长庆项目修改
This commit is contained in:
parent
fc9eb49a75
commit
f81eef47b7
|
@ -2081,4 +2081,10 @@ public class HttpApiController {
|
||||||
|
|
||||||
return R.ok().put("data", page);
|
return R.ok().put("data", page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/role")
|
||||||
|
public R roleList() {
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,17 +164,17 @@ public class CqMemberController {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (personTypeId != null){
|
if (personTypeId != null){
|
||||||
queryWrapper.eq("label_id", idCard);
|
queryWrapper.eq("label_id", personTypeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phone != null && !phone.isEmpty()){
|
if (phone != null && !phone.isEmpty()){
|
||||||
queryWrapper.eq("mobile", phone);
|
queryWrapper.eq("mobile", phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isvisitor == 1){
|
/* if (isvisitor == 1){
|
||||||
Integer i = cqMemberMapper.speciallyForVisitors();
|
Integer i = cqMemberMapper.speciallyForVisitors();
|
||||||
queryWrapper.eq("label_id", i);
|
queryWrapper.eq("label_id", i);
|
||||||
}
|
}*/
|
||||||
if (isWatched != null){
|
if (isWatched != null){
|
||||||
queryWrapper.eq("is_watch_safe_video", isWatched);
|
queryWrapper.eq("is_watch_safe_video", isWatched);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,15 +20,12 @@ import net.shapelight.modules.face.service.FaceEngineService;
|
||||||
import net.shapelight.modules.face.util.UserInfo;
|
import net.shapelight.modules.face.util.UserInfo;
|
||||||
import net.shapelight.modules.face.util.UserRamGroup;
|
import net.shapelight.modules.face.util.UserRamGroup;
|
||||||
import net.shapelight.modules.feignClient.CxFeignClient;
|
import net.shapelight.modules.feignClient.CxFeignClient;
|
||||||
|
import net.shapelight.modules.nettyapi.service.ServerApiService;
|
||||||
import net.shapelight.modules.sys.controller.AbstractController;
|
import net.shapelight.modules.sys.controller.AbstractController;
|
||||||
import net.shapelight.modules.ten.entity.TenCellEntity;
|
import net.shapelight.modules.ten.entity.*;
|
||||||
import net.shapelight.modules.ten.entity.TenPersonCert;
|
import net.shapelight.modules.ten.service.*;
|
||||||
import net.shapelight.modules.ten.entity.TenPersonEntity;
|
import net.shapelight.modules.vo.TenDeviceVo;
|
||||||
import net.shapelight.modules.ten.entity.TenPersonTrain;
|
import net.shapelight.modules.vo.TenPersonOperationVo;
|
||||||
import net.shapelight.modules.ten.service.TenCellService;
|
|
||||||
import net.shapelight.modules.ten.service.TenPersonCertService;
|
|
||||||
import net.shapelight.modules.ten.service.TenPersonService;
|
|
||||||
import net.shapelight.modules.ten.service.TenPersonTrainService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@ -60,11 +57,19 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
|
||||||
private TenPersonTrainService trainService;
|
private TenPersonTrainService trainService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private FaceEngineService faceEngineService;
|
private FaceEngineService faceEngineService;
|
||||||
|
@Autowired
|
||||||
|
private TenDeviceService tenDeviceService;
|
||||||
|
@Autowired
|
||||||
|
private TenPersonSyncService tenPersonSyncService;
|
||||||
|
@Autowired
|
||||||
|
private ServerApiService serverApiService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(String params) {
|
public void run(String params) {
|
||||||
|
getPmInternalPersonnelList("Person");
|
||||||
|
getPmInternalPersonnelList("Contractor");
|
||||||
|
getPmInternalPersonnelList("Supplier");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getPmInternalPersonnelList(String type) {
|
private void getPmInternalPersonnelList(String type) {
|
||||||
|
@ -280,7 +285,34 @@ public class PersonSynchronousTask extends AbstractController implements ITask {
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
tenPerson.setOrgImage(orgImageFileName);
|
tenPerson.setOrgImage(orgImageFileName);
|
||||||
tenPerson.setFaceImage(orgImageFileName);
|
tenPerson.setFaceImage(orgImageFileName);
|
||||||
tenPersonService.saveOrUpdateByField(tenPerson,"openId");
|
String flag = tenPersonService.saveOrUpdateByField(tenPerson,"openId");
|
||||||
|
if(flag.equals("save")) {
|
||||||
|
//发送设备通知
|
||||||
|
List<TenDeviceVo> devList = tenDeviceService.findByCellId(tenPerson.getCellId());
|
||||||
|
//状态是0正常,发送推送
|
||||||
|
if (tenPerson.getStatus().intValue() == Constant.PESON_SUATUS_NOMOR) {
|
||||||
|
for (TenDeviceVo dev : devList) {
|
||||||
|
//添加到同步表,下发设备通知
|
||||||
|
TenPersonSyncEntity syncEntity = new TenPersonSyncEntity();
|
||||||
|
syncEntity.setPersonId(tenPerson.getPersonId());
|
||||||
|
syncEntity.setTenantId(tenPerson.getTenantId());
|
||||||
|
syncEntity.setDeviceSn(dev.getSn());
|
||||||
|
syncEntity.setDeviceId(dev.getDeviceId());
|
||||||
|
syncEntity.setState(1);
|
||||||
|
syncEntity.setLastUpdateTime(tenPerson.getLastUpdateTime());
|
||||||
|
tenPersonSyncService.insert(syncEntity);
|
||||||
|
|
||||||
|
//下发通知
|
||||||
|
List<TenPersonOperationVo> list = new ArrayList<>();
|
||||||
|
TenPersonOperationVo vo = new TenPersonOperationVo();
|
||||||
|
vo.setUid(syncEntity.getPersonId());
|
||||||
|
vo.setOperation(1);
|
||||||
|
vo.setLast_update_stamp(syncEntity.getLastUpdateTime());
|
||||||
|
list.add(vo);
|
||||||
|
serverApiService.personOperation(dev.getSn(), list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
UserInfo userInfo = new UserInfo();
|
UserInfo userInfo = new UserInfo();
|
||||||
UserRamGroup.addUser(userInfo,tenPerson.getOrgId()!=null?UserRamGroup.getOrgCellMap(tenPerson.getOrgId()):null);
|
UserRamGroup.addUser(userInfo,tenPerson.getOrgId()!=null?UserRamGroup.getOrgCellMap(tenPerson.getOrgId()):null);
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -142,10 +142,14 @@ public class TenPersonController extends AbstractController {
|
||||||
List<Integer> personTypeList = new ArrayList<>();
|
List<Integer> personTypeList = new ArrayList<>();
|
||||||
List<TenLabelEntity> tenLabel = tenLabelService.list(new QueryWrapper<TenLabelEntity>()
|
List<TenLabelEntity> tenLabel = tenLabelService.list(new QueryWrapper<TenLabelEntity>()
|
||||||
.eq("tenant_id",getUser().getTenantId()));
|
.eq("tenant_id",getUser().getTenantId()));
|
||||||
personTypeList.add(Constant.PERSON_TYPE_OWNER);
|
if(params.get("personType")!=null&& !Objects.equals(params.get("personType").toString(), "")) {
|
||||||
personTypeList.add(Constant.PERSON_TYPE_MEMBER);
|
personTypeList.add(Integer.parseInt(params.get("personType").toString()));
|
||||||
personTypeList.add(Constant.PERSON_TYPE_TENANT);
|
}
|
||||||
|
//personTypeList.add(Constant.PERSON_TYPE_MEMBER);
|
||||||
|
//personTypeList.add(Constant.PERSON_TYPE_TENANT);
|
||||||
|
if(!personTypeList.isEmpty()) {
|
||||||
params.put("personTypeList",personTypeList);
|
params.put("personTypeList",personTypeList);
|
||||||
|
}
|
||||||
PageUtils page = tenPersonService.queryPage(params);
|
PageUtils page = tenPersonService.queryPage(params);
|
||||||
|
|
||||||
return R.ok().put("data", page);
|
return R.ok().put("data", page);
|
||||||
|
|
|
@ -163,7 +163,7 @@ public interface TenPersonService extends IService<TenPersonEntity> {
|
||||||
|
|
||||||
List<TenDeptPersonCount> findDeptCount(String tenantId);
|
List<TenDeptPersonCount> findDeptCount(String tenantId);
|
||||||
|
|
||||||
void saveOrUpdateByField(TenPersonEntity entity,String fieldName);
|
String saveOrUpdateByField(TenPersonEntity entity,String fieldName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -414,7 +414,7 @@ public class TenDeviceServiceImpl extends ServiceImpl<TenDeviceDao, TenDeviceEnt
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void evictSave(TenDeviceEntity deviceEntity) {
|
public void evictSave(TenDeviceEntity deviceEntity) {
|
||||||
this.save(deviceEntity);
|
this.save(deviceEntity);
|
||||||
//保存标签关联
|
/*//保存标签关联
|
||||||
//1.删除标签关联
|
//1.删除标签关联
|
||||||
tenDeviceLabelService.remove(new QueryWrapper<TenDeviceLabelEntity>()
|
tenDeviceLabelService.remove(new QueryWrapper<TenDeviceLabelEntity>()
|
||||||
.eq("device_id",deviceEntity.getDeviceId()));
|
.eq("device_id",deviceEntity.getDeviceId()));
|
||||||
|
@ -428,34 +428,34 @@ public class TenDeviceServiceImpl extends ServiceImpl<TenDeviceDao, TenDeviceEnt
|
||||||
addList.add(dl);
|
addList.add(dl);
|
||||||
}
|
}
|
||||||
tenDeviceLabelService.saveBatch(addList);
|
tenDeviceLabelService.saveBatch(addList);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
//在同步表中插入所有信息
|
//在同步表中插入所有信息
|
||||||
// List<TenPersonIdUpdateAllVo> list = tenPersonService.findAllPersonIdUpdateAll(deviceEntity.getCellId(),
|
List<TenPersonIdUpdateAllVo> list = tenPersonService.findAllPersonIdUpdateAll(deviceEntity.getCellId(),
|
||||||
// deviceEntity.getBuildId(),
|
deviceEntity.getBuildId(),
|
||||||
// deviceEntity.getRoomId());
|
deviceEntity.getRoomId());
|
||||||
//// List<TenPersonSyncEntity> sList = new ArrayList<>();
|
// List<TenPersonSyncEntity> sList = new ArrayList<>();
|
||||||
// //1.删除设备关联的人
|
//1.删除设备关联的人
|
||||||
// //2.批量添加
|
//2.批量添加
|
||||||
// List<TenPersonSyncEntity> saveList = new ArrayList<>();
|
List<TenPersonSyncEntity> saveList = new ArrayList<>();
|
||||||
// for (TenPersonIdUpdateAllVo vo : list) {
|
for (TenPersonIdUpdateAllVo vo : list) {
|
||||||
// TenPersonSyncEntity entity = new TenPersonSyncEntity();
|
TenPersonSyncEntity entity = new TenPersonSyncEntity();
|
||||||
// entity.setDeviceId(deviceEntity.getDeviceId());
|
entity.setDeviceId(deviceEntity.getDeviceId());
|
||||||
// entity.setDeviceSn(deviceEntity.getSn());
|
entity.setDeviceSn(deviceEntity.getSn());
|
||||||
// entity.setLastUpdateTime(vo.getLast_update_stamp());
|
entity.setLastUpdateTime(vo.getLast_update_stamp());
|
||||||
// entity.setPersonId(vo.getUid());
|
entity.setPersonId(vo.getUid());
|
||||||
// entity.setState(0);
|
entity.setState(0);
|
||||||
// entity.setTenantId(deviceEntity.getTenantId());
|
entity.setTenantId(deviceEntity.getTenantId());
|
||||||
//// sList.add(entity);
|
// sList.add(entity);
|
||||||
// saveList.add(entity);
|
saveList.add(entity);
|
||||||
//// tenPersonSyncService.insert(entity);
|
// tenPersonSyncService.insert(entity);
|
||||||
// }
|
}
|
||||||
// if (saveList.size() > 0) {
|
if (saveList.size() > 0) {
|
||||||
// tenPersonSyncService.insertBatch(saveList, deviceEntity.getTenantId());
|
tenPersonSyncService.insertBatch(saveList, deviceEntity.getTenantId());
|
||||||
// }
|
}
|
||||||
|
|
||||||
// tenPersonSyncService.saveBatch(sList);
|
//tenPersonSyncService.insertBatch(saveList,);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1080,8 +1080,13 @@ public class TenPersonServiceImpl extends ServiceImpl<TenPersonDao,TenPersonEnti
|
||||||
Long personId = Long.parseLong(param.get("personId"));
|
Long personId = Long.parseLong(param.get("personId"));
|
||||||
cellId = Long.parseLong(param.get("cellId"));
|
cellId = Long.parseLong(param.get("cellId"));
|
||||||
TenPersonEntity entity = tenPersonDao.selectById(personId, cellId);
|
TenPersonEntity entity = tenPersonDao.selectById(personId, cellId);
|
||||||
|
if(entity!=null) {
|
||||||
entity.setLastUpdateTime(new Date());
|
entity.setLastUpdateTime(new Date());
|
||||||
tenPersonDao.updateById(entity);
|
tenPersonDao.updateById(entity);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//删除人员
|
//删除人员
|
||||||
tenPersonDao.updateWatchSafeVideo(personId, cellId);
|
tenPersonDao.updateWatchSafeVideo(personId, cellId);
|
||||||
|
@ -2720,15 +2725,17 @@ public class TenPersonServiceImpl extends ServiceImpl<TenPersonDao,TenPersonEnti
|
||||||
* @param fieldName 字段名称
|
* @param fieldName 字段名称
|
||||||
* @return 操作结果
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
public void saveOrUpdateByField(TenPersonEntity entity, String fieldName) {
|
public String saveOrUpdateByField(TenPersonEntity entity, String fieldName) {
|
||||||
QueryWrapper<TenPersonEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<TenPersonEntity> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq(fieldName, MyBeanUtils.getFieldValueByName(entity,fieldName));
|
queryWrapper.eq(fieldName, MyBeanUtils.getFieldValueByName(entity,fieldName));
|
||||||
TenPersonEntity existEntity = this.getOne(queryWrapper);
|
TenPersonEntity existEntity = this.getOne(queryWrapper);
|
||||||
|
|
||||||
if (existEntity == null) {
|
if (existEntity == null) {
|
||||||
this.save(entity);
|
this.save(entity);
|
||||||
|
return "save";
|
||||||
} else {
|
} else {
|
||||||
this.updateById(entity);
|
this.updateById(entity);
|
||||||
|
return "update";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue