diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java index 718aaeebf..efd122f2f 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java @@ -16,6 +16,7 @@ */ package com.logpm.basicdata.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; @@ -135,6 +136,11 @@ public class BasicdataWarehouseEntity extends TenantEntity { */ @ApiModelProperty(value = "所属部门") private String department; + /** + * 所属部门--部门回显 + */ + @ApiModelProperty(value = "所属部门--部门回显") + private String departmentName; /** * 所属部门 diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java index 804561738..8eb01ab71 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java @@ -69,12 +69,12 @@ public class DistributionReservationEntity extends TenantEntity { * 配送类型;预约添加送货方式;1-送货(商配的唯一方式)、2-送货上楼、3-送装一体、4-装 */ @ApiModelProperty(value = "配送类型;预约添加送货方式;1-送货(商配的唯一方式)、2-送货上楼、3-送装一体、4-装") - private String deliveryType; + private String deliveryWay; /** * 配送方式;预约添加送货方式;1-送货(商配的唯一方式)、2-送货上楼、3-送装一体、4-装 */ @ApiModelProperty(value = "配送类型;1-商配、2-市配") - private String deliveryWay; + private String deliveryType; /** * 到付运费 */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java index 4c9d48854..b115faae4 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java @@ -17,12 +17,15 @@ package com.logpm.distribution.vo; import com.baomidou.mybatisplus.annotation.TableField; +import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionStockArticleEntity; import io.swagger.annotations.ApiModelProperty; import org.springblade.core.tool.node.INode; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.List; + /** * 配送在库订单 视图实体类 * @@ -76,4 +79,12 @@ public class DistributionStockArticleVO extends DistributionStockArticleEntity { @ApiModelProperty(value = "是否齐套名称") private String completeSetName; + /** + * 是否齐套名称 + */ + @ApiModelProperty(value = "是否齐套名称") + private List parcelListVOS; + + + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java index fbde9fbff..9f9b03e0f 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java @@ -189,6 +189,18 @@ public class BasicdataGoodsAreaController extends BladeController { return R.data(list); } + /** + * 查询当前登录人所能操作的备货区 + */ + @GetMapping("/stockUpInfo") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "查询当前登录人所能操作的备货区", notes = "传入ids") + public R stockUpInfo(@RequestParam String params) { + List result = basicdataGoodsAreaService.getStockUpInfo(params); + return R.data(result); +// return R.status(distributionStockupService.deleteLogic(Func.toLongList(ids))); + } + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamGroupController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamGroupController.java index 599bfb174..26a8c1dd6 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamGroupController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamGroupController.java @@ -158,4 +158,15 @@ public class BasicdataTeamGroupController extends BladeController { ExcelUtil.export(response, "基础班组表数据" + DateUtil.time(), "基础班组表数据表", list, BasicdataTeamGroupExcel.class); } + /** + * 查询当前登录人能够操作的班组信息 + */ + @GetMapping("/listTeamInfo") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "传入basicdataTeamGroup") + public R getListTeamInfo( @RequestParam String params) { + List result = basicdataTeamGroupService.getListTeamInfo(params); + return R.data(result); + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java index e5b7f2ba0..8749a9778 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java @@ -81,11 +81,13 @@ public class BasicdataWarehouseController extends BladeController { Object endDate = warehouseWarehouse.get("endDate"); warehouseWarehouse.put("startDate",null); warehouseWarehouse.put("endDate",null); + String deptId = AuthUtil.getUser().getDeptId(); QueryWrapper qw = Condition.getQueryWrapper(warehouseWarehouse, BasicdataWarehouseEntity.class); qw .apply(startDate != null,"date_format (start_date,'%Y-%m-%d') >= date_format ({0},'%Y-%m-%d')",startDate) .apply(endDate != null,"date_format (end_date,'%Y-%m-%d') <= date_format ({0},'%Y-%m-%d')",endDate); qw.lambda().eq(BasicdataWarehouseEntity::getTenantId, AuthUtil.getTenantId()); + qw.lambda().eq(BasicdataWarehouseEntity::getDepartment, deptId); IPage page = warehouseService.page(Condition.getPage(query), qw); // IPage pages = warehouseService.page(Condition.getPage(query), Condition.getQueryWrapper(warehouseWarehouse, BasicdataWarehouseEntity.class)); return R.data(page); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java index 00397ba0e..f8a75fcb2 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java @@ -65,4 +65,7 @@ public interface BasicdataGoodsAreaMapper extends BaseMapper stockUp(@Param("par") BasicdataGoodsAreaEntity warehouseWarehouse); + + + List getStockUpInfo(@Param("deptId")String params); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml index 30f065a90..ef02fea49 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml @@ -108,5 +108,18 @@ WHERE warehouse_id = #{value} AND is_deleted=0 - + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.java index a0f48a760..b161bedd3 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.java @@ -52,4 +52,6 @@ public interface BasicdataTeamGroupMapper extends BaseMapper exportBasicdataTeamGroup(@Param("ew") Wrapper queryWrapper); IPage listTeam(IPage page, @Param("param") BasicdataTeamGroupEntity basicdataTeamGroupEntity); + + List getListTeamInfo(@Param("deptId")String params); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.xml index a6cbedd62..10fafb367 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.xml @@ -41,5 +41,18 @@ + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml index 437f62423..ec933ee31 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml @@ -31,6 +31,7 @@ + diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java index ddedceee9..184fbcaed 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java @@ -84,4 +84,6 @@ public interface IBasicdataGoodsAreaService extends BaseService ids); List stockUp(BasicdataGoodsAreaEntity warehouseWarehouse); + + List getStockUpInfo(String params); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java index 3ad4c683b..5e40a5e6a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java @@ -52,4 +52,11 @@ public interface IBasicdataTeamGroupService extends BaseService exportBasicdataTeamGroup(Wrapper queryWrapper); IPage listTeam(IPage page, Map basicdataTeamGroup ); + + /** + * 查询当前登录人能够操作的班组信息 + * @param params + * @return + */ + List getListTeamInfo(String params); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java index 08d3c1be3..c99469435 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java @@ -121,4 +121,9 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl getStockUpInfo(String params) { + return basicdataGoodsAreaMapper.getStockUpInfo(params); + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamGroupServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamGroupServiceImpl.java index a6b1c2395..408ac0acd 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamGroupServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamGroupServiceImpl.java @@ -61,4 +61,9 @@ public class BasicdataTeamGroupServiceImpl extends BaseServiceImpl getListTeamInfo(String params) { + return baseMapper.getListTeamInfo(params); + } + } 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 70904727a..6d00a68bb 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 @@ -271,4 +271,18 @@ public class DistributionDeliveryListController extends BladeController { } + /** + * 修改配送任务 + */ + @PutMapping("/updateDeliveryList") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "customArgs") + public R UpdateDeliveryList(@RequestBody DistributionDeliveryListDTO deliveryListDTO) { + R result = distributionDeliveryListService.UpdateDeliveryListInfo(deliveryListDTO); + return result; + } + + + + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java index dcb2fe43a..24d0f19cb 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java @@ -47,10 +47,7 @@ import wrapper.DistributionStockArticleWrapper; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; /** * 配送在库订单 控制器 @@ -235,8 +232,19 @@ public class DistributionStockArticleController extends BladeController { return result; } - - + /** + * 查询订单和订单的包件信息 + */ + @GetMapping("/selectStockArticleAndParcel") + @ApiOperationSupport(order = 7) + @ApiOperation(value = "逻辑删除", notes = "传入ids") + public R selectStockArticleAndParcel( @RequestParam String typeService,@RequestParam String genre) { + HashMap query = new HashMap<>(); + query.put("typeService",typeService); + query.put("genre",genre); + R> result = distributionStockArticleService.selectStockArticleAndParcel(query); + return result; + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java index 0cc2f961a..30f5773cf 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java @@ -216,4 +216,5 @@ public class DistributionStockupController extends BladeController { ExcelUtil.export(response, "备货信息表数据" + DateUtil.time(), "备货信息表数据表", list, DistributionStockupExcel.class); } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryAllocationDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryAllocationDTO.java index 6beebf05c..1d2649e75 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryAllocationDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryAllocationDTO.java @@ -1,10 +1,12 @@ package com.logpm.distribution.dto; +import com.fasterxml.jackson.annotation.JsonFormat; import com.logpm.distribution.entity.DistributionReservationEntity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.Date; import java.util.List; import java.util.Map; @@ -74,5 +76,11 @@ public class DistributionDeliveryAllocationDTO { @ApiModelProperty(value = "商配订单信息") private List stockArticle; + /** + * 任务时间 + */ + @ApiModelProperty(value = "任务时间") + private String taskTime; + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryListDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryListDTO.java index f98962e1d..091dd8e74 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryListDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryListDTO.java @@ -22,6 +22,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.NonNull; +import java.util.List; + /** * 配送管理 数据传输对象实体类 * @@ -37,4 +39,46 @@ public class DistributionDeliveryListDTO extends DistributionDeliveryListEntity */ @ApiModelProperty(value = "查询创建时间") private String createTime_query; + +// /** +// * 备货数据 +// */ +// @ApiModelProperty(value = "备货数据") +// private DistributionStockupDTO stockupDTO; + + /** + * 预约数据 + */ + @ApiModelProperty(value = "预约数据") + private DistributionReservationDTO reservation; + + /** + * 自主配送司机、车辆信息 + */ + @ApiModelProperty(value = "自主配送司机、车辆信息") + private List allocationInfo; + + /** + * 外协配送司机、车辆信息 + */ + @ApiModelProperty(value = "外协配送司机、车辆信息") + private DistributionDeliveryTripartiteDTO tripartite; + + /** + * 订单数据 + */ + @ApiModelProperty(value = "订单数据") + private List stockArticle; + + /** + * 主司机信息 + */ + @ApiModelProperty(value = "主司机信息") + private String masterDriverName; + + /** + * 主车辆信息 + */ + @ApiModelProperty(value = "主车辆信息") + private String masterVehicleNub; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.java index 4abb9bbf5..d47de4bfd 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.java @@ -64,4 +64,10 @@ public interface DistributionDeliverySelfMapper extends BaseMapper getDeliverySelfInfo(@Param("id")String id); + /** + * 删除司机信息 + * @param id + */ + void deleteDeliverySelf(@Param("id")Long id); + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml index ebf8422b0..30fcc08a8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml @@ -27,6 +27,9 @@ + + DELETE FROM logpn_distribution_delivery_self WHERE delivery_id = #{id} + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java index 9065d1ffa..b3235e5d1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java @@ -76,7 +76,9 @@ public interface DistributionReservationMapper extends BaseMapper getDeliveryReservation(@Param("id")Long id); Integer getReservationNumByReservationIdAndStockListId(@Param("reservationId") Long reservationId, @Param("stockListId")Long stockListId); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index fe8711ed4..da29cbb9b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -234,9 +234,7 @@ + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java index dc5007b5b..95b3869e1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java @@ -27,6 +27,7 @@ import com.logpm.distribution.vo.DistributionStockupVO; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 备货信息表 Mapper 接口 @@ -107,4 +108,5 @@ public interface DistributionStockupMapper extends BaseMapper - - - 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 d5c50f266..d099d4ba2 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 @@ -150,4 +150,12 @@ public interface IDistributionDeliveryListService extends BaseService getAppDeliveryreservationListPage(IPage page,DistributionAppDeliveryListDTO distributionDeliveryList); IPage selectDistributionAppDeliverywrapIn(IPage page, DistributionAppDeliveryListDTO distributionAppDeliveryListDTO); + + /** + * 修改配送任务 + * @param deliveryListDTO + * @return + */ + R UpdateDeliveryListInfo(DistributionDeliveryListDTO deliveryListDTO); + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java index e33daa8d1..cd9551849 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java @@ -24,6 +24,7 @@ import com.logpm.distribution.vo.DistributionStockArticleVO; import com.logpm.distribution.excel.DistributionStockArticleExcel; import com.baomidou.mybatisplus.core.metadata.IPage; 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; @@ -86,4 +87,11 @@ public interface IDistributionStockArticleService extends BaseService selectClientListPage(IPage page, DistributionStockArticleVO distributionStockArticle); + + /** + * 查询订单和包件信息 + * @param query + * @return + */ + R> selectStockArticleAndParcel(Map query); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 6897e8d43..20fd634e1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -18,18 +18,23 @@ 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.DistributionDeliveryListDTO; +import com.logpm.distribution.dto.*; import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO; import com.logpm.distribution.entity.*; import com.logpm.distribution.mapper.*; -import com.logpm.distribution.service.IDistributionAsyncService; +import com.logpm.distribution.service.*; import com.logpm.distribution.vo.*; import com.logpm.distribution.excel.DistributionDeliveryListExcel; import com.logpm.distribution.service.IDistributionDeliveryListService; import com.logpm.distribution.vo.app.*; +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.DistributionAppReservationVO; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import net.bytebuddy.implementation.bytecode.Throw; import org.apache.commons.lang.StringUtils; import org.springblade.common.serviceConstant.ServiceConstant; import org.springblade.core.redis.cache.BladeRedis; @@ -37,6 +42,7 @@ import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.RandomType; import org.springblade.system.feign.IDictBizClient; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -49,6 +55,8 @@ import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; /** * 配送管理 服务实现类 @@ -62,20 +70,27 @@ import java.util.stream.Collectors; public class DistributionDeliveryListServiceImpl extends BaseServiceImpl implements IDistributionDeliveryListService { private final DistributionDeliveryInfoMapper distributionDeliveryInfoMapper; private final DistributionReservationMapper distributionReservationMapper; + private final IDistributionReservationStockarticleService distributionReservationStockarticleService; + private final IDistributionReservationPackageService distributionReservationPackageService; private final DistributionParcelListMapper distributionParcelListMapper; + private final IDistributionParcelListService distributionParcelListService; private final DistributionLoadscanMapper distributionLoadscanMapper; private final DistributionLoadscanServiceImpl distributionLoadscanService; private final DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService; private final DistributionDeliveryListMapper distributionDeliveryListMapper; private final DistributionSignforServiceImpl distributionSignforService; private final DistributionSignforMapper distributionSignforMapper; + private final IDistributionSignforService distributionSignforServicer; private final DistributionStockArticleMapper distributionStockArticleMapper; private final DistributionSigndetailServiceImpl distributionSigndetailService; private final DistributionPackadeliServiceImpl distributionPackadeliService; private final DistributionDeliverySelfMapper distributionDeliverySelfMapper; + private final IDistributionDeliverySelfService distributionDeliverySelfService; private final DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper; + private final IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService; private final DistributionReservationStockarticleMapper distributionReservationStockarticleMapper; private final DistributionStockupMapper distributionStockupMapper; + private final IDistributionStockupInfoService distributionStockupInfoService; private final DistributionStockMapper distributionStockMapper; private final DistributionLoadscaninvnMapper distributionLoadscaninvnMapper; private final BladeRedis bladeRedis; @@ -1095,6 +1110,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl stockArticleVOS = distributionDeliveryListMapper.getDeliveryStockArticleInfo(id); + stockArticleVOS.forEach(s->{ + //这里查询出订单选取的包件信息 + }); deliveryListVO.setStockArticleList(stockArticleVOS); //2、查询出备货信息 DistributionStockupVO stockupEntity = distributionStockupMapper.getDeliveryStockupInfo(id); @@ -1142,6 +1160,181 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl UpdateDeliveryListInfo(DistributionDeliveryListDTO deliveryListDTO) { + if ( Func.isEmpty(deliveryListDTO)){ + log.error("deliveryListDTO参数异常+{"+deliveryListDTO+"}"); + return R.fail("服务器正忙!!"); + } + //首先对配送任务进行修改 + //查询出配送任务的基本信息 + DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryListDTO.getId()); + //查询这个配送任务的备货任务 + DistributionStockupVO stockupInfo = distributionStockupMapper.getDeliveryStockupInfo(deliveryListEntity.getId().toString()); + List allocationInfo = deliveryListDTO.getAllocationInfo(); + String kind = deliveryListEntity.getKind(); + switch (kind){ + case "1": + //对自主配送中的司机信息进行删除 + distributionDeliverySelfMapper.deleteDeliverySelf(deliveryListEntity.getId()); + break; + case "2": + distributionDeliveryTripartiteMapper.deleteDeliveryTripartite(deliveryListEntity.getId()); + break; + } + if (Func.isEmpty(allocationInfo)){ + //这里就表示是三方配送 + DistributionDeliveryTripartiteDTO tripartite = deliveryListDTO.getTripartite(); + DistributionDeliveryTripartiteEntity tripartiteEntity = Func.copy(tripartite, DistributionDeliveryTripartiteEntity.class); + tripartiteEntity.setDeliveryId(deliveryListEntity.getId()); + distributionDeliveryTripartiteService.save(tripartiteEntity); + deliveryListEntity.setDriverName(tripartiteEntity.getDriverName()); + deliveryListEntity.setVehicleName(tripartiteEntity.getVehicleNum()); + //重新为配送任务的司机进行设置 + }else { + StringBuilder driverNames = new StringBuilder(); + StringBuilder vehicleNubs = new StringBuilder(); + //自主配送 + allocationInfo.forEach(a->{ + DistributionDeliverySelfEntity deliverySelfEntity = Func.copy(a, DistributionDeliverySelfEntity.class); + if (a.getDriverName().equals(deliveryListDTO.getMasterDriverName()) && a.getVehicleNub().equals(deliveryListDTO.getMasterVehicleNub())){ + deliverySelfEntity.setIsMaster(ServiceConstant.IS_MASTER_YES); + } + //自主配送需要对司机名称进行重新拼接 + distributionDeliverySelfService.save(deliverySelfEntity); + driverNames.append(deliverySelfEntity.getDriverName()).append(","); + vehicleNubs.append(deliverySelfEntity.getVehicleNub()).append(","); + }); + //配送任务重新设置司机名称 + deliveryListEntity.setDriverName(driverNames.deleteCharAt(driverNames.length()-1).toString()); + deliveryListEntity.setVehicleName(vehicleNubs.deleteCharAt(vehicleNubs.length()-1).toString()); + } + //对配送进行更改 +// this.updateById(deliveryListEntity); + //TODO 这里对订单、包件、客户之间的关系进行过滤筛选 + //获取所有订单 + List stockArticle = deliveryListDTO.getStockArticle(); + //根据门店进行分组 + Map> storeClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getStoreName)); + List distributionStockArticleDTOS = storeClient.get(""); + Map> mallClient = distributionStockArticleDTOS.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getMallName)); + //3、维护订单和客户 + storeClient.forEach((k,v)->mallClient.merge(k,v,(v1,v2)->v2)); + //查询该配送任务下原有的客户 + List reservationEntityList = distributionReservationMapper.getDeliveryReservation(deliveryListEntity.getId()); + //将原客户和新的进行比对,如果有那么则进行客户修改,最后剩下的订单信息都属于是新客户 + Map> originalClient = reservationEntityList.stream().collect(Collectors.groupingBy(DistributionReservationEntity::getConsignee)); + Date date = new Date(); + mallClient.forEach((k,v)->{ + if (!k.equals("")){ + if (Func.isNotEmpty(originalClient.get(k))){ + //这里实际上就是包件发生了变化 + v.forEach(o->{ + List packageList = o.getPackageList(); + //删除原来订单和包件之间的关系,建立新的包件和订单之间的关系 + //1、通过客户名称查询出预约信息 + //2、通过预约信息解除该订单下原有的包件信息 + //3、重新建立包件和预约的关联关系 + + }); + originalClient.remove(k); + }else { + DistributionReservationDTO reservation = deliveryListDTO.getReservation(); + DistributionReservationEntity reservationEntity = Func.copy(reservation, DistributionReservationEntity.class); + reservationEntity.setReservationStatus(ServiceConstant.RESERVATION_STATE_WAIT_DELIVERY); + reservationEntity.setConsignee(k); + reservationEntity.setDeliveryAddress(v.get(0).getConsigneeAddress()); + reservationEntity.setDeliveryPhone(v.get(0).getCustomerTelephone()); + reservationEntity.setReservationDate(date); + reservationEntity.setPeriodOfTime(ServiceConstant.RESERVATION_PERIOED_TIME_DAY); + reservationEntity.setServiceNumber(v.get(0).getServiceNumber()); + reservationEntity.setReservationCode(Func.random(13, RandomType.INT)); + reservationEntity.setStockupStatus(ServiceConstant.STOCKUP_STATE_WAIT_EXECUTION); + BladeUser user = AuthUtil.getUser(); + reservationEntity.setCreateUser(user.getUserId()); + reservationEntity.setCreateDept(Long.parseLong(user.getDeptId())); + reservationEntity.setTenantId(AuthUtil.getTenantId()); + reservationEntity.setStatus(1); + reservationEntity.setIsDeleted(0); + //统计订单下包件总数 + AtomicInteger orderTotal = new AtomicInteger(); + //保存新的预约任务 + distributionReservationMapper.insert(reservationEntity); + //订单自编号拼接 + HashSet str = new HashSet<>(); + v.forEach(s->{ + //新增 + //构建预约和订单之间的关系 + List packageList = s.getPackageList(); + //统计订单下包件总数 + AtomicInteger packageTotal = new AtomicInteger(); + if (packageList.size()>0){ + //完成对选择的包件信息维护 + packageList.forEach(p->{ + DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); + reservationPackageEntity.setStockArticleId(s.getId()); + reservationPackageEntity.setReservationId(reservationEntity.getId()); + reservationPackageEntity.setParceListId(p.getId()); + reservationPackageEntity.setPacketBarCode(p.getPacketBarCode()); + distributionReservationPackageService.save(reservationPackageEntity); + packageTotal.getAndAdd(p.getQuantity()); + }); + }else { + //查询出该订单下的所有包件,完成预约和包件的维护 + QueryWrapper parcelListEntityQueryWrapper = new QueryWrapper<>(); + parcelListEntityQueryWrapper.lambda().eq(DistributionParcelListEntity::getStockArticleId,s.getId()); + List distributionParcelListEntityList = distributionParcelListService.getBaseMapper().selectList(parcelListEntityQueryWrapper); + distributionParcelListEntityList.forEach(dp->{ + DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); + reservationPackageEntity.setStockArticleId(s.getId()); + reservationPackageEntity.setReservationId(reservationEntity.getId()); + reservationPackageEntity.setParceListId(dp.getId()); + reservationPackageEntity.setPacketBarCode(dp.getPacketBarCode()); + distributionReservationPackageService.save(reservationPackageEntity); + packageTotal.getAndAdd(dp.getQuantity()); + }); + } + //完成预约和订单之间数据关系 + DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity(); + reservationStockarticleEntity.setReservationNum(packageTotal.get()); + reservationStockarticleEntity.setStockArticleCode(s.getStockArticleCode()); + reservationStockarticleEntity.setIsHaveData(s.getIsHaveData()); + reservationStockarticleEntity.setReservationId(reservationEntity.getId()); + reservationStockarticleEntity.setStockArticleId(s.getId()); + distributionReservationStockarticleService.save(reservationStockarticleEntity); + //统计订单的包件数量 + orderTotal.getAndAdd(reservationStockarticleEntity.getReservationNum()); + str.add(s.getOrderSelfNumbering()); + }); + //对预约信息进行修改 + String s = String.join(",", str); + s = s.replaceFirst(",",""); + reservationEntity.setReservationNum(orderTotal.get()); + reservationEntity.setStockArticleId(s); + reservationEntity.setUpdateUser(user.getUserId()); + reservationEntity.setUpdateTime(new Date()); + distributionReservationMapper.updateById(reservationEntity); + //构建新客户和备货任务之间的关系 + DistributionStockupInfoEntity stockupInfoEntity = new DistributionStockupInfoEntity(); + stockupInfoEntity.setStockupId(stockupInfo.getId()); + stockupInfoEntity.setReservationId(reservationEntity.getId()); + distributionStockupInfoService.save(stockupInfoEntity); + //构建新客户信息和配送任务之间的关系 + DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity(); + distributionSignforEntity.setReservationId(reservationEntity.getId()); + distributionSignforEntity.setTrainNumber(deliveryListEntity.getTrainNumber()); + distributionSignforEntity.setDeliveryId(deliveryListEntity.getId()); + distributionSignforServicer.save(distributionSignforEntity); + } + } + }); + //删除客户信息 + + + return null; + } + @Override public List selectDistributionAppDeliverySelfVOList(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { //查询该配送类型 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 3d7bcd0bf..7d49c7d45 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 @@ -29,6 +29,7 @@ import com.logpm.distribution.vo.*; import org.springblade.common.serviceConstant.ServiceConstant; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; +import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; @@ -422,9 +423,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl> selectStockArticleAndParcel(Map query) { + List distributionStockArticleVOList = distributionStockArticleMapper.getAllReservationStockArticleInfo(query); + distributionStockArticleVOList.forEach(s->{ + QueryWrapper parcelListVOQueryWrapper = new QueryWrapper<>(); + parcelListVOQueryWrapper.lambda().eq(DistributionParcelListEntity::getStockArticleId,s.getId()); + List distributionParcelListEntityList = distributionParcelListService.getBaseMapper().selectList(parcelListVOQueryWrapper); + s.setParcelListVOS(distributionParcelListEntityList); + }); + return R.data(distributionStockArticleVOList); + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 36f747fb9..d46b347e1 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -382,6 +382,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl