添加了查验列表接口
This commit is contained in:
parent
8f70e34cb5
commit
751da4557b
|
@ -161,7 +161,7 @@ public class ExportInPlanExcel {
|
|||
/**
|
||||
* 单票重量
|
||||
*/
|
||||
@ExcelProperty("*单票重量(吨)")
|
||||
@ExcelProperty("*单票重量(千克)")
|
||||
@NotNull(message = "单票重量不能为空")
|
||||
@NumberFormat("#.####")
|
||||
private BigDecimal eachWeight;
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.haitonggauto.rtosc.api;
|
|||
|
||||
import com.haitonggauto.rtosc.api.dto.CustomNoReq;
|
||||
import com.haitonggauto.rtosc.api.dto.CustomNoResp;
|
||||
import com.haitonggauto.rtosc.api.dto.VinStatus;
|
||||
import com.haitonggauto.rtosc.api.dto.VoyageDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -11,10 +12,13 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
//@FeignClient(name = "https://rtops4.haitongauto.com/tos/yard")
|
||||
@FeignClient(name = "yard-service")
|
||||
@FeignClient(name = "https://rtops4.haitongauto.com/tos/yard")
|
||||
//@FeignClient(name = "yard-service")
|
||||
public interface NuzarYardApi {
|
||||
|
||||
@PostMapping("/yardCustomsRelease/queryCustomNoByvvyIdAndMnf")
|
||||
List<CustomNoResp> getVoyageNameByVvyName(@RequestBody CustomNoReq customNoReq);
|
||||
|
||||
@PostMapping("/yardGoods/vinCode")
|
||||
List<VinStatus> getVinStatus(@RequestBody List<String> vinCode);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.haitonggauto.rtosc.api.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel("车辆在场状态")
|
||||
@Data
|
||||
public class VinStatus implements Serializable {
|
||||
@ApiModelProperty("车架号")
|
||||
private String vinCode;
|
||||
|
||||
@ApiModelProperty("货物是否异常 0 否 1 是")
|
||||
private String expFlag;
|
||||
|
||||
private String workStatus;
|
||||
|
||||
private String yardPos;
|
||||
}
|
|
@ -1544,6 +1544,7 @@ public class ExportInHandler implements BaseHandler {
|
|||
return v;
|
||||
}).collect(Collectors.toList());
|
||||
List<CheckVinReq> rst = shpApi.checkVinRepeat(req);
|
||||
existVins.clear();
|
||||
if (CollectionUtils.isNotEmpty(rst)) {
|
||||
// 再次过滤出重复的
|
||||
List<CheckVinReq> collect = rst.stream().filter(item -> item.getIsRepetition()).collect(Collectors.toList());
|
||||
|
|
|
@ -576,6 +576,40 @@ public class ExportInspectHandler implements BaseHandler {
|
|||
return ResultUtil.success(exportInspect);
|
||||
}
|
||||
|
||||
@ApiOperation("获取查验货物明细")
|
||||
@PostMapping("/inspect/cargo/detail")
|
||||
public Result<Page<CustomerExportInspectCargo>> inspectCargoDetail(@RequestBody ExportInspectCheckQuery query) {
|
||||
// 要么传 船ID和航次ID 要么传ids
|
||||
LambdaQueryWrapper<CustomerExportInspectCargo> cQuery = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(query.getShipId()) && StringUtils.isNotEmpty(query.getVoyageId())) {
|
||||
cQuery.exists("select id from customer_export_inspect where customer_export_inspect.id=customer_export_inspect_cargo.export_inspect_id and ship_id={0} and voyage_id={1}", query.getShipId(), query.getVoyageId());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(query.getIds())) {
|
||||
cQuery.in(CustomerExportInspectCargo::getExportInspectId, query.getIds());
|
||||
}
|
||||
|
||||
Page<CustomerExportInspectCargo> page = customerExportInspectCargoService.page(new Page<>(query.getPage(), query.getRows()), cQuery);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(page.getRecords())) {
|
||||
List<String> vins = page.getRecords().stream().map(item -> item.getVin()).collect(Collectors.toList());
|
||||
List<Long> ids = page.getRecords().stream().map(item -> item.getExportInspectId()).distinct().collect(Collectors.toList());
|
||||
// 获取表头信息
|
||||
List<CustomerExportInspect> list = customerExportInspectService.lambdaQuery().in(CustomerExportInspect::getId, ids).list();
|
||||
Map<Long, CustomerExportInspect> collect = list.stream().collect(Collectors.toMap(CustomerExportInspect::getId, item -> item));
|
||||
|
||||
// 判断车辆是否在场
|
||||
List<VinStatus> vinStatus = yardApi.getVinStatus(vins);
|
||||
|
||||
page.getRecords().stream().forEach(item -> {
|
||||
item.setInspect(collect.get(item.getExportInspectId()));
|
||||
item.setInArea(vinStatus.contains(item.getVin()));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return ResultUtil.success(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.haitonggauto.rtosc.api.NuzarOpenApi;
|
||||
import com.haitonggauto.rtosc.api.NuzarYardApi;
|
||||
import com.haitonggauto.rtosc.api.dto.*;
|
||||
import com.haitonggauto.rtosc.api.dto.log.ImportInspectLog;
|
||||
import com.haitonggauto.rtosc.common.context.UserContext;
|
||||
|
@ -75,6 +76,9 @@ public class ImportInspectHandler implements BaseHandler {
|
|||
@Resource
|
||||
private NuzarOpenApi openApi;
|
||||
|
||||
@Resource
|
||||
private NuzarYardApi yardApi;
|
||||
|
||||
@ApiOperation("船名航次模糊匹配")
|
||||
@PostMapping("/shipVoyage")
|
||||
public Result<List<ShipVoyageVo>> getExportInShipNameList(
|
||||
|
@ -538,6 +542,40 @@ public class ImportInspectHandler implements BaseHandler {
|
|||
return ResultUtil.success(exportInspect);
|
||||
}
|
||||
|
||||
@ApiOperation("获取查验货物明细")
|
||||
@PostMapping("/inspect/cargo/detail")
|
||||
public Result<Page<CustomerExportInspectCargo>> inspectCargoDetail(@RequestBody ExportInspectCheckQuery query) {
|
||||
// 要么传 船ID和航次ID 要么传ids
|
||||
LambdaQueryWrapper<CustomerExportInspectCargo> cQuery = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(query.getShipId()) && StringUtils.isNotEmpty(query.getVoyageId())) {
|
||||
cQuery.exists("select id from customer_export_inspect where customer_export_inspect.id=customer_export_inspect_cargo.export_inspect_id and ship_id={0} and voyage_id={1}", query.getShipId(), query.getVoyageId());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(query.getIds())) {
|
||||
cQuery.in(CustomerExportInspectCargo::getExportInspectId, query.getIds());
|
||||
}
|
||||
|
||||
Page<CustomerExportInspectCargo> page = customerExportInspectCargoService.page(new Page<>(query.getPage(), query.getRows()), cQuery);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(page.getRecords())) {
|
||||
List<String> vins = page.getRecords().stream().map(item -> item.getVin()).collect(Collectors.toList());
|
||||
List<Long> ids = page.getRecords().stream().map(item -> item.getExportInspectId()).distinct().collect(Collectors.toList());
|
||||
// 获取表头信息
|
||||
List<CustomerExportInspect> list = customerExportInspectService.lambdaQuery().in(CustomerExportInspect::getId, ids).list();
|
||||
Map<Long, CustomerExportInspect> collect = list.stream().collect(Collectors.toMap(CustomerExportInspect::getId, item -> item));
|
||||
|
||||
// 判断车辆是否在场
|
||||
List<VinStatus> vinStatus = yardApi.getVinStatus(vins);
|
||||
|
||||
page.getRecords().stream().forEach(item -> {
|
||||
item.setInspect(collect.get(item.getExportInspectId()));
|
||||
item.setInArea(vinStatus.contains(item.getVin()));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return ResultUtil.success(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*
|
||||
|
|
Binary file not shown.
|
@ -85,6 +85,14 @@ public class CustomerExportInspectCargo extends BaseEntity implements Serializab
|
|||
@TableField(value = "area")
|
||||
private String area;
|
||||
|
||||
@ApiModelProperty(value = "是否在场")
|
||||
@TableField(exist = false)
|
||||
private Boolean inArea;
|
||||
|
||||
@ApiModelProperty(value = "查验")
|
||||
@TableField(exist = false)
|
||||
private CustomerExportInspect inspect;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(hidden = true)
|
||||
|
|
Loading…
Reference in New Issue