From 42fa0c7a8200447fdd317fb6929fb8314ee85a6d Mon Sep 17 00:00:00 2001 From: kilo Date: Wed, 28 Jun 2023 13:55:25 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E9=A2=84=E7=BA=A6DTO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/distribution/dto/DistributionReservationDTO.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionReservationDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionReservationDTO.java index 40bdd5906..ae660105e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionReservationDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionReservationDTO.java @@ -17,6 +17,8 @@ package com.logpm.distribution.dto; import com.logpm.distribution.entity.DistributionReservationEntity; +import com.logpm.distribution.entity.DistributionStockArticleEntity; +import com.logpm.distribution.entity.DistributionStockListEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; @@ -54,13 +56,13 @@ public class DistributionReservationDTO extends DistributionReservationEntity { * 库存品信息列表 */ @ApiModelProperty(value = "库存品信息列表") - private List inventoryList; + private List inventoryList; /** * 订单信息列表 */ @ApiModelProperty(value = "订单信息列表") - private List stockArticleList; + private List stockArticleList; From 39b3c9b53fc2f0663ad704b2240cd1ecad53bd4a Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 28 Jun 2023 16:06:09 +0800 Subject: [PATCH 2/5] =?UTF-8?q?1.=E5=9C=A8=E5=BA=93=E8=AE=A2=E4=B9=A6?= =?UTF-8?q?=E5=BA=93=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/BasicdataStoreBusinessEntity.java | 5 +- .../feign/IBasicdataClientClient.java | 7 +- .../feign/IBasicdataStoreBusinessClient.java | 3 + .../IDistributionStockArticleClient.java | 3 + .../oldproject/feign/IAdvanceClient.java | 3 +- .../feign/IAdvanceDetailClient.java | 1 + .../feign/BasicdataClientClient.java | 8 ++ .../feign/BasicdataStoreBusinessClient.java | 9 ++ .../feign/DistributionStockArticleClient.java | 15 ++- blade-service/logpm-factory/pom.xml | 6 + .../impl/PanFactoryDataServiceImpl.java | 124 ++++++++++-------- .../logpm/oldproject/feign/AdvanceClient.java | 6 + .../oldproject/mapper/AdvanceMapper.java | 8 +- .../logpm/oldproject/mapper/AdvanceMapper.xml | 7 + .../oldproject/service/IAdvanceService.java | 2 + .../service/impl/AdvanceServiceImpl.java | 7 +- 16 files changed, 143 insertions(+), 71 deletions(-) diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataStoreBusinessEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataStoreBusinessEntity.java index 4140eae75..3b55e762f 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataStoreBusinessEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataStoreBusinessEntity.java @@ -17,10 +17,9 @@ package com.logpm.basicdata.entity; import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.Date; +import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; @@ -75,6 +74,6 @@ public class BasicdataStoreBusinessEntity extends TenantEntity { * 服务类型—类型 */ @ApiModelProperty(value = "服务类型—类型") - private String mold; + private Integer mold; } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java index 8ed1fc762..45385733e 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java @@ -16,8 +16,9 @@ */ package com.logpm.basicdata.feign; -import org.springblade.core.mp.support.BladePage; import com.logpm.basicdata.entity.BasicdataClientEntity; +import org.springblade.common.constant.ModuleNameConstant; +import org.springblade.core.mp.support.BladePage; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -29,7 +30,7 @@ import org.springframework.web.bind.annotation.RequestParam; * @since 2023-05-16 */ @FeignClient( - value = "blade-basicdataClient" + value = ModuleNameConstant.APPLICATION_BASICDATA_NAME ) public interface IBasicdataClientClient { @@ -46,4 +47,6 @@ public interface IBasicdataClientClient { @GetMapping(TOP) BladePage top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + @GetMapping(API_PREFIX+"/findByName") + BasicdataClientEntity findByName(String customerName); } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataStoreBusinessClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataStoreBusinessClient.java index 58d0efc18..461dd4926 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataStoreBusinessClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataStoreBusinessClient.java @@ -46,4 +46,7 @@ public interface IBasicdataStoreBusinessClient { @GetMapping(TOP) BladePage top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + @GetMapping(API_PREFIX+"/findByClientIdAndTypeService") + BasicdataStoreBusinessEntity findByClientIdAndTypeService(Long clientEntityId, Integer typeService); + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java index c13476c35..4c37f7ea9 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java @@ -50,4 +50,7 @@ public interface IDistributionStockArticleClient { @PostMapping(API_PREFIX + "/addData") Long addData(@RequestBody DistributionStockArticleEntity distributionStockArticleEntity); + + @GetMapping(API_PREFIX + "/findByAdvanceId") + DistributionStockArticleEntity findByAdvanceId(@RequestParam Integer advanceId); } diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java index 8fb6f4d52..36e99096f 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java @@ -78,5 +78,6 @@ public interface IAdvanceClient { @GetMapping(API_PREFIX + "/queryDataOne") AdvanceEntity getQueryDataOne(@RequestParam String orderSelfNum); - + @GetMapping(API_PREFIX + "/fingById") + AdvanceEntity fingById(@RequestParam Integer advanceId); } diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceDetailClient.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceDetailClient.java index ec3198c37..f2c1d5dbb 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceDetailClient.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceDetailClient.java @@ -75,4 +75,5 @@ public interface IAdvanceDetailClient { @GetMapping(API_PREFIX + "/getListByOrderSelfNum") List getListByOrderSelfNum(@RequestParam String orderSelfNum); + void getOneByUnitNo(); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java index 897e2b4df..ac17d71e0 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java @@ -16,6 +16,7 @@ */ package com.logpm.basicdata.feign; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; @@ -50,4 +51,11 @@ public class BasicdataClientClient implements IBasicdataClientClient { return BladePage.of(page); } + @Override + public BasicdataClientEntity findByName(String customerName) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("client_name",customerName); + return basicdataClientService.getOne(queryWrapper); + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataStoreBusinessClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataStoreBusinessClient.java index ba89b1f6d..e65d1ce03 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataStoreBusinessClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataStoreBusinessClient.java @@ -16,6 +16,7 @@ */ package com.logpm.basicdata.feign; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; @@ -50,4 +51,12 @@ public class BasicdataStoreBusinessClient implements IBasicdataStoreBusinessClie return BladePage.of(page); } + @Override + public BasicdataStoreBusinessEntity findByClientIdAndTypeService(Long clientEntityId, Integer typeService) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("client_id",clientEntityId) + .eq("type_service",typeService); + return basicdataStoreBusinessService.getOne(queryWrapper); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java index 03637f1f4..106adcf1e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java @@ -16,14 +16,16 @@ */ package com.logpm.distribution.feign; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.entity.DistributionStockArticleEntity; +import com.logpm.distribution.service.IDistributionStockArticleService; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; -import com.logpm.distribution.entity.DistributionStockArticleEntity; -import com.logpm.distribution.service.IDistributionStockArticleService; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; @@ -51,6 +53,7 @@ public class DistributionStockArticleClient implements IDistributionStockArticle } @Override + @PostMapping(API_PREFIX + "/addData") public Long addData(DistributionStockArticleEntity distributionStockArticleEntity) { boolean saveFlag = distributionStockArticleService.save(distributionStockArticleEntity); if(saveFlag){ @@ -60,4 +63,12 @@ public class DistributionStockArticleClient implements IDistributionStockArticle } } + @Override + @GetMapping(API_PREFIX + "/findByAdvanceId") + public DistributionStockArticleEntity findByAdvanceId(Integer advanceId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("advance_id",advanceId); + return distributionStockArticleService.getOne(queryWrapper); + } + } diff --git a/blade-service/logpm-factory/pom.xml b/blade-service/logpm-factory/pom.xml index e77c72afa..ba96c5bc8 100644 --- a/blade-service/logpm-factory/pom.xml +++ b/blade-service/logpm-factory/pom.xml @@ -86,6 +86,12 @@ 3.1.0.RELEASE compile + + org.springblade + logpm-basicdata-api + 3.1.0.RELEASE + compile + diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java index 0cae986ab..542ff12a6 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java @@ -6,6 +6,10 @@ import com.alibaba.fastjson.JSONObject; import com.alibaba.nacos.shaded.com.google.gson.Gson; import com.alibaba.nacos.shaded.com.google.gson.GsonBuilder; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.logpm.basicdata.entity.BasicdataClientEntity; +import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity; +import com.logpm.basicdata.feign.IBasicdataClientClient; +import com.logpm.basicdata.feign.IBasicdataStoreBusinessClient; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; import com.logpm.distribution.feign.IDistributionParcelListClient; @@ -13,7 +17,9 @@ import com.logpm.distribution.feign.IDistributionStockArticleClient; import com.logpm.factory.comfac.dto.OrderInfoDTO; import com.logpm.factory.comfac.dto.OrderStatusDTO; import com.logpm.factory.comfac.service.IOrderStatusLogService; -import com.logpm.factory.pan.dto.*; +import com.logpm.factory.pan.dto.PanFactoryOrderDTO; +import com.logpm.factory.pan.dto.PanPackageInfoDTO; +import com.logpm.factory.pan.dto.PanPackageListDTO; import com.logpm.factory.pan.service.IPanFactoryDataService; import com.logpm.factory.pan.service.IPanFactoryOrderService; import com.logpm.factory.pan.service.IPanPackageInfoService; @@ -26,12 +32,10 @@ import com.logpm.factory.snm.entity.PanPackageInfo; import com.logpm.factory.snm.entity.PanPackageList; import com.logpm.oldproject.entity.AdvanceDetailEntity; import com.logpm.oldproject.entity.AdvanceEntity; -import com.logpm.oldproject.entity.OrderEntity; import com.logpm.oldproject.feign.IAdvanceClient; import com.logpm.oldproject.feign.IAdvanceDetailClient; import com.logpm.oldproject.feign.IOrderClient; import com.logpm.oldproject.feign.IWarehouseClient; -import com.logpm.oldproject.vo.DistributionParcelListEntityVO; import lombok.AllArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -69,6 +73,9 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { private final IDistributionParcelListClient distributionParcelListClient; private final IDistributionStockArticleClient distributionStockArticleClient; + private final IBasicdataClientClient basicdataClientClient; + private final IBasicdataStoreBusinessClient basicdataStoreBusinessClient; + // @Override // public FactoryTokenVO getToken(String corpId, String appKey, String appSecret) throws NoSuchAlgorithmException { // @@ -302,68 +309,73 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { } //2.根据包条信息拿到订单信息 String orderSelfNum = advanceDetailEntity.getOrderSelfNum();//订单自编码 - //2.1如果订单信息出现两条,就正序排列取时间最早的一条,并在存入platform的时候打上标记 - List orderEntityList = orderClient.getOrderByOrderSelfNum(orderSelfNum); - AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderSelfNum); + Integer advanceId = advanceDetailEntity.getAdvanceId();//订单id + //2.1 因为会存在相同订单自编码的订单,所以为了区分订单只有通过id查询 + AdvanceEntity advanceEntity = advanceClient.fingById(advanceId); if(Objects.isNull(advanceEntity)){ - logger.warn("#################handleDataToPlatform: 未找到对应的订单信息 orderSelfNum={}",orderSelfNum); - throw new CustomerException(405,"未找到对应的订单信息"); - } - int size = orderEntityList.size();//数据数量 - if(size < 1){ - logger.warn("#################handleDataToPlatform: 未找到对应的订单信息 orderSelfNum={}",orderSelfNum); + logger.warn("#################handleDataToPlatform: 未找到对应的订单信息 advanceId={}",advanceId); throw new CustomerException(405,"未找到对应的订单信息"); } - OrderEntity orderEntity = orderEntityList.get(0); - Integer warehouseId = orderEntity.getWarehouseId();//仓库id - Date date = CommonUtil.StringToDate(operationTime); - Date now = new Date(); - - - //根据仓库id查询仓库 - String warehouseName = warehouseClient.selectNameById(warehouseId); - - DistributionStockArticleEntity distributionStockArticleEntity = new DistributionStockArticleEntity(); - distributionStockArticleEntity.setServiceNumber(orderEntity.getServicenum()); - distributionStockArticleEntity.setOrderSelfNumbering(orderEntity.getSelfnumber()); - distributionStockArticleEntity.setMallName(advanceEntity.getStoreName()); - distributionStockArticleEntity.setDescriptionGoods(advanceEntity.getFirstPackName()); - distributionStockArticleEntity.setWarehouse(warehouseName); - distributionStockArticleEntity.setWarehouseEntryTime(date); - distributionStockArticleEntity.setStoreTime(0);//TODO - distributionStockArticleEntity.setTotalNumber(advanceEntity.getTotal()); - distributionStockArticleEntity.setHandQuantity(0);//TODO - distributionStockArticleEntity.setCompleteSet(1);//TODO - distributionStockArticleEntity.setBrand(advanceEntity.getType()); - distributionStockArticleEntity.setTypeService(orderEntity.getDoor()); - distributionStockArticleEntity.setCustomerName(orderEntity.getContact()); - distributionStockArticleEntity.setCustomerTelephone(orderEntity.getPhone()); - distributionStockArticleEntity.setCustomerAddress(orderEntity.getAddress()); - distributionStockArticleEntity.setGenre(1); - distributionStockArticleEntity.setState(2); - if(size > 1){ - distributionStockArticleEntity.setReserve1("multiple"); + + Map supplyData = advanceDetailClient.getSupplyData(unitNo); + + //判断新系统是否有这条订单数据 + DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleClient.findByAdvanceId(advanceId); + + if(Objects.isNull(distributionStockArticleEntity)){ + Date date = CommonUtil.StringToDate(operationTime); + + distributionStockArticleEntity = new DistributionStockArticleEntity(); + distributionStockArticleEntity.setServiceNumber(advanceEntity.getServiceNum()); + distributionStockArticleEntity.setOrderSelfNumbering(advanceEntity.getOrderSelfNum()); + distributionStockArticleEntity.setMallName(advanceEntity.getStoreName()); + distributionStockArticleEntity.setDescriptionGoods(advanceEntity.getFirstPackName()); + distributionStockArticleEntity.setWarehouse(supplyData.get("destinationWarehouse")); + distributionStockArticleEntity.setWarehouseEntryTime(date); + distributionStockArticleEntity.setTotalNumber(advanceEntity.getTotal()); + distributionStockArticleEntity.setHandQuantity(0); + distributionStockArticleEntity.setCompleteSet(1);//TODO + distributionStockArticleEntity.setBrand(advanceEntity.getType()); + + String customerName = advanceEntity.getCustomerName();//客户名称 + //通过客户名称去查询客户的服务类型 + BasicdataClientEntity basicdataClientEntity = basicdataClientClient.findByName(customerName); + if(!Objects.isNull(basicdataClientEntity)){ + Long clientEntityId = basicdataClientEntity.getId();//基础客户 + BasicdataStoreBusinessEntity basicdataStoreBusinessEntity = basicdataStoreBusinessClient.findByClientIdAndTypeService(clientEntityId,3); + if(!Objects.isNull(basicdataStoreBusinessEntity)){ + distributionStockArticleEntity.setTypeService(basicdataStoreBusinessEntity.getMold()); + } + } + distributionStockArticleEntity.setCustomerName(customerName); + distributionStockArticleEntity.setCustomerTelephone(advanceEntity.getCustomerPhone()); + distributionStockArticleEntity.setCustomerAddress(advanceEntity.getCustomerRoad()); + distributionStockArticleEntity.setGenre(1); + distributionStockArticleEntity.setState(2); + distributionStockArticleEntity.setAdvanceId(advanceId); } Long id = distributionStockArticleClient.addData(distributionStockArticleEntity); if(id == 0){ logger.warn("#################handleDataToPlatform: 保存订单信息失败 orderSelfNum={}",orderSelfNum); throw new CustomerException(405,"保存订单信息失败"); } - //通过订单自编号查询包件信息 - List detailList = advanceDetailClient.getListByOrderSelfNum(orderSelfNum); - - List parcelListEntityList = new ArrayList<>(); - for (DistributionParcelListEntityVO vo:detailList){ - DistributionParcelListEntity entity = new DistributionParcelListEntity(); - BeanUtil.copyProperties(vo,entity); - entity.setStockArticleId(id+""); - parcelListEntityList.add(entity); - } - boolean b = distributionParcelListClient.addBatch(parcelListEntityList); - if(!b){ - logger.warn("#################handleDataToPlatform: 保存包件信息失败 orderSelfNum={}",orderSelfNum); - throw new CustomerException(405,"保存包件信息失败"); - } + + //存入包件明细 + + + +// List parcelListEntityList = new ArrayList<>(); +// for (DistributionParcelListEntityVO vo:detailList){ +// DistributionParcelListEntity entity = new DistributionParcelListEntity(); +// BeanUtil.copyProperties(vo,entity); +// entity.setStockArticleId(id+""); +// parcelListEntityList.add(entity); +// } +// boolean b = distributionParcelListClient.addBatch(parcelListEntityList); +// if(!b){ +// logger.warn("#################handleDataToPlatform: 保存包件信息失败 orderSelfNum={}",orderSelfNum); +// throw new CustomerException(405,"保存包件信息失败"); +// } logger.info("#################handleDataToPlatform: 数据处理完成"); }else{ diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java index b32c2a4b5..1db70d902 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java @@ -75,4 +75,10 @@ public class AdvanceClient implements IAdvanceClient { return service.advanceEntityOne(orderSelfNum); } + @Override + @GetMapping(API_PREFIX + "/fingById") + public AdvanceEntity fingById(Integer advanceId) { + return service.fingById(advanceId); + } + } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java index 587c21ff3..872972b02 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java @@ -16,12 +16,7 @@ */ package com.logpm.oldproject.mapper; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.oldproject.entity.AdvanceEntity; - -import com.logpm.oldproject.vo.AdvanceVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -49,4 +44,7 @@ public interface AdvanceMapper { AdvanceEntity advanceEntityOne(@Param("orderSelfNum") String orderSelfNum); + + AdvanceEntity fingById(@Param("advanceId") Integer advanceId); + } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml index 0905ddbbf..352c56a09 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml @@ -38,5 +38,12 @@ + diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java index a5ee1c2bc..768b41690 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java @@ -38,4 +38,6 @@ public interface IAdvanceService { Boolean addAdvanceEntity(AdvanceEntity advanceEntity); AdvanceEntity advanceEntityOne(String orderSelfNum); + + AdvanceEntity fingById(Integer advanceId); } diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java index 71a09fc0d..4c729cb9c 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java @@ -20,9 +20,7 @@ import com.logpm.oldproject.dto.AdvanceDTO; import com.logpm.oldproject.entity.AdvanceEntity; import com.logpm.oldproject.mapper.AdvanceMapper; import com.logpm.oldproject.service.IAdvanceService; -import io.micrometer.core.instrument.binder.BaseUnits; import lombok.AllArgsConstructor; -import org.springblade.core.tool.utils.BeanUtil; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -61,4 +59,9 @@ public class AdvanceServiceImpl implements IAdvanceService { public AdvanceEntity advanceEntityOne(String orderSelfNum) { return advanceMapper.advanceEntityOne(orderSelfNum); } + + @Override + public AdvanceEntity fingById(Integer advanceId) { + return advanceMapper.fingById(advanceId); + } } From 4fa4600c371ef5f4f767ef6fb9116f7df33aaec7 Mon Sep 17 00:00:00 2001 From: "0.0" <1092404103.qq.com> Date: Wed, 28 Jun 2023 16:12:38 +0800 Subject: [PATCH 3/5] =?UTF-8?q?1.=E9=85=8D=E9=80=81=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionDeliveryListEntity.java | 15 +++ .../vo/DistributionDeliveryInfoVO.java | 22 ++-- .../DistributionDeliveryListController.java | 4 +- .../DistributionDeliveryInfoMapper.java | 6 + .../mapper/DistributionDeliveryInfoMapper.xml | 41 ++++--- .../DistributionDeliveryListMapper.java | 8 +- .../mapper/DistributionDeliveryListMapper.xml | 19 ++-- .../DistributionDeliveryListServiceImpl.java | 19 ++-- .../DistributionReservationServiceImpl.java | 106 +++++++++--------- 9 files changed, 146 insertions(+), 94 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java index 8a2e34543..5e56103e9 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java @@ -98,6 +98,16 @@ public class DistributionDeliveryListEntity extends TenantEntity { */ @ApiModelProperty(value = "配送司机(id)") private String driverId; + /** + * 叉车司机(id) + */ + @ApiModelProperty(value = "叉车司机(id)") + private String forkliftId; + /** + * 叉车司机(值) + */ + @ApiModelProperty(value = "叉车司机(值)") + private String forkliftName; /** * 配送车辆(名称) */ @@ -158,6 +168,11 @@ public class DistributionDeliveryListEntity extends TenantEntity { */ @ApiModelProperty(value = "装卸班组(名称)") private String loadingTeamName; + /** + * 装卸类型 + */ + @ApiModelProperty(value = "装卸类型(1-装,2-卸)") + private Integer loadingTeamType; /** * 关联预约表id(客户) */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java index b8f0da70a..1bd5cccb1 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java @@ -93,11 +93,11 @@ public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity { */ @ApiModelProperty(value = "车次号") private String trainNumber; - /** - * 在库订单ID - */ - @ApiModelProperty(value = "在库订单ID") - private String stockArticleId; +// /** +// * 在库订单ID +// */ +// @ApiModelProperty(value = "在库订单ID") +// private String stockArticleId; @@ -106,7 +106,7 @@ public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity { * 订单自编号;展示使用 */ @ApiModelProperty(value = "订单自编号;订单自编号,关联订单表") - private String orderIds; + private String stockArticleId; /** * 收货人 */ @@ -183,11 +183,11 @@ public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity { */ @ApiModelProperty(value = "备注") private String remarks; - /** - * 预约单编号,系统构建生成 - */ - @ApiModelProperty(value = "预约单编号") - private String reservationIds; +// /** +// * 预约单编号,系统构建生成 +// */ +// @ApiModelProperty(value = "预约单编号") +// private String reservationId; /** * 时段 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java index 701facf89..1e7768894 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java @@ -31,6 +31,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import lombok.AllArgsConstructor; import javax.validation.Valid; +import lombok.extern.slf4j.Slf4j; import org.springblade.core.secure.BladeUser; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; @@ -63,6 +64,7 @@ import javax.servlet.http.HttpServletResponse; @AllArgsConstructor @RequestMapping("/deliveryList") @Api(value = "配送管理", tags = "配送管理接口") +@Slf4j public class DistributionDeliveryListController extends BladeController { private final IDistributionDeliveryListService distributionDeliveryListService; @@ -104,7 +106,7 @@ public class DistributionDeliveryListController extends BladeController { /** - * 配送管理 配送车次统计 + * 配送车次统计 */ @GetMapping("/statistics") @ApiOperationSupport(order = 2) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java index b28c7855d..c45d81353 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java @@ -82,4 +82,10 @@ public interface DistributionDeliveryInfoMapper extends BaseMapper selectcustomListByOrderId(String orderId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml index 6fa4ea869..bf4fdea87 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml @@ -48,14 +48,13 @@ ldpl.quantity quantity, ldpl.train_number trainNumber, ldpl.stock_article_id stockArticleId, - lddi.loaded_state loadedState, - lddi.package_nub packageNub, - lddi.loaded_nub loadedNub + ldl.package_nub packageNub, + ldl.loaded_nub loadedNub FROM - logpm_distribution_delivery_info lddi - JOIN logpm_distribution_parcel_list ldpl ON lddi.package_id = ldpl.id + logpm_distribution_loadscan ldl + JOIN logpm_distribution_parcel_list ldpl ON ldl.package_id = ldpl.id - lddi.is_deleted = 0 and lddi.delivery_id = #{id} + ldl.is_deleted = 0 and ldl.delivery_id = #{id} + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java index 9778a4d7f..d12fcac22 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java @@ -74,5 +74,11 @@ public interface DistributionDeliveryListMapper extends BaseMapper + + UPDATE logpm_distribution_delivery_list lddl + JOIN logpm_distribution_loadscan ldl ON lddl.id = ldl.delivery_id + SET lddl.loading_time = now() + WHERE ldl.package_id = #{id} and lddl.loading_time is null + + select * from logpm_distribution_reservation_stockarticle where is_deleted = 0 + + + + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.java new file mode 100644 index 000000000..f8227d6b3 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.mapper; + +import com.logpm.distribution.entity.DistributionReservationStocklistEntity; +import com.logpm.distribution.vo.DistributionReservationStocklistVO; +import com.logpm.distribution.excel.DistributionReservationStocklistExcel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; +import java.util.List; + +/** + * 预约库存中间表 Mapper 接口 + * + * @author TJJ + * @since 2023-06-28 + */ +public interface DistributionReservationStocklistMapper extends BaseMapper { + + /** + * 自定义分页 + * + * @param page + * @param distributionReservationStocklist + * @return + */ + List selectDistributionReservationStocklistPage(IPage page, DistributionReservationStocklistVO distributionReservationStocklist); + + + /** + * 获取导出数据 + * + * @param queryWrapper + * @return + */ + List exportDistributionReservationStocklist(@Param("ew") Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml new file mode 100644 index 000000000..a3037fb03 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index f64d5057e..4e4625569 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -37,7 +37,7 @@ - + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml index 57f236ef9..30fdb906b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml @@ -31,6 +31,7 @@ + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationStockarticleService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationStockarticleService.java new file mode 100644 index 000000000..4434b1a5e --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationStockarticleService.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.logpm.distribution.entity.DistributionReservationStockarticleEntity; +import com.logpm.distribution.vo.DistributionReservationStockarticleVO; +import com.logpm.distribution.excel.DistributionReservationStockarticleExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 预约订单中间表 服务类 + * + * @author TJJ + * @since 2023-06-28 + */ +public interface IDistributionReservationStockarticleService extends BaseService { + /** + * 自定义分页 + * + * @param page + * @param distributionReservationStockarticle + * @return + */ + IPage selectDistributionReservationStockarticlePage(IPage page, DistributionReservationStockarticleVO distributionReservationStockarticle); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List exportDistributionReservationStockarticle(Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationStocklistService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationStocklistService.java new file mode 100644 index 000000000..f24c20a03 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationStocklistService.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.logpm.distribution.entity.DistributionReservationStocklistEntity; +import com.logpm.distribution.vo.DistributionReservationStocklistVO; +import com.logpm.distribution.excel.DistributionReservationStocklistExcel; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import java.util.List; + +/** + * 预约库存中间表 服务类 + * + * @author TJJ + * @since 2023-06-28 + */ +public interface IDistributionReservationStocklistService extends BaseService { + /** + * 自定义分页 + * + * @param page + * @param distributionReservationStocklist + * @return + */ + IPage selectDistributionReservationStocklistPage(IPage page, DistributionReservationStocklistVO distributionReservationStocklist); + + + /** + * 导出数据 + * + * @param queryWrapper + * @return + */ + List exportDistributionReservationStocklist(Wrapper queryWrapper); + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 6790e929a..5f5d5f5b7 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -61,12 +61,20 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl selectDistrbutionReservationPage(IPage page, DistributionReservationVO distrbutionReservation) { @@ -112,59 +120,67 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl ids = Func.toLongList(idsStr); -// if (Func.isEmpty(ids)) { -// log.error("ids参数错误:+{" + ids + "}"); -// return false; -// } -// BigDecimal collectFee = new BigDecimal("0"); -// BigDecimal replaceFee = new BigDecimal("0"); -// StringBuffer buffer = new StringBuffer(); -// List deliveryEntities = new ArrayList<>(); -// for (int i = 0; i < ids.size(); i++) { -// BaseMapper stockArticleMapper = distributionStockArticleService.getBaseMapper(); -// DistributionStockArticleEntity distributionStockArticleEntity = stockArticleMapper.selectById(ids.get(i)); -//// deliveryEntities.add(distributionDeliveryEntity); -//// collectFee = collectFee.add(distributionDeliveryEntity.getCollectFee()); -//// //待收货款累加 -//// replaceFee = replaceFee.add(distributionDeliveryEntity.getReplaceFee()); -//// String orderId = distributionDeliveryEntity.getOrderId(); -// buffer.append(distributionStockArticleEntity.getId()).append(","); -// } -// buffer.deleteCharAt(buffer.length() - 1); -// DistributionReservationEntity distributionReservationEntity = new DistributionReservationEntity(); -// BeanUtils.copyProperties(distributionReservationDTO, distributionReservationEntity); -// distributionReservationEntity.setCollectFee(collectFee); -// distributionReservationEntity.setReplaceFee(replaceFee); -// //设置订单自编号,这里的数据属于冗余部分 -// distributionReservationEntity.setStockArticleId(buffer.toString()); -// //设置状态未备货 -// distributionReservationEntity.setStockupStatus("1"); -// //设置预约状态为待确认 -// distributionReservationEntity.setReservationStatus("1"); -// //设置预约信息来源是自建的方式 -// distributionReservationEntity.setOrderSource("3"); -// -// //这里就对新增的预约信息进行保存 -// this.save(distributionReservationEntity); -// Long reservationEntityId = distributionReservationEntity.getId(); -// //保存完之后获取新插入的预约服务获取ID然后订单派送单进行绑定 -// deliveryEntities.forEach(i -> { -// i.setReservationId(reservationEntityId); -// distributionStockArticleService.getBaseMapper().updateById(i); -// }); -// } catch (Exception e) { -// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); -// log.error("出现异常:+{" + e.getMessage() + "}"); -// return false; -// } + if (Func.isEmpty(distributionReservationDTO)){ + log.error("参数错误+{" + distributionReservationDTO + "}"); + return false; + } + //构建预约单 + DistributionReservationEntity reservationEntity = new DistributionReservationEntity(); + Func.copy(distributionReservationDTO,reservationEntity); + reservationEntity.setReservationStatus("1"); + reservationEntity.setStockupStatus("1"); + this.save(reservationEntity); + //获取新增预约信息的编号 + Long reservationId = reservationEntity.getId(); + List stockArticleList = distributionReservationDTO.getStockArticleList(); + List inventoryList = distributionReservationDTO.getInventoryList(); + AtomicInteger stockArticleCount = new AtomicInteger(); + AtomicInteger stockListCount = new AtomicInteger(); + List arrayList = new ArrayList<>(); + AtomicReference initTotal = new AtomicReference<>(BigDecimal.ZERO); + //存在订单构建预约订单关联信息 + if (!Func.isEmpty(stockArticleList)){ + stockArticleList.forEach(s->{ + //修改订单状态为已预约 + s.setState(2); + stockArticleCount.getAndAdd(s.getReservationNum()); + distributionStockArticleService.updateById(s); + arrayList.add(s.getOrderSelfNumbering()); + initTotal.accumulateAndGet(new BigDecimal(s.getFee().toString()),BigDecimal::add); + initTotal.accumulateAndGet(new BigDecimal(s.getRate().toString()),BigDecimal::add); + Long stockArticleId = s.getId(); + DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = new DistributionReservationStockarticleEntity(); + distributionReservationStockarticleEntity.setReservationId(reservationId); + distributionReservationStockarticleEntity.setStockarticleId(stockArticleId); + distributionReservationStockarticleEntity.setReservationNum(s.getReservationNum()); + distributionReservationStockarticleService.save(distributionReservationStockarticleEntity); + }); + } + //存在库存品构建预约库存品关联信息 + if (!Func.isEmpty(inventoryList)){ + inventoryList.forEach(i->{ + distributionStockListService.updateById(i); + Long stocklistId = i.getId(); + stockListCount.getAndAdd(i.getReservationNum()); + arrayList.add(i.getOrderSelfNumbering()); + DistributionReservationStocklistEntity distributionReservationStocklistEntity = new DistributionReservationStocklistEntity(); + distributionReservationStocklistEntity.setReservationId(reservationId); + distributionReservationStocklistEntity.setStocklistId(stocklistId); + distributionReservationStocklistEntity.setReservationNum(i.getReservationNum()); + distributionReservationStocklistService.save(distributionReservationStocklistEntity); + }); + } + //这里对预约信息再次进行修改 + HashSet set = new HashSet<>(); + set.addAll(arrayList); + arrayList.addAll(set); + String str = String.join(",", set); + //拼接在库和库存订单编号 + reservationEntity.setStockArticleId(str); + //统计数量 + BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee()); + reservationEntity.setFee(fee); + distributionReservationMapper.updateById(reservationEntity); return true; } @@ -200,7 +216,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl implements IDistributionReservationStockarticleService { + + @Override + public IPage selectDistributionReservationStockarticlePage(IPage page, DistributionReservationStockarticleVO distributionReservationStockarticle) { + return page.setRecords(baseMapper.selectDistributionReservationStockarticlePage(page, distributionReservationStockarticle)); + } + + + @Override + public List exportDistributionReservationStockarticle(Wrapper queryWrapper) { + List distributionReservationStockarticleList = baseMapper.exportDistributionReservationStockarticle(queryWrapper); + //distributionReservationStockarticleList.forEach(distributionReservationStockarticle -> { + // distributionReservationStockarticle.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionReservationStockarticle.getType())); + //}); + return distributionReservationStockarticleList; + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationStocklistServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationStocklistServiceImpl.java new file mode 100644 index 000000000..6e5482fc4 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationStocklistServiceImpl.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.distribution.service.impl; + +import com.logpm.distribution.entity.DistributionReservationStocklistEntity; +import com.logpm.distribution.vo.DistributionReservationStocklistVO; +import com.logpm.distribution.excel.DistributionReservationStocklistExcel; +import com.logpm.distribution.mapper.DistributionReservationStocklistMapper; +import com.logpm.distribution.service.IDistributionReservationStocklistService; +import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseServiceImpl; +import java.util.List; + +/** + * 预约库存中间表 服务实现类 + * + * @author TJJ + * @since 2023-06-28 + */ +@Service +public class DistributionReservationStocklistServiceImpl extends BaseServiceImpl implements IDistributionReservationStocklistService { + + @Override + public IPage selectDistributionReservationStocklistPage(IPage page, DistributionReservationStocklistVO distributionReservationStocklist) { + return page.setRecords(baseMapper.selectDistributionReservationStocklistPage(page, distributionReservationStocklist)); + } + + + @Override + public List exportDistributionReservationStocklist(Wrapper queryWrapper) { + List distributionReservationStocklistList = baseMapper.exportDistributionReservationStocklist(queryWrapper); + //distributionReservationStocklistList.forEach(distributionReservationStocklist -> { + // distributionReservationStocklist.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionReservationStocklist.getType())); + //}); + return distributionReservationStocklistList; + } + +} From e604971b285e9a1b68a6e8576f22fe94b5e945f1 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 28 Jun 2023 16:43:02 +0800 Subject: [PATCH 5/5] =?UTF-8?q?1.=E6=8E=A8=E9=80=81=E7=9A=AE=E9=98=BF?= =?UTF-8?q?=E8=AF=BA=E5=BC=80=E5=8D=95=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../factory/receiver/OpenOrderHandler.java | 52 +++++++++++-------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java index 40cfcaf17..9d3cf9380 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java @@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.RabbitConstant; import org.springblade.common.exception.CustomerException; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitListener; @@ -48,34 +49,43 @@ public class OpenOrderHandler { String msg = new String(message.getBody()); log.info("##################我进入这里了 retryCount={}",retryCount++); OrderInfoDTO orderInfoDTO = (OrderInfoDTO) map.get("messageData"); - String orderNo = orderInfoDTO.getOrderNo();//订单自编号 - //通过订单自编号去查询该条订单是属于哪个工厂 - AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderNo); - if(Objects.isNull(advanceEntity)){ - log.info("##################openOrderStatusHandler: 未找到对应订单 orderNo={}",orderNo); + String orderNoStr = orderInfoDTO.getOrderNo();//订单自编号 + String[] split = orderNoStr.split(","); + for (String orderNo:split){ + if(StringUtil.isBlank(orderNo)){ + continue; + } + //通过订单自编号去查询该条订单是属于哪个工厂 + AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderNo); + if(Objects.isNull(advanceEntity)){ + log.info("##################openOrderStatusHandler: 未找到对应订单 orderNo={}",orderNo); // channel.basicAck(deliveryTag,true); - return; - } - String type = advanceEntity.getType();//品牌 + return; + } + String type = advanceEntity.getType();//品牌 - R r = null; - switch (type){ - case FactoryConstant.PIANO: - r = panFactoryDataService.handleData(orderInfoDTO); - int code = r.getCode(); - if(code == 400 || code == 200){ - log.info("##################openOrderStatusHandler: 该条数据不用处理 orderNo={}",orderNo); + orderInfoDTO.setOrderNo(orderNo); + R r = null; + switch (type){ + case FactoryConstant.PIANO: + r = panFactoryDataService.handleData(orderInfoDTO); + int code = r.getCode(); + if(code == 400 || code == 200){ + log.info("##################openOrderStatusHandler: 该条数据不用处理 orderNo={}",orderNo); // channel.basicAck(deliveryTag,true); - }else{ - throw new CustomerException(code,r.getMsg()); - } - break; + }else{ + throw new CustomerException(code,r.getMsg()); + } + break; // case FactoryConstant.MENGT: // r = mtFactoryDataService.handleData(orderInfoDTO); // break; - default: - log.info("##################openOrderStatusHandler: 未知品牌 type={}",type); + default: + log.info("##################openOrderStatusHandler: 未知品牌 type={}",type); // channel.basicAck(deliveryTag,true); + } } + + } }