#
lsh
2024-03-06 9c86cce3943842ed28f3acd48c33c76cb93b57e5
src/main/java/com/zy/asrs/service/impl/OpenServiceImpl.java
@@ -7,17 +7,17 @@
import com.core.common.R;
import com.core.exception.CoolException;
import com.zy.asrs.domain.enums.TaskStatusType;
import com.zy.asrs.domain.enums.WorkNoType;
import com.zy.asrs.entity.LocMast;
import com.zy.asrs.entity.StaDesc;
import com.zy.asrs.entity.TaskWrk;
import com.zy.asrs.entity.ToWmsDTO;
import com.zy.asrs.entity.param.TaskOverParam;
import com.zy.asrs.entity.param.WMSAndAGVInterfaceParam;
import com.zy.asrs.entity.param.taskCreateParam;
import com.zy.asrs.service.ApiLogService;
import com.zy.asrs.service.OpenService;
import com.zy.asrs.service.StaDescService;
import com.zy.asrs.service.TaskWrkService;
import com.zy.asrs.entity.param.TaskCreateParam;
import com.zy.asrs.service.*;
import com.zy.asrs.utils.Utils;
import com.zy.common.service.CommonService;
import com.zy.common.utils.HttpHandler;
import com.zy.core.DevpThread;
import com.zy.core.cache.MessageQueue;
@@ -31,7 +31,6 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.*;
@@ -47,6 +46,10 @@
    @Autowired
    private StaDescService staDescService;
    @Autowired
    private CommonService commonService;
    @Autowired
    private LocMastService locMastService;
@@ -60,7 +63,7 @@
    @Override
    public R taskCreate(taskCreateParam param) {
    public R taskCreate(TaskCreateParam param) {
        TaskWrk taskWrk = taskWrkService.selectByTaskNo(param.getTaskNo());
        if (taskWrk != null) {
            throw new CoolException(param.getTaskNo() + "任务已存在,请勿重复提交");
@@ -71,13 +74,16 @@
        Date now = new Date();
        taskWrk = new TaskWrk();
        LocMast locMast=locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",param.getStartPoint()));
        int workNo1 = commonService.getWorkNo(WorkNoType.PAKOUT.type);//获取入库工作号
        taskWrk.setTaskNo(param.getTaskNo());//任务号
        taskWrk.setWrkNo(workNo1);
        taskWrk.setStatus(TaskStatusType.RECEIVE.id);//任务状态:接收
        taskWrk.setCreateTime(now);
        taskWrk.setIoType(param.getIoType());//任务类型
        taskWrk.setIoPri(param.getTaskPriority());//优先级
        taskWrk.setBarcode(param.getBarcode());//条码
        taskWrk.setCrnNo(param.getCrn());
        taskWrk.setCrnNo(locMast.getCrnNo());
        if(param.getIoType() == 1){
            taskWrk.setWrkSts(1);
            if (!Cools.isEmpty(param.getTargetPoint())) {
@@ -88,15 +94,15 @@
        } else if (param.getIoType() == 2) {
            taskWrk.setWrkSts(11);
            if (!Cools.isEmpty(param.getStartPoint())) {
                taskWrk.setStartPoint(Utils.getWcsLocNo(param.getStartPoint()));//起点
                taskWrk.setOriginStartPoint(param.getStartPoint());
                taskWrk.setStartPoint(param.getStartPoint());//起点
                taskWrk.setTargetPoint(param.getTargetPoint());
            }
            taskWrk.setTargetPoint(param.getTargetPoint());
        }else if (param.getIoType() == 3){
            taskWrk.setWrkSts(11);
            if (!Cools.isEmpty(param.getStartPoint())) {
                taskWrk.setStartPoint(param.getStartPoint());//起点
                taskWrk.setOriginStartPoint(param.getStartPoint());
                taskWrk.setTargetPoint(param.getTargetPoint());
            }
        }
@@ -162,7 +168,7 @@
            WMSAndAGVInterfaceParam data = JSONObject.parseObject(jsonObject.get("data").toString(), WMSAndAGVInterfaceParam.class);
            String msg = null;
            try {
                taskCreate(new taskCreateParam(data));
                taskCreate(new TaskCreateParam(data));
            }catch (Exception e){
                msg = e.getMessage();
            }