Commit 29ea29c999ce65ebbf94ef26e980ea8dbb283e35
1 parent
07777440
feat(*): 引入kotlin
- 引入kotlin
Showing
3 changed files
with
51 additions
and
37 deletions
fw-morax-server/src/main/java/cn/fw/morax/server/controller/erp/EvalDebugController.kt
1 | -package cn.fw.morax.server.controller.erp; | |
2 | - | |
3 | -import cn.fw.common.web.annotation.ControllerMethod; | |
4 | -import cn.fw.data.base.domain.common.Message; | |
5 | -import cn.fw.morax.common.config.SpecialIndicatorCodeVal; | |
6 | -import cn.fw.morax.common.utils.DateUtil; | |
7 | -import cn.fw.morax.common.utils.PublicUtil; | |
8 | -import cn.fw.morax.domain.db.eval.EvalGroupUser; | |
9 | -import cn.fw.morax.domain.dto.kpi.UserIndicatorDTO; | |
10 | -import cn.fw.morax.service.biz.eval.EvalGroupUserBizService; | |
11 | -import cn.fw.security.auth.client.annotation.Authorization; | |
12 | -import cn.fw.security.auth.client.enums.AuthType; | |
13 | -import lombok.RequiredArgsConstructor; | |
14 | -import lombok.extern.slf4j.Slf4j; | |
15 | -import org.springframework.validation.annotation.Validated; | |
16 | -import org.springframework.web.bind.annotation.*; | |
17 | - | |
18 | -import javax.validation.Valid; | |
19 | -import java.time.LocalDate; | |
20 | -import java.util.ArrayList; | |
21 | -import java.util.Date; | |
22 | -import java.util.List; | |
23 | - | |
24 | -import static cn.fw.common.web.util.ResultBuilder.success; | |
1 | +package cn.fw.morax.server.controller.erp | |
2 | + | |
3 | +import cn.fw.common.web.annotation.ControllerMethod | |
4 | +import cn.fw.common.web.util.ResultBuilder.success | |
5 | +import cn.fw.data.base.domain.common.Message | |
6 | +import cn.fw.morax.common.utils.DateUtil | |
7 | +import cn.fw.morax.domain.db.eval.EvalGroupUser | |
8 | +import cn.fw.morax.service.biz.eval.EvalGroupUserBizService | |
9 | +import cn.fw.security.auth.client.annotation.Authorization | |
10 | +import cn.fw.security.auth.client.enums.AuthType | |
11 | +import org.springframework.validation.annotation.Validated | |
12 | +import org.springframework.web.bind.annotation.GetMapping | |
13 | +import org.springframework.web.bind.annotation.RequestMapping | |
14 | +import org.springframework.web.bind.annotation.RestController | |
15 | +import java.time.LocalDate | |
16 | +import java.util.Date | |
25 | 17 | |
26 | 18 | /** |
27 | 19 | * @author jiangchao |
28 | 20 | * @des: |
29 | 21 | * @date 2024/3/29 18:50 |
30 | 22 | */ |
31 | -@Slf4j | |
32 | 23 | @RestController |
33 | 24 | @Authorization(AuthType.NONE) |
34 | -@RequiredArgsConstructor | |
35 | 25 | @Validated |
36 | 26 | @RequestMapping("/debug/eval") |
37 | -public class EvalDebugController { | |
38 | - | |
39 | - private final EvalGroupUserBizService evalGroupUserBizService; | |
27 | +class EvalDebugController(private val evalGroupUserBizService: EvalGroupUserBizService) { | |
40 | 28 | |
41 | 29 | |
42 | 30 | @GetMapping("/users") |
43 | 31 | @ControllerMethod("查看考评人员") |
44 | - public Message<List<EvalGroupUser>> fetchPostUsers(Long groupId, Long postId, Long shopId, Date date) { | |
45 | - LocalDate dataDate = PublicUtil.isEmpty(date) ? LocalDate.now().minusDays(1) : DateUtil.date2LocalDate(date); | |
46 | - List<EvalGroupUser> evalGroupUsers = evalGroupUserBizService.fetchPostUsers(groupId, postId, new ArrayList<Long>(){{add(shopId);}}, dataDate); | |
47 | - return success(evalGroupUsers); | |
32 | + fun fetchPostUsers(groupId: Long, postId: Long, shopId: Long, date: Date?): Message<List<EvalGroupUser>> { | |
33 | + val dataDate = date?.let { | |
34 | + DateUtil.date2LocalDate(date) | |
35 | + } ?: LocalDate.now().minusDays(1) | |
36 | + return success(evalGroupUserBizService.fetchPostUsers(groupId, postId, listOf(shopId), dataDate)); | |
48 | 37 | } |
49 | - | |
50 | - | |
51 | -} | |
38 | +} | |
52 | 39 | \ No newline at end of file | ... | ... |
lombok.config
0 → 100644
pom.xml
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 | <parent> |
13 | 13 | <groupId>cn.fw</groupId> |
14 | 14 | <artifactId>fw-common-dependencies</artifactId> |
15 | - <version>3.5.0</version> | |
15 | + <version>3.6.0</version> | |
16 | 16 | </parent> |
17 | 17 | |
18 | 18 | <modules> |
... | ... | @@ -206,11 +206,34 @@ |
206 | 206 | <artifactId>junit</artifactId> |
207 | 207 | <scope>test</scope> |
208 | 208 | </dependency> |
209 | + <dependency> | |
210 | + <groupId>org.jetbrains.kotlin</groupId> | |
211 | + <artifactId>kotlin-stdlib</artifactId> | |
212 | + <version>${kotlin.version}</version> | |
213 | + </dependency> | |
214 | + <dependency> | |
215 | + <groupId>org.jetbrains.kotlin</groupId> | |
216 | + <artifactId>kotlin-reflect</artifactId> | |
217 | + <version>${kotlin.version}</version> | |
218 | + </dependency> | |
219 | + <dependency> | |
220 | + <groupId>org.jetbrains.kotlin</groupId> | |
221 | + <artifactId>kotlin-stdlib-jdk8</artifactId> | |
222 | + <version>${kotlin.version}</version> | |
223 | + </dependency> | |
224 | + <dependency> | |
225 | + <groupId>com.fasterxml.jackson.module</groupId> | |
226 | + <artifactId>jackson-module-kotlin</artifactId> | |
227 | + </dependency> | |
209 | 228 | </dependencies> |
210 | 229 | |
211 | 230 | <build> |
212 | 231 | <plugins> |
213 | 232 | <plugin> |
233 | + <groupId>org.jetbrains.kotlin</groupId> | |
234 | + <artifactId>kotlin-maven-plugin</artifactId> | |
235 | + </plugin> | |
236 | + <plugin> | |
214 | 237 | <groupId>org.apache.maven.plugins</groupId> |
215 | 238 | <artifactId>maven-compiler-plugin</artifactId> |
216 | 239 | <configuration> | ... | ... |