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 e07251298..804561738 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 @@ -114,7 +114,7 @@ public class DistributionReservationEntity extends TenantEntity { * 备货区编号 */ @ApiModelProperty(value = "备货区编号") - private String goodsAreaId; + private Long goodsAreaId; /** * 备货区名称 */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java index 67c9f2498..318c892f1 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java @@ -75,11 +75,11 @@ public class DistributionStockupEntity extends TenantEntity { */ @ApiModelProperty(value = "备货库位") private String stockipAllocation; -// /** -// * 预约信息编号 -// */ -// @ApiModelProperty(value = "预约信息编号") -// private String reservationId; + /** + * 预约信息编号 + */ + @ApiModelProperty(value = "预约信息编号") + private Long goodsAreaId; /** * 预留1 */ @@ -110,11 +110,11 @@ public class DistributionStockupEntity extends TenantEntity { */ @ApiModelProperty(value = "服务类型 1 商 2 市 3 自") private String typeService; - /** - * 备货区编号 - */ - @ApiModelProperty(value = "备货区编号") - private Long goodsAreaId; +// /** +// * 备货区编号 +// */ +// @ApiModelProperty(value = "备货区编号") +// private Long goodsAreaId; /** * 叉车司机 */ @@ -159,6 +159,13 @@ public class DistributionStockupEntity extends TenantEntity { @ApiModelProperty(value = "班组职能;1-装、2-卸") private String teamResponsibility; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + private String remarks; + + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryListVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryListVO.java index 54b65535a..168503c06 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryListVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryListVO.java @@ -55,5 +55,37 @@ public class DistributionDeliveryListVO extends DistributionDeliveryListEntity { @ApiModelProperty(value = "预约客户数据") private List<DistributionDeliveryInfoVO> reservationList; + /** + * 配送任务订单数据 + */ + @ApiModelProperty(value = "配送任务订单数据") + private List<DistributionStockArticleVO> stockArticleList; + + /** + * 配送任务备货数据 + */ + @ApiModelProperty(value = "配送任务备货数据") + private DistributionStockupVO stockupInfo; + + /** + * 配送任务自主配送司机数据 + */ + @ApiModelProperty(value = "配送任务自主配送司机数据") + private List<DistributionDeliverySelfVO> deliverySelfVO; + + /** + * 配送任务外协司机数据 + */ + @ApiModelProperty(value = "配送任务外协司机数据") + private DistributionDeliveryTripartiteVO deliveryTripartiteVO; + + /** + * 预约信息 + */ + @ApiModelProperty(value = "预约信息") + private DistributionReservationVO reservationInfo; + + + } 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 6769c8554..4beae8ddc 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 @@ -277,5 +277,16 @@ public class DistributionDeliveryListController extends BladeController { return R.data(pages); } + /** + * 配送客户列表 + */ + @GetMapping("/getDeliveryList") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "分页", notes = "customArgs") + public R<DistributionDeliveryListVO> getDeliveryList(@RequestParam String id) { + DistributionDeliveryListVO deliveryListVO = distributionDeliveryListService.getDeliveryList(id); + return R.data(deliveryListVO); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockupDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockupDTO.java index 7c2d5e34b..ae143d56d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockupDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockupDTO.java @@ -31,8 +31,7 @@ import java.util.Date; * @since 2023-06-15 */ @Data -@EqualsAndHashCode(callSuper = true) -public class DistributionStockupDTO extends DistributionStockupEntity { +public class DistributionStockupDTO{ private static final long serialVersionUID = 1L; /** @@ -59,6 +58,12 @@ public class DistributionStockupDTO extends DistributionStockupEntity { @ApiModelProperty(value = "备货区名称") private String goodsAreaName; + /** + * 预约单编号 + */ + @ApiModelProperty(value = "备货区名称") + private Long goodsAreaId; + /** * 班组职能 */ 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 2573d2ddc..098d4a56d 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 @@ -20,14 +20,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.logpm.distribution.dto.DistributionDeliveryListDTO; import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; import com.logpm.distribution.entity.*; -import com.logpm.distribution.vo.DistributionDeliveryListPrintReponseVO; -import com.logpm.distribution.vo.DistributionDeliveryListPrintRequestVO; -import com.logpm.distribution.vo.DistributionDeliveryListVO; +import com.logpm.distribution.vo.*; import com.logpm.distribution.excel.DistributionDeliveryListExcel; 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.DistributionLoadscaninvnVO; import com.logpm.distribution.vo.app.DistributionAppDeliveryListVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -175,4 +172,13 @@ public interface DistributionDeliveryListMapper extends BaseMapper<DistributionD List<DistributionLoadscaninvnEntity> selectdeliveryworkVnScanStock(@Param("barcode")String barcode,@Param("deliveryId") Long deliveryId); List<DistributionAppDeliveryListVO> selectDistributionAppDeliveryListPage(IPage page, @Param("param") DistributionAppDeliveryListDTO distributionAppDeliveryListDTO); + + + /** + * 查询配送任务订单信息 + * @param id + * @return + */ + List<DistributionStockArticleVO> getDeliveryStockArticleInfo(String id); + } 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 6f86f9379..469cd1031 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 @@ -543,5 +543,17 @@ </if> </where> </select> + <select id="getDeliveryStockArticleInfo" resultType="com.logpm.distribution.vo.DistributionStockArticleVO"> + SELECT + ldsa.* + FROM + logpm_distribution_delivery_list AS lddl + INNER JOIN logpm_distribution_signfor AS lds ON lddl.id = lds.delivery_id + INNER JOIN logpm_distribution_reservation_stockarticle AS ldrs ON lds.reservation_id = ldrs.reservation_id + INNER JOIN logpm_distribution_stock_article AS ldsa ON ldsa.id = ldrs.stock_article_id + WHERE + lddl.id = #{id} + + </select> </mapper> 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 f1bb3d974..67405b09a 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 @@ -51,4 +51,10 @@ public interface DistributionDeliverySelfMapper extends BaseMapper<DistributionD */ List<DistributionDeliverySelfExcel> exportDistributionDeliverySelf(@Param("ew") Wrapper<DistributionDeliverySelfEntity> queryWrapper); + /** + * 查询配送任务自主配送司机车辆信息 + * @param id + * @return + */ + List<DistributionDeliverySelfVO> getDeliverySelfInfo(@Param("id")String 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 79866ca55..52dc1d275 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 @@ -37,5 +37,17 @@ <select id="exportDistributionDeliverySelf" resultType="com.logpm.distribution.excel.DistributionDeliverySelfExcel"> SELECT * FROM logpm_distribution_delivery_self ${ew.customSqlSegment} </select> + <select id="getDeliverySelfInfo" resultType="com.logpm.distribution.vo.DistributionDeliverySelfVO"> + SELECT + ldds.* + FROM + logpm_distribution_delivery_list AS lddl + INNER JOIN logpm_distribution_delivery_self AS ldds ON lddl.id=ldds.delivery_id + <where> + <if test="id != null and id != ''"> + lddl.id=#{id} + </if> + </where> + </select> </mapper> 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 30cbb2713..1327af7db 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 @@ -51,4 +51,10 @@ public interface DistributionDeliveryTripartiteMapper extends BaseMapper<Distrib */ List<DistributionDeliveryTripartiteExcel> exportDistributionDeliveryTripartite(@Param("ew") Wrapper<DistributionDeliveryTripartiteEntity> queryWrapper); + /** + * 查询配送任务外协司机车辆信息 + * @param id + * @return + */ + DistributionDeliveryTripartiteVO getDeliveryTripartiteInfo(String id); } 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 b041aa11b..65a3979dd 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 @@ -35,5 +35,17 @@ <select id="exportDistributionDeliveryTripartite" resultType="com.logpm.distribution.excel.DistributionDeliveryTripartiteExcel"> SELECT * FROM logpm_distribution_delivery_tripartite ${ew.customSqlSegment} </select> + <select id="getDeliveryTripartiteInfo" resultType="com.logpm.distribution.vo.DistributionDeliveryTripartiteVO"> + SELECT + ldds.* + FROM + logpm_distribution_delivery_list AS lddl + INNER JOIN logpm_distribution_delivery_tripartite AS ldds ON lddl.id=ldds.delivery_id + <where> + <if test="id != null and id != ''"> + lddl.id=#{id} + </if> + </where> + </select> </mapper> 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 735e95bab..ac31c6947 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 @@ -70,4 +70,11 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe Integer selectOrderNumByReservationId(@Param("reservationId")Long reservationId); Integer selectPlanNum(@Param("reservationId")Long reservationId); + + /** + * 查询配送任务预约信息 + * @param id + * @return + */ + DistributionReservationVO getReservationInfo(String id); } 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 5273aecce..7839de5c0 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 @@ -224,5 +224,46 @@ where r.is_deleted = 0 and r.id = #{reservationId} </select> + <select id="getReservationInfo" resultType="com.logpm.distribution.vo.DistributionReservationVO"> + SELECT DISTINCT + ldr.tenant_id, + ldr.status, + ldr.is_deleted, + ldr.create_dept, + ldr.mall_id, + ldr.mall_name, + ldr.store_id, + ldr.store_name, + ldr.serve_type, + ldr.delivery_way, + ldr.delivery_type, + ldr.collect_fee, + ldr.other_fee, + ldr.replace_fee, + ldr.reservation_status, + ldr.order_source, + ldr.stockup_status, + ldr.goods_area_name, + ldr.goods_area_id, + ldr.remarks, + ldr.shopping_id, + ldr.period_of_time, + ldr.fee, + ldr.reservation_num, + ldr.service_number, + ldr.cancel_reason, + ldr.is_urgent, + ldr.reservation_stock_list_num + FROM + logpm_distribution_delivery_list AS lddl + INNER JOIN logpm_distribution_signfor AS lds ON lddl.id = lds.delivery_id + INNER JOIN logpm_distribution_stockup_info AS ldsi ON lds.reservation_id = ldsi.reservation_id + INNER JOIN logpm_distribution_reservation AS ldr ON ldr.id = lds.reservation_id + <where> + <if test="id!='' and id != null"> + lddl.id = #{id} + </if> + </where> + </select> </mapper> diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.java index d0ba6b30c..1dee682b3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.java @@ -53,4 +53,11 @@ public interface DistributionReservationStocklistMapper extends BaseMapper<Distr int deleteReservationStocklist(@Param("id")Long id); + + /** + * 查询预约下的库存品种类 + * @param ids + * @return + */ + Integer getStockListTotal(@Param("ids")List<Long> ids); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml index 46824e219..7e94f01a2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml @@ -36,5 +36,15 @@ <select id="exportDistributionReservationStocklist" resultType="com.logpm.distribution.excel.DistributionReservationStocklistExcel"> SELECT * FROM logpm_distribution_reservation_stocklist ${ew.customSqlSegment} </select> + <select id="getStockListTotal" resultType="java.lang.Integer"> + select count(*) from logpm_distribution_reservation_stocklist + <where> + is_deleted=0 + and reservation_id in + <foreach collection="ids" item="id" open="(" separator="," close=")"> + #{id} + </foreach> + </where> + </select> </mapper> diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupInfoMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupInfoMapper.java index 956c88d67..bfab92573 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupInfoMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupInfoMapper.java @@ -33,7 +33,8 @@ import java.util.List; */ public interface DistributionStockupInfoMapper extends BaseMapper< DistributionStockupInfoEntity> { - /** + + /** * 自定义分页 * * @param page 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 8169a2862..dc5007b5b 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 @@ -87,4 +87,24 @@ public interface DistributionStockupMapper extends BaseMapper<DistributionStocku IPage<DistributionStockupVO> getInventoryOwn(IPage<Object> page,@Param("id") Long id); List<DistributionStockupVO> getInventoryChe(@Param("id") Long id); + + /** + * 查询备货信息下存在多少客户信息 + * @param id + * @return + */ + Integer getReservationTotal(@Param("id")Long id); + + /** + * 物理删除备货任务 + * @param id + */ + void deleteStockUpById(@Param("id")Long id); + + /** + * 通过配送任务查询备货信息 + * @param id + * @return + */ + DistributionStockupVO getDeliveryStockupInfo(@Param("id")String id); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml index 763e1e383..aa2c472b3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml @@ -19,6 +19,7 @@ <result column="stockup_area" property="stockupArea"/> <result column="assign_status" property="assignStatus"/> <result column="stockip_allocation" property="stockipAllocation"/> + <result column="remarks" property="remarks"/> <result column="reserve1" property="reserve1"/> <result column="reserve2" property="reserve2"/> <result column="reserve3" property="reserve3"/> @@ -32,6 +33,9 @@ <result column="fix_time" property="fixTime"/> <result column="assign_time" property="assignTime"/> </resultMap> + <delete id="deleteStockUpById"> + DELETE FROM logpm_distribution_stockup WHERE id = #{id} + </delete> <select id="selectDistributionStockupPage" resultMap="distributionStockupResultMap"> @@ -96,6 +100,34 @@ from logpm_distribution_reservation_stocklist ldrs where ldrs.reservation_id = #{reservationId} </select> + <select id="getReservationTotal" resultType="java.lang.Integer"> + SELECT + count(*) + FROM + logpm_distribution_stockup_info + WHERE + stockup_id = ( + SELECT + stockup_id + FROM + logpm_distribution_stockup_info + WHERE + reservation_id = #{id}) + </select> + <select id="getDeliveryStockupInfo" resultType="com.logpm.distribution.vo.DistributionStockupVO"> + SELECT DISTINCT + ldsu.* + FROM + logpm_distribution_delivery_list AS lddl + INNER JOIN logpm_distribution_signfor AS lds ON lddl.id = lds.delivery_id + INNER JOIN logpm_distribution_stockup_info AS ldsi ON lds.reservation_id = ldsi.reservation_id + INNER JOIN logpm_distribution_stockup AS ldsu ON ldsu.id = ldsi.stockup_id + <where> + <if test="id !=null and id!=''"> + lddl.id = #{id} + </if> + </where> + </select> <select id="getOneOwn" resultType="com.logpm.distribution.vo.DistributionStockupVO"> select DISTINCT ds.stockup_code stockupCode,ds.stockup_user stockupUser,ds.stockup_status stockupStatus,ldr.reservation_date reservationDate,ldr.serve_type serveType,ldr.delivery_way deliveryWay, 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 2d9b05d82..fb3d306d3 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 @@ -126,4 +126,10 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi */ DistributionAppDeliveryListVO getAppDeliverydetailVO(DistributionDeliveryListEntity detail); + /** + * 查询配送任务详情 + * @param id + * @return + */ + DistributionDeliveryListVO getDeliveryList(String id); } 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 2d1f8d1b9..cb4aef145 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 @@ -31,6 +31,7 @@ import com.logpm.distribution.vo.app.DistributionAppReservationVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; +import org.springblade.common.serviceConstant.ServiceConstant; import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; @@ -72,6 +73,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib private final DistributionDeliverySelfMapper distributionDeliverySelfMapper; private final DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper; private final DistributionReservationStockarticleMapper distributionReservationStockarticleMapper; + private final DistributionStockupMapper distributionStockupMapper; private final BladeRedis bladeRedis; @Override @@ -920,4 +922,31 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib distributionAppDeliveryListVO.setReservationList(customList); return distributionAppDeliveryListVO; } + + @Override + public DistributionDeliveryListVO getDeliveryList(String id) { + DistributionDeliveryListEntity deliveryListEntity = this.getById(id); + DistributionDeliveryListVO deliveryListVO = Func.copy(deliveryListEntity, DistributionDeliveryListVO.class); + DistributionReservationVO reservationVOS = distributionReservationMapper.getReservationInfo(id); + deliveryListVO.setReservationInfo(reservationVOS); + //1、查询出订单信息 + List<DistributionStockArticleVO> stockArticleVOS = distributionDeliveryListMapper.getDeliveryStockArticleInfo(id); + deliveryListVO.setStockArticleList(stockArticleVOS); + //2、查询出备货信息 + DistributionStockupVO stockupEntity = distributionStockupMapper.getDeliveryStockupInfo(id); + deliveryListVO.setStockupInfo(stockupEntity); + //3、查询司机信息 + if (deliveryListEntity.getKind().equals(ServiceConstant.DELIVERLIST_KIND_SELF)){ + //自主配送 + List<DistributionDeliverySelfVO> deliverySelfVO = distributionDeliverySelfMapper.getDeliverySelfInfo(id); + deliveryListVO.setDeliverySelfVO(deliverySelfVO); + + }else { + //外协配送 + DistributionDeliveryTripartiteVO deliveryTripartiteVO = distributionDeliveryTripartiteMapper.getDeliveryTripartiteInfo(id); + deliveryListVO.setDeliveryTripartiteVO(deliveryTripartiteVO); + } + //4、结果封装 + return deliveryListVO; + } } 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 31dc5e7e2..84dffe17a 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 @@ -23,10 +23,7 @@ import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; import com.logpm.distribution.dto.*; import com.logpm.distribution.entity.*; import com.logpm.distribution.excel.DistributionReservationExcel; -import com.logpm.distribution.mapper.DistributionReservationMapper; -import com.logpm.distribution.mapper.DistributionReservationPackageMapper; -import com.logpm.distribution.mapper.DistributionReservationStockarticleMapper; -import com.logpm.distribution.mapper.DistributionReservationStocklistMapper; +import com.logpm.distribution.mapper.*; import com.logpm.distribution.service.*; import com.logpm.distribution.vo.*; import lombok.AllArgsConstructor; @@ -37,6 +34,7 @@ import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.RandomType; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -64,6 +62,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu private final IDistributionStockupService distributionStockupService; + private final DistributionStockupMapper distributionStockupMapper; + private final IDistributionStockupInfoService distributionStockupInfoService; private final IDistributionStockArticleService distributionStockArticleService; @@ -197,7 +197,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu AtomicInteger packageNum = new AtomicInteger(); List<DistributionParcelListEntity> packageList = s.getPackageList(); if (packageList.size() == 0) { - if (s.getIsHaveData() == 2) { Map<String, Object> map = new HashMap<>(); map.put("stockArticleId", s.getId()); QueryWrapper<DistributionParcelListEntity> qw = Condition.getQueryWrapper(map, DistributionParcelListEntity.class); @@ -214,7 +213,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu //此时订单下的所有包件都处于预约状态,可用数为0 packageNum.getAndAdd(p.getQuantity()); }); - } s.setAvailableQuantity(0); } else { //维护选中的包件信息 @@ -285,6 +283,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu set.addAll(arrayList); arrayList.addAll(set); String str = String.join(",", set); + str = str.replaceFirst(",",""); //拼接在库和库存订单编号 reservationEntity.setStockArticleId(str); //统计数量 @@ -344,7 +343,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu //修改预约备货状态 reservationEntity.setStockupStatus(ServiceConstant.STOCKUP_STATE_WAIT_EXECUTION); reservationEntity.setGoodsAreaName(stockupAreaName); - reservationEntity.setGoodsAreaId(goddsAreaId); + reservationEntity.setGoodsAreaId(Long.parseLong(goddsAreaId)); result = SqlHelper.retBool(distributionReservationMapper.updateById(reservationEntity)); //构建中间表信息 DistributionStockupInfoEntity reservationStockupEntity = new DistributionStockupInfoEntity(); @@ -397,9 +396,13 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu String reservationIds = allocationDTO.getReservationIds(); //创建备货任务 DistributionStockupDTO stockup = allocationDTO.getStockup(); - boolean flag = Func.isEmpty(stockup); + DistributionStockupEntity stockupentity = Func.copy(stockup, DistributionStockupEntity.class); + List<Long> ids = Func.toLongList(reservationIds); + boolean flag = Func.isEmpty(stockupentity); + boolean aj = Func.isNotEmpty(stockup); DistributionStockupEntity distributionStockupEntity = Func.copy(stockup, DistributionStockupEntity.class); - if (flag){ + Integer stockListTotal = distributionReservationStocklistMapper.getStockListTotal(ids); + if (!flag){ distributionStockupEntity.setAssignStatus(ServiceConstant.STOCkUP_ASSIGNSTATUS_ALREADY); distributionStockupEntity.setAssignTime(new Date()); distributionStockupEntity.setForkliftId(stockup.getForkliftId()); @@ -407,6 +410,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu distributionStockupEntity.setStockupStatus(ServiceConstant.STOCkUP_STATE_NOT_EXECUTION); distributionStockupEntity.setTypeService(ServiceConstant.DELIVERY_TYPE_CUSTOMER); distributionStockupService.save(distributionStockupEntity); + }else { + if (stockListTotal > 0 ){ + return R.fail("配送库存品请填写备货信息!!!"); + } } DistributionDeliveryListEntity distributionDeliveryListEntity = new DistributionDeliveryListEntity(); //设置车次号 @@ -414,10 +421,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu String random = Func.random(7, RandomType.ALL); distributionDeliveryListEntity.setTrainNumber(random + today); distributionDeliveryListService.save(distributionDeliveryListEntity); - List<Long> ids = Func.toLongList(reservationIds); Map<String, Object> map = new HashMap<>(); - //获取备货任务的编号 - Long stockupEntityId = distributionStockupEntity.getId(); +// //获取备货任务的编号 +// Long stockupEntityId = distributionStockupEntity.getId(); //统计包件数量 AtomicInteger packageNum = new AtomicInteger(); //预约订单数量 @@ -439,31 +445,37 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu map.put("reservationId", i); QueryWrapper<DistributionStockupInfoEntity> qw = Condition.getQueryWrapper(map, DistributionStockupInfoEntity.class); DistributionStockupInfoEntity distributionStockupInfoEntity = distributionStockupInfoService.getOne(qw); - if (flag){ if (Func.isEmpty(distributionStockupInfoEntity)) { //1、预约单不存在备货任务 //利用中间表建立起预约和备货表之间的关系 DistributionStockupInfoEntity stockupInfoEntity = new DistributionStockupInfoEntity(); stockupInfoEntity.setReservationId(i); - stockupInfoEntity.setStockupId(stockupEntityId); + stockupInfoEntity.setStockupId(distributionStockupEntity.getId()); distributionStockupInfoService.save(stockupInfoEntity); } else { - //TODO 这里还需要考虑一个备货任务下只有一条记录 //获取备货任务编号 Long stockupId = distributionStockupInfoEntity.getStockupId(); DistributionStockupEntity stockupEntity = distributionStockupService.getById(stockupId); //2、预约单存在备货任务还未指派 if (Func.equals(stockupEntity.getAssignStatus(), ServiceConstant.STOCkUP_ASSIGNSTATUS_ABSENCE)) { + //备货任务只存在一个,对该备货任务进行删除 + //查询备货任务下是否具有 + Long id = distributionStockupInfoEntity.getStockupId(); + Integer reservationNum = distributionStockupMapper.getReservationTotal(id); + if (reservationNum==1){ + //只有一条,对该备货记录进行删除 + distributionStockupMapper.deleteStockUpById(id); + } //对原有的备货关系进行修改 - distributionStockupInfoEntity.setStockupId(stockupEntityId); + distributionStockupInfoEntity.setStockupId(distributionStockupEntity.getId()); distributionStockupInfoService.updateById(distributionStockupInfoEntity); } //3、预约单存在备货任务且已指派备货 //不执行操作 } - } DistributionReservationEntity reservationEntity = this.getById(i); DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity(); + distributionSignforEntity.setTrainNumber(random); distributionSignforEntity.setReservationId(reservationEntity.getId()); distributionSignforEntity.setDeliveryId(distributionDeliveryListEntity.getId()); distributionSignforEntity.setSigningStatus(ServiceConstant.CLERK_SIGNING_STATUS_NOT); @@ -577,14 +589,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu } //对配送信息进行修改 distributionDeliveryListEntity.setState(ServiceConstant.DELIVERY_TYPE_CUSTOMER); - if (flag){ distributionDeliveryListEntity.setLoadingTeamName(stockup.getLoaderName()); distributionDeliveryListEntity.setForkliftName(stockup.getForkliftName()); distributionDeliveryListEntity.setForkliftId(stockup.getForkliftId().toString()); distributionDeliveryListEntity.setLoadingTeamId(stockup.getLoaderId()); distributionDeliveryListEntity.setLeadTime(allocationDTO.getStockup().getStockupDate()); distributionDeliveryListEntity.setLoadingTeamType(stockup.getLoadAndUnload()); - } distributionDeliveryListEntity.setCustomersNumber(reservationIds.split(",").length); distributionDeliveryListEntity.setOrderNumber(orderNum.get()); distributionDeliveryListEntity.setType(ServiceConstant.DELIVERY_TYPE_CUSTOMER); @@ -802,7 +812,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu distributionStockupService.save(stockupEntity); //4、维护配送表数据 DistributionDeliveryListEntity distributionDeliveryListEntity = new DistributionDeliveryListEntity(); - distributionDeliveryListEntity.setTrainNumber(Func.random(7, RandomType.ALL) + DateUtil.today()); + String str = Func.random(7, RandomType.ALL) + DateUtil.today(); + + distributionDeliveryListEntity.setTrainNumber(str); distributionDeliveryListEntity.setType(ServiceConstant.DELIVERY_TYPE_BUSINESS); distributionDeliveryListEntity.setState(ServiceConstant.DELIVERLIST_STATE_WAIT); distributionDeliveryListService.save(distributionDeliveryListEntity); @@ -816,7 +828,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu storeClient.forEach((k,v)->mallClient.merge(k,v,(v1,v2)->v2)); //统计客户数 AtomicInteger clientNum = new AtomicInteger(); - ////统计包件总数 AtomicInteger packageTotal = new AtomicInteger(); ////统计包件总数 @@ -829,14 +840,15 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu //预约任务是在客户的维度上进行数据维护 DistributionReservationDTO reservation = allocationDTO.getReservation(); DistributionReservationEntity reservationEntity = Func.copy(reservation, DistributionReservationEntity.class); - reservationEntity.setReservationDate(new Date()); + Date date = new Date(); + reservationEntity.setReservationDate(date); reservationEntity.setConsignee(k); reservationEntity.setDeliveryAddress(v.get(0).getCustomerAddress()); reservationEntity.setDeliveryPhone(v.get(0).getCustomerTelephone()); reservationEntity.setDeliveryType(ServiceConstant.DELIVERY_TYPE_BUSINESS); reservationEntity.setReservationStatus(ServiceConstant.RESERVATION_STATE_WAIT_DELIVERY); reservationEntity.setStockupStatus(ServiceConstant.STOCKUP_STATE_WAIT_EXECUTION); - reservationEntity.setGoodsAreaId(stockupEntity.getGoodsAreaId().toString()); + reservationEntity.setGoodsAreaId(stockupEntity.getGoodsAreaId()); //默认配送时间为全天 reservationEntity.setPeriodOfTime(ServiceConstant.RESERVATION_PERIOED_TIME_DAY); this.save(reservationEntity); @@ -863,7 +875,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu //订单存在数据源,维护订单包件信息 //维护预约和订单关系 DistributionReservationStockarticleEntity reservationStockarticleEntity = new DistributionReservationStockarticleEntity(); - if (stockArticleEntity.getIsHaveData().equals(ServiceConstant.ORDER_HAVE_DATA)) { List<DistributionParcelListEntity> packageList = a.getPackageList(); if (a.getPackageList().size() == 0) { Map<String, Object> map = new HashMap<String, Object>(); @@ -896,10 +907,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu reservationStockarticleEntity.setReservationNum(packageCount.get()); reservationStockarticleEntity.setIsHaveData(ServiceConstant.ORDER_HAVE_DATA); //对订单下的包件进行累加 - } else { reservationStockarticleEntity.setIsHaveData(ServiceConstant.ORDER_NOT_HAVE_DATA); reservationStockarticleEntity.setReservationNum(stockArticleEntity.getTotalNumber()); - } reservationStockarticleEntity.setStockArticleId(stockArticleEntity.getId()); reservationStockarticleEntity.setStockArticleCode(stockArticleEntity.getStockArticleCode()); reservationStockarticleEntity.setReservationId(reservationEntity.getId()); @@ -910,10 +919,11 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu reservationEntity.setStockArticleId(orderSelfNumbering.deleteCharAt(orderSelfNumbering.length() - 1).toString()); //预约添加订单数量 reservationEntity.setReservationNum(packageNum.get()); - reservationEntity.setReservationCode(Func.random(7, RandomType.ALL) + DateUtil.today()); + reservationEntity.setReservationCode(ServiceConstant.RESERVATION_STATE_WAIT_DELIVERY); this.updateById(reservationEntity); DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity(); distributionSignforEntity.setReservationId(reservationEntity.getId()); + distributionSignforEntity.setTrainNumber(str); distributionSignforEntity.setDeliveryId(distributionDeliveryListEntity.getId()); distributionSignforEntity.setSigningStatus(ServiceConstant.CLERK_SIGNING_STATUS_NOT); distributionSignforEntity.setDriverSigning(ServiceConstant.DRIVER_SIGNING_STATUS_NOT); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index e4b35f7ac..60b5d35b0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -130,6 +130,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib @Override public R<?> addIncrement(Map<String, Object> addvalueInfo) { + //这里需要先查看原来订单是否具有增值服务项,如果有需要删除重新添加 boolean result = false; if (Func.isNotEmpty(addvalueInfo)) { String id = (String) addvalueInfo.get("id");