bug修复
parent
6d49773242
commit
d5f729cdbe
|
@ -1,20 +1,16 @@
|
||||||
package com.zcloud.controller.xgf;
|
package com.zcloud.controller.xgf;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.zcloud.controller.base.BaseController;
|
import com.zcloud.controller.base.BaseController;
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.service.system.UsersService;
|
|
||||||
import com.zcloud.service.xgf.TrainingBatchService;
|
import com.zcloud.service.xgf.TrainingBatchService;
|
||||||
|
import com.zcloud.service.xgf.XgfUserService;
|
||||||
import com.zcloud.util.*;
|
import com.zcloud.util.*;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
@ -32,10 +28,7 @@ public class TrainingBatchController extends BaseController {
|
||||||
private TrainingBatchService trainingbatchService;
|
private TrainingBatchService trainingbatchService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UsersService usersService;
|
private XgfUserService xgfUserService;
|
||||||
|
|
||||||
@Value("${prevention.api.url}")
|
|
||||||
private String preventionUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
|
@ -59,8 +52,6 @@ public class TrainingBatchController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*
|
*
|
||||||
* @param out
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/delete")
|
@RequestMapping(value = "/delete")
|
||||||
@RequiresPermissions("trainingbatch:del")
|
@RequiresPermissions("trainingbatch:del")
|
||||||
|
@ -113,46 +104,6 @@ public class TrainingBatchController extends BaseController {
|
||||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||||
page.setPd(pd);
|
page.setPd(pd);
|
||||||
List<PageData> varList = trainingbatchService.list(page); //列出TrainingBatch列表
|
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("varList", varList);
|
||||||
map.put("page", page);
|
map.put("page", page);
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
|
@ -177,7 +128,7 @@ public class TrainingBatchController extends BaseController {
|
||||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||||
page.setPd(pd);
|
page.setPd(pd);
|
||||||
List<PageData> varList = usersService.flowlistPage(page); //列出TrainingBatch列表
|
List<PageData> varList = xgfUserService.flowlistPage(page); //列出TrainingBatch列表
|
||||||
map.put("varList", varList);
|
map.put("varList", varList);
|
||||||
map.put("page", page);
|
map.put("page", page);
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
|
@ -203,47 +154,6 @@ public class TrainingBatchController extends BaseController {
|
||||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||||
page.setPd(pd);
|
page.setPd(pd);
|
||||||
List<PageData> varList = trainingbatchService.batchUserlistPage(page); //列出TrainingBatch列表
|
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("varList", varList);
|
||||||
map.put("page", page);
|
map.put("page", page);
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
|
@ -281,120 +191,13 @@ public class TrainingBatchController extends BaseController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object deleteAll() throws Exception {
|
public Object deleteAll() throws Exception {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
PageData pd = this.getPageData();
|
||||||
PageData pd = new PageData();
|
|
||||||
pd = this.getPageData();
|
|
||||||
String DATA_IDS = pd.getString("DATA_IDS");
|
String DATA_IDS = pd.getString("DATA_IDS");
|
||||||
if (Tools.notEmpty(DATA_IDS)) {
|
if (Tools.notEmpty(DATA_IDS)) {
|
||||||
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
||||||
trainingbatchService.deleteAll(ArrayDATA_IDS);
|
trainingbatchService.deleteAll(ArrayDATA_IDS);
|
||||||
errInfo = "success";
|
|
||||||
} else {
|
|
||||||
errInfo = "error";
|
|
||||||
}
|
}
|
||||||
map.put("result", errInfo); //返回结果
|
map.put("result", "success"); //返回结果
|
||||||
return map;
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,7 @@ package com.zcloud.controller.xgf;
|
||||||
import com.zcloud.controller.base.BaseController;
|
import com.zcloud.controller.base.BaseController;
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
import com.zcloud.service.system.UsersService;
|
|
||||||
import com.zcloud.service.xgf.XgfUserService;
|
import com.zcloud.service.xgf.XgfUserService;
|
||||||
import com.zcloud.util.HttpClientService;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
@ -23,7 +21,7 @@ public class XgfUserController extends BaseController {
|
||||||
|
|
||||||
@RequestMapping(value = "/list")
|
@RequestMapping(value = "/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object getLevels(Page page) throws Exception {
|
public Object list(Page page) throws Exception {
|
||||||
PageData request = this.getPageData();
|
PageData request = this.getPageData();
|
||||||
page.setPd(request);
|
page.setPd(request);
|
||||||
xgfUserService.list(page);
|
xgfUserService.list(page);
|
||||||
|
@ -33,4 +31,16 @@ public class XgfUserController extends BaseController {
|
||||||
response.put("data", request);
|
response.put("data", request);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = "/approve")
|
||||||
|
@ResponseBody
|
||||||
|
public Object approve() throws Exception {
|
||||||
|
PageData request = this.getPageData();
|
||||||
|
xgfUserService.approve(request);
|
||||||
|
|
||||||
|
PageData response = new PageData();
|
||||||
|
response.put("result", "success");
|
||||||
|
response.put("data", request);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,4 +64,6 @@ public interface XgfUserMapper {
|
||||||
void graduation(PageData condition);
|
void graduation(PageData condition);
|
||||||
|
|
||||||
void graduationstudent(PageData condition);
|
void graduationstudent(PageData condition);
|
||||||
|
|
||||||
|
List<PageData> flowlistPage(Page page);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,4 +16,8 @@ public interface XgfUserService {
|
||||||
void init(PageData request);
|
void init(PageData request);
|
||||||
|
|
||||||
void approvalApplication(PageData request) throws Exception;
|
void approvalApplication(PageData request) throws Exception;
|
||||||
|
|
||||||
|
List<PageData> flowlistPage(Page page)throws Exception;
|
||||||
|
|
||||||
|
void approve(PageData request) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,8 @@ public class TrainingBatchServiceImpl implements TrainingBatchService {
|
||||||
@Resource
|
@Resource
|
||||||
private FlowDetailMapper flowDetailMapper;
|
private FlowDetailMapper flowDetailMapper;
|
||||||
|
|
||||||
@Value("${prevention.api.url}")
|
// @Value("${prevention.api.url}")
|
||||||
private String preventionUrl;
|
// private String preventionUrl;
|
||||||
|
|
||||||
/**新增
|
/**新增
|
||||||
* @param pd
|
* @param pd
|
||||||
|
|
|
@ -6,14 +6,19 @@ import com.zcloud.mapper.datasource.xgf.XgfUserDetailsMapper;
|
||||||
import com.zcloud.mapper.datasource.xgf.XgfUserMapper;
|
import com.zcloud.mapper.datasource.xgf.XgfUserMapper;
|
||||||
import com.zcloud.service.xgf.XgfUserService;
|
import com.zcloud.service.xgf.XgfUserService;
|
||||||
import com.zcloud.util.DateUtil;
|
import com.zcloud.util.DateUtil;
|
||||||
|
import com.zcloud.util.HttpClientService;
|
||||||
|
import com.zcloud.util.HttpClientUtil;
|
||||||
import com.zcloud.util.Warden;
|
import com.zcloud.util.Warden;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class XgfUserServiceImpl implements XgfUserService {
|
public class XgfUserServiceImpl implements XgfUserService {
|
||||||
|
@ -24,6 +29,9 @@ public class XgfUserServiceImpl implements XgfUserService {
|
||||||
@Resource
|
@Resource
|
||||||
private XgfUserDetailsMapper xgfUserDetailsMapper;
|
private XgfUserDetailsMapper xgfUserDetailsMapper;
|
||||||
|
|
||||||
|
@Value("${preventionxgf.api.url}")
|
||||||
|
private String prevention_xgf_url;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void save(PageData pd) throws Exception {
|
public void save(PageData pd) throws Exception {
|
||||||
xgfUserMapper.save(pd);
|
xgfUserMapper.save(pd);
|
||||||
|
@ -88,10 +96,41 @@ public class XgfUserServiceImpl implements XgfUserService {
|
||||||
x.put("STATUS", "1");
|
x.put("STATUS", "1");
|
||||||
xgfUserMapper.edit(x);
|
xgfUserMapper.edit(x);
|
||||||
}
|
}
|
||||||
PageData pd = new PageData();
|
}
|
||||||
pd.put("XGF_USER_ID", request.getString("XGF_USER_ID"));
|
|
||||||
pd.put("ISDELETE", "1");
|
@Override
|
||||||
xgfUserMapper.edit(pd);
|
public List<PageData> flowlistPage(Page page) throws Exception {
|
||||||
xgfUserDetailsMapper.edit(pd);
|
return xgfUserMapper.flowlistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void approve(PageData request) throws Exception {
|
||||||
|
List<PageData> _list = Warden.getList(request.getString("list"));
|
||||||
|
if (_list == null || _list.size() == 0) {
|
||||||
|
throw new RuntimeException("请求数据异常");
|
||||||
|
}
|
||||||
|
List<String> list = _list.stream().map(x -> x.getString("XGF_USER_ID")).collect(Collectors.toList());
|
||||||
|
PageData condition = new PageData();
|
||||||
|
for (String x : list) {
|
||||||
|
condition.put("XGF_USER_ID", x);
|
||||||
|
PageData entity = xgfUserMapper.findById(condition);
|
||||||
|
if (entity == null || entity.size() == 0) {
|
||||||
|
throw new RuntimeException("未找到该用户");
|
||||||
|
}
|
||||||
|
if ("1".equals(request.getString("STATUS"))) {
|
||||||
|
entity.put("STATUS", "0");
|
||||||
|
} else {
|
||||||
|
entity.put("STATUS", "2");
|
||||||
|
}
|
||||||
|
xgfUserMapper.edit(entity);
|
||||||
|
|
||||||
|
entity.put("USER_ID", condition.get("XGF_USER_ID"));
|
||||||
|
entity.put("STATUS", request.getString("STATUS"));
|
||||||
|
Map result = HttpClientService.doPost(prevention_xgf_url + "openApi/user/approve", entity);
|
||||||
|
if (result == null || !"succeed".equals(result.get("result"))) {
|
||||||
|
throw new RuntimeException("请求失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -365,46 +365,9 @@ public class HttpClientService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Map doPost(String url, PageData pd) {
|
public static Map doPost(String url, PageData pd) {
|
||||||
/* 正式上面总是显示一次断一次,未找到原因
|
|
||||||
MultiValueMap<String, String> requestBody = new LinkedMultiValueMap();
|
|
||||||
pd.forEach((key, value) -> {
|
|
||||||
requestBody.add(key.toString(), value.toString());
|
|
||||||
});
|
|
||||||
System.out.println(requestBody);
|
|
||||||
Map<String,Object> responseBody = new HashMap<String,Object>();
|
|
||||||
TcpClient tcpClient = TcpClient.create()
|
|
||||||
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 1000) // Connection Timeout
|
|
||||||
.doOnConnected(connection ->
|
|
||||||
connection.addHandlerLast(new ReadTimeoutHandler(10)) // Read Timeout
|
|
||||||
.addHandlerLast(new WriteTimeoutHandler(10))); // Write Timeout
|
|
||||||
WebClient client = WebClient.builder().clientConnector(new ReactorClientHttpConnector(HttpClient.from(tcpClient))).build();
|
|
||||||
client.post()
|
|
||||||
.uri(url)
|
|
||||||
.header("Source","zcloud")
|
|
||||||
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
|
|
||||||
.body(BodyInserters.fromFormData(requestBody))
|
|
||||||
.exchange()
|
|
||||||
.flatMap(response -> {
|
|
||||||
System.out.println("Status code: " + response.statusCode().value());
|
|
||||||
return response.bodyToMono(JSONObject.class);
|
|
||||||
})
|
|
||||||
.doOnSuccess(body -> {
|
|
||||||
System.out.println("success");
|
|
||||||
responseBody.putAll(body);
|
|
||||||
})
|
|
||||||
.doOnError(throwable -> {
|
|
||||||
responseBody.put("msg",throwable.getMessage());
|
|
||||||
System.out.println("Error occurred: " + throwable.getMessage());
|
|
||||||
})
|
|
||||||
.block();
|
|
||||||
return responseBody;
|
|
||||||
*/
|
|
||||||
JSONObject jsonObject = null;
|
JSONObject jsonObject = null;
|
||||||
HttpResponse response = null;
|
HttpResponse response = null;
|
||||||
List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
|
List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
|
||||||
// pd.forEach((key, value) -> { // 这个遍历不好使
|
|
||||||
// System.out.println("键:" + key.toString() + ",值:" + value.toString());
|
|
||||||
// });
|
|
||||||
Map<Object, Object> map = (Map)pd;
|
Map<Object, Object> map = (Map)pd;
|
||||||
System.out.print("参数:{");
|
System.out.print("参数:{");
|
||||||
for(Map.Entry<Object, Object> entry : map.entrySet()){
|
for(Map.Entry<Object, Object> entry : map.entrySet()){
|
||||||
|
|
|
@ -175,14 +175,14 @@
|
||||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||||
select
|
select
|
||||||
f.*,
|
f.*,
|
||||||
ma.NAME MANAGER_DEPARTMENT_NAME,
|
ma.NAME MANAGER_DEPT_NAME,
|
||||||
ma_u.NAME MANAGER_USER_NAME,
|
ma_u.NAME MANAGER_USER_NAME,
|
||||||
md.NAME MAIN_DEPARTMENT_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,
|
(select MANAGER_TIME from bus_trainusers t1 where t1.TRAININGBATCH_ID = f.TRAININGBATCH_ID order by t1.MANAGER_TIME DESC LIMIT 0,1) AS MANAGER_TIME,
|
||||||
su.NAME SUPERVISION_DEPARTMENT_NAME,
|
su.NAME SUPERVISION_DEPT_NAME,
|
||||||
su_u.NAME SUPERVISION_USER_NAME,
|
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,
|
(select SUPERVISION_TIME from bus_trainusers t2 where t2.TRAININGBATCH_ID = f.TRAININGBATCH_ID order by t2.SUPERVISION_TIME DESC LIMIT 0,1) AS SUPERVISION_TIME,
|
||||||
te.NAME TERRITORIALITY_DEPARTMENT_NAME,
|
te.NAME TERRITORIALITY_DEPT_NAME,
|
||||||
te_u.NAME TERRITORIALITY_USER_NAME,
|
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,
|
(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,
|
cu.NAME TRAIN_CORP_LEADER_NAME,
|
||||||
|
@ -200,11 +200,11 @@
|
||||||
and t4.TERRITORIALITY_STATE = '1' ) as PASS_COUNT<!-- 根据小齐要求,已更新为申请状态中的审核通过人员数-->
|
and t4.TERRITORIALITY_STATE = '1' ) as PASS_COUNT<!-- 根据小齐要求,已更新为申请状态中的审核通过人员数-->
|
||||||
from
|
from
|
||||||
<include refid="tableName"></include> f
|
<include refid="tableName"></include> f
|
||||||
left join vi_corp_department ma on ma.DEPARTMENT_ID = f.MANAGER
|
left join vi_department_all ma on ma.DEPARTMENT_ID = f.MANAGER
|
||||||
left join vi_corp_user ma_u on ma_u.USER_ID = f.MANAGER_USER_ID
|
left join vi_corp_user ma_u on ma_u.USER_ID = f.MANAGER_USER_ID
|
||||||
left join vi_regulatory_department su on su.DEPARTMENT_ID = f.SUPERVISION
|
left join vi_department_all su on su.DEPARTMENT_ID = f.SUPERVISION
|
||||||
left join vi_regulatory_user su_u on su_u.USER_ID = f.SUPERVISION_USER_ID
|
left join vi_regulatory_user su_u on su_u.USER_ID = f.SUPERVISION_USER_ID
|
||||||
left join vi_corp_department te on te.DEPARTMENT_ID = f.TERRITORIALITY
|
left join vi_department_all te on te.DEPARTMENT_ID = f.TERRITORIALITY
|
||||||
left join vi_corp_user te_u on te_u.USER_ID = f.TERRITORIALITY_USER_ID
|
left join vi_corp_user te_u on te_u.USER_ID = f.TERRITORIALITY_USER_ID
|
||||||
left join vi_corp_user cu on cu.USER_ID = f.TRAIN_CORP_LEADER
|
left join vi_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 sys_dictionaries d on d.DICTIONARIES_ID = f.TRAIN_AREA
|
||||||
|
@ -325,14 +325,17 @@
|
||||||
t.SUPERVISION_OPINION,
|
t.SUPERVISION_OPINION,
|
||||||
t.SUPERVISION_TIME,
|
t.SUPERVISION_TIME,
|
||||||
tr.SUPERVISION,
|
tr.SUPERVISION,
|
||||||
|
sup.NAME SUPERVISION_DEPT_NAME,
|
||||||
t.MANAGER_STATE,
|
t.MANAGER_STATE,
|
||||||
t.MANAGER_OPINION,
|
t.MANAGER_OPINION,
|
||||||
t.MANAGER_TIME,
|
t.MANAGER_TIME,
|
||||||
tr.MANAGER,
|
tr.MANAGER,
|
||||||
|
man.NAME MANAGER_DEPT_NAME,
|
||||||
t.TERRITORIALITY_STATE,
|
t.TERRITORIALITY_STATE,
|
||||||
t.TERRITORIALITY_OPINION,
|
t.TERRITORIALITY_OPINION,
|
||||||
t.TERRITORIALITY_TIME,
|
t.TERRITORIALITY_TIME,
|
||||||
tr.TERRITORIALITY,
|
tr.TERRITORIALITY,
|
||||||
|
tra.NAME TERRITORIALITY_DEPT_NAME,
|
||||||
t.TRAINUSERS_ID,
|
t.TRAINUSERS_ID,
|
||||||
t.STEP_STATUS,
|
t.STEP_STATUS,
|
||||||
d.NAME DEPARTMENT_NAME ,
|
d.NAME DEPARTMENT_NAME ,
|
||||||
|
@ -350,8 +353,11 @@
|
||||||
left join bus_trainingbatch tr on tr.TRAININGBATCH_ID = t.TRAININGBATCH_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 `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_corp_user te on te.USER_ID = tr.TERRITORIALITY_USER_ID
|
||||||
left join vi_regulatory_user s on s.USER_ID = tr.SUPERVISION_USER_ID
|
left join vi_user_all s on s.USER_ID = tr.SUPERVISION_USER_ID
|
||||||
left join vi_corp_user m on m.USER_ID = tr.MANAGER_USER_ID
|
left join vi_corp_user m on m.USER_ID = tr.MANAGER_USER_ID
|
||||||
|
left join vi_department_all sup on sup.DEPARTMENT_ID = tr.SUPERVISION
|
||||||
|
left join vi_department_all man on man.DEPARTMENT_ID = tr.MANAGER
|
||||||
|
left join vi_department_all tra on man.DEPARTMENT_ID = tr.TERRITORIALITY
|
||||||
where t.TRAININGBATCH_ID = #{pd.TRAININGBATCH_ID}
|
where t.TRAININGBATCH_ID = #{pd.TRAININGBATCH_ID}
|
||||||
</select>
|
</select>
|
||||||
<select id="passUserlistPage" resultType="com.zcloud.entity.PageData">
|
<select id="passUserlistPage" resultType="com.zcloud.entity.PageData">
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
f.CREATED_TIME,
|
f.CREATED_TIME,
|
||||||
f.CORPINFO_ID,
|
f.CORPINFO_ID,
|
||||||
f.STATUS,
|
f.STATUS,
|
||||||
f.OPERATOR_TIME
|
f.OPERATOR_TIME,
|
||||||
|
f.ISFLOW
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 字段用于新增 -->
|
<!-- 字段用于新增 -->
|
||||||
|
@ -34,7 +35,8 @@
|
||||||
CREATED_TIME,
|
CREATED_TIME,
|
||||||
CORPINFO_ID,
|
CORPINFO_ID,
|
||||||
STATUS,
|
STATUS,
|
||||||
OPERATOR_TIME
|
OPERATOR_TIME,
|
||||||
|
ISFLOW
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 字段值 -->
|
<!-- 字段值 -->
|
||||||
|
@ -49,7 +51,8 @@
|
||||||
#{CREATED_TIME},
|
#{CREATED_TIME},
|
||||||
#{CORPINFO_ID},
|
#{CORPINFO_ID},
|
||||||
#{STATUS},
|
#{STATUS},
|
||||||
#{OPERATOR_TIME}
|
#{OPERATOR_TIME},
|
||||||
|
#{ISFLOW}
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 新增-->
|
<!-- 新增-->
|
||||||
|
@ -87,7 +90,8 @@
|
||||||
CREATED_TIME = #{CREATED_TIME},
|
CREATED_TIME = #{CREATED_TIME},
|
||||||
CORPINFO_ID = #{CORPINFO_ID},
|
CORPINFO_ID = #{CORPINFO_ID},
|
||||||
STATUS = #{STATUS},
|
STATUS = #{STATUS},
|
||||||
OPERATOR_TIME = #{OPERATOR_TIME}
|
OPERATOR_TIME = #{OPERATOR_TIME},
|
||||||
|
ISFLOW = #{ISFLOW}
|
||||||
where
|
where
|
||||||
XGF_USER_ID = #{XGF_USER_ID}
|
XGF_USER_ID = #{XGF_USER_ID}
|
||||||
</update>
|
</update>
|
||||||
|
@ -97,7 +101,7 @@
|
||||||
<include refid="tableName"></include>
|
<include refid="tableName"></include>
|
||||||
set STATUS = #{STATUS}
|
set STATUS = #{STATUS}
|
||||||
where
|
where
|
||||||
XGF_USER_ID in (select USER_ID from bus_trainusers bu where bu.TRAINUSERS_ID = #{TRAINUSERS_ID})
|
XGF_USER_ID in (select USER_ID from xgf_train_users bu where bu.TRAINUSERS_ID = #{TRAINUSERS_ID})
|
||||||
</update>
|
</update>
|
||||||
<update id="bantchUpdateStatus">
|
<update id="bantchUpdateStatus">
|
||||||
update
|
update
|
||||||
|
@ -114,16 +118,16 @@
|
||||||
<include refid="tableName"></include>
|
<include refid="tableName"></include>
|
||||||
set STATUS = #{STATUS}
|
set STATUS = #{STATUS}
|
||||||
where
|
where
|
||||||
XGF_USER_ID in (select USER_ID from bus_trainusers bu where bu.TRAININGBATCH_ID = #{TRAININGBATCH_ID})
|
XGF_USER_ID in (select USER_ID from xgf_train_users bu where bu.TRAININGBATCH_ID = #{TRAININGBATCH_ID})
|
||||||
</update>
|
</update>
|
||||||
<update id="graduation">
|
<update id="graduation">
|
||||||
update bus_trainusers a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID in
|
update xgf_train_users a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID in
|
||||||
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>;
|
</foreach>;
|
||||||
</update>
|
</update>
|
||||||
<update id="graduationstudent">
|
<update id="graduationstudent">
|
||||||
update bus_trainusers a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID = #{TRAINUSERS_ID}
|
update xgf_train_users a set a.STATUS = #{STATUS} where a.TRAINUSERS_ID = #{TRAINUSERS_ID}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<!-- 通过ID获取数据 -->
|
<!-- 通过ID获取数据 -->
|
||||||
|
@ -188,5 +192,8 @@
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="flowlistPage" resultType="com.zcloud.entity.PageData">
|
||||||
|
select * from xgf_user a where a.STATUS = '1'
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue