|
|
|
@ -1205,6 +1205,14 @@ public class PhysicalInventoryServiceImpl extends ServiceImpl<PhysicalInventoryM |
|
|
|
log.info("handleCountRfidCallback 开始,site: {}, countNo: {}, palletId: {}, taskNo: {}, resultCode: {}, resultMsg: {}", |
|
|
|
site, countNo, palletId, taskNo, resultCode, resultMsg); |
|
|
|
|
|
|
|
// 0. 检查单据状态是否为盘点中,如果不是则直接返回成功不做业务 - rqrq |
|
|
|
CountHeaderData countHeader = getCountHeaderByNo(site, countNo); |
|
|
|
if (countHeader == null || !CountHeader.STATUS_CHECKING.equals(countHeader.getStatus())) { |
|
|
|
log.info("盘点单状态不是盘点中,直接返回成功不做业务,countNo: {}, status: {}", |
|
|
|
countNo, countHeader != null ? countHeader.getStatus() : "null"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 1. 从pallet_detail查询当前栈板的所有标签 - rqrq |
|
|
|
List<CountLabelData> palletLabels = baseMapper.getPalletDetailByPalletId(site, palletId); |
|
|
|
log.info("栈板标签数量: {}", palletLabels.size()); |
|
|
|
@ -1624,6 +1632,14 @@ public class PhysicalInventoryServiceImpl extends ServiceImpl<PhysicalInventoryM |
|
|
|
public int pdaQuickSubmitCount(String site, String countNo, String palletId, String username) { |
|
|
|
log.info("pdaQuickSubmitCount 开始,site: {}, countNo: {}, palletId: {}", site, countNo, palletId); |
|
|
|
|
|
|
|
// 0. 检查单据状态是否为盘点中,如果不是PDA直接报错 - rqrq |
|
|
|
CountHeaderData countHeader = getCountHeaderByNo(site, countNo); |
|
|
|
if (countHeader == null || !CountHeader.STATUS_CHECKING.equals(countHeader.getStatus())) { |
|
|
|
log.error("盘点单状态不是盘点中,无法提交盘点结果,countNo: {}, status: {}", |
|
|
|
countNo, countHeader != null ? countHeader.getStatus() : "null"); |
|
|
|
throw new RuntimeException("盘点单状态不是盘点中,无法提交盘点结果"); |
|
|
|
} |
|
|
|
|
|
|
|
// 1. 查询栈板的盘点标签明细 - rqrq |
|
|
|
List<CountLabelData> labelList = baseMapper.getCountLabelsByPalletId(site, countNo, palletId); |
|
|
|
if (labelList.isEmpty()) { |
|
|
|
@ -1686,6 +1702,14 @@ public class PhysicalInventoryServiceImpl extends ServiceImpl<PhysicalInventoryM |
|
|
|
log.info("pdaSubmitCount 开始,site: {}, countNo: {}, palletId: {}, 扫描标签数: {}", |
|
|
|
site, countNo, palletId, scannedLabels != null ? scannedLabels.size() : 0); |
|
|
|
|
|
|
|
// 0. 检查单据状态是否为盘点中,如果不是PDA直接报错 - rqrq |
|
|
|
CountHeaderData countHeader = getCountHeaderByNo(site, countNo); |
|
|
|
if (countHeader == null || !CountHeader.STATUS_CHECKING.equals(countHeader.getStatus())) { |
|
|
|
log.error("盘点单状态不是盘点中,无法提交盘点结果,countNo: {}, status: {}", |
|
|
|
countNo, countHeader != null ? countHeader.getStatus() : "null"); |
|
|
|
throw new RuntimeException("盘点单状态不是盘点中,无法提交盘点结果"); |
|
|
|
} |
|
|
|
|
|
|
|
// 1. 查询栈板的盘点标签明细 - rqrq |
|
|
|
List<CountLabelData> labelList = baseMapper.getCountLabelsByPalletId(site, countNo, palletId); |
|
|
|
if (labelList.isEmpty()) { |
|
|
|
@ -1796,6 +1820,54 @@ public class PhysicalInventoryServiceImpl extends ServiceImpl<PhysicalInventoryM |
|
|
|
return labelList.size(); |
|
|
|
} |
|
|
|
|
|
|
|
// ==================== 异常处理 ==================== - rqrq |
|
|
|
|
|
|
|
@Override |
|
|
|
public java.util.List<CountResultData> searchUnhandledExceptionList(CountResultData query) { |
|
|
|
System.out.println("searchUnhandledExceptionList 开始"); |
|
|
|
System.out.println("参数:site=" + query.getSite() + ", countNo=" + query.getCountNo()); |
|
|
|
|
|
|
|
java.util.List<CountResultData> result = baseMapper.searchUnhandledExceptionList(query); |
|
|
|
|
|
|
|
System.out.println("searchUnhandledExceptionList 结束,结果数量: " + (result != null ? result.size() : 0)); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public int saveExceptionHandle(String site, String countNo, String username, |
|
|
|
java.util.List<java.util.Map<String, Object>> exceptionList) { |
|
|
|
System.out.println("saveExceptionHandle 开始"); |
|
|
|
System.out.println("参数:site=" + site + ", countNo=" + countNo + ", username=" + username); |
|
|
|
|
|
|
|
if (exceptionList == null || exceptionList.isEmpty()) { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
int updateCount = 0; |
|
|
|
for (java.util.Map<String, Object> item : exceptionList) { |
|
|
|
Long id = null; |
|
|
|
Object idObj = item.get("id"); |
|
|
|
if (idObj instanceof Number) { |
|
|
|
id = ((Number) idObj).longValue(); |
|
|
|
} else if (idObj instanceof String) { |
|
|
|
id = Long.parseLong((String) idObj); |
|
|
|
} |
|
|
|
|
|
|
|
String unitId = (String) item.get("unitId"); |
|
|
|
String palletId = (String) item.get("palletId"); |
|
|
|
String handleType = (String) item.get("handleType"); |
|
|
|
|
|
|
|
// 更新处理标记和处理方式 - rqrq |
|
|
|
int updated = baseMapper.updateCountResultHandleFlag(id, site, countNo, unitId, palletId, |
|
|
|
CountResult.HANDLE_FLAG_YES, handleType, username); |
|
|
|
updateCount += updated; |
|
|
|
} |
|
|
|
|
|
|
|
System.out.println("saveExceptionHandle 结束,更新数量: " + updateCount); |
|
|
|
return updateCount; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 盘点完成后处理任务单(与RFID接口逻辑一致)- rqrq |
|
|
|
* |
|
|
|
|