Browse Source

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

dist.1.3.0
zhaoqiaobo 12 months ago
parent
commit
500eadf80d
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java
  2. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataTrayVO.java
  3. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java
  4. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java
  5. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java
  6. 14
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/EditOrderMsgVO.java
  7. 65
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/LoadingDetailExportVO.java
  8. 7
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OpenOrderVO.java
  9. 14
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java
  10. 2
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseWaybillVO.java
  11. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml
  12. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  13. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleStatisticsController.java
  14. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  15. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  16. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  17. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  18. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleStatisticsMapper.xml
  19. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  20. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java
  21. 33
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  22. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  23. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  24. 699
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  25. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/OrderPackageStatusFallJob.java
  26. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  27. 10
      blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java
  28. 18
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  29. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  30. 17
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  31. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml
  32. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingWaybillMapper.xml
  33. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.java
  34. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  35. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  36. 34
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  37. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  38. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  39. 18
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  40. 26
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  41. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  42. 209
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java
  43. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLineServiceImpl.java
  44. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  45. 146
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  46. 72
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java
  47. 206
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

2
blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java

@ -113,6 +113,8 @@ public class DictBizConstant {
public static final String OPEN_ORDER_URGENCY = "open_order_urgency";
public static final String OPEN_ORDER_RECEIPT = "open_order_receipt";
public static final String OPEN_ORDER_TRANSPORT_TYPE = "open_order_transport_type";
public static final String OPEN_ORDER_CHARGE_TYPE = "open_order_charge_type";
public static final String EDIT_WAYBILL_REASON_TYPE = "edit_waybill_reason_type";
/* 异常工单状态 */
public static final String PC_WORK_ORDER = "pc_work_order"; //PC工单异常类型

3
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataTrayVO.java

@ -49,4 +49,7 @@ public class BasicdataTrayVO extends BasicdataTrayEntity {
@ApiModelProperty(value = "打托方式显示")
private String trayTypeString;
@ApiModelProperty(value = "串货条件")
private String filterValue;
}

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java

@ -197,7 +197,7 @@ public class DistributionParcelListEntity extends TenantEntity {
* 运单ID
*/
@ApiModelProperty(value = "运单ID")
private String waybillId;
private Long waybillId;
/**
* 客户id
*/

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/OpenOrderDTO.java

@ -16,6 +16,8 @@ public class OpenOrderDTO implements Serializable {
private String brand;//品牌
private String trainNumber;//客户车次号
private String waybillNo;//运单号
private String departure;//发站
private String departureCode;
private Long departureWarehouseId;//发站仓id
private String departureWarehouseName;//发站仓名称
private String destination;//到站
@ -26,6 +28,8 @@ public class OpenOrderDTO implements Serializable {
private List<Long> advanceIds;//暂存单ids
private String orderCode;//订单号
private String openOrderDate;//开单时间
private String dearCode;//商场编码
private String dearName;//商场名称
private Long shipperId;//发货单位id
private String shipper;//发货单位

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineAdvanceDetailEntity.java

@ -90,6 +90,9 @@ public class TrunklineAdvanceDetailEntity extends TenantEntity {
/** 服务号 */
@ApiModelProperty(name = "服务号",notes = "")
private String serviceNum ;
/** 运单id */
@ApiModelProperty(name = "运单id",notes = "")
private Long waybillId ;
/** 运单号 */
@ApiModelProperty(name = "运单号",notes = "")
private String waybillNo ;

14
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/EditOrderMsgVO.java

@ -0,0 +1,14 @@
package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class EditOrderMsgVO implements Serializable {
private String itemName;
private String oldValue;
private String newValue;
}

65
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/LoadingDetailExportVO.java

@ -0,0 +1,65 @@
package com.logpm.trunkline.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class LoadingDetailExportVO implements Serializable {
@ExcelProperty(value = "运单号")
private String waybillNo;
@ExcelProperty(value = "配载批次")
private String carsNo;
@ExcelProperty(value = "合同号")
private String orderCode;
@ExcelProperty(value = "包条码-产品名称")
private String scanCode;
@ExcelProperty(value = "装车人")
private String loadingUserName;
@ExcelProperty(value = "装车仓库")
private String warehouseNname;
@ExcelProperty(value = "计划目的仓库")
private String finalNodeName;
@ExcelProperty(value = "装卸状态")
private String scanStatus;
@ExcelProperty(value = "托盘名称")
private String trayName;
@ExcelProperty(value = "托盘码")
private String trayCode;
@ExcelProperty(value = "卸车仓库")
private String unloadNodeName;
@ExcelProperty(value = "卸车人")
private String unloadUserName;
@ExcelProperty(value = "类型")
private String type;
@ExcelProperty(value = "数量")
private String num;
@ExcelProperty(value = "有无数据")
private String isData;
@ExcelProperty(value = "是否装车异常")
private String loadingAbnormal;
@ExcelProperty(value = "是否卸车异常")
private String unloadAbnormal;
@ExcelProperty(value = "是否补录")
private String isSupple;
}

7
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OpenOrderVO.java

@ -10,9 +10,12 @@ import java.util.List;
@Data
public class OpenOrderVO implements Serializable {
private Long brandId;
private String brand;
private String trainNumber;
private String orderCode;
private String dealerCode;
private String dealerName;
private List<Long> advanceIds = new ArrayList<>();
@ -22,6 +25,10 @@ public class OpenOrderVO implements Serializable {
private String destinationWarehouseName;//目的仓名称
private Long destinationWarehouseId;//目的仓Id
private String departure;//发站
private String departureCode;//发站编码
private List<String> departureArray;//发站
private String destination;//到站
private String destinationCode;//到站编码
private List<String> destinationArray;//到站

14
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWaybillEntity.java

@ -445,4 +445,18 @@ public class WarehouseWaybillEntity extends TenantEntity {
@ApiModelProperty(value = "成本件数")
private Integer costNum;
@ApiModelProperty(value = "发站")
private String departure;
@ApiModelProperty(value = "发站编码")
private String departureCode;
@ApiModelProperty(value = "商场编码")
private String dearCode;
@ApiModelProperty(value = "商场名称")
private String dearName;
}

2
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/WarehouseWaybillVO.java

@ -39,4 +39,6 @@ public class WarehouseWaybillVO extends WarehouseWaybillEntity {
private Integer handleNum;
private Long waybillId;
}

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTrayMapper.xml

@ -61,7 +61,8 @@
tray.tray_status,
warehouse.name AS warehouseName,
tray.`type`,
lwtt.tray_type
lwtt.tray_type,
lwtt.filter_value
FROM
logpm_warehouse_tray AS tray
left join logpm_warehouse_tray_type lwtt on tray.id = lwtt.tray_id and lwtt.is_deleted=0

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -503,24 +503,6 @@ public class DistributionStockupAppController extends BladeController {
@ApiOperation(value = "零担备货")
public R zeroStockUp(@RequestBody StockupZeroDTO stockupDTO) {
log.debug("=====零担备货:{}", stockupDTO);
if (ObjectUtils.isNull(stockupDTO.getStockupId())) {
return R.fail(3002, "备货id不能为空 !");
}
if (ObjectUtils.isNull(stockupDTO.getStockArticleId())) {
return R.fail(3002, "订单ID不能为空 !");
}
if (ObjectUtils.isNull(stockupDTO.getOrderCode())) {
return R.fail(3002, "订单自编号不能为空 !");
}
if (ObjectUtils.isNull(stockupDTO.getReservationId())) {
return R.fail(3002, "预约单号不能为空 !");
}
if (ObjectUtils.isNull(stockupDTO.getTypeService())) {
return R.fail(3002, "备货业务类型不能为空 !");
}
/* if (ObjectUtils.isNull(stockupDTO.getAllocationId())) {
return R.fail(3002, "库位信息不能为空 !");
}*/
R b = distributionStockupService.zeroStockUp(stockupDTO);
return b;
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleStatisticsController.java

@ -18,7 +18,7 @@ public class DistributionStockArticleStatisticsController extends BladeControlle
private IDistributionStockArticleStatisticsService distributionStockArticleStatisticsService;
@GetMapping(value = "/collect")
public R<DistributionStockArticleStatisticsDTO> collect(@RequestParam(required = false) DistributionStockArticleOweDTO distributionStockArticleOweDTO) {
public R<DistributionStockArticleStatisticsDTO> collect(DistributionStockArticleOweDTO distributionStockArticleOweDTO) {
DistributionStockArticleStatisticsDTO collect = distributionStockArticleStatisticsService.collect(distributionStockArticleOweDTO);
return R.data(collect);
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -98,7 +98,7 @@
ldl.signing_time signingTimes,
ldl.signing_user signingUser,
ldl.scan_user scanUser,
ldl.vehicle_name vehicleName,
lddl.vehicle_name vehicleName,
ldsa.type_service typeService,
ldbl.pickup_batch pickupBatch
FROM
@ -109,10 +109,10 @@
LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.parce_list_id = ldpl.id and ldrp.packet_bar_status in (1,3)
LEFT JOIN logpm_distribution_reservation ldr on ldr.id = ldrp.reservation_id
LEFT JOIN logpm_distribution_signfor AS lds ON lds.reservation_id = ldr.id
LEFT JOIN logpm_distribution_loadscan ldl on ldl.package_id = ldpl.id and ldl.scan_status !=1
LEFT JOIN logpm_distribution_loadscan ldl on ldl.package_id = ldpl.id and ldl.scan_status !=1 AND ldl.is_deleted = 0
LEFT JOIN logpm_distribution_delivery_list lddl on lddl.id = lds.delivery_id
left join logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id
LEFT JOIN logpm_distrilbution_bill_package AS ldbp ON ldbp.parce_list_id = ldpl.id
LEFT JOIN logpm_distrilbution_bill_package AS ldbp ON ldbp.parce_list_id = ldpl.id and ldbp.packet_bar_status != 2
LEFT JOIN logpm_distrilbution_bill_lading ldbl ON ldbl.id = ldbp.bill_lading_id
<where>

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -1221,9 +1221,12 @@
<select id="getCategoryByStockArticleIdAndReservationId" resultType="java.util.Map">
select IFNULL(ldpl.third_product,'其他') thirdProduct,
IFNULL(count( ldl.id ) ,0) AS aaa,
count(ldpl.id) num
from logpm_distribution_reservation_package ldrp
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id and ldpl.is_deleted = 0
LEFT JOIN logpm_distribution_loadscan AS ldl ON ldpl.id = ldl.package_id AND ldrp.reservation_id = ldl.reservation_id AND ldl.is_deleted = 0 AND ldl.scan_status != 1
where 1=1
and ldrp.reservation_id = #{reservationId}
and ldrp.stock_article_id = #{stockArticleId}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml

@ -1038,7 +1038,7 @@
LEFT JOIN logpm_distribution_loadscan AS ldl ON ldla.package_id = ldl.package_id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldla.package_id = ldpl.id
WHERE
ldla.reservation_id = #{reservationId} and ldl.reservation_id = #{reservationId} and ldla.delivery_list_id = #{deliveryListId} AND ldl.scan_status != 1
ldla.reservation_id = #{reservationId} and ldl.reservation_id = #{reservationId} and ldla.delivery_list_id = #{deliveryListId} AND ldl.scan_status != 1 AND ldl.is_deleted = 0
</select>
<select id="selectSignImgsUrl" resultType="com.logpm.distribution.vo.DistributionSignPrintVO">
SELECT * FROM logpm_distribution_sign_print WHERE reservation_id = #{reservationId} and is_deleted = 0

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -841,12 +841,12 @@
group_concat(DISTINCT lwt.pallet_name) as trays,
group_concat(DISTINCT lwug.position_code) as allocation
from logpm_platform.logpm_distribution_stock_article ldsa
left join logpm_platform.logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id and ldpl.tenant_id = '627683'
left join logpm_platform.logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id
left join logpm_platform.logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
left join logpm_platform.logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
left JOIN logpm_warehouse_tray lwt on lwtg.tray_id= lwt.id
<where>
ldsa.is_deleted = 0 and ldsa.order_status != '80'
ldsa.is_deleted = 0 and ldsa.order_status IN ( 10, 20, 30, 40, 50, 60, 70 )
<if test="paramMap.warehouseId != null and paramMap.warehouseId != ''">
and ldsa.warehouse_id = #{paramMap.warehouseId}
</if>
@ -859,9 +859,7 @@
<if test="paramMap.trainNumber != null and paramMap.trainNumber != ''"> and ldsa.train_number = #{paramMap.trainNumber} </if>
<if test="paramMap.acceptWarehouseName != null and paramMap.acceptWarehouseName != ''"> and ldsa.accept_warehouse_name = #{paramMap.acceptWarehouseName} </if>
<if test="paramMap.tenantId != null and paramMap.tenantId != ''">
and ldsa.tenant_id = #{paramMap.tenantId}
</if>
<if test="paramMap.serviceNumber != null and paramMap.serviceNumber != ''">
and ldsa.servic_nNumber = #{paramMap.serviceNumber}
</if>

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleStatisticsMapper.xml

@ -3,7 +3,7 @@
<mapper namespace="com.logpm.distribution.mapper.DistributionStockArticleStatisticsMapper">
<select id="collect" resultType="com.logpm.distribution.dto.DistributionStockArticleStatisticsDTO">
select
count(distinct ldsa.waybill_id) waybillNum,
count(distinct ldpl.waybill_number) waybillNum,
count(distinct ldsa.order_code) orderNum,
count(distinct ldpl.id) packageCodeNum
from logpm_distribution_stock_article ldsa
@ -104,8 +104,7 @@
</if>
<if test=" param.completeSet != null ">and ldsa.complete_set like concat('%',#{param.completeSet},'%')
</if>
<if test=" param.typeService != null and param.groundingStatus != '' ">and ldsa.type_service like concat('%',#{param.typeService},'%')
</if>
<if test=" param.customerName != null and param.customerName != '' ">and ldsa.customer_name like
concat('%',#{param.customerName},'%')
</if>

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -49,7 +49,7 @@
dbl.total_cost totalCost,
dbl.pick_up_plate pickUpPlate,dbl.pickup_batch pickupBatch,
(
select COUNT(id)
select COUNT(quantity)
from logpm_distribution_bill_lading_scan
where bill_lading_id = dbl.id
) stopNum,

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java

@ -188,6 +188,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
List<DistributionStockArticleVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryOrderPage(page, distributionStockArticle);
List<DistributionLoadscanEntity> loadList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionStockArticle.get("deliveryId"))
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
Map<Long, List<DistributionLoadscanEntity>> orderLoadMap;
if (!Objects.isNull(loadList)) {
@ -249,6 +250,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
List<DistributionStockArticleVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryOrderPageByDeliveryId(Long.parseLong(deliveryId));
List<DistributionLoadscanEntity> loadList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionStockArticle.get("deliveryId"))
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
Map<Long, List<DistributionLoadscanEntity>> orderLoadMap;
if (!Objects.isNull(loadList)) {

33
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -2805,7 +2805,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
reservationEntity.setCreateUser(user.getUserId());
reservationEntity.setDeliveryWay(reservation.getDeliveryWay());
reservationEntity.setCreateTime(new Date());
reservationEntity.setCreateDept(Long.parseLong(user.getDeptId()));
reservationEntity.setCreateDept(myCurrentWarehouse.getDepartment());
reservationEntity.setUpdateTime(new Date());
reservationEntity.setUpdateUser(user.getUserId());
reservationEntity.setIsDeleted(0);
@ -6577,17 +6577,22 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
for (Map<String, Object> m : mapList) {
String thirdProduct = (String) m.get("thirdProduct");
Long num = (Long) m.get("num");
Long signNum = (Long) m.get("aaa");
if (thirdProduct.equals(key)) {
numObj.put(key, num);
tn = tn + num.intValue();
}
orderMap.put("签收件数", signNum);
}
}
}
orderMap.put("合计数量", tn);
orderMap.put("产品明细", numObj);
orderMap.put("产品明细长度", numObj.size());
//通过订单id和预约id查询对应包件的物料信息
List<String> materialNameStrList = distributionReservationMapper.getMaterialNameByStockArticleIdAndReservationId(stockArticleId, reservationId);
String materialNameStr = StringUtils.join(materialNameStrList, ",");
@ -7125,12 +7130,28 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
log.info(method + "存在装车数据:{}", reservationCodes);
return R.fail(deliveryListEntity.getTrainNumber() + "存在装车包件!!!");
}
//该配送是否存在异常装车或者异常签收数据
List<DistributionLoadscanEntity> loadscanEntityList = distributionDeliveryListService.selectAbnormalLoadingBydeliveryId(deliveryId);
if (Func.isNotEmpty(loadscanEntityList)) {
log.info(method + "存在异常装车数据:{}", deliveryId);
return R.fail(reservationCodes + "存在异常装车、签收包条!!!");
List<Long> ids = reservationEntities.stream().map(DistributionReservationEntity::getId).collect(Collectors.toList());
List<DistributionLoadscanEntity> packageList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getReservationId, ids)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
List<DistributionLoadscaninvnEntity> inventoryList = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
.eq(DistributionLoadscaninvnEntity::getReservationId, ids)
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (!packageList.isEmpty() || !inventoryList.isEmpty()){
log.info(method + "取消配送存在装车数据:{}", deliveryId);
return R.fail(reservationCodes + "存在装车、签收数据!!!");
}
// //该配送是否存在异常装车或者异常签收数据
// List<DistributionLoadscanEntity> loadscanEntityList = distributionDeliveryListService.selectAbnormalLoadingBydeliveryId(deliveryId);
// if (Func.isNotEmpty(loadscanEntityList)) {
// log.info(method + "存在异常装车数据:{}", deliveryId);
// return R.fail(reservationCodes + "存在异常装车、签收包条!!!");
// }
boolean flag = false;
for (DistributionReservationEntity reservationEntity : reservationEntities) {
DistributionReservationDTO reservationDTO = Func.copy(reservationEntity, DistributionReservationDTO.class);

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -737,7 +737,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
Set<String> orderCodes = new TreeSet<>();
for (DistributionParcelListEntity parcelListEntity : listEntityList) {
Long packageWarehouseId = parcelListEntity.getWarehouseId();
parcelListEntity.setWaybillId(waybillId + "");
parcelListEntity.setWaybillId(waybillId);
parcelListEntity.setWaybillNumber(waybillNo);
parcelListEntity.setSendWarehouseId(departureWarehouseId);
parcelListEntity.setSendWarehouseName(departureWarehouseName);

24
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -601,6 +601,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
DistributionSignforEntity distributionSignfor = this.getById(distributionSignforDTO.getId());
Integer loadingNum = distributionSignfor.getLoadedNumber() + distributionSignfor.getLoadedinNumber();
Integer signNum = distributionSignfor.getReceivedQuantity() + distributionSignfor.getReceivedinQuantity();
if (Func.equals(loadingNum,signNum)){
log.error("复核签收装车数和签收数不一致,装车数:{},签收数:{}", loadingNum,signNum);
return R.fail("请维护计划后进行复核!!!");
}
BladeUser user = AuthUtil.getUser();
distributionSignfor.setExamineUserId(user.getUserId());
distributionSignfor.setSigningStatus(SignforStatusConstant.yiqianshou.getValue());
@ -2842,21 +2848,28 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//查询装车扫描表
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
// .eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
// .eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
DistributionLoadscanEntity loadscanEntity = null;
if (loadscanEntityList.isEmpty()){
if (!loadscanEntityList.isEmpty()){
if (loadscanEntityList.size() == 1){
if (loadscanEntityList.get(0).getReservationId().equals(distrilbutionloadingscanDTO.getReservationId())) {
loadscanEntity = loadscanEntityList.get(0);
}else {
log.error("##############异常签收包件在其他车次进行装车reservationId:{}", loadscanEntityList.stream().map(DistributionLoadscanEntity::getReservationId).map(String::valueOf).collect(Collectors.joining(",")));
return Resp.scanFail("操作失败", "包件已出库");
}
}
if (loadscanEntityList.size() > 1){
log.error("##############异常签收包件在其他车次进行装车reservationId:{}", loadscanEntityList.stream().map(DistributionLoadscanEntity::getReservationId).map(String::valueOf).collect(Collectors.joining(",")));
return Resp.scanFail("操作失败", "包件已出库");
}
if (loadscanEntityList.size() == 1){
loadscanEntity = loadscanEntityList.get(0);
}
}
if (Func.isNotEmpty(loadscanEntity)) {
@ -2898,6 +2911,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity.setReceivedQuantity(parcelListEntity.getQuantity());
distributionLoadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
distributionLoadscanEntity.setIsSignfor(2);
distributionLoadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
distributionLoadscanEntity.setIsInsert(2);
distributionLoadscanEntity.setSignforState(2);
distributionLoadscanEntity.setPackageNub(parcelListEntity.getQuantity());

699
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

File diff suppressed because it is too large Load Diff

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/OrderPackageStatusFallJob.java

@ -47,6 +47,7 @@ public class OrderPackageStatusFallJob {
orderPackageStatusPushFailLogEntity.setDataStatus(1);
}catch (CustomerException e){
XxlJobLogger.log(e);
log.error("##################getOrderPackageFromOldSystem: 处理推送失败数据",e);

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -235,7 +235,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.getListByOrderPackageCode(orderPackageCode);
for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) {
Long warehouseId = parcelListEntity.getWarehouseId();
parcelListEntity.setWaybillId(waybillId+"");
parcelListEntity.setWaybillId(waybillId);
parcelListEntity.setWaybillNumber(waybillNo);
parcelListEntity.setSendWarehouseId(departureWarehouseId);
parcelListEntity.setSendWarehouseName(departureWarehouseName);

10
blade-service/logpm-supervise/src/main/java/com/logpm/supervise/service/impl/IndicatorsServiceImpl.java

@ -189,8 +189,14 @@ public class IndicatorsServiceImpl extends BaseServiceImpl<IndicatorsMapper, Ind
exportIndicatorsVO.setCreateDeptName(deptName);
Long createUser = exportIndicatorsVO.getCreateUser();
R<User> userR = userClient.userInfoById(createUser);
String userName = userR.getData().getName();
exportIndicatorsVO.setCreateUserName(userName);
if(userR.isSuccess()){
if(!Objects.isNull(userR.getData())){
String userName = userR.getData().getName();
exportIndicatorsVO.setCreateUserName(userName);
}
}
}
return list;

18
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java

@ -7,6 +7,7 @@ import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.dto.*;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.vo.LoadingDetailExportVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import com.logpm.trunkline.vo.ZeroSuppleVO;
import io.swagger.annotations.Api;
@ -14,11 +15,14 @@ import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.Enumeration;
import java.util.List;
@ -1189,6 +1193,20 @@ public class CarsLoadController {
}
}
@ResponseBody
@PostMapping("/loadingDetailExport")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "装车明细导出", notes = "传入loadCarsDTO")
public void loadingDetailExport(@RequestBody LoadCarsDTO loadCarsDTO, HttpServletResponse response) {
String method = "############loadingDetailExport: ";
log.info(method+"请求参数{}",loadCarsDTO);
List<LoadingDetailExportVO> ls = carsLoadService.loadingDetailExport(loadCarsDTO);
//导出ls
ExcelUtil.export(response, "未盘点任务数据" + DateUtil.time(), "未盘点任务数据数据表", ls, LoadingDetailExportVO.class);
}
@ResponseBody
@PostMapping("/carsLoadDetailInfo")
@ApiOperationSupport(order = 1)

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -170,7 +170,8 @@
<update id="updateWaybillNoByAdvanceId" >
update logpm_trunkline_advance_detail
set waybill_no = #{waybillNo}
set waybill_no = #{waybillNo},
waybill_id = #{waybillId}
where advance_id = #{advanceId}
</update>

17
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -84,7 +84,9 @@
<select id="selectInfoByIds" resultType="com.logpm.trunkline.vo.OpenOrderVO">
select GROUP_CONCAT(DISTINCT brand) brand,
GROUP_CONCAT(DISTINCT train_number) trainNumber,
GROUP_CONCAT(DISTINCT order_code) orderCode
GROUP_CONCAT(DISTINCT order_code) orderCode,
GROUP_CONCAT(DISTINCT dealer_code) dealerCode,
GROUP_CONCAT(DISTINCT dealer_name) dealerName
from logpm_trunkline_advance
where is_deleted = 0
and id in
@ -138,19 +140,22 @@
</update>
<select id="findIncomingOrderList" resultType="com.logpm.trunkline.vo.TrunklineAdvanceVO">
select lta.*
from logpm_trunkline_advance lta
select lta.*,
max(IF(ltad.package_status = '0',1,0)) isIncoming
from logpm_trunkline_advance_detail ltad
left join logpm_trunkline_advance lta on lta.id = ltad.advance_id
WHERE 1=1
and lta.warehouse_id = #{param.warehouseId}
and ltad.warehouse_id = #{param.warehouseId}
<if test="param.incomingType == 4" >
and lta.train_number = #{param.incomingCode}
and ltad.train_number = #{param.incomingCode}
</if>
<if test="param.incomingType == 5" >
and lta.order_code in
and ltad.order_code in
<foreach collection="param.orderCodes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
group by lta.id
</select>
<select id="findAllNumByOrderCode" resultType="int">

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml

@ -30,7 +30,7 @@
count(DISTINCT ltbl.id) nodeNub,
count(DISTINCT ltbw.id) waybillCount
from logpm_trunkline_billlading ltb
left join logpm_trunkline_billlading_line ltbl on ltbl.billlading_id = ltb.id
left join logpm_trunkline_billlading_line ltbl on ltbl.billlading_id = ltb.id and ltbl.is_deleted = 0
left join logpm_trunkline_billlading_waybill ltbw on ltbw.billlading_id = ltb.id and ltbw.waybill_no != '————'
where ltb.is_deleted = 0
<if test="param.warehouseId != null ">
@ -85,7 +85,8 @@
<select id="findWaybillListNotBillladingId" resultType="com.logpm.warehouse.vo.WarehouseWaybillVO">
select lww.waybill_no waybillNo,
select lww.id waybillId,
lww.waybill_no waybillNo,
lww.create_time createTime,
lww.goods_name goodsName,
lww.destination destination,

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

@ -48,6 +48,7 @@
left join logpm_trunkline_billlading ltb on ltb.id = ltbw.billlading_id
left join logpm_warehouse_waybill lww on lww.waybill_no = ltbw.waybill_no
where ltbw.billlading_id = #{billladingId}
and ltbw.is_deleted = 0
</select>
<update id="updateDataByBillladingWaybillId" >

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.java

@ -17,6 +17,11 @@ import java.util.List;
@Mapper
public interface TrunklineCarsLoadMapper extends BaseMapper<TrunklineCarsLoadEntity> {
/**
* @param page
* @param loadCarsDTO
* @return
*/
IPage<TrunklineCarsLoadVO> loadCarsPageList(IPage<Object> page, @Param("param") LoadCarsDTO loadCarsDTO);
IPage<TrunklineCarsLoadVO> arriveCarsPageList(IPage<Object> page, @Param("param") LoadCarsDTO loadCarsDTO);

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -41,6 +41,7 @@
left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcl.id
where ltcl.is_deleted = 0
and ltcl.load_type != '4'
and ltcl.load_status != '100'
<if test="param.warehouseId != null" >
and ltcl.start_warehouse_id = #{param.warehouseId}
</if>
@ -375,6 +376,7 @@
</if>
<if test="param.type != null and param.type == 1">
and ltcl.load_status = '0'
and ltcl.load_status != '100'
</if>
<if test="param.type != null and param.type == 2">
and ltcl.load_status != '0'

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

@ -126,4 +126,6 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
List<WaybillCarsLoadVO> findWaybillCarsLoadInfo(@Param("waybillId") Long waybillId);
List<WaybillCarsLoadVO> findWaybillTransferInfo(@Param("waybillId") Long waybillId);
List<LoadingDetailExportVO> loadingDetailExport(@Param("param") LoadCarsDTO loadCarsDTO);
}

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

@ -583,10 +583,42 @@
ltcl.remark remark
from logpm_trunkline_cars_load_scan ltcls
left join logpm_trunkline_cars_load ltcl on ltcl.id = ltcls.load_id
where ltcls.waybill_no = #{waybillNo}
where ltcls.waybill_id = #{waybillId}
and ltcl.load_type = 4
group by ltcl.cars_no
order By ltcl.start_time asc
</select>
<select id="loadingDetailExport" resultType="com.logpm.trunkline.vo.LoadingDetailExportVO">
select ltcls.tray_code trayCode,
ltcls.unload_node_name unloadNodeName,
ltcls.order_code orderCode,
ltcls.warehouse_name warehouseNname,
ltcls.unload_user_name unloadUserName,
IF(ltcls.unload_abnormal = 1,'是','否') unloadAbnormal,
IF(ltcls.is_supple = 1,'是','否') isSupple,
ltcls.cars_no carsNo,
ltcls.scan_code scanCode,
ltcls.final_node_name finalNodeName,
case ltcls.scan_status
when '1' then '装车'
when '2' then '卸车'
when '3' then '签收'
end scanStatus,
ltcls.tray_name trayName,
ltcls.num num,
IF(ltcls.is_data = 1,'有','无') isData,
ltcls.waybill_no waybillNo,
ltcls.loading_user_name loadingUserName,
case ltcls.type
when 1 then '订制品'
when 2 then '零担'
end type,
IF(ltcls.loading_abnormal = 1,'是','否') loadingAbnormal
from logpm_trunkline_cars_load_scan ltcls
where ltcls.load_id = #{param.loadId}
order by ltcls.create_time asc
</select>
</mapper>

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java

@ -122,4 +122,5 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<WaybillCarsLoadVO> findWaybillTransferInfo(Long waybillId);
List<LoadingDetailExportVO> loadingDetailExport(LoadCarsDTO loadCarsDTO);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java

@ -5,6 +5,7 @@ import com.logpm.trunkline.dto.BatchUnloadDTO;
import com.logpm.trunkline.dto.LoadCarsDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.vo.LoadingDetailExportVO;
import com.logpm.trunkline.vo.TripartiteTransferVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import org.springblade.core.mp.base.BaseService;
@ -205,4 +206,5 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R findWaybillTransferInfo(Long waybillId);
List<LoadingDetailExportVO> loadingDetailExport(LoadCarsDTO loadCarsDTO);
}

18
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -146,15 +146,15 @@ public class InComingServiceImpl implements IInComingService {
}
List<TrunklineAdvanceVO> ls = advanceService.findIncomingOrderList(inComingDTO);
for (TrunklineAdvanceVO advanceVO : ls) {
Long advanceId = advanceVO.getId();
Integer num = advanceDetailService.findListByAdvanceIdAndPackageStatus(advanceId,"0");
if(num > 0){
advanceVO.setIsIncoming(1);
}else{
advanceVO.setIsIncoming(0);
}
}
// for (TrunklineAdvanceVO advanceVO : ls) {
// Long advanceId = advanceVO.getId();
// Integer num = advanceDetailService.findListByAdvanceIdAndPackageStatus(advanceId,"0");
// if(num > 0){
// advanceVO.setIsIncoming(1);
// }else{
// advanceVO.setIsIncoming(0);
// }
// }
return R.data(ls);
}

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

@ -94,9 +94,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
page.setCurrent(advanceDTO.getPageNum());
page.setSize(advanceDTO.getPageSize());
IPage<TrunklineAdvanceVO> pageList = advanceService.advancePageList(page, advanceDTO);
return pageList;
return advanceService.advancePageList(page, advanceDTO);
}
@Override
@ -139,6 +137,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
OpenOrderVO infoByIds = advanceService.selectInfoByIds(advanceIds);
BeanUtil.copy(infoByIds, openOrderVO);
openOrderVO.setAdvanceIds(advanceIds);
BasicdataBrandEntity basicdataBrandEntity = basicdataBrandClient.findEntityByName(brand);
if(!Objects.isNull(basicdataBrandEntity)){
openOrderVO.setBrandId(basicdataBrandEntity.getId());
}
//发站仓-----目前登录人的仓库
openOrderVO.setDepartureWarehouseName(basicdataWarehouseEntity.getName());
openOrderVO.setDepartureWarehouseId(warehouseId);
@ -303,13 +305,19 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
Long destinationWarehouseId = openOrderDTO.getDestinationWarehouseId();
String brand = openOrderDTO.getBrand();
BasicdataBrandEntity basicdataBrandEntity = basicdataBrandClient.findEntityByName(brand);
Long brandId = openOrderDTO.getBrandId();
WarehouseWaybillEntity waybillEntity = new WarehouseWaybillEntity();
waybillEntity.setWaybillNo(waybillNo);
if (!Objects.isNull(basicdataBrandEntity)) {
waybillEntity.setBrandId(basicdataBrandEntity.getId());
if(Objects.isNull(brandId)){
BasicdataBrandEntity basicdataBrandEntity = basicdataBrandClient.findEntityByName(brand);
if (!Objects.isNull(basicdataBrandEntity)) {
brandId = basicdataBrandEntity.getId();
}
}
waybillEntity.setBrandId(brandId);
waybillEntity.setBrand(brand);
waybillEntity.setOrderNo(openOrderDTO.getOrderCode());
waybillEntity.setDepartureWarehouseId(departureWarehouseId);
@ -526,8 +534,8 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}
//判断是否是开单及入库的配置
Boolean aBoolean = basicdataOpenIncomingClient.checkOpenIncoming(warehouseId, basicdataBrandEntity.getId());
if (aBoolean) {
Boolean aBoolean = basicdataOpenIncomingClient.checkOpenIncoming(warehouseId, brandId);
if (Boolean.TRUE.equals(aBoolean)) {
openOrderAsyncService.incomingPackageBatch(advanceIds, AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getTenantId(), AuthUtil.getNickName(), IncomingTypeEnum.OPEN_TO_IN.getCode());
}
@ -2823,7 +2831,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
entity.setOrderPackageStockupStatus("10");
entity.setOrderPackageReservationStatus("10");
entity.setOrderPackageLoadingStatus("10");
entity.setWaybillId(warehouseWaybill.getId() + "");
entity.setWaybillId(warehouseWaybill.getId());
entity.setWaybillNumber(warehouseWaybill.getWaybillNo());
entity.setIsZero("1");
entity.setWarehouseEntryTimeEnd(date);

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -227,7 +227,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
if(StringUtil.isNotBlank(waybillNo)){
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
if(!Objects.isNull(waybillEntity)){
parcelList.setWaybillId(waybillEntity.getId()+"");
parcelList.setWaybillId(waybillEntity.getId());
parcelList.setWaybillNumber(waybillEntity.getWaybillNo());
parcelList.setSendWarehouseId(waybillEntity.getDepartureWarehouseId());
parcelList.setSendWarehouseName(waybillEntity.getDepartureWarehouseName());
@ -551,7 +551,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
if(StringUtil.isNotBlank(waybillNo)){
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
if(!Objects.isNull(waybillEntity)){
parcelList.setWaybillId(waybillEntity.getId()+"");
parcelList.setWaybillId(waybillEntity.getId());
parcelList.setWaybillNumber(waybillEntity.getWaybillNo());
parcelList.setSendWarehouseId(waybillEntity.getDepartureWarehouseId());
parcelList.setSendWarehouseName(waybillEntity.getDepartureWarehouseName());

209
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -56,9 +57,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
page.setCurrent(billladingDTO.getPageNum());
page.setSize(billladingDTO.getPageSize());
IPage<TrunklineBillladingVO> pageList = baseMapper.pageList(page,billladingDTO);
return pageList;
return baseMapper.pageList(page,billladingDTO);
}
@Override
@ -124,7 +123,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
logEntity.setCreateUserName(AuthUtil.getUserName());
logEntity.setContent("创建提货单 billladingCode="+billladingCode);
logEntity.setBillladingId(billladingId);
logEntity.setAfterOpreation(JSONObject.toJSONString(trunklineBillladingEntity));
logEntity.setAfterOpreation(JSON.toJSONString(trunklineBillladingEntity));
trunklineBillladingLogService.save(logEntity);
}
@ -138,9 +137,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
billladingDTO.setBillladingStatus("2");
IPage<TrunklineBillladingVO> pageList = baseMapper.pageInfoList(page,billladingDTO);
return pageList;
return baseMapper.pageInfoList(page,billladingDTO);
}
@Override
@ -168,7 +165,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
logEntity.setCreateUserName(AuthUtil.getUserName());
logEntity.setContent("修改提货单 billladingCode="+billladingCode);
logEntity.setBillladingId(billladingId);
logEntity.setBeforeOpreation(JSONObject.toJSONString(billladingEntity));
logEntity.setBeforeOpreation(JSON.toJSONString(billladingEntity));
BeanUtil.copy(billladingDTO,billladingEntity);
updateById(billladingEntity);
@ -189,10 +186,11 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
}
TrunklineBillladingLineEntity billladingLineEntity = new TrunklineBillladingLineEntity();
BeanUtil.copy(billladingLineVO,billladingLineEntity);
billladingLineEntity.setId(null);
billladingLineEntity.setBillladingId(billladingId);
billladingLineEntity.setWarehouseId(warehouseId);
billladingLineEntity.setWarehouseName(warehouseName);
billladingLineService.saveOrUpdate(billladingLineEntity);
billladingLineService.save(billladingLineEntity);
}
billladingEntity.setLineNameTitle(lineTitle);
updateById(billladingEntity);
@ -221,7 +219,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
}
}
logEntity.setAfterOpreation(JSONObject.toJSONString(billladingEntity));
logEntity.setAfterOpreation(JSON.toJSONString(billladingEntity));
trunklineBillladingLogService.save(logEntity);
}
@ -231,94 +229,101 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
log.info("#############updateBillladingStatus: 更新提货单状态 type={}",type);
TrunklineBillladingEntity billladingEntity = baseMapper.selectById(billladingId);
if(Objects.isNull(billladingEntity)){
log.warn("##################updateBillladingStatus: 提货单不存在 billladingId={}",billladingId);
throw new CustomerException(405,"提货单不存在");
}
String billladingCode = billladingEntity.getBillladingCode();
StringBuilder stringBuffer = new StringBuilder();
TrunklineBillladingLogEntity logEntity = new TrunklineBillladingLogEntity();
logEntity.setWarehouseId(warehouseId);
logEntity.setWarehouseName(warehouseName);
logEntity.setCreateUserName(AuthUtil.getUserName());
logEntity.setBillladingId(billladingId);
logEntity.setBeforeOpreation(JSONObject.toJSONString(billladingEntity));
stringBuffer.append("变更提货单状态 billladingCode=").append(billladingCode);
String billladingStatus = billladingEntity.getBillladingStatus();
//提货单状态 1=未开始,2=提货中,3=已完成,4=已结算 5=已取消
switch (type){
case 1://开始提货
if("1".equals(billladingStatus)){
billladingEntity.setBillladingStatus("2");
billladingEntity.setStartTime(new Date());
stringBuffer.append(",未开始变更为提货中");
}else{
log.warn("##################updateBillladingStatus: 提货单不能更新为提货中 billladingStatus={}",billladingStatus);
throw new CustomerException(405,"提货单不能更新为提货中");
}
break;
case 2://提货完成
if("2".equals(billladingStatus)){
billladingEntity.setBillladingStatus("3");
billladingEntity.setEndTime(new Date());
stringBuffer.append(",提货中变更为提货完成");
}else{
log.warn("##################updateBillladingStatus: 提货单不能更新为已完成 billladingStatus={}",billladingStatus);
throw new CustomerException(405,"提货单不能更新为已完成");
}
break;
case 3://取消完成
if("3".equals(billladingStatus)){
billladingEntity.setBillladingStatus("2");
billladingEntity.setEndTime(null);
stringBuffer.append(",提货完成变更为提货中");
}else{
log.warn("##################updateBillladingStatus: 提货单不能更新为提货中 billladingStatus={}",billladingStatus);
throw new CustomerException(405,"提货单不能更新为提货中");
}
break;
case 4://结算
if("3".equals(billladingStatus)){
Date date = new Date();
billladingEntity.setBillladingStatus("4");
billladingEntity.setSettlementTime(date);
billladingEntity.setSettlementId(AuthUtil.getUserId());
billladingEntity.setSettlementName(AuthUtil.getUserName());
stringBuffer.append(",提货完成变更为已结算,时间"+ CommonUtil.dateToString(date)+",变更人"+AuthUtil.getUserName());
}else{
log.warn("##################updateBillladingStatus: 提货单不能更新为已结算 billladingStatus={}",billladingStatus);
throw new CustomerException(405,"提货单不能更新为提货中");
}
break;
case 5://取消结算
if("4".equals(billladingStatus)){
billladingEntity.setBillladingStatus("3");
billladingEntity.setSettlementTime(null);
billladingEntity.setSettlementId(null);
billladingEntity.setSettlementName(null);
stringBuffer.append(",已结算变更为提货完成,时间"+ CommonUtil.dateToString(new Date())+",变更人"+AuthUtil.getUserName());
}else{
log.warn("##################updateBillladingStatus: 提货单不能更新为提货完成 billladingStatus={}",billladingStatus);
throw new CustomerException(405,"提货单不能更新为提货完成");
}
break;
case 6://取消提货
billladingEntity.setBillladingStatus("5");
stringBuffer.append(",变更为取消提货,时间"+ CommonUtil.dateToString(new Date())+",变更人"+AuthUtil.getUserName());
break;
default:
log.warn("#############updateBillladingStatus: 未知的更新操作");
throw new CustomerException(405,"未知的更新操作");
if (!Objects.isNull(billladingEntity)) {
String billladingCode = billladingEntity.getBillladingCode();
StringBuilder stringBuffer = new StringBuilder();
TrunklineBillladingLogEntity logEntity = new TrunklineBillladingLogEntity();
logEntity.setWarehouseId(warehouseId);
logEntity.setWarehouseName(warehouseName);
logEntity.setCreateUserName(AuthUtil.getUserName());
logEntity.setBillladingId(billladingId);
logEntity.setBeforeOpreation(JSON.toJSONString(billladingEntity));
stringBuffer.append("变更提货单状态 billladingCode=").append(billladingCode);
String billladingStatus = billladingEntity.getBillladingStatus();
//提货单状态 1=未开始,2=提货中,3=已完成,4=已结算 5=已取消
switch (type) {
case 1:
//开始提货
if ("1".equals(billladingStatus)) {
billladingEntity.setBillladingStatus("2");
billladingEntity.setStartTime(new Date());
stringBuffer.append(",未开始变更为提货中");
} else {
log.warn("##################updateBillladingStatus: 提货单不能更新为提货中 billladingStatus={}", billladingStatus);
throw new CustomerException(405, "提货单不能更新为提货中");
}
break;
case 2:
//提货完成
if ("2".equals(billladingStatus)) {
billladingEntity.setBillladingStatus("3");
billladingEntity.setEndTime(new Date());
stringBuffer.append(",提货中变更为提货完成");
} else {
log.warn("##################updateBillladingStatus: 提货单不能更新为已完成 billladingStatus={}", billladingStatus);
throw new CustomerException(405, "提货单不能更新为已完成");
}
break;
case 3:
//取消完成
if ("3".equals(billladingStatus)) {
billladingEntity.setBillladingStatus("2");
billladingEntity.setEndTime(null);
stringBuffer.append(",提货完成变更为提货中");
} else {
log.warn("##################updateBillladingStatus: 提货单不能更新为提货中 billladingStatus={}", billladingStatus);
throw new CustomerException(405, "提货单不能更新为提货中");
}
break;
case 4:
//结算
if ("3".equals(billladingStatus)) {
Date date = new Date();
billladingEntity.setBillladingStatus("4");
billladingEntity.setSettlementTime(date);
billladingEntity.setSettlementId(AuthUtil.getUserId());
billladingEntity.setSettlementName(AuthUtil.getUserName());
stringBuffer.append(",提货完成变更为已结算,时间").append(CommonUtil.dateToString(date)).append(",变更人").append(AuthUtil.getUserName());
} else {
log.warn("##################updateBillladingStatus: 提货单不能更新为已结算 billladingStatus={}", billladingStatus);
throw new CustomerException(405, "提货单不能更新为提货中");
}
break;
case 5:
//取消结算
if ("4".equals(billladingStatus)) {
billladingEntity.setBillladingStatus("3");
billladingEntity.setSettlementTime(null);
billladingEntity.setSettlementId(null);
billladingEntity.setSettlementName(null);
stringBuffer.append(",已结算变更为提货完成,时间").append(CommonUtil.dateToString(new Date())).append(",变更人").append(AuthUtil.getUserName());
} else {
log.warn("##################updateBillladingStatus: 提货单不能更新为提货完成 billladingStatus={}", billladingStatus);
throw new CustomerException(405, "提货单不能更新为提货完成");
}
break;
case 6:
//取消提货
billladingEntity.setBillladingStatus("5");
stringBuffer.append(",变更为取消提货,时间").append(CommonUtil.dateToString(new Date())).append(",变更人").append(AuthUtil.getUserName());
break;
default:
log.warn("#############updateBillladingStatus: 未知的更新操作");
throw new CustomerException(405, "未知的更新操作");
}
//更新状态
updateById(billladingEntity);
logEntity.setContent(stringBuffer.toString());
logEntity.setAfterOpreation(JSON.toJSONString(billladingEntity));
trunklineBillladingLogService.save(logEntity);
} else {
log.warn("##################updateBillladingStatus: 提货单不存在 billladingId={}", billladingId);
throw new CustomerException(405, "提货单不存在");
}
//更新状态
updateById(billladingEntity);
logEntity.setContent(stringBuffer.toString());
logEntity.setAfterOpreation(JSONObject.toJSONString(billladingEntity));
trunklineBillladingLogService.save(logEntity);
}
@Override
@ -548,15 +553,9 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
@Override
public List<TrunklineBillladingDetailListVO> findAdvanceDetailList(BillladingDTO billladingDTO) {
// Integer pageNum = billladingDTO.getPageNum();
// Integer pageSize = billladingDTO.getPageSize();
String orderCode = billladingDTO.getOrderCode();
// IPage<Object> page = new Page<>();
// page.setCurrent(pageNum);
// page.setSize(pageSize);
List<TrunklineBillladingDetailListVO> ls = baseMapper.findAdvanceDetailList(orderCode);
String orderCode = billladingDTO.getOrderCode();
return ls;
return baseMapper.findAdvanceDetailList(orderCode);
}
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLineServiceImpl.java

@ -31,7 +31,8 @@ public class TrunklineCarsLoadLineServiceImpl extends BaseServiceImpl<TrunklineC
public TrunklineCarsLoadLineEntity findEntityByLoadIdAndNodeId(Long loadId, Long nodeId) {
QueryWrapper<TrunklineCarsLoadLineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("load_id",loadId)
.eq("node_id",nodeId);
.eq("node_id",nodeId)
.eq("is_deleted",0);
return baseMapper.selectOne(queryWrapper);
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java

@ -298,4 +298,9 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
return baseMapper.findWaybillTransferInfo(waybillId);
}
@Override
public List<LoadingDetailExportVO> loadingDetailExport(LoadCarsDTO loadCarsDTO) {
return baseMapper.loadingDetailExport(loadCarsDTO);
}
}

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

@ -29,73 +29,11 @@ import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.BatchUnloadDTO;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.dto.LoadCarsDTO;
import com.logpm.trunkline.dto.LoadScanBrandDTO;
import com.logpm.trunkline.dto.LoadingPackageDTO;
import com.logpm.trunkline.dto.LoadingZeroDTO;
import com.logpm.trunkline.dto.ProductInfoDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadLineDTO;
import com.logpm.trunkline.dto.TrunklineCarsOrderDTO;
import com.logpm.trunkline.dto.UnloadPackageDTO;
import com.logpm.trunkline.dto.UnloadZeroDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadContractEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadFinanceEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLogEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineCarsOrderEntity;
import com.logpm.trunkline.entity.TrunklineCostShareRecordEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignOrderEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignPhotoEntity;
import com.logpm.trunkline.dto.*;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper;
import com.logpm.trunkline.service.ICarsLoadAsyncService;
import com.logpm.trunkline.service.IInComingService;
import com.logpm.trunkline.service.IOpenOrderAsyncService;
import com.logpm.trunkline.service.IPackageTrackLogAsyncService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineCarsLoadContractService;
import com.logpm.trunkline.service.ITrunklineCarsLoadFinanceService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLineService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLogService;
import com.logpm.trunkline.service.ITrunklineCarsLoadScanService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.service.ITrunklineCarsLoadingLogService;
import com.logpm.trunkline.service.ITrunklineCarsOrderService;
import com.logpm.trunkline.service.ITrunklineCarsSignLogService;
import com.logpm.trunkline.service.ITrunklineCarsUnloadLogService;
import com.logpm.trunkline.service.ITrunklineCostShareRecordService;
import com.logpm.trunkline.service.ITrunklineLoadSignOrderService;
import com.logpm.trunkline.service.ITrunklineLoadSignPhotoService;
import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
import com.logpm.trunkline.vo.CarsLoadAllOrderVO;
import com.logpm.trunkline.vo.CarsLoadOrderInfoVO;
import com.logpm.trunkline.vo.CarsLoadWaybillInfoVO;
import com.logpm.trunkline.vo.HasNotFinalNodeIdDataVO;
import com.logpm.trunkline.vo.LoadScanFinalNodeIdVO;
import com.logpm.trunkline.vo.LoadScanOrderVO;
import com.logpm.trunkline.vo.LoadZeroListVO;
import com.logpm.trunkline.vo.LoadingListGoodsVO;
import com.logpm.trunkline.vo.LoadingListMainVO;
import com.logpm.trunkline.vo.NodeNumDataVO;
import com.logpm.trunkline.vo.OrderScanDetailVO;
import com.logpm.trunkline.vo.SignOrderDetailVO;
import com.logpm.trunkline.vo.SignPackageVO;
import com.logpm.trunkline.vo.SignScanOrderVO;
import com.logpm.trunkline.vo.TripartiteTransferVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadLoadingListVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadScanVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import com.logpm.trunkline.vo.TrunklineLoadSignOrderVO;
import com.logpm.trunkline.vo.UnloadPackageVO;
import com.logpm.trunkline.vo.UnloadScanOrderVO;
import com.logpm.trunkline.vo.UnloadZeroVO;
import com.logpm.trunkline.vo.WaybillCarsLoadVO;
import com.logpm.trunkline.vo.ZeroSuppleVO;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
@ -105,11 +43,7 @@ import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringEscapeUtils;
import org.springblade.common.constant.CodeNumConstant;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.*;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
@ -128,14 +62,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeSet;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Service
@ -186,15 +114,24 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
IPage<TrunklineCarsLoadVO> pageList = baseMapper.loadCarsPageList(page, loadCarsDTO);
List<TrunklineCarsLoadVO> records = pageList.getRecords();
for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) {
//把records中的id封装成一个set
Set<Long> idsSet = records.stream()
.map(TrunklineCarsLoadVO::getId) // Assuming getId() method returns the id as an Integer
.collect(Collectors.toSet());
//判空idsSet
if (idsSet.isEmpty()) {
return pageList;
}
//使用trunklineCarsLoadLineService通过idsSet关联loadId批量查询TrunklineCarsLoadLineEntity集合
List<TrunklineCarsLoadLineEntity> loadLineList = trunklineCarsLoadLineService.list(new QueryWrapper<TrunklineCarsLoadLineEntity>().in("load_id", idsSet));
//把loadLineList中对象通过loadId分组
Map<Long, List<TrunklineCarsLoadLineEntity>> loadLineMap = loadLineList.stream()
.collect(Collectors.groupingBy(TrunklineCarsLoadLineEntity::getLoadId));
records.forEach(trunklineCarsLoadVO -> {
Long loadId = trunklineCarsLoadVO.getId();
QueryWrapper<TrunklineCarsLoadLineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_deleted", 0)
.eq("load_id", loadId)
.orderByAsc("sort");
List<TrunklineCarsLoadLineEntity> list = trunklineCarsLoadLineService.list(queryWrapper);
List<TrunklineCarsLoadLineEntity> list = loadLineMap.get(loadId);
trunklineCarsLoadVO.setCarsLoadLineList(list);
}
});
pageList.setRecords(records);
return pageList;
}
@ -207,15 +144,24 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
IPage<TrunklineCarsLoadVO> pageList = baseMapper.arriveCarsPageList(page, loadCarsDTO);
List<TrunklineCarsLoadVO> records = pageList.getRecords();
for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) {
//把records中的id封装成一个set
Set<Long> idsSet = records.stream()
.map(TrunklineCarsLoadVO::getId) // Assuming getId() method returns the id as an Integer
.collect(Collectors.toSet());
//判空idsSet
if (idsSet.isEmpty()) {
return pageList;
}
//使用trunklineCarsLoadLineService通过idsSet关联loadId批量查询TrunklineCarsLoadLineEntity集合
List<TrunklineCarsLoadLineEntity> loadLineList = trunklineCarsLoadLineService.list(new QueryWrapper<TrunklineCarsLoadLineEntity>().in("load_id", idsSet));
//把loadLineList中对象通过loadId分组
Map<Long, List<TrunklineCarsLoadLineEntity>> loadLineMap = loadLineList.stream()
.collect(Collectors.groupingBy(TrunklineCarsLoadLineEntity::getLoadId));
records.forEach(trunklineCarsLoadVO -> {
Long loadId = trunklineCarsLoadVO.getId();
QueryWrapper<TrunklineCarsLoadLineEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("is_deleted", 0)
.eq("load_id", loadId)
.orderByAsc("sort");
List<TrunklineCarsLoadLineEntity> list = trunklineCarsLoadLineService.list(queryWrapper);
List<TrunklineCarsLoadLineEntity> list = loadLineMap.get(loadId);
trunklineCarsLoadVO.setCarsLoadLineList(list);
}
});
pageList.setRecords(records);
return pageList;
}
@ -786,7 +732,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//逻辑删除装车扫描表的数据
List<Long> carsLoadScanIdList = trunklineCarsLoadScanService.findAllIdListByLoadId(loadId);
removeCarsLoadScan(StringUtil.join(carsLoadScanIdList, ","), warehouseId);
//通过loadId更新carsOrder关联表中的所有订单startNum为0
trunklineCarsOrderService.updateStartNumByLoadIdAndWarehouseId(loadId, warehouseId);
if(CollUtil.isNotEmpty(carsLoadScanIdList)){
removeCarsLoadScan(StringUtil.join(carsLoadScanIdList, ","), warehouseId);
}
try {
trunklineCarsLoadLogService.saveLog(carsLoadEntity, currentCarsLoadLineEntity, CarsLoadLogTypeConstant.CANCEL_CARS_LOAD.getValue());
@ -2154,6 +2105,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
} else {
carsLoadScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode());
carsLoadScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo());
carsLoadScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId());
carsLoadScanEntity.setIsData(1);
String packageStatus = trunklineAdvanceDetailEntity.getPackageStatus();
if ("0".equals(packageStatus)) {
@ -2512,6 +2464,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
IPage<TrunklineCarsLoadVO> pageList = baseMapper.carsLoadPageList(page, loadCarsDTO);
List<TrunklineCarsLoadVO> records = pageList.getRecords();
//循环records,获取字典值
for (TrunklineCarsLoadVO trunklineCarsLoadVO : records) {
String loadStatus = trunklineCarsLoadVO.getLoadStatus();
String value = DictBizCache.getValue(DictBizConstant.CARS_LOAD_STATUS, loadStatus);
@ -4478,6 +4431,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.data(list);
}
@Override
public List<LoadingDetailExportVO> loadingDetailExport(LoadCarsDTO loadCarsDTO) {
return trunklineCarsLoadScanService.loadingDetailExport(loadCarsDTO);
}
@Override
public R loadingTrayInfo(LoadCarsDTO loadCarsDTO) {
log.info("##############loadingTrayInfo: 查询托盘的货物信息");

72
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTrayTypeApiController.java

@ -99,7 +99,7 @@ public class WarehouseTrayTypeApiController {
return R.fail(403,"仓库信息为空");
}
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
@ -146,11 +146,11 @@ public class WarehouseTrayTypeApiController {
return R.fail(403,"仓库信息为空");
}
if(!StringUtil.hasLength(orderCode)){
if(StringUtil.isBlank(orderCode)){
log.warn(method+"订单编号不能为空 orderCode={}",orderCode);
return R.fail(403,"订单编号不能为空");
}
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"订单编号不能为空 trayCode={}",trayCode);
return R.fail(403,"订单编号不能为空");
}
@ -181,15 +181,15 @@ public class WarehouseTrayTypeApiController {
String trayCode = trayTypeDTO.getTrayCode();
String orderPackageCode = trayTypeDTO.getOrderPackageCode();//包条码
if(!StringUtil.hasLength(trayType)){
if(StringUtil.isBlank(trayType)){
log.warn(method+"打托方式不能为空 trayType={}",trayType);
return R.fail(403,"打托方式不能为空");
}
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
if(!StringUtil.hasLength(orderPackageCode)){
if(StringUtil.isBlank(orderPackageCode)){
log.warn(method+"包条码不能为空 orderPackageCode={}",orderPackageCode);
return R.fail(403,"包条码不能为空");
}
@ -223,11 +223,11 @@ public class WarehouseTrayTypeApiController {
List<String> orderPackageCodes = trayTypeDTO.getOrderPackageCodes();
String trayCode = trayTypeDTO.getTrayCode();//托盘码
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
if(Objects.isNull(orderPackageCodes)||orderPackageCodes.size() == 0){
if(Objects.isNull(orderPackageCodes)||orderPackageCodes.isEmpty()){
log.warn(method+"包条码不能为空 orderPackageCodes={}",orderPackageCodes);
return R.fail(403,"包条码不能为空");
}
@ -262,11 +262,11 @@ public class WarehouseTrayTypeApiController {
String orderCode = trayTypeDTO.getOrderCode();
String trayCode = trayTypeDTO.getTrayCode();//托盘码
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
if(!StringUtil.hasLength(orderCode)){
if(StringUtil.isBlank(orderCode)){
log.warn(method+"订单号不能为空 orderCode={}",orderCode);
return R.fail(403,"订单号不能为空");
}
@ -345,7 +345,7 @@ public class WarehouseTrayTypeApiController {
return R.fail(403,"仓库信息为空");
}
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
@ -388,7 +388,7 @@ public class WarehouseTrayTypeApiController {
log.warn(method+"仓库信息不能为空");
return R.fail(403,"仓库信息不能为空");
}
if(!StringUtil.hasLength(waybillCode)){
if(StringUtil.isBlank(waybillCode)){
log.warn(method+"运单号不能为空 waybillCode={}",waybillCode);
return R.fail(403,"运单号不能为空");
}
@ -420,11 +420,11 @@ public class WarehouseTrayTypeApiController {
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘号不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘号不能为空");
}
if(!StringUtil.hasLength(trayType)){
if(StringUtil.isBlank(trayType)){
log.warn(method+"打托方式不能为空 trayCode={}",trayCode);
return R.fail(403,"打托方式不能为空");
}
@ -455,11 +455,11 @@ public class WarehouseTrayTypeApiController {
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘号不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘号不能为空");
}
if(!StringUtil.hasLength(orderCode)){
if(StringUtil.isBlank(orderCode)){
log.warn(method+"订单不能为空 trayCode={}",trayCode);
return R.fail(403,"打托方式不能为空");
}
@ -480,9 +480,12 @@ public class WarehouseTrayTypeApiController {
public R updateZeroOrderNumByTrayCode(@RequestBody TrayTypeDTO trayTypeDTO) {
String method = "###########updateZeroOrderNumByTrayCode: ";
log.info(method + "更新零担订单数量 trayTypeDTO={}", trayTypeDTO);
String orderCode = trayTypeDTO.getOrderCode();//订单自编码
String trayCode = trayTypeDTO.getTrayCode();//托盘码
Integer num = trayTypeDTO.getNum();//数量
//订单自编码
String orderCode = trayTypeDTO.getOrderCode();
//托盘码
String trayCode = trayTypeDTO.getTrayCode();
//数量
Integer num = trayTypeDTO.getNum();
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
@ -490,11 +493,11 @@ public class WarehouseTrayTypeApiController {
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘号不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘号不能为空");
}
if(!StringUtil.hasLength(orderCode)){
if(StringUtil.isBlank(orderCode)){
log.warn(method+"订单不能为空 orderCode={}",orderCode);
return R.fail(403,"订单不能为空");
}
@ -524,10 +527,11 @@ public class WarehouseTrayTypeApiController {
public R zeroOrderUpdateRemark(@RequestBody TrayTypeDTO trayTypeDTO) {
String method = "###########updateZeroOrderNumByTrayCode: ";
log.info(method + "更新零担订单数量 trayTypeDTO={}", trayTypeDTO);
String trayCode = trayTypeDTO.getTrayCode();//托盘码
//托盘码
String trayCode = trayTypeDTO.getTrayCode();
String remark = trayTypeDTO.getRemark();
try{
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘号不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘号不能为空");
}
@ -597,7 +601,7 @@ public class WarehouseTrayTypeApiController {
return R.fail(403,"仓库信息为空");
}
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
@ -644,15 +648,15 @@ public class WarehouseTrayTypeApiController {
return R.fail(403,"仓库信息为空");
}
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
if(!StringUtil.hasLength(trayType)){
if(StringUtil.isBlank(trayType)){
log.warn(method+"打托方式不能为空 trayType={}",trayType);
return R.fail(403,"打托方式不能为空");
}
if(!StringUtil.hasLength(orderPackageCode)){
if(StringUtil.isBlank(orderPackageCode)){
log.warn(method+"包条码不能为空 orderPackageCode={}",orderPackageCode);
return R.fail(403,"包条码不能为空");
}
@ -777,7 +781,7 @@ public class WarehouseTrayTypeApiController {
return R.fail(403,"仓库信息为空");
}
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
@ -827,7 +831,7 @@ public class WarehouseTrayTypeApiController {
log.warn(method+"商场id不能为空 marketId={}",marketId);
return R.fail(403,"商场id不能为空");
}
if(!StringUtil.hasLength(materialCode)){
if(StringUtil.isBlank(materialCode)){
log.warn(method+"物料编码不能为空 materialCode={}",materialCode);
return R.fail(403,"物料编码不能为空");
}
@ -863,7 +867,7 @@ public class WarehouseTrayTypeApiController {
log.warn(method+"商场id不能为空 marketId={}",marketId);
return R.fail(403,"商场id不能为空");
}
if(!StringUtil.hasLength(materialName)){
if(StringUtil.isBlank(materialName)){
log.warn(method+"物料名称不能为空 materialCode={}",materialName);
return R.fail(403,"物料名称不能为空");
}
@ -898,19 +902,19 @@ public class WarehouseTrayTypeApiController {
return R.fail(403,"仓库信息不能为空");
}
if(!StringUtil.hasLength(trayCode)){
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
if(!StringUtil.hasLength(trayType)){
if(StringUtil.isBlank(trayType)){
log.warn(method+"打托方式不能为空 trayType={}",trayType);
return R.fail(403,"打托方式不能为空");
}
if(!StringUtil.hasLength(materialCode)){
if(StringUtil.isBlank(materialCode)){
log.warn(method+"物料编码不能为空 materialCode={}",materialCode);
return R.fail(403,"物料编码不能为空");
}
if(!StringUtil.hasLength(incomingBatch)){
if(StringUtil.isBlank(incomingBatch)){
log.warn(method+"批次号不能为空 incomingBatch={}",incomingBatch);
return R.fail(403,"批次号不能为空");
}

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

@ -87,8 +87,6 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
private final IBasicdataWarehouseClient warehouseClient;
@Override
public IPage<WarehouseWarehousingEntryVO> selectWarehouseWarehousingEntryPage(IPage<WarehouseWarehousingEntryVO> page, WarehouseWarehousingEntryVO warehouseWarehousingEntry) {
return page.setRecords(baseMapper.selectWarehouseWarehousingEntryPage(page, warehouseWarehousingEntry));
@ -107,16 +105,16 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean saveOrUpdateOwn(WarehouseWarehousingEntryDTO warehouseWarehousingEntryDTO) {
if(ObjectUtils.isNull(warehouseWarehousingEntryDTO.getType())){
if (ObjectUtils.isNull(warehouseWarehousingEntryDTO.getType())) {
throw new ServiceException("入库类型不能为空!!");
}
if("2".equals(warehouseWarehousingEntryDTO.getType())){
if ("2".equals(warehouseWarehousingEntryDTO.getType())) {
//直接入库
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingEntryDTO.getList();
WarehouseWarehousingEntryEntity warehouseWarehousingEntry = new WarehouseWarehousingEntryEntity();
BeanUtil.copyProperties(warehouseWarehousingEntryDTO,warehouseWarehousingEntry);
BeanUtil.copyProperties(warehouseWarehousingEntryDTO, warehouseWarehousingEntry);
//入库批次号
if(ObjectUtils.isNull( warehouseWarehousingEntry.getReceiptBatch() )){
if (ObjectUtils.isNull(warehouseWarehousingEntry.getReceiptBatch())) {
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
String s = "RK" + myCurrentWarehouse.getWarehouseCode() + time;
@ -126,21 +124,21 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
WarehouseWarehousingEntryEntity entryEntity = new WarehouseWarehousingEntryEntity();
entryEntity.setId(warehouseWarehousingEntryDTO.getId());
//添加
//获取当前登录人仓库
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(basicdataWarehouseEntity)) {
log.warn("#####操作人,当前未查询到仓库信息");
return false;
}
warehouseWarehousingEntry.setWarehouseId(basicdataWarehouseEntity.getId());
warehouseWarehousingEntry.setWarehouse(basicdataWarehouseEntity.getName());
warehouseWarehousingEntry.setSource("添加");
warehouseWarehousingEntry.setConditions("3");
this.save(warehouseWarehousingEntry);
list.forEach( i ->{
//添加
//获取当前登录人仓库
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(basicdataWarehouseEntity)) {
log.warn("#####操作人,当前未查询到仓库信息");
return false;
}
warehouseWarehousingEntry.setWarehouseId(basicdataWarehouseEntity.getId());
warehouseWarehousingEntry.setWarehouse(basicdataWarehouseEntity.getName());
warehouseWarehousingEntry.setSource("添加");
warehouseWarehousingEntry.setConditions("3");
this.save(warehouseWarehousingEntry);
list.forEach(i -> {
//添加库存品
addInventory(i.getCreateInventory(),warehouseWarehousingEntryDTO,i);
addInventory(i.getCreateInventory(), warehouseWarehousingEntryDTO, i);
});
//添加入库明细
// Iterator<WarehouseWarehousingDetailEntity> iterator = list.iterator();
@ -149,8 +147,8 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
// iterator.remove();
// }
// }
if(!list.isEmpty()){
list.forEach(i ->{
if (!list.isEmpty()) {
list.forEach(i -> {
i.setWarehousingEntryId(warehouseWarehousingEntry.getId());
i.setConditions("3");
}
@ -158,46 +156,46 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
warehouseWarehousingDetailService.saveBatch(list);
}
return true;
}else if("1".equals(warehouseWarehousingEntryDTO.getType())){
} else if ("1".equals(warehouseWarehousingEntryDTO.getType())) {
//预计入库
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingEntryDTO.getList();
WarehouseWarehousingEntryEntity warehouseWarehousingEntry = new WarehouseWarehousingEntryEntity();
BeanUtil.copyProperties(warehouseWarehousingEntryDTO,warehouseWarehousingEntry);
BeanUtil.copyProperties(warehouseWarehousingEntryDTO, warehouseWarehousingEntry);
WarehouseWarehousingEntryEntity entryEntity = new WarehouseWarehousingEntryEntity();
BeanUtil.copyProperties(warehouseWarehousingEntryDTO,entryEntity);
BeanUtil.copyProperties(warehouseWarehousingEntryDTO, entryEntity);
//入库批次号
if(ObjectUtils.isNull( warehouseWarehousingEntry.getReceiptBatch() )){
if (ObjectUtils.isNull(warehouseWarehousingEntry.getReceiptBatch())) {
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
warehouseWarehousingEntry.setReceiptBatch("RK"+myCurrentWarehouse.getWarehouseCode()+time);
warehouseWarehousingEntry.setReceiptBatch("RK" + myCurrentWarehouse.getWarehouseCode() + time);
}
entryEntity.setId(warehouseWarehousingEntryDTO.getId());
if(ObjectUtils.isNotNull(warehouseWarehousingEntryDTO.getId())){
if (ObjectUtils.isNotNull(warehouseWarehousingEntryDTO.getId())) {
//修改
List<Long> detailEntityList = new ArrayList<>();
List<WarehouseWarehousingDetailEntity> list1 = warehouseWarehousingDetailService.list(Wrappers.<WarehouseWarehousingDetailEntity>query().lambda()
.eq(WarehouseWarehousingDetailEntity::getWarehousingEntryId, warehouseWarehousingEntry.getId())
.apply("conditions in (1,2) ")
);//查询不是确定的数据
if(!list1.isEmpty()){
if (!list1.isEmpty()) {
AtomicReference<Integer> num = new AtomicReference<>(0);
list1.forEach( i ->{
list1.forEach(i -> {
boolean b = list.stream().anyMatch(w -> w.getMaterialId().equals(i.getMaterialId()));
if(b){
if (b) {
//存在
Iterator<WarehouseWarehousingDetailEntity> iterator = list.iterator();
while (iterator.hasNext()){
while (iterator.hasNext()) {
WarehouseWarehousingDetailEntity next = iterator.next();
if(next.getMaterialId().equals(i.getMaterialId())){
if (next.getMaterialId().equals(i.getMaterialId())) {
//修改
WarehouseWarehousingDetailEntity detailEntity = new WarehouseWarehousingDetailEntity();
detailEntity.setId(i.getId());
detailEntity.setActualReceipt(next.getActualReceipt()); //实际
if(next.getActualReceipt().equals(i.getCreateInventory()) || next.getActualReceipt() > i.getCreateInventory()){
if (next.getActualReceipt().equals(i.getCreateInventory()) || next.getActualReceipt() > i.getCreateInventory()) {
detailEntity.setConditions("3");
num.updateAndGet(v -> v + 1);
}else if(next.getActualReceipt() > 0 ){
} else if (next.getActualReceipt() > 0) {
detailEntity.setConditions("2");
entryEntity.setConditions("2");
warehouseWarehousingEntry.setConditions("2");
@ -206,13 +204,13 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
//当前入库数量
int i1 = next.getActualReceipt() - i.getActualReceipt();
//添加库存品
addInventory(i1,warehouseWarehousingEntryDTO,i);
addInventory(i1, warehouseWarehousingEntryDTO, i);
iterator.remove();
}
}
}else{
if("1".equals(i.getConditions())){
} else {
if ("1".equals(i.getConditions())) {
//删除
detailEntityList.add(i.getId());
}
@ -220,18 +218,18 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
});
Integer teger = num.get();
if(list1.size() == teger){
if (list1.size() == teger) {
//完成这个任务
entryEntity.setConditions("3");
}
baseMapper.updateById(entryEntity);
if(!detailEntityList.isEmpty()){
if (!detailEntityList.isEmpty()) {
//删除多余的
warehouseWarehousingDetailService.deleteLogic(detailEntityList);
}
}
}else{
} else {
//添加
//获取当前登录人仓库
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getMyCurrentWarehouse();
@ -247,14 +245,14 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
//添加入库明细
Iterator<WarehouseWarehousingDetailEntity> iterator = list.iterator();
while (iterator.hasNext()){
while (iterator.hasNext()) {
WarehouseWarehousingDetailEntity next = iterator.next();
if(ObjectUtils.isNotNull(next.getConditions() ) && "3".equals(next.getConditions())){
if (ObjectUtils.isNotNull(next.getConditions()) && "3".equals(next.getConditions())) {
iterator.remove();
}
}
if(!list.isEmpty()){
list.forEach(i ->{
if (!list.isEmpty()) {
list.forEach(i -> {
i.setWarehousingEntryId(warehouseWarehousingEntry.getId());
i.setConditions("1");
}
@ -262,7 +260,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
warehouseWarehousingDetailService.saveBatch(list);
}
return true;
}else{
} else {
return false;
}
@ -270,19 +268,20 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
/**
* 添加库存品
* @param num 添加数量
*
* @param num 添加数量
* @param warehousingEntryDTO 客户信息
* @param warehousingDetail 物品信息
* @param warehousingDetail 物品信息
* @return
*/
public Boolean addInventory(Integer num,WarehouseWarehousingEntryDTO warehousingEntryDTO,WarehouseWarehousingDetailEntity warehousingDetail){
public Boolean addInventory(Integer num, WarehouseWarehousingEntryDTO warehousingEntryDTO, WarehouseWarehousingDetailEntity warehousingDetail) {
// DistributionStockListEntity distributionStockList = new DistributionStockListEntity();
// distributionStockList.setStoreId(warehousingEntryDTO.getStoreId()); //门店
// distributionStockList.setMarketId(warehousingEntryDTO.getClientId()); //客户id
// distributionStockList.setMaterialId(warehousingDetail.getMaterialId()); //物料id
if(num < 1){
if (num < 1) {
return true;
}else{
} else {
//查询库存品信息
DistributionStockListEntity stockListEntity = new DistributionStockListEntity();
stockListEntity.setStoreId(warehousingEntryDTO.getStoreId());
@ -306,10 +305,10 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
distributionStockListEntity.setCargoUnit(warehousingDetail.getProductUnit()); //货物单位
distributionStockListEntity.setWarehousingTime(warehousingEntryDTO.getReceiptDate()); //入库时间
distributionStockListEntity.setLicensePlate(Optional.ofNullable(warehousingEntryDTO.getLicensePlate()).orElse(null)); //车牌
if(Func.isNotEmpty(warehousingEntryDTO.getStoreId())){
if (Func.isNotEmpty(warehousingEntryDTO.getStoreId())) {
distributionStockListEntity.setStoreId(warehousingEntryDTO.getStoreId()); //门店
}
if(Func.isNotEmpty(warehousingEntryDTO.getLicensePlate())){
if (Func.isNotEmpty(warehousingEntryDTO.getLicensePlate())) {
distributionStockListEntity.setDespatch(warehousingEntryDTO.getTrainNumber());//车次号运单
}
distributionStockListEntity.setServiceType(warehousingEntryDTO.getServiceType());
@ -328,7 +327,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
distributionStockListEntity.setBrandId(warehousingDetail.getBrandId());//品牌ID
// distributionStockListEntity.setFactory("工厂车次");//工厂车次
// distributionStockListEntity.setCategory("品分类");//品分类
distributionStockListEntity.setMaterialId( warehousingDetail.getMaterialId());//货物ID
distributionStockListEntity.setMaterialId(warehousingDetail.getMaterialId());//货物ID
// distributionStockListEntity.setStoreName("门店名称");//门店名称
// distributionStockListEntity.setParcelListId(distributionParcelList.getId());//包件id
distributionStockListEntity.setQuantityOccupied(0);//冻结数量
@ -338,57 +337,54 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
distributionStockListEntity.setSku(warehousingDetail.getSku());
distributionStockListEntity.setSourceType("2");//导入
if(Func.isNotEmpty(queryData)){
if (Func.isNotEmpty(queryData)) {
// distributionStockListEntity.setQuantityStock( queryData.getQuantityStock()+num ); //库存数量
// distributionStockListEntity.setOutboundQuantity(queryData.getOutboundQuantity()); //出库数量
//修改
DistributionStockListEntity distributionStockList = new DistributionStockListEntity();
distributionStockList.setQuantityStock(queryData.getQuantityStock()+num );
distributionStockList.setQuantityStock(queryData.getQuantityStock() + num);
distributionStockList.setOutboundQuantity(queryData.getOutboundQuantity());
distributionStockList.setId(queryData.getId());
distributionStockListClient.getUpdateStockList(distributionStockList);
}else{
} else {
distributionStockListClient.getAddStockList(distributionStockListEntity);
}
DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity();
BeanUtil.copyProperties(distributionStockListEntity,distributionStockListInfo);
BeanUtil.copyProperties(distributionStockListEntity, distributionStockListInfo);
distributionStockListInfo.setSourceType("2");//导入
return distributionStockListInfoClient.addStockListInfoEntity(distributionStockListInfo);
}
}
/**
*
* @param warehouseWarehousingEntry
* @return
*/
@Override
public WarehouseWarehousingEntryVO getOneOwn(WarehouseWarehousingEntryEntity warehouseWarehousingEntry) {
WarehouseWarehousingEntryEntity one = this.getOne(Condition.getQueryWrapper(warehouseWarehousingEntry));
log.info("one>>>>>>>>>>>>{}",one);
if(ObjectUtils.isNotNull(one) && ObjectUtils.isNotNull(one.getId())){
log.info("one>>>>>>>>>>>>{}", one);
if (ObjectUtils.isNotNull(one) && ObjectUtils.isNotNull(one.getId())) {
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingDetailService.list(Wrappers.<WarehouseWarehousingDetailEntity>query().lambda()
.eq(WarehouseWarehousingDetailEntity::getWarehousingEntryId, one.getId())
);
WarehouseWarehousingEntryVO warehouseWarehousingEntryVO = new WarehouseWarehousingEntryVO();
BeanUtils.copyProperties(one,warehouseWarehousingEntryVO);
BeanUtils.copyProperties(one, warehouseWarehousingEntryVO);
warehouseWarehousingEntryVO.setList(list);
return warehouseWarehousingEntryVO;
}else{
} else {
return null;
}
}
/**
* 导入
*
* @param data
* @param isCovered
*/
@ -398,51 +394,51 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
//分组
Map<String, List<WarehousingEntryDetailExcel>> collect = data.stream().map(x -> {
return x;
}).collect(Collectors.groupingBy(o ->{
System.out.println("====<<<<<<<<"+o);
if(ObjectUtils.isEmpty(o) || ObjectUtils.isNull(o.getCustomerName()) || ObjectUtils.isNull(o.getCustomerCode()) ){
}).collect(Collectors.groupingBy(o -> {
System.out.println("====<<<<<<<<" + o);
if (ObjectUtils.isEmpty(o) || ObjectUtils.isNull(o.getCustomerName()) || ObjectUtils.isNull(o.getCustomerCode())) {
return "";
}else{
} else {
WarehouseWarehousingEntryEntity entryEntity = new WarehouseWarehousingEntryEntity();
if(ObjectUtils.isNull(o.getReceiptBatch())){
if (ObjectUtils.isNull(o.getReceiptBatch())) {
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
entryEntity.setReceiptBatch("RK"+myCurrentWarehouse.getWarehouseCode()+time);
}else{
entryEntity.setReceiptBatch("RK" + myCurrentWarehouse.getWarehouseCode() + time);
} else {
entryEntity.setReceiptBatch(o.getReceiptBatch());
}
entryEntity.setReceiptDate(o.getReceiptDate());
//入库批次号
if(ObjectUtils.isNull( o.getReceiptBatch() )){
if (ObjectUtils.isNull(o.getReceiptBatch())) {
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
entryEntity.setReceiptBatch("RK"+myCurrentWarehouse.getWarehouseCode()+time);
entryEntity.setReceiptBatch("RK" + myCurrentWarehouse.getWarehouseCode() + time);
}
entryEntity.setConditions("1");
// entryEntity.setReceiptBatch("1");
BasicdataClientEntity customer = basicdataClientClient.getCustomer(o.getCustomerName(), o.getCustomerCode());
if(ObjectUtils.isNotEmpty(customer) ){
if(StringUtils.isNotBlank(o.getStoreName())){
if (ObjectUtils.isNotEmpty(customer)) {
if (StringUtils.isNotBlank(o.getStoreName())) {
BasicdataClientEntity customer1 = basicdataClientClient.findByName(o.getStoreName());
if(Func.isNotEmpty(customer1)){
if (Func.isNotEmpty(customer1)) {
entryEntity.setStoreId(customer1.getId());
entryEntity.setStoreName(o.getStoreName());
}else{
throw new ServiceException(o.getCustomerName()+o.getCustomerCode()+"门店信息不存在!!请维护门店数据!!!");
} else {
throw new ServiceException(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()+"客户信息不存在!!请维护客户数据!!!");
} else {
throw new ServiceException(o.getCustomerName() + o.getCustomerCode() + "客户信息不存在!!请维护客户数据!!!");
}
BasicdataWarehouseEntity warehouse = basicdataWarehouseClient.getWarehouse(o.getWarehouse(), o.getWarehouseCode());
if(Func.isNotEmpty(warehouse)){
if (Func.isNotEmpty(warehouse)) {
entryEntity.setWarehouseId(warehouse.getId());//仓库id
entryEntity.setWarehouse(o.getWarehouse());//仓库名称
}else{
throw new ServiceException(o.getCustomerName()+o.getCustomerCode()+"仓库信息不存在!!请维护仓库数据!!!");
} else {
throw new ServiceException(o.getCustomerName() + o.getCustomerCode() + "仓库信息不存在!!请维护仓库数据!!!");
}
entryEntity.setLogisticsCompany(Optional.ofNullable(o.getLogisticsCompany()).orElse(null));
entryEntity.setTrainNumber(Optional.ofNullable(o.getTrainNumber()).orElse(null)); //仓库名称
@ -451,7 +447,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
entryEntity.setRemark(Optional.ofNullable(o.getRemark()).orElse(null)); //备注
entryEntity.setSource("导入");
R<List<DictBiz>> distriType = dictBizClient.getList("distribution_type");
if(ObjectUtils.isNotNull(distriType)){
if (ObjectUtils.isNotNull(distriType)) {
List<DictBiz> data1 = distriType.getData();
// data1.forEach( a ->{
// if(o.getServiceType().equals(a.getDictValue())){
@ -469,15 +465,15 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
return s;
}
} , Collectors.toList()));
}, Collectors.toList()));
collect.forEach((k,v) ->{
collect.forEach((k, v) -> {
// System.out.println(">>>>>>>>>>>+++++"+k+v);
WarehouseWarehousingEntryEntity entryEntity = JSON.parseObject(k, WarehouseWarehousingEntryEntity.class);
// WarehouseWarehousingEntryEntity entryEntity = JSONObject.parseObject(JSONObject.toJSONString(k), WarehouseWarehousingEntryEntity.class);
this.save(entryEntity);
List<WarehouseWarehousingDetailEntity> detailEntityList = new ArrayList<>();
v.forEach( i ->{
v.forEach(i -> {
WarehouseWarehousingDetailEntity detail = new WarehouseWarehousingDetailEntity();
detail.setConditions("1");
detail.setSku(i.getSku());
@ -492,28 +488,28 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
detail.setActualReceipt(0);
//品牌
BasicdataStoreBrandEntity brandList = basicdataStoreBrandClient.getBrandList(entryEntity.getClientId(), i.getBrandName());
if(Func.isNotEmpty(brandList)){
if (Func.isNotEmpty(brandList)) {
detail.setBrandName(brandList.getBrandName());
detail.setBrandId(brandList.getBrandId());
}else{
throw new ServiceException(i.getProductName()+i.getProductCode()+i.getSku()+"品牌信息不存在!!请维护客户品牌数据!!!");
} else {
throw new ServiceException(i.getProductName() + i.getProductCode() + i.getSku() + "品牌信息不存在!!请维护客户品牌数据!!!");
}
BasicMaterialEntity materialOwn = basicMaterialClient.getMaterialOwn(detail.getProductCode(), detail.getProductName(), detail.getSku());
if(Func.isNotEmpty(materialOwn)){
if (Func.isNotEmpty(materialOwn)) {
detail.setMaterialId(materialOwn.getId());//物料ID
}else{
throw new ServiceException(i.getProductName()+i.getProductCode()+i.getSku()+"物料信息不存在!!请维护基础数据!!!");
} else {
throw new ServiceException(i.getProductName() + i.getProductCode() + i.getSku() + "物料信息不存在!!请维护基础数据!!!");
}
if(!detailEntityList.isEmpty()){
if (!detailEntityList.isEmpty()) {
boolean b = detailEntityList.stream().anyMatch(a -> a.getProductCode().equals(detail.getProductCode()) && a.getProductName().equals(detail.getProductName()) && a.getSku().equals(detail.getSku()));
if(b){
detailEntityList.stream().filter(a -> a.getProductCode().equals(detail.getProductCode()) && a.getProductName().equals(detail.getProductName()) && a.getSku().equals(detail.getSku())).forEach( f->f.setCreateInventory(f.getCreateInventory()+detail.getCreateInventory()));
}else{
if (b) {
detailEntityList.stream().filter(a -> a.getProductCode().equals(detail.getProductCode()) && a.getProductName().equals(detail.getProductName()) && a.getSku().equals(detail.getSku())).forEach(f -> f.setCreateInventory(f.getCreateInventory() + detail.getCreateInventory()));
} else {
detailEntityList.add(detail);
}
}else{
} else {
detailEntityList.add(detail);
}
});
@ -525,13 +521,13 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
public List<WarehouseWarehousingEntryExcel> exportWarehouseWarehousing(Map<String, Object> paramMap) {
// 获取当前登录的仓库信息
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull(myCurrentWarehouse)){
if (ObjectUtils.isNull(myCurrentWarehouse)) {
throw new ServiceException("没有仓库信息!");
}
// 用户勾选数据的ids
Object ids = paramMap.get("ids");
List<String> idArr = null;
if (null != ids && !ids.toString().isEmpty()){
if (null != ids && !ids.toString().isEmpty()) {
idArr = Arrays.asList(paramMap.get("ids").toString().split(","));
}
@ -539,9 +535,9 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
List<WarehouseWarehousingEntryEntity> list = baseMapper.exportWarehouseWarehousing(paramMap, idArr);
List<WarehouseWarehousingEntryExcel> listExcel = new ArrayList<>();
list.forEach(s->{
list.forEach(s -> {
WarehouseWarehousingEntryExcel excel = new WarehouseWarehousingEntryExcel();
switch (s.getConditions()){
switch (s.getConditions()) {
case "1":
s.setConditions("待确定");
break;
@ -552,7 +548,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
s.setConditions("已确定");
break;
}
BeanUtil.copyProperties(s,excel);
BeanUtil.copyProperties(s, excel);
listExcel.add(excel);
});

Loading…
Cancel
Save