|
@@ -22,6 +22,8 @@ import com.itextpdf.text.Document;
|
|
|
import com.itextpdf.text.pdf.PdfCopy;
|
|
|
import com.itextpdf.text.pdf.PdfReader;
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import javassist.bytecode.stackmap.BasicBlock;
|
|
|
import lombok.AllArgsConstructor;
|
|
@@ -53,6 +55,7 @@ import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springblade.core.mp.base.BaseService;
|
|
|
import org.springblade.core.oss.model.BladeFile;
|
|
|
import org.springblade.core.redis.cache.BladeRedis;
|
|
|
+import org.springblade.core.secure.BladeUser;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
@@ -253,10 +256,10 @@ public class TaskController extends BladeController {
|
|
|
throw new ServiceException("当前期数的数据中存在已上报的任务,操作失败");
|
|
|
}
|
|
|
/*校验计量单金额是否为0*/
|
|
|
- BigDecimal reduce = middleMeterApplies.stream().map(l -> l.getMeterMoney()).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- if (reduce.compareTo(BigDecimal.ZERO) == 0){
|
|
|
- throw new ServiceException("上报金额不能为0");
|
|
|
- }
|
|
|
+// BigDecimal reduce = middleMeterApplies.stream().map(l -> l.getMeterMoney()).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+// if (reduce.compareTo(BigDecimal.ZERO) == 0){
|
|
|
+// throw new ServiceException("上报金额不能为0");
|
|
|
+// }
|
|
|
|
|
|
/*获取所有中间计量申请下的清单信息*/
|
|
|
List<Long> middleMeterAppliesIds = middleMeterApplies.stream().map(MiddleMeterApply::getId).collect(Collectors.toList());
|
|
@@ -1286,9 +1289,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
//校验当前用户在第几流程
|
|
|
- Integer sort = query.stream().collect(Collectors.toMap(l -> l.getFixedFlowLinkUser(), l -> l.getFixedFlowBranchSort())).get(AuthUtil.getUserId());
|
|
|
+ /* Map<Long, Integer> collect = query.stream().collect(Collectors.toMap(l -> l.getFixedFlowLinkUser(), l -> l.getFixedFlowBranchSort()));
|
|
|
+
|
|
|
+ Integer sort = collect.get(AuthUtil.getUserId());
|
|
|
// 为空则代表是上报人,直接显示当前结果
|
|
|
- currentUserFlow = sort;
|
|
|
+ currentUserFlow = sort;*/
|
|
|
|
|
|
Map<String, List<FixedFlowLink>> group = query.stream()
|
|
|
.collect(Collectors.groupingBy(obj -> obj.getFixedFlowLink() + "@@@" + obj.getFixedFlowLinkType(),
|
|
@@ -1394,8 +1399,8 @@ public class TaskController extends BladeController {
|
|
|
}else {
|
|
|
vo.setType(task.getMeterTaskType() == 2 ? 1 : 2);
|
|
|
}
|
|
|
- if (reportAllMoney == null || reportAllMoney.compareTo(BigDecimal.ZERO) == 0){
|
|
|
- throw new ServiceException("上报金额不能为0");
|
|
|
+ if (reportAllMoney == null){
|
|
|
+ throw new ServiceException("上报金额不能为空");
|
|
|
}
|
|
|
reportAllMoney =reportAllMoney.setScale(0,RoundingMode.HALF_UP);
|
|
|
vo.setReportAllMoney(reportAllMoney);
|
|
@@ -2543,20 +2548,7 @@ public class TaskController extends BladeController {
|
|
|
|
|
|
//单独保存意见单
|
|
|
if (task.getMeterTaskType() != null && Arrays.asList(1,2,3).contains(task.getMeterTaskType())) {
|
|
|
- MeterApproveOpinion opinion = dto.getMeterApproveOpinion();
|
|
|
- if (opinion != null) {
|
|
|
- if (StringUtils.isBlank(opinion.getChiefExecutive()))opinion.setChiefExecutive(null);
|
|
|
- if (StringUtils.isBlank(opinion.getContractDept()))opinion.setContractDept(null);
|
|
|
- if (StringUtils.isBlank(opinion.getProjectBuild()))opinion.setProjectBuild(null);
|
|
|
- if (StringUtils.isBlank(opinion.getGeneralManager()))opinion.setGeneralManager(null);
|
|
|
- if (StringUtils.isBlank(opinion.getChiefSupervisor()))opinion.setChiefSupervisor(null);
|
|
|
- if (StringUtils.isBlank(opinion.getSafetyManager()))opinion.setSafetyManager(null);
|
|
|
- if (StringUtils.isBlank(opinion.getContractDeptLeader()))opinion.setContractDeptLeader(null);
|
|
|
- if (StringUtils.isBlank(opinion.getProjectBuildLeader()))opinion.setProjectBuildLeader(null);
|
|
|
- if (StringUtils.isBlank(opinion.getSafetyManagerLeader()))opinion.setSafetyManagerLeader(null);
|
|
|
- if (StringUtils.isBlank(opinion.getSupervisorAudit()))opinion.setSupervisorAudit(null);
|
|
|
- opinionMapper.updateById(opinion);
|
|
|
- }
|
|
|
+ this.saveOpinion(dto);
|
|
|
}
|
|
|
|
|
|
//如果要生成审计意见单
|
|
@@ -2565,7 +2557,9 @@ public class TaskController extends BladeController {
|
|
|
checkMiddleApp(dto, task, taskParallels);
|
|
|
}
|
|
|
|
|
|
+ //判断签字状态
|
|
|
boolean isCurrentUserLastApprove = checkTheTaskPersonSort(taskParallels);
|
|
|
+
|
|
|
/*单条业务数据状态*/
|
|
|
updateCopyDataStatus(task, dto);
|
|
|
String reportId = null;
|
|
@@ -2652,6 +2646,175 @@ public class TaskController extends BladeController {
|
|
|
return R.fail("操作失败");
|
|
|
}
|
|
|
|
|
|
+ private void saveOpinion(TaskApproveDTO dto) {
|
|
|
+ MeterApproveOpinion opinion = dto.getMeterApproveOpinion();
|
|
|
+ //获取最新的意见单
|
|
|
+ MeterApproveOpinion oldOpinion = opinionMapper.selectById(opinion.getId());
|
|
|
+ if (opinion != null) {
|
|
|
+ if (StringUtils.isBlank(opinion.getChiefExecutive())) {
|
|
|
+ opinion.setChiefExecutive(null);
|
|
|
+ }else {
|
|
|
+ //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
+ if (oldOpinion != null){
|
|
|
+ if (StringUtils.isBlank(oldOpinion.getChiefExecutive())){
|
|
|
+ opinion.setChiefExecutiveUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setChiefExecutiveTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
|
|
|
+ opinion.setChiefExecutiveUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setChiefExecutiveTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(opinion.getContractDept())) {
|
|
|
+ opinion.setContractDept(null);
|
|
|
+ }else {
|
|
|
+ //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
+ if (oldOpinion != null){
|
|
|
+ if (StringUtils.isBlank(oldOpinion.getContractDept())){
|
|
|
+ opinion.setContractDeptUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setContractDeptTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
|
|
|
+ opinion.setContractDeptUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setContractDeptTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(opinion.getProjectBuild())) {
|
|
|
+ opinion.setProjectBuild(null);
|
|
|
+ }else {
|
|
|
+ //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
+ if (oldOpinion != null){
|
|
|
+ if (StringUtils.isBlank(oldOpinion.getProjectBuild())){
|
|
|
+ opinion.setProjectBuildUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setProjectBuildTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
|
|
|
+ opinion.setProjectBuildUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setProjectBuildTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(opinion.getGeneralManager())) {
|
|
|
+ opinion.setGeneralManager(null);
|
|
|
+ }else {
|
|
|
+ //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
+ if (oldOpinion != null){
|
|
|
+ if (StringUtils.isBlank(oldOpinion.getGeneralManager())){
|
|
|
+ opinion.setGeneralManagerUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setGeneralManagerTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
|
|
|
+ opinion.setGeneralManagerUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setGeneralManagerTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(opinion.getChiefSupervisor())) {
|
|
|
+ opinion.setChiefSupervisor(null);
|
|
|
+ }else {
|
|
|
+ //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
+ if (oldOpinion != null){
|
|
|
+ if (StringUtils.isBlank(oldOpinion.getChiefSupervisor())){
|
|
|
+ opinion.setChiefSupervisorUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setChiefSupervisorTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
|
|
|
+ opinion.setChiefSupervisorUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setChiefSupervisorTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(opinion.getSafetyManager())) {
|
|
|
+ opinion.setSafetyManager(null);
|
|
|
+ }else {
|
|
|
+ //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
+ if (oldOpinion != null){
|
|
|
+ if (StringUtils.isBlank(oldOpinion.getSafetyManager())){
|
|
|
+ opinion.setSafetyManagerUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setSafetyManagerTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
|
|
|
+ opinion.setSafetyManagerUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setSafetyManagerTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(opinion.getContractDeptLeader())) {
|
|
|
+ opinion.setContractDeptLeader(null);
|
|
|
+ }else {
|
|
|
+ //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
+ if (oldOpinion != null){
|
|
|
+ if (StringUtils.isBlank(oldOpinion.getContractDeptLeader())){
|
|
|
+ opinion.setContractDeptLeaderUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setContractDeptLeaderTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
|
|
|
+ opinion.setContractDeptLeaderUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setContractDeptLeaderTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(opinion.getProjectBuildLeader())) {
|
|
|
+ opinion.setProjectBuildLeader(null);
|
|
|
+ }else {
|
|
|
+ //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
+ if (oldOpinion != null){
|
|
|
+ if (StringUtils.isBlank(oldOpinion.getProjectBuildLeader())){
|
|
|
+ opinion.setProjectBuildLeaderUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setProjectBuildLeaderTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
|
|
|
+ opinion.setProjectBuildLeaderUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setProjectBuildLeaderTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(opinion.getSafetyManagerLeader())) {
|
|
|
+ opinion.setSafetyManagerLeader(null);
|
|
|
+ }else {
|
|
|
+ //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
+ if (oldOpinion != null){
|
|
|
+ if (StringUtils.isBlank(oldOpinion.getSafetyManagerLeader())){
|
|
|
+ opinion.setSafetyManagerLeaderUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setSafetyManagerLeaderTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
|
|
|
+ opinion.setSafetyManagerLeaderUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setSafetyManagerLeaderTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(opinion.getSupervisorAudit())) {
|
|
|
+ opinion.setSupervisorAudit(null);
|
|
|
+ }else {
|
|
|
+ //如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
+ if (oldOpinion != null){
|
|
|
+ if (StringUtils.isBlank(oldOpinion.getSupervisorAudit())){
|
|
|
+ opinion.setSupervisorAuditUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setSupervisorAuditTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //如果不存在数据,则判断当前是否填写了总监理工程师数据,填写了,则设置用户id名称时间
|
|
|
+ opinion.setSupervisorAuditUserName(AuthUtil.getNickName());
|
|
|
+ opinion.setSupervisorAuditTime(LocalDateTime.now());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ opinionMapper.updateById(opinion);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void checkMiddleApp(TaskApproveDTO dto, Task task, List<TaskParallel> taskParallels) {
|
|
|
String html = this.getExcelHtmlByBuss(Long.valueOf(task.getProjectId()));
|
|
|
if (html != null) {
|
|
@@ -3246,6 +3409,22 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @GetMapping("/backMeterTask")
|
|
|
+ @ApiOperationSupport(order = 22)
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "periodId", value = "期数ID"),
|
|
|
+ @ApiImplicitParam(name = "type", value = "类型(0中间,1材料,2开工)")
|
|
|
+ })
|
|
|
+ public R backMeterTask(@RequestParam String periodId, @RequestParam Integer type) {
|
|
|
+ // 0中间,1材料,2开工
|
|
|
+ String delTaskPall = "DELETE from u_task_parallel where process_instance_id in(SELECT process_instance_id from u_task where form_data_id ='"+periodId+"') ";
|
|
|
+ String delTask = "DELETE from u_task where form_data_id ='"+periodId+"'";
|
|
|
+ jdbcTemplate.execute(delTaskPall);
|
|
|
+ jdbcTemplate.execute(delTask);
|
|
|
+ return R.success("成功");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@GetMapping("/meterPdfInfo")
|
|
|
@ApiOperationSupport(order = 22)
|
|
|
@ApiOperation(value = "计量生成Pdf", notes = "计量生成Pdf")
|
|
@@ -3796,8 +3975,9 @@ public class TaskController extends BladeController {
|
|
|
&& ObjectUtil.isNotEmpty(dto.getProjectId())
|
|
|
&& ObjectUtil.isNotEmpty(dto.getContractId())) {
|
|
|
|
|
|
+ // 获取流产下的节点流程信息
|
|
|
List<SaveFixedFlowDTO.FixedBranch> fixedBranchList = dto.getFixedBranchList();
|
|
|
- Set<String> allUserIds = new HashSet<>();
|
|
|
+ /*Set<String> allUserIds = new HashSet<>();
|
|
|
Set<String> duplicateUserIds = new HashSet<>();
|
|
|
for (SaveFixedFlowDTO.FixedBranch fixedBranch : fixedBranchList) {
|
|
|
String userIds = fixedBranch.getUserIds();
|
|
@@ -3819,7 +3999,7 @@ public class TaskController extends BladeController {
|
|
|
names.add(orDefault);
|
|
|
}
|
|
|
throw new ServiceException("每个任务人只能归属于一个任务中,以下任务人重复:" + String.join("、", names));
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
/*检查签字证书信息*/
|
|
|
List<String> userIds = dto.getFixedBranchList().stream().map(SaveFixedFlowDTO.FixedBranch::getUserIds).collect(Collectors.toList());
|
|
@@ -4002,7 +4182,7 @@ public class TaskController extends BladeController {
|
|
|
} else {
|
|
|
fileUrl = aPrivate.getHtmlUrl();
|
|
|
}
|
|
|
- try (InputStream fileInputStream = new FileInputStream(fileUrl)){
|
|
|
+ try (InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl)){
|
|
|
String htmlString = IoUtil.readToString(fileInputStream);
|
|
|
htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
|
|
|
htmlString = htmlString.replaceAll("title", "titlexx");
|