opt: 修复2

This commit is contained in:
2025-10-30 15:09:09 +08:00
parent 877b56e24b
commit 0118aed6ab
3 changed files with 21 additions and 15 deletions

View File

@@ -36,6 +36,7 @@ import org.nl.wms.sch_manage.service.ISchBaseTaskService;
import org.nl.wms.sch_manage.service.dao.SchBasePoint;
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
import org.nl.wms.sch_manage.service.util.TaskFactory;
import org.nl.wms.system_manage.enums.TagNameEnum;
import org.nl.wms.system_manage.service.dict.ISysDictService;
import org.nl.wms.system_manage.service.dict.dao.Dict;
import org.nl.wms.warehouse_manage.enums.IOSConstant;
@@ -48,6 +49,7 @@ import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -135,6 +137,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
@SneakyThrows
@Transactional(rollbackFor = Exception.class)
public MesResponse callMaterial(MesCallMaterialRequestDto dto) {
MDC.put(TagNameEnum.TAG_NAME.getTag(), TagNameEnum.MES_CALL_MATERIAL.getTag());
log.info("MES下发设备叫料信息输入参数-------------------: {}", dto);
if (dto.getIsManual() != null && dto.getIsManual()) {
@@ -155,12 +158,12 @@ public class MesToWmsServiceImpl implements MesToWmsService {
try {
if (tryLock) {
String pointCode = dto.getDevice_code();
SchBasePoint outPoint = pointService.getPointByExtCode(dto.getDevice_code());
String deviceCode = dto.getDevice_code();
SchBasePoint outPoint = pointService.getPointByExtCode(deviceCode);
if (null == outPoint) {
throw new BadRequestException("设备【" + pointCode + "】不存在!");
throw new BadRequestException("设备【" + deviceCode + "】不存在!");
}
String pointCode = outPoint.getPoint_code();
if (!"1".equals(outPoint.getPoint_type())) {
throw new BadRequestException("设备【" + groupPlate.getStruct_code() + "】有误,请传入作业区设备!");
}
@@ -336,7 +339,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
.and(wp -> wp
.eq(SchBaseTask::getPoint_code1, groupPlate.getStruct_code())
.or()
.eq(SchBaseTask::getPoint_code2, dto.getDevice_code())
.eq(SchBaseTask::getPoint_code2, pointCode)
.or()
.eq(SchBaseTask::getPoint_code3, sonSchBasePointList.get(0).getPoint_code())
.or()
@@ -417,7 +420,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
taskParam.put("iostorinv_id", invId);
taskParam.put("point_code", groupPlate.getStruct_code());
taskParam.put("point_code2", sonSchBasePointList.get(0).getPoint_code());
taskParam.put("point_code3", dto.getDevice_code());
taskParam.put("point_code3", pointCode);
taskParam.put("point_code4", sonSchBasePointList.get(1).getPoint_code());
taskParam.put("group_id", groupPlate.getGroup_id());
taskParam.put("task_code", dto.getTask_code());
@@ -443,6 +446,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
@Override
@SneakyThrows
public MesResponse backMaterial(MesBackMaterialRequestDto dto) {
MDC.put(TagNameEnum.TAG_NAME.getTag(), TagNameEnum.MES_BACK_MATERIAL.getTag());
log.info("MES下发设备退料信息输入参数-------------------: {}", dto);
if (dto.getIsManual() != null && dto.getIsManual()) {
@@ -468,7 +472,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
if (ObjectUtil.isEmpty(point)) {
throw new BadRequestException("设备" + dto.getDevice_code() + "不存在,轻检验编码与LMS是否一致");
}
String pointCode = point.getPoint_code();
//根据料桶号去载具表匹配料桶类型
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = iMdPbStoragevehicleinfoService.getByCode(point.getVehicle_code());
@@ -515,7 +519,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
param.put("sect_id", sectattr.getSect_id());
param.put("vehicle_code", point.getVehicle_code());
param.put("storagevehicle_code", param.getString("vehicle_code"));
param.put("site_code", dto.getDevice_code());
param.put("site_code", pointCode);
param.put("material_id", materDao.getMaterial_code());
param.put("material_code", materDao.getMaterial_code());
param.put("pcsn", groupPlate.getPcsn());
@@ -530,7 +534,7 @@ public class MesToWmsServiceImpl implements MesToWmsService {
//退空桶
param.put("vehicle_code", point.getVehicle_code());
param.put("storagevehicle_code", param.getString("vehicle_code"));
param.put("site_code", dto.getDevice_code());
param.put("site_code", pointCode);
param.put("sect_id", sectattr.getSect_id());
param.put("sect_code", sectattr.getSect_code());
param.put("back_material_flag", true);

View File

@@ -32,6 +32,8 @@ public enum TagNameEnum {
*/
PDA_JB_BACK_MATERIAL("解包手持退料"),
TO_MES_MATERIAL("同步MES物料"),
MES_CALL_MATERIAL("MES请求叫料"),
MES_BACK_MATERIAL("MES请求退料"),
/**
* 标记符号
*/

View File

@@ -104,12 +104,12 @@ public class UpdateIvtUtils {
if (ObjectUtil.isEmpty(where.getString("pcsn"))) {
throw new BadRequestException("批次不能为空!");
}
if (ObjectUtil.isEmpty(where.getString("qty_unit_id"))) {
throw new BadRequestException("计量单位标识不能为空!");
}
if (ObjectUtil.isEmpty(where.getString("qty_unit_name"))) {
throw new BadRequestException("计量单位名称不能为空!");
}
// if (ObjectUtil.isEmpty(where.getString("qty_unit_id"))) {
// throw new BadRequestException("计量单位标识不能为空!");
// }
// if (ObjectUtil.isEmpty(where.getString("qty_unit_name"))) {
// throw new BadRequestException("计量单位名称不能为空!");
// }
if (ObjectUtil.isEmpty(where.getString("change_qty"))) {
throw new BadRequestException("变动数量不能为空!");
}