Commit d9823f41d468303ac3237f10370bbaa2648542bb

Authored by yeqianyong
2 parents 306ed1ab 0c26f571

Merge remote-tracking branch 'origin/master_0929' into master_0929

# Conflicts:
#	xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/order/PurchaseOrderInfoServiceImpl.java
Showing 36 changed files with 2241 additions and 19 deletions
@@ -249,4 +249,51 @@ create table `tbl_holidays` @@ -249,4 +249,51 @@ create table `tbl_holidays`
249 `update_by` varchar(20) not null comment '更新人', 249 `update_by` varchar(20) not null comment '更新人',
250 `create_time` datetime default now() comment '创建时间', 250 `create_time` datetime default now() comment '创建时间',
251 `update_time` datetime default now() comment '更新时间' 251 `update_time` datetime default now() comment '更新时间'
252 -) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '节假日' ROW_FORMAT = DYNAMIC;  
  252 +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '节假日' ROW_FORMAT = DYNAMIC;
  253 +
  254 +-- 补货单
  255 +DROP TABLE IF EXISTS `tbl_replenishment_order`;
  256 +create table `tbl_replenishment_order`
  257 +(
  258 + `id` varchar(32) primary key comment 'ID',
  259 + `code` varchar(50) NOT NULL COMMENT '编号',
  260 + `workshop_id` varchar(32) comment '分厂',
  261 + `dept_id` varchar(32) comment '办事处',
  262 + `customer_id` varchar(32) comment '购货单位',
  263 + `origin_plan_ship_date` DATE COMMENT '原计划发货日期',
  264 + `purchase_order_id` varchar(32) COMMENT '订货单',
  265 + `status` varchar(20) comment '状态',
  266 + `create_by_id` varchar(32) not null comment '创建人ID',
  267 + `create_by` varchar(20) not null comment '创建人',
  268 + `update_by_id` varchar(32) not null comment '更新人ID',
  269 + `update_by` varchar(20) not null comment '更新人',
  270 + `create_time` datetime default now() comment '创建时间',
  271 + `update_time` datetime default now() comment '更新时间'
  272 +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '补货单' ROW_FORMAT = DYNAMIC;
  273 +
  274 +-- 补货单物料行
  275 +DROP TABLE IF EXISTS `tbl_replenishment_order_line`;
  276 +create table `tbl_replenishment_order_line`
  277 +(
  278 + `id` varchar(32) primary key comment 'ID',
  279 + `replenishment_order_id` varchar(32) NOT NULL COMMENT '补货单',
  280 + `purchase_order_line_id` varchar(32) NOT NULL COMMENT '订货单表物料行ID',
  281 + `brand` varchar(100) COMMENT '牌号',
  282 + `thickness` decimal(10, 4) COMMENT '厚度',
  283 + `width` decimal(10, 4) COMMENT '宽度',
  284 + `length` decimal(10, 4) COMMENT '长度',
  285 + `status` varchar(50) COMMENT '状态',
  286 + `quantity` decimal(15, 4) COMMENT '需发(t)',
  287 + `shipped_quantity` decimal(15, 4) COMMENT '实发(t)',
  288 + `supplementary_quantity` decimal(15, 4) COMMENT '需求补发(t/件)',
  289 + `confirmed_delivery_date` DATE COMMENT '生产科确认交付日期',
  290 + `remarks` TEXT COMMENT '备注',
  291 + `show_order` INT DEFAULT 0 COMMENT '排序',
  292 + `item_id` varchar(50) COMMENT '前端用ID',
  293 + `create_by_id` varchar(32) not null comment '创建人ID',
  294 + `create_by` varchar(20) not null comment '创建人',
  295 + `update_by_id` varchar(32) not null comment '更新人ID',
  296 + `update_by` varchar(20) not null comment '更新人',
  297 + `create_time` datetime default now() comment '创建时间',
  298 + `update_time` datetime default now() comment '更新时间'
  299 +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '补货单物料行' ROW_FORMAT = DYNAMIC;
@@ -269,7 +269,7 @@ public class GetPurchaseOrderInfoBo extends BaseBo<PurchaseOrderInfo> { @@ -269,7 +269,7 @@ public class GetPurchaseOrderInfoBo extends BaseBo<PurchaseOrderInfo> {
269 /** 269 /**
270 * 是否展示审核按钮(非持久化字段) 270 * 是否展示审核按钮(非持久化字段)
271 */ 271 */
272 - @TableField(exist = false) 272 + @ApiModelProperty("是否展示审核按钮")
273 private Boolean showExamine; 273 private Boolean showExamine;
274 274
275 275
@@ -3,6 +3,8 @@ package com.lframework.xingyun.sc.bo.order; @@ -3,6 +3,8 @@ package com.lframework.xingyun.sc.bo.order;
3 import com.fasterxml.jackson.annotation.JsonFormat; 3 import com.fasterxml.jackson.annotation.JsonFormat;
4 import com.lframework.starter.common.constants.StringPool; 4 import com.lframework.starter.common.constants.StringPool;
5 import com.lframework.starter.web.core.bo.BaseBo; 5 import com.lframework.starter.web.core.bo.BaseBo;
  6 +
  7 +import java.math.BigDecimal;
6 import java.time.LocalDate; 8 import java.time.LocalDate;
7 import java.util.List; 9 import java.util.List;
8 import com.lframework.xingyun.sc.entity.PurchaseOrderRevoke; 10 import com.lframework.xingyun.sc.entity.PurchaseOrderRevoke;
@@ -51,6 +53,18 @@ public class GetPurchaseOrderRevokeBo extends BaseBo<PurchaseOrderRevoke> { @@ -51,6 +53,18 @@ public class GetPurchaseOrderRevokeBo extends BaseBo<PurchaseOrderRevoke> {
51 private String orderingUnitName; 53 private String orderingUnitName;
52 54
53 /** 55 /**
  56 + * 办事处
  57 + */
  58 + @ApiModelProperty("办事处")
  59 + private String deptId;
  60 +
  61 + /**
  62 + * 办事处名称(非持久化字段)
  63 + */
  64 + @ApiModelProperty("办事处名称")
  65 + private String deptName;
  66 +
  67 + /**
54 * 原订货日期 68 * 原订货日期
55 */ 69 */
56 @ApiModelProperty("原订货日期") 70 @ApiModelProperty("原订货日期")
@@ -96,12 +110,36 @@ public class GetPurchaseOrderRevokeBo extends BaseBo<PurchaseOrderRevoke> { @@ -96,12 +110,36 @@ public class GetPurchaseOrderRevokeBo extends BaseBo<PurchaseOrderRevoke> {
96 private String confirmationVoucherFileName; 110 private String confirmationVoucherFileName;
97 111
98 /** 112 /**
  113 + * 原总数量
  114 + */
  115 + @ApiModelProperty("原总数量")
  116 + private BigDecimal totalQuantity;
  117 +
  118 + /**
  119 + * 撤销总数量
  120 + */
  121 + @ApiModelProperty("撤销总数量")
  122 + private BigDecimal totalRevokeQuantity;
  123 +
  124 + /**
99 * 创建人(制单人) 125 * 创建人(制单人)
100 */ 126 */
101 @ApiModelProperty("创建人") 127 @ApiModelProperty("创建人")
102 private String createBy; 128 private String createBy;
103 129
104 /** 130 /**
  131 + * 是否为撤销单创建人
  132 + */
  133 + @ApiModelProperty("创建人")
  134 + private boolean revokeCreateBy;
  135 +
  136 + /**
  137 + * 是否展示审核按钮(非持久化字段)
  138 + */
  139 + @ApiModelProperty("是否展示审核按钮")
  140 + private Boolean showExamine;
  141 +
  142 + /**
105 * 订货单撤销表物料行 143 * 订货单撤销表物料行
106 */ 144 */
107 @ApiModelProperty("订货单撤销表物料行") 145 @ApiModelProperty("订货单撤销表物料行")
  1 +package com.lframework.xingyun.sc.bo.purchase;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.lframework.starter.common.constants.StringPool;
  5 +import com.lframework.starter.web.core.bo.BaseBo;
  6 +import com.lframework.xingyun.sc.entity.ReplenishmentOrder;
  7 +import io.swagger.annotations.ApiModelProperty;
  8 +import lombok.Data;
  9 +
  10 +import java.time.LocalDate;
  11 +import java.util.List;
  12 +
  13 +/**
  14 + * <p>
  15 + * 补货单 GetBo
  16 + * </p>
  17 + */
  18 +@Data
  19 +public class GetReplenishmentOrderBo extends BaseBo<ReplenishmentOrder> {
  20 +
  21 + /**
  22 + * ID
  23 + */
  24 + @ApiModelProperty("ID")
  25 + private String id;
  26 +
  27 + /**
  28 + * 编号
  29 + */
  30 + @ApiModelProperty("编号")
  31 + private String code;
  32 +
  33 + /**
  34 + * 分厂
  35 + */
  36 + @ApiModelProperty("分厂")
  37 + private String workshopId;
  38 +
  39 + /**
  40 + * 办事处
  41 + */
  42 + @ApiModelProperty("办事处")
  43 + private String deptId;
  44 +
  45 + /**
  46 + * 购货单位
  47 + */
  48 + @ApiModelProperty("购货单位")
  49 + private String customerId;
  50 +
  51 + /**
  52 + * 原计划发货日期
  53 + */
  54 + @ApiModelProperty("原计划发货日期")
  55 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  56 + private LocalDate originPlanShipDate;
  57 +
  58 + /**
  59 + * 订货单
  60 + */
  61 + @ApiModelProperty("订货单")
  62 + private String purchaseOrderId;
  63 +
  64 + /**
  65 + * 补货单物料行
  66 + */
  67 + @ApiModelProperty("补货单物料行")
  68 + private List<GetReplenishmentOrderLineBo> replenishmentOrderLineList;
  69 +
  70 + public GetReplenishmentOrderBo() {
  71 +
  72 + }
  73 +
  74 + public GetReplenishmentOrderBo(ReplenishmentOrder dto) {
  75 +
  76 + super(dto);
  77 + }
  78 +
  79 + @Override
  80 + public BaseBo<ReplenishmentOrder> convert(ReplenishmentOrder dto) {
  81 + return super.convert(dto);
  82 + }
  83 +
  84 + @Override
  85 + protected void afterInit(ReplenishmentOrder dto) {
  86 +
  87 + }
  88 +}
  1 +package com.lframework.xingyun.sc.bo.purchase;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.lframework.starter.common.constants.StringPool;
  5 +import com.lframework.starter.web.core.bo.BaseBo;
  6 +import com.lframework.xingyun.sc.entity.ReplenishmentOrderLine;
  7 +import io.swagger.annotations.ApiModelProperty;
  8 +import lombok.Data;
  9 +
  10 +import java.math.BigDecimal;
  11 +import java.time.LocalDate;
  12 +
  13 +/**
  14 + * <p>
  15 + * 补货单物料行 GetBo
  16 + * </p>
  17 + */
  18 +@Data
  19 +public class GetReplenishmentOrderLineBo extends BaseBo<ReplenishmentOrderLine> {
  20 +
  21 + /**
  22 + * ID
  23 + */
  24 + @ApiModelProperty("ID")
  25 + private String id;
  26 +
  27 + /**
  28 + * 补货单
  29 + */
  30 + @ApiModelProperty("补货单")
  31 + private String replenishmentOrderId;
  32 +
  33 + /**
  34 + * 订货单表物料行ID
  35 + */
  36 + @ApiModelProperty("订货单表物料行ID")
  37 + private String purchaseOrderLineId;
  38 +
  39 + /**
  40 + * 牌号
  41 + */
  42 + @ApiModelProperty("牌号")
  43 + private String brand;
  44 +
  45 + /**
  46 + * 厚度
  47 + */
  48 + @ApiModelProperty("厚度")
  49 + private BigDecimal thickness;
  50 +
  51 + /**
  52 + * 宽度
  53 + */
  54 + @ApiModelProperty("宽度")
  55 + private BigDecimal width;
  56 +
  57 + /**
  58 + * 长度
  59 + */
  60 + @ApiModelProperty("长度")
  61 + private BigDecimal length;
  62 +
  63 + /**
  64 + * 状态
  65 + */
  66 + @ApiModelProperty("状态")
  67 + private String status;
  68 +
  69 + /**
  70 + * 需发(t)
  71 + */
  72 + @ApiModelProperty("需发(t)")
  73 + private BigDecimal quantity;
  74 +
  75 + /**
  76 + * 实发(t)
  77 + */
  78 + @ApiModelProperty("实发(t)")
  79 + private BigDecimal shippedQuantity;
  80 +
  81 + /**
  82 + * 需求补发(t/件)
  83 + */
  84 + @ApiModelProperty("需求补发(t/件)")
  85 + private BigDecimal supplementaryQuantity;
  86 +
  87 + /**
  88 + * 生产科确认交付日期
  89 + */
  90 + @ApiModelProperty("生产科确认交付日期")
  91 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  92 + private LocalDate confirmedDeliveryDate;
  93 +
  94 + /**
  95 + * 备注
  96 + */
  97 + @ApiModelProperty("备注")
  98 + private String remarks;
  99 +
  100 + /**
  101 + * 排序
  102 + */
  103 + @ApiModelProperty("排序")
  104 + private Integer showOrder;
  105 +
  106 + public GetReplenishmentOrderLineBo() {
  107 +
  108 + }
  109 +
  110 + public GetReplenishmentOrderLineBo(ReplenishmentOrderLine dto) {
  111 +
  112 + super(dto);
  113 + }
  114 +
  115 + @Override
  116 + public BaseBo<ReplenishmentOrderLine> convert(ReplenishmentOrderLine dto) {
  117 + return super.convert(dto);
  118 + }
  119 +
  120 + @Override
  121 + protected void afterInit(ReplenishmentOrderLine dto) {
  122 +
  123 + }
  124 +}
  1 +package com.lframework.xingyun.sc.bo.purchase;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import com.lframework.starter.common.constants.StringPool;
  5 +import com.lframework.starter.web.core.bo.BaseBo;
  6 +import com.lframework.xingyun.sc.entity.ReplenishmentOrder;
  7 +import io.swagger.annotations.ApiModelProperty;
  8 +import lombok.Data;
  9 +
  10 +import java.time.LocalDate;
  11 +import java.time.LocalDateTime;
  12 +
  13 +/**
  14 + * <p>
  15 + * 补货单 QueryBo
  16 + * </p>
  17 + */
  18 +@Data
  19 +public class QueryReplenishmentOrderBo extends BaseBo<ReplenishmentOrder> {
  20 +
  21 + /**
  22 + * ID
  23 + */
  24 + @ApiModelProperty("ID")
  25 + private String id;
  26 +
  27 + /**
  28 + * 编号
  29 + */
  30 + @ApiModelProperty("编号")
  31 + private String code;
  32 +
  33 + /**
  34 + * 分厂
  35 + */
  36 + @ApiModelProperty("分厂")
  37 + private String workshopId;
  38 +
  39 + /**
  40 + * 办事处
  41 + */
  42 + @ApiModelProperty("办事处")
  43 + private String deptId;
  44 +
  45 + /**
  46 + * 购货单位
  47 + */
  48 + @ApiModelProperty("购货单位")
  49 + private String customerId;
  50 +
  51 + /**
  52 + * 原计划发货日期
  53 + */
  54 + @ApiModelProperty("原计划发货日期")
  55 + @JsonFormat(pattern = StringPool.DATE_PATTERN)
  56 + private LocalDate originPlanShipDate;
  57 +
  58 + /**
  59 + * 状态
  60 + */
  61 + @ApiModelProperty("状态")
  62 + private String status;
  63 +
  64 + /**
  65 + * 创建时间
  66 + */
  67 + @ApiModelProperty("创建时间")
  68 + @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN)
  69 + private LocalDateTime createTime;
  70 +
  71 + public QueryReplenishmentOrderBo() {
  72 +
  73 + }
  74 +
  75 + public QueryReplenishmentOrderBo(ReplenishmentOrder dto) {
  76 +
  77 + super(dto);
  78 + }
  79 +
  80 + @Override
  81 + public BaseBo<ReplenishmentOrder> convert(ReplenishmentOrder dto) {
  82 + return super.convert(dto);
  83 + }
  84 +
  85 + @Override
  86 + protected void afterInit(ReplenishmentOrder dto) {
  87 +
  88 + }
  89 +}
  90 +
  1 +package com.lframework.xingyun.sc.bo.purchase;
  2 +
  3 +import com.lframework.starter.web.core.bo.BaseBo;
  4 +import com.lframework.xingyun.sc.entity.ReplenishmentOrderLine;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +/**
  9 + * <p>
  10 + * 补货单物料行 QueryBo
  11 + * </p>
  12 + */
  13 +@Data
  14 +public class QueryReplenishmentOrderLineBo extends BaseBo<ReplenishmentOrderLine> {
  15 +
  16 + /**
  17 + * ID
  18 + */
  19 + @ApiModelProperty("ID")
  20 + private String id;
  21 +
  22 + /**
  23 + * 补货单
  24 + */
  25 + @ApiModelProperty("补货单")
  26 + private String replenishmentOrderId;
  27 +
  28 + public QueryReplenishmentOrderLineBo() {
  29 +
  30 + }
  31 +
  32 + public QueryReplenishmentOrderLineBo(ReplenishmentOrderLine dto) {
  33 +
  34 + super(dto);
  35 + }
  36 +
  37 + @Override
  38 + public BaseBo<ReplenishmentOrderLine> convert(ReplenishmentOrderLine dto) {
  39 + return super.convert(dto);
  40 + }
  41 +
  42 + @Override
  43 + protected void afterInit(ReplenishmentOrderLine dto) {
  44 +
  45 + }
  46 +}
  47 +
@@ -91,7 +91,7 @@ public class PurchaseOrderInfoController extends DefaultBaseController { @@ -91,7 +91,7 @@ public class PurchaseOrderInfoController extends DefaultBaseController {
91 * 查询列表 91 * 查询列表
92 */ 92 */
93 @ApiOperation("查询列表") 93 @ApiOperation("查询列表")
94 - @HasPermission({"purchaseOrderInfo:purchaseorderinfo:query"}) 94 + @HasPermission({"order-manage:order-list:query"})
95 @GetMapping("/query") 95 @GetMapping("/query")
96 public InvokeResult<PageResult<GetPurchaseOrderInfoBo>> query(@Valid QueryPurchaseOrderInfoVo vo) { 96 public InvokeResult<PageResult<GetPurchaseOrderInfoBo>> query(@Valid QueryPurchaseOrderInfoVo vo) {
97 97
@@ -143,7 +143,7 @@ public class PurchaseOrderInfoController extends DefaultBaseController { @@ -143,7 +143,7 @@ public class PurchaseOrderInfoController extends DefaultBaseController {
143 */ 143 */
144 @ApiOperation("根据ID查询") 144 @ApiOperation("根据ID查询")
145 @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) 145 @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
146 - @HasPermission({"purchaseOrderInfo:purchaseorderinfo:query"}) 146 + @HasPermission({"order-manage:order-list:query","order-manage:order-list:review"})
147 @GetMapping("/get") 147 @GetMapping("/get")
148 public InvokeResult<GetPurchaseOrderInfoBo> get(@NotBlank(message = "id不能为空!") String id) { 148 public InvokeResult<GetPurchaseOrderInfoBo> get(@NotBlank(message = "id不能为空!") String id) {
149 149
@@ -207,7 +207,7 @@ public class PurchaseOrderInfoController extends DefaultBaseController { @@ -207,7 +207,7 @@ public class PurchaseOrderInfoController extends DefaultBaseController {
207 * 修改 207 * 修改
208 */ 208 */
209 @ApiOperation("修改") 209 @ApiOperation("修改")
210 - @HasPermission({"purchaseOrderInfo:purchaseorderinfo:modify"}) 210 + @HasPermission({"order-manage:order-list:modify","order-manage:order-list:approve"})
211 @PutMapping("/update") 211 @PutMapping("/update")
212 public InvokeResult<Void> update(@Valid @RequestBody UpdatePurchaseOrderInfoVo vo) { 212 public InvokeResult<Void> update(@Valid @RequestBody UpdatePurchaseOrderInfoVo vo) {
213 213
@@ -220,7 +220,7 @@ public class PurchaseOrderInfoController extends DefaultBaseController { @@ -220,7 +220,7 @@ public class PurchaseOrderInfoController extends DefaultBaseController {
220 * 取消 220 * 取消
221 */ 221 */
222 @ApiOperation("取消") 222 @ApiOperation("取消")
223 - @HasPermission({"purchaseOrderRevoke:purchaseorderrevoke:cancel"}) 223 + @HasPermission({"order-manage:order-list:cancel"})
224 @GetMapping("/cancel") 224 @GetMapping("/cancel")
225 public InvokeResult<Void> cancel(@NotBlank(message = "id不能为空!") String id, 225 public InvokeResult<Void> cancel(@NotBlank(message = "id不能为空!") String id,
226 @NotBlank(message = "status不能为空!") String status) { 226 @NotBlank(message = "status不能为空!") String status) {
@@ -2,12 +2,15 @@ package com.lframework.xingyun.sc.controller.order; @@ -2,12 +2,15 @@ package com.lframework.xingyun.sc.controller.order;
2 2
3 import com.lframework.starter.common.utils.StringUtil; 3 import com.lframework.starter.common.utils.StringUtil;
4 import com.lframework.starter.web.core.annotations.security.HasPermission; 4 import com.lframework.starter.web.core.annotations.security.HasPermission;
  5 +import com.lframework.starter.web.core.components.security.SecurityUtil;
5 import com.lframework.starter.web.core.controller.DefaultBaseController; 6 import com.lframework.starter.web.core.controller.DefaultBaseController;
6 import com.lframework.starter.web.core.utils.PageResultUtil; 7 import com.lframework.starter.web.core.utils.PageResultUtil;
7 import com.lframework.starter.web.core.components.resp.PageResult; 8 import com.lframework.starter.web.core.components.resp.PageResult;
8 import com.lframework.starter.web.core.components.resp.InvokeResult; 9 import com.lframework.starter.web.core.components.resp.InvokeResult;
9 import javax.annotation.Resource; 10 import javax.annotation.Resource;
10 import javax.validation.constraints.NotBlank; 11 import javax.validation.constraints.NotBlank;
  12 +
  13 +import com.lframework.xingyun.sc.bo.order.GetPurchaseOrderInfoBo;
11 import com.lframework.xingyun.sc.bo.order.GetPurchaseOrderRevokeBo; 14 import com.lframework.xingyun.sc.bo.order.GetPurchaseOrderRevokeBo;
12 import com.lframework.xingyun.sc.entity.*; 15 import com.lframework.xingyun.sc.entity.*;
13 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService; 16 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
@@ -54,7 +57,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController { @@ -54,7 +57,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController {
54 * 查询列表 57 * 查询列表
55 */ 58 */
56 @ApiOperation("查询列表") 59 @ApiOperation("查询列表")
57 - @HasPermission({"purchaseOrderRevoke:purchaseorderrevoke:query"}) 60 + @HasPermission({"order-manage:revoke-list:query"})
58 @GetMapping("/query") 61 @GetMapping("/query")
59 public InvokeResult<PageResult<GetPurchaseOrderRevokeBo>> query(@Valid QueryPurchaseOrderRevokeVo vo) { 62 public InvokeResult<PageResult<GetPurchaseOrderRevokeBo>> query(@Valid QueryPurchaseOrderRevokeVo vo) {
60 63
@@ -64,7 +67,18 @@ public class PurchaseOrderRevokeController extends DefaultBaseController { @@ -64,7 +67,18 @@ public class PurchaseOrderRevokeController extends DefaultBaseController {
64 List<GetPurchaseOrderRevokeBo> results = null; 67 List<GetPurchaseOrderRevokeBo> results = null;
65 68
66 if (!CollectionUtil.isEmpty(datas)) { 69 if (!CollectionUtil.isEmpty(datas)) {
67 - results = datas.stream().map(GetPurchaseOrderRevokeBo::new).collect(Collectors.toList()); 70 + String currentUserId = SecurityUtil.getCurrentUser().getId();
  71 +
  72 + results = datas.stream().map(purchaseOrderRevoke -> {
  73 + GetPurchaseOrderRevokeBo bo = new GetPurchaseOrderRevokeBo(purchaseOrderRevoke);
  74 + // 判断 createById 是否等于当前用户 ID
  75 + boolean isCreateBy = false;
  76 + if (currentUserId.equals(purchaseOrderRevoke.getCreateById())) {
  77 + isCreateBy = true;
  78 + }
  79 + bo.setRevokeCreateBy(isCreateBy);
  80 + return bo;
  81 + }).collect(Collectors.toList());
68 } 82 }
69 83
70 return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results)); 84 return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
@@ -75,7 +89,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController { @@ -75,7 +89,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController {
75 */ 89 */
76 @ApiOperation("根据ID查询") 90 @ApiOperation("根据ID查询")
77 @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) 91 @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
78 - @HasPermission({"purchaseOrderRevoke:purchaseorderrevoke:query"}) 92 + @HasPermission({"order-manage:revoke-list:query","order-manage:revoke-list:review"})
79 @GetMapping("/get") 93 @GetMapping("/get")
80 public InvokeResult<GetPurchaseOrderRevokeBo> get(@NotBlank(message = "id不能为空!") String id) { 94 public InvokeResult<GetPurchaseOrderRevokeBo> get(@NotBlank(message = "id不能为空!") String id) {
81 95
@@ -100,7 +114,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController { @@ -100,7 +114,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController {
100 */ 114 */
101 @ApiOperation("根据ID查询") 115 @ApiOperation("根据ID查询")
102 @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) 116 @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
103 - @HasPermission({"purchaseOrderRevoke:purchaseorderrevoke:query"}) 117 + @HasPermission({"order-manage:revoke-list:query"})
104 @GetMapping("/getByPurchaseOrderId") 118 @GetMapping("/getByPurchaseOrderId")
105 public InvokeResult<GetPurchaseOrderRevokeBo> getByPurchaseOrderId(@NotBlank(message = "id不能为空!") String id) { 119 public InvokeResult<GetPurchaseOrderRevokeBo> getByPurchaseOrderId(@NotBlank(message = "id不能为空!") String id) {
106 120
@@ -117,7 +131,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController { @@ -117,7 +131,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController {
117 * 新增 131 * 新增
118 */ 132 */
119 @ApiOperation("新增") 133 @ApiOperation("新增")
120 - @HasPermission({"purchaseOrderRevoke:purchaseorderrevoke:add"}) 134 + @HasPermission({"order-manage:revoke-list:add"})
121 @PostMapping("/create") 135 @PostMapping("/create")
122 public InvokeResult<Void> create(@Valid @RequestBody CreatePurchaseOrderRevokeVo vo) { 136 public InvokeResult<Void> create(@Valid @RequestBody CreatePurchaseOrderRevokeVo vo) {
123 137
@@ -130,7 +144,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController { @@ -130,7 +144,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController {
130 * 修改 144 * 修改
131 */ 145 */
132 @ApiOperation("修改") 146 @ApiOperation("修改")
133 - @HasPermission({"purchaseOrderRevoke:purchaseorderrevoke:modify"}) 147 + @HasPermission({"order-manage:revoke-list:modify","order-manage:revoke-list:approve"})
134 @PutMapping("/update") 148 @PutMapping("/update")
135 public InvokeResult<Void> update(@Valid @RequestBody UpdatePurchaseOrderRevokeVo vo) { 149 public InvokeResult<Void> update(@Valid @RequestBody UpdatePurchaseOrderRevokeVo vo) {
136 150
@@ -143,7 +157,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController { @@ -143,7 +157,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController {
143 * 取消 157 * 取消
144 */ 158 */
145 @ApiOperation("取消") 159 @ApiOperation("取消")
146 - @HasPermission({"purchaseOrderRevoke:purchaseorderrevoke:cancel"}) 160 + @HasPermission({"order-manage:revoke-list:cancel"})
147 @GetMapping("/cancel") 161 @GetMapping("/cancel")
148 public InvokeResult<Void> cancel(@NotBlank(message = "id不能为空!") String id, 162 public InvokeResult<Void> cancel(@NotBlank(message = "id不能为空!") String id,
149 @NotBlank(message = "status不能为空!") String status) { 163 @NotBlank(message = "status不能为空!") String status) {
@@ -158,7 +172,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController { @@ -158,7 +172,7 @@ public class PurchaseOrderRevokeController extends DefaultBaseController {
158 */ 172 */
159 @ApiOperation("根据ID删除") 173 @ApiOperation("根据ID删除")
160 @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true) 174 @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
161 - @HasPermission({"purchaseOrderRevoke:purchaseorderrevoke:delete"}) 175 + @HasPermission({"order-manage:revoke-list:delete"})
162 @DeleteMapping("/deleteById") 176 @DeleteMapping("/deleteById")
163 public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) { 177 public InvokeResult<Void> deleteById(@NotBlank(message = "id不能为空!") String id) {
164 178
  1 +package com.lframework.xingyun.sc.controller.purchase;
  2 +
  3 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  4 +import com.lframework.starter.common.utils.CollectionUtil;
  5 +import com.lframework.starter.web.core.annotations.security.HasPermission;
  6 +import com.lframework.starter.web.core.components.resp.InvokeResult;
  7 +import com.lframework.starter.web.core.components.resp.InvokeResultBuilder;
  8 +import com.lframework.starter.web.core.components.resp.PageResult;
  9 +import com.lframework.starter.web.core.controller.DefaultBaseController;
  10 +import com.lframework.starter.web.core.utils.PageResultUtil;
  11 +import com.lframework.xingyun.sc.bo.purchase.GetReplenishmentOrderBo;
  12 +import com.lframework.xingyun.sc.bo.purchase.QueryReplenishmentOrderBo;
  13 +import com.lframework.xingyun.sc.entity.ReplenishmentOrder;
  14 +import com.lframework.xingyun.sc.service.purchase.ReplenishmentOrderService;
  15 +import com.lframework.xingyun.sc.vo.purchase.CreateReplenishmentOrderVo;
  16 +import com.lframework.xingyun.sc.vo.purchase.QueryReplenishmentOrderVo;
  17 +import com.lframework.xingyun.sc.vo.purchase.UpdateReplenishmentOrderVo;
  18 +import io.swagger.annotations.Api;
  19 +import io.swagger.annotations.ApiImplicitParam;
  20 +import io.swagger.annotations.ApiOperation;
  21 +import org.springframework.beans.factory.annotation.Autowired;
  22 +import org.springframework.validation.annotation.Validated;
  23 +import org.springframework.web.bind.annotation.*;
  24 +
  25 +import javax.validation.Valid;
  26 +import javax.validation.constraints.NotBlank;
  27 +import java.util.List;
  28 +import java.util.stream.Collectors;
  29 +
  30 +/**
  31 + * 补货单 Controller
  32 + */
  33 +@Api(tags = "补货单")
  34 +@Validated
  35 +@RestController
  36 +@RequestMapping("/purchase/replenishmentorder")
  37 +public class ReplenishmentOrderController extends DefaultBaseController {
  38 +
  39 + @Autowired
  40 + private ReplenishmentOrderService replenishmentOrderService;
  41 +
  42 + /**
  43 + * 查询列表
  44 + */
  45 + @ApiOperation("查询列表")
  46 + @HasPermission({"entity:replenishmentorder:query"})
  47 + @GetMapping("/query")
  48 + public InvokeResult<PageResult<QueryReplenishmentOrderBo>> query(@Valid QueryReplenishmentOrderVo vo) {
  49 +
  50 + PageResult<ReplenishmentOrder> pageResult = replenishmentOrderService.query(getPageIndex(vo), getPageSize(vo), vo);
  51 +
  52 + List<ReplenishmentOrder> datas = pageResult.getDatas();
  53 + List<QueryReplenishmentOrderBo> results = null;
  54 +
  55 + if (!CollectionUtil.isEmpty(datas)) {
  56 + results = datas.stream().map(QueryReplenishmentOrderBo::new).collect(Collectors.toList());
  57 + }
  58 +
  59 + return InvokeResultBuilder.success(PageResultUtil.rebuild(pageResult, results));
  60 + }
  61 +
  62 + /**
  63 + * 根据ID查询
  64 + */
  65 + @ApiOperation("根据ID查询")
  66 + @ApiImplicitParam(value = "id", name = "id", paramType = "query", required = true)
  67 + @HasPermission({"entity:replenishmentorder:query"})
  68 + @GetMapping
  69 + public InvokeResult<GetReplenishmentOrderBo> get(@NotBlank(message = "id不能为空!") String id) {
  70 +
  71 + ReplenishmentOrder data = replenishmentOrderService.findById(id);
  72 + if (data == null) {
  73 + throw new DefaultClientException("补货单不存在!");
  74 + }
  75 +
  76 + GetReplenishmentOrderBo result = new GetReplenishmentOrderBo(data);
  77 +
  78 + return InvokeResultBuilder.success(result);
  79 + }
  80 +
  81 + /**
  82 + * 新增
  83 + */
  84 + @ApiOperation("新增")
  85 + @HasPermission({"entity:replenishmentorder:add"})
  86 + @PostMapping
  87 + public InvokeResult<Void> create(@Valid @RequestBody CreateReplenishmentOrderVo vo) {
  88 +
  89 + replenishmentOrderService.create(vo);
  90 +
  91 + return InvokeResultBuilder.success();
  92 + }
  93 +
  94 + /**
  95 + * 修改
  96 + */
  97 + @ApiOperation("修改")
  98 + @HasPermission({"entity:replenishmentorder:modify"})
  99 + @PutMapping
  100 + public InvokeResult<Void> update(@Valid @RequestBody UpdateReplenishmentOrderVo vo) {
  101 +
  102 + replenishmentOrderService.update(vo);
  103 +
  104 + replenishmentOrderService.cleanCacheByKey(vo.getId());
  105 +
  106 + return InvokeResultBuilder.success();
  107 + }
  108 +
  109 + /**
  110 + * 取消
  111 + */
  112 + @ApiOperation("取消")
  113 + @GetMapping("/cancel")
  114 + public InvokeResult<Void> cancel(@NotBlank(message = "id不能为空!") String id) {
  115 +
  116 + replenishmentOrderService.cancel(id);
  117 +
  118 + replenishmentOrderService.cleanCacheByKey(id);
  119 +
  120 + return InvokeResultBuilder.success();
  121 + }
  122 +
  123 + /**
  124 + * 填写补货时间
  125 + */
  126 + @ApiOperation("填写补货时间")
  127 + @PostMapping("/fillRestockTime")
  128 + public InvokeResult<Void> fillRestockTime(@RequestBody UpdateReplenishmentOrderVo vo) {
  129 +
  130 + replenishmentOrderService.fillRestockTime(vo);
  131 +
  132 + replenishmentOrderService.cleanCacheByKey(vo.getId());
  133 +
  134 + return InvokeResultBuilder.success();
  135 + }
  136 +}
@@ -9,6 +9,7 @@ import java.time.LocalDateTime; @@ -9,6 +9,7 @@ import java.time.LocalDateTime;
9 import com.baomidou.mybatisplus.annotation.FieldFill; 9 import com.baomidou.mybatisplus.annotation.FieldFill;
10 import com.lframework.starter.web.core.entity.BaseEntity; 10 import com.lframework.starter.web.core.entity.BaseEntity;
11 import com.baomidou.mybatisplus.annotation.TableField; 11 import com.baomidou.mybatisplus.annotation.TableField;
  12 +import io.swagger.annotations.ApiModelProperty;
12 import lombok.Data; 13 import lombok.Data;
13 14
14 /** 15 /**
@@ -52,6 +53,17 @@ public class PurchaseOrderRevoke extends BaseEntity implements BaseDto { @@ -52,6 +53,17 @@ public class PurchaseOrderRevoke extends BaseEntity implements BaseDto {
52 private String orderingUnitName; 53 private String orderingUnitName;
53 54
54 /** 55 /**
  56 + * 办事处
  57 + */
  58 + private String deptId;
  59 +
  60 + /**
  61 + * 办事处名称(非持久化字段)
  62 + */
  63 + @TableField(exist = false)
  64 + private String deptName;
  65 +
  66 + /**
55 * 原订货日期 67 * 原订货日期
56 */ 68 */
57 private LocalDate orderDate; 69 private LocalDate orderDate;
@@ -87,6 +99,16 @@ public class PurchaseOrderRevoke extends BaseEntity implements BaseDto { @@ -87,6 +99,16 @@ public class PurchaseOrderRevoke extends BaseEntity implements BaseDto {
87 private String confirmationVoucherFileName; 99 private String confirmationVoucherFileName;
88 100
89 /** 101 /**
  102 + * 原总数量
  103 + */
  104 + private BigDecimal totalQuantity;
  105 +
  106 + /**
  107 + * 撤销总数量
  108 + */
  109 + private BigDecimal totalRevokeQuantity;
  110 +
  111 + /**
90 * 撤销撤销数量总和(吨)(非持久化字段) 112 * 撤销撤销数量总和(吨)(非持久化字段)
91 */ 113 */
92 @TableField(exist = false) 114 @TableField(exist = false)
@@ -99,6 +121,12 @@ public class PurchaseOrderRevoke extends BaseEntity implements BaseDto { @@ -99,6 +121,12 @@ public class PurchaseOrderRevoke extends BaseEntity implements BaseDto {
99 private String userId; 121 private String userId;
100 122
101 /** 123 /**
  124 + * 是否展示审核字段(非持久化字段)
  125 + */
  126 + @TableField(exist = false)
  127 + private boolean showExamine;
  128 +
  129 + /**
102 * 创建人ID 130 * 创建人ID
103 */ 131 */
104 @TableField(fill = FieldFill.INSERT) 132 @TableField(fill = FieldFill.INSERT)
  1 +package com.lframework.xingyun.sc.entity;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.FieldFill;
  4 +import com.baomidou.mybatisplus.annotation.TableField;
  5 +import com.baomidou.mybatisplus.annotation.TableName;
  6 +import com.lframework.starter.web.core.dto.BaseDto;
  7 +import com.lframework.starter.web.core.entity.BaseEntity;
  8 +import lombok.Data;
  9 +
  10 +import java.time.LocalDate;
  11 +import java.time.LocalDateTime;
  12 +
  13 +/**
  14 + * <p>
  15 + * 补货单
  16 + * </p>
  17 + */
  18 +@Data
  19 +@TableName("tbl_replenishment_order")
  20 +public class ReplenishmentOrder extends BaseEntity implements BaseDto {
  21 +
  22 + private static final long serialVersionUID = 1L;
  23 +
  24 + public static final String CACHE_NAME = "ReplenishmentOrder";
  25 +
  26 + /**
  27 + * ID
  28 + */
  29 + private String id;
  30 +
  31 + /**
  32 + * 编号
  33 + */
  34 + private String code;
  35 +
  36 + /**
  37 + * 分厂
  38 + */
  39 + private String workshopId;
  40 +
  41 + /**
  42 + * 办事处
  43 + */
  44 + private String deptId;
  45 +
  46 + /**
  47 + * 购货单位
  48 + */
  49 + private String customerId;
  50 +
  51 + /**
  52 + * 原计划发货日期
  53 + */
  54 + private LocalDate originPlanShipDate;
  55 +
  56 + /**
  57 + * 订货单
  58 + */
  59 + private String purchaseOrderId;
  60 +
  61 + /**
  62 + * 状态
  63 + */
  64 + private String status;
  65 +
  66 + /**
  67 + * 创建人ID
  68 + */
  69 + @TableField(fill = FieldFill.INSERT)
  70 + private String createById;
  71 +
  72 + /**
  73 + * 创建人
  74 + */
  75 + @TableField(fill = FieldFill.INSERT)
  76 + private String createBy;
  77 +
  78 + /**
  79 + * 更新人ID
  80 + */
  81 + @TableField(fill = FieldFill.INSERT_UPDATE)
  82 + private String updateById;
  83 +
  84 + /**
  85 + * 更新人
  86 + */
  87 + @TableField(fill = FieldFill.INSERT_UPDATE)
  88 + private String updateBy;
  89 +
  90 + /**
  91 + * 创建时间
  92 + */
  93 + @TableField(fill = FieldFill.INSERT)
  94 + private LocalDateTime createTime;
  95 +
  96 + /**
  97 + * 更新时间
  98 + */
  99 + @TableField(fill = FieldFill.INSERT_UPDATE)
  100 + private LocalDateTime updateTime;
  101 +
  102 + /**
  103 + * 是否展示正式合同审核按钮(非持久化字段)
  104 + */
  105 + @TableField(exist = false)
  106 + private Boolean showExamine;
  107 +}
  1 +package com.lframework.xingyun.sc.entity;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.FieldFill;
  4 +import com.baomidou.mybatisplus.annotation.TableField;
  5 +import com.baomidou.mybatisplus.annotation.TableName;
  6 +import com.lframework.starter.web.core.dto.BaseDto;
  7 +import com.lframework.starter.web.core.entity.BaseEntity;
  8 +import lombok.Data;
  9 +
  10 +import java.math.BigDecimal;
  11 +import java.time.LocalDate;
  12 +import java.time.LocalDateTime;
  13 +
  14 +/**
  15 + * <p>
  16 + * 补货单物料行
  17 + * </p>
  18 + */
  19 +@Data
  20 +@TableName("tbl_replenishment_order_line")
  21 +public class ReplenishmentOrderLine extends BaseEntity implements BaseDto {
  22 +
  23 + private static final long serialVersionUID = 1L;
  24 +
  25 + public static final String CACHE_NAME = "ReplenishmentOrderLine";
  26 +
  27 + /**
  28 + * ID
  29 + */
  30 + private String id;
  31 +
  32 + /**
  33 + * 补货单
  34 + */
  35 + private String replenishmentOrderId;
  36 +
  37 + /**
  38 + * 订货单表物料行ID
  39 + */
  40 + private String purchaseOrderLineId;
  41 +
  42 + /**
  43 + * 牌号
  44 + */
  45 + private String brand;
  46 +
  47 + /**
  48 + * 厚度
  49 + */
  50 + private BigDecimal thickness;
  51 +
  52 + /**
  53 + * 宽度
  54 + */
  55 + private BigDecimal width;
  56 +
  57 + /**
  58 + * 长度
  59 + */
  60 + private BigDecimal length;
  61 +
  62 + /**
  63 + * 状态
  64 + */
  65 + private String status;
  66 +
  67 + /**
  68 + * 需发(t)
  69 + */
  70 + private BigDecimal quantity;
  71 +
  72 + /**
  73 + * 实发(t)
  74 + */
  75 + private BigDecimal shippedQuantity;
  76 +
  77 + /**
  78 + * 需求补发(t/件)
  79 + */
  80 + private BigDecimal supplementaryQuantity;
  81 +
  82 + /**
  83 + * 生产科确认交付日期
  84 + */
  85 + private LocalDate confirmedDeliveryDate;
  86 +
  87 + /**
  88 + * 备注
  89 + */
  90 + private String remarks;
  91 +
  92 + /**
  93 + * 排序
  94 + */
  95 + private Integer showOrder;
  96 +
  97 + /**
  98 + * 前端用ID
  99 + */
  100 + private String itemId;
  101 +
  102 + /**
  103 + * 创建人ID
  104 + */
  105 + @TableField(fill = FieldFill.INSERT)
  106 + private String createById;
  107 +
  108 + /**
  109 + * 创建人
  110 + */
  111 + @TableField(fill = FieldFill.INSERT)
  112 + private String createBy;
  113 +
  114 + /**
  115 + * 更新人ID
  116 + */
  117 + @TableField(fill = FieldFill.INSERT_UPDATE)
  118 + private String updateById;
  119 +
  120 + /**
  121 + * 更新人
  122 + */
  123 + @TableField(fill = FieldFill.INSERT_UPDATE)
  124 + private String updateBy;
  125 +
  126 + /**
  127 + * 创建时间
  128 + */
  129 + @TableField(fill = FieldFill.INSERT)
  130 + private LocalDateTime createTime;
  131 +
  132 + /**
  133 + * 更新时间
  134 + */
  135 + @TableField(fill = FieldFill.INSERT_UPDATE)
  136 + private LocalDateTime updateTime;
  137 +
  138 +}
@@ -18,6 +18,8 @@ import com.lframework.xingyun.sc.service.customer.CustomerCreditHistoryService; @@ -18,6 +18,8 @@ import com.lframework.xingyun.sc.service.customer.CustomerCreditHistoryService;
18 import com.lframework.xingyun.sc.service.customer.CustomerCreditService; 18 import com.lframework.xingyun.sc.service.customer.CustomerCreditService;
19 import com.lframework.xingyun.sc.service.customer.CustomerDevelopPlanService; 19 import com.lframework.xingyun.sc.service.customer.CustomerDevelopPlanService;
20 import com.lframework.xingyun.sc.service.order.*; 20 import com.lframework.xingyun.sc.service.order.*;
  21 +import com.lframework.xingyun.sc.service.purchase.ReplenishmentOrderService;
  22 +import com.lframework.xingyun.sc.service.shipments.car.RequestCarTicketService;
21 import com.lframework.xingyun.sc.service.shipments.car.DraftRequestCarTicketService; 23 import com.lframework.xingyun.sc.service.shipments.car.DraftRequestCarTicketService;
22 import com.lframework.xingyun.sc.vo.customer.credit.QueryCorePersonnelHistoryVo; 24 import com.lframework.xingyun.sc.vo.customer.credit.QueryCorePersonnelHistoryVo;
23 import com.lframework.xingyun.sc.vo.customer.credit.UpdateCustomerCreditVo; 25 import com.lframework.xingyun.sc.vo.customer.credit.UpdateCustomerCreditVo;
@@ -73,6 +75,10 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic @@ -73,6 +75,10 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic
73 private SpecLockDelayApplicationService specLockDelayApplicationService; 75 private SpecLockDelayApplicationService specLockDelayApplicationService;
74 @Resource 76 @Resource
75 private DraftRequestCarTicketService draftRequestCarTicketService; 77 private DraftRequestCarTicketService draftRequestCarTicketService;
  78 + @Resource
  79 + private RequestCarTicketService requestCarTicketService;
  80 + @Resource
  81 + private ReplenishmentOrderService replenishmentOrderService;
76 82
77 83
78 /** 84 /**
@@ -131,6 +137,9 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic @@ -131,6 +137,9 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic
131 case "DRAFT_REQUEST_CAR": 137 case "DRAFT_REQUEST_CAR":
132 handleDraftRequestCarTicketData(flowStatus, businessId); 138 handleDraftRequestCarTicketData(flowStatus, businessId);
133 break; 139 break;
  140 + case "RESTOCK_APPROVAL":
  141 + handleReplenishmentOrderStatus(flowStatus, businessId);
  142 + break;
134 default: 143 default:
135 break; 144 break;
136 } 145 }
@@ -163,7 +172,7 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic @@ -163,7 +172,7 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic
163 } 172 }
164 } 173 }
165 174
166 - private void handleSpecLockDelayAuditData(String flowStatus, String businessId) { 175 + private void handleReplenishmentOrderStatus(String flowStatus, String businessId) {
167 if (FlowInstanceStatus.APPROVE_PASS.getCode().equals(flowStatus) 176 if (FlowInstanceStatus.APPROVE_PASS.getCode().equals(flowStatus)
168 || FlowInstanceStatus.FINISH.getCode().equals(flowStatus)) { 177 || FlowInstanceStatus.FINISH.getCode().equals(flowStatus)) {
169 specLockDelayApplicationService.updateAuditStatus(businessId, "PASS"); 178 specLockDelayApplicationService.updateAuditStatus(businessId, "PASS");
@@ -176,6 +185,19 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic @@ -176,6 +185,19 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic
176 } 185 }
177 } 186 }
178 187
  188 + private void handleSpecLockDelayAuditData(String flowStatus, String businessId) {
  189 + if (FlowInstanceStatus.APPROVE_PASS.getCode().equals(flowStatus)
  190 + || FlowInstanceStatus.FINISH.getCode().equals(flowStatus)) {
  191 + replenishmentOrderService.updateStatus(businessId, "PASS");
  192 + } else if (FlowInstanceStatus.REVOKE.getCode().equals(flowStatus)
  193 + || FlowInstanceStatus.REFUSE.getCode().equals(flowStatus)
  194 + || FlowInstanceStatus.TERMINATION.getCode().equals(flowStatus)) {
  195 + replenishmentOrderService.updateStatus(businessId, "REFUSE");
  196 + } else if (FlowInstanceStatus.UNDO.getCode().equals(flowStatus)) {
  197 + replenishmentOrderService.updateStatus(businessId, "REFUSE");
  198 + }
  199 + }
  200 +
179 /** 201 /**
180 * 客户开发业务数据处理 202 * 客户开发业务数据处理
181 * 203 *
@@ -234,6 +256,7 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic @@ -234,6 +256,7 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic
234 if (query.size() < query1.size()) { 256 if (query.size() < query1.size()) {
235 b = false; 257 b = false;
236 } 258 }
  259 + BigDecimal totalQuantity = BigDecimal.ZERO;
237 for (PurchaseOrderRevokeLine purchaseOrderRevokeLine : query) { 260 for (PurchaseOrderRevokeLine purchaseOrderRevokeLine : query) {
238 //原数量 261 //原数量
239 BigDecimal quantity = purchaseOrderRevokeLine.getQuantity(); 262 BigDecimal quantity = purchaseOrderRevokeLine.getQuantity();
@@ -247,9 +270,12 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic @@ -247,9 +270,12 @@ public class BusinessDataHandlerServiceImpl implements BusinessDataHandlerServic
247 } 270 }
248 if (quantity != null) { 271 if (quantity != null) {
249 BigDecimal result = quantity.subtract(revokeQuantity); 272 BigDecimal result = quantity.subtract(revokeQuantity);
  273 + totalQuantity = totalQuantity.add(result);
250 purchaseOrderLineService.updateQuantity(purchaseOrderRevokeLine.getPurchaseOrderLineId(), result); 274 purchaseOrderLineService.updateQuantity(purchaseOrderRevokeLine.getPurchaseOrderLineId(), result);
251 } 275 }
252 } 276 }
  277 + //更新总数量
  278 + purchaseOrderInfoService.updateTotalQuantity(revoke.getPurchaseOrderId(), totalQuantity);
253 //更新订货单撤销状态(部分撤销、全部撤销) 279 //更新订货单撤销状态(部分撤销、全部撤销)
254 if (b) { 280 if (b) {
255 //全部撤销 281 //全部撤销
@@ -8,8 +8,10 @@ import com.lframework.starter.web.core.utils.JsonUtil; @@ -8,8 +8,10 @@ import com.lframework.starter.web.core.utils.JsonUtil;
8 import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; 8 import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
9 import com.lframework.xingyun.sc.service.customer.CustomerCreditService; 9 import com.lframework.xingyun.sc.service.customer.CustomerCreditService;
10 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService; 10 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
  11 +import com.lframework.xingyun.sc.service.purchase.ReplenishmentOrderService;
11 import com.lframework.xingyun.sc.vo.customer.credit.*; 12 import com.lframework.xingyun.sc.vo.customer.credit.*;
12 import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderInfoVo; 13 import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderInfoVo;
  14 +import com.lframework.xingyun.sc.vo.purchase.UpdateReplenishmentOrderVo;
13 import org.springframework.stereotype.Service; 15 import org.springframework.stereotype.Service;
14 import org.springframework.transaction.annotation.Transactional; 16 import org.springframework.transaction.annotation.Transactional;
15 17
@@ -23,6 +25,8 @@ public class FlowTaskServiceImpl implements FlowTaskService { @@ -23,6 +25,8 @@ public class FlowTaskServiceImpl implements FlowTaskService {
23 private CustomerCreditService customerCreditService; 25 private CustomerCreditService customerCreditService;
24 @Resource 26 @Resource
25 private PurchaseOrderInfoService purchaseOrderInfoService; 27 private PurchaseOrderInfoService purchaseOrderInfoService;
  28 + @Resource
  29 + private ReplenishmentOrderService replenishmentOrderService;
26 30
27 31
28 @OpLog(type = OtherOpLogType.class, name = "修改客户资信,ID:{}", params = {"#id"}) 32 @OpLog(type = OtherOpLogType.class, name = "修改客户资信,ID:{}", params = {"#id"})
@@ -59,4 +63,20 @@ public class FlowTaskServiceImpl implements FlowTaskService { @@ -59,4 +63,20 @@ public class FlowTaskServiceImpl implements FlowTaskService {
59 e.printStackTrace(); 63 e.printStackTrace();
60 } 64 }
61 } 65 }
  66 +
  67 + @OpLog(type = OtherOpLogType.class, name = "修改补货单,ID:{}", params = {"#id"})
  68 + @Transactional(rollbackFor = Exception.class)
  69 + @Override
  70 + public void updateReplenishmentOrderByMap(Map<String, Object> map) {
  71 + try {
  72 + // 创建 ObjectMapper 实例
  73 + ObjectMapper objectMapper = new ObjectMapper();
  74 + //先将 Map 序列化为 JSON 字符串,再反序列化为目标对象
  75 + String json = objectMapper.writeValueAsString(map);
  76 + UpdateReplenishmentOrderVo updateReplenishmentOrderVo = JsonUtil.parseObject(json, UpdateReplenishmentOrderVo.class);
  77 + replenishmentOrderService.updateFlowInstance(updateReplenishmentOrderVo);
  78 + } catch (JsonProcessingException e) {
  79 + e.printStackTrace();
  80 + }
  81 + }
62 } 82 }
@@ -37,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional; @@ -37,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
37 import org.springframework.stereotype.Service; 37 import org.springframework.stereotype.Service;
38 38
39 import javax.annotation.Resource; 39 import javax.annotation.Resource;
  40 +import java.math.BigDecimal;
40 import java.util.*; 41 import java.util.*;
41 import java.util.stream.Collectors; 42 import java.util.stream.Collectors;
42 43
@@ -378,6 +379,19 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde @@ -378,6 +379,19 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde
378 getBaseMapper().update(updateWrapper); 379 getBaseMapper().update(updateWrapper);
379 } 380 }
380 381
  382 + @OpLog(type = OtherOpLogType.class, name = "更新总数量,ID:{}", params = {"#id"})
  383 + @Transactional(rollbackFor = Exception.class)
  384 + @Override
  385 + public void updateTotalQuantity(String id, BigDecimal totalQuantity) {
  386 + if (StringUtils.isBlank(id) || totalQuantity == null) {
  387 + return;
  388 + }
  389 + LambdaUpdateWrapper<PurchaseOrderInfo> updateWrapper = Wrappers.lambdaUpdate(PurchaseOrderInfo.class)
  390 + .set(PurchaseOrderInfo::getTotalQuantity, totalQuantity)
  391 + .eq(PurchaseOrderInfo::getId, id);
  392 + getBaseMapper().update(updateWrapper);
  393 + }
  394 +
381 /** 395 /**
382 * 更新规格变更状态 396 * 更新规格变更状态
383 * 397 *
@@ -3,7 +3,10 @@ package com.lframework.xingyun.sc.impl.order; @@ -3,7 +3,10 @@ package com.lframework.xingyun.sc.impl.order;
3 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 3 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
4 import com.baomidou.mybatisplus.core.toolkit.Wrappers; 4 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5 import com.github.pagehelper.PageInfo; 5 import com.github.pagehelper.PageInfo;
  6 +import com.lframework.starter.bpm.dto.FlowTaskDto;
  7 +import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper;
6 import com.lframework.starter.bpm.service.FlowInstanceWrapperService; 8 import com.lframework.starter.bpm.service.FlowInstanceWrapperService;
  9 +import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
7 import com.lframework.starter.common.utils.CollectionUtil; 10 import com.lframework.starter.common.utils.CollectionUtil;
8 import com.lframework.starter.web.core.components.security.SecurityUtil; 11 import com.lframework.starter.web.core.components.security.SecurityUtil;
9 import com.lframework.starter.web.core.impl.BaseMpServiceImpl; 12 import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
@@ -19,6 +22,7 @@ import com.lframework.starter.web.core.annotations.oplog.OpLog; @@ -19,6 +22,7 @@ import com.lframework.starter.web.core.annotations.oplog.OpLog;
19 import com.lframework.starter.web.core.utils.PageHelperUtil; 22 import com.lframework.starter.web.core.utils.PageHelperUtil;
20 import com.lframework.starter.common.utils.Assert; 23 import com.lframework.starter.common.utils.Assert;
21 import com.lframework.starter.web.inner.components.oplog.OtherOpLogType; 24 import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  25 +import com.lframework.xingyun.sc.entity.PurchaseOrderInfo;
22 import com.lframework.xingyun.sc.entity.PurchaseOrderRevoke; 26 import com.lframework.xingyun.sc.entity.PurchaseOrderRevoke;
23 import com.lframework.xingyun.sc.entity.PurchaseOrderRevokeLine; 27 import com.lframework.xingyun.sc.entity.PurchaseOrderRevokeLine;
24 import com.lframework.xingyun.sc.mappers.PurchaseOrderRevokeMapper; 28 import com.lframework.xingyun.sc.mappers.PurchaseOrderRevokeMapper;
@@ -26,6 +30,7 @@ import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService; @@ -26,6 +30,7 @@ import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
26 import com.lframework.xingyun.sc.service.order.PurchaseOrderRevokeLineService; 30 import com.lframework.xingyun.sc.service.order.PurchaseOrderRevokeLineService;
27 import com.lframework.xingyun.sc.service.order.PurchaseOrderRevokeService; 31 import com.lframework.xingyun.sc.service.order.PurchaseOrderRevokeService;
28 import com.lframework.xingyun.sc.vo.order.*; 32 import com.lframework.xingyun.sc.vo.order.*;
  33 +import org.apache.commons.collections.CollectionUtils;
29 import org.apache.commons.lang3.StringUtils; 34 import org.apache.commons.lang3.StringUtils;
30 import org.springframework.transaction.annotation.Transactional; 35 import org.springframework.transaction.annotation.Transactional;
31 import org.springframework.stereotype.Service; 36 import org.springframework.stereotype.Service;
@@ -35,6 +40,7 @@ import java.math.BigDecimal; @@ -35,6 +40,7 @@ import java.math.BigDecimal;
35 import java.math.RoundingMode; 40 import java.math.RoundingMode;
36 import java.time.LocalDate; 41 import java.time.LocalDate;
37 import java.util.List; 42 import java.util.List;
  43 +import java.util.stream.Collectors;
38 44
39 @Service 45 @Service
40 public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOrderRevokeMapper, PurchaseOrderRevoke> implements PurchaseOrderRevokeService { 46 public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOrderRevokeMapper, PurchaseOrderRevoke> implements PurchaseOrderRevokeService {
@@ -46,7 +52,8 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr @@ -46,7 +52,8 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr
46 private PurchaseOrderInfoService purchaseOrderInfoService; 52 private PurchaseOrderInfoService purchaseOrderInfoService;
47 @Resource 53 @Resource
48 private FlowInstanceWrapperService flowInstanceWrapperService; 54 private FlowInstanceWrapperService flowInstanceWrapperService;
49 - 55 + @Resource
  56 + private FlowTaskWrapperMapper flowTaskWrapperMapper;
50 57
51 @Override 58 @Override
52 public PageResult<PurchaseOrderRevoke> query(Integer pageIndex, Integer pageSize, QueryPurchaseOrderRevokeVo vo) { 59 public PageResult<PurchaseOrderRevoke> query(Integer pageIndex, Integer pageSize, QueryPurchaseOrderRevokeVo vo) {
@@ -56,6 +63,21 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr @@ -56,6 +63,21 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr
56 63
57 PageHelperUtil.startPage(pageIndex, pageSize); 64 PageHelperUtil.startPage(pageIndex, pageSize);
58 List<PurchaseOrderRevoke> datas = this.query(vo); 65 List<PurchaseOrderRevoke> datas = this.query(vo);
  66 + if (CollectionUtils.isNotEmpty(datas)) {
  67 + // 获取当前人员的待办任务数据
  68 + List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
  69 + if (CollectionUtils.isEmpty(flowTaskList)) {
  70 + return new PageResult<>();
  71 + }
  72 + List<String> ids = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList());
  73 + for (PurchaseOrderRevoke purchaseOrderRevoke : datas) {
  74 + if (ids.contains(purchaseOrderRevoke.getId())) {
  75 + purchaseOrderRevoke.setShowExamine(true);
  76 + } else {
  77 + purchaseOrderRevoke.setShowExamine(false);
  78 + }
  79 + }
  80 + }
59 81
60 return PageResultUtil.convert(new PageInfo<>(datas)); 82 return PageResultUtil.convert(new PageInfo<>(datas));
61 } 83 }
@@ -86,6 +108,9 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr @@ -86,6 +108,9 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr
86 if (!StringUtil.isBlank(vo.getOrderingUnit())) { 108 if (!StringUtil.isBlank(vo.getOrderingUnit())) {
87 data.setOrderingUnit(vo.getOrderingUnit()); 109 data.setOrderingUnit(vo.getOrderingUnit());
88 } 110 }
  111 + if (!StringUtil.isBlank(vo.getDeptId())) {
  112 + data.setDeptId(vo.getDeptId());
  113 + }
89 if (vo.getOrderDate() != null) { 114 if (vo.getOrderDate() != null) {
90 data.setOrderDate(vo.getOrderDate()); 115 data.setOrderDate(vo.getOrderDate());
91 } 116 }
@@ -108,6 +133,12 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr @@ -108,6 +133,12 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr
108 if (!StringUtil.isBlank(vo.getConfirmationVoucherFileName())) { 133 if (!StringUtil.isBlank(vo.getConfirmationVoucherFileName())) {
109 data.setConfirmationVoucherFileName(vo.getConfirmationVoucherFileName()); 134 data.setConfirmationVoucherFileName(vo.getConfirmationVoucherFileName());
110 } 135 }
  136 + if (vo.getTotalQuantity() != null) {
  137 + data.setTotalQuantity(vo.getTotalQuantity());
  138 + }
  139 + if (vo.getTotalRevokeQuantity() != null) {
  140 + data.setTotalRevokeQuantity(vo.getTotalRevokeQuantity());
  141 + }
111 142
112 getBaseMapper().insert(data); 143 getBaseMapper().insert(data);
113 144
@@ -176,13 +207,15 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr @@ -176,13 +207,15 @@ public class PurchaseOrderRevokeServiceImpl extends BaseMpServiceImpl<PurchaseOr
176 .set(PurchaseOrderRevoke::getRevokeReason, StringUtil.isBlank(vo.getRevokeReason()) ? null : vo.getRevokeReason()) 207 .set(PurchaseOrderRevoke::getRevokeReason, StringUtil.isBlank(vo.getRevokeReason()) ? null : vo.getRevokeReason())
177 .set(PurchaseOrderRevoke::getConfirmationVoucherFileId, StringUtil.isBlank(vo.getConfirmationVoucherFileId()) ? null : vo.getConfirmationVoucherFileId()) 208 .set(PurchaseOrderRevoke::getConfirmationVoucherFileId, StringUtil.isBlank(vo.getConfirmationVoucherFileId()) ? null : vo.getConfirmationVoucherFileId())
178 .set(PurchaseOrderRevoke::getConfirmationVoucherFileName, StringUtil.isBlank(vo.getConfirmationVoucherFileName()) ? null : vo.getConfirmationVoucherFileName()) 209 .set(PurchaseOrderRevoke::getConfirmationVoucherFileName, StringUtil.isBlank(vo.getConfirmationVoucherFileName()) ? null : vo.getConfirmationVoucherFileName())
  210 + .set(PurchaseOrderRevoke::getTotalQuantity, vo.getTotalQuantity() == null ? null : vo.getTotalQuantity())
  211 + .set(PurchaseOrderRevoke::getTotalRevokeQuantity, vo.getTotalRevokeQuantity() == null ? null : vo.getTotalRevokeQuantity())
179 .eq(PurchaseOrderRevoke::getId, vo.getId()); 212 .eq(PurchaseOrderRevoke::getId, vo.getId());
180 213
181 getBaseMapper().update(updateWrapper); 214 getBaseMapper().update(updateWrapper);
182 215
183 //撤销单物料行修改 216 //撤销单物料行修改
184 BigDecimal sumRevokeQuantity = BigDecimal.ZERO; 217 BigDecimal sumRevokeQuantity = BigDecimal.ZERO;
185 - List<UpdatePurchaseOrderRevokeLineVo> voList = vo.getUpdatePurchaseOrderRevokeLineVoList(); 218 + List<UpdatePurchaseOrderRevokeLineVo> voList = vo.getPurchaseOrderRevokeLineList();
186 if (CollectionUtil.isNotEmpty(voList)) { 219 if (CollectionUtil.isNotEmpty(voList)) {
187 for (UpdatePurchaseOrderRevokeLineVo vo1 : voList) { 220 for (UpdatePurchaseOrderRevokeLineVo vo1 : voList) {
188 if (vo1.getRevokeQuantity() != null) { 221 if (vo1.getRevokeQuantity() != null) {
  1 +package com.lframework.xingyun.sc.impl.purchase;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.github.pagehelper.PageInfo;
  6 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  7 +import com.lframework.starter.common.utils.Assert;
  8 +import com.lframework.starter.common.utils.ObjectUtil;
  9 +import com.lframework.starter.web.core.annotations.oplog.OpLog;
  10 +import com.lframework.starter.web.core.components.resp.PageResult;
  11 +import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
  12 +import com.lframework.starter.web.core.utils.IdUtil;
  13 +import com.lframework.starter.web.core.utils.OpLogUtil;
  14 +import com.lframework.starter.web.core.utils.PageHelperUtil;
  15 +import com.lframework.starter.web.core.utils.PageResultUtil;
  16 +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  17 +import com.lframework.xingyun.sc.entity.ReplenishmentOrderLine;
  18 +import com.lframework.xingyun.sc.mappers.ReplenishmentOrderLineMapper;
  19 +import com.lframework.xingyun.sc.service.purchase.ReplenishmentOrderLineService;
  20 +import com.lframework.xingyun.sc.vo.purchase.CreateReplenishmentOrderLineVo;
  21 +import com.lframework.xingyun.sc.vo.purchase.QueryReplenishmentOrderLineVo;
  22 +import com.lframework.xingyun.sc.vo.purchase.UpdateReplenishmentOrderLineVo;
  23 +import org.springframework.cache.annotation.CacheEvict;
  24 +import org.springframework.cache.annotation.Cacheable;
  25 +import org.springframework.stereotype.Service;
  26 +import org.springframework.transaction.annotation.Transactional;
  27 +
  28 +import java.io.Serializable;
  29 +import java.util.List;
  30 +
  31 +@Service
  32 +public class ReplenishmentOrderLineServiceImpl extends BaseMpServiceImpl<ReplenishmentOrderLineMapper, ReplenishmentOrderLine> implements ReplenishmentOrderLineService {
  33 +
  34 + @Override
  35 + public PageResult<ReplenishmentOrderLine> query(Integer pageIndex, Integer pageSize, QueryReplenishmentOrderLineVo vo) {
  36 +
  37 + Assert.greaterThanZero(pageIndex);
  38 + Assert.greaterThanZero(pageSize);
  39 +
  40 + PageHelperUtil.startPage(pageIndex, pageSize);
  41 + List<ReplenishmentOrderLine> datas = this.query(vo);
  42 +
  43 + return PageResultUtil.convert(new PageInfo<>(datas));
  44 + }
  45 +
  46 + @Override
  47 + public List<ReplenishmentOrderLine> query(QueryReplenishmentOrderLineVo vo) {
  48 +
  49 + return getBaseMapper().query(vo);
  50 + }
  51 +
  52 + @Cacheable(value = ReplenishmentOrderLine.CACHE_NAME, key = "@cacheVariables.tenantId() + #id", unless = "#result == null")
  53 + @Override
  54 + public ReplenishmentOrderLine findById(String id) {
  55 +
  56 + return getBaseMapper().selectById(id);
  57 + }
  58 +
  59 + @OpLog(type = OtherOpLogType.class, name = "新增补货单物料行,ID:{}", params = {"#id"})
  60 + @Transactional(rollbackFor = Exception.class)
  61 + @Override
  62 + public String create(CreateReplenishmentOrderLineVo vo) {
  63 +
  64 + ReplenishmentOrderLine data = new ReplenishmentOrderLine();
  65 + data.setId(IdUtil.getUUID());
  66 + data.setReplenishmentOrderId(vo.getReplenishmentOrderId());
  67 + data.setPurchaseOrderLineId(vo.getPurchaseOrderLineId());
  68 + data.setBrand(vo.getBrand());
  69 + data.setThickness(vo.getThickness());
  70 + data.setWidth(vo.getWidth());
  71 + data.setLength(vo.getLength());
  72 + data.setStatus(vo.getStatus());
  73 + data.setQuantity(vo.getQuantity());
  74 + data.setShippedQuantity(vo.getShippedQuantity());
  75 + data.setSupplementaryQuantity(vo.getSupplementaryQuantity());
  76 + data.setConfirmedDeliveryDate(vo.getConfirmedDeliveryDate());
  77 + data.setRemarks(vo.getRemarks());
  78 + data.setShowOrder(vo.getShowOrder());
  79 + data.setItemId(vo.getItemId());
  80 +
  81 + getBaseMapper().insert(data);
  82 +
  83 + OpLogUtil.setVariable("id", data.getId());
  84 + OpLogUtil.setExtra(vo);
  85 +
  86 + return data.getId();
  87 + }
  88 +
  89 + @OpLog(type = OtherOpLogType.class, name = "修改补货单物料行,ID:{}", params = {"#id"})
  90 + @Transactional(rollbackFor = Exception.class)
  91 + @Override
  92 + public void update(UpdateReplenishmentOrderLineVo vo) {
  93 +
  94 + ReplenishmentOrderLine data = getBaseMapper().selectById(vo.getId());
  95 + if (ObjectUtil.isNull(data)) {
  96 + throw new DefaultClientException("补货单物料行不存在!");
  97 + }
  98 +
  99 + LambdaUpdateWrapper<ReplenishmentOrderLine> updateWrapper = Wrappers.lambdaUpdate(ReplenishmentOrderLine.class)
  100 + .set(ReplenishmentOrderLine::getReplenishmentOrderId, vo.getReplenishmentOrderId())
  101 + .set(ReplenishmentOrderLine::getPurchaseOrderLineId, vo.getPurchaseOrderLineId())
  102 + .set(ReplenishmentOrderLine::getBrand, vo.getBrand())
  103 + .set(ReplenishmentOrderLine::getThickness, vo.getThickness())
  104 + .set(ReplenishmentOrderLine::getWidth, vo.getWidth())
  105 + .set(ReplenishmentOrderLine::getLength, vo.getLength())
  106 + .set(ReplenishmentOrderLine::getStatus, vo.getStatus())
  107 + .set(ReplenishmentOrderLine::getQuantity, vo.getQuantity())
  108 + .set(ReplenishmentOrderLine::getShippedQuantity, vo.getShippedQuantity())
  109 + .set(ReplenishmentOrderLine::getSupplementaryQuantity, vo.getSupplementaryQuantity())
  110 + .set(ReplenishmentOrderLine::getConfirmedDeliveryDate, vo.getConfirmedDeliveryDate())
  111 + .set(ReplenishmentOrderLine::getRemarks, vo.getRemarks())
  112 + .set(ReplenishmentOrderLine::getShowOrder, vo.getShowOrder())
  113 + .set(ReplenishmentOrderLine::getItemId, vo.getItemId())
  114 + .eq(ReplenishmentOrderLine::getId, vo.getId());
  115 +
  116 + getBaseMapper().update(updateWrapper);
  117 +
  118 + OpLogUtil.setVariable("id", data.getId());
  119 + OpLogUtil.setExtra(vo);
  120 + }
  121 +
  122 + @CacheEvict(value = ReplenishmentOrderLine.CACHE_NAME, key = "@cacheVariables.tenantId() + #key")
  123 + @Override
  124 + public void cleanCacheByKey(Serializable key) {
  125 +
  126 + }
  127 +}
  1 +package com.lframework.xingyun.sc.impl.purchase;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.Wrapper;
  4 +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  5 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  6 +import com.github.pagehelper.PageInfo;
  7 +import com.lframework.starter.bpm.dto.FlowTaskDto;
  8 +import com.lframework.starter.bpm.mappers.FlowTaskWrapperMapper;
  9 +import com.lframework.starter.bpm.service.FlowInstanceWrapperService;
  10 +import com.lframework.starter.bpm.vo.flow.task.QueryTodoTaskListVo;
  11 +import com.lframework.starter.common.exceptions.impl.DefaultClientException;
  12 +import com.lframework.starter.common.utils.Assert;
  13 +import com.lframework.starter.common.utils.ObjectUtil;
  14 +import com.lframework.starter.web.core.annotations.oplog.OpLog;
  15 +import com.lframework.starter.web.core.components.resp.PageResult;
  16 +import com.lframework.starter.web.core.components.security.SecurityUtil;
  17 +import com.lframework.starter.web.core.impl.BaseMpServiceImpl;
  18 +import com.lframework.starter.web.core.utils.IdUtil;
  19 +import com.lframework.starter.web.core.utils.OpLogUtil;
  20 +import com.lframework.starter.web.core.utils.PageHelperUtil;
  21 +import com.lframework.starter.web.core.utils.PageResultUtil;
  22 +import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
  23 +import com.lframework.xingyun.sc.entity.ReplenishmentOrder;
  24 +import com.lframework.xingyun.sc.entity.ReplenishmentOrderLine;
  25 +import com.lframework.xingyun.sc.enums.CustomerDevelopStatus;
  26 +import com.lframework.xingyun.sc.mappers.ReplenishmentOrderMapper;
  27 +import com.lframework.xingyun.sc.service.purchase.ReplenishmentOrderLineService;
  28 +import com.lframework.xingyun.sc.service.purchase.ReplenishmentOrderService;
  29 +import com.lframework.xingyun.sc.vo.purchase.*;
  30 +import org.apache.commons.collections4.CollectionUtils;
  31 +import org.apache.commons.lang3.StringUtils;
  32 +import org.springframework.cache.annotation.CacheEvict;
  33 +import org.springframework.cache.annotation.Cacheable;
  34 +import org.springframework.stereotype.Service;
  35 +import org.springframework.transaction.annotation.Transactional;
  36 +
  37 +import javax.annotation.Resource;
  38 +import java.io.Serializable;
  39 +import java.util.ArrayList;
  40 +import java.util.List;
  41 +import java.util.stream.Collectors;
  42 +
  43 +@Service
  44 +public class ReplenishmentOrderServiceImpl extends BaseMpServiceImpl<ReplenishmentOrderMapper, ReplenishmentOrder> implements ReplenishmentOrderService {
  45 +
  46 + private static final String RESTOCK_APPROVAL_FLAG = "RESTOCK_APPROVAL"; // 补货单审批
  47 +
  48 + @Resource
  49 + private ReplenishmentOrderLineService replenishmentOrderLineService;
  50 + @Resource
  51 + private FlowInstanceWrapperService flowInstanceWrapperService;
  52 + @Resource
  53 + private FlowTaskWrapperMapper flowTaskWrapperMapper;
  54 +
  55 + @Override
  56 + public PageResult<ReplenishmentOrder> query(Integer pageIndex, Integer pageSize, QueryReplenishmentOrderVo vo) {
  57 +
  58 + Assert.greaterThanZero(pageIndex);
  59 + Assert.greaterThanZero(pageSize);
  60 +
  61 + PageHelperUtil.startPage(pageIndex, pageSize);
  62 + List<ReplenishmentOrder> datas = this.query(vo);
  63 + if (CollectionUtils.isNotEmpty(datas)) {
  64 + // 获取当前人员的待办任务数据
  65 + List<FlowTaskDto> flowTaskList = flowTaskWrapperMapper.queryTodoList(new QueryTodoTaskListVo(), SecurityUtil.getCurrentUser().getId());
  66 + if (CollectionUtils.isNotEmpty(flowTaskList)) {
  67 + List<String> businessIds = flowTaskList.stream().map(FlowTaskDto::getBusinessId).collect(Collectors.toList());
  68 + datas.forEach(replenishmentOrder -> {
  69 + replenishmentOrder.setShowExamine(businessIds.contains(replenishmentOrder.getId()));
  70 + });
  71 + }
  72 + }
  73 +
  74 + return PageResultUtil.convert(new PageInfo<>(datas));
  75 + }
  76 +
  77 + @Override
  78 + public List<ReplenishmentOrder> query(QueryReplenishmentOrderVo vo) {
  79 +
  80 + return getBaseMapper().query(vo);
  81 + }
  82 +
  83 + @Cacheable(value = ReplenishmentOrder.CACHE_NAME, key = "@cacheVariables.tenantId() + #id", unless = "#result == null")
  84 + @Override
  85 + public ReplenishmentOrder findById(String id) {
  86 +
  87 + return getBaseMapper().selectById(id);
  88 + }
  89 +
  90 + @OpLog(type = OtherOpLogType.class, name = "新增补货单,ID:{}", params = {"#id"})
  91 + @Transactional(rollbackFor = Exception.class)
  92 + @Override
  93 + public String create(CreateReplenishmentOrderVo vo) {
  94 +
  95 + if (vo == null || CollectionUtils.isEmpty(vo.getReplenishmentOrderLineList())) {
  96 + throw new DefaultClientException("参数错误!");
  97 + }
  98 +
  99 +
  100 + ReplenishmentOrder data = new ReplenishmentOrder();
  101 + data.setId(IdUtil.getUUID());
  102 + data.setCode(vo.getCode());
  103 + data.setWorkshopId(vo.getWorkshopId());
  104 + data.setDeptId(vo.getDeptId());
  105 + data.setCustomerId(vo.getCustomerId());
  106 + data.setOriginPlanShipDate(vo.getOriginPlanShipDate());
  107 + data.setPurchaseOrderId(vo.getPurchaseOrderId());
  108 + data.setStatus("AUDIT");
  109 +
  110 + getBaseMapper().insert(data);
  111 +
  112 + for (int index = 0; index < vo.getReplenishmentOrderLineList().size(); index++) {
  113 + CreateReplenishmentOrderLineVo lineVo = vo.getReplenishmentOrderLineList().get(index);
  114 + lineVo.setShowOrder(index);
  115 + lineVo.setReplenishmentOrderId(data.getId());
  116 + replenishmentOrderLineService.create(lineVo);
  117 + }
  118 +
  119 + OpLogUtil.setVariable("id", data.getId());
  120 + OpLogUtil.setExtra(vo);
  121 +
  122 + // 开启审核
  123 + flowInstanceWrapperService.startInstance(RESTOCK_APPROVAL_FLAG, data.getId(), RESTOCK_APPROVAL_FLAG, data);
  124 +
  125 + return data.getId();
  126 + }
  127 +
  128 + @OpLog(type = OtherOpLogType.class, name = "修改补货单,ID:{}", params = {"#id"})
  129 + @Transactional(rollbackFor = Exception.class)
  130 + @Override
  131 + public void update(UpdateReplenishmentOrderVo vo) {
  132 +
  133 + ReplenishmentOrder data = getBaseMapper().selectById(vo.getId());
  134 + if (ObjectUtil.isNull(data)) {
  135 + throw new DefaultClientException("补货单不存在!");
  136 + }
  137 +
  138 + if (!CustomerDevelopStatus.REFUSE.name().equals(data.getStatus())) {
  139 + throw new DefaultClientException(CustomerDevelopStatus.getDescByNameSafe(data.getStatus()) + "的补货单不允许修改!");
  140 + }
  141 +
  142 + LambdaUpdateWrapper<ReplenishmentOrder> updateWrapper = Wrappers.lambdaUpdate(ReplenishmentOrder.class)
  143 + .set(ReplenishmentOrder::getCode, vo.getCode())
  144 + .set(ReplenishmentOrder::getWorkshopId, vo.getWorkshopId())
  145 + .set(ReplenishmentOrder::getDeptId, vo.getDeptId())
  146 + .set(ReplenishmentOrder::getCustomerId, vo.getCustomerId())
  147 + .set(ReplenishmentOrder::getOriginPlanShipDate, vo.getOriginPlanShipDate())
  148 + .set(ReplenishmentOrder::getPurchaseOrderId, vo.getPurchaseOrderId())
  149 + .eq(ReplenishmentOrder::getId, vo.getId());
  150 +
  151 + getBaseMapper().update(updateWrapper);
  152 +
  153 + Wrapper<ReplenishmentOrderLine> lineWrapper = Wrappers.lambdaQuery(ReplenishmentOrderLine.class)
  154 + .eq(ReplenishmentOrderLine::getReplenishmentOrderId, data.getId());
  155 + List<ReplenishmentOrderLine> oldReplenishmentOrderLineList = replenishmentOrderLineService.list(lineWrapper);
  156 + List<String> oldLineIdList = CollectionUtils.emptyIfNull(oldReplenishmentOrderLineList)
  157 + .stream()
  158 + .map(ReplenishmentOrderLine::getId).collect(Collectors.toList());
  159 + List<String> existIdList = new ArrayList<>(oldLineIdList.size());
  160 + for (int index = 0; index < vo.getReplenishmentOrderLineList().size(); index++) {
  161 + UpdateReplenishmentOrderLineVo updateReplenishmentOrderLineVo = vo.getReplenishmentOrderLineList().get(index);
  162 + updateReplenishmentOrderLineVo.setShowOrder(index);
  163 + if (StringUtils.isNotBlank(updateReplenishmentOrderLineVo.getId())) {
  164 + existIdList.add(updateReplenishmentOrderLineVo.getId());
  165 + replenishmentOrderLineService.update(updateReplenishmentOrderLineVo);
  166 + } else {
  167 + updateReplenishmentOrderLineVo.setReplenishmentOrderId(data.getId());
  168 + CreateReplenishmentOrderLineVo createReplenishmentOrderLineVo = new CreateReplenishmentOrderLineVo();
  169 + createReplenishmentOrderLineVo.setReplenishmentOrderId(updateReplenishmentOrderLineVo.getReplenishmentOrderId());
  170 + createReplenishmentOrderLineVo.setPurchaseOrderLineId(updateReplenishmentOrderLineVo.getPurchaseOrderLineId());
  171 + createReplenishmentOrderLineVo.setBrand(updateReplenishmentOrderLineVo.getBrand());
  172 + createReplenishmentOrderLineVo.setThickness(updateReplenishmentOrderLineVo.getThickness());
  173 + createReplenishmentOrderLineVo.setWidth(updateReplenishmentOrderLineVo.getWidth());
  174 + createReplenishmentOrderLineVo.setLength(updateReplenishmentOrderLineVo.getLength());
  175 + createReplenishmentOrderLineVo.setStatus(updateReplenishmentOrderLineVo.getStatus());
  176 + createReplenishmentOrderLineVo.setQuantity(updateReplenishmentOrderLineVo.getQuantity());
  177 + createReplenishmentOrderLineVo.setShippedQuantity(updateReplenishmentOrderLineVo.getShippedQuantity());
  178 + createReplenishmentOrderLineVo.setSupplementaryQuantity(updateReplenishmentOrderLineVo.getSupplementaryQuantity());
  179 + createReplenishmentOrderLineVo.setRemarks(updateReplenishmentOrderLineVo.getRemarks());
  180 + createReplenishmentOrderLineVo.setItemId(updateReplenishmentOrderLineVo.getItemId());
  181 + createReplenishmentOrderLineVo.setShowOrder(updateReplenishmentOrderLineVo.getShowOrder());
  182 + replenishmentOrderLineService.create(createReplenishmentOrderLineVo);
  183 + }
  184 + }
  185 +
  186 + List<String> needDeleteLineIdList = oldLineIdList.stream()
  187 + .filter(oldLineId -> !existIdList.contains(oldLineId))
  188 + .collect(Collectors.toList());
  189 + if (CollectionUtils.isNotEmpty(needDeleteLineIdList)) {
  190 + replenishmentOrderLineService.removeByIds(needDeleteLineIdList);
  191 + }
  192 +
  193 + OpLogUtil.setVariable("id", data.getId());
  194 + OpLogUtil.setExtra(vo);
  195 +
  196 + // 开启审核
  197 + flowInstanceWrapperService.startInstance(RESTOCK_APPROVAL_FLAG, data.getId(), RESTOCK_APPROVAL_FLAG, data);
  198 + }
  199 +
  200 + @OpLog(type = OtherOpLogType.class, name = "取消补货单,ID:{}", params = {"#id"})
  201 + @Transactional(rollbackFor = Exception.class)
  202 + @Override
  203 + public void cancel(String id) {
  204 + ReplenishmentOrder data = getBaseMapper().selectById(id);
  205 + if (ObjectUtil.isNull(data)) {
  206 + throw new DefaultClientException("补货单不存在!");
  207 + }
  208 +
  209 + if (CustomerDevelopStatus.CANCEL.name().equals(data.getStatus())) {
  210 + throw new DefaultClientException("补货单已取消!");
  211 + }
  212 +
  213 + if (!CustomerDevelopStatus.REFUSE.name().equals(data.getStatus())) {
  214 + throw new DefaultClientException(CustomerDevelopStatus.getDescByNameSafe(data.getStatus()) + "的补货单不允许取消!");
  215 + }
  216 +
  217 + Wrapper<ReplenishmentOrder> wrapper = Wrappers.lambdaUpdate(ReplenishmentOrder.class)
  218 + .set(ReplenishmentOrder::getStatus, CustomerDevelopStatus.CANCEL.name())
  219 + .eq(ReplenishmentOrder::getId, id);
  220 +
  221 + getBaseMapper().update(wrapper);
  222 +
  223 + OpLogUtil.setVariable("id", id);
  224 + OpLogUtil.setExtra(data);
  225 + }
  226 +
  227 + @OpLog(type = OtherOpLogType.class, name = "补货单填写补货时间,ID:{}", params = {"#id"})
  228 + @Transactional(rollbackFor = Exception.class)
  229 + @Override
  230 + public void fillRestockTime(UpdateReplenishmentOrderVo vo) {
  231 +
  232 + ReplenishmentOrder data = getBaseMapper().selectById(vo.getId());
  233 + if (ObjectUtil.isNull(data)) {
  234 + throw new DefaultClientException("补货单不存在!");
  235 + }
  236 +
  237 + if (!CustomerDevelopStatus.PASS.name().equals(data.getStatus())) {
  238 + throw new DefaultClientException("只有审核通过的补货单才能填写补货时间");
  239 + }
  240 +
  241 + vo.getReplenishmentOrderLineList().forEach(updateReplenishmentOrderLineVo -> {
  242 + Wrapper<ReplenishmentOrderLine> updateWrapper = Wrappers.lambdaUpdate(ReplenishmentOrderLine.class)
  243 + .set(ReplenishmentOrderLine::getConfirmedDeliveryDate, updateReplenishmentOrderLineVo.getConfirmedDeliveryDate())
  244 + .eq(ReplenishmentOrderLine::getId, updateReplenishmentOrderLineVo.getId());
  245 +
  246 + replenishmentOrderLineService.update(updateWrapper);
  247 + });
  248 +
  249 + OpLogUtil.setVariable("id", vo.getId());
  250 + OpLogUtil.setExtra(data);
  251 + }
  252 +
  253 + @Override
  254 + @OpLog(type = OtherOpLogType.class, name = "补货单审批完成,ID:{}, 审批状态:{}", params = {"#id", "#status"})
  255 + @Transactional(rollbackFor = Exception.class)
  256 + public void updateStatus(String id, String status) {
  257 + if (StringUtils.isBlank(id) || StringUtils.isBlank(status)) {
  258 + return;
  259 + }
  260 +
  261 + Wrapper<ReplenishmentOrder> wrapper = Wrappers.lambdaUpdate(ReplenishmentOrder.class)
  262 + .set(ReplenishmentOrder::getStatus, status)
  263 + .eq(ReplenishmentOrder::getId, id);
  264 +
  265 + getBaseMapper().update(wrapper);
  266 +
  267 + UpdateReplenishmentOrderVo vo = new UpdateReplenishmentOrderVo();
  268 + vo.setId(id);
  269 + vo.setStatus(status);
  270 +
  271 + OpLogUtil.setVariable("id", vo.getId());
  272 + OpLogUtil.setExtra(vo);
  273 +
  274 + cleanCacheByKey(id);
  275 + }
  276 +
  277 + @Override
  278 + @Transactional(rollbackFor = Exception.class)
  279 + public void updateFlowInstance(UpdateReplenishmentOrderVo vo) {
  280 + ReplenishmentOrder data = getBaseMapper().selectById(vo.getId());
  281 + if (ObjectUtil.isNull(data)) {
  282 + throw new DefaultClientException("补货单不存在!");
  283 + }
  284 +
  285 + vo.getReplenishmentOrderLineList().forEach(updateReplenishmentOrderLineVo -> {
  286 + Wrapper<ReplenishmentOrderLine> lineWrapper = Wrappers.lambdaUpdate(ReplenishmentOrderLine.class)
  287 + .set(ReplenishmentOrderLine::getQuantity, updateReplenishmentOrderLineVo.getQuantity())
  288 + .set(ReplenishmentOrderLine::getShippedQuantity, updateReplenishmentOrderLineVo.getShippedQuantity())
  289 + .set(ReplenishmentOrderLine::getSupplementaryQuantity, updateReplenishmentOrderLineVo.getSupplementaryQuantity())
  290 + .eq(ReplenishmentOrderLine::getId, updateReplenishmentOrderLineVo.getId());
  291 +
  292 + replenishmentOrderLineService.update(lineWrapper);
  293 + });
  294 +
  295 + OpLogUtil.setVariable("id", vo.getId());
  296 + OpLogUtil.setExtra(vo);
  297 +
  298 + cleanCacheByKey(vo.getId());
  299 + }
  300 +
  301 + @CacheEvict(value = ReplenishmentOrder.CACHE_NAME, key = "@cacheVariables.tenantId() + #key")
  302 + @Override
  303 + public void cleanCacheByKey(Serializable key) {
  304 +
  305 + }
  306 +}
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.starter.web.core.mapper.BaseMapper;
  4 +import com.lframework.xingyun.sc.entity.ReplenishmentOrderLine;
  5 +import com.lframework.xingyun.sc.vo.purchase.QueryReplenishmentOrderLineVo;
  6 +import org.apache.ibatis.annotations.Param;
  7 +
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * <p>
  12 + * 补货单物料行 Mapper 接口
  13 + * </p>
  14 + */
  15 +public interface ReplenishmentOrderLineMapper extends BaseMapper<ReplenishmentOrderLine> {
  16 +
  17 + /**
  18 + * 查询列表
  19 + *
  20 + * @param vo
  21 + * @return
  22 + */
  23 + List<ReplenishmentOrderLine> query(@Param("vo") QueryReplenishmentOrderLineVo vo);
  24 +}
  1 +package com.lframework.xingyun.sc.mappers;
  2 +
  3 +import com.lframework.starter.web.core.mapper.BaseMapper;
  4 +import com.lframework.xingyun.sc.entity.ReplenishmentOrder;
  5 +import com.lframework.xingyun.sc.vo.purchase.QueryReplenishmentOrderVo;
  6 +import org.apache.ibatis.annotations.Param;
  7 +
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * <p>
  12 + * 补货单 Mapper 接口
  13 + * </p>
  14 + */
  15 +public interface ReplenishmentOrderMapper extends BaseMapper<ReplenishmentOrder> {
  16 +
  17 + /**
  18 + * 查询列表
  19 + *
  20 + * @param vo
  21 + * @return
  22 + */
  23 + List<ReplenishmentOrder> query(@Param("vo") QueryReplenishmentOrderVo vo);
  24 +}
@@ -6,6 +6,8 @@ import com.lframework.xingyun.sc.entity.PurchaseOrderInfo; @@ -6,6 +6,8 @@ import com.lframework.xingyun.sc.entity.PurchaseOrderInfo;
6 import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderInfoVo; 6 import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderInfoVo;
7 import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderInfoVo; 7 import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderInfoVo;
8 import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderInfoVo; 8 import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderInfoVo;
  9 +
  10 +import java.math.BigDecimal;
9 import java.util.List; 11 import java.util.List;
10 12
11 /** 13 /**
@@ -91,6 +93,14 @@ public interface PurchaseOrderInfoService extends BaseMpService<PurchaseOrderInf @@ -91,6 +93,14 @@ public interface PurchaseOrderInfoService extends BaseMpService<PurchaseOrderInf
91 void updateRevokeStatus(String id, String status); 93 void updateRevokeStatus(String id, String status);
92 94
93 /** 95 /**
  96 + * 更新总数量
  97 + *
  98 + * @param id 主键ID
  99 + * @param totalQuantity 总数量
  100 + */
  101 + void updateTotalQuantity(String id, BigDecimal totalQuantity);
  102 +
  103 + /**
94 * 更新规格变更状态 104 * 更新规格变更状态
95 * 105 *
96 * @param id 主键ID 106 * @param id 主键ID
  1 +package com.lframework.xingyun.sc.service.purchase;
  2 +
  3 +import com.lframework.starter.web.core.components.resp.PageResult;
  4 +import com.lframework.starter.web.core.service.BaseMpService;
  5 +import com.lframework.xingyun.sc.entity.ReplenishmentOrderLine;
  6 +import com.lframework.xingyun.sc.vo.purchase.CreateReplenishmentOrderLineVo;
  7 +import com.lframework.xingyun.sc.vo.purchase.QueryReplenishmentOrderLineVo;
  8 +import com.lframework.xingyun.sc.vo.purchase.UpdateReplenishmentOrderLineVo;
  9 +
  10 +import java.util.List;
  11 +
  12 +/**
  13 + * 补货单物料行 Service
  14 + */
  15 +public interface ReplenishmentOrderLineService extends BaseMpService<ReplenishmentOrderLine> {
  16 +
  17 + /**
  18 + * 查询列表
  19 + *
  20 + * @return
  21 + */
  22 + PageResult<ReplenishmentOrderLine> query(Integer pageIndex, Integer pageSize, QueryReplenishmentOrderLineVo vo);
  23 +
  24 + /**
  25 + * 查询列表
  26 + *
  27 + * @param vo
  28 + * @return
  29 + */
  30 + List<ReplenishmentOrderLine> query(QueryReplenishmentOrderLineVo vo);
  31 +
  32 + /**
  33 + * 根据ID查询
  34 + *
  35 + * @param id
  36 + * @return
  37 + */
  38 + ReplenishmentOrderLine findById(String id);
  39 +
  40 + /**
  41 + * 创建
  42 + *
  43 + * @param vo
  44 + * @return
  45 + */
  46 + String create(CreateReplenishmentOrderLineVo vo);
  47 +
  48 + /**
  49 + * 修改
  50 + *
  51 + * @param vo
  52 + */
  53 + void update(UpdateReplenishmentOrderLineVo vo);
  54 +
  55 +}
  1 +package com.lframework.xingyun.sc.service.purchase;
  2 +
  3 +import com.lframework.starter.web.core.components.resp.PageResult;
  4 +import com.lframework.starter.web.core.service.BaseMpService;
  5 +import com.lframework.xingyun.sc.entity.ReplenishmentOrder;
  6 +import com.lframework.xingyun.sc.vo.order.UpdatePurchaseOrderInfoVo;
  7 +import com.lframework.xingyun.sc.vo.purchase.CreateReplenishmentOrderVo;
  8 +import com.lframework.xingyun.sc.vo.purchase.QueryReplenishmentOrderVo;
  9 +import com.lframework.xingyun.sc.vo.purchase.UpdateReplenishmentOrderVo;
  10 +
  11 +import java.util.List;
  12 +
  13 +/**
  14 + * 补货单 Service
  15 + */
  16 +public interface ReplenishmentOrderService extends BaseMpService<ReplenishmentOrder> {
  17 +
  18 + /**
  19 + * 查询列表
  20 + *
  21 + * @return
  22 + */
  23 + PageResult<ReplenishmentOrder> query(Integer pageIndex, Integer pageSize, QueryReplenishmentOrderVo vo);
  24 +
  25 + /**
  26 + * 查询列表
  27 + *
  28 + * @param vo
  29 + * @return
  30 + */
  31 + List<ReplenishmentOrder> query(QueryReplenishmentOrderVo vo);
  32 +
  33 + /**
  34 + * 根据ID查询
  35 + *
  36 + * @param id
  37 + * @return
  38 + */
  39 + ReplenishmentOrder findById(String id);
  40 +
  41 + /**
  42 + * 创建
  43 + *
  44 + * @param vo
  45 + * @return
  46 + */
  47 + String create(CreateReplenishmentOrderVo vo);
  48 +
  49 + /**
  50 + * 修改
  51 + *
  52 + * @param vo
  53 + */
  54 + void update(UpdateReplenishmentOrderVo vo);
  55 +
  56 + /**
  57 + * 取消补货单
  58 + *
  59 + * @param id
  60 + */
  61 + void cancel(String id);
  62 +
  63 + /**
  64 + * 填写补货时间
  65 + *
  66 + * @param vo
  67 + */
  68 + void fillRestockTime(UpdateReplenishmentOrderVo vo);
  69 +
  70 + /**
  71 + * 更新审核状态
  72 + *
  73 + * @param id
  74 + * @param status
  75 + */
  76 + void updateStatus(String id, String status);
  77 +
  78 + /**
  79 + * 更新审核数据
  80 + *
  81 + * @param vo 更新数据
  82 + */
  83 + void updateFlowInstance(UpdateReplenishmentOrderVo vo);
  84 +}
1 package com.lframework.xingyun.sc.vo.order; 1 package com.lframework.xingyun.sc.vo.order;
2 2
3 import javax.validation.constraints.NotBlank; 3 import javax.validation.constraints.NotBlank;
  4 +import java.math.BigDecimal;
4 import java.time.LocalDate; 5 import java.time.LocalDate;
  6 +
  7 +import com.baomidou.mybatisplus.annotation.TableField;
5 import com.lframework.starter.web.core.vo.BaseVo; 8 import com.lframework.starter.web.core.vo.BaseVo;
6 import com.lframework.xingyun.sc.entity.PurchaseOrderRevokeLine; 9 import com.lframework.xingyun.sc.entity.PurchaseOrderRevokeLine;
7 import io.swagger.annotations.ApiModelProperty; 10 import io.swagger.annotations.ApiModelProperty;
@@ -40,6 +43,12 @@ public class CreatePurchaseOrderRevokeVo implements BaseVo, Serializable { @@ -40,6 +43,12 @@ public class CreatePurchaseOrderRevokeVo implements BaseVo, Serializable {
40 private String orderingUnit; 43 private String orderingUnit;
41 44
42 /** 45 /**
  46 + * 办事处
  47 + */
  48 + @ApiModelProperty("办事处")
  49 + private String deptId;
  50 +
  51 + /**
43 * 原订货日期 52 * 原订货日期
44 */ 53 */
45 @ApiModelProperty("原订货日期") 54 @ApiModelProperty("原订货日期")
@@ -94,4 +103,16 @@ public class CreatePurchaseOrderRevokeVo implements BaseVo, Serializable { @@ -94,4 +103,16 @@ public class CreatePurchaseOrderRevokeVo implements BaseVo, Serializable {
94 @ApiModelProperty("订货单撤销表物料行") 103 @ApiModelProperty("订货单撤销表物料行")
95 private List<PurchaseOrderRevokeLine> purchaseOrderRevokeLineList; 104 private List<PurchaseOrderRevokeLine> purchaseOrderRevokeLineList;
96 105
  106 + /**
  107 + * 原总数量
  108 + */
  109 + @ApiModelProperty("原总数量")
  110 + private BigDecimal totalQuantity;
  111 +
  112 + /**
  113 + * 撤销总数量
  114 + */
  115 + @ApiModelProperty("撤销总数量")
  116 + private BigDecimal totalRevokeQuantity;
  117 +
97 } 118 }
@@ -26,6 +26,24 @@ public class QueryPurchaseOrderRevokeVo extends PageVo implements BaseVo, Serial @@ -26,6 +26,24 @@ public class QueryPurchaseOrderRevokeVo extends PageVo implements BaseVo, Serial
26 private String orderingUnit; 26 private String orderingUnit;
27 27
28 /** 28 /**
  29 + * 订货单位名称
  30 + */
  31 + @ApiModelProperty("订货单位名称")
  32 + private String orderingUnitName;
  33 +
  34 + /**
  35 + * 办事处
  36 + */
  37 + @ApiModelProperty("办事处")
  38 + private String deptId;
  39 +
  40 + /**
  41 + * 办事处名称(非持久化字段)
  42 + */
  43 + @ApiModelProperty("办事处名称")
  44 + private String deptName;
  45 +
  46 + /**
29 * 制单日期 47 * 制单日期
30 */ 48 */
31 @ApiModelProperty("制单日期") 49 @ApiModelProperty("制单日期")
@@ -2,6 +2,7 @@ package com.lframework.xingyun.sc.vo.order; @@ -2,6 +2,7 @@ package com.lframework.xingyun.sc.vo.order;
2 2
3 import lombok.Data; 3 import lombok.Data;
4 import javax.validation.constraints.NotBlank; 4 import javax.validation.constraints.NotBlank;
  5 +import java.math.BigDecimal;
5 import java.time.LocalDate; 6 import java.time.LocalDate;
6 import com.lframework.starter.web.core.vo.BaseVo; 7 import com.lframework.starter.web.core.vo.BaseVo;
7 import com.lframework.starter.web.core.components.validation.TypeMismatch; 8 import com.lframework.starter.web.core.components.validation.TypeMismatch;
@@ -55,6 +56,18 @@ public class UpdatePurchaseOrderRevokeVo implements BaseVo, Serializable { @@ -55,6 +56,18 @@ public class UpdatePurchaseOrderRevokeVo implements BaseVo, Serializable {
55 * 订货单撤销单物料行 56 * 订货单撤销单物料行
56 */ 57 */
57 @ApiModelProperty("订货单撤销单物料行") 58 @ApiModelProperty("订货单撤销单物料行")
58 - List<UpdatePurchaseOrderRevokeLineVo> updatePurchaseOrderRevokeLineVoList; 59 + List<UpdatePurchaseOrderRevokeLineVo> purchaseOrderRevokeLineList;
  60 +
  61 + /**
  62 + * 原总数量
  63 + */
  64 + @ApiModelProperty("原总数量")
  65 + private BigDecimal totalQuantity;
  66 +
  67 + /**
  68 + * 撤销总数量
  69 + */
  70 + @ApiModelProperty("撤销总数量")
  71 + private BigDecimal totalRevokeQuantity;
59 72
60 } 73 }
  1 +package com.lframework.xingyun.sc.vo.purchase;
  2 +
  3 +import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
  4 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  5 +import com.lframework.starter.web.core.vo.BaseVo;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import lombok.Data;
  8 +import org.hibernate.validator.constraints.Length;
  9 +
  10 +
  11 +import java.io.Serializable;
  12 +import java.math.BigDecimal;
  13 +import java.time.LocalDate;
  14 +
  15 +@Data
  16 +public class CreateReplenishmentOrderLineVo implements BaseVo, Serializable {
  17 +
  18 + private static final long serialVersionUID = 1L;
  19 +
  20 + /**
  21 + * 补货单
  22 + */
  23 + @ApiModelProperty(value = "补货单")
  24 + @Length(message = "补货单最多允许32个字符!")
  25 + private String replenishmentOrderId;
  26 +
  27 + /**
  28 + * 订货单表物料行ID
  29 + */
  30 + @ApiModelProperty(value = "订货单表物料行ID")
  31 + @Length(message = "订货单表物料行ID最多允许32个字符!")
  32 + private String purchaseOrderLineId;
  33 +
  34 + /**
  35 + * 牌号
  36 + */
  37 + @ApiModelProperty(value = "牌号")
  38 + @Length(message = "牌号最多允许100个字符!")
  39 + private String brand;
  40 +
  41 + /**
  42 + * 厚度
  43 + */
  44 + @ApiModelProperty(value = "厚度")
  45 + @TypeMismatch(message = "厚度格式有误!")
  46 + @IsNumberPrecision(message = "厚度最多允许4位小数!", value = 4)
  47 + private BigDecimal thickness;
  48 +
  49 + /**
  50 + * 宽度
  51 + */
  52 + @ApiModelProperty(value = "宽度")
  53 + @TypeMismatch(message = "宽度格式有误!")
  54 + @IsNumberPrecision(message = "宽度最多允许4位小数!", value = 4)
  55 + private BigDecimal width;
  56 +
  57 + /**
  58 + * 长度
  59 + */
  60 + @ApiModelProperty(value = "长度")
  61 + @TypeMismatch(message = "长度格式有误!")
  62 + @IsNumberPrecision(message = "长度最多允许4位小数!", value = 4)
  63 + private BigDecimal length;
  64 +
  65 + /**
  66 + * 状态
  67 + */
  68 + @ApiModelProperty(value = "状态")
  69 + @Length(message = "状态最多允许50个字符!")
  70 + private String status;
  71 +
  72 + /**
  73 + * 需发(t)
  74 + */
  75 + @ApiModelProperty(value = "需发(t)")
  76 + @TypeMismatch(message = "需发(t)格式有误!")
  77 + @IsNumberPrecision(message = "需发(t)最多允许4位小数!", value = 4)
  78 + private BigDecimal quantity;
  79 +
  80 + /**
  81 + * 实发(t)
  82 + */
  83 + @ApiModelProperty(value = "实发(t)")
  84 + @TypeMismatch(message = "实发(t)格式有误!")
  85 + @IsNumberPrecision(message = "实发(t)最多允许4位小数!", value = 4)
  86 + private BigDecimal shippedQuantity;
  87 +
  88 + /**
  89 + * 需求补发(t/件)
  90 + */
  91 + @ApiModelProperty(value = "需求补发(t/件)")
  92 + @TypeMismatch(message = "需求补发(t/件)格式有误!")
  93 + @IsNumberPrecision(message = "需求补发(t/件)最多允许4位小数!", value = 4)
  94 + private BigDecimal supplementaryQuantity;
  95 +
  96 + /**
  97 + * 生产科确认交付日期
  98 + */
  99 + @ApiModelProperty(value = "生产科确认交付日期")
  100 + @TypeMismatch(message = "生产科确认交付日期格式有误!")
  101 + private LocalDate confirmedDeliveryDate;
  102 +
  103 + /**
  104 + * 备注
  105 + */
  106 + @ApiModelProperty(value = "备注")
  107 + @Length(message = "备注最多允许65,535个字符!")
  108 + private String remarks;
  109 +
  110 + /**
  111 + * 排序
  112 + */
  113 + @ApiModelProperty(value = "排序")
  114 + @TypeMismatch(message = "排序格式有误!")
  115 + private Integer showOrder;
  116 +
  117 + /**
  118 + * 前端用ID
  119 + */
  120 + @ApiModelProperty(value = "前端用ID")
  121 + private String itemId;
  122 +}
  1 +package com.lframework.xingyun.sc.vo.purchase;
  2 +
  3 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  4 +import com.lframework.starter.web.core.vo.BaseVo;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +import org.hibernate.validator.constraints.Length;
  8 +
  9 +import javax.validation.constraints.NotBlank;
  10 +import javax.validation.constraints.NotNull;
  11 +import java.io.Serializable;
  12 +import java.time.LocalDate;
  13 +import java.util.List;
  14 +
  15 +@Data
  16 +public class CreateReplenishmentOrderVo implements BaseVo, Serializable {
  17 +
  18 + private static final long serialVersionUID = 1L;
  19 +
  20 + /**
  21 + * 编号
  22 + */
  23 + @ApiModelProperty(value = "编号", required = true)
  24 + @NotBlank(message = "请输入编号!")
  25 + @Length(message = "编号最多允许50个字符!")
  26 + private String code;
  27 +
  28 + /**
  29 + * 分厂
  30 + */
  31 + @ApiModelProperty(value = "分厂", required = true)
  32 + @NotBlank(message = "请输入分厂!")
  33 + @Length(message = "分厂最多允许32个字符!")
  34 + private String workshopId;
  35 +
  36 + /**
  37 + * 办事处
  38 + */
  39 + @ApiModelProperty(value = "办事处", required = true)
  40 + @NotBlank(message = "请输入办事处!")
  41 + @Length(message = "办事处最多允许32个字符!")
  42 + private String deptId;
  43 +
  44 + /**
  45 + * 购货单位
  46 + */
  47 + @ApiModelProperty(value = "购货单位", required = true)
  48 + @NotBlank(message = "请输入购货单位!")
  49 + @Length(message = "购货单位最多允许32个字符!")
  50 + private String customerId;
  51 +
  52 + /**
  53 + * 原计划发货日期
  54 + */
  55 + @ApiModelProperty(value = "原计划发货日期", required = true)
  56 + @NotNull(message = "请输入原计划发货日期!")
  57 + @TypeMismatch(message = "原计划发货日期格式有误!")
  58 + private LocalDate originPlanShipDate;
  59 +
  60 + /**
  61 + * 订货单
  62 + */
  63 + @ApiModelProperty(value = "订货单", required = true)
  64 + @NotBlank(message = "请输入订货单!")
  65 + @Length(message = "订货单最多允许32个字符!")
  66 + private String purchaseOrderId;
  67 +
  68 + /**
  69 + * 状态
  70 + */
  71 + @ApiModelProperty(value = "状态", required = true)
  72 + @NotBlank(message = "请输入状态!")
  73 + @Length(message = "状态最多允许20个字符!")
  74 + private String status;
  75 +
  76 + /**
  77 + * 补货单物料行
  78 + */
  79 + @ApiModelProperty(value = "补货单物料行")
  80 + private List<CreateReplenishmentOrderLineVo> replenishmentOrderLineList;
  81 +
  82 +}
  1 +package com.lframework.xingyun.sc.vo.purchase;
  2 +
  3 +import com.lframework.starter.web.core.vo.BaseVo;
  4 +import com.lframework.starter.web.core.vo.PageVo;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +
  8 +import java.io.Serializable;
  9 +
  10 +@Data
  11 +public class QueryReplenishmentOrderLineVo extends PageVo implements BaseVo, Serializable {
  12 +
  13 + private static final long serialVersionUID = 1L;
  14 +
  15 + /**
  16 + * 补货单
  17 + */
  18 + @ApiModelProperty("补货单")
  19 + private String replenishmentOrderId;
  20 +
  21 +}
  1 +package com.lframework.xingyun.sc.vo.purchase;
  2 +
  3 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  4 +import com.lframework.starter.web.core.vo.BaseVo;
  5 +import com.lframework.starter.web.core.vo.PageVo;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +import lombok.Data;
  8 +
  9 +import java.io.Serializable;
  10 +import java.time.LocalDateTime;
  11 +
  12 +@Data
  13 +public class QueryReplenishmentOrderVo extends PageVo implements BaseVo, Serializable {
  14 +
  15 + private static final long serialVersionUID = 1L;
  16 +
  17 + /**
  18 + * 编号
  19 + */
  20 + @ApiModelProperty("编号")
  21 + private String code;
  22 +
  23 + /**
  24 + * 分厂
  25 + */
  26 + @ApiModelProperty("分厂")
  27 + private String workshopId;
  28 +
  29 + /**
  30 + * 购货单位
  31 + */
  32 + @ApiModelProperty("购货单位")
  33 + private String customerId;
  34 +
  35 + /**
  36 + * 创建时间
  37 + */
  38 + @ApiModelProperty("创建时间")
  39 + @TypeMismatch(message = "创建时间格式有误!")
  40 + private LocalDateTime createTime;
  41 +
  42 +}
  1 +package com.lframework.xingyun.sc.vo.purchase;
  2 +
  3 +import com.lframework.starter.web.core.vo.BaseVo;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +import lombok.Data;
  6 +
  7 +import java.io.Serializable;
  8 +import java.math.BigDecimal;
  9 +import java.time.LocalDate;
  10 +
  11 +@Data
  12 +public class UpdateReplenishmentOrderLineVo implements BaseVo, Serializable {
  13 +
  14 + private static final long serialVersionUID = 1L;
  15 +
  16 + /**
  17 + * ID
  18 + */
  19 + @ApiModelProperty(value = "ID")
  20 + private String id;
  21 +
  22 + /**
  23 + * 补货单
  24 + */
  25 + @ApiModelProperty(value = "补货单")
  26 + private String replenishmentOrderId;
  27 +
  28 + /**
  29 + * 订货单表物料行ID
  30 + */
  31 + @ApiModelProperty(value = "订货单表物料行ID")
  32 + private String purchaseOrderLineId;
  33 +
  34 + /**
  35 + * 牌号
  36 + */
  37 + @ApiModelProperty(value = "牌号")
  38 + private String brand;
  39 +
  40 + /**
  41 + * 厚度
  42 + */
  43 + @ApiModelProperty(value = "厚度")
  44 + private BigDecimal thickness;
  45 +
  46 + /**
  47 + * 宽度
  48 + */
  49 + @ApiModelProperty(value = "宽度")
  50 + private BigDecimal width;
  51 +
  52 + /**
  53 + * 长度
  54 + */
  55 + @ApiModelProperty(value = "长度")
  56 + private BigDecimal length;
  57 +
  58 + /**
  59 + * 状态
  60 + */
  61 + @ApiModelProperty(value = "状态")
  62 + private String status;
  63 +
  64 + /**
  65 + * 需发(t)
  66 + */
  67 + @ApiModelProperty(value = "需发(t)")
  68 + private BigDecimal quantity;
  69 +
  70 + /**
  71 + * 实发(t)
  72 + */
  73 + @ApiModelProperty(value = "实发(t)")
  74 + private BigDecimal shippedQuantity;
  75 +
  76 + /**
  77 + * 需求补发(t/件)
  78 + */
  79 + @ApiModelProperty(value = "需求补发(t/件)")
  80 + private BigDecimal supplementaryQuantity;
  81 +
  82 + /**
  83 + * 生产科确认交付日期
  84 + */
  85 + @ApiModelProperty(value = "生产科确认交付日期")
  86 + private LocalDate confirmedDeliveryDate;
  87 +
  88 + /**
  89 + * 备注
  90 + */
  91 + @ApiModelProperty(value = "备注")
  92 + private String remarks;
  93 +
  94 + /**
  95 + * 排序
  96 + */
  97 + @ApiModelProperty(value = "排序")
  98 + private Integer showOrder;
  99 +
  100 + /**
  101 + * 前端用ID
  102 + */
  103 + @ApiModelProperty(value = "前端用ID")
  104 + private String itemId;
  105 +
  106 +}
  1 +package com.lframework.xingyun.sc.vo.purchase;
  2 +
  3 +import com.lframework.starter.web.core.components.validation.TypeMismatch;
  4 +import com.lframework.starter.web.core.vo.BaseVo;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
  7 +import org.hibernate.validator.constraints.Length;
  8 +
  9 +import javax.validation.constraints.NotBlank;
  10 +import javax.validation.constraints.NotNull;
  11 +import java.io.Serializable;
  12 +import java.time.LocalDate;
  13 +import java.util.List;
  14 +
  15 +@Data
  16 +public class UpdateReplenishmentOrderVo implements BaseVo, Serializable {
  17 +
  18 + private static final long serialVersionUID = 1L;
  19 +
  20 + /**
  21 + * ID
  22 + */
  23 + @ApiModelProperty(value = "ID", required = true)
  24 + @NotBlank(message = "id不能为空!")
  25 + private String id;
  26 +
  27 + /**
  28 + * 编号
  29 + */
  30 + @ApiModelProperty(value = "编号", required = true)
  31 + @NotBlank(message = "请输入编号!")
  32 + @Length(message = "编号最多允许50个字符!")
  33 + private String code;
  34 +
  35 + /**
  36 + * 分厂
  37 + */
  38 + @ApiModelProperty(value = "分厂", required = true)
  39 + @NotBlank(message = "请输入分厂!")
  40 + @Length(message = "分厂最多允许32个字符!")
  41 + private String workshopId;
  42 +
  43 + /**
  44 + * 办事处
  45 + */
  46 + @ApiModelProperty(value = "办事处", required = true)
  47 + @NotBlank(message = "请输入办事处!")
  48 + @Length(message = "办事处最多允许32个字符!")
  49 + private String deptId;
  50 +
  51 + /**
  52 + * 购货单位
  53 + */
  54 + @ApiModelProperty(value = "购货单位", required = true)
  55 + @NotBlank(message = "请输入购货单位!")
  56 + @Length(message = "购货单位最多允许32个字符!")
  57 + private String customerId;
  58 +
  59 + /**
  60 + * 原计划发货日期
  61 + */
  62 + @ApiModelProperty(value = "原计划发货日期", required = true)
  63 + @TypeMismatch(message = "原计划发货日期格式有误!")
  64 + @NotNull(message = "请输入原计划发货日期!")
  65 + private LocalDate originPlanShipDate;
  66 +
  67 + /**
  68 + * 订货单
  69 + */
  70 + @ApiModelProperty(value = "订货单", required = true)
  71 + @NotBlank(message = "请输入订货单!")
  72 + @Length(message = "订货单最多允许32个字符!")
  73 + private String purchaseOrderId;
  74 +
  75 + /**
  76 + * 补货单物料行
  77 + */
  78 + @ApiModelProperty("补货单物料行")
  79 + private List<UpdateReplenishmentOrderLineVo> replenishmentOrderLineList;
  80 +
  81 + /**
  82 + * 审批状态
  83 + */
  84 + @ApiModelProperty("审批状态")
  85 + private String status;
  86 +}
@@ -7,13 +7,16 @@ @@ -7,13 +7,16 @@
7 <result column="purchase_order_id" property="purchaseOrderId"/> 7 <result column="purchase_order_id" property="purchaseOrderId"/>
8 <result column="order_no" property="orderNo"/> 8 <result column="order_no" property="orderNo"/>
9 <result column="ordering_unit" property="orderingUnit"/> 9 <result column="ordering_unit" property="orderingUnit"/>
  10 + <result column="dept_id" property="deptId"/>
  11 + <result column="dept_name" property="deptName"/>
10 <result column="order_date" property="orderDate"/> 12 <result column="order_date" property="orderDate"/>
11 <result column="delivery_date" property="deliveryDate"/> 13 <result column="delivery_date" property="deliveryDate"/>
12 <result column="document_preparation_date" property="documentPreparationDate"/> 14 <result column="document_preparation_date" property="documentPreparationDate"/>
13 <result column="status" property="status"/> 15 <result column="status" property="status"/>
14 <result column="revoke_reason" property="revokeReason"/> 16 <result column="revoke_reason" property="revokeReason"/>
15 <result column="confirmation_voucher_file_id" property="confirmationVoucherFileId"/> 17 <result column="confirmation_voucher_file_id" property="confirmationVoucherFileId"/>
16 - <result column="confirmation_voucher_file_name" property="confirmationVoucherFileName"/> 18 + <result column="total_quantity" property="totalQuantity"/>
  19 + <result column="total_revoke_quantity" property="totalRevokeQuantity"/>
17 <result column="create_by_id" property="createById"/> 20 <result column="create_by_id" property="createById"/>
18 <result column="create_by" property="createBy"/> 21 <result column="create_by" property="createBy"/>
19 <result column="update_by_id" property="updateById"/> 22 <result column="update_by_id" property="updateById"/>
@@ -29,6 +32,8 @@ @@ -29,6 +32,8 @@
29 tb.order_no, 32 tb.order_no,
30 tb.ordering_unit, 33 tb.ordering_unit,
31 cu.name AS ordering_unit_name, 34 cu.name AS ordering_unit_name,
  35 + tb.dept_id,
  36 + sd.name AS dept_name,
32 tb.order_date, 37 tb.order_date,
33 tb.delivery_date, 38 tb.delivery_date,
34 tb.document_preparation_date, 39 tb.document_preparation_date,
@@ -36,6 +41,8 @@ @@ -36,6 +41,8 @@
36 tb.revoke_reason, 41 tb.revoke_reason,
37 tb.confirmation_voucher_file_id, 42 tb.confirmation_voucher_file_id,
38 tb.confirmation_voucher_file_name, 43 tb.confirmation_voucher_file_name,
  44 + tb.total_quantity,
  45 + tb.total_revoke_quantity,
39 tb.create_by_id, 46 tb.create_by_id,
40 tb.create_by, 47 tb.create_by,
41 tb.update_by_id, 48 tb.update_by_id,
@@ -44,6 +51,7 @@ @@ -44,6 +51,7 @@
44 tb.update_time 51 tb.update_time
45 FROM purchase_order_revoke AS tb 52 FROM purchase_order_revoke AS tb
46 left join base_data_customer as cu on cu.id = tb.ordering_unit 53 left join base_data_customer as cu on cu.id = tb.ordering_unit
  54 + left join sys_dept as sd on sd.id = tb.dept_id
47 </sql> 55 </sql>
48 56
49 <select id="query" resultMap="PurchaseOrderRevoke"> 57 <select id="query" resultMap="PurchaseOrderRevoke">
@@ -55,6 +63,12 @@ @@ -55,6 +63,12 @@
55 <if test="vo.orderingUnit != null and vo.orderingUnit != ''"> 63 <if test="vo.orderingUnit != null and vo.orderingUnit != ''">
56 AND tb.ordering_unit = #{vo.orderingUnit} 64 AND tb.ordering_unit = #{vo.orderingUnit}
57 </if> 65 </if>
  66 + <if test="vo.deptId != null and vo.deptId != ''">
  67 + AND tb.dept_id = #{vo.deptId}
  68 + </if>
  69 + <if test="vo.deptName != null and vo.deptName != ''">
  70 + AND sd.name LIKE CONCAT('%', #{vo.deptName},'%')
  71 + </if>
58 <if test="vo.orderingUnitName != null and vo.orderingUnitName != ''"> 72 <if test="vo.orderingUnitName != null and vo.orderingUnitName != ''">
59 AND cu.name LIKE CONCAT('%', #{vo.orderingUnitName},'%') 73 AND cu.name LIKE CONCAT('%', #{vo.orderingUnitName},'%')
60 </if> 74 </if>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.lframework.xingyun.sc.mappers.ReplenishmentOrderLineMapper">
  4 +
  5 + <resultMap id="ReplenishmentOrderLine" type="com.lframework.xingyun.sc.entity.ReplenishmentOrderLine">
  6 + <id column="id" property="id"/>
  7 + <result column="replenishment_order_id" property="replenishmentOrderId"/>
  8 + <result column="purchase_order_line_id" property="purchaseOrderLineId"/>
  9 + <result column="brand" property="brand"/>
  10 + <result column="thickness" property="thickness"/>
  11 + <result column="width" property="width"/>
  12 + <result column="length" property="length"/>
  13 + <result column="status" property="status"/>
  14 + <result column="quantity" property="quantity"/>
  15 + <result column="shipped_quantity" property="shippedQuantity"/>
  16 + <result column="supplementary_quantity" property="supplementaryQuantity"/>
  17 + <result column="confirmed_delivery_date" property="confirmedDeliveryDate"/>
  18 + <result column="remarks" property="remarks"/>
  19 + <result column="show_order" property="showOrder"/>
  20 + <result column="create_by_id" property="createById"/>
  21 + <result column="create_by" property="createBy"/>
  22 + <result column="update_by_id" property="updateById"/>
  23 + <result column="update_by" property="updateBy"/>
  24 + <result column="create_time" property="createTime"/>
  25 + <result column="update_time" property="updateTime"/>
  26 + </resultMap>
  27 +
  28 + <sql id="ReplenishmentOrderLine_sql">
  29 + SELECT tb.id,
  30 + tb.replenishment_order_id,
  31 + tb.purchase_order_line_id,
  32 + tb.brand,
  33 + tb.thickness,
  34 + tb.width,
  35 + tb.length,
  36 + tb.status,
  37 + tb.quantity,
  38 + tb.shipped_quantity,
  39 + tb.supplementary_quantity,
  40 + tb.confirmed_delivery_date,
  41 + tb.remarks,
  42 + tb.show_order,
  43 + tb.create_by_id,
  44 + tb.create_by,
  45 + tb.update_by_id,
  46 + tb.update_by,
  47 + tb.create_time,
  48 + tb.update_time
  49 + FROM tbl_replenishment_order_line AS tb
  50 + </sql>
  51 +
  52 + <select id="query" resultMap="ReplenishmentOrderLine">
  53 + <include refid="ReplenishmentOrderLine_sql"/>
  54 + <where>
  55 + <if test="vo.replenishmentOrderId != null and vo.replenishmentOrderId != ''">
  56 + AND tb.replenishment_order_id = #{vo.replenishmentOrderId}
  57 + </if>
  58 + </where>
  59 + </select>
  60 +</mapper>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.lframework.xingyun.sc.mappers.ReplenishmentOrderMapper">
  4 +
  5 + <resultMap id="ReplenishmentOrder" type="com.lframework.xingyun.sc.entity.ReplenishmentOrder">
  6 + <id column="id" property="id"/>
  7 + <result column="code" property="code"/>
  8 + <result column="workshop_id" property="workshopId"/>
  9 + <result column="dept_id" property="deptId"/>
  10 + <result column="customer_id" property="customerId"/>
  11 + <result column="origin_plan_ship_date" property="originPlanShipDate"/>
  12 + <result column="purchase_order_id" property="purchaseOrderId"/>
  13 + <result column="status" property="status"/>
  14 + <result column="create_by_id" property="createById"/>
  15 + <result column="create_by" property="createBy"/>
  16 + <result column="update_by_id" property="updateById"/>
  17 + <result column="update_by" property="updateBy"/>
  18 + <result column="create_time" property="createTime"/>
  19 + <result column="update_time" property="updateTime"/>
  20 + </resultMap>
  21 +
  22 + <sql id="ReplenishmentOrder_sql">
  23 + SELECT tb.id,
  24 + tb.code,
  25 + tb.workshop_id,
  26 + tb.dept_id,
  27 + tb.customer_id,
  28 + tb.origin_plan_ship_date,
  29 + tb.purchase_order_id,
  30 + tb.status,
  31 + tb.create_by_id,
  32 + tb.create_by,
  33 + tb.update_by_id,
  34 + tb.update_by,
  35 + tb.create_time,
  36 + tb.update_time
  37 + FROM tbl_replenishment_order AS tb
  38 + </sql>
  39 +
  40 + <select id="query" resultMap="ReplenishmentOrder">
  41 + <include refid="ReplenishmentOrder_sql"/>
  42 + <where>
  43 + <if test="vo.code != null and vo.code != ''">
  44 + AND tb.code LIKE CONCAT('%', #{vo.code}, '%')
  45 + </if>
  46 + <if test="vo.workshopId != null and vo.workshopId != ''">
  47 + AND tb.workshop_id = #{vo.workshopId}
  48 + </if>
  49 + <if test="vo.customerId != null and vo.customerId != ''">
  50 + AND tb.customer_id = #{vo.customerId}
  51 + </if>
  52 + <if test="vo.createTime != null">
  53 + AND tb.create_time = #{vo.createTime}
  54 + </if>
  55 + </where>
  56 + </select>
  57 +</mapper>