Browse Source

Merge branch 'pre-production'

newStockUp
zhenghaoyu 1 year ago
parent
commit
86789b3600
  1. 8
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java
  2. 16
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/InComingDTO.java
  3. 5
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailChildEntity.java
  4. 1
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java
  5. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFreightController.java
  6. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataFreightDTO.java
  7. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataFreightService.java
  8. 18
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFreightServiceImpl.java
  9. 13
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java
  10. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java
  11. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  12. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  13. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionReservationPackageExcel.java
  14. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  15. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueDetailMapper.java
  16. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueDetailMapper.xml
  17. 32
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml
  18. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  19. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationPackageMapper.xml
  20. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml
  21. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupInfoMapper.java
  22. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupInfoMapper.xml
  23. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  24. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAddvalueService.java
  25. 453
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java
  26. 38
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  27. 182
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  28. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  29. 6
      blade-service/logpm-trunkline/pom.xml
  30. 61
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/BillladingApiController.java
  31. 70
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/InComingApiController.java
  32. 35
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/bean/Resp.java
  33. 32
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java
  34. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  35. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  36. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java
  37. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  38. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.java
  39. 43
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml
  40. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IInComingService.java
  41. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  42. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java
  43. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingService.java
  44. 61
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  45. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  46. 62
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  47. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java
  48. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java
  49. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java
  50. 39
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWaybillController.java
  51. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java
  52. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  53. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java
  54. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml
  55. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  56. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java
  57. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  58. 147
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java
  59. 64
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java
  60. 12
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

8
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java

@ -57,4 +57,12 @@ public interface IDistributionReservationClient {
@GetMapping(TOP+"/retentionCancelReservationPack")
boolean retentionCancelReservationPack(@RequestBody DistributionRetentionScanVo distributionRetentionScanVo);
// /**
// * 根据配送任务ID查询配送司机信息
// * @param distributionRetentionScanVo
// * @return
// */
// @Post(TOP+"/retentionCancelReservationPack")
// boolean retentionCancelReservationPack(@RequestBody DistributionRetentionScanVo distributionRetentionScanVo);
}

16
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/InComingDTO.java

@ -0,0 +1,16 @@
package com.logpm.trunkline.dto;
import lombok.Data;
import java.io.Serializable;
@Data
public class InComingDTO implements Serializable {
private Long billladingId;//提货id
private String orderPackageCode;//包件码
private Long warehouseId;//仓库id
}

5
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailChildEntity.java

