BUG修复
This commit is contained in:
parent
bb8c1724ff
commit
a3ae356a1f
|
@ -23,6 +23,10 @@ public class DeparturePlanVo implements Serializable {
|
||||||
@ApiModelProperty(value = "提离港区ID", hidden = true)
|
@ApiModelProperty(value = "提离港区ID", hidden = true)
|
||||||
private Long departureId;
|
private Long departureId;
|
||||||
|
|
||||||
|
@ApiModelProperty("货物类型,0代表车辆,1代表备件")
|
||||||
|
@NotBlank(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "货物类型不能为空")
|
||||||
|
private String cargoType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 品牌ID
|
* 品牌ID
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -421,6 +421,17 @@ public class ExportInHandler implements BaseHandler {
|
||||||
}
|
}
|
||||||
List<CustomerExportIn> list = customerExportInService.getListByVoyageId(voyageId, status);
|
List<CustomerExportIn> list = customerExportInService.getListByVoyageId(voyageId, status);
|
||||||
customerService.wrapperEntity(list);
|
customerService.wrapperEntity(list);
|
||||||
|
|
||||||
|
// 判断是否换船,找出车架号重复,且航次不一样的记录
|
||||||
|
List<String> 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);
|
return ResultUtil.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,14 @@ public class ExportInspectHandler implements BaseHandler {
|
||||||
public Result<List<InspectBillDTO>> getConfirmBillNo(@RequestParam(required = false) String voyageId,
|
public Result<List<InspectBillDTO>> getConfirmBillNo(@RequestParam(required = false) String voyageId,
|
||||||
@RequestParam(required = false) String q) {
|
@RequestParam(required = false) String q) {
|
||||||
|
|
||||||
return ResultUtil.success(openApi.getExportInspectBillNoList(voyageId, q));
|
List<InspectBillDTO> list = openApi.getExportInspectBillNoList(voyageId, q);
|
||||||
|
|
||||||
|
// 对结果按提单号进行去重处理
|
||||||
|
Map<String, List<InspectBillDTO>> collect = list.stream().collect(Collectors.groupingBy(InspectBillDTO::getMnfBl));
|
||||||
|
|
||||||
|
List<InspectBillDTO> rst = collect.values().stream().map(item -> item.get(0)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
return ResultUtil.success(rst);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("出口查验申请货物明细")
|
@ApiOperation("出口查验申请货物明细")
|
||||||
|
|
|
@ -359,7 +359,20 @@ public class ExportLoadHandler implements BaseHandler {
|
||||||
if (status == null) {
|
if (status == null) {
|
||||||
status = AuditEnum.AUDIT_PASS;
|
status = AuditEnum.AUDIT_PASS;
|
||||||
}
|
}
|
||||||
return ResultUtil.success(customerExportLoadService.getListByVoyageId(voyageId, status));
|
|
||||||
|
List<CustomerExportLoad> list = customerExportLoadService.getListByVoyageId(voyageId, status);
|
||||||
|
|
||||||
|
// 判断是否换船,找出车架号重复,且航次不一样的记录
|
||||||
|
List<String> 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -270,21 +270,23 @@ public class FreeTradeHandler implements BaseHandler {
|
||||||
* @param vins
|
* @param vins
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation("验证车架号激活状态")
|
@ApiOperation("验证车架号激活状态, 返回已激活车架号详情")
|
||||||
@PostMapping("/valid-vins")
|
@PostMapping("/valid-vins")
|
||||||
public Result<String> validVins(@RequestBody
|
public Result<List<CustomerFreeTrade>> validVins(@RequestBody
|
||||||
@NotNull(message = "请传入车架号列表")
|
@NotNull(message = "请传入车架号列表")
|
||||||
@Size(min = 1, message = "车架号列表不能为空") List<String> vins) {
|
@Size(min = 1, message = "车架号列表不能为空") List<String> vins) {
|
||||||
List<CustomerFreeTrade> list = customerFreeTradeService.lambdaQuery().in(CustomerFreeTrade::getVin, vins).list();
|
List<CustomerFreeTrade> list = customerFreeTradeService.lambdaQuery()
|
||||||
|
.eq(CustomerFreeTrade::getIsActivate, ActiveEnum.YES)
|
||||||
|
.in(CustomerFreeTrade::getVin, vins).list();
|
||||||
// 返回的车架号信息
|
// 返回的车架号信息
|
||||||
List<String> collect = list.stream().map(item -> item.getVin()).collect(Collectors.toList());
|
// List<String> collect = list.stream().map(item -> item.getVin()).collect(Collectors.toList());
|
||||||
// 待激活的车架号信息
|
// 待激活的车架号信息
|
||||||
List<String> noActivate = list.stream().filter(item -> item.getIsActivate() == ActiveEnum.NO).map(item -> item.getVin()).collect(Collectors.toList());
|
// List<String> noActivate = list.stream().filter(item -> item.getIsActivate() == ActiveEnum.NO).map(item -> item.getVin()).collect(Collectors.toList());
|
||||||
List<String> noValid = vins.stream().filter(item -> !collect.contains(item) || noActivate.contains(item)).collect(Collectors.toList());
|
// List<String> noValid = vins.stream().filter(item -> !collect.contains(item) || noActivate.contains(item)).collect(Collectors.toList());
|
||||||
if (CollectionUtils.isNotEmpty(noValid)) {
|
// if (CollectionUtils.isNotEmpty(noValid)) {
|
||||||
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), StringUtils.join(noValid, ","));
|
// return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), StringUtils.join(noValid, ","));
|
||||||
}
|
// }
|
||||||
return ResultUtil.success("success");
|
return ResultUtil.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -211,7 +211,13 @@ public class ImportInspectHandler implements BaseHandler {
|
||||||
@ApiOperation("场地确认完成的提单号")
|
@ApiOperation("场地确认完成的提单号")
|
||||||
@PostMapping("/selectBills")
|
@PostMapping("/selectBills")
|
||||||
public Result<List<InspectBillDTO>> getImportInspectBillNoList(@RequestParam(value = "vvyId", required = false) String vvyId, @RequestParam(value = "key", required = false) String key){
|
public Result<List<InspectBillDTO>> getImportInspectBillNoList(@RequestParam(value = "vvyId", required = false) String vvyId, @RequestParam(value = "key", required = false) String key){
|
||||||
return ResultUtil.success(openApi.getImportInspectBillNoList(vvyId, key));
|
List<InspectBillDTO> list = openApi.getImportInspectBillNoList(vvyId, key);
|
||||||
|
|
||||||
|
// 对结果按提单号进行去重处理
|
||||||
|
Map<String, List<InspectBillDTO>> collect = list.stream().collect(Collectors.groupingBy(InspectBillDTO::getMnfBl));
|
||||||
|
|
||||||
|
List<InspectBillDTO> 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.setContentType("application/vnd.ms-excel");
|
||||||
response.setCharacterEncoding("utf-8");
|
response.setCharacterEncoding("utf-8");
|
||||||
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
// 这里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");
|
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
|
||||||
|
|
||||||
excelWriter = EasyExcel.write(out).build();
|
excelWriter = EasyExcel.write(out).build();
|
||||||
|
|
||||||
WriteSheet writeSheet = EasyExcel.writerSheet(0, "进口查验申请").head(ImportInspectExportExcel.class).build();
|
WriteSheet writeSheet = EasyExcel.writerSheet(0, "进口查验计划清单").head(ImportInspectExportExcel.class).build();
|
||||||
|
|
||||||
// 查询数据
|
// 查询数据
|
||||||
Page<CustomerExportInspect> page = customerExportInspectService.page(new Page<>(query.getPage(), query.getRows()), queryWrapper);
|
Page<CustomerExportInspect> page = customerExportInspectService.page(new Page<>(query.getPage(), query.getRows()), queryWrapper);
|
||||||
|
|
|
@ -25,6 +25,13 @@ public class CustomerDeparturePlan extends BaseEntity implements Serializable {
|
||||||
@ApiModelProperty(hidden = true)
|
@ApiModelProperty(hidden = true)
|
||||||
private Long departureId;
|
private Long departureId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 货物类型ID,0代表车辆,1代表备件
|
||||||
|
*/
|
||||||
|
@TableField(value = "cargo_type")
|
||||||
|
@ApiModelProperty("货物类型ID,0代表车辆,1代表备件")
|
||||||
|
private String cargoType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计划提货时间
|
* 计划提货时间
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -94,6 +94,10 @@ public class CustomerExportInCargo extends BaseEntity implements Serializable {
|
||||||
@ApiModelProperty(value = "场地")
|
@ApiModelProperty(value = "场地")
|
||||||
private String position;
|
private String position;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "是否换船")
|
||||||
|
private String changeFlag = "0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆状态
|
* 车辆状态
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -105,6 +105,10 @@ public class CustomerExportLoadCargo extends BaseEntity implements Serializable
|
||||||
@ApiModelProperty(value = "中转航次名")
|
@ApiModelProperty(value = "中转航次名")
|
||||||
private String transferVoyage;
|
private String transferVoyage;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "是否换船")
|
||||||
|
private String changeFlag = "0";
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
@ApiModelProperty(value = "基本信息")
|
@ApiModelProperty(value = "基本信息")
|
||||||
private CustomerExportLoad exportLoad;
|
private CustomerExportLoad exportLoad;
|
||||||
|
|
|
@ -16,6 +16,8 @@ import java.util.List;
|
||||||
public interface CustomerExportInCargoMapper extends BaseMapper<CustomerExportInCargo> {
|
public interface CustomerExportInCargoMapper extends BaseMapper<CustomerExportInCargo> {
|
||||||
|
|
||||||
List<CustomerExportInCargo> getListByVoyageId(PrintQuery query);
|
List<CustomerExportInCargo> getListByVoyageId(PrintQuery query);
|
||||||
|
|
||||||
|
List<String> getChangeShipVin(@Param("voyageId") String voyageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface CustomerExportLoadCargoMapper extends BaseMapper<CustomerExportLoadCargo> {
|
public interface CustomerExportLoadCargoMapper extends BaseMapper<CustomerExportLoadCargo> {
|
||||||
List<CustomerExportLoadCargo> getListByVoyageId(@Param("voyageId") String voyageId);
|
List<CustomerExportLoadCargo> getListByVoyageId(@Param("voyageId") String voyageId);
|
||||||
|
|
||||||
|
List<String> getChangeShipVin(@Param("voyageId") String voyageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.haitonggauto.rtosc.repository.service;
|
||||||
import com.haitonggauto.rtosc.repository.entity.CustomerExportInCargo;
|
import com.haitonggauto.rtosc.repository.entity.CustomerExportInCargo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.haitonggauto.rtosc.repository.query.PrintQuery;
|
import com.haitonggauto.rtosc.repository.query.PrintQuery;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -19,4 +20,6 @@ public interface CustomerExportInCargoService extends IService<CustomerExportInC
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<CustomerExportInCargo> getListByVoyageId(PrintQuery query);
|
List<CustomerExportInCargo> getListByVoyageId(PrintQuery query);
|
||||||
|
|
||||||
|
List<String> getChangeShipVin(String voyageId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,4 +17,6 @@ public interface CustomerExportLoadCargoService extends IService<CustomerExportL
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<CustomerExportLoadCargo> getListByVoyageId(String voyageId);
|
List<CustomerExportLoadCargo> getListByVoyageId(String voyageId);
|
||||||
|
|
||||||
|
List<String> getChangeShipVin(String voyageId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,11 @@ public class CustomerExportInCargoServiceImpl extends ServiceImpl<CustomerExport
|
||||||
public List<CustomerExportInCargo> getListByVoyageId(PrintQuery query) {
|
public List<CustomerExportInCargo> getListByVoyageId(PrintQuery query) {
|
||||||
return getBaseMapper().getListByVoyageId(query);
|
return getBaseMapper().getListByVoyageId(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getChangeShipVin(String voyageId) {
|
||||||
|
return getBaseMapper().getChangeShipVin(voyageId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,11 @@ public class CustomerExportLoadCargoServiceImpl extends ServiceImpl<CustomerExpo
|
||||||
public List<CustomerExportLoadCargo> getListByVoyageId(String voyageId) {
|
public List<CustomerExportLoadCargo> getListByVoyageId(String voyageId) {
|
||||||
return getBaseMapper().getListByVoyageId(voyageId);
|
return getBaseMapper().getListByVoyageId(voyageId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getChangeShipVin(String voyageId) {
|
||||||
|
return getBaseMapper().getChangeShipVin(voyageId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -116,4 +116,15 @@
|
||||||
<foreach collection="id" item="b" open="(" separator="," close=")">#{b}</foreach>
|
<foreach collection="id" item="b" open="(" separator="," close=")">#{b}</foreach>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据航次查询是否有转船的车架号 -->
|
||||||
|
<select id="getChangeShipVin" resultType="string">
|
||||||
|
select A.vin from customer_export_in_cargo A
|
||||||
|
left join customer_export_in B ON B."id" = A.export_in_id
|
||||||
|
where A.is_del=0 and B.is_del=0
|
||||||
|
<if test="voyageId != null and voyageId != ''">
|
||||||
|
and B.voyage_id=#{voyageId}
|
||||||
|
</if>
|
||||||
|
group by A.vin HAVING count(A.id)>1 and count(DISTINCT(voyage_id)) > 1;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -88,4 +88,15 @@
|
||||||
<select id="getListByVoyageId" resultMap="CMap">
|
<select id="getListByVoyageId" resultMap="CMap">
|
||||||
select * from customer_export_load_cargo left join customer_export_load on customer_export_load.id=customer_export_load_cargo.export_load_id where customer_export_load.voyage_id=#{voyageId} and check_status=2
|
select * from customer_export_load_cargo left join customer_export_load on customer_export_load.id=customer_export_load_cargo.export_load_id where customer_export_load.voyage_id=#{voyageId} and check_status=2
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据航次查询是否有转船的车架号 -->
|
||||||
|
<select id="getChangeShipVin" resultType="string">
|
||||||
|
select A.vin from customer_export_load_cargo A
|
||||||
|
left join customer_export_load B ON B."id" = A.export_load_id
|
||||||
|
where A.is_del=0 and B.is_del=0
|
||||||
|
<if test="voyageId != null and voyageId != ''">
|
||||||
|
and B.voyage_id=#{voyageId}
|
||||||
|
</if>
|
||||||
|
group by A.vin HAVING count(A.id)>1 and count(DISTINCT(voyage_id)) > 1;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue