StatusUpdateServiceImpl.java
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.huaheng.api.wcs.service.statusUpdate;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.framework.web.domain.AjaxResult;
import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
import com.huaheng.pc.task.taskHeader.service.TaskHeaderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class StatusUpdateServiceImpl implements StatusUpdateService {
@Autowired
private TaskHeaderService taskHeaderService;
@Override
public AjaxResult statusUpdate(String taskNo) {
if(StringUtils.isEmpty(taskNo)){
return AjaxResult.error("任务号为空");
}
//TaskHeader taskHeader = taskHeaderService.selectEntityById(Integer.valueOf(taskNo));
TaskHeader taskHeader = taskHeaderService.getById(Integer.valueOf(taskNo));
if(taskHeader == null){
return AjaxResult.error("wms找不到该任务号");
}
if(taskHeader.getStatus().intValue() == 100){
return AjaxResult.error("wms该任务已完成");
}
taskHeader.setStatus(50);
//taskHeader.setLastStatus((short)50);
taskHeaderService.updateById(taskHeader);
return AjaxResult.success("修改成功");
}
}