24282 1 anno fa
parent
commit
8d92d3085c
26 ha cambiato i file con 555 aggiunte e 42 eliminazioni
  1. 71 0
      sd-business/src/main/java/com/sd/business/controller/express/ExpressDeliveryController.java
  2. 2 1
      sd-business/src/main/java/com/sd/business/controller/order/OrderController.java
  3. 17 0
      sd-business/src/main/java/com/sd/business/entity/express/dto/ExpressDeliveryDto.java
  4. 17 0
      sd-business/src/main/java/com/sd/business/entity/express/dto/ExpressDeliverySelectDto.java
  5. 91 0
      sd-business/src/main/java/com/sd/business/entity/express/po/ExpressDelivery.java
  6. 17 0
      sd-business/src/main/java/com/sd/business/entity/express/vo/ExpressDeliveryVo.java
  7. 12 0
      sd-business/src/main/java/com/sd/business/entity/order/dto/OrderInfoDto.java
  8. 10 0
      sd-business/src/main/java/com/sd/business/entity/order/dto/OrderSkuDto.java
  9. 1 2
      sd-business/src/main/java/com/sd/business/entity/order/enums/OrderStatusEnum.java
  10. 18 0
      sd-business/src/main/java/com/sd/business/entity/order/po/OrderInfo.java
  11. 11 1
      sd-business/src/main/java/com/sd/business/entity/order/po/OrderSku.java
  12. 4 0
      sd-business/src/main/java/com/sd/business/entity/order/po/OrderSkuBom.java
  13. 5 0
      sd-business/src/main/java/com/sd/business/entity/production/po/ProductionTask.java
  14. 1 1
      sd-business/src/main/java/com/sd/business/entity/production/po/ProductionWorkOrder.java
  15. 18 0
      sd-business/src/main/java/com/sd/business/entity/production/vo/ProductionTaskVo.java
  16. 26 0
      sd-business/src/main/java/com/sd/business/mapper/express/ExpressDeliveryMapper.java
  17. 5 0
      sd-business/src/main/java/com/sd/business/service/bom/BomClassifyService.java
  18. 8 0
      sd-business/src/main/java/com/sd/business/service/bom/impl/BomClassifyServiceImpl.java
  19. 4 1
      sd-business/src/main/java/com/sd/business/service/bom/impl/BomServiceImpl.java
  20. 46 0
      sd-business/src/main/java/com/sd/business/service/express/ExpressDeliveryService.java
  21. 57 0
      sd-business/src/main/java/com/sd/business/service/express/impl/ExpressDeliveryServiceImpl.java
  22. 48 0
      sd-business/src/main/java/com/sd/business/service/order/impl/OrderServiceImpl.java
  23. 25 21
      sd-business/src/main/java/com/sd/business/service/production/impl/StockPreparationServiceImpl.java
  24. 1 0
      sd-business/src/main/java/com/sd/business/util/CodeEnum.java
  25. 28 0
      sd-business/src/main/resources/mapper/express/ExpressDeliveryMapper.xml
  26. 12 15
      sd-business/src/main/resources/mapper/production/ProductionTaskMapper.xml

+ 71 - 0
sd-business/src/main/java/com/sd/business/controller/express/ExpressDeliveryController.java

