|
@@ -31,10 +31,9 @@ import org.springblade.feign.ArchiveFileTaskClient;
|
|
|
import org.springblade.manager.entity.ContractInfo;
|
|
|
import org.springblade.meter.dto.*;
|
|
|
import org.springblade.meter.entity.*;
|
|
|
+import org.springblade.meter.mapper.MiddleMeterApplyMapper;
|
|
|
import org.springblade.meter.service.impl.*;
|
|
|
-import org.springblade.meter.vo.TaskDataDetailVO;
|
|
|
-import org.springblade.meter.vo.TaskDetailVO;
|
|
|
-import org.springblade.meter.vo.TaskPageVO;
|
|
|
+import org.springblade.meter.vo.*;
|
|
|
import org.springblade.producer.bean.PushMessage;
|
|
|
import org.springblade.system.user.entity.User;
|
|
|
import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
@@ -48,6 +47,7 @@ import java.lang.reflect.Method;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@RestController
|
|
@@ -73,6 +73,8 @@ public class TaskController extends BladeController {
|
|
|
private final AttachmentFormServiceImpl attachmentFormService;
|
|
|
private final AttachmentFormServiceTaskImpl attachmentFormServiceTask;
|
|
|
|
|
|
+ private final MiddleMeterApplyMapper middleMeterApplyMapper;
|
|
|
+
|
|
|
@GetMapping("/name")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@ApiOperation(value = "获取任务名称", notes = "传入合同段contractId、期数id、type=1(中间计量申请)、=2(材料计量单、开工预付款计量单)、=3(变更令)")
|
|
@@ -90,7 +92,11 @@ public class TaskController extends BladeController {
|
|
|
} else if (("2").equals(type)) {
|
|
|
MeterPeriod meterPeriod = periodService.getById(id);
|
|
|
if (contractInfo != null && meterPeriod != null) {
|
|
|
- name = "【" + contractInfo.getContractName() + "】" + date + " 中间计量申请【" + meterPeriod.getPeriodNumber() + "】";
|
|
|
+ if (meterPeriod.getType().equals(1)) {
|
|
|
+ name = "【" + contractInfo.getContractName() + "】" + date + " 材料计量单【" + meterPeriod.getPeriodNumber() + "】";
|
|
|
+ } else if (meterPeriod.getType().equals(2)) {
|
|
|
+ name = "【" + contractInfo.getContractName() + "】" + date + " 开工预付款计量单【" + meterPeriod.getPeriodNumber() + "】";
|
|
|
+ }
|
|
|
}
|
|
|
} else if (("3").equals(type)) {
|
|
|
//TODO 变更令
|
|
@@ -118,6 +124,14 @@ public class TaskController extends BladeController {
|
|
|
throw new ServiceException("未获取到任务人信息,操作失败");
|
|
|
}
|
|
|
|
|
|
+ /*加锁*/
|
|
|
+ String redisValue = bladeRedis.get("meter:report:periodId-" + approvalDTO.getPeriodId());
|
|
|
+ if (StringUtils.isNotEmpty(redisValue) && redisValue.equals("1")) {
|
|
|
+ return R.fail(400, "当前期数已提交任务审批,请勿重复提交,60秒后再尝试");
|
|
|
+ }
|
|
|
+ bladeRedis.set("meter:report:periodId-" + approvalDTO.getPeriodId(), "1");
|
|
|
+ bladeRedis.expire("meter:report:periodId-" + approvalDTO.getPeriodId(), 60);
|
|
|
+
|
|
|
if (ObjectUtil.isNotEmpty(approvalDTO.getType()) && (approvalDTO.getType().equals(1) || approvalDTO.getType().equals(2) || approvalDTO.getType().equals(3))) {
|
|
|
if (approvalDTO.getType().equals(1)) {
|
|
|
/*==================== 中间计量申请 ====================*/
|
|
@@ -426,7 +440,7 @@ public class TaskController extends BladeController {
|
|
|
* @param serviceMap
|
|
|
* @param approveStatus
|
|
|
*/
|
|
|
- private void updateApproveStatus(Map<List<Long>, List<BaseService<?>>> serviceMap, int approveStatus) {
|
|
|
+ private void updateApproveStatus(Map<List<Long>, List<BaseService<?>>> serviceMap, Integer approveStatus) {
|
|
|
for (Map.Entry<List<Long>, List<BaseService<?>>> entry : serviceMap.entrySet()) {
|
|
|
List<Long> ids = entry.getKey();
|
|
|
List<BaseService<?>> services = entry.getValue();
|
|
@@ -436,7 +450,7 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private <T, U extends BaseService<T>> void updateEntityStatus(U service, List<Long> ids, int approveStatus) {
|
|
|
+ private <T, U extends BaseService<T>> void updateEntityStatus(U service, List<Long> ids, Integer approveStatus) {
|
|
|
UpdateWrapper<T> updateWrapper = new UpdateWrapper<>();
|
|
|
updateWrapper.in("id", ids);
|
|
|
T updateEntity = createUpdateEntity(service.getEntityClass());
|
|
@@ -453,16 +467,22 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private <T> void setApproveStatus(T entity, int approveStatus) {
|
|
|
+ private <T> void setApproveStatus(T entity, Integer approveStatus) {
|
|
|
try {
|
|
|
- Method setApproveStatusMethod = entity.getClass().getMethod("setApproveStatus", Integer.TYPE);
|
|
|
- setApproveStatusMethod.invoke(entity, approveStatus);
|
|
|
- } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
|
|
|
+ Method[] methods = entity.getClass().getMethods();
|
|
|
+ for (Method method : methods) {
|
|
|
+ if (method.getName().equals("setApproveStatus")) {
|
|
|
+ method.invoke(entity, approveStatus);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (IllegalAccessException | InvocationTargetException e) {
|
|
|
e.printStackTrace();
|
|
|
throw new ServiceException("修改业务数据审批状态失败,msg:" + e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@PostMapping("/repeal")
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
@ApiOperation(value = "任务废除(任务撤销、驳回审批)", notes = "按一期废除,即按整条任务废除(中期计量申请、材料计量单、开工预付款计量单、任务查看-废除任务)")
|
|
@@ -470,7 +490,7 @@ public class TaskController extends BladeController {
|
|
|
public R<Object> repeal(@RequestBody TaskRepealDTO taskRepealDTO) {
|
|
|
if (ObjectUtil.isNotEmpty(taskRepealDTO) && ObjectUtil.isNotEmpty(taskRepealDTO.getTaskId())) {
|
|
|
if (ObjectUtil.isNotEmpty(taskRepealDTO.getMeterTaskRepealDesc()) && taskRepealDTO.getMeterTaskRepealDesc().length() > 1000) {
|
|
|
- throw new ServiceException("任务废除原因过长,请重新输入");
|
|
|
+ throw new ServiceException("任务废除原因最长1000个字符,请重新输入");
|
|
|
}
|
|
|
Task task = jdbcTemplate.query("SELECT * FROM u_task WHERE id = " + taskRepealDTO.getTaskId(), new BeanPropertyRowMapper<>(Task.class)).stream().findAny().orElse(null);
|
|
|
if (task != null) {
|
|
@@ -497,7 +517,7 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
/*修改主任务、副任务状态*/
|
|
|
- jdbcTemplate.execute("UPDATE u_task SET status = 3,meter_task_repeal_desc = '" + taskRepealDTO.getMeterTaskRepealDesc() + "' WHERE id = " + taskRepealDTO.getTaskId());
|
|
|
+ jdbcTemplate.execute("UPDATE u_task SET status = 3,meter_task_repeal_desc = '" + (ObjectUtil.isNotEmpty(taskRepealDTO.getMeterTaskRepealDesc()) ? taskRepealDTO.getMeterTaskRepealDesc() : null) + "' WHERE id = " + taskRepealDTO.getTaskId());
|
|
|
jdbcTemplate.execute("UPDATE u_task_parallel SET status = 3 WHERE process_instance_id = '" + processInstanceId + "'");
|
|
|
|
|
|
/*修改业务状态=未上报,业务复制数据taskVO全部删除(存在重新上报的情况,那么如果历史复制数据存在,会导致主键冲突,因为关联数据是copy的)*/
|
|
@@ -712,6 +732,7 @@ public class TaskController extends BladeController {
|
|
|
vo.setStartTime(task.getStartTime());
|
|
|
vo.setEndTime(task.getEndTime());
|
|
|
vo.setType(task.getType());
|
|
|
+ vo.setMeterType(task.getMeterTaskType());
|
|
|
vo.setTaskDesc(task.getTaskContent());
|
|
|
vo.setTaskReportUserName(nameMap.get(Long.parseLong(task.getReportUser())));
|
|
|
List<TaskParallel> taskParallelList = finalTaskParallelGroupMap.get(task.getProcessInstanceId());
|
|
@@ -765,26 +786,44 @@ public class TaskController extends BladeController {
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
@ApiOperation(value = "任务详情", notes = "传入任务id")
|
|
|
public R<TaskDetailVO> detail(@RequestParam String id) {
|
|
|
- if (ObjectUtil.isEmpty(id)) {
|
|
|
- throw new ServiceException("任务id不能为空");
|
|
|
+ if (ObjectUtil.isEmpty(id) || ObjectUtil.isEmpty(SecureUtil.getUserId())) {
|
|
|
+ throw new ServiceException("任务id、用户信息不能为空");
|
|
|
}
|
|
|
TaskDetailVO vo = new TaskDetailVO();
|
|
|
Task task = jdbcTemplate.query("SELECT * FROM u_task WHERE id = " + id, new BeanPropertyRowMapper<>(Task.class)).stream().findAny().orElse(null);
|
|
|
if (task != null) {
|
|
|
- /*任务流程信息*/
|
|
|
- List<TaskParallel> taskParallels = jdbcTemplate.query("select process_instance_id,task_user,task_user_name,e_visa_status,e_visa_content,status,sort from u_task_parallel where process_instance_id = " + task.getProcessInstanceId() + " order by sort", new BeanPropertyRowMapper<>(TaskParallel.class));
|
|
|
+ /*左侧任务流程信息*/
|
|
|
+ List<TaskParallel> taskParallels = jdbcTemplate.query("select process_instance_id,task_user,task_user_name,e_visa_status,e_visa_content,status,sort,create_time from u_task_parallel where process_instance_id = " + task.getProcessInstanceId() + " order by sort", new BeanPropertyRowMapper<>(TaskParallel.class));
|
|
|
List<Map<String, String>> taskProcessInfo = new LinkedList<>();
|
|
|
- for (TaskParallel taskParallel : taskParallels) {
|
|
|
+ Map<String, String> taskUserOne = new LinkedHashMap<>();
|
|
|
+ taskUserOne.put("name", task.getReportUserName());
|
|
|
+ taskUserOne.put("date", task.getCreateTime().toString());
|
|
|
+ taskUserOne.put("status", task.getStatus().toString());
|
|
|
+ taskUserOne.put("flowValue", "上报");
|
|
|
+ taskProcessInfo.add(0, taskUserOne);
|
|
|
+
|
|
|
+ for (int i = 0; i < taskParallels.size(); i++) {
|
|
|
+ TaskParallel taskParallel = taskParallels.get(i);
|
|
|
Map<String, String> taskUserMap = new LinkedHashMap<>();
|
|
|
taskUserMap.put("name", taskParallel.getTaskUserName());
|
|
|
taskUserMap.put("date", taskParallel.getCreateTime().toString());
|
|
|
taskUserMap.put("status", taskParallel.getStatus().toString());
|
|
|
+ if (i == taskParallels.size() - 1) {
|
|
|
+ taskUserOne.put("flowValue", "结束流程</br>同意");
|
|
|
+ } else {
|
|
|
+ taskUserOne.put("flowValue", taskParallel.getStatus().equals(2) ? "同意" : "待审批");
|
|
|
+ }
|
|
|
taskProcessInfo.add(taskUserMap);
|
|
|
}
|
|
|
vo.setTaskProcessInfo(taskProcessInfo);
|
|
|
|
|
|
/*中间业务taskVO数据*/
|
|
|
if (ObjectUtil.isNotEmpty(task.getFormDataId())) {
|
|
|
+ /*获取当条任务所有批注信息*/
|
|
|
+ Map<String, TaskComment> taskCommentMap = jdbcTemplate.query("SELECT * FROM s_task_comment WHERE task_id = " + id, new BeanPropertyRowMapper<>(TaskComment.class))
|
|
|
+ .stream()
|
|
|
+ .collect(Collectors.toMap(taskComment -> taskComment.getUserId() + ":" + taskComment.getDataId(), Function.identity()));
|
|
|
+
|
|
|
String periodId = task.getFormDataId();
|
|
|
if (task.getMeterTaskType().equals(1)) {
|
|
|
/*==================== 中间计量申请 ====================*/
|
|
@@ -792,7 +831,17 @@ public class TaskController extends BladeController {
|
|
|
.eq(MiddleMeterApplyTask::getContractPeriodId, periodId)
|
|
|
.eq(MiddleMeterApplyTask::getTaskId, task.getId())
|
|
|
);
|
|
|
- vo.setTaskCenterDataInfo(Collections.singletonList(middleMeterApplyTasks));
|
|
|
+ List<MiddleMeterApplyTaskVO> middleMeterApplyTaskVOS = BeanUtil.copyProperties(middleMeterApplyTasks, MiddleMeterApplyTaskVO.class);
|
|
|
+ for (MiddleMeterApplyTaskVO middleMeterApplyTaskVO : middleMeterApplyTaskVOS) {
|
|
|
+ String key = SecureUtil.getUserId() + ":" + middleMeterApplyTaskVO.getId();
|
|
|
+ TaskComment orDefault = taskCommentMap.getOrDefault(key, null);
|
|
|
+ if (orDefault != null) {
|
|
|
+ middleMeterApplyTaskVO.setIsComment(1);
|
|
|
+ } else {
|
|
|
+ middleMeterApplyTaskVO.setIsComment(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setTaskCenterDataInfo(middleMeterApplyTaskVOS);
|
|
|
|
|
|
} else if (task.getMeterTaskType().equals(2)) {
|
|
|
/*==================== 材料计量单 ====================*/
|
|
@@ -800,7 +849,17 @@ public class TaskController extends BladeController {
|
|
|
.eq(MaterialMeterFormTask::getMeterPeriodId, periodId)
|
|
|
.eq(MaterialMeterFormTask::getTaskId, task.getId())
|
|
|
);
|
|
|
- vo.setTaskCenterDataInfo(Collections.singletonList(materialMeterFormTasks));
|
|
|
+ List<MaterialMeterFormTaskVO> materialMeterFormTaskVOS = BeanUtil.copyProperties(materialMeterFormTasks, MaterialMeterFormTaskVO.class);
|
|
|
+ for (MaterialMeterFormTaskVO materialMeterFormTaskVO : materialMeterFormTaskVOS) {
|
|
|
+ String key = SecureUtil.getUserId() + ":" + materialMeterFormTaskVO.getId();
|
|
|
+ TaskComment orDefault = taskCommentMap.getOrDefault(key, null);
|
|
|
+ if (orDefault != null) {
|
|
|
+ materialMeterFormTaskVO.setIsComment(1);
|
|
|
+ } else {
|
|
|
+ materialMeterFormTaskVO.setIsComment(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setTaskCenterDataInfo(materialMeterFormTaskVOS);
|
|
|
|
|
|
} else if (task.getMeterTaskType().equals(3)) {
|
|
|
/*==================== 开工预付款计量单 ====================*/
|
|
@@ -808,7 +867,17 @@ public class TaskController extends BladeController {
|
|
|
.eq(StartPayMeterFormTask::getMeterPeriodId, periodId)
|
|
|
.eq(StartPayMeterFormTask::getTaskId, task.getId())
|
|
|
);
|
|
|
- vo.setTaskCenterDataInfo(Collections.singletonList(startPayMeterFormTasks));
|
|
|
+ List<StartPayMeterFormTaskVO> startPayMeterFormTaskVOS = BeanUtil.copyProperties(startPayMeterFormTasks, StartPayMeterFormTaskVO.class);
|
|
|
+ for (StartPayMeterFormTaskVO startPayMeterFormTaskVO : startPayMeterFormTaskVOS) {
|
|
|
+ String key = SecureUtil.getUserId() + ":" + startPayMeterFormTaskVO.getId();
|
|
|
+ TaskComment orDefault = taskCommentMap.getOrDefault(key, null);
|
|
|
+ if (orDefault != null) {
|
|
|
+ startPayMeterFormTaskVO.setIsComment(1);
|
|
|
+ } else {
|
|
|
+ startPayMeterFormTaskVO.setIsComment(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ vo.setTaskCenterDataInfo(startPayMeterFormTaskVOS);
|
|
|
|
|
|
} else if (task.getMeterTaskType().equals(4)) {
|
|
|
/*==================== 变更令 ====================*/
|
|
@@ -832,11 +901,10 @@ public class TaskController extends BladeController {
|
|
|
if (task.getMeterTaskType().equals(1)) {
|
|
|
MiddleMeterApplyTask middleMeterApplyTask = middleMeterApplyServiceTask.getById(dataId);
|
|
|
vo.setBasicsInfo(middleMeterApplyTask);
|
|
|
- List<InventoryFormApplyTask> inventoryFormApplyTasks = inventoryFormApplyServiceTask.getBaseMapper().selectList(Wrappers.<InventoryFormApplyTask>lambdaQuery()
|
|
|
- .eq(InventoryFormApplyTask::getTaskId, id)
|
|
|
- .eq(InventoryFormApplyTask::getContractPeriodId, task.getFormDataId())
|
|
|
- .eq(InventoryFormApplyTask::getMiddleMeterId, dataId));
|
|
|
- vo.setAssociatedDataInfoList(Collections.singletonList(inventoryFormApplyTasks));
|
|
|
+
|
|
|
+ /*清单信息*/
|
|
|
+ List<MeterInventoryVO> formToTask = middleMeterApplyMapper.getForm(Long.parseLong(dataId), middleMeterApplyTask.getContractId(), middleMeterApplyTask.getContractUnitId());
|
|
|
+ vo.setAssociatedDataInfoList(formToTask);
|
|
|
|
|
|
} else if (task.getMeterTaskType().equals(2)) {
|
|
|
MaterialMeterFormTask materialMeterFormTask = materialMeterFormServiceTask.getById(dataId);
|
|
@@ -885,7 +953,7 @@ public class TaskController extends BladeController {
|
|
|
Object[] params = {updatedMeterMoney, inventoryFormApplyTask.getMiddleMeterId()};
|
|
|
jdbcTemplate.update(updateSql, params);
|
|
|
|
|
|
- return R.data(200, null, "操作成功");
|
|
|
+ return R.data(200, updatedMeterMoney, "操作成功");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -926,7 +994,7 @@ public class TaskController extends BladeController {
|
|
|
Object[] params = {updatedMeterMoney, inventoryFormApplyTask.getMiddleMeterId()};
|
|
|
jdbcTemplate.update(updateSql, params);
|
|
|
|
|
|
- return R.success("操作成功");
|
|
|
+ return R.data(200, updatedMeterMoney, "操作成功");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -947,38 +1015,43 @@ public class TaskController extends BladeController {
|
|
|
Object[] params = {updatedMeterMoney, inventoryFormApplyTask.getMiddleMeterId()};
|
|
|
jdbcTemplate.update(updateSql, params);
|
|
|
|
|
|
- return R.success("操作成功");
|
|
|
+ return R.data(200, updatedMeterMoney, "操作成功");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
return R.fail("操作失败");
|
|
|
}
|
|
|
|
|
|
@PostMapping("/data/inventoryFormApplyTask/save")
|
|
|
@ApiOperationSupport(order = 9)
|
|
|
- @ApiOperation(value = "清单数据新增(添加清单)", notes = "查询获取数据接口还是调/middleMeterApply/addFormList,传入InventoryFormApplyTask")
|
|
|
- public R<Object> dataInventoryFormApplyTaskSave(@RequestBody InventoryFormApplyTask obj) {
|
|
|
- if (ObjectUtil.isEmpty(obj.getCurrentMeterTotal()) && ObjectUtil.isEmpty(obj.getCurrentPrice())) {
|
|
|
- throw new ServiceException("计量金额和计量数量不能为空");
|
|
|
- }
|
|
|
- /*重新计算金额*/
|
|
|
- obj.setCurrentMeterMoney(obj.getCurrentPrice().multiply(obj.getCurrentMeterTotal()));
|
|
|
- if (inventoryFormApplyServiceTask.save(obj)) {
|
|
|
- /*申请单金额相加*/
|
|
|
- BigDecimal currentMeterMoney = obj.getCurrentMeterMoney();
|
|
|
- MiddleMeterApplyTask middleMeterApplyTask = middleMeterApplyServiceTask.getById(obj.getMiddleMeterId());
|
|
|
- if (middleMeterApplyTask != null) {
|
|
|
- BigDecimal meterMoney = middleMeterApplyTask.getMeterMoney();
|
|
|
- BigDecimal add = meterMoney.add(currentMeterMoney); //相加
|
|
|
-
|
|
|
- String updateSql = "UPDATE s_middle_meter_apply_task SET meter_money = ? WHERE id = ?";
|
|
|
- Object[] params = {add, middleMeterApplyTask.getId()};
|
|
|
- jdbcTemplate.update(updateSql, params);
|
|
|
-
|
|
|
- return R.data(200, null, "操作成功");
|
|
|
+ @ApiOperation(value = "清单数据新增(添加清单)", notes = "查询获取数据接口还是调/middleMeterApply/addFormList,传入InventoryFormApplyTaskBatchDTO")
|
|
|
+ public R<Object> dataInventoryFormApplyTaskSave(@RequestBody InventoryFormApplyTaskBatchDTO dto) {
|
|
|
+ BigDecimal currentMeterMoneyTotal = BigDecimal.ZERO;
|
|
|
+ Long middleMeterId = null;
|
|
|
+ for (InventoryFormApplyTask obj : dto.getDtoList()) {
|
|
|
+ if (ObjectUtil.isEmpty(obj.getCurrentMeterTotal()) && ObjectUtil.isEmpty(obj.getCurrentPrice())) {
|
|
|
+ throw new ServiceException("计量金额和计量数量不能为空");
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isEmpty(middleMeterId)) {
|
|
|
+ middleMeterId = obj.getMiddleMeterId();
|
|
|
}
|
|
|
+ obj.setCurrentMeterMoney(obj.getCurrentPrice().multiply(obj.getCurrentMeterTotal()));
|
|
|
+ currentMeterMoneyTotal = currentMeterMoneyTotal.add(obj.getCurrentMeterMoney());
|
|
|
+ inventoryFormApplyServiceTask.save(obj);
|
|
|
+ }
|
|
|
+
|
|
|
+ /*申请单金额相加*/
|
|
|
+ MiddleMeterApplyTask middleMeterApplyTask = middleMeterApplyServiceTask.getById(middleMeterId);
|
|
|
+ if (middleMeterApplyTask != null) {
|
|
|
+ BigDecimal meterMoney = middleMeterApplyTask.getMeterMoney();
|
|
|
+ BigDecimal resultMoney = meterMoney.add(currentMeterMoneyTotal); //相加
|
|
|
+ String updateSql = "UPDATE s_middle_meter_apply_task SET meter_money = ? WHERE id = ?";
|
|
|
+ Object[] params = {resultMoney, middleMeterApplyTask.getId()};
|
|
|
+ jdbcTemplate.update(updateSql, params);
|
|
|
+
|
|
|
+ return R.data(200, resultMoney, "操作成功");
|
|
|
}
|
|
|
+
|
|
|
return R.fail("操作失败");
|
|
|
}
|
|
|
|
|
@@ -1013,7 +1086,7 @@ public class TaskController extends BladeController {
|
|
|
file.setContractId(dto.getContractId());
|
|
|
file.setMasterId(dto.getDataId());
|
|
|
}
|
|
|
- attachmentFormServiceTask.saveBatch(fileList);
|
|
|
+ attachmentFormServiceTask.saveOrUpdateBatch(fileList);
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
|
return R.fail("操作失败");
|
|
@@ -1094,7 +1167,7 @@ public class TaskController extends BladeController {
|
|
|
/*校验当前用户审批顺序*/
|
|
|
boolean isCurrentUserLastApprove = checkTheTaskPersonSort(task);
|
|
|
|
|
|
- /*修改复制数据状态,未选择时,默认为正确(即同意)*/
|
|
|
+ /*修改复制数据状态,单条数据的状态,未选择时,默认为正确(即同意)(此状态为数据状态,不是任务状态)*/
|
|
|
updateCopyDataStatus(task, dto);
|
|
|
|
|
|
/*最后审批人员*/
|
|
@@ -1102,8 +1175,8 @@ public class TaskController extends BladeController {
|
|
|
|
|
|
//TODO 重新生成报表,执行电签(电签失败直接return或抛出异常,不修改下方状态)
|
|
|
|
|
|
- /*修改主任务对应的业务状态为已审批*/
|
|
|
- updateTaskDataStatus(task, dto);
|
|
|
+ /*修改主任务对应的复制业务数据状态为已审批*/
|
|
|
+ updateCopyDataApproveStatus(task, dto);
|
|
|
|
|
|
/*修改主任务状态为已审批*/
|
|
|
updateTaskStatus(task);
|
|
@@ -1192,7 +1265,7 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void updateTaskDataStatus(Task task, TaskApproveDTO dto) {
|
|
|
+ private void updateCopyDataApproveStatus(Task task, TaskApproveDTO dto) {
|
|
|
String formDataId = task.getFormDataId();
|
|
|
if (task.getMeterTaskType().equals(1)) {
|
|
|
List<MiddleMeterApplyTask> middleMeterApplyTasks = middleMeterApplyServiceTask.getBaseMapper().selectList(Wrappers.<MiddleMeterApplyTask>lambdaQuery()
|
|
@@ -1317,7 +1390,7 @@ public class TaskController extends BladeController {
|
|
|
throw new ServiceException("未获取到当前用户信息");
|
|
|
}
|
|
|
if (ObjectUtil.isNotEmpty(taskComment.getComment()) && taskComment.getComment().length() > 1000) {
|
|
|
- throw new ServiceException("批注信息最长1000个字符");
|
|
|
+ throw new ServiceException("批注信息最长1000个字符,请重新输入");
|
|
|
}
|
|
|
try {
|
|
|
String querySql = "SELECT COUNT(*) FROM s_task_comment WHERE task_id = ? AND data_id = ? AND user_id = ?";
|
|
@@ -1336,14 +1409,14 @@ public class TaskController extends BladeController {
|
|
|
taskComment.getDataId(),
|
|
|
SecureUtil.getUserId(),
|
|
|
SecureUtil.getNickName(),
|
|
|
- taskComment.getComment(),
|
|
|
+ ObjectUtil.isNotEmpty(taskComment.getComment()) ? taskComment.getComment() : null,
|
|
|
new java.sql.Timestamp(System.currentTimeMillis())
|
|
|
};
|
|
|
jdbcTemplate.update(insertSql, insertParams);
|
|
|
} else {
|
|
|
String updateSql = "UPDATE s_task_comment SET comment = ?, create_time = ? WHERE task_id = ? AND data_id = ? AND user_id = ?";
|
|
|
Object[] updateParams = {
|
|
|
- taskComment.getComment(),
|
|
|
+ ObjectUtil.isNotEmpty(taskComment.getComment()) ? taskComment.getComment() : null,
|
|
|
new java.sql.Timestamp(System.currentTimeMillis()),
|
|
|
taskComment.getTaskId(),
|
|
|
taskComment.getDataId(),
|