kangwei: 外协人员接口
系统配置表相关代码--存放参数信息
正在显示
20 个修改的文件
包含
457 行增加
和
21 行删除
... | @@ -7,6 +7,8 @@ import java.net.URLDecoder; | ... | @@ -7,6 +7,8 @@ import java.net.URLDecoder; |
7 | import javax.servlet.ServletOutputStream; | 7 | import javax.servlet.ServletOutputStream; |
8 | import javax.servlet.http.HttpServletRequest; | 8 | import javax.servlet.http.HttpServletRequest; |
9 | import javax.servlet.http.HttpServletResponse; | 9 | import javax.servlet.http.HttpServletResponse; |
10 | |||
11 | import com.skua.common.util.word.ExportWordUtils; | ||
10 | import com.skua.core.api.vo.Result; | 12 | import com.skua.core.api.vo.Result; |
11 | import com.skua.core.aspect.annotation.AutoLog; | 13 | import com.skua.core.aspect.annotation.AutoLog; |
12 | import com.skua.core.query.QueryGenerator; | 14 | import com.skua.core.query.QueryGenerator; |
... | @@ -37,6 +39,7 @@ import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | ... | @@ -37,6 +39,7 @@ import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
37 | 39 | ||
38 | import org.jeecgframework.poi.word.WordExportUtil; | 40 | import org.jeecgframework.poi.word.WordExportUtil; |
39 | import org.jeecgframework.poi.word.entity.MyXWPFDocument; | 41 | import org.jeecgframework.poi.word.entity.MyXWPFDocument; |
42 | import org.jeecgframework.poi.word.entity.WordImageEntity; | ||
40 | import org.springframework.beans.factory.annotation.Autowired; | 43 | import org.springframework.beans.factory.annotation.Autowired; |
41 | import org.springframework.web.bind.annotation.*; | 44 | import org.springframework.web.bind.annotation.*; |
42 | import org.springframework.web.multipart.MultipartFile; | 45 | import org.springframework.web.multipart.MultipartFile; |
... | @@ -317,36 +320,74 @@ public class AjhMeetingMinutesController { | ... | @@ -317,36 +320,74 @@ public class AjhMeetingMinutesController { |
317 | } | 320 | } |
318 | /*** | 321 | /*** |
319 | * 下载会议纪要 | 322 | * 下载会议纪要 |
320 | * @param id | 323 | * @param meetsId |
321 | * @param response | 324 | * @param response |
322 | */ | 325 | */ |
323 | @AutoLog(value = "会议纪要管理-通过会议纪要id下载会议纪要") | 326 | @AutoLog(value = "会议纪要管理-通过会议纪要id下载会议纪要") |
324 | @ApiOperation(value="会议纪要管理-通过id下载会议纪要", notes="会议纪要管理-通过id下载会议纪要") | 327 | @ApiOperation(value="会议纪要管理-通过id下载会议纪要", notes="会议纪要管理-通过id下载会议纪要") |
325 | @GetMapping("/exportWordData") | 328 | @GetMapping("/exportWordData") |
326 | public void exportWordData(@RequestParam(name="id",required=true) String id,HttpServletResponse response ) { | 329 | public void exportWordData(@RequestParam(name="id",required=true) String meetsId,HttpServletResponse response ) { |
327 | String templatePath = null;//导出模板文件名称 | 330 | String templatePath = "D:\\test\\会议模板-2.docx";//导出模板文件名称 |
331 | |||
328 | String exportName = "****---会议纪要.docx";//导出文件名称 | 332 | String exportName = "****---会议纪要.docx";//导出文件名称 |
329 | Map<String ,Object> paramMap = new HashMap<String,Object>(); | 333 | Map<String ,Object> paramMap = new HashMap<String,Object>(); |
330 | 334 | ||
331 | AjhMeetingMinutes ajhMeetingMinutes = ajhMeetingMinutesService.getDataById(id); | 335 | AjhMeetingMinutes ajhMeetingMinutes = ajhMeetingMinutesService.queryByMeetId(meetsId); |
332 | ExportAjhMeetingMinutesVO exprotVo = new ExportAjhMeetingMinutesVO(); | 336 | ExportAjhMeetingMinutesVO exprotVo = new ExportAjhMeetingMinutesVO(); |
333 | // 标题:meetTitile 机构名称:orgDepart 纪要图片 , 住持人 ;纪要内容 ; 会议地点 | 337 | // 标题:meetTitile 机构名称:orgDepart 纪要图片 , 住持人 ;纪要内容 ; 会议地点 |
334 | exprotVo.convert( exprotVo , ajhMeetingMinutes); | 338 | exprotVo.convert( exprotVo , ajhMeetingMinutes); |
335 | // 会议记录 | 339 | // 会议记录 |
336 | AjhMeetingSend meetingSend = meetingSendService.getById( ajhMeetingMinutes.getMeetsId() ); | 340 | AjhMeetingSend meetingSend = meetingSendService.getById( meetsId ); |
337 | //会议通知 | 341 | //会议通知 |
338 | AjhMeeting meeting = meetingService.getById( meetingSend.getMeetId() ); | 342 | AjhMeeting meeting = meetingService.getById( meetsId ); |
339 | //签到集合 | 343 | //签到集合 |
340 | List<AjhMeetingAttend> meetingAttendList = meetingAttendService.getByMeetsId( ajhMeetingMinutes.getMeetsId() ); | 344 | int supplementNum = 0;//后续添加补全表格记录16 |
345 | List<AjhMeetingAttend> meetingAttendList = meetingAttendService.getByMeetsId( meetsId ); | ||
341 | if(meetingAttendList == null || meetingAttendList.isEmpty()){ | 346 | if(meetingAttendList == null || meetingAttendList.isEmpty()){ |
342 | meetingAttendList = new ArrayList<AjhMeetingAttend>(); | 347 | meetingAttendList = new ArrayList<AjhMeetingAttend>(); |
348 | supplementNum = 16; | ||
349 | }else{ | ||
350 | supplementNum = 16 - meetingAttendList.size(); | ||
343 | } | 351 | } |
344 | paramMap.put("dataList",meetingAttendList); | 352 | //补全签到表格集合 |
353 | supplementList( meetingAttendList , supplementNum ); | ||
354 | //签到表集合 | ||
355 | paramMap.put("attendList",meetingAttendList); | ||
345 | 356 | ||
357 | //添加图片 | ||
358 | // 第三部分:图片 | ||
359 | WordImageEntity img = new WordImageEntity(); | ||
360 | img.setType(WordImageEntity.URL); | ||
361 | img.setUrl("D:\\test\\123.jpg"); | ||
362 | //img.setUrl("https://s2.51cto.com/media/2024/blog/logo.png"); | ||
363 | img.setWidth(550); | ||
364 | img.setHeight(500); | ||
365 | |||
366 | paramMap.put("meetingPlace" , img); | ||
346 | //导出word | 367 | //导出word |
347 | exportWordData( templatePath , exportName , paramMap ,response); | 368 | exportWordData( templatePath , exportName , paramMap ,response); |
348 | } | 369 | } |
349 | 370 | ||
371 | /*** | ||
372 | * 补全签到表格集合 | ||
373 | * @param meetingAttendList | ||
374 | * @param supplementNum | ||
375 | */ | ||
376 | private void supplementList(List<AjhMeetingAttend> meetingAttendList ,int supplementNum){ | ||
377 | if(supplementNum > 0){ | ||
378 | for(int i = 0 ;i <supplementNum ;i ++){ | ||
379 | meetingAttendList.add( new AjhMeetingAttend() ); | ||
380 | } | ||
381 | } | ||
382 | |||
383 | } | ||
384 | /** | ||
385 | * 导出word模板 | ||
386 | * @param templatePath | ||
387 | * @param exportName | ||
388 | * @param paramMap | ||
389 | * @param response | ||
390 | */ | ||
350 | private void exportWordData(String templatePath , String exportName , Map<String ,Object> paramMap, HttpServletResponse response ){ | 391 | private void exportWordData(String templatePath , String exportName , Map<String ,Object> paramMap, HttpServletResponse response ){ |
351 | InputStream is = null; | 392 | InputStream is = null; |
352 | 393 | ||
... | @@ -359,8 +400,9 @@ public class AjhMeetingMinutesController { | ... | @@ -359,8 +400,9 @@ public class AjhMeetingMinutesController { |
359 | 400 | ||
360 | 401 | ||
361 | //解析07版的Word并且进行赋值 | 402 | //解析07版的Word并且进行赋值 |
362 | WordExportUtil.exportWord07(document, paramMap); | 403 | //WordExportUtil.exportWord07(document, paramMap); |
363 | 404 | //解析07版的Word并且进行赋值 | |
405 | ExportWordUtils.getInstance().exportWord07(document, paramMap); | ||
364 | // .doc格式文档,设置响应内容类型为 Word 文档 | 406 | // .doc格式文档,设置响应内容类型为 Word 文档 |
365 | response.setContentType("application/msword"); | 407 | response.setContentType("application/msword"); |
366 | //String exportName = "***--会议纪要.docx"; | 408 | //String exportName = "***--会议纪要.docx"; |
... | @@ -370,10 +412,18 @@ public class AjhMeetingMinutesController { | ... | @@ -370,10 +412,18 @@ public class AjhMeetingMinutesController { |
370 | response.setHeader("Content-Disposition", "attachment;filename=".concat(String.valueOf(URLEncoder.encode(exportName , "UTF-8")))); | 412 | response.setHeader("Content-Disposition", "attachment;filename=".concat(String.valueOf(URLEncoder.encode(exportName , "UTF-8")))); |
371 | // 将文档写入响应的输出流 | 413 | // 将文档写入响应的输出流 |
372 | 414 | ||
373 | document.write(response.getOutputStream()); | 415 | |
416 | // 输出文件路径 --测试 | ||
417 | String outputPath = "D:\\test\\会议纪要导出记录.docx"; | ||
418 | FileOutputStream outputFile = new FileOutputStream(outputPath); | ||
419 | document.write( outputFile); | ||
420 | |||
421 | //document.write(response.getOutputStream()); | ||
374 | // 刷新和关闭输出流 | 422 | // 刷新和关闭输出流 |
375 | response.getOutputStream().flush(); | 423 | //response.getOutputStream().flush(); |
376 | response.getOutputStream().close(); | 424 | //response.getOutputStream().close(); |
425 | |||
426 | outputFile.close(); | ||
377 | } | 427 | } |
378 | catch (Exception e) { | 428 | catch (Exception e) { |
379 | e.printStackTrace(); | 429 | e.printStackTrace(); | ... | ... |
... | @@ -80,6 +80,6 @@ public class ExportAjhMeetingMinutesVO { | ... | @@ -80,6 +80,6 @@ public class ExportAjhMeetingMinutesVO { |
80 | exprotVo.setSendDate(ajhMeetingMinutes.getSendDate());//发送时间 | 80 | exprotVo.setSendDate(ajhMeetingMinutes.getSendDate());//发送时间 |
81 | exprotVo.setMeetTitile(ajhMeetingMinutes.getTitle());//会议标题 | 81 | exprotVo.setMeetTitile(ajhMeetingMinutes.getTitle());//会议标题 |
82 | exprotVo.setMeetingPlace( ajhMeetingMinutes.getPlace()); //会议地址 | 82 | exprotVo.setMeetingPlace( ajhMeetingMinutes.getPlace()); //会议地址 |
83 | exprotVo.setMeetingPlace( ajhMeetingMinutes.getImage() );//会议图片;需要补全路径 | 83 | //exprotVo.setMeetingPlace( ajhMeetingMinutes.getImage() );//会议图片;需要补全路径 |
84 | } | 84 | } |
85 | } | 85 | } | ... | ... |
... | @@ -76,6 +76,15 @@ public class EpibolyCertificateController { | ... | @@ -76,6 +76,15 @@ public class EpibolyCertificateController { |
76 | Result<IPage<EpibolyCertificate>> result = new Result<IPage<EpibolyCertificate>>(); | 76 | Result<IPage<EpibolyCertificate>> result = new Result<IPage<EpibolyCertificate>>(); |
77 | QueryWrapper<EpibolyCertificate> queryWrapper = QueryGenerator.initQueryWrapper(epibolyCertificate, req.getParameterMap()); | 77 | QueryWrapper<EpibolyCertificate> queryWrapper = QueryGenerator.initQueryWrapper(epibolyCertificate, req.getParameterMap()); |
78 | Page<EpibolyCertificate> page = new Page<EpibolyCertificate>(pageNo, pageSize); | 78 | Page<EpibolyCertificate> page = new Page<EpibolyCertificate>(pageNo, pageSize); |
79 | |||
80 | if(epibolyCertificate.getCompanyId() != null ){ | ||
81 | queryWrapper.eq("company_id",epibolyCertificate.getCompanyId()); | ||
82 | } | ||
83 | |||
84 | if(epibolyCertificate.getOuterStaffId() != null ){ | ||
85 | queryWrapper.eq("outer_staff_id",epibolyCertificate.getOuterStaffId()); | ||
86 | } | ||
87 | |||
79 | IPage<EpibolyCertificate> pageList = epibolyCertificateService.page(page, queryWrapper); | 88 | IPage<EpibolyCertificate> pageList = epibolyCertificateService.page(page, queryWrapper); |
80 | result.setSuccess(true); | 89 | result.setSuccess(true); |
81 | result.setResult(pageList); | 90 | result.setResult(pageList); | ... | ... |
... | @@ -99,6 +99,8 @@ public class EpibolyCompanyController { | ... | @@ -99,6 +99,8 @@ public class EpibolyCompanyController { |
99 | Result<IPage<EpibolyCompany>> result = new Result<IPage<EpibolyCompany>>(); | 99 | Result<IPage<EpibolyCompany>> result = new Result<IPage<EpibolyCompany>>(); |
100 | QueryWrapper<EpibolyCompany> queryWrapper = QueryGenerator.initQueryWrapper(epibolyCompany, req.getParameterMap()); | 100 | QueryWrapper<EpibolyCompany> queryWrapper = QueryGenerator.initQueryWrapper(epibolyCompany, req.getParameterMap()); |
101 | Page<EpibolyCompany> page = new Page<EpibolyCompany>(pageNo, pageSize); | 101 | Page<EpibolyCompany> page = new Page<EpibolyCompany>(pageNo, pageSize); |
102 | |||
103 | queryWrapper.eq("depart_id",epibolyCompany.getDepartId()); | ||
102 | IPage<EpibolyCompany> pageList = epibolyCompanyService.page(page, queryWrapper); | 104 | IPage<EpibolyCompany> pageList = epibolyCompanyService.page(page, queryWrapper); |
103 | result.setSuccess(true); | 105 | result.setSuccess(true); |
104 | result.setResult(pageList); | 106 | result.setResult(pageList); | ... | ... |
... | @@ -75,6 +75,11 @@ public class EpibolyContractController { | ... | @@ -75,6 +75,11 @@ public class EpibolyContractController { |
75 | Result<IPage<EpibolyContract>> result = new Result<IPage<EpibolyContract>>(); | 75 | Result<IPage<EpibolyContract>> result = new Result<IPage<EpibolyContract>>(); |
76 | QueryWrapper<EpibolyContract> queryWrapper = QueryGenerator.initQueryWrapper(epibolyContract, req.getParameterMap()); | 76 | QueryWrapper<EpibolyContract> queryWrapper = QueryGenerator.initQueryWrapper(epibolyContract, req.getParameterMap()); |
77 | Page<EpibolyContract> page = new Page<EpibolyContract>(pageNo, pageSize); | 77 | Page<EpibolyContract> page = new Page<EpibolyContract>(pageNo, pageSize); |
78 | |||
79 | if(epibolyContract.getCompanyId() != null ){ | ||
80 | queryWrapper.eq("company_id",epibolyContract.getCompanyId()); | ||
81 | } | ||
82 | |||
78 | IPage<EpibolyContract> pageList = epibolyContractService.page(page, queryWrapper); | 83 | IPage<EpibolyContract> pageList = epibolyContractService.page(page, queryWrapper); |
79 | result.setSuccess(true); | 84 | result.setSuccess(true); |
80 | result.setResult(pageList); | 85 | result.setResult(pageList); | ... | ... |
... | @@ -75,6 +75,16 @@ public class EpibolyOuterStaffController { | ... | @@ -75,6 +75,16 @@ public class EpibolyOuterStaffController { |
75 | Result<IPage<EpibolyOuterStaff>> result = new Result<IPage<EpibolyOuterStaff>>(); | 75 | Result<IPage<EpibolyOuterStaff>> result = new Result<IPage<EpibolyOuterStaff>>(); |
76 | QueryWrapper<EpibolyOuterStaff> queryWrapper = QueryGenerator.initQueryWrapper(epibolyOuterStaff, req.getParameterMap()); | 76 | QueryWrapper<EpibolyOuterStaff> queryWrapper = QueryGenerator.initQueryWrapper(epibolyOuterStaff, req.getParameterMap()); |
77 | Page<EpibolyOuterStaff> page = new Page<EpibolyOuterStaff>(pageNo, pageSize); | 77 | Page<EpibolyOuterStaff> page = new Page<EpibolyOuterStaff>(pageNo, pageSize); |
78 | //queryWrapper.in("company_id", BaseContextHandler.getDeparts().split(",")); | ||
79 | |||
80 | if(epibolyOuterStaff.getDepartId() != null ){ | ||
81 | queryWrapper.eq("depart_id",epibolyOuterStaff.getDepartId()); | ||
82 | } | ||
83 | |||
84 | if(epibolyOuterStaff.getCompanyId() != null ){ | ||
85 | queryWrapper.eq("company_id",epibolyOuterStaff.getCompanyId()); | ||
86 | } | ||
87 | |||
78 | IPage<EpibolyOuterStaff> pageList = epibolyOuterStaffService.page(page, queryWrapper); | 88 | IPage<EpibolyOuterStaff> pageList = epibolyOuterStaffService.page(page, queryWrapper); |
79 | result.setSuccess(true); | 89 | result.setSuccess(true); |
80 | result.setResult(pageList); | 90 | result.setResult(pageList); |
... | @@ -101,7 +111,7 @@ public class EpibolyOuterStaffController { | ... | @@ -101,7 +111,7 @@ public class EpibolyOuterStaffController { |
101 | epibolyOuterStaff.setCreateTime(new Date()); | 111 | epibolyOuterStaff.setCreateTime(new Date()); |
102 | epibolyOuterStaffService.saveEpibolyOuterStaff(epibolyOuterStaff); | 112 | epibolyOuterStaffService.saveEpibolyOuterStaff(epibolyOuterStaff); |
103 | 113 | ||
104 | 114 | result.setResult( epibolyOuterStaff ); | |
105 | result.success("添加成功!"); | 115 | result.success("添加成功!"); |
106 | } catch (Exception e) { | 116 | } catch (Exception e) { |
107 | log.error(e.getMessage(),e); | 117 | log.error(e.getMessage(),e); |
... | @@ -130,6 +140,8 @@ public class EpibolyOuterStaffController { | ... | @@ -130,6 +140,8 @@ public class EpibolyOuterStaffController { |
130 | epibolyOuterStaff.setUpdateBy(BaseContextHandler.getUserName()); | 140 | epibolyOuterStaff.setUpdateBy(BaseContextHandler.getUserName()); |
131 | epibolyOuterStaff.setUpdateTime(new Date()); | 141 | epibolyOuterStaff.setUpdateTime(new Date()); |
132 | boolean ok = epibolyOuterStaffService.updateById(epibolyOuterStaff); | 142 | boolean ok = epibolyOuterStaffService.updateById(epibolyOuterStaff); |
143 | |||
144 | result.setResult( epibolyOuterStaff ); | ||
133 | //TODO 返回false说明什么? | 145 | //TODO 返回false说明什么? |
134 | if(ok) { | 146 | if(ok) { |
135 | result.success("修改成功!"); | 147 | result.success("修改成功!"); | ... | ... |
1 | package com.skua.modules.safe.controller; | 1 | package com.skua.modules.safe.controller; |
2 | 2 | ||
3 | import java.util.Arrays; | 3 | import java.util.*; |
4 | import java.util.List; | ||
5 | import java.util.Map; | ||
6 | import java.io.IOException; | 4 | import java.io.IOException; |
7 | import java.io.UnsupportedEncodingException; | 5 | import java.io.UnsupportedEncodingException; |
8 | import java.net.URLDecoder; | 6 | import java.net.URLDecoder; |
... | @@ -16,10 +14,12 @@ import com.skua.core.service.ISequenceService; | ... | @@ -16,10 +14,12 @@ import com.skua.core.service.ISequenceService; |
16 | import com.skua.core.util.ConvertUtils; | 14 | import com.skua.core.util.ConvertUtils; |
17 | import com.skua.modules.safe.entity.SafetyOffenceRecord; | 15 | import com.skua.modules.safe.entity.SafetyOffenceRecord; |
18 | import com.skua.modules.safe.service.ISafetyOffenceRecordService; | 16 | import com.skua.modules.safe.service.ISafetyOffenceRecordService; |
19 | import java.util.Date; | ||
20 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 17 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
21 | import com.baomidou.mybatisplus.core.metadata.IPage; | 18 | import com.baomidou.mybatisplus.core.metadata.IPage; |
22 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 19 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
20 | import com.skua.modules.safe.vo.SafetyOffenceRecordStatisticsVO; | ||
21 | import com.skua.modules.system.service.ISysConfigService; | ||
22 | import com.skua.modules.system.service.ISysUserDepartService; | ||
23 | import lombok.extern.slf4j.Slf4j; | 23 | import lombok.extern.slf4j.Slf4j; |
24 | 24 | ||
25 | import org.jeecgframework.poi.excel.ExcelImportUtil; | 25 | import org.jeecgframework.poi.excel.ExcelImportUtil; |
... | @@ -52,6 +52,11 @@ public class SafetyOffenceRecordController { | ... | @@ -52,6 +52,11 @@ public class SafetyOffenceRecordController { |
52 | @Autowired | 52 | @Autowired |
53 | private ISafetyOffenceRecordService safetyOffenceRecordService; | 53 | private ISafetyOffenceRecordService safetyOffenceRecordService; |
54 | 54 | ||
55 | @Autowired | ||
56 | private ISysConfigService sysConfigService; | ||
57 | |||
58 | @Autowired | ||
59 | private ISysUserDepartService sysUserDepartMapper;//用户部门关系表 | ||
55 | /** | 60 | /** |
56 | * <pre> | 61 | * <pre> |
57 | * 分页列表查询 | 62 | * 分页列表查询 |
... | @@ -73,14 +78,68 @@ public class SafetyOffenceRecordController { | ... | @@ -73,14 +78,68 @@ public class SafetyOffenceRecordController { |
73 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 78 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
74 | HttpServletRequest req) { | 79 | HttpServletRequest req) { |
75 | Result<IPage<SafetyOffenceRecord>> result = new Result<IPage<SafetyOffenceRecord>>(); | 80 | Result<IPage<SafetyOffenceRecord>> result = new Result<IPage<SafetyOffenceRecord>>(); |
81 | |||
82 | |||
83 | |||
84 | Boolean flag = false; | ||
85 | String role_ah_id = sysConfigService.queryValueByKey("ROLE_AH_ADMIN");//安环管理员角色编号 | ||
86 | String role_cz_id = sysConfigService.queryValueByKey("ROLE_CZ");//厂长角色编号 | ||
87 | String userRoleIds = BaseContextHandler.getRoles(); | ||
88 | //安装部长角色看集团类型的违法上报 | ||
89 | if( userRoleIds != null && userRoleIds.contains( role_ah_id ) ){//判断安环管理员 | ||
90 | safetyOffenceRecord.setDepartId( null ); | ||
91 | flag = false; | ||
92 | } | ||
93 | if( userRoleIds != null && userRoleIds.contains( role_cz_id ) ){//判断 厂长 ,查询分管的所有长编号 | ||
94 | safetyOffenceRecord.setDepartId( BaseContextHandler.getDeparts() );//BaseContextHandler.getRealDepartId() | ||
95 | flag = true; | ||
96 | } | ||
97 | //各个厂长角色看到厂长类型的违法上报 departId | ||
98 | |||
76 | QueryWrapper<SafetyOffenceRecord> queryWrapper = QueryGenerator.initQueryWrapper(safetyOffenceRecord, req.getParameterMap()); | 99 | QueryWrapper<SafetyOffenceRecord> queryWrapper = QueryGenerator.initQueryWrapper(safetyOffenceRecord, req.getParameterMap()); |
77 | Page<SafetyOffenceRecord> page = new Page<SafetyOffenceRecord>(pageNo, pageSize); | 100 | Page<SafetyOffenceRecord> page = new Page<SafetyOffenceRecord>(pageNo, pageSize); |
101 | if(flag ){ | ||
102 | queryWrapper.in("depart_id", BaseContextHandler.getDeparts().split(",")); | ||
103 | } | ||
104 | |||
78 | IPage<SafetyOffenceRecord> pageList = safetyOffenceRecordService.page(page, queryWrapper); | 105 | IPage<SafetyOffenceRecord> pageList = safetyOffenceRecordService.page(page, queryWrapper); |
79 | result.setSuccess(true); | 106 | result.setSuccess(true); |
80 | result.setResult(pageList); | 107 | result.setResult(pageList); |
81 | return result; | 108 | return result; |
82 | } | 109 | } |
83 | 110 | ||
111 | @AutoLog(value = "违章记录-统计数量") | ||
112 | @ApiOperation(value="违章记录-统计数量", notes="违章记录-统计数量") | ||
113 | @PostMapping(value = "/statistics") | ||
114 | public Result<SafetyOffenceRecordStatisticsVO> statistics() { | ||
115 | Result<SafetyOffenceRecordStatisticsVO> result = new Result<SafetyOffenceRecordStatisticsVO>(); | ||
116 | try { | ||
117 | SafetyOffenceRecordStatisticsVO safetyOffenceRecordStatisticsVO = null; | ||
118 | |||
119 | String departIds = null; | ||
120 | String role_ah_id = sysConfigService.queryValueByKey("ROLE_AH_ADMIN");//安环管理员角色编号 | ||
121 | String role_cz_id = sysConfigService.queryValueByKey("ROLE_CZ");//厂长角色编号 | ||
122 | String userRoleIds = BaseContextHandler.getRoles(); | ||
123 | //安装部长角色看集团类型的违法上报 | ||
124 | if( userRoleIds != null && userRoleIds.contains( role_ah_id ) ){//判断安环管理员 | ||
125 | departIds = null; | ||
126 | } | ||
127 | if( userRoleIds != null && userRoleIds.contains( role_cz_id ) ){//判断 厂长 | ||
128 | departIds = BaseContextHandler.getDeparts(); | ||
129 | } | ||
130 | safetyOffenceRecordStatisticsVO = safetyOffenceRecordService.statistics(departIds); | ||
131 | |||
132 | result.setResult( safetyOffenceRecordStatisticsVO ); | ||
133 | result.success("操作成功!"); | ||
134 | } catch (Exception e) { | ||
135 | log.error(e.getMessage(),e); | ||
136 | result.error500("操作失败"); | ||
137 | } | ||
138 | return result; | ||
139 | } | ||
140 | |||
141 | |||
142 | |||
84 | /** | 143 | /** |
85 | * <pre> | 144 | * <pre> |
86 | * 添加 | 145 | * 添加 |
... | @@ -131,6 +190,29 @@ public class SafetyOffenceRecordController { | ... | @@ -131,6 +190,29 @@ public class SafetyOffenceRecordController { |
131 | 190 | ||
132 | return result; | 191 | return result; |
133 | } | 192 | } |
193 | |||
194 | |||
195 | @AutoLog(value = "违章记录-处理违章记录") | ||
196 | @ApiOperation(value="违章记录-处理违章记录", notes="违章记录-处理违章记录") | ||
197 | @PutMapping(value = "/handle") | ||
198 | public Result<SafetyOffenceRecord> handle(@RequestBody SafetyOffenceRecord safetyOffenceRecord) { | ||
199 | Result<SafetyOffenceRecord> result = new Result<SafetyOffenceRecord>(); | ||
200 | SafetyOffenceRecord safetyOffenceRecordEntity = safetyOffenceRecordService.getById(safetyOffenceRecord.getId()); | ||
201 | if(safetyOffenceRecordEntity==null) { | ||
202 | result.error500("未找到对应实体"); | ||
203 | }else { | ||
204 | |||
205 | safetyOffenceRecord.setHandleUser( BaseContextHandler.getUserId() );//处理人 | ||
206 | safetyOffenceRecord.setHandleTime( new Date() );//处理时间 | ||
207 | boolean ok = safetyOffenceRecordService.updateById(safetyOffenceRecord); | ||
208 | //TODO 返回false说明什么? | ||
209 | if(ok) { | ||
210 | result.success("修改成功!"); | ||
211 | } | ||
212 | } | ||
213 | |||
214 | return result; | ||
215 | } | ||
134 | /** | 216 | /** |
135 | * <pre> | 217 | * <pre> |
136 | * 通过id删除 | 218 | * 通过id删除 | ... | ... |
... | @@ -83,6 +83,26 @@ public class DangerLevelManage { | ... | @@ -83,6 +83,26 @@ public class DangerLevelManage { |
83 | @Excel(name = "安全四色图", width = 15) | 83 | @Excel(name = "安全四色图", width = 15) |
84 | @ApiModelProperty(value = "安全四色图") | 84 | @ApiModelProperty(value = "安全四色图") |
85 | private String dangerFour; | 85 | private String dangerFour; |
86 | |||
87 | @Excel(name = "风险点名称", width = 15) | ||
88 | @ApiModelProperty(value = "风险点名称") | ||
89 | private String dangerPlace; | ||
90 | |||
91 | @Excel(name = "关联设备", width = 15) | ||
92 | @ApiModelProperty(value = "关联设备") | ||
93 | @Dict(dicCode = "id",dicText = "equipment_name",dictTable = "equipment_info") | ||
94 | private String equipInfoId; | ||
95 | |||
96 | @Excel(name = "是否共享", width = 15) | ||
97 | @ApiModelProperty(value = "是否共享") | ||
98 | private String is_share; | ||
99 | |||
100 | @Excel(name = "二维码", width = 15) | ||
101 | @ApiModelProperty(value = "二维码") | ||
102 | private String qrCode; | ||
103 | |||
104 | |||
105 | |||
86 | /**创建人Id*/ | 106 | /**创建人Id*/ |
87 | @ApiModelProperty(value = "创建人Id") | 107 | @ApiModelProperty(value = "创建人Id") |
88 | private String createBy; | 108 | private String createBy; | ... | ... |
... | @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType; | ... | @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType; |
6 | import com.baomidou.mybatisplus.annotation.TableId; | 6 | import com.baomidou.mybatisplus.annotation.TableId; |
7 | import com.baomidou.mybatisplus.annotation.TableName; | 7 | import com.baomidou.mybatisplus.annotation.TableName; |
8 | import com.baomidou.mybatisplus.annotation.TableField; | 8 | import com.baomidou.mybatisplus.annotation.TableField; |
9 | import com.skua.core.aspect.annotation.Dict; | ||
9 | import io.swagger.annotations.ApiModel; | 10 | import io.swagger.annotations.ApiModel; |
10 | import io.swagger.annotations.ApiModelProperty; | 11 | import io.swagger.annotations.ApiModelProperty; |
11 | import lombok.Data; | 12 | import lombok.Data; |
... | @@ -48,7 +49,11 @@ public class EpibolyCertificate { | ... | @@ -48,7 +49,11 @@ public class EpibolyCertificate { |
48 | /**证件类型*/ | 49 | /**证件类型*/ |
49 | @Excel(name = "证件类型", width = 15) | 50 | @Excel(name = "证件类型", width = 15) |
50 | @ApiModelProperty(value = "证件类型") | 51 | @ApiModelProperty(value = "证件类型") |
52 | @Dict(dicCode = "epiboly_certificate_type") | ||
51 | private String certificateType; | 53 | private String certificateType; |
54 | |||
55 | |||
56 | |||
52 | /**到期时间*/ | 57 | /**到期时间*/ |
53 | @Excel(name = "到期时间", width = 15) | 58 | @Excel(name = "到期时间", width = 15) |
54 | @ApiModelProperty(value = "到期时间") | 59 | @ApiModelProperty(value = "到期时间") | ... | ... |
... | @@ -38,8 +38,12 @@ public class EpibolyOuterStaff { | ... | @@ -38,8 +38,12 @@ public class EpibolyOuterStaff { |
38 | /**关联外协单位ID*/ | 38 | /**关联外协单位ID*/ |
39 | @Excel(name = "关联外协单位ID", width = 15) | 39 | @Excel(name = "关联外协单位ID", width = 15) |
40 | @ApiModelProperty(value = "关联外协单位ID") | 40 | @ApiModelProperty(value = "关联外协单位ID") |
41 | @Dict(dictTable = "epiboly_company", dicCode="id", dicText = "company_name") | ||
41 | private String companyId; | 42 | private String companyId; |
42 | 43 | ||
44 | |||
45 | |||
46 | |||
43 | /**关联外协单位ID*/ | 47 | /**关联外协单位ID*/ |
44 | @Excel(name = "外协类型", width = 15) | 48 | @Excel(name = "外协类型", width = 15) |
45 | @ApiModelProperty(value = "外协类型:1 单位合作;2 个人合作") | 49 | @ApiModelProperty(value = "外协类型:1 单位合作;2 个人合作") |
... | @@ -55,11 +59,17 @@ public class EpibolyOuterStaff { | ... | @@ -55,11 +59,17 @@ public class EpibolyOuterStaff { |
55 | @Excel(name = "性别(0-默认未知,1-男,2-女)", width = 15) | 59 | @Excel(name = "性别(0-默认未知,1-男,2-女)", width = 15) |
56 | @ApiModelProperty(value = "性别(0-默认未知,1-男,2-女)") | 60 | @ApiModelProperty(value = "性别(0-默认未知,1-男,2-女)") |
57 | @Dict(dicCode = "sex") | 61 | @Dict(dicCode = "sex") |
58 | private Integer sex; | 62 | private String sex; |
63 | |||
59 | /**电子邮件*/ | 64 | /**电子邮件*/ |
60 | @Excel(name = "电子邮件", width = 15) | 65 | @Excel(name = "电子邮件", width = 15) |
61 | @ApiModelProperty(value = "电子邮件") | 66 | @ApiModelProperty(value = "电子邮件") |
62 | private String email; | 67 | private String email; |
68 | |||
69 | /**电子邮件*/ | ||
70 | @Excel(name = "学历", width = 15) | ||
71 | @ApiModelProperty(value = "学历") | ||
72 | private String degree; | ||
63 | /**手机号码*/ | 73 | /**手机号码*/ |
64 | @Excel(name = "手机号码", width = 15) | 74 | @Excel(name = "手机号码", width = 15) |
65 | @ApiModelProperty(value = "手机号码") | 75 | @ApiModelProperty(value = "手机号码") | ... | ... |
... | @@ -11,4 +11,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ... | @@ -11,4 +11,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
11 | */ | 11 | */ |
12 | public interface SafetyOffenceRecordMapper extends BaseMapper<SafetyOffenceRecord> { | 12 | public interface SafetyOffenceRecordMapper extends BaseMapper<SafetyOffenceRecord> { |
13 | 13 | ||
14 | |||
15 | /*** | ||
16 | * 统计数量:全部、未处理、已处理 | ||
17 | * @param departId | ||
18 | * @param handleStatus | ||
19 | * @return | ||
20 | */ | ||
21 | public Integer statisticsSafetyOffenceRecord(@Param("departId") String departId, @Param("status") String status); | ||
14 | } | 22 | } | ... | ... |
... | @@ -2,4 +2,19 @@ | ... | @@ -2,4 +2,19 @@ |
2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 2 | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | <mapper namespace="com.skua.modules.safe.mapper.SafetyOffenceRecordMapper"> | 3 | <mapper namespace="com.skua.modules.safe.mapper.SafetyOffenceRecordMapper"> |
4 | 4 | ||
5 | |||
6 | |||
7 | <!-- 统计数量:全部、未处理、已处理 --> | ||
8 | <select id="statisticsSafetyOffenceRecord" resultType="java.lang.Integer"> | ||
9 | select count(1) from safety_offence_record | ||
10 | <where> | ||
11 | <if test="departId != null "> | ||
12 | depart_id in ( ${departId}) | ||
13 | </if> | ||
14 | <if test="status != null "> | ||
15 | status = #{status} | ||
16 | </if> | ||
17 | |||
18 | </where> | ||
19 | </select> | ||
5 | </mapper> | 20 | </mapper> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -2,10 +2,17 @@ package com.skua.modules.safe.service; | ... | @@ -2,10 +2,17 @@ package com.skua.modules.safe.service; |
2 | 2 | ||
3 | import com.skua.modules.safe.entity.SafetyOffenceRecord; | 3 | import com.skua.modules.safe.entity.SafetyOffenceRecord; |
4 | import com.baomidou.mybatisplus.extension.service.IService; | 4 | import com.baomidou.mybatisplus.extension.service.IService; |
5 | import com.skua.modules.safe.vo.SafetyOffenceRecordStatisticsVO; | ||
5 | 6 | ||
6 | /** | 7 | /** |
7 | * 违章记录 | 8 | * 违章记录 |
8 | */ | 9 | */ |
9 | public interface ISafetyOffenceRecordService extends IService<SafetyOffenceRecord> { | 10 | public interface ISafetyOffenceRecordService extends IService<SafetyOffenceRecord> { |
10 | 11 | ||
12 | /*** | ||
13 | * 统计数量 | ||
14 | * @param departIds 部门编号集合 | ||
15 | * @return | ||
16 | */ | ||
17 | public SafetyOffenceRecordStatisticsVO statistics(String departIds); | ||
11 | } | 18 | } | ... | ... |
... | @@ -3,6 +3,7 @@ package com.skua.modules.safe.service.impl; | ... | @@ -3,6 +3,7 @@ package com.skua.modules.safe.service.impl; |
3 | import com.skua.modules.safe.entity.SafetyOffenceRecord; | 3 | import com.skua.modules.safe.entity.SafetyOffenceRecord; |
4 | import com.skua.modules.safe.mapper.SafetyOffenceRecordMapper; | 4 | import com.skua.modules.safe.mapper.SafetyOffenceRecordMapper; |
5 | import com.skua.modules.safe.service.ISafetyOffenceRecordService; | 5 | import com.skua.modules.safe.service.ISafetyOffenceRecordService; |
6 | import com.skua.modules.safe.vo.SafetyOffenceRecordStatisticsVO; | ||
6 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
7 | 8 | ||
8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 9 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
... | @@ -13,4 +14,29 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ... | @@ -13,4 +14,29 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
13 | @Service | 14 | @Service |
14 | public class SafetyOffenceRecordServiceImpl extends ServiceImpl<SafetyOffenceRecordMapper, SafetyOffenceRecord> implements ISafetyOffenceRecordService { | 15 | public class SafetyOffenceRecordServiceImpl extends ServiceImpl<SafetyOffenceRecordMapper, SafetyOffenceRecord> implements ISafetyOffenceRecordService { |
15 | 16 | ||
17 | /*** | ||
18 | * 统计数量 | ||
19 | * @param departIds 部门编号集合 | ||
20 | * @return | ||
21 | */ | ||
22 | public SafetyOffenceRecordStatisticsVO statistics(String departIds){ | ||
23 | //处理状态【1 已处理 2 暂不处理】 | ||
24 | String status = null; | ||
25 | // 统计总数 | ||
26 | int total = this.baseMapper.statisticsSafetyOffenceRecord(departIds ,status ); | ||
27 | // 未处理数量 | ||
28 | status = "1"; //上报未处理 | ||
29 | int unHandleNum = this.baseMapper.statisticsSafetyOffenceRecord( departIds ,status ); | ||
30 | // 已处理数量 | ||
31 | status = "2"; //已经处理 | ||
32 | int handleNum = this.baseMapper.statisticsSafetyOffenceRecord( departIds ,status ); | ||
33 | SafetyOffenceRecordStatisticsVO recordStatisticsVO = new SafetyOffenceRecordStatisticsVO(); | ||
34 | |||
35 | recordStatisticsVO.setHandleNum( handleNum ); | ||
36 | recordStatisticsVO.setTotal( total ); | ||
37 | recordStatisticsVO.setUnHandleNum( unHandleNum ); | ||
38 | return recordStatisticsVO; | ||
39 | |||
40 | } | ||
41 | |||
16 | } | 42 | } | ... | ... |
sk-module-biz/src/main/java/com/skua/modules/safe/vo/SafetyOffenceRecordStatisticsVO.java
0 → 100644
1 | package com.skua.modules.safe.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModel; | ||
4 | import io.swagger.annotations.ApiModelProperty; | ||
5 | import lombok.Data; | ||
6 | import org.jeecgframework.poi.excel.annotation.Excel; | ||
7 | |||
8 | import java.io.Serializable; | ||
9 | |||
10 | /** | ||
11 | * 违章统计对象 | ||
12 | */ | ||
13 | @Data | ||
14 | @ApiModel(value="SafetyOffenceRecordStatistics 违章记录统计对象", description="违章记录统计对象") | ||
15 | public class SafetyOffenceRecordStatisticsVO implements Serializable { | ||
16 | |||
17 | @Excel(name = "全部数据", width = 15) | ||
18 | @ApiModelProperty(value = "全部数据") | ||
19 | private Integer total; | ||
20 | |||
21 | @Excel(name = "未处理数量", width = 15) | ||
22 | @ApiModelProperty(value = "未处理数量") | ||
23 | private Integer unHandleNum;//未处理数量 | ||
24 | |||
25 | @Excel(name = "已经处理数据", width = 15) | ||
26 | @ApiModelProperty(value = "已经处理数据") | ||
27 | private Integer handleNum;//已经处理数据 | ||
28 | |||
29 | } |
1 | package com.skua.modules.system.entity; | ||
2 | |||
3 | import java.io.Serializable; | ||
4 | import java.util.Date; | ||
5 | import com.baomidou.mybatisplus.annotation.IdType; | ||
6 | import com.baomidou.mybatisplus.annotation.TableId; | ||
7 | import com.baomidou.mybatisplus.annotation.TableName; | ||
8 | import com.baomidou.mybatisplus.annotation.TableField; | ||
9 | import io.swagger.annotations.ApiModel; | ||
10 | import io.swagger.annotations.ApiModelProperty; | ||
11 | import lombok.Data; | ||
12 | import lombok.EqualsAndHashCode; | ||
13 | import lombok.experimental.Accessors; | ||
14 | import com.fasterxml.jackson.annotation.JsonFormat; | ||
15 | import org.springframework.format.annotation.DateTimeFormat; | ||
16 | import org.jeecgframework.poi.excel.annotation.Excel; | ||
17 | |||
18 | /** | ||
19 | * 参数配置表 | ||
20 | */ | ||
21 | @Data | ||
22 | @TableName("sys_config") | ||
23 | @EqualsAndHashCode(callSuper = false) | ||
24 | @Accessors(chain = true) | ||
25 | @ApiModel(value="sys_config对象", description="参数配置表") | ||
26 | public class SysConfig { | ||
27 | |||
28 | /**参数主键*/ | ||
29 | /**ID*/ | ||
30 | @TableId(type = IdType.UUID) | ||
31 | @ApiModelProperty(value = "configId") | ||
32 | private Integer configId; | ||
33 | /**参数名称*/ | ||
34 | @Excel(name = "参数名称", width = 15) | ||
35 | @ApiModelProperty(value = "参数名称") | ||
36 | private String configName; | ||
37 | /**参数键名*/ | ||
38 | @Excel(name = "参数键名", width = 15) | ||
39 | @ApiModelProperty(value = "参数键名") | ||
40 | private String configKey; | ||
41 | /**参数键值*/ | ||
42 | @Excel(name = "参数键值", width = 15) | ||
43 | @ApiModelProperty(value = "参数键值") | ||
44 | private String configValue; | ||
45 | /**系统内置(Y是 N否)*/ | ||
46 | @Excel(name = "系统内置(Y是 N否)", width = 15) | ||
47 | @ApiModelProperty(value = "系统内置(Y是 N否)") | ||
48 | private String configType; | ||
49 | /**创建者*/ | ||
50 | @Excel(name = "创建者", width = 15) | ||
51 | @ApiModelProperty(value = "创建者") | ||
52 | private String createBy; | ||
53 | /**创建时间*/ | ||
54 | @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
55 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | ||
56 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | ||
57 | @ApiModelProperty(value = "创建时间") | ||
58 | private Date createTime; | ||
59 | /**更新者*/ | ||
60 | @Excel(name = "更新者", width = 15) | ||
61 | @ApiModelProperty(value = "更新者") | ||
62 | private String updateBy; | ||
63 | /**更新时间*/ | ||
64 | @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") | ||
65 | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") | ||
66 | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") | ||
67 | @ApiModelProperty(value = "更新时间") | ||
68 | private Date updateTime; | ||
69 | /**备注*/ | ||
70 | @Excel(name = "备注", width = 15) | ||
71 | @ApiModelProperty(value = "备注") | ||
72 | private String remark; | ||
73 | } |
1 | package com.skua.modules.system.mapper; | ||
2 | |||
3 | import java.util.List; | ||
4 | |||
5 | import org.apache.ibatis.annotations.Param; | ||
6 | import com.skua.modules.system.entity.SysConfig; | ||
7 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
8 | |||
9 | /** | ||
10 | * 参数配置表 | ||
11 | */ | ||
12 | public interface SysConfigMapper extends BaseMapper<SysConfig> { | ||
13 | |||
14 | |||
15 | /*** | ||
16 | *根据configKey获取value | ||
17 | * @param configKey | ||
18 | * @return | ||
19 | */ | ||
20 | public List<String> queryValueByKey(@Param("configKey") String configKey ); | ||
21 | } |
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.skua.modules.system.mapper.SysConfigMapper"> | ||
4 | |||
5 | <!-- 根据configKey获取value --> | ||
6 | <select id="queryValueByKey" resultType="java.lang.String"> | ||
7 | select config_value from sys_config where config_key =#{configKey} | ||
8 | </select> | ||
9 | |||
10 | </mapper> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | package com.skua.modules.system.service; | ||
2 | |||
3 | import com.skua.modules.system.entity.SysConfig; | ||
4 | import com.baomidou.mybatisplus.extension.service.IService; | ||
5 | |||
6 | /** | ||
7 | * 参数配置表 | ||
8 | */ | ||
9 | public interface ISysConfigService extends IService<SysConfig> { | ||
10 | |||
11 | |||
12 | /*** | ||
13 | *根据configKey获取value | ||
14 | * @param configKey | ||
15 | * @return | ||
16 | */ | ||
17 | public String queryValueByKey( String configKey ); | ||
18 | |||
19 | } |
sk-module-system/src/main/java/com/skua/modules/system/service/impl/SysConfigServiceImpl.java
0 → 100644
1 | package com.skua.modules.system.service.impl; | ||
2 | |||
3 | import com.skua.modules.system.entity.SysConfig; | ||
4 | import com.skua.modules.system.mapper.SysConfigMapper; | ||
5 | import com.skua.modules.system.service.ISysConfigService; | ||
6 | import org.springframework.stereotype.Service; | ||
7 | |||
8 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||
9 | |||
10 | import java.util.List; | ||
11 | |||
12 | /** | ||
13 | * 参数配置表 | ||
14 | */ | ||
15 | @Service | ||
16 | public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService { | ||
17 | |||
18 | /*** | ||
19 | *根据configKey获取value | ||
20 | * @param configKey | ||
21 | * @return | ||
22 | */ | ||
23 | public String queryValueByKey( String configKey ){ | ||
24 | List<String> valueList = this.baseMapper.queryValueByKey(configKey); | ||
25 | String value = null; | ||
26 | if( valueList != null && !valueList.isEmpty()){ | ||
27 | value = valueList.get(0); | ||
28 | } | ||
29 | |||
30 | return value; | ||
31 | } | ||
32 | |||
33 | } |
-
请 注册 或 登录 后发表评论