Browse Source

优化联合技术审查

master
zhouhaibin 3 months ago
parent
commit
ebf56887c5
  1. 4
      huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouUploadfileinfoController.java
  2. 6
      huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/WorkflowController.java
  3. 2
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouUploadfileinfoService.java
  4. 6
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouPlaninfoServiceImpl.java
  5. 12
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java
  6. 104
      huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouUploadfileinfoServiceImpl.java

4
huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/HuzhouUploadfileinfoController.java

@ -130,8 +130,8 @@ public class HuzhouUploadfileinfoController {
}
@PostMapping("/uploadURTFile")
public Result<?> uploadURTFile(@RequestParam(value = "file")
MultipartFile[] files,@RequestParam(value = "projectid") String projectid) throws IOException {
uploadfileinfoService.submitURTFile(files, projectid,"6");
MultipartFile[] files,@RequestParam(value = "planinfoid") String planinfoid) throws IOException {
uploadfileinfoService.submitURTFile(files, planinfoid,"6");
return Result.OK("上传成功!!");
}

6
huzhou/src/main/java/com/easy/admin/modules/huzhou/controller/WorkflowController.java

@ -387,9 +387,9 @@ public class WorkflowController {
}
}
for(HashMap<String, Object> lastUser:approvalEntityList){
// if ("0".equals(lastUser.get("approvalStatue"))) {
// continue;
// }
if ("0".equals(lastUser.get("approvalStatue"))) {
continue;
}
for (int i =0;i<userTaskList.size();i++ ) {
UserTask task=userTaskList.get(i);
// HashMap<String, Object> lastUser = approvalEntityList.get(approvalEntityList.size() - 1);//获取最后一个

2
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/IHuzhouUploadfileinfoService.java

@ -29,7 +29,7 @@ public interface IHuzhouUploadfileinfoService extends IService<HuzhouUploadfilei
*/
IPage<HuzhouUploadfileinfo> getuploacFilePageListOk(HuzhouUploadfileinfo uploadfileinfo, Integer pageNo, Integer pageSize);
void submitURTFile(MultipartFile[] files, String projectid, String s) throws IOException;
void submitURTFile(MultipartFile[] files, String planinfoid, String s) throws IOException;
void approveURTFile(MultipartFile[] files, String taskId, String flag, String projectid, String comment, MultipartFile[] adviceFiles) throws IOException;
}

6
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouPlaninfoServiceImpl.java

@ -561,11 +561,11 @@ public class HuzhouPlaninfoServiceImpl extends ServiceImpl<HuzhouPlaninfoMapper,
String taskId=list.get(0).getId();
// //根据流程实例查询当前流所在位置
Task task = taskService.createTaskQuery()
List<Task> taskList = taskService.createTaskQuery()
.processInstanceId(processInstanceId)
.active()
.singleResult();
String name = task.getName();
.list();
String name = taskList.get(0).getName();
if("发起人".equals(name)){
hashMap.put("isEdit","1");

12
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouProjectinfoServiceImpl.java

@ -1216,6 +1216,18 @@ public class HuzhouProjectinfoServiceImpl extends ServiceImpl<HuzhouProjectinfoM
projectInfoAuthSelect.setUtrIsfinishList(Arrays.asList(split));
}
Page<HuzhouProjectinfoOV> unitedTechnicalReviewList = projectinfoMapper.getUnitedTechnicalReviewList(projectInfoAndChildPageList, projectInfoAuthSelect);
List<HuzhouProjectinfoOV> records = unitedTechnicalReviewList.getRecords();
records.forEach(item -> {
item.setMissingSubprojects(false);//设置默认是false
double subTotalMoney = 0;//子项目的总金额
List<HuzhouSubProjectinfo> subProjectinfoList = item.getChildren();
if (subProjectinfoList.size() > 0) {
} else {
//没有子项目
item.setChildren(null);
}
});
return unitedTechnicalReviewList;
}

104
huzhou/src/main/java/com/easy/admin/modules/huzhou/service/impl/HuzhouUploadfileinfoServiceImpl.java

