Browse Source

仓库调整、配送任务订单详情调整

dev-warehouse
kilo 2 years ago
parent
commit
6c6e7782cc
  1. 6
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java
  2. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java
  3. 11
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java
  4. 12
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java
  5. 11
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataTeamGroupController.java
  6. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java
  7. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java
  8. 15
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml
  9. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.java
  10. 13
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.xml
  11. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml
  12. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java
  13. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java
  14. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java
  15. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamGroupServiceImpl.java
  16. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java
  17. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  18. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java
  19. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryAllocationDTO.java
  20. 44
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryListDTO.java
  21. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.java
  22. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml
  23. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.java
  24. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.xml
  25. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  26. 73
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  27. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  28. 85
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  29. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java
  30. 37
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml
  31. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  32. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  33. 197
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  34. 37
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  35. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  36. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

6
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;
/**
* 所属部门

4
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;
/**
* 到付运费
*/

11
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<DistributionParcelListEntity> parcelListVOS;
}

12
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<BasicdataGoodsAreaVO> result = basicdataGoodsAreaService.getStockUpInfo(params);
return R.data(result);
// return R.status(distributionStockupService.deleteLogic(Func.toLongList(ids)));
}

11
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<BasicdataTeamGroupEntity> result = basicdataTeamGroupService.getListTeamInfo(params);
return R.data(result);
}
}

2
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<BasicdataWarehouseEntity> 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<BasicdataWarehouseEntity> page = warehouseService.page(Condition.getPage(query), qw);
// IPage<BasicdataWarehouseEntity> pages = warehouseService.page(Condition.getPage(query), Condition.getQueryWrapper(warehouseWarehouse, BasicdataWarehouseEntity.class));
return R.data(page);

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java

@ -65,4 +65,7 @@ public interface BasicdataGoodsAreaMapper extends BaseMapper<BasicdataGoodsAreaE
Integer removeGoodsArea(String id);
List<BasicdataGoodsAreaVO> stockUp(@Param("par") BasicdataGoodsAreaEntity warehouseWarehouse);
List<BasicdataGoodsAreaVO> getStockUpInfo(@Param("deptId")String params);
}

15
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
</select>
<select id="getStockUpInfo" resultType="com.logpm.basicdata.vo.BasicdataGoodsAreaVO">
SELECT
lwga.id,
lwga.headline
FROM
logpm_warehouse_warehouse AS lww
INNER JOIN logpm_warehouse_goods_area AS lwga ON lww.id = lwga.warehouse_id
<where>
lwga.area_type = 1
<if test="deptId != '' and deptId!=null">
AND lww.department = #{deptId}
</if>
</where>
</select>
</mapper>

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.java

@ -52,4 +52,6 @@ public interface BasicdataTeamGroupMapper extends BaseMapper<BasicdataTeamGroupE
List<BasicdataTeamGroupExcel> exportBasicdataTeamGroup(@Param("ew") Wrapper<BasicdataTeamGroupEntity> queryWrapper);
IPage<BasicdataTeamGroupEntity> listTeam(IPage page, @Param("param") BasicdataTeamGroupEntity basicdataTeamGroupEntity);
List<BasicdataTeamGroupEntity> getListTeamInfo(@Param("deptId")String params);
}

13
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataTeamGroupMapper.xml

@ -41,5 +41,18 @@
<select id="exportBasicdataTeamGroup" resultType="com.logpm.basicdata.excel.BasicdataTeamGroupExcel">
SELECT * FROM logpm_basicdata_team_group ${ew.customSqlSegment}
</select>
<select id="getListTeamInfo" resultType="com.logpm.basicdata.entity.BasicdataTeamGroupEntity">
SELECT
lbtg.id,
lbtg.group_name
FROM
logpm_warehouse_warehouse AS lww
INNER JOIN logpm_basicdata_team_group AS lbtg ON lww.id = lbtg.belong_to
<where>
<if test="deptId != null and deptId != '' ">
lww.department = #{deptId}
</if>
</where>
</select>
</mapper>

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataWarehouseMapper.xml

@ -31,6 +31,7 @@
<result column="longitude" property="longitude"/>
<result column="latitude" property="latitude"/>
<result column="department" property="department"/>
<result column="department_name" property="departmentName"/>
<result column="warehouse_type" property="warehouseType"/>
<result column="fire_grade" property="fireGrade"/>
<result column="fire_rating_not" property="fireRatingNot"/>

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java

