mirror of
https://gitee.com/elegant_wings/xiongan-meeting.git
synced 2025-06-21 11:59:36 +08:00
修改了对应不同园区不同企业的功能
This commit is contained in:
parent
bcea3e4d3b
commit
9a3d01fbf3
@ -99,6 +99,10 @@ public class CustomerStaffController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IBuildingDetailService buildingDetailService;
|
private IBuildingDetailService buildingDetailService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStaffCustomerService staffCustomerService;
|
||||||
|
|
||||||
|
|
||||||
private static final String BASE64_PREFIX = "data:image/png;base64,";
|
private static final String BASE64_PREFIX = "data:image/png;base64,";
|
||||||
|
|
||||||
|
|
||||||
@ -122,49 +126,17 @@ public class CustomerStaffController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 查询企业员工列表
|
* 查询企业员工列表
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("admin:staff:list")
|
// @RequiresPermissions("admin:staff:list")
|
||||||
@GetMapping("list")
|
// @GetMapping("list")
|
||||||
public R list(IcsCustomerStaff icsCustomerStaff) {
|
// public R list(IcsCustomerStaff icsCustomerStaff) {
|
||||||
startPage();
|
// startPage();
|
||||||
String customerId = icsCustomerStaff.getCustomerId();
|
// String customerId = icsCustomerStaff.getCustomerId();
|
||||||
if (customerId != null && !"".equals(customerId)) {
|
// if (customerId != null && !"".equals(customerId)) {
|
||||||
icsCustomerStaff.setIcsCustomerId(Long.valueOf(customerId));
|
// icsCustomerStaff.setIcsCustomerId(Long.valueOf(customerId));
|
||||||
}
|
// }
|
||||||
icsCustomerStaff.setDataType(Constants.CUSTOMER_VISIT);
|
// icsCustomerStaff.setDataType(Constants.CUSTOMER_VISIT);
|
||||||
return result(icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff));
|
// return result(icsCustomerStaffService.selectIcsCustomerStaffList(icsCustomerStaff));
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@GetMapping("getStaffListNotId")
|
|
||||||
public R getStaffListNotId(IcsCustomerStaff icsCustomerStaff) {
|
|
||||||
startPage();
|
|
||||||
String customerId = icsCustomerStaff.getCustomerId();
|
|
||||||
if (customerId != null && !"".equals(customerId)) {
|
|
||||||
icsCustomerStaff.setIcsCustomerId(Long.valueOf(customerId));
|
|
||||||
}
|
|
||||||
|
|
||||||
return result(icsCustomerStaffService.getStaffListNotId(icsCustomerStaff));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@GetMapping("getStaffListByUser")
|
|
||||||
public R getStaffListByUser(IcsCustomerStaff icsCustomerStaff) {
|
|
||||||
startPage();
|
|
||||||
String customerId = icsCustomerStaff.getCustomerId();
|
|
||||||
if (customerId != null && !"".equals(customerId)) {
|
|
||||||
icsCustomerStaff.setIcsCustomerId(Long.valueOf(customerId));
|
|
||||||
}
|
|
||||||
List<IcsCustomerStaff> staffListByUser = icsCustomerStaffService.getStaffListByUser(icsCustomerStaff);
|
|
||||||
if (icsCustomerStaff.getStaffId() != null) {
|
|
||||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(icsCustomerStaff.getStaffId());
|
|
||||||
if (null != customerStaff) {
|
|
||||||
staffListByUser.add(customerStaff);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result(staffListByUser);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -204,15 +176,13 @@ public class CustomerStaffController extends BaseController {
|
|||||||
public R updateStaff(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
public R updateStaff(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
||||||
|
|
||||||
//如果没有注册小程序的话
|
//如果没有注册小程序的话
|
||||||
String customerId = "";
|
|
||||||
|
|
||||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectByPhone(icsCustomerStaff.getMobile());
|
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectByPhone(icsCustomerStaff.getMobile());
|
||||||
if (customerStaff != null) {
|
if (customerStaff != null) {
|
||||||
|
|
||||||
if (icsCustomerStaff.getId() == null) {
|
if (icsCustomerStaff.getId() == null) {
|
||||||
ArrayList<Long> ids = new ArrayList<>();
|
ArrayList<Long> ids = new ArrayList<>();
|
||||||
|
|
||||||
Customer customer = customerService.selectCustomerById(Long.valueOf(icsCustomerStaff.getCustomerId()));
|
Customer customer = customerService.selectCustomerById(icsCustomerStaff.getIcsCustomerId());
|
||||||
if (null != customer) {
|
if (null != customer) {
|
||||||
String roomId = customer.getRoomId();
|
String roomId = customer.getRoomId();
|
||||||
List<String> roomIds = StrUtil.split(roomId, ',');
|
List<String> roomIds = StrUtil.split(roomId, ',');
|
||||||
@ -238,11 +208,16 @@ public class CustomerStaffController extends BaseController {
|
|||||||
userEquipment.setUserId(customerStaff.getId());
|
userEquipment.setUserId(customerStaff.getId());
|
||||||
userEquipment.setStartTime(customer.getStartDate());
|
userEquipment.setStartTime(customer.getStartDate());
|
||||||
userEquipment.setEndDate(customer.getEndDate());
|
userEquipment.setEndDate(customer.getEndDate());
|
||||||
|
|
||||||
|
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(userEquipment);
|
||||||
|
if (CollUtil.isEmpty(equipments)){
|
||||||
userEquipmentService.insertUserEquipment(userEquipment);
|
userEquipmentService.insertUserEquipment(userEquipment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Long customerId1 = icsCustomerStaff.getIcsCustomerId();
|
||||||
|
Customer customer = customerService.selectCustomerById(customerId1);
|
||||||
|
|
||||||
customerStaff.setName(icsCustomerStaff.getName());
|
customerStaff.setName(icsCustomerStaff.getName());
|
||||||
customerStaff.setMobile(icsCustomerStaff.getMobile());
|
customerStaff.setMobile(icsCustomerStaff.getMobile());
|
||||||
@ -256,14 +231,7 @@ public class CustomerStaffController extends BaseController {
|
|||||||
customerStaff.setDegree(icsCustomerStaff.getDegree());
|
customerStaff.setDegree(icsCustomerStaff.getDegree());
|
||||||
customerStaff.setUrgent(icsCustomerStaff.getUrgent());
|
customerStaff.setUrgent(icsCustomerStaff.getUrgent());
|
||||||
//如果修改了照片,根据企业找到对应的房间,根据房间找到对应的设备,添加用户照片进入设备中
|
//如果修改了照片,根据企业找到对应的房间,根据房间找到对应的设备,添加用户照片进入设备中
|
||||||
if (icsCustomerStaff.getCustomerId() != null) {
|
|
||||||
customerStaff.setIcsCustomerId(Long.valueOf(icsCustomerStaff.getCustomerId()));
|
|
||||||
customerId = icsCustomerStaff.getCustomerId();
|
|
||||||
} else {
|
|
||||||
customerId = customerStaff.getIcsCustomerId().toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
Customer customer = customerService.selectCustomerById(Long.valueOf(customerId));
|
|
||||||
if (null != customer) {
|
if (null != customer) {
|
||||||
String roomId = customer.getRoomId();
|
String roomId = customer.getRoomId();
|
||||||
List<String> roomIds = StrUtil.split(roomId, ',');
|
List<String> roomIds = StrUtil.split(roomId, ',');
|
||||||
@ -276,7 +244,7 @@ public class CustomerStaffController extends BaseController {
|
|||||||
//根据设备id获取设备
|
//根据设备id获取设备
|
||||||
Equipment equipment = equipmentService.selectEquipmentById(roomEquipment.getEquipmentId());
|
Equipment equipment = equipmentService.selectEquipmentById(roomEquipment.getEquipmentId());
|
||||||
if (equipment != null) {
|
if (equipment != null) {
|
||||||
String persons = DeviceUtils.queryPersons(String.valueOf(customerStaff.getId()));
|
String persons = DeviceUtils.queryPersons(equipment.getIp(),String.valueOf(customerStaff.getId()));
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(persons);
|
JSONObject jsonObject = JSONUtil.parseObj(persons);
|
||||||
Integer amount = (Integer) jsonObject.get("amount");
|
Integer amount = (Integer) jsonObject.get("amount");
|
||||||
if (amount <= 0) {
|
if (amount <= 0) {
|
||||||
@ -294,23 +262,57 @@ public class CustomerStaffController extends BaseController {
|
|||||||
facesDto.setFaceId(String.valueOf(customerStaff.getId()));
|
facesDto.setFaceId(String.valueOf(customerStaff.getId()));
|
||||||
String photoUrl = url + customerStaff.getPhoto();
|
String photoUrl = url + customerStaff.getPhoto();
|
||||||
String faceData = BASE64_PREFIX + UrlToBase64Util.imageUrlToBase64(photoUrl);
|
String faceData = BASE64_PREFIX + UrlToBase64Util.imageUrlToBase64(photoUrl);
|
||||||
|
|
||||||
facesDto.setData(faceData);
|
facesDto.setData(faceData);
|
||||||
facesDtos.add(facesDto);
|
facesDtos.add(facesDto);
|
||||||
devicePersonDto.setFaces(facesDtos);
|
devicePersonDto.setFaces(facesDtos);
|
||||||
String s = DeviceUtils.addPersons(equipment.getIp(), devicePersonDto);
|
String s = DeviceUtils.addPersons(equipment.getIp(), devicePersonDto);
|
||||||
log.info("添加人员返回结果:" + s);
|
log.info("添加人员返回结果:" + s);
|
||||||
|
}else {
|
||||||
|
//更新用户信息
|
||||||
|
if (icsCustomerStaff.getPhoto() != null) {
|
||||||
|
if (!icsCustomerStaff.getPhoto().equals(customer.getPhone())){
|
||||||
|
DevicePersonDto devicePersonDto = new DevicePersonDto();
|
||||||
|
devicePersonDto.setPersonId(String.valueOf(customerStaff.getId()));
|
||||||
|
ArrayList<FacesDto> facesDtos = new ArrayList<>();
|
||||||
|
FacesDto facesDto = new FacesDto();
|
||||||
|
String photoUrl = url + icsCustomerStaff.getPhoto();
|
||||||
|
String faceData = BASE64_PREFIX + UrlToBase64Util.imageUrlToBase64(photoUrl);
|
||||||
|
facesDto.setData(faceData);
|
||||||
|
facesDto.setFaceId(String.valueOf(customerStaff.getId()));
|
||||||
|
facesDtos.add(facesDto);
|
||||||
|
devicePersonDto.setFaces(facesDtos);
|
||||||
|
DeviceUtils.modifyFaces(equipment.getIp(),devicePersonDto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int i = icsCustomerStaffService.updateIcsCustomerStaff(customerStaff);
|
||||||
|
Assert.isTrue(i > 0, "更新失败");
|
||||||
|
|
||||||
|
StaffCustomer staffCustomer = new StaffCustomer();
|
||||||
|
staffCustomer.setIcsCustomerId(icsCustomerStaff.getIcsCustomerId());
|
||||||
|
staffCustomer.setStaffId(customerStaff.getId());
|
||||||
|
List<StaffCustomer> staffCustomers = staffCustomerService.selectStaffCustomerList(staffCustomer);
|
||||||
|
if (staffCustomers.size() == 0) {
|
||||||
|
staffCustomerService.insertStaffCustomer(staffCustomer);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
return toAjax(i);
|
||||||
return toAjax(icsCustomerStaffService.updateIcsCustomerStaff(customerStaff));
|
|
||||||
}
|
}
|
||||||
icsCustomerStaff.setDataType("1");
|
icsCustomerStaff.setDataType("1");
|
||||||
icsCustomerStaff.setIcsCustomerId(Long.valueOf(icsCustomerStaff.getCustomerId()));
|
int i = icsCustomerStaffService.insertIcsCustomerStaff(icsCustomerStaff);
|
||||||
|
Assert.isTrue(i > 0, "添加失败");
|
||||||
|
//新增用户和企业 id
|
||||||
|
StaffCustomer staffCustomer = new StaffCustomer();
|
||||||
|
staffCustomer.setIcsCustomerId(icsCustomerStaff.getIcsCustomerId());
|
||||||
|
staffCustomer.setStaffId(icsCustomerStaff.getStaffId());
|
||||||
|
staffCustomerService.insertStaffCustomer(staffCustomer);
|
||||||
|
|
||||||
return toAjax(icsCustomerStaffService.insertIcsCustomerStaff(icsCustomerStaff));
|
return toAjax(i);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,10 +325,8 @@ public class CustomerStaffController extends BaseController {
|
|||||||
@Ignore
|
@Ignore
|
||||||
@PostMapping("updateStaffByCustomer")
|
@PostMapping("updateStaffByCustomer")
|
||||||
public R updateStaffByCustomer(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
public R updateStaffByCustomer(@RequestBody IcsCustomerStaff icsCustomerStaff) {
|
||||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(Long.valueOf(icsCustomerStaff.getId()));
|
StaffCustomer staffCustomer = staffCustomerService.selectStaffIdAndCustomerId(icsCustomerStaff.getIcsCustomerId(),icsCustomerStaff.getId());
|
||||||
|
return toAjax(staffCustomerService.deleteStaffCustomerById(staffCustomer.getId()));
|
||||||
customerStaff.setUpdateTime(new Date());
|
|
||||||
return toAjax(icsCustomerStaffService.updateByCustomer(customerStaff));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -389,7 +389,7 @@ public class CustomerStaffController extends BaseController {
|
|||||||
|
|
||||||
@Ignore
|
@Ignore
|
||||||
@GetMapping("/exportTemplate")
|
@GetMapping("/exportTemplate")
|
||||||
public void exportTemplate (HttpServletResponse response) throws IOException {
|
public void exportTemplate(HttpServletResponse response) throws IOException {
|
||||||
|
|
||||||
List<SellerVO> sellerVOList = new ArrayList<>();
|
List<SellerVO> sellerVOList = new ArrayList<>();
|
||||||
String title = "用户导入数据";
|
String title = "用户导入数据";
|
||||||
@ -402,7 +402,7 @@ public class CustomerStaffController extends BaseController {
|
|||||||
//授权用户设备权限,查询出所有的设备
|
//授权用户设备权限,查询出所有的设备
|
||||||
@RequiresPermissions("meeting:roomContent:list")
|
@RequiresPermissions("meeting:roomContent:list")
|
||||||
@PostMapping("/selectUserDeviceList")
|
@PostMapping("/selectUserDeviceList")
|
||||||
public R selectUserDeviceList () {
|
public R selectUserDeviceList() {
|
||||||
|
|
||||||
//根据园区 角色 查询所有的设备信息
|
//根据园区 角色 查询所有的设备信息
|
||||||
boolean isAdmin = SubjectUtil.hasRole(getRequest(), "manager");
|
boolean isAdmin = SubjectUtil.hasRole(getRequest(), "manager");
|
||||||
@ -468,7 +468,7 @@ public class CustomerStaffController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequiresPermissions("meeting:roomContent:list")
|
@RequiresPermissions("meeting:roomContent:list")
|
||||||
@PostMapping("/selectEquipmentListById")
|
@PostMapping("/selectEquipmentListById")
|
||||||
public R selectEquipmentListById (@RequestBody UserEquipment equipment){
|
public R selectEquipmentListById(@RequestBody UserEquipment equipment) {
|
||||||
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(equipment);
|
List<UserEquipment> equipments = userEquipmentService.selectUserEquipmentList(equipment);
|
||||||
List<Long> collect = equipments.stream().map(UserEquipment::getEquipmentId).collect(Collectors.toList());
|
List<Long> collect = equipments.stream().map(UserEquipment::getEquipmentId).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(collect)) {
|
if (CollUtil.isNotEmpty(collect)) {
|
||||||
@ -481,7 +481,7 @@ public class CustomerStaffController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<Equipment> selectEquipmentListByIds (List < Equipment > equipment) {
|
public List<Equipment> selectEquipmentListByIds(List<Equipment> equipment) {
|
||||||
for (Equipment equipment2 : equipment) {
|
for (Equipment equipment2 : equipment) {
|
||||||
RoomEquipment roomEquipment = roomEquipmentService.selectByEquipmentId(equipment2.getId());
|
RoomEquipment roomEquipment = roomEquipmentService.selectByEquipmentId(equipment2.getId());
|
||||||
if (roomEquipment != null) {
|
if (roomEquipment != null) {
|
||||||
@ -508,7 +508,7 @@ public class CustomerStaffController extends BaseController {
|
|||||||
|
|
||||||
@RequiresPermissions("meeting:roomContent:list")
|
@RequiresPermissions("meeting:roomContent:list")
|
||||||
@PostMapping("/saveUserEquipment")
|
@PostMapping("/saveUserEquipment")
|
||||||
public R saveUserEquipment (@RequestBody UserEquipment equipment){
|
public R saveUserEquipment(@RequestBody UserEquipment equipment) {
|
||||||
|
|
||||||
|
|
||||||
//根据企业查询出所有的设备
|
//根据企业查询出所有的设备
|
||||||
@ -518,7 +518,9 @@ public class CustomerStaffController extends BaseController {
|
|||||||
ArrayList<Long> ids = new ArrayList<>();
|
ArrayList<Long> ids = new ArrayList<>();
|
||||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(equipment.getUserId());
|
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(equipment.getUserId());
|
||||||
if (null != customerStaff) {
|
if (null != customerStaff) {
|
||||||
Customer customer = customerService.selectCustomerById(customerStaff.getIcsCustomerId());
|
List<StaffCustomer> staffCustomers = staffCustomerService.selectStaffCustomerByStaffId(customerStaff.getId());
|
||||||
|
for (StaffCustomer staffCustomer : staffCustomers) {
|
||||||
|
Customer customer = customerService.selectCustomerById(staffCustomer.getIcsCustomerId());
|
||||||
//根据企业 查询对应的 房间,和对应的楼层
|
//根据企业 查询对应的 房间,和对应的楼层
|
||||||
String roomId = customer.getRoomId();
|
String roomId = customer.getRoomId();
|
||||||
List<String> roomIds = StrUtil.split(roomId, ',');
|
List<String> roomIds = StrUtil.split(roomId, ',');
|
||||||
@ -539,6 +541,7 @@ public class CustomerStaffController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
int num = userEquipmentService.selectListByUserId(equipment.getUserId());
|
int num = userEquipmentService.selectListByUserId(equipment.getUserId());
|
||||||
if (num > 0) {
|
if (num > 0) {
|
||||||
@ -546,6 +549,8 @@ public class CustomerStaffController extends BaseController {
|
|||||||
Assert.isTrue(count > 0, "删除失败");
|
Assert.isTrue(count > 0, "删除失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Long id : equipment.getUserIds()) {
|
for (Long id : equipment.getUserIds()) {
|
||||||
@ -565,4 +570,4 @@ public class CustomerStaffController extends BaseController {
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,9 @@ public class EquipmentController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IUserService userService;
|
private IUserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStaffCustomerService staffCustomerService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询设备
|
* 查询设备
|
||||||
*/
|
*/
|
||||||
@ -363,12 +366,16 @@ public class EquipmentController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectIcsCustomerStaffList(customerStaff);
|
List<IcsCustomerStaff> icsCustomerStaffs = staffService.selectIcsCustomerStaffList(customerStaff);
|
||||||
|
|
||||||
for (IcsCustomerStaff icsCustomerStaff : icsCustomerStaffs) {
|
for (IcsCustomerStaff icsCustomerStaff : icsCustomerStaffs) {
|
||||||
Customer customer = customerService.selectCustomerById(icsCustomerStaff.getIcsCustomerId());
|
List<StaffCustomer> staffCustomers = staffCustomerService.selectStaffCustomerByStaffId(icsCustomerStaff.getId());
|
||||||
|
for (StaffCustomer staffCustomer : staffCustomers) {
|
||||||
|
Customer customer = customerService.selectCustomerById(staffCustomer.getIcsCustomerId());
|
||||||
if (null != customer) {
|
if (null != customer) {
|
||||||
icsCustomerStaff.setCustomerName(customer.getName());
|
icsCustomerStaff.setCustomerName(customer.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return R.data(icsCustomerStaffs);
|
return R.data(icsCustomerStaffs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,6 +124,7 @@ public class ShowroomRecordController extends BaseController {
|
|||||||
showroomRecord.setUserName(customerStaff.getUsername());
|
showroomRecord.setUserName(customerStaff.getUsername());
|
||||||
showroomRecord.setUserPhone(customerStaff.getMobile());
|
showroomRecord.setUserPhone(customerStaff.getMobile());
|
||||||
|
|
||||||
|
// todo 企业展示如何展示
|
||||||
Customer customer = customerService.selectCustomerById(customerStaff.getIcsCustomerId());
|
Customer customer = customerService.selectCustomerById(customerStaff.getIcsCustomerId());
|
||||||
if (null != customer) {
|
if (null != customer) {
|
||||||
showroomRecord.setCustomerName(customer.getName());
|
showroomRecord.setCustomerName(customer.getName());
|
||||||
|
@ -24,6 +24,7 @@ import com.ics.common.core.domain.dto.DevicePersonDto;
|
|||||||
import com.ics.common.core.domain.dto.FacesDto;
|
import com.ics.common.core.domain.dto.FacesDto;
|
||||||
import com.ics.common.utils.DateUtils;
|
import com.ics.common.utils.DateUtils;
|
||||||
import com.ics.common.utils.DeviceUtils;
|
import com.ics.common.utils.DeviceUtils;
|
||||||
|
import com.ics.common.utils.RandomUtil;
|
||||||
import com.ics.common.utils.UrlToBase64Util;
|
import com.ics.common.utils.UrlToBase64Util;
|
||||||
import com.ics.system.domain.Tenant;
|
import com.ics.system.domain.Tenant;
|
||||||
import com.ics.system.domain.User;
|
import com.ics.system.domain.User;
|
||||||
@ -111,11 +112,7 @@ public class VisitorPersonController extends BaseController {
|
|||||||
visitorPerson.setIntervieweeName(customerStaff.getUsername());
|
visitorPerson.setIntervieweeName(customerStaff.getUsername());
|
||||||
}
|
}
|
||||||
IcsCustomerStaff customerStaff1 = staffService.selectIcsCustomerStaffById(visitorPerson.getUserId());
|
IcsCustomerStaff customerStaff1 = staffService.selectIcsCustomerStaffById(visitorPerson.getUserId());
|
||||||
if (null != customerStaff1) {
|
|
||||||
visitorPerson.setUserName(customerStaff1.getUsername());
|
|
||||||
visitorPerson.setUserPhone(customerStaff1.getMobile());
|
|
||||||
|
|
||||||
}
|
|
||||||
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
||||||
if (null != customer) {
|
if (null != customer) {
|
||||||
visitorPerson.setCustomerName(customer.getName());
|
visitorPerson.setCustomerName(customer.getName());
|
||||||
@ -188,15 +185,10 @@ public class VisitorPersonController extends BaseController {
|
|||||||
}
|
}
|
||||||
visitorPerson.setStatus(1);
|
visitorPerson.setStatus(1);
|
||||||
visitorPerson.setCreateTime(DateUtils.getNowDate());
|
visitorPerson.setCreateTime(DateUtils.getNowDate());
|
||||||
|
visitorPerson.setUserId(Long.valueOf(RandomUtil.randomInt(10)));
|
||||||
int i = visitorPersonService.insertReservationPerson(visitorPerson);
|
int i = visitorPersonService.insertReservationPerson(visitorPerson);
|
||||||
if (i > 0){
|
if (i > 0){
|
||||||
String s = DeviceUtils.queryPersons(String.valueOf(visitorPerson.getIntervieweeId()));
|
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(s);
|
|
||||||
Integer amount = (Integer) jsonObject.get("amount");
|
|
||||||
if (amount > 0) {
|
|
||||||
//todo 需要修改 到底是按照访客时间。
|
|
||||||
return toAjax(1);
|
|
||||||
}
|
|
||||||
// todo 根据被访人企业id,查询对应的房间
|
// todo 根据被访人企业id,查询对应的房间
|
||||||
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
||||||
String roomId = customer.getRoomId();
|
String roomId = customer.getRoomId();
|
||||||
@ -210,7 +202,13 @@ public class VisitorPersonController extends BaseController {
|
|||||||
//根据设备id获取设备
|
//根据设备id获取设备
|
||||||
Equipment equipment = equipmentService.selectEquipmentById(roomEquipment.getEquipmentId());
|
Equipment equipment = equipmentService.selectEquipmentById(roomEquipment.getEquipmentId());
|
||||||
if (equipment != null) {
|
if (equipment != null) {
|
||||||
|
String s = DeviceUtils.queryPersons(equipment.getIp(), String.valueOf(visitorPerson.getIntervieweeId()));
|
||||||
|
JSONObject jsonObject = JSONUtil.parseObj(s);
|
||||||
|
Integer amount = (Integer) jsonObject.get("amount");
|
||||||
|
if (amount > 0) {
|
||||||
|
//todo 需要修改 到底是按照访客时间。
|
||||||
|
return toAjax(1);
|
||||||
|
}
|
||||||
//添加 用户和对应的设备
|
//添加 用户和对应的设备
|
||||||
UserEquipment userEquipment = new UserEquipment();
|
UserEquipment userEquipment = new UserEquipment();
|
||||||
userEquipment.setEquipmentId(equipment.getId());
|
userEquipment.setEquipmentId(equipment.getId());
|
||||||
@ -222,7 +220,7 @@ public class VisitorPersonController extends BaseController {
|
|||||||
//往设备添加对应的人脸数据
|
//往设备添加对应的人脸数据
|
||||||
DevicePersonDto devicePersonDto = new DevicePersonDto();
|
DevicePersonDto devicePersonDto = new DevicePersonDto();
|
||||||
ArrayList<FacesDto> facesDtos = new ArrayList<>();
|
ArrayList<FacesDto> facesDtos = new ArrayList<>();
|
||||||
devicePersonDto.setPersonId(String.valueOf(visitorPerson.getIntervieweeId()));
|
devicePersonDto.setPersonId(String.valueOf(visitorPerson.getUserId()));
|
||||||
devicePersonDto.setName(visitorPerson.getName());
|
devicePersonDto.setName(visitorPerson.getName());
|
||||||
devicePersonDto.setPhone(String.valueOf(visitorPerson.getPhone()));
|
devicePersonDto.setPhone(String.valueOf(visitorPerson.getPhone()));
|
||||||
devicePersonDto.setCertificateType("111");
|
devicePersonDto.setCertificateType("111");
|
||||||
@ -257,12 +255,74 @@ public class VisitorPersonController extends BaseController {
|
|||||||
|
|
||||||
if (null != visitorPerson.getStatus()) {
|
if (null != visitorPerson.getStatus()) {
|
||||||
Long loginCustomerId = this.getLoginCustomerId();
|
Long loginCustomerId = this.getLoginCustomerId();
|
||||||
|
|
||||||
if (loginCustomerId != null) {
|
if (loginCustomerId != null) {
|
||||||
visitorPerson.setReviewers(loginCustomerId);
|
|
||||||
visitorPerson.setReviewersTime(new Date());
|
visitorPerson.setReviewersTime(new Date());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (visitorPerson.getStatus() == 1){
|
||||||
|
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
||||||
|
String roomId = customer.getRoomId();
|
||||||
|
List<String> roomIds = StrUtil.split(roomId, ',');
|
||||||
|
List<Long> collect = roomIds.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||||
|
//获取了房间集合,循环对应集合,
|
||||||
|
for (Long aLong : collect) {
|
||||||
|
//根据房间id获取设备id
|
||||||
|
List<RoomEquipment> roomEquipments = roomEquipmentService.selectListByRoomId(aLong);
|
||||||
|
for (RoomEquipment roomEquipment : roomEquipments) {
|
||||||
|
//根据设备id获取设备
|
||||||
|
Equipment equipment = equipmentService.selectEquipmentById(roomEquipment.getEquipmentId());
|
||||||
|
if (equipment != null) {
|
||||||
|
String s = DeviceUtils.queryPersons(equipment.getIp(), String.valueOf(visitorPerson.getIntervieweeId()));
|
||||||
|
JSONObject jsonObject = JSONUtil.parseObj(s);
|
||||||
|
Integer amount = (Integer) jsonObject.get("amount");
|
||||||
|
if (amount > 0) {
|
||||||
|
//todo 需要修改 到底是按照访客时间。
|
||||||
|
return toAjax(1);
|
||||||
|
}
|
||||||
|
//添加 用户和对应的设备
|
||||||
|
UserEquipment userEquipment = new UserEquipment();
|
||||||
|
userEquipment.setEquipmentId(equipment.getId());
|
||||||
|
userEquipment.setUserId(visitorPerson.getIntervieweeId());
|
||||||
|
userEquipment.setStartTime(customer.getStartDate());
|
||||||
|
userEquipment.setEndDate(customer.getEndDate());
|
||||||
|
userEquipmentService.insertUserEquipment(userEquipment);
|
||||||
|
|
||||||
|
//往设备添加对应的人脸数据
|
||||||
|
DevicePersonDto devicePersonDto = new DevicePersonDto();
|
||||||
|
ArrayList<FacesDto> facesDtos = new ArrayList<>();
|
||||||
|
devicePersonDto.setPersonId(String.valueOf(visitorPerson.getUserId()));
|
||||||
|
devicePersonDto.setName(visitorPerson.getName());
|
||||||
|
devicePersonDto.setPhone(String.valueOf(visitorPerson.getPhone()));
|
||||||
|
devicePersonDto.setCertificateType("111");
|
||||||
|
devicePersonDto.setCertificateNumber(visitorPerson.getCardNo());
|
||||||
|
//添加人员类型
|
||||||
|
devicePersonDto.setPersonType("visitor");
|
||||||
|
//添加访客时间
|
||||||
|
devicePersonDto.setVisitorValidStartTime(DateUtil.format(visitorPerson.getVisitTime(), "yyyy-MM-dd'T'HH:mm:ss"));
|
||||||
|
devicePersonDto.setVisitorValidEndTime(DateUtil.format(visitorPerson.getLeaveTime(), "yyyy-MM-dd'T'HH:mm:ss"));
|
||||||
|
FacesDto facesDto = new FacesDto();
|
||||||
|
facesDto.setFaceId(String.valueOf(visitorPerson.getUserId()));
|
||||||
|
String photoUrl = url+visitorPerson.getPhoto();
|
||||||
|
String faceData = BASE64_PREFIX + UrlToBase64Util.imageUrlToBase64(photoUrl);
|
||||||
|
facesDto.setData(faceData);
|
||||||
|
facesDtos.add(facesDto);
|
||||||
|
devicePersonDto.setFaces(facesDtos);
|
||||||
|
DeviceUtils.addPersons(equipment.getIp(), devicePersonDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return toAjax(visitorPersonService.updateReservationPerson(visitorPerson));
|
return toAjax(visitorPersonService.updateReservationPerson(visitorPerson));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,8 +368,10 @@ public class VisitorPersonController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@Ignore
|
@Ignore
|
||||||
@GetMapping("selectCustomer")
|
@GetMapping("selectCustomer")
|
||||||
public R selectCustomer() {
|
public R selectCustomer(Long parkId) {
|
||||||
List<Customer> customers = customerService.selectCustomerList(new Customer());
|
Customer customer = new Customer();
|
||||||
|
customer.setParkId(parkId);
|
||||||
|
List<Customer> customers = customerService.selectCustomerList(customer);
|
||||||
return R.data(customers);
|
return R.data(customers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,10 +4,13 @@ import com.baomidou.mybatisplus.annotation.IEnum;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ics.admin.domain.BannerImage;
|
||||||
|
import com.ics.admin.handler.BannerImageHandler;
|
||||||
import com.ics.common.core.domain.BaseEntity;
|
import com.ics.common.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -38,6 +41,9 @@ public class RoomContent extends BaseEntity<RoomContent> {
|
|||||||
/** 室内图片url */
|
/** 室内图片url */
|
||||||
private String indoorPicUrl;
|
private String indoorPicUrl;
|
||||||
|
|
||||||
|
// @TableField(typeHandler = BannerImageHandler.class)
|
||||||
|
// private List<BannerImage> bannerImages = new ArrayList<>();
|
||||||
|
|
||||||
/** 地址 */
|
/** 地址 */
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
|
@ -21,11 +21,9 @@ public class VisitorPerson extends BaseEntity<VisitorPerson> {
|
|||||||
/** 被访人id */
|
/** 被访人id */
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
@TableField(exist = false)
|
private String userMobile;
|
||||||
private String userPhone;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,12 +22,10 @@ public class VisitorPersonVo extends BaseEntity<VisitorPersonVo> {
|
|||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
private String userName;
|
||||||
private String username;
|
|
||||||
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
private String userMobile;
|
||||||
private String mobile;
|
|
||||||
|
|
||||||
|
|
||||||
/** 被访人id */
|
/** 被访人id */
|
||||||
|
@ -61,4 +61,6 @@ public interface ICustomerService extends IService<Customer> {
|
|||||||
int deleteCustomerById(Long id);
|
int deleteCustomerById(Long id);
|
||||||
|
|
||||||
Customer selectByRoomId(Long id);
|
Customer selectByRoomId(Long id);
|
||||||
|
|
||||||
|
Customer selectCustomerByIdAndParkId(Long icsCustomerId, Long parkId);
|
||||||
}
|
}
|
@ -99,4 +99,12 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
|||||||
return customerMapper.selectOne(queryWrapper);
|
return customerMapper.selectOne(queryWrapper);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Customer selectCustomerByIdAndParkId(Long icsCustomerId, Long parkId) {
|
||||||
|
QueryWrapper<Customer> queryWrapper =new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("id",icsCustomerId).eq("park_id",parkId);
|
||||||
|
return customerMapper.selectOne(queryWrapper);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
@ -161,9 +161,8 @@ public class IcsCustomerStaffServiceImpl extends ServiceImpl<IcsCustomerStaffMap
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<IcsCustomerStaff> selectCustomerStaffList(IcsCustomerStaff icsCustomerStaff) {
|
public List<IcsCustomerStaff> selectCustomerStaffList(IcsCustomerStaff icsCustomerStaff) {
|
||||||
QueryWrapper<IcsCustomerStaff> wrapper = new QueryWrapper<>();
|
|
||||||
wrapper.eq("ics_customer_id",icsCustomerStaff.getIcsCustomerId());
|
return icsCustomerStaffMapper.selectIcsCustomerStaffList(icsCustomerStaff);
|
||||||
return icsCustomerStaffMapper.selectList(wrapper);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -94,6 +94,8 @@ public class UserEquipmentServiceImpl extends ServiceImpl<UserEquipmentMapper, U
|
|||||||
QueryWrapper queryWrapper = new QueryWrapper();
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
queryWrapper.eq(null != userEquipment.getEquipmentId(),"equipment_id",userEquipment.getEquipmentId());
|
queryWrapper.eq(null != userEquipment.getEquipmentId(),"equipment_id",userEquipment.getEquipmentId());
|
||||||
queryWrapper.eq(null != userEquipment.getUserId(),"user_id",userEquipment.getUserId());
|
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.in(CollUtil.isNotEmpty(userEquipment.getUserIds()),"user_id",userEquipment.getUserIds());
|
||||||
return userEquipmentMapper.selectList(queryWrapper);
|
return userEquipmentMapper.selectList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
@ -137,16 +137,25 @@ public class IVisitorPersonServiceImpl extends ServiceImpl<VisitorPersonMapper,
|
|||||||
VisitorPerson visitorPerson = visitorPersonMapper.selectReservationPersonById(id);
|
VisitorPerson visitorPerson = visitorPersonMapper.selectReservationPersonById(id);
|
||||||
//获取当前预约记录,根据开始时间和结束时间去查找对应的
|
//获取当前预约记录,根据开始时间和结束时间去查找对应的
|
||||||
|
|
||||||
//开始时间
|
// //开始时间
|
||||||
Date visitTime = visitorPerson.getVisitTime();
|
// Date visitTime = visitorPerson.getVisitTime();
|
||||||
//结束时间
|
// //结束时间
|
||||||
Date leaveTime = visitorPerson.getLeaveTime();
|
// Date leaveTime = visitorPerson.getLeaveTime();
|
||||||
|
|
||||||
|
|
||||||
QueryWrapper<RoomRecord> wrapper = new QueryWrapper<RoomRecord>();
|
QueryWrapper<RoomRecord> wrapper = new QueryWrapper<RoomRecord>();
|
||||||
wrapper.between("create_time",visitTime,leaveTime);
|
// wrapper.between("create_time",visitTime,leaveTime);
|
||||||
wrapper.eq("user_id",visitorPerson.getIntervieweeId());
|
wrapper.eq("user_id",visitorPerson.getIntervieweeId());
|
||||||
|
|
||||||
return roomRecordMapper.selectList(wrapper);
|
return roomRecordMapper.selectList(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VisitorPerson selectByUserId(String personId) {
|
||||||
|
|
||||||
|
QueryWrapper<VisitorPerson> wrapper = new QueryWrapper<VisitorPerson>();
|
||||||
|
wrapper.eq("user_id",personId);
|
||||||
|
return visitorPersonMapper.selectOne(wrapper);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,8 @@ public class StaffCustomerServiceImpl extends ServiceImpl<StaffCustomerMapper, S
|
|||||||
@Override
|
@Override
|
||||||
public List<StaffCustomer> selectStaffCustomerList(StaffCustomer staffCustomer) {
|
public List<StaffCustomer> selectStaffCustomerList(StaffCustomer staffCustomer) {
|
||||||
QueryWrapper queryWrapper = new QueryWrapper();
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.like(staffCustomer.getIcsCustomerId() != null,"ics_customer_id",staffCustomer.getIcsCustomerId());
|
||||||
|
queryWrapper.like(staffCustomer.getStaffId() !=null,"staff_id",staffCustomer.getStaffId());
|
||||||
return staffCustomerMapper.selectList(queryWrapper);
|
return staffCustomerMapper.selectList(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,4 +91,21 @@ public class StaffCustomerServiceImpl extends ServiceImpl<StaffCustomerMapper, S
|
|||||||
public int deleteStaffCustomerById(Long id) {
|
public int deleteStaffCustomerById(Long id) {
|
||||||
return staffCustomerMapper.deleteStaffCustomerById(id);
|
return staffCustomerMapper.deleteStaffCustomerById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StaffCustomer> selectStaffCustomerByStaffId(Long id) {
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.eq("staff_id",id);
|
||||||
|
return staffCustomerMapper.selectList(queryWrapper);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StaffCustomer selectStaffIdAndCustomerId(Long icsCustomerId, Long staffId) {
|
||||||
|
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.eq("staff_id",staffId);
|
||||||
|
queryWrapper.eq("ics_customer_id",icsCustomerId);
|
||||||
|
return staffCustomerMapper.selectOne(queryWrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,4 +58,8 @@ public interface IStaffCustomerService extends IService<StaffCustomer> {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteStaffCustomerById(Long id);
|
int deleteStaffCustomerById(Long id);
|
||||||
|
|
||||||
|
List<StaffCustomer> selectStaffCustomerByStaffId(Long id);
|
||||||
|
|
||||||
|
StaffCustomer selectStaffIdAndCustomerId(Long icsCustomerId, Long staffId);
|
||||||
}
|
}
|
||||||
|
@ -69,4 +69,7 @@ public interface IVisitorPersonService extends IService<VisitorPerson> {
|
|||||||
int updateVisitorPersonStatus(VisitorPerson person);
|
int updateVisitorPersonStatus(VisitorPerson person);
|
||||||
|
|
||||||
List<RoomRecord> getRecordByReservationId(Long id);
|
List<RoomRecord> getRecordByReservationId(Long id);
|
||||||
|
|
||||||
|
VisitorPerson selectByUserId(String personId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -43,16 +43,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectIcsCustomerStaffList" parameterType="com.ics.common.core.domain.IcsCustomerStaff" resultMap="IcsCustomerStaffResult">
|
<select id="selectIcsCustomerStaffList" parameterType="com.ics.common.core.domain.IcsCustomerStaff" resultMap="IcsCustomerStaffResult">
|
||||||
<include refid="selectIcsCustomerStaffVo"/>
|
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>
|
<where>
|
||||||
<if test="username != null and username != ''"> AND username LIKE CONCAT('%', #{username}, '%') </if>
|
<if test="username != null and username != ''"> AND cs.username LIKE CONCAT('%', #{username}, '%') </if>
|
||||||
<if test="icsCustomerId != null and icsCustomerId != ''"> AND ics_customer_id = #{icsCustomerId} </if>
|
<if test="icsCustomerId != null and icsCustomerId != ''"> AND tsc.ics_customer_id = #{icsCustomerId} </if>
|
||||||
<if test="mobile != null and mobile != ''"> AND mobile LIKE CONCAT('%', #{mobile}, '%') </if>
|
<if test="mobile != null and mobile != ''"> AND cs.mobile LIKE CONCAT('%', #{mobile}, '%') </if>
|
||||||
<if test="name != null and name != ''"> AND name LIKE CONCAT('%', #{name}, '%') </if>
|
<if test="name != null and name != ''"> AND cs.name LIKE CONCAT('%', #{name}, '%') </if>
|
||||||
<if test="dataType != null and dataType != ''"> AND data_type = #{dataType} </if>
|
<if test="dataType != null and dataType != ''"> AND cs.data_type = #{dataType} </if>
|
||||||
<if test="parkId != null and parkId != ''"> AND park_id = #{parkId} </if>
|
<if test="parkId != null and parkId != ''"> AND cs.park_id = #{parkId} </if>
|
||||||
<if test="tenantId != null and tenantId != ''"> AND tenant_id = #{tenantId} </if>
|
<if test="tenantId != null and tenantId != ''"> AND cs.tenant_id = #{tenantId} </if>
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectIcsCustomerStaffById" parameterType="Long" resultMap="IcsCustomerStaffResult">
|
<select id="selectIcsCustomerStaffById" parameterType="Long" resultMap="IcsCustomerStaffResult">
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
<result property="userId" column="user_id"/>
|
<result property="userId" column="user_id"/>
|
||||||
<result property="intervieweeId" column="interviewee_id"/>
|
<result property="intervieweeId" column="interviewee_id"/>
|
||||||
<result property="name" column="name"/>
|
<result property="name" column="name"/>
|
||||||
|
<result property="userName" column="user_name"/>
|
||||||
|
<result property="userMobile" column="user_mobile"/>
|
||||||
<result property="phone" column="phone"/>
|
<result property="phone" column="phone"/>
|
||||||
<result property="joinTime" column="join_time"/>
|
<result property="joinTime" column="join_time"/>
|
||||||
<result property="visitTime" column="visit_time"/>
|
<result property="visitTime" column="visit_time"/>
|
||||||
@ -25,7 +27,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectReservationPersonVo">
|
<sql id="selectReservationPersonVo">
|
||||||
SELECT id, user_id, interviewee_id, name, phone,reject_content, join_time,reviewers,reviewers_time, visit_time,photo,customer_id, leave_time, visit_content, card_type, card_no, status FROM tb_visitor_person
|
SELECT id, user_id, interviewee_id, name, phone,reject_content,user_name,user_mobile, join_time,reviewers,reviewers_time, visit_time,photo,customer_id, leave_time, visit_content, card_type, card_no, status FROM tb_visitor_person
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectReservationPersonList" parameterType="VisitorPerson" resultMap="ReservationPersonResult">
|
<select id="selectReservationPersonList" parameterType="VisitorPerson" resultMap="ReservationPersonResult">
|
||||||
@ -50,6 +52,8 @@
|
|||||||
<if test="phone != null ">phone,</if>
|
<if test="phone != null ">phone,</if>
|
||||||
<if test="joinTime != null ">join_time,</if>
|
<if test="joinTime != null ">join_time,</if>
|
||||||
<if test="visitTime != null ">visit_time,</if>
|
<if test="visitTime != null ">visit_time,</if>
|
||||||
|
<if test="userName != null ">user_name,</if>
|
||||||
|
<if test="userMobile != null ">user_mobile,</if>
|
||||||
<if test="customerId != null ">customer_id,</if>
|
<if test="customerId != null ">customer_id,</if>
|
||||||
<if test="reviewers != null ">reviewers,</if>
|
<if test="reviewers != null ">reviewers,</if>
|
||||||
<if test="reviewersTime != null ">reviewers_time,</if>
|
<if test="reviewersTime != null ">reviewers_time,</if>
|
||||||
@ -67,6 +71,8 @@
|
|||||||
<if test="intervieweeId != null ">#{intervieweeId},</if>
|
<if test="intervieweeId != null ">#{intervieweeId},</if>
|
||||||
<if test="name != null and name != ''">#{name},</if>
|
<if test="name != null and name != ''">#{name},</if>
|
||||||
<if test="phone != null ">#{phone},</if>
|
<if test="phone != null ">#{phone},</if>
|
||||||
|
<if test="userName != null ">#{userName},</if>
|
||||||
|
<if test="userMobile != null ">#{userMobile},</if>
|
||||||
<if test="joinTime != null ">#{joinTime},</if>
|
<if test="joinTime != null ">#{joinTime},</if>
|
||||||
<if test="reviewers != null ">#{reviewers},</if>
|
<if test="reviewers != null ">#{reviewers},</if>
|
||||||
<if test="reviewersTime != null ">#{reviewersTime},</if>
|
<if test="reviewersTime != null ">#{reviewersTime},</if>
|
||||||
@ -91,6 +97,8 @@
|
|||||||
<if test="phone != null ">phone = #{phone},</if>
|
<if test="phone != null ">phone = #{phone},</if>
|
||||||
<if test="joinTime != null ">join_time = #{joinTime},</if>
|
<if test="joinTime != null ">join_time = #{joinTime},</if>
|
||||||
<if test="visitTime != null ">visit_time = #{visitTime},</if>
|
<if test="visitTime != null ">visit_time = #{visitTime},</if>
|
||||||
|
<if test="userName != null ">user_name = #{userName},</if>
|
||||||
|
<if test="userMobile != null ">user_mobile = #{userMobile},</if>
|
||||||
<if test="customerId != null ">customer_id = #{customerId},</if>
|
<if test="customerId != null ">customer_id = #{customerId},</if>
|
||||||
<if test="reviewersTime != null ">reviewers_time = #{reviewersTime},</if>
|
<if test="reviewersTime != null ">reviewers_time = #{reviewersTime},</if>
|
||||||
<if test="reviewers != null ">reviewers = #{reviewers},</if>
|
<if test="reviewers != null ">reviewers = #{reviewers},</if>
|
||||||
|
@ -185,6 +185,26 @@ public class DeviceUtils {
|
|||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人脸
|
||||||
|
*/
|
||||||
|
public static String modifyFaces(String ip,DevicePersonDto dto) {
|
||||||
|
String url = ip + "/api/viso/v2/modifyFaces";
|
||||||
|
// DevicePersonDto devicePersonDto = new DevicePersonDto();
|
||||||
|
// FacesDto facesDto = new FacesDto();
|
||||||
|
// facesDto.setFaceId("001");
|
||||||
|
// String imgurl = "E:\\360MoveData\\Users\\Administrator\\Desktop\\图片\\图片\\photo.jpg";
|
||||||
|
// String s =BASE64_PREFIX+ UrlToBase64Util.imageUrlToBase64(imgurl);
|
||||||
|
String json = JsonUtils.toJson(dto);
|
||||||
|
System.out.println(json);
|
||||||
|
System.out.println(url);
|
||||||
|
String msg = HttpUtil.post(url,json);
|
||||||
|
log.info("设备修改人脸:{}", msg);
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加人脸照片
|
* 添加人脸照片
|
||||||
*/
|
*/
|
||||||
@ -227,8 +247,8 @@ public class DeviceUtils {
|
|||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String queryPersons(String personId) {
|
public static String queryPersons(String ip,String personId) {
|
||||||
String url = DEVICE_IP + "/api/viso/v2/queryPersons";
|
String url = ip + "/api/viso/v2/queryPersons";
|
||||||
JSONObject param = JSONUtil.createObj();
|
JSONObject param = JSONUtil.createObj();
|
||||||
param.put("any", false);
|
param.put("any", false);
|
||||||
param.put("personId", personId);
|
param.put("personId", personId);
|
||||||
|
@ -9,14 +9,12 @@ import com.ics.admin.domain.Customer;
|
|||||||
import com.ics.admin.domain.Park;
|
import com.ics.admin.domain.Park;
|
||||||
import com.ics.admin.domain.meeting.DetailEquipment;
|
import com.ics.admin.domain.meeting.DetailEquipment;
|
||||||
import com.ics.admin.domain.meeting.RoomEquipment;
|
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.domain.meeting.UserEquipment;
|
||||||
import com.ics.admin.service.ICustomerService;
|
import com.ics.admin.service.ICustomerService;
|
||||||
import com.ics.admin.service.IIcsCustomerStaffService;
|
import com.ics.admin.service.IIcsCustomerStaffService;
|
||||||
import com.ics.admin.service.IParkService;
|
import com.ics.admin.service.IParkService;
|
||||||
import com.ics.admin.service.meeting.IDetailEquipmentService;
|
import com.ics.admin.service.meeting.*;
|
||||||
import com.ics.admin.service.meeting.IEquipmentService;
|
|
||||||
import com.ics.admin.service.meeting.IRoomEquipmentService;
|
|
||||||
import com.ics.admin.service.meeting.IUserEquipmentService;
|
|
||||||
import com.ics.common.constant.Constants;
|
import com.ics.common.constant.Constants;
|
||||||
import com.ics.common.core.controller.BaseController;
|
import com.ics.common.core.controller.BaseController;
|
||||||
import com.ics.common.core.domain.IcsCustomerStaff;
|
import com.ics.common.core.domain.IcsCustomerStaff;
|
||||||
@ -83,6 +81,9 @@ public class WxLoginAPIController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ICustomerService customerService;
|
private ICustomerService customerService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStaffCustomerService staffCustomerService;
|
||||||
|
|
||||||
|
|
||||||
String smallWxAccessTokenKey = "smallWxAccessToken";
|
String smallWxAccessTokenKey = "smallWxAccessToken";
|
||||||
String smallWxUserPassword = "123456";
|
String smallWxUserPassword = "123456";
|
||||||
@ -243,13 +244,25 @@ public class WxLoginAPIController extends BaseController {
|
|||||||
|
|
||||||
@RequiresPermissions("member:center:view")
|
@RequiresPermissions("member:center:view")
|
||||||
@GetMapping("/wx/getUserInfo")
|
@GetMapping("/wx/getUserInfo")
|
||||||
public R login(Long userId) {
|
public R login(Long userId,Long parkId) {
|
||||||
try {
|
try {
|
||||||
//检查是否是否存在
|
//检查是否是否存在
|
||||||
IcsCustomerStaff icsCustomerStaff = new IcsCustomerStaff();
|
|
||||||
icsCustomerStaff.setId(userId);
|
|
||||||
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(userId);
|
IcsCustomerStaff customerStaff = icsCustomerStaffService.selectIcsCustomerStaffById(userId);
|
||||||
if (null != customerStaff) {
|
if (null != customerStaff) {
|
||||||
|
StaffCustomer staffCustomer = new StaffCustomer();
|
||||||
|
staffCustomer.setStaffId(userId);
|
||||||
|
List<StaffCustomer> staffCustomers = staffCustomerService.selectStaffCustomerByStaffId(userId);
|
||||||
|
if(CollUtil.isNotEmpty(staffCustomers)){
|
||||||
|
for (StaffCustomer staffCustomer1 : staffCustomers) {
|
||||||
|
Customer customer = customerService.selectCustomerByIdAndParkId(staffCustomer1.getIcsCustomerId(), parkId);
|
||||||
|
if (null != customer){
|
||||||
|
customerStaff.setCustomerName(customer.getName());
|
||||||
|
customerStaff.setIcsCustomerId(customer.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return R.ok().put("data", customerStaff);
|
return R.ok().put("data", customerStaff);
|
||||||
} else {
|
} else {
|
||||||
return R.error("获取微信用户数据失败");
|
return R.error("获取微信用户数据失败");
|
||||||
|
@ -8,15 +8,9 @@ import cn.hutool.json.JSONObject;
|
|||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.ics.admin.controller.meeting.UserEquipmentController;
|
import com.ics.admin.controller.meeting.UserEquipmentController;
|
||||||
import com.ics.admin.domain.meeting.Equipment;
|
import com.ics.admin.domain.meeting.*;
|
||||||
import com.ics.admin.domain.meeting.RoomEquipment;
|
|
||||||
import com.ics.admin.domain.meeting.RoomRecord;
|
|
||||||
import com.ics.admin.domain.meeting.UserEquipment;
|
|
||||||
import com.ics.admin.domain.meeting.vo.DeviceData;
|
import com.ics.admin.domain.meeting.vo.DeviceData;
|
||||||
import com.ics.admin.service.meeting.IEquipmentService;
|
import com.ics.admin.service.meeting.*;
|
||||||
import com.ics.admin.service.meeting.IRoomEquipmentService;
|
|
||||||
import com.ics.admin.service.meeting.IRoomRecordService;
|
|
||||||
import com.ics.admin.service.meeting.IUserEquipmentService;
|
|
||||||
import com.ics.common.core.controller.BaseController;
|
import com.ics.common.core.controller.BaseController;
|
||||||
import com.ics.common.core.domain.R;
|
import com.ics.common.core.domain.R;
|
||||||
import com.ics.common.core.page.PageDomain;
|
import com.ics.common.core.page.PageDomain;
|
||||||
@ -51,6 +45,9 @@ public class ApiEquipmentController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IRoomEquipmentService roomEquipmentService;
|
private IRoomEquipmentService roomEquipmentService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IVisitorPersonService visitorPersonService;
|
||||||
|
|
||||||
//根据用户id查询对应的设备, 楼层分割,房间,设备信息,
|
//根据用户id查询对应的设备, 楼层分割,房间,设备信息,
|
||||||
@RequiresPermissions("member:center:view")
|
@RequiresPermissions("member:center:view")
|
||||||
@GetMapping("/getEquipmentByUserId/{userId}")
|
@GetMapping("/getEquipmentByUserId/{userId}")
|
||||||
@ -112,7 +109,7 @@ public class ApiEquipmentController extends BaseController {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取对比记录 todo 没写完 是否需要人脸对比的数据
|
* 获取对比记录
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Ignore
|
@Ignore
|
||||||
@ -126,13 +123,19 @@ public class ApiEquipmentController extends BaseController {
|
|||||||
//用户id
|
//用户id
|
||||||
String personId = data.getData().getPersonId();
|
String personId = data.getData().getPersonId();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String deviceId = data.getData().getDeviceId();
|
String deviceId = data.getData().getDeviceId();
|
||||||
Equipment equipment = equipmentService.selectByDeviceCode(deviceId);
|
Equipment equipment = equipmentService.selectByDeviceCode(deviceId);
|
||||||
Assert.isTrue(equipment != null,"设备不存在");
|
Assert.isTrue(equipment != null,"设备不存在");
|
||||||
RoomRecord record = new RoomRecord();
|
RoomRecord record = new RoomRecord();
|
||||||
record.setUserId(Long.valueOf(personId));
|
record.setUserId(Long.valueOf(personId));
|
||||||
|
|
||||||
|
if (data.getData().getPersonType().equals("visitor")){
|
||||||
|
VisitorPerson visitorPerson =visitorPersonService.selectByUserId(personId);
|
||||||
|
record.setUserId(visitorPerson.getIntervieweeId());
|
||||||
|
}
|
||||||
|
|
||||||
record.setParkId(equipment.getParkId());
|
record.setParkId(equipment.getParkId());
|
||||||
record.setType("1");
|
record.setType("1");
|
||||||
|
@ -90,6 +90,9 @@ public class ApiShowroomController extends BaseController {
|
|||||||
Room room = roomService.selectRoomById(showroom1.getRoomId());
|
Room room = roomService.selectRoomById(showroom1.getRoomId());
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
showroom1.setRoomName(room.getName());
|
showroom1.setRoomName(room.getName());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//查询楼层号
|
//查询楼层号
|
||||||
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
BuildingDetail buildingDetail = buildingDetailService.selectBuildingDetailById(room.getBuildingDetailId());
|
||||||
if (buildingDetail != null) {
|
if (buildingDetail != null) {
|
||||||
@ -198,8 +201,8 @@ public class ApiShowroomController extends BaseController {
|
|||||||
showroomRecord1.setStatusName("待审核");
|
showroomRecord1.setStatusName("待审核");
|
||||||
}else if (showroomRecord1.getStatus() == 1){
|
}else if (showroomRecord1.getStatus() == 1){
|
||||||
showroomRecord1.setStatusName("审核通过");
|
showroomRecord1.setStatusName("审核通过");
|
||||||
}else if (showroomRecord1.getStatus() == 2){
|
}else if (showroomRecord1.getStatus() == 4){
|
||||||
showroomRecord1.setStatusName("审核驳回");
|
showroomRecord1.setStatusName("已取消");
|
||||||
}
|
}
|
||||||
|
|
||||||
Showroom showroom = showroomService.selectShowroomById(showroomRecord1.getShowroomId());
|
Showroom showroom = showroomService.selectShowroomById(showroomRecord1.getShowroomId());
|
||||||
@ -233,8 +236,8 @@ public class ApiShowroomController extends BaseController {
|
|||||||
showroomRecord.setStatusName("待审核");
|
showroomRecord.setStatusName("待审核");
|
||||||
} else if (showroomRecord.getStatus() == 1) {
|
} else if (showroomRecord.getStatus() == 1) {
|
||||||
showroomRecord.setStatusName("审核通过");
|
showroomRecord.setStatusName("审核通过");
|
||||||
} else if (showroomRecord.getStatus() == 2) {
|
} else if (showroomRecord.getStatus() == 4) {
|
||||||
showroomRecord.setStatusName("审核驳回");
|
showroomRecord.setStatusName("已取消");
|
||||||
}
|
}
|
||||||
|
|
||||||
IcsCustomerStaff icsCustomerStaff = staffService.selectIcsCustomerStaffById(showroomRecord.getUserId());
|
IcsCustomerStaff icsCustomerStaff = staffService.selectIcsCustomerStaffById(showroomRecord.getUserId());
|
||||||
|
@ -26,6 +26,7 @@ import com.ics.common.core.domain.dto.FacesDto;
|
|||||||
import com.ics.common.core.page.PageDomain;
|
import com.ics.common.core.page.PageDomain;
|
||||||
import com.ics.common.core.page.TableSupport;
|
import com.ics.common.core.page.TableSupport;
|
||||||
import com.ics.common.utils.DeviceUtils;
|
import com.ics.common.utils.DeviceUtils;
|
||||||
|
import com.ics.common.utils.RandomUtil;
|
||||||
import com.ics.common.utils.UrlToBase64Util;
|
import com.ics.common.utils.UrlToBase64Util;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@ -167,10 +168,7 @@ public class ApiVisitorController extends BaseController {
|
|||||||
visitorPerson.setStatusName("审核拒绝");
|
visitorPerson.setStatusName("审核拒绝");
|
||||||
}
|
}
|
||||||
|
|
||||||
Long userId = visitorPerson.getUserId();
|
|
||||||
IcsCustomerStaff icsCustomerStaff = customerStaffService.selectIcsCustomerStaffById(userId);
|
|
||||||
visitorPerson.setUserName(icsCustomerStaff.getUsername());
|
|
||||||
visitorPerson.setMobile(icsCustomerStaff.getMobile());
|
|
||||||
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
||||||
visitorPerson.setCustomerName(customer.getName());
|
visitorPerson.setCustomerName(customer.getName());
|
||||||
}
|
}
|
||||||
@ -193,17 +191,11 @@ public class ApiVisitorController extends BaseController {
|
|||||||
visitorPerson.setStatusName("审核拒绝");
|
visitorPerson.setStatusName("审核拒绝");
|
||||||
}
|
}
|
||||||
|
|
||||||
Long userId = visitorPerson.getUserId();
|
|
||||||
IcsCustomerStaff icsCustomerStaff = customerStaffService.selectIcsCustomerStaffById(userId);
|
|
||||||
visitorPerson.setUserName(icsCustomerStaff.getUsername());
|
|
||||||
// visitorPerson.setUsername(icsCustomerStaff.getUsername());
|
|
||||||
visitorPerson.setMobile(icsCustomerStaff.getMobile());
|
|
||||||
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
Customer customer = customerService.selectCustomerById(visitorPerson.getCustomerId());
|
||||||
visitorPerson.setCustomerName(customer.getName());
|
visitorPerson.setCustomerName(customer.getName());
|
||||||
|
|
||||||
VisitorPersonVo visitorPersonVO = new VisitorPersonVo();
|
VisitorPersonVo visitorPersonVO = new VisitorPersonVo();
|
||||||
BeanUtils.copyProperties(visitorPerson, visitorPersonVO);
|
BeanUtils.copyProperties(visitorPerson, visitorPersonVO);
|
||||||
visitorPersonVO.setUsername(icsCustomerStaff.getUsername());
|
|
||||||
|
|
||||||
return R.ok().put("data", visitorPersonVO);
|
return R.ok().put("data", visitorPersonVO);
|
||||||
}
|
}
|
||||||
@ -223,13 +215,7 @@ public class ApiVisitorController extends BaseController {
|
|||||||
person.setReviewersTime(new Date());
|
person.setReviewersTime(new Date());
|
||||||
int update = visitorPersonService.updateVisitorPersonStatus(person);
|
int update = visitorPersonService.updateVisitorPersonStatus(person);
|
||||||
if (update > 0) {
|
if (update > 0) {
|
||||||
String s = DeviceUtils.queryPersons(String.valueOf(person.getIntervieweeId()));
|
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(s);
|
|
||||||
Integer amount = (Integer) jsonObject.get("amount");
|
|
||||||
if (amount > 0) {
|
|
||||||
//todo 需要修改 到底是按照访客时间。
|
|
||||||
return toAjax(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
ArrayList<Long> ids = new ArrayList<>();
|
ArrayList<Long> ids = new ArrayList<>();
|
||||||
|
|
||||||
@ -273,7 +259,13 @@ public class ApiVisitorController extends BaseController {
|
|||||||
//根据设备id获取设备
|
//根据设备id获取设备
|
||||||
Equipment equipment = equipmentService.selectEquipmentById(roomEquipment.getEquipmentId());
|
Equipment equipment = equipmentService.selectEquipmentById(roomEquipment.getEquipmentId());
|
||||||
if (equipment != null) {
|
if (equipment != null) {
|
||||||
|
String s = DeviceUtils.queryPersons(equipment.getIp(),String.valueOf(person.getIntervieweeId()));
|
||||||
|
JSONObject jsonObject = JSONUtil.parseObj(s);
|
||||||
|
Integer amount = (Integer) jsonObject.get("amount");
|
||||||
|
if (amount > 0) {
|
||||||
|
//todo 需要修改 到底是按照访客时间。
|
||||||
|
return toAjax(1);
|
||||||
|
}
|
||||||
DevicePersonDto devicePersonDto = new DevicePersonDto();
|
DevicePersonDto devicePersonDto = new DevicePersonDto();
|
||||||
ArrayList<FacesDto> facesDtos = new ArrayList<>();
|
ArrayList<FacesDto> facesDtos = new ArrayList<>();
|
||||||
devicePersonDto.setPersonId(String.valueOf(visitorPerson.getIntervieweeId()));
|
devicePersonDto.setPersonId(String.valueOf(visitorPerson.getIntervieweeId()));
|
||||||
@ -328,6 +320,7 @@ public class ApiVisitorController extends BaseController {
|
|||||||
person.setStatus(0);
|
person.setStatus(0);
|
||||||
Assert.isTrue(IdcardUtil.isValidCard(person.getCardNo()), "身份证格式不正确");
|
Assert.isTrue(IdcardUtil.isValidCard(person.getCardNo()), "身份证格式不正确");
|
||||||
Assert.isTrue(Validator.isMobile(person.getPhone()), "手机号格式不正确");
|
Assert.isTrue(Validator.isMobile(person.getPhone()), "手机号格式不正确");
|
||||||
|
person.setUserId(Long.valueOf(RandomUtil.randomInt(10)));
|
||||||
int i = visitorPersonService.insertReservationPerson(person);
|
int i = visitorPersonService.insertReservationPerson(person);
|
||||||
Assert.isTrue(i > 0, "添加访客预约失败");
|
Assert.isTrue(i > 0, "添加访客预约失败");
|
||||||
//添加成功后,需要 往设备中添加一条数据
|
//添加成功后,需要 往设备中添加一条数据
|
||||||
|
@ -121,7 +121,7 @@ public class ProfileAPIController extends BaseController {
|
|||||||
//根据设备id获取设备
|
//根据设备id获取设备
|
||||||
Equipment equipment = equipmentService.selectEquipmentById(roomEquipment.getEquipmentId());
|
Equipment equipment = equipmentService.selectEquipmentById(roomEquipment.getEquipmentId());
|
||||||
if (equipment != null) {
|
if (equipment != null) {
|
||||||
String persons = DeviceUtils.queryPersons(String.valueOf(icsCustomerStaff.getId()));
|
String persons = DeviceUtils.queryPersons(equipment.getIp(),String.valueOf(icsCustomerStaff.getId()));
|
||||||
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(persons);
|
cn.hutool.json.JSONObject jsonObject = JSONUtil.parseObj(persons);
|
||||||
Integer amount = (Integer) jsonObject.get("amount");
|
Integer amount = (Integer) jsonObject.get("amount");
|
||||||
if (amount <= 0) {
|
if (amount <= 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user