安全交底人审批接口保存

liujun-2024-05-23-接口漏洞修复
liujun 2024-02-03 22:02:15 +08:00
parent 01d0df7124
commit 110163f9da
7 changed files with 450 additions and 180 deletions

View File

@ -113,6 +113,8 @@ public class AppHotworkCfdController extends BaseController {
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //修改时间
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
hotworkCfdService.save(pd);
// created by liu jun 2024/02/01 保存动火交底人、项目负责人、安全员
hotworkCfdService.saveConfess(pd);
if (pd.get("APPLY_STATUS").equals("1")) {
PageData log = new PageData();
@ -249,6 +251,8 @@ public class AppHotworkCfdController extends BaseController {
PageData pd = new PageData();
pd = this.getPageData();
hotworkCfdService.edit(pd);
// created by liu jun 2024/02/01 保存动火交底人、项目负责人、安全员
hotworkCfdService.editConfess(pd);
if (pd.get("APPLY_STATUS").equals("1")) {
PageData log = new PageData();
log.put("HOTWORKLOG_ID", this.get32UUID());
@ -621,36 +625,29 @@ public class AppHotworkCfdController extends BaseController {
}
switch (status) {
// created by liu jun 2024-01-30 description: 作业负责人之前添加项目主管部门负责人签字为什么状态码时1.5因为前端代码有判断小于1则不能提交所以这里写1.5
case "1.5": {
// created by liu jun 2024-01-30 description: 安全项检查人签字
case "0.9": {
if (files != null && files.length > 0) {
MultipartFile file = files[0];
String ffile = DateUtil.getDays();
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
pd2.put("BELONGING_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("BELONGING_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
pd2.put("BELONGING_CONTENT", pd.get("CONTENT"));
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
hotworkCfdService.edit(pd2);
// 如果审批通过则进入下一阶段
if (pd.get("APPROVAL_STATUS").equals("1")) {
pd2.put("APPLY_STATUS", "1");
} else {
pd2.put("APPLY_STATUS", "-0.9");
}
break;
}
case "2"://确认
if (files != null && files.length > 0) {
MultipartFile file = files[0];
String ffile = DateUtil.getDays();
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
pd2.put("CONFIRM_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("CONFIRM_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
pd2.put("CONFIRM_CONTENT", pd.get("CONTENT"));
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
hotworkCfdService.edit(pd2);
PageData condition = new PageData();
condition.put("HOTWORK_ID", pd2.get("HOTWORK_ID"));
condition.put("TYPE","2");
condition.put("APPROVAL_SIGNATURE",Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
condition.put("APPROVAL_OPINIONS",pd.get("CONTENT"));
condition.put("APPROVAL_SIGNATURE_TIME",pd.get("SIGNER_TIME"));
condition.put("APPROVAL_STATUS",pd.getString("APPROVAL_STATUS"));
hotworkCfdService.approval(condition);
// 保存安全项信息
hotworkToMeasuresCfdService.delete(pd2);
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.get("measuresList").toString());
for (JSONObject json : list) {
@ -667,87 +664,54 @@ public class AppHotworkCfdController extends BaseController {
measures.put("CONFIRM_NAME", pd.get("ACTION_USER"));
hotworkToMeasuresCfdService.save(measures);
}
log.put("ACTION", "作业单位通过");
// 发短信
PageData mes = new PageData();
mes.put("RECEIVER_ID", pd2.get("LEADER_USER_ID"));// 收信人userid
mes.put("templateCode", "DH_Y02");// 短信模板编码
mes.put("SMSCode", "SMS_227245922");// 短信模板编码
mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// 参数集合
List<PageData> paramsList = new ArrayList<PageData>();
// 第1个参数
PageData params1 = new PageData();
params1.put("name", "number");// 存入短信模板中的参数名称
params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
paramsList.add(params1);
// 第2个参数
PageData params2 = new PageData();
params2.put("name", "params1");// 存入短信模板中的参数名称
params2.put("value", "动火作业");// 存入上面参数名称所传递的值
paramsList.add(params2);
// 第3个参数
PageData params3 = new PageData();
params3.put("name", "params2");// 存入短信模板中的参数名称
params3.put("value", "动火点所在单位审核");// 存入上面参数名称所传递的值
paramsList.add(params3);
// 第4个参数
PageData params4 = new PageData();
params4.put("name", "params3");// 存入短信模板中的参数名称
params4.put("value", "审核");// 存入上面参数名称所传递的值
paramsList.add(params4);
//sendMessageUtil.sendMessages(mes, paramsList);
}
break;
}
// 作业负责人审批
case "2": {//确认
if (files != null && files.length > 0) {
MultipartFile file = files[0];
// case "3"://监护人确认
// if (files != null && files.length > 0) {
// MultipartFile file = files[0];
//
// String ffile = DateUtil.getDays();
// String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
// Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
//
// pd2.put("GUARDIAN_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
// pd2.put("GUARDIAN_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
// pd2.put("GUARDIAN_CONTENT", pd.get("CONTENT"));
// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
// hotworkService.edit(pd2);
// log.put("ACTION", "监护人确认通过");
//
// // 发短信
// PageData mes = new PageData();
// mes.put("RECEIVER_ID", pd2.get("LEADER_USER_ID"));// 收信人userid
// mes.put("templateCode", "SMS_227245922");// 短信模板编码
// mes.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// // 参数集合
// List<PageData> paramsList = new ArrayList<PageData>();
// // 第1个参数
// PageData params1 = new PageData();
// params1.put("name", "number");// 存入短信模板中的参数名称
// params1.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
// paramsList.add(params1);
// // 第2个参数
// PageData params2 = new PageData();
// params2.put("name", "params1");// 存入短信模板中的参数名称
// params2.put("value", "动火作业");// 存入上面参数名称所传递的值
// paramsList.add(params2);
// // 第3个参数
// PageData params3 = new PageData();
// params3.put("name", "params2");// 存入短信模板中的参数名称
// params3.put("value", "动火点所在单位审核");// 存入上面参数名称所传递的值
// paramsList.add(params3);
// // 第4个参数
// PageData params4 = new PageData();
// params4.put("name", "params3");// 存入短信模板中的参数名称
// params4.put("value", "审核");// 存入上面参数名称所传递的值
// paramsList.add(params4);
// //sendMessageUtil.sendMessages(mes, paramsList);
// }
// break;
String ffile = DateUtil.getDays();
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
pd2.put("CONFIRM_USER_SIGNER_PATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
pd2.put("CONFIRM_USER_SIGNER_TIME", pd.get("SIGNER_TIME"));
pd2.put("CONFIRM_CONTENT", pd.get("CONTENT"));
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
hotworkCfdService.edit(pd2);
log.put("ACTION", "作业单位通过");
}
break;
}
// created by liu jun 2024-01-30 description: 作业负责人之前添加项目主管部门负责人签字
// 项目主管部门审批
case "2.5": {
if (files != null && files.length > 0) {
MultipartFile file = files[0];
String ffile = DateUtil.getDays();
String fileName = this.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile);
// 如果审批通过则进入下一阶段
if (pd.get("APPROVAL_STATUS").equals("1")) {
pd2.put("APPLY_STATUS", "3");
} else {
pd2.put("APPLY_STATUS", "-2.5");
}
hotworkCfdService.edit(pd2);
// 保存审批信息
PageData condition = new PageData();
condition.put("HOTWORK_ID", pd2.get("HOTWORK_ID"));
condition.put("TYPE","1");
condition.put("APPROVAL_OPINIONS",pd.get("CONTENT"));
condition.put("APPROVAL_SIGNATURE",Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
condition.put("APPROVAL_SIGNATURE_TIME",pd.get("SIGNER_TIME"));
condition.put("APPROVAL_STATUS",pd.getString("APPROVAL_STATUS"));
hotworkCfdService.approval(condition);
}
break;
}
case "4"://单位负责人人确认
if (files != null && files.length > 0) {
MultipartFile file = files[0];
@ -1015,7 +979,7 @@ public class AppHotworkCfdController extends BaseController {
//sendMessageUtil.sendMessages(mes, paramsList);
}
break;
case "-2"://确认打回
case "-2": {//确认打回
log.put("ACTION", "作业单位打回");
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
pd2.put("CONFIRM_CONTENT", pd.get("CONTENT"));
@ -1046,35 +1010,7 @@ public class AppHotworkCfdController extends BaseController {
paramsList.add(params3);
//sendMessageUtil.sendMessages(mes, paramsList);
break;
// case "-3"://监护人确认打回
// log.put("ACTION", "监护人打回");
// pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
// pd2.put("GUARDIAN_CONTENT", pd.get("CONTENT"));
// hotworkService.edit(pd2);
// // 发短信
// PageData mes1 = new PageData();
// mes1.put("RECEIVER_ID", pd2.get("APPLY_USER_ID"));// 收信人userid
// mes1.put("templateCode", "SMS_223580715");// 短信模板编码
// mes1.put("CORPINFO_ID", pd2.get("CORPINFO_ID"));// 企业id
// // 参数集合
// List<PageData> paramsList1 = new ArrayList<PageData>();
// // 第1个参数
// PageData params4 = new PageData();
// params4.put("name", "params1");// 存入短信模板中的参数名称
// params4.put("value", pd2.get("CHECK_NO"));// 存入上面参数名称所传递的值
// paramsList1.add(params4);
// // 第2个参数
// PageData params5 = new PageData();
// params5.put("name", "params2");// 存入短信模板中的参数名称
// params5.put("value", "动火作业");// 存入上面参数名称所传递的值
// paramsList1.add(params5);
// // 第3个参数
// PageData params6 = new PageData();
// params6.put("name", "params3");// 存入短信模板中的参数名称
// params6.put("value", "监护人确认");// 存入上面参数名称所传递的值
// paramsList1.add(params6);
// //sendMessageUtil.sendMessages(mes1, paramsList1);
// break;
}
case "-4"://单位负责人打回
log.put("ACTION", "单位负责人打回");
pd2.put("APPLY_STATUS", pd.get("APPLY_STATUS"));
@ -1578,4 +1514,74 @@ public class AppHotworkCfdController extends BaseController {
}
}
/**
*
* created by liu jun
* @date 2024-02-03
*/
@RequestMapping(value="/check")
@ResponseBody
public Object check() throws Exception {
PageData response = new PageData();
try {
PageData request = this.getPageData();
PageData info = hotworkCfdService.check(request);
response.putAll(info);
response.put("result", "success");
return response;
} catch (Exception e) {
e.printStackTrace();
response.put("result", "error");
response.put("message", e.getMessage());
return response;
}
}
/**
*
* created by liu jun
* @date 2024-02-03
*/
@RequestMapping(value="/safetyList")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "列表")
public Object safetyList(Page page) throws Exception{
PageData response = new PageData();
try {
PageData request = this.getPageData();
page.setPd(request);
List<PageData> varList = hotworkCfdService.safetyList(page);
response.put("varList", varList);
response.put("page", page);
response.put("result", "success");
return response;
} catch (Exception e) {
e.printStackTrace();
response.put("result", "error");
response.put("message", e.getMessage());
return response;
}
}
/**
*
* created by liu jun
* @date 2024-02-03
*/
@RequestMapping(value = "/confessApproval")
@ResponseBody
public Object confessApproval(@RequestParam(value = "FFILE", required = false) MultipartFile[] files) throws Exception {
PageData response = new PageData();
try {
PageData request = this.getPageData();
hotworkCfdService.confessApproval(request, files);
response.put("result", "success");
return response;
} catch (Exception e) {
e.printStackTrace();
response.put("result", "error");
response.put("message", e.getMessage());
return response;
}
}
}

View File

@ -24,5 +24,7 @@ public interface BusHotworkCfdExamineMapper {
List<PageData> listAll(PageData condition);
List<PageData> findByCondition(PageData condition);
List<PageData> safetylistPage(Page page);
}

View File

@ -2,6 +2,7 @@ package com.zcloud.service.highriskwork;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@ -86,5 +87,16 @@ public interface HotworkCfdService {
PageData getCode(PageData pd)throws Exception;
void addInfo(PageData pd) throws Exception;
void saveConfess(PageData info) throws Exception;
void editConfess(PageData info) throws Exception;
void approval(PageData condition) throws Exception;
PageData check(PageData condition) throws Exception;
List<PageData> safetyList(Page page) throws Exception;
void confessApproval(PageData request, MultipartFile[] files) throws Exception;
}

View File

@ -9,9 +9,11 @@ import com.zcloud.service.bus.CorpInfoService;
import com.zcloud.service.highriskwork.HotworkCfdService;
import com.zcloud.util.DateUtil;
import com.zcloud.util.Warden;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.List;
@ -46,12 +48,10 @@ public class HotworkCfdServiceImpl implements HotworkCfdService {
@Transactional
public void save(PageData pd)throws Exception {
hotworkCfdMapper.save(pd);
// created by liu jun 2024/02/01 保存动火交底人
this.saveConfess(pd.getString("confessList"), pd);
}
private void saveConfess(String json, PageData info) throws Exception{
List<PageData> list = Warden.getList(json);
public void saveConfess(PageData info) throws Exception{
List<PageData> list = Warden.getList(info.getString("confessList"));
String flowsId = Warden.get32UUID();
String time = DateUtil.getTime();
PageData condition = new PageData();
@ -68,7 +68,7 @@ public class HotworkCfdServiceImpl implements HotworkCfdService {
this.getCorpInfo(entity);
entity.put("TYPE", "0");
entity.put("TYPE_NAME", "动火交底人");
entity.put("APPROVAL_OPINIONS","");
entity.put("APPROVAL_OPINIONS",info.getString("CONFESS_DEPARTMENT_OPINIONS"));
entity.put("STATUS", "0");
entity.put("CREATE_TIME", time);
entity.put("VALID_FLAG", "1");
@ -88,7 +88,7 @@ public class HotworkCfdServiceImpl implements HotworkCfdService {
belonging.put("TYPE", "1");
belonging.put("TYPE_NAME", "项目主管部门负责人");
belonging.put("APPROVAL_OPINIONS","");
belonging.put("STATUS", "0");
belonging.put("APPROVAL_STATUS", "0");
belonging.put("CREATE_TIME", time);
belonging.put("VALID_FLAG", "1");
belonging.put("IS_DELETE", "0");
@ -107,13 +107,104 @@ public class HotworkCfdServiceImpl implements HotworkCfdService {
safety.put("TYPE", "2");
safety.put("TYPE_NAME", "安全项检查人");
safety.put("APPROVAL_OPINIONS","");
safety.put("STATUS", "0");
safety.put("APPROVAL_STATUS", "0");
safety.put("CREATE_TIME", time);
safety.put("VALID_FLAG", "1");
safety.put("IS_DELETE", "0");
busHotworkCfdExamineMapper.save(safety);
}
@Override
public void editConfess(PageData info) throws Exception {
// 删除原有的动火交底人
PageData condition = new PageData();
condition.put("HOTWORK_ID", info.getString("HOTWORK_ID"));
List<PageData> oldEntity = busHotworkCfdExamineMapper.listAll(condition);
for (PageData entity : oldEntity) {
entity.put("IS_DELETE", "1");
busHotworkCfdExamineMapper.edit(entity);
}
// created by liu jun 2024/02/01 保存动火交底人
this.saveConfess(info);
}
@Override
public void approval(PageData info) throws Exception {
PageData condition = new PageData();
condition.put("HOTWORK_ID", info.getString("HOTWORK_ID"));
condition.put("IS_DELETE", "0");
condition.put("VALID_FLAG", "1");
condition.put("TYPE", info.getString("TYPE"));
List<PageData> list = busHotworkCfdExamineMapper.findByCondition(condition);
if (list == null || list.size() == 0) throw new RuntimeException("数据异常请联系管理员");
PageData entity = list.get(0);
entity.put("APPROVAL_OPINIONS", info.getString("APPROVAL_OPINIONS"));
entity.put("APPROVAL_SIGNATURE", info.getString("APPROVAL_SIGNATURE"));
entity.put("APPROVAL_SIGNATURE_TIME", info.getString("APPROVAL_SIGNATURE_TIME"));
entity.put("APPROVAL_STATUS", info.getString("APPROVAL_STATUS"));
busHotworkCfdExamineMapper.edit(entity);
}
@Override
public PageData check(PageData request) throws Exception {
PageData condition = new PageData();
condition.put("HOTWORK_ID", request.get("HOTWORK_ID"));
PageData entity = hotworkCfdMapper.findById(condition);
if (entity == null) {
throw new RuntimeException("未找到动火作业信息");
}
String passFlag = "1";
String message = "";
if (entity.get("ACCEPT_CONFESS_USER_SIGNER_PATH") == null || StringUtils.isEmpty(entity.getString("ACCEPT_CONFESS_USER_SIGNER_PATH"))) {
message = "交底人未签字,";
passFlag = "0";
}
if (entity.get("GUARDIAN_USER_SIGNER_PATH") == null || StringUtils.isEmpty(entity.getString(entity.get("GUARDIAN_USER_SIGNER_PATH")))) {
message = message + "监护人未签字,";
passFlag = "0";
}
condition.clear();
condition.put("HOTWORK_ID", request.get("HOTWORK_ID"));
condition.put("IS_DELETE", "0");
condition.put("VALID_FLAG", "1");
condition.put("TYPE", "0");
List<PageData> approvalInfos = busHotworkCfdExamineMapper.findByCondition(condition);
if (approvalInfos == null || approvalInfos.size() == 0) throw new RuntimeException("未找到审批信息");
int unApprovalNum = (int) approvalInfos.stream().filter(x -> "0".equals(x.getString("APPROVAL_STATUS"))).count();
if (unApprovalNum > 0) {
message = message + "动火交底人未签字";
passFlag = "0";
}
PageData result = new PageData();
result.put("passFlag", passFlag);
result.put("message", message);
return result;
}
@Override
public List<PageData> safetyList(Page page) throws Exception {
return busHotworkCfdExamineMapper.safetylistPage(page);
}
@Override
public void confessApproval(PageData request, MultipartFile[] files) throws Exception {
PageData conditon = new PageData();
conditon.put("HOTWORK_ID", request.get("HOTWORK_ID"));
conditon.put("IS_DELETE", "0");
conditon.put("VALID_FLAG", "1");
conditon.put("TYPE", "0");
conditon.put("USER_ID", request.get("USER_ID"));
List<PageData> approvalInfos = busHotworkCfdExamineMapper.findByCondition(conditon);
if(approvalInfos.size() == 0) throw new RuntimeException("未找到审批信息,请联系管理员");
if (approvalInfos.size() > 1) throw new RuntimeException("审批信息异常,请联系管理员");
PageData entity = approvalInfos.get(0);
entity.put("APPROVAL_STATUS", "1");
entity.put("APPROVAL_SIGNATURE", Warden.saveFile(files,request.getString("CORPINFO_ID")));
entity.put("APPROVAL_SIGNATURE_TIME", DateUtil.getTime());
busHotworkCfdExamineMapper.edit(entity);
}
private void getCorpInfo(PageData entity) throws Exception {
PageData condition = new PageData();
condition.put("DEPARTMENT_ID", entity.getString("DEPARTMENT_ID"));
@ -152,16 +243,6 @@ public class HotworkCfdServiceImpl implements HotworkCfdService {
@Transactional
public void edit(PageData pd)throws Exception{
hotworkCfdMapper.edit(pd);
// 删除原有的动火交底人
PageData condition = new PageData();
condition.put("HOTWORK_ID", pd.getString("HOTWORK_ID"));
List<PageData> oldEntity = busHotworkCfdExamineMapper.listAll(condition);
for (PageData entity : oldEntity) {
entity.put("IS_DELETE", "1");
busHotworkCfdExamineMapper.edit(entity);
}
// created by liu jun 2024/02/01 保存动火交底人
this.saveConfess(pd.getString("confessList"), pd);
}
/**
@ -169,7 +250,12 @@ public class HotworkCfdServiceImpl implements HotworkCfdService {
* @throws Exception
*/
public List<PageData> list(Page page)throws Exception{
return hotworkCfdMapper.datalistPage(page);
List<PageData> list = hotworkCfdMapper.datalistPage(page);
// created by liu jun 2024/02/03 description: 拼接动火交底人、项目主管部门、安全项检查人
for(PageData dto: list){
this.addInfo(dto);
}
return list;
}
public List<PageData> jhlist(Page page)throws Exception{
return hotworkCfdMapper.jhdatalistPage(page);
@ -280,6 +366,7 @@ public class HotworkCfdServiceImpl implements HotworkCfdService {
x.put("CONFESS_DEPARTMENT_ID", x.get("DEPARTMENT_ID"));
x.put("CONFESS_DEPARTMENT_NAME", x.get("DEPARTMENT_NAME"));
}
pd.put("confessUserNames", confess.stream().map(x -> x.getString("USER_NAME")).collect(Collectors.joining(",")));
pd.put("confessList", confess);
// 项目责任负责人
PageData belong = approvalInfos.stream().filter(x -> "1".equals(x.getString("TYPE"))).findFirst().orElse(null);

View File

@ -11,6 +11,7 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.*;
@ -294,5 +295,13 @@ public class Warden {
}
}
public static Object saveFile(MultipartFile[] files,String CORPINFO_ID) throws Exception{
if (files.length == 0) throw new RuntimeException("文件为空");
MultipartFile file = files[0];
String ffile = DateUtil.getDays();
String fileName = get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
Smb.sshSftp(file, fileName, Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile);
return Const.FILEPATHFILE + CORPINFO_ID + "/" + ffile + "/" + fileName;
}
}

View File

@ -22,7 +22,7 @@
f.APPROVAL_SIGNATURE_TIME,
f.FLOW_ID,
f.VALID_FLAG,
f.STATUS,
f.APPROVAL_STATUS,
f.IS_DELETE,
f.CREATE_TIME,
f.REMARK
@ -44,7 +44,7 @@
APPROVAL_SIGNATURE_TIME,
FLOW_ID,
VALID_FLAG,
STATUS,
APPROVAL_STATUS,
IS_DELETE,
CREATE_TIME,
REMARK
@ -66,7 +66,7 @@
#{APPROVAL_SIGNATURE_TIME},
#{FLOW_ID},
#{VALID_FLAG},
#{STATUS},
#{APPROVAL_STATUS},
#{IS_DELETE},
#{CREATE_TIME},
#{REMARK}
@ -100,7 +100,7 @@
APPROVAL_SIGNATURE_TIME = #{APPROVAL_SIGNATURE_TIME},
FLOW_ID = #{FLOW_ID},
VALID_FLAG = #{VALID_FLAG},
STATUS = #{STATUS},
APPROVAL_STATUS = #{APPROVAL_STATUS},
IS_DELETE = #{IS_DELETE},
CREATE_TIME = #{CREATE_TIME},
REMARK = #{REMARK}
@ -109,7 +109,17 @@
<!-- 分页查询 -->
<select id="datalistPage" parameterType="page" resultType="pd">
select * from bus_hotwork_cfd_examine a where a.IS_DELETE = '0'
select a.* from bus_hotwork_cfd_examine a where a.IS_DELETE = '0'
left join bus_hotwork_cfd b on a.HOTWORK_ID = b.HOTWORK_ID
<if test="HOTWORK_ID != null and HOTWORK_ID != ''">
and a.HOTWORK_ID = #{HOTWORK_ID}
</if>
<if test="CORP_ID != null and CORP_ID != ''">
and a.CORP_ID = #{CORP_ID}
</if>
<if test="USER_ID != null and USER_ID != ''">
and a.USER_ID = #{USER_ID}
</if>
</select>
<select id="findById" parameterType="pd" resultType="pd">
@ -120,8 +130,7 @@
select * from bus_hotwork_cfd_examine f
</select>
<select id="findByCondition" resultType="com.zcloud.entity.PageData">
select * from bus_hotwork_cfd_examine f
<where>
select * from bus_hotwork_cfd_examine f where f.IS_DELETE = '0'
<if test="HOTWORK_ID != null and HOTWORK_ID != ''">
and f.HOTWORK_ID = #{HOTWORK_ID}
</if>
@ -131,19 +140,166 @@ select * from bus_hotwork_cfd_examine f
<if test="USER_ID != null and USER_ID != ''">
and f.USER_ID = #{USER_ID}
</if>
<if test="DEPARTMENT_ID != null and DEPARTMENT_ID != ''">
and f.DEPARTMENT_ID = #{DEPARTMENT_ID}
</if>
<if test="TYPE != null and TYPE != ''">
and f.TYPE = #{TYPE}
</if>
<if test="STATUS != null and STATUS != ''">
and f.STATUS = #{STATUS}
</select>
<select id="safetylistPage" resultType="com.zcloud.entity.PageData">
select
f.CORPINFO_ID,
f.ISDELETE,
f.CREATTIME,
f.CREATOR,
f.OPERATTIME,
f.OPERATOR,
f.CHECK_NO,
f.WORK_CONTENT,
f.WORK_START_DATE,
f.WORK_END_DATE,
f.CONFIRM_DEPARTMENT_ID,
f.CONFIRM_USER_ID,
f.CONFIRM_USER_SIGNER_PATH,
f.CONFIRM_USER_SIGNER_TIME,
f.AUDIT_DEPARTMENT_ID,
f.AUDIT_USER_ID,
f.AUDIT_USER_SIGNER_PATH,
f.AUDIT_USER_SIGNER_TIME,
f.APPROVE_DEPARTMENT_ID,
f.APPROVE_USER_ID,
f.APPROVE_USER_SIGNER_PATH,
f.APPROVE_USER_SIGNER_TIME,
f.APPLY_STATUS,
f.CONFIRM_CONTENT,
f.AUDIT_CONTENT,
f.APPROVE_CONTENT,
f.OTHER_PROTECTIVE_MEASURES,
f.ACCEPT_DEPARTMENT_ID,
f.ACCEPT_USER_ID,
f.ACCEPT_USER_SIGNER_PATH,
f.ACCEPT_USER_SIGNER_TIME,
f.ACCEPT_CONTENT,
f.APPLY_DEPARTMENT_ID,
f.APPLY_USER_ID,
f.WORK_PLACE,
f.WORK_LEVEL,
f.WORK_USER,
f.WORK_LONGITUDE,
f.WORK_LATITUDE,
f.SPECIAL_WORK,
f.RISK_IDENTIFICATION,
f.WORK_MANAGER,
f.ANALYZE_DEPARTMENT_ID,
f.ANALYZE_USER_ID,
f.GUARDIAN_DEPARTMENT_ID,
f.GUARDIAN_USER_ID,
f.GUARDIAN_USER_SIGNER_PATH,
f.GUARDIAN_USER_SIGNER_TIME,
f.GUARDIAN_CONTENT,
f.LEADER_DEPARTMENT_ID,
f.LEADER_USER_ID,
f.LEADER_USER_SIGNER_PATH,
f.LEADER_USER_SIGNER_TIME,
f.LEADER_CONTENT,
f.MONITOR_DEPARTMENT_ID,
f.MONITOR_USER_ID,
f.MONITOR_USER_SIGNER_PATH,
f.MONITOR_USER_SIGNER_TIME,
f.MONITOR_CONTENT,
f.CONFESS_USER,
f.EDUCATE_USER,
f.ACCEPT_EDUCATE_USER,
f.TRIAL_USER,
f.WORK_FUNCTION,
f.GUARDIAN_USER,
f.HOTWORK_ID,
f.CONFESS_DEPARTMENT_ID,
f.CONFESS_USER_ID,
f.CONFESS_USER_SIGNER_PATH,
f.CONFESS_USER_SIGNER_TIME,
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.ANALYZE_TIME,
(SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from BUS_HOTWORK_ACCEPTUSER_CFD a where a.ISDELETE = '0'
AND a.HOTWORK_ID = f.HOTWORK_ID
ORDER BY
a.ACCEPT_CONFESS_USER_SIGNER_TIME DESC LIMIT 1) as ACCEPT_CONFESS_USER_SIGNER_TIME,
ad.NAME as APPLY_DEPARTMENT_NAME,
getFullName(ad.DEPARTMENT_ID) APPLY_DEPARTMENT_ALL,
au.NAME as APPLY_USER_NAME,
cd.NAME as CONFIRM_DEPARTMENT_NAME,
cu.NAME as CONFIRM_USER_NAME,
gd.NAME as GUARDIAN_DEPARTMENT_NAME,
gu.NAME as GUARDIAN_USER_NAME,
ld.NAME as LEADER_DEPARTMENT_NAME,
lu.NAME as LEADER_USER_NAME,
aud.NAME as AUDIT_DEPARTMENT_NAME,
auu.NAME as AUDIT_USER_NAME,
apd.NAME as APPROVE_DEPARTMENT_NAME,
apu.NAME as APPROVE_USER_NAME,
md.NAME as MONITOR_DEPARTMENT_NAME,
mu.NAME as MONITOR_USER_NAME,
acd.NAME as ACCEPT_DEPARTMENT_NAME,
acu.NAME as ACCEPT_USER_NAME,
ac.NAME as CONFESS_DEPARTMENT_NAME,
accu.NAME as CONFESS_USER_NAME,
aac.NAME as ACCEPT_CONFESS_DEPARTMENT_NAME,
aacu.NAME as ACCEPT_CONFESS_USER_NAME,
anad.NAME as ANALYZE_DEPARTMENT_NAME,
anau.NAME as ANALYZE_USER_NAME
from bus_hotwork_cfd f
left join OA_DEPARTMENT ad on ad.DEPARTMENT_ID = f.APPLY_DEPARTMENT_ID
left join SYS_USER au on au.USER_ID = f.APPLY_USER_ID
left join OA_DEPARTMENT aac on aac.DEPARTMENT_ID = f.ACCEPT_CONFESS_DEPARTMENT_ID
left join SYS_USER aacu on aacu.USER_ID = f.ACCEPT_CONFESS_USER_ID
left join OA_DEPARTMENT ac on ac.DEPARTMENT_ID = f.CONFESS_DEPARTMENT_ID
left join SYS_USER accu on accu.USER_ID = f.CONFESS_USER_ID
left join OA_DEPARTMENT cd on cd.DEPARTMENT_ID = f.CONFIRM_DEPARTMENT_ID
left join SYS_USER cu on cu.USER_ID = f.CONFIRM_USER_ID
left join OA_DEPARTMENT gd on gd.DEPARTMENT_ID = f.GUARDIAN_DEPARTMENT_ID
left join SYS_USER gu on gu.USER_ID = f.GUARDIAN_USER_ID
left join OA_DEPARTMENT ld on ld.DEPARTMENT_ID = f.LEADER_DEPARTMENT_ID
left join SYS_USER lu on lu.USER_ID = f.LEADER_USER_ID
left join OA_DEPARTMENT aud on aud.DEPARTMENT_ID = f.AUDIT_DEPARTMENT_ID
left join SYS_USER auu on auu.USER_ID = f.AUDIT_USER_ID
left join OA_DEPARTMENT apd on apd.DEPARTMENT_ID = f.APPROVE_DEPARTMENT_ID
left join SYS_USER apu on apu.USER_ID = f.APPROVE_USER_ID
left join OA_DEPARTMENT md on md.DEPARTMENT_ID = f.MONITOR_DEPARTMENT_ID
left join SYS_USER mu on mu.USER_ID = f.MONITOR_USER_ID
left join OA_DEPARTMENT acd on acd.DEPARTMENT_ID = f.ACCEPT_DEPARTMENT_ID
left join SYS_USER acu on acu.USER_ID = f.ACCEPT_USER_ID
left join OA_DEPARTMENT anad on anad.DEPARTMENT_ID = f.ANALYZE_DEPARTMENT_ID
left join SYS_USER anau on anau.USER_ID = f.ANALYZE_USER_ID
where f.ISDELETE = '0'
and f.APPLY_STATUS &lt; 8 and f.CONFESS_USER_SIGNER_TIME is null and f.APPLY_STATUS &gt; 0
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != ''">
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
</if>
<if test="VALID_FLAG != null and VALID_FLAG != ''">
and f.VALID_FLAG = #{VALID_FLAG}
<if test="pd.USER_ID != null and pd.USER_ID != ''">
and exists (select 1 from bus_hotwork_cfd_examine bhce where bhce.USER_ID = #{pd.USER_ID} and bhce.IS_DELETE =
'0' and bhce.VALID_FLAG = '1' and bhce.APPROVAL_STATUS = '0' and bhce.TYPE = '0')
</if>
</where>
ORDER BY f.APPLY_STATUS,f.CREATTIME DESC
</select>
</mapper>

View File

@ -955,8 +955,6 @@
f.ACCEPT_CONFESS_DEPARTMENT_ID,
f.ACCEPT_CONFESS_USER_ID,
f.ANALYZE_TIME,
<!--(SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from BUS_HOTWORK_ACCEPTUSER a where a.ISDELETE = '0'-->
(SELECT a.ACCEPT_CONFESS_USER_SIGNER_TIME from BUS_HOTWORK_ACCEPTUSER_CFD a where a.ISDELETE = '0'
AND a.HOTWORK_ID = f.HOTWORK_ID
ORDER BY