@ -84,4 +84,6 @@ public interface IBasicdataGoodsAreaService extends BaseService<BasicdataGoodsAr
boolean removeGoodsArea(List<String> ids);
List<BasicdataGoodsAreaVO> stockUp(BasicdataGoodsAreaEntity warehouseWarehouse);
List<BasicdataGoodsAreaVO> getStockUpInfo(String params);
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataTeamGroupService.java

@ -52,4 +52,11 @@ public interface IBasicdataTeamGroupService extends BaseService<BasicdataTeamGro
List<BasicdataTeamGroupExcel> exportBasicdataTeamGroup(Wrapper<BasicdataTeamGroupEntity> queryWrapper);
IPage<BasicdataTeamGroupEntity> listTeam(IPage<Object> page, Map<String, Object> basicdataTeamGroup );
/**
* 查询当前登录人能够操作的班组信息
* @param params
* @return
*/
List<BasicdataTeamGroupEntity> getListTeamInfo(String params);
}

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java

@ -121,4 +121,9 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl<BasicdataGood
return baseMapper.stockUp(warehouseWarehouse);
}
@Override
public List<BasicdataGoodsAreaVO> getStockUpInfo(String params) {
return basicdataGoodsAreaMapper.getStockUpInfo(params);
}
}

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTeamGroupServiceImpl.java

@ -61,4 +61,9 @@ public class BasicdataTeamGroupServiceImpl extends BaseServiceImpl<BasicdataTeam
return baseMapper.listTeam(page,basicdataTeamGroupEntity);
}
@Override
public List<BasicdataTeamGroupEntity> getListTeamInfo(String params) {
return baseMapper.getListTeamInfo(params);
}
}

14
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;
}
}

20
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<String, Object> query = new HashMap<>();
query.put("typeService",typeService);
query.put("genre",genre);
R<List<DistributionStockArticleVO>> result = distributionStockArticleService.selectStockArticleAndParcel(query);
return result;
}

1
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);
}
}

8
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<DistributionStockArticleDTO> stockArticle;
/**
* 任务时间
*/
@ApiModelProperty(value = "任务时间")
private String taskTime;
}

44
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<DistributionDeliverySelfDTO> allocationInfo;
/**
* 外协配送司机车辆信息
*/
@ApiModelProperty(value = "外协配送司机、车辆信息")
private DistributionDeliveryTripartiteDTO tripartite;
/**
* 订单数据
*/
@ApiModelProperty(value = "订单数据")
private List<DistributionStockArticleDTO> stockArticle;
/**
* 主司机信息
*/
@ApiModelProperty(value = "主司机信息")
private String masterDriverName;
/**
* 主车辆信息
*/
@ApiModelProperty(value = "主车辆信息")
private String masterVehicleNub;
}

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.java

@ -64,4 +64,10 @@ public interface DistributionDeliverySelfMapper extends BaseMapper<DistributionD
*/
List<DistributionDeliverySelfVO> getDeliverySelfInfo(@Param("id")String id);
/**
* 删除司机信息
* @param id
*/
void deleteDeliverySelf(@Param("id")Long id);
}

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml

@ -27,6 +27,9 @@
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
</resultMap>
<delete id="deleteDeliverySelf">
DELETE FROM logpn_distribution_delivery_self WHERE delivery_id = #{id}
</delete>
<select id="selectDistributionDeliverySelfPage" resultMap="distributionDeliverySelfResultMap">

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.java

@ -57,6 +57,13 @@ public interface DistributionDeliveryTripartiteMapper extends BaseMapper<Distrib
* @param id
* @return
*/
DistributionDeliveryTripartiteVO getDeliveryTripartiteInfo(String id);
DistributionDeliveryTripartiteVO getDeliveryTripartiteInfo(@Param("id")String id);
List<DistributionAppDeliverySelfVO> selectListcustom(Long deliveryId);
/**
* 删除自主配送司机信息
* @param id
*/
void deleteDeliveryTripartite(@Param("id")Long id);
}

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.xml

