feat(ajh): 添加人员培训记录接口
- 新增 getListByUser 接口,用于获取人员培训记录 - 在 AjhMeetingReceiptMapper 中添加 getPxList 方法,用于查询培训记录 - 在 AjhMeetingReceiptServiceImpl 中实现 getList 方法,用于处理培训记录查询逻辑 - 更新 pom.xml,将 kingtroldata.flow.version 升级到 2.0.9
正在显示
6 个修改的文件
包含
98 行增加
和
1 行删除
... | @@ -66,7 +66,7 @@ | ... | @@ -66,7 +66,7 @@ |
66 | <aliyun-java-sdk-core.version>3.2.3</aliyun-java-sdk-core.version> | 66 | <aliyun-java-sdk-core.version>3.2.3</aliyun-java-sdk-core.version> |
67 | <aliyun-java-sdk-dysmsapi.version>1.0.0</aliyun-java-sdk-dysmsapi.version> | 67 | <aliyun-java-sdk-dysmsapi.version>1.0.0</aliyun-java-sdk-dysmsapi.version> |
68 | <kingtroldata.core.version>2.0.3</kingtroldata.core.version> | 68 | <kingtroldata.core.version>2.0.3</kingtroldata.core.version> |
69 | <kingtroldata.flow.version>2.0.7</kingtroldata.flow.version> | 69 | <kingtroldata.flow.version>2.0.9</kingtroldata.flow.version> |
70 | <flowable.version>6.4.2</flowable.version> | 70 | <flowable.version>6.4.2</flowable.version> |
71 | <log4j2.version>2.17.0</log4j2.version> | 71 | <log4j2.version>2.17.0</log4j2.version> |
72 | </properties> | 72 | </properties> | ... | ... |
1 | package com.skua.modules.ajh.controller; | 1 | package com.skua.modules.ajh.controller; |
2 | 2 | ||
3 | import java.util.ArrayList; | ||
3 | import java.util.Arrays; | 4 | import java.util.Arrays; |
4 | import java.util.List; | 5 | import java.util.List; |
5 | import java.util.Map; | 6 | import java.util.Map; |
6 | import java.io.IOException; | 7 | import java.io.IOException; |
7 | import java.io.UnsupportedEncodingException; | 8 | import java.io.UnsupportedEncodingException; |
8 | import java.net.URLDecoder; | 9 | import java.net.URLDecoder; |
10 | import java.util.stream.Collectors; | ||
9 | import javax.annotation.Resource; | 11 | import javax.annotation.Resource; |
10 | import javax.servlet.http.HttpServletRequest; | 12 | import javax.servlet.http.HttpServletRequest; |
11 | import javax.servlet.http.HttpServletResponse; | 13 | import javax.servlet.http.HttpServletResponse; |
12 | 14 | ||
15 | import cn.hutool.core.bean.BeanUtil; | ||
13 | import com.skua.core.api.ISysBaseAPI; | 16 | import com.skua.core.api.ISysBaseAPI; |
14 | import com.skua.core.api.vo.LoginUser; | 17 | import com.skua.core.api.vo.LoginUser; |
15 | import com.skua.core.api.vo.Result; | 18 | import com.skua.core.api.vo.Result; |
... | @@ -17,7 +20,9 @@ import com.skua.core.aspect.annotation.AutoLog; | ... | @@ -17,7 +20,9 @@ import com.skua.core.aspect.annotation.AutoLog; |
17 | import com.skua.core.context.BaseContextHandler; | 20 | import com.skua.core.context.BaseContextHandler; |
18 | import com.skua.core.query.QueryGenerator; | 21 | import com.skua.core.query.QueryGenerator; |
19 | import com.skua.core.util.ConvertUtils; | 22 | import com.skua.core.util.ConvertUtils; |
23 | import com.skua.modules.ajh.entity.AjhEduTrainingRecord; | ||
20 | import com.skua.modules.ajh.entity.AjhMeetingReceipt; | 24 | import com.skua.modules.ajh.entity.AjhMeetingReceipt; |
25 | import com.skua.modules.ajh.service.IAjhEduTrainingRecordService; | ||
21 | import com.skua.modules.ajh.service.IAjhMeetingReceiptService; | 26 | import com.skua.modules.ajh.service.IAjhMeetingReceiptService; |
22 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 27 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
23 | import com.baomidou.mybatisplus.core.metadata.IPage; | 28 | import com.baomidou.mybatisplus.core.metadata.IPage; |
... | @@ -25,6 +30,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ... | @@ -25,6 +30,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
25 | import com.skua.modules.ajh.vo.AjhMeetingReceiptVO; | 30 | import com.skua.modules.ajh.vo.AjhMeetingReceiptVO; |
26 | import com.skua.modules.ajh.vo.MeetingReceiptVO; | 31 | import com.skua.modules.ajh.vo.MeetingReceiptVO; |
27 | import com.skua.modules.ajh.vo.MeetingReceiptWebVO; | 32 | import com.skua.modules.ajh.vo.MeetingReceiptWebVO; |
33 | import com.skua.modules.biz.IBusinessService; | ||
28 | import com.skua.modules.system.entity.SysDepart; | 34 | import com.skua.modules.system.entity.SysDepart; |
29 | import com.skua.modules.system.service.ISysDepartService; | 35 | import com.skua.modules.system.service.ISysDepartService; |
30 | import lombok.extern.slf4j.Slf4j; | 36 | import lombok.extern.slf4j.Slf4j; |
... | @@ -61,6 +67,8 @@ public class AjhMeetingReceiptController { | ... | @@ -61,6 +67,8 @@ public class AjhMeetingReceiptController { |
61 | private ISysBaseAPI iSysBaseAPI; | 67 | private ISysBaseAPI iSysBaseAPI; |
62 | @Resource | 68 | @Resource |
63 | private ISysDepartService departService; | 69 | private ISysDepartService departService; |
70 | @Autowired | ||
71 | private IBusinessService businessService; | ||
64 | /** | 72 | /** |
65 | * <pre> | 73 | * <pre> |
66 | * 分页列表查询 | 74 | * 分页列表查询 |
... | @@ -354,4 +362,40 @@ public class AjhMeetingReceiptController { | ... | @@ -354,4 +362,40 @@ public class AjhMeetingReceiptController { |
354 | return Result.ok("文件导入失败!"); | 362 | return Result.ok("文件导入失败!"); |
355 | } | 363 | } |
356 | 364 | ||
365 | @AutoLog(value = "人员培训记录") | ||
366 | @ApiOperation(value="人员培训记录", notes="人员培训记录") | ||
367 | @GetMapping(value = "/getListByUser") | ||
368 | public Result<Object> getList(AjhEduTrainingRecord ajhEduTrainingRecord, | ||
369 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | ||
370 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { | ||
371 | Result<Object> result = new Result<Object>(); | ||
372 | Page<AjhEduTrainingRecord> page = new Page<AjhEduTrainingRecord>(pageNo, pageSize); | ||
373 | IPage<AjhEduTrainingRecord> pageList = ajhMeetingReceiptService.getList(page,ajhEduTrainingRecord); | ||
374 | // 翻译 | ||
375 | Map<String, String> sysUserDictMap = businessService.dictMap("sys_user", null); | ||
376 | Map<String, String> eduTraLxDictMap = businessService.dictMap("edu_tra_lx", null); | ||
377 | // 封装结果 | ||
378 | IPage<Map<String, Object>> mapIPage = new Page<>(pageNo, pageSize); | ||
379 | mapIPage.setTotal(pageList.getTotal()); | ||
380 | mapIPage.setRecords(pageList.getRecords().stream().map(item -> { | ||
381 | Map<String, Object> map = BeanUtil.beanToMap(item); | ||
382 | List<String> joinUserNameList = new ArrayList<>(); | ||
383 | if (item.getJoinUser() != null) { | ||
384 | String[] joinUserIds = item.getJoinUser().split(","); | ||
385 | for (String userId : joinUserIds) { | ||
386 | String userName = sysUserDictMap.get(userId); | ||
387 | if (userName != null) { | ||
388 | joinUserNameList.add(userName); | ||
389 | } | ||
390 | } | ||
391 | } | ||
392 | map.put("joinUser_dictText", String.join(",", joinUserNameList)); | ||
393 | map.put("eduTraLx_dictText", eduTraLxDictMap.get(item.getEduTraLx())); | ||
394 | return map; | ||
395 | }).collect(Collectors.toList())); | ||
396 | result.setSuccess(true); | ||
397 | result.setResult(mapIPage); | ||
398 | return result; | ||
399 | } | ||
400 | |||
357 | } | 401 | } | ... | ... |
... | @@ -2,6 +2,7 @@ package com.skua.modules.ajh.mapper; | ... | @@ -2,6 +2,7 @@ package com.skua.modules.ajh.mapper; |
2 | 2 | ||
3 | import java.util.List; | 3 | import java.util.List; |
4 | 4 | ||
5 | import com.skua.modules.ajh.entity.AjhEduTrainingRecord; | ||
5 | import com.skua.modules.ajh.vo.AjhMeetingReceiptVO; | 6 | import com.skua.modules.ajh.vo.AjhMeetingReceiptVO; |
6 | import org.apache.ibatis.annotations.Param; | 7 | import org.apache.ibatis.annotations.Param; |
7 | import com.skua.modules.ajh.entity.AjhMeetingReceipt; | 8 | import com.skua.modules.ajh.entity.AjhMeetingReceipt; |
... | @@ -14,4 +15,6 @@ public interface AjhMeetingReceiptMapper extends BaseMapper<AjhMeetingReceipt> { | ... | @@ -14,4 +15,6 @@ public interface AjhMeetingReceiptMapper extends BaseMapper<AjhMeetingReceipt> { |
14 | 15 | ||
15 | List<AjhMeetingReceiptVO> getList(@Param("ajhMeetingReceiptVO") AjhMeetingReceiptVO ajhMeetingReceiptVO); | 16 | List<AjhMeetingReceiptVO> getList(@Param("ajhMeetingReceiptVO") AjhMeetingReceiptVO ajhMeetingReceiptVO); |
16 | 17 | ||
18 | List<AjhEduTrainingRecord> getPxList(@Param("userId") String userId, @Param("eduType") String eduType); | ||
19 | |||
17 | } | 20 | } | ... | ... |
... | @@ -47,4 +47,39 @@ | ... | @@ -47,4 +47,39 @@ |
47 | </if> | 47 | </if> |
48 | </select> | 48 | </select> |
49 | 49 | ||
50 | <select id="getPxList" resultType="com.skua.modules.ajh.entity.AjhEduTrainingRecord"> | ||
51 | SELECT * FROM ( | ||
52 | SELECT | ||
53 | LEFT( s.meet_start_time, 10 ) AS edu_tra_date, | ||
54 | s.meet_content AS edu_tra_content, | ||
55 | a.user_count AS join_count, | ||
56 | a.user_ids AS join_user, | ||
57 | '5' AS edu_tra_lx | ||
58 | FROM | ||
59 | ajh_meeting_receipt r | ||
60 | LEFT JOIN ajh_meeting_send s ON s.id = r.meets_id | ||
61 | LEFT JOIN ajh_meeting m ON m.id = s.meet_id | ||
62 | LEFT JOIN ( SELECT meets_id, count( id ) user_count, GROUP_CONCAT( user_id ) user_ids | ||
63 | FROM ajh_meeting_receipt GROUP BY meets_id, depart_id ) a ON a.meets_id = r.meets_id | ||
64 | WHERE | ||
65 | m.meet_category = '1' AND r.user_id = #{userId} | ||
66 | UNION ALL | ||
67 | SELECT | ||
68 | edu_tra_date, | ||
69 | edu_tra_content, | ||
70 | join_count, | ||
71 | join_user, | ||
72 | edu_tra_lx | ||
73 | FROM | ||
74 | ajh_edu_training_record | ||
75 | WHERE | ||
76 | join_user LIKE concat('%',#{userId},'%') | ||
77 | ) edu | ||
78 | WHERE | ||
79 | 1 = 1 | ||
80 | <if test="eduType!=null and eduType!=''"> | ||
81 | AND edu.edu_tra_lx = #{eduType} | ||
82 | </if> | ||
83 | </select> | ||
84 | |||
50 | </mapper> | 85 | </mapper> | ... | ... |
... | @@ -3,10 +3,13 @@ package com.skua.modules.ajh.service; | ... | @@ -3,10 +3,13 @@ package com.skua.modules.ajh.service; |
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
4 | import com.baomidou.mybatisplus.core.metadata.IPage; | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
6 | import com.skua.modules.ajh.entity.AjhEduTrainingRecord; | ||
6 | import com.skua.modules.ajh.entity.AjhMeetingReceipt; | 7 | import com.skua.modules.ajh.entity.AjhMeetingReceipt; |
7 | import com.baomidou.mybatisplus.extension.service.IService; | 8 | import com.baomidou.mybatisplus.extension.service.IService; |
8 | import com.skua.modules.ajh.vo.AjhMeetingReceiptVO; | 9 | import com.skua.modules.ajh.vo.AjhMeetingReceiptVO; |
9 | 10 | ||
11 | import java.util.List; | ||
12 | |||
10 | /** | 13 | /** |
11 | * 会议回执记录表 | 14 | * 会议回执记录表 |
12 | */ | 15 | */ |
... | @@ -14,4 +17,5 @@ public interface IAjhMeetingReceiptService extends IService<AjhMeetingReceipt> { | ... | @@ -14,4 +17,5 @@ public interface IAjhMeetingReceiptService extends IService<AjhMeetingReceipt> { |
14 | 17 | ||
15 | IPage<AjhMeetingReceiptVO> get(Page<AjhMeetingReceiptVO> page, AjhMeetingReceiptVO ajhMeetingReceiptVO); | 18 | IPage<AjhMeetingReceiptVO> get(Page<AjhMeetingReceiptVO> page, AjhMeetingReceiptVO ajhMeetingReceiptVO); |
16 | 19 | ||
20 | IPage<AjhEduTrainingRecord> getList(Page<AjhEduTrainingRecord> page, AjhEduTrainingRecord ajhEduTrainingRecord); | ||
17 | } | 21 | } | ... | ... |
... | @@ -2,6 +2,7 @@ package com.skua.modules.ajh.service.impl; | ... | @@ -2,6 +2,7 @@ package com.skua.modules.ajh.service.impl; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.metadata.IPage; | 3 | import com.baomidou.mybatisplus.core.metadata.IPage; |
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
5 | import com.skua.modules.ajh.entity.AjhEduTrainingRecord; | ||
5 | import com.skua.modules.ajh.entity.AjhMeetingReceipt; | 6 | import com.skua.modules.ajh.entity.AjhMeetingReceipt; |
6 | import com.skua.modules.ajh.mapper.AjhMeetingReceiptMapper; | 7 | import com.skua.modules.ajh.mapper.AjhMeetingReceiptMapper; |
7 | import com.skua.modules.ajh.service.IAjhMeetingReceiptService; | 8 | import com.skua.modules.ajh.service.IAjhMeetingReceiptService; |
... | @@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ... | @@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
12 | 13 | ||
13 | import javax.annotation.Resource; | 14 | import javax.annotation.Resource; |
14 | import java.util.ArrayList; | 15 | import java.util.ArrayList; |
16 | import java.util.Collections; | ||
15 | import java.util.List; | 17 | import java.util.List; |
16 | 18 | ||
17 | /** | 19 | /** |
... | @@ -30,4 +32,13 @@ public class AjhMeetingReceiptServiceImpl extends ServiceImpl<AjhMeetingReceiptM | ... | @@ -30,4 +32,13 @@ public class AjhMeetingReceiptServiceImpl extends ServiceImpl<AjhMeetingReceiptM |
30 | page.setRecords(list); | 32 | page.setRecords(list); |
31 | return page; | 33 | return page; |
32 | } | 34 | } |
35 | |||
36 | @Override | ||
37 | public IPage<AjhEduTrainingRecord> getList(Page<AjhEduTrainingRecord> page, AjhEduTrainingRecord ajhEduTrainingRecord) { | ||
38 | String userId = ajhEduTrainingRecord.getJoinUser(); | ||
39 | String eduType = ajhEduTrainingRecord.getEduTraLx(); | ||
40 | List<AjhEduTrainingRecord> list = ajhMeetingReceiptMapper.getPxList(userId,eduType); | ||
41 | page.setRecords(list); | ||
42 | return page; | ||
43 | } | ||
33 | } | 44 | } | ... | ... |
-
请 注册 或 登录 后发表评论