Browse Source

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

master
zhaoqiaobo 10 months ago
parent
commit
fb21428a73
  1. 9
      blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java
  2. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java
  3. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java
  4. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/config/RabbitMqConfiguration.java
  5. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.xml
  7. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  8. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  9. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  10. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  11. 44
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  12. 45
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BillLadingScanDataQueueHandler.java
  13. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  14. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationPackageService.java
  15. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  16. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  17. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  18. 38
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationPackageServiceImpl.java
  19. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  20. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  21. 820
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  22. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayTypeMapper.java
  23. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayTypeMapper.xml
  24. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java
  25. 120
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

9
blade-biz-common/src/main/java/org/springblade/common/constant/RabbitConstant.java

@ -226,4 +226,13 @@ public interface RabbitConstant {
/****************老系统推送打托数据 start *************************/
/****************自提扫描信息处理 start *************************/
String SELF_PICKUP_SCAN_QUEUE = "self_pickup_scan_queue" + ModuleNameConstant.DEVAUTH;
String SELF_PICKUP_SCAN_EXCHANGE = "self_pickup_scan_exchange" + ModuleNameConstant.DEVAUTH;
String SELF_PICKUP_SCAN_ROUTING = "self_pickup_scan_routing" + ModuleNameConstant.DEVAUTH;
/****************自提扫描信息处理 start *************************/
}

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java

@ -183,4 +183,9 @@ public interface IDistributionStockArticleClient {
@PostMapping(value = API_PREFIX + "/addReturnList",consumes = MediaType.APPLICATION_JSON_VALUE)
List<DistributionStockArticleEntity> addReturnList(@RequestBody List<DistributionStockArticleEntity> addStockArticleEntities);
@PostMapping(value = API_PREFIX + "/findOrderTotalNumByOrderCodes",consumes = MediaType.APPLICATION_JSON_VALUE)
Integer findOrderTotalNumByOrderCodes(@RequestBody JSONObject jsonObject);
@PostMapping(value = API_PREFIX + "/findOrderTotalNumByOrderPackageCodes",consumes = MediaType.APPLICATION_JSON_VALUE)
Integer findOrderTotalNumByOrderPackageCodes(@RequestBody JSONObject jsonObject);
}

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java

