报表分享init
parent
2e2b7fe0d0
commit
15dea081b2
@ -0,0 +1,16 @@
|
|||||||
|
/**/
|
||||||
|
package com.anjiplus.template.gaea.business.modules.reportshare.controller.param;
|
||||||
|
|
||||||
|
import com.anji.plus.gaea.curd.params.PageParam;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @desc ReportShare 报表分享查询输入类
|
||||||
|
* @author Raod
|
||||||
|
* @date 2021-08-18 13:37:26.663
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class ReportShareParam extends PageParam implements Serializable{
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.anjiplus.template.gaea.business.modules.reportshare.dao;
|
||||||
|
|
||||||
|
import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper;
|
||||||
|
import com.anjiplus.template.gaea.business.modules.reportshare.dao.entity.ReportShare;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
/**
|
||||||
|
* ReportShare Mapper
|
||||||
|
* @author Raod
|
||||||
|
* @date 2021-08-18 13:37:26.663
|
||||||
|
**/
|
||||||
|
@Mapper
|
||||||
|
public interface ReportShareMapper extends GaeaBaseMapper<ReportShare> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
package com.anjiplus.template.gaea.business.modules.reportshare.service;
|
||||||
|
|
||||||
|
import com.anji.plus.gaea.curd.service.GaeaBaseService;
|
||||||
|
import com.anjiplus.template.gaea.business.modules.reportshare.controller.param.ReportShareParam;
|
||||||
|
import com.anjiplus.template.gaea.business.modules.reportshare.dao.entity.ReportShare;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @desc ReportShare 报表分享服务接口
|
||||||
|
* @author Raod
|
||||||
|
* @date 2021-08-18 13:37:26.663
|
||||||
|
**/
|
||||||
|
public interface ReportShareService extends GaeaBaseService<ReportShareParam, ReportShare> {
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 查询详情
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ReportShare getDetail(Long id);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
|
||||||
|
package com.anjiplus.template.gaea.business.modules.reportshare.service.impl;
|
||||||
|
|
||||||
|
import com.anji.plus.gaea.constant.BaseOperationEnum;
|
||||||
|
import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper;
|
||||||
|
import com.anji.plus.gaea.exception.BusinessException;
|
||||||
|
import com.anjiplus.template.gaea.business.modules.reportshare.dao.ReportShareMapper;
|
||||||
|
import com.anjiplus.template.gaea.business.modules.reportshare.dao.entity.ReportShare;
|
||||||
|
import com.anjiplus.template.gaea.business.modules.reportshare.service.ReportShareService;
|
||||||
|
import com.anjiplus.template.gaea.business.util.DateUtil;
|
||||||
|
import com.anjiplus.template.gaea.business.util.MD5Util;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @desc ReportShare 报表分享服务实现
|
||||||
|
* @author Raod
|
||||||
|
* @date 2021-08-18 13:37:26.663
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
public class ReportShareServiceImpl implements ReportShareService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ReportShareMapper reportShareMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GaeaBaseMapper<ReportShare> getMapper() {
|
||||||
|
return reportShareMapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReportShare getDetail(Long id) {
|
||||||
|
ReportShare reportShare = this.selectOne(id);
|
||||||
|
return reportShare;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processBeforeOperation(ReportShare entity, BaseOperationEnum operationEnum) throws BusinessException {
|
||||||
|
switch (operationEnum) {
|
||||||
|
case INSERT:
|
||||||
|
//前端地址 window.location.href https://report.anji-plus.com/index.html#/report/bigscreen
|
||||||
|
//截取#之前的内容
|
||||||
|
//http://localhost:9528/#/bigscreen/viewer?reportCode=bigScreen2
|
||||||
|
//http://127.0.0.1:9095/reportDashboard/getData
|
||||||
|
String shareCode = UUID.randomUUID().toString();
|
||||||
|
entity.setShareCode(shareCode);
|
||||||
|
if (StringUtils.isNotBlank(entity.getShareUrl())) {
|
||||||
|
String prefix = entity.getShareUrl().substring(0, entity.getShareUrl().indexOf("#"));
|
||||||
|
entity.setShareUrl(prefix + "#/bigscreen/viewer?reportCode=" + entity.getReportCode());
|
||||||
|
}
|
||||||
|
entity.setShareValidTime(DateUtil.getFutureDateTmdHms(entity.getShareValidType()));
|
||||||
|
break;
|
||||||
|
case UPDATE:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.anjiplus.template.gaea.business.modules.reportshare.dao.ReportShareMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.anjiplus.template.gaea.business.modules.reportshare.dao.entity.ReportShare" id="ReportShareMap">
|
||||||
|
<!--jdbcType="{column.columnType}"-->
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="shareCode" column="share_code" />
|
||||||
|
<result property="shareValidType" column="share_valid_type" />
|
||||||
|
<result property="shareValidTime" column="share_valid_time" />
|
||||||
|
<result property="shareUrl" column="share_url" />
|
||||||
|
<result property="reportCode" column="report_code" />
|
||||||
|
<result property="enableFlag" column="enable_flag" />
|
||||||
|
<result property="deleteFlag" column="delete_flag" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
<result property="version" column="version" />
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id,share_code,share_valid_type,share_valid_time,share_url,report_code,enable_flag,delete_flag,create_by,create_time,update_by,update_time,version
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue