Browse Source

Merge branch 'dev' into test

test
zhenghaoyu 2 years ago
parent
commit
67fd02676f
  1. 29
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliverySelfEntity.java
  2. 25
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryTripartiteEntity.java
  3. 19
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java
  4. 10
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java
  5. 14
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliverySelfClient.java
  6. 14
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryTripartiteClient.java
  7. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockupInfoClient.java
  8. 8
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliverySelfVO.java
  9. 8
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryTripartiteVO.java
  10. 72
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliverySelfController.java
  11. 72
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryTripartiteController.java
  12. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java
  13. 55
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryAllocationDTO.java
  14. 38
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliverySelfDTO.java
  15. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryTripartiteDTO.java
  16. 65
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockupDTO.java
  17. 26
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliverySelfExcel.java
  18. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryTripartiteExcel.java
  19. 53
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliverySelfClient.java
  20. 53
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryTripartiteClient.java
  21. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockupInfoClient.java
  22. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.java
  23. 21
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml
  24. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.java
  25. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.xml
  26. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliverySelfService.java
  27. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryTripartiteService.java
  28. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  29. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliverySelfServiceImpl.java
  30. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryTripartiteServiceImpl.java
  31. 239
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  32. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSelfDeliveryServiceImpl.java
  33. 54
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionTripartiteDeliveryServiceImpl.java

29
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSelfDeliveryEntity.java → blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliverySelfEntity.java

@ -27,35 +27,40 @@ import org.springblade.core.tenant.mp.TenantEntity;
/**
* 自主配送信息列表 实体类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@Data
@TableName("logpm_distribution_self_delivery")
@ApiModel(value = "DistributionSelfDelivery对象", description = "自主配送信息列表")
@TableName("logpm_distribution_delivery_self")
@ApiModel(value = "DistributionDeliverySelf对象", description = "自主配送信息列表")
@EqualsAndHashCode(callSuper = true)
public class DistributionSelfDeliveryEntity extends TenantEntity {
public class DistributionDeliverySelfEntity extends TenantEntity {
/**
* 预约信息编号
*/
@ApiModelProperty(value = "预约信息编号")
private String reservationIds;
/**
* 配送司机
*/
@ApiModelProperty(value = "配送司机")
private String slaveDriverId;
/**
* 车辆编号
*/
@ApiModelProperty(value = "车辆编号")
private String vehicleIds;
private String vehicleId;
/**
* 司机负责人
* 是否是主司机
*/
@ApiModelProperty(value = "司机负责人")
private String masterDriverId;
@ApiModelProperty(value = "是否是主司机")
private Integer isMaster;
/**
* 配送司机
* 配送ID
*/
@ApiModelProperty(value = "配送司机")
private String slaveDriverIds;
@ApiModelProperty(value = "配送ID")
private Long deliveryId;
/**
* 预留1
*/

25
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionTripartiteDeliveryEntity.java → blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryTripartiteEntity.java

@ -28,14 +28,14 @@ import org.springblade.core.tenant.mp.TenantEntity;
/**
* 外协配送信息列表 实体类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@Data
@TableName("logpm_distribution_tripartite_delivery")
@ApiModel(value = "DistributionTripartiteDelivery对象", description = "外协配送信息列表")
@TableName("logpm_distribution_delivery_tripartite")
@ApiModel(value = "DistributionDeliveryTripartite对象", description = "外协配送信息列表")
@EqualsAndHashCode(callSuper = true)
public class DistributionTripartiteDeliveryEntity extends TenantEntity {
public class DistributionDeliveryTripartiteEntity extends TenantEntity {
/**
* 司机名称
@ -52,16 +52,16 @@ public class DistributionTripartiteDeliveryEntity extends TenantEntity {
*/
@ApiModelProperty(value = "车辆车牌")
private String vehicleNum;
/**
* 预约信息编号
*/
@ApiModelProperty(value = "预约信息")
private String reservationIds;
/**
* 配送费用
*/
@ApiModelProperty(value = "配送费用")
private BigDecimal deliveryFee;
/**
* 预约信息编号
*/
@ApiModelProperty(value = "预约信息编号")
private String reservationIds;
/**
* 预留1
*/
@ -87,5 +87,10 @@ public class DistributionTripartiteDeliveryEntity extends TenantEntity {
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
/**
* 配送ID
*/
@ApiModelProperty(value = "配送ID")
private Long deliveryId;
}

19
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@ -72,7 +73,7 @@ public class DistributionReservationEntity extends TenantEntity {
/**
* 配送方式;预约添加送货方式1-送货(商配的唯一方式)2-送货上楼3-送装一体4-
*/
@ApiModelProperty(value = "配送方式;1-商配、2-市配")
@ApiModelProperty(value = "配送类型;1-商配、2-市配")
private String deliveryWay;
/**
* 到付运费
@ -119,11 +120,11 @@ public class DistributionReservationEntity extends TenantEntity {
*/
@ApiModelProperty(value = "备注")
private String remarks;
// /**
// * 预约单编号,系统构建生成
// */
// @ApiModelProperty(value = "预约单编号")
// private String reservationId;
/**
* 预约单编号系统构建生成
*/
@ApiModelProperty(value = "预约单编号")
private String reservationId;
/**
* 时段
*/
@ -141,6 +142,12 @@ public class DistributionReservationEntity extends TenantEntity {
*/
@ApiModelProperty(value = "费用汇总")
private BigDecimal fee;
/**
* 服务类型
*/
@TableField(exist = false)
@ApiModelProperty(value = "服务类型")
private Integer typeService;
/**
/**
* 预留1

10
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockupEntity.java

@ -18,6 +18,7 @@ package com.logpm.distribution.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -133,6 +134,15 @@ public class DistributionStockupEntity extends TenantEntity {
* 指派时间
*/
@ApiModelProperty(value = "指派时间")
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
private Date assignTime;
/**
* 班组职能
*/
@ApiModelProperty(value = "班组职能;1-装、2-卸")
private String teamResponsibility;
}

14
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionSelfDeliveryClient.java → blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliverySelfClient.java

@ -17,7 +17,7 @@
package com.logpm.distribution.feign;
import org.springblade.core.mp.support.BladePage;
import com.logpm.distribution.entity.DistributionSelfDeliveryEntity;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -25,15 +25,15 @@ import org.springframework.web.bind.annotation.RequestParam;
/**
* 自主配送信息列表 Feign接口类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@FeignClient(
value = "selfDelivery"
value = "deliverySelf"
)
public interface IDistributionSelfDeliveryClient {
public interface IDistributionDeliverySelfClient {
String API_PREFIX = "selfDelivery/client";
String API_PREFIX = "deliverySelf/client";
String TOP = API_PREFIX + "/top";
/**
@ -44,6 +44,6 @@ public interface IDistributionSelfDeliveryClient {
* @return BladePage
*/
@GetMapping(TOP)
BladePage<DistributionSelfDeliveryEntity> selfDeliveryTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
BladePage<DistributionDeliverySelfEntity> deliverySelfTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
}

14
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionTripartiteDeliveryClient.java → blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryTripartiteClient.java

@ -17,7 +17,7 @@
package com.logpm.distribution.feign;
import org.springblade.core.mp.support.BladePage;
import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity;
import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -25,15 +25,15 @@ import org.springframework.web.bind.annotation.RequestParam;
/**
* 外协配送信息列表 Feign接口类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@FeignClient(
value = "tripartiteDelivery"
value = "deliveryTripartite"
)
public interface IDistributionTripartiteDeliveryClient {
public interface IDistributionDeliveryTripartiteClient {
String API_PREFIX = "tripartiteDelivery/client";
String API_PREFIX = "deliveryTripartite/client";
String TOP = API_PREFIX + "/top";
/**
@ -44,6 +44,6 @@ public interface IDistributionTripartiteDeliveryClient {
* @return BladePage
*/
@GetMapping(TOP)
BladePage<DistributionTripartiteDeliveryEntity> tripartiteDeliveryTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
BladePage<DistributionDeliveryTripartiteEntity> tdeliveryTripartiteTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
}

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockupInfoClient.java

@ -44,6 +44,6 @@ public interface IDistributionStockupInfoClient {
* @return BladePage
*/
@GetMapping(TOP)
BladePage<DistributionStockupInfoEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
BladePage<DistributionStockupInfoEntity> reservationStockupTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
}

