Browse Source

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

dist.1.3.0
zhaoqiaobo 9 months ago
parent
commit
d04821507a
  1. 15
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvaluePackageVO.java
  2. 3
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java
  3. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  4. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvalueMapper.xml
  5. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  6. 427
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java
  7. 53
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  8. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  9. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  10. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingWaybillMapper.xml
  11. 9
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  12. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  13. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java
  14. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java
  15. 14
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  16. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/config/ExecutorConfig.java
  17. 120
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

15
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionAddvaluePackageVO.java

@ -83,6 +83,21 @@ public class DistributionAddvaluePackageVO extends DistributionAddvaluePackageEn
*/
private String sku;
/**
* 楼层数
*/
private String floolNum;
/**
* 距离米
*/
private String distance;
/**
* 公里
*/
private String kilometers;
}

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

@ -13,6 +13,9 @@ public class CarsLoadAllOrderVO implements Serializable {
private String orderCode;//订单号
private Long waybillId;//运单id
private String waybillNo;//运单号
private Long nodeId;//计划仓库id
private Long finalNodeId;//计划目的仓库id
private String nodeName;//计划仓库
private Date createTime;//创建时间
private String destination;//到站
private String departureWarehouseName;//目的仓

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.feign;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -40,9 +41,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
/**
* 配送在库订单 Feign实现类
@ -338,11 +337,17 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
@Override
public List<DistributionStockArticleEntity> findListByOrderCodesAndWarehouseId(FindParamterDTO findParamterDTO) {
QueryWrapper<DistributionStockArticleEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("order_code",findParamterDTO.getOrderCodeSet())
.eq("warehouse_id",findParamterDTO.getWarehouseId());
Set<String> orderCodeSet = findParamterDTO.getOrderCodeSet();
log.info("###################findListByOrderCodesAndWarehouseId: 当前处理的数据为 {}",orderCodeSet);
if(CollUtil.isEmpty(orderCodeSet)){
return Collections.emptyList();
}else{
QueryWrapper<DistributionStockArticleEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("order_code",orderCodeSet)
.eq("warehouse_id",findParamterDTO.getWarehouseId());
return distributionStockArticleService.list(queryWrapper);
return distributionStockArticleService.list(queryWrapper);
}
}
@Override

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

@ -110,7 +110,16 @@
WHEN ldap.conditions =1 THEN '订制品'
WHEN ldap.conditions =2 THEN '库存品'
WHEN ldap.conditions =3 THEN '零担'
END AS packageType
END AS packageType,
ldap.client_id AS clientId,
ldap.client_name AS clientName,
ldap.brand_name AS brandName,
ldap.brand_id AS brandId,
ldap.unit_price AS unitPrice,
ldap.scan_user_name AS scanUserName,
ldad.flool_num AS floolNum,
ldad.distance AS distance,
ldad.kilometers AS kilometers
FROM
logpm_distribution_addvalue AS lda
INNER JOIN logpm_distribution_addvalue_detail AS ldad ON ldad.addvalue_id = lda.id

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

@ -18,10 +18,7 @@ package com.logpm.distribution.service;
import com.logpm.distribution.bean.Resp;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistributionAddvalueDTO;
import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.dto.DistributionSignforExcelDTO;
import com.logpm.distribution.dto.DistrilbutionAppsignforDTO;
import com.logpm.distribution.dto.*;
import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.entity.DistributionSignPrintEntity;
@ -365,4 +362,10 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
*/
R loadingAbnormalPackageListTurnDown(String ids,boolean yesOrNo);
/**
* 查询客户下所有可添加增值服务包件
* @param reservationId
* @return
*/
List<DistributionAddvaluePackageDTO> checkAddValuePCPackageList(Long reservationId);
}

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

@ -16,11 +16,9 @@
*/
package com.logpm.distribution.service.impl;
import com.alibaba.fastjson.serializer.BigDecimalCodec;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.entity.BasicdataPriceEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataFactoryCategoryClient;
import com.logpm.basicdata.feign.IBasicdataPriceClient;
@ -38,7 +36,6 @@ import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionAddvaluePackageVO;
import com.logpm.distribution.vo.DistributionAddvalueVO;
import com.logpm.distribution.vo.app.DistributionAppAddvalueVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.util.Strings;
import org.springblade.common.constant.loading.LoadingStatusConstant;
@ -46,6 +43,8 @@ import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -53,10 +52,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -68,23 +64,37 @@ import java.util.stream.Collectors;
* @since 2023-09-11
*/
@Service
@AllArgsConstructor
@Slf4j
public class DistributionAddvalueServiceImpl extends BaseServiceImpl<DistributionAddvalueMapper, DistributionAddvalueEntity> implements IDistributionAddvalueService {
private final DistributionAddvalueMapper distributionAddvalueMapper;
private final DistributionReservationMapper distributionReservationMapper;
private final IDistributionStockListService distributionStockListService;
private final DistributionDeliveryListMapper distributionDeliveryListMapper;
// private final IDistributionAddvalueService distributionAddvalueService;
private final IDistributionAddvaluePackageService distributionAddvaluePackageService;
private final IDistributionAddvalueDetailService distributionAddvalueDetailService;
private final DistributionAddvalueDetailMapper distributionAddvalueDetailMapper;
private final DistributionAddvaluePackageMapper distributionAddvaluePackageMapper;
private final IDistributionLoadscanService distributionLoadscanService;
private final IBasicdataPriceClient basicdataPriceClient;
private final IBasicdataClientClient basicdataClientClient;
private final IBasicdataFactoryCategoryClient basicdataFactoryCategoryClient;
@Autowired
private DistributionAddvalueMapper distributionAddvalueMapper;
@Autowired
private DistributionReservationMapper distributionReservationMapper;
@Autowired
private IDistributionStockListService distributionStockListService;
@Autowired
private DistributionDeliveryListMapper distributionDeliveryListMapper;
@Autowired
// private IDistributionAddvalueService distributionAddvalueService;
private IDistributionAddvaluePackageService distributionAddvaluePackageService;
@Autowired
private IDistributionAddvalueDetailService distributionAddvalueDetailService;
@Autowired
private DistributionAddvalueDetailMapper distributionAddvalueDetailMapper;
@Autowired
private DistributionAddvaluePackageMapper distributionAddvaluePackageMapper;
@Autowired
private IDistributionLoadscanService distributionLoadscanService;
@Autowired
private IBasicdataPriceClient basicdataPriceClient;
@Autowired
private IBasicdataClientClient basicdataClientClient;
@Autowired
private IBasicdataFactoryCategoryClient basicdataFactoryCategoryClient;
@Autowired
@Lazy
private IDistributionSignforService distributionSignforService;
@Override
@ -388,10 +398,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
@Transactional
public R savePCAddvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageDTO> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
List<DistributionAddvaluePackageDTO> packageDTOList = packageEntityList.stream().filter(p -> Func.isNotEmpty(p.getQuantity()) && p.getQuantity() > 0).collect(Collectors.toList());
if (Func.isEmpty(packageDTOList)) {
return Resp.scanFail("操作失败", "无可用包件信息");
}
//查询是否重复添加
DistributionAddvalueEntity addvalueEntity = distributionAddvalueMapper.selectOne(Wrappers.<DistributionAddvalueEntity>query().lambda()
.eq(DistributionAddvalueEntity::getAddvalueId, distributionAppAddvalueDTO.getAddvalueType())
@ -413,6 +420,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
}
// 上楼 超区 平移 搬运 分拣 专车
BigDecimal totalFee = new BigDecimal(BigInteger.ZERO);
BigDecimal currencyUnitPrice = new BigDecimal(BigInteger.ZERO);
switch (distributionAppAddvalueDTO.getAddvalueType()) {
case "1":
if (Func.isEmpty(distributionAppAddvalueDTO.getFloolNum())) {
@ -433,6 +441,20 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
}else {
totalFee.add(distributionAppAddvalueDTO.getFee());
}
Map<String, Object> addValueDTO = new HashMap<>();
addValueDTO.put("reservationId",distributionAppAddvalueDTO.getReservationId().toString());
//超区需要默认当前所有包件
List<DistributionAddvaluePackageDTO> superZoneList = distributionSignforService.checkAddValuePCPackageList(distributionAppAddvalueDTO.getReservationId());
if (!Func.isEmpty(superZoneList)){
packageEntityList = superZoneList;
//进行费用均摊
BigDecimal fee = distributionAppAddvalueDTO.getFee();
if (fee.equals(BigDecimal.ZERO)){
currencyUnitPrice = BigDecimal.ZERO;
}else {
currencyUnitPrice = fee.divide(BigDecimal.valueOf(packageEntityList.size()));
}
}
break;
case "3":
if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) {
@ -447,10 +469,28 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
}else {
totalFee.add(distributionAppAddvalueDTO.getFee());
}
List<DistributionAddvaluePackageDTO> specialCarList = distributionSignforService.checkAddValuePCPackageList(distributionAppAddvalueDTO.getReservationId());
if (!Func.isEmpty(specialCarList)){
packageEntityList = specialCarList;
//进行费用均摊
BigDecimal fee = distributionAppAddvalueDTO.getFee();
if (fee.equals(BigDecimal.ZERO)){
currencyUnitPrice = BigDecimal.ZERO;
}else {
currencyUnitPrice = fee.divide(BigDecimal.valueOf(packageEntityList.size()));
}
}
break;
}
if (packageEntityList.isEmpty()) {
return R.fail("无可用包件信息");
}
List<DistributionAddvaluePackageDTO> packageDTOList = packageEntityList.stream().filter(p -> Func.isNotEmpty(p.getQuantity()) && p.getQuantity() > 0).collect(Collectors.toList());
if (Func.isEmpty(packageDTOList)) {
return Resp.scanFail("操作失败", "无可用包件信息");
}
int total = packageEntityList.stream().mapToInt(DistributionAddvaluePackageDTO::getQuantity).sum();
if (total == 0) {
return Resp.scanFail("添加失败", "包件数量错误");
} else {
@ -481,79 +521,83 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
//查询客户下此类的增值服务
List<DistributionAddvaluePackageEntity> packageEntities = distributionAddvalueMapper.selectAddvaluePackageListByAddvalueType(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType());
Map<Long, DistributionAddvaluePackageEntity> addvaluePackageEntityMap = packageEntities.stream().collect(Collectors.toMap(DistributionAddvaluePackageEntity::getPackageId, Function.identity(), (k1, k2) -> k2));
BigDecimal finalCurrencyUnitPrice = currencyUnitPrice;
packageDTOList.stream().forEach(p -> {
BigDecimal unitPrice = null;
if (Func.isEmpty(addvaluePackageEntityMap.get(p.getPackageId()))) {
Integer conditions = p.getConditions();
BigDecimal unitPrice = null;
//获取结算单价
List<PriceDispatchAddClientVO> priceDispatchAddClientVOS = basicdataPriceClient.dispatchAddPrice(BasicdatPriceApiVO.builder().clientId(p.getClientId().toString()).brandId(p.getBrandId().toString()).build());
if (Func.isEmpty(priceDispatchAddClientVOS)) {
//此客户品牌下无单价信息
unitPrice = new BigDecimal(BigInteger.ZERO);
}
switch (conditions) {
case 1:
//查询订制品结算品类
BasicdataFactoryCategoryEntity entity1 = new BasicdataFactoryCategoryEntity();
entity1.setFirsts(p.getFirsts());
entity1.setSeconds(p.getSecond());
entity1.setThirds(p.getThirdProduct());
entity1.setMaterielName(p.getMaterialName());
entity1.setBrandId(p.getBrandId());
BasicdataFactoryCategoryEntity factoryCategoryEntity1 = basicdataFactoryCategoryClient.findEntityByThreeCategory(entity1);
if (Func.isEmpty(factoryCategoryEntity1)){
unitPrice = new BigDecimal(BigInteger.ZERO);
}
if (!Func.isEmpty(priceDispatchAddClientVOS)&&Func.isNotEmpty(factoryCategoryEntity1)){
//获取单价
unitPrice = getUnitPrice(priceDispatchAddClientVOS,factoryCategoryEntity1,distributionAppAddvalueDTO);
}
//判定该包件是否属于该客户
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionAppAddvalueDTO.getReservationId());
if (Func.isEmpty(distributionAppAddvalueDTO.getFee())){
Integer conditions = p.getConditions();
//获取结算单价
List<PriceDispatchAddClientVO> priceDispatchAddClientVOS = basicdataPriceClient.dispatchAddPrice(BasicdatPriceApiVO.builder().clientId(p.getClientId().toString()).brandId(p.getBrandId().toString()).build());
if (Func.isEmpty(priceDispatchAddClientVOS)) {
//此客户品牌下无单价信息
unitPrice = new BigDecimal(BigInteger.ZERO);
}
switch (conditions) {
case 1:
//查询订制品结算品类
BasicdataFactoryCategoryEntity entity1 = new BasicdataFactoryCategoryEntity();
entity1.setFirsts(p.getFirsts());
entity1.setSeconds(p.getSecond());
entity1.setThirds(p.getThirdProduct());
entity1.setMaterielName(p.getMaterialName());
entity1.setBrandId(p.getBrandId());
BasicdataFactoryCategoryEntity factoryCategoryEntity1 = basicdataFactoryCategoryClient.findEntityByThreeCategory(entity1);
if (Func.isEmpty(factoryCategoryEntity1)){
unitPrice = new BigDecimal(BigInteger.ZERO);
}
if (!Func.isEmpty(priceDispatchAddClientVOS)&&Func.isNotEmpty(factoryCategoryEntity1)){
//获取单价
unitPrice = getUnitPrice(priceDispatchAddClientVOS,factoryCategoryEntity1,distributionAppAddvalueDTO);
}
//判定该包件是否属于该客户
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionAppAddvalueDTO.getReservationId());
// boolean packageFlag = parcelListEntities.stream().allMatch(pack -> !Func.equals(pack.getId(), p.getPackageId()));
boolean packageFlag = parcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()).contains(p.getPackageId());
if (!packageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
case 2:
BasicdataFactoryCategoryEntity entity2 = new BasicdataFactoryCategoryEntity();
entity2.setMaterielName(p.getMaterialName());
BasicdataFactoryCategoryEntity factoryCategoryEntity2 = basicdataFactoryCategoryClient.findEntityByMaterielName(entity2);
if (Func.isEmpty(factoryCategoryEntity2)){
unitPrice = new BigDecimal(BigInteger.ZERO);
}
if (!Func.isEmpty(priceDispatchAddClientVOS)&&Func.isNotEmpty(factoryCategoryEntity2)){
//获取单价
unitPrice = getUnitPrice(priceDispatchAddClientVOS,factoryCategoryEntity2,distributionAppAddvalueDTO);
}
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionAppAddvalueDTO.getReservationId());
boolean packageFlag = parcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()).contains(p.getPackageId());
if (!packageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
case 2:
BasicdataFactoryCategoryEntity entity2 = new BasicdataFactoryCategoryEntity();
entity2.setMaterielName(p.getMaterialName());
BasicdataFactoryCategoryEntity factoryCategoryEntity2 = basicdataFactoryCategoryClient.findEntityByMaterielName(entity2);
if (Func.isEmpty(factoryCategoryEntity2)){
unitPrice = new BigDecimal(BigInteger.ZERO);
}
if (!Func.isEmpty(priceDispatchAddClientVOS)&&Func.isNotEmpty(factoryCategoryEntity2)){
//获取单价
unitPrice = getUnitPrice(priceDispatchAddClientVOS,factoryCategoryEntity2,distributionAppAddvalueDTO);
}
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionAppAddvalueDTO.getReservationId());
// boolean inventoryPackageFlag = detailEntities.stream().allMatch(pack -> !Func.equals(pack.getId(), p.getPackageId()));
boolean inventoryPackageFlag = detailEntities.stream().map(DisStockListDetailEntity::getId).collect(Collectors.toList()).contains(p.getPackageId());
if (!inventoryPackageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
case 3:
BasicdataFactoryCategoryEntity entity3 = new BasicdataFactoryCategoryEntity();
entity3.setMaterielName(p.getMaterialName());
BasicdataFactoryCategoryEntity factoryCategoryEntity3 = basicdataFactoryCategoryClient.findEntityByCategoryName(entity3);
if (Func.isEmpty(factoryCategoryEntity3)){
unitPrice = new BigDecimal(BigInteger.ZERO);
}
if (!Func.isEmpty(priceDispatchAddClientVOS)&&Func.isNotEmpty(factoryCategoryEntity3)){
//获取单价
unitPrice = getUnitPrice(priceDispatchAddClientVOS,factoryCategoryEntity3,distributionAppAddvalueDTO);
}
List<DistributionParcelNumberDTO> distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(distributionAppAddvalueDTO.getReservationId());
boolean inventoryPackageFlag = detailEntities.stream().map(DisStockListDetailEntity::getId).collect(Collectors.toList()).contains(p.getPackageId());
if (!inventoryPackageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
case 3:
BasicdataFactoryCategoryEntity entity3 = new BasicdataFactoryCategoryEntity();
entity3.setMaterielName(p.getMaterialName());
BasicdataFactoryCategoryEntity factoryCategoryEntity3 = basicdataFactoryCategoryClient.findEntityByCategoryName(entity3);
if (Func.isEmpty(factoryCategoryEntity3)){
unitPrice = new BigDecimal(BigInteger.ZERO);
}
if (!Func.isEmpty(priceDispatchAddClientVOS)&&Func.isNotEmpty(factoryCategoryEntity3)){
//获取单价
unitPrice = getUnitPrice(priceDispatchAddClientVOS,factoryCategoryEntity3,distributionAppAddvalueDTO);
}
List<DistributionParcelNumberDTO> distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(distributionAppAddvalueDTO.getReservationId());
// boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().allMatch(pack -> !Func.equals(pack.getId(), p.getPackageId()));
boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getId).collect(Collectors.toList()).contains(p.getPackageId());
if (!zeroPackageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getId).collect(Collectors.toList()).contains(p.getPackageId());
if (!zeroPackageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
}
}else {
unitPrice = finalCurrencyUnitPrice;
}
p.setAddvalueDetailId(distributionAddvalueDetailEntity.getId());
DistributionAddvaluePackageEntity addvaluePackageEntity = Func.copy(p, DistributionAddvaluePackageEntity.class);
if (Func.isNotEmpty(p.getZeroQuantity())) {
@ -563,6 +607,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
addvaluePackageEntity.setUnitPrice(unitPrice);
addvaluePackageEntity.setFee(unitPrice.multiply(new BigDecimal(p.getQuantity())));
addvaluePackageEntity.setScanUserName(AuthUtil.getNickName());
addvaluePackageEntity.setRecordType("1");
addvaluePackageEntities.add(addvaluePackageEntity);
}
});
@ -580,6 +625,16 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
}
private List<DistributionAddvaluePackageDTO> handleAddvaluePackageEntity(List<DistributionAddvaluePackageVO> records) {
List<DistributionAddvaluePackageDTO> packageDTOList= new ArrayList<>();
records.forEach(r->{
DistributionAddvaluePackageDTO dto = Func.copy(r, DistributionAddvaluePackageDTO.class);
packageDTOList.add(dto);
});
return packageDTOList;
}
private BigDecimal getUnitPrice(List<PriceDispatchAddClientVO> priceDispatchAddClientVOS, BasicdataFactoryCategoryEntity factoryCategoryEntity, DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<PriceDispatchAddClientVO> collect = priceDispatchAddClientVOS.stream().filter(f -> f.getCategoryId().equals(factoryCategoryEntity.getId())).collect(Collectors.toList());
@ -860,31 +915,65 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
@Override
@Transactional
public R cancelSignAddValuePackage(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageDTO> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
List<DistributionAddvaluePackageDTO> packageEntityList = new ArrayList<>();
if (distributionAppAddvalueDTO.getAddvalueType().equals("2") || distributionAppAddvalueDTO.getAddvalueType().equals("6")){
//专车和超区进行全部包件查询
Map<String, Object> addValueDTO = new HashMap<>();
addValueDTO.put("reservationId",distributionAppAddvalueDTO.getReservationId().toString());
//超区需要默认当前所有包件
List<DistributionAddvaluePackageDTO> superZoneList = distributionSignforService.checkAddValuePCPackageList(distributionAppAddvalueDTO.getReservationId());
if (!superZoneList.isEmpty()) {
packageEntityList = superZoneList;
}
}else {
packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
}
if (Func.isEmpty(packageEntityList)) {
log.error("################在干什么?参数都不会传");
return R.fail("在干什么?参数都不会传");
return R.fail("无包件信息进行移除");
}
//查询增值服务详情
DistributionAddvalueDetailEntity distributionAddvalueDetailEntity = distributionAddvalueDetailMapper.selectById(distributionAppAddvalueDTO.getAddvalueDetailId());
if (Func.isEmpty(distributionAddvalueDetailEntity)){
log.error("################查询增值服务详情错误id:{}",distributionAppAddvalueDTO.getAddvalueDetailId());
}
DistributionAddvalueEntity addvalueEntity = this.getById(distributionAddvalueDetailEntity.getAddvalueId());
if (Func.isEmpty(addvalueEntity)){
log.error("################查询增值服务错误id:{}",distributionAddvalueDetailEntity.getAddvalueId());
}
AtomicReference<BigDecimal> newFee = new AtomicReference<>(BigDecimal.ZERO);
List<Long> packageIds = packageEntityList.stream().map(DistributionAddvaluePackageDTO::getPackageId).collect(Collectors.toList());
packageEntityList.forEach(p->{
newFee.set(distributionAddvalueDetailEntity.getFee().subtract(p.getUnitPrice()));
});
List<DistributionAddvaluePackageEntity> addvaluePackageEntities = distributionAddvaluePackageMapper.selectList(Wrappers.<DistributionAddvaluePackageEntity>query().lambda()
.eq(DistributionAddvaluePackageEntity::getReservationId, distributionAppAddvalueDTO.getReservationId())
.eq(DistributionAddvaluePackageEntity::getAddvalueDetailId, distributionAppAddvalueDTO.getAddvalueDetailId())
);
//查看取消增值服务的保健是否存在该项增值服务中,存在才能继续执行
boolean isExistence = packageIds.stream().allMatch(id -> addvaluePackageEntities.stream().map(DistributionAddvaluePackageEntity::getPackageId).collect(Collectors.toList()).contains(id));
if (isExistence) {
if (packageIds.size() == addvaluePackageEntities.size()) {
//这里就需要对整个增值服务项进行删除
distributionAddvalueDetailMapper.deleteAddvalueDetailById(distributionAppAddvalueDTO.getAddvalueDetailId());
distributionAddvalueMapper.deleteAddvalue(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType());
}
packageIds.forEach(id -> {
distributionAddvaluePackageMapper.deleteAddvaluePackageByDetailId(distributionAppAddvalueDTO.getReservationId(), id, distributionAppAddvalueDTO.getAddvalueDetailId());
});
} else {
log.error("###########该包件不存在增值服务项包件列表中");
return R.fail("取消包件失败,该包件不存在增值服务项列表中");
if (Objects.equals(packageIds.size(),addvaluePackageEntities.size())){
//此增值服务项进行全部取消
//这里就需要对整个增值服务项进行删除
distributionAddvalueDetailMapper.deleteAddvalueDetailById(distributionAppAddvalueDTO.getAddvalueDetailId());
distributionAddvalueMapper.deleteAddvalue(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType());
}else {
int sum = packageEntityList.stream().mapToInt(DistributionAddvaluePackageEntity::getQuantity).sum();
//维护详情的件数和金额
distributionAddvalueDetailEntity.setFee(newFee.get());
distributionAddvalueDetailEntity.setNum(distributionAddvalueDetailEntity.getNum() - sum);
distributionAddvalueDetailMapper.updateById(distributionAddvalueDetailEntity);
}
//查看取消增值服务的保健是否存在该项增值服务中,存在才能继续执行
boolean isExistence = packageIds.stream().allMatch(id -> addvaluePackageEntities.stream().map(DistributionAddvaluePackageEntity::getPackageId).collect(Collectors.toList()).contains(id));
if (isExistence) {
packageIds.forEach(id -> {
distributionAddvaluePackageMapper.deleteAddvaluePackageByDetailId(distributionAppAddvalueDTO.getReservationId(), id, distributionAppAddvalueDTO.getAddvalueDetailId());
});
} else {
log.error("###########该包件不存在增值服务项包件列表中");
return R.fail("取消包件失败,该包件不存在增值服务项列表中");
}
return R.success("操作成功");
}
@ -895,10 +984,13 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
if (Func.isEmpty(packageEntityList)) {
return R.fail("无包件信息");
}
final BigDecimal[] totalFee = {BigDecimal.ZERO};
Map<Long, DistributionAddvaluePackageDTO> packageDTOMap = packageEntityList.stream().collect(Collectors.toMap(DistributionAddvaluePackageDTO::getPackageId, Function.identity(), (k1, k2) -> k2));
List<Long> zeroPackageIds = packageEntityList.stream().filter(p -> p.getConditions() == 3).collect(Collectors.toList()).stream().map(DistributionAddvaluePackageDTO::getPackageId).collect(Collectors.toList());
//这里需要查询出原来的增值服务项详情
DistributionAddvalueDetailEntity detailEntity = distributionAddvalueDetailMapper.selectById(distributionAppAddvalueDTO.getAddvalueDetailId());
totalFee[0] = totalFee[0].add(detailEntity.getFee());
//查询出对应所有增值服务项的包件信息
List<DistributionAddvaluePackageEntity> addvaluePackageEntities = distributionAddvaluePackageMapper.selectList(Wrappers.<DistributionAddvaluePackageEntity>query().lambda()
.eq(DistributionAddvaluePackageEntity::getReservationId, distributionAppAddvalueDTO.getReservationId())
@ -927,9 +1019,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
if (Strings.isBlank(string)) {
log.info("计算成本失败>>>>>>>>>:{}", string);
}
if (increasePackage.size() > 0) {
//统计该项增值服务包件数量
int num = detailEntity.getNum() + increasePackage.size();
detailEntity.setNum(num);
@ -941,13 +1031,6 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
detailEntity.setFloolNum(distributionAppAddvalueDTO.getFloolNum());
}
break;
case "2":
if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) {
return Resp.scanFail("添加失败", "请输入超区公里数");
} else {
detailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
case "3":
if (Func.isEmpty(distributionAppAddvalueDTO.getDistance())) {
return Resp.scanFail("添加失败", "请输入平移距离");
@ -955,44 +1038,88 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
detailEntity.setDistance(distributionAppAddvalueDTO.getDistance());
}
break;
// case "4":
// case "5":
// if (Func.isEmpty(distributionAppAddvalueDTO.getNum())) {
// return Resp.scanFail("添加失败", "请输入件数");
// } else {
// detailEntity.setNum(num);
// }
// break;
// case "6":
// if (Func.isEmpty(distributionAppAddvalueDTO.getFee())) {
// return Resp.scanFail("添加失败", "错误的包件数量");
// } else {
// detailEntity.setFee(distributionAppAddvalueDTO.getFee());
// }
// break;
default:
return Resp.scanFail("添加失败", "服务器正忙");
}
detailEntity.setFee(distributionAppAddvalueDTO.getFee());
detailEntity.setNum(num);
distributionAddvalueDetailMapper.updateById(detailEntity);
//查询价格模板
//basicdataPriceClient.dispatchAddPrice();
//添加新的包件信息
increasePackage.forEach(ip -> {
if (Func.isNotEmpty(packageDTOMap.get(ip))) {
//新增包件
BigDecimal unitPrice = null;
//计算包件单价
DistributionAddvaluePackageDTO distributionAddvaluePackageDTO = packageDTOMap.get(ip);
List<PriceDispatchAddClientVO> priceDispatchAddClientVOS = basicdataPriceClient.dispatchAddPrice(BasicdatPriceApiVO.builder().clientId(distributionAddvaluePackageDTO.getClientId().toString()).brandId(distributionAddvaluePackageDTO.getClientId().toString()).build());
//查询价格模板
if (Func.isEmpty(priceDispatchAddClientVOS)){
//TODO 结算品类
unitPrice = BigDecimal.ZERO;
}
DistributionAddvaluePackageDTO dto = packageDTOMap.get(ip);
switch (dto.getConditions()) {
case 1:
//查询订制品结算品类
BasicdataFactoryCategoryEntity entity1 = new BasicdataFactoryCategoryEntity();
entity1.setFirsts(dto.getFirsts());
entity1.setSeconds(dto.getSecond());
entity1.setThirds(dto.getThirdProduct());
entity1.setMaterielName(dto.getMaterialName());
entity1.setBrandId(dto.getBrandId());
BasicdataFactoryCategoryEntity factoryCategoryEntity1 = basicdataFactoryCategoryClient.findEntityByThreeCategory(entity1);
if (Func.isEmpty(factoryCategoryEntity1)){
unitPrice = new BigDecimal(BigInteger.ZERO);
}
if (!Func.isEmpty(priceDispatchAddClientVOS)&&Func.isNotEmpty(factoryCategoryEntity1)){
//获取单价
unitPrice = getUnitPrice(priceDispatchAddClientVOS,factoryCategoryEntity1,distributionAppAddvalueDTO);
}
//判定该包件是否属于该客户
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distributionAppAddvalueDTO.getReservationId());
// boolean packageFlag = parcelListEntities.stream().allMatch(pack -> !Func.equals(pack.getId(), p.getPackageId()));
boolean packageFlag = parcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()).contains(dto.getPackageId());
if (!packageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
case 2:
BasicdataFactoryCategoryEntity entity2 = new BasicdataFactoryCategoryEntity();
entity2.setMaterielName(dto.getMaterialName());
BasicdataFactoryCategoryEntity factoryCategoryEntity2 = basicdataFactoryCategoryClient.findEntityByMaterielName(entity2);
if (Func.isEmpty(factoryCategoryEntity2)){
unitPrice = new BigDecimal(BigInteger.ZERO);
}
if (!Func.isEmpty(priceDispatchAddClientVOS)&&Func.isNotEmpty(factoryCategoryEntity2)){
//获取单价
unitPrice = getUnitPrice(priceDispatchAddClientVOS,factoryCategoryEntity2,distributionAppAddvalueDTO);
}
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionAppAddvalueDTO.getReservationId());
boolean inventoryPackageFlag = detailEntities.stream().map(DisStockListDetailEntity::getId).collect(Collectors.toList()).contains(dto.getPackageId());
if (!inventoryPackageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
case 3:
BasicdataFactoryCategoryEntity entity3 = new BasicdataFactoryCategoryEntity();
entity3.setMaterielName(dto.getMaterialName());
BasicdataFactoryCategoryEntity factoryCategoryEntity3 = basicdataFactoryCategoryClient.findEntityByCategoryName(entity3);
if (Func.isEmpty(factoryCategoryEntity3)){
unitPrice = new BigDecimal(BigInteger.ZERO);
}
if (!Func.isEmpty(priceDispatchAddClientVOS)&&Func.isNotEmpty(factoryCategoryEntity3)){
//获取单价
unitPrice = getUnitPrice(priceDispatchAddClientVOS,factoryCategoryEntity3,distributionAppAddvalueDTO);
}
List<DistributionParcelNumberDTO> distributionParcelNumberDTOS = distributionReservationMapper.selectZeroPackageListByReservationId(distributionAppAddvalueDTO.getReservationId());
// boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().allMatch(pack -> !Func.equals(pack.getId(), p.getPackageId()));
boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getId).collect(Collectors.toList()).contains(dto.getPackageId());
if (!zeroPackageFlag) {
throw new RuntimeException("不属于该客户包件");
}
break;
}
//查询价格模板
DistributionAddvaluePackageEntity distributionAddvaluePackageEntity = distributionAddvaluePackageMapper.selectOne(Wrappers.<DistributionAddvaluePackageEntity>query().lambda()
.eq(DistributionAddvaluePackageEntity::getReservationId, distributionAddvaluePackageDTO.getReservationId())
@ -1021,7 +1148,6 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
}
}
} else {
DistributionAddvaluePackageEntity addvaluePackageEntity = new DistributionAddvaluePackageEntity();
addvaluePackageEntity.setAddvalueDetailId(distributionAddvaluePackageDTO.getAddvalueDetailId());
addvaluePackageEntity.setStockArticleId(distributionAddvaluePackageDTO.getStockArticleId());
@ -1031,6 +1157,10 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
addvaluePackageEntity.setPackageId(distributionAddvaluePackageDTO.getPackageId());
addvaluePackageEntity.setReservationId(distributionAddvaluePackageDTO.getReservationId());
addvaluePackageEntity.setQuantity(distributionAddvaluePackageDTO.getQuantity());
addvaluePackageEntity.setClientId(distributionAddvaluePackageDTO.getClientId());
addvaluePackageEntity.setClientName(distributionAddvaluePackageDTO.getClientName());
addvaluePackageEntity.setBrandId(distributionAddvaluePackageDTO.getBrandId());
addvaluePackageEntity.setBrandName(distributionAddvaluePackageDTO.getBrandName());
if (distributionAddvaluePackageDTO.getConditions() == 1) {
//新增订制品
addvaluePackageEntity.setOrderPackageCode(distributionAddvaluePackageDTO.getOrderPackageCode());
@ -1043,11 +1173,20 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
addvaluePackageEntity.setRecordType("3");
addvaluePackageEntity.setConditions(2);
}
addvaluePackageEntity.setRecordType("1");
addvaluePackageEntity.setScanUserName(AuthUtil.getNickName());
addvaluePackageEntity.setUnitPrice(unitPrice);
totalFee[0] = totalFee[0].add(unitPrice.multiply(BigDecimal.valueOf(addvaluePackageEntity.getQuantity())));
addvaluePackageEntity.setFee(unitPrice.multiply(BigDecimal.valueOf(addvaluePackageEntity.getQuantity())));
distributionAddvaluePackageService.save(addvaluePackageEntity);
}
}
});
//进行详情维护
detailEntity.setFee(totalFee[0]);
detailEntity.setNum(num);
distributionAddvalueDetailMapper.updateById(detailEntity);
}
return R.status(true);
}

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

