Merge pull request 'develop' (#264) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/264
This commit is contained in:
commit
9a49e35a0d
@ -1,10 +1,10 @@
|
||||
/**
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisTmsSiteBatchMapper.java
|
||||
* @author linfso
|
||||
* @date 2024-03-01 08:54:56
|
||||
* @Copyright: ShangHai Doitinfo 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @version v1.0
|
||||
* @Description: <p> 一级网点TMS组批次 Mapper 接口 </p>
|
||||
* <span style='color:red'> Warning : This file is generate by ai tools,don't edit!!! </span>
|
||||
*/
|
||||
@ -29,13 +29,13 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
|
||||
/**
|
||||
* 主键查询
|
||||
* @param id
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
public EmisTmsSiteBatch selectEmisTmsSiteBatchById(Long id);
|
||||
|
||||
/**
|
||||
* 主键查询(包含明细和装载信息)
|
||||
*
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ -48,8 +48,8 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param emisTmsSiteBatch
|
||||
*
|
||||
* @param emisTmsSiteBatch
|
||||
* @return 集合
|
||||
*/
|
||||
public List<EmisTmsSiteBatch> selectEmisTmsSiteBatchList(EmisTmsSiteBatch emisTmsSiteBatch);
|
||||
@ -64,25 +64,25 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
|
||||
public List<EmisTmsSiteBatch> selectWaitDoProfitList(EmisTmsSiteBatch emisTmsSiteBatch);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* 新增
|
||||
*
|
||||
* @param emisTmsSiteBatch
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
public int insertEmisTmsSiteBatch(EmisTmsSiteBatch emisTmsSiteBatch);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param emisTmsSiteBatch
|
||||
* @return
|
||||
*
|
||||
* @param emisTmsSiteBatch
|
||||
* @return
|
||||
*/
|
||||
@DataAuditLog(operateType= OperateType.UPDATE,serviceClass= EmisTmsSiteBatchServiceImpl.class)
|
||||
public int updateEmisTmsSiteBatch(EmisTmsSiteBatch emisTmsSiteBatch);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 结果
|
||||
*/
|
||||
@ -90,7 +90,7 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
@ -119,7 +119,7 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
|
||||
|
||||
/**
|
||||
* 根据运单号列表查询组批次信息
|
||||
*
|
||||
*
|
||||
* @param billCodes 运单号列表
|
||||
* @return 组批次信息列表
|
||||
*/
|
||||
@ -130,13 +130,16 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
|
||||
*
|
||||
* @param startSiteCode 起始网点编码
|
||||
* @param nextSiteCode 下一网点编码
|
||||
* @param carNo 运输号
|
||||
* @param billCode 运单号
|
||||
* @param id
|
||||
* @return TMS组批次列表
|
||||
*/
|
||||
List<EmisTmsSiteBatch> selectTmsSiteBatchBySiteAndBillCode(@Param("startSiteCode") String startSiteCode,
|
||||
List<EmisTmsSiteBatch> selectTmsSiteBatchBySiteAndBillCode(
|
||||
@Param("startSiteCode") String startSiteCode,
|
||||
@Param("nextSiteCode") String nextSiteCode,
|
||||
@Param("billCode") String billCode, @Param("id")Long id);
|
||||
@Param("carNo") String carNo,
|
||||
@Param("billCode") String billCode, @Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 验重
|
||||
|
||||
@ -46,12 +46,14 @@ public interface IEmisTmsSiteBatchService extends IDataAuditService
|
||||
*
|
||||
* @param startSiteCode 起始网点编码
|
||||
* @param nextSiteCode 下一网点编码
|
||||
* @param carNo
|
||||
* @param billCode 运单号
|
||||
* @param id
|
||||
* @return TMS组批次列表
|
||||
*/
|
||||
public List<EmisTmsSiteBatch> selectTmsSiteBatchBySiteAndBillCode(String startSiteCode, String nextSiteCode,
|
||||
String billCode, Long id);
|
||||
public List<EmisTmsSiteBatch> selectTmsSiteBatchBySiteAndBillCode(
|
||||
String startSiteCode, String nextSiteCode,
|
||||
String carNo, String billCode, Long id);
|
||||
|
||||
/**
|
||||
* 查询一级网点TMS组批次列表
|
||||
|
||||
@ -21,8 +21,13 @@ import cn.hutool.core.map.MapUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.alibaba.excel.write.handler.AbstractCellWriteHandler;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.Head;
|
||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.alibaba.excel.write.metadata.WriteTable;
|
||||
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
|
||||
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
|
||||
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
|
||||
import com.alibaba.excel.write.metadata.style.WriteFont;
|
||||
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
|
||||
@ -46,8 +51,11 @@ import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.BorderStyle;
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.poi.ss.usermodel.FillPatternType;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xdadan.erp.emis.service.IEmisSettleBillService;
|
||||
@ -1245,6 +1253,8 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
|
||||
|
||||
// 结算对象
|
||||
String settlement = Optional.ofNullable(list.get(0)).map(e -> StringUtil.isNotBlank(e.getCustName()) ? e.getCustName() : e.getCustomerName()).orElse("");
|
||||
settlement = Optional.ofNullable(settlement).orElse("").replace("ST", "");
|
||||
final String settlementDisplay = settlement;
|
||||
|
||||
// 根据运单号查询运单详情
|
||||
List<EmisWaybillAndFeeitem> emisWaybills = emisSettleSubBillFeeitemMapper
|
||||
@ -1303,36 +1313,106 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
|
||||
|
||||
ExcelWriter excelWriter = EasyExcel.write(outputStream).excelType(ExcelTypeEnum.XLSX).build();
|
||||
List<List<String>> contentHeader = this.buildHeader();
|
||||
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(null,
|
||||
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
|
||||
headWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
|
||||
AbstractCellWriteHandler headerStyleHandler = new AbstractCellWriteHandler() {
|
||||
@Override
|
||||
public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder,
|
||||
List<WriteCellData<?>> cellDataList, Cell cell, Head head,
|
||||
Integer relativeRowIndex, Boolean isHead) {
|
||||
if (!Boolean.TRUE.equals(isHead)) {
|
||||
return;
|
||||
}
|
||||
int rowIndex = cell.getRowIndex();
|
||||
WriteCellStyle style = cellDataList.get(0).getOrCreateStyle();
|
||||
WriteFont font = style.getWriteFont();
|
||||
if (font == null) {
|
||||
font = new WriteFont();
|
||||
style.setWriteFont(font);
|
||||
}
|
||||
switch (rowIndex) {
|
||||
case 0:
|
||||
font.setFontHeightInPoints((short) 8);
|
||||
font.setBold(Boolean.FALSE);
|
||||
font.setColor(IndexedColors.BLACK.getIndex());
|
||||
style.setHorizontalAlignment(HorizontalAlignment.LEFT);
|
||||
break;
|
||||
case 1:
|
||||
font.setFontHeightInPoints((short) 14);
|
||||
font.setBold(Boolean.FALSE);
|
||||
font.setColor(IndexedColors.BLACK.getIndex());
|
||||
style.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
break;
|
||||
case 3:
|
||||
font.setFontHeightInPoints((short) 12);
|
||||
font.setBold(Boolean.TRUE);
|
||||
font.setColor(IndexedColors.RED.getIndex());
|
||||
style.setFillForegroundColor(IndexedColors.WHITE.getIndex());
|
||||
style.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
|
||||
style.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
cellDataList.get(0).setWriteCellStyle(style);
|
||||
}
|
||||
};
|
||||
|
||||
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,
|
||||
contentWriteCellStyle);
|
||||
// 样式:日期行单独,后续保持原样
|
||||
WriteCellStyle dateContentStyle = new WriteCellStyle();
|
||||
dateContentStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
dateContentStyle.setHorizontalAlignment(HorizontalAlignment.LEFT);
|
||||
dateContentStyle.setBorderLeft(BorderStyle.THIN);
|
||||
dateContentStyle.setBorderRight(BorderStyle.THIN);
|
||||
dateContentStyle.setBorderTop(BorderStyle.THIN);
|
||||
dateContentStyle.setBorderBottom(BorderStyle.THIN);
|
||||
WriteFont dateFont = new WriteFont();
|
||||
dateFont.setFontName("微软雅黑");
|
||||
dateFont.setFontHeightInPoints((short) 8);
|
||||
dateContentStyle.setWriteFont(dateFont);
|
||||
|
||||
// 日期行:单独写入并使用独立样式,按列头数量合并
|
||||
WriteSheet dateSheet = EasyExcel.writerSheet("sheet").needHead(Boolean.FALSE)
|
||||
.registerWriteHandler(new HorizontalCellStyleStrategy(null, dateContentStyle))
|
||||
.registerWriteHandler(headerStyleHandler)
|
||||
.registerWriteHandler(new CellStyleStrategy(new WriteCellStyle())).build();
|
||||
List<List<String>> headerDate = contentHeader.stream()
|
||||
.map(item -> Collections.singletonList("出账日期:" + date))
|
||||
.collect(Collectors.toList());
|
||||
WriteTable tDate = EasyExcel.writerTable(0).needHead(Boolean.TRUE).head(headerDate).build();
|
||||
excelWriter.write((Collection<?>) null, dateSheet, tDate);
|
||||
|
||||
// 构建大表头
|
||||
WriteSheet writeSheet1 = EasyExcel.writerSheet("sheet").needHead(Boolean.FALSE)
|
||||
.registerWriteHandler(horizontalCellStyleStrategy)
|
||||
.registerWriteHandler(headerStyleHandler)
|
||||
.registerWriteHandler(new CellStyleStrategy(new WriteCellStyle())).build();
|
||||
|
||||
List<List<String>> header1 = contentHeader.stream().map(item -> Collections.singletonList("探路供应链(上海)"))
|
||||
.collect(Collectors.toList());
|
||||
WriteTable t1 = EasyExcel.writerTable(0).needHead(Boolean.TRUE).head(header1).build();
|
||||
WriteTable t1 = EasyExcel.writerTable(1).needHead(Boolean.TRUE).head(header1).build();
|
||||
excelWriter.write((Collection<?>) null, writeSheet1, t1);
|
||||
|
||||
List<List<String>> header2 = contentHeader.stream()
|
||||
.map(item -> Collections.singletonList(year + "年" + month + "月海运费确认书"))
|
||||
.collect(Collectors.toList());
|
||||
WriteTable t2 = EasyExcel.writerTable(1).needHead(Boolean.TRUE).head(header2).build();
|
||||
WriteTable t2 = EasyExcel.writerTable(2).needHead(Boolean.TRUE).head(header2).build();
|
||||
excelWriter.write((Collection<?>) null, writeSheet1, t2);
|
||||
|
||||
List<List<String>> header3 = contentHeader.stream()
|
||||
.map(item -> Collections.singletonList("结算对象:" + settlement))
|
||||
.map(item -> Collections.singletonList("结算对象:" + settlementDisplay))
|
||||
.collect(Collectors.toList());
|
||||
header3.set(9, Collections.singletonList("出账日期:" + date));
|
||||
header3.set(10, Collections.singletonList("出账日期:" + date));
|
||||
header3.set(11, Collections.singletonList("出账日期:" + date));
|
||||
WriteTable t3 = EasyExcel.writerTable(2).needHead(Boolean.TRUE).head(header3).build();
|
||||
WriteTable t3 = EasyExcel.writerTable(3).needHead(Boolean.TRUE).head(header3).build();
|
||||
excelWriter.write((Collection<?>) null, writeSheet1, t3);
|
||||
|
||||
log.info("Building a large header is success");
|
||||
|
||||
List<String> excelKey = emisWaybillMap.keySet().stream().collect(Collectors.toList());
|
||||
int num = 3;
|
||||
int num = 4;
|
||||
for (int i = 0; i < excelKey.size(); i++) {
|
||||
List<List<String>> result = new ArrayList<>();
|
||||
Map<String, Object> subtotalMap = new HashMap<>();
|
||||
@ -1341,6 +1421,7 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
|
||||
List<EmisSettleSubBillFeeitem> settleSubBillFeeitemList = emisWaybill.getSettleSubBillFeeitemList();
|
||||
calculateSubtotal(settleSubBillFeeitemList, subtotalMap);
|
||||
settleSubBillFeeitemList.forEach(item -> {
|
||||
String remark = Optional.ofNullable(item.getRemark()).orElse("");
|
||||
result.add(Lists.newArrayList(emisWaybill.getLadingBillCode(), emisWaybill.getBillCode(),
|
||||
emisWaybill.getCompanyCode(), emisWaybill.getDeparturePortName(),
|
||||
emisWaybill.getDestinationPortName(), emisWaybill.getBoxQuantity(),
|
||||
@ -1348,7 +1429,8 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
|
||||
emisWaybill.getBillWeight().stripTrailingZeros().toPlainString(),
|
||||
emisWaybill.getTotalVolume().stripTrailingZeros().toPlainString(),
|
||||
item.getFeeName(), item.getCurrency(),
|
||||
item.getBillFee().stripTrailingZeros().toPlainString()));
|
||||
item.getBillFee().stripTrailingZeros().toPlainString(),
|
||||
remark));
|
||||
});
|
||||
// 小表头
|
||||
WriteSheet sheet = EasyExcel.writerSheet("sheet")
|
||||
@ -1416,6 +1498,7 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
|
||||
header.add(Collections.singletonList("费用名称"));
|
||||
header.add(Collections.singletonList("币种"));
|
||||
header.add(Collections.singletonList("金额"));
|
||||
header.add(Collections.singletonList("备注"));
|
||||
return header;
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
/**
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisTmsSiteBatchDtlServiceImpl.java
|
||||
* @author linfso
|
||||
* @date 2024-03-01 08:54:57
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @version v1.0
|
||||
* @Description: <p> 一级网点TMS组批次明细 实体类 </p>
|
||||
*/
|
||||
|
||||
@ -34,7 +34,7 @@ import com.xdadan.erp.emis.service.IEmisTmsSiteBatchDtlService;
|
||||
|
||||
/**
|
||||
* 一级网点TMS组批次明细Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author linfso
|
||||
* @date 2024-03-01 08:54:57
|
||||
*/
|
||||
@ -57,7 +57,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
||||
|
||||
/**
|
||||
* 查询一级网点TMS组批次明细
|
||||
*
|
||||
*
|
||||
* @param id 一级网点TMS组批次明细主键
|
||||
* @return 一级网点TMS组批次明细
|
||||
*/
|
||||
@ -68,7 +68,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
||||
|
||||
/**
|
||||
* 查询一级网点TMS组批次明细列表
|
||||
*
|
||||
*
|
||||
* @param emisTmsSiteBatchDtl 一级网点TMS组批次明细
|
||||
* @return 一级网点TMS组批次明细
|
||||
*/
|
||||
@ -93,7 +93,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
||||
|
||||
/**
|
||||
* 新增一级网点TMS组批次明细
|
||||
*
|
||||
*
|
||||
* @param emisTmsSiteBatchDtl 一级网点TMS组批次明细
|
||||
* @return 结果
|
||||
*/
|
||||
@ -107,7 +107,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
||||
|
||||
/**
|
||||
* 修改一级网点TMS组批次明细
|
||||
*
|
||||
*
|
||||
* @param emisTmsSiteBatchDtl 一级网点TMS组批次明细
|
||||
* @return 结果
|
||||
*/
|
||||
@ -118,7 +118,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
||||
|
||||
/**
|
||||
* 批量删除一级网点TMS组批次明细
|
||||
*
|
||||
*
|
||||
* @param ids 需要删除的一级网点TMS组批次明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@ -129,7 +129,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
||||
|
||||
/**
|
||||
* 删除一级网点TMS组批次明细信息
|
||||
*
|
||||
*
|
||||
* @param id 一级网点TMS组批次明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@ -149,6 +149,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
||||
String batchNo = emisTmsSiteBatchDtl.getBatchNo();
|
||||
String startSiteCode = (String) emisTmsSiteBatchDtl.getParams().get("startSiteCode");
|
||||
String nextSiteCode = (String) emisTmsSiteBatchDtl.getParams().get("nextSiteCode");
|
||||
String carNo = (String) emisTmsSiteBatchDtl.getParams().get("carNo");
|
||||
String supplierCode = (String) emisTmsSiteBatchDtl.getParams().get("supplierCode");
|
||||
|
||||
// 参数校验
|
||||
@ -161,6 +162,9 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
||||
if (StringUtils.isBlank(nextSiteCode)) {
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL, "下一网点编码不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(carNo)) {
|
||||
throw new EmisBizError(EmisBizErrorType.FAIL, "运输号不能为空");
|
||||
}
|
||||
|
||||
// 查询运单信息
|
||||
EmisWaybill emisWaybill = emisWaybillMapper.selectEmisWaybillByBillCode(billCode);
|
||||
@ -200,6 +204,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
||||
List<EmisTmsSiteBatch> existingBatches = emisTmsSiteBatchMapper.selectTmsSiteBatchBySiteAndBillCode(
|
||||
startSiteCode,
|
||||
nextSiteCode,
|
||||
carNo,
|
||||
billCode,
|
||||
null);
|
||||
|
||||
@ -229,22 +234,22 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
||||
boolean hasMatchingSupplier = existingBatches.stream()
|
||||
.anyMatch(batch -> supplierCodeList.contains(batch.getSupplierCode()));
|
||||
|
||||
if (hasMatchingSupplier) {
|
||||
// 找到匹配的批次,检查重量、体积、件数是否一致
|
||||
EmisTmsSiteBatch matchingBatch = existingBatches.stream()
|
||||
.filter(batch -> supplierCodeList.contains(batch.getSupplierCode()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (Objects.nonNull(matchingBatch)) {
|
||||
result.setBatchParcelQty(
|
||||
matchingBatch.getTotalParcelQty() != null ? matchingBatch.getTotalParcelQty() : 0);
|
||||
result.setBatchWeight(
|
||||
matchingBatch.getTotalWeight() != null ? matchingBatch.getTotalWeight() : BigDecimal.ZERO);
|
||||
result.setBatchVolume(
|
||||
matchingBatch.getTotalVolume() != null ? matchingBatch.getTotalVolume() : BigDecimal.ZERO);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
// if (hasMatchingSupplier) {
|
||||
// // 找到匹配的批次,检查重量、体积、件数是否一致
|
||||
// EmisTmsSiteBatch matchingBatch = existingBatches.stream()
|
||||
// .filter(batch -> supplierCodeList.contains(batch.getSupplierCode()))
|
||||
// .findFirst()
|
||||
// .orElse(null);
|
||||
// if (Objects.nonNull(matchingBatch)) {
|
||||
// result.setBatchParcelQty(
|
||||
// matchingBatch.getTotalParcelQty() != null ? matchingBatch.getTotalParcelQty() : 0);
|
||||
// result.setBatchWeight(
|
||||
// matchingBatch.getTotalWeight() != null ? matchingBatch.getTotalWeight() : BigDecimal.ZERO);
|
||||
// result.setBatchVolume(
|
||||
// matchingBatch.getTotalVolume() != null ? matchingBatch.getTotalVolume() : BigDecimal.ZERO);
|
||||
// return result;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// 先过滤出包含多个供应商编码的rules
|
||||
|
||||
@ -111,8 +111,8 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi
|
||||
|
||||
@Override
|
||||
public List<EmisTmsSiteBatch> selectTmsSiteBatchBySiteAndBillCode(String startSiteCode, String nextSiteCode,
|
||||
String billCode, Long id) {
|
||||
return emisTmsSiteBatchMapper.selectTmsSiteBatchBySiteAndBillCode(startSiteCode, nextSiteCode, billCode, id);
|
||||
String carNo, String billCode, Long id) {
|
||||
return emisTmsSiteBatchMapper.selectTmsSiteBatchBySiteAndBillCode(startSiteCode, nextSiteCode, carNo, billCode, id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -209,6 +209,7 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi
|
||||
List<EmisTmsSiteBatch> existingBatches = selectTmsSiteBatchBySiteAndBillCode(
|
||||
oldSiteBatch.getStartSiteCode(),
|
||||
oldSiteBatch.getNextSiteCode(),
|
||||
oldSiteBatch.getCarNo(),
|
||||
itemDtl.getBillCode(), itemDtl.getId());
|
||||
if (itemDtl.getId() != null) {
|
||||
existingBatches = existingBatches.stream().filter(i -> !itemDtl.getBatchNo().equals(i.getBatchNo()))
|
||||
|
||||
@ -41,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="origFee" column="orig_fee"/>
|
||||
<result property="currency" column="currency"/>
|
||||
<result property="orderNum" column="order_num"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmisSettleSubBillFeeitemVo">
|
||||
@ -66,7 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
b.bill_fee,
|
||||
b.orig_fee,
|
||||
b.currency,
|
||||
b.order_num
|
||||
b.order_num,
|
||||
b.remark
|
||||
from emis_waybill a
|
||||
left join emis_settle_sub_bill_feeitem b on a.bill_code = b.bill_code and b.del_flag = '0'
|
||||
left join emis_site seaway1 on a.departure_port=seaway1.site_code and seaway1.del_flag='0'
|
||||
|
||||
@ -333,6 +333,9 @@
|
||||
and start_site_code = #{startSiteCode}
|
||||
and next_site_code = #{nextSiteCode}
|
||||
and supplier_code=#{supplierCode}
|
||||
<if test="carNo != null and carNo != ''">
|
||||
and car_no = #{carNo}
|
||||
</if>
|
||||
and batch_no in (select batch_no from emis_tms_site_batch_dtl where del_flag='0'
|
||||
and FIND_IN_SET(`bill_code`
|
||||
, #{params.billCode}) )
|
||||
@ -574,10 +577,13 @@
|
||||
left join emis_waybill w on d.bill_code = w.bill_code and w.del_flag = '0'
|
||||
where b.start_site_code = #{startSiteCode}
|
||||
and b.next_site_code = #{nextSiteCode}
|
||||
<if test="carNo != null and carNo != ''">
|
||||
and b.car_no = #{carNo}
|
||||
</if>
|
||||
and d.bill_code = #{billCode}
|
||||
and b.del_flag = '0'
|
||||
and d.del_flag = '0'
|
||||
and d.waybill_batch_status != '2'
|
||||
-- and d.waybill_batch_status != '2'
|
||||
<if test="id != null">AND d.id != #{id}</if>
|
||||
group by b.id, b.batch_no, b.batch_name, b.batch_date, b.supplier_code, b.trans_line_type,
|
||||
b.product_type, b.batch_type, b.trans_type, b.start_site_code, b.send_country,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user