@ -127,12 +127,7 @@ public class DistributionBillLadingAppController extends BladeController {
@ApiOperation(value = "自提扫描id")
@GetMapping("/scan")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "自提单ID", required = true),
@ApiImplicitParam(name = "coding", value = "包条码", required = true),
@ApiImplicitParam(name = "type", value = "类型 2 订单 1 库存品", required = true)
})
public Resp scan(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading){
public R scan(@ApiIgnore @RequestParam Map<String, Object> distrilbutionBillLading){
Resp scan = distrilbutionBillLadingService.getScan(distrilbutionBillLading);
//获取传入类型
@ -142,7 +137,7 @@ public class DistributionBillLadingAppController extends BladeController {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
String coding = distrilbutionBillLading.get("coding").toString();
warehouseUpdownTypeClient.downPackageOrDelTray(coding, myCurrentWarehouse.getId(),"签收下架解托");
// warehouseUpdownTypeClient.downPackageOrDelTray(coding, myCurrentWarehouse.getId(),"签收下架解托");
}else if("1".equals(type)){
//todo 这里需要增加对备货库存品的下架逻辑 但是备货是会进行下架的
log.warn("库存品下架的逻辑");

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

@ -203,6 +203,19 @@ public class RabbitMqConfiguration {
return BindingBuilder.bind(businessInConversionQueue).to(businessInConversionExchange).with(RabbitConstant.BUSINESS_IN_CONVERSION_DATA_ROUTING).noargs();
}
@Bean
public Queue selfPickupScanQueue() {
return new Queue(RabbitConstant.SELF_PICKUP_SCAN_QUEUE, true);
}
@Bean
public CustomExchange selfPickupScanExchange() {
Map<String, Object> args = Maps.newHashMap();
args.put("x-delayed-type", "direct");
return new CustomExchange(RabbitConstant.SELF_PICKUP_SCAN_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding selfPickupScanBinding(Queue selfPickupScanQueue, CustomExchange selfPickupScanExchange) {
return BindingBuilder.bind(selfPickupScanQueue).to(selfPickupScanExchange).with(RabbitConstant.SELF_PICKUP_SCAN_ROUTING).noargs();
}
}

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

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.feign;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -350,4 +351,23 @@ public class DistributionStockArticleClient implements IDistributionStockArticle
return addStockArticleEntities;
}
@Override
public Integer findOrderTotalNumByOrderCodes(JSONObject jsonObject) {
JSONArray jsonArray = jsonObject.getJSONArray("orderCodes");
List<String> orderCodes = jsonArray.toJavaList(String.class);
Long warehouseId = jsonObject.getLong("warehouseId");
return distributionStockArticleService.findOrderTotalNumByOrderCodes(orderCodes,warehouseId);
}
@Override
public Integer findOrderTotalNumByOrderPackageCodes(JSONObject jsonObject) {
JSONArray jsonArray = jsonObject.getJSONArray("orderPackageCodes");
List<String> orderPackageCodes = jsonArray.toJavaList(String.class);
Long warehouseId = jsonObject.getLong("warehouseId");
return distributionStockArticleService.findOrderTotalNumByOrderPackageCodes(orderPackageCodes,warehouseId);
}
}

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

@ -145,7 +145,7 @@
ldsl.tray_name trayName, lds.allocation_title allocation,
lddd.reality_quantity preparedQuantity,
lddd.stock_status,
(SELECT count(id) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.stock_list_id = lddd.stock_list_id and ldbls.material_type = 1) AS pick_up_quantity,
(SELECT count(id) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.bill_lading_id = lddd.bill_lading_id AND ldbls.stock_list_id = lddd.stock_list_id and ldbls.material_type = 1) AS pick_up_quantity,
CASE
WHEN (lddd.quantity - (SELECT count(id) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.stock_list_id = lddd.stock_list_id and ldbls.material_type = 1)) > 0 THEN 20
WHEN (lddd.quantity - (SELECT count(id) FROM logpm_distribution_bill_lading_scan ldbls WHERE ldbls.stock_list_id = lddd.stock_list_id and ldbls.material_type = 1)) = 0 THEN 10

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

@ -279,4 +279,6 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
List<Map<String, String>> findPackageCodeByCodes(@Param("keySet") Set<String> keySet);
List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCodeList(@Param("orderCodeList") List<String> orderCodeList, @Param("warehouseId") Long warehouseId);
List<String> findOrderCodesByOrderPackageCodes(@Param("orderPackageCodes") List<String> orderPackageCodes, @Param("warehouseId") Long warehouseId);
}

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

@ -1783,5 +1783,15 @@
and lwug.id is null
</select>
<select id="findOrderCodesByOrderPackageCodes" resultType="java.lang.String">
select ldpl.order_code
from logpm_distribution_parcel_list ldpl
where ldpl.warehouse_id = #{warehouseId}
and ldpl.order_package_code in
<foreach collection="orderPackageCodes" item="item" open="(" separator="," close=")">
#{item}
</foreach>
group by ldpl.order_code
</select>
</mapper>

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

@ -199,4 +199,7 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
void updateCustomerAllByOrderCode(@Param("data") cn.hutool.json.JSONObject data);
void updateDistributionStockArticleEntityById(@Param("t") DistributionStockArticleEntity t);
Integer findOrderTotalNumByOrderCodes(@Param("orderCodes") List<String> orderCodes,@Param("warehouseId") Long warehouseId);
}

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

@ -1428,4 +1428,15 @@
</update>
<select id="findOrderTotalNumByOrderCodes" resultType="int">
select IFNULL(sum(total_number),0)
from logpm_distribution_stock_article
where warehouse_id = #{warehouseId}
and order_code in
<foreach collection="orderCodes" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
</mapper>

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

