Commit 38239746 by huluobin

# 更新

parent 53e9f5d0
...@@ -41,9 +41,6 @@ public class CostPlanNewController { ...@@ -41,9 +41,6 @@ public class CostPlanNewController {
@PostMapping("/affirm") @PostMapping("/affirm")
public Map<String, Object> affirm(@RequestParam String costPlanNo) { public Map<String, Object> affirm(@RequestParam String costPlanNo) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
// CostPlanNoLock lock = CostPlanNoLock.getInstance();
// try {
// lock.lock(Math.abs(costPlanNo.hashCode()));
CostPlanService costPlanService = CostPlanServiceFactory.getCostPlanService(costPlanNo); CostPlanService costPlanService = CostPlanServiceFactory.getCostPlanService(costPlanNo);
Integer affirm = costPlanService.affirm(costPlanNo); Integer affirm = costPlanService.affirm(costPlanNo);
...@@ -51,9 +48,6 @@ public class CostPlanNewController { ...@@ -51,9 +48,6 @@ public class CostPlanNewController {
result.put("msg", "已生成 " + affirm + " 张费用单"); result.put("msg", "已生成 " + affirm + " 张费用单");
return result; return result;
// } finally {
// lock.unlock(Math.abs(costPlanNo.hashCode()));
// }
} }
......
...@@ -57,6 +57,7 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement ...@@ -57,6 +57,7 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
.eq(CostPlanDomain::getCostPlanNo, planDomain.getCostPlanNo())); .eq(CostPlanDomain::getCostPlanNo, planDomain.getCostPlanNo()));
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
public Integer affirm(String costPlanNo) { public Integer affirm(String costPlanNo) {
// 获取 temp 表中的记录 // 获取 temp 表中的记录
...@@ -69,6 +70,9 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement ...@@ -69,6 +70,9 @@ public class CostPlanNewPayServiceImpl extends AbstractCostPlanService implement
if (costPlanTempDomains.stream().anyMatch(temp -> null == temp.getTypeNo())) { if (costPlanTempDomains.stream().anyMatch(temp -> null == temp.getTypeNo())) {
throw new RuntimeException("存在有金额、但是没有选择类型的子项目"); throw new RuntimeException("存在有金额、但是没有选择类型的子项目");
} }
if (costPlanTempDomains.stream().noneMatch(temp -> temp.getTypeId() == null)) {
throw new RuntimeException("没选类型");
}
costPlanDomain.setCostPlanStatus(1); costPlanDomain.setCostPlanStatus(1);
costPlanDao.updateById(costPlanDomain); 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