Browse Source

jiahan.wu[CR]

1.bi大屏图表对应指标模板配置模块
2.bi大屏通用查询service方法
develop
eric777 10 months ago
parent
commit
7617b25cca
  1. 131
      lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiReportTargetConfigController.java
  2. 56
      lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiReportTargetConfig.java
  3. 63
      lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiReportTargetConfigMapper.java
  4. 92
      lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiReportTargetConfigService.java
  5. 30
      lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewReqVo.java
  6. 29
      lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewResVo.java
  7. 7
      lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDaynewMapper.java
  8. 6
      lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftDaynewService.java
  9. 93
      lzbi-module/src/main/resources/mapper/asset/DcBusiReportTargetConfigMapper.xml
  10. 30
      lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDaynewMapper.xml

131
lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiReportTargetConfigController.java

@ -0,0 +1,131 @@
package com.lzbi.bi.controller;
import com.lzbi.bi.domain.DcBusiReportTargetConfig;
import com.lzbi.bi.service.DcBusiReportTargetConfigService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
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.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.lzbi.common.annotation.Log;
import com.lzbi.common.core.controller.BaseController;
import com.lzbi.common.core.domain.AjaxResult;
import com.lzbi.common.enums.BusinessType;
import com.lzbi.common.utils.poi.ExcelUtil;
import com.lzbi.common.core.page.TableDataInfo;
/**
* 图指标配置Controller
*
* @author win
* @date 2024-01-29
*/
@RestController
@RequestMapping("/lzbi/config")
public class DcBusiReportTargetConfigController extends BaseController
{
@Autowired
private DcBusiReportTargetConfigService dcBusiReportTargetConfigService;
/**
* 查询图指标配置列表
*/
@ApiOperation("查询图指标配置列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiReportTargetConfig", value = "", dataType = "DcBusiReportTargetConfig", dataTypeClass = DcBusiReportTargetConfig.class),
})
@PreAuthorize("@ss.hasPermi('lzbi:config:list')")
@GetMapping("/list")
public TableDataInfo list(DcBusiReportTargetConfig DcBusiReportTargetConfig)
{
startPage();
List< DcBusiReportTargetConfig> list = dcBusiReportTargetConfigService.selectDcBusiReportTargetConfigList(DcBusiReportTargetConfig);
return getDataTable(list);
}
/**
* 导出图指标配置列表
*/
@ApiOperation("导出图指标配置列表")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiReportTargetConfig", value = "", dataType = "DcBusiReportTargetConfig", dataTypeClass = DcBusiReportTargetConfig.class),
})
@PreAuthorize("@ss.hasPermi('lzbi:config:export')")
@Log(title = "图指标配置", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response,DcBusiReportTargetConfig DcBusiReportTargetConfig)
{
List<DcBusiReportTargetConfig> list = dcBusiReportTargetConfigService.selectDcBusiReportTargetConfigList(DcBusiReportTargetConfig);
ExcelUtil<DcBusiReportTargetConfig> util = new ExcelUtil<DcBusiReportTargetConfig>(DcBusiReportTargetConfig.class);
util.exportExcel(response, list, "图指标配置数据");
}
/**
* 获取图指标配置详细信息
*/
@ApiOperation("获取图指标配置详细信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "", dataType = "Long", dataTypeClass = Long.class),
})
@PreAuthorize("@ss.hasPermi('lzbi:config:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(dcBusiReportTargetConfigService.selectDcBusiReportTargetConfigById(id));
}
/**
* 新增图指标配置
*/
@ApiOperation("新增图指标配置")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiReportTargetConfig", value = "", dataType = "DcBusiReportTargetConfig", dataTypeClass = DcBusiReportTargetConfig.class),
})
@PreAuthorize("@ss.hasPermi('lzbi:config:add')")
@Log(title = "图指标配置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcBusiReportTargetConfig DcBusiReportTargetConfig)
{
return toAjax(dcBusiReportTargetConfigService.insertDcBusiReportTargetConfig(DcBusiReportTargetConfig));
}
/**
* 修改图指标配置
*/
@ApiOperation("修改图指标配置")
@ApiImplicitParams({
@ApiImplicitParam(name = "DcBusiReportTargetConfig", value = "", dataType = "DcBusiReportTargetConfig", dataTypeClass = DcBusiReportTargetConfig.class),
})
@PreAuthorize("@ss.hasPermi('lzbi:config:edit')")
@Log(title = "图指标配置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcBusiReportTargetConfig DcBusiReportTargetConfig)
{
return toAjax(dcBusiReportTargetConfigService.updateDcBusiReportTargetConfig(DcBusiReportTargetConfig));
}
/**
* 删除图指标配置
*/
@ApiOperation("删除图指标配置")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "", dataType = "Long", dataTypeClass =Long.class),
})
@PreAuthorize("@ss.hasPermi('lzbi:config:remove')")
@Log(title = "图指标配置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcBusiReportTargetConfigService.deleteDcBusiReportTargetConfigByIds(ids));
}
}

