Browse Source

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

dist.1.3.0
zhaoqiaobo 9 months ago
parent
commit
08d082a1f5
  1. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java
  2. 2
      blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java
  3. 98
      blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java
  4. 28
      blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java
  5. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataDriverArteryClient.java
  6. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java
  7. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java
  8. 1
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  9. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSignforVO.java
  10. 18
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppPackageDetailVO.java
  11. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java
  12. 5
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClientFallbackFactory.java
  13. 1
      blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/dto/SyncInventoryDTO.java
  14. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java
  15. 1
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java
  16. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TripartiteTransferVO.java
  17. 1
      blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicMaterialMapper.xml
  18. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java
  19. 2
      blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessAsyncService.java
  20. 4
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java
  21. 70
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java
  22. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java
  23. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  24. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  25. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java
  26. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  27. 45
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  28. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  29. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  30. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  31. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListInfoMapper.java
  32. 30
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListInfoMapper.xml
  33. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java
  34. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  35. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  36. 1275
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/WarehouseTrayAllocationListener.java
  37. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  38. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  39. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  40. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListInfoService.java
  41. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  42. 133
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java
  43. 314
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  44. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  45. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  46. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  47. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListInfoServiceImpl.java
  48. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  49. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java
  50. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java
  51. 7
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml
  52. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java
  53. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java
  54. 29
      blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncOrderInfoController.java
  55. 272
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java
  56. 16
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/IndexDTO.java
  57. 42
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java
  58. 204
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml
  59. 21
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java
  60. 239
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java
  61. 16
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexAllocationDataVO.java
  62. 18
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexHandOrderDataVO.java
  63. 15
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexOpenOrderDataVO.java
  64. 26
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexOpenOrderIncomeVO.java
  65. 16
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexTrunklineCarsDataVO.java
  66. 16
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexTrunklineHandOrderDataVO.java
  67. 21
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexUnloadAbnormalDataVO.java
  68. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  69. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  70. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  71. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java
  72. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml
  73. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  74. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsOrderService.java
  75. 47
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLogServiceImpl.java
  76. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  77. 29
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  78. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java
  79. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java
  80. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ISendFanoutService.java
  81. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java
  82. 27
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/SendFanoutServiceImpl.java
  83. 811
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  84. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java
  85. 715
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java
  86. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

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

@ -28,7 +28,7 @@ public class RedisKeyConstant {
/**
* 异常件数
*/
public static final String BUSINESS_INEXCE_CARNUMBER ="business:in:carnumber:";
public static final String BUSINESS_INEXCE_CARNUMBER ="business:inexce:carnumber:";
}

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

@ -62,7 +62,7 @@ public enum WorkNodeEnums implements Serializable {
CANCEL_DELIVERY(301030, "计划取消"),
PLAN_BILLOFLADING(301040, "计划自提"),
CANCEL_BILLOFLADING(301050, "取消自提"),
SIGN_BILLOFLADING(301050, "取消自提"),
SIGN_BILLOFLADING(301050, "自提签收"),
PLAN_DISTRIBUTION(301060, "计划配车"),
CANCEL_DISTRIBUTION(301070, "取消配车"),

98
blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java

@ -55,4 +55,102 @@ public abstract class FanoutConstants {
}
//仓库
public interface warehouse {
//打托
interface TRAYTYPE{
//交换机
String EXCHANGE = "fanout.warehouse.traytype" + ModuleNameConstant.DEVAUTH;
interface QUEUE {
String TRAYTYPE_MESSAGE = "fanout.warehouse.traytype.distribution.traytypemessage" + ModuleNameConstant.DEVAUTH;
}
}
// //解托
// interface UNBINDTRAY{
//
// //交换机
// String EXCHANGE = "fanout.warehouse.unbindtray" + ModuleNameConstant.DEVAUTH;
//
// interface QUEUE {
//
// String UNBINDTRAY_INFO = "fanout.warehouse.unbindtray.distribution.unbindtrayINFO" + ModuleNameConstant.DEVAUTH;
//
// }
//
// }
//
//
// //移托
// interface MOVETRAY{
//
// //交换机
// String EXCHANGE = "fanout.warehouse.movetray" + ModuleNameConstant.DEVAUTH;
//
// interface QUEUE {
//
// String MOVETRAY_INFO = "fanout.warehouse.movetray.distribution.movetrayInfo" + ModuleNameConstant.DEVAUTH;
//
// }
//
// }
//上架
interface ALLOCATION{
//交换机
String EXCHANGE = "fanout.warehouse.upshelf" + ModuleNameConstant.DEVAUTH;
interface QUEUE {
String ALLOCATION_MESSAGE = "fanout.warehouse.upshelf.distribution.allocationmessage" + ModuleNameConstant.DEVAUTH;
}
}
// //下架
// interface DOWNSHELF{
//
// //交换机
// String EXCHANGE = "fanout.warehouse.downshelf" + ModuleNameConstant.DEVAUTH;
//
// interface QUEUE {
//
// String DOWNSHELF_INFO = "fanout.warehouse.downshelf.distribution.downshelfInfo" + ModuleNameConstant.DEVAUTH;
//
// }
//
// }
//
//
// //移库
// interface MOVEALLOCATION{
//
// //交换机
// String EXCHANGE = "fanout.warehouse.moveallocation" + ModuleNameConstant.DEVAUTH;
//
// interface QUEUE {
//
// String MOVEALLOCATION_INFO = "fanout.warehouse.moveallocation.distribution.moveallocationInfo" + ModuleNameConstant.DEVAUTH;
//
// }
//
// }
}
}

28
blade-biz-common/src/main/java/org/springblade/common/utils/CommonUtil.java

@ -172,6 +172,17 @@ public class CommonUtil {
return null;
}
public static Date getDayStart(){
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
// 将时分秒,毫秒域清零
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
return calendar.getTime();
}
public static Date getDayEnd(){
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
@ -183,6 +194,23 @@ public class CommonUtil {
return calendar.getTime();
}
public static Date getMonthDayStart(){
//获取一个Calendar对象
Calendar cal = Calendar.getInstance();
//获取当前时间
cal.setTime(new Date());
//获取当前月
cal.add(Calendar.MONTH, 0);
//获取当前月的最后一天
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
//得到当前月的最后一天
Date preMonth=cal.getTime();
return preMonth;
}
public static Date getMonthDayEnd(){
//获取一个Calendar对象
Calendar cal = Calendar.getInstance();

3
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataDriverArteryClient.java

@ -60,4 +60,7 @@ public interface IBasicdataDriverArteryClient {
@GetMapping(API_PREFIX+"/findDriverListByName")
List<JSONObject> findDriverListByName(@RequestParam String driverName);
@GetMapping(API_PREFIX+"/getDriverArteryById")
BasicdataDriverArteryEntity getDriverArteryById(Long id);
}

1
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java

@ -348,6 +348,7 @@ public class DistributionLoadscanEntity extends TenantEntity {
@ApiModelProperty(value = "是否异常装车 1-否 2-是")
private Integer isAbnormalLoading;
/**
* 是否异常装车 1- 2-
*/

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java

@ -132,7 +132,7 @@ public interface IDistributionDeliveryListClient {
void pushNotification(@RequestParam("warehouseIds")String warehouseIds,@RequestParam("reservationCode")String reservationCode);
@GetMapping(TOP+"/mallClientSignfor")
void mallClientSignfor(@RequestParam("trainNumber")String trainNumber,@RequestParam("warehouseId")Long warehouseId,@RequestParam("orderPackageCode")String orderPackageCode);
void mallClientSignfor(@RequestParam("tenantId") String tenantId,@RequestParam("trainNumber")String trainNumber,@RequestParam("warehouseId")Long warehouseId,@RequestParam("orderPackageCode")String orderPackageCode,@RequestParam("nowTenantId")String nowTenantId);
// /**

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

@ -198,4 +198,5 @@ public interface IDistributionParcelListClient {
@PostMapping(API_PREFIX + "/findALLNoUpShelfPackageByOrderCodeList")
List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCodeList(@RequestBody FindParamterDTO findParamterDTO);
}

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSignforVO.java

@ -130,7 +130,7 @@ public class DistributionSignforVO extends DistributionSignforEntity {
/**
* 签收件数
*/
@ApiModelProperty(value = "装车件数")
@ApiModelProperty(value = "签收件数")
private Integer signingNum;
/**
* 复核时间

18
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppPackageDetailVO.java

@ -44,6 +44,24 @@ public class DistributionAppPackageDetailVO implements Serializable {
@ApiModelProperty(value = "订单自编号")
private Integer isAbnormal;
/**
* 客户
*/
@ApiModelProperty(value = "客户")
private String client;
/**
* 电话
*/
@ApiModelProperty(value = "电话")
private String phone;
/**
* 地址
*/
@ApiModelProperty(value = "地址")
private String address;
}

3
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java

@ -100,4 +100,7 @@ public interface IAdvanceClient {
@PostMapping(API_PREFIX + "/findListByAdvanceIds")
List<AdvanceEntity> findListByAdvanceIds(@RequestBody List<Integer> advanceIds);
@PostMapping(API_PREFIX + "/findListByWaybillNo")
List<String> findListByWaybillNo(@RequestParam String waybillNo);
}

5
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClientFallbackFactory.java

@ -60,6 +60,11 @@ public class IAdvanceClientFallbackFactory implements FallbackFactory<IAdvanceCl
public List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds) {
return null;
}
@Override
public List<String> findListByWaybillNo(String waybillNo) {
return null;
}
};
}
}

1
blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/dto/SyncInventoryDTO.java

@ -15,5 +15,6 @@ public class SyncInventoryDTO implements Serializable {
private Long warehouseId;
private String orderCodes;
private Integer syncType;
}

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadOrderInfoVO.java

@ -13,6 +13,7 @@ public class CarsLoadOrderInfoVO implements Serializable {
private Integer planNum;
private Integer loadingNum;
private Integer unloadNum;
private Integer signNum;
private BigDecimal unloadIncome;
private BigDecimal costZhang;
private BigDecimal costPiece;

1
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadWaybillInfoVO.java

@ -15,6 +15,7 @@ public class CarsLoadWaybillInfoVO implements Serializable {
private Date createTime;
private String destination;
private String destinationWarehouseName;
private Integer checkStatus;
private String shipper;
private String shipperName;
private String consignee;

3
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TripartiteTransferVO.java

@ -5,4 +5,7 @@ import lombok.Data;
@Data
public class TripartiteTransferVO extends TrunklineCarsLoadEntity {
private Integer signNum;
}

1
blade-service/logpm-basic/src/main/java/com/logpm/basic/mapper/BasicMaterialMapper.xml

@ -49,6 +49,7 @@
where is_deleted = 0
and product_code = #{materialCode}
and `name` = #{materialName}
and hide = 1
</select>
</mapper>

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDriverArteryClient.java

@ -82,4 +82,9 @@ public class BasicdataDriverArteryClient implements IBasicdataDriverArteryClient
return list;
}
@Override
public BasicdataDriverArteryEntity getDriverArteryById(Long id) {
return basicdataDriverArteryService.getById(id);
}
}

2
blade-service/logpm-business/src/main/java/com/logpm/business/service/IBusinessAsyncService.java

@ -8,4 +8,6 @@ import java.util.List;
public interface IBusinessAsyncService {
public void saveOtherDataBaseNew(String tenantId, List<BusinessPreOrderEntity> dataResult, String mallName);
}

4
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.business.service.IBusinessAsyncService;
import com.logpm.business.service.IBusinessPreOrderService;
import com.logpm.distribution.feign.IDistributionDeliveryListClient;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.annotations.ChangeAsync;
@ -24,6 +25,7 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
private final IBusinessPreOrderService businessPreOrderService;
private final ISysClient sysClient;
private final IDistributionDeliveryListClient distributionDeliveryListClient;
@ChangeAsync()
@Override
@ -80,4 +82,6 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
}
}
}

70
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java

@ -13,9 +13,11 @@ import com.logpm.business.dto.BusinessPreOrderDTO;
import com.logpm.business.dto.BusinessSanDTO;
import com.logpm.business.entity.BusinessPreOrderEntity;
import com.logpm.business.mapper.BusinessPreOrderMapper;
import com.logpm.business.service.IBusinessAsyncService;
import com.logpm.business.service.IBusinessPreOrderService;
import com.logpm.business.vo.*;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.feign.IDistributionDeliveryListClient;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
@ -32,6 +34,7 @@ import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func;
@ -51,9 +54,8 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
private final IInComingClient inComingClient;
private final ITrunklineAdvanceDetailClient trunklineAdvanceDetailClient;
private final BladeRedis bladeRedis;
private final IDistributionParcelListClient distributionParcelListClient;
private final IWarehouseTrayTypeClient warehouseTrayTypeClient;
private final IDistributionDeliveryListClient distributionDeliveryListClient;
@ -78,7 +80,6 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
List<BusinessPreOrderEntity> list = baseMapper.selectList(wrapper);
List<BusinessPreOrderEntity> data = new ArrayList<>();
List<String> carNumberList = new ArrayList<>();
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
if (distributionBusinessPreOrderEntity.getInWarehouse() == 1) {
@ -90,31 +91,22 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
sb.append(distributionBusinessPreOrderEntity.getOrderPackageCode());
data.add(distributionBusinessPreOrderEntity);
if(!carNumberList.contains(distributionBusinessPreOrderEntity.getDistrCarNumber())){
carNumberList.add(distributionBusinessPreOrderEntity.getDistrCarNumber());
}
}
if(carNumberList.size()>1){
throw new ServiceException("不能同时操作多个车次");
}
BusinessSanDTO businessSanDTO = new BusinessSanDTO();
businessSanDTO.setOrderPackageCode(sb.toString());
businessSanDTO.setInWarehouseException(0);
businessSanDTO.setDistrCarNumber(carNumberList.get(0));
R r = inOrderWarehourse(businessSanDTO);
if (r.isSuccess()) {
// 更新成功
// 更新入库状态
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : data) {
distributionBusinessPreOrderEntity.setInWarehouse(1);
baseMapper.updateById(distributionBusinessPreOrderEntity);
Object o = bladeRedis.get(RedisKeyConstant.BUSINESS_IN_CARNUMBER + distributionBusinessPreOrderEntity.getDistrCarNumber());
if (!Objects.isNull(o)) {
bladeRedis.set(RedisKeyConstant.BUSINESS_IN_CARNUMBER + distributionBusinessPreOrderEntity.getDistrCarNumber(), null);
BusinessSanDTO businessSanDTO = new BusinessSanDTO();
businessSanDTO.setOrderPackageCode(distributionBusinessPreOrderEntity.getOrderPackageCode());
businessSanDTO.setInWarehouseException(0);
businessSanDTO.setDistrCarNumber(distributionBusinessPreOrderEntity.getDistrCarNumber());
R r = inOrderWarehourse(businessSanDTO);
if (r.isSuccess()) {
// 更新成功
// 更新入库状态
distributionBusinessPreOrderEntity.setInWarehouse(1);
baseMapper.updateById(distributionBusinessPreOrderEntity);
Object o = bladeRedis.get(RedisKeyConstant.BUSINESS_IN_CARNUMBER + distributionBusinessPreOrderEntity.getDistrCarNumber());
if (!Objects.isNull(o)) {
bladeRedis.set(RedisKeyConstant.BUSINESS_IN_CARNUMBER + distributionBusinessPreOrderEntity.getDistrCarNumber(), null);
}
}
}
}
return true;
@ -329,7 +321,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}
}else{
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getDistrCarNumber()+businessSanDTO.getTrayCode();
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER +businessSanDTO.getTrayCode();
Object o = bladeRedis.get(key);
if (Objects.isNull(o)) {
@ -337,7 +329,8 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(businessSanDTO.getTrayCode());
o = 1;
if(!Objects.isNull(trayTypeDataVO)){
o=trayTypeDataVO.getOrderlNum();
o=trayTypeDataVO.getTrayNum();
a= (int) o;
}
bladeRedis.setEx(key, o, 60 * 60 * 24L);
}else{
@ -350,6 +343,10 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}
// 推送业务系统
distributionDeliveryListClient.mallClientSignfor(selectD.getFromTenantId(), businessSanDTO.getDistrCarNumber(), selectD.getAcceptWarehouseId(), orderPackageCode, AuthUtil.getTenantId());
return Resp.scanSuccess("扫描成功", a + "件");
}
@ -380,6 +377,10 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
t.setFromTenantId(distributionBusinessPreOrderEntity.getFromTenantId());
t.setOperationStatus(1);
t.setInWarehouse(0);
t.setAcceptWarehouseId(distributionBusinessPreOrderEntity.getAcceptWarehouseId());
t.setAcceptWarehouseName(distributionBusinessPreOrderEntity.getAcceptWarehouseName());
t.setSendWarehouseId(distributionBusinessPreOrderEntity.getSendWarehouseId());
t.setSendWarehouseName(distributionBusinessPreOrderEntity.getSendWarehouseName());
this.save(t);
}
R r = inOrderWarehourseByFeign(businessSanDTO);
@ -391,7 +392,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
if(StringUtil.isNotBlank(businessSanDTO.getTrayCode())){
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER + businessSanDTO.getDistrCarNumber()+businessSanDTO.getTrayCode();
String key =RedisKeyConstant.BUSINESS_IN_CARNUMBER +businessSanDTO.getTrayCode();
Object o = bladeRedis.get(key);
if (Objects.isNull(o)) {
@ -399,9 +400,10 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(businessSanDTO.getTrayCode());
o = 1;
if(!Objects.isNull(trayTypeDataVO)){
o=trayTypeDataVO.getOrderlNum();
o=trayTypeDataVO.getTrayNum();
}
bladeRedis.setEx(key, o, 60 * 60 * 24L);
a= (int) o;
bladeRedis.setEx(key, o, 60 * 60 * 24L);
}else{
a = (int) o;
a = a + 1;
@ -411,7 +413,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}else{
//记录当前车次的异常件数
Object o = bladeRedis.get(RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER + businessSanDTO.getDistrCarNumber());
String key =RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER + businessSanDTO.getDistrCarNumber()+businessSanDTO.getTrayCode();
String key =RedisKeyConstant.BUSINESS_INEXCE_CARNUMBER +businessSanDTO.getTrayCode();
if (Objects.isNull(o)) {
// 查询当前车次的异常入库数量
@ -434,7 +436,9 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
}
}
// 推送业务系统
distributionDeliveryListClient.mallClientSignfor(t.getFromTenantId(), businessSanDTO.getDistrCarNumber(), t.getAcceptWarehouseId(), orderPackageCode, AuthUtil.getTenantId());
return Resp.scanSuccess("扫描成功", "异常" + a + "件");
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java

@ -7,8 +7,6 @@ import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.retry.MessageRecoverer;
import org.springframework.amqp.rabbit.retry.RepublishMessageRecoverer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@ -69,10 +67,10 @@ public class RabbitMqConfiguration {
* @param rabbitTemplate
* @return
*/
@Bean
public MessageRecoverer republishMessageRecoverer(RabbitTemplate rabbitTemplate){
return new RepublishMessageRecoverer(rabbitTemplate, RabbitConstant.DISTRIBUTION_ERROR_EXCHANGE, RabbitConstant.DISTRIBUTION_ERROR_ROUTING);
}
// @Bean
// public MessageRecoverer republishMessageRecoverer(RabbitTemplate rabbitTemplate){
// return new RepublishMessageRecoverer(rabbitTemplate, RabbitConstant.DISTRIBUTION_ERROR_EXCHANGE, RabbitConstant.DISTRIBUTION_ERROR_ROUTING);
// }
/**

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java

@ -423,9 +423,9 @@ public class DistributionDeliveryListController extends BladeController {
@GetMapping("/judgmentOrderRemove")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "判断是否可以在商配计划中移除", notes = "customArgs")
public R<Boolean> judgmentOrderRemove(@RequestParam Long deliveryId,@RequestParam String orderIds) {
boolean result = distributionDeliveryListService.judgmentOrderRemove(deliveryId,orderIds);
return R.data(result);
public R judgmentOrderRemove(@RequestParam Long deliveryId,@RequestParam String orderIds) {
R result = distributionDeliveryListService.judgmentOrderRemove(deliveryId,orderIds);
return result;
}
@PostMapping("/printBatch")

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

@ -167,8 +167,6 @@ public class DistributionStockArticleController extends BladeController {
public R<List<DistributionParcelNumberVO>> getZeroOrderDetail(@ApiIgnore @RequestParam Long id) {
List<DistributionParcelNumberVO> parcelNumberVOS = distributionStockArticleService.getZeroOrderDetail(id);
return R.data(parcelNumberVOS);
// IPage<DistributionStockArticleEntity> pages = distributionStockArticleService.pageWhole(Condition.getPage(query), distributionStockArticle);
// return R.data(DistributionStockArticleWrapper.build().pageVO(pages));
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java

@ -27,6 +27,7 @@ import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import com.logpm.distribution.vo.DistributionRetentionScanVo;
import lombok.AllArgsConstructor;
import org.apache.logging.log4j.util.Strings;
import org.springblade.common.annotations.ChangeAsync;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -129,8 +130,9 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList
/**
* @param
*/
@ChangeAsync
@Override
public void mallClientSignfor(String trainNumber,Long warehouseId,String orderPackageCode) {
public void mallClientSignfor(String tenantId,String trainNumber,Long warehouseId,String orderPackageCode,String nowTenantId) {
distributionDeliveryListService.mallClientSignfor(trainNumber,warehouseId,orderPackageCode);
}

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

@ -288,4 +288,12 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCodeList(@Param("orderCodeList") List<String> orderCodeList, @Param("warehouseId") Long warehouseId);
List<String> findOrderCodesByOrderPackageCodes(@Param("orderPackageCodes") List<String> orderPackageCodes, @Param("warehouseId") Long warehouseId);
String findAllTraysByNoParcelListIds(@Param("parcelListIdList") List<Long> parcelListIdList,@Param("orderCode") String orderCode);
void clearPalletByIds(@Param("clearTrayList") List<Long> clearTrayList);
String findAllAllocationByNoParcelListIds(@Param("parcelListIdList") List<Long> parcelListIdList, @Param("orderCode") String orderCode);
void clearAllocationByIds(@Param("clearTrayList") List<Long> clearTrayList);
}

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

@ -1794,4 +1794,49 @@
group by ldpl.order_code
</select>
<select id="findAllTraysByNoParcelListIds" resultType="String">
select GROUP_CONCAT(DISTINCT pallet)
from logpm_distribution_parcel_list
where 1=1
and order_code = #{orderCode}
and pallet != ''
and pallet is not null
and id not in
<foreach collection="parcelListIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<update id="clearPalletByIds" >
update logpm_distribution_parcel_list
set pallet = null
where id in
<foreach collection="clearTrayList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<select id="findAllAllocationByNoParcelListIds" resultType="String">
select GROUP_CONCAT(DISTINCT goods_allocation)
from logpm_distribution_parcel_list
where 1=1
and order_code = #{orderCode}
and goods_allocation != ''
and goods_allocation is not null
and id not in
<foreach collection="parcelListIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<update id="clearAllocationByIds" >
update logpm_distribution_parcel_list
set goods_allocation = null,
order_package_grounding_status = '10'
where id in
<foreach collection="clearTrayList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
</mapper>

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

@ -675,6 +675,8 @@
lds.delivery_sign_pictures deliverySignPictures,
ldr.reservation_date reservationDate,
lds.positioning_adr positioningAdr,
(lds.loaded_number + lds.loadedin_number) loadingNum,
(lds.received_quantity + lds.receivedin_quantity) signingNum,
lddl.train_number trainNumber,
lddl.vehicle_name vehicleName,
lddl.driver_name driverName,

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

@ -208,4 +208,9 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
* @return
*/
List<DistributionSignforStockArticleVO> signforListDetail(@Param("orderId") Long id);
void clearTraysByIds(@Param("ids") List<Long> clearTraysStockArticleIdList);
void clearAllocationByIds(@Param("ids") List<Long> clearAllocationStockArticleIdList);
}

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

@ -1515,5 +1515,23 @@
ldrs.reservation_id
</select>
<update id="clearTraysByIds" >
update logpm_distribution_stock_article
set trays = null
where id in
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
<update id="clearAllocationByIds" >
update logpm_distribution_stock_article
set allocation = null,
grounding_status = '10'
where id in
<foreach collection="ids" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</mapper>

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

@ -57,4 +57,8 @@ public interface DistributionStockListInfoMapper extends BaseMapper<Distribution
IPage<DistributionStockListInfoEntity> getStockListInfo(IPage<DistributionStockListInfoEntity> page,@Param("par") Map<String, Object> distributionStockListInfo);
List<String> getAllOrderPackageCodes(@Param("incomingBatch") String incomingBatch, @Param("sku") String sku, @Param("mallId") Long mallId, @Param("warehouseId") Long warehouseId);
String findAllTraysByNoParcelListIdsAndStockListId(@Param("parcelListIds") List<Long> parcelListIds, @Param("stockListId") Long stockListId);
String findAllAllocationByNoParcelListIdsAndStockListId(@Param("parcelListIds") List<Long> parcelListIds, @Param("stockListId") Long stockListId);
}

30
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListInfoMapper.xml

@ -116,4 +116,34 @@
AND is_deleted = 0
</select>
<select id="findAllTraysByNoParcelListIdsAndStockListId" resultType="String">
select GROUP_CONCAT(DISTINCT ldpl.pallet)
from logpm_distribution_stock_list_info ldsli
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldsli.parcel_list_id
where ldsli.stock_list_id = #{stockListId}
and ldsli.is_deleted = 0
and ldpl.is_deleted = 0
and ldpl.pallet != ''
and ldpl.pallet is not null
and ldsli.parcel_list_id not in
<foreach collection="parcelListIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<select id="findAllAllocationByNoParcelListIdsAndStockListId" resultType="String" >
select GROUP_CONCAT(DISTINCT ldpl.goods_allocation)
from logpm_distribution_stock_list_info ldsli
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldsli.parcel_list_id
where ldsli.stock_list_id = #{stockListId}
and ldsli.is_deleted = 0
and ldpl.is_deleted = 0
and ldpl.goods_allocation != ''
and ldpl.goods_allocation is not null
and ldsli.parcel_list_id not in
<foreach collection="parcelListIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
</mapper>

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

@ -156,4 +156,8 @@ public interface DistributionStockListMapper extends BaseMapper<DistributionStoc
IPage<DistributionStockListAllocationVO> listAllocationOrder(IPage<Object> page, @Param("param") DistributionStockListEntity distributionStockListEntity);
List<DistributionStockListEntity> getListByMarketIdAndSku(@Param("mallId")Long mallId, @Param("sku")String sku, @Param("warehouseId")Long warehouseId);
void clearTraysByIds(@Param("stockListIds") List<Long> clearTrayStockListIds);
void clearAllocationByIds(@Param("stockListIds") List<Long> clearAllocationStockListIds);
}

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml

@ -616,4 +616,22 @@
and ldsl.warehouse_id = #{warehouseId}
</select>
<update id="clearTraysByIds" >
update logpm_distribution_stock_list
set tray_name = null
where id in
<foreach collection="stockListIds" item="stockListId" open="(" separator="," close=")">
#{stockListId}
</foreach>
</update>
<update id="clearAllocationByIds" >
update logpm_distribution_stock_list
set storage_location = null
where id in
<foreach collection="stockListIds" item="stockListId" open="(" separator="," close=")">
#{stockListId}
</foreach>
</update>
</mapper>

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

@ -908,7 +908,7 @@
ldbls.create_user AS distribution_contact_id,
ldbls.bill_lading_id AS distributionId,
ldbl.pickup_batch AS transNo,
ldsa.waybill_number AS waybillNo,
ldpl.waybill_number AS waybillNo,
ldsa.order_code AS orderSelfNum,
IFNULL(ldbls.packet_bar_code,'') AS unitNo,
2 AS type,
@ -929,6 +929,7 @@
LEFT JOIN logpm_distrilbution_bill_lading AS ldbl ON ldbls.bill_lading_id = ldbl.id AND ldbl.is_deleted = 0
LEFT JOIN logpm_distribution_stock_article AS ldsa ON ldbls.stock_article_id = ldsa.id AND ldsa.is_deleted = 0
LEFT JOIN logpm_warehouse_warehouse AS lww ON ldbl.warehouse_id = lww.id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbls.parce_list_id = ldpl.id
WHERE
bill_lading_id = #{id} AND ldbls.is_deleted = 0 AND ldbls.scan_type = 1
</select>

1275
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/WarehouseTrayAllocationListener.java

File diff suppressed because it is too large Load Diff

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -401,7 +401,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
* @param
* @return
*/
boolean judgmentOrderRemove(Long deliveryId, String orderIds);
R judgmentOrderRemove(Long deliveryId, String orderIds);
/**
* 维护配送任务的配送数量
@ -464,6 +464,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
void mallClientSignfor(String trainNumber, Long warehouseId, String orderPackageCode);
/**
* 查询签收预约客户包件信息
* @param reservationId

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

@ -246,4 +246,12 @@ public interface IDistributionParcelListService extends BaseService<Distribution
List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCodeList(List<String> orderCodeList, Long warehouseId);
List<String> findOrderCodesByOrderPackageCodes(List<String> orderPackageCodes, Long warehouseId);
String findAllTraysByNoParcelListIds(List<Long> parcelListIdList,String orderCode);
void clearPalletByIds(List<Long> clearTrayList);
String findAllAllocationByNoParcelListIds(List<Long> parcelListIdList, String orderCode);
void clearAllocationByIds(List<Long> clearTrayList);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java

@ -299,4 +299,8 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
*/
List<DistributionSignforStockArticleVO> signforListDetail(Long id);
void clearTraysByIds(List<Long> clearTraysStockArticleIdList);
void clearAllocationByIds(List<Long> clearAllocationStockArticleIdList);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListInfoService.java

@ -60,4 +60,8 @@ public interface IDistributionStockListInfoService extends BaseService<Distribut
List<String> getAllOrderPackageCodes(String incomingBatch, String sku, Long mallId, Long warehouseId);
String findAllTraysByNoParcelListIdsAndStockListId(List<Long> parcelListIds, Long stockListId);
String findAllAllocationByNoParcelListIdsAndStockListId(List<Long> parcelListIds, Long stockListId);
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java

@ -214,6 +214,11 @@ public interface IDistributionStockListService extends BaseService<DistributionS
*/
R findStockListAllocation(String sourceType, Long marketId, String materielCode);
void clearTraysByIds(List<Long> clearTrayStockListIds);
void clearAllocationByIds(List<Long> clearAllocationStockListIds);
// /**
// * 查询库存品详情

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

