Browse Source

Merge branch 'fix_bug_20231216' into dev

single_db
pref_mail@163.com 1 year ago
parent
commit
6a410692af
  1. 5
      blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java
  2. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java
  3. 11
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  4. 13
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSignforVO.java
  5. 3
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/OrderCountEntity.java
  6. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  7. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  8. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  9. 99
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionNumberDetailDTO.java
  10. 30
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  11. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  12. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  13. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  14. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  15. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  16. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  17. 37
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  18. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  19. 485
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  20. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  21. 12
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IOrderPackageStatusPushFailLogService.java
  22. 48
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java
  23. 45
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/OrderPackageStatusPushFailLogServiceImpl.java
  24. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/jobhandler/OrderPackageStatusFallJob.java
  25. 1524
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

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

@ -13,5 +13,10 @@ public class RedisKeyConstant {
*/
public static final String CACHE_OLD_SYSTEM_ORDERPACKAGE_KEY ="cache:old-system-orderpackage-key:";
/**
* 缓存盘点包件的子任务
*/
public static final String TASK_QUEST_CHILD_KEY ="cache:task-quest-child-key:";
}

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

@ -302,7 +302,7 @@ public class DistributionParcelListEntity extends TenantEntity {
@ApiModelProperty(value = "收站仓ID")
private String acceptWarehouseName;
@ApiModelProperty(value = "收站仓ID")
@ApiModelProperty(value = "装车状态")
private String orderPackageLoadingStatus;
@ApiModelProperty(value = "重量")

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

@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
/**
* 在库订单包件清单 Feign接口类
@ -118,4 +119,14 @@ public interface IDistributionParcelListClient {
@GetMapping(API_PREFIX+"/updateOrderPackageCodeById")
void updateOrderPackageCodeById(@RequestParam Long packageId, @RequestParam String orderPackageStatus);
/**
* 根据包条码和仓库ID查询订单相关信息
* @param orderPackCode 包条码
* @param warehouseId 仓库ID
* @return
*/
@GetMapping(API_PREFIX+"/findByOrderInfoByOrderPackageCodeAndWarehouseId")
Map<String,Object> findByOrderInfoByOrderPackageCodeAndWarehouseId(@RequestParam String orderPackCode,@RequestParam Long warehouseId);
}

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