@ -25,6 +25,9 @@
<result column="reserve5" property="reserve5"/>
<result column="delivery_id" property="deliveryId"/>
</resultMap>
<delete id="deleteDeliveryTripartite">
DELETE FROM logpm_distribution_delivery_tripartite WHERE delivery_id = #{id}
</delete>
<select id="selectDistributionDeliveryTripartitePage" resultMap="distributionDeliveryTripartiteResultMap">

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java

@ -76,7 +76,9 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
* @param id
* @return
*/
DistributionReservationVO getReservationInfo(String id);
DistributionReservationVO getReservationInfo(@Param("id")String id);
List<DistributionReservationEntity> getDeliveryReservation(@Param("id")Long id);
Integer getReservationNumByReservationIdAndStockListId(@Param("reservationId") Long reservationId, @Param("stockListId")Long stockListId);

73
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -234,9 +234,7 @@
<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,
@ -244,23 +242,10 @@
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
ldr.period_of_time
FROM
logpm_distribution_delivery_list AS lddl
INNER JOIN logpm_distribution_signfor AS lds ON lddl.id = lds.delivery_id
@ -272,6 +257,62 @@
</if>
</where>
</select>
<select id="getDeliveryReservation" resultType="com.logpm.distribution.entity.DistributionReservationEntity">
SELECT
ldr.id,
ldr.tenant_id,
ldr.create_user,
ldr.create_time,
ldr.update_user,
ldr.update_time,
ldr.status,
ldr.is_deleted,
ldr.create_dept,
ldr.stock_article_id,
ldr.mall_id,
ldr.mall_name,
ldr.store_id,
ldr.store_name,
ldr.consignee,
ldr.delivery_address,
ldr.reservation_date,
ldr.serve_type,
ldr.delivery_way,
ldr.delivery_type,
ldr.collect_fee,
ldr.other_fee,
ldr.replace_fee,
ldr.delivery_phone,
ldr.reservation_status,
ldr.order_source,
ldr.stockup_status,
ldr.goods_area_name,
ldr.goods_area_id,
ldr.reserve1,
ldr.reserve2,
ldr.reserve3,
ldr.reserve4,
ldr.reserve5,
ldr.remarks,
ldr.shopping_id,
ldr.period_of_time,
ldr.fee,
ldr.reservation_num,
ldr.reservation_code,
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_reservation AS ldr ON ldr.id = lds.reservation_id
<where>
<if test="id!='' and id != null">
lddl.id = #{id}
</if>
</where>
</select>
<select id="getReservationNumByReservationIdAndStockListId" resultType="Integer" >
select ldrs.reservation_num

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java

@ -23,7 +23,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.mp.support.Query;
import java.util.List;
import java.util.Map;
/**
* 配送在库订单 Mapper 接口
@ -66,8 +69,5 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
*/
List<DistributionStockArticleEntity> selectClientListPage(IPage page, DistributionStockArticleVO distributionStockArticleVO,@Param("loginUserId") Long loginUserId);
List<DistributionStockArticleVO> getAllReservationStockArticleInfo(@Param("ew") Map<String,Object> query);
}

85
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -82,4 +82,89 @@
</if>
<!-- 条件没有写完 -->
</select>
<select id="getAllReservationStockArticleInfo" resultType="com.logpm.distribution.vo.DistributionStockArticleVO">
SELECT
ldsa.tenant_id,
ldsa.id,
ldsa.create_user,
ldsa.create_time,
ldsa.update_user,
ldsa.update_time,
ldsa.STATUS,
ldsa.is_deleted,
ldsa.create_dept,
ldsa.reserve1,
ldsa.reserve2,
ldsa.reserve3,
ldsa.reserve4,
ldsa.reserve5,
ldsa.service_number,
ldsa.order_self_numbering,
ldsa.mall_id,
ldsa.mall_code,
ldsa.mall_name,
ldsa.store_name,
ldsa.store_code,
ldsa.store_id,
ldsa.description_goods,
ldsa.warehouse_id,
ldsa.warehouse,
ldsa.warehouse_entry_time,
ldsa.store_time,
ldsa.total_number,
ldsa.hand_quantity,
ldsa.complete_set,
ldsa.brand,
ldsa.type_service,
ldsa.customer_name,
ldsa.customer_telephone,
ldsa.customer_address,
ldsa.genre,
ldsa.state,
ldsa.notification,
ldsa.fee,
ldsa.rate,
ldsa.advance_id,
ldsa.waybill_number,
ldsa.consignee_unit,
ldsa.collect_fee,
ldsa.storage_fee,
ldsa.consignee_person,
ldsa.consignee_address,
ldsa.consignee_mobile,
ldsa.warehouse_entry_time_end,
ldsa.sorting_quantity,
ldsa.delivery_quantity,
ldsa.transfer_quantity,
ldsa.signin_quantity,
ldsa.grounding_status,
ldsa.allocation,
ldsa.order_status,
ldsa.resource,
ldsa.trays,
ldsa.is_opai,
ldsa.inventory_date,
ldsa.inventory_person,
ldsa.inventory_person_id,
ldsa.freeze_status,
ldsa.available_quantity,
ldsa.is_have_data,
ldsa.stock_article_code,
ldsa.dealer_name,
ldsa.dealer_code,
ldsa.train_number,
ldsa.factory_train
FROM
logpm_distribution_stock_article AS ldsa
<where>
<if test="ew.genre !='' and ew.genre!=null">
AND ldsa.genre = #{ew.genre}
</if>
<if test="ew.typeService !='' and ew.typeService!=null">
AND ldsa.type_service= #{ew.typeService}
</if>
</where>
</select>
</mapper>