@ -17,6 +17,7 @@
package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -80,6 +81,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
private IDistributionLoadscaninvnService distributionLoadscaninvnService;
private final IBasicdataWarehouseClient basicdataWarehouseClient;
@Override
public IPage<DistributionDeliveryInfoVO> selectDistributionDeliveryInfoPage(IPage<DistributionDeliveryInfoVO> page, DistributionDeliveryInfoVO distributionDeliveryInfo) {
List<DistributionDeliveryInfoVO> distributionDeliveryInfoVOS = baseMapper.selectDistributionDeliveryInfoPage(page, distributionDeliveryInfo);
@ -137,13 +139,19 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
List<DistributionParcelListVO> parcelListVOS = DistributionParcelListWrapper.build().listVO(parcelListEntityList);
LambdaQueryWrapper<DistributionLoadscanEntity> loadscanEntityWrapper = new LambdaQueryWrapper<>();
loadscanEntityWrapper.eq(DistributionLoadscanEntity::getReservationId, reservationId);
if (!ids.isEmpty()) {
loadscanEntityWrapper.in(DistributionLoadscanEntity::getPackageId, ids);
}
if (!orderPackageCodes.isEmpty()) {
loadscanEntityWrapper.in(DistributionLoadscanEntity::getOrderPackageCode, orderPackageCodes);
}
loadscanEntityWrapper.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue());
// 保持不变,优化性能需要注意的是ids和orderPackageCodes的处理
List<DistributionLoadscanEntity> loadscanEntitys = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.in(DistributionLoadscanEntity::getPackageId, ids)
.eq(DistributionLoadscanEntity::getReservationId, reservationId)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
.in(DistributionLoadscanEntity::getOrderPackageCode, orderPackageCodes)
);
List<DistributionLoadscanEntity> loadscanEntitys = distributionLoadscanService.list(loadscanEntityWrapper);
// 对加载的VO列表进行处理的逻辑抽取到一个独立的方法
processParcelListVOS(parcelListVOS, loadscanEntitys, reservationIdStr);
@ -163,50 +171,48 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
}
}
});
}
}
private void updateParcelStatus(DistributionParcelListVO parcel, DistributionLoadscanEntity loadscanEntity) {
parcel.setLoadingTime(loadscanEntity.getScanTime());
switch (loadscanEntity.getScanStatus()) {
case "1":
parcel.setScanStatus(LoadingStatusConstant.quxiao.getName());
break;
case "2":
parcel.setScanStatus(LoadingStatusConstant.saomiao.getName());
break;
case "3":
parcel.setScanStatus(LoadingStatusConstant.queren.getName());
break;
case "4":
parcel.setScanStatus(LoadingStatusConstant.yijianzhuangche.getName());
break;
case "5":
parcel.setScanStatus(LoadingStatusConstant.buluzhuangche.getName());
break;
default:
log.info("loadscanEntity.getScanStatus() does not meet matching conditions: {}", loadscanEntity.getScanStatus());
break;
}
if (Func.isNotEmpty(loadscanEntity.getSigningTime())) {
parcel.setSigningTime(loadscanEntity.getSigningTime());
}
if (Func.isNotEmpty(loadscanEntity.getScanUser())) {
parcel.setScanUser(loadscanEntity.getScanUser());
}
if (Func.isNotEmpty(loadscanEntity.getDriverName())) {
parcel.setDriverName(loadscanEntity.getDriverName());
}
if (Func.isNotEmpty(loadscanEntity.getSigningUser())) {
parcel.setSigningUser(loadscanEntity.getSigningUser());
}
}
parcel.setLoadingTime(loadscanEntity.getScanTime());
switch (loadscanEntity.getScanStatus()) {
case "1":
parcel.setScanStatus(LoadingStatusConstant.quxiao.getName());
break;
case "2":
parcel.setScanStatus(LoadingStatusConstant.saomiao.getName());
break;
case "3":
parcel.setScanStatus(LoadingStatusConstant.queren.getName());
break;
case "4":
parcel.setScanStatus(LoadingStatusConstant.yijianzhuangche.getName());
break;
case "5":
parcel.setScanStatus(LoadingStatusConstant.buluzhuangche.getName());
break;
default:
log.info("loadscanEntity.getScanStatus() does not meet matching conditions: {}", loadscanEntity.getScanStatus());
break;
}
if (Func.isNotEmpty(loadscanEntity.getSigningTime())) {
parcel.setSigningTime(loadscanEntity.getSigningTime());
}
if (Func.isNotEmpty(loadscanEntity.getScanUser())) {
parcel.setScanUser(loadscanEntity.getScanUser());
}
if (Func.isNotEmpty(loadscanEntity.getDriverName())) {
parcel.setDriverName(loadscanEntity.getDriverName());
}
if (Func.isNotEmpty(loadscanEntity.getSigningUser())) {
parcel.setSigningUser(loadscanEntity.getSigningUser());
}
}
private DistributionLoadscanEntity getLoadscanEntity(List<DistributionLoadscanEntity> loadscanEntitys, DistributionParcelListVO p) {
for (DistributionLoadscanEntity loadscanEntity : loadscanEntitys) {
if(loadscanEntity.getPackageId().equals(p.getId())&& loadscanEntity.getOrderPackageCode().equals(p.getOrderPackageCode())){
if (loadscanEntity.getPackageId().equals(p.getId()) && loadscanEntity.getOrderPackageCode().equals(p.getOrderPackageCode())) {
return loadscanEntity;
}
}
@ -278,7 +284,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
s.setOrderStatusName(OrderStatusConstant.qianshou.getName());
break;
default:
log.info("selectDistributionDeliveryorder 不满足匹配值 s.getOrderStatus() {}",s.getOrderStatus());
log.info("selectDistributionDeliveryorder 不满足匹配值 s.getOrderStatus() {}", s.getOrderStatus());
break;
}
});
@ -340,7 +346,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
s.setOrderStatusName(OrderStatusConstant.qianshou.getName());
break;
default:
log.info("selectDistributionDeliveryorder 不满足匹配值 s.getOrderStatus() {}",s.getOrderStatus());
log.info("selectDistributionDeliveryorder 不满足匹配值 s.getOrderStatus() {}", s.getOrderStatus());
break;
}
});
@ -360,7 +366,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
//-------------------------------------2023-10-07 客户查看订单详情-----------------------------------------------------------------
// 这里先查询出客户的订单信息,然后查询订单的预约包件信息
BasicdataWarehouseEntity myCurrentWarehouse =basicdataWarehouseClient.getMyCurrentWarehouse();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
Long reservationId = Long.parseLong(distributionAppDeliveryListDTO.getReservationId());
List<DistributionStockArticleVO> stockArticleVOS = distributionReservationMapper.selectOrderInfoByReservationId(reservationId);
@ -387,7 +393,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
loadingPackage = orderInfo.get(ord.getId()).stream().collect(Collectors.toMap(DistributionLoadscanEntity::getPackageId, Function.identity(), (k1, k2) -> k2));
}
if (ord.getIsZero().equals(IsOrNoConstant.no.getValue())) {
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, ord.getId(),myCurrentWarehouse.getId());
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(reservationId, ord.getId(), myCurrentWarehouse.getId());
List<DistributionAppParcelListVO> ks = new ArrayList<>();
AtomicInteger atomicInteger = new AtomicInteger();
// 装车数量
@ -396,8 +402,8 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
DistributionAppParcelListVO appParcelListVO = Func.copy(parcelListEntity, DistributionAppParcelListVO.class);
if (Func.isNotEmpty(loadingPackage.get(parcelListEntity.getId()))) {
atomicInteger.getAndIncrement();
assert appParcelListVO != null;
appParcelListVO.setScanStatus(2);
assert appParcelListVO != null;
appParcelListVO.setScanStatus(2);
appParcelListVO.setIsScan("已扫");
loadingPackage.remove(parcelListEntity.getId());
loadingNum.getAndAdd(parcelListEntity.getQuantity());
@ -406,8 +412,8 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
} else {
//此时这个订单内还存在装车的包件,这些包件就是异常装车的包件了
assert appParcelListVO != null;
appParcelListVO.setScanStatus(1);
assert appParcelListVO != null;
appParcelListVO.setScanStatus(1);
appParcelListVO.setIsScan("未扫");
}
ks.add(appParcelListVO);
@ -525,14 +531,14 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
for (DistributionLoadscanEntity loadscanEntity : v) {
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(loadscanEntity.getPackageId());
DistributionAppParcelListVO parcelListVO = Func.copy(parcelListEntity, DistributionAppParcelListVO.class);
assert parcelListVO != null;
parcelListVO.setScanStatus(3);
assert parcelListVO != null;
parcelListVO.setScanStatus(3);
parcelListVO.setIsScan("异常");
loadingNum.getAndAdd(parcelListEntity.getQuantity());
distributionAppParcelListVOS.add(parcelListVO);
}
assert appStockArticleVO != null;
appStockArticleVO.setIsZero(stockArticleEntity.getIsZero());
assert appStockArticleVO != null;
appStockArticleVO.setIsZero(stockArticleEntity.getIsZero());
appStockArticleVO.setLoadingNub(loadingNum.get());
appStockArticleVO.setIsHaveAbnormalPackage(2);
appStockArticleVO.setIsHaveAbnormalPackageName("整单异常");
@ -640,13 +646,12 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
@Override
public IPage<DistributionReservationInventoryPackageVO> getReservationPackageList(Map<String, Object> reservationPackageDTO, IPage<DistributionReservationInventoryPackageVO> page) {
String method = "DistributionDeliveryInfoServiceImpl类,getReservationPackageList方法";
if (Func.isEmpty(reservationPackageDTO.get("reservationId"))){
if (Func.isEmpty(reservationPackageDTO.get("reservationId"))) {
//参数缺失
log.error(method+"reservationId参数缺失");
log.error(method + "reservationId参数缺失");
return null;
}
IPage<DistributionReservationInventoryPackageVO> reservationInventoryPackageVOIPage = distributionReservationMapper.selectInvenToryPackageByReservationInfo(reservationPackageDTO,page);
IPage<DistributionReservationInventoryPackageVO> reservationInventoryPackageVOIPage = distributionReservationMapper.selectInvenToryPackageByReservationInfo(reservationPackageDTO, page);
return reservationInventoryPackageVOIPage;
@ -656,13 +661,13 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
@Override
public IPage<DistributionReservationZeroPackageVO> getReservationZeroPackageList(Map<String, Object> reservationPackageDTO, IPage<DistributionReservationZeroPackageVO> page) {
String method = "DistributionDeliveryInfoServiceImpl类,getReservationPackageList方法";
if (Func.isEmpty(reservationPackageDTO.get("reservationId"))){
if (Func.isEmpty(reservationPackageDTO.get("reservationId"))) {
//参数缺失
log.error(method+"reservationId参数缺失");
log.error(method + "reservationId参数缺失");
return null;
}
IPage<DistributionReservationZeroPackageVO> reservationInventoryPackageVOIPage = distributionReservationMapper.selectZeroPackageByReservationInfo(reservationPackageDTO,page);
return reservationInventoryPackageVOIPage;
IPage<DistributionReservationZeroPackageVO> reservationInventoryPackageVOIPage = distributionReservationMapper.selectZeroPackageByReservationInfo(reservationPackageDTO, page);
return reservationInventoryPackageVOIPage;
}

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

@ -72,10 +72,7 @@ import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStatusConstant;
import org.springblade.common.constant.loading.LoadScanSigningStatusConstant;
import org.springblade.common.constant.loading.LoadingAbnormalAuditingStatusConstant;
import org.springblade.common.constant.loading.LoadingIsInsertConstant;
import org.springblade.common.constant.loading.LoadingStatusConstant;
import org.springblade.common.constant.loading.*;
import org.springblade.common.constant.order.OrderStatusConstant;
import org.springblade.common.constant.orderpackage.*;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
@ -100,7 +97,9 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IDictBizClient;
import org.springblade.system.feign.IUserClient;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -246,6 +245,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Autowired
private FactoryDataMessageSender factoryDataMessageSender;
@Autowired
private IUserClient userClient;
@Autowired
private IBasicdataDriverArteryClient arteryClient;
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
// @Lazy
@ -7007,7 +7013,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@Override
public boolean judgmentOrderRemove(Long deliveryId, String orderIds) {
public R judgmentOrderRemove(Long deliveryId, String orderIds) {
List<Long> list = Func.toLongList(orderIds);
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryId)
@ -7015,9 +7021,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(loadscanEntityList)) {
return false;
List<Long> ids = loadscanEntityList.stream().map(DistributionLoadscanEntity::getOrderId).distinct().collect(Collectors.toList());
List<DistributionStockArticleEntity> distributionStockArticleEntities = distributionStockArticleService.listByIds(ids);
if (!distributionStockArticleEntities.isEmpty()) {
String orderCodes = distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getOrderCode).distinct().collect(Collectors.joining(",\n"));
return R.fail(orderCodes+"当前订单已装车,请滞留后进行移除");
}
}
return true;
return R.data(true);
}
@Override
@ -7227,6 +7238,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@Override
@Transactional
public void mallClientSignfor(String trainNumber, Long warehouseId, String orderPackageCode) {
//查询包件是否合法
DistributionParcelListEntity packageObj = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda()
@ -7235,6 +7247,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
);
if (Func.isEmpty(packageObj)) {
//系统无编码
log.error("系统无编码");
}
if (OrderPackageStatusConstant.yiqianshou.getValue().equals(packageObj.getOrderPackageStatus())) {
//包件已签收
log.error("包件已签收");
}
//查询配送计划
DistributionDeliveryListEntity deliveryListEntity = this.getOne(Wrappers.<DistributionDeliveryListEntity>query().lambda()
@ -7243,49 +7260,280 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
);
if (Func.isEmpty(deliveryListEntity)) {
//配送计划查询错误
log.error("配送计划查询错误");
}
//查询仓库是否有效
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(warehouseId);
if (Func.isEmpty(entityWarehouseId)) {
//仓库查询错误
log.error("仓库查询错误");
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(packageObj.getStockArticleId());
if (Func.isEmpty(stockArticleEntity)) {
//订单查询错误
log.error("订单查询错误");
}
//查询配送司机
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfDTO();
if (deliveryListEntity.getKind().equals(ServiceConstant.DELIVERLIST_KIND_SELF)) {
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(new QueryWrapper<DistributionDeliverySelfEntity>().lambda()
.eq(DistributionDeliverySelfEntity::getIsMaster, ServiceConstant.IS_MASTER_YES)
.eq(DistributionDeliverySelfEntity::getDeliveryId, deliveryListEntity.getId())
);
} else {
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda()
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, deliveryListEntity.getId()));
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
}
if (Func.isEmpty(distributionDeliverySelfEntity)){
//查询司机信息失败
log.error("查询司机信息失败");
}
//查询签收信息
List<DistributionSignforEntity> signforEntityList = distributionSignforService.list(Wrappers.<DistributionSignforEntity>query().lambda()
.eq(DistributionSignforEntity::getDeliveryId, deliveryListEntity.getId())
);
String content = "";
if (!signforEntityList.isEmpty()) {
List<Long> reservationIds = signforEntityList.stream().map(DistributionSignforEntity::getReservationId).collect(Collectors.toList());
List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.in(DistributionReservationPackageEntity::getReservationId, reservationIds)
.ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
if (!reservationPackageEntityList.isEmpty()) {
boolean flag = reservationPackageEntityList.stream().anyMatch(rp -> orderPackageCode.equals(rp.getPacketBarCode()));
if (flag) {
//存在计划中,进行是否装车判断然后完成签收扫描闭环
List<DistributionReservationPackageEntity> rpList = reservationPackageEntityList.stream().filter(rp -> orderPackageCode.equals(rp.getPacketBarCode())).collect(Collectors.toList());
if (rpList.size() == 1) {
DistributionReservationEntity reservationEntity = distributionReservationService.getById(rpList.get(0).getReservationId());
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getReservationId, rpList.get(0).getReservationId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, rpList.get(0).getPacketBarCode())
.eq(DistributionLoadscanEntity::getWarehouseId, warehouseId)
.eq(DistributionLoadscanEntity::getSignforState, LoadScanSigningStatusConstant.weiqianshou.getValue())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (Func.isEmpty(loadscanEntity)) {
if (!Func.isEmpty(loadscanEntity)) {
//存在装车数据
loadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
loadscanEntity.setSignforState(2);
loadscanEntity.setScanState(1);
loadscanEntity.setIsInsert(1);
loadscanEntity.setScanState(1);
loadscanEntity.setReceivedQuantity(loadscanEntity.getLoadedNub());
loadscanEntity.setSigningUser(loadscanEntity.getDriverName());
loadscanEntity.setSigningUserId(Long.parseLong(loadscanEntity.getDriverId()));
distributionLoadscanService.updateById(loadscanEntity);
//更新签收数量
Integer j = distributionSignforMapper.updateSignforNum(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//更新签收人
BladeUser user = AuthUtil.getUser();
user.setNickName(loadscanEntity.getDriverName());
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), user);
content = "包件在" + entityWarehouseId.getName() + "由" + loadscanEntity.getSigningUser() + "扫描签收,签收方式:司机进行装车,由商家端进行签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
} else {
//不存在装车数据进行补录
//查询配送计划的计划司机
DistributionLoadscanEntity distributionLoadscanEntity = new DistributionLoadscanEntity();
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleNub())) {
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) {
distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) {
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
Date loadScanTime = new Date();
distributionLoadscanEntity.setScanTime(simpleDateFormat.format(loadScanTime));
distributionLoadscanEntity.setPackageId(packageObj.getId());
distributionLoadscanEntity.setWarehouseId(entityWarehouseId.getId());
distributionLoadscanEntity.setWarehouseName(entityWarehouseId.getName());
distributionLoadscanEntity.setOrderPackageCode(packageObj.getOrderPackageCode());
Date signingTime = new Date(System.currentTimeMillis() + (1000 * 60));
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(signingTime));
distributionLoadscanEntity.setReceivedQuantity(packageObj.getQuantity());
distributionLoadscanEntity.setReservationId(rpList.get(0).getReservationId());
distributionLoadscanEntity.setScanState(0);
distributionLoadscanEntity.setIsSignfor(2);
distributionLoadscanEntity.setScanType("1");
distributionLoadscanEntity.setIsInsert(2);
distributionLoadscanEntity.setSignforState(2);
distributionLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
distributionLoadscanEntity.setPackageNub(packageObj.getQuantity());
distributionLoadscanEntity.setOrderId(packageObj.getStockArticleId());
distributionLoadscanEntity.setLoadedNub(packageObj.getQuantity());
distributionLoadscanEntity.setDeliveryId(deliveryListEntity.getId());
distributionLoadscanEntity.setScanUser(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setSigningUser(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setSigningUserId(distributionDeliverySelfEntity.getDeliveryId());
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue());
distributionLoadscanService.save(distributionLoadscanEntity);
//进行签收数量的修改
Integer i = distributionDeliveryListMapper.updateloadingTimeById(deliveryListEntity.getId());
//更新装车包件数和签收包件数
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
BladeUser user = AuthUtil.getUser();
user.setNickName(distributionLoadscanEntity.getDriverName());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user);
//包件解托下架
warehouseUpdownTypeClient.downPackageOrDelTray(packageObj.getOrderPackageCode(), warehouseId, "签收下架解托");
content = "包件在" + entityWarehouseId.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,签收方式:司机未进行装车,由商家端进行签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
}
//进行包件状态维护
//维护订单
}
} else {
//异常签收判定
//查询此包件的订单
//查询此配送任务的预约列表
List<DistributionReservationEntity> distributionReservationEntities = baseMapper.selectReservationByDeliveryListId(deliveryListEntity.getId());
if (!distributionReservationEntities.isEmpty()) {
boolean isSatisfy = distributionReservationEntities.stream().anyMatch(f -> stockArticleEntity.getConsigneeUnit().equals(f.getReceivingUnit()) && stockArticleEntity.getMallName().equals(f.getMallName()) && stockArticleEntity.getConsigneePerson().equals(f.getConsignee()));
if (isSatisfy) {
List<DistributionReservationEntity> reservationList = distributionReservationEntities.stream().filter(f -> stockArticleEntity.getConsigneeUnit().equals(f.getReceivingUnit()) && stockArticleEntity.getMallName().equals(f.getMallName()) && stockArticleEntity.getConsigneePerson().equals(f.getConsignee())).collect(Collectors.toList());
if (reservationList.size() == 1) {
//查询装车记录
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getOrderPackageCode, packageObj.getOrderPackageCode())
.eq(DistributionLoadscanEntity::getSignforState, LoadScanSigningStatusConstant.weiqianshou.getValue())
.eq(DistributionLoadscanEntity::getWarehouseId, warehouseId)
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (!loadscanEntityList.isEmpty()) {
//存在装车
if (loadscanEntityList.size() == 1) {
//判定是否是本车次的装车
isSatisfy = loadscanEntityList.stream().anyMatch(a -> deliveryListEntity.getId().equals(a.getDeliveryId()));
if (isSatisfy){
//本车次的异常装车
DistributionLoadscanEntity distributionLoadscanEntity = loadscanEntityList.get(0);
if (distributionLoadscanEntity.equals("2")){
//进行异常签收的标识
//存在装车数据
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date()));
distributionLoadscanEntity.setSignforState(2);
distributionLoadscanEntity.setScanState(1);
distributionLoadscanEntity.setIsInsert(1);
distributionLoadscanEntity.setScanState(1);
//异常装车状态下进行签收
distributionLoadscanEntity.setIsAbnormalSigning(2);
distributionLoadscanEntity.setAbnormalNote("异常签收");
distributionLoadscanEntity.setReceivedQuantity(distributionLoadscanEntity.getLoadedNub());
distributionLoadscanEntity.setSigningUser(distributionLoadscanEntity.getDriverName());
distributionLoadscanEntity.setSigningUserId(Long.parseLong(distributionLoadscanEntity.getDriverId()));
distributionLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
distributionLoadscanService.updateById(distributionLoadscanEntity);
Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
BladeUser user = AuthUtil.getUser();
user.setNickName(distributionLoadscanEntity.getDriverName());
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user);
content = "包件在" + entityWarehouseId.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,签收方式:司机进行异常装车,由商家端进行签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationList.get(0).getReservationCode();
//成功 -- 进行异常签收
}
} else {
log.error("商家端异常签收存在装车非本车次计划");
}
}else {
log.error("商家端签收非计划下存在多条装车记录");
}
}else {
DistributionLoadscanEntity distributionLoadscanEntity = new DistributionLoadscanEntity();
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleNub())) {
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) {
distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) {
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
Date loadScanTime = new Date();
distributionLoadscanEntity.setScanTime(simpleDateFormat.format(loadScanTime));
distributionLoadscanEntity.setPackageId(packageObj.getId());
distributionLoadscanEntity.setWarehouseId(entityWarehouseId.getId());
distributionLoadscanEntity.setWarehouseName(entityWarehouseId.getName());
distributionLoadscanEntity.setOrderPackageCode(packageObj.getOrderPackageCode());
Date signingTime = new Date(System.currentTimeMillis() + (1000 * 60));
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(signingTime));
distributionLoadscanEntity.setReceivedQuantity(packageObj.getQuantity());
distributionLoadscanEntity.setReservationId(reservationList.get(0).getId());
distributionLoadscanEntity.setScanState(0);
distributionLoadscanEntity.setIsSignfor(2);
distributionLoadscanEntity.setScanType("5");
distributionLoadscanEntity.setIsInsert(2);
distributionLoadscanEntity.setSignforState(2);
distributionLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber());
distributionLoadscanEntity.setPackageNub(packageObj.getQuantity());
distributionLoadscanEntity.setOrderId(packageObj.getStockArticleId());
distributionLoadscanEntity.setLoadedNub(packageObj.getQuantity());
distributionLoadscanEntity.setDeliveryId(deliveryListEntity.getId());
distributionLoadscanEntity.setScanUser(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setSigningUser(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setSigningUserId(distributionDeliverySelfEntity.getDeliveryId());
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue());
distributionLoadscanService.save(distributionLoadscanEntity);
//进行签收数量的修改
Integer i = distributionDeliveryListMapper.updateloadingTimeById(deliveryListEntity.getId());
//更新装车包件数和签收包件数
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
BladeUser user = AuthUtil.getUser();
user.setNickName(distributionLoadscanEntity.getDriverName());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), user);
content = "包件在" + entityWarehouseId.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,签收方式:司机未进行装车,由商家端进行异常签收,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + reservationList.get(0).getReservationCode();
//失败 -- 无法进行异常签收
}
}else {
log.error("一个车次内存在两个同样客户");
}
}else {
log.error("商家签收车次内不存在该客户");
}
}
}
List<JSONObject> logs = handleMallLogJSONObject(entityWarehouseId, Long.parseLong(distributionDeliverySelfEntity.getDriverId()), packageObj.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode());
if (!logs.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(logs);
}
//进行包件状态维护
packageObj.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
packageObj.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
distributionParcelListService.updateById(packageObj);
//下架解托
warehouseUpdownTypeClient.downPackageAndDelTrayAndIsUpdate(packageObj.getOrderPackageCode(), entityWarehouseId.getId(), "扫描装车进行下架、解托", false);
//维护订单
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(),warehouseId);
//维护车次任务状态
deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue());
distributionDeliveryListService.updateById(deliveryListEntity);
}
}
@ -7424,4 +7672,32 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
trunklinePackageTrackLog.put("operator", user.getNickName());
return trunklinePackageTrackLog;
}
private List<JSONObject> handleMallLogJSONObject(BasicdataWarehouseEntity warehouse, Long userId, String orderPackageCode, String content, Integer node) {
List<JSONObject> trunklinePackageTrackLog = new ArrayList<>();
JSONObject js = new JSONObject();
//查询司机用户
BasicdataDriverArteryEntity driverArtery = arteryClient.getDriverArteryById(userId);
if (!Func.isEmpty(driverArtery)){
R<User> userR = userClient.userInfoById(driverArtery.getUserId());
User user = userR.getData();
js.put("tenantId", user.getTenantId());
js.put("createTime", new Date());
js.put("createUser", user.getId());
js.put("updateUser", user.getId());
js.put("updateTime", new Date());
js.put("isDeleted", 0);
js.put("status", 1);
js.put("createDept", warehouse.getDepartment());
js.put("orderPackageCode", orderPackageCode);
js.put("warehouseId", warehouse.getId());
js.put("warehouseName", warehouse.getName());
js.put("workNode", node);
js.put("content", content);
js.put("operator", user.getName());
trunklinePackageTrackLog.add(js);
}
return trunklinePackageTrackLog;
}
}

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

