mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 04:59:36 +08:00
修改了对应的bug
This commit is contained in:
parent
9a3d01fbf3
commit
c4babf61ea
@ -137,7 +137,9 @@ public class CustomerController extends BaseController {
|
||||
Tenant tenant = tenantService.selectTenantById(tenantId);
|
||||
customer1.setTenantName(tenant.getName());
|
||||
Building building = buildingService.selectBuildingById(customer1.getBuildingId());
|
||||
customer1.setBuildingName(building.getBuildingName());
|
||||
if (null != building){
|
||||
customer1.setBuildingName(building.getBuildingName());
|
||||
}
|
||||
|
||||
}
|
||||
return result(customers);
|
||||
|
@ -126,17 +126,17 @@ public class CustomerStaffController extends BaseController {
|
||||
/**
|
||||
* 查询企业员工列表
|
||||
*/
|
||||
// @RequiresPermissions("admin:staff:list")
|
||||
// @GetMapping("list")
|
||||
// public R list(IcsCustomerStaff icsCustomerStaff) {
|
||||
// startPage();
|
||||
// String customerId = icsCustomerStaff.getCustomerId();
|
||||
// if (customerId != null && !"".equals(customerId)) {
|
||||
// icsCustomerStaff.setIcsCustomerId(Long.valueOf(customerId));
|
||||
// }
|
||||
// icsCustomerStaff.setDataType(Constants.CUSTOMER_VISIT);
|
||||
// return result(icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff));
|
||||
// }
|
||||
@Ignore
|
||||
@GetMapping("list")
|
||||
public R list(IcsCustomerStaff icsCustomerStaff) {
|
||||
startPage();
|
||||
String customerId = icsCustomerStaff.getCustomerId();
|
||||
if (customerId != null && !"".equals(customerId)) {
|
||||
icsCustomerStaff.setIcsCustomerId(Long.valueOf(customerId));
|
||||
}
|
||||
icsCustomerStaff.setDataType(Constants.CUSTOMER_VISIT);
|
||||
return result(icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -210,7 +210,7 @@ public class CustomerStaffController extends BaseController {
|
||||
userEquipment.setEndDate(customer.getEndDate());
|
||||
|
||||
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment);
|
||||
if (CollUtil.isEmpty(equipments)){
|
||||
if (CollUtil.isEmpty(equipments)) {
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
}
|
||||
@ -244,7 +244,7 @@ public class CustomerStaffController extends BaseController {
|
||||
//根据设备id获取设备
|
||||
Equipment equipment = equipmentService.selectEquipmentById(roomEquipment.getEquipmentId());
|
||||
if (equipment != null) {
|
||||
String persons = DeviceUtils.queryPersons(equipment.getIp(),String.valueOf(customerStaff.getId()));
|
||||
String persons = DeviceUtils.queryPersons(equipment.getIp(), String.valueOf(customerStaff.getId()));
|
||||
JSONObject jsonObject = JSONUtil.parseObj(persons);
|
||||
Integer amount = (Integer) jsonObject.get("amount");
|
||||
if (amount <= 0) {
|
||||
@ -268,10 +268,10 @@ public class CustomerStaffController extends BaseController {
|
||||
devicePersonDto.setFaces(facesDtos);
|
||||
String s = DeviceUtils.addPersons(equipment.getIp(), devicePersonDto);
|
||||
log.info("添加人员返回结果:" + s);
|
||||
}else {
|
||||
} else {
|
||||
//更新用户信息
|
||||
if (icsCustomerStaff.getPhoto() != null) {
|
||||
if (!icsCustomerStaff.getPhoto().equals(customer.getPhone())){
|
||||
if (!icsCustomerStaff.getPhoto().equals(customer.getPhone())) {
|
||||
DevicePersonDto devicePersonDto = new DevicePersonDto();
|
||||
devicePersonDto.setPersonId(String.valueOf(customerStaff.getId()));
|
||||
ArrayList<FacesDto> facesDtos = new ArrayList<>();
|
||||
@ -282,7 +282,7 @@ public class CustomerStaffController extends BaseController {
|
||||
facesDto.setFaceId(String.valueOf(customerStaff.getId()));
|
||||
facesDtos.add(facesDto);
|
||||
devicePersonDto.setFaces(facesDtos);
|
||||
DeviceUtils.modifyFaces(equipment.getIp(),devicePersonDto);
|
||||
DeviceUtils.modifyFaces(equipment.getIp(), devicePersonDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -325,8 +325,46 @@ public class CustomerStaffController extends BaseController {
|
||||
@Ignore
|
||||
@PostMapping("updateStaffByCustomer")
|
||||
public R updateStaffByCustomer(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
||||
StaffCustomer staffCustomer = staffCustomerService.selectStaffIdAndCustomerId(icsCustomerStaff.getIcsCustomerId(),icsCustomerStaff.getId());
|
||||
return toAjax(staffCustomerService.deleteStaffCustomerById(staffCustomer.getId()));
|
||||
StaffCustomer staffCustomer = staffCustomerService.selectStaffIdAndCustomerId(icsCustomerStaff.getIcsCustomerId(), icsCustomerStaff.getId());
|
||||
int i = staffCustomerService.deleteStaffCustomerById(staffCustomer.getId());
|
||||
Assert.isTrue(i > 0, "删除失败");
|
||||
//删除用户与设备
|
||||
Long icsCustomerId = icsCustomerStaff.getIcsCustomerId();
|
||||
ArrayList<Long> ids = new ArrayList<>();
|
||||
|
||||
//查询对应的企业
|
||||
Customer customer = customerService.selectCustomerById(icsCustomerId);
|
||||
|
||||
|
||||
if (null != customer) {
|
||||
String roomId = customer.getRoomId();
|
||||
List<String> roomIds = StrUtil.split(roomId, ',');
|
||||
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||
//获取了房间集合,循环对应集合,
|
||||
for (Long id : collect) {
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectByRoomId(id);
|
||||
if (null != roomEquipment) {
|
||||
ids.add(roomEquipment.getEquipmentId());
|
||||
}
|
||||
List<DetailEquipment> detailEquipments = detailEquipmentService.selectByRoomId(id);
|
||||
if (CollUtil.isNotEmpty(detailEquipments)) {
|
||||
for (DetailEquipment detailEquipment : detailEquipments) {
|
||||
ids.add(detailEquipment.getEquipmentId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
for (Long id : ids) {
|
||||
int i1 = userEquipmentService.deleteUserEquipmentByUserId(icsCustomerStaff.getId(), id);
|
||||
//删除设备的用户
|
||||
Equipment equipment = equipmentService.selectEquipmentById(id);
|
||||
if (equipment !=null){
|
||||
DeviceUtils.deletePersons(equipment.getIp(),icsCustomerStaff.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -352,7 +390,7 @@ public class CustomerStaffController extends BaseController {
|
||||
//获取设备数量
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setUserId(customerStaff.getId());
|
||||
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment);
|
||||
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentNum(userEquipment);
|
||||
customerStaff.setNum(equipments.size());
|
||||
|
||||
}
|
||||
@ -362,7 +400,7 @@ public class CustomerStaffController extends BaseController {
|
||||
// @RequiresPermissions("admin:staff:import")
|
||||
@Ignore
|
||||
@PostMapping("/importData")
|
||||
public R importData(MultipartFile file) throws Exception {
|
||||
public R importData(MultipartFile file,Long customerId) throws Exception {
|
||||
// }
|
||||
ExcelUtil<IcsCustomerStaff> util = new ExcelUtil<IcsCustomerStaff>(IcsCustomerStaff.class);
|
||||
List<IcsCustomerStaff> userList = util.importExcel(file.getInputStream());
|
||||
@ -383,7 +421,7 @@ public class CustomerStaffController extends BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
String message = icsCustomerStaffService.importCustomerStaff(userList);
|
||||
String message = icsCustomerStaffService.importCustomerStaff(userList,customerId);
|
||||
return R.data(message);
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ package com.ics.admin.controller;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.Park;
|
||||
import com.ics.admin.service.IParkService;
|
||||
import com.ics.common.core.controller.BaseController;
|
||||
@ -9,11 +10,14 @@ import com.ics.common.core.domain.R;
|
||||
import com.ics.common.utils.DateUtils;
|
||||
import com.ics.common.utils.ValidatorUtils;
|
||||
import com.ics.system.domain.Dept;
|
||||
import com.ics.system.domain.User;
|
||||
import com.ics.system.service.ICurrentUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.Logical;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
import org.wf.jwtp.util.SubjectUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -31,7 +35,8 @@ public class ParkController extends BaseController {
|
||||
@Autowired
|
||||
private IParkService parkService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private ICurrentUserService currentUserService;
|
||||
/**
|
||||
* 查询园区管理
|
||||
*/
|
||||
@ -57,6 +62,14 @@ public class ParkController extends BaseController {
|
||||
@GetMapping("list")
|
||||
public R list(Park park) {
|
||||
startPage();
|
||||
boolean isAdmin = SubjectUtil.hasRole(getRequest(),"manager");
|
||||
if (isAdmin){
|
||||
Long parkId = currentUserService.getParkId();
|
||||
Long tenantId = currentUserService.getTenantId();
|
||||
park.setId(parkId);
|
||||
park.setTenantId(tenantId);
|
||||
}
|
||||
|
||||
return result(parkService.selectParkList(park));
|
||||
}
|
||||
|
||||
|
@ -143,17 +143,20 @@ public class EquipmentController extends BaseController {
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectByEquipmentId(equipment2.getId());
|
||||
if (roomEquipment != null) {
|
||||
Room room = roomService.selectRoomById(roomEquipment.getRoomId());
|
||||
equipment2.setRoomId(room.getId());
|
||||
equipment2.setBuildId(room.getBuildingDetailId());
|
||||
equipment2.setRoomName(room.getName());
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
if (buildingDetail != null) {
|
||||
equipment2.setBuildName(buildingDetail.getFloorName());
|
||||
if (room !=null){
|
||||
equipment2.setRoomId(room.getId());
|
||||
equipment2.setBuildId(room.getBuildingDetailId());
|
||||
equipment2.setRoomName(room.getName());
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||
if (buildingDetail != null) {
|
||||
equipment2.setBuildName(buildingDetail.getFloorName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(equipment2.getId());
|
||||
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment);
|
||||
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentNumByUserId(userEquipment);
|
||||
equipment2.setPersonCount(equipments.size());
|
||||
}
|
||||
return result(equipment1);
|
||||
@ -365,7 +368,7 @@ public class EquipmentController extends BaseController {
|
||||
customerStaff.setIcsCustomerId(customer.getId());
|
||||
}
|
||||
}
|
||||
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectIcsCustomerStaffList(customerStaff);
|
||||
List<IcsCustomerStaff> icsCustomerStaffs = staffService.getUserList(customerStaff);
|
||||
|
||||
for (IcsCustomerStaff icsCustomerStaff : icsCustomerStaffs) {
|
||||
List<StaffCustomer> staffCustomers = staffCustomerService.selectStaffCustomerByStaffId(icsCustomerStaff.getId());
|
||||
|
@ -4,9 +4,13 @@ import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.ics.admin.domain.*;
|
||||
import com.ics.admin.domain.meeting.CustomerTicket;
|
||||
import com.ics.admin.domain.meeting.RoomContent;
|
||||
import com.ics.admin.domain.meeting.Ticket;
|
||||
import com.ics.admin.service.*;
|
||||
import com.ics.admin.service.meeting.ICustomerTicketService;
|
||||
import com.ics.admin.service.meeting.IRoomContentService;
|
||||
import com.ics.admin.service.meeting.ITicketService;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import com.ics.system.domain.Tenant;
|
||||
import com.ics.system.domain.User;
|
||||
@ -79,6 +83,12 @@ public class ReservationController extends BaseController {
|
||||
@Autowired
|
||||
private IBuildingDetailService buildingDetailService;
|
||||
|
||||
@Autowired
|
||||
private ITicketService ticketService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerTicketService customerTicketService;
|
||||
|
||||
/**
|
||||
* 查询预约记录
|
||||
*/
|
||||
@ -112,6 +122,10 @@ public class ReservationController extends BaseController {
|
||||
reservation.setParkName(park.getName());
|
||||
}
|
||||
|
||||
Ticket ticket = ticketService.selectTicketById(reservation.getTicketId());
|
||||
if (ticket !=null){
|
||||
reservation.setTicketName(ticket.getTitle());
|
||||
}
|
||||
|
||||
Tenant tenant = tenantService.selectTenantById(reservation.getTenantId());
|
||||
if (tenant !=null ){
|
||||
@ -214,6 +228,20 @@ public class ReservationController extends BaseController {
|
||||
|
||||
if (reservation.getCancelResaon() !=null){
|
||||
reservation.setCancelResaon("管理员取消原因为:"+reservation.getCancelResaon());
|
||||
|
||||
Long ticketId = reservation.getTicketId();
|
||||
if (ticketId !=null){
|
||||
Ticket ticket = ticketService.selectTicketById(ticketId);
|
||||
if (ticket != null){
|
||||
Long customerId = reservation.getCustomerId();
|
||||
CustomerTicket customerTicket = new CustomerTicket();
|
||||
customerTicket.setTicketId(ticketId);
|
||||
customerTicket.setCustomerId(customerId);
|
||||
customerTicket.setType(ticket.getType());
|
||||
customerTicket.setIsVerification(0);
|
||||
int i1 = customerTicketService.insertCustomerTicket(customerTicket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return toAjax(reservationService.updateReservation(reservation));
|
||||
|
@ -110,14 +110,19 @@ public class RoomContentController extends BaseController {
|
||||
}
|
||||
boolean b = SubjectUtil.hasRole(getRequest(),"admin");
|
||||
if (b){
|
||||
User user = userService.selectUserById(getCurrentUserId());
|
||||
if (null != user.getCustomerId()){
|
||||
Customer customer = customerService.selectCustomerById(user.getCustomerId());
|
||||
String roomId = customer.getRoomId();
|
||||
List<String> roomIds = StrUtil.split(roomId, ',');
|
||||
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||
roomContent.setRoomIds(collect);
|
||||
}
|
||||
Long parkId = currentUserService.getParkId();
|
||||
Long tenantId = currentUserService.getTenantId();
|
||||
roomContent.setParkId(parkId);
|
||||
roomContent.setTenantId(tenantId);
|
||||
|
||||
// User user = userService.selectUserById(getCurrentUserId());
|
||||
// if (null != user.getCustomerId()){
|
||||
// Customer customer = customerService.selectCustomerById(user.getCustomerId());
|
||||
// String roomId = customer.getRoomId();
|
||||
// List<String> roomIds = StrUtil.split(roomId, ',');
|
||||
// List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||
// roomContent.setRoomIds(collect);
|
||||
// }
|
||||
}
|
||||
List<RoomContent> roomContents = roomContentService.selectRoomContentList(roomContent);
|
||||
for (RoomContent content : roomContents) {
|
||||
@ -251,10 +256,14 @@ public class RoomContentController extends BaseController {
|
||||
room.setDeleteFlag(0);
|
||||
room.setBuildingDetailId(room.getBuildingDetailId());
|
||||
List<Room> rooms = roomService.selectRoomList(room);
|
||||
if (room.getId() != null ){
|
||||
Room room1 = roomService.selectRoomById(room.getId());
|
||||
rooms.add(room1);
|
||||
|
||||
if (room.getType() !=null){
|
||||
if (room.getId() != null ){
|
||||
Room room1 = roomService.selectRoomById(room.getId());
|
||||
rooms.add(room1);
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok().put("data",rooms);
|
||||
}
|
||||
@Ignore
|
||||
@ -287,7 +296,8 @@ public class RoomContentController extends BaseController {
|
||||
return R.data(customers);
|
||||
}
|
||||
|
||||
@RequiresPermissions("meeting:roomContent:list")
|
||||
@Ignore
|
||||
// @RequiresPermissions("meeting:roomContent:list")
|
||||
@GetMapping("/roomContentList")
|
||||
public R roomContentList(RoomContent roomContent) {
|
||||
|
||||
@ -308,14 +318,20 @@ public class RoomContentController extends BaseController {
|
||||
}
|
||||
boolean b = SubjectUtil.hasRole(getRequest(),"admin");
|
||||
if (b){
|
||||
User user = userService.selectUserById(getCurrentUserId());
|
||||
if (null != user.getCustomerId()){
|
||||
Customer customer = customerService.selectCustomerById(user.getCustomerId());
|
||||
String roomId = customer.getRoomId();
|
||||
List<String> roomIds = StrUtil.split(roomId, ',');
|
||||
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||
roomContent.setRoomIds(collect);
|
||||
}
|
||||
|
||||
Long parkId = currentUserService.getParkId();
|
||||
Long tenantId = currentUserService.getTenantId();
|
||||
roomContent.setParkId(parkId);
|
||||
roomContent.setTenantId(tenantId);
|
||||
|
||||
// User user = userService.selectUserById(getCurrentUserId());
|
||||
// if (null != user.getCustomerId()){
|
||||
// Customer customer = customerService.selectCustomerById(user.getCustomerId());
|
||||
// String roomId = customer.getRoomId();
|
||||
// List<String> roomIds = StrUtil.split(roomId, ',');
|
||||
// List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||
// roomContent.setRoomIds(collect);
|
||||
// }
|
||||
}
|
||||
return R.data(roomContentService.selectRoomContentList(roomContent));
|
||||
}
|
||||
|
@ -74,9 +74,6 @@ public class TicketController extends BaseController {
|
||||
List<CustomerTicket> customerTickets = customerTicketService.selectListByTicketId(id);
|
||||
Optional<CustomerTicket> min = customerTickets.stream()
|
||||
.min(Comparator.comparing(CustomerTicket::getNum));
|
||||
if (ticket.getType() == 1){
|
||||
ticket.setNum(min.get().getNum());
|
||||
}
|
||||
Map<Long, CustomerTicket> customerMap = customerTickets.stream().collect(Collectors.toMap(CustomerTicket::getCustomerId, Function.identity()));
|
||||
for (Customer customer : customers) {
|
||||
//根据外层遍历的学信息id get学生住宿信息Map中的Key
|
||||
@ -165,6 +162,7 @@ public class TicketController extends BaseController {
|
||||
@RequiresPermissions("meeting:ticket:edit")
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody Ticket ticket) {
|
||||
// ticket.get
|
||||
int i = ticketService.updateTicket(ticket);
|
||||
Assert.isTrue(i == 1, "修改失败");
|
||||
//修改企业和优惠卷数据 如果类型是 抵用卷,循环添加,如果是优惠卷,添加一条
|
||||
@ -172,48 +170,51 @@ public class TicketController extends BaseController {
|
||||
CustomerTicket customerTicket = customerTicketService.selectCustomerTicketById(ticket.getId());
|
||||
if (customerTicket ==null){
|
||||
if (ticket.getType() == 1) {
|
||||
for (TicketCustomerVo ticketCustomerVo : ticket.getTicketCustomerVo()) {
|
||||
if (ticket.getTicketCustomerVo() != null){
|
||||
for (TicketCustomerVo ticketCustomerVo : ticket.getTicketCustomerVo()) {
|
||||
|
||||
//查询出所有的 id
|
||||
CustomerTicket customerTicket2 = new CustomerTicket();
|
||||
customerTicket2.setTicketId(ticket.getId());
|
||||
customerTicket2.setCustomerId(ticketCustomerVo.getId());
|
||||
customerTicket2.setIsVerification(0);
|
||||
List<CustomerTicket> customerTickets = customerTicketService.selectCustomerTicketList(customerTicket2);
|
||||
List<Long> collect = customerTickets.stream().map(CustomerTicket::getId).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(collect)){
|
||||
String ids = CollUtil.join(collect, ",");
|
||||
//查询出所有的 id
|
||||
CustomerTicket customerTicket2 = new CustomerTicket();
|
||||
customerTicket2.setTicketId(ticket.getId());
|
||||
customerTicket2.setCustomerId(ticketCustomerVo.getId());
|
||||
customerTicket2.setIsVerification(0);
|
||||
List<CustomerTicket> customerTickets = customerTicketService.selectCustomerTicketList(customerTicket2);
|
||||
List<Long> collect = customerTickets.stream().map(CustomerTicket::getId).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(collect)){
|
||||
String ids = CollUtil.join(collect, ",");
|
||||
|
||||
int i1 = customerTicketService.deleteCustomerTicketByIds(ids);
|
||||
int i1 = customerTicketService.deleteCustomerTicketByIds(ids);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int j = 0; j < ticketCustomerVo.getSumNum(); j++) {
|
||||
CustomerTicket customerTicket1 = new CustomerTicket();
|
||||
customerTicket1.setTicketId(ticket.getId());
|
||||
customerTicket1.setCustomerId(ticketCustomerVo.getId());
|
||||
customerTicket1.setIsVerification(0);
|
||||
customerTicket1.setType(ticket.getType());
|
||||
customerTicketService.insertCustomerTicket(customerTicket1);
|
||||
for (int j = 0; j < ticketCustomerVo.getSumNum(); j++) {
|
||||
CustomerTicket customerTicket1 = new CustomerTicket();
|
||||
customerTicket1.setTicketId(ticket.getId());
|
||||
customerTicket1.setCustomerId(ticketCustomerVo.getId());
|
||||
customerTicket1.setIsVerification(0);
|
||||
customerTicket1.setType(ticket.getType());
|
||||
customerTicketService.insertCustomerTicket(customerTicket1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
for (TicketCustomerVo ticketCustomerVo : ticket.getTicketCustomerVo()) {
|
||||
if (ticket.getTicketCustomerVo()!=null){
|
||||
for (TicketCustomerVo ticketCustomerVo : ticket.getTicketCustomerVo()) {
|
||||
for (int j = 0; j < ticketCustomerVo.getSumNum(); j++) {
|
||||
CustomerTicket customerTicket1 = new CustomerTicket();
|
||||
customerTicket1.setTicketId(ticket.getId());
|
||||
customerTicket1.setCustomerId(ticketCustomerVo.getId());
|
||||
customerTicket1.setIsVerification(0);
|
||||
customerTicket1.setType(ticket.getType());
|
||||
customerTicketService.insertCustomerTicket(customerTicket1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
for (int j = 0; j < ticketCustomerVo.getSumNum(); j++) {
|
||||
CustomerTicket customerTicket1 = new CustomerTicket();
|
||||
customerTicket1.setTicketId(ticket.getId());
|
||||
customerTicket1.setCustomerId(ticketCustomerVo.getId());
|
||||
customerTicket1.setIsVerification(0);
|
||||
customerTicket1.setType(ticket.getType());
|
||||
customerTicketService.insertCustomerTicket(customerTicket1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -253,13 +253,13 @@ public class VisitorPersonController extends BaseController {
|
||||
@PostMapping("update")
|
||||
public R editSave(@RequestBody VisitorPerson visitorPerson) {
|
||||
|
||||
if (null != visitorPerson.getStatus()) {
|
||||
Long loginCustomerId = this.getLoginCustomerId();
|
||||
|
||||
if (loginCustomerId != null) {
|
||||
visitorPerson.setReviewersTime(new Date());
|
||||
}
|
||||
}
|
||||
// if (null != visitorPerson.getStatus()) {
|
||||
// Long loginCustomerId = this.getLoginCustomerId();
|
||||
//
|
||||
// if (loginCustomerId != null) {
|
||||
// visitorPerson.setReviewersTime(new Date());
|
||||
// }
|
||||
// }
|
||||
|
||||
if (visitorPerson.getStatus() == 1){
|
||||
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
||||
@ -313,6 +313,9 @@ public class VisitorPersonController extends BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if (visitorPerson.getStatus() == 2){
|
||||
//如果状态为2
|
||||
//则删除设备中的人员信息
|
||||
}
|
||||
|
||||
|
||||
|
@ -61,7 +61,6 @@ public class Ticket extends BaseEntity<Ticket> {
|
||||
@TableField(exist = false)
|
||||
private Long[] enterpriseIds;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer num;
|
||||
|
||||
@TableField(exist = false)
|
||||
|
@ -74,4 +74,7 @@ public interface IcsCustomerStaffMapper extends BaseMapper<IcsCustomerStaff> {
|
||||
int updateByCustomer(IcsCustomerStaff customerStaff);
|
||||
|
||||
IcsCustomerStaff selectUserByMobile(String mobile);
|
||||
|
||||
List<IcsCustomerStaff> getUserList(IcsCustomerStaff customerStaff);
|
||||
|
||||
}
|
||||
|
@ -83,5 +83,8 @@ public interface IIcsCustomerStaffService extends IService<IcsCustomerStaff> {
|
||||
|
||||
List<IcsCustomerStaff> selectCustomerStaffList(IcsCustomerStaff icsCustomerStaff);
|
||||
|
||||
String importCustomerStaff(List<IcsCustomerStaff> userList);
|
||||
String importCustomerStaff(List<IcsCustomerStaff> userList,Long customerId);
|
||||
|
||||
List<IcsCustomerStaff> getUserList(IcsCustomerStaff customerStaff);
|
||||
|
||||
}
|
||||
|
@ -1,19 +1,35 @@
|
||||
package com.ics.admin.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.aliyun.oss.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ics.admin.domain.Customer;
|
||||
import com.ics.admin.domain.Room;
|
||||
import com.ics.admin.domain.meeting.DetailEquipment;
|
||||
import com.ics.admin.domain.meeting.RoomEquipment;
|
||||
import com.ics.admin.domain.meeting.StaffCustomer;
|
||||
import com.ics.admin.domain.meeting.UserEquipment;
|
||||
import com.ics.admin.mapper.IcsCustomerStaffMapper;
|
||||
import com.ics.admin.service.ICustomerService;
|
||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||
import com.ics.admin.service.IRoomService;
|
||||
import com.ics.admin.service.meeting.IDetailEquipmentService;
|
||||
import com.ics.admin.service.meeting.IRoomEquipmentService;
|
||||
import com.ics.admin.service.meeting.IStaffCustomerService;
|
||||
import com.ics.admin.service.meeting.IUserEquipmentService;
|
||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||
import com.ics.common.utils.StringUtils;
|
||||
import com.ics.system.domain.User;
|
||||
import com.ics.system.mapper.UserMapper;
|
||||
import com.ics.system.service.ICurrentUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 企业员工Service业务层处理
|
||||
@ -29,6 +45,26 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
@Autowired
|
||||
private UserMapper userMapper;
|
||||
|
||||
@Autowired
|
||||
private IStaffCustomerService staffCustomerService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerService customerService;
|
||||
@Autowired
|
||||
private IRoomService roomService;
|
||||
|
||||
@Autowired
|
||||
private ICurrentUserService currentUserService;
|
||||
|
||||
@Autowired
|
||||
private IRoomEquipmentService roomEquipmentService;
|
||||
|
||||
@Autowired
|
||||
private IDetailEquipmentService detailEquipmentService;
|
||||
@Autowired
|
||||
private IUserEquipmentService userEquipmentService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询企业员工
|
||||
*
|
||||
@ -82,7 +118,7 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
*/
|
||||
@Override
|
||||
public int deleteIcsCustomerStaffByIds(String ids) {
|
||||
String[] idsArray = StringUtils.split(ids,",");
|
||||
String[] idsArray = StringUtils.split(ids, ",");
|
||||
return icsCustomerStaffMapper.deleteBatchIds(CollUtil.toList(idsArray));
|
||||
}
|
||||
|
||||
@ -97,7 +133,7 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
return icsCustomerStaffMapper.deleteIcsCustomerStaffById(id);
|
||||
}
|
||||
|
||||
public String checkMobileUnique(String mobile){
|
||||
public String checkMobileUnique(String mobile) {
|
||||
return icsCustomerStaffMapper.checkMobileUnique(mobile);
|
||||
}
|
||||
|
||||
@ -119,7 +155,7 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
public List<IcsCustomerStaff> selectListByUserIds(List<Long> userIds) {
|
||||
|
||||
QueryWrapper<IcsCustomerStaff> objectQueryWrapper = new QueryWrapper<>();
|
||||
objectQueryWrapper.in("id",userIds);
|
||||
objectQueryWrapper.in(CollUtil.isNotEmpty(userIds), "id", userIds);
|
||||
return icsCustomerStaffMapper.selectList(objectQueryWrapper);
|
||||
}
|
||||
|
||||
@ -134,12 +170,12 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
|
||||
@Override
|
||||
public List<IcsCustomerStaff> getStaffListByUser(IcsCustomerStaff icsCustomerStaff) {
|
||||
List<Long> list =userMapper.getStaffListByUser();
|
||||
List<Long> list = userMapper.getStaffListByUser();
|
||||
System.out.println(list);
|
||||
|
||||
QueryWrapper<IcsCustomerStaff> wrapper = new QueryWrapper<>();
|
||||
|
||||
wrapper.notIn(CollUtil.isNotEmpty(list),"id",list);
|
||||
wrapper.notIn(CollUtil.isNotEmpty(list), "id", list);
|
||||
|
||||
return icsCustomerStaffMapper.selectList(wrapper);
|
||||
}
|
||||
@ -148,7 +184,7 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
public IcsCustomerStaff selectByPhone(String mobile) {
|
||||
QueryWrapper<IcsCustomerStaff> wrapper = new QueryWrapper<>();
|
||||
|
||||
wrapper.eq("mobile",mobile);
|
||||
wrapper.eq("mobile", mobile);
|
||||
|
||||
return icsCustomerStaffMapper.selectOne(wrapper);
|
||||
}
|
||||
@ -156,7 +192,7 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
@Override
|
||||
public int updateByCustomer(IcsCustomerStaff customerStaff) {
|
||||
|
||||
return icsCustomerStaffMapper.updateByCustomer(customerStaff);
|
||||
return icsCustomerStaffMapper.updateByCustomer(customerStaff);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -166,55 +202,126 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
||||
}
|
||||
|
||||
@Override
|
||||
public String importCustomerStaff(List<IcsCustomerStaff> userList) {
|
||||
public String importCustomerStaff(List<IcsCustomerStaff> userList,Long customerId) {
|
||||
|
||||
if (StringUtils.isNull(userList) || userList.size() == 0)
|
||||
{
|
||||
if (StringUtils.isNull(userList) || userList.size() == 0) {
|
||||
throw new ServiceException("导入用户数据不能为空!");
|
||||
}
|
||||
int successNum = 0;
|
||||
int failureNum = 0;
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
for (IcsCustomerStaff user : userList)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (IcsCustomerStaff user : userList) {
|
||||
try {
|
||||
// 验证是否存在这个用户
|
||||
IcsCustomerStaff u = icsCustomerStaffMapper.selectUserByMobile(user.getMobile());
|
||||
if (StringUtils.isNull(u))
|
||||
{
|
||||
if (StringUtils.isNull(u)) {
|
||||
user.setCardNo("0");
|
||||
user.setDataType("1");
|
||||
user.setGender(user.getGender().equals("男") ? "0" : "1");
|
||||
icsCustomerStaffMapper.insert(user);
|
||||
int insert = icsCustomerStaffMapper.insert(user);
|
||||
if (insert > 0) {
|
||||
StaffCustomer staffCustomer =new StaffCustomer();
|
||||
staffCustomer.setStaffId(user.getId());
|
||||
staffCustomer.setIcsCustomerId(customerId);
|
||||
StaffCustomer staffCustomer1 = staffCustomerService.selectStaffIdAndCustomerId(customerId, user.getId());
|
||||
if (staffCustomer1 == null) {
|
||||
staffCustomerService.insertStaffCustomer(staffCustomer);
|
||||
}
|
||||
//根据用户添加对应企业设备
|
||||
queryDeviceByCustomerId(customerId,user.getId());
|
||||
}
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、账号 " + user.getName() + " 导入成功");
|
||||
}
|
||||
} else {
|
||||
u.setCardNo("0");
|
||||
u.setDataType("1");
|
||||
u.setGender(user.getGender().equals("男") ? "0" : "1");
|
||||
u.setUsername(user.getUsername());
|
||||
u.setName(user.getName());
|
||||
u.setAddress(user.getAddress());
|
||||
u.setEmail(user.getEmail());
|
||||
u.setDegree(user.getDegree());
|
||||
u.setUrgent(user.getUrgent());
|
||||
int insert = updateByCustomer(u);
|
||||
StaffCustomer staffCustomer =new StaffCustomer();
|
||||
staffCustomer.setStaffId(u.getId());
|
||||
staffCustomer.setIcsCustomerId(customerId);
|
||||
|
||||
StaffCustomer staffCustomer1 = staffCustomerService.selectStaffIdAndCustomerId(customerId, u.getId());
|
||||
if (staffCustomer1 == null) {
|
||||
staffCustomerService.insertStaffCustomer(staffCustomer);
|
||||
//根据用户添加对应企业设备
|
||||
queryDeviceByCustomerId(customerId,u.getId());
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、账号 " + user.getName() + " 已更新");
|
||||
}else {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + successNum + "、账号 " + user.getName() + "已经存在");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + failureNum + "、账号 " + user.getName() + " 已存在");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、账号 " + user.getName() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
}
|
||||
if (failureNum > 0)
|
||||
{
|
||||
if (failureNum > 0) {
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
throw new RuntimeException(failureMsg.toString());
|
||||
} else {
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IcsCustomerStaff> getUserList(IcsCustomerStaff customerStaff) {
|
||||
|
||||
return icsCustomerStaffMapper.getUserList(customerStaff);
|
||||
}
|
||||
|
||||
//根据企业查询对应的设备
|
||||
public void queryDeviceByCustomerId(Long customerId,Long userId){
|
||||
ArrayList<Long> ids = new ArrayList<>();
|
||||
|
||||
Customer customer = customerService.selectCustomerById(customerId);
|
||||
//根据企业 查询对应的 房间,和对应的楼层
|
||||
String roomId = customer.getRoomId();
|
||||
List<String> roomIds = StrUtil.split(roomId, ',');
|
||||
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||
for (Long roomid : collect) {
|
||||
Room room = roomService.selectRoomById(roomid);
|
||||
if (null != room) {
|
||||
Long id = room.getId();
|
||||
RoomEquipment roomEquipment = roomEquipmentService.selectByRoomId(id);
|
||||
if (null != roomEquipment) {
|
||||
ids.add(roomEquipment.getEquipmentId());
|
||||
}
|
||||
List<DetailEquipment> detailEquipments = detailEquipmentService.selectByRoomId(id);
|
||||
if (CollUtil.isNotEmpty(detailEquipments)) {
|
||||
for (DetailEquipment detailEquipment : detailEquipments) {
|
||||
ids.add(detailEquipment.getEquipmentId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//根据设备id
|
||||
for (Long id : ids) {
|
||||
UserEquipment userEquipment = new UserEquipment();
|
||||
userEquipment.setEquipmentId(id);
|
||||
userEquipment.setUserId(userId);
|
||||
userEquipment.setStartTime(customer.getStartDate());
|
||||
userEquipment.setEndDate(customer.getEndDate());
|
||||
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment);
|
||||
if (CollUtil.isEmpty(equipments)) {
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
|
||||
public List<Ticket> selectTicketList(Ticket ticket) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(ticket.getParkId() !=null,"park_id", ticket.getParkId());
|
||||
queryWrapper.eq(ticket.getTitle() !=null,"title", ticket.getTitle());
|
||||
queryWrapper.eq(ticket.getTenantId() !=null,"tenant_id", ticket.getTenantId());
|
||||
|
||||
return ticketMapper.selectList(queryWrapper);
|
||||
|
@ -232,6 +232,7 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
public int deleteUserEquipmentByUserId(Long userId,Long deviceId) {
|
||||
UpdateWrapper<UserEquipment> wrapper = new UpdateWrapper<>();
|
||||
wrapper.eq("user_id", userId);
|
||||
wrapper.eq("equipment_id", deviceId);
|
||||
return userEquipmentMapper.delete(wrapper);
|
||||
}
|
||||
|
||||
@ -242,6 +243,32 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
||||
return userEquipmentMapper.selectCount(wrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserEquipment> selectUserEquipmentNum(UserEquipment userEquipment) {
|
||||
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(null != userEquipment.getEquipmentId(),"equipment_id",userEquipment.getEquipmentId());
|
||||
queryWrapper.eq(null != userEquipment.getUserId(),"user_id",userEquipment.getUserId());
|
||||
queryWrapper.eq(null != userEquipment.getStartTime(),"start_time",userEquipment.getStartTime());
|
||||
queryWrapper.eq(null != userEquipment.getEndDate(),"end_date",userEquipment.getEndDate());
|
||||
queryWrapper.in(CollUtil.isNotEmpty(userEquipment.getUserIds()),"user_id",userEquipment.getUserIds());
|
||||
queryWrapper.groupBy("equipment_id");
|
||||
return userEquipmentMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserEquipment> selectUserEquipmentNumByUserId(UserEquipment userEquipment) {
|
||||
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(null != userEquipment.getEquipmentId(),"equipment_id",userEquipment.getEquipmentId());
|
||||
queryWrapper.eq(null != userEquipment.getUserId(),"user_id",userEquipment.getUserId());
|
||||
queryWrapper.eq(null != userEquipment.getStartTime(),"start_time",userEquipment.getStartTime());
|
||||
queryWrapper.eq(null != userEquipment.getEndDate(),"end_date",userEquipment.getEndDate());
|
||||
queryWrapper.in(CollUtil.isNotEmpty(userEquipment.getUserIds()),"user_id",userEquipment.getUserIds());
|
||||
queryWrapper.groupBy("user_id");
|
||||
return userEquipmentMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
public void updateDeviceDataSource(List<Equipment> equipments) {
|
||||
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
|
||||
|
@ -116,7 +116,6 @@ public class CustomerTicketServiceImpl extends ServiceImpl<CustomerTicketMapper,
|
||||
if (roomContent.getIsTicket() == 1){
|
||||
return new ArrayList<CustomerTicket>();
|
||||
}
|
||||
|
||||
List<CustomerTicket> customerTickets = customerTicketMapper.selectListByCustomerId(userCustomerVo);
|
||||
|
||||
for (CustomerTicket customerTicket : customerTickets) {
|
||||
@ -129,6 +128,9 @@ public class CustomerTicketServiceImpl extends ServiceImpl<CustomerTicketMapper,
|
||||
customerTicket.setDuration(ticket.getDuration());
|
||||
customerTicket.setType(ticket.getType());
|
||||
customerTicket.setDiscount(ticket.getDiscount());
|
||||
int i = customerTicketMapper.selectByTicketIdAndCustomer(customerTicket.getTicketId(), customerTicket.getCustomerId());
|
||||
customerTicket.setNum(i);
|
||||
|
||||
}
|
||||
return customerTickets;
|
||||
}
|
||||
@ -138,6 +140,7 @@ public class CustomerTicketServiceImpl extends ServiceImpl<CustomerTicketMapper,
|
||||
QueryWrapper<CustomerTicket> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("customer_id", customerTicket.getCustomerId());
|
||||
wrapper.eq("ticket_id", customerTicket.getTicketId());
|
||||
wrapper.eq("is_verification", 0);
|
||||
wrapper.groupBy("ticket_id");
|
||||
CustomerTicket customerTicket1 = customerTicketMapper.selectOne(wrapper);
|
||||
customerTicket1.setStaffId(customerTicket.getStaffId());
|
||||
|
@ -13,6 +13,8 @@ import com.ics.admin.domain.meeting.RoomRecord;
|
||||
import com.ics.admin.mapper.RoomMapper;
|
||||
import com.ics.admin.mapper.meeting.RoomRecordMapper;
|
||||
import com.ics.admin.service.meeting.IVisitorPersonService;
|
||||
import com.ics.system.domain.User;
|
||||
import com.ics.system.service.IUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ics.admin.mapper.meeting.VisitorPersonMapper;
|
||||
@ -33,6 +35,9 @@ public class IVisitorPersonServiceImpl extends ServiceImpl<VisitorPersonMapper,
|
||||
@Autowired
|
||||
private RoomRecordMapper roomRecordMapper;
|
||||
|
||||
@Autowired
|
||||
private IUserService userService;
|
||||
|
||||
/**
|
||||
* 查询预约参观人员
|
||||
*
|
||||
@ -109,12 +114,26 @@ public class IVisitorPersonServiceImpl extends ServiceImpl<VisitorPersonMapper,
|
||||
|
||||
@Override
|
||||
public IPage<VisitorPerson> selectVisitorRecord(Long userId, Integer pageNum, Integer pageSize) {
|
||||
QueryWrapper<VisitorPerson> wrapper = new QueryWrapper<VisitorPerson>().eq("user_id", userId);
|
||||
wrapper.orderByDesc("create_time");
|
||||
//根据当前的用户id 去查询 系统用户的 用户id
|
||||
User user = userService.selectUserByStaffId(userId);
|
||||
if (null != user){
|
||||
Long customerId = user.getCustomerId();
|
||||
QueryWrapper<VisitorPerson> wrapper = new QueryWrapper<VisitorPerson>().eq("customer_id", customerId);
|
||||
wrapper.orderByDesc("create_time");
|
||||
|
||||
IPage<VisitorPerson> pages = new Page<>(pageNum,pageSize);
|
||||
IPage<VisitorPerson> userIPage = visitorPersonMapper.selectPage(pages,wrapper);
|
||||
return userIPage;
|
||||
|
||||
}else {
|
||||
QueryWrapper<VisitorPerson> wrapper = new QueryWrapper<VisitorPerson>().eq("user_id", userId);
|
||||
wrapper.orderByDesc("create_time");
|
||||
|
||||
IPage<VisitorPerson> pages = new Page<>(pageNum,pageSize);
|
||||
IPage<VisitorPerson> userIPage = visitorPersonMapper.selectPage(pages,wrapper);
|
||||
return userIPage;
|
||||
}
|
||||
|
||||
IPage<VisitorPerson> pages = new Page<>(pageNum,pageSize);
|
||||
IPage<VisitorPerson> userIPage = visitorPersonMapper.selectPage(pages,wrapper);
|
||||
return userIPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -136,6 +136,7 @@ public class ReservationServiceImpl extends ServiceImpl<ReservationMapper, Reser
|
||||
QueryWrapper<Reservation> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.eq("room_content_id",reservation.getRoomContentId());
|
||||
queryWrapper.ne("stauts",4);
|
||||
|
||||
Date startTime = reservation.getStartTime();
|
||||
Date endDate = reservation.getEndDate();
|
||||
|
@ -52,6 +52,7 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
|
||||
@Override
|
||||
public List<ShowroomRecord> selectShowroomRecordList(ShowroomRecord showroomRecord) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(showroomRecord.getTitle() !=null,"title", showroomRecord.getTitle());
|
||||
queryWrapper.eq(showroomRecord.getParkId() !=null,"park_id", showroomRecord.getParkId());
|
||||
queryWrapper.eq(showroomRecord.getTenantId() !=null,"tenant_id", showroomRecord.getTenantId());
|
||||
queryWrapper.eq(CollUtil.isNotEmpty(showroomRecord.getStaffIds()),"user_id", showroomRecord.getStaffIds());
|
||||
@ -115,6 +116,7 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
|
||||
// 查询会议室记录
|
||||
QueryWrapper<ShowroomRecord> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("showroom_id",showroomRecord.getShowroomId());
|
||||
wrapper.ne("status",4);
|
||||
wrapper.gt("start_time", DateUtil.format(dateTime,"yyyy-MM-dd")+ " 00:00:00");
|
||||
wrapper.lt("end_date",DateUtil.format(dateTime,"yyyy-MM-dd") + " 23:59:59");
|
||||
List<ShowroomRecord> showroomRecords = showroomRecordMapper.selectList(wrapper);
|
||||
@ -132,6 +134,7 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
|
||||
QueryWrapper<ShowroomRecord> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.eq("showroom_id",showroomRecord.getShowroomId());
|
||||
queryWrapper.ne("status",4);
|
||||
|
||||
Date startTime = showroomRecord.getStartTime();
|
||||
Date endDate = showroomRecord.getEndDate();
|
||||
@ -154,6 +157,7 @@ public class ShowroomRecordServiceImpl extends ServiceImpl<ShowroomRecordMapper,
|
||||
QueryWrapper<ShowroomRecord> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.eq("user_id",showroomRecord.getUserId());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<ShowroomRecord> pages = new Page<>(pageNum,pageSize);
|
||||
|
||||
IPage<ShowroomRecord> showroomRecordIPage = baseMapper.selectPage(pages, queryWrapper);
|
||||
|
@ -43,6 +43,7 @@ public class ShowroomServiceImpl extends ServiceImpl<ShowroomMapper, Showroom> i
|
||||
public List<Showroom> selectShowroomList(Showroom showroom) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(showroom.getParkId() !=null,"park_id", showroom.getParkId());
|
||||
queryWrapper.eq(showroom.getMeetingName() !=null,"meeting_name", showroom.getMeetingName());
|
||||
queryWrapper.eq(showroom.getTenantId() !=null,"tenant_id", showroom.getTenantId());
|
||||
queryWrapper.eq(showroom.getRoomId() !=null,"room_id", showroom.getRoomId());
|
||||
queryWrapper.in(showroom.getRoomIds() !=null,"room_id", showroom.getRoomIds());
|
||||
|
@ -72,4 +72,8 @@ public interface IUserEquipmentService extends IService<UserEquipment> {
|
||||
int deleteUserEquipmentByUserId(Long userId,Long deviceId);
|
||||
|
||||
int selectListByUserId(Long userId);
|
||||
|
||||
List<UserEquipment> selectUserEquipmentNum(UserEquipment userEquipment);
|
||||
|
||||
List<UserEquipment> selectUserEquipmentNumByUserId(UserEquipment userEquipment);
|
||||
}
|
||||
|
@ -47,16 +47,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
cs.delete_flag, cs.ics_customer_id, cs.openid, cs.avatar, cs.gender, cs.status, cs.park_id,cs.card_no,cs.data_type
|
||||
FROM ics_customer_staff cs
|
||||
left join tb_staff_customer tsc on cs.id = tsc.staff_id
|
||||
left join ics_customer icc on tsc.ics_customer_id = icc.id
|
||||
<where>
|
||||
<if test="username != null and username != ''"> AND cs.username LIKE CONCAT('%', #{username}, '%') </if>
|
||||
<if test="icsCustomerId != null and icsCustomerId != ''"> AND tsc.ics_customer_id = #{icsCustomerId} </if>
|
||||
<if test="mobile != null and mobile != ''"> AND cs.mobile LIKE CONCAT('%', #{mobile}, '%') </if>
|
||||
<if test="name != null and name != ''"> AND cs.name LIKE CONCAT('%', #{name}, '%') </if>
|
||||
<if test="dataType != null and dataType != ''"> AND cs.data_type = #{dataType} </if>
|
||||
<if test="parkId != null and parkId != ''"> AND cs.park_id = #{parkId} </if>
|
||||
<if test="parkId != null and parkId != ''"> AND icc.park_id = #{parkId} </if>
|
||||
<if test="tenantId != null and tenantId != ''"> AND cs.tenant_id = #{tenantId} </if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectIcsCustomerStaffById" parameterType="Long" resultMap="IcsCustomerStaffResult">
|
||||
@ -196,6 +195,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectIcsCustomerStaffVo"/>
|
||||
WHERE mobile=#{mobile}
|
||||
</select>
|
||||
<select id="getUserList" resultType="com.ics.common.core.domain.IcsCustomerStaff">
|
||||
SELECT cs.id, cs.username, cs.mobile, cs.create_by, cs.create_time, cs.update_by,cs.name,cs.photo,cs.address,cs.email,cs.degree,cs.urgent,cs.update_time,
|
||||
cs.delete_flag, cs.ics_customer_id, cs.openid, cs.avatar, cs.gender, cs.status, cs.park_id,cs.card_no,cs.data_type
|
||||
FROM ics_customer_staff cs
|
||||
left join tb_staff_customer tsc on cs.id = tsc.staff_id
|
||||
<where>
|
||||
<if test="username != null and username != ''"> AND cs.username LIKE CONCAT('%', #{username}, '%') </if>
|
||||
<if test="icsCustomerId != null and icsCustomerId != ''"> AND tsc.ics_customer_id = #{icsCustomerId} </if>
|
||||
<if test="mobile != null and mobile != ''"> AND cs.mobile LIKE CONCAT('%', #{mobile}, '%') </if>
|
||||
<if test="name != null and name != ''"> AND cs.name LIKE CONCAT('%', #{name}, '%') </if>
|
||||
<if test="dataType != null and dataType != ''"> AND cs.data_type = #{dataType} </if>
|
||||
<if test="parkId != null and parkId != ''"> AND cs.park_id = #{parkId} </if>
|
||||
<if test="tenantId != null and tenantId != ''"> AND cs.tenant_id = #{tenantId} </if>
|
||||
</where>
|
||||
group by cs.id
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
@ -75,6 +75,7 @@
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and ip.name like concat('%', #{name}, '%')</if>
|
||||
<if test="tenantId != null"> and ip.tenant_id = #{tenantId}</if>
|
||||
<if test="id != null"> and ip.id = #{id}</if>
|
||||
and ip.delete_flag = 0
|
||||
</where>
|
||||
</select>
|
||||
|
@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select customer_id,count(1) as num from tb_customer_ticket where ticket_id = #{id} GROUP BY customer_id
|
||||
</select>
|
||||
<select id="selectByTicketIdAndCustomer" resultType="java.lang.Integer">
|
||||
select count(1) as num from tb_customer_ticket where ticket_id = #{id} and customer_id =#{customerId} GROUP BY customer_id
|
||||
select count(1) as num from tb_customer_ticket where ticket_id = #{id} and customer_id =#{customerId} and is_verification = 0 GROUP BY customer_id
|
||||
|
||||
</select>
|
||||
|
||||
|
@ -35,6 +35,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="parkId != null and parkId != ''"> AND e.park_id = #{parkId}</if>
|
||||
<if test="tenantId != null and tenantId != ''"> AND e.tenant_id = #{tenantId}</if>
|
||||
<if test="roomId != null and roomId != ''"> AND re.room_id = #{roomId}</if>
|
||||
<if test="roomIds != null and roomIds.size() > 0">
|
||||
AND re.room_id IN
|
||||
<foreach collection="roomIds" item="roomId" open="(" separator="," close=")">
|
||||
#{roomId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="buildingDetailIds != null and buildingDetailIds.size() > 0">
|
||||
AND re.building_detail_id IN
|
||||
<foreach collection="buildingDetailIds" item="buildingDetailId" open="(" separator="," close=")">
|
||||
|
@ -44,7 +44,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
<select id="selectListByDate" resultType="java.util.Date">
|
||||
select date_format(start_time, '%Y-%m-%d') from tb_showroom_record where start_time >= date_format(now(), '%Y-%m-%d')
|
||||
and showroom_id = #{showroomId} group by date_format(start_time, '%Y-%m-%d');
|
||||
and showroom_id = #{showroomId} and status != 4
|
||||
group by date_format(start_time, '%Y-%m-%d');
|
||||
</select>
|
||||
|
||||
<insert id="insertShowroomRecord" parameterType="ShowroomRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
|
@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="num" column="num" />
|
||||
<result property="isDefault" column="is_default" />
|
||||
<result property="version" column="version" />
|
||||
<result property="deleteFlag" column="delete_flag" />
|
||||
@ -27,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTicketVo">
|
||||
SELECT id, title, content, type, duration, address, is_verification,discount, is_show, start_time, end_date, remark, is_default, version, delete_flag, create_by, create_time, update_by, update_time FROM tb_ticket
|
||||
SELECT id, title, content, type, duration, address, is_verification,discount,num, is_show, start_time, end_date, remark, is_default, version, delete_flag, create_by, create_time, update_by, update_time FROM tb_ticket
|
||||
</sql>
|
||||
|
||||
<select id="selectTicketList" parameterType="Ticket" resultMap="TicketResult">
|
||||
@ -54,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="isShow != null ">is_show,</if>
|
||||
<if test="startTime != null ">start_time,</if>
|
||||
<if test="endDate != null ">end_date,</if>
|
||||
<if test="num != null ">num,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="isDefault != null ">is_default,</if>
|
||||
<if test="version != null ">version,</if>
|
||||
@ -71,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="discount != null and discount != ''">#{discount},</if>
|
||||
<if test="address != null and address != ''">#{address},</if>
|
||||
<if test="isVerification != null ">#{isVerification},</if>
|
||||
<if test="num != null ">#{num},</if>
|
||||
<if test="isShow != null ">#{isShow},</if>
|
||||
<if test="startTime != null ">#{startTime},</if>
|
||||
<if test="endDate != null ">#{endDate},</if>
|
||||
@ -94,6 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="duration != null and duration != ''">duration = #{duration},</if>
|
||||
<if test="discount != null and discount != ''">discount = #{discount},</if>
|
||||
<if test="address != null and address != ''">address = #{address},</if>
|
||||
<if test="num != null and num != ''">num = #{num},</if>
|
||||
<if test="isVerification != null ">is_verification = #{isVerification},</if>
|
||||
<if test="isShow != null ">is_show = #{isShow},</if>
|
||||
<if test="startTime != null ">start_time = #{startTime},</if>
|
||||
|
@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectCountByUserIdAndDeviceId" resultType="java.lang.Integer">
|
||||
SELECT COUNT(1) FROM tb_user_equipment
|
||||
WHERE user_id = #{userId} AND equipment_id = #{equipmentId}
|
||||
AND now() > DATE_SUB(create_time, INTERVAL 15 MINUTE)
|
||||
AND now() > DATE_SUB(start_time, INTERVAL 15 MINUTE)
|
||||
AND now() < end_date
|
||||
</select>
|
||||
|
||||
|
@ -25,11 +25,16 @@ public class IcsCustomerStaff extends BaseEntity<IcsCustomerStaff> {
|
||||
|
||||
@Excel(name = "姓名")
|
||||
private String name;
|
||||
/** 用户性别(0男 1女 2未知) */
|
||||
@Excel(name = "性别")
|
||||
private String gender;
|
||||
|
||||
private String photo;
|
||||
|
||||
@Excel(name = "地址")
|
||||
private String address;
|
||||
@Excel(name = "身份证号")
|
||||
private String cardNo;
|
||||
|
||||
@Excel(name = "邮箱")
|
||||
private String email;
|
||||
@ -56,9 +61,7 @@ public class IcsCustomerStaff extends BaseEntity<IcsCustomerStaff> {
|
||||
/** 用户头像 */
|
||||
private String avatar;
|
||||
|
||||
/** 用户性别(0男 1女 2未知) */
|
||||
@Excel(name = "性别")
|
||||
private String gender;
|
||||
|
||||
|
||||
/** 帐号状态(0正常 1停用) */
|
||||
private String status;
|
||||
@ -73,8 +76,7 @@ public class IcsCustomerStaff extends BaseEntity<IcsCustomerStaff> {
|
||||
private String cardType;
|
||||
|
||||
/**证件号码**/
|
||||
@Excel(name = "身份证号")
|
||||
private String cardNo;
|
||||
|
||||
|
||||
/**来访时间*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
@ -22,6 +22,7 @@ import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@ -185,6 +186,23 @@ public class DeviceUtils {
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除人员信息
|
||||
*/
|
||||
public static String deletePersons(String ip,Long personId) {
|
||||
String url = ip + "/api/viso/v2/deletePersons";
|
||||
ArrayList<DevicePersonDto> dtos = new ArrayList<>();
|
||||
DevicePersonsDto devicePersonDto = new DevicePersonsDto();
|
||||
DevicePersonDto dto = new DevicePersonDto();
|
||||
dto.setPersonId(String.valueOf(personId));
|
||||
dtos.add(dto);
|
||||
devicePersonDto.setPersons(dtos);
|
||||
String json = JsonUtils.toJson(devicePersonDto);
|
||||
String msg = HttpUtil.post(url,json);
|
||||
log.info("删除人员信息:{}", msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改人脸
|
||||
*/
|
||||
@ -205,6 +223,8 @@ public class DeviceUtils {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加人脸照片
|
||||
*/
|
||||
@ -301,7 +321,8 @@ public class DeviceUtils {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
String s = addPersons(null,null);
|
||||
// String s = addPersons(null,null);
|
||||
// deletePersons("192.168.0.12");
|
||||
// System.out.println(s);
|
||||
// String s = queryPersons("10000");
|
||||
//
|
||||
|
@ -3,9 +3,14 @@ package com.ics.quartz.task;
|
||||
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.ics.admin.domain.meeting.CustomerTicket;
|
||||
import com.ics.admin.domain.meeting.Reservation;
|
||||
import com.ics.admin.domain.meeting.Ticket;
|
||||
import com.ics.admin.service.meeting.ICustomerTicketService;
|
||||
import com.ics.admin.service.meeting.IReservationService;
|
||||
import com.ics.admin.service.meeting.ITicketService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -19,6 +24,13 @@ public class PayTimeOutTask {
|
||||
@Autowired
|
||||
private IReservationService iReservationService;
|
||||
|
||||
@Autowired
|
||||
private ICustomerTicketService customerTicketService;
|
||||
|
||||
@Autowired
|
||||
private ITicketService ticketService;
|
||||
|
||||
|
||||
|
||||
// 支付超时处理
|
||||
public void payTimeOut() {
|
||||
@ -35,6 +47,23 @@ public class PayTimeOutTask {
|
||||
reservation1.setStauts(Reservation.Status.CANCELED);
|
||||
reservation1.setCancelResaon("管理员取消原因为:支付超时");
|
||||
iReservationService.updateReservation(reservation1);
|
||||
|
||||
|
||||
Long ticketId = reservation.getTicketId();
|
||||
if (ticketId !=null){
|
||||
Ticket ticket = ticketService.selectTicketById(ticketId);
|
||||
if (ticket != null){
|
||||
Long customerId = reservation.getCustomerId();
|
||||
CustomerTicket customerTicket = new CustomerTicket();
|
||||
customerTicket.setTicketId(ticketId);
|
||||
customerTicket.setCustomerId(customerId);
|
||||
customerTicket.setType(ticket.getType());
|
||||
customerTicket.setIsVerification(0);
|
||||
int i1 = customerTicketService.insertCustomerTicket(customerTicket);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
log.info("支付超时处理任务执行成功");
|
||||
}
|
||||
}
|
||||
|
@ -175,6 +175,10 @@ public class User extends BaseEntity<User> {
|
||||
*/
|
||||
private Long staffId;
|
||||
|
||||
private Long parkId;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
@TableField
|
||||
private String parkName;
|
||||
|
||||
|
@ -169,4 +169,5 @@ public interface UserMapper {
|
||||
|
||||
IcsCustomerStaff selectCustomerStaffById(Long customerId);
|
||||
|
||||
User selectUserByStaffId(Long userId);
|
||||
}
|
||||
|
@ -206,4 +206,5 @@ public interface IUserService {
|
||||
|
||||
IcsCustomerStaff selectCustomerStaffById(Long customerId);
|
||||
|
||||
User selectUserByStaffId(Long userId);
|
||||
}
|
||||
|
@ -425,6 +425,11 @@ public class UserServiceImpl implements IUserService {
|
||||
return userMapper.selectCustomerStaffById(customerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public User selectUserByStaffId(Long userId) {
|
||||
|
||||
return userMapper.selectUserByStaffId(userId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -289,6 +289,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM ics_customer_staff
|
||||
where id = #{customerId}
|
||||
</select>
|
||||
<select id="selectUserByStaffId" resultType="com.ics.system.domain.User">
|
||||
select u.username,
|
||||
u.nickname,
|
||||
u.email,
|
||||
u.mobile,
|
||||
u.status,
|
||||
u.staff_id,
|
||||
u.customer_id
|
||||
from sys_user u
|
||||
where u.staff_id = #{userId}
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteUserById" parameterType="Long">
|
||||
@ -403,6 +414,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
<if test="parkId != null">park_id = #{parkId},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="username != null and username != ''">username = #{username},</if>
|
||||
<if test="nickname != null and nickname != ''">nickname = #{nickname},</if>
|
||||
<if test="openid != null and openid != ''">openid = #{openid},</if>
|
||||
|
@ -187,8 +187,6 @@ public class WxLoginAPIController extends BaseController {
|
||||
userEquipmentService.insertUserEquipment(userEquipment);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
customerStaff.setOpenid(openid);
|
||||
icsCustomerStaffService.updateIcsCustomerStaff(customerStaff);
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ import com.ics.common.core.page.TableSupport;
|
||||
import com.ics.common.json.JsonUtils;
|
||||
import com.ics.common.utils.DeviceUtils;
|
||||
import com.ics.common.utils.IpUtils;
|
||||
import com.ics.common.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -106,10 +107,8 @@ public class ApiEquipmentController extends BaseController {
|
||||
return R.ok().put("data",openDoorRecord);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取对比记录
|
||||
* 获取对比记录,获取设备的对比记录,设备往服务端传输数据
|
||||
* @return
|
||||
*/
|
||||
@Ignore
|
||||
@ -119,13 +118,10 @@ public class ApiEquipmentController extends BaseController {
|
||||
// 对比personId 和用户 id,
|
||||
// 对比equipmentId 和设备id
|
||||
|
||||
if (data.getData() != null){
|
||||
if (data.getData() != null && data.getData().getEventType() != 17 && StringUtils.isNotEmpty(data.getData().getPersonId())){
|
||||
//用户id
|
||||
String personId = data.getData().getPersonId();
|
||||
|
||||
|
||||
|
||||
|
||||
String deviceId = data.getData().getDeviceId();
|
||||
Equipment equipment = equipmentService.selectByDeviceCode(deviceId);
|
||||
Assert.isTrue(equipment != null,"设备不存在");
|
||||
@ -136,7 +132,6 @@ public class ApiEquipmentController extends BaseController {
|
||||
VisitorPerson visitorPerson =visitorPersonService.selectByUserId(personId);
|
||||
record.setUserId(visitorPerson.getIntervieweeId());
|
||||
}
|
||||
|
||||
record.setParkId(equipment.getParkId());
|
||||
record.setType("1");
|
||||
record.setDeviceId(equipment.getId());
|
||||
|
@ -2,14 +2,15 @@ package com.ics.controller.mobile.meeting;
|
||||
|
||||
import com.ics.admin.domain.Park;
|
||||
import com.ics.admin.service.IParkService;
|
||||
import com.ics.common.core.domain.R;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.wf.jwtp.annotation.Ignore;
|
||||
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/park")
|
||||
public class ApiParkController {
|
||||
@ -23,4 +24,11 @@ public class ApiParkController {
|
||||
return parkService.selectParkById(id);
|
||||
}
|
||||
|
||||
|
||||
@Ignore
|
||||
@GetMapping("selectParkList")
|
||||
public R selectParkList() {
|
||||
List<Park> parkList = parkService.selectParkList(new Park());
|
||||
return R.data(parkList);
|
||||
}
|
||||
}
|
||||
|
@ -521,9 +521,31 @@ public class ApiRoomContentController extends BaseController {
|
||||
|
||||
Assert.notNull(reservation.getId(), "当前预约信息不存在");
|
||||
reservation.setStauts(Reservation.Status.CANCELED);
|
||||
reservation.setCancelResaon("管理员取消原因:"+reservation.getCancelResaon());
|
||||
reservation.setCancelResaon("用户取消原因:"+reservation.getCancelResaon());
|
||||
reservation.setCancelTime(new Date());
|
||||
int i = reservationService.updateReservation(reservation);
|
||||
|
||||
//取消订单,返还优惠券
|
||||
if (i > 0) {
|
||||
Long ticketId = reservation.getTicketId();
|
||||
if (ticketId !=null){
|
||||
Ticket ticket = ticketService.selectTicketById(ticketId);
|
||||
if (ticket != null){
|
||||
Long customerId = reservation.getCustomerId();
|
||||
CustomerTicket customerTicket = new CustomerTicket();
|
||||
customerTicket.setTicketId(ticketId);
|
||||
customerTicket.setCustomerId(customerId);
|
||||
customerTicket.setType(ticket.getType());
|
||||
customerTicket.setIsVerification(0);
|
||||
int i1 = customerTicketService.insertCustomerTicket(customerTicket);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return toAjax(i);
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ public class ApiRoomController extends BaseController {
|
||||
/**
|
||||
* 获取房间内容
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@Ignore
|
||||
@PostMapping("list")
|
||||
public R list() {
|
||||
List<RoomContent> roomContents = roomContentService.selectApiRoomList(new RoomContent());
|
||||
@ -83,6 +83,15 @@ public class ApiRoomController extends BaseController {
|
||||
if (null != roomEquipment){
|
||||
roomContent.setEquipmentId(roomEquipment.getEquipmentId());
|
||||
}
|
||||
Long roomId = roomContent.getRoomId();
|
||||
Room room = roomService.selectRoomById(roomId);
|
||||
if (room != null){
|
||||
roomContent.setRoomName(room.getName());
|
||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingId());
|
||||
if (buildingDetail != null) {
|
||||
roomContent.setBuildingName(buildingDetail.getFloorName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return R.data(roomContents);
|
||||
@ -91,7 +100,7 @@ public class ApiRoomController extends BaseController {
|
||||
/**
|
||||
* 查询今日的会议和正常进行的会议
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@Ignore
|
||||
@PostMapping("todayMeeting")
|
||||
public R todayMeeting(@RequestBody RoomContent roomContent) {
|
||||
List<Reservation> roomContents=roomContentService.todayMeeting(roomContent);
|
||||
@ -102,7 +111,7 @@ public class ApiRoomController extends BaseController {
|
||||
/**
|
||||
* 查询所有的园区
|
||||
*/
|
||||
@RequiresPermissions("member:center:view")
|
||||
@Ignore
|
||||
@GetMapping("selectParkList")
|
||||
public R selectParkList() {
|
||||
List<Park> parkList = parkService.selectParkList(new Park());
|
||||
|
@ -135,7 +135,7 @@ public class ApiVisitorController extends BaseController {
|
||||
visitorPerson.setStatusName("审核拒绝");
|
||||
}
|
||||
|
||||
Long userId = visitorPerson.getUserId();
|
||||
Long userId = visitorPerson1.getUserId();
|
||||
IcsCustomerStaff icsCustomerStaff = customerStaffService.selectIcsCustomerStaffById(userId);
|
||||
visitorPerson.setUserName(icsCustomerStaff.getUsername());
|
||||
visitorPerson.setMobile(icsCustomerStaff.getMobile());
|
||||
|
Loading…
x
Reference in New Issue
Block a user