@@ -0,0 +1,71 @@
+package com.sd.business.controller.express;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.sd.business.entity.express.dto.ExpressDeliveryDto;
+import com.sd.business.entity.express.dto.ExpressDeliverySelectDto;
+import com.sd.business.entity.express.vo.ExpressDeliveryVo;
+import com.sd.business.service.express.ExpressDeliveryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * <p>
+ * 快递网点 前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2023-07-21
+ */
+@RestController
+@RequestMapping("/expressDelivery")
+public class ExpressDeliveryController {
+
+    @Autowired
+    private ExpressDeliveryService expressDeliveryService;
+
+    /**
+     * 快递网点分页
+     */
+    @PostMapping("/page")
+    public Page<ExpressDeliveryVo> page(@RequestBody ExpressDeliverySelectDto dto) {
+        return expressDeliveryService.getPage(dto);
+    }
+
+    /**
+     * 快递网点明细
+     */
+    @PostMapping("/detail")
+    public ExpressDeliveryVo detail(@RequestBody BaseSelectDto dto) {
+        return expressDeliveryService.detail(dto.getId());
+    }
+
+    /**
+     * 快递网点新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody ExpressDeliveryDto expressDeliveryDto) {
+        expressDeliveryService.add(expressDeliveryDto);
+    }
+
+    /**
+     * 快递网点编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody ExpressDeliveryDto expressDeliveryDto) {
+        expressDeliveryService.edit(expressDeliveryDto);
+    }
+
+    /**
+     * 快递网点删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        expressDeliveryService.delete(dto.getId());
+    }
+
+}

+ 2 - 1
sd-business/src/main/java/com/sd/business/controller/order/OrderController.java

@@ -7,6 +7,7 @@ import com.sd.business.entity.order.dto.OrderSelectDto;
 import com.sd.business.entity.order.vo.OrderInfoVo;
 import com.sd.business.service.order.OrderService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -47,7 +48,7 @@ public class OrderController {
      * 订单新增
      */
     @PostMapping("/add")
-    public void add(@RequestBody OrderInfoDto orderDto) {
+    public void add(@Validated @RequestBody OrderInfoDto orderDto) {
         orderService.add(orderDto);
     }
 

+ 17 - 0
sd-business/src/main/java/com/sd/business/entity/express/dto/ExpressDeliveryDto.java

@@ -0,0 +1,17 @@
+package com.sd.business.entity.express.dto;
+
+import com.sd.business.entity.express.po.ExpressDelivery;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 快递网点新增编辑入参实体
+ *
+ * @author
+ * @since 2023-07-21
+ */
+@Getter
+@Setter
+public class ExpressDeliveryDto extends ExpressDelivery {
+
+}

+ 17 - 0
sd-business/src/main/java/com/sd/business/entity/express/dto/ExpressDeliverySelectDto.java

@@ -0,0 +1,17 @@
+package com.sd.business.entity.express.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 快递网点列表查询入参实体
+ *
+ * @author
+ * @since 2023-07-21
+ */
+@Getter
+@Setter
+public class ExpressDeliverySelectDto extends BaseSelectDto {
+
+}

+ 91 - 0
sd-business/src/main/java/com/sd/business/entity/express/po/ExpressDelivery.java

@@ -0,0 +1,91 @@
+package com.sd.business.entity.express.po;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.core.domain.BasePo;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 快递网点
+ * </p>
+ *
+ * @author
+ * @since 2023-07-21
+ */
+@Getter
+@Setter
+@TableName("express_delivery")
+public class ExpressDelivery extends BasePo {
+
+    /**
+     * 电话
+     */
+    private String phone;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 省
+     */
+    private String province;
+
+    /**
+     * 市
+     */
+    private String city;
+
+    /**
+     * 区
+     */
+    private String district;
+
+    /**
+     * 地址
+     */
+    private String address;
+
+    /**
+     * 快递
+     */
+    private String expressage;
+
+    /**
+     * 快递编码
+     */
+    private String expressageCode;
+
+    /**
+     * 快递网点
+     */
+    private String branch;
+
+    /**
+     * 网点编码
+     */
+    private String branchCode;
+
+    /**
+     * 面单模板地址
+     */
+    private String templateUrl;
+
+    /**
+     * 自定义模板地址
+     */
+    private String customTemplateUrl;
+
+    /**
+     * 取号模式 字典
+     */
+    private String takeNum;
+
+    /**
+     * 打印机
+     */
+    private String printer;
+
+}

+ 17 - 0
sd-business/src/main/java/com/sd/business/entity/express/vo/ExpressDeliveryVo.java

@@ -0,0 +1,17 @@
+package com.sd.business.entity.express.vo;
+
+import com.sd.business.entity.express.po.ExpressDelivery;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 快递网点列表查询返回值实体
+ *
+ * @author
+ * @since 2023-07-21
+ */
+@Getter
+@Setter
+public class ExpressDeliveryVo extends ExpressDelivery {
+
+}

+ 12 - 0
sd-business/src/main/java/com/sd/business/entity/order/dto/OrderInfoDto.java

@@ -4,6 +4,10 @@ import com.sd.business.entity.order.po.OrderInfo;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.Valid;
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
+
 /**
  * 订单新增编辑入参实体
  *
@@ -19,4 +23,12 @@ public class OrderInfoDto extends OrderInfo {
      */
     private Integer updateType;
 
+    /**
+     * 订单商品
+     */
+    @Valid
+    @NotEmpty(message = "产品列表不能为空")
+    private List<OrderSkuDto> orderSkuList;
+
+
 }

+ 10 - 0
sd-business/src/main/java/com/sd/business/entity/order/dto/OrderSkuDto.java

@@ -1,9 +1,13 @@
 package com.sd.business.entity.order.dto;
 
 import com.sd.business.entity.order.po.OrderSku;
+import com.sd.business.entity.order.po.OrderSkuBom;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.Valid;
+import java.util.List;
+
 /**
  * 订单sku新增编辑入参实体
  *
@@ -24,4 +28,10 @@ public class OrderSkuDto extends OrderSku {
      */
     private String orderCode;
 
+    /**
+     * 订单包材
+     */
+    @Valid
+    private List<OrderSkuBom> orderSkuBomList;
+
 }