@ -1297,6 +1297,26 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return baseMapper.findOrderCodesByOrderPackageCodes(orderPackageCodes,warehouseId);
}
@Override
public String findAllTraysByNoParcelListIds(List<Long> parcelListIdList,String orderCode) {
return baseMapper.findAllTraysByNoParcelListIds(parcelListIdList,orderCode);
}
@Override
public void clearPalletByIds(List<Long> clearTrayList) {
baseMapper.clearPalletByIds(clearTrayList);
}
@Override
public String findAllAllocationByNoParcelListIds(List<Long> parcelListIdList, String orderCode) {
return baseMapper.findAllAllocationByNoParcelListIds(parcelListIdList,orderCode);
}
@Override
public void clearAllocationByIds(List<Long> clearTrayList) {
baseMapper.clearAllocationByIds(clearTrayList);
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();

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

@ -936,6 +936,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public R signingPackageDetail(Long reservationId) {
List<DistributionAppPackageDetailVO> details = baseMapper.signingPackageDetail(reservationId);
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
String str = reservationEntity.getReceivingUnit()+"("+reservationEntity.getConsignee()+")";
details.get(0).setClient(str);
details.get(0).setAddress(reservationEntity.getDeliveryAddress());
details.get(0).setPhone(reservationEntity.getDeliveryPhone());
return R.data(details);
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -2723,6 +2723,16 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return baseMapper.signforListDetail(id);
}
@Override
public void clearTraysByIds(List<Long> clearTraysStockArticleIdList) {
baseMapper.clearTraysByIds(clearTraysStockArticleIdList);
}
@Override
public void clearAllocationByIds(List<Long> clearAllocationStockArticleIdList) {
baseMapper.clearAllocationByIds(clearAllocationStockArticleIdList);
}
@Override
public R findEditCustomerLog(Long orderId) {

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListInfoServiceImpl.java

@ -16,7 +16,6 @@
*/
package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionStockListInfoEntity;
@ -89,4 +88,14 @@ public class DistributionStockListInfoServiceImpl extends BaseServiceImpl<Distri
return baseMapper.getAllOrderPackageCodes(incomingBatch,sku,mallId,warehouseId);
}
@Override
public String findAllTraysByNoParcelListIdsAndStockListId(List<Long> parcelListIds, Long stockListId) {
return baseMapper.findAllTraysByNoParcelListIdsAndStockListId(parcelListIds,stockListId);
}
@Override
public String findAllAllocationByNoParcelListIdsAndStockListId(List<Long> parcelListIds, Long stockListId) {
return baseMapper.findAllAllocationByNoParcelListIdsAndStockListId(parcelListIds,stockListId);
}
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -918,6 +918,16 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return null;
}
@Override
public void clearTraysByIds(List<Long> clearTrayStockListIds) {
baseMapper.clearTraysByIds(clearTrayStockListIds);
}
@Override
public void clearAllocationByIds(List<Long> clearAllocationStockListIds) {
baseMapper.clearAllocationByIds(clearAllocationStockListIds);
}
@Override
public OrderPackgeCodeDataVO showInventorySourcePackageCode(String incomingBatch, Long packageIds) throws Exception {

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java

@ -112,4 +112,9 @@ public class AdvanceClient implements IAdvanceClient {
return list;
}
@Override
public List<String> findListByWaybillNo(String waybillNo) {
return service.findListByWaybillNo(waybillNo);
}
}

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java

@ -54,4 +54,6 @@ public interface AdvanceMapper {
List<AdvanceEntity> getAdvanceList(@Param("orderSelfNum") String orderSelfNum);
List<AdvanceEntity> findListByAdvanceIds(@Param("advanceIds") List<Integer> advanceIds);
List<String> findListByWaybillNo(@Param("waybillNo") String waybillNo);
}

7
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml

@ -82,4 +82,11 @@
</if>
</select>
<select id="findListByWaybillNo" resultType="String">
select orderSelfNum
from ht_advance
where delete_time = 0
and waybill_no = #{waybillNo}
</select>
</mapper>

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java

@ -54,4 +54,6 @@ public interface IAdvanceService {
List<AdvanceEntity> getAdvanceList(String orderSelfNum);
List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds);
List<String> findListByWaybillNo(String waybillNo);
}

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java

@ -87,4 +87,9 @@ public class AdvanceServiceImpl implements IAdvanceService {
public List<AdvanceEntity> findListByAdvanceIds(List<Integer> advanceIds) {
return advanceMapper.findListByAdvanceIds(advanceIds);
}
@Override
public List<String> findListByWaybillNo(String waybillNo) {
return advanceMapper.findListByWaybillNo(waybillNo);
}
}

29
blade-service/logpm-patch/src/main/java/com/logpm/patch/controller/SyncOrderInfoController.java

