Merge remote-tracking branch 'origin/1212-八项作业迁移' into 1212-八项作业迁移

main^2^2
guoyuepeng 2023-12-26 14:02:28 +08:00
commit ee37e8e021
38 changed files with 4030 additions and 88 deletions

View File

@ -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;
}
}

View File

@ -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<String, Object> response = new HashMap<String, Object>();
response.put("result", "success");
return response;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("系统异常");
}
}
@RequestMapping(value = "/approvalApplication")
@ResponseBody
public Object approvalApplication() throws Exception {
Map<String, Object> response = new HashMap<String, Object>();
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;
}
}
}

View File

@ -0,0 +1,4 @@
package com.zcloud.controller.api.dto;
public class XgfUserDto {
}

View File

@ -66,6 +66,23 @@ public class OpenApiController extends BaseController {
return map;
}
/**
* ztree
* @return
*/
@RequestMapping(value="/corpDepartment/listTree")
@ResponseBody
public Object listTreeRe()throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
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
*/

View File

@ -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<String, Object> map = new HashMap<String, Object>();
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;
}
}

View File

@ -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<String, Object> map = new HashMap<String, Object>();
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<PageData> 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<PageData> 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() + "&currentPage=" + page.getUrlCurrentPage();
private String getPageUrl(Page page) {
return "?showCount=" + page.getShowCount() + "&currentPage=" + page.getUrlCurrentPage();
}
/**
* --
*
* @return
* @throws Exception
*/
@RequestMapping(value="/getUserDetailById")
@RequestMapping(value = "/getUserDetailById")
@ResponseBody
public Object getCorpUserList() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
public Object getCorpUserList() throws Exception {
Map<String, Object> map = new HashMap<String, Object>();
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<String,Object> map = new HashMap<String,Object>();
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<String,Object> map = new HashMap<String,Object>();
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<String, Object> map = new HashMap<String, Object>();
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<PageData> varList = trainingbatchService.oldBatchList(page); //列出TrainingBatch列表
map.put("varList", varList);
map.put("page", page);
map.put("result", "success");
return map;
}
}

View File

@ -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<String,Object> map = new HashMap<String,Object>();
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<String,String> map = new HashMap<String,String>();
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<String,Object> map = new HashMap<String,Object>();
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<String,Object> map = new HashMap<String,Object>();
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<PageData> 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<String,Object> map = new HashMap<String,Object>();
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<String,Object> map = new HashMap<String,Object>();
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<String,Object> dataMap = new HashMap<String,Object>();
List<String> titles = new ArrayList<String>();
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<PageData> varOList = trainusersService.listAll(pd);
List<PageData> varList = new ArrayList<PageData>();
for(int i=0;i<varOList.size();i++){
PageData vpd = new PageData();
vpd.put("var1", varOList.get(i).getString("TRAINUSERS_ID")); //1
vpd.put("var2", varOList.get(i).getString("TRAININGBATCH_ID")); //2
vpd.put("var3", varOList.get(i).getString("USER_ID")); //3
vpd.put("var4", varOList.get(i).getString("START_DATE")); //4
vpd.put("var5", varOList.get(i).getString("END_DATE")); //5
vpd.put("var6", varOList.get(i).get("STATUS").toString()); //6
vpd.put("var7", varOList.get(i).getString("TRAIN_CORPINFO_ID")); //7
vpd.put("var8", varOList.get(i).getString("TRAIN_AREA")); //8
vpd.put("var9", varOList.get(i).get("SUPERVISION_STATE").toString()); //9
vpd.put("var10", varOList.get(i).getString("SUPERVISION_OPINION")); //10
vpd.put("var11", varOList.get(i).get("MANAGER_STATE").toString()); //11
vpd.put("var12", varOList.get(i).getString("MANAGER_OPINION")); //12
vpd.put("var13", varOList.get(i).get("TERRITORIALITY_STATE").toString()); //13
vpd.put("var14", varOList.get(i).getString("TERRITORIALITY_OPINION")); //14
varList.add(vpd);
}
dataMap.put("varList", varList);
ObjectExcelView erv = new ObjectExcelView();
mv = new ModelAndView(erv,dataMap);
return mv;
}
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/approveUser")
@ResponseBody
public Object approveUser() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
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<String, Object> map = new HashMap<>();
PageData pd = new PageData();
pd = this.getPageData();
List<PageData> list = trainusersService.findinfoByCondition(pd);
map.put("list", list);
map.put("result", "success");
return map;
}
}

View File

@ -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<String, Object> map = new HashMap<String, Object>();
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<String, String> map = new HashMap<String, String>();
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<String, Object> map = new HashMap<String, Object>();
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<String, Object> map = new HashMap<String, Object>();
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<PageData> 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<String, Object> map = new HashMap<String, Object>();
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<PageData> 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<String, Object> map = new HashMap<String, Object>();
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<PageData> 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<String, Object> map = new HashMap<String, Object>();
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<String, Object> map = new HashMap<String, Object>();
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;
}
}

View File

@ -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<PageData> recordList = xgfUserService.findRecordList(condition);
/*培训申请记录*/
condition.clear();
condition.put("USER_ID", entity.getString("XGF_USER_ID"));
List<PageData> 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;
}
}

View File

@ -177,5 +177,9 @@ public interface DepartmentMapper{
PageData getInfo(PageData pd) throws Exception;
List<PageData> listTreeManageAndCorpHasOrder(PageData pd);
List<Department> listSubCorpDepartmentByParentId(String parentId);
PageData findByCorpDepartmentId(PageData condition);
}

View File

@ -301,4 +301,5 @@ public interface UsersMapper {
void resetCardNo(PageData pd);
PageData getUserInfo(PageData pd);
List<PageData> getUsersInfo(PageData pd);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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<PageData> datalistPage(Page page);
/**()
* @param pd
* @throws Exception
*/
List<PageData> 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<PageData> unflowlistPage(Page page);
void updateStatus(PageData pd);
/**
*
* @param page
* @return
*/
List<PageData> 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<PageData> 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<PageData> findinfoByCondition(PageData pd);
}

