Browse Source

采购合格入库

master
han\hanst 7 months ago
parent
commit
c3d03529ae
  1. 30
      src/main/java/com/gaotao/modules/api/entity/issueAndReturnVo/PurchaseOrderReceiptVo.java
  2. 2
      src/main/java/com/gaotao/modules/api/service/impl/IfsApiIssueAndReturnServiceImpl.java
  3. 8
      src/main/java/com/gaotao/modules/inspection/controller/QualifiedStorageController.java
  4. 11
      src/main/java/com/gaotao/modules/inspection/service/QualifiedStorageService.java
  5. 41
      src/main/java/com/gaotao/modules/inspection/service/impl/QualifiedStorageServiceImpl.java

30
src/main/java/com/gaotao/modules/api/entity/issueAndReturnVo/PurchaseOrderReceiptVo.java

@ -35,4 +35,34 @@ public class PurchaseOrderReceiptVo {
private String senderName;
private String senderType;
private Long receiptSequence;
/**
* 库位编号
*/
private String locationNo;
/**
* 批次号
*/
private String lotBatchNo;
/**
* WDR单号
*/
private String wdrNo;
/**
* 工程变更等级
*/
private String engChgLevel;
/**
* 配置ID
*/
private String configurationID;
/**
* 序列号
*/
private String serialNo;
}

2
src/main/java/com/gaotao/modules/api/service/impl/IfsApiIssueAndReturnServiceImpl.java

