系统问题修复

This commit is contained in:
dengjun 2023-11-10 09:28:56 +08:00
parent 4d129332cf
commit 346918ab95
17 changed files with 131 additions and 43 deletions

1
.gitignore vendored
View File

@ -7,5 +7,4 @@
/nuzar-customer-repository/target/
/.idea/
/logs/
*.iml
/nuzar-customer-repository/nuzar-customer-repository.iml

View File

@ -17,6 +17,9 @@ import java.util.List;
@Data
@ApiModel(value = "提离港区",description = "")
public class DepartureVo implements Serializable {
@ApiModelProperty(value = "是否直接提交审核")
private Boolean flag = false;
@NotNull(groups = {ValidationGroup.update.class}, message = "编辑时请进场ID不能为空")
@ApiModelProperty(value = "id")
private Long id;

View File

@ -25,6 +25,10 @@ import java.util.List;
@ApiModel(value = "出口进场基本表", description = "")
@MoreThan(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, field1 = "quantity", field2 = "eachQuantity", message = "数量不得超过单票件数")
public class ExportInVo implements Serializable {
@ApiModelProperty(value = "是否直接提交审核")
private Boolean flag = false;
@NotNull(groups = {ValidationGroup.update.class}, message = "编辑时请进场ID不能为空")
@ApiModelProperty(value = "id")
private Long id;

View File

@ -18,6 +18,9 @@ import java.util.List;
@Data
@ApiModel(value = "出口查验表")
public class ExportInspectVo implements Serializable {
@ApiModelProperty(value = "是否直接提交审核")
private Boolean flag = false;
@NotNull(groups = {ValidationGroup.update.class}, message = "编辑时ID不能为空")
@ApiModelProperty(value = "id")
private Long id;

View File

@ -17,6 +17,9 @@ import java.util.List;
@Data
@ApiModel(value = "出口装船表",description = "")
public class ExportLoadVo implements Serializable {
@ApiModelProperty(value = "是否直接提交审核")
private Boolean flag = false;
@NotNull(groups = {ValidationGroup.update.class}, message = "编辑时请ID不能为空")
@ApiModelProperty(value = "id")
private Long id;

View File

@ -14,6 +14,9 @@ import java.util.Date;
@Data
@ApiModel(value = "特保区基本信息表")
public class FreeTradeVo implements Serializable {
@ApiModelProperty(value = "是否直接提交审核")
private Boolean flag = false;
@ApiModelProperty(value = "id")
@NotNull(groups = {ValidationGroup.update.class}, message = "编辑时ID不能为空")
private Long id;

View File

@ -20,6 +20,9 @@ public class ExportInCheckQuery extends BaseQuery {
@DbQuery(field = "shipId")
private String shipName;
@ApiModelProperty(value = "船Id")
private String shipId;
@ApiModelProperty(value = "航次ID")
private String voyageId;

View File

@ -16,6 +16,9 @@ public class ExportLoadCheckQuery extends BaseQuery {
@ApiModelProperty(value = "受理号")
private String batchNo;
@ApiModelProperty(value = "船ID")
private String shipId;
@ApiModelProperty(value = "船名")
@DbQuery(field = "shipId")
private String shipName;

View File

@ -2,6 +2,8 @@ package com.haitonggauto.rtosc.api;
import com.haitonggauto.rtosc.api.dto.CheckVinReq;
import com.haitonggauto.rtosc.api.dto.VoyageDTO;
import com.haitonggauto.rtosc.api.dto.VoyageReq;
import com.haitonggauto.rtosc.api.dto.VoyageResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -19,4 +21,7 @@ public interface NuzarShpApi {
@PostMapping("/checkDup/checkDupVincode")
List<CheckVinReq> checkVinRepeat(@RequestBody List<CheckVinReq> req);
@PostMapping("/vesselVoyages/queryVvyListByVvNameAndSpmName")
List<VoyageResp> queryVvyListByVvNameAndSpmName(@RequestBody List<VoyageReq> req);
}

View File

@ -0,0 +1,17 @@
package com.haitonggauto.rtosc.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
@ApiModel("通过般名和航次查询航次信息请求体")
public class VoyageReq implements Serializable {
@ApiModelProperty("船名")
private String spmName;
@ApiModelProperty("航次名")
private String vvyName;
}

View File

@ -0,0 +1,34 @@
package com.haitonggauto.rtosc.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("通过般名和航次查询航次信息返回体")
public class VoyageResp {
@ApiModelProperty("航次ID")
private String vvyId;
@ApiModelProperty("航次名")
private String vvyName;
@ApiModelProperty("船舶id")
private String spmId;
@ApiModelProperty("内贸/外贸/内外贸")
private String tradeType;
private String tradeTypeName;
@ApiModelProperty("进出口标志")
private String importExportFlag;
private String importExportFlagName;
@ApiModelProperty("实际离泊时间")
private String actualAnchoringTime;
@ApiModelProperty("实际靠泊时间")
private String actualBerthingTime;
}

View File

@ -177,7 +177,7 @@ public class DepartureHandler implements BaseHandler {
CustomerDeparture departure = PoMapper.instance.departureVo2Entity(form);
departure.setBatchNo(batchNo);
departure.setApplicantId(UserContext.getUser().getUserId());
departure.setCheckStatus(AuditEnum.SUBMIT);
departure.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
departure.setApplyTime(new Date());
departure.setTermcd(departure.getPortAreaId());
@ -260,7 +260,7 @@ public class DepartureHandler implements BaseHandler {
CustomerDeparture departure = PoMapper.instance.departureVo2Entity(form);
departure.setBatchNo(batchNo);
if (!flag) {
departure.setCheckStatus(AuditEnum.SUBMIT);
departure.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
} else {
departure.setCheckStatus(AuditEnum.AUDIT);
}

View File

@ -383,7 +383,7 @@ public class ExportInHandler implements BaseHandler {
// 表单验证以及格式转换
CustomerExportIn exportIn = PoMapper.instance.exportInVo2Entity(form);
exportIn.setBatchNo(batchNo);
exportIn.setCheckStatus(AuditEnum.SUBMIT); // 待提交, 待审核 审核通守审核拒绝
exportIn.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT); // 待提交, 待审核 审核通守审核拒绝
exportIn.setApplyTime(new Date());
exportIn.setApplicantId(UserContext.getUser().getUserId());
exportIn.setTermcd(exportIn.getPortAreaId());
@ -667,7 +667,7 @@ public class ExportInHandler implements BaseHandler {
exportIn.setBatchNo(batchNo);
exportIn.setTermcd(exportIn.getPortAreaId());
if (!flag) {
exportIn.setCheckStatus(AuditEnum.SUBMIT);
exportIn.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
} else {
exportIn.setCheckStatus(AuditEnum.AUDIT);
}
@ -755,6 +755,8 @@ public class ExportInHandler implements BaseHandler {
// 验证同一提单下所有进场的数量体积重量和提单号的每票的数量进行
QueryWrapper<CustomerExportIn> nQuery = new QueryWrapper<>();
nQuery.select("sum(quantity) as quantity, sum(volume) as volume, sum(weight) as weight")
.eq("ship_id", exportIn.getShipId())
.eq("voyage_id", exportIn.getVoyageId())
.eq("bill_num", exportIn.getBillNum()).ne("id", exportIn.getId());
Map<String, Object> vmap = customerExportInService.getMap(nQuery);
if (MapUtils.isEmpty(vmap)) {
@ -974,34 +976,39 @@ public class ExportInHandler implements BaseHandler {
// 验证哪些车架号已经存在了
// 移除oExists已经存在的
List<String> vins = form.getVins().stream().filter(item -> !oExists.contains(item)).collect(Collectors.toList());
List<CustomerExportInCargo> exists = customerExportInCargoService.list(new LambdaQueryWrapper<CustomerExportInCargo>().in(CustomerExportInCargo::getVin, vins));
List<String> existVins = exists.stream().map(p -> p.getVin()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(vins)) {
List<CustomerExportInCargo> exists = customerExportInCargoService.list(new LambdaQueryWrapper<CustomerExportInCargo>().in(CustomerExportInCargo::getVin, vins));
List<String> existVins = exists.stream().map(p -> p.getVin()).collect(Collectors.toList());
// 查询出对应的港区
if (CollectionUtils.isNotEmpty(exists)) {
List<CustomerExportIn> list = customerExportInService.lambdaQuery().in(CustomerExportIn::getId, exists.stream().map(item -> item.getExportInId()).collect(Collectors.toList())).list();
Map<Long, String> portAreaMap = list.stream().collect(Collectors.toMap(CustomerExportIn::getId, CustomerExportIn::getPortAreaId));
// 通过接口再次验证
List<CheckVinReq> req = exists.stream().map(item -> {
CheckVinReq v = new CheckVinReq();
v.setIsRepetition(true);
v.setPamId(portAreaMap.get(item.getExportInId()));
v.setVinCode(item.getVin());
return v;
}).collect(Collectors.toList());
List<CheckVinReq> rst = shpApi.checkVinRepeat(req);
if (CollectionUtils.isNotEmpty(rst)) {
// 再次过滤出重复的
List<CheckVinReq> collect = rst.stream().filter(item -> item.getIsRepetition()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) {
return ResultUtil.success(collect.stream().map(item -> item.getVinCode()).collect(Collectors.toList()));
// 查询出对应的港区
if (CollectionUtils.isNotEmpty(exists)) {
List<CustomerExportIn> list = customerExportInService.lambdaQuery().in(CustomerExportIn::getId, exists.stream().map(item -> item.getExportInId()).collect(Collectors.toList())).list();
Map<Long, String> portAreaMap = list.stream().collect(Collectors.toMap(CustomerExportIn::getId, CustomerExportIn::getPortAreaId));
// 通过接口再次验证
List<CheckVinReq> req = exists.stream().map(item -> {
CheckVinReq v = new CheckVinReq();
v.setIsRepetition(true);
v.setPamId(portAreaMap.get(item.getExportInId()));
v.setVinCode(item.getVin());
return v;
}).collect(Collectors.toList());
List<CheckVinReq> rst = shpApi.checkVinRepeat(req);
if (CollectionUtils.isNotEmpty(rst)) {
// 再次过滤出重复的
List<CheckVinReq> collect = rst.stream().filter(item -> item.getIsRepetition()).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)) {
return ResultUtil.success(collect.stream().map(item -> item.getVinCode()).collect(Collectors.toList()));
}
} else {
return ResultUtil.success(existVins);
}
} else {
return ResultUtil.success(existVins);
}
return ResultUtil.success(existVins);
}
return ResultUtil.success(existVins);
return ResultUtil.success(Collections.emptyList());
}
@ApiOperation("车架号导入(数组形式)")

View File

@ -242,7 +242,7 @@ public class ExportInspectHandler implements BaseHandler {
exportInspect.setBatchNo(batchNo);
exportInspect.setApplicantId(UserContext.getUser().getUserId());
exportInspect.setTradType("E");
exportInspect.setCheckStatus(AuditEnum.SUBMIT);
exportInspect.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
exportInspect.setTermcd(exportInspect.getPortAreaId());
exportInspect.setApplyTime(new Date());
@ -324,7 +324,7 @@ public class ExportInspectHandler implements BaseHandler {
exportInspect.setTermcd(exportInspect.getPortAreaId());
exportInspect.setTradType("E");
if (!flag) { // 后台编辑
exportInspect.setCheckStatus(AuditEnum.SUBMIT);
exportInspect.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
} else {
exportInspect.setCheckStatus(AuditEnum.AUDIT);
}

View File

@ -270,7 +270,7 @@ public class ExportLoadHandler implements BaseHandler {
// 表单验证以及格式转换
CustomerExportLoad exportLoad = PoMapper.instance.exportLoadVo2Entity(form);
exportLoad.setBatchNo(batchNo);
exportLoad.setCheckStatus(AuditEnum.SUBMIT);
exportLoad.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
exportLoad.setApplyTime(new Date());
exportLoad.setApplicantId(UserContext.getUser().getUserId());
@ -460,7 +460,7 @@ public class ExportLoadHandler implements BaseHandler {
CustomerExportLoad exportLoad = PoMapper.instance.exportLoadVo2Entity(form);
exportLoad.setBatchNo(batchNo);
if (!flag) {
exportLoad.setCheckStatus(AuditEnum.SUBMIT);
exportLoad.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
} else {
exportLoad.setCheckStatus(AuditEnum.AUDIT);
}
@ -1272,15 +1272,19 @@ public class ExportLoadHandler implements BaseHandler {
errorDataList.add(o);
return;
}
if (!voyageMap.containsKey(item.getVoyage())) {
VoyageDTO v = shpApi.getVoyageNameByVvyName(item.getVoyage());
if (v == null || StringUtils.isEmpty(v.getVvyId())) {
voyageMap.put(item.getVoyage(), "");
if (!voyageMap.containsKey(StringUtils.join(item.getShipName(),item.getVoyage()))) {
VoyageReq req = new VoyageReq();
req.setSpmName(item.getShipName());
req.setVvyName(item.getVoyage());
List<VoyageResp> resp = shpApi.queryVvyListByVvNameAndSpmName(Arrays.asList(req));
// VoyageDTO v = shpApi.getVoyageNameByVvyName(item.getVoyage());
if (CollectionUtils.isEmpty(resp)) {
voyageMap.put(StringUtils.join(item.getShipName(),item.getVoyage()), "");
} else {
voyageMap.put(item.getVoyage(),StringUtils.trim(v.getVvyId()));
voyageMap.put(StringUtils.join(item.getShipName(),item.getVoyage()),StringUtils.trim(resp.get(0).getVvyId()));
}
}
if (StringUtils.isEmpty(voyageMap.get(item.getVoyage()))) {
if (StringUtils.isEmpty(voyageMap.get(StringUtils.join(item.getShipName(),item.getVoyage())))) {
JSONObject o = JSONObject.from(item);
o.put("status", "航次不存在");
errorDataList.add(o);
@ -1407,7 +1411,7 @@ public class ExportLoadHandler implements BaseHandler {
exportLoad.setShipId(shipList.stream().filter(s -> StringUtils.equalsIgnoreCase(s.getText(), keys[0])).findFirst().get().getId());
exportLoad.setShipName(keys[0]);
exportLoad.setShipEnName(shipList.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getText(), keys[0])).findFirst().get().getExtra1());
exportLoad.setVoyageId(voyageMap.get(keys[1]));
exportLoad.setVoyageId(voyageMap.get(StringUtils.join(keys[0],keys[1])));
exportLoad.setVoyage(keys[1]);
exportLoad.setBillNo(keys[2]);
exportLoad.setBrandId(brandList.stream().filter(s -> StringUtils.equalsIgnoreCase(s.getText(), keys[3])).findFirst().get().getId());

View File

@ -121,7 +121,7 @@ public class FreeTradeHandler implements BaseHandler {
// 表单验证以及格式转换
CustomerFreeTrade freeTrade = PoMapper.instance.freeTradeVo2Entity(form);
freeTrade.setBatchNo(batchNo);
freeTrade.setCheckStatus(AuditEnum.SUBMIT);
freeTrade.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
customerFreeTradeService.save(freeTrade);
@ -178,7 +178,7 @@ public class FreeTradeHandler implements BaseHandler {
CustomerFreeTrade freeTrade = PoMapper.instance.freeTradeVo2Entity(form);
freeTrade.setBatchNo(batchNo);
if (!flag) {
freeTrade.setCheckStatus(AuditEnum.SUBMIT);
freeTrade.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
} else {
freeTrade.setCheckStatus(AuditEnum.AUDIT);
}

View File

@ -227,7 +227,7 @@ public class ImportInspectHandler implements BaseHandler {
exportInspect.setBatchNo(batchNo);
exportInspect.setApplicantId(UserContext.getUser().getUserId());
exportInspect.setTradType("I");
exportInspect.setCheckStatus(AuditEnum.SUBMIT);
exportInspect.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
exportInspect.setTermcd(exportInspect.getPortAreaId());
exportInspect.setApplyTime(new Date());
@ -305,7 +305,7 @@ public class ImportInspectHandler implements BaseHandler {
exportInspect.setTermcd(exportInspect.getPortAreaId());
exportInspect.setTradType("I");
if (!flag) {
exportInspect.setCheckStatus(AuditEnum.SUBMIT);
exportInspect.setCheckStatus(form.getFlag() ? AuditEnum.AUDIT : AuditEnum.SUBMIT);
} else {
exportInspect.setCheckStatus(AuditEnum.AUDIT);
}