View File

@ -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<PageData> datalistPage(Page page);
/**()
* @param pd
* @throws Exception
*/
List<PageData> 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<PageData> batchUserlistPage(Page page);
List<PageData> passUserlistPage(Page page);
/**id
* @param pd
* @throws Exception
*/
PageData findAndTimeById(PageData pd);
void graduation(PageData condition);
List<PageData> findByUserId(PageData condition);
List<PageData> oldlistPage(Page page);
}

View File

@ -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<PageData> listPage(Page page);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
/**(ID)
* @param pd
* @throws Exception
*/
public List<PageData> listByIds(PageData pd);
}

View File

@ -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<PageData> listPage(Page page);
/**()
* @param pd
* @throws Exception
*/
List<PageData> listAll(PageData pd);
/**id
* @param pd
* @throws Exception
*/
PageData findById(PageData pd);
/**(ID)
* @param pd
* @throws Exception
*/
public List<PageData> 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<PageData> flowlistPage(Page page);
PageData getInfoById(PageData condition);
List<PageData> findRecordList(PageData condition);
}

View File

@ -227,5 +227,9 @@ public interface DepartmentService{
PageData getDepartmentInfo(PageData pd) throws Exception;
List<PageData> listTreeManageAndCorpHasOrder(PageData pd);
List<Department> listAllCorpDepartment(String number) throws Exception;
PageData getCorpDepartment(PageData condition) throws Exception;
}

View File

@ -352,4 +352,6 @@ public interface UsersService {
void resetCardNo(PageData pd);
PageData getUserInfo(PageData pd);
List<PageData> getRegUserInfo(PageData pd);
}

View File

@ -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<PageData> listTreeManageAndCorpHasOrder(PageData pd) {
return departmentMapper.listTreeManageAndCorpHasOrder(pd);
}
@Override
public List<Department> listAllCorpDepartment(String parentId) throws Exception{
List<Department> 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<Department> listSubCorpDepartmentByParentId(String parentId) throws Exception {
return departmentMapper.listSubCorpDepartmentByParentId(parentId);
}
}

View File

@ -473,4 +473,9 @@ public class UsersServiceImpl implements UsersService {
public PageData getUserInfo(PageData pd) {
return usersMapper.getUserInfo(pd);
}
@Override
public List<PageData> getRegUserInfo(PageData pd) {
return usersMapper.getUsersInfo(pd);
}
}

View File

@ -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<PageData> list(Page page)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> 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<PageData> trainApplicationRecordList(Page page);
/**
* @param page
* @throws Exception
*/
public List<PageData> 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<PageData> findinfoByCondition(PageData condition) throws Exception;
void endApproval(PageData pd) throws Exception;
}

View File

@ -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<PageData> list(Page page)throws Exception;
/**()
* @param pd
* @throws Exception
*/
public List<PageData> 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<PageData> batchUserlistPage(Page page)throws Exception;
List<PageData> 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<PageData> findByUserId(PageData condition) throws Exception;
List<PageData> oldBatchList(Page page) throws Exception;
}

View File

@ -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<PageData> list(Page page) throws Exception;
void init(PageData request) throws Exception;
void approvalApplication(PageData request) throws Exception;
List<PageData> flowlistPage(Page page)throws Exception;
void approve(PageData request) throws Exception;
PageData findInfo(PageData condition);
List<PageData> findRecordList(PageData condition) throws Exception;
}

View File

@ -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<PageData> list(Page page) throws Exception {
return trainusersMapper.datalistPage(page);
}
/**
* ()
*
* @param pd
* @throws Exception
*/
public List<PageData> 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<PageData> trainApplicationRecordList(Page page) {
return trainusersMapper.trainApplicationRecordList(page);
}
public List<PageData> 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<PageData> 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);
}
}

View File

@ -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<PageData> list(Page page) throws Exception {
return trainingbatchMapper.datalistPage(page);
}
/**
* ()
*
* @param pd
* @throws Exception
*/
public List<PageData> 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<PageData> batchUserlistPage(Page page) throws Exception {
return trainingbatchMapper.batchUserlistPage(page);
}
@Override
public List<PageData> 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<PageData> 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<PageData> 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<PageData> 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<PageData> findByUserId(PageData condition) throws Exception {
return trainingbatchMapper.findByUserId(condition);
}
@Override
public List<PageData> oldBatchList(Page page) throws Exception {
return trainingbatchMapper.oldlistPage(page);
}
}

View File

