|
@@ -2,6 +2,7 @@ package org.springblade.business.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
@@ -14,6 +15,7 @@ import org.apache.commons.lang.StringUtils;
|
|
|
import org.springblade.business.entity.ContractLog;
|
|
|
import org.springblade.business.entity.ContractLogWbs;
|
|
|
import org.springblade.business.entity.Task;
|
|
|
+import org.springblade.business.entity.TaskParallel;
|
|
|
import org.springblade.business.feign.MessageWarningClient;
|
|
|
import org.springblade.business.feign.OperationLogClient;
|
|
|
import org.springblade.business.feign.TaskClient;
|
|
@@ -67,7 +69,26 @@ public class ContractLogController extends BladeController {
|
|
|
|
|
|
private final NewIOSSClient newIOSSClient;
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 日志上报(填报页)
|
|
|
+ */
|
|
|
+ @PostMapping("/startTaskTheLog")
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
|
+ @ApiOperation(value = "日志上报(填报页)")
|
|
|
+ public R<Boolean> startTaskTheLog(@RequestBody StartTaskVO startTaskVO, @RequestParam String nodePrimaryKeyId, @RequestParam String recordTime){
|
|
|
+ if(StringUtils.isEmpty(startTaskVO.getIds())){
|
|
|
+ if(StringUtils.isEmpty(nodePrimaryKeyId) && StringUtils.isEmpty(recordTime)){
|
|
|
+ return R.fail("未找到业务数据");
|
|
|
+ }
|
|
|
+ //如果ids为空,说明是填报页上报,那么需要根据 nodePrimaryKeyId 和 recordTime 获取当前用户的填写记录
|
|
|
+ ContractLog log = this.contractLogService.getOne(Wrappers.<ContractLog>lambdaQuery().eq(ContractLog::getWbsNodeId, nodePrimaryKeyId).eq(ContractLog::getRecordTime, recordTime).eq(ContractLog::getCreateUser, AuthUtil.getUserId()));
|
|
|
+ if(log == null){
|
|
|
+ return R.fail("未找到业务数据");
|
|
|
+ }
|
|
|
+ startTaskVO.setIds(String.valueOf(log.getId()));
|
|
|
+ }
|
|
|
+ return this.batchTask(startTaskVO);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 预览、打印
|
|
@@ -176,9 +197,7 @@ public class ContractLogController extends BladeController {
|
|
|
this.taskClient.abolishTask(task);
|
|
|
} else if(new Integer("2").equals(task.getStatus())) {
|
|
|
//已审批的任务,修改业务数据的审批状态为未上报并撤签即可
|
|
|
- this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getStatus, 3).in(ContractLog::getId, Arrays.asList(task.getFormDataId().split(","))));
|
|
|
- // todo ================== 调用撤签
|
|
|
- // todo ================== 调用撤签
|
|
|
+ this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getEVisaPdfUrl, null).set(ContractLog::getStatus, 3).in(ContractLog::getId, Arrays.asList(task.getFormDataId().split(","))));
|
|
|
}
|
|
|
|
|
|
List<ContractLog> contractLogs = this.contractLogService.getBaseMapper().selectBatchIds(Arrays.asList(task.getFormDataId().split(",")));
|
|
@@ -237,8 +256,22 @@ public class ContractLogController extends BladeController {
|
|
|
taskVO.setApprovalType(3);
|
|
|
//上报
|
|
|
if(this.taskClient.startTask(taskVO).getData()){
|
|
|
+ LambdaUpdateWrapper<ContractLog> wrappers = Wrappers.lambdaUpdate();
|
|
|
+ wrappers.set(ContractLog::getBatch, taskVO.getBatch()).set(ContractLog::getStatus, 1);
|
|
|
+
|
|
|
+ //查询审批人
|
|
|
+ List<TaskParallel> taskUsers = this.taskClient.queryApprovalUser(id);
|
|
|
+ if(taskUsers.size() > 0){
|
|
|
+ //生成审批人信息
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ taskUsers.forEach(users -> stringBuilder.append(",").append(users.getTaskUser()).append("-").append(users.getTaskUserName()));
|
|
|
+ //设置审批人
|
|
|
+ wrappers.set(ContractLog::getAuditUserIdAndName, stringBuilder.substring(1));
|
|
|
+ }
|
|
|
+ wrappers.eq(ContractLog::getId, id);
|
|
|
+
|
|
|
//修改记录
|
|
|
- this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getStatus, 1).eq(ContractLog::getId, id));
|
|
|
+ this.contractLogService.update(wrappers);
|
|
|
}
|
|
|
}
|
|
|
|