Commit fc5a6b1b authored by zhangwanglin's avatar zhangwanglin

新增计划记录操作人

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