Commit 5c716366612e64e7ad25dfcd2fc7658faf2e1518
Merge branch 'develop-test' into develop
# Conflicts: # src/main/java/com/order/erp/common/constant/Constant.java # src/main/java/com/order/erp/service/order/OrderProfitAnalysisService.java # src/main/java/com/order/erp/service/order/impl/InvoiceBillOrderServiceImpl.java # src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java # src/main/java/com/order/erp/service/order/impl/OrderFieldLockApplyServiceImpl.java # src/main/java/com/order/erp/service/order/impl/OrderProfitAnalysisServiceImpl.java # src/main/java/com/order/erp/service/order/impl/ProducePaymentCheckBillOrderServiceImpl.java # src/main/resources/application.yml
Showing
87 changed files
with
5610 additions
and
86 deletions
src/main/java/com/order/erp/common/constant/Constant.java
@@ -162,6 +162,7 @@ public class Constant { | @@ -162,6 +162,7 @@ public class Constant { | ||
162 | public static final int SEVEN = 7; | 162 | public static final int SEVEN = 7; |
163 | public static final int FOURTEEN= 14; | 163 | public static final int FOURTEEN= 14; |
164 | public static final Integer THIRTY = 30; | 164 | public static final Integer THIRTY = 30; |
165 | + | ||
165 | public static final int SIXTY = 60; | 166 | public static final int SIXTY = 60; |
166 | public static final int TWENTY_FIRST = 21; | 167 | public static final int TWENTY_FIRST = 21; |
167 | 168 |
src/main/java/com/order/erp/config/MybatisPlusConfig.java
1 | package com.order.erp.config; | 1 | package com.order.erp.config; |
2 | 2 | ||
3 | +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; | ||
4 | +import org.apache.ibatis.session.SqlSessionFactory; | ||
5 | +import org.springframework.context.annotation.Bean; | ||
3 | import org.springframework.context.annotation.Configuration; | 6 | import org.springframework.context.annotation.Configuration; |
4 | 7 | ||
5 | 8 |
src/main/java/com/order/erp/controller/OrderCostController.java
0 → 100644
1 | +package com.order.erp.controller; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.domain.vo.OrderProfitAnalysisVo; | ||
6 | +import com.order.erp.domain.vo.order.*; | ||
7 | +import com.order.erp.service.order.IOrderCostInfoService; | ||
8 | +import com.order.erp.service.order.OrderProfitAnalysisService; | ||
9 | +import io.swagger.annotations.Api; | ||
10 | +import io.swagger.annotations.ApiOperation; | ||
11 | +import org.springframework.beans.factory.annotation.Autowired; | ||
12 | +import org.springframework.validation.annotation.Validated; | ||
13 | +import org.springframework.web.bind.annotation.*; | ||
14 | + | ||
15 | +import javax.annotation.Resource; | ||
16 | +import javax.servlet.http.HttpServletResponse; | ||
17 | +import java.util.Collections; | ||
18 | + | ||
19 | +/** | ||
20 | + * @author zhongnanhuang | ||
21 | + * @version 1.0 | ||
22 | + * @project order-erp | ||
23 | + * @description 订单利润表控制层 | ||
24 | + * @date 2023/10/23 11:48:36 | ||
25 | + */ | ||
26 | +@RestController | ||
27 | +@RequestMapping("/order/cost") | ||
28 | +@Api(tags = "订单费用表") | ||
29 | +public class OrderCostController { | ||
30 | + | ||
31 | + @Resource | ||
32 | + OrderProfitAnalysisService orderProfitAnalysisService; | ||
33 | + @Autowired | ||
34 | + IOrderCostInfoService orderCostInfoService; | ||
35 | + | ||
36 | + | ||
37 | + @PostMapping("/InnerProfitDetail/listByPage") | ||
38 | + @ApiOperation("内部生产费用明细表") | ||
39 | + public ServerResult<Page<InnerProfitDetailVO>> listInnerProfitDetailByPage(@RequestBody @Validated OrderBaseInfoQueryVO queryVO) { | ||
40 | + queryVO.setProductionDepartment(Collections.singletonList("内部")); | ||
41 | + return orderCostInfoService.listInnerProfitDetailByPage(queryVO); | ||
42 | + } | ||
43 | + | ||
44 | + @PostMapping("/BusinessProfitDetail/listByPage") | ||
45 | + @ApiOperation("包装费用明细表") | ||
46 | + public ServerResult<Page<BusinessProfitDetailVO>> listBusinessProfitDetailsByPage(@RequestBody @Validated OrderBaseInfoQueryVO queryVO) { | ||
47 | + return orderCostInfoService.listBusinessProfitDetailByPage(queryVO); | ||
48 | + } | ||
49 | + | ||
50 | + @PostMapping("/edit") | ||
51 | + @ApiOperation("编辑") | ||
52 | + public ServerResult edit(@RequestBody OrderCostInfoVO vo) throws Exception { | ||
53 | + return orderCostInfoService.edit(vo); | ||
54 | + } | ||
55 | + | ||
56 | + @PostMapping("/applyEditFileds") | ||
57 | + @ApiOperation("申请编辑字段") | ||
58 | + public ServerResult applyEditFileds(@RequestBody OrderCostInfolockFieldVO vo) { | ||
59 | + return orderCostInfoService.applyEditFileds(vo); | ||
60 | + } | ||
61 | + | ||
62 | + @PostMapping("/businessProfitDetail/exportExcel") | ||
63 | + @ApiOperation("包装费用明细表多个导出") | ||
64 | + public void exportBusinessProfitDetailExcel(HttpServletResponse response, @RequestBody ProjectBaseInfoQueryVO queryVO) throws Exception { | ||
65 | + orderCostInfoService.exportBusinessProfitDetailExcel(response, queryVO); | ||
66 | + } | ||
67 | + | ||
68 | + @PostMapping("/innerProfitDetail/exportExcel") | ||
69 | + @ApiOperation("内部生产费用明细表多个导出") | ||
70 | + public void exportInnerProfitDetailExcel(HttpServletResponse response, @RequestBody ProjectBaseInfoQueryVO queryVO) throws Exception { | ||
71 | + orderCostInfoService.exportInnerProfitDetailExcel(response, queryVO); | ||
72 | + } | ||
73 | + | ||
74 | + @PostMapping("/setPackStatus") | ||
75 | + @ApiOperation("设置包装费用明细表的状态") | ||
76 | + public void setPackStatus(@RequestBody OrderCostInfoVO vo) { | ||
77 | + orderCostInfoService.setPackStatus(vo); | ||
78 | + } | ||
79 | + | ||
80 | + | ||
81 | + @PostMapping("/setInnerStatus") | ||
82 | + @ApiOperation("设置内部生产明细表的状态") | ||
83 | + public void setInnerProduceStatus(@RequestBody OrderCostInfoVO vo) { | ||
84 | + orderCostInfoService.setInnerProduceStatus(vo); | ||
85 | + } | ||
86 | + | ||
87 | +} |
src/main/java/com/order/erp/controller/OrderCostDetailedOptLogController.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.order.OrderCostDetailedOptedLogQueryVO; | ||
5 | +import com.order.erp.service.order.OrderCostDetailedOptLogService; | ||
6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
7 | +import org.springframework.web.bind.annotation.PostMapping; | ||
8 | +import org.springframework.web.bind.annotation.RequestBody; | ||
9 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
10 | +import org.springframework.web.bind.annotation.RestController; | ||
11 | + | ||
12 | +/** | ||
13 | + * 净利润分析板块(包装费用明细表/内部生产明细表)--用户操作日志记录 | ||
14 | + * */ | ||
15 | +@RestController | ||
16 | +@RequestMapping("/orderCostDetailedOptLog") | ||
17 | +public class OrderCostDetailedOptLogController { | ||
18 | + @Autowired | ||
19 | + private OrderCostDetailedOptLogService orderCostDetailedOptLogService; | ||
20 | + @PostMapping("/listByPage") | ||
21 | + public ServerResult listByPage(@RequestBody OrderCostDetailedOptedLogQueryVO queryVO){ | ||
22 | + return orderCostDetailedOptLogService.listByPage(queryVO); | ||
23 | + } | ||
24 | +} |
src/main/java/com/order/erp/controller/OrderProfitController.java
@@ -2,16 +2,20 @@ package com.order.erp.controller; | @@ -2,16 +2,20 @@ package com.order.erp.controller; | ||
2 | 2 | ||
3 | import com.order.erp.common.constant.ServerResult; | 3 | import com.order.erp.common.constant.ServerResult; |
4 | import com.order.erp.domain.vo.OrderProfitAnalysisVo; | 4 | import com.order.erp.domain.vo.OrderProfitAnalysisVo; |
5 | -import com.order.erp.domain.vo.order.OrderProfitAnalysisVO; | ||
6 | -import com.order.erp.domain.vo.order.ProfitCalculateVO; | 5 | +import com.order.erp.domain.vo.order.*; |
6 | +import com.order.erp.service.order.IOrderCostInfoService; | ||
7 | import com.order.erp.service.order.OrderProfitAnalysisService; | 7 | import com.order.erp.service.order.OrderProfitAnalysisService; |
8 | +import io.swagger.annotations.Api; | ||
9 | +import io.swagger.annotations.ApiOperation; | ||
10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
8 | import org.springframework.validation.annotation.Validated; | 11 | 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; | 12 | +import org.springframework.web.bind.annotation.*; |
13 | 13 | ||
14 | import javax.annotation.Resource; | 14 | import javax.annotation.Resource; |
15 | +import javax.servlet.http.HttpServletResponse; | ||
16 | +import java.io.IOException; | ||
17 | +import java.util.Arrays; | ||
18 | +import java.util.Collections; | ||
15 | 19 | ||
16 | /** | 20 | /** |
17 | * @author zhongnanhuang | 21 | * @author zhongnanhuang |
@@ -36,4 +40,5 @@ public class OrderProfitController { | @@ -36,4 +40,5 @@ public class OrderProfitController { | ||
36 | public ServerResult calculate(@RequestBody @Validated ProfitCalculateVO calculateVO) { | 40 | public ServerResult calculate(@RequestBody @Validated ProfitCalculateVO calculateVO) { |
37 | return orderProfitAnalysisService.calculate(calculateVO); | 41 | return orderProfitAnalysisService.calculate(calculateVO); |
38 | } | 42 | } |
43 | + | ||
39 | } | 44 | } |
src/main/java/com/order/erp/controller/ProjectBaseDevelopOptLogController.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.order.ProjectOptLogQueryVO; | ||
5 | + | ||
6 | +import com.order.erp.service.order.ProjectBaseDevelopOptLogService; | ||
7 | +import org.springframework.beans.factory.annotation.Autowired; | ||
8 | +import org.springframework.web.bind.annotation.PostMapping; | ||
9 | +import org.springframework.web.bind.annotation.RequestBody; | ||
10 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
11 | +import org.springframework.web.bind.annotation.RestController; | ||
12 | + | ||
13 | +/** | ||
14 | + * 净利润分析板块(业务研发净利润/内部生产净利润)--用户操作日志记录 | ||
15 | + * */ | ||
16 | +@RestController | ||
17 | +@RequestMapping("/projectOptLog") | ||
18 | +public class ProjectBaseDevelopOptLogController { | ||
19 | + @Autowired | ||
20 | + private ProjectBaseDevelopOptLogService projectBaseDevelopOptLogService; | ||
21 | + /** | ||
22 | + * 分页查询 | ||
23 | + * */ | ||
24 | + @PostMapping("/listByPage") | ||
25 | + public ServerResult listByPage(@RequestBody ProjectOptLogQueryVO queryVO){ | ||
26 | + return projectBaseDevelopOptLogService.listByPage(queryVO); | ||
27 | + } | ||
28 | + | ||
29 | +} |
src/main/java/com/order/erp/controller/ProjectController.java
0 → 100644
1 | +package com.order.erp.controller; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.domain.vo.OrderProfitAnalysisVo; | ||
6 | +import com.order.erp.domain.vo.order.*; | ||
7 | +import com.order.erp.service.order.IOrderCostInfoService; | ||
8 | +import com.order.erp.service.order.IProjectBaseInfoService; | ||
9 | +import com.order.erp.service.order.OrderProfitAnalysisService; | ||
10 | +import io.swagger.annotations.Api; | ||
11 | +import io.swagger.annotations.ApiOperation; | ||
12 | +import org.springframework.beans.factory.annotation.Autowired; | ||
13 | +import org.springframework.validation.annotation.Validated; | ||
14 | +import org.springframework.web.bind.annotation.*; | ||
15 | + | ||
16 | +import javax.annotation.Resource; | ||
17 | +import javax.servlet.http.HttpServletResponse; | ||
18 | +import java.util.Collections; | ||
19 | + | ||
20 | +/** | ||
21 | + * @author zhongnanhuang | ||
22 | + * @version 1.0 | ||
23 | + * @project order-erp | ||
24 | + * @description 订单利润表控制层 | ||
25 | + * @date 2023/10/23 11:48:36 | ||
26 | + */ | ||
27 | +@RestController | ||
28 | +@RequestMapping("/project") | ||
29 | +@Api(tags = "项目信息") | ||
30 | +public class ProjectController { | ||
31 | + @Autowired | ||
32 | + IOrderCostInfoService orderCostInfoService; | ||
33 | + @Autowired | ||
34 | + IProjectBaseInfoService projectBaseInfoService; | ||
35 | + | ||
36 | + @PostMapping("/edit") | ||
37 | + @ApiOperation("编辑") | ||
38 | + public ServerResult<OrderProfitAnalysisVO> edit(@RequestBody @Validated ProjectBaseInfoVO vo) { | ||
39 | + return projectBaseInfoService.edit(vo); | ||
40 | + } | ||
41 | + | ||
42 | + @PostMapping("/applyEditFileds") | ||
43 | + @ApiOperation("申请修改") | ||
44 | + public ServerResult<OrderProfitAnalysisVO> applyEditFileds(@RequestBody @Validated ProjectBaseInfoLockFieldVO vo) { | ||
45 | + return projectBaseInfoService.applyEditFileds(vo); | ||
46 | + } | ||
47 | + | ||
48 | + @PostMapping("/pageProjectLockFieldApply") | ||
49 | + @ApiOperation("分页查询项目字段申请记录") | ||
50 | + public ServerResult<OrderProfitAnalysisVO> pageProjectLockFieldApply(@RequestBody @Validated QueryProjectLockFieldVO vo) { | ||
51 | + return projectBaseInfoService.pageProjectLockFieldApply(vo); | ||
52 | + } | ||
53 | + | ||
54 | + @PostMapping("/audit") | ||
55 | + @ApiOperation("审核") | ||
56 | + public ServerResult<OrderProfitAnalysisVO> audit(@RequestBody @Validated AuditVO vo) { | ||
57 | + return projectBaseInfoService.audit(vo); | ||
58 | + } | ||
59 | + @PostMapping("/InnerProfitInfo/listByPage") | ||
60 | + @ApiOperation("内部生产利润分析表") | ||
61 | + public ServerResult<Page<InnerProfitInfoVO>> listInnerProfitInfoByPage(@RequestBody @Validated OrderBaseInfoQueryVO queryVO) { | ||
62 | + queryVO.setProductionDepartment(Collections.singletonList("内部")); | ||
63 | + return projectBaseInfoService.listInnerProfitInfoByPage(queryVO); | ||
64 | + } | ||
65 | + | ||
66 | + @PostMapping("/BusinessProfitInfo/listByPage") | ||
67 | + @ApiOperation("业务研发净利润分析表") | ||
68 | + public ServerResult<Page<BusinessProfitInfoVO>> listBusinessProfitInfosByPage(@RequestBody @Validated OrderBaseInfoQueryVO queryVO) { | ||
69 | + return projectBaseInfoService.listBusinessProfitInfoByPage(queryVO); | ||
70 | + } | ||
71 | + | ||
72 | + @PostMapping("/businessProfit/export") | ||
73 | + @ApiOperation("业务研发净利润分析表单个导出") | ||
74 | + public void exportBusinessProfitInfo(HttpServletResponse response, @RequestParam("projectNoPrefix") String projectNoPrefix) throws Exception { | ||
75 | + projectBaseInfoService.exportBusinessProfitInfo(response, projectNoPrefix); | ||
76 | + } | ||
77 | + | ||
78 | + @PostMapping("/innerProfit/export") | ||
79 | + @ApiOperation("内部研发净利润分析表导出") | ||
80 | + public void exportInnerProfitInfo(HttpServletResponse response, @RequestParam("projectNoPrefix") String projectNoPrefix) throws Exception { | ||
81 | + projectBaseInfoService.exportInnerProfitInfo(response, projectNoPrefix); | ||
82 | + } | ||
83 | + | ||
84 | + //直接通过查询传递多个projectNo去查询。 | ||
85 | + @PostMapping("/businessProfit/exportExcel") | ||
86 | + @ApiOperation("业务研发净利润分析表多个导出") | ||
87 | + public void exportBusinessProfitExcel(HttpServletResponse response, @RequestBody ProjectBaseInfoQueryVO queryVO) throws Exception { | ||
88 | + projectBaseInfoService.exportBusinessProfitExcel(response, queryVO); | ||
89 | + } | ||
90 | + //直接通过查询传递多个projectNo去查询。 | ||
91 | + @PostMapping("/innerProfitInfo/exportExcel") | ||
92 | + @ApiOperation("内部生产净利润分析表多个导出") | ||
93 | + public void exportInnerProfitInfoExcel(HttpServletResponse response, @RequestBody ProjectBaseInfoQueryVO queryVO) throws Exception { | ||
94 | + projectBaseInfoService.exportInnerProfitInfoExcel(response, queryVO); | ||
95 | + } | ||
96 | + | ||
97 | + @PostMapping("/businessProfit/setStatus") | ||
98 | + @ApiOperation("业务研发净利润分析表审核状态设置") | ||
99 | + public void setProjectBaseInfoDevelopmentStatus(@RequestBody OrderBaseInfoVO vo) { | ||
100 | + projectBaseInfoService.setProjectBaseInfoDevelopmentStatus(vo); | ||
101 | + } | ||
102 | + //直接通过查询传递多个projectNo去查询。 | ||
103 | + @PostMapping("/innerProfitInfo/setStatus") | ||
104 | + @ApiOperation("内部生产净利润分析表审核状态设置") | ||
105 | + public void setInnerProductionStatus(@RequestBody OrderBaseInfoVO vo) { | ||
106 | + projectBaseInfoService.setInnerProductionStatus(vo); | ||
107 | + } | ||
108 | + | ||
109 | +} |
src/main/java/com/order/erp/domain/ApplyTypeEnum.java
@@ -32,4 +32,13 @@ public enum ApplyTypeEnum { | @@ -32,4 +32,13 @@ public enum ApplyTypeEnum { | ||
32 | private Integer type; | 32 | private Integer type; |
33 | 33 | ||
34 | private String desc; | 34 | private String desc; |
35 | + | ||
36 | + public static String getNameByType(Integer type) { | ||
37 | + for (ApplyTypeEnum value : ApplyTypeEnum.values()) { | ||
38 | + if (value.getType().equals(type)) { | ||
39 | + return value.getDesc(); | ||
40 | + } | ||
41 | + } | ||
42 | + return null; | ||
43 | + } | ||
35 | } | 44 | } |
src/main/java/com/order/erp/domain/OrderCostApplyTpeEnum.java
0 → 100644
1 | +package com.order.erp.domain; | ||
2 | + | ||
3 | +import lombok.AllArgsConstructor; | ||
4 | +import lombok.Getter; | ||
5 | + | ||
6 | +@Getter | ||
7 | +@AllArgsConstructor | ||
8 | +public enum OrderCostApplyTpeEnum { | ||
9 | + | ||
10 | + ORDER_PACKET_COST_FIELD_EDIT_APPLY(60,"订单包装费用明细字段申请"), | ||
11 | + | ||
12 | + ORDER_PRODUCTION_COST_FIELD_EDIT_APPLY(70,"订单生产费用明细字段申请"), | ||
13 | + ; | ||
14 | + | ||
15 | + private Integer type; | ||
16 | + private String desc; | ||
17 | + | ||
18 | + public static String getNameByType(Integer type) { | ||
19 | + for (OrderCostApplyTpeEnum e : OrderCostApplyTpeEnum.values()) { | ||
20 | + if (e.getType().equals(type)) { | ||
21 | + return e.getDesc(); | ||
22 | + } | ||
23 | + } | ||
24 | + return null; | ||
25 | + } | ||
26 | +} |
src/main/java/com/order/erp/domain/OrderOptTypeEnum.java
@@ -29,6 +29,21 @@ public enum OrderOptTypeEnum { | @@ -29,6 +29,21 @@ public enum OrderOptTypeEnum { | ||
29 | 29 | ||
30 | ORDER_INSPECT_EDIT_APPLY(60, "质检信息编辑"), | 30 | ORDER_INSPECT_EDIT_APPLY(60, "质检信息编辑"), |
31 | 31 | ||
32 | + //后续添加部分(净利润分析板块) | ||
33 | + PROJECT_DEVELOPMENT_PROFIT_EDIT(70,"业务研发净利润编辑"), | ||
34 | + PROJECT_DEVELOPMENT_PROFIT_ADD(75,"业务研发净利润创建"), | ||
35 | +// PROJECT_DEVELOPMENT_FIELD_EDIT_APPLY(77,"业务研发净利润字段编辑申请"), | ||
36 | + PROJECT_COST_EDIT(80,"包装费用明细编辑"), | ||
37 | + PROJECT_COST_ADD(85,"包装费用明细创建"), | ||
38 | +// PROJECT_COST_FIELD_EDIT_APPLY(87,"包装费用明细表字段编辑申请"), | ||
39 | + PROJECT_INNER_PRODUCE_EDIT(90,"内部生产净利润编辑"), | ||
40 | + PROJECT_INNER_PRODUCE_ADD(95,"内部生产净利润创建"), | ||
41 | +// PROJECT_INNER_PRODUCE_FIELD_EDIT_APPLY(97,"内部生产净利润字段编辑申请"), | ||
42 | + PROJECT_INNER_PRODUCE_PROFIT_EDIT(100,"内部生产明细表编辑"), | ||
43 | + PROJECT_INNER_PRODUCE_PROFIT_ADD(105,"内部生产明细表创建"), | ||
44 | +// PROJECT_INNER_PRODUCE_PROFIT_FIELD_EDIT_APPLY(107,"内部研发净明细表字段编辑申请"), | ||
45 | + | ||
46 | + | ||
32 | ; | 47 | ; |
33 | private Integer type; | 48 | private Integer type; |
34 | 49 |
src/main/java/com/order/erp/domain/ProfitStatusEnum.java
0 → 100644
1 | +package com.order.erp.domain; | ||
2 | + | ||
3 | +import lombok.AllArgsConstructor; | ||
4 | +import lombok.Getter; | ||
5 | +/** | ||
6 | + * 净利润板块的各个表的状态字段。 | ||
7 | + * */ | ||
8 | +@Getter | ||
9 | +@AllArgsConstructor | ||
10 | +public enum ProfitStatusEnum { | ||
11 | + Not_COMPLETED(-1, "未完成"), | ||
12 | + PENDING_APPROVAL(0, "待审核"), | ||
13 | + APPROVED(1, "已审核"), | ||
14 | + ; | ||
15 | + private Integer status; | ||
16 | + private String desc; | ||
17 | +} |
src/main/java/com/order/erp/domain/ProjectApplyTypeEnum.java
0 → 100644
1 | +package com.order.erp.domain; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.EnumValue; | ||
4 | +import com.fasterxml.jackson.annotation.JsonValue; | ||
5 | +import lombok.AllArgsConstructor; | ||
6 | +import lombok.Getter; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author: xms | ||
10 | + * @description: TODO | ||
11 | + * @date: 2023/9/13 18:05 | ||
12 | + * @version: 1.0 | ||
13 | + */ | ||
14 | +@Getter | ||
15 | +@AllArgsConstructor | ||
16 | +public enum ProjectApplyTypeEnum { | ||
17 | + | ||
18 | + FIELD_EDIT_APPLY(0, "业务利润字段编辑申请"), | ||
19 | + INNER_PROFIT_FIELD_EDIT_APPLY(1, "内部利润字段编辑申请"), | ||
20 | + ; | ||
21 | + | ||
22 | + private Integer type; | ||
23 | + | ||
24 | + private String desc; | ||
25 | + public static String getDescByName(String type) { | ||
26 | + for (ProjectApplyTypeEnum value : ProjectApplyTypeEnum.values()) { | ||
27 | + if (value.name().equals(type)) { | ||
28 | + return value.getDesc(); | ||
29 | + } | ||
30 | + } | ||
31 | + return null; | ||
32 | + } | ||
33 | +} |
src/main/java/com/order/erp/domain/ProjectBaseSettingTypeEnum.java
0 → 100644
1 | +package com.order.erp.domain; | ||
2 | + | ||
3 | +import lombok.AllArgsConstructor; | ||
4 | +import lombok.Getter; | ||
5 | + | ||
6 | +@Getter | ||
7 | +@AllArgsConstructor | ||
8 | +public enum ProjectBaseSettingTypeEnum { | ||
9 | + COMMISSION_COST(1, "提成成本配置"), | ||
10 | + FIXED_COST_OF_PRODUCTION_DEPARTMENT(2, "生产科固定成本配置"), | ||
11 | + ; | ||
12 | + private Integer type; | ||
13 | + | ||
14 | + private String desc; | ||
15 | +} |
src/main/java/com/order/erp/domain/ProjectFieldEditType.java
0 → 100644
1 | +package com.order.erp.domain; | ||
2 | + | ||
3 | +import com.order.erp.domain.vo.order.BusinessProfitInfoVO; | ||
4 | +import lombok.AllArgsConstructor; | ||
5 | +import lombok.Getter; | ||
6 | +import lombok.NoArgsConstructor; | ||
7 | + | ||
8 | +/** | ||
9 | + * @author zgt | ||
10 | + * @project order-erp | ||
11 | + * @description | ||
12 | + * @date 2025/3/27 | ||
13 | + */ | ||
14 | +@Getter | ||
15 | +@AllArgsConstructor | ||
16 | +@NoArgsConstructor | ||
17 | +public enum ProjectFieldEditType { | ||
18 | + InnerProfitInfo("内部表编辑"), | ||
19 | + BusinessProfitInfo("业务利润表编辑"); | ||
20 | + private String Text; | ||
21 | +} |
src/main/java/com/order/erp/domain/ProjectOptTypeEnum.java
0 → 100644
1 | +package com.order.erp.domain; | ||
2 | + | ||
3 | +import lombok.AllArgsConstructor; | ||
4 | +import lombok.Getter; | ||
5 | +/** | ||
6 | + * 净利润分析板块下的项目类型枚举 | ||
7 | + */ | ||
8 | +@Getter | ||
9 | +@AllArgsConstructor | ||
10 | +public enum ProjectOptTypeEnum { | ||
11 | + BUSINESS_NET_PROFIT_TYPE(10, "业务研发净利润类型"), | ||
12 | + | ||
13 | + PACKAGING_COST_TYPE(20, "包装费用类型"), | ||
14 | + | ||
15 | + INTERNAL_BUSINESS_NET_PROFIT_TYPE(30, "内部生产净利润类型"), | ||
16 | + | ||
17 | + INTERNAL_PRODUCE_DETAILS_TYPE(40, "内部生产明细表类型"), | ||
18 | + ; | ||
19 | + | ||
20 | + private Integer type; | ||
21 | + | ||
22 | + private String desc; | ||
23 | +} |
src/main/java/com/order/erp/domain/dto/order/OrderCostDetailedOptLogDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.order.erp.domain.dto.BaseDO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +import java.io.Serializable; | ||
9 | + | ||
10 | +/** | ||
11 | + * 包装费用,内部生产明细操作日志表(OrderCostDetailedOptLogDO)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2023-09-08 15:14:46 | ||
15 | + */ | ||
16 | +@TableName("order_cost_detailed_opt_log") | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class OrderCostDetailedOptLogDO extends BaseDO implements Serializable { | ||
24 | + private Long id; | ||
25 | + private Long orderId; | ||
26 | + /** | ||
27 | + * 用户id | ||
28 | + */ | ||
29 | + private Long userId; | ||
30 | + /** | ||
31 | + * 操作类型 | ||
32 | + */ | ||
33 | + private Integer type; | ||
34 | + | ||
35 | + /** | ||
36 | + * 操作类型描述 | ||
37 | + */ | ||
38 | + private String optType; | ||
39 | + /** | ||
40 | + * 操作字段 json字符串 | ||
41 | + */ | ||
42 | + private String fields; | ||
43 | +} |
src/main/java/com/order/erp/domain/dto/order/OrderCostInfoDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
5 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
6 | +import java.io.Serializable; | ||
7 | +import java.math.BigDecimal; | ||
8 | + | ||
9 | +import com.order.erp.domain.dto.BaseDO; | ||
10 | +import io.swagger.annotations.ApiModel; | ||
11 | +import lombok.AllArgsConstructor; | ||
12 | +import lombok.Data; | ||
13 | +import lombok.EqualsAndHashCode; | ||
14 | +import lombok.NoArgsConstructor; | ||
15 | +import lombok.experimental.SuperBuilder; | ||
16 | + | ||
17 | +/** | ||
18 | + * <p> | ||
19 | + * | ||
20 | + * </p> | ||
21 | + * | ||
22 | + * @author author | ||
23 | + * @since 2024-12-22 | ||
24 | + */ | ||
25 | +@Data | ||
26 | +@EqualsAndHashCode(callSuper = false) | ||
27 | +@SuperBuilder | ||
28 | +@AllArgsConstructor | ||
29 | +@NoArgsConstructor | ||
30 | +@TableName("order_cost_info") | ||
31 | +@ApiModel(value="OrderCostinfo对象", description="") | ||
32 | +public class OrderCostInfoDO extends BaseDO implements Serializable { | ||
33 | + | ||
34 | + private static final long serialVersionUID = 1L; | ||
35 | + | ||
36 | + @TableId(value = "id", type = IdType.AUTO) | ||
37 | + private Long id; | ||
38 | + | ||
39 | + private Long orderId; | ||
40 | + | ||
41 | + private BigDecimal productionDepartmentPredictPrice; | ||
42 | + | ||
43 | + private BigDecimal productionActualPrice; | ||
44 | + | ||
45 | + private BigDecimal packetActualRmbTotalPrice; | ||
46 | + //包装费用明细表状态。 | ||
47 | + private Integer packStatus; | ||
48 | + //内部生产明细表状态。 | ||
49 | + private Integer innerProduceStatus; | ||
50 | + | ||
51 | +} |
src/main/java/com/order/erp/domain/dto/order/OrderProfitAnalysisDO.java
@@ -6,6 +6,7 @@ import lombok.*; | @@ -6,6 +6,7 @@ import lombok.*; | ||
6 | import lombok.experimental.SuperBuilder; | 6 | import lombok.experimental.SuperBuilder; |
7 | 7 | ||
8 | import java.io.Serializable; | 8 | import java.io.Serializable; |
9 | +import java.math.BigDecimal; | ||
9 | 10 | ||
10 | /** | 11 | /** |
11 | * 订单利润分析表(OrderProfitAnalysis)实体类 | 12 | * 订单利润分析表(OrderProfitAnalysis)实体类 |
src/main/java/com/order/erp/domain/dto/order/ProjectBaseAfterReviewSettingDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.math.BigDecimal; | ||
8 | +/** | ||
9 | + * 存储,内部业务研发净利润审核通过的配置,以及内部生产净利润审核通过的配置 因为这个配置是每年都会改变,所以需要保存当时审核年份的配置,防止切换到其他年份配置更改之后,之前的数据又会被重新计算。 | ||
10 | + * */ | ||
11 | +@TableName("project_base_after_review_setting") | ||
12 | +@Data | ||
13 | +@AllArgsConstructor | ||
14 | +@ToString | ||
15 | +@NoArgsConstructor | ||
16 | +@EqualsAndHashCode(callSuper = false) | ||
17 | +@SuperBuilder | ||
18 | +public class ProjectBaseAfterReviewSettingDO { | ||
19 | + private Long id; | ||
20 | + /** | ||
21 | + * 存储项目号,可能存储项目号的前八位(业务研发净利润专属),也可能存储完整的项目号(内部生产净利润) | ||
22 | + * */ | ||
23 | + private String projectNoPrefix; | ||
24 | + /** | ||
25 | + * type=1代表为提成成本配置,type=2代表为生产科固定成本配置 | ||
26 | + * */ | ||
27 | + private Integer type; | ||
28 | + | ||
29 | + /** | ||
30 | + * 审核通过时的配置数据。 --提成成本配置或者生产科固定成本中的固定成本。 type=1代表为提成成本配置,type=2代表为生产科固定成本配置 | ||
31 | + * */ | ||
32 | + private BigDecimal fixedCost; | ||
33 | + /** | ||
34 | + * 审核通过时的配置数据。 --提成成本配置中的提成比例。 | ||
35 | + * */ | ||
36 | + private BigDecimal commissionRate; | ||
37 | + | ||
38 | + /** | ||
39 | + * 审核通过时的配置数据。 --提成成本配置中的西班牙提成比例。 | ||
40 | + * */ | ||
41 | + private BigDecimal spainCommissionRate; | ||
42 | + | ||
43 | + /** | ||
44 | + * 审核通过时的配置数据。 --生产科固定成本配置中的提成单价。 | ||
45 | + * */ | ||
46 | + private BigDecimal commissionUnitPrice; | ||
47 | +} |
src/main/java/com/order/erp/domain/dto/order/ProjectBaseDevelopOptLogDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.order.erp.domain.dto.BaseDO; | ||
5 | +import lombok.*; | ||
6 | +import lombok.experimental.SuperBuilder; | ||
7 | + | ||
8 | +import java.io.Serializable; | ||
9 | + | ||
10 | +/** | ||
11 | + * 用户业务研发,内部生产操作日志表(ProjectBaseDevelopOptLogDO)实体类 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2023-09-08 15:14:46 | ||
15 | + */ | ||
16 | +@TableName("project_base_develop_opt_log") | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class ProjectBaseDevelopOptLogDO extends BaseDO implements Serializable { | ||
24 | + private static final long serialVersionUID = -79481441736960701L; | ||
25 | + | ||
26 | + private Long id; | ||
27 | + /** | ||
28 | + * 项目号前八位前缀 或者前十位前缀 | ||
29 | + */ | ||
30 | + private String projectNoPrefix; | ||
31 | + /** | ||
32 | + * 用户id | ||
33 | + */ | ||
34 | + private Long userId; | ||
35 | + /** | ||
36 | + * 操作类型 | ||
37 | + */ | ||
38 | + private Integer type; | ||
39 | + | ||
40 | + /** | ||
41 | + * 操作类型描述 | ||
42 | + */ | ||
43 | + private String optType; | ||
44 | + /** | ||
45 | + * 操作字段 json字符串 | ||
46 | + */ | ||
47 | + private String fields; | ||
48 | + | ||
49 | +} |
src/main/java/com/order/erp/domain/dto/order/ProjectBaseInfoDO.java
0 → 100644
1 | +package com.order.erp.domain.dto.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
5 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
6 | + | ||
7 | +import java.math.BigDecimal; | ||
8 | +import java.time.LocalDateTime; | ||
9 | +import java.io.Serializable; | ||
10 | + | ||
11 | +import com.order.erp.domain.dto.BaseDO; | ||
12 | +import io.swagger.annotations.ApiModel; | ||
13 | +import lombok.Data; | ||
14 | +import lombok.EqualsAndHashCode; | ||
15 | +import lombok.experimental.Accessors; | ||
16 | + | ||
17 | +/** | ||
18 | + * <p> | ||
19 | + * | ||
20 | + * </p> | ||
21 | + * | ||
22 | + * @author author | ||
23 | + * @since 2024-12-18 | ||
24 | + */ | ||
25 | +@Data | ||
26 | +@EqualsAndHashCode(callSuper = false) | ||
27 | +@Accessors(chain = true) | ||
28 | +@TableName("project_base_info") | ||
29 | +@ApiModel(value="ProjectBaseInfoDO", description="") | ||
30 | +public class ProjectBaseInfoDO extends BaseDO implements Serializable { | ||
31 | + | ||
32 | + private static final long serialVersionUID = 1L; | ||
33 | + | ||
34 | + @TableId(value = "id", type = IdType.AUTO) | ||
35 | + private Long id; | ||
36 | + /** | ||
37 | + * 项目号的前缀 例如:A05-2303-2391,projectNoPrefix就是A05-2303。 | ||
38 | + * */ | ||
39 | + private String projectNoPrefix; | ||
40 | + /** | ||
41 | + * 研发复制费合计¥ | ||
42 | + * */ | ||
43 | + private BigDecimal developmentCopyRmbTotalPrice; | ||
44 | + /** | ||
45 | + * 项目开始时间 | ||
46 | + * */ | ||
47 | + private LocalDateTime projectStartTime; | ||
48 | + /** | ||
49 | + * 项目结束时间 | ||
50 | + * */ | ||
51 | + private LocalDateTime projectEndTime; | ||
52 | + | ||
53 | + private LocalDateTime projectInnerProfitInfoStartTime; | ||
54 | + | ||
55 | + private LocalDateTime projectInnerProfitInfoEndTime; | ||
56 | + | ||
57 | + /** | ||
58 | + * 西班牙已发提成 | ||
59 | + * */ | ||
60 | + private BigDecimal spainPaidRmbCommission; | ||
61 | + /** | ||
62 | + * 中国团队已发提成 | ||
63 | + * */ | ||
64 | + private BigDecimal paidRmbCommission; | ||
65 | + /** | ||
66 | + * 实际汇率 | ||
67 | + * */ | ||
68 | + private BigDecimal actualExchangeRate; | ||
69 | + | ||
70 | + /** | ||
71 | + * 业务研发净利润分析表审核状态 | ||
72 | + * */ | ||
73 | + private Integer developmentStatus; | ||
74 | + /** | ||
75 | + * 内部生产净利润分析表审核状态 | ||
76 | + * */ | ||
77 | + private Integer innerProductionStatus; | ||
78 | + | ||
79 | +} |
src/main/java/com/order/erp/domain/model/OrderCostFieldLockRecord.java
0 → 100644
1 | +package com.order.erp.domain.model; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
5 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
6 | +import java.time.LocalDateTime; | ||
7 | +import com.baomidou.mybatisplus.annotation.FieldFill; | ||
8 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
9 | +import java.io.Serializable; | ||
10 | + | ||
11 | +import com.order.erp.domain.dto.BaseDO; | ||
12 | +import io.swagger.annotations.ApiModel; | ||
13 | +import io.swagger.annotations.ApiModelProperty; | ||
14 | +import lombok.AllArgsConstructor; | ||
15 | +import lombok.Data; | ||
16 | +import lombok.EqualsAndHashCode; | ||
17 | +import lombok.NoArgsConstructor; | ||
18 | +import lombok.experimental.Accessors; | ||
19 | +import lombok.experimental.SuperBuilder; | ||
20 | + | ||
21 | +/** | ||
22 | + * <p> | ||
23 | + * | ||
24 | + * </p> | ||
25 | + * | ||
26 | + * @author author | ||
27 | + * @since 2024-12-22 | ||
28 | + */ | ||
29 | +@Data | ||
30 | +@EqualsAndHashCode(callSuper = false) | ||
31 | +@SuperBuilder | ||
32 | +@NoArgsConstructor | ||
33 | +@AllArgsConstructor | ||
34 | +@TableName("order_cost_field_lock_record") | ||
35 | +@ApiModel(value="OrderCostFieldLockRecord对象", description="") | ||
36 | +public class OrderCostFieldLockRecord extends BaseDO implements Serializable { | ||
37 | + | ||
38 | + private static final long serialVersionUID = 1L; | ||
39 | + | ||
40 | + @TableId(value = "id", type = IdType.AUTO) | ||
41 | + private Long id; | ||
42 | + | ||
43 | + private String fields; | ||
44 | + | ||
45 | + private Long userId; | ||
46 | + | ||
47 | + private Long orderId; | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | +} |
src/main/java/com/order/erp/domain/model/ProjectApplyDO.java
0 → 100644
1 | +package com.order.erp.domain.model; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
5 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | + | ||
9 | +import com.order.erp.domain.ProjectApplyTypeEnum; | ||
10 | +import com.order.erp.domain.dto.BaseDO; | ||
11 | +import io.swagger.annotations.ApiModel; | ||
12 | +import io.swagger.annotations.ApiModelProperty; | ||
13 | +import lombok.AllArgsConstructor; | ||
14 | +import lombok.Data; | ||
15 | +import lombok.EqualsAndHashCode; | ||
16 | +import lombok.NoArgsConstructor; | ||
17 | +import lombok.experimental.SuperBuilder; | ||
18 | + | ||
19 | +/** | ||
20 | + * <p> | ||
21 | + * 项目-字段锁定申请表 | ||
22 | + * </p> | ||
23 | + * | ||
24 | + * @author author | ||
25 | + * @since 2024-12-22 | ||
26 | + */ | ||
27 | +@Data | ||
28 | +@EqualsAndHashCode(callSuper = false) | ||
29 | +@SuperBuilder | ||
30 | +@AllArgsConstructor | ||
31 | +@NoArgsConstructor | ||
32 | +@TableName("project_apply") | ||
33 | +@ApiModel(value="ProjectFieldLockApply对象", description="项目-字段锁定申请表") | ||
34 | +public class ProjectApplyDO extends BaseDO implements Serializable { | ||
35 | + | ||
36 | + private static final long serialVersionUID = 1L; | ||
37 | + | ||
38 | + @TableId(value = "id", type = IdType.AUTO) | ||
39 | + private Long id; | ||
40 | + | ||
41 | + @ApiModelProperty(value = "项目号") | ||
42 | + private String projectNoPrefix; | ||
43 | + | ||
44 | + | ||
45 | + @ApiModelProperty(value = "申请用户id") | ||
46 | + private Long applyUserId; | ||
47 | + | ||
48 | + @ApiModelProperty(value = "审批用户id") | ||
49 | + private Long auditUserId; | ||
50 | + | ||
51 | + @ApiModelProperty(value = "锁定字段 json字符串") | ||
52 | + private String fields; | ||
53 | + | ||
54 | + @ApiModelProperty(value = "锁定字段 json字符串") | ||
55 | + private String type; | ||
56 | + | ||
57 | + @ApiModelProperty(value = "状态:0 待审批,1 通过,2 拒绝") | ||
58 | + private Integer status; | ||
59 | + | ||
60 | + @ApiModelProperty(value = "审核备注") | ||
61 | + private String auditRemark; | ||
62 | + | ||
63 | + @ApiModelProperty(value = "审批角色code集合,分割") | ||
64 | + private String auditRoleCodes; | ||
65 | + | ||
66 | + @ApiModelProperty(value = "申请原因") | ||
67 | + private String applyRemark; | ||
68 | + | ||
69 | + | ||
70 | + | ||
71 | +} |
src/main/java/com/order/erp/domain/model/ProjectFieldLockRecord.java
0 → 100644
1 | +package com.order.erp.domain.model; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
5 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
6 | +import java.time.LocalDateTime; | ||
7 | +import com.baomidou.mybatisplus.annotation.FieldFill; | ||
8 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
9 | +import java.io.Serializable; | ||
10 | + | ||
11 | +import com.order.erp.domain.dto.BaseDO; | ||
12 | +import io.swagger.annotations.ApiModel; | ||
13 | +import io.swagger.annotations.ApiModelProperty; | ||
14 | +import lombok.AllArgsConstructor; | ||
15 | +import lombok.Data; | ||
16 | +import lombok.EqualsAndHashCode; | ||
17 | +import lombok.NoArgsConstructor; | ||
18 | +import lombok.experimental.Accessors; | ||
19 | +import lombok.experimental.SuperBuilder; | ||
20 | + | ||
21 | +/** | ||
22 | + * <p> | ||
23 | + * 项目-字段锁定记录表 | ||
24 | + * </p> | ||
25 | + * | ||
26 | + * @author author | ||
27 | + * @since 2024-12-22 | ||
28 | + */ | ||
29 | +@Data | ||
30 | +@EqualsAndHashCode(callSuper = false) | ||
31 | +@AllArgsConstructor | ||
32 | +@NoArgsConstructor | ||
33 | +@SuperBuilder | ||
34 | +@TableName("project_field_lock_record") | ||
35 | +@ApiModel(value="ProjectFieldLockRecord对象", description="项目-字段锁定记录表") | ||
36 | +public class ProjectFieldLockRecord extends BaseDO implements Serializable { | ||
37 | + | ||
38 | + private static final long serialVersionUID = 1L; | ||
39 | + | ||
40 | + @TableId(value = "id", type = IdType.AUTO) | ||
41 | + private Long id; | ||
42 | + | ||
43 | + | ||
44 | + @ApiModelProperty(value = "项目号") | ||
45 | + private String projectNoPrefix; | ||
46 | + | ||
47 | + @ApiModelProperty(value = "用户id") | ||
48 | + private Long userId; | ||
49 | + | ||
50 | + @ApiModelProperty(value = "锁定字段 json字符串") | ||
51 | + private String fields; | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | +} |
src/main/java/com/order/erp/domain/vo/order/AuditVO.java
1 | package com.order.erp.domain.vo.order; | 1 | package com.order.erp.domain.vo.order; |
2 | 2 | ||
3 | import com.order.erp.domain.vo.BasePageVO; | 3 | import com.order.erp.domain.vo.BasePageVO; |
4 | +import io.swagger.annotations.ApiModelProperty; | ||
4 | import lombok.*; | 5 | import lombok.*; |
5 | import lombok.experimental.SuperBuilder; | 6 | import lombok.experimental.SuperBuilder; |
6 | 7 | ||
@@ -17,23 +18,26 @@ import java.io.Serializable; | @@ -17,23 +18,26 @@ import java.io.Serializable; | ||
17 | @NoArgsConstructor | 18 | @NoArgsConstructor |
18 | @EqualsAndHashCode(callSuper = false) | 19 | @EqualsAndHashCode(callSuper = false) |
19 | @SuperBuilder | 20 | @SuperBuilder |
20 | -public class AuditVO extends BasePageVO implements Serializable { | 21 | +public class AuditVO implements Serializable { |
21 | 22 | ||
22 | /** | 23 | /** |
23 | * 申请id | 24 | * 申请id |
24 | */ | 25 | */ |
25 | @NotNull(message = "申请id不能为空") | 26 | @NotNull(message = "申请id不能为空") |
27 | + @ApiModelProperty(value = "申请id", required = true) | ||
26 | private Long id; | 28 | private Long id; |
27 | 29 | ||
28 | /** | 30 | /** |
29 | * 状态:1 通过,2 拒绝 | 31 | * 状态:1 通过,2 拒绝 |
30 | */ | 32 | */ |
31 | @NotNull(message = "状态不能为空") | 33 | @NotNull(message = "状态不能为空") |
34 | + @ApiModelProperty(value = "状态:1 通过,2 拒绝", required = true) | ||
32 | private Integer status; | 35 | private Integer status; |
33 | 36 | ||
34 | /** | 37 | /** |
35 | * 拒绝原因备注 | 38 | * 拒绝原因备注 |
36 | */ | 39 | */ |
40 | + @ApiModelProperty(value = "拒绝原因备注") | ||
37 | private String refuseRemark; | 41 | private String refuseRemark; |
38 | } | 42 | } |
39 | 43 |
src/main/java/com/order/erp/domain/vo/order/BusinessCostExportSelect.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import io.swagger.annotations.ApiModelProperty; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | +@Data | ||
10 | +@AllArgsConstructor | ||
11 | +@ToString | ||
12 | +@NoArgsConstructor | ||
13 | +@EqualsAndHashCode(callSuper = false) | ||
14 | +@SuperBuilder | ||
15 | +public class BusinessCostExportSelect { | ||
16 | + /** | ||
17 | + * 包装费用$ | ||
18 | + */ | ||
19 | + @ApiModelProperty(value = "包装费用(美元)") | ||
20 | + private String packetPrice; | ||
21 | + | ||
22 | + /** | ||
23 | + * 包装费用合计$ | ||
24 | + */ | ||
25 | + @ApiModelProperty(value = "包装费用合计(美元)") | ||
26 | + private String packetTotalPrice; | ||
27 | + | ||
28 | + /** | ||
29 | + * 包装费用合计¥ | ||
30 | + */ | ||
31 | + @ApiModelProperty(value = "包装费用合计(人民币)") | ||
32 | + private String packetRmbTotalPrice; | ||
33 | + | ||
34 | + /** | ||
35 | + * 包装费用实际金额 | ||
36 | + */ | ||
37 | + @ApiModelProperty(value = "包装费用实际金额(人民币)") | ||
38 | + private String packetActualRmbTotalPrice; | ||
39 | + | ||
40 | + /** | ||
41 | + * 实际跟单单价¥ | ||
42 | + */ | ||
43 | + @ApiModelProperty(value = "实际跟单单价(人民币)") | ||
44 | + private String packetActualRmbPrice; | ||
45 | + | ||
46 | + /** | ||
47 | + * 实际跟单单价$ | ||
48 | + */ | ||
49 | + @ApiModelProperty(value = "实际跟单单价(美元)") | ||
50 | + private String packetActualPrice; | ||
51 | + | ||
52 | + /** | ||
53 | + * 包装费用收益 | ||
54 | + */ | ||
55 | + @ApiModelProperty(value = "包装费用收益(人民币)") | ||
56 | + private String packetProfitRmbPrice; | ||
57 | + | ||
58 | + /** | ||
59 | + * 包装费用利润率 | ||
60 | + */ | ||
61 | + @ApiModelProperty(value = "包装费用利润率") | ||
62 | + private String packetProfitRate; | ||
63 | + | ||
64 | +} |
src/main/java/com/order/erp/domain/vo/order/BusinessProfitDetailVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import io.swagger.annotations.ApiModelProperty; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | +import java.math.BigDecimal; | ||
9 | + | ||
10 | +/** | ||
11 | + * 业务/研发净利润分析 | ||
12 | + * | ||
13 | + * @author makejava | ||
14 | + * @since 2024-08-05 16:26:34 | ||
15 | + */ | ||
16 | +@Data | ||
17 | +@AllArgsConstructor | ||
18 | +@ToString | ||
19 | +@NoArgsConstructor | ||
20 | +@EqualsAndHashCode(callSuper = false) | ||
21 | +@SuperBuilder | ||
22 | +public class BusinessProfitDetailVO implements Serializable { | ||
23 | + | ||
24 | + | ||
25 | + /** | ||
26 | + * 客户编码 | ||
27 | + */ | ||
28 | + @ApiModelProperty(value = "客户编码") | ||
29 | + private String customerCode; | ||
30 | + | ||
31 | + /** | ||
32 | + * 项目号 | ||
33 | + */ | ||
34 | + @ApiModelProperty(value = "订单id") | ||
35 | + private Long orderId; | ||
36 | + | ||
37 | + /** | ||
38 | + * 项目号 | ||
39 | + */ | ||
40 | + @ApiModelProperty(value = "项目号") | ||
41 | + private String projectNo; | ||
42 | + | ||
43 | + /** | ||
44 | + * 生产科 | ||
45 | + */ | ||
46 | + @ApiModelProperty(value = "生产部门") | ||
47 | + private String productionDepartment; | ||
48 | + | ||
49 | + /** | ||
50 | + * 内部编号 | ||
51 | + */ | ||
52 | + @ApiModelProperty(value = "内部编号") | ||
53 | + private String innerNo; | ||
54 | + | ||
55 | + /** | ||
56 | + * pic图片地址 | ||
57 | + */ | ||
58 | + @ApiModelProperty(value = "图片地址") | ||
59 | + private String picUrl; | ||
60 | + | ||
61 | + /** | ||
62 | + * 订单数量 | ||
63 | + */ | ||
64 | + @ApiModelProperty(value = "订单数量") | ||
65 | + private Integer orderCount; | ||
66 | + | ||
67 | + /** | ||
68 | + * 包装费用$ | ||
69 | + */ | ||
70 | + @ApiModelProperty(value = "包装费用(美元)") | ||
71 | + private Double packetPrice; | ||
72 | + | ||
73 | + /** | ||
74 | + * 包装费用合计$ | ||
75 | + */ | ||
76 | + @ApiModelProperty(value = "包装费用合计(美元)") | ||
77 | + private Double packetTotalPrice; | ||
78 | + | ||
79 | + /** | ||
80 | + * 包装费用合计¥ | ||
81 | + */ | ||
82 | + @ApiModelProperty(value = "包装费用合计(人民币)") | ||
83 | + private Double packetRmbTotalPrice; | ||
84 | + | ||
85 | + /** | ||
86 | + * 包装费用实际金额 | ||
87 | + */ | ||
88 | + @ApiModelProperty(value = "包装费用实际金额(人民币)") | ||
89 | + private BigDecimal packetActualRmbTotalPrice; | ||
90 | + | ||
91 | + /** | ||
92 | + * 实际跟单单价¥ | ||
93 | + */ | ||
94 | + @ApiModelProperty(value = "实际跟单单价(人民币)") | ||
95 | + private BigDecimal packetActualRmbPrice; | ||
96 | + | ||
97 | + /** | ||
98 | + * 实际跟单单价$ | ||
99 | + */ | ||
100 | + @ApiModelProperty(value = "实际跟单单价(美元)") | ||
101 | + private BigDecimal packetActualPrice; | ||
102 | + | ||
103 | + /** | ||
104 | + * 包装费用收益 | ||
105 | + */ | ||
106 | + @ApiModelProperty(value = "包装费用收益(人民币)") | ||
107 | + private BigDecimal packetProfitRmbPrice; | ||
108 | + | ||
109 | + /** | ||
110 | + * 包装费用利润率 | ||
111 | + */ | ||
112 | + @ApiModelProperty(value = "包装费用利润率") | ||
113 | + private BigDecimal packetProfitRate; | ||
114 | + /** | ||
115 | + * 包装费用明细表状态 | ||
116 | + */ | ||
117 | + @ApiModelProperty(value = "包装费用明细表状态") | ||
118 | + private Integer packStatus; | ||
119 | + | ||
120 | + /** | ||
121 | + * 锁定字段信息 | ||
122 | + */ | ||
123 | + @ApiModelProperty(value = "锁定字段信息") | ||
124 | + private OrderCostInfolockFieldVO lockFields; | ||
125 | + | ||
126 | + | ||
127 | +} | ||
128 | + |
src/main/java/com/order/erp/domain/vo/order/BusinessProfitInfoVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import io.swagger.annotations.ApiModelProperty; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | +import java.math.BigDecimal; | ||
9 | +import java.time.LocalDateTime; | ||
10 | +import java.util.List; | ||
11 | +import java.util.Set; | ||
12 | + | ||
13 | +/** | ||
14 | + * 业务/研发净利润分析 | ||
15 | + * | ||
16 | + * @author makejava | ||
17 | + * @since 2024-08-05 16:26:34 | ||
18 | + */ | ||
19 | +@Data | ||
20 | +@AllArgsConstructor | ||
21 | +@ToString | ||
22 | +@NoArgsConstructor | ||
23 | +@EqualsAndHashCode(callSuper = false) | ||
24 | +@SuperBuilder | ||
25 | +public class BusinessProfitInfoVO implements Serializable { | ||
26 | + | ||
27 | + | ||
28 | + /** | ||
29 | + * 客户编码 | ||
30 | + */ | ||
31 | + @ApiModelProperty(value = "客户编码") | ||
32 | + private String customerCode; | ||
33 | + | ||
34 | + /** | ||
35 | + * 项目号 | ||
36 | + */ | ||
37 | + @ApiModelProperty(value = "项目号") | ||
38 | + private String projectNoPrefix; | ||
39 | + | ||
40 | + @ApiModelProperty(value = "完整项目号,用于当做id来使用,因为没有返回id所以无法确实操作的是那一条数据,所以需要完整的项目号来确认是哪一条数据") | ||
41 | + private Set<String> detailProjectNo; | ||
42 | + | ||
43 | + /** | ||
44 | + * 客户总价¥ | ||
45 | + */ | ||
46 | + @ApiModelProperty(value = "客户总价(人民币)") | ||
47 | + private Double customerRmbTotalPrice; | ||
48 | + | ||
49 | + /** | ||
50 | + * 客户总价¥ | ||
51 | + */ | ||
52 | + @ApiModelProperty(value = "客户总价") | ||
53 | + private Double customerTotalPrice; | ||
54 | + | ||
55 | + /** | ||
56 | + * 生成科总价¥ | ||
57 | + */ | ||
58 | + @ApiModelProperty(value = "生产部门总价") | ||
59 | + private Double productionDepartmentTotalPrice; | ||
60 | + | ||
61 | + /** | ||
62 | + * 生产科 | ||
63 | + */ | ||
64 | + @ApiModelProperty(value = "生产部门") | ||
65 | + private String productionDepartment; | ||
66 | + | ||
67 | + /** | ||
68 | + * 内部编号 | ||
69 | + */ | ||
70 | + @ApiModelProperty(value = "内部编号") | ||
71 | + private String innerNo; | ||
72 | + | ||
73 | + /** | ||
74 | + * pic图片地址 | ||
75 | + */ | ||
76 | + @ApiModelProperty(value = "图片地址") | ||
77 | + private String picUrl; | ||
78 | + | ||
79 | + /** | ||
80 | + * 订单数量 | ||
81 | + */ | ||
82 | + @ApiModelProperty(value = "订单数量") | ||
83 | + private Integer orderCount; | ||
84 | + | ||
85 | + /** | ||
86 | + * 包装费用$ | ||
87 | + */ | ||
88 | + @ApiModelProperty(value = "包装费用(美元)") | ||
89 | + private Double packetPrice; | ||
90 | + | ||
91 | + /** | ||
92 | + * 包装费用合计$ | ||
93 | + */ | ||
94 | + @ApiModelProperty(value = "包装费用合计(美元)") | ||
95 | + private Double packetTotalPrice; | ||
96 | + | ||
97 | + /** | ||
98 | + * 包装费用合计¥ | ||
99 | + */ | ||
100 | + @ApiModelProperty(value = "包装费用合计(人民币)") | ||
101 | + private Double packetRmbTotalPrice; | ||
102 | + | ||
103 | + /** | ||
104 | + * 包装费用实际金额 | ||
105 | + */ | ||
106 | + @ApiModelProperty(value = "包装费用实际金额(人民币)") | ||
107 | + private BigDecimal packetActualRmbTotalPrice; | ||
108 | + | ||
109 | + /** | ||
110 | + * 包装费用实际金额¥ | ||
111 | + */ | ||
112 | + @ApiModelProperty(value = "包装费用实际金额(人民币)") | ||
113 | + private BigDecimal packetActualRmbPrice; | ||
114 | + | ||
115 | + /** | ||
116 | + * 包装费用实际金额$ | ||
117 | + */ | ||
118 | + @ApiModelProperty(value = "包装费用实际金额(美元)") | ||
119 | + private BigDecimal packetActualPrice; | ||
120 | + | ||
121 | + /** | ||
122 | + * 包装费用收益 | ||
123 | + */ | ||
124 | + @ApiModelProperty(value = "包装费用收益(人民币)") | ||
125 | + private BigDecimal packetProfitRmbPrice; | ||
126 | + | ||
127 | + /** | ||
128 | + * 包装费用利润率 | ||
129 | + */ | ||
130 | + @ApiModelProperty(value = "包装费用利润率") | ||
131 | + private BigDecimal packetProfitRate; | ||
132 | + | ||
133 | + /** | ||
134 | + * 研发复制费合计¥ | ||
135 | + */ | ||
136 | + @ApiModelProperty(value = "研发复制费合计(人民币)") | ||
137 | + private BigDecimal developmentCopyRmbTotalPrice; | ||
138 | + | ||
139 | + /** | ||
140 | + * 固定成本 | ||
141 | + */ | ||
142 | + @ApiModelProperty(value = "固定成本") | ||
143 | + private BigDecimal fixedCost; | ||
144 | + | ||
145 | + /** | ||
146 | + * 西班牙已发提成¥ | ||
147 | + */ | ||
148 | + @ApiModelProperty(value = "西班牙已发提成(人民币)") | ||
149 | + private BigDecimal spainPaidRmbCommission; | ||
150 | + | ||
151 | + /** | ||
152 | + * 西班牙提成¥ | ||
153 | + */ | ||
154 | + @ApiModelProperty(value = "西班牙提成(人民币)") | ||
155 | + private BigDecimal spainRmbCommission; | ||
156 | + | ||
157 | + /** | ||
158 | + * 西班牙未发提成¥ | ||
159 | + */ | ||
160 | + @ApiModelProperty(value = "西班牙未发提成(人民币)") | ||
161 | + private BigDecimal spainUnpaidRmbCommission; | ||
162 | + | ||
163 | + /** | ||
164 | + * 已发提成¥ | ||
165 | + */ | ||
166 | + @ApiModelProperty(value = "已发提成(人民币)") | ||
167 | + private BigDecimal paidRmbCommission; | ||
168 | + | ||
169 | + /** | ||
170 | + * 提成¥ | ||
171 | + */ | ||
172 | + @ApiModelProperty(value = "提成(人民币)") | ||
173 | + private BigDecimal rmbCommission; | ||
174 | + | ||
175 | + /** | ||
176 | + * 未发提成¥ | ||
177 | + */ | ||
178 | + @ApiModelProperty(value = "未发提成(人民币)") | ||
179 | + private BigDecimal unpaidRmbCommission; | ||
180 | + | ||
181 | + /** | ||
182 | + * 实际汇率 | ||
183 | + */ | ||
184 | + @ApiModelProperty(value = "实际汇率") | ||
185 | + private BigDecimal actualExchangeRate; | ||
186 | + | ||
187 | + /** | ||
188 | + * 支出合计 | ||
189 | + */ | ||
190 | + @ApiModelProperty(value = "支出合计(人民币)") | ||
191 | + private BigDecimal rmbTotalExpense; | ||
192 | + | ||
193 | + /** | ||
194 | + * 毛利润 | ||
195 | + */ | ||
196 | + @ApiModelProperty(value = "毛利润") | ||
197 | + private BigDecimal profit; | ||
198 | + | ||
199 | + /** | ||
200 | + * 毛利率 | ||
201 | + */ | ||
202 | + @ApiModelProperty(value = "毛利率") | ||
203 | + private BigDecimal profitRate; | ||
204 | + | ||
205 | + /** | ||
206 | + * 研发净利润 | ||
207 | + */ | ||
208 | + @ApiModelProperty(value = "研发净利润") | ||
209 | + private BigDecimal developmentProfit; | ||
210 | + | ||
211 | + /** | ||
212 | + * 净利润率 | ||
213 | + */ | ||
214 | + @ApiModelProperty(value = "净利润率") | ||
215 | + private BigDecimal developmentProfitRate; | ||
216 | + | ||
217 | + /** | ||
218 | + * 实际跟单单价 | ||
219 | + */ | ||
220 | + @ApiModelProperty(value = "实际跟单单价(人民币)") | ||
221 | + private BigDecimal actualOrderRmbPrice; | ||
222 | + | ||
223 | + /** | ||
224 | + * 实际跟单单价$ | ||
225 | + */ | ||
226 | + @ApiModelProperty(value = "实际跟单单价(美元)") | ||
227 | + private BigDecimal actualOrderPrice; | ||
228 | + | ||
229 | + /** | ||
230 | + * 汇率收益 | ||
231 | + */ | ||
232 | + @ApiModelProperty(value = "汇率收益") | ||
233 | + private BigDecimal exchangeRateProfit; | ||
234 | + | ||
235 | + /** | ||
236 | + * 综合收益 | ||
237 | + */ | ||
238 | + @ApiModelProperty(value = "综合收益") | ||
239 | + private BigDecimal comprehensiveProfit; | ||
240 | + | ||
241 | + | ||
242 | + /** | ||
243 | + * 业务研发净利润状态 | ||
244 | + */ | ||
245 | + @ApiModelProperty(value = "业务研发净利润状态") | ||
246 | + private Integer developmentStatus; | ||
247 | + | ||
248 | + /** | ||
249 | + * 内部生产净利润状态 | ||
250 | + */ | ||
251 | + @ApiModelProperty(value = "内部生产净利润状态") | ||
252 | + private Integer innerProductionStatus; | ||
253 | + | ||
254 | + /** | ||
255 | + * 项目开始时间 | ||
256 | + */ | ||
257 | + @ApiModelProperty(value = "项目开始时间") | ||
258 | + private LocalDateTime projectStartTime; | ||
259 | + | ||
260 | + /** | ||
261 | + * 项目结束时间 | ||
262 | + */ | ||
263 | + @ApiModelProperty(value = "项目结束时间") | ||
264 | + private LocalDateTime projectEndTime; | ||
265 | + | ||
266 | + @ApiModelProperty(value = "生产开始时间") | ||
267 | + private LocalDateTime produceStartTime; | ||
268 | + | ||
269 | + @ApiModelProperty(value = "生产结束时间") | ||
270 | + private LocalDateTime produceEndTime; | ||
271 | + | ||
272 | + @ApiModelProperty(value = "锁定字段信息") | ||
273 | + private ProjectBaseInfoLockFieldVO lockFields; | ||
274 | + | ||
275 | + | ||
276 | +} | ||
277 | + |
src/main/java/com/order/erp/domain/vo/order/InnerProfitDetailExportSelect.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import io.swagger.annotations.ApiModelProperty; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | + | ||
8 | +@Data | ||
9 | +@AllArgsConstructor | ||
10 | +@ToString | ||
11 | +@NoArgsConstructor | ||
12 | +@EqualsAndHashCode(callSuper = false) | ||
13 | +@SuperBuilder | ||
14 | +public class InnerProfitDetailExportSelect { | ||
15 | + /** | ||
16 | + * 生产科预算金额由财务手动输入 | ||
17 | + */ | ||
18 | + @ApiModelProperty(value = "生产科预算金额") | ||
19 | + private String productionDepartmentPredictPrice; | ||
20 | + | ||
21 | + | ||
22 | + /** | ||
23 | + * 实际发生费用 手动输入 | ||
24 | + */ | ||
25 | + @ApiModelProperty(value = "实际发生费用") | ||
26 | + private String productionActualPrice; | ||
27 | + | ||
28 | + /** | ||
29 | + * 生产科总价合计 | ||
30 | + */ | ||
31 | + @ApiModelProperty(value = "生产科总价") | ||
32 | + private String productionDepartmentTotalPrice; | ||
33 | + /** | ||
34 | + * 生产科总价合计 | ||
35 | + */ | ||
36 | + @ApiModelProperty(value = "生产科单价") | ||
37 | + private String productionDepartmentPrice; | ||
38 | + | ||
39 | + | ||
40 | + /** | ||
41 | + * 预算占比 | ||
42 | + * 预算占比计算(实际发生费用/预算金额 | ||
43 | + */ | ||
44 | + @ApiModelProperty(value = "预算占比") | ||
45 | + private String predictRatio; | ||
46 | + | ||
47 | + /** | ||
48 | + * 预算占比与实际占比差 | ||
49 | + * 预算占比与实际占比差计算(1-预算占比) | ||
50 | + */ | ||
51 | + @ApiModelProperty(value = "预算占比与实际占比差") | ||
52 | + private String predictAndActualRatio; | ||
53 | + | ||
54 | + /** | ||
55 | + * 内部生产毛利润计算:生产科总价-预算金额 | ||
56 | + */ | ||
57 | + @ApiModelProperty(value = "事前毛利润") | ||
58 | + private String beforeGrossProfit; | ||
59 | + | ||
60 | + /** | ||
61 | + * 内部生产毛利润率计算:事前毛利润/生产科总价 | ||
62 | + */ | ||
63 | + @ApiModelProperty(value = "事前毛利率") | ||
64 | + private String beforeGrossProfitRate; | ||
65 | + | ||
66 | + /** | ||
67 | + * 内部生产毛利润计算:生产科总价-实际发生费用就是得出 | ||
68 | + */ | ||
69 | + @ApiModelProperty(value = "事后毛利润") | ||
70 | + private String grossProfit; | ||
71 | + | ||
72 | + /** | ||
73 | + * 内部生产毛利润率计算:事后毛利润/生产科总价 | ||
74 | + */ | ||
75 | + @ApiModelProperty(value = "事后毛利率") | ||
76 | + private String grossProfitRate; | ||
77 | + | ||
78 | +} |
src/main/java/com/order/erp/domain/vo/order/InnerProfitDetailVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import io.swagger.annotations.ApiModelProperty; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | +import java.math.BigDecimal; | ||
9 | +import java.util.Map; | ||
10 | + | ||
11 | +/** | ||
12 | + * 业务/研发净利润分析 | ||
13 | + * | ||
14 | + * @author makejava | ||
15 | + * @since 2024-08-05 16:26:34 | ||
16 | + */ | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class InnerProfitDetailVO implements Serializable { | ||
24 | + | ||
25 | + /** | ||
26 | + * 订单id | ||
27 | + */ | ||
28 | + @ApiModelProperty(value = "订单id") | ||
29 | + private Long orderId; | ||
30 | + /** | ||
31 | + * 客户编码 | ||
32 | + */ | ||
33 | + @ApiModelProperty(value = "客户编码") | ||
34 | + private String customerCode; | ||
35 | + | ||
36 | + /** | ||
37 | + * 项目号 | ||
38 | + */ | ||
39 | + @ApiModelProperty(value = "项目号") | ||
40 | + private String projectNo; | ||
41 | + @ApiModelProperty(value = "生产科") | ||
42 | + private String productionDepartment; | ||
43 | + | ||
44 | + /** | ||
45 | + * 内部编号 | ||
46 | + */ | ||
47 | + @ApiModelProperty(value = "内部编码") | ||
48 | + private String innerNo; | ||
49 | + /** | ||
50 | + * pic图片地址 | ||
51 | + */ | ||
52 | + @ApiModelProperty(value = "图片") | ||
53 | + private String picUrl; | ||
54 | + | ||
55 | + /** | ||
56 | + * 订单数量 | ||
57 | + */ | ||
58 | + @ApiModelProperty(value = "数量") | ||
59 | + private Integer orderCount; | ||
60 | + | ||
61 | + /** | ||
62 | + * 生产科预算金额由财务手动输入 | ||
63 | + */ | ||
64 | + @ApiModelProperty(value = "生产科预算金额") | ||
65 | + private BigDecimal productionDepartmentPredictPrice; | ||
66 | + | ||
67 | + /** | ||
68 | + * 生产科预算单价,由生产科预算金额/数量。 | ||
69 | + */ | ||
70 | + @ApiModelProperty(value = "生产科预算金额") | ||
71 | + private BigDecimal productionDepartmentPredictUnitprice; | ||
72 | + | ||
73 | + | ||
74 | + /** | ||
75 | + * 实际发生费用 手动输入 | ||
76 | + */ | ||
77 | + @ApiModelProperty(value = "实际发生费用") | ||
78 | + private BigDecimal productionActualPrice; | ||
79 | + | ||
80 | + /** | ||
81 | + * 生产科总价合计 | ||
82 | + */ | ||
83 | + @ApiModelProperty(value = "生产科总价") | ||
84 | + private Double productionDepartmentTotalPrice; | ||
85 | + /** | ||
86 | + * 生产科总价合计 | ||
87 | + */ | ||
88 | + @ApiModelProperty(value = "生产科单价") | ||
89 | + private Double productionDepartmentPrice; | ||
90 | + | ||
91 | + | ||
92 | + /** | ||
93 | + * 预算占比 | ||
94 | + * 预算占比计算(实际发生费用/预算金额 | ||
95 | + */ | ||
96 | + @ApiModelProperty(value = "预算占比") | ||
97 | + private BigDecimal predictRatio; | ||
98 | + | ||
99 | + /** | ||
100 | + * 预算占比与实际占比差 | ||
101 | + * 预算占比与实际占比差计算(1-预算占比) | ||
102 | + */ | ||
103 | + @ApiModelProperty(value = "预算占比与实际占比差") | ||
104 | + private BigDecimal predictAndActualRatio; | ||
105 | + | ||
106 | + /** | ||
107 | + * 内部生产毛利润计算:生产科总价-预算金额 | ||
108 | + */ | ||
109 | + @ApiModelProperty(value = "事前毛利润") | ||
110 | + private BigDecimal beforeGrossProfit; | ||
111 | + | ||
112 | + /** | ||
113 | + * 内部生产毛利润率计算:事前毛利润/生产科总价 | ||
114 | + */ | ||
115 | + @ApiModelProperty(value = "事前毛利润") | ||
116 | + private BigDecimal beforeGrossProfitRate; | ||
117 | + | ||
118 | + /** | ||
119 | + * 内部生产毛利润计算:生产科总价-实际发生费用就是得出 | ||
120 | + */ | ||
121 | + @ApiModelProperty(value = "事后毛利润") | ||
122 | + private BigDecimal grossProfit; | ||
123 | + | ||
124 | + /** | ||
125 | + * 内部生产毛利润率计算:事后毛利润/生产科总价 | ||
126 | + */ | ||
127 | + @ApiModelProperty(value = "事后毛利润") | ||
128 | + private BigDecimal grossProfitRate; | ||
129 | + /** | ||
130 | + * 内部生产明细表状态 | ||
131 | + */ | ||
132 | + @ApiModelProperty(value = "内部生产明细表状态") | ||
133 | + private Integer innerProduceStatus ; | ||
134 | + | ||
135 | + private OrderCostInfolockFieldVO lockFields; | ||
136 | + | ||
137 | +} | ||
138 | + |
src/main/java/com/order/erp/domain/vo/order/InnerProfitInfoExportSelect.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import io.swagger.annotations.ApiModelProperty; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | +@Data | ||
10 | +@AllArgsConstructor | ||
11 | +@ToString | ||
12 | +@NoArgsConstructor | ||
13 | +@EqualsAndHashCode(callSuper = false) | ||
14 | +@SuperBuilder | ||
15 | +public class InnerProfitInfoExportSelect { | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | + /** | ||
20 | + * 生产科预算金额由财务手动输入 | ||
21 | + */ | ||
22 | + @ApiModelProperty(value = "生产科预算金额") | ||
23 | + private String productionDepartmentPredictPrice; | ||
24 | + | ||
25 | + | ||
26 | + /** | ||
27 | + * 实际发生费用 手动输入 | ||
28 | + */ | ||
29 | + @ApiModelProperty(value = "实际发生费用") | ||
30 | + private String productionActualPrice; | ||
31 | + | ||
32 | + /** | ||
33 | + * 生产科总价合计 | ||
34 | + */ | ||
35 | + @ApiModelProperty(value = "生产科单价") | ||
36 | + private String productionDepartmentUnitPrice; | ||
37 | + | ||
38 | + /** | ||
39 | + * 生产科总价合计 | ||
40 | + */ | ||
41 | + @ApiModelProperty(value = "生产科总价") | ||
42 | + private String productionDepartmentTotalPrice; | ||
43 | + | ||
44 | + | ||
45 | + /** | ||
46 | + * 预算占比 | ||
47 | + * 预算占比计算(实际发生费用/预算金额 | ||
48 | + */ | ||
49 | + @ApiModelProperty(value = "预算占比") | ||
50 | + private String predictRatio; | ||
51 | + | ||
52 | + /** | ||
53 | + * 预算占比与实际占比差 | ||
54 | + * 预算占比与实际占比差计算(1-预算占比) | ||
55 | + */ | ||
56 | + @ApiModelProperty(value = "预算占比与实际占比差") | ||
57 | + private String predictAndActualRatio; | ||
58 | + | ||
59 | + /** | ||
60 | + * 内部生产毛利润计算:生产科总价-预算金额 | ||
61 | + */ | ||
62 | + @ApiModelProperty(value = "事前毛利润") | ||
63 | + private String beforeGrossProfit; | ||
64 | + | ||
65 | + /** | ||
66 | + * 内部生产毛利润率计算:事前毛利润/生产科总价 | ||
67 | + */ | ||
68 | + @ApiModelProperty(value = "事前毛利率") | ||
69 | + private String beforeGrossProfitRate; | ||
70 | + | ||
71 | + /** | ||
72 | + * 内部生产毛利润计算:生产科总价-实际发生费用就是得出 | ||
73 | + */ | ||
74 | + @ApiModelProperty(value = "事后毛利润") | ||
75 | + private String grossProfit; | ||
76 | + | ||
77 | + /** | ||
78 | + * 内部生产毛利润率计算:事后毛利润/生产科总价 | ||
79 | + */ | ||
80 | + @ApiModelProperty(value = "事后毛利率") | ||
81 | + private String grossProfitRate; | ||
82 | + | ||
83 | + /** | ||
84 | + * 内部生产固定成本 | ||
85 | + */ | ||
86 | + @ApiModelProperty(value = "内部生产固定成本") | ||
87 | + private String innerProductionFixedCost; | ||
88 | + | ||
89 | + /** | ||
90 | + * 内部生产提成 | ||
91 | + */ | ||
92 | + @ApiModelProperty(value = "内部生产提成") | ||
93 | + private String innerProductionCommission; | ||
94 | + /** | ||
95 | + * 内部生产净利润 | ||
96 | + */ | ||
97 | + @ApiModelProperty(value = "内部生产净利润") | ||
98 | + private String innerProductionProfit; | ||
99 | + /** | ||
100 | + * 内部生产净利润率 | ||
101 | + */ | ||
102 | + @ApiModelProperty(value = "内部生产净利润率") | ||
103 | + private String innerProductionProfitRate; | ||
104 | +} |
src/main/java/com/order/erp/domain/vo/order/InnerProfitInfoVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import io.swagger.annotations.ApiModelProperty; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | +import java.math.BigDecimal; | ||
9 | +import java.time.LocalDateTime; | ||
10 | + | ||
11 | +/** | ||
12 | + * 业务/研发净利润分析 | ||
13 | + * | ||
14 | + * @author makejava | ||
15 | + * @since 2024-08-05 16:26:34 | ||
16 | + */ | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class InnerProfitInfoVO implements Serializable { | ||
24 | + | ||
25 | + | ||
26 | + /** | ||
27 | + * 客户编码 | ||
28 | + */ | ||
29 | + @ApiModelProperty(value = "客户编码") | ||
30 | + private String customerCode; | ||
31 | + | ||
32 | + /** | ||
33 | + * 项目号 | ||
34 | + */ | ||
35 | + @ApiModelProperty(value = "项目号") | ||
36 | + private String projectNoPrefix; | ||
37 | + @ApiModelProperty(value = "生产科") | ||
38 | + private String productionDepartment; | ||
39 | + | ||
40 | + /** | ||
41 | + * 订单数量 | ||
42 | + */ | ||
43 | + @ApiModelProperty(value = "数量") | ||
44 | + private Integer orderCount; | ||
45 | + | ||
46 | + /** | ||
47 | + * 生产科预算金额由财务手动输入 | ||
48 | + */ | ||
49 | + @ApiModelProperty(value = "生产科预算金额") | ||
50 | + private BigDecimal productionDepartmentPredictPrice; | ||
51 | + | ||
52 | + | ||
53 | + /** | ||
54 | + * 实际发生费用 手动输入 | ||
55 | + */ | ||
56 | + @ApiModelProperty(value = "实际发生费用") | ||
57 | + private BigDecimal productionActualPrice; | ||
58 | + | ||
59 | + /** | ||
60 | + * 生产科总价合计 | ||
61 | + */ | ||
62 | + @ApiModelProperty(value = "生产科单价") | ||
63 | + private Double productionDepartmentUnitPrice; | ||
64 | + | ||
65 | + /** | ||
66 | + * 生产科总价合计 | ||
67 | + */ | ||
68 | + @ApiModelProperty(value = "生产科总价") | ||
69 | + private Double productionDepartmentTotalPrice; | ||
70 | + | ||
71 | + | ||
72 | + /** | ||
73 | + * 预算占比 | ||
74 | + * 预算占比计算(实际发生费用/预算金额 | ||
75 | + */ | ||
76 | + @ApiModelProperty(value = "预算占比") | ||
77 | + private BigDecimal predictRatio; | ||
78 | + | ||
79 | + /** | ||
80 | + * 预算占比与实际占比差 | ||
81 | + * 预算占比与实际占比差计算(1-预算占比) | ||
82 | + */ | ||
83 | + @ApiModelProperty(value = "预算占比与实际占比差") | ||
84 | + private BigDecimal predictAndActualRatio; | ||
85 | + | ||
86 | + /** | ||
87 | + * 内部生产毛利润计算:生产科总价-预算金额 | ||
88 | + */ | ||
89 | + @ApiModelProperty(value = "事前毛利润") | ||
90 | + private BigDecimal beforeGrossProfit; | ||
91 | + | ||
92 | + /** | ||
93 | + * 内部生产毛利润率计算:事前毛利润/生产科总价 | ||
94 | + */ | ||
95 | + @ApiModelProperty(value = "事前毛利润") | ||
96 | + private BigDecimal beforeGrossProfitRate; | ||
97 | + | ||
98 | + /** | ||
99 | + * 内部生产毛利润计算:生产科总价-实际发生费用就是得出 | ||
100 | + */ | ||
101 | + @ApiModelProperty(value = "事后毛利润") | ||
102 | + private BigDecimal grossProfit; | ||
103 | + | ||
104 | + /** | ||
105 | + * 内部生产毛利润率计算:事后毛利润/生产科总价 | ||
106 | + */ | ||
107 | + @ApiModelProperty(value = "事后毛利润") | ||
108 | + private BigDecimal grossProfitRate; | ||
109 | + | ||
110 | + /** | ||
111 | + * 内部生产固定成本 | ||
112 | + */ | ||
113 | + @ApiModelProperty(value = "内部生产固定成本") | ||
114 | + private BigDecimal innerProductionFixedCost; | ||
115 | + | ||
116 | + /** | ||
117 | + * 内部生产提成 | ||
118 | + */ | ||
119 | + @ApiModelProperty(value = "内部生产提成") | ||
120 | + private BigDecimal innerProductionCommission; | ||
121 | + /** | ||
122 | + * 内部生产净利润 | ||
123 | + */ | ||
124 | + @ApiModelProperty(value = "内部生产净利润") | ||
125 | + private BigDecimal innerProductionProfit; | ||
126 | + /** | ||
127 | + * 内部生产净利润率 | ||
128 | + */ | ||
129 | + @ApiModelProperty(value = "内部生产净利润率") | ||
130 | + private BigDecimal innerProductionProfitRate; | ||
131 | + | ||
132 | + /** | ||
133 | + * 项目开始时间 | ||
134 | + */ | ||
135 | + @ApiModelProperty(value = "项目开始时间") | ||
136 | + private LocalDateTime produceStartTime; | ||
137 | + /** | ||
138 | + * 项目结束时间 | ||
139 | + */ | ||
140 | + @ApiModelProperty(value = "项目结束时间") | ||
141 | + private LocalDateTime produceEndTime; | ||
142 | + | ||
143 | + /** | ||
144 | + * 内部生产净利润分析表状态 | ||
145 | + */ | ||
146 | + @ApiModelProperty(value = "内部生产净利润分析表状态") | ||
147 | + private Integer innerProductionStatus; | ||
148 | + | ||
149 | + private ProjectBaseInfoLockFieldVO lockFields; | ||
150 | + | ||
151 | +} | ||
152 | + |
src/main/java/com/order/erp/domain/vo/order/OrderBaseInfoQueryVO.java
@@ -61,6 +61,12 @@ public class OrderBaseInfoQueryVO extends BasePageVO implements Serializable { | @@ -61,6 +61,12 @@ public class OrderBaseInfoQueryVO extends BasePageVO implements Serializable { | ||
61 | private List<String> projectNo; | 61 | private List<String> projectNo; |
62 | 62 | ||
63 | /** | 63 | /** |
64 | + * 项目号右模糊 | ||
65 | + */ | ||
66 | + private String projectNoLikeRight; | ||
67 | + | ||
68 | + | ||
69 | + /** | ||
64 | * 客户编码集合 | 70 | * 客户编码集合 |
65 | */ | 71 | */ |
66 | private List<String> customerCode; | 72 | private List<String> customerCode; |
src/main/java/com/order/erp/domain/vo/order/OrderBaseInfoVO.java
@@ -4,6 +4,7 @@ import lombok.*; | @@ -4,6 +4,7 @@ import lombok.*; | ||
4 | import lombok.experimental.SuperBuilder; | 4 | import lombok.experimental.SuperBuilder; |
5 | 5 | ||
6 | import java.io.Serializable; | 6 | import java.io.Serializable; |
7 | +import java.time.LocalDateTime; | ||
7 | 8 | ||
8 | /** | 9 | /** |
9 | * 订单基础信息表(OrderBaseInfo)实体类 | 10 | * 订单基础信息表(OrderBaseInfo)实体类 |
@@ -26,6 +27,8 @@ public class OrderBaseInfoVO implements Serializable { | @@ -26,6 +27,8 @@ public class OrderBaseInfoVO implements Serializable { | ||
26 | */ | 27 | */ |
27 | private String invoiceNo; | 28 | private String invoiceNo; |
28 | 29 | ||
30 | + private LocalDateTime createTime; | ||
31 | + | ||
29 | /** | 32 | /** |
30 | * 生产科对账单号 如果要在首页添加生产科对账单号列数,就需要在这里加上。 | 33 | * 生产科对账单号 如果要在首页添加生产科对账单号列数,就需要在这里加上。 |
31 | */ | 34 | */ |
src/main/java/com/order/erp/domain/vo/order/OrderCostDetailedOptedLogQueryVO.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 java.io.Serializable; | ||
8 | +import java.util.List; | ||
9 | +@Data | ||
10 | +@AllArgsConstructor | ||
11 | +@ToString | ||
12 | +@NoArgsConstructor | ||
13 | +@EqualsAndHashCode(callSuper = false) | ||
14 | +@SuperBuilder | ||
15 | +public class OrderCostDetailedOptedLogQueryVO extends BasePageVO implements Serializable { | ||
16 | + | ||
17 | + private List<Long> ids; | ||
18 | + | ||
19 | + private Long id; | ||
20 | + | ||
21 | + /** | ||
22 | + * 项目号前缀 | ||
23 | + * */ | ||
24 | + private Long orderId; | ||
25 | + | ||
26 | + /** | ||
27 | + * 业务类型 20:包装费用明细表创建/编辑 40:对应内部生产明细表创建/编辑 | ||
28 | + * */ | ||
29 | + private Integer type; | ||
30 | +} |
src/main/java/com/order/erp/domain/vo/order/OrderCostInfoVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
6 | +import io.swagger.annotations.ApiModel; | ||
7 | +import lombok.AllArgsConstructor; | ||
8 | +import lombok.Data; | ||
9 | +import lombok.EqualsAndHashCode; | ||
10 | +import lombok.NoArgsConstructor; | ||
11 | +import lombok.experimental.SuperBuilder; | ||
12 | + | ||
13 | +import java.io.Serializable; | ||
14 | +import java.math.BigDecimal; | ||
15 | + | ||
16 | +/** | ||
17 | + * <p> | ||
18 | + * | ||
19 | + * </p> | ||
20 | + * | ||
21 | + * @author author | ||
22 | + * @since 2024-12-22 | ||
23 | + */ | ||
24 | +@Data | ||
25 | +@EqualsAndHashCode(callSuper = false) | ||
26 | +@SuperBuilder | ||
27 | +@AllArgsConstructor | ||
28 | +@NoArgsConstructor | ||
29 | +@TableName("order_cost_info") | ||
30 | +@ApiModel(value="OrderCostDetail对象", description="") | ||
31 | +public class OrderCostInfoVO implements Serializable { | ||
32 | + | ||
33 | + private static final long serialVersionUID = 1L; | ||
34 | + | ||
35 | + @TableId(value = "id", type = IdType.AUTO) | ||
36 | + private Long id; | ||
37 | + | ||
38 | + private Long orderId; | ||
39 | + | ||
40 | + private BigDecimal productionDepartmentPredictPrice; | ||
41 | + | ||
42 | + private BigDecimal productionActualPrice; | ||
43 | + | ||
44 | + private BigDecimal packetActualRmbTotalPrice; | ||
45 | + private Integer orderCount; | ||
46 | + //单价 之前前端是传递productionDepartmentPredictPrice,现在改为传递单价,所以传递productionDepartmentPredictUnitPrice。 | ||
47 | + private BigDecimal productionDepartmentPredictUnitPrice; | ||
48 | + | ||
49 | + //内部生产费用明细表状态。 | ||
50 | + private Integer innerProduceStatus; | ||
51 | + //包装费用费用明细表状态。 | ||
52 | + private Integer packStatus; | ||
53 | + | ||
54 | +} |
src/main/java/com/order/erp/domain/vo/order/OrderCostInfolockFieldVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import io.swagger.annotations.ApiModel; | ||
5 | +import lombok.AllArgsConstructor; | ||
6 | +import lombok.Data; | ||
7 | +import lombok.EqualsAndHashCode; | ||
8 | +import lombok.NoArgsConstructor; | ||
9 | +import lombok.experimental.SuperBuilder; | ||
10 | + | ||
11 | +import javax.validation.constraints.NotNull; | ||
12 | +import java.io.Serializable; | ||
13 | + | ||
14 | +/** | ||
15 | + * <p> | ||
16 | + * | ||
17 | + * </p> | ||
18 | + * | ||
19 | + * @author author | ||
20 | + * @since 2024-12-22 | ||
21 | + */ | ||
22 | +@Data | ||
23 | +@EqualsAndHashCode(callSuper = false) | ||
24 | +@SuperBuilder | ||
25 | +@AllArgsConstructor | ||
26 | +@NoArgsConstructor | ||
27 | +@TableName("order_cost_info") | ||
28 | +@ApiModel(value="OrderCostDetail对象", description="") | ||
29 | +public class OrderCostInfolockFieldVO implements Serializable { | ||
30 | + | ||
31 | + private static final long serialVersionUID = 1L; | ||
32 | + | ||
33 | + @NotNull | ||
34 | + private Integer type; | ||
35 | + @NotNull | ||
36 | + private Long orderId; | ||
37 | + | ||
38 | + private String productionDepartmentPredictPrice; | ||
39 | + | ||
40 | + private String productionActualPrice; | ||
41 | + | ||
42 | + private String packetActualRmbTotalPrice; | ||
43 | + /** | ||
44 | + * 生产科预算单价。 | ||
45 | + * */ | ||
46 | + private String productionDepartmentPredictUnitPrice; | ||
47 | + | ||
48 | + private String applyRemark; | ||
49 | +} |
src/main/java/com/order/erp/domain/vo/order/OrderCostOptLogResultVO.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 | +import java.time.LocalDateTime; | ||
8 | +@Data | ||
9 | +@AllArgsConstructor | ||
10 | +@ToString | ||
11 | +@NoArgsConstructor | ||
12 | +@EqualsAndHashCode(callSuper = false) | ||
13 | +@SuperBuilder | ||
14 | +public class OrderCostOptLogResultVO implements Serializable { | ||
15 | + private Long id; | ||
16 | + /** | ||
17 | + * 订单id | ||
18 | + * */ | ||
19 | + private Long orderId; | ||
20 | + /** | ||
21 | + * 用户id | ||
22 | + * */ | ||
23 | + private Long userId; | ||
24 | + /** | ||
25 | + * 用户名称 | ||
26 | + * */ | ||
27 | + private String userName; | ||
28 | + /** | ||
29 | + * 操作类型 | ||
30 | + * */ | ||
31 | + private String optType; | ||
32 | + /** | ||
33 | + * 操作字段 json字符串 | ||
34 | + * */ | ||
35 | + private String fields; | ||
36 | + | ||
37 | + private LocalDateTime createTime; | ||
38 | +} |
src/main/java/com/order/erp/domain/vo/order/OrderFieldLockApplyQueryVO.java
@@ -59,6 +59,11 @@ public class OrderFieldLockApplyQueryVO extends BasePageVO implements Serializab | @@ -59,6 +59,11 @@ public class OrderFieldLockApplyQueryVO extends BasePageVO implements Serializab | ||
59 | private Integer type; | 59 | private Integer type; |
60 | 60 | ||
61 | /** | 61 | /** |
62 | + * 申请类型:枚举类ApplyTypeEnum | ||
63 | + */ | ||
64 | + private List<Integer> typeIn; | ||
65 | + | ||
66 | + /** | ||
62 | * 项目号 | 67 | * 项目号 |
63 | */ | 68 | */ |
64 | private List<String> projectNo; | 69 | private List<String> projectNo; |
src/main/java/com/order/erp/domain/vo/order/OrderInfoResultVO.java
@@ -38,6 +38,10 @@ public class OrderInfoResultVO extends OrderBaseInfoVO implements Serializable { | @@ -38,6 +38,10 @@ public class OrderInfoResultVO extends OrderBaseInfoVO implements Serializable { | ||
38 | * 质检信息 | 38 | * 质检信息 |
39 | */ | 39 | */ |
40 | private OrderInspectionStageVO inspectionStageInfo; | 40 | private OrderInspectionStageVO inspectionStageInfo; |
41 | + /** | ||
42 | + * 费用明细 | ||
43 | + */ | ||
44 | + private OrderCostInfoVO orderCostInfo; | ||
41 | 45 | ||
42 | /** | 46 | /** |
43 | * 字段锁定集合 | 47 | * 字段锁定集合 |
src/main/java/com/order/erp/domain/vo/order/OrderLockFieldVO.java
@@ -46,6 +46,11 @@ public class OrderLockFieldVO implements Serializable { | @@ -46,6 +46,11 @@ public class OrderLockFieldVO implements Serializable { | ||
46 | private OrderInspectionStageFieldVO inspectionStageFields; | 46 | private OrderInspectionStageFieldVO inspectionStageFields; |
47 | 47 | ||
48 | /** | 48 | /** |
49 | + * 费用字段 | ||
50 | + */ | ||
51 | + private OrderCostInfolockFieldVO costInfolockFieldVO; | ||
52 | + | ||
53 | + /** | ||
49 | * 应收款账单字段 | 54 | * 应收款账单字段 |
50 | */ | 55 | */ |
51 | 56 |
src/main/java/com/order/erp/domain/vo/order/OrderProfitAnalysisVO.java
@@ -4,6 +4,7 @@ import lombok.*; | @@ -4,6 +4,7 @@ import lombok.*; | ||
4 | import lombok.experimental.SuperBuilder; | 4 | import lombok.experimental.SuperBuilder; |
5 | 5 | ||
6 | import java.io.Serializable; | 6 | import java.io.Serializable; |
7 | +import java.math.BigDecimal; | ||
7 | 8 | ||
8 | /** | 9 | /** |
9 | * 订单利润分析表(OrderProfitAnalysis)实体类 | 10 | * 订单利润分析表(OrderProfitAnalysis)实体类 |
@@ -34,7 +35,6 @@ public class OrderProfitAnalysisVO implements Serializable { | @@ -34,7 +35,6 @@ public class OrderProfitAnalysisVO implements Serializable { | ||
34 | */ | 35 | */ |
35 | private Double customerTotalPrice; | 36 | private Double customerTotalPrice; |
36 | 37 | ||
37 | - | ||
38 | /** | 38 | /** |
39 | * 客户单价¥ | 39 | * 客户单价¥ |
40 | */ | 40 | */ |
@@ -115,4 +115,6 @@ public class OrderProfitAnalysisVO implements Serializable { | @@ -115,4 +115,6 @@ public class OrderProfitAnalysisVO implements Serializable { | ||
115 | */ | 115 | */ |
116 | private String endCheckResult; | 116 | private String endCheckResult; |
117 | 117 | ||
118 | + | ||
119 | + | ||
118 | } | 120 | } |
src/main/java/com/order/erp/domain/vo/order/OrderProfitQueryVO.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 java.io.Serializable; | ||
8 | +import java.util.List; | ||
9 | +import java.util.Set; | ||
10 | + | ||
11 | +/** | ||
12 | + * 订单基础信息表(OrderBaseInfo)实体类 | ||
13 | + * | ||
14 | + * @author makejava | ||
15 | + * @since 2023-09-08 15:26:43 | ||
16 | + */ | ||
17 | +@Data | ||
18 | +@AllArgsConstructor | ||
19 | +@ToString | ||
20 | +@NoArgsConstructor | ||
21 | +@EqualsAndHashCode(callSuper = false) | ||
22 | +@SuperBuilder | ||
23 | +public class OrderProfitQueryVO extends BasePageVO implements Serializable { | ||
24 | + private static final long serialVersionUID = -84816007994858993L; | ||
25 | + | ||
26 | + private List<Long> ids; | ||
27 | + | ||
28 | + private Set<Long> orderIds; | ||
29 | + | ||
30 | + | ||
31 | + private Long id; | ||
32 | + | ||
33 | + /** | ||
34 | + * 生成开始时间 | ||
35 | + */ | ||
36 | + private String createStartTime; | ||
37 | + | ||
38 | + /** | ||
39 | + * 生成结束时间 | ||
40 | + */ | ||
41 | + private String createEndTime; | ||
42 | + | ||
43 | + /** | ||
44 | + * 单据状态 | ||
45 | + */ | ||
46 | + private List<String> orderStatus; | ||
47 | + | ||
48 | + /** | ||
49 | + * 提交人名称 | ||
50 | + */ | ||
51 | + private String commitUserName; | ||
52 | + | ||
53 | + /** | ||
54 | + * 提交人手机号码 | ||
55 | + */ | ||
56 | + private String commitUserPhone; | ||
57 | + | ||
58 | + /** | ||
59 | + * 项目号 | ||
60 | + */ | ||
61 | + private List<String> projectNo; | ||
62 | + | ||
63 | + /** | ||
64 | + * 客户编码集合 | ||
65 | + */ | ||
66 | + private List<String> customerCode; | ||
67 | + | ||
68 | + /** | ||
69 | + * 客户STYLE# | ||
70 | + */ | ||
71 | + private List<String> customerStyle; | ||
72 | + | ||
73 | + /** | ||
74 | + * 内部编号 | ||
75 | + */ | ||
76 | + private List<String> innerNo; | ||
77 | + | ||
78 | + /** | ||
79 | + * 生产科 | ||
80 | + */ | ||
81 | + private List<String> productionDepartment; | ||
82 | + | ||
83 | + /** | ||
84 | + * 生成科拖货开始时间 | ||
85 | + */ | ||
86 | + private String productionDepartmentConsignStartTime; | ||
87 | + | ||
88 | + /** | ||
89 | + * 生成科拖货结束时间 | ||
90 | + */ | ||
91 | + private String productionDepartmentConsignEndTime; | ||
92 | + | ||
93 | + /** | ||
94 | + * 订单上HOD开始时间 | ||
95 | + */ | ||
96 | + private String orderHodStartTime; | ||
97 | + | ||
98 | + /** | ||
99 | + * 订单上HOD结束时间 | ||
100 | + */ | ||
101 | + private String orderHodEndTime; | ||
102 | + | ||
103 | + /** | ||
104 | + * 最小利润率 | ||
105 | + */ | ||
106 | + private Double profitRateLqt; | ||
107 | + | ||
108 | + /** | ||
109 | + * 最大利润率 | ||
110 | + */ | ||
111 | + private Double profitRateGqt; | ||
112 | + | ||
113 | + /** | ||
114 | + * 想法来源 | ||
115 | + */ | ||
116 | + private List<String> ideaSource; | ||
117 | + | ||
118 | + /** | ||
119 | + * 想法来源占比 | ||
120 | + */ | ||
121 | + private Double ideaSourceRate; | ||
122 | + | ||
123 | + /** | ||
124 | + * 设计师 | ||
125 | + */ | ||
126 | + private String designer; | ||
127 | + | ||
128 | + /** | ||
129 | + * 手工初型1 | ||
130 | + */ | ||
131 | + private List<String> manualPreform1; | ||
132 | + | ||
133 | + /** | ||
134 | + * 手工初型1占比 | ||
135 | + */ | ||
136 | + private Double manualPreform1Rate; | ||
137 | + | ||
138 | + /** | ||
139 | + * 手工初型2 | ||
140 | + */ | ||
141 | + private List<String> manualPreform2; | ||
142 | + | ||
143 | + /** | ||
144 | + * 手工初型2占比 | ||
145 | + */ | ||
146 | + private Double manualPreform2Rate; | ||
147 | + | ||
148 | + /** | ||
149 | + * pp样品确认意见 | ||
150 | + */ | ||
151 | + private List<String> ppConfirmResult; | ||
152 | + | ||
153 | + /** | ||
154 | + * 自测通过开始时间 | ||
155 | + */ | ||
156 | + private String selfTestPassStartTime; | ||
157 | + | ||
158 | + /** | ||
159 | + * 自测通过结束时间 | ||
160 | + */ | ||
161 | + private String selfTestPassEndTime; | ||
162 | + | ||
163 | + /** | ||
164 | + * 中期验货结果PASS / FAIL | ||
165 | + */ | ||
166 | + private List<String> midCheckResult; | ||
167 | + | ||
168 | + /** | ||
169 | + * 尾期验货结果PASS / FAIL | ||
170 | + */ | ||
171 | + private List<String> endCheckResult; | ||
172 | + | ||
173 | + /** | ||
174 | + * 选择的字段 | ||
175 | + */ | ||
176 | + private OrderLockFieldVO fieldVO; | ||
177 | + | ||
178 | + /** | ||
179 | + * 创建人 | ||
180 | + */ | ||
181 | + private String createBy; | ||
182 | + | ||
183 | + /** | ||
184 | + * 业务员 | ||
185 | + */ | ||
186 | + private List<String> businessPerson; | ||
187 | + | ||
188 | + | ||
189 | + private List<Long> exportOrderIds; | ||
190 | + | ||
191 | + /** | ||
192 | + * invoice 首页筛选invoice。 | ||
193 | + */ | ||
194 | + private List<String> invoiceNo; | ||
195 | + | ||
196 | + /** | ||
197 | + * checkNo 首页筛选Check。 | ||
198 | + */ | ||
199 | + private List<String> CheckNo; | ||
200 | + /** | ||
201 | + * invoice invoice状态。 | ||
202 | + */ | ||
203 | + private Long invoiceStatus; | ||
204 | + /** | ||
205 | + * checkNo checkNo状态。 | ||
206 | + */ | ||
207 | + private Long checkNoStatus; | ||
208 | +} | ||
209 | + |
src/main/java/com/order/erp/domain/vo/order/ProjectApplyVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
6 | +import com.order.erp.domain.dto.BaseDO; | ||
7 | +import io.swagger.annotations.ApiModel; | ||
8 | +import io.swagger.annotations.ApiModelProperty; | ||
9 | +import lombok.AllArgsConstructor; | ||
10 | +import lombok.Data; | ||
11 | +import lombok.EqualsAndHashCode; | ||
12 | +import lombok.NoArgsConstructor; | ||
13 | +import lombok.experimental.SuperBuilder; | ||
14 | + | ||
15 | +import java.io.Serializable; | ||
16 | + | ||
17 | +/** | ||
18 | + * <p> | ||
19 | + * 项目-字段锁定申请表 | ||
20 | + * </p> | ||
21 | + * | ||
22 | + * @author author | ||
23 | + * @since 2024-12-22 | ||
24 | + */ | ||
25 | +@Data | ||
26 | +@EqualsAndHashCode(callSuper = false) | ||
27 | +@SuperBuilder | ||
28 | +@AllArgsConstructor | ||
29 | +@NoArgsConstructor | ||
30 | +@TableName("project_apply") | ||
31 | +@ApiModel(value="ProjectApply对象", description="项目-字段锁定申请表") | ||
32 | +public class ProjectApplyVO extends BaseDO implements Serializable { | ||
33 | + | ||
34 | + private static final long serialVersionUID = 1L; | ||
35 | + | ||
36 | + @TableId(value = "id", type = IdType.AUTO) | ||
37 | + private Long id; | ||
38 | + | ||
39 | + @ApiModelProperty(value = "项目id") | ||
40 | + private Long projectId; | ||
41 | + | ||
42 | + @ApiModelProperty(value = "项目号") | ||
43 | + private String projectNoPrefix; | ||
44 | + | ||
45 | + @ApiModelProperty(value = "申请用户id") | ||
46 | + private Long applyUserId; | ||
47 | + | ||
48 | + @ApiModelProperty(value = "审批用户id") | ||
49 | + private Long auditUserId; | ||
50 | + | ||
51 | + @ApiModelProperty(value = "申请类型") | ||
52 | + private String type; | ||
53 | + | ||
54 | + @ApiModelProperty(value = "锁定字段 json字符串") | ||
55 | + private String fields; | ||
56 | + | ||
57 | + @ApiModelProperty(value = "状态:0 待审批,1 通过,2 拒绝") | ||
58 | + private Integer status; | ||
59 | + | ||
60 | + @ApiModelProperty(value = "审核备注") | ||
61 | + private String auditRemark; | ||
62 | + | ||
63 | + @ApiModelProperty(value = "审批角色code集合,分割") | ||
64 | + private String auditRoleCodes; | ||
65 | + | ||
66 | + @ApiModelProperty(value = "申请原因") | ||
67 | + private String applyRemark; | ||
68 | + | ||
69 | + | ||
70 | +} |
src/main/java/com/order/erp/domain/vo/order/ProjectBaseInfoAuditStatus.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import lombok.*; | ||
4 | +import lombok.experimental.SuperBuilder; | ||
5 | + | ||
6 | +@Data | ||
7 | +@AllArgsConstructor | ||
8 | +@ToString | ||
9 | +@NoArgsConstructor | ||
10 | +@EqualsAndHashCode(callSuper = false) | ||
11 | +@SuperBuilder | ||
12 | +public class ProjectBaseInfoAuditStatus { | ||
13 | + /** | ||
14 | + * 设置状态时传递过来的projectNo可能只包含前八位(业务研发净利润分析),或者全部包含(内部生产净利润分析表)。 | ||
15 | + * */ | ||
16 | + private String projectNo; | ||
17 | + | ||
18 | + /** | ||
19 | + * 类型,用来判断是业务研发净利润分析表还是内部生产净利润分析表 | ||
20 | + * */ | ||
21 | + private String type; | ||
22 | + | ||
23 | +} |
src/main/java/com/order/erp/domain/vo/order/ProjectBaseInfoLockFieldVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
6 | +import com.order.erp.domain.dto.BaseDO; | ||
7 | +import io.swagger.annotations.ApiModel; | ||
8 | +import io.swagger.annotations.ApiModelProperty; | ||
9 | +import lombok.AllArgsConstructor; | ||
10 | +import lombok.Data; | ||
11 | +import lombok.EqualsAndHashCode; | ||
12 | +import lombok.NoArgsConstructor; | ||
13 | +import lombok.experimental.Accessors; | ||
14 | +import lombok.experimental.SuperBuilder; | ||
15 | + | ||
16 | +import java.io.Serializable; | ||
17 | +import java.math.BigDecimal; | ||
18 | +import java.time.LocalDateTime; | ||
19 | + | ||
20 | +/** | ||
21 | + * <p> | ||
22 | + * 项目-字段锁定申请表 | ||
23 | + * </p> | ||
24 | + * | ||
25 | + * @author author | ||
26 | + * @since 2024-12-22 | ||
27 | + */ | ||
28 | +@Data | ||
29 | +@EqualsAndHashCode(callSuper = false) | ||
30 | +@SuperBuilder | ||
31 | +@AllArgsConstructor | ||
32 | +@NoArgsConstructor | ||
33 | +@ApiModel(value="ProjectFieldLockApply对象", description="项目-字段锁定申请表") | ||
34 | +public class ProjectBaseInfoLockFieldVO implements Serializable { | ||
35 | + | ||
36 | + | ||
37 | + private Long projectId; | ||
38 | + | ||
39 | + private String projectNoPrefix; | ||
40 | + | ||
41 | + private String applyRemark; | ||
42 | + | ||
43 | + private String developmentCopyRmbTotalPrice; | ||
44 | + | ||
45 | + private String projectStartTime; | ||
46 | + | ||
47 | + private String projectEndTime; | ||
48 | + | ||
49 | + | ||
50 | + private String spainPaidRmbCommission; | ||
51 | + | ||
52 | + private String paidRmbCommission; | ||
53 | + | ||
54 | + private String actualExchangeRate; | ||
55 | + | ||
56 | + private String projectInnerProfitInfoStartTime; | ||
57 | + | ||
58 | + private String projectInnerProfitInfoEndTime; | ||
59 | + | ||
60 | + private String type; | ||
61 | + | ||
62 | +} |
src/main/java/com/order/erp/domain/vo/order/ProjectBaseInfoQueryVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.dto.BaseDO; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +import java.io.Serializable; | ||
8 | +import java.util.List; | ||
9 | +import java.util.Set; | ||
10 | + | ||
11 | +@Data | ||
12 | +@AllArgsConstructor | ||
13 | +@ToString | ||
14 | +@NoArgsConstructor | ||
15 | +@EqualsAndHashCode(callSuper = false) | ||
16 | +@SuperBuilder | ||
17 | +public class ProjectBaseInfoQueryVO extends BaseDO implements Serializable { | ||
18 | + /** | ||
19 | + * 业务研发净利润表以及内部生产明细表,用于条件查询的项目号,需要传递完整的项目号 | ||
20 | + * */ | ||
21 | + private List<String> detailProjectNo; | ||
22 | + | ||
23 | + /** | ||
24 | + * 包装费用明细表以及内部生产明细表,用于条件查询。 | ||
25 | + * */ | ||
26 | + private Set<Long> orderIds; | ||
27 | + | ||
28 | + /** | ||
29 | + * 筛选条件 不传orderId时就传递筛选条件 -客户编码。 | ||
30 | + * */ | ||
31 | + private List<String> customerCode; | ||
32 | + | ||
33 | + /** | ||
34 | + * 筛选条件 不传orderId时就传递筛选条件 -内部编号。 | ||
35 | + * */ | ||
36 | + private List<String> innerNo; | ||
37 | + | ||
38 | + /** | ||
39 | + * 筛选条件 不传orderId时就传递筛选条件 -生产科。 | ||
40 | + * */ | ||
41 | + private List<String> productionDepartment; | ||
42 | + | ||
43 | + /** | ||
44 | + * 筛选条件 不传orderId时就传递筛选条件 -项目号。 | ||
45 | + * */ | ||
46 | + private List<String> projectNo; | ||
47 | + | ||
48 | + /** | ||
49 | + * 业务研发净利润分析选择导出字段 | ||
50 | + * */ | ||
51 | + private ProjectExportSelect projectExportSelect; | ||
52 | + | ||
53 | + /** | ||
54 | + * 内部研发净利润分析选择导出字段 | ||
55 | + * */ | ||
56 | + private InnerProfitInfoExportSelect innerProfitInfoExportSelect; | ||
57 | + | ||
58 | + /** | ||
59 | + * 包装费用明细表选择导出字段 | ||
60 | + * */ | ||
61 | + private BusinessCostExportSelect businessCostExportSelect; | ||
62 | + | ||
63 | + /** | ||
64 | + * 内部生产费用明细表选择导出字段 | ||
65 | + * */ | ||
66 | + private InnerProfitDetailExportSelect innerProfitDetailExportSelect; | ||
67 | + | ||
68 | +} |
src/main/java/com/order/erp/domain/vo/order/ProjectBaseInfoVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
4 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
5 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
6 | +import io.swagger.annotations.ApiModel; | ||
7 | +import lombok.Data; | ||
8 | +import lombok.EqualsAndHashCode; | ||
9 | +import lombok.experimental.Accessors; | ||
10 | + | ||
11 | +import java.io.Serializable; | ||
12 | +import java.math.BigDecimal; | ||
13 | +import java.time.LocalDateTime; | ||
14 | + | ||
15 | +/** | ||
16 | + * <p> | ||
17 | + * | ||
18 | + * </p> | ||
19 | + * | ||
20 | + * @author author | ||
21 | + * @since 2024-12-18 | ||
22 | + */ | ||
23 | +@Data | ||
24 | +@EqualsAndHashCode(callSuper = false) | ||
25 | +@Accessors(chain = true) | ||
26 | +@TableName("project_base_info") | ||
27 | +@ApiModel(value="ProjectBaseInfoDO", description="") | ||
28 | +public class ProjectBaseInfoVO implements Serializable { | ||
29 | + | ||
30 | + private static final long serialVersionUID = 1L; | ||
31 | + | ||
32 | + @TableId(value = "id", type = IdType.AUTO) | ||
33 | + private Long id; | ||
34 | + | ||
35 | + private String projectNoPrefix; | ||
36 | + | ||
37 | + private BigDecimal developmentCopyRmbTotalPrice; | ||
38 | + | ||
39 | + private LocalDateTime projectStartTime; | ||
40 | + | ||
41 | + private LocalDateTime projectEndTime; | ||
42 | + | ||
43 | + private LocalDateTime projectInnerProfitInfoStartTime; | ||
44 | + | ||
45 | + private LocalDateTime projectInnerProfitInfoEndTime; | ||
46 | + | ||
47 | + private BigDecimal spainPaidRmbCommission; | ||
48 | + | ||
49 | + private BigDecimal paidRmbCommission; | ||
50 | + | ||
51 | + private BigDecimal actualExchangeRate; | ||
52 | + | ||
53 | + private String fieldType; | ||
54 | + | ||
55 | + | ||
56 | +} |
src/main/java/com/order/erp/domain/vo/order/ProjectExportSelect.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import io.swagger.annotations.ApiModelProperty; | ||
4 | +import lombok.*; | ||
5 | +import lombok.experimental.SuperBuilder; | ||
6 | + | ||
7 | +@Data | ||
8 | +@AllArgsConstructor | ||
9 | +@ToString | ||
10 | +@NoArgsConstructor | ||
11 | +@EqualsAndHashCode(callSuper = false) | ||
12 | +@SuperBuilder | ||
13 | +public class ProjectExportSelect { | ||
14 | + /** | ||
15 | + * 客户总价¥ | ||
16 | + */ | ||
17 | + @ApiModelProperty(value = "客户总价(人民币)") | ||
18 | + private String customerRmbTotalPrice; | ||
19 | + | ||
20 | + /** | ||
21 | + * 客户总价$ | ||
22 | + */ | ||
23 | + @ApiModelProperty(value = "客户总价") | ||
24 | + private String customerTotalPrice; | ||
25 | + | ||
26 | + /** | ||
27 | + * 生成科总价¥ | ||
28 | + */ | ||
29 | + @ApiModelProperty(value = "生产部门总价") | ||
30 | + private String productionDepartmentTotalPrice; | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + /** | ||
35 | + * 订单数量 | ||
36 | + */ | ||
37 | + @ApiModelProperty(value = "订单数量") | ||
38 | + private String orderCount; | ||
39 | + | ||
40 | + | ||
41 | + /** | ||
42 | + * 包装费用合计$ | ||
43 | + */ | ||
44 | + @ApiModelProperty(value = "包装费用合计(美元)") | ||
45 | + private String packetTotalPrice; | ||
46 | + | ||
47 | + /** | ||
48 | + * 包装费用合计¥ | ||
49 | + */ | ||
50 | + @ApiModelProperty(value = "包装费用合计(人民币)") | ||
51 | + private String packetRmbTotalPrice; | ||
52 | + | ||
53 | + | ||
54 | + /** | ||
55 | + * 包装费用实际金额$ | ||
56 | + */ | ||
57 | + @ApiModelProperty(value = "包装费用实际金额(人民币)") | ||
58 | + private String packetActualRmbPrice; | ||
59 | + | ||
60 | + | ||
61 | + /** | ||
62 | + * 包装费用收益 | ||
63 | + */ | ||
64 | + @ApiModelProperty(value = "包装费用收益(人民币)") | ||
65 | + private String packetProfitRmbPrice; | ||
66 | + | ||
67 | + | ||
68 | + /** | ||
69 | + * 研发复制费合计¥ | ||
70 | + */ | ||
71 | + @ApiModelProperty(value = "研发复制费合计(人民币)") | ||
72 | + private String developmentCopyRmbTotalPrice; | ||
73 | + | ||
74 | + /** | ||
75 | + * 固定成本 | ||
76 | + */ | ||
77 | + @ApiModelProperty(value = "固定成本") | ||
78 | + private String fixedCost; | ||
79 | + | ||
80 | + /** | ||
81 | + * 西班牙已发提成¥ | ||
82 | + */ | ||
83 | + @ApiModelProperty(value = "西班牙已发提成(人民币)") | ||
84 | + private String spainPaidRmbCommission; | ||
85 | + | ||
86 | + /** | ||
87 | + * 西班牙提成¥ | ||
88 | + */ | ||
89 | + @ApiModelProperty(value = "西班牙提成(人民币)") | ||
90 | + private String spainRmbCommission; | ||
91 | + | ||
92 | + /** | ||
93 | + * 西班牙未发提成¥ | ||
94 | + */ | ||
95 | + @ApiModelProperty(value = "西班牙未发提成(人民币)") | ||
96 | + private String spainUnpaidRmbCommission; | ||
97 | + | ||
98 | + /** | ||
99 | + * 已发提成¥ | ||
100 | + */ | ||
101 | + @ApiModelProperty(value = "已发提成(人民币)") | ||
102 | + private String paidRmbCommission; | ||
103 | + | ||
104 | + /** | ||
105 | + * 提成¥ | ||
106 | + */ | ||
107 | + @ApiModelProperty(value = "提成(人民币)") | ||
108 | + private String rmbCommission; | ||
109 | + | ||
110 | + /** | ||
111 | + * 未发提成¥ | ||
112 | + */ | ||
113 | + @ApiModelProperty(value = "未发提成(人民币)") | ||
114 | + private String unpaidRmbCommission; | ||
115 | + | ||
116 | + | ||
117 | + /** | ||
118 | + * 支出合计 | ||
119 | + */ | ||
120 | + @ApiModelProperty(value = "支出合计(人民币)") | ||
121 | + private String rmbTotalExpense; | ||
122 | + | ||
123 | + /** | ||
124 | + * 毛利润 | ||
125 | + */ | ||
126 | + @ApiModelProperty(value = "毛利润") | ||
127 | + private String profit; | ||
128 | + | ||
129 | + /** | ||
130 | + * 毛利率 | ||
131 | + */ | ||
132 | + @ApiModelProperty(value = "毛利率") | ||
133 | + private String profitRate; | ||
134 | + | ||
135 | + /** | ||
136 | + * 研发净利润 | ||
137 | + */ | ||
138 | + @ApiModelProperty(value = "研发净利润") | ||
139 | + private String developmentProfit; | ||
140 | + | ||
141 | + /** | ||
142 | + * 净利润率 | ||
143 | + */ | ||
144 | + @ApiModelProperty(value = "净利润率") | ||
145 | + private String developmentProfitRate; | ||
146 | + | ||
147 | + /** | ||
148 | + * 实际跟单单价 | ||
149 | + */ | ||
150 | + @ApiModelProperty(value = "实际跟单单价(人民币)") | ||
151 | + private String actualOrderRmbPrice; | ||
152 | + | ||
153 | + /** | ||
154 | + * 实际跟单单价$ | ||
155 | + */ | ||
156 | + @ApiModelProperty(value = "实际跟单单价(美元)") | ||
157 | + private String actualOrderPrice; | ||
158 | + | ||
159 | + | ||
160 | + /** | ||
161 | + * 综合收益 | ||
162 | + */ | ||
163 | + @ApiModelProperty(value = "综合收益") | ||
164 | + private String comprehensiveProfit; | ||
165 | + | ||
166 | +} |
src/main/java/com/order/erp/domain/vo/order/ProjectOptLogQueryVO.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 java.io.Serializable; | ||
8 | +import java.util.List; | ||
9 | +@Data | ||
10 | +@AllArgsConstructor | ||
11 | +@ToString | ||
12 | +@NoArgsConstructor | ||
13 | +@EqualsAndHashCode(callSuper = false) | ||
14 | +@SuperBuilder | ||
15 | +public class ProjectOptLogQueryVO extends BasePageVO implements Serializable { | ||
16 | + private static final long serialVersionUID = 1L; | ||
17 | + private List<Long> ids; | ||
18 | + | ||
19 | + private Long id; | ||
20 | + | ||
21 | + /** | ||
22 | + * 项目号前缀 | ||
23 | + * */ | ||
24 | + private String projectNoPrefix; | ||
25 | + | ||
26 | + /** | ||
27 | + * 业务类型 10:对应业务研发净利润创建/编辑 30:对应内部生产净利润创建/编辑 | ||
28 | + * */ | ||
29 | + private Integer type; | ||
30 | +} |
src/main/java/com/order/erp/domain/vo/order/ProjectOptLogResultVO.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 | +import java.time.LocalDateTime; | ||
8 | + | ||
9 | +@Data | ||
10 | +@AllArgsConstructor | ||
11 | +@ToString | ||
12 | +@NoArgsConstructor | ||
13 | +@EqualsAndHashCode(callSuper = false) | ||
14 | +@SuperBuilder | ||
15 | +public class ProjectOptLogResultVO implements Serializable { | ||
16 | + private Long id; | ||
17 | + /** | ||
18 | + * 项目号前缀,前八位或者前十位。 | ||
19 | + */ | ||
20 | + private String projectNoPrefix; | ||
21 | + /** | ||
22 | + * 用户id | ||
23 | + */ | ||
24 | + private Long userId; | ||
25 | + | ||
26 | + /** | ||
27 | + * 用户名称 | ||
28 | + */ | ||
29 | + private String userName; | ||
30 | + /** | ||
31 | + * 操作类型 | ||
32 | + */ | ||
33 | + private String optType; | ||
34 | + /** | ||
35 | + * 操作字段 json字符串 | ||
36 | + */ | ||
37 | + private String fields; | ||
38 | + | ||
39 | + private LocalDateTime createTime; | ||
40 | + | ||
41 | +} |
src/main/java/com/order/erp/domain/vo/order/QueryProjectLockFieldVO.java
0 → 100644
1 | +package com.order.erp.domain.vo.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
4 | +import com.order.erp.domain.vo.BasePageVO; | ||
5 | +import io.swagger.annotations.ApiModel; | ||
6 | +import lombok.AllArgsConstructor; | ||
7 | +import lombok.Data; | ||
8 | +import lombok.EqualsAndHashCode; | ||
9 | +import lombok.NoArgsConstructor; | ||
10 | +import lombok.experimental.SuperBuilder; | ||
11 | + | ||
12 | +import java.io.Serializable; | ||
13 | + | ||
14 | +/** | ||
15 | + * <p> | ||
16 | + * | ||
17 | + * </p> | ||
18 | + * | ||
19 | + * @author author | ||
20 | + * @since 2024-12-22 | ||
21 | + */ | ||
22 | +@Data | ||
23 | +@EqualsAndHashCode(callSuper = false) | ||
24 | +@SuperBuilder | ||
25 | +@AllArgsConstructor | ||
26 | +@NoArgsConstructor | ||
27 | +@TableName("order_cost_info") | ||
28 | +@ApiModel(value="OrderCostDetail对象", description="") | ||
29 | +public class QueryProjectLockFieldVO extends BasePageVO implements Serializable { | ||
30 | + | ||
31 | + private static final long serialVersionUID = 1L; | ||
32 | + | ||
33 | + private Long orderId; | ||
34 | + /** | ||
35 | + * NO_COMMIT(-1, "未提交审核"), | ||
36 | + * | ||
37 | + * WAIT_AUDIT(0, "待审批"), | ||
38 | + * | ||
39 | + * AUDIT_PASS(10, "已通过"), | ||
40 | + * | ||
41 | + * AUDIT_REFUSE(20, "已驳回") | ||
42 | + */ | ||
43 | + private String status; | ||
44 | + | ||
45 | + private String productionDepartmentPredictPrice; | ||
46 | + | ||
47 | + private String productionActualPrice; | ||
48 | + | ||
49 | + private String packetActualRmbTotalPrice; | ||
50 | + | ||
51 | + private Integer type; | ||
52 | + | ||
53 | + | ||
54 | +} |
src/main/java/com/order/erp/mapper/OrderCostFieldLockRecordMapper.java
0 → 100644
1 | +package com.order.erp.mapper; | ||
2 | + | ||
3 | +import com.order.erp.domain.model.OrderCostFieldLockRecord; | ||
4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
5 | + | ||
6 | +/** | ||
7 | + * <p> | ||
8 | + * Mapper 接口 | ||
9 | + * </p> | ||
10 | + * | ||
11 | + * @author author | ||
12 | + * @since 2024-12-22 | ||
13 | + */ | ||
14 | +public interface OrderCostFieldLockRecordMapper extends BaseMapper<OrderCostFieldLockRecord> { | ||
15 | + | ||
16 | +} |
src/main/java/com/order/erp/mapper/ProjectApplyMapper.java
0 → 100644
1 | +package com.order.erp.mapper; | ||
2 | + | ||
3 | +import com.order.erp.domain.model.ProjectApplyDO; | ||
4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
5 | + | ||
6 | +/** | ||
7 | + * <p> | ||
8 | + * 项目-字段锁定申请表 Mapper 接口 | ||
9 | + * </p> | ||
10 | + * | ||
11 | + * @author author | ||
12 | + * @since 2024-12-22 | ||
13 | + */ | ||
14 | +public interface ProjectApplyMapper extends BaseMapper<ProjectApplyDO> { | ||
15 | + | ||
16 | +} |
src/main/java/com/order/erp/mapper/ProjectFieldLockRecordMapper.java
0 → 100644
1 | +package com.order.erp.mapper; | ||
2 | + | ||
3 | +import com.order.erp.domain.model.ProjectFieldLockRecord; | ||
4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
5 | + | ||
6 | +/** | ||
7 | + * <p> | ||
8 | + * 项目-字段锁定记录表 Mapper 接口 | ||
9 | + * </p> | ||
10 | + * | ||
11 | + * @author author | ||
12 | + * @since 2024-12-22 | ||
13 | + */ | ||
14 | +public interface ProjectFieldLockRecordMapper extends BaseMapper<ProjectFieldLockRecord> { | ||
15 | + | ||
16 | +} |
src/main/java/com/order/erp/mapper/order/OrderCostDetailedOptLogMapper.java
0 → 100644
src/main/java/com/order/erp/mapper/order/OrderCostInfoMapper.java
0 → 100644
1 | +package com.order.erp.mapper.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.dto.order.OrderCostInfoDO; | ||
4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
5 | + | ||
6 | +/** | ||
7 | + * <p> | ||
8 | + * Mapper 接口 | ||
9 | + * </p> | ||
10 | + * | ||
11 | + * @author author | ||
12 | + * @since 2024-12-22 | ||
13 | + */ | ||
14 | +public interface OrderCostInfoMapper extends BaseMapper<OrderCostInfoDO> { | ||
15 | + | ||
16 | +} |
src/main/java/com/order/erp/mapper/order/ProjectBaseAfterReviewSettingMapper.java
0 → 100644
src/main/java/com/order/erp/mapper/order/ProjectBaseDevelopOptLogMapper.java
0 → 100644
src/main/java/com/order/erp/mapper/order/ProjectBaseInfoMapper.java
0 → 100644
1 | +package com.order.erp.mapper.order; | ||
2 | + | ||
3 | +import com.order.erp.domain.dto.order.ProjectBaseInfoDO; | ||
4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
5 | + | ||
6 | +/** | ||
7 | + * <p> | ||
8 | + * Mapper 接口 | ||
9 | + * </p> | ||
10 | + * | ||
11 | + * @author author | ||
12 | + * @since 2024-12-18 | ||
13 | + */ | ||
14 | +public interface ProjectBaseInfoMapper extends BaseMapper<ProjectBaseInfoDO> { | ||
15 | + | ||
16 | +} |
src/main/java/com/order/erp/service/IOrderCostFieldLockRecordService.java
0 → 100644
1 | +package com.order.erp.service; | ||
2 | + | ||
3 | +import com.order.erp.domain.model.OrderCostFieldLockRecord; | ||
4 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
5 | + | ||
6 | +/** | ||
7 | + * <p> | ||
8 | + * 服务类 | ||
9 | + * </p> | ||
10 | + * | ||
11 | + * @author author | ||
12 | + * @since 2024-12-22 | ||
13 | + */ | ||
14 | +public interface IOrderCostFieldLockRecordService extends IService<OrderCostFieldLockRecord> { | ||
15 | + | ||
16 | +} |
src/main/java/com/order/erp/service/IProjectApplyService.java
0 → 100644
1 | +package com.order.erp.service; | ||
2 | + | ||
3 | +import com.order.erp.domain.model.ProjectApplyDO; | ||
4 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
5 | + | ||
6 | +/** | ||
7 | + * <p> | ||
8 | + * 项目-字段锁定申请表 服务类 | ||
9 | + * </p> | ||
10 | + * | ||
11 | + * @author author | ||
12 | + * @since 2024-12-22 | ||
13 | + */ | ||
14 | +public interface IProjectApplyService extends IService<ProjectApplyDO> { | ||
15 | + | ||
16 | +} |
src/main/java/com/order/erp/service/IProjectFieldLockRecordService.java
0 → 100644
1 | +package com.order.erp.service; | ||
2 | + | ||
3 | +import com.order.erp.domain.model.ProjectFieldLockRecord; | ||
4 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
5 | + | ||
6 | +/** | ||
7 | + * <p> | ||
8 | + * 项目-字段锁定记录表 服务类 | ||
9 | + * </p> | ||
10 | + * | ||
11 | + * @author author | ||
12 | + * @since 2024-12-22 | ||
13 | + */ | ||
14 | +public interface IProjectFieldLockRecordService extends IService<ProjectFieldLockRecord> { | ||
15 | + | ||
16 | +} |
src/main/java/com/order/erp/service/SystemSettingService.java
@@ -6,6 +6,8 @@ import com.order.erp.domain.dto.SystemSettingDO; | @@ -6,6 +6,8 @@ import com.order.erp.domain.dto.SystemSettingDO; | ||
6 | import com.order.erp.domain.vo.SystemSettingQueryVO; | 6 | import com.order.erp.domain.vo.SystemSettingQueryVO; |
7 | import com.order.erp.domain.vo.SystemSettingVO; | 7 | import com.order.erp.domain.vo.SystemSettingVO; |
8 | 8 | ||
9 | +import java.math.BigDecimal; | ||
10 | + | ||
9 | /** | 11 | /** |
10 | * 系统配置(SystemSetting)表服务接口 | 12 | * 系统配置(SystemSetting)表服务接口 |
11 | * | 13 | * |
@@ -37,6 +39,8 @@ public interface SystemSettingService extends IService<SystemSettingDO> { | @@ -37,6 +39,8 @@ public interface SystemSettingService extends IService<SystemSettingDO> { | ||
37 | */ | 39 | */ |
38 | ServerResult listByPage(SystemSettingQueryVO systemSettingQueryVO); | 40 | ServerResult listByPage(SystemSettingQueryVO systemSettingQueryVO); |
39 | 41 | ||
42 | + BigDecimal getExchangeRate(); | ||
43 | + | ||
40 | /** | 44 | /** |
41 | * 新增数据 | 45 | * 新增数据 |
42 | * | 46 | * |
src/main/java/com/order/erp/service/impl/OrderCostFieldLockRecordServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.impl; | ||
2 | + | ||
3 | +import com.order.erp.domain.model.OrderCostFieldLockRecord; | ||
4 | +import com.order.erp.mapper.OrderCostFieldLockRecordMapper; | ||
5 | +import com.order.erp.service.IOrderCostFieldLockRecordService; | ||
6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
7 | +import org.springframework.stereotype.Service; | ||
8 | + | ||
9 | +/** | ||
10 | + * <p> | ||
11 | + * 服务实现类 | ||
12 | + * </p> | ||
13 | + * | ||
14 | + * @author author | ||
15 | + * @since 2024-12-22 | ||
16 | + */ | ||
17 | +@Service | ||
18 | +public class OrderCostFieldLockRecordServiceImpl extends ServiceImpl<OrderCostFieldLockRecordMapper, OrderCostFieldLockRecord> implements IOrderCostFieldLockRecordService { | ||
19 | + | ||
20 | +} |
src/main/java/com/order/erp/service/impl/ProjectApplyServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.impl; | ||
2 | + | ||
3 | +import com.order.erp.domain.model.ProjectApplyDO; | ||
4 | +import com.order.erp.mapper.ProjectApplyMapper; | ||
5 | +import com.order.erp.service.IProjectApplyService; | ||
6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
7 | +import org.springframework.stereotype.Service; | ||
8 | + | ||
9 | +/** | ||
10 | + * <p> | ||
11 | + * 项目-字段锁定申请表 服务实现类 | ||
12 | + * </p> | ||
13 | + * | ||
14 | + * @author author | ||
15 | + * @since 2024-12-22 | ||
16 | + */ | ||
17 | +@Service | ||
18 | +public class ProjectApplyServiceImpl extends ServiceImpl<ProjectApplyMapper, ProjectApplyDO> implements IProjectApplyService { | ||
19 | + | ||
20 | +} |
src/main/java/com/order/erp/service/impl/ProjectFieldLockRecordServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.impl; | ||
2 | + | ||
3 | +import com.order.erp.domain.model.ProjectFieldLockRecord; | ||
4 | +import com.order.erp.mapper.ProjectFieldLockRecordMapper; | ||
5 | +import com.order.erp.service.IProjectFieldLockRecordService; | ||
6 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
7 | +import org.springframework.stereotype.Service; | ||
8 | + | ||
9 | +/** | ||
10 | + * <p> | ||
11 | + * 项目-字段锁定记录表 服务实现类 | ||
12 | + * </p> | ||
13 | + * | ||
14 | + * @author author | ||
15 | + * @since 2024-12-22 | ||
16 | + */ | ||
17 | +@Service | ||
18 | +public class ProjectFieldLockRecordServiceImpl extends ServiceImpl<ProjectFieldLockRecordMapper, ProjectFieldLockRecord> implements IProjectFieldLockRecordService { | ||
19 | + | ||
20 | +} |
src/main/java/com/order/erp/service/impl/SystemSettingServiceImpl.java
@@ -24,7 +24,9 @@ import com.order.erp.service.SystemSettingService; | @@ -24,7 +24,9 @@ import com.order.erp.service.SystemSettingService; | ||
24 | import lombok.extern.slf4j.Slf4j; | 24 | import lombok.extern.slf4j.Slf4j; |
25 | import org.springframework.beans.BeanUtils; | 25 | import org.springframework.beans.BeanUtils; |
26 | import org.springframework.stereotype.Service; | 26 | import org.springframework.stereotype.Service; |
27 | +import springfox.documentation.annotations.Cacheable; | ||
27 | 28 | ||
29 | +import java.math.BigDecimal; | ||
28 | import java.util.List; | 30 | import java.util.List; |
29 | import java.util.Objects; | 31 | import java.util.Objects; |
30 | import java.util.stream.Collectors; | 32 | import java.util.stream.Collectors; |
@@ -110,6 +112,15 @@ public class SystemSettingServiceImpl extends ServiceImpl<SystemSettingMapper, S | @@ -110,6 +112,15 @@ public class SystemSettingServiceImpl extends ServiceImpl<SystemSettingMapper, S | ||
110 | .eq(StringUtils.isNotBlank(queryVO.getRelationCode()), SystemSettingDO::getRelationCode, queryVO.getRelationCode()); | 112 | .eq(StringUtils.isNotBlank(queryVO.getRelationCode()), SystemSettingDO::getRelationCode, queryVO.getRelationCode()); |
111 | } | 113 | } |
112 | 114 | ||
115 | + @Override | ||
116 | + public BigDecimal getExchangeRate(){ | ||
117 | + SystemSettingDO exchangeRate = this.lambdaQuery() | ||
118 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
119 | + .eq(SystemSettingDO::getSettingCode, "exchangeRate") | ||
120 | + .one(); | ||
121 | + return BigDecimal.valueOf(Double.parseDouble(exchangeRate.getSettingValue())); | ||
122 | + } | ||
123 | + | ||
113 | 124 | ||
114 | /** | 125 | /** |
115 | * 新增数据 | 126 | * 新增数据 |
src/main/java/com/order/erp/service/order/IOrderCostInfoService.java
0 → 100644
1 | +package com.order.erp.service.order; | ||
2 | + | ||
3 | +import com.order.erp.common.constant.ServerResult; | ||
4 | +import com.order.erp.domain.dto.order.OrderCostInfoDO; | ||
5 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
6 | +import com.order.erp.domain.vo.order.OrderBaseInfoQueryVO; | ||
7 | +import com.order.erp.domain.vo.order.OrderCostInfoVO; | ||
8 | +import com.order.erp.domain.vo.order.OrderCostInfolockFieldVO; | ||
9 | +import com.order.erp.domain.vo.order.ProjectBaseInfoQueryVO; | ||
10 | + | ||
11 | +import javax.servlet.http.HttpServletResponse; | ||
12 | +import java.io.IOException; | ||
13 | + | ||
14 | +/** | ||
15 | + * <p> | ||
16 | + * 服务类 | ||
17 | + * </p> | ||
18 | + * | ||
19 | + * @author author | ||
20 | + * @since 2024-12-22 | ||
21 | + */ | ||
22 | +public interface IOrderCostInfoService extends IService<OrderCostInfoDO> { | ||
23 | + | ||
24 | + ServerResult edit(OrderCostInfoVO vo); | ||
25 | + | ||
26 | + ServerResult applyEditFileds(OrderCostInfolockFieldVO vo); | ||
27 | + | ||
28 | + ServerResult listInnerProfitDetailByPage(OrderBaseInfoQueryVO queryVO); | ||
29 | + | ||
30 | + ServerResult listBusinessProfitDetailByPage(OrderBaseInfoQueryVO queryVO); | ||
31 | + void exportBusinessProfitDetailExcel(HttpServletResponse response,ProjectBaseInfoQueryVO queryVO) throws Exception; | ||
32 | + void exportInnerProfitDetailExcel(HttpServletResponse response,ProjectBaseInfoQueryVO queryVO) throws Exception; | ||
33 | + void setPackStatus(OrderCostInfoVO vo); | ||
34 | + void setInnerProduceStatus(OrderCostInfoVO vo); | ||
35 | +} |
src/main/java/com/order/erp/service/order/IProjectBaseInfoService.java
0 → 100644
1 | +package com.order.erp.service.order; | ||
2 | + | ||
3 | +import com.order.erp.common.constant.ServerResult; | ||
4 | +import com.order.erp.domain.dto.order.ProjectBaseInfoDO; | ||
5 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
6 | +import com.order.erp.domain.vo.order.*; | ||
7 | + | ||
8 | +import javax.servlet.http.HttpServletResponse; | ||
9 | +import java.io.IOException; | ||
10 | + | ||
11 | +/** | ||
12 | + * <p> | ||
13 | + * 服务类 | ||
14 | + * </p> | ||
15 | + * | ||
16 | + * @author author | ||
17 | + * @since 2024-12-18 | ||
18 | + */ | ||
19 | +public interface IProjectBaseInfoService extends IService<ProjectBaseInfoDO> { | ||
20 | + | ||
21 | + ServerResult edit(ProjectBaseInfoVO vo); | ||
22 | + | ||
23 | + ServerResult applyEditFileds(ProjectBaseInfoLockFieldVO vo); | ||
24 | + | ||
25 | + ServerResult pageProjectLockFieldApply(QueryProjectLockFieldVO vo); | ||
26 | + | ||
27 | + ServerResult audit(AuditVO vo); | ||
28 | + | ||
29 | + ServerResult listInnerProfitInfoByPage(OrderBaseInfoQueryVO queryVO); | ||
30 | + | ||
31 | + ServerResult listBusinessProfitInfoByPage(OrderBaseInfoQueryVO queryVO); | ||
32 | + | ||
33 | + void exportBusinessProfitInfo(HttpServletResponse response, String projectNoPrefix) throws Exception; | ||
34 | + | ||
35 | + void exportInnerProfitInfo(HttpServletResponse response, String projectNoPrefix) throws Exception; | ||
36 | + void exportBusinessProfitExcel(HttpServletResponse response, ProjectBaseInfoQueryVO queryVO) throws Exception; | ||
37 | + void exportInnerProfitInfoExcel(HttpServletResponse response, ProjectBaseInfoQueryVO queryVO) throws Exception; | ||
38 | + | ||
39 | + void setProjectBaseInfoDevelopmentStatus(OrderBaseInfoVO vo); | ||
40 | + void setInnerProductionStatus(OrderBaseInfoVO vo); | ||
41 | +} |
src/main/java/com/order/erp/service/order/OrderCostDetailedOptLogService.java
0 → 100644
1 | +package com.order.erp.service.order; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | +import com.order.erp.common.constant.ServerResult; | ||
5 | +import com.order.erp.domain.dto.order.OrderCostDetailedOptLogDO; | ||
6 | +import com.order.erp.domain.vo.order.OrderCostDetailedOptedLogQueryVO; | ||
7 | + | ||
8 | + | ||
9 | +public interface OrderCostDetailedOptLogService extends IService<OrderCostDetailedOptLogDO> { | ||
10 | + ServerResult listByPage(OrderCostDetailedOptedLogQueryVO queryVO); | ||
11 | + | ||
12 | +} |
src/main/java/com/order/erp/service/order/OrderProfitAnalysisService.java
@@ -4,11 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService; | @@ -4,11 +4,10 @@ import com.baomidou.mybatisplus.extension.service.IService; | ||
4 | import com.order.erp.common.constant.ServerResult; | 4 | import com.order.erp.common.constant.ServerResult; |
5 | import com.order.erp.domain.dto.order.OrderProfitAnalysisDO; | 5 | import com.order.erp.domain.dto.order.OrderProfitAnalysisDO; |
6 | import com.order.erp.domain.vo.OrderProfitAnalysisVo; | 6 | import com.order.erp.domain.vo.OrderProfitAnalysisVo; |
7 | -import com.order.erp.domain.vo.order.OrderProfitAnalysisQueryVO; | ||
8 | -import com.order.erp.domain.vo.order.OrderProfitAnalysisVO; | ||
9 | -import com.order.erp.domain.vo.order.ProfitCalculateVO; | 7 | +import com.order.erp.domain.vo.order.*; |
10 | 8 | ||
11 | import java.time.LocalDate; | 9 | import java.time.LocalDate; |
10 | +import javax.servlet.http.HttpServletResponse; | ||
12 | import java.util.List; | 11 | import java.util.List; |
13 | 12 | ||
14 | /** | 13 | /** |
src/main/java/com/order/erp/service/order/ProjectBaseAfterReviewSettingService.java
0 → 100644
src/main/java/com/order/erp/service/order/ProjectBaseDevelopOptLogService.java
0 → 100644
1 | +package com.order.erp.service.order; | ||
2 | + | ||
3 | + | ||
4 | +import com.baomidou.mybatisplus.extension.service.IService; | ||
5 | +import com.order.erp.common.constant.ServerResult; | ||
6 | + | ||
7 | +import com.order.erp.domain.dto.order.ProjectBaseDevelopOptLogDO; | ||
8 | +import com.order.erp.domain.vo.order.ProjectOptLogQueryVO; | ||
9 | + | ||
10 | +import java.util.List; | ||
11 | + | ||
12 | +public interface ProjectBaseDevelopOptLogService extends IService<ProjectBaseDevelopOptLogDO> { | ||
13 | + ServerResult listByPage(ProjectOptLogQueryVO queryVO); | ||
14 | +} |
src/main/java/com/order/erp/service/order/impl/CalculateProfitServiceImpl.java
@@ -67,6 +67,10 @@ public class CalculateProfitServiceImpl { | @@ -67,6 +67,10 @@ public class CalculateProfitServiceImpl { | ||
67 | */ | 67 | */ |
68 | public ServerResult businessProfitRatioExport(HttpServletResponse response, BusinessProfitRatioQueryVO queryVO) throws IOException { | 68 | public ServerResult businessProfitRatioExport(HttpServletResponse response, BusinessProfitRatioQueryVO queryVO) throws IOException { |
69 | BusinessProfitRatioResultVO resultVO = buildBusinessProfitRatioResultVO(queryVO); | 69 | BusinessProfitRatioResultVO resultVO = buildBusinessProfitRatioResultVO(queryVO); |
70 | + return writeBusinessProfitRatioResult(response, resultVO); | ||
71 | + } | ||
72 | + | ||
73 | + private ServerResult<Object> writeBusinessProfitRatioResult(HttpServletResponse response, BusinessProfitRatioResultVO resultVO) throws IOException { | ||
70 | //开始 | 74 | //开始 |
71 | Workbook workbook = new XSSFWorkbook(); | 75 | Workbook workbook = new XSSFWorkbook(); |
72 | Sheet sheet = workbook.createSheet("业务净利润分析表"); | 76 | Sheet sheet = workbook.createSheet("业务净利润分析表"); |
@@ -90,7 +94,7 @@ public class CalculateProfitServiceImpl { | @@ -90,7 +94,7 @@ public class CalculateProfitServiceImpl { | ||
90 | 94 | ||
91 | // 第二行 | 95 | // 第二行 |
92 | createMergedCell(sheet, workbook, 4, 0, 4, 5, 0, 1, "项目号"); | 96 | createMergedCell(sheet, workbook, 4, 0, 4, 5, 0, 1, "项目号"); |
93 | - createMergedCell(sheet, workbook, 4, 2, 4, 5, 2, 4, String.join(",",resultVO.getProjectNo())); | 97 | + createMergedCell(sheet, workbook, 4, 2, 4, 5, 2, 4, String.join(",", resultVO.getProjectNo())); |
94 | createMergedCell(sheet, workbook, 4, 5, 4, 5, 5, 6, "开始时间"); | 98 | createMergedCell(sheet, workbook, 4, 5, 4, 5, 5, 6, "开始时间"); |
95 | createMergedCell(sheet, workbook, 4, 7, 4, 5, 7, 9, "结束时间"); | 99 | createMergedCell(sheet, workbook, 4, 7, 4, 5, 7, 9, "结束时间"); |
96 | // 第三行 | 100 | // 第三行 |
@@ -111,55 +115,55 @@ public class CalculateProfitServiceImpl { | @@ -111,55 +115,55 @@ public class CalculateProfitServiceImpl { | ||
111 | createMergedCell(sheet, workbook, 10, 7, 10, 11, 7, 9, "备注"); | 115 | createMergedCell(sheet, workbook, 10, 7, 10, 11, 7, 9, "备注"); |
112 | //第六行 | 116 | //第六行 |
113 | createMergedCell(sheet, workbook, 12, 0, 12, 13, 0, 4, "客户总金额计算"); | 117 | createMergedCell(sheet, workbook, 12, 0, 12, 13, 0, 4, "客户总金额计算"); |
114 | - createMergedCell(sheet, workbook, 12, 5, 12, 13, 5, 6, "¥"+resultVO.getCustomerTotalPrice()); | ||
115 | - createMergedCell(sheet, workbook, 12, 7, 12, 13, 7, 9, "$"+resultVO.getCustomerTotalPriceUsd()); | 118 | + createMergedCell(sheet, workbook, 12, 5, 12, 13, 5, 6, "¥"+ resultVO.getCustomerTotalPrice()); |
119 | + createMergedCell(sheet, workbook, 12, 7, 12, 13, 7, 9, "$"+ resultVO.getCustomerTotalPriceUsd()); | ||
116 | ////第七行 | 120 | ////第七行 |
117 | createMergedCell(sheet, workbook, 14, 0, 14, 15, 0, 4, "生产科总价合计"); | 121 | createMergedCell(sheet, workbook, 14, 0, 14, 15, 0, 4, "生产科总价合计"); |
118 | - createMergedCell(sheet, workbook, 14, 5, 14, 15, 5, 6, "¥"+resultVO.getProductionDepartmentTotalPrice()); | ||
119 | - createMergedCell(sheet, workbook, 14, 7, 14, 15, 7, 9, "$"+resultVO.getProductionDepartmentTotalPriceUsd()); | 122 | + createMergedCell(sheet, workbook, 14, 5, 14, 15, 5, 6, "¥"+ resultVO.getProductionDepartmentTotalPrice()); |
123 | + createMergedCell(sheet, workbook, 14, 7, 14, 15, 7, 9, "$"+ resultVO.getProductionDepartmentTotalPriceUsd()); | ||
120 | ////第八行 | 124 | ////第八行 |
121 | createMergedCell(sheet, workbook, 16, 0, 16, 17, 0, 4, "包装费用合计"); | 125 | createMergedCell(sheet, workbook, 16, 0, 16, 17, 0, 4, "包装费用合计"); |
122 | - createMergedCell(sheet, workbook, 16, 5, 16, 17, 5, 6, "¥"+resultVO.getPacketTotalPrice()); | ||
123 | - createMergedCell(sheet, workbook, 16, 7, 16, 17, 7, 9, "$"+resultVO.getPacketTotalPriceUsd()); | 126 | + createMergedCell(sheet, workbook, 16, 5, 16, 17, 5, 6, "¥"+ resultVO.getPacketTotalPrice()); |
127 | + createMergedCell(sheet, workbook, 16, 7, 16, 17, 7, 9, "$"+ resultVO.getPacketTotalPriceUsd()); | ||
124 | ////第九行 | 128 | ////第九行 |
125 | createMergedCell(sheet, workbook, 18, 0, 18, 19, 0, 4, "研发开发费合计"); | 129 | createMergedCell(sheet, workbook, 18, 0, 18, 19, 0, 4, "研发开发费合计"); |
126 | - createMergedCell(sheet, workbook, 18, 5, 18, 19, 5, 6, "¥"+resultVO.getDevelopTotalPrice().setScale(2, RoundingMode.HALF_UP)); | 130 | + createMergedCell(sheet, workbook, 18, 5, 18, 19, 5, 6, "¥"+ resultVO.getDevelopTotalPrice().setScale(2, RoundingMode.HALF_UP)); |
127 | createMergedCell(sheet, workbook, 18, 7, 18, 19, 7, 9, ""); | 131 | createMergedCell(sheet, workbook, 18, 7, 18, 19, 7, 9, ""); |
128 | ////第十行 | 132 | ////第十行 |
129 | createMergedCell(sheet, workbook, 20, 0, 20, 21, 0, 4, "复制费用合计"); | 133 | createMergedCell(sheet, workbook, 20, 0, 20, 21, 0, 4, "复制费用合计"); |
130 | - createMergedCell(sheet, workbook, 20, 5, 20, 21, 5, 6, "¥"+resultVO.getCopyTotalPrice().setScale(2, RoundingMode.HALF_UP)); | 134 | + createMergedCell(sheet, workbook, 20, 5, 20, 21, 5, 6, "¥"+ resultVO.getCopyTotalPrice().setScale(2, RoundingMode.HALF_UP)); |
131 | createMergedCell(sheet, workbook, 20, 7, 20, 21, 7, 9, ""); | 135 | createMergedCell(sheet, workbook, 20, 7, 20, 21, 7, 9, ""); |
132 | //第十一行 | 136 | //第十一行 |
133 | createMergedCell(sheet, workbook, 22, 0, 22, 23, 0, 4, "固定成本"); | 137 | createMergedCell(sheet, workbook, 22, 0, 22, 23, 0, 4, "固定成本"); |
134 | - createMergedCell(sheet, workbook, 22, 5, 22, 23, 5, 6, "¥"+resultVO.getFixCost()); | 138 | + createMergedCell(sheet, workbook, 22, 5, 22, 23, 5, 6, "¥"+ resultVO.getFixCost()); |
135 | createMergedCell(sheet, workbook, 22, 7, 22, 23, 7, 9, ""); | 139 | createMergedCell(sheet, workbook, 22, 7, 22, 23, 7, 9, ""); |
136 | //第十二行 | 140 | //第十二行 |
137 | createMergedCell(sheet, workbook, 24, 0, 24, 25, 0, 4, "西班牙提成"); | 141 | createMergedCell(sheet, workbook, 24, 0, 24, 25, 0, 4, "西班牙提成"); |
138 | - createMergedCell(sheet, workbook, 24, 5, 24, 25, 5, 6, "¥"+resultVO.getSpainRatioProfitPrice()); | 142 | + createMergedCell(sheet, workbook, 24, 5, 24, 25, 5, 6, "¥"+ resultVO.getSpainRatioProfitPrice()); |
139 | createMergedCell(sheet, workbook, 24, 7, 24, 25, 7, 9, ""); | 143 | createMergedCell(sheet, workbook, 24, 7, 24, 25, 7, 9, ""); |
140 | //第十三行 | 144 | //第十三行 |
141 | createMergedCell(sheet, workbook, 26, 0, 26, 27, 0, 4, "中国团队提成"); | 145 | createMergedCell(sheet, workbook, 26, 0, 26, 27, 0, 4, "中国团队提成"); |
142 | - createMergedCell(sheet, workbook, 26, 5, 26, 27, 5, 6, "¥"+resultVO.getChinaRatioProfitPrice()); | 146 | + createMergedCell(sheet, workbook, 26, 5, 26, 27, 5, 6, "¥"+ resultVO.getChinaRatioProfitPrice()); |
143 | createMergedCell(sheet, workbook, 26, 7, 26, 27, 7, 9, ""); | 147 | createMergedCell(sheet, workbook, 26, 7, 26, 27, 7, 9, ""); |
144 | - //第十四行 | 148 | + //第十四行 |
145 | createMergedCell(sheet, workbook, 28, 0, 28, 29, 0, 4, "支出合计"); | 149 | createMergedCell(sheet, workbook, 28, 0, 28, 29, 0, 4, "支出合计"); |
146 | - createMergedCell(sheet, workbook, 28, 5, 28, 29, 5, 6, "¥"+resultVO.getOutTotalPrice()); | 150 | + createMergedCell(sheet, workbook, 28, 5, 28, 29, 5, 6, "¥"+ resultVO.getOutTotalPrice()); |
147 | createMergedCell(sheet, workbook, 28, 7, 28, 29, 7, 9, ""); | 151 | createMergedCell(sheet, workbook, 28, 7, 28, 29, 7, 9, ""); |
148 | //第十五行 | 152 | //第十五行 |
149 | createMergedCell(sheet, workbook, 30, 0, 30, 31, 0, 4, "毛利润"); | 153 | createMergedCell(sheet, workbook, 30, 0, 30, 31, 0, 4, "毛利润"); |
150 | - createMergedCell(sheet, workbook, 30, 5, 30, 31, 5, 6, "¥"+resultVO.getGrossProfit()); | 154 | + createMergedCell(sheet, workbook, 30, 5, 30, 31, 5, 6, "¥"+ resultVO.getGrossProfit()); |
151 | createMergedCell(sheet, workbook, 30, 7, 30, 31, 7, 9, ""); | 155 | createMergedCell(sheet, workbook, 30, 7, 30, 31, 7, 9, ""); |
152 | ////第十六行 | 156 | ////第十六行 |
153 | createMergedCell(sheet, workbook, 32, 0, 32, 33, 0, 4, "研发贸易净利润"); | 157 | createMergedCell(sheet, workbook, 32, 0, 32, 33, 0, 4, "研发贸易净利润"); |
154 | - createMergedCell(sheet, workbook, 32, 5, 32, 33, 5, 6, "¥"+resultVO.getDevelopProfit()); | 158 | + createMergedCell(sheet, workbook, 32, 5, 32, 33, 5, 6, "¥"+ resultVO.getDevelopProfit()); |
155 | createMergedCell(sheet, workbook, 32, 7, 32, 33, 7, 9, ""); | 159 | createMergedCell(sheet, workbook, 32, 7, 32, 33, 7, 9, ""); |
156 | ////第十七行 | 160 | ////第十七行 |
157 | createMergedCell(sheet, workbook, 34, 0, 34, 35, 0, 4, "包装费用合计金额"); | 161 | createMergedCell(sheet, workbook, 34, 0, 34, 35, 0, 4, "包装费用合计金额"); |
158 | - createMergedCell(sheet, workbook, 34, 5, 34, 35, 5, 6, "¥"+resultVO.getPacketTotalPrice()); | 162 | + createMergedCell(sheet, workbook, 34, 5, 34, 35, 5, 6, "¥"+ resultVO.getPacketTotalPrice()); |
159 | createMergedCell(sheet, workbook, 34, 7, 34, 35, 7, 9, ""); | 163 | createMergedCell(sheet, workbook, 34, 7, 34, 35, 7, 9, ""); |
160 | ////第十八行 | 164 | ////第十八行 |
161 | createMergedCell(sheet, workbook, 36, 0, 36, 37, 0, 4, "包装费用实际金额"); | 165 | createMergedCell(sheet, workbook, 36, 0, 36, 37, 0, 4, "包装费用实际金额"); |
162 | - createMergedCell(sheet, workbook, 36, 5, 36, 37, 5, 6, "¥"+resultVO.getPacketActualTotalPrice().setScale(2, RoundingMode.HALF_UP)); | 166 | + createMergedCell(sheet, workbook, 36, 5, 36, 37, 5, 6, "¥"+ resultVO.getPacketActualTotalPrice().setScale(2, RoundingMode.HALF_UP)); |
163 | createMergedCell(sheet, workbook, 36, 7, 36, 37, 7, 9, ""); | 167 | createMergedCell(sheet, workbook, 36, 7, 36, 37, 7, 9, ""); |
164 | ////第十九行 | 168 | ////第十九行 |
165 | createMergedCell(sheet, workbook, 38, 0, 38, 39, 0, 4, "订单总数量"); | 169 | createMergedCell(sheet, workbook, 38, 0, 38, 39, 0, 4, "订单总数量"); |
@@ -167,27 +171,27 @@ public class CalculateProfitServiceImpl { | @@ -167,27 +171,27 @@ public class CalculateProfitServiceImpl { | ||
167 | createMergedCell(sheet, workbook, 38, 7, 38, 39, 7, 9, ""); | 171 | createMergedCell(sheet, workbook, 38, 7, 38, 39, 7, 9, ""); |
168 | ////第二十行 | 172 | ////第二十行 |
169 | createMergedCell(sheet, workbook, 40, 0, 40, 41, 0, 4, "实际跟单单价=实际跟单费用/件数"); | 173 | createMergedCell(sheet, workbook, 40, 0, 40, 41, 0, 4, "实际跟单单价=实际跟单费用/件数"); |
170 | - createMergedCell(sheet, workbook, 40, 5, 40, 41, 5, 6, "¥"+resultVO.getActualRmbPrice()); | 174 | + createMergedCell(sheet, workbook, 40, 5, 40, 41, 5, 6, "¥"+ resultVO.getActualRmbPrice()); |
171 | createMergedCell(sheet, workbook, 40, 7, 40, 41, 7, 9, ""); | 175 | createMergedCell(sheet, workbook, 40, 7, 40, 41, 7, 9, ""); |
172 | //第二十一行 | 176 | //第二十一行 |
173 | createMergedCell(sheet, workbook, 42, 0, 42, 43, 0, 4, "实际跟单单价折算美金"); | 177 | createMergedCell(sheet, workbook, 42, 0, 42, 43, 0, 4, "实际跟单单价折算美金"); |
174 | - createMergedCell(sheet, workbook, 42, 5, 42, 43, 5, 6, "$"+resultVO.getActualPrice()); | 178 | + createMergedCell(sheet, workbook, 42, 5, 42, 43, 5, 6, "$"+ resultVO.getActualPrice()); |
175 | createMergedCell(sheet, workbook, 42, 7, 42, 43, 7, 9, ""); | 179 | createMergedCell(sheet, workbook, 42, 7, 42, 43, 7, 9, ""); |
176 | //第二十二行 | 180 | //第二十二行 |
177 | createMergedCell(sheet, workbook, 44, 0, 44, 45, 0, 4, "包装费用收益"); | 181 | createMergedCell(sheet, workbook, 44, 0, 44, 45, 0, 4, "包装费用收益"); |
178 | - createMergedCell(sheet, workbook, 44, 5, 44, 45, 5, 6, "¥"+resultVO.getPacketProfitPrice()); | 182 | + createMergedCell(sheet, workbook, 44, 5, 44, 45, 5, 6, "¥"+ resultVO.getPacketProfitPrice()); |
179 | createMergedCell(sheet, workbook, 44, 7, 44, 45, 7, 9, ""); | 183 | createMergedCell(sheet, workbook, 44, 7, 44, 45, 7, 9, ""); |
180 | //第二十三行 | 184 | //第二十三行 |
181 | createMergedCell(sheet, workbook, 46, 0, 46, 47, 0, 4, "实际汇率"); | 185 | createMergedCell(sheet, workbook, 46, 0, 46, 47, 0, 4, "实际汇率"); |
182 | - createMergedCell(sheet, workbook, 46, 5, 46, 47, 5, 6, "¥"+resultVO.getActualRatio().setScale(2, RoundingMode.HALF_UP)); | 186 | + createMergedCell(sheet, workbook, 46, 5, 46, 47, 5, 6, "¥"+ resultVO.getActualRatio().setScale(2, RoundingMode.HALF_UP)); |
183 | createMergedCell(sheet, workbook, 46, 7, 46, 47, 7, 9, ""); | 187 | createMergedCell(sheet, workbook, 46, 7, 46, 47, 7, 9, ""); |
184 | //第二十四行 | 188 | //第二十四行 |
185 | createMergedCell(sheet, workbook, 48, 0, 48, 49, 0, 4, "汇率收益"); | 189 | createMergedCell(sheet, workbook, 48, 0, 48, 49, 0, 4, "汇率收益"); |
186 | - createMergedCell(sheet, workbook, 48, 5, 48, 49, 5, 6, "¥"+resultVO.getActualRatioProfitPrice()); | 190 | + createMergedCell(sheet, workbook, 48, 5, 48, 49, 5, 6, "¥"+ resultVO.getActualRatioProfitPrice()); |
187 | createMergedCell(sheet, workbook, 48, 7, 48, 49, 7, 9, ""); | 191 | createMergedCell(sheet, workbook, 48, 7, 48, 49, 7, 9, ""); |
188 | //第二十五行 | 192 | //第二十五行 |
189 | createMergedCell(sheet, workbook, 50, 0, 50, 51, 0, 4, "综合收益"); | 193 | createMergedCell(sheet, workbook, 50, 0, 50, 51, 0, 4, "综合收益"); |
190 | - createMergedCell(sheet, workbook, 50, 5, 50, 51, 5, 6, "¥"+resultVO.getTotalProfitPrice()); | 194 | + createMergedCell(sheet, workbook, 50, 5, 50, 51, 5, 6, "¥"+ resultVO.getTotalProfitPrice()); |
191 | createMergedCell(sheet, workbook, 50, 7, 50, 51, 7, 9, ""); | 195 | createMergedCell(sheet, workbook, 50, 7, 50, 51, 7, 9, ""); |
192 | response.setHeader("Content-Disposition", "attachment; filename=\"-.xlsx\""); | 196 | response.setHeader("Content-Disposition", "attachment; filename=\"-.xlsx\""); |
193 | workbook.write(response.getOutputStream()); | 197 | workbook.write(response.getOutputStream()); |
@@ -203,6 +207,10 @@ public class CalculateProfitServiceImpl { | @@ -203,6 +207,10 @@ public class CalculateProfitServiceImpl { | ||
203 | */ | 207 | */ |
204 | public ServerResult innerProfitRatioExport(HttpServletResponse response,InnerProfitRatioQueryVO queryVO) throws IOException { | 208 | public ServerResult innerProfitRatioExport(HttpServletResponse response,InnerProfitRatioQueryVO queryVO) throws IOException { |
205 | InnerProfitRatioResultVO resultVO = buildInnerProfitRatioResultVO(queryVO); | 209 | InnerProfitRatioResultVO resultVO = buildInnerProfitRatioResultVO(queryVO); |
210 | + return writeInnerProfitRatioData(response, resultVO); | ||
211 | + } | ||
212 | + | ||
213 | + private ServerResult<Object> writeInnerProfitRatioData(HttpServletResponse response, InnerProfitRatioResultVO resultVO) throws IOException { | ||
206 | Workbook workbook = new XSSFWorkbook(); | 214 | Workbook workbook = new XSSFWorkbook(); |
207 | Sheet sheet = workbook.createSheet("内部生产净利润分析表"); | 215 | Sheet sheet = workbook.createSheet("内部生产净利润分析表"); |
208 | Row row = sheet.createRow(0); | 216 | Row row = sheet.createRow(0); |
@@ -270,7 +278,7 @@ public class CalculateProfitServiceImpl { | @@ -270,7 +278,7 @@ public class CalculateProfitServiceImpl { | ||
270 | createMergedCell(sheet, workbook, 20, 4, 20, 21, 4, 5, "¥"+ resultVO.getInnerProduceTotalPrice()); | 278 | createMergedCell(sheet, workbook, 20, 4, 20, 21, 4, 5, "¥"+ resultVO.getInnerProduceTotalPrice()); |
271 | createMergedCell(sheet, workbook, 20, 6, 20, 21, 6, 7, ""); | 279 | createMergedCell(sheet, workbook, 20, 6, 20, 21, 6, 7, ""); |
272 | createMergedCell(sheet, workbook, 20, 8, 20, 21, 8, 10, ""); | 280 | createMergedCell(sheet, workbook, 20, 8, 20, 21, 8, 10, ""); |
273 | - //第十一行 | 281 | + //第十一行 |
274 | createMergedCell(sheet, workbook, 22, 0, 22, 23, 0, 3, "内部生产净利润"); | 282 | createMergedCell(sheet, workbook, 22, 0, 22, 23, 0, 3, "内部生产净利润"); |
275 | createMergedCell(sheet, workbook, 22, 4, 22, 23, 4, 5, "¥"+ resultVO.getInnerProduceTotalProfit()); | 283 | createMergedCell(sheet, workbook, 22, 4, 22, 23, 4, 5, "¥"+ resultVO.getInnerProduceTotalProfit()); |
276 | createMergedCell(sheet, workbook, 22, 6, 22, 23, 6, 7, ""); | 284 | createMergedCell(sheet, workbook, 22, 6, 22, 23, 6, 7, ""); |
@@ -281,6 +289,7 @@ public class CalculateProfitServiceImpl { | @@ -281,6 +289,7 @@ public class CalculateProfitServiceImpl { | ||
281 | workbook.close(); | 289 | workbook.close(); |
282 | return ServerResult.success(); | 290 | return ServerResult.success(); |
283 | } | 291 | } |
292 | + | ||
284 | public void createMergedCell(Sheet sheet, Workbook workbook, int rowIndex, int colIndex, int startRow, int endRow, int startCol, int endCol, String value) { | 293 | public void createMergedCell(Sheet sheet, Workbook workbook, int rowIndex, int colIndex, int startRow, int endRow, int startCol, int endCol, String value) { |
285 | // 创建或获取当前行 | 294 | // 创建或获取当前行 |
286 | Row row = sheet.getRow(rowIndex); | 295 | Row row = sheet.getRow(rowIndex); |
src/main/java/com/order/erp/service/order/impl/OrderBaseInfoServiceImpl.java
@@ -35,22 +35,19 @@ import com.order.erp.domain.excel.AccountStatementExcelVO; | @@ -35,22 +35,19 @@ import com.order.erp.domain.excel.AccountStatementExcelVO; | ||
35 | import com.order.erp.domain.vo.AccountStatementVO; | 35 | import com.order.erp.domain.vo.AccountStatementVO; |
36 | import com.order.erp.domain.vo.ProducePdfVO; | 36 | import com.order.erp.domain.vo.ProducePdfVO; |
37 | import com.order.erp.domain.vo.order.*; | 37 | import com.order.erp.domain.vo.order.*; |
38 | -import com.order.erp.job.OrderOverTimeEventJob; | ||
39 | import com.order.erp.mapper.order.OrderBaseInfoMapper; | 38 | import com.order.erp.mapper.order.OrderBaseInfoMapper; |
40 | import com.order.erp.service.SystemSettingService; | 39 | import com.order.erp.service.SystemSettingService; |
41 | import com.order.erp.service.admin.AdminUserRoleService; | 40 | import com.order.erp.service.admin.AdminUserRoleService; |
42 | import com.order.erp.service.admin.AdminUserService; | 41 | import com.order.erp.service.admin.AdminUserService; |
43 | import com.order.erp.service.order.*; | 42 | import com.order.erp.service.order.*; |
44 | -import freemarker.template.TemplateException; | ||
45 | import lombok.extern.slf4j.Slf4j; | 43 | import lombok.extern.slf4j.Slf4j; |
46 | -import org.joda.time.DateTime; | ||
47 | import org.springframework.beans.BeanUtils; | 44 | import org.springframework.beans.BeanUtils; |
45 | +import org.springframework.beans.factory.annotation.Autowired; | ||
48 | import org.springframework.beans.factory.annotation.Value; | 46 | import org.springframework.beans.factory.annotation.Value; |
49 | import org.springframework.stereotype.Service; | 47 | import org.springframework.stereotype.Service; |
50 | import org.springframework.transaction.annotation.Transactional; | 48 | import org.springframework.transaction.annotation.Transactional; |
51 | 49 | ||
52 | import javax.annotation.Resource; | 50 | import javax.annotation.Resource; |
53 | -import javax.mail.MessagingException; | ||
54 | import javax.servlet.http.HttpServletResponse; | 51 | import javax.servlet.http.HttpServletResponse; |
55 | import java.io.*; | 52 | import java.io.*; |
56 | import java.math.BigDecimal; | 53 | import java.math.BigDecimal; |
@@ -150,6 +147,8 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | @@ -150,6 +147,8 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | ||
150 | 147 | ||
151 | @Resource | 148 | @Resource |
152 | private ProducePaymentCheckBillOrderService producePaymentCheckBillOrderService; | 149 | private ProducePaymentCheckBillOrderService producePaymentCheckBillOrderService; |
150 | + @Autowired | ||
151 | + private IOrderCostInfoService orderCostInfoService; | ||
153 | 152 | ||
154 | @Resource | 153 | @Resource |
155 | private OrderTrackStageService orderTrackStageService; | 154 | private OrderTrackStageService orderTrackStageService; |
@@ -267,6 +266,8 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | @@ -267,6 +266,8 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | ||
267 | 266 | ||
268 | // 填充发票信息 对于填充发票信息和填充生产科对账单号,其实不需要在这里写了,而且这里只是填充了invoice号和check号,这里的代码是填充数据,达到一个进度条的效果,既然没有根据是否填充发票来填充进度条,这里就不需要写。 | 267 | // 填充发票信息 对于填充发票信息和填充生产科对账单号,其实不需要在这里写了,而且这里只是填充了invoice号和check号,这里的代码是填充数据,达到一个进度条的效果,既然没有根据是否填充发票来填充进度条,这里就不需要写。 |
269 | // fillInvoiceNo(resultVOList); | 268 | // fillInvoiceNo(resultVOList); |
269 | + | ||
270 | + fillOrderCostDetils(resultVOList); | ||
270 | //第四版 start | 271 | //第四版 start |
271 | /* //需要填充生产科对账单号信息 | 272 | /* //需要填充生产科对账单号信息 |
272 | fillCheckNo(resultVOList); | 273 | fillCheckNo(resultVOList); |
@@ -287,6 +288,29 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | @@ -287,6 +288,29 @@ public class OrderBaseInfoServiceImpl extends ServiceImpl<OrderBaseInfoMapper, O | ||
287 | return resultVOList; | 288 | return resultVOList; |
288 | } | 289 | } |
289 | 290 | ||
291 | + private void fillOrderCostDetils(List<OrderInfoResultVO> resultVOList) { | ||
292 | + if (CollectionUtils.isEmpty(resultVOList)) { | ||
293 | + return; | ||
294 | + } | ||
295 | + | ||
296 | + Set<Long> orderIds = resultVOList.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); | ||
297 | + List<OrderCostInfoDO> orderCostInfoDOS = orderCostInfoService.lambdaQuery() | ||
298 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
299 | + .in(OrderCostInfoDO::getOrderId, orderIds) | ||
300 | + .list(); | ||
301 | + | ||
302 | + if (CollectionUtils.isNotEmpty(orderCostInfoDOS)) { | ||
303 | + Map<Long, OrderCostInfoDO> orderCostDetailDOMap = orderCostInfoDOS.stream().collect(Collectors.toMap(OrderCostInfoDO::getOrderId, Function.identity(), (v1, v2) -> v1)); | ||
304 | + resultVOList.forEach(result -> { | ||
305 | + if (orderCostDetailDOMap.containsKey(result.getId())) { | ||
306 | + OrderCostInfoDO orderCostInfoDO = orderCostDetailDOMap.get(result.getId()); | ||
307 | + OrderCostInfoVO orderCostInfoVO = BeanUtil.copyProperties(orderCostInfoDO, OrderCostInfoVO.class); | ||
308 | + result.setOrderCostInfo(orderCostInfoVO); | ||
309 | + } | ||
310 | + }); | ||
311 | + } | ||
312 | + } | ||
313 | + | ||
290 | @Override | 314 | @Override |
291 | public void export(HttpServletResponse response, OrderBaseInfoQueryVO queryVO) throws IOException, Excel4JException { | 315 | public void export(HttpServletResponse response, OrderBaseInfoQueryVO queryVO) throws IOException, Excel4JException { |
292 | OrderLockFieldVO lockFieldVO = queryVO.getFieldVO(); | 316 | OrderLockFieldVO lockFieldVO = queryVO.getFieldVO(); |
@@ -1585,6 +1609,8 @@ end | @@ -1585,6 +1609,8 @@ end | ||
1585 | .in(CollectionUtils.isNotEmpty(queryVO.getCheckNo()),OrderBaseInfoDO::getCheckNo,queryVO.getCheckNo()) | 1609 | .in(CollectionUtils.isNotEmpty(queryVO.getCheckNo()),OrderBaseInfoDO::getCheckNo,queryVO.getCheckNo()) |
1586 | .eq(Objects.nonNull(queryVO.getInvoiceStatus()), OrderBaseInfoDO::getInvoiceStatus, queryVO.getInvoiceStatus()) | 1610 | .eq(Objects.nonNull(queryVO.getInvoiceStatus()), OrderBaseInfoDO::getInvoiceStatus, queryVO.getInvoiceStatus()) |
1587 | .eq(Objects.nonNull(queryVO.getCheckNoStatus()), OrderBaseInfoDO::getCheckStatus, queryVO.getCheckNoStatus()) | 1611 | .eq(Objects.nonNull(queryVO.getCheckNoStatus()), OrderBaseInfoDO::getCheckStatus, queryVO.getCheckNoStatus()) |
1612 | + .in(CollUtil.isNotEmpty(queryVO.getIds()), OrderBaseInfoDO::getId, queryVO.getIds()) | ||
1613 | + .likeRight(StringUtils.isNotBlank(queryVO.getProjectNoLikeRight()), OrderBaseInfoDO::getProjectNo, queryVO.getProjectNoLikeRight()) | ||
1588 | .orderByDesc(OrderBaseInfoDO::getId) | 1614 | .orderByDesc(OrderBaseInfoDO::getId) |
1589 | ; | 1615 | ; |
1590 | } | 1616 | } |
src/main/java/com/order/erp/service/order/impl/OrderCostDetailedOptLogServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
5 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
7 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
8 | +import com.order.erp.common.constant.Constant; | ||
9 | +import com.order.erp.common.constant.ServerResult; | ||
10 | +import com.order.erp.domain.dto.BaseDO; | ||
11 | +import com.order.erp.domain.dto.admin.AdminUserDO; | ||
12 | +import com.order.erp.domain.dto.order.OrderCostDetailedOptLogDO; | ||
13 | +import com.order.erp.domain.dto.order.ProjectBaseDevelopOptLogDO; | ||
14 | +import com.order.erp.domain.vo.order.OrderCostDetailedOptedLogQueryVO; | ||
15 | +import com.order.erp.domain.vo.order.OrderCostOptLogResultVO; | ||
16 | +import com.order.erp.domain.vo.order.ProjectOptLogQueryVO; | ||
17 | +import com.order.erp.domain.vo.order.ProjectOptLogResultVO; | ||
18 | +import com.order.erp.mapper.order.OrderCostDetailedOptLogMapper; | ||
19 | +import com.order.erp.service.admin.AdminUserService; | ||
20 | +import com.order.erp.service.order.OrderCostDetailedOptLogService; | ||
21 | +import org.springframework.beans.BeanUtils; | ||
22 | +import org.springframework.stereotype.Service; | ||
23 | + | ||
24 | +import javax.annotation.Resource; | ||
25 | +import java.util.*; | ||
26 | +import java.util.function.Function; | ||
27 | +import java.util.stream.Collectors; | ||
28 | + | ||
29 | +@Service | ||
30 | +public class OrderCostDetailedOptLogServiceImpl extends ServiceImpl<OrderCostDetailedOptLogMapper, OrderCostDetailedOptLogDO> implements OrderCostDetailedOptLogService{ | ||
31 | + @Resource | ||
32 | + private AdminUserService userService; | ||
33 | + | ||
34 | + @Override | ||
35 | + public ServerResult listByPage(OrderCostDetailedOptedLogQueryVO queryVO) { | ||
36 | + LambdaQueryWrapper<OrderCostDetailedOptLogDO> queryWrapper = buildQueryByParam(queryVO); | ||
37 | + Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize()); | ||
38 | + IPage<OrderCostDetailedOptLogDO> iPage = page(page, queryWrapper); | ||
39 | + | ||
40 | + Page<OrderCostOptLogResultVO> webVOPage = new Page<>(); | ||
41 | + List<OrderCostDetailedOptLogDO> OrderCostDetailedOptLogDOS = iPage.getRecords(); | ||
42 | + if (CollectionUtils.isNotEmpty(OrderCostDetailedOptLogDOS)) { | ||
43 | + Set<Long> userIds = OrderCostDetailedOptLogDOS.stream().map(OrderCostDetailedOptLogDO::getUserId).collect(Collectors.toSet()); | ||
44 | + Map<Long, AdminUserDO> userDOMap = new HashMap<>(); | ||
45 | + if (CollectionUtils.isNotEmpty(userIds)) { | ||
46 | + List<AdminUserDO> userDOS = userService.listByIds(userIds); | ||
47 | + if (CollectionUtils.isNotEmpty(userDOS)) { | ||
48 | + userDOMap = userDOS.stream().collect(Collectors.toMap(AdminUserDO::getId, Function.identity())); | ||
49 | + } | ||
50 | + } | ||
51 | + Map<Long, AdminUserDO> finalUserDOMap = userDOMap; | ||
52 | + List<OrderCostOptLogResultVO> resultVOList = OrderCostDetailedOptLogDOS.stream().map(x -> { | ||
53 | + OrderCostOptLogResultVO resultVO = new OrderCostOptLogResultVO(); | ||
54 | + BeanUtils.copyProperties(x, resultVO); | ||
55 | + if (finalUserDOMap.containsKey(x.getUserId())) { | ||
56 | + resultVO.setUserName(finalUserDOMap.get(x.getUserId()).getUserName()); | ||
57 | + } | ||
58 | + return resultVO; | ||
59 | + }).collect(Collectors.toList()); | ||
60 | + | ||
61 | + webVOPage.setRecords(resultVOList); | ||
62 | + } | ||
63 | + BeanUtils.copyProperties(page, webVOPage, "records"); | ||
64 | + return ServerResult.success(webVOPage); | ||
65 | + } | ||
66 | + | ||
67 | + private LambdaQueryWrapper<OrderCostDetailedOptLogDO> buildQueryByParam(OrderCostDetailedOptedLogQueryVO queryVO) { | ||
68 | + return new LambdaQueryWrapper<OrderCostDetailedOptLogDO>() | ||
69 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
70 | + .eq(Objects.nonNull(queryVO.getOrderId()), OrderCostDetailedOptLogDO::getOrderId, queryVO.getOrderId()) | ||
71 | + .eq(Objects.nonNull(queryVO.getType()), OrderCostDetailedOptLogDO::getType, queryVO.getType()) | ||
72 | + .orderByDesc(OrderCostDetailedOptLogDO::getId); | ||
73 | + } | ||
74 | + | ||
75 | + | ||
76 | +} |
src/main/java/com/order/erp/service/order/impl/OrderCostInfoServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | ||
2 | + | ||
3 | +import cn.hutool.core.bean.BeanUtil; | ||
4 | +import cn.hutool.core.bean.copier.CopyOptions; | ||
5 | +import cn.hutool.core.collection.CollUtil; | ||
6 | +import com.alibaba.fastjson.JSONObject; | ||
7 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
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; | ||
11 | +import com.fasterxml.jackson.core.JsonProcessingException; | ||
12 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
13 | +import com.github.stupdit1t.excel.common.PoiWorkbookType; | ||
14 | +import com.github.stupdit1t.excel.core.ExcelHelper; | ||
15 | +import com.github.stupdit1t.excel.style.CellPosition; | ||
16 | +import com.order.erp.common.constant.Constant; | ||
17 | +import com.order.erp.common.constant.ServerResult; | ||
18 | +import com.order.erp.common.constant.ServerResultCode; | ||
19 | +import com.order.erp.common.exception.BusinessException; | ||
20 | +import com.order.erp.config.DataScope; | ||
21 | +import com.order.erp.domain.*; | ||
22 | +import com.order.erp.domain.dto.BaseDO; | ||
23 | +import com.order.erp.domain.dto.order.OrderBaseInfoDO; | ||
24 | +import com.order.erp.domain.dto.order.OrderCostDetailedOptLogDO; | ||
25 | +import com.order.erp.domain.dto.order.OrderCostInfoDO; | ||
26 | +import com.order.erp.domain.dto.order.OrderFieldLockApplyDO; | ||
27 | +import com.order.erp.domain.model.OrderCostFieldLockRecord; | ||
28 | +import com.order.erp.domain.vo.order.*; | ||
29 | +import com.order.erp.mapper.order.OrderCostInfoMapper; | ||
30 | +import com.order.erp.service.IOrderCostFieldLockRecordService; | ||
31 | +import com.order.erp.service.SystemSettingService; | ||
32 | +import com.order.erp.service.order.*; | ||
33 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
34 | +import org.springframework.beans.BeanUtils; | ||
35 | +import org.springframework.beans.factory.annotation.Autowired; | ||
36 | +import org.springframework.stereotype.Service; | ||
37 | +import org.springframework.transaction.annotation.Transactional; | ||
38 | + | ||
39 | +import javax.annotation.Resource; | ||
40 | +import javax.servlet.http.HttpServletResponse; | ||
41 | +import java.io.IOException; | ||
42 | +import java.math.BigDecimal; | ||
43 | +import java.math.RoundingMode; | ||
44 | +import java.util.*; | ||
45 | +import java.util.stream.Collectors; | ||
46 | + | ||
47 | +/** | ||
48 | + * <p> | ||
49 | + * 服务实现类 | ||
50 | + * </p> | ||
51 | + * | ||
52 | + * @author author | ||
53 | + * @since 2024-12-22 | ||
54 | + */ | ||
55 | +@Service | ||
56 | +public class OrderCostInfoServiceImpl extends ServiceImpl<OrderCostInfoMapper, OrderCostInfoDO> implements IOrderCostInfoService { | ||
57 | + @Autowired | ||
58 | + private DataScope dataScope; | ||
59 | + @Resource | ||
60 | + private OrderFieldLockApplyService orderFieldLockApplyService; | ||
61 | + @Autowired | ||
62 | + private OrderBaseInfoService orderBaseInfoService; | ||
63 | + @Autowired | ||
64 | + private IOrderCostFieldLockRecordService orderCostFieldLockRecordService; | ||
65 | + @Autowired | ||
66 | + private SystemSettingService systemSettingService; | ||
67 | + @Autowired | ||
68 | + private OrderCostDetailedOptLogService orderCostDetailedOptLogService; | ||
69 | + | ||
70 | + @Override | ||
71 | + @Transactional(rollbackFor = Exception.class) | ||
72 | + public ServerResult edit(OrderCostInfoVO vo) { | ||
73 | + Integer type=null; | ||
74 | + String operationDesc=null; | ||
75 | + Long id = vo.getOrderId(); | ||
76 | + Optional<OrderCostInfoDO> orderCostInfoDOOpt = this.lambdaQuery() | ||
77 | + .eq(OrderCostInfoDO::getOrderId, id) | ||
78 | + .last(" limit 1 ") | ||
79 | + .oneOpt(); | ||
80 | + OrderCostInfoDO orderCostInfoDO = null; | ||
81 | + OrderCostInfoDO oldOrderCostInfoDO = null; | ||
82 | + boolean isUpdate = orderCostInfoDOOpt.isPresent(); | ||
83 | + if (!isUpdate) { | ||
84 | + //对象不存在。 | ||
85 | + orderCostInfoDO = BeanUtil.copyProperties(vo, OrderCostInfoDO.class); | ||
86 | + } else { | ||
87 | + orderCostInfoDO = orderCostInfoDOOpt.get(); | ||
88 | + oldOrderCostInfoDO = BeanUtil.copyProperties(orderCostInfoDO, OrderCostInfoDO.class,"id","orderId","createTime","createBy","modifyTime","modifyBy","enableFlag"); | ||
89 | + BeanUtil.copyProperties(vo, orderCostInfoDO, CopyOptions.create().ignoreNullValue()); | ||
90 | + } | ||
91 | + // 如果对于新旧数据一致时,则不会进行状态设置。 但是对于第一次创建数据应该怎么办呢? 通过isUpdate来进行判断。 对象不存在时,就不需要判断数据是否一致,对象存在时,就需要进行判断数据是否一致。如果一致,则不要进行状态设置,反之则需要进行状态设置。 | ||
92 | + | ||
93 | + Optional<OrderCostFieldLockRecord> orderCostFieldLockRecordOpt = orderCostFieldLockRecordService | ||
94 | + .lambdaQuery() | ||
95 | + .eq(OrderCostFieldLockRecord::getOrderId, id) | ||
96 | + .last(" limit 1 ") | ||
97 | + .oneOpt(); | ||
98 | + OrderCostFieldLockRecord orderCostFieldLockRecord = orderCostFieldLockRecordOpt.orElse( | ||
99 | + OrderCostFieldLockRecord.builder() | ||
100 | + .orderId(id) | ||
101 | + .userId(dataScope.getLoginUserId()) | ||
102 | + .build() | ||
103 | + ); | ||
104 | + OrderCostInfolockFieldVO originOrderCostInfolockFieldVO = JSONObject.parseObject(Optional.ofNullable(orderCostFieldLockRecord.getFields()).orElse("{}"), OrderCostInfolockFieldVO.class); | ||
105 | + if(Objects.nonNull(vo.getPacketActualRmbTotalPrice())){ | ||
106 | + originOrderCostInfolockFieldVO.setPacketActualRmbTotalPrice(OrderLockFieldEnum.LOCKED.name()); | ||
107 | + type=ProjectOptTypeEnum.PACKAGING_COST_TYPE.getType(); | ||
108 | + operationDesc = isUpdate | ||
109 | + ? OrderOptTypeEnum.PROJECT_COST_EDIT.getDesc() | ||
110 | + : OrderOptTypeEnum.PROJECT_COST_ADD.getDesc(); | ||
111 | + //编辑包装费用实际金额之后状态为待审核 | ||
112 | + /*需要考虑一个问题,假如状态为已通过,但是没有进行任何的修改而点击了确认,那么它的状态会由已审核变为待审核,所以需要进行判断一下,此次传递来的数据是否与上一次的数据一致,如果不一致则需要进行状态设置*/ | ||
113 | + if(isUpdate && ProfitStatusEnum.APPROVED.getStatus().equals(oldOrderCostInfoDO.getPackStatus()) | ||
114 | + && oldOrderCostInfoDO.getPacketActualRmbTotalPrice().compareTo(vo.getPacketActualRmbTotalPrice()) == 0){ | ||
115 | + }else{ | ||
116 | + orderCostInfoDO.setPackStatus(ProfitStatusEnum.PENDING_APPROVAL.getStatus()); | ||
117 | + } | ||
118 | + }else if(Objects.nonNull(vo.getProductionActualPrice())||Objects.nonNull(vo.getProductionDepartmentPredictUnitPrice())) { | ||
119 | + //todo 以前是直接填写总价,现在是填写单价,然后乘以数量自动计算总价,需要前端传递一个数量参数过来。 | ||
120 | + vo.setProductionDepartmentPredictPrice(vo.getProductionDepartmentPredictUnitPrice().multiply(BigDecimal.valueOf(vo.getOrderCount()))); | ||
121 | + orderCostInfoDO.setProductionDepartmentPredictPrice(vo.getProductionDepartmentPredictPrice()); | ||
122 | + originOrderCostInfolockFieldVO.setProductionActualPrice(OrderLockFieldEnum.LOCKED.name()); | ||
123 | + originOrderCostInfolockFieldVO.setProductionDepartmentPredictPrice(OrderLockFieldEnum.LOCKED.name()); | ||
124 | + type=ProjectOptTypeEnum.INTERNAL_PRODUCE_DETAILS_TYPE.getType(); | ||
125 | + operationDesc = isUpdate | ||
126 | + ? OrderOptTypeEnum.PROJECT_INNER_PRODUCE_PROFIT_EDIT.getDesc() | ||
127 | + : OrderOptTypeEnum.PROJECT_INNER_PRODUCE_PROFIT_ADD.getDesc(); | ||
128 | + //编辑生产科预算金额和实际发生费用之后状态为待审核 | ||
129 | + /*也需要考虑问题,假如状态为已通过,但是没有进行任何修改二点击了确认,那么它的状态会由已审核变为待审核*/ | ||
130 | + if(isUpdate && ProfitStatusEnum.APPROVED.getStatus().equals(oldOrderCostInfoDO.getInnerProduceStatus()) && | ||
131 | + oldOrderCostInfoDO.getProductionActualPrice().compareTo(vo.getProductionActualPrice()) ==0 && | ||
132 | + //前端传递的是单价和数量,但是后端只是保存了总价,所以需要进行判断一下,此次传递来的数据和上一次的数据是否一致,如果不一致则需要进行状态设置 | ||
133 | + oldOrderCostInfoDO.getProductionDepartmentPredictPrice().compareTo(vo.getProductionDepartmentPredictUnitPrice().multiply(BigDecimal.valueOf(vo.getOrderCount()))) ==0){ | ||
134 | + }else{ | ||
135 | + orderCostInfoDO.setInnerProduceStatus(ProfitStatusEnum.PENDING_APPROVAL.getStatus()); | ||
136 | + } | ||
137 | + } | ||
138 | + orderCostFieldLockRecord.setFields(JSONObject.toJSONString(originOrderCostInfolockFieldVO)); | ||
139 | + orderCostFieldLockRecordService.saveOrUpdate(orderCostFieldLockRecord); | ||
140 | + this.saveOrUpdate(orderCostInfoDO); | ||
141 | + //进行日志记录。 | ||
142 | + OrderCostInfoVO orderCostInfoVO = buildOrderConstInfoVO(vo, id); | ||
143 | + OrderCostDetailedOptLogDO orderConstOptLogDo = buildOrderConstOptLogDo(id, dataScope.getLoginUserId(),type ,operationDesc,JSONObject.toJSONString(orderCostInfoVO)); | ||
144 | + return ServerResult.success(orderCostDetailedOptLogService.save(orderConstOptLogDo)); | ||
145 | + } | ||
146 | + | ||
147 | + @Override | ||
148 | + public ServerResult applyEditFileds(OrderCostInfolockFieldVO vo) { | ||
149 | + Integer applyType=null; | ||
150 | + List<OrderFieldLockApplyDO> applyDOS = orderFieldLockApplyService.list(new LambdaQueryWrapper<OrderFieldLockApplyDO>() | ||
151 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
152 | + .eq(OrderFieldLockApplyDO::getOrderId, vo.getOrderId()) | ||
153 | + .eq(OrderFieldLockApplyDO::getApplyUserId, dataScope.getLoginUserId()) | ||
154 | + .eq(OrderFieldLockApplyDO::getType, vo.getType()) | ||
155 | + .eq(OrderFieldLockApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus())); | ||
156 | + if (CollectionUtils.isNotEmpty(applyDOS)) { | ||
157 | + throw new BusinessException(ServerResultCode.APPLY_UNLOCK_FIELD_EXIST); | ||
158 | + } | ||
159 | + OrderCostInfolockFieldVO lockField = OrderCostInfolockFieldVO.builder() | ||
160 | + .packetActualRmbTotalPrice(vo.getPacketActualRmbTotalPrice()) | ||
161 | + .productionActualPrice(vo.getProductionActualPrice()) | ||
162 | + .productionDepartmentPredictPrice(vo.getProductionDepartmentPredictPrice()) | ||
163 | + .productionDepartmentPredictUnitPrice(vo.getProductionDepartmentPredictUnitPrice()) | ||
164 | + .build(); | ||
165 | + OrderFieldLockApplyDO build = OrderFieldLockApplyDO.builder() | ||
166 | + .orderId(vo.getOrderId()) | ||
167 | + .applyUserId(dataScope.getLoginUserId()) | ||
168 | + .applyRemark(vo.getApplyRemark()) | ||
169 | + .fields(JSONObject.toJSONString(lockField)) | ||
170 | + .status(ApplyStatusEnum.WAIT_AUDIT.getStatus()) | ||
171 | + .type(vo.getType()) | ||
172 | + .remark(OrderCostApplyTpeEnum.getNameByType(vo.getType())) | ||
173 | + .build(); | ||
174 | + orderFieldLockApplyService.save(build); | ||
175 | + //进行审批记录的保存。需要前端在申请字段申请时传递这条数据的id。 | ||
176 | + if(OrderCostApplyTpeEnum.ORDER_PRODUCTION_COST_FIELD_EDIT_APPLY.getType().equals(vo.getType())){ | ||
177 | + applyType=OrderCostApplyTpeEnum.ORDER_PRODUCTION_COST_FIELD_EDIT_APPLY.getType(); | ||
178 | + }else{ | ||
179 | + applyType=OrderCostApplyTpeEnum.ORDER_PACKET_COST_FIELD_EDIT_APPLY.getType(); | ||
180 | + } | ||
181 | + orderCostDetailedOptLogService.save(buildOrderConstOptLogDo(vo.getOrderId(), dataScope.getLoginUserId(),applyType,OrderCostApplyTpeEnum.getNameByType(applyType),JSONObject.toJSONString(lockField))); | ||
182 | + return ServerResult.success(); | ||
183 | + } | ||
184 | + | ||
185 | + @Override | ||
186 | + public ServerResult<Page<InnerProfitDetailVO>> listInnerProfitDetailByPage(OrderBaseInfoQueryVO queryVO) { | ||
187 | + ServerResult serverResult = orderBaseInfoService.listByPage(queryVO); | ||
188 | + Page<OrderInfoResultVO> page = (Page<OrderInfoResultVO>) serverResult.getData(); | ||
189 | + List<OrderInfoResultVO> records = page.getRecords(); | ||
190 | + List<OrderCostFieldLockRecord> lockRecords = orderCostFieldLockRecordService | ||
191 | + .lambdaQuery() | ||
192 | + .func(query -> { | ||
193 | + Set<Long> collect = records.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); | ||
194 | + if (CollUtil.isNotEmpty(collect)) { | ||
195 | + query.in(OrderCostFieldLockRecord::getOrderId, collect); | ||
196 | + | ||
197 | + } else { | ||
198 | + query.apply("1!=1"); | ||
199 | + } | ||
200 | + }) | ||
201 | + .list(); | ||
202 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
203 | + Map<Long, OrderCostInfolockFieldVO> orderId2fieldMapMap = lockRecords.stream().collect(Collectors.toMap(OrderCostFieldLockRecord::getOrderId, record -> { | ||
204 | + try { | ||
205 | + return objectMapper.readValue(record.getFields(), OrderCostInfolockFieldVO.class); | ||
206 | + } catch (JsonProcessingException e) { | ||
207 | + throw new RuntimeException(e); | ||
208 | + } | ||
209 | + })); | ||
210 | + List<InnerProfitDetailVO> innerProfitRatioResultVOs = records.stream().map(record -> { | ||
211 | + OrderCostInfoVO orderCostInfo = record.getOrderCostInfo(); | ||
212 | + OrderCostInfolockFieldVO lockFields = Optional.ofNullable(orderId2fieldMapMap.get(record.getId())) | ||
213 | + .orElse(new OrderCostInfolockFieldVO() | ||
214 | + ); | ||
215 | + if(Objects.isNull(lockFields.getPacketActualRmbTotalPrice())){ | ||
216 | + lockFields.setPacketActualRmbTotalPrice(Objects.isNull(orderCostInfo) || Objects.isNull(orderCostInfo.getPacketActualRmbTotalPrice()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); | ||
217 | + } | ||
218 | + if(Objects.isNull(lockFields.getProductionActualPrice())){ | ||
219 | + lockFields.setProductionActualPrice(Objects.isNull(orderCostInfo) || Objects.isNull(orderCostInfo.getProductionActualPrice()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); | ||
220 | + } | ||
221 | + if(Objects.isNull(lockFields.getProductionDepartmentPredictPrice())){ | ||
222 | + lockFields.setProductionDepartmentPredictPrice(Objects.isNull(orderCostInfo) || Objects.isNull(orderCostInfo.getProductionDepartmentPredictPrice()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); | ||
223 | + } | ||
224 | + if(Objects.isNull(lockFields.getProductionDepartmentPredictUnitPrice())){ | ||
225 | + lockFields.setProductionDepartmentPredictUnitPrice(Objects.isNull(orderCostInfo) || Objects.isNull(orderCostInfo.getProductionDepartmentPredictUnitPrice()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); | ||
226 | + } | ||
227 | + InnerProfitDetailVO vo = InnerProfitDetailVO.builder() | ||
228 | + .orderId(record.getId()) | ||
229 | + .customerCode(record.getCustomerCode()) | ||
230 | + .projectNo(record.getProjectNo()) | ||
231 | + .productionDepartment(record.getProductionDepartment()) | ||
232 | + .innerNo(record.getInnerNo()) | ||
233 | + .picUrl(record.getPicUrl()) | ||
234 | + .orderCount(record.getOrderCount()) | ||
235 | + .productionDepartmentPrice(Objects.isNull(record.getProfitAnalysisInfo()) ? null : record.getProfitAnalysisInfo().getProductionDepartmentPrice()) | ||
236 | + .productionDepartmentTotalPrice(Objects.isNull(record.getProfitAnalysisInfo()) ? null : record.getProfitAnalysisInfo().getProductionDepartmentTotalPrice()) | ||
237 | + .productionDepartmentPredictPrice(Objects.isNull(record.getOrderCostInfo()) ? null : record.getOrderCostInfo().getProductionDepartmentPredictPrice()) | ||
238 | + .productionActualPrice(Objects.isNull(record.getOrderCostInfo()) ? null : record.getOrderCostInfo().getProductionActualPrice()) | ||
239 | + .innerProduceStatus((Objects.isNull(record.getOrderCostInfo()) || Objects.isNull(record.getOrderCostInfo().getInnerProduceStatus())) ? ProfitStatusEnum.Not_COMPLETED.getStatus() : record.getOrderCostInfo().getInnerProduceStatus()) | ||
240 | + .lockFields(lockFields) | ||
241 | + .build(); | ||
242 | + | ||
243 | + if (Objects.nonNull(vo.getProductionDepartmentPredictPrice()) | ||
244 | + && Objects.nonNull(vo.getProductionActualPrice()) | ||
245 | + && vo.getProductionDepartmentPredictPrice().compareTo(BigDecimal.ZERO) != 0) { | ||
246 | + //预算占比=实际发生费用/预算金额 | ||
247 | + vo.setPredictRatio(vo.getProductionActualPrice().divide(vo.getProductionDepartmentPredictPrice(), 4, RoundingMode.HALF_UP)); | ||
248 | + //预算占比与实际比占比差:1-预算占比 | ||
249 | + vo.setPredictAndActualRatio(new BigDecimal(1).subtract(vo.getPredictRatio())); | ||
250 | + } | ||
251 | + if (Objects.nonNull(vo.getProductionDepartmentTotalPrice()) | ||
252 | + && Objects.nonNull(vo.getProductionDepartmentPredictPrice())) { | ||
253 | + //事前毛利润=生产总额-预算金额 | ||
254 | + vo.setBeforeGrossProfit(BigDecimal.valueOf(vo.getProductionDepartmentTotalPrice()).subtract(vo.getProductionDepartmentPredictPrice())); | ||
255 | + if (Objects.nonNull(vo.getProductionDepartmentTotalPrice()) | ||
256 | + && vo.getProductionDepartmentTotalPrice().compareTo(0.0) != 0) { | ||
257 | + //事前毛利润率=事前毛利润/生产总额 | ||
258 | + vo.setBeforeGrossProfitRate(vo.getBeforeGrossProfit().divide(BigDecimal.valueOf(vo.getProductionDepartmentTotalPrice()), 4, RoundingMode.HALF_UP)); | ||
259 | + } | ||
260 | + } | ||
261 | + if (Objects.nonNull(vo.getProductionDepartmentTotalPrice()) | ||
262 | + && Objects.nonNull(vo.getProductionActualPrice())) { | ||
263 | + //事后毛利润=实际发生费用-生产总额 | ||
264 | + vo.setGrossProfit(BigDecimal.valueOf(vo.getProductionDepartmentTotalPrice()).subtract(vo.getProductionActualPrice())); | ||
265 | + if (Objects.nonNull(vo.getProductionDepartmentTotalPrice()) | ||
266 | + && vo.getProductionDepartmentTotalPrice().compareTo(0.0) != 0) { | ||
267 | + //事后毛利润率=事后毛利润/生产总额 | ||
268 | + vo.setGrossProfitRate(vo.getGrossProfit().divide(BigDecimal.valueOf(vo.getProductionDepartmentTotalPrice()), 4, RoundingMode.HALF_UP)); | ||
269 | + } | ||
270 | + } | ||
271 | + if(Objects.nonNull(vo.getProductionDepartmentPredictPrice())){ | ||
272 | + vo.setProductionDepartmentPredictUnitprice(vo.getProductionDepartmentPredictPrice().divide(BigDecimal.valueOf(record.getOrderCount()), 2, RoundingMode.HALF_UP)); | ||
273 | + } | ||
274 | + return vo; | ||
275 | + }).collect(Collectors.toList()); | ||
276 | + Page<InnerProfitDetailVO> webVOPage = new Page<>(); | ||
277 | + webVOPage.setRecords(innerProfitRatioResultVOs); | ||
278 | + BeanUtils.copyProperties(page, webVOPage, "records"); | ||
279 | + return ServerResult.success(webVOPage); | ||
280 | + } | ||
281 | + | ||
282 | + | ||
283 | + @Override | ||
284 | + public ServerResult<Page<BusinessProfitDetailVO>> listBusinessProfitDetailByPage(OrderBaseInfoQueryVO queryVO) { | ||
285 | + ServerResult serverResult = orderBaseInfoService.listByPage(queryVO); | ||
286 | + Page<OrderInfoResultVO> page = (Page<OrderInfoResultVO>) serverResult.getData(); | ||
287 | + List<OrderInfoResultVO> records = page.getRecords(); | ||
288 | + List<OrderCostFieldLockRecord> lockRecords = orderCostFieldLockRecordService | ||
289 | + .lambdaQuery() | ||
290 | + .func(query -> { | ||
291 | + Set<Long> collect = records.stream().map(OrderInfoResultVO::getId).collect(Collectors.toSet()); | ||
292 | + if (CollUtil.isNotEmpty(collect)) { | ||
293 | + query.in(OrderCostFieldLockRecord::getOrderId, collect); | ||
294 | + | ||
295 | + } else { | ||
296 | + query.apply("1!=1"); | ||
297 | + } | ||
298 | + }) | ||
299 | + .list(); | ||
300 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
301 | + Map<Long, OrderCostInfolockFieldVO> orderId2fieldMapMap = lockRecords.stream().collect(Collectors.toMap(OrderCostFieldLockRecord::getOrderId, record -> { | ||
302 | + try { | ||
303 | + return objectMapper.readValue(record.getFields(), OrderCostInfolockFieldVO.class); | ||
304 | + } catch (JsonProcessingException e) { | ||
305 | + throw new RuntimeException(e); | ||
306 | + } | ||
307 | + })); | ||
308 | + BigDecimal exchangeRate = systemSettingService.getExchangeRate(); | ||
309 | + | ||
310 | + List<BusinessProfitDetailVO> innerProfitRatioResultVOs = records.stream().map(record -> { | ||
311 | + OrderCostInfoVO orderCostInfo = record.getOrderCostInfo(); | ||
312 | + OrderCostInfolockFieldVO lockFields = Optional.ofNullable(orderId2fieldMapMap.get(record.getId())).orElse( | ||
313 | + new OrderCostInfolockFieldVO() | ||
314 | + ); | ||
315 | + if(Objects.isNull(lockFields.getPacketActualRmbTotalPrice())){ | ||
316 | + lockFields.setPacketActualRmbTotalPrice(Objects.isNull(orderCostInfo) || Objects.isNull(orderCostInfo.getPacketActualRmbTotalPrice()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); | ||
317 | + } | ||
318 | + if(Objects.isNull(lockFields.getProductionActualPrice())){ | ||
319 | + lockFields.setProductionActualPrice(Objects.isNull(orderCostInfo) || Objects.isNull(orderCostInfo.getProductionActualPrice()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); | ||
320 | + } | ||
321 | + if(Objects.isNull(lockFields.getProductionDepartmentPredictPrice())){ | ||
322 | + lockFields.setProductionDepartmentPredictPrice(Objects.isNull(orderCostInfo) || Objects.isNull(orderCostInfo.getProductionDepartmentPredictPrice()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); | ||
323 | + } | ||
324 | + BusinessProfitDetailVO vo = BusinessProfitDetailVO.builder() | ||
325 | + .orderId(record.getId()) | ||
326 | + .customerCode(record.getCustomerCode()) | ||
327 | + .projectNo(record.getProjectNo()) | ||
328 | + .productionDepartment(record.getProductionDepartment()) | ||
329 | + .innerNo(record.getInnerNo()) | ||
330 | + .picUrl(record.getPicUrl()) | ||
331 | + .orderCount(record.getOrderCount()) | ||
332 | + .packetPrice(Objects.isNull(record.getProfitAnalysisInfo()) ? null : record.getProfitAnalysisInfo().getPacketPrice()) | ||
333 | + .packetTotalPrice(Objects.isNull(record.getProfitAnalysisInfo()) ? null : record.getProfitAnalysisInfo().getPacketTotalPrice()) | ||
334 | + .packetActualRmbTotalPrice(Objects.isNull(record.getOrderCostInfo()) ? null : record.getOrderCostInfo().getPacketActualRmbTotalPrice()) | ||
335 | + .packStatus((Objects.isNull(record.getOrderCostInfo()) || Objects.isNull(record.getOrderCostInfo().getPackStatus())) ? ProfitStatusEnum.Not_COMPLETED.getStatus() : record.getOrderCostInfo().getPackStatus()) | ||
336 | + .lockFields(lockFields) | ||
337 | + .build(); | ||
338 | + if (Objects.nonNull(vo.getPacketTotalPrice())) { | ||
339 | + //包装费用合计 = 包装费合计*汇率 | ||
340 | + vo.setPacketRmbTotalPrice(BigDecimal.valueOf(vo.getPacketTotalPrice()).multiply(exchangeRate.setScale(4, RoundingMode.HALF_UP)).doubleValue()); | ||
341 | + } | ||
342 | + if (Objects.nonNull(vo.getPacketActualRmbTotalPrice()) && Objects.nonNull(vo.getOrderCount())) { | ||
343 | + //实际跟单单价 = 包装费用实际金额/数量 | ||
344 | + vo.setPacketActualRmbPrice(vo.getPacketActualRmbTotalPrice().divide(BigDecimal.valueOf(vo.getOrderCount()), 4, RoundingMode.HALF_UP)); | ||
345 | + //实际跟单单价折算美金$ = 人民币单价/汇率 | ||
346 | + vo.setPacketActualPrice(vo.getPacketActualRmbPrice().divide(exchangeRate, 4, RoundingMode.HALF_UP)); | ||
347 | + } | ||
348 | + if (Objects.nonNull(vo.getPacketRmbTotalPrice()) && Objects.nonNull(vo.getPacketActualRmbPrice())) { | ||
349 | + //包装费用收益¥ = 包装费用合计-包装费用实际金额 | ||
350 | + vo.setPacketProfitRmbPrice(BigDecimal.valueOf(vo.getPacketRmbTotalPrice()).subtract(vo.getPacketActualRmbTotalPrice())); | ||
351 | + } | ||
352 | + if (Objects.nonNull(vo.getPacketProfitRmbPrice()) && Objects.nonNull(vo.getPacketRmbTotalPrice())) { | ||
353 | + //包装费用净利润率 = 包装费用收益/包装费用合计 | ||
354 | + vo.setPacketProfitRate(vo.getPacketProfitRmbPrice().divide(BigDecimal.valueOf(vo.getPacketRmbTotalPrice()), 4, RoundingMode.HALF_UP)); | ||
355 | + } | ||
356 | + return vo; | ||
357 | + }).collect(Collectors.toList()); | ||
358 | + Page<BusinessProfitDetailVO> webVOPage = new Page<>(); | ||
359 | + webVOPage.setRecords(innerProfitRatioResultVOs); | ||
360 | + BeanUtils.copyProperties(page, webVOPage, "records"); | ||
361 | + return ServerResult.success(webVOPage); | ||
362 | + } | ||
363 | + | ||
364 | + @Override | ||
365 | + public void exportBusinessProfitDetailExcel(HttpServletResponse response,ProjectBaseInfoQueryVO queryVO) throws Exception { | ||
366 | + if(CollectionUtils.isEmpty(queryVO.getOrderIds()) && | ||
367 | + CollectionUtils.isEmpty(queryVO.getProjectNo()) && | ||
368 | + CollectionUtils.isEmpty(queryVO.getCustomerCode()) && | ||
369 | + CollectionUtils.isEmpty(queryVO.getInnerNo()) && | ||
370 | + CollectionUtils.isEmpty(queryVO.getProductionDepartment())){ | ||
371 | + throw new BusinessException(ServerResultCode.PARAM_ERROR); | ||
372 | + } | ||
373 | + OrderBaseInfoQueryVO.OrderBaseInfoQueryVOBuilder builder = OrderBaseInfoQueryVO.builder() | ||
374 | + .page(1) | ||
375 | + .pageSize(200); // 设置大一点,确保导出数据不遗漏 | ||
376 | + | ||
377 | + // 根据传入条件设置筛选字段 | ||
378 | + if (CollectionUtils.isNotEmpty(queryVO.getOrderIds())) { | ||
379 | + builder.orderIds(queryVO.getOrderIds()); | ||
380 | + } else { | ||
381 | + //如果orderIds为空就代表传递的是筛选条件。 | ||
382 | + if (CollectionUtils.isNotEmpty(queryVO.getProjectNo())) { | ||
383 | + builder.projectNo(queryVO.getProjectNo()); | ||
384 | + } | ||
385 | + if (CollectionUtils.isNotEmpty(queryVO.getCustomerCode())) { | ||
386 | + builder.customerCode(queryVO.getCustomerCode()); | ||
387 | + } | ||
388 | + if (CollectionUtils.isNotEmpty(queryVO.getProductionDepartment())) { | ||
389 | + builder.productionDepartment(queryVO.getProductionDepartment()); | ||
390 | + } | ||
391 | + if (CollectionUtils.isNotEmpty(queryVO.getInnerNo())) { | ||
392 | + builder.innerNo(queryVO.getInnerNo()); | ||
393 | + } | ||
394 | + } | ||
395 | + ServerResult serverResult = listBusinessProfitDetailByPage(builder.build()); | ||
396 | + Page<BusinessProfitDetailVO> page = (Page<BusinessProfitDetailVO>) serverResult.getData(); | ||
397 | + List<BusinessProfitDetailVO> businessProfitDetailVOS = page.getRecords(); | ||
398 | + System.out.println("订单数量:"+businessProfitDetailVOS.size()); | ||
399 | + if(CollectionUtils.isNotEmpty(businessProfitDetailVOS)){ | ||
400 | + List<Map<String, Object>> list = buildBusinessProfitExportExcel(businessProfitDetailVOS, queryVO); | ||
401 | + if(CollectionUtils.isNotEmpty(list)){ | ||
402 | + List<String> keys = new ArrayList<>(list.get(Constant.ZERO).keySet()); | ||
403 | + ExcelHelper.opsExport(PoiWorkbookType.XLSX) | ||
404 | + .opsSheet(list) | ||
405 | + .opsHeader().simple().texts(keys).done() | ||
406 | + .opsColumn().fields(keys).done() | ||
407 | + .height(CellPosition.CELL, 750) | ||
408 | + .done() | ||
409 | + .export(response.getOutputStream()); | ||
410 | + System.out.println("导出成功"); | ||
411 | + } | ||
412 | + } | ||
413 | + System.out.println(businessProfitDetailVOS); | ||
414 | + } | ||
415 | + | ||
416 | + @Override | ||
417 | + public void exportInnerProfitDetailExcel(HttpServletResponse response, ProjectBaseInfoQueryVO queryVO) throws Exception { | ||
418 | + if(CollectionUtils.isEmpty(queryVO.getOrderIds()) && | ||
419 | + CollectionUtils.isEmpty(queryVO.getProjectNo()) && | ||
420 | + CollectionUtils.isEmpty(queryVO.getCustomerCode()) && | ||
421 | + CollectionUtils.isEmpty(queryVO.getInnerNo()) && | ||
422 | + CollectionUtils.isEmpty(queryVO.getProductionDepartment())){ | ||
423 | + throw new BusinessException(ServerResultCode.PARAM_ERROR); | ||
424 | + } | ||
425 | + OrderBaseInfoQueryVO.OrderBaseInfoQueryVOBuilder builder = OrderBaseInfoQueryVO.builder() | ||
426 | + .page(1) | ||
427 | + .pageSize(200); //设置大一点,确保导出数据不遗漏 | ||
428 | + if(CollectionUtils.isNotEmpty(queryVO.getOrderIds())){ | ||
429 | + builder.orderIds(queryVO.getOrderIds()); | ||
430 | + }else{ | ||
431 | + //如果orderIds为空就代表传递的是筛选条件。 | ||
432 | + if(CollectionUtils.isNotEmpty(queryVO.getProjectNo())){ | ||
433 | + builder.projectNo(queryVO.getProjectNo()); | ||
434 | + } | ||
435 | + if(CollectionUtils.isNotEmpty(queryVO.getCustomerCode())){ | ||
436 | + builder.customerCode(queryVO.getCustomerCode()); | ||
437 | + } | ||
438 | + if(CollectionUtils.isNotEmpty(queryVO.getProductionDepartment())){ | ||
439 | + builder.productionDepartment(queryVO.getProductionDepartment()); | ||
440 | + } | ||
441 | + if(CollectionUtils.isNotEmpty(queryVO.getInnerNo())){ | ||
442 | + builder.innerNo(queryVO.getInnerNo()); | ||
443 | + } | ||
444 | + } | ||
445 | + //这里设置为100是故意设置大一点,防止导出多条数据。 | ||
446 | + ServerResult<Page<InnerProfitDetailVO>> serverResult= listInnerProfitDetailByPage(builder.build()); | ||
447 | + Page<InnerProfitDetailVO> page=(Page<InnerProfitDetailVO>) serverResult.getData(); | ||
448 | + List<InnerProfitDetailVO> innerProfitDetailVOS = page.getRecords(); | ||
449 | + System.out.println("订单数量"+innerProfitDetailVOS.size()); | ||
450 | + if(CollectionUtils.isNotEmpty(innerProfitDetailVOS)){ | ||
451 | + List<Map<String, Object>> list = buildInnerProfitDetailExcel(innerProfitDetailVOS, queryVO); | ||
452 | + if(CollectionUtils.isNotEmpty(list)){ | ||
453 | + List<String> keys = new ArrayList<>(list.get(Constant.ZERO).keySet()); | ||
454 | + ExcelHelper.opsExport(PoiWorkbookType.XLSX) | ||
455 | + .opsSheet(list) | ||
456 | + .opsHeader().simple().texts(keys).done() | ||
457 | + .opsColumn().fields(keys).done() | ||
458 | + .height(CellPosition.CELL, 750) | ||
459 | + .done() | ||
460 | + .export(response.getOutputStream()); | ||
461 | + System.out.println("导出成功"); | ||
462 | + } | ||
463 | + } | ||
464 | + } | ||
465 | + | ||
466 | + @Override | ||
467 | + public void setPackStatus(OrderCostInfoVO vo) { | ||
468 | + //首先判断orderId是否为空。 | ||
469 | + if(Objects.isNull(vo.getOrderId())){ | ||
470 | + throw new BusinessException(ServerResultCode.PARAM_ERROR); | ||
471 | + } | ||
472 | + OrderCostInfoDO orderCostInfoDO = getOne(new LambdaQueryWrapper<OrderCostInfoDO>() | ||
473 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
474 | + .eq(OrderCostInfoDO::getOrderId, vo.getOrderId()) | ||
475 | + .last("limit 1")); | ||
476 | + if(Objects.isNull(orderCostInfoDO)){ | ||
477 | + throw new BusinessException(ServerResultCode.EMPTY_LIST); | ||
478 | + } | ||
479 | + orderCostInfoDO.setPackStatus(ProfitStatusEnum.APPROVED.getStatus()); | ||
480 | + updateById(orderCostInfoDO); | ||
481 | + } | ||
482 | + | ||
483 | + @Override | ||
484 | + public void setInnerProduceStatus(OrderCostInfoVO vo) { | ||
485 | + if(Objects.isNull(vo.getOrderId())){ | ||
486 | + throw new BusinessException(ServerResultCode.PARAM_ERROR); | ||
487 | + } | ||
488 | + OrderCostInfoDO orderCostInfoDO = getOne(new LambdaQueryWrapper<OrderCostInfoDO>() | ||
489 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
490 | + .eq(OrderCostInfoDO::getOrderId, vo.getOrderId()) | ||
491 | + .last("limit 1")); | ||
492 | + if(Objects.isNull(orderCostInfoDO)){ | ||
493 | + throw new BusinessException(ServerResultCode.EMPTY_LIST); | ||
494 | + } | ||
495 | + orderCostInfoDO.setInnerProduceStatus(ProfitStatusEnum.APPROVED.getStatus()); | ||
496 | + updateById(orderCostInfoDO); | ||
497 | + } | ||
498 | + | ||
499 | + | ||
500 | + private OrderCostDetailedOptLogDO buildOrderConstOptLogDo(Long orderId, Long userId , Integer type, String optType, String field){ | ||
501 | + return OrderCostDetailedOptLogDO.builder() | ||
502 | + .orderId(orderId) | ||
503 | + .userId(userId) | ||
504 | + .type(type) | ||
505 | + .optType(optType) | ||
506 | + .fields(field) | ||
507 | + .build(); | ||
508 | + } | ||
509 | + private OrderCostInfoVO buildOrderConstInfoVO(OrderCostInfoVO vo,Long orderId){ | ||
510 | + OrderCostInfoVO orderCostInfoVO = new OrderCostInfoVO(); | ||
511 | + BeanUtils.copyProperties(vo, orderCostInfoVO, "id"); | ||
512 | + orderCostInfoVO.setId(orderId); | ||
513 | + return orderCostInfoVO; | ||
514 | + } | ||
515 | + | ||
516 | + private List<Map<String,Object>> buildBusinessProfitExportExcel(List<BusinessProfitDetailVO> businessProfitDetailVOS,ProjectBaseInfoQueryVO queryVO){ | ||
517 | + List<Map<String,Object>> list= new ArrayList<>(); | ||
518 | + for(BusinessProfitDetailVO vo:businessProfitDetailVOS){ | ||
519 | + Map<String, Object> map = new LinkedHashMap<>(); | ||
520 | + map.put("客户编码",Objects.nonNull(vo.getCustomerCode()) ? vo.getCustomerCode() : ""); | ||
521 | + map.put("项目号",Objects.nonNull(vo.getProjectNo()) ? vo.getProjectNo() : ""); | ||
522 | + map.put("生产科",Objects.nonNull(vo.getProductionDepartment()) ? vo.getProductionDepartment() : ""); | ||
523 | + map.put("内部编号",Objects.nonNull(vo.getInnerNo()) ? vo.getInnerNo() : ""); | ||
524 | + map.put("图片地址",Objects.nonNull(vo.getPicUrl()) ? vo.getPicUrl() : ""); | ||
525 | + map.put("订单数量",Objects.nonNull(vo.getOrderCount()) ? vo.getOrderCount() : ""); | ||
526 | + map.put("包装费用$",Objects.nonNull(vo.getPacketPrice()) ? String.format("%.2f",vo.getPacketPrice()) : ""); | ||
527 | + map.put("包装费用合计$",Objects.nonNull(vo.getPacketTotalPrice()) ? String.format("%.2f",vo.getPacketTotalPrice()) : ""); | ||
528 | + map.put("包装费用合计¥",Objects.nonNull(vo.getPacketRmbTotalPrice()) ? String.format("%.2f",vo.getPacketRmbTotalPrice()) : ""); | ||
529 | + map.put("包装费用实际金额¥",Objects.nonNull(vo.getPacketActualRmbTotalPrice()) ? vo.getPacketActualRmbTotalPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
530 | + map.put("实际跟单单价¥",Objects.nonNull(vo.getPacketActualRmbPrice()) ? vo.getPacketActualRmbPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
531 | + map.put("实际跟单单价$",Objects.nonNull(vo.getPacketActualPrice()) ? vo.getPacketActualPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
532 | + map.put("包装费用净利润率",Objects.nonNull(vo.getPacketProfitRate()) ? vo.getPacketProfitRate().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" : ""); | ||
533 | +// if(StringUtils.isNotBlank(queryVO.getBusinessCostExportSelect().getPacketPrice()) && | ||
534 | +// OrderLockFieldEnum.SELECTED.name().equals(queryVO.getBusinessCostExportSelect().getPacketPrice())){ | ||
535 | +// | ||
536 | +// } | ||
537 | + list.add(map); | ||
538 | + } | ||
539 | + return list; | ||
540 | + } | ||
541 | + | ||
542 | + private List<Map<String,Object>> buildInnerProfitDetailExcel(List<InnerProfitDetailVO> innerProfitDetailVOS, ProjectBaseInfoQueryVO queryVO){ | ||
543 | + List<Map<String,Object>> list = new ArrayList<>(); | ||
544 | + for (InnerProfitDetailVO vo:innerProfitDetailVOS){ | ||
545 | + Map<String, Object> hashMap = new LinkedHashMap<>(); | ||
546 | + hashMap.put("客户编码",Objects.nonNull(vo.getCustomerCode()) ? vo.getCustomerCode() : ""); | ||
547 | + hashMap.put("项目号",Objects.nonNull(vo.getProjectNo()) ? vo.getProjectNo() : ""); | ||
548 | + hashMap.put("生产科",Objects.nonNull(vo.getProductionDepartment()) ? vo.getProductionDepartment() : ""); | ||
549 | + hashMap.put("内部编号",Objects.nonNull(vo.getInnerNo()) ? vo.getInnerNo() : ""); | ||
550 | + hashMap.put("图片地址",Objects.nonNull(vo.getPicUrl()) ? vo.getPicUrl() : ""); | ||
551 | + hashMap.put("订单数量",Objects.nonNull(vo.getOrderCount()) ? vo.getOrderCount() : ""); | ||
552 | + hashMap.put("生产科单价¥",Objects.nonNull(vo.getProductionDepartmentPrice()) ? String.format("%.2f",vo.getProductionDepartmentPrice()) : ""); | ||
553 | + hashMap.put("生产科总价¥",Objects.nonNull(vo.getProductionDepartmentTotalPrice()) ? String.format("%.2f",vo.getProductionDepartmentTotalPrice()) : ""); | ||
554 | + hashMap.put("生产科预算金额¥",Objects.nonNull(vo.getProductionDepartmentPredictPrice()) ? vo.getProductionDepartmentPredictPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
555 | + hashMap.put("实际发生费用¥",Objects.nonNull(vo.getProductionActualPrice()) ? vo.getProductionActualPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
556 | + hashMap.put("预算占比",Objects.nonNull(vo.getPredictRatio()) ? vo.getPredictRatio().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" : ""); | ||
557 | + hashMap.put("预算占比与实际占比差",Objects.nonNull(vo.getPredictAndActualRatio()) ? vo.getPredictAndActualRatio().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" : ""); | ||
558 | + hashMap.put("事前毛利润",Objects.nonNull(vo.getBeforeGrossProfit()) ? vo.getBeforeGrossProfit().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
559 | + hashMap.put("事前毛利率",Objects.nonNull(vo.getBeforeGrossProfitRate()) ? vo.getBeforeGrossProfitRate().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" : ""); | ||
560 | + hashMap.put("事后毛利润",Objects.nonNull(vo.getGrossProfit()) ? vo.getGrossProfit().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
561 | + hashMap.put("事后毛利率",Objects.nonNull(vo.getGrossProfitRate()) ? vo.getGrossProfitRate().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" : ""); | ||
562 | + /*if(StringUtils.isNotBlank(queryVO.getInnerProfitDetailExportSelect().getProductionDepartmentPrice()) && | ||
563 | + OrderLockFieldEnum.SELECTED.name().equals(queryVO.getInnerProfitDetailExportSelect().getProductionDepartmentPrice())){ | ||
564 | + | ||
565 | + }*/ | ||
566 | + list.add(hashMap); | ||
567 | + } | ||
568 | + return list; | ||
569 | + } | ||
570 | + | ||
571 | +} |
src/main/java/com/order/erp/service/order/impl/OrderFieldLockApplyServiceImpl.java
1 | package com.order.erp.service.order.impl; | 1 | package com.order.erp.service.order.impl; |
2 | 2 | ||
3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
4 | +import cn.hutool.core.bean.copier.CopyOptions; | ||
4 | import cn.hutool.core.collection.CollUtil; | 5 | import cn.hutool.core.collection.CollUtil; |
5 | import com.alibaba.fastjson.JSONObject; | 6 | import com.alibaba.fastjson.JSONObject; |
6 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 7 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
@@ -20,12 +21,15 @@ import com.order.erp.config.DataScope; | @@ -20,12 +21,15 @@ import com.order.erp.config.DataScope; | ||
20 | import com.order.erp.domain.*; | 21 | import com.order.erp.domain.*; |
21 | import com.order.erp.domain.dto.BaseDO; | 22 | import com.order.erp.domain.dto.BaseDO; |
22 | import com.order.erp.domain.dto.order.*; | 23 | import com.order.erp.domain.dto.order.*; |
24 | +import com.order.erp.domain.model.OrderCostFieldLockRecord; | ||
23 | import com.order.erp.domain.vo.order.*; | 25 | import com.order.erp.domain.vo.order.*; |
24 | import com.order.erp.mapper.order.OrderFieldLockApplyMapper; | 26 | import com.order.erp.mapper.order.OrderFieldLockApplyMapper; |
27 | +import com.order.erp.service.IOrderCostFieldLockRecordService; | ||
25 | import com.order.erp.service.order.*; | 28 | import com.order.erp.service.order.*; |
26 | import lombok.extern.slf4j.Slf4j; | 29 | import lombok.extern.slf4j.Slf4j; |
27 | import org.joda.time.DateTime; | 30 | import org.joda.time.DateTime; |
28 | import org.springframework.beans.BeanUtils; | 31 | import org.springframework.beans.BeanUtils; |
32 | +import org.springframework.beans.factory.annotation.Autowired; | ||
29 | import org.springframework.stereotype.Service; | 33 | import org.springframework.stereotype.Service; |
30 | import org.springframework.transaction.annotation.Transactional; | 34 | import org.springframework.transaction.annotation.Transactional; |
31 | 35 | ||
@@ -35,6 +39,7 @@ import java.util.*; | @@ -35,6 +39,7 @@ import java.util.*; | ||
35 | import java.util.concurrent.TimeUnit; | 39 | import java.util.concurrent.TimeUnit; |
36 | import java.util.function.Function; | 40 | import java.util.function.Function; |
37 | import java.util.stream.Collectors; | 41 | import java.util.stream.Collectors; |
42 | +import java.util.stream.Stream; | ||
38 | 43 | ||
39 | /** | 44 | /** |
40 | * 用户订单-字段锁定申请表(OrderFieldLockApply)表服务实现类 | 45 | * 用户订单-字段锁定申请表(OrderFieldLockApply)表服务实现类 |
@@ -52,6 +57,9 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -52,6 +57,9 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
52 | @Resource | 57 | @Resource |
53 | private OrderFieldLockRecordService fieldLockRecordService; | 58 | private OrderFieldLockRecordService fieldLockRecordService; |
54 | 59 | ||
60 | + @Autowired | ||
61 | + private IOrderCostFieldLockRecordService orderCostFieldLockRecordService; | ||
62 | + | ||
55 | @Resource | 63 | @Resource |
56 | private OrderFieldLockApplyService applyService; | 64 | private OrderFieldLockApplyService applyService; |
57 | 65 | ||
@@ -121,15 +129,23 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -121,15 +129,23 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
121 | BeanUtils.copyProperties(x, resultVO); | 129 | BeanUtils.copyProperties(x, resultVO); |
122 | String fields = x.getFields(); | 130 | String fields = x.getFields(); |
123 | if (StringUtils.isNotBlank(fields)) { | 131 | if (StringUtils.isNotBlank(fields)) { |
124 | - if (ApplyTypeEnum.FIELD_EDIT_APPLY.getType() .equals(x.getType())) { | 132 | + if (ApplyTypeEnum.FIELD_EDIT_APPLY.getType().equals(x.getType())) { |
125 | resultVO.setFieldInfos(JSONObject.parseObject(fields, OrderLockFieldVO.class)); | 133 | resultVO.setFieldInfos(JSONObject.parseObject(fields, OrderLockFieldVO.class)); |
126 | } | 134 | } |
135 | + // todo | ||
136 | + if (Stream.of(OrderCostApplyTpeEnum.ORDER_PACKET_COST_FIELD_EDIT_APPLY, | ||
137 | + OrderCostApplyTpeEnum.ORDER_PRODUCTION_COST_FIELD_EDIT_APPLY) | ||
138 | + .map(OrderCostApplyTpeEnum::getType) | ||
139 | + .anyMatch(type -> type.equals(x.getType()))) { | ||
140 | + OrderCostInfolockFieldVO orderCostInfolockFieldVO = JSONObject.parseObject(fields, OrderCostInfolockFieldVO.class); | ||
141 | + resultVO.setFieldInfos(OrderLockFieldVO.builder().costInfolockFieldVO(orderCostInfolockFieldVO).build()); | ||
142 | + } | ||
127 | if (ApplyTypeEnum.ORDER_REPORT_APPLY.getType().equals(x.getType())) { | 143 | if (ApplyTypeEnum.ORDER_REPORT_APPLY.getType().equals(x.getType())) { |
128 | OrderLockFieldVO fieldVO = new OrderLockFieldVO(); | 144 | OrderLockFieldVO fieldVO = new OrderLockFieldVO(); |
129 | fieldVO.setReportFields(JSONObject.parseObject(fields, OrderCompletionReportFieldVO.class)); | 145 | fieldVO.setReportFields(JSONObject.parseObject(fields, OrderCompletionReportFieldVO.class)); |
130 | resultVO.setFieldInfos(fieldVO); | 146 | resultVO.setFieldInfos(fieldVO); |
131 | } | 147 | } |
132 | - if (ApplyTypeEnum.ORDER_PROFIT_APPLY.getType() .equals(x.getType())) { | 148 | + if (ApplyTypeEnum.ORDER_PROFIT_APPLY.getType().equals(x.getType())) { |
133 | OrderLockFieldVO fieldVO = new OrderLockFieldVO(); | 149 | OrderLockFieldVO fieldVO = new OrderLockFieldVO(); |
134 | fieldVO.setProfitAnalysisFields(JSONObject.parseObject(fields, OrderProfitAnalysisFieldVO.class)); | 150 | fieldVO.setProfitAnalysisFields(JSONObject.parseObject(fields, OrderProfitAnalysisFieldVO.class)); |
135 | resultVO.setFieldInfos(fieldVO); | 151 | resultVO.setFieldInfos(fieldVO); |
@@ -158,8 +174,8 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -158,8 +174,8 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
158 | } else{ | 174 | } else{ |
159 | resultVO.setFieldInfos(orderLockFieldVO); | 175 | resultVO.setFieldInfos(orderLockFieldVO); |
160 | } | 176 | } |
161 | - if(Objects.isNull(resultVO.getFieldInfos())){ | ||
162 | - resultVO=null; | 177 | + if (Objects.isNull(resultVO.getFieldInfos())) { |
178 | + resultVO = null; | ||
163 | } | 179 | } |
164 | } | 180 | } |
165 | if (ApplyTypeEnum.CHECK_BILL_APPLY.getType().equals(x.getType()) || ApplyTypeEnum.DEPARTMENT_INVOICE_APPLY.getType().equals(x.getType()) || ApplyTypeEnum.CHECK_DEDUCT_URL.getType().equals(x.getType())) { | 181 | if (ApplyTypeEnum.CHECK_BILL_APPLY.getType().equals(x.getType()) || ApplyTypeEnum.DEPARTMENT_INVOICE_APPLY.getType().equals(x.getType()) || ApplyTypeEnum.CHECK_DEDUCT_URL.getType().equals(x.getType())) { |
@@ -200,13 +216,13 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -200,13 +216,13 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
200 | } else{ | 216 | } else{ |
201 | resultVO.setFieldInfos(orderLockFieldVO); | 217 | resultVO.setFieldInfos(orderLockFieldVO); |
202 | } | 218 | } |
203 | - if(Objects.isNull(resultVO.getFieldInfos())){ | ||
204 | - resultVO=null; | 219 | + if (Objects.isNull(resultVO.getFieldInfos())) { |
220 | + resultVO = null; | ||
205 | } | 221 | } |
206 | } | 222 | } |
207 | } | 223 | } |
208 | return resultVO; | 224 | return resultVO; |
209 | - }).filter(result->result!=null).collect(Collectors.toList()); | 225 | + }).filter(Objects::nonNull).collect(Collectors.toList()); |
210 | if (resultVOList != null && resultVOList.stream().noneMatch(x -> ApplyTypeEnum.INVOICE_BILL_APPLY.getType().equals(x.getType()) | 226 | if (resultVOList != null && resultVOList.stream().noneMatch(x -> ApplyTypeEnum.INVOICE_BILL_APPLY.getType().equals(x.getType()) |
211 | || ApplyTypeEnum.DEPARTMENT_INVOICE_APPLY.getType().equals(x.getType()) | 227 | || ApplyTypeEnum.DEPARTMENT_INVOICE_APPLY.getType().equals(x.getType()) |
212 | || ApplyTypeEnum.CHECK_BILL_APPLY.getType().equals(x.getType()) | 228 | || ApplyTypeEnum.CHECK_BILL_APPLY.getType().equals(x.getType()) |
@@ -406,7 +422,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -406,7 +422,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
406 | * @param queryVO | 422 | * @param queryVO |
407 | * @return | 423 | * @return |
408 | */ | 424 | */ |
409 | - private LambdaQueryWrapper<OrderFieldLockApplyDO> buildQueryByParam(OrderFieldLockApplyQueryVO queryVO,RoleEnum roleEnum) { | 425 | + private LambdaQueryWrapper<OrderFieldLockApplyDO> buildQueryByParam(OrderFieldLockApplyQueryVO queryVO, RoleEnum roleEnum) { |
410 | RoleEnum roleSelect = null; | 426 | RoleEnum roleSelect = null; |
411 | if (RoleEnum.BUSINESS_USER.getCode().equals(roleEnum.getCode())) { | 427 | if (RoleEnum.BUSINESS_USER.getCode().equals(roleEnum.getCode())) { |
412 | queryVO.setBusinessPerson(dataScope.getLoginUserName()); | 428 | queryVO.setBusinessPerson(dataScope.getLoginUserName()); |
@@ -424,7 +440,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -424,7 +440,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
424 | // queryVO.getType==Constant.SIXTY完全是为了跟单和业务对于应收账单类型请求时,屏蔽掉应收账单,只展示invoice扣款单申请数据。 | 440 | // queryVO.getType==Constant.SIXTY完全是为了跟单和业务对于应收账单类型请求时,屏蔽掉应收账单,只展示invoice扣款单申请数据。 |
425 | if(queryVO.getType()==Constant.THIRTY || queryVO.getType()==4050 || queryVO.getType()==Constant.SIXTY){ | 441 | if(queryVO.getType()==Constant.THIRTY || queryVO.getType()==4050 || queryVO.getType()==Constant.SIXTY){ |
426 | 442 | ||
427 | - }else{ | 443 | + } else { |
428 | /** 这部分代码是之前的,每台看懂,就先不修改了,保留*/ | 444 | /** 这部分代码是之前的,每台看懂,就先不修改了,保留*/ |
429 | //这里是否还u需要添加财务角色权限的逻辑。 | 445 | //这里是否还u需要添加财务角色权限的逻辑。 |
430 | if (StringUtils.isNotBlank(queryVO.getBusinessPerson()) || CollectionUtils.isNotEmpty(queryVO.getCustomerCode()) || CollectionUtils.isNotEmpty(queryVO.getInnerNo()) | 446 | if (StringUtils.isNotBlank(queryVO.getBusinessPerson()) || CollectionUtils.isNotEmpty(queryVO.getCustomerCode()) || CollectionUtils.isNotEmpty(queryVO.getInnerNo()) |
@@ -450,14 +466,14 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -450,14 +466,14 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
450 | .in(CollectionUtils.isNotEmpty(queryVO.getStatusList()), OrderFieldLockApplyDO::getStatus, queryVO.getStatusList()) | 466 | .in(CollectionUtils.isNotEmpty(queryVO.getStatusList()), OrderFieldLockApplyDO::getStatus, queryVO.getStatusList()) |
451 | .in(CollectionUtils.isNotEmpty(orderIds), OrderFieldLockApplyDO::getOrderId, orderIds); | 467 | .in(CollectionUtils.isNotEmpty(orderIds), OrderFieldLockApplyDO::getOrderId, orderIds); |
452 | //这里应该加上应收款待审核,应付款待审核,应付款已审核,应收款已审核已审核的一个条件。 目前只支持单个字符串搜索,不支持多个。 | 468 | //这里应该加上应收款待审核,应付款待审核,应付款已审核,应收款已审核已审核的一个条件。 目前只支持单个字符串搜索,不支持多个。 |
453 | - if(Objects.nonNull(queryVO.getType())){ | 469 | + if (Objects.nonNull(queryVO.getType())) { |
454 | //发票,应付款审核。 | 470 | //发票,应付款审核。 |
455 | - if(Constant.FOUR == String.valueOf(queryVO.getType()).length()){ | 471 | + if (Constant.FOUR == String.valueOf(queryVO.getType()).length()) { |
456 | int firstTwoDigits = queryVO.getType() / 100; | 472 | int firstTwoDigits = queryVO.getType() / 100; |
457 | int lastTwoDigits = queryVO.getType() % 100; | 473 | int lastTwoDigits = queryVO.getType() % 100; |
458 | queryWrapper.in(OrderFieldLockApplyDO::getType,firstTwoDigits,lastTwoDigits,ApplyTypeEnum.CHECK_DEDUCT_URL.getType()); | 474 | queryWrapper.in(OrderFieldLockApplyDO::getType,firstTwoDigits,lastTwoDigits,ApplyTypeEnum.CHECK_DEDUCT_URL.getType()); |
459 | //目前是只能通过内部编号查询出应付款审核,无法查询出发票信息。 | 475 | //目前是只能通过内部编号查询出应付款审核,无法查询出发票信息。 |
460 | - if(CollectionUtils.isNotEmpty(queryVO.getInnerNo())){ | 476 | + if (CollectionUtils.isNotEmpty(queryVO.getInnerNo())) { |
461 | String queryInnerNo = queryVO.getInnerNo().get(0).trim(); | 477 | String queryInnerNo = queryVO.getInnerNo().get(0).trim(); |
462 | queryWrapper.apply( | 478 | queryWrapper.apply( |
463 | "(" + | 479 | "(" + |
@@ -472,7 +488,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -472,7 +488,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
472 | //应收款审核。 | 488 | //应收款审核。 |
473 | queryWrapper.in(Objects.nonNull(queryVO.getType()), OrderFieldLockApplyDO::getType, queryVO.getType(),ApplyTypeEnum.INVOICE_DEDUCT_URL.getType()); | 489 | queryWrapper.in(Objects.nonNull(queryVO.getType()), OrderFieldLockApplyDO::getType, queryVO.getType(),ApplyTypeEnum.INVOICE_DEDUCT_URL.getType()); |
474 | //这个内部编号单独针对于应付款申请设置的。 | 490 | //这个内部编号单独针对于应付款申请设置的。 |
475 | - if(CollectionUtils.isNotEmpty(queryVO.getInnerNo())){ | 491 | + if (CollectionUtils.isNotEmpty(queryVO.getInnerNo())) { |
476 | String queryInnerNo = queryVO.getInnerNo().get(0).trim(); | 492 | String queryInnerNo = queryVO.getInnerNo().get(0).trim(); |
477 | queryWrapper.apply( | 493 | queryWrapper.apply( |
478 | "(" + | 494 | "(" + |
@@ -525,15 +541,22 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -525,15 +541,22 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
525 | 541 | ||
526 | }else if(RoleEnum.BUSINESS_USER.getCode().equals(roleEnum.getCode()) && (queryVO.getType()==Constant.THIRTY || queryVO.getType()==4050 || queryVO.getType() ==Constant.SIXTY)){ | 542 | }else if(RoleEnum.BUSINESS_USER.getCode().equals(roleEnum.getCode()) && (queryVO.getType()==Constant.THIRTY || queryVO.getType()==4050 || queryVO.getType() ==Constant.SIXTY)){ |
527 | 543 | ||
528 | - }else{ | 544 | + } else { |
529 | if (Objects.isNull(roleSelect)) { | 545 | if (Objects.isNull(roleSelect)) { |
530 | queryWrapper.like(Objects.nonNull(roleEnum), OrderFieldLockApplyDO::getAuditRoleCodes, roleEnum.getCode()); | 546 | queryWrapper.like(Objects.nonNull(roleEnum), OrderFieldLockApplyDO::getAuditRoleCodes, roleEnum.getCode()); |
531 | - }else { | 547 | + } else { |
532 | queryWrapper.eq(Objects.nonNull(roleSelect), OrderFieldLockApplyDO::getAuditRoleCodes, roleSelect.getCode()); | 548 | queryWrapper.eq(Objects.nonNull(roleSelect), OrderFieldLockApplyDO::getAuditRoleCodes, roleSelect.getCode()); |
533 | 549 | ||
534 | } | 550 | } |
535 | } | 551 | } |
536 | - return queryWrapper; | 552 | + return queryWrapper |
553 | + .func(Objects.nonNull(queryVO.getTypeIn()), query -> { | ||
554 | + if (CollUtil.isNotEmpty(queryVO.getTypeIn())) { | ||
555 | + query.in(OrderFieldLockApplyDO::getType, queryVO.getTypeIn()); | ||
556 | + } else { | ||
557 | + query.apply("1!=1"); | ||
558 | + } | ||
559 | + }); | ||
537 | } | 560 | } |
538 | 561 | ||
539 | /** | 562 | /** |
@@ -676,16 +699,16 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -676,16 +699,16 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
676 | throw new BusinessException(ServerResultCode.ORDER_BASE_INFO_EMPTY); | 699 | throw new BusinessException(ServerResultCode.ORDER_BASE_INFO_EMPTY); |
677 | } | 700 | } |
678 | } | 701 | } |
679 | - if(ApplyTypeEnum.INVOICE_BILL_APPLY.getType().equals(applyDO.getType())){ | ||
680 | - InvoiceBillOrderDO invoiceBillOrderDO= invoiceBillOrderService.getById(applyDO.getOrderId()); | ||
681 | - if(Objects.isNull(invoiceBillOrderDO)){ | ||
682 | - throw new BusinessException(ServerResultCode. APPLY_NOT_EXIST); | 702 | + if (ApplyTypeEnum.INVOICE_BILL_APPLY.getType().equals(applyDO.getType())) { |
703 | + InvoiceBillOrderDO invoiceBillOrderDO = invoiceBillOrderService.getById(applyDO.getOrderId()); | ||
704 | + if (Objects.isNull(invoiceBillOrderDO)) { | ||
705 | + throw new BusinessException(ServerResultCode.APPLY_NOT_EXIST); | ||
683 | } | 706 | } |
684 | } | 707 | } |
685 | - if(ApplyTypeEnum.CHECK_BILL_APPLY.getType().equals(applyDO.getType()) || ApplyTypeEnum.DEPARTMENT_INVOICE_APPLY.getType().equals(applyDO.getType())){ | ||
686 | - ProducePaymentCheckBillOrderDO checkBillOrderDO= checkBillOrderService.getById(applyDO.getOrderId()); | ||
687 | - if(Objects.isNull(checkBillOrderDO)){ | ||
688 | - throw new BusinessException(ServerResultCode. APPLY_NOT_EXIST); | 708 | + if (ApplyTypeEnum.CHECK_BILL_APPLY.getType().equals(applyDO.getType()) || ApplyTypeEnum.DEPARTMENT_INVOICE_APPLY.getType().equals(applyDO.getType())) { |
709 | + ProducePaymentCheckBillOrderDO checkBillOrderDO = checkBillOrderService.getById(applyDO.getOrderId()); | ||
710 | + if (Objects.isNull(checkBillOrderDO)) { | ||
711 | + throw new BusinessException(ServerResultCode.APPLY_NOT_EXIST); | ||
689 | } | 712 | } |
690 | } | 713 | } |
691 | if (ApplyTypeEnum.ORDER_REPORT_APPLY.getType().equals(applyDO.getType())) { | 714 | if (ApplyTypeEnum.ORDER_REPORT_APPLY.getType().equals(applyDO.getType())) { |
@@ -696,7 +719,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -696,7 +719,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
696 | orderBaseInfoDO.setOrderStatus(OrderStatusEnum.PROFIT_AUDIT_REFUSE.getStatus()); | 719 | orderBaseInfoDO.setOrderStatus(OrderStatusEnum.PROFIT_AUDIT_REFUSE.getStatus()); |
697 | orderBaseInfoService.updateById(orderBaseInfoDO); | 720 | orderBaseInfoService.updateById(orderBaseInfoDO); |
698 | } else if (ApplyTypeEnum.INVOICE_BILL_APPLY.getType().equals(applyDO.getType())) { | 721 | } else if (ApplyTypeEnum.INVOICE_BILL_APPLY.getType().equals(applyDO.getType())) { |
699 | - OrderLockFieldVO lockFieldVO = JSONObject.parseObject(applyDO.getFields(), OrderLockFieldVO.class); | 722 | + OrderLockFieldVO lockFieldVO = JSONObject.parseObject(applyDO.getFields(), OrderLockFieldVO.class); |
700 | InvoiceFieldVO invoiceBillOrderDO = lockFieldVO.getInvoiceFieldVO(); | 723 | InvoiceFieldVO invoiceBillOrderDO = lockFieldVO.getInvoiceFieldVO(); |
701 | //查询是否存在未审核的扣款单。 | 724 | //查询是否存在未审核的扣款单。 |
702 | List<OrderFieldLockApplyDO> InvoiceDeductUrlList = list(new LambdaQueryWrapper<OrderFieldLockApplyDO>() | 725 | List<OrderFieldLockApplyDO> InvoiceDeductUrlList = list(new LambdaQueryWrapper<OrderFieldLockApplyDO>() |
@@ -708,7 +731,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -708,7 +731,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
708 | throw new BusinessException("该Invoice存在未审批的扣款单,请先审批该对账单的扣款单!"); | 731 | throw new BusinessException("该Invoice存在未审批的扣款单,请先审批该对账单的扣款单!"); |
709 | } | 732 | } |
710 | List<InvoiceBillOrderDO> invoiceBillOrderDOList = invoiceBillOrderService.listByIds(invoiceBillOrderDO.getInvoiceId()); | 733 | List<InvoiceBillOrderDO> invoiceBillOrderDOList = invoiceBillOrderService.listByIds(invoiceBillOrderDO.getInvoiceId()); |
711 | - if(CollectionUtils.isNotEmpty(invoiceBillOrderDOList)){ | 734 | + if (CollectionUtils.isNotEmpty(invoiceBillOrderDOList)) { |
712 | List<InvoiceBillOrderDO> invoiceBillOrderDOS = invoiceBillOrderDOList.stream().filter(Objects::nonNull).map(x -> { | 735 | List<InvoiceBillOrderDO> invoiceBillOrderDOS = invoiceBillOrderDOList.stream().filter(Objects::nonNull).map(x -> { |
713 | x.setStatus(FinanceEnum.UNPAID_PAYMENTS.getStatus()); | 736 | x.setStatus(FinanceEnum.UNPAID_PAYMENTS.getStatus()); |
714 | return x; | 737 | return x; |
@@ -757,8 +780,8 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -757,8 +780,8 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
757 | throw new BusinessException("该生产科对账单存在未审批的扣款单,请先审批该对账单的扣款单!"); | 780 | throw new BusinessException("该生产科对账单存在未审批的扣款单,请先审批该对账单的扣款单!"); |
758 | } | 781 | } |
759 | List<ProducePaymentCheckBillOrderDO> producePaymentCheckBillOrderDOList = checkBillOrderService.listByIds(producePaymentCheckBillId); | 782 | List<ProducePaymentCheckBillOrderDO> producePaymentCheckBillOrderDOList = checkBillOrderService.listByIds(producePaymentCheckBillId); |
760 | - if(CollectionUtils.isNotEmpty(producePaymentCheckBillOrderDOList)){ | ||
761 | - List<ProducePaymentCheckBillOrderDO> producePaymentCheckBillOrderDOS= producePaymentCheckBillOrderDOList.stream().filter(Objects::nonNull).map(x -> { | 783 | + if (CollectionUtils.isNotEmpty(producePaymentCheckBillOrderDOList)) { |
784 | + List<ProducePaymentCheckBillOrderDO> producePaymentCheckBillOrderDOS = producePaymentCheckBillOrderDOList.stream().filter(Objects::nonNull).map(x -> { | ||
762 | x.setStatus(FinanceEnum.UNPAID_PAYMENTS.getStatus()); | 785 | x.setStatus(FinanceEnum.UNPAID_PAYMENTS.getStatus()); |
763 | return x; | 786 | return x; |
764 | }).collect(Collectors.toList()); | 787 | }).collect(Collectors.toList()); |
@@ -783,7 +806,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -783,7 +806,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
783 | emailSendUtils.sendInvoiceAndCheckEmail(FinanceOverEnum.CHECK_FAIL,invoiceAndCheckBillSendEmailVO,false); | 806 | emailSendUtils.sendInvoiceAndCheckEmail(FinanceOverEnum.CHECK_FAIL,invoiceAndCheckBillSendEmailVO,false); |
784 | } | 807 | } |
785 | 808 | ||
786 | - } else if(ApplyTypeEnum.DEPARTMENT_INVOICE_APPLY.getType().equals(applyDO.getType())){ | 809 | + } else if (ApplyTypeEnum.DEPARTMENT_INVOICE_APPLY.getType().equals(applyDO.getType())) { |
787 | OrderLockFieldVO lockFieldVO = JSONObject.parseObject(applyDO.getFields(), OrderLockFieldVO.class); | 810 | OrderLockFieldVO lockFieldVO = JSONObject.parseObject(applyDO.getFields(), OrderLockFieldVO.class); |
788 | ProducePaymentCheckBillVO checkBillOrderDO = lockFieldVO.getCheckBillVO(); | 811 | ProducePaymentCheckBillVO checkBillOrderDO = lockFieldVO.getCheckBillVO(); |
789 | 812 | ||
@@ -791,9 +814,9 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -791,9 +814,9 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
791 | ProducePaymentCheckBillOrderDO invoiceInfoDO = checkBillOrderService.getById(checkBillOrderDO.getId()); | 814 | ProducePaymentCheckBillOrderDO invoiceInfoDO = checkBillOrderService.getById(checkBillOrderDO.getId()); |
792 | invoiceInfoDO.setDepartmentInvoiceStatus(ApplyStatusEnum.AUDIT_REFUSE.getStatus()); | 815 | invoiceInfoDO.setDepartmentInvoiceStatus(ApplyStatusEnum.AUDIT_REFUSE.getStatus()); |
793 | //传递给审核一直都是最新的发票。 | 816 | //传递给审核一直都是最新的发票。 |
794 | - if(com.order.erp.common.utils.StringUtils.isNotBlank(invoiceInfoDO.getInvoiceUrl())){ | 817 | + if (com.order.erp.common.utils.StringUtils.isNotBlank(invoiceInfoDO.getInvoiceUrl())) { |
795 | log.info("checkBillOrderDO.getInvoiceUrl() 极有可能为空: {}", checkBillOrderDO.getInvoiceUrl()); | 818 | log.info("checkBillOrderDO.getInvoiceUrl() 极有可能为空: {}", checkBillOrderDO.getInvoiceUrl()); |
796 | - if(Arrays.stream(invoiceInfoDO.getInvoiceUrl().split(",")).anyMatch(item->item.equals(checkBillOrderDO.getInvoiceUrl()))){ | 819 | + if (Arrays.stream(invoiceInfoDO.getInvoiceUrl().split(",")).anyMatch(item -> item.equals(checkBillOrderDO.getInvoiceUrl()))) { |
797 | // 将 invoiceUrls 分割成 List 并删除相同项 | 820 | // 将 invoiceUrls 分割成 List 并删除相同项 |
798 | List<String> urlList = new ArrayList<>(Arrays.asList(invoiceInfoDO.getInvoiceUrl().split(","))); | 821 | List<String> urlList = new ArrayList<>(Arrays.asList(invoiceInfoDO.getInvoiceUrl().split(","))); |
799 | urlList.removeIf(url -> url.equals(checkBillOrderDO.getInvoiceUrl())); | 822 | urlList.removeIf(url -> url.equals(checkBillOrderDO.getInvoiceUrl())); |
@@ -802,7 +825,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -802,7 +825,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
802 | String updatedInvoiceUrls = String.join(",", urlList); | 825 | String updatedInvoiceUrls = String.join(",", urlList); |
803 | invoiceInfoDO.setInvoiceUrl(updatedInvoiceUrls); | 826 | invoiceInfoDO.setInvoiceUrl(updatedInvoiceUrls); |
804 | } | 827 | } |
805 | - }else{ | 828 | + } else { |
806 | invoiceInfoDO.setInvoiceUrl(null); | 829 | invoiceInfoDO.setInvoiceUrl(null); |
807 | } | 830 | } |
808 | checkBillOrderService.updateById(invoiceInfoDO); | 831 | checkBillOrderService.updateById(invoiceInfoDO); |
@@ -992,7 +1015,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -992,7 +1015,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
992 | //后期需要判断是否存在存在未审核的扣款单。 | 1015 | //后期需要判断是否存在存在未审核的扣款单。 |
993 | applyDO.setAuditUserId(auditUserId); | 1016 | applyDO.setAuditUserId(auditUserId); |
994 | applyDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); | 1017 | applyDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); |
995 | - OrderLockFieldVO lockFieldVO = JSONObject.parseObject(applyDO.getFields(), OrderLockFieldVO.class); | 1018 | + OrderLockFieldVO lockFieldVO = JSONObject.parseObject(applyDO.getFields(), OrderLockFieldVO.class); |
996 | InvoiceFieldVO invoiceBillOrderDO = lockFieldVO.getInvoiceFieldVO(); | 1019 | InvoiceFieldVO invoiceBillOrderDO = lockFieldVO.getInvoiceFieldVO(); |
997 | List<Long> invoiceId = invoiceBillOrderDO.getInvoiceId(); | 1020 | List<Long> invoiceId = invoiceBillOrderDO.getInvoiceId(); |
998 | //查询是否存在未审核的扣款单。 | 1021 | //查询是否存在未审核的扣款单。 |
@@ -1005,7 +1028,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -1005,7 +1028,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
1005 | throw new BusinessException("该Invoice存在未审批的扣款单,请先审批该对账单的扣款单!"); | 1028 | throw new BusinessException("该Invoice存在未审批的扣款单,请先审批该对账单的扣款单!"); |
1006 | } | 1029 | } |
1007 | List<InvoiceBillOrderDO> invoiceBillOrderDOS = invoiceBillOrderService.listByIds(invoiceId); | 1030 | List<InvoiceBillOrderDO> invoiceBillOrderDOS = invoiceBillOrderService.listByIds(invoiceId); |
1008 | - if(CollectionUtils.isNotEmpty(invoiceBillOrderDOS)){ | 1031 | + if (CollectionUtils.isNotEmpty(invoiceBillOrderDOS)) { |
1009 | List<InvoiceBillOrderDO> invoiceeBillOrderDOs = invoiceBillOrderDOS.stream().filter(Objects::nonNull).map(x -> { | 1032 | List<InvoiceBillOrderDO> invoiceeBillOrderDOs = invoiceBillOrderDOS.stream().filter(Objects::nonNull).map(x -> { |
1010 | x.setStatus(FinanceEnum.RECEIVED_PAYMENT.getStatus()); | 1033 | x.setStatus(FinanceEnum.RECEIVED_PAYMENT.getStatus()); |
1011 | return x; | 1034 | return x; |
@@ -1054,7 +1077,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -1054,7 +1077,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
1054 | throw new BusinessException("该生产科对账单存在未审批的扣款单,请先审批该对账单的扣款单!"); | 1077 | throw new BusinessException("该生产科对账单存在未审批的扣款单,请先审批该对账单的扣款单!"); |
1055 | } | 1078 | } |
1056 | List<ProducePaymentCheckBillOrderDO> checkBillOrderDOS = checkBillOrderService.listByIds(producePaymentCheckBillId); | 1079 | List<ProducePaymentCheckBillOrderDO> checkBillOrderDOS = checkBillOrderService.listByIds(producePaymentCheckBillId); |
1057 | - if(CollectionUtils.isNotEmpty(checkBillOrderDOS)){ | 1080 | + if (CollectionUtils.isNotEmpty(checkBillOrderDOS)) { |
1058 | List<ProducePaymentCheckBillOrderDO> producePaymentCheckBillOrderDOS = checkBillOrderDOS.stream().filter(Objects::nonNull).map(x -> { | 1081 | List<ProducePaymentCheckBillOrderDO> producePaymentCheckBillOrderDOS = checkBillOrderDOS.stream().filter(Objects::nonNull).map(x -> { |
1059 | x.setStatus(FinanceEnum.RECEIVED_PAYMENT.getStatus()); | 1082 | x.setStatus(FinanceEnum.RECEIVED_PAYMENT.getStatus()); |
1060 | return x; | 1083 | return x; |
@@ -1068,7 +1091,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -1068,7 +1091,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
1068 | x.setCheckStatus(FinanceEnum.RECEIVED_PAYMENT.getStatus()); | 1091 | x.setCheckStatus(FinanceEnum.RECEIVED_PAYMENT.getStatus()); |
1069 | return x; | 1092 | return x; |
1070 | }).collect(Collectors.toList()); | 1093 | }).collect(Collectors.toList()); |
1071 | - transactionHelper.run(() ->{ | 1094 | + transactionHelper.run(() -> { |
1072 | orderBaseInfoService.updateBatchById(orderBaseInfoDOS); | 1095 | orderBaseInfoService.updateBatchById(orderBaseInfoDOS); |
1073 | checkBillOrderService.updateBatchById(producePaymentCheckBillOrderDOS); | 1096 | checkBillOrderService.updateBatchById(producePaymentCheckBillOrderDOS); |
1074 | }); | 1097 | }); |
@@ -1079,7 +1102,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -1079,7 +1102,7 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
1079 | emailSendUtils.sendInvoiceAndCheckEmail(FinanceOverEnum.CHECK_PASS,invoiceAndCheckBillSendEmailVO,true); | 1102 | emailSendUtils.sendInvoiceAndCheckEmail(FinanceOverEnum.CHECK_PASS,invoiceAndCheckBillSendEmailVO,true); |
1080 | 1103 | ||
1081 | } | 1104 | } |
1082 | - } else if (ApplyTypeEnum.DEPARTMENT_INVOICE_APPLY.getType().equals(applyDO.getType())) { | 1105 | + } else if (ApplyTypeEnum.DEPARTMENT_INVOICE_APPLY.getType().equals(applyDO.getType())) { |
1083 | applyDO.setAuditUserId(auditUserId); | 1106 | applyDO.setAuditUserId(auditUserId); |
1084 | applyDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); | 1107 | applyDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); |
1085 | OrderLockFieldVO lockFieldVO = JSONObject.parseObject(applyDO.getFields(), OrderLockFieldVO.class); | 1108 | OrderLockFieldVO lockFieldVO = JSONObject.parseObject(applyDO.getFields(), OrderLockFieldVO.class); |
@@ -1088,18 +1111,18 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -1088,18 +1111,18 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
1088 | ProducePaymentCheckBillOrderDO invoiceInfoDO = checkBillOrderService.getById(checkBillOrderDO.getId()); | 1111 | ProducePaymentCheckBillOrderDO invoiceInfoDO = checkBillOrderService.getById(checkBillOrderDO.getId()); |
1089 | invoiceInfoDO.setDepartmentInvoiceStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); | 1112 | invoiceInfoDO.setDepartmentInvoiceStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); |
1090 | //传递给审核一直都是最新的发票。 | 1113 | //传递给审核一直都是最新的发票。 |
1091 | - if(com.order.erp.common.utils.StringUtils.isNotBlank(invoiceInfoDO.getInvoiceUrl())){ | ||
1092 | - if(com.order.erp.common.utils.StringUtils.isNotBlank(checkBillOrderDO.getInvoiceUrl())){ | 1114 | + if (com.order.erp.common.utils.StringUtils.isNotBlank(invoiceInfoDO.getInvoiceUrl())) { |
1115 | + if (com.order.erp.common.utils.StringUtils.isNotBlank(checkBillOrderDO.getInvoiceUrl())) { | ||
1093 | Set<String> deductUrlSet = new HashSet<>(Arrays.asList( | 1116 | Set<String> deductUrlSet = new HashSet<>(Arrays.asList( |
1094 | org.apache.commons.lang3.StringUtils.defaultString(invoiceInfoDO.getInvoiceUrl()).split(","))); | 1117 | org.apache.commons.lang3.StringUtils.defaultString(invoiceInfoDO.getInvoiceUrl()).split(","))); |
1095 | - if(!deductUrlSet.contains(checkBillOrderDO.getInvoiceUrl())){ | 1118 | + if (!deductUrlSet.contains(checkBillOrderDO.getInvoiceUrl())) { |
1096 | deductUrlSet.add(checkBillOrderDO.getInvoiceUrl()); | 1119 | deductUrlSet.add(checkBillOrderDO.getInvoiceUrl()); |
1097 | - String updateDeductUrl=String.join(",",deductUrlSet); | 1120 | + String updateDeductUrl = String.join(",", deductUrlSet); |
1098 | invoiceInfoDO.setInvoiceUrl(updateDeductUrl); | 1121 | invoiceInfoDO.setInvoiceUrl(updateDeductUrl); |
1099 | } | 1122 | } |
1100 | } | 1123 | } |
1101 | - }else{ | ||
1102 | - if(com.order.erp.common.utils.StringUtils.isNotBlank(checkBillOrderDO.getInvoiceUrl())){ | 1124 | + } else { |
1125 | + if (com.order.erp.common.utils.StringUtils.isNotBlank(checkBillOrderDO.getInvoiceUrl())) { | ||
1103 | invoiceInfoDO.setInvoiceUrl(checkBillOrderDO.getInvoiceUrl()); | 1126 | invoiceInfoDO.setInvoiceUrl(checkBillOrderDO.getInvoiceUrl()); |
1104 | } | 1127 | } |
1105 | } | 1128 | } |
@@ -1166,6 +1189,39 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | @@ -1166,6 +1189,39 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl<OrderFieldLockAp | ||
1166 | InvoiceAndCheckBillSendEmailVO invoiceAndCheckBillSendEmailVO = new InvoiceAndCheckBillSendEmailVO(); | 1189 | InvoiceAndCheckBillSendEmailVO invoiceAndCheckBillSendEmailVO = new InvoiceAndCheckBillSendEmailVO(); |
1167 | invoiceAndCheckBillSendEmailVO.setDeductionUrlFieldVO(deductionUrlFieldVO); | 1190 | invoiceAndCheckBillSendEmailVO.setDeductionUrlFieldVO(deductionUrlFieldVO); |
1168 | emailSendUtils.sendInvoiceAndCheckEmail(FinanceOverEnum.CHECK_DEDUCTURL_PASS,invoiceAndCheckBillSendEmailVO,true); | 1191 | emailSendUtils.sendInvoiceAndCheckEmail(FinanceOverEnum.CHECK_DEDUCTURL_PASS,invoiceAndCheckBillSendEmailVO,true); |
1192 | + //todo | ||
1193 | + } else if (Stream.of(OrderCostApplyTpeEnum.ORDER_PACKET_COST_FIELD_EDIT_APPLY, | ||
1194 | + OrderCostApplyTpeEnum.ORDER_PRODUCTION_COST_FIELD_EDIT_APPLY) | ||
1195 | + .map(OrderCostApplyTpeEnum::getType) | ||
1196 | + .anyMatch(x -> x.equals(applyDO.getType()))) { | ||
1197 | + applyDO.setAuditUserId(auditUserId); | ||
1198 | + applyDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); | ||
1199 | + | ||
1200 | + OrderCostFieldLockRecord recordDO = orderCostFieldLockRecordService.getOne(new LambdaQueryWrapper<OrderCostFieldLockRecord>() | ||
1201 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
1202 | + .eq(OrderCostFieldLockRecord::getOrderId, applyDO.getOrderId()) | ||
1203 | + .eq(OrderCostFieldLockRecord::getUserId, applyDO.getApplyUserId()) | ||
1204 | + .orderByDesc(OrderCostFieldLockRecord::getId) | ||
1205 | + .last("limit 1")); | ||
1206 | + if (Objects.isNull(recordDO)) { | ||
1207 | + recordDO = OrderCostFieldLockRecord.builder() | ||
1208 | + .orderId(applyDO.getOrderId()) | ||
1209 | + .userId(applyDO.getApplyUserId()) | ||
1210 | + .fields(applyDO.getFields()) | ||
1211 | + .build(); | ||
1212 | + } else { | ||
1213 | + String originFields = recordDO.getFields(); | ||
1214 | + OrderCostInfolockFieldVO originOrderCostInfolockFieldVO = JSONObject.parseObject(originFields, OrderCostInfolockFieldVO.class); | ||
1215 | + String fields = applyDO.getFields(); | ||
1216 | + OrderCostInfolockFieldVO orderCostInfolockFieldVO = JSONObject.parseObject(fields, OrderCostInfolockFieldVO.class); | ||
1217 | + BeanUtil.copyProperties(orderCostInfolockFieldVO, originOrderCostInfolockFieldVO, CopyOptions.create().ignoreNullValue()); | ||
1218 | + recordDO.setFields(JSONObject.toJSONString(originOrderCostInfolockFieldVO)); | ||
1219 | + } | ||
1220 | + if (Objects.isNull(recordDO.getId())) { | ||
1221 | + orderCostFieldLockRecordService.save(recordDO); | ||
1222 | + } else { | ||
1223 | + orderCostFieldLockRecordService.updateById(recordDO); | ||
1224 | + } | ||
1169 | } | 1225 | } |
1170 | 1226 | ||
1171 | OrderAuditLogDO auditLogDO = OrderAuditLogDO.builder().applyId(applyDO.getId()).orderId(applyDO.getOrderId()).optType(ApplyStatusEnum.AUDIT_PASS.getDesc()).build(); | 1227 | OrderAuditLogDO auditLogDO = OrderAuditLogDO.builder().applyId(applyDO.getId()).orderId(applyDO.getOrderId()).optType(ApplyStatusEnum.AUDIT_PASS.getDesc()).build(); |
src/main/java/com/order/erp/service/order/impl/OrderProfitAnalysisServiceImpl.java
@@ -3,30 +3,55 @@ package com.order.erp.service.order.impl; | @@ -3,30 +3,55 @@ package com.order.erp.service.order.impl; | ||
3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
4 | import cn.hutool.core.collection.CollUtil; | 4 | import cn.hutool.core.collection.CollUtil; |
5 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 5 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
6 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
6 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | 7 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
7 | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | 8 | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
9 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 10 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
11 | +import com.fasterxml.jackson.core.JsonProcessingException; | ||
12 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
9 | import com.order.erp.common.constant.Constant; | 13 | import com.order.erp.common.constant.Constant; |
10 | import com.order.erp.common.constant.ServerResult; | 14 | import com.order.erp.common.constant.ServerResult; |
11 | import com.order.erp.common.exception.BusinessException; | 15 | import com.order.erp.common.exception.BusinessException; |
12 | import com.order.erp.common.utils.ProfitUtils; | 16 | import com.order.erp.common.utils.ProfitUtils; |
13 | import com.order.erp.common.utils.StringUtils; | 17 | import com.order.erp.common.utils.StringUtils; |
14 | import com.order.erp.domain.dto.BaseDO; | 18 | import com.order.erp.domain.dto.BaseDO; |
19 | +import com.order.erp.domain.dto.SystemSettingDO; | ||
15 | import com.order.erp.domain.dto.order.OrderBaseInfoDO; | 20 | import com.order.erp.domain.dto.order.OrderBaseInfoDO; |
16 | import com.order.erp.domain.dto.order.OrderProfitAnalysisDO; | 21 | import com.order.erp.domain.dto.order.OrderProfitAnalysisDO; |
22 | +import com.order.erp.domain.dto.order.ProjectBaseInfoDO; | ||
23 | +import com.order.erp.domain.model.OrderCostFieldLockRecord; | ||
24 | +import com.order.erp.domain.model.ProjectFieldLockRecord; | ||
17 | import com.order.erp.domain.vo.OrderProfitAnalysisVo; | 25 | import com.order.erp.domain.vo.OrderProfitAnalysisVo; |
18 | -import com.order.erp.domain.vo.order.OrderProfitAnalysisQueryVO; | ||
19 | -import com.order.erp.domain.vo.order.OrderProfitAnalysisVO; | ||
20 | -import com.order.erp.domain.vo.order.ProfitCalculateVO; | 26 | +import com.order.erp.domain.vo.order.*; |
21 | import com.order.erp.mapper.order.OrderProfitAnalysisMapper; | 27 | import com.order.erp.mapper.order.OrderProfitAnalysisMapper; |
28 | +import com.order.erp.service.IProjectFieldLockRecordService; | ||
29 | +import com.order.erp.service.SystemSettingService; | ||
30 | +import com.order.erp.service.impl.OrderCostFieldLockRecordServiceImpl; | ||
31 | +import com.order.erp.service.order.IProjectBaseInfoService; | ||
22 | import com.order.erp.service.order.OrderBaseInfoService; | 32 | import com.order.erp.service.order.OrderBaseInfoService; |
33 | +import com.order.erp.service.order.OrderFieldLockRecordService; | ||
23 | import com.order.erp.service.order.OrderProfitAnalysisService; | 34 | import com.order.erp.service.order.OrderProfitAnalysisService; |
24 | import lombok.extern.slf4j.Slf4j; | 35 | import lombok.extern.slf4j.Slf4j; |
36 | +import org.apache.poi.ss.usermodel.*; | ||
37 | +import org.apache.poi.ss.util.CellRangeAddress; | ||
38 | +import org.apache.poi.xssf.usermodel.XSSFFont; | ||
39 | +import org.apache.poi.xssf.usermodel.XSSFWorkbook; | ||
25 | import org.springframework.beans.BeanUtils; | 40 | import org.springframework.beans.BeanUtils; |
41 | +import org.springframework.beans.factory.annotation.Autowired; | ||
26 | import org.springframework.stereotype.Service; | 42 | import org.springframework.stereotype.Service; |
27 | 43 | ||
28 | import javax.annotation.Resource; | 44 | import javax.annotation.Resource; |
45 | +import javax.servlet.http.HttpServletResponse; | ||
46 | +import java.io.OutputStream; | ||
29 | import java.math.BigDecimal; | 47 | import java.math.BigDecimal; |
48 | +import java.math.RoundingMode; | ||
49 | +import java.time.Duration; | ||
50 | +import java.time.LocalDateTime; | ||
51 | +import java.time.format.DateTimeFormatter; | ||
52 | +import java.time.temporal.ChronoUnit; | ||
53 | +import java.util.*; | ||
54 | +import java.util.function.Function; | ||
30 | import java.time.LocalDate; | 55 | import java.time.LocalDate; |
31 | import java.util.HashSet; | 56 | import java.util.HashSet; |
32 | import java.util.List; | 57 | import java.util.List; |
@@ -46,6 +71,16 @@ public class OrderProfitAnalysisServiceImpl extends ServiceImpl<OrderProfitAnaly | @@ -46,6 +71,16 @@ public class OrderProfitAnalysisServiceImpl extends ServiceImpl<OrderProfitAnaly | ||
46 | 71 | ||
47 | @Resource | 72 | @Resource |
48 | private OrderBaseInfoService orderBaseInfoService; | 73 | private OrderBaseInfoService orderBaseInfoService; |
74 | + @Autowired | ||
75 | + private SystemSettingService systemSettingService; | ||
76 | + @Autowired | ||
77 | + private IProjectBaseInfoService projectProfitAnalysisService; | ||
78 | + @Autowired | ||
79 | + private IProjectFieldLockRecordService projectionFieldLockRecordService; | ||
80 | + @Resource | ||
81 | + private OrderFieldLockRecordService orderFieldLockRecordService; | ||
82 | + @Autowired | ||
83 | + OrderCostFieldLockRecordServiceImpl orderCostFieldLockRecordService; | ||
49 | 84 | ||
50 | /** | 85 | /** |
51 | * 通过ID查询单条数据 | 86 | * 通过ID查询单条数据 |
@@ -109,6 +144,7 @@ public class OrderProfitAnalysisServiceImpl extends ServiceImpl<OrderProfitAnaly | @@ -109,6 +144,7 @@ public class OrderProfitAnalysisServiceImpl extends ServiceImpl<OrderProfitAnaly | ||
109 | if (Objects.isNull(orderProfitAnalysisVO.getId())) { | 144 | if (Objects.isNull(orderProfitAnalysisVO.getId())) { |
110 | return ServerResult.fail("id 不能为空"); | 145 | return ServerResult.fail("id 不能为空"); |
111 | } | 146 | } |
147 | + orderProfitAnalysisVO.getId(); | ||
112 | OrderProfitAnalysisDO orderProfitAnalysisDo = BeanUtil.copyProperties(orderProfitAnalysisVO, OrderProfitAnalysisDO.class); | 148 | OrderProfitAnalysisDO orderProfitAnalysisDo = BeanUtil.copyProperties(orderProfitAnalysisVO, OrderProfitAnalysisDO.class); |
113 | 149 | ||
114 | updateById(orderProfitAnalysisDo); | 150 | updateById(orderProfitAnalysisDo); |
src/main/java/com/order/erp/service/order/impl/ProjectBaseAfterReviewSettingServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
4 | +import com.order.erp.domain.dto.order.ProjectBaseAfterReviewSettingDO; | ||
5 | +import com.order.erp.mapper.order.ProjectBaseAfterReviewSettingMapper; | ||
6 | +import com.order.erp.service.order.ProjectBaseAfterReviewSettingService; | ||
7 | +import lombok.extern.slf4j.Slf4j; | ||
8 | +import org.springframework.stereotype.Service; | ||
9 | + | ||
10 | +@Slf4j | ||
11 | +@Service | ||
12 | +public class ProjectBaseAfterReviewSettingServiceImpl extends ServiceImpl<ProjectBaseAfterReviewSettingMapper, ProjectBaseAfterReviewSettingDO> implements ProjectBaseAfterReviewSettingService { | ||
13 | +} |
src/main/java/com/order/erp/service/order/impl/ProjectBaseDevelopOptLogServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | ||
2 | + | ||
3 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | ||
5 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
6 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
7 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
8 | +import com.order.erp.common.constant.Constant; | ||
9 | +import com.order.erp.common.constant.ServerResult; | ||
10 | +import com.order.erp.domain.dto.BaseDO; | ||
11 | +import com.order.erp.domain.dto.admin.AdminUserDO; | ||
12 | +import com.order.erp.domain.dto.order.ProjectBaseDevelopOptLogDO; | ||
13 | +import com.order.erp.domain.vo.order.ProjectOptLogQueryVO; | ||
14 | +import com.order.erp.domain.vo.order.ProjectOptLogResultVO; | ||
15 | +import com.order.erp.mapper.order.ProjectBaseDevelopOptLogMapper; | ||
16 | +import com.order.erp.service.admin.AdminUserService; | ||
17 | + | ||
18 | +import com.order.erp.service.order.ProjectBaseDevelopOptLogService; | ||
19 | +import org.springframework.beans.BeanUtils; | ||
20 | +import org.springframework.stereotype.Service; | ||
21 | + | ||
22 | +import javax.annotation.Resource; | ||
23 | +import java.util.*; | ||
24 | +import java.util.function.Function; | ||
25 | +import java.util.stream.Collectors; | ||
26 | + | ||
27 | +@Service | ||
28 | +public class ProjectBaseDevelopOptLogServiceImpl extends ServiceImpl<ProjectBaseDevelopOptLogMapper, ProjectBaseDevelopOptLogDO> implements ProjectBaseDevelopOptLogService { | ||
29 | + @Resource | ||
30 | + private AdminUserService userService; | ||
31 | + | ||
32 | + @Override | ||
33 | + public ServerResult listByPage(ProjectOptLogQueryVO queryVO) { | ||
34 | + LambdaQueryWrapper<ProjectBaseDevelopOptLogDO> queryWrapper = buildQueryByParam(queryVO); | ||
35 | + Page page = new Page<>(queryVO.getPage(), queryVO.getPageSize()); | ||
36 | + IPage<ProjectBaseDevelopOptLogDO> iPage = page(page, queryWrapper); | ||
37 | + | ||
38 | + Page<ProjectOptLogResultVO> webVOPage = new Page<>(); | ||
39 | + List<ProjectBaseDevelopOptLogDO> ProjectDevelopOptLogDOS = iPage.getRecords(); | ||
40 | + if (CollectionUtils.isNotEmpty(ProjectDevelopOptLogDOS)) { | ||
41 | + Set<Long> userIds = ProjectDevelopOptLogDOS.stream().map(ProjectBaseDevelopOptLogDO::getUserId).collect(Collectors.toSet()); | ||
42 | + Map<Long, AdminUserDO> userDOMap = new HashMap<>(); | ||
43 | + if (CollectionUtils.isNotEmpty(userIds)) { | ||
44 | + List<AdminUserDO> userDOS = userService.listByIds(userIds); | ||
45 | + if (CollectionUtils.isNotEmpty(userDOS)) { | ||
46 | + userDOMap = userDOS.stream().collect(Collectors.toMap(AdminUserDO::getId, Function.identity())); | ||
47 | + } | ||
48 | + } | ||
49 | + Map<Long, AdminUserDO> finalUserDOMap = userDOMap; | ||
50 | + List<ProjectOptLogResultVO> resultVOList = ProjectDevelopOptLogDOS.stream().map(x -> { | ||
51 | + ProjectOptLogResultVO resultVO = new ProjectOptLogResultVO(); | ||
52 | + BeanUtils.copyProperties(x, resultVO); | ||
53 | + if (finalUserDOMap.containsKey(x.getUserId())) { | ||
54 | + resultVO.setUserName(finalUserDOMap.get(x.getUserId()).getUserName()); | ||
55 | + } | ||
56 | + return resultVO; | ||
57 | + }).collect(Collectors.toList()); | ||
58 | + | ||
59 | + webVOPage.setRecords(resultVOList); | ||
60 | + } | ||
61 | + BeanUtils.copyProperties(page, webVOPage, "records"); | ||
62 | + return ServerResult.success(webVOPage); | ||
63 | + } | ||
64 | + | ||
65 | + private LambdaQueryWrapper<ProjectBaseDevelopOptLogDO> buildQueryByParam(ProjectOptLogQueryVO queryVO) { | ||
66 | + return new LambdaQueryWrapper<ProjectBaseDevelopOptLogDO>() | ||
67 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
68 | + .eq(Objects.nonNull(queryVO.getProjectNoPrefix()), ProjectBaseDevelopOptLogDO::getProjectNoPrefix, queryVO.getProjectNoPrefix()) | ||
69 | + .eq(Objects.nonNull(queryVO.getType()), ProjectBaseDevelopOptLogDO::getType, queryVO.getType()) | ||
70 | + .orderByDesc(ProjectBaseDevelopOptLogDO::getId); | ||
71 | + } | ||
72 | +} | ||
0 | \ No newline at end of file | 73 | \ No newline at end of file |
src/main/java/com/order/erp/service/order/impl/ProjectBaseInfoServiceImpl.java
0 → 100644
1 | +package com.order.erp.service.order.impl; | ||
2 | + | ||
3 | +import cn.hutool.core.bean.BeanUtil; | ||
4 | +import cn.hutool.core.bean.copier.CopyOptions; | ||
5 | +import cn.hutool.core.collection.CollUtil; | ||
6 | +import com.alibaba.fastjson.JSON; | ||
7 | +import com.alibaba.fastjson.JSONObject; | ||
8 | +import com.alibaba.fastjson.TypeReference; | ||
9 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
10 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
11 | +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||
12 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
13 | +import com.fasterxml.jackson.core.JsonProcessingException; | ||
14 | +import com.fasterxml.jackson.databind.ObjectMapper; | ||
15 | +import com.github.stupdit1t.excel.common.PoiWorkbookType; | ||
16 | +import com.github.stupdit1t.excel.core.ExcelHelper; | ||
17 | +import com.github.stupdit1t.excel.style.CellPosition; | ||
18 | +import com.order.erp.common.constant.Constant; | ||
19 | +import com.order.erp.common.constant.ServerResult; | ||
20 | +import com.order.erp.common.constant.ServerResultCode; | ||
21 | +import com.order.erp.common.exception.BusinessException; | ||
22 | +import com.order.erp.common.utils.TransactionHelper; | ||
23 | +import com.order.erp.config.DataScope; | ||
24 | +import com.order.erp.domain.*; | ||
25 | +import com.order.erp.domain.dto.BaseDO; | ||
26 | +import com.order.erp.domain.dto.SystemSettingDO; | ||
27 | +import com.order.erp.domain.dto.order.*; | ||
28 | +import com.order.erp.domain.model.ProjectApplyDO; | ||
29 | +import com.order.erp.domain.model.ProjectFieldLockRecord; | ||
30 | +import com.order.erp.domain.vo.CostSettingItemVO; | ||
31 | +import com.order.erp.domain.vo.order.*; | ||
32 | +import com.order.erp.mapper.order.ProjectBaseInfoMapper; | ||
33 | +import com.order.erp.service.IProjectFieldLockRecordService; | ||
34 | +import com.order.erp.service.SystemSettingService; | ||
35 | +import com.order.erp.service.impl.ProjectApplyServiceImpl; | ||
36 | +import com.order.erp.service.order.*; | ||
37 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
38 | +import org.apache.commons.lang3.StringUtils; | ||
39 | +import org.apache.poi.ss.usermodel.*; | ||
40 | +import org.apache.poi.ss.util.CellRangeAddress; | ||
41 | +import org.apache.poi.xssf.usermodel.XSSFFont; | ||
42 | +import org.apache.poi.xssf.usermodel.XSSFWorkbook; | ||
43 | +import org.springframework.beans.BeanUtils; | ||
44 | +import org.springframework.beans.factory.annotation.Autowired; | ||
45 | +import org.springframework.stereotype.Service; | ||
46 | +import org.springframework.transaction.annotation.Transactional; | ||
47 | + | ||
48 | +import javax.annotation.Resource; | ||
49 | +import javax.servlet.http.HttpServletResponse; | ||
50 | +import java.io.IOException; | ||
51 | +import java.io.OutputStream; | ||
52 | +import java.math.BigDecimal; | ||
53 | +import java.math.RoundingMode; | ||
54 | +import java.time.Duration; | ||
55 | +import java.time.LocalDateTime; | ||
56 | +import java.time.format.DateTimeFormatter; | ||
57 | +import java.time.temporal.ChronoUnit; | ||
58 | +import java.util.*; | ||
59 | +import java.util.function.Function; | ||
60 | +import java.util.stream.Collectors; | ||
61 | + | ||
62 | +/** | ||
63 | + * <p> | ||
64 | + * 服务实现类 | ||
65 | + * </p> | ||
66 | + * | ||
67 | + * @author author | ||
68 | + * @since 2024-12-18 | ||
69 | + */ | ||
70 | +@Service | ||
71 | +public class ProjectBaseInfoServiceImpl extends ServiceImpl<ProjectBaseInfoMapper, ProjectBaseInfoDO> implements IProjectBaseInfoService { | ||
72 | + @Autowired | ||
73 | + private ProjectApplyServiceImpl projectFieldLockApplyService; | ||
74 | + @Autowired | ||
75 | + private DataScope dataScope; | ||
76 | + @Autowired | ||
77 | + private IProjectFieldLockRecordService projectionFieldLockRecordService; | ||
78 | + @Autowired | ||
79 | + private OrderBaseInfoService orderBaseInfoService; | ||
80 | + @Autowired | ||
81 | + private OrderProfitAnalysisService projectProfitAnalysisService; | ||
82 | + @Autowired | ||
83 | + private SystemSettingService systemSettingService; | ||
84 | + @Autowired | ||
85 | + private ProjectBaseDevelopOptLogService projectBaseDevelopOptLogService; | ||
86 | + @Autowired | ||
87 | + private ProjectBaseAfterReviewSettingService projectBaseAfterReviewSettingService; | ||
88 | + @Resource | ||
89 | + private TransactionHelper transactionHelper; | ||
90 | + | ||
91 | + @Override | ||
92 | + @Transactional(rollbackFor = Exception.class) | ||
93 | + public ServerResult edit(ProjectBaseInfoVO vo) { | ||
94 | + Integer type = null; | ||
95 | + String operationDesc =null; | ||
96 | + String projectNoPrefix = vo.getProjectNoPrefix(); | ||
97 | + Optional<ProjectBaseInfoDO> projectBaseInfoDOOpt = this.lambdaQuery() | ||
98 | + .eq(ProjectBaseInfoDO::getProjectNoPrefix, projectNoPrefix) | ||
99 | + .last(" limit 1 ") | ||
100 | + .oneOpt(); | ||
101 | + ProjectBaseInfoDO oldProjectBaseInfoDO = null; | ||
102 | + ProjectBaseInfoDO projectBaseInfoDO = null; | ||
103 | + boolean isUpdate = projectBaseInfoDOOpt.isPresent(); | ||
104 | + if (isUpdate) { | ||
105 | + projectBaseInfoDO = projectBaseInfoDOOpt.get(); | ||
106 | + oldProjectBaseInfoDO = BeanUtil.copyProperties(projectBaseInfoDOOpt.get(), ProjectBaseInfoDO.class,"id","projectNoPrefix","createTime","createBy","modifyTime","modifyBy","enableFlag"); // 深拷贝 | ||
107 | + BeanUtil.copyProperties(vo, projectBaseInfoDO, CopyOptions.create().setIgnoreProperties("id").ignoreNullValue()); | ||
108 | + } else { | ||
109 | + projectBaseInfoDO = BeanUtil.copyProperties(vo, ProjectBaseInfoDO.class); | ||
110 | + } | ||
111 | + //通过排序取出最新的锁定记录。来重新设置锁定记录。 因为你编辑之后,所以就必须要进行锁定LOCKED。 | ||
112 | + ProjectFieldLockRecord recordDO = projectionFieldLockRecordService.getOne(new LambdaQueryWrapper<ProjectFieldLockRecord>() | ||
113 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
114 | + .eq(ProjectFieldLockRecord::getProjectNoPrefix, projectNoPrefix) | ||
115 | + .eq(ProjectFieldLockRecord::getUserId, dataScope.getLoginUserId()) | ||
116 | + .orderByDesc(ProjectFieldLockRecord::getId) | ||
117 | + .last("limit 1")); | ||
118 | + if (Objects.isNull(recordDO)) { | ||
119 | + recordDO = ProjectFieldLockRecord.builder() | ||
120 | + .projectNoPrefix(projectNoPrefix) | ||
121 | + .userId(dataScope.getLoginUserId()) | ||
122 | + .build(); | ||
123 | + } | ||
124 | + ProjectBaseInfoLockFieldVO recordLockFieldVO = JSONObject.parseObject(Optional.ofNullable(recordDO.getFields()).orElse("{}"), ProjectBaseInfoLockFieldVO.class); | ||
125 | + if (Objects.nonNull(vo.getProjectStartTime())|| | ||
126 | + Objects.nonNull(vo.getProjectEndTime())|| | ||
127 | + Objects.nonNull(vo.getDevelopmentCopyRmbTotalPrice())|| | ||
128 | + Objects.nonNull(vo.getSpainPaidRmbCommission())|| | ||
129 | + Objects.nonNull(vo.getPaidRmbCommission())|| | ||
130 | + Objects.nonNull(vo.getActualExchangeRate())) { | ||
131 | + recordLockFieldVO.setProjectStartTime("LOCKED"); | ||
132 | + recordLockFieldVO.setProjectEndTime("LOCKED"); | ||
133 | + recordLockFieldVO.setDevelopmentCopyRmbTotalPrice("LOCKED"); | ||
134 | + recordLockFieldVO.setSpainPaidRmbCommission("LOCKED"); | ||
135 | + recordLockFieldVO.setPaidRmbCommission("LOCKED"); | ||
136 | + recordLockFieldVO.setActualExchangeRate("LOCKED"); | ||
137 | + type=ProjectOptTypeEnum.BUSINESS_NET_PROFIT_TYPE.getType(); | ||
138 | + operationDesc = isUpdate | ||
139 | + ? OrderOptTypeEnum.PROJECT_DEVELOPMENT_PROFIT_EDIT.getDesc() | ||
140 | + : OrderOptTypeEnum.PROJECT_DEVELOPMENT_PROFIT_ADD.getDesc(); | ||
141 | + /*这里还需要考虑一下,对于状态已经是已审批的状态,但是在编辑数据时没有发生任何改变,也需要重新设置为待审核状态吗?不需要,这里处理一下,对于这种情况就不需要重新设置状态*/ | ||
142 | + if(isUpdate && oldProjectBaseInfoDO.getDevelopmentStatus().equals(ProfitStatusEnum.APPROVED.getStatus()) && | ||
143 | + oldProjectBaseInfoDO.getProjectStartTime().isEqual(vo.getProjectStartTime()) && | ||
144 | + oldProjectBaseInfoDO.getProjectEndTime().isEqual(vo.getProjectEndTime()) && | ||
145 | + oldProjectBaseInfoDO.getDevelopmentCopyRmbTotalPrice().compareTo(vo.getDevelopmentCopyRmbTotalPrice()) == 0 && | ||
146 | + oldProjectBaseInfoDO.getSpainPaidRmbCommission().compareTo(vo.getSpainPaidRmbCommission()) == 0 && | ||
147 | + oldProjectBaseInfoDO.getPaidRmbCommission().compareTo(vo.getPaidRmbCommission()) == 0 && | ||
148 | + //todo 这个实际汇率是否需要,需要讨论。 | ||
149 | + oldProjectBaseInfoDO.getActualExchangeRate().compareTo(vo.getActualExchangeRate()) == 0 | ||
150 | + ){ | ||
151 | + }else{ | ||
152 | + projectBaseInfoDO.setDevelopmentStatus(ProfitStatusEnum.PENDING_APPROVAL.getStatus()); | ||
153 | + } | ||
154 | + } else if (Objects.nonNull(vo.getProjectInnerProfitInfoStartTime()) || Objects.nonNull(vo.getProjectInnerProfitInfoEndTime())) { | ||
155 | + recordLockFieldVO.setProjectInnerProfitInfoStartTime("LOCKED"); | ||
156 | + recordLockFieldVO.setProjectInnerProfitInfoEndTime("LOCKED"); | ||
157 | + type=ProjectOptTypeEnum.INTERNAL_BUSINESS_NET_PROFIT_TYPE.getType(); | ||
158 | + operationDesc = isUpdate | ||
159 | + ? OrderOptTypeEnum.PROJECT_INNER_PRODUCE_EDIT.getDesc() | ||
160 | + : OrderOptTypeEnum.PROJECT_INNER_PRODUCE_ADD.getDesc(); | ||
161 | + if(isUpdate && oldProjectBaseInfoDO.getInnerProductionStatus().equals(ProfitStatusEnum.APPROVED.getStatus()) && | ||
162 | + oldProjectBaseInfoDO.getProjectInnerProfitInfoStartTime().isEqual(vo.getProjectInnerProfitInfoStartTime()) && | ||
163 | + oldProjectBaseInfoDO.getProjectInnerProfitInfoEndTime().isEqual(vo.getProjectInnerProfitInfoEndTime())){ | ||
164 | + }else{ | ||
165 | + projectBaseInfoDO.setInnerProductionStatus(ProfitStatusEnum.PENDING_APPROVAL.getStatus()); | ||
166 | + } | ||
167 | + } | ||
168 | + recordDO.setFields(JSONObject.toJSONString(recordLockFieldVO)); | ||
169 | + if (Objects.isNull(recordDO.getId())) { | ||
170 | + projectionFieldLockRecordService.save(recordDO); | ||
171 | + } else { | ||
172 | + projectionFieldLockRecordService.updateById(recordDO); | ||
173 | + } | ||
174 | + this.saveOrUpdate(projectBaseInfoDO); | ||
175 | + //在这里进行操作记录。 | ||
176 | + ProjectBaseInfoVO projectBaseInfoVO = buildProjectBaseInfoVO(vo, projectBaseInfoDO.getId()); | ||
177 | + ProjectBaseDevelopOptLogDO projectOptLogDO = buildProjectOptLogDo(projectNoPrefix, dataScope.getLoginUserId(),type ,operationDesc,JSONObject.toJSONString(projectBaseInfoVO)); | ||
178 | + return ServerResult.success(projectBaseDevelopOptLogService.save(projectOptLogDO)); | ||
179 | + } | ||
180 | + | ||
181 | + @Override | ||
182 | + public ServerResult applyEditFileds(ProjectBaseInfoLockFieldVO vo) { | ||
183 | + Integer applyType=null; | ||
184 | + List<ProjectApplyDO> applyDOS = projectFieldLockApplyService.list(new LambdaQueryWrapper<ProjectApplyDO>() | ||
185 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
186 | + .eq(ProjectApplyDO::getType, vo.getType()) | ||
187 | + .eq(ProjectApplyDO::getProjectNoPrefix, vo.getProjectNoPrefix()) | ||
188 | + .eq(ProjectApplyDO::getApplyUserId, dataScope.getLoginUserId()) | ||
189 | + .eq(ProjectApplyDO::getStatus, ApplyStatusEnum.WAIT_AUDIT.getStatus())); | ||
190 | + if (CollectionUtils.isNotEmpty(applyDOS)) { | ||
191 | + throw new BusinessException(ServerResultCode.APPLY_UNLOCK_FIELD_EXIST); | ||
192 | + } | ||
193 | + ProjectBaseInfoLockFieldVO projectBaseInfoLockFieldVO = ProjectBaseInfoLockFieldVO.builder() | ||
194 | + .developmentCopyRmbTotalPrice(vo.getDevelopmentCopyRmbTotalPrice()) | ||
195 | + .projectStartTime(vo.getProjectStartTime()) | ||
196 | + .projectEndTime(vo.getProjectEndTime()) | ||
197 | + .spainPaidRmbCommission(vo.getSpainPaidRmbCommission()) | ||
198 | + .paidRmbCommission(vo.getPaidRmbCommission()) | ||
199 | + .actualExchangeRate(vo.getActualExchangeRate()) | ||
200 | + .projectInnerProfitInfoEndTime(vo.getProjectInnerProfitInfoEndTime()) | ||
201 | + .projectInnerProfitInfoStartTime(vo.getProjectInnerProfitInfoStartTime()) | ||
202 | + .build(); | ||
203 | + ProjectApplyDO build = ProjectApplyDO.builder() | ||
204 | + .projectNoPrefix(vo.getProjectNoPrefix()) | ||
205 | + .applyUserId(dataScope.getLoginUserId()) | ||
206 | + .applyRemark(vo.getApplyRemark()) | ||
207 | + .fields(JSONObject.toJSONString(projectBaseInfoLockFieldVO)) | ||
208 | + .type(vo.getType()) | ||
209 | + .status(ApplyStatusEnum.WAIT_AUDIT.getStatus()) | ||
210 | + .build(); | ||
211 | + projectFieldLockApplyService.save(build); | ||
212 | + //进行审批记录的保存。 需要前端在申请字段申请时传递这条数据的id。 | ||
213 | + if(ProjectApplyTypeEnum.FIELD_EDIT_APPLY.name().equals(vo.getType())){ | ||
214 | + applyType=ProjectApplyTypeEnum.FIELD_EDIT_APPLY.getType(); | ||
215 | + }else{ | ||
216 | + applyType=ProjectApplyTypeEnum.INNER_PROFIT_FIELD_EDIT_APPLY.getType(); | ||
217 | + } | ||
218 | + String descByName = ProjectApplyTypeEnum.getDescByName(vo.getType()); | ||
219 | +// ProjectBaseInfoLockFieldVO projectBaseInfoLockFieldVO = buildProjectBaseInfoLockFieldVO(vo); | ||
220 | + projectBaseDevelopOptLogService.save(buildProjectOptLogDo(vo.getProjectNoPrefix(), dataScope.getLoginUserId(),applyType,ProjectApplyTypeEnum.getDescByName(vo.getType()),JSONObject.toJSONString(projectBaseInfoLockFieldVO))); | ||
221 | + return ServerResult.success(); | ||
222 | + } | ||
223 | + | ||
224 | + | ||
225 | + @Override | ||
226 | + public ServerResult pageProjectLockFieldApply(QueryProjectLockFieldVO vo) { | ||
227 | + Page<ProjectApplyDO> page = projectFieldLockApplyService.lambdaQuery() | ||
228 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
229 | + .eq(Objects.nonNull(vo.getType()), ProjectApplyDO::getType, vo.getType()) | ||
230 | + .eq(ProjectApplyDO::getStatus, StringUtils.isBlank(vo.getStatus()) ? ApplyStatusEnum.WAIT_AUDIT.getStatus() : vo.getStatus()) | ||
231 | + .orderByDesc(ProjectApplyDO::getCreateTime) | ||
232 | + .page(new Page<>(vo.getPage(), vo.getPageSize())); | ||
233 | + List<ProjectApplyDO> records = page.getRecords(); | ||
234 | + if (CollectionUtils.isEmpty(records)) { | ||
235 | + return buildPageResult(page, Collections.emptyList()); | ||
236 | + } | ||
237 | + List<ProjectApplyVO> collect = records.stream().map(e -> { | ||
238 | + ProjectApplyVO projectApplyVO = BeanUtil.copyProperties(e, ProjectApplyVO.class); | ||
239 | + return projectApplyVO; | ||
240 | + }).collect(Collectors.toList()); | ||
241 | + return ServerResult.success(buildPageResult(page, collect)); | ||
242 | + } | ||
243 | + | ||
244 | + @Override | ||
245 | + public ServerResult audit(AuditVO vo) { | ||
246 | + ProjectApplyDO applyDO = projectFieldLockApplyService.getById(vo.getId()); | ||
247 | + applyDO.setAuditUserId(dataScope.getLoginUserId()); | ||
248 | + applyDO.setAuditRemark(vo.getRefuseRemark()); | ||
249 | + if (ApplyStatusEnum.AUDIT_PASS.getStatus().equals(vo.getStatus())) { | ||
250 | + applyDO.setStatus(ApplyStatusEnum.AUDIT_PASS.getStatus()); | ||
251 | + ProjectFieldLockRecord recordDO = projectionFieldLockRecordService.getOne(new LambdaQueryWrapper<ProjectFieldLockRecord>() | ||
252 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
253 | + .eq(ProjectFieldLockRecord::getProjectNoPrefix, applyDO.getProjectNoPrefix()) | ||
254 | + .eq(ProjectFieldLockRecord::getUserId, applyDO.getApplyUserId()) | ||
255 | + .orderByDesc(ProjectFieldLockRecord::getId) | ||
256 | + .last("limit 1")); | ||
257 | + if (Objects.isNull(recordDO)) { | ||
258 | + recordDO = ProjectFieldLockRecord.builder() | ||
259 | + .projectNoPrefix(applyDO.getProjectNoPrefix()) | ||
260 | + .userId(applyDO.getApplyUserId()) | ||
261 | + .build(); | ||
262 | + } | ||
263 | + ProjectBaseInfoLockFieldVO applyLockFieldVO = JSONObject.parseObject(applyDO.getFields(), ProjectBaseInfoLockFieldVO.class); | ||
264 | + ProjectBaseInfoLockFieldVO recordLockFieldVO = JSONObject.parseObject(Optional.ofNullable(recordDO.getFields()).orElse("{}"), ProjectBaseInfoLockFieldVO.class); | ||
265 | + if (ProjectApplyTypeEnum.FIELD_EDIT_APPLY.name().equals(applyDO.getType())) { | ||
266 | + ProjectBaseInfoLockFieldVO projectBaseInfoLockFieldVO = Optional.ofNullable(recordLockFieldVO).orElse(new ProjectBaseInfoLockFieldVO()); | ||
267 | + BeanUtil.copyProperties(applyLockFieldVO, projectBaseInfoLockFieldVO, CopyOptions.create().setIgnoreProperties("projectInnerProfitInfoStartTime", "projectInnerProfitInfoEndTime").ignoreNullValue()); | ||
268 | + recordLockFieldVO = projectBaseInfoLockFieldVO; | ||
269 | + } else if (ProjectApplyTypeEnum.INNER_PROFIT_FIELD_EDIT_APPLY.name().equals(applyDO.getType())) { | ||
270 | + recordLockFieldVO.setProjectInnerProfitInfoStartTime(applyLockFieldVO.getProjectInnerProfitInfoStartTime()); | ||
271 | + recordLockFieldVO.setProjectInnerProfitInfoEndTime(applyLockFieldVO.getProjectInnerProfitInfoEndTime()); | ||
272 | + } | ||
273 | + recordDO.setFields(JSONObject.toJSONString(recordLockFieldVO)); | ||
274 | + if (Objects.isNull(recordDO.getId())) { | ||
275 | + projectionFieldLockRecordService.save(recordDO); | ||
276 | + } else { | ||
277 | + projectionFieldLockRecordService.updateById(recordDO); | ||
278 | + } | ||
279 | + } | ||
280 | + projectFieldLockApplyService.updateById(applyDO); | ||
281 | + return ServerResult.success(); | ||
282 | + } | ||
283 | + | ||
284 | + | ||
285 | + @Override | ||
286 | + public ServerResult<Page<InnerProfitInfoVO>> listInnerProfitInfoByPage(OrderBaseInfoQueryVO queryVO) { | ||
287 | + Page<OrderBaseInfoDO> page = pageProjectNo(queryVO); | ||
288 | + List<OrderInfoResultVO> orderInfoResultVOS = getOrderInfoResultVOS(page, queryVO); | ||
289 | + List<InnerProfitInfoVO> innerProfitInfoVOs = buildInnerProfitInfos(orderInfoResultVOS); | ||
290 | + return buildPageResult(page, innerProfitInfoVOs); | ||
291 | + } | ||
292 | + | ||
293 | + @Override | ||
294 | + public ServerResult<Page<BusinessProfitInfoVO>> listBusinessProfitInfoByPage(OrderBaseInfoQueryVO queryVO) { | ||
295 | + Page<OrderBaseInfoDO> page = pageProjectNoPrefix(queryVO); | ||
296 | + List<OrderInfoResultVO> orderInfoResultVOS = getOrderInfoResultVOSByProNoPrefix(page, queryVO); | ||
297 | + List<BusinessProfitInfoVO> businessProfitInfoVOs = buildBusinessProfitInfos(orderInfoResultVOS); | ||
298 | + return buildPageResult(page, businessProfitInfoVOs); | ||
299 | + } | ||
300 | + | ||
301 | + /** | ||
302 | + * 分页查询项目号前8位 | ||
303 | + */ | ||
304 | + private Page<OrderBaseInfoDO> pageProjectNo(OrderBaseInfoQueryVO queryVO) { | ||
305 | + LambdaQueryWrapper<OrderBaseInfoDO> orderBaseInfoDOLambdaQueryWrapper = orderBaseInfoService.buildQueryByParam(queryVO).select(OrderBaseInfoDO::getId); | ||
306 | + return orderBaseInfoService.page(new Page<>(queryVO.getPage(), queryVO.getPageSize()), | ||
307 | + new LambdaQueryWrapper<OrderBaseInfoDO>() | ||
308 | + .select(OrderBaseInfoDO::getProjectNo) | ||
309 | + .func(!orderBaseInfoDOLambdaQueryWrapper.isEmptyOfWhere(), queryWrapper -> { | ||
310 | + List<OrderBaseInfoDO> list = orderBaseInfoService.list(orderBaseInfoDOLambdaQueryWrapper); | ||
311 | + List<Long> ids = list.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toList()); | ||
312 | + if (CollUtil.isNotEmpty(ids)) { | ||
313 | + queryWrapper.in(OrderBaseInfoDO::getId, ids); | ||
314 | + } else { | ||
315 | + queryWrapper.apply("1!=1 "); | ||
316 | + } | ||
317 | + }) | ||
318 | + .groupBy(OrderBaseInfoDO::getProjectNo)); | ||
319 | + } | ||
320 | + | ||
321 | + /** | ||
322 | + * 分页查询项目号前8位 | ||
323 | + */ | ||
324 | + private Page<OrderBaseInfoDO> pageProjectNoPrefix(OrderBaseInfoQueryVO queryVO) { | ||
325 | + LambdaQueryWrapper<OrderBaseInfoDO> orderBaseInfoDOLambdaQueryWrapper = orderBaseInfoService.buildQueryByParam(queryVO).select(OrderBaseInfoDO::getId); | ||
326 | + return orderBaseInfoService.page(new Page<>(queryVO.getPage(), queryVO.getPageSize()), | ||
327 | + new QueryWrapper<OrderBaseInfoDO>() | ||
328 | + .select("LEFT(project_no, 8) as project_no") | ||
329 | + .func(!orderBaseInfoDOLambdaQueryWrapper.isEmptyOfWhere(), queryWrapper -> { | ||
330 | + List<OrderBaseInfoDO> list = orderBaseInfoService.list(orderBaseInfoDOLambdaQueryWrapper); | ||
331 | + List<Long> ids = list.stream().map(OrderBaseInfoDO::getId).collect(Collectors.toList()); | ||
332 | + if (CollUtil.isNotEmpty(ids)) { | ||
333 | + queryWrapper.in("id", ids); | ||
334 | + } else { | ||
335 | + queryWrapper.ne("1", 1); | ||
336 | + } | ||
337 | + }) | ||
338 | + .groupBy("LEFT(project_no, 8)")); | ||
339 | + } | ||
340 | + | ||
341 | + | ||
342 | + /** | ||
343 | + * 查询订单列表 | ||
344 | + */ | ||
345 | + private List<OrderInfoResultVO> getOrderInfoResultVOS(Page<OrderBaseInfoDO> page, OrderBaseInfoQueryVO queryVO) { | ||
346 | + List<String> projectNoPrefix = page.getRecords().stream() | ||
347 | + .map(OrderBaseInfoDO::getProjectNo) | ||
348 | + //.map(x -> x.substring(0, 8)) | ||
349 | + .collect(Collectors.toList()); | ||
350 | + | ||
351 | + List<OrderBaseInfoDO> orderBaseInfoDOS = orderBaseInfoService.list(orderBaseInfoService.buildQueryByParam(queryVO) | ||
352 | + .func(query -> { | ||
353 | + if (CollUtil.isNotEmpty(projectNoPrefix)) { | ||
354 | + query.in(OrderBaseInfoDO::getProjectNo, projectNoPrefix); | ||
355 | + } else { | ||
356 | + query.apply("1!=1"); | ||
357 | + } | ||
358 | + })); | ||
359 | + | ||
360 | + return orderBaseInfoService.wrapperOrderResultList(true, orderBaseInfoDOS); | ||
361 | + } | ||
362 | + | ||
363 | + /** | ||
364 | + * 查询订单列表 | ||
365 | + */ | ||
366 | + private List<OrderInfoResultVO> getOrderInfoResultVOSByProNoPrefix(Page<OrderBaseInfoDO> page, OrderBaseInfoQueryVO queryVO) { | ||
367 | + List<String> projectNoPrefix = page.getRecords().stream() | ||
368 | + .map(OrderBaseInfoDO::getProjectNo) | ||
369 | + .map(x -> x.substring(0, 8)) | ||
370 | + .collect(Collectors.toList()); | ||
371 | + | ||
372 | + List<OrderBaseInfoDO> orderBaseInfoDOS = orderBaseInfoService.list(orderBaseInfoService.buildQueryByParam(queryVO) | ||
373 | + .and(CollUtil.isNotEmpty(projectNoPrefix), query -> { | ||
374 | + for (int i = 0; i < projectNoPrefix.size(); i++) { | ||
375 | + query.likeRight(OrderBaseInfoDO::getProjectNo, projectNoPrefix.get(i)); | ||
376 | + if (i != projectNoPrefix.size() - 1) { | ||
377 | + query.or(); | ||
378 | + } | ||
379 | + } | ||
380 | + })); | ||
381 | + | ||
382 | + return orderBaseInfoService.wrapperOrderResultList(true, orderBaseInfoDOS); | ||
383 | + } | ||
384 | + | ||
385 | + /** | ||
386 | + * 构建分页 | ||
387 | + */ | ||
388 | + private <T> ServerResult buildPageResult(Page<?> page, List<T> records) { | ||
389 | + Page<T> webVOPage = new Page<>(); | ||
390 | + webVOPage.setRecords(records); | ||
391 | + BeanUtils.copyProperties(page, webVOPage, "records"); | ||
392 | + return ServerResult.success(webVOPage); | ||
393 | + } | ||
394 | + | ||
395 | + private List<InnerProfitInfoVO> buildInnerProfitInfos(List<OrderInfoResultVO> orderInfoResultVOS) { | ||
396 | + if (CollUtil.isEmpty(orderInfoResultVOS)) { | ||
397 | + return Collections.emptyList(); | ||
398 | + } | ||
399 | + Map<String, List<OrderInfoResultVO>> orderBaseInfoDOSGroupByProjectNoPre = orderInfoResultVOS.stream() | ||
400 | + .collect(Collectors.groupingBy( | ||
401 | + OrderBaseInfoVO::getProjectNo | ||
402 | + )); | ||
403 | + List<String> projectNoPrefix = orderInfoResultVOS.stream() | ||
404 | + .map(OrderInfoResultVO::getProjectNo) | ||
405 | + //.map(projectNo -> projectNo.substring(0, 8)) | ||
406 | + .distinct() | ||
407 | + .collect(Collectors.toList()); | ||
408 | + List<ProjectBaseInfoDO> list = this.lambdaQuery() | ||
409 | + .func(query -> { | ||
410 | + if (CollUtil.isNotEmpty(projectNoPrefix)) { | ||
411 | + query.in(ProjectBaseInfoDO::getProjectNoPrefix, projectNoPrefix); | ||
412 | + } else { | ||
413 | + query.apply("1!=1"); | ||
414 | + } | ||
415 | + }) | ||
416 | + .list(); | ||
417 | + Map<String, ProjectBaseInfoDO> no2ProjectInfoMap = list.stream().collect(Collectors.toMap(ProjectBaseInfoDO::getProjectNoPrefix, Function.identity())); | ||
418 | + Set<String> collect = orderInfoResultVOS.stream() | ||
419 | + .map(OrderBaseInfoVO::getCustomerCode) | ||
420 | + .collect(Collectors.toSet()); | ||
421 | + List<SystemSettingDO> systemSettingDOS = systemSettingService.lambdaQuery() | ||
422 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
423 | + .eq(SystemSettingDO::getRelationCode, "ProduceSettingItem") | ||
424 | + .in(SystemSettingDO::getSettingValue, collect) | ||
425 | + .list(); | ||
426 | + Map<String, SystemSettingDO> systemSettingDOSMap = systemSettingDOS.stream() | ||
427 | + .collect(Collectors.toMap(SystemSettingDO::getSettingValue, Function.identity(), (x, y) -> x)); | ||
428 | + List<ProjectFieldLockRecord> lockRecords = projectionFieldLockRecordService | ||
429 | + .lambdaQuery() | ||
430 | + .func(query -> { | ||
431 | + Set<String> projectNoPrefixs = list.stream().map(ProjectBaseInfoDO::getProjectNoPrefix).collect(Collectors.toSet()); | ||
432 | + if (CollUtil.isNotEmpty(projectNoPrefixs)) { | ||
433 | + query.in(ProjectFieldLockRecord::getProjectNoPrefix, projectNoPrefixs); | ||
434 | + | ||
435 | + } else { | ||
436 | + query.apply("1!=1"); | ||
437 | + } | ||
438 | + }) | ||
439 | + .list(); | ||
440 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
441 | + Map<String, ProjectBaseInfoLockFieldVO> prjectNo2LockRecordMap = lockRecords.stream() | ||
442 | + .collect(Collectors.toMap(ProjectFieldLockRecord::getProjectNoPrefix, record -> { | ||
443 | + try { | ||
444 | + return objectMapper.readValue(record.getFields(), ProjectBaseInfoLockFieldVO.class); | ||
445 | + } catch (JsonProcessingException e) { | ||
446 | + throw new RuntimeException(e); | ||
447 | + } | ||
448 | + })); | ||
449 | + //查询永久已保存的配置。 | ||
450 | + List<ProjectBaseAfterReviewSettingDO> projectBaseAfterReviewSettingDOS = projectBaseAfterReviewSettingService.list(new LambdaQueryWrapper<ProjectBaseAfterReviewSettingDO>() | ||
451 | + .eq(ProjectBaseAfterReviewSettingDO::getType, ProjectBaseSettingTypeEnum.FIXED_COST_OF_PRODUCTION_DEPARTMENT.getType()) | ||
452 | + .in(ProjectBaseAfterReviewSettingDO::getProjectNoPrefix, orderInfoResultVOS.stream() | ||
453 | + .map(OrderBaseInfoVO::getProjectNo) | ||
454 | + .collect(Collectors.toSet()))); | ||
455 | + Map<String, ProjectBaseAfterReviewSettingDO> projectBaseAfterReviewSettingDOMap = projectBaseAfterReviewSettingDOS | ||
456 | + .stream() | ||
457 | + .collect(Collectors.toMap(ProjectBaseAfterReviewSettingDO::getProjectNoPrefix, Function.identity(), (x, y) -> x)); | ||
458 | + return orderBaseInfoDOSGroupByProjectNoPre.entrySet().stream().map(entry -> { | ||
459 | + ProjectBaseInfoDO projectBaseInfoDO = no2ProjectInfoMap.get(entry.getKey()); | ||
460 | + List<OrderInfoResultVO> details = entry.getValue(); | ||
461 | + ProjectBaseInfoLockFieldVO lockFields = Optional.ofNullable(prjectNo2LockRecordMap.get(entry.getKey())).orElse( | ||
462 | + new ProjectBaseInfoLockFieldVO()); | ||
463 | + if(Objects.isNull(lockFields.getProjectInnerProfitInfoStartTime())){ | ||
464 | + lockFields.setProjectInnerProfitInfoStartTime(Objects.isNull(projectBaseInfoDO) || Objects.isNull(projectBaseInfoDO.getProjectInnerProfitInfoStartTime()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); | ||
465 | + } | ||
466 | + if(Objects.isNull(lockFields.getProjectInnerProfitInfoEndTime())){ | ||
467 | + lockFields.setProjectInnerProfitInfoEndTime(Objects.isNull(projectBaseInfoDO) || Objects.isNull(projectBaseInfoDO.getProjectInnerProfitInfoEndTime()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()); | ||
468 | + } | ||
469 | + InnerProfitInfoVO innerProfitInfoVO = InnerProfitInfoVO.builder() | ||
470 | + .customerCode(details.get(0).getCustomerCode()) | ||
471 | + .projectNoPrefix(entry.getKey()) | ||
472 | + .innerProductionStatus((Objects.isNull(projectBaseInfoDO) || Objects.isNull(projectBaseInfoDO.getInnerProductionStatus())) ? ProfitStatusEnum.Not_COMPLETED.getStatus() : projectBaseInfoDO.getInnerProductionStatus() ) | ||
473 | + .productionDepartment(details.get(0).getProductionDepartment()) | ||
474 | + .lockFields(lockFields) | ||
475 | + .build(); | ||
476 | + | ||
477 | + //数量 | ||
478 | + details.stream() | ||
479 | + .filter(vo -> Objects.nonNull(vo.getOrderCount())) | ||
480 | + .mapToInt(OrderInfoResultVO::getOrderCount) | ||
481 | + .reduce(Integer::sum) | ||
482 | + .ifPresent(innerProfitInfoVO::setOrderCount); | ||
483 | + | ||
484 | + //生产科单价 | ||
485 | + details.stream() | ||
486 | + .map(OrderInfoResultVO::getProfitAnalysisInfo) | ||
487 | + .filter(Objects::nonNull) | ||
488 | + .map(OrderProfitAnalysisVO::getCustomerRmbPrice) | ||
489 | + .filter(Objects::nonNull) | ||
490 | + .map(BigDecimal::valueOf) | ||
491 | + .reduce(BigDecimal::add) | ||
492 | + .ifPresent(price -> { | ||
493 | + innerProfitInfoVO.setProductionDepartmentUnitPrice(price.doubleValue()); | ||
494 | + }); | ||
495 | + | ||
496 | + //生产科总价 | ||
497 | + details.stream() | ||
498 | + .map(OrderInfoResultVO::getProfitAnalysisInfo) | ||
499 | + .filter(Objects::nonNull) | ||
500 | + .map(OrderProfitAnalysisVO::getProductionDepartmentTotalPrice) | ||
501 | + .filter(Objects::nonNull) | ||
502 | + .map(BigDecimal::valueOf) | ||
503 | + .reduce(BigDecimal::add) | ||
504 | + .ifPresent(price -> { | ||
505 | + innerProfitInfoVO.setProductionDepartmentTotalPrice(price.doubleValue()); | ||
506 | + }); | ||
507 | + | ||
508 | + //生产科预算金额 | ||
509 | + details.stream() | ||
510 | + .map(OrderInfoResultVO::getOrderCostInfo) | ||
511 | + .filter(Objects::nonNull) | ||
512 | + .map(OrderCostInfoVO::getProductionDepartmentPredictPrice) | ||
513 | + .filter(Objects::nonNull) | ||
514 | + .reduce(BigDecimal::add) | ||
515 | + .ifPresent(innerProfitInfoVO::setProductionDepartmentPredictPrice); | ||
516 | + //实际发生费用 | ||
517 | + details.stream() | ||
518 | + .map(OrderInfoResultVO::getOrderCostInfo) | ||
519 | + .filter(Objects::nonNull) | ||
520 | + .map(OrderCostInfoVO::getProductionActualPrice) | ||
521 | + .filter(Objects::nonNull) | ||
522 | + .reduce(BigDecimal::add) | ||
523 | + .ifPresent(innerProfitInfoVO::setProductionActualPrice); | ||
524 | + | ||
525 | + if (Objects.nonNull(innerProfitInfoVO.getProductionDepartmentPredictPrice()) | ||
526 | + && Objects.nonNull(innerProfitInfoVO.getProductionActualPrice())) { | ||
527 | + //预算占比=实际发生费用/预算金额 | ||
528 | + innerProfitInfoVO.setPredictRatio(innerProfitInfoVO.getProductionActualPrice().divide(innerProfitInfoVO.getProductionDepartmentPredictPrice(), 4, RoundingMode.HALF_UP)); | ||
529 | + if (innerProfitInfoVO.getProductionDepartmentPredictPrice().compareTo(BigDecimal.ZERO) != 0) { | ||
530 | + //预算占比与实际比占比差:1-预算占比 | ||
531 | + innerProfitInfoVO.setPredictAndActualRatio(new BigDecimal(1).subtract(innerProfitInfoVO.getPredictRatio())); | ||
532 | + } | ||
533 | + } | ||
534 | + | ||
535 | + //事前毛利润 = 生产总额-预算金额 | ||
536 | + if (Objects.nonNull(innerProfitInfoVO.getProductionDepartmentTotalPrice()) | ||
537 | + && Objects.nonNull(innerProfitInfoVO.getProductionDepartmentPredictPrice())) { | ||
538 | + innerProfitInfoVO.setBeforeGrossProfit(BigDecimal.valueOf(innerProfitInfoVO.getProductionDepartmentTotalPrice()).subtract(innerProfitInfoVO.getProductionDepartmentPredictPrice())); | ||
539 | + //事前毛利润率 = 事前毛利/生产科总价 | ||
540 | + if (innerProfitInfoVO.getProductionDepartmentTotalPrice().compareTo(0.0) != 0) { | ||
541 | + innerProfitInfoVO.setBeforeGrossProfitRate(innerProfitInfoVO.getBeforeGrossProfit().divide(BigDecimal.valueOf(innerProfitInfoVO.getProductionDepartmentTotalPrice()), 4, RoundingMode.HALF_UP)); | ||
542 | + } | ||
543 | + } | ||
544 | + //事后毛利率 = 总价-实际发生费用 | ||
545 | + if (Objects.nonNull(innerProfitInfoVO.getProductionDepartmentTotalPrice()) | ||
546 | + && Objects.nonNull(innerProfitInfoVO.getProductionActualPrice())) { | ||
547 | + innerProfitInfoVO.setGrossProfit(BigDecimal.valueOf(innerProfitInfoVO.getProductionDepartmentTotalPrice()).subtract(innerProfitInfoVO.getProductionActualPrice())); | ||
548 | + if (innerProfitInfoVO.getProductionDepartmentTotalPrice().compareTo(0.0) != 0) { | ||
549 | + innerProfitInfoVO.setGrossProfitRate(innerProfitInfoVO.getGrossProfit().divide(BigDecimal.valueOf(innerProfitInfoVO.getProductionDepartmentTotalPrice()), 4, RoundingMode.HALF_UP)); | ||
550 | + } | ||
551 | + } | ||
552 | + | ||
553 | + //hod时间差 | ||
554 | + LocalDateTime earliest = Optional.ofNullable(no2ProjectInfoMap.get(entry.getKey())).map(ProjectBaseInfoDO::getProjectInnerProfitInfoStartTime).orElse(null); | ||
555 | + LocalDateTime latest = Optional.ofNullable(no2ProjectInfoMap.get(entry.getKey())).map(ProjectBaseInfoDO::getProjectInnerProfitInfoEndTime).orElse(null); | ||
556 | + ; | ||
557 | + innerProfitInfoVO.setProduceStartTime(earliest); | ||
558 | + innerProfitInfoVO.setProduceEndTime(latest); | ||
559 | + SystemSettingDO systemSettingDO = systemSettingDOSMap.get(innerProfitInfoVO.getCustomerCode()); | ||
560 | + if (Objects.nonNull(systemSettingDO)) { | ||
561 | + String relationValue = systemSettingDO.getRelationValue(); | ||
562 | + try { | ||
563 | + // 将 JSON 字符串解析为 List<Map<String, String>> | ||
564 | + List<Map<String, String>> relations = objectMapper.readValue(relationValue, objectMapper.getTypeFactory().constructCollectionType(List.class, Map.class)); | ||
565 | + // 提取 fixCost 和 ratio 的 relationValue | ||
566 | + String fixCostValue = null; | ||
567 | + String ratioValue = null; | ||
568 | + | ||
569 | + for (Map<String, String> relation : relations) { | ||
570 | + if ("fixCost".equals(relation.get("relationCode"))) { | ||
571 | + fixCostValue = relation.get("relationValue"); | ||
572 | + } else if ("ratio".equals(relation.get("relationCode"))) { | ||
573 | + ratioValue = relation.get("relationValue"); | ||
574 | + } | ||
575 | + } | ||
576 | + //在这里进行覆盖 | ||
577 | + if(Objects.nonNull(projectBaseAfterReviewSettingDOMap.get(entry.getKey()))){ | ||
578 | + fixCostValue=projectBaseAfterReviewSettingDOMap.get(entry.getKey()).getFixedCost().toString(); | ||
579 | + ratioValue=projectBaseAfterReviewSettingDOMap.get(entry.getKey()).getCommissionUnitPrice().toString(); | ||
580 | + } | ||
581 | + if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(fixCostValue) | ||
582 | + && Objects.nonNull(earliest) | ||
583 | + && Objects.nonNull(latest)) { | ||
584 | + Duration duration = Duration.between(earliest, latest); | ||
585 | + //内部生产固定成本¥ | ||
586 | + innerProfitInfoVO.setInnerProductionFixedCost(BigDecimal.valueOf((duration.toDays() + 1) * Double.parseDouble(fixCostValue))); | ||
587 | + } | ||
588 | + if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(ratioValue) | ||
589 | + && Objects.nonNull(innerProfitInfoVO.getPredictRatio()) | ||
590 | + && innerProfitInfoVO.getPredictRatio().compareTo(BigDecimal.valueOf(1.05)) < 0) { | ||
591 | + //内部生产提成¥ | ||
592 | + String finalRatioValue = ratioValue; | ||
593 | + innerProfitInfoVO.setInnerProductionCommission( | ||
594 | + details.stream() | ||
595 | + .map(detail -> BigDecimal.valueOf(detail.getOrderCount()) | ||
596 | + .multiply(BigDecimal.valueOf(Optional.ofNullable(finalRatioValue).map(Double::valueOf).orElse(0.0)))) | ||
597 | + .reduce(BigDecimal.ZERO, BigDecimal::add) | ||
598 | + ); | ||
599 | + } | ||
600 | + //内部生产净利润 = 总价-实际费用-固定成本-提成 | ||
601 | + if (Objects.nonNull(innerProfitInfoVO.getProductionDepartmentTotalPrice()) | ||
602 | + && Objects.nonNull(innerProfitInfoVO.getProductionActualPrice()) | ||
603 | + && Objects.nonNull(innerProfitInfoVO.getInnerProductionFixedCost()) | ||
604 | + && Objects.nonNull(innerProfitInfoVO.getInnerProductionCommission())) { | ||
605 | + innerProfitInfoVO.setInnerProductionProfit(BigDecimal.valueOf(innerProfitInfoVO.getProductionDepartmentTotalPrice()) | ||
606 | + .subtract(innerProfitInfoVO.getProductionActualPrice()) | ||
607 | + .subtract(innerProfitInfoVO.getInnerProductionFixedCost()) | ||
608 | + .subtract(innerProfitInfoVO.getInnerProductionCommission())); | ||
609 | + } | ||
610 | + //内部生产净利润率 = 净利润/总价 | ||
611 | + if (Objects.nonNull(innerProfitInfoVO.getProductionDepartmentTotalPrice()) | ||
612 | + && Objects.nonNull(innerProfitInfoVO.getInnerProductionProfit())) { | ||
613 | + innerProfitInfoVO.setInnerProductionProfitRate(innerProfitInfoVO.getInnerProductionProfit().divide(BigDecimal.valueOf(innerProfitInfoVO.getProductionDepartmentTotalPrice()), 4, RoundingMode.HALF_UP)); | ||
614 | + } | ||
615 | + } catch (JsonProcessingException e) { | ||
616 | + throw new RuntimeException(e); | ||
617 | + } | ||
618 | + } | ||
619 | + return innerProfitInfoVO; | ||
620 | + }).collect(Collectors.toList()); | ||
621 | + } | ||
622 | + | ||
623 | + private List<BusinessProfitInfoVO> buildBusinessProfitInfos(List<OrderInfoResultVO> orderInfoResultVOS) { | ||
624 | + List<String> projectNoPrefix = orderInfoResultVOS.stream() | ||
625 | + .map(OrderInfoResultVO::getProjectNo) | ||
626 | + .map(projectNo -> projectNo.substring(0, 8)) | ||
627 | + .distinct() | ||
628 | + .collect(Collectors.toList()); | ||
629 | + Map<String, Set<String>> detailProjectNoMap = orderInfoResultVOS.stream() | ||
630 | + .filter(vo -> vo.getProjectNo() != null && vo.getProjectNo().length() >= 8) | ||
631 | + .collect(Collectors.groupingBy( | ||
632 | + vo -> vo.getProjectNo().substring(0, 8), // 按前8位分组 | ||
633 | + Collectors.mapping(OrderInfoResultVO::getProjectNo, Collectors.toSet()) // 提取完整projectNo组成List | ||
634 | + )); | ||
635 | + | ||
636 | + Map<String, List<OrderInfoResultVO>> orderBaseInfoDOSGroupByProjectNoPre = orderInfoResultVOS.stream() | ||
637 | + .collect(Collectors.groupingBy( | ||
638 | + order -> order.getProjectNo().substring(0, 8) | ||
639 | + )); | ||
640 | + List<ProjectBaseInfoDO> list = this.lambdaQuery() | ||
641 | + .func(query -> { | ||
642 | + if (CollUtil.isNotEmpty(projectNoPrefix)) { | ||
643 | + query.in(ProjectBaseInfoDO::getProjectNoPrefix, projectNoPrefix); | ||
644 | + } else { | ||
645 | + query.apply("1!=1"); | ||
646 | + } | ||
647 | + }) | ||
648 | + .list(); | ||
649 | + Map<String, ProjectBaseInfoDO> noPrefix2ProjectProfitAnalysisDOMap = list.stream().collect(Collectors.toMap(ProjectBaseInfoDO::getProjectNoPrefix, Function.identity())); | ||
650 | + Set<String> collect = orderInfoResultVOS.stream() | ||
651 | + .map(OrderBaseInfoVO::getCustomerCode) | ||
652 | + .collect(Collectors.toSet()); | ||
653 | + List<SystemSettingDO> systemSettingDOS = systemSettingService.lambdaQuery() | ||
654 | + .eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
655 | + .eq(SystemSettingDO::getRelationCode, "costSettingItem") | ||
656 | + .func(query -> { | ||
657 | + if (CollUtil.isNotEmpty(collect)) { | ||
658 | + query.in(SystemSettingDO::getSettingValue, collect); | ||
659 | + } else { | ||
660 | + query.apply("1!=1"); | ||
661 | + } | ||
662 | + }) | ||
663 | + .list(); | ||
664 | + Map<String, SystemSettingDO> systemSettingDOSMap = systemSettingDOS.stream() | ||
665 | + .collect(Collectors.toMap(SystemSettingDO::getSettingValue, Function.identity(), (x, y) -> x)); | ||
666 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
667 | + BigDecimal systemExchangeRate = systemSettingService.getExchangeRate(); | ||
668 | + List<ProjectFieldLockRecord> lockRecords = projectionFieldLockRecordService | ||
669 | + .lambdaQuery() | ||
670 | + .func(query -> { | ||
671 | + Set<String> projectNoPrefixs = list.stream().map(ProjectBaseInfoDO::getProjectNoPrefix).collect(Collectors.toSet()); | ||
672 | + if (CollUtil.isNotEmpty(projectNoPrefixs)) { | ||
673 | + query.in(ProjectFieldLockRecord::getProjectNoPrefix, projectNoPrefixs); | ||
674 | + | ||
675 | + } else { | ||
676 | + query.apply("1!=1"); | ||
677 | + } | ||
678 | + }) | ||
679 | + .list(); | ||
680 | + Map<String, ProjectBaseInfoLockFieldVO> prjectNo2LockRecordMap = lockRecords.stream() | ||
681 | + .collect(Collectors.toMap(ProjectFieldLockRecord::getProjectNoPrefix, record -> { | ||
682 | + try { | ||
683 | + return objectMapper.readValue(record.getFields(), ProjectBaseInfoLockFieldVO.class); | ||
684 | + } catch (JsonProcessingException e) { | ||
685 | + throw new RuntimeException(e); | ||
686 | + } | ||
687 | + })); | ||
688 | + BigDecimal exchangeRate = systemSettingService.getExchangeRate(); | ||
689 | + //查询永久已保存的配置。 | ||
690 | + List<ProjectBaseAfterReviewSettingDO> projectBaseAfterReviewSettingDOS = projectBaseAfterReviewSettingService.list(new LambdaQueryWrapper<ProjectBaseAfterReviewSettingDO>() | ||
691 | + .eq(ProjectBaseAfterReviewSettingDO::getType, ProjectBaseSettingTypeEnum.COMMISSION_COST.getType()) | ||
692 | + .in(ProjectBaseAfterReviewSettingDO::getProjectNoPrefix,projectNoPrefix)); | ||
693 | + Map<String, ProjectBaseAfterReviewSettingDO> projectBaseAfterReviewSettingDOMap = projectBaseAfterReviewSettingDOS.stream().collect(Collectors.toMap(ProjectBaseAfterReviewSettingDO::getProjectNoPrefix, Function.identity(), (x, y) -> x)); | ||
694 | + return orderBaseInfoDOSGroupByProjectNoPre.entrySet().stream().map(entry -> { | ||
695 | + List<OrderInfoResultVO> details = entry.getValue(); | ||
696 | + ProjectBaseInfoDO projectBaseInfoDO = noPrefix2ProjectProfitAnalysisDOMap.get(entry.getKey()); | ||
697 | + BusinessProfitInfoVO businessProfitInfoVO = BusinessProfitInfoVO.builder() | ||
698 | + .customerCode(details.get(0).getCustomerCode()) | ||
699 | + .projectNoPrefix(entry.getKey()) | ||
700 | + //设置完整的项目号,用于后面需要那这个完整的项目号传递值由前段给后端,因为没有id,所以无法直接知道是哪一条数据,所以需要具体的完整项目号。 | ||
701 | + .detailProjectNo(detailProjectNoMap.get(entry.getKey())) | ||
702 | + //返回状态。 | ||
703 | + .developmentStatus((Objects.isNull(projectBaseInfoDO) || Objects.isNull(projectBaseInfoDO.getDevelopmentStatus())) ? ProfitStatusEnum.Not_COMPLETED.getStatus() : projectBaseInfoDO.getDevelopmentStatus()) | ||
704 | + .lockFields(Optional.ofNullable(prjectNo2LockRecordMap.get(entry.getKey())).orElse(ProjectBaseInfoLockFieldVO.builder() | ||
705 | + .actualExchangeRate(Objects.isNull(projectBaseInfoDO) || Objects.isNull(projectBaseInfoDO.getActualExchangeRate()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()) | ||
706 | + .developmentCopyRmbTotalPrice(Objects.isNull(projectBaseInfoDO) || Objects.isNull(projectBaseInfoDO.getDevelopmentCopyRmbTotalPrice()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()) | ||
707 | + .paidRmbCommission(Objects.isNull(projectBaseInfoDO) || Objects.isNull(projectBaseInfoDO.getPaidRmbCommission()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()) | ||
708 | + .projectEndTime(Objects.isNull(projectBaseInfoDO) || Objects.isNull(projectBaseInfoDO.getProjectEndTime()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()) | ||
709 | + .projectStartTime(Objects.isNull(projectBaseInfoDO) || Objects.isNull(projectBaseInfoDO.getProjectStartTime()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()) | ||
710 | + .spainPaidRmbCommission(Objects.isNull(projectBaseInfoDO) || Objects.isNull(projectBaseInfoDO.getSpainPaidRmbCommission()) ? OrderLockFieldEnum.UN_LOCKED.name() : OrderLockFieldEnum.LOCKED.name()) | ||
711 | + .build())) | ||
712 | + .build(); | ||
713 | + | ||
714 | + //客户总金额¥ | ||
715 | + details.stream() | ||
716 | + .map(OrderInfoResultVO::getProfitAnalysisInfo) | ||
717 | + .filter(Objects::nonNull) | ||
718 | + .map(OrderProfitAnalysisVO::getCustomerRmbTotalPrice) | ||
719 | + .filter(Objects::nonNull) | ||
720 | + .map(BigDecimal::valueOf) | ||
721 | + .reduce(BigDecimal::add) | ||
722 | + .ifPresent(price -> businessProfitInfoVO.setCustomerRmbTotalPrice(price.doubleValue())); | ||
723 | + | ||
724 | + //客户总金额$ | ||
725 | + details.stream() | ||
726 | + .map(OrderInfoResultVO::getProfitAnalysisInfo) | ||
727 | + .filter(Objects::nonNull) | ||
728 | + .map(OrderProfitAnalysisVO::getCustomerTotalPrice) | ||
729 | + .filter(Objects::nonNull) | ||
730 | + .map(BigDecimal::valueOf) | ||
731 | + .reduce(BigDecimal::add) | ||
732 | + .ifPresent(price -> businessProfitInfoVO.setCustomerTotalPrice(price.doubleValue())); | ||
733 | + | ||
734 | + //生产科总价¥ | ||
735 | + details.stream() | ||
736 | + .map(OrderInfoResultVO::getProfitAnalysisInfo) | ||
737 | + .filter(Objects::nonNull) | ||
738 | + .map(OrderProfitAnalysisVO::getProductionDepartmentTotalPrice) | ||
739 | + .filter(Objects::nonNull) | ||
740 | + .map(BigDecimal::valueOf) | ||
741 | + .reduce(BigDecimal::add) | ||
742 | + .ifPresent(price -> businessProfitInfoVO.setProductionDepartmentTotalPrice(price.doubleValue())); | ||
743 | + | ||
744 | + //包装费用合计$ | ||
745 | + details.stream() | ||
746 | + .map(OrderInfoResultVO::getProfitAnalysisInfo) | ||
747 | + .filter(Objects::nonNull) | ||
748 | + .map(OrderProfitAnalysisVO::getPacketTotalPrice) | ||
749 | + .filter(Objects::nonNull) | ||
750 | + .map(BigDecimal::valueOf) | ||
751 | + .reduce(BigDecimal::add) | ||
752 | + .ifPresent(price -> businessProfitInfoVO.setPacketTotalPrice(price.doubleValue())); | ||
753 | + | ||
754 | + //包装费用合计¥ | ||
755 | + businessProfitInfoVO.setPacketRmbTotalPrice(Optional.ofNullable(businessProfitInfoVO.getPacketTotalPrice()) | ||
756 | + .orElse(0.0) * exchangeRate.doubleValue()); | ||
757 | + //包装费用实际金额 | ||
758 | + details.stream() | ||
759 | + .map(OrderInfoResultVO::getOrderCostInfo) | ||
760 | + .filter(Objects::nonNull) | ||
761 | + .map(OrderCostInfoVO::getPacketActualRmbTotalPrice) | ||
762 | + .filter(Objects::nonNull) | ||
763 | + .reduce(BigDecimal::add) | ||
764 | + .ifPresent(packetActualRmbTotalPrice -> { | ||
765 | + businessProfitInfoVO.setPacketActualRmbTotalPrice(packetActualRmbTotalPrice.setScale(2, RoundingMode.HALF_UP)); | ||
766 | + }); | ||
767 | + //订单数 | ||
768 | + details.stream() | ||
769 | + .mapToInt(OrderInfoResultVO::getOrderCount) | ||
770 | + .filter(Objects::nonNull) | ||
771 | + .reduce(Integer::sum) | ||
772 | + .ifPresent(businessProfitInfoVO::setOrderCount); | ||
773 | + if (Objects.nonNull(businessProfitInfoVO.getOrderCount()) | ||
774 | + && Objects.nonNull(businessProfitInfoVO.getPacketActualRmbTotalPrice()) | ||
775 | + ) { | ||
776 | + //实际跟单单价 | ||
777 | + businessProfitInfoVO.setActualOrderRmbPrice(businessProfitInfoVO.getPacketActualRmbTotalPrice().divide(new BigDecimal(businessProfitInfoVO.getOrderCount()), 4, RoundingMode.HALF_UP)); | ||
778 | + //折换成美金 | ||
779 | + businessProfitInfoVO.setActualOrderPrice(businessProfitInfoVO.getActualOrderRmbPrice().divide(exchangeRate, 4, RoundingMode.HALF_UP)); | ||
780 | + } | ||
781 | + if (Objects.nonNull(businessProfitInfoVO.getPacketActualRmbTotalPrice()) | ||
782 | + && Objects.nonNull(businessProfitInfoVO.getPacketRmbTotalPrice())) { | ||
783 | + //包装费用收益¥ | ||
784 | + businessProfitInfoVO.setPacketProfitRmbPrice(BigDecimal.valueOf(businessProfitInfoVO.getPacketRmbTotalPrice()) | ||
785 | + .subtract(businessProfitInfoVO.getPacketActualRmbTotalPrice()).setScale(2, RoundingMode.HALF_UP)); | ||
786 | + } | ||
787 | + | ||
788 | + //hod时间差 | ||
789 | + LocalDateTime earliest = details.stream() | ||
790 | + .map(OrderInfoResultVO::getCreateTime) | ||
791 | + .min(Comparator.naturalOrder()) | ||
792 | + .orElse(null); | ||
793 | + LocalDateTime latest = details.stream() | ||
794 | + .map(OrderInfoResultVO::getOrderHodTime) | ||
795 | + .map(hodTime -> LocalDateTime.parse(hodTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))) | ||
796 | + .max(Comparator.naturalOrder()) | ||
797 | + .orElse(null); | ||
798 | + businessProfitInfoVO.setProduceStartTime(earliest); | ||
799 | + businessProfitInfoVO.setProduceEndTime(latest); | ||
800 | + //研发复制费合计¥ 固定成本¥ 西班牙已发提成¥ 已发提成¥ 实际汇率¥ | ||
801 | + if (Objects.nonNull(noPrefix2ProjectProfitAnalysisDOMap.get(entry.getKey()))) { | ||
802 | + //研发复制费用 | ||
803 | + businessProfitInfoVO.setDevelopmentCopyRmbTotalPrice(projectBaseInfoDO.getDevelopmentCopyRmbTotalPrice()); | ||
804 | + //西班牙已付提成 | ||
805 | + businessProfitInfoVO.setSpainPaidRmbCommission(projectBaseInfoDO.getSpainPaidRmbCommission()); | ||
806 | + //已付提成 | ||
807 | + businessProfitInfoVO.setPaidRmbCommission(projectBaseInfoDO.getPaidRmbCommission()); | ||
808 | + //实际汇率 | ||
809 | + businessProfitInfoVO.setActualExchangeRate(projectBaseInfoDO.getActualExchangeRate()); | ||
810 | + //项目开始时间 | ||
811 | + businessProfitInfoVO.setProjectStartTime(projectBaseInfoDO.getProjectStartTime()); | ||
812 | + //项目结束时间 | ||
813 | + businessProfitInfoVO.setProjectEndTime(projectBaseInfoDO.getProjectEndTime()); | ||
814 | + //生产开始时间 | ||
815 | + if (Objects.nonNull(projectBaseInfoDO.getProjectStartTime()) | ||
816 | + && Objects.nonNull(projectBaseInfoDO.getProjectEndTime()) | ||
817 | + && Objects.nonNull(systemSettingDOSMap.get(details.get(0).getCustomerCode()))) { | ||
818 | + | ||
819 | + //获取固定成本、提成比率、西班牙提成比例 | ||
820 | + long between = ChronoUnit.DAYS.between(projectBaseInfoDO.getProjectStartTime(), projectBaseInfoDO.getProjectEndTime()); | ||
821 | + SystemSettingDO systemSettingDO = systemSettingDOSMap.get(details.get(0).getCustomerCode()); | ||
822 | + String relationValue = systemSettingDO.getRelationValue(); | ||
823 | + List<Map<String, String>> relations = null; | ||
824 | + try { | ||
825 | + relations = objectMapper.readValue(relationValue, objectMapper.getTypeFactory().constructCollectionType(List.class, Map.class)); | ||
826 | + } catch (JsonProcessingException e) { | ||
827 | + throw new RuntimeException(e); | ||
828 | + } | ||
829 | + String fixCostValue = null; | ||
830 | + String ratio = null; | ||
831 | + String spainRatio = null; | ||
832 | + for (Map<String, String> relation : relations) { | ||
833 | + if ("fixCost".equals(relation.get("relationCode"))) { | ||
834 | + fixCostValue = relation.get("relationValue"); | ||
835 | + } else if ("ratio".equals(relation.get("relationCode"))) { | ||
836 | + ratio = relation.get("relationValue"); | ||
837 | + } else if ("spainRatio".equals(relation.get("relationCode"))) { | ||
838 | + spainRatio = relation.get("relationValue"); | ||
839 | + } | ||
840 | + } | ||
841 | + //在这里进行判断,能够对上述的配置进行覆盖,如果永久已保存的配置中包含这个项目号的数据,则采用永久已保存的配置中,否则采用当前配置(对于已审核的数据,如果采用当前配置肯定会出错。)。 | ||
842 | + if(Objects.nonNull(projectBaseAfterReviewSettingDOMap.get(entry.getKey()))){ | ||
843 | + fixCostValue=projectBaseAfterReviewSettingDOMap.get(entry.getKey()).getFixedCost().toString(); | ||
844 | + ratio=projectBaseAfterReviewSettingDOMap.get(entry.getKey()).getCommissionRate().toString(); | ||
845 | + spainRatio=projectBaseAfterReviewSettingDOMap.get(entry.getKey()).getSpainCommissionRate().toString(); | ||
846 | + } | ||
847 | + //固定成本 | ||
848 | + businessProfitInfoVO.setFixedCost(BigDecimal.valueOf((between + 1) * Double.parseDouble(fixCostValue)).setScale(2, RoundingMode.HALF_UP)); | ||
849 | + if (Objects.nonNull(spainRatio) | ||
850 | + && Objects.nonNull(businessProfitInfoVO.getCustomerRmbTotalPrice())) { | ||
851 | + //西班牙提成 | ||
852 | + businessProfitInfoVO.setSpainRmbCommission(BigDecimal.valueOf(businessProfitInfoVO.getCustomerRmbTotalPrice()).multiply(BigDecimal.valueOf(Double.parseDouble(spainRatio))).setScale(2, RoundingMode.HALF_UP)); | ||
853 | + } | ||
854 | + if (Objects.nonNull(businessProfitInfoVO.getSpainRmbCommission()) | ||
855 | + && Objects.nonNull(projectBaseInfoDO.getSpainPaidRmbCommission())) { | ||
856 | + //西班牙未发提成 | ||
857 | + businessProfitInfoVO.setSpainUnpaidRmbCommission(businessProfitInfoVO.getSpainRmbCommission().subtract(projectBaseInfoDO.getSpainPaidRmbCommission()).setScale(2, RoundingMode.HALF_UP)); | ||
858 | + } | ||
859 | + | ||
860 | + if (Objects.nonNull(ratio) | ||
861 | + && Objects.nonNull(businessProfitInfoVO.getCustomerRmbTotalPrice())) { | ||
862 | + //中国团队提成 | ||
863 | + businessProfitInfoVO.setRmbCommission(BigDecimal.valueOf(businessProfitInfoVO.getCustomerRmbTotalPrice()).multiply(BigDecimal.valueOf(Double.parseDouble(ratio))).setScale(2, RoundingMode.HALF_UP)); | ||
864 | + } | ||
865 | + if (Objects.nonNull(businessProfitInfoVO.getRmbCommission()) | ||
866 | + && Objects.nonNull(projectBaseInfoDO.getPaidRmbCommission())) { | ||
867 | + //未发提成 | ||
868 | + businessProfitInfoVO.setUnpaidRmbCommission(businessProfitInfoVO.getRmbCommission().subtract(projectBaseInfoDO.getPaidRmbCommission()).setScale(2, RoundingMode.HALF_UP)); | ||
869 | + } | ||
870 | + } | ||
871 | + if (Objects.nonNull(businessProfitInfoVO.getActualExchangeRate()) | ||
872 | + && Objects.nonNull(businessProfitInfoVO.getCustomerTotalPrice())) { | ||
873 | + businessProfitInfoVO.setExchangeRateProfit(BigDecimal.valueOf(businessProfitInfoVO.getCustomerTotalPrice()) | ||
874 | + .multiply(businessProfitInfoVO.getActualExchangeRate().subtract(systemExchangeRate))); | ||
875 | + } | ||
876 | + } | ||
877 | + //支出合计 | ||
878 | + businessProfitInfoVO.setRmbTotalExpense(Optional.ofNullable(businessProfitInfoVO.getSpainPaidRmbCommission()).orElse(BigDecimal.ZERO) | ||
879 | + .add(Optional.ofNullable(businessProfitInfoVO.getPaidRmbCommission()).orElse(BigDecimal.ZERO)) | ||
880 | + .add(Optional.ofNullable(businessProfitInfoVO.getFixedCost()).orElse(BigDecimal.ZERO)) | ||
881 | + .add(Optional.ofNullable(businessProfitInfoVO.getDevelopmentCopyRmbTotalPrice()).orElse(BigDecimal.ZERO)) | ||
882 | + .add(BigDecimal.valueOf(Optional.ofNullable(businessProfitInfoVO.getPacketRmbTotalPrice()).orElse(0.0))) | ||
883 | + .add(BigDecimal.valueOf(Optional.ofNullable(businessProfitInfoVO.getProductionDepartmentTotalPrice()).orElse(0.0))).setScale(2, RoundingMode.HALF_UP)); | ||
884 | + if (Objects.nonNull(businessProfitInfoVO.getCustomerRmbTotalPrice()) | ||
885 | + && Objects.nonNull(businessProfitInfoVO.getProductionDepartmentTotalPrice()) | ||
886 | + && Objects.nonNull(businessProfitInfoVO.getPacketRmbTotalPrice())) { | ||
887 | + //毛利润 | ||
888 | + businessProfitInfoVO.setProfit(BigDecimal.valueOf(businessProfitInfoVO.getCustomerRmbTotalPrice()) | ||
889 | + .subtract(BigDecimal.valueOf(businessProfitInfoVO.getProductionDepartmentTotalPrice())) | ||
890 | + .subtract(BigDecimal.valueOf(businessProfitInfoVO.getPacketRmbTotalPrice()))); | ||
891 | + } | ||
892 | + if (Objects.nonNull(businessProfitInfoVO.getProfit()) | ||
893 | + && Objects.nonNull(businessProfitInfoVO.getCustomerRmbTotalPrice())) { | ||
894 | + //毛利润率 | ||
895 | + businessProfitInfoVO.setProfitRate(businessProfitInfoVO.getProfit() | ||
896 | + .divide(BigDecimal.valueOf(businessProfitInfoVO.getCustomerRmbTotalPrice()), 4, RoundingMode.HALF_UP)); | ||
897 | + } | ||
898 | + if (Objects.nonNull(businessProfitInfoVO.getCustomerRmbTotalPrice()) | ||
899 | + && Objects.nonNull(businessProfitInfoVO.getRmbTotalExpense())) { | ||
900 | + //研发贸易净利润 | ||
901 | + businessProfitInfoVO.setDevelopmentProfit(BigDecimal.valueOf(businessProfitInfoVO.getCustomerRmbTotalPrice()) | ||
902 | + .subtract(businessProfitInfoVO.getRmbTotalExpense().setScale(2, RoundingMode.HALF_UP)) | ||
903 | + ); | ||
904 | + //研发贸易净利润率 | ||
905 | + businessProfitInfoVO.setDevelopmentProfitRate(businessProfitInfoVO.getDevelopmentProfit() | ||
906 | + .divide(BigDecimal.valueOf(businessProfitInfoVO.getCustomerRmbTotalPrice()), 4, RoundingMode.HALF_UP)); | ||
907 | + } | ||
908 | + //综合收益 | ||
909 | + businessProfitInfoVO.setComprehensiveProfit(Optional.ofNullable(businessProfitInfoVO.getDevelopmentProfit()).orElse(BigDecimal.ZERO) | ||
910 | + //综合收益不需要汇率收益计算。 | ||
911 | +// .add(Optional.ofNullable(businessProfitInfoVO.getExchangeRateProfit()).orElse(BigDecimal.ZERO)) | ||
912 | + .add(Optional.ofNullable(businessProfitInfoVO.getActualOrderRmbPrice()).orElse(BigDecimal.ZERO)).setScale(2, RoundingMode.HALF_UP)); | ||
913 | + return businessProfitInfoVO; | ||
914 | + }).collect(Collectors.toList()); | ||
915 | + } | ||
916 | + | ||
917 | + @Override | ||
918 | + public void exportBusinessProfitInfo(HttpServletResponse response, String projectNoPrefix) throws Exception { | ||
919 | + ServerResult serverResult = listBusinessProfitInfoByPage(OrderBaseInfoQueryVO.builder().page(1).pageSize(1).projectNoLikeRight(projectNoPrefix).build()); | ||
920 | + Page<BusinessProfitInfoVO> page = (Page<BusinessProfitInfoVO>) serverResult.getData(); | ||
921 | + List<BusinessProfitInfoVO> orderInfoResultVOS = page.getRecords(); | ||
922 | + BusinessProfitInfoVO businessProfitInfoVO = orderInfoResultVOS.get(0); | ||
923 | + exportBusinessProfitExcel(response, businessProfitInfoVO); | ||
924 | + } | ||
925 | + | ||
926 | + public void exportBusinessProfitExcel(HttpServletResponse response, BusinessProfitInfoVO businessProfitInfoVO) throws Exception { | ||
927 | + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); | ||
928 | + XSSFWorkbook workbook = new XSSFWorkbook(); | ||
929 | + Sheet sheet = workbook.createSheet("业务净利润分析"); | ||
930 | + | ||
931 | + // 设置默认列宽 | ||
932 | + sheet.setDefaultColumnWidth(10); | ||
933 | + | ||
934 | + // 创建字体和样式 | ||
935 | + XSSFFont font = workbook.createFont(); | ||
936 | + font.setFontName("Arial"); | ||
937 | + font.setFontHeightInPoints((short) 10); | ||
938 | + | ||
939 | + CellStyle cellStyle = workbook.createCellStyle(); | ||
940 | + cellStyle.setAlignment(HorizontalAlignment.CENTER); | ||
941 | + cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); | ||
942 | + cellStyle.setFont(font); | ||
943 | + cellStyle.setWrapText(true); | ||
944 | + | ||
945 | + | ||
946 | + createMergedRow(sheet, cellStyle, 0, 3, 0, 9, "业务净利润分析表"); | ||
947 | + createMergedRow(sheet, cellStyle, 4, 5, 0, 1, "项目号"); | ||
948 | + createMergedRow(sheet, cellStyle, 4, 5, 2, 4, Optional.ofNullable(businessProfitInfoVO.getProjectNoPrefix()).orElse("-")); | ||
949 | + createMergedRow(sheet, cellStyle, 4, 5, 5, 6, "开始时间"); | ||
950 | + createMergedRow(sheet, cellStyle, 4, 5, 7, 9, "结束时间"); | ||
951 | + createMergedRow(sheet, cellStyle, 6, 7, 0, 1, ""); | ||
952 | + createMergedRow(sheet, cellStyle, 6, 7, 2, 4, "项目开始时间"); | ||
953 | + createMergedRow(sheet, cellStyle, 6, 7, 5, 6, Optional.ofNullable(dateTimeFormatter.format(businessProfitInfoVO.getProjectStartTime())).orElse("-")); | ||
954 | + createMergedRow(sheet, cellStyle, 6, 7, 7, 9, Optional.ofNullable(dateTimeFormatter.format(businessProfitInfoVO.getProjectEndTime())).orElse("-")); | ||
955 | + createMergedRow(sheet, cellStyle, 8, 9, 0, 1, ""); | ||
956 | + createMergedRow(sheet, cellStyle, 8, 9, 2, 4, "生产进行时间"); | ||
957 | + createMergedRow(sheet, cellStyle, 8, 9, 5, 6, Optional.ofNullable(dateTimeFormatter.format(businessProfitInfoVO.getProduceStartTime())).orElse("-")); | ||
958 | + createMergedRow(sheet, cellStyle, 8, 9, 7, 9, Optional.ofNullable(dateTimeFormatter.format(businessProfitInfoVO.getProduceEndTime())).orElse("-")); | ||
959 | + createMergedRow(sheet, cellStyle, 10, 11, 0, 1, "客户编码"); | ||
960 | + createMergedRow(sheet, cellStyle, 10, 11, 2, 4, Optional.ofNullable(businessProfitInfoVO.getCustomerCode()).orElse("-")); | ||
961 | + createMergedRow(sheet, cellStyle, 10, 11, 5, 6, ""); | ||
962 | + createMergedRow(sheet, cellStyle, 10, 11, 7, 9, "备注"); | ||
963 | + createMergedRow(sheet, cellStyle, 12, 13, 0, 4, "客户总金额计算"); | ||
964 | + createMergedRow(sheet, cellStyle, 12, 13, 5, 6, Optional.ofNullable(businessProfitInfoVO.getCustomerRmbTotalPrice()).map(price -> "¥" + price).orElse("-")); | ||
965 | + createMergedRow(sheet, cellStyle, 12, 13, 7, 9, Optional.ofNullable(businessProfitInfoVO.getCustomerTotalPrice()).map(price -> "$" + price).orElse("-")); | ||
966 | + createMergedRow(sheet, cellStyle, 14, 15, 0, 4, "生产科总价合计"); | ||
967 | + createMergedRow(sheet, cellStyle, 14, 15, 5, 6, Optional.ofNullable(businessProfitInfoVO.getProductionDepartmentTotalPrice()).map(price -> "¥" + price).orElse("-")); | ||
968 | + createMergedRow(sheet, cellStyle, 14, 15, 7, 9, ""); | ||
969 | + createMergedRow(sheet, cellStyle, 16, 17, 0, 4, "包装费用合计"); | ||
970 | + createMergedRow(sheet, cellStyle, 16, 17, 5, 6, Optional.ofNullable(businessProfitInfoVO.getPacketRmbTotalPrice()).map(price -> "¥" + price).orElse("-")); | ||
971 | + createMergedRow(sheet, cellStyle, 16, 17, 7, 9, Optional.ofNullable(businessProfitInfoVO.getPacketTotalPrice()).map(price -> "$" + price).orElse("-")); | ||
972 | + createMergedRow(sheet, cellStyle, 18, 19, 0, 4, "研发复制费合计"); | ||
973 | + createMergedRow(sheet, cellStyle, 18, 19, 5, 6, Optional.ofNullable(businessProfitInfoVO.getDevelopmentCopyRmbTotalPrice()).map(price -> "¥" + price).orElse("-")); | ||
974 | + createMergedRow(sheet, cellStyle, 18, 19, 7, 9, ""); | ||
975 | + createMergedRow(sheet, cellStyle, 20, 21, 0, 4, "固定成本"); | ||
976 | + createMergedRow(sheet, cellStyle, 20, 21, 5, 6, Optional.ofNullable(businessProfitInfoVO.getFixedCost()).map(price -> "¥" + price).orElse("-")); | ||
977 | + createMergedRow(sheet, cellStyle, 20, 21, 7, 9, ""); | ||
978 | + createMergedRow(sheet, cellStyle, 22, 23, 0, 4, "西班牙提成"); | ||
979 | + createMergedRow(sheet, cellStyle, 22, 23, 5, 6, Optional.ofNullable(businessProfitInfoVO.getSpainRmbCommission()).map(price -> "¥" + price).orElse("-")); | ||
980 | + createMergedRow(sheet, cellStyle, 22, 23, 7, 9, ""); | ||
981 | + createMergedRow(sheet, cellStyle, 24, 25, 0, 4, "中国团队提成"); | ||
982 | + createMergedRow(sheet, cellStyle, 24, 25, 5, 6, Optional.ofNullable(businessProfitInfoVO.getRmbCommission()).map(price -> "¥" + price).orElse("-")); | ||
983 | + createMergedRow(sheet, cellStyle, 24, 25, 7, 9, ""); | ||
984 | + createMergedRow(sheet, cellStyle, 26, 27, 0, 4, "支出合计"); | ||
985 | + createMergedRow(sheet, cellStyle, 26, 27, 5, 6, Optional.ofNullable(businessProfitInfoVO.getRmbTotalExpense()).map(price -> "¥" + price).orElse("-")); | ||
986 | + createMergedRow(sheet, cellStyle, 26, 27, 7, 9, ""); | ||
987 | + createMergedRow(sheet, cellStyle, 28, 29, 0, 4, "毛利润"); | ||
988 | + createMergedRow(sheet, cellStyle, 28, 29, 5, 6, Optional.ofNullable(businessProfitInfoVO.getProfit()).map(price -> "¥" + price).orElse("-")); | ||
989 | + createMergedRow(sheet, cellStyle, 28, 29, 7, 9, ""); | ||
990 | + createMergedRow(sheet, cellStyle, 30, 31, 0, 4, "毛利率"); | ||
991 | + createMergedRow(sheet, cellStyle, 30, 31, 5, 6, Optional.ofNullable(businessProfitInfoVO.getProfitRate()).map(rate -> rate.multiply(new BigDecimal(100)) + "%").orElse("-")); | ||
992 | + createMergedRow(sheet, cellStyle, 30, 31, 7, 9, ""); | ||
993 | + createMergedRow(sheet, cellStyle, 32, 33, 0, 4, "研发贸易净利润"); | ||
994 | + createMergedRow(sheet, cellStyle, 32, 33, 5, 6, Optional.ofNullable(businessProfitInfoVO.getDevelopmentProfit()).map(price -> "¥" + price).orElse("-")); | ||
995 | + createMergedRow(sheet, cellStyle, 32, 33, 7, 9, ""); | ||
996 | + createMergedRow(sheet, cellStyle, 34, 35, 0, 4, "研发贸易净利润率"); | ||
997 | + createMergedRow(sheet, cellStyle, 34, 35, 5, 6, Optional.ofNullable(businessProfitInfoVO.getDevelopmentProfitRate()).map(rate -> rate.multiply(new BigDecimal(100)) + "%").orElse("-")); | ||
998 | + createMergedRow(sheet, cellStyle, 34, 35, 7, 9, ""); | ||
999 | + createMergedRow(sheet, cellStyle, 36, 37, 0, 4, "包装费用合计金额"); | ||
1000 | + createMergedRow(sheet, cellStyle, 36, 37, 5, 6, Optional.ofNullable(businessProfitInfoVO.getPacketRmbTotalPrice()).map(price -> "¥" + price).orElse("-")); | ||
1001 | + createMergedRow(sheet, cellStyle, 36, 37, 7, 9, ""); | ||
1002 | + createMergedRow(sheet, cellStyle, 38, 39, 0, 4, "包装费用实际金额"); | ||
1003 | + createMergedRow(sheet, cellStyle, 38, 39, 5, 6, Optional.ofNullable(businessProfitInfoVO.getPacketActualRmbTotalPrice()).map(price -> "¥" + price).orElse("-")); | ||
1004 | + createMergedRow(sheet, cellStyle, 38, 39, 7, 9, ""); | ||
1005 | + createMergedRow(sheet, cellStyle, 40, 41, 0, 4, "订单总数量"); | ||
1006 | + createMergedRow(sheet, cellStyle, 40, 41, 5, 6, Optional.ofNullable(businessProfitInfoVO.getOrderCount()).map(String::valueOf).orElse("-")); | ||
1007 | + createMergedRow(sheet, cellStyle, 40, 41, 7, 9, ""); | ||
1008 | + createMergedRow(sheet, cellStyle, 42, 43, 0, 4, "实际跟单单价=实际跟单费用/件数"); | ||
1009 | + createMergedRow(sheet, cellStyle, 42, 43, 5, 6, Optional.ofNullable(businessProfitInfoVO.getActualOrderRmbPrice()).map(price -> "¥" + price).orElse("-")); | ||
1010 | + createMergedRow(sheet, cellStyle, 42, 43, 7, 9, ""); | ||
1011 | + createMergedRow(sheet, cellStyle, 44, 45, 0, 4, "实际跟单单价折算美金"); | ||
1012 | + createMergedRow(sheet, cellStyle, 44, 45, 5, 6, Optional.ofNullable(businessProfitInfoVO.getActualOrderPrice()).map(price -> "$" + price).orElse("-")); | ||
1013 | + createMergedRow(sheet, cellStyle, 44, 45, 7, 9, ""); | ||
1014 | + createMergedRow(sheet, cellStyle, 46, 47, 0, 4, "包装费用收益"); | ||
1015 | + createMergedRow(sheet, cellStyle, 46, 47, 5, 6, Optional.ofNullable(businessProfitInfoVO.getPacketProfitRmbPrice()).map(price -> "¥" + price).orElse("-")); | ||
1016 | + createMergedRow(sheet, cellStyle, 46, 47, 7, 9, ""); | ||
1017 | + createMergedRow(sheet, cellStyle, 48, 49, 0, 4, "包装费用净利润率"); | ||
1018 | + createMergedRow(sheet, cellStyle, 48, 49, 5, 6, | ||
1019 | + Optional.ofNullable(businessProfitInfoVO.getPacketRmbTotalPrice()) | ||
1020 | + .map(totalPrice -> Optional.ofNullable(businessProfitInfoVO.getPacketProfitRmbPrice()) | ||
1021 | + .orElse(BigDecimal.valueOf(0)) | ||
1022 | + .divide(BigDecimal.valueOf(totalPrice), 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)) + "%").orElse("-")); | ||
1023 | + createMergedRow(sheet, cellStyle, 48, 49, 7, 9, ""); | ||
1024 | + //导出不再需要实际汇率和汇率收益 | ||
1025 | +// createMergedRow(sheet, cellStyle, 50, 51, 0, 4, "实际汇率"); | ||
1026 | +// createMergedRow(sheet, cellStyle, 50, 51, 5, 6, Optional.ofNullable(businessProfitInfoVO.getActualExchangeRate()).map(String::valueOf).orElse("-")); | ||
1027 | +// createMergedRow(sheet, cellStyle, 50, 51, 7, 9, ""); | ||
1028 | +// createMergedRow(sheet, cellStyle, 52, 53, 0, 4, "汇率收益"); | ||
1029 | +// createMergedRow(sheet, cellStyle, 52, 53, 5, 6, Optional.ofNullable(businessProfitInfoVO.getExchangeRateProfit()).map(price -> "¥" + price).orElse("-")); | ||
1030 | +// createMergedRow(sheet, cellStyle, 52, 53, 7, 9, ""); | ||
1031 | + createMergedRow(sheet, cellStyle, 50, 51, 0, 4, "综合收益"); | ||
1032 | + createMergedRow(sheet, cellStyle, 50, 51, 5, 6, Optional.ofNullable(businessProfitInfoVO.getComprehensiveProfit()).map(price -> "¥" + price).orElse("-")); | ||
1033 | + createMergedRow(sheet, cellStyle, 50, 51, 7, 9, ""); | ||
1034 | + | ||
1035 | + // 设置响应头 | ||
1036 | + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); | ||
1037 | + response.setHeader("Content-Disposition", "attachment;filename=BusinessProfitAnalysis.xlsx"); | ||
1038 | + try (OutputStream out = response.getOutputStream()) { | ||
1039 | + workbook.write(out); | ||
1040 | + } finally { | ||
1041 | + workbook.close(); | ||
1042 | + } | ||
1043 | + } | ||
1044 | + | ||
1045 | + @Override | ||
1046 | + public void exportInnerProfitInfo(HttpServletResponse response, String projectNoPrefix) throws Exception { | ||
1047 | + ServerResult serverResult = listInnerProfitInfoByPage(OrderBaseInfoQueryVO.builder().page(1).pageSize(1).productionDepartment(Collections.singletonList("内部")).projectNoLikeRight(projectNoPrefix).build()); | ||
1048 | + Page<InnerProfitInfoVO> page = (Page<InnerProfitInfoVO>) serverResult.getData(); | ||
1049 | + List<InnerProfitInfoVO> profitInfoVOS = page.getRecords(); | ||
1050 | + InnerProfitInfoVO ProfitInfoVO = profitInfoVOS.get(0); | ||
1051 | + exportInnerProfitExcel(response, ProfitInfoVO); | ||
1052 | + } | ||
1053 | + | ||
1054 | + @Override | ||
1055 | + public void exportBusinessProfitExcel(HttpServletResponse response, ProjectBaseInfoQueryVO queryVO) throws Exception { | ||
1056 | + //这里设置为100是故意设置大一点,防止导出多条数据。 | ||
1057 | + ServerResult serverResult =listBusinessProfitInfoByPage(OrderBaseInfoQueryVO.builder().page(1).pageSize(100).projectNo(queryVO.getDetailProjectNo()).build()); | ||
1058 | + Page<BusinessProfitInfoVO> page = (Page<BusinessProfitInfoVO>) serverResult.getData(); | ||
1059 | + List<BusinessProfitInfoVO> businessProfitInfoVOS = page.getRecords(); | ||
1060 | + if(CollectionUtils.isNotEmpty(businessProfitInfoVOS)){ | ||
1061 | + List<Map<String, Object>> list = buildExportExcel(businessProfitInfoVOS, queryVO); | ||
1062 | + if(CollectionUtils.isNotEmpty(list)){ | ||
1063 | + List<String> keys = new ArrayList<>(list.get(Constant.ZERO).keySet()); | ||
1064 | + ExcelHelper.opsExport(PoiWorkbookType.XLSX) | ||
1065 | + .opsSheet(list) | ||
1066 | + .opsHeader().simple().texts(keys).done() | ||
1067 | + .opsColumn().fields(keys).done() | ||
1068 | + .height(CellPosition.CELL, 750) | ||
1069 | + .done() | ||
1070 | + .export(response.getOutputStream()); | ||
1071 | + } | ||
1072 | + } | ||
1073 | + } | ||
1074 | + | ||
1075 | + @Override | ||
1076 | + public void exportInnerProfitInfoExcel(HttpServletResponse response, ProjectBaseInfoQueryVO queryVO) throws Exception { | ||
1077 | + //这里设置为100是故意设置大一点,防止导出多条数据。 | ||
1078 | + ServerResult serverResult = listInnerProfitInfoByPage(OrderBaseInfoQueryVO.builder().page(1).pageSize(100).productionDepartment(Collections.singletonList("内部")).projectNo(queryVO.getDetailProjectNo()).build()); | ||
1079 | + Page<InnerProfitInfoVO> page = (Page<InnerProfitInfoVO>) serverResult.getData(); | ||
1080 | + List<InnerProfitInfoVO> profitInfoVOS = page.getRecords(); | ||
1081 | + if(CollectionUtils.isNotEmpty(profitInfoVOS)){ | ||
1082 | + List<Map<String,Object>> list=buildInnerProfitExportExcel(profitInfoVOS, queryVO); | ||
1083 | + if(CollectionUtils.isNotEmpty(list)){ | ||
1084 | + List<String> keys = new ArrayList<>(list.get(Constant.ZERO).keySet()); | ||
1085 | + ExcelHelper.opsExport(PoiWorkbookType.XLSX) | ||
1086 | + .opsSheet(list) | ||
1087 | + .opsHeader().simple().texts(keys).done() | ||
1088 | + .opsColumn().fields(keys).done() | ||
1089 | + .height(CellPosition.CELL, 750) | ||
1090 | + .done() | ||
1091 | + .export(response.getOutputStream()); | ||
1092 | + } | ||
1093 | + } | ||
1094 | + } | ||
1095 | + | ||
1096 | + @Override | ||
1097 | + public void setProjectBaseInfoDevelopmentStatus(OrderBaseInfoVO vo) { | ||
1098 | + | ||
1099 | + //中国团队提成比例。 | ||
1100 | + String chainRatio = null; | ||
1101 | + //西班牙提成比例。 | ||
1102 | + String spainRatio = null; | ||
1103 | + //固定成本。 | ||
1104 | + String dailyCost = null; | ||
1105 | + | ||
1106 | + //去表中设置状态,然后记录数据到永久配置中。 | ||
1107 | + if(StringUtils.isBlank(vo.getProjectNo())){ | ||
1108 | + throw new BusinessException(ServerResultCode.PARAM_ERROR); | ||
1109 | + } | ||
1110 | + ProjectBaseInfoDO projectBaseInfoDO = getOne(new LambdaQueryWrapper<ProjectBaseInfoDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
1111 | + .eq(ProjectBaseInfoDO::getProjectNoPrefix, vo.getProjectNo()) | ||
1112 | + .last("limit 1")); | ||
1113 | + if(Objects.isNull(projectBaseInfoDO)){ | ||
1114 | + throw new BusinessException(ServerResultCode.EMPTY_LIST); | ||
1115 | + } | ||
1116 | + projectBaseInfoDO.setDevelopmentStatus(ProfitStatusEnum.APPROVED.getStatus()); | ||
1117 | + //把审核通过时的计算数据时的系统配置保存到永久配置中。防止后续更改系统配置后,正确的数据会被更新掉。 | ||
1118 | + //获取当前的系统配置。 | ||
1119 | + ProjectBaseAfterReviewSettingDO projectBaseAfterReviewSettingDO = projectBaseAfterReviewSettingService.getOne(new LambdaQueryWrapper<ProjectBaseAfterReviewSettingDO>() | ||
1120 | + .eq(ProjectBaseAfterReviewSettingDO::getProjectNoPrefix, vo.getProjectNo()) | ||
1121 | + .eq(ProjectBaseAfterReviewSettingDO::getType, ProjectBaseSettingTypeEnum.COMMISSION_COST.getType()) | ||
1122 | + .last("limit 1")); | ||
1123 | + SystemSettingDO systemSettingDO = systemSettingService.getOne(new LambdaQueryWrapper<SystemSettingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
1124 | + .eq(SystemSettingDO::getSettingValue, vo.getCustomerCode()) | ||
1125 | + .eq(SystemSettingDO::getRelationCode, "costSettingItem")); | ||
1126 | + if(Objects.isNull(systemSettingDO) || StringUtils.isBlank(systemSettingDO.getRelationValue())){ | ||
1127 | + throw new BusinessException("该项目编号的提成配置未配置,请先配置提成配置。"); | ||
1128 | + } | ||
1129 | + //json反序列化。 | ||
1130 | + List<CostSettingItemVO> costSettingItemVOList = JSONObject.parseObject(systemSettingDO.getRelationValue(), new TypeReference<List<CostSettingItemVO>>() {}); | ||
1131 | + if( CollectionUtils.isNotEmpty(costSettingItemVOList)){ | ||
1132 | + for (CostSettingItemVO relation : costSettingItemVOList) { | ||
1133 | + if ("ratio".equals(relation.getRelationCode())) { | ||
1134 | + chainRatio = relation.getRelationValue(); | ||
1135 | + }if ("spainRatio".equals(relation.getRelationCode())) { | ||
1136 | + spainRatio = relation.getRelationValue(); | ||
1137 | + }if("fixCost".equals(relation.getRelationCode())){ | ||
1138 | + dailyCost=relation.getRelationValue(); | ||
1139 | + } | ||
1140 | + } | ||
1141 | + } | ||
1142 | + if(Objects.isNull(projectBaseAfterReviewSettingDO)){ | ||
1143 | + projectBaseAfterReviewSettingDO = projectBaseAfterReviewSettingDO.builder().projectNoPrefix(vo.getProjectNo()) | ||
1144 | + .type(ProjectBaseSettingTypeEnum.COMMISSION_COST.getType()) | ||
1145 | + .fixedCost(new BigDecimal(dailyCost)) | ||
1146 | + .commissionRate(new BigDecimal(chainRatio)) | ||
1147 | + .spainCommissionRate(new BigDecimal(spainRatio)).build(); | ||
1148 | + }else{ | ||
1149 | + projectBaseAfterReviewSettingDO.setProjectNoPrefix(vo.getProjectNo()); | ||
1150 | + projectBaseAfterReviewSettingDO.setType(ProjectBaseSettingTypeEnum.COMMISSION_COST.getType()); | ||
1151 | + projectBaseAfterReviewSettingDO.setFixedCost(new BigDecimal(dailyCost)); | ||
1152 | + projectBaseAfterReviewSettingDO.setCommissionRate(new BigDecimal(chainRatio)); | ||
1153 | + projectBaseAfterReviewSettingDO.setSpainCommissionRate(new BigDecimal(spainRatio)); | ||
1154 | + } | ||
1155 | + ProjectBaseAfterReviewSettingDO finalProjectBaseAfterReviewSettingDO = projectBaseAfterReviewSettingDO; | ||
1156 | + transactionHelper.run(() -> { | ||
1157 | + projectBaseAfterReviewSettingService.saveOrUpdate(finalProjectBaseAfterReviewSettingDO); | ||
1158 | + updateById(projectBaseInfoDO); | ||
1159 | + }); | ||
1160 | + } | ||
1161 | + | ||
1162 | + @Override | ||
1163 | + public void setInnerProductionStatus(OrderBaseInfoVO vo) { | ||
1164 | + String dailyCost = null; | ||
1165 | + String price = null; | ||
1166 | + //去表中设置状态,然后记录数据到永久配置中。 | ||
1167 | + if(StringUtils.isBlank(vo.getProjectNo())){ | ||
1168 | + throw new BusinessException(ServerResultCode.PARAM_ERROR); | ||
1169 | + } | ||
1170 | + ProjectBaseInfoDO projectBaseInfoDO = getOne(new LambdaQueryWrapper<ProjectBaseInfoDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
1171 | + .eq(ProjectBaseInfoDO::getProjectNoPrefix, vo.getProjectNo()) | ||
1172 | + .last("limit 1")); | ||
1173 | + if(Objects.isNull(projectBaseInfoDO)){ | ||
1174 | + throw new BusinessException(ServerResultCode.EMPTY_LIST); | ||
1175 | + } | ||
1176 | + projectBaseInfoDO.setInnerProductionStatus(ProfitStatusEnum.APPROVED.getStatus()); | ||
1177 | + //把审核通过时的计算数据时的系统配置保存到永久配置中。防止后续更改系统配置后,正确的数据会被更新掉。 | ||
1178 | + //获取当前的系统配置。 | ||
1179 | + ProjectBaseAfterReviewSettingDO projectBaseAfterReviewSettingDO = projectBaseAfterReviewSettingService.getOne(new LambdaQueryWrapper<ProjectBaseAfterReviewSettingDO>() | ||
1180 | + .eq(ProjectBaseAfterReviewSettingDO::getProjectNoPrefix, vo.getProjectNo()) | ||
1181 | + .eq(ProjectBaseAfterReviewSettingDO::getType, ProjectBaseSettingTypeEnum.FIXED_COST_OF_PRODUCTION_DEPARTMENT.getType()) | ||
1182 | + .last("limit 1")); | ||
1183 | + SystemSettingDO systemSettingDO = systemSettingService.getOne(new LambdaQueryWrapper<SystemSettingDO>().eq(BaseDO::getEnableFlag, Constant.ENABLE_TEN) | ||
1184 | + .eq(SystemSettingDO::getSettingValue, vo.getCustomerCode()) | ||
1185 | + .eq(SystemSettingDO::getRelationCode, "ProduceSettingItem")); | ||
1186 | + if(Objects.isNull(systemSettingDO) || StringUtils.isBlank(systemSettingDO.getRelationValue())){ | ||
1187 | + throw new BusinessException("该项目编号的提成配置未配置,请先配置提成配置。"); | ||
1188 | + } | ||
1189 | + //json反序列化。 | ||
1190 | + List<CostSettingItemVO> costSettingItemVOList = JSONObject.parseObject(systemSettingDO.getRelationValue(), new TypeReference<List<CostSettingItemVO>>() {}); | ||
1191 | + if( CollectionUtils.isNotEmpty(costSettingItemVOList)){ | ||
1192 | + for (CostSettingItemVO relation : costSettingItemVOList) { | ||
1193 | + //这里是系统配置中的得到的,应该是从系统配置中的生产科中得到。 固定成本。 | ||
1194 | + if("fixCost".equals(relation.getRelationCode())){ | ||
1195 | + dailyCost=relation.getRelationValue(); | ||
1196 | + } | ||
1197 | + //生产提成单价 | ||
1198 | + if("ratio".equals(relation.getRelationCode())){ | ||
1199 | + price=relation.getRelationValue(); | ||
1200 | + } | ||
1201 | + } | ||
1202 | + } | ||
1203 | + if(Objects.isNull(projectBaseAfterReviewSettingDO)){ | ||
1204 | + projectBaseAfterReviewSettingDO= projectBaseAfterReviewSettingDO.builder().projectNoPrefix(vo.getProjectNo()) | ||
1205 | + .type(ProjectBaseSettingTypeEnum.FIXED_COST_OF_PRODUCTION_DEPARTMENT.getType()) | ||
1206 | + .fixedCost(new BigDecimal(dailyCost)) | ||
1207 | + .commissionUnitPrice(new BigDecimal(price)).build(); | ||
1208 | + }else{ | ||
1209 | + projectBaseAfterReviewSettingDO.setProjectNoPrefix(vo.getProjectNo()); | ||
1210 | + projectBaseAfterReviewSettingDO.setType(ProjectBaseSettingTypeEnum.FIXED_COST_OF_PRODUCTION_DEPARTMENT.getType()); | ||
1211 | + projectBaseAfterReviewSettingDO.setFixedCost(new BigDecimal(dailyCost)); | ||
1212 | + projectBaseAfterReviewSettingDO.setCommissionUnitPrice(new BigDecimal(price)); | ||
1213 | + } | ||
1214 | + ProjectBaseAfterReviewSettingDO finalProjectBaseAfterReviewSettingDO = projectBaseAfterReviewSettingDO; | ||
1215 | + transactionHelper.run(() -> { | ||
1216 | + projectBaseAfterReviewSettingService.saveOrUpdate(finalProjectBaseAfterReviewSettingDO); | ||
1217 | + updateById(projectBaseInfoDO); | ||
1218 | + }); | ||
1219 | + } | ||
1220 | + | ||
1221 | + public void exportInnerProfitExcel(HttpServletResponse response, InnerProfitInfoVO vo) throws Exception { | ||
1222 | + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); | ||
1223 | + XSSFWorkbook workbook = new XSSFWorkbook(); | ||
1224 | + Sheet sheet = workbook.createSheet("内部生产净利润分析"); | ||
1225 | + sheet.setDefaultColumnWidth(10); | ||
1226 | + | ||
1227 | + // 设置字体和样式 | ||
1228 | + XSSFFont font = workbook.createFont(); | ||
1229 | + font.setFontName("Arial"); | ||
1230 | + font.setFontHeightInPoints((short) 10); | ||
1231 | + | ||
1232 | + CellStyle cellStyle = workbook.createCellStyle(); | ||
1233 | + cellStyle.setAlignment(HorizontalAlignment.CENTER); | ||
1234 | + cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); | ||
1235 | + cellStyle.setFont(font); | ||
1236 | + cellStyle.setWrapText(true); | ||
1237 | + | ||
1238 | + // 第一部分:表头 | ||
1239 | + createMergedRow(sheet, cellStyle, 0, 3, 0, 9, "内部生产净利润分析表"); | ||
1240 | + | ||
1241 | + // 第二部分:项目信息 | ||
1242 | + createMergedRow(sheet, cellStyle, 4, 5, 0, 1, "项目号"); | ||
1243 | + createMergedRow(sheet, cellStyle, 4, 5, 2, 3, Optional.ofNullable(vo.getProjectNoPrefix()).orElse("-")); | ||
1244 | + createMergedRow(sheet, cellStyle, 4, 5, 4, 5, "开始时间"); | ||
1245 | + createMergedRow(sheet, cellStyle, 4, 5, 6, 7, "结束时间"); | ||
1246 | + createMergedRow(sheet, cellStyle, 4, 5, 8, 9, "生产持续时间"); | ||
1247 | + | ||
1248 | + String projectStartTime = Optional.ofNullable(vo.getProduceStartTime()).map(dateTimeFormatter::format).orElse("-"); | ||
1249 | + String projectEndTime = Optional.ofNullable(vo.getProduceEndTime()).map(dateTimeFormatter::format).orElse("-"); | ||
1250 | + String duration = (vo.getProduceStartTime() != null && vo.getProduceEndTime() != null) | ||
1251 | + ? String.valueOf(Duration.between(vo.getProduceStartTime(), vo.getProduceEndTime()).toDays() + 1) | ||
1252 | + : "-"; | ||
1253 | + createMergedRow(sheet, cellStyle, 6, 7, 0, 1, ""); | ||
1254 | + createMergedRow(sheet, cellStyle, 6, 7, 2, 3, "生产起止时间"); | ||
1255 | + createMergedRow(sheet, cellStyle, 6, 7, 4, 5, projectStartTime); | ||
1256 | + createMergedRow(sheet, cellStyle, 6, 7, 6, 7, projectEndTime); | ||
1257 | + createMergedRow(sheet, cellStyle, 6, 7, 8, 9, duration); | ||
1258 | + | ||
1259 | + // 第三部分:客户和订单信息 | ||
1260 | + createMergedRow(sheet, cellStyle, 8, 9, 0, 1, "客户编码"); | ||
1261 | + createMergedRow(sheet, cellStyle, 8, 9, 2, 3, Optional.ofNullable(vo.getCustomerCode()).orElse("-")); | ||
1262 | + createMergedRow(sheet, cellStyle, 8, 9, 4, 5, "明细"); | ||
1263 | + createMergedRow(sheet, cellStyle, 8, 9, 6, 7, "金额"); | ||
1264 | + createMergedRow(sheet, cellStyle, 8, 9, 8, 9, "订单数量"); | ||
1265 | + | ||
1266 | + // 第四部分:生产科总价合计 | ||
1267 | + createMergedRow(sheet, cellStyle, 10, 11, 0, 3, "生产科总价合计"); | ||
1268 | + createMergedRow(sheet, cellStyle, 10, 11, 4, 5, "¥" + Optional.ofNullable(vo.getProductionDepartmentTotalPrice()).orElse(0.0)); | ||
1269 | + createMergedRow(sheet, cellStyle, 10, 11, 6, 7, "¥" + Optional.ofNullable(vo.getProductionDepartmentTotalPrice()).orElse(0.0)); | ||
1270 | + createMergedRow(sheet, cellStyle, 10, 11, 8, 9, Optional.ofNullable(vo.getOrderCount()).map(String::valueOf).orElse("-")); | ||
1271 | + | ||
1272 | + // 第五部分:预算与实际 | ||
1273 | + createMergedRow(sheet, cellStyle, 12, 13, 0, 3, "生产科预算总金额"); | ||
1274 | + createMergedRow(sheet, cellStyle, 12, 13, 4, 5, "¥" + Optional.ofNullable(vo.getProductionDepartmentPredictPrice()).map(String::valueOf).orElse("-")); | ||
1275 | + createMergedRow(sheet, cellStyle, 12, 13, 6, 7, "预算占比"); | ||
1276 | + createMergedRow(sheet, cellStyle, 12, 13, 8, 9, "预算占比与实际占比差"); | ||
1277 | + | ||
1278 | + createMergedRow(sheet, cellStyle, 14, 15, 0, 3, "生产科实际花费总金额"); | ||
1279 | + createMergedRow(sheet, cellStyle, 14, 15, 4, 5, "¥" + Optional.ofNullable(vo.getProductionActualPrice()).orElse(BigDecimal.ZERO)); | ||
1280 | + createMergedRow(sheet, cellStyle, 14, 15, 6, 7, Optional.ofNullable(vo.getPredictRatio()).map(r -> r.multiply(BigDecimal.valueOf(100)) + "%").orElse("-")); | ||
1281 | + createMergedRow(sheet, cellStyle, 14, 15, 8, 9, Optional.ofNullable(vo.getPredictAndActualRatio()).map(r -> r.multiply(BigDecimal.valueOf(100)) + "%").orElse("-")); | ||
1282 | + | ||
1283 | + // 第六部分:毛利润 | ||
1284 | + createMergedRow(sheet, cellStyle, 16, 17, 0, 3, "内部生产毛利润"); | ||
1285 | + createMergedRow(sheet, cellStyle, 16, 17, 4, 5, "¥" + Optional.ofNullable(vo.getGrossProfit()).orElse(BigDecimal.ZERO)); | ||
1286 | + createMergedRow(sheet, cellStyle, 16, 16, 6, 7, "事前毛利润"); | ||
1287 | + createMergedRow(sheet, cellStyle, 16, 16, 8, 9, "事前毛利率"); | ||
1288 | + createMergedRow(sheet, cellStyle, 17, 17, 6, 7, Optional.ofNullable(vo.getBeforeGrossProfit()).orElse(BigDecimal.ZERO).toString()); | ||
1289 | + createMergedRow(sheet, cellStyle, 17, 17, 8, 9, Optional.ofNullable(vo.getBeforeGrossProfitRate()).map(r -> r.multiply(BigDecimal.valueOf(100)) + "%").orElse("-")); | ||
1290 | + | ||
1291 | + // 第七部分:固定成本与净利润 | ||
1292 | + createMergedRow(sheet, cellStyle, 18, 19, 0, 3, "内部生产固定成本"); | ||
1293 | + createMergedRow(sheet, cellStyle, 18, 19, 4, 5, "¥" + Optional.ofNullable(vo.getInnerProductionFixedCost()).orElse(BigDecimal.ZERO)); | ||
1294 | + createMergedRow(sheet, cellStyle, 18, 18, 6, 7, "事后毛利润"); | ||
1295 | + createMergedRow(sheet, cellStyle, 18, 18, 8, 9, "事后毛利率"); | ||
1296 | + createMergedRow(sheet, cellStyle, 19, 19, 6, 7, Optional.ofNullable(vo.getGrossProfit()).orElse(BigDecimal.ZERO).toString()); | ||
1297 | + createMergedRow(sheet, cellStyle, 19, 19, 8, 9, Optional.ofNullable(vo.getGrossProfitRate()).map(r -> r.multiply(BigDecimal.valueOf(100)) + "%").orElse("-")); | ||
1298 | + | ||
1299 | + // 第八部分:提成与净利润 | ||
1300 | + createMergedRow(sheet, cellStyle, 20, 21, 0, 3, "内部生产提成"); | ||
1301 | + createMergedRow(sheet, cellStyle, 20, 21, 4, 5, "¥" + Optional.ofNullable(vo.getInnerProductionCommission()).orElse(BigDecimal.ZERO)); | ||
1302 | + createMergedRow(sheet, cellStyle, 20, 21, 6, 7, "净利润率"); | ||
1303 | + createMergedRow(sheet, cellStyle, 20, 21, 8, 9, ""); | ||
1304 | + | ||
1305 | + createMergedRow(sheet, cellStyle, 22, 23, 0, 3, "内部生产净利润"); | ||
1306 | + createMergedRow(sheet, cellStyle, 22, 23, 4, 5, "¥" + Optional.ofNullable(vo.getInnerProductionProfit()).orElse(BigDecimal.ZERO)); | ||
1307 | + createMergedRow(sheet, cellStyle, 22, 23, 6, 7, Optional.ofNullable(vo.getInnerProductionProfitRate()).map(r -> r.multiply(BigDecimal.valueOf(100)) + "%").orElse("-")); | ||
1308 | + createMergedRow(sheet, cellStyle, 22, 23, 8, 9, ""); | ||
1309 | + | ||
1310 | + // 设置响应头 | ||
1311 | + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); | ||
1312 | + response.setHeader("Content-Disposition", "attachment;filename=BusinessProfitAnalysis.xlsx"); | ||
1313 | + try (OutputStream out = response.getOutputStream()) { | ||
1314 | + workbook.write(out); | ||
1315 | + } finally { | ||
1316 | + workbook.close(); | ||
1317 | + } | ||
1318 | + } | ||
1319 | + | ||
1320 | + private void createMergedRow(Sheet sheet, CellStyle cellStyle, int startRow, int endRow, int startCol, int endCol, String value) { | ||
1321 | + for (int i = startRow; i <= endRow; i++) { | ||
1322 | + Row row = sheet.getRow(i); | ||
1323 | + if (row == null) { | ||
1324 | + row = sheet.createRow(i); | ||
1325 | + } | ||
1326 | + for (int j = startCol; j <= endCol; j++) { | ||
1327 | + Cell cell = row.createCell(j); | ||
1328 | + cell.setCellStyle(cellStyle); | ||
1329 | + if (i == startRow && j == startCol) { | ||
1330 | + cell.setCellValue(value); | ||
1331 | + } | ||
1332 | + } | ||
1333 | + } | ||
1334 | + sheet.addMergedRegion(new CellRangeAddress(startRow, endRow, startCol, endCol)); | ||
1335 | + } | ||
1336 | + private ProjectBaseDevelopOptLogDO buildProjectOptLogDo(String projectNoPrefix, Long userId , Integer type,String optType, String field){ | ||
1337 | + return ProjectBaseDevelopOptLogDO.builder() | ||
1338 | + .projectNoPrefix(projectNoPrefix) | ||
1339 | + .userId(userId) | ||
1340 | + .type(type) | ||
1341 | + .optType(optType) | ||
1342 | + .fields(field) | ||
1343 | + .build(); | ||
1344 | + } | ||
1345 | + private ProjectBaseInfoVO buildProjectBaseInfoVO(ProjectBaseInfoVO vo,Long projectBaseInfoId){ | ||
1346 | + ProjectBaseInfoVO projectBaseInfoVO = new ProjectBaseInfoVO(); | ||
1347 | + BeanUtils.copyProperties(vo, projectBaseInfoVO, "id"); | ||
1348 | + projectBaseInfoVO.setId(projectBaseInfoId); | ||
1349 | + return projectBaseInfoVO; | ||
1350 | + } | ||
1351 | +// private ProjectBaseInfoLockFieldVO buildProjectBaseInfoLockFieldVO(ProjectBaseInfoLockFieldVO vo){ | ||
1352 | +// ProjectBaseInfoLockFieldVO projectBaseInfoLockFieldVO = new ProjectBaseInfoLockFieldVO(); | ||
1353 | +// if(OrderLockFieldEnum.UN_LOCKED.equals(vo.getActualExchangeRate())){ | ||
1354 | +// projectBaseInfoLockFieldVO.setActualExchangeRate(OrderLockFieldEnum.UN_LOCKED.getStatus()); | ||
1355 | +// } | ||
1356 | +// if(OrderLockFieldEnum.UN_LOCKED.equals(vo.getDevelopmentCopyRmbTotalPrice())){ | ||
1357 | +// projectBaseInfoLockFieldVO.setDevelopmentCopyRmbTotalPrice(OrderLockFieldEnum.UN_LOCKED.getStatus()); | ||
1358 | +// } | ||
1359 | +// if(OrderLockFieldEnum.UN_LOCKED.equals(vo.getPaidRmbCommission())){ | ||
1360 | +// projectBaseInfoLockFieldVO.setPaidRmbCommission(OrderLockFieldEnum.UN_LOCKED.getStatus()); | ||
1361 | +// } | ||
1362 | +// if(OrderLockFieldEnum.UN_LOCKED.equals(vo.getProjectEndTime())){ | ||
1363 | +// projectBaseInfoLockFieldVO.setProjectEndTime(OrderLockFieldEnum.UN_LOCKED.getStatus()); | ||
1364 | +// } | ||
1365 | +// if(OrderLockFieldEnum.UN_LOCKED.equals(vo.getProjectStartTime())){ | ||
1366 | +// projectBaseInfoLockFieldVO.setProjectStartTime(OrderLockFieldEnum.UN_LOCKED.getStatus()); | ||
1367 | +// } | ||
1368 | +// if(OrderLockFieldEnum.UN_LOCKED.equals(vo.getSpainPaidRmbCommission())){ | ||
1369 | +// projectBaseInfoLockFieldVO.setSpainPaidRmbCommission(OrderLockFieldEnum.UN_LOCKED.getStatus()); | ||
1370 | +// } | ||
1371 | +// return projectBaseInfoLockFieldVO; | ||
1372 | +// } | ||
1373 | + private List<Map<String,Object>> buildExportExcel(List<BusinessProfitInfoVO> businessProfitInfoVOList,ProjectBaseInfoQueryVO queryVO){ | ||
1374 | + List<Map<String,Object>> list = new ArrayList<>(); | ||
1375 | + for( BusinessProfitInfoVO vo:businessProfitInfoVOList){ | ||
1376 | + Map<String, Object> hashMap = new LinkedHashMap<>(); | ||
1377 | + hashMap.put("客户编码",Objects.nonNull(vo.getCustomerCode()) ? vo.getCustomerCode() : ""); | ||
1378 | + hashMap.put("项目号",Objects.nonNull(vo.getProjectNoPrefix()) ? vo.getProjectNoPrefix() : ""); | ||
1379 | + hashMap.put("客户总金额¥",Objects.nonNull(vo.getCustomerRmbTotalPrice()) ? String.format("%.2f",vo.getCustomerRmbTotalPrice()) : ""); | ||
1380 | + hashMap.put("客户总金额$",Objects.nonNull(vo.getCustomerTotalPrice()) ? String.format("%.2f",vo.getCustomerTotalPrice()) : ""); | ||
1381 | + hashMap.put("生产总价合计¥",Objects.nonNull(vo.getProductionDepartmentTotalPrice()) ? String.format("%.2f",vo.getProductionDepartmentTotalPrice()) : ""); | ||
1382 | + hashMap.put("包装费用合计¥",Objects.nonNull(vo.getPacketRmbTotalPrice()) ? String.format("%.2f",vo.getPacketRmbTotalPrice()) : ""); | ||
1383 | + hashMap.put("包装费用合计$",Objects.nonNull(vo.getPacketTotalPrice()) ? String.format("%.2f",vo.getPacketTotalPrice()) : ""); | ||
1384 | + hashMap.put("研发复制合计¥",Objects.nonNull(vo.getDevelopmentCopyRmbTotalPrice()) ? vo.getDevelopmentCopyRmbTotalPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1385 | + hashMap.put("固定成本¥",Objects.nonNull(vo.getFixedCost()) ? vo.getFixedCost().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1386 | + hashMap.put("西班牙提成¥",Objects.nonNull(vo.getSpainRmbCommission()) ? vo.getSpainRmbCommission().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1387 | + hashMap.put("西班牙已发提成¥",Objects.nonNull(vo.getSpainPaidRmbCommission()) ? vo.getSpainPaidRmbCommission().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1388 | + hashMap.put("西班牙未发提成¥",Objects.nonNull(vo.getSpainUnpaidRmbCommission()) ? vo.getSpainUnpaidRmbCommission().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1389 | + hashMap.put("中国团队提成¥",Objects.nonNull(vo.getRmbCommission()) ? vo.getRmbCommission().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1390 | + hashMap.put("中国已发提成¥",Objects.nonNull(vo.getPaidRmbCommission()) ? vo.getPaidRmbCommission().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1391 | + hashMap.put("中国未发提成¥",Objects.nonNull(vo.getUnpaidRmbCommission()) ? vo.getUnpaidRmbCommission().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1392 | + hashMap.put("支出合计¥",Objects.nonNull(vo.getRmbTotalExpense()) ? vo.getRmbTotalExpense().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1393 | + hashMap.put("毛利润¥",Objects.nonNull(vo.getProfit()) ? vo.getProfit().setScale(2, RoundingMode.HALF_UP).toPlainString(): ""); | ||
1394 | + hashMap.put("毛利率", | ||
1395 | + Objects.nonNull(vo.getProfitRate()) | ||
1396 | + ? vo.getProfitRate().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toPlainString() + "%" | ||
1397 | + : "" | ||
1398 | + ); | ||
1399 | + hashMap.put("研发贸易净利润¥",Objects.nonNull(vo.getDevelopmentProfit()) ? vo.getDevelopmentProfit().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1400 | + hashMap.put("净利润率", | ||
1401 | + Objects.nonNull(vo.getDevelopmentProfitRate()) | ||
1402 | + ? vo.getDevelopmentProfitRate().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" | ||
1403 | + : "" | ||
1404 | + ); | ||
1405 | + hashMap.put("包装费用合计¥",Objects.nonNull(vo.getPacketRmbTotalPrice()) ? String.format("%.2f",vo.getPacketRmbTotalPrice()) : ""); | ||
1406 | + hashMap.put("包装费用实际金额¥",Objects.nonNull(vo.getPacketActualRmbPrice()) ? vo.getPacketActualRmbPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1407 | + hashMap.put("订单总数量",Objects.nonNull(vo.getOrderCount()) ? vo.getOrderCount() : ""); | ||
1408 | + hashMap.put("实际跟单单价¥",Objects.nonNull(vo.getActualOrderRmbPrice()) ? vo.getActualOrderRmbPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1409 | + hashMap.put("实际跟单单价$",Objects.nonNull(vo.getActualOrderPrice()) ? vo.getActualOrderPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1410 | + hashMap.put("包装费用收益¥",Objects.nonNull(vo.getPacketProfitRmbPrice()) ? vo.getPacketProfitRmbPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1411 | + hashMap.put("综合收益¥",Objects.nonNull(vo.getComprehensiveProfit()) ? vo.getComprehensiveProfit().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1412 | +// if(StringUtils.isNotBlank(queryVO.getProjectExportSelect().getSpainPaidRmbCommission()) && | ||
1413 | +// OrderLockFieldEnum.SELECTED.name().equals(queryVO.getProjectExportSelect().getSpainPaidRmbCommission())){ | ||
1414 | +// } | ||
1415 | + list.add(hashMap); | ||
1416 | + } | ||
1417 | + return list; | ||
1418 | + } | ||
1419 | + | ||
1420 | + private List<Map<String,Object>> buildInnerProfitExportExcel(List<InnerProfitInfoVO> innerProfitInfoVOList, ProjectBaseInfoQueryVO queryVO) { | ||
1421 | + List<Map<String,Object>> list = new ArrayList<>(); | ||
1422 | + for (InnerProfitInfoVO vo:innerProfitInfoVOList){ | ||
1423 | + Map<String, Object> map = new LinkedHashMap<>(); | ||
1424 | + map.put("客户编码",Objects.nonNull(vo.getCustomerCode()) ? vo.getCustomerCode() : ""); | ||
1425 | + map.put("项目号",Objects.nonNull(vo.getProjectNoPrefix()) ? vo.getProjectNoPrefix() : ""); | ||
1426 | + map.put("生产科",Objects.nonNull(vo.getProductionDepartment()) ? vo.getProductionDepartment() : ""); | ||
1427 | + map.put("数量",Objects.nonNull(vo.getOrderCount()) ? vo.getOrderCount() : ""); | ||
1428 | + map.put("生产科总价¥",Objects.nonNull(vo.getProductionDepartmentTotalPrice()) ? String.format("%.2f",vo.getProductionDepartmentTotalPrice()) : ""); | ||
1429 | + map.put("生产科预算金额¥",Objects.nonNull(vo.getProductionDepartmentPredictPrice()) ? vo.getProductionDepartmentPredictPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1430 | + map.put("实际发生费用¥",Objects.nonNull(vo.getProductionActualPrice()) ? vo.getProductionActualPrice().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1431 | + map.put("预算占比",Objects.nonNull(vo.getPredictRatio()) ? vo.getPredictRatio().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1432 | + map.put("预算占比与实际占比差", | ||
1433 | + Objects.nonNull(vo.getPredictAndActualRatio()) | ||
1434 | + ? vo.getPredictAndActualRatio().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" | ||
1435 | + : "" | ||
1436 | + ); | ||
1437 | + map.put("事前毛利润¥",Objects.nonNull(vo.getBeforeGrossProfit()) ? vo.getBeforeGrossProfit().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1438 | + map.put("事前毛利润率",Objects.nonNull(vo.getBeforeGrossProfitRate()) ? vo.getBeforeGrossProfitRate().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" : ""); | ||
1439 | + map.put("事后毛利润¥",Objects.nonNull(vo.getGrossProfit()) ? vo.getGrossProfit().setScale(2, RoundingMode.HALF_UP).toPlainString() : ""); | ||
1440 | + map.put("事后毛利润率",Objects.nonNull(vo.getGrossProfitRate()) ? vo.getGrossProfitRate().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" : ""); | ||
1441 | + map.put("内部生产固定成本¥",Objects.nonNull(vo.getInnerProductionFixedCost()) ? vo.getInnerProductionFixedCost().setScale(2, RoundingMode.HALF_UP) : ""); | ||
1442 | + map.put("内部生产提成¥",Objects.nonNull(vo.getInnerProductionCommission()) ? vo.getInnerProductionCommission().setScale(2, RoundingMode.HALF_UP) : ""); | ||
1443 | + map.put("内部生产净利润¥",Objects.nonNull(vo.getInnerProductionProfit()) ? vo.getInnerProductionProfit().setScale(2, RoundingMode.HALF_UP) : ""); | ||
1444 | + map.put("内部生产净利润率",Objects.nonNull(vo.getInnerProductionProfitRate()) ? vo.getInnerProductionProfitRate().multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP) + "%" : ""); | ||
1445 | + /* if(StringUtils.isNotEmpty(queryVO.getInnerProfitInfoExportSelect().getProductionDepartmentTotalPrice()) && | ||
1446 | + OrderLockFieldEnum.SELECTED.name().equals(queryVO.getInnerProfitInfoExportSelect().getProductionDepartmentTotalPrice())){ | ||
1447 | + | ||
1448 | + }*/ | ||
1449 | + list.add(map); | ||
1450 | + } | ||
1451 | + return list; | ||
1452 | + } | ||
1453 | +} |
src/main/resources/mapper/OrderCostFieldLockRecordMapper.xml
0 → 100644
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.order.erp.mapper.OrderCostFieldLockRecordMapper"> | ||
4 | + | ||
5 | + <!-- 通用查询映射结果 --> | ||
6 | + <resultMap id="BaseResultMap" type="com.order.erp.domain.model.OrderCostFieldLockRecord"> | ||
7 | + <id column="id" property="id" /> | ||
8 | + <result column="fields" property="fields" /> | ||
9 | + <result column="user_id" property="userId" /> | ||
10 | + <result column="order_id" property="orderId" /> | ||
11 | + <result column="enable_flag" property="enableFlag" /> | ||
12 | + <result column="create_time" property="createTime" /> | ||
13 | + <result column="create_by" property="createBy" /> | ||
14 | + <result column="modify_time" property="modifyTime" /> | ||
15 | + <result column="modify_by" property="modifyBy" /> | ||
16 | + <result column="version" property="version" /> | ||
17 | + </resultMap> | ||
18 | + | ||
19 | + <!-- 通用查询结果列 --> | ||
20 | + <sql id="Base_Column_List"> | ||
21 | + id, fields, user_id, order_id, enable_flag, create_time, create_by, modify_time, modify_by, version | ||
22 | + </sql> | ||
23 | + | ||
24 | +</mapper> |
src/main/resources/mapper/OrderCostInfoMapper.xml
0 → 100644
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.order.erp.mapper.order.OrderCostInfoMapper"> | ||
4 | + | ||
5 | + <!-- 通用查询映射结果 --> | ||
6 | + <resultMap id="BaseResultMap" type="com.order.erp.domain.dto.order.OrderCostInfoDO"> | ||
7 | + <id column="id" property="id" /> | ||
8 | + <result column="production_department_predict_price" property="productionDepartmentPredictPrice" /> | ||
9 | + <result column="production_actual_price" property="productionActualPrice" /> | ||
10 | + <result column="packet_actual_rmb_total_price" property="packetActualRmbTotalPrice" /> | ||
11 | + </resultMap> | ||
12 | + | ||
13 | + <!-- 通用查询结果列 --> | ||
14 | + <sql id="Base_Column_List"> | ||
15 | + id, production_department_predict_price, production_actual_price, packet_actual_rmb_total_price | ||
16 | + </sql> | ||
17 | + | ||
18 | +</mapper> |
src/main/resources/mapper/ProjectApplyMapper.xml
0 → 100644
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.order.erp.mapper.ProjectApplyMapper"> | ||
4 | + | ||
5 | + <!-- 通用查询映射结果 --> | ||
6 | + <resultMap id="BaseResultMap" type="com.order.erp.domain.model.ProjectApplyDO"> | ||
7 | + <id column="id" property="id" /> | ||
8 | + <result column="project_id" property="projectId" /> | ||
9 | + <result column="apply_user_id" property="applyUserId" /> | ||
10 | + <result column="audit_user_id" property="auditUserId" /> | ||
11 | + <result column="fields" property="fields" /> | ||
12 | + <result column="status" property="status" /> | ||
13 | + <result column="audit_remark" property="auditRemark" /> | ||
14 | + <result column="audit_role_codes" property="auditRoleCodes" /> | ||
15 | + <result column="apply_remark" property="applyRemark" /> | ||
16 | + <result column="enable_flag" property="enableFlag" /> | ||
17 | + <result column="create_time" property="createTime" /> | ||
18 | + <result column="create_by" property="createBy" /> | ||
19 | + <result column="modify_time" property="modifyTime" /> | ||
20 | + <result column="modify_by" property="modifyBy" /> | ||
21 | + <result column="version" property="version" /> | ||
22 | + </resultMap> | ||
23 | + | ||
24 | + <!-- 通用查询结果列 --> | ||
25 | + <sql id="Base_Column_List"> | ||
26 | + id, project_id, apply_user_id, audit_user_id, fields, status, audit_remark, audit_role_codes, apply_remark, enable_flag, create_time, create_by, modify_time, modify_by, version | ||
27 | + </sql> | ||
28 | + | ||
29 | +</mapper> |
src/main/resources/mapper/ProjectFieldLockRecordMapper.xml
0 → 100644
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.order.erp.mapper.ProjectFieldLockRecordMapper"> | ||
4 | + | ||
5 | + <!-- 通用查询映射结果 --> | ||
6 | + <resultMap id="BaseResultMap" type="com.order.erp.domain.model.ProjectFieldLockRecord"> | ||
7 | + <id column="id" property="id" /> | ||
8 | + <result column="project_id" property="projectId" /> | ||
9 | + <result column="user_id" property="userId" /> | ||
10 | + <result column="fields" property="fields" /> | ||
11 | + <result column="enable_flag" property="enableFlag" /> | ||
12 | + <result column="create_time" property="createTime" /> | ||
13 | + <result column="create_by" property="createBy" /> | ||
14 | + <result column="modify_time" property="modifyTime" /> | ||
15 | + <result column="modify_by" property="modifyBy" /> | ||
16 | + <result column="version" property="version" /> | ||
17 | + </resultMap> | ||
18 | + | ||
19 | + <!-- 通用查询结果列 --> | ||
20 | + <sql id="Base_Column_List"> | ||
21 | + id, project_id, user_id, fields, enable_flag, create_time, create_by, modify_time, modify_by, version | ||
22 | + </sql> | ||
23 | + | ||
24 | +</mapper> |