|
@ -6,11 +6,7 @@ import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import org.nl.common.exception.BadRequestException; |
|
|
import org.nl.common.exception.BadRequestException; |
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
import org.nl.wms.database.material.service.IMdBaseMaterialService; |
|
|
|
|
|
import org.nl.wms.database.material.service.dao.MdBaseMaterial; |
|
|
|
|
|
import org.nl.wms.ext.service.dto.to.BaseResponse; |
|
|
import org.nl.wms.ext.service.dto.to.BaseResponse; |
|
|
import org.nl.wms.pdm.service.IPdmBdWorkorderService; |
|
|
|
|
|
import org.nl.wms.pdm.service.dao.PdmBdWorkorder; |
|
|
|
|
|
import org.nl.wms.sch.point.service.ISchBasePointService; |
|
|
import org.nl.wms.sch.point.service.ISchBasePointService; |
|
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
|
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
|
|
import org.nl.wms.sch.task.service.ISchBaseTaskService; |
|
|
import org.nl.wms.sch.task.service.ISchBaseTaskService; |
|
@ -18,17 +14,16 @@ import org.nl.wms.sch.task.service.ISchBaseTaskconfigService; |
|
|
import org.nl.wms.sch.task.service.dao.SchBaseTask; |
|
|
import org.nl.wms.sch.task.service.dao.SchBaseTask; |
|
|
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig; |
|
|
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig; |
|
|
import org.nl.wms.sch.task_manage.enums.TaskDirectionEnum; |
|
|
import org.nl.wms.sch.task_manage.enums.TaskDirectionEnum; |
|
|
import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; |
|
|
|
|
|
import org.nl.wms.sch.task_manage.task.AcsUtil; |
|
|
import org.nl.wms.sch.task_manage.task.AcsUtil; |
|
|
import org.nl.wms.sch.task_manage.task.core.TaskStatus; |
|
|
import org.nl.wms.sch.task_manage.task.core.TaskStatus; |
|
|
import org.nl.wms.sch.workorder.service.IWorkorderService; |
|
|
import org.nl.wms.sch.workorder.service.IWorkorderService; |
|
|
|
|
|
import org.nl.wms.sch.workorder.service.dao.Workorder; |
|
|
|
|
|
import org.nl.wms.sch.workorder.service.dao.mapper.WorkorderMapper; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Component; |
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
import java.util.HashMap; |
|
|
|
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @author ldjun |
|
|
* @author ldjun |
|
@ -47,7 +42,7 @@ public abstract class AbstractTask { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IWorkorderService workorderService; |
|
|
private IWorkorderService workorderService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IMdBaseMaterialService materialService; |
|
|
private WorkorderMapper workorderMapper; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 任务创建 |
|
|
* 任务创建 |
|
@ -191,15 +186,26 @@ public abstract class AbstractTask { |
|
|
// 判断是否校验工单
|
|
|
// 判断是否校验工单
|
|
|
if (taskConfig.getIs_check_workorder()) { |
|
|
if (taskConfig.getIs_check_workorder()) { |
|
|
//如果点位上没货
|
|
|
//如果点位上没货
|
|
|
if(ObjectUtil.isNotEmpty(pointObj.getVehicle_code2())) { |
|
|
if(ObjectUtil.isEmpty(pointObj)) { |
|
|
|
|
|
throw new BadRequestException(apply_point_code+"点位信息异常,请检查输入的点位!" ); |
|
|
|
|
|
} |
|
|
|
|
|
//如果点位上没货
|
|
|
|
|
|
if(ObjectUtil.isEmpty(pointObj.getVehicle_code2())) { |
|
|
throw new BadRequestException("点位:" + apply_point_code+ "上无托盘信息!"); |
|
|
throw new BadRequestException("点位:" + apply_point_code+ "上无托盘信息!"); |
|
|
} |
|
|
} |
|
|
|
|
|
List<Workorder> works = workorderMapper.selectList(new LambdaQueryWrapper<Workorder>() |
|
|
|
|
|
.eq(Workorder::getPalletSN, pointObj.getVehicle_code2()) |
|
|
|
|
|
.le(Workorder::getStatus, 1)); |
|
|
|
|
|
if(works.size()<=0){ |
|
|
|
|
|
throw new BadRequestException("点位:" + apply_point_code+ "上托盘:"+pointObj.getVehicle_code2()+"无可出库工单信息!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//设置载具信息
|
|
|
//设置载具信息
|
|
|
param.put("vehicle_code2",pointObj.getVehicle_code2()); |
|
|
param.put("vehicle_code2",pointObj.getVehicle_code2()); |
|
|
param.put("vehicle_code",pointObj.getVehicle_code()); |
|
|
param.put("vehicle_code",pointObj.getVehicle_code()); |
|
|
//更新对应载具工单状态为已生成任务,不可在工单页面取消
|
|
|
//更新对应载具工单状态为已生成任务,不可在工单页面取消
|
|
|
//pdm_bd_workorder_two任务生成时,status改为2
|
|
|
//pdm_bd_workorder_two任务生成时,status改为2
|
|
|
workorderService.update(pointObj.getVehicle_code2(),"2"); |
|
|
workorderService.updateByPda(pointObj.getVehicle_code2(),"2",param.getString("mode")); |
|
|
// 校验工单
|
|
|
// 校验工单
|
|
|
// 根据对接位的父点位编码(设备)找到工单设备
|
|
|
// 根据对接位的父点位编码(设备)找到工单设备
|
|
|
/*SchBasePoint one = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|
/*SchBasePoint one = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() |
|
|