Browse Source

调用记录提示

master
常熟吴彦祖 2 months ago
parent
commit
6daee996ef
  1. 2
      src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/AutoTaskServiceImpl.java
  2. 48
      src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java
  3. 17
      src/main/java/com/gaotao/modules/warehouse/entity/Pallet.java
  4. 9
      src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml

2
src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/AutoTaskServiceImpl.java

@ -378,7 +378,7 @@ public class AutoTaskServiceImpl implements AutoTaskService {
throw new RuntimeException("栈板不存在:" + inData.getPalletId());
}
if(!"N".equals(pallet.getCallingFlag())){
throw new RuntimeException("栈板状态异常:栈板正在被调用中,无法创建新任务");
throw new RuntimeException("栈板状态异常:栈板正在被调用中,最近一次调用备注:"+pallet.getRemark());
}
// 验证栈板是否已有未完成任务更严格的检查- rqrq

48
src/main/java/com/gaotao/modules/automatedWarehouse/service/impl/WcsIntegrationServiceImpl.java

@ -229,9 +229,9 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
String palletId = item.getPalletId();
// 1. 检查栈板是否正在被调用 - rqrq
String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(item.getSite(), palletId);
if ("Y".equals(callingFlag)) {
throw new RuntimeException("栈板正在被调用中");
com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(item.getSite(), palletId);
if (pallet != null && "Y".equals(pallet.getCallingFlag())) {
throw new RuntimeException("栈板正在被调用中,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无"));
}
// 2. 生成任务编号 - rqrq
@ -322,7 +322,8 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
String callingFlag = (String) palletInfo.get("calling_flag");
if ("Y".equals(callingFlag)) {
// if ("Y".equals(callingFlag)&&!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletInfo.get("locationCode"))) {
throw new RuntimeException("栈板正在被调用中,无法进行打托操作");
String remark = (String) palletInfo.get("remark");
throw new RuntimeException("栈板正在被调用中,无法进行打托操作,最近一次调用备注:" + (remark != null ? remark : "无"));
}
// 获取栈板类型的位置信息
@ -423,11 +424,10 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
throw new Exception("参数不能为空");
}
Map<String, Object> palletData = wcsIntegrationMapper.getPalletInfo(site, palletId);
// 检查栈板是否正在被调用
String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId);
// if ("Y".equals(callingFlag)&&!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletData.get("locationCode"))) {
if ("Y".equals(callingFlag)) {
throw new Exception("栈板正在被调用中,无法进行打托操作");
// 检查栈板是否正在被调用 - rqrq
com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(site, palletId);
if (pallet != null && "Y".equals(pallet.getCallingFlag())) {
throw new Exception("栈板正在被调用中,无法进行打托操作,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无"));
}
// 1. 验证标签
@ -544,11 +544,10 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
}
Map<String, Object> palletData = wcsIntegrationMapper.getPalletInfo(site, palletId);
// 检查栈板是否正在被调用
String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId);
// if ("Y".equals(callingFlag)&&!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletData.get("locationCode"))) {
if ("Y".equals(callingFlag)) {
throw new Exception("栈板正在被调用中,无法进行扫出操作");
// 检查栈板是否正在被调用 - rqrq
com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(site, palletId);
if (pallet != null && "Y".equals(pallet.getCallingFlag())) {
throw new Exception("栈板正在被调用中,无法进行扫出操作,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无"));
}
// 检查标签是否在本栈板中
@ -594,9 +593,9 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
", position=" + data.getOriginalPosition() + ", layer=" + data.getOriginalLayer() + ", wcsFlag=" + data.getWcsFlag());
// 检查原栈板是否正在被调用 - rqrq
String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(data.getSite(), data.getOriginalPalletId());
if ("Y".equals(callingFlag)) {
throw new Exception("原栈板正在被调用中,无法恢复标签");
com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(data.getSite(), data.getOriginalPalletId());
if (pallet != null && "Y".equals(pallet.getCallingFlag())) {
throw new Exception("原栈板正在被调用中,无法恢复标签,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无"));
}
// 执行恢复操作先删除当前记录再插入到原栈板- rqrq
@ -716,11 +715,10 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
}
Map<String, Object> palletData = wcsIntegrationMapper.getPalletInfo(site, palletId);
// 检查栈板是否正在被调用
String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId);
//if ("Y".equals(callingFlag)&&!BufferZoneConfig.BUFFER_Station_ID.getValue().equals(palletData.get("locationCode"))) {
if ("Y".equals(callingFlag)) {
throw new Exception("栈板正在被调用中,无法进行位置调整");
// 检查栈板是否正在被调用 - rqrq
com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(site, palletId);
if (pallet != null && "Y".equals(pallet.getCallingFlag())) {
throw new Exception("栈板正在被调用中,无法进行位置调整,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无"));
}
// 验证标签是否在当前栈板中
@ -820,9 +818,9 @@ public class WcsIntegrationServiceImpl implements WcsIntegrationService {
String username = ((SysUserEntity) SecurityUtils.getSubject().getPrincipal()).getUsername();
// 检查栈板calling_flag状态 - rqrq
String callingFlag = wcsIntegrationMapper.checkPalletCallingFlag(site, palletId);
if ("Y".equals(callingFlag)) {
throw new Exception("栈板正在被调用中,无法创建运输任务");
com.gaotao.modules.warehouse.entity.Pallet pallet = wcsIntegrationMapper.getPalletByCode(site, palletId);
if (pallet != null && "Y".equals(pallet.getCallingFlag())) {
throw new Exception("栈板正在被调用中,无法创建运输任务,最近一次调用备注:" + (pallet.getRemark() != null ? pallet.getRemark() : "无"));
}
// 使用统一的运输任务调度方法 - rqrq

17
src/main/java/com/gaotao/modules/warehouse/entity/Pallet.java

@ -73,7 +73,22 @@ public class Pallet {
private String locationCode;
/**
* 备注信息
* 备注信息 - rqrq
* <p><b>用途记录最近一次栈板调用情况</b></p>
* <p>当calling_flag='Y'此字段记录调用的业务信息格式示例</p>
* <ul>
* <li>领料申请单工厂1 领料申请单IN001 订单号SO001</li>
* <li>任务类型立库取货 任务单号WOT001 物料RM001</li>
* </ul>
* <p><b>系统维护逻辑</b></p>
* <pre>
* // 场景1领料申请单调用时更新 - rqrq
* String remark = "领料申请单:工厂:" + site + " 领料申请单" + notifyNo + " 订单号" + productionOrderNo;
* mapper.updatePalletCallingFlag(site, palletIds, remark);
*
* // 场景2WCS调用时可选更新 - rqrq
* mapper.updatePalletCallingFlag(site, palletId, "Y", remark, updatedBy);
* </pre>
*/
private String remark;

9
src/main/resources/mapper/automatedWarehouse/WcsIntegrationMapper.xml

@ -130,7 +130,14 @@
<!-- 检查栈板是否存在并获取栈板信息 - AI制作/rqrq -->
<select id="getPalletInfo" resultType="java.util.Map">
SELECT pallet_id, pallet_type, status, location_code, site, calling_flag
SELECT
pallet_id,
pallet_type,
status,
location_code,
site,
calling_flag,
remark
FROM pallet WITH (NOLOCK)
WHERE site = #{site} AND pallet_id = #{palletId} AND is_deleted = '0'
</select>

Loading…
Cancel
Save