+ 1 - 2
sd-business/src/main/java/com/sd/business/entity/order/enums/OrderStatusEnum.java

@@ -18,8 +18,7 @@ public enum OrderStatusEnum {
     STOCK_PREPARATION(20, "备料中"),
     IN_PRODUCTION(30, "生产中"),
     COMPLETION_PRODUCTION(40, "生产完成"),
-    TO_BE_SENT(50, "待发货"),
-    HAVE_BEEN_SHIPPED(60, "已发货"),
+    HAVE_BEEN_SHIPPED(50, "已发货"),
 
     DELETE(90, "订单删除审核中"),
     EXCEPTION(99, "订单异常");

+ 18 - 0
sd-business/src/main/java/com/sd/business/entity/order/po/OrderInfo.java

@@ -5,6 +5,8 @@ import com.ruoyi.common.core.domain.BasePo;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -89,6 +91,7 @@ public class OrderInfo extends BasePo {
     /**
      * 进度 {@link com.sd.business.entity.order.enums.OrderStatusEnum}
      */
+    @NotNull(message = "订单进度不能为空")
     private Integer status;
 
     /**
@@ -99,41 +102,49 @@ public class OrderInfo extends BasePo {
     /**
      * 电商平台
      */
+    @NotBlank(message = "电商平台不能为空")
     private String commercePlatform;
 
     /**
      * 订单总金额
      */
+    @NotNull(message = "订单总金额不能为空")
     private BigDecimal totalAmount;
 
     /**
      * 产品总金额
      */
+    @NotNull(message = "产品总金额不能为空")
     private BigDecimal productTotalAmount;
 
     /**
      * 定制加工费
      */
+    @NotNull(message = "定制加工费不能为空")
     private BigDecimal customProcessingFee;
 
     /**
      * 代发费
      */
+    @NotNull(message = "代发费不能为空")
     private BigDecimal lssueFee;
 
     /**
      * 快递包材费
      */
+    @NotNull(message = "快递包材费不能为空")
     private BigDecimal deliveryMaterialsFee;
 
     /**
      * 包装人工费
      */
+    @NotNull(message = "包装人工费不能为空")
     private BigDecimal packingLabor;
 
     /**
      * 包材费
      */
+    @NotNull(message = "包材费不能为空")
     private BigDecimal packagingMaterialCost;
 
     /**
@@ -144,21 +155,25 @@ public class OrderInfo extends BasePo {
     /**
      * 发货时间
      */
+    @NotNull(message = "交货时间不能为空")
     private Date shippingTime;
 
     /**
      * 收货人
      */
+    @NotBlank(message = "联系人不能为空")
     private String consignee;
 
     /**
      * 收货人电话
      */
+    @NotBlank(message = "联系电话不能为空")
     private String consigneeNumber;
 
     /**
      * 省
      */
+    @NotBlank(message = "省不能为空")
     private String province;
 
     /**
@@ -174,16 +189,19 @@ public class OrderInfo extends BasePo {
     /**
      * 详细地址
      */
+    @NotBlank(message = "详细地址不能为空")
     private String detailedAddress;
 
     /**
      * 邮编
      */
+    @NotBlank(message = "邮编不能为空")
     private String postcode;
 
     /**
      * 事业部id
      */
+    @NotNull(message = "事业部id不能为空")
     private Long departmentId;
 
     /**

+ 11 - 1
sd-business/src/main/java/com/sd/business/entity/order/po/OrderSku.java

@@ -5,6 +5,7 @@ import com.ruoyi.common.core.domain.BasePo;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -29,11 +30,13 @@ public class OrderSku extends BasePo {
     /**
      * sku id
      */
+    @NotNull(message = "skuId不能为空")
     private Long skuId;
 
     /**
      * sku规格id
      */
+    @NotNull(message = "sku规格Id不能为空")
     private Long skuSpecId;
 
     /**
@@ -54,36 +57,43 @@ public class OrderSku extends BasePo {
     /**
      * 数量
      */
+    @NotNull(message = "数量不能为空")
     private BigDecimal quantity;
 
     /**
      * 定制加工费
      */
+    @NotNull(message = "定制加工费不能为空")
     private BigDecimal customProcessingFee;
 
     /**
      * 代发费
      */
+    @NotNull(message = "代发费不能为空")
     private BigDecimal lssueFee;
 
     /**
      * 快递包材费
      */
+    @NotNull(message = "快递包材费不能为空")
     private BigDecimal deliveryMaterialsFee;
 
     /**
      * 包装人工费
      */
+    @NotNull(message = "包装人工费不能为空")
     private BigDecimal packingLabor;
 
     /**
      * 单价
      */
+    @NotNull(message = "单价不能为空")
     private BigDecimal unitPrice;
 
     /**
-     * 标识 1单面 2 双面
+     * 打印 1单面 2 双面
      */
+    @NotNull(message = "打印类型不能为空")
     private Integer printType;
 
     /**

+ 4 - 0
sd-business/src/main/java/com/sd/business/entity/order/po/OrderSkuBom.java

@@ -5,6 +5,7 @@ import com.ruoyi.common.core.domain.BasePo;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 
 /**
@@ -33,16 +34,19 @@ public class OrderSkuBom extends BasePo {
     /**
      * bom规格id
      */
+    @NotNull(message = "bom规格id不能为空")
     private Long bomSpecId;
 
     /**
      * 单价
      */
+    @NotNull(message = "单价不能为空")
     private BigDecimal unitPrice;
 
     /**
      * 数量
      */
+    @NotNull(message = "数量不能为空")
     private BigDecimal quantity;
 
 }

+ 5 - 0
sd-business/src/main/java/com/sd/business/entity/production/po/ProductionTask.java

@@ -47,6 +47,11 @@ public class ProductionTask extends BasePo {
     private String machinedPanel;
 
     /**
+     * 打印 1单面 2 双面
+     */
+    private Integer printType;
+
+    /**
      * 生产数量
      */
     private BigDecimal productionQuantity;

+ 1 - 1
sd-business/src/main/java/com/sd/business/entity/production/po/ProductionWorkOrder.java

@@ -31,7 +31,7 @@ public class ProductionWorkOrder extends BasePo {
     private String code;
 
     /**
-     * 状态 1待投产
+     * 状态 0待投产
      */
     private Integer status;
 

+ 18 - 0
sd-business/src/main/java/com/sd/business/entity/production/vo/ProductionTaskVo.java

@@ -4,6 +4,8 @@ import com.sd.business.entity.production.po.ProductionTask;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.util.Date;
+
 /**
  * 生产任务列表查询返回值实体
  *
@@ -54,4 +56,20 @@ public class ProductionTaskVo extends ProductionTask {
      */
     private String bomSpecName;
 
+    /**
+     * 下单时间
+     */
+    private Date wlnCreateTime;
+
+    /**
+     * 交期
+     */
+    private Date deliveryTime;
+
+    /**
+     * 工艺路线
+     */
+    private String craftProductionLine;
+
+
 }

+ 26 - 0
sd-business/src/main/java/com/sd/business/mapper/express/ExpressDeliveryMapper.java

@@ -0,0 +1,26 @@
+package com.sd.business.mapper.express;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.sd.business.entity.express.po.ExpressDelivery;
+import com.sd.business.entity.express.vo.ExpressDeliveryVo;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 快递网点 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2023-07-21
+ */
+public interface ExpressDeliveryMapper extends BaseMapper<ExpressDelivery> {
+
+    /**
+     * 快递网点分页
+     */
+    Page<ExpressDeliveryVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<ExpressDelivery> wrapper);
+
+}

+ 5 - 0
sd-business/src/main/java/com/sd/business/service/bom/BomClassifyService.java

@@ -50,4 +50,9 @@ public interface BomClassifyService extends BaseService<BomClassify> {
      */
     List<Long> getChildrenIdList(Long parentId);
 
+    /**
+     * 获取子集id
+     */
+    List<Long> getChildrenIdList(List<Long> parentIdList);
+
 }

+ 8 - 0
sd-business/src/main/java/com/sd/business/service/bom/impl/BomClassifyServiceImpl.java

@@ -83,6 +83,14 @@ public class BomClassifyServiceImpl extends ServiceImpl<BomClassifyMapper, BomCl
         return childrenIdList;
     }
 
