Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dist.1.3.0
zhaoqiaobo 8 months ago
parent
commit
8d9d618ee8
  1. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java
  2. 37
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java
  3. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehousingEntryDetailExcel.java
  4. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java
  5. 142
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml
  6. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  7. 111
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java
  8. 36
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java

@ -129,7 +129,7 @@ public class FactoryCommonServiceImpl implements IFactoryCommonService {
@Override
public void extracted(String status, String unitNo, String currentWarehouseId, String operationTime, Integer trayId) {
log.info("#############extracted: 当前处理的数据为 status={} unitNo={} currentWarehouseId={} operationTime={} trayId={}",status,unitNo,currentWarehouseId,operationTime,trayId);
if ("4".equals(status) || "2".equals(status) || "1".equals(status)) {
if ("4".equals(status) || "2".equals(status)) {
//继续判断是否到达目的仓
//查询destinationWarehouse logiBillNo plantId数据

37
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java

@ -51,6 +51,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ -259,6 +260,42 @@ public class WarehouseWaybillController extends BladeController {
}
}
@ResponseBody
@PostMapping("/pageFinanceWaybillList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "分页查询运单审核", notes = "传入waybillDTO")
public R pageFinanceWaybillList(@RequestBody WarehouseWaybillDTO waybillDTO) {
String method = "############pageFinanceWaybillList: ";
log.info(method + "请求参数{}", waybillDTO);
try{
List<Long> destinationWarehouseIds = new ArrayList<>();
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
if(!myWatchWarehouse.isEmpty()){
myWatchWarehouse.forEach(warehouseEntity -> {
destinationWarehouseIds.add(warehouseEntity.getId());
});
}
}else{
destinationWarehouseIds.add(myCurrentWarehouse.getId());
}
waybillDTO.setDestinationWarehouseIds(destinationWarehouseIds);
IPage<WarehouseWaybillVO> pages = warehouseWaybillService.pageFinanceWaybillList(waybillDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
@ResponseBody
@PostMapping("/findWaybillInfo")
@ApiOperationSupport(order = 1)

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehousingEntryDetailExcel.java

@ -178,6 +178,4 @@ public class WarehousingEntryDetailExcel implements Serializable {
private String remark;
}

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

@ -61,4 +61,5 @@ public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybillEntit
WarehouseWaybillEntity findWaybillEntityByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode);
IPage<WarehouseWaybillVO> pageFinanceWaybillList(IPage<Object> page, @Param("param") WarehouseWaybillDTO waybillDTO);
}

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

@ -323,4 +323,146 @@
and ltad.order_package_code = #{orderPackageCode}
</select>
<select id="pageFinanceWaybillList" resultType="com.logpm.warehouse.vo.WarehouseWaybillVO">
select lww.*
from logpm_warehouse_waybill lww
where lww.is_deleted = 0
<if test="param.waybillNoList != null">
and lww.waybill_no not in
<foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.warehouseId != null">
and lww.destination_warehouse_id in
<foreach collection="param.destinationWarehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.waybillNo != null and param.waybillNo != ''">
and Locate(#{param.waybillNo},lww.waybill_no) > 0
</if>
<if test="param.orderNo != null and param.orderNo != ''">
and Locate(#{param.orderNo},lww.order_no) > 0
</if>
<if test="param.destinationWarehouseName != null and param.destinationWarehouseName != ''">
and Locate(#{param.destinationWarehouseName},lww.destination_warehouse_name) > 0
</if>
<if test="param.departureWarehouseName != null and param.departureWarehouseName != ''">
and Locate(#{param.departureWarehouseName},lww.departure_warehouse_name) > 0
</if>
<if test="param.customerTrain != null and param.customerTrain != ''">
and Locate(#{param.customerTrain},lww.customer_train) > 0
</if>
<if test="param.brand != null and param.brand != ''">
and Locate(#{param.brand},lww.brand) > 0
</if>
<if test="param.shipper != null and param.shipper != ''">
and Locate(#{param.shipper},lww.shipper) > 0
</if>
<if test="param.shipperName != null and param.shipperName != ''">
and Locate(#{param.shipperName},lww.shipper_name) > 0
</if>
<if test="param.shipperMobile != null and param.shipperMobile != ''">
and Locate(#{param.shipperMobile},lww.shipper_mobile) > 0
</if>
<if test="param.consignee != null and param.consignee != ''">
and Locate(#{param.consignee},lww.consignee) > 0
</if>
<if test="param.consigneeName != null and param.consigneeName != ''">
and Locate(#{param.consigneeName},lww.consignee_name) > 0
</if>
<if test="param.consigneeMobile != null and param.consigneeMobile != ''">
and Locate(#{param.consigneeMobile},lww.consignee_mobile) > 0
</if>
<if test="param.destination != null and param.destination != ''">
and Locate(#{param.destination},lww.destination) > 0
</if>
<if test="param.departure != null and param.departure != ''">
and Locate(#{param.departure},lww.departure) > 0
</if>
<if test="param.payType != null">
and lww.pay_type = #{param.payType}
</if>
<if test="param.payWay != null">
and lww.pay_way = #{param.payWay}
</if>
<if test="param.deliveryWay != null">
and lww.delivery_way = #{param.deliveryWay}
</if>
<if test="param.urgency != null">
and lww.urgency = #{param.urgency}
</if>
<if test="param.transportType != null">
and lww.transport_type = #{param.transportType}
</if>
<if test="param.transportType != null">
and lww.transport_type = #{param.transportType}
</if>
<if test="param.waybillStatus != null">
and lww.waybill_status = #{param.waybillStatus}
</if>
<if test="param.pickupCompleteOrNot != null">
and lww.pickup_complete_or_not = #{param.pickupCompleteOrNot}
</if>
<if test="param.trunklineCompleteOrNot != null">
and lww.trunkline_complete_or_not = #{param.trunklineCompleteOrNot}
</if>
<if test="param.documentMakingTimeStartDate != null">
and lww.document_making_time &gt;= #{param.documentMakingTimeStartDate}
</if>
<if test="param.documentMakingTimeEndDate != null">
and lww.document_making_time &lt;= #{param.documentMakingTimeEndDate}
</if>
<if test="param.createTimeStartDate != null">
and lww.create_time &gt;= #{param.createTimeStartDate}
</if>
<if test="param.createTimeEndDate != null">
and lww.create_time &lt;= #{param.createTimeEndDate}
</if>
<if test="param.agent != null and param.agent != ''">
and lww.Locate(#{param.agent},agent) > 0
</if>
<if test="param.goodsName != null and param.goodsName != ''">
and lww.Locate(#{param.goodsName},goods_name) > 0
</if>
<if test="param.freezeStatus != null">
and lww.freeze_status = #{param.freezeStatus}
</if>
<if test="param.abolishStatus != null">
and lww.abolish_status = #{param.abolishStatus}
</if>
<if test="param.remark != null and param.reamrk != ''">
and Locate(#{param.remark},lww.remark) > 0
</if>
<if test="param.consigneeAddress != null and param.consigneeAddress != ''">
and Locate(#{param.consigneeAddress},lww.consignee_address) > 0
</if>
<if test="param.totalCount != null">
and lww.total_count = #{param.totalCount}
</if>
<if test="param.totalWeight != null">
and lww.total_weight = #{param.totalWeight}
</if>
<if test="param.totalVolume != null">
and lww.total_volume = #{param.totalVolume}
</if>
<if test="param.abolishTimeStartDate != null">
and lww.abolish_time &gt;= #{param.abolishTimeStartDate}
</if>
<if test="param.abolishTimeEndDate != null">
and lww.abolish_time &lt;= #{param.abolishTimeEndDate}
</if>
<if test="param.freezeTimeStartDate != null">
and lww.freeze_time &gt;= #{param.freezeTimeStartDate}
</if>
<if test="param.freezeTimeEndDate != null">
and lww.freeze_time &lt;= #{param.freezeTimeEndDate}
</if>
order by lww.create_time desc
</select>
</mapper>

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java

@ -71,4 +71,6 @@ public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEn
List<WarehouseWaybillEntity> findFreezeOrAbolishByWaybillNos(List<String> waybillNos);
WarehouseWaybillEntity findWaybillEntityByOrderPackageCode(String orderPackageCode);
IPage<WarehouseWaybillVO> pageFinanceWaybillList(WarehouseWaybillDTO waybillDTO);
}

111
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

@ -49,6 +49,7 @@ import com.logpm.warehouse.service.IWarehouseWarehousingEntryService;
import com.logpm.warehouse.vo.WarehouseWarehousingEntryVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
@ -290,69 +291,69 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
stockListEntity.setIncomingBatch(warehousingEntryDTO.getReceiptBatch());
DistributionStockListVO queryData = distributionStockListClient.getQueryData(stockListEntity);
DistributionStockListEntity entity = null;
//导入
//添加
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity();
distributionStockListEntity.setUnpack(false);
if (Func.isNotEmpty(queryData)) {
// distributionStockListEntity.setQuantityStock( queryData.getQuantityStock()+num ); //库存数量
// distributionStockListEntity.setOutboundQuantity(queryData.getOutboundQuantity()); //出库数量
//修改
entity = queryData;
entity.setQuantityStock(queryData.getQuantityStock() + num);
entity.setOutboundQuantity(queryData.getOutboundQuantity());
entity.setId(queryData.getId());
distributionStockListClient.getUpdateStockList(entity);
} else {
//添加
entity = new DistributionStockListEntity();
entity.setUnpack(false);
// distributionStockListEntity.setStockArticleId(distributionParcelList.getStockArticleId()); //订单ID
distributionStockListEntity.setOrderCode(Optional.ofNullable(warehousingEntryDTO.getOrderNumber()).orElse(null)); //订单自编号
distributionStockListEntity.setIncomingBatch(warehousingEntryDTO.getReceiptBatch()); //入库批次号
entity.setOrderCode(Optional.ofNullable(warehousingEntryDTO.getOrderNumber()).orElse(null)); //订单自编号
entity.setIncomingBatch(warehousingEntryDTO.getReceiptBatch()); //入库批次号
// distributionStockListEntity.setServiceNumber("服务号"); //服务号
distributionStockListEntity.setDescriptionGoods(warehousingDetail.getProductName()); //货物名称
distributionStockListEntity.setCargoNumber(warehousingDetail.getProductCode()); //货物编号
distributionStockListEntity.setWarehouseId(warehousingEntryDTO.getWarehouseId()); //仓库ID
distributionStockListEntity.setMarketId(warehousingEntryDTO.getClientId()); //商场及客户
distributionStockListEntity.setCargoUnit(warehousingDetail.getProductUnit()); //货物单位
distributionStockListEntity.setWarehousingTime(warehousingEntryDTO.getReceiptDate()); //入库时间
distributionStockListEntity.setLicensePlate(Optional.ofNullable(warehousingEntryDTO.getLicensePlate()).orElse(null)); //车牌
if (Func.isNotEmpty(warehousingEntryDTO.getStoreId())) {
distributionStockListEntity.setStoreId(warehousingEntryDTO.getStoreId()); //门店
}
if (Func.isNotEmpty(warehousingEntryDTO.getLicensePlate())) {
distributionStockListEntity.setDespatch(warehousingEntryDTO.getTrainNumber());//车次号运单
}
distributionStockListEntity.setServiceType(warehousingEntryDTO.getServiceType());
entity.setDescriptionGoods(warehousingDetail.getProductName()); //货物名称
entity.setCargoNumber(warehousingDetail.getProductCode()); //货物编号
entity.setWarehouseId(warehousingEntryDTO.getWarehouseId()); //仓库ID
entity.setMarketId(warehousingEntryDTO.getClientId()); //商场及客户
entity.setCargoUnit(warehousingDetail.getProductUnit()); //货物单位
entity.setWarehousingTime(warehousingEntryDTO.getReceiptDate()); //入库时间
entity.setLicensePlate(Optional.ofNullable(warehousingEntryDTO.getLicensePlate()).orElse(null)); //车牌
if (Func.isNotEmpty(warehousingEntryDTO.getStoreId())) {
entity.setStoreId(warehousingEntryDTO.getStoreId()); //门店
}
if (Func.isNotEmpty(warehousingEntryDTO.getLicensePlate())) {
entity.setDespatch(warehousingEntryDTO.getTrainNumber());//车次号运单
}
entity.setServiceType(warehousingEntryDTO.getServiceType());
// distributionStockListEntity.setStorageLocation("库位信息"); //库位信息
// distributionStockListEntity.setMallName(warehousingEntryDTO.getCustomerName()); //商场名称
// distributionStockListEntity.setUnit("单位");//单位
distributionStockListEntity.setWarehouseName(warehousingEntryDTO.getWarehouse());//仓库名称
entity.setWarehouseName(warehousingEntryDTO.getWarehouse());//仓库名称
// distributionStockListEntity.setStoreId(Long.parseLong("12312"));//门店ID
// distributionStockListEntity.setShoppingMall(warehousingEntryDTO.getClientId());//所属商场
// distributionStockListEntity.setMarketCode(warehousingEntryDTO.get);//商场编码
distributionStockListEntity.setMarketName(warehousingEntryDTO.getCustomerName());//商场名称
entity.setMarketName(warehousingEntryDTO.getCustomerName());//商场名称
// distributionStockListEntity.setStoreCode(warehousingEntryDTO.getStore);//门店编码
distributionStockListEntity.setStoreName(warehousingEntryDTO.getStoreName());//门店名称
distributionStockListEntity.setBrandName(warehousingDetail.getBrandName());//品牌]名称
distributionStockListEntity.setBrandId(warehousingDetail.getBrandId());//品牌ID
entity.setStoreName(warehousingEntryDTO.getStoreName());//门店名称
entity.setBrandName(warehousingDetail.getBrandName());//品牌]名称
entity.setBrandId(warehousingDetail.getBrandId());//品牌ID
// distributionStockListEntity.setFactory("工厂车次");//工厂车次
// distributionStockListEntity.setCategory("品分类");//品分类
distributionStockListEntity.setMaterialId(warehousingDetail.getMaterialId());//货物ID
entity.setMaterialId(warehousingDetail.getMaterialId());//货物ID
// distributionStockListEntity.setStoreName("门店名称");//门店名称
// distributionStockListEntity.setParcelListId(distributionParcelList.getId());//包件id
distributionStockListEntity.setQuantityOccupied(0);//冻结数量
distributionStockListEntity.setQuantityStock(num); //库存数量
distributionStockListEntity.setOutboundQuantity(0); //出库数量
distributionStockListEntity.setUnpackingQuantity(0); //库存拆包数量
distributionStockListEntity.setSku(warehousingDetail.getSku());
distributionStockListEntity.setSourceType("2");//导入
if (Func.isNotEmpty(queryData)) {
// distributionStockListEntity.setQuantityStock( queryData.getQuantityStock()+num ); //库存数量
// distributionStockListEntity.setOutboundQuantity(queryData.getOutboundQuantity()); //出库数量
//修改
DistributionStockListEntity distributionStockList = new DistributionStockListEntity();
distributionStockList.setQuantityStock(queryData.getQuantityStock() + num);
distributionStockList.setOutboundQuantity(queryData.getOutboundQuantity());
distributionStockList.setId(queryData.getId());
distributionStockListClient.getUpdateStockList(distributionStockList);
} else {
distributionStockListClient.getAddStockList(distributionStockListEntity);
entity.setQuantityOccupied(0);//冻结数量
entity.setQuantityStock(num); //库存数量
entity.setOutboundQuantity(0); //出库数量
entity.setUnpackingQuantity(0); //库存拆包数量
entity.setSku(warehousingDetail.getSku());
entity.setSourceType("2");
distributionStockListClient.getAddStockList(entity);
}
DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity();
BeanUtil.copyProperties(distributionStockListEntity, distributionStockListInfo);
BeanUtil.copyProperties(entity, distributionStockListInfo);
distributionStockListInfo.setSourceType("2");//导入
return distributionStockListInfoClient.addStockListInfoEntity(distributionStockListInfo);
}
@ -409,11 +410,11 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
entryEntity.setReceiptDate(o.getReceiptDate());
//入库批次号
if (ObjectUtils.isNull(o.getReceiptBatch())) {
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
entryEntity.setReceiptBatch("RK" + myCurrentWarehouse.getWarehouseCode() + time);
}
// if (ObjectUtils.isNull(o.getReceiptBatch())) {
// long time = new Date().getTime();
// BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
// entryEntity.setReceiptBatch("RK" + myCurrentWarehouse.getWarehouseCode() + time);
// }
entryEntity.setConditions("1");
// entryEntity.setReceiptBatch("1");
BasicdataClientEntity customer = basicdataClientClient.getCustomer(o.getCustomerName(), o.getCustomerCode());
@ -424,21 +425,21 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
entryEntity.setStoreId(customer1.getId());
entryEntity.setStoreName(o.getStoreName());
} else {
throw new ServiceException(o.getCustomerName() + o.getCustomerCode() + "门店信息不存在!!请维护门店数据!!!");
throw new CustomerException(o.getCustomerName() + o.getCustomerCode() + "门店信息不存在!!请维护门店数据!!!");
}
}
entryEntity.setClientId(customer.getId());//客户id
entryEntity.setCustomerName(o.getCustomerName());
entryEntity.setCustomerCode(o.getCustomerCode());
} else {
throw new ServiceException(o.getCustomerName() + o.getCustomerCode() + "客户信息不存在!!请维护客户数据!!!");
throw new CustomerException(o.getCustomerName() + o.getCustomerCode() + "客户信息不存在!!请维护客户数据!!!");
}
BasicdataWarehouseEntity warehouse = basicdataWarehouseClient.getWarehouse(o.getWarehouse(), o.getWarehouseCode());
if (Func.isNotEmpty(warehouse)) {
entryEntity.setWarehouseId(warehouse.getId());//仓库id
entryEntity.setWarehouse(o.getWarehouse());//仓库名称
} else {
throw new ServiceException(o.getCustomerName() + o.getCustomerCode() + "仓库信息不存在!!请维护仓库数据!!!");
throw new CustomerException(o.getCustomerName() + o.getCustomerCode() + "仓库信息不存在!!请维护仓库数据!!!");
}
entryEntity.setLogisticsCompany(Optional.ofNullable(o.getLogisticsCompany()).orElse(null));
entryEntity.setTrainNumber(Optional.ofNullable(o.getTrainNumber()).orElse(null)); //仓库名称
@ -492,14 +493,14 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
detail.setBrandName(brandList.getBrandName());
detail.setBrandId(brandList.getBrandId());
} else {
throw new ServiceException(i.getProductName() + i.getProductCode() + i.getSku() + "品牌信息不存在!!请维护客户品牌数据!!!");
throw new CustomerException(i.getProductName() + i.getProductCode() + i.getSku() + "品牌信息不存在!!请维护客户品牌数据!!!");
}
BasicMaterialEntity materialOwn = basicMaterialClient.getMaterialOwn(detail.getProductCode(), detail.getProductName(), detail.getSku());
if (Func.isNotEmpty(materialOwn)) {
detail.setMaterialId(materialOwn.getId());//物料ID
} else {
throw new ServiceException(i.getProductName() + i.getProductCode() + i.getSku() + "物料信息不存在!!请维护基础数据!!!");
throw new CustomerException(i.getProductName() + i.getProductCode() + i.getSku() + "物料信息不存在!!请维护基础数据!!!");
}
if (!detailEntityList.isEmpty()) {
boolean b = detailEntityList.stream().anyMatch(a -> a.getProductCode().equals(detail.getProductCode()) && a.getProductName().equals(detail.getProductName()) && a.getSku().equals(detail.getSku()));

36
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -807,6 +807,42 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
return baseMapper.findWaybillEntityByOrderPackageCode(orderPackageCode);
}
@Override
public IPage<WarehouseWaybillVO> pageFinanceWaybillList(WarehouseWaybillDTO waybillDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(waybillDTO.getPageNum());
page.setSize(waybillDTO.getPageSize());
waybillDTO.setDocumentMakingTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getDocumentMakingTimeStartStr()));
waybillDTO.setDocumentMakingTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getDocumentMakingTimeEndStr()));
waybillDTO.setCreateTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getCreateTimeStartStr()));
waybillDTO.setCreateTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getCreateTimeEndStr()));
waybillDTO.setAbolishTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getAbolishTimeStartStr()));
waybillDTO.setAbolishTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getAbolishTimeEndStr()));
waybillDTO.setFreezeTimeStartDate(CommonUtil.getStartByDateStr(waybillDTO.getFreezeTimeStartStr()));
waybillDTO.setFreezeTimeEndDate(CommonUtil.getEndByDateStr(waybillDTO.getFreezeTimeEndStr()));
IPage<WarehouseWaybillVO> pageList = baseMapper.pageFinanceWaybillList(page, waybillDTO);
List<WarehouseWaybillVO> records = pageList.getRecords();
if(!records.isEmpty()){
//把records中的id取出作为一个集合
List<Long> ids = records.stream().map(WarehouseWaybillVO::getId).collect(Collectors.toList());
List<WarehouseWayBillDetail> wayBillDetailList = warehouseWayBillDetailService.findByWaybillIds(ids);
//把wayBillDetailList通过waibillId分组
Map<Long, List<WarehouseWayBillDetail>> map = wayBillDetailList.stream().collect(Collectors.groupingBy(WarehouseWayBillDetail::getWaybillId));
for (WarehouseWaybillVO record : records) {
Long waybillId = record.getId();
record.setDetailList(map.get(waybillId));
}
pageList.setRecords(records);
}
return pageList;
}
private PrintPreviewVO buildPrintWallet(WarehouseWaybillEntity warehouseWaybillEntity, List<WarehouseWayBillDetail> warehouseWayBillDetails, BasicPrintTemplateEntity template) throws Exception {
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());

Loading…
Cancel
Save