动火合并打回与保存功能

pull/4/head
chenxinying 2024-01-24 17:14:19 +08:00
parent eb6ea22dfd
commit 0a64479a7d
4 changed files with 41 additions and 46 deletions

View File

@ -125,18 +125,6 @@ public class AppHotworkController extends BaseController {
return map; return map;
} }
@RequestMapping("/cancel")
@ResponseBody
@LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "打回")
public Object cancel()throws Exception{
Map<String, Object> map = new HashMap<>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
hotworkService.cancel(pd);
map.put("result",errInfo);
return map;
}
@RequestMapping("/nextStep") @RequestMapping("/nextStep")
@ResponseBody @ResponseBody
@ -215,12 +203,18 @@ public class AppHotworkController extends BaseController {
@RequestMapping(value="/gas/save") @RequestMapping(value="/gas/save")
@ResponseBody @ResponseBody
@LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "保存气体检测") @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "保存气体检测")
public Object gasSave(@RequestParam(value="file",required=false) MultipartFile file) throws Exception{ public Object gasSave(MultipartRequest request) throws Exception{
Map<String,Object> map = new HashMap<String,Object>(); Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success"; String errInfo = "success";
PageData pd = new PageData(); PageData pd = new PageData();
pd = this.getPageData(); pd = this.getPageData();
hotworkService.saveGas(pd,file); List<MultipartFile> fileList = new ArrayList<MultipartFile>();
String SIGNTIME[] = pd.getString("SIGNTIME").split(",");
for (int i = 0; i < SIGNTIME.length; i++) {
fileList.add(request.getFile("file" + i));
}
hotworkService.saveGas(pd,fileList.toArray(new MultipartFile[fileList.size()]));
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }

View File

@ -18,7 +18,6 @@ public interface HotworkMapper {
void editGasTime(PageData pd); void editGasTime(PageData pd);
void editStep(PageData pd); void editStep(PageData pd);
List<PageData> datalistPage(Page page); List<PageData> datalistPage(Page page);
void cancel(PageData pd);
List<PageData> listAllMeasures(); List<PageData> listAllMeasures();
List<PageData> checkWorkCount(PageData pd); List<PageData> checkWorkCount(PageData pd);

View File

@ -22,8 +22,6 @@ public interface HotworkService {
void nextStep(PageData pd, MultipartFile[] files) throws Exception; void nextStep(PageData pd, MultipartFile[] files) throws Exception;
void cancel(PageData pd) throws Exception;
PageData findById(PageData pd) throws Exception; PageData findById(PageData pd) throws Exception;
PageData checkWorkCount(PageData pd); PageData checkWorkCount(PageData pd);
@ -37,6 +35,6 @@ public interface HotworkService {
// //获取所有签字完成的措施(bus_hotworktomeasures) // //获取所有签字完成的措施(bus_hotworktomeasures)
List<PageData> listSignFinishMeasures(PageData pd) throws Exception; List<PageData> listSignFinishMeasures(PageData pd) throws Exception;
void saveGas(PageData pd,MultipartFile file) throws Exception; void saveGas(PageData pd,MultipartFile[] files) throws Exception;
} }

View File

@ -134,7 +134,7 @@ public class HotworkServiceImpl implements HotworkService {
} }
List<PageData> unsignedList = hotworkSignMapper.checkUnsigned(sign);//当前步骤未签名人列表 List<PageData> unsignedList = hotworkSignMapper.checkUnsigned(sign);//当前步骤未签名人列表
if(unsignedList == null || unsignedList.size() == 0){//如果没有未签人 则跳转下一步 if((unsignedList == null || unsignedList.size() == 0) && pd.getString("APPLY_STATUS").equals("1")){//如果没有未签人 则跳转下一步
hotworkMapper.editStep(work); hotworkMapper.editStep(work);
//保存日志 //保存日志
@ -148,21 +148,14 @@ public class HotworkServiceImpl implements HotworkService {
savePreparers(work,currentflow); savePreparers(work,currentflow);
} }
saveNextSigner(work,currentflow); saveNextSigner(work,currentflow);
}else if(pd.getString("APPLY_STATUS").equals("-1")){
work.put("STEP_ID",-1);
hotworkMapper.editStep(work);
//保存日志
saveLog(work,work.getString(flow.get("ACTOR_FIELD")),"-1");
} }
} }
/**
*
*/
@Override
@Transactional
public void cancel(PageData pd)throws Exception{
PageData flow = getStep(pd.get("TASK_ID"), pd.get("STEP_ID"));
saveLog(pd,pd.getString(flow.get("ACTOR_FIELD")),"-1");
pd.put("STEP_ID", -1);
hotworkMapper.editStep(pd);
}
@Override @Override
public PageData findById(PageData pd) throws Exception { public PageData findById(PageData pd) throws Exception {
PageData pageData = hotworkMapper.findById(pd); PageData pageData = hotworkMapper.findById(pd);
@ -202,45 +195,56 @@ public class HotworkServiceImpl implements HotworkService {
@Override @Override
@Transactional @Transactional
public void saveGas(PageData pd,MultipartFile file) throws Exception { public void saveGas(PageData pd, MultipartFile[] files) throws Exception {
PageData work = hotworkMapper.findById(pd); PageData work = hotworkMapper.findById(pd);
String ffile = DateUtil.getDays(); List<String> filePaths = new ArrayList<>();
String fileName = UuidUtil.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); for (int i = 0; i < files.length; i++) {
smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); //保存签名文件
String filePath = Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName; String ffile = DateUtil.getDays();
String fileName = UuidUtil.get32UUID() + files[i].getOriginalFilename().substring(files[i].getOriginalFilename().lastIndexOf("."));
smb.sshSftp(files[i], fileName, Const.FILEPATHFILE + work.getString("CORPINFO_ID") + "/" + ffile);
filePaths.add(Const.FILEPATHFILE + work.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName);
}
pd.put("HOTWORKGAS_ID", UuidUtil.get32UUID()); //主键 pd.put("HOTWORKGAS_ID", UuidUtil.get32UUID()); //主键
pd.put("ISDELETE", "0"); //是否删除 1-是 0-否 pd.put("ISDELETE", "0"); //是否删除 1-是 0-否
pd.put("SIGN_PATH", filePath); pd.put("SIGN_PATH", String.join(",",filePaths));
hotworkGasMapper.save(pd); hotworkGasMapper.save(pd);
hotworkMapper.editGasTime(pd);//修改最后一次气体检测时间 hotworkMapper.editGasTime(pd);//修改最后一次气体检测时间
PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); PageData flow = getStep(work.get("TASK_ID"), work.get("STEP_ID"));
if (pd.get("APPLY_STATUS").equals("1")) { //如果通过 if (pd.get("APPLY_STATUS").equals("1")) { //如果通过
if(flow.get("NEXT_STEP_ID") != null && flow.getString("NEXT_STEP_ID").equals("2")){//如果为气体检测步骤,则保存日志并跳转下一步 if(flow.get("NEXT_STEP_ID") != null && flow.getString("NEXT_STEP_ID").equals("2")) {//如果为气体检测步骤,则保存日志并跳转下一步
PageData sign = new PageData(); PageData sign = new PageData();
sign.put(primary_key, work.get(primary_key)); sign.put(primary_key, work.get(primary_key));
sign.put("STEP_ID", 2); sign.put("STEP_ID", 2);
sign.put("SIGN_USER_ID", pd.get("USER_ID")); sign.put("SIGN_USER_ID", pd.get("USER_ID"));
sign.put("SIGN_TIME", DateUtil.date2Str(new Date())); sign.put("SIGN_TIME", DateUtil.date2Str(new Date()));
sign.put("SIGN_PATH", filePath); sign.put("SIGN_PATH", String.join(",", filePaths));
sign.put("DESCR", pd.get("DESCR")); sign.put("DESCR", pd.get("DESCR"));
hotworkSignMapper.edit(sign); hotworkSignMapper.edit(sign);
work.put("STEP_ID", flow.get("NEXT_STEP_ID")); work.put("STEP_ID", flow.get("NEXT_STEP_ID"));
hotworkMapper.editStep(work); hotworkMapper.editStep(work);
//保存日志 //保存日志
saveLog(work,work.getString(flow.get("ACTOR_FIELD")),"1"); saveLog(work, work.getString(flow.get("ACTOR_FIELD")), "1");
//预存下一步 //预存下一步
PageData currentflow = getStep(work.get("TASK_ID"), work.get("STEP_ID")); PageData currentflow = getStep(work.get("TASK_ID"), work.get("STEP_ID"));
saveNextSigner(work,currentflow); saveNextSigner(work, currentflow);
} }
}else{ }else if(pd.getString("APPLY_STATUS").equals("-1")){
saveLog(work,pd.getString("USER_ID"),"-2"); PageData sign = new PageData();
work.put("STEP_ID", -1); sign.put(primary_key, work.get(primary_key));
sign.put("STEP_ID", 2);
sign.put("SIGN_USER_ID", pd.get("USER_ID"));
sign.put("SIGN_TIME", DateUtil.date2Str(new Date()));
sign.put("SIGN_PATH", String.join(",", filePaths));
sign.put("DESCR", pd.get("DESCR"));
hotworkSignMapper.edit(sign);
work.put("STEP_ID",-1);
hotworkMapper.editStep(work); hotworkMapper.editStep(work);
//保存日志
saveLog(work,pd.getString("USER_ID"),"-2");
} }
} }