Commit 939bee3c048d1194ca934ba7d39e92f7a7899b70
1 parent
6696c58d
feature(*): 自定义指标导入
自定义指标导入
Showing
14 changed files
with
633 additions
and
120 deletions
fw-morax-common/src/main/java/cn/fw/morax/common/config/EvalIndicatorVal.java
... | ... | @@ -32,6 +32,13 @@ public class EvalIndicatorVal { |
32 | 32 | @Getter |
33 | 33 | private String evalImportDetail; |
34 | 34 | |
35 | + @Value("${spring.cache.custom.global-prefix}:eval-import-showroom-beautification:") | |
36 | + @Getter | |
37 | + private String evalShowroomBeautificationImport; | |
38 | + @Value("${spring.cache.custom.global-prefix}:eval-import-showroom-beautification-detail:") | |
39 | + @Getter | |
40 | + private String evalShowroomBeautificationImportDetail; | |
41 | + | |
35 | 42 | /** |
36 | 43 | * 最大重试次数 |
37 | 44 | */ | ... | ... |
fw-morax-dao/src/main/java/cn/fw/morax/dao/eval/EvalIndicatorImportDetailScoreDao.java
0 → 100644
1 | +package cn.fw.morax.dao.eval; | |
2 | + | |
3 | + | |
4 | +import cn.fw.morax.dao.orm.LocalMapper; | |
5 | +import cn.fw.morax.domain.db.eval.EvalIndicatorImportDetailScore; | |
6 | +import cn.fw.morax.domain.db.eval.EvalIndicatorImportKeyValue; | |
7 | + | |
8 | +/** | |
9 | + * <p> | |
10 | + * 考评指标导入记录 Mapper 接口 | |
11 | + * </p> | |
12 | + * | |
13 | + * @author jiangchao | |
14 | + * @since 2023-01-30 | |
15 | + */ | |
16 | +public interface EvalIndicatorImportDetailScoreDao extends LocalMapper<EvalIndicatorImportDetailScore> { | |
17 | + | |
18 | +} | ... | ... |
fw-morax-domain/src/main/java/cn/fw/morax/domain/db/eval/EvalIndicatorImportDetailScore.java
0 → 100644
1 | +package cn.fw.morax.domain.db.eval; | |
2 | + | |
3 | +import cn.fw.common.data.entity.BaseAuditableTimeEntity; | |
4 | +import cn.fw.morax.domain.enums.ImportErrorReasonEnum; | |
5 | +import com.baomidou.mybatisplus.annotation.TableName; | |
6 | +import lombok.Data; | |
7 | +import lombok.EqualsAndHashCode; | |
8 | +import lombok.experimental.Accessors; | |
9 | + | |
10 | +import java.math.BigDecimal; | |
11 | +import java.time.LocalDate; | |
12 | + | |
13 | +/** | |
14 | + * <p> | |
15 | + * 自定义指标导入数据 | |
16 | + * </p> | |
17 | + * | |
18 | + * @author jiangchao | |
19 | + * @since 2024-03-26 | |
20 | + */ | |
21 | +@Data | |
22 | +@EqualsAndHashCode(callSuper = false) | |
23 | +@Accessors(chain = true) | |
24 | +@TableName(autoResultMap = true) | |
25 | +public class EvalIndicatorImportDetailScore extends BaseAuditableTimeEntity<EvalIndicatorImportDetailScore, Long> { | |
26 | + | |
27 | + private static final long serialVersionUID = 1L; | |
28 | + | |
29 | + /** | |
30 | + * 导入记录id | |
31 | + */ | |
32 | + private Long recordId; | |
33 | + | |
34 | + /** | |
35 | + * 指标名称 | |
36 | + */ | |
37 | + private String indicatorName; | |
38 | + | |
39 | + /** | |
40 | + * 指标编码 | |
41 | + */ | |
42 | + private String indicatorCode; | |
43 | + | |
44 | + /** | |
45 | + * 门店id | |
46 | + */ | |
47 | + private Long shopId; | |
48 | + | |
49 | + /** | |
50 | + * 门店名称 | |
51 | + */ | |
52 | + private String shopName; | |
53 | + | |
54 | + | |
55 | + /** | |
56 | + * 得分 | |
57 | + */ | |
58 | + private BigDecimal score; | |
59 | + | |
60 | + /** | |
61 | + * 总分 | |
62 | + */ | |
63 | + private BigDecimal totalScore; | |
64 | + | |
65 | + /** | |
66 | + * 打分人员名称 | |
67 | + */ | |
68 | + private String graderStaffName; | |
69 | + | |
70 | + /** | |
71 | + * 打分人员id | |
72 | + */ | |
73 | + private Long graderStaffId; | |
74 | + | |
75 | + /** | |
76 | + * 阶段数据开始日期 | |
77 | + */ | |
78 | + private LocalDate stageStartDataDate; | |
79 | + | |
80 | + /** | |
81 | + * 阶段数据结束日期 | |
82 | + */ | |
83 | + private LocalDate stageEndDataDate; | |
84 | + | |
85 | + /** | |
86 | + * 数据结束日期 | |
87 | + */ | |
88 | + private LocalDate dataDate; | |
89 | + | |
90 | + /** | |
91 | + * 错误提示 | |
92 | + */ | |
93 | + private ImportErrorReasonEnum errorType; | |
94 | + | |
95 | + /** | |
96 | + * 有效 | |
97 | + */ | |
98 | + private Boolean valid; | |
99 | + | |
100 | + /** | |
101 | + * 逻辑删除 | |
102 | + */ | |
103 | + private Boolean yn; | |
104 | + | |
105 | + public EvalIndicatorImportDetailScore() { | |
106 | + } | |
107 | + | |
108 | +} | ... | ... |
fw-morax-domain/src/main/java/cn/fw/morax/domain/dto/query/EvalIndicatorImportScoreQueryDTO.java
0 → 100644
1 | +package cn.fw.morax.domain.dto.query; | |
2 | + | |
3 | +import cn.fw.common.page.BasePageQuery; | |
4 | +import cn.fw.common.web.annotation.LoginContextField; | |
5 | +import lombok.Data; | |
6 | + | |
7 | +import java.time.LocalDate; | |
8 | +import java.time.YearMonth; | |
9 | + | |
10 | +@Data | |
11 | +public class EvalIndicatorImportScoreQueryDTO extends BasePageQuery { | |
12 | + | |
13 | + /** | |
14 | + * 指标编码 | |
15 | + */ | |
16 | + private String indicatorCode; | |
17 | + | |
18 | + /** | |
19 | + * 导入人员 | |
20 | + */ | |
21 | + private Long userId; | |
22 | + | |
23 | + /** | |
24 | + * 开始导入时间 | |
25 | + */ | |
26 | + private YearMonth monthly; | |
27 | + | |
28 | + /** | |
29 | + * 集团id | |
30 | + */ | |
31 | + @LoginContextField(LoginContextField.Name.GROUP_ID) | |
32 | + private Long groupId; | |
33 | + | |
34 | +} | ... | ... |
fw-morax-domain/src/main/java/cn/fw/morax/domain/enums/EvalIndicatorImportTypeEnum.java
fw-morax-domain/src/main/java/cn/fw/morax/domain/vo/eval/EvalIndicatorImportDetailScoreVO.java
0 → 100644
1 | +package cn.fw.morax.domain.vo.eval; | |
2 | + | |
3 | +import cn.fw.common.data.entity.BaseAuditableTimeEntity; | |
4 | +import cn.fw.morax.domain.enums.ImportErrorReasonEnum; | |
5 | +import com.baomidou.mybatisplus.annotation.TableName; | |
6 | +import lombok.Data; | |
7 | +import lombok.EqualsAndHashCode; | |
8 | +import lombok.experimental.Accessors; | |
9 | + | |
10 | +import java.math.BigDecimal; | |
11 | +import java.time.LocalDate; | |
12 | + | |
13 | +/** | |
14 | + * <p> | |
15 | + * 自定义指标导入数据 | |
16 | + * </p> | |
17 | + * | |
18 | + * @author jiangchao | |
19 | + * @since 2024-03-26 | |
20 | + */ | |
21 | +@Data | |
22 | +@EqualsAndHashCode(callSuper = false) | |
23 | +@Accessors(chain = true) | |
24 | +public class EvalIndicatorImportDetailScoreVO { | |
25 | + | |
26 | + private static final long serialVersionUID = 1L; | |
27 | + | |
28 | + /** | |
29 | + * 导入记录id | |
30 | + */ | |
31 | + private Long id; | |
32 | + | |
33 | + | |
34 | + /** | |
35 | + * 导入记录id | |
36 | + */ | |
37 | + private Long recordId; | |
38 | + | |
39 | + /** | |
40 | + * 指标名称 | |
41 | + */ | |
42 | + private String indicatorName; | |
43 | + | |
44 | + /** | |
45 | + * 指标编码 | |
46 | + */ | |
47 | + private String indicatorCode; | |
48 | + | |
49 | + /** | |
50 | + * 门店id | |
51 | + */ | |
52 | + private Long shopId; | |
53 | + | |
54 | + /** | |
55 | + * 门店名称 | |
56 | + */ | |
57 | + private String shopName; | |
58 | + | |
59 | + | |
60 | + /** | |
61 | + * 得分 | |
62 | + */ | |
63 | + private BigDecimal score; | |
64 | + | |
65 | + /** | |
66 | + * 总分 | |
67 | + */ | |
68 | + private BigDecimal totalScore; | |
69 | + | |
70 | + /** | |
71 | + * 打分人员名称 | |
72 | + */ | |
73 | + private String graderStaffName; | |
74 | + | |
75 | + /** | |
76 | + * 打分人员id | |
77 | + */ | |
78 | + private Long graderStaffId; | |
79 | + | |
80 | + /** | |
81 | + * 阶段数据开始日期 | |
82 | + */ | |
83 | + private LocalDate stageStartDataDate; | |
84 | + | |
85 | + /** | |
86 | + * 阶段数据结束日期 | |
87 | + */ | |
88 | + private LocalDate stageEndDataDate; | |
89 | + | |
90 | + /** | |
91 | + * 数据结束日期 | |
92 | + */ | |
93 | + private LocalDate dataDate; | |
94 | + | |
95 | + /** | |
96 | + * 错误提示 | |
97 | + */ | |
98 | + private ImportErrorReasonEnum errorType; | |
99 | + | |
100 | + /** | |
101 | + * 有效 | |
102 | + */ | |
103 | + private Boolean valid; | |
104 | + | |
105 | + /** | |
106 | + * 逻辑删除 | |
107 | + */ | |
108 | + private Boolean yn; | |
109 | + | |
110 | + public EvalIndicatorImportDetailScoreVO() { | |
111 | + } | |
112 | + | |
113 | +} | ... | ... |
fw-morax-domain/src/main/java/cn/fw/morax/domain/vo/eval/EvalIndicatorImportVO.java
0 → 100644
1 | +package cn.fw.morax.domain.vo.eval; | |
2 | + | |
3 | +import cn.fw.morax.domain.enums.DataTimeTypeEnum; | |
4 | +import cn.fw.morax.domain.enums.DimensionTypeEnum; | |
5 | +import cn.fw.morax.domain.enums.SettingDraftStatusEnum; | |
6 | +import lombok.Data; | |
7 | +import lombok.EqualsAndHashCode; | |
8 | +import lombok.experimental.Accessors; | |
9 | + | |
10 | +import java.time.LocalDate; | |
11 | +import java.util.Date; | |
12 | +import java.util.List; | |
13 | + | |
14 | +/** | |
15 | + * <p> | |
16 | + * 考评指标导入记录 | |
17 | + * </p> | |
18 | + * | |
19 | + * @author jiangchao | |
20 | + * @since 2023-01-30 | |
21 | + */ | |
22 | +@Data | |
23 | +@EqualsAndHashCode(callSuper = false) | |
24 | +@Accessors(chain = true) | |
25 | +public class EvalIndicatorImportVO<T> { | |
26 | + | |
27 | + private static final long serialVersionUID = 1L; | |
28 | + | |
29 | + /** | |
30 | + * 导入人员id | |
31 | + */ | |
32 | + private Long id; | |
33 | + | |
34 | + /** | |
35 | + * 导入人员id | |
36 | + */ | |
37 | + private Long importUserId; | |
38 | + | |
39 | + /** | |
40 | + * 导入人员名称 | |
41 | + */ | |
42 | + private String importUserName; | |
43 | + | |
44 | + /** | |
45 | + * 门店id | |
46 | + */ | |
47 | + private Long shopId; | |
48 | + | |
49 | + /** | |
50 | + * 门店名称 | |
51 | + */ | |
52 | + private String shopName; | |
53 | + | |
54 | + /** | |
55 | + * 维度类型 1:人员 2:门店 | |
56 | + */ | |
57 | + private DimensionTypeEnum dimensionType; | |
58 | + | |
59 | + /** | |
60 | + * 指标编码 | |
61 | + */ | |
62 | + private String indicatorCode; | |
63 | + | |
64 | + /** | |
65 | + * 指标库名称 | |
66 | + */ | |
67 | + private String indicatorName; | |
68 | + | |
69 | + /** | |
70 | + * 类型:1: 百分比 2:数量 3:条件值 4:金额 | |
71 | + */ | |
72 | + private Integer valueType; | |
73 | + | |
74 | + /** | |
75 | + * 数据日期 | |
76 | + */ | |
77 | + private LocalDate dataDate; | |
78 | + | |
79 | + /** | |
80 | + * 导入条数 | |
81 | + */ | |
82 | + private Integer num; | |
83 | + | |
84 | + /** | |
85 | + * 成功导入条数 | |
86 | + */ | |
87 | + private Integer successNum; | |
88 | + | |
89 | + /** | |
90 | + * 失败导入条数 | |
91 | + */ | |
92 | + private Integer errorNum; | |
93 | + | |
94 | + /** | |
95 | + * 集团id | |
96 | + */ | |
97 | + private Long groupId; | |
98 | + | |
99 | + /** | |
100 | + * 创建时间 | |
101 | + */ | |
102 | + private Date createTime; | |
103 | + | |
104 | + /** | |
105 | + * 保存的key | |
106 | + */ | |
107 | + private String key; | |
108 | + | |
109 | + | |
110 | + /** | |
111 | + * 状态;1:审批中 2:待生效 3:生效中 4:已失效 | |
112 | + */ | |
113 | + private SettingDraftStatusEnum status; | |
114 | + | |
115 | + /** | |
116 | + * 审批单号 | |
117 | + */ | |
118 | + private String approvalNo; | |
119 | + | |
120 | + /** | |
121 | + * 数据时间类型;1:月数据 2:阶段数据 | |
122 | + */ | |
123 | + private DataTimeTypeEnum dataTimeType; | |
124 | + | |
125 | + /** | |
126 | + * 导入详情 | |
127 | + */ | |
128 | + private List<T> details; | |
129 | + | |
130 | +} | ... | ... |
fw-morax-server/src/main/java/cn/fw/morax/server/controller/app/EvalController.java
... | ... | @@ -53,6 +53,7 @@ public class EvalController { |
53 | 53 | private final SettingDraftBizService settingDraftBizService; |
54 | 54 | private final EvalGroupRankBizService evalGroupRankBizService; |
55 | 55 | private final EvalIndicatorValueBizService evalIndicatorValueBizService; |
56 | + private final EvalIndicatorImportBizService evalIndicatorImportBizService; | |
56 | 57 | private final EvalIndicatorReportService evalIndicatorReportService; |
57 | 58 | |
58 | 59 | /** |
... | ... | @@ -81,6 +82,18 @@ public class EvalController { |
81 | 82 | } |
82 | 83 | |
83 | 84 | /** |
85 | + * 自定义指标得分数据导入详情 | |
86 | + * | |
87 | + * @param id | |
88 | + * @return | |
89 | + */ | |
90 | + @GetMapping("/score-import-detail") | |
91 | + @ControllerMethod("自定义指标得分数据导入详情") | |
92 | + public Message<EvalIndicatorImportVO> scoreImportDetail(@NotNull(message = "录入详情id不能为空") Long id) { | |
93 | + return success(evalIndicatorImportBizService.scoreImportDetail(id)); | |
94 | + } | |
95 | + | |
96 | + /** | |
84 | 97 | * 导入记录详情审批查询 |
85 | 98 | * |
86 | 99 | * @return | ... | ... |
fw-morax-server/src/main/java/cn/fw/morax/server/controller/erp/EvalIndicatorImportController.java
... | ... | @@ -6,14 +6,14 @@ import cn.fw.common.web.annotation.ControllerMethod; |
6 | 6 | import cn.fw.common.web.auth.LoginAuthBean; |
7 | 7 | import cn.fw.common.web.auth.annotation.CurrentUser; |
8 | 8 | import cn.fw.data.base.domain.common.Message; |
9 | +import cn.fw.morax.common.config.EvalIndicatorCodeVal; | |
9 | 10 | import cn.fw.morax.common.utils.PublicUtil; |
11 | +import cn.fw.morax.domain.db.eval.EvalIndicator; | |
10 | 12 | import cn.fw.morax.domain.dto.query.EvalIndicatorImportDetailQueryDTO; |
11 | 13 | import cn.fw.morax.domain.dto.query.EvalIndicatorImportQueryDTO; |
14 | +import cn.fw.morax.domain.dto.query.EvalIndicatorImportScoreQueryDTO; | |
12 | 15 | import cn.fw.morax.domain.dto.query.EvalIndicatorImportSituationQueryDTO; |
13 | -import cn.fw.morax.domain.vo.eval.EvalIndicatorImportDetailVO; | |
14 | -import cn.fw.morax.domain.vo.eval.EvalIndicatorImportRecordVO; | |
15 | -import cn.fw.morax.domain.vo.eval.EvalIndicatorVO; | |
16 | -import cn.fw.morax.domain.vo.eval.IndicatorImportSituationVO; | |
16 | +import cn.fw.morax.domain.vo.eval.*; | |
17 | 17 | import cn.fw.morax.sdk.dto.eval.EvalIndicatorResult; |
18 | 18 | import cn.fw.morax.service.biz.eval.EvalIndicatorBizService; |
19 | 19 | import cn.fw.morax.service.biz.eval.EvalIndicatorImportBizService; |
... | ... | @@ -52,29 +52,55 @@ public class EvalIndicatorImportController { |
52 | 52 | private final EvalIndicatorValueBizService evalIndicatorValueBizService; |
53 | 53 | private final EvalIndicatorReportService evalIndicatorReportService; |
54 | 54 | private final EvalIndicatorBizService evalIndicatorBizService; |
55 | + private final EvalIndicatorCodeVal evalIndicatorCodeVal; | |
55 | 56 | |
56 | 57 | /** |
57 | - * 导入记录分页查询 | |
58 | + * 数据导入指标列表 | |
58 | 59 | * |
59 | 60 | * @return |
60 | 61 | */ |
61 | 62 | @IgnoreAuth |
62 | - @GetMapping("/page") | |
63 | - @ControllerMethod("导入记录分页查询") | |
64 | - public Message<AppPage<EvalIndicatorImportRecordVO>> importPage(EvalIndicatorImportQueryDTO dto) { | |
63 | + @GetMapping("/indicators") | |
64 | + @ControllerMethod("数据导入指标列表") | |
65 | + public Message<List<EvalIndicatorVO>> evalIndicators() { | |
66 | + return success(evalIndicatorImportBizService.evalIndicators()); | |
67 | + } | |
68 | + | |
69 | + /** | |
70 | + * 展厅美化导入记录分页查询 | |
71 | + * | |
72 | + * @return | |
73 | + */ | |
74 | + @IgnoreAuth | |
75 | + @GetMapping("/showroom-page") | |
76 | + @ControllerMethod("展厅美化导入记录分页查询") | |
77 | + public Message<AppPage<EvalIndicatorImportRecordVO>> showroomImportPage(EvalIndicatorImportQueryDTO dto) { | |
78 | + dto.setIndicatorCode(evalIndicatorCodeVal.getShowroomScore()); | |
65 | 79 | return success(evalIndicatorImportBizService.importPage(dto)); |
66 | 80 | } |
67 | 81 | |
68 | 82 | /** |
69 | - * 导入记录详情查询 | |
83 | + * 展厅美化导入记录详情查询 | |
84 | + * | |
85 | + * @param id | |
86 | + * @return | |
87 | + */ | |
88 | + @GetMapping("/showroom-import-detail") | |
89 | + @ControllerMethod("展厅美化导入记录详情查询") | |
90 | + public Message<EvalIndicatorImportVO> scoreImportDetail(@NotNull(message = "录入详情id不能为空") Long id) { | |
91 | + return success(evalIndicatorImportBizService.scoreImportDetail(id)); | |
92 | + } | |
93 | + | |
94 | + /** | |
95 | + * 展厅美化导入清单查询 | |
70 | 96 | * |
71 | 97 | * @return |
72 | 98 | */ |
73 | 99 | @IgnoreAuth |
74 | - @GetMapping("/detail") | |
75 | - @ControllerMethod("导入记录详情查询") | |
76 | - public Message<List<EvalIndicatorImportDetailVO>> importDetail(@Validated EvalIndicatorImportDetailQueryDTO dto) { | |
77 | - return success(evalIndicatorImportBizService.importDetail(dto)); | |
100 | + @GetMapping("/showroom-detail") | |
101 | + @ControllerMethod("展厅美化导入清单查询") | |
102 | + public Message<AppPage<EvalIndicatorImportDetailScoreVO>> showroomImportDetailPage(@Validated EvalIndicatorImportScoreQueryDTO dto) { | |
103 | + return success(evalIndicatorImportBizService.showroomImportDetailPage(dto)); | |
78 | 104 | } |
79 | 105 | |
80 | 106 | /** |
... | ... | @@ -83,7 +109,7 @@ public class EvalIndicatorImportController { |
83 | 109 | @IgnoreAuth |
84 | 110 | @PostMapping("/analysis-file/showroom-shop") |
85 | 111 | @ControllerMethod("上传展厅美化数据") |
86 | - public Message<EvalIndicatorImportRecordVO> analysisStaffExcel(@RequestParam("file") MultipartFile file, @CurrentUser LoginAuthBean user) { | |
112 | + public Message<EvalIndicatorImportVO> analysisStaffExcel(@RequestParam("file") MultipartFile file, @CurrentUser LoginAuthBean user) { | |
87 | 113 | if (file.isEmpty()) { |
88 | 114 | throw new BusinessException("请上传文件"); |
89 | 115 | } |
... | ... | @@ -91,45 +117,45 @@ public class EvalIndicatorImportController { |
91 | 117 | } |
92 | 118 | |
93 | 119 | /** |
94 | - * 上传展厅美化数据 | |
120 | + * 上传展厅美化数据——fid | |
95 | 121 | */ |
96 | 122 | @IgnoreAuth |
97 | 123 | @PostMapping("/analysis/showroom-shop") |
98 | 124 | @ControllerMethod("上传展厅美化数据") |
99 | - public Message<EvalIndicatorImportRecordVO> uploadShowroomMonthlyData(@RequestParam("fid") String fid, @CurrentUser LoginAuthBean user) { | |
125 | + public Message<EvalIndicatorImportVO> uploadShowroomMonthlyData(@RequestParam("fid") String fid, @CurrentUser LoginAuthBean user) { | |
100 | 126 | if (PublicUtil.isEmpty(fid)) { |
101 | 127 | throw new BusinessException("请上传文件"); |
102 | 128 | } |
103 | 129 | return success(evalIndicatorImportBizService.uploadShowroomMonthlyData(fid, null, user)); |
104 | 130 | } |
105 | 131 | |
106 | - /** | |
107 | - * 上传门店指标 | |
108 | - * | |
109 | - * @return | |
110 | - */ | |
111 | - @IgnoreAuth | |
112 | - @PostMapping("/analysis-shop") | |
113 | - @ControllerMethod("上传门店指标") | |
114 | - public Message<EvalIndicatorImportRecordVO> uploadShopIndicator(@RequestParam("file") MultipartFile file, @CurrentUser LoginAuthBean user) { | |
115 | - if (file.isEmpty()) { | |
116 | - throw new BusinessException("请上传文件"); | |
117 | - } | |
118 | - return success(evalIndicatorReportService.uploadShopIndicator(file, user)); | |
119 | - } | |
132 | +// /** | |
133 | +// * 上传门店指标 | |
134 | +// * | |
135 | +// * @return | |
136 | +// */ | |
137 | +// @IgnoreAuth | |
138 | +// @PostMapping("/analysis-shop") | |
139 | +// @ControllerMethod("上传门店指标") | |
140 | +// public Message<EvalIndicatorImportRecordVO> uploadShopIndicator(@RequestParam("file") MultipartFile file, @CurrentUser LoginAuthBean user) { | |
141 | +// if (file.isEmpty()) { | |
142 | +// throw new BusinessException("请上传文件"); | |
143 | +// } | |
144 | +// return success(evalIndicatorReportService.uploadShopIndicator(file, user)); | |
145 | +// } | |
120 | 146 | |
121 | 147 | /** |
122 | - * 保存上传人员数据 | |
148 | + * 保存展厅美化数据 | |
123 | 149 | * |
124 | 150 | * @return |
125 | 151 | */ |
126 | - @GetMapping("/save-import") | |
152 | + @GetMapping("/save-showroom-import") | |
127 | 153 | @ControllerMethod("保存上传人员数据") |
128 | - public Message<Void> uploadStaffIndicator(String key, @CurrentUser LoginAuthBean user) { | |
154 | + public Message<Void> saveShowroomImportData(String key, @CurrentUser LoginAuthBean user) { | |
129 | 155 | if (PublicUtil.isEmpty(key)) { |
130 | 156 | throw new BusinessException("参数错误"); |
131 | 157 | } |
132 | - evalIndicatorImportBizService.saveImportIndicator(key, user); | |
158 | + evalIndicatorImportBizService.saveShowroomImportData(key, user); | |
133 | 159 | return success(); |
134 | 160 | } |
135 | 161 | ... | ... |
fw-morax-server/src/main/resources/application-test.yml
fw-morax-service/src/main/java/cn/fw/morax/service/biz/ApprovalBizService.java
... | ... | @@ -460,6 +460,7 @@ public class ApprovalBizService { |
460 | 460 | conditions.add(commonService.createShopTypes(shopIds)); |
461 | 461 | Map extDataMap = new HashMap<String, Object>() {{ |
462 | 462 | put("evalIndicatorImportRecordId", record.getId()); |
463 | + put("importType", record.getImportType().getValue()); | |
463 | 464 | }}; |
464 | 465 | FlowDto flowDto = FlowDto.builder() |
465 | 466 | .groupId(user.getGroupId()) | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/biz/eval/EvalIndicatorImportBizService.java
... | ... | @@ -7,27 +7,16 @@ import cn.fw.common.web.auth.LoginAuthBean; |
7 | 7 | import cn.fw.morax.common.config.EvalIndicatorCodeVal; |
8 | 8 | import cn.fw.morax.common.config.EvalIndicatorVal; |
9 | 9 | import cn.fw.morax.common.config.FileVal; |
10 | -import cn.fw.morax.common.constant.Constant; | |
11 | -import cn.fw.morax.common.utils.ExcelDataUtil; | |
12 | 10 | import cn.fw.morax.common.utils.PublicUtil; |
13 | -import cn.fw.morax.domain.db.eval.EvalIndicator; | |
14 | -import cn.fw.morax.domain.db.eval.EvalIndicatorImportDetail; | |
15 | -import cn.fw.morax.domain.db.eval.EvalIndicatorImportKeyValue; | |
16 | -import cn.fw.morax.domain.db.eval.EvalIndicatorImportRecord; | |
17 | -import cn.fw.morax.domain.db.salary.IndividualTaxImportLog; | |
18 | -import cn.fw.morax.domain.db.salary.SalaryPool; | |
11 | +import cn.fw.morax.domain.db.eval.*; | |
19 | 12 | import cn.fw.morax.domain.dto.query.EvalIndicatorImportDetailQueryDTO; |
20 | 13 | import cn.fw.morax.domain.dto.query.EvalIndicatorImportQueryDTO; |
14 | +import cn.fw.morax.domain.dto.query.EvalIndicatorImportScoreQueryDTO; | |
21 | 15 | import cn.fw.morax.domain.enums.*; |
22 | 16 | import cn.fw.morax.domain.vo.eval.*; |
23 | -import cn.fw.morax.domain.vo.salary.DealerTaxVO; | |
24 | -import cn.fw.morax.domain.vo.salary.StaffPersonTaxVO; | |
25 | 17 | import cn.fw.morax.rpc.approval.FlowApproveRpc; |
26 | 18 | import cn.fw.morax.rpc.ehr.EhrRpcService; |
27 | -import cn.fw.morax.rpc.ehr.dto.StaffInfoDTO; | |
28 | -import cn.fw.morax.rpc.ehr.dto.StaffShopInfoDTO; | |
29 | 19 | import cn.fw.morax.rpc.file.FileRpcService; |
30 | -import cn.fw.morax.rpc.file.dto.DfsFileDTO; | |
31 | 20 | import cn.fw.morax.rpc.oop.OopRpcService; |
32 | 21 | import cn.fw.morax.rpc.oop.dto.ShopDTO; |
33 | 22 | import cn.fw.morax.service.biz.ApprovalBizService; |
... | ... | @@ -41,28 +30,18 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
41 | 30 | import com.google.common.collect.Lists; |
42 | 31 | import lombok.RequiredArgsConstructor; |
43 | 32 | import lombok.extern.slf4j.Slf4j; |
44 | -import org.apache.commons.collections4.map.MultiKeyMap; | |
45 | -import org.apache.commons.lang3.math.NumberUtils; | |
46 | -import org.apache.poi.ss.formula.functions.T; | |
47 | -import org.apache.poi.xssf.usermodel.XSSFSheet; | |
48 | -import org.apache.poi.xssf.usermodel.XSSFWorkbook; | |
49 | 33 | import org.springframework.data.redis.core.BoundValueOperations; |
50 | 34 | import org.springframework.data.redis.core.StringRedisTemplate; |
51 | 35 | import org.springframework.stereotype.Service; |
52 | 36 | import org.springframework.transaction.annotation.Transactional; |
53 | 37 | import org.springframework.web.multipart.MultipartFile; |
54 | 38 | |
55 | -import java.io.ByteArrayInputStream; | |
56 | -import java.io.IOException; | |
57 | -import java.math.BigDecimal; | |
58 | -import java.math.RoundingMode; | |
59 | 39 | import java.time.LocalDate; |
60 | 40 | import java.time.LocalDateTime; |
61 | 41 | import java.time.LocalTime; |
62 | 42 | import java.time.YearMonth; |
63 | 43 | import java.util.*; |
64 | 44 | import java.util.concurrent.TimeUnit; |
65 | -import java.util.function.Function; | |
66 | 45 | import java.util.stream.Collectors; |
67 | 46 | |
68 | 47 | import static cn.fw.common.businessvalidator.Validator.BV; |
... | ... | @@ -79,6 +58,7 @@ public class EvalIndicatorImportBizService { |
79 | 58 | |
80 | 59 | private final EvalIndicatorImportKeyValueService evalIndicatorImportKeyValueService; |
81 | 60 | private final EvalIndicatorImportRecordService evalIndicatorImportRecordService; |
61 | + private final EvalIndicatorImportDetailScoreService evalIndicatorImportDetailScoreService; | |
82 | 62 | private final EvalIndicatorImportDetailService evalIndicatorImportDetailService; |
83 | 63 | private final EvalIndicatorCommonService evalIndicatorCommonService; |
84 | 64 | private final SalaryGeneralSettinService salaryGeneralSettinService; |
... | ... | @@ -97,6 +77,24 @@ public class EvalIndicatorImportBizService { |
97 | 77 | private final FileVal fileVal; |
98 | 78 | |
99 | 79 | /** |
80 | + * 数据导入指标列表 | |
81 | + */ | |
82 | + public List<EvalIndicatorVO> evalIndicators() { | |
83 | + List<String> evalIndicatorCodes = new ArrayList<String>() {{ | |
84 | + add(evalIndicatorCodeVal.getShowroomScore()); | |
85 | + }}; | |
86 | + List<EvalIndicator> evalIndicators = evalIndicatorService.list(Wrappers.<EvalIndicator>lambdaQuery() | |
87 | + .in(EvalIndicator::getCode, evalIndicatorCodes) | |
88 | + .eq(EvalIndicator::getYn, Boolean.TRUE) | |
89 | + ); | |
90 | + if (PublicUtil.isEmpty(evalIndicators)) { | |
91 | + return new ArrayList<>(); | |
92 | + } | |
93 | + List<EvalIndicatorVO> evalIndicatorVos = PublicUtil.copyList(evalIndicators, EvalIndicatorVO.class); | |
94 | + return evalIndicatorVos; | |
95 | + } | |
96 | + | |
97 | + /** | |
100 | 98 | * 分页查询 |
101 | 99 | * |
102 | 100 | * @param dto |
... | ... | @@ -111,7 +109,7 @@ public class EvalIndicatorImportBizService { |
111 | 109 | .eq(PublicUtil.isNotEmpty(dto.getIndicatorCode()), EvalIndicatorImportRecord::getIndicatorCode, dto.getIndicatorCode()) |
112 | 110 | .ge(PublicUtil.isNotEmpty(startTime), EvalIndicatorImportRecord::getCreateTime, startTime) |
113 | 111 | .le(PublicUtil.isNotEmpty(endTime), EvalIndicatorImportRecord::getCreateTime, endTime) |
114 | - .eq(EvalIndicatorImportRecord::getImportType, EvalIndicatorImportTypeEnum.ORIGIN_VALUE) | |
112 | + .eq(EvalIndicatorImportRecord::getImportType, EvalIndicatorImportTypeEnum.SCORE_ORIGIN_VALUE) | |
115 | 113 | .eq(EvalIndicatorImportRecord::getYn, Boolean.TRUE) |
116 | 114 | .eq(EvalIndicatorImportRecord::getGroupId, dto.getGroupId()) |
117 | 115 | .orderByDesc(EvalIndicatorImportRecord::getCreateTime) |
... | ... | @@ -158,9 +156,38 @@ public class EvalIndicatorImportBizService { |
158 | 156 | return detailVOS; |
159 | 157 | } |
160 | 158 | |
159 | + /** | |
160 | + * 展厅梅花导入数据分页查询 | |
161 | + * | |
162 | + * @param dto | |
163 | + * @return | |
164 | + */ | |
165 | + public AppPage<EvalIndicatorImportDetailScoreVO> showroomImportDetailPage(EvalIndicatorImportScoreQueryDTO dto) { | |
166 | + final YearMonth monthly = dto.getMonthly(); | |
167 | + LocalDate startTime = (PublicUtil.isNotEmpty(monthly)) ? monthly.atDay(1) : null; | |
168 | + LocalDate endTime = (PublicUtil.isNotEmpty(monthly)) ? monthly.atEndOfMonth() : null; | |
169 | + PageData<EvalIndicatorImportDetailScore> pageData = evalIndicatorImportDetailScoreService.page(new PageData<>(dto.getCurrent(), dto.getPageSize()), | |
170 | + Wrappers.<EvalIndicatorImportDetailScore>lambdaQuery() | |
171 | + .eq(PublicUtil.isNotEmpty(dto.getIndicatorCode()), EvalIndicatorImportDetailScore::getIndicatorCode, dto.getIndicatorCode()) | |
172 | + .ge(PublicUtil.isNotEmpty(startTime), EvalIndicatorImportDetailScore::getCreateTime, startTime) | |
173 | + .le(PublicUtil.isNotEmpty(endTime), EvalIndicatorImportDetailScore::getCreateTime, endTime) | |
174 | + .isNull(EvalIndicatorImportDetailScore::getErrorType) | |
175 | + .eq(EvalIndicatorImportDetailScore::getValid, Boolean.TRUE) | |
176 | + .eq(EvalIndicatorImportDetailScore::getYn, Boolean.TRUE) | |
177 | + ); | |
178 | + | |
179 | + return PublicUtil.toPage(pageData, importDetailScore -> { | |
180 | + EvalIndicatorImportDetailScoreVO importDetailScoreVO = PublicUtil.copy(importDetailScore, EvalIndicatorImportDetailScoreVO.class); | |
181 | + return importDetailScoreVO; | |
182 | + }); | |
183 | + } | |
184 | + | |
161 | 185 | @Transactional(rollbackFor = Exception.class) |
162 | - public EvalIndicatorImportRecordVO uploadShowroomMonthlyData(String fid, MultipartFile file, LoginAuthBean user) { | |
186 | + public EvalIndicatorImportVO uploadShowroomMonthlyData(String fid, MultipartFile file, LoginAuthBean user) { | |
163 | 187 | final DataTimeTypeEnum dataTimeType = DataTimeTypeEnum.MONTHLY; |
188 | + EvalIndicator evalIndicator = evalIndicatorService.queryByCode(evalIndicatorCodeVal.getShowroomScore(), Boolean.FALSE); | |
189 | + BV.notNull(evalIndicator, "展厅美化指标不存在,请重试"); | |
190 | + | |
164 | 191 | final Map<String, ShopDTO> shopMap = evalIndicatorCommonService.getShopNameMap(user); |
165 | 192 | Map<Integer, String> headerAlias = this.getShopHeaderNameMap(dataTimeType); |
166 | 193 | List<ShowroomScoreImportValueVO> indicatorValues = null; |
... | ... | @@ -171,63 +198,56 @@ public class EvalIndicatorImportBizService { |
171 | 198 | } |
172 | 199 | |
173 | 200 | EvalIndicatorImportRecord importRecord = this.createRecord(user, DimensionTypeEnum.SHOP); |
174 | - List<EvalIndicatorImportDetail> details = new ArrayList<>(); | |
201 | + importRecord.setImportType(EvalIndicatorImportTypeEnum.SCORE_ORIGIN_VALUE); | |
202 | + List<EvalIndicatorImportDetailScore> details = new ArrayList<>(); | |
175 | 203 | Integer errorNum = 0; |
176 | 204 | for (ShowroomScoreImportValueVO shop : indicatorValues) { |
177 | - EvalIndicatorImportDetail importDetail = this.convertShopPo(shop, dataTimeType); | |
178 | - details.add(importDetail); | |
205 | + EvalIndicatorImportDetailScore importDetailScore = this.convertShopPo(shop, dataTimeType); | |
206 | + details.add(importDetailScore); | |
179 | 207 | |
180 | 208 | if (! shopMap.containsKey(shop.getShopName())) { |
181 | - importDetail.setErrorType(ImportErrorReasonEnum.NO_MATCH_SHOP); | |
209 | + importDetailScore.setErrorType(ImportErrorReasonEnum.NO_MATCH_SHOP); | |
182 | 210 | errorNum += 1; |
183 | 211 | continue; |
184 | 212 | } |
185 | 213 | ShopDTO shopDTO = shopMap.get(shop.getShopName()); |
186 | - importDetail.setShopId(shopDTO.getId()); | |
187 | - | |
188 | - importDetail.setIndicatorCode(evalIndicatorCodeVal.getShowroomScore()); | |
189 | - importDetail.setIndicatorName(""); | |
190 | - importDetail.setDataType(DataTypeEnum.RATIO); | |
191 | - importDetail.setUnit("%"); | |
192 | - //指标率 | |
193 | - if (PublicUtil.isEmpty(shop.getScore()) && PublicUtil.isEmpty(shop.getTotalScore())) { | |
194 | - importDetail.setIndicatorValue(shop.getScore().divide(shop.getTotalScore(), 4, RoundingMode.HALF_UP)); | |
195 | - } | |
214 | + importDetailScore.setShopId(shopDTO.getId()); | |
215 | + | |
216 | + importDetailScore.setIndicatorCode(evalIndicatorCodeVal.getShowroomScore()); | |
217 | + importDetailScore.setIndicatorName(evalIndicator.getName()); | |
218 | + | |
219 | + importDetailScore.setScore(shop.getScore()); | |
220 | + importDetailScore.setTotalScore(shop.getTotalScore()); | |
221 | + importDetailScore.setGraderStaffName(shop.getGraderStaffName()); | |
222 | +// importDetailScore.setGraderStaffId(shop.getGraderStaffId()); | |
196 | 223 | |
197 | - List<EvalIndicatorImportKeyValue> keyValues = new ArrayList<>(); | |
198 | - keyValues.add(new EvalIndicatorImportKeyValue("l1", "打分", shop.getScore().toString())); | |
199 | - keyValues.add(new EvalIndicatorImportKeyValue("l2", "总分", shop.getTotalScore().toString())); | |
200 | - keyValues.add(new EvalIndicatorImportKeyValue("l3", "打分人员", shop.getGraderStaffName())); | |
201 | - importDetail.setKeyValues(keyValues); | |
202 | 224 | } |
203 | 225 | LocalDate dataDate = details.stream() |
204 | - .filter(detail -> PublicUtil.isEmpty(detail.getErrorType()) && PublicUtil.isNotEmpty(detail.getEndDataDate())) | |
205 | - .sorted(Comparator.comparing(EvalIndicatorImportDetail::getEndDataDate).reversed()) | |
206 | - .map(EvalIndicatorImportDetail::getEndDataDate) | |
226 | + .filter(detail -> PublicUtil.isEmpty(detail.getErrorType()) && PublicUtil.isNotEmpty(detail.getDataDate())) | |
227 | + .map(EvalIndicatorImportDetailScore::getDataDate) | |
207 | 228 | .findFirst().orElse(LocalDate.now()); |
208 | 229 | importRecord.setDataDate(dataDate); |
209 | 230 | importRecord.setErrorNum(errorNum); |
210 | 231 | importRecord.setNum(indicatorValues.size()); |
211 | 232 | importRecord.setSuccessNum(indicatorValues.size() - errorNum); |
212 | 233 | importRecord.setDataTimeType(dataTimeType); |
213 | - //导入指标信息 | |
214 | - this.setImportIndicatorInfo(importRecord, details); | |
234 | + importRecord.setIndicatorName(evalIndicator.getName()); | |
235 | + importRecord.setIndicatorCode(evalIndicatorCodeVal.getShowroomScore()); | |
215 | 236 | |
216 | 237 | String key = PublicUtil.getUUID() + user.getUserId(); |
217 | - stringRedisTemplate.opsForValue().set(evalIndicatorVal.getEvalImport() + key, JSON.toJSONString(importRecord), 1 , TimeUnit.DAYS); | |
218 | - stringRedisTemplate.opsForValue().set(evalIndicatorVal.getEvalImportDetail() + key, JSON.toJSONString(details), 1 , TimeUnit.DAYS); | |
238 | + stringRedisTemplate.opsForValue().set(evalIndicatorVal.getEvalShowroomBeautificationImport() + key, JSON.toJSONString(importRecord), 1 , TimeUnit.DAYS); | |
239 | + stringRedisTemplate.opsForValue().set(evalIndicatorVal.getEvalShowroomBeautificationImportDetail() + key, JSON.toJSONString(details), 1 , TimeUnit.DAYS); | |
219 | 240 | |
220 | - EvalIndicatorImportRecordVO recordVO = PublicUtil.copy(importRecord, EvalIndicatorImportRecordVO.class); | |
221 | - List<EvalIndicatorImportDetailVO> detailVos = PublicUtil.copyList(details, EvalIndicatorImportDetailVO.class); | |
222 | - recordVO.setDetails(detailVos); | |
241 | + EvalIndicatorImportVO<EvalIndicatorImportDetailScore> recordVO = PublicUtil.copy(importRecord, EvalIndicatorImportVO.class); | |
242 | + recordVO.setDetails(details); | |
223 | 243 | recordVO.setKey(key); |
224 | 244 | return recordVO; |
225 | 245 | } |
226 | 246 | |
227 | 247 | @Transactional(rollbackFor = Exception.class) |
228 | - public void saveImportIndicator(String key, LoginAuthBean user) { | |
229 | - BoundValueOperations<String, String> importOperation = stringRedisTemplate.boundValueOps(evalIndicatorVal.getEvalImport() + key); | |
230 | - BoundValueOperations<String, String> importDetailOperation = stringRedisTemplate.boundValueOps(evalIndicatorVal.getEvalImportDetail() + key); | |
248 | + public void saveShowroomImportData(String key, LoginAuthBean user) { | |
249 | + BoundValueOperations<String, String> importOperation = stringRedisTemplate.boundValueOps(evalIndicatorVal.getEvalShowroomBeautificationImport() + key); | |
250 | + BoundValueOperations<String, String> importDetailOperation = stringRedisTemplate.boundValueOps(evalIndicatorVal.getEvalShowroomBeautificationImportDetail() + key); | |
231 | 251 | String json = importOperation.get(); |
232 | 252 | String detailJson = importDetailOperation.get(); |
233 | 253 | if (PublicUtil.isEmpty(json) || PublicUtil.isEmpty(detailJson)) { |
... | ... | @@ -237,25 +257,18 @@ public class EvalIndicatorImportBizService { |
237 | 257 | EvalIndicatorImportRecord record = JSON.parseObject(json, EvalIndicatorImportRecord.class); |
238 | 258 | final Set<String> uploadIndicatorCodes = new HashSet<String>(){{add(record.getIndicatorCode());}}; |
239 | 259 | record.setStatus(SettingDraftStatusEnum.RELEASE_APPROVAL); |
240 | - List<EvalIndicatorImportDetail> details = JSON.parseArray(detailJson, EvalIndicatorImportDetail.class); | |
260 | + List<EvalIndicatorImportDetailScore> details = JSON.parseArray(detailJson, EvalIndicatorImportDetailScore.class); | |
241 | 261 | |
242 | 262 | evalIndicatorImportRecordService.save(record); |
243 | 263 | final Long recordId = record.getId(); |
244 | - for (EvalIndicatorImportDetail detail : details) { | |
264 | + for (EvalIndicatorImportDetailScore detail : details) { | |
245 | 265 | detail.setRecordId(recordId); |
246 | - evalIndicatorImportDetailService.save(detail); | |
247 | - final Long evalIndicatorImportDetailId = detail.getId(); | |
248 | - //详情数据 | |
249 | - for (EvalIndicatorImportKeyValue keyValue : Optional.ofNullable(detail.getKeyValues()).orElse(new ArrayList<>())) { | |
250 | - keyValue.setRecordId(recordId); | |
251 | - keyValue.setEvalIndicatorImportDetailId(evalIndicatorImportDetailId); | |
252 | - evalIndicatorImportKeyValueService.save(keyValue); | |
253 | - } | |
266 | + evalIndicatorImportDetailScoreService.save(detail); | |
254 | 267 | } |
255 | 268 | |
256 | 269 | List<Long> shopIds = details.stream() |
257 | 270 | .filter(detail -> PublicUtil.isNotEmpty(detail.getShopId()) && PublicUtil.isEmpty(detail.getErrorType())) |
258 | - .map(EvalIndicatorImportDetail::getShopId) | |
271 | + .map(EvalIndicatorImportDetailScore::getShopId) | |
259 | 272 | .collect(Collectors.toList()); |
260 | 273 | //提交审批 |
261 | 274 | Date expTime = evalIndicatorCommonService.importApprovalExpTime(user.getGroupId()); |
... | ... | @@ -264,8 +277,24 @@ public class EvalIndicatorImportBizService { |
264 | 277 | evalIndicatorImportRecordService.updateById(record); |
265 | 278 | |
266 | 279 | //保存到数据库,删除缓存 |
267 | - stringRedisTemplate.delete(evalIndicatorVal.getEvalImport() + key); | |
268 | - stringRedisTemplate.delete(evalIndicatorVal.getEvalImportDetail() + key); | |
280 | + stringRedisTemplate.delete(evalIndicatorVal.getEvalShowroomBeautificationImport() + key); | |
281 | + stringRedisTemplate.delete(evalIndicatorVal.getEvalShowroomBeautificationImportDetail() + key); | |
282 | + } | |
283 | + | |
284 | + public EvalIndicatorImportVO scoreImportDetail(Long id) { | |
285 | + EvalIndicatorImportRecord record = evalIndicatorImportRecordService.getById(id); | |
286 | + BV.notNull(record, "考评导入数据记录不能为空"); | |
287 | + | |
288 | + List<EvalIndicatorImportDetailScore> importDetailScores = evalIndicatorImportDetailScoreService.list(Wrappers.<EvalIndicatorImportDetailScore>lambdaQuery() | |
289 | + .eq(EvalIndicatorImportDetailScore::getRecordId, id) | |
290 | + .eq(EvalIndicatorImportDetailScore::getYn, Boolean.TRUE) | |
291 | + ); | |
292 | + List<EvalIndicatorImportDetailScoreVO> detailScoreVos = PublicUtil.copyList(importDetailScores, EvalIndicatorImportDetailScoreVO.class); | |
293 | + | |
294 | + EvalIndicatorImportVO<EvalIndicatorImportDetailScoreVO> recordVO = PublicUtil.copy(record, EvalIndicatorImportVO.class); | |
295 | + recordVO.setDetails(detailScoreVos); | |
296 | + | |
297 | + return recordVO; | |
269 | 298 | } |
270 | 299 | |
271 | 300 | /** |
... | ... | @@ -273,17 +302,17 @@ public class EvalIndicatorImportBizService { |
273 | 302 | * @param importRecord |
274 | 303 | * @param details |
275 | 304 | */ |
276 | - public void setImportIndicatorInfo(EvalIndicatorImportRecord importRecord, List<EvalIndicatorImportDetail> details) { | |
277 | - Optional<EvalIndicatorImportDetail> effectImportDetail = details.stream() | |
305 | + public void setImportIndicatorInfo(EvalIndicatorImportRecord importRecord, List<EvalIndicatorImportDetailScore> details) { | |
306 | + Optional<EvalIndicatorImportDetailScore> effectImportDetail = details.stream() | |
278 | 307 | .filter(detail -> PublicUtil.isEmpty(detail.getErrorType()) && PublicUtil.isNotEmpty(detail.getIndicatorName())) |
279 | 308 | .findFirst(); |
280 | - importRecord.setIndicatorName(effectImportDetail.map(EvalIndicatorImportDetail::getIndicatorName).orElse("")); | |
281 | - importRecord.setIndicatorCode(effectImportDetail.map(EvalIndicatorImportDetail::getIndicatorCode).orElse("")); | |
309 | + importRecord.setIndicatorName(effectImportDetail.map(EvalIndicatorImportDetailScore::getIndicatorName).orElse("")); | |
310 | + importRecord.setIndicatorCode(effectImportDetail.map(EvalIndicatorImportDetailScore::getIndicatorCode).orElse("")); | |
282 | 311 | } |
283 | 312 | |
284 | 313 | public EvalIndicatorImportRecord createRecord(LoginAuthBean user, DimensionTypeEnum dimensionType) { |
285 | 314 | EvalIndicatorImportRecord importRecord = new EvalIndicatorImportRecord(); |
286 | - importRecord.setImportType(EvalIndicatorImportTypeEnum.ORIGIN_VALUE); | |
315 | + importRecord.setImportType(EvalIndicatorImportTypeEnum.SCORE_ORIGIN_VALUE); | |
287 | 316 | importRecord.setImportUserId(user.getUserId()); |
288 | 317 | importRecord.setImportUserName(user.getUserName()); |
289 | 318 | importRecord.setDimensionType(dimensionType); |
... | ... | @@ -316,22 +345,16 @@ public class EvalIndicatorImportBizService { |
316 | 345 | return headerMap; |
317 | 346 | } |
318 | 347 | |
319 | - public EvalIndicatorImportDetail convertShopPo(ShowroomScoreImportValueVO shopValue, DataTimeTypeEnum dataTimeType) { | |
348 | + public EvalIndicatorImportDetailScore convertShopPo(ShowroomScoreImportValueVO shopValue, DataTimeTypeEnum dataTimeType) { | |
320 | 349 | Optional<ShowroomScoreImportValueVO> valueOptional = Optional.ofNullable(shopValue); |
321 | - EvalIndicatorImportDetail detail = new EvalIndicatorImportDetail(); | |
350 | + EvalIndicatorImportDetailScore detail = new EvalIndicatorImportDetailScore(); | |
322 | 351 | detail.setIndicatorCode(evalIndicatorCodeVal.getShowroomScore()); |
323 | 352 | detail.setShopName(valueOptional.map(ShowroomScoreImportValueVO::getShopName).orElse("")); |
324 | - //值 | |
325 | - detail.setIndicatorValue(BigDecimal.ZERO); | |
326 | 353 | if (PublicUtil.isNotEmpty(shopValue.getMonthlyDate())) { |
327 | 354 | detail.setDataDate(evalIndicatorCommonService.convertMonthlyDate(shopValue.getMonthlyDate())); |
328 | 355 | } |
329 | - if (PublicUtil.isNotEmpty(shopValue.getScore()) && PublicUtil.isNotEmpty(shopValue.getTotalScore())) { | |
330 | - BigDecimal value = shopValue.getScore().divide(shopValue.getTotalScore(), 4, RoundingMode.HALF_UP); | |
331 | - detail.setIndicatorValue(value); | |
332 | - } | |
333 | - detail.setDataTimeType(dataTimeType); | |
334 | 356 | return detail; |
335 | 357 | } |
336 | 358 | |
359 | + | |
337 | 360 | } | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/data/eval/EvalIndicatorImportDetailScoreService.java
0 → 100644
1 | +package cn.fw.morax.service.data.eval; | |
2 | + | |
3 | + | |
4 | +import cn.fw.morax.dao.orm.ILocalService; | |
5 | +import cn.fw.morax.domain.db.eval.EvalIndicatorImportDetailScore; | |
6 | + | |
7 | +/** | |
8 | + * <p> | |
9 | + * 考评指标导入记录 服务类 | |
10 | + * </p> | |
11 | + * | |
12 | + * @author jiangchao | |
13 | + * @since 2023-01-30 | |
14 | + */ | |
15 | +public interface EvalIndicatorImportDetailScoreService extends ILocalService<EvalIndicatorImportDetailScore> { | |
16 | + | |
17 | + | |
18 | +} | ... | ... |
fw-morax-service/src/main/java/cn/fw/morax/service/data/eval/impl/EvalIndicatorImportDetailScoreServiceImpl.java
0 → 100644
1 | +package cn.fw.morax.service.data.eval.impl; | |
2 | + | |
3 | +import cn.fw.morax.dao.eval.EvalIndicatorImportDetailScoreDao; | |
4 | +import cn.fw.morax.domain.db.eval.EvalIndicatorImportDetailScore; | |
5 | +import cn.fw.morax.service.data.eval.EvalIndicatorImportDetailScoreService; | |
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 jiangchao | |
15 | + * @since 2023-02-06 | |
16 | + */ | |
17 | +@Service | |
18 | +public class EvalIndicatorImportDetailScoreServiceImpl extends ServiceImpl<EvalIndicatorImportDetailScoreDao, EvalIndicatorImportDetailScore> | |
19 | + implements EvalIndicatorImportDetailScoreService { | |
20 | + | |
21 | + | |
22 | +} | ... | ... |