2
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<DistributionStocku
* @return
*/
DistributionStockupVO getDeliveryStockupInfo(@Param("id")String id);
}

37
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml

@ -111,7 +111,39 @@
</select>
<select id="getDeliveryStockupInfo" resultType="com.logpm.distribution.vo.DistributionStockupVO">
SELECT DISTINCT
ldsu.*
ldsu.id,
ldsu.tenant_id,
ldsu.create_user,
ldsu.create_time,
ldsu.update_user,
ldsu.update_time,
ldsu.status,
ldsu.is_deleted,
ldsu.create_dept,
ldsu.reserve1,
ldsu.reserve2,
ldsu.reserve3,
ldsu.reserve4,
ldsu.reserve5,
ldsu.stockup_date,
ldsu.stockup_user,
ldsu.stockup_status,
ldsu.stockup_area,
ldsu.assign_status,
ldsu.stockip_allocation,
ldsu.goods_area_id,
ldsu.forklift_id,
ldsu.loader_id,
ldsu.team_responsibility,
ldsu.fix_time,
ldsu.assign_time,
ldsu.type_service,
ldsu.stockup_user_id,
ldsu.forklift_name,
ldsu.loader_name,
ldsu.stockup_code,
ldsu.remarks,
ldsu.annulment
FROM
logpm_distribution_delivery_list AS lddl
INNER JOIN logpm_distribution_signfor AS lds ON lddl.id = lds.delivery_id
@ -212,7 +244,4 @@
ldsi.stockup_id =#{id}
</where>
</select>
</mapper>

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -150,4 +150,12 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
IPage<DistributionAppReservationVO> getAppDeliveryreservationListPage(IPage<DistributionAppReservationVO> page,DistributionAppDeliveryListDTO distributionDeliveryList);
IPage<DistributionAppStockListVO> selectDistributionAppDeliverywrapIn(IPage<DistributionAppStockListVO> page, DistributionAppDeliveryListDTO distributionAppDeliveryListDTO);
/**
* 修改配送任务
* @param deliveryListDTO
* @return
*/
R<?> UpdateDeliveryListInfo(DistributionDeliveryListDTO deliveryListDTO);
}

8
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<Distributi
* @return
*/
IPage<DistributionStockArticleEntity> selectClientListPage(IPage<DistributionStockArticleEntity> page, DistributionStockArticleVO distributionStockArticle);
/**
* 查询订单和包件信息
* @param query
* @return
*/
R<List<DistributionStockArticleVO>> selectStockArticleAndParcel(Map<String,Object> query);
}

