|
|
@ -1,9 +1,7 @@ |
|
|
|
package org.nl.wms.ext.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.lang.Assert; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.http.HttpStatus; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
@ -12,46 +10,30 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.nl.common.exception.BadRequestException; |
|
|
|
import org.nl.common.utils.RedisUtils; |
|
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
|
import org.nl.system.service.logicflow.dao.Stage; |
|
|
|
import org.nl.system.service.notice.ISysNoticeService; |
|
|
|
import org.nl.system.service.param.ISysParamService; |
|
|
|
import org.nl.wms.database.material.service.IMdBaseMaterialService; |
|
|
|
import org.nl.wms.database.material.service.dao.MdBaseMaterial; |
|
|
|
import org.nl.wms.ext.service.AcsToWmsService; |
|
|
|
import org.nl.wms.ext.service.dto.to.BaseResponse; |
|
|
|
import org.nl.wms.ext.service.dto.to.wms.FeedBackTaskStatusRequest; |
|
|
|
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; |
|
|
|
import org.nl.wms.sch.group.service.dao.SchBaseVehiclematerialgroup; |
|
|
|
import org.nl.wms.sch.material.service.dao.Material; |
|
|
|
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; |
|
|
|
import org.nl.wms.sch.point.service.ISchBasePointService; |
|
|
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
|
|
|
import org.nl.wms.sch.point.service.impl.SchBasePointServiceImpl; |
|
|
|
import org.nl.wms.sch.task.service.ISchBaseTaskService; |
|
|
|
import org.nl.wms.sch.task.service.dao.SchBaseTask; |
|
|
|
import org.nl.wms.sch.task_manage.AbstractTask; |
|
|
|
import org.nl.wms.sch.task_manage.GeneralDefinition; |
|
|
|
import org.nl.wms.sch.task_manage.enums.GroupBindMaterialStatusEnum; |
|
|
|
import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum; |
|
|
|
import org.nl.wms.sch.task_manage.enums.PointStatusEnum; |
|
|
|
import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; |
|
|
|
import org.nl.wms.sch.task_manage.task.TaskFactory; |
|
|
|
import org.nl.wms.sch.task_manage.task.core.TaskStatus; |
|
|
|
import org.nl.wms.sch.task_manage.task.tasks.mapper.PointMapper; |
|
|
|
import org.nl.wms.util.PointUtils; |
|
|
|
import org.nl.wms.util.TaskUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.annotation.PostConstruct; |
|
|
|
import java.lang.reflect.InvocationTargetException; |
|
|
|
import java.lang.reflect.Method; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Author: lyd |
|
|
@ -71,15 +53,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
@Autowired |
|
|
|
private ISchBasePointService pointService; |
|
|
|
@Autowired |
|
|
|
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService; |
|
|
|
@Autowired |
|
|
|
private TaskFactory taskFactory; |
|
|
|
@Autowired |
|
|
|
private ISysNoticeService noticeService; |
|
|
|
@Autowired |
|
|
|
private PointMapper pointMapper; |
|
|
|
@Autowired |
|
|
|
private RedisUtils redisUtils; |
|
|
|
@Autowired |
|
|
|
private MaterialMapper materialMapper; |
|
|
|
|
|
|
|
// 初始化反射方法
|
|
|
|
@PostConstruct |
|
|
@ -152,6 +132,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { |
|
|
|
String device_code = param.getString("device_code"); |
|
|
|
//设置任务类型
|
|
|
|
param.put("config_code",requestMethodCode); |
|
|
|
//统一托盘码字段
|
|
|
|
if(ObjectUtil.isNotEmpty(param.getString("sub_tray"))){ |
|
|
|
param.put("vehicle_code2",param.getString("sub_tray")); |
|
|
|
} |
|
|
|
if(ObjectUtil.isNotEmpty(param.getString("mother_tray"))){ |
|
|
|
param.put("vehicle_code",param.getString("mother_tray")); |
|
|
|
} |
|
|
|
AbstractTask task = taskFactory.getTask(requestMethodCode); |
|
|
|
if(ObjectUtil.isEmpty(requestMethodCode)){ |
|
|
|
throw new BadRequestException("任务类型不能为空!requestMethodCode:"+requestMethodName+",device_code:"+device_code); |
|
|
|