提交 e96a6b99 authored 作者: 吕本才's avatar 吕本才 提交者: Coding

Accept Merge Request #97: (qa -> main)

Merge Request: 增加oracle驱动 Created By: @吕本才 Accepted By: @吕本才 URL: https://g-pkkp8204.coding.net/p/wangxiaolu-sfa/d/wangxiaolu-link-report/git/merge/97?initial=true
...@@ -11,4 +11,4 @@ RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shangh ...@@ -11,4 +11,4 @@ RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shangh
ENTRYPOINT ["nohup","java", "-jar", "/link/app.jar"] ENTRYPOINT ["nohup","java", "-jar", "/link/app.jar"]
CMD ["--spring.profiles.active=${ACTIVE}"] CMD ["--spring.profiles.active=${ACTIVE}"]
EXPOSE 9205 EXPOSE 9206
...@@ -81,6 +81,11 @@ ...@@ -81,6 +81,11 @@
<artifactId>mysql-connector-j</artifactId> <artifactId>mysql-connector-j</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
</dependency>
<!-- RuoYi Common Swagger --> <!-- RuoYi Common Swagger -->
<dependency> <dependency>
<groupId>com.wangxiaolu.sfa</groupId> <groupId>com.wangxiaolu.sfa</groupId>
......
...@@ -2,6 +2,7 @@ package com.link.report; ...@@ -2,6 +2,7 @@ package com.link.report;
import com.sfa.common.security.annotation.EnableCustomConfig; import com.sfa.common.security.annotation.EnableCustomConfig;
import com.sfa.common.security.annotation.EnableRyFeignClients; import com.sfa.common.security.annotation.EnableRyFeignClients;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
...@@ -13,15 +14,15 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -13,15 +14,15 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @motto: Done is better than perfect. * @motto: Done is better than perfect.
*/ */
@EnableCustomConfig @EnableCustomConfig
//@EnableCustomSwagger2 @Slf4j
@EnableRyFeignClients @EnableRyFeignClients
@MapperScan("org.jeecg.modules.jmreport.dao") @MapperScan(value = {"org.jeecg.modules.jmreport.dao","com.link.report.domain.mapper"})
@SpringBootApplication(scanBasePackages = {"org.jeecg.modules.jmreport", "com.link.report"}) @SpringBootApplication(scanBasePackages = {"org.jeecg.modules.jmreport", "com.link.report"})
public class WangxiaoluLinkModuleReportApplication { public class WangxiaoluLinkModuleReportApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(WangxiaoluLinkModuleReportApplication.class, args); SpringApplication.run(WangxiaoluLinkModuleReportApplication.class, args);
System.out.println( log.info(
" .------------------------------------. \n" + " .------------------------------------. \n" +
" : __ :\n" + " : __ :\n" +
" : =='_)) __-:!:- :\n" + " : =='_)) __-:!:- :\n" +
......
package com.link.report.config;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.sfa.common.security.service.TokenService;
import com.sfa.system.api.model.LoginUser;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.jmreport.api.JmReportTokenServiceI;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @ClassName: JimuInterceptor
* @Description: 监听/jmreport/view/*接口,必须携带token
* @author fzz
*
*/
@Component
@AllArgsConstructor
@Slf4j
public class JmDataScopeInterceptor implements HandlerInterceptor {
private final TokenService tokenService;
private final JmReportTokenServiceI jmReportTokenServiceI;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object arg2) throws Exception {
response.setContentType("text/html; charset=UTF-8");
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
String token = request.getParameter("token");
String jmToken = request.getHeader("token");
if(ObjectUtil.isEmpty(token) && ObjectUtil.isNotEmpty(jmToken)){
token = jmToken;
}
LoginUser loginUser = tokenService.getLoginUser(token);
if (loginUser != null ) {
// 数据权限
String[] roles = jmReportTokenServiceI.getRoles(jmToken);
if (roles.length > 0) {
log.info(roles[0]);
}
return true;
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", 200);
jsonObject.put("msg", "参数错误或无权访问数据");
response.getWriter().println(jsonObject);
return false;
}
}
package com.link.report.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.annotation.Resource;
@Configuration
public class JmWebConfigurer implements WebMvcConfigurer {
@Resource
private JmDataScopeInterceptor dataScopeInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
// List<String> patterns = new ArrayList<>();
// 拦截报表查看页面
// patterns.add("/jmreport/shareView/**");
// patterns.add("/share/list");
//
// registry.addInterceptor(dataScopeInterceptor)
// .addPathPatterns(patterns) // 需要拦截的请求
// .excludePathPatterns(); // 不需要拦截的请求
}
}
package com.link.report.controller.query;
import com.link.report.pojo.request.ReportShareListVo;
import com.link.report.pojo.response.ReportShareBiListDto;
import com.link.report.service.ReportShareService;
import com.sfa.common.core.domain.R;
import com.sfa.common.core.web.controller.BaseController;
import com.sfa.common.datascope.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 财务分析-直播间分类基础数据
*
* @author admin
* @date 2024-12-19
*/
@RestController
@RequestMapping("/share")
public class ReportShareQueryController extends BaseController {
@Autowired
private ReportShareService reportShareService;
/**
* 直播间分类的页面查询
* @param reportShareListVo
* @return
*/
// @RequiresPermissions("report:jimu:list")
@DataScope(deptAlias = "d", userAlias = "u")
@GetMapping("/list")
public R<List<ReportShareBiListDto>> selectList(ReportShareListVo reportShareListVo) {
List<ReportShareBiListDto> reportShareBiListDtos = reportShareService.selectList(reportShareListVo);
return R.ok(reportShareBiListDtos);
}
}
package com.link.report.domain.dao;
import com.link.report.domain.wq.ReportShareListWq;
import com.link.report.pojo.response.ReportShareBiListDto;
import java.util.List;
public interface ReportShareDao {
List<ReportShareBiListDto> selectList(ReportShareListWq reportShareListWq);
}
package com.link.report.domain.dao.impl;
import com.link.report.domain.dao.ReportShareDao;
import com.link.report.domain.mapper.ReportShareBiMapper;
import com.link.report.domain.wq.ReportShareListWq;
import com.link.report.pojo.response.ReportShareBiListDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 报表分享数据
*/
@Component
public class ReportShareDaoImpl implements ReportShareDao {
@Autowired
private ReportShareBiMapper reportShareMapper;
@Override
public List<ReportShareBiListDto> selectList(ReportShareListWq reportShareListWq) {
// 查询数据
List<ReportShareBiListDto> jimuReportShares = reportShareMapper.selectShareList(reportShareListWq);
// List<ReportShareBiListDto> dtos = BeanUtils.transitionDtos(jimuReportShares, ReportShareBiListDto.class);
return jimuReportShares;
}
}
package com.link.report.domain.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
* 报表分享
*/
@TableName(value ="jimu_report_share")
@Data
public class JimuReportShareBi {
private String id;
private String reportId;
private String previewUrl;
private String previewLock;
private Date lastUpdateTime;
private String termOfValidity;
private String status;
private String previewLockStatus;
private String shareToken;
// @TableField(exist = false)
// private String name;
}
package com.link.report.domain.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.link.report.domain.entity.JimuReportShareBi;
import com.link.report.domain.wq.ReportShareListWq;
import com.link.report.pojo.response.ReportShareBiListDto;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Mapper
@Repository
public interface ReportShareBiMapper extends BaseMapper<JimuReportShareBi> {
List<ReportShareBiListDto> selectShareList(ReportShareListWq reportShareListWq);
}
package com.link.report.domain.wq;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.util.Map;
/**
* @author : lvbencai
* @date : 2025年02月14日15:24:06
*
*/
@Data
public class ReportShareListWq {
private String reportId;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private Map<String, Object> params;
}
package com.link.report.pojo.request;
import com.sfa.common.core.web.domain.BaseEntity;
/**
* @author : lvbencai
* @date : 2025年02月14日15:17:07
* @describe :
*/
public class ReportShareListVo extends BaseEntity {
}
package com.link.report.pojo.response;
import lombok.Data;
import java.util.Date;
/**
* @author : lvbencai
* @date : 2025年02月14日15:17:07
* @describe :
*/
@Data
public class ReportShareBiListDto {
private String id;
private String reportId;
private String previewUrl;
private String previewLock;
private Date lastUpdateTime;
private String termOfValidity;
private String status;
private String previewLockStatus;
private String shareToken;
private String name;
}
package com.link.report.service;
import com.link.report.pojo.request.ReportShareListVo;
import com.link.report.pojo.response.ReportShareBiListDto;
import java.util.List;
public interface ReportShareService {
List<ReportShareBiListDto> selectList(ReportShareListVo reportShareListVo);
}
package com.link.report.service.impl;
import com.link.report.domain.dao.ReportShareDao;
import com.link.report.domain.wq.ReportShareListWq;
import com.link.report.pojo.request.ReportShareListVo;
import com.link.report.pojo.response.ReportShareBiListDto;
import com.link.report.service.ReportShareService;
import com.sfa.common.core.utils.bean.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 报表分享数据
*/
@Service
public class ReportShareServiceImpl implements ReportShareService {
@Autowired
private ReportShareDao reportShareDao;
@Override
public List<ReportShareBiListDto> selectList(ReportShareListVo reportShareListVo) {
ReportShareListWq wq = new ReportShareListWq();
BeanUtils.copyProperties(reportShareListVo, wq);
return reportShareDao.selectList(wq);
}
}
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.link.report.domain.mapper.ReportShareBiMapper">
<!-- 定义 ResultMap,将数据库表字段映射到 Java 对象属性 -->
<resultMap id="ReportShareResultMap" type="com.link.report.domain.entity.JimuReportShareBi">
<id property="id" column="id"/>
<result property="reportId" column="report_id"/>
<result property="previewUrl" column="preview_url"/>
<result property="previewLock" column="preview_lock"/>
<result property="lastUpdateTime" column="last_update_time"/>
<result property="termOfValidity" column="term_of_validity"/>
<result property="status" column="status"/>
<result property="previewLockStatus" column="preview_lock_status"/>
<result property="shareToken" column="share_token"/>
</resultMap>
<select id="selectShareList" resultType="com.link.report.pojo.response.ReportShareBiListDto">
select jrs.id,jrs.report_id as reportId ,
jrs.preview_url as previewUrl,
jrs.preview_lock as previewLock,
jrs.last_update_time as lastUpdateTime,
jrs.term_of_validity as termOfValidity,
jrs.status as status,
jrs.preview_lock_status as previewLockStatus,
jrs.share_token as shareToken,
jr.name from jimu_report_share jrs
inner join jimu_report jr on jr.id = jrs.report_id and jr.del_flag =0
<where>
<if test="reportId != null and reportId != ''">
and report_id = #{reportId}
</if>
</where>
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论