Commit 0e7f505713a5ae287a7746d52f1301755c41172b

Authored by “谢茂盛”
1 parent 8eeaa6e4

init: 订单相关

Showing 41 changed files with 1460 additions and 32 deletions
sql/table.sql
... ... @@ -20,6 +20,7 @@ CREATE TABLE `order_base_info` (
20 20 `order_hod_time` varchar(32) DEFAULT NULL COMMENT '订单上HOD时间',
21 21 `outbound_type` varchar(32) DEFAULT NULL COMMENT '出库类型',
22 22 `packet_type` varchar(64) DEFAULT NULL COMMENT '包装类型',
  23 + `order_status` INT NOT NULL COMMENT '订单状态',
23 24 `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除',
24 25 `create_time` DATETIME NOT NULL COMMENT '创建时间',
25 26 `create_by` varchar(64) NOT NULL COMMENT '创建人',
... ... @@ -43,6 +44,7 @@ CREATE TABLE `order_profit_analysis` (
43 44 `packet_total_price` DOUBLE DEFAULT 0 COMMENT '包装费用合计¥',
44 45 `exchange_rate` DOUBLE DEFAULT 0 COMMENT '汇率',
45 46 `profit_rate` DOUBLE DEFAULT 0 COMMENT '利润率',
  47 + `order_status` INT NOT NULL COMMENT '订单状态',
46 48 `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除',
47 49 `create_time` DATETIME NOT NULL COMMENT '创建时间',
48 50 `create_by` varchar(64) NOT NULL COMMENT '创建人',
... ... @@ -60,6 +62,7 @@ CREATE TABLE `order_completion_report` (
60 62 `idea_source` varchar(64) DEFAULT NULL COMMENT '想法来源',
61 63 `manual_preform` varchar(64) DEFAULT NULL COMMENT '手工初型',
62 64 `idea_manual_rate` DOUBLE DEFAULT 0 COMMENT '想法和手工比例分配',
  65 + `order_status` INT NOT NULL COMMENT '订单状态',
63 66 `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除',
64 67 `create_time` DATETIME NOT NULL COMMENT '创建时间',
65 68 `create_by` varchar(64) NOT NULL COMMENT '创建人',
... ... @@ -78,15 +81,16 @@ CREATE TABLE `order_track_stage` (
78 81 `pp_confirm_result` varchar(64) DEFAULT NULL COMMENT 'pp样品确认意见',
79 82 `eso_sample_send_time` varchar(64) DEFAULT NULL COMMENT 'EXTRA,SHOWROOM,ONLINE sample发送时间',
80 83 `shippment_sample_send_time` varchar(64) DEFAULT NULL COMMENT 'shippment sample 发送时间',
81   - `shippment_sample_confirm_time` varchar(64) DEFAULT NULL COMMENT 'shipment sample确认意见',
  84 + `shippment_sample_confirm_result` varchar(64) DEFAULT NULL COMMENT 'shipment sample确认意见',
82 85 `self_test_pass_time` varchar(64) DEFAULT NULL COMMENT '自测通过时间',
83 86 `aitex_test_send_time` varchar(64) DEFAULT NULL COMMENT 'Aitex测试发送时间',
84   - `aitex_test_finish_time` varchar(64) DEFAULT NULL COMMENT 'Aitex测试结果时间',
  87 + `aitex_test_finish_result` varchar(64) DEFAULT NULL COMMENT 'Aitex测试结果',
85 88 `sgs_test_send_time` varchar(64) DEFAULT NULL COMMENT 'SGS测试发送时间',
86   - `sgs_test_finish_time` varchar(64) DEFAULT NULL COMMENT 'SGS测试结果时间',
  89 + `sgs_test_finish_result` varchar(64) DEFAULT NULL COMMENT 'SGS测试结果',
87 90 `barcode_sticker_arrival_time` varchar(64) DEFAULT NULL COMMENT 'Barcode sticker arrival time',
88 91 `latest_arrival_time` varchar(64) DEFAULT NULL COMMENT '最晚包材到货时间',
89 92 `latest_bk_time` varchar(64) DEFAULT NULL COMMENT '最晚订舱+报关资料时间',
  93 + `order_status` INT NOT NULL COMMENT '订单状态',
90 94 `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除',
91 95 `create_time` DATETIME NOT NULL COMMENT '创建时间',
92 96 `create_by` varchar(64) NOT NULL COMMENT '创建人',
... ... @@ -113,6 +117,7 @@ CREATE TABLE `order_inspection_stage` (
113 117 `value3` varchar(128) DEFAULT NULL COMMENT '其他不良3',
114 118 `box_packet` varchar(64) DEFAULT NULL COMMENT '包装:卡片、条码、箱贴,箱单',
115 119 `end_check_result` varchar(16) DEFAULT NULL COMMENT '尾期验货结果PASS / FAIL',
  120 + `order_status` INT NOT NULL COMMENT '订单状态',
116 121 `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除',
117 122 `create_time` DATETIME NOT NULL COMMENT '创建时间',
118 123 `create_by` varchar(64) NOT NULL COMMENT '创建人',
... ... @@ -147,6 +152,8 @@ CREATE TABLE `order_field_lock_apply` (
147 152 `audit_user_id` bigint DEFAULT NULL COMMENT '审批用户id',
148 153 `fields` text DEFAULT NULL COMMENT '锁定字段 json字符串',
149 154 `status` INT DEFAULT 0 COMMENT '状态:0 待审批,1 通过,2 拒绝',
  155 + `type` INT NOT NULL COMMENT '申请类型',
  156 + `remark` varchar(64) DEFAULT NULL COMMENT '申请类型描述',
150 157 `enable_flag` INT NOT NULL COMMENT '是否可用 10-可用 20-删除',
151 158 `create_time` DATETIME NOT NULL COMMENT '创建时间',
152 159 `create_by` varchar(64) NOT NULL COMMENT '创建人',
... ...
src/main/java/com/order/erp/common/constant/ServerResultCode.java
... ... @@ -62,6 +62,10 @@ public enum ServerResultCode implements ErrorInfo {
62 62  
63 63 //订单
64 64 ORDER_BASE_INFO_EMPTY(70001, "订单基础信息不能为空!"),
  65 +
  66 + //申请
  67 + APPLY_UNLOCK_FIELD_EXIST(80001, "还有未审批完结的申请,请等上一个申请单完结!"),
  68 + APPLY_NOT_EXIST(80002, "申请单不存在!"),
65 69 ;
66 70  
67 71  
... ...
src/main/java/com/order/erp/common/utils/OrderFieldUtils.java 0 → 100644
  1 +package com.order.erp.common.utils;
  2 +
  3 +import com.order.erp.domain.OrderLockFieldEnum;
  4 +import com.order.erp.domain.vo.order.*;
  5 +
  6 +import java.util.Objects;
  7 +
  8 +/**
  9 + * @author: xms
  10 + * @description: TODO
  11 + * @date: 2023/9/13 20:02
  12 + * @version: 1.0
  13 + */
  14 +public class OrderFieldUtils {
  15 +
  16 + /**
  17 + * @param lockFieldEnum
  18 + * @return
  19 + */
  20 + public static OrderLockFieldVO initField(OrderLockFieldEnum lockFieldEnum) {
  21 + if (Objects.isNull(lockFieldEnum)) {
  22 + lockFieldEnum = OrderLockFieldEnum.LOCKED;
  23 + }
  24 + return OrderLockFieldVO.builder()
  25 + .baseFields(initOrderBaseField(lockFieldEnum))
  26 + .reportFields(initReportField(lockFieldEnum))
  27 + .profitAnalysisFields(initProfitAnalysisField(lockFieldEnum))
  28 + .trackStageFields(initTrackStageField(lockFieldEnum))
  29 + .inspectionStageFields(initInspectionStageField(lockFieldEnum))
  30 + .build();
  31 + }
  32 +
  33 + /**
  34 + * @param lockFieldEnum
  35 + * @return
  36 + */
  37 + public static OrderBaseFieldVO initOrderBaseField(OrderLockFieldEnum lockFieldEnum) {
  38 + String locked = lockFieldEnum.getStatus();
  39 + return OrderBaseFieldVO.builder()
  40 + .cnColor(locked)
  41 + .collection(locked)
  42 + .customerCode(locked)
  43 + .customerPo(locked)
  44 + .customerStyle(locked)
  45 + .innerNo(locked)
  46 + .modeleLo(locked)
  47 + .orderComposition(locked)
  48 + .orderCount(locked)
  49 + .orderHodTime(locked)
  50 + .orderStatus(locked)
  51 + .outboundType(locked)
  52 + .packetType(locked)
  53 + .picUrl(locked)
  54 + .poColor(locked)
  55 + .productionComment(locked)
  56 + .productionDepartment(locked)
  57 + .productionDepartmentConsignTime(locked)
  58 + .productStyle(locked)
  59 + .projectNo(locked)
  60 + .build();
  61 + }
  62 +
  63 + /**
  64 + * @param lockFieldEnum
  65 + * @return
  66 + */
  67 + public static OrderCompletionReportFieldVO initReportField(OrderLockFieldEnum lockFieldEnum) {
  68 + String locked = lockFieldEnum.getStatus();
  69 + return OrderCompletionReportFieldVO.builder()
  70 + .ideaManualRate(locked)
  71 + .ideaSource(locked)
  72 + .manualPreform(locked)
  73 + .orderStatus(locked)
  74 + .build();
  75 + }
  76 +
  77 + /**
  78 + * @param lockFieldEnum
  79 + * @return
  80 + */
  81 + public static OrderProfitAnalysisFieldVO initProfitAnalysisField(OrderLockFieldEnum lockFieldEnum) {
  82 + String locked = lockFieldEnum.getStatus();
  83 + return OrderProfitAnalysisFieldVO.builder()
  84 + .customerPrice(locked)
  85 + .customerTotalPrice(locked)
  86 + .exchangeRate(locked)
  87 + .orderStatus(locked)
  88 + .packetPrice(locked)
  89 + .packetTotalPrice(locked)
  90 + .productionDepartmentPrice(locked)
  91 + .productionDepartmentTotalPrice(locked)
  92 + .profitRate(locked)
  93 + .build();
  94 + }
  95 +
  96 + /**
  97 + * @param lockFieldEnum
  98 + * @return
  99 + */
  100 + public static OrderTrackStageFieldVO initTrackStageField(OrderLockFieldEnum lockFieldEnum) {
  101 + String locked = lockFieldEnum.getStatus();
  102 + return OrderTrackStageFieldVO.builder()
  103 + .aitexTestFinishResult(locked)
  104 + .aitexTestSendTime(locked)
  105 + .barcodeStickerArrivalTime(locked)
  106 + .esoSampleSendTime(locked)
  107 + .latestArrivalTime(locked)
  108 + .latestBkTime(locked)
  109 + .orderStatus(locked)
  110 + .ppConfirmResult(locked)
  111 + .ppTime(locked)
  112 + .selfTestPassTime(locked)
  113 + .sgsTestFinishResult(locked)
  114 + .sgsTestSendTime(locked)
  115 + .shippmentSampleConfirmResult(locked)
  116 + .shippmentSampleSendTime(locked)
  117 + .build();
  118 + }
  119 +
  120 + /**
  121 + * @param lockFieldEnum
  122 + * @return
  123 + */
  124 + public static OrderInspectionStageFieldVO initInspectionStageField(OrderLockFieldEnum lockFieldEnum) {
  125 + String locked = lockFieldEnum.getStatus();
  126 + return OrderInspectionStageFieldVO.builder()
  127 + .boxPacket(locked)
  128 + .electroplate(locked)
  129 + .endCheckApplyTime(locked)
  130 + .endCheckResult(locked)
  131 + .functionality(locked)
  132 + .midCheckApplyTime(locked)
  133 + .midCheckComment(locked)
  134 + .midCheckResult(locked)
  135 + .orderStatus(locked)
  136 + .specification(locked)
  137 + .value1(locked)
  138 + .value2(locked)
  139 + .value3(locked)
  140 + .build();
  141 + }
  142 +}
... ...
src/main/java/com/order/erp/config/DataScope.java
... ... @@ -27,6 +27,14 @@ public class DataScope {
27 27 }
28 28  
29 29 /**
  30 + *
  31 + * @return
  32 + */
  33 + public String getLoginUserName(){
  34 + return SecurityUtils.getUsername();
  35 + }
  36 +
  37 + /**
30 38 * @return
31 39 */
32 40 public UserVO getUser() {
... ...
src/main/java/com/order/erp/controller/AuditController.java 0 → 100644
  1 +package com.order.erp.controller;
  2 +
  3 +import com.order.erp.common.annotation.AnonymousAccess;
  4 +import com.order.erp.common.constant.ServerResult;
  5 +import com.order.erp.domain.vo.order.AuditVO;
  6 +import com.order.erp.domain.vo.order.OrderFieldLockApplyQueryVO;
  7 +import com.order.erp.service.order.OrderFieldLockApplyService;
  8 +import org.springframework.validation.annotation.Validated;
  9 +import org.springframework.web.bind.annotation.PostMapping;
  10 +import org.springframework.web.bind.annotation.RequestBody;
  11 +import org.springframework.web.bind.annotation.RequestMapping;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import javax.annotation.Resource;
  15 +
  16 +/**
  17 + * 订单基础信息表(OrderBaseInfo)表控制层
  18 + *
  19 + * @author makejava
  20 + * @since 2023-09-08 15:26:43
  21 + */
  22 +@RestController
  23 +@RequestMapping("/order/erp/audit")
  24 +public class AuditController {
  25 + /**
  26 + * 服务对象
  27 + */
  28 + @Resource
  29 + private OrderFieldLockApplyService applyService;
  30 +
  31 + /**
  32 + * 分页查询
  33 + *
  34 + * @param queryVO 查询条件
  35 + * @return 查询结果
  36 + */
  37 + @PostMapping("/list_by_page")
  38 + @AnonymousAccess
  39 + public ServerResult listByPage(@RequestBody @Validated OrderFieldLockApplyQueryVO queryVO) {
  40 + return applyService.listByPage(queryVO);
  41 + }
  42 +
  43 + /**
  44 + * 审核
  45 + *
  46 + * @param auditVO 查询条件
  47 + * @return 查询结果
  48 + */
  49 + @PostMapping("/do_audit")
  50 + @AnonymousAccess
  51 + public ServerResult doAudit(@RequestBody @Validated AuditVO auditVO) {
  52 + return applyService.doAudit(auditVO);
  53 + }
  54 +}
  55 +
... ...
src/main/java/com/order/erp/controller/DeptController.java
... ... @@ -54,6 +54,6 @@ public class DeptController {
54 54 @DeleteMapping
55 55 @PreAuthorize("@el.check('dept:del')")
56 56 public ServerResult delete(@RequestBody @Validated AdminDeptQueryVO queryVO) {
57   - return ServerResult.success(deptService.deleteById(queryVO));
  57 + return deptService.deleteById(queryVO);
58 58 }
59 59 }
60 60 \ No newline at end of file
... ...
src/main/java/com/order/erp/controller/DictionaryController.java 0 → 100644
  1 +package com.order.erp.controller;
  2 +
  3 +import com.order.erp.common.constant.ServerResult;
  4 +import com.order.erp.domain.vo.admin.DictionaryQueryVO;
  5 +import com.order.erp.domain.vo.admin.DictionaryVO;
  6 +import com.order.erp.log.Log;
  7 +import com.order.erp.service.admin.DictionaryService;
  8 +import io.swagger.annotations.Api;
  9 +import io.swagger.annotations.ApiOperation;
  10 +import org.springframework.security.access.prepost.PreAuthorize;
  11 +import org.springframework.validation.annotation.Validated;
  12 +import org.springframework.web.bind.annotation.PostMapping;
  13 +import org.springframework.web.bind.annotation.RequestBody;
  14 +import org.springframework.web.bind.annotation.RequestMapping;
  15 +import org.springframework.web.bind.annotation.RestController;
  16 +
  17 +import javax.annotation.Resource;
  18 +
  19 +/**
  20 + * @author xms
  21 + */
  22 +@RestController
  23 +@Api(tags = "系统:字典管理")
  24 +@RequestMapping("/order/erp/dictionary")
  25 +public class DictionaryController {
  26 +
  27 + @Resource
  28 + private DictionaryService dictionaryService;
  29 +
  30 +
  31 + @Log("查询字典列表")
  32 + @ApiOperation("查询字典列表")
  33 + @PostMapping(value = "/list_by_page")
  34 + @PreAuthorize("@el.check('user:list','dept:list')")
  35 + public ServerResult listByPage(@RequestBody @Validated DictionaryQueryVO queryVO) {
  36 + return dictionaryService.listByPage(queryVO);
  37 + }
  38 +
  39 + @Log("获取所有字典")
  40 + @ApiOperation("获取所有字典")
  41 + @PostMapping(value = "/get_all")
  42 + @PreAuthorize("@el.check('user:list','dept:list')")
  43 + public ServerResult getAll(@RequestBody @Validated DictionaryQueryVO queryVO) {
  44 + return dictionaryService.getAll(queryVO);
  45 + }
  46 +
  47 + @Log("新增字典")
  48 + @ApiOperation("新增字典")
  49 + @PostMapping("/add")
  50 + @PreAuthorize("@el.check('dept:add')")
  51 + public ServerResult add(@RequestBody @Validated DictionaryVO dictionaryVO) {
  52 + return dictionaryService.add(dictionaryVO);
  53 + }
  54 +
  55 + @Log("修改字典")
  56 + @ApiOperation("修改字典")
  57 + @PostMapping("/edit")
  58 + @PreAuthorize("@el.check('dept:edit')")
  59 + public ServerResult edit(@RequestBody @Validated DictionaryVO dictionaryVO) {
  60 + return dictionaryService.edit(dictionaryVO);
  61 + }
  62 +
  63 + @Log("删除字典")
  64 + @ApiOperation("删除字典")
  65 + @PostMapping("/delete")
  66 + @PreAuthorize("@el.check('dept:del')")
  67 + public ServerResult delete(@RequestBody @Validated DictionaryQueryVO queryVO) {
  68 + return dictionaryService.deleteById(queryVO);
  69 + }
  70 +}
0 71 \ No newline at end of file
... ...
src/main/java/com/order/erp/controller/OrderController.java
... ... @@ -2,9 +2,7 @@ package com.order.erp.controller;
2 2  
3 3 import com.order.erp.common.annotation.AnonymousAccess;
4 4 import com.order.erp.common.constant.ServerResult;
5   -import com.order.erp.domain.vo.order.OrderAddVO;
6   -import com.order.erp.domain.vo.order.OrderBaseInfoQueryVO;
7   -import com.order.erp.domain.vo.order.OrderBaseInfoVO;
  5 +import com.order.erp.domain.vo.order.*;
8 6 import com.order.erp.service.order.OrderBaseInfoService;
9 7 import org.springframework.validation.annotation.Validated;
10 8 import org.springframework.web.bind.annotation.PostMapping;
... ... @@ -65,6 +63,19 @@ public class OrderController {
65 63 }
66 64  
67 65 /**
  66 + * 字段解锁申请
  67 + *
  68 + * @param fieldVO 查询条件
  69 + * @return 查询结果
  70 + */
  71 + @PostMapping("/field_unlock_apply")
  72 + @AnonymousAccess
  73 + public ServerResult fieldUnlockApply(@RequestBody @Validated OrderUnlockFieldApplyVO fieldVO) {
  74 + return orderBaseInfoService.fieldUnlockApply(fieldVO);
  75 + }
  76 +
  77 +
  78 + /**
68 79 * 编辑数据
69 80 *
70 81 * @param orderBaseInfoVO 数据VO
... ...
src/main/java/com/order/erp/domain/ApplyStatusEnum.java 0 → 100644
  1 +package com.order.erp.domain;
  2 +
  3 +import lombok.AllArgsConstructor;
  4 +import lombok.Getter;
  5 +
  6 +/**
  7 + * @author: xms
  8 + * @description: TODO
  9 + * @date: 2023/9/13 18:05
  10 + * @version: 1.0
  11 + */
  12 +@Getter
  13 +@AllArgsConstructor
  14 +public enum ApplyStatusEnum {
  15 +
  16 + WAIT_AUDIT(0, "待审批"),
  17 +
  18 + AUDIT_PASS(10, "已通过"),
  19 +
  20 + AUDIT_REFUSE(20, "已驳回"),
  21 + ;
  22 + private Integer status;
  23 +
  24 + private String desc;
  25 +}
... ...
src/main/java/com/order/erp/domain/ApplyTypeEnum.java 0 → 100644
  1 +package com.order.erp.domain;
  2 +
  3 +import lombok.AllArgsConstructor;
  4 +import lombok.Getter;
  5 +
  6 +/**
  7 + * @author: xms
  8 + * @description: TODO
  9 + * @date: 2023/9/13 18:05
  10 + * @version: 1.0
  11 + */
  12 +@Getter
  13 +@AllArgsConstructor
  14 +public enum ApplyTypeEnum {
  15 +
  16 + FIELD_EDIT_APPLY(0, "字段编辑申请"),
  17 +
  18 + ORDER_PROFIT_APPLY(10, "利润分析申请"),
  19 +
  20 + ORDER_REPORT_APPLY(20, "项目报告书申请"),
  21 + ;
  22 + private Integer type;
  23 +
  24 + private String desc;
  25 +}
... ...
src/main/java/com/order/erp/domain/DictionaryEnum.java 0 → 100644
  1 +package com.order.erp.domain;
  2 +
  3 +import lombok.AllArgsConstructor;
  4 +import lombok.Getter;
  5 +
  6 +/**
  7 + * @author: xms
  8 + * @description: TODO
  9 + * @date: 2023/9/13 18:05
  10 + * @version: 1.0
  11 + */
  12 +@Getter
  13 +@AllArgsConstructor
  14 +public enum DictionaryEnum {
  15 +
  16 + EXCHANGE_RATE("exchange_rate", "汇率"),
  17 + ;
  18 + private String code;
  19 +
  20 + private String name;
  21 +}
... ...
src/main/java/com/order/erp/domain/OrderLockFieldEnum.java 0 → 100644
  1 +package com.order.erp.domain;
  2 +
  3 +import lombok.AllArgsConstructor;
  4 +import lombok.Getter;
  5 +
  6 +/**
  7 + * @author: xms
  8 + * @description: TODO
  9 + * @date: 2023/9/13 18:05
  10 + * @version: 1.0
  11 + */
  12 +@Getter
  13 +@AllArgsConstructor
  14 +public enum OrderLockFieldEnum {
  15 +
  16 + LOCKED("LOCKED", "锁定"),
  17 +
  18 + UN_LOCKED("UN_LOCKED", "解锁"),
  19 + ;
  20 + private String status;
  21 +
  22 + private String desc;
  23 +}
... ...
src/main/java/com/order/erp/domain/OrderStatusEnum.java 0 → 100644
  1 +package com.order.erp.domain;
  2 +
  3 +import lombok.AllArgsConstructor;
  4 +import lombok.Getter;
  5 +
  6 +/**
  7 + * @author: xms
  8 + * @description: TODO
  9 + * @date: 2023/9/13 18:05
  10 + * @version: 1.0
  11 + */
  12 +@Getter
  13 +@AllArgsConstructor
  14 +public enum OrderStatusEnum {
  15 +
  16 + CREATE_FINISH(0, "订单创建完成"),
  17 +
  18 + PROFIT_WAIT_AUDIT(10, "利润分析表待审核"),
  19 +
  20 + PROFIT_AUDIT_PASS(11, "利润分析表审核通过"),
  21 +
  22 + PROFIT_AUDIT_REFUSE(12, "利润分析表审核驳回"),
  23 +
  24 + REPORT_WAIT_AUDIT(20, "项目报告书待审核"),
  25 +
  26 + REPORT_AUDIT_PASS(21, "项目报告书审核通过"),
  27 +
  28 + REPORT_AUDIT_REFUSE(22, "项目报告书审核驳回"),
  29 +
  30 + TRACK_ING(30, "跟单中"),
  31 +
  32 + TRACK_PASS(31, "跟单完成"),
  33 +
  34 + INSPECT_ING(40, "质检中"),
  35 +
  36 + INSPECT_PASS(41, "质检完成"),
  37 +
  38 + ORDER_FINISH(50, "订单完成"),
  39 + ;
  40 + private Integer status;
  41 +
  42 + private String desc;
  43 +}
... ...
src/main/java/com/order/erp/domain/dto/order/OrderBaseInfoDO.java
... ... @@ -101,4 +101,9 @@ public class OrderBaseInfoDO extends BaseDO implements Serializable {
101 101 */
102 102 private String packetType;
103 103  
  104 + /**
  105 + * 订单状态:枚举类 OrderStatusEnum
  106 + */
  107 + private Integer orderStatus;
  108 +
104 109 }
... ...
src/main/java/com/order/erp/domain/dto/order/OrderCompletionReportDO.java
... ... @@ -41,4 +41,10 @@ public class OrderCompletionReportDO extends BaseDO implements Serializable {
41 41 */
42 42 private Double ideaManualRate;
43 43  
  44 + /**
  45 + * 订单状态:枚举类 OrderStatusEnum
  46 + */
  47 + private Integer orderStatus;
  48 +
  49 +
44 50 }
... ...
src/main/java/com/order/erp/domain/dto/order/OrderFieldLockApplyDO.java
... ... @@ -21,7 +21,6 @@ import java.io.Serializable;
21 21 @EqualsAndHashCode(callSuper = false)
22 22 @SuperBuilder
23 23 public class OrderFieldLockApplyDO extends BaseDO implements Serializable {
24   - private static final long serialVersionUID = 646989609392883241L;
25 24  
26 25 private Long id;
27 26 /**
... ... @@ -45,4 +44,14 @@ public class OrderFieldLockApplyDO extends BaseDO implements Serializable {
45 44 */
46 45 private Integer status;
47 46  
  47 + /**
  48 + * 申请类型:枚举类ApplyTypeEnum
  49 + */
  50 + private Integer type;
  51 +
  52 + /**
  53 + * 申请类型描述
  54 + */
  55 + private String remark;
  56 +
48 57 }
... ...
src/main/java/com/order/erp/domain/dto/order/OrderInspectionStageDO.java
... ... @@ -77,4 +77,10 @@ public class OrderInspectionStageDO extends BaseDO implements Serializable {
77 77 */
78 78 private String endCheckResult;
79 79  
  80 + /**
  81 + * 订单状态:枚举类 OrderStatusEnum
  82 + */
  83 + private Integer orderStatus;
  84 +
  85 +
80 86 }
... ...
src/main/java/com/order/erp/domain/dto/order/OrderProfitAnalysisDO.java
... ... @@ -61,4 +61,10 @@ public class OrderProfitAnalysisDO extends BaseDO implements Serializable {
61 61 */
62 62 private Double profitRate;
63 63  
  64 + /**
  65 + * 订单状态:枚举类 OrderStatusEnum
  66 + */
  67 + private Integer orderStatus;
  68 +
  69 +
64 70 }
... ...
src/main/java/com/order/erp/domain/dto/order/OrderTrackStageDO.java
... ... @@ -47,7 +47,7 @@ public class OrderTrackStageDO extends BaseDO implements Serializable {
47 47 /**
48 48 * shipment sample确认意见
49 49 */
50   - private String shippmentSampleConfirmTime;
  50 + private String shippmentSampleConfirmResult;
51 51 /**
52 52 * 自测通过时间
53 53 */
... ... @@ -57,17 +57,17 @@ public class OrderTrackStageDO extends BaseDO implements Serializable {
57 57 */
58 58 private String aitexTestSendTime;
59 59 /**
60   - * Aitex测试结果时间
  60 + * Aitex测试结果
61 61 */
62   - private String aitexTestFinishTime;
  62 + private String aitexTestFinishResult;
63 63 /**
64 64 * SGS测试发送时间
65 65 */
66 66 private String sgsTestSendTime;
67 67 /**
68   - * SGS测试结果时间
  68 + * SGS测试结果
69 69 */
70   - private String sgsTestFinishTime;
  70 + private String sgsTestFinishResult;
71 71 /**
72 72 * Barcode sticker arrival time
73 73 */
... ... @@ -81,4 +81,10 @@ public class OrderTrackStageDO extends BaseDO implements Serializable {
81 81 */
82 82 private String latestBkTime;
83 83  
  84 + /**
  85 + * 订单状态:枚举类 OrderStatusEnum
  86 + */
  87 + private Integer orderStatus;
  88 +
  89 +
84 90 }
... ...
src/main/java/com/order/erp/domain/vo/admin/DictionaryResultVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.admin;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + * @author makejava
  10 + * @since 2023-08-30 17:51:48
  11 + */
  12 +@Data
  13 +@AllArgsConstructor
  14 +@ToString
  15 +@NoArgsConstructor
  16 +@EqualsAndHashCode(callSuper = false)
  17 +@SuperBuilder
  18 +public class DictionaryResultVO implements Serializable {
  19 +
  20 + private Long id;
  21 + /**
  22 + * 字典编码
  23 + */
  24 + private String dictCode;
  25 + /**
  26 + * 名称
  27 + */
  28 + private String dictName;
  29 + /**
  30 + * 值
  31 + */
  32 + private String dictValue;
  33 + /**
  34 + * 备注
  35 + */
  36 + private String remark;
  37 + /**
  38 + * 排序字段
  39 + */
  40 + private Integer sort;
  41 +
  42 +
  43 +}
... ...
src/main/java/com/order/erp/domain/vo/order/AuditVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import com.order.erp.domain.vo.BasePageVO;
  4 +import lombok.*;
  5 +import lombok.experimental.SuperBuilder;
  6 +
  7 +import javax.validation.constraints.NotNull;
  8 +import java.io.Serializable;
  9 +
  10 +/**
  11 + * @author makejava
  12 + * @since 2023-09-08 15:26:44
  13 + */
  14 +@Data
  15 +@AllArgsConstructor
  16 +@ToString
  17 +@NoArgsConstructor
  18 +@EqualsAndHashCode(callSuper = false)
  19 +@SuperBuilder
  20 +public class AuditVO extends BasePageVO implements Serializable {
  21 +
  22 + /**
  23 + * 申请id
  24 + */
  25 + @NotNull(message = "申请id不能为空")
  26 + private Long id;
  27 +
  28 + /**
  29 + * 状态:1 通过,2 拒绝
  30 + */
  31 + @NotNull(message = "状态不能为空")
  32 + private Integer status;
  33 +}
  34 +
... ...
src/main/java/com/order/erp/domain/vo/order/OrderApplyResultVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.FieldFill;
  4 +import com.baomidou.mybatisplus.annotation.TableField;
  5 +import com.baomidou.mybatisplus.annotation.TableLogic;
  6 +import com.fasterxml.jackson.annotation.JsonFormat;
  7 +import lombok.*;
  8 +import lombok.experimental.SuperBuilder;
  9 +import org.apache.ibatis.type.LocalDateTimeTypeHandler;
  10 +
  11 +import java.io.Serializable;
  12 +import java.time.LocalDateTime;
  13 +
  14 +/**
  15 + * 订单基础信息表(OrderBaseInfo)实体类
  16 + *
  17 + * @author makejava
  18 + * @since 2023-09-08 15:26:43
  19 + */
  20 +@Data
  21 +@AllArgsConstructor
  22 +@ToString
  23 +@NoArgsConstructor
  24 +@EqualsAndHashCode(callSuper = false)
  25 +@SuperBuilder
  26 +public class OrderApplyResultVO implements Serializable {
  27 +
  28 + private Long id;
  29 +
  30 + /**
  31 + * 订单id
  32 + */
  33 + private Long orderId;
  34 + /**
  35 + * 申请用户id
  36 + */
  37 + private Long applyUserId;
  38 + /**
  39 + * 审批用户id
  40 + */
  41 + private Long auditUserId;
  42 + /**
  43 + * 锁定字段 json字符串
  44 + */
  45 + private OrderLockFieldVO fieldInfos;
  46 + /**
  47 + * 状态:0 待审批,1 通过,2 拒绝
  48 + */
  49 + private Integer status;
  50 +
  51 + /**
  52 + * 申请类型:枚举类ApplyTypeEnum
  53 + */
  54 + private Integer type;
  55 +
  56 + /**
  57 + * 申请类型描述
  58 + */
  59 + private String desc;
  60 +
  61 + /**
  62 + * 创建时间
  63 + */
  64 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  65 + private LocalDateTime createTime;
  66 +
  67 + /**
  68 + * 创建人
  69 + */
  70 + private String createBy;
  71 +
  72 + /**
  73 + * 修改时间
  74 + */
  75 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  76 + private LocalDateTime modifyTime;
  77 +
  78 + /**
  79 + * 修改人
  80 + */
  81 + private String modifyBy;
  82 +
  83 +
  84 +}
... ...
src/main/java/com/order/erp/domain/vo/order/OrderBaseFieldVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import com.order.erp.domain.OrderLockFieldEnum;
  4 +import lombok.*;
  5 +import lombok.experimental.SuperBuilder;
  6 +
  7 +import java.io.Serializable;
  8 +
  9 +/**
  10 + *
  11 + * @author makejava
  12 + * @since 2023-09-08 15:26:43
  13 + */
  14 +@Data
  15 +@AllArgsConstructor
  16 +@ToString
  17 +@NoArgsConstructor
  18 +@EqualsAndHashCode(callSuper = false)
  19 +@SuperBuilder
  20 +public class OrderBaseFieldVO implements Serializable {
  21 +
  22 + /**
  23 + * 客户编码
  24 + */
  25 + private String customerCode = OrderLockFieldEnum.LOCKED.getStatus();
  26 + /**
  27 + * 项目号
  28 + */
  29 + private String projectNo = OrderLockFieldEnum.LOCKED.getStatus();
  30 + /**
  31 + * 生产科
  32 + */
  33 + private String productionDepartment = OrderLockFieldEnum.LOCKED.getStatus();
  34 + /**
  35 + * 内部编号
  36 + */
  37 + private String innerNo = OrderLockFieldEnum.LOCKED.getStatus();
  38 + /**
  39 + * 客户po号
  40 + */
  41 + private String customerPo = OrderLockFieldEnum.LOCKED.getStatus();
  42 + /**
  43 + * 客户STYLE#
  44 + */
  45 + private String customerStyle = OrderLockFieldEnum.LOCKED.getStatus();
  46 + /**
  47 + * Modelo(REFERENCE)
  48 + */
  49 + private String modeleLo = OrderLockFieldEnum.LOCKED.getStatus();
  50 + /**
  51 + * COLLECTION (style description)
  52 + */
  53 + private String collection = OrderLockFieldEnum.LOCKED.getStatus();
  54 + /**
  55 + * PO COLOR
  56 + */
  57 + private String poColor = OrderLockFieldEnum.LOCKED.getStatus();
  58 + /**
  59 + * 颜色中文
  60 + */
  61 + private String cnColor = OrderLockFieldEnum.LOCKED.getStatus();
  62 + /**
  63 + * pic图片地址
  64 + */
  65 + private String picUrl = OrderLockFieldEnum.LOCKED.getStatus();
  66 + /**
  67 + * 生产要求
  68 + */
  69 + private String productionComment = OrderLockFieldEnum.LOCKED.getStatus();
  70 + /**
  71 + * 数量
  72 + */
  73 + private String orderCount = OrderLockFieldEnum.LOCKED.getStatus();
  74 + /**
  75 + * 订单成分
  76 + */
  77 + private String orderComposition = OrderLockFieldEnum.LOCKED.getStatus();
  78 + /**
  79 + * 款式类型
  80 + */
  81 + private String productStyle = OrderLockFieldEnum.LOCKED.getStatus();
  82 + /**
  83 + * 生成科拖货时间
  84 + */
  85 + private String productionDepartmentConsignTime = OrderLockFieldEnum.LOCKED.getStatus();
  86 + /**
  87 + * 订单上HOD时间
  88 + */
  89 + private String orderHodTime = OrderLockFieldEnum.LOCKED.getStatus();
  90 + /**
  91 + * 出库类型
  92 + */
  93 + private String outboundType = OrderLockFieldEnum.LOCKED.getStatus();
  94 + /**
  95 + * 包装类型
  96 + */
  97 + private String packetType = OrderLockFieldEnum.LOCKED.getStatus();
  98 +
  99 + /**
  100 + * 订单状态:枚举类 OrderStatusEnum
  101 + */
  102 + private String orderStatus = OrderLockFieldEnum.LOCKED.getStatus();
  103 +
  104 +}
... ...
src/main/java/com/order/erp/domain/vo/order/OrderBaseInfoVO.java
... ... @@ -98,5 +98,9 @@ public class OrderBaseInfoVO implements Serializable {
98 98 */
99 99 private String packetType;
100 100  
  101 + /**
  102 + * 订单状态:枚举类 OrderStatusEnum
  103 + */
  104 + private Integer orderStatus;
101 105  
102 106 }
... ...
src/main/java/com/order/erp/domain/vo/order/OrderCompletionReportFieldVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + *
  10 + * @author makejava
  11 + * @since 2023-09-08 15:26:44
  12 + */
  13 +@Data
  14 +@AllArgsConstructor
  15 +@ToString
  16 +@NoArgsConstructor
  17 +@EqualsAndHashCode(callSuper = false)
  18 +@SuperBuilder
  19 +public class OrderCompletionReportFieldVO implements Serializable {
  20 +
  21 + /**
  22 + * 想法来源
  23 + */
  24 + private String ideaSource;
  25 + /**
  26 + * 手工初型
  27 + */
  28 + private String manualPreform;
  29 + /**
  30 + * 想法和手工比例分配
  31 + */
  32 + private String ideaManualRate;
  33 +
  34 + /**
  35 + * 订单状态
  36 + */
  37 + private String orderStatus;
  38 +}
... ...
src/main/java/com/order/erp/domain/vo/order/OrderCompletionReportVO.java
... ... @@ -38,5 +38,8 @@ public class OrderCompletionReportVO implements Serializable {
38 38 */
39 39 private Double ideaManualRate;
40 40  
41   -
  41 + /**
  42 + * 订单状态:枚举类 OrderStatusEnum
  43 + */
  44 + private Integer orderStatus;
42 45 }
... ...
src/main/java/com/order/erp/domain/vo/order/OrderInfoResultVO.java
... ... @@ -39,4 +39,9 @@ public class OrderInfoResultVO extends OrderBaseInfoVO implements Serializable {
39 39 */
40 40 private OrderInspectionStageVO inspectionStageInfo;
41 41  
  42 + /**
  43 + * 字段锁定集合
  44 + */
  45 + private OrderLockFieldVO lockFields;
  46 +
42 47 }
... ...
src/main/java/com/order/erp/domain/vo/order/OrderInspectionStageFieldVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + *
  10 + * @author makejava
  11 + * @since 2023-09-08 15:26:45
  12 + */
  13 +@Data
  14 +@AllArgsConstructor
  15 +@ToString
  16 +@NoArgsConstructor
  17 +@EqualsAndHashCode(callSuper = false)
  18 +@SuperBuilder
  19 +public class OrderInspectionStageFieldVO implements Serializable {
  20 + /**
  21 + * 中期验货申请时间
  22 + */
  23 + private String midCheckApplyTime;
  24 + /**
  25 + * 中期验货(功能性-拉力/跌落等、外观性-颜色/规格等、耐久性-烤厅等)
  26 + */
  27 + private String midCheckComment;
  28 + /**
  29 + * 中期验货结果PASS / FAIL
  30 + */
  31 + private String midCheckResult;
  32 + /**
  33 + * 尾期验货申请时间
  34 + */
  35 + private String endCheckApplyTime;
  36 + /**
  37 + * 长度/规格
  38 + */
  39 + private String specification;
  40 + /**
  41 + * 功能性不良
  42 + */
  43 + private String functionality;
  44 + /**
  45 + * 电镀不良
  46 + */
  47 + private String electroplate;
  48 + /**
  49 + * 不良1
  50 + */
  51 + private String value1;
  52 + /**
  53 + * 不良2
  54 + */
  55 + private String value2;
  56 + /**
  57 + * 其他不良3
  58 + */
  59 + private String value3;
  60 + /**
  61 + * 包装:卡片、条码、箱贴,箱单
  62 + */
  63 + private String boxPacket;
  64 + /**
  65 + * 尾期验货结果PASS / FAIL
  66 + */
  67 + private String endCheckResult;
  68 +
  69 + /**
  70 + * 订单状态
  71 + */
  72 + private String orderStatus;
  73 +}
... ...
src/main/java/com/order/erp/domain/vo/order/OrderInspectionStageVO.java
... ... @@ -74,5 +74,8 @@ public class OrderInspectionStageVO implements Serializable {
74 74 */
75 75 private String endCheckResult;
76 76  
77   -
  77 + /**
  78 + * 订单状态:枚举类 OrderStatusEnum
  79 + */
  80 + private Integer orderStatus;
78 81 }
... ...
src/main/java/com/order/erp/domain/vo/order/OrderLockFieldVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + * @author makejava
  10 + * @since 2023-09-08 15:26:43
  11 + */
  12 +@Data
  13 +@AllArgsConstructor
  14 +@ToString
  15 +@NoArgsConstructor
  16 +@EqualsAndHashCode(callSuper = false)
  17 +@SuperBuilder
  18 +public class OrderLockFieldVO implements Serializable {
  19 +
  20 + /**
  21 + * 基础信息字段
  22 + */
  23 + private OrderBaseFieldVO baseFields;
  24 +
  25 + /**
  26 + * 利润分析字段
  27 + */
  28 + private OrderProfitAnalysisFieldVO profitAnalysisFields;
  29 +
  30 + /**
  31 + * 项目报告书字段
  32 + */
  33 + private OrderCompletionReportFieldVO reportFields;
  34 +
  35 + /**
  36 + * 跟单字段
  37 + */
  38 + private OrderTrackStageFieldVO trackStageFields;
  39 +
  40 + /**
  41 + * 质检字段
  42 + */
  43 + private OrderInspectionStageFieldVO inspectionStageFields;
  44 +
  45 +}
... ...
src/main/java/com/order/erp/domain/vo/order/OrderProfitAnalysisFieldVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + *
  10 + * @author makejava
  11 + * @since 2023-09-08 15:26:47
  12 + */
  13 +@Data
  14 +@AllArgsConstructor
  15 +@ToString
  16 +@NoArgsConstructor
  17 +@EqualsAndHashCode(callSuper = false)
  18 +@SuperBuilder
  19 +public class OrderProfitAnalysisFieldVO implements Serializable {
  20 + /**
  21 + * 客户单价$
  22 + */
  23 + private String customerPrice;
  24 + /**
  25 + * 客户总价$
  26 + */
  27 + private String customerTotalPrice;
  28 + /**
  29 + * 生成科单价¥
  30 + */
  31 + private String productionDepartmentPrice;
  32 + /**
  33 + * 生成科总价¥
  34 + */
  35 + private String productionDepartmentTotalPrice;
  36 + /**
  37 + * 包装费用¥
  38 + */
  39 + private String packetPrice;
  40 + /**
  41 + * 包装费用合计¥
  42 + */
  43 + private String packetTotalPrice;
  44 + /**
  45 + * 汇率
  46 + */
  47 + private String exchangeRate;
  48 + /**
  49 + * 利润率
  50 + */
  51 + private String profitRate;
  52 +
  53 + /**
  54 + * 订单状态:枚举类 OrderStatusEnum
  55 + */
  56 + private String orderStatus;
  57 +
  58 +
  59 +}
... ...
src/main/java/com/order/erp/domain/vo/order/OrderProfitAnalysisVO.java
... ... @@ -58,5 +58,10 @@ public class OrderProfitAnalysisVO implements Serializable {
58 58 */
59 59 private Double profitRate;
60 60  
  61 + /**
  62 + * 订单状态:枚举类 OrderStatusEnum
  63 + */
  64 + private Integer orderStatus;
  65 +
61 66  
62 67 }
... ...
src/main/java/com/order/erp/domain/vo/order/OrderTrackStageFieldVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + * @author makejava
  10 + * @since 2023-09-08 15:26:48
  11 + */
  12 +@Data
  13 +@AllArgsConstructor
  14 +@ToString
  15 +@NoArgsConstructor
  16 +@EqualsAndHashCode(callSuper = false)
  17 +@SuperBuilder
  18 +public class OrderTrackStageFieldVO implements Serializable {
  19 +
  20 + /**
  21 + * pp date
  22 + */
  23 + private String ppTime;
  24 + /**
  25 + * pp样品确认意见
  26 + */
  27 + private String ppConfirmResult;
  28 + /**
  29 + * EXTRA,SHOWROOM,ONLINE sample发送时间
  30 + */
  31 + private String esoSampleSendTime;
  32 + /**
  33 + * shippment sample 发送时间
  34 + */
  35 + private String shippmentSampleSendTime;
  36 + /**
  37 + * shipment sample确认意见
  38 + */
  39 + private String shippmentSampleConfirmResult;
  40 + /**
  41 + * 自测通过时间
  42 + */
  43 + private String selfTestPassTime;
  44 + /**
  45 + * Aitex测试发送时间
  46 + */
  47 + private String aitexTestSendTime;
  48 + /**
  49 + * Aitex测试结果
  50 + */
  51 + private String aitexTestFinishResult;
  52 + /**
  53 + * SGS测试发送时间
  54 + */
  55 + private String sgsTestSendTime;
  56 + /**
  57 + * SGS测试结果
  58 + */
  59 + private String sgsTestFinishResult;
  60 + /**
  61 + * Barcode sticker arrival time
  62 + */
  63 + private String barcodeStickerArrivalTime;
  64 + /**
  65 + * 最晚包材到货时间
  66 + */
  67 + private String latestArrivalTime;
  68 + /**
  69 + * 最晚订舱+报关资料时间
  70 + */
  71 + private String latestBkTime;
  72 +
  73 + /**
  74 + * 订单状态:枚举类 OrderStatusEnum
  75 + */
  76 + private String orderStatus;
  77 +}
... ...
src/main/java/com/order/erp/domain/vo/order/OrderTrackStageVO.java
... ... @@ -78,5 +78,8 @@ public class OrderTrackStageVO implements Serializable {
78 78 */
79 79 private String latestBkTime;
80 80  
81   -
  81 + /**
  82 + * 订单状态:枚举类 OrderStatusEnum
  83 + */
  84 + private Integer orderStatus;
82 85 }
... ...
src/main/java/com/order/erp/domain/vo/order/OrderUnlockFieldApplyVO.java 0 → 100644
  1 +package com.order.erp.domain.vo.order;
  2 +
  3 +import lombok.*;
  4 +import lombok.experimental.SuperBuilder;
  5 +
  6 +import javax.validation.constraints.NotNull;
  7 +import java.io.Serializable;
  8 +
  9 +/**
  10 + * @author makejava
  11 + * @since 2023-09-08 15:26:43
  12 + */
  13 +@Data
  14 +@AllArgsConstructor
  15 +@ToString
  16 +@NoArgsConstructor
  17 +@EqualsAndHashCode(callSuper = false)
  18 +@SuperBuilder
  19 +public class OrderUnlockFieldApplyVO implements Serializable {
  20 +
  21 + @NotNull(message = "订单id不能为空!")
  22 + private Long orderId;
  23 +
  24 + /**
  25 + * 基础信息字段
  26 + */
  27 + private OrderBaseFieldVO baseFields;
  28 +
  29 + /**
  30 + * 利润分析字段
  31 + */
  32 + private OrderProfitAnalysisFieldVO profitAnalysisFields;
  33 +
  34 + /**
  35 + * 项目报告书字段
  36 + */
  37 + private OrderCompletionReportFieldVO reportFields;
  38 +
  39 + /**
  40 + * 跟单字段
  41 + */
  42 + private OrderTrackStageFieldVO trackStageFields;
  43 +
  44 + /**
  45 + * 质检字段
  46 + */
  47 + private OrderInspectionStageFieldVO inspectionStageFields;
  48 +
  49 +}
... ...
src/main/java/com/order/erp/service/admin/DictionaryService.java
... ... @@ -31,6 +31,20 @@ public interface DictionaryService extends IService<DictionaryDO> {
31 31 ServerResult list(DictionaryQueryVO dictionaryQueryVO);
32 32  
33 33 /**
  34 + *
  35 + * @param dictionaryQueryVO
  36 + * @return
  37 + */
  38 + ServerResult listByPage(DictionaryQueryVO dictionaryQueryVO);
  39 +
  40 + /**
  41 + *
  42 + * @param dictionaryQueryVO
  43 + * @return
  44 + */
  45 + ServerResult getAll(DictionaryQueryVO dictionaryQueryVO);
  46 +
  47 + /**
34 48 * 新增数据
35 49 *
36 50 * @param dictionaryVO 数据VO
... ...
src/main/java/com/order/erp/service/admin/impl/DictionaryServiceImpl.java
... ... @@ -2,20 +2,29 @@ package com.order.erp.service.admin.impl;
2 2  
3 3 import cn.hutool.core.bean.BeanUtil;
4 4 import cn.hutool.core.collection.CollUtil;
  5 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 6 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  7 +import com.baomidou.mybatisplus.core.metadata.IPage;
  8 +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
  9 +import com.baomidou.mybatisplus.core.toolkit.StringUtils;
  10 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 11 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 12 import com.order.erp.common.constant.Constant;
8 13 import com.order.erp.common.constant.ServerResult;
  14 +import com.order.erp.domain.dto.BaseDO;
9 15 import com.order.erp.domain.dto.admin.DictionaryDO;
10 16 import com.order.erp.domain.vo.admin.DictionaryQueryVO;
  17 +import com.order.erp.domain.vo.admin.DictionaryResultVO;
11 18 import com.order.erp.domain.vo.admin.DictionaryVO;
12 19 import com.order.erp.mapper.admin.DictionaryMapper;
13 20 import com.order.erp.service.admin.DictionaryService;
14 21 import lombok.extern.slf4j.Slf4j;
  22 +import org.springframework.beans.BeanUtils;
15 23 import org.springframework.stereotype.Service;
16 24  
17 25 import java.util.List;
18 26 import java.util.Objects;
  27 +import java.util.stream.Collectors;
19 28  
20 29 /**
21 30 * 字典表(Dictionary)表服务实现类
... ... @@ -59,6 +68,51 @@ public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Diction
59 68 return ServerResult.success();
60 69 }
61 70  
  71 + @Override
  72 + public ServerResult listByPage(DictionaryQueryVO queryVO) {
  73 +
  74 + LambdaQueryWrapper<DictionaryDO> queryWrapper = buildQueryByParam(queryVO);
  75 + Page page = new Page<>(queryVO.getPageNo(), queryVO.getPageSize());
  76 + IPage<DictionaryDO> iPage = page(page, queryWrapper);
  77 +
  78 + Page<DictionaryResultVO> webVOPage = new Page<>();
  79 + List<DictionaryDO> dictionaryDOList = iPage.getRecords();
  80 + if (CollectionUtils.isNotEmpty(dictionaryDOList)) {
  81 + List<DictionaryResultVO> queryVos = dictionaryDOList.stream().map(x -> {
  82 + DictionaryResultVO resultVO = new DictionaryResultVO();
  83 + BeanUtils.copyProperties(x, resultVO);
  84 + return resultVO;
  85 + }).collect(Collectors.toList());
  86 + webVOPage.setRecords(queryVos);
  87 + }
  88 + BeanUtils.copyProperties(page, webVOPage, "records");
  89 + return ServerResult.success(webVOPage);
  90 + }
  91 +
  92 + /**
  93 + * @param queryVO
  94 + * @return
  95 + */
  96 + private LambdaQueryWrapper<DictionaryDO> buildQueryByParam(DictionaryQueryVO queryVO) {
  97 + return new LambdaQueryWrapper<DictionaryDO>()
  98 + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
  99 + .like(StringUtils.isNotBlank(queryVO.getDictName()), DictionaryDO::getDictName, queryVO.getDictName())
  100 + .eq(StringUtils.isNotBlank(queryVO.getDictCode()), DictionaryDO::getDictCode, queryVO.getDictCode());
  101 + }
  102 +
  103 + @Override
  104 + public ServerResult getAll(DictionaryQueryVO dictionaryQueryVO) {
  105 + List<DictionaryDO> dictionaryDOList = list(buildQueryByParam(dictionaryQueryVO));
  106 + if (CollectionUtils.isEmpty(dictionaryDOList)) {
  107 + return ServerResult.success();
  108 + }
  109 + return ServerResult.success(dictionaryDOList.stream().map(x -> {
  110 + DictionaryResultVO resultVO = new DictionaryResultVO();
  111 + BeanUtils.copyProperties(x, resultVO);
  112 + return resultVO;
  113 + }).collect(Collectors.toList()));
  114 + }
  115 +
62 116 /**
63 117 * 新增数据
64 118 *
... ...
src/main/java/com/order/erp/service/order/OrderBaseInfoService.java
... ... @@ -3,9 +3,7 @@ package com.order.erp.service.order;
3 3 import com.baomidou.mybatisplus.extension.service.IService;
4 4 import com.order.erp.common.constant.ServerResult;
5 5 import com.order.erp.domain.dto.order.OrderBaseInfoDO;
6   -import com.order.erp.domain.vo.order.OrderAddVO;
7   -import com.order.erp.domain.vo.order.OrderBaseInfoQueryVO;
8   -import com.order.erp.domain.vo.order.OrderBaseInfoVO;
  6 +import com.order.erp.domain.vo.order.*;
9 7  
10 8 /**
11 9 * 订单基础信息表(OrderBaseInfo)表服务接口
... ... @@ -40,6 +38,13 @@ public interface OrderBaseInfoService extends IService&lt;OrderBaseInfoDO&gt; {
40 38 ServerResult listByPage(OrderBaseInfoQueryVO orderBaseInfoQueryVO);
41 39  
42 40 /**
  41 + *
  42 + * @param fieldVO
  43 + * @return
  44 + */
  45 + ServerResult fieldUnlockApply(OrderUnlockFieldApplyVO fieldVO);
  46 +
  47 + /**
43 48 * 新增数据
44 49 *
45 50 * @param orderAddVO 数据VO
... ...
src/main/java/com/order/erp/service/order/OrderFieldLockApplyService.java
... ... @@ -3,6 +3,7 @@ package com.order.erp.service.order;
3 3 import com.baomidou.mybatisplus.extension.service.IService;
4 4 import com.order.erp.common.constant.ServerResult;
5 5 import com.order.erp.domain.dto.order.OrderFieldLockApplyDO;
  6 +import com.order.erp.domain.vo.order.AuditVO;
6 7 import com.order.erp.domain.vo.order.OrderFieldLockApplyQueryVO;
7 8 import com.order.erp.domain.vo.order.OrderFieldLockApplyVO;
8 9  
... ... @@ -31,6 +32,12 @@ public interface OrderFieldLockApplyService extends IService&lt;OrderFieldLockApply
31 32 ServerResult list(OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO);
32 33  
33 34 /**
  35 + * @param orderFieldLockApplyQueryVO
  36 + * @return
  37 + */
  38 + ServerResult listByPage(OrderFieldLockApplyQueryVO orderFieldLockApplyQueryVO);
  39 +
  40 + /**
34 41 * 新增数据
35 42 *
36 43 * @param orderFieldLockApplyVO 数据VO
... ... @@ -39,6 +46,12 @@ public interface OrderFieldLockApplyService extends IService&lt;OrderFieldLockApply
39 46 ServerResult add(OrderFieldLockApplyVO orderFieldLockApplyVO);
40 47  
41 48 /**
  49 + * @param auditVO
  50 + * @return
  51 + */
  52 + ServerResult doAudit(AuditVO auditVO);
  53 +
  54 + /**
42 55 * 修改数据
43 56 *
44 57 * @param orderFieldLockApplyVO 数据VO
... ...
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
... ... @@ -2,6 +2,7 @@ package com.order.erp.service.order.impl;
2 2  
3 3 import cn.hutool.core.bean.BeanUtil;
4 4 import cn.hutool.core.collection.CollUtil;
  5 +import com.alibaba.fastjson.JSONObject;
5 6 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
6 7 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
7 8 import com.baomidou.mybatisplus.core.metadata.IPage;
... ... @@ -13,6 +14,12 @@ import com.canrd.shop.common.constant.ServerResultCode;
13 14 import com.order.erp.common.constant.Constant;
14 15 import com.order.erp.common.constant.ServerResult;
15 16 import com.order.erp.common.exception.BusinessException;
  17 +import com.order.erp.common.utils.OrderFieldUtils;
  18 +import com.order.erp.config.DataScope;
  19 +import com.order.erp.domain.ApplyStatusEnum;
  20 +import com.order.erp.domain.ApplyTypeEnum;
  21 +import com.order.erp.domain.OrderLockFieldEnum;
  22 +import com.order.erp.domain.OrderStatusEnum;
16 23 import com.order.erp.domain.dto.BaseDO;
17 24 import com.order.erp.domain.dto.order.*;
18 25 import com.order.erp.domain.vo.order.*;
... ... @@ -53,6 +60,15 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
53 60 @Resource
54 61 private OrderInspectionStageService inspectionStageService;
55 62  
  63 + @Resource
  64 + private OrderFieldLockRecordService fieldLockRecordService;
  65 +
  66 + @Resource
  67 + private OrderFieldLockApplyService orderFieldLockApplyService;
  68 +
  69 + @Resource
  70 + private DataScope dataScope;
  71 +
56 72 /**
57 73 * 通过ID查询单条数据
58 74 * <p>
... ... @@ -111,12 +127,61 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
111 127 // 填充质检信息
112 128 fillInspectionStageInfo(resultVOList);
113 129  
  130 + // 填充字段锁定信息
  131 + fillLockFields(resultVOList);
  132 +
114 133 webVOPage.setRecords(resultVOList);
115 134 }
116 135 BeanUtils.copyProperties(page, webVOPage, "records");
117 136 return ServerResult.success(webVOPage);
118 137 }
119 138  
  139 + @Override
  140 + public ServerResult fieldUnlockApply(OrderUnlockFieldApplyVO fieldVO) {
  141 + Long userId = dataScope.getLoginUserId();
  142 + checkApply(fieldVO, userId);
  143 +
  144 + OrderFieldLockApplyDO applyDO = initOrderFieldLockApplyDO(fieldVO, userId);
  145 +
  146 + orderFieldLockApplyService.save(applyDO);
  147 + return ServerResult.success();
  148 + }
  149 +
  150 + /**
  151 + * @param fieldVO
  152 + * @param userId
  153 + */
  154 + private void checkApply(OrderUnlockFieldApplyVO fieldVO, Long userId) {
  155 + List<OrderFieldLockApplyDO> applyDOS = orderFieldLockApplyService.list(new LambdaQueryWrapper<OrderFieldLockApplyDO>()
  156 + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
  157 + .eq(OrderFieldLockApplyDO::getOrderId, fieldVO.getOrderId())
  158 + .eq(OrderFieldLockApplyDO::getApplyUserId, userId)
  159 + .eq(OrderFieldLockApplyDO::getType, ApplyTypeEnum.FIELD_EDIT_APPLY.getType())
  160 + .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus()));
  161 + if (CollectionUtils.isNotEmpty(applyDOS)) {
  162 + throw new BusinessException(ServerResultCode.APPLY_UNLOCK_FIELD_EXIST);
  163 + }
  164 + }
  165 +
  166 + /**
  167 + * @param fieldVO
  168 + * @param userId
  169 + * @return
  170 + */
  171 + private OrderFieldLockApplyDO initOrderFieldLockApplyDO(OrderUnlockFieldApplyVO fieldVO, Long userId) {
  172 + OrderLockFieldVO lockFieldVO = new OrderLockFieldVO();
  173 + BeanUtils.copyProperties(fieldVO, lockFieldVO);
  174 + return OrderFieldLockApplyDO.builder()
  175 + .applyUserId(userId)
  176 + .auditUserId(null)
  177 + .fields(JSONObject.toJSONString(lockFieldVO))
  178 + .orderId(fieldVO.getOrderId())
  179 + .type(ApplyTypeEnum.FIELD_EDIT_APPLY.getType())
  180 + .remark(ApplyTypeEnum.FIELD_EDIT_APPLY.getDesc())
  181 + .status(ApplyStatusEnum.WAIT_AUDIT.getStatus())
  182 + .build();
  183 + }
  184 +
120 185 /**
121 186 * @param orderInfoResultVOList
122 187 */
... ... @@ -129,18 +194,19 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
129 194 List<OrderProfitAnalysisDO> orderProfitAnalysisDOS = profitAnalysisService.list(new LambdaQueryWrapper<OrderProfitAnalysisDO>()
130 195 .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
131 196 .in(OrderProfitAnalysisDO::getOrderId, orderIds));
132   - if (CollectionUtils.isEmpty(orderProfitAnalysisDOS)) {
133   - return;
  197 +
  198 + if (CollectionUtils.isNotEmpty(orderProfitAnalysisDOS)) {
  199 + Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = orderProfitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity()));
  200 + orderInfoResultVOList.forEach(result -> {
  201 + if (profitAnalysisDOMap.containsKey(result.getId())) {
  202 + OrderProfitAnalysisDO profitAnalysisDO = profitAnalysisDOMap.get(result.getId());
  203 + OrderProfitAnalysisVO profitAnalysisVO = new OrderProfitAnalysisVO();
  204 + BeanUtils.copyProperties(profitAnalysisDO, profitAnalysisVO);
  205 + result.setProfitAnalysisInfo(profitAnalysisVO);
  206 + }
  207 + });
134 208 }
135   - Map<Long, OrderProfitAnalysisDO> profitAnalysisDOMap = orderProfitAnalysisDOS.stream().collect(Collectors.toMap(OrderProfitAnalysisDO::getOrderId, Function.identity()));
136   - orderInfoResultVOList.forEach(result -> {
137   - if (profitAnalysisDOMap.containsKey(result.getId())) {
138   - OrderProfitAnalysisDO profitAnalysisDO = profitAnalysisDOMap.get(result.getId());
139   - OrderProfitAnalysisVO profitAnalysisVO = new OrderProfitAnalysisVO();
140   - BeanUtils.copyProperties(profitAnalysisDO, profitAnalysisVO);
141   - result.setProfitAnalysisInfo(profitAnalysisVO);
142   - }
143   - });
  209 +
144 210 }
145 211  
146 212 /**
... ... @@ -198,6 +264,45 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
198 264 /**
199 265 * @param orderInfoResultVOList
200 266 */
  267 + private void fillLockFields(List<OrderInfoResultVO> orderInfoResultVOList) {
  268 + if (CollectionUtils.isEmpty(orderInfoResultVOList)) {
  269 + return;
  270 + }
  271 +
  272 + Set<Long> orderIds = orderInfoResultVOList.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet());
  273 +
  274 + List<OrderFieldLockRecordDO> fieldLockRecordDOList = fieldLockRecordService.list(new LambdaQueryWrapper<OrderFieldLockRecordDO>()
  275 + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
  276 + .eq(OrderFieldLockRecordDO::getUserId, dataScope.getLoginUserId())
  277 + .in(OrderFieldLockRecordDO::getOrderId, orderIds));
  278 +
  279 + if (CollectionUtils.isNotEmpty(fieldLockRecordDOList)) {
  280 + Map<Long, OrderFieldLockRecordDO> recordDOMap = fieldLockRecordDOList.stream().collect(Collectors.toMap(OrderFieldLockRecordDO::getOrderId, Function.identity()));
  281 + orderInfoResultVOList.forEach(x -> {
  282 + OrderFieldLockRecordDO recordDO = recordDOMap.get(x.getId());
  283 + if (Objects.nonNull(recordDO)) {
  284 + String fields = recordDO.getFields();
  285 + if (StringUtils.isNotBlank(fields)) {
  286 + OrderLockFieldVO fieldVO = JSONObject.parseObject(fields, OrderLockFieldVO.class);
  287 + x.setLockFields(fieldVO);
  288 + } else {
  289 + x.setLockFields(OrderFieldUtils.initField(OrderLockFieldEnum.LOCKED));
  290 + }
  291 + } else {
  292 + x.setLockFields(OrderFieldUtils.initField(OrderLockFieldEnum.LOCKED));
  293 + }
  294 + });
  295 + } else {
  296 + orderInfoResultVOList.forEach(x -> {
  297 + x.setLockFields(OrderFieldUtils.initField(OrderLockFieldEnum.LOCKED));
  298 + });
  299 + }
  300 +
  301 + }
  302 +
  303 + /**
  304 + * @param orderInfoResultVOList
  305 + */
201 306 private void fillInspectionStageInfo(List<OrderInfoResultVO> orderInfoResultVOList) {
202 307 if (CollectionUtils.isEmpty(orderInfoResultVOList)) {
203 308 return;
... ... @@ -258,6 +363,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
258 363 }
259 364 OrderBaseInfoDO baseInfoDO = new OrderBaseInfoDO();
260 365 BeanUtils.copyProperties(baseInfoVO, baseInfoDO);
  366 + baseInfoDO.setOrderStatus(OrderStatusEnum.CREATE_FINISH.getStatus());
261 367 save(baseInfoDO);
262 368  
263 369 OrderProfitAnalysisVO profitAnalysisVO = orderAddVO.getProfitAnalysisInfo();
... ... @@ -265,6 +371,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
265 371 OrderProfitAnalysisDO profitAnalysisDO = new OrderProfitAnalysisDO();
266 372 BeanUtils.copyProperties(profitAnalysisVO, profitAnalysisDO);
267 373 profitAnalysisDO.setOrderId(baseInfoDO.getId());
  374 + profitAnalysisDO.setOrderStatus(OrderStatusEnum.PROFIT_WAIT_AUDIT.getStatus());
268 375 profitAnalysisService.save(profitAnalysisDO);
269 376 }
270 377  
... ... @@ -273,6 +380,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
273 380 OrderCompletionReportDO reportDO = new OrderCompletionReportDO();
274 381 BeanUtils.copyProperties(reportVO, reportDO);
275 382 reportDO.setOrderId(baseInfoDO.getId());
  383 + reportDO.setOrderStatus(OrderStatusEnum.REPORT_WAIT_AUDIT.getStatus());
276 384 reportService.save(reportDO);
277 385 }
278 386  
... ... @@ -281,6 +389,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
281 389 OrderTrackStageDO trackStageDO = new OrderTrackStageDO();
282 390 BeanUtils.copyProperties(trackStageVO, trackStageDO);
283 391 trackStageDO.setOrderId(baseInfoDO.getId());
  392 + trackStageDO.setOrderStatus(OrderStatusEnum.TRACK_ING.getStatus());
284 393 trackStageService.save(trackStageDO);
285 394 }
286 395  
... ... @@ -289,6 +398,7 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl&lt;OrderBaseInfoMapper, O
289 398 OrderInspectionStageDO inspectionStageDO = new OrderInspectionStageDO();
290 399 BeanUtils.copyProperties(inspectionStageVO, inspectionStageDO);
291 400 inspectionStageDO.setOrderId(baseInfoDO.getId());
  401 + inspectionStageDO.setOrderStatus(OrderStatusEnum.INSPECT_ING.getStatus());
292 402 inspectionStageService.save(inspectionStageDO);
293 403 }
294 404  
... ...
src/main/java/com/order/erp/service/order/impl/OrderFieldLockApplyServiceImpl.java
... ... @@ -2,20 +2,39 @@ package com.order.erp.service.order.impl;
2 2  
3 3 import cn.hutool.core.bean.BeanUtil;
4 4 import cn.hutool.core.collection.CollUtil;
  5 +import com.alibaba.fastjson.JSONObject;
  6 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 7 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
  8 +import com.baomidou.mybatisplus.core.metadata.IPage;
  9 +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
  10 +import com.baomidou.mybatisplus.core.toolkit.StringUtils;
  11 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 12 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  13 +import com.canrd.shop.common.constant.ServerResultCode;
7 14 import com.order.erp.common.constant.Constant;
8 15 import com.order.erp.common.constant.ServerResult;
  16 +import com.order.erp.common.exception.BusinessException;
  17 +import com.order.erp.config.DataScope;
  18 +import com.order.erp.domain.ApplyStatusEnum;
  19 +import com.order.erp.domain.ApplyTypeEnum;
  20 +import com.order.erp.domain.dto.BaseDO;
  21 +import com.order.erp.domain.dto.order.OrderAuditLogDO;
9 22 import com.order.erp.domain.dto.order.OrderFieldLockApplyDO;
10   -import com.order.erp.domain.vo.order.OrderFieldLockApplyQueryVO;
11   -import com.order.erp.domain.vo.order.OrderFieldLockApplyVO;
  23 +import com.order.erp.domain.dto.order.OrderFieldLockRecordDO;
  24 +import com.order.erp.domain.vo.order.*;
12 25 import com.order.erp.mapper.order.OrderFieldLockApplyMapper;
  26 +import com.order.erp.service.order.OrderAuditLogService;
13 27 import com.order.erp.service.order.OrderFieldLockApplyService;
  28 +import com.order.erp.service.order.OrderFieldLockRecordService;
14 29 import lombok.extern.slf4j.Slf4j;
  30 +import org.springframework.beans.BeanUtils;
15 31 import org.springframework.stereotype.Service;
  32 +import org.springframework.transaction.annotation.Transactional;
16 33  
  34 +import javax.annotation.Resource;
17 35 import java.util.List;
18 36 import java.util.Objects;
  37 +import java.util.stream.Collectors;
19 38  
20 39 /**
21 40 * 用户订单-字段锁定申请表(OrderFieldLockApply)表服务实现类
... ... @@ -27,6 +46,17 @@ import java.util.Objects;
27 46 @Service
28 47 public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockApplyMapper, OrderFieldLockApplyDO> implements OrderFieldLockApplyService {
29 48  
  49 + @Resource
  50 + private DataScope dataScope;
  51 +
  52 + @Resource
  53 + private OrderFieldLockRecordService fieldLockRecordService;
  54 +
  55 + @Resource
  56 + private OrderFieldLockApplyService applyService;
  57 +
  58 + @Resource
  59 + private OrderAuditLogService auditLogService;
30 60  
31 61 /**
32 62 * 通过ID查询单条数据
... ... @@ -59,6 +89,42 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl&lt;OrderFieldLockAp
59 89 return ServerResult.success();
60 90 }
61 91  
  92 + @Override
  93 + public ServerResult listByPage(OrderFieldLockApplyQueryVO queryVO) {
  94 + LambdaQueryWrapper<OrderFieldLockApplyDO> queryWrapper = buildQueryByParam(queryVO);
  95 + Page page = new Page<>(queryVO.getPageNo(), queryVO.getPageSize());
  96 + IPage<OrderFieldLockApplyDO> iPage = page(page, queryWrapper);
  97 +
  98 + Page<OrderApplyResultVO> webVOPage = new Page<>();
  99 + List<OrderFieldLockApplyDO> applyDOList = iPage.getRecords();
  100 + if (CollectionUtils.isNotEmpty(applyDOList)) {
  101 + List<OrderApplyResultVO> resultVOList = applyDOList.stream().map(x -> {
  102 + OrderApplyResultVO resultVO = new OrderApplyResultVO();
  103 + BeanUtils.copyProperties(x, resultVO);
  104 + String fields = x.getFields();
  105 + if (StringUtils.isNotBlank(fields)) {
  106 + resultVO.setFieldInfos(JSONObject.parseObject(fields, OrderLockFieldVO.class));
  107 + }
  108 + return resultVO;
  109 + }).collect(Collectors.toList());
  110 +
  111 + webVOPage.setRecords(resultVOList);
  112 + }
  113 + BeanUtils.copyProperties(page, webVOPage, "records");
  114 + return ServerResult.success(webVOPage);
  115 + }
  116 +
  117 + /**
  118 + * @param queryVO
  119 + * @return
  120 + */
  121 + private LambdaQueryWrapper<OrderFieldLockApplyDO> buildQueryByParam(OrderFieldLockApplyQueryVO queryVO) {
  122 + return new LambdaQueryWrapper<OrderFieldLockApplyDO>()
  123 + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
  124 + .eq(Objects.nonNull(queryVO.getApplyUserId()), OrderFieldLockApplyDO::getApplyUserId, queryVO.getApplyUserId())
  125 + .eq(Objects.nonNull(queryVO.getStatus()), OrderFieldLockApplyDO::getStatus, queryVO.getStatus());
  126 + }
  127 +
62 128 /**
63 129 * 新增数据
64 130 *
... ... @@ -78,6 +144,71 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl&lt;OrderFieldLockAp
78 144 return ServerResult.success();
79 145 }
80 146  
  147 + @Override
  148 + public ServerResult doAudit(AuditVO auditVO) {
  149 + OrderFieldLockApplyDO applyDO = getById(auditVO.getId());
  150 + if (Objects.isNull(applyDO)) {
  151 + throw new BusinessException(ServerResultCode.APPLY_NOT_EXIST);
  152 + }
  153 + Long auditUserId = dataScope.getLoginUserId();
  154 + // 申请通过
  155 + if (ApplyStatusEnum.AUDIT_PASS.getStatus().equals(auditVO.getStatus())) {
  156 + doPass(applyDO, auditUserId);
  157 + }
  158 + if (ApplyStatusEnum.AUDIT_REFUSE.getStatus().equals(auditVO.getStatus())) {
  159 + doRefuse(applyDO, auditUserId);
  160 + }
  161 + return ServerResult.success();
  162 + }
  163 +
  164 + @Transactional(rollbackFor = Exception.class)
  165 + public void doRefuse(OrderFieldLockApplyDO applyDO, Long auditUserId) {
  166 + applyDO.setAuditUserId(auditUserId);
  167 + applyDO.setStatus(ApplyStatusEnum.AUDIT_REFUSE.getStatus());
  168 +
  169 + OrderAuditLogDO auditLogDO = OrderAuditLogDO.builder().applyId(applyDO.getId()).orderId(applyDO.getOrderId()).optType(ApplyStatusEnum.AUDIT_REFUSE.getDesc()).build();
  170 +
  171 + applyService.updateById(applyDO);
  172 + auditLogService.save(auditLogDO);
  173 + }
  174 +
  175 + /**
  176 + * @param applyDO
  177 + * @param auditUserId
  178 + */
  179 + @Transactional(rollbackFor = Exception.class)
  180 + public void doPass(OrderFieldLockApplyDO applyDO, Long auditUserId) {
  181 + OrderFieldLockRecordDO recordDO = null;
  182 + if (ApplyTypeEnum.FIELD_EDIT_APPLY.getType().equals(applyDO.getType())) {
  183 + applyDO.setAuditUserId(auditUserId);
  184 + applyDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus());
  185 +
  186 + recordDO = fieldLockRecordService.getOne(new LambdaQueryWrapper<OrderFieldLockRecordDO>()
  187 + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN)
  188 + .eq(OrderFieldLockRecordDO::getOrderId, applyDO.getOrderId())
  189 + .eq(OrderFieldLockRecordDO::getUserId, applyDO.getApplyUserId()));
  190 + if (Objects.isNull(recordDO)) {
  191 + recordDO = OrderFieldLockRecordDO.builder()
  192 + .orderId(applyDO.getOrderId())
  193 + .userId(applyDO.getApplyUserId())
  194 + .fields(applyDO.getFields()).build();
  195 + }
  196 + recordDO.setFields(applyDO.getFields());
  197 + }
  198 +
  199 + OrderAuditLogDO auditLogDO = OrderAuditLogDO.builder().applyId(applyDO.getId()).orderId(applyDO.getOrderId()).optType(ApplyStatusEnum.AUDIT_PASS.getDesc()).build();
  200 +
  201 + applyService.updateById(applyDO);
  202 +
  203 + if (Objects.isNull(recordDO.getId())) {
  204 + fieldLockRecordService.save(recordDO);
  205 + } else {
  206 + fieldLockRecordService.updateById(recordDO);
  207 + }
  208 +
  209 + auditLogService.save(auditLogDO);
  210 + }
  211 +
81 212 /**
82 213 * 修改数据
83 214 *
... ...