+    @Override
+    public List<Long> getChildrenIdList(List<Long> parentIdList) {
+        List<BomClassify> list = list();
+        List<Long> childrenIdList = new ArrayList<>();
+        parentIdList.forEach(item -> getChildrenIdList(item, childrenIdList, list));
+        return childrenIdList;
+    }
+
     /**
      * 递归添加子集节点id
      */

+ 4 - 1
sd-business/src/main/java/com/sd/business/service/bom/impl/BomServiceImpl.java

@@ -71,7 +71,6 @@ public class BomServiceImpl extends ServiceImpl<BomMapper, Bom> implements BomSe
         wrapper.eq("b", Bom::getEmbossingProcess, dto.getEmbossingProcess());
         wrapper.eq("b", Bom::getFrontGrain, dto.getFrontGrain());
         wrapper.eq("b", Bom::getReverseGrain, dto.getReverseGrain());
-        wrapper.eq("b", Bom::getBomClassifyId, dto.getBomClassifyIdList());
         if (StrUtil.isNotBlank(dto.getColour())) {
             List<Long> bomIdList = bomSpecService.listObject(BomSpec::getBomId, i -> i.like(BomSpec::getColour, dto.getColour()));
             if (bomIdList.size() == 0) {
@@ -83,6 +82,10 @@ public class BomServiceImpl extends ServiceImpl<BomMapper, Bom> implements BomSe
             List<Long> childrenIdList = bomClassifyService.getChildrenIdList(dto.getBomClassifyId());
             wrapper.in("b", Bom::getBomClassifyId, childrenIdList);
         }
+        if (ObjectUtil.isNotNull(dto.getBomClassifyIdList())) {
+            List<Long> childrenIdList = bomClassifyService.getChildrenIdList(dto.getBomClassifyIdList());
+            wrapper.in("b", Bom::getBomClassifyId, childrenIdList);
+        }
 
         Page<BomVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         List<BomVo> records = page.getRecords();

+ 46 - 0
sd-business/src/main/java/com/sd/business/service/express/ExpressDeliveryService.java

@@ -0,0 +1,46 @@
+package com.sd.business.service.express;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.service.BaseService;
+import com.sd.business.entity.express.dto.ExpressDeliveryDto;
+import com.sd.business.entity.express.dto.ExpressDeliverySelectDto;
+import com.sd.business.entity.express.po.ExpressDelivery;
+import com.sd.business.entity.express.vo.ExpressDeliveryVo;
+
+
+/**
+ * <p>
+ * 快递网点 服务类
+ * </p>
+ *
+ * @author
+ * @since 2023-07-21
+ */
+public interface ExpressDeliveryService extends BaseService<ExpressDelivery> {
+
+    /**
+     * 快递网点分页
+     */
+    Page<ExpressDeliveryVo> getPage(ExpressDeliverySelectDto dto);
+
+    /**
+     * 快递网点明细
+     */
+    ExpressDeliveryVo detail(Long id);
+
+    /**
+     * 快递网点新增
+     */
+    void add(ExpressDeliveryDto expressDeliveryDto);
+
+    /**
+     * 快递网点编辑
+     */
+    void edit(ExpressDeliveryDto expressDeliveryDto);
+
+    /**
+     * 快递网点删除
+     */
+    void delete(Long id);
+
+}

+ 57 - 0
sd-business/src/main/java/com/sd/business/service/express/impl/ExpressDeliveryServiceImpl.java

@@ -0,0 +1,57 @@
+package com.sd.business.service.express.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.sd.business.entity.express.dto.ExpressDeliveryDto;
+import com.sd.business.entity.express.dto.ExpressDeliverySelectDto;
+import com.sd.business.entity.express.po.ExpressDelivery;
+import com.sd.business.entity.express.vo.ExpressDeliveryVo;
+import com.sd.business.mapper.express.ExpressDeliveryMapper;
+import com.sd.business.service.express.ExpressDeliveryService;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * <p>
+ * 快递网点 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2023-07-21
+ */
+@Service
+public class ExpressDeliveryServiceImpl extends ServiceImpl<ExpressDeliveryMapper, ExpressDelivery> implements ExpressDeliveryService {
+
+    @Override
+    public Page<ExpressDeliveryVo> getPage(ExpressDeliverySelectDto dto) {
+        IWrapper<ExpressDelivery> wrapper = getWrapper();
+        wrapper.orderByDesc("ed", ExpressDelivery::getId);
+        Page<ExpressDeliveryVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public ExpressDeliveryVo detail(Long id) {
+        ExpressDelivery ExpressDelivery = this.getById(id);
+        ExpressDeliveryVo result = BeanUtil.toBean(ExpressDelivery, ExpressDeliveryVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(ExpressDeliveryDto expressDeliveryDto) {
+        this.save(expressDeliveryDto);
+    }
+
+    @Override
+    public void edit(ExpressDeliveryDto expressDeliveryDto) {
+        this.updateById(expressDeliveryDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 48 - 0
sd-business/src/main/java/com/sd/business/service/order/impl/OrderServiceImpl.java

@@ -1,13 +1,16 @@
 package com.sd.business.service.order.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.constant.StatusConstant;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.sd.business.entity.department.po.Department;
 import com.sd.business.entity.order.dto.OrderInfoDto;
 import com.sd.business.entity.order.dto.OrderSelectDto;
+import com.sd.business.entity.order.dto.OrderSkuDto;
 import com.sd.business.entity.order.po.OrderInfo;
 import com.sd.business.entity.order.po.OrderOperatingLog;
 import com.sd.business.entity.order.po.OrderSku;
@@ -27,7 +30,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
 import java.util.Collections;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -121,13 +126,56 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void add(OrderInfoDto orderDto) {
+        orderDto.setSource(1);
+        orderDto.setCode("PI" + new Date().getTime());
+        orderDto.setDeliveryTime(DateUtil.offsetDay(new Date(), 1));
+        orderDto.setSettlementStatus(1);
+        orderDto.setTaxRate(new BigDecimal("10.00"));
+        orderDto.setTag("0");
         this.save(orderDto);
+
+        List<OrderSkuDto> orderSkuList = orderDto.getOrderSkuList();
+        List<OrderSku> tempOrderSkuList = orderSkuList.stream()
+                .peek(item -> item.setOrderId(orderDto.getId()))
+                .peek(item -> item.setStockPreparationStatus(StatusConstant.NO))
+                .map(item -> (OrderSku) item)
+                .collect(Collectors.toList());
+        orderSkuService.saveBatch(tempOrderSkuList);
+
+        List<OrderSkuBom> orderSkuBomList = orderSkuList.stream()
+                .peek(item -> item.setOrderId(orderDto.getId()))
+                .flatMap(orderSku -> orderSku.getOrderSkuBomList()
+                        .stream().peek(orderSkuBom -> orderSkuBom.setOrderSkuId(orderSku.getId())))
+                .collect(Collectors.toList());
+        orderSkuBomService.saveBatch(orderSkuBomList);
+
+        OrderOperatingLog orderOperatingLog = new OrderOperatingLog();
+        orderOperatingLog.setType(10);
+        orderOperatingLog.setOrderId(orderDto.getId());
+        orderOperatingLog.setOrderCode(orderDto.getCode());
+        orderOperatingLogService.save(orderOperatingLog);
     }
 
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void edit(OrderInfoDto orderDto) {
         this.updateById(orderDto);
+
+        List<OrderSkuDto> orderSkuList = orderDto.getOrderSkuList();
+        List<OrderSku> tempOrderSkuList = orderSkuList.stream()
+                .peek(item -> item.setOrderId(orderDto.getId()))
+                .peek(item -> item.setStockPreparationStatus(StatusConstant.NO))
+                .map(item -> (OrderSku) item)
+                .collect(Collectors.toList());
+        orderSkuService.saveOrUpdateBatch(tempOrderSkuList);
+
+        List<OrderSkuBom> orderSkuBomList = orderSkuList.stream()
+                .peek(item -> item.setOrderId(orderDto.getId()))
+                .flatMap(orderSku -> orderSku.getOrderSkuBomList()
+                        .stream().peek(orderSkuBom -> orderSkuBom.setOrderSkuId(orderSku.getId())))
+                .collect(Collectors.toList());
+        orderSkuBomService.saveOrUpdateBatch(orderSkuBomList);
+
         OrderOperatingLog orderOperatingLog = new OrderOperatingLog();
         orderOperatingLog.setType(orderDto.getUpdateType());
         orderOperatingLog.setOrderId(orderDto.getId());

+ 25 - 21
sd-business/src/main/java/com/sd/business/service/production/impl/StockPreparationServiceImpl.java

@@ -173,40 +173,44 @@ public class StockPreparationServiceImpl implements StockPreparationService {
                                      List<ProductionWorkOrder> productionWorkOrderList) {
 
         OrderInfo orderInfo = orderService.getById(orderId);
-        HashMap<Long, ProductionTask> skuSpecIdProductionTaskMap = new HashMap<>();
+        Map<String, ProductionTask> skuSpecIdProductionTaskMap = new HashMap<>();
         int num = 1;
 
         for (OrderSku orderSku : orderSkuList) {
 
             Long skuSpecId = orderSku.getSkuSpecId();
             BigDecimal quantity = orderSku.getQuantity();
-
-            ProductionTask productionTask = skuSpecIdProductionTaskMap.computeIfAbsent(skuSpecId, item -> {
-                SkuSpec skuSpec = skuSpecService.getById(skuSpecId);
-                Sku sku = skuService.getById(skuSpec.getSkuId());
-
-                ProductionTask tempProductionTask = new ProductionTask();
-                tempProductionTask.setId(IdWorker.getId());
-                tempProductionTask.setOrderId(orderSku.getOrderId());
-                tempProductionTask.setSkuSpecId(skuSpecId);
-                tempProductionTask.setBomSpecId(skuSpec.getBomSpecId());
-                tempProductionTask.setCraftProductionLineId(sku.getCraftProductionLineId());
-                tempProductionTask.setMachinedPanel(skuSpec.getMachinedPanel());
-                tempProductionTask.setProductionQuantity(BigDecimal.ZERO);
-                tempProductionTask.setCompleteQuantity(BigDecimal.ZERO);
-
-                productionTaskList.add(tempProductionTask);
-
-                return tempProductionTask;
-            });
+            Integer printType = orderSku.getPrintType();
+
+            ProductionTask productionTask = skuSpecIdProductionTaskMap.computeIfAbsent(
+                    skuSpecId + ":" + printType,
+                    item -> {
+                        SkuSpec skuSpec = skuSpecService.getById(skuSpecId);
+                        Sku sku = skuService.getById(skuSpec.getSkuId());
+
+                        ProductionTask tempProductionTask = new ProductionTask();
+                        tempProductionTask.setId(IdWorker.getId());
+                        tempProductionTask.setOrderId(orderSku.getOrderId());
+                        tempProductionTask.setSkuSpecId(skuSpecId);
+                        tempProductionTask.setBomSpecId(skuSpec.getBomSpecId());
+                        tempProductionTask.setCraftProductionLineId(sku.getCraftProductionLineId());
+                        tempProductionTask.setMachinedPanel(skuSpec.getMachinedPanel());
+                        tempProductionTask.setPrintType(printType);
+                        tempProductionTask.setProductionQuantity(BigDecimal.ZERO);
+                        tempProductionTask.setCompleteQuantity(BigDecimal.ZERO);
+
+                        productionTaskList.add(tempProductionTask);
+
+                        return tempProductionTask;
+                    });
 
             productionTask.setProductionQuantity(productionTask.getProductionQuantity().add(quantity));
 
             for (int i = 0; i < quantity.intValue(); i++) {
                 ProductionWorkOrder productionWorkOrder = new ProductionWorkOrder();
                 productionWorkOrder.setProductionTaskId(productionTask.getId());
-                productionWorkOrder.setStatus(1);
                 productionWorkOrder.setCode(orderInfo.getCode() + String.format("-%05d", num));
+                productionWorkOrder.setStatus(0);
                 productionWorkOrderList.add(productionWorkOrder);
                 num++;
             }

+ 1 - 0
sd-business/src/main/java/com/sd/business/util/CodeEnum.java

@@ -38,6 +38,7 @@ public enum CodeEnum {
     private final String codeFieldName;
     // service
     private final IService<?> service;
+
     CodeEnum(String prefix, String dateFormat, String codeFieldName, Integer length, Class<? extends IService<?>> serviceCls) {
         this.prefix = prefix;
         this.dateFormat = dateFormat;

+ 28 - 0
sd-business/src/main/resources/mapper/express/ExpressDeliveryMapper.xml

@@ -0,0 +1,28 @@
+<?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.sd.business.mapper.express.ExpressDeliveryMapper">
+    <select id="getPage" resultType="com.sd.business.entity.express.vo.ExpressDeliveryVo">
+        select ed.id,
+               ed.phone,
+               ed.name,
+               ed.province,
+               ed.city,
+               ed.district,
+               ed.address,
+               ed.expressage,
+               ed.expressage_code,
+               ed.branch,
+               ed.branch_code,
+               ed.template_url,
+               ed.custom_template_url,
+               ed.take_num,
+               ed.printer,
+               ed.create_user,
+               ed.create_time,
+               ed.update_user,
+               ed.update_time
+        from express_delivery ed
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 12 - 15
sd-business/src/main/resources/mapper/production/ProductionTaskMapper.xml

@@ -1,35 +1,32 @@
 <?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.sd.business.mapper.production.ProductionTaskMapper">
+
     <select id="getPage" resultType="com.sd.business.entity.production.vo.ProductionTaskVo">
         select pt.id,
-               pt.order_id,
-               pt.sku_spec_id,
-               pt.bom_spec_id,
-               pt.craft_production_line_id,
-               pt.machined_panel,
-               pt.production_quantity,
-               pt.complete_quantity,
-               pt.complete_time,
-               pt.create_user,
-               pt.create_time,
-               pt.update_user,
-               pt.update_time,
-
                oi.blueprint,
                bs.main_img_url,
                oi.code     orderCode,
                oi.wln_code orderWlnCode,
                ss.code     skuSpecCode,
                ss.name     skuSpecName,
+               pt.production_quantity,
+               pt.complete_quantity,
+               pt.machined_panel,
+               pt.print_type,
                bs.code     bomSpecCode,
-               bs.name     bomSpecName
-
+               bs.name     bomSpecName,
+               oi.wln_create_time,
+               oi.delivery_time,
+               cpl.name    craftProductionLine,
+               pt.create_time,
+               pt.complete_time
         from production_task pt
                  left join sku_spec ss on pt.sku_spec_id = ss.id
                  left join sku s on ss.sku_id = s.id
                  left join bom_spec bs on ss.bom_spec_id = bs.id
                  left join order_info oi on pt.order_id = oi.id
+                 left join craft_production_line cpl on pt.craft_production_line_id = cpl.id
             ${ew.customSqlSegment}
     </select>