diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java index 37b09afb1..fac47d3c0 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java @@ -165,5 +165,10 @@ public class DistributionParcelListEntity extends TenantEntity { */ @ApiModelProperty(value = "品牌名称") private String brandName; + /** + * 配送状态 + */ + @ApiModelProperty(value = "配送状态") + private String deliveryState; } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDeliveryListVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDeliveryListVO.java index 7c37fa14d..848602ee6 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDeliveryListVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDeliveryListVO.java @@ -42,6 +42,18 @@ public class DistributionAppDeliveryListVO extends DistributionDeliveryListEntit @ApiModelProperty(value = "装车件数") private Integer loadingNub; + /** + * 装车订单数 + */ + @ApiModelProperty(value = "装车订单数") + private Integer loadOrdNub; + /** + * 装车客户数 + */ + @ApiModelProperty(value = "装车客户数") + private Integer loadCusNub; + + /** * 是否备货 @@ -57,4 +69,11 @@ public class DistributionAppDeliveryListVO extends DistributionDeliveryListEntit @ApiModelProperty(value = "预约客户数据") private List reservationList; + + /** + * 包条数据 + */ + @ApiModelProperty(value = "包条数据") + private List parcelListVOS; + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDeliverySelfVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDeliverySelfVO.java new file mode 100644 index 000000000..bb2a3404d --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppDeliverySelfVO.java @@ -0,0 +1,34 @@ +/* + * 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.DistributionDeliverySelfEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 自主配送信息列表 视图实体类 + * + * @author Tjj + * @since 2023-07-04 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistributionAppDeliverySelfVO extends DistributionDeliverySelfEntity { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppLoadscanVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppLoadscanVO.java new file mode 100644 index 000000000..c8059fdc1 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppLoadscanVO.java @@ -0,0 +1,32 @@ +/* + * 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 lombok.Data; + + +/** + * 装车扫描表 App-视图实体类 + * + * @author lmy + * @since 2023-07-24 + */ +@Data +public class DistributionAppLoadscanVO { + private static final long serialVersionUID = 1L; + +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppParcelListVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppParcelListVO.java new file mode 100644 index 000000000..016cab965 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppParcelListVO.java @@ -0,0 +1,38 @@ +/* + * 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.DistributionParcelListEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 在库订单包件清单 视图实体类 + * + * @author cyz + * @since 2023-06-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +public class DistributionAppParcelListVO extends DistributionParcelListEntity { + private static final long serialVersionUID = 1L; + + + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java index 37a799e4a..c2da555e0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java @@ -7,12 +7,15 @@ import com.logpm.distribution.dto.DistributionDeliveryListDTO; import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO; import com.logpm.distribution.entity.DistributionDeliveryListEntity; +import com.logpm.distribution.entity.DistributionDeliverySelfEntity; import com.logpm.distribution.service.IDistributionDeliveryInfoService; import com.logpm.distribution.service.IDistributionDeliveryListService; import com.logpm.distribution.vo.DistributionDeliveryListVO; import com.logpm.distribution.vo.DistributionStockArticleVO; import com.logpm.distribution.vo.app.DistributionAppDeliveryListVO; +import com.logpm.distribution.vo.app.DistributionAppDeliverySelfVO; +import com.logpm.distribution.vo.app.DistributionAppLoadscanVO; import com.logpm.distribution.vo.app.DistributionAppStockArticleVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -23,6 +26,7 @@ import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.util.List; /** * 预约列表 控制器 @@ -41,10 +45,11 @@ public class DistributionDeliveryAppController { + /** * 配送管理 列表 */ - @GetMapping("/list") + @GetMapping("/page") @ApiOperationSupport(order = 1) @ApiOperation(value = "列表", notes = "DistributionAppDeliveryListDTO") public R> list(DistributionAppDeliveryListDTO distributionDeliveryList, Query query) { @@ -52,11 +57,22 @@ public class DistributionDeliveryAppController { return R.data(pages); } + /** + * 配送管理 选择车辆 + */ + @PostMapping("/vehicle") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "车辆列表", notes = "传入reservationId") + public R> vehicle(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { + List distributionDeliverySelfEntityList = distributionDeliveryListService.selectDistributionAppDeliverySelfVOList(distrilbutionloadingscanDTO); + return R.data(distributionDeliverySelfEntityList); + } + /** * 配送 查看客户 */ @GetMapping("/custom") - @ApiOperationSupport(order = 1) + @ApiOperationSupport(order = 3) @ApiOperation(value = "详情", notes = "传入DistributionDeliveryListDTO") public R detail(DistributionAppDeliveryListDTO distributionDeliveryList) { DistributionDeliveryListEntity detail = distributionDeliveryListService.getOne(Condition.getQueryWrapper(distributionDeliveryList)); @@ -68,20 +84,31 @@ public class DistributionDeliveryAppController { * 配送 查看订单 */ @GetMapping("/order") - @ApiOperationSupport(order = 1) + @ApiOperationSupport(order = 4) @ApiOperation(value = "查看订单", notes = "DistributionAppDeliveryListDTO") public R> order(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO, Query query) { IPage pages = distributionDeliveryInfoService.selectDistributionAppDeliveryorder(Condition.getPage(query), distributionAppDeliveryListDTO); return R.data(pages); } + /** + * 查看配送明细 + */ + @GetMapping("/wrap") + @ApiOperationSupport(order = 5) + @ApiOperation(value = "查看配送明细", notes = "DistributionAppDeliveryListDTO") + public R wrap(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO, Query query) { + DistributionAppDeliveryListVO distributionAppDeliveryListVO = distributionDeliveryListService.selectDistributionAppDeliverywrap(Condition.getPage(query), distributionAppDeliveryListDTO); + return R.data(distributionAppDeliveryListVO); + } + /** * 配送管理 装车扫描 */ @PostMapping("/loadingscan") - @ApiOperationSupport(order = 2) + @ApiOperationSupport(order = 6) @ApiOperation(value = "装车扫描", notes = "传入DistrilbutionloadingscanDTO") public R loadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { R msg = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO); @@ -92,7 +119,7 @@ public class DistributionDeliveryAppController { * 配送管理 库存品装车 */ @PostMapping("/loadinginventory") - @ApiOperationSupport(order = 3) + @ApiOperationSupport(order = 7) @ApiOperation(value = "库存品装车", notes = "传入DistrilbutionloadingscanDTO") public R loadinginventory(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { R msg = distributionDeliveryListService.loadinginventory(distrilbutionloadingscanDTO); @@ -103,7 +130,7 @@ public class DistributionDeliveryAppController { * 配送管理 装车扫描(取消) */ @PostMapping("/loadingscanoff") - @ApiOperationSupport(order = 4) + @ApiOperationSupport(order = 8) @ApiOperation(value = "装车扫描(取消)", notes = "传入DistrilbutionloadingscanDTO") public R loadingscanoff(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { R msg = distributionDeliveryListService.loadingscanoff(distrilbutionloadingscanDTO); @@ -111,13 +138,35 @@ public class DistributionDeliveryAppController { } /** - * 配送管理 装车确认(确认) + * 配送管理 装车确认(一键确认) */ - @GetMapping("/oneack") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "装车确认(确认))", notes = "DistrilbutionloadingscanDTO") + @PostMapping("/oneack") + @ApiOperationSupport(order = 9) + @ApiOperation(value = "装车确认(一键确认))", notes = "DistrilbutionloadingscanDTO") public R oneack(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { R msg = distributionDeliveryListService.oneack(distrilbutionloadingscanDTO); return msg; } + + /** + * 配送管理 装车确认 + */ + @PostMapping("/loadingack") + @ApiOperationSupport(order = 10) + public R loadingack(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { + R msg = distributionDeliveryListService.loadingack(distrilbutionloadingscanDTO); + return msg; + } + + /** + * 配送管理 装车扫描(一键装车) + */ + @PostMapping("/oneloading") + @ApiOperationSupport(order = 11) + public R oneloading(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { + R msg = distributionDeliveryListService.oneloading(distrilbutionloadingscanDTO); + return msg; + } + + } 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 4beae8ddc..32291050f 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 @@ -164,25 +164,9 @@ public class DistributionDeliveryListController extends BladeController { // return msg; // } - /** - * 配送管理 装车扫描(一键装车) - */ - @PostMapping("/oneloading") - @ApiOperationSupport(order = 2) - public R oneloading(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { - R msg = distributionDeliveryListService.oneloading(distrilbutionloadingscanDTO); - return msg; - } - /** - * 配送管理 装车确认 - */ - @PostMapping("/loadingack") - @ApiOperationSupport(order = 2) - public R loadingack(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { - R msg = distributionDeliveryListService.loadingack(distrilbutionloadingscanDTO); - return msg; - } + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSigndetailController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSigndetailController.java index dcdba5684..59ae6b8e4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSigndetailController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSigndetailController.java @@ -84,7 +84,7 @@ public class DistributionSigndetailController extends BladeController { */ @GetMapping("/detail") @ApiOperationSupport(order = 1) - @ApiOperation(value = "详情", notes = "传入distributionSigndetail") + @ApiOperation(value = "详情", notes = "传入distribution.Signdetail") public R detail(DistributionSigndetailDTO distributionSigndetail) { DistributionSigndetailEntity detail = distributionSigndetailService.getOne(Condition.getQueryWrapper(distributionSigndetail)); DistributionSigndetailVO distributionSigndetailVO = new DistributionSigndetailVO(); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppDeliveryListDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppDeliveryListDTO.java index 65ed899c7..a1a201cac 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppDeliveryListDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistributionAppDeliveryListDTO.java @@ -39,4 +39,10 @@ public class DistributionAppDeliveryListDTO extends DistributionDeliveryListEnti @ApiModelProperty(value = "查询创建时间") private String createTime_query; + /** + * 是否扫描 + */ + @ApiModelProperty(value = "是否扫描") + private String isScan; + } 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 098d4a56d..5f83890da 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 @@ -157,7 +157,7 @@ public interface DistributionDeliveryListMapper extends BaseMapper selectdeliverOnevn(Long reservationId, Long deliveryId); + List selectdeliverOnevn(@Param("reservationId") Long reservationId,@Param("deliveryId") Long deliveryId); /** * 通过配送任务库存品扫描(无拆包) * @@ -181,4 +181,10 @@ public interface DistributionDeliveryListMapper extends BaseMapper getDeliveryStockArticleInfo(String id); + /** + * 查询所有的库存品(拆包) + * + * @return + */ + List selectdeliverOnevnopen(Long reservationId, Long deliveryId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index 469cd1031..e2f399a39 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -124,6 +124,21 @@ + - SELECT ldsl.id inventoryId, ldsl.packet_bar_code packetBarCode, @@ -465,7 +480,7 @@ JOIN logpm_distribution_delivery_list lddl ON lddl.id = lds.delivery_id JOIN logpm_distribution_stock_list ldsl ON ldrs.stocklist_id = ldsl.id WHERE - lds.is_deleted = 0 and lddl.id = #{deliveryId} and ldsl.id =#{inventoryId} + lds.is_deleted = 0 and lddl.id = #{deliveryId} and lds.reservation_id =#{reservationId} + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.java index 1327af7db..c0cffaaeb 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.java @@ -22,6 +22,7 @@ import com.logpm.distribution.excel.DistributionDeliveryTripartiteExcel; 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.DistributionAppDeliverySelfVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -57,4 +58,5 @@ public interface DistributionDeliveryTripartiteMapper extends BaseMapper selectListcustom(Long deliveryId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.xml index 65a3979dd..70d6bfad4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.xml @@ -47,5 +47,8 @@ + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPackagereceiptMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPackagereceiptMapper.xml index 42be2c91a..b430d0106 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPackagereceiptMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionPackagereceiptMapper.xml @@ -35,9 +35,9 @@ 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 new file mode 100644 index 000000000..3628fad8c --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java @@ -0,0 +1,16 @@ +package com.logpm.distribution.service; + +import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO; + +/** + * 配送签收异步线程 + */ +public interface IDistributionAsyncService { + /** + * 从包条扫描状态处理订单,客户,配送状态 + * + * @param distrilbutionloadingscanDTO + * @return + */ + void makeSureByPackage(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO); +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java index 9df8c3f9a..e9b7c5358 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java @@ -25,6 +25,8 @@ import com.logpm.distribution.excel.DistributionDeliveryInfoExcel; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.distribution.vo.DistributionStockArticleVO; import com.logpm.distribution.vo.DistributionStockListVO; +import com.logpm.distribution.vo.app.DistributionAppDeliveryListVO; +import com.logpm.distribution.vo.app.DistributionAppLoadscanVO; import com.logpm.distribution.vo.app.DistributionAppStockArticleVO; import org.springblade.core.mp.base.BaseService; import java.util.List; @@ -93,4 +95,5 @@ public interface IDistributionDeliveryInfoService extends BaseService selectDistributionAppDeliveryorder(IPage page, DistributionAppDeliveryListDTO distributionAppDeliveryListDTO); + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index fb3d306d3..49b54245c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -22,6 +22,7 @@ import com.logpm.distribution.dto.DistributionDeliveryListDTO; import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO; import com.logpm.distribution.entity.DistributionDeliveryListEntity; +import com.logpm.distribution.entity.DistributionDeliverySelfEntity; import com.logpm.distribution.vo.DistributionDeliveryListPrintReponseVO; import com.logpm.distribution.vo.DistributionDeliveryListPrintRequestVO; import com.logpm.distribution.vo.DistributionDeliveryListVO; @@ -29,6 +30,8 @@ import com.logpm.distribution.excel.DistributionDeliveryListExcel; import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.distribution.vo.DistributionstatisticsnmbVO; import com.logpm.distribution.vo.app.DistributionAppDeliveryListVO; +import com.logpm.distribution.vo.app.DistributionAppDeliverySelfVO; +import com.logpm.distribution.vo.app.DistributionAppLoadscanVO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.tool.api.R; @@ -94,7 +97,7 @@ public interface IDistributionDeliveryListService extends BaseService selectDistributionAppDeliverySelfVOList(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO); + /** + * App-查看配送明细 + * + * @param page + * @param distributionAppDeliveryListDTO + * @return + */ + DistributionAppDeliveryListVO selectDistributionAppDeliverywrap(IPage page, DistributionAppDeliveryListDTO distributionAppDeliveryListDTO); /** * 查询配送任务详情 * @param id 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 new file mode 100644 index 000000000..1997dd12c --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -0,0 +1,61 @@ +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.mapper.DistributionLoadscanMapper; +import com.logpm.distribution.mapper.DistributionParcelListMapper; +import com.logpm.distribution.service.IDistributionAsyncService; +import lombok.AllArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Isolation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + + +@Log4j2 +@Service +@AllArgsConstructor +public class DistributionAsyncServiceImpl implements IDistributionAsyncService { + + private final DistributionLoadscanMapper distributionLoadscanMapper; + + private final DistributionParcelListServiceImpl distributionParcelListService; + + private final DistributionParcelListMapper distributionParcelListMapper; + + + @Override + @Async + @Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class) + public void makeSureByPackage(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { + log.info("[makeSureByPackage]线程开启>>>>>>>>>>>>>>>>>>>>>>>>{}",distrilbutionloadingscanDTO); + //查询该扫描车次扫描的所有在库包条 + List distributionLoadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() + .eq(DistributionLoadscanEntity::getDeliveryId,distrilbutionloadingscanDTO.getDeliveryId()) + ); + if (distributionLoadscanEntities.size()<0){log.info("[makeSureByPackage]包条无数据"); return;} + // 使用流式操作和映射,提取包条Id并创建新的列表 + List PackageIdList = distributionLoadscanEntities.stream().map(DistributionLoadscanEntity::getPackageId).collect(Collectors.toList()); + //修改状态包条状态 + distributionParcelListService.update(new UpdateWrapper().lambda() + .in(DistributionParcelListEntity::getId,PackageIdList) + .set(DistributionParcelListEntity::getDeliveryState,"5") + ); + //提取订单Id(去重) + List OrderList = distributionLoadscanEntities.stream().map(DistributionLoadscanEntity::getOrderId).distinct().collect(Collectors.toList()); + //查询修改订单状态 + List distributionParcelListEntities = distributionParcelListMapper.selectList(new QueryWrapper().lambda() + .in(DistributionParcelListEntity::getStockArticleId, OrderList) + //.eq(DistributionParcelListEntity::get) + ); + } +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java index 5e3b62d78..8cd752288 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java @@ -25,7 +25,12 @@ import com.logpm.distribution.mapper.DistributionDeliveryInfoMapper; import com.logpm.distribution.service.IDistributionDeliveryInfoService; import com.logpm.distribution.vo.DistributionStockArticleVO; import com.logpm.distribution.vo.DistributionStockListVO; +import com.logpm.distribution.vo.app.DistributionAppDeliveryListVO; +import com.logpm.distribution.vo.app.DistributionAppLoadscanVO; import com.logpm.distribution.vo.app.DistributionAppStockArticleVO; +import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.Func; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -87,4 +92,5 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl implements IDistributionDeliveryListService { private final DistributionDeliveryInfoMapper distributionDeliveryInfoMapper; private final DistributionReservationMapper distributionReservationMapper; @@ -75,6 +78,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectDistributionDeliveryListPage(IPage page, DistributionDeliveryListDTO distributionDeliveryList) { @@ -108,10 +112,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl customList = distributionDeliveryInfoMapper.selectcustomList(detail.getId()); - distributionDeliveryListVO.setReservationList(customList); + // if (detail.getSource() == 1) { + //查询客户信息 + List customList = distributionDeliveryInfoMapper.selectcustomList(detail.getId()); + distributionDeliveryListVO.setReservationList(customList); // } else if (detail.getSource() == 2) { // //查询订单信息 // List customList = distributionDeliveryInfoMapper.selectcustomListByOrderId(detail.getOrderId()); @@ -131,16 +135,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionReservationEntities = baseMapper.selectRservationByDeliveryId(distrilbutionloadingscanDTO.getDeliveryId()); + List distributionReservationEntities = baseMapper.selectRservationByDeliveryId(distrilbutionloadingscanDTO.getDeliveryId()); for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntities) { Long Sum = distributionLoadscanMapper.selectCount(new QueryWrapper().lambda() - .eq(DistributionLoadscanEntity::getReservationId,distributionReservationEntity.getId()) - .ne(DistributionLoadscanEntity::getScanStatus,1) - .ne(DistributionLoadscanEntity::getScanStatus,4) + .eq(DistributionLoadscanEntity::getReservationId, distributionReservationEntity.getId()) + .ne(DistributionLoadscanEntity::getScanStatus, 1) + .ne(DistributionLoadscanEntity::getScanStatus, 4) ); - if (distributionReservationEntity.getReservationNum()<=Sum){ + if (distributionReservationEntity.getReservationNum() <= Sum) { distributionReservationEntities.remove(distributionReservationEntity); } } @@ -606,20 +613,22 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl().lambda() - .eq(DistributionDeliverySelfEntity::getIsMaster,2) - .eq(DistributionDeliverySelfEntity::getDeliveryId,distrilbutionloadingscanDTO.getDeliveryId()) + .eq(DistributionDeliverySelfEntity::getIsMaster, 2) + .eq(DistributionDeliverySelfEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) ); - }else { - distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectById(distrilbutionloadingscanDTO.getLoadingId()); + } else { + distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectById(distrilbutionloadingscanDTO.getLoadingId()); } //先查询有数据的 List distributionLoadscanEntities = baseMapper.selectdeliverOne(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId()); //无数据的 - // List distributionLoadscanEntitiesno = baseMapper.selectdeliverOneNo(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId()); - //查询所有的库存品 - List distributionLoadscanvnEntities = baseMapper.selectdeliverOnevn(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId()); + // List distributionLoadscanEntitiesno = baseMapper.selectdeliverOneNo(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId()); + //查询所有的库存品(无拆包) + List distributionLoadscanvnEntities = baseMapper.selectdeliverOnevn(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId()); + //查询所有的库存品(拆包) + List distributionLoadscanvnEntitiesopen = baseMapper.selectdeliverOnevnopen(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId()); //将该客户所有的物品上该车辆 if (distributionLoadscanEntities.size() > 0) { for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) { @@ -633,8 +642,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl 0) { + for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) { + //依次插入该装车记录,设置车辆 + if (null != distributionDeliverySelfEntity.getDriverId()) { + distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); + } + distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); + distributionLoadscanEntity.setScanStatus(2); + distributionLoadscanEntity.setScanType("1"); + distributionLoadscanEntity.setScanTime(new Date()); + if (null == distributionLoadscanEntity.getPackageNub()) { + distributionLoadscanEntity.setPackageNub(1); + } + distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId()); + distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); + if (null != distributionDeliverySelfEntity.getDriverPhone()) { + distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); + } + if (null != distributionDeliverySelfEntity.getVehicleId()) { + distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); + } + //查询本车次是否第一次扫码,没有则更新上车时间 + Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); + //更新签收表的装车数量 + Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); + } + distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities); + } + if (distributionLoadscanvnEntitiesopen.size() > 0) { + for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntitiesopen) { + //依次插入该装车记录,设置车辆 + if (null != distributionDeliverySelfEntity.getDriverId()) { + distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); + } + distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); + distributionLoadscanEntity.setScanStatus(2); + distributionLoadscanEntity.setScanType("1"); + distributionLoadscanEntity.setScanTime(new Date()); + if (null == distributionLoadscanEntity.getPackageNub()) { + distributionLoadscanEntity.setPackageNub(1); + } + distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId()); + distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); + if (null != distributionDeliverySelfEntity.getDriverPhone()) { + distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); + } + if (null != distributionDeliverySelfEntity.getVehicleId()) { + distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); + } + //查询本车次是否第一次扫码,没有则更新上车时间 + Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); + //更新签收表的装车数量 + Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); + } + distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities); + } // if (distributionLoadscanEntitiesno.size() > 0) { // for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntitiesno) { // //查询是否重复扫码 @@ -696,15 +762,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl().lambda() - .eq(DistributionLoadscanEntity::getDeliveryId,distrilbutionloadingscanDTO.getDeliveryId()) - .set(DistributionLoadscanEntity::getScanStatus,3) + .eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) + .set(DistributionLoadscanEntity::getScanStatus, 3) ); - //库存品装车 + //异步确认包条扫描信息 + distributionAsyncService.makeSureByPackage(distrilbutionloadingscanDTO); + //库存品确认装车 distributionLoadscaninvnService.update(new UpdateWrapper().lambda() - .eq(DistributionLoadscaninvnEntity::getDeliveryId,distrilbutionloadingscanDTO.getDeliveryId()) - .set(DistributionLoadscaninvnEntity::getScanStatus,3) + .eq(DistributionLoadscaninvnEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) + .set(DistributionLoadscaninvnEntity::getScanStatus, 3) ); return R.status(update); } @@ -802,22 +870,22 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionLoadscanvnEntities = new ArrayList<>(); distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVnScan(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId()); if (distributionLoadscanvnEntities.size() <= 0) { //拆包从备货查询 distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVnScanStock(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId()); - if (distributionLoadscanvnEntities.size()<=0){ - return R.fail(3001, "窜货"); + if (distributionLoadscanvnEntities.size() <= 0) { + return R.fail(3001, "窜货"); } } for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) { @@ -831,13 +899,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionLoadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper().lambda() - .ne(DistributionLoadscanEntity::getScanStatus,1) - .eq(DistributionLoadscanEntity::getDeliveryId,distrilbutionloadingscanDTO.getDeliveryId()) - .eq(DistributionLoadscanEntity::getPacketBarCode,distrilbutionloadingscanDTO.getBarcode()) + .ne(DistributionLoadscanEntity::getScanStatus, 1) + .eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) + .eq(DistributionLoadscanEntity::getPacketBarCode, distrilbutionloadingscanDTO.getBarcode()) ); - if (distributionLoadscanEntities.size()< 0){ + if (distributionLoadscanEntities.size() < 0) { return R.fail(3005, "该货物未装车"); } - boolean b =false; + boolean b = false; for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) { - b = distributionLoadscanService.updateById(distributionLoadscanEntity); + b = distributionLoadscanService.updateById(distributionLoadscanEntity); } return R.status(b); } @@ -916,7 +987,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl customList = distributionDeliveryInfoMapper.selectAppcustomList(detail.getId()); distributionAppDeliveryListVO.setReservationList(customList); @@ -949,4 +1020,36 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectDistributionAppDeliverySelfVOList(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { + //查询该配送类型 + DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId()); + List distributionAppDeliverySelfVOS = new ArrayList<>(); + if (distributionDeliveryListEntity.getKind().equals("1")) { + //自主配送 + distributionAppDeliverySelfVOS = distributionDeliverySelfMapper.selectListcustom(distrilbutionloadingscanDTO.getDeliveryId()); + } else { + //三方配送 + distributionAppDeliverySelfVOS = distributionDeliveryTripartiteMapper.selectListcustom(distrilbutionloadingscanDTO.getDeliveryId()); + + } + return distributionAppDeliverySelfVOS; + } + + + @Override + public DistributionAppDeliveryListVO selectDistributionAppDeliverywrap(IPage page, DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) { + //查询配送 + DistributionDeliveryListEntity distributionDeliveryListEntity = baseMapper.selectById(distributionAppDeliveryListDTO.getId()); + DistributionAppDeliveryListVO distributionAppDeliveryListVO = new DistributionAppDeliveryListVO(); + Func.copy(distributionDeliveryListEntity, distributionAppDeliveryListVO); + //查询完成客户数 + + //查询完成订单数 + + //查询该配送所有包条 + //distributionParcelListMapper.selectList(); + return null; + } }