TaskFinishServiceImpl.java
2.14 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.huaheng.api.wcs.service.taskFinish;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.huaheng.api.wcs.domain.TaskFinishDomain;
import com.huaheng.api.wcs.service.emptyOutHandle.EmptyOutHandleService;
import com.huaheng.api.wcs.service.overrideHandle.OverrideHandleService;
import com.huaheng.common.support.Convert;
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 TaskFinishServiceImpl implements TaskFinishService {
@Autowired
private TaskHeaderService taskHeaderService;
@Autowired
private EmptyOutHandleService emptyOutHandleService;
@Autowired
private OverrideHandleService overrideHandleService;
//任务完成
@Override
public AjaxResult completeTaskByWCS(TaskFinishDomain taskFinishDomain) {
AjaxResult ajaxResult=new AjaxResult();
if(StringUtils.isEmpty(taskFinishDomain.getTaskNo())){
return AjaxResult.error("任务号为空");
}
//1、空出处理
if(taskFinishDomain.getIsEmptyOut() == 1){
ajaxResult = emptyOutHandleService.EmptyOutHandle(taskFinishDomain.getTaskNo());
}
//2、重入处理
if(taskFinishDomain.getIsDoubleIn() == 1){
ajaxResult = overrideHandleService.OverrideHandle(taskFinishDomain);
}
//3、取货错
if(taskFinishDomain.getIsForkError() == 1){
}
if (StringUtils.isEmpty(taskFinishDomain.getWeight())) {
return AjaxResult.error("重量为空");
}
//任务完成
try{
ajaxResult=taskHeaderService.completeTaskByWMS(Convert.toIntArray(taskFinishDomain.getTaskNo()), Convert.toStrArray(taskFinishDomain.getWeight()));
} catch (Exception e) {
e.printStackTrace();
}
return ajaxResult;
}
}