@ -94,9 +94,9 @@
END id,
CONCAT_WS( ',', k.orderCode, m.orderCode ) AS orderCode,
CONCAT_WS( ',', k.serviceNumber, m.serviceNumber ) AS serviceNumber,
CONCAT_WS( ',', k.consigneeUnit, m.consigneeUnit ) AS consigneeUnit,
CONCAT_WS( ',', k.customerName, m.customerName ) AS customerName,
CONCAT_WS( ',', k.customerTelephone, m.customerTelephone ) AS customerTelephone,
IF(k.customerName is not null, k.customerName, m.customerName) AS customerName,
IF(k.consigneeUnit is not null, k.consigneeUnit, m.consigneeUnit) AS consigneeUnit,
IF(k.customerTelephone is not null, k.customerTelephone, m.customerTelephone) AS customerTelephone,
CONCAT_WS( ',', k.waybillNumber ) AS waybillNumber,
k.warehouse_entry_time AS warehouseEntryTime,
k.storage_fee AS storageFee
@ -286,9 +286,9 @@
END id,
CONCAT_WS( ',', k.orderCode, m.orderCode ) AS orderCode,
CONCAT_WS( ',', k.serviceNumber, m.serviceNumber ) AS serviceNumber,
CONCAT_WS( ',', k.consigneeUnit, m.consigneeUnit ) AS consigneeUnit,
CONCAT_WS( ',', k.customerName, m.customerName ) AS customerName,
CONCAT_WS( ',', k.customerTelephone, m.customerTelephone ) AS customerTelephone,
IF(k.customerName is not null, k.customerName, m.customerName) AS customerName,
IF(k.consigneeUnit is not null, k.consigneeUnit, m.consigneeUnit) AS consigneeUnit,
IF(k.customerTelephone is not null, k.customerTelephone, m.customerTelephone) AS customerTelephone,
CONCAT_WS( ',', k.waybillNumber ) AS waybillNumber,
k.warehouse_entry_time AS warehouseEntryTime,
k.storage_fee AS storageFee
@ -614,16 +614,28 @@
</select>
<select id="getViewDetailOwn" resultType="com.logpm.distribution.vo.DistrilbutionBillLadingViewVO">
SELECT ldbl.pickup_batch AS pickupBatch,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.waybill_number)) AS waybillNumber,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.service_number)) AS serviceNumber,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.consignee_unit)) AS consigneeUnit,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.consignee_person)) AS customerName,
GROUP_CONCAT(DISTINCT ANY_VALUE(ldsa.consignee_mobile)) AS customerTelephone
FROM logpm_distrilbution_bill_lading ldbl
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbl.id = ldbs.bill_lading_id AND order_status != '2'
LEFT JOIN logpm_distribution_stock_article ldsa ON ldbs.stock_article_id = ldsa.id
WHERE ldbl.id = #{id}
SELECT
ldbl.pickup_batch AS pickupBatch,
GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.waybill_number )) AS waybillNumber,
GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.service_number )) AS serviceNumber,
IFNULL(GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsl.market_name )),GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.consignee_unit ))) AS consigneeUnit,
IFNULL(ldbl.consignee,GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.consignee_person ))) AS customerName,
GROUP_CONCAT(
DISTINCT ANY_VALUE ( ldsa.consignee_mobile )) AS customerTelephone
FROM
logpm_distrilbution_bill_lading ldbl
LEFT JOIN logpm_distrilbution_bill_stock ldbs ON ldbl.id = ldbs.bill_lading_id
AND order_status != '2'
LEFT JOIN logpm_distribution_stock_article ldsa ON ldbs.stock_article_id = ldsa.id
LEFT JOIN logpm_distribution_delivery_details AS lddd ON ldbl.id = lddd.bill_lading_id AND lddd.inventory_status IN ('1','3')
LEFT JOIN logpm_distribution_stock_list AS ldsl ON lddd.stock_list_id = ldsl.id
WHERE
ldbl.id = #{id}
GROUP BY ldbl.id;
</select>

45
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/BillLadingScanDataQueueHandler.java

@ -0,0 +1,45 @@
package com.logpm.distribution.receiver;
import cn.hutool.core.util.ObjectUtil;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.rabbitmq.client.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;
import java.util.Map;
import java.util.Objects;
@Slf4j
@RabbitListener(queues = RabbitConstant.SELF_PICKUP_SCAN_QUEUE)
@Component
@AllArgsConstructor
public class BillLadingScanDataQueueHandler {
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
@RabbitHandler
public void billLadingScanDataHandler(Map map, Message message, Channel channel) {
log.info("自提订单扫描数据接收成功");
Object o = map.get("coding");
Object warehouseIdObj = map.get("warehouseId");
if (!ObjectUtil.isAllEmpty(o, warehouseIdObj)) {
String coding = Objects.toString(o);
Long warehouseId = (Long) warehouseIdObj;
warehouseUpdownTypeClient.downPackageOrDelTray(coding, warehouseId, "签收下架解托");
}else{
log.warn("自提订单扫描数据接收失败");
}
}
}

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

