|
|
@@ -136,7 +136,7 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
|
|
|
* @return 实例对象
|
|
|
*/
|
|
|
@Override
|
|
|
- public TaskDetails insert(TaskDetails taskDetails,TaskFeature taskFeature) {
|
|
|
+ public TaskDetails insert(TaskDetails taskDetails,Integer type) {
|
|
|
TOrderNew tOrderNew =tOrderNewMapper.selectByTid(taskDetails.getTid());
|
|
|
taskDetails.setUid(tOrderNew.getBuyerId());
|
|
|
taskDetails.setCreateTime(new Date());
|
|
|
@@ -144,13 +144,20 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
|
|
|
//数据计算
|
|
|
countTaskDetails(taskDetails);
|
|
|
this.taskDetailsMapper.insert(taskDetails);
|
|
|
- taskFeature.setId(taskDetails.getId());
|
|
|
- this.taskFeatureMapper.insert(taskFeature);
|
|
|
- addTaskDetailsLog(taskDetails,taskFeature);
|
|
|
+ //新增日志数据
|
|
|
+ if (type==1){
|
|
|
+ addTaskDetailsLog(taskDetails);
|
|
|
+ }
|
|
|
return taskDetails;
|
|
|
}
|
|
|
|
|
|
- private void addTaskDetailsLog(TaskDetails taskDetails,TaskFeature taskFeature) {
|
|
|
+ /**
|
|
|
+ *新增的时候特殊数据可以是单传输,修改的时候可以多传
|
|
|
+ *
|
|
|
+ * @param taskDetails 项目进度数据
|
|
|
+ *
|
|
|
+ */
|
|
|
+ private void addTaskDetailsLog(TaskDetails taskDetails) {
|
|
|
Admin adminToken = TokenManager.getAdminToken();
|
|
|
TaskDetailsLog log=new TaskDetailsLog();
|
|
|
BeanUtils.copyProperties(taskDetails, log);
|
|
|
@@ -159,13 +166,17 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
|
|
|
log.setAid(adminToken.getId());
|
|
|
log.setAname(adminToken.getName());
|
|
|
taskDetailsLogMapper.insert(log);
|
|
|
- TaskFeatureLog tfLog = new TaskFeatureLog();
|
|
|
- BeanUtils.copyProperties(taskFeature, tfLog);
|
|
|
- tfLog.setTdlId(log.getId());
|
|
|
- tfLog.setId(null);
|
|
|
- tfLog.setAid(adminToken.getId());
|
|
|
- tfLog.setAname(adminToken.getName());
|
|
|
- taskFeatureLogMapper.insert(tfLog);
|
|
|
+ List<TaskFeature> list = taskFeatureMapper.selectByTdId(taskDetails.getId());
|
|
|
+ for (TaskFeature feature : list) {
|
|
|
+ TaskFeatureLog tfLog = new TaskFeatureLog();
|
|
|
+ BeanUtils.copyProperties(feature, tfLog);
|
|
|
+ tfLog.setTdlId(log.getId());
|
|
|
+ tfLog.setId(null);
|
|
|
+ tfLog.setAid(adminToken.getId());
|
|
|
+ tfLog.setAname(adminToken.getName());
|
|
|
+ taskFeatureLogMapper.insert(tfLog);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void countTaskDetails(TaskDetails taskDetails) {
|
|
|
@@ -217,16 +228,15 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
|
|
|
* 修改数据
|
|
|
*
|
|
|
* @param taskDetails 实例对象
|
|
|
- * @param taskFeature
|
|
|
* @return 实例对象
|
|
|
*/
|
|
|
@Override
|
|
|
- public TaskDetails update(TaskDetails taskDetails, TaskFeature taskFeature) {
|
|
|
+ public TaskDetails update(TaskDetails taskDetails) {
|
|
|
taskDetails.setUpdateTime(new Date());
|
|
|
this.taskDetailsMapper.update(taskDetails);
|
|
|
countTaskDetails(taskDetails);
|
|
|
TaskDetails res = this.queryById(taskDetails.getId());
|
|
|
- addTaskDetailsLog(res,taskFeature);
|
|
|
+ addTaskDetailsLog(res);
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
@@ -278,4 +288,6 @@ public class TaskDetailsServiceImpl extends BaseMybatisDao<TaskDetailsMapper> im
|
|
|
taskFeatureMapper.update(in);
|
|
|
return taskFeatureMapper.selectById(in.getId());
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|