3bc245db 康伟

kangwei: 外协人员接口

         系统配置表相关代码--存放参数信息
1 个父辈 1d7c30d4
正在显示 20 个修改的文件 包含 457 行增加21 行删除
......@@ -7,6 +7,8 @@ import java.net.URLDecoder;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.skua.common.util.word.ExportWordUtils;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.query.QueryGenerator;
......@@ -37,6 +39,7 @@ import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecgframework.poi.word.WordExportUtil;
import org.jeecgframework.poi.word.entity.MyXWPFDocument;
import org.jeecgframework.poi.word.entity.WordImageEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -317,36 +320,74 @@ public class AjhMeetingMinutesController {
}
/***
* 下载会议纪要
* @param id
* @param meetsId
* @param response
*/
@AutoLog(value = "会议纪要管理-通过会议纪要id下载会议纪要")
@ApiOperation(value="会议纪要管理-通过id下载会议纪要", notes="会议纪要管理-通过id下载会议纪要")
@GetMapping("/exportWordData")
public void exportWordData(@RequestParam(name="id",required=true) String id,HttpServletResponse response ) {
String templatePath = null;//导出模板文件名称
public void exportWordData(@RequestParam(name="id",required=true) String meetsId,HttpServletResponse response ) {
String templatePath = "D:\\test\\会议模板-2.docx";//导出模板文件名称
String exportName = "****---会议纪要.docx";//导出文件名称
Map<String ,Object> paramMap = new HashMap<String,Object>();
AjhMeetingMinutes ajhMeetingMinutes = ajhMeetingMinutesService.getDataById(id);
AjhMeetingMinutes ajhMeetingMinutes = ajhMeetingMinutesService.queryByMeetId(meetsId);
ExportAjhMeetingMinutesVO exprotVo = new ExportAjhMeetingMinutesVO();
// 标题:meetTitile 机构名称:orgDepart 纪要图片 , 住持人 ;纪要内容 ; 会议地点
exprotVo.convert( exprotVo , ajhMeetingMinutes);
// 会议记录
AjhMeetingSend meetingSend = meetingSendService.getById( ajhMeetingMinutes.getMeetsId() );
AjhMeetingSend meetingSend = meetingSendService.getById( meetsId );
//会议通知
AjhMeeting meeting = meetingService.getById( meetingSend.getMeetId() );
AjhMeeting meeting = meetingService.getById( meetsId );
//签到集合
List<AjhMeetingAttend> meetingAttendList = meetingAttendService.getByMeetsId( ajhMeetingMinutes.getMeetsId() );
int supplementNum = 0;//后续添加补全表格记录16
List<AjhMeetingAttend> meetingAttendList = meetingAttendService.getByMeetsId( meetsId );
if(meetingAttendList == null || meetingAttendList.isEmpty()){
meetingAttendList = new ArrayList<AjhMeetingAttend>();
supplementNum = 16;
}else{
supplementNum = 16 - meetingAttendList.size();
}
paramMap.put("dataList",meetingAttendList);
//补全签到表格集合
supplementList( meetingAttendList , supplementNum );
//签到表集合
paramMap.put("attendList",meetingAttendList);
//添加图片
// 第三部分:图片
WordImageEntity img = new WordImageEntity();
img.setType(WordImageEntity.URL);
img.setUrl("D:\\test\\123.jpg");
//img.setUrl("https://s2.51cto.com/media/2024/blog/logo.png");
img.setWidth(550);
img.setHeight(500);
paramMap.put("meetingPlace" , img);
//导出word
exportWordData( templatePath , exportName , paramMap ,response);
}
/***
* 补全签到表格集合
* @param meetingAttendList
* @param supplementNum
*/
private void supplementList(List<AjhMeetingAttend> meetingAttendList ,int supplementNum){
if(supplementNum > 0){
for(int i = 0 ;i <supplementNum ;i ++){
meetingAttendList.add( new AjhMeetingAttend() );
}
}
}
/**
* 导出word模板
* @param templatePath
* @param exportName
* @param paramMap
* @param response
*/
private void exportWordData(String templatePath , String exportName , Map<String ,Object> paramMap, HttpServletResponse response ){
InputStream is = null;
......@@ -359,8 +400,9 @@ public class AjhMeetingMinutesController {
//解析07版的Word并且进行赋值
WordExportUtil.exportWord07(document, paramMap);
//WordExportUtil.exportWord07(document, paramMap);
//解析07版的Word并且进行赋值
ExportWordUtils.getInstance().exportWord07(document, paramMap);
// .doc格式文档,设置响应内容类型为 Word 文档
response.setContentType("application/msword");
//String exportName = "***--会议纪要.docx";
......@@ -370,10 +412,18 @@ public class AjhMeetingMinutesController {
response.setHeader("Content-Disposition", "attachment;filename=".concat(String.valueOf(URLEncoder.encode(exportName , "UTF-8"))));
// 将文档写入响应的输出流
document.write(response.getOutputStream());
// 输出文件路径 --测试
String outputPath = "D:\\test\\会议纪要导出记录.docx";
FileOutputStream outputFile = new FileOutputStream(outputPath);
document.write( outputFile);
//document.write(response.getOutputStream());
// 刷新和关闭输出流
response.getOutputStream().flush();
response.getOutputStream().close();
//response.getOutputStream().flush();
//response.getOutputStream().close();
outputFile.close();
}
catch (Exception e) {
e.printStackTrace();
......
......@@ -80,6 +80,6 @@ public class ExportAjhMeetingMinutesVO {
exprotVo.setSendDate(ajhMeetingMinutes.getSendDate());//发送时间
exprotVo.setMeetTitile(ajhMeetingMinutes.getTitle());//会议标题
exprotVo.setMeetingPlace( ajhMeetingMinutes.getPlace()); //会议地址
exprotVo.setMeetingPlace( ajhMeetingMinutes.getImage() );//会议图片;需要补全路径
//exprotVo.setMeetingPlace( ajhMeetingMinutes.getImage() );//会议图片;需要补全路径
}
}
......
......@@ -76,6 +76,15 @@ public class EpibolyCertificateController {
Result<IPage<EpibolyCertificate>> result = new Result<IPage<EpibolyCertificate>>();
QueryWrapper<EpibolyCertificate> queryWrapper = QueryGenerator.initQueryWrapper(epibolyCertificate, req.getParameterMap());
Page<EpibolyCertificate> page = new Page<EpibolyCertificate>(pageNo, pageSize);
if(epibolyCertificate.getCompanyId() != null ){
queryWrapper.eq("company_id",epibolyCertificate.getCompanyId());
}
if(epibolyCertificate.getOuterStaffId() != null ){
queryWrapper.eq("outer_staff_id",epibolyCertificate.getOuterStaffId());
}
IPage<EpibolyCertificate> pageList = epibolyCertificateService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
......
......@@ -99,6 +99,8 @@ public class EpibolyCompanyController {
Result<IPage<EpibolyCompany>> result = new Result<IPage<EpibolyCompany>>();
QueryWrapper<EpibolyCompany> queryWrapper = QueryGenerator.initQueryWrapper(epibolyCompany, req.getParameterMap());
Page<EpibolyCompany> page = new Page<EpibolyCompany>(pageNo, pageSize);
queryWrapper.eq("depart_id",epibolyCompany.getDepartId());
IPage<EpibolyCompany> pageList = epibolyCompanyService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
......
......@@ -75,6 +75,11 @@ public class EpibolyContractController {
Result<IPage<EpibolyContract>> result = new Result<IPage<EpibolyContract>>();
QueryWrapper<EpibolyContract> queryWrapper = QueryGenerator.initQueryWrapper(epibolyContract, req.getParameterMap());
Page<EpibolyContract> page = new Page<EpibolyContract>(pageNo, pageSize);
if(epibolyContract.getCompanyId() != null ){
queryWrapper.eq("company_id",epibolyContract.getCompanyId());
}
IPage<EpibolyContract> pageList = epibolyContractService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
......
......@@ -75,6 +75,16 @@ public class EpibolyOuterStaffController {
Result<IPage<EpibolyOuterStaff>> result = new Result<IPage<EpibolyOuterStaff>>();
QueryWrapper<EpibolyOuterStaff> queryWrapper = QueryGenerator.initQueryWrapper(epibolyOuterStaff, req.getParameterMap());
Page<EpibolyOuterStaff> page = new Page<EpibolyOuterStaff>(pageNo, pageSize);
//queryWrapper.in("company_id", BaseContextHandler.getDeparts().split(","));
if(epibolyOuterStaff.getDepartId() != null ){
queryWrapper.eq("depart_id",epibolyOuterStaff.getDepartId());
}
if(epibolyOuterStaff.getCompanyId() != null ){
queryWrapper.eq("company_id",epibolyOuterStaff.getCompanyId());
}
IPage<EpibolyOuterStaff> pageList = epibolyOuterStaffService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
......@@ -101,7 +111,7 @@ public class EpibolyOuterStaffController {
epibolyOuterStaff.setCreateTime(new Date());
epibolyOuterStaffService.saveEpibolyOuterStaff(epibolyOuterStaff);
result.setResult( epibolyOuterStaff );
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
......@@ -130,6 +140,8 @@ public class EpibolyOuterStaffController {
epibolyOuterStaff.setUpdateBy(BaseContextHandler.getUserName());
epibolyOuterStaff.setUpdateTime(new Date());
boolean ok = epibolyOuterStaffService.updateById(epibolyOuterStaff);
result.setResult( epibolyOuterStaff );
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
......
package com.skua.modules.safe.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
......@@ -16,10 +14,12 @@ import com.skua.core.service.ISequenceService;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.safe.entity.SafetyOffenceRecord;
import com.skua.modules.safe.service.ISafetyOffenceRecordService;
import java.util.Date;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.safe.vo.SafetyOffenceRecordStatisticsVO;
import com.skua.modules.system.service.ISysConfigService;
import com.skua.modules.system.service.ISysUserDepartService;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
......@@ -52,6 +52,11 @@ public class SafetyOffenceRecordController {
@Autowired
private ISafetyOffenceRecordService safetyOffenceRecordService;
@Autowired
private ISysConfigService sysConfigService;
@Autowired
private ISysUserDepartService sysUserDepartMapper;//用户部门关系表
/**
* <pre>
* 分页列表查询
......@@ -73,14 +78,68 @@ public class SafetyOffenceRecordController {
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<SafetyOffenceRecord>> result = new Result<IPage<SafetyOffenceRecord>>();
Boolean flag = false;
String role_ah_id = sysConfigService.queryValueByKey("ROLE_AH_ADMIN");//安环管理员角色编号
String role_cz_id = sysConfigService.queryValueByKey("ROLE_CZ");//厂长角色编号
String userRoleIds = BaseContextHandler.getRoles();
//安装部长角色看集团类型的违法上报
if( userRoleIds != null && userRoleIds.contains( role_ah_id ) ){//判断安环管理员
safetyOffenceRecord.setDepartId( null );
flag = false;
}
if( userRoleIds != null && userRoleIds.contains( role_cz_id ) ){//判断 厂长 ,查询分管的所有长编号
safetyOffenceRecord.setDepartId( BaseContextHandler.getDeparts() );//BaseContextHandler.getRealDepartId()
flag = true;
}
//各个厂长角色看到厂长类型的违法上报 departId
QueryWrapper<SafetyOffenceRecord> queryWrapper = QueryGenerator.initQueryWrapper(safetyOffenceRecord, req.getParameterMap());
Page<SafetyOffenceRecord> page = new Page<SafetyOffenceRecord>(pageNo, pageSize);
if(flag ){
queryWrapper.in("depart_id", BaseContextHandler.getDeparts().split(","));
}
IPage<SafetyOffenceRecord> pageList = safetyOffenceRecordService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
@AutoLog(value = "违章记录-统计数量")
@ApiOperation(value="违章记录-统计数量", notes="违章记录-统计数量")
@PostMapping(value = "/statistics")
public Result<SafetyOffenceRecordStatisticsVO> statistics() {
Result<SafetyOffenceRecordStatisticsVO> result = new Result<SafetyOffenceRecordStatisticsVO>();
try {
SafetyOffenceRecordStatisticsVO safetyOffenceRecordStatisticsVO = null;
String departIds = null;
String role_ah_id = sysConfigService.queryValueByKey("ROLE_AH_ADMIN");//安环管理员角色编号
String role_cz_id = sysConfigService.queryValueByKey("ROLE_CZ");//厂长角色编号
String userRoleIds = BaseContextHandler.getRoles();
//安装部长角色看集团类型的违法上报
if( userRoleIds != null && userRoleIds.contains( role_ah_id ) ){//判断安环管理员
departIds = null;
}
if( userRoleIds != null && userRoleIds.contains( role_cz_id ) ){//判断 厂长
departIds = BaseContextHandler.getDeparts();
}
safetyOffenceRecordStatisticsVO = safetyOffenceRecordService.statistics(departIds);
result.setResult( safetyOffenceRecordStatisticsVO );
result.success("操作成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
result.error500("操作失败");
}
return result;
}
/**
* <pre>
* 添加
......@@ -131,6 +190,29 @@ public class SafetyOffenceRecordController {
return result;
}
@AutoLog(value = "违章记录-处理违章记录")
@ApiOperation(value="违章记录-处理违章记录", notes="违章记录-处理违章记录")
@PutMapping(value = "/handle")
public Result<SafetyOffenceRecord> handle(@RequestBody SafetyOffenceRecord safetyOffenceRecord) {
Result<SafetyOffenceRecord> result = new Result<SafetyOffenceRecord>();
SafetyOffenceRecord safetyOffenceRecordEntity = safetyOffenceRecordService.getById(safetyOffenceRecord.getId());
if(safetyOffenceRecordEntity==null) {
result.error500("未找到对应实体");
}else {
safetyOffenceRecord.setHandleUser( BaseContextHandler.getUserId() );//处理人
safetyOffenceRecord.setHandleTime( new Date() );//处理时间
boolean ok = safetyOffenceRecordService.updateById(safetyOffenceRecord);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
}
}
return result;
}
/**
* <pre>
* 通过id删除
......
......@@ -83,6 +83,26 @@ public class DangerLevelManage {
@Excel(name = "安全四色图", width = 15)
@ApiModelProperty(value = "安全四色图")
private String dangerFour;
@Excel(name = "风险点名称", width = 15)
@ApiModelProperty(value = "风险点名称")
private String dangerPlace;
@Excel(name = "关联设备", width = 15)
@ApiModelProperty(value = "关联设备")
@Dict(dicCode = "id",dicText = "equipment_name",dictTable = "equipment_info")
private String equipInfoId;
@Excel(name = "是否共享", width = 15)
@ApiModelProperty(value = "是否共享")
private String is_share;
@Excel(name = "二维码", width = 15)
@ApiModelProperty(value = "二维码")
private String qrCode;
/**创建人Id*/
@ApiModelProperty(value = "创建人Id")
private String createBy;
......
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.skua.core.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -48,7 +49,11 @@ public class EpibolyCertificate {
/**证件类型*/
@Excel(name = "证件类型", width = 15)
@ApiModelProperty(value = "证件类型")
@Dict(dicCode = "epiboly_certificate_type")
private String certificateType;
/**到期时间*/
@Excel(name = "到期时间", width = 15)
@ApiModelProperty(value = "到期时间")
......
......@@ -38,8 +38,12 @@ public class EpibolyOuterStaff {
/**关联外协单位ID*/
@Excel(name = "关联外协单位ID", width = 15)
@ApiModelProperty(value = "关联外协单位ID")
@Dict(dictTable = "epiboly_company", dicCode="id", dicText = "company_name")
private String companyId;
/**关联外协单位ID*/
@Excel(name = "外协类型", width = 15)
@ApiModelProperty(value = "外协类型:1 单位合作;2 个人合作")
......@@ -55,11 +59,17 @@ public class EpibolyOuterStaff {
@Excel(name = "性别(0-默认未知,1-男,2-女)", width = 15)
@ApiModelProperty(value = "性别(0-默认未知,1-男,2-女)")
@Dict(dicCode = "sex")
private Integer sex;
private String sex;
/**电子邮件*/
@Excel(name = "电子邮件", width = 15)
@ApiModelProperty(value = "电子邮件")
@ApiModelProperty(value = "电子邮件")
private String email;
/**电子邮件*/
@Excel(name = "学历", width = 15)
@ApiModelProperty(value = "学历")
private String degree;
/**手机号码*/
@Excel(name = "手机号码", width = 15)
@ApiModelProperty(value = "手机号码")
......
......@@ -11,4 +11,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface SafetyOffenceRecordMapper extends BaseMapper<SafetyOffenceRecord> {
/***
* 统计数量:全部、未处理、已处理
* @param departId
* @param handleStatus
* @return
*/
public Integer statisticsSafetyOffenceRecord(@Param("departId") String departId, @Param("status") String status);
}
......
......@@ -2,4 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.safe.mapper.SafetyOffenceRecordMapper">
<!-- 统计数量:全部、未处理、已处理 -->
<select id="statisticsSafetyOffenceRecord" resultType="java.lang.Integer">
select count(1) from safety_offence_record
<where>
<if test="departId != null ">
depart_id in ( ${departId})
</if>
<if test="status != null ">
status = #{status}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
......
......@@ -2,10 +2,17 @@ package com.skua.modules.safe.service;
import com.skua.modules.safe.entity.SafetyOffenceRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.safe.vo.SafetyOffenceRecordStatisticsVO;
/**
* 违章记录
*/
public interface ISafetyOffenceRecordService extends IService<SafetyOffenceRecord> {
/***
* 统计数量
* @param departIds 部门编号集合
* @return
*/
public SafetyOffenceRecordStatisticsVO statistics(String departIds);
}
......
......@@ -3,6 +3,7 @@ package com.skua.modules.safe.service.impl;
import com.skua.modules.safe.entity.SafetyOffenceRecord;
import com.skua.modules.safe.mapper.SafetyOffenceRecordMapper;
import com.skua.modules.safe.service.ISafetyOffenceRecordService;
import com.skua.modules.safe.vo.SafetyOffenceRecordStatisticsVO;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -13,4 +14,29 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@Service
public class SafetyOffenceRecordServiceImpl extends ServiceImpl<SafetyOffenceRecordMapper, SafetyOffenceRecord> implements ISafetyOffenceRecordService {
/***
* 统计数量
* @param departIds 部门编号集合
* @return
*/
public SafetyOffenceRecordStatisticsVO statistics(String departIds){
//处理状态【1 已处理 2 暂不处理】
String status = null;
// 统计总数
int total = this.baseMapper.statisticsSafetyOffenceRecord(departIds ,status );
// 未处理数量
status = "1"; //上报未处理
int unHandleNum = this.baseMapper.statisticsSafetyOffenceRecord( departIds ,status );
// 已处理数量
status = "2"; //已经处理
int handleNum = this.baseMapper.statisticsSafetyOffenceRecord( departIds ,status );
SafetyOffenceRecordStatisticsVO recordStatisticsVO = new SafetyOffenceRecordStatisticsVO();
recordStatisticsVO.setHandleNum( handleNum );
recordStatisticsVO.setTotal( total );
recordStatisticsVO.setUnHandleNum( unHandleNum );
return recordStatisticsVO;
}
}
......
package com.skua.modules.safe.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* 违章统计对象
*/
@Data
@ApiModel(value="SafetyOffenceRecordStatistics 违章记录统计对象", description="违章记录统计对象")
public class SafetyOffenceRecordStatisticsVO implements Serializable {
@Excel(name = "全部数据", width = 15)
@ApiModelProperty(value = "全部数据")
private Integer total;
@Excel(name = "未处理数量", width = 15)
@ApiModelProperty(value = "未处理数量")
private Integer unHandleNum;//未处理数量
@Excel(name = "已经处理数据", width = 15)
@ApiModelProperty(value = "已经处理数据")
private Integer handleNum;//已经处理数据
}
package com.skua.modules.system.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* 参数配置表
*/
@Data
@TableName("sys_config")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="sys_config对象", description="参数配置表")
public class SysConfig {
/**参数主键*/
/**ID*/
@TableId(type = IdType.UUID)
@ApiModelProperty(value = "configId")
private Integer configId;
/**参数名称*/
@Excel(name = "参数名称", width = 15)
@ApiModelProperty(value = "参数名称")
private String configName;
/**参数键名*/
@Excel(name = "参数键名", width = 15)
@ApiModelProperty(value = "参数键名")
private String configKey;
/**参数键值*/
@Excel(name = "参数键值", width = 15)
@ApiModelProperty(value = "参数键值")
private String configValue;
/**系统内置(Y是 N否)*/
@Excel(name = "系统内置(Y是 N否)", width = 15)
@ApiModelProperty(value = "系统内置(Y是 N否)")
private String configType;
/**创建者*/
@Excel(name = "创建者", width = 15)
@ApiModelProperty(value = "创建者")
private String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**更新者*/
@Excel(name = "更新者", width = 15)
@ApiModelProperty(value = "更新者")
private String updateBy;
/**更新时间*/
@Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
}
package com.skua.modules.system.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.system.entity.SysConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 参数配置表
*/
public interface SysConfigMapper extends BaseMapper<SysConfig> {
/***
*根据configKey获取value
* @param configKey
* @return
*/
public List<String> queryValueByKey(@Param("configKey") String configKey );
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.system.mapper.SysConfigMapper">
<!-- 根据configKey获取value -->
<select id="queryValueByKey" resultType="java.lang.String">
select config_value from sys_config where config_key =#{configKey}
</select>
</mapper>
\ No newline at end of file
package com.skua.modules.system.service;
import com.skua.modules.system.entity.SysConfig;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 参数配置表
*/
public interface ISysConfigService extends IService<SysConfig> {
/***
*根据configKey获取value
* @param configKey
* @return
*/
public String queryValueByKey( String configKey );
}
package com.skua.modules.system.service.impl;
import com.skua.modules.system.entity.SysConfig;
import com.skua.modules.system.mapper.SysConfigMapper;
import com.skua.modules.system.service.ISysConfigService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* 参数配置表
*/
@Service
public class SysConfigServiceImpl extends ServiceImpl<SysConfigMapper, SysConfig> implements ISysConfigService {
/***
*根据configKey获取value
* @param configKey
* @return
*/
public String queryValueByKey( String configKey ){
List<String> valueList = this.baseMapper.queryValueByKey(configKey);
String value = null;
if( valueList != null && !valueList.isEmpty()){
value = valueList.get(0);
}
return value;
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!