@ -244,4 +244,6 @@ public interface IDistributionParcelListService extends BaseService<Distribution
Map<String, Set<String>> findPackageCodeByCodes(Set<String> keySet);
List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCodeList(List<String> orderCodeList, Long warehouseId);
List<String> findOrderCodesByOrderPackageCodes(List<String> orderPackageCodes, Long warehouseId);
}

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

@ -99,7 +99,7 @@ public interface IDistributionReservationPackageService extends BaseService<Dist
* @param packageId
* @return
*/
boolean cancelReservationPackage(Long reservationId, Long packageId);
boolean cancelReservationPackage(Long reservationId, Long packageId,String reservationCode);
String getConcatMaterialName(Long reservationId, Long stockArticleId);

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

@ -28,7 +28,6 @@ import com.logpm.distribution.vo.app.queryOrderVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@ -288,4 +287,8 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
* @param orderCode 订单号
*/
void updateCustomerAllByOrderCode(String orderCode);
Integer findOrderTotalNumByOrderCodes(List<String> orderCodes,Long warehouseId);
Integer findOrderTotalNumByOrderPackageCodes(List<String> orderPackageCodes, Long warehouseId);
}

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

@ -2385,7 +2385,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionAppDeliveryListVO> distributionAppDeliveryListVOS = new ArrayList<>();
try {
//获取当前登录人
//获取当前登录人
BladeUser user = AuthUtil.getUser();
String roleId = user.getRoleId();
//判断当前登录人是否为司机
@ -3021,7 +3021,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionParcelListService.updateById(dp);
distributionAsyncService.checkStockArticleReservationStatus(dp);
packageLockIds.add(dp.getId());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:新增订单勾选包件,预约任务号:"+reservationEntity.getReservationCode();
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:新增订单无包件操作,构建新的预约计划,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), dp.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
}
@ -3041,7 +3041,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionParcelListService.updateById(p);
packageLockIds.add(p.getId());
//这里根据包件进行订单状态的改变
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:新增订单系统默认可用包件,预约任务号:"+reservationEntity.getReservationCode();
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:新增订单勾选包件,构建新的预约计划,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), p.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
});
@ -3070,7 +3070,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
orderPackageNum.getAndAdd(distributionReservationZeroPackageEntity.getQuantity());
distributionAsyncService.checkZeroStockArticleReservationStatus(Func.copy(p, DistributionParcelNumberEntity.class));
packageLockIds.add(p.getParcelListId());
}
});
} else {
@ -3237,7 +3236,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionParcelListService.updateById(p);
packageLockIds.add(p.getId());
//这里根据包件进行订单状态的改变
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:操作已选订单包件,预约任务号:"+reservationEntity.getReservationCode();
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:选订单包件,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), p.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
});
@ -3268,7 +3267,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionParcelListService.updateById(dp);
distributionAsyncService.checkStockArticleReservationStatus(dp);
packageLockIds.add(dp.getId());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:操作已选订单包件,预约任务号:"+reservationEntity.getReservationCode();
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:无勾选包件操作,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), dp.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
@ -3374,6 +3373,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionReservationPackageService.save(reservationPackageEntity);
distributionAsyncService.checkStockArticleReservationStatus(p);
packageLockIds.add(p.getId());
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"商配计划配车,操作方式:对已有计划订单进行包件勾选新增操作,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), reservationPackageEntity.getPacketBarCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
} else {
//依然存在包件,
oldPackageList.remove(p.getId());
@ -3402,7 +3404,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
bladeRedis.set("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + parcelListEntity.getOrderCode(),ids);
}
}
// distributionAsyncService.checkStockArticleReservationStatus(parcelListEntity);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"取消商配计划配车,操作方式:对已有计划订单进行勾选包件取消操作,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
});
} else {
//查找该订单没有进行包件选择的操作, 但是存在newOrder列表中 视为该订单保持计划选择
@ -3515,7 +3519,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
parcelListEntity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
distributionParcelListService.updateById(parcelListEntity);
distributionAsyncService.checkStockArticleReservationStatus(parcelListEntity);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"取消商配计划配车,操作方式:对已有计划订单整单移除操作,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
});
reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity);
@ -3580,6 +3586,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionParcelListService.updateById(parcelListEntity);
//包件维护订单状态
distributionAsyncService.checkStockArticleReservationStatus(parcelListEntity);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"取消商配计划配车,操作方式:对已有计划订单整单移除操作,取消预约计划,预约任务号:"+reservationEntity.getReservationCode();
JSONObject js = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(),content , WorkNodeEnums.PLAN_DISTRIBUTION.getCode());
logs.add(js);
});
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(e.getStockArticleId());
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(), myCurrentWarehouse.getId());
@ -3685,6 +3694,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// 执行发送推送
distributionReservationService.createBusinessPreConversionQueue(deliveryListEntity.getId());
trunklinePackageTrackLogClient.addPackageTrackLog(logs);
return R.status(true);

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

