相关方需求变革
parent
cfb4c2dd8e
commit
6d49773242
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,400 @@
|
|||
package com.zcloud.controller.xgf;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.system.UsersService;
|
||||
import com.zcloud.service.xgf.TrainingBatchService;
|
||||
import com.zcloud.util.*;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 说明:培训批次管理
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-05-08
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/trainingbatch")
|
||||
public class TrainingBatchController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TrainingBatchService trainingbatchService;
|
||||
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
|
||||
@Value("${prevention.api.url}")
|
||||
private String preventionUrl;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
@RequiresPermissions("trainingbatch:add")
|
||||
@ResponseBody
|
||||
public Object add() throws Exception {
|
||||
Map<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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param out
|
||||
* @throws Exception
|
||||
*/
|
||||
@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列表
|
||||
for (PageData x : varList) {
|
||||
PageData condition = new PageData();
|
||||
condition.put("USER_ID", x.getString("SUPERVISION_USER_ID"));
|
||||
Map result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("SUPERVISION_USER_NAME", result.get("NAME"));
|
||||
}
|
||||
condition.clear();
|
||||
condition.put("DEPARTMENT_ID", x.getString("SUPERVISION"));
|
||||
result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("SUPERVISION_DEPT_NAME", result.get("NAME"));
|
||||
}
|
||||
|
||||
condition.clear();
|
||||
condition.put("USER_ID", x.getString("MANAGER_USER_ID"));
|
||||
result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("MANAGER_USER_NAME", result.get("NAME"));
|
||||
}
|
||||
condition.clear();
|
||||
condition.put("DEPARTMENT_ID", x.getString("MANAGER"));
|
||||
result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("MANAGER_DEPT_NAME", result.get("NAME"));
|
||||
}
|
||||
|
||||
condition.clear();
|
||||
condition.put("USER_ID", x.getString("TERRITORIALITY_USER_ID"));
|
||||
result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("ERRITORIALITY_USER_NAME", result.get("NAME"));
|
||||
}
|
||||
condition.clear();
|
||||
condition.put("DEPARTMENT_ID", x.getString("TERRITORIALITY"));
|
||||
result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("ERRITORIALITY_DEPT_NAME", result.get("NAME"));
|
||||
}
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/userList")
|
||||
@RequiresPermissions("trainingbatch:list")
|
||||
@ResponseBody
|
||||
public Object userList(Page page) throws Exception {
|
||||
Map<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 = usersService.flowlistPage(page); //列出TrainingBatch列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/batchUserList")
|
||||
@RequiresPermissions("trainingbatch:list")
|
||||
@ResponseBody
|
||||
public Object batchUserList(Page page) throws Exception {
|
||||
Map<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列表
|
||||
|
||||
for (PageData x : varList) {
|
||||
PageData condition = new PageData();
|
||||
condition.put("USER_ID", x.getString("SUPERVISION_USER_ID"));
|
||||
Map result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("SUPERVISION_USER_NAME", result.get("NAME"));
|
||||
}
|
||||
condition.clear();
|
||||
condition.put("DEPARTMENT_ID", x.getString("SUPERVISION"));
|
||||
result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("SUPERVISION_DEPT_NAME", result.get("NAME"));
|
||||
}
|
||||
|
||||
condition.clear();
|
||||
condition.put("USER_ID", x.getString("MANAGER_USER_ID"));
|
||||
result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("MANAGER_USER_NAME", result.get("NAME"));
|
||||
}
|
||||
condition.clear();
|
||||
condition.put("DEPARTMENT_ID", x.getString("MANAGER"));
|
||||
result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("MANAGER_DEPT_NAME", result.get("NAME"));
|
||||
}
|
||||
|
||||
condition.clear();
|
||||
condition.put("USER_ID", x.getString("TERRITORIALITY_USER_ID"));
|
||||
result = HttpClientUtil.doPost(preventionUrl + "/user/getUserInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("ERRITORIALITY_USER_NAME", result.get("NAME"));
|
||||
}
|
||||
condition.clear();
|
||||
condition.put("DEPARTMENT_ID", x.getString("TERRITORIALITY"));
|
||||
result = HttpClientUtil.doPost(preventionUrl + "/department/getDepartmentInfo", condition);
|
||||
if (result != null) {
|
||||
x.put("ERRITORIALITY_DEPT_NAME", result.get("NAME"));
|
||||
}
|
||||
}
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去修改页面获取数据
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/goEdit")
|
||||
@RequiresPermissions("trainingbatch:edit")
|
||||
@ResponseBody
|
||||
public Object goEdit() throws Exception {
|
||||
Map<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>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if (Tools.notEmpty(DATA_IDS)) {
|
||||
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
||||
trainingbatchService.deleteAll(ArrayDATA_IDS);
|
||||
errInfo = "success";
|
||||
} else {
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出到excel
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/excel")
|
||||
@RequiresPermissions("toExcel")
|
||||
public ModelAndView exportExcel() throws Exception {
|
||||
ModelAndView mv = new ModelAndView();
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
Map<String, Object> dataMap = new HashMap<String, Object>();
|
||||
List<String> titles = new ArrayList<String>();
|
||||
titles.add("创建人"); //1
|
||||
titles.add("创建时间"); //2
|
||||
titles.add("修改人"); //3
|
||||
titles.add("修改时间"); //4
|
||||
titles.add("是否删除"); //5
|
||||
titles.add("批次名称"); //6
|
||||
titles.add("所属企业"); //7
|
||||
titles.add("培训人数"); //8
|
||||
titles.add("培训企业"); //9
|
||||
dataMap.put("titles", titles);
|
||||
List<PageData> varOList = trainingbatchService.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("CREATOR")); //1
|
||||
vpd.put("var2", varOList.get(i).getString("CREATTIME")); //2
|
||||
vpd.put("var3", varOList.get(i).getString("OPERATOR")); //3
|
||||
vpd.put("var4", varOList.get(i).getString("OPERATTIME")); //4
|
||||
vpd.put("var5", varOList.get(i).get("ISDELETE").toString()); //5
|
||||
vpd.put("var6", varOList.get(i).getString("BATCH_NAME")); //6
|
||||
vpd.put("var7", varOList.get(i).getString("CORPINFO_ID")); //7
|
||||
vpd.put("var8", varOList.get(i).get("USER_COUNT").toString()); //8
|
||||
vpd.put("var9", varOList.get(i).getString("TRAIN_CORP_DEPT")); //9
|
||||
varList.add(vpd);
|
||||
}
|
||||
dataMap.put("varList", varList);
|
||||
ObjectExcelView erv = new ObjectExcelView();
|
||||
mv = new ModelAndView(erv, dataMap);
|
||||
return mv;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/sendMessage")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
public Object sendMessage() throws Exception {
|
||||
PageData request = this.getPageData();
|
||||
List<PageData> list = Warden.getList(request.getString("list"));
|
||||
List<PageData> userList = new ArrayList<>();
|
||||
for (PageData x : list) {
|
||||
PageData entity = usersService.getById(x);
|
||||
Map<Object, Object> map = new HashMap<>(entity);
|
||||
for (Object key : map.keySet()) {
|
||||
map.putIfAbsent(key, "");
|
||||
}
|
||||
entity.put("CORPINFO_ID", request.get("corp_id"));
|
||||
userList.add(entity);
|
||||
// 更新用户信息
|
||||
PageData info = usersService.findById(entity);
|
||||
info.put("EMPLOYER", request.get("corp_id"));
|
||||
info.put("EMPLOYER_NAME", request.get("corp_name"));
|
||||
info.put("EMPLOY_FLAG", "1");
|
||||
usersService.editUser(info);
|
||||
}
|
||||
|
||||
PageData info = new PageData();
|
||||
info.put("infoList", JSONObject.toJSON(userList));
|
||||
HttpClientUtil.doPost(preventionUrl + "/xfgUser/synchronizationUserInfo", info);
|
||||
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
response.put("result", "success");
|
||||
return response;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/submitApplication")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
public Object submitApplication() throws Exception{
|
||||
PageData request = this.getPageData();
|
||||
|
||||
PageData info = new PageData();
|
||||
info.put("xgf_user_ids",request.get("xgf_user_ids"));
|
||||
HttpClientUtil.doPost(preventionUrl + "/xfgUser/approvalApplication", info);
|
||||
|
||||
List<String> list = Arrays.asList(request.getString("xgf_user_ids").split(","));
|
||||
PageData condition = new PageData();
|
||||
for (String x : list) {
|
||||
condition.put("USER_ID", x);
|
||||
PageData entity = usersService.findById(condition);
|
||||
entity.put("EMPLOY_FLAG", "2");
|
||||
usersService.editUser(entity);
|
||||
}
|
||||
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
response.put("result", "success");
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.zcloud.mapper.datasource.xgf;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:培训批次管理
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-05-08
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TrainingBatchMapper{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
void audit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<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);
|
||||
}
|
||||
|
|
@ -54,4 +54,14 @@ public interface XgfUserMapper {
|
|||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listByIds(PageData pd);
|
||||
|
||||
void updateStatusByUnflowTrain(PageData pd);
|
||||
|
||||
void bantchUpdateStatus(int i, String[] userids);
|
||||
|
||||
void updateStatusByFlowTrain(PageData pd);
|
||||
|
||||
void graduation(PageData condition);
|
||||
|
||||
void graduationstudent(PageData condition);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
package com.zcloud.service.xgf;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:培训学员
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-05-08
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TrainUsersService{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**固定服务人员培训管理列表
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<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 Integer approveUser(PageData pd)throws Exception;
|
||||
List<PageData> findinfoByCondition(PageData condition) throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package com.zcloud.service.xgf;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:培训批次管理
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-05-08
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TrainingBatchService{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
public void unflowTrain(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**审核
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void audit(PageData pd)throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<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;
|
||||
}
|
||||
|
|
@ -0,0 +1,305 @@
|
|||
package com.zcloud.service.xgf.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.system.UsersMapper;
|
||||
import com.zcloud.mapper.datasource.xgf.*;
|
||||
import com.zcloud.service.xgf.TrainUsersService;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.Tools;
|
||||
import com.zcloud.util.Warden;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:培训学员
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-05-08
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class TrainUsersServiceImpl implements TrainUsersService {
|
||||
|
||||
@Resource
|
||||
private TrainUsersMapper trainusersMapper;
|
||||
|
||||
@Resource
|
||||
private TrainingBatchMapper trainingBatchMapper;
|
||||
@Resource
|
||||
private XgfUserMapper xgfUserMapper;
|
||||
|
||||
@Resource
|
||||
private FlowDetailMapper flowDetailMapper;
|
||||
|
||||
@Resource
|
||||
private FlowMapper flowMapper;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd) throws Exception {
|
||||
trainusersMapper.save(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd) throws Exception {
|
||||
trainusersMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd) throws Exception {
|
||||
trainusersMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<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 Integer approveUser(PageData pd) throws Exception {
|
||||
String type = pd.getString("type"); //1、集团单位,2、企业端,3、监管端
|
||||
String TRAINUSERS_ID = pd.getString("TRAINUSERS_ID"); //培训批次 详情id
|
||||
String STATE = pd.getString("IS_STATE"); // 审批状态 0:不合格;1:合格;
|
||||
|
||||
String OPINION = pd.getString("OPINION"); // 审批意见
|
||||
Integer userCount = Integer.parseInt(pd.getString("USER_COUNT")); // 批次的人数
|
||||
String[] userids = new String[1]; // 被审批人
|
||||
userids[0] = pd.getString("USER_ID");
|
||||
PageData trainusersPd = trainusersMapper.getPdById(pd); //培训 详情信息
|
||||
PageData appPd = new PageData();
|
||||
appPd.put("TRAINUSERS_ID", trainusersPd.getString("TRAINUSERS_ID"));
|
||||
appPd.put("STATUS", "1");
|
||||
/*2023-12-06 liu jun 需求便跟*/
|
||||
PageData batch = trainingBatchMapper.findById(pd);
|
||||
// 如果
|
||||
if ("0".equals(STATE)) {
|
||||
appPd.put("STATUS", "-1");
|
||||
userids[0] = pd.getString("USER_ID");
|
||||
xgfUserMapper.bantchUpdateStatus(0, userids);
|
||||
}
|
||||
if (trainusersPd.get("STEP_STATUS") == null || trainusersPd.get("STEP_STATUS").equals("0")) {
|
||||
if (pd.getString("loginUserId").equals(batch.getString("TERRITORIALITY_USER_ID"))) {
|
||||
appPd.put("TERRITORIALITY_STATE", STATE);
|
||||
appPd.put("TERRITORIALITY_OPINION", OPINION);
|
||||
appPd.put("TERRITORIALITY_TIME", DateUtil.getTime());
|
||||
appPd.put("STEP_STATUS", "1");
|
||||
trainusersMapper.approveTerritoriality(appPd);
|
||||
} else {
|
||||
throw new RuntimeException("当前用户不是集团单位指定审批人,无法进行审批");
|
||||
}
|
||||
}
|
||||
if (trainusersPd.get("STEP_STATUS") != null && trainusersPd.get("STEP_STATUS").equals("1")) {
|
||||
if (pd.getString("loginUserId").equals(batch.getString("MANAGER_USER_ID"))) {
|
||||
appPd.put("MANAGER_STATE", STATE);
|
||||
appPd.put("MANAGER_OPINION", OPINION);
|
||||
appPd.put("MANAGER_TIME", DateUtil.getTime());
|
||||
appPd.put("STEP_STATUS", "2");
|
||||
trainusersMapper.approveManager(appPd);
|
||||
} else {
|
||||
throw new RuntimeException("当前用户不是股份主管部门指定审批人,无法进行审批");
|
||||
}
|
||||
}
|
||||
if (trainusersPd.get("STEP_STATUS") != null && trainusersPd.get("STEP_STATUS").equals("2")) {
|
||||
if (pd.getString("loginUserId").equals(batch.getString("SUPERVISION_USER_ID"))) {
|
||||
appPd.put("SUPERVISION_STATE", STATE);
|
||||
appPd.put("SUPERVISION_OPINION", OPINION);
|
||||
appPd.put("SUPERVISION_TIME", DateUtil.getTime());
|
||||
appPd.put("STEP_STATUS", "3");
|
||||
trainusersMapper.approveSupervision(appPd);
|
||||
} else {
|
||||
throw new RuntimeException("当前用户不是股份安监部门,无法进行审批");
|
||||
}
|
||||
}
|
||||
|
||||
/** 如果审批全部通过 */
|
||||
Integer stateCountInt = 0; //审批了几次, 如果是审批了3次.这个人审批完成
|
||||
Integer stateTongguoInt = 0; //审批通过次数
|
||||
String sate1 = trainusersPd.getString("SUPERVISION_STATE");
|
||||
String sate2 = trainusersPd.getString("MANAGER_STATE");
|
||||
String sate3 = trainusersPd.getString("TERRITORIALITY_STATE");
|
||||
if (!Tools.isEmpty(sate1)) { //如果有审批状态 就是审批过的数据
|
||||
stateCountInt++;
|
||||
}
|
||||
if (!Tools.isEmpty(sate2)) { //如果有审批状态 就是审批过的数据
|
||||
stateCountInt++;
|
||||
}
|
||||
if (!Tools.isEmpty(sate3)) { //如果有审批状态 就是审批过的数据
|
||||
stateCountInt++;
|
||||
}
|
||||
if ("1".equals(sate1)) {
|
||||
stateTongguoInt++;
|
||||
}
|
||||
if ("1".equals(sate2)) {
|
||||
stateTongguoInt++;
|
||||
}
|
||||
if ("1".equals(sate3)) {
|
||||
stateTongguoInt++;
|
||||
}
|
||||
|
||||
//如果其中一个人打回,则结束审批流程
|
||||
if ("0".equals(STATE)) {
|
||||
stateCountInt = 3;
|
||||
}
|
||||
if (3 == stateCountInt) { //这个人的审批全部
|
||||
PageData statePd = new PageData();
|
||||
statePd.put("TRAINUSERS_ID", TRAINUSERS_ID);
|
||||
String STATUS = "-1"; //培训状态0未培训1培训中2培训通过-1培训未通过
|
||||
if (3 == stateTongguoInt) {
|
||||
STATUS = "2";
|
||||
statePd.put("STATUS", STATUS);
|
||||
trainusersMapper.updateStatus(statePd);
|
||||
}
|
||||
}
|
||||
// 这个批次全部审批完成
|
||||
Integer wanchengPingshen = trainusersMapper.getCountByWanchengPingshen(trainusersPd);
|
||||
|
||||
if (wanchengPingshen == userCount) { //已经审批的数据量 和 批次的人数一致的时候,修改批次的状态
|
||||
PageData trainingBatchPd = trainingBatchMapper.findById(trainusersPd);
|
||||
trainingBatchPd.put("AUDIT_STATUS", "2"); //业务修改 ,现在只有 2培训中 3培训完成
|
||||
trainingBatchMapper.edit(trainingBatchPd);
|
||||
}
|
||||
|
||||
/*保存审批流*/
|
||||
PageData condition = new PageData();
|
||||
condition.put("FOREIGN_KEY", trainusersPd.getString("TRAININGBATCH_ID"));
|
||||
PageData flow = flowMapper.findByCondition(condition);
|
||||
if (flow == null) {
|
||||
System.out.println("历史数据======不做处理");
|
||||
} else {
|
||||
condition.clear();
|
||||
condition.put("FLOW_ID", flow.getString("FLOW_ID"));
|
||||
condition.put("FOREIGN_KEY", trainusersPd.getString("TRAINUSERS_ID"));
|
||||
condition.put("STEP_FLAG", "1");
|
||||
PageData step = flowDetailMapper.selectOne(condition);
|
||||
if (step == null) {
|
||||
condition.clear();
|
||||
condition.put("FLOW_ID", flow.getString("FLOW_ID"));
|
||||
condition.put("PARENT_ID", "0");
|
||||
step = flowDetailMapper.selectOne(condition);
|
||||
}
|
||||
step.put("STEP_FLAG", "0");
|
||||
flowDetailMapper.edit(step);
|
||||
|
||||
PageData nextStep = new PageData();
|
||||
nextStep.put("FLOW_DETAIL_ID", Warden.get32UUID());
|
||||
nextStep.put("FLOW_ID", flow.getString("FLOW_ID"));
|
||||
nextStep.put("STEP_FLAG", "1");
|
||||
nextStep.put("PARENT_ID", step.getString("FLOW_DETAIL_ID"));
|
||||
nextStep.put("FOREIGN_KEY", trainusersPd.getString("TRAINUSERS_ID"));
|
||||
nextStep.put("STEP_NAME", "培训审核");
|
||||
nextStep.put("SORT", (Integer) step.get("SORT") + 1);
|
||||
nextStep.put("CREATE_TIME", DateUtil.date2Str(new Date()));
|
||||
nextStep.put("APPROVER_ID", pd.getString("APPROVER_ID"));
|
||||
nextStep.put("APPROVER_NAME", pd.getString("APPROVER_NAME"));
|
||||
nextStep.put("APPROVER_OPINION", OPINION);
|
||||
nextStep.put("APPROVER_TIME", DateUtil.getTime());
|
||||
nextStep.put("APPROVER_CORPINFO_ID", pd.getString("APPROVER_CORPINFO_ID"));
|
||||
nextStep.put("APPROVER_CORPINFO_NAME", pd.getString("APPROVER_CORPINFO_NAME"));
|
||||
nextStep.put("PASS_FLAG", STATE);
|
||||
if (3 == stateCountInt) {
|
||||
nextStep.put("IS_END", "1");
|
||||
} else {
|
||||
nextStep.put("IS_END", "0");
|
||||
}
|
||||
nextStep.put("ISDELETE", "0");
|
||||
nextStep.put("FOREIGN_KEY", trainusersPd.getString("TRAINUSERS_ID"));
|
||||
flowDetailMapper.save(nextStep);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PageData> findinfoByCondition(PageData condition) throws Exception {
|
||||
return trainusersMapper.findinfoByCondition(condition);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,341 @@
|
|||
package com.zcloud.service.xgf.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.system.UsersMapper;
|
||||
import com.zcloud.mapper.datasource.xgf.*;
|
||||
import com.zcloud.service.xgf.TrainingBatchService;
|
||||
import com.zcloud.util.*;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 说明:培训批次管理
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-05-08
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class TrainingBatchServiceImpl implements TrainingBatchService {
|
||||
|
||||
@Resource
|
||||
private TrainingBatchMapper trainingbatchMapper;
|
||||
|
||||
@Resource
|
||||
private TrainUsersMapper trainUsersMapper;
|
||||
|
||||
@Resource
|
||||
private XgfUserMapper xgfUserMapper;
|
||||
|
||||
@Resource
|
||||
private FlowMapper flowMapper;
|
||||
|
||||
@Resource
|
||||
private FlowDetailMapper flowDetailMapper;
|
||||
|
||||
@Value("${prevention.api.url}")
|
||||
private String preventionUrl;
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception{
|
||||
/* 保存主题信息 */
|
||||
String batch_id=UuidUtil.get32UUID();
|
||||
String train_area=pd.getString("TRAIN_AREA");
|
||||
pd.put("TRAININGBATCH_ID", batch_id); //主键
|
||||
pd.put("CREATOR", Jurisdiction.getUsername()); //添加人
|
||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人
|
||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
pd.put("ISDELETE", 0); //是否删除 1-是 0-否
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
DecimalFormat dft=new DecimalFormat("00");
|
||||
int year = calendar.get(Calendar.YEAR);
|
||||
String month = dft.format(calendar.get(Calendar.MONTH) + 1);
|
||||
pd.put("CREATDATE",year + "-" + month);
|
||||
PageData cpd = trainingbatchMapper.getCode(pd); //根据ID读取
|
||||
String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString())+1));
|
||||
pd.put("BATCH_NAME",code);
|
||||
|
||||
trainingbatchMapper.save(pd);
|
||||
|
||||
String ArrayDATA_IDS[] = pd.getString("users").split(",");
|
||||
Arrays.asList(ArrayDATA_IDS).forEach(id -> {
|
||||
PageData user = new PageData();
|
||||
user.put("TRAINUSERS_ID", UuidUtil.get32UUID());
|
||||
user.put("TRAININGBATCH_ID", batch_id);
|
||||
user.put("USER_ID", id);
|
||||
user.put("TRAIN_AREA", train_area);
|
||||
user.put("STATUS", 0);
|
||||
user.put("SUPERVISION_STATE", 9);
|
||||
user.put("MANAGER_STATE", 9);
|
||||
user.put("TERRITORIALITY_STATE", 9);
|
||||
user.put("STEP_STATUS", "0");
|
||||
trainUsersMapper.save(user);
|
||||
});
|
||||
xgfUserMapper.bantchUpdateStatus(9,ArrayDATA_IDS);
|
||||
|
||||
/* 保存审批流程信息 */
|
||||
PageData flow = new PageData();
|
||||
flow.put("FLOW_ID", Warden.get32UUID());
|
||||
flow.put("TYPE", "0");
|
||||
flow.put("CREATOR",Jurisdiction.getUSER_ID());
|
||||
flow.put("CREATOR_NAME",Jurisdiction.getName());
|
||||
flow.put("CREATOR_TIME", DateUtil.getTime());
|
||||
flow.put("VALID_FLAG", "1");
|
||||
flow.put("FOREIGN_KEY",pd.getString("TRAININGBATCH_ID"));
|
||||
flow.put("ISDELETE", "0");
|
||||
flowMapper.save(flow);
|
||||
/* 保存审批流程明细信息 */
|
||||
PageData flowDetail = new PageData();
|
||||
flowDetail.put("FLOW_DETAIL_ID", Warden.get32UUID());
|
||||
flowDetail.put("FLOW_ID", flow.getString("FLOW_ID"));
|
||||
flowDetail.put("STEP_FLAG", "1");
|
||||
flowDetail.put("SORT",0);
|
||||
flowDetail.put("APPROVER_ID",Jurisdiction.getUSER_ID());
|
||||
flowDetail.put("APPROVER_NAME",Jurisdiction.getName());
|
||||
flowDetail.put("APPROVER_TIME", DateUtil.getTime());
|
||||
flowDetail.put("APPROVER_CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
|
||||
// TODO 未完成
|
||||
flowDetail.put("APPROVER_CORPINFO_NAME","");
|
||||
flowDetail.put("PASS_FLAG", "1");
|
||||
flowDetail.put("END_FLAG", "0");
|
||||
flowDetail.put("ISDELETE", "0");
|
||||
flowDetail.put("PARENT_ID","0");
|
||||
flowDetailMapper.save(flowDetail);
|
||||
}
|
||||
|
||||
/**固定人员培训
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void unflowTrain(PageData pd)throws Exception{
|
||||
PageData trainBatch = new PageData();
|
||||
String batch_id = UuidUtil.get32UUID();
|
||||
trainBatch.put("TRAININGBATCH_ID", batch_id); //主键
|
||||
trainBatch.put("CREATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //添加人
|
||||
trainBatch.put("CREATTIME", DateUtil.date2Str(new Date())); //添加时间
|
||||
trainBatch.put("OPERATOR", pd.getString("TRAIN_CORP_LEADER_NAME")); //修改人
|
||||
trainBatch.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
|
||||
trainBatch.put("ISDELETE", 0); //是否删除 1-是 0-否
|
||||
trainBatch.put("TYPE", 1);
|
||||
trainBatch.put("USER_COUNT", pd.getString("USER_COUNT"));
|
||||
trainBatch.put("AUDIT_STATUS", 0);
|
||||
trainBatch.put("TRAIN_CORP_DEPT", pd.getString("TRAIN_CORP_DEPT"));
|
||||
trainBatch.put("TRAIN_CORP_LEADER", pd.getString("TRAIN_CORP_LEADER"));
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
DecimalFormat dft = new DecimalFormat("00");
|
||||
int year = calendar.get(Calendar.YEAR);
|
||||
String month = dft.format(calendar.get(Calendar.MONTH) + 1);
|
||||
trainBatch.put("CREATDATE", year + "-" + month);
|
||||
PageData cpd = trainingbatchMapper.getCode(trainBatch); //根据ID读取
|
||||
String code = year + "-" + month + "-" + dft.format((Integer.parseInt(cpd.get("code").toString()) + 1));
|
||||
trainBatch.put("BATCH_NAME", code);
|
||||
|
||||
trainingbatchMapper.save(trainBatch);
|
||||
trainBatch.put("AUDIT_STATUS", "2");
|
||||
this.audit(trainBatch);
|
||||
|
||||
String ArrayDATA_IDS[] = pd.getString("users").split(",");
|
||||
Arrays.asList(ArrayDATA_IDS).forEach(id -> {
|
||||
PageData user = new PageData();
|
||||
user.put("TRAINUSERS_ID", UuidUtil.get32UUID());
|
||||
user.put("TRAININGBATCH_ID", batch_id);
|
||||
user.put("USER_ID", id);
|
||||
user.put("TRAIN_CORPINFO_ID", pd.getString("FIRST_PARTY_ID"));
|
||||
user.put("STATUS", 1);
|
||||
user.put("START_DATE", DateUtil.date2Str(new Date()));
|
||||
user.put("SUPERVISION_STATE", 9);
|
||||
user.put("MANAGER_STATE", 9);
|
||||
user.put("TERRITORIALITY_STATE", 9);
|
||||
user.put("STEP_STATUS", "0");
|
||||
trainUsersMapper.save(user);
|
||||
});
|
||||
xgfUserMapper.bantchUpdateStatus(1,ArrayDATA_IDS);
|
||||
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception{
|
||||
trainingbatchMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception{
|
||||
trainingbatchMapper.edit(pd);
|
||||
}
|
||||
|
||||
public void audit(PageData pd)throws Exception{
|
||||
if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == -1){
|
||||
pd.put("STATUS",0);
|
||||
pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date()));
|
||||
xgfUserMapper.updateStatusByFlowTrain(pd);
|
||||
trainingbatchMapper.audit(pd);
|
||||
}else if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == 2){
|
||||
pd.put("STATUS",1);
|
||||
pd.put("START_DATE",DateUtil.date2Str(new Date()));
|
||||
pd.put("AUDIT_TIME", DateUtil.date2Str(new Date()));
|
||||
xgfUserMapper.updateStatusByFlowTrain(pd);
|
||||
trainUsersMapper.updateStatusByFlowTrain(pd);
|
||||
trainingbatchMapper.audit(pd);
|
||||
}else if(Integer.parseInt(pd.getString("AUDIT_STATUS")) == 3){
|
||||
pd.put("STATUS",2);
|
||||
pd.put("END_DATE",DateUtil.date2Str(new Date()));
|
||||
pd.put("VERIFY_TIME",DateUtil.date2Str(new Date()));
|
||||
xgfUserMapper.updateStatusByFlowTrain(pd);
|
||||
trainUsersMapper.updateStatusByFlowTrain(pd);
|
||||
trainingbatchMapper.audit(pd);
|
||||
}else{
|
||||
pd.put("ENTRUST_TIME", DateUtil.date2Str(new Date()));
|
||||
trainingbatchMapper.audit(pd);
|
||||
}
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<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("TRAINUSERS_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("TRAINUSERS_ID", info.getString("TRAINUSERS_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("TRAINUSERS_ID")).collect(Collectors.toList()));
|
||||
if (StringUtils.isNotEmpty(info.getString("START_DATE"))){
|
||||
condition.put("START_DATE",DateUtil.getTime());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(info.getString("END_DATE"))){
|
||||
condition.put("END_DATE",DateUtil.getTime());
|
||||
}
|
||||
trainUsersMapper.updateDate(condition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveFlow(PageData request) throws Exception {
|
||||
/* 保存审批流程明细信息 */
|
||||
PageData condition = new PageData();
|
||||
condition.put("FLOW_ID", request.getString("FLOW_ID"));
|
||||
condition.put("STEP_FLAG", "1");
|
||||
PageData flow = flowDetailMapper.selectOne(condition);
|
||||
flow.put("STEP_FLAG", "0");
|
||||
flowDetailMapper.edit(flow);
|
||||
PageData next_flow = new PageData();
|
||||
next_flow.put("FLOW_DETAIL_ID", Warden.get32UUID());
|
||||
next_flow.put("FLOW_ID", flow.getString("FLOW_ID"));
|
||||
next_flow.put("STEP_FLAG", "1");
|
||||
next_flow.put("SORT",(Integer)flow.get("SORT")+1);
|
||||
next_flow.put("APPROVER_ID",request.get("APPROVER_ID"));
|
||||
next_flow.put("APPROVER_NAME",request.get("APPROVER_NAME"));
|
||||
next_flow.put("APPROVER_TIME", DateUtil.getTime());
|
||||
next_flow.put("APPROVER_CORPINFO_ID",request.get("APPROVER_CORPINFO_ID"));
|
||||
next_flow.put("APPROVER_CORPINFO_NAME",request.get("APPROVER_CORPINFO_NAME"));
|
||||
next_flow.put("PASS_FLAG", "1");
|
||||
next_flow.put("END_FLAG", "0");
|
||||
next_flow.put("ISDELETE", "0");
|
||||
next_flow.put("PARENT_ID",flow.getString("FLOW_DETAIL_ID"));
|
||||
flowDetailMapper.save(next_flow);
|
||||
}
|
||||
}
|
||||
|
|
@ -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.train.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>
|
|
@ -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>
|
|
@ -0,0 +1,482 @@
|
|||
<?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">
|
||||
BUS_TRAINUSERS
|
||||
</sql>
|
||||
|
||||
<!--数据字典表名 -->
|
||||
<sql id="dicTableName">
|
||||
SYS_DICTIONARIES
|
||||
</sql>
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
f.TRAININGBATCH_ID,
|
||||
f.USER_ID,
|
||||
f.START_DATE,
|
||||
f.END_DATE,
|
||||
f.STATUS,
|
||||
f.TRAIN_CORPINFO_ID,
|
||||
f.TRAIN_AREA,
|
||||
f.SUPERVISION_STATE,
|
||||
f.SUPERVISION_OPINION,
|
||||
f.SUPERVISION_TIME,
|
||||
f.MANAGER_STATE,
|
||||
f.MANAGER_OPINION,
|
||||
f.MANAGER_TIME,
|
||||
f.TERRITORIALITY_STATE,
|
||||
f.TERRITORIALITY_OPINION,
|
||||
f.TERRITORIALITY_TIME,
|
||||
f.TRAINUSERS_ID,
|
||||
f.STEP_STATUS
|
||||
</sql>
|
||||
|
||||
<!-- 字段用于新增 -->
|
||||
<sql id="Field2">
|
||||
TRAININGBATCH_ID,
|
||||
USER_ID,
|
||||
START_DATE,
|
||||
END_DATE,
|
||||
STATUS,
|
||||
TRAIN_CORPINFO_ID,
|
||||
TRAIN_AREA,
|
||||
SUPERVISION_STATE,
|
||||
SUPERVISION_OPINION,
|
||||
SUPERVISION_TIME,
|
||||
MANAGER_STATE,
|
||||
MANAGER_OPINION,
|
||||
MANAGER_TIME,
|
||||
TERRITORIALITY_STATE,
|
||||
TERRITORIALITY_OPINION,
|
||||
TERRITORIALITY_TIME,
|
||||
TRAINUSERS_ID,
|
||||
STEP_STATUS
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
<sql id="FieldValue">
|
||||
#{TRAININGBATCH_ID},
|
||||
#{USER_ID},
|
||||
#{START_DATE},
|
||||
#{END_DATE},
|
||||
#{STATUS},
|
||||
#{TRAIN_CORPINFO_ID},
|
||||
#{TRAIN_AREA},
|
||||
#{SUPERVISION_STATE},
|
||||
#{SUPERVISION_OPINION},
|
||||
#{SUPERVISION_TINE},
|
||||
#{MANAGER_STATE},
|
||||
#{MANAGER_OPINION},
|
||||
#{MANAGER_TIME},
|
||||
#{TERRITORIALITY_STATE},
|
||||
#{TERRITORIALITY_OPINION},
|
||||
#{TERRITORIALITY_TIME},
|
||||
#{TRAINUSERS_ID},
|
||||
#{STEP_STATUS}
|
||||
</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
|
||||
TRAINUSERS_ID = #{TRAINUSERS_ID}
|
||||
</delete>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="edit" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
TRAININGBATCH_ID = #{TRAININGBATCH_ID},
|
||||
USER_ID = #{USER_ID},
|
||||
START_DATE = #{START_DATE},
|
||||
END_DATE = #{END_DATE},
|
||||
STATUS = #{STATUS},
|
||||
TRAIN_AREA = #{TRAIN_AREA},
|
||||
STEP_STATUS = #{STEP_STATUS},
|
||||
TRAINUSERS_ID = TRAINUSERS_ID
|
||||
where
|
||||
TRAINUSERS_ID = #{TRAINUSERS_ID}
|
||||
</update>
|
||||
|
||||
<!-- 通过USER_ID获取数据 -->
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
IFNULL(f.SERVICE_COMPANY_USER_MAP_ID, "") as SERVICE_COMPANY_USER_MAP_ID,
|
||||
IFNULL(su.NAME, "") AS NAME,
|
||||
IFNULL(bc.RELEVANT_UNIT_NAME, "") AS RELEVANT_UNIT_NAME,
|
||||
IFNULL(sud.PERSON_WORK_TYPE, "") AS PERSON_WORK_TYPE,
|
||||
IFNULL(sd.NAME, "") AS DICNAME,
|
||||
IFNULL(f.USER_ID, "") AS USER_ID
|
||||
from
|
||||
bus_service_company_user_map as f
|
||||
left join sys_user su on su.USER_ID = f.USER_ID <!-- 添加人信息 -->
|
||||
left join bus_corpinfo bc on bc.CORPINFO_ID = f.CORPINFO_ID<!-- 相关方企业名称 -->
|
||||
left join sys_user_details sud on sud.USER_ID = f.USER_ID<!-- 工种 -->
|
||||
left join SYS_DICTIONARIES sd on sud.PERSON_WORK_TYPE = sd.DICTIONARIES_ID<!-- 工种名字 -->
|
||||
where
|
||||
f.SERVICE_COMPANY_USER_MAP_ID = #{SERVICE_COMPANY_USER_MAP_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.TRAININGBATCH_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
|
||||
TRAINUSERS_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>
|
||||
TRAININGBATCH_ID = #{TRAININGBATCH_ID}
|
||||
where
|
||||
TRAININGBATCH_ID = #{TRAININGBATCH_ID}
|
||||
</update>
|
||||
|
||||
<!-- 培训申请记录 -->
|
||||
<select id="trainApplicationRecordList" parameterType="pd" resultType="pd">
|
||||
select
|
||||
IFNULL(f.TRAINUSERS_ID, "") AS TRAINUSERS_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>
|
||||
TRAINUSERS_ID = #{TRAINUSERS_ID}
|
||||
where
|
||||
TRAINUSERS_ID = #{TRAINUSERS_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
|
||||
TRAINUSERS_ID = #{TRAINUSERS_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
|
||||
TRAINUSERS_ID = #{TRAINUSERS_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
|
||||
TRAINUSERS_ID = #{TRAINUSERS_ID}
|
||||
</update>
|
||||
<update id="graduation">
|
||||
update bus_trainusers 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 bus_trainusers a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID = #{TRAINUSERS_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.TRAINUSERS_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 TRAININGBATCH_ID = #{TRAININGBATCH_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.TRAINUSERS_ID = #{TRAINUSERS_ID}
|
||||
</select>
|
||||
<!-- 通过USER_ID获取数据 -->
|
||||
<select id="getCountByWanchengPingshen" parameterType="pd" resultType="Integer">
|
||||
|
||||
select
|
||||
count(1)
|
||||
from
|
||||
<include refid="tableName"></include>
|
||||
f
|
||||
where
|
||||
f.TRAININGBATCH_ID = #{TRAININGBATCH_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.TRAINUSERS_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>
|
|
@ -0,0 +1,421 @@
|
|||
<?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">
|
||||
BUS_TRAININGBATCH
|
||||
</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_USER_ID,
|
||||
f.AUDIT_STATUS,
|
||||
f.TRAININGBATCH_ID,
|
||||
f.SUPERVISION,
|
||||
f.SUPERVISION_USER_ID,
|
||||
f.TERRITORIALITY,
|
||||
f.TERRITORIALITY_USER_ID
|
||||
</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_USER_ID,
|
||||
AUDIT_STATUS,
|
||||
TYPE,
|
||||
TRAININGBATCH_ID,
|
||||
SUPERVISION,
|
||||
SUPERVISION_USER_ID,
|
||||
TERRITORIALITY,
|
||||
TERRITORIALITY_USER_ID
|
||||
</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_USER_ID},
|
||||
#{AUDIT_STATUS},
|
||||
#{TYPE},
|
||||
#{TRAININGBATCH_ID},
|
||||
#{SUPERVISION},
|
||||
#{SUPERVISION_USER_ID},
|
||||
#{TERRITORIALITY},
|
||||
#{TERRITORIALITY_USER_ID}
|
||||
</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
|
||||
TRAININGBATCH_ID = #{TRAININGBATCH_ID}
|
||||
</delete>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="edit" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
OPERATOR = #{OPERATOR},
|
||||
OPERATTIME = #{OPERATTIME},
|
||||
AUDIT_STATUS = #{AUDIT_STATUS},
|
||||
TRAIN_CORP_DEPT = #{TRAIN_CORP_DEPT},
|
||||
TRAIN_CORP_LEADER = #{TRAIN_CORP_LEADER},
|
||||
ENTRUST_TIME = #{ENTRUST_TIME},
|
||||
VERIFY_TIME = #{VERIFY_TIME}
|
||||
where
|
||||
TRAININGBATCH_ID = #{TRAININGBATCH_ID}
|
||||
</update>
|
||||
|
||||
<!-- 修改 -->
|
||||
<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>
|
||||
TRAININGBATCH_ID = #{TRAININGBATCH_ID}
|
||||
where
|
||||
TRAININGBATCH_ID = #{TRAININGBATCH_ID}
|
||||
</update>
|
||||
<update id="graduation" parameterType="pd">
|
||||
update bus_trainusers 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.TRAININGBATCH_ID = #{TRAININGBATCH_ID}
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
f.*,
|
||||
ma.NAME MANAGER_DEPARTMENT_NAME,
|
||||
ma_u.NAME MANAGER_USER_NAME,
|
||||
md.NAME MAIN_DEPARTMENT_NAME,
|
||||
(select MANAGER_TIME from bus_trainusers t1 where t1.TRAININGBATCH_ID = f.TRAININGBATCH_ID order by t1.MANAGER_TIME DESC LIMIT 0,1) AS MANAGER_TIME,
|
||||
su.NAME SUPERVISION_DEPARTMENT_NAME,
|
||||
su_u.NAME SUPERVISION_USER_NAME,
|
||||
(select SUPERVISION_TIME from bus_trainusers t2 where t2.TRAININGBATCH_ID = f.TRAININGBATCH_ID order by t2.SUPERVISION_TIME DESC LIMIT 0,1) AS SUPERVISION_TIME,
|
||||
te.NAME TERRITORIALITY_DEPARTMENT_NAME,
|
||||
te_u.NAME TERRITORIALITY_USER_NAME,
|
||||
(select TERRITORIALITY_TIME from bus_trainusers t3 where t3.TRAININGBATCH_ID = f.TRAININGBATCH_ID order by t3.TERRITORIALITY_TIME DESC LIMIT 0,1) AS TERRITORIALITY_TIME,
|
||||
cu.NAME TRAIN_CORP_LEADER_NAME,
|
||||
d.NAME TRAIN_AREA_NAME,
|
||||
c.RELEVANT_UNIT_NAME,
|
||||
syu.NAME AS CREATOR_NAME,
|
||||
vcd.NAME SUPERVISE_DEPARTMENT_NAME,
|
||||
vci.CORP_NAME SUPERVISE_CORPINFO_NAME,
|
||||
corpTypeDic.NAME corpTypeName,
|
||||
vcu.NAME AS VCU_NAME,
|
||||
(select count(*) from bus_trainusers t5 where t5.TRAININGBATCH_ID = f.TRAININGBATCH_ID and f.SUPERVISION_USER_ID = #{pd.USER_ID} and (t5.SUPERVISION_STATE in('1','0') or t5.MANAGER_STATE = '0' or t5.TERRITORIALITY_STATE = '0') ) as supervisionCount,
|
||||
(select count(*) from bus_trainusers t6 where t6.TRAININGBATCH_ID = f.TRAININGBATCH_ID and f.MANAGER_USER_ID = #{pd.USER_ID} and (t6.MANAGER_STATE in('1','0') or t6.SUPERVISION_STATE = '0') ) as managerCount,
|
||||
(select count(*) from bus_trainusers t7 where t7.TRAININGBATCH_ID = f.TRAININGBATCH_ID and f.TERRITORIALITY_USER_ID = #{pd.USER_ID} and (t7.TERRITORIALITY_STATE in('1','0') or t7.SUPERVISION_STATE = '0') ) as territorialityCount,
|
||||
(select count(*) from bus_trainusers t4 where t4.TRAININGBATCH_ID = f.TRAININGBATCH_ID AND t4.SUPERVISION_STATE = '1' and t4.MANAGER_STATE = '1'
|
||||
and t4.TERRITORIALITY_STATE = '1' ) as PASS_COUNT<!-- 根据小齐要求,已更新为申请状态中的审核通过人员数-->
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
left join vi_corp_department ma on ma.DEPARTMENT_ID = f.MANAGER
|
||||
left join vi_corp_user ma_u on ma_u.USER_ID = f.MANAGER_USER_ID
|
||||
left join vi_regulatory_department su on su.DEPARTMENT_ID = f.SUPERVISION
|
||||
left join vi_regulatory_user su_u on su_u.USER_ID = f.SUPERVISION_USER_ID
|
||||
left join vi_corp_department te on te.DEPARTMENT_ID = f.TERRITORIALITY
|
||||
left join vi_corp_user te_u on te_u.USER_ID = f.TERRITORIALITY_USER_ID
|
||||
left join vi_corp_user cu on cu.USER_ID = f.TRAIN_CORP_LEADER
|
||||
left join sys_dictionaries d on d.DICTIONARIES_ID = f.TRAIN_AREA
|
||||
left join bus_corpinfo c on c.CORPINFO_ID = f.CORPINFO_ID
|
||||
left join BUS_CORPINFODETAILS bcd on bcd.CORPINFO_ID = c.CORPINFO_ID
|
||||
left join sys_dictionaries corpTypeDic on corpTypeDic.BIANMA = bcd.CORP_TYPE
|
||||
left join vi_regulatory_department md on md.DEPARTMENT_ID = c.MAIN_DEPARTMENT
|
||||
left join sys_user syu on syu.USERNAME = f.CREATOR
|
||||
left join vi_corp_user vcu on vcu.USERNAME = f.CREATOR
|
||||
left join vi_corp_department vcd on vcd.DEPARTMENT_ID = c.SUPERVISE_DEPARTMENT_ID
|
||||
left join vi_corp_info vci on vci.CORPINFO_ID = c.SUPERVISE_CORPINFO_ID
|
||||
where 1=1
|
||||
<if test="pd.TYPE != null and pd.TYPE != ''">
|
||||
and f.TYPE = #{pd.TYPE}
|
||||
</if>
|
||||
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''">
|
||||
and f.CREATOR LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
</if>
|
||||
<!--9173 搜索框不好使-->
|
||||
<if test="pd.XGF_NAME_REG != null and pd.XGF_NAME_REG != ''">
|
||||
and c.RELEVANT_UNIT_NAME LIKE CONCAT(CONCAT('%', #{pd.XGF_NAME_REG,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="pd.XGF_NAME != null and pd.XGF_NAME != ''">
|
||||
and c.RELEVANT_UNIT_NAME LIKE CONCAT(CONCAT('%', #{pd.XGF_NAME}),'%')
|
||||
</if>
|
||||
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''">
|
||||
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||
</if>
|
||||
<if test="pd.MANAGER != null and pd.MANAGER != ''">
|
||||
and f.MANAGER = #{pd.MANAGER}
|
||||
</if>
|
||||
<if test="pd.MANAGER_USER_ID != null and pd.MANAGER_USER_ID != ''">
|
||||
and f.MANAGER_USER_ID = #{pd.MANAGER_USER_ID}
|
||||
</if>
|
||||
<if test="pd.TERRITORIALITY != null and pd.TERRITORIALITY != ''">
|
||||
and f.TERRITORIALITY = #{pd.TERRITORIALITY}
|
||||
</if>
|
||||
<if test="pd.TRAIN_CORP_DEPT != null and pd.TRAIN_CORP_DEPT != ''">
|
||||
and f.TRAIN_CORP_DEPT = #{pd.TRAIN_CORP_DEPT}
|
||||
</if>
|
||||
<if test="pd.TRAIN_CORP_DEPTS != null and pd.TRAIN_CORP_DEPTS != ''">
|
||||
and FIND_IN_SET(f.TRAIN_CORP_DEPT, #{pd.TRAIN_CORP_DEPTS})
|
||||
</if>
|
||||
<if test="pd.TRAIN_CORP_LEADER != null and pd.TRAIN_CORP_LEADER != ''">
|
||||
and f.TRAIN_CORP_LEADER = #{pd.TRAIN_CORP_LEADER}
|
||||
</if>
|
||||
<if test="pd.AUDIT_STATUS != null and pd.AUDIT_STATUS != ''">
|
||||
and f.AUDIT_STATUS = #{pd.AUDIT_STATUS}
|
||||
</if>
|
||||
<if test="pd.SELECT_STATUS != null and pd.SELECT_STATUS != '' and pd.SELECT_STATUS == 2 and (pd.AUDIT_STATUS == null or pd.AUDIT_STATUS == '')">
|
||||
and f.AUDIT_STATUS > 1
|
||||
</if>
|
||||
<if test="pd.STARTTIME != null and pd.STARTTIME != ''">
|
||||
and DATE_FORMAT( f.CREATTIME, '%Y-%m-%d' ) BETWEEN DATE_FORMAT( #{pd.STARTTIME}, '%Y-%m-%d' ) and DATE_FORMAT( #{pd.ENDTIME}, '%Y-%m-%d' )
|
||||
</if>
|
||||
<if test="pd.VERIFY_START_TIME != null and pd.VERIFY_START_TIME != ''">
|
||||
and DATE_FORMAT( f.VERIFY_TIME, '%Y-%m-%d' ) BETWEEN DATE_FORMAT( #{pd.VERIFY_START_TIME}, '%Y-%m-%d' ) and DATE_FORMAT( #{pd.VERIFY_END_TIME}, '%Y-%m-%d' )
|
||||
</if>
|
||||
<if test="pd.ENTRUST_STARTTIME != null and pd.ENTRUST_STARTTIME != ''">
|
||||
and DATE_FORMAT( f.ENTRUST_TIME, '%Y-%m-%d' ) BETWEEN DATE_FORMAT( #{pd.ENTRUST_STARTTIME}, '%Y-%m-%d' ) and DATE_FORMAT( #{pd.ENTRUST_ENDTIME}, '%Y-%m-%d' )
|
||||
</if>
|
||||
<if test="pd.SUPERVISION_USER_ID != null and pd.SUPERVISION_USER_ID != ''"> <!-- 安检-->
|
||||
and f.SUPERVISION_USER_ID = #{pd.SUPERVISION_USER_ID}
|
||||
</if>
|
||||
<if test="pd.TERRITORIALITY_USER_ID != null and pd.TERRITORIALITY_USER_ID != ''"> <!-- 属地管理部门审核人员-->
|
||||
and f.TERRITORIALITY_USER_ID = #{pd.TERRITORIALITY_USER_ID}
|
||||
</if>
|
||||
<if test="pd.MANAGER_USER_ID != null and pd.MANAGER_USER_ID != ''"> <!-- 主管部门-->
|
||||
and f.MANAGER_USER_ID = #{pd.MANAGER_USER_ID}
|
||||
</if>
|
||||
<if test="pd.MAndTUserId != null and pd.MAndTUserId != ''"> <!-- 主管部门-->
|
||||
and (f.MANAGER_USER_ID = #{pd.MAndTUserId} or f.TERRITORIALITY_USER_ID = #{pd.MAndTUserId})
|
||||
</if>
|
||||
<if test="pd.user_index != null and pd.user_index != ''"> <!-- 主管部门-->
|
||||
and (f.MANAGER_USER_ID = #{pd.user_index} or f.TERRITORIALITY_USER_ID = #{pd.user_index} or f.SUPERVISION_USER_ID = #{pd.user_index})
|
||||
</if>
|
||||
order by f.CREATTIME desc
|
||||
</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
|
||||
TRAININGBATCH_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 u.USER_ID,
|
||||
u.USERNAME,
|
||||
u.CORPINFO_ID,
|
||||
u.NAME,
|
||||
u.ISFLOW,
|
||||
u.DEPART_STATE,
|
||||
t.STATUS,
|
||||
t.SUPERVISION_STATE,
|
||||
t.SUPERVISION_OPINION,
|
||||
t.SUPERVISION_TIME,
|
||||
tr.SUPERVISION,
|
||||
t.MANAGER_STATE,
|
||||
t.MANAGER_OPINION,
|
||||
t.MANAGER_TIME,
|
||||
tr.MANAGER,
|
||||
t.TERRITORIALITY_STATE,
|
||||
t.TERRITORIALITY_OPINION,
|
||||
t.TERRITORIALITY_TIME,
|
||||
tr.TERRITORIALITY,
|
||||
t.TRAINUSERS_ID,
|
||||
t.STEP_STATUS,
|
||||
d.NAME DEPARTMENT_NAME ,
|
||||
tr.TERRITORIALITY_USER_ID,
|
||||
tr.SUPERVISION_USER_ID,
|
||||
tr.MANAGER_USER_ID,
|
||||
te.NAME as TERRITORIALITY_USER_NAME,
|
||||
s.NAME as SUPERVISION_USER_NAME,
|
||||
m.NAME as MANAGER_USER_NAME,
|
||||
n.STATUS as TRAIN_STATUS,
|
||||
tr.AUDIT_STATUS
|
||||
from SYS_USER u
|
||||
left join oa_department d on d.DEPARTMENT_ID = u.DEPARTMENT_ID
|
||||
left join BUS_TRAINUSERS t on t.USER_ID = u.USER_ID
|
||||
left join bus_trainingbatch tr on tr.TRAININGBATCH_ID = t.TRAININGBATCH_ID
|
||||
LEFT JOIN `qa-gwj-regulatory`.bus_class_info n ON n.TRAINUSERS_ID = t.TRAINUSERS_ID
|
||||
left join vi_corp_user te on te.USER_ID = tr.TERRITORIALITY_USER_ID
|
||||
left join vi_regulatory_user s on s.USER_ID = tr.SUPERVISION_USER_ID
|
||||
left join vi_corp_user m on m.USER_ID = tr.MANAGER_USER_ID
|
||||
where t.TRAININGBATCH_ID = #{pd.TRAININGBATCH_ID}
|
||||
</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 bus_trainusers a
|
||||
left join bus_trainingbatch tb on a.TRAININGBATCH_ID = tb.TRAININGBATCH_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_corpinfo 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 bus_trainusers t1 where
|
||||
t1.TRAININGBATCH_ID = f.TRAININGBATCH_ID ) AS SUPERVISION_TIME,
|
||||
(SELECT MAX( t2.MANAGER_TIME ) AS MANAGER_TIME FROM bus_trainusers t2 where
|
||||
t2.TRAININGBATCH_ID = f.TRAININGBATCH_ID ) AS MANAGER_TIME,
|
||||
(SELECT MAX( t3.TERRITORIALITY_TIME ) AS TERRITORIALITY_TIME FROM bus_trainusers t3 where
|
||||
t3.TRAININGBATCH_ID = f.TRAININGBATCH_ID ) AS TERRITORIALITY_TIME
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
left join vi_regulatory_user supUser on supUser.USER_ID = f.SUPERVISION_USER_ID
|
||||
left join vi_regulatory_department 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.TRAININGBATCH_ID = #{TRAININGBATCH_ID}
|
||||
</select>
|
||||
</mapper>
|
|
@ -92,6 +92,40 @@
|
|||
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 bus_trainusers bu where bu.TRAINUSERS_ID = #{TRAINUSERS_ID})
|
||||
</update>
|
||||
<update id="bantchUpdateStatus">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set 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 bus_trainusers bu where bu.TRAININGBATCH_ID = #{TRAININGBATCH_ID})
|
||||
</update>
|
||||
<update id="graduation">
|
||||
update bus_trainusers 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 bus_trainusers a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID = #{TRAINUSERS_ID}
|
||||
</update>
|
||||
|
||||
<!-- 通过ID获取数据 -->
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
|
|
Loading…
Reference in New Issue