diff --git a/src/main/java/com/zcloud/controller/system/UsersController.java b/src/main/java/com/zcloud/controller/system/UsersController.java index ee503d61..546cb06a 100644 --- a/src/main/java/com/zcloud/controller/system/UsersController.java +++ b/src/main/java/com/zcloud/controller/system/UsersController.java @@ -1034,7 +1034,7 @@ public class UsersController extends BaseController { map.put("USER_ID",ID); map.put("result", errInfo); //返回结果 map.put("code", "0"); - map.put("syncInfo", JSONUtils.toJSONString(userinfo)); + map.put("syncInfo", JSONUtil.toJsonStr(userinfo)); } else { map.put("result", "您输入的身份证号和用户名二次校验失败,请确认后重新申请"); //返回结果 } @@ -1056,6 +1056,12 @@ public class UsersController extends BaseController { pd = this.getPageData(); Map returnMap = null; if (pd.getString("ISPUSH").equals("1")) { + + // ------联通人员定位删除人员用------ + // 用于获取除UID ISDELETE外的其他信息 + PageData detail = usersService.findById(pd); + pd.putAll(detail); + // ------------------------------- pd.put("ISDELETE","1"); HashMap param = new HashMap<>(); Set set = pd.keySet(); @@ -2589,4 +2595,115 @@ public class UsersController extends BaseController { } return returnMap; } + + static String CREATOR = null; + static String OPERATOR = null; + @RequestMapping(value = "/initCore") + @ResponseBody + public Object initCore() throws Exception { + + PageData p1d = new PageData(); +// pd = this.getPageData(); + if (CREATOR == null) { + CREATOR = Jurisdiction.getUSER_ID(); + OPERATOR = Jurisdiction.getUSER_ID(); + } + List pageData = usersService.listAllUser(p1d); + + for (PageData pd : pageData) { + try { + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间 + pd.put("CREATOR", CREATOR); //创建人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + pd.put("OPERATOR", OPERATOR); //修改人 + PageData sexPd = new PageData(); + if (Tools.notEmpty(pd.getString("SEX"))) { + sexPd.put("DICTIONARIES_ID", pd.getString("SEX")); + PageData byId = dictionariesService.findById(sexPd); + if (Tools.notEmpty(byId)) { + pd.put("SEX", byId.getString("NAME")); + } + } + StringBuilder ORG_PATH = new StringBuilder(); + boolean hasPid = true; + PageData department = departmentService.findById(pd); + if (department != null) { + ORG_PATH.insert(0, department.getString("NAME")); + String deptId = department.getString("PARENT_ID"); + PageData deptPd = new PageData(); + deptPd.put("DEPARTMENT_ID", deptId); + if (!"0".equals(department.get("PARENT_ID"))) { + while (hasPid) { + PageData dept = departmentService.findById(deptPd); + if ("0".equals(dept.get("PARENT_ID"))) { + hasPid = false; + } else { + deptId = dept.getString("PARENT_ID"); + deptPd.put("DEPARTMENT_ID", deptId); + } + ORG_PATH.insert(0, dept.getString("NAME") + "/"); + } + } + pd.put("ORG_PATH", ORG_PATH); + } else { + ORG_PATH.insert(0, ""); + + + } + PageData CorpName = corpInfoService.findById(pd); + + + pd.put("CORPINFO_NAME", CorpName == null ? "" : CorpName.getString("CORP_NAME")); + pd.put("USER_TYPE", "1"); + + HashMap param = new HashMap<>(); + Set set = pd.keySet(); + for (Object key : set) { + param.put(key.toString(), pd.getString(key.toString())); + } + + + //要推送的照片集合 + List userPhotoDTOList = new ArrayList<>(); + //人脸照片 + PageData photoPd = new PageData(); + photoPd.put("USER_PHOTO_ID", pd.getString("IMGFILES_ID")); + photoPd.put("USER_ID", pd.getString("FOREIGN_KEY")); + photoPd.put("PHOTO_URL", pd.getString("FILEPATH")); + photoPd.put("PHOTO_TYPE", "1"); + photoPd.put("ISDELETE", "0"); + userPhotoDTOList.add(photoPd); + param.put("userPhotoDTOList", userPhotoDTOList); + String userResult = HttpClientUtilDoGet.sendHttpGet(tongBuUrl + "/docking/core/user/getUserInfoById" + "?USER_ID=" + pd.getString("USER_ID")); + Map userReturnMap = (Map) JSON.parse(userResult); + if (userReturnMap.get("USERINFO") != null) { //有用户数据获取修改信息 + PageData userInfoPd = JSON.parseObject(userReturnMap.get("USERINFO").toString(), PageData.class); + String updateDescription = UpdateEnum.getUpdateDescription(userInfoPd, pd); + param.put("REMARKS", updateDescription); + + } else { //没有数据则获取新增信息 + String insertDescription = UpdateEnum.getInsertDescription(pd); + param.put("REMARKS", insertDescription); + } + String UserDto = JSON.toJSONString(param); + String result = HttpClientUtilDoGet.sendHttpPost(tongBuUrl + "/docking/core/user/addOrUpdate", UserDto, null); + Map returnMap = (Map) JSON.parse(result); + if (returnMap.get("result").equals("success")) { + PageData pushPd = new PageData(); + pushPd.put("ISPUSH", "1"); + if (!Tools.isEmpty(pd.get("operateType")) && pd.getString("operateType").equals("delete")) { + pushPd.put("ISDELETE", "1"); + } else { + pushPd.put("ISDELETE", "0"); + } + pushPd.put("USER_ID", pd.getString("USER_ID")); + usersService.editPushStatus(pushPd); + } + }catch (Exception e){ + + } + } + + return null; + } } diff --git a/src/main/java/com/zcloud/syncData/SyncDataAdviceAspect.java b/src/main/java/com/zcloud/syncData/SyncDataAdviceAspect.java index 2acaf8ab..d50553f2 100644 --- a/src/main/java/com/zcloud/syncData/SyncDataAdviceAspect.java +++ b/src/main/java/com/zcloud/syncData/SyncDataAdviceAspect.java @@ -27,6 +27,7 @@ import java.util.Map; */ @Aspect @Component +@SuppressWarnings("all") public class SyncDataAdviceAspect { @Pointcut(value = "@annotation(com.zcloud.syncData.SyncPlatformAdvice)") diff --git a/src/main/java/com/zcloud/syncData/listener/SyncDataListener.java b/src/main/java/com/zcloud/syncData/listener/SyncDataListener.java index 93c6b1b2..a313f873 100644 --- a/src/main/java/com/zcloud/syncData/listener/SyncDataListener.java +++ b/src/main/java/com/zcloud/syncData/listener/SyncDataListener.java @@ -33,6 +33,7 @@ import java.util.Date; topic = "${mq.consumer.dataChange.tongbu-data-change.topic}", selectorType = SelectorType.TAG, messageModel = MessageModel.BROADCASTING) // 添加广播模式 +@SuppressWarnings("all") public class SyncDataListener implements RocketMQListener { @Autowired @@ -102,10 +103,10 @@ public class SyncDataListener implements RocketMQListener { // 相关方推送 xgfUserService.edit4Mq(syncInfo); } - PageData localData = usersService.findById(syncInfo); - if (localData != null && !localData.isEmpty()){ - usersService.editUser(syncInfo); - } +// PageData localData = usersService.findById(syncInfo); +// if (localData != null && !localData.isEmpty()){ +// usersService.editUser(syncInfo); +// } // 2024.8.9 按郭跃鹏提出:后期各公司从企业端分离后,需要其他公司的用户进行SQL联查,要求新增一张core_user的同步表,用于记录中台的所有用户数据 PageData coreLocalData = coreSyncUserMapper.findById(syncInfo); @@ -134,9 +135,9 @@ public class SyncDataListener implements RocketMQListener { String str = tenCorpDto.getData().getString("syncInfo"); PageData syncInfo = JSONUtil.toBean(str, PageData.class); PageData localData = departmentMapper.findById(syncInfo); - if (localData != null && !localData.isEmpty()){ - departmentMapper.edit(syncInfo); - } +// if (localData != null && !localData.isEmpty()){ +// departmentMapper.edit(syncInfo); +// } PageData coreLocalData = coreSyncDeptMapper.findById(syncInfo); try { @@ -161,9 +162,9 @@ public class SyncDataListener implements RocketMQListener { String str = tenCorpDto.getData().getString("syncInfo"); PageData syncInfo = JSONUtil.toBean(str, PageData.class); PageData localData = corpinfoMapper.findById(syncInfo); - if (localData != null && !localData.isEmpty()){ - corpinfoMapper.edit(syncInfo); - } +// if (localData != null && !localData.isEmpty()){ +// corpinfoMapper.edit(syncInfo); +// } PageData coreLocalData = coreSyncCorpMapper.findById(syncInfo); try { diff --git a/src/main/resources/mybatis/datasource/system/UsersMapper.xml b/src/main/resources/mybatis/datasource/system/UsersMapper.xml index e7625a89..1b0a68d3 100644 --- a/src/main/resources/mybatis/datasource/system/UsersMapper.xml +++ b/src/main/resources/mybatis/datasource/system/UsersMapper.xml @@ -391,19 +391,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update - set NAME = #{NAME}, - DEPARTMENT_ID = #{DEPARTMENT_ID}, - POST_ID =#{POST_ID}, - ROLE_ID = #{ROLE_ID}, - ROLE_IDS = #{ROLE_IDS}, - BZ = #{BZ}, - EMAIL = #{EMAIL}, - NUMBER = #{NUMBER}, - SORT = #{SORT}, - PERSON_TYPE = #{PERSON_TYPE}, - IS_HAZARDCONFIRMER = #{IS_HAZARDCONFIRMER}, - IS_ONLINELEARNING = #{IS_ONLINELEARNING}, - PHONE = #{PHONE} + set + + NAME = #{NAME} + + + ,DEPARTMENT_ID = #{DEPARTMENT_ID} + + + ,POST_ID = #{POST_ID} + + + ,ROLE_ID = #{ROLE_ID} + + + ,ROLE_IDS = #{ROLE_IDS} + + + ,BZ = #{BZ} + + + ,EMAIL = #{EMAIL} + + + ,NUMBER = #{NUMBER} + + + ,SORT = #{SORT} + + + ,PERSON_TYPE = #{PERSON_TYPE} + + + ,IS_HAZARDCONFIRMER = #{IS_HAZARDCONFIRMER} + + + ,IS_ONLINELEARNING = #{IS_ONLINELEARNING} + + + ,PHONE = #{PHONE} + ,ISPUSH = #{ISPUSH} @@ -770,17 +797,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"