|
|
@ -4033,6 +4033,27 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<InventoryPartUnitCostSumEntity> onlyQueryPartUnitCostList(InventoryPartUnitCostSumEntity inData) { |
|
|
public List<InventoryPartUnitCostSumEntity> onlyQueryPartUnitCostList(InventoryPartUnitCostSumEntity inData) { |
|
|
|
|
|
PartInformationEntity partData = partInformationMapper.selectOne(new QueryWrapper<PartInformationEntity>().eq("site", inData.getSite()).eq("part_no", inData.getPartNo())); |
|
|
|
|
|
if ("Y".equals(partData.getStatus())) { |
|
|
|
|
|
// 使用默认账号 |
|
|
|
|
|
Server srv = ifsServer.getIfsServer(ifsUsername, ifsPassword); |
|
|
|
|
|
Map<String, String> getInventoryValueResponse = baseSearchBean.getInventoryValueByPartNo(srv, partData); |
|
|
|
|
|
if ("200".equals(getInventoryValueResponse.get("resultCode"))) { |
|
|
|
|
|
// 修改物料成本 |
|
|
|
|
|
ArrayList<InventoryPartUnitCostSumEntity> subList = new ArrayList<>(); |
|
|
|
|
|
InventoryPartUnitCostSumEntity unitCostSum = JSONObject.parseObject(getInventoryValueResponse.get("obj"), InventoryPartUnitCostSumEntity.class); |
|
|
|
|
|
subList.add(unitCostSum); |
|
|
|
|
|
// 查是否存在该物料的成本 |
|
|
|
|
|
List<InventoryPartUnitCostSumEntity> unitValues = partInformationMapper.getUnitValuesByPartNo(inData.getSite(), inData.getPartNo(), "*"); |
|
|
|
|
|
if (unitValues.isEmpty()) { |
|
|
|
|
|
partInformationMapper.syncSaveUnitValue(subList); |
|
|
|
|
|
} else { |
|
|
|
|
|
partInformationMapper.syncUpdateUnitValue(subList); |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
log.error("获取成本信息异常: " + getInventoryValueResponse.get("resultMsg")); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
return partInformationMapper.queryPartUnitCostList(inData); |
|
|
return partInformationMapper.queryPartUnitCostList(inData); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|