@ -4,6 +4,7 @@ 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.oldproject.feign.IAdvanceClient;
import com.logpm.patch.dto.SyncInventoryDTO;
import com.logpm.patch.entity.SyncInventoryEntity;
import com.logpm.patch.service.ISyncOrderInfoService;
@ -30,6 +31,7 @@ public class SyncOrderInfoController {
private final IBasicdataWarehouseClient warehouseClient;
private final ISyncOrderInfoService syncOrderInfoService;
private final IAdvanceClient advanceClient;
@ResponseBody
@PostMapping("/syncOrder")
@ -40,6 +42,7 @@ public class SyncOrderInfoController {
try{
String orderCodes = syncInventoryDTO.getOrderCodes();
Integer syncType = syncInventoryDTO.getSyncType();//1订单 2 运单
if(StringUtil.isBlank(orderCodes)){
log.warn(method+"订单号不能为空 orderCodes={}",orderCodes);
@ -51,16 +54,34 @@ public class SyncOrderInfoController {
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(403,"仓库信息为空");
}
if(Objects.isNull(syncType)){
log.warn(method+"数据类型不能为空 syncType={}",syncType);
return R.fail(403,"数据类型不能为空");
}
Long warehouseId = myCurrentWarehouse.getId();
log.info(method+" warehouseId={} oldWarehouseId={}",warehouseId,myCurrentWarehouse.getOldId());
BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(warehouseId);
log.info(method+" warehouseId={} oldWarehouseId={}",warehouseId,entityWarehouseId.getOldId());
String[] split = orderCodes.split(",");
List<String> orderCodeList = new ArrayList<>(Arrays.asList(split));
List<String> orderCodeList = new ArrayList<>();
if(syncType.equals(1)){
//订单
String[] split = orderCodes.split(",");
List<String> list = Arrays.asList(split);
orderCodeList.addAll(list);
}else if(syncType.equals(2)){
//运单
List<String> list = advanceClient.findListByWaybillNo(orderCodes);
orderCodeList.addAll(list);
}else{
log.warn(method+"数据类型不正确 syncType={}",syncType);
return R.fail(403,"数据类型不正确");
}
log.info(method+"当前处理的订单 orderCodeList={}",orderCodeList);
syncOrderInfoService.handleData(orderCodeList,entityWarehouseId.getOldId(),warehouseId,null,null);

272
blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java

@ -0,0 +1,272 @@
package com.logpm.report.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.report.dto.IndexDTO;
import com.logpm.report.service.IWarehouseIndexService;
import com.logpm.report.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@Log4j2
@RestController
@AllArgsConstructor
@RequestMapping("/warehouseIndex")
@Api(value = "仓库首页控制类", tags = "仓库首页数据")
public class WarehouseIndexController {
private IBasicdataWarehouseClient warehouseClient;
private IWarehouseIndexService warehouseIndexService;
@ResponseBody
@PostMapping("/openOrderData")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "开单数据", notes = "传入indexDTO")
public R openOrderData(@RequestBody IndexDTO indexDTO) {
String method = "###########openOrderData: ";
log.info(method+"indexDTO={}",indexDTO);
try{
List<Long> warehouseIds = new ArrayList<>();
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
myWatchWarehouse.forEach(warehouseEntity -> {
warehouseIds.add(warehouseEntity.getId());
});
}else{
warehouseIds.add(myCurrentWarehouse.getId());
}
indexDTO.setWarehouseIds(warehouseIds);
//查询订制品打托列表
IndexOpenOrderDataVO indexOpenOrderDataVO = warehouseIndexService.openOrderData(indexDTO);
return R.data(indexOpenOrderDataVO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/openOrderIncome")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "开单收入数据", notes = "传入indexDTO")
public R openOrderIncome(@RequestBody IndexDTO indexDTO) {
String method = "###########openOrderIncome: ";
log.info(method+"indexDTO={}",indexDTO);
try{
List<Long> warehouseIds = new ArrayList<>();
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
myWatchWarehouse.forEach(warehouseEntity -> {
warehouseIds.add(warehouseEntity.getId());
});
}else{
warehouseIds.add(myCurrentWarehouse.getId());
}
indexDTO.setWarehouseIds(warehouseIds);
//查询订制品打托列表
IndexOpenOrderIncomeVO indexOpenOrderIncomeVO = warehouseIndexService.openOrderIncome(indexDTO);
return R.data(indexOpenOrderIncomeVO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/handOrderData")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "当前在库数据", notes = "传入indexDTO")
public R handOrderData(@RequestBody IndexDTO indexDTO) {
String method = "###########handOrderData: ";
log.info(method+"indexDTO={}",indexDTO);
try{
List<Long> warehouseIds = new ArrayList<>();
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
myWatchWarehouse.forEach(warehouseEntity -> {
warehouseIds.add(warehouseEntity.getId());
});
}else{
warehouseIds.add(myCurrentWarehouse.getId());
}
indexDTO.setWarehouseIds(warehouseIds);
//查询订制品打托列表
IndexHandOrderDataVO indexHandOrderDataVO = warehouseIndexService.handOrderData(indexDTO);
return R.data(indexHandOrderDataVO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/allocationData")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "库位数据", notes = "传入indexDTO")
public R allocationData(@RequestBody IndexDTO indexDTO) {
String method = "###########allocationData: ";
log.info(method+"indexDTO={}",indexDTO);
try{
List<Long> warehouseIds = new ArrayList<>();
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
myWatchWarehouse.forEach(warehouseEntity -> {
warehouseIds.add(warehouseEntity.getId());
});
}else{
warehouseIds.add(myCurrentWarehouse.getId());
}
indexDTO.setWarehouseIds(warehouseIds);
//查询订制品打托列表
IndexAllocationDataVO indexAllocationDataVO = warehouseIndexService.allocationData(indexDTO);
return R.data(indexAllocationDataVO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/trunklineHandOrderData")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "干线待发运数据", notes = "传入indexDTO")
public R trunklineHandOrderData(@RequestBody IndexDTO indexDTO) {
String method = "###########trunklineHandOrderData: ";
log.info(method+"indexDTO={}",indexDTO);
try{
List<Long> warehouseIds = new ArrayList<>();
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
myWatchWarehouse.forEach(warehouseEntity -> {
warehouseIds.add(warehouseEntity.getId());
});
}else{
warehouseIds.add(myCurrentWarehouse.getId());
}
indexDTO.setWarehouseIds(warehouseIds);
//查询订制品打托列表
IndexTrunklineHandOrderDataVO indexTrunklineHandOrderDataVO = warehouseIndexService.trunklineHandOrderData(indexDTO);
return R.data(indexTrunklineHandOrderDataVO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/trunklineCarsData")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "干线车次数据", notes = "传入indexDTO")
public R trunklineCarsData(@RequestBody IndexDTO indexDTO) {
String method = "###########trunklineCarsData: ";
log.info(method+"indexDTO={}",indexDTO);
try{
List<Long> warehouseIds = new ArrayList<>();
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
myWatchWarehouse.forEach(warehouseEntity -> {
warehouseIds.add(warehouseEntity.getId());
});
}else{
warehouseIds.add(myCurrentWarehouse.getId());
}
indexDTO.setWarehouseIds(warehouseIds);
//查询订制品打托列表
IndexTrunklineCarsDataVO indexTrunklineCarsDataVO = warehouseIndexService.trunklineCarsData(indexDTO);
return R.data(indexTrunklineCarsDataVO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/unloadAbnormalData")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "卸车异常数据", notes = "传入indexDTO")
public R unloadAbnormalData(@RequestBody IndexDTO indexDTO) {
String method = "###########unloadAbnormalData: ";
log.info(method+"indexDTO={}",indexDTO);
try{
List<Long> warehouseIds = new ArrayList<>();
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
myWatchWarehouse.forEach(warehouseEntity -> {
warehouseIds.add(warehouseEntity.getId());
});
}else{
warehouseIds.add(myCurrentWarehouse.getId());
}
indexDTO.setWarehouseIds(warehouseIds);
//查询订制品打托列表
IndexUnloadAbnormalDataVO indexUnloadAbnormalDataVO = warehouseIndexService.unloadAbnormalData(indexDTO);
return R.data(indexUnloadAbnormalDataVO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
}

16
blade-service/logpm-report/src/main/java/com/logpm/report/dto/IndexDTO.java

@ -0,0 +1,16 @@
package com.logpm.report.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class IndexDTO implements Serializable {
private List<Long> warehouseIds;
private Date startDate;
private Date endDate;
}

42
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.java

@ -0,0 +1,42 @@
package com.logpm.report.mapper;
import com.alibaba.fastjson.JSONObject;
import com.logpm.report.dto.IndexDTO;
import com.logpm.report.vo.IndexHandOrderDataVO;
import com.logpm.report.vo.IndexTrunklineCarsDataVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
@Mapper
public interface WarehouseIndexMapper {
int findTotalNum(@Param("param") IndexDTO indexDTO);
BigDecimal findTotalFee(@Param("param") IndexDTO indexDTO);
JSONObject findFeeByDate(@Param("param") IndexDTO indexDTO);
IndexHandOrderDataVO handOrderData(@Param("param") IndexDTO indexDTO);
Integer findHandStockListNum(@Param("param") IndexDTO indexDTO);
Integer findTrayNum(@Param("param") IndexDTO indexDTO);
Integer findTotalAllocationNum(@Param("param") IndexDTO indexDTO);
Integer findUseAllocationNum(@Param("param") IndexDTO indexDTO);
Integer findUpshelfNum(@Param("param") IndexDTO indexDTO);
JSONObject findPackageTrunklineHandOrderData(@Param("param") IndexDTO indexDTO);
JSONObject findZeroTrunklineHandOrderData(@Param("param") IndexDTO indexDTO);
IndexTrunklineCarsDataVO trunklineCarsData(@Param("param") IndexDTO indexDTO);
JSONObject findAbnormalData(@Param("param") IndexDTO indexDTO);
Integer findUnloadNum(@Param("param") IndexDTO indexDTO);
}

204
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/WarehouseIndexMapper.xml

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.report.mapper.WarehouseIndexMapper">
<select id="findTotalNum" resultType="int">
select IFNULL(count(id),0)
from logpm_warehouse_waybill
where 1=1
<if test="param.startDate != null">
and create_time &gt;= #{param.startDate}
</if>
<if test="param.endDate != null">
and create_time &lt;= #{param.endDate}
</if>
and departure_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findTotalFee" resultType="java.math.BigDecimal">
select IFNULL(sum(IFNULL(x_pay,0)+IFNULL(d_pay,0)+IFNULL(y_pay,0)+IFNULL(h_pay,0)),0)
from logpm_warehouse_waybill
where 1=1
and departure_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findFeeByDate" resultType="com.alibaba.fastjson.JSONObject">
select IFNULL(sum(IFNULL(x_pay,0)+IFNULL(d_pay,0)+IFNULL(y_pay,0)+IFNULL(h_pay,0)),0) fee,
IFNULL(sum(IFNULL(total_freight,0)),0) trunklineFee,
IFNULL(sum(IFNULL(storage_fee,0)),0) warehouseFee,
IFNULL(sum(IFNULL(delivery_fee,0)),0) distributionFee,
IFNULL(sum(IFNULL(pickup_fee,0)),0) billladingFee,
IFNULL(sum(IFNULL(install_fee,0)),0) installFee
from logpm_warehouse_waybill
where 1=1
<if test="param.startDate != null">
and create_time &gt;= #{param.startDate}
</if>
<if test="param.endDate != null">
and create_time &lt;= #{param.endDate}
</if>
and departure_warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="handOrderData" resultType="com.logpm.report.vo.IndexHandOrderDataVO">
select IFNULL(sum(hand_quantity),0) totalNum,
IFNULL(SUM(IF(is_zero=1,hand_quantity,0)),0) zeroNum,
IFNULL(SUM(IF(type_service='1',hand_quantity,0)),0) mallNum,
IFNULL(SUM(IF(type_service='2',hand_quantity,0)),0) cityNum,
IFNULL(SUM(IF(type_service='3',hand_quantity,0)),0) billNum,
IFNULL(SUM(IF(type_service='4',hand_quantity,0)),0) thirdTransferNum
from logpm_distribution_stock_article
WHERE 1=1
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findHandStockListNum" resultType="int">
select IFNULL(sum(quantity_stock),0)
from logpm_distribution_stock_list
where 1=1
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findTrayNum" resultType="int">
select IFNULL(sum(num),0)
from logpm_warehouse_tray_goods
where 1=1
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findTotalAllocationNum" resultType="int">
select IFNULL(count(id),0)
from logpm_warehouse_goods_allocation
where 1=1
and is_deleted = 0
and enable_status = 1
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findUseAllocationNum" resultType="int">
select IFNULL(count(id),0)
from logpm_warehouse_updown_type
where 1=1
and is_deleted = 0
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findUpshelfNum" resultType="int">
select IFNULL(sum(num),0)
from logpm_warehouse_updown_goods
where 1=1
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findPackageTrunklineHandOrderData" resultType="com.alibaba.fastjson.JSONObject">
select IFNULL(count(distinct lww.id),0) waybillNum,
IFNULL(sum(ldpl.quantity),0) handleNum,
IFNULL(sum(ldpl.weight),0) handleWeight,
IFNULL(sum(ldpl.volume),0) handleVolume
from logpm_distribution_parcel_list ldpl
left join logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id
left join logpm_warehouse_waybill lww on ldpl.waybill_number = lww.waybill_no and lww.departure_warehouse_id = ldpl.warehouse_id
where 1=1
and ldsa.is_zero = 0
and ldpl.order_package_status = '20'
and ldpl.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findZeroTrunklineHandOrderData" resultType="com.alibaba.fastjson.JSONObject">
select IFNULL(count(distinct lww.waybill_no),0) waybillNum,
IFNULL(sum(ldsa.hand_quantity),0) handleNum,
0 handleWeight,
0 handleVolume
from logpm_distribution_stock_article ldsa
left join logpm_warehouse_waybill lww on lww.departure_warehouse_id = ldsa.warehouse_id and lww.waybill_no = ldsa.order_code
where 1=1
and ldsa.hand_quantity > 0
and ldsa.is_zero = 1
and ldsa.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="trunklineCarsData" resultType="com.logpm.report.vo.IndexTrunklineCarsDataVO">
select IFNULL(count(distinct load_id),0) totalNum,
IFNULL(sum(if(node_status = '0',1,0)),0) inTransitNum,
IFNULL(sum(if(node_status != '0',1,0)),0) workNum,
IFNULL(sum(if(unload_status != '0',1,0)),0) unloadNum
from logpm_trunkline_cars_load_line
where 1=1
and is_deleted = 0
and node_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findAbnormalData" resultType="com.alibaba.fastjson.JSONObject">
select IFNULL(count(id),0) sendNum,
IFNULL(sum(abnormal_status),0) dealNum
from logpm_aftersales_abnormal_record
where 1=1
<if test="param.startDate != null">
and create_time &gt;= #{param.startDate}
</if>
<if test="param.endDate != null">
and create_time &lt;= #{param.endDate}
</if>
and warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findUnloadNum" resultType="int">
select IFNULL(sum(unload_number),0)
from logpm_trunkline_cars_load_line
where 1=1
and is_deleted = 0
and unload_status != '0'
<if test="param.startDate != null">
and unload_date &gt;= #{param.startDate}
</if>
<if test="param.endDate != null">
and unload_date &lt;= #{param.endDate}
</if>
and node_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>

21
blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java

@ -0,0 +1,21 @@
package com.logpm.report.service;
import com.logpm.report.dto.IndexDTO;
import com.logpm.report.vo.*;
public interface IWarehouseIndexService {
IndexOpenOrderDataVO openOrderData(IndexDTO indexDTO);
IndexOpenOrderIncomeVO openOrderIncome(IndexDTO indexDTO);
IndexHandOrderDataVO handOrderData(IndexDTO indexDTO);
IndexAllocationDataVO allocationData(IndexDTO indexDTO);
IndexTrunklineHandOrderDataVO trunklineHandOrderData(IndexDTO indexDTO);
IndexTrunklineCarsDataVO trunklineCarsData(IndexDTO indexDTO);
IndexUnloadAbnormalDataVO unloadAbnormalData(IndexDTO indexDTO);
}

239
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java

@ -0,0 +1,239 @@
package com.logpm.report.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.logpm.report.dto.IndexDTO;
import com.logpm.report.mapper.WarehouseIndexMapper;
import com.logpm.report.service.IWarehouseIndexService;
import com.logpm.report.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.utils.CommonUtil;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@Slf4j
@Service
@AllArgsConstructor
public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
private WarehouseIndexMapper warehouseIndexMapper;
@Override
public IndexOpenOrderDataVO openOrderData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexOpenOrderDataVO indexOpenOrderDataVO = new IndexOpenOrderDataVO();
if(warehouseIds.isEmpty()){
return indexOpenOrderDataVO;
}
indexOpenOrderDataVO.setTotalNum(warehouseIndexMapper.findTotalNum(indexDTO));
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
Date dayStart = calendar.getTime();
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
Date dayEnd = calendar.getTime();
indexDTO.setStartDate(dayStart);
indexDTO.setEndDate(dayEnd);
indexOpenOrderDataVO.setDayNum(warehouseIndexMapper.findTotalNum(indexDTO));
// 设置日为1,以获取当前月的第一天
calendar.set(Calendar.DAY_OF_MONTH, 1);
// 将小时、分钟、秒和毫秒设置为0,确保获取的是完整的第一天
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
Date firstDayOfMonth = calendar.getTime(); // 获取第一天
// 获取下个月的第一天
calendar.add(Calendar.MONTH, 1);
// 再将日减1,以得到当前月的最后一天
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.add(Calendar.DATE, -1);
// 同样确保时间部分为0
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
Date lastDayOfMonth = calendar.getTime(); // 获取最后一天
indexDTO.setStartDate(firstDayOfMonth);
indexDTO.setEndDate(lastDayOfMonth);
indexOpenOrderDataVO.setMonthNum(warehouseIndexMapper.findTotalNum(indexDTO));
return indexOpenOrderDataVO;
}
@Override
public IndexOpenOrderIncomeVO openOrderIncome(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexOpenOrderIncomeVO indexOpenOrderIncomeVO = new IndexOpenOrderIncomeVO();
if(warehouseIds.isEmpty()){
return indexOpenOrderIncomeVO;
}
//总收入
indexOpenOrderIncomeVO.setTotalFee(warehouseIndexMapper.findTotalFee(indexDTO));
//获取当天的开始时间
indexDTO.setStartDate(CommonUtil.getDayStart());
indexDTO.setEndDate(CommonUtil.getDayEnd());
JSONObject incomeDay = warehouseIndexMapper.findFeeByDate(indexDTO);
indexOpenOrderIncomeVO.setDayFee(incomeDay.getBigDecimal("fee"));
indexOpenOrderIncomeVO.setDayBillladingFee(incomeDay.getBigDecimal("billladingFee"));
indexOpenOrderIncomeVO.setDayInstallFee(incomeDay.getBigDecimal("installFee"));
indexOpenOrderIncomeVO.setDayTrunklineFee(incomeDay.getBigDecimal("trunklineFee"));
indexOpenOrderIncomeVO.setDayWarehouseFee(incomeDay.getBigDecimal("warehouseFee"));
indexOpenOrderIncomeVO.setDayDistributionFee(incomeDay.getBigDecimal("distributionFee"));
//获取当月的开始时间
indexDTO.setStartDate(CommonUtil.getMonthDayStart());
indexDTO.setEndDate(CommonUtil.getMonthDayEnd());
JSONObject incomeMonth = warehouseIndexMapper.findFeeByDate(indexDTO);
indexOpenOrderIncomeVO.setMonthFee(incomeMonth.getBigDecimal("fee"));
indexOpenOrderIncomeVO.setMonthBillladingFee(incomeMonth.getBigDecimal("billladingFee"));
indexOpenOrderIncomeVO.setMonthInstallFee(incomeMonth.getBigDecimal("installFee"));
indexOpenOrderIncomeVO.setMonthTrunklineFee(incomeMonth.getBigDecimal("trunklineFee"));
indexOpenOrderIncomeVO.setMonthWarehouseFee(incomeMonth.getBigDecimal("warehouseFee"));
indexOpenOrderIncomeVO.setMonthDistributionFee(incomeMonth.getBigDecimal("distributionFee"));
return indexOpenOrderIncomeVO;
}
@Override
public IndexHandOrderDataVO handOrderData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexHandOrderDataVO indexHandOrderDataVO = new IndexHandOrderDataVO();
if(warehouseIds.isEmpty()){
return indexHandOrderDataVO;
}
//当前在库的数据 订制品 零担
indexHandOrderDataVO = warehouseIndexMapper.handOrderData(indexDTO);
//当前在库的库存品
Integer stockListNum = warehouseIndexMapper.findHandStockListNum(indexDTO);
indexHandOrderDataVO.setTotalNum(indexHandOrderDataVO.getTotalNum() + stockListNum);
//已打托数量
Integer trayNum = warehouseIndexMapper.findTrayNum(indexDTO);
indexHandOrderDataVO.setTrayNum(trayNum);
return indexHandOrderDataVO;
}
@Override
public IndexAllocationDataVO allocationData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexAllocationDataVO indexAllocationDataVO = new IndexAllocationDataVO();
if(warehouseIds.isEmpty()){
return indexAllocationDataVO;
}
//当前在库的数据 订制品 零担
IndexHandOrderDataVO indexHandOrderDataVO = warehouseIndexMapper.handOrderData(indexDTO);
//当前在库的库存品
Integer stockListNum = warehouseIndexMapper.findHandStockListNum(indexDTO);
Integer totalNum = indexHandOrderDataVO.getTotalNum() + stockListNum;
//查询库位总数
Integer totalAllocationNum = warehouseIndexMapper.findTotalAllocationNum(indexDTO);
//已使用库位数
Integer useAllocationNum = warehouseIndexMapper.findUseAllocationNum(indexDTO);
//已上架件数
Integer upshelfNum = warehouseIndexMapper.findUpshelfNum(indexDTO);
indexAllocationDataVO.setTotalNum(totalAllocationNum);
indexAllocationDataVO.setUseNum(useAllocationNum);
indexAllocationDataVO.setNullNum(totalAllocationNum - useAllocationNum);
indexAllocationDataVO.setUpshelfNum(upshelfNum);
indexAllocationDataVO.setNoUpshelfNum(totalNum-upshelfNum);
return indexAllocationDataVO;
}
@Override
public IndexTrunklineHandOrderDataVO trunklineHandOrderData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexTrunklineHandOrderDataVO indexTrunklineHandOrderDataVO = new IndexTrunklineHandOrderDataVO();
if(warehouseIds.isEmpty()){
return indexTrunklineHandOrderDataVO;
}
//订制品
JSONObject packageJson = warehouseIndexMapper.findPackageTrunklineHandOrderData(indexDTO);
Integer packageWaybillNum = packageJson.getInteger("waybillNum");
Integer packageHandleNum = packageJson.getInteger("handleNum");
BigDecimal packageHandleWeight = packageJson.getBigDecimal("handleWeight");
BigDecimal packageHandleVolume = packageJson.getBigDecimal("handleVolume");
//零担
JSONObject zeroJson = warehouseIndexMapper.findZeroTrunklineHandOrderData(indexDTO);
Integer zeroWaybillNum = zeroJson.getInteger("waybillNum");
Integer zeroHandleNum = zeroJson.getInteger("handleNum");
BigDecimal zeroHandleWeight = zeroJson.getBigDecimal("handleWeight");
BigDecimal zeroHandleVolume = zeroJson.getBigDecimal("handleVolume");
indexTrunklineHandOrderDataVO.setWaybillNum(packageWaybillNum + zeroWaybillNum);
indexTrunklineHandOrderDataVO.setHandleNum(packageHandleNum + zeroHandleNum);
indexTrunklineHandOrderDataVO.setHandleWeight(packageHandleWeight.add(zeroHandleWeight));
indexTrunklineHandOrderDataVO.setHandleVolume(packageHandleVolume.add(zeroHandleVolume));
return indexTrunklineHandOrderDataVO;
}
@Override
public IndexTrunklineCarsDataVO trunklineCarsData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexTrunklineCarsDataVO indexTrunklineCarsDataVO = new IndexTrunklineCarsDataVO();
if(warehouseIds.isEmpty()){
return indexTrunklineCarsDataVO;
}
indexTrunklineCarsDataVO = warehouseIndexMapper.trunklineCarsData(indexDTO);
return indexTrunklineCarsDataVO;
}
@Override
public IndexUnloadAbnormalDataVO unloadAbnormalData(IndexDTO indexDTO) {
List<Long> warehouseIds = indexDTO.getWarehouseIds();
IndexUnloadAbnormalDataVO indexUnloadAbnormalDataVO = new IndexUnloadAbnormalDataVO();
if(warehouseIds.isEmpty()){
return indexUnloadAbnormalDataVO;
}
indexDTO.setStartDate(CommonUtil.getDayStart());
indexDTO.setEndDate(CommonUtil.getDayEnd());
JSONObject dayJson = warehouseIndexMapper.findAbnormalData(indexDTO);
Integer sendDayNum = dayJson.getInteger("sendNum");
Integer dealDayNum = dayJson.getInteger("dealNum");
Integer unloadDayNum = warehouseIndexMapper.findUnloadNum(indexDTO);
indexUnloadAbnormalDataVO.setSendDayNum(sendDayNum);
indexUnloadAbnormalDataVO.setNoDealDayNum(sendDayNum - dealDayNum);
indexUnloadAbnormalDataVO.setUnloadDayNum(unloadDayNum);
BigDecimal dayRate = BigDecimal.ZERO;
if(!unloadDayNum.equals(0)){
dayRate = new BigDecimal(sendDayNum).divide(new BigDecimal(unloadDayNum), 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
}
indexUnloadAbnormalDataVO.setAbnormalDayRate(dayRate);
indexDTO.setStartDate(CommonUtil.getMonthDayStart());
indexDTO.setEndDate(CommonUtil.getMonthDayEnd());
JSONObject monthJson = warehouseIndexMapper.findAbnormalData(indexDTO);
Integer sendMonthNum = monthJson.getInteger("sendNum");
Integer dealMonthNum = monthJson.getInteger("dealNum");
Integer unloadMonthNum = warehouseIndexMapper.findUnloadNum(indexDTO);
indexUnloadAbnormalDataVO.setSendMonthNum(sendMonthNum);
indexUnloadAbnormalDataVO.setNoDealMonthNum(sendMonthNum - dealMonthNum);
indexUnloadAbnormalDataVO.setUnloadMonthNum(unloadMonthNum);
BigDecimal monthRate = BigDecimal.ZERO;
if(!unloadMonthNum.equals(0)){
monthRate = new BigDecimal(sendMonthNum).divide(new BigDecimal(unloadMonthNum),4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
}
indexUnloadAbnormalDataVO.setAbnormalMonthRate(monthRate);
return indexUnloadAbnormalDataVO;
}
}

16
blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexAllocationDataVO.java

@ -0,0 +1,16 @@
package com.logpm.report.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class IndexAllocationDataVO implements Serializable {
private Integer totalNum = 0;
private Integer useNum = 0;
private Integer nullNum = 0;
private Integer upshelfNum = 0;
private Integer noUpshelfNum = 0;
}

18
blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexHandOrderDataVO.java

@ -0,0 +1,18 @@
package com.logpm.report.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class IndexHandOrderDataVO implements Serializable {
private Integer totalNum = 0;
private Integer zeroNum = 0;
private Integer thirdTransferNum = 0;
private Integer mallNum = 0;
private Integer cityNum = 0;
private Integer billNum = 0;
private Integer trayNum = 0;
}

15
blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexOpenOrderDataVO.java

@ -0,0 +1,15 @@
package com.logpm.report.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class IndexOpenOrderDataVO implements Serializable {
private int totalNum = 0;
private int monthNum = 0;
private int dayNum = 0;
}

26
blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexOpenOrderIncomeVO.java

@ -0,0 +1,26 @@
package com.logpm.report.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class IndexOpenOrderIncomeVO implements Serializable {
private BigDecimal totalFee = BigDecimal.ZERO;
private BigDecimal monthFee = BigDecimal.ZERO;
private BigDecimal monthTrunklineFee = BigDecimal.ZERO;
private BigDecimal monthWarehouseFee = BigDecimal.ZERO;
private BigDecimal monthDistributionFee = BigDecimal.ZERO;
private BigDecimal monthBillladingFee = BigDecimal.ZERO;
private BigDecimal monthInstallFee = BigDecimal.ZERO;
private BigDecimal dayFee = BigDecimal.ZERO;
private BigDecimal dayTrunklineFee = BigDecimal.ZERO;
private BigDecimal dayWarehouseFee = BigDecimal.ZERO;
private BigDecimal dayDistributionFee = BigDecimal.ZERO;
private BigDecimal dayBillladingFee = BigDecimal.ZERO;
private BigDecimal dayInstallFee = BigDecimal.ZERO;
}

16
blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexTrunklineCarsDataVO.java

@ -0,0 +1,16 @@
package com.logpm.report.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class IndexTrunklineCarsDataVO implements Serializable {
private Integer totalNum = 0;
private Integer inTransitNum = 0;
private Integer workNum = 0;
private Integer unloadNum = 0;
}

16
blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexTrunklineHandOrderDataVO.java

@ -0,0 +1,16 @@
package com.logpm.report.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class IndexTrunklineHandOrderDataVO implements Serializable {
private Integer waybillNum = 0;
private Integer handleNum = 0;
private BigDecimal handleWeight = BigDecimal.ZERO;
private BigDecimal handleVolume = BigDecimal.ZERO;
}

21
blade-service/logpm-report/src/main/java/com/logpm/report/vo/IndexUnloadAbnormalDataVO.java

@ -0,0 +1,21 @@
package com.logpm.report.vo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class IndexUnloadAbnormalDataVO implements Serializable {
private Integer sendDayNum = 0;
private Integer noDealDayNum = 0;
private Integer unloadDayNum = 0;
private BigDecimal abnormalDayRate = BigDecimal.ZERO;
private Integer sendMonthNum = 0;
private Integer noDealMonthNum = 0;
private Integer unloadMonthNum = 0;
private BigDecimal abnormalMonthRate = BigDecimal.ZERO;
}

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

@ -359,13 +359,16 @@
ltcl.start_time startTime,
ltcl.plan_loading_number planLoadingNumber,
ltcl.real_loading_number realLoadingNumber,
ltcl.unload_number unloadNumber,
ltcl.delivery_type deliveryType,
ltcl.operator operator,
ltcl.create_time createTime,
ltcl.settlement_value settlementValue,
ltcl.settlement_person settlementPerson,
ltcl.sign_time signTime
ltcl.sign_time signTime,
IFNULL(sum(ltcls.num),0) signNum
from logpm_trunkline_cars_load ltcl
left join logpm_trunkline_cars_load_scan ltcls on ltcls.load_id = ltcl.id and ltcls.scan_status = '3'
where ltcl.is_deleted = 0
and ltcl.load_type = '4'
<if test="param.warehouseId != null" >
@ -383,6 +386,7 @@
<if test="param.endTime != null">
and ltcl.create_time &lt;= #{param.endTime}
</if>
group by ltcl.id
order by ltcl.create_time desc
</select>

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

@ -91,7 +91,7 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
List<LoadingListGoodsVO> findUnloadGoods(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo);
void updateScanStatusAndTime(@Param("loadScanIds") List<Long> loadScanIds, @Param("scanStatus") String scanStatus, @Param("unloadTime") Date unloadTime);
void updateScanStatusAndTime(@Param("loadScanIds") List<Long> loadScanIds, @Param("scanStatus") String scanStatus, @Param("unloadTime") Date unloadTime,@Param("signUserName") String signUserName);
List<LoadScanWaybillVO> findLoadScanWaybillList(@Param("loadId") Long loadId, @Param("nodeId") Long nodeId);

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

@ -151,7 +151,7 @@
<if test="param.destinationWarehouseName != null and param.destinationWarehouseName != ''">
and Locate(#{param.destinationWarehouseName},lww.destination_warehouse_name) > 0
</if>
order by cls.loading_abnormal desc,cls.unload_abnormal desc,cls.create_time asc
</select>
<select id="findCarsLoadingOrderDetail" resultType="com.logpm.trunkline.vo.OrderScanDetailVO">
@ -472,7 +472,8 @@
<update id="updateScanStatusAndTime">
update logpm_trunkline_cars_load_scan
set scan_status = #{scanStatus},
sign_time = #{unloadTime}
sign_time = #{unloadTime},
sign_user_name = #{signUserName}
where 1=1
<if test="loadScanIds != null and loadScanIds.size() > 0">
and id in

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

@ -45,9 +45,9 @@ public interface TrunklineCarsOrderMapper extends BaseMapper<TrunklineCarsOrderE
List<TrunklineLoadSignOrderEntity> findSignOrderListBy(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
List<SignScanOrderVO> findSignOrderList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
List<SignScanOrderVO> findSignOrderList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId,@Param("signOrderId") Long signOrderId);
List<SignScanOrderVO> findSignZeroOrderList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
List<SignScanOrderVO> findSignZeroOrderList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId,@Param("signOrderId") Long signOrderId);
Integer findSignNumBySignOrderId(@Param("signOrderId") Long signOrderId);

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

@ -109,6 +109,7 @@
wb.create_time createTime,
wb.destination destination,
wb.destination_warehouse_name destinationWarehouseName,
IF(wb.check_user_id IS NULL , 0,1) checkStatus,
wb.shipper shipper,
wb.shipper_name shipperName,
wb.consignee consignee,
@ -176,8 +177,10 @@
IFNULL(lww.total_freight/lww.total_count*ltwo.total_number,0) orderFreight,
IFNULL(lww.total_freight/lww.total_count*ltco.unload_num,0) unloadIncome,
IFNULL(lww.total_freight/lww.total_count*ltco.plan_num,0) orderLineCost,
sum(ltwo.total_number) orderNum
sum(ltwo.total_number) orderNum,
sum(IF(ltcls.scan_status = '3',ltcls.num,0)) signNum
from logpm_trunkline_cars_order ltco
left join logpm_trunkline_cars_load_scan ltcls on ltcls.waybill_no = ltco.waybill_no and ltcls.order_code = ltco.order_code
left join logpm_trunkline_waybill_order ltwo on ltwo.order_code = ltco.order_code and ltwo.waybill_no = ltco.waybill_no and ltwo.is_deleted = 0
left join logpm_warehouse_waybill lww on lww.waybill_no = ltwo.waybill_no
where ltco.load_id = #{loadId}
@ -254,6 +257,7 @@
from logpm_trunkline_cars_order ltco
where ltco.load_id = #{loadId}
and ltco.node_id = #{warehouseId}
and ltco.sign_order_id = #{signOrderId}
and ltco.type = 1
and ltco.is_customer = '1'
</select>
@ -266,6 +270,7 @@
from logpm_trunkline_cars_order ltco
where ltco.load_id = #{loadId}
and ltco.node_id = #{warehouseId}
and ltco.sign_order_id = #{signOrderId}
and ltco.type = 2
and ltco.is_customer = '1'
</select>

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

@ -86,7 +86,7 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<LoadingListGoodsVO> findUnloadGoods(Long loadId, Long warehouseId, String orderCode, String waybillNo);
void updateScanStatusAndTime(List<Long> loadScanIds, String scanStatus,Date unloadTime);
void updateScanStatusAndTime(List<Long> loadScanIds, String scanStatus,Date unloadTime,String signUserName);
List<LoadScanWaybillVO> findLoadScanWaybillList(Long loadId, Long nodeId);

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

@ -42,9 +42,9 @@ public interface ITrunklineCarsOrderService extends BaseService<TrunklineCarsOrd
List<TrunklineLoadSignOrderEntity> findSignOrderListBy(Long loadId, Long warehouseId);
List<SignScanOrderVO> findSignOrderList(Long loadId, Long warehouseId);
List<SignScanOrderVO> findSignOrderList(Long loadId, Long warehouseId,Long signOrderId);
List<SignScanOrderVO> findSignZeroOrderList(Long loadId, Long warehouseId);
List<SignScanOrderVO> findSignZeroOrderList(Long loadId, Long warehouseId,Long signOrderId);
Integer findSignNumBySignOrderId(Long signOrderId);

47
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadLogServiceImpl.java

@ -1,10 +1,13 @@
package com.logpm.trunkline.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLogEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.mapper.TrunklineCarsLoadLogMapper;
import com.logpm.trunkline.service.ITrunklineCarsLoadLogService;
import com.logpm.trunkline.service.ITrunklineCarsLoadScanService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
@ -14,12 +17,16 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@Slf4j
@Service
@AllArgsConstructor
public class TrunklineCarsLoadLogServiceImpl extends BaseServiceImpl<TrunklineCarsLoadLogMapper, TrunklineCarsLoadLogEntity> implements ITrunklineCarsLoadLogService {
private final ITrunklineCarsLoadScanService carsLoadScanService;
@Override
public void saveLog(TrunklineCarsLoadEntity carsLoadEntity, TrunklineCarsLoadLineEntity carsLoadLineEntity, int cardLoadType) {
String nodeName = null;
@ -34,6 +41,7 @@ public class TrunklineCarsLoadLogServiceImpl extends BaseServiceImpl<TrunklineCa
startDate = carsLoadLineEntity.getStartDate();
nodeId = carsLoadLineEntity.getNodeId();
}
Long loadId = carsLoadEntity.getId();
String carsNo = carsLoadEntity.getCarsNo();
String carNumber = carsLoadEntity.getCarNumber();
String driverName = carsLoadEntity.getDriverName();
@ -44,7 +52,7 @@ public class TrunklineCarsLoadLogServiceImpl extends BaseServiceImpl<TrunklineCa
TrunklineCarsLoadLogEntity carsLoadLogEntity = new TrunklineCarsLoadLogEntity();
carsLoadLogEntity.setNodeId(nodeId);
carsLoadLogEntity.setNodeName(nodeName);
carsLoadLogEntity.setLoadId(carsLoadEntity.getId());
carsLoadLogEntity.setLoadId(loadId);
carsLoadLogEntity.setLoadCode(carsNo);
carsLoadLogEntity.setCarNumber(carNumber);
carsLoadLogEntity.setDriverName(driverName);
@ -117,6 +125,26 @@ public class TrunklineCarsLoadLogServiceImpl extends BaseServiceImpl<TrunklineCa
content = "【"+nodeName+"】终点卸车,车次号:"+carsNo+",车牌号:"+carNumber+",司机姓名:"+driverName+
",司机手机号:"+driverMobile+",终点卸车时间:"+ now;
break;
case 16:
QueryWrapper<TrunklineCarsLoadScanEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("load_id",loadId)
.eq("scan_status","3");
List<TrunklineCarsLoadScanEntity> list = carsLoadScanService.list(queryWrapper);
Integer signNum = 0;
if(!list.isEmpty()){
signNum = list.size();
}
content = "【"+nodeName+"】三方中转签收,车次号:"+carsNo+",车牌号:"+carNumber+",司机姓名:"+driverName+
",司机手机号:"+driverMobile+",签收件数:"+ signNum + "/" + realLoadingNumber + "件";
break;
case 17:
content = "【"+nodeName+"】三方中转结算,车次号:"+carsNo+",车牌号:"+carNumber+",司机姓名:"+driverName+
",司机手机号:"+driverMobile+",结算时间:"+ now;
break;
case 18:
content = "【"+nodeName+"】直发商家签收,车次号:"+carsNo+",车牌号:"+carNumber+",司机姓名:"+driverName+
",司机手机号:"+driverMobile+",签收时间:"+ now;
break;
default:
content = "【"+nodeName+"】其他日志,车次号:"+carsNo+",车牌号:"+carNumber+",司机姓名:"+driverName+
",司机手机号:"+driverMobile;
@ -124,6 +152,21 @@ public class TrunklineCarsLoadLogServiceImpl extends BaseServiceImpl<TrunklineCa
carsLoadLogEntity.setContent(content);
carsLoadLogEntity.setType(cardLoadType);
carsLoadLogEntity.setCreateUserName(AuthUtil.getNickName());
save(carsLoadLogEntity);
if(CarsLoadLogTypeConstant.TRIPARTITE_TRANSFER_SIGN.getValue().equals(cardLoadType)){
QueryWrapper<TrunklineCarsLoadLogEntity> qw = new QueryWrapper<>();
qw.eq("node_id",nodeId)
.eq("load_id",loadId)
.eq("type",cardLoadType);
TrunklineCarsLoadLogEntity carsLoadLogEntity1 = baseMapper.selectOne(qw);
if(Objects.isNull(carsLoadLogEntity1)){
save(carsLoadLogEntity);
}else{
carsLoadLogEntity1.setContent(content);
updateById(carsLoadLogEntity1);
}
}else{
save(carsLoadLogEntity);
}
}
}

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

@ -203,8 +203,8 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
}
@Override
public void updateScanStatusAndTime(List<Long> loadScanIds, String scanStatus,Date unloadTime) {
baseMapper.updateScanStatusAndTime(loadScanIds,scanStatus,unloadTime);
public void updateScanStatusAndTime(List<Long> loadScanIds, String scanStatus,Date unloadTime,String signUserName) {
baseMapper.updateScanStatusAndTime(loadScanIds,scanStatus,unloadTime,signUserName);
}
@Override

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

@ -2028,6 +2028,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId, "3", new Date());
try {
trunklineCarsLoadLogService.saveLog(carsLoadEntity, null, CarsLoadLogTypeConstant.TRIPARTITE_TRANSFER_SIGN.getValue());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodes(loadId);
String content = "包件在" + warehouseEntity.getName() + "被三方中转整车签收";
@ -2065,6 +2067,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadEntity.setSettlementPersonId(AuthUtil.getUserId());
updateById(carsLoadEntity);
trunklineCarsLoadLogService.saveLog(carsLoadEntity, null, CarsLoadLogTypeConstant.TRIPARTITE_TRANSFER_SETTLEMENT.getValue());
return R.success("结算成功");
}
@ -2363,8 +2367,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}catch (Exception e){
log.error("推送数据失败",e);
}
return Resp.scanFail(3001,"装车成功",audio);
// return Resp.scanSuccess("装车成功",audio);
return Resp.scanSuccess("装车成功",audio);
}
private void pushFactoryOrderData(Long warehouseId, String orderPackageCode, String orderCode) {
@ -2550,7 +2553,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
2, isData, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark);
updateNumByLoadId(loadId);
return Resp.scanFail(3001,"装车成功",audio);
return Resp.scanSuccess("装车成功",audio);
}
@Override
@ -2908,17 +2911,17 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadWaybillInfoVO.setOpenPrice(openPrice);
carsLoadWaybillInfoVO.setGoodsName(productNames);
List<CarsLoadOrderInfoVO> carsLoadOrderInfoList = trunklineCarsOrderService.findCarsLoadOrderInfoList(loadId, waybillNo);
// List<CarsLoadOrderInfoVO> carsLoadOrderInfoList = trunklineCarsOrderService.findCarsLoadOrderInfoList(loadId, waybillNo);
// List<CarsLoadOrderInfoVO> carsLoadOrderInfoListPlan = trunklineCarsOrderService.findCarsLoadOrderInfoListPlan(loadId, waybillNo);
List<CarsLoadOrderInfoVO> carsLoadOrderInfoListPlan = trunklineCarsOrderService.findCarsLoadOrderInfoListPlan(loadId, waybillNo);
carsLoadOrderInfoList.forEach(carsLoadOrderInfoVO -> {
carsLoadOrderInfoListPlan.forEach(carsLoadOrderInfoVO -> {
carsLoadOrderInfoVO.setUnloadIncome(carsLoadOrderInfoVO.getUnloadIncome().setScale(2, BigDecimal.ROUND_HALF_UP));
carsLoadOrderInfoVO.setOrderFreight(carsLoadOrderInfoVO.getOrderFreight().setScale(2, BigDecimal.ROUND_HALF_UP));
});
carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoList);
carsLoadWaybillInfoVO.setCarsLoadOrderInfoList(carsLoadOrderInfoListPlan);
// carsLoadWaybillInfoVO.setCarsLoadOrderInfoListPlan(carsLoadOrderInfoListPlan);
TrunklineCostShareRecordEntity costShareRecordEntity = trunklineCostShareRecordService.findTotalUnloadNumByLoadAndWaybillNo(loadId, waybillNo);
@ -3383,6 +3386,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCarsLoadScanEntity.setUnloadNodeId(warehouseId);
trunklineCarsLoadScanEntity.setUnloadNum(1);
trunklineCarsLoadScanEntity.setUnloadTime(new Date());
trunklineCarsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
trunklineCarsLoadScanEntity.setIsSupple(0);
trunklineCarsLoadScanService.save(trunklineCarsLoadScanEntity);
Long loadScanId = trunklineCarsLoadScanEntity.getId();
@ -3561,6 +3565,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadNodeName(warehouseName);
carsLoadScanEntity.setUnloadAbnormal(0);
carsLoadScanEntity.setUnloadTime(new Date());
carsLoadScanEntity.setUnloadUserName(AuthUtil.getNickName());
carsLoadScanEntity.setScanStatus("2");
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
@ -4137,7 +4142,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
loadCarsDTO.setUserId(AuthUtil.getUserId());
loadCarsDTO.setEnterTimeStart(CommonUtil.getStartByDateStr(loadCarsDTO.getEnterTimeStartStr()));
loadCarsDTO.setEnterTimeEnd(CommonUtil.getStartByDateStr(loadCarsDTO.getEnterTimeEndStr()));
loadCarsDTO.setEnterTimeEnd(CommonUtil.getEndByDateStr(loadCarsDTO.getEnterTimeEndStr()));
IPage<TrunklineLoadSignOrderVO> pageList = trunklineLoadSignOrderService.finaSignOrderList(page, loadCarsDTO);
@ -4165,7 +4170,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long warehouseId = signOrderVO.getWarehouseId();
//查询订单列表
List<SignScanOrderVO> signScanOrderList = trunklineCarsOrderService.findSignOrderList(loadId, warehouseId);
List<SignScanOrderVO> signScanOrderList = trunklineCarsOrderService.findSignOrderList(loadId, warehouseId,signOrderId);
for (SignScanOrderVO signScanOrderVO : signScanOrderList) {
String waybillNo = signScanOrderVO.getWaybillNo();
String orderCode = signScanOrderVO.getOrderCode();
@ -4173,7 +4178,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
signScanOrderVO.setSignPackageList(signPackageList);
}
List<SignScanOrderVO> signScanZeroOrderList = trunklineCarsOrderService.findSignZeroOrderList(loadId, warehouseId);
List<SignScanOrderVO> signScanZeroOrderList = trunklineCarsOrderService.findSignZeroOrderList(loadId, warehouseId,signOrderId);
for (SignScanOrderVO signScanOrderVO : signScanZeroOrderList) {
String waybillNo = signScanOrderVO.getWaybillNo();
String orderCode = signScanOrderVO.getOrderCode();
@ -4887,7 +4892,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
Date date = new Date();
trunklineCarsLoadScanService.updateScanStatusAndTime(loadScanIds, "3", new Date());
trunklineCarsLoadScanService.updateScanStatusAndTime(loadScanIds, "3", new Date(),AuthUtil.getNickName());
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodesByIds(loadScanIds);
@ -6124,7 +6129,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
if (isData == 0) {
return Resp.scanFail("卸车成功", "系统无数据");
return Resp.scanSuccess("卸车成功", "系统无编码");
}
return R.success("卸车成功");
}

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java

@ -99,13 +99,13 @@ public class TrunklineCarsOrderEntityServiceImpl extends BaseServiceImpl<Trunkli
}
@Override
public List<SignScanOrderVO> findSignOrderList(Long loadId, Long warehouseId) {
return baseMapper.findSignOrderList(loadId,warehouseId);
public List<SignScanOrderVO> findSignOrderList(Long loadId, Long warehouseId,Long signOrderId) {
return baseMapper.findSignOrderList(loadId,warehouseId,signOrderId);
}
@Override
public List<SignScanOrderVO> findSignZeroOrderList(Long loadId, Long warehouseId) {
return baseMapper.findSignZeroOrderList(loadId,warehouseId);
public List<SignScanOrderVO> findSignZeroOrderList(Long loadId, Long warehouseId,Long signOrderId) {
return baseMapper.findSignZeroOrderList(loadId,warehouseId,signOrderId);
}
@Override

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

@ -68,4 +68,5 @@ public interface WarehouseWaybillMapper extends BaseMapper<WarehouseWaybillEntit
List<WarehouseWaybillEntity> findWaybillBilllByWaybillNos(@Param("waybillNos") List<String> waybillNos);
List<ExportWarehouseWaybillVO> exportWaybillList(@Param("param") WarehouseWaybillDTO waybillDTO);
}

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

@ -0,0 +1,7 @@
package com.logpm.warehouse.service;
import org.springblade.common.model.FanoutMsg;
public interface ISendFanoutService {
void sendFanoutMsg(FanoutMsg fanoutMsg);
}

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

@ -80,4 +80,5 @@ public interface IWarehouseWaybillService extends BaseService<WarehouseWaybillEn
List<WarehouseWaybillEntity> findWaybillBilllByWaybillNos(List<String> waybillNos);
List<ExportWarehouseWaybillVO> exportWaybillList(WarehouseWaybillDTO waybillDTO);
}

27
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/SendFanoutServiceImpl.java

@ -0,0 +1,27 @@
package com.logpm.warehouse.service.impl;
import com.logpm.warehouse.service.ISendFanoutService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.model.FanoutMsg;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
@Slf4j
public class SendFanoutServiceImpl implements ISendFanoutService {
private final RabbitTemplate rabbitTemplate;
// @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(value = 3000, multiplier = 1.5))
@Override
public void sendFanoutMsg(FanoutMsg fanoutMsg) {
rabbitTemplate.convertAndSend(fanoutMsg.getExchange(),null, fanoutMsg.getMsg(), message -> {
message.getMessageProperties().setHeader("x-delay", 1000);
return message;
});
}
}

811
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

File diff suppressed because it is too large Load Diff

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

@ -174,7 +174,7 @@ public class WarehouseUpdownGoodsServiceImpl extends BaseServiceImpl<WarehouseUp
updownGoodsLogEntities.add(warehouseUpdownGoodsLogEntity);
parcelListEntity.setOrderPackageGroundingStatus("20");
// parcelListEntity.setOrderPackageGroundingStatus("20");
});

715
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -23,7 +23,9 @@ import com.logpm.warehouse.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.model.FanoutMsg;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
@ -58,6 +60,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
private final IWarehouseUpdownGoodsLogService warehouseUpdownGoodsLogService;
private final IBasicdataWarehouseClient warehouseClient;
private final IDistributionStockListInfoClient distributionStockListInfoClient;
private final ISendFanoutService sendFanoutService;
@Override
public boolean packageChangeStock(List<String> orderPackageCodes) {
@ -941,6 +944,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
String enableStatus = goodsAllocationEntity.getEnableStatus();
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId();
String qrCode = goodsAllocationEntity.getQrCode();
if ("2".equals(enableStatus)) {
log.warn("##############upShelfPackage: 库位已被禁用 allocationId={}", allocationId);
return R.fail(403, "库位已被禁用");
@ -1009,6 +1013,35 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//更新货位缓存
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
try{
//把parcelListEntityList通过conditions进行分组,conditions作为key
Map<Integer, List<DistributionParcelListEntity>> map = parcelListEntityList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getConditions));
map.keySet().forEach(conditions -> {
List<DistributionParcelListEntity> list = map.get(conditions);
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",1);
jsonObject.put("conditions",conditions);
jsonObject.put("operation",3);
//把list中所有元素的orderPackageCode提取出来存入一个List<String>
List<String> orderPackageCodes = list.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.toList());
jsonObject.put("orderPackageCodes",orderPackageCodes);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
});
}catch (Exception e){
log.warn("###########upShelfPackage: 发送打托广播失败");
}
// for (UpShelfPackageDTO upShelfPackageDTO : upShelfPackageList) {
// String orderPackageCode = upShelfPackageDTO.getOrderPackageCode();
// log.info("##############upShelfPackage: 当前处理的包件码 orderPackageCode={}", orderPackageCode);
@ -1159,6 +1192,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
return R.fail(403, "库位不存在");
}
String enableStatus = goodsAllocationEntity.getEnableStatus();
String qrCode = goodsAllocationEntity.getQrCode();
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId();
if ("2".equals(enableStatus)) {
log.warn("##############upShelfOrder: 库位已被禁用 allocationId={}", allocationId);
@ -1203,9 +1237,12 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
//
bindingAllocationAndZeroOrderAndLog(upShelfZeroOrderList, updownTypeEntity, remark);
List<String> orderCodes = new ArrayList<>();
for (UpShelfZeroOrderDTO upShelfZeroOrderDTO : upShelfZeroOrderList) {
num = num + upShelfZeroOrderDTO.getEnterNum();
updateZeroOrderGroundingStatus(upShelfZeroOrderDTO.getOrderCode(), warehouseId);
orderCodes.add(upShelfZeroOrderDTO.getOrderCode());
// updateZeroOrderGroundingStatus(upShelfZeroOrderDTO.getOrderCode(), warehouseId);
}
updateUpdownTypeNum(updownTypeEntity);
@ -1225,6 +1262,24 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
//更新货位缓存
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
try{
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",2);
jsonObject.put("operation",3);
jsonObject.put("orderCodes",orderCodes);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}catch (Exception e){
log.warn("###########upShelfPackage: 发送打托广播失败");
}
return Resp.scanSuccess("上架成功", "成功上架" + num + "条");
}
@ -1316,6 +1371,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
return R.fail(403, "库位不存在");
}
String enableStatus = goodsAllocationEntity.getEnableStatus();
String qrCode = goodsAllocationEntity.getQrCode();
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId();
if ("2".equals(enableStatus)) {
log.warn("##############upShelfOrder: 库位已被禁用 allocationId={}", allocationId);
@ -1380,6 +1436,36 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
if (s.length() > 0) {
msg = msg + s + "超出输入数量,或输入数量为0,请输入正确数量再进行操作";
}
try{
List<Long> stockListIds = new ArrayList<>();
upShelfStockList.forEach(upShelfStockDTO -> {
String materialCode = upShelfStockDTO.getMaterialCode();
String incomingBatch = upShelfStockDTO.getIncomingBatch();
Long marketId = upShelfStockDTO.getMarketId();
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, materialCode, incomingBatch, warehouseId);
if(!Objects.isNull(stockListEntity)){
stockListIds.add(stockListEntity.getId());
}
});
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",3);
jsonObject.put("operation",3);
jsonObject.put("stockListIds",stockListIds);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}catch (Exception e){
log.warn("###########saveTrayTypeByOrderPackageCode: 发送打托广播失败");
}
return Resp.scanSuccess(msg, "成功上架" + num + "件");
}
@ -1542,11 +1628,179 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
warehouseUpdownGoodsLogEntity.setWarehouseId(updownTypeEntity.getWarehouseId());
updownGoodsLogEntities.add(warehouseUpdownGoodsLogEntity);
parcelListEntity.setOrderPackageGroundingStatus("10");
// parcelListEntity.setOrderPackageGroundingStatus("10");
});
// updownParcelEntities.addAll(parcelListEntities);
});
removeByIds(toNullUpdownTypeIds);
if (!updateAllocationIds.isEmpty()) {
basicdataGoodsAllocationClient.updateListAllocationStatus(updateAllocationIds, "1");
}
if (!deleteTrayAllocationList.isEmpty()) {
warehouseTaryAllocationService.removeBatchByIds(deleteTrayAllocationList);
}
updateUpdownTypeList.forEach(this::updateUpdownTypeNum);
warehouseUpdownGoodsLogService.saveBatch(updownGoodsLogEntities);
// distributionParcelListClient.updateList(updownParcelEntities);
map.keySet().forEach(allocationId -> {
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
});
for (String orderCode : orderSet) {
distributionStockArticleClient.updateOrderInfo(orderCode, warehouseId);
}
num = num + updownGoodsLogEntities.size();
try{
//把parcelListEntityList中所有元素的conditions作为key进行分组成一个Map
Map<Integer, List<DistributionParcelListEntity>> listMap = parcelListEntityList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getConditions));
listMap.keySet().forEach(conditions -> {
List<DistributionParcelListEntity> ls = listMap.get(conditions);
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",1);
jsonObject.put("conditions",conditions);
jsonObject.put("operation",4);
//把ls中所有元素的orderPackageCode放入一个List
List<String> orderPackageCodes = ls.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.toList());
jsonObject.put("orderPackageCodes",orderPackageCodes);
jsonObject.put("warehouseId",warehouseId);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
});
}catch (Exception e){
log.warn("###########saveTrayTypeByOrderPackageCode: 发送打托广播失败");
}
return Resp.scanSuccess("下架成功", "成功下架" + num + "件");
}
private R downPackageNoFanout(List<UpShelfPackageDTO> upShelfPackageList, Long warehouseId, String remark) {
int num = 0;
Set<String> orderSet = new HashSet<>();
//把upShelfPackageList中的orderPackageCde提取到List中
List<String> orderPackageCodeList = upShelfPackageList.stream().map(UpShelfPackageDTO::getOrderPackageCode).collect(Collectors.toList());
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_type", "3")
.eq("warehouse_id", warehouseId)
.in("association_value", orderPackageCodeList);
List<WarehouseUpdownGoodsEntity> updownGoodsEntities = warehouseUpdownGoodsService.list(queryWrapper);
//把updownGoodsEntities的association_value提取到一个List中
List<String> associationValueList = updownGoodsEntities.stream().map(WarehouseUpdownGoodsEntity::getAssociationValue).collect(Collectors.toList());
FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderPackageCodeList(associationValueList);
findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
//把parcelListEntityList转化成orderPackageCode为key的Map
Map<String, DistributionParcelListEntity> parcelListEntityMap = parcelListEntityList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getOrderPackageCode, Function.identity()));
//把updownGoodsEntities通过allocatiionId进行分组
Map<Long, List<WarehouseUpdownGoodsEntity>> map = updownGoodsEntities.stream().collect(Collectors.groupingBy(WarehouseUpdownGoodsEntity::getAllocationId));
List<Long> allocationIds = new ArrayList<>(map.keySet());
QueryWrapper<WarehouseUpdownTypeEntity> updownTypeEntityQueryWrapper = new QueryWrapper<>();
updownTypeEntityQueryWrapper.in("allocation_id", allocationIds)
.eq("is_deleted", 0);
List<WarehouseUpdownTypeEntity> updownTypeList = list(updownTypeEntityQueryWrapper);
//把updownTypeList转化成allocationId为key的Map
Map<Long, WarehouseUpdownTypeEntity> updownTypeMap = updownTypeList.stream().collect(Collectors.toMap(WarehouseUpdownTypeEntity::getAllocationId, Function.identity()));
List<Long> toNullUpdownTypeIds = new ArrayList<>();
List<Long> updateAllocationIds = new ArrayList<>();
List<WarehouseTaryAllocationEntity> deleteTrayAllocationList = new ArrayList<>();
List<WarehouseUpdownTypeEntity> updateUpdownTypeList = new ArrayList<>();
List<WarehouseUpdownGoodsLogEntity> updownGoodsLogEntities = new ArrayList<>();
List<DistributionParcelListEntity> updownParcelEntities = new ArrayList<>();
map.keySet().forEach(allocationId -> {
QueryWrapper<WarehouseTaryAllocationEntity> taryAllocationEntityQueryWrapper = new QueryWrapper<>();
taryAllocationEntityQueryWrapper.eq("allocation_id", allocationId)
.eq("is_deleted", 0);
WarehouseTaryAllocationEntity taryAllocationEntity = warehouseTaryAllocationService.getOne(taryAllocationEntityQueryWrapper);
List<WarehouseUpdownGoodsEntity> updownGoodsEntities1 = map.get(allocationId);
List<String> orderPackageCodes = updownGoodsEntities1.stream().map(WarehouseUpdownGoodsEntity::getAssociationValue).collect(Collectors.toList());
if (!Objects.isNull(taryAllocationEntity)) {
warehouseTrayTypeService.downPackageByOrderPackageCodeList(orderPackageCodes, remark, warehouseId);
}
WarehouseUpdownTypeEntity updownTypeEntity = updownTypeMap.get(allocationId);
Long updownTypeId = updownTypeEntity.getId();
//把updownGoodsEntities1的id提取到List中
List<Long> updownGoodsIds = updownGoodsEntities1.stream().map(WarehouseUpdownGoodsEntity::getId).collect(Collectors.toList());
Integer residue = warehouseUpdownGoodsService.deleteByUpdownGoodsIds(updownGoodsIds, updownTypeEntity.getId());
if (residue == 0) {
//删除上架方式
toNullUpdownTypeIds.add(updownTypeId);
//修改库位状态为空闲
updateAllocationIds.add(allocationId);
// basicdataGoodsAllocationClient.updateAllocationStatus(allocationId, "1");
//如果有托盘还要删除托盘与库位的绑定
if (!Objects.isNull(taryAllocationEntity)) {
deleteTrayAllocationList.add(taryAllocationEntity);
// warehouseTaryAllocationService.deleteById(taryAllocationEntity);
}
} else {
updateUpdownTypeList.add(updownTypeEntity);
}
List<DistributionParcelListEntity> parcelListEntities = new ArrayList<>();
orderPackageCodes.forEach(orderPackageCode -> {
DistributionParcelListEntity parcelListEntity = parcelListEntityMap.get(orderPackageCode);
if (!Objects.isNull(parcelListEntity)) {
parcelListEntities.add(parcelListEntity);
}
});
parcelListEntities.forEach(parcelListEntity -> {
orderSet.add(parcelListEntity.getOrderCode());
WarehouseUpdownGoodsLogEntity warehouseUpdownGoodsLogEntity = new WarehouseUpdownGoodsLogEntity();
warehouseUpdownGoodsLogEntity.setCreateUser(1714696768639311873L);
warehouseUpdownGoodsLogEntity.setUpdateUser(1714696768639311873L);
warehouseUpdownGoodsLogEntity.setCreateDept(1649331096241836033L);
warehouseUpdownGoodsLogEntity.setTenantId(TenantNum.HUITONGCODE);
warehouseUpdownGoodsLogEntity.setUpdownTypeId(updownTypeEntity.getId());
warehouseUpdownGoodsLogEntity.setAreaId(updownTypeEntity.getAreaId());
warehouseUpdownGoodsLogEntity.setAreaTitle(updownTypeEntity.getAreaTitle());
warehouseUpdownGoodsLogEntity.setShelfId(updownTypeEntity.getShelfId());
warehouseUpdownGoodsLogEntity.setShelfTitle(updownTypeEntity.getShelfTitle());
warehouseUpdownGoodsLogEntity.setAllocationId(updownTypeEntity.getAllocationId());
warehouseUpdownGoodsLogEntity.setAllocationTitle(updownTypeEntity.getAllocationTitle());
warehouseUpdownGoodsLogEntity.setPositionCode(updownTypeEntity.getPositionCode());
warehouseUpdownGoodsLogEntity.setBindingType("2");
warehouseUpdownGoodsLogEntity.setIsAlltrays(0);
warehouseUpdownGoodsLogEntity.setAssociationId(parcelListEntity.getId());
warehouseUpdownGoodsLogEntity.setAssociationValue(parcelListEntity.getOrderPackageCode());
warehouseUpdownGoodsLogEntity.setAssociationType("3");
warehouseUpdownGoodsLogEntity.setNum(1);
warehouseUpdownGoodsLogEntity.setRemark(remark);
warehouseUpdownGoodsLogEntity.setWarehouseId(updownTypeEntity.getWarehouseId());
updownGoodsLogEntities.add(warehouseUpdownGoodsLogEntity);
// parcelListEntity.setOrderPackageGroundingStatus("10");
});
updownParcelEntities.addAll(parcelListEntities);
// updownParcelEntities.addAll(parcelListEntities);
});
@ -1562,7 +1816,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
warehouseUpdownGoodsLogService.saveBatch(updownGoodsLogEntities);
distributionParcelListClient.updateList(updownParcelEntities);
// distributionParcelListClient.updateList(updownParcelEntities);
map.keySet().forEach(allocationId -> {
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
@ -1572,11 +1826,12 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
distributionStockArticleClient.updateOrderInfo(orderCode, warehouseId);
}
num = num + updownParcelEntities.size();
num = num + updownGoodsLogEntities.size();
return Resp.scanSuccess("下架成功", "成功下架" + num + "件");
}
@Override
public R downDeliveryPackage(List<UpShelfPackageDTO> upShelfPackageList, Long warehouseId) {
int num = 0;
@ -1636,6 +1891,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
public R downPackageOrDelTray(List<UpShelfPackageDTO> upShelfPackageList, Long warehouseId, String remark) {
int num = 0;
Set<String> orderSet = new TreeSet<>();
List<String> orderPackageCodes = new ArrayList<>();
for (UpShelfPackageDTO upShelfPackageDTO : upShelfPackageList) {
String orderPackageCode = upShelfPackageDTO.getOrderPackageCode();
//查询包件在哪个库位上
@ -1686,16 +1942,50 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
}
warehouseUpdownGoodsLogService.saveAllocationAndPackage(updownTypeEntity, parcelListEntity, "2", 0, remark);
updatePackageGroundingStatus(orderPackageCode, "10", warehouseId);
// updatePackageGroundingStatus(orderPackageCode, "10", warehouseId);
updateUpdownTypeNum(updownTypeEntity);
orderSet.add(orderCode);
num = num + quantity;
orderPackageCodes.add(orderPackageCode);
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
}
for (String orderCode : orderSet) {
distributionStockArticleClient.updateOrderInfo(orderCode, warehouseId);
// for (String orderCode : orderSet) {
// distributionStockArticleClient.updateOrderInfo(orderCode, warehouseId);
// }
try{
FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderCodeList(orderPackageCodes);
findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
//把parcelListEntityList中所有元素的conditions作为key进行分组成一个Map
Map<Integer, List<DistributionParcelListEntity>> listMap = parcelListEntityList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getConditions));
listMap.keySet().forEach(conditions -> {
List<DistributionParcelListEntity> ls = listMap.get(conditions);
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",1);
jsonObject.put("conditions",conditions);
jsonObject.put("operation",4);
//把ls中所有元素的orderPackageCode放入一个List
List<String> packageCodes = ls.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.toList());
jsonObject.put("orderPackageCodes",packageCodes);
jsonObject.put("warehouseId",warehouseId);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
});
}catch (Exception e){
log.warn("###########saveTrayTypeByOrderPackageCode: 发送打托广播失败");
}
return Resp.scanSuccess("下架成功", "成功下架" + num + "件");
@ -1779,14 +2069,36 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
}
warehouseUpdownGoodsLogService.saveAllocationAndPackage(updownTypeEntity, parcelListEntity, "2", 0, remark);
if (isOrNo) {
updatePackageGroundingStatus(orderPackageCode, "10", warehouseId);
}
updateUpdownTypeNum(updownTypeEntity);
orderSet.add(orderCode);
// orderSet.add(orderCode);
num = num + quantity;
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
if (isOrNo) {
// updatePackageGroundingStatus(orderPackageCode, "10", warehouseId);
try{
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",1);
jsonObject.put("operation",4);
jsonObject.put("conditions",parcelListEntity.getConditions());
List<String> orderPackageCodes = new ArrayList<>();
orderPackageCodes.add(orderPackageCode);
jsonObject.put("orderPackageCodes",orderPackageCodes);
jsonObject.put("warehouseId",warehouseId);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}catch (Exception e){
log.warn("###########saveTrayTypeByOrderPackageCode: 发送打托广播失败");
}
}
}
}
@ -1794,16 +2106,16 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
// for (String orderCode : orderSet) {
// distributionStockArticleClient.updateOrderInfo(orderCode, warehouseId);
// }
List<String> orders = new ArrayList<>(orderSet);
if (orders.isEmpty()) {
return Resp.scanSuccess("下架成功", "成功下架" + num + "件");
}
// List<String> orders = new ArrayList<>(orderSet);
// if (orders.isEmpty()) {
// return Resp.scanSuccess("下架成功", "成功下架" + num + "件");
// }
OrderPackageDTO orderPackageDTO1 = new OrderPackageDTO();
orderPackageDTO1.setWarehouseId(warehouseId);
orderPackageDTO1.setStrings(orders);
distributionStockArticleClient.updateOrdersInfo(orderPackageDTO1);
log.info(">>>>> T downPackageAndDelTrayAndIsUpdate end");
// OrderPackageDTO orderPackageDTO1 = new OrderPackageDTO();
// orderPackageDTO1.setWarehouseId(warehouseId);
// orderPackageDTO1.setStrings(orders);
// distributionStockArticleClient.updateOrdersInfo(orderPackageDTO1);
// log.info(">>>>> T downPackageAndDelTrayAndIsUpdate end");
return Resp.scanSuccess("下架成功", "成功下架" + num + "件");
}
@ -1819,6 +2131,10 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
String orderCode = upShelfZeroOrderDTO.getOrderCode();//订单号
Long allocationId = upShelfZeroOrderDTO.getAllocationId();//库位id
Integer enterNum = upShelfZeroOrderDTO.getEnterNum();//下架数量
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
String qrCode = goodsAllocationEntity.getQrCode();
BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("association_value", orderCode)
@ -1856,6 +2172,26 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
removeById(updownTypeId);
//修改库位状态为空闲
basicdataGoodsAllocationClient.updateAllocationStatus(allocationId, "1");
try{
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",2);
jsonObject.put("operation",4);
List<String> orderCodes = new ArrayList<>();
orderCodes.add(orderCode);
jsonObject.put("orderCodes",orderCodes);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}catch (Exception e){
log.warn("###########saveTrayTypeByOrderPackageCode: 发送打托广播失败");
}
}
saveUpdownGoodsLog(updownGoodsList, "2", 0, remark, warehouseId);
updateUpdownTypeNum(updownTypeEntity);
@ -1872,7 +2208,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//存入日志
saveUpdownGoodsLogPart(updownGoodsList, enterNum, "2", 0, remark + "部分", updownTypeEntity.getWarehouseId());
}
updateZeroOrderGroundingStatus(orderCode, warehouseId);
// updateZeroOrderGroundingStatus(orderCode, warehouseId);
updateUpdownTypeNum(updownTypeEntity);
allNum = allNum + enterNum;
//更新货位缓存
@ -1924,6 +2260,10 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
continue;
}
String incomingBatch = upShelfStockDTO.getIncomingBatch();
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
String qrCode = goodsAllocationEntity.getQrCode();
BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
@ -1971,6 +2311,29 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
removeById(updownTypeId);
//修改库位状态为空闲
basicdataGoodsAllocationClient.updateAllocationStatus(allocationId, "1");
try{
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, materialCode, incomingBatch, warehouseId);
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",3);
jsonObject.put("operation",4);
List<Long> stockListIds = new ArrayList<>();
stockListIds.add(stockListEntity.getId());
jsonObject.put("stockListIds",stockListIds);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}catch (Exception e){
log.warn("###########saveTrayTypeByOrderPackageCode: 发送打托广播失败");
}
}
//更新货位缓存
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
@ -2018,11 +2381,14 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
.eq("is_deleted", 0);
WarehouseUpdownTypeEntity updownTypeEntity = baseMapper.selectOne(updownTypeEntityQueryWrapper);
// Long updownTypeId = updownTypeEntity.getId();
// BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
// if(Objects.isNull(goodsAllocationEntity)){
// log.warn("#################downTrayCode: 库位信息不存在 allocationId={}",allocationId);
// return R.fail(403,"库位信息不存在");
// }
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){
log.warn("#################downTrayCode: 库位信息不存在 allocationId={}",allocationId);
return R.fail(403,"库位信息不存在");
}
String qrCode = goodsAllocationEntity.getQrCode();
// Long wid = goodsAllocationEntity.getWarehouseId();
// if(!wid.equals(warehouseId)){
// log.warn("#################downTrayCode: 库位不在当前仓 allocationId={}",allocationId);
@ -2045,23 +2411,95 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//修改状态
Set<String> setOrder = new TreeSet<>();
for (WarehouseUpdownGoodsEntity updownGoodsEntity : updownGoodsList) {
String associationType = updownGoodsEntity.getAssociationType();
String associationValue = updownGoodsEntity.getAssociationValue();
// String associationType = updownGoodsEntity.getAssociationType();
// String associationValue = updownGoodsEntity.getAssociationValue();
Integer num = updownGoodsEntity.getNum();
if ("1".equals(associationType)) {
updateZeroOrderGroundingStatus(associationValue, warehouseId);
} else if ("3".equals(associationType)) {
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(associationValue, warehouseId);
updatePackageGroundingStatus(associationValue, "10", warehouseId);
setOrder.add(parcelListEntity.getOrderCode());
}
// if ("1".equals(associationType)) {
// updateZeroOrderGroundingStatus(associationValue, warehouseId);
// } else if ("3".equals(associationType)) {
// DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(associationValue, warehouseId);
// updatePackageGroundingStatus(associationValue, "10", warehouseId);
// setOrder.add(parcelListEntity.getOrderCode());
// }
allNum = allNum + num;
}
for (String orderCode : setOrder) {
distributionStockArticleClient.updateOrderInfo(orderCode, warehouseId);
// for (String orderCode : setOrder) {
// distributionStockArticleClient.updateOrderInfo(orderCode, warehouseId);
// }
try{
//把updownGoodsList通过associationType进行分组associationType作为key
Map<String, List<WarehouseUpdownGoodsEntity>> map = updownGoodsList.stream().collect(Collectors.groupingBy(WarehouseUpdownGoodsEntity::getAssociationType));
map.keySet().forEach(associationType -> {
List<WarehouseUpdownGoodsEntity> updownGoodsEntities = map.get(associationType);
//把updownGoodsEntities中所有元素的associationValue放入一个List
List<String> associationValues = updownGoodsEntities.stream().map(WarehouseUpdownGoodsEntity::getAssociationValue).collect(Collectors.toList());
if("1".equals(associationType)){
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",2);
jsonObject.put("operation",4);
jsonObject.put("orderCodes",associationValues);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}else if("3".equals(associationType)){
FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderPackageCodeList(associationValues);
findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> listEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
//把listEntityList通过conditions进行分组
Map<Integer, List<DistributionParcelListEntity>> map1 = listEntityList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getConditions));
map1.keySet().forEach(conditions -> {
List<DistributionParcelListEntity> parcelListEntityList = map1.get(conditions);
//把parcelListEntityList中所有元素的orderPackageCodes放入一个List
List<String> orderPackageCodes = parcelListEntityList.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.toList());
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",1);
jsonObject.put("conditions",conditions);
jsonObject.put("operation",4);
jsonObject.put("orderPackageCodes",orderPackageCodes);
jsonObject.put("warehouseId",warehouseId);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
});
}else if("4".equals(associationType)){
List<Long> stockListIds = new ArrayList<>();
updownGoodsEntities.forEach(updownGoodsEntity -> {
String materialCode = updownGoodsEntity.getAssociationValue();
String incomingBatch = updownGoodsEntity.getIncomingBatch();
Long marketId = updownGoodsEntity.getMarketId();
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, materialCode, incomingBatch, warehouseId);
if(!Objects.isNull(stockListEntity)){
stockListIds.add(stockListEntity.getId());
}
});
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",3);
jsonObject.put("operation",4);
jsonObject.put("stockListIds",stockListIds);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
});
}catch (Exception e){
log.warn("################downAllocation: 下架库位存入广播失败");
}
//修改库位状态
basicdataGoodsAllocationClient.updateAllocationStatus(allocationId, "1");
@ -2166,6 +2604,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//上架新的库位
upShelfPackage(upShelfPackageList, allocationId, warehouseId, remark + "上架");
//更新货位缓存
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
return Resp.scanSuccess("移库成功", "移库成功");
@ -2519,20 +2958,22 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
if (Objects.isNull(trayEntity)) {
//没有托盘就直接修改库位数据
//修改绑定数据的库位信息到新库位
changeUpdownGoodsToNewAllocation(list, targetAllocationId, updownTypeEntity);
//下架原库位的所有货物
downAllocation(allocationId, warehouseId);
for (WarehouseUpdownGoodsEntity updownGoodsEntity : list) {
String associationType = updownGoodsEntity.getAssociationType();
String associationValue = updownGoodsEntity.getAssociationValue();
if ("1".equals(associationType)) {
updateZeroOrderGroundingStatus(associationValue, warehouseId);
} else if ("3".equals(associationType)) {
updatePackageGroundingStatus(associationValue, "20", warehouseId);
}
}
//修改绑定数据的库位信息到新库位
changeUpdownGoodsToNewAllocation(list, targetAllocationId, updownTypeEntity);
// for (WarehouseUpdownGoodsEntity updownGoodsEntity : list) {
// String associationType = updownGoodsEntity.getAssociationType();
// String associationValue = updownGoodsEntity.getAssociationValue();
// if ("1".equals(associationType)) {
// updateZeroOrderGroundingStatus(associationValue, warehouseId);
// } else if ("3".equals(associationType)) {
// updatePackageGroundingStatus(associationValue, "20", warehouseId);
// }
// }
} else {
String trayCode = trayEntity.getPalletCode();
moveAllocationByTrayCode(trayCode, targetAllocationId, warehouseId);
@ -2664,6 +3105,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
}
String enableStatus = goodsAllocationEntity.getEnableStatus();
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId();
String qrCode = goodsAllocationEntity.getQrCode();
if ("2".equals(enableStatus)) {
log.warn("##############changeUpdownGoodsToNewAllocation: 库位已被禁用 allocationId={}", allocationId);
throw new CustomerException(403, "库位已被禁用");
@ -2721,6 +3163,81 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
basicdataGoodsAllocationClient.updateAllocationStatus(allocationId, "2");
saveUpdownGoodsLog(newList, "1", 0, "移库:整库移库上架", targetUpdownTypeEntity.getWarehouseId());
try{
//把trayGoodsList通过associationType进行分组,associationType作为key的Map
Map<String, List<WarehouseUpdownGoodsEntity>> map = list.stream().collect(Collectors.groupingBy(WarehouseUpdownGoodsEntity::getAssociationType));
map.keySet().forEach(associationType -> {
List<WarehouseUpdownGoodsEntity> updownGoodsEntities = map.get(associationType);
//把trayGoodsEntities中所有元素的associationValue存入一个List集合
List<String> associationValues = updownGoodsEntities.stream().map(WarehouseUpdownGoodsEntity::getAssociationValue).collect(Collectors.toList());
if("1".equals(associationType)){
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",2);
jsonObject.put("operation",3);
jsonObject.put("orderCodes",associationValues);
jsonObject.put("warehouseId",wid);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}else if ("3".equals(associationType)){
FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderPackageCodeList(associationValues);
findParamterDTO.setWarehouseId(wid);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
//把parcelListEntityList通过conditions进行分组,conditions作为key的Map
Map<Integer, List<DistributionParcelListEntity>> parcelListEntityMap = parcelListEntityList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getConditions));
parcelListEntityMap.keySet().forEach(conditions -> {
List<DistributionParcelListEntity> parcelListEntities = parcelListEntityMap.get(conditions);
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",1);
jsonObject.put("operation",3);
jsonObject.put("conditions",conditions);
jsonObject.put("orderPackageCodes",associationValues);
jsonObject.put("warehouseId",wid);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
});
}else if ("4".equals(associationType)){
List<Long> stockListIds = new ArrayList<>();
updownGoodsEntities.forEach(updownGoodsEntity -> {
String materialCode = updownGoodsEntity.getAssociationValue();
String incomingBatch = updownGoodsEntity.getIncomingBatch();
Long marketId = updownGoodsEntity.getMarketId();
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, incomingBatch, materialCode, wid);
if(!Objects.isNull(stockListEntity)){
stockListIds.add(stockListEntity.getId());
}
});
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",3);
jsonObject.put("operation",3);
jsonObject.put("stockListIds",stockListIds);
jsonObject.put("warehouseId",wid);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
});
}catch (Exception e){
log.warn("###########saveTrayTypeByOrderPackageCode: 发送打托广播失败");
}
}
@ -2935,6 +3452,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
private R saveTrayGoodsToAllocation(WarehouseTrayTypeEntity trayTypeEntity, BasicdataGoodsAllocationEntity goodsAllocationEntity, BasicdataGoodsShelfEntity goodsShelfEntity, BasicdataGoodsAreaEntity goodsAreaEntity, Long warehouseId) {
Long allocationId = goodsAllocationEntity.getId();
String qrCode = goodsAllocationEntity.getQrCode();
Long shelfId = goodsShelfEntity.getId();
Long areaId = goodsAreaEntity.getId();
QueryWrapper<WarehouseUpdownTypeEntity> updownTypeQueryWrapper = new QueryWrapper<>();
@ -2955,16 +3473,16 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//把托盘绑定关系转成货位绑定关系
changeTrayGoodsToUpdownGoodsAndLog(trayGoodsList, updownTypeEntity);
for (WarehouseTrayGoodsEntity trayGoodsEntity : trayGoodsList) {
String associationType = trayGoodsEntity.getAssociationType();
if ("3".equals(associationType)) {
String orderPackageCode = trayGoodsEntity.getAssociationValue();
updatePackageGroundingStatus(orderPackageCode, "20", warehouseId);
} else if ("1".equals(associationType)) {
String orderCode = trayGoodsEntity.getAssociationValue();
updateZeroOrderGroundingStatus(orderCode, warehouseId);
}
}
// for (WarehouseTrayGoodsEntity trayGoodsEntity : trayGoodsList) {
// String associationType = trayGoodsEntity.getAssociationType();
// if ("3".equals(associationType)) {
// String orderPackageCode = trayGoodsEntity.getAssociationValue();
// updatePackageGroundingStatus(orderPackageCode, "20", warehouseId);
// } else if ("1".equals(associationType)) {
// String orderCode = trayGoodsEntity.getAssociationValue();
// updateZeroOrderGroundingStatus(orderCode, warehouseId);
// }
// }
//绑定托盘与库位关系
WarehouseTaryAllocationEntity taryAllocationEntity = new WarehouseTaryAllocationEntity();
@ -2985,6 +3503,83 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
Integer stockNum = trayTypeEntity.getStockNum();
Integer totalNum = trayTypeEntity.getTotalNum();
Integer total = stockNum + totalNum;
try{
//把trayGoodsList通过associationType进行分组,associationType作为key的Map
Map<String, List<WarehouseTrayGoodsEntity>> map = trayGoodsList.stream().collect(Collectors.groupingBy(WarehouseTrayGoodsEntity::getAssociationType));
map.keySet().forEach(associationType -> {
List<WarehouseTrayGoodsEntity> trayGoodsEntities = map.get(associationType);
//把trayGoodsEntities中所有元素的associationValue存入一个List集合
List<String> associationValues = trayGoodsEntities.stream().map(WarehouseTrayGoodsEntity::getAssociationValue).collect(Collectors.toList());
if("1".equals(associationType)){
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",2);
jsonObject.put("operation",3);
jsonObject.put("orderCodes",associationValues);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}else if ("3".equals(associationType)){
FindParamterDTO findParamterDTO = new FindParamterDTO();
findParamterDTO.setOrderPackageCodeList(associationValues);
findParamterDTO.setWarehouseId(warehouseId);
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findListByOrderPackageCodeList(findParamterDTO);
//把parcelListEntityList通过conditions进行分组,conditions作为key的Map
Map<Integer, List<DistributionParcelListEntity>> parcelListEntityMap = parcelListEntityList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getConditions));
parcelListEntityMap.keySet().forEach(conditions -> {
List<DistributionParcelListEntity> parcelListEntities = parcelListEntityMap.get(conditions);
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",1);
jsonObject.put("operation",3);
jsonObject.put("conditions",conditions);
jsonObject.put("orderPackageCodes",associationValues);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
});
}else if ("4".equals(associationType)){
List<Long> stockListIds = new ArrayList<>();
trayGoodsEntities.forEach(trayGoodsEntity -> {
String materialCode = trayGoodsEntity.getAssociationValue();
String incomingBatch = trayGoodsEntity.getIncomingBatch();
Long marketId = trayGoodsEntity.getMarketId();
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, incomingBatch, materialCode, warehouseId);
if(!Objects.isNull(stockListEntity)){
stockListIds.add(stockListEntity.getId());
}
});
JSONObject jsonObject = new JSONObject();
jsonObject.put("dataType",3);
jsonObject.put("operation",3);
jsonObject.put("stockListIds",stockListIds);
jsonObject.put("warehouseId",warehouseId);
jsonObject.put("allocationName",qrCode);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toJSONString()).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
});
}catch (Exception e){
log.warn("###########saveTrayTypeByOrderPackageCode: 发送打托广播失败");
}
return Resp.scanSuccess("上架成功", "整托上架成功" + total + "件");
}
@ -3098,7 +3693,7 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
//货物和库位绑定
warehouseUpdownGoodsService.bindingAllocationAndPackageList(updownTypeEntity, parcelListEntities, "1", 0, remrk);
distributionParcelListClient.updateList(parcelListEntities);
// distributionParcelListClient.updateList(parcelListEntities);
//修改上架方式上的数据
updateUpdownTypeNum(updownTypeEntity);

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

@ -27,10 +27,7 @@ import com.logpm.oldproject.entity.WayBillEntity;
import com.logpm.oldproject.entity.WaybillDesEntity;
import com.logpm.oldproject.feign.IWayBillClient;
import com.logpm.oldproject.feign.IWaybillDesClient;
import com.logpm.warehouse.dto.ProductDTO;
import com.logpm.warehouse.dto.SplitOrderDTO;
import com.logpm.warehouse.dto.WarehouseWaybillDTO;
import com.logpm.warehouse.dto.WaybillDTO;
import com.logpm.warehouse.dto.*;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.excel.WarehouseWaybillExcel;
@ -880,6 +877,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
return list;
}
private PrintPreviewVO buildPrintWallet(WarehouseWaybillEntity warehouseWaybillEntity, List<WarehouseWayBillDetail> warehouseWayBillDetails, BasicPrintTemplateEntity template) throws Exception {
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());

Loading…
Cancel
Save