常熟吴彦祖 6 months ago
parent
commit
08107324c6
  1. 2
      src/main/java/com/gaotao/modules/api/entity/IfsCallErrorLog.java
  2. 2
      src/main/java/com/gaotao/modules/api/service/IfsCallErrorLogService.java
  3. 4
      src/main/java/com/gaotao/modules/api/service/impl/IfsCallErrorLogServiceImpl.java
  4. 15
      src/main/java/com/gaotao/modules/other/service/impl/InventoryMoveServiceImpl.java

2
src/main/java/com/gaotao/modules/api/entity/IfsCallErrorLog.java

@ -24,7 +24,7 @@ public class IfsCallErrorLog {
* 站点 * 站点
*/ */
private String site; private String site;
private String serialNos;
/** /**
* 接口名称 * 接口名称
*/ */

2
src/main/java/com/gaotao/modules/api/service/IfsCallErrorLogService.java

@ -36,7 +36,7 @@ public interface IfsCallErrorLogService extends IService<IfsCallErrorLog> {
String partNo, String lotBatchNo, String partNo, String lotBatchNo,
String sourceLocation, String destLocation, String sourceLocation, String destLocation,
BigDecimal qty, Date expiredDate, BigDecimal qty, Date expiredDate,
String requestData, String responseData, String errorMessage);
String requestData, String responseData, String errorMessage, String serialNos);
/** /**
* @Description 分页查询IFS错误日志 - rqrq * @Description 分页查询IFS错误日志 - rqrq

4
src/main/java/com/gaotao/modules/api/service/impl/IfsCallErrorLogServiceImpl.java

@ -56,7 +56,7 @@ public class IfsCallErrorLogServiceImpl extends ServiceImpl<IfsCallErrorLogMappe
String partNo, String lotBatchNo, String partNo, String lotBatchNo,
String sourceLocation, String destLocation, String sourceLocation, String destLocation,
BigDecimal qty, Date expiredDate, BigDecimal qty, Date expiredDate,
String requestData, String responseData, String errorMessage) {
String requestData, String responseData, String errorMessage, String serialNos) {
System.out.println("========== IFS错误日志记录开始 =========="); System.out.println("========== IFS错误日志记录开始 ==========");
System.out.println("站点: " + site + ", 接口: " + interfaceName + ", 方法: " + methodType); System.out.println("站点: " + site + ", 接口: " + interfaceName + ", 方法: " + methodType);
@ -80,7 +80,7 @@ public class IfsCallErrorLogServiceImpl extends ServiceImpl<IfsCallErrorLogMappe
errorLog.setRetryCount(0); errorLog.setRetryCount(0);
errorLog.setMaxRetry(3); errorLog.setMaxRetry(3);
errorLog.setCreatedAt(new Date()); errorLog.setCreatedAt(new Date());
errorLog.setSerialNos(serialNos);
this.save(errorLog); this.save(errorLog);
System.out.println("IFS错误日志记录成功,日志ID: " + errorLog.getId()); System.out.println("IFS错误日志记录成功,日志ID: " + errorLog.getId());

15
src/main/java/com/gaotao/modules/other/service/impl/InventoryMoveServiceImpl.java

@ -230,7 +230,7 @@ public class InventoryMoveServiceImpl implements InventoryMoveService {
.list(); .list();
if (handlingUnits.size() != dto.getHandlingUnitIds().size()) { if (handlingUnits.size() != dto.getHandlingUnitIds().size()) {
throw new XJException("部分HandlingUnit不存在或站点不匹配");
throw new XJException("部分HandlingUnit不存在或site不匹配");
} }
/* for (HandlingUnit hu : handlingUnits) { /* for (HandlingUnit hu : handlingUnits) {
@ -323,6 +323,12 @@ public class InventoryMoveServiceImpl implements InventoryMoveService {
}); });
group.totalQty = group.totalQty.add(hu.getQty()); group.totalQty = group.totalQty.add(hu.getQty());
// 拼接逻辑如果为空直接赋值否则加前缀
if (group.serialNos.isEmpty()) {
group.serialNos = hu.getUnitId();
} else {
group.serialNos += ";" + hu.getUnitId();
}
} }
// 为每个分组调用IFS接口 - rqrq // 为每个分组调用IFS接口 - rqrq
@ -614,7 +620,8 @@ public class InventoryMoveServiceImpl implements InventoryMoveService {
group.expiredDate, group.expiredDate,
jsonBody, jsonBody,
ifsResponse, ifsResponse,
errorMessage
errorMessage,
group.serialNos
); );
} }
@ -637,7 +644,8 @@ public class InventoryMoveServiceImpl implements InventoryMoveService {
group.expiredDate, group.expiredDate,
jsonBody != null ? jsonBody : "请求构建失败", jsonBody != null ? jsonBody : "请求构建失败",
ifsResponse != null ? ifsResponse : "未收到响应", ifsResponse != null ? ifsResponse : "未收到响应",
errorMessage
errorMessage,
group.serialNos
); );
} }
} }
@ -764,6 +772,7 @@ public class InventoryMoveServiceImpl implements InventoryMoveService {
BigDecimal totalQty; BigDecimal totalQty;
Date expiredDate; Date expiredDate;
String engChgLevel; // 工程变更级别默认1 String engChgLevel; // 工程变更级别默认1
String serialNos;
} }
/** /**

Loading…
Cancel
Save