From 72495ef2cab4c4c88ce268378362a6fed3476ab9 Mon Sep 17 00:00:00 2001 From: dearlin <1261008090@qq.com> Date: Mon, 26 Feb 2024 17:46:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=20=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/DepartmentController.java | 14 +++++++++++++- .../mapper/datasource/corp/CorpInfoMapper.java | 2 ++ .../com/zcloud/service/corp/CorpInfoService.java | 2 ++ .../service/corp/impl/CorpInfoServiceImpl.java | 5 +++++ .../mybatis/datasource/corp/CorpInfoMapper.xml | 10 +++++++++- 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zcloud/controller/system/DepartmentController.java b/src/main/java/com/zcloud/controller/system/DepartmentController.java index 7e86422..23324d4 100644 --- a/src/main/java/com/zcloud/controller/system/DepartmentController.java +++ b/src/main/java/com/zcloud/controller/system/DepartmentController.java @@ -61,6 +61,18 @@ public class DepartmentController extends BaseController { corpPage.put("CORPINFO_ID", corpinfoId); PageData corpInfo = corpInfoService.findById(corpPage); // {"deptName":"0226-wx","enterpriseId":4,"staffId":"","deptPhone":"","deptAddress":"","remark":"","deptDuty":""} + corpPage.put("enterpriseName",corpInfo.getString("CORP_NAME")); + if (Tools.isEmpty(corpInfo.getString("enterpriseId"))) { + JSONObject body = PLSUtil.GeneralPost("/deploy/enterprise/addDepEnterprise", corpPage, corpinfoId); + if (body != null) { + if (!"200".equals(body.getString("code"))) { + return ReturnMap.error("人员定位系统中部门新增失败"); + } + corpPage.put("enterpriseId", body.getString("data")); + corpInfo.put("enterpriseId", body.getString("data")); + corpInfoService.updateEnterpriseId(corpPage); + } + } PageData dept = new PageData(); dept.put("deptName", pd.getString("NAME")); dept.put("enterpriseId", corpInfo.get("enterpriseId")); @@ -69,7 +81,7 @@ public class DepartmentController extends BaseController { if (!"200".equals(body.getString("code"))) { return ReturnMap.error("人员定位系统中部门新增失败"); } - pd.put("deptId", body.getString("deptId")); + pd.put("deptId", body.getString("data")); } pd.put("DEPARTMENT_ID", this.get32UUID()); //主键 pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); //企业 diff --git a/src/main/java/com/zcloud/mapper/datasource/corp/CorpInfoMapper.java b/src/main/java/com/zcloud/mapper/datasource/corp/CorpInfoMapper.java index b4743e2..2817958 100644 --- a/src/main/java/com/zcloud/mapper/datasource/corp/CorpInfoMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/corp/CorpInfoMapper.java @@ -73,5 +73,7 @@ public interface CorpInfoMapper { PageData getInfo(PageData corpCondition); PageData eightWorkBI(PageData pd); + + void updateEnterpriseId(PageData corpPage); } diff --git a/src/main/java/com/zcloud/service/corp/CorpInfoService.java b/src/main/java/com/zcloud/service/corp/CorpInfoService.java index 2b23be0..ed9f58f 100644 --- a/src/main/java/com/zcloud/service/corp/CorpInfoService.java +++ b/src/main/java/com/zcloud/service/corp/CorpInfoService.java @@ -70,5 +70,7 @@ public interface CorpInfoService { public PageData findByCode(PageData pd)throws Exception; PageData eightWorkBI(PageData pd)throws Exception; + + void updateEnterpriseId(PageData corpPage); } diff --git a/src/main/java/com/zcloud/service/corp/impl/CorpInfoServiceImpl.java b/src/main/java/com/zcloud/service/corp/impl/CorpInfoServiceImpl.java index 23e5619..09ffbc7 100644 --- a/src/main/java/com/zcloud/service/corp/impl/CorpInfoServiceImpl.java +++ b/src/main/java/com/zcloud/service/corp/impl/CorpInfoServiceImpl.java @@ -113,5 +113,10 @@ public class CorpInfoServiceImpl implements CorpInfoService { return corpinfoMapper.eightWorkBI(pd); } + @Override + public void updateEnterpriseId(PageData corpPage) { + corpinfoMapper.updateEnterpriseId(corpPage); + } + } diff --git a/src/main/resources/mybatis/datasource/corp/CorpInfoMapper.xml b/src/main/resources/mybatis/datasource/corp/CorpInfoMapper.xml index 9650d4b..c3f566a 100644 --- a/src/main/resources/mybatis/datasource/corp/CorpInfoMapper.xml +++ b/src/main/resources/mybatis/datasource/corp/CorpInfoMapper.xml @@ -333,8 +333,16 @@ where CORPINFO_ID = #{CORPINFO_ID} + + update + + set + enterpriseId = #{enterpriseId} + where + CORPINFO_ID = #{CORPINFO_ID} + - +