197
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<DistributionDeliveryListMapper, DistributionDeliveryListEntity> 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<Distrib
deliveryListVO.setReservationInfo(reservationVOS);
//1、查询出订单信息
List<DistributionStockArticleVO> 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<Distrib
return page.setRecords(distributionAppStockListVOS);
}
@Override
@Transactional
public R<?> 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<DistributionDeliverySelfDTO> 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<DistributionStockArticleDTO> stockArticle = deliveryListDTO.getStockArticle();
//根据门店进行分组
Map<String, List<DistributionStockArticleDTO>> storeClient = stockArticle.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getStoreName));
List<DistributionStockArticleDTO> distributionStockArticleDTOS = storeClient.get("");
Map<String, List<DistributionStockArticleDTO>> mallClient = distributionStockArticleDTOS.stream().collect(Collectors.groupingBy(DistributionStockArticleDTO::getMallName));
//3、维护订单和客户
storeClient.forEach((k,v)->mallClient.merge(k,v,(v1,v2)->v2));
//查询该配送任务下原有的客户
List<DistributionReservationEntity> reservationEntityList = distributionReservationMapper.getDeliveryReservation(deliveryListEntity.getId());
//将原客户和新的进行比对,如果有那么则进行客户修改,最后剩下的订单信息都属于是新客户
Map<String, List<DistributionReservationEntity>> 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<DistributionParcelListEntity> 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<String> str = new HashSet<>();
v.forEach(s->{
//新增
//构建预约和订单之间的关系
List<DistributionParcelListEntity> 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<DistributionParcelListEntity> parcelListEntityQueryWrapper = new QueryWrapper<>();
parcelListEntityQueryWrapper.lambda().eq(DistributionParcelListEntity::getStockArticleId,s.getId());
List<DistributionParcelListEntity> 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<DistributionAppDeliverySelfVO> selectDistributionAppDeliverySelfVOList(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//查询该配送类型

37
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<Distribu
DistributionStockupEntity distributionStockupEntity = Func.copy(stockup, DistributionStockupEntity.class);
Integer stockListTotal = distributionReservationStocklistMapper.getStockListTotal(ids);
if (!flag){
BladeUser user = AuthUtil.getUser();
distributionStockupEntity.setAssignStatus(ServiceConstant.STOCkUP_ASSIGNSTATUS_ALREADY);
distributionStockupEntity.setAssignTime(new Date());
distributionStockupEntity.setStockupUser(user.getUserName());
distributionStockupEntity.setStockupUserId(user.getUserId());
distributionStockupEntity.setForkliftId(stockup.getForkliftId());
distributionStockupEntity.setForkliftName(stockup.getForkliftName());
distributionStockupEntity.setStockupUser(AuthUtil.getUserId().toString());
distributionStockupEntity.setStockupStatus(ServiceConstant.STOCkUP_STATE_NOT_EXECUTION);
distributionStockupEntity.setTypeService(ServiceConstant.DELIVERY_TYPE_CUSTOMER);
@ -562,7 +567,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
Long deliveryListId = distributionDeliveryListEntity.getId();
//操作司机信息
DistributionDeliveryTripartiteDTO tripartite = allocationDTO.getTripartite();
if (Func.isEmpty(tripartite)) {
if (!Func.isEmpty(tripartite)) {
//这里就是三方配送
DistributionDeliveryTripartiteEntity tripartiteEntity = Func.copy(tripartite, DistributionDeliveryTripartiteEntity.class);
// tripartiteEntity.setReservationIds(reservationIds);
@ -818,15 +823,26 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//1、添加配送任务
DistributionStockupDTO stockup = allocationDTO.getStockup();
DistributionStockupEntity stockupEntity = Func.copy(stockup, DistributionStockupEntity.class);
stockupEntity.setForkliftId(stockup.getForkliftId());
if (!Func.isBlank(stockup.getForkliftName())){
stockupEntity.setForkliftId(stockupEntity.getForkliftId());
stockupEntity.setForkliftName(stockupEntity.getForkliftName());
stockupEntity.setAssignStatus(ServiceConstant.STOCkUP_ASSIGNSTATUS_ALREADY);
stockupEntity.setStockupStatus(ServiceConstant.STOCKUP_STATE_WAIT_EXECUTION);
}else {
stockupEntity.setAssignStatus(ServiceConstant.STOCkUP_ASSIGNSTATUS_ABSENCE);
stockupEntity.setStockupStatus(ServiceConstant.STOCkUP_STATE_NOT_EXECUTION);
}
BladeUser user = AuthUtil.getUser();
stockupEntity.setStockupUser(user.getUserName());
stockupEntity.setStockupUserId(user.getUserId());
//TODO 这里需要获取具体的哪一个人进行备货操作
stockupEntity.setStockupUser(user.getUserName());
stockupEntity.setLoaderId(stockup.getLoaderId());
stockupEntity.setTeamResponsibility(stockup.getLoadAndUnload());
stockupEntity.setStockupDate(stockup.getStockupDate());
//设置类型为商配
stockupEntity.setTypeService(ServiceConstant.DELIVERY_TYPE_BUSINESS);
stockupEntity.setAssignTime(new Date());
stockupEntity.setAssignStatus(ServiceConstant.STOCkUP_ASSIGNSTATUS_ALREADY);
stockupEntity.setStockupStatus(ServiceConstant.STOCkUP_STATE_NOT_EXECUTION);
//2、添加备货任务
distributionStockupService.save(stockupEntity);
//4、维护配送表数据
@ -955,7 +971,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
//司机名称拼接
StringBuilder driverNames = new StringBuilder();
DistributionDeliveryTripartiteDTO tripartite = allocationDTO.getTripartite();
if (Func.isEmpty(tripartite)) {
if (!Func.isEmpty(tripartite)) {
//三方配送
//这里就是三方配送
DistributionDeliveryTripartiteEntity tripartiteEntity = Func.copy(tripartite, DistributionDeliveryTripartiteEntity.class);
@ -998,15 +1014,16 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setVehicleName(vehicleNubs.deleteCharAt(vehicleNubs.length() - 1).toString());
}
//完善配送信息
distributionDeliveryListEntity.setLoadingTeamName(stockup.getLoaderName());
distributionDeliveryListEntity.setLoadingTeamId(stockup.getLoaderId());
distributionDeliveryListEntity.setLeadTime(stockup.getStockupDate());
// distributionDeliveryListEntity.setLoadingTeamName(stockup.getLoaderName());
// distributionDeliveryListEntity.setLoadingTeamId(stockup.getLoaderId());
// distributionDeliveryListEntity.setLeadTime(stockup.getStockupDate());
distributionDeliveryListEntity.setOrderSelfNumbering(orderSelfNumbering.deleteCharAt(orderSelfNumbering.length() - 1).toString());
distributionDeliveryListEntity.setOrderNumber(orderTotal.get());
distributionDeliveryListEntity.setDeliveryNumber(packageTotal.get());
distributionDeliveryListEntity.setCustomersNumber(clientNum.get());
distributionDeliveryListEntity.setForkliftId(stockupEntity.getForkliftId().toString());
distributionDeliveryListEntity.setForkliftName(stockup.getForkliftName());
distributionDeliveryListEntity.setTaskTime(allocationDTO.getTaskTime().toString());
// distributionDeliveryListEntity.setForkliftId(stockupEntity.getForkliftId().toString());
// distributionDeliveryListEntity.setForkliftName(stockup.getForkliftName());
distributionDeliveryListService.updateById(distributionDeliveryListEntity);
return R.status(true);
}

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -17,6 +17,7 @@
package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -28,11 +29,13 @@ import com.logpm.distribution.mapper.DistributionAddvalueMapper;
import com.logpm.distribution.mapper.DistributionDeliveryListMapper;
import com.logpm.distribution.mapper.DistributionStockArticleMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
@ -60,6 +63,8 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
private final IDistributionStockListService distributionStockListService;
private final DistributionStockArticleMapper distributionStockArticleMapper;
private final DistributionDeliveryListMapper distributionDeliveryListMapper;
// private final IDistributionStockService distributionStockService;
@ -323,4 +328,16 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return page.setRecords(result);
}
@Override
public R<List<DistributionStockArticleVO>> selectStockArticleAndParcel(Map<String,Object> query) {
List<DistributionStockArticleVO> distributionStockArticleVOList = distributionStockArticleMapper.getAllReservationStockArticleInfo(query);
distributionStockArticleVOList.forEach(s->{
QueryWrapper<DistributionParcelListEntity> parcelListVOQueryWrapper = new QueryWrapper<>();
parcelListVOQueryWrapper.lambda().eq(DistributionParcelListEntity::getStockArticleId,s.getId());
List<DistributionParcelListEntity> distributionParcelListEntityList = distributionParcelListService.getBaseMapper().selectList(parcelListVOQueryWrapper);
s.setParcelListVOS(distributionParcelListEntityList);
});
return R.data(distributionStockArticleVOList);
}
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -382,6 +382,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
}
/**
* 查询预约信息
*

Loading…
Cancel
Save