Commit 38239746 by huluobin

# 更新

parent 53e9f5d0
......@@ -41,9 +41,6 @@ public class CostPlanNewController {
@PostMapping("/affirm")
public Map<String, Object> affirm(@RequestParam String costPlanNo) {
Map<String, Object> result = new HashMap<>();
// CostPlanNoLock lock = CostPlanNoLock.getInstance();
// try {
// lock.lock(Math.abs(costPlanNo.hashCode()));
CostPlanService costPlanService = CostPlanServiceFactory.getCostPlanService(costPlanNo);
Integer affirm = costPlanService.affirm(costPlanNo);
......@@ -51,9 +48,6 @@ public class CostPlanNewController {
result.put("msg", "已生成 " + affirm + " 张费用单");
return result;
// } finally {
// lock.unlock(Math.abs(costPlanNo.hashCode()));
// }
}
......
......@@ -57,6 +57,7 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
.eq(CostPlanDomain::getCostPlanNo, planDomain.getCostPlanNo()));
}
@Transactional(rollbackFor = Exception.class)
@Override
public Integer affirm(String costPlanNo) {
// 获取 temp 表中的记录
......@@ -69,6 +70,9 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
if (costPlanTempDomains.stream().anyMatch(temp -> null == temp.getTypeNo())) {
throw new RuntimeException("存在有金额、但是没有选择类型的子项目");
}
if (costPlanTempDomains.stream().noneMatch(temp -> temp.getTypeId() == null)) {
throw new RuntimeException("没选类型");
}
costPlanDomain.setCostPlanStatus(1);
costPlanDao.updateById(costPlanDomain);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment