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
|
* @Project: emis
|
||||||
* @Title: EmisTmsSiteBatchMapper.java
|
* @Title: EmisTmsSiteBatchMapper.java
|
||||||
* @author linfso
|
* @author linfso
|
||||||
* @date 2024-03-01 08:54:56
|
* @date 2024-03-01 08:54:56
|
||||||
* @Copyright: ShangHai Doitinfo 2022 All rights reserved.
|
* @Copyright: ShangHai Doitinfo 2022 All rights reserved.
|
||||||
* @version v1.0
|
* @version v1.0
|
||||||
* @Description: <p> 一级网点TMS组批次 Mapper 接口 </p>
|
* @Description: <p> 一级网点TMS组批次 Mapper 接口 </p>
|
||||||
* <span style='color:red'> Warning : This file is generate by ai tools,don't edit!!! </span>
|
* <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
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public EmisTmsSiteBatch selectEmisTmsSiteBatchById(Long id);
|
public EmisTmsSiteBatch selectEmisTmsSiteBatchById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键查询(包含明细和装载信息)
|
* 主键查询(包含明细和装载信息)
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -48,8 +48,8 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询列表
|
* 查询列表
|
||||||
*
|
*
|
||||||
* @param emisTmsSiteBatch
|
* @param emisTmsSiteBatch
|
||||||
* @return 集合
|
* @return 集合
|
||||||
*/
|
*/
|
||||||
public List<EmisTmsSiteBatch> selectEmisTmsSiteBatchList(EmisTmsSiteBatch emisTmsSiteBatch);
|
public List<EmisTmsSiteBatch> selectEmisTmsSiteBatchList(EmisTmsSiteBatch emisTmsSiteBatch);
|
||||||
@ -64,25 +64,25 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
|
|||||||
public List<EmisTmsSiteBatch> selectWaitDoProfitList(EmisTmsSiteBatch emisTmsSiteBatch);
|
public List<EmisTmsSiteBatch> selectWaitDoProfitList(EmisTmsSiteBatch emisTmsSiteBatch);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*
|
*
|
||||||
* @param emisTmsSiteBatch
|
* @param emisTmsSiteBatch
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int insertEmisTmsSiteBatch(EmisTmsSiteBatch emisTmsSiteBatch);
|
public int insertEmisTmsSiteBatch(EmisTmsSiteBatch emisTmsSiteBatch);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
*
|
*
|
||||||
* @param emisTmsSiteBatch
|
* @param emisTmsSiteBatch
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@DataAuditLog(operateType= OperateType.UPDATE,serviceClass= EmisTmsSiteBatchServiceImpl.class)
|
@DataAuditLog(operateType= OperateType.UPDATE,serviceClass= EmisTmsSiteBatchServiceImpl.class)
|
||||||
public int updateEmisTmsSiteBatch(EmisTmsSiteBatch emisTmsSiteBatch);
|
public int updateEmisTmsSiteBatch(EmisTmsSiteBatch emisTmsSiteBatch);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*
|
*
|
||||||
* @param id 主键
|
* @param id 主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -90,7 +90,7 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除
|
* 批量删除
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的数据主键集合
|
* @param ids 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -119,7 +119,7 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据运单号列表查询组批次信息
|
* 根据运单号列表查询组批次信息
|
||||||
*
|
*
|
||||||
* @param billCodes 运单号列表
|
* @param billCodes 运单号列表
|
||||||
* @return 组批次信息列表
|
* @return 组批次信息列表
|
||||||
*/
|
*/
|
||||||
@ -130,13 +130,16 @@ public interface EmisTmsSiteBatchMapper extends BaseMapper<EmisTmsSiteBatch>
|
|||||||
*
|
*
|
||||||
* @param startSiteCode 起始网点编码
|
* @param startSiteCode 起始网点编码
|
||||||
* @param nextSiteCode 下一网点编码
|
* @param nextSiteCode 下一网点编码
|
||||||
|
* @param carNo 运输号
|
||||||
* @param billCode 运单号
|
* @param billCode 运单号
|
||||||
* @param id
|
* @param id
|
||||||
* @return TMS组批次列表
|
* @return TMS组批次列表
|
||||||
*/
|
*/
|
||||||
List<EmisTmsSiteBatch> selectTmsSiteBatchBySiteAndBillCode(@Param("startSiteCode") String startSiteCode,
|
List<EmisTmsSiteBatch> selectTmsSiteBatchBySiteAndBillCode(
|
||||||
|
@Param("startSiteCode") String startSiteCode,
|
||||||
@Param("nextSiteCode") String nextSiteCode,
|
@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 startSiteCode 起始网点编码
|
||||||
* @param nextSiteCode 下一网点编码
|
* @param nextSiteCode 下一网点编码
|
||||||
|
* @param carNo
|
||||||
* @param billCode 运单号
|
* @param billCode 运单号
|
||||||
* @param id
|
* @param id
|
||||||
* @return TMS组批次列表
|
* @return TMS组批次列表
|
||||||
*/
|
*/
|
||||||
public List<EmisTmsSiteBatch> selectTmsSiteBatchBySiteAndBillCode(String startSiteCode, String nextSiteCode,
|
public List<EmisTmsSiteBatch> selectTmsSiteBatchBySiteAndBillCode(
|
||||||
String billCode, Long id);
|
String startSiteCode, String nextSiteCode,
|
||||||
|
String carNo, String billCode, Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询一级网点TMS组批次列表
|
* 查询一级网点TMS组批次列表
|
||||||
|
|||||||
@ -21,8 +21,13 @@ import cn.hutool.core.map.MapUtil;
|
|||||||
import com.alibaba.excel.EasyExcel;
|
import com.alibaba.excel.EasyExcel;
|
||||||
import com.alibaba.excel.ExcelWriter;
|
import com.alibaba.excel.ExcelWriter;
|
||||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
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.WriteSheet;
|
||||||
import com.alibaba.excel.write.metadata.WriteTable;
|
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.WriteCellStyle;
|
||||||
import com.alibaba.excel.write.metadata.style.WriteFont;
|
import com.alibaba.excel.write.metadata.style.WriteFont;
|
||||||
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
|
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.collections.MapUtils;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
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.IndexedColors;
|
||||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.xdadan.erp.emis.service.IEmisSettleBillService;
|
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("");
|
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
|
List<EmisWaybillAndFeeitem> emisWaybills = emisSettleSubBillFeeitemMapper
|
||||||
@ -1303,36 +1313,106 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
|
|||||||
|
|
||||||
ExcelWriter excelWriter = EasyExcel.write(outputStream).excelType(ExcelTypeEnum.XLSX).build();
|
ExcelWriter excelWriter = EasyExcel.write(outputStream).excelType(ExcelTypeEnum.XLSX).build();
|
||||||
List<List<String>> contentHeader = this.buildHeader();
|
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);
|
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)
|
WriteSheet writeSheet1 = EasyExcel.writerSheet("sheet").needHead(Boolean.FALSE)
|
||||||
.registerWriteHandler(horizontalCellStyleStrategy)
|
.registerWriteHandler(horizontalCellStyleStrategy)
|
||||||
|
.registerWriteHandler(headerStyleHandler)
|
||||||
.registerWriteHandler(new CellStyleStrategy(new WriteCellStyle())).build();
|
.registerWriteHandler(new CellStyleStrategy(new WriteCellStyle())).build();
|
||||||
|
|
||||||
List<List<String>> header1 = contentHeader.stream().map(item -> Collections.singletonList("探路供应链(上海)"))
|
List<List<String>> header1 = contentHeader.stream().map(item -> Collections.singletonList("探路供应链(上海)"))
|
||||||
.collect(Collectors.toList());
|
.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);
|
excelWriter.write((Collection<?>) null, writeSheet1, t1);
|
||||||
|
|
||||||
List<List<String>> header2 = contentHeader.stream()
|
List<List<String>> header2 = contentHeader.stream()
|
||||||
.map(item -> Collections.singletonList(year + "年" + month + "月海运费确认书"))
|
.map(item -> Collections.singletonList(year + "年" + month + "月海运费确认书"))
|
||||||
.collect(Collectors.toList());
|
.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);
|
excelWriter.write((Collection<?>) null, writeSheet1, t2);
|
||||||
|
|
||||||
List<List<String>> header3 = contentHeader.stream()
|
List<List<String>> header3 = contentHeader.stream()
|
||||||
.map(item -> Collections.singletonList("结算对象:" + settlement))
|
.map(item -> Collections.singletonList("结算对象:" + settlementDisplay))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
header3.set(9, Collections.singletonList("出账日期:" + date));
|
WriteTable t3 = EasyExcel.writerTable(3).needHead(Boolean.TRUE).head(header3).build();
|
||||||
header3.set(10, Collections.singletonList("出账日期:" + date));
|
|
||||||
header3.set(11, Collections.singletonList("出账日期:" + date));
|
|
||||||
WriteTable t3 = EasyExcel.writerTable(2).needHead(Boolean.TRUE).head(header3).build();
|
|
||||||
excelWriter.write((Collection<?>) null, writeSheet1, t3);
|
excelWriter.write((Collection<?>) null, writeSheet1, t3);
|
||||||
|
|
||||||
log.info("Building a large header is success");
|
log.info("Building a large header is success");
|
||||||
|
|
||||||
List<String> excelKey = emisWaybillMap.keySet().stream().collect(Collectors.toList());
|
List<String> excelKey = emisWaybillMap.keySet().stream().collect(Collectors.toList());
|
||||||
int num = 3;
|
int num = 4;
|
||||||
for (int i = 0; i < excelKey.size(); i++) {
|
for (int i = 0; i < excelKey.size(); i++) {
|
||||||
List<List<String>> result = new ArrayList<>();
|
List<List<String>> result = new ArrayList<>();
|
||||||
Map<String, Object> subtotalMap = new HashMap<>();
|
Map<String, Object> subtotalMap = new HashMap<>();
|
||||||
@ -1341,6 +1421,7 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
|
|||||||
List<EmisSettleSubBillFeeitem> settleSubBillFeeitemList = emisWaybill.getSettleSubBillFeeitemList();
|
List<EmisSettleSubBillFeeitem> settleSubBillFeeitemList = emisWaybill.getSettleSubBillFeeitemList();
|
||||||
calculateSubtotal(settleSubBillFeeitemList, subtotalMap);
|
calculateSubtotal(settleSubBillFeeitemList, subtotalMap);
|
||||||
settleSubBillFeeitemList.forEach(item -> {
|
settleSubBillFeeitemList.forEach(item -> {
|
||||||
|
String remark = Optional.ofNullable(item.getRemark()).orElse("");
|
||||||
result.add(Lists.newArrayList(emisWaybill.getLadingBillCode(), emisWaybill.getBillCode(),
|
result.add(Lists.newArrayList(emisWaybill.getLadingBillCode(), emisWaybill.getBillCode(),
|
||||||
emisWaybill.getCompanyCode(), emisWaybill.getDeparturePortName(),
|
emisWaybill.getCompanyCode(), emisWaybill.getDeparturePortName(),
|
||||||
emisWaybill.getDestinationPortName(), emisWaybill.getBoxQuantity(),
|
emisWaybill.getDestinationPortName(), emisWaybill.getBoxQuantity(),
|
||||||
@ -1348,7 +1429,8 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
|
|||||||
emisWaybill.getBillWeight().stripTrailingZeros().toPlainString(),
|
emisWaybill.getBillWeight().stripTrailingZeros().toPlainString(),
|
||||||
emisWaybill.getTotalVolume().stripTrailingZeros().toPlainString(),
|
emisWaybill.getTotalVolume().stripTrailingZeros().toPlainString(),
|
||||||
item.getFeeName(), item.getCurrency(),
|
item.getFeeName(), item.getCurrency(),
|
||||||
item.getBillFee().stripTrailingZeros().toPlainString()));
|
item.getBillFee().stripTrailingZeros().toPlainString(),
|
||||||
|
remark));
|
||||||
});
|
});
|
||||||
// 小表头
|
// 小表头
|
||||||
WriteSheet sheet = EasyExcel.writerSheet("sheet")
|
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("币种"));
|
||||||
header.add(Collections.singletonList("金额"));
|
header.add(Collections.singletonList("金额"));
|
||||||
|
header.add(Collections.singletonList("备注"));
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* @Project: emis
|
* @Project: emis
|
||||||
* @Title: EmisTmsSiteBatchDtlServiceImpl.java
|
* @Title: EmisTmsSiteBatchDtlServiceImpl.java
|
||||||
* @author linfso
|
* @author linfso
|
||||||
* @date 2024-03-01 08:54:57
|
* @date 2024-03-01 08:54:57
|
||||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||||
* @version v1.0
|
* @version v1.0
|
||||||
* @Description: <p> 一级网点TMS组批次明细 实体类 </p>
|
* @Description: <p> 一级网点TMS组批次明细 实体类 </p>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ import com.xdadan.erp.emis.service.IEmisTmsSiteBatchDtlService;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 一级网点TMS组批次明细Service业务层处理
|
* 一级网点TMS组批次明细Service业务层处理
|
||||||
*
|
*
|
||||||
* @author linfso
|
* @author linfso
|
||||||
* @date 2024-03-01 08:54:57
|
* @date 2024-03-01 08:54:57
|
||||||
*/
|
*/
|
||||||
@ -57,7 +57,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询一级网点TMS组批次明细
|
* 查询一级网点TMS组批次明细
|
||||||
*
|
*
|
||||||
* @param id 一级网点TMS组批次明细主键
|
* @param id 一级网点TMS组批次明细主键
|
||||||
* @return 一级网点TMS组批次明细
|
* @return 一级网点TMS组批次明细
|
||||||
*/
|
*/
|
||||||
@ -68,7 +68,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询一级网点TMS组批次明细列表
|
* 查询一级网点TMS组批次明细列表
|
||||||
*
|
*
|
||||||
* @param emisTmsSiteBatchDtl 一级网点TMS组批次明细
|
* @param emisTmsSiteBatchDtl 一级网点TMS组批次明细
|
||||||
* @return 一级网点TMS组批次明细
|
* @return 一级网点TMS组批次明细
|
||||||
*/
|
*/
|
||||||
@ -93,7 +93,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增一级网点TMS组批次明细
|
* 新增一级网点TMS组批次明细
|
||||||
*
|
*
|
||||||
* @param emisTmsSiteBatchDtl 一级网点TMS组批次明细
|
* @param emisTmsSiteBatchDtl 一级网点TMS组批次明细
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -107,7 +107,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改一级网点TMS组批次明细
|
* 修改一级网点TMS组批次明细
|
||||||
*
|
*
|
||||||
* @param emisTmsSiteBatchDtl 一级网点TMS组批次明细
|
* @param emisTmsSiteBatchDtl 一级网点TMS组批次明细
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -118,7 +118,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除一级网点TMS组批次明细
|
* 批量删除一级网点TMS组批次明细
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的一级网点TMS组批次明细主键
|
* @param ids 需要删除的一级网点TMS组批次明细主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -129,7 +129,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除一级网点TMS组批次明细信息
|
* 删除一级网点TMS组批次明细信息
|
||||||
*
|
*
|
||||||
* @param id 一级网点TMS组批次明细主键
|
* @param id 一级网点TMS组批次明细主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@ -149,6 +149,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
|||||||
String batchNo = emisTmsSiteBatchDtl.getBatchNo();
|
String batchNo = emisTmsSiteBatchDtl.getBatchNo();
|
||||||
String startSiteCode = (String) emisTmsSiteBatchDtl.getParams().get("startSiteCode");
|
String startSiteCode = (String) emisTmsSiteBatchDtl.getParams().get("startSiteCode");
|
||||||
String nextSiteCode = (String) emisTmsSiteBatchDtl.getParams().get("nextSiteCode");
|
String nextSiteCode = (String) emisTmsSiteBatchDtl.getParams().get("nextSiteCode");
|
||||||
|
String carNo = (String) emisTmsSiteBatchDtl.getParams().get("carNo");
|
||||||
String supplierCode = (String) emisTmsSiteBatchDtl.getParams().get("supplierCode");
|
String supplierCode = (String) emisTmsSiteBatchDtl.getParams().get("supplierCode");
|
||||||
|
|
||||||
// 参数校验
|
// 参数校验
|
||||||
@ -161,6 +162,9 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
|||||||
if (StringUtils.isBlank(nextSiteCode)) {
|
if (StringUtils.isBlank(nextSiteCode)) {
|
||||||
throw new EmisBizError(EmisBizErrorType.FAIL, "下一网点编码不能为空");
|
throw new EmisBizError(EmisBizErrorType.FAIL, "下一网点编码不能为空");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isBlank(carNo)) {
|
||||||
|
throw new EmisBizError(EmisBizErrorType.FAIL, "运输号不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
// 查询运单信息
|
// 查询运单信息
|
||||||
EmisWaybill emisWaybill = emisWaybillMapper.selectEmisWaybillByBillCode(billCode);
|
EmisWaybill emisWaybill = emisWaybillMapper.selectEmisWaybillByBillCode(billCode);
|
||||||
@ -200,6 +204,7 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
|||||||
List<EmisTmsSiteBatch> existingBatches = emisTmsSiteBatchMapper.selectTmsSiteBatchBySiteAndBillCode(
|
List<EmisTmsSiteBatch> existingBatches = emisTmsSiteBatchMapper.selectTmsSiteBatchBySiteAndBillCode(
|
||||||
startSiteCode,
|
startSiteCode,
|
||||||
nextSiteCode,
|
nextSiteCode,
|
||||||
|
carNo,
|
||||||
billCode,
|
billCode,
|
||||||
null);
|
null);
|
||||||
|
|
||||||
@ -229,22 +234,22 @@ public class EmisTmsSiteBatchDtlServiceImpl implements IEmisTmsSiteBatchDtlServi
|
|||||||
boolean hasMatchingSupplier = existingBatches.stream()
|
boolean hasMatchingSupplier = existingBatches.stream()
|
||||||
.anyMatch(batch -> supplierCodeList.contains(batch.getSupplierCode()));
|
.anyMatch(batch -> supplierCodeList.contains(batch.getSupplierCode()));
|
||||||
|
|
||||||
if (hasMatchingSupplier) {
|
// if (hasMatchingSupplier) {
|
||||||
// 找到匹配的批次,检查重量、体积、件数是否一致
|
// // 找到匹配的批次,检查重量、体积、件数是否一致
|
||||||
EmisTmsSiteBatch matchingBatch = existingBatches.stream()
|
// EmisTmsSiteBatch matchingBatch = existingBatches.stream()
|
||||||
.filter(batch -> supplierCodeList.contains(batch.getSupplierCode()))
|
// .filter(batch -> supplierCodeList.contains(batch.getSupplierCode()))
|
||||||
.findFirst()
|
// .findFirst()
|
||||||
.orElse(null);
|
// .orElse(null);
|
||||||
if (Objects.nonNull(matchingBatch)) {
|
// if (Objects.nonNull(matchingBatch)) {
|
||||||
result.setBatchParcelQty(
|
// result.setBatchParcelQty(
|
||||||
matchingBatch.getTotalParcelQty() != null ? matchingBatch.getTotalParcelQty() : 0);
|
// matchingBatch.getTotalParcelQty() != null ? matchingBatch.getTotalParcelQty() : 0);
|
||||||
result.setBatchWeight(
|
// result.setBatchWeight(
|
||||||
matchingBatch.getTotalWeight() != null ? matchingBatch.getTotalWeight() : BigDecimal.ZERO);
|
// matchingBatch.getTotalWeight() != null ? matchingBatch.getTotalWeight() : BigDecimal.ZERO);
|
||||||
result.setBatchVolume(
|
// result.setBatchVolume(
|
||||||
matchingBatch.getTotalVolume() != null ? matchingBatch.getTotalVolume() : BigDecimal.ZERO);
|
// matchingBatch.getTotalVolume() != null ? matchingBatch.getTotalVolume() : BigDecimal.ZERO);
|
||||||
return result;
|
// return result;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// 先过滤出包含多个供应商编码的rules
|
// 先过滤出包含多个供应商编码的rules
|
||||||
|
|||||||
@ -111,8 +111,8 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<EmisTmsSiteBatch> selectTmsSiteBatchBySiteAndBillCode(String startSiteCode, String nextSiteCode,
|
public List<EmisTmsSiteBatch> selectTmsSiteBatchBySiteAndBillCode(String startSiteCode, String nextSiteCode,
|
||||||
String billCode, Long id) {
|
String carNo, String billCode, Long id) {
|
||||||
return emisTmsSiteBatchMapper.selectTmsSiteBatchBySiteAndBillCode(startSiteCode, nextSiteCode, billCode, id);
|
return emisTmsSiteBatchMapper.selectTmsSiteBatchBySiteAndBillCode(startSiteCode, nextSiteCode, carNo, billCode, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -209,6 +209,7 @@ public class EmisTmsSiteBatchServiceImpl extends EmisBaseService implements IEmi
|
|||||||
List<EmisTmsSiteBatch> existingBatches = selectTmsSiteBatchBySiteAndBillCode(
|
List<EmisTmsSiteBatch> existingBatches = selectTmsSiteBatchBySiteAndBillCode(
|
||||||
oldSiteBatch.getStartSiteCode(),
|
oldSiteBatch.getStartSiteCode(),
|
||||||
oldSiteBatch.getNextSiteCode(),
|
oldSiteBatch.getNextSiteCode(),
|
||||||
|
oldSiteBatch.getCarNo(),
|
||||||
itemDtl.getBillCode(), itemDtl.getId());
|
itemDtl.getBillCode(), itemDtl.getId());
|
||||||
if (itemDtl.getId() != null) {
|
if (itemDtl.getId() != null) {
|
||||||
existingBatches = existingBatches.stream().filter(i -> !itemDtl.getBatchNo().equals(i.getBatchNo()))
|
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="origFee" column="orig_fee"/>
|
||||||
<result property="currency" column="currency"/>
|
<result property="currency" column="currency"/>
|
||||||
<result property="orderNum" column="order_num"/>
|
<result property="orderNum" column="order_num"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectEmisSettleSubBillFeeitemVo">
|
<sql id="selectEmisSettleSubBillFeeitemVo">
|
||||||
@ -66,7 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
b.bill_fee,
|
b.bill_fee,
|
||||||
b.orig_fee,
|
b.orig_fee,
|
||||||
b.currency,
|
b.currency,
|
||||||
b.order_num
|
b.order_num,
|
||||||
|
b.remark
|
||||||
from emis_waybill a
|
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_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'
|
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 start_site_code = #{startSiteCode}
|
||||||
and next_site_code = #{nextSiteCode}
|
and next_site_code = #{nextSiteCode}
|
||||||
and supplier_code=#{supplierCode}
|
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 batch_no in (select batch_no from emis_tms_site_batch_dtl where del_flag='0'
|
||||||
and FIND_IN_SET(`bill_code`
|
and FIND_IN_SET(`bill_code`
|
||||||
, #{params.billCode}) )
|
, #{params.billCode}) )
|
||||||
@ -574,10 +577,13 @@
|
|||||||
left join emis_waybill w on d.bill_code = w.bill_code and w.del_flag = '0'
|
left join emis_waybill w on d.bill_code = w.bill_code and w.del_flag = '0'
|
||||||
where b.start_site_code = #{startSiteCode}
|
where b.start_site_code = #{startSiteCode}
|
||||||
and b.next_site_code = #{nextSiteCode}
|
and b.next_site_code = #{nextSiteCode}
|
||||||
|
<if test="carNo != null and carNo != ''">
|
||||||
|
and b.car_no = #{carNo}
|
||||||
|
</if>
|
||||||
and d.bill_code = #{billCode}
|
and d.bill_code = #{billCode}
|
||||||
and b.del_flag = '0'
|
and b.del_flag = '0'
|
||||||
and d.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>
|
<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,
|
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,
|
b.product_type, b.batch_type, b.trans_type, b.start_site_code, b.send_country,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user