@ -5377,7 +5377,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//TODO
// warehouseUpdownStockUpAreaClient.downStockUpShelf(jsonObjects);
if (Func.isNotEmpty(packageCodes)) {
distributionAsyncService.handlPakcage(packageIds, myCurrentWarehouse.getId());
//批量下架
String collected = packageCodes.stream().distinct().collect(Collectors.joining(","));
log.info(method + "司机批量签收进行包件下架:{}", collected);
@ -5392,7 +5391,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//批量维护订单信息
if (Func.isNotEmpty(orderCodes)) {
String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCode, myCurrentWarehouse.getId());
distributionStockArticleService.maintenanceOrderInfo(orderCode, reservationEntity.getWarehouseId());
}
//维护客户信息状态
@ -6683,6 +6682,56 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R.success("异常驳回成功");
}
@Override
public List<DistributionAddvaluePackageDTO> checkAddValuePCPackageList(Long reservationId) {
if (Func.isEmpty(reservationId)) {
log.error("##################无reservationId");
return null;
}
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(reservationId);
List<DistributionAddvaluePackageVO> addvaluePackageVOS = new ArrayList<>();
Map<String, Object> addValueDTO = new HashMap<>();
if (Func.isNotEmpty(reservationStockarticleEntityList)) {
List<Long> orderIds = reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList());
LambdaQueryWrapper<DistributionStockArticleEntity> orderQW = Wrappers.<DistributionStockArticleEntity>query().lambda().in(DistributionStockArticleEntity::getId, orderIds);
List<DistributionStockArticleEntity> orderList = distributionStockArticleService.list(orderQW);
orderList.forEach(rs -> {
if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())) {
List<DistributionAddvaluePackageVO> addvaluepackageVO = distributionAddvalueMapper.selectAddvaluePackageVO(reservationId, rs.getId(), addValueDTO);
if (Func.isNotEmpty(addvaluepackageVO)) {
addvaluePackageVOS.addAll(addvaluepackageVO);
}
} else {
List<DistributionAddvaluePackageVO> addvalueZeroPackageVO = distributionAddvalueMapper.selectAddvalueZeroPackageVO(reservationId, rs.getId(), addValueDTO);
if (Func.isNotEmpty(addvalueZeroPackageVO)) {
addvaluePackageVOS.addAll(addvalueZeroPackageVO);
}
}
});
}
List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(reservationId);
if (Func.isNotEmpty(distributionReservationStocklistEntities)) {
List<Long> inventoryIds = distributionReservationStocklistEntities.stream().map(DistributionReservationStocklistEntity::getStocklistId).collect(Collectors.toList());
LambdaQueryWrapper<DistributionStockListEntity> inventoryQW = Wrappers.<DistributionStockListEntity>query().lambda().in(DistributionStockListEntity::getId, inventoryIds);
List<DistributionStockListEntity> stockListEntityList = distributionStockListService.list(inventoryQW);
stockListEntityList.forEach(inven -> {
List<DistributionAddvaluePackageVO> addvalueinventoryPackageVO = distributionAddvalueMapper.selectAddvalueInventoryPackageVO(reservationId, inven.getId(), addValueDTO);
if (Func.isNotEmpty(addvalueinventoryPackageVO)) {
addvaluePackageVOS.addAll(addvalueinventoryPackageVO);
}
});
}
List<DistributionAddvaluePackageDTO> list = new ArrayList<>();
if (!addvaluePackageVOS.isEmpty()) {
addvaluePackageVOS.forEach(a->{
DistributionAddvaluePackageDTO dto = Func.copy(a, DistributionAddvaluePackageDTO.class);
list.add(dto);
});
}
return list;
}
private void buildNameAndPhone(List<SignPushDataUnitDTO> pushOldPackageSigning) {
for (SignPushDataUnitDTO signPushDataUnitDTO : pushOldPackageSigning) {
User user = bladeRedis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getAdministratorsId());

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

@ -2212,7 +2212,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
}
if (deliveryQuantity == 0){
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue());
}
if (signingQuantity == 0) {
stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());

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

