|
@@ -60,38 +60,39 @@ public class ProjectWbsNodeServiceImpl extends ServiceImpl<ProjectWbsNodeDao, Pr
|
|
|
//更新一个报验点的任务节点状态
|
|
|
final String projectid = projectMachineObj.getString("PROJECTID");
|
|
|
final String mathinecode = projectMachineObj.getString("MATHINECODE");
|
|
|
- dao.updateWbsNodeState(projectid, mathinecode);
|
|
|
+// dao.updateWbsNodeState(projectid, mathinecode); //单个报验点更新
|
|
|
|
|
|
// 单个报验点更新完还需更新多个报验点,先获取项目所有的报验点状态
|
|
|
final LambdaQueryWrapper<ZhcxItpProjectNodeStateDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(ZhcxItpProjectNodeStateDo::getPrjid, projectid)
|
|
|
.eq(ZhcxItpProjectNodeStateDo::getMathinecode, mathinecode);
|
|
|
- final List<ZhcxItpProjectNodeStateDo> list = zhcxItpProjectNodeStateService.list(queryWrapper);
|
|
|
+ final List<ZhcxItpProjectNodeStateDo> allfinish = zhcxItpProjectNodeStateService.list(queryWrapper);
|
|
|
|
|
|
- if(ObjectUtil.isEmpty(list)) { //无报验点不做处理
|
|
|
+ if(ObjectUtil.isEmpty(allfinish)) { //无报验点不做处理
|
|
|
updateProgress(projectid, mathinecode);
|
|
|
return ;
|
|
|
}
|
|
|
- final List<JSONObject> nodeList = dao.getAllNode(projectid, mathinecode); //获取所有任务报验点
|
|
|
+
|
|
|
+ final List<JSONObject> nodeList = dao.getAllNode(projectid, mathinecode); //获取所有多报验点任务
|
|
|
if(ObjectUtil.isEmpty(nodeList)) { //无任务报验点不做处理
|
|
|
updateProgress(projectid, mathinecode);
|
|
|
return ;
|
|
|
}
|
|
|
|
|
|
//转换格式方便读取
|
|
|
- Map<String, ZhcxItpProjectNodeStateDo> nodeStateMap = new HashMap<>(list.size());
|
|
|
- for(ZhcxItpProjectNodeStateDo state : list) {
|
|
|
+ Map<String, ZhcxItpProjectNodeStateDo> nodeStateMap = new HashMap<>(allfinish.size());
|
|
|
+ for(ZhcxItpProjectNodeStateDo state : allfinish) {
|
|
|
nodeStateMap.put(state.getNodeid(), state);
|
|
|
}
|
|
|
|
|
|
- int scount = 0, count = 0;
|
|
|
-
|
|
|
- String stateIn = "0", stateOut = "0";
|
|
|
- int finishCnt = 0, finishCntOut = 0;
|
|
|
for(JSONObject item : nodeList) {
|
|
|
- count = nodeList.size();//总共多报验点任务数量
|
|
|
- final String itpnodeid = item.getString("ITPNODEID");
|
|
|
- final String[] itpNodeIds = itpnodeid.split(",");
|
|
|
+ final String fids = item.getString("ITPNODEID");
|
|
|
+ final String[] itpNodeIds = fids.split(",");
|
|
|
+
|
|
|
+ int scount = 0;
|
|
|
+ String stateIn = "0", stateOut = "0";
|
|
|
+ int finishCnt = 0, finishCntOut = 0;
|
|
|
+
|
|
|
|
|
|
if(itpNodeIds.length <= 1) {
|
|
|
continue;
|
|
@@ -123,17 +124,17 @@ public class ProjectWbsNodeServiceImpl extends ServiceImpl<ProjectWbsNodeDao, Pr
|
|
|
if(itpNodeIds.length > 1 && finishCntOut == itpNodeIds.length) {
|
|
|
stateOut = "2";
|
|
|
}
|
|
|
-
|
|
|
- //更新任务点状态
|
|
|
- final LambdaUpdateWrapper<ProjectWbsNodeDo> updateWrapper = Wrappers.lambdaUpdate();
|
|
|
- updateWrapper.eq(ProjectWbsNodeDo::getId, item.getString("ID"))
|
|
|
- .set(ProjectWbsNodeDo::getState, stateIn).set(ProjectWbsNodeDo::getStateout, stateOut);
|
|
|
- update(updateWrapper);
|
|
|
scount++;
|
|
|
+ }
|
|
|
|
|
|
- if(scount == scount) { //更新进度
|
|
|
- updateProgress(projectid, mathinecode);
|
|
|
- }
|
|
|
+ //更新任务点状态
|
|
|
+ final LambdaUpdateWrapper<ProjectWbsNodeDo> updateWrapper = Wrappers.lambdaUpdate();
|
|
|
+ updateWrapper.eq(ProjectWbsNodeDo::getId, item.getString("ID"))
|
|
|
+ .set(ProjectWbsNodeDo::getState, stateIn).set(ProjectWbsNodeDo::getStateout, stateOut);
|
|
|
+ update(updateWrapper);
|
|
|
+
|
|
|
+ if(scount == scount) { //更新进度
|
|
|
+ updateProgress(projectid, mathinecode);
|
|
|
}
|
|
|
}
|
|
|
}
|