| | |
| | | |
| | | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
| | | hs_err_pid* |
| | | .idea |
| | | target/ |
| | | upload/ |
| | | logs/ |
| | |
| | | @ApiOperation(value = "分页获取教师管理",httpMethod = "GET") |
| | | @GetMapping("/page") |
| | | public TableDataInfo selectTeacherAll(@RequestParam @NotNull(message = "isCm不能为空") int isCm) { |
| | | startPage(); |
| | | List<GetTeacherRespDTO> list = eduResourcesManagerService.selectTeacherAll(isCm); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页获取教师管理通过工种类型",httpMethod = "GET") |
| | | @GetMapping("/pageByCondition") |
| | | public TableDataInfo selectTeacherByCondition(@RequestParam @NotNull(message = "isCm不能为空") int isCm |
| | | ,@RequestParam Long operateTypeId) { |
| | | List<GetTeacherRespDTO> list = eduResourcesManagerService.selectTeacherByCondition(isCm,operateTypeId); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | */ |
| | |
| | | |
| | | AjaxResult deleteTeacherBindOperateType(Long id); |
| | | |
| | | List<GetTeacherRespDTO> selectTeacherByCondition(int isCm, Long operateTypeId); |
| | | |
| | | } |
| | |
| | | wrapper.eq(CmStaff::getDelFlag,DeleteStatusEnum.NO.getStatus()) |
| | | .eq(CmStaff::getCode,code); |
| | | CmStaff cmStaff = cmStaffService.getOne(wrapper); |
| | | if (wrapper == null){ |
| | | if (cmStaff == null){ |
| | | return AjaxResult.success(); |
| | | } |
| | | CmStaffByCodeRespDTO dto = new CmStaffByCodeRespDTO(); |
| | |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.ruoyi.common.utils.PageUtils.startPage; |
| | | |
| | | /** |
| | | * @author Mr.huang |
| | | * @decription |
| | |
| | | |
| | | @Override |
| | | public List<GetTeacherRespDTO> selectTeacherAll(Integer isCm) { |
| | | startPage(); |
| | | LambdaQueryWrapper<TeacherManage> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TeacherManage::getDelFlag,DeleteStatusEnum.NO.getStatus()) |
| | | .eq(TeacherManage::getIsCm,isCm); |
| | |
| | | dtos.add(dto); |
| | | } |
| | | return dtos; |
| | | } |
| | | |
| | | @Override |
| | | public List<GetTeacherRespDTO> selectTeacherByCondition(int isCm, Long operateTypeId) { |
| | | if (operateTypeId == null || operateTypeId == 0) |
| | | return selectTeacherAll(isCm); |
| | | LambdaQueryWrapper<TeacherManageOperateTypeBind> wrapper = new LambdaQueryWrapper<>(); |
| | | List<TeacherManageOperateTypeBind> teacherManageOperateTypeBinds = |
| | | teacherManageOperateTypeBindService.list(wrapper.eq(TeacherManageOperateTypeBind::getOperateTypeId, operateTypeId) |
| | | .eq(TeacherManageOperateTypeBind::getDelFlag,DeleteStatusEnum.NO.getStatus())); |
| | | if (CollectionUtils.isEmpty(teacherManageOperateTypeBinds)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | List<Long> teacherManageIds = teacherManageOperateTypeBinds.stream() |
| | | .map(TeacherManageOperateTypeBind::getTeacherManageId) |
| | | .distinct() |
| | | .collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(teacherManageIds)) |
| | | return new ArrayList<>(); |
| | | startPage(); |
| | | LambdaQueryWrapper<TeacherManage> teacherManageWrapper = new LambdaQueryWrapper<>(); |
| | | teacherManageWrapper.eq(TeacherManage::getDelFlag,DeleteStatusEnum.NO.getStatus()) |
| | | .eq(TeacherManage::getIsCm,isCm) |
| | | .in(TeacherManage::getId,teacherManageIds); |
| | | List<TeacherManage> list = teacherManageService.list(teacherManageWrapper); |
| | | if (CollectionUtils.isEmpty(list)) |
| | | return new ArrayList<>(); |
| | | List<GetTeacherRespDTO> dtos = new ArrayList<>(); |
| | | for (TeacherManage manage : list) { |
| | | GetTeacherRespDTO dto = getTeacherRespDTO(manage); |
| | | dtos.add(dto); |
| | | } |
| | | return dtos; |
| | | } |
| | | |
| | | @Override |
对比新文件 |
| | |
| | | package com.gkhy.exam.noncoalmine.controller; |
| | | |
| | | import com.gkhy.exam.noncoalmine.entity.IdentificationRecord; |
| | | import com.gkhy.exam.noncoalmine.model.addForm.IdentificationRecordAddForm; |
| | | import com.gkhy.exam.noncoalmine.model.query.IdentificationRecordQuery; |
| | | import com.gkhy.exam.noncoalmine.model.query.NcCertQuery; |
| | | import com.gkhy.exam.noncoalmine.service.IdentificationRecordService; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import static com.ruoyi.common.utils.PageUtils.startPage; |
| | | |
| | | /** |
| | | * @email 1603559716@qq.com |
| | | * @author: zf |
| | | * @date: 2023/10/13 |
| | | * @time: 13:51 |
| | | */ |
| | | @Api(tags = "证书接口") |
| | | @RequestMapping("/identity/record") |
| | | @RestController |
| | | public class IdentificationRecordController extends BaseController { |
| | | @Autowired |
| | | private IdentificationRecordService recordService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param query 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @GetMapping("page/list") |
| | | @ApiOperation(value = "分页查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "pageNum", dataTypeClass = String.class,value = "页码",required = true), |
| | | @ApiImplicitParam(name = "pageSize", dataTypeClass = String.class,value = "页数",required = true), |
| | | }) |
| | | public TableDataInfo listByPage(IdentificationRecordQuery query) { |
| | | startPage(); |
| | | return getDataTable(this.recordService.getList(query)); |
| | | } |
| | | /** |
| | | * 新增 |
| | | * |
| | | * @param addForm 实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @PostMapping("add") |
| | | @ApiOperation(value = "新增") |
| | | public AjaxResult add(IdentificationRecordAddForm addForm) { |
| | | return toAjax(this.recordService.add(addForm)); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.exam.noncoalmine.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * @email 1603559716@qq.com |
| | | * @author: zf |
| | | * @date: 2023/10/13 |
| | | * @time: 13:53 |
| | | */ |
| | | @Data |
| | | public class IdentificationRecord { |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | //是否是煤矿(0非,1是) |
| | | private Byte isCm; |
| | | //姓名 |
| | | private String name; |
| | | //性别 0男,1女 |
| | | private String sex; |
| | | //身份证 |
| | | private String idCard; |
| | | //民族 |
| | | private String nationCode; |
| | | //考试中心名称 |
| | | private String centerName; |
| | | //考试点名称 |
| | | private String roomName; |
| | | //考试科目 |
| | | private String subject; |
| | | //删除标识(0未删除,2删除) |
| | | private Byte delFlag; |
| | | //推送时间 |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime compareTime; |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.exam.noncoalmine.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.gkhy.exam.noncoalmine.entity.IdentificationRecord; |
| | | import com.gkhy.exam.noncoalmine.model.query.IdentificationRecordQuery; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @email 1603559716@qq.com |
| | | * @author: zf |
| | | * @date: 2023/10/13 |
| | | * @time: 14:05 |
| | | */ |
| | | @Repository |
| | | @Mapper |
| | | public interface IdentificationRecordMapper extends BaseMapper<IdentificationRecord> { |
| | | List<IdentificationRecord> getList(IdentificationRecordQuery query); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.exam.noncoalmine.model.addForm; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @email 1603559716@qq.com |
| | | * @author: zf |
| | | * @date: 2023/10/13 |
| | | * @time: 13:53 |
| | | */ |
| | | @ApiModel("识别记录模块") |
| | | @Data |
| | | public class IdentificationRecordAddForm { |
| | | @ApiModelProperty(value = "是否是煤矿(0非,1是)") |
| | | private Byte isCm; |
| | | @ApiModelProperty(value = "姓名") |
| | | @NotEmpty(message = "姓名不能为空") |
| | | private String name; |
| | | @ApiModelProperty(value = "性别") |
| | | private String sex; |
| | | @ApiModelProperty(value = "身份证") |
| | | @NotEmpty(message = "身份证不能为空") |
| | | private String idCard; |
| | | @ApiModelProperty(value = "民族") |
| | | private String nationCode; |
| | | @ApiModelProperty(value = "考试中心名称") |
| | | private String centerName; |
| | | @ApiModelProperty(value = "考试点名称") |
| | | private String roomName; |
| | | @ApiModelProperty(value = "考试科目") |
| | | private String subject; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "IC卡编号") |
| | | private String icNum; |
| | | //作业时间 |
| | | @ApiModelProperty(value = "作业时间",required = true) |
| | | @NotNull(message = "请填写做业时间") |
| | | @ApiModelProperty(value = "违章时间",required = true) |
| | | @NotNull(message = "请填写违章时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date violationTime; |
| | | //违章附件 |
对比新文件 |
| | |
| | | package com.gkhy.exam.noncoalmine.model.query; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | @ApiModel(value = "识别记录查询实体") |
| | | @Data |
| | | public class IdentificationRecordQuery { |
| | | @ApiModelProperty(value = "姓名") |
| | | private String name; |
| | | @ApiModelProperty(value = "是否是煤矿 1是,0非") |
| | | private Byte isCm; |
| | | /** 身份证件号 */ |
| | | @ApiModelProperty(value = "身份证件号") |
| | | private String idcard; |
| | | @ApiModelProperty(value = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private String startTime; |
| | | @ApiModelProperty(value = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private String endTime; |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.exam.noncoalmine.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.gkhy.exam.noncoalmine.controller.IdentificationRecordController; |
| | | import com.gkhy.exam.noncoalmine.entity.IdentificationRecord; |
| | | import com.gkhy.exam.noncoalmine.model.addForm.IdentificationRecordAddForm; |
| | | import com.gkhy.exam.noncoalmine.model.query.IdentificationRecordQuery; |
| | | import com.gkhy.exam.noncoalmine.model.query.NcCertQuery; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @email 1603559716@qq.com |
| | | * @author: zf |
| | | * @date: 2023/10/13 |
| | | * @time: 13:53 |
| | | */ |
| | | public interface IdentificationRecordService extends IService<IdentificationRecord> { |
| | | int add(IdentificationRecordAddForm addForm); |
| | | |
| | | List<IdentificationRecord> getList(IdentificationRecordQuery query); |
| | | } |
对比新文件 |
| | |
| | | package com.gkhy.exam.noncoalmine.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.exam.noncoalmine.entity.IdentificationRecord; |
| | | import com.gkhy.exam.noncoalmine.mapper.IdentificationRecordMapper; |
| | | import com.gkhy.exam.noncoalmine.model.addForm.IdentificationRecordAddForm; |
| | | import com.gkhy.exam.noncoalmine.model.query.IdentificationRecordQuery; |
| | | import com.gkhy.exam.noncoalmine.service.IdentificationRecordService; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @email 1603559716@qq.com |
| | | * @author: zf |
| | | * @date: 2023/10/13 |
| | | * @time: 14:05 |
| | | */ |
| | | @Service |
| | | public class IdentificationRecordServiceImpl extends ServiceImpl<IdentificationRecordMapper, IdentificationRecord> implements IdentificationRecordService { |
| | | @Override |
| | | public int add(IdentificationRecordAddForm addForm) { |
| | | IdentificationRecord record = new IdentificationRecord(); |
| | | BeanUtils.copyProperties(addForm,record); |
| | | record.setCompareTime(LocalDateTime.now()); |
| | | record.setDelFlag((byte)0); |
| | | return baseMapper.insert(record); |
| | | } |
| | | |
| | | @Override |
| | | public List<IdentificationRecord> getList(IdentificationRecordQuery query) { |
| | | List<IdentificationRecord> list = baseMapper.getList(query); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | public List<NcCert> getList(NcCertQuery query) { |
| | | List<NcCert> ncCerts = ncCertMapper.selectList(new LambdaQueryWrapper<NcCert>() |
| | | .eq(NcCert::getDelFlag, (byte) 0) |
| | | .eq(StringUtils.isNotEmpty(query.getName()), NcCert::getName, query.getName()) |
| | | .like(StringUtils.isNotEmpty(query.getName()), NcCert::getName, query.getName()) |
| | | .eq(StringUtils.isNotEmpty(query.getIdcardNum()),NcCert::getIdcardNum,query.getIdcardNum()) |
| | | ); |
| | | return ncCerts; |
| | | } |
对比新文件 |
| | |
| | | <?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.gkhy.exam.noncoalmine.mapper.IdentificationRecordMapper"> |
| | | <select id="getList" resultType="com.gkhy.exam.noncoalmine.entity.IdentificationRecord"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | identification_record |
| | | WHERE |
| | | del_flag = 0 |
| | | <if test="query.name != null and query.name != ''"> |
| | | and name like concat('%', #{query.name}, '%') |
| | | </if> |
| | | <if test="query.idCard != null and query.idCard != ''"> |
| | | and id_card = #{query.idCard} |
| | | </if> |
| | | <if test="query.isCm != null"> |
| | | and is_cm = #{query.isCm} |
| | | </if> |
| | | <if test="query.startTime != null"><!-- 开始时间检索 --> |
| | | and date_format(compare_time,'%y-%m-%d') >= date_format(#{query.startTime},'%y-%m-%d') |
| | | </if> |
| | | <if test="query.endTime != null"><!-- 结束时间检索 --> |
| | | and date_format(compare_time,'%y-%m-%d') <= date_format(#{query.endTime},'%y-%m-%d') |
| | | </if> |
| | | order by compare_time desc |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | and name like concat('%', #{query.name}, '%') |
| | | </if> |
| | | <if test="query.idCardNum != null and query.idCardNum != ''"> |
| | | and name = #{query.idCardNum} |
| | | and id_card_num = #{query.idCardNum} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://192.168.0.52:3306/swspkmas?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: gkhymysql |
| | | url: jdbc:mysql://121.239.169.30:33306/swspkmas?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: gkhynew |
| | | password: 123456 |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | |
| | | file: |
| | | path: |
| | | #基础路径 |
| | | dcPath: E:\file\gkhy\test\ |
| | | dcPath: upload |
| | | urlRootPath: /uploadfile/ |
| | | module: |
| | | #用户模块 |
| | | accountPath: /account/ |
| | | |
对比新文件 |
| | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8085 |
| | | servlet: |
| | | # 应用的访问路径 |
| | | context-path: /api |
| | | tomcat: |
| | | # tomcat的URI编码 |
| | | uri-encoding: UTF-8 |
| | | # 连接数满后的排队数,默认为100 |
| | | accept-count: 1000 |
| | | threads: |
| | | # tomcat最大线程数,默认为200 |
| | | max: 800 |
| | | # Tomcat启动初始化的线程数,默认值10 |
| | | min-spare: 100 |
| | | |
| | | # 数据源配置 |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://192.168.30.118:3306/swspkmas?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: e7be93ef5413e5ed |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | | enabled: false |
| | | url: |
| | | username: |
| | | password: |
| | | # 初始连接数 |
| | | initialSize: 5 |
| | | # 最小连接池数量 |
| | | minIdle: 10 |
| | | # 最大连接池数量 |
| | | maxActive: 20 |
| | | # 配置获取连接等待超时的时间 |
| | | maxWait: 60000 |
| | | # 配置连接超时时间 |
| | | connectTimeout: 30000 |
| | | # 配置网络超时时间 |
| | | socketTimeout: 60000 |
| | | # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # 配置一个连接在池中最小生存的时间,单位是毫秒 |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # 配置一个连接在池中最大生存的时间,单位是毫秒 |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # 配置检测连接是否有效 |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: true |
| | | # 设置白名单,不填则允许所有访问 |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # 控制台管理用户名和密码 |
| | | login-username: ruoyi |
| | | login-password: 123456 |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | # 慢SQL记录 |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
| | | |
| | | # redis 配置 |
| | | redis: |
| | | # 地址 |
| | | host: 127.0.0.1 |
| | | # 端口,默认为6379 |
| | | port: 6379 |
| | | # 数据库索引 |
| | | database: 5 |
| | | # 密码 |
| | | password: gkhy@202306 |
| | | # 连接超时时间 |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # 连接池中的最小空闲连接 |
| | | min-idle: 0 |
| | | # 连接池中的最大空闲连接 |
| | | max-idle: 8 |
| | | # 连接池的最大数据库连接数 |
| | | max-active: 8 |
| | | # #连接池最大阻塞等待时间(使用负值表示没有限制) |
| | | max-wait: -1ms |
| | | tripartite: |
| | | restSever: https://inspurtestcx.saws.org.cn/sjjh |
| | | appKey: hj92qe |
| | | appPwd: dxep6j |
| | | |
| | | #windous测试 |
| | | file: |
| | | path: |
| | | #基础路径 |
| | | dcPath: upload |
| | | urlRootPath: /uploadfile/ |
| | | module: |
| | | #用户模块 |
| | | accountPath: /account/ |
| | | |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="/home/ruoyi/logs" /> |
| | | <property name="log.path" value="logs" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.File; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | * 模块路径 |
| | | */ |
| | | private Map<String,String> module; |
| | | |
| | | |
| | | public String getDcPath(){ |
| | | String systemDir=System.getProperty("user.dir"); |
| | | return systemDir+ File.separator+dcPath+File.separator; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.framework.config; |
| | | |
| | | import java.io.File; |
| | | import java.util.concurrent.TimeUnit; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | @Override |
| | | public void addResourceHandlers(ResourceHandlerRegistry registry) |
| | | { |
| | | String systemDir=System.getProperty("user.dir"); |
| | | /** 本地文件上传路径 */ |
| | | registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**") |
| | | .addResourceLocations("file:" + RuoYiConfig.getProfile() + "/"); |
| | |
| | | .setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic()); |
| | | //文件访问路径 |
| | | registry.addResourceHandler("/uploadfile/**") |
| | | .addResourceLocations("file:" + dcPath); |
| | | .addResourceLocations("file:" + systemDir+ File.separator+dcPath+File.separator); |
| | | } |
| | | |
| | | /** |