Blame view

src/main/java/com/huaheng/api/wcs/service/taskFinish/TaskFinishServiceImpl.java 1.97 KB
pengcheng authored
1
2
package com.huaheng.api.wcs.service.taskFinish;
pengcheng authored
3
4
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
pengcheng authored
5
import com.huaheng.api.wcs.domain.TaskFinishDomain;
6
7
import com.huaheng.api.wcs.service.emptyOutHandle.EmptyOutHandleService;
import com.huaheng.api.wcs.service.overrideHandle.OverrideHandleService;
pengcheng authored
8
9
10
import com.huaheng.common.support.Convert;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.framework.web.domain.AjaxResult;
pengcheng authored
11
import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
pengcheng authored
12
13
14
15
16
17
18
19
20
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;
21
22
23
24
    @Autowired
    private EmptyOutHandleService emptyOutHandleService;
    @Autowired
    private OverrideHandleService overrideHandleService;
pengcheng authored
25
26
27

    //任务完成
    @Override
pengcheng authored
28
    public AjaxResult completeTaskByWCS(TaskFinishDomain taskFinishDomain) {
pengcheng authored
29
        AjaxResult ajaxResult=new AjaxResult();
pengcheng authored
30
        if(StringUtils.isEmpty(taskFinishDomain.getTaskNo())){
pengcheng authored
31
32
            return AjaxResult.error("任务号为空");
        }
pengcheng authored
33
34
        //1、空出处理
pengcheng authored
35
        if(taskFinishDomain.getIsEmptyOut() == 1){
36
37
38
39
40
41
            ajaxResult = emptyOutHandleService.EmptyOutHandle(taskFinishDomain.getTaskNo());
        }

        //2、重入处理
        if(taskFinishDomain.getIsDoubleIn() == 1){
            ajaxResult = overrideHandleService.OverrideHandle(taskFinishDomain);
pengcheng authored
42
        }
43
44
45
46
47
48
49

        //3、取货错
        if(taskFinishDomain.getIsForkError() == 1){

        }

        //任务完成
pengcheng authored
50
        try{
pengcheng authored
51
            ajaxResult=taskHeaderService.completeTaskByWMS(Convert.toIntArray(taskFinishDomain.getTaskNo()));
pengcheng authored
52
53
54
55
56
57
        } catch (Exception e) {
            e.printStackTrace();
        }
        return ajaxResult;
    }
}