|
@@ -232,6 +232,24 @@ public class ZhcxPmqManagementRecoredServiceImpl extends ServiceImpl<ZhcxPmqMana
|
|
|
|
|
|
@Override
|
|
|
public R getListData(String id) {
|
|
|
+ List<ZhcxPmqManagementDistributionDo> distributions = getDistributionDataByPid(id);
|
|
|
+ Map<String, Object> results = new HashMap<>();
|
|
|
+ results.put("records",distributions);
|
|
|
+ results.put("current",1);
|
|
|
+ results.put("orders",new ArrayList<String>());
|
|
|
+ results.put("pages",1);
|
|
|
+ results.put("searchCount",true);
|
|
|
+ results.put("size",100);
|
|
|
+ results.put("total",distributions.size());
|
|
|
+ return R.ok(results);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 构建2.5层三单数据(已保存)
|
|
|
+ * @param id record_id
|
|
|
+ * @return 集合
|
|
|
+ */
|
|
|
+ private List<ZhcxPmqManagementDistributionDo> getDistributionDataByPid(String id){
|
|
|
ZhcxPmqManagementRecoredDo recoredDo = this.getById(id);
|
|
|
// 生成第2.5层数据结果
|
|
|
List<ZhcxPmqManagementDistributionDo> distributions = baseMapper.getDistributionsByPid(id);
|
|
@@ -269,7 +287,12 @@ public class ZhcxPmqManagementRecoredServiceImpl extends ServiceImpl<ZhcxPmqMana
|
|
|
}
|
|
|
if(isSave){
|
|
|
// 更改派单状态/更新第二层的状态
|
|
|
- recoredDo.setDispatchstatus("1");
|
|
|
+ int sized = (int) distributions.stream().filter(item -> !item.getStatus().equals("已关闭") && StringUtils.isEmpty(item.getConfirmer())).count();
|
|
|
+ if(sized >0){
|
|
|
+ recoredDo.setDispatchstatus("2");//部分派单
|
|
|
+ }else {
|
|
|
+ recoredDo.setDispatchstatus("1");//已派单
|
|
|
+ }
|
|
|
if(index == distributions.size()){
|
|
|
recoredDo.setClosestatus("已关闭");
|
|
|
this.updateById(recoredDo);
|
|
@@ -279,17 +302,8 @@ public class ZhcxPmqManagementRecoredServiceImpl extends ServiceImpl<ZhcxPmqMana
|
|
|
}
|
|
|
log.info("更新关闭状态");
|
|
|
}
|
|
|
- Map<String, Object> results = new HashMap<>();
|
|
|
- results.put("records",distributions);
|
|
|
- results.put("current",1);
|
|
|
- results.put("orders",new ArrayList<String>());
|
|
|
- results.put("pages",1);
|
|
|
- results.put("searchCount",true);
|
|
|
- results.put("size",100);
|
|
|
- results.put("total",distributions.size());
|
|
|
- return R.ok(results);
|
|
|
+ return distributions;
|
|
|
}
|
|
|
-
|
|
|
/**
|
|
|
* 三单派单右边列表
|
|
|
* @param deptid NX部门id
|
|
@@ -326,4 +340,16 @@ public class ZhcxPmqManagementRecoredServiceImpl extends ServiceImpl<ZhcxPmqMana
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R getBatchListData(String id) {
|
|
|
+ // 去构建保存2.5层的数据集合
|
|
|
+ String[] idSplit = id.split(",");
|
|
|
+ for (String recordId : idSplit) {
|
|
|
+ // 执行第2.5层保存操作
|
|
|
+ getDistributionDataByPid(recordId);
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|