From 57a67ab8dbcf711393e1403c1c9531aa4af4dba1 Mon Sep 17 00:00:00 2001 From: chenlong Date: Fri, 9 Aug 2024 17:59:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E8=BD=A6=E5=9E=8B=E7=9A=84=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=95=B0=E6=8D=AE=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionSplitOrderDetailEntity.java | 91 +++++++++++++ .../DistributionSplitOrderLogEntity.java | 85 ++++++++++++ .../DistributionSplitOrderTaskEntity.java | 126 ++++++++++++++++++ .../DistributionSplitOrderTaskMapper.java | 7 + .../IDistributionSplitOrderTaskService.java | 65 +++++++++ ...DistributionSplitOrderTaskServiceImpl.java | 78 +++++++++++ 6 files changed, 452 insertions(+) create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderDetailEntity.java create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderLogEntity.java create mode 100644 blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderTaskEntity.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSplitOrderTaskMapper.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java create mode 100644 blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderDetailEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderDetailEntity.java new file mode 100644 index 000000000..554762d04 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderDetailEntity.java @@ -0,0 +1,91 @@ +/* + * 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.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * 常规订单拆单明细 实体类 + * + * @author TJJ + * @since 2023-09-11 + */ +@Data +@TableName("logpm_distribution_split_order_detail") +@ApiModel(value = "logpmDistributionSplitOrderDetail对象", description = "常规订单拆单明细表") +@EqualsAndHashCode(callSuper = true) +public class DistributionSplitOrderDetailEntity extends TenantEntity { + + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private Long id; + + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + + @ApiModelProperty(value = "任务ID") + private Long splitOrderTaskId; + + @ApiModelProperty(value = "包条") + private String orderPackageCode; + + @ApiModelProperty(value = "状态:1=待拆单,2=已拆单,3=驳回拆单,4=已撤回") + private Integer state; + + @ApiModelProperty(value = "撤回人员ID") + private Long cancelUser; + + @ApiModelProperty(value = "撤回人员") + private String cancelUsername; +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderLogEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderLogEntity.java new file mode 100644 index 000000000..f89323395 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderLogEntity.java @@ -0,0 +1,85 @@ +/* + * 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.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +/** + * 常规订单拆单日志 实体类 + * + * @author TJJ + * @since 2023-09-11 + */ +@Data +@TableName("logpm_distribution_split_order_log") +@ApiModel(value = "logpmDistributionSplitOrderLog对象", description = "常规订单拆单日志表") +@EqualsAndHashCode(callSuper = true) +public class DistributionSplitOrderLogEntity extends TenantEntity { + + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private Long id; + + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + + @ApiModelProperty(value = "任务ID") + private Long splitOrderTaskId; + + @ApiModelProperty(value = "日志内容") + private String content; + + @ApiModelProperty(value = "创建人名") + private String createUsername; +} diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderTaskEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderTaskEntity.java new file mode 100644 index 000000000..a2c5cd912 --- /dev/null +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSplitOrderTaskEntity.java @@ -0,0 +1,126 @@ +/* + * 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.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.tenant.mp.TenantEntity; + +import javax.validation.constraints.NotBlank; +import java.math.BigDecimal; + +/** + * 常规订单拆单任务 实体类 + * + * @author TJJ + * @since 2023-09-11 + */ +@Data +@TableName("logpm_distribution_split_order_task") +@ApiModel(value = "logpmDistributionSplitOrderTask对象", description = "常规订单拆单任务表") +@EqualsAndHashCode(callSuper = true) +public class DistributionSplitOrderTaskEntity extends TenantEntity { + + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "主键") + @TableId(value = "id", type = IdType.ASSIGN_ID) + private Long id; + + /** + * 预留1 + */ + @ApiModelProperty(value = "预留1") + private String reserve1; + /** + * 预留2 + */ + @ApiModelProperty(value = "预留2") + private String reserve2; + /** + * 预留3 + */ + @ApiModelProperty(value = "预留3") + private String reserve3; + /** + * 预留4 + */ + @ApiModelProperty(value = "预留4") + private String reserve4; + /** + * 预留5 + */ + @ApiModelProperty(value = "预留5") + private String reserve5; + + @NotBlank(message = "被拆订单ID不能为空") + @ApiModelProperty(value = "被拆订单ID") + private Long stockArticleId; + + @ApiModelProperty(value = "被拆订单") + private String orderCode; + + @ApiModelProperty(value = "商场名称") + private String mallName; + + @ApiModelProperty(value = "状态:1=待审核,2=同意拆单,3=驳回拆单,4=撤回") + private Integer state; + + @ApiModelProperty(value = "原因") + private String reason; + + @ApiModelProperty(value = "审核人") + private Long reviewerUser; + + @ApiModelProperty(value = "审核人名字") + private String reviewerUsername; + + @ApiModelProperty(value = "审核时间") + private String reviewTime; + + @ApiModelProperty(value = "拆单数量") + private Integer number; + + @NotBlank(message = "新的客户姓名不能为空") + @ApiModelProperty(value = "新的客户姓名") + private String customerName; + + @NotBlank(message = "新的客户联系方式不能为空") + @ApiModelProperty(value = "新的客户联系方式") + private String customerTelephone; + + @NotBlank(message = "新的客户地址不能为空") + @ApiModelProperty(value = "新的客户地址") + private String customerAddress; + + @ApiModelProperty(value = "新的订单") + private String newOrderCode; + + @ApiModelProperty(value = "新的订单ID") + private Long newStockArticleId; + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSplitOrderTaskMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSplitOrderTaskMapper.java new file mode 100644 index 000000000..235b26557 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSplitOrderTaskMapper.java @@ -0,0 +1,7 @@ +package com.logpm.distribution.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.distribution.entity.DistributionSplitOrderTaskEntity; + +public interface DistributionSplitOrderTaskMapper extends BaseMapper { +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java new file mode 100644 index 000000000..733e692f6 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSplitOrderTaskService.java @@ -0,0 +1,65 @@ +package com.logpm.distribution.service; + + +import com.logpm.distribution.entity.DistributionSplitOrderTaskEntity; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; + +import java.util.List; + +/** + * 拆单任务接口 + */ +public interface IDistributionSplitOrderTaskService { + + /** + * 拆单任务列表 + * @param query + * @param distributionSplitOrderTaskEntity + * @return + */ + R> taskList(Query query, DistributionSplitOrderTaskEntity distributionSplitOrderTaskEntity); + + /** + * 创建任务 + * @param distributionSplitOrderTaskEntity + * @return + */ + R createTask(DistributionSplitOrderTaskEntity distributionSplitOrderTaskEntity, List packageCodeList); + + /** + * 更新任务 + * @param distributionSplitOrderTaskEntity + * @return + */ + R updateTask(DistributionSplitOrderTaskEntity distributionSplitOrderTaskEntity, List packageCodeList); + + /** + * 整单撤回任务 + * @param taskId + * @return + */ + R cancelTask(Long taskId); + + /** + * 单个包撤回任务 + * @param taskId + * @param packageCode + * @return + */ + R cancelPackageCode(Long taskId, String packageCode); + + /** + * 审核任务 + * @param taskId + * @return + */ + R reviewTask(Long taskId); + + /** + * 获取任务详情 + * @param taskId + * @return + */ + R getTaskDetail(Long taskId); +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java new file mode 100644 index 000000000..bfeea7ab8 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java @@ -0,0 +1,78 @@ +package com.logpm.distribution.service.impl; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.logpm.distribution.entity.DistributionParcelListEntity; +import com.logpm.distribution.entity.DistributionSplitOrderTaskEntity; +import com.logpm.distribution.entity.DistributionStockArticleEntity; +import com.logpm.distribution.mapper.DistributionSplitOrderTaskMapper; +import com.logpm.distribution.service.IDistributionSplitOrderTaskService; +import groovy.util.logging.Slf4j; +import lombok.AllArgsConstructor; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@AllArgsConstructor +@Slf4j +public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl implements IDistributionSplitOrderTaskService { + + private DistributionStockArticleServiceImpl distributionStockArticleService; + private DistributionParcelListServiceImpl distributionParcelListService; + + @Override + public R> taskList(Query query, DistributionSplitOrderTaskEntity distributionSplitOrderTaskEntity) { + return null; + } + + @Override + public R createTask(DistributionSplitOrderTaskEntity distributionSplitOrderTaskEntity, List packageCodeList) { + try { + DistributionStockArticleEntity distributionStockArticle = distributionStockArticleService.getById(distributionSplitOrderTaskEntity.getStockArticleId()); + if (distributionStockArticle == null) { + return R.fail("原订单信息错误"); + } + List packageCode = distributionParcelListService.list(Wrappers.lambdaQuery() + .eq(DistributionParcelListEntity::getStockArticleId, distributionSplitOrderTaskEntity.getStockArticleId()) + .in(DistributionParcelListEntity::getOrderPackageCode, packageCodeList) + ); + if (packageCode.size() != packageCodeList.size()) { + return R.fail("订单包件信息错误"); + } + + + return R.data(""); + } catch (Exception e) { + log.error("createTask error", e); + return R.fail("createTask error"); + } + } + + @Override + public R updateTask(DistributionSplitOrderTaskEntity distributionSplitOrderTaskEntity, List packageCodeList) { + return null; + } + + @Override + public R cancelTask(Long taskId) { + return null; + } + + @Override + public R cancelPackageCode(Long taskId, String packageCode) { + return null; + } + + @Override + public R reviewTask(Long taskId) { + return null; + } + + @Override + public R getTaskDetail(Long taskId) { + return null; + } +}