Merge branch 'develop' into qms/develop

This commit is contained in:
曹鹏飞 2026-05-13 17:59:25 +08:00
commit 174617214f
5 changed files with 17 additions and 4 deletions

View File

@ -474,7 +474,7 @@ public class NormalPGIController extends BaseController {
.forEach(qrCodeMaster -> {
// 库存
InventoryInDTO inventoryDTO = inventories.stream()
.filter(inventoriesDTO -> inventoriesDTO.getMaterialNo().equals(item.getItemCode())
.filter(inventoriesDTO -> inventoriesDTO.getMaterialNo().equals(qrCodeMaster.getMaterialCode())
&& inventoriesDTO.getBatchNo().equals(qrCodeMaster.getBatchNo())
&& inventoriesDTO.getSerialNo().equals(qrCodeMaster.getSerialNo())
&& inventoriesDTO.getFactoryNo().equals(qrCodeMaster.getFactoryCode())
@ -489,6 +489,7 @@ public class NormalPGIController extends BaseController {
.setWarehouseNo(qrCodeMaster.getStorageLocation())
.setBatchNo(qrCodeMaster.getBatchNo())
.setSerialNo(qrCodeMaster.getSerialNo())
.setBinLocation(qrCodeMaster.getBinLocation())
.setNum(qrCodeMaster.getQuantity());
inventories.add(inventoryDTO);
} else {

View File

@ -27,7 +27,8 @@ public enum STATE {
InconsistentDataError(117, "需要用户确认"),
NoOrderData(118, "订单不存在"),
SAPErr(119, "SAP错误"),
OutOfStock(120, "库存不足");
OutOfStock(120, "库存不足"),
HttpError(121, "HTTP错误");
@Getter
private final Integer state;

View File

@ -194,6 +194,9 @@ public class MaterialController extends BaseController {
if (CollectionUtil.isNotEmpty(datas)) {
shipmentMaterialService.saveBatch(datas.stream().map(data -> {
WmsShipmentMaterial material = Convert.convert(WmsShipmentMaterial.class, data);
if (StrUtil.isNotBlank(data.getImageBase64())) {
material.setImage(uploadBase64(data.getImageBase64()));
}
material.setCreateBy("同步");
material.setCreateTime(LocalDateTime.now());
return material;

View File

@ -20,6 +20,7 @@ import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.servlet.resource.NoResourceFoundException;
import java.util.ArrayList;
@ -88,10 +89,17 @@ public class GlobalRestControllerAdvice {
@ExceptionHandler(DataAlertException.class)
public ApiResult<Void> handleDataAlertException(DataAlertException ex) {
printLog("返回数据错误", ex);
printLog("返回数据错误", ex);
return ApiResult.errorWithExtras(ex.getState(), ex.getObj());
}
@ExceptionHandler(HttpClientErrorException.class)
public ApiResult<Void> handleHttpClientErrorException(HttpClientErrorException ex) {
Throwable rootCause = ex.getRootCause() != null ? ex.getRootCause() : ex;
printLog("HTTP请求错误", rootCause);
return ApiResult.error(STATE.HttpError, rootCause.getMessage());
}
private void printLog(String msg, Throwable ex) {
log.error("{}:{},{}", msg, ex.getMessage(), ExceptionUtil.stacktraceToString(ex));
}

View File

@ -71,7 +71,7 @@ public class BomMaterialService {
headers.add("authorization", getToken());
HttpEntity<MaterialCategoryQO> requestEntity = new HttpEntity<>(qo, headers);
ResponseEntity<BomResultDTO<List<MaterialCategoryVO>>> response = restTemplate.exchange(
baseUrl + "/api/material/category/getAlllist",
baseUrl + "/material/category/getAlllist",
HttpMethod.POST,
requestEntity,
new ParameterizedTypeReference<>() {