diff --git a/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/dto/DeparturePlanVo.java b/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/dto/DeparturePlanVo.java index 45965a9..08d736a 100644 --- a/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/dto/DeparturePlanVo.java +++ b/nuzar-customer-client/src/main/java/com/haitonggauto/rtosc/dto/DeparturePlanVo.java @@ -23,6 +23,10 @@ public class DeparturePlanVo implements Serializable { @ApiModelProperty(value = "提离港区ID", hidden = true) private Long departureId; + @ApiModelProperty("货物类型,0代表车辆,1代表备件") + @NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "货物类型不能为空") + private String cargoType; + /** * 品牌ID */ 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 f792135..cb220d7 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 @@ -421,6 +421,17 @@ public class ExportInHandler implements BaseHandler { } List list = customerExportInService.getListByVoyageId(voyageId, status); customerService.wrapperEntity(list); + + // 判断是否换船,找出车架号重复,且航次不一样的记录 + List vins = customerExportInCargoService.getChangeShipVin(voyageId); + if (CollectionUtils.isNotEmpty(vins)) { + list.stream().forEach(item -> { + item.getVins().stream().filter(p -> vins.contains(p.getVin())).forEach(p -> { + p.setChangeFlag("1"); + }); + }); + } + return ResultUtil.success(list); } 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 d1edda2..3abf962 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 @@ -211,7 +211,14 @@ public class ExportInspectHandler implements BaseHandler { public Result> getConfirmBillNo(@RequestParam(required = false) String voyageId, @RequestParam(required = false) String q) { - return ResultUtil.success(openApi.getExportInspectBillNoList(voyageId, q)); + List list = openApi.getExportInspectBillNoList(voyageId, q); + + // 对结果按提单号进行去重处理 + Map> collect = list.stream().collect(Collectors.groupingBy(InspectBillDTO::getMnfBl)); + + List rst = collect.values().stream().map(item -> item.get(0)).collect(Collectors.toList()); + + return ResultUtil.success(rst); } @ApiOperation("出口查验申请货物明细") 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 e45c4c6..9610da4 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 @@ -359,7 +359,20 @@ public class ExportLoadHandler implements BaseHandler { if (status == null) { status = AuditEnum.AUDIT_PASS; } - return ResultUtil.success(customerExportLoadService.getListByVoyageId(voyageId, status)); + + List list = customerExportLoadService.getListByVoyageId(voyageId, status); + + // 判断是否换船,找出车架号重复,且航次不一样的记录 + List vins = customerExportLoadCargoService.getChangeShipVin(voyageId); + if (CollectionUtils.isNotEmpty(vins)) { + list.stream().forEach(item -> { + item.getVins().stream().filter(p -> vins.contains(p.getVin())).forEach(p -> { + p.setChangeFlag("1"); + }); + }); + } + + return ResultUtil.success(list); } /** diff --git a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/FreeTradeHandler.java b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/FreeTradeHandler.java index b9db6d2..5bf5033 100644 --- a/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/FreeTradeHandler.java +++ b/nuzar-customer-controller/src/main/java/com/haitonggauto/rtosc/handler/FreeTradeHandler.java @@ -270,21 +270,23 @@ public class FreeTradeHandler implements BaseHandler { * @param vins * @return */ - @ApiOperation("验证车架号激活状态") + @ApiOperation("验证车架号激活状态, 返回已激活车架号详情") @PostMapping("/valid-vins") - public Result validVins(@RequestBody + public Result> validVins(@RequestBody @NotNull(message = "请传入车架号列表") @Size(min = 1, message = "车架号列表不能为空") List vins) { - List list = customerFreeTradeService.lambdaQuery().in(CustomerFreeTrade::getVin, vins).list(); + List list = customerFreeTradeService.lambdaQuery() + .eq(CustomerFreeTrade::getIsActivate, ActiveEnum.YES) + .in(CustomerFreeTrade::getVin, vins).list(); // 返回的车架号信息 - List collect = list.stream().map(item -> item.getVin()).collect(Collectors.toList()); +// List collect = list.stream().map(item -> item.getVin()).collect(Collectors.toList()); // 待激活的车架号信息 - List noActivate = list.stream().filter(item -> item.getIsActivate() == ActiveEnum.NO).map(item -> item.getVin()).collect(Collectors.toList()); - List noValid = vins.stream().filter(item -> !collect.contains(item) || noActivate.contains(item)).collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(noValid)) { - return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), StringUtils.join(noValid, ",")); - } - return ResultUtil.success("success"); +// List noActivate = list.stream().filter(item -> item.getIsActivate() == ActiveEnum.NO).map(item -> item.getVin()).collect(Collectors.toList()); +// List noValid = vins.stream().filter(item -> !collect.contains(item) || noActivate.contains(item)).collect(Collectors.toList()); +// if (CollectionUtils.isNotEmpty(noValid)) { +// return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), StringUtils.join(noValid, ",")); +// } + return ResultUtil.success(list); } /** 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 27c2fa3..5af8aa9 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 @@ -211,7 +211,13 @@ public class ImportInspectHandler implements BaseHandler { @ApiOperation("场地确认完成的提单号") @PostMapping("/selectBills") public Result> getImportInspectBillNoList(@RequestParam(value = "vvyId", required = false) String vvyId, @RequestParam(value = "key", required = false) String key){ - return ResultUtil.success(openApi.getImportInspectBillNoList(vvyId, key)); + List list = openApi.getImportInspectBillNoList(vvyId, key); + + // 对结果按提单号进行去重处理 + Map> collect = list.stream().collect(Collectors.groupingBy(InspectBillDTO::getMnfBl)); + + List rst = collect.values().stream().map(item -> item.get(0)).collect(Collectors.toList()); + return ResultUtil.success(rst); } // 进口查验申请货物明细分页 @@ -674,12 +680,12 @@ public class ImportInspectHandler implements BaseHandler { response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding("utf-8"); // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 - String fileName = URLEncoder.encode(DateUtil.format(new Date(), DatePattern.PURE_DATE_PATTERN) + "进口查验申请", "UTF-8"); + String fileName = URLEncoder.encode(DateUtil.format(new Date(), DatePattern.PURE_DATE_PATTERN) + "进口查验计划清单", "UTF-8"); response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); excelWriter = EasyExcel.write(out).build(); - WriteSheet writeSheet = EasyExcel.writerSheet(0, "进口查验申请").head(ImportInspectExportExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet(0, "进口查验计划清单").head(ImportInspectExportExcel.class).build(); // 查询数据 Page page = customerExportInspectService.page(new Page<>(query.getPage(), query.getRows()), queryWrapper); diff --git a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerDeparturePlan.java b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerDeparturePlan.java index 76ce7b5..fd889e0 100644 --- a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerDeparturePlan.java +++ b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerDeparturePlan.java @@ -25,6 +25,13 @@ public class CustomerDeparturePlan extends BaseEntity implements Serializable { @ApiModelProperty(hidden = true) private Long departureId; + /** + * 货物类型ID,0代表车辆,1代表备件 + */ + @TableField(value = "cargo_type") + @ApiModelProperty("货物类型ID,0代表车辆,1代表备件") + private String cargoType; + /** * 计划提货时间 */ diff --git a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerExportInCargo.java b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerExportInCargo.java index 6ecfe29..c0f7662 100644 --- a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerExportInCargo.java +++ b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerExportInCargo.java @@ -94,6 +94,10 @@ public class CustomerExportInCargo extends BaseEntity implements Serializable { @ApiModelProperty(value = "场地") private String position; + @TableField(exist = false) + @ApiModelProperty(value = "是否换船") + private String changeFlag = "0"; + /** * 车辆状态 */ diff --git a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerExportLoadCargo.java b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerExportLoadCargo.java index 1cf7ac0..50e71aa 100644 --- a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerExportLoadCargo.java +++ b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/entity/CustomerExportLoadCargo.java @@ -105,6 +105,10 @@ public class CustomerExportLoadCargo extends BaseEntity implements Serializable @ApiModelProperty(value = "中转航次名") private String transferVoyage; + @TableField(exist = false) + @ApiModelProperty(value = "是否换船") + private String changeFlag = "0"; + @TableField(exist = false) @ApiModelProperty(value = "基本信息") private CustomerExportLoad exportLoad; diff --git a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/mapper/CustomerExportInCargoMapper.java b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/mapper/CustomerExportInCargoMapper.java index eddddf7..9fb9267 100644 --- a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/mapper/CustomerExportInCargoMapper.java +++ b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/mapper/CustomerExportInCargoMapper.java @@ -16,6 +16,8 @@ import java.util.List; public interface CustomerExportInCargoMapper extends BaseMapper { List getListByVoyageId(PrintQuery query); + + List getChangeShipVin(@Param("voyageId") String voyageId); } diff --git a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/mapper/CustomerExportLoadCargoMapper.java b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/mapper/CustomerExportLoadCargoMapper.java index 7804493..9836027 100644 --- a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/mapper/CustomerExportLoadCargoMapper.java +++ b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/mapper/CustomerExportLoadCargoMapper.java @@ -14,6 +14,8 @@ import java.util.List; */ public interface CustomerExportLoadCargoMapper extends BaseMapper { List getListByVoyageId(@Param("voyageId") String voyageId); + + List getChangeShipVin(@Param("voyageId") String voyageId); } diff --git a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/CustomerExportInCargoService.java b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/CustomerExportInCargoService.java index 6b7b0b2..0e4f7ab 100644 --- a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/CustomerExportInCargoService.java +++ b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/CustomerExportInCargoService.java @@ -3,6 +3,7 @@ package com.haitonggauto.rtosc.repository.service; import com.haitonggauto.rtosc.repository.entity.CustomerExportInCargo; import com.baomidou.mybatisplus.extension.service.IService; import com.haitonggauto.rtosc.repository.query.PrintQuery; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -19,4 +20,6 @@ public interface CustomerExportInCargoService extends IService getListByVoyageId(PrintQuery query); + + List getChangeShipVin(String voyageId); } diff --git a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/CustomerExportLoadCargoService.java b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/CustomerExportLoadCargoService.java index da081ef..faa09a5 100644 --- a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/CustomerExportLoadCargoService.java +++ b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/CustomerExportLoadCargoService.java @@ -17,4 +17,6 @@ public interface CustomerExportLoadCargoService extends IService getListByVoyageId(String voyageId); + + List getChangeShipVin(String voyageId); } diff --git a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/impl/CustomerExportInCargoServiceImpl.java b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/impl/CustomerExportInCargoServiceImpl.java index 0179180..06afba6 100644 --- a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/impl/CustomerExportInCargoServiceImpl.java +++ b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/impl/CustomerExportInCargoServiceImpl.java @@ -22,6 +22,11 @@ public class CustomerExportInCargoServiceImpl extends ServiceImpl getListByVoyageId(PrintQuery query) { return getBaseMapper().getListByVoyageId(query); } + + @Override + public List getChangeShipVin(String voyageId) { + return getBaseMapper().getChangeShipVin(voyageId); + } } diff --git a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/impl/CustomerExportLoadCargoServiceImpl.java b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/impl/CustomerExportLoadCargoServiceImpl.java index b11ba39..a3b4f52 100644 --- a/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/impl/CustomerExportLoadCargoServiceImpl.java +++ b/nuzar-customer-repository/src/main/java/com/haitonggauto/rtosc/repository/service/impl/CustomerExportLoadCargoServiceImpl.java @@ -21,6 +21,11 @@ public class CustomerExportLoadCargoServiceImpl extends ServiceImpl getListByVoyageId(String voyageId) { return getBaseMapper().getListByVoyageId(voyageId); } + + @Override + public List getChangeShipVin(String voyageId) { + return getBaseMapper().getChangeShipVin(voyageId); + } } diff --git a/nuzar-customer-repository/src/main/resources/mapper/CustomerExportInCargoMapper.xml b/nuzar-customer-repository/src/main/resources/mapper/CustomerExportInCargoMapper.xml index 88fac82..14dd5ee 100644 --- a/nuzar-customer-repository/src/main/resources/mapper/CustomerExportInCargoMapper.xml +++ b/nuzar-customer-repository/src/main/resources/mapper/CustomerExportInCargoMapper.xml @@ -116,4 +116,15 @@ #{b} + + + diff --git a/nuzar-customer-repository/src/main/resources/mapper/CustomerExportLoadCargoMapper.xml b/nuzar-customer-repository/src/main/resources/mapper/CustomerExportLoadCargoMapper.xml index c4586be..fb37d14 100644 --- a/nuzar-customer-repository/src/main/resources/mapper/CustomerExportLoadCargoMapper.xml +++ b/nuzar-customer-repository/src/main/resources/mapper/CustomerExportLoadCargoMapper.xml @@ -88,4 +88,15 @@ + + +