@ -9,12 +9,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.easy.admin.auth.model.SysUser;
import com.easy.admin.auth.service.SysUserService;
import com.easy.admin.common.util.CommonUtils;
import com.easy.admin.modules.huzhou.dao.HuzhouPlaninfoMapper;
import com.easy.admin.modules.huzhou.dao.HuzhouPlaninfofileMapper;
import com.easy.admin.modules.huzhou.dao.HuzhouProcessinfoMapper;
import com.easy.admin.modules.huzhou.dao.HuzhouUploadfileinfoMapper;
import com.easy.admin.modules.huzhou.entity.BaseEntity;
import com.easy.admin.modules.huzhou.entity.HuzhouProcessinfo;
import com.easy.admin.modules.huzhou.entity.HuzhouUploadfileinfo;
import com.easy.admin.modules.huzhou.entity.WorkFlow;
import com.easy.admin.modules.huzhou.entity.*;
import com.easy.admin.modules.huzhou.service.IHuzhouPlaninfoService;
import com.easy.admin.modules.huzhou.service.IHuzhouProcessinfoService;
import com.easy.admin.modules.huzhou.service.IHuzhouUploadfileinfoService;
import com.easy.admin.modules.huzhou.service.IWorkflowService;
@ -65,7 +65,10 @@ public class HuzhouUploadfileinfoServiceImpl extends ServiceImpl<HuzhouUploadfil
private IdentityService identityService;
@Autowired
private SysUserService userService;
@Autowired
private HuzhouPlaninfoMapper planinfoMapper;
@Autowired
private HuzhouPlaninfofileMapper planinfofileMapper;
public void modifyUploadFile(MultipartFile[] files, String projectid, String stage) throws IOException {
@ -189,15 +192,22 @@ public class HuzhouUploadfileinfoServiceImpl extends ServiceImpl<HuzhouUploadfil
}
@Override
public void submitURTFile(MultipartFile[] files, String projectid, String s) throws IOException {
WorkFlow workFlow = workflowService.createFlow("createURT", projectid);//创建流程
public void submitURTFile(MultipartFile[] files, String planinfoid, String s) throws IOException {
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualStartTime(new Date());
planinfoMapper.updateById(huzhouPlaninfo);
WorkFlow workFlow = workflowService.createFlow("createURT", planinfoid);//创建流程
String taskId = workFlow.getTask().getId();
String processInstanceId = workFlow.getProcessInstanceId();
taskService.setVariableLocal(taskId, "approvalStatue", "1");//添加审批状态 通过
String comment = "同意";
taskService.addComment(taskId, processInstanceId, comment);//添加审批意见
taskService.complete(taskId);
saveFileAndFileInfo(files, projectid, s);
// saveFileAndFileInfo(files, planinfoid, s);
this.modifyUploadFileByURT(files,planinfoid,"1","1");
}
@Override
@ -211,16 +221,22 @@ public class HuzhouUploadfileinfoServiceImpl extends ServiceImpl<HuzhouUploadfil
List<HuzhouProcessinfo> processinfos = processinfoService.list(queryWrapper);
String processName = processinfos.get(0).getProcessName();
if(files!=null&&"1".equals(flag)){
modifyUploadFile(files,projectid,"6");
this.modifyUploadFileByURT(files,projectid,"2","1");
}
//意见文件
if(adviceFiles!=null){
modifyUploadFileByURT(adviceFiles,projectid,"7");
this.modifyUploadFileByURT(adviceFiles,projectid,"2","2");
}
WorkFlow workFlow = workflowService.approveProjectInfo(taskId, flag, comment);
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(workFlow.getProcessInstanceId()).singleResult();
if(processInstance==null&&"1".equals(flag)){
processinfoService.modifyStatusByProjectId(projectid,"2",processName);
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(projectid);
huzhouPlaninfo.setIsfinish("2");
huzhouPlaninfo.setActualEndTime(new Date());
planinfoMapper.updateById(huzhouPlaninfo);
}else{
//如果流程未完成,检查流程是否被拒绝退回,退回后,之前同意的系统默认同意
List<Task> tasks = taskService.createTaskQuery()
@ -267,44 +283,56 @@ public class HuzhouUploadfileinfoServiceImpl extends ServiceImpl<HuzhouUploadfil
}
}
}
public void modifyUploadFileByURT(MultipartFile[] files, String projectid, String stage) throws IOException {
LambdaUpdateWrapper<HuzhouUploadfileinfo> queryWrapper = new LambdaUpdateWrapper<>();
queryWrapper.eq(HuzhouUploadfileinfo::getProjectid,projectid);
queryWrapper.eq(HuzhouUploadfileinfo::getStage,stage);
queryWrapper.eq(BaseEntity::getCreateUser,ShiroUtil.getCurrentUser().getId());
queryWrapper.set(HuzhouUploadfileinfo::getStatus,"0");
this.update(queryWrapper);
public void modifyUploadFileByURT(MultipartFile[] files, String planinfoid, String type,String stage) throws IOException {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
String currentDay = dateFormat.format(new Date());
SysUser currentUser = ShiroUtil.getCurrentUser();
String nickname = currentUser.getNickname();
File filePath = new File(uploadpath + File.separator +nickname+ File.separator+currentDay+File.separator);
File filePath = new File(uploadpath +File.separator+"planinfoFile"+ File.separator + nickname+ File.separator+currentDay+File.separator);
//文件夹不存在则创建
if (!filePath.exists()) {
// 创建文件根目录
filePath.mkdirs();
}else {
// return modifyUploadFile(files,projectid,status);
}
for (MultipartFile item:files) {
String fileName =null;
String originalFilename = item.getOriginalFilename();
originalFilename = CommonUtils.getFileName(originalFilename);
if(originalFilename.indexOf(".")!=-1){
fileName = originalFilename.substring(0, originalFilename.lastIndexOf(".")) + "_" + System.currentTimeMillis() + originalFilename.substring(originalFilename.lastIndexOf("."));
}else{
fileName = originalFilename+ "_" + System.currentTimeMillis();
if(null!=files){
for (MultipartFile item:files) {
String fileName =null;
String originalFilename = item.getOriginalFilename();
originalFilename = CommonUtils.getFileName(originalFilename);
if(originalFilename.indexOf(".")!=-1){
fileName = originalFilename.substring(0, originalFilename.lastIndexOf(".")) + "_" + System.currentTimeMillis() + originalFilename.substring(originalFilename.lastIndexOf("."));
}else{
fileName = originalFilename+ "_" + System.currentTimeMillis();
}
String savePath = filePath.getPath() + File.separator + fileName;
File savefile = new File(savePath);
FileCopyUtils.copy(item.getBytes(), savefile);//保存文件
if("2".equals(type)){
//修改以前记录为作废
LambdaUpdateWrapper<HuzhouPlaninfofile> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(HuzhouPlaninfofile::getPlaninfoid,planinfoid);
updateWrapper.eq(HuzhouPlaninfofile::getCreateUser,currentUser.getId());
updateWrapper.set(HuzhouPlaninfofile::getStatus,"0");
planinfofileMapper.update(null,updateWrapper);
}
HuzhouPlaninfofile huzhouUploadfileinfo = new HuzhouPlaninfofile();
huzhouUploadfileinfo.setDocumentName(originalFilename);//未加工过的文件名称
huzhouUploadfileinfo.setDocumentType(item.getContentType());
huzhouUploadfileinfo.setDocumentPath(savePath);
huzhouUploadfileinfo.setSize(item.getSize());
huzhouUploadfileinfo.setPlaninfoid(planinfoid);
huzhouUploadfileinfo.setStatus("1");
huzhouUploadfileinfo.setStage(stage);
planinfofileMapper.insert(huzhouUploadfileinfo);
}
String savePath = filePath.getPath() + File.separator + fileName;
File savefile = new File(savePath);
FileCopyUtils.copy(item.getBytes(), savefile);//保存文件
HuzhouUploadfileinfo huzhouUploadfileinfo = new HuzhouUploadfileinfo();
huzhouUploadfileinfo.setDocumentName(originalFilename);//未加工过的文件名称
huzhouUploadfileinfo.setDocumentType(item.getContentType());
huzhouUploadfileinfo.setDocumentPath(savePath);
huzhouUploadfileinfo.setStage(stage);
huzhouUploadfileinfo.setStatus("1");
huzhouUploadfileinfo.setSize(item.getSize());
huzhouUploadfileinfo.setProjectid(projectid);
boolean save = this.save(huzhouUploadfileinfo);
}
HuzhouPlaninfo huzhouPlaninfo = new HuzhouPlaninfo();
huzhouPlaninfo.setId(planinfoid);
huzhouPlaninfo.setIsfinish("1");
huzhouPlaninfo.setActualEndTime(new Date());
planinfoMapper.updateById(huzhouPlaninfo);
}
}

Loading…
Cancel
Save