@ -2065,6 +2065,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
log.error("#########################无可用包件orderIds:{}", zeroOrderIds);
throw new RuntimeException(zeroOrderIds + "无可用包件");
}
List<DistributionReservationZeroPackageEntity> zeroPackageList = new ArrayList<>();
parcelNumberEntityList.forEach(zp -> {
//查询包件
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(zp.getParcelListId());
@ -2073,16 +2074,22 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
distributionReservationZeroPackageEntity.setParcelListId(zp.getParcelListId());
distributionReservationZeroPackageEntity.setStockArticleId(zp.getStockArticleId());
distributionReservationZeroPackageEntity.setType("3");
distributionReservationZeroPackageEntity.setReservationId(distrilbutionBillLading.getId());
distributionReservationZeroPackageEntity.setZeroPackageStatus("3");
distributionReservationZeroPackageEntity.setCategoryName(parcelListEntity.getFirsts());
log.info(">>>>>>>>>>>>>>>>>>>>>>>>零担品类增加计划数量getHandQuantity:{}getDeliveryQuantity:{}(zp.getHandQuantity() - zp.getDeliveryQuantity()):{}", zp.getHandQuantity(), zp.getDeliveryQuantity(), (zp.getHandQuantity() - zp.getDeliveryQuantity()));
distributionParcelNumberService.updateBillNum(zp.getParcelListId(), (zp.getHandQuantity() - zp.getDeliveryQuantity()), 1);
zeroPackageList.add(distributionReservationZeroPackageEntity);
});
List<Long> collect = parcelNumberEntityList.stream().map(DistributionParcelNumberEntity::getParcelListId).collect(Collectors.toList());
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update()
.in("id", collect)
.set("order_package_reservation_status", OrderPackageReservationStatusConstant.daiyuyue.getValue())
);
if (!zeroPackageList.isEmpty()) {
distributionZeroPackageService.saveBatch(zeroPackageList);
}
}
}
if (!packageEntityList.isEmpty()) {

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

@ -41,7 +41,7 @@
lww.consignee_address consigneeAddress,
lww.remark remark,
lww.total_count-lww.billlading_num totalPlanNum,
ltbw.plan_num planNum,
lww.total_count-lww.billlading_num + ltbw.real_num planNum,
ltbw.real_num realNum,
ltbw.billlading_fee billladingFee,
lww.collect_pay collectPay,

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

@ -313,6 +313,9 @@
ltco.order_code orderCode,
ltco.waybill_id waybillId,
ltco.waybill_no waybillNo,
ltco.node_id nodeId,
ltco.node_name nodeName,
ltco.final_node_id finalNodeId,
lww.create_time createTime,
lww.destination destination,
lww.destination_warehouse_name destinationWarehouseName,
@ -334,13 +337,13 @@
where ltco.load_id = #{param.loadId}
and ltco.final_node_id = #{param.finalNodeId}
and ldpl.is_deleted = 0
<if test="param.warehouseId != null">
and ldpl.warehouse_id = #{param.warehouseId}
</if>
group by ltco.id,
ltco.order_code,
ltco.waybill_id,
ltco.waybill_no,
ltco.node_id,
ltco.node_name,
ltco.final_node_id,
lww.create_time,
lww.destination,
lww.destination_warehouse_name,

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

@ -228,7 +228,7 @@ public class InComingServiceImpl implements IInComingService {
return Resp.scanFail(405, "包件无数据", "包件无数据");
}
if(incomingType == 1 && incomingType == 2){
if(incomingType == 1 || incomingType == 2){
for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : advanceDetailEntityList) {
Long warehouseId1 = trunklineAdvanceDetailEntity.getWarehouseId();
if(!warehouseId1.equals(warehouseId)){

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

@ -873,7 +873,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService {
Integer realNum = billladingNoWaybillEntity.getRealNum();
if (realNum > num) {
billladingNoWaybillEntity.setRealNum(realNum - num);
} else if (realNum.equals(num)) {
} else {
billladingNoWaybillEntity.setRealNum(0);
billladingNoWaybillEntity.setIsDeleted(1);
}

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

@ -147,6 +147,8 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
billladingWaybillEntity.setRealWeight(BigDecimal.ZERO);
billladingWaybillEntity.setRealVolume(BigDecimal.ZERO);
billladingWaybillEntity.setBillladingFee(BigDecimal.ZERO);
billladingWaybillEntity.setWarehouseId(warehouseId);
billladingWaybillEntity.setWarehouseName(warehouseName);
saveBillladingWaybillList.add(billladingWaybillEntity);
}
}
@ -383,7 +385,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
TrunklineBillladingLogEntity logEntity = new TrunklineBillladingLogEntity();
logEntity.setWarehouseId(warehouseId);
logEntity.setWarehouseName(warehouseName);
logEntity.setCreateUserName(AuthUtil.getUserName());
logEntity.setCreateUserName(AuthUtil.getNickName());
logEntity.setBillladingId(billladingId);
logEntity.setBeforeOpreation(JSON.toJSONString(billladingEntity));
@ -696,14 +698,20 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl<TrunklineBil
return R.fail(405,"总提货数大于运单总数量");
}
TrunklineBillladingWaybillEntity entity = new TrunklineBillladingWaybillEntity();
TrunklineBillladingWaybillEntity entity = billladingWaybillService.findEntityByWaybillIdAndBillladingId(waybillId, billladingId);
if(!Objects.isNull(entity)){
log.warn("#############addWaybillToBillladingId: 运单已绑定到该提货单 totalCount={} finishNum={} enterNum={}",totalCount,finishNum,enterNum);
return R.fail(405,"运单已绑定到该提货单");
}
entity = new TrunklineBillladingWaybillEntity();
entity.setWarehouseId(warehouseId);
entity.setWarehouseName(warehouseName);
entity.setBillladingId(billladingId);
entity.setBilladingCode(trunklineBillladingEntity.getBillladingCode());
entity.setWaybillId(waybillId);
entity.setWaybillNo(waybillNo);
entity.setRealNum(warehouseWaybillEntity.getTotalCount()-warehouseWaybillEntity.getBillladingNum());
entity.setRealNum(enterNum);
entity.setRealWeight(BigDecimal.ZERO);
entity.setRealVolume(BigDecimal.ZERO);
entity.setBillladingFee(BigDecimal.ZERO);

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

@ -6694,6 +6694,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String trayName = null;
String trayCode = null;
String orderCode = null;
Integer isTransfer = 0;
//判断包件是否已入库
DistributionParcelListEntity distributionParcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
@ -6872,10 +6873,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
BeanUtil.copy(nowParcelListEntity, distributionParcelListEntity);
distributionParcelListEntity.setId(null);
distributionParcelListEntity.setIsTransfer(1);
isTransfer = 1;
if (!Objects.isNull(warehouseWaybillEntity)) {
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if (destinationWarehouseId.equals(warehouseId)) {
distributionParcelListEntity.setIsTransfer(0);
isTransfer = 0;
}
}
distributionParcelListEntity.setAdvanceId(nowParcelListEntity.getAdvanceId());
@ -6900,8 +6903,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if (destinationWarehouseId.equals(warehouseId)) {
distributionParcelListEntity.setIsTransfer(0);
isTransfer = 0;
} else {
distributionParcelListEntity.setIsTransfer(1);
isTransfer = 1;
}
}
distributionParcelListClient.update(distributionParcelListEntity);
@ -7040,10 +7045,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
BeanUtil.copy(parcelListEntity, distributionParcelListEntity);
distributionParcelListEntity.setId(null);
distributionParcelListEntity.setIsTransfer(1);
isTransfer = 1;
if (!Objects.isNull(warehouseWaybillEntity)) {
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if (destinationWarehouseId.equals(warehouseId)) {
distributionParcelListEntity.setIsTransfer(0);
isTransfer = 0;
}
}
distributionParcelListEntity.setAdvanceId(parcelListEntity.getAdvanceId());
@ -7068,8 +7075,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if (destinationWarehouseId.equals(warehouseId)) {
distributionParcelListEntity.setIsTransfer(0);
isTransfer = 0;
} else {
distributionParcelListEntity.setIsTransfer(1);
isTransfer = 1;
}
}
distributionParcelListClient.update(distributionParcelListEntity);
@ -7187,8 +7196,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if (destinationWarehouseId.equals(warehouseId)) {
distributionParcelListEntity.setIsTransfer(0);
isTransfer = 0;
} else {
distributionParcelListEntity.setIsTransfer(1);
isTransfer = 1;
}
}
distributionParcelListEntity.setWarehouseId(warehouseId);
@ -7210,8 +7221,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();//目的仓
if (destinationWarehouseId.equals(warehouseId)) {
distributionParcelListEntity.setIsTransfer(0);
isTransfer = 0;
} else {
distributionParcelListEntity.setIsTransfer(1);
isTransfer = 1;
}
}
distributionParcelListClient.update(distributionParcelListEntity);
@ -7373,6 +7386,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
String trayName = null;
String trayCode = null;
String orderCode = null;
Integer isTransfer = 0;
//判断包件是否已入库
DistributionParcelListEntity distributionParcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);

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