@ -720,7 +720,7 @@ public class IfsApiIssueAndReturnServiceImpl implements IfsApiIssueAndReturnServ
ObjectMapper objectMapper = new ObjectMapper();
String jsonBody = objectMapper.writeValueAsString(params);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "PurchaseOrderReceipt", jsonBody, null);
String ifsResponse = HttpUtils.doGetWithBody(ifsUrl + "PurchaseOrderReceiptLocation", jsonBody, null);
return objectMapper.readValue(ifsResponse, new TypeReference<List<PurchaseOrderReceiptVo>>() {});
} catch (Exception e) {
log.error("获取采购订单接收记录失败: {}", e.getMessage());

8
src/main/java/com/gaotao/modules/inspection/controller/QualifiedStorageController.java

@ -42,8 +42,14 @@ public class QualifiedStorageController {
String site = (String) params.get("site");
String expectedPartNo = (String) params.get("expectedPartNo");
String expectedBatchNo = (String) params.get("expectedBatchNo");
String expectedLocationNo = (String) params.get("expectedLocationNo");
String expectedLotBatchNo = (String) params.get("expectedLotBatchNo");
String expectedWdrNo = (String) params.get("expectedWdrNo");
return qualifiedStorageService.validateHandlingUnitForQualifiedStorage(unitId, site, expectedPartNo, expectedBatchNo);
return qualifiedStorageService.validateHandlingUnitForQualifiedStorage(
unitId, site, expectedPartNo, expectedBatchNo,
expectedLocationNo, expectedLotBatchNo, expectedWdrNo
);
} catch (Exception e) {
return R.error("HandlingUnit校验失败: " + e.getMessage());
}

11
src/main/java/com/gaotao/modules/inspection/service/QualifiedStorageService.java

@ -16,8 +16,17 @@ public interface QualifiedStorageService {
/**
* 校验并获取HandlingUnit信息用于检验合格入库
*
* @param unitId HandlingUnit编码
* @param site 站点
* @param expectedPartNo 期望物料编码
* @param expectedBatchNo 期望批次号
* @param expectedLocationNo 期望库位编号
* @param expectedLotBatchNo 期望Lot批次号
* @param expectedWdrNo 期望WDR单号
*/
R validateHandlingUnitForQualifiedStorage(String unitId, String site, String expectedPartNo, String expectedBatchNo);
R validateHandlingUnitForQualifiedStorage(String unitId, String site, String expectedPartNo, String expectedBatchNo,
String expectedLocationNo, String expectedLotBatchNo, String expectedWdrNo);
/**
* 确认检验合格入库

41
src/main/java/com/gaotao/modules/inspection/service/impl/QualifiedStorageServiceImpl.java

@ -126,7 +126,8 @@ public class QualifiedStorageServiceImpl implements QualifiedStorageService {
}
@Override
public R validateHandlingUnitForQualifiedStorage(String unitId, String site, String expectedPartNo, String expectedBatchNo) {
public R validateHandlingUnitForQualifiedStorage(String unitId, String site, String expectedPartNo, String expectedBatchNo,
String expectedLocationNo, String expectedLotBatchNo, String expectedWdrNo) {
try {
// 1. 基础参数校验
if (StringUtils.isBlank(unitId)) {
@ -166,11 +167,39 @@ public class QualifiedStorageServiceImpl implements QualifiedStorageService {
}
}
// 7. 在库状态校验检验合格入库通常要求HU已经在库
// 6. 库位编号匹配校验
if (StringUtils.isNotBlank(expectedLocationNo)) {
String actualLocationNo = handlingUnit.getLocationId();
if (!expectedLocationNo.equals(actualLocationNo)) {
return R.error("HandlingUnit库位不匹配,期望: " + expectedLocationNo + ",实际: " + actualLocationNo);
}
}
// 7. Lot批次号匹配校验
if (StringUtils.isNotBlank(expectedLotBatchNo)) {
String actualLotBatchNo = handlingUnit.getBatchNo();
if (!expectedLotBatchNo.equals(actualLotBatchNo)) {
return R.error("HandlingUnit Lot批次号不匹配,期望: " + expectedLotBatchNo + ",实际: " + actualLotBatchNo);
}
}
// 8. WDR单号匹配校验
if (StringUtils.isNotBlank(expectedWdrNo)) {
String actualWdrNo = handlingUnit.getWdr();
if (actualWdrNo == null || actualWdrNo.isEmpty() || "*".equals(actualWdrNo)) {
return R.error("HandlingUnit WDR单号为空或默认值");
}
if (!expectedWdrNo.equals(actualWdrNo)) {
return R.error("HandlingUnit WDR单号不匹配,期望: " + expectedWdrNo + ",实际: " + actualWdrNo);
}
}
// 9. 在库状态校验检验合格入库通常要求HU已经在库
if (!"X".equals(handlingUnit.getInStockFlag())) {
return R.error("HandlingUnit不是未入库状态,无法进行检验合格入库");
}
// 8. 返回HandlingUnit信息
// 10. 返回HandlingUnit信息
Map<String, Object> huInfo = Map.ofEntries(
Map.entry("unitId", handlingUnit.getUnitId()),
Map.entry("partNo", handlingUnit.getPartNo()),
@ -213,6 +242,10 @@ public class QualifiedStorageServiceImpl implements QualifiedStorageService {
String wdr = (String) params.get("wdr");
String toLocationNo = (String) params.get("toLocationNo");
BigDecimal qtyToMove = new BigDecimal(params.get("qtyToMove").toString());
// 获取engChgLevel参数如果没有则默认为"1"
String engChgLevel = params.get("engChgLevel") != null ?
params.get("engChgLevel").toString() : "1";
@SuppressWarnings("unchecked")
List<String> handlingUnitIds = (List<String>) params.get("handlingUnitIds");
@ -351,7 +384,7 @@ public class QualifiedStorageServiceImpl implements QualifiedStorageService {
moveDto.setIfsLotBatchNo(lotBatchNo);
moveDto.setIfsNewLotBatchNo(lotBatchNo);
moveDto.setIfsSerialNo("*");
moveDto.setIfsEngChgLevel("1");
moveDto.setIfsEngChgLevel(engChgLevel); // 从IFS接口返回数据中获取
moveDto.setIfsWDR(wdr);
moveDto.setIfsToLocationNo(toLocationNo);
moveDto.setIfsHandlingUnitID(0);

Loading…
Cancel
Save