From 7360ba8cca78b9dea88b116200ed4e24c0847bbe Mon Sep 17 00:00:00 2001 From: liujun Date: Tue, 19 Dec 2023 20:03:25 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/api/ApiXgfUserController.java | 3 +- .../controller/openApi/OpenApiController.java | 17 +++++ .../controller/system/UsersController.java | 17 +++++ .../controller/xgf/FlowTrainController.java | 26 ++++--- .../controller/xgf/XgfUserController.java | 12 ++++ .../datasource/system/DepartmentMapper.java | 4 ++ .../mapper/datasource/system/UsersMapper.java | 1 + .../service/system/DepartmentService.java | 4 ++ .../zcloud/service/system/UsersService.java | 2 + .../system/impl/DepartmentServiceImpl.java | 35 +++++++++ .../service/system/impl/UsersServiceImpl.java | 5 ++ .../zcloud/service/xgf/XgfUserService.java | 2 +- .../service/xgf/impl/XgfUserServiceImpl.java | 72 ++++++++++--------- .../datasource/system/DepartmentMapper.xml | 13 ++++ .../mybatis/datasource/system/UsersMapper.xml | 18 +++++ .../datasource/xgf/TrainingBatchMapper.xml | 12 ++-- .../datasource/xgf/XgfUserDetailsMapper.xml | 15 ++-- .../mybatis/datasource/xgf/XgfUserMapper.xml | 30 ++++---- 18 files changed, 223 insertions(+), 65 deletions(-) diff --git a/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java b/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java index 6cbe7b7d..23147099 100644 --- a/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java +++ b/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java @@ -25,7 +25,6 @@ public class ApiXgfUserController extends BaseController { public Object synchronizationUserInfo() throws Exception { try { PageData request = this.getPageData(); - List infoList = Warden.getList(request.getString("infoList")); xgfUserService.init(request); Map response = new HashMap(); response.put("result", "response"); @@ -38,7 +37,7 @@ public class ApiXgfUserController extends BaseController { @RequestMapping(value = "/approvalApplication") @ResponseBody - public Object approvalApplication() throws Exception{ + public Object approvalApplication() throws Exception { try { PageData request = this.getPageData(); xgfUserService.approvalApplication(request); diff --git a/src/main/java/com/zcloud/controller/openApi/OpenApiController.java b/src/main/java/com/zcloud/controller/openApi/OpenApiController.java index 6c888b4e..8fab9475 100644 --- a/src/main/java/com/zcloud/controller/openApi/OpenApiController.java +++ b/src/main/java/com/zcloud/controller/openApi/OpenApiController.java @@ -66,6 +66,23 @@ public class OpenApiController extends BaseController { return map; } + /** + * 显示列表ztree + * @return + */ + @RequestMapping(value="/corpDepartment/listTree") + @ResponseBody + public Object listTreeRe()throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + JSONArray arr = JSONArray.fromObject(departmentService.listAllCorpDepartment("0")); + String json = arr.toString(); + json = json.replaceAll("DEPARTMENT_ID", "id").replaceAll("PARENT_ID", "pId").replaceAll("NAME", "name").replaceAll("subDepartment", "nodes").replaceAll("hasDepartment", "checked").replaceAll("treeurl", "url"); + map.put("zTreeNodes", json); + map.put("result", errInfo); + return map; + } + /**列表 * @throws Exception */ diff --git a/src/main/java/com/zcloud/controller/system/UsersController.java b/src/main/java/com/zcloud/controller/system/UsersController.java index 8beec699..c22fddb1 100644 --- a/src/main/java/com/zcloud/controller/system/UsersController.java +++ b/src/main/java/com/zcloud/controller/system/UsersController.java @@ -2401,5 +2401,22 @@ public class UsersController extends BaseController { map.put("result", errInfo); return map; } + /** + * @param + * @throws Exception + */ + @RequestMapping(value = "/getRegUserInfo") + @ResponseBody + public Object getRegUserInfo() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("LOCK_STATUS", "0"); + pd.put("ERROR_COUNT", 0); + map.put("list",usersService.getRegUserInfo(pd)); + map.put("result", errInfo); + return map; + } } diff --git a/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java b/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java index d3c4f6e1..125f1f73 100644 --- a/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java +++ b/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java @@ -3,15 +3,16 @@ package com.zcloud.controller.xgf; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; -import com.zcloud.util.Const; -import com.zcloud.util.HttpClientService; -import com.zcloud.util.Jurisdiction; +import com.zcloud.service.xgf.TrainingBatchService; +import com.zcloud.util.*; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -25,14 +26,23 @@ public class FlowTrainController extends BaseController { @Value("${preventionxgf.api.url}") private String xgfUrl; + @Resource + private TrainingBatchService trainingbatchService; + @RequestMapping(value="/batchList") @ResponseBody public Object batchList(Page page) throws Exception{ - PageData pd = new PageData(); - pd = this.getPageData(); - pd.put("MAndTUserId",Jurisdiction.getUSER_ID()); - Map result = HttpClientService.doPost(xgfUrl + "/openApi/trainingbatch/list" +getPageUrl(page), pd); - return result; + Map map = new HashMap(); + PageData pd = this.getPageData(); + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim()); + page.setPd(pd); + List varList = trainingbatchService.list(page); //列出TrainingBatch列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", "success"); + return map; } @RequestMapping(value="/batchUserList") diff --git a/src/main/java/com/zcloud/controller/xgf/XgfUserController.java b/src/main/java/com/zcloud/controller/xgf/XgfUserController.java index da7a0863..91bb1e22 100644 --- a/src/main/java/com/zcloud/controller/xgf/XgfUserController.java +++ b/src/main/java/com/zcloud/controller/xgf/XgfUserController.java @@ -19,6 +19,7 @@ public class XgfUserController extends BaseController { @Resource private XgfUserService xgfUserService; + @RequestMapping(value = "/list") @ResponseBody public Object list(Page page) throws Exception { @@ -43,4 +44,15 @@ public class XgfUserController extends BaseController { response.put("data", request); return response; } + + @RequestMapping(value = "/regulatoryUserList") + @ResponseBody + public Object regulatoryUserList() throws Exception{ + PageData request = this.getPageData(); + + PageData response = new PageData(); + response.put("result", "success"); + response.put("data", request); + return response; + } } diff --git a/src/main/java/com/zcloud/mapper/datasource/system/DepartmentMapper.java b/src/main/java/com/zcloud/mapper/datasource/system/DepartmentMapper.java index 5b9f4d3d..5fdb5712 100644 --- a/src/main/java/com/zcloud/mapper/datasource/system/DepartmentMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/system/DepartmentMapper.java @@ -177,5 +177,9 @@ public interface DepartmentMapper{ PageData getInfo(PageData pd) throws Exception; List listTreeManageAndCorpHasOrder(PageData pd); + + List listSubCorpDepartmentByParentId(String parentId); + + PageData findByCorpDepartmentId(PageData condition); } diff --git a/src/main/java/com/zcloud/mapper/datasource/system/UsersMapper.java b/src/main/java/com/zcloud/mapper/datasource/system/UsersMapper.java index 85a1f671..9bce4376 100644 --- a/src/main/java/com/zcloud/mapper/datasource/system/UsersMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/system/UsersMapper.java @@ -301,4 +301,5 @@ public interface UsersMapper { void resetCardNo(PageData pd); PageData getUserInfo(PageData pd); + List getUsersInfo(PageData pd); } diff --git a/src/main/java/com/zcloud/service/system/DepartmentService.java b/src/main/java/com/zcloud/service/system/DepartmentService.java index a79792c5..7c30e2a1 100644 --- a/src/main/java/com/zcloud/service/system/DepartmentService.java +++ b/src/main/java/com/zcloud/service/system/DepartmentService.java @@ -227,5 +227,9 @@ public interface DepartmentService{ PageData getDepartmentInfo(PageData pd) throws Exception; List listTreeManageAndCorpHasOrder(PageData pd); + + List listAllCorpDepartment(String number) throws Exception; + + PageData getCorpDepartment(PageData condition) throws Exception; } diff --git a/src/main/java/com/zcloud/service/system/UsersService.java b/src/main/java/com/zcloud/service/system/UsersService.java index f6f9b316..05efcfd7 100644 --- a/src/main/java/com/zcloud/service/system/UsersService.java +++ b/src/main/java/com/zcloud/service/system/UsersService.java @@ -352,4 +352,6 @@ public interface UsersService { void resetCardNo(PageData pd); PageData getUserInfo(PageData pd); + + List getRegUserInfo(PageData pd); } diff --git a/src/main/java/com/zcloud/service/system/impl/DepartmentServiceImpl.java b/src/main/java/com/zcloud/service/system/impl/DepartmentServiceImpl.java index 13c86e06..5be056e3 100644 --- a/src/main/java/com/zcloud/service/system/impl/DepartmentServiceImpl.java +++ b/src/main/java/com/zcloud/service/system/impl/DepartmentServiceImpl.java @@ -6,6 +6,7 @@ import java.util.stream.Collectors; import com.zcloud.entity.system.Menu; import com.zcloud.mapper.datasource.system.SupervisionDepartmentMapper; +import com.zcloud.mapper.dsno2.system.Department2Mapper; import com.zcloud.util.DateUtil; import com.zcloud.util.Jurisdiction; import com.zcloud.util.UuidUtil; @@ -33,6 +34,9 @@ public class DepartmentServiceImpl implements DepartmentService{ @Resource private DepartmentMapper departmentMapper; + + @Resource + private Department2Mapper department2Mapper; /**新增 * @param pd * @throws Exception @@ -419,5 +423,36 @@ public class DepartmentServiceImpl implements DepartmentService{ public List listTreeManageAndCorpHasOrder(PageData pd) { return departmentMapper.listTreeManageAndCorpHasOrder(pd); } + + @Override + public List listAllCorpDepartment(String parentId) throws Exception{ + List departmentList = this.listSubCorpDepartmentByParentId(parentId); + for(Department depar : departmentList){ + depar.setTreeurl("department_list.html?DEPARTMENT_ID="+depar.getDEPARTMENT_ID()); + depar.setSubDepartment(this.listAllCorpDepartment(depar.getDEPARTMENT_ID())); + depar.setTarget("treeFrame"); + depar.setIcon("../../../assets/images/user.gif"); + } + return departmentList; + } + + @Override + public PageData getCorpDepartment(PageData condition) throws Exception { + return departmentMapper.findByCorpDepartmentId(condition); + } + + /** + * 通过ID获取其子级列表 + * @param parentId + * @return + * @throws Exception + */ + public List listSubCorpDepartmentByParentId(String parentId) throws Exception { + return departmentMapper.listSubCorpDepartmentByParentId(parentId); + } + + + + } diff --git a/src/main/java/com/zcloud/service/system/impl/UsersServiceImpl.java b/src/main/java/com/zcloud/service/system/impl/UsersServiceImpl.java index 84142fa1..1559789b 100644 --- a/src/main/java/com/zcloud/service/system/impl/UsersServiceImpl.java +++ b/src/main/java/com/zcloud/service/system/impl/UsersServiceImpl.java @@ -473,4 +473,9 @@ public class UsersServiceImpl implements UsersService { public PageData getUserInfo(PageData pd) { return usersMapper.getUserInfo(pd); } + + @Override + public List getRegUserInfo(PageData pd) { + return usersMapper.getUsersInfo(pd); + } } diff --git a/src/main/java/com/zcloud/service/xgf/XgfUserService.java b/src/main/java/com/zcloud/service/xgf/XgfUserService.java index fcf3d30a..60dd151a 100644 --- a/src/main/java/com/zcloud/service/xgf/XgfUserService.java +++ b/src/main/java/com/zcloud/service/xgf/XgfUserService.java @@ -13,7 +13,7 @@ public interface XgfUserService { List list(Page page) throws Exception; - void init(PageData request); + void init(PageData request) throws Exception; void approvalApplication(PageData request) throws Exception; diff --git a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java index 19719c4b..11627079 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -4,11 +4,10 @@ import com.zcloud.entity.Page; import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper; +import com.zcloud.service.bus.CorpInfoService; +import com.zcloud.service.system.DepartmentService; import com.zcloud.service.xgf.XgfUserService; -import com.zcloud.util.DateUtil; -import com.zcloud.util.HttpClientService; -import com.zcloud.util.HttpClientUtil; -import com.zcloud.util.Warden; +import com.zcloud.util.*; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -29,6 +28,9 @@ public class XgfUserServiceImpl implements XgfUserService { @Resource private XgfUserDetailsMapper xgfUserDetailsMapper; + @Resource + private DepartmentService departmentService; + @Value("${preventionxgf.api.url}") private String prevention_xgf_url; @@ -49,37 +51,43 @@ public class XgfUserServiceImpl implements XgfUserService { @Override @Transactional - public void init(PageData request) { + public void init(PageData request) throws Exception { List list = Warden.getList(request.getString("infoList")); + PageData condition = new PageData(); for (PageData x : list) { - try { - PageData condition = new PageData(); - if (StringUtils.isNotBlank(x.getString("USER_ID"))) { - condition.put("XGF_USER_ID", x.getString("USER_ID")); - PageData entity = xgfUserMapper.findById(condition); - if (entity == null || entity.size() <= 0) { - x.put("XGF_USER_ID", x.get("USER_ID")); - x.put("XGF_USER_DETAILS_ID", x.get("USER_ID")); - x.put("ISDELETE", "0"); - x.put("VALID_FLAG", "1"); - x.put("STATUS", "2"); - x.put("CREATED_TIME", DateUtil.getTime()); - x.put("OPERATOR_TIME", DateUtil.getTime()); - xgfUserMapper.save(x); - xgfUserDetailsMapper.save(x); - } else { - x.put("XGF_USER_ID", x.get("USER_ID")); - x.put("XFG_USER_DETAILS_ID", x.get("USER_ID")); - x.put("ISDELETE", "0"); - x.put("OPERATOR_TIME", DateUtil.getTime()); - xgfUserMapper.edit(x); - xgfUserDetailsMapper.edit(x); - } - } + if (StringUtils.isNotBlank(x.getString("USER_ID"))) { + condition.put("XGF_USER_ID", x.getString("USER_ID")); + PageData entity = xgfUserMapper.findById(condition); + if (entity == null || entity.size() <= 0) { + x.put("XGF_USER_ID", x.get("USER_ID")); + x.put("XGF_USER_DETAILS_ID", x.get("USER_ID")); + x.put("ISDELETE", "0"); + x.put("VALID_FLAG", "1"); + x.put("STATUS", "2"); + x.put("CREATED_TIME", DateUtil.getTime()); + x.put("OPERATOR_TIME", DateUtil.getTime()); + condition.clear(); + condition.put("DEPARTMENT_ID","MANAGER_DEPARTMENT_ID"); + PageData regDepartmentEntity = departmentService.getCorpDepartment(condition); + x.put("MANAGER_DEPARTMENT_NAME",regDepartmentEntity.get("NAME")); + xgfUserMapper.save(x); + xgfUserDetailsMapper.save(x); + } else { + x.put("XGF_USER_ID", x.get("USER_ID")); + x.put("XGF_USER_DETAILS_ID", x.get("USER_ID")); + x.put("ISDELETE", "0"); + x.put("OPERATOR_TIME", DateUtil.getTime()); + condition.clear(); + condition.put("DEPARTMENT_ID",x.get("MANAGER_DEPARTMENT_ID")); + PageData regDepartmentEntity = departmentService.getCorpDepartment(condition); + x.put("MANAGER_DEPARTMENT_NAME",regDepartmentEntity.get("NAME")); - } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("保存数据失败"); + x.put("ISDELETE", "0"); + x.put("VALID_FLAG", "1"); + x.put("STATUS", "2"); + xgfUserMapper.edit(x); + xgfUserDetailsMapper.edit(x); + } } } } diff --git a/src/main/resources/mybatis/datasource/system/DepartmentMapper.xml b/src/main/resources/mybatis/datasource/system/DepartmentMapper.xml index 2215e418..fc23d5e8 100644 --- a/src/main/resources/mybatis/datasource/system/DepartmentMapper.xml +++ b/src/main/resources/mybatis/datasource/system/DepartmentMapper.xml @@ -579,4 +579,17 @@ DEP_ORDER ASC, name + + diff --git a/src/main/resources/mybatis/datasource/system/UsersMapper.xml b/src/main/resources/mybatis/datasource/system/UsersMapper.xml index 59ce3768..b3f6e302 100644 --- a/src/main/resources/mybatis/datasource/system/UsersMapper.xml +++ b/src/main/resources/mybatis/datasource/system/UsersMapper.xml @@ -1328,4 +1328,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + diff --git a/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml b/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml index f20102f0..5a27117a 100644 --- a/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml @@ -4,7 +4,7 @@ - BUS_TRAININGBATCH + xgf_training_batch @@ -201,20 +201,20 @@ from f left join vi_department_all ma on ma.DEPARTMENT_ID = f.MANAGER - left join vi_corp_user ma_u on ma_u.USER_ID = f.MANAGER_USER_ID + left join vi_user_all ma_u on ma_u.USER_ID = f.MANAGER_USER_ID left join vi_department_all su on su.DEPARTMENT_ID = f.SUPERVISION left join vi_regulatory_user su_u on su_u.USER_ID = f.SUPERVISION_USER_ID left join vi_department_all te on te.DEPARTMENT_ID = f.TERRITORIALITY - left join vi_corp_user te_u on te_u.USER_ID = f.TERRITORIALITY_USER_ID - left join vi_corp_user cu on cu.USER_ID = f.TRAIN_CORP_LEADER + left join vi_user_all te_u on te_u.USER_ID = f.TERRITORIALITY_USER_ID + left join vi_user_all cu on cu.USER_ID = f.TRAIN_CORP_LEADER left join sys_dictionaries d on d.DICTIONARIES_ID = f.TRAIN_AREA left join bus_corpinfo c on c.CORPINFO_ID = f.CORPINFO_ID left join BUS_CORPINFODETAILS bcd on bcd.CORPINFO_ID = c.CORPINFO_ID left join sys_dictionaries corpTypeDic on corpTypeDic.BIANMA = bcd.CORP_TYPE left join vi_regulatory_department md on md.DEPARTMENT_ID = c.MAIN_DEPARTMENT left join sys_user syu on syu.USERNAME = f.CREATOR - left join vi_corp_user vcu on vcu.USERNAME = f.CREATOR - left join vi_corp_department vcd on vcd.DEPARTMENT_ID = c.SUPERVISE_DEPARTMENT_ID + left join vi_user_all vcu on vcu.USERNAME = f.CREATOR + left join vi_department_all vcd on vcd.DEPARTMENT_ID = c.SUPERVISE_DEPARTMENT_ID left join vi_corp_info vci on vci.CORPINFO_ID = c.SUPERVISE_CORPINFO_ID where 1=1 diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml index 57865957..a04a52a5 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml @@ -50,7 +50,8 @@ f.IS_LEVEL_THREE, f.IS_BODY_ADAPT, f.IS_SPECIAL_JOB, - f.CORPINFO_ID + f.CORPINFO_ID, + f.MANAGER_DEPARTMENT_ID @@ -96,7 +97,9 @@ IS_LEVEL_THREE, IS_BODY_ADAPT, IS_SPECIAL_JOB, - CORPINFO_ID + CORPINFO_ID, + MANAGER_DEPARTMENT_ID, + MANAGER_DEPARTMENT_NAME @@ -142,7 +145,9 @@ #{IS_LEVEL_THREE}, #{IS_BODY_ADAPT}, #{IS_SPECIAL_JOB}, - #{CORPINFO_ID} + #{CORPINFO_ID}, + #{MANAGER_DEPARTMENT_ID}, + #{MANAGER_DEPARTMENT_NAME} @@ -212,7 +217,9 @@ IS_LEVEL_THREE = #{IS_LEVEL_THREE}, IS_BODY_ADAPT = #{IS_BODY_ADAPT}, IS_SPECIAL_JOB = #{IS_SPECIAL_JOB}, - CORPINFO_ID = #{CORPINFO_ID} + CORPINFO_ID = #{CORPINFO_ID}, + MANAGER_DEPARTMENT_ID = #{MANAGER_DEPARTMENT_ID}, + MANAGER_DEPARTMENT_NAME = #{MANAGER_DEPARTMENT_NAME} where XGF_USER_DETAILS_ID = #{XGF_USER_DETAILS_ID} diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml index 32fbcc66..3ab8dcc0 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -182,18 +182,24 @@ + select + + from + + f + where f.ISDELETE = '0' + and XGF_USER_ID in + + #{item} + + + select a.XGF_USER_ID,a.BELONG_TO_CORP_NAME,a.USERNAME,a.NAME,b.MANAGER_DEPARTMENT_ID from xgf_user a + left join xgf_user_details b on a.XGF_USER_ID = b.XGF_USER_ID + where 1=1 + + and a.STATUS = #{pd.STATUS} + +