进口查验导入场位BUG,中转船名航次优化,操作模式,特殊作业查询条件增加
This commit is contained in:
parent
2b28b41982
commit
50c362cb9f
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -18,4 +18,6 @@ public class VinStatus implements Serializable {
|
|||
private String workStatus;
|
||||
|
||||
private String yardPos;
|
||||
|
||||
private String position;
|
||||
}
|
||||
|
|
|
@ -285,6 +285,30 @@ public class ExportInHandler implements BaseHandler {
|
|||
return ResultUtil.success(rst, String.valueOf(page.getTotal()));
|
||||
}
|
||||
|
||||
@ApiOperation("出口进港计划货代列表")
|
||||
@PostMapping("/freight/list")
|
||||
public Result<List<DictDTO>> getFreightList(
|
||||
@RequestParam(required = false, defaultValue = "1") Integer current,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer size,
|
||||
@RequestParam(required = false) String q) {
|
||||
QueryWrapper<CustomerExportIn> 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<CustomerExportIn> page = customerExportInService.page(new Page<>(current, size), query);
|
||||
List<CustomerExportIn> list = page.getRecords();
|
||||
|
||||
List<DictDTO> 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<Long> 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<Long> 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<ExportVinExcel> dataList = new ArrayList<>();
|
||||
|
@ -2600,13 +2624,13 @@ public class ExportInHandler implements BaseHandler {
|
|||
try {
|
||||
CustomerExportIn exportIn = customerExportInService.getById(id);
|
||||
|
||||
List<Long> 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<Long> 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<ExportInSpareExcel> dataList = new ArrayList<>();
|
||||
|
@ -2923,18 +2947,18 @@ public class ExportInHandler implements BaseHandler {
|
|||
ids.addAll(exportInList.stream().map(p -> p.getId()).collect(Collectors.toList()));
|
||||
|
||||
// 已生成装船计划,不能导入
|
||||
List<Long> 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<Long> 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<Long> 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<Long> 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<VoyageResp> 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<VoyageResp> 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());
|
||||
|
|
|
@ -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()));
|
||||
|
||||
|
|
|
@ -2906,11 +2906,12 @@ public class ExportLoadHandler implements BaseHandler {
|
|||
errorDataList.add(o);
|
||||
return;
|
||||
}
|
||||
if (!transferVoyageMap.containsKey(item.getTransferShipName())) {
|
||||
List<VoyageResp> 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<VoyageResp> 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());
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue