| | |
| | | import com.ruoyi.basic.pojo.StandardProductList; |
| | | import com.ruoyi.basic.pojo.StructureItemParameter; |
| | | import com.ruoyi.basic.pojo.StructureTestObject; |
| | | import com.ruoyi.common.config.ifs.IfsProperties; |
| | | import com.ruoyi.common.constant.InsOrderTypeConstants; |
| | | import com.ruoyi.common.core.domain.Result; |
| | | import com.ruoyi.common.core.domain.entity.User; |
| | |
| | | */ |
| | | @Override |
| | | public void getIfsOrder(Map<String, Object> map, Boolean isSplitOrder) { |
| | | List<Map<String, Object>> inventory = ifsApiUtils.getInventory(JSONUtil.toJsonStr(map)); |
| | | List<Map<String, Object>> inventory = ifsApiUtils.getInventory(map); |
| | | if (inventory.isEmpty()) { |
| | | return; |
| | | } |
| | |
| | | ifsInventoryQuantity.setIsCopper(1); |
| | | ifsInventoryQuantity.setIsQuarter(0); |
| | | ifsInventoryQuantity.setInspectStatus(0); |
| | | ifsInventoryQuantity.setOrderType(OrderType.RAW.getValue()); |
| | | ifsInventoryQuantity.setMaterialProp("01Cu"); |
| | | |
| | | ifsInventoryQuantity.setQtyArrived(insOrder.getQtyArrived()); |
| | | ifsInventoryQuantity.setBuyUnitMeas(insOrder.getBuyUnitMeas()); |
| | |
| | | resultMap.put("SYSCODE", "LIMS"); |
| | | resultMap.put("SYSMODEL", "登记采购检验结果"); |
| | | resultMap.put("BATCH_INFO", resultList); |
| | | Result result = ifsApiUtils.getProcurementResults(JSONUtil.toJsonStr(resultMap)); |
| | | Result result = ifsApiUtils.getProcurementResults(one.getContract(),JSONUtil.toJsonStr(resultMap)); |
| | | if (result.getCode() != 200) { |
| | | throw new ErrorException("IFS登记采购检验结果失败: " + result.getMessage()); |
| | | } |
| | |
| | | * TODO 后续需要调用IFS的接口 移入的库位号 toLocation |
| | | */ |
| | | // 检验后移库 |
| | | //1301:原材料合格库,CP-02-001:成品库 |
| | | toLocation = StringUtils.equals(inventoryQuantity.getOrderType(), OrderType.RAW.getValue()) ? "1301" : "CP-02-001"; |
| | | //1.根据ifs域获取对应库位配置 |
| | | IfsProperties properties = ifsApiUtils.getPropByContract(one.getContract()); |
| | | //2.判断订单类型是否为原材料 |
| | | if(StringUtils.equals(inventoryQuantity.getOrderType(), OrderType.RAW.getValue())){ |
| | | toLocation = properties.getRawQualifiedLocation(); |
| | | }else{ |
| | | toLocation = properties.getProductQualifiedLocation(); |
| | | } |
| | | Map<String, Object> moveResultMap = new HashMap<>(); |
| | | List<Map<String, Object>> moveResultList = new ArrayList<>(); |
| | | Map<String, Object> moveMap = new HashMap<>(); |
| | |
| | | moveResultMap.put("SYSMODEL", "检验后移库"); |
| | | moveResultMap.put("BATCH_INFO", moveResultList); |
| | | |
| | | Result result1 = ifsApiUtils.moveReceipt(JSONUtil.toJsonStr(moveResultMap)); |
| | | Result result1 = ifsApiUtils.moveReceipt(one.getContract(),JSONUtil.toJsonStr(moveResultMap)); |
| | | // 如果有必须为零件指定批号报错需要重新提交移库信息去指定批号 |
| | | if (result1.getCode() != 200) { |
| | | String message = result1.getMessage(); |
| | |
| | | throw new ErrorException("IFS检验后移库失败: " + result1.getMessage()); |
| | | } |
| | | } |
| | | // 修改ifs订单数据为已检验 |
| | | ifsInventoryQuantityMapper.update(null, new LambdaUpdateWrapper<IfsInventoryQuantity>() |
| | | .set(IfsInventoryQuantity::getState, 2) |
| | | .eq(IfsInventoryQuantity::getId, inventoryQuantity.getId())); |
| | | return toLocation; |
| | | } |
| | | |
| | |
| | | resultMap.put("SYSMODEL", "修改采购订单批次号"); |
| | | resultMap.put("BATCH_INFO", resultList); |
| | | |
| | | Result result = ifsApiUtils.updateMoveReceiptLot(JSONUtil.toJsonStr(resultMap)); |
| | | Result result = ifsApiUtils.updateMoveReceiptLot(one.getContract(),JSONUtil.toJsonStr(resultMap)); |
| | | |
| | | if (result.getCode() != 200) { |
| | | throw new ErrorException("IFS修改批次号失败: " + result.getMessage()); |
| | |
| | | moveResultMap.put("SYSMODEL", "检验后移库"); |
| | | moveResultMap.put("BATCH_INFO", moveResultList); |
| | | |
| | | Result result1 = ifsApiUtils.moveReceipt(JSONUtil.toJsonStr(moveResultMap)); |
| | | Result result1 = ifsApiUtils.moveReceipt(one.getContract(),JSONUtil.toJsonStr(moveResultMap)); |
| | | if (result1.getCode() != 200) { |
| | | throw new ErrorException("IFS检验后移库失败: " + result1.getMessage()); |
| | | } |