@ -21,7 +21,7 @@ import java.util.concurrent.ThreadPoolExecutor;
@Configuration
@Slf4j
@EnableAsync
public class ExecutorConfig {
public class ExecutorConfig {
@Bean
public Executor asyncExecutor() {

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

@ -50,6 +50,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.jetbrains.annotations.Nullable;
import org.mapstruct.factory.Mappers;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.exception.CustomerException;
@ -196,8 +197,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
QuestDetailEntity detailEntity = buildQuestDetailEntity(taskQuest, i, user, trayEntityList);
if (detailEntity == null) {
return;
}
return;
}
detailEntityList.add(detailEntity);
});
@ -258,32 +259,24 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntity.setBrandName(i.getBrandName());
detailEntity.setHasData(1);
// detailEntity.setQuestType();
//盘点对象;1.定制品 2零担 3 库存品
//盘点对象;1 定制品 2 库存品 3零担
//查询托盘名称
if (ObjectUtils.isNotNull(i.getTrayId())) {
// boolean b = trayEntityList.stream().anyMatch(a -> i.getTrayId().equals(String.valueOf(a.getId()) ));
// log.info("托盘是否有值>>>>>>>>>>{}",b);
// Optional<BasicdataTrayEntity> first = trayEntityList.stream().filter(t -> i.getTrayId().equals(String.valueOf(t.getId()))).findFirst();
// if (first.isPresent()) {
// BasicdataTrayEntity basicdataTrayEntity = first.get();
// detailEntity.setTrayName(basicdataTrayEntity.getPalletName());
// }
}
Integer conditions = i.getConditions();
if (conditions.equals(1)) {
if (1==conditions) {
detailEntity.setQuestTarget(1);
} else if (conditions.equals(2)) {
} else if (2==conditions) {
detailEntity.setQuestTarget(3);
}
if (ObjectUtils.isNotNull(i.getConditions()) && i.getConditions().equals(1)) {
detailEntity.setQuestTarget(i.getConditions());
} else if (ObjectUtils.isNotNull(i.getConditions()) && i.getConditions().equals(2)) {
detailEntity.setQuestTarget(3); // 库存品
} else {
log.info("包件信息!数据信息不存在!!");
}else if( 3==conditions){
detailEntity.setQuestTarget(2);
}else{
log.warn(">>>>>>>>>>> 警告 错误的包件数据类型 ,{}",i);
return null;
}
// detailEntity.setQuestTarget(1);
detailEntity.setOrderPackageCode(i.getOrderPackageCode());
detailEntity.setWaybillNumber(i.getWaybillNumber());
@ -306,11 +299,32 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntity.setMaterialCode(i.getMaterialCode());
detailEntity.setMaterialName(i.getMaterialName());
detailEntity.setMarketName(i.getMallName());
if (ObjectUtils.isNull(i.getMallName())) {
// 根据包件查询订单的上的商城信息
DistributionStockArticleEntity stockArticleEntity = getCacheEntityByStockArticleId(i);
if (ObjectUtils.isNotNull(stockArticleEntity)) {
detailEntity.setMarketName(stockArticleEntity.getMallName());
}
}
detailEntity.setIncomingBatch(i.getOrderCode());
return detailEntity;
}
private DistributionStockArticleEntity getCacheEntityByStockArticleId(DistributionParcelListEntity i) {
String key = CacheNames.tenantKeyObj(AuthUtil.getTenantId(),"getEntityByStockArticleId", i.getStockArticleId());
DistributionStockArticleEntity temp = bladeRedis.get(key);
if(ObjectUtils.isNotNull(temp)){
temp = distributionStockArticleClient.findEntityByStockArticleId(i.getStockArticleId());
if(ObjectUtils.isNotNull(temp)){
// 设定该条数据的缓存时间 10分钟
bladeRedis.setEx(key,temp,600L);
}
}
return temp;
}
/**
* 获取用户部门最大的部门ID
*
@ -453,9 +467,9 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
for (DistributionStockListVO distributionStockListVO : stockListInfo) {
// 订单转换的
if("1".equals(distributionStockListVO.getSourceType())){
if ("1".equals(distributionStockListVO.getSourceType())) {
}else {
} else {
// 导入的‘
}
@ -768,7 +782,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
* @return
*/
@Override
public R addDataInfo(TaskSearchDTO taskSearchDTO) {
log.info("开始添加数据{}", taskSearchDTO.toString());
String questNum = taskSearchDTO.getQuestNum();
@ -790,7 +803,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// 在库包件状态修改
if (ObjectUtils.isNotNull(taskSearchDTO.getQuestDetailIds()) && ObjectUtils.isNotNull(taskSearchDTO.getQuestDetailIds().get(0))) {
QuestDetailEntity quest = new QuestDetailEntity();
List<QuestDetailEntity> questDetailList = baseMapper.selectTaskInfoForIds(questNum, quest, taskSearchDTO.getQuestDetailIds());
// List<QuestDetailEntity> questDetailList = baseMapper.selectTaskInfoForIds(questNum, quest, taskSearchDTO.getQuestDetailIds());
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", 1);
List<QuestDetailEntity> list = new ArrayList<>();
@ -950,7 +963,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetail.setNewTrayId(i.getNewTrayId());
questDetail.setNewTrayCode(i.getNewTrayCode());
// 通过托盘ID 查询托盘名称
if(ObjectUtils.isNotNull(i.getNewTrayCode())){
if (ObjectUtils.isNotNull(i.getNewTrayCode())) {
BasicdataTrayEntity trayEntity = basicdataTrayClient.getTrayByTrayCode(i.getNewTrayCode());
questDetail.setNewTrayName(trayEntity.getPalletName());
}
@ -1158,13 +1171,13 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
q.setMaterialName(entityByStockArticle.getDescriptionGoods());
v.forEach(i -> {
if (i.getQuestStatus() == 1) {
yi.updateAndGet(v1 -> v1 + 1);
q.setQuestStatusName("部分盘点");
User user = UserCache.getUser(i.getUpdateUser());
q.setUpdateUser(user.getAccount());
q.setUpdateTime(i.getUpdateTime());
}
if (i.getQuestStatus() == 1) {
yi.updateAndGet(v1 -> v1 + 1);
q.setQuestStatusName("部分盘点");
User user = UserCache.getUser(i.getUpdateUser());
q.setUpdateUser(user.getAccount());
q.setUpdateTime(i.getUpdateTime());
}
q.setOrderCode(i.getOrderCode());
if (ObjectUtils.isNull(i.getGroundingPositionCode())) {
q.setGroundingPositionCode("无更新");
@ -1269,7 +1282,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
String[] split1 = i.getTrayId().split(",");
for (String s : split1) {
if(StringUtil.isNoneBlank(s)){
if (StringUtil.isNoneBlank(s)) {
List<BasicdataTrayEntity> collect = trayEntityList.stream().filter(w -> w.getId().equals(Long.valueOf(s))).collect(Collectors.toList());
//托盘
if (ObjectUtils.isNull(collect)) {
@ -1554,10 +1567,10 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
List<DistributionParcelListEntity> byPacketBarCode = distributionParcelListClient.findByPacketBarCode(packageListVO.getOrderPackageCode());
for (DistributionParcelListEntity distributionParcelListEntity : byPacketBarCode) {
if(distributionParcelListEntity.getWarehouseId().equals(taskSearchDTO.getWarehouseId())){
QuestDetailEntity questDetailEntity= buildQuestDetailEntity(taskSearchDTO.getQuestId(),distributionParcelListEntity,user,null);
if (distributionParcelListEntity.getWarehouseId().equals(taskSearchDTO.getWarehouseId())) {
QuestDetailEntity questDetailEntity = buildQuestDetailEntity(taskSearchDTO.getQuestId(), distributionParcelListEntity, user, null);
questDetailEntities.add(questDetailEntity);
baseMapper.insertQuestDetail(taskSearchDTO.getQuestNum(),questDetailEntities);
baseMapper.insertQuestDetail(taskSearchDTO.getQuestNum(), questDetailEntities);
}
}
}
@ -1652,24 +1665,24 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
if (Func.isEmpty(questDetailEntityList)) {
// 从业务系统获取数据
DistributionParcelListEntity byPacketBarCodeAndWarehouseId = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(questDetail.getCode(), taskSearchDTO.getWarehouseId());
if (ObjectUtils.isNotNull(byPacketBarCodeAndWarehouseId)){
if (ObjectUtils.isNotNull(byPacketBarCodeAndWarehouseId)) {
// 得到下面的订单信息
List<DistributionParcelListEntity> byPacketBarCode = distributionParcelListClient.findEntityListByOrderCode(byPacketBarCodeAndWarehouseId.getOrderCode(), taskSearchDTO.getWarehouseId());
if(ObjectUtils.isEmpty(byPacketBarCode)){
if (ObjectUtils.isEmpty(byPacketBarCode)) {
throw new ServiceException("包件信息不存在");
}else{
} else {
List<QuestDetailEntity> list1 = new ArrayList<>();
for (DistributionParcelListEntity distributionParcelListEntity : byPacketBarCode) {
if(distributionParcelListEntity.getWarehouseId().equals(taskSearchDTO.getWarehouseId())){
if (distributionParcelListEntity.getWarehouseId().equals(taskSearchDTO.getWarehouseId())) {
QuestDetailEntity questDetailEntity1 = buildQuestDetailEntity(taskSearchDTO.getQuestId(), distributionParcelListEntity, user, null);
// 这里新增2
questDetailEntity1.setIsNew(1);
list1.add(questDetailEntity1);
}
}
baseMapper.insertQuestDetail(taskSearchDTO.getQuestNum(),list1);
baseMapper.insertQuestDetail(taskSearchDTO.getQuestNum(), list1);
// return taskPageList.setRecords(list);
questDetailEntityList = list1;
}
@ -1855,7 +1868,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// return baseMapper.selecttrayList(page,taskSearchDTO,collect);// 查询有没有当次盘点任务的托盘数据
TaskTrayVO taskTrayVO = new TaskTrayVO();
if(list1.isEmpty()){
if (list1.isEmpty()) {
return taskTrayVO;
}
@ -2084,8 +2097,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// questDetail.setAllocationId(String.valueOf(warehouseUpdownGoodsEntity.getAllocationId()));
// }
// questDetail.setIsNew(0);//是否新增
DistributionParcelListEntity byPacketBarCodeAndWarehouseId = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(i.getAssociationValue(), warehouseId);
questDetail =buildQuestDetailEntity(taskSearchDTO.getQuestId(),byPacketBarCodeAndWarehouseId,user,null);
DistributionParcelListEntity byPacketBarCodeAndWarehouseId = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(taskSearchDTO.getCode(), warehouseId);
questDetail = buildQuestDetailEntity(taskSearchDTO.getQuestId(), byPacketBarCodeAndWarehouseId, user, null);
break;
case "4": //4库存品
questDetail.setCreateUser(user.getUserId());
@ -2123,7 +2136,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
questDetail.setQuestType(4);//托盘
questDetail.setQuestStatus(0); //包件盘点状态
questDetail.setStockNum(i.getNum()); //数量
@ -2737,7 +2749,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
if (taskSearchDTO.getTypeState().equals(1)) {
//有
if (ObjectUtils.isNull(questDetailEntity.getHasData())||questDetailEntity.getHasData().equals(0)) {
if (ObjectUtils.isNull(questDetailEntity.getHasData()) || questDetailEntity.getHasData().equals(0)) {
continue;
}
//查询包件信息
@ -2933,28 +2945,26 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// 需要去业务系统上进行查询信息
List<DistributionParcelListEntity> byPacketBarCode = distributionParcelListClient.findByPacketBarCode(questDetail.getOrderPackageCode());
if(ObjectUtils.isEmpty(byPacketBarCode)){
if (ObjectUtils.isEmpty(byPacketBarCode)) {
return R.fail(5000, "包件信息不存在!!");
}else{
} else {
for (DistributionParcelListEntity distributionParcelListEntity : byPacketBarCode) {
if(distributionParcelListEntity.getWarehouseId().equals(warehouseId)){
if (distributionParcelListEntity.getWarehouseId().equals(warehouseId)) {
QuestDetailEntity questDetailEntity1 = buildQuestDetailEntity(questId, distributionParcelListEntity, user, null);
// 这里新增2
questDetailEntity1.setIsNew(1);
List<QuestDetailEntity> list = Arrays.asList(questDetailEntity1);
baseMapper.insertQuestDetail(taskSearchDTO.getQuestNum(),list);
baseMapper.insertQuestDetail(taskSearchDTO.getQuestNum(), list);
return R.data(list);
}
}
}
}
for (QuestDetailEntity i : questDetailEntityList) {
if (i.getQuestStatus().equals(1)) {
@ -3459,7 +3469,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
public List<TaskQueryDataExcel> exportContrastStockInfo(QuestDetailDTO questDetailDTO) {
List<TaskQueryDataExcel> datas = baseMapper.selectContrastStockInfo(questDetailDTO.getQuestNum(),questDetailDTO.getQuestStatus());
List<TaskQueryDataExcel> datas = baseMapper.selectContrastStockInfo(questDetailDTO.getQuestNum(), questDetailDTO.getQuestStatus());
return datas;

Loading…
Cancel
Save