8
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionSelfDeliveryVO.java → blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliverySelfVO.java

@ -16,7 +16,7 @@
*/
package com.logpm.distribution.vo;
import com.logpm.distribution.entity.DistributionSelfDeliveryEntity;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -24,12 +24,12 @@ import lombok.EqualsAndHashCode;
/**
* 自主配送信息列表 视图实体类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class DistributionSelfDeliveryVO extends DistributionSelfDeliveryEntity {
public class DistributionDeliverySelfVO extends DistributionDeliverySelfEntity {
private static final long serialVersionUID = 1L;
}

8
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionTripartiteDeliveryVO.java → blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryTripartiteVO.java

@ -16,7 +16,7 @@
*/
package com.logpm.distribution.vo;
import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity;
import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -24,12 +24,12 @@ import lombok.EqualsAndHashCode;
/**
* 外协配送信息列表 视图实体类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class DistributionTripartiteDeliveryVO extends DistributionTripartiteDeliveryEntity {
public class DistributionDeliveryTripartiteVO extends DistributionDeliveryTripartiteEntity {
private static final long serialVersionUID = 1L;
}

72
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSelfDeliveryController.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliverySelfController.java

@ -31,10 +31,10 @@ import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionSelfDeliveryEntity;
import com.logpm.distribution.vo.DistributionSelfDeliveryVO;
import com.logpm.distribution.excel.DistributionSelfDeliveryExcel;
import com.logpm.distribution.service.IDistributionSelfDeliveryService;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import com.logpm.distribution.excel.DistributionDeliverySelfExcel;
import com.logpm.distribution.service.IDistributionDeliverySelfService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
@ -47,25 +47,25 @@ import javax.servlet.http.HttpServletResponse;
/**
* 自主配送信息列表 控制器
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@RestController
@AllArgsConstructor
@RequestMapping("selfDelivery/distributionSelfDelivery")
@RequestMapping("deliverySelf/distributionDeliverySelf")
@Api(value = "自主配送信息列表", tags = "自主配送信息列表接口")
public class DistributionSelfDeliveryController extends BladeController {
public class DistributionDeliverySelfController extends BladeController {
private final IDistributionSelfDeliveryService distributionSelfDeliveryService;
private final IDistributionDeliverySelfService distributionDeliverySelfService;
/**
* 自主配送信息列表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distributionSelfDelivery")
public R<DistributionSelfDeliveryEntity> detail(DistributionSelfDeliveryEntity distributionSelfDelivery) {
DistributionSelfDeliveryEntity detail = distributionSelfDeliveryService.getOne(Condition.getQueryWrapper(distributionSelfDelivery));
@ApiOperation(value = "详情", notes = "传入distributionDeliverySelf")
public R<DistributionDeliverySelfEntity> detail(DistributionDeliverySelfEntity distributionDeliverySelf) {
DistributionDeliverySelfEntity detail = distributionDeliverySelfService.getOne(Condition.getQueryWrapper(distributionDeliverySelf));
return R.data(detail);
}
/**
@ -73,9 +73,9 @@ public class DistributionSelfDeliveryController extends BladeController {
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionSelfDelivery")
public R<IPage<DistributionSelfDeliveryEntity>> list(@ApiIgnore @RequestParam Map<String, Object> distributionSelfDelivery, Query query) {
IPage<DistributionSelfDeliveryEntity> pages = distributionSelfDeliveryService.page(Condition.getPage(query), Condition.getQueryWrapper(distributionSelfDelivery, DistributionSelfDeliveryEntity.class));
@ApiOperation(value = "分页", notes = "传入distributionDeliverySelf")
public R<IPage<DistributionDeliverySelfEntity>> list(@ApiIgnore @RequestParam Map<String, Object> distributionDeliverySelf, Query query) {
IPage<DistributionDeliverySelfEntity> pages = distributionDeliverySelfService.page(Condition.getPage(query), Condition.getQueryWrapper(distributionDeliverySelf, DistributionDeliverySelfEntity.class));
return R.data(pages);
}
@ -84,9 +84,9 @@ public class DistributionSelfDeliveryController extends BladeController {
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入distributionSelfDelivery")
public R<IPage<DistributionSelfDeliveryVO>> page(DistributionSelfDeliveryVO distributionSelfDelivery, Query query) {
IPage<DistributionSelfDeliveryVO> pages = distributionSelfDeliveryService.selectDistributionSelfDeliveryPage(Condition.getPage(query), distributionSelfDelivery);
@ApiOperation(value = "分页", notes = "传入distributionDeliverySelf")
public R<IPage<DistributionDeliverySelfVO>> page(DistributionDeliverySelfVO distributionDeliverySelf, Query query) {
IPage<DistributionDeliverySelfVO> pages = distributionDeliverySelfService.selectDistributionDeliverySelfPage(Condition.getPage(query), distributionDeliverySelf);
return R.data(pages);
}
@ -95,9 +95,9 @@ public class DistributionSelfDeliveryController extends BladeController {
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入distributionSelfDelivery")
public R save(@Valid @RequestBody DistributionSelfDeliveryEntity distributionSelfDelivery) {
return R.status(distributionSelfDeliveryService.save(distributionSelfDelivery));
@ApiOperation(value = "新增", notes = "传入distributionDeliverySelf")
public R save(@Valid @RequestBody DistributionDeliverySelfEntity distributionDeliverySelf) {
return R.status(distributionDeliverySelfService.save(distributionDeliverySelf));
}
/**
@ -105,9 +105,9 @@ public class DistributionSelfDeliveryController extends BladeController {
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入distributionSelfDelivery")
public R update(@Valid @RequestBody DistributionSelfDeliveryEntity distributionSelfDelivery) {
return R.status(distributionSelfDeliveryService.updateById(distributionSelfDelivery));
@ApiOperation(value = "修改", notes = "传入distributionDeliverySelf")
public R update(@Valid @RequestBody DistributionDeliverySelfEntity distributionDeliverySelf) {
return R.status(distributionDeliverySelfService.updateById(distributionDeliverySelf));
}
/**
@ -115,9 +115,9 @@ public class DistributionSelfDeliveryController extends BladeController {
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入distributionSelfDelivery")
public R submit(@Valid @RequestBody DistributionSelfDeliveryEntity distributionSelfDelivery) {
return R.status(distributionSelfDeliveryService.saveOrUpdate(distributionSelfDelivery));
@ApiOperation(value = "新增或修改", notes = "传入distributionDeliverySelf")
public R submit(@Valid @RequestBody DistributionDeliverySelfEntity distributionDeliverySelf) {
return R.status(distributionDeliverySelfService.saveOrUpdate(distributionDeliverySelf));
}
/**
@ -127,24 +127,24 @@ public class DistributionSelfDeliveryController extends BladeController {
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(distributionSelfDeliveryService.deleteLogic(Func.toLongList(ids)));
return R.status(distributionDeliverySelfService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@GetMapping("/export-distributionSelfDelivery")
@GetMapping("/export-distributionDeliverySelf")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入distributionSelfDelivery")
public void exportDistributionSelfDelivery(@ApiIgnore @RequestParam Map<String, Object> distributionSelfDelivery, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<DistributionSelfDeliveryEntity> queryWrapper = Condition.getQueryWrapper(distributionSelfDelivery, DistributionSelfDeliveryEntity.class);
@ApiOperation(value = "导出数据", notes = "传入distributionDeliverySelf")
public void exportDistributionDeliverySelf(@ApiIgnore @RequestParam Map<String, Object> distributionDeliverySelf, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<DistributionDeliverySelfEntity> queryWrapper = Condition.getQueryWrapper(distributionDeliverySelf, DistributionDeliverySelfEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(DistributionSelfDelivery::getTenantId, bladeUser.getTenantId());
// queryWrapper.lambda().eq(DistributionDeliverySelf::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(DistributionSelfDeliveryEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<DistributionSelfDeliveryExcel> list = distributionSelfDeliveryService.exportDistributionSelfDelivery(queryWrapper);
ExcelUtil.export(response, "自主配送信息列表数据" + DateUtil.time(), "自主配送信息列表数据表", list, DistributionSelfDeliveryExcel.class);
queryWrapper.lambda().eq(DistributionDeliverySelfEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<DistributionDeliverySelfExcel> list = distributionDeliverySelfService.exportDistributionDeliverySelf(queryWrapper);
ExcelUtil.export(response, "自主配送信息列表数据" + DateUtil.time(), "自主配送信息列表数据表", list, DistributionDeliverySelfExcel.class);
}
}

72
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionTripartiteDeliveryController.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryTripartiteController.java

@ -31,10 +31,10 @@ import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity;
import com.logpm.distribution.vo.DistributionTripartiteDeliveryVO;
import com.logpm.distribution.excel.DistributionTripartiteDeliveryExcel;
import com.logpm.distribution.service.IDistributionTripartiteDeliveryService;
import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity;
import com.logpm.distribution.vo.DistributionDeliveryTripartiteVO;
import com.logpm.distribution.excel.DistributionDeliveryTripartiteExcel;
import com.logpm.distribution.service.IDistributionDeliveryTripartiteService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
@ -47,25 +47,25 @@ import javax.servlet.http.HttpServletResponse;
/**
* 外协配送信息列表 控制器
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@RestController
@AllArgsConstructor
@RequestMapping("tripartiteDelivery/distributionTripartiteDelivery")
@RequestMapping("deliveryTripartite/distributionDeliveryTripartite")
@Api(value = "外协配送信息列表", tags = "外协配送信息列表接口")
public class DistributionTripartiteDeliveryController extends BladeController {
public class DistributionDeliveryTripartiteController extends BladeController {
private final IDistributionTripartiteDeliveryService distributionTripartiteDeliveryService;
private final IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService;
/**
* 外协配送信息列表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distributionTripartiteDelivery")
public R<DistributionTripartiteDeliveryEntity> detail(DistributionTripartiteDeliveryEntity distributionTripartiteDelivery) {
DistributionTripartiteDeliveryEntity detail = distributionTripartiteDeliveryService.getOne(Condition.getQueryWrapper(distributionTripartiteDelivery));
@ApiOperation(value = "详情", notes = "传入distributionDeliveryTripartite")
public R<DistributionDeliveryTripartiteEntity> detail(DistributionDeliveryTripartiteEntity distributionDeliveryTripartite) {
DistributionDeliveryTripartiteEntity detail = distributionDeliveryTripartiteService.getOne(Condition.getQueryWrapper(distributionDeliveryTripartite));
return R.data(detail);
}
/**
@ -73,9 +73,9 @@ public class DistributionTripartiteDeliveryController extends BladeController {
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入distributionTripartiteDelivery")
public R<IPage<DistributionTripartiteDeliveryEntity>> list(@ApiIgnore @RequestParam Map<String, Object> distributionTripartiteDelivery, Query query) {
IPage<DistributionTripartiteDeliveryEntity> pages = distributionTripartiteDeliveryService.page(Condition.getPage(query), Condition.getQueryWrapper(distributionTripartiteDelivery, DistributionTripartiteDeliveryEntity.class));
@ApiOperation(value = "分页", notes = "传入distributionDeliveryTripartite")
public R<IPage<DistributionDeliveryTripartiteEntity>> list(@ApiIgnore @RequestParam Map<String, Object> distributionDeliveryTripartite, Query query) {
IPage<DistributionDeliveryTripartiteEntity> pages = distributionDeliveryTripartiteService.page(Condition.getPage(query), Condition.getQueryWrapper(distributionDeliveryTripartite, DistributionDeliveryTripartiteEntity.class));
return R.data(pages);
}
@ -84,9 +84,9 @@ public class DistributionTripartiteDeliveryController extends BladeController {
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入distributionTripartiteDelivery")
public R<IPage<DistributionTripartiteDeliveryVO>> page(DistributionTripartiteDeliveryVO distributionTripartiteDelivery, Query query) {
IPage<DistributionTripartiteDeliveryVO> pages = distributionTripartiteDeliveryService.selectDistributionTripartiteDeliveryPage(Condition.getPage(query), distributionTripartiteDelivery);
@ApiOperation(value = "分页", notes = "传入distributionDeliveryTripartite")
public R<IPage<DistributionDeliveryTripartiteVO>> page(DistributionDeliveryTripartiteVO distributionDeliveryTripartite, Query query) {
IPage<DistributionDeliveryTripartiteVO> pages = distributionDeliveryTripartiteService.selectDistributionDeliveryTripartitePage(Condition.getPage(query), distributionDeliveryTripartite);
return R.data(pages);
}
@ -95,9 +95,9 @@ public class DistributionTripartiteDeliveryController extends BladeController {
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入distributionTripartiteDelivery")
public R save(@Valid @RequestBody DistributionTripartiteDeliveryEntity distributionTripartiteDelivery) {
return R.status(distributionTripartiteDeliveryService.save(distributionTripartiteDelivery));
@ApiOperation(value = "新增", notes = "传入distributionDeliveryTripartite")
public R save(@Valid @RequestBody DistributionDeliveryTripartiteEntity distributionDeliveryTripartite) {
return R.status(distributionDeliveryTripartiteService.save(distributionDeliveryTripartite));
}
/**
@ -105,9 +105,9 @@ public class DistributionTripartiteDeliveryController extends BladeController {
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入distributionTripartiteDelivery")
public R update(@Valid @RequestBody DistributionTripartiteDeliveryEntity distributionTripartiteDelivery) {
return R.status(distributionTripartiteDeliveryService.updateById(distributionTripartiteDelivery));
@ApiOperation(value = "修改", notes = "传入distributionDeliveryTripartite")
public R update(@Valid @RequestBody DistributionDeliveryTripartiteEntity distributionDeliveryTripartite) {
return R.status(distributionDeliveryTripartiteService.updateById(distributionDeliveryTripartite));
}
/**
@ -115,9 +115,9 @@ public class DistributionTripartiteDeliveryController extends BladeController {
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入distributionTripartiteDelivery")
public R submit(@Valid @RequestBody DistributionTripartiteDeliveryEntity distributionTripartiteDelivery) {
return R.status(distributionTripartiteDeliveryService.saveOrUpdate(distributionTripartiteDelivery));
@ApiOperation(value = "新增或修改", notes = "传入distributionDeliveryTripartite")
public R submit(@Valid @RequestBody DistributionDeliveryTripartiteEntity distributionDeliveryTripartite) {
return R.status(distributionDeliveryTripartiteService.saveOrUpdate(distributionDeliveryTripartite));
}
/**
@ -127,24 +127,24 @@ public class DistributionTripartiteDeliveryController extends BladeController {
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(distributionTripartiteDeliveryService.deleteLogic(Func.toLongList(ids)));
return R.status(distributionDeliveryTripartiteService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@GetMapping("/export-distributionTripartiteDelivery")
@GetMapping("/export-distributionDeliveryTripartite")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入distributionTripartiteDelivery")
public void exportDistributionTripartiteDelivery(@ApiIgnore @RequestParam Map<String, Object> distributionTripartiteDelivery, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<DistributionTripartiteDeliveryEntity> queryWrapper = Condition.getQueryWrapper(distributionTripartiteDelivery, DistributionTripartiteDeliveryEntity.class);
@ApiOperation(value = "导出数据", notes = "传入distributionDeliveryTripartite")
public void exportDistributionDeliveryTripartite(@ApiIgnore @RequestParam Map<String, Object> distributionDeliveryTripartite, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<DistributionDeliveryTripartiteEntity> queryWrapper = Condition.getQueryWrapper(distributionDeliveryTripartite, DistributionDeliveryTripartiteEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(DistributionTripartiteDelivery::getTenantId, bladeUser.getTenantId());
// queryWrapper.lambda().eq(DistributionDeliveryTripartite::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(DistributionTripartiteDeliveryEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<DistributionTripartiteDeliveryExcel> list = distributionTripartiteDeliveryService.exportDistributionTripartiteDelivery(queryWrapper);
ExcelUtil.export(response, "外协配送信息列表数据" + DateUtil.time(), "外协配送信息列表数据表", list, DistributionTripartiteDeliveryExcel.class);
queryWrapper.lambda().eq(DistributionDeliveryTripartiteEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<DistributionDeliveryTripartiteExcel> list = distributionDeliveryTripartiteService.exportDistributionDeliveryTripartite(queryWrapper);
ExcelUtil.export(response, "外协配送信息列表数据" + DateUtil.time(), "外协配送信息列表数据表", list, DistributionDeliveryTripartiteExcel.class);
}
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionReservationController.java

@ -16,6 +16,7 @@
*/
package com.logpm.distribution.controller;
import com.logpm.distribution.dto.DistributionDeliveryAllocationDTO;
import com.logpm.distribution.dto.DistributionReservationDTO;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.excel.DistributionReservationExcel;
@ -191,8 +192,8 @@ public class DistributionReservationController extends BladeController {
@PostMapping("/deliveryTask")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "批量预约转备货任务")
public R deliveryTask(@RequestBody Map<String,Object> deliveryInfo) {
R<?> result = reservationService.deliveryTask(deliveryInfo);
public R deliveryTask(@RequestBody DistributionDeliveryAllocationDTO allocationDTO) {
R<?> result = reservationService.deliveryTask(allocationDTO);
return result;
}

55
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryAllocationDTO.java

@ -0,0 +1,55 @@
package com.logpm.distribution.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
import java.util.Map;
/**
* 预约转配送信息传输类
*
* @author Tjj
* @since 2023-07-04
*/
@Data
@EqualsAndHashCode()
public class DistributionDeliveryAllocationDTO {
/**
* 预约单编号
*/
@ApiModelProperty(value = "订单配送单编号")
private String reservationIds;
// /**
// * 预约单数据
// */
// @ApiModelProperty(value = "预约单数据")
// private List<DistributionReservationDTO> reservations;
/**
* 备货数据
*/
@ApiModelProperty(value = "备货数据")
private DistributionStockupDTO stockup;
/**
* 自主配送司机车辆信息
*/
@ApiModelProperty(value = "自主配送司机车辆信息")
private List<DistributionDeliverySelfDTO> allocationInfo;
/**
* 三方配送司机车辆信息
*/
@ApiModelProperty(value = "三方配送司机车辆信息")
private DistributionDeliveryTripartiteDTO tripartite;
}

38
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionSelfDeliveryDTO.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliverySelfDTO.java

@ -16,19 +16,49 @@
*/
package com.logpm.distribution.dto;
import com.logpm.distribution.entity.DistributionSelfDeliveryEntity;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 自主配送信息列表 数据传输对象实体类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class DistributionSelfDeliveryDTO extends DistributionSelfDeliveryEntity {
public class DistributionDeliverySelfDTO extends DistributionDeliverySelfEntity {
private static final long serialVersionUID = 1L;
/**
* 司机名称
*/
@ApiModelProperty(value = "司机名称")
private String driver;
/**
* 司机编号
*/
@ApiModelProperty(value = "司机编号")
private String driverId;
/**
* 车牌号
*/
@ApiModelProperty(value = "车牌号")
private String vehicle;
/**
* 车辆编号
*/
@ApiModelProperty(value = "车辆编号")
private String vehicleId;
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionTripartiteDeliveryDTO.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionDeliveryTripartiteDTO.java

@ -16,19 +16,19 @@
*/
package com.logpm.distribution.dto;
import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity;
import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 外协配送信息列表 数据传输对象实体类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class DistributionTripartiteDeliveryDTO extends DistributionTripartiteDeliveryEntity {
public class DistributionDeliveryTripartiteDTO extends DistributionDeliveryTripartiteEntity {
private static final long serialVersionUID = 1L;
}

65
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionStockupDTO.java

@ -16,10 +16,14 @@
*/
package com.logpm.distribution.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.logpm.distribution.entity.DistributionStockupEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 备货信息表 数据传输对象实体类
*
@ -31,4 +35,65 @@ import lombok.EqualsAndHashCode;
public class DistributionStockupDTO extends DistributionStockupEntity {
private static final long serialVersionUID = 1L;
/**
* 叉车司机
*/
@ApiModelProperty(value = "叉车司机")
private String forkliftId;
/**
* 叉车司机名称
*/
@ApiModelProperty(value = "叉车司机名称")
private String forkliftName;
// /**
// * 备货区编号
// */
// @ApiModelProperty(value = "备货区编号")
// private String goodsAreaId;
/**
* 预约单编号
*/
@ApiModelProperty(value = "备货区名称")
private String goodsAreaName;
/**
* 班组职能
*/
@ApiModelProperty(value = "班组职能")
private String loadAndUnload;
/**
* 预约单编号
*/
@ApiModelProperty(value = "班组编号")
private String loaderId;
/**
* 班组名称
*/
@ApiModelProperty(value = "班组名称")
private String loaderName;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remarks;
/**
* 备货时间
*/
@ApiModelProperty(value = "备货时间")
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
private Date stockupDate;
}

26
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionSelfDeliveryExcel.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliverySelfExcel.java

@ -30,14 +30,14 @@ import java.io.Serializable;
/**
* 自主配送信息列表 Excel实体类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class DistributionSelfDeliveryExcel implements Serializable {
public class DistributionDeliverySelfExcel implements Serializable {
private static final long serialVersionUID = 1L;
@ -59,24 +59,30 @@ public class DistributionSelfDeliveryExcel implements Serializable {
@ColumnWidth(20)
@ExcelProperty("预约信息编号")
private String reservationIds;
/**
* 配送司机
*/
@ColumnWidth(20)
@ExcelProperty("配送司机")
private String slaveDriverId;
/**
* 车辆编号
*/
@ColumnWidth(20)
@ExcelProperty("车辆编号")
private String vehicleIds;
private String vehicleId;
/**
* 司机负责人
* 是否是主司机
*/
@ColumnWidth(20)
@ExcelProperty("司机负责人")
private String masterDriverId;
@ExcelProperty("是否是主司机")
private Integer isMaster;
/**
* 配送司机
* 配送ID
*/
@ColumnWidth(20)
@ExcelProperty("配送司机")
private String slaveDriverIds;
@ExcelProperty("配送ID")
private Long deliveryId;
/**
* 预留1
*/

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionTripartiteDeliveryExcel.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionDeliveryTripartiteExcel.java

@ -31,14 +31,14 @@ import java.io.Serializable;
/**
* 外协配送信息列表 Excel实体类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class DistributionTripartiteDeliveryExcel implements Serializable {
public class DistributionDeliveryTripartiteExcel implements Serializable {
private static final long serialVersionUID = 1L;
@ -78,6 +78,12 @@ public class DistributionTripartiteDeliveryExcel implements Serializable {
@ColumnWidth(20)
@ExcelProperty("配送费用")
private BigDecimal deliveryFee;
/**
* 预约信息编号
*/
@ColumnWidth(20)
@ExcelProperty("预约信息编号")
private String reservationIds;
/**
* 预留1
*/
@ -108,5 +114,11 @@ public class DistributionTripartiteDeliveryExcel implements Serializable {
@ColumnWidth(20)
@ExcelProperty("预留5")
private String reserve5;
/**
* 配送ID
*/
@ColumnWidth(20)
@ExcelProperty("配送ID")
private Long deliveryId;
}

53
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliverySelfClient.java

@ -0,0 +1,53 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import com.logpm.distribution.service.IDistributionDeliverySelfService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
/**
* 自主配送信息列表 Feign实现类
*
* @author Tjj
* @since 2023-07-04
*/
@ApiIgnore()
@RestController
@AllArgsConstructor
public class DistributionDeliverySelfClient implements IDistributionDeliverySelfClient {
private final IDistributionDeliverySelfService distributionDeliverySelfService;
@Override
@GetMapping(TOP)
public BladePage<DistributionDeliverySelfEntity> deliverySelfTop(Integer current, Integer size) {
Query query = new Query();
query.setCurrent(current);
query.setSize(size);
IPage<DistributionDeliverySelfEntity> page = distributionDeliverySelfService.page(Condition.getPage(query));
return BladePage.of(page);
}
}

53
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryTripartiteClient.java

@ -0,0 +1,53 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity;
import com.logpm.distribution.service.IDistributionDeliveryTripartiteService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
/**
* 外协配送信息列表 Feign实现类
*
* @author Tjj
* @since 2023-07-04
*/
@ApiIgnore()
@RestController
@AllArgsConstructor
public class DistributionDeliveryTripartiteClient implements IDistributionDeliveryTripartiteClient {
private final IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService;
@Override
@GetMapping(TOP)
public BladePage<DistributionDeliveryTripartiteEntity> tdeliveryTripartiteTop(Integer current, Integer size) {
Query query = new Query();
query.setCurrent(current);
query.setSize(size);
IPage<DistributionDeliveryTripartiteEntity> page = distributionDeliveryTripartiteService.page(Condition.getPage(query));
return BladePage.of(page);
}
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockupInfoClient.java

@ -42,7 +42,7 @@ public class DistributionStockupInfoClient implements IDistributionStockupInfoCl
@Override
@GetMapping(TOP)
public BladePage<DistributionStockupInfoEntity> top(Integer current, Integer size) {
public BladePage<DistributionStockupInfoEntity> reservationStockupTop(Integer current, Integer size) {
Query query = new Query();
query.setCurrent(current);
query.setSize(size);

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSelfDeliveryMapper.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.java

@ -16,9 +16,9 @@
*/
package com.logpm.distribution.mapper;
import com.logpm.distribution.entity.DistributionSelfDeliveryEntity;
import com.logpm.distribution.vo.DistributionSelfDeliveryVO;
import com.logpm.distribution.excel.DistributionSelfDeliveryExcel;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import com.logpm.distribution.excel.DistributionDeliverySelfExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -28,19 +28,19 @@ import java.util.List;
/**
* 自主配送信息列表 Mapper 接口
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
public interface DistributionSelfDeliveryMapper extends BaseMapper<DistributionSelfDeliveryEntity> {
public interface DistributionDeliverySelfMapper extends BaseMapper<DistributionDeliverySelfEntity> {
/**
* 自定义分页
*
* @param page
* @param distributionSelfDelivery
* @param distributionDeliverySelf
* @return
*/
List<DistributionSelfDeliveryVO> selectDistributionSelfDeliveryPage(IPage page, DistributionSelfDeliveryVO distributionSelfDelivery);
List<DistributionDeliverySelfVO> selectDistributionDeliverySelfPage(IPage page, DistributionDeliverySelfVO distributionDeliverySelf);
/**
@ -49,6 +49,6 @@ public interface DistributionSelfDeliveryMapper extends BaseMapper<DistributionS
* @param queryWrapper
* @return
*/
List<DistributionSelfDeliveryExcel> exportDistributionSelfDelivery(@Param("ew") Wrapper<DistributionSelfDeliveryEntity> queryWrapper);
List<DistributionDeliverySelfExcel> exportDistributionDeliverySelf(@Param("ew") Wrapper<DistributionDeliverySelfEntity> queryWrapper);
}

21
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSelfDeliveryMapper.xml → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliverySelfMapper.xml

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.distribution.mapper.DistributionSelfDeliveryMapper">
<mapper namespace="com.logpm.distribution.mapper.DistributionDeliverySelfMapper">
<!-- 通用查询映射结果 -->
<resultMap id="distributionSelfDeliveryResultMap" type="com.logpm.distribution.entity.DistributionSelfDeliveryEntity">
<resultMap id="distributionDeliverySelfResultMap" type="com.logpm.distribution.entity.DistributionDeliverySelfEntity">
<result column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
@ -12,11 +13,11 @@
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="id" property="id"/>
<result column="reservation_ids" property="reservationIds"/>
<result column="vehicle_ids" property="vehicleIds"/>
<result column="master_driver_id" property="masterDriverId"/>
<result column="slave_driver_ids" property="slaveDriverIds"/>
<result column="slave_driver_id" property="slaveDriverId"/>
<result column="vehicle_id" property="vehicleId"/>
<result column="is_master" property="isMaster"/>
<result column="delivery_id" property="deliveryId"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
@ -25,13 +26,13 @@
</resultMap>
<select id="selectDistributionSelfDeliveryPage" resultMap="distributionSelfDeliveryResultMap">
select * from logpm_distribution_self_delivery where is_deleted = 0
<select id="selectDistributionDeliverySelfPage" resultMap="distributionDeliverySelfResultMap">
select * from logpm_distribution_delivery_self where is_deleted = 0
</select>
<select id="exportDistributionSelfDelivery" resultType="com.logpm.distribution.excel.DistributionSelfDeliveryExcel">
SELECT * FROM logpm_distribution_self_delivery ${ew.customSqlSegment}
<select id="exportDistributionDeliverySelf" resultType="com.logpm.distribution.excel.DistributionDeliverySelfExcel">
SELECT * FROM logpm_distribution_delivery_self ${ew.customSqlSegment}
</select>
</mapper>

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionTripartiteDeliveryMapper.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.java

@ -16,9 +16,9 @@
*/
package com.logpm.distribution.mapper;
import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity;
import com.logpm.distribution.vo.DistributionTripartiteDeliveryVO;
import com.logpm.distribution.excel.DistributionTripartiteDeliveryExcel;
import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity;
import com.logpm.distribution.vo.DistributionDeliveryTripartiteVO;
import com.logpm.distribution.excel.DistributionDeliveryTripartiteExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -28,19 +28,19 @@ import java.util.List;
/**
* 外协配送信息列表 Mapper 接口
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
public interface DistributionTripartiteDeliveryMapper extends BaseMapper<DistributionTripartiteDeliveryEntity> {
public interface DistributionDeliveryTripartiteMapper extends BaseMapper<DistributionDeliveryTripartiteEntity> {
/**
* 自定义分页
*
* @param page
* @param distributionTripartiteDelivery
* @param distributionDeliveryTripartite
* @return
*/
List<DistributionTripartiteDeliveryVO> selectDistributionTripartiteDeliveryPage(IPage page, DistributionTripartiteDeliveryVO distributionTripartiteDelivery);
List<DistributionDeliveryTripartiteVO> selectDistributionDeliveryTripartitePage(IPage page, DistributionDeliveryTripartiteVO distributionDeliveryTripartite);
/**
@ -49,6 +49,6 @@ public interface DistributionTripartiteDeliveryMapper extends BaseMapper<Distrib
* @param queryWrapper
* @return
*/
List<DistributionTripartiteDeliveryExcel> exportDistributionTripartiteDelivery(@Param("ew") Wrapper<DistributionTripartiteDeliveryEntity> queryWrapper);
List<DistributionDeliveryTripartiteExcel> exportDistributionDeliveryTripartite(@Param("ew") Wrapper<DistributionDeliveryTripartiteEntity> queryWrapper);
}

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionTripartiteDeliveryMapper.xml → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryTripartiteMapper.xml

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.distribution.mapper.DistributionTripartiteDeliveryMapper">
<mapper namespace="com.logpm.distribution.mapper.DistributionDeliveryTripartiteMapper">
<!-- 通用查询映射结果 -->
<resultMap id="distributionTripartiteDeliveryResultMap" type="com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity">
<resultMap id="distributionDeliveryTripartiteResultMap" type="com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity">
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
@ -23,16 +23,17 @@
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="delivery_id" property="deliveryId"/>
</resultMap>
<select id="selectDistributionTripartiteDeliveryPage" resultMap="distributionTripartiteDeliveryResultMap">
select * from logpm_distribution_tripartite_delivery where is_deleted = 0
<select id="selectDistributionDeliveryTripartitePage" resultMap="distributionDeliveryTripartiteResultMap">
select * from logpm_distribution_delivery_tripartite where is_deleted = 0
</select>
<select id="exportDistributionTripartiteDelivery" resultType="com.logpm.distribution.excel.DistributionTripartiteDeliveryExcel">
SELECT * FROM logpm_distribution_tripartite_delivery ${ew.customSqlSegment}
<select id="exportDistributionDeliveryTripartite" resultType="com.logpm.distribution.excel.DistributionDeliveryTripartiteExcel">
SELECT * FROM logpm_distribution_delivery_tripartite ${ew.customSqlSegment}
</select>
</mapper>

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSelfDeliveryService.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliverySelfService.java

@ -17,9 +17,9 @@
package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.distribution.entity.DistributionSelfDeliveryEntity;
import com.logpm.distribution.vo.DistributionSelfDeliveryVO;
import com.logpm.distribution.excel.DistributionSelfDeliveryExcel;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import com.logpm.distribution.excel.DistributionDeliverySelfExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
@ -27,18 +27,18 @@ import java.util.List;
/**
* 自主配送信息列表 服务类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
public interface IDistributionSelfDeliveryService extends BaseService<DistributionSelfDeliveryEntity> {
public interface IDistributionDeliverySelfService extends BaseService<DistributionDeliverySelfEntity> {
/**
* 自定义分页
*
* @param page
* @param distributionSelfDelivery
* @param distributionDeliverySelf
* @return
*/
IPage<DistributionSelfDeliveryVO> selectDistributionSelfDeliveryPage(IPage<DistributionSelfDeliveryVO> page, DistributionSelfDeliveryVO distributionSelfDelivery);
IPage<DistributionDeliverySelfVO> selectDistributionDeliverySelfPage(IPage<DistributionDeliverySelfVO> page, DistributionDeliverySelfVO distributionDeliverySelf);
/**
@ -47,6 +47,6 @@ public interface IDistributionSelfDeliveryService extends BaseService<Distributi
* @param queryWrapper
* @return
*/
List<DistributionSelfDeliveryExcel> exportDistributionSelfDelivery(Wrapper<DistributionSelfDeliveryEntity> queryWrapper);
List<DistributionDeliverySelfExcel> exportDistributionDeliverySelf(Wrapper<DistributionDeliverySelfEntity> queryWrapper);
}

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionTripartiteDeliveryService.java → blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryTripartiteService.java

@ -17,9 +17,9 @@
package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity;
import com.logpm.distribution.vo.DistributionTripartiteDeliveryVO;
import com.logpm.distribution.excel.DistributionTripartiteDeliveryExcel;
import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity;
import com.logpm.distribution.vo.DistributionDeliveryTripartiteVO;
import com.logpm.distribution.excel.DistributionDeliveryTripartiteExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
@ -27,18 +27,18 @@ import java.util.List;
/**
* 外协配送信息列表 服务类
*
* @author TJJ
* @since 2023-06-26
* @author Tjj
* @since 2023-07-04
*/
public interface IDistributionTripartiteDeliveryService extends BaseService<DistributionTripartiteDeliveryEntity> {
public interface IDistributionDeliveryTripartiteService extends BaseService<DistributionDeliveryTripartiteEntity> {
/**
* 自定义分页
*
* @param page
* @param distributionTripartiteDelivery
* @param distributionDeliveryTripartite
* @return
*/
IPage<DistributionTripartiteDeliveryVO> selectDistributionTripartiteDeliveryPage(IPage<DistributionTripartiteDeliveryVO> page, DistributionTripartiteDeliveryVO distributionTripartiteDelivery);
IPage<DistributionDeliveryTripartiteVO> selectDistributionDeliveryTripartitePage(IPage<DistributionDeliveryTripartiteVO> page, DistributionDeliveryTripartiteVO distributionDeliveryTripartite);
/**
@ -47,6 +47,6 @@ public interface IDistributionTripartiteDeliveryService extends BaseService<Dist
* @param queryWrapper
* @return
*/
List<DistributionTripartiteDeliveryExcel> exportDistributionTripartiteDelivery(Wrapper<DistributionTripartiteDeliveryEntity> queryWrapper);
List<DistributionDeliveryTripartiteExcel> exportDistributionDeliveryTripartite(Wrapper<DistributionDeliveryTripartiteEntity> queryWrapper);
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -18,6 +18,7 @@ package com.logpm.distribution.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.dto.DistributionDeliveryAllocationDTO;
import com.logpm.distribution.dto.DistributionReservationDTO;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.excel.DistributionReservationExcel;
@ -91,10 +92,10 @@ public interface IDistributionReservationService extends BaseService<Distributio
/**
* 批量转配送任务
* @param deliveryInfo
* @param allocationDTO 配送信息
* @return
*/
R<?> deliveryTask(Map<String, Object> deliveryInfo);
R<?> deliveryTask(DistributionDeliveryAllocationDTO allocationDTO);
/**

54
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliverySelfServiceImpl.java

@ -0,0 +1,54 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.service.impl;
import com.logpm.distribution.entity.DistributionDeliverySelfEntity;
import com.logpm.distribution.vo.DistributionDeliverySelfVO;
import com.logpm.distribution.excel.DistributionDeliverySelfExcel;
import com.logpm.distribution.mapper.DistributionDeliverySelfMapper;
import com.logpm.distribution.service.IDistributionDeliverySelfService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 自主配送信息列表 服务实现类
*
* @author Tjj
* @since 2023-07-04
*/
@Service
public class DistributionDeliverySelfServiceImpl extends BaseServiceImpl<DistributionDeliverySelfMapper, DistributionDeliverySelfEntity> implements IDistributionDeliverySelfService {
@Override
public IPage<DistributionDeliverySelfVO> selectDistributionDeliverySelfPage(IPage<DistributionDeliverySelfVO> page, DistributionDeliverySelfVO distributionDeliverySelf) {
return page.setRecords(baseMapper.selectDistributionDeliverySelfPage(page, distributionDeliverySelf));
}
@Override
public List<DistributionDeliverySelfExcel> exportDistributionDeliverySelf(Wrapper<DistributionDeliverySelfEntity> queryWrapper) {
List<DistributionDeliverySelfExcel> distributionDeliverySelfList = baseMapper.exportDistributionDeliverySelf(queryWrapper);
//distributionDeliverySelfList.forEach(distributionDeliverySelf -> {
// distributionDeliverySelf.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionDeliverySelf.getType()));
//});
return distributionDeliverySelfList;
}
}

54
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryTripartiteServiceImpl.java

@ -0,0 +1,54 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.service.impl;
import com.logpm.distribution.entity.DistributionDeliveryTripartiteEntity;
import com.logpm.distribution.vo.DistributionDeliveryTripartiteVO;
import com.logpm.distribution.excel.DistributionDeliveryTripartiteExcel;
import com.logpm.distribution.mapper.DistributionDeliveryTripartiteMapper;
import com.logpm.distribution.service.IDistributionDeliveryTripartiteService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 外协配送信息列表 服务实现类
*
* @author Tjj
* @since 2023-07-04
*/
@Service
public class DistributionDeliveryTripartiteServiceImpl extends BaseServiceImpl<DistributionDeliveryTripartiteMapper, DistributionDeliveryTripartiteEntity> implements IDistributionDeliveryTripartiteService {
@Override
public IPage<DistributionDeliveryTripartiteVO> selectDistributionDeliveryTripartitePage(IPage<DistributionDeliveryTripartiteVO> page, DistributionDeliveryTripartiteVO distributionDeliveryTripartite) {
return page.setRecords(baseMapper.selectDistributionDeliveryTripartitePage(page, distributionDeliveryTripartite));
}
@Override
public List<DistributionDeliveryTripartiteExcel> exportDistributionDeliveryTripartite(Wrapper<DistributionDeliveryTripartiteEntity> queryWrapper) {
List<DistributionDeliveryTripartiteExcel> distributionDeliveryTripartiteList = baseMapper.exportDistributionDeliveryTripartite(queryWrapper);
//distributionDeliveryTripartiteList.forEach(distributionDeliveryTripartite -> {
// distributionDeliveryTripartite.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionDeliveryTripartite.getType()));
//});
return distributionDeliveryTripartiteList;
}
}

239
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -19,7 +19,7 @@ package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.logpm.distribution.dto.DistributionReservationDTO;
import com.logpm.distribution.dto.*;
import com.logpm.distribution.entity.*;
import com.logpm.distribution.excel.DistributionReservationExcel;
import com.logpm.distribution.mapper.DistributionReservationMapper;
@ -30,6 +30,7 @@ import org.springblade.core.mp.support.Condition;
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.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
@ -67,9 +68,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
private final IDistributionDeliveryListService distributionDeliveryListService;
private final IDistributionTripartiteDeliveryService distributionTripartiteDeliveryService;
private final IDistributionSelfDeliveryService distributionSelfDeliveryService;
private final IDistributionReservationStockarticleService distributionReservationStockarticleService;
@ -190,6 +189,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
BigDecimal fee = initTotal.get().add(reservationEntity.getOtherFee());
reservationEntity.setFee(fee);
int count = stockArticleCount.get() + stockListCount.get();
String random = Func.random(13, RandomType.ALL);
reservationEntity.setReservationId(random);
reservationEntity.setReservationNum(count);
distributionReservationMapper.updateById(reservationEntity);
return true;
@ -211,7 +212,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
String stockUpDate = (String) stockUpInfo.get("stockupDate");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date date = format.parse(stockUpDate);
String goddsAreaId = (String) stockUpInfo.get("goodsAreaId");
String goddsAreaId = (String) stockUpInfo.get("stockupArea");
DistributionStockupEntity stockupEntity = new DistributionStockupEntity();
stockupEntity.setGoodsAreaId(Long.parseLong(goddsAreaId));
//设置备货任务指派状态---未指派
@ -272,134 +273,124 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return distributionReservationVOS;
}
@Transactional
@Override
public R<?> deliveryTask(Map<String, Object> deliveryInfo) {
//获取前端传递的多个预约信息
String idsStr = (String) deliveryInfo.get("reservationIds");
String[] ids = idsStr.split(",");
if (Func.isEmpty(ids)) {
log.error("预约参数错误+{" + ids + "}");
return R.fail("预约信息错误!!!");
@Transactional
public R<?> deliveryTask(DistributionDeliveryAllocationDTO allocationDTO) {
if (Func.isEmpty(allocationDTO)){
log.error("参数异常allocationDTO:+{"+allocationDTO+"}");
return R.fail("服务器正忙!!!");
}
//判断是自主配送还是三方配送
String tripartiteSource = (String) deliveryInfo.get("tripartiteSource");
boolean result = false;
try {
if (Func.isBlank(tripartiteSource)) {
//自主配送
DistributionSelfDeliveryEntity distributionSelfDeliveryEntity = new DistributionSelfDeliveryEntity();
distributionSelfDeliveryEntity.setMasterDriverId((String) deliveryInfo.get("masterDriver"));
distributionSelfDeliveryEntity.setReservationIds(idsStr);
distributionSelfDeliveryEntity.setVehicleIds((String) deliveryInfo.get("vehicleIds"));
distributionSelfDeliveryEntity.setSlaveDriverIds((String) deliveryInfo.get("slaveDriver"));
//保存自主配送信息
result = distributionSelfDeliveryService.save(distributionSelfDeliveryEntity);
//获取自主配送信息id
Long distributionSelfDeliveryEntityId = distributionSelfDeliveryEntity.getId();
} else {
//三方配送
DistributionTripartiteDeliveryEntity distributionTripartiteDeliveryEntity = new DistributionTripartiteDeliveryEntity();
distributionTripartiteDeliveryEntity.setDriverPhone((String) deliveryInfo.get("driverPhone"));
distributionTripartiteDeliveryEntity.setDriverName((String) deliveryInfo.get("driverName"));
distributionTripartiteDeliveryEntity.setVehicleNum((String) deliveryInfo.get("vehicleNum"));
distributionTripartiteDeliveryEntity.setDeliveryFee(new BigDecimal((String) deliveryInfo.get("deliveryFee")));
distributionTripartiteDeliveryEntity.setReservationIds(idsStr);
result = distributionTripartiteDeliveryService.save(distributionTripartiteDeliveryEntity);
Long distributionTripartiteDeliveryEntityId = distributionTripartiteDeliveryEntity.getId();
}
//备货信息构建
DistributionStockupEntity stockupEntity = new DistributionStockupEntity();
stockupEntity.setForklift(Long.parseLong((String) deliveryInfo.get("forklift")));
stockupEntity.setStockupStatus("2");
stockupEntity.setStockupArea((String) deliveryInfo.get("goodsAreaId"));
stockupEntity.setStockupUser(AuthUtil.getUser().getUserId().toString());
stockupEntity.setLoader(Long.parseLong((String) deliveryInfo.get("loader")));
stockupEntity.setAssignStatus("2");
stockupEntity.setAssignTime(new Date());
String stockUpdate = (String) deliveryInfo.get("stockupDate");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Date date = format.parse(stockUpdate);
stockupEntity.setStockupDate(date);
//完成对备货任务信息的保存
result = distributionStockupService.save(stockupEntity);
Long stockupEntityId = stockupEntity.getId();
StringBuffer reservationIdBuffer = new StringBuffer();
StringBuffer stockArticleIdBuffer = new StringBuffer();
AtomicReference<String> warehouseName = new AtomicReference<>();
AtomicInteger count = new AtomicInteger();
Arrays.stream(ids).forEach(id -> {
//对预约信息进行备货状态修改
DistributionReservationEntity reservationEntity = this.getBaseMapper().selectById(id);
String stockupStatus = reservationEntity.getStockupStatus();
if (!stockupStatus.equals("1")) {
//预约任务处于未备货状态
//预约信息编号拼接
reservationIdBuffer.append(reservationEntity.getId()).append(",");
//修改备货状态为待备货
reservationEntity.setStockupStatus("2");
this.updateById(reservationEntity);
reservationEntity.setUpdateTime(new Date());
reservationEntity.setUpdateUser(AuthUtil.getUserId());
reservationEntity.setIsDeleted(1);
String reservationIds = allocationDTO.getReservationIds();
//创建备货任务
DistributionStockupDTO stockup = allocationDTO.getStockup();
DistributionStockupEntity distributionStockupEntity = Func.copy(stockup, DistributionStockupEntity.class);
distributionStockupEntity.setAssignStatus("1");
distributionStockupEntity.setAssignTime(new Date());
distributionStockupEntity.setForklift(Long.parseLong(stockup.getForkliftId()));
distributionStockupEntity.setStockupUser(AuthUtil.getUserId().toString());
distributionStockupEntity.setStockupStatus("2");
distributionStockupService.save(distributionStockupEntity);
List<Long> ids = Func.toLongList(reservationIds);
Map<String,Object> map = new HashMap<>();
//获取备货任务的编号
Long stockupEntityId = distributionStockupEntity.getId();
//统计包件数量
AtomicInteger packageNum = new AtomicInteger();
//预约订单数量
AtomicInteger orderNum = new AtomicInteger();
//预约单号拼接
StringBuilder reservationId = new StringBuilder();
//订单编号
StringBuilder orderIds = new StringBuilder();
//库存品编号
StringBuilder stockListId = new StringBuilder();
//订单自编号
HashSet<String> hashSet = new HashSet<>();
ids.forEach(i->{
//查询备货任务
map.put("reservationId",i);
QueryWrapper<DistributionStockupInfoEntity> qw = Condition.getQueryWrapper(map, DistributionStockupInfoEntity.class);
DistributionStockupInfoEntity distributionStockupInfoEntity = distributionStockupInfoService.getOne(qw);
if (Func.isEmpty(distributionStockupInfoEntity)){
//1、预约单不存在备货任务
//利用中间表建立起预约和备货表之间的关系
DistributionStockupInfoEntity stockupInfoEntity = new DistributionStockupInfoEntity();
stockupInfoEntity.setReservationId(i.toString());
stockupInfoEntity.setStockupId(stockupEntityId.toString());
distributionStockupInfoService.save(stockupInfoEntity);
}else {
//获取备货任务编号
String stockupId = distributionStockupInfoEntity.getStockupId();
DistributionStockupEntity stockupEntity = distributionStockupService.getById(stockupId);
//2、预约单存在备货任务还未指派
if (Func.equals(stockupEntity.getAssignStatus(),"2")){
//对原有的备货关系进行修改
distributionStockupInfoEntity.setStockupId(stockupEntityId.toString());
distributionStockupInfoService.updateById(distributionStockupInfoEntity);
}
String stockArticleId = reservationEntity.getStockArticleId();
stockArticleIdBuffer.append(stockArticleId).append(",");
//对预约信息中的订单状态进行修改并且将预约信息从预约列表中清除
String[] stockArticleIds = stockArticleId.split(",");
for (String articleId : stockArticleIds) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(articleId);
stockArticleEntity.setState(3);
distributionStockArticleService.updateById(stockArticleEntity);
warehouseName.set(stockArticleEntity.getWarehouse());
//TODO 统计预约单下订单配送包件数量
//3、预约单存在备货任务且已指派备货
//不执行操作
}
DistributionReservationEntity reservationEntity = this.getById(i);
//预约订单数量
orderNum.getAndAdd(reservationEntity.getStockArticleId().split(",").length);
//统计包件数量
packageNum.getAndAdd(reservationEntity.getReservationNum());
//预约单号拼接
reservationId.append(reservationEntity.getId()).append(",");
this.updateById(reservationEntity);
//订单自编号拼接
QueryWrapper<DistributionReservationStockarticleEntity> q = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStockarticleEntity.class);
q.lambda().eq(DistributionReservationStockarticleEntity::getReservationId, reservationEntity.getId());
QueryWrapper<DistributionReservationStocklistEntity> w = Condition.getQueryWrapper(new HashMap<String, Object>(), DistributionReservationStocklistEntity.class);
w.lambda().eq(DistributionReservationStocklistEntity::getReservationId, reservationEntity.getId());
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationStockarticleService.getBaseMapper().selectList(q);
List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationStocklistService.getBaseMapper().selectList(w);
if (!Func.isEmpty(reservationStockarticleEntityList)){
reservationStockarticleEntityList.forEach(r->{
//查询订单信息,完成对订单的信息修改
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(r.getStockarticleId());
//拼接订单编号
orderIds.append(stockArticleEntity.getId()).append(",");
//拼接订单自编号
hashSet.add(stockArticleEntity.getOrderSelfNumbering());
if (stockArticleEntity.getHandQuantity()> r.getReservationNum()){
//这里表示订单下的包件没有进行全部配送
//修改订单状态为部分配送
stockArticleEntity.setState(4);
//修改订单的在库数量
stockArticleEntity.setState(stockArticleEntity.getHandQuantity() - r.getReservationNum());
//对订单进行修改
distributionStockArticleService.updateById(stockArticleEntity);
}
//构建预约备货中间表信息
DistributionStockupInfoEntity distributionStockupInfoEntity = new DistributionStockupInfoEntity();
distributionStockupInfoEntity.setReservationId(reservationEntity.getId().toString());
distributionStockupInfoEntity.setStockupId(stockupEntityId.toString());
distributionStockupInfoService.save(distributionStockupInfoEntity);
count.getAndIncrement();
});
reservationIdBuffer.deleteCharAt(reservationIdBuffer.length() - 1);
stockupEntity.setIds(reservationIdBuffer.toString());
result = distributionStockupService.updateById(stockupEntity);
//这里还需要将数据保存至配送列表中
DistributionDeliveryListEntity distributionDeliveryListEntity = new DistributionDeliveryListEntity();
distributionDeliveryListEntity.setReservationId(idsStr);
stockArticleIdBuffer.deleteCharAt(stockArticleIdBuffer.length() - 1);
distributionDeliveryListEntity.setOrderId(stockArticleIdBuffer.toString());
distributionDeliveryListEntity.setWarehouseId(warehouseName.get());
String masterDriverName = (String) deliveryInfo.get("masterDriverName");
String slaveDriverNames = (String) deliveryInfo.get("slaveDriverNames");
if (Func.isBlank(masterDriverName)) {
//这里就是外协配送的方式
distributionDeliveryListEntity.setDriverName((String) deliveryInfo.get("driverName"));
distributionDeliveryListEntity.setKind("2");
distributionDeliveryListEntity.setVehicleName((String) deliveryInfo.get("vehicleNum"));
} else {
distributionDeliveryListEntity.setVehicleName((String) deliveryInfo.get("vehicleNums"));
distributionDeliveryListEntity.setVehicleId((String) deliveryInfo.get("vehicleIds"));
distributionDeliveryListEntity.setDriverName(masterDriverName + "," + slaveDriverNames);
distributionDeliveryListEntity.setDriverId((String) deliveryInfo.get("driverIds"));
distributionDeliveryListEntity.setKind("1");
}
});
}
distributionDeliveryListEntity.setCustomersNumber(Integer.parseInt(count.toString()));
distributionDeliveryListEntity.setState("1");
distributionDeliveryListEntity.setLoadingTeamId((String) deliveryInfo.get("loader"));
distributionDeliveryListEntity.setLoadingTeamName((String) deliveryInfo.get("loaderName"));
//TODO 配送的来源,这里是通过预约单转配送
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
} catch (Exception e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
log.error("异常错误+{" + e.getMessage() + "}");
return R.fail("操作失败!!!");
if (!Func.isEmpty(reservationStocklistEntityList)){
//对库存品进行操作
reservationStocklistEntityList.forEach(l->{
DistributionStockListEntity stockListEntity = distributionStockListService.getById(l.getStocklistId());
stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - l.getReservationNum());
hashSet.add(stockListEntity.getOrderSelfNumbering());
stockListId.append(stockListEntity.getId()).append(",");
});
}
});
//操作司机信息
DistributionDeliveryTripartiteDTO tripartite = allocationDTO.getTripartite();
if (Func.isEmpty(tripartite)){
//这里就是自主配送
}else {
//这里就是三方配送
List<DistributionDeliverySelfDTO> allocationInfo = allocationDTO.getAllocationInfo();
}
return R.status(result);
return null;
}
@Override
public R<DistributionReservationVO> getReservationInfo(String reservationId) {
//查询出预约信息

54
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSelfDeliveryServiceImpl.java

@ -1,54 +0,0 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.service.impl;
import com.logpm.distribution.entity.DistributionSelfDeliveryEntity;
import com.logpm.distribution.vo.DistributionSelfDeliveryVO;
import com.logpm.distribution.excel.DistributionSelfDeliveryExcel;
import com.logpm.distribution.mapper.DistributionSelfDeliveryMapper;
import com.logpm.distribution.service.IDistributionSelfDeliveryService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 自主配送信息列表 服务实现类
*
* @author TJJ
* @since 2023-06-26
*/
@Service
public class DistributionSelfDeliveryServiceImpl extends BaseServiceImpl<DistributionSelfDeliveryMapper, DistributionSelfDeliveryEntity> implements IDistributionSelfDeliveryService {
@Override
public IPage<DistributionSelfDeliveryVO> selectDistributionSelfDeliveryPage(IPage<DistributionSelfDeliveryVO> page, DistributionSelfDeliveryVO distributionSelfDelivery) {
return page.setRecords(baseMapper.selectDistributionSelfDeliveryPage(page, distributionSelfDelivery));
}
@Override
public List<DistributionSelfDeliveryExcel> exportDistributionSelfDelivery(Wrapper<DistributionSelfDeliveryEntity> queryWrapper) {
List<DistributionSelfDeliveryExcel> distributionSelfDeliveryList = baseMapper.exportDistributionSelfDelivery(queryWrapper);
//distributionSelfDeliveryList.forEach(distributionSelfDelivery -> {
// distributionSelfDelivery.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionSelfDelivery.getType()));
//});
return distributionSelfDeliveryList;
}
}

54
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionTripartiteDeliveryServiceImpl.java

@ -1,54 +0,0 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.distribution.service.impl;
import com.logpm.distribution.entity.DistributionTripartiteDeliveryEntity;
import com.logpm.distribution.vo.DistributionTripartiteDeliveryVO;
import com.logpm.distribution.excel.DistributionTripartiteDeliveryExcel;
import com.logpm.distribution.mapper.DistributionTripartiteDeliveryMapper;
import com.logpm.distribution.service.IDistributionTripartiteDeliveryService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 外协配送信息列表 服务实现类
*
* @author TJJ
* @since 2023-06-26
*/
@Service
public class DistributionTripartiteDeliveryServiceImpl extends BaseServiceImpl<DistributionTripartiteDeliveryMapper, DistributionTripartiteDeliveryEntity> implements IDistributionTripartiteDeliveryService {
@Override
public IPage<DistributionTripartiteDeliveryVO> selectDistributionTripartiteDeliveryPage(IPage<DistributionTripartiteDeliveryVO> page, DistributionTripartiteDeliveryVO distributionTripartiteDelivery) {
return page.setRecords(baseMapper.selectDistributionTripartiteDeliveryPage(page, distributionTripartiteDelivery));
}
@Override
public List<DistributionTripartiteDeliveryExcel> exportDistributionTripartiteDelivery(Wrapper<DistributionTripartiteDeliveryEntity> queryWrapper) {
List<DistributionTripartiteDeliveryExcel> distributionTripartiteDeliveryList = baseMapper.exportDistributionTripartiteDelivery(queryWrapper);
//distributionTripartiteDeliveryList.forEach(distributionTripartiteDelivery -> {
// distributionTripartiteDelivery.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionTripartiteDelivery.getType()));
//});
return distributionTripartiteDeliveryList;
}
}
Loading…
Cancel
Save