Commit fc5a6b1b authored by zhangwanglin's avatar zhangwanglin

新增计划记录操作人

parent 066269c5
...@@ -24,4 +24,6 @@ public class SrvTaskInfoListVO implements Serializable { ...@@ -24,4 +24,6 @@ public class SrvTaskInfoListVO implements Serializable {
* SrvTaskInfoVOs * SrvTaskInfoVOs
*/ */
private List<SrvTaskInfoVO> taskList; private List<SrvTaskInfoVO> taskList;
private Integer userId;
} }
\ No newline at end of file
...@@ -112,12 +112,14 @@ public class SrvTaskController { ...@@ -112,12 +112,14 @@ public class SrvTaskController {
* 新增或者修改服务计划 * 新增或者修改服务计划
*/ */
@PostMapping("/addOrUpdateSrvTask") @PostMapping("/addOrUpdateSrvTask")
public Result<List<SrvTaskInfoVO>> addSrvTask(SrvTaskInfoListVO param) { public Result<List<SrvTaskInfoVO>> addSrvTask(@RequestHeader("Authorization") String token,SrvTaskInfoListVO param) {
String programId = param.getProgramId(); String programId = param.getProgramId();
List<SrvTaskInfoVO> taskList = param.getTaskList(); List<SrvTaskInfoVO> taskList = param.getTaskList();
if (StringUtils.isBlank(programId) || taskList == null || taskList.size() <= 0) { if (StringUtils.isBlank(programId) || taskList == null || taskList.size() <= 0) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
Integer userId = TokenParsingUtil.TokenParsing(token, "userId");
param.setUserId(userId);
try { try {
for (int i = 0; i < taskList.size(); i++) { for (int i = 0; i < taskList.size(); i++) {
SrvTaskInfoVO srvTaskInfoVO = taskList.get(i); SrvTaskInfoVO srvTaskInfoVO = taskList.get(i);
......
...@@ -147,6 +147,9 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -147,6 +147,9 @@ public class SrvTaskServiceImpl implements SrvTaskService {
chSrvTask.setStatus((short) 1);//状态 未分配:0;已分配:1;已终止2 chSrvTask.setStatus((short) 1);//状态 未分配:0;已分配:1;已终止2
chSrvTask.setSrvDate(DateUtils.strToDate(taskDetails.get(0))); chSrvTask.setSrvDate(DateUtils.strToDate(taskDetails.get(0)));
chSrvTask.setFcd(new Date()); chSrvTask.setFcd(new Date());
chSrvTask.setLcd(new Date());
chSrvTask.setFcu(param.getUserId().longValue());
chSrvTask.setLcu(param.getUserId().longValue());
srvTaskMapper.insert(chSrvTask); srvTaskMapper.insert(chSrvTask);
// 服务计划制定方案修改为已生效 // 服务计划制定方案修改为已生效
ChSrvProgram chSrvProgram = new ChSrvProgram(); ChSrvProgram chSrvProgram = new ChSrvProgram();
...@@ -162,12 +165,12 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -162,12 +165,12 @@ public class SrvTaskServiceImpl implements SrvTaskService {
} else { } else {
// 修改服务计划 // 修改服务计划
// chSrvTaskDetailMapper.delete(new QueryWrapper<ChSrvTaskDetail>().eq("srv_task_id", Long.parseLong(srvTaskId)));//删除原来的计划详情 // chSrvTaskDetailMapper.delete(new QueryWrapper<ChSrvTaskDetail>().eq("srv_task_id", Long.parseLong(srvTaskId)));//删除原来的计划详情
if("2".equals(srvTaskInfoVO.getTaskStatus())){ /* if("2".equals(srvTaskInfoVO.getTaskStatus())){
UpdateWrapper updateWrapper1 = new UpdateWrapper(); UpdateWrapper updateWrapper1 = new UpdateWrapper();
updateWrapper1.eq("SRV_TASK_ID",srvTaskId); updateWrapper1.eq("SRV_TASK_ID",srvTaskId);
updateWrapper1.set("STATUS",3); updateWrapper1.set("STATUS",3);
chSrvTaskDetailMapper.update(null,updateWrapper1); chSrvTaskDetailMapper.update(null,updateWrapper1);
} }*/
// this.insertTaskDetail(Long.parseLong(srvTaskId), taskDetails); // this.insertTaskDetail(Long.parseLong(srvTaskId), taskDetails);
//修改服务计划 //修改服务计划
ChSrvTask chSrvTask = new ChSrvTask(); ChSrvTask chSrvTask = new ChSrvTask();
...@@ -175,6 +178,8 @@ public class SrvTaskServiceImpl implements SrvTaskService { ...@@ -175,6 +178,8 @@ public class SrvTaskServiceImpl implements SrvTaskService {
updateWrapper.eq("SRV_TASK_ID",srvTaskId); updateWrapper.eq("SRV_TASK_ID",srvTaskId);
//状态 未分配:0;已分配:1;已终止2 //状态 未分配:0;已分配:1;已终止2
updateWrapper.set("STATUS",srvTaskInfoVO.getTaskStatus()); updateWrapper.set("STATUS",srvTaskInfoVO.getTaskStatus());
updateWrapper.set("LCD",new Date());
updateWrapper.set("LCU",param.getUserId());
updateWrapper.set("END_REASON",srvTaskInfoVO.getEndReason()); updateWrapper.set("END_REASON",srvTaskInfoVO.getEndReason());
srvTaskMapper.update(null,updateWrapper); srvTaskMapper.update(null,updateWrapper);
......
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