Commit 441a2d8d authored by 李博今's avatar 李博今

Merge branch 'V2.0.3' of http://103.249.252.28:90/lcy/education

parents 71505c9e 2551b642
......@@ -172,12 +172,8 @@ public class BArrangeServiceImpl implements BArrangeService {
BSubtask bSubtask = new BSubtask();
if (subtask.get("businessId") != null){
bSubtask.setBusinessId(subtask.getString("businessId"));
}
if (subtask.get("name") != null){
bSubtask.setName(subtask.getString("name"));
bSubtaskRepository.updateByPrimaryKeySelective(bSubtask);
}
if (subtask.get("childList") != null){
//先清除原子任务
bSubAgencyRepository.deletePervious(subtask.getString("businessId"));
JSONArray childList2 = subtask.getJSONArray("childList");
......@@ -193,6 +189,27 @@ public class BArrangeServiceImpl implements BArrangeService {
bSubAgencyRepository.insertSelective(bSubAgency);
}
}
else {
List<BSubtask> subtaskList = new ArrayList<>();
List<BSubAgency> bSubAgencyList = new ArrayList<>();
bSubtask.setName(subtask.getString("name"));
bSubtask.setArrangeId(bArrange.getBusinessId());
bSubtask.setStatus("0");
UserUtil.setCurrentPersistOperation(bSubtask);
subtaskList.add(bSubtask);
JSONArray childList2 = subtask.getJSONArray("childList");
for(int j = 0; j < childList2.size() ; j++){
JSONObject agency = childList2.getJSONObject(j);
BSubAgency bSubAgency = new BSubAgency();
bSubAgency.setAgencyCode(agency.getString("agencyCode"));
bSubAgency.setStatus("0");
bSubAgency.setSubtaskId(bSubtask.getBusinessId());
UserUtil.setCurrentPersistOperation(bSubAgency);
bSubAgencyList.add(bSubAgency);
}
bArrangeRepository.insertBSubAgency(bSubAgencyList);
bArrangeRepository.insertBSubtask(subtaskList);
}
}
}
return new PersistModel(1);
......
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