2023需求修改前
This commit is contained in:
parent
bcb588fd5d
commit
15cc47f465
|
@ -60,7 +60,7 @@ public class DepartureCargoVo implements Serializable {
|
|||
/**
|
||||
* 数量
|
||||
*/
|
||||
@NotNull(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "数量不能为空")
|
||||
// @NotNull(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "数量不能为空")
|
||||
@ApiModelProperty(value = "数量", required = true)
|
||||
private Integer quantity;
|
||||
|
||||
|
|
|
@ -151,7 +151,7 @@ public class DepartureVo implements Serializable {
|
|||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "返回日期", required = true, example="2023-06-12")
|
||||
@NotNull(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "返回日期不能为空")
|
||||
// @NotNull(groups = {ValidationGroup.insert.class, ValidationGroup.update.class}, message = "返回日期不能为空")
|
||||
private Date returnTime;
|
||||
|
||||
/**
|
||||
|
|
|
@ -74,15 +74,15 @@ public class ExportInCheckQuery extends BaseQuery {
|
|||
@DbQuery(field = "checkStatus", symbol = SqlSymbol.IN)
|
||||
private List<AuditEnum> checkStatusList;
|
||||
|
||||
@ApiModelProperty(value = "品牌")
|
||||
@ApiModelProperty(value = "品牌ID")
|
||||
@DbQuery(field = "brandId")
|
||||
private String brand;
|
||||
|
||||
@ApiModelProperty(value = "车型")
|
||||
@ApiModelProperty(value = "车型ID")
|
||||
@DbQuery(field = "cartTypeId")
|
||||
private String cartType;
|
||||
|
||||
@ApiModelProperty(value = "车型明细")
|
||||
@ApiModelProperty(value = "车型明细ID")
|
||||
@DbQuery(field = "cartTypeDetailId")
|
||||
private String cartTypeDetail;
|
||||
|
||||
|
|
|
@ -0,0 +1,102 @@
|
|||
package com.haitonggauto.rtosc.api.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@ApiModel("老系统出口进港同步数据")
|
||||
public class OldExportInAddReq implements Serializable {
|
||||
@ApiModelProperty("新系统计划主键")
|
||||
private String nsId;
|
||||
|
||||
@ApiModelProperty("船名")
|
||||
private String vlsNm;
|
||||
|
||||
@ApiModelProperty("航次")
|
||||
private String vvyNm;
|
||||
|
||||
@ApiModelProperty("货代")
|
||||
private String cstNm;
|
||||
|
||||
@ApiModelProperty("品牌")
|
||||
private String brdNm;
|
||||
|
||||
@ApiModelProperty("型号")
|
||||
private String mdlNm;
|
||||
|
||||
@ApiModelProperty("长度")
|
||||
private BigDecimal length;
|
||||
|
||||
@ApiModelProperty("宽度")
|
||||
private BigDecimal width;
|
||||
|
||||
@ApiModelProperty("高度")
|
||||
private BigDecimal height;
|
||||
|
||||
@ApiModelProperty("体积")
|
||||
private BigDecimal volume;
|
||||
|
||||
@ApiModelProperty("重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
@ApiModelProperty("目的国")
|
||||
private String ctnNm;
|
||||
|
||||
@ApiModelProperty("目的港")
|
||||
private String potNm;
|
||||
|
||||
@ApiModelProperty("车辆数")
|
||||
private String carNum;
|
||||
|
||||
@ApiModelProperty("备件数")
|
||||
private String partNum;
|
||||
|
||||
@ApiModelProperty("提单号")
|
||||
private String mnfBl;
|
||||
|
||||
@ApiModelProperty("单票件数")
|
||||
private BigDecimal mnfNum;
|
||||
|
||||
@ApiModelProperty("单票重量")
|
||||
private BigDecimal mnfWeight;
|
||||
|
||||
@ApiModelProperty("单票体积")
|
||||
private BigDecimal mnfVolume;
|
||||
|
||||
@ApiModelProperty("车型")
|
||||
private String godType;
|
||||
|
||||
@ApiModelProperty("车型明细")
|
||||
private String godDtlType;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("运输方式")
|
||||
private String transType;
|
||||
|
||||
@ApiModelProperty("联系人")
|
||||
private String person;
|
||||
|
||||
@ApiModelProperty("车辆操作模式")
|
||||
private String carOpMode;
|
||||
|
||||
@ApiModelProperty("备件操作模式")
|
||||
private String partOpMode;
|
||||
|
||||
@ApiModelProperty("特殊作业")
|
||||
private String specWork;
|
||||
|
||||
@ApiModelProperty("进场时间(起始)")
|
||||
private String inStartTm;
|
||||
|
||||
@ApiModelProperty("进场时间(截止)")
|
||||
private String inEndTm;
|
||||
|
||||
@ApiModelProperty("联系方式")
|
||||
private String personTel;
|
||||
}
|
|
@ -827,9 +827,9 @@ public class DepartureHandler implements BaseHandler {
|
|||
XSSFWorkbook workbook = new XSSFWorkbook(inputStream);
|
||||
//设置模板的第一个sheet的名称
|
||||
// 查询出所有提单的数量
|
||||
List<Long> ids = departures.stream().map(item -> item.getId()).collect(Collectors.toList());
|
||||
long count = departureCargoService.count(new LambdaQueryWrapper<CustomerDepartureCargo>().in(CustomerDepartureCargo::getDepartureId, ids));
|
||||
for (int i = 1; i < count; i++) {
|
||||
// List<Long> ids = departures.stream().map(item -> item.getId()).collect(Collectors.toList());
|
||||
// long count = departureCargoService.count(new LambdaQueryWrapper<CustomerDepartureCargo>().in(CustomerDepartureCargo::getDepartureId, ids));
|
||||
for (int i = 1; i < departures.size(); i++) {
|
||||
workbook.cloneSheet(0, "Sheet"+(i+1));
|
||||
}
|
||||
|
||||
|
@ -843,13 +843,19 @@ public class DepartureHandler implements BaseHandler {
|
|||
// 计划数据是共用的
|
||||
List<CustomerDeparturePlan> plans = departurePlanService.list(new LambdaQueryWrapper<CustomerDeparturePlan>().eq(CustomerDeparturePlan::getDepartureId, departures.get(i).getId()));
|
||||
|
||||
// 时间转换
|
||||
plans.stream().forEach(item -> {
|
||||
if (item.getPickTime() != null) {
|
||||
item.setPickTimeStr(DateUtils.formatDate(item.getPickTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
});
|
||||
|
||||
int totalCarQuantity = plans.stream().mapToInt(item -> item.getCarQuantity()).sum();
|
||||
int totalPartQuantity = plans.stream().mapToInt(item -> item.getPartQuantity()).sum();
|
||||
|
||||
// 查询出提单
|
||||
List<CustomerDepartureCargo> list = departureCargoService.list(new LambdaQueryWrapper<CustomerDepartureCargo>().in(CustomerDepartureCargo::getDepartureId, departures.get(i).getId()));
|
||||
|
||||
for (CustomerDepartureCargo cargo : list) {
|
||||
// 每个提单一个sheet
|
||||
WriteSheet writeSheet = EasyExcel.writerSheet(i, departures.get(i).getBatchNo()).build();
|
||||
// 这里注意 入参用了forceNewRow 代表在写入list的时候不管list下面有没有空行 都会创建一行,然后下面的数据往后移动。默认 是false,会直接使用下一行,如果没有则创建。
|
||||
|
@ -876,7 +882,7 @@ public class DepartureHandler implements BaseHandler {
|
|||
//{voyage}
|
||||
map.put("voyage", departures.get(i).getVoyage());
|
||||
// {billNo}
|
||||
map.put("billNo", cargo.getBillNo());
|
||||
map.put("billNo", list.get(0).getBillNo());
|
||||
// {arrivalTime}
|
||||
map.put("arrivalTime", departures.get(i).getArrivalTime());
|
||||
// {deliveryTime}
|
||||
|
@ -891,9 +897,10 @@ public class DepartureHandler implements BaseHandler {
|
|||
map.put("totalCarQuantity", totalCarQuantity);
|
||||
// {totalPartQuantity}
|
||||
map.put("totalPartQuantity", totalPartQuantity);
|
||||
|
||||
|
||||
excelWriter.fill(map, writeSheet);
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
|
|
|
@ -1200,6 +1200,9 @@ public class ExportInHandler implements BaseHandler {
|
|||
}
|
||||
|
||||
boolean row = customerExportInService.updateBatchById(exportIns);
|
||||
|
||||
// 如果是审核通过,还需要将数据同步到旧系统
|
||||
|
||||
if (row) {
|
||||
List<CustomerExportIn> list = customerExportInService.lambdaQuery().in(CustomerExportIn::getId, check.getIds()).list();
|
||||
|
||||
|
@ -3116,12 +3119,7 @@ public class ExportInHandler implements BaseHandler {
|
|||
}
|
||||
}
|
||||
|
||||
JSONObject o = JSONObject.from(item);
|
||||
o.put("status", "导入成功");
|
||||
successDataList.add(o);
|
||||
|
||||
saveData.add(item);
|
||||
|
||||
});
|
||||
|
||||
if (CollectionUtils.isNotEmpty(errorDataList)) {
|
||||
|
@ -3237,27 +3235,48 @@ public class ExportInHandler implements BaseHandler {
|
|||
return;
|
||||
}
|
||||
|
||||
errorDataList.addAll(item.getValue().stream().map(p -> {
|
||||
successDataList.addAll(item.getValue().stream().map(p -> {
|
||||
JSONObject o = JSONObject.from(p);
|
||||
o.put("status", "导入成功");
|
||||
o.put("status", "数据验证成功");
|
||||
return o;
|
||||
}).collect(Collectors.toList()));
|
||||
});
|
||||
|
||||
if (CollectionUtils.isNotEmpty(errorDataList)) {
|
||||
errorDataList.addAll(successDataList);
|
||||
return ResultUtil.failure(ErrorType.PARAMS_ERROR.id(), "导入失败", errorDataList);
|
||||
}
|
||||
|
||||
inMap.entrySet().forEach(item -> {
|
||||
String[] keys = StringUtils.split(item.getKey(), "#$#");
|
||||
String shipId = keys[0]; // 船名
|
||||
String voyageId = keys[1]; // 航次
|
||||
String billNo = keys[2]; // 提单号
|
||||
|
||||
// 查询出已存在的数据
|
||||
LambdaQueryWrapper<CustomerExportIn> cQuery = new LambdaQueryWrapper<>();
|
||||
cQuery.eq(CustomerExportIn::getShipId, shipId);
|
||||
cQuery.eq(CustomerExportIn::getVoyageId, voyageId);
|
||||
cQuery.eq(CustomerExportIn::getBillNum, billNo);
|
||||
|
||||
List<CustomerExportIn> exportInList = customerExportInService.list(cQuery);
|
||||
|
||||
// 单票件件,毛,体
|
||||
CustomerExportIn lastE = item.getValue().get(item.getValue().size() - 1); // 以最后一个为标准
|
||||
// 如果是备件自动生成条码
|
||||
// 过滤出是备件的
|
||||
item.getValue().stream().filter(ss -> StringUtils.equals(ss.getCartType(), "备件") && StringUtils.equals(ss.getNatureFlagName(), "正常")).forEach(ss -> {
|
||||
// 过滤出是备件
|
||||
item.getValue().stream().filter(ss -> StringUtils.equals(ss.getCartType(), "备件")).forEach(ss -> {
|
||||
// 判断是否是国际中转航次ID
|
||||
String vvyId = ss.getVoyageId();
|
||||
TransitPartRequest request = new TransitPartRequest();
|
||||
request.setVvyIds(Arrays.asList(vvyId));
|
||||
request.setPartAmount(ss.getQuantity());
|
||||
request.setMnfBl(ss.getBillNum());
|
||||
Map<String, List<TransitPartResp>> rst = openApi.getTransitPart(request);
|
||||
// Map<String, List<TransitPartResp>> rst = openApi.getTransitPart(request);
|
||||
|
||||
List<String> vins = new ArrayList<>(ss.getQuantity());
|
||||
if (MapUtils.isNotEmpty(rst) && CollectionUtils.isNotEmpty(rst.get(vvyId))) { // 需要自动生成
|
||||
vins.addAll(rst.get(vvyId).stream().map(t -> t.getVinCode()).collect(Collectors.toList()));
|
||||
} else {
|
||||
List<String> vins = new ArrayList<>();
|
||||
if (StringUtils.equals(ss.getNatureFlagName(), "正常")) { // 需要自动生成
|
||||
// vins.addAll(rst.get(vvyId).stream().map(t -> t.getVinCode()).collect(Collectors.toList()));
|
||||
// 出口进场计划备件条码生成的规则要变一下,BJ+年月日时分+5随机数,一共要17位
|
||||
String prefix = StringUtils.join("BJ", DateUtil.format(new Date(), "yyMMddHHmm"));
|
||||
do {
|
||||
|
@ -3474,4 +3493,8 @@ public class ExportInHandler implements BaseHandler {
|
|||
|
||||
});
|
||||
}
|
||||
|
||||
private void syncAddExportInToOld(List<CustomerExportIn> list) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1729,7 +1729,10 @@ public class ExportLoadHandler implements BaseHandler {
|
|||
exportLoad.setPortArea(item.getValue().get(0).getPortArea());
|
||||
exportLoad.setContact(item.getValue().get(0).getContact());
|
||||
exportLoad.setContactPhone(item.getValue().get(0).getContactPhone());
|
||||
exportLoad.setNatureFlagName(item.getValue().get(0).getNatureFlagName());
|
||||
exportLoad.setNatureFlag(goodsNature.stream().filter(p -> StringUtils.equalsIgnoreCase(p.getPtrDesc(), item.getValue().get(0).getNatureFlagName())).findFirst().get().getPtrCode());
|
||||
exportLoad.setTransferVoyage(item.getValue().get(0).getTransferVoyage());
|
||||
exportLoad.setTransferShipName(item.getValue().get(0).getTransferShipName());
|
||||
if (!StringUtils.equals(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());
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.alibaba.excel.write.metadata.WriteSheet;
|
|||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.NuzarMiniApi;
|
||||
|
@ -107,6 +108,23 @@ public class FreeTradeHandler implements BaseHandler {
|
|||
return ResultUtil.success(page);
|
||||
}
|
||||
|
||||
@ApiOperation("总价,总净重查询")
|
||||
@PostMapping("/query/sum")
|
||||
public Result<Map<String, Object>> checkQuerySum(@RequestBody FreeTradeQuery query) {
|
||||
if (query.getEndCreateDate() != null) {
|
||||
query.setEndCreateDate(DateUtils.getDayEnd(query.getEndCreateDate()));
|
||||
}
|
||||
if (query.getCheckStatus() == null) {
|
||||
query.setCheckStatusList(Arrays.asList(AuditEnum.SUBMIT, AuditEnum.AUDIT, AuditEnum.AUDIT_PASS, AuditEnum.AUDIT_REJECT));
|
||||
}
|
||||
query.setSorts(null);
|
||||
QueryWrapper<CustomerFreeTrade> queryWrapper = (QueryWrapper)new WrapperKit() {
|
||||
}.changeBaseQueryToWrapper(CustomerFreeTrade.class, query);
|
||||
queryWrapper.select("sum(total_price) as total_price, sum(net_weight) as net_weight");
|
||||
Map<String, Object> map = customerFreeTradeService.getMap(queryWrapper);
|
||||
return ResultUtil.success(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
|
|
|
@ -1,13 +1,17 @@
|
|||
package com.haitonggauto.rtosc.handler.mapper;
|
||||
|
||||
import com.haitonggauto.rtosc.api.dto.OldExportInAddReq;
|
||||
import com.haitonggauto.rtosc.api.dto.log.ImportInspectLog;
|
||||
import com.haitonggauto.rtosc.excel.*;
|
||||
import com.haitonggauto.rtosc.repository.entity.*;
|
||||
import com.haitonggauto.rtosc.dto.*;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Mapper
|
||||
public interface PoMapper {
|
||||
PoMapper instance = Mappers.getMapper(PoMapper.class);
|
||||
|
@ -98,4 +102,36 @@ public interface PoMapper {
|
|||
@Mapping(source = "cargo.vin", target = "vin")
|
||||
@Mapping(source = "head.company", target = "company")
|
||||
ExportInspectExportExcel inspectEntity2ExportExcel(CustomerExportInspect head, CustomerExportInspectCargo cargo);
|
||||
|
||||
@Mapping(source = "id", target = "nsId")
|
||||
// @Mapping(source = "head.company", target = "vlsNm")
|
||||
// @Mapping(source = "head.company", target = "vvyNm")
|
||||
// @Mapping(source = "head.company", target = "cstNm")
|
||||
// @Mapping(source = "head.company", target = "brdNm")
|
||||
// @Mapping(source = "head.company", target = "mdlNm")
|
||||
// @Mapping(source = "head.company", target = "length")
|
||||
// @Mapping(source = "head.company", target = "width")
|
||||
// @Mapping(source = "head.company", target = "height")
|
||||
// @Mapping(source = "head.company", target = "volume")
|
||||
// @Mapping(source = "head.company", target = "weight")
|
||||
// @Mapping(source = "head.company", target = "ctnNm")
|
||||
// @Mapping(source = "head.company", target = "potNm")
|
||||
// @Mapping(source = "head.company", target = "carNum")
|
||||
// @Mapping(source = "head.company", target = "partNum")
|
||||
// @Mapping(source = "head.company", target = "mnfBl")
|
||||
// @Mapping(source = "head.company", target = "mnfNum")
|
||||
// @Mapping(source = "head.company", target = "mnfWeight")
|
||||
// @Mapping(source = "head.company", target = "mnfVolume")
|
||||
// @Mapping(source = "head.company", target = "godType")
|
||||
// @Mapping(source = "head.company", target = "godDtlType")
|
||||
// @Mapping(source = "head.company", target = "remark")
|
||||
// @Mapping(source = "head.company", target = "transType")
|
||||
// @Mapping(source = "head.company", target = "person")
|
||||
// @Mapping(source = "head.company", target = "carOpMode")
|
||||
// @Mapping(source = "head.company", target = "partOpMode")
|
||||
// @Mapping(source = "head.company", target = "specWork")
|
||||
// @Mapping(source = "head.company", target = "inStartTm")
|
||||
// @Mapping(source = "head.company", target = "inEndTm")
|
||||
// @Mapping(source = "head.company", target = "personTel")
|
||||
OldExportInAddReq exportIn2OldExportInAddReq(CustomerExportIn exportIn);
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -32,6 +32,9 @@ public class CustomerDeparturePlan extends BaseEntity implements Serializable {
|
|||
@ApiModelProperty(value = "计划提货时间")
|
||||
private Date pickTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String pickTimeStr;
|
||||
|
||||
/**
|
||||
* 品牌ID
|
||||
*/
|
||||
|
|
|
@ -71,6 +71,12 @@
|
|||
<result property="shipName" column="ship_name" jdbcType="VARCHAR"/>
|
||||
<result property="voyage" column="voyage" jdbcType="VARCHAR"/>
|
||||
<result property="portArea" column="port_area" jdbcType="VARCHAR"/>
|
||||
<result property="natureFlag" column="nature_flag" jdbcType="VARCHAR"/>
|
||||
<result property="natureFlagName" column="nature_flag_name" jdbcType="VARCHAR"/>
|
||||
<result property="transferShipId" column="transfer_ship_id" jdbcType="VARCHAR"/>
|
||||
<result property="transferShipName" column="transfer_ship_name" jdbcType="VARCHAR"/>
|
||||
<result property="transferVoyageId" column="transfer_voyage_id" jdbcType="VARCHAR"/>
|
||||
<result property="transferVoyage" column="transfer_voyage" jdbcType="VARCHAR"/>
|
||||
<result property="contact" column="contact" jdbcType="VARCHAR"/>
|
||||
<result property="contactPhone" column="contact_phone" jdbcType="VARCHAR"/>
|
||||
<result property="countryId" column="country_id" jdbcType="VARCHAR"/>
|
||||
|
|
|
@ -37,6 +37,12 @@
|
|||
<result property="batchNo" column="batch_no" jdbcType="VARCHAR"/>
|
||||
<result property="shipName" column="ship_name" jdbcType="VARCHAR"/>
|
||||
<result property="voyage" column="voyage" jdbcType="VARCHAR"/>
|
||||
<result property="natureFlag" column="nature_flag" jdbcType="VARCHAR"/>
|
||||
<result property="natureFlagName" column="nature_flag_name" jdbcType="VARCHAR"/>
|
||||
<result property="transferShipId" column="transfer_ship_id" jdbcType="VARCHAR"/>
|
||||
<result property="transferShipName" column="transfer_ship_name" jdbcType="VARCHAR"/>
|
||||
<result property="transferVoyageId" column="transfer_voyage_id" jdbcType="VARCHAR"/>
|
||||
<result property="transferVoyage" column="transfer_voyage" jdbcType="VARCHAR"/>
|
||||
<result property="billNo" column="bill_no" jdbcType="VARCHAR"/>
|
||||
<result property="brandId" column="brand_id" jdbcType="VARCHAR"/>
|
||||
<result property="brand" column="brand" jdbcType="VARCHAR"/>
|
||||
|
|
Loading…
Reference in New Issue