@ -43,13 +43,7 @@ import com.logpm.distribution.entity.DistrilbutionBillPackageEntity;
import com.logpm.distribution.excel.DistributionParcelListExcel;
import com.logpm.distribution.mapper.DistributionParcelListMapper;
import com.logpm.distribution.mapper.DistributionStockArticleMapper;
import com.logpm.distribution.service.IDistributionParcelDetailsService;
import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.service.IDistributionParcelNumberService;
import com.logpm.distribution.service.IDistributionReservationZeroPackageService;
import com.logpm.distribution.service.IDistributionStockListInfoService;
import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IDistrilbutionBillPackageService;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionParcelListBaseVO;
import com.logpm.distribution.vo.DistributionParcelListNodeVO;
import com.logpm.distribution.vo.DistributionParcelListVO;
@ -82,6 +76,7 @@ import org.springblade.system.feign.IUserClient;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -132,6 +127,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
@Autowired
private IDistributionReservationZeroPackageService reservationZeroPackageService;
@Lazy
@Autowired
private IDistributionStockArticleService distributionStockArticleService;
@Autowired
private IDistrilbutionBillPackageService distrilbutionBillPackageService;
@ -786,8 +784,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
stockArticleEntity.setConsigneeMobile(waybillEntity.getConsigneeMobile());
stockArticleEntity.setConsigneeAddress(waybillEntity.getConsigneeAddress());
stockArticleEntity.setConsigneeUnit(basicdataClientEntity.getClientName());
distributionStockArticleMapper.updateById(stockArticleEntity);
}
distributionStockArticleService.updateBatchById(stockArticleEntities);
}
return orderCodes;
}
@ -1291,4 +1289,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return baseMapper.findALLNoUpShelfPackageByOrderCodeList(orderCodeList,warehouseId);
}
@Override
public List<String> findOrderCodesByOrderPackageCodes(List<String> orderPackageCodes, Long warehouseId) {
return baseMapper.findOrderCodesByOrderPackageCodes(orderPackageCodes,warehouseId);
}
}

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

