Browse Source

1.运单列表逻辑优化

2.干线导入数据限制
3.干线开单运单重复判定
visual
zhenghaoyu 4 months ago
parent
commit
b124624239
  1. 21
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java
  2. 61
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ExportWarehouseWaybillVO.java
  3. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  4. 42
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  5. 28
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  6. 178
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

21
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsLoadScanEntity.java

@ -154,4 +154,25 @@ public class TrunklineCarsLoadScanEntity extends TenantEntity {
@ApiModelProperty(name = "顾客地址",notes = "") @ApiModelProperty(name = "顾客地址",notes = "")
private String customerAddress; private String customerAddress;
/** 一级品类 */
@ApiModelProperty(name = "一级品类",notes = "")
private String firsts;
/** 二级品类 */
@ApiModelProperty(name = "二级品类",notes = "")
private String senconds;
/** 三级品类 */
@ApiModelProperty(name = "三级品类",notes = "")
private String thirds;
/** 物料编码 */
@ApiModelProperty(name = "物料编码",notes = "")
private String materialCode;
/** 物料名称 */
@ApiModelProperty(name = "物料名称",notes = "")
private String materialName;
} }

61
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/ExportWarehouseWaybillVO.java

@ -18,6 +18,9 @@ public class ExportWarehouseWaybillVO implements Serializable {
@ExcelProperty(value = "订单号") @ExcelProperty(value = "订单号")
private String orderNo; private String orderNo;
@ExcelProperty(value = "备注")
private String remark;
@ExcelProperty(value = "发站仓") @ExcelProperty(value = "发站仓")
private String departureWarehouseName; private String departureWarehouseName;
@ -64,6 +67,12 @@ public class ExportWarehouseWaybillVO implements Serializable {
@ExcelProperty(value = "货物名称") @ExcelProperty(value = "货物名称")
private String goodsName; private String goodsName;
@ExcelProperty(value = "货物名称明细")
private String productNum;
@ExcelProperty(value = "干线品类单价")
private String productPrice;
@ExcelProperty(value = "按件分摊") @ExcelProperty(value = "按件分摊")
private BigDecimal costPiece; private BigDecimal costPiece;
@ -76,6 +85,9 @@ public class ExportWarehouseWaybillVO implements Serializable {
@ExcelProperty(value = "总件数") @ExcelProperty(value = "总件数")
private Integer totalCount; private Integer totalCount;
@ExcelProperty(value = "签收数量")
private Integer signNum;
@ExcelProperty(value = "总重量") @ExcelProperty(value = "总重量")
private BigDecimal totalWeight; private BigDecimal totalWeight;
@ -142,13 +154,6 @@ public class ExportWarehouseWaybillVO implements Serializable {
@ExcelProperty(value = "经办人") @ExcelProperty(value = "经办人")
private String agent; private String agent;
@ExcelProperty(value = "创建时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@ExcelProperty(value = "制单时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date documentMakingTime;
@ExcelIgnore @ExcelIgnore
private Integer pickupCompleteOrNot; private Integer pickupCompleteOrNot;
@ -176,8 +181,40 @@ public class ExportWarehouseWaybillVO implements Serializable {
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date freezeTime; private Date freezeTime;
@ExcelProperty(value = "审核人")
private String checkUserName;
@ExcelProperty(value = "审核原因")
private String checkReson;
@ExcelProperty(value = "审核备注")
private String checkRemark;
@ExcelProperty(value = "审核时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date checkTime;
@ExcelProperty(value = "签收人")
private String signUserName;
@ExcelProperty(value = "复核人")
private String signCheckUserName;
@ExcelProperty(value = "签收时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date signTime;
@ExcelProperty(value = "复核时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date signCheckTime;
@ExcelIgnore @ExcelIgnore
private Integer abolishStatus; private Integer abolishStatus;
@ExcelProperty(value = "是否作废") @ExcelProperty(value = "是否作废")
private String abolishStatusStr; private String abolishStatusStr;
@ -188,4 +225,14 @@ public class ExportWarehouseWaybillVO implements Serializable {
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date abolishTime; private Date abolishTime;
@ExcelProperty(value = "创建时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@ExcelProperty(value = "制单时间")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date documentMakingTime;
} }

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -182,6 +182,7 @@
select * select *
from logpm_trunkline_cars_load_scan from logpm_trunkline_cars_load_scan
where is_deleted = 0 where is_deleted = 0
and is_supple = 0
<if test="param.loadId != null "> <if test="param.loadId != null ">
and load_id = #{param.loadId} and load_id = #{param.loadId}
</if> </if>

42
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -477,6 +477,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
// while(!Objects.isNull(warehouseWaybillEntity)){ // while(!Objects.isNull(warehouseWaybillEntity)){
// waybillNo = basicdataCodeClient.getCodeByType(CodeNumConstant.WAYBILL, warehouseCode, ""); // waybillNo = basicdataCodeClient.getCodeByType(CodeNumConstant.WAYBILL, warehouseCode, "");
// } // }
}else{
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
if(!Objects.isNull(warehouseWaybillEntity)){
log.warn("#############openWaybill: 运单号已存在 waybillNo={}", waybillNo);
return R.fail(405, "运单号已存在");
}
} }
Long departureWarehouseId = openOrderDTO.getDepartureWarehouseId(); Long departureWarehouseId = openOrderDTO.getDepartureWarehouseId();
Long destinationWarehouseId = openOrderDTO.getDestinationWarehouseId(); Long destinationWarehouseId = openOrderDTO.getDestinationWarehouseId();
@ -823,6 +829,12 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
//如果运单号为空则自动生成运单号 //如果运单号为空则自动生成运单号
if (StringUtil.isBlank(waybillNo)) { if (StringUtil.isBlank(waybillNo)) {
waybillNo = basicdataCodeClient.getCodeByType(CodeNumConstant.WAYBILL, warehouseCode, ""); waybillNo = basicdataCodeClient.getCodeByType(CodeNumConstant.WAYBILL, warehouseCode, "");
}else{
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
if(!Objects.isNull(warehouseWaybillEntity)){
log.warn("#############openZeroWaybill: 运单号已存在 waybillNo={}", waybillNo);
return R.fail(405, "运单号已存在");
}
} }
WarehouseWaybillEntity waybillEntity = new WarehouseWaybillEntity(); WarehouseWaybillEntity waybillEntity = new WarehouseWaybillEntity();
@ -1758,6 +1770,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
List<ImportCustomizedOuPaiDTO> importCustomizedOuPaiDTOS = EasyExcel.read(inputStream).head(ImportCustomizedOuPaiDTO.class).sheet(0).headRowNumber(1).doReadSync(); List<ImportCustomizedOuPaiDTO> importCustomizedOuPaiDTOS = EasyExcel.read(inputStream).head(ImportCustomizedOuPaiDTO.class).sheet(0).headRowNumber(1).doReadSync();
//判断importCustomizedOuPaiDTOS中firstsName有值的数量
long countWithMaterialName = importCustomizedOuPaiDTOS.stream()
.filter(dto -> StringUtil.isNotBlank(dto.getFirstsName()))
.count();
if(NumberUtil.equals(countWithMaterialName,0)){
log.warn("#################: 请使用定制品模版");
return R.fail(405,"请使用定制品模版");
}
//排除pacakgeDetailExcelDTOS中的orderPackageCode为空的元素 //排除pacakgeDetailExcelDTOS中的orderPackageCode为空的元素
importCustomizedOuPaiDTOS = importCustomizedOuPaiDTOS.stream().filter(item -> StringUtil.isNotBlank(item.getOrderPackageCode())).collect(Collectors.toList()); importCustomizedOuPaiDTOS = importCustomizedOuPaiDTOS.stream().filter(item -> StringUtil.isNotBlank(item.getOrderPackageCode())).collect(Collectors.toList());
@ -2095,8 +2115,18 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
InputStream inputStream = file.getInputStream(); InputStream inputStream = file.getInputStream();
//读取inputStream中Excel的表头数据
List<ImportStandardOuPaiDTO> importStandardOuPaiDTOS = EasyExcel.read(inputStream).head(ImportStandardOuPaiDTO.class).sheet(0).headRowNumber(1).doReadSync(); List<ImportStandardOuPaiDTO> importStandardOuPaiDTOS = EasyExcel.read(inputStream).head(ImportStandardOuPaiDTO.class).sheet(0).headRowNumber(1).doReadSync();
//判断importStandardOuPaiDTOS中materialName有值的数量
long countWithMaterialName = importStandardOuPaiDTOS.stream()
.filter(dto -> StringUtil.isNotBlank(dto.getMaterialName()))
.count();
if(NumberUtil.equals(countWithMaterialName,0)){
log.warn("#################: 请使用标准品模版");
return R.fail(405,"请使用标准品模版");
}
//排除importStandardOuPaiDTOS中的orderPackageCode为空的元素 //排除importStandardOuPaiDTOS中的orderPackageCode为空的元素
importStandardOuPaiDTOS = importStandardOuPaiDTOS.stream().filter(item -> StringUtil.isNotBlank(item.getOrderPackageCode())).collect(Collectors.toList()); importStandardOuPaiDTOS = importStandardOuPaiDTOS.stream().filter(item -> StringUtil.isNotBlank(item.getOrderPackageCode())).collect(Collectors.toList());
@ -2407,8 +2437,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
advanceDetailModel.setMaterialId(basicMaterialEntity.getId()); advanceDetailModel.setMaterialId(basicMaterialEntity.getId());
advanceDetailModel.setMaterialCode(materialCode); advanceDetailModel.setMaterialCode(materialCode);
advanceDetailModel.setMaterialName(materialName); advanceDetailModel.setMaterialName(materialName);
advanceDetailModel.setWeight(new BigDecimal(basicMaterialEntity.getWeight())); String weight = basicMaterialEntity.getWeight();
advanceDetailModel.setVolume(new BigDecimal(basicMaterialEntity.getVolume())); if(StringUtil.isBlank(weight)){
weight = "0";
}
String volume1 = basicMaterialEntity.getVolume();
if(StringUtil.isBlank(volume1)){
volume1 = "0";
}
advanceDetailModel.setWeight(new BigDecimal(weight));
advanceDetailModel.setVolume(new BigDecimal(volume1));
} }
// if (StringUtil.isNotBlank(materialCode) && StringUtil.isNotBlank(materialName)) { // if (StringUtil.isNotBlank(materialCode) && StringUtil.isNotBlank(materialName)) {

28
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -3647,6 +3647,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setCustomerTelephone(stockArticleEntity.getCustomerTelephone()); carsLoadScanEntity.setCustomerTelephone(stockArticleEntity.getCustomerTelephone());
carsLoadScanEntity.setCustomerAddress(stockArticleEntity.getCustomerAddress()); carsLoadScanEntity.setCustomerAddress(stockArticleEntity.getCustomerAddress());
carsLoadScanEntity.setFirsts(otherParcelListEntity.getFirsts());
carsLoadScanEntity.setSenconds(otherParcelListEntity.getSecond());
carsLoadScanEntity.setThirds(otherParcelListEntity.getThirdProduct());
carsLoadScanEntity.setMaterialCode(otherParcelListEntity.getMaterialCode());
carsLoadScanEntity.setMaterialName(otherParcelListEntity.getMaterialName());
remark = "有数据,不在当前仓,异常装车"; remark = "有数据,不在当前仓,异常装车";
audio = "包件未入库"; audio = "包件未入库";
if(StringUtils.isNotBlank(orderPackageCode)){ if(StringUtils.isNotBlank(orderPackageCode)){
@ -3745,6 +3751,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setCustomerName(stockArticleEntity.getCustomerName()); carsLoadScanEntity.setCustomerName(stockArticleEntity.getCustomerName());
carsLoadScanEntity.setCustomerTelephone(stockArticleEntity.getCustomerTelephone()); carsLoadScanEntity.setCustomerTelephone(stockArticleEntity.getCustomerTelephone());
carsLoadScanEntity.setCustomerAddress(stockArticleEntity.getCustomerAddress()); carsLoadScanEntity.setCustomerAddress(stockArticleEntity.getCustomerAddress());
carsLoadScanEntity.setFirsts(parcelListEntity.getFirsts());
carsLoadScanEntity.setSenconds(parcelListEntity.getSecond());
carsLoadScanEntity.setThirds(parcelListEntity.getThirdProduct());
carsLoadScanEntity.setMaterialCode(parcelListEntity.getMaterialCode());
carsLoadScanEntity.setMaterialName(parcelListEntity.getMaterialName());
} }
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName()); carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
@ -3992,6 +4003,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setCustomerName(stockArticleEntity.getCustomerName()); carsLoadScanEntity.setCustomerName(stockArticleEntity.getCustomerName());
carsLoadScanEntity.setCustomerTelephone(stockArticleEntity.getCustomerTelephone()); carsLoadScanEntity.setCustomerTelephone(stockArticleEntity.getCustomerTelephone());
carsLoadScanEntity.setCustomerAddress(stockArticleEntity.getCustomerAddress()); carsLoadScanEntity.setCustomerAddress(stockArticleEntity.getCustomerAddress());
trunklineCarsLoadScanService.save(carsLoadScanEntity); trunklineCarsLoadScanService.save(carsLoadScanEntity);
loadScanId = carsLoadScanEntity.getId(); loadScanId = carsLoadScanEntity.getId();
List<TrunklineScanZeroDetailEntity> zeroDetailList = new ArrayList<>(); List<TrunklineScanZeroDetailEntity> zeroDetailList = new ArrayList<>();
@ -5652,6 +5664,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<TrunklineCarsLoadScanEntity> loadScanEntityListHasData = loadScanEntityList.stream().filter(e -> e.getIsData() == 1).collect(Collectors.toList()); List<TrunklineCarsLoadScanEntity> loadScanEntityListHasData = loadScanEntityList.stream().filter(e -> e.getIsData() == 1).collect(Collectors.toList());
//把loadScanEntityListHasData中所有元素的scanCode放入一个List
List<String> scanCodeList = loadScanEntityListHasData.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toList());
FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderPackageCodeList(scanCodeList);
findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
//把parcelListEntityList中所有的orderPackageCode放入一个List
List<String> orderPackageCodeList = parcelListEntityList.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.toList());
//把loadScanEntityListHasData中的元素通过orderPackageCodeList存在及过滤掉
loadScanEntityListHasData = loadScanEntityListHasData.stream().filter(e -> !orderPackageCodeList.contains(e.getScanCode())).collect(Collectors.toList());
//把loadScanEntityListHasData通过tray_code is null和tray_code is not null 分成两个新的list //把loadScanEntityListHasData通过tray_code is null和tray_code is not null 分成两个新的list
List<TrunklineCarsLoadScanEntity> loadScanEntityListHasDataNoTray = loadScanEntityListHasData.stream().filter(e -> StringUtil.isBlank(e.getTrayCode())).collect(Collectors.toList()); List<TrunklineCarsLoadScanEntity> loadScanEntityListHasDataNoTray = loadScanEntityListHasData.stream().filter(e -> StringUtil.isBlank(e.getTrayCode())).collect(Collectors.toList());
//把loadScanEntityListHasDataNoTray通过orderCode进行分组 //把loadScanEntityListHasDataNoTray通过orderCode进行分组
@ -7170,6 +7193,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setSignOrderId(signOrderId); carsLoadScanEntity.setSignOrderId(signOrderId);
carsLoadScanEntity.setIsSupple(0); carsLoadScanEntity.setIsSupple(0);
carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName()); carsLoadScanEntity.setLoadingUserName(AuthUtil.getNickName());
carsLoadScanEntity.setFirsts(parcelListEntity.getFirsts());
carsLoadScanEntity.setSenconds(parcelListEntity.getSecond());
carsLoadScanEntity.setThirds(parcelListEntity.getThirdProduct());
carsLoadScanEntity.setMaterialCode(parcelListEntity.getMaterialCode());
carsLoadScanEntity.setMaterialName(parcelListEntity.getMaterialName());
if(!Objects.isNull(stockArticle)){ if(!Objects.isNull(stockArticle)){
carsLoadScanEntity.setCustomerName(stockArticle.getCustomerName()); carsLoadScanEntity.setCustomerName(stockArticle.getCustomerName());
carsLoadScanEntity.setCustomerTelephone(stockArticle.getCustomerTelephone()); carsLoadScanEntity.setCustomerTelephone(stockArticle.getCustomerTelephone());

178
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml

@ -146,14 +146,84 @@
<select id="pageList" resultType="com.logpm.warehouse.vo.WarehouseWaybillVO"> <select id="pageList" resultType="com.logpm.warehouse.vo.WarehouseWaybillVO">
select lww.*, select lww.id id,
lww.brand brand,
lww.waybill_no waybillNo,
lww.order_no orderNo,
lww.consignee consignee,
lww.consignee_name consigneeName,
lww.consignee_mobile consigneeMobile,
lww.consignee_address consigneeAddress,
lww.shipper shipper,
lww.shipper_name shipperName,
lww.shipper_mobile shipperMobile,
lww.shipper_address shipperAddress,
lww.destination destination,
lww.departure departure,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
lww.delivery_way deliveryWay,
lww.customer_train customerTrain,
IFNULL(lww.return_status,0) returnStatus,
lww.remark remark,
lww.pay_type payType,
lww.pay_way payWay,
lww.x_pay xPay,
lww.d_pay dPay,
lww.h_pay hPay,
lww.y_pay yPay,
lww.service_type serviceType,
IFNULL(lww.update_status,0) updateStatus,
IFNULL(lww.check_status,0) checkStatus,
lww.check_reson checkReson,
lww.check_remark checkRemark,
lww.check_user_name checkUserName,
lww.check_time checkTime,
lww.cancle_check_remark cancleCheckRemark,
lww.cancle_check_user_name cancleCheckUserName,
lww.cancle_check_time cancleCheckTime,
lww.waybill_status waybillStatus,
lww.waybill_type waybillType,
lww.document_making_time openTime,
GROUP_CONCAT(lwwd.product_name) goodsName,
lww.total_count totalCount,
sum(lwwd.weight) totalWeight,
sum(lwwd.volume) totalVolume,
lww.x_pay+lww.d_pay+lww.h_pay+lww.y_pay totalFee,
sum(IFNULL(lwwd.freight_price,0)*lwwd.num+IFNULL(lwwd.pickup_price,0)*lwwd.num+IFNULL(lwwd.delivery_price,0)*lwwd.num) systemTotalFee,
lww.pickup_fee pickupFee,
lww.total_freight totalFreight,
lww.storage_fee+lww.warehouse_management_fee warehouseServiceFee,
lww.storage_fee storageFee,
lww.warehouse_management_fee warehouseManagementFee,
0.00 warehouseSortingFee,
0.00 warehouseOprationFee,
lww.delivery_fee+lww.handling_fee deliveryServiceFee,
lww.delivery_fee deliveryFee,
lww.handling_fee handlingFee,
0.00 deliverySortingFee,
0.00 deliveryUpfloorFee,
0.00 deliveryMoveFee,
0.00 deliveryLine,
0.00 deliveryLineFee,
lww.other_fee otherFee,
lww.install_fee installFee,
lww.insurance_fee insuranceFee,
lww.claiming_value claimingValue,
lww.third_operation_fee thirdOperationFee,
lww.sign_num signNum,
lww.sign_user_name signUserName,
lww.sign_time signTime,
lww.sign_check_user_name signCheckUserName,
lww.sign_check_time signCheckTime,
lww.rebate rebate,
GROUP_CONCAT(CONCAT(lwwd.product_name,'(',lwwd.num,')')) productNum, GROUP_CONCAT(CONCAT(lwwd.product_name,'(',lwwd.num,')')) productNum,
GROUP_CONCAT(CONCAT(lwwd.product_name,'(',lwwd.price,')')) productPrice GROUP_CONCAT(CONCAT(lwwd.product_name,'(',lwwd.price,')')) productPrice
from logpm_warehouse_waybill lww from logpm_warehouse_waybill lww
left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id and lwwd.is_deleted = 0
where lww.is_deleted = 0 where lww.is_deleted = 0
<if test="param.waybillNoList != null"> <if test="param.waybillNoList != null">
and lww.waybill_no not in and lww.waybill_no in
<foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")"> <foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
@ -372,7 +442,7 @@
lww.d_pay dPay, lww.d_pay dPay,
lww.h_pay hPay, lww.h_pay hPay,
lww.y_pay yPay, lww.y_pay yPay,
lww.service_type serviceType, lbc.type_service serviceType,
IFNULL(lww.update_status,0) updateStatus, IFNULL(lww.update_status,0) updateStatus,
IFNULL(lww.check_status,0) checkStatus, IFNULL(lww.check_status,0) checkStatus,
lww.check_reson checkReson, lww.check_reson checkReson,
@ -387,8 +457,8 @@
lww.document_making_time openTime, lww.document_making_time openTime,
lww.goods_name goodsName, lww.goods_name goodsName,
lww.total_count totalCount, lww.total_count totalCount,
lww.total_weight totalWeight, sum(lwwd.weight) totalWeight,
lww.total_volume totalVolume, sum(lwwd.volume) totalVolume,
lww.x_pay+lww.d_pay+lww.h_pay+lww.y_pay totalFee, lww.x_pay+lww.d_pay+lww.h_pay+lww.y_pay totalFee,
sum(IFNULL(lwwd.freight_price,0)*lwwd.num+IFNULL(lwwd.pickup_price,0)*lwwd.num+IFNULL(lwwd.delivery_price,0)*lwwd.num) systemTotalFee, sum(IFNULL(lwwd.freight_price,0)*lwwd.num+IFNULL(lwwd.pickup_price,0)*lwwd.num+IFNULL(lwwd.delivery_price,0)*lwwd.num) systemTotalFee,
lww.pickup_fee pickupFee, lww.pickup_fee pickupFee,
@ -420,10 +490,10 @@
count(lwwd.id) goodsTypeCount count(lwwd.id) goodsTypeCount
from logpm_warehouse_waybill lww from logpm_warehouse_waybill lww
left join logpm_basicdata_client lbc on lbc.id = lww.consignee_id left join logpm_basicdata_client lbc on lbc.id = lww.consignee_id
left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id and lwwd.is_deleted = 0
where lww.is_deleted = 0 where lww.is_deleted = 0
<if test="param.waybillNoList != null"> <if test="param.waybillNoList != null">
and lww.waybill_no not in and lww.waybill_no in
<foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")"> <foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
@ -620,10 +690,10 @@
lww.d_pay dPay, lww.d_pay dPay,
lww.h_pay hPay, lww.h_pay hPay,
lww.y_pay yPay, lww.y_pay yPay,
case when lww.service_type='1' then '商配' case when lbc.type_service='1' then '商配'
when lww.service_type='2' then '市配' when lbc.type_service='2' then '市配'
when lww.service_type='3' then '自提' when lbc.type_service='3' then '自提'
when lww.service_type='4' then '三方中转' when lbc.type_service='4' then '三方中转'
else '未知' end serviceType, else '未知' end serviceType,
CASE WHEN IFNULL(lww.update_status,0)=0 THEN '未改单' CASE WHEN IFNULL(lww.update_status,0)=0 THEN '未改单'
WHEN IFNULL(lww.update_status,0)=1 THEN '已改单' WHEN IFNULL(lww.update_status,0)=1 THEN '已改单'
@ -652,8 +722,8 @@
lww.document_making_time openTime, lww.document_making_time openTime,
lww.goods_name goodsName, lww.goods_name goodsName,
lww.total_count totalCount, lww.total_count totalCount,
lww.total_weight totalWeight, sum(lwwd.weight) totalWeight,
lww.total_volume totalVolume, sum(lwwd.volume) totalVolume,
lww.x_pay+lww.d_pay+lww.h_pay+lww.y_pay totalFee, lww.x_pay+lww.d_pay+lww.h_pay+lww.y_pay totalFee,
sum(IFNULL(lwwd.freight_price,0)*lwwd.num+IFNULL(lwwd.pickup_price,0)*lwwd.num+IFNULL(lwwd.delivery_price,0)*lwwd.num) systemTotalFee, sum(IFNULL(lwwd.freight_price,0)*lwwd.num+IFNULL(lwwd.pickup_price,0)*lwwd.num+IFNULL(lwwd.delivery_price,0)*lwwd.num) systemTotalFee,
lww.pickup_fee pickupFee, lww.pickup_fee pickupFee,
@ -685,10 +755,10 @@
count(lwwd.id) goodsTypeCount count(lwwd.id) goodsTypeCount
from logpm_warehouse_waybill lww from logpm_warehouse_waybill lww
left join logpm_basicdata_client lbc on lbc.id = lww.consignee_id left join logpm_basicdata_client lbc on lbc.id = lww.consignee_id
left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id and lwwd.is_deleted = 0
where lww.is_deleted = 0 where lww.is_deleted = 0
<if test="param.waybillNoList != null"> <if test="param.waybillNoList != null">
and lww.waybill_no not in and lww.waybill_no in
<foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")"> <foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
@ -847,14 +917,84 @@
</select> </select>
<select id="exportWaybillList" resultType="com.logpm.warehouse.vo.ExportWarehouseWaybillVO"> <select id="exportWaybillList" resultType="com.logpm.warehouse.vo.ExportWarehouseWaybillVO">
select lww.*, select lww.id id,
lww.brand brand,
lww.waybill_no waybillNo,
lww.order_no orderNo,
lww.consignee consignee,
lww.consignee_name consigneeName,
lww.consignee_mobile consigneeMobile,
lww.consignee_address consigneeAddress,
lww.shipper shipper,
lww.shipper_name shipperName,
lww.shipper_mobile shipperMobile,
lww.shipper_address shipperAddress,
lww.destination destination,
lww.departure departure,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,
lww.delivery_way deliveryWay,
lww.customer_train customerTrain,
IFNULL(lww.return_status,0) returnStatus,
lww.remark remark,
lww.pay_type payType,
lww.pay_way payWay,
lww.x_pay xPay,
lww.d_pay dPay,
lww.h_pay hPay,
lww.y_pay yPay,
lww.service_type serviceType,
IFNULL(lww.update_status,0) updateStatus,
IFNULL(lww.check_status,0) checkStatus,
lww.check_reson checkReson,
lww.check_remark checkRemark,
lww.check_user_name checkUserName,
lww.check_time checkTime,
lww.cancle_check_remark cancleCheckRemark,
lww.cancle_check_user_name cancleCheckUserName,
lww.cancle_check_time cancleCheckTime,
lww.waybill_status waybillStatus,
lww.waybill_type waybillType,
lww.document_making_time openTime,
GROUP_CONCAT(lwwd.product_name) goodsName,
lww.total_count totalCount,
sum(lwwd.weight) totalWeight,
sum(lwwd.volume) totalVolume,
lww.x_pay+lww.d_pay+lww.h_pay+lww.y_pay totalFee,
sum(IFNULL(lwwd.freight_price,0)*lwwd.num+IFNULL(lwwd.pickup_price,0)*lwwd.num+IFNULL(lwwd.delivery_price,0)*lwwd.num) systemTotalFee,
lww.pickup_fee pickupFee,
lww.total_freight totalFreight,
lww.storage_fee+lww.warehouse_management_fee warehouseServiceFee,
lww.storage_fee storageFee,
lww.warehouse_management_fee warehouseManagementFee,
0.00 warehouseSortingFee,
0.00 warehouseOprationFee,
lww.delivery_fee+lww.handling_fee deliveryServiceFee,
lww.delivery_fee deliveryFee,
lww.handling_fee handlingFee,
0.00 deliverySortingFee,
0.00 deliveryUpfloorFee,
0.00 deliveryMoveFee,
0.00 deliveryLine,
0.00 deliveryLineFee,
lww.other_fee otherFee,
lww.install_fee installFee,
lww.insurance_fee insuranceFee,
lww.claiming_value claimingValue,
lww.third_operation_fee thirdOperationFee,
lww.sign_num signNum,
lww.sign_user_name signUserName,
lww.sign_time signTime,
lww.sign_check_user_name signCheckUserName,
lww.sign_check_time signCheckTime,
lww.rebate rebate,
GROUP_CONCAT(CONCAT(lwwd.product_name,'(',lwwd.num,')')) productNum, GROUP_CONCAT(CONCAT(lwwd.product_name,'(',lwwd.num,')')) productNum,
GROUP_CONCAT(CONCAT(lwwd.product_name,'(',lwwd.price,')')) productPrice GROUP_CONCAT(CONCAT(lwwd.product_name,'(',lwwd.price,')')) productPrice
from logpm_warehouse_waybill lww from logpm_warehouse_waybill lww
left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id left join logpm_warehouse_waybill_detail lwwd on lwwd.waybill_id = lww.id and lwwd.is_deleted = 0
where lww.is_deleted = 0 where lww.is_deleted = 0
<if test="param.waybillNoList != null"> <if test="param.waybillNoList != null">
and lww.waybill_no not in and lww.waybill_no in
<foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")"> <foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>

Loading…
Cancel
Save