|
|
@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.nl.common.exception.BadRequestException; |
|
|
|
import org.nl.wms.ext.service.AcsToWmsService; |
|
|
|
import org.nl.wms.ext.service.dto.to.BaseResponse; |
|
|
|
import org.nl.wms.pdm.service.IPdmBdWorkorderService; |
|
|
|
import org.nl.wms.sch.group.service.ISchBaseVehiclematerialgroupService; |
|
|
|
import org.nl.wms.sch.point.service.ISchBasePointService; |
|
|
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
|
|
|
import org.nl.wms.sch.task.service.ISchBaseTaskService; |
|
|
@ -49,13 +46,7 @@ public class SSXBKJTask extends AbstractTask { |
|
|
|
@Autowired |
|
|
|
private ISchBaseTaskconfigService taskConfigService; |
|
|
|
@Autowired |
|
|
|
private IPdmBdWorkorderService workorderService; |
|
|
|
@Autowired |
|
|
|
private ISchBaseVehiclematerialgroupService vehiclematerialgroupService; |
|
|
|
@Autowired |
|
|
|
private PointMapper pointMapper; |
|
|
|
@Autowired |
|
|
|
private AcsToWmsService acsToWmsService; |
|
|
|
|
|
|
|
@Override |
|
|
|
// @Transactional(rollbackFor = Exception.class)
|
|
|
@ -71,7 +62,6 @@ public class SSXBKJTask extends AbstractTask { |
|
|
|
.eq(SchBasePoint::getPoint_code, task.getPoint_code1())); |
|
|
|
String extGroupData = task.getExt_group_data(); |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(extGroupData); |
|
|
|
// String materialType = jsonObject.getString("material_type");
|
|
|
|
SchBasePoint point = findNextPoint(); |
|
|
|
if (ObjectUtil.isEmpty(point)) { |
|
|
|
task.setRemark("未找到所需点位!"); |
|
|
@ -80,7 +70,7 @@ public class SSXBKJTask extends AbstractTask { |
|
|
|
log.info("原材料入库未找到当前符合条件的点位!"); |
|
|
|
continue; |
|
|
|
} |
|
|
|
// 设置终点并修改创建成功状态
|
|
|
|
// 设置起点并修改创建成功状态
|
|
|
|
task.setPoint_code1(point.getPoint_code()); |
|
|
|
task.setTask_status(TaskStatus.CREATED.getCode()); |
|
|
|
task.setRemark(""); |
|
|
@ -88,7 +78,6 @@ public class SSXBKJTask extends AbstractTask { |
|
|
|
|
|
|
|
//发起任务时先把点位占用,防止发起重复任务
|
|
|
|
point.setIng_task_code(task.getTask_code()); |
|
|
|
// point.setVehicle_type(materialType);
|
|
|
|
pointService.update(point); |
|
|
|
|
|
|
|
//下发
|
|
|
@ -105,9 +94,12 @@ public class SSXBKJTask extends AbstractTask { |
|
|
|
String regionCode = "KJHC"; |
|
|
|
List<SchBasePoint> schBasePointList = pointMapper.findPointByRegion(regionCode, "0"); |
|
|
|
for (SchBasePoint schBasePoint : schBasePointList) { |
|
|
|
if (StringUtils.isEmpty(schBasePoint.getIng_task_code()) |
|
|
|
//查找点上无载具号无任务号、载具数量为1的
|
|
|
|
if (schBasePoint.getIs_used() |
|
|
|
&& StringUtils.isEmpty(schBasePoint.getIng_task_code()) |
|
|
|
&& StringUtils.isEmpty(schBasePoint.getVehicle_code2()) |
|
|
|
&& schBasePoint.getVehicle_qty() ==1) { |
|
|
|
log.info("原材料入库找到当前符合条件的点位{}", schBasePoint.getPoint_code()); |
|
|
|
log.info("输送线补空架找到当前符合条件的点位{}", schBasePoint.getPoint_code()); |
|
|
|
return schBasePoint; |
|
|
|
} |
|
|
|
} |
|
|
|