diff --git a/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/query/ExportInCheckQuery.java b/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/query/ExportInCheckQuery.java index e0f319e..c974d0e 100644 --- a/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/query/ExportInCheckQuery.java +++ b/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/query/ExportInCheckQuery.java @@ -122,6 +122,12 @@ public class ExportInCheckQuery extends BaseQuery { @ApiModelProperty(hidden = true) private Long exportInId; + @ApiModelProperty(value = "操作模式ID") + private String operateTypeId; + + @ApiModelProperty("特殊作业ID") + private String specWorkId; + @ApiModelProperty(value = "是否加载车架号列表") private Boolean vinStatus; diff --git a/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/query/ExportInQuery.java b/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/query/ExportInQuery.java index b0d2a1e..cc9d77a 100644 --- a/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/query/ExportInQuery.java +++ b/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/query/ExportInQuery.java @@ -94,6 +94,12 @@ public class ExportInQuery extends BaseQuery { @DbQuery(field = "select id from customer_export_in_cargo where export_in_id=customer_export_in.id and vin like {0}", symbol = SqlSymbol.EXISTS) private String vin; + @ApiModelProperty(value = "操作模式ID") + private String operateTypeId; + + @ApiModelProperty("特殊作业ID") + private String specWorkId; + // 明细表查询时会用到 @ApiModelProperty(hidden = true) private Long exportInId; diff --git a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/api/dto/VinStatus.java b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/api/dto/VinStatus.java index 37d107f..fd4f5b8 100644 --- a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/api/dto/VinStatus.java +++ b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/api/dto/VinStatus.java @@ -18,4 +18,6 @@ public class VinStatus implements Serializable { private String workStatus; private String yardPos; + + private String position; } diff --git a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportInHandler.java b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportInHandler.java index f6e4047..4797a3c 100644 --- a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportInHandler.java +++ b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportInHandler.java @@ -285,6 +285,30 @@ public class ExportInHandler implements BaseHandler { return ResultUtil.success(rst, String.valueOf(page.getTotal())); } + @ApiOperation("出口进港计划货代列表") + @PostMapping("/freight/list") + public Result> getFreightList( + @RequestParam(required = false, defaultValue = "1") Integer current, + @RequestParam(required = false, defaultValue = "10") Integer size, + @RequestParam(required = false) String q) { + QueryWrapper query = new QueryWrapper<>(); + query.select("distinct freight_id, freight"); + query.in("check_status", Arrays.asList(AuditEnum.AUDIT)); + query.like(StringUtils.isNotEmpty(q), "freight", q); + + Page page = customerExportInService.page(new Page<>(current, size), query); + List list = page.getRecords(); + + List rst = list.stream().map(item -> { + DictDTO dto = new DictDTO(); + dto.setId(item.getFreightId()); + dto.setText(item.getFreight()); + return dto; + }).collect(Collectors.toList()); + + return ResultUtil.success(rst, String.valueOf(page.getTotal())); + } + /** * 分页查询 * @@ -2378,13 +2402,13 @@ public class ExportInHandler implements BaseHandler { try { CustomerExportIn exportIn = customerExportInService.getById(id); - List havePlans = openApi.haveShipPlan(exportIn.getVoyageId()); - if (exportIn != null && CollectionUtils.isNotEmpty(havePlans)) { - Boolean c = havePlans.contains(exportIn.getId()); - if (c) { - return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "已生成装船计划,不能导入"); - } - } +// List havePlans = openApi.haveShipPlan(exportIn.getVoyageId()); +// if (exportIn != null && CollectionUtils.isNotEmpty(havePlans)) { +// Boolean c = havePlans.contains(exportIn.getId()); +// if (c) { +// return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "已生成装船计划,不能导入"); +// } +// } // 所有读取的数据 List dataList = new ArrayList<>(); @@ -2600,13 +2624,13 @@ public class ExportInHandler implements BaseHandler { try { CustomerExportIn exportIn = customerExportInService.getById(id); - List havePlans = openApi.haveShipPlan(exportIn.getVoyageId()); - if (exportIn != null && CollectionUtils.isNotEmpty(havePlans)) { - Boolean c = havePlans.contains(exportIn.getId()); - if (c) { - return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "已生成装船计划,不能导入"); - } - } +// List havePlans = openApi.haveShipPlan(exportIn.getVoyageId()); +// if (exportIn != null && CollectionUtils.isNotEmpty(havePlans)) { +// Boolean c = havePlans.contains(exportIn.getId()); +// if (c) { +// return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "已生成装船计划,不能导入"); +// } +// } // 所有读取的数据 List dataList = new ArrayList<>(); @@ -2923,18 +2947,18 @@ public class ExportInHandler implements BaseHandler { ids.addAll(exportInList.stream().map(p -> p.getId()).collect(Collectors.toList())); // 已生成装船计划,不能导入 - List havePlans = openApi.haveShipPlan(exportIn.getVoyageId()); - if (exportIn != null && CollectionUtils.isNotEmpty(havePlans)) { - Boolean c = havePlans.contains(exportIn.getId()); - if (c) { - errorDataList.addAll(item.getValue().stream().map(p -> { - JSONObject o = JSONObject.from(p); - o.put("status", "已生成装船计划,不能导入"); - return o; - }).collect(Collectors.toList())); - return; - } - } +// List havePlans = openApi.haveShipPlan(exportIn.getVoyageId()); +// if (exportIn != null && CollectionUtils.isNotEmpty(havePlans)) { +// Boolean c = havePlans.contains(exportIn.getId()); +// if (c) { +// errorDataList.addAll(item.getValue().stream().map(p -> { +// JSONObject o = JSONObject.from(p); +// o.put("status", "已生成装船计划,不能导入"); +// return o; +// }).collect(Collectors.toList())); +// return; +// } +// } // 按计划中的件数进行VIN的分配 int j = 0; @@ -3211,18 +3235,18 @@ public class ExportInHandler implements BaseHandler { ids.add(exportIn.getId()); // 已生成装船计划,不能导入 - List havePlans = openApi.haveShipPlan(exportIn.getVoyageId()); - if (exportIn != null && CollectionUtils.isNotEmpty(havePlans)) { - Boolean c = havePlans.contains(exportIn.getId()); - if (c) { - errorDataList.addAll(item.getValue().stream().map(p -> { - JSONObject o = JSONObject.from(p); - o.put("status", "已生成装船计划,不能导入"); - return o; - }).collect(Collectors.toList())); - return; - } - } +// List havePlans = openApi.haveShipPlan(exportIn.getVoyageId()); +// if (exportIn != null && CollectionUtils.isNotEmpty(havePlans)) { +// Boolean c = havePlans.contains(exportIn.getId()); +// if (c) { +// errorDataList.addAll(item.getValue().stream().map(p -> { +// JSONObject o = JSONObject.from(p); +// o.put("status", "已生成装船计划,不能导入"); +// return o; +// }).collect(Collectors.toList())); +// return; +// } +// } if (exportIn.getCheckStatus() == AuditEnum.AUDIT_PASS) { // 审核 errorDataList.addAll(item.getValue().stream().map(p -> { @@ -4002,11 +4026,12 @@ public class ExportInHandler implements BaseHandler { errorDataList.add(o); return; } - if (!voyageMap.containsKey(item.getTransferShipName())) { - List data = dictHandler.queryVoyageByKey(null, null, null, shipList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), item.getTransferShipName())).findFirst().get().getId(), null).getData(); - voyageMap.put(item.getTransferShipName(), data); + String key = item.getTransferShipName()+"#$#"+item.getTransferVoyage(); + if (!voyageMap.containsKey(key)) { + List data = dictHandler.queryVoyageByKey(null, item.getTransferVoyage(), null, shipList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), item.getTransferShipName())).findFirst().get().getId(), null).getData(); + voyageMap.put(key, data); } - if (voyageMap.get(item.getTransferShipName()).stream().filter(p -> StringUtils.equalsIgnoreCase(p.getVvyName(), item.getTransferVoyage())).count() == 0) { + if (voyageMap.get(key).stream().filter(p -> StringUtils.equalsIgnoreCase(p.getVvyName(), item.getTransferVoyage())).count() == 0) { JSONObject o = JSONObject.from(item); o.put("status", "中转进口航次不存在"); errorDataList.add(o); @@ -4091,7 +4116,7 @@ public class ExportInHandler implements BaseHandler { in.setNatureFlag(goodsNature.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getPtrDesc(), item.getNatureFlagName())).findFirst().get().getPtrCode()); if (StringUtils.equalsAny(in.getNatureFlagName(), "内进转外出", "外进转内出", "国际中转", "国内中转")) { in.setTransferShipId(shipList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), item.getTransferShipName())).findFirst().get().getId()); - in.setTransferVoyageId(voyageMap.get(in.getTransferShipName()).stream().filter(p -> StringUtils.equalsIgnoreCase(p.getVvyName(), item.getTransferVoyage())).findFirst().get().getVvyId()); + in.setTransferVoyageId(voyageMap.get(in.getTransferShipName()+"#$#"+in.getTransferVoyage()).stream().filter(p -> StringUtils.equalsIgnoreCase(p.getVvyName(), item.getTransferVoyage())).findFirst().get().getVvyId()); } if (in.getEnterQuantity() == null) { in.setEnterQuantity(in.getQuantity()); diff --git a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportInspectHandler.java b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportInspectHandler.java index 6be67e9..7eaea95 100644 --- a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportInspectHandler.java +++ b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportInspectHandler.java @@ -1184,7 +1184,7 @@ public class ExportInspectHandler implements BaseHandler { successDataList.addAll(dataList.stream().map(p -> { JSONObject o = JSONObject.from(p); o.put("status", "成攻"); - o.put("yardPos", vinStatusMap.containsKey(p.getVin()) ? vinStatusMap.get(p.getVin()).getYardPos() : "未进港"); + o.put("yardPos", vinStatusMap.containsKey(p.getVin()) ? vinStatusMap.get(p.getVin()).getPosition() : "未进港"); return o; }).collect(Collectors.toList())); diff --git a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportLoadHandler.java b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportLoadHandler.java index bbb7341..9e53c2c 100644 --- a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportLoadHandler.java +++ b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ExportLoadHandler.java @@ -2906,11 +2906,12 @@ public class ExportLoadHandler implements BaseHandler { errorDataList.add(o); return; } - if (!transferVoyageMap.containsKey(item.getTransferShipName())) { - List data = dictHandler.queryVoyageByKey(null, null, null, shipList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), item.getTransferShipName())).findFirst().get().getId(), null).getData(); - transferVoyageMap.put(item.getTransferShipName(), data); + String key = item.getTransferShipName()+"#$#"+item.getTransferVoyage(); + if (!transferVoyageMap.containsKey(key)) { + List data = dictHandler.queryVoyageByKey(null, item.getTransferVoyage(), null, shipList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), item.getTransferShipName())).findFirst().get().getId(), null).getData(); + transferVoyageMap.put(key, data); } - if (transferVoyageMap.get(item.getTransferShipName()).stream().filter(p -> StringUtils.equalsIgnoreCase(p.getVvyName(), item.getTransferVoyage())).count() == 0) { + if (transferVoyageMap.get(key).stream().filter(p -> StringUtils.equalsIgnoreCase(p.getVvyName(), item.getTransferVoyage())).count() == 0) { JSONObject o = JSONObject.from(item); o.put("status", "中转进口航次不存在"); errorDataList.add(o); @@ -3069,7 +3070,7 @@ public class ExportLoadHandler implements BaseHandler { exportLoad.setTransferShipName(item.getValue().get(0).getTransferShipName()); if (StringUtils.equalsAny(item.getValue().get(0).getNatureFlagName(), "内进转外出", "外进转内出", "国际中转", "国内中转")) { exportLoad.setTransferShipId(shipList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), item.getValue().get(0).getTransferShipName())).findFirst().get().getId()); - exportLoad.setTransferVoyageId(transferVoyageMap.get(exportLoad.getTransferShipName()).stream().filter(p -> StringUtils.equalsIgnoreCase(p.getVvyName(), item.getValue().get(0).getTransferVoyage())).findFirst().get().getVvyId()); + exportLoad.setTransferVoyageId(transferVoyageMap.get(exportLoad.getTransferShipName()+"#$#"+exportLoad.getTransferVoyage()).stream().filter(p -> StringUtils.equalsIgnoreCase(p.getVvyName(), item.getValue().get(0).getTransferVoyage())).findFirst().get().getVvyId()); } if (StringUtils.isNotEmpty(item.getValue().get(0).getDestPort())) { // 内贸目的港可以为空 exportLoad.setDestPort(item.getValue().get(0).getDestPort()); diff --git a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ImportInspectHandler.java b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ImportInspectHandler.java index 9ac26b8..678266c 100644 --- a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ImportInspectHandler.java +++ b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/ImportInspectHandler.java @@ -1142,7 +1142,7 @@ public class ImportInspectHandler implements BaseHandler { successDataList.addAll(dataList.stream().map(p -> { JSONObject o = JSONObject.from(p); o.put("status", "成功"); - o.put("yardPos", vinStatusMap.containsKey(p.getVin()) ? vinStatusMap.get(p.getVin()).getYardPos() : "未进港"); + o.put("yardPos", vinStatusMap.containsKey(p.getVin()) ? vinStatusMap.get(p.getVin()).getPosition() : "未进港"); return o; }).collect(Collectors.toList())); } catch (ExcelDataConvertException e) {