From 1cb6ce1c9559cbab3f91230662a273c21d42c398 Mon Sep 17 00:00:00 2001 From: water_xu Date: Tue, 10 Sep 2024 15:38:03 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E4=BA=BA=E5=91=98=E4=B8=AD=E5=8F=B0?= =?UTF-8?q?=20-=20=E4=BA=BA=E5=91=98=E5=88=9D=E5=A7=8B=E5=8C=96=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit b3ec041f58ed2c70df892f65e3ea9a6750f378a4. --- .../controller/system/UsersController.java | 111 ------------------ .../mybatis/datasource/system/UsersMapper.xml | 66 ++++------- 2 files changed, 23 insertions(+), 154 deletions(-) diff --git a/src/main/java/com/zcloud/controller/system/UsersController.java b/src/main/java/com/zcloud/controller/system/UsersController.java index 65cf57f4..bfde8859 100644 --- a/src/main/java/com/zcloud/controller/system/UsersController.java +++ b/src/main/java/com/zcloud/controller/system/UsersController.java @@ -2590,115 +2590,4 @@ 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/resources/mybatis/datasource/system/UsersMapper.xml b/src/main/resources/mybatis/datasource/system/UsersMapper.xml index 1b0a68d3..e7625a89 100644 --- a/src/main/resources/mybatis/datasource/system/UsersMapper.xml +++ b/src/main/resources/mybatis/datasource/system/UsersMapper.xml @@ -391,46 +391,19 @@ 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} @@ -797,9 +770,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"