56
lzbi-module/src/main/java/com/lzbi/bi/domain/DcBusiReportTargetConfig.java

@ -0,0 +1,56 @@
package com.lzbi.bi.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import lombok.experimental.Accessors;
import com.lzbi.common.annotation.Excel;
import com.lzbi.module.base.BaseModuleEntity;
/**
* 图指标配置对象 dc_busi_report_target_config
*
* @author win
* @date 2024-01-29
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class DcBusiReportTargetConfig extends BaseModuleEntity
{
private static final long serialVersionUID = 1L;
/** 创建人 */
private String createdBy;
/** 创建时间 */
private Date createdTime;
/** 更新人 */
private String updatedBy;
/** 更新时间 */
private Date updatedTime;
/** ID */
private Long id;
/** 图表名称 */
@Excel(name = "图表名称")
@ApiModelProperty(name = "图表名称",notes = "reportName")
private String reportName;
/** 指标模型编码 */
@Excel(name = "指标模型编码")
@ApiModelProperty(name = "指标模型编码",notes = "targetModelCode")
private String targetModelCode;
}

63
lzbi-module/src/main/java/com/lzbi/bi/mapper/DcBusiReportTargetConfigMapper.java

@ -0,0 +1,63 @@
package com.lzbi.bi.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.bi.domain.DcBusiReportTargetConfig;
/**
* 图指标配置Mapper接口
*
* @author win
* @date 2024-01-29
*/
public interface DcBusiReportTargetConfigMapper extends BaseMapper<DcBusiReportTargetConfig>
{
/**
* 查询图指标配置
*
* @param id 图指标配置主键
* @return 图指标配置
*/
public DcBusiReportTargetConfig selectDcBusiReportTargetConfigById(Long id);
/**
* 查询图指标配置列表
*
* @param dcBusiReportTargetConfig 图指标配置
* @return 图指标配置集合
*/
public List<DcBusiReportTargetConfig> selectDcBusiReportTargetConfigList(DcBusiReportTargetConfig dcBusiReportTargetConfig);
/**
* 新增图指标配置
*
* @param dcBusiReportTargetConfig 图指标配置
* @return 结果
*/
public int insertDcBusiReportTargetConfig(DcBusiReportTargetConfig dcBusiReportTargetConfig);
/**
* 修改图指标配置
*
* @param dcBusiReportTargetConfig 图指标配置
* @return 结果
*/
public int updateDcBusiReportTargetConfig(DcBusiReportTargetConfig dcBusiReportTargetConfig);
/**
* 删除图指标配置
*
* @param id 图指标配置主键
* @return 结果
*/
public int deleteDcBusiReportTargetConfigById(Long id);
/**
* 批量删除图指标配置
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteDcBusiReportTargetConfigByIds(Long[] ids);
}

92
lzbi-module/src/main/java/com/lzbi/bi/service/DcBusiReportTargetConfigService.java

@ -0,0 +1,92 @@
package com.lzbi.bi.service;
import java.util.List;
import com.lzbi.bi.domain.DcBusiReportTargetConfig;
import com.lzbi.bi.mapper.DcBusiReportTargetConfigMapper;
import com.lzbi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 图指标配置Service业务层处理
*
* @author win
* @date 2024-01-29
*/
@Service
public class DcBusiReportTargetConfigService extends ServiceImpl<DcBusiReportTargetConfigMapper, DcBusiReportTargetConfig> implements IService<DcBusiReportTargetConfig>
{
/**
* 查询图指标配置
*
* @param id 图指标配置主键
* @return 图指标配置
*/
public DcBusiReportTargetConfig selectDcBusiReportTargetConfigById(Long id)
{
return baseMapper.selectDcBusiReportTargetConfigById(id);
}
/**
* 查询图指标配置列表
*
* @param dcBusiReportTargetConfig 图指标配置
* @return 图指标配置
*/
public List<DcBusiReportTargetConfig> selectDcBusiReportTargetConfigList(DcBusiReportTargetConfig dcBusiReportTargetConfig)
{
return baseMapper.selectDcBusiReportTargetConfigList(dcBusiReportTargetConfig);
}
/**
* 新增图指标配置
*
* @param dcBusiReportTargetConfig 图指标配置
* @return 结果
*/
public int insertDcBusiReportTargetConfig(DcBusiReportTargetConfig dcBusiReportTargetConfig)
{
dcBusiReportTargetConfig.setCreatedTime(DateUtils.getNowDate());
return baseMapper.insertDcBusiReportTargetConfig(dcBusiReportTargetConfig);
}
/**
* 修改图指标配置
*
* @param dcBusiReportTargetConfig 图指标配置
* @return 结果
*/
public int updateDcBusiReportTargetConfig(DcBusiReportTargetConfig dcBusiReportTargetConfig)
{
dcBusiReportTargetConfig.setUpdatedTime(DateUtils.getNowDate());
return baseMapper.updateDcBusiReportTargetConfig(dcBusiReportTargetConfig);
}
/**
* 批量删除图指标配置
*
* @param ids 需要删除的图指标配置主键
* @return 结果
*/
public int deleteDcBusiReportTargetConfigByIds(Long[] ids)
{
return baseMapper.deleteDcBusiReportTargetConfigByIds(ids);
}
/**
* 删除图指标配置信息
*
* @param id 图指标配置主键
* @return 结果
*/
public int deleteDcBusiReportTargetConfigById(Long id)
{
return baseMapper.deleteDcBusiReportTargetConfigById(id);
}
}

30
lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewReqVo.java

@ -0,0 +1,30 @@
package com.lzbi.draft.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TargetDraftDaynewReqVo {
private List<String> reportNames;
private String dateYear;
private String dateMonth;
private String dateDay;
private Long orgId;
private String assetLevel;
private String assetType;
}

29
lzbi-module/src/main/java/com/lzbi/draft/domain/vo/TargetDraftDaynewResVo.java

@ -0,0 +1,29 @@
package com.lzbi.draft.domain.vo;
import com.lzbi.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.List;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TargetDraftDaynewResVo {
@ApiModelProperty(name = "组织名称",notes = "organizeName")
private String organizeName;
@ApiModelProperty(name = "图表名称",notes = "reportName")
private String reportName;
@ApiModelProperty(name = "指标结果值",notes = "valueResult")
private BigDecimal valueResult;
@Excel(name = "单位")
private String targetUnit;
}

7
lzbi-module/src/main/java/com/lzbi/draft/mapper/DcBusiTargetDraftDaynewMapper.java

@ -1,13 +1,16 @@
package com.lzbi.draft.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lzbi.bill.domain.DcBusiTargetInputMaster;
import com.lzbi.draft.domain.DcBusiTargetDraftDaynew;
import com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo;
import com.lzbi.draft.domain.vo.TargetDraftDaynewResVo;
import com.lzbi.wechat.domain.dto.TargetModelValueDTO;
import com.lzbi.wechat.domain.vo.TargetResultVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 指标数据底稿日-新结构Mapper接口
*
@ -84,4 +87,6 @@ public interface DcBusiTargetDraftDaynewMapper extends BaseMapper<DcBusiTargetDr
* @return 结果
*/
public int deleteDcBusiTargetDraftDaynewByIds(String[] ids);
List<TargetDraftDaynewResVo> selectTargetDraftDaynewList(TargetDraftDaynewReqVo vo);
}

