|
@@ -222,25 +222,13 @@ public class WODispatchPlanDBServiceImpl implements WODispatchPlanDBService,WODi
|
|
for (JPDispatchPlanInfoRuleSave jp : rulesList) {
|
|
for (JPDispatchPlanInfoRuleSave jp : rulesList) {
|
|
Map<String, Object> map = FastJsonUtil.obj2Map(jp, true);
|
|
Map<String, Object> map = FastJsonUtil.obj2Map(jp, true);
|
|
map.put("update_time", TimeTool.getCurMsUTC());
|
|
map.put("update_time", TimeTool.getCurMsUTC());
|
|
- if(StringUtils.isEmpty(jp.getPlanId())) {
|
|
|
|
- map.put(WODispatchPlanRulsTable.W_INFO.PRIMARY_KEY, model.getPlanId());
|
|
|
|
- woDispatchPlanRulsMapper.inserts(map);
|
|
|
|
- }else{
|
|
|
|
- HashMap<String,Object> rulsMapUpWhere = new HashMap<>();
|
|
|
|
- rulsMapUpWhere.put("plan_id",jp.getPlanId());
|
|
|
|
- woDispatchPlanRulsMapper.updateWiths(map,rulsMapUpWhere,new HashMap<>(),"");
|
|
|
|
- }
|
|
|
|
|
|
+ map.put(WODispatchPlanRulsTable.W_INFO.PRIMARY_KEY, model.getPlanId());
|
|
|
|
+ woDispatchPlanRulsMapper.inserts(map);
|
|
}
|
|
}
|
|
for (JPDispatchPlanInfoTagsSave jp : tagsList) {
|
|
for (JPDispatchPlanInfoTagsSave jp : tagsList) {
|
|
Map<String, Object> map = FastJsonUtil.obj2Map(jp, true);
|
|
Map<String, Object> map = FastJsonUtil.obj2Map(jp, true);
|
|
- if(StringUtils.isEmpty(jp.getPlanId())) {
|
|
|
|
- map.put(WODispatchPlanTagsTable.W_INFO.PRIMARY_KEY, model.getPlanId());
|
|
|
|
- woDispatchPlanTagsMapper.inserts(map);
|
|
|
|
- }else{
|
|
|
|
- HashMap<String,Object> rulsMapUpWhere = new HashMap<>();
|
|
|
|
- rulsMapUpWhere.put("plan_id",jp.getPlanId());
|
|
|
|
- woDispatchPlanTagsMapper.updateWiths(map,rulsMapUpWhere,new HashMap<>(),"");
|
|
|
|
- }
|
|
|
|
|
|
+ map.put(WODispatchPlanTagsTable.W_INFO.PRIMARY_KEY, model.getPlanId());
|
|
|
|
+ woDispatchPlanTagsMapper.inserts(map);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (JPDispatchCmdBatchItem jp:itemsList){
|
|
for (JPDispatchCmdBatchItem jp:itemsList){
|
|
@@ -255,13 +243,7 @@ public class WODispatchPlanDBServiceImpl implements WODispatchPlanDBService,WODi
|
|
mapDispoal.put("key",StringUtils.isEmpty(dispoal.getKey())?CommTool.genPlanItemDispoalId():dispoal.getKey());
|
|
mapDispoal.put("key",StringUtils.isEmpty(dispoal.getKey())?CommTool.genPlanItemDispoalId():dispoal.getKey());
|
|
mapDispoal.put("create_time",TimeTool.getCurMsUTC());
|
|
mapDispoal.put("create_time",TimeTool.getCurMsUTC());
|
|
mapDispoal.put(WODispatchCmdPatchDisposalTable.W_INFO.BATCH_ITEM_ID,map.get(WODispatchCmdPatchItemTable.W_INFO.PRIMARY_KEY));
|
|
mapDispoal.put(WODispatchCmdPatchDisposalTable.W_INFO.BATCH_ITEM_ID,map.get(WODispatchCmdPatchItemTable.W_INFO.PRIMARY_KEY));
|
|
- if(StringUtils.isEmpty(dispoal.getKey())){
|
|
|
|
- woDispatchCmdPatchDisposalMapper.inserts(mapDispoal);
|
|
|
|
- }else{
|
|
|
|
- Map<String,Object> andWhereUpDis = new HashMap<>();
|
|
|
|
- andWhereUpDis.put("key",dispoal.getKey());
|
|
|
|
- woDispatchCmdPatchDisposalMapper.updateWiths(mapDispoal,andWhereUpDis,new HashMap<>(),"");
|
|
|
|
- }
|
|
|
|
|
|
+ woDispatchCmdPatchDisposalMapper.inserts(mapDispoal);
|
|
}
|
|
}
|
|
woDispatchCmdPatchItemMapper.inserts(map);
|
|
woDispatchCmdPatchItemMapper.inserts(map);
|
|
}
|
|
}
|
|
@@ -317,20 +299,23 @@ public class WODispatchPlanDBServiceImpl implements WODispatchPlanDBService,WODi
|
|
map.put(WODispatchPlanRulsTable.W_INFO.PRIMARY_KEY, model.getPlanId());
|
|
map.put(WODispatchPlanRulsTable.W_INFO.PRIMARY_KEY, model.getPlanId());
|
|
woDispatchPlanRulsMapper.inserts(map);
|
|
woDispatchPlanRulsMapper.inserts(map);
|
|
}else{
|
|
}else{
|
|
- HashMap<String,Object> rulsMapUpWhere = new HashMap<>();
|
|
|
|
- rulsMapUpWhere.put("plan_id",jp.getPlanId());
|
|
|
|
- woDispatchPlanRulsMapper.updateWiths(map,rulsMapUpWhere,new HashMap<>(),"");
|
|
|
|
|
|
+ Map<String,Object> andWheresWith = new HashMap<>();
|
|
|
|
+ andWheresWith.put(WODispatchPlanRulsTable.W_INFO.PRIMARY_KEY,jp.getPlanId());
|
|
|
|
+ woDispatchPlanRulsMapper.updateWiths(map,andWheresWith,new HashMap<>(),"");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (JPDispatchPlanInfoTagsSave jp : tagsList) {
|
|
for (JPDispatchPlanInfoTagsSave jp : tagsList) {
|
|
Map<String, Object> map = FastJsonUtil.obj2Map(jp, true);
|
|
Map<String, Object> map = FastJsonUtil.obj2Map(jp, true);
|
|
- if(StringUtils.isEmpty(jp.getPlanId())) {
|
|
|
|
- map.put(WODispatchPlanTagsTable.W_INFO.PRIMARY_KEY, model.getPlanId());
|
|
|
|
- woDispatchPlanTagsMapper.inserts(map);
|
|
|
|
- }else{
|
|
|
|
- HashMap<String,Object> rulsMapUpWhere = new HashMap<>();
|
|
|
|
- rulsMapUpWhere.put("plan_id",jp.getPlanId());
|
|
|
|
- woDispatchPlanTagsMapper.updateWiths(map,rulsMapUpWhere,new HashMap<>(),"");
|
|
|
|
|
|
+ if(!StringUtils.isEmpty(jp.getKey())) {
|
|
|
|
+ if (StringUtils.isEmpty(jp.getPlanId())) {
|
|
|
|
+ map.put(WODispatchPlanTagsTable.W_INFO.PRIMARY_KEY, model.getPlanId());
|
|
|
|
+ woDispatchPlanTagsMapper.inserts(map);
|
|
|
|
+ } else {
|
|
|
|
+ Map<String, Object> andWheresWith = new HashMap<>();
|
|
|
|
+ andWheresWith.put(WODispatchPlanTagsTable.W_INFO.PRIMARY_KEY, jp.getPlanId());
|
|
|
|
+ andWheresWith.put("key", jp.getPlanId());
|
|
|
|
+ woDispatchPlanTagsMapper.updateWiths(map, andWheresWith, new HashMap<>(), "");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -343,24 +328,24 @@ public class WODispatchPlanDBServiceImpl implements WODispatchPlanDBService,WODi
|
|
//添加相应的处置建议
|
|
//添加相应的处置建议
|
|
for (JPDispatchCmdBatchDispoal dispoal : jp.getDispoalList()) {
|
|
for (JPDispatchCmdBatchDispoal dispoal : jp.getDispoalList()) {
|
|
Map<String, Object> mapDispoal = FastJsonUtil.obj2Map(dispoal, true);
|
|
Map<String, Object> mapDispoal = FastJsonUtil.obj2Map(dispoal, true);
|
|
- mapDispoal.put("key", StringUtils.isEmpty(dispoal.getKey())?CommTool.genPlanItemDispoalId():dispoal.getKey());
|
|
|
|
mapDispoal.put("create_time", TimeTool.getCurMsUTC());
|
|
mapDispoal.put("create_time", TimeTool.getCurMsUTC());
|
|
mapDispoal.put(WODispatchCmdPatchDisposalTable.W_INFO.BATCH_ITEM_ID, map.get(WODispatchCmdPatchItemTable.W_INFO.PRIMARY_KEY));
|
|
mapDispoal.put(WODispatchCmdPatchDisposalTable.W_INFO.BATCH_ITEM_ID, map.get(WODispatchCmdPatchItemTable.W_INFO.PRIMARY_KEY));
|
|
if(StringUtils.isEmpty(dispoal.getKey())){
|
|
if(StringUtils.isEmpty(dispoal.getKey())){
|
|
|
|
+ mapDispoal.put("key", CommTool.genPlanItemDispoalId());
|
|
woDispatchCmdPatchDisposalMapper.inserts(mapDispoal);
|
|
woDispatchCmdPatchDisposalMapper.inserts(mapDispoal);
|
|
}else{
|
|
}else{
|
|
- Map<String,Object> andWhereUpDis = new HashMap<>();
|
|
|
|
- andWhereUpDis.put("key",dispoal.getKey());
|
|
|
|
- woDispatchCmdPatchDisposalMapper.updateWiths(mapDispoal,andWhereUpDis,new HashMap<>(),"");
|
|
|
|
|
|
+ Map<String, Object> andWheresWith = new HashMap<>();
|
|
|
|
+ andWheresWith.put(WODispatchCmdPatchDisposalTable.W_INFO.PRIMARY_KEY, dispoal.getKey());
|
|
|
|
+ woDispatchCmdPatchDisposalMapper.updateWiths(mapDispoal,andWheresWith,new HashMap<>(),"");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(StringUtils.isEmpty(jp.getBatchItemId())) {
|
|
if(StringUtils.isEmpty(jp.getBatchItemId())) {
|
|
map.put(WODispatchCmdPatchItemTable.W_INFO.PRIMARY_KEY, CommTool.genPlanItemId());
|
|
map.put(WODispatchCmdPatchItemTable.W_INFO.PRIMARY_KEY, CommTool.genPlanItemId());
|
|
woDispatchCmdPatchItemMapper.inserts(map);
|
|
woDispatchCmdPatchItemMapper.inserts(map);
|
|
}else{
|
|
}else{
|
|
- Map<String,Object> andWhereUpItem = new HashMap<>();
|
|
|
|
- andWhereUpItem.put("batch_item_id",jp.getBatchItemId());
|
|
|
|
- woDispatchCmdPatchItemMapper.updateWiths(map,andWhereUpItem,new HashMap<>(),"");
|
|
|
|
|
|
+ Map<String, Object> andWheresWith = new HashMap<>();
|
|
|
|
+ andWheresWith.put(WODispatchCmdPatchItemTable.W_INFO.PRIMARY_KEY, jp.getBatchItemId());
|
|
|
|
+ woDispatchCmdPatchItemMapper.updateWiths(map,andWheresWith,new HashMap<>(),"");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|