From a0dcdb61d3ff40fa502be12ae19c9c2256efad03 Mon Sep 17 00:00:00 2001 From: liujun Date: Mon, 18 Dec 2023 18:54:50 +0800 Subject: [PATCH 01/21] =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=96=B9=E9=9C=80?= =?UTF-8?q?=E6=B1=82=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 | 39 +++ .../zcloud/controller/api/dto/XgfUserDto.java | 4 + .../controller/xgf/XgfUserController.java | 36 +++ .../datasource/xgf/XgfUserDetailsMapper.java | 58 ++++ .../mapper/datasource/xgf/XgfUserMapper.java | 58 ++++ .../zcloud/service/xgf/XgfUserService.java | 17 ++ .../service/xgf/impl/XgfUserServiceImpl.java | 71 +++++ .../datasource/xgf/XgfUserDetailsMapper.xml | 286 ++++++++++++++++++ .../mybatis/datasource/xgf/XgfUserMapper.xml | 150 +++++++++ 9 files changed, 719 insertions(+) create mode 100644 src/main/java/com/zcloud/controller/api/ApiXgfUserController.java create mode 100644 src/main/java/com/zcloud/controller/api/dto/XgfUserDto.java create mode 100644 src/main/java/com/zcloud/controller/xgf/XgfUserController.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserDetailsMapper.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java create mode 100644 src/main/java/com/zcloud/service/xgf/XgfUserService.java create mode 100644 src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java create mode 100644 src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml create mode 100644 src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml diff --git a/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java b/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java new file mode 100644 index 00000000..9ab58769 --- /dev/null +++ b/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java @@ -0,0 +1,39 @@ +package com.zcloud.controller.api; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.PageData; +import com.zcloud.service.xgf.XgfUserService; +import com.zcloud.util.Warden; +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; + +@Controller +@RequestMapping("/openApi/xfgUser") +public class ApiXgfUserController extends BaseController { + + @Resource + private XgfUserService xgfUserService; + + @RequestMapping(value = "/synchronizationUserInfo") + @ResponseBody + 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(); + response.put("result", "response"); + return response; + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException("系统异常"); + } + } +} diff --git a/src/main/java/com/zcloud/controller/api/dto/XgfUserDto.java b/src/main/java/com/zcloud/controller/api/dto/XgfUserDto.java new file mode 100644 index 00000000..60948602 --- /dev/null +++ b/src/main/java/com/zcloud/controller/api/dto/XgfUserDto.java @@ -0,0 +1,4 @@ +package com.zcloud.controller.api.dto; + +public class XgfUserDto { +} diff --git a/src/main/java/com/zcloud/controller/xgf/XgfUserController.java b/src/main/java/com/zcloud/controller/xgf/XgfUserController.java new file mode 100644 index 00000000..b71515a5 --- /dev/null +++ b/src/main/java/com/zcloud/controller/xgf/XgfUserController.java @@ -0,0 +1,36 @@ +package com.zcloud.controller.xgf; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.system.UsersService; +import com.zcloud.service.xgf.XgfUserService; +import com.zcloud.util.HttpClientService; +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.Map; + +@Controller +@RequestMapping("/xgf/user") +public class XgfUserController extends BaseController { + + @Resource + private XgfUserService xgfUserService; + + @RequestMapping(value = "/list") + @ResponseBody + public Object getLevels(Page page) throws Exception { + PageData request = this.getPageData(); + page.setPd(request); + xgfUserService.list(page); + PageData response = new PageData(); + response.put("result", "success"); + response.put("page", page); + response.put("data", request); + return response; + } +} diff --git a/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserDetailsMapper.java b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserDetailsMapper.java new file mode 100644 index 00000000..9ac6f5d0 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserDetailsMapper.java @@ -0,0 +1,58 @@ +package com.zcloud.mapper.datasource.xgf; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +public interface XgfUserDetailsMapper { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**批量删除 + * @param pd + * @throws Exception + */ + void deleteAll(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List listPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**列表(根据多选ID查询数据) + * @param pd + * @throws Exception + */ + public List listByIds(PageData pd); + +} diff --git a/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java new file mode 100644 index 00000000..f6edc42e --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java @@ -0,0 +1,58 @@ +package com.zcloud.mapper.datasource.xgf; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +public interface XgfUserMapper { + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**批量删除 + * @param pd + * @throws Exception + */ + void deleteAll(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List listPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**列表(根据多选ID查询数据) + * @param pd + * @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 new file mode 100644 index 00000000..1148c58d --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/XgfUserService.java @@ -0,0 +1,17 @@ +package com.zcloud.service.xgf; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +public interface XgfUserService { + + void save(PageData pd) throws Exception; + + void saveDetail(PageData pd) throws Exception; + + List list(Page page) throws Exception; + + void init(PageData request); +} diff --git a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java new file mode 100644 index 00000000..9cbbd1bf --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -0,0 +1,71 @@ +package com.zcloud.service.xgf.impl; + +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.xgf.XgfUserService; +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.List; + +@Service +public class XgfUserServiceImpl implements XgfUserService { + + @Resource + private XgfUserMapper xgfUserMapper; + + @Resource + private XgfUserDetailsMapper xgfUserDetailsMapper; + + @Override + public void save(PageData pd) throws Exception { + xgfUserMapper.save(pd); + } + + @Override + public void saveDetail(PageData pd) throws Exception { + xgfUserDetailsMapper.save(pd); + } + + @Override + public List list(Page page) throws Exception { + return xgfUserDetailsMapper.listPage(page); + } + + @Override + @Transactional + public void init(PageData request) { + List list = Warden.getList(request.getString("infoList")); + for (PageData x : list) { + try { + PageData condition = new PageData(); + if (StringUtils.isNotBlank(x.getString("USER_ID"))) { + condition.put("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("ISDELETE","0"); + 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("ISDELETE","0"); + xgfUserMapper.edit(x); + xgfUserDetailsMapper.edit(x); + } + } + + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException("保存数据失败"); + } + } + } +} diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml new file mode 100644 index 00000000..66ab9833 --- /dev/null +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml @@ -0,0 +1,286 @@ + + + + + + + XGF_USER_DETAILS + + + + + f.XFG_USER_DETAILS_ID, + f.XGF_USER_ID, + f.XGF_USER_NAME, + f.BELONG_TO_CORP, + f.BELONG_TO_CORP_NAME, + f.PHONE, + f.CREAT_TIME, + f.DEPART_STATE, + f.ISDELETE, + f.AGE, + f.HKLOCAL, + f.ADDRESS, + f.DEGREE_OF_EDUCATION, + f.DEGREE_OF_EDUCATION_NAME, + f.CORP_START_DATE, + f.POST_ID, + f.POST_NAME, + f.WORK_SIGN, + f.JOINED_DATE, + f.WORK_DATE, + f.PHOTO, + f.DATE_OF_BIRTH, + f.ISPAY, + f.ISPAY_NUMBER, + f.IS_SAFETY_TELL, + f.IS_SAFETY_TIME, + f.IS_INJURIES_PAY, + f.IS_SIGN_LABOR, + f.SEX, + f.ENTRY_DATE, + f.PERSON_WORK_TYPE, + f.PERSON_WORK_TYPE_NAME, + f.NATIONALITY, + f.NATIONALITY_NAME, + f.POLITICAL_TIME, + f.POLITICAL_STATUS, + f.POLITICAL_STATUS_NAME, + f.IS_INJURIES_PAY_TIME, + f.IS_LEVEL_THREE, + f.IS_BODY_ADAPT, + f.IS_SPECIAL_JOB, + f.CORPINFO_ID + + + + + XFG_USER_DETAILS_ID, + XGF_USER_ID, + XGF_USER_NAME, + BELONG_TO_CORP, + BELONG_TO_CORP_NAME, + PHONE, + CREAT_TIME, + DEPART_STATE, + ISDELETE, + AGE, + HKLOCAL, + ADDRESS, + DEGREE_OF_EDUCATION, + DEGREE_OF_EDUCATION_NAME, + CORP_START_DATE, + POST_ID, + POST_NAME, + WORK_SIGN, + JOINED_DATE, + WORK_DATE, + PHOTO, + DATE_OF_BIRTH, + ISPAY, + ISPAY_NUMBER, + IS_SAFETY_TELL, + IS_SAFETY_TIME, + IS_INJURIES_PAY, + IS_SIGN_LABOR, + SEX, + ENTRY_DATE, + PERSON_WORK_TYPE, + PERSON_WORK_TYPE_NAME, + NATIONALITY, + NATIONALITY_NAME, + POLITICAL_TIME, + POLITICAL_STATUS, + POLITICAL_STATUS_NAME, + IS_INJURIES_PAY_TIME, + IS_LEVEL_THREE, + IS_BODY_ADAPT, + IS_SPECIAL_JOB, + CORPINFO_ID + + + + + #{XFG_USER_DETAILS_ID} + , + #{XGF_USER_ID}, + #{XGF_USER_NAME}, + #{BELONG_TO_CORP}, + #{BELONG_TO_CORP_NAME}, + #{PHONE}, + #{CREAT_TIME}, + #{DEPART_STATE}, + #{ISDELETE}, + #{AGE}, + #{HKLOCAL}, + #{ADDRESS}, + #{DEGREE_OF_EDUCATION}, + #{DEGREE_OF_EDUCATION_NAME}, + #{CORP_START_DATE}, + #{POST_ID}, + #{POST_NAME}, + #{WORK_SIGN}, + #{JOINED_DATE}, + #{WORK_DATE}, + #{PHOTO}, + #{DATE_OF_BIRTH}, + #{ISPAY}, + #{ISPAY_NUMBER}, + #{IS_SAFETY_TELL}, + #{IS_SAFETY_TIME}, + #{IS_INJURIES_PAY}, + #{IS_SIGN_LABOR}, + #{SEX}, + #{ENTRY_DATE}, + #{PERSON_WORK_TYPE}, + #{PERSON_WORK_TYPE_NAME}, + #{NATIONALITY}, + #{NATIONALITY_NAME}, + #{POLITICAL_TIME}, + #{POLITICAL_STATUS}, + #{POLITICAL_STATUS_NAME}, + #{IS_INJURIES_PAY_TIME}, + #{IS_LEVEL_THREE}, + #{IS_BODY_ADAPT}, + #{IS_SPECIAL_JOB}, + #{CORPINFO_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + XGF_USER_ID = #{XGF_USER_ID} + + + + + update + + set + XFG_USER_DETAILS_ID = #{XFG_USER_DETAILS_ID}, + XGF_USER_ID = #{XGF_USER_ID}, + XGF_USER_NAME = #{XGF_USER_NAME}, + BELONG_TO_CORP = #{BELONG_TO_CORP}, + BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME}, + PHONE = #{PHONE}, + CREAT_TIME = #{CREAT_TIME}, + DEPART_STATE = #{DEPART_STATE}, + ISDELETE = #{ISDELETE}, + AGE = #{AGE}, + HKLOCAL = #{HKLOCAL}, + ADDRESS = #{ADDRESS}, + DEGREE_OF_EDUCATION = #{DEGREE_OF_EDUCATION},}, + DEGREE_OF_EDUCATION_NAME = #{DEGREE_OF_EDUCATION_NAME}, + CORP_START_DATE = #{CORP_START_DATE}, + POST_ID = #{POST_ID}, + POST_NAME = #{POST_NAME}, + WORK_SIGN = #{WORK_SIGN}, + JOINED_DATE = #{JOINED_DATE}, + WORK_DATE = #{WORK_DATE}, + PHOTO = #{PHOTO}, + DATE_OF_BIRTH = #{DATE_OF_BIRTH}, + ISPAY = #{ISPAY}, + ISPAY_NUMBER = #{ISPAY_NUMBER}, + IS_SAFETY_TELL = #{IS_SAFETY_TELL}, + IS_SAFETY_TIME = #{IS_SAFETY_TIME}, + IS_INJURIES_PAY = #{IS_INJURIES_PAY}, + IS_SIGN_LABOR = #{IS_SIGN_LABOR}, + SEX = #{SEX}, + ENTRY_DATE = #{ENTRY_DATE}, + PERSON_WORK_TYPE = #{PERSON_WORK_TYPE}, + PERSON_WORK_TYPE_NAME = #{PERSON_WORK_TYPE_NAME}, + NATIONALITY = #{NATIONALITY}, + NATIONALITY_NAME = #{NATIONALITY_NAME}, + POLITICAL_TIME = #{POLITICAL_TIME}, + POLITICAL_STATUS = #{POLITICAL_STATUS}, + POLITICAL_STATUS_NAME = #{POLITICAL_STATUS_NAME}, + IS_INJURIES_PAY_TIME = #{IS_INJURIES_PAY_TIME}, + IS_LEVEL_THREE = #{IS_LEVEL_THREE}, + IS_BODY_ADAPT = #{IS_BODY_ADAPT}, + IS_SPECIAL_JOB = #{IS_SPECIAL_JOB}, + CORPINFO_ID = #{CORPINFO_ID} + where + XFG_USER_DETAILS_ID = #{XFG_USER_DETAILS_ID} + + + + + + + + + + + + + + update + + set + ISDELETE = '1', + OPERATOR = #{OPERATOR}, + OPERATTIME = #{OPERATTIME} + where + XFG_USER_DETAILS_ID in + + #{item} + + + + + + + diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml new file mode 100644 index 00000000..c723207c --- /dev/null +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -0,0 +1,150 @@ + + + + + + + XGF_USER + + + + + f.XGF_USER_ID, + f.USERNAME, + f.NAME, + f.VALID_FLAG, + f.BELONG_TO_CORP, + f.BELONG_TO_CORP_NAME, + f.ISDELETE, + f.CREATED_TIME, + f.CORPINFO_ID + + + + + XGF_USER_ID, + USERNAME, + NAME, + VALID_FLAG, + BELONG_TO_CORP, + BELONG_TO_CORP_NAME, + ISDELETE, + CREATED_TIME, + CORPINFO_ID + + + + + #{XGF_USER_ID}, + #{USERNAME}, + #{NAME}, + #{VALID_FLAG}, + #{BELONG_TO_CORP}, + #{BELONG_TO_CORP_NAME}, + #{ISDELETE}, + #{CREATED_TIME}, + #{CORPINFO_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + XGF_USER_ID = #{XGF_USER_ID} + + + + + update + + set + USERNAME = #{USERNAME}, + NAME = #{NAME}, + VALID_FLAG = #{VALID_FLAG}, + BELONG_TO_CORP = #{BELONG_TO_CORP}, + BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME}, + ISDELETE = #{ISDELETE}, + CREATED_TIME = #{CREATED_TIME}, + CORPINFO_ID = #{CORPINFO_ID} + where + XGF_USER_ID = #{XGF_USER_ID} + + + + + + + + + + + + + + update + + set + ISDELETE = '1', + OPERATOR = #{OPERATOR}, + OPERATTIME = #{OPERATTIME} + where + SPECIALEQUIPMENT_ID in + + #{item} + + + + + + + From cfb4c2dd8e33e00814367a86a788448272a64e9f Mon Sep 17 00:00:00 2001 From: liujun Date: Mon, 18 Dec 2023 19:58:52 +0800 Subject: [PATCH 02/21] =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=96=B9=E9=9C=80?= =?UTF-8?q?=E6=B1=82=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} From 6d497732422a94b13ed8cf3029484564f017ad0a Mon Sep 17 00:00:00 2001 From: liujun Date: Mon, 18 Dec 2023 20:24:02 +0800 Subject: [PATCH 03/21] =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=96=B9=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E5=8F=98=E9=9D=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/xgf/TrainUsersController.java | 230 +++++++++ .../xgf/TrainingBatchController.java | 400 +++++++++++++++ .../datasource/xgf/FlowDetailMapper.java | 16 + .../mapper/datasource/xgf/FlowMapper.java | 16 + .../datasource/xgf/TrainUsersMapper.java | 129 +++++ .../datasource/xgf/TrainingBatchMapper.java | 78 +++ .../mapper/datasource/xgf/XgfUserMapper.java | 10 + .../zcloud/service/xgf/TrainUsersService.java | 99 ++++ .../service/xgf/TrainingBatchService.java | 91 ++++ .../xgf/impl/TrainUsersServiceImpl.java | 305 +++++++++++ .../xgf/impl/TrainingBatchServiceImpl.java | 341 +++++++++++++ .../datasource/xgf/FlowDetailMapper.xml | 132 +++++ .../mybatis/datasource/xgf/FlowMapper.xml | 91 ++++ .../datasource/xgf/TrainUsersMapper.xml | 482 ++++++++++++++++++ .../datasource/xgf/TrainingBatchMapper.xml | 421 +++++++++++++++ .../mybatis/datasource/xgf/XgfUserMapper.xml | 34 ++ 16 files changed, 2875 insertions(+) create mode 100644 src/main/java/com/zcloud/controller/xgf/TrainUsersController.java create mode 100644 src/main/java/com/zcloud/controller/xgf/TrainingBatchController.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/xgf/FlowDetailMapper.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/xgf/FlowMapper.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/xgf/TrainUsersMapper.java create mode 100644 src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java create mode 100644 src/main/java/com/zcloud/service/xgf/TrainUsersService.java create mode 100644 src/main/java/com/zcloud/service/xgf/TrainingBatchService.java create mode 100644 src/main/java/com/zcloud/service/xgf/impl/TrainUsersServiceImpl.java create mode 100644 src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java create mode 100644 src/main/resources/mybatis/datasource/xgf/FlowDetailMapper.xml create mode 100644 src/main/resources/mybatis/datasource/xgf/FlowMapper.xml create mode 100644 src/main/resources/mybatis/datasource/xgf/TrainUsersMapper.xml create mode 100644 src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml diff --git a/src/main/java/com/zcloud/controller/xgf/TrainUsersController.java b/src/main/java/com/zcloud/controller/xgf/TrainUsersController.java new file mode 100644 index 00000000..450e6f57 --- /dev/null +++ b/src/main/java/com/zcloud/controller/xgf/TrainUsersController.java @@ -0,0 +1,230 @@ +package com.zcloud.controller.xgf; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.xgf.TrainUsersService; +import com.zcloud.util.ObjectExcelView; +import com.zcloud.util.Tools; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 说明:原来: 现在入场告知培训 + * 作者:luoxiaobao + * 时间:2023-09-27 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/trainusers") +public class TrainUsersController extends BaseController { + + @Autowired + private TrainUsersService trainusersService; + + /**新增 + * @param + * @throws Exception + */ + @RequestMapping(value="/add") + @RequiresPermissions("trainusers:add") + @ResponseBody + public Object add() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("TRAINUSERS_ID", this.get32UUID()); //主键 + pd.put("STEP_STATUS", "0"); + trainusersService.save(pd); + map.put("result", errInfo); + return map; + } + + /**删除 + * @param out + * @throws Exception + */ + @RequestMapping(value="/delete") + @RequiresPermissions("trainusers:del") + @ResponseBody + public Object delete() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + trainusersService.delete(pd); + map.put("result", errInfo); //返回结果 + return map; + } + + /**修改 + * @param + * @throws Exception + */ + @RequestMapping(value="/edit") + @RequiresPermissions("trainusers:edit") + @ResponseBody + public Object edit() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + trainusersService.edit(pd); + map.put("result", errInfo); + return map; + } + + /**列表 + * @param page + * @throws Exception + */ + @RequestMapping(value="/list") + @RequiresPermissions("trainusers:list") + @ResponseBody + public Object list(Page page) throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); + page.setPd(pd); + List varList = trainusersService.list(page); //列出TrainUsers列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /**去修改页面获取数据 + * @param + * @throws Exception + */ + @RequestMapping(value="/goEdit") + @RequiresPermissions("trainusers:edit") + @ResponseBody + public Object goEdit() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = trainusersService.findById(pd); //根据ID读取 + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + + /**批量删除 + * @param + * @throws Exception + */ + @RequestMapping(value="/deleteAll") + @RequiresPermissions("trainusers:del") + @ResponseBody + public Object deleteAll() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String DATA_IDS = pd.getString("DATA_IDS"); + if(Tools.notEmpty(DATA_IDS)){ + String ArrayDATA_IDS[] = DATA_IDS.split(","); + trainusersService.deleteAll(ArrayDATA_IDS); + errInfo = "success"; + }else{ + errInfo = "error"; + } + map.put("result", errInfo); //返回结果 + return map; + } + + /**导出到excel + * @param + * @throws Exception + */ + @RequestMapping(value="/excel") + @RequiresPermissions("toExcel") + public ModelAndView exportExcel() throws Exception{ + ModelAndView mv = new ModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + Map dataMap = new HashMap(); + List titles = new ArrayList(); + titles.add("备注1"); //1 + titles.add("培训批次"); //2 + titles.add("用户ID"); //3 + titles.add("培训开始时间"); //4 + titles.add("培训结束时间"); //5 + titles.add("培训状态0未培训1培训中2培训通过-1培训未通过"); //6 + titles.add("培训企业"); //7 + titles.add("流动类型"); //8 + titles.add("安全监督部"); //9 + titles.add("主管部门"); //10 + titles.add("主管部门审批状态"); //11 + titles.add("主管部门审批意见"); //12 + titles.add("管理部门审批状态"); //13 + titles.add("管理部门审批意见"); //14 + dataMap.put("titles", titles); + List varOList = trainusersService.listAll(pd); + List varList = new ArrayList(); + for(int i=0;i map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + trainusersService.approveUser(pd); + map.put("result", errInfo); + return map; + } + @RequestMapping(value = "/getUserinfoList") + @ResponseBody + public Object getUserinfoList() throws Exception { + Map map = new HashMap<>(); + PageData pd = new PageData(); + pd = this.getPageData(); + List list = trainusersService.findinfoByCondition(pd); + map.put("list", list); + map.put("result", "success"); + return map; + } + +} diff --git a/src/main/java/com/zcloud/controller/xgf/TrainingBatchController.java b/src/main/java/com/zcloud/controller/xgf/TrainingBatchController.java new file mode 100644 index 00000000..98beb39a --- /dev/null +++ b/src/main/java/com/zcloud/controller/xgf/TrainingBatchController.java @@ -0,0 +1,400 @@ +package com.zcloud.controller.xgf; + +import com.alibaba.fastjson.JSONObject; +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.system.UsersService; +import com.zcloud.service.xgf.TrainingBatchService; +import com.zcloud.util.*; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; + +import java.util.*; + +/** + * 说明:培训批次管理 + * 作者:luoxiaobao + * 时间:2023-05-08 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/trainingbatch") +public class TrainingBatchController extends BaseController { + + @Autowired + private TrainingBatchService trainingbatchService; + + @Autowired + private UsersService usersService; + + @Value("${prevention.api.url}") + private String preventionUrl; + + /** + * 新增 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/add") + @RequiresPermissions("trainingbatch:add") + @ResponseBody + public Object add() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + trainingbatchService.save(pd); + map.put("result", errInfo); + return map; + } + + /** + * 删除 + * + * @param out + * @throws Exception + */ + @RequestMapping(value = "/delete") + @RequiresPermissions("trainingbatch:del") + @ResponseBody + public Object delete() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + trainingbatchService.delete(pd); + map.put("result", errInfo); //返回结果 + return map; + } + + /** + * 修改 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/edit") + @RequiresPermissions("trainingbatch:edit") + @ResponseBody + public Object edit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + trainingbatchService.edit(pd); + map.put("result", errInfo); + return map; + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/list") + @RequiresPermissions("trainingbatch:list") + @ResponseBody + public Object list(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new 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列表 + for (PageData x : varList) { + PageData condition = new PageData(); + condition.put("USER_ID", x.getString("SUPERVISION_USER_ID")); + Map result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition); + if (result != null) { + x.put("SUPERVISION_USER_NAME", result.get("NAME")); + } + condition.clear(); + condition.put("DEPARTMENT_ID", x.getString("SUPERVISION")); + result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition); + if (result != null) { + x.put("SUPERVISION_DEPT_NAME", result.get("NAME")); + } + + condition.clear(); + condition.put("USER_ID", x.getString("MANAGER_USER_ID")); + result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition); + if (result != null) { + x.put("MANAGER_USER_NAME", result.get("NAME")); + } + condition.clear(); + condition.put("DEPARTMENT_ID", x.getString("MANAGER")); + result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition); + if (result != null) { + x.put("MANAGER_DEPT_NAME", result.get("NAME")); + } + + condition.clear(); + condition.put("USER_ID", x.getString("TERRITORIALITY_USER_ID")); + result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition); + if (result != null) { + x.put("ERRITORIALITY_USER_NAME", result.get("NAME")); + } + condition.clear(); + condition.put("DEPARTMENT_ID", x.getString("TERRITORIALITY")); + result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition); + if (result != null) { + x.put("ERRITORIALITY_DEPT_NAME", result.get("NAME")); + } + } + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/userList") + @RequiresPermissions("trainingbatch:list") + @ResponseBody + public Object userList(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new 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 = usersService.flowlistPage(page); //列出TrainingBatch列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + @RequestMapping(value = "/batchUserList") + @RequiresPermissions("trainingbatch:list") + @ResponseBody + public Object batchUserList(Page page) throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new 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.batchUserlistPage(page); //列出TrainingBatch列表 + + for (PageData x : varList) { + PageData condition = new PageData(); + condition.put("USER_ID", x.getString("SUPERVISION_USER_ID")); + Map result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition); + if (result != null) { + x.put("SUPERVISION_USER_NAME", result.get("NAME")); + } + condition.clear(); + condition.put("DEPARTMENT_ID", x.getString("SUPERVISION")); + result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition); + if (result != null) { + x.put("SUPERVISION_DEPT_NAME", result.get("NAME")); + } + + condition.clear(); + condition.put("USER_ID", x.getString("MANAGER_USER_ID")); + result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition); + if (result != null) { + x.put("MANAGER_USER_NAME", result.get("NAME")); + } + condition.clear(); + condition.put("DEPARTMENT_ID", x.getString("MANAGER")); + result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition); + if (result != null) { + x.put("MANAGER_DEPT_NAME", result.get("NAME")); + } + + condition.clear(); + condition.put("USER_ID", x.getString("TERRITORIALITY_USER_ID")); + result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition); + if (result != null) { + x.put("ERRITORIALITY_USER_NAME", result.get("NAME")); + } + condition.clear(); + condition.put("DEPARTMENT_ID", x.getString("TERRITORIALITY")); + result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition); + if (result != null) { + x.put("ERRITORIALITY_DEPT_NAME", result.get("NAME")); + } + } + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /** + * 去修改页面获取数据 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/goEdit") + @RequiresPermissions("trainingbatch:edit") + @ResponseBody + public Object goEdit() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = trainingbatchService.findById(pd); //根据ID读取 + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + + /** + * 批量删除 + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/deleteAll") + @RequiresPermissions("trainingbatch:del") + @ResponseBody + public Object deleteAll() throws Exception { + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String DATA_IDS = pd.getString("DATA_IDS"); + if (Tools.notEmpty(DATA_IDS)) { + String ArrayDATA_IDS[] = DATA_IDS.split(","); + trainingbatchService.deleteAll(ArrayDATA_IDS); + errInfo = "success"; + } else { + errInfo = "error"; + } + map.put("result", errInfo); //返回结果 + return map; + } + + /** + * 导出到excel + * + * @param + * @throws Exception + */ + @RequestMapping(value = "/excel") + @RequiresPermissions("toExcel") + public ModelAndView exportExcel() throws Exception { + ModelAndView mv = new ModelAndView(); + PageData pd = new PageData(); + pd = this.getPageData(); + Map dataMap = new HashMap(); + List titles = new ArrayList(); + titles.add("创建人"); //1 + titles.add("创建时间"); //2 + titles.add("修改人"); //3 + titles.add("修改时间"); //4 + titles.add("是否删除"); //5 + titles.add("批次名称"); //6 + titles.add("所属企业"); //7 + titles.add("培训人数"); //8 + titles.add("培训企业"); //9 + dataMap.put("titles", titles); + List varOList = trainingbatchService.listAll(pd); + List varList = new ArrayList(); + for (int i = 0; i < varOList.size(); i++) { + PageData vpd = new PageData(); + vpd.put("var1", varOList.get(i).getString("CREATOR")); //1 + vpd.put("var2", varOList.get(i).getString("CREATTIME")); //2 + vpd.put("var3", varOList.get(i).getString("OPERATOR")); //3 + vpd.put("var4", varOList.get(i).getString("OPERATTIME")); //4 + vpd.put("var5", varOList.get(i).get("ISDELETE").toString()); //5 + vpd.put("var6", varOList.get(i).getString("BATCH_NAME")); //6 + vpd.put("var7", varOList.get(i).getString("CORPINFO_ID")); //7 + vpd.put("var8", varOList.get(i).get("USER_COUNT").toString()); //8 + vpd.put("var9", varOList.get(i).getString("TRAIN_CORP_DEPT")); //9 + varList.add(vpd); + } + dataMap.put("varList", varList); + ObjectExcelView erv = new ObjectExcelView(); + mv = new ModelAndView(erv, dataMap); + return mv; + } + + @RequestMapping(value = "/sendMessage") + @ResponseBody + @Transactional + public Object sendMessage() throws Exception { + PageData request = this.getPageData(); + List list = Warden.getList(request.getString("list")); + List userList = new ArrayList<>(); + for (PageData x : list) { + PageData entity = usersService.getById(x); + Map map = new HashMap<>(entity); + for (Object key : map.keySet()) { + map.putIfAbsent(key, ""); + } + entity.put("CORPINFO_ID", request.get("corp_id")); + userList.add(entity); + // 更新用户信息 + PageData info = usersService.findById(entity); + info.put("EMPLOYER", request.get("corp_id")); + info.put("EMPLOYER_NAME", request.get("corp_name")); + info.put("EMPLOY_FLAG", "1"); + usersService.editUser(info); + } + + PageData info = new PageData(); + info.put("infoList", JSONObject.toJSON(userList)); + HttpClientUtil.doPost(preventionUrl + "/xfgUser/synchronizationUserInfo", info); + + Map response = new HashMap<>(); + response.put("result", "success"); + return response; + } + + @RequestMapping(value = "/submitApplication") + @ResponseBody + @Transactional + public Object submitApplication() throws Exception{ + PageData request = this.getPageData(); + + PageData info = new PageData(); + info.put("xgf_user_ids",request.get("xgf_user_ids")); + HttpClientUtil.doPost(preventionUrl + "/xfgUser/approvalApplication", info); + + List list = Arrays.asList(request.getString("xgf_user_ids").split(",")); + PageData condition = new PageData(); + for (String x : list) { + condition.put("USER_ID", x); + PageData entity = usersService.findById(condition); + entity.put("EMPLOY_FLAG", "2"); + usersService.editUser(entity); + } + + Map response = new HashMap<>(); + response.put("result", "success"); + return response; + } + +} diff --git a/src/main/java/com/zcloud/mapper/datasource/xgf/FlowDetailMapper.java b/src/main/java/com/zcloud/mapper/datasource/xgf/FlowDetailMapper.java new file mode 100644 index 00000000..37ab6211 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/FlowDetailMapper.java @@ -0,0 +1,16 @@ +package com.zcloud.mapper.datasource.xgf; + +import com.zcloud.entity.PageData; + +public interface FlowDetailMapper { + + void save(PageData flow); + + void delete(PageData flow); + + void edit(PageData flow); + + PageData findById(PageData flow); + + PageData selectOne(PageData condition); +} diff --git a/src/main/java/com/zcloud/mapper/datasource/xgf/FlowMapper.java b/src/main/java/com/zcloud/mapper/datasource/xgf/FlowMapper.java new file mode 100644 index 00000000..160baf67 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/FlowMapper.java @@ -0,0 +1,16 @@ +package com.zcloud.mapper.datasource.xgf; + +import com.zcloud.entity.PageData; + +public interface FlowMapper { + + void save(PageData flow); + + void delete(PageData flow); + + void edit(PageData flow); + + PageData findById(PageData flow); + + PageData findByCondition(PageData condition); +} diff --git a/src/main/java/com/zcloud/mapper/datasource/xgf/TrainUsersMapper.java b/src/main/java/com/zcloud/mapper/datasource/xgf/TrainUsersMapper.java new file mode 100644 index 00000000..bafeb394 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/TrainUsersMapper.java @@ -0,0 +1,129 @@ +package com.zcloud.mapper.datasource.xgf; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:培训学员 + * 作者:luoxiaobao + * 时间:2023-05-08 + * 官网:www.zcloudchina.com + */ +public interface TrainUsersMapper{ + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + /**固定服务人员培训管理列表 + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); + + void updateStatusByFlowTrain(PageData pd); + + List unflowlistPage(Page page); + + void updateStatus(PageData pd); + + /** + * 固定服务人员培训管理培训申请记录 + * @param page + * @return + */ + List trainApplicationRecordList(Page page); + + /** + * 固定服务人员培训管理查看 + * @param pd + * @return + */ + PageData trainView(PageData pd); + + + + + /** + * 安全监督部 审核 + * @param pd + * @return + */ + Integer approveSupervision(PageData pd); + /** + * 主管部门 审核 + * @param pd + * @return + */ + Integer approveManager(PageData pd); + /** + * 安全监督部 审核 + * @param pd + * @return + */ + Integer approveTerritoriality(PageData pd); + + /** + * 根据培训批次id 获取 这次培训中审批完成的次数 + * @param pd + * @return + */ + List getApproveCountByGbatchId(PageData pd ); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData getPdById(PageData pd); + + + /** + * 查询和这个批次完成评审的 数量 和 传过来的对比 + */ + Integer getCountByWanchengPingshen(PageData pd); + + void graduation(PageData condition); + void graduationstudent(PageData condition); + + + + void updateDate(PageData condition); + + List findinfoByCondition(PageData pd); + +} + diff --git a/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java b/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java new file mode 100644 index 00000000..ef808ece --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java @@ -0,0 +1,78 @@ +package com.zcloud.mapper.datasource.xgf; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:培训批次管理 + * 作者:luoxiaobao + * 时间:2023-05-08 + * 官网:www.zcloudchina.com + */ +public interface TrainingBatchMapper{ + + /**新增 + * @param pd + * @throws Exception + */ + void save(PageData pd); + + /**删除 + * @param pd + * @throws Exception + */ + void delete(PageData pd); + + /**修改 + * @param pd + * @throws Exception + */ + void edit(PageData pd); + + void audit(PageData pd); + + /**列表 + * @param page + * @throws Exception + */ + List datalistPage(Page page); + + /**列表(全部) + * @param pd + * @throws Exception + */ + List listAll(PageData pd); + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findById(PageData pd); + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + void deleteAll(String[] ArrayDATA_IDS); + + /** + * 获取编号 + * @param pd + * @return + */ + PageData getCode(PageData pd); + + List batchUserlistPage(Page page); + + List passUserlistPage(Page page); + /**通过id获取数据 + * @param pd + * @throws Exception + */ + PageData findAndTimeById(PageData pd); + + void graduation(PageData condition); +} + 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 869d1efe..28c25a77 100644 --- a/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java @@ -54,4 +54,14 @@ public interface XgfUserMapper { * @throws Exception */ public List listByIds(PageData pd); + + void updateStatusByUnflowTrain(PageData pd); + + void bantchUpdateStatus(int i, String[] userids); + + void updateStatusByFlowTrain(PageData pd); + + void graduation(PageData condition); + + void graduationstudent(PageData condition); } diff --git a/src/main/java/com/zcloud/service/xgf/TrainUsersService.java b/src/main/java/com/zcloud/service/xgf/TrainUsersService.java new file mode 100644 index 00000000..b04c88f0 --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/TrainUsersService.java @@ -0,0 +1,99 @@ +package com.zcloud.service.xgf; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** +import java.util.List; + +/** + * 说明:培训学员 + * 作者:luoxiaobao + * 时间:2023-05-08 + * 官网:www.zcloudchina.com + */ +public interface TrainUsersService{ + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception; + + /**固定服务人员培训管理列表 + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; + + /** + * 固定服务人员培训管理查看 + * @param pd + * @return + */ + public PageData trainView(PageData pd) throws Exception; + + /** + * 培训申请记录 + * @param pd + * @return + */ + public List trainApplicationRecordList(Page page); + + + /**固定人员列表 + * @param page + * @throws Exception + */ + public List unflowlist(Page page)throws Exception; + + /**审核 + * @param pd + * @throws Exception + */ + public void audit(PageData pd)throws Exception; + + + /**新增 + * @param pd + * @throws Exception + */ + public Integer approveUser(PageData pd)throws Exception; + List findinfoByCondition(PageData condition) throws Exception; + +} + diff --git a/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java b/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java new file mode 100644 index 00000000..2c55d312 --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java @@ -0,0 +1,91 @@ +package com.zcloud.service.xgf; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; + +import java.util.List; + +/** + * 说明:培训批次管理 + * 作者:luoxiaobao + * 时间:2023-05-08 + * 官网:www.zcloudchina.com + */ +public interface TrainingBatchService{ + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception; + + public void unflowTrain(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception; + + /**审核 + * @param pd + * @throws Exception + */ + void audit(PageData pd)throws Exception; + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception; + + /** + * 获取编号 + * @param pd + * @return + */ + public PageData getCode(PageData pd) throws Exception; + + /**批次内人员列表 + * @param page + * @throws Exception + */ + public List batchUserlistPage(Page page)throws Exception; + + List passUserlistPage(Page page) throws Exception; + + void graduation(PageData condition); + + void openClass(PageData condition); + + void openStudentClass(PageData condition); + + void updateClassMessage(PageData condition); + + void saveFlow(PageData request) throws Exception; +} + diff --git a/src/main/java/com/zcloud/service/xgf/impl/TrainUsersServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/TrainUsersServiceImpl.java new file mode 100644 index 00000000..786487f8 --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/impl/TrainUsersServiceImpl.java @@ -0,0 +1,305 @@ +package com.zcloud.service.xgf.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.system.UsersMapper; +import com.zcloud.mapper.datasource.xgf.*; +import com.zcloud.service.xgf.TrainUsersService; +import com.zcloud.util.DateUtil; +import com.zcloud.util.Tools; +import com.zcloud.util.Warden; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * 说明:培训学员 + * 作者:luoxiaobao + * 时间:2023-05-08 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class TrainUsersServiceImpl implements TrainUsersService { + + @Resource + private TrainUsersMapper trainusersMapper; + + @Resource + private TrainingBatchMapper trainingBatchMapper; + @Resource + private XgfUserMapper xgfUserMapper; + + @Resource + private FlowDetailMapper flowDetailMapper; + + @Resource + private FlowMapper flowMapper; + + /** + * 新增 + * + * @param pd + * @throws Exception + */ + public void save(PageData pd) throws Exception { + trainusersMapper.save(pd); + } + + /** + * 删除 + * + * @param pd + * @throws Exception + */ + public void delete(PageData pd) throws Exception { + trainusersMapper.delete(pd); + } + + /** + * 修改 + * + * @param pd + * @throws Exception + */ + public void edit(PageData pd) throws Exception { + trainusersMapper.edit(pd); + } + + /** + * 列表 + * + * @param page + * @throws Exception + */ + public List list(Page page) throws Exception { + return trainusersMapper.datalistPage(page); + } + + /** + * 列表(全部) + * + * @param pd + * @throws Exception + */ + public List listAll(PageData pd) throws Exception { + return trainusersMapper.listAll(pd); + } + + /** + * 通过id获取数据 + * + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd) throws Exception { + return trainusersMapper.findById(pd); + } + + /** + * 批量删除 + * + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS) throws Exception { + trainusersMapper.deleteAll(ArrayDATA_IDS); + } + + /** + * 固定服务人员培训管理查看 + * + * @param pd + * @return + * @throws Exception + */ + @Override + public PageData trainView(PageData pd) throws Exception { + return trainusersMapper.trainView(pd); + } + + @Override + public List trainApplicationRecordList(Page page) { + return trainusersMapper.trainApplicationRecordList(page); + } + + + public List unflowlist(Page page) throws Exception { + return trainusersMapper.unflowlistPage(page); + } + + public void audit(PageData pd) throws Exception { + if (Integer.parseInt(pd.getString("AUDIT_STATUS")) == -1) { + + } else if (Integer.parseInt(pd.getString("AUDIT_STATUS")) == 1) { + pd.put("STATUS", 2); + pd.put("END_DATE", DateUtil.date2Str(new Date())); + xgfUserMapper.updateStatusByUnflowTrain(pd); + trainusersMapper.updateStatus(pd); + } + } + + @Override + public Integer approveUser(PageData pd) throws Exception { + String type = pd.getString("type"); //1、集团单位,2、企业端,3、监管端 + String TRAINUSERS_ID = pd.getString("TRAINUSERS_ID"); //培训批次 详情id + String STATE = pd.getString("IS_STATE"); // 审批状态 0:不合格;1:合格; + + String OPINION = pd.getString("OPINION"); // 审批意见 + Integer userCount = Integer.parseInt(pd.getString("USER_COUNT")); // 批次的人数 + String[] userids = new String[1]; // 被审批人 + userids[0] = pd.getString("USER_ID"); + PageData trainusersPd = trainusersMapper.getPdById(pd); //培训 详情信息 + PageData appPd = new PageData(); + appPd.put("TRAINUSERS_ID", trainusersPd.getString("TRAINUSERS_ID")); + appPd.put("STATUS", "1"); + /*2023-12-06 liu jun 需求便跟*/ + PageData batch = trainingBatchMapper.findById(pd); + // 如果 + if ("0".equals(STATE)) { + appPd.put("STATUS", "-1"); + userids[0] = pd.getString("USER_ID"); + xgfUserMapper.bantchUpdateStatus(0, userids); + } + if (trainusersPd.get("STEP_STATUS") == null || trainusersPd.get("STEP_STATUS").equals("0")) { + if (pd.getString("loginUserId").equals(batch.getString("TERRITORIALITY_USER_ID"))) { + appPd.put("TERRITORIALITY_STATE", STATE); + appPd.put("TERRITORIALITY_OPINION", OPINION); + appPd.put("TERRITORIALITY_TIME", DateUtil.getTime()); + appPd.put("STEP_STATUS", "1"); + trainusersMapper.approveTerritoriality(appPd); + } else { + throw new RuntimeException("当前用户不是集团单位指定审批人,无法进行审批"); + } + } + if (trainusersPd.get("STEP_STATUS") != null && trainusersPd.get("STEP_STATUS").equals("1")) { + if (pd.getString("loginUserId").equals(batch.getString("MANAGER_USER_ID"))) { + appPd.put("MANAGER_STATE", STATE); + appPd.put("MANAGER_OPINION", OPINION); + appPd.put("MANAGER_TIME", DateUtil.getTime()); + appPd.put("STEP_STATUS", "2"); + trainusersMapper.approveManager(appPd); + } else { + throw new RuntimeException("当前用户不是股份主管部门指定审批人,无法进行审批"); + } + } + if (trainusersPd.get("STEP_STATUS") != null && trainusersPd.get("STEP_STATUS").equals("2")) { + if (pd.getString("loginUserId").equals(batch.getString("SUPERVISION_USER_ID"))) { + appPd.put("SUPERVISION_STATE", STATE); + appPd.put("SUPERVISION_OPINION", OPINION); + appPd.put("SUPERVISION_TIME", DateUtil.getTime()); + appPd.put("STEP_STATUS", "3"); + trainusersMapper.approveSupervision(appPd); + } else { + throw new RuntimeException("当前用户不是股份安监部门,无法进行审批"); + } + } + + /** 如果审批全部通过 */ + Integer stateCountInt = 0; //审批了几次, 如果是审批了3次.这个人审批完成 + Integer stateTongguoInt = 0; //审批通过次数 + String sate1 = trainusersPd.getString("SUPERVISION_STATE"); + String sate2 = trainusersPd.getString("MANAGER_STATE"); + String sate3 = trainusersPd.getString("TERRITORIALITY_STATE"); + if (!Tools.isEmpty(sate1)) { //如果有审批状态 就是审批过的数据 + stateCountInt++; + } + if (!Tools.isEmpty(sate2)) { //如果有审批状态 就是审批过的数据 + stateCountInt++; + } + if (!Tools.isEmpty(sate3)) { //如果有审批状态 就是审批过的数据 + stateCountInt++; + } + if ("1".equals(sate1)) { + stateTongguoInt++; + } + if ("1".equals(sate2)) { + stateTongguoInt++; + } + if ("1".equals(sate3)) { + stateTongguoInt++; + } + + //如果其中一个人打回,则结束审批流程 + if ("0".equals(STATE)) { + stateCountInt = 3; + } + if (3 == stateCountInt) { //这个人的审批全部 + PageData statePd = new PageData(); + statePd.put("TRAINUSERS_ID", TRAINUSERS_ID); + String STATUS = "-1"; //培训状态0未培训1培训中2培训通过-1培训未通过 + if (3 == stateTongguoInt) { + STATUS = "2"; + statePd.put("STATUS", STATUS); + trainusersMapper.updateStatus(statePd); + } + } + // 这个批次全部审批完成 + Integer wanchengPingshen = trainusersMapper.getCountByWanchengPingshen(trainusersPd); + + if (wanchengPingshen == userCount) { //已经审批的数据量 和 批次的人数一致的时候,修改批次的状态 + PageData trainingBatchPd = trainingBatchMapper.findById(trainusersPd); + trainingBatchPd.put("AUDIT_STATUS", "2"); //业务修改 ,现在只有 2培训中 3培训完成 + trainingBatchMapper.edit(trainingBatchPd); + } + + /*保存审批流*/ + PageData condition = new PageData(); + condition.put("FOREIGN_KEY", trainusersPd.getString("TRAININGBATCH_ID")); + PageData flow = flowMapper.findByCondition(condition); + if (flow == null) { + System.out.println("历史数据======不做处理"); + } else { + condition.clear(); + condition.put("FLOW_ID", flow.getString("FLOW_ID")); + condition.put("FOREIGN_KEY", trainusersPd.getString("TRAINUSERS_ID")); + condition.put("STEP_FLAG", "1"); + PageData step = flowDetailMapper.selectOne(condition); + if (step == null) { + condition.clear(); + condition.put("FLOW_ID", flow.getString("FLOW_ID")); + condition.put("PARENT_ID", "0"); + step = flowDetailMapper.selectOne(condition); + } + step.put("STEP_FLAG", "0"); + flowDetailMapper.edit(step); + + PageData nextStep = new PageData(); + nextStep.put("FLOW_DETAIL_ID", Warden.get32UUID()); + nextStep.put("FLOW_ID", flow.getString("FLOW_ID")); + nextStep.put("STEP_FLAG", "1"); + nextStep.put("PARENT_ID", step.getString("FLOW_DETAIL_ID")); + nextStep.put("FOREIGN_KEY", trainusersPd.getString("TRAINUSERS_ID")); + nextStep.put("STEP_NAME", "培训审核"); + nextStep.put("SORT", (Integer) step.get("SORT") + 1); + nextStep.put("CREATE_TIME", DateUtil.date2Str(new Date())); + nextStep.put("APPROVER_ID", pd.getString("APPROVER_ID")); + nextStep.put("APPROVER_NAME", pd.getString("APPROVER_NAME")); + nextStep.put("APPROVER_OPINION", OPINION); + nextStep.put("APPROVER_TIME", DateUtil.getTime()); + nextStep.put("APPROVER_CORPINFO_ID", pd.getString("APPROVER_CORPINFO_ID")); + nextStep.put("APPROVER_CORPINFO_NAME", pd.getString("APPROVER_CORPINFO_NAME")); + nextStep.put("PASS_FLAG", STATE); + if (3 == stateCountInt) { + nextStep.put("IS_END", "1"); + } else { + nextStep.put("IS_END", "0"); + } + nextStep.put("ISDELETE", "0"); + nextStep.put("FOREIGN_KEY", trainusersPd.getString("TRAINUSERS_ID")); + flowDetailMapper.save(nextStep); + } + + return 0; + } + + @Override + public List findinfoByCondition(PageData condition) throws Exception { + return trainusersMapper.findinfoByCondition(condition); + } +} + diff --git a/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java new file mode 100644 index 00000000..5b6132fb --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java @@ -0,0 +1,341 @@ +package com.zcloud.service.xgf.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.system.UsersMapper; +import com.zcloud.mapper.datasource.xgf.*; +import com.zcloud.service.xgf.TrainingBatchService; +import com.zcloud.util.*; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.text.DecimalFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 说明:培训批次管理 + * 作者:luoxiaobao + * 时间:2023-05-08 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class TrainingBatchServiceImpl implements TrainingBatchService { + + @Resource + private TrainingBatchMapper trainingbatchMapper; + + @Resource + private TrainUsersMapper trainUsersMapper; + + @Resource + private XgfUserMapper xgfUserMapper; + + @Resource + private FlowMapper flowMapper; + + @Resource + private FlowDetailMapper flowDetailMapper; + + @Value("${prevention.api.url}") + private String preventionUrl; + + /**新增 + * @param pd + * @throws Exception + */ + public void save(PageData pd)throws Exception{ + /* 保存主题信息 */ + String batch_id=UuidUtil.get32UUID(); + String train_area=pd.getString("TRAIN_AREA"); + pd.put("TRAININGBATCH_ID", batch_id); //主键 + pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + pd.put("ISDELETE", 0); //是否删除 1-是 0-否 + + Calendar calendar = Calendar.getInstance(); + DecimalFormat dft=new DecimalFormat("00"); + int year = calendar.get(Calendar.YEAR); + String month = dft.format(calendar.get(Calendar.MONTH) + 1); + pd.put("CREATDATE",year + "-" + month); + PageData cpd = trainingbatchMapper.getCode(pd); //根据ID读取 + String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString())+1)); + pd.put("BATCH_NAME",code); + + trainingbatchMapper.save(pd); + + String ArrayDATA_IDS[] = pd.getString("users").split(","); + Arrays.asList(ArrayDATA_IDS).forEach(id -> { + PageData user = new PageData(); + user.put("TRAINUSERS_ID", UuidUtil.get32UUID()); + user.put("TRAININGBATCH_ID", batch_id); + user.put("USER_ID", id); + user.put("TRAIN_AREA", train_area); + user.put("STATUS", 0); + user.put("SUPERVISION_STATE", 9); + user.put("MANAGER_STATE", 9); + user.put("TERRITORIALITY_STATE", 9); + user.put("STEP_STATUS", "0"); + trainUsersMapper.save(user); + }); + xgfUserMapper.bantchUpdateStatus(9,ArrayDATA_IDS); + + /* 保存审批流程信息 */ + PageData flow = new PageData(); + flow.put("FLOW_ID", Warden.get32UUID()); + flow.put("TYPE", "0"); + flow.put("CREATOR",Jurisdiction.getUSER_ID()); + flow.put("CREATOR_NAME",Jurisdiction.getName()); + flow.put("CREATOR_TIME", DateUtil.getTime()); + flow.put("VALID_FLAG", "1"); + flow.put("FOREIGN_KEY",pd.getString("TRAININGBATCH_ID")); + flow.put("ISDELETE", "0"); + flowMapper.save(flow); + /* 保存审批流程明细信息 */ + PageData flowDetail = new PageData(); + flowDetail.put("FLOW_DETAIL_ID", Warden.get32UUID()); + flowDetail.put("FLOW_ID", flow.getString("FLOW_ID")); + flowDetail.put("STEP_FLAG", "1"); + flowDetail.put("SORT",0); + flowDetail.put("APPROVER_ID",Jurisdiction.getUSER_ID()); + flowDetail.put("APPROVER_NAME",Jurisdiction.getName()); + flowDetail.put("APPROVER_TIME", DateUtil.getTime()); + flowDetail.put("APPROVER_CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); + // TODO 未完成 + flowDetail.put("APPROVER_CORPINFO_NAME",""); + flowDetail.put("PASS_FLAG", "1"); + flowDetail.put("END_FLAG", "0"); + flowDetail.put("ISDELETE", "0"); + flowDetail.put("PARENT_ID","0"); + flowDetailMapper.save(flowDetail); + } + + /**固定人员培训 + * @param pd + * @throws Exception + */ + public void unflowTrain(PageData pd)throws Exception{ + PageData trainBatch = new PageData(); + String batch_id = UuidUtil.get32UUID(); + trainBatch.put("TRAININGBATCH_ID", batch_id); //主键 + trainBatch.put("CREATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //添加人 + trainBatch.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + trainBatch.put("OPERATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //修改人 + trainBatch.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + trainBatch.put("ISDELETE", 0); //是否删除 1-是 0-否 + trainBatch.put("TYPE", 1); + trainBatch.put("USER_COUNT", pd.getString("USER_COUNT")); + trainBatch.put("AUDIT_STATUS", 0); + trainBatch.put("TRAIN_CORP_DEPT", pd.getString("TRAIN_CORP_DEPT")); + trainBatch.put("TRAIN_CORP_LEADER", pd.getString("TRAIN_CORP_LEADER")); + + Calendar calendar = Calendar.getInstance(); + DecimalFormat dft = new DecimalFormat("00"); + int year = calendar.get(Calendar.YEAR); + String month = dft.format(calendar.get(Calendar.MONTH) + 1); + trainBatch.put("CREATDATE", year + "-" + month); + PageData cpd = trainingbatchMapper.getCode(trainBatch); //根据ID读取 + String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString()) + 1)); + trainBatch.put("BATCH_NAME", code); + + trainingbatchMapper.save(trainBatch); + trainBatch.put("AUDIT_STATUS", "2"); + this.audit(trainBatch); + + String ArrayDATA_IDS[] = pd.getString("users").split(","); + Arrays.asList(ArrayDATA_IDS).forEach(id -> { + PageData user = new PageData(); + user.put("TRAINUSERS_ID", UuidUtil.get32UUID()); + user.put("TRAININGBATCH_ID", batch_id); + user.put("USER_ID", id); + user.put("TRAIN_CORPINFO_ID", pd.getString("FIRST_PARTY_ID")); + user.put("STATUS", 1); + user.put("START_DATE", DateUtil.date2Str(new Date())); + user.put("SUPERVISION_STATE", 9); + user.put("MANAGER_STATE", 9); + user.put("TERRITORIALITY_STATE", 9); + user.put("STEP_STATUS", "0"); + trainUsersMapper.save(user); + }); + xgfUserMapper.bantchUpdateStatus(1,ArrayDATA_IDS); + + } + + /**删除 + * @param pd + * @throws Exception + */ + public void delete(PageData pd)throws Exception{ + trainingbatchMapper.delete(pd); + } + + /**修改 + * @param pd + * @throws Exception + */ + public void edit(PageData pd)throws Exception{ + trainingbatchMapper.edit(pd); + } + + public void audit(PageData pd)throws Exception{ + if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == -1){ + pd.put("STATUS",0); + pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); + xgfUserMapper.updateStatusByFlowTrain(pd); + trainingbatchMapper.audit(pd); + }else if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == 2){ + pd.put("STATUS",1); + pd.put("START_DATE",DateUtil.date2Str(new Date())); + pd.put("AUDIT_TIME", DateUtil.date2Str(new Date())); + xgfUserMapper.updateStatusByFlowTrain(pd); + trainUsersMapper.updateStatusByFlowTrain(pd); + trainingbatchMapper.audit(pd); + }else if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == 3){ + pd.put("STATUS",2); + pd.put("END_DATE",DateUtil.date2Str(new Date())); + pd.put("VERIFY_TIME",DateUtil.date2Str(new Date())); + xgfUserMapper.updateStatusByFlowTrain(pd); + trainUsersMapper.updateStatusByFlowTrain(pd); + trainingbatchMapper.audit(pd); + }else{ + pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); + trainingbatchMapper.audit(pd); + } + } + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception{ + return trainingbatchMapper.datalistPage(page); + } + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception{ + return trainingbatchMapper.listAll(pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception{ + return trainingbatchMapper.findById(pd); + } + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ + trainingbatchMapper.deleteAll(ArrayDATA_IDS); + } + + /** + * 获取编号 + * @param pd + * @return + */ + @Override + public PageData getCode(PageData pd) throws Exception{ + return trainingbatchMapper.getCode(pd); + } + + public List batchUserlistPage(Page page)throws Exception{ + return trainingbatchMapper.batchUserlistPage(page); + } + + @Override + public List passUserlistPage(Page page) throws Exception { + return trainingbatchMapper.passUserlistPage(page); + } + + @Override + public void graduation(PageData condition) { + trainingbatchMapper.graduation(condition); + xgfUserMapper.graduation(condition); + } + + @Override + public void openClass(PageData info) { + List list = Warden.getList(info.getString("list")); + PageData condition = new PageData(); + condition.put("STATUS",info.getString("userStatus")); + condition.put("list", list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("USER_ID")).collect(Collectors.toList())); + xgfUserMapper.graduation(condition); + + condition.clear(); + condition.put("STATUS",info.getString("detailsStatus")); + condition.put("list",list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("TRAINUSERS_ID")).collect(Collectors.toList())); + trainUsersMapper.graduation(condition); + + } + + @Override + public void openStudentClass(PageData info) { +// List list = Warden.getList(info.getString("list")); + PageData condition = new PageData(); + condition.put("STATUS",info.getString("userStatus")); + condition.put("USER_ID", info.getString("USER_ID")); + xgfUserMapper.graduationstudent(condition); + + condition.clear(); + condition.put("STATUS",info.getString("detailsStatus")); + condition.put("TRAINUSERS_ID", info.getString("TRAINUSERS_ID")); + trainUsersMapper.graduationstudent(condition); + + } + + @Override + public void updateClassMessage(PageData info) { + List list = Warden.getList(info.getString("list")); + PageData condition = new PageData(); + condition.put("list", list.stream().map(n -> n.getString("TRAINUSERS_ID")).collect(Collectors.toList())); + if (StringUtils.isNotEmpty(info.getString("START_DATE"))){ + condition.put("START_DATE",DateUtil.getTime()); + } + if (StringUtils.isNotEmpty(info.getString("END_DATE"))){ + condition.put("END_DATE",DateUtil.getTime()); + } + trainUsersMapper.updateDate(condition); + } + + @Override + public void saveFlow(PageData request) throws Exception { + /* 保存审批流程明细信息 */ + PageData condition = new PageData(); + condition.put("FLOW_ID", request.getString("FLOW_ID")); + condition.put("STEP_FLAG", "1"); + PageData flow = flowDetailMapper.selectOne(condition); + flow.put("STEP_FLAG", "0"); + flowDetailMapper.edit(flow); + PageData next_flow = new PageData(); + next_flow.put("FLOW_DETAIL_ID", Warden.get32UUID()); + next_flow.put("FLOW_ID", flow.getString("FLOW_ID")); + next_flow.put("STEP_FLAG", "1"); + next_flow.put("SORT",(Integer)flow.get("SORT")+1); + next_flow.put("APPROVER_ID",request.get("APPROVER_ID")); + next_flow.put("APPROVER_NAME",request.get("APPROVER_NAME")); + next_flow.put("APPROVER_TIME", DateUtil.getTime()); + next_flow.put("APPROVER_CORPINFO_ID",request.get("APPROVER_CORPINFO_ID")); + next_flow.put("APPROVER_CORPINFO_NAME",request.get("APPROVER_CORPINFO_NAME")); + next_flow.put("PASS_FLAG", "1"); + next_flow.put("END_FLAG", "0"); + next_flow.put("ISDELETE", "0"); + next_flow.put("PARENT_ID",flow.getString("FLOW_DETAIL_ID")); + flowDetailMapper.save(next_flow); + } +} + diff --git a/src/main/resources/mybatis/datasource/xgf/FlowDetailMapper.xml b/src/main/resources/mybatis/datasource/xgf/FlowDetailMapper.xml new file mode 100644 index 00000000..c3e402d7 --- /dev/null +++ b/src/main/resources/mybatis/datasource/xgf/FlowDetailMapper.xml @@ -0,0 +1,132 @@ + + + + + + + BUS_FLOW_DETAIL + + + + + SYS_DICTIONARIES + + + + + f.FLOW_DETAIL_ID, + f.FLOW_ID, + f.STEP_FLAG, + F.STEP_NAME, + f.APPROVER_ID, + f.APPROVER_NAME, + f.APPROVER_OPINION, + f.APPROVER_CORPINFO_ID, + f.APPROVER_CORPINFO_NAME, + f.APPROVER_TIME, + f.PASS_FLAG, + f.END_FLAG, + f.ISDELETE, + f.PARENT_ID, + f.FOREIGN_KEY + + + + + FLOW_DETAIL_ID, + FLOW_ID, + STEP_FLAG, + STEP_NAME, + APPROVER_ID, + APPROVER_NAME, + APPROVER_OPINION, + APPROVER_CORPINFO_ID, + APPROVER_CORPINFO_NAME, + APPROVER_TIME, + PASS_FLAG, + END_FLAG, + ISDELETE, + PARENT_ID, + FOREIGN_KEY + + + + + #{FLOW_DETAIL_ID}, + #{FLOW_ID}, + #{STEP_FLAG}, + #{STEP_NAME}, + #{APPROVER_ID}, + #{APPROVER_NAME}, + #{APPROVER_OPINION}, + #{APPROVER_CORPINFO_ID}, + #{APPROVER_CORPINFO_NAME}, + #{APPROVER_TIME}, + #{PASS_FLAG}, + #{END_FLAG}, + #{ISDELETE}, + #{PARENT_ID}, + #{FOREIGN_KEY} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + FLOW_DETAIL_ID = #{FLOW_DETAIL_ID} + + + + + update BUS_FLOW_DETAIL + set FLOW_ID = #{FLOW_ID}, + STEP_FLAG = #{STEP_FLAG}, + APPROVER_ID = #{APPROVER_ID}, + APPROVER_NAME = #{APPROVER_NAME}, + APPROVER_OPINION = #{APPROVER_OPINION}, + APPROVER_CORPINFO_NAME = #{APPROVER_CORPINFO_NAME}, + APPROVER_TIME = #{APPROVER_TIME}, + PASS_FLAG = #{PASS_FLAG}, + END_FLAG = #{END_FLAG}, + ISDELETE = #{ISDELETE}, + PARENT_ID = #{PARENT_ID}, + FOREIGN_ID = #{FOREIGN_ID}, + STEP_NAME = #{STEP_NAME}, + where FLOW_DETAIL_ID = #{FLOW_DETAIL_ID} + + + + + diff --git a/src/main/resources/mybatis/datasource/xgf/FlowMapper.xml b/src/main/resources/mybatis/datasource/xgf/FlowMapper.xml new file mode 100644 index 00000000..978c5797 --- /dev/null +++ b/src/main/resources/mybatis/datasource/xgf/FlowMapper.xml @@ -0,0 +1,91 @@ + + + + + + + BUS_FLOW + + + + + SYS_DICTIONARIES + + + + + f.FLOW_ID, + f.TYPE, + f.CREATOR, + f.CREATOR_NAME, + f.CREATOR_TIME, + f.VALID_FLAG, + f.FOREIGN_KEY + + + + + FLOW_ID, + TYPE, + CREATOR, + CREATOR_NAME, + CREATOR_TIME, + VALID_FLAG, + FOREIGN_KEY + + + + + #{FLOW_ID}, + #{TYPE}, + #{CREATOR}, + #{CREATOR_NAME}, + #{CREATOR_TIME}, + #{VALID_FLAG}, + #{FOREIGN_KEY} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + FLOW_ID = #{FLOW_ID} + + + + + update BUS_FLOW set + TYPE = #{TYPE}, + CREATOR = #{CREATOR}, + CREATOR_NAME = #{CREATOR_NAME}, + CREATOR_TIME = #{CREATOR_TIME}, + VALID_FLAG = #{VALID_FLAG}, + FOREIGN_KEY = FOREIGN_KEY + where + FLOW_ID = #{FLOW_ID} + + + + + diff --git a/src/main/resources/mybatis/datasource/xgf/TrainUsersMapper.xml b/src/main/resources/mybatis/datasource/xgf/TrainUsersMapper.xml new file mode 100644 index 00000000..1486b8ba --- /dev/null +++ b/src/main/resources/mybatis/datasource/xgf/TrainUsersMapper.xml @@ -0,0 +1,482 @@ + + + + + + + BUS_TRAINUSERS + + + + + SYS_DICTIONARIES + + + + + f.TRAININGBATCH_ID, + f.USER_ID, + f.START_DATE, + f.END_DATE, + f.STATUS, + f.TRAIN_CORPINFO_ID, + f.TRAIN_AREA, + f.SUPERVISION_STATE, + f.SUPERVISION_OPINION, + f.SUPERVISION_TIME, + f.MANAGER_STATE, + f.MANAGER_OPINION, + f.MANAGER_TIME, + f.TERRITORIALITY_STATE, + f.TERRITORIALITY_OPINION, + f.TERRITORIALITY_TIME, + f.TRAINUSERS_ID, + f.STEP_STATUS + + + + + TRAININGBATCH_ID, + USER_ID, + START_DATE, + END_DATE, + STATUS, + TRAIN_CORPINFO_ID, + TRAIN_AREA, + SUPERVISION_STATE, + SUPERVISION_OPINION, + SUPERVISION_TIME, + MANAGER_STATE, + MANAGER_OPINION, + MANAGER_TIME, + TERRITORIALITY_STATE, + TERRITORIALITY_OPINION, + TERRITORIALITY_TIME, + TRAINUSERS_ID, + STEP_STATUS + + + + + #{TRAININGBATCH_ID}, + #{USER_ID}, + #{START_DATE}, + #{END_DATE}, + #{STATUS}, + #{TRAIN_CORPINFO_ID}, + #{TRAIN_AREA}, + #{SUPERVISION_STATE}, + #{SUPERVISION_OPINION}, + #{SUPERVISION_TINE}, + #{MANAGER_STATE}, + #{MANAGER_OPINION}, + #{MANAGER_TIME}, + #{TERRITORIALITY_STATE}, + #{TERRITORIALITY_OPINION}, + #{TERRITORIALITY_TIME}, + #{TRAINUSERS_ID}, + #{STEP_STATUS} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + TRAINUSERS_ID = #{TRAINUSERS_ID} + + + + + update + + set + TRAININGBATCH_ID = #{TRAININGBATCH_ID}, + USER_ID = #{USER_ID}, + START_DATE = #{START_DATE}, + END_DATE = #{END_DATE}, + STATUS = #{STATUS}, + TRAIN_AREA = #{TRAIN_AREA}, + STEP_STATUS = #{STEP_STATUS}, + TRAINUSERS_ID = TRAINUSERS_ID + where + TRAINUSERS_ID = #{TRAINUSERS_ID} + + + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + TRAINUSERS_ID in + + #{item} + + + + + + update + + set STATUS = #{STATUS}, + + START_DATE = #{START_DATE}, + + + END_DATE = #{END_DATE}, + + TRAININGBATCH_ID = #{TRAININGBATCH_ID} + where + TRAININGBATCH_ID = #{TRAININGBATCH_ID} + + + + + + + + + + update + set STATUS = #{STATUS}, + + START_DATE = #{START_DATE}, + + + END_DATE = #{END_DATE}, + + TRAINUSERS_ID = #{TRAINUSERS_ID} + where + TRAINUSERS_ID = #{TRAINUSERS_ID} + + + + + + + + update + set + SUPERVISION_STATE = #{SUPERVISION_STATE}, + + STATUS = #{STATUS}, + + SUPERVISION_OPINION = #{SUPERVISION_OPINION}, + SUPERVISION_TIME= #{SUPERVISION_TIME}, + STEP_STATUS = #{STEP_STATUS} + where + TRAINUSERS_ID = #{TRAINUSERS_ID} + + + update + set + MANAGER_STATE= #{MANAGER_STATE}, + + STATUS = #{STATUS}, + + MANAGER_OPINION = #{MANAGER_OPINION}, + MANAGER_TIME = #{MANAGER_TIME}, + STEP_STATUS = #{STEP_STATUS} + where + TRAINUSERS_ID = #{TRAINUSERS_ID} + + + update + set + TERRITORIALITY_STATE = #{TERRITORIALITY_STATE}, + + STATUS = #{STATUS}, + + TERRITORIALITY_OPINION = #{TERRITORIALITY_OPINION}, + TERRITORIALITY_TIME = #{TERRITORIALITY_TIME}, + STEP_STATUS = #{STEP_STATUS} + where + TRAINUSERS_ID = #{TRAINUSERS_ID} + + + update bus_trainusers a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID in + + #{item} + ; + + + + update bus_trainusers a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID = #{TRAINUSERS_ID} + + + update bus_trainusers a set + + a.START_DATE = #{START_DATE} + + + a.END_DATE = #{END_DATE} + + where a.TRAINUSERS_ID in + + #{item} + ; + + + + + + + + + + + + + diff --git a/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml b/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml new file mode 100644 index 00000000..ece65330 --- /dev/null +++ b/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml @@ -0,0 +1,421 @@ + + + + + + + BUS_TRAININGBATCH + + + + + SYS_DICTIONARIES + + + + + f.CREATOR, + f.CREATTIME, + f.OPERATOR, + f.OPERATTIME, + f.ISDELETE, + f.BATCH_NAME, + f.CORPINFO_ID, + f.USER_COUNT, + f.TRAIN_CORP_DEPT, + f.TRAIN_CORP_LEADER, + f.DESCR, + f.TRAIN_AREA, + f.MANAGER, + f.MANAGER_USER_ID, + f.AUDIT_STATUS, + f.TRAININGBATCH_ID, + f.SUPERVISION, + f.SUPERVISION_USER_ID, + f.TERRITORIALITY, + f.TERRITORIALITY_USER_ID + + + + + CREATOR, + CREATTIME, + OPERATOR, + OPERATTIME, + ISDELETE, + BATCH_NAME, + CORPINFO_ID, + USER_COUNT, + TRAIN_CORP_DEPT, + TRAIN_CORP_LEADER, + DESCR, + TRAIN_AREA, + MANAGER, + MANAGER_USER_ID, + AUDIT_STATUS, + TYPE, + TRAININGBATCH_ID, + SUPERVISION, + SUPERVISION_USER_ID, + TERRITORIALITY, + TERRITORIALITY_USER_ID + + + + + #{CREATOR}, + #{CREATTIME}, + #{OPERATOR}, + #{OPERATTIME}, + #{ISDELETE}, + #{BATCH_NAME}, + #{CORPINFO_ID}, + #{USER_COUNT}, + #{TRAIN_CORP_DEPT}, + #{TRAIN_CORP_LEADER}, + #{DESCR}, + #{TRAIN_AREA}, + #{MANAGER}, + #{MANAGER_USER_ID}, + #{AUDIT_STATUS}, + #{TYPE}, + #{TRAININGBATCH_ID}, + #{SUPERVISION}, + #{SUPERVISION_USER_ID}, + #{TERRITORIALITY}, + #{TERRITORIALITY_USER_ID} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + TRAININGBATCH_ID = #{TRAININGBATCH_ID} + + + + + update + + set + OPERATOR = #{OPERATOR}, + OPERATTIME = #{OPERATTIME}, + AUDIT_STATUS = #{AUDIT_STATUS}, + TRAIN_CORP_DEPT = #{TRAIN_CORP_DEPT}, + TRAIN_CORP_LEADER = #{TRAIN_CORP_LEADER}, + ENTRUST_TIME = #{ENTRUST_TIME}, + VERIFY_TIME = #{VERIFY_TIME} + where + TRAININGBATCH_ID = #{TRAININGBATCH_ID} + + + + + update + + set + AUDIT_STATUS = #{AUDIT_STATUS}, + + TRAIN_CORP_DEPT = #{TRAIN_CORP_DEPT}, + + + TRAIN_CORP_LEADER = #{TRAIN_CORP_LEADER}, + + + ENTRUST_TIME = #{ENTRUST_TIME}, + + + AUDIT_TIME = #{AUDIT_TIME}, + + + VERIFY_TIME = #{VERIFY_TIME}, + + + AUDIT_DESCR = #{AUDIT_DESCR}, + + + CORP_AUDIT_DESCR = #{CORP_AUDIT_DESCR}, + + TRAININGBATCH_ID = #{TRAININGBATCH_ID} + where + TRAININGBATCH_ID = #{TRAININGBATCH_ID} + + + update bus_trainusers a set a.STATUS = '2' where a.USER_ID in + + #{item} + ; + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + TRAININGBATCH_ID in + + #{item} + + + + + + + + + + + + diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml index 0dbafc9c..fbb2f490 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -92,6 +92,40 @@ XGF_USER_ID = #{XGF_USER_ID} + + update + + set STATUS = #{STATUS} + where + XGF_USER_ID in (select USER_ID from bus_trainusers bu where bu.TRAINUSERS_ID = #{TRAINUSERS_ID}) + + + update + + set STATUS = #{STATUS} + where + XGF_USER_ID in + + #{item} + + + + update + + set STATUS = #{STATUS} + where + XGF_USER_ID in (select USER_ID from bus_trainusers bu where bu.TRAININGBATCH_ID = #{TRAININGBATCH_ID}) + + + update bus_trainusers a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID in + + #{item} + ; + + + update bus_trainusers a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID = #{TRAINUSERS_ID} + + select f.*, - ma.NAME MANAGER_DEPARTMENT_NAME, + ma.NAME MANAGER_DEPT_NAME, ma_u.NAME MANAGER_USER_NAME, md.NAME MAIN_DEPARTMENT_NAME, (select MANAGER_TIME from bus_trainusers t1 where t1.TRAININGBATCH_ID = f.TRAININGBATCH_ID order by t1.MANAGER_TIME DESC LIMIT 0,1) AS MANAGER_TIME, - su.NAME SUPERVISION_DEPARTMENT_NAME, + su.NAME SUPERVISION_DEPT_NAME, su_u.NAME SUPERVISION_USER_NAME, (select SUPERVISION_TIME from bus_trainusers t2 where t2.TRAININGBATCH_ID = f.TRAININGBATCH_ID order by t2.SUPERVISION_TIME DESC LIMIT 0,1) AS SUPERVISION_TIME, - te.NAME TERRITORIALITY_DEPARTMENT_NAME, + te.NAME TERRITORIALITY_DEPT_NAME, te_u.NAME TERRITORIALITY_USER_NAME, (select TERRITORIALITY_TIME from bus_trainusers t3 where t3.TRAININGBATCH_ID = f.TRAININGBATCH_ID order by t3.TERRITORIALITY_TIME DESC LIMIT 0,1) AS TERRITORIALITY_TIME, cu.NAME TRAIN_CORP_LEADER_NAME, @@ -200,11 +200,11 @@ and t4.TERRITORIALITY_STATE = '1' ) as PASS_COUNT from f - left join vi_corp_department ma on ma.DEPARTMENT_ID = f.MANAGER + 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_regulatory_department su on su.DEPARTMENT_ID = f.SUPERVISION + 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_corp_department te on te.DEPARTMENT_ID = f.TERRITORIALITY + 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 sys_dictionaries d on d.DICTIONARIES_ID = f.TRAIN_AREA @@ -325,14 +325,17 @@ t.SUPERVISION_OPINION, t.SUPERVISION_TIME, tr.SUPERVISION, + sup.NAME SUPERVISION_DEPT_NAME, t.MANAGER_STATE, t.MANAGER_OPINION, t.MANAGER_TIME, tr.MANAGER, + man.NAME MANAGER_DEPT_NAME, t.TERRITORIALITY_STATE, t.TERRITORIALITY_OPINION, t.TERRITORIALITY_TIME, tr.TERRITORIALITY, + tra.NAME TERRITORIALITY_DEPT_NAME, t.TRAINUSERS_ID, t.STEP_STATUS, d.NAME DEPARTMENT_NAME , @@ -350,8 +353,11 @@ left join bus_trainingbatch tr on tr.TRAININGBATCH_ID = t.TRAININGBATCH_ID LEFT JOIN `qa-gwj-regulatory`.bus_class_info n ON n.TRAINUSERS_ID = t.TRAINUSERS_ID left join vi_corp_user te on te.USER_ID = tr.TERRITORIALITY_USER_ID - left join vi_regulatory_user s on s.USER_ID = tr.SUPERVISION_USER_ID + left join vi_user_all s on s.USER_ID = tr.SUPERVISION_USER_ID left join vi_corp_user m on m.USER_ID = tr.MANAGER_USER_ID + left join vi_department_all sup on sup.DEPARTMENT_ID = tr.SUPERVISION + left join vi_department_all man on man.DEPARTMENT_ID = tr.MANAGER + left join vi_department_all tra on man.DEPARTMENT_ID = tr.TERRITORIALITY where t.TRAININGBATCH_ID = #{pd.TRAININGBATCH_ID} + From 7360ba8cca78b9dea88b116200ed4e24c0847bbe Mon Sep 17 00:00:00 2001 From: liujun Date: Tue, 19 Dec 2023 20:03:25 +0800 Subject: [PATCH 05/21] =?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} + + From d8f38ffdcdbdfcda95c2558d5465646c4d494c0a Mon Sep 17 00:00:00 2001 From: liujun Date: Wed, 20 Dec 2023 14:49:01 +0800 Subject: [PATCH 06/21] =?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/xgf/FlowTrainController.java | 113 +++++-- .../mapper/datasource/xgf/XgfUserMapper.java | 2 +- .../zcloud/service/xgf/TrainUsersService.java | 3 +- .../xgf/impl/TrainUsersServiceImpl.java | 189 +++-------- .../xgf/impl/TrainingBatchServiceImpl.java | 80 ++++- .../datasource/xgf/FlowDetailMapper.xml | 2 +- .../datasource/xgf/TrainUsersMapper.xml | 103 +++--- .../datasource/xgf/TrainingBatchMapper.xml | 317 +++++++----------- .../mybatis/datasource/xgf/XgfUserMapper.xml | 16 +- 9 files changed, 376 insertions(+), 449 deletions(-) diff --git a/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java b/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java index 125f1f73..47df2e56 100644 --- a/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java +++ b/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java @@ -3,8 +3,10 @@ package com.zcloud.controller.xgf; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.service.xgf.TrainUsersService; import com.zcloud.service.xgf.TrainingBatchService; import com.zcloud.util.*; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -29,9 +31,12 @@ public class FlowTrainController extends BaseController { @Resource private TrainingBatchService trainingbatchService; - @RequestMapping(value="/batchList") + @Resource + private TrainUsersService trainUsersService; + + @RequestMapping(value = "/batchList") @ResponseBody - public Object batchList(Page page) throws Exception{ + public Object batchList(Page page) throws Exception { Map map = new HashMap(); PageData pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); @@ -45,37 +50,46 @@ public class FlowTrainController extends BaseController { return map; } - @RequestMapping(value="/batchUserList") + @RequestMapping(value = "/batchUserList") @ResponseBody - public Object batchUserList(Page page) throws Exception{ + public Object batchUserList(Page page) throws Exception { + PageData request = this.getPageData(); + PageData condition = new PageData(); + condition.put("TRAINING_BATCH_ID", request.get("TRAINING_BATCH_ID")); + page.setPd(condition); + List varList = trainingbatchService.batchUserlistPage(page); + + PageData response = new PageData(); + response.put("varList", varList); + response.put("page", page); + response.put("total", page.getTotalResult()); + response.put("result", "success"); + return response; + } + + @RequestMapping(value = "/batchAudit") + @ResponseBody + public Object batchAudit(Page page) throws Exception { PageData pd = new PageData(); pd = this.getPageData(); - Map result = HttpClientService.doPost(xgfUrl + "/openApi/trainingbatch/batchUserList" +getPageUrl(page), pd); + Map result = HttpClientService.doPost(xgfUrl + "/openApi/trainingbatch/audit", pd); return result; } - @RequestMapping(value="/batchAudit") - @ResponseBody - public Object batchAudit(Page page) throws Exception{ - PageData pd = new PageData(); - pd = this.getPageData(); - Map result = HttpClientService.doPost(xgfUrl + "/openApi/trainingbatch/audit" , pd); - return result; - } - - private String getPageUrl(Page page){ - return "?showCount=" +page.getShowCount() + "¤tPage=" + page.getUrlCurrentPage(); + private String getPageUrl(Page page) { + return "?showCount=" + page.getShowCount() + "¤tPage=" + page.getUrlCurrentPage(); } /** * 分公司端-相关方流动人员培训审核-查看用户信息 + * * @return * @throws Exception */ - @RequestMapping(value="/getUserDetailById") + @RequestMapping(value = "/getUserDetailById") @ResponseBody - public Object getCorpUserList() throws Exception{ - Map map = new HashMap(); + public Object getCorpUserList() throws Exception { + Map map = new HashMap(); String errInfo = "success"; PageData pd = new PageData(); pd = this.getPageData(); @@ -83,24 +97,55 @@ public class FlowTrainController extends BaseController { return result; } - @RequestMapping(value="/approveUser") + @RequestMapping(value = "/approveUser") @ResponseBody - public Object approveUser() throws Exception{ - PageData pd = new PageData(); - pd = this.getPageData(); - pd.put("loginUserId",Jurisdiction.getUSER_ID()); - Map result = HttpClientService.doPost(xgfUrl + "/openApi/trainusers/approveUser", pd); - return result; + public Object approveUser() throws Exception { + Map map = new HashMap(); + PageData pd = this.getPageData(); + trainUsersService.approveUser(pd); + map.put("result", "success"); + return map; } - @RequestMapping(value="/getDetailsById") + + @RequestMapping(value = "/getDetailsById") @ResponseBody - public Object getDetailsById() throws Exception{ - PageData pd = new PageData(); - pd = this.getPageData(); - if(!Jurisdiction.getUsername().equals("admin")){ - pd.put("AUDIT_USER_ID", Jurisdiction.getUSER_ID()); + public Object getDetailsById() throws Exception { + PageData request = this.getPageData(); + PageData condition = new PageData(); + condition.put("TRAINING_BATCH_ID", request.get("TRAINING_BATCH_ID")); + PageData entity = trainingbatchService.findById(condition); + switch (entity.getString("STEP_STATUS")) { + case "0": + if (entity.getString("TERRITORIALITY_USER_ID").equals(Jurisdiction.getUSER_ID())) { + entity.put("step", "TERRITORIALITY_STATE"); + } + break; + case "1": + if (entity.getString("MANAGER_USER_ID").equals(Jurisdiction.getUSER_ID())) { + entity.put("step", "MANAGER_STATE"); + } + break; + case "2": + if (entity.getString("SUPERVISION_USER_ID").equals(Jurisdiction.getUSER_ID())) { + entity.put("step", "SUPERVISION_STATE"); + } + break; + default: + break; } - Map result = HttpClientService.doPost(xgfUrl+ "/openApi/trainingbatch/getDetailsById", pd); - return result; + PageData response = new PageData(); + response.put("pd", entity); + response.put("result", "success"); + return response; + } + + @RequestMapping(value = "/endApproval") + @ResponseBody + public Object endApproval() throws Exception { + Map map = new HashMap(); + PageData pd = this.getPageData(); + trainUsersService.endApproval(pd); + map.put("result", "success"); + return map; } } 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 20b35f30..d60b51cf 100644 --- a/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java @@ -57,7 +57,7 @@ public interface XgfUserMapper { void updateStatusByUnflowTrain(PageData pd); - void bantchUpdateStatus(int i, String[] userids); + void bantchUpdateStatus(int STATUS, String[] arrayDATA_ids); void updateStatusByFlowTrain(PageData pd); diff --git a/src/main/java/com/zcloud/service/xgf/TrainUsersService.java b/src/main/java/com/zcloud/service/xgf/TrainUsersService.java index b04c88f0..bba08ab6 100644 --- a/src/main/java/com/zcloud/service/xgf/TrainUsersService.java +++ b/src/main/java/com/zcloud/service/xgf/TrainUsersService.java @@ -92,8 +92,9 @@ public interface TrainUsersService{ * @param pd * @throws Exception */ - public Integer approveUser(PageData pd)throws Exception; + public void approveUser(PageData pd)throws Exception; List findinfoByCondition(PageData condition) throws Exception; + void endApproval(PageData pd) throws Exception; } diff --git a/src/main/java/com/zcloud/service/xgf/impl/TrainUsersServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/TrainUsersServiceImpl.java index 786487f8..79aefcec 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/TrainUsersServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/TrainUsersServiceImpl.java @@ -144,162 +144,53 @@ public class TrainUsersServiceImpl implements TrainUsersService { } @Override - public Integer approveUser(PageData pd) throws Exception { - String type = pd.getString("type"); //1、集团单位,2、企业端,3、监管端 - String TRAINUSERS_ID = pd.getString("TRAINUSERS_ID"); //培训批次 详情id - String STATE = pd.getString("IS_STATE"); // 审批状态 0:不合格;1:合格; - - String OPINION = pd.getString("OPINION"); // 审批意见 - Integer userCount = Integer.parseInt(pd.getString("USER_COUNT")); // 批次的人数 - String[] userids = new String[1]; // 被审批人 - userids[0] = pd.getString("USER_ID"); - PageData trainusersPd = trainusersMapper.getPdById(pd); //培训 详情信息 - PageData appPd = new PageData(); - appPd.put("TRAINUSERS_ID", trainusersPd.getString("TRAINUSERS_ID")); - appPd.put("STATUS", "1"); - /*2023-12-06 liu jun 需求便跟*/ - PageData batch = trainingBatchMapper.findById(pd); - // 如果 - if ("0".equals(STATE)) { - appPd.put("STATUS", "-1"); - userids[0] = pd.getString("USER_ID"); - xgfUserMapper.bantchUpdateStatus(0, userids); - } - if (trainusersPd.get("STEP_STATUS") == null || trainusersPd.get("STEP_STATUS").equals("0")) { - if (pd.getString("loginUserId").equals(batch.getString("TERRITORIALITY_USER_ID"))) { - appPd.put("TERRITORIALITY_STATE", STATE); - appPd.put("TERRITORIALITY_OPINION", OPINION); - appPd.put("TERRITORIALITY_TIME", DateUtil.getTime()); - appPd.put("STEP_STATUS", "1"); - trainusersMapper.approveTerritoriality(appPd); - } else { - throw new RuntimeException("当前用户不是集团单位指定审批人,无法进行审批"); - } - } - if (trainusersPd.get("STEP_STATUS") != null && trainusersPd.get("STEP_STATUS").equals("1")) { - if (pd.getString("loginUserId").equals(batch.getString("MANAGER_USER_ID"))) { - appPd.put("MANAGER_STATE", STATE); - appPd.put("MANAGER_OPINION", OPINION); - appPd.put("MANAGER_TIME", DateUtil.getTime()); - appPd.put("STEP_STATUS", "2"); - trainusersMapper.approveManager(appPd); - } else { - throw new RuntimeException("当前用户不是股份主管部门指定审批人,无法进行审批"); - } - } - if (trainusersPd.get("STEP_STATUS") != null && trainusersPd.get("STEP_STATUS").equals("2")) { - if (pd.getString("loginUserId").equals(batch.getString("SUPERVISION_USER_ID"))) { - appPd.put("SUPERVISION_STATE", STATE); - appPd.put("SUPERVISION_OPINION", OPINION); - appPd.put("SUPERVISION_TIME", DateUtil.getTime()); - appPd.put("STEP_STATUS", "3"); - trainusersMapper.approveSupervision(appPd); - } else { - throw new RuntimeException("当前用户不是股份安监部门,无法进行审批"); - } - } - - /** 如果审批全部通过 */ - Integer stateCountInt = 0; //审批了几次, 如果是审批了3次.这个人审批完成 - Integer stateTongguoInt = 0; //审批通过次数 - String sate1 = trainusersPd.getString("SUPERVISION_STATE"); - String sate2 = trainusersPd.getString("MANAGER_STATE"); - String sate3 = trainusersPd.getString("TERRITORIALITY_STATE"); - if (!Tools.isEmpty(sate1)) { //如果有审批状态 就是审批过的数据 - stateCountInt++; - } - if (!Tools.isEmpty(sate2)) { //如果有审批状态 就是审批过的数据 - stateCountInt++; - } - if (!Tools.isEmpty(sate3)) { //如果有审批状态 就是审批过的数据 - stateCountInt++; - } - if ("1".equals(sate1)) { - stateTongguoInt++; - } - if ("1".equals(sate2)) { - stateTongguoInt++; - } - if ("1".equals(sate3)) { - stateTongguoInt++; - } - - //如果其中一个人打回,则结束审批流程 - if ("0".equals(STATE)) { - stateCountInt = 3; - } - if (3 == stateCountInt) { //这个人的审批全部 - PageData statePd = new PageData(); - statePd.put("TRAINUSERS_ID", TRAINUSERS_ID); - String STATUS = "-1"; //培训状态0未培训1培训中2培训通过-1培训未通过 - if (3 == stateTongguoInt) { - STATUS = "2"; - statePd.put("STATUS", STATUS); - trainusersMapper.updateStatus(statePd); - } - } - // 这个批次全部审批完成 - Integer wanchengPingshen = trainusersMapper.getCountByWanchengPingshen(trainusersPd); - - if (wanchengPingshen == userCount) { //已经审批的数据量 和 批次的人数一致的时候,修改批次的状态 - PageData trainingBatchPd = trainingBatchMapper.findById(trainusersPd); - trainingBatchPd.put("AUDIT_STATUS", "2"); //业务修改 ,现在只有 2培训中 3培训完成 - trainingBatchMapper.edit(trainingBatchPd); - } - - /*保存审批流*/ + public void approveUser(PageData pd) throws Exception { PageData condition = new PageData(); - condition.put("FOREIGN_KEY", trainusersPd.getString("TRAININGBATCH_ID")); - PageData flow = flowMapper.findByCondition(condition); - if (flow == null) { - System.out.println("历史数据======不做处理"); - } else { - condition.clear(); - condition.put("FLOW_ID", flow.getString("FLOW_ID")); - condition.put("FOREIGN_KEY", trainusersPd.getString("TRAINUSERS_ID")); - condition.put("STEP_FLAG", "1"); - PageData step = flowDetailMapper.selectOne(condition); - if (step == null) { - condition.clear(); - condition.put("FLOW_ID", flow.getString("FLOW_ID")); - condition.put("PARENT_ID", "0"); - step = flowDetailMapper.selectOne(condition); - } - step.put("STEP_FLAG", "0"); - flowDetailMapper.edit(step); - - PageData nextStep = new PageData(); - nextStep.put("FLOW_DETAIL_ID", Warden.get32UUID()); - nextStep.put("FLOW_ID", flow.getString("FLOW_ID")); - nextStep.put("STEP_FLAG", "1"); - nextStep.put("PARENT_ID", step.getString("FLOW_DETAIL_ID")); - nextStep.put("FOREIGN_KEY", trainusersPd.getString("TRAINUSERS_ID")); - nextStep.put("STEP_NAME", "培训审核"); - nextStep.put("SORT", (Integer) step.get("SORT") + 1); - nextStep.put("CREATE_TIME", DateUtil.date2Str(new Date())); - nextStep.put("APPROVER_ID", pd.getString("APPROVER_ID")); - nextStep.put("APPROVER_NAME", pd.getString("APPROVER_NAME")); - nextStep.put("APPROVER_OPINION", OPINION); - nextStep.put("APPROVER_TIME", DateUtil.getTime()); - nextStep.put("APPROVER_CORPINFO_ID", pd.getString("APPROVER_CORPINFO_ID")); - nextStep.put("APPROVER_CORPINFO_NAME", pd.getString("APPROVER_CORPINFO_NAME")); - nextStep.put("PASS_FLAG", STATE); - if (3 == stateCountInt) { - nextStep.put("IS_END", "1"); - } else { - nextStep.put("IS_END", "0"); - } - nextStep.put("ISDELETE", "0"); - nextStep.put("FOREIGN_KEY", trainusersPd.getString("TRAINUSERS_ID")); - flowDetailMapper.save(nextStep); + condition.put("TRAIN_USERS_ID", pd.get("TRAIN_USERS_ID")); + PageData userEntity = trainusersMapper.findById(condition); + switch (userEntity.getString("STEP_STATUS")){ + case "0": + userEntity.put("TERRITORIALITY_STATE", pd.getString("IS_STATE")); + userEntity.put("TERRITORIALITY_OPINION", pd.getString("OPINION")); + userEntity.put("TERRITORIALITY_TIME", DateUtil.getTime()); + break; + case "1": + userEntity.put("MANAGER_STATE", pd.getString("IS_STATE")); + userEntity.put("MANAGER_OPINION", pd.getString("OPINION")); + userEntity.put("MANAGER_TIME", DateUtil.getTime()); + break; + case "3": + userEntity.put("SUPERVISION_STATE", pd.getString("IS_STATE")); + userEntity.put("SUPERVISION_OPINION", pd.getString("OPINION")); + userEntity.put("SUPERVISION_TIME", DateUtil.getTime()); + break; } - - return 0; + if ("0".equals(pd.getString("IS_STATE"))) { + userEntity.put("STEP_STATUS", '-' + userEntity.getString("STEP_STATUS")); + userEntity.put("RESULT_STATUS","3"); + } else { + int stepNumber = Integer.parseInt(userEntity.getString("STEP_STATUS")) + 1; + if (stepNumber == 3){ + userEntity.put("RESULT_STATUS","2"); + } + userEntity.put("STEP_STATUS", Integer.toString(stepNumber)); + } + trainusersMapper.edit(userEntity); } @Override public List findinfoByCondition(PageData condition) throws Exception { return trainusersMapper.findinfoByCondition(condition); } + + @Override + public void endApproval(PageData pd) throws Exception { + PageData condition = new PageData(); + condition.put("TRAINING_BATCH_ID",pd.getString("TRAINING_BATCH_ID")); + PageData entity = trainingBatchMapper.findById(condition); + int stepNumber = Integer.parseInt(entity.getString("STEP_STATUS")); + entity.put("STEP_STATUS",++stepNumber); + trainingBatchMapper.edit(entity); + } } diff --git a/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java index a6d25eb7..71758050 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java @@ -2,6 +2,7 @@ package com.zcloud.service.xgf.impl; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.system.DepartmentMapper; import com.zcloud.mapper.datasource.system.UsersMapper; import com.zcloud.mapper.datasource.xgf.*; import com.zcloud.service.xgf.TrainingBatchService; @@ -42,8 +43,11 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { @Resource private FlowDetailMapper flowDetailMapper; -// @Value("${prevention.api.url}") -// private String preventionUrl; + @Resource + private UsersMapper usersMapper; + + @Resource + private DepartmentMapper departmentMapper; /**新增 * @param pd @@ -53,7 +57,7 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { /* 保存主题信息 */ String batch_id=UuidUtil.get32UUID(); String train_area=pd.getString("TRAIN_AREA"); - pd.put("TRAININGBATCH_ID", batch_id); //主键 + pd.put("TRAINING_BATCH_ID", batch_id); //主键 pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 @@ -69,14 +73,45 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { PageData cpd = trainingbatchMapper.getCode(pd); //根据ID读取 String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString())+1)); pd.put("BATCH_NAME",code); + /*翻译*/ + PageData condition = new PageData(); + condition.put("USER_ID",pd.get("SUPERVISION_USER_ID")); + PageData supUser = usersMapper.getUserInfo(condition); + pd.put("SUPERVISION_USER_NAME",supUser.get("NAME")); + condition.clear(); + condition.put("DEPARTMENT_ID",pd.get("SUPERVISION")); + PageData supDepartment = departmentMapper.getInfo(condition); + pd.put("SUPERVISION_DEPARTMENT_NAME",supDepartment.get("NAME")); + + condition.clear(); + condition.put("USER_ID",pd.get("MANAGER_USER_ID")); + PageData manUser = usersMapper.getUserInfo(condition); + pd.put("MANAGER_USER_NAME",manUser.get("NAME")); + + condition.clear(); + condition.put("DEPARTMENT_ID",pd.get("MANAGER")); + PageData manDepartment = departmentMapper.getInfo(condition); + pd.put("MANAGER_DEPARTMENT_NAME",manDepartment.get("NAME")); + + condition.clear(); + condition.put("USER_ID",pd.get("TERRITORIALITY_USER_ID")); + PageData terUser = usersMapper.getUserInfo(condition); + pd.put("TERRITORIALITY_USER_NAME",terUser.get("NAME")); + + condition.clear(); + condition.put("DEPARTMENT_ID",pd.get("TERRITORIALITY")); + PageData terDepartment = departmentMapper.getInfo(condition); + pd.put("TERRITORIALITY_DEPARTMENT_NAME",terDepartment.get("NAME")); + pd.put("IS_DELETE","0"); + pd.put("STEP_STATUS","0"); trainingbatchMapper.save(pd); - String ArrayDATA_IDS[] = pd.getString("users").split(","); - Arrays.asList(ArrayDATA_IDS).forEach(id -> { + String arrayDATA_ids[] = pd.getString("users").split(","); + Arrays.asList(arrayDATA_ids).forEach(id -> { PageData user = new PageData(); - user.put("TRAINUSERS_ID", UuidUtil.get32UUID()); - user.put("TRAININGBATCH_ID", batch_id); + user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); + user.put("TRAINING_BATCH_ID", batch_id); user.put("USER_ID", id); user.put("TRAIN_AREA", train_area); user.put("STATUS", 0); @@ -84,9 +119,18 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { user.put("MANAGER_STATE", 9); user.put("TERRITORIALITY_STATE", 9); user.put("STEP_STATUS", "0"); + user.put("BELONG_TO_CORP",pd.get("BELONG_TO_CORP")); + user.put("BELONG_TO_CORP_NAME",pd.get("BELONG_TO_CORP_NAME")); + user.put("IS_DELETE", "0"); + user.put("RESULT_STATUS","1"); trainUsersMapper.save(user); + condition.clear(); + condition.put("XGF_USER_ID",id); + PageData userEntity = xgfUserMapper.findById(condition); + userEntity.put("STATUS","3"); + userEntity.put("STUDY_STATUS","9"); + xgfUserMapper.edit(userEntity); }); - xgfUserMapper.bantchUpdateStatus(9,ArrayDATA_IDS); /* 保存审批流程信息 */ PageData flow = new PageData(); @@ -96,7 +140,7 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { flow.put("CREATOR_NAME",Jurisdiction.getName()); flow.put("CREATOR_TIME", DateUtil.getTime()); flow.put("VALID_FLAG", "1"); - flow.put("FOREIGN_KEY",pd.getString("TRAININGBATCH_ID")); + flow.put("FOREIGN_KEY",pd.getString("TRAINING_BATCH_ID")); flow.put("ISDELETE", "0"); flowMapper.save(flow); /* 保存审批流程明细信息 */ @@ -125,7 +169,7 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { public void unflowTrain(PageData pd)throws Exception{ PageData trainBatch = new PageData(); String batch_id = UuidUtil.get32UUID(); - trainBatch.put("TRAININGBATCH_ID", batch_id); //主键 + trainBatch.put("TRAINING_BATCH_ID", batch_id); //主键 trainBatch.put("CREATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //添加人 trainBatch.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 trainBatch.put("OPERATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //修改人 @@ -150,11 +194,11 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { trainBatch.put("AUDIT_STATUS", "2"); this.audit(trainBatch); - String ArrayDATA_IDS[] = pd.getString("users").split(","); - Arrays.asList(ArrayDATA_IDS).forEach(id -> { + String arrayDATA_IDS[] = pd.getString("users").split(","); + Arrays.asList(arrayDATA_IDS).forEach(id -> { PageData user = new PageData(); - user.put("TRAINUSERS_ID", UuidUtil.get32UUID()); - user.put("TRAININGBATCH_ID", batch_id); + user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); + user.put("TRAINING_BATCH_ID", batch_id); user.put("USER_ID", id); user.put("TRAIN_CORPINFO_ID", pd.getString("FIRST_PARTY_ID")); user.put("STATUS", 1); @@ -165,7 +209,7 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { user.put("STEP_STATUS", "0"); trainUsersMapper.save(user); }); - xgfUserMapper.bantchUpdateStatus(1,ArrayDATA_IDS); + xgfUserMapper.bantchUpdateStatus(1,arrayDATA_IDS); } @@ -278,7 +322,7 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { condition.clear(); condition.put("STATUS",info.getString("detailsStatus")); - condition.put("list",list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("TRAINUSERS_ID")).collect(Collectors.toList())); + condition.put("list",list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); trainUsersMapper.graduation(condition); } @@ -293,7 +337,7 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { condition.clear(); condition.put("STATUS",info.getString("detailsStatus")); - condition.put("TRAINUSERS_ID", info.getString("TRAINUSERS_ID")); + condition.put("TRAIN_USERS_ID", info.getString("TRAIN_USERS_ID")); trainUsersMapper.graduationstudent(condition); } @@ -302,7 +346,7 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { public void updateClassMessage(PageData info) { List list = Warden.getList(info.getString("list")); PageData condition = new PageData(); - condition.put("list", list.stream().map(n -> n.getString("TRAINUSERS_ID")).collect(Collectors.toList())); + condition.put("list", list.stream().map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); if (StringUtils.isNotEmpty(info.getString("START_DATE"))){ condition.put("START_DATE",DateUtil.getTime()); } diff --git a/src/main/resources/mybatis/datasource/xgf/FlowDetailMapper.xml b/src/main/resources/mybatis/datasource/xgf/FlowDetailMapper.xml index c3e402d7..4a663f1e 100644 --- a/src/main/resources/mybatis/datasource/xgf/FlowDetailMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/FlowDetailMapper.xml @@ -1,6 +1,6 @@ - + diff --git a/src/main/resources/mybatis/datasource/xgf/TrainUsersMapper.xml b/src/main/resources/mybatis/datasource/xgf/TrainUsersMapper.xml index 1486b8ba..0c20cab8 100644 --- a/src/main/resources/mybatis/datasource/xgf/TrainUsersMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/TrainUsersMapper.xml @@ -4,7 +4,7 @@ - BUS_TRAINUSERS + xgf_train_users @@ -14,7 +14,7 @@ - f.TRAININGBATCH_ID, + f.TRAINING_BATCH_ID, f.USER_ID, f.START_DATE, f.END_DATE, @@ -30,13 +30,17 @@ f.TERRITORIALITY_STATE, f.TERRITORIALITY_OPINION, f.TERRITORIALITY_TIME, - f.TRAINUSERS_ID, - f.STEP_STATUS + f.TRAIN_USERS_ID, + f.STEP_STATUS, + f.BELONG_TO_CORP + f.BELONG_TO_CORP_NAME, + f.IS_DELETE, + f.RESULT_STATUS - TRAININGBATCH_ID, + TRAINING_BATCH_ID, USER_ID, START_DATE, END_DATE, @@ -52,13 +56,17 @@ TERRITORIALITY_STATE, TERRITORIALITY_OPINION, TERRITORIALITY_TIME, - TRAINUSERS_ID, - STEP_STATUS + TRAIN_USERS_ID, + STEP_STATUS, + BELONG_TO_CORP, + BELONG_TO_CORP_NAME, + IS_DELETE, + RESULT_STATUS - #{TRAININGBATCH_ID}, + #{TRAINING_BATCH_ID}, #{USER_ID}, #{START_DATE}, #{END_DATE}, @@ -74,8 +82,12 @@ #{TERRITORIALITY_STATE}, #{TERRITORIALITY_OPINION}, #{TERRITORIALITY_TIME}, - #{TRAINUSERS_ID}, - #{STEP_STATUS} + #{TRAIN_USERS_ID}, + #{STEP_STATUS}, + #{BELONG_TO_CORP}, + #{BELONG_TO_CORP_NAME}, + #{IS_DELETE}, + #{RESULT_STATUS} @@ -96,7 +108,7 @@ set ISDELETE = '1' where - TRAINUSERS_ID = #{TRAINUSERS_ID} + TRAIN_USERS_ID = #{TRAIN_USERS_ID} @@ -104,35 +116,34 @@ update set - TRAININGBATCH_ID = #{TRAININGBATCH_ID}, + TRAINING_BATCH_ID= #{TRAINING_BATCH_ID}, USER_ID = #{USER_ID}, START_DATE = #{START_DATE}, END_DATE = #{END_DATE}, STATUS = #{STATUS}, + TRAIN_CORPINFO_ID = #{TRAIN_CORPINFO_ID}, TRAIN_AREA = #{TRAIN_AREA}, + SUPERVISION_STATE = #{SUPERVISION_STATE}, + SUPERVISION_OPINION = #{SUPERVISION_OPINION}, + SUPERVISION_TIME = #{SUPERVISION_TINE}, + MANAGER_STATE = #{MANAGER_STATE}, + MANAGER_OPINION = #{MANAGER_OPINION}, + MANAGER_TIME = #{MANAGER_TIME}, + TERRITORIALITY_STATE = #{TERRITORIALITY_STATE}, + TERRITORIALITY_OPINION = #{TERRITORIALITY_OPINION}, + TERRITORIALITY_TIME = #{TERRITORIALITY_TIME}, STEP_STATUS = #{STEP_STATUS}, - TRAINUSERS_ID = TRAINUSERS_ID + BELONG_TO_CORP = #{BELONG_TO_CORP}, + BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME}, + IS_DELETE = #{IS_DELETE}, + RESULT_STATUS = #{RESULT_STATUS} where - TRAINUSERS_ID = #{TRAINUSERS_ID} + TRAIN_USERS_ID = #{TRAIN_USERS_ID} @@ -204,7 +215,7 @@ left join bus_corpinfo c on c.CORPINFO_ID = u.CORPINFO_ID left join vi_corp_info vc on vc.CORPINFO_ID = f.TRAIN_CORPINFO_ID left join oa_department d on d.DEPARTMENT_ID = u.DEPARTMENT_ID - where f.TRAININGBATCH_ID is null + where f.TRAINING_BATCH_ID is null and ( @@ -232,7 +243,7 @@ set ISDELETE = '1' where - TRAINUSERS_ID in + TRAIN_USERS_ID in #{item} @@ -249,15 +260,15 @@ END_DATE = #{END_DATE}, - TRAININGBATCH_ID = #{TRAININGBATCH_ID} + TRAINING_BATCH_ID = #{TRAINING_BATCH_ID} where - TRAININGBATCH_ID = #{TRAININGBATCH_ID} + TRAINING_BATCH_ID = #{TRAINING_BATCH_ID} @@ -421,7 +432,7 @@ f where - f.TRAINUSERS_ID = #{TRAINUSERS_ID} + f.TRAIN_USERS_ID = #{TRAIN_USERS_ID} @@ -299,7 +254,7 @@ set ISDELETE = '1' where - TRAININGBATCH_ID in + TRAINING_BATCH_ID in #{item} @@ -314,51 +269,27 @@ diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml index 3ab8dcc0..1517d39d 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -20,7 +20,8 @@ f.CORPINFO_ID, f.STATUS, f.OPERATOR_TIME, - f.ISFLOW + f.ISFLOW, + f.STUDY_STATUS @@ -36,7 +37,8 @@ CORPINFO_ID, STATUS, OPERATOR_TIME, - ISFLOW + ISFLOW, + STUDY_STATUS @@ -52,7 +54,8 @@ #{CORPINFO_ID}, #{STATUS}, #{OPERATOR_TIME}, - #{ISFLOW} + #{ISFLOW}, + #{STUDY_STATUS} @@ -91,7 +94,8 @@ CORPINFO_ID = #{CORPINFO_ID}, STATUS = #{STATUS}, OPERATOR_TIME = #{OPERATOR_TIME}, - ISFLOW = #{ISFLOW} + ISFLOW = #{ISFLOW}, + STUDY_STATUS = #{STUDY_STATUS} where XGF_USER_ID = #{XGF_USER_ID} @@ -106,7 +110,7 @@ update - set STATUS = #{STATUS} + set STUDY_STATUS = #{STATUS} where XGF_USER_ID in @@ -194,7 +198,7 @@ + From a28d97cea7cfc53bc9911c1489883b86a276278e Mon Sep 17 00:00:00 2001 From: liujun Date: Thu, 21 Dec 2023 13:58:57 +0800 Subject: [PATCH 10/21] =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=96=B9=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E8=AF=A6=E6=83=85=E7=BB=9F=E4=B8=80=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/xgf/XgfUserController.java | 28 +++++++++++++++++++ .../datasource/xgf/TrainingBatchMapper.java | 2 ++ .../mapper/datasource/xgf/XgfUserMapper.java | 2 ++ .../service/xgf/TrainingBatchService.java | 2 ++ .../zcloud/service/xgf/XgfUserService.java | 2 ++ .../xgf/impl/TrainingBatchServiceImpl.java | 5 ++++ .../service/xgf/impl/XgfUserServiceImpl.java | 5 ++++ .../datasource/xgf/TrainingBatchMapper.xml | 16 +++++++++++ .../mybatis/datasource/xgf/XgfUserMapper.xml | 15 ++++++++++ 9 files changed, 77 insertions(+) diff --git a/src/main/java/com/zcloud/controller/xgf/XgfUserController.java b/src/main/java/com/zcloud/controller/xgf/XgfUserController.java index 14169e38..3929e092 100644 --- a/src/main/java/com/zcloud/controller/xgf/XgfUserController.java +++ b/src/main/java/com/zcloud/controller/xgf/XgfUserController.java @@ -3,13 +3,17 @@ package com.zcloud.controller.xgf; import com.zcloud.controller.base.BaseController; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.service.xgf.TrainingBatchService; import com.zcloud.service.xgf.XgfUserService; +import com.zcloud.util.HttpClientService; +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; @Controller @@ -19,6 +23,12 @@ public class XgfUserController extends BaseController { @Resource private XgfUserService xgfUserService; + @Value("${preventionxgf.api.url}") + private String url; + + @Resource + private TrainingBatchService trainingBatchService; + @RequestMapping(value = "/list") @ResponseBody @@ -59,11 +69,29 @@ public class XgfUserController extends BaseController { public Object getInfo() throws Exception { PageData request = this.getPageData(); PageData condition = new PageData(); + /*组织人员信息*/ condition.put("XGF_USER_ID", request.getString("XGF_USER_ID")); PageData entity = xgfUserService.findInfo(condition); + /*组织人员图片信息*/ + condition.put("USER_ID", entity.getString("XGF_USER_ID")); + condition.put("CORPINFO_ID", entity.getString("BELONG_TO_CORP")); + Map result = HttpClientService.doPost(url + "/openApi/user/getInfoPicture", condition); + if (result == null || !"succeed".equals(result.get("result"))) throw new RuntimeException("请求失败"); + /*组织员工培训信息*/ + condition.clear(); + condition.put("USER_ID", entity.getString("XGF_USER_ID")); + List recordList = xgfUserService.findRecordList(condition); + /*培训申请记录*/ + condition.clear(); + condition.put("USER_ID", entity.getString("XGF_USER_ID")); + List trainList = trainingBatchService.findByUserId(condition); + PageData response = new PageData(); response.put("result", "success"); response.put("info", entity); + response.put("img", result); + response.put("trainRecordList", recordList); + response.put("applyList", trainList); response.put("data", request); return response; } diff --git a/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java b/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java index ef808ece..e25807f2 100644 --- a/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java @@ -74,5 +74,7 @@ public interface TrainingBatchMapper{ PageData findAndTimeById(PageData pd); void graduation(PageData condition); + + List findByUserId(PageData condition); } 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 aaf87245..63d2150e 100644 --- a/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java @@ -68,4 +68,6 @@ public interface XgfUserMapper { List flowlistPage(Page page); PageData getInfoById(PageData condition); + + List findRecordList(PageData condition); } diff --git a/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java b/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java index 2c55d312..1218f53d 100644 --- a/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java +++ b/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java @@ -87,5 +87,7 @@ public interface TrainingBatchService{ void updateClassMessage(PageData condition); void saveFlow(PageData request) throws Exception; + + List findByUserId(PageData condition) throws Exception; } diff --git a/src/main/java/com/zcloud/service/xgf/XgfUserService.java b/src/main/java/com/zcloud/service/xgf/XgfUserService.java index 8e0f2c92..3397027c 100644 --- a/src/main/java/com/zcloud/service/xgf/XgfUserService.java +++ b/src/main/java/com/zcloud/service/xgf/XgfUserService.java @@ -22,4 +22,6 @@ public interface XgfUserService { void approve(PageData request) throws Exception; PageData findInfo(PageData condition); + + List findRecordList(PageData condition) throws Exception; } diff --git a/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java index 71758050..0431c093 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java @@ -381,5 +381,10 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { next_flow.put("PARENT_ID",flow.getString("FLOW_DETAIL_ID")); flowDetailMapper.save(next_flow); } + + @Override + public List findByUserId(PageData condition) throws Exception { + return trainingbatchMapper.findByUserId(condition); + } } 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 e25efcb5..93e6543c 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -146,4 +146,9 @@ public class XgfUserServiceImpl implements XgfUserService { public PageData findInfo(PageData condition) { return xgfUserMapper.getInfoById(condition); } + + @Override + public List findRecordList(PageData condition) throws Exception { + return xgfUserMapper.findRecordList(condition); + } } diff --git a/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml b/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml index db1bc1a0..93c694a7 100644 --- a/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml @@ -355,4 +355,20 @@ where f.TRAINING_BATCH_ID = #{TRAINING_BATCH_ID} + diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml index ad1548bc..7f75b3bd 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -268,5 +268,20 @@ and a.XGF_USER_ID = #{XGF_USER_ID} + From e55250245885dfd1da277ac0070395c955220431 Mon Sep 17 00:00:00 2001 From: liujun Date: Thu, 21 Dec 2023 15:15:45 +0800 Subject: [PATCH 11/21] =?UTF-8?q?=E6=9F=A5=E7=9C=8Bbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/datasource/xgf/TrainingBatchMapper.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml b/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml index 93c694a7..8b75a2cb 100644 --- a/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml @@ -236,7 +236,11 @@ From f59d2b05007f564e114a54db4d42d4a15b11e1b0 Mon Sep 17 00:00:00 2001 From: liujun Date: Thu, 21 Dec 2023 16:59:50 +0800 Subject: [PATCH 12/21] =?UTF-8?q?=E6=9F=A5=E7=9C=8Bbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/ApiXgfDepartmentController.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/main/java/com/zcloud/controller/api/ApiXgfDepartmentController.java diff --git a/src/main/java/com/zcloud/controller/api/ApiXgfDepartmentController.java b/src/main/java/com/zcloud/controller/api/ApiXgfDepartmentController.java new file mode 100644 index 00000000..7778e34d --- /dev/null +++ b/src/main/java/com/zcloud/controller/api/ApiXgfDepartmentController.java @@ -0,0 +1,30 @@ +package com.zcloud.controller.api; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.PageData; +import com.zcloud.service.bus.CorpInfoService; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; + +@Controller +@RequestMapping("/openApi/preventCorp") +public class ApiXgfDepartmentController extends BaseController { + + @Resource + private CorpInfoService corpInfoService; + + /** + * 获取所有公司 + */ + @RequestMapping(value = "/getAllPreventionCorp") + @ResponseBody + private PageData getAllPreventionCorp() throws Exception { + PageData response = new PageData(); + response.put("result", "success"); + response.put("data", corpInfoService.listAll(new PageData())); + return response; + } +} From 644ee593984532e2a8bf32558a8f60c8ff8e3974 Mon Sep 17 00:00:00 2001 From: liujun Date: Thu, 21 Dec 2023 19:55:08 +0800 Subject: [PATCH 13/21] =?UTF-8?q?=E6=9F=A5=E7=9C=8Bbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xgf/impl/TrainingBatchServiceImpl.java | 655 +++++++++--------- .../service/xgf/impl/XgfUserServiceImpl.java | 7 +- .../datasource/xgf/XgfUserDetailsMapper.xml | 8 +- .../mybatis/datasource/xgf/XgfUserMapper.xml | 21 +- 4 files changed, 359 insertions(+), 332 deletions(-) diff --git a/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java index 0431c093..1e0e701e 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java @@ -28,363 +28,384 @@ import java.util.stream.Collectors; @Transactional //开启事物 public class TrainingBatchServiceImpl implements TrainingBatchService { - @Resource - private TrainingBatchMapper trainingbatchMapper; + @Resource + private TrainingBatchMapper trainingbatchMapper; - @Resource - private TrainUsersMapper trainUsersMapper; + @Resource + private TrainUsersMapper trainUsersMapper; - @Resource - private XgfUserMapper xgfUserMapper; + @Resource + private XgfUserMapper xgfUserMapper; - @Resource - private FlowMapper flowMapper; + @Resource + private FlowMapper flowMapper; - @Resource - private FlowDetailMapper flowDetailMapper; + @Resource + private FlowDetailMapper flowDetailMapper; - @Resource - private UsersMapper usersMapper; + @Resource + private UsersMapper usersMapper; - @Resource - private DepartmentMapper departmentMapper; + @Resource + private DepartmentMapper departmentMapper; - /**新增 - * @param pd - * @throws Exception - */ - public void save(PageData pd)throws Exception{ - /* 保存主题信息 */ - String batch_id=UuidUtil.get32UUID(); - String train_area=pd.getString("TRAIN_AREA"); - pd.put("TRAINING_BATCH_ID", batch_id); //主键 - pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 - pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 - pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 - pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); - pd.put("ISDELETE", 0); //是否删除 1-是 0-否 + /** + * 新增 + * + * @param pd + * @throws Exception + */ + public void save(PageData pd) throws Exception { + /* 保存主题信息 */ + String batch_id = UuidUtil.get32UUID(); + String train_area = pd.getString("TRAIN_AREA"); + pd.put("TRAINING_BATCH_ID", batch_id); //主键 + pd.put("CREATOR", Jurisdiction.getUsername()); //添加人 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + pd.put("ISDELETE", 0); //是否删除 1-是 0-否 - Calendar calendar = Calendar.getInstance(); - DecimalFormat dft=new DecimalFormat("00"); - int year = calendar.get(Calendar.YEAR); - String month = dft.format(calendar.get(Calendar.MONTH) + 1); - pd.put("CREATDATE",year + "-" + month); - PageData cpd = trainingbatchMapper.getCode(pd); //根据ID读取 - String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString())+1)); - pd.put("BATCH_NAME",code); - /*翻译*/ - PageData condition = new PageData(); - condition.put("USER_ID",pd.get("SUPERVISION_USER_ID")); - PageData supUser = usersMapper.getUserInfo(condition); - pd.put("SUPERVISION_USER_NAME",supUser.get("NAME")); + Calendar calendar = Calendar.getInstance(); + DecimalFormat dft = new DecimalFormat("00"); + int year = calendar.get(Calendar.YEAR); + String month = dft.format(calendar.get(Calendar.MONTH) + 1); + pd.put("CREATDATE", year + "-" + month); + PageData cpd = trainingbatchMapper.getCode(pd); //根据ID读取 + String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString()) + 1)); + pd.put("BATCH_NAME", code); + /*翻译*/ + PageData condition = new PageData(); + condition.put("USER_ID", pd.get("SUPERVISION_USER_ID")); + PageData supUser = usersMapper.getUserInfo(condition); + pd.put("SUPERVISION_USER_NAME", supUser.get("NAME")); - condition.clear(); - condition.put("DEPARTMENT_ID",pd.get("SUPERVISION")); - PageData supDepartment = departmentMapper.getInfo(condition); - pd.put("SUPERVISION_DEPARTMENT_NAME",supDepartment.get("NAME")); + condition.clear(); + condition.put("DEPARTMENT_ID", pd.get("SUPERVISION")); + PageData supDepartment = departmentMapper.getInfo(condition); + pd.put("SUPERVISION_DEPARTMENT_NAME", supDepartment.get("NAME")); - condition.clear(); - condition.put("USER_ID",pd.get("MANAGER_USER_ID")); - PageData manUser = usersMapper.getUserInfo(condition); - pd.put("MANAGER_USER_NAME",manUser.get("NAME")); + condition.clear(); + condition.put("USER_ID", pd.get("MANAGER_USER_ID")); + PageData manUser = usersMapper.getUserInfo(condition); + pd.put("MANAGER_USER_NAME", manUser.get("NAME")); - condition.clear(); - condition.put("DEPARTMENT_ID",pd.get("MANAGER")); - PageData manDepartment = departmentMapper.getInfo(condition); - pd.put("MANAGER_DEPARTMENT_NAME",manDepartment.get("NAME")); + condition.clear(); + condition.put("DEPARTMENT_ID", pd.get("MANAGER")); + PageData manDepartment = departmentMapper.getInfo(condition); + pd.put("MANAGER_DEPARTMENT_NAME", manDepartment.get("NAME")); - condition.clear(); - condition.put("USER_ID",pd.get("TERRITORIALITY_USER_ID")); - PageData terUser = usersMapper.getUserInfo(condition); - pd.put("TERRITORIALITY_USER_NAME",terUser.get("NAME")); + // 2023-12-21 相关方功能限制,暂时移除集团单位审批节点 created by sparrow + if (StringUtils.isNotEmpty(pd.getString("TERRITORIALITY_USER_ID"))) { + condition.clear(); + condition.put("USER_ID", pd.get("TERRITORIALITY_USER_ID")); + PageData terUser = usersMapper.getUserInfo(condition); + pd.put("TERRITORIALITY_USER_NAME", terUser == null ? "" : terUser.get("NAME")); - condition.clear(); - condition.put("DEPARTMENT_ID",pd.get("TERRITORIALITY")); - PageData terDepartment = departmentMapper.getInfo(condition); - pd.put("TERRITORIALITY_DEPARTMENT_NAME",terDepartment.get("NAME")); - pd.put("IS_DELETE","0"); - pd.put("STEP_STATUS","0"); - trainingbatchMapper.save(pd); + condition.clear(); + condition.put("DEPARTMENT_ID", pd.get("TERRITORIALITY")); + PageData terDepartment = departmentMapper.getInfo(condition); + pd.put("TERRITORIALITY_DEPARTMENT_NAME", terDepartment == null ? "" : terDepartment.get("NAME")); + } - String arrayDATA_ids[] = pd.getString("users").split(","); - Arrays.asList(arrayDATA_ids).forEach(id -> { - PageData user = new PageData(); - user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); - user.put("TRAINING_BATCH_ID", batch_id); - user.put("USER_ID", id); - user.put("TRAIN_AREA", train_area); - user.put("STATUS", 0); - user.put("SUPERVISION_STATE", 9); - user.put("MANAGER_STATE", 9); - user.put("TERRITORIALITY_STATE", 9); - user.put("STEP_STATUS", "0"); - user.put("BELONG_TO_CORP",pd.get("BELONG_TO_CORP")); - user.put("BELONG_TO_CORP_NAME",pd.get("BELONG_TO_CORP_NAME")); - user.put("IS_DELETE", "0"); - user.put("RESULT_STATUS","1"); - trainUsersMapper.save(user); - condition.clear(); - condition.put("XGF_USER_ID",id); - PageData userEntity = xgfUserMapper.findById(condition); - userEntity.put("STATUS","3"); - userEntity.put("STUDY_STATUS","9"); - xgfUserMapper.edit(userEntity); - }); + pd.put("IS_DELETE", "0"); + pd.put("STEP_STATUS", "1"); + trainingbatchMapper.save(pd); - /* 保存审批流程信息 */ - PageData flow = new PageData(); - flow.put("FLOW_ID", Warden.get32UUID()); - flow.put("TYPE", "0"); - flow.put("CREATOR",Jurisdiction.getUSER_ID()); - flow.put("CREATOR_NAME",Jurisdiction.getName()); - flow.put("CREATOR_TIME", DateUtil.getTime()); - flow.put("VALID_FLAG", "1"); - flow.put("FOREIGN_KEY",pd.getString("TRAINING_BATCH_ID")); - flow.put("ISDELETE", "0"); - flowMapper.save(flow); - /* 保存审批流程明细信息 */ - PageData flowDetail = new PageData(); - flowDetail.put("FLOW_DETAIL_ID", Warden.get32UUID()); - flowDetail.put("FLOW_ID", flow.getString("FLOW_ID")); - flowDetail.put("STEP_FLAG", "1"); - flowDetail.put("SORT",0); - flowDetail.put("APPROVER_ID",Jurisdiction.getUSER_ID()); - flowDetail.put("APPROVER_NAME",Jurisdiction.getName()); - flowDetail.put("APPROVER_TIME", DateUtil.getTime()); - flowDetail.put("APPROVER_CORPINFO_ID",Jurisdiction.getCORPINFO_ID()); - // TODO 未完成 - flowDetail.put("APPROVER_CORPINFO_NAME",""); - flowDetail.put("PASS_FLAG", "1"); - flowDetail.put("END_FLAG", "0"); - flowDetail.put("ISDELETE", "0"); - flowDetail.put("PARENT_ID","0"); - flowDetailMapper.save(flowDetail); - } + String arrayDATA_ids[] = pd.getString("users").split(","); + Arrays.asList(arrayDATA_ids).forEach(id -> { + PageData user = new PageData(); + user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); + user.put("TRAINING_BATCH_ID", batch_id); + user.put("USER_ID", id); + user.put("TRAIN_AREA", train_area); + user.put("STATUS", 0); + user.put("SUPERVISION_STATE", 9); + user.put("MANAGER_STATE", 9); + user.put("TERRITORIALITY_STATE", 9); + user.put("STEP_STATUS", "1"); + user.put("BELONG_TO_CORP", pd.get("BELONG_TO_CORP")); + user.put("BELONG_TO_CORP_NAME", pd.get("BELONG_TO_CORP_NAME")); + user.put("IS_DELETE", "0"); + user.put("RESULT_STATUS", "1"); + trainUsersMapper.save(user); + condition.clear(); + condition.put("XGF_USER_ID", id); + PageData userEntity = xgfUserMapper.findById(condition); + userEntity.put("STATUS", "3"); + userEntity.put("STUDY_STATUS", "9"); + xgfUserMapper.edit(userEntity); + }); - /**固定人员培训 - * @param pd - * @throws Exception - */ - public void unflowTrain(PageData pd)throws Exception{ - PageData trainBatch = new PageData(); - String batch_id = UuidUtil.get32UUID(); - trainBatch.put("TRAINING_BATCH_ID", batch_id); //主键 - trainBatch.put("CREATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //添加人 - trainBatch.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 - trainBatch.put("OPERATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //修改人 - trainBatch.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 - trainBatch.put("ISDELETE", 0); //是否删除 1-是 0-否 - trainBatch.put("TYPE", 1); - trainBatch.put("USER_COUNT", pd.getString("USER_COUNT")); - trainBatch.put("AUDIT_STATUS", 0); - trainBatch.put("TRAIN_CORP_DEPT", pd.getString("TRAIN_CORP_DEPT")); - trainBatch.put("TRAIN_CORP_LEADER", pd.getString("TRAIN_CORP_LEADER")); + /* 保存审批流程信息 */ + PageData flow = new PageData(); + flow.put("FLOW_ID", Warden.get32UUID()); + flow.put("TYPE", "0"); + flow.put("CREATOR", Jurisdiction.getUSER_ID()); + flow.put("CREATOR_NAME", Jurisdiction.getName()); + flow.put("CREATOR_TIME", DateUtil.getTime()); + flow.put("VALID_FLAG", "1"); + flow.put("FOREIGN_KEY", pd.getString("TRAINING_BATCH_ID")); + flow.put("ISDELETE", "0"); + flowMapper.save(flow); + /* 保存审批流程明细信息 */ + PageData flowDetail = new PageData(); + flowDetail.put("FLOW_DETAIL_ID", Warden.get32UUID()); + flowDetail.put("FLOW_ID", flow.getString("FLOW_ID")); + flowDetail.put("STEP_FLAG", "1"); + flowDetail.put("SORT", 0); + flowDetail.put("APPROVER_ID", Jurisdiction.getUSER_ID()); + flowDetail.put("APPROVER_NAME", Jurisdiction.getName()); + flowDetail.put("APPROVER_TIME", DateUtil.getTime()); + flowDetail.put("APPROVER_CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); + // TODO 未完成 + flowDetail.put("APPROVER_CORPINFO_NAME", ""); + flowDetail.put("PASS_FLAG", "1"); + flowDetail.put("END_FLAG", "0"); + flowDetail.put("ISDELETE", "0"); + flowDetail.put("PARENT_ID", "0"); + flowDetailMapper.save(flowDetail); + } - Calendar calendar = Calendar.getInstance(); - DecimalFormat dft = new DecimalFormat("00"); - int year = calendar.get(Calendar.YEAR); - String month = dft.format(calendar.get(Calendar.MONTH) + 1); - trainBatch.put("CREATDATE", year + "-" + month); - PageData cpd = trainingbatchMapper.getCode(trainBatch); //根据ID读取 - String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString()) + 1)); - trainBatch.put("BATCH_NAME", code); + /** + * 固定人员培训 + * + * @param pd + * @throws Exception + */ + public void unflowTrain(PageData pd) throws Exception { + PageData trainBatch = new PageData(); + String batch_id = UuidUtil.get32UUID(); + trainBatch.put("TRAINING_BATCH_ID", batch_id); //主键 + trainBatch.put("CREATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //添加人 + trainBatch.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间 + trainBatch.put("OPERATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //修改人 + trainBatch.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间 + trainBatch.put("ISDELETE", 0); //是否删除 1-是 0-否 + trainBatch.put("TYPE", 1); + trainBatch.put("USER_COUNT", pd.getString("USER_COUNT")); + trainBatch.put("AUDIT_STATUS", 0); + trainBatch.put("TRAIN_CORP_DEPT", pd.getString("TRAIN_CORP_DEPT")); + trainBatch.put("TRAIN_CORP_LEADER", pd.getString("TRAIN_CORP_LEADER")); - trainingbatchMapper.save(trainBatch); - trainBatch.put("AUDIT_STATUS", "2"); - this.audit(trainBatch); + Calendar calendar = Calendar.getInstance(); + DecimalFormat dft = new DecimalFormat("00"); + int year = calendar.get(Calendar.YEAR); + String month = dft.format(calendar.get(Calendar.MONTH) + 1); + trainBatch.put("CREATDATE", year + "-" + month); + PageData cpd = trainingbatchMapper.getCode(trainBatch); //根据ID读取 + String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString()) + 1)); + trainBatch.put("BATCH_NAME", code); - String arrayDATA_IDS[] = pd.getString("users").split(","); - Arrays.asList(arrayDATA_IDS).forEach(id -> { - PageData user = new PageData(); - user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); - user.put("TRAINING_BATCH_ID", batch_id); - user.put("USER_ID", id); - user.put("TRAIN_CORPINFO_ID", pd.getString("FIRST_PARTY_ID")); - user.put("STATUS", 1); - user.put("START_DATE", DateUtil.date2Str(new Date())); - user.put("SUPERVISION_STATE", 9); - user.put("MANAGER_STATE", 9); - user.put("TERRITORIALITY_STATE", 9); - user.put("STEP_STATUS", "0"); - trainUsersMapper.save(user); - }); - xgfUserMapper.bantchUpdateStatus(1,arrayDATA_IDS); + trainingbatchMapper.save(trainBatch); + trainBatch.put("AUDIT_STATUS", "2"); + this.audit(trainBatch); - } + String arrayDATA_IDS[] = pd.getString("users").split(","); + Arrays.asList(arrayDATA_IDS).forEach(id -> { + PageData user = new PageData(); + user.put("TRAIN_USERS_ID", UuidUtil.get32UUID()); + user.put("TRAINING_BATCH_ID", batch_id); + user.put("USER_ID", id); + user.put("TRAIN_CORPINFO_ID", pd.getString("FIRST_PARTY_ID")); + user.put("STATUS", 1); + user.put("START_DATE", DateUtil.date2Str(new Date())); + user.put("SUPERVISION_STATE", 9); + user.put("MANAGER_STATE", 9); + user.put("TERRITORIALITY_STATE", 9); + user.put("STEP_STATUS", "0"); + trainUsersMapper.save(user); + }); + xgfUserMapper.bantchUpdateStatus(1, arrayDATA_IDS); - /**删除 - * @param pd - * @throws Exception - */ - public void delete(PageData pd)throws Exception{ - trainingbatchMapper.delete(pd); - } + } - /**修改 - * @param pd - * @throws Exception - */ - public void edit(PageData pd)throws Exception{ - trainingbatchMapper.edit(pd); - } + /** + * 删除 + * + * @param pd + * @throws Exception + */ + public void delete(PageData pd) throws Exception { + trainingbatchMapper.delete(pd); + } - public void audit(PageData pd)throws Exception{ - if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == -1){ - pd.put("STATUS",0); - pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); - xgfUserMapper.updateStatusByFlowTrain(pd); - trainingbatchMapper.audit(pd); - }else if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == 2){ - pd.put("STATUS",1); - pd.put("START_DATE",DateUtil.date2Str(new Date())); - pd.put("AUDIT_TIME", DateUtil.date2Str(new Date())); - xgfUserMapper.updateStatusByFlowTrain(pd); - trainUsersMapper.updateStatusByFlowTrain(pd); - trainingbatchMapper.audit(pd); - }else if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == 3){ - pd.put("STATUS",2); - pd.put("END_DATE",DateUtil.date2Str(new Date())); - pd.put("VERIFY_TIME",DateUtil.date2Str(new Date())); - xgfUserMapper.updateStatusByFlowTrain(pd); - trainUsersMapper.updateStatusByFlowTrain(pd); - trainingbatchMapper.audit(pd); - }else{ - pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); - trainingbatchMapper.audit(pd); - } - } + /** + * 修改 + * + * @param pd + * @throws Exception + */ + public void edit(PageData pd) throws Exception { + trainingbatchMapper.edit(pd); + } - /**列表 - * @param page - * @throws Exception - */ - public List list(Page page)throws Exception{ - return trainingbatchMapper.datalistPage(page); - } + public void audit(PageData pd) throws Exception { + if (Integer.parseInt(pd.getString("AUDIT_STATUS")) == -1) { + pd.put("STATUS", 0); + pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); + xgfUserMapper.updateStatusByFlowTrain(pd); + trainingbatchMapper.audit(pd); + } else if (Integer.parseInt(pd.getString("AUDIT_STATUS")) == 2) { + pd.put("STATUS", 1); + pd.put("START_DATE", DateUtil.date2Str(new Date())); + pd.put("AUDIT_TIME", DateUtil.date2Str(new Date())); + xgfUserMapper.updateStatusByFlowTrain(pd); + trainUsersMapper.updateStatusByFlowTrain(pd); + trainingbatchMapper.audit(pd); + } else if (Integer.parseInt(pd.getString("AUDIT_STATUS")) == 3) { + pd.put("STATUS", 2); + pd.put("END_DATE", DateUtil.date2Str(new Date())); + pd.put("VERIFY_TIME", DateUtil.date2Str(new Date())); + xgfUserMapper.updateStatusByFlowTrain(pd); + trainUsersMapper.updateStatusByFlowTrain(pd); + trainingbatchMapper.audit(pd); + } else { + pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date())); + trainingbatchMapper.audit(pd); + } + } - /**列表(全部) - * @param pd - * @throws Exception - */ - public List listAll(PageData pd)throws Exception{ - return trainingbatchMapper.listAll(pd); - } + /** + * 列表 + * + * @param page + * @throws Exception + */ + public List list(Page page) throws Exception { + return trainingbatchMapper.datalistPage(page); + } - /**通过id获取数据 - * @param pd - * @throws Exception - */ - public PageData findById(PageData pd)throws Exception{ - return trainingbatchMapper.findById(pd); - } + /** + * 列表(全部) + * + * @param pd + * @throws Exception + */ + public List listAll(PageData pd) throws Exception { + return trainingbatchMapper.listAll(pd); + } - /**批量删除 - * @param ArrayDATA_IDS - * @throws Exception - */ - public void deleteAll(String[] ArrayDATA_IDS)throws Exception{ - trainingbatchMapper.deleteAll(ArrayDATA_IDS); - } + /** + * 通过id获取数据 + * + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd) throws Exception { + return trainingbatchMapper.findById(pd); + } - /** - * 获取编号 - * @param pd - * @return - */ - @Override - public PageData getCode(PageData pd) throws Exception{ - return trainingbatchMapper.getCode(pd); - } + /** + * 批量删除 + * + * @param ArrayDATA_IDS + * @throws Exception + */ + public void deleteAll(String[] ArrayDATA_IDS) throws Exception { + trainingbatchMapper.deleteAll(ArrayDATA_IDS); + } - public List batchUserlistPage(Page page)throws Exception{ - return trainingbatchMapper.batchUserlistPage(page); - } + /** + * 获取编号 + * + * @param pd + * @return + */ + @Override + public PageData getCode(PageData pd) throws Exception { + return trainingbatchMapper.getCode(pd); + } - @Override - public List passUserlistPage(Page page) throws Exception { - return trainingbatchMapper.passUserlistPage(page); - } + public List batchUserlistPage(Page page) throws Exception { + return trainingbatchMapper.batchUserlistPage(page); + } - @Override - public void graduation(PageData condition) { - trainingbatchMapper.graduation(condition); - xgfUserMapper.graduation(condition); - } + @Override + public List passUserlistPage(Page page) throws Exception { + return trainingbatchMapper.passUserlistPage(page); + } - @Override - public void openClass(PageData info) { - List list = Warden.getList(info.getString("list")); - PageData condition = new PageData(); - condition.put("STATUS",info.getString("userStatus")); - condition.put("list", list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("USER_ID")).collect(Collectors.toList())); - xgfUserMapper.graduation(condition); + @Override + public void graduation(PageData condition) { + trainingbatchMapper.graduation(condition); + xgfUserMapper.graduation(condition); + } - condition.clear(); - condition.put("STATUS",info.getString("detailsStatus")); - condition.put("list",list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); - trainUsersMapper.graduation(condition); + @Override + public void openClass(PageData info) { + List list = Warden.getList(info.getString("list")); + PageData condition = new PageData(); + condition.put("STATUS", info.getString("userStatus")); + condition.put("list", list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("USER_ID")).collect(Collectors.toList())); + xgfUserMapper.graduation(condition); - } + condition.clear(); + condition.put("STATUS", info.getString("detailsStatus")); + condition.put("list", list.stream().filter(n -> "1".equals(n.getString("STATUS"))).map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); + trainUsersMapper.graduation(condition); - @Override - public void openStudentClass(PageData info) { + } + + @Override + public void openStudentClass(PageData info) { // List list = Warden.getList(info.getString("list")); - PageData condition = new PageData(); - condition.put("STATUS",info.getString("userStatus")); - condition.put("USER_ID", info.getString("USER_ID")); - xgfUserMapper.graduationstudent(condition); + PageData condition = new PageData(); + condition.put("STATUS", info.getString("userStatus")); + condition.put("USER_ID", info.getString("USER_ID")); + xgfUserMapper.graduationstudent(condition); - condition.clear(); - condition.put("STATUS",info.getString("detailsStatus")); - condition.put("TRAIN_USERS_ID", info.getString("TRAIN_USERS_ID")); - trainUsersMapper.graduationstudent(condition); + condition.clear(); + condition.put("STATUS", info.getString("detailsStatus")); + condition.put("TRAIN_USERS_ID", info.getString("TRAIN_USERS_ID")); + trainUsersMapper.graduationstudent(condition); - } + } - @Override - public void updateClassMessage(PageData info) { - List list = Warden.getList(info.getString("list")); - PageData condition = new PageData(); - condition.put("list", list.stream().map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); - if (StringUtils.isNotEmpty(info.getString("START_DATE"))){ - condition.put("START_DATE",DateUtil.getTime()); - } - if (StringUtils.isNotEmpty(info.getString("END_DATE"))){ - condition.put("END_DATE",DateUtil.getTime()); - } - trainUsersMapper.updateDate(condition); - } + @Override + public void updateClassMessage(PageData info) { + List list = Warden.getList(info.getString("list")); + PageData condition = new PageData(); + condition.put("list", list.stream().map(n -> n.getString("TRAIN_USERS_ID")).collect(Collectors.toList())); + if (StringUtils.isNotEmpty(info.getString("START_DATE"))) { + condition.put("START_DATE", DateUtil.getTime()); + } + if (StringUtils.isNotEmpty(info.getString("END_DATE"))) { + condition.put("END_DATE", DateUtil.getTime()); + } + trainUsersMapper.updateDate(condition); + } - @Override - public void saveFlow(PageData request) throws Exception { - /* 保存审批流程明细信息 */ - PageData condition = new PageData(); - condition.put("FLOW_ID", request.getString("FLOW_ID")); - condition.put("STEP_FLAG", "1"); - PageData flow = flowDetailMapper.selectOne(condition); - flow.put("STEP_FLAG", "0"); - flowDetailMapper.edit(flow); - PageData next_flow = new PageData(); - next_flow.put("FLOW_DETAIL_ID", Warden.get32UUID()); - next_flow.put("FLOW_ID", flow.getString("FLOW_ID")); - next_flow.put("STEP_FLAG", "1"); - next_flow.put("SORT",(Integer)flow.get("SORT")+1); - next_flow.put("APPROVER_ID",request.get("APPROVER_ID")); - next_flow.put("APPROVER_NAME",request.get("APPROVER_NAME")); - next_flow.put("APPROVER_TIME", DateUtil.getTime()); - next_flow.put("APPROVER_CORPINFO_ID",request.get("APPROVER_CORPINFO_ID")); - next_flow.put("APPROVER_CORPINFO_NAME",request.get("APPROVER_CORPINFO_NAME")); - next_flow.put("PASS_FLAG", "1"); - next_flow.put("END_FLAG", "0"); - next_flow.put("ISDELETE", "0"); - next_flow.put("PARENT_ID",flow.getString("FLOW_DETAIL_ID")); - flowDetailMapper.save(next_flow); - } + @Override + public void saveFlow(PageData request) throws Exception { + /* 保存审批流程明细信息 */ + PageData condition = new PageData(); + condition.put("FLOW_ID", request.getString("FLOW_ID")); + condition.put("STEP_FLAG", "1"); + PageData flow = flowDetailMapper.selectOne(condition); + flow.put("STEP_FLAG", "0"); + flowDetailMapper.edit(flow); + PageData next_flow = new PageData(); + next_flow.put("FLOW_DETAIL_ID", Warden.get32UUID()); + next_flow.put("FLOW_ID", flow.getString("FLOW_ID")); + next_flow.put("STEP_FLAG", "1"); + next_flow.put("SORT", (Integer) flow.get("SORT") + 1); + next_flow.put("APPROVER_ID", request.get("APPROVER_ID")); + next_flow.put("APPROVER_NAME", request.get("APPROVER_NAME")); + next_flow.put("APPROVER_TIME", DateUtil.getTime()); + next_flow.put("APPROVER_CORPINFO_ID", request.get("APPROVER_CORPINFO_ID")); + next_flow.put("APPROVER_CORPINFO_NAME", request.get("APPROVER_CORPINFO_NAME")); + next_flow.put("PASS_FLAG", "1"); + next_flow.put("END_FLAG", "0"); + next_flow.put("ISDELETE", "0"); + next_flow.put("PARENT_ID", flow.getString("FLOW_DETAIL_ID")); + flowDetailMapper.save(next_flow); + } - @Override - public List findByUserId(PageData condition) throws Exception { - return trainingbatchMapper.findByUserId(condition); - } + @Override + public List findByUserId(PageData condition) throws Exception { + return trainingbatchMapper.findByUserId(condition); + } } 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 93e6543c..17de5f5d 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -61,11 +61,13 @@ public class XgfUserServiceImpl implements XgfUserService { 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("XGF_USER_NAME", x.get("NAME")); x.put("VALID_FLAG", "1"); x.put("STATUS", "2"); x.put("CREATED_TIME", DateUtil.getTime()); x.put("OPERATOR_TIME", DateUtil.getTime()); + x.put("IS_DELETE", "0"); + x.put("CREATE_TIME", DateUtil.getTime()); condition.clear(); condition.put("DEPARTMENT_ID",x.get("MANAGER_DEPARTMENT_ID")); PageData regDepartmentEntity = departmentService.getCorpDepartment(condition); @@ -75,7 +77,8 @@ public class XgfUserServiceImpl implements XgfUserService { } 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("IS_DELETE", "0"); + x.put("CREATE_TIME", DateUtil.getTime()); x.put("OPERATOR_TIME", DateUtil.getTime()); condition.clear(); condition.put("DEPARTMENT_ID",x.get("MANAGER_DEPARTMENT_ID")); diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml index 409d2f14..2a3ed948 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml @@ -15,7 +15,7 @@ f.BELONG_TO_CORP, f.BELONG_TO_CORP_NAME, f.PHONE, - f.CREAT_TIME, + f.CREATE_TIME, f.DEPART_STATE, f.ISDELETE, f.AGE, @@ -69,7 +69,7 @@ BELONG_TO_CORP, BELONG_TO_CORP_NAME, PHONE, - CREAT_TIME, + CREATE_TIME, DEPART_STATE, ISDELETE, AGE, @@ -124,7 +124,7 @@ #{BELONG_TO_CORP}, #{BELONG_TO_CORP_NAME}, #{PHONE}, - #{CREAT_TIME}, + #{CREATE_TIME}, #{DEPART_STATE}, #{ISDELETE}, #{AGE}, @@ -203,7 +203,7 @@ BELONG_TO_CORP = #{BELONG_TO_CORP}, BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME}, PHONE = #{PHONE}, - CREAT_TIME = #{CREAT_TIME}, + CREATE_TIME = #{CREATE_TIME}, DEPART_STATE = #{DEPART_STATE}, ISDELETE = #{ISDELETE}, AGE = #{AGE}, diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml index 7f75b3bd..53ccf893 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -15,8 +15,8 @@ f.VALID_FLAG, f.BELONG_TO_CORP, f.BELONG_TO_CORP_NAME, - f.ISDELETE, - f.CREATED_TIME, + f.IS_DELETE, + f.CREATE_TIME, f.CORPINFO_ID, f.STATUS, f.OPERATOR_TIME, @@ -32,8 +32,8 @@ VALID_FLAG, BELONG_TO_CORP, BELONG_TO_CORP_NAME, - ISDELETE, - CREATED_TIME, + IS_DELETE, + CREATE_TIME, CORPINFO_ID, STATUS, OPERATOR_TIME, @@ -49,8 +49,8 @@ #{VALID_FLAG}, #{BELONG_TO_CORP}, #{BELONG_TO_CORP_NAME}, - #{ISDELETE}, - #{CREATED_TIME}, + #{IS_DELETE}, + #{CREATE_TIME}, #{CORPINFO_ID}, #{STATUS}, #{OPERATOR_TIME}, @@ -90,7 +90,7 @@ BELONG_TO_CORP = #{BELONG_TO_CORP}, BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME}, ISDELETE = #{ISDELETE}, - CREATED_TIME = #{CREATED_TIME}, + CREATE_TIME = #{CREATE_TIME}, CORPINFO_ID = #{CORPINFO_ID}, STATUS = #{STATUS}, OPERATOR_TIME = #{OPERATOR_TIME}, @@ -155,7 +155,7 @@ and(f.BELONG_TO_CORP_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')) - ORDER BY f.CREATED_TIME DESC + ORDER BY f.CREATE_TIME DESC @@ -204,6 +204,9 @@ and a.STATUS = #{pd.STATUS} + + and a.STUDY_STATUS != #{pd.UN_STUDY_STATUS} + @@ -174,7 +174,7 @@ update set - ISDELETE = '1', + IS_DELETE = '1', OPERATOR = #{OPERATOR}, OPERATTIME = #{OPERATTIME} where @@ -191,23 +191,30 @@ from f - where f.ISDELETE = '0' - and XGF_USER_ID in + where f.IS_DELETE = '0' + and f.XGF_USER_ID in #{item} + + and a.STUDY_STATUS = #{pd.STUDY_STATUS} + + + and a.CORPINFO_ID = #{pd.CORPINFO_ID} + + @@ -310,7 +310,7 @@ update set - ISDELETE = '1', + IS_DELETE = '1', OPERATOR = #{OPERATOR}, OPERATTIME = #{OPERATTIME} where @@ -327,7 +327,7 @@ from f - where f.ISDELETE = '0' + where f.IS_DELETE = '0' and XFG_USER_DETAILS_ID in #{item} diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml index 9196bc81..6af23e20 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -210,7 +210,7 @@ from xgf_user a left join xgf_user_details b on a.XGF_USER_ID = b.XGF_USER_ID - where 1=1 + where a.IS_DELETE = '0' and a.STATUS = #{pd.STATUS} @@ -302,7 +302,7 @@ left join `qa-gwj-regulatory`.bus_class_message rcm on rf.CLASS_MESSAGE_ID = rcm.CLASS_MESSAGE_ID left join sys_dictionaries sdp on sdp.DICTIONARIES_ID = rcm.PLACE left join sys_dictionaries sdt on sdt.DICTIONARIES_ID = rcm.TRAINING_TYPE - where rf.USER_ID = #{USER_ID} + where rf.USER_ID = #{USER_ID} and rf.ISDELETE = '0' order by rf.CREATE_TIME desc From 4f60d4f571b91b94fdb509b10c2ba24c22c11e01 Mon Sep 17 00:00:00 2001 From: liujun Date: Mon, 25 Dec 2023 14:45:17 +0800 Subject: [PATCH 19/21] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=A4=9A=E9=80=89bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 980c1801..321cdddb 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -164,6 +164,7 @@ public class XgfUserServiceImpl implements XgfUserService { entity.put("STATUS", "0"); } else { entity.put("STATUS", "2"); + entity.put("VALID_FLAG", "1"); } xgfUserMapper.edit(entity); From 797a8c0586a19953b58f17ed9c347a2ce3f9c235 Mon Sep 17 00:00:00 2001 From: liujun Date: Mon, 25 Dec 2023 18:17:09 +0800 Subject: [PATCH 20/21] =?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/xgf/FlowTrainController.java | 16 ++++++++++++++++ .../datasource/xgf/TrainingBatchMapper.java | 2 ++ .../zcloud/service/xgf/TrainingBatchService.java | 2 ++ .../xgf/impl/TrainingBatchServiceImpl.java | 5 +++++ src/main/resources/application.properties | 6 +++--- .../datasource/xgf/TrainingBatchMapper.xml | 7 +++++++ 6 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java b/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java index 47df2e56..353793ec 100644 --- a/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java +++ b/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java @@ -148,4 +148,20 @@ public class FlowTrainController extends BaseController { map.put("result", "success"); return map; } + + @RequestMapping(value = "/oldBatchList") + @ResponseBody + public Object oldBatchList(Page page) throws Exception { + 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.oldBatchList(page); //列出TrainingBatch列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", "success"); + return map; + } } diff --git a/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java b/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java index e25807f2..76fdf346 100644 --- a/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java @@ -76,5 +76,7 @@ public interface TrainingBatchMapper{ void graduation(PageData condition); List findByUserId(PageData condition); + + List oldlistPage(Page page); } diff --git a/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java b/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java index 1218f53d..5dff54a4 100644 --- a/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java +++ b/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java @@ -89,5 +89,7 @@ public interface TrainingBatchService{ void saveFlow(PageData request) throws Exception; List findByUserId(PageData condition) throws Exception; + + List oldBatchList(Page page) throws Exception; } diff --git a/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java index 1e0e701e..773f317e 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java @@ -407,5 +407,10 @@ public class TrainingBatchServiceImpl implements TrainingBatchService { public List findByUserId(PageData condition) throws Exception { return trainingbatchMapper.findByUserId(condition); } + + @Override + public List oldBatchList(Page page) throws Exception { + return trainingbatchMapper.oldlistPage(page); + } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a48eb064..ea7feb10 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -2,9 +2,9 @@ spring.application.name=qa-prevention-gwj server.port=8091 #?? -#spring.profiles.active=local -#31ʱʹ -spring.profiles.active=dev +spring.profiles.active=local +#����31ʱʹ�� +#spring.profiles.active=dev #?? #spring.profiles.active=master diff --git a/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml b/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml index 4f8b7672..c6175178 100644 --- a/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml @@ -280,6 +280,7 @@ a.TRAIN_USERS_ID, a.STEP_STATUS, a.USER_ID, + a.USER_ID as XGF_USER_ID, a.SUPERVISION_STATE, a.MANAGER_STATE, a.TERRITORIALITY_STATE, @@ -378,4 +379,10 @@ and USER_ID = #{USER_ID} order by b.CREATTIME desc; + From e1cd46b49308010c59d194c11bb7c23c37c88dc1 Mon Sep 17 00:00:00 2001 From: liujun Date: Tue, 26 Dec 2023 12:35:28 +0800 Subject: [PATCH 21/21] =?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 --- .../zcloud/service/xgf/impl/XgfUserServiceImpl.java | 12 +++++++++++- src/main/resources/application-local.properties | 6 +++--- .../mybatis/datasource/xgf/XgfUserMapper.xml | 3 +++ 3 files changed, 17 insertions(+), 4 deletions(-) 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 321cdddb..169722b4 100644 --- a/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -2,6 +2,7 @@ package com.zcloud.service.xgf.impl; import com.zcloud.entity.Page; import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.xgf.TrainUsersMapper; import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper; import com.zcloud.mapper.datasource.xgf.XgfUserMapper; import com.zcloud.service.bus.CorpInfoService; @@ -28,6 +29,9 @@ public class XgfUserServiceImpl implements XgfUserService { @Resource private XgfUserDetailsMapper xgfUserDetailsMapper; + @Resource + private TrainUsersMapper trainUsersMapper; + @Resource private DepartmentService departmentService; @@ -107,10 +111,16 @@ public class XgfUserServiceImpl implements XgfUserService { if (regDepartmentEntity.size() > 0) { x.put("MAIN_DEPARTMENT_NAME", regDepartmentEntity.get("NAME")); } - x.put("IS_DELETE", "0"); x.put("VALID_FLAG", "1"); x.put("STATUS", "2"); + if ("2".equals(x.getString("STUDY_STATUS"))) { + x.put("STUDY_STATUS", "2"); + }else { + x.put("STUDY_STATUS", entity.getString("STUDY_STATUS")); + } + x.put("STUDY_STATUS",entity.getString("STUDY_STATUS")); + xgfUserMapper.edit(x); xgfUserDetailsMapper.edit(x); } diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 8d8cc1c0..1b26fc67 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -65,11 +65,11 @@ preventionxgf.api.url=http://192.168.0.79:8088/ qa-regulatory-gwj.api.url=http://192.168.0.79:8092/ #????? -smb.host=39.103.224.166 +smb.host=192.168.192.201 smb.port=22 smb.user=root -smb.password=Zcloud@zcloud88888 -smb.basePath=/mnt/qgfile/file/ +smb.password=SJSKAQHBGLXT@20220311 +smb.basePath=/mnt/qask/file/ #Mq\u914D\u7F6E rocketmq.consumer.group2=edu-admin-edit diff --git a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml index 6af23e20..ddbff968 100644 --- a/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -226,6 +226,9 @@ and (a.USERNAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')) + + and a.VALID_FLAG = #{pd.VALID_FLAG} +