|
@@ -18,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -209,7 +210,7 @@ public class WODispatchPlanDBServiceImpl implements WODispatchPlanDBService,WODi
|
|
|
|
|
|
//TODO 事务控制多对象添加
|
|
|
@Override
|
|
|
- @Transactional(transactionManager = "mainDbTransactionManager")
|
|
|
+ @Transactional(transactionManager = "mainDbTransactionManager",rollbackFor = Exception.class)
|
|
|
public ResponseCode insertPlanInfoByCount(DispatchPlanInfoModel model, List<JPDispatchPlanInfoRuleSave> rulesList
|
|
|
, List<JPDispatchPlanInfoTagsSave> tagsList, List<JPDispatchCmdBatchItem> itemsList) {
|
|
|
woDispatchPlanMapper.inserts(FastJsonUtil.obj2Map(model,true));
|
|
@@ -235,7 +236,7 @@ public class WODispatchPlanDBServiceImpl implements WODispatchPlanDBService,WODi
|
|
|
//添加相应的处置建议
|
|
|
for (JPDispatchCmdBatchDispoal dispoal:jp.getDispoalList()) {
|
|
|
Map<String,Object> mapDispoal = FastJsonUtil.obj2Map(dispoal,true);
|
|
|
- mapDispoal.put("key",CommTool.genPlanItemDispoalId());
|
|
|
+ mapDispoal.put("key",StringUtils.isEmpty(dispoal.getKey())?CommTool.genPlanItemDispoalId():dispoal.getKey());
|
|
|
mapDispoal.put("create_time",TimeTool.getCurMsUTC());
|
|
|
mapDispoal.put(WODispatchCmdPatchDisposalTable.W_INFO.BATCH_ITEM_ID,map.get(WODispatchCmdPatchItemTable.W_INFO.PRIMARY_KEY));
|
|
|
woDispatchCmdPatchDisposalMapper.inserts(mapDispoal);
|
|
@@ -247,7 +248,7 @@ public class WODispatchPlanDBServiceImpl implements WODispatchPlanDBService,WODi
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- @Transactional(transactionManager = "mainDbTransactionManager")
|
|
|
+ @Transactional(transactionManager = "mainDbTransactionManager",rollbackFor = Exception.class)
|
|
|
public ResponseCode updatePlanInfoByCount(JPDispatchPlanInfoUpdate model,Long nextTakeTime, List<JPDispatchPlanInfoRuleSave> rulesList, List<JPDispatchPlanInfoTagsSave> tagsList, List<JPDispatchCmdBatchItem> itemsList) {
|
|
|
//TODO 修改计划
|
|
|
Map<String,Object> andWhereUp = new HashMap<>();
|
|
@@ -307,7 +308,7 @@ public class WODispatchPlanDBServiceImpl implements WODispatchPlanDBService,WODi
|
|
|
//添加相应的处置建议
|
|
|
for (JPDispatchCmdBatchDispoal dispoal : jp.getDispoalList()) {
|
|
|
Map<String, Object> mapDispoal = FastJsonUtil.obj2Map(dispoal, true);
|
|
|
- mapDispoal.put("key", CommTool.genPlanItemDispoalId());
|
|
|
+ mapDispoal.put("key", StringUtils.isEmpty(dispoal.getKey())?CommTool.genPlanItemDispoalId():dispoal.getKey());
|
|
|
mapDispoal.put("create_time", TimeTool.getCurMsUTC());
|
|
|
mapDispoal.put(WODispatchCmdPatchDisposalTable.W_INFO.BATCH_ITEM_ID, map.get(WODispatchCmdPatchItemTable.W_INFO.PRIMARY_KEY));
|
|
|
woDispatchCmdPatchDisposalMapper.inserts(mapDispoal);
|