diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionBillLadingScanEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionBillLadingScanEntity.java index a6444c28c..8314255a9 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionBillLadingScanEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionBillLadingScanEntity.java @@ -45,7 +45,7 @@ public class DistributionBillLadingScanEntity extends BaseEntity { @ApiModelProperty(value = "节点") private Integer nodeType; - @ApiModelProperty(value = "扫码类型 1 pda扫码 2 手填") + @ApiModelProperty(value = "扫码类型 1 pda扫码 2 手填 3库存品 4 订单") private Integer scanType; @ApiModelProperty(value = "包件id") @@ -57,4 +57,10 @@ public class DistributionBillLadingScanEntity extends BaseEntity { @ApiModelProperty(value = "订单id") private Long stockArticleId; + @ApiModelProperty(value = "提货id") + private Long billLadingId; + + @ApiModelProperty(value = "库存品id") + private Long stockListId; + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryDetailsEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryDetailsEntity.java index 366285f21..ff550bdbc 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryDetailsEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryDetailsEntity.java @@ -76,5 +76,10 @@ public class DistributionDeliveryDetailsEntity extends TenantEntity { */ @ApiModelProperty(value = "数量") private Integer quantity; + /** + * 状态 + */ + @ApiModelProperty(value = "状态") + private String conditions; } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java index 5b0fabd64..c154f5596 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java @@ -199,7 +199,7 @@ public class DistributionStockArticleEntity extends TenantEntity { * 状态;1 配送 2 待配送 3部分入库 4已入库 */ @ApiModelProperty(value = "状态;1 配送 2 待配送 3部分入库 4已入库") - private Integer state; + private String state; /** * 状态;1 已通知 2 未通知 diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java index 16fb6764e..d3d8b9d3c 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java @@ -80,7 +80,7 @@ public class DistributionStockEntity extends TenantEntity { * 状态 */ @ApiModelProperty(value = "状态") - private Integer conditions; + private String conditions; /** * 货物名称 */ @@ -141,6 +141,11 @@ public class DistributionStockEntity extends TenantEntity { */ @ApiModelProperty(value = "配送编号") private Long deliveryListCode; + /** + * 提货Id + */ + @ApiModelProperty(value = "提货Id") + private Long billLadingId; @ApiModelProperty(value = "备货区") private String stockupArea; diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillStockEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillStockEntity.java index b55d6c01a..dda3abccb 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillStockEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistrilbutionBillStockEntity.java @@ -71,6 +71,11 @@ public class DistrilbutionBillStockEntity extends TenantEntity { */ @ApiModelProperty(value = "在库订单") private Long stockArticleId; + /** + * 状态 + */ + @ApiModelProperty(value = "状态") + private String conditions; } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryDetailsVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryDetailsVO.java index c3cabf6fa..ed16f44ae 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryDetailsVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryDetailsVO.java @@ -31,5 +31,7 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper = true) public class DistributionDeliveryDetailsVO extends DistributionDeliveryDetailsEntity { private static final long serialVersionUID = 1L; + private Integer wholeNum; //全部 + private Integer esauNum; //全部 } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingAppVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingAppVO.java index 1d8122142..0b3e984e2 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingAppVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingAppVO.java @@ -60,8 +60,17 @@ public class DistrilbutionBillLadingAppVO extends DistrilbutionBillLadingEntity private Integer orderNum;//订单总数 private Integer planNum;//自提件数 private Integer signedNum;//签收总数 + private Integer inventoryNum;//签收总数 private Integer completeNum;//齐套总数 + private String stockListId;//库存品id + private Integer quantity;//库存数量 + private String descriptionGoods;//物品名称 + private String cargoUnit;//单位 + private String sku;//sku + private Integer deliveryNum;//备货数量 + private Integer esauInventoryNum;//以扫备货数量 + private List list = new ArrayList<>(); diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionBillLadingInventoryAppVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionBillLadingInventoryAppVO.java new file mode 100644 index 000000000..972f18662 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionBillLadingInventoryAppVO.java @@ -0,0 +1,44 @@ +/* + * 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.vo.app; + +import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 提货单 视图实体类 + * + * @author cyz + * @since 2023-06-14 + */ +@Data + +public class DistrilbutionBillLadingInventoryAppVO { + + private static final long serialVersionUID = 1L; + private Long billLadingId; + private Long ldddId; + private Long stockArticleId; + private Long stockListId; + private Integer quantity; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java index 18bae8bb8..fa3856690 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java @@ -31,6 +31,9 @@ import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.Map; /** * 自提列表信息 app控制器 @@ -86,4 +89,27 @@ public class DistributionBillLadingAppController extends BladeController { return R.data(vo); } + @ApiOperation(value = "自提订单列表库存品",notes = "自提订单列表库存品") + @GetMapping("/getInventory") + @ApiOperationSupport(order = 1) + public R> getInventory(@ApiIgnore @RequestParam Map distrilbutionBillLading, Query query){ + IPage ladingAppVOIPage = distrilbutionBillLadingService.getInventory(Condition.getPage(query),distrilbutionBillLading); + return R.data(ladingAppVOIPage); + } + + @ApiOperation(value = "自提订单列表库存品详细包件",notes = "自提订单列表库存品详细包件") + @GetMapping("/getInventory") + @ApiOperationSupport(order = 1) + public R> getInventoryNum(@ApiIgnore @RequestParam Map distrilbutionBillLading, Query query){ + IPage ladingAppVOIPage = distrilbutionBillLadingService.getInventoryNum(Condition.getPage(query),distrilbutionBillLading); + return R.data(ladingAppVOIPage); + } + + @ApiOperation(value = "扫描id") + @PutMapping("/scan") + public R getScan(@ApiIgnore @RequestParam Map distrilbutionBillLading){ + R scan = distrilbutionBillLadingService.getScan(distrilbutionBillLading); + return scan; + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.java index c3a371df0..19cdf5b3f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.java @@ -22,6 +22,7 @@ import com.logpm.distribution.excel.DistributionDeliveryDetailsExcel; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.vo.app.DistrilbutionBillLadingInventoryAppVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -50,5 +51,18 @@ public interface DistributionDeliveryDetailsMapper extends BaseMapper exportDistributionDeliveryDetails(@Param("ew") Wrapper queryWrapper); + /** + * 查询自提库存品数据 + * @param billLadingId + * @return + */ + DistributionDeliveryDetailsVO oneListNum(@Param("id") Long billLadingId); + /** + * 查询 + * @param billLadingId + * @param coding + * @return + */ + DistrilbutionBillLadingInventoryAppVO listCode(@Param("billLadingId") String billLadingId,@Param("coding") String coding); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.xml index 84d6f5eef..9a0764b18 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryDetailsMapper.xml @@ -19,7 +19,7 @@ - + @@ -33,4 +33,20 @@ SELECT * FROM logpm_distribution_delivery_details ${ew.customSqlSegment} + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java index 8fa170349..ecb4b3c58 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java @@ -29,6 +29,7 @@ import com.logpm.distribution.vo.DistrilbutionBillLadingOwnVO; import com.logpm.distribution.vo.DistrilbutionBillLadingVO; import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingDetailVO; import org.apache.ibatis.annotations.Param; +import org.springblade.core.mp.support.Query; import java.util.List; @@ -75,4 +76,13 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper getInventoryOwn(IPage page,@Param("id") Long id); DistrilbutionBillLadingDetailsVO getDetailOne(@Param("id") Long id); + + + /** + * 查询自提库存品 + * @param page + * @param distrilbutionBillLadingEntity + * @return + */ + IPage getInventory(IPage page,@Param("param") DistrilbutionBillLadingEntity distrilbutionBillLadingEntity); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index 029d9c538..127fb22fc 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -173,5 +173,18 @@ + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java index 3628fad8c..572dbb768 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java @@ -13,4 +13,32 @@ public interface IDistributionAsyncService { * @return */ void makeSureByPackage(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO); + + /** + * 修改订单状态 + * @param id + * @return + */ + Boolean getSelfPickup(Long id); + + /** + * 修改订单状态 + * @param id + * @return + */ + Boolean getOrderSelfPickup(Long id); + /** + * 修改订单状态 + * @param id + * @return + */ + Boolean getInventorySelfPickup(Long id); + /** + * 修改订单状态 + * @param id + * @return + */ + Boolean getInventoryOrderSelfPickup(Long id); + + Boolean getBillStock(Long id); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryDetailsService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryDetailsService.java index 8d523f525..22b21b1d1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryDetailsService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryDetailsService.java @@ -21,6 +21,8 @@ import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity; import com.logpm.distribution.vo.DistributionDeliveryDetailsVO; import com.logpm.distribution.excel.DistributionDeliveryDetailsExcel; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.vo.DistrilbutionBillLadingAppVO; +import com.logpm.distribution.vo.app.DistrilbutionBillLadingInventoryAppVO; import org.springblade.core.mp.base.BaseService; import java.util.List; @@ -49,4 +51,12 @@ public interface IDistributionDeliveryDetailsService extends BaseService exportDistributionDeliveryDetails(Wrapper queryWrapper); + /** + * 查询自提库存品数据 + * @param billLadingId + * @return + */ + DistributionDeliveryDetailsVO oneListNum(Long billLadingId); + + DistrilbutionBillLadingInventoryAppVO listCode(String billLadingId, String coding); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java index ce90fa966..fcbd1030c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java @@ -28,6 +28,8 @@ import com.logpm.distribution.vo.DistrilbutionBillLadingOwnVO; import com.logpm.distribution.vo.DistrilbutionBillLadingVO; import com.logpm.distribution.vo.app.DistrilbutionAppBillLadingOrderMainVO; import org.springblade.core.mp.base.BaseService; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; import java.util.List; import java.util.Map; @@ -93,8 +95,31 @@ public interface IDistrilbutionBillLadingService extends BaseService getInventory(IPage page, Map distrilbutionBillLading); + + /** + * pda扫描操作 + * @param distrilbutionBillLading + * @return + */ + R getScan(Map distrilbutionBillLading); + + /** + * 库存品包件 + * @param page + * @param distrilbutionBillLading + * @return + */ + IPage getInventoryNum(IPage page, Map distrilbutionBillLading); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index 1997dd12c..22fc1379b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -4,13 +4,15 @@ package com.logpm.distribution.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO; -import com.logpm.distribution.entity.DistributionLoadscanEntity; -import com.logpm.distribution.entity.DistributionParcelListEntity; +import com.logpm.distribution.entity.*; import com.logpm.distribution.mapper.DistributionLoadscanMapper; import com.logpm.distribution.mapper.DistributionParcelListMapper; -import com.logpm.distribution.service.IDistributionAsyncService; +import com.logpm.distribution.service.*; +import com.logpm.distribution.vo.DistributionStockupVO; +import com.logpm.distribution.vo.DistrilbutionBillStockVO; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.apache.poi.ss.formula.functions.T; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Isolation; @@ -27,6 +29,10 @@ import java.util.stream.Collectors; public class DistributionAsyncServiceImpl implements IDistributionAsyncService { private final DistributionLoadscanMapper distributionLoadscanMapper; + private final IDistributionStockArticleService distributionStockArticleService; + private final IDistributionStockService distributionStockService; + private final IDistrilbutionBillStockService distrilbutionBillStockService; + private final IDistributionDeliveryDetailsService distributionDeliveryDetailsService; private final DistributionParcelListServiceImpl distributionParcelListService; @@ -58,4 +64,62 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { //.eq(DistributionParcelListEntity::get) ); } + + /** + * 修改包件状态 + * @param id + * @return + */ + @Override + @Async + @Transactional(rollbackFor = Exception.class) + public Boolean getSelfPickup(Long id) { + DistributionParcelListEntity entity = new DistributionParcelListEntity(); + entity.setId(id); + entity.setDeliveryState("40"); + return distributionParcelListService.updateById(entity); + } + /** + * 修改订单状态 + * @param id + * @return + */ + @Override + @Async + @Transactional(rollbackFor = Exception.class) + public Boolean getOrderSelfPickup(Long id) { + DistributionStockArticleEntity entity = new DistributionStockArticleEntity(); + entity.setId(id); + entity.setState("60"); + return distributionStockArticleService.updateById(entity); + } + + @Override + @Async + @Transactional(rollbackFor = Exception.class) + public Boolean getInventorySelfPickup(Long id) { + DistributionStockEntity distributionStock = new DistributionStockEntity(); + distributionStock.setId(id); + distributionStock.setConditions("3"); + return distributionStockService.updateById(distributionStock); + } + + @Override + @Async + @Transactional(rollbackFor = Exception.class) + public Boolean getInventoryOrderSelfPickup(Long id) { + DistributionDeliveryDetailsEntity deliveryDetails = new DistributionDeliveryDetailsEntity(); + deliveryDetails.setConditions("2"); + deliveryDetails.setId(id); + return distributionDeliveryDetailsService.updateById(deliveryDetails); + } + + @Override + public Boolean getBillStock(Long id) { + DistrilbutionBillStockEntity distrilbutionBillStock = new DistrilbutionBillStockVO(); + distrilbutionBillStock.setId(id); + distrilbutionBillStock.setConditions("2"); + return distrilbutionBillStockService.updateById(distrilbutionBillStock); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryDetailsServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryDetailsServiceImpl.java index 68bf0b6fe..d3afeabeb 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryDetailsServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryDetailsServiceImpl.java @@ -21,6 +21,7 @@ import com.logpm.distribution.vo.DistributionDeliveryDetailsVO; import com.logpm.distribution.excel.DistributionDeliveryDetailsExcel; import com.logpm.distribution.mapper.DistributionDeliveryDetailsMapper; import com.logpm.distribution.service.IDistributionDeliveryDetailsService; +import com.logpm.distribution.vo.app.DistrilbutionBillLadingInventoryAppVO; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -51,4 +52,19 @@ public class DistributionDeliveryDetailsServiceImpl extends BaseServiceImpl pageListApp(IPage page, BillLadingAppDTO billLadingAppDTO) { IPage pageList = baseMapper.pageListApp(page, billLadingAppDTO); List records = pageList.getRecords(); - for (DistrilbutionBillLadingAppVO vo:records){ + for (DistrilbutionBillLadingAppVO vo : records){ //有可能存在多个订单所以需要拆分 String stockArticleId = vo.getStockArticleId(); @@ -312,6 +318,16 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl details = baseMapper.selectDetailList(Long.parseLong(s),scanStatus,orderSelfNumbering); - for (DistrilbutionAppBillLadingDetailVO detailVO:details){ + for (DistrilbutionAppBillLadingDetailVO detailVO : details){ Integer ss = detailVO.getScanStatus(); Integer errorStatus = detailVO.getErrorStatus(); if(ss == 1){ @@ -631,5 +651,193 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl getInventory(IPage page, Map distrilbutionBillLading) { + DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = JSONObject.parseObject(JSONObject.toJSONString(distrilbutionBillLading), DistrilbutionBillLadingEntity.class); + IPage inventory = baseMapper.getInventory(page, distrilbutionBillLadingEntity); + inventory.getRecords().forEach( i ->{ + if(i.getQuantity().equals(i.getDeliveryNum())){ + //已备货 + List list = distributionBillLadingScanService.list(Wrappers.query().lambda() + .eq(DistributionBillLadingScanEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) + .eq(DistributionBillLadingScanEntity::getScanType, '3') + ); + i.setEsauInventoryNum(list.size()); + }else{ + //没有备货完成 + i.setEsauInventoryNum(0); + } + }); + return inventory; + + } + + /** + * pda扫描 + * @param distrilbutionBillLading + * @return + */ + @Override + public R getScan(Map distrilbutionBillLading) { + Object billLadingId = distrilbutionBillLading.get("id"); //提货ID + Object coding = distrilbutionBillLading.get("coding"); //包条码 + Object type = distrilbutionBillLading.get("type"); //类型 4 订单 3 库存品 + if(Func.isNull(billLadingId) || Func.isNull(coding ) || Func.isNull(type) ){ + return R.fail(3000,"参数不完整,你干啥呢!!"); + }else{ + //添加扫描记录 + DistributionBillLadingScanEntity distributionBillLadingScan = new DistributionBillLadingScanEntity(); + distributionBillLadingScan.setScanType((Integer) type); + distributionBillLadingScan.setBillLadingId((Long) billLadingId); + if(type.equals("3")){ + //库存品 + DistrilbutionBillLadingInventoryAppVO inventoryAppVO = distributionDeliveryDetailsService.listCode(String.valueOf(billLadingId), String.valueOf(coding)); + if(ObjectUtils.isNotNull(inventoryAppVO)){ + //查询签收数量 + List list = distributionBillLadingScanService.list(Wrappers.query().lambda() + .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) + .eq(DistributionBillLadingScanEntity::getScanType, "3") + .eq(DistributionBillLadingScanEntity::getStockListId, inventoryAppVO.getStockListId()) + ); + if(list.size() == inventoryAppVO.getQuantity()+1){ + //修改完成状态 + distributionAsyncService.getInventoryOrderSelfPickup(inventoryAppVO.getLdddId()); + } + //修改库存品签收 + distributionAsyncService.getInventorySelfPickup(inventoryAppVO.getStockArticleId()); + distributionBillLadingScan.setPacketBarCode((String) coding); + distributionBillLadingScan.setStockListId(inventoryAppVO.getStockListId()); + distributionBillLadingScanService.save(distributionBillLadingScan); + }else { + return R.fail(3000,"包件信息不存在"); + } + }else{ + //查询订单存在吗 + List list= distrilbutionBillStockService.list(Wrappers.query().lambda() + .eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId) + ); + if(list.size()> 0){ + R.fail(3000,"当前提货任务,订单不存在!"); + }else{ + AtomicBoolean n = new AtomicBoolean(false); + list.forEach(so ->{ + //查询包件信息 + List list1 = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getStockArticleId, so.getStockArticleId()) + .eq(DistributionParcelListEntity::getPacketBarCode, coding) + ); + if(list1.size() > 0){ + n.set(true); + //查询订单包件数量签收的信息 + DistributionStockArticleEntity one = distributionStockArticleService.getOne(Wrappers.query().lambda() + .eq(DistributionStockArticleEntity::getId, so.getStockArticleId()) + ); + List list2 = distributionBillLadingScanService.list(Wrappers.query().lambda() + .eq(DistributionBillLadingScanEntity::getStockArticleId, so.getStockArticleId()) + .eq(DistributionBillLadingScanEntity::getScanType, "4") + .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingId) + ); + //判断当前签收数 + if(one.getTotalNumber().equals(list2.size()+1)){ + + DistrilbutionBillStockEntity one1 = distrilbutionBillStockService.getOne(Wrappers.query().lambda() + .eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId) + .eq(DistrilbutionBillStockEntity::getStockArticleId, one.getId()) + .eq(DistrilbutionBillStockEntity::getConditions, "1") + ); + distributionAsyncService.getOrderSelfPickup(list1.get(0).getId()); + distributionAsyncService.getBillStock(one1.getId()); + } + //修改包件状态 + distributionAsyncService.getSelfPickup(list1.get(0).getId()); + distributionBillLadingScan.setParcelListId(list1.get(0).getId()); + distributionBillLadingScan.setPacketBarCode(String.valueOf(coding) ); + //订单 + distributionBillLadingScan.setStockArticleId(one.getId()); + distributionBillLadingScan.setBillLadingId(Long.parseLong((String) billLadingId)); + } + }); + + if(n.get()){ + distributionBillLadingScanService.save(distributionBillLadingScan); + }else{ + // + return R.fail(3000,"当前订单,包件不存在!!"); + } + } + + } + //判断当前自提任务完成没有 + List list = distrilbutionBillStockService.list(Wrappers.query().lambda() + .eq(DistrilbutionBillStockEntity::getBillLadingId, billLadingId) + ); + List list1 = distributionDeliveryDetailsService.list(Wrappers.query().lambda() + .eq(DistributionDeliveryDetailsEntity::getBillLadingId, billLadingId) + ); + long count = list.stream().filter(e -> e.getConditions().equals("2")).count(); + long count2 = list1.stream().filter(e -> e.getConditions().equals("2")).count(); + if(Integer.parseInt(String.valueOf(count)) == list.size() && Integer.parseInt(String.valueOf(count2)) == list1.size()){ + //修改提货任务状态 + DistrilbutionBillLadingEntity billLadingEntity = new DistrilbutionBillLadingEntity(); + billLadingEntity.setId((Long) billLadingId); + billLadingEntity.setConsignee("2"); + distrilbutionBillLadingService.updateById(billLadingEntity); + } + return R.fail(200,"签收成功"); + } + } + + /** + * 查询包件 + * @param page + * @param distrilbutionBillLading + * @return + */ + @Override + public IPage getInventoryNum(IPage page, Map distrilbutionBillLading) { + DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = JSONObject.parseObject(JSONObject.toJSONString(distrilbutionBillLading), DistrilbutionBillLadingEntity.class); + IPage inventory = baseMapper.getInventory(page, distrilbutionBillLadingEntity); + inventory.getRecords().forEach( i ->{ + if(i.getQuantity().equals(i.getDeliveryNum())){ + //已备货 + List list = distributionBillLadingScanService.list(Wrappers.query().lambda() + .eq(DistributionBillLadingScanEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) + .eq(DistributionBillLadingScanEntity::getScanType, '3') + ); + i.setEsauInventoryNum(list.size()); + List ladingDetailVOS = new ArrayList<>(); + List list1 = distributionStockService.list(Wrappers.query().lambda() + .eq(DistributionStockEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) + .eq(DistributionStockEntity::getType, "2") + ); + list1.forEach( di ->{ + DistrilbutionAppBillLadingDetailVO billLadingDetailVO = new DistrilbutionAppBillLadingDetailVO(); + billLadingDetailVO.setPacketBarCode(di.getCoding()); + billLadingDetailVO.setScanStatus(Integer.parseInt(di.getConditions())); + switch (di.getConditions()){ + case "2": + billLadingDetailVO.setScanStatusStr("待签收"); + break; + case "3": + billLadingDetailVO.setScanStatusStr("已签收"); + break; + } + ladingDetailVOS.add(billLadingDetailVO); + }); + i.setList(ladingDetailVOS); + }else{ + //没有备货完成 + i.setEsauInventoryNum(0); + } + }); + return inventory; + } + }