From cfb4c2dd8e33e00814367a86a788448272a64e9f Mon Sep 17 00:00:00 2001 From: liujun Date: Mon, 18 Dec 2023 19:58:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=96=B9=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E5=8F=98=E9=9D=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/api/ApiXgfUserController.java | 16 +++++++++- .../mapper/datasource/xgf/XgfUserMapper.java | 1 - .../zcloud/service/xgf/XgfUserService.java | 2 ++ .../service/xgf/impl/XgfUserServiceImpl.java | 32 +++++++++++++++++-- .../datasource/xgf/XgfUserDetailsMapper.xml | 13 ++++---- .../mybatis/datasource/xgf/XgfUserMapper.xml | 18 ++++++++--- 6 files changed, 65 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java b/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java index 9ab58769..6cbe7b7d 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(); - System.out.println(request.getString("infoList")); List infoList = Warden.getList(request.getString("infoList")); xgfUserService.init(request); Map response = new HashMap(); @@ -36,4 +35,19 @@ public class ApiXgfUserController extends BaseController { throw new RuntimeException("系统异常"); } } + + @RequestMapping(value = "/approvalApplication") + @ResponseBody + public Object approvalApplication() throws Exception{ + try { + PageData request = this.getPageData(); + xgfUserService.approvalApplication(request); + Map response = new HashMap(); + response.put("result", "response"); + return response; + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException("系统异常"); + } + } } diff --git a/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java index f6edc42e..869d1efe 100644 --- a/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java @@ -54,5 +54,4 @@ public interface XgfUserMapper { * @throws Exception */ public List listByIds(PageData pd); - } diff --git a/src/main/java/com/zcloud/service/xgf/XgfUserService.java b/src/main/java/com/zcloud/service/xgf/XgfUserService.java index 1148c58d..95dd7356 100644 --- a/src/main/java/com/zcloud/service/xgf/XgfUserService.java +++ b/src/main/java/com/zcloud/service/xgf/XgfUserService.java @@ -14,4 +14,6 @@ public interface XgfUserService { List list(Page page) throws Exception; void init(PageData request); + + 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 9cbbd1bf..4a028a93 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -5,12 +5,14 @@ import com.zcloud.entity.PageData; import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.service.xgf.XgfUserService; +import com.zcloud.util.DateUtil; import com.zcloud.util.Warden; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.Arrays; import java.util.List; @Service @@ -45,18 +47,23 @@ public class XgfUserServiceImpl implements XgfUserService { try { PageData condition = new PageData(); if (StringUtils.isNotBlank(x.getString("USER_ID"))) { - condition.put("USER_ID", 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("XGF_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("XGF_USER_DETAILS_ID", x.get("XGF_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); } @@ -68,4 +75,23 @@ public class XgfUserServiceImpl implements XgfUserService { } } } + + @Override + public void approvalApplication(PageData request) throws Exception { + List list = Arrays.asList(request.getString("xgf_user_ids").split(",")) ; + + PageData condition = new PageData(); + condition.put("XGF_USER_IDS", list); + List entities = xgfUserMapper.listByIds(condition); + for (PageData x : entities) { + x.put("VALID_FLAG","0"); + x.put("STATUS","1"); + xgfUserMapper.edit(x); + } + PageData pd = new PageData(); + pd.put("XGF_USER_ID", request.getString("XGF_USER_ID")); + pd.put("ISDELETE", "1"); + xgfUserMapper.edit(pd); + xgfUserDetailsMapper.edit(pd); + } } diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml index 66ab9833..57865957 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml @@ -9,7 +9,7 @@ - f.XFG_USER_DETAILS_ID, + f.XGF_USER_DETAILS_ID, f.XGF_USER_ID, f.XGF_USER_NAME, f.BELONG_TO_CORP, @@ -55,7 +55,7 @@ - XFG_USER_DETAILS_ID, + XGF_USER_DETAILS_ID, XGF_USER_ID, XGF_USER_NAME, BELONG_TO_CORP, @@ -101,8 +101,7 @@ - #{XFG_USER_DETAILS_ID} - , + #{XGF_USER_DETAILS_ID}, #{XGF_USER_ID}, #{XGF_USER_NAME}, #{BELONG_TO_CORP}, @@ -172,7 +171,7 @@ update set - XFG_USER_DETAILS_ID = #{XFG_USER_DETAILS_ID}, + XGF_USER_DETAILS_ID = #{XGF_USER_DETAILS_ID}, XGF_USER_ID = #{XGF_USER_ID}, XGF_USER_NAME = #{XGF_USER_NAME}, BELONG_TO_CORP = #{BELONG_TO_CORP}, @@ -184,7 +183,7 @@ AGE = #{AGE}, HKLOCAL = #{HKLOCAL}, ADDRESS = #{ADDRESS}, - DEGREE_OF_EDUCATION = #{DEGREE_OF_EDUCATION},}, + DEGREE_OF_EDUCATION = #{DEGREE_OF_EDUCATION}, DEGREE_OF_EDUCATION_NAME = #{DEGREE_OF_EDUCATION_NAME}, CORP_START_DATE = #{CORP_START_DATE}, POST_ID = #{POST_ID}, @@ -215,7 +214,7 @@ IS_SPECIAL_JOB = #{IS_SPECIAL_JOB}, CORPINFO_ID = #{CORPINFO_ID} where - XFG_USER_DETAILS_ID = #{XFG_USER_DETAILS_ID} + 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 c723207c..0dbafc9c 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -17,7 +17,9 @@ f.BELONG_TO_CORP_NAME, f.ISDELETE, f.CREATED_TIME, - f.CORPINFO_ID + f.CORPINFO_ID, + f.STATUS, + f.OPERATOR_TIME @@ -30,7 +32,9 @@ BELONG_TO_CORP_NAME, ISDELETE, CREATED_TIME, - CORPINFO_ID + CORPINFO_ID, + STATUS, + OPERATOR_TIME @@ -43,7 +47,9 @@ #{BELONG_TO_CORP_NAME}, #{ISDELETE}, #{CREATED_TIME}, - #{CORPINFO_ID} + #{CORPINFO_ID}, + #{STATUS}, + #{OPERATOR_TIME} @@ -79,7 +85,9 @@ BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME}, ISDELETE = #{ISDELETE}, CREATED_TIME = #{CREATED_TIME}, - CORPINFO_ID = #{CORPINFO_ID} + CORPINFO_ID = #{CORPINFO_ID}, + STATUS = #{STATUS}, + OPERATOR_TIME = #{OPERATOR_TIME} where XGF_USER_ID = #{XGF_USER_ID} @@ -142,7 +150,7 @@ f where f.ISDELETE = '0' and XGF_USER_ID in - + #{item}