@ -85,6 +85,19 @@ public class DistributionSignforVO extends DistributionSignforEntity {
@ApiModelProperty(value = "搜索创建时间")
private String createTime_query;
/**
* 搜索创建时间
*/
@ApiModelProperty(value = "未签收件数")
private Integer unreceivedQuantity;
/**
* 搜索创建时间
*/
@ApiModelProperty(value = "未装车数")
private Integer unloadedNumber;
/**
* 业务类型
*/

3
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/OrderCountEntity.java

@ -7,12 +7,13 @@ import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
@TableName("ht_order_count")
@ApiModel(value = "OrderCount对象", description = "订单整合信息")
public class OrderCountEntity {
public class OrderCountEntity implements Serializable {
@TableId(
value = "id",

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

@ -1348,7 +1348,6 @@ public class DistributionStockupAppController extends BladeController {
Resp.scanFail(r1.getMsg(),r1.getMsg());
}
}
Integer i = distributionStockupService.selectPackagePrint(stockupDTO);
switch (i) {
case 1:

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

@ -391,6 +391,16 @@ public class DistributionSignforController extends BladeController {
}
@GetMapping("/numberDetail")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "PC下载签收图片", notes = "传入ids")
public R getNumberDetail(@RequestParam Long signingId,Integer type) {
return distributionSignforService.getNumberDetail(signingId,type);
}

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

@ -19,7 +19,6 @@ package com.logpm.distribution.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataClientUserEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.dto.DistributionStockArticleDTO;

99
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionNumberDetailDTO.java

@ -0,0 +1,99 @@
package com.logpm.distribution.dto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 签收列表数量详情
*/
@Data
public class DistributionNumberDetailDTO {
/**
* 运单号
*/
private String waybillNumber;
/**
* 服务号
*/
private String serviceNumber;
/**
* 订单自编码
*/
private String orderCode;
/**
* 包条码
*/
private String orderPackageCode;
/**
* 包件类型 1- 订制品 2 - 库存品 3- 零担
*/
private Integer conditions;
/**
* 包件类型 1- 订制品 2 - 库存品 3- 零担
*/
private String conditionsName;
/**
* 装车状态
*/
private String loadingStatusName;
/**
* 装车时间
*/
private Date loadingTime;
/**
* 签收状态
*/
private String signingStatusName;
/**
* 备货状态
*/
private String stockupStatusName;
/**
* 签收时间
*/
private String signingTime;
/**
* 备货时间
*/
private Date stockupTime;
/**
* 物料编码
*/
private String cargoNumber;
/**
* 物料名称
*/
private String marketName;
/**
* 货物名称
*/
private String descriptionGoods;
}

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

@ -16,16 +16,19 @@
*/
package com.logpm.distribution.feign;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.vo.DistributionParcelListVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -34,7 +37,9 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 在库订单包件清单 Feign实现类
@ -45,6 +50,7 @@ import java.util.List;
@ApiIgnore()
@RestController
@AllArgsConstructor
@Slf4j
public class DistributionParcelListClient implements IDistributionParcelListClient {
private final IDistributionParcelListService distributionParcelListService;
@ -219,4 +225,28 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
distributionStockArticleService.updateOrderInfo(orderCode,warehouseId);
}
@Override
public Map<String, Object> findByOrderInfoByOrderPackageCodeAndWarehouseId(String orderPackCode, Long warehouseId) {
LambdaQueryWrapper<DistributionParcelListEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(DistributionParcelListEntity::getOrderPackageCode,orderPackCode);
lambdaQueryWrapper.eq(DistributionParcelListEntity::getWarehouseId,warehouseId);
// 得到包件
try{
DistributionParcelListEntity one = distributionParcelListService.getOne(lambdaQueryWrapper);
//查询订单信息
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleService.getById(one.getStockArticleId());
Map<String, Object> map = new HashMap<>();
map.put("mallName",distributionStockArticleEntity.getMallName());
return map;
}catch (Exception e){
log.error(" >>>>>>> findByOrderInfoByOrderPackageCodeAndWarehouseId 查询异常",e);
}
return null;
}
}

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

@ -134,4 +134,10 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
* @return
*/
Integer updatePackageListByIds(@Param("packageIds") List<Long> packageIds);
/**
* 批量修改包件装车和签收状态
* @param packageIds
*/
Integer updateLoadingAndSigningByIds(@Param("packageIds")List<Long> packageIds);
}

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

@ -880,6 +880,12 @@
#{item}
</foreach>
</update>
<update id="updateLoadingAndSigningByIds">
UPDATE logpm_distribution_parcel_list SET order_package_loading_status = 20 , order_package_status = 70 WHERE id IN
<foreach collection="packageIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</mapper>

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

@ -318,6 +318,9 @@
(ldr.reservation_num + ldr.reservation_stock_list_num) reservationNum,
lds.driver_signing driverSigning,
(lds.loaded_number+lds.loadedin_number) loadedNumber,
(ldr.reservation_num + ldr.reservation_stock_list_num -lds.loaded_number - lds.loadedin_number ) unloadedNumber,
(ldr.reservation_num + ldr.reservation_stock_list_num - lds.received_quantity + receivedin_quantity ) unreceivedQuantity,
lds.create_time createTime,
CASE WHEN lds.signing_status ='2' THEN '文员签收'
WHEN lds.driver_signing ='2' THEN '司机签收'

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

@ -438,6 +438,9 @@
<if test=" param.orderCodeNumLike != '' and param.orderCodeNumLike != null ">and ldsa.order_code like
concat('%',#{param.orderCodeNumLike},'%')
</if>
<if test=" param.reservation != '' and param.reservation != null ">
and ldsa.reservation_status in (10,20)
</if>
<if test=" param.waybillNumList != null ">
and ldpl.waybill_number in
<foreach collection="param.waybillNumList" open="(" item="a" close=")" separator=",">

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

@ -264,4 +264,11 @@ public interface IDistributionAsyncService {
* @param updatePackageList
*/
void updatepackageListLoadingStatus(List<DistributionParcelListEntity> updatePackageList,Long warehouseId);
/**
* 处理包件一键签收状态
* @param packageIds
* @param id
*/
void handlPakcage(List<Long> packageIds, Long id);
}

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

@ -221,4 +221,12 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
* @return
*/
IPage<DistributionSignforVO> selectDistributionSignforPageByClient(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor);
/**
* 查询签收列表数字详情
* @param signingId
* @param type
* @return
*/
R getNumberDetail(Long signingId, Integer type);
}

37
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -54,6 +54,7 @@ import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -703,10 +704,14 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
@Override
@Transactional
public void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId, Long reservationId) {
if (Func.isEmpty(parcelListEntity)) {
log.error("############包件信息异常:{}", parcelListEntity);
throw new RuntimeException("包件信息异常");
}
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
distributionParcelListService.updateById(parcelListEntity);
//维护包件所属订单是否均已完成装车,如果均已完成装车则订单进行装车状态的修改
if (parcelListEntity.getConditions() != 2) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
@ -722,7 +727,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
distributionStockArticleService.updateById(stockArticleEntity);
}
}
warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(),parcelListEntity.getWarehouseId());
checkReservationAndDeliveryLoadingStatus(deliveryId, reservationId);
}
@ -1343,7 +1348,9 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
public void updatepackageListLoadingStatus(List<DistributionParcelListEntity> updatePackageList,Long warehouseId) {
List<Long> packageIds = updatePackageList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
Integer i = distributionParcelListMapper.updatePackageListByIds(packageIds);
if (Func.isNotEmpty(packageIds)){
Integer i = distributionParcelListMapper.updatePackageListByIds(packageIds);
}
String collect = updatePackageList.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(","));
warehouseUpdownTypeClient.downPackageOrDelTray(collect,warehouseId);
@ -1351,6 +1358,32 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
// 进行批量下架
}
@Override
public void handlPakcage(List<Long> packageIds, Long id) {
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(packageIds);
if (Func.isNotEmpty(distributionParcelListEntities)){
//进行批量修改
distributionParcelListMapper.updateLoadingAndSigningByIds(packageIds);
String orderPackCode = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(","));
log.info("一件签收包件解托>>>>>>>>>>>>>>>orderPackCodes():{}", orderPackCode);
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackCode,id);
Map<Long, List<DistributionParcelListEntity>> orderPackageMap = distributionParcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getStockArticleId));
orderPackageMap.forEach((k,v)->{
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(k);
Integer signNum = distributionLoadscanMapper.selectOrderSignNum(k);
if (signNum.equals(stockArticleEntity.getHandQuantity())){
stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue());
}else {
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
}
distributionStockArticleService.updateById(stockArticleEntity);
});
}
}
/**
* 维护配送数量和状态
*

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

@ -584,7 +584,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanEntity.setLoadedNub(parcelListEntity.getQuantity());
distributionLoadscanService.save(loadscanEntity);
//出库
warehouseUpdownTypeClient.downPackage(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
// warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(),myCurrentWarehouse.getId());
//订单扣减在库数量
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
@ -1706,17 +1705,21 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) {
loadscaninvnEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) {
loadscaninvnEntity.setLoadedNub(disStockListDetailEntity.getNum());
}
distributionLoadscaninvnService.save(loadscaninvnEntity);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
Integer j = distributionSignforMapper.updateloadByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// warehouseUpdownTypeClient.downStock()
//异步修改包件状态 //对于存在库存品的这里还需要将库存品从对应的信息中进行扣除
// distributionAsyncService.changeMarketDeliveryListStatus(loadscaninvnEntity.getOrderPackageCode(), loadscaninvnEntity.getDeliveryId());
DistributionStockListEntity stockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda().eq(DistributionStockListEntity::getId, loadscaninvnEntity.getInventoryId()));
stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadscaninvnEntity.getPackageNub());
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadscaninvnEntity.getPackageNub());
stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadscaninvnEntity.getPackageNub());
distributionStockListMapper.updateById(stockListEntity);
// DistributionStockListEntity stockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda().eq(DistributionStockListEntity::getId, loadscaninvnEntity.getInventoryId()));
// stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadscaninvnEntity.getPackageNub());
// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadscaninvnEntity.getPackageNub());
// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadscaninvnEntity.getPackageNub());
// distributionStockListMapper.updateById(stockListEntity);
distributionStockListMapper.deductionQuantityStock(loadscaninvnEntity.getInventoryId(),loadscaninvnEntity.getLoadedNub());
}
}
}

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

@ -48,6 +48,7 @@ import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant;
@ -169,8 +170,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<BasicdataClientUserEntity> basicdataClientUserEntityListByUserIds = basicdataClientClient.getBasicdataClientUserEntityListByUserId(AuthUtil.getUserId());
List clientIds =null;
if(Func.isNotEmpty(basicdataClientUserEntityListByUserIds)){
List clientIds = null;
if (Func.isNotEmpty(basicdataClientUserEntityListByUserIds)) {
clientIds = basicdataClientUserEntityListByUserIds.stream().map(BasicdataClientUserEntity::getClientId).collect(Collectors.toList());
}
@ -198,6 +199,330 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return page.setRecords(distributionSignforVOS);
}
@Override
public R getNumberDetail(Long signingId, Integer type) {
DistributionSignforEntity byId = this.getById(signingId);
//订制品
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(byId.getReservationId());
//库存品
List<DisStockListDetailEntity> disStockListDetailEntities = distributionReservationMapper.selectInventoryListByReservation(byId.getReservationId());
//零担
List<DistributionParcelNumberDTO> distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(byId.getReservationId());
List<DistributionNumberDetailDTO> detailDTOS = new ArrayList<>();
if (Func.isNotEmpty(byId)){
switch (type) {
case 1:
//配送件数
//订制品
if (Func.isNotEmpty(parcelListEntityList)){
List<DistributionNumberDetailDTO> packageNumberDetail = handleNumberDetailPackage(parcelListEntityList);
if (Func.isNotEmpty(packageNumberDetail)){
detailDTOS.addAll(packageNumberDetail);
}
}
//库存品
if (Func.isNotEmpty(disStockListDetailEntities)){
List<DistributionNumberDetailDTO> inventoryNumberDetail = handleNumberDetailInventory(disStockListDetailEntities);
if (Func.isNotEmpty(inventoryNumberDetail)){
detailDTOS.addAll(inventoryNumberDetail);
}
}
//零担
break;
case 2:
if (Func.isNotEmpty(parcelListEntityList)){
List<DistributionNumberDetailDTO> packageNumberDetail = deliveryLoadingPackageNumberDetail(parcelListEntityList);
if (Func.isNotEmpty(packageNumberDetail)){
detailDTOS.addAll(packageNumberDetail);
}
}
if (Func.isNotEmpty(disStockListDetailEntities)){
List<DistributionNumberDetailDTO> inventoryNumberDetail= deliveryLoadingInventoryNumberDetail(disStockListDetailEntities);
if (Func.isNotEmpty(inventoryNumberDetail)){
detailDTOS.addAll(inventoryNumberDetail);
}
}
//装车件数
break;
case 3:
//未装车数量
if (Func.isNotEmpty(parcelListEntityList)){
List<DistributionNumberDetailDTO> packageNumberDetail = deliveryUnloadingPackageNumberDetail(parcelListEntityList);
if (Func.isNotEmpty(packageNumberDetail)){
detailDTOS.addAll(packageNumberDetail);
}
}
if (Func.isNotEmpty(disStockListDetailEntities)){
List<DistributionNumberDetailDTO> inventoryNumberDetail= deliveryUnLoadingInventoryNumberDetail(disStockListDetailEntities);
if (Func.isNotEmpty(inventoryNumberDetail)){
detailDTOS.addAll(inventoryNumberDetail);
}
}
break;
case 4:
if (Func.isNotEmpty(parcelListEntityList)){
List<DistributionNumberDetailDTO> packageNumberDetail = deliverySigningPackageNumberDetail(parcelListEntityList);
if (Func.isNotEmpty(packageNumberDetail)){
detailDTOS.addAll(packageNumberDetail);
}
}
if (Func.isNotEmpty(disStockListDetailEntities)){
List<DistributionNumberDetailDTO> inventoryNumberDetail= deliverySigningInventoryNumberDetail(disStockListDetailEntities);
if (Func.isNotEmpty(inventoryNumberDetail)){
detailDTOS.addAll(inventoryNumberDetail);
}
}
//签收数量
break;
case 5:
//未签收件数
if (Func.isNotEmpty(parcelListEntityList)){
List<DistributionNumberDetailDTO> packageNumberDetail = deliveryUnsigningPackageNumberDetail(parcelListEntityList);
if (Func.isNotEmpty(packageNumberDetail)){
detailDTOS.addAll(packageNumberDetail);
}
}
if (Func.isNotEmpty(disStockListDetailEntities)){
List<DistributionNumberDetailDTO> inventoryNumberDetail= deliveryUnsigningInventoryNumberDetail(disStockListDetailEntities);
if (Func.isNotEmpty(inventoryNumberDetail)){
detailDTOS.addAll(inventoryNumberDetail);
}
}
break;
}
}
return R.data(detailDTOS);
}
private List<DistributionNumberDetailDTO> deliveryUnsigningInventoryNumberDetail(List<DisStockListDetailEntity> disStockListDetailEntities) {
List<DisStockListDetailEntity> unsignInventoryList = disStockListDetailEntities.stream().filter(p -> p.getStockSignfoStatus().equals(InventorySigningStatusConstant.yiqianshou.getValue())).collect(Collectors.toList());
if (Func.isEmpty(unsignInventoryList)){
return null;
}
List<DistributionNumberDetailDTO> detailDTOS = handleNumberDetailInventory(unsignInventoryList);
return detailDTOS;
}
/**
* 未签收包件详情
* @param parcelListEntityList
* @return
*/
private List<DistributionNumberDetailDTO> deliveryUnsigningPackageNumberDetail(List<DistributionParcelListEntity> parcelListEntityList) {
List<DistributionParcelListEntity> unsignPackageList = parcelListEntityList.stream().filter(p -> !p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())).collect(Collectors.toList());
if (Func.isEmpty(unsignPackageList)){
return null;
}
List<DistributionNumberDetailDTO> detailDTOS = handleNumberDetailPackage(unsignPackageList);
return detailDTOS;
}
/**
* 处理签收库存品包件详情
* @param disStockListDetailEntities
* @return
*/
private List<DistributionNumberDetailDTO> deliverySigningInventoryNumberDetail(List<DisStockListDetailEntity> disStockListDetailEntities) {
List<DisStockListDetailEntity> signingInventoryList = disStockListDetailEntities.stream().filter(p -> p.getStockSignfoStatus().equals(InventorySigningStatusConstant.yiqianshou.getValue())).collect(Collectors.toList());
if (Func.isEmpty(signingInventoryList)){
return null;
}
List<DistributionNumberDetailDTO> detailDTOS = handleNumberDetailInventory(signingInventoryList);
return detailDTOS;
}
/**
* 处理签收包件详情
* @param parcelListEntityList
* @return
*/
private List<DistributionNumberDetailDTO> deliverySigningPackageNumberDetail(List<DistributionParcelListEntity> parcelListEntityList) {
List<DistributionParcelListEntity> signingPackageList = parcelListEntityList.stream().filter(p -> p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())).collect(Collectors.toList());
if (Func.isEmpty(signingPackageList)){
return null;
}
List<DistributionNumberDetailDTO> detailDTOS = handleNumberDetailPackage(signingPackageList);
return detailDTOS;
}
/**
* 未装车库存品详情列表
* @param disStockListDetailEntities
* @return
*/
private List<DistributionNumberDetailDTO> deliveryUnLoadingInventoryNumberDetail(List<DisStockListDetailEntity> disStockListDetailEntities) {
List<DisStockListDetailEntity> unloadingInventoryList = disStockListDetailEntities.stream().filter(p -> p.getStockLockingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())).collect(Collectors.toList());
if (Func.isEmpty(unloadingInventoryList)){
return null;
}
List<DistributionNumberDetailDTO> detailDTOS = handleNumberDetailInventory(unloadingInventoryList);
return detailDTOS;
}
/**
* 未装车包件列表
* @param parcelListEntityList
* @return
*/
private List<DistributionNumberDetailDTO> deliveryUnloadingPackageNumberDetail(List<DistributionParcelListEntity> parcelListEntityList) {
List<DistributionParcelListEntity> unLoadingPackageList = parcelListEntityList.stream().filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())).collect(Collectors.toList());
if (Func.isEmpty(unLoadingPackageList)){
return null;
}
List<DistributionNumberDetailDTO> detailDTOS = handleNumberDetailPackage(unLoadingPackageList);
return detailDTOS;
}
/**
* 装车库存品详情
* @param disStockListDetailEntities
* @return
*/
private List<DistributionNumberDetailDTO> deliveryLoadingInventoryNumberDetail(List<DisStockListDetailEntity> disStockListDetailEntities) {
List<DisStockListDetailEntity> inventoryLoadingList = disStockListDetailEntities.stream().filter(p -> p.getStockLockingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())).collect(Collectors.toList());
if (Func.isEmpty(inventoryLoadingList)){
return null;
}
List<DistributionNumberDetailDTO> detailDTOS = handleNumberDetailInventory(inventoryLoadingList);
return detailDTOS;
}
/**
* 装车包件详情
* @param parcelListEntityList
* @return
*/
private List<DistributionNumberDetailDTO> deliveryLoadingPackageNumberDetail(List<DistributionParcelListEntity> parcelListEntityList) {
List<DistributionParcelListEntity> loadingPackageList = parcelListEntityList.stream().filter(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())).collect(Collectors.toList());
if (Func.isEmpty(loadingPackageList)){
return null;
}
List<DistributionNumberDetailDTO> detailDTOS = handleNumberDetailPackage(loadingPackageList);
return detailDTOS;
}
/**
* 处理包件详情
* @param loadingPackageList
* @return
*/
@NotNull
private List<DistributionNumberDetailDTO> handleNumberDetailPackage(List<DistributionParcelListEntity> loadingPackageList) {
List<DistributionNumberDetailDTO> detailDTOS = new ArrayList<>();
loadingPackageList.stream().forEach(p->{
DistributionNumberDetailDTO distributionNumberDetailDTO = new DistributionNumberDetailDTO();
distributionNumberDetailDTO.setServiceNumber(p.getServiceNumber());
distributionNumberDetailDTO.setWaybillNumber(p.getWaybillNumber());
distributionNumberDetailDTO.setConditions(p.getConditions());
distributionNumberDetailDTO.setConditionsName("定制品");
distributionNumberDetailDTO.setOrderCode(p.getOrderCode());
distributionNumberDetailDTO.setDescriptionGoods(p.getMaterialName());
distributionNumberDetailDTO.setOrderPackageCode(p.getOrderPackageCode());
distributionNumberDetailDTO.setMarketName(p.getMallName());
//查询装车
DistributionLoadscanEntity loadscanEntity = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getPackageId, p.getId())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
//装车
if (Func.isNotEmpty(loadscanEntity)){
distributionNumberDetailDTO.setLoadingTime(loadscanEntity.getScanTime());
distributionNumberDetailDTO.setLoadingStatusName(OrderPackageLoadingStatusConstant.yizhuangche.getName());
//签收
if ( loadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())){
distributionNumberDetailDTO.setSigningTime(loadscanEntity.getSigningTime());
distributionNumberDetailDTO.setSigningStatusName(OrderPackageStatusConstant.yiqianshou.getName());
}
}else {
distributionNumberDetailDTO.setLoadingStatusName(OrderPackageLoadingStatusConstant.weizhuancghe.getName());
}
if (p.getOrderPackageStockupStatus().equals(OrderPackageStockupStatusConstant.yibeihu.getValue())){
//查询备货
DistributionStockEntity distributionStockEntity = distributionStockMapper.selectOne(Wrappers.<DistributionStockEntity>query().lambda()
.eq(DistributionStockEntity::getParcelListId, p.getId())
);
if (Func.isNotEmpty(distributionStockEntity)){
distributionNumberDetailDTO.setStockupTime(distributionStockEntity.getCreateTime());
distributionNumberDetailDTO.setStockupStatusName(OrderPackageStockupStatusConstant.yibeihu.getName());
}
}else {
distributionNumberDetailDTO.setStockupStatusName(OrderPackageStockupStatusConstant.daibeihuo.getName());
}
detailDTOS.add(distributionNumberDetailDTO);
});
return detailDTOS;
}
/**
* 处理库存品详情
* @param disStockListDetailEntities
* @return
*/
@NotNull
private List<DistributionNumberDetailDTO> handleNumberDetailInventory(List<DisStockListDetailEntity> disStockListDetailEntities) {
List<DistributionNumberDetailDTO> detailDTOS = new ArrayList<>();
disStockListDetailEntities.forEach(p->{
DistributionNumberDetailDTO distributionNumberDetailDTO = new DistributionNumberDetailDTO();
DistributionStockListEntity stockListEntity = distributionStockListService.getById(p.getStockListId());
if (Func.isNotEmpty(stockListEntity)){
distributionNumberDetailDTO.setCargoNumber(stockListEntity.getCargoNumber());
distributionNumberDetailDTO.setMarketName(stockListEntity.getMarketName());
distributionNumberDetailDTO.setDescriptionGoods(stockListEntity.getDescriptionGoods());
distributionNumberDetailDTO.setOrderCode(stockListEntity.getOrderCode());
distributionNumberDetailDTO.setServiceNumber(stockListEntity.getServiceNumber());
if (p.getStockLockingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())){
//查询库存品装车信息
DistributionLoadscaninvnEntity one = distributionLoadscaninvnService.getOne(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
.eq(DistributionLoadscaninvnEntity::getInventoryId, p.getStockListId())
.eq(DistributionLoadscaninvnEntity::getInventoryPackageId, p.getId())
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(one)){
distributionNumberDetailDTO.setLoadingTime(one.getScanTime());
distributionNumberDetailDTO.setLoadingStatusName(OrderPackageLoadingStatusConstant.yizhuangche.getName());
if (one.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())){
distributionNumberDetailDTO.setSigningTime(one.getSigningTime());
distributionNumberDetailDTO.setSigningStatusName(OrderPackageStatusConstant.yiqianshou.getName());
}
}
}else {
distributionNumberDetailDTO.setLoadingStatusName(OrderPackageLoadingStatusConstant.weizhuancghe.getName());
}
if (p.getStockPackageCode() != null){
//存在备货记录
DistributionStockEntity distributionStockEntity = distributionStockMapper.selectOne(Wrappers.<DistributionStockEntity>query().lambda()
.eq(DistributionStockEntity::getReservationId, p.getReservationId())
.eq(DistributionStockEntity::getStockListId, p.getStockListId())
.eq(DistributionStockEntity::getCoding, p.getStockPackageCode())
);
if (Func.isNotEmpty(distributionStockEntity)){
distributionNumberDetailDTO.setStockupTime(distributionStockEntity.getCreateTime());
distributionNumberDetailDTO.setStockupStatusName(OrderPackageStockupStatusConstant.yibeihu.getName());
}
}else {
distributionNumberDetailDTO.setStockupStatusName(OrderPackageStockupStatusConstant.daibeihuo.getName());
}
}
if (Func.isNotEmpty(distributionNumberDetailDTO)){
distributionNumberDetailDTO.setConditionsName("库存品");
detailDTOS.add(distributionNumberDetailDTO);
}
});
return detailDTOS;
}
@Override
public List<DistributionSignforExcel> exportDistributionSignfor(Map<String, Object> distributionSignfor) {
@ -288,7 +613,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public DistributionSignforsnmbVO getNubTotal(DistributionSignforDTO distributionSignfor) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isNotEmpty(myCurrentWarehouse)){
if (Func.isNotEmpty(myCurrentWarehouse)) {
distributionSignfor.setWarehouseId(myCurrentWarehouse.getId());
}
//转换创建时间
@ -323,11 +648,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(list)){
if (Func.isNotEmpty(list)) {
//满足条件此码必定为库存品
//判断该库存品是否属于当前客户
List<DisStockListDetailEntity> collect = list.stream().filter(l -> l.getReservationId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
if (Func.isNotEmpty(collect)){
if (Func.isNotEmpty(collect)) {
return Resp.scanFail("请在库存品页面扫描此码", "请在库存品页面扫描此码");
}
return Resp.scanFail("此码不是订制品", "此码不是订制品");
@ -425,11 +750,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新装车包件数和签收包件数
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(),AuthUtil.getUser());
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
//扣减订单的在库数量
Integer k = distributionStockArticleMapper.deductionHandQuantity(distributionLoadscanEntity.getOrderId(), distributionLoadscanEntity.getLoadedNub());
warehouseUpdownTypeClient.downPackageOrDelTray(collect.get(0).getOrderPackageCode(), myCurrentWarehouse.getId());
distributionAsyncService.checkSignStatus(distributionLoadscanEntity.getPackageId(),distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getDeliveryId());
distributionAsyncService.checkSignStatus(distributionLoadscanEntity.getPackageId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getDeliveryId());
}
//TODO 这里就需要一个异步的包件状态维护方法
} else if (Func.isEmpty(collect)) {
@ -439,7 +764,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
);
if (Func.isNotEmpty(one) && one.getConditions() == 2){
if (Func.isNotEmpty(one) && one.getConditions() == 2) {
log.error("#####################此包件不是定制品", one.getConditions());
return Resp.scanFail("此包件不是定制品", "此包件不是定制品");
}
@ -578,9 +903,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue())
);
distributionStockArticleVO.setReservationNum(reservationStockarticleEntity.getReservationNum());
Integer loadingNum = distributionLoadscanMapper.selectOrderLoadingNumByReservationIdAndDeliveryIdAndOrderId(signforEntity.getReservationId(),signforEntity.getDeliveryId(),distributionStockArticleVO.getId());
Integer loadingNum = distributionLoadscanMapper.selectOrderLoadingNumByReservationIdAndDeliveryIdAndOrderId(signforEntity.getReservationId(), signforEntity.getDeliveryId(), distributionStockArticleVO.getId());
distributionStockArticleVO.setLoadingNumber(loadingNum);
Integer signingNum = distributionLoadscanMapper.selectOrderSigningNumByReservationIdAndDeliveryIdAndOrderId(signforEntity.getReservationId(),signforEntity.getDeliveryId(),distributionStockArticleVO.getId());
Integer signingNum = distributionLoadscanMapper.selectOrderSigningNumByReservationIdAndDeliveryIdAndOrderId(signforEntity.getReservationId(), signforEntity.getDeliveryId(), distributionStockArticleVO.getId());
distributionStockArticleVO.setSigningNumber(signingNum);
}
@ -991,9 +1316,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//判断扫码是否是包件
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
if (Func.isNotEmpty(parcelListEntities)){
if (Func.isNotEmpty(parcelListEntities)) {
boolean isHave = parcelListEntities.stream().map(DistributionParcelListEntity::getOrderPackageCode).anyMatch(c -> c.contains(distrilbutionloadingscanDTO.getBarcode()));
if (isHave){
if (isHave) {
return Resp.scanFail("请在订制品页面扫描此码", "请在订制品页面扫描此码");
}
}
@ -1086,7 +1411,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer i = distributionSignforMapper.updateSignUser(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), AuthUtil.getUser());
//扣减库存
distributionStockListMapper.deductionQuantityStock(distributionLoadscaninvnEntity.getInventoryId(),distributionLoadscaninvnEntity.getLoadedNub());
distributionStockListMapper.deductionQuantityStock(distributionLoadscaninvnEntity.getInventoryId(), distributionLoadscaninvnEntity.getLoadedNub());
// //扣减库存
// DistributionStockListEntity stockListEntity = distributionStockListService.getById(inventory.get(0).getStockListId());
// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - distributionLoadscaninvnEntity.getPackageNub());
@ -1277,7 +1602,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<DistributionAppDeliveryListVO> distributionAppDeliveryListVOS = new ArrayList<>();
R<String> value = dictBizClient.getValue("role_class", "delivery_driver_new");
log.info(">>>>>> 获取配置的司机角色 {}",value.getData());
log.info(">>>>>> 获取配置的司机角色 {}", value.getData());
// 得到配置的多个配送角色
String[] split = value.getData().split(",");
@ -1286,8 +1611,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
for (String s : split) {
String[] roleIds = roleId.split(",");
for (String id : roleIds) {
if(id.equals(s)){
log.info(">>>>> 匹配司机 角色 用户 :{}",user.getUserName());
if (id.equals(s)) {
log.info(">>>>> 匹配司机 角色 用户 :{}", user.getUserName());
isDriver = true;
break;
}
@ -1569,7 +1894,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(loadscaninvnEntity)) {
if (!loadscaninvnEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())){
if (!loadscaninvnEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
//存在库存品装车数据,这里进行签收状态修改
loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum());
@ -1584,9 +1909,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), AuthUtil.getUser());
distributionAsyncService.checkSignStatus(null,loadscaninvnEntity.getReservationId(),loadscaninvnEntity.getDeliveryId());
distributionAsyncService.checkSignStatus(null, loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId());
}
}else {
} else {
//不存在装车数据 这里需要进行装车数据的补录
detailEntity.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue());
detailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue());
@ -1647,7 +1972,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - newLoadscaninvnEntity.getPackageNub());
stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + newLoadscaninvnEntity.getPackageNub());
distributionStockListService.updateById(stockListEntity);
distributionAsyncService.checkSignStatus(null,newLoadscaninvnEntity.getReservationId(),newLoadscaninvnEntity.getDeliveryId());
distributionAsyncService.checkSignStatus(null, newLoadscaninvnEntity.getReservationId(), newLoadscaninvnEntity.getDeliveryId());
}
@ -1827,7 +2152,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity.setMsg("司机一键签收数据补录");
}
distributionLoadscanService.updateById(distributionLoadscanEntity);
distributionAsyncService.checkSignStatus(distributionLoadscanEntity.getPackageId(),distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getDeliveryId());
distributionAsyncService.checkSignStatus(distributionLoadscanEntity.getPackageId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getDeliveryId());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
//维护签收数量
@ -1882,7 +2207,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntity.setMsg("司机一键签收数据补录");
}
distributionLoadscanService.save(loadscanEntity);
distributionAsyncService.checkSignStatus(loadscanEntity.getPackageId(),loadscanEntity.getReservationId(),loadscanEntity.getDeliveryId());
distributionAsyncService.checkSignStatus(loadscanEntity.getPackageId(), loadscanEntity.getReservationId(), loadscanEntity.getDeliveryId());
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
//更新签收表的签收数量和装车数量
@ -1906,6 +2231,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
}
List<Long> packageIds = new ArrayList<>();
if (Func.isNotEmpty(parcelListEntityList)) {
for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) {
//查询是否进行装车
@ -1970,7 +2297,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser());
distributionAsyncService.checkStockArticleSignStatus(parcelListEntity);
log.info("一件签收包件下架解托>>>>>>>>>>>>>>>parcelListEntity.getOrderPackageCode():{}",parcelListEntity.getOrderPackageCode());
log.info("一件签收包件下架解托>>>>>>>>>>>>>>>parcelListEntity.getOrderPackageCode():{}", parcelListEntity.getOrderPackageCode());
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
} else {
//存在装车数据
@ -1995,13 +2322,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer j = distributionSignforMapper.updateSignforNum(loadscanEntities.getDeliveryId(), loadscanEntities.getReservationId(), loadscanEntities.getPackageNub());
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntities.getDeliveryId(), loadscanEntities.getReservationId(), AuthUtil.getUser());
distributionAsyncService.checkSignStatus(loadscanEntities.getPackageId(),loadscanEntities.getReservationId(),loadscanEntities.getDeliveryId());
log.info("一件签收包件解托>>>>>>>>>>>>>>>parcelListEntity.getOrderPackageCode():{}",parcelListEntity.getOrderPackageCode());
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
distributionAsyncService.checkSignStatus(loadscanEntities.getPackageId(), loadscanEntities.getReservationId(), loadscanEntities.getDeliveryId());
}
}
distributionParcelListService.updateById(parcelListEntity);
packageIds.add(parcelListEntity.getId());
}
if (Func.isNotEmpty(packageIds)){
distributionAsyncService.handlPakcage(packageIds,myCurrentWarehouse.getId());
}
}
@ -2114,9 +2443,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//维护配送任务
distributionAsyncService.checkDeliverySignStatusByReservation(distributionSignforEntity.getDeliveryId());
distributionDeliveryListEntity.setDeliveryListLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
if (distributionSignfor.getIsClerk()){
if (distributionSignfor.getIsClerk()) {
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue());
}else {
} else {
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue());
}
distributionDeliveryListMapper.updateById(distributionDeliveryListEntity);
@ -2129,8 +2458,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getSigningTime, simpleDateFormat.format(new Date()))
.set(!distributionSignfor.getIsClerk(), DistributionSignforEntity::getSigningTime, simpleDateFormat.format(new Date()))
.set(distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getClerkSignRemarks()), DistributionSignforEntity::getClerkSignRemarks, distributionSignfor.getClerkSignRemarks())
.set(distributionSignfor.getIsClerk() , DistributionSignforEntity::getExamineUserId, user.getUserId())
.set(distributionSignfor.getIsClerk() , DistributionSignforEntity::getExamineUserName, user.getNickName())
.set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getExamineUserId, user.getUserId())
.set(distributionSignfor.getIsClerk(), DistributionSignforEntity::getExamineUserName, user.getNickName())
.set(!distributionSignfor.getIsClerk() && StringUtils.isNotBlank(distributionSignfor.getDriverRemarks()), DistributionSignforEntity::getDriverRemarks, distributionSignfor.getDriverRemarks())
.set(!distributionSignfor.getIsClerk(), DistributionSignforEntity::getDriverSigning, 2)
.set(!distributionSignfor.getIsClerk(), DistributionSignforEntity::getSjsigningTime, simpleDateFormat.format(new Date()));
@ -2422,22 +2751,22 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionReservationStocklistVOS.forEach(i -> {
if (Func.isNotEmpty(i)) {
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda().eq(DisStockListDetailEntity::getReservationId, i.getReservationId()).eq(DisStockListDetailEntity::getStockListId, i.getStocklistId()));
if (Func.isNotEmpty(list)){
if (Func.isNotEmpty(list)) {
boolean loadingFlag = list.stream().allMatch(l -> l.getStockLockingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
i.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.bufenzhuangche.getName());
if (loadingFlag){
if (loadingFlag) {
//全部都装车
i.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.yizhuangche.getName());
}else {
} else {
//全部未装车
i.setLoadingStatusName(ReservationInventoryLoadingStatusConstant.weizhuangche.getName());
}
boolean signingFlag = list.stream().allMatch(l -> l.getStockSignfoStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
i.setSigningStatusName(ReservationInventorySigningStatusConstant.bufenqianshou.getName());
if (signingFlag){
if (signingFlag) {
//全部签收
i.setSigningStatusName(ReservationInventorySigningStatusConstant.yiqianshou.getName());
}else {
} else {
//全部未签收
i.setSigningStatusName(ReservationInventorySigningStatusConstant.weiqianshou.getName());
}
@ -2787,7 +3116,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanFail("请签收扫描", "请签收扫描!!");
}
StringBuilder str = new StringBuilder();
str.append("计划" + (reservationEntity.getReservationNum()+reservationEntity.getReservationStockListNum()) + "件");
str.append("计划" + (reservationEntity.getReservationNum() + reservationEntity.getReservationStockListNum()) + "件");
AtomicInteger signingTotalNum = new AtomicInteger();
if (Func.isNotEmpty(packageNum)) {
//统计签收数量
@ -2904,7 +3233,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
parcelNumberEntity.setSigninQuantity(signinQuantity.add(signingNum).intValue());
distributionLoadscanService.updateById(loadscanEntityList);
distributionParcelNumberService.updateById(parcelNumberEntity);
distributionAsyncService.checkSignStatus(loadscanEntityList.getPackageId(),loadscanEntityList.getReservationId(),loadscanEntityList.getDeliveryId());
distributionAsyncService.checkSignStatus(loadscanEntityList.getPackageId(), loadscanEntityList.getReservationId(), loadscanEntityList.getDeliveryId());
}
}
}
@ -2938,7 +3267,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
signforEntity.setReceivedQuantity(signingNumber.subtract(receivedQuantity).add(signingNum).intValue());
distributionSignforMapper.updateById(signforEntity);
distributionLoadscanService.updateById(loadscanEntityList);
distributionAsyncService.checkSignStatus(loadscanEntityList.getPackageId(),loadscanEntityList.getReservationId(),loadscanEntityList.getDeliveryId());
distributionAsyncService.checkSignStatus(loadscanEntityList.getPackageId(), loadscanEntityList.getReservationId(), loadscanEntityList.getDeliveryId());
distributionParcelNumberService.updateById(parcelNumberEntity);
}
@ -2992,7 +3321,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
loadscanEntity.setSigningUser(AuthUtil.getUser().getNickName());
loadscanEntity.setSigningUserId(AuthUtil.getUser().getUserId());
distributionLoadscanService.save(loadscanEntity);
distributionAsyncService.checkSignStatus(loadscanEntity.getPackageId(),loadscanEntity.getReservationId(),loadscanEntity.getDeliveryId());
distributionAsyncService.checkSignStatus(loadscanEntity.getPackageId(), loadscanEntity.getReservationId(), loadscanEntity.getDeliveryId());
//进行签收数量的修改
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新装车包件数和签收包件数
@ -3024,8 +3353,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
distributionSignfor.setSigningTime(sdf.format(date));
boolean isSuccess =this.updatePicture(distributionSignfor);
if(isSuccess){
boolean isSuccess = this.updatePicture(distributionSignfor);
if (isSuccess) {
this.updateById(distributionSignfor);
// 创建异步队列推送老系统的的签收信息 构建请求参数
buildArgsToPushMq(distributionSignfor);
@ -3038,6 +3367,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
/**
* 构建文员签收审核的参数
*
* @param distributionSignfor
*/
public void buildArgsToPushMq(DistributionSignforDTO distributionSignfor) {
@ -3047,12 +3377,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
mapState.put("messageData", distributionSignfor);
mapState.put("createTime", new Date().getTime());
try{
log.info(">>>>>>>>>>>>>>>>>>> 推送老系统 的签收数据 {} ",mapState);
try {
log.info(">>>>>>>>>>>>>>>>>>> 推送老系统 的签收数据 {} ", mapState);
rabbitTemplate.convertAndSend(RabbitConstant.CLERK_CHECK_PUSH_DATA_EXCHANGE, RabbitConstant.CLERK_CHECK_PUSH_DATA_ROUTING, mapState);
}catch (Exception customerException){
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! {}",customerException.getMessage());
} catch (Exception customerException) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 消息推送失败~ 请联系管理员! {}", customerException.getMessage());
}
@ -3113,39 +3443,39 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
@Override
public void handlePicture(String ids, HttpServletResponse res) {
log.info(">>>>>> handlePicture {}",1);
if (Func.isEmpty(ids)){
log.error("#########ids字段缺失:{}",ids);
log.info(">>>>>> handlePicture {}", 1);
if (Func.isEmpty(ids)) {
log.error("#########ids字段缺失:{}", ids);
}
List<Long> signIds = Func.toLongList(",", ids);
List<String> reservationCodes= new ArrayList<>();
log.info(">>>>>> handlePicture {}",2);
List<String> reservationCodes = new ArrayList<>();
log.info(">>>>>> handlePicture {}", 2);
List<DistributionSignforEntity> distributionSignforEntities = this.listByIds(signIds);
log.info(">>>>>> handlePicture {}",3);
log.info(">>>>>> handlePicture {}", 3);
if (Func.isNotEmpty(distributionSignforEntities)) {
for (DistributionSignforEntity distributionSignforEntity : distributionSignforEntities) {
log.info(">>>>>> handlePicture {},{}",3,1);
log.info(">>>>>> handlePicture {},{}", 3, 1);
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distributionSignforEntity.getReservationId());
log.info(">>>>>> handlePicture {},{}",3,2);
log.info(">>>>>> handlePicture {},{}", 3, 2);
List<DistributionSignPrintVO> printEntities = baseMapper.selectSignImgsUrl(distributionSignforEntity.getReservationId());
log.info(">>>>>> handlePicture {},{}",3,3);
log.info(">>>>>> handlePicture {},{}", 3, 3);
if (Func.isNotEmpty(printEntities)){
if (Func.isNotEmpty(printEntities)) {
//进行分组
Map<String, List<DistributionSignPrintVO>> signingPictureGroup = printEntities.stream().collect(Collectors.groupingBy(DistributionSignPrintVO::getType));
log.info(">>>>>> handlePicture {},{}",3,4);
log.info(">>>>>> handlePicture {},{}", 3, 4);
//进行图片
signingPictureGroup.forEach((k,v)->{
log.info(">>>>>> handlePicture {},{}",3,5);
signingPictureGroup.forEach((k, v) -> {
log.info(">>>>>> handlePicture {},{}", 3, 5);
//这个方法会根据
List<String> urls = v.stream().map(DistributionSignPrintVO::getUrlRoute).collect(Collectors.toList());
log.info(">>>>>> handlePicture {},{}",3,6);
log.info(">>>>>> handlePicture {},{}", 3, 6);
FileUtil.handleSignPictureZip(urls, k, distributionReservationEntity.getReservationCode(), distributionReservationEntity.getConsignee());
log.info(">>>>>> handlePicture {},{}",3,7);
log.info(">>>>>> handlePicture {},{}", 3, 7);
});
//拼接ReservationCode
@ -3154,35 +3484,35 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
log.info(">>>>>> handlePicture {}",5);
log.info(">>>>>> handlePicture {}", 5);
//将指定的文件进行压缩
String fileName = FileUtil.reservationPictureFileToZip(String.join(",",reservationCodes));
log.info(">>>>>> handlePicture {}",6);
String fileName = FileUtil.reservationPictureFileToZip(String.join(",", reservationCodes));
log.info(">>>>>> handlePicture {}", 6);
//获得压缩后的文件进行前端下载数据推送
File file = FileUtil.getZipFile(fileName);
log.info(">>>>>> handlePicture {}",7);
if (Func.isNotEmpty(file)){
log.info(">>>>>> handlePicture {}", 7);
if (Func.isNotEmpty(file)) {
byte[] buffer = new byte[512];
FileInputStream fis = null;
BufferedInputStream bis = null;
try {
ServletOutputStream os = res.getOutputStream();
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
ServletOutputStream os = res.getOutputStream();
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
// res.setHeader("Content-Length", ""+file.listFiles().length);
// res.setContentType("application/zip;charset=UTF-8");
// res.setHeader("Content-Disposition","签收图片打包");
int i = bis.read(buffer);
while (i >= 0) {
os.write(buffer, 0, i);
i = bis.read(buffer);
}
int i = bis.read(buffer);
while (i >= 0) {
os.write(buffer, 0, i);
i = bis.read(buffer);
}
} catch (IOException e) {
log.error("文件下载失败 {}",e.getMessage());
}finally {
log.error("文件下载失败 {}", e.getMessage());
} finally {
if (bis != null) {
try {
bis.close();
@ -3201,6 +3531,5 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
}

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

@ -836,9 +836,9 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
}
if(Func.isNotEmpty(stockArticleEntity.getReservation())){
stockArticleEntity.setReservationStatus("10");
}
// if(Func.isNotEmpty(stockArticleEntity.getReservation())){
// stockArticleEntity.setReservationStatus("10");
// }
List<BasicdataWarehouseEntity> myWarehouseList = warehouseClient.getMyWatchWarehouse();
List<Long> collect = myWarehouseList.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());

12
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/IOrderPackageStatusPushFailLogService.java

@ -0,0 +1,12 @@
package com.logpm.factory.comfac.service;
import com.logpm.factory.entity.OrderPackageStatusPushFailLogEntity;
import com.logpm.factory.snm.entity.OrderStatusLog;
import org.springblade.core.mp.base.BaseService;
public interface IOrderPackageStatusPushFailLogService extends BaseService<OrderPackageStatusPushFailLogEntity> {
void saveOrderPackageStatusFaleLog(String unitNo, String currentWarehouseId, String status,String operationTime, Integer trayId);
}

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

@ -8,6 +8,7 @@ import com.logpm.basicdata.feign.IBasicdataTrayClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.factory.comfac.mapper.OrderPackageStatusPushFailLogMapper;
import com.logpm.factory.comfac.service.IFactoryCommonService;
import com.logpm.factory.comfac.service.IOrderPackageStatusPushFailLogService;
import com.logpm.factory.entity.OrderPackageStatusPushFailLogEntity;
import com.logpm.factory.pan.service.IPanFactoryDataService;
import com.logpm.oldproject.entity.TrayEntity;
@ -41,7 +42,8 @@ public class FactoryCommonServiceImpl implements IFactoryCommonService {
private final IAdvanceDetailClient advanceDetailClient;
private final IPanFactoryDataService panFactoryDataService;
private final OrderPackageStatusPushFailLogMapper orderPackageStatusPushFailLogMapper;
private final IOrderPackageStatusPushFailLogService orderPackageStatusPushFailLogService;
private final ITrayClient trayClient;
private final ITrayScanClient trayScanClient;
@ -135,8 +137,10 @@ public class FactoryCommonServiceImpl implements IFactoryCommonService {
//查询destinationWarehouse logiBillNo plantId数据
Map<String, String> supplyData = advanceDetailClient.getSupplyData(unitNo);
log.info(">>>>>>>>>>>>>>> extracted supplyData {}",supplyData);
if (supplyData== null||!supplyData.isEmpty()) {
log.info(">>>>>>>>>>>>>>> extracted supplyData {}", supplyData);
if (supplyData != null && !supplyData.isEmpty()) {
String destinationWarehouseId = supplyData.get("destinationWarehouseId");//目的仓id
if (StringUtil.isBlank(currentWarehouseId) || StringUtil.isBlank(destinationWarehouseId)) {
@ -150,53 +154,25 @@ public class FactoryCommonServiceImpl implements IFactoryCommonService {
//真正的处理需要的数据
if (OldSystemDataPushConfig.getWarehourseIdList().contains(currentWarehouseId)) {
try {
if ("1".equals(status)) {
if ("1".equals(status) || "4".equals(status)) {
// 始发仓和目的仓入库
panFactoryDataService.handleDataToPlatform(unitNo, operationTime);
bladeRedis.setEx("tray-" + unitNo, trayId, 30L);
} else if ("4".equals(status)) {
panFactoryDataService.handleDataToPlatform(unitNo, operationTime);
} else if ("2".equals(status)) {
bladeRedis.setEx("tray-" + unitNo, trayId, 30L);
} else {
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>> 错误的状态");
}
//同步打托数据
// syncTrayTypeData(unitNo, trayId, currentWarehouseId);
} catch (Exception e) {
log.error(e.getMessage());
log.error(">>>> 数据推送异常", e);
orderPackageStatusPushFailLogService.saveOrderPackageStatusFaleLog(unitNo, currentWarehouseId, status, operationTime, trayId);
log.error(">>>> 保存到错误数据推送记录 {}", unitNo);
}
}
}
}
} else {
log.info("##############dealWithDataHandler: unitNo={} 没有查询到数据 保存到待处理数据库", unitNo);
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("unit_no", unitNo);
queryWrapper.eq("warehouse_id", currentWarehouseId);
List list = orderPackageStatusPushFailLogMapper.selectList(queryWrapper);
if (list == null || list.isEmpty()) {
OrderPackageStatusPushFailLogEntity orderPackageStatusPushFailLogEntity = new OrderPackageStatusPushFailLogEntity();
orderPackageStatusPushFailLogEntity.setOrderPackageStatus(status);
orderPackageStatusPushFailLogEntity.setUnitNo(unitNo);
orderPackageStatusPushFailLogEntity.setWarehouseId(currentWarehouseId);
orderPackageStatusPushFailLogEntity.setOperationTime(operationTime);
orderPackageStatusPushFailLogEntity.setTrayId(trayId);
orderPackageStatusPushFailLogEntity.setDataStatus(0);
// 插入之前判断这条数据是否存在系统中
log.info(">>>>>>>>>>>>>>>> 保存到定时任务队列");
orderPackageStatusPushFailLogMapper.insert(orderPackageStatusPushFailLogEntity);
}else{
throw new CustomerException(405, "失败的包件数据状态记录已存在");
}
orderPackageStatusPushFailLogService.saveOrderPackageStatusFaleLog(unitNo, currentWarehouseId, status, operationTime, trayId);
}
}

45
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/OrderPackageStatusPushFailLogServiceImpl.java

@ -0,0 +1,45 @@
package com.logpm.factory.comfac.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.factory.comfac.mapper.OrderPackageStatusPushFailLogMapper;
import com.logpm.factory.comfac.service.IOrderPackageStatusPushFailLogService;
import com.logpm.factory.entity.OrderPackageStatusPushFailLogEntity;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
public class OrderPackageStatusPushFailLogServiceImpl extends BaseServiceImpl<OrderPackageStatusPushFailLogMapper, OrderPackageStatusPushFailLogEntity> implements IOrderPackageStatusPushFailLogService {
@Override
public void saveOrderPackageStatusFaleLog(String unitNo, String currentWarehouseId, String status,String operationTime, Integer trayId) {
log.info("##############dealWithDataHandler: unitNo={} 没有查询到数据 保存到待处理数据库", unitNo);
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("unit_no", unitNo);
queryWrapper.eq("warehouse_id", currentWarehouseId);
List list = baseMapper.selectList(queryWrapper);
if (list == null || list.isEmpty()) {
OrderPackageStatusPushFailLogEntity orderPackageStatusPushFailLogEntity = new OrderPackageStatusPushFailLogEntity();
orderPackageStatusPushFailLogEntity.setOrderPackageStatus(status);
orderPackageStatusPushFailLogEntity.setUnitNo(unitNo);
orderPackageStatusPushFailLogEntity.setWarehouseId(currentWarehouseId);
orderPackageStatusPushFailLogEntity.setOperationTime(operationTime);
orderPackageStatusPushFailLogEntity.setTrayId(trayId);
orderPackageStatusPushFailLogEntity.setDataStatus(0);
// 插入之前判断这条数据是否存在系统中
log.info(">>>>>>>>>>>>>>>> 保存到定时任务队列");
baseMapper.insert(orderPackageStatusPushFailLogEntity);
}else{
throw new CustomerException(405, "失败的包件数据状态记录已存在");
}
}
}

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

@ -9,6 +9,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
import com.xxl.job.core.log.XxlJobLogger;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springframework.stereotype.Component;
import java.util.List;
@ -43,6 +44,10 @@ public class OrderPackageStatusFallJob {
orderPackageStatusPushFailLogEntity.setDataStatus(1);
}catch (CustomerException e){
XxlJobLogger.log(e);
orderPackageStatusPushFailLogEntity.setDataStatus(2);
}catch (Exception e){
XxlJobLogger.log(e);

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

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save