6
lzbi-module/src/main/java/com/lzbi/draft/service/DcBusiTargetDraftDaynewService.java

@ -2,6 +2,8 @@ package com.lzbi.draft.service;
import java.util.List;
import com.lzbi.common.utils.DateUtils;
import com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo;
import com.lzbi.draft.domain.vo.TargetDraftDaynewResVo;
import org.springframework.stereotype.Service;
import com.lzbi.draft.domain.DcBusiTargetDraftDaynew;
import com.lzbi.draft.mapper.DcBusiTargetDraftDaynewMapper;
@ -88,4 +90,8 @@ public class DcBusiTargetDraftDaynewService extends ServiceImpl<DcBusiTargetDraf
{
return baseMapper.deleteDcBusiTargetDraftDaynewById(id);
}
public List<TargetDraftDaynewResVo> selectTargetDraftDaynewList(TargetDraftDaynewReqVo vo){
return baseMapper.selectTargetDraftDaynewList(vo);
}
}

93
lzbi-module/src/main/resources/mapper/asset/DcBusiReportTargetConfigMapper.xml

@ -0,0 +1,93 @@
<?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.lzbi.bi.mapper.DcBusiReportTargetConfigMapper">
<resultMap type="com.lzbi.bi.domain.DcBusiReportTargetConfig" id="DcBusiReportTargetConfigResult">
<result property="tenantId" column="tenant_id" />
<result property="revision" column="revision" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="deleteBy" column="delete_by" />
<result property="deleteTime" column="delete_time" />
<result property="id" column="id" />
<result property="reportName" column="report_name" />
<result property="targetModelCode" column="target_model_code" />
</resultMap>
<sql id="selectDcBusiReportTargetConfigVo">
select tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, id, report_name, target_model_code from dc_busi_report_target_config
</sql>
<select id="selectDcBusiReportTargetConfigList" parameterType="DcBusiReportTargetConfig" resultMap="DcBusiReportTargetConfigResult">
<include refid="selectDcBusiReportTargetConfigVo"/>
<where>
<if test="reportName != null and reportName != ''"> and report_name like concat('%', #{reportName}, '%')</if>
<if test="targetModelCode != null and targetModelCode != ''"> and target_model_code = #{targetModelCode}</if>
</where>
</select>
<select id="selectDcBusiReportTargetConfigById" parameterType="Long" resultMap="DcBusiReportTargetConfigResult">
<include refid="selectDcBusiReportTargetConfigVo"/>
where id = #{id}
</select>
<insert id="insertDcBusiReportTargetConfig" parameterType="DcBusiReportTargetConfig" useGeneratedKeys="true" keyProperty="id">
insert into dc_busi_report_target_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tenantId != null">tenant_id,</if>
<if test="revision != null">revision,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="deleteBy != null">delete_by,</if>
<if test="deleteTime != null">delete_time,</if>
<if test="reportName != null and reportName != ''">report_name,</if>
<if test="targetModelCode != null and targetModelCode != ''">target_model_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tenantId != null">#{tenantId},</if>
<if test="revision != null">#{revision},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="deleteBy != null">#{deleteBy},</if>
<if test="deleteTime != null">#{deleteTime},</if>
<if test="reportName != null and reportName != ''">#{reportName},</if>
<if test="targetModelCode != null and targetModelCode != ''">#{targetModelCode},</if>
</trim>
</insert>
<update id="updateDcBusiReportTargetConfig" parameterType="DcBusiReportTargetConfig">
update dc_busi_report_target_config
<trim prefix="SET" suffixOverrides=",">
<if test="tenantId != null">tenant_id = #{tenantId},</if>
<if test="revision != null">revision = #{revision},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="deleteBy != null">delete_by = #{deleteBy},</if>
<if test="deleteTime != null">delete_time = #{deleteTime},</if>
<if test="reportName != null and reportName != ''">report_name = #{reportName},</if>
<if test="targetModelCode != null and targetModelCode != ''">target_model_code = #{targetModelCode},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcBusiReportTargetConfigById" parameterType="Long">
delete from dc_busi_report_target_config where id = #{id}
</delete>
<delete id="deleteDcBusiReportTargetConfigByIds" parameterType="String">
delete from dc_busi_report_target_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

30
lzbi-module/src/main/resources/mapper/asset/DcBusiTargetDraftDaynewMapper.xml

@ -274,4 +274,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectTargetDraftDaynewList" parameterType="com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo" resultType="com.lzbi.draft.domain.vo.TargetDraftDaynewResVo">
select
d.organize_name ,c.report_name ,d.value_result ,m.target_unit
from
dc_busi_target_draft_daynew d,
dc_busi_report_target_config c,
dc_base_target_model m,
(
select
asset_code
from
dc_base_asset_info
where
org_id = #{orgId}
and asset_level = #{assetLevel}
and asset_type = #{assetType}
limit 1) a
where
d.asset_code = a.asset_code
and d.target_model_code = c.target_model_code
and d.target_model_code =m.target_model_code
and c.report_name in
<foreach item="reportName" collection="reportNames" open="(" separator="," close=")">
#{reportName}
</foreach>
and d.date_year = #{dateYear}
and d.date_month = #{dateMonth}
and d.date_day = #{dateDay}
</select>
</mapper>
Loading…
Cancel
Save