Commit a542fe09 hc

fix:刷新GR过账信息缓存bug修改

1 个父辈 74ca021b
...@@ -2,20 +2,16 @@ package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util; ...@@ -2,20 +2,16 @@ package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.utils.CodeResolve; import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.core.device.util.DataCache; import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.custom.luxsan.api.LuxsanApi; import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import com.neotel.smfcore.custom.luxsan.api.bean.request.QueryGrStatusRequest; import com.neotel.smfcore.custom.luxsan.api.bean.request.QueryGrStatusRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.result.QueryGrStatusResult;
import com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil; import com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.GrUdNum; import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.GrUdNum;
import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.QueryGrStatusDto; import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.dto.QueryGrStatusDto;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -80,8 +76,18 @@ public class GrUtil { ...@@ -80,8 +76,18 @@ public class GrUtil {
QueryGrStatusRequest request = new QueryGrStatusRequest(CommonUtil.plantCode, barcode.getProvider(), barcode.getPartNumber(), "", ""); QueryGrStatusRequest request = new QueryGrStatusRequest(CommonUtil.plantCode, barcode.getProvider(), barcode.getPartNumber(), "", "");
List<QueryGrStatusDto> queryGrStatusDtos = QueryGrStatusDto.convertQueryGrStatusResultDto( List<QueryGrStatusDto> queryGrStatusDtos = QueryGrStatusDto.convertQueryGrStatusResultDto(
LuxsanApi.queryGrStatus(request)); LuxsanApi.queryGrStatus(request));
QueryGrStatusDto queryGrStatusDto = null;
if (ObjectUtil.isNotEmpty(queryGrStatusDtos)) { if (ObjectUtil.isNotEmpty(queryGrStatusDtos)) {
QueryGrStatusDto queryGrStatusDto = queryGrStatusDtos.get(0); for (QueryGrStatusDto item : queryGrStatusDtos) {
if (item.getGrItem().equals(grItem)
&& item.getGrCode().equals(grCode)) {
queryGrStatusDto = item;
break;
}
}
if (ObjectUtil.isNull(queryGrStatusDto)) {
throw new Exception(String.format("更新 [%s] GR过账信息缓存失败", key));
}
grUdNum.setLotQty(Double.valueOf(queryGrStatusDto.getLotQty()).intValue()); grUdNum.setLotQty(Double.valueOf(queryGrStatusDto.getLotQty()).intValue());
grUdNum.setUdQty(Double.valueOf(queryGrStatusDto.getUdQty()).intValue()); grUdNum.setUdQty(Double.valueOf(queryGrStatusDto.getUdQty()).intValue());
cacheMap.put(key, grUdNum); cacheMap.put(key, grUdNum);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!