@ -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<PageData> list(Page page) throws Exception {
return xgfUserDetailsMapper.listPage(page);
}
@Override
@Transactional
public void init(PageData request) throws Exception {
List<PageData> 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<String> list = Arrays.asList(request.getString("xgf_user_ids").split(","));
PageData condition = new PageData();
condition.put("XGF_USER_IDS", list);
List<PageData> 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<PageData> flowlistPage(Page page) throws Exception {
return xgfUserMapper.flowlistPage(page);
}
@Override
@Transactional
public void approve(PageData request) throws Exception {
List<PageData> _list = Warden.getList(request.getString("list"));
if (_list == null || _list.size() == 0) {
throw new RuntimeException("请求数据异常");
}
List<String> 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<PageData> findRecordList(PageData condition) throws Exception {
return xgfUserMapper.findRecordList(condition);
}
}

View File

@ -365,46 +365,9 @@ public class HttpClientService {
}
public static Map doPost(String url, PageData pd) {
/*
MultiValueMap<String, String> requestBody = new LinkedMultiValueMap();
pd.forEach((key, value) -> {
requestBody.add(key.toString(), value.toString());
});
System.out.println(requestBody);
Map<String,Object> responseBody = new HashMap<String,Object>();
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<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
// pd.forEach((key, value) -> { // 这个遍历不好使
// System.out.println("键:" + key.toString() + ",值:" + value.toString());
// });
Map<Object, Object> map = (Map)pd;
System.out.print("参数:{");
for(Map.Entry<Object, Object> entry : map.entrySet()){

View File

@ -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

View File

@ -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
#<EFBFBD><EFBFBD><EFBFBD><EFBFBD>31ʱʹ<EFBFBD><EFBFBD>
#spring.profiles.active=dev
#??
#spring.profiles.active=master

View File

@ -579,4 +579,17 @@
DEP_ORDER ASC,
name
</select>
<select id="listSubCorpDepartmentByParentId" parameterType="String" resultMap="departmentResultMap">
select * from `qa-gwj-regulatory`.SYS_DEPARTMENT
where 1=1
<if test="_parameter != null and _parameter != ''"><!-- 关键词检索 -->
and PARENT_ID = #{parentId}
</if>
order by DEP_ORDER asc, NAME
</select>
<select id="findByCorpDepartmentId" resultType="com.zcloud.entity.PageData">
select * from `qa-gwj-regulatory`.SYS_DEPARTMENT
where DEPARTMENT_ID = #{DEPARTMENT_ID}
order by DEP_ORDER asc, NAME
</select>
</mapper>

View File

@ -1328,4 +1328,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</if>
</select>
<select id="getUsersInfo" resultType="com.zcloud.entity.PageData">
select * from `qa-gwj-regulatory`.SYS_USER where ISDELETE = '0'
<if test="USER_ID != null and USER_ID != ''">
and USER_ID = #{USER_ID}
</if>
<if test="USER_IDS != null and USER_IDS != ''">
and USER_ID in
<foreach item="item" index="index" collection="USER_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="DEPARTMENT_ID != null and DEPARTMENT_ID != null">
and DEPARTMENT_ID = #{DEPARTMENT_ID}
</if>
<if test="ISASSESS != null and ISASSESS != null">
and ISASSESS = #{ISASSESS}
</if>
</select>
</mapper>

View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.xgf.FlowDetailMapper">
<!--表名 -->
<sql id="tableName">
BUS_FLOW_DETAIL
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
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
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
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
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{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}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
FLOW_DETAIL_ID = #{FLOW_DETAIL_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
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}
</update>
<select id="findById" parameterType="pd" resultType="pd">
select * from BUS_FLOW_DETAIL a where a.FLOW_DETAIL_ID = #{FLOW_DETAIL_ID}
</select>
<select id="selectOne" resultType="com.zcloud.entity.PageData">
select *
from BUS_FLOW_DETAIL a
where a.ISDELETE = '0'
<if test="FLOW_ID != null and FLOW_ID != ''">
and a.FLOW_ID = #{FLOW_ID}
</if>
<if test="STEP_FLAG != null and STEP_FLAG != ''">
and a.STEP_FLAG = #{STEP_FLAG}
</if>
<if test="PARENT_ID != null and PARENT_ID != ''">
and a.PARENT_ID = #{PARENT_ID}
</if>
<if test="FOREIGN_ID != null and FOREIGN_ID != ''">
and a.FOREIGN_ID = #{FOREIGN_ID}
</if>
</select>
</mapper>

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.xgf.FlowMapper">
<!--表名 -->
<sql id="tableName">
BUS_FLOW
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.FLOW_ID,
f.TYPE,
f.CREATOR,
f.CREATOR_NAME,
f.CREATOR_TIME,
f.VALID_FLAG,
f.FOREIGN_KEY
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
FLOW_ID,
TYPE,
CREATOR,
CREATOR_NAME,
CREATOR_TIME,
VALID_FLAG,
FOREIGN_KEY
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{FLOW_ID},
#{TYPE},
#{CREATOR},
#{CREATOR_NAME},
#{CREATOR_TIME},
#{VALID_FLAG},
#{FOREIGN_KEY}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
FLOW_ID = #{FLOW_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
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}
</update>
<select id="findById" parameterType="pd" resultType="pd">
select * from bus_flow a where a.FLOW_ID = #{FLOW_ID}
</select>
<select id="findByCondition" resultType="com.zcloud.entity.PageData">
select * from bus_flow a where a.ISDELETE = '0'
<if test="FOREIGN_KEY != null and FOREIGN_KEY != ''">
and a.FOREIGN_KEY = #{FOREIGN_KEY}
</if>
</select>
</mapper>

View File

@ -0,0 +1,493 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.xgf.TrainUsersMapper">
<!--表名 -->
<sql id="tableName">
xgf_train_users
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
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
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
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
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{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}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
TRAIN_USERS_ID = #{TRAIN_USERS_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
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>
<!-- 通过USER_ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select * from xgf_train_users a where a.TRAIN_USERS_ID = #{TRAIN_USERS_ID}
</select>
<!-- 服务人员管理列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select
u.USER_ID,
IFNULL(u.NAME, "") AS NAME,
IFNULL(bc.RELEVANT_UNIT_NAME, "") AS RELEVANT_UNIT_NAME,
IFNULL(sud.PERSON_WORK_TYPE, "") AS PERSON_WORK_TYPE_NAME,<!-- 工种名称-->
IFNULL(sd.NAME, "") AS DICNAME,
IFNULL(oa.NAME, "") AS DEP_NAME,
IFNULL(t.END_DATE, "") as END_DATE,
corpTypeDic.NAME corpTypeName,
IFNULL(u.STATUS, "") as STATUS
from
sys_user u
left join bus_corpinfo bc on bc.CORPINFO_ID = u.CORPINFO_ID<!-- 相关方企业名称 -->
left join BUS_CORPINFODETAILS bcd on bcd.CORPINFO_ID = bc.CORPINFO_ID
left join sys_dictionaries corpTypeDic on corpTypeDic.BIANMA = bcd.CORP_TYPE
left join sys_user_details sud on sud.USER_ID = u.USER_ID<!-- 工种 -->
left join SYS_DICTIONARIES sd on sud.PERSON_WORK_TYPE = sd.BIANMA<!-- 工种名字 -->
left join oa_department oa on oa.DEPARTMENT_ID = u.DEPARTMENT_ID <!-- 部门-->
left join (select tu.* from BUS_TRAINUSERS tu where tu.STATUS = 2 and tu.TRAIN_AREA is null GROUP BY tu.USER_ID HAVING END_DATE = MAX(END_DATE ) ) t on t.USER_ID = u.USER_ID
<!--年份-->
<where>
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索(用户名) -->
and (u.NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%'))
</if>
<if test="pd.RELEVANT_UNIT_NAME != null and pd.RELEVANT_UNIT_NAME != ''"><!-- 关键词检索(相关方单位名称) -->
and bc.RELEVANT_UNIT_NAME LIKE CONCAT(CONCAT('%', #{pd.RELEVANT_UNIT_NAME}),'%')
</if>
<if test="pd.STATUS != null and pd.STATUS != ''"><!-- 关键词检索(年份) -->
and u.STATUS = #{pd.STATUS}
</if>
<if test="pd.END_DATE != null and pd.END_DATE != ''"><!-- 关键词检索(年份) -->
and t.END_DATE LIKE CONCAT(CONCAT('%', #{pd.END_DATE}),'%')
</if>
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''"><!-- 关键词检索(年份) -->
and
exists (select 1 from bus_service_company_user_map um where um.USER_ID = u.USER_ID and um.STATUS = 1 and um.SERVICE_PROVIDER_ID = #{pd.CORPINFO_ID} )
</if>
<if test="pd.TYPE == 1">
and u.ISFLOW='0'
</if>
</where>
order by u.CREATTIME desc
</select>
<!-- 列表(全部) -->
<select id="listAll1" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
</select>
<!-- 列表 -->
<select id="unflowlistPage" parameterType="page" resultType="pd">
select
f.*,
c.RELEVANT_UNIT_NAME,
vc.CORP_NAME FIRST_PARTY_NAME,
u.USERNAME,
u.NAME,
d.NAME DEPARTMENT_NAME
from
<include refid="tableName"></include> f
left join SYS_USER u on u.USER_ID = f.USER_ID
left join bus_corpinfo c on c.CORPINFO_ID = u.CORPINFO_ID
left join vi_corp_info vc on vc.CORPINFO_ID = f.TRAIN_CORPINFO_ID
left join oa_department d on d.DEPARTMENT_ID = u.DEPARTMENT_ID
where f.TRAINING_BATCH_ID is null
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and
(
u.USERNAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
or
c.RELEVANT_UNIT_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
)
</if>
<if test="pd.YEAR != null and pd.YEAR != ''"><!-- 关键词检索 -->
and YEAR(f.START_DATE) = #{pd.YEAR}
</if>
<if test="pd.STATUS != null and pd.STATUS != '' and pd.STATUS == 0"><!-- 关键词检索 -->
and f.STATUS = 1
</if>
<if test="pd.STATUS != null and pd.STATUS != '' and pd.STATUS == 1"><!-- 关键词检索 -->
and f.STATUS != 1
</if>
order by f.STATUS = 0,f.START_DATE desc
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
TRAIN_USERS_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 批量修改用户状态 -->
<update id="updateStatusByFlowTrain" parameterType="pd">
update
<include refid="tableName"></include>
set STATUS = #{STATUS},
<if test="START_DATE != null and START_DATE != ''">
START_DATE = #{START_DATE},
</if>
<if test="END_DATE != null and END_DATE != ''">
END_DATE = #{END_DATE},
</if>
TRAINING_BATCH_ID = #{TRAINING_BATCH_ID}
where
TRAINING_BATCH_ID = #{TRAINING_BATCH_ID}
</update>
<!-- 培训申请记录 -->
<select id="trainApplicationRecordList" parameterType="pd" resultType="pd">
select
IFNULL(f.TRAIN_USERS_ID, "") AS TRAIN_USERS_ID,
IFNULL(f.TRAIN_CORPINFO_ID, "") AS TRAIN_CORPINFO_ID, <!-- 分公司申请部门 -->
IFNULL(f.STATUS, "") AS STATUS,<!-- 验证状态 -->
IFNULL(od.NAME, "") AS DEP_NAME<!-- 部门名称 -->
from
bus_trainusers f
left join bus_corpinfo bc on bc.CORPINFO_ID = f.TRAIN_CORPINFO_ID
left join oa_department od on od.DEPARTMENT_ID = bc.CORPINFO_ID
<where>
<if test="pd.DEP_NAME != null and pd.DEP_NAME != ''"><!-- 关键词检索(分工是申请部门) -->
and
(od.DEP_NAME LIKE CONCAT(CONCAT('%', #{pd.DEP_NAME}),'%'))
</if>
<if test="pd.STATUS != null and pd.STATUS != ''"><!-- 验证状态 -->
and
(f.STATUS LIKE CONCAT(CONCAT('%', #{pd.STATUS}),'%'))
</if>
</where>
</select>
<!-- 固定人员管理培训查看按钮 -->
<select id="trainView" parameterType="pd" resultType="pd" >
select
su.USER_ID,
su.NAME,
sud.PHOTO,
sud.SEX,
sud.DATE_OF_BIRTH,
sud.AGE,
sud.HKLOCAL,
su.CARD_ID,
sud.ADDRESS,
sud.PHONE,
sud.DEGREE_OF_EDUCATION,
be.CORP_START_DATE,
be.POST_ID,
be.ENTRY_DATE,
be.IS_SIGN_LABOR,
be.IS_INJURIES_PAY,
su.SOCIAL_NUMBER,
be.ISPAY,
be.IS_LEVEL_THREE,
be.IS_SAFETY_TELL,
be.IS_BODY_ADAPT,
be.IS_SPECIAL_JOB,
su.ISFLOW,
bc.CORPINFO_ID,
bc.RELEVANT_UNIT_NAME,
dic.NAME as TRAIN_AREA,
sd.NAME as POST_NAME,
sdic.NAME as EDUCATION_NAME
from SYS_USER su
left join SYS_USER_DETAILS sud on su.USER_ID = sud.USER_ID
left join (select tu.* from BUS_TRAINUSERS tu where tu.STATUS = 2 GROUP BY tu.USER_ID HAVING START_DATE = MAX(START_DATE) ) t on t.USER_ID = su.USER_ID
left join SYS_DICTIONARIES dic on dic.DICTIONARIES_ID = t.TRAIN_AREA
left join BUS_EMPLOYMENT_APPLY_MANAGEMENT be on su.USER_ID = be.USER_ID and be.ISDELETE = '0' and be.CORPINFO_ID = su.CORPINFO_ID
left join SYS_DICTIONARIES sd on sd.BIANMA = be.POST_ID
left join SYS_DICTIONARIES sdic on sdic.BIANMA = sud.DEGREE_OF_EDUCATION
left join BUS_CORPINFO bc on bc.CORPINFO_ID = su.CORPINFO_ID
where su.USER_ID = #{USER_ID}
limit 1
</select>
<!-- 批量修改用户状态 -->
<update id="updateStatus" parameterType="pd" >
update <include refid="tableName"></include>
set STATUS = #{STATUS},
<if test="START_DATE != null and START_DATE != ''">
START_DATE = #{START_DATE},
</if>
<if test="END_DATE != null and END_DATE != ''">
END_DATE = #{END_DATE},
</if>
TRAIN_USERS_ID = #{TRAIN_USERS_ID}
where
TRAIN_USERS_ID = #{TRAIN_USERS_ID}
</update>
<!-- 安全监督部 审核 -->
<update id="approveSupervision" parameterType="pd" >
update <include refid="tableName"></include>
set
SUPERVISION_STATE = #{SUPERVISION_STATE},
<if test="STATUS != null and STATUS != ''">
STATUS = #{STATUS},
</if>
SUPERVISION_OPINION = #{SUPERVISION_OPINION},
SUPERVISION_TIME= #{SUPERVISION_TIME},
STEP_STATUS = #{STEP_STATUS}
where
TRAIN_USERS_ID = #{TRAIN_USERS_ID}
</update>
<update id="approveManager" parameterType="pd" >
update <include refid="tableName"></include>
set
MANAGER_STATE= #{MANAGER_STATE},
<if test="STATUS != null and STATUS != ''">
STATUS = #{STATUS},
</if>
MANAGER_OPINION = #{MANAGER_OPINION},
MANAGER_TIME = #{MANAGER_TIME},
STEP_STATUS = #{STEP_STATUS}
where
TRAIN_USERS_ID = #{TRAIN_USERS_ID}
</update>
<update id="approveTerritoriality" parameterType="pd" >
update <include refid="tableName"></include>
set
TERRITORIALITY_STATE = #{TERRITORIALITY_STATE},
<if test="STATUS != null and STATUS != ''">
STATUS = #{STATUS},
</if>
TERRITORIALITY_OPINION = #{TERRITORIALITY_OPINION},
TERRITORIALITY_TIME = #{TERRITORIALITY_TIME},
STEP_STATUS = #{STEP_STATUS}
where
TRAIN_USERS_ID = #{TRAIN_USERS_ID}
</update>
<update id="graduation">
update bus_trainusers a set a.STATUS = #{STATUS} where a.TRAIN_USERS_ID in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>;
</update>
<update id="graduationstudent">
update bus_trainusers a set a.STATUS = #{STATUS} where a.TRAIN_USERS_ID = #{TRAIN_USERS_ID}
</update>
<update id="updateDate" parameterType="pd">
update bus_trainusers a set
<if test="START_DATE != null and START_DATE != ''">
a.START_DATE = #{START_DATE}
</if>
<if test="END_DATE != null and END_DATE != ''">
a.END_DATE = #{END_DATE}
</if>
where a.TRAIN_USERS_ID in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>;
</update>
<!-- 根据培训批次id 获取 这次培训中审批完成的次数 -->
<select id="getApproveCountByGbatchId" parameterType="pd" resultType="pd">
select
count(*),
STATUS
from
bus_trainusers f
where TRAINING_BATCH_ID = #{TRAINING_BATCH_ID}
GROUP BY STATUS
</select>
<!-- 通过USER_ID获取数据 -->
<select id="getPdById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
where
f.TRAIN_USERS_ID = #{TRAIN_USERS_ID}
</select>
<!-- 通过USER_ID获取数据 -->
<select id="getCountByWanchengPingshen" parameterType="pd" resultType="Integer">
select
count(1)
from
<include refid="tableName"></include>
f
where
f.TRAINING_BATCH_ID = #{TRAINING_BATCH_ID}
and (
(f.SUPERVISION_STATE = '1' and f.MANAGER_STATE = '1' and f.TERRITORIALITY_STATE = '1')
or (f.SUPERVISION_STATE = '0' or f.MANAGER_STATE = '0' or f.TERRITORIALITY_STATE = '0'))
</select>
<select id="findinfoByCondition" resultType="com.zcloud.entity.PageData">
select distinct
a.CREATE_TIME,
a.CREATOR,
a.OPERATE_TIME,
a.OPERATOR,
a.ISDELETE,
a.CORPINFO_ID,
a.USER_ID,
a.STATUS,
a.CLASS_MESSAGE_ID,
a.CLASS_INFO_ID,
a.USERNAME,
a.NAME,
a.SEX,
a.CARD_ID,
a.RELEVANT_UNIT_NAME,
a.DEPARTMENT_NAME,
a.PHOTO,
a.PHONE,
a.PERSON_WORK_TYPE,
a.CLASS_NO,
a.TRAIN_USERS_ID
,b.OPENING_TIME,b.VALIDITY_PERIOD_END,
(select f.JOBS_TYPE from `qa-prevention-xgf`.sys_special_user f where f.USER_ID = a.USER_ID order by f.CREATTIME limit 1) as JOBS_TYPE,
(select f.CERTIFICATE from `qa-prevention-xgf`.sys_special_user f where f.USER_ID = a.USER_ID order by f.CREATTIME limit 1) as CERTIFICATE
from `qa-gwj-regulatory`.bus_class_info a
left join `qa-gwj-regulatory`.bus_class_message b on a.CLASS_MESSAGE_ID = b.CLASS_MESSAGE_ID
where a.ISDELETE = '0'
<if test="CLASS_MESSAGE_ID != null and CLASS_MESSAGE_ID != ''">
and a.CLASS_MESSAGE_ID = #{CLASS_MESSAGE_ID}
</if>
<if test="CLASS_INFO_ID != null and CLASS_INFO_ID != ''">
and a.CLASS_INFO_ID = #{CLASS_INFO_ID}
</if>
<if test="USER_ID != null and USER_ID != ''">
and a.USER_ID = #{USER_ID}
</if>
order by CREATE_TIME desc limit 1
</select>
</mapper>

View File

@ -0,0 +1,388 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.xgf.TrainingBatchMapper">
<!--表名 -->
<sql id="tableName">
xgf_training_batch
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
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
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
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
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{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}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
TRAINING_BATCH_ID = #{TRAINING_BATCH_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
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>
<!-- 修改 -->
<update id="audit" parameterType="pd">
update
<include refid="tableName"></include>
set
AUDIT_STATUS = #{AUDIT_STATUS},
<if test="TRAIN_CORP_DEPT != null and TRAIN_CORP_DEPT != ''">
TRAIN_CORP_DEPT = #{TRAIN_CORP_DEPT},
</if>
<if test="TRAIN_CORP_LEADER != null and TRAIN_CORP_LEADER != ''">
TRAIN_CORP_LEADER = #{TRAIN_CORP_LEADER},
</if>
<if test="ENTRUST_TIME != null and ENTRUST_TIME != ''">
ENTRUST_TIME = #{ENTRUST_TIME},
</if>
<if test="AUDIT_TIME != null and AUDIT_TIME != ''">
AUDIT_TIME = #{AUDIT_TIME},
</if>
<if test="VERIFY_TIME != null and VERIFY_TIME != ''">
VERIFY_TIME = #{VERIFY_TIME},
</if>
<if test="AUDIT_DESCR != null and AUDIT_DESCR != ''">
AUDIT_DESCR = #{AUDIT_DESCR},
</if>
<if test="CORP_AUDIT_DESCR != null and CORP_AUDIT_DESCR != ''">
CORP_AUDIT_DESCR = #{CORP_AUDIT_DESCR},
</if>
TRAINING_BATCH_ID = #{TRAINING_BATCH_ID}
where
TRAINING_BATCH_ID = #{TRAINING_BATCH_ID}
</update>
<update id="graduation" parameterType="pd">
update xgf_train_users a set a.STATUS = '2' where a.USER_ID in
<foreach item="item" index="index" collection="users" open="(" separator="," close=")">
#{item}
</foreach>;
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
f.*
from
<include refid="tableName"></include> f
where
f.TRAINING_BATCH_ID = #{TRAINING_BATCH_ID}
</select>
<!-- 列表 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select *
from xgf_training_batch a
where a.IS_DELETE = '0'
and (a.MANAGER_USER_ID = #{pd.USER_ID} or a.SUPERVISION_USER_ID = #{pd.USER_ID} or a.TERRITORIALITY_USER_ID = #{pd.USER_ID})
and a.STEP_STATUS != '3'
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
f.*
from
<include refid="tableName"></include> f
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
TRAINING_BATCH_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 获取编码 -->
<select id="getCode" parameterType="pd" resultType="pd">
SELECT
COUNT(1) as code
FROM <include refid="tableName"></include> f
WHERE f.CREATTIME LIKE CONCAT(#{CREATDATE},'%')
</select>
<select id="batchUserlistPage" parameterType="page" resultType="pd">
select
b.USERNAME,
b.NAME,
b.BELONG_TO_CORP_NAME,
a.TRAIN_USERS_ID,
a.STEP_STATUS,
a.USER_ID,
a.USER_ID as XGF_USER_ID,
a.SUPERVISION_STATE,
a.MANAGER_STATE,
a.TERRITORIALITY_STATE,
a.RESULT_STATUS,
c.SUPERVISION_USER_ID,
c.MANAGER_USER_ID,
c.TERRITORIALITY_USER_ID
from xgf_train_users a
left join xgf_user b on a.USER_ID = b.XGF_USER_ID
left join xgf_training_batch c on a.TRAINING_BATCH_ID = c.TRAINING_BATCH_ID
where a.IS_DELETE = '0'
<if test="pd.TRAINING_BATCH_ID != null and pd.TRAINING_BATCH_ID != ''">
and a.TRAINING_BATCH_ID = #{pd.TRAINING_BATCH_ID}
</if>
</select>
<select id="passUserlistPage" resultType="com.zcloud.entity.PageData">
select distinct su.USERNAME,
su.NAME,
sud.SEX,
su.CARD_ID,
ci.RELEVANT_UNIT_NAME,
od.NAME as DEPARTMENT_NAME,
sud.PHOTO,
sud.PHONE,
ci.CORPINFO_ID,
su.USER_ID,
a.TRAINUSERS_ID,
ssu.JOBS_TYPE as PERSON_WORK_TYPE,
ssu.CERTIFICATE
from xgf_train_users a
left join bus_trainingbatch tb on a.TRAINING_BATCH_ID = tb.TRAINING_BATCH_ID
left join sys_user su on su.USER_ID = a.USER_ID
left join SYS_USER_DETAILS sud on su.USER_ID = sud.USER_ID
left join bus_corp_info ci on ci.CORPINFO_ID = su.CORPINFO_ID
left join oa_department od on od.DEPARTMENT_ID = su.DEPARTMENT_ID
left join (select ssup.USER_ID, ssup. JOBS_TYPE, ssup.CERTIFICATE
from sys_special_user ssup
group by ssup.USER_ID) as ssu on ssu.USER_ID = a.USER_ID
where su.AUDIT_STATE = '2'
and tb.ISDELETE = '0'
AND su.STATUS = '9'
AND (a.STATUS = '1'
or a.STATUS = '2')
and a.SUPERVISION_STATE = 1
and a.MANAGER_STATE = 1
and a.TERRITORIALITY_STATE = 1
order by tb.CREATTIME
</select>
<!-- 通过ID获取数据 -->
<select id="findAndTimeById" parameterType="pd" resultType="pd">
select
f.*,
supUser.USERNAME as SUPERVISION_USER_USERNAME,
supUser.NAME as SUPERVISION_USER_NAME,
supDept.NAME as SUPERVISION_DEPT_NAME,
mangUser.NAME as MANAGER_USER_USERNAME,
mangUser.NAME as MANAGER_USER_NAME,
mangDept.NAME as MANAGER_DEPT_NAME,
rerUser.NAME as ERRITORIALITY_USER_USERNAME,
rerUser.NAME as ERRITORIALITY_USER_NAME,
rerDept.NAME as ERRITORIALITY_DEPT_NAME,
(SELECT MAX( t1.SUPERVISION_TIME ) AS SUPERVISION_TIME FROM xgf_train_users t1 where
t1.TRAINING_BATCH_ID = f.TRAINING_BATCH_ID ) AS SUPERVISION_TIME,
(SELECT MAX( t2.MANAGER_TIME ) AS MANAGER_TIME FROM xgf_train_users t2 where
t2.TRAINING_BATCH_ID = f.TRAINING_BATCH_ID ) AS MANAGER_TIME,
(SELECT MAX( t3.TERRITORIALITY_TIME ) AS TERRITORIALITY_TIME FROM xgf_train_users t3 where
t3.TRAINING_BATCH_ID = f.TRAINING_BATCH_ID ) AS TERRITORIALITY_TIME
from
<include refid="tableName"></include> f
left join vi_user_all supUser on supUser.USER_ID = f.SUPERVISION_USER_ID
left join vi_department_all supDept on supDept.DEPARTMENT_ID = f.SUPERVISION
left join vi_corp_user mangUser on mangUser.USER_ID = f.MANAGER_USER_ID
left join vi_corp_department mangDept on mangDept.DEPARTMENT_ID = f.MANAGER
left join vi_corp_user rerUser on rerUser.USER_ID = f.TERRITORIALITY_USER_ID
left join vi_corp_department rerDept on rerDept.DEPARTMENT_ID = f.TERRITORIALITY
where
f.TRAINING_BATCH_ID = #{TRAINING_BATCH_ID}
</select>
<select id="findByUserId" resultType="com.zcloud.entity.PageData">
select b.MANAGER_DEPARTMENT_NAME,
b.MANAGER_USER_NAME,
a.MANAGER_STATE,
a.MANAGER_OPINION,
b.SUPERVISION_DEPARTMENT_NAME,
b.SUPERVISION_USER_NAME,
a.SUPERVISION_STATE,
a.SUPERVISION_OPINION,
b.TERRITORIALITY_DEPARTMENT_NAME,
b.TERRITORIALITY_USER_NAME,
a.TERRITORIALITY_STATE,
a.TERRITORIALITY_OPINION
from xgf_train_users a
left join xgf_training_batch b on a.TRAINING_BATCH_ID = b.TRAINING_BATCH_ID
where a.IS_DELETE = '0'
and USER_ID = #{USER_ID}
order by b.CREATTIME desc;
</select>
<select id="oldlistPage" resultType="com.zcloud.entity.PageData">
select *
from xgf_training_batch a
where a.IS_DELETE = '0'
and a.CORPINFO_ID = #{pd.CORPINFO_ID}
</select>
</mapper>

View File

@ -0,0 +1,337 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper">
<!--表名 -->
<sql id="tableName">
XGF_USER_DETAILS
</sql>
<!-- 字段 -->
<sql id="Field">
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
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
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
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{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}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
IS_DELETE = '1'
where
XGF_USER_ID = #{XGF_USER_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
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>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
where
f.XFG_USER_DETAILS_ID = #{XFG_USER_DETAILS_ID}
</select>
<!-- 列表 -->
<select id="listPage" parameterType="page" resultType="pd">
select
*
from
<include refid="tableName"></include>
f
where f.IS_DELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and(f.BELONG_TO_CORP_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%'))
</if>
ORDER BY f.CREATED_TIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
*
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
where f.IS_DELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="pd">
update
<include refid="tableName"></include>
set
IS_DELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
XFG_USER_DETAILS_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(根据多选ID查询数据) -->
<select id="listByIds" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
where f.IS_DELETE = '0'
and XFG_USER_DETAILS_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

View File

@ -0,0 +1,312 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.mapper.datasource.xgf.XgfUserMapper">
<!--表名 -->
<sql id="tableName">
XGF_USER
</sql>
<!-- 字段 -->
<sql id="Field">
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
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
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
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{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}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
update
<include refid="tableName"></include>
set
IS_DELETE = '1'
where
XGF_USER_ID = #{XGF_USER_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
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>
<update id="updateStatusByUnflowTrain">
update
<include refid="tableName"></include>
set STATUS = #{STATUS}
where
XGF_USER_ID in (select USER_ID from xgf_train_users bu where bu.TRAINUSERS_ID = #{TRAINUSERS_ID})
</update>
<update id="bantchUpdateStatus">
update
<include refid="tableName"></include>
set STUDY_STATUS = #{STATUS}
where
XGF_USER_ID in
<foreach item="item" index="index" collection="arrayDATA_ids" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<update id="updateStatusByFlowTrain">
update
<include refid="tableName"></include>
set STATUS = #{STATUS}
where
XGF_USER_ID in (select USER_ID from xgf_train_users bu where bu.TRAININGBATCH_ID = #{TRAININGBATCH_ID})
</update>
<update id="graduation">
update xgf_train_users a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>;
</update>
<update id="graduationstudent">
update xgf_train_users a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID = #{TRAINUSERS_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.XGF_USER_ID = #{XGF_USER_ID}
</select>
<!-- 列表 -->
<select id="listPage" parameterType="page" resultType="pd">
select
*
from
<include refid="tableName"></include>
f
where f.IS_DELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
and(f.BELONG_TO_CORP_NAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%'))
</if>
ORDER BY f.CREATE_TIME DESC
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
*
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
where f.IS_DELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="pd">
update
<include refid="tableName"></include>
set
IS_DELETE = '1',
OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME}
where
SPECIALEQUIPMENT_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<!-- 列表(根据多选ID查询数据) -->
<select id="listByIds" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include>
f
where f.IS_DELETE = '0'
and f.XGF_USER_ID in
<foreach item="item" index="index" collection="XGF_USER_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="flowlistPage" resultType="com.zcloud.entity.PageData">
select a.XGF_USER_ID,
a.BELONG_TO_CORP,
a.BELONG_TO_CORP_NAME,
a.USERNAME,
a.NAME,
b.MANAGER_DEPARTMENT_ID,
b.MANAGER_DEPARTMENT_NAME,
b.MAIN_DEPARTMENT_ID,
b.MAIN_DEPARTMENT_NAME
from
xgf_user a
left join xgf_user_details b on a.XGF_USER_ID = b.XGF_USER_ID
where a.IS_DELETE = '0'
<if test="pd.STATUS != null and pd.STATUS != ''">
and a.STATUS = #{pd.STATUS}
</if>
<if test="pd.UN_STUDY_STATUS != null and pd.UN_STUDY_STATUS != ''">
and a.STUDY_STATUS != #{pd.UN_STUDY_STATUS}
</if>
<if test="pd.STUDY_STATUS != null and pd.STUDY_STATUS != ''">
and a.STUDY_STATUS = #{pd.STUDY_STATUS}
</if>
<if test="pd.CORPINFO_ID != '' and pd.CORPINFO_ID != null">
and a.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''">
and (a.USERNAME LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%'))
</if>
<if test="pd.VALID_FLAG != null and pd.VALID_FLAG != ''">
and a.VALID_FLAG = #{pd.VALID_FLAG}
</if>
</select>
<select id="getInfoById" resultType="com.zcloud.entity.PageData">
select a.XGF_USER_ID,
a.ISFLOW,
a.NAME,
b.XGF_USER_DETAILS_ID,
b.XGF_USER_ID,
b.XGF_USER_NAME,
b.BELONG_TO_CORP,
b.BELONG_TO_CORP_NAME,
b.PHONE,
b.CREATE_TIME,
b.DEPART_STATE,
b.IS_DELETE,
b.AGE,
b.HKLOCAL,
b.ADDRESS,
b.DEGREE_OF_EDUCATION,
b.DEGREE_OF_EDUCATION_NAME,
b.CORP_START_DATE,
b.POST_ID,
b.POST_NAME,
b.WORK_SIGN,
b.JOINED_DATE,
b.WORK_DATE,
b.PHOTO,
b.DATE_OF_BIRTH,
b.ISPAY,
b.ISPAY_NUMBER,
b.IS_SAFETY_TELL,
b.IS_SAFETY_TIME,
b.IS_INJURIES_PAY,
b.IS_SIGN_LABOR,
b.SEX,
b.ENTRY_DATE,
b.PERSON_WORK_TYPE,
b.PERSON_WORK_TYPE_NAME,
b.NATIONALITY,
b.NATIONALITY_NAME,
b.POLITICAL_TIME,
b.POLITICAL_STATUS,
b.POLITICAL_STATUS_NAME,
b.IS_INJURIES_PAY_TIME,
b.IS_LEVEL_THREE,
b.IS_BODY_ADAPT,
b.IS_SPECIAL_JOB,
b.CORPINFO_ID,
b.MANAGER_DEPARTMENT_ID,
b.MANAGER_DEPARTMENT_NAME,
b.CARD_ID,
b.DEPARTMENT_ID,
b.DEPARTMENT_NAME,
b.IS_SOCIAL,
b.IS_BF,
b.SOCIAL_NUMBER,
b.zzName,
b.POLITICAL_TIME
from xgf_user a
left join xgf_user_details b on a.XGF_USER_ID = b.XGF_USER_ID
where a.IS_DELETE = '0'
<if test="XGF_USER_ID != null and XGF_USER_ID != ''">
and a.XGF_USER_ID = #{XGF_USER_ID}
</if>
</select>
<select id="findRecordList" resultType="com.zcloud.entity.PageData">
select rf.*,
rcm.CLASS_NAME,
rcm.OPENING_TIME,
sdp.NAME as PLACE_NAME,
sdt.NAME as TRAINING_TYPE_NAME,
rcm.VALIDITY_PERIOD_START,
rcm.VALIDITY_PERIOD_END
from `qa-gwj-regulatory`.bus_class_info rf
left join `qa-gwj-regulatory`.bus_class_message rcm on rf.CLASS_MESSAGE_ID = rcm.CLASS_MESSAGE_ID
left join sys_dictionaries sdp on sdp.DICTIONARIES_ID = rcm.PLACE
left join sys_dictionaries sdt on sdt.DICTIONARIES_ID = rcm.TRAINING_TYPE
where rf.USER_ID = #{USER_ID} and rf.ISDELETE = '0'
order by rf.CREATE_TIME desc
</select>
</mapper>