@ -35,6 +35,11 @@ import org.springblade.core.tenant.mp.TenantEntity;
@EqualsAndHashCode(callSuper = true)
public class QuestDetailChildEntity extends TenantEntity {
/**
* id
*/
@ApiModelProperty(value = "id")
private Long id;
/**
* 预留1
*/

1
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java

@ -60,4 +60,5 @@ public interface IWarehouseWaybillClient {
@PostMapping(API_PREFIX + "/updateEntity")
void updateEntity(@RequestBody WarehouseWaybillEntity warehouseWaybill);
}

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFreightController.java

@ -19,6 +19,7 @@ package com.logpm.basicdata.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.dto.BasicdataFreightDTO;
import com.logpm.basicdata.entity.BasicdataFreightEntity;
import com.logpm.basicdata.excel.BasicdataFreightExcel;
import com.logpm.basicdata.service.IBasicdataFreightService;
@ -116,7 +117,7 @@ public class BasicdataFreightController extends BladeController {
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入basicdataFreight")
public R submit(@Valid @RequestBody BasicdataFreightEntity basicdataFreight) {
public R submit(@Valid @RequestBody BasicdataFreightDTO basicdataFreight) {
return R.status(basicdataFreightService.ownSaveOrUpdate(basicdataFreight));
}

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataFreightDTO.java

@ -30,5 +30,11 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class BasicdataFreightDTO extends BasicdataFreightEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String clientIds;
}

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataFreightService.java

@ -18,6 +18,7 @@ package com.logpm.basicdata.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.BasicdataFreightDTO;
import com.logpm.basicdata.entity.BasicdataFreightEntity;
import com.logpm.basicdata.excel.BasicdataFreightExcel;
import com.logpm.basicdata.vo.BasicdataFreightVO;
@ -55,5 +56,6 @@ public interface IBasicdataFreightService extends BaseService<BasicdataFreightEn
* @param basicdataFreight
* @return
*/
Boolean ownSaveOrUpdate(BasicdataFreightEntity basicdataFreight);
Boolean ownSaveOrUpdate(BasicdataFreightDTO basicdataFreight);
}

18
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFreightServiceImpl.java

@ -18,6 +18,8 @@ package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.basicdata.dto.BasicdataFreightDTO;
import com.logpm.basicdata.entity.BasicdataFreightEntity;
import com.logpm.basicdata.excel.BasicdataFreightExcel;
import com.logpm.basicdata.mapper.BasicdataFreightMapper;
@ -57,15 +59,27 @@ public class BasicdataFreightServiceImpl extends BaseServiceImpl<BasicdataFreigh
}
/**
* 添加
* 添加和修改
* @param basicdataFreight
* @return
*/
@Override
public Boolean ownSaveOrUpdate(BasicdataFreightEntity basicdataFreight) {
public Boolean ownSaveOrUpdate(BasicdataFreightDTO basicdataFreight) {
log.info("接收的数据{}",basicdataFreight);
if(ObjectUtils.isNotNull(basicdataFreight.getId())){
//修改
}else{
//新增
if(basicdataFreight.getClientIds().contains(",")){
//多用户
}else{
}
}
return null;
}

13
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java

@ -105,16 +105,19 @@ public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl<BasicdataSto
//查询客户相关的品牌
l.forEach(i ->{
QueryWrapper<BasicdataStoreBrandEntity> queryWrapper = new QueryWrapper<>();
if(type.equals("1")){
//客户
queryWrapper.apply(ObjectUtils.isNotNull(o1),"lbb.brand_name like concat('%',{0},'%') ",o1);
queryWrapper.apply("lbsb.client_id ={0} ",i);
//客户
queryWrapper.apply(ObjectUtils.isNotNull(o1),"lbb.brand_name like concat('%',{0},'%') ",o1);
queryWrapper.apply("lbsb.client_id ={0} ",i);
/*if(ObjectUtils.isNotNull(type)){
if(type.equals("1")){
}
}else{
//门店
//客户
queryWrapper.apply(ObjectUtils.isNotNull(o1),"lbb.brand_name like concat('%',{0},'%') ",o1);
queryWrapper.apply("lbsb.shop_id ={0} ", i);
}
}*/
List<BasicdataStoreBrandVO> basicdataStoreBrandVOS = baseMapper.listNameBrand(queryWrapper ); // 查询相关品牌信息
voList.addAll(basicdataStoreBrandVOS);
/* List<BasicdataStoreBrandEntity> basicdataStoreBrandEntities = baseMapper.selectList(Wrappers.<BasicdataStoreBrandEntity>query().lambda()

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java

@ -284,7 +284,7 @@ public class DistributionDeliveryAppController {
/**
* 扫描查询配送任务下的包件信息
*/
@PostMapping("/getZeroPackageInfo")
@PostMapping("/getZeroPackageInfo")
@ApiOperationSupport(order = 11)
public R getZeroPackageInfo(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R distributionParcelListVOS = distributionDeliveryListService.getZeroPackageInfo(distrilbutionloadingscanDTO);

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

@ -756,10 +756,14 @@ public class DistributionStockupAppController extends BladeController {
.eq(DistributionParcelListEntity::getWarehouseId, byId.getWarehouseId())
);
if(ObjectUtils.isNotNull(list) && list.size() > 1){
throw new ServiceException("查询到重复包条信息!!");
return Resp.scanFail("查询到重复包条信息!!","查询到重复包条信息!!");
}
if(ObjectUtils.isNull(list)){
throw new ServiceException("没有查询到包件信息");
return Resp.scanFail("没有查询到包件信息 ! ","没有查询到包件信息 ! ");
}
if(!list.get(0).getConditions().equals("2")){
return Resp.scanFail("当前包件不是库存品,无法备货!!","当前包件不是库存品,无法备货!!");
}
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId());

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

@ -341,7 +341,7 @@ public class DistributionSignforController extends BladeController {
@ApiOperationSupport(order = 7)
@ApiOperation(value = "PC查看增值服务列表", notes = "传入ids")
public R checkAddValuePackageList(@RequestBody DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
return distributionAddvalueService.saveAddvalueInfo(distributionAppAddvalueDTO);
return distributionAddvalueService.savePCAddvalueInfo(distributionAppAddvalueDTO);
}
/**

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionReservationPackageExcel.java

@ -138,31 +138,31 @@ public class DistributionReservationPackageExcel implements Serializable {
*/
@ColumnWidth(20)
@ExcelProperty("一级品")
private Long firsts;
private String firsts;
/**
* 订单编号
*/
@ColumnWidth(20)
@ExcelProperty("二级品")
private Long second;
private String second;
/**
* 订单编号
*/
@ColumnWidth(20)
@ExcelProperty("三级品")
private Long thirdProduct;
private String thirdProduct;
/**
* 订单编号
*/
@ColumnWidth(20)
@ExcelProperty("物料名称")
private Long materialName;
private String materialName;
/**
* 订单编号
*/
@ColumnWidth(20)
@ExcelProperty("数量")
private Long quantity;
private Integer quantity;
// /**
// * 订单编号
// */
@ -174,12 +174,12 @@ public class DistributionReservationPackageExcel implements Serializable {
*/
@ColumnWidth(20)
@ExcelProperty("货位数量")
private Long positionCode;
private Integer positionCode;
/**
* 订单编号
*/
@ColumnWidth(20)
@ExcelProperty("所在托盘")
private Long trayCode;
private String trayCode;
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java

@ -62,6 +62,7 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
.eq(ObjectUtils.isNotNull(parcelListEntity.getId()),DistributionParcelListEntity::getId,parcelListEntity.getId())
.eq(ObjectUtils.isNotNull(parcelListEntity.getWarehouseId()),DistributionParcelListEntity::getWarehouseId,parcelListEntity.getWarehouseId())
.eq(ObjectUtils.isNotNull(parcelListEntity.getStockArticleId()),DistributionParcelListEntity::getStockArticleId,parcelListEntity.getStockArticleId())
.notIn(ObjectUtils.isNotNull(parcelListEntity.getOrderPackageStatus()),DistributionParcelListEntity::getOrderPackageStatus,parcelListEntity.getOrderPackageStatus().split(","))
);
}

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

@ -56,4 +56,10 @@ public interface DistributionAddvalueDetailMapper extends BaseMapper<Distributio
* @param addvalueId
*/
void deleteAddvalueDetail(@Param("addvalueId") Long addvalueId);
/**
* 删除增值服务详情
* @param addvalueDetailId
*/
void deleteAddvalueDetailById(@Param("id")Long addvalueDetailId);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueDetailMapper.xml

@ -30,13 +30,15 @@
<delete id="deleteAddvalueDetail">
DELETE FROM logpm_distribution_addvalue_detail WHERE addvalue_id = #{addvalueId}
</delete>
<delete id="deleteAddvalueDetailById">
DELETE FROM logpm_distribution_addvalue_detail WHERE id = #{id}
</delete>
<select id="selectDistributionAddvalueDetailPage" resultMap="distributionAddvalueDetailResultMap">
select * from logpm_distribution_addvalue_detail where is_deleted = 0
</select>
<select id="exportDistributionAddvalueDetail"
resultType="com.logpm.distribution.excel.DistributionAddvalueDetailExcel">
SELECT * FROM logpm_distribution_addvalue_detail ${ew.customSqlSegment}

32
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml

@ -127,7 +127,7 @@
ldpl.third_product AS third_product,
ldap.order_package_code AS order_package_code,
ldap.order_code AS order_code,
ldpl.quantity AS quantity,
ldap.quantity AS quantity,
ldrzp.quantity AS maxQuantity,
ldap.id AS id,
ldap.stock_article_id AS stockArticleId,
@ -199,7 +199,7 @@
<select id="selectAddvalueZeroPackageVO"
resultType="com.logpm.distribution.vo.DistributionAddvaluePackageVO">
SELECT
ldpl.id,
ldpl.id AS packageId,
ldpl.firsts,
ldpl.`second`,
ldpl.third_product,
@ -217,22 +217,22 @@
</select>
<select id="selectAddvalueInventoryPackageVO"
resultType="com.logpm.distribution.vo.DistributionAddvaluePackageVO">
SELECT
ldsld.sku,
ldsld.stock_package_code,
ldsld.reservation_id,
ldsld.stock_list_id,
ldsld.id AS packageId,
ldsld.num AS quantity,
ldsl.description_goods,
ldsl.cargo_number,
2 AS conditions,
'库存品' AS packageType
FROM
SELECT
ldsld.sku,
ldsld.stock_package_code AS orderPackageCode,
ldsld.reservation_id,
ldsld.stock_list_id,
ldsld.id AS packageId,
ldsld.num AS quantity,
ldsl.description_goods AS materialName,
ldsl.cargo_number AS materialCode,
2 AS conditions,
'库存品' AS packageType
FROM
logpm_dis_stock_list_detail AS ldsld
INNER JOIN logpm_distribution_stock_list AS ldsl ON ldsld.stock_list_id = ldsl.id
WHERE
ldsld.reservation_id = #{reservationId} AND ldsld.stock_package_status in ('1','3') AND ldsld.stock_list_id =#{stockListId}
WHERE
ldsld.reservation_id = #{reservationId} AND ldsld.stock_package_status in ('1','3') AND ldsld.stock_list_id =#{stockListId}
<if test="obj.orderPackageCode != null and obj.orderPackageCode != ''">
AND ldsld.stock_package_code like concat ('%',#{obj.orderPackageCode},'%')
</if>

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

@ -209,9 +209,20 @@
&lt;!&ndash; and lwug.association_type = '3' and lwtg.association_type = '3' &ndash;&gt;
</where>-->
select DISTINCT CONCAT(lwug.position_code ) allocation , lwtg.tray_code pallet,lwug.area_id areaId,ldpl.id parcelListId,lds.id stockId,
lwug.shelf_id shelfId,lwug.allocation_id allocationId,lwtg.tray_id trayId,ldpl.order_code orderCode,ldpl.stock_article_id stockArticleId
from logpm_distribution_reservation_package ldrp
LEFT JOIN logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id and ldpl.order_package_status != '70'
LEFT JOIN logpm_distribution_stock_article ldsa on ldpl.stock_article_id = ldsa.id
LEFT JOIN logpm_warehouse_updown_goods lwug on ldpl.id = lwug.association_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id and lds.reservation_id = ldrp.reservation_id
<where>
ldrp.reservation_id = #{reservationId} and ldrp.packet_bar_status in (1,3) and ldsa.is_zero = #{isZero}
</where>
<!--select DISTINCT CONCAT(lwug.position_code ) allocation , lwtg.tray_code pallet,lwug.area_id areaId,ldpl.id parcelListId,lds.id stockId,
lwug.shelf_id shelfId,lwug.allocation_id allocationId,lwtg.tray_id trayId,ldpl.order_code orderCode,ldpl.stock_article_id stockArticleId
from logpm_distribution_reservation_stockarticle ldrs
LEFT JOIN logpm_distribution_stock_article ldsa on ldrs.stock_article_id = ldsa.id
@ -221,8 +232,7 @@
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id and lds.reservation_id = ldrs.reservation_id
<where>
ldrs.reservation_id = #{reservationId} and ldrs.stock_article_status in (1,3) and ldsa.is_zero = #{isZero}
</where>
</where> -->
@ -254,7 +264,7 @@
from logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id and lwug.association_type = '3'
and ldpl.warehouse_id = lwug.warehouse_id
where ldpl.order_code = ldst.incoming_batch
where ldpl.order_code = ldst.incoming_batch and ldpl.conditions = '2'
)
END allocation,
ldrs.id deliveryDetailsId
@ -1040,7 +1050,7 @@
ldpn.delivery_quantity,
ldpn.signin_quantity,
ldpn.outbound_quantity,
ldpn.id AS id
ldpl.id AS id
FROM
logpm_distribution_reservation_stockarticle AS ldrs
LEFT JOIN logpm_distribution_reservation_zero_package AS ldrzp ON ldrs.stock_article_id = ldrzp.stock_article_id AND ldrzp.reservation_id = ldrs.reservation_id

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

@ -58,7 +58,7 @@
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id and lwug.warehouse_id = #{param.warehouseId}
<where>
ldrp.packet_bar_status in (1,3)
<if test="param.reservationId != null and param.reservationId != ''"> and ldrs.reservation_id = #{param.reservationId } </if>
<if test="param.reservationId != null and param.reservationId != ''"> and ldrp.reservation_id = #{param.reservationId } </if>
<if test="param.waybillNumber != null and param.waybillNumber != ''"> and ldpl.waybill_number like concat('%',#{param.waybillNumber },'%') </if>
<if test="param.serviceNumber != null and param.serviceNumber != ''"> and ldpl.service_number like concat('%', #{param.serviceNumber },'%') </if>
<if test="param.orderCode != null and param.orderCode != ''"> and ldpl.order_code like concat('%', #{param.orderCode },'%') </if>

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml

@ -49,6 +49,7 @@
LEFT JOIN logpm_distribution_stockup_info ldsi on ldsi.reservation_id = ldrs.reservation_id
LEFT JOIN logpm_distribution_stockup lds on lds.id = ldsi.stockup_id
<where>
ldrs.reservation_id =#{param.reservationId}
<if test="param.incomingBatch != null and param.incomingBatch !=''"> and ldsl.incoming_batch like concat('%', #{param.incomingBatch },'%')</if>
<if test="param.sku != null and param.sku !=''"> and ldsl.sku like concat('%', #{param.sku },'%')</if>
<if test="param.marketName != null and param.marketName !=''"> and ldsl.market_name like concat('%', #{param.marketName },'%')</if>

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

@ -58,7 +58,7 @@ public interface DistributionStockupInfoMapper extends BaseMapper< Distribution
* 删除预约备货中间表
* @param id
*/
void deleteByReservationId(@Param("id") Long stockupId,@Param("reservationId") Long id);
void deleteByReservationId(@Param("stockupId") Long stockupId,@Param("reservationId") Long id);
/**
* 备货商 市查询库存品的数量

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

@ -8,11 +8,11 @@
<delete id="deleteByReservationId">
DELETE FROM logpm_distribution_stockup_info
<where>
<if test="reservationId != null and reservationId != ''">
and reservation_id = #{reservationId}
<if test="stockupId != null and stockupId != ''">
and stockup_id = #{stockupId}
</if>
<if test="reservationId != null and reservationId != ''">
and if = #{id}
and reservation_id = #{reservationId}
</if>
</where>
</delete>

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml

@ -162,7 +162,7 @@
lwug.num
from logpm_distribution_reservation_stocklist ldrs
LEFT JOIN logpm_distribution_stock_list ldsl on ldrs.stocklist_id = ldsl.id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.order_code = ldsl.incoming_batch
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.order_code = ldsl.incoming_batch and ldpl.conditions = '2'
LEFT JOIN logpm_warehouse_updown_goods lwug
on lwug.association_id = ldpl.id and lwug.association_type = '3' and ldsl.warehouse_id = lwug.warehouse_id
where ldrs.id = #{param.deliveryDetailsId} and lwug.allocation_id is not null
@ -203,7 +203,7 @@
lwug.num
from logpm_distribution_delivery_details lddd
LEFT JOIN logpm_distribution_stock_list ldsl on lddd.stock_list_id = ldsl.id
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.order_code = ldsl.incoming_batch
LEFT JOIN logpm_distribution_parcel_list ldpl on ldpl.order_code = ldsl.incoming_batch and ldpl.conditions = '2'
LEFT JOIN logpm_warehouse_updown_goods lwug
on lwug.association_id = ldpl.id and lwug.association_type = '3' and ldsl.warehouse_id = lwug.warehouse_id
where lddd.id = #{param.deliveryDetailsId} and lwug.allocation_id is not null

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAddvalueService.java

@ -78,6 +78,13 @@ public interface IDistributionAddvalueService extends IService<DistributionAddva
*/
R saveAddvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO);
/**
* 保存增值服务列表
* @param distributionAppAddvalueDTO
* @return
*/
R savePCAddvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO);
/**
* 查询出该客户下的所有包件信息
* @param distributionAppAddvalueDTO

453
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java

@ -189,13 +189,14 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
}
@Override
@Transactional
public R saveAddvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageDTO> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
List<DistributionAddvaluePackageDTO> packageDTOList = packageEntityList.stream().filter(p -> Func.isNotEmpty(p.getQuantity()) && p.getQuantity() > 0).collect(Collectors.toList());
if (Func.isEmpty(packageDTOList)) {
return Resp.scanFail("操作失败", "无可用包件信息");
if (Func.isEmpty(packageDTOList)){
return Resp.scanFail("操作失败","无可用包件信息");
}
//查询是否重复添加
DistributionAddvalueEntity addvalueEntity = distributionAddvalueMapper.selectOne(Wrappers.<DistributionAddvalueEntity>query().lambda()
@ -203,17 +204,17 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
.eq(DistributionAddvalueEntity::getRefId, distributionAppAddvalueDTO.getReservationId())
.eq(DistributionAddvalueEntity::getRefType, 1));
if (Func.isNotEmpty(addvalueEntity)) {
if (Func.isNotEmpty(addvalueEntity)){
return Resp.scanFail("操作失败", "存在该类型增值服务项,如需更改请编辑");
}
DistributionAddvalueDetailEntity distributionAddvalueDetailEntity = new DistributionAddvalueDetailEntity();
if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
return Resp.scanFail("添加失败", "错误的包件数量");
} else {
}else {
distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum());
}
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(distributionAppAddvalueDTO.getReservationId());
if (Func.isEmpty(reservationEntity)) {
if (Func.isEmpty(reservationEntity)){
return Resp.scanFail("添加失败", "客户信息错误");
}
// 上楼 超区 平移 搬运 分拣 专车
@ -244,7 +245,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
return Resp.scanFail("添加失败", "请输入件数");
} else {
distributionAddvalueDetailEntity.setNum(packageEntityList.stream().mapToInt(DistributionAddvaluePackageDTO::getQuantity).sum());
distributionAddvalueDetailEntity.setNum(packageEntityList.stream().mapToInt(DistributionAddvaluePackageEntity::getQuantity).sum());
}
break;
case "6":
@ -263,13 +264,116 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
distributionAddvalueEntity.setRefType(1);
distributionAddvalueEntity.setRefId(distributionAppAddvalueDTO.getReservationId());
distributionAddvalueEntity.setDeliveryListId(distributionAppAddvalueDTO.getDeliveryId());
this.save(distributionAddvalueEntity);
distributionAddvalueDetailEntity.setAddvalueId(distributionAddvalueEntity.getId());
distributionAddvalueDetailEntity.setRecordType(2);
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionAppAddvalueDTO.getReservationId());
if (parcelListEntities.size() == packageEntityList.size()){
distributionAddvalueDetailEntity.setRecordType(1);
}
distributionAddvalueDetailService.save(distributionAddvalueDetailEntity);
List<DistributionAddvaluePackageEntity> addvaluePackageEntities = new ArrayList<>();
packageEntityList.stream().forEach(p->{p.setAddvalueDetailId(distributionAddvalueDetailEntity.getId());p.setQuantity(p.getZeroQuantity());addvaluePackageEntities.add(Func.copy(p,DistributionAddvaluePackageEntity.class));});
distributionAddvaluePackageService.saveBatch(addvaluePackageEntities);
return Resp.scanSuccess("添加成功","添加成功");
}
@Override
@Transactional
public R savePCAddvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageDTO> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
List<DistributionAddvaluePackageDTO> packageDTOList = packageEntityList.stream().filter(p -> Func.isNotEmpty(p.getQuantity()) && p.getQuantity() > 0).collect(Collectors.toList());
if (Func.isEmpty(packageDTOList)) {
return Resp.scanFail("操作失败", "无可用包件信息");
}
//查询是否重复添加
DistributionAddvalueEntity addvalueEntity = distributionAddvalueMapper.selectOne(Wrappers.<DistributionAddvalueEntity>query().lambda()
.eq(DistributionAddvalueEntity::getAddvalueId, distributionAppAddvalueDTO.getAddvalueType())
.eq(DistributionAddvalueEntity::getRefId, distributionAppAddvalueDTO.getReservationId())
.eq(DistributionAddvalueEntity::getRefType, 1));
if (Func.isNotEmpty(addvalueEntity)) {
return Resp.scanFail("操作失败", "存在该类型增值服务项,如需更改请编辑");
}
DistributionAddvalueDetailEntity distributionAddvalueDetailEntity = new DistributionAddvalueDetailEntity();
// if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
// return Resp.scanFail("添加失败", "错误的包件数量");
// } else {
// distributionAddvalueDetailEntity.setNum(distributionAppAddvalueDTO.getNum());
// }
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(distributionAppAddvalueDTO.getReservationId());
if (Func.isEmpty(reservationEntity)) {
return Resp.scanFail("添加失败", "客户信息错误");
}
// 上楼 超区 平移 搬运 分拣 专车
switch (distributionAppAddvalueDTO.getAddvalueType()) {
case "1":
if (Func.isEmpty(distributionAppAddvalueDTO.getFloolNum())) {
return Resp.scanFail("添加失败", "请输入楼层数");
} else {
distributionAddvalueDetailEntity.setFloolNum(distributionAppAddvalueDTO.getFloolNum());
}
break;
case "2":
if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) {
return Resp.scanFail("添加失败", "请输入超区公里数");
} else {
distributionAddvalueDetailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
case "3":
if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) {
return Resp.scanFail("添加失败", "请输入平移距离");
} else {
distributionAddvalueDetailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
// case "4":
// case "5":
// if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
// return Resp.scanFail("添加失败", "请输入件数");
// } else {
// distributionAddvalueDetailEntity.setNum(packageEntityList.stream().mapToInt(DistributionAddvaluePackageDTO::getQuantity).sum());
// }
// break;
// case "6":
// if (Func.isEmpty(distributionAppAddvalueDTO.getFee())) {
// return Resp.scanFail("添加失败", "请输入件数");
// } else {
// distributionAddvalueDetailEntity.setFee(distributionAppAddvalueDTO.getFee());
// }
// break;
default:
return Resp.scanFail("添加失败", "服务器正忙");
}
int total = packageEntityList.stream().mapToInt(DistributionAddvaluePackageDTO::getQuantity).sum();
if ( total == 0) {
return Resp.scanFail("添加失败", "包件数量错误");
} else {
distributionAddvalueDetailEntity.setNum(packageEntityList.stream().mapToInt(DistributionAddvaluePackageDTO::getQuantity).sum());
}
if (Func.isEmpty(distributionAppAddvalueDTO.getFee())) {
return Resp.scanFail("添加失败", "请输入费用");
} else {
distributionAddvalueDetailEntity.setFee(distributionAppAddvalueDTO.getFee());
}
DistributionAddvalueEntity distributionAddvalueEntity = new DistributionAddvalueEntity();
distributionAddvalueEntity.setAddvalueId(distributionAppAddvalueDTO.getAddvalueType());
distributionAddvalueEntity.setCode(reservationEntity.getReservationCode());
distributionAddvalueEntity.setRefType(1);
distributionAddvalueEntity.setRefId(distributionAppAddvalueDTO.getReservationId());
distributionAddvalueEntity.setDeliveryListId(distributionAppAddvalueDTO.getDeliveryId());
distributionAddvalueEntity.setWarehouseId(reservationEntity.getWarehouseId());
distributionAddvalueEntity.setWarehouseName(reservationEntity.getWarehouseName());
this.save(distributionAddvalueEntity);
distributionAddvalueDetailEntity.setAddvalueId(distributionAddvalueEntity.getId());
distributionAddvalueDetailEntity.setRecordType(2);
// List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionAppAddvalueDTO.getReservationId());
if (reservationEntity.getReservationNum()+reservationEntity.getReservationStockListNum() == packageEntityList.size()) {
if (reservationEntity.getReservationNum() + reservationEntity.getReservationStockListNum() == packageEntityList.size()) {
distributionAddvalueDetailEntity.setRecordType(1);
}
distributionAddvalueDetailService.save(distributionAddvalueDetailEntity);
@ -283,28 +387,36 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
case 1:
//判定该包件是否属于该客户
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionAppAddvalueDTO.getReservationId());
boolean packageFlag = parcelListEntities.stream().allMatch(pack -> !Func.equals(pack.getId(), p.getPackageId()));
if (packageFlag){
// boolean packageFlag = parcelListEntities.stream().allMatch(pack -> !Func.equals(pack.getId(), p.getPackageId()));
boolean packageFlag = parcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()).contains(p.getPackageId());
if (!packageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
case 2:
List<DistributionParcelNumberDTO> distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(distributionAppAddvalueDTO.getReservationId());
boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().allMatch(pack -> !Func.equals(pack.getId(), p.getPackageId()));
if (zeroPackageFlag){
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionAppAddvalueDTO.getReservationId());
// boolean inventoryPackageFlag = detailEntities.stream().allMatch(pack -> !Func.equals(pack.getId(), p.getPackageId()));
boolean inventoryPackageFlag = detailEntities.stream().map(DisStockListDetailEntity::getId).collect(Collectors.toList()).contains(p.getPackageId());
if (!inventoryPackageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
case 3:
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionAppAddvalueDTO.getReservationId());
boolean inventoryPackageFlag = detailEntities.stream().allMatch(pack -> !Func.equals(pack.getId(), p.getPackageId()));
if (inventoryPackageFlag){
List<DistributionParcelNumberDTO> distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(distributionAppAddvalueDTO.getReservationId());
// boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().allMatch(pack -> !Func.equals(pack.getId(), p.getPackageId()));
boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getId).collect(Collectors.toList()).contains(p.getPackageId());
if (!zeroPackageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
}
p.setAddvalueDetailId(distributionAddvalueDetailEntity.getId());
addvaluePackageEntities.add(Func.copy(p, DistributionAddvaluePackageEntity.class));
DistributionAddvaluePackageEntity addvaluePackageEntity = Func.copy(p, DistributionAddvaluePackageEntity.class);
if (Func.isNotEmpty(p.getZeroQuantity())){
addvaluePackageEntity.setQuantity(p.getZeroQuantity());
}
addvaluePackageEntities.add(addvaluePackageEntity);
}
});
distributionAddvaluePackageService.saveBatch(addvaluePackageEntities);
@ -552,13 +664,20 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
.eq(DistributionAddvaluePackageEntity::getReservationId, distributionAppAddvalueDTO.getReservationId())
.eq(DistributionAddvaluePackageEntity::getAddvalueDetailId, distributionAppAddvalueDTO.getAddvalueDetailId())
);
packageIds.forEach(id -> {
distributionAddvaluePackageMapper.deleteAddvaluePackage(distributionAppAddvalueDTO.getReservationId(), id);
});
if (packageIds.size() == addvaluePackageEntities.size()) {
//这里就需要对整个增值服务项进行删除
distributionAddvalueDetailMapper.deleteAddvalueDetail(distributionAppAddvalueDTO.getAddvalueDetailId());
distributionAddvalueMapper.deleteAddvalue(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType());
//查看取消增值服务的保健是否存在该项增值服务中,存在才能继续执行
boolean isExistence = packageIds.stream().allMatch(id -> addvaluePackageEntities.stream().map(DistributionAddvaluePackageEntity::getPackageId).collect(Collectors.toList()).contains(id));
if (isExistence) {
if (packageIds.size() == addvaluePackageEntities.size()) {
//这里就需要对整个增值服务项进行删除
distributionAddvalueDetailMapper.deleteAddvalueDetailById(distributionAppAddvalueDTO.getAddvalueDetailId());
distributionAddvalueMapper.deleteAddvalue(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType());
}
packageIds.forEach(id -> {
distributionAddvaluePackageMapper.deleteAddvaluePackage(distributionAppAddvalueDTO.getReservationId(), id);
});
} else {
log.error("###########该包件不存在增值服务项包件列表中");
return R.fail("取消包件失败,该包件不存在增值服务项列表中");
}
return R.success("操作成功");
}
@ -566,117 +685,207 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
@Override
public R updatePCAddvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageDTO> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
if (Func.isEmpty(packageEntityList)){
if (Func.isEmpty(packageEntityList)) {
return R.fail("无包件信息");
}
Map<Long, DistributionAddvaluePackageDTO> packageDTOMap = packageEntityList.stream().collect(Collectors.toMap(DistributionAddvaluePackageDTO::getPackageId, Function.identity(), (k1, k2) -> k2));
List<Long> zeroPackageIds = packageEntityList.stream().filter(p -> p.getConditions() == 3).collect(Collectors.toList()).stream().map(DistributionAddvaluePackageDTO::getPackageId).collect(Collectors.toList());
//这里需要查询出原来的增值服务项详情
DistributionAddvalueDetailEntity detailEntity = distributionAddvalueDetailMapper.selectById(distributionAppAddvalueDTO.getAddvalueDetailId());
if (Func.isEmpty(detailEntity)){
log.error("###########查询增值服务详情错误:{}",detailEntity);
log.error("###########AddvalueDetailId>>>>>>>>>>>>>>>>>>>>>>>>>>>:{}",detailEntity);
return R.fail("服务器正忙............");
}
String addvalueType = distributionAppAddvalueDTO.getAddvalueType();
switch (addvalueType) {
case "1":
if (Func.isEmpty(distributionAppAddvalueDTO.getFloolNum())) {
return Resp.scanFail("添加失败", "请输入楼层数");
} else {
detailEntity.setFloolNum(distributionAppAddvalueDTO.getFloolNum());
}
break;
case "2":
if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) {
return Resp.scanFail("添加失败", "请输入超区公里数");
} else {
detailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
case "3":
if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) {
return Resp.scanFail("添加失败", "请输入平移距离");
} else {
detailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
case "4":
case "5":
if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
return Resp.scanFail("添加失败", "请输入件数");
} else {
detailEntity.setNum(distributionAppAddvalueDTO.getNum());
}
break;
case "6":
if (Func.isEmpty(distributionAppAddvalueDTO.getFee())) {
return Resp.scanFail("添加失败", "错误的包件数量");
} else {
detailEntity.setFee(distributionAppAddvalueDTO.getFee());
}
break;
default:
return Resp.scanFail("添加失败", "服务器正忙");
//查询出对应所有增值服务项的包件信息
List<DistributionAddvaluePackageEntity> addvaluePackageEntities = distributionAddvaluePackageMapper.selectList(Wrappers.<DistributionAddvaluePackageEntity>query().lambda()
.eq(DistributionAddvaluePackageEntity::getReservationId, distributionAppAddvalueDTO.getReservationId())
.eq(DistributionAddvaluePackageEntity::getAddvalueDetailId, distributionAppAddvalueDTO.getAddvalueDetailId()));
List<Long> increasePackage = packageEntityList.stream()
.map(DistributionAddvaluePackageDTO::getPackageId)
.filter(p -> !addvaluePackageEntities.stream()
.map(DistributionAddvaluePackageEntity::getPackageId)
.collect(Collectors.toList()).contains(p))
.collect(Collectors.toList());
if (Func.isNotEmpty(zeroPackageIds)){
increasePackage.addAll(zeroPackageIds);
}
distributionAddvalueDetailMapper.updateById(detailEntity);
//查询出原来的包件信息
DistributionAddvalueVO addvalueVO = distributionAddvalueMapper.selectReservationAddvalue(distributionAppAddvalueDTO.getReservationId(), addvalueType);
String packageListIds = addvalueVO.getPackageListIds();
if (Func.isEmpty(packageListIds)){
log.error("##############查询增值服务包件列表DI错误:{}",packageListIds);
if (increasePackage.size() == 0) {
//添加包件都已经存在在增值服务列表
return Resp.scanFail("添加失败", "包件已存在");
}
List<DistributionAddvaluePackageEntity> distributionAddvaluePackageEntities = distributionAddvaluePackageService.list(Wrappers.<DistributionAddvaluePackageEntity>query().lambda()
.in(DistributionAddvaluePackageEntity::getPackageId, Func.toLongList(packageListIds))
.eq(DistributionAddvaluePackageEntity::getAddvalueDetailId, distributionAppAddvalueDTO.getAddvalueDetailId()));
Map<Long, List<DistributionAddvaluePackageEntity>> oldPackageList = distributionAddvaluePackageEntities.stream().collect(Collectors.groupingBy(DistributionAddvaluePackageEntity::getPackageId));
Map<Long, List<DistributionAddvaluePackageDTO>> newPackageList = packageEntityList.stream().collect(Collectors.groupingBy(DistributionAddvaluePackageEntity::getPackageId));
newPackageList.forEach((k, v) -> {
DistributionAddvaluePackageDTO distributionAddvaluePackageEntity = v.get(0);
//只要不存在与就是新增,这里PC操作是一个包件累加操作,如果已经存在列表之中那么不进行添加
if (Func.isEmpty(oldPackageList.get(k))) {
//从老的包件中无法进行获取,这里进行包件的新增
DistributionAddvaluePackageEntity addvaluePackageEntity = new DistributionAddvaluePackageEntity();
addvaluePackageEntity.setQuantity(distributionAddvaluePackageEntity.getZeroQuantity());
addvaluePackageEntity.setAddvalueDetailId(distributionAddvaluePackageEntity.getAddvalueDetailId());
addvaluePackageEntity.setStockArticleId(distributionAddvaluePackageEntity.getStockArticleId());
addvaluePackageEntity.setMaterialName(distributionAddvaluePackageEntity.getMaterialName());
addvaluePackageEntity.setPackageId(distributionAddvaluePackageEntity.getPackageId());
addvaluePackageEntity.setReservationId(distributionAddvaluePackageEntity.getReservationId());
if (distributionAddvaluePackageEntity.getConditions() == 3) {
addvaluePackageEntity.setConditions(3);
addvaluePackageEntity.setRecordType("3");
distributionAddvaluePackageService.save(addvaluePackageEntity);
} else if (distributionAddvaluePackageEntity.getConditions() == 1) {
//新增订制品
addvaluePackageEntity.setOrderPackageCode(distributionAddvaluePackageEntity.getOrderPackageCode());
addvaluePackageEntity.setRecordType("1");
addvaluePackageEntity.setConditions(1);
} else {
//新增库存品
addvaluePackageEntity.setOrderPackageCode(distributionAddvaluePackageEntity.getOrderPackageCode());
addvaluePackageEntity.setRecordType("2");
addvaluePackageEntity.setConditions(2);
}
// distributionAddvaluePackageEntity.setAddvalueDetailId(distributionAddvaluePackageEntities.get(0).getAddvalueDetailId());
distributionAddvaluePackageService.save(addvaluePackageEntity);
} else {
if (distributionAddvaluePackageEntity.getConditions() == 3) {
if (distributionAddvaluePackageEntity.getZeroQuantity() != 0) {
if (distributionAddvaluePackageEntity.getZeroQuantity() > 0) {
distributionAddvaluePackageEntity.setQuantity(distributionAddvaluePackageEntity.getZeroQuantity());
distributionAddvaluePackageService.updateById(distributionAddvaluePackageEntity);
} else {
log.error("###############零担品类录入数量有误:{}", distributionAddvaluePackageEntity.getZeroQuantity());
if (increasePackage.size() > 0) {
//统计该项增值服务包件数量
int num = detailEntity.getNum() + increasePackage.size();
detailEntity.setNum(num);
switch (distributionAppAddvalueDTO.getAddvalueType()) {
case "1":
if (Func.isEmpty(distributionAppAddvalueDTO.getFloolNum())) {
return Resp.scanFail("添加失败", "请输入楼层数");
} else {
detailEntity.setFloolNum(distributionAppAddvalueDTO.getFloolNum());
}
break;
case "2":
if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) {
return Resp.scanFail("添加失败", "请输入超区公里数");
} else {
detailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
case "3":
if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) {
return Resp.scanFail("添加失败", "请输入平移距离");
} else {
detailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
// case "4":
// case "5":
// if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
// return Resp.scanFail("添加失败", "请输入件数");
// } else {
// detailEntity.setNum(num);
// }
// break;
// case "6":
// if (Func.isEmpty(distributionAppAddvalueDTO.getFee())) {
// return Resp.scanFail("添加失败", "错误的包件数量");
// } else {
// detailEntity.setFee(distributionAppAddvalueDTO.getFee());
// }
// break;
default:
return Resp.scanFail("添加失败", "服务器正忙");
}
detailEntity.setFee(distributionAppAddvalueDTO.getFee());
detailEntity.setNum(num);
distributionAddvalueDetailMapper.updateById(detailEntity);
//添加新的包件信息
increasePackage.forEach(ip -> {
if (Func.isNotEmpty(packageDTOMap.get(ip))) {
//新增包件
DistributionAddvaluePackageDTO distributionAddvaluePackageDTO = packageDTOMap.get(ip);
DistributionAddvaluePackageEntity distributionAddvaluePackageEntity = distributionAddvaluePackageMapper.selectOne(Wrappers.<DistributionAddvaluePackageEntity>query().lambda()
.eq(DistributionAddvaluePackageEntity::getReservationId, distributionAddvaluePackageDTO.getReservationId())
.eq(DistributionAddvaluePackageEntity::getPackageId, distributionAddvaluePackageDTO.getPackageId())
.eq(DistributionAddvaluePackageEntity::getAddvalueDetailId, distributionAddvaluePackageDTO.getAddvalueDetailId())
.eq(DistributionAddvaluePackageEntity::getStockArticleId, distributionAddvaluePackageDTO.getStockArticleId())
);
if (distributionAddvaluePackageDTO.getConditions() == 3) {
if (Func.isEmpty(distributionAddvaluePackageEntity)){
//新增零担
// DistributionAddvaluePackageEntity zeroAddvaluePackageEntity = new DistributionAddvaluePackageEntity();
if (distributionAddvaluePackageDTO.getZeroQuantity() > 0){
DistributionAddvaluePackageEntity zeroAddvaluePackageEntity = Func.copy(distributionAddvaluePackageDTO, DistributionAddvaluePackageEntity.class);
distributionAddvaluePackageEntity.setQuantity(distributionAddvaluePackageDTO.getZeroQuantity());
distributionAddvaluePackageService.updateById(zeroAddvaluePackageEntity);
}else {
log.error("###############零担品类录入数量0:{}", distributionAddvaluePackageDTO.getPackageId());
}
}else {
if (distributionAddvaluePackageDTO.getZeroQuantity() > 0) {
distributionAddvaluePackageEntity.setQuantity(distributionAddvaluePackageDTO.getZeroQuantity());
distributionAddvaluePackageService.updateById(distributionAddvaluePackageEntity);
} else {
log.error("###############零担品类录入数量0:{}", distributionAddvaluePackageDTO.getPackageId());
}
}
} else {
//删除对应的包件信息
distributionAddvaluePackageMapper.deleteAddvaluePackage(distributionAddvaluePackageEntity.getReservationId(), distributionAddvaluePackageEntity.getPackageId());
DistributionAddvaluePackageEntity addvaluePackageEntity = new DistributionAddvaluePackageEntity();
addvaluePackageEntity.setAddvalueDetailId(distributionAddvaluePackageDTO.getAddvalueDetailId());
addvaluePackageEntity.setStockArticleId(distributionAddvaluePackageDTO.getStockArticleId());
addvaluePackageEntity.setAddvalueDetailId(distributionAppAddvalueDTO.getAddvalueDetailId());
addvaluePackageEntity.setOrderCode(distributionAddvaluePackageDTO.getOrderCode());
addvaluePackageEntity.setMaterialName(distributionAddvaluePackageDTO.getMaterialName());
addvaluePackageEntity.setPackageId(distributionAddvaluePackageDTO.getPackageId());
addvaluePackageEntity.setReservationId(distributionAddvaluePackageDTO.getReservationId());
addvaluePackageEntity.setQuantity(distributionAddvaluePackageDTO.getQuantity());
if (distributionAddvaluePackageDTO.getConditions() == 1) {
//新增订制品
addvaluePackageEntity.setOrderPackageCode(distributionAddvaluePackageDTO.getOrderPackageCode());
addvaluePackageEntity.setRecordType("3");
addvaluePackageEntity.setConditions(1);
} else {
//新增库存品
addvaluePackageEntity.setMaterialName(distributionAddvaluePackageDTO.getMaterialName());
addvaluePackageEntity.setOrderPackageCode(distributionAddvaluePackageDTO.getOrderPackageCode());
addvaluePackageEntity.setRecordType("3");
addvaluePackageEntity.setConditions(2);
}
distributionAddvaluePackageService.save(addvaluePackageEntity);
}
}
}
});
return R.status(true);
});
}
return R.status(true);
}
// if (Func.isEmpty(detailEntity)) {
// log.error("###########查询增值服务详情错误:{}", detailEntity);
// log.error("###########AddvalueDetailId>>>>>>>>>>>>>>>>>>>>>>>>>>>:{}", detailEntity);
// return R.fail("服务器正忙............");
// }
// String addvalueType = distributionAppAddvalueDTO.getAddvalueType();
//
// distributionAddvalueDetailMapper.updateById(detailEntity);
//查询出原来的包件信息
// DistributionAddvalueVO addvalueVO = distributionAddvalueMapper.selectReservationAddvalue(distributionAppAddvalueDTO.getReservationId(), addvalueType);
// String packageListIds = addvalueVO.getPackageListIds();
// if (Func.isEmpty(packageListIds)) {
// log.error("##############查询增值服务包件列表DI错误:{}", packageListIds);
// }
// List<DistributionAddvaluePackageEntity> distributionAddvaluePackageEntities = distributionAddvaluePackageService.list(Wrappers.<DistributionAddvaluePackageEntity>query().lambda()
// .in(DistributionAddvaluePackageEntity::getPackageId, Func.toLongList(packageListIds))
// .eq(DistributionAddvaluePackageEntity::getAddvalueDetailId, distributionAppAddvalueDTO.getAddvalueDetailId()));
// Map<Long, List<DistributionAddvaluePackageEntity>> oldPackageList = distributionAddvaluePackageEntities.stream().collect(Collectors.groupingBy(DistributionAddvaluePackageEntity::getPackageId));
// Map<Long, List<DistributionAddvaluePackageDTO>> newPackageList = packageEntityList.stream().collect(Collectors.groupingBy(DistributionAddvaluePackageEntity::getPackageId));
// newPackageList.forEach((k, v) -> {
// DistributionAddvaluePackageDTO distributionAddvaluePackageEntity = v.get(0);
// //只要不存在与就是新增,这里PC操作是一个包件累加操作,如果已经存在列表之中那么不进行添加
// if (Func.isEmpty(oldPackageList.get(k))) {
// //从老的包件中无法进行获取,这里进行包件的新增
// DistributionAddvaluePackageEntity addvaluePackageEntity = new DistributionAddvaluePackageEntity();
// addvaluePackageEntity.setQuantity(distributionAddvaluePackageEntity.getZeroQuantity());
// addvaluePackageEntity.setAddvalueDetailId(distributionAddvaluePackageEntity.getAddvalueDetailId());
// addvaluePackageEntity.setStockArticleId(distributionAddvaluePackageEntity.getStockArticleId());
// addvaluePackageEntity.setMaterialName(distributionAddvaluePackageEntity.getMaterialName());
// addvaluePackageEntity.setPackageId(distributionAddvaluePackageEntity.getPackageId());
// addvaluePackageEntity.setReservationId(distributionAddvaluePackageEntity.getReservationId());
// if (distributionAddvaluePackageEntity.getConditions() == 3) {
// addvaluePackageEntity.setConditions(3);
// addvaluePackageEntity.setRecordType("3");
// distributionAddvaluePackageService.save(addvaluePackageEntity);
// } else if (distributionAddvaluePackageEntity.getConditions() == 1) {
// //新增订制品
// addvaluePackageEntity.setOrderPackageCode(distributionAddvaluePackageEntity.getOrderPackageCode());
// addvaluePackageEntity.setRecordType("1");
// addvaluePackageEntity.setConditions(1);
// } else {
// //新增库存品
// addvaluePackageEntity.setOrderPackageCode(distributionAddvaluePackageEntity.getOrderPackageCode());
// addvaluePackageEntity.setRecordType("2");
// addvaluePackageEntity.setConditions(2);
// }
//// distributionAddvaluePackageEntity.setAddvalueDetailId(distributionAddvaluePackageEntities.get(0).getAddvalueDetailId());
// distributionAddvaluePackageService.save(addvaluePackageEntity);
// } else {
// if (distributionAddvaluePackageEntity.getConditions() == 3) {
// if (distributionAddvaluePackageEntity.getZeroQuantity() != 0) {
// if (distributionAddvaluePackageEntity.getZeroQuantity() > 0) {
// distributionAddvaluePackageEntity.setQuantity(distributionAddvaluePackageEntity.getZeroQuantity());
// distributionAddvaluePackageService.updateById(distributionAddvaluePackageEntity);
// } else {
// log.error("###############零担品类录入数量有误:{}", distributionAddvaluePackageEntity.getZeroQuantity());
// }
// } else {
// //删除对应的包件信息
// distributionAddvaluePackageMapper.deleteAddvaluePackage(distributionAddvaluePackageEntity.getReservationId(), distributionAddvaluePackageEntity.getPackageId());
// }
// }
// }
// });
// return R.status(true);
// }
// @Override
// public List<DistributionAddvaluePackageEntity> getAddvalueBySignfor(DistributionAddvalueDTO distributionAddvalueDTO) {
// DistributionAddvalueVO addvalueVO = distributionAddvalueMapper.getAddvalueBySignfor(distributionAddvalueDTO);

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

@ -5367,17 +5367,41 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanFail("操作失败","不属于该配送任务!!!");
}
}
break;
case 2:
List<DistributionRetentionScanVo> distributionRetentionScanVos = baseMapper.selectRetentionZeroPackage(distrilbutionloadingscanDTO.getDeliveryId(),distrilbutionloadingscanDTO.getBarcode());
if (Func.isNotEmpty(distributionRetentionScanVos)){
retentionScanVos.addAll(distributionRetentionScanVos);
}
break;
case 2:
//托盘
break;
default:
log.info("################无满足滞留扫描类型");
break;
// //托盘
// TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(distrilbutionloadingscanDTO.getBarcode());
// if (Func.isEmpty(trayTypeDataVO)){
// log.error("################查询托盘失败,托盘码为:{}",distrilbutionloadingscanDTO.getBarcode());
// return Resp.scanFail("扫描托盘失败","请扫描托盘码");
// }
// List<WarehouseTrayGoodsEntity> goodsLsit = trayTypeDataVO.getGoodsLsit();
// boolean flag = goodsLsit.stream().allMatch(good -> good.getAssociationType().equals("3"));
// if (!flag){
// log.error("#########托盘货物存在多种类型,:{}", goodsLsit.stream().distinct().map(WarehouseTrayGoodsEntity::getAssociationType).collect(Collectors.toList()));
// return Resp.scanFail("托盘存在多种货物","托盘存在多种货物");
// }
// //查询出配送任务所有包件
//// List<DistributionParcelListEntity> parcelListEntityList = baseMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
// boolean isBelongTo = goodsLsit.stream().map(WarehouseTrayGoodsEntity::getAssociationId).allMatch(good -> parcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()).contains(good));
// if (isBelongTo){
// //判断包件是否都属于该配送计划
// goodsLsit.forEach(g->{
// DistributionRetentionScanVo retentionScanVo = baseMapper.selectRetentionPackage(g.getAssociationValue(), distrilbutionloadingscanDTO.getDeliveryId());
// retentionScanVos.add(retentionScanVo);
// });
// }else {
// log.error("####################托盘包件不完全属于该配送任务,isBelongTo:{}",isBelongTo);
// return Resp.scanFail("存在货物不属于该任务","存在货物不属于该任务");
// }
// break;
// default:
// log.info("################无满足滞留扫描类型");
// break;
}
// warehouseRetentionScanClient.saveRetentionScan();
if (Func.isEmpty(retentionScanVos)){

182
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -3167,99 +3167,99 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
@Override
public boolean retentionCancelReservationPack(DistributionRetentionScanVo distributionRetentionScanVo) {
//滞留取消配送任务
Integer conditions = distributionRetentionScanVo.getConditions();
DistributionReservationEntity reservationEntity = this.getById(distributionRetentionScanVo.getReservationId());
if (Func.isEmpty(reservationEntity)){
log.error("###########查询预约计划错误,reservationId:{}",distributionRetentionScanVo.getReservationId());
return false;
}
switch (conditions){
// 1 定制 2-零担 3-库存品
case 1:
if (reservationEntity.getReservationNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationStockListNum() == 0){
//该预约订单只存在该包件并且没有库存品
this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class));
}else {
DistributionReservationPackageEntity reservationPackageEntity = distributionReservationPackageMapper.selectOne(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.eq(DistributionReservationPackageEntity::getReservationId, distributionRetentionScanVo.getReservationId())
.eq(DistributionReservationPackageEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
.eq(DistributionReservationPackageEntity::getParceListId, distributionRetentionScanVo.getOrderPackageId())
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()));
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
distributionReservationPackageMapper.updateById(reservationPackageEntity);
DistributionReservationStockarticleEntity reservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, distributionRetentionScanVo.getReservationId())
.eq(DistributionReservationStockarticleEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
.eq(DistributionReservationStockarticleEntity::getIsZero, IsOrNoConstant.no.getValue())
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue()));
Integer reservationNum = reservationStockarticleEntity.getReservationNum();
Integer retentionQuantity = distributionRetentionScanVo.getRetentionQuantity();
if ((reservationNum - retentionQuantity) == 0){
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
}
reservationStockarticleEntity.setReservationNum(reservationNum - retentionQuantity);
distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity);
reservationEntity.setReservationNum(reservationEntity.getReservationNum() - retentionQuantity);
this.updateById(reservationEntity);
}
break;
case 2:
if (reservationEntity.getReservationStockListNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationNum() == 0){
this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class));
}else {
DisStockListDetailEntity disStockListDetailEntity = disStockListDetailMapper.selectOne(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, distributionRetentionScanVo.getReservationId())
.eq(DisStockListDetailEntity::getStockListId, distributionRetentionScanVo.getInventoryId())
.eq(DisStockListDetailEntity::getId, distributionRetentionScanVo.getOrderPackageId())
);
disStockListDetailEntity.setStockPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
disStockListDetailMapper.updateById(disStockListDetailEntity);
DistributionReservationStocklistEntity reservationStocklistEntity = distributionReservationStocklistMapper.selectOne(Wrappers.<DistributionReservationStocklistEntity>query().lambda()
.eq(DistributionReservationStocklistEntity::getReservationId, distributionRetentionScanVo.getReservationId())
.eq(DistributionReservationStocklistEntity::getStocklistId, distributionRetentionScanVo.getInventoryId())
.ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
Integer reservationNum = reservationStocklistEntity.getReservationNum();
}
break;
case 3:
if (reservationEntity.getReservationNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationStockListNum() == 0){
//该预约订单只存在该包件并且没有库存品
this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class));
}else {
DistributionReservationZeroPackageEntity reservationZeroPackageEntity = distributionReservationZeroPackageMapper.selectOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, distributionRetentionScanVo.getReservationId())
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
.eq(DistributionReservationZeroPackageEntity::getParcelListId, distributionRetentionScanVo.getOrderPackageId())
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()));
if (reservationZeroPackageEntity.getQuantity() == distributionRetentionScanVo.getRetentionQuantity()){
reservationZeroPackageEntity.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
}
reservationZeroPackageEntity.setQuantity(reservationZeroPackageEntity.getQuantity() -distributionRetentionScanVo.getRetentionQuantity());
distributionReservationZeroPackageMapper.updateById(reservationZeroPackageEntity);
DistributionReservationStockarticleEntity reservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
.eq(DistributionReservationStockarticleEntity::getReservationId, distributionRetentionScanVo.getReservationId())
.eq(DistributionReservationStockarticleEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
.eq(DistributionReservationStockarticleEntity::getIsZero, IsOrNoConstant.no.getValue())
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue()));
Integer reservationNum = reservationStockarticleEntity.getReservationNum();
Integer retentionQuantity = distributionRetentionScanVo.getRetentionQuantity();
if ((reservationNum - retentionQuantity) == 0){
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
}
reservationStockarticleEntity.setReservationNum(reservationNum - retentionQuantity);
distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity);
reservationEntity.setReservationNum(reservationEntity.getReservationNum() - retentionQuantity);
this.updateById(reservationEntity);
}
break;
}
log.info("@@@@@@@@@@@@执行了包件滞留取消");
// //滞留取消配送任务
// Integer conditions = distributionRetentionScanVo.getConditions();
// DistributionReservationEntity reservationEntity = this.getById(distributionRetentionScanVo.getReservationId());
// if (Func.isEmpty(reservationEntity)){
// log.error("###########查询预约计划错误,reservationId:{}",distributionRetentionScanVo.getReservationId());
// return false;
// }
// switch (conditions){
// // 1 定制 2-零担 3-库存品
// case 1:
// if (reservationEntity.getReservationNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationStockListNum() == 0){
// //该预约订单只存在该包件并且没有库存品
// this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class));
// }else {
// DistributionReservationPackageEntity reservationPackageEntity = distributionReservationPackageMapper.selectOne(Wrappers.<DistributionReservationPackageEntity>query().lambda()
// .eq(DistributionReservationPackageEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DistributionReservationPackageEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
// .eq(DistributionReservationPackageEntity::getParceListId, distributionRetentionScanVo.getOrderPackageId())
// .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()));
// reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
// distributionReservationPackageMapper.updateById(reservationPackageEntity);
// DistributionReservationStockarticleEntity reservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
// .eq(DistributionReservationStockarticleEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DistributionReservationStockarticleEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
// .eq(DistributionReservationStockarticleEntity::getIsZero, IsOrNoConstant.no.getValue())
// .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue()));
// Integer reservationNum = reservationStockarticleEntity.getReservationNum();
// Integer retentionQuantity = distributionRetentionScanVo.getRetentionQuantity();
// if ((reservationNum - retentionQuantity) == 0){
// reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
// }
// reservationStockarticleEntity.setReservationNum(reservationNum - retentionQuantity);
// distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity);
// reservationEntity.setReservationNum(reservationEntity.getReservationNum() - retentionQuantity);
// this.updateById(reservationEntity);
// }
// break;
// case 2:
// if (reservationEntity.getReservationStockListNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationNum() == 0){
// this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class));
// }else {
// DisStockListDetailEntity disStockListDetailEntity = disStockListDetailMapper.selectOne(Wrappers.<DisStockListDetailEntity>query().lambda()
// .eq(DisStockListDetailEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DisStockListDetailEntity::getStockListId, distributionRetentionScanVo.getInventoryId())
// .eq(DisStockListDetailEntity::getId, distributionRetentionScanVo.getOrderPackageId())
// );
// disStockListDetailEntity.setStockPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
// disStockListDetailMapper.updateById(disStockListDetailEntity);
// DistributionReservationStocklistEntity reservationStocklistEntity = distributionReservationStocklistMapper.selectOne(Wrappers.<DistributionReservationStocklistEntity>query().lambda()
// .eq(DistributionReservationStocklistEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DistributionReservationStocklistEntity::getStocklistId, distributionRetentionScanVo.getInventoryId())
// .ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationOrderStatusConstant.quxiao.getValue())
// );
// Integer reservationNum = reservationStocklistEntity.getReservationNum();
//
// }
// break;
// case 3:
// if (reservationEntity.getReservationNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationStockListNum() == 0){
// //该预约订单只存在该包件并且没有库存品
// this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class));
// }else {
// DistributionReservationZeroPackageEntity reservationZeroPackageEntity = distributionReservationZeroPackageMapper.selectOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
// .eq(DistributionReservationZeroPackageEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DistributionReservationZeroPackageEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
// .eq(DistributionReservationZeroPackageEntity::getParcelListId, distributionRetentionScanVo.getOrderPackageId())
// .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()));
// if (reservationZeroPackageEntity.getQuantity() == distributionRetentionScanVo.getRetentionQuantity()){
// reservationZeroPackageEntity.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
// }
// reservationZeroPackageEntity.setQuantity(reservationZeroPackageEntity.getQuantity() -distributionRetentionScanVo.getRetentionQuantity());
// distributionReservationZeroPackageMapper.updateById(reservationZeroPackageEntity);
// DistributionReservationStockarticleEntity reservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
// .eq(DistributionReservationStockarticleEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DistributionReservationStockarticleEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
// .eq(DistributionReservationStockarticleEntity::getIsZero, IsOrNoConstant.no.getValue())
// .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue()));
// Integer reservationNum = reservationStockarticleEntity.getReservationNum();
// Integer retentionQuantity = distributionRetentionScanVo.getRetentionQuantity();
// if ((reservationNum - retentionQuantity) == 0){
// reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
// }
// reservationStockarticleEntity.setReservationNum(reservationNum - retentionQuantity);
// distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity);
// reservationEntity.setReservationNum(reservationEntity.getReservationNum() - retentionQuantity);
// this.updateById(reservationEntity);
// }
// break;
//
// }
return false;
}
}

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

@ -2880,7 +2880,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
});
}
page.setTotal(addvaluePackageVOS.size());
return page.setRecords(addvaluePackageVOS);
}
}

6
blade-service/logpm-trunkline/pom.xml

@ -45,6 +45,12 @@
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>logpm-warehouse-api</artifactId>
<version>3.2.0.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>

61
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/BillladingApiController.java

@ -0,0 +1,61 @@
package com.logpm.trunkline.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.dto.BillladingDTO;
import com.logpm.trunkline.service.ITrunklineBillladingService;
import com.logpm.trunkline.vo.TrunklineBillladingVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/api/billlading")
@Api(value = "提货单控制类", tags = "提货单接口")
public class BillladingApiController {
private final IBasicdataWarehouseClient warehouseClient;
private final ITrunklineBillladingService billladingService;
@ResponseBody
@PostMapping("/list")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "提货单列表", notes = "传入billladingDTO")
public R pageList(@RequestBody BillladingDTO billladingDTO) {
String method = "############list: ";
log.info(method+"请求参数{}",billladingDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
billladingDTO.setWarehouseId(myCurrentWarehouse.getId());
IPage<TrunklineBillladingVO> pages = billladingService.pageInfoList(billladingDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
}

70
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/InComingApiController.java

@ -0,0 +1,70 @@
package com.logpm.trunkline.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.service.IInComingService;
import com.logpm.trunkline.vo.TrunklineBillladingVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.web.bind.annotation.*;
import java.util.Objects;
@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/api/incoming")
@Api(value = "入库控制类", tags = "入库接口")
public class InComingApiController {
private final IBasicdataWarehouseClient warehouseClient;
private final IInComingService inComingService;
@ResponseBody
@PostMapping("/incomingPackage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "包件入库扫描", notes = "传入inComingDTO")
public R incomingPackage(@RequestBody InComingDTO inComingDTO) {
String method = "############incomingPackage: ";
log.info(method+"请求参数{}",inComingDTO);
String orderPackageCode = inComingDTO.getOrderPackageCode();
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
inComingDTO.setWarehouseId(myCurrentWarehouse.getId());
if(StringUtil.isBlank(orderPackageCode)){
log.warn(method+"包件码不能为空");
return R.fail(405,"包件码不能为空");
}
return inComingService.incomingPackage(inComingDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
}

35
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/bean/Resp.java

@ -0,0 +1,35 @@
package com.logpm.trunkline.bean;
import lombok.Data;
import org.springblade.core.tool.api.R;
@Data
public class Resp extends R {
private String audio;
public static Resp scanSuccess(String msg,String audio){
Resp resp = new Resp();
resp.setCode(200);
resp.setMsg(msg);
resp.setAudio(audio);
return resp;
}
public static Resp scanFail(String msg,String audio){
Resp resp = new Resp();
resp.setCode(3001);
resp.setMsg(msg);
resp.setAudio(audio);
return resp;
}
public static Resp scanFail(int code,String msg,String audio){
Resp resp = new Resp();
resp.setCode(code);
resp.setMsg(msg);
resp.setAudio(audio);
return resp;
}
}

32
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/BillladingController.java

@ -7,6 +7,7 @@ import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.trunkline.dto.BillladingDTO;
import com.logpm.trunkline.service.ITrunklineBillladingService;
import com.logpm.trunkline.vo.TrunklineBillladingVO;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@ -34,6 +35,8 @@ public class BillladingController {
private final ITrunklineBillladingService trunklineBillladingService;
private final IWarehouseWaybillClient warehouseWaybillClient;
@ResponseBody
@PostMapping("/pageList")
@ApiOperationSupport(order = 1)
@ -159,34 +162,5 @@ public class BillladingController {
}
}
@ResponseBody
@PostMapping("/pageWaybillList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "分页查询运单", notes = "传入waybillDTO")
public R pageWaybillList(@RequestBody BillladingDTO billladingDTO) {
String method = "############findChargeTypeList: ";
log.info(method + "请求参数{}", billladingDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
billladingDTO.setWarehouseId(myCurrentWarehouse.getId());
IPage<TrunklineBillladingVO> pages = trunklineBillladingService.pageList(billladingDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
}

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

@ -3,7 +3,11 @@ package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanceDetailEntity> {
void updatePackageStatusById(@Param("packageStatus") String packageStatus, @Param("advanceDetailId") Long advanceDetailId);
}

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

@ -3,4 +3,11 @@
<mapper namespace="com.logpm.trunkline.mapper.TrunklineAdvanceDetailMapper">
<update id="updatePackageStatusById">
update logpm_trunkline_advance_detail
set package_status = #{packageStatus}
where id = #{advanceDetailId}
</update>
</mapper>

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

@ -3,7 +3,10 @@ package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface TrunklineAdvanceMapper extends BaseMapper<TrunklineAdvanceEntity> {
int getAllTotalNum(@Param("orderCode") String orderCode);
}

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

@ -2,5 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.trunkline.mapper.TrunklineAdvanceMapper">
<select id="getAllTotalNum" resultType="int">
select sum(total_num)
from logpm_trunkline_advance
where is_deleted = 0
and order_code = #{orderCode}
</select>
</mapper>

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

@ -13,4 +13,5 @@ public interface TrunklineBillladingMapper extends BaseMapper<TrunklineBillladin
IPage<TrunklineBillladingVO> pageList(IPage<Object> page, @Param("param") BillladingDTO billladingDTO);
IPage<TrunklineBillladingVO> pageInfoList(IPage<Object> page, @Param("param") BillladingDTO billladingDTO);
}

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

@ -8,27 +8,13 @@
ltb.car_number carNumber,
ltb.driver_name driverName,
ltb.driver_phone driverPhone,
ltb.line_name_title lineTameTitle,
ltb.warehouse_id warehouseId,
ltb.warehouse_name warehouseName,
ltb.line_id lineId,
ltb.line_name_title lineNameTitle,
lbd.node_nub nodeNub,
ltb.start_time startTime,
ltb.end_time endTime,
ltb.plan_num planNum,
ltb.billlading_status billladingStatus,
ltb.charge_type chargeType,
ltb.total_fee totalFee,
ltb.remark remark,
ltb.carrier_name carrierName,
ltb.create_user_name createUserName,
count(ltbw.id) waybillCount,
sum(ltbw.real_num) totalNum,
sum(ltbw.real_weight) totalWeight,
sum(ltbw.real_volume) totalVolume
ltb.carrier_name carrierName
from logpm_trunkline_billlading ltb
left join logpm_basic_deline lbd on lbd.id = ltb.line_id
left join logpm_trunkline_billlading_waybill ltbw on ltbw.billlading_id = ltb.id and ltbw.
where ltb.is_deleted = 0
<if test="param.billladingCode != null and param.billladingCode != '' ">
and ltb.billlading_code = #{param.billladingCode}
@ -54,25 +40,14 @@
<if test="param.createUserName != null and param.createUserName != '' ">
and ltb.create_user_name = #{param.createUserName}
</if>
group by ltb.id,ltb.billlading_code,
ltb.car_number,
ltb.driver_name,
ltb.driver_phone,
ltb.warehouse_id,
ltb.warehouse_name,
ltb.line_id,
ltb.line_name_title,
lbd.node_nub,
ltb.start_time,
ltb.end_time,
ltb.plan_num,
ltb.billlading_status,
ltb.charge_type,
ltb.total_fee,
ltb.remark,
ltb.carrier_name,
ltb.create_user_name
order by ltb.create_time desc
</select>
<select id="pageInfoList" resultType="com.logpm.trunkline.vo.TrunklineBillladingVO">
select
</select>
</mapper>

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IInComingService.java

@ -0,0 +1,10 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.dto.InComingDTO;
import org.springblade.core.tool.api.R;
public interface IInComingService {
R incomingPackage(InComingDTO inComingDTO);
}

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

@ -4,4 +4,7 @@ import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import org.springblade.core.mp.base.BaseService;
public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdvanceDetailEntity> {
void updatePackageStatusById(String packageStatus, Long advanceDetailId);
}

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

@ -1,7 +1,10 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import org.springblade.core.mp.base.BaseService;
public interface ITrunklineAdvanceService extends BaseService<TrunklineAdvanceEntity> {
void saveOrderAndPackage(TrunklineAdvanceDetailEntity advanceDetailEntity, Long warehouseId);
}

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

@ -11,4 +11,7 @@ public interface ITrunklineBillladingService extends BaseService<TrunklineBillla
IPage<TrunklineBillladingVO> pageList(BillladingDTO billladingDTO);
void saveNew(BillladingDTO billladingDTO,String warehouseCode);
IPage<TrunklineBillladingVO> pageInfoList(BillladingDTO billladingDTO);
}

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

@ -0,0 +1,61 @@
package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.service.IInComingService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import com.logpm.trunkline.service.ITrunklineBillladingPackageServicie;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Slf4j
@Service
@AllArgsConstructor
public class InComingServiceImpl implements IInComingService {
private final ITrunklineBillladingPackageServicie billladingPackageServicie;
private final ITrunklineAdvanceDetailService advanceDetailService;
private final ITrunklineAdvanceService advanceService;
@Override
public R incomingPackage(InComingDTO inComingDTO) {
String orderPackageCode = inComingDTO.getOrderPackageCode();//包件码
Long warehouseId = inComingDTO.getWarehouseId();//仓库id
Long billladingId = inComingDTO.getBillladingId();//提货单id
log.info("############incomingPackage: 包件入库开始 orderPackageCode={} billladingId={} warehouseId={}",orderPackageCode,billladingId,warehouseId);
//包件入库开始
//查询包件是否有数据
QueryWrapper<TrunklineAdvanceDetailEntity> advanceDetailQueryWrapper = new QueryWrapper<>();
advanceDetailQueryWrapper.eq("order_package_code",orderPackageCode)
.eq("warehouse_id",warehouseId);
TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailService.getOne(advanceDetailQueryWrapper);
if(Objects.isNull(advanceDetailEntity)){
log.warn("############incomingPackage: 包件不存在 orderPackageCode={} warehouseId={}",orderPackageCode,warehouseId);
return Resp.scanFail(405,"包件无数据","包件无数据");
}
Long advanceDetailId = advanceDetailEntity.getId();
String packageStatus = advanceDetailEntity.getPackageStatus();
if("1".equals(packageStatus)){
log.warn("############incomingPackage: 包件已入库 orderPackageCode={} warehouseId={}",orderPackageCode,warehouseId);
return Resp.scanFail(405,"包件已入库","包件已入库");
}
//1.修改暂存单包件入库状态
advanceDetailService.updatePackageStatusById("1",advanceDetailId);
//2.判断包件和订单是否已经存入在库订单
advanceService.saveOrderAndPackage(advanceDetailEntity,warehouseId);
return null;
}
}

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

@ -12,4 +12,8 @@ import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<TrunklineAdvanceDetailMapper, TrunklineAdvanceDetailEntity> implements ITrunklineAdvanceDetailService {
@Override
public void updatePackageStatusById(String packageStatus, Long advanceDetailId) {
baseMapper.updatePackageStatusById(packageStatus,advanceDetailId);
}
}

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

@ -1,15 +1,77 @@
package com.logpm.trunkline.service.impl;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity;
import com.logpm.trunkline.mapper.TrunklineAdvanceMapper;
import com.logpm.trunkline.service.ITrunklineAdvanceService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Slf4j
@Service
@AllArgsConstructor
public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanceMapper, TrunklineAdvanceEntity> implements ITrunklineAdvanceService {
private final IDistributionStockArticleClient stockArticleClient;
private final IDistributionParcelListClient parcelListClient;
private final ITrunklineAdvanceService advanceService;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
@Override
public void saveOrderAndPackage(TrunklineAdvanceDetailEntity advanceDetailEntity, Long warehouseId) {
String orderPackageCode = advanceDetailEntity.getOrderPackageCode();
String orderCode = advanceDetailEntity.getOrderCode();
Long advanceId = advanceDetailEntity.getAdvanceId();
log.info("############saveOrderAndPackage: 保存订单和包件信息 orderPackageCode={}",orderPackageCode);
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(Objects.isNull(warehouseEntity)){
log.warn("############saveOrderAndPackage: 仓库信息不存在warehouseId={}",warehouseId);
throw new CustomerException(405,"仓库信息不存在");
}
//1.判断包件是否已经存在
DistributionParcelListEntity parcelListEntity = parcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
if(!Objects.isNull(parcelListEntity)){
log.warn("############saveOrderAndPackage: 包件信息已存在 orderPackageCode={} warehouseId={}",orderPackageCode,warehouseId);
throw new CustomerException(405,"包件信息已存在");
}
//2.查询订单信息
int total = baseMapper.getAllTotalNum(orderCode);
DistributionStockArticleEntity stockArticleEntity = stockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(Objects.isNull(stockArticleEntity)){
log.info("#############saveOrderAndPackage: 订单信息为空,同步订单信息");
//订单信息为空
TrunklineAdvanceEntity advanceEntity = advanceService.getById(advanceId);
stockArticleEntity = new DistributionStockArticleEntity();
stockArticleEntity.setOrderCode(orderCode);
stockArticleEntity.setServiceNumber(advanceEntity.getServiceNum());
stockArticleEntity.setWaybillNumber(advanceEntity.getWaybillNo());
stockArticleEntity.setTotalNumber(total);
stockArticleEntity.setHandQuantity(0);
stockArticleEntity.setTenantId(TenantNum.HUITONGCODE);// 对应租户ID
stockArticleEntity.setWarehouse(warehouseEntity.getName());
stockArticleEntity.setWarehouseId(warehouseId);
stockArticleEntity.setBrand(advanceEntity.getBrand());
}
}
}

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

@ -103,4 +103,18 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
billladingWaybillService.save(billladingWaybillEntity);
}
}
@Override
public IPage<TrunklineBillladingVO> pageInfoList(BillladingDTO billladingDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(billladingDTO.getPageNum());
page.setSize(billladingDTO.getPageSize());
billladingDTO.setBillladingStatus("2");
IPage<TrunklineBillladingVO> pageList = baseMapper.pageInfoList(page,billladingDTO);
return pageList;
}
}

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java

@ -85,6 +85,16 @@ public class WarehouseRetentionApiController {
}
@PostMapping("/updateRetentionList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "保存滞留扫描列表", notes = "传入trayTypeDTO")
public R updateRetentionList(@RequestBody WarehouseRetentionRecordDTO warehouseRetentionScanDTOS) {
// R r = warehouseRetentionScanService.saveRetentionList(warehouseRetentionScanDTOS);
R r = warehouseRetentionRecordService.updateRetentionList(warehouseRetentionScanDTOS);
return r;
}
// @GetMapping("/initRetentionList")
// @ApiOperationSupport(order = 1)

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

@ -113,7 +113,7 @@ public class WarehouseTaskApiController {
return R.fail(403,"仓库信息为空");
}
taskSearchDTO.setWarehouseId(myCurrentWarehouse.getId());
R r= taskQuestService.queryContract(Condition.getPage(query), taskSearchDTO);
R r= taskQuestService.queryContractGai(Condition.getPage(query), taskSearchDTO);
return r;
}

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

@ -16,7 +16,6 @@
*/
package com.logpm.warehouse.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
@ -25,9 +24,8 @@ import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.warehouse.dto.ProductDTO;
import com.logpm.warehouse.dto.SplitOrderDTO;
import com.logpm.warehouse.entity.WarehouseWarehousingDetailEntity;
import com.logpm.warehouse.dto.WarehouseWaybillDTO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.excel.WarehouseWarehousingDetailExcel;
import com.logpm.warehouse.excel.WarehouseWaybillExcel;
import com.logpm.warehouse.service.IWarehouseWaybillService;
import com.logpm.warehouse.vo.WarehouseWaybillVO;
@ -44,7 +42,6 @@ import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.feign.IDictBizClient;
@ -56,7 +53,6 @@ import javax.validation.Valid;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 运单表 控制器
@ -75,7 +71,7 @@ public class WarehouseWaybillController extends BladeController {
private final IDistributionStockArticleClient distributionStockArticleClient;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IBasicdataWarehouseClient warehouseClient;
private final IDictBizClient dictBizClient;
@ -251,4 +247,35 @@ public class WarehouseWaybillController extends BladeController {
ExcelUtil.export(response, "在库运单" + DateUtil.time(), "在库运单数据表", list, WarehouseWaybillExcel.class);
}
@ResponseBody
@PostMapping("/pageWaybillList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "分页查询运单", notes = "传入waybillDTO")
public R pageWaybillList(@RequestBody WarehouseWaybillDTO waybillDTO) {
String method = "############pageWaybillList: ";
log.info(method + "请求参数{}", waybillDTO);
try{
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
waybillDTO.setWarehouseId(myCurrentWarehouse.getId());
IPage<WarehouseWaybillVO> pages = warehouseWaybillService.pageList(waybillDTO);
return R.data(pages);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
}

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/WarehouseWaybillDTO.java

@ -37,4 +37,11 @@ public class WarehouseWaybillDTO extends WarehouseWaybillEntity {
private List<Long> destinationWarehouseIds;
private Integer pageNum;
private Integer pageSize;
private Long warehouseId;
private List<String> waybillNoList;
}

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml

@ -146,6 +146,7 @@
<if test="param.allocationId != null and param.allocationId != ''">and allocation_id =#{param.allocationId } </if>
<if test="param.trayId != null and param.trayId != ''">and tray_id =#{param.trayId } </if>
<if test="param.orderCode != null and param.orderCode != ''">and order_code =#{param.orderCode } </if>
<if test="param.ordePackageCode != null and param.ordePackageCode != ''">and orde_package_code =#{param.ordePackageCode } </if>
</where>
</select>
<select id="selectOneTaskInfo" resultType="com.logpm.warehouse.entity.QuestDetailEntity">
@ -221,7 +222,7 @@
</update>
<update id="updetaQuestDetailChildList">
<foreach collection="list" item="item" index="index">
<foreach collection="list" item="item" index="index" separator=";">
update ${questNum}
<set>
<if test="item.cargoName != null and item.cargoName != ''" > cargo_name = #{item.cargoName }, </if>

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

@ -48,4 +48,6 @@ public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybillEntit
List<WarehouseWaybillVO> exportWarehouseWarehousingDetail(@Param("ew") QueryWrapper<WarehouseWaybillEntity> queryWrapper);
IPage<WarehouseWaybillEntity> pageInfo(IPage<Object> page,@Param("param") WarehouseWaybillDTO warehouseWaybillDTO);
IPage<WarehouseWaybillVO> pageList(IPage<Object> page, @Param("param") WarehouseWaybillDTO waybillDTO);
}

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

@ -141,4 +141,16 @@
</update>
<select id="pageList" resultType="com.logpm.warehouse.vo.WarehouseWaybillVO">
select *
from logpm_warehouse_waybill
where is_deleted = 0
<if test="param.waybillNoList != null">
and waybill_no not in
<foreach collection="param.waybillNoList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java

@ -85,6 +85,16 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
*/
R queryContract(IPage<Object> page,TaskSearchDTO taskSearchDTO);
/**
* 合同号扫描改
*
* @param page
* @param taskSearchDTO
* @return
*/
R queryContractGai(IPage<Object> page,TaskSearchDTO taskSearchDTO);
/**
* 盘点定制平数据
*

8
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java

@ -73,4 +73,12 @@ public interface IWarehouseRetentionRecordService extends BaseService<WarehouseR
R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionScanDTOS);
List<WarehouseRetentionRecordExcel> exportWarehouseRetentionRecord(Map<String, Object> paramMap);
/**
* 增加滞留包件
* @param warehouseRetentionScanDTOS
* @return
*/
R updateRetentionList(WarehouseRetentionRecordDTO warehouseRetentionScanDTOS);
}

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

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.warehouse.dto.SplitOrderDTO;
import com.logpm.warehouse.dto.WarehouseWaybillDTO;
import com.logpm.warehouse.dto.WaybillDTO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.excel.WarehouseWaybillExcel;
@ -46,4 +47,7 @@ public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEn
List<WarehouseWaybillExcel> exportWarehouseWarehousingDetail(Map<String, Object> warehouseWaybillEntity);
IPage<WarehouseWaybillEntity> pageInfo(IPage<Object> page, Map<String, Object> warehouseWaybill);
IPage<WarehouseWaybillVO> pageList(WarehouseWaybillDTO waybillDTO);
}

147
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -17,6 +17,7 @@
package com.logpm.warehouse.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.Query;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@ -46,6 +47,7 @@ import com.logpm.warehouse.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.log.exception.ServiceException;
@ -205,6 +207,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntityList.add(detailEntity);
});
log.debug("包件数据=={}",detailEntityList.size());
//查询零担数据
DistributionStockArticleEntity stockArticle = new DistributionStockArticleEntity();
stockArticle.setWarehouseId(stockArticleEntity.getWarehouseId());
@ -214,7 +217,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
if(!stockArticleInfo.isEmpty()){
detailEntityList.addAll(handleIsZeroList(stockArticleInfo,taskQuest));
}
log.debug("零担 和 包件数据=={}",detailEntityList.size());
//查询库存平数据
DistributionStockListEntity stockListEntity = new DistributionStockListEntity();
stockListEntity.setWarehouseId(stockArticleEntity.getWarehouseId());
@ -252,18 +255,39 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// detailEntityList.add(detailListEntity);
// });
}
log.debug("全部包件数据=={}",detailEntityList.size());
if(!detailEntityList.isEmpty()){
int batchSize = 1000; // 设置批处理的大小
int totalSize = detailEntityList.size(); // 获取总数据量
int batchSize = 1000; // 设置批处理的大小
int xh = (int) Math.ceil((double) totalSize / batchSize);
for (int i = 0; i < totalSize; i += batchSize) {
int endIndex = Math.min(i + batchSize, totalSize);
List<QuestDetailEntity> subList = detailEntityList.subList(i, endIndex);
for (int i = 0; i < xh; i++) {
int startIndex = i * batchSize;
int endIndex = Math.min(startIndex + batchSize, totalSize);
List<QuestDetailEntity> subList = detailEntityList.subList(startIndex, endIndex);
baseMapper.insertQuestDetail(questNum, subList);
}
// int totalSize = detailEntityList.size(); // 获取总数据量
// int batchSize = 1000; // 设置批处理的大小
// int xh = (int) Math.ceil( totalSize / batchSize);
// for (int i = 0; i < xh; i ++) {
// List<QuestDetailEntity> subList = new ArrayList<>();
// if(i == 0){
// subList = detailEntityList.subList(i, batchSize);
// baseMapper.insertQuestDetail(questNum, subList);
//
// }else{
// subList = detailEntityList.subList(batchSize, batchSize+1000);
// baseMapper.insertQuestDetail(questNum, subList);
// batchSize = batchSize+1000;
// }
// }
// int q = totalSize - (xh * batchSize);
// if(q > 0){
// baseMapper.insertQuestDetail(questNum,detailEntityList.subList(xh * batchSize, q));
// }
log.info("数量七千万===》》》"+xh);
}
}
@ -844,7 +868,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetailChildEntity.setWarehouseId(warehouseId);
List<QuestDetailChildEntity> list = getQuestDetailInfo(taskQuestEntity.getQuestNum()+"_child",questDetailChildEntity);
if(!list.isEmpty()){
int sum = list.stream().mapToInt(QuestDetailChildEntity::getQuestNum).sum();
int sum = list.stream().filter(i ->i.getCargoName().equals("10")).mapToInt(QuestDetailChildEntity::getQuestNum).sum();
unTotal.set(unTotal.get() + sum);
}else{
throw new ServiceException("未找到对应的处理数据!!");
@ -910,7 +934,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setWarehouseId(warehouseId);
questDetail.setQuestId(taskSearchDTO.getTaskId());
questDetail.setQuestType(4);
// questDetail.setQuestType(4);
if(ObjectUtils.isNotNull(trayId)){
questDetail.setTrayId(String.valueOf(trayId));
}
@ -1355,14 +1379,15 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
childList.add(addQuestDetailChild(noRepairNum,"40",questDetaiId,warehouseId,taskQuestEntity.getQuestNum()));
childList.add(addQuestDetailChild(deliveNum,"50",questDetaiId,warehouseId,taskQuestEntity.getQuestNum()));
childList.add(addQuestDetailChild(noReceivedNum,"60",questDetaiId,warehouseId,taskQuestEntity.getQuestNum()));
if(!childList.isEmpty()){
if(!childList.isEmpty()){
boolean b = childList.stream().anyMatch(i -> ObjectUtils.isNull(i.getId()));
if(b){
//添加
baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum()+"_child",childList);
}else{
//修改
baseMapper.updetaQuestDetailChildList(taskQuestEntity.getQuestNum()+"_child",childList);
List<QuestDetailChildEntity> collect = childList.stream().filter(i -> ObjectUtils.isNotNull(i.getQuestNum()) && i.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(taskQuestEntity.getQuestNum()+"_child",collect);
}
}
// questDetailChildService.saveOrUpdateBatch(childList);
@ -1640,12 +1665,12 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
QuestDetailEntity detailEntity = new QuestDetailEntity();
detailEntity.setQuestId(taskSearchDTO.getTaskId());
detailEntity.setWarehouseId(taskSearchDTO.getWarehouseId());
detailEntity.setQuestType(3);
// LambdaQueryWrapper<QuestDetailEntity> queryWrapper = Wrappers.<QuestDetailEntity>query().lambda()
// .eq(QuestDetailEntity::getQuestId, taskSearchDTO.getTaskId())
// .eq(QuestDetailEntity::getWarehouseId, taskSearchDTO.getWarehouseId())
// .eq(QuestDetailEntity::getQuestType, 3);
//是否库存品 0 否 1是
if (Func.equals(isInventory,1)){
detailEntity.setIncomingBatch(taskSearchDTO.getOrderCode());
}else {
@ -1654,14 +1679,14 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
IPage<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(page,taskSearchDTO.getQuestNum(),detailEntity);
List<Integer> type = questDetailEntities.getRecords().stream().filter(f -> Func.isNotEmpty(f.getQuestTarget())).map(QuestDetailEntity::getQuestTarget).distinct().collect(Collectors.toList());
if (Func.isEmpty(type)){
return null;
return Resp.scanFail("无数据信息!","无数据信息!");
}
if (type.size() != 1){
log.error("###################orderId查询类型异常:{}",taskSearchDTO.getOrderId());
return null;
}
TaskContractVO contractVO = new TaskContractVO();
AtomicInteger total = new AtomicInteger();
AtomicInteger total = new AtomicInteger(); //总数
AtomicInteger operationNum = new AtomicInteger();
ArrayList<TaskPackagelistVO> taskPackagelistVOS = new ArrayList<>();
List<String> orderCode = questDetailEntities.getRecords().stream().map(QuestDetailEntity::getOrderCode).distinct().collect(Collectors.toList());
@ -1903,17 +1928,22 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetailChildEntity = new QuestDetailChildEntity();
questDetailChildEntity.setTenantId(user.getTenantId());
questDetailChildEntity.setCreateUser(user.getUserId());
// questDetailChildEntity.setCreateDept(user.getDeptId());
questDetailChildEntity.setCreateDept(Long.valueOf(user.getDeptId()));
questDetailChildEntity.setCreateTime(new Date());
questDetailChildEntity.setIsDeleted(0);
questDetailChildEntity.setStatus(1);
questDetailChildEntity.setQuestDetailId(questDetaiId);
questDetailChildEntity.setCargoName(cargoName);
questDetailChildEntity.setQuestNum(num);
questDetailChildEntity.setWarehouseId(warehouseId);
return questDetailChildEntity;
}else{
questDetailChildEntity.setQuestNum(num);
QuestDetailChildEntity detailChildEntity = new QuestDetailChildEntity();
detailChildEntity.setQuestNum(num);
detailChildEntity.setId(questDetailChildEntity.getId());
return detailChildEntity;
}
return questDetailChildEntity;
}
@ -2229,6 +2259,87 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
return R.data(taskContractVOS);
}
/**
* 合同扫描
* @param page
* @param taskSearchDTO
* @return
*/
@Override
@Transactional
public R queryContractGai(IPage<Object> page, TaskSearchDTO taskSearchDTO) {
// String goodsType = taskSearchDTO.getGoodsType();
Integer type = taskSearchDTO.getType();
String questNum = taskSearchDTO.getQuestNum();
Long taskQuestId = taskSearchDTO.getTaskId();
if (Func.isEmpty(type)){
log.error("####################前端参数type传递有误:{}",type);
return Resp.scanFail("操作失败", "服务器正忙...");
}
if (Func.isEmpty(questNum)){
log.error("####################前端参数questNum传递有误:{}",questNum);
return Resp.scanFail("操作失败", "服务器正忙...");
}
String incomingBatch = taskSearchDTO.getIncomingBatch(); //输入的码
String code = taskSearchDTO.getCode(); //扫描的码
QuestDetailEntity questDetail = new QuestDetailEntity();
if(type == 1){
if(ObjectUtils.isNull(code)){
log.error("####################订单合同号为空");
return Resp.scanFail("操作失败", "请填写正确合同号");
}
questDetail.setOrdePackageCode(code);
}else{
if(ObjectUtils.isNull(incomingBatch)){
log.error("####################订单合同号为空");
return Resp.scanFail("操作失败", "请输入正确合同号");
}
questDetail.setOrderCode(incomingBatch);
}
//检验是否完结
verifyTask(taskQuestId, taskSearchDTO.getWarehouseId());
TaskQuestEntity taskQuestEntity = baseMapper.selectById(taskQuestId);
taskSearchDTO.setQuestNum(taskQuestEntity.getQuestNum());
List<TaskContractVO> taskContractVOS = new ArrayList<>();
//查询盘点数据
questDetail.setQuestId(taskQuestId);
questDetail.setWarehouseId(taskSearchDTO.getWarehouseId());
IPage<QuestDetailEntity> questDetailEntityList;
questDetailEntityList = baseMapper.selectTaskInfo(page,taskSearchDTO.getQuestNum(),questDetail);
if(ObjectUtils.isNull(questDetailEntityList.getRecords())){
if(type == 2){
questDetail.setOrderCode(null);
questDetail.setOrdePackageCode(incomingBatch);
questDetailEntityList = baseMapper.selectTaskInfo(page,taskSearchDTO.getQuestNum(),questDetail);
if(ObjectUtils.isNull(questDetailEntityList.getRecords())){
return Resp.scanSuccess("无盘点数据!","无盘点数据!");
}
}else{
return Resp.scanSuccess("无盘点数据!","无盘点数据!");
}
}
questDetailEntityList.getRecords().stream().collect(Collectors.groupingBy(QuestDetailEntity::getOrderId))
.forEach((k,v)->{
TaskContractVO taskContractVO = new TaskContractVO();
taskContractVO.setOrderId(k);
taskContractVO.setOrderCode(v.get(0).getOrderCode());
DistributionStockArticleEntity entityByStockArticle = distributionStockArticleClient.findEntityByStockArticleId(k);
taskContractVO.setTotal(entityByStockArticle.getTotalNumber());
taskContractVO.setZktotal(entityByStockArticle.getHandQuantity());
int size = v.stream().map(i -> i.getQuestStatus().equals("1")).collect(Collectors.toList()).size();
taskContractVO.setUnTotal(size);
boolean b = v.stream().anyMatch(ii -> ii.getQuestTarget().equals(1));
taskContractVO.setIsZero(b ? 0 : 1);
taskContractVO.setIsInventory(b ? 0 : 1);
taskContractVOS.add(taskContractVO);
});
return R.data(taskContractVOS);
}
private String getQuestNum(String warehouseCode) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");

64
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

@ -43,6 +43,7 @@ import com.logpm.warehouse.mapper.WarehouseRetentionRecordMapper;
import com.logpm.warehouse.service.IWarehouseRetentionRecordService;
import com.logpm.warehouse.service.IWarehouseRetentionScanService;
import com.logpm.warehouse.vo.WarehouseRetentionRecordVO;
import com.logpm.warehouse.vo.WarehouseRetentionScanVO;
import com.logpm.warehouse.vo.WarehouseWaybillDetentionVO;
import com.logpm.warehouse.wrapper.WarehouseRetentionRecordWrapper;
import com.logpm.warehouse.wrapper.WarehouseRetentionScanWrapper;
@ -62,6 +63,7 @@ import org.springframework.stereotype.Service;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -176,20 +178,26 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
warehouseRetentionRecordEntity.setRetentionCarId(warehouseRetentionRecordDTO.getLoadingId());
warehouseRetentionRecordEntity.setRetentionWarehouseId(myCurrentWarehouse.getId());
warehouseRetentionRecordEntity.setRetentionWarehouseName(myCurrentWarehouse.getName());
warehouseRetentionRecordEntity.setRetentionWarehouseName(myCurrentWarehouse.getName());
warehouseRetentionRecordEntity.setRetentionType(RetentionTypeConstant.peisongzhiliu.getValue());
warehouseRetentionRecordEntity.setRetentionCreateUserId(user.getUserId());
warehouseRetentionRecordEntity.setRetentionCreateUserName(user.getUserName());
this.save(warehouseRetentionRecordEntity);
AtomicInteger retentionTotal = new AtomicInteger();
warehouseRetentionScanDTOS.forEach(r->{
r.setRetentionScanTime(new Date());
r.setRetentionScanUserId(user.getUserId());
r.setRetentionScanUsername(user.getUserName());
r.setRetentionQuantity(r.getRetentionQuantity());
retentionTotal.getAndAdd(r.getRetentionQuantity());
r.setDeliveryId(warehouseRetentionRecordDTO.getDeliveryId());
r.setRefId(warehouseRetentionRecordEntity.getId());
warehouseRetentionScanService.save(Func.copy(r,WarehouseRetentionScanEntity.class));
//进行滞留操作的包件需要和原来订单 预约进行绑定解除
//TODO 需要一个取消配送包件的方法
// reservationClient.retentionCancelReservationPack();
});
warehouseRetentionRecordEntity.setRetentionQuantity(retentionTotal.get());
this.updateById(warehouseRetentionRecordEntity);
return Resp.scanSuccess("操作成功","操作成功");
}
@ -218,4 +226,58 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
return list;
}
@Override
public R updateRetentionList(WarehouseRetentionRecordDTO warehouseRetentionScanDTOS) {
// 获取当前登录的仓库信息
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull(myCurrentWarehouse)){
return R.fail(403,"无仓库信息");
}
List<WarehouseRetentionScanDTO> warehouseRetentionScanDTOList = warehouseRetentionScanDTOS.getWarehouseRetentionScanDTOS();
if (Func.isEmpty(warehouseRetentionScanDTOList)){
log.error("##########缺少滞留包件列表:{}",warehouseRetentionScanDTOList);
return Resp.scanFail("无滞留包件信息","无滞留包件信息");
}
//如果滞留全部为空,这里执行删除操作
//查询出该滞留任务是否存在
List<WarehouseRetentionScanEntity> retentionScanEntityList = warehouseRetentionScanService.list(Wrappers.<WarehouseRetentionScanEntity>query().lambda()
.eq(WarehouseRetentionScanEntity::getDeliveryId, warehouseRetentionScanDTOS.getDeliveryId())
.eq(WarehouseRetentionScanEntity::getRefId, warehouseRetentionScanDTOS.getId()));
WarehouseRetentionRecordEntity retentionRecordEntity = this.getById(warehouseRetentionScanDTOS.getId());
if(Func.isNotEmpty(retentionScanEntityList)){
BladeUser user = AuthUtil.getUser();
Map<Long, WarehouseRetentionScanEntity> retentionPackageMap = retentionScanEntityList.stream().collect(Collectors.toMap(WarehouseRetentionScanEntity::getOrderPackageId, Function.identity(), (k1, k2) -> k2));
warehouseRetentionScanDTOList.forEach(rs->{
if (Func.isNotEmpty(retentionPackageMap.get(rs.getOrderPackageId()))){
//查看是否是零担,如果是零担需要查看是否发生数量修改
WarehouseRetentionScanEntity warehouseRetentionScanEntity = retentionPackageMap.get(rs.getOrderPackageId());
if (retentionPackageMap.get(rs.getOrderPackageId()).getConditions()==3){
//零担查看是否发生数据修改
if (warehouseRetentionScanEntity.getRetentionQuantity() != rs.getRetentionQuantity() && rs.getRetentionQuantity()>0){
warehouseRetentionScanEntity.setRetentionQuantity(rs.getRetentionQuantity());
warehouseRetentionScanService.updateById(warehouseRetentionScanEntity);
}
}
}else {
//在原列表中查询不到,这里视为新增滞留包件
rs.setRetentionScanTime(new Date());
rs.setRetentionScanUserId(user.getUserId());
rs.setRetentionScanUsername(user.getUserName());
// rs.setRetentionQuantity(r.getRetentionQuantity());
// retentionTotal.getAndAdd(r.getRetentionQuantity());
rs.setDeliveryId(warehouseRetentionScanDTOS.getDeliveryId());
rs.setRefId(retentionRecordEntity.getId());
warehouseRetentionScanService.save(Func.copy(rs,WarehouseRetentionScanEntity.class));
}
});
}
//统计该滞留任务的包件数量
int retentionTotal = warehouseRetentionScanService.list(Wrappers.<WarehouseRetentionScanEntity>query().lambda()
.eq(WarehouseRetentionScanEntity::getDeliveryId, warehouseRetentionScanDTOS.getDeliveryId())
.eq(WarehouseRetentionScanEntity::getRefId, warehouseRetentionScanDTOS.getId())).stream().mapToInt(WarehouseRetentionScanEntity::getRetentionQuantity).sum();
retentionRecordEntity.setRetentionQuantity(retentionTotal);
this.updateById(retentionRecordEntity);
return Resp.scanSuccess("操作成功","操作成功");
}
}

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

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
@ -39,7 +40,6 @@ import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.order.*;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.constant.BladeConstant;
@ -682,4 +682,14 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
}
return baseMapper.pageInfo(page,warehouseWaybillDTO);
}
@Override
public IPage<WarehouseWaybillVO> pageList(WarehouseWaybillDTO waybillDTO) {
IPage<Object> page = new Page<>();
page.setCurrent(waybillDTO.getPageNum());
page.setSize(waybillDTO.getPageSize());
IPage<WarehouseWaybillVO> pageList = baseMapper.pageList(page,waybillDTO);
return pageList;
}
}

Loading…
Cancel
Save