|
@@ -669,23 +669,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
} else {
|
|
|
if (projectBaseCostData != null) {
|
|
|
updateProjectBaseCostData(projectBaseCostData, project.getId());
|
|
|
-
|
|
|
- //创建项目涉及到基线成本数据,要填写到快照表中
|
|
|
-// EarningSnapshot snapshot = new EarningSnapshot();
|
|
|
-// snapshot.setProjectId(project.getId());
|
|
|
-// snapshot.setContractAmount(project.getContractAmount());
|
|
|
-// snapshot.setCostData(projectBaseCostData);
|
|
|
-// snapshot.setCreatorId(user.getId());
|
|
|
-// snapshot.setCreatorName(user.getName());
|
|
|
-// snapshot.setCostTotal(budget);
|
|
|
-
|
|
|
-// if (project.getContractAmount() == null || project.getContractAmount() == 0 ) {
|
|
|
-// //无需处理
|
|
|
-// } else {
|
|
|
-// snapshot.setProfit(project.getContractAmount() - budget);
|
|
|
-// snapshot.setProfitPercent(100.0*(project.getContractAmount() - budget)/project.getContractAmount());
|
|
|
-// earningSnapshotMapper.insert(snapshot);
|
|
|
-// }
|
|
|
}
|
|
|
if (projectKeyNodesData != null) {
|
|
|
updateProjectKeyNodesData(projectKeyNodesData, project.getId());
|
|
@@ -844,7 +827,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//httpRespMsg.setError("操作失败");
|
|
|
httpRespMsg.setError(MessageUtils.message("other.operationFail"));
|
|
|
} else {
|
|
|
-
|
|
|
if (customerId == null) {
|
|
|
//去掉客户
|
|
|
projectMapper.removeProjectCustomer(id);
|
|
@@ -859,58 +841,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if(costList==null){
|
|
|
return respMsg;
|
|
|
}
|
|
|
-
|
|
|
- //如果不存在基线成本快照,则生成
|
|
|
-// List<EarningSnapshot> earningSnapshots = earningSnapshotMapper.selectList(new QueryWrapper<EarningSnapshot>().eq("project_id", p.getId()).orderByDesc("id").last("limit 1"));
|
|
|
-// boolean shouldAdd = false;
|
|
|
-// if (earningSnapshots.size() == 0) {
|
|
|
-// shouldAdd = true;
|
|
|
-// } else {
|
|
|
-// //检查是否发生变化
|
|
|
-// String data = earningSnapshots.get(0).getCostData();
|
|
|
-// if (data == null) {
|
|
|
-// shouldAdd = true;
|
|
|
-// } else {
|
|
|
-// JSONArray oldArray = JSONArray.parseArray(data);
|
|
|
-// if (oldArray.size() != costList.size()) {
|
|
|
-// //条目数量有变化,需要新增
|
|
|
-// shouldAdd = true;
|
|
|
-// } else {
|
|
|
-// for (int i=0; i<oldArray.size(); i++) {
|
|
|
-// JSONObject jsonObject = oldArray.getJSONObject(i);
|
|
|
-// ProjectBasecost projectBasecost = JSONObject.toJavaObject(jsonObject, ProjectBasecost.class);
|
|
|
-// Optional<ProjectBasecost> first = costList.stream().filter(cost -> cost.getBaseId().equals(projectBasecost.getBaseId())).findFirst();
|
|
|
-// if (first.isPresent()) {
|
|
|
-// if (!first.get().getBaseAmount().equals(projectBasecost.getBaseAmount())) {
|
|
|
-// shouldAdd = true;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// //有新增的条目,需要增加
|
|
|
-// shouldAdd = true;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-// if (shouldAdd) {
|
|
|
-// EarningSnapshot record = new EarningSnapshot();
|
|
|
-// record.setProjectId(p.getId());
|
|
|
-// record.setCreatorId(user.getId());
|
|
|
-// record.setCreatorName(user.getName());
|
|
|
-// record.setContractAmount(p.getContractAmount());
|
|
|
-// record.setCostData(projectBaseCostData);
|
|
|
-// record.setCostTotal(p.getBudget());
|
|
|
-// record.setProfit(p.getContractAmount() - p.getBudget());
|
|
|
-// if (p.getContractAmount() > 0) {
|
|
|
-// record.setProfitPercent(100.0*(p.getContractAmount() - p.getBudget())/p.getContractAmount());
|
|
|
-// earningSnapshotMapper.insert(record);
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
}
|
|
|
if (projectKeyNodesData != null) {
|
|
|
updateProjectKeyNodesData(projectKeyNodesData, p.getId());
|
|
@@ -922,7 +852,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
financeProjectsMapper.update(fp, new QueryWrapper<FinanceProjects>().eq("project_id", p.getId()));
|
|
|
}
|
|
|
Project newProject = projectMapper.selectById(id);
|
|
|
- String path = Project.class.getClassLoader().getResource("/").getPath();
|
|
|
BeanChangeUtil<Project> beanChangeUtil=new BeanChangeUtil();
|
|
|
String content = beanChangeUtil.contrastObj(oldProject, newProject);
|
|
|
OperationRecord operationRecord =new OperationRecord();
|