16 changed files with 979 additions and 22 deletions
@ -0,0 +1,62 @@ |
|||
package com.zdxt.enforcementcode.controller.web.supervision; |
|||
|
|||
import java.util.List; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bo.BashboardSituationQueryBo; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendStatQueryBo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationAreaVo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationPerVo; |
|||
import lombok.RequiredArgsConstructor; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.common.core.domain.R; |
|||
import com.zdxt.enforcementcode.service.IDashboardSituationTrendAreaService; |
|||
|
|||
/** |
|||
* 态势趋势分析-区域统计 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-05-28 |
|||
*/ |
|||
@Validated |
|||
@RequiredArgsConstructor |
|||
@RestController |
|||
@RequestMapping("/enforcementcode/situationTrendArea") |
|||
public class DashboardSituationTrendAreaController extends BaseController { |
|||
|
|||
private final IDashboardSituationTrendAreaService dashboardSituationTrendAreaService; |
|||
/** |
|||
* 区域-各区风险态势分布 |
|||
*/ |
|||
@GetMapping("/querySituationTrendAreaList") |
|||
public R<List<DashboardSituationAreaVo>> querySituationTrendAreaList(@Validated DashboardTrendStatQueryBo bo) { |
|||
List<DashboardSituationAreaVo> list = dashboardSituationTrendAreaService.querySituationTrendAreaList(bo); |
|||
return R.ok(list); |
|||
} |
|||
|
|||
/** |
|||
* 区域-风险态势情况占比 |
|||
* |
|||
* @param bo 查询参数 |
|||
* @return 综合评价统计列表 |
|||
*/ |
|||
@GetMapping("/statByComprehensiveEvaluation") |
|||
public R<DashboardSituationPerVo> statByComprehensiveEvaluation(@Validated BashboardSituationQueryBo bo) { |
|||
DashboardSituationPerVo dashboardSituationPerVo = dashboardSituationTrendAreaService.statByComprehensiveEvaluation(bo); |
|||
return R.ok(dashboardSituationPerVo); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 区域-风险态势构成 |
|||
* |
|||
* @param bo 查询参数 |
|||
* @return 态势趋势分析-领域统计信息 |
|||
*/ |
|||
@GetMapping("/getSituationTrendAreaInfo") |
|||
public R<DashboardSituationAreaVo> getSituationTrendAreaInfo(@Validated BashboardSituationQueryBo bo) { |
|||
DashboardSituationAreaVo vo = dashboardSituationTrendAreaService.getSituationTrendAreaInfo(bo); |
|||
return R.ok(vo); |
|||
} |
|||
} |
|||
@ -0,0 +1,96 @@ |
|||
package com.zdxt.enforcementcode.domain.bean; |
|||
|
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.*; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.io.Serial; |
|||
|
|||
/** |
|||
* 态势趋势分析-区域统计对象 dashboard_situation_trend_area |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-05-28 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@TableName("dashboard_situation_trend_area") |
|||
public class DashboardSituationTrendArea extends BaseEntity { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID(UUID) |
|||
*/ |
|||
@TableId(value = "id") |
|||
private String id; |
|||
|
|||
/** |
|||
* 年份(如:2025) |
|||
*/ |
|||
private Long year; |
|||
|
|||
/** |
|||
* 季度 1-4 |
|||
*/ |
|||
private Long quarter; |
|||
|
|||
/** |
|||
* 区编码 |
|||
*/ |
|||
private String districtCode; |
|||
|
|||
/** |
|||
* 区名称 |
|||
*/ |
|||
private String districtName; |
|||
|
|||
/** |
|||
* 综合评级:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String zhpj; |
|||
|
|||
/** |
|||
* 风险信用:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String fxxy; |
|||
|
|||
/** |
|||
* 高频检查:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String gpjc; |
|||
|
|||
/** |
|||
* 异常行为:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String ycxw; |
|||
|
|||
/** |
|||
* 趋势异常:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String qsyc; |
|||
|
|||
/** |
|||
* 局级部门ID |
|||
*/ |
|||
private String bureauDeptId; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 组织单位ID |
|||
*/ |
|||
private String organId; |
|||
|
|||
/** |
|||
* 逻辑删除:0-否 1-是 |
|||
*/ |
|||
private String isDelete; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,97 @@ |
|||
package com.zdxt.enforcementcode.domain.bo; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bean.DashboardSituationTrendArea; |
|||
import org.dromara.common.mybatis.core.domain.BaseEntity; |
|||
import org.dromara.common.core.validate.AddGroup; |
|||
import org.dromara.common.core.validate.EditGroup; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
import jakarta.validation.constraints.*; |
|||
|
|||
/** |
|||
* 态势趋势分析-区域统计业务对象 dashboard_situation_trend_area |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-05-28 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper = true) |
|||
@AutoMapper(target = DashboardSituationTrendArea.class, reverseConvertGenerate = false) |
|||
public class DashboardSituationTrendAreaBo extends BaseEntity { |
|||
|
|||
/** |
|||
* 主键ID(UUID) |
|||
*/ |
|||
@NotBlank(message = "主键ID(UUID)不能为空", groups = { EditGroup.class }) |
|||
private String id; |
|||
|
|||
/** |
|||
* 年份(如:2025) |
|||
*/ |
|||
@NotNull(message = "年份(如:2025)不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long year; |
|||
|
|||
/** |
|||
* 季度 1-4 |
|||
*/ |
|||
@NotNull(message = "季度 1-4不能为空", groups = { AddGroup.class, EditGroup.class }) |
|||
private Long quarter; |
|||
|
|||
/** |
|||
* 区编码 |
|||
*/ |
|||
private String districtCode; |
|||
|
|||
/** |
|||
* 区名称 |
|||
*/ |
|||
private String districtName; |
|||
|
|||
/** |
|||
* 综合评级:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String zhpj; |
|||
|
|||
/** |
|||
* 风险信用:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String fxxy; |
|||
|
|||
/** |
|||
* 高频检查:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String gpjc; |
|||
|
|||
/** |
|||
* 异常行为:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String ycxw; |
|||
|
|||
/** |
|||
* 趋势异常:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String qsyc; |
|||
|
|||
/** |
|||
* 局级部门ID |
|||
*/ |
|||
private String bureauDeptId; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 组织单位ID |
|||
*/ |
|||
private String organId; |
|||
|
|||
/** |
|||
* 逻辑删除:0-否 1-是 |
|||
*/ |
|||
private String isDelete; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,117 @@ |
|||
package com.zdxt.enforcementcode.domain.vo; |
|||
|
|||
import com.zdxt.enforcementcode.common.commonenum.ComprehensiveEvaluationEnum; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 态势趋势分析-区域统计VO |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-05-28 |
|||
*/ |
|||
@Data |
|||
public class DashboardSituationAreaVo implements Serializable { |
|||
|
|||
/** |
|||
* 主键ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 年份 |
|||
*/ |
|||
private Long year; |
|||
|
|||
/** |
|||
* 季度 1-4 |
|||
*/ |
|||
private Long quarter; |
|||
|
|||
/** |
|||
* 区编码 |
|||
*/ |
|||
private String districtCode; |
|||
|
|||
/** |
|||
* 区名称 |
|||
*/ |
|||
private String districtName; |
|||
|
|||
/** |
|||
* 综合评级:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String zhpj; |
|||
|
|||
/** |
|||
* 风险信用:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String fxxy; |
|||
|
|||
/** |
|||
* 高频检查:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String gpjc; |
|||
|
|||
/** |
|||
* 异常行为:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String ycxw; |
|||
|
|||
/** |
|||
* 趋势异常:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
private String qsyc; |
|||
|
|||
/** |
|||
* 局级部门ID |
|||
*/ |
|||
private String bureauDeptId; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 组织单位ID |
|||
*/ |
|||
private String organId; |
|||
|
|||
/** |
|||
* 综合评级描述 |
|||
*/ |
|||
public String getZhpjDescription() { |
|||
return ComprehensiveEvaluationEnum.getDescriptionByCode(zhpj); |
|||
} |
|||
|
|||
/** |
|||
* 风险信用描述 |
|||
*/ |
|||
public String getFxxyDescription() { |
|||
return ComprehensiveEvaluationEnum.getDescriptionByCode(fxxy); |
|||
} |
|||
|
|||
/** |
|||
* 高频检查描述 |
|||
*/ |
|||
public String getGpjcDescription() { |
|||
return ComprehensiveEvaluationEnum.getDescriptionByCode(gpjc); |
|||
} |
|||
|
|||
/** |
|||
* 异常行为描述 |
|||
*/ |
|||
public String getYcxwDescription() { |
|||
return ComprehensiveEvaluationEnum.getDescriptionByCode(ycxw); |
|||
} |
|||
|
|||
/** |
|||
* 趋势异常描述 |
|||
*/ |
|||
public String getQsycDescription() { |
|||
return ComprehensiveEvaluationEnum.getDescriptionByCode(qsyc); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,116 @@ |
|||
package com.zdxt.enforcementcode.domain.vo; |
|||
|
|||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated; |
|||
import cn.idev.excel.annotation.ExcelProperty; |
|||
import com.zdxt.enforcementcode.domain.bean.DashboardSituationTrendArea; |
|||
import org.dromara.common.excel.annotation.ExcelDictFormat; |
|||
import org.dromara.common.excel.convert.ExcelDictConvert; |
|||
import io.github.linpeilie.annotations.AutoMapper; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serial; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
|
|||
/** |
|||
* 态势趋势分析-区域统计视图对象 dashboard_situation_trend_area |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-05-28 |
|||
*/ |
|||
@Data |
|||
@ExcelIgnoreUnannotated |
|||
@AutoMapper(target = DashboardSituationTrendArea.class) |
|||
public class DashboardSituationTrendAreaVo implements Serializable { |
|||
|
|||
@Serial |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键ID(UUID) |
|||
*/ |
|||
@ExcelProperty(value = "主键ID(UUID)") |
|||
private String id; |
|||
|
|||
/** |
|||
* 年份(如:2025) |
|||
*/ |
|||
@ExcelProperty(value = "年份(如:2025)") |
|||
private Long year; |
|||
|
|||
/** |
|||
* 季度 1-4 |
|||
*/ |
|||
@ExcelProperty(value = "季度 1-4") |
|||
private Long quarter; |
|||
|
|||
/** |
|||
* 区编码 |
|||
*/ |
|||
@ExcelProperty(value = "区编码") |
|||
private String districtCode; |
|||
|
|||
/** |
|||
* 区名称 |
|||
*/ |
|||
@ExcelProperty(value = "区名称") |
|||
private String districtName; |
|||
|
|||
/** |
|||
* 综合评级:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
@ExcelProperty(value = "综合评级:A-优秀、B-良好、C-一般") |
|||
private String zhpj; |
|||
|
|||
/** |
|||
* 风险信用:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
@ExcelProperty(value = "风险信用:A-优秀、B-良好、C-一般") |
|||
private String fxxy; |
|||
|
|||
/** |
|||
* 高频检查:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
@ExcelProperty(value = "高频检查:A-优秀、B-良好、C-一般") |
|||
private String gpjc; |
|||
|
|||
/** |
|||
* 异常行为:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
@ExcelProperty(value = "异常行为:A-优秀、B-良好、C-一般") |
|||
private String ycxw; |
|||
|
|||
/** |
|||
* 趋势异常:A-优秀、B-良好、C-一般 |
|||
*/ |
|||
@ExcelProperty(value = "趋势异常:A-优秀、B-良好、C-一般") |
|||
private String qsyc; |
|||
|
|||
/** |
|||
* 局级部门ID |
|||
*/ |
|||
@ExcelProperty(value = "局级部门ID") |
|||
private String bureauDeptId; |
|||
|
|||
/** |
|||
* 部门ID |
|||
*/ |
|||
@ExcelProperty(value = "部门ID") |
|||
private String deptId; |
|||
|
|||
/** |
|||
* 组织单位ID |
|||
*/ |
|||
@ExcelProperty(value = "组织单位ID") |
|||
private String organId; |
|||
|
|||
/** |
|||
* 逻辑删除:0-否 1-是 |
|||
*/ |
|||
@ExcelProperty(value = "逻辑删除:0-否 1-是") |
|||
private String isDelete; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
package com.zdxt.enforcementcode.mapper; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bean.DashboardSituationTrendArea; |
|||
import com.zdxt.enforcementcode.domain.bo.BashboardSituationQueryBo; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendStatQueryBo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationAreaVo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationPerListVo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationTrendAreaVo; |
|||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
|||
|
|||
import java.util.List; |
|||
/** |
|||
* 态势趋势分析-区域统计Mapper接口 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-05-28 |
|||
*/ |
|||
public interface DashboardSituationTrendAreaMapper extends BaseMapperPlus<DashboardSituationTrendArea, DashboardSituationTrendAreaVo> { |
|||
|
|||
/** |
|||
* 查询态势趋势分析-区域统计列表 |
|||
* |
|||
* @param bo 查询参数 |
|||
* @return 态势趋势分析-区域统计列表 |
|||
*/ |
|||
List<DashboardSituationAreaVo> querySituationTrendAreaList(DashboardTrendStatQueryBo bo); |
|||
|
|||
/** |
|||
* 根据年份和季度,按综合评价分组统计个数 |
|||
* |
|||
* @param bo 查询参数 |
|||
* @return 综合评价统计列表 |
|||
*/ |
|||
List<DashboardSituationPerListVo> statByComprehensiveEvaluation(BashboardSituationQueryBo bo); |
|||
|
|||
/** |
|||
* 根据年度、季度、区编码查询态势趋势分析-区域统计信息 |
|||
* |
|||
* @param bo 查询参数 |
|||
* @return 态势趋势分析-区域统计信息 |
|||
*/ |
|||
DashboardSituationAreaVo getSituationTrendAreaInfo(BashboardSituationQueryBo bo); |
|||
} |
|||
@ -0,0 +1,96 @@ |
|||
package com.zdxt.enforcementcode.service; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bo.BashboardSituationQueryBo; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendStatQueryBo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationAreaVo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationPerVo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationTrendAreaVo; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardSituationTrendAreaBo; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
|
|||
import java.util.Collection; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 态势趋势分析-区域统计Service接口 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-05-28 |
|||
*/ |
|||
public interface IDashboardSituationTrendAreaService { |
|||
|
|||
/** |
|||
* 查询态势趋势分析-区域统计 |
|||
* |
|||
* @param id 主键 |
|||
* @return 态势趋势分析-区域统计 |
|||
*/ |
|||
DashboardSituationTrendAreaVo queryById(String id); |
|||
|
|||
/** |
|||
* 分页查询态势趋势分析-区域统计列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 态势趋势分析-区域统计分页列表 |
|||
*/ |
|||
TableDataInfo<DashboardSituationTrendAreaVo> queryPageList(DashboardSituationTrendAreaBo bo, PageQuery pageQuery); |
|||
|
|||
/** |
|||
* 查询符合条件的态势趋势分析-区域统计列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 态势趋势分析-区域统计列表 |
|||
*/ |
|||
List<DashboardSituationTrendAreaVo> queryList(DashboardSituationTrendAreaBo bo); |
|||
|
|||
/** |
|||
* 新增态势趋势分析-区域统计 |
|||
* |
|||
* @param bo 态势趋势分析-区域统计 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
Boolean insertByBo(DashboardSituationTrendAreaBo bo); |
|||
|
|||
/** |
|||
* 修改态势趋势分析-区域统计 |
|||
* |
|||
* @param bo 态势趋势分析-区域统计 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
Boolean updateByBo(DashboardSituationTrendAreaBo bo); |
|||
|
|||
/** |
|||
* 校验并批量删除态势趋势分析-区域统计信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid); |
|||
|
|||
/** |
|||
* 查询态势趋势分析-区域统计列表 |
|||
* |
|||
* @param bo 查询参数 |
|||
* @return 态势趋势分析-区域统计列表 |
|||
*/ |
|||
List<DashboardSituationAreaVo> querySituationTrendAreaList(DashboardTrendStatQueryBo bo); |
|||
|
|||
/** |
|||
* 根据年份和季度,按综合评价分组统计个数 |
|||
* |
|||
* @param bo 查询参数 |
|||
* @return 综合评价统计列表 |
|||
*/ |
|||
DashboardSituationPerVo statByComprehensiveEvaluation(BashboardSituationQueryBo bo); |
|||
|
|||
/** |
|||
* 根据年度、季度、区编码查询态势趋势分析-区域统计信息 |
|||
* |
|||
* @param bo 查询参数 |
|||
* @return 态势趋势分析-区域统计信息 |
|||
*/ |
|||
DashboardSituationAreaVo getSituationTrendAreaInfo(BashboardSituationQueryBo bo); |
|||
} |
|||
@ -0,0 +1,203 @@ |
|||
package com.zdxt.enforcementcode.service.impl; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bean.DashboardSituationTrendArea; |
|||
import com.zdxt.enforcementcode.domain.bo.BashboardSituationQueryBo; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardTrendStatQueryBo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationAreaVo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationPerListVo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationPerVo; |
|||
import org.dromara.common.core.utils.MapstructUtils; |
|||
import org.dromara.common.core.utils.StringUtils; |
|||
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|||
import org.dromara.common.mybatis.core.page.PageQuery; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import lombok.RequiredArgsConstructor; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Service; |
|||
import com.zdxt.enforcementcode.domain.bo.DashboardSituationTrendAreaBo; |
|||
import com.zdxt.enforcementcode.domain.vo.DashboardSituationTrendAreaVo; |
|||
import com.zdxt.enforcementcode.mapper.DashboardSituationTrendAreaMapper; |
|||
import com.zdxt.enforcementcode.service.IDashboardSituationTrendAreaService; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import java.util.Collection; |
|||
|
|||
/** |
|||
* 态势趋势分析-区域统计Service业务层处理 |
|||
* |
|||
* @author Lion Li |
|||
* @date 2026-05-28 |
|||
*/ |
|||
@Slf4j |
|||
@RequiredArgsConstructor |
|||
@Service |
|||
public class DashboardSituationTrendAreaServiceImpl implements IDashboardSituationTrendAreaService { |
|||
|
|||
private final DashboardSituationTrendAreaMapper baseMapper; |
|||
|
|||
/** |
|||
* 查询态势趋势分析-区域统计 |
|||
* |
|||
* @param id 主键 |
|||
* @return 态势趋势分析-区域统计 |
|||
*/ |
|||
@Override |
|||
public DashboardSituationTrendAreaVo queryById(String id){ |
|||
return baseMapper.selectVoById(id); |
|||
} |
|||
|
|||
/** |
|||
* 分页查询态势趋势分析-区域统计列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @param pageQuery 分页参数 |
|||
* @return 态势趋势分析-区域统计分页列表 |
|||
*/ |
|||
@Override |
|||
public TableDataInfo<DashboardSituationTrendAreaVo> queryPageList(DashboardSituationTrendAreaBo bo, PageQuery pageQuery) { |
|||
LambdaQueryWrapper<DashboardSituationTrendArea> lqw = buildQueryWrapper(bo); |
|||
Page<DashboardSituationTrendAreaVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|||
return TableDataInfo.build(result); |
|||
} |
|||
|
|||
/** |
|||
* 查询符合条件的态势趋势分析-区域统计列表 |
|||
* |
|||
* @param bo 查询条件 |
|||
* @return 态势趋势分析-区域统计列表 |
|||
*/ |
|||
@Override |
|||
public List<DashboardSituationTrendAreaVo> queryList(DashboardSituationTrendAreaBo bo) { |
|||
LambdaQueryWrapper<DashboardSituationTrendArea> lqw = buildQueryWrapper(bo); |
|||
return baseMapper.selectVoList(lqw); |
|||
} |
|||
|
|||
private LambdaQueryWrapper<DashboardSituationTrendArea> buildQueryWrapper(DashboardSituationTrendAreaBo bo) { |
|||
Map<String, Object> params = bo.getParams(); |
|||
LambdaQueryWrapper<DashboardSituationTrendArea> lqw = Wrappers.lambdaQuery(); |
|||
lqw.orderByAsc(DashboardSituationTrendArea::getId); |
|||
lqw.eq(bo.getYear() != null, DashboardSituationTrendArea::getYear, bo.getYear()); |
|||
lqw.eq(bo.getQuarter() != null, DashboardSituationTrendArea::getQuarter, bo.getQuarter()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getDistrictCode()), DashboardSituationTrendArea::getDistrictCode, bo.getDistrictCode()); |
|||
lqw.like(StringUtils.isNotBlank(bo.getDistrictName()), DashboardSituationTrendArea::getDistrictName, bo.getDistrictName()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getZhpj()), DashboardSituationTrendArea::getZhpj, bo.getZhpj()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getFxxy()), DashboardSituationTrendArea::getFxxy, bo.getFxxy()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getGpjc()), DashboardSituationTrendArea::getGpjc, bo.getGpjc()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getYcxw()), DashboardSituationTrendArea::getYcxw, bo.getYcxw()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getQsyc()), DashboardSituationTrendArea::getQsyc, bo.getQsyc()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getBureauDeptId()), DashboardSituationTrendArea::getBureauDeptId, bo.getBureauDeptId()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getDeptId()), DashboardSituationTrendArea::getDeptId, bo.getDeptId()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getOrganId()), DashboardSituationTrendArea::getOrganId, bo.getOrganId()); |
|||
lqw.eq(StringUtils.isNotBlank(bo.getIsDelete()), DashboardSituationTrendArea::getIsDelete, bo.getIsDelete()); |
|||
return lqw; |
|||
} |
|||
|
|||
/** |
|||
* 新增态势趋势分析-区域统计 |
|||
* |
|||
* @param bo 态势趋势分析-区域统计 |
|||
* @return 是否新增成功 |
|||
*/ |
|||
@Override |
|||
public Boolean insertByBo(DashboardSituationTrendAreaBo bo) { |
|||
DashboardSituationTrendArea add = MapstructUtils.convert(bo, DashboardSituationTrendArea.class); |
|||
validEntityBeforeSave(add); |
|||
boolean flag = baseMapper.insert(add) > 0; |
|||
if (flag) { |
|||
bo.setId(add.getId()); |
|||
} |
|||
return flag; |
|||
} |
|||
|
|||
/** |
|||
* 修改态势趋势分析-区域统计 |
|||
* |
|||
* @param bo 态势趋势分析-区域统计 |
|||
* @return 是否修改成功 |
|||
*/ |
|||
@Override |
|||
public Boolean updateByBo(DashboardSituationTrendAreaBo bo) { |
|||
DashboardSituationTrendArea update = MapstructUtils.convert(bo, DashboardSituationTrendArea.class); |
|||
validEntityBeforeSave(update); |
|||
return baseMapper.updateById(update) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 保存前的数据校验 |
|||
*/ |
|||
private void validEntityBeforeSave(DashboardSituationTrendArea entity){ |
|||
//TODO 做一些数据校验,如唯一约束
|
|||
} |
|||
|
|||
/** |
|||
* 校验并批量删除态势趋势分析-区域统计信息 |
|||
* |
|||
* @param ids 待删除的主键集合 |
|||
* @param isValid 是否进行有效性校验 |
|||
* @return 是否删除成功 |
|||
*/ |
|||
@Override |
|||
public Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid) { |
|||
if(isValid){ |
|||
//TODO 做一些业务上的校验,判断是否需要校验
|
|||
} |
|||
return baseMapper.deleteByIds(ids) > 0; |
|||
} |
|||
|
|||
/** |
|||
* 查询态势趋势分析-区域统计列表 |
|||
* |
|||
* @param bo 查询参数 |
|||
* @return 态势趋势分析-区域统计列表 |
|||
*/ |
|||
@Override |
|||
public List<DashboardSituationAreaVo> querySituationTrendAreaList(DashboardTrendStatQueryBo bo) { |
|||
return baseMapper.querySituationTrendAreaList(bo); |
|||
} |
|||
|
|||
/** |
|||
* 根据年份和季度,按综合评价分组统计个数 |
|||
* |
|||
* @param bo 查询参数 |
|||
* @return 综合评价统计列表 |
|||
*/ |
|||
@Override |
|||
public DashboardSituationPerVo statByComprehensiveEvaluation(BashboardSituationQueryBo bo) { |
|||
DashboardSituationPerVo dashboardSituationPerVo = new DashboardSituationPerVo(); |
|||
List<DashboardSituationPerListVo> list = baseMapper.statByComprehensiveEvaluation(bo); |
|||
|
|||
// 计算总数
|
|||
int total = list.stream() |
|||
.mapToInt(item -> item.getCount() != null ? item.getCount().intValue() : 0) |
|||
.sum(); |
|||
|
|||
// 计算每个级别的比例
|
|||
if (total > 0) { |
|||
list.forEach(item -> { |
|||
long count = item.getCount() != null ? item.getCount() : 0; |
|||
double per = (double) count / total * 100; |
|||
// 保留两位小数
|
|||
item.setPer(Math.round(per * 100.0) / 100.0); |
|||
}); |
|||
} |
|||
|
|||
dashboardSituationPerVo.setTotal(total); |
|||
dashboardSituationPerVo.setList(list); |
|||
|
|||
return dashboardSituationPerVo; |
|||
} |
|||
|
|||
/** |
|||
* 根据年度、季度、区编码查询态势趋势分析-区域统计信息 |
|||
* |
|||
* @param bo 查询参数 |
|||
* @return 态势趋势分析-区域统计信息 |
|||
*/ |
|||
@Override |
|||
public DashboardSituationAreaVo getSituationTrendAreaInfo(BashboardSituationQueryBo bo) { |
|||
return baseMapper.getSituationTrendAreaInfo(bo); |
|||
} |
|||
} |
|||
@ -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.zdxt.enforcementcode.mapper.DashboardSituationTrendAreaMapper"> |
|||
|
|||
<!-- 查询态势趋势分析-区域统计列表 --> |
|||
<select id="querySituationTrendAreaList" resultType="com.zdxt.enforcementcode.domain.vo.DashboardSituationAreaVo"> |
|||
SELECT |
|||
a.id, |
|||
a.year, |
|||
a.quarter, |
|||
a.district_code AS districtCode, |
|||
a.district_name AS districtName, |
|||
a.zhpj, |
|||
a.fxxy, |
|||
a.gpjc, |
|||
a.ycxw, |
|||
a.qsyc, |
|||
a.bureau_dept_id AS bureauDeptId, |
|||
a.dept_id AS deptId, |
|||
a.organ_id AS organId |
|||
FROM dashboard_situation_trend_area a |
|||
WHERE a.is_delete = '0' |
|||
|
|||
<if test="startYear != null and startQuarter != null and endYear != null and endQuarter != null"> |
|||
AND ( |
|||
(a.year = #{startYear} AND a.quarter >= #{startQuarter}) |
|||
OR (a.year > #{startYear} AND a.year < #{endYear}) |
|||
OR (a.year = #{endYear} AND a.quarter <= #{endQuarter}) |
|||
) |
|||
</if> |
|||
|
|||
<if test="districtCode != null and districtCode != ''"> |
|||
AND a.district_code = #{districtCode} |
|||
</if> |
|||
|
|||
<if test="districtName != null and districtName != ''"> |
|||
AND a.district_name LIKE CONCAT('%', #{districtName}, '%') |
|||
</if> |
|||
|
|||
ORDER BY |
|||
a.district_name, |
|||
a.year, |
|||
a.quarter |
|||
|
|||
</select> |
|||
|
|||
<!-- 根据年份和季度,按综合评价分组统计个数 --> |
|||
<select id="statByComprehensiveEvaluation" resultType="com.zdxt.enforcementcode.domain.vo.DashboardSituationPerListVo"> |
|||
SELECT |
|||
a.zhpj AS level, |
|||
COUNT(*) AS count |
|||
FROM dashboard_situation_trend_area a |
|||
WHERE a.is_delete = '0' |
|||
<if test="year != null"> |
|||
AND a.year = #{year} |
|||
</if> |
|||
<if test="quarter != null"> |
|||
AND a.quarter = #{quarter} |
|||
</if> |
|||
GROUP BY a.zhpj |
|||
ORDER BY a.zhpj |
|||
</select> |
|||
|
|||
<!-- 根据年度、季度、区编码查询态势趋势分析-区域统计信息 --> |
|||
<select id="getSituationTrendAreaInfo" resultType="com.zdxt.enforcementcode.domain.vo.DashboardSituationAreaVo"> |
|||
SELECT |
|||
a.id, |
|||
a.year, |
|||
a.quarter, |
|||
a.district_code AS districtCode, |
|||
a.district_name AS districtName, |
|||
a.zhpj, |
|||
a.fxxy, |
|||
a.gpjc, |
|||
a.ycxw, |
|||
a.qsyc, |
|||
a.bureau_dept_id AS bureauDeptId, |
|||
a.dept_id AS deptId, |
|||
a.organ_id AS organId |
|||
FROM dashboard_situation_trend_area a |
|||
WHERE a.is_delete = '0' |
|||
<if test="year != null"> |
|||
AND a.year = #{year} |
|||
</if> |
|||
<if test="quarter != null"> |
|||
AND a.quarter = #{quarter} |
|||
</if> |
|||
LIMIT 1 |
|||
</select> |
|||
|
|||
</mapper> |
|||
Loading…
Reference in new issue