@ -32,18 +32,24 @@ import com.logpm.distribution.service.IDistributionReservationPackageService;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.vo.app.DistributionAppParcelListVO;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.order.OrderReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.constant.reservation.ReservationPackageStatusConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -59,6 +65,7 @@ public class DistributionReservationPackageServiceImpl extends BaseServiceImpl<D
private IDistributionParcelListService parcelListService;
private IBasicdataWarehouseClient warehouseClient;
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient;
@Override
@ -158,8 +165,12 @@ public class DistributionReservationPackageServiceImpl extends BaseServiceImpl<D
@Override
@Transactional
public boolean cancelReservationPackage(Long reservationId, Long packageId) {
public boolean cancelReservationPackage(Long reservationId, Long packageId,String reservationCode) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
log.error("取消配送包件未进行仓库选择");
return false;
}
//取消预约
List<DistributionReservationPackageEntity> packageEntityList = this.list(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.eq(DistributionReservationPackageEntity::getReservationId, reservationId)
@ -169,10 +180,15 @@ public class DistributionReservationPackageServiceImpl extends BaseServiceImpl<D
if (packageEntityList.size() == 1){
//执行计划的包件取消
List<JSONObject> aaa = new ArrayList<>();
DistributionReservationPackageEntity distributionReservationPackageEntity = packageEntityList.get(0);
distributionReservationPackageEntity.setCancelStatus(1);
distributionReservationPackageEntity.setCancelRemark(AuthUtil.getNickName()+"进行配车计划取消订制品");
distributionReservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
this.updateById(distributionReservationPackageEntity);
String content = "包件在"+myCurrentWarehouse.getName()+"由"+AuthUtil.getUser().getNickName()+"取消配车计划,操作方式:配送详情进行客户包件批量选中取消,预约任务号:"+reservationCode;
aaa.add(handleLogJSONObject(myCurrentWarehouse,AuthUtil.getUser(),distributionReservationPackageEntity.getPacketBarCode(),content, WorkNodeEnums.CANCEL_DISTRIBUTION.getCode()));
trunklinePackageTrackLogClient.addPackageTrackLog(aaa);
}else {
//计划出现查询该包件记录错误,
return false;
@ -192,5 +208,23 @@ public class DistributionReservationPackageServiceImpl extends BaseServiceImpl<D
return baseMapper.getConcatMaterialName(reservationId,stockArticleId);
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();
trunklinePackageTrackLog.put("tenantId",user.getTenantId());
trunklinePackageTrackLog.put("createTime",new Date());
trunklinePackageTrackLog.put("createUser",user.getUserId());
trunklinePackageTrackLog.put("updateUser",user.getUserId());
trunklinePackageTrackLog.put("updateTime",new Date());
trunklinePackageTrackLog.put("isDeleted",0);
trunklinePackageTrackLog.put("status",1);
trunklinePackageTrackLog.put("createDept",warehouse.getDepartment());
trunklinePackageTrackLog.put("orderPackageCode",orderPackageCode);
trunklinePackageTrackLog.put("warehouseId",warehouse.getId());
trunklinePackageTrackLog.put("warehouseName",warehouse.getName());
trunklinePackageTrackLog.put("workNode",node);
trunklinePackageTrackLog.put("content",content);
trunklinePackageTrackLog.put("operator",user.getNickName());
return trunklinePackageTrackLog;
}
}

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

@ -3444,6 +3444,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
log.error(method+"packageId参数缺失");
return R.fail("请联系管理员....");
}
DistributionReservationEntity reservationEntity = this.getById(distributionCancelReservationPackageDTO.getReservationId());
if (Func.isEmpty(reservationEntity)){
log.error(method+"查询预约计划信息错误>>>>>>>>>>>>>>>>>>reservationId:{}",distributionCancelReservationPackageDTO.getReservationId());
return R.fail("请联系管理员....");
}
List<Long> list = Func.toLongList(distributionCancelReservationPackageDTO.getPackageIds());
log.info(method+"取消包件>>>>:{}",distributionCancelReservationPackageDTO.getPackageIds());
switch (distributionCancelReservationPackageDTO.getType()){
@ -3478,7 +3483,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
/**
* 取消指定预约下包件
*/
boolean flag = distributionReservationPackageService.cancelReservationPackage(distributionCancelReservationPackageDTO.getReservationId(),Long.parseLong(s));
boolean flag = distributionReservationPackageService.cancelReservationPackage(distributionCancelReservationPackageDTO.getReservationId(),Long.parseLong(s),reservationEntity.getReservationCode());
if (flag){
//任务包件取消成功
//维护此预约下的订单计划状态

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

@ -2698,6 +2698,18 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
this.baseMapper.updateCustomerAllByOrderCode(JSONUtil.parseObj(data));
}
@Override
public Integer findOrderTotalNumByOrderCodes(List<String> orderCodes,Long warehouseId) {
return baseMapper.findOrderTotalNumByOrderCodes(orderCodes,warehouseId);
}
@Override
public Integer findOrderTotalNumByOrderPackageCodes(List<String> orderPackageCodes, Long warehouseId) {
List<String> orderCodes = distributionParcelListService.findOrderCodesByOrderPackageCodes(orderPackageCodes,warehouseId);
return baseMapper.findOrderTotalNumByOrderCodes(orderCodes,warehouseId);
}
@Override
public R findEditCustomerLog(Long orderId) {

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

File diff suppressed because it is too large Load Diff

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

@ -43,4 +43,6 @@ public interface WarehouseTrayTypeMapper extends BaseMapper<WarehouseTrayTypeEnt
* @return
*/
TrayTypeDataListVO getZeroOrderByOrderId(@Param("orderId")Long orderId,@Param("warehouseId") Long warehouseId);
void updateAllNumTrayTypeId(@Param("orderTotalNum") Integer orderTotalNum, @Param("orderNum") Integer orderNum, @Param("stockTotalNum") Integer stockTotalNum, @Param("stockNum") Integer stockNum, @Param("trayTypeId") Long trayTypeId);
}

8
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayTypeMapper.xml

@ -114,5 +114,13 @@
and ldsa.warehouse_id = #{warehouseId}
</select>
<update id="updateAllNumTrayTypeId" >
update logpm_warehouse_tray_type
set total_num = #{orderNum},
order_total_num = #{orderTotalNum},
stock_num = #{stockNum},
stock_total_num = #{stockTotalNum}
where id = #{trayTypeId}
</update>
</mapper>

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

@ -1155,14 +1155,14 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
orderTotalNum = orderTotalNum + zeroTatolNumVO.getOrderTotalNum();
orderNum = orderNum + zeroTatolNumVO.getEnterNum();
}
baseMapper.updateNumByTrayTypeId(orderTotalNum,orderNum,trayTypeId);
// baseMapper.updateNumByTrayTypeId(orderTotalNum,orderNum,trayTypeId);
TatolNumVO stockTatolNumVO = warehouseTrayGoodsService.getStockTotalNumAndNum(trayTypeId,warehouseId);
if(!Objects.isNull(stockTatolNumVO)){
stockTotalNum = stockTotalNum + stockTatolNumVO.getOrderTotalNum();
stockNum = stockNum + stockTatolNumVO.getEnterNum();
}
baseMapper.updateStockByTrayTypeId(stockTotalNum,stockNum,trayTypeId);
baseMapper.updateAllNumTrayTypeId(orderTotalNum,orderNum,stockTotalNum,stockNum,trayTypeId);
}

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

@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -3111,75 +3112,60 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
QueryWrapper<WarehouseUpdownGoodsEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("updown_type_id", updownTypeId);
List<WarehouseUpdownGoodsEntity> list = warehouseUpdownGoodsService.list(queryWrapper);
Set<String> set = new TreeSet<>();
Integer totalNum = 0;
Integer orderTotalNum = 0;
Integer stockNum = 0;
Integer stockTotalNum = 0;
for (WarehouseUpdownGoodsEntity updownGoodsEntity : list) {
String associationType = updownGoodsEntity.getAssociationType();
Long associationId = updownGoodsEntity.getAssociationId();
String associationValue = updownGoodsEntity.getAssociationValue();
Long marketId = updownGoodsEntity.getMarketId();
Integer num = updownGoodsEntity.getNum();
String incomingBatch = updownGoodsEntity.getIncomingBatch();
if ("1".equals(associationType)) {
//零担订单数据
String orderCode = associationValue;
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
Integer totalNumber = stockArticleEntity.getTotalNumber();
if (!set.contains(associationValue)) {
set.add(orderCode);
orderTotalNum = orderTotalNum + totalNumber;
}
totalNum = totalNum + num;
} else if ("3".equals(associationType)) {
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(associationValue, warehouseId);
String orderCode = parcelListEntity.getOrderCode();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
Integer totalNumber = stockArticleEntity.getTotalNumber();
if (!set.contains(orderCode)) {
set.add(orderCode);
orderTotalNum = orderTotalNum + totalNumber;
}
totalNum = totalNum + num;
} else if ("4".equals(associationType)) {
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, associationValue, incomingBatch, warehouseId);
Integer quantityStock = stockListEntity.getQuantityStock();
stockNum = stockNum + num;
stockTotalNum = stockTotalNum + quantityStock;
}
}
baseMapper.updateNumByUpdownTypeId(orderTotalNum, totalNum, stockNum, stockTotalNum, updownTypeId);
AtomicReference<Integer> totalNum = new AtomicReference<>(0);
AtomicReference<Integer> orderTotalNum = new AtomicReference<>(0);
AtomicReference<Integer> stockNum = new AtomicReference<>(0);
AtomicReference<Integer> stockTotalNum = new AtomicReference<>(0);
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCode(orderCode);
// if(Objects.isNull(stockArticleEntity)){
// log.warn("##############updateUpdownTypeNumPackage: 订单信息不存在 orderCode={}",orderCode);
// throw new CustomerException(403,"订单信息不存在");
// }
// Integer orderTotalNumber = stockArticleEntity.getTotalNumber();
// //查询该订单在该上架方式下的包件还有几条数据
// List<WarehouseUpdownGoodsEntity> ls = warehouseUpdownGoodsService.findListByUpdownTypeIdAndOrderCode(updownTypeId,orderCode);
// int size = ls.size();
// if("1".equals(addStatus)){
// if(size==0){
// baseMapper.updateOrderTotalNumAndTotalNum(updownTypeId,orderTotalNumber,quantity);
// }else{
// baseMapper.updateTotalNum(updownTypeId,quantity);
// }
// }else if("2".equals(addStatus)){
// if(size==0){
// log.warn("##############updateUpdownTypeNumPackage: 数据格式问题 updownTypeId={} orderCode={}",updownTypeId,orderCode);
// throw new CustomerException(403,"数据格式问题");
// }else if(size > 1){
// //如果库中有至少2条数据,那么去掉一条也不会影响改订单的总数变化,所以只减去包件的数量
// baseMapper.updateTotalNum(updownTypeId,-quantity);
// }else{
// //如果库中有至少2条数据,那么去掉一条也不会影响改订单的总数变化,所以只减去包件的数量
// baseMapper.updateOrderTotalNumAndTotalNum(updownTypeId,-orderTotalNumber,-quantity);
// }
// }
// 使用Java Stream对list按associationType字段进行分组
Map<String, List<WarehouseUpdownGoodsEntity>> groupedByAssociationType = list.stream()
.collect(Collectors.groupingBy(WarehouseUpdownGoodsEntity::getAssociationType));
groupedByAssociationType.keySet().forEach(associationType -> {
List<WarehouseUpdownGoodsEntity> updownGoodsEntities = groupedByAssociationType.get(associationType);
//统计updownGoodsEntities中所有元素的num之和
Integer total = updownGoodsEntities.stream()
.mapToInt(WarehouseUpdownGoodsEntity::getNum)
.sum();
//把updownGoodsEntities中所有元素的associationValue放入一个List<String>中
List<String> associationValues = updownGoodsEntities.stream()
.map(WarehouseUpdownGoodsEntity::getAssociationValue)
.collect(Collectors.toList());
if ("1".equals(associationType)) {
//零担
//获取所有
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderCodes",associationValues);
jsonObject.put("warehouseId",warehouseId);
Integer orderTotal = distributionStockArticleClient.findOrderTotalNumByOrderCodes(jsonObject);
totalNum.set(totalNum.get()+total);
orderTotalNum.set(orderTotalNum.get()+orderTotal);
}else if ("3".equals(associationType)){
//订制品
JSONObject jsonObject = new JSONObject();
jsonObject.put("orderPackageCodes",associationValues);
jsonObject.put("warehouseId",warehouseId);
Integer orderTotal = distributionStockArticleClient.findOrderTotalNumByOrderPackageCodes(jsonObject);
totalNum.set(totalNum.get()+total);
orderTotalNum.set(orderTotalNum.get()+orderTotal);
}else if ("4".equals(associationType)){
//无数据库存品
updownGoodsEntities.forEach(updownGoodsEntity -> {
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(updownGoodsEntity.getMarketId(), updownGoodsEntity.getAssociationValue(), updownGoodsEntity.getIncomingBatch(), warehouseId);
Integer quantityStock = stockListEntity.getQuantityStock();
stockTotalNum.set(stockTotalNum.get() + quantityStock);
});
stockNum.set(stockNum.get() + total);
}
});
baseMapper.updateNumByUpdownTypeId(orderTotalNum.get(), totalNum.get(), stockNum.get(), stockTotalNum.get(), updownTypeId);
}
/**

Loading…
Cancel
Save