opt:二楼出库逻辑优化
This commit is contained in:
@@ -42,7 +42,7 @@ public class AppRun implements CommandLineRunner {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(String... args) {
|
public void run(String... args) {
|
||||||
HeartClientServer heartServer = new HeartClientServer(new InetSocketAddress("192.168.18.218", 20889));
|
//HeartClientServer heartServer = new HeartClientServer(new InetSocketAddress("192.168.18.218", 20889));
|
||||||
System.out.println("--------项目启动完成--------");
|
System.out.println("--------项目启动完成--------");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public enum StatusEnum {
|
|||||||
"立库", "1", null, "AGV任务", "2", null, "CTU任务", "3", null
|
"立库", "1", null, "AGV任务", "2", null, "CTU任务", "3", null
|
||||||
)),
|
)),
|
||||||
ACS_SYSTEM_TYPE(ForkMap.of(
|
ACS_SYSTEM_TYPE(ForkMap.of(
|
||||||
"NDC", "1", null, "海柔CTU", "5", null, "海康CTU", "6", null
|
"NDC", "1", null, "仙工", "2", null,"海柔CTU", "5", null, "海康CTU", "6", null
|
||||||
)),
|
)),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import java.util.stream.Collectors;
|
|||||||
/*
|
/*
|
||||||
* @author ZZQ
|
* @author ZZQ
|
||||||
* @Date 2024/4/6 16:18
|
* @Date 2024/4/6 16:18
|
||||||
* 巷道均衡策略:XYZ:排列层
|
* 巷道均衡策略:XYZ: 排列层
|
||||||
*/
|
*/
|
||||||
@Service("alleyAve")
|
@Service("alleyAve")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import java.util.stream.Collectors;
|
|||||||
/*
|
/*
|
||||||
* @author ZZQ
|
* @author ZZQ
|
||||||
* @Date 2024/4/6 16:18
|
* @Date 2024/4/6 16:18
|
||||||
* 货位限位策略:限高,限宽,限长,限重
|
* 货位限位策略: 限高,限宽,限长,限重
|
||||||
*/
|
*/
|
||||||
@Service("limitStorage")
|
@Service("limitStorage")
|
||||||
public class LimitStorageRuleHandler extends Decisioner<StIvtStructattr, JSONObject> {
|
public class LimitStorageRuleHandler extends Decisioner<StIvtStructattr, JSONObject> {
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ import java.util.List;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @author ZZQ
|
* @author GBX
|
||||||
* @Date 2024/4/6 16:18
|
* @Date 2025/2/1 16:18
|
||||||
* 巷道均衡策略:XYZ:排列层
|
* 相同巷道,自下而上分配,左右相邻
|
||||||
*/
|
*/
|
||||||
@Service("sameBlockNum")
|
@Service("sameBlockNum")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import java.util.List;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
*深位优先
|
||||||
* @author ZZQ
|
* @author ZZQ
|
||||||
* @Date 2024/7/31 15:19
|
* @Date 2024/7/31 15:19
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -93,7 +93,8 @@ public class SchBasePointController {
|
|||||||
throw new BadRequestException("输入的站点编号有误或被禁用,请检查!");
|
throw new BadRequestException("输入的站点编号有误或被禁用,请检查!");
|
||||||
}
|
}
|
||||||
SchBasePoint point = pointList.get(0);
|
SchBasePoint point = pointList.get(0);
|
||||||
point.setRemark("00".equals(point.getLock_type()) ? "未绑定货架" : "已绑定货架");
|
point.setRemark(StringUtils.isNotBlank(point.getVehicle_code()) ? "已绑定货架" : "未绑定货架");
|
||||||
|
point.setLock_type(StringUtils.isNotBlank(point.getVehicle_code()) ? "20" : "00");
|
||||||
return new ResponseEntity<>(point, HttpStatus.OK);
|
return new ResponseEntity<>(point, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
|||||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -53,6 +54,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
* @param mode 0解绑1绑定
|
* @param mode 0解绑1绑定
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void bindOrUnbind(String siteCode, String shelfCode, String mode) {
|
public void bindOrUnbind(String siteCode, String shelfCode, String mode) {
|
||||||
List<SchBasePoint> pointList = this.list(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getCode, siteCode).eq(SchBasePoint::getIs_used, true));
|
List<SchBasePoint> pointList = this.list(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getCode, siteCode).eq(SchBasePoint::getIs_used, true));
|
||||||
if (ObjectUtils.isEmpty(pointList)) {
|
if (ObjectUtils.isEmpty(pointList)) {
|
||||||
@@ -66,16 +68,34 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
if (ObjectUtils.isNotEmpty(notEmptyList)) {
|
if (ObjectUtils.isNotEmpty(notEmptyList)) {
|
||||||
throw new BadRequestException("该货架的货位:" + notEmptyList.get(0).getStruct_code() + ",存在未出库的料箱:" + notEmptyList.get(0).getVehicle_code() + ",请检查!");
|
throw new BadRequestException("该货架的货位:" + notEmptyList.get(0).getStruct_code() + ",存在未出库的料箱:" + notEmptyList.get(0).getVehicle_code() + ",请检查!");
|
||||||
}
|
}
|
||||||
|
List<SchBasePoint> shelfCodePointList = this.list(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getVehicle_code, shelfCode));
|
||||||
LambdaUpdateWrapper<SchBasePoint> wrapper = new LambdaUpdateWrapper<SchBasePoint>()
|
LambdaUpdateWrapper<SchBasePoint> wrapper = new LambdaUpdateWrapper<SchBasePoint>()
|
||||||
.eq(SchBasePoint::getCode, siteCode);
|
.eq(SchBasePoint::getCode, siteCode);
|
||||||
if ("1".equals(mode)) {
|
if ("1".equals(mode)) {
|
||||||
if (StringUtils.isNotBlank(pointList.get(0).getVehicle_code())) {
|
if (StringUtils.isNotBlank(pointList.get(0).getVehicle_code())) {
|
||||||
throw new BadRequestException("当前站点已绑定货架,货架编号:" + pointList.get(0).getVehicle_code() + ",请检查或解绑!");
|
throw new BadRequestException("当前站点已绑定货架,货架编号:" + pointList.get(0).getVehicle_code() + ",请检查或解绑!");
|
||||||
}
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(shelfCodePointList)) {
|
||||||
|
if (!shelfCodePointList.get(0).getLock_type().equals(StatusEnum.LOCK.code("无锁"))) {
|
||||||
|
throw new BadRequestException("该货架正在执行输送任务,状态为锁定,请等任务完成再解绑!");
|
||||||
|
}
|
||||||
|
//解锁
|
||||||
|
LambdaUpdateWrapper<SchBasePoint> wrapper1 = new LambdaUpdateWrapper<SchBasePoint>()
|
||||||
|
.eq(SchBasePoint::getVehicle_code, shelfCode)
|
||||||
|
.set(SchBasePoint::getVehicle_code, null)
|
||||||
|
.set(SchBasePoint::getPoint_type, 0)
|
||||||
|
.set(SchBasePoint::getLock_type, StatusEnum.LOCK.code("无锁"));
|
||||||
|
this.update(wrapper1);
|
||||||
|
}
|
||||||
wrapper.set(SchBasePoint::getVehicle_code, shelfCode)
|
wrapper.set(SchBasePoint::getVehicle_code, shelfCode)
|
||||||
.set(SchBasePoint::getPoint_type, 0)
|
.set(SchBasePoint::getPoint_type, 0)
|
||||||
.set(SchBasePoint::getLock_type, StatusEnum.LOCK.code("无锁"));
|
.set(SchBasePoint::getLock_type, StatusEnum.LOCK.code("无锁"));
|
||||||
} else if ("0".equals(mode)) {
|
} else if ("0".equals(mode)) {
|
||||||
|
if (ObjectUtils.isNotEmpty(shelfCodePointList)) {
|
||||||
|
if (!shelfCodePointList.get(0).getLock_type().equals(StatusEnum.LOCK.code("无锁"))) {
|
||||||
|
throw new BadRequestException("该货架正在执行输送任务,状态为锁定,请等任务完成再解绑!");
|
||||||
|
}
|
||||||
|
}
|
||||||
wrapper.set(SchBasePoint::getVehicle_code, null)
|
wrapper.set(SchBasePoint::getVehicle_code, null)
|
||||||
.set(SchBasePoint::getLock_type, StatusEnum.LOCK.code("无锁"));
|
.set(SchBasePoint::getLock_type, StatusEnum.LOCK.code("无锁"));
|
||||||
}
|
}
|
||||||
@@ -83,7 +103,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
|||||||
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName());
|
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName());
|
||||||
this.update(wrapper);
|
this.update(wrapper);
|
||||||
//绑定状态同步至ACS
|
//绑定状态同步至ACS
|
||||||
wmsToAcsService.bindPodAndBerth(siteCode, shelfCode, mode, "bindPodAndBerth");
|
wmsToAcsService.bindPodAndBerth(shelfCode,siteCode,mode, "bindPodAndBerth");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class SecondFloorAgvTransferTask extends AbstractTask {
|
|||||||
task.setStatus(StatusEnum.FORM_STATUS.code("生成"));
|
task.setStatus(StatusEnum.FORM_STATUS.code("生成"));
|
||||||
task.setHandle_class(this.getClass().getName());
|
task.setHandle_class(this.getClass().getName());
|
||||||
task.setAcs_type(StatusEnum.ACS_TYPE.code("AGV任务"));
|
task.setAcs_type(StatusEnum.ACS_TYPE.code("AGV任务"));
|
||||||
|
task.setAgv_system_type(StatusEnum.ACS_SYSTEM_TYPE.code("仙工"));
|
||||||
task.setCreate_time(DateUtil.now());
|
task.setCreate_time(DateUtil.now());
|
||||||
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||||
task.setTask_type(StatusEnum.IOBILL_TYPE_OUT.code("二楼出库AGV搬运"));
|
task.setTask_type(StatusEnum.IOBILL_TYPE_OUT.code("二楼出库AGV搬运"));
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class SecondFloorEmptyShelfTask extends AbstractTask {
|
|||||||
task.setStatus(StatusEnum.FORM_STATUS.code("生成"));
|
task.setStatus(StatusEnum.FORM_STATUS.code("生成"));
|
||||||
task.setHandle_class(this.getClass().getName());
|
task.setHandle_class(this.getClass().getName());
|
||||||
task.setAcs_type(StatusEnum.ACS_TYPE.code("AGV任务"));
|
task.setAcs_type(StatusEnum.ACS_TYPE.code("AGV任务"));
|
||||||
|
task.setAgv_system_type(StatusEnum.ACS_SYSTEM_TYPE.code("仙工"));
|
||||||
task.setCreate_time(DateUtil.now());
|
task.setCreate_time(DateUtil.now());
|
||||||
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
task.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||||
task.setTask_type(StatusEnum.IOBILL_TYPE_OUT.code("二楼空架AGV搬运"));
|
task.setTask_type(StatusEnum.IOBILL_TYPE_OUT.code("二楼空架AGV搬运"));
|
||||||
|
|||||||
@@ -97,10 +97,10 @@ public class SecondFloorOutStorageTask extends AbstractTask {
|
|||||||
* @param pointCode2 CTU站点编号
|
* @param pointCode2 CTU站点编号
|
||||||
* @param vehicleCode 载具编号
|
* @param vehicleCode 载具编号
|
||||||
* @param sourceFormId 载具物料ID
|
* @param sourceFormId 载具物料ID
|
||||||
* @param inStructCode 货架仓位
|
* @param targetCode 货架仓位
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public JSONObject handleBills(String billCode, String siteCode, String pointCode2, String vehicleCode, String sourceFormId, String inStructCode) throws BadRequestException {
|
public JSONObject handleBills(String billCode, String siteCode, String pointCode2, String vehicleCode, String sourceFormId, String targetCode) throws BadRequestException {
|
||||||
try {
|
try {
|
||||||
// 创建任务
|
// 创建任务
|
||||||
JSONObject taskJsonObject = new JSONObject();
|
JSONObject taskJsonObject = new JSONObject();
|
||||||
@@ -131,10 +131,10 @@ public class SecondFloorOutStorageTask extends AbstractTask {
|
|||||||
.set("lock_type", StatusEnum.LOCK.code("入库锁"))
|
.set("lock_type", StatusEnum.LOCK.code("入库锁"))
|
||||||
.set("update_time", DateUtil.now())
|
.set("update_time", DateUtil.now())
|
||||||
.set("update_name", SecurityUtils.getCurrentNickName())
|
.set("update_name", SecurityUtils.getCurrentNickName())
|
||||||
.eq("struct_code", inStructCode));
|
.eq("struct_code", pointCode2));
|
||||||
taskJsonObject.put("pointCode1", structattrVechielDto.getStruct_code());
|
taskJsonObject.put("pointCode1", structattrVechielDto.getStruct_code());
|
||||||
taskJsonObject.put("pointCode2", pointCode2);
|
taskJsonObject.put("pointCode2", pointCode2);
|
||||||
taskJsonObject.put("pointCode3", inStructCode);
|
taskJsonObject.put("pointCode3", targetCode);
|
||||||
taskJsonObject.put("pointCode4", siteCode);
|
taskJsonObject.put("pointCode4", siteCode);
|
||||||
taskJsonObject.put("vehicleCode", vehicleCode);
|
taskJsonObject.put("vehicleCode", vehicleCode);
|
||||||
taskJsonObject.put("source_form_id", sourceFormId);
|
taskJsonObject.put("source_form_id", sourceFormId);
|
||||||
@@ -164,7 +164,7 @@ public class SecondFloorOutStorageTask extends AbstractTask {
|
|||||||
.set("update_time", now)
|
.set("update_time", now)
|
||||||
.set("lock_type", StatusEnum.LOCK.code("无锁"))
|
.set("lock_type", StatusEnum.LOCK.code("无锁"))
|
||||||
.set("vehicle_code", schBaseTask.getVehicle_code())
|
.set("vehicle_code", schBaseTask.getVehicle_code())
|
||||||
.eq("struct_code", schBaseTask.getPoint_code3());
|
.eq("struct_code", schBaseTask.getPoint_code2());
|
||||||
iStIvtStructattrService.update(wrapper2);
|
iStIvtStructattrService.update(wrapper2);
|
||||||
//更新料架仓位
|
//更新料架仓位
|
||||||
// UpdateWrapper<StIvtStructattr> wrapper2 = new UpdateWrapper<StIvtStructattr>()
|
// UpdateWrapper<StIvtStructattr> wrapper2 = new UpdateWrapper<StIvtStructattr>()
|
||||||
@@ -225,14 +225,14 @@ public class SecondFloorOutStorageTask extends AbstractTask {
|
|||||||
//终点解锁
|
//终点解锁
|
||||||
iSchBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
|
iSchBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
|
||||||
.set(SchBasePoint::getLock_type, StatusEnum.LOCK.code("无锁"))
|
.set(SchBasePoint::getLock_type, StatusEnum.LOCK.code("无锁"))
|
||||||
.eq(SchBasePoint::getCode, schBaseTask.getPoint_code2()));
|
.eq(SchBasePoint::getCode, schBaseTask.getPoint_code3()));
|
||||||
//入库仓位解锁
|
//入库仓位解锁
|
||||||
iStIvtStructattrService.update(new UpdateWrapper<StIvtStructattr>()
|
iStIvtStructattrService.update(new UpdateWrapper<StIvtStructattr>()
|
||||||
.set("lock_type", StatusEnum.LOCK.code("无锁"))
|
.set("lock_type", StatusEnum.LOCK.code("无锁"))
|
||||||
.set("vehicle_code", null)
|
.set("vehicle_code", null)
|
||||||
.set("update_time", DateUtil.now())
|
.set("update_time", DateUtil.now())
|
||||||
.set("update_name", SecurityUtils.getCurrentNickName())
|
.set("update_name", SecurityUtils.getCurrentNickName())
|
||||||
.eq("struct_code", schBaseTask.getPoint_code3()));
|
.eq("struct_code", schBaseTask.getPoint_code2()));
|
||||||
//载具物料解锁
|
//载具物料解锁
|
||||||
iMdPbVehicleMaterService.update(new LambdaUpdateWrapper<MdPbVehicleMater>()
|
iMdPbVehicleMaterService.update(new LambdaUpdateWrapper<MdPbVehicleMater>()
|
||||||
.set(MdPbVehicleMater::getFrozen_qty, 0)
|
.set(MdPbVehicleMater::getFrozen_qty, 0)
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package org.nl.wms.flow_manage.flow.service.classprocessimpl;
|
package org.nl.wms.flow_manage.flow.service.classprocessimpl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.github.javaparser.utils.Log;
|
import com.github.javaparser.utils.Log;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.wms.flow_manage.flow.framework.process.nodeType.excess.impl.process.classprocess.ClassProcess;
|
import org.nl.wms.flow_manage.flow.framework.process.nodeType.excess.impl.process.classprocess.ClassProcess;
|
||||||
import org.nl.wms.md_manage.vehicleMater.service.IMdPbVehicleMaterService;
|
import org.nl.wms.md_manage.vehicleMater.service.IMdPbVehicleMaterService;
|
||||||
import org.nl.wms.md_manage.vehicleMater.service.dao.MdPbVehicleMater;
|
import org.nl.wms.md_manage.vehicleMater.service.dao.MdPbVehicleMater;
|
||||||
@@ -32,9 +34,30 @@ public class CtuProcessHandler implements ClassProcess {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public JSONObject process(JSONObject from, JSONObject param) {
|
public JSONObject process(JSONObject from, JSONObject param) {
|
||||||
|
String id = from.getString("id");
|
||||||
|
PmFormData pmFormData = iPmFormDataService.getById(id);
|
||||||
JSONObject vehicleMater = from.getJSONObject("vehicleMater");
|
JSONObject vehicleMater = from.getJSONObject("vehicleMater");
|
||||||
|
if (vehicleMater == null) {
|
||||||
|
LambdaUpdateWrapper<PmFormData> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.eq(PmFormData::getId, pmFormData.getId());
|
||||||
|
updateWrapper.set(PmFormData::getRemark, "CTU出库用料单号异常:未获取到物料载具信息vehicleMater,from数据为:" + JSON.toJSONString(from));
|
||||||
|
iPmFormDataService.update(updateWrapper);
|
||||||
|
log.error("CTU出库用料单号异常:未获取到物料载具信息vehicleMater,from数据为:" + JSON.toJSONString(from));
|
||||||
|
}
|
||||||
JSONObject sourceFormData = from.getJSONObject("source_form_data");
|
JSONObject sourceFormData = from.getJSONObject("source_form_data");
|
||||||
|
if (sourceFormData == null) {
|
||||||
|
iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
||||||
|
.set("prd_ppbom_no", "CTU出库用料单号异常:未获取到源单信息sourceFormData,from数据为:" + JSON.toJSONString(from))
|
||||||
|
.eq("id", vehicleMater.getString("id")));
|
||||||
|
log.error("CTU出库用料单号异常:未获取到源单信息sourceFormData,from数据为:" + JSON.toJSONString(from));
|
||||||
|
}
|
||||||
String billCode = sourceFormData.getString("code");
|
String billCode = sourceFormData.getString("code");
|
||||||
|
if (StringUtils.isBlank(billCode)) {
|
||||||
|
iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
||||||
|
.set("prd_ppbom_no", "CTU出库用料单号异常:未获取到源单号billCode,from数据为:" + JSON.toJSONString(from))
|
||||||
|
.eq("id", vehicleMater.getString("id")));
|
||||||
|
log.error("CTU出库用料单号异常:未获取到源单号billCode,from数据为:" + JSON.toJSONString(from));
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
//更新物料载具信息的出库单据号
|
//更新物料载具信息的出库单据号
|
||||||
iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ public class MdGruopDickServiceImpl extends ServiceImpl<MdGruopDickMapper, MdGru
|
|||||||
}
|
}
|
||||||
BmVehicleInfo vehicleInfo = iBmVehicleInfoService.vehileInfo(vehicle_code);
|
BmVehicleInfo vehicleInfo = iBmVehicleInfoService.vehileInfo(vehicle_code);
|
||||||
if (vehicleInfo == null) {
|
if (vehicleInfo == null) {
|
||||||
throw new BadRequestException("第" + (i + 1) +"行,"+vehicle_code+ "载具编号不能为空");
|
throw new BadRequestException("第" + (i + 1) +"行,"+vehicle_code+ "载具信息未录入,请录入");
|
||||||
}
|
}
|
||||||
List<MdPbVehicleMaterVo> vehicleMaters = iMdPbVehicleMaterService.getVehicleMaters(vehicle_code);
|
List<MdPbVehicleMaterVo> vehicleMaters = iMdPbVehicleMaterService.getVehicleMaters(vehicle_code);
|
||||||
if (!CollectionUtils.isEmpty(vehicleMaters)) {
|
if (!CollectionUtils.isEmpty(vehicleMaters)) {
|
||||||
|
|||||||
@@ -199,11 +199,11 @@ public class PdaIOService {
|
|||||||
.eq(StIvtStructattr::getSect_code, endPointList.get(0).getVehicle_code())
|
.eq(StIvtStructattr::getSect_code, endPointList.get(0).getVehicle_code())
|
||||||
.eq(StIvtStructattr::getLock_type, StatusEnum.LOCK.code("无锁"))
|
.eq(StIvtStructattr::getLock_type, StatusEnum.LOCK.code("无锁"))
|
||||||
.eq(StIvtStructattr::getStor_code, StatusEnum.STOCK_INFO.code("二楼货架缓存库"))
|
.eq(StIvtStructattr::getStor_code, StatusEnum.STOCK_INFO.code("二楼货架缓存库"))
|
||||||
.isNotNull(StIvtStructattr::getVehicle_code)
|
.isNull(StIvtStructattr::getVehicle_code)
|
||||||
.orderByAsc(StIvtStructattr::getLayer_num));
|
.orderByAsc(StIvtStructattr::getLayer_num));
|
||||||
if (ObjectUtils.isEmpty(stIvtStructattrList)) {
|
if (ObjectUtils.isEmpty(stIvtStructattrList)) {
|
||||||
log.error("CTU出库任务,该单据{}出库时,地面货架站点货架的货位已放满,请检查现场情况", billCode);
|
log.error("CTU出库任务,该单据{}出库时,地面货架站点货架的货位已放满,请检查现场情况", billCode);
|
||||||
throw new BadRequestException("地面货架站点货架的货位已放满,请检查现场情况");
|
throw new BadRequestException("地面货架站点货架:"+endPointList.get(0).getVehicle_code()+"的货位已放满,请检查现场情况");
|
||||||
}
|
}
|
||||||
// CTU分配终点
|
// CTU分配终点
|
||||||
List<SchBasePoint> targetPointList = endPointList.stream().filter(r -> r.getVehicle_code().equals(stIvtStructattrList.get(0).getSect_code())).collect(Collectors.toList());
|
List<SchBasePoint> targetPointList = endPointList.stream().filter(r -> r.getVehicle_code().equals(stIvtStructattrList.get(0).getSect_code())).collect(Collectors.toList());
|
||||||
@@ -214,7 +214,7 @@ public class PdaIOService {
|
|||||||
if (StringUtils.isBlank(pdaFormOutMst.getChildren().get(i).getVehicle_code())) {
|
if (StringUtils.isBlank(pdaFormOutMst.getChildren().get(i).getVehicle_code())) {
|
||||||
throw new BadRequestException("出库失败,料箱码不能为空");
|
throw new BadRequestException("出库失败,料箱码不能为空");
|
||||||
}
|
}
|
||||||
JSONObject jsonObject = secondFloorOutStorageTask.handleBills(billCode, siteCode, targetPointList.get(0).getCode(), pdaFormOutMst.getChildren().get(i).getVehicle_code(), pdaFormOutMst.getChildren().get(i).getId(), stIvtStructattrList.get(0).getStruct_code());
|
JSONObject jsonObject = secondFloorOutStorageTask.handleBills(billCode, siteCode, stIvtStructattrList.get(0).getStruct_code(),pdaFormOutMst.getChildren().get(i).getVehicle_code(), pdaFormOutMst.getChildren().get(i).getId(),targetPointList.get(0).getCode());
|
||||||
jsonArray.add(jsonObject);
|
jsonArray.add(jsonObject);
|
||||||
} catch (BadRequestException e) {
|
} catch (BadRequestException e) {
|
||||||
log.error("单据号:{}的第{}行明细,物料号为:{},出库异常:", billCode, i, pdaFormOutMst.getChildren().get(i).getMaterial_code(), e);
|
log.error("单据号:{}的第{}行明细,物料号为:{},出库异常:", billCode, i, pdaFormOutMst.getChildren().get(i).getMaterial_code(), e);
|
||||||
@@ -231,8 +231,6 @@ public class PdaIOService {
|
|||||||
.eq(SchBasePoint::getCode, endPointList.get(0).getCode()));
|
.eq(SchBasePoint::getCode, endPointList.get(0).getCode()));
|
||||||
List<String> taskIdList = jsonArray.stream().map(r -> ((JSONObject) r).getString("id")).collect(Collectors.toList());
|
List<String> taskIdList = jsonArray.stream().map(r -> ((JSONObject) r).getString("id")).collect(Collectors.toList());
|
||||||
//todo 终点货位锁定
|
//todo 终点货位锁定
|
||||||
|
|
||||||
|
|
||||||
//任务分组
|
//任务分组
|
||||||
taskService.update(new LambdaUpdateWrapper<SchBaseTask>()
|
taskService.update(new LambdaUpdateWrapper<SchBaseTask>()
|
||||||
.set(SchBaseTask::getGroup_code, pdaFormOutMst.getSite_code() + "_" + IdUtil.getStringId() + "_" + jsonArray.size()).
|
.set(SchBaseTask::getGroup_code, pdaFormOutMst.getSite_code() + "_" + IdUtil.getStringId() + "_" + jsonArray.size()).
|
||||||
@@ -253,8 +251,6 @@ public class PdaIOService {
|
|||||||
throw new BadRequestException("输入的站点编号有误或被禁用,请检查!");
|
throw new BadRequestException("输入的站点编号有误或被禁用,请检查!");
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(pointList.get(0).getVehicle_code())) {
|
if (StringUtils.isNotBlank(pointList.get(0).getVehicle_code())) {
|
||||||
//货架解绑
|
|
||||||
// iSchBasePointService.bindOrUnbind(param.getString("site_code"), pointList.get(0).getVehicle_code(), "0");
|
|
||||||
List<StIvtStructattr> stIvtStructattrList = iStIvtStructattrService.list(new LambdaQueryWrapper<StIvtStructattr>()
|
List<StIvtStructattr> stIvtStructattrList = iStIvtStructattrService.list(new LambdaQueryWrapper<StIvtStructattr>()
|
||||||
.eq(StIvtStructattr::getSect_code, pointList.get(0).getVehicle_code())
|
.eq(StIvtStructattr::getSect_code, pointList.get(0).getVehicle_code())
|
||||||
.isNotNull(StIvtStructattr::getVehicle_code));
|
.isNotNull(StIvtStructattr::getVehicle_code));
|
||||||
@@ -265,6 +261,7 @@ public class PdaIOService {
|
|||||||
iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
iMdPbVehicleMaterService.update(new UpdateWrapper<MdPbVehicleMater>()
|
||||||
.set("frozen_qty",0)
|
.set("frozen_qty",0)
|
||||||
.set("qty",0)
|
.set("qty",0)
|
||||||
|
.set("is_delete",true)
|
||||||
.set("remark","该料箱的物料已从产线取走")
|
.set("remark","该料箱的物料已从产线取走")
|
||||||
.in("vehicle_code",vehicleCodeList));
|
.in("vehicle_code",vehicleCodeList));
|
||||||
//清除货架库位
|
//清除货架库位
|
||||||
@@ -278,6 +275,7 @@ public class PdaIOService {
|
|||||||
//标记为空架
|
//标记为空架
|
||||||
iSchBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
|
iSchBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
|
||||||
.set(SchBasePoint::getPoint_type, 0)
|
.set(SchBasePoint::getPoint_type, 0)
|
||||||
|
.set(SchBasePoint::getLock_type, StatusEnum.LOCK.code("无锁"))
|
||||||
.eq(SchBasePoint::getCode, pointList.get(0).getCode()));
|
.eq(SchBasePoint::getCode, pointList.get(0).getCode()));
|
||||||
//生成补空架任务
|
//生成补空架任务
|
||||||
applyShelfScheduleService.taskPublish(param.getString("site_code"), null, pointList.get(0).getVehicle_code(), false);
|
applyShelfScheduleService.taskPublish(param.getString("site_code"), null, pointList.get(0).getVehicle_code(), false);
|
||||||
@@ -541,7 +539,7 @@ public class PdaIOService {
|
|||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(result.getMaterial_id())) {
|
if (StringUtils.isNotBlank(result.getMaterial_id())) {
|
||||||
List<MdMeMaterialbase> materialbaseList = mdMeMaterialbaseServiceImpl.list(new LambdaQueryWrapper<MdMeMaterialbase>().eq(MdMeMaterialbase::getMaterial_id, result.getMaterial_id()));
|
List<MdMeMaterialbase> materialbaseList = mdMeMaterialbaseServiceImpl.list(new LambdaQueryWrapper<MdMeMaterialbase>().eq(MdMeMaterialbase::getMaterial_id, result.getMaterial_id()));
|
||||||
//本地存在改物料信息
|
//本地存在该物料信息
|
||||||
if (ObjectUtils.isNotEmpty(materialbaseList)) {
|
if (ObjectUtils.isNotEmpty(materialbaseList)) {
|
||||||
result.setMaterial_code(materialbaseList.get(0).getMaterial_code());
|
result.setMaterial_code(materialbaseList.get(0).getMaterial_code());
|
||||||
result.setMaterial_spec(materialbaseList.get(0).getMaterial_spec());
|
result.setMaterial_spec(materialbaseList.get(0).getMaterial_spec());
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.nl.wms.system_manage.service.quartz.task;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
@@ -9,6 +10,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.nl.common.enums.StatusEnum;
|
import org.nl.common.enums.StatusEnum;
|
||||||
import org.nl.common.utils.BaseCode;
|
import org.nl.common.utils.BaseCode;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.config.lucene.LuceneAppender;
|
import org.nl.config.lucene.LuceneAppender;
|
||||||
import org.nl.wms.dispatch_manage.point.service.ISchBasePointService;
|
import org.nl.wms.dispatch_manage.point.service.ISchBasePointService;
|
||||||
import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||||
@@ -76,7 +78,7 @@ public class ApplyShelfScheduleService {
|
|||||||
if (isAuto) {
|
if (isAuto) {
|
||||||
List<SchBasePoint> cxPointLists = iSchBasePointService.checkEndPointTask(
|
List<SchBasePoint> cxPointLists = iSchBasePointService.checkEndPointTask(
|
||||||
StatusEnum.REGION_INFO.code("二楼AGV产线对接位"),
|
StatusEnum.REGION_INFO.code("二楼AGV产线对接位"),
|
||||||
StatusEnum.LOCK.code("出库锁"),
|
StatusEnum.LOCK.code("无锁"),
|
||||||
StatusEnum.SORT_TYPE.code("升序"), "0");
|
StatusEnum.SORT_TYPE.code("升序"), "0");
|
||||||
if (ObjectUtils.isNotEmpty(cxPointLists)) {
|
if (ObjectUtils.isNotEmpty(cxPointLists)) {
|
||||||
startPointCode = cxPointLists.get(0).getCode();
|
startPointCode = cxPointLists.get(0).getCode();
|
||||||
@@ -103,6 +105,12 @@ public class ApplyShelfScheduleService {
|
|||||||
task.put("pointCode2", endPointCode);
|
task.put("pointCode2", endPointCode);
|
||||||
task.put("vehicleCode", vehicleCode);
|
task.put("vehicleCode", vehicleCode);
|
||||||
secondFloorEmptyShelfTask.createTask(task);
|
secondFloorEmptyShelfTask.createTask(task);
|
||||||
|
//起点锁定
|
||||||
|
iSchBasePointService.update(new LambdaUpdateWrapper<SchBasePoint>()
|
||||||
|
.set(SchBasePoint::getLock_type, StatusEnum.LOCK.code("出库锁"))
|
||||||
|
.set(SchBasePoint::getUpdate_time, DateUtil.now())
|
||||||
|
.set(SchBasePoint::getUpdate_name, SecurityUtils.getCurrentNickName())
|
||||||
|
.eq(SchBasePoint::getCode, startPointCode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|||||||
@@ -259,9 +259,9 @@ public class SyncErpBillsScheduleService {
|
|||||||
final String mainId = mainBill.get(0).getId();
|
final String mainId = mainBill.get(0).getId();
|
||||||
//仓库Key
|
//仓库Key
|
||||||
final String stockId = BILL_STOCK_ID_MAPPING.get(formType);
|
final String stockId = BILL_STOCK_ID_MAPPING.get(formType);
|
||||||
//除了合格证相关单据,其他都过滤非立库仓库组织
|
//todo
|
||||||
// if (!"PRD_MO".equals(formType) && !"PUR_ReceiveBill".equals(formType)) {
|
//除了合格证相关单据,其他都过滤非立库仓库组织,最新:暂时先过滤用料清单,再视现场情况
|
||||||
if (false) {
|
if ("PRD_PPBOM".equals(formType)) {
|
||||||
//明细单据
|
//明细单据
|
||||||
List<PmFormData> detailBills = formDataList.stream()
|
List<PmFormData> detailBills = formDataList.stream()
|
||||||
.filter(rs -> StringUtils.isBlank(rs.getCode()))
|
.filter(rs -> StringUtils.isBlank(rs.getCode()))
|
||||||
|
|||||||
@@ -10,11 +10,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
import org.nl.common.enums.StatusEnum;
|
import org.nl.common.enums.StatusEnum;
|
||||||
import org.nl.common.utils.BaseCode;
|
import org.nl.common.utils.BaseCode;
|
||||||
import org.nl.common.utils.IdUtil;
|
import org.nl.common.utils.IdUtil;
|
||||||
import org.nl.config.lucene.LuceneAppender;
|
import org.nl.config.lucene.LuceneAppender;
|
||||||
|
import org.nl.wms.dispatch_manage.point.service.ISchBasePointService;
|
||||||
|
import org.nl.wms.dispatch_manage.point.service.dao.SchBasePoint;
|
||||||
import org.nl.wms.dispatch_manage.task.handler.impl.SecondFloorAgvTransferTask;
|
import org.nl.wms.dispatch_manage.task.handler.impl.SecondFloorAgvTransferTask;
|
||||||
import org.nl.wms.dispatch_manage.task.service.ISchBaseTaskService;
|
import org.nl.wms.dispatch_manage.task.service.ISchBaseTaskService;
|
||||||
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
import org.nl.wms.dispatch_manage.task.service.dao.SchBaseTask;
|
||||||
@@ -46,6 +49,8 @@ public class TaskScheduleService {
|
|||||||
private WmsToAcsService wmsToAcsService;
|
private WmsToAcsService wmsToAcsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SecondFloorAgvTransferTask secondFloorAgvTransferTask;
|
private SecondFloorAgvTransferTask secondFloorAgvTransferTask;
|
||||||
|
@Autowired
|
||||||
|
private ISchBasePointService iSchBasePointService;
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
@@ -100,10 +105,17 @@ public class TaskScheduleService {
|
|||||||
//任务组任务全部完成
|
//任务组任务全部完成
|
||||||
if (targetSize == t.size()) {
|
if (targetSize == t.size()) {
|
||||||
//创建agv任务
|
//创建agv任务
|
||||||
|
// 终点满足条件
|
||||||
|
List<SchBasePoint> endPointList = iSchBasePointService.list(new LambdaQueryWrapper<SchBasePoint>()
|
||||||
|
.eq(SchBasePoint::getLock_type, StatusEnum.LOCK.code("无锁"))
|
||||||
|
.eq(SchBasePoint::getCode, targetCode));
|
||||||
|
if (ObjectUtils.isEmpty(endPointList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
JSONObject taskJsonObject = new JSONObject();
|
JSONObject taskJsonObject = new JSONObject();
|
||||||
taskJsonObject.put("pointCode1", t.get(0).getPoint_code2());
|
taskJsonObject.put("pointCode1", t.get(0).getPoint_code3());
|
||||||
taskJsonObject.put("pointCode2", targetCode);
|
taskJsonObject.put("pointCode2", targetCode);
|
||||||
taskJsonObject.put("pointCode3", t.get(0).getPoint_code3().substring(0, t.get(0).getPoint_code3().indexOf("-")));
|
taskJsonObject.put("pointCode3", t.get(0).getPoint_code2().substring(0, t.get(0).getPoint_code2().indexOf("-")));
|
||||||
taskJsonObject.put("group_code", g);
|
taskJsonObject.put("group_code", g);
|
||||||
taskJsonObject.put("vehicleCode", t.stream().map(SchBaseTask::getVehicle_code).collect(Collectors.joining(",")));
|
taskJsonObject.put("vehicleCode", t.stream().map(SchBaseTask::getVehicle_code).collect(Collectors.joining(",")));
|
||||||
secondFloorAgvTransferTask.createTask(taskJsonObject);
|
secondFloorAgvTransferTask.createTask(taskJsonObject);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ spring:
|
|||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
# url: jdbc:mysql://${DB_HOST:192.168.8.218}:${DB_PORT:3306}/${DB_NAME:wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
# url: jdbc:mysql://${DB_HOST:192.168.8.218}:${DB_PORT:3306}/${DB_NAME:wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||||
url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:wms_hs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
url: jdbc:mysql://${DB_HOST:192.168.18.218}:${DB_PORT:3306}/${DB_NAME:wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:123456}
|
password: ${DB_PWD:123456}
|
||||||
|
|
||||||
@@ -156,9 +156,9 @@ lucene:
|
|||||||
index:
|
index:
|
||||||
path: D:\lms\lucene\index
|
path: D:\lms\lucene\index
|
||||||
kdapi:
|
kdapi:
|
||||||
appId: 295539_RY4pS/CH0vl8TfUo652sR+1KULwdQNOG111
|
appId: 295539_RY4pS/CH0vl8TfUo652sR+1KULwdQNOG
|
||||||
appSecret: 0d47d08ee5014643b91a764e121e0bcb111
|
appSecret: 0d47d08ee5014643b91a764e121e0bcb
|
||||||
userName: 管理员
|
userName: 管理员
|
||||||
pwd: ty.870163621111
|
pwd: ty.87016362
|
||||||
serverUrl: http://192.168.16.249/k3cloud/1
|
serverUrl: http://192.168.16.249/k3cloud/
|
||||||
dCID: 65b078e7ea0ce6
|
dCID: 65b078e7ea0ce6
|
||||||
|
|||||||
@@ -166,7 +166,6 @@
|
|||||||
<springProfile name="prod">
|
<springProfile name="prod">
|
||||||
<root level="info">
|
<root level="info">
|
||||||
<appender-ref ref="asyncLuceneAppender"/>
|
<appender-ref ref="asyncLuceneAppender"/>
|
||||||
<appender-ref ref="CONSOLE"/>
|
|
||||||
</root>
|
</root>
|
||||||
<logger name="jdbc" level="ERROR" additivity="true">
|
<logger name="jdbc" level="ERROR" additivity="true">
|
||||||
<appender-ref ref="asyncFileAppender"/>
|
<appender-ref ref="asyncFileAppender"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user