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; + } +} 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..539d0b03 --- /dev/null +++ b/src/main/java/com/zcloud/controller/api/ApiXgfUserController.java @@ -0,0 +1,56 @@ +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(); + xgfUserService.init(request); + Map response = new HashMap(); + response.put("result", "success"); + return response; + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException("系统异常"); + } + } + + @RequestMapping(value = "/approvalApplication") + @ResponseBody + public Object approvalApplication() throws Exception { + Map response = new HashMap(); + try { + PageData request = this.getPageData(); + xgfUserService.approvalApplication(request); + response.put("result", "success"); + response.put("code","0"); + return response; + } catch (Exception e) { + e.printStackTrace(); + response.put("result", "error"); + response.put("code","9999"); + response.put("msg", e.getMessage()); + return response; + } + } +} 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/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 1b92751a..098ad1d2 100644 --- a/src/main/java/com/zcloud/controller/system/UsersController.java +++ b/src/main/java/com/zcloud/controller/system/UsersController.java @@ -2400,5 +2400,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..353793ec 100644 --- a/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java +++ b/src/main/java/com/zcloud/controller/xgf/FlowTrainController.java @@ -3,15 +3,18 @@ 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.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; import org.springframework.web.bind.annotation.ResponseBody; +import javax.annotation.Resource; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -25,47 +28,68 @@ public class FlowTrainController extends BaseController { @Value("${preventionxgf.api.url}") private String xgfUrl; - @RequestMapping(value="/batchList") + @Resource + private TrainingBatchService trainingbatchService; + + @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()); + 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") + @ResponseBody + 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(); - pd.put("MAndTUserId",Jurisdiction.getUSER_ID()); - Map result = HttpClientService.doPost(xgfUrl + "/openApi/trainingbatch/list" +getPageUrl(page), pd); + Map result = HttpClientService.doPost(xgfUrl + "/openApi/trainingbatch/audit", pd); return result; } - @RequestMapping(value="/batchUserList") - @ResponseBody - public Object batchUserList(Page page) throws Exception{ - PageData pd = new PageData(); - pd = this.getPageData(); - Map result = HttpClientService.doPost(xgfUrl + "/openApi/trainingbatch/batchUserList" +getPageUrl(page), 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(); @@ -73,24 +97,71 @@ 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; + } + + @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/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..feb476ac --- /dev/null +++ b/src/main/java/com/zcloud/controller/xgf/TrainingBatchController.java @@ -0,0 +1,203 @@ +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.*; +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 java.util.*; + +/** + * 说明:培训批次管理 + * 作者:luoxiaobao + * 时间:2023-05-08 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/trainingbatch") +public class TrainingBatchController extends BaseController { + + @Autowired + private TrainingBatchService trainingbatchService; + + @Autowired + private XgfUserService xgfUserService; + + /** + * 新增 + * + * @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; + } + + /** + * 删除 + * + */ + @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列表 + 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 = xgfUserService.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列表 + 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(); + 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); + } + map.put("result", "success"); //返回结果 + return map; + } +} 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..3929e092 --- /dev/null +++ b/src/main/java/com/zcloud/controller/xgf/XgfUserController.java @@ -0,0 +1,98 @@ +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 +@RequestMapping("/xgf/user") +public class XgfUserController extends BaseController { + + @Resource + private XgfUserService xgfUserService; + + @Value("${preventionxgf.api.url}") + private String url; + + @Resource + private TrainingBatchService trainingBatchService; + + + @RequestMapping(value = "/list") + @ResponseBody + public Object list(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; + } + + @RequestMapping(value = "/approve") + @ResponseBody + public Object approve() throws Exception { + PageData request = this.getPageData(); + xgfUserService.approve(request); + PageData response = new PageData(); + response.put("result", "success"); + 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; + } + + @RequestMapping(value = "/getInfo") + @ResponseBody + 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/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/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..76fdf346 --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/TrainingBatchMapper.java @@ -0,0 +1,82 @@ +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); + + List findByUserId(PageData condition); + + List oldlistPage(Page page); +} + 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..63d2150e --- /dev/null +++ b/src/main/java/com/zcloud/mapper/datasource/xgf/XgfUserMapper.java @@ -0,0 +1,73 @@ +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); + + void updateStatusByUnflowTrain(PageData pd); + + void bantchUpdateStatus(int STATUS, String[] arrayDATA_ids); + + void updateStatusByFlowTrain(PageData pd); + + void graduation(PageData condition); + + void graduationstudent(PageData condition); + + List flowlistPage(Page page); + + PageData getInfoById(PageData condition); + + List findRecordList(PageData condition); +} 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/TrainUsersService.java b/src/main/java/com/zcloud/service/xgf/TrainUsersService.java new file mode 100644 index 00000000..bba08ab6 --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/TrainUsersService.java @@ -0,0 +1,100 @@ +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 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/TrainingBatchService.java b/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java new file mode 100644 index 00000000..5dff54a4 --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/TrainingBatchService.java @@ -0,0 +1,95 @@ +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; + + List findByUserId(PageData condition) throws Exception; + + List oldBatchList(Page page) throws Exception; +} + 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..3397027c --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/XgfUserService.java @@ -0,0 +1,27 @@ +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) throws Exception; + + void approvalApplication(PageData request) throws Exception; + + List flowlistPage(Page page)throws Exception; + + 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/TrainUsersServiceImpl.java b/src/main/java/com/zcloud/service/xgf/impl/TrainUsersServiceImpl.java new file mode 100644 index 00000000..5f5cb66d --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/impl/TrainUsersServiceImpl.java @@ -0,0 +1,207 @@ +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 void approveUser(PageData pd) throws Exception { + PageData condition = new PageData(); + 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; + } + 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")); + switch (stepNumber){ + case 0: + entity.put("TERRITORIALITY_TIME",DateUtil.getTime()); + break; + case 1: + entity.put("MANAGER_TIME",DateUtil.getTime()); + break; + case 2: + entity.put("SUPERVISION_TIME",DateUtil.getTime()); + break; + } + 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 new file mode 100644 index 00000000..773f317e --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/impl/TrainingBatchServiceImpl.java @@ -0,0 +1,416 @@ +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; +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; + + @Resource + private UsersMapper usersMapper; + + @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-否 + + 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("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")); + + // 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 == null ? "" : terDepartment.get("NAME")); + } + + pd.put("IS_DELETE", "0"); + pd.put("STEP_STATUS", "1"); + trainingbatchMapper.save(pd); + + 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); + }); + + /* 保存审批流程信息 */ + 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); + } + + /** + * 固定人员培训 + * + * @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")); + + 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("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); + } + + 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("TRAIN_USERS_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("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 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 oldBatchList(Page page) throws Exception { + return trainingbatchMapper.oldlistPage(page); + } +} + 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..169722b4 --- /dev/null +++ b/src/main/java/com/zcloud/service/xgf/impl/XgfUserServiceImpl.java @@ -0,0 +1,199 @@ +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; +import com.zcloud.service.system.DepartmentService; +import com.zcloud.service.xgf.XgfUserService; +import com.zcloud.util.*; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Service +public class XgfUserServiceImpl implements XgfUserService { + + @Resource + private XgfUserMapper xgfUserMapper; + + @Resource + private XgfUserDetailsMapper xgfUserDetailsMapper; + + @Resource + private TrainUsersMapper trainUsersMapper; + + @Resource + private DepartmentService departmentService; + + @Value("${preventionxgf.api.url}") + private String prevention_xgf_url; + + @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) throws Exception { + List list = Warden.getList(request.getString("infoList")); + PageData condition = new PageData(); + for (PageData x : list) { + 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("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); + if (regDepartmentEntity != null && regDepartmentEntity.size() > 0) { + x.put("MANAGER_DEPARTMENT_NAME", regDepartmentEntity.get("NAME")); + } + + /* 主管部门 */ + condition.clear(); + condition.put("DEPARTMENT_ID", x.get("MAIN_DEPARTMENT_ID")); + regDepartmentEntity = departmentService.getCorpDepartment(condition); + x.put("MAIN_DEPARTMENT_NAME", regDepartmentEntity.get("NAME")); + if (regDepartmentEntity.size() > 0) { + x.put("MAIN_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("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")); + PageData regDepartmentEntity = departmentService.getCorpDepartment(condition); + if (regDepartmentEntity != null && regDepartmentEntity.size() > 0) { + x.put("MANAGER_DEPARTMENT_NAME", regDepartmentEntity.get("NAME")); + } + /* 主管部门 */ + condition.clear(); + condition.put("DEPARTMENT_ID", x.get("MAIN_DEPARTMENT_ID")); + regDepartmentEntity = departmentService.getCorpDepartment(condition); + x.put("MAIN_DEPARTMENT_NAME", regDepartmentEntity.get("NAME")); + 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); + } + } + } + } + + @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); + /* 校验所有数据是否都是正常状态 */ + if (entities.stream().anyMatch(n -> !"2".equals(n.getString("STATUS")))) { + String name = entities.stream().filter(n -> !"2".equals(n.getString("STATUS"))).map( n -> n.getString("NAME")).collect(Collectors.joining(",")); + throw new RuntimeException("用户[" + name + "]在系统流程中无法被打回"); + } + + for (PageData x : entities) { + x.put("VALID_FLAG", "0"); + x.put("STATUS", "1"); + xgfUserMapper.edit(x); + } + } + + @Override + public List flowlistPage(Page page) throws Exception { + return xgfUserMapper.flowlistPage(page); + } + + @Override + @Transactional + public void approve(PageData request) throws Exception { + List _list = Warden.getList(request.getString("list")); + if (_list == null || _list.size() == 0) { + throw new RuntimeException("请求数据异常"); + } + List list = _list.stream().map(x -> x.getString("XGF_USER_ID")).collect(Collectors.toList()); + PageData condition = new PageData(); + for (String x : list) { + condition.put("XGF_USER_ID", x); + PageData entity = xgfUserMapper.findById(condition); + if (entity == null || entity.size() == 0) { + throw new RuntimeException("未找到该用户"); + } + if ("1".equals(request.getString("STATUS"))) { + entity.put("STATUS", "0"); + } else { + entity.put("STATUS", "2"); + entity.put("VALID_FLAG", "1"); + } + xgfUserMapper.edit(entity); + + entity.put("USER_ID", condition.get("XGF_USER_ID")); + entity.put("STATUS", request.getString("STATUS")); + Map result = HttpClientService.doPost(prevention_xgf_url + "openApi/user/approve", entity); + if (result == null || !"succeed".equals(result.get("result"))) { + throw new RuntimeException("请求失败"); + } + } + } + + @Override + 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/java/com/zcloud/util/HttpClientService.java b/src/main/java/com/zcloud/util/HttpClientService.java index 2adb7701..64be5883 100644 --- a/src/main/java/com/zcloud/util/HttpClientService.java +++ b/src/main/java/com/zcloud/util/HttpClientService.java @@ -365,46 +365,9 @@ public class HttpClientService { } public static Map doPost(String url, PageData pd) { - /* 正式上面总是显示一次断一次,未找到原因 - MultiValueMap requestBody = new LinkedMultiValueMap(); - pd.forEach((key, value) -> { - requestBody.add(key.toString(), value.toString()); - }); - System.out.println(requestBody); - Map responseBody = new HashMap(); - TcpClient tcpClient = TcpClient.create() - .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 1000) // Connection Timeout - .doOnConnected(connection -> - connection.addHandlerLast(new ReadTimeoutHandler(10)) // Read Timeout - .addHandlerLast(new WriteTimeoutHandler(10))); // Write Timeout - WebClient client = WebClient.builder().clientConnector(new ReactorClientHttpConnector(HttpClient.from(tcpClient))).build(); - client.post() - .uri(url) - .header("Source","zcloud") - .contentType(MediaType.APPLICATION_FORM_URLENCODED) - .body(BodyInserters.fromFormData(requestBody)) - .exchange() - .flatMap(response -> { - System.out.println("Status code: " + response.statusCode().value()); - return response.bodyToMono(JSONObject.class); - }) - .doOnSuccess(body -> { - System.out.println("success"); - responseBody.putAll(body); - }) - .doOnError(throwable -> { - responseBody.put("msg",throwable.getMessage()); - System.out.println("Error occurred: " + throwable.getMessage()); - }) - .block(); - return responseBody; - */ JSONObject jsonObject = null; HttpResponse response = null; List nameValuePairList = new ArrayList(); -// pd.forEach((key, value) -> { // 这个遍历不好使 -// System.out.println("键:" + key.toString() + ",值:" + value.toString()); -// }); Map map = (Map)pd; System.out.print("参数:{"); for(Map.Entry entry : map.entrySet()){ diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 57b4496f..3177c2f9 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -68,11 +68,11 @@ corp.default.pic-path=https://qgqy.qhdsafety.com/file/ corp.default.back-end-path=http://192.168.151.57: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/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/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 9ed6e5db..42cf2520 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/FlowDetailMapper.xml b/src/main/resources/mybatis/datasource/xgf/FlowDetailMapper.xml new file mode 100644 index 00000000..4a663f1e --- /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..0c20cab8 --- /dev/null +++ b/src/main/resources/mybatis/datasource/xgf/TrainUsersMapper.xml @@ -0,0 +1,493 @@ + + + + + + + xgf_train_users + + + + + SYS_DICTIONARIES + + + + + f.TRAINING_BATCH_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.TRAIN_USERS_ID, + f.STEP_STATUS, + f.BELONG_TO_CORP + f.BELONG_TO_CORP_NAME, + f.IS_DELETE, + f.RESULT_STATUS + + + + + TRAINING_BATCH_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, + TRAIN_USERS_ID, + STEP_STATUS, + BELONG_TO_CORP, + BELONG_TO_CORP_NAME, + IS_DELETE, + RESULT_STATUS + + + + + #{TRAINING_BATCH_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}, + #{TRAIN_USERS_ID}, + #{STEP_STATUS}, + #{BELONG_TO_CORP}, + #{BELONG_TO_CORP_NAME}, + #{IS_DELETE}, + #{RESULT_STATUS} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + TRAIN_USERS_ID = #{TRAIN_USERS_ID} + + + + + update + + set + 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}, + BELONG_TO_CORP = #{BELONG_TO_CORP}, + BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME}, + IS_DELETE = #{IS_DELETE}, + RESULT_STATUS = #{RESULT_STATUS} + where + TRAIN_USERS_ID = #{TRAIN_USERS_ID} + + + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + TRAIN_USERS_ID in + + #{item} + + + + + + update + + set STATUS = #{STATUS}, + + START_DATE = #{START_DATE}, + + + END_DATE = #{END_DATE}, + + TRAINING_BATCH_ID = #{TRAINING_BATCH_ID} + where + TRAINING_BATCH_ID = #{TRAINING_BATCH_ID} + + + + + + + + + + update + set STATUS = #{STATUS}, + + START_DATE = #{START_DATE}, + + + END_DATE = #{END_DATE}, + + TRAIN_USERS_ID = #{TRAIN_USERS_ID} + where + TRAIN_USERS_ID = #{TRAIN_USERS_ID} + + + + + + + + update + set + SUPERVISION_STATE = #{SUPERVISION_STATE}, + + STATUS = #{STATUS}, + + SUPERVISION_OPINION = #{SUPERVISION_OPINION}, + SUPERVISION_TIME= #{SUPERVISION_TIME}, + STEP_STATUS = #{STEP_STATUS} + where + TRAIN_USERS_ID = #{TRAIN_USERS_ID} + + + update + set + MANAGER_STATE= #{MANAGER_STATE}, + + STATUS = #{STATUS}, + + MANAGER_OPINION = #{MANAGER_OPINION}, + MANAGER_TIME = #{MANAGER_TIME}, + STEP_STATUS = #{STEP_STATUS} + where + TRAIN_USERS_ID = #{TRAIN_USERS_ID} + + + update + set + TERRITORIALITY_STATE = #{TERRITORIALITY_STATE}, + + STATUS = #{STATUS}, + + TERRITORIALITY_OPINION = #{TERRITORIALITY_OPINION}, + TERRITORIALITY_TIME = #{TERRITORIALITY_TIME}, + STEP_STATUS = #{STEP_STATUS} + where + TRAIN_USERS_ID = #{TRAIN_USERS_ID} + + + update bus_trainusers a set a.STATUS = #{STATUS} where a.TRAIN_USERS_ID in + + #{item} + ; + + + + update bus_trainusers a set a.STATUS = #{STATUS} where a.TRAIN_USERS_ID = #{TRAIN_USERS_ID} + + + update bus_trainusers a set + + a.START_DATE = #{START_DATE} + + + a.END_DATE = #{END_DATE} + + where a.TRAIN_USERS_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..c6175178 --- /dev/null +++ b/src/main/resources/mybatis/datasource/xgf/TrainingBatchMapper.xml @@ -0,0 +1,388 @@ + + + + + + + xgf_training_batch + + + + + 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_DEPARTMENT_NAME, + f.MANAGER_USER_ID, + f.MANAGER_USER_NAME, + f.MANAGER_TIME, + f.AUDIT_STATUS, + f.TRAINING_BATCH_ID, + f.SUPERVISION, + f.SUPERVISION_DEPARTMENT_NAME, + f.SUPERVISION_USER_ID, + f.SUPERVISION_USER_NAME, + f.SUPERVISION_TIME, + f.TERRITORIALITY, + f.TERRITORIALITY_DEPARTMENT_NAME, + f.TERRITORIALITY_USER_ID, + f.TERRITORIALITY_USER_NAME, + f.TERRITORIALITY_TIME, + f.BELONG_TO_CORP, + f.BELONG_TO_CORP_NAME, + f.IS_DELETE, + f.STEP_STATUS + + + + + CREATOR, + CREATTIME, + OPERATOR, + OPERATTIME, + ISDELETE, + BATCH_NAME, + CORPINFO_ID, + USER_COUNT, + TRAIN_CORP_DEPT, + TRAIN_CORP_LEADER, + DESCR, + TRAIN_AREA, + MANAGER, + MANAGER_DEPARTMENT_NAME, + MANAGER_USER_ID, + MANAGER_USER_NAME, + MANAGER_TIME, + AUDIT_STATUS, + TRAINING_BATCH_ID, + SUPERVISION, + SUPERVISION_DEPARTMENT_NAME, + SUPERVISION_USER_ID, + SUPERVISION_USER_NAME, + SUPERVISION_TIME, + TERRITORIALITY, + TERRITORIALITY_DEPARTMENT_NAME, + TERRITORIALITY_USER_ID, + TERRITORIALITY_USER_NAME, + TERRITORIALITY_TIME, + BELONG_TO_CORP, + BELONG_TO_CORP_NAME, + IS_DELETE, + STEP_STATUS + + + + + #{CREATOR}, + #{CREATTIME}, + #{OPERATOR}, + #{OPERATTIME}, + #{ISDELETE}, + #{BATCH_NAME}, + #{CORPINFO_ID}, + #{USER_COUNT}, + #{TRAIN_CORP_DEPT}, + #{TRAIN_CORP_LEADER}, + #{DESCR}, + #{TRAIN_AREA}, + #{MANAGER}, + #{MANAGER_DEPARTMENT_NAME}, + #{MANAGER_USER_ID}, + #{MANAGER_USER_NAME}, + #{MANAGER_TIME}, + #{AUDIT_STATUS}, + #{TRAINING_BATCH_ID}, + #{SUPERVISION}, + #{SUPERVISION_DEPARTMENT_NAME}, + #{SUPERVISION_USER_ID}, + #{SUPERVISION_USER_NAME}, + #{SUPERVISION_TIME}, + #{TERRITORIALITY}, + #{TERRITORIALITY_DEPARTMENT_NAME}, + #{TERRITORIALITY_USER_ID}, + #{TERRITORIALITY_USER_NAME}, + #{TERRITORIALITY_TIME}, + #{BELONG_TO_CORP}, + #{BELONG_TO_CORP_NAME}, + #{IS_DELETE}, + #{STEP_STATUS} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + TRAINING_BATCH_ID = #{TRAINING_BATCH_ID} + + + + + update + + set + CREATOR = #{CREATOR}, + CREATTIME = #{CREATTIME}, + OPERATOR = #{OPERATOR}, + OPERATTIME = #{OPERATTIME}, + ISDELETE = #{ISDELETE}, + BATCH_NAME = #{BATCH_NAME}, + CORPINFO_ID = #{CORPINFO_ID}, + USER_COUNT = #{USER_COUNT}, + TRAIN_CORP_DEPT = #{TRAIN_CORP_DEPT}, + TRAIN_CORP_LEADER = #{TRAIN_CORP_LEADER}, + DESCR = #{DESCR}, + TRAIN_AREA = #{TRAIN_AREA}, + MANAGER = #{MANAGER}, + MANAGER_DEPARTMENT_NAME = #{MANAGER_DEPARTMENT_NAME}, + MANAGER_USER_ID = #{MANAGER_USER_ID}, + MANAGER_USER_NAME = #{MANAGER_USER_NAME}, + MANAGER_TIME = #{MANAGER_TIME}, + AUDIT_STATUS = #{AUDIT_STATUS}, + TRAINING_BATCH_ID = #{TRAINING_BATCH_ID}, + SUPERVISION = #{SUPERVISION}, + SUPERVISION_DEPARTMENT_NAME = #{SUPERVISION_DEPARTMENT_NAME}, + SUPERVISION_USER_ID = #{SUPERVISION_USER_ID}, + SUPERVISION_USER_NAME = #{SUPERVISION_USER_NAME}, + SUPERVISION_TIME = #{SUPERVISION_TIME}, + TERRITORIALITY = #{TERRITORIALITY}, + TERRITORIALITY_DEPARTMENT_NAME = #{TERRITORIALITY_DEPARTMENT_NAME}, + TERRITORIALITY_USER_ID = #{TERRITORIALITY_USER_ID}, + TERRITORIALITY_USER_NAME = #{TERRITORIALITY_USER_NAME}, + TERRITORIALITY_TIME = #{TERRITORIALITY_TIME}, + BELONG_TO_CORP = #{BELONG_TO_CORP}, + BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME}, + IS_DELETE = #{IS_DELETE}, + STEP_STATUS = #{STEP_STATUS} + where + TRAINING_BATCH_ID = #{TRAINING_BATCH_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}, + + TRAINING_BATCH_ID = #{TRAINING_BATCH_ID} + where + TRAINING_BATCH_ID = #{TRAINING_BATCH_ID} + + + update xgf_train_users a set a.STATUS = '2' where a.USER_ID in + + #{item} + ; + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + TRAINING_BATCH_ID in + + #{item} + + + + + + + + + + + + + + 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..0c1343c9 --- /dev/null +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserDetailsMapper.xml @@ -0,0 +1,337 @@ + + + + + + + XGF_USER_DETAILS + + + + + f.XGF_USER_DETAILS_ID, + f.XGF_USER_ID, + f.XGF_USER_NAME, + f.BELONG_TO_CORP, + f.BELONG_TO_CORP_NAME, + f.PHONE, + f.CREATE_TIME, + f.DEPART_STATE, + f.IS_DELETE, + 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, + f.MANAGER_DEPARTMENT_ID, + f.MANAGER_DEPARTMENT_NAME, + f.COMPETENT_DEPARTMENT_ID, + f.COMPETENT_DEPARTMENT_NAME, + f.MAIN_DEPARTMENT_ID, + f.MAIN_DEPARTMENT_NAME, + f.CARD_ID, + f.DEPARTMENT_ID, + f.DEPARTMENT_NAME, + f.IS_BF, + f.IS_SOCIAL, + f.SOCIAL_NUMBER, + f.zzName + + + + + XGF_USER_DETAILS_ID, + XGF_USER_ID, + XGF_USER_NAME, + BELONG_TO_CORP, + BELONG_TO_CORP_NAME, + PHONE, + CREATE_TIME, + DEPART_STATE, + IS_DELETE, + 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, + MANAGER_DEPARTMENT_ID, + MANAGER_DEPARTMENT_NAME, + COMPETENT_DEPARTMENT_ID, + COMPETENT_DEPARTMENT_NAME, + MAIN_DEPARTMENT_ID, + MAIN_DEPARTMENT_NAME, + CARD_ID, + DEPARTMENT_ID, + DEPARTMENT_NAME, + IS_BF, + IS_SOCIAL, + SOCIAL_NUMBER, + zzName + + + + + #{XGF_USER_DETAILS_ID}, + #{XGF_USER_ID}, + #{XGF_USER_NAME}, + #{BELONG_TO_CORP}, + #{BELONG_TO_CORP_NAME}, + #{PHONE}, + #{CREATE_TIME}, + #{DEPART_STATE}, + #{IS_DELETE}, + #{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}, + #{MANAGER_DEPARTMENT_ID}, + #{MANAGER_DEPARTMENT_NAME}, + #{COMPETENT_DEPARTMENT_ID}, + #{COMPETENT_DEPARTMENT_NAME}, + #{MAIN_DEPARTMENT_ID}, + #{MAIN_DEPARTMENT_NAME}, + #{CARD_ID}, + #{DEPARTMENT_ID}, + #{DEPARTMENT_NAME}, + #{IS_BF}, + #{IS_SOCIAL}, + #{SOCIAL_NUMBER}, + #{zzName} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + IS_DELETE = '1' + where + XGF_USER_ID = #{XGF_USER_ID} + + + + + update + + set + 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}, + BELONG_TO_CORP_NAME = #{BELONG_TO_CORP_NAME}, + PHONE = #{PHONE}, + CREATE_TIME = #{CREATE_TIME}, + DEPART_STATE = #{DEPART_STATE}, + IS_DELETE = #{IS_DELETE}, + 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}, + MANAGER_DEPARTMENT_ID = #{MANAGER_DEPARTMENT_ID}, + MANAGER_DEPARTMENT_NAME = #{MANAGER_DEPARTMENT_NAME}, + COMPETENT_DEPARTMENT_ID = #{COMPETENT_DEPARTMENT_ID}, + COMPETENT_DEPARTMENT_NAME = #{COMPETENT_DEPARTMENT_NAME}, + MAIN_DEPARTMENT_ID = #{MAIN_DEPARTMENT_ID}, + MAIN_DEPARTMENT_NAME = #{MAIN_DEPARTMENT_NAME}, + CARD_ID = #{CARD_ID}, + DEPARTMENT_ID = #{DEPARTMENT_ID}, + DEPARTMENT_NAME = #{DEPARTMENT_NAME}, + IS_BF = #{IS_BF}, + IS_SOCIAL = #{IS_SOCIAL}, + SOCIAL_NUMBER = #{SOCIAL_NUMBER}, + zzName = #{zzName} + where + XGF_USER_DETAILS_ID = #{XGF_USER_DETAILS_ID} + + + + + + + + + + + + + + update + + set + IS_DELETE = '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..ddbff968 --- /dev/null +++ b/src/main/resources/mybatis/datasource/xgf/XgfUserMapper.xml @@ -0,0 +1,312 @@ + + + + + + + XGF_USER + + + + + f.XGF_USER_ID, + f.USERNAME, + f.NAME, + f.VALID_FLAG, + f.BELONG_TO_CORP, + f.BELONG_TO_CORP_NAME, + f.IS_DELETE, + f.CREATE_TIME, + f.CORPINFO_ID, + f.STATUS, + f.OPERATOR_TIME, + f.ISFLOW, + f.STUDY_STATUS + + + + + XGF_USER_ID, + USERNAME, + NAME, + VALID_FLAG, + BELONG_TO_CORP, + BELONG_TO_CORP_NAME, + IS_DELETE, + CREATE_TIME, + CORPINFO_ID, + STATUS, + OPERATOR_TIME, + ISFLOW, + STUDY_STATUS + + + + + #{XGF_USER_ID}, + #{USERNAME}, + #{NAME}, + #{VALID_FLAG}, + #{BELONG_TO_CORP}, + #{BELONG_TO_CORP_NAME}, + #{IS_DELETE}, + #{CREATE_TIME}, + #{CORPINFO_ID}, + #{STATUS}, + #{OPERATOR_TIME}, + #{ISFLOW}, + #{STUDY_STATUS} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + IS_DELETE = '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}, + IS_DELETE = #{IS_DELETE}, + CREATE_TIME = #{CREATE_TIME}, + CORPINFO_ID = #{CORPINFO_ID}, + STATUS = #{STATUS}, + OPERATOR_TIME = #{OPERATOR_TIME}, + ISFLOW = #{ISFLOW}, + STUDY_STATUS = #{STUDY_STATUS} + where + XGF_USER_ID = #{XGF_USER_ID} + + + + update + + set STATUS = #{STATUS} + where + XGF_USER_ID in (select USER_ID from xgf_train_users bu where bu.TRAINUSERS_ID = #{TRAINUSERS_ID}) + + + update + + set STUDY_STATUS = #{STATUS} + where + XGF_USER_ID in + + #{item} + + + + update + + set STATUS = #{STATUS} + where + XGF_USER_ID in (select USER_ID from xgf_train_users bu where bu.TRAININGBATCH_ID = #{TRAININGBATCH_ID}) + + + update xgf_train_users a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID in + + #{item} + ; + + + update xgf_train_users a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID = #{TRAINUSERS_ID} + + + + + + + + + + + + + + update + + set + IS_DELETE = '1', + OPERATOR = #{OPERATOR}, + OPERATTIME = #{OPERATTIME} + where + SPECIALEQUIPMENT_ID in + + #{item} + + + + + + + + + +