计划管理模块修改

zhangtao
dongdingding 1 year ago
parent 8fb1f4d573
commit eb2d0adce7

@ -7,8 +7,11 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.programManagement.entity.BKeyEnterprise;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.entity.request.*;
import com.ruoyi.programManagement.entity.request.BPlanEnterprisePageRequest;
import com.ruoyi.programManagement.entity.request.PlanMxRequest;
import com.ruoyi.programManagement.entity.request.checkResultRequest;
import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse;
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseResponse;
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse;
import com.ruoyi.programManagement.mapper.BPlanEnterpriseMapper;
import com.ruoyi.programManagement.service.BKeyEnterpriseService;
@ -58,13 +61,14 @@ public class BPlanEnterpriseController extends BaseController {
@Resource
private IBAdministrativeDivisionService bAdministrativeDivisionService;
/**
*
*/
@ApiOperation(value = "查询计划企业列表",response = BPlanEnterprise.class)
@ApiOperation(value = "查询计划企业列表", response = BPlanEnterpriseResponse.class)
@GetMapping("/list")
public AjaxResult list(BPlanEnterprise bPlanEnterprise) {
List<BPlanEnterprise> list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise);
List<BPlanEnterpriseResponse> list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise);
return AjaxResult.success(list);
}
@ -88,14 +92,13 @@ public class BPlanEnterpriseController extends BaseController {
@GetMapping("/exportpage")
public void exportpage(HttpServletResponse response, BPlanEnterprisePageRequest req) {
List<BPlanEnterPriseTreeResponse> list = bPlanEnterpriseService.getShouyeList(req);
ExcelUtil<BPlanEnterPriseTreeResponse> util = new ExcelUtil<BPlanEnterPriseTreeResponse>(BPlanEnterPriseTreeResponse. class);
ExcelUtil<BPlanEnterPriseTreeResponse> util = new ExcelUtil<BPlanEnterPriseTreeResponse>(BPlanEnterPriseTreeResponse.class);
util.exportExcel(response, list, "行政区划数据");
}
/**
*
*
@ -178,7 +181,7 @@ public class BPlanEnterpriseController extends BaseController {
* @return
*/
@GetMapping("/getZhifa")
@ApiOperation(value = "执法结果-企业详情",response = BPlanEnterpriseZhifaResponse.class)
@ApiOperation(value = "执法结果-企业详情", response = BPlanEnterpriseZhifaResponse.class)
public TableDataInfo getZhifa(@Valid checkResultRequest req) {
startPage();
return getDataTable(bPlanEnterpriseService.getZhifa(req));
@ -191,11 +194,6 @@ public class BPlanEnterpriseController extends BaseController {
@PostMapping("/export")
public void export(HttpServletResponse response, checkResultRequest req) {
List<BPlanEnterpriseZhifaResponse> list = bPlanEnterpriseMapper.getZhifa(req);
for (BPlanEnterpriseZhifaResponse a : list) {
String district = a.getDistrict();
String countyList = bAdministrativeService.getBydistinct(district);
a.setDistrict(countyList);
}
ExcelUtil<BPlanEnterpriseZhifaResponse> util = new ExcelUtil<BPlanEnterpriseZhifaResponse>(BPlanEnterpriseZhifaResponse.class);
util.exportExcel(response, list, "导出执法结果");
}
@ -206,14 +204,9 @@ public class BPlanEnterpriseController extends BaseController {
@ApiOperation(value = "导出计划管理")
@PostMapping("/exportplan")
public void exportplan(HttpServletResponse response, BPlanEnterprise bPlanEnterprise) {
List<BPlanEnterprise> list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise);
for (BPlanEnterprise a : list) {
String district = a.getDistrict();
String countyList = bAdministrativeService.getBydistinct(district);
a.setDistrict(countyList);
}
ExcelUtil<BPlanEnterprise> util = new ExcelUtil<BPlanEnterprise>(BPlanEnterprise.class);
util.exportExcel(response, list, "计划管理数据");
List<BPlanEnterpriseResponse> list = bPlanEnterpriseService.selectBPlanEnterpriseList(bPlanEnterprise);
ExcelUtil<BPlanEnterpriseResponse> util = new ExcelUtil<BPlanEnterpriseResponse>(BPlanEnterpriseResponse.class);
util.exportExcel( response,list, "计划管理数据");
}
/**

@ -10,7 +10,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.Date;
@ -55,7 +54,6 @@ public class BPlanEnterprise implements Serializable {
/**
*
*/
@Excel(name = "年份", dateFormat = "yyyy-MM-dd")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd ", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "创建时间")
@ -97,15 +95,6 @@ public class BPlanEnterprise implements Serializable {
@ApiModelProperty(value = "部门权限id")
private Long deptId;
/**
*
*/
@ApiModelProperty(value = "行政区划")
@Excel(name = "行政区划")
private String district;
/**
*
*/
@ -114,20 +103,20 @@ public class BPlanEnterprise implements Serializable {
private String plannedYear;
/**
* 12
*
*/
@ApiModelProperty(value = "是否重点企业1是2否")
private Integer isPoint;
@Excel(name = "计划月份")
@ApiModelProperty(value = "计划月份")
private String[] plannedMonth;
/**
*
*
*/
@TableField(exist = false)
@ApiModelProperty(value = "企业主表名称")
private String entprName;
@ApiModelProperty(value = "行政区划")
@Excel(name = "行政区划")
private String district;
/**
@ -139,15 +128,17 @@ public class BPlanEnterprise implements Serializable {
/**
*
* 12
*/
@ApiModelProperty(value = "执法排序")
private Long lawSort;
@Excel(name = "是否省重点", readConverterExp = "1=是,2=否")
@ApiModelProperty(value = "是否重点企业1是2否")
private Integer isPoint;
/**
*
*/
@Excel(name = "执法地区")
@ApiModelProperty(value = "执法地区")
private String lawAreas;
@ -155,6 +146,7 @@ public class BPlanEnterprise implements Serializable {
/**
*
*/
@Excel(name = "执法级别")
@ApiModelProperty(value = "执法级别")
private String lawLevel;
@ -162,22 +154,35 @@ public class BPlanEnterprise implements Serializable {
/**
*
*/
@Excel(name = "执法层级")
@ApiModelProperty(value = "执法层级")
private String lawHierarchy;
/**
*
* 0稿 1
*/
@ApiModelProperty(value = "计划月份")
private String plannedMonth;
@Excel(name = "状态",readConverterExp = "0=草稿,1=正式")
@ApiModelProperty(value = "0草稿 1正式")
private Integer status;
/**
*
*/
@TableField(exist = false)
@ApiModelProperty(value = "企业主表名称")
private String entprName;
/**
* 0稿 1
*
*/
@ApiModelProperty(value = "0草稿 1正式")
private Integer status ;
@ApiModelProperty(value = "执法排序")
private Long lawSort;
/**
@ -208,7 +213,6 @@ public class BPlanEnterprise implements Serializable {
private Integer RISK_LEVEL;
/**
*
*/
@ -223,7 +227,6 @@ public class BPlanEnterprise implements Serializable {
private String standLevel;
/**
*
*/
@ -231,7 +234,5 @@ public class BPlanEnterprise implements Serializable {
private Date examineEndTime;
}

@ -0,0 +1,238 @@
package com.ruoyi.programManagement.entity.response;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
*
*/
@Data
@ApiModel("计划企业响应类")
public class BPlanEnterpriseResponse {
private static final long serialVersionUID = -98531345456142440L;
/**
*
*/
@ApiModelProperty(value = "编号")
@TableId(type = IdType.AUTO)
private Long id;
/**
* id
*/
@ApiModelProperty(value = "企业id")
private String enterpriseId;
/**
* ID
*/
@ApiModelProperty(value = "创建者ID")
private Long createId;
/**
*
*/
@ApiModelProperty(value = "创建者")
private String createBy;
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd ", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "创建时间")
private Date createTime;
/**
* ID
*/
@ApiModelProperty(value = "更新者ID")
private Long updateId;
/**
*
*/
@ApiModelProperty(value = "更新者")
private String updateBy;
/**
*
*/
@ApiModelProperty(value = "更新时间")
private Date updateTime;
/**
*
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* id
*/
@ApiModelProperty(value = "用户权限id")
private Long userId;
/**
* id
*/
@ApiModelProperty(value = "部门权限id")
private Long deptId;
/**
*
*/
@ApiModelProperty(value = "计划年份")
@Excel(name = "计划年份")
private String plannedYear;
/**
*
*/
@Excel(name = "计划月份")
@ApiModelProperty(value = "计划月份")
private String plannedMonth;
/**
*
*/
@ApiModelProperty(value = "行政区划")
private String district;
/**
*
*/
@Excel(name = "行政区划")
private String districtcounty;
/**
*
*/
@Excel(name = "企业名称")
@ApiModelProperty(value = "企业名称")
private String enterpriseName;
/**
* 12
*/
@Excel(name = "是否省重点", readConverterExp = "1=是,2=否")
@ApiModelProperty(value = "是否重点企业1是2否")
private Integer isPoint;
/**
*
*/
@Excel(name = "执法地区")
@ApiModelProperty(value = "执法地区")
private String lawAreas;
/**
*
*/
@Excel(name = "执法级别")
@ApiModelProperty(value = "执法级别")
private String lawLevel;
/**
*
*/
@Excel(name = "执法层级")
@ApiModelProperty(value = "执法层级")
private String lawHierarchy;
/**
* 0稿 1
*/
@Excel(name = "状态",readConverterExp = "0=草稿,1=正式")
@ApiModelProperty(value = "0草稿 1正式")
private Integer status;
/**
*
*/
@TableField(exist = false)
@ApiModelProperty(value = "企业主表名称")
private String entprName;
/**
*
*/
@ApiModelProperty(value = "执法排序")
private Long lawSort;
/**
* 0 1
*/
@ApiModelProperty(value = "0未检查 1已检查")
private Integer checkStatus;
/**
* id
*/
@ApiModelProperty(value = "检查id")
private Integer checkId;
/**
* 1 2 3
*/
@ApiModelProperty(value = "1当月 2提前 3滞后")
private Integer checkAgeing;
/**
* 1 2 3
*/
@ApiModelProperty(value = "1当月 2提前 3滞后")
private Integer RISK_LEVEL;
/**
*
*/
@ApiModelProperty(value = "安全风险等级")
private String riskLevel;
/**
*
*/
@ApiModelProperty(value = "标准化等级")
private String standLevel;
/**
*
*/
@ApiModelProperty(value = "上次检查时间")
private Date examineEndTime;
}

@ -82,11 +82,5 @@ public interface BAdministrativeMapper {
List<BPlanEnterPriseTreeResponse> selectBPlanEnterPriseTreeRequestRequestList(@Param("req") BPlanEnterprisePageRequest req);
/**
*
*
* @param district
* @return
*/
String getBydistinct(@Param("district") String district);
}

@ -71,7 +71,7 @@ public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterprise> {
* @param bPlanEnterprise
* @return
*/
public List<BPlanEnterprise> selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise);
public List<BPlanEnterpriseResponse> selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise);
/**

@ -3,6 +3,7 @@ package com.ruoyi.programManagement.quartz;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.programManagement.entity.*;
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseResponse;
import com.ruoyi.programManagement.mapper.BEnterpriseNewMapper;
import com.ruoyi.programManagement.mapper.BStandardizationMapper;
import com.ruoyi.programManagement.mapper.SzsEnterpriseInformationMapper;
@ -127,8 +128,8 @@ public class EnterpristQuartz {
@ApiOperation(value = "定时任务修改更新计划表的检查状态、检查id、检查时效字段")
public AjaxResult updateExamine() {
//查询计划表中的所有数据
List<BPlanEnterprise> list = bPlanEnterpriseService.selectBPlanEnterpriseList(null);
for (BPlanEnterprise a:list){
List<BPlanEnterpriseResponse> list = bPlanEnterpriseService.selectBPlanEnterpriseList(null);
for (BPlanEnterpriseResponse a:list){
BEnterpriseNew bEnterpriseNew = new BEnterpriseNew();
List<SzEnforExamine> szEnforExamineList = szEnforExamineService.getByEnterPriseCode(a.getEnterpriseId());
for (SzEnforExamine b:szEnforExamineList) {

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.entity.request.*;
import com.ruoyi.programManagement.entity.response.BPlanEnterPriseTreeResponse;
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseResponse;
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseZhifaResponse;
import com.ruoyi.programManagement.entity.response.zhifaPlanResponse;
@ -26,7 +27,7 @@ public interface BPlanEnterpriseService extends IService<BPlanEnterprise> {
* @param bPlanEnterprise
* @return
*/
public List<BPlanEnterprise> selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise);
public List<BPlanEnterpriseResponse> selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise);
/**
* planId
*

@ -66,11 +66,5 @@ public interface IBAdministrativeService {
List<BPlanEnterPriseTreeResponse> selectBPlanEnterPriseTreeRequestRequestList(BPlanEnterprisePageRequest req);
/**
*
*
* @param district
* @return
*/
String getBydistinct(String district);
}

@ -97,10 +97,5 @@ public class BAdministrativeServiceImpl implements IBAdministrativeService {
@Override
public String getBydistinct(String district) {
return bAdministrativeMapper.getBydistinct(district);
}
}

@ -39,7 +39,7 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
* @return
*/
@Override
public List<BPlanEnterprise> selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise) {
public List<BPlanEnterpriseResponse> selectBPlanEnterpriseList(BPlanEnterprise bPlanEnterprise) {
return bPlanEnterpriseMapper.selectBPlanEnterpriseList(bPlanEnterprise);
}

@ -110,7 +110,7 @@
) s
</select>
<select id="getBydistinct" resultType="java.lang.String">
SELECT FULL_NAME FROM `szs_administrative_division` where DISTRICT_CODE = #{district}
SELECT county FROM `b_administrative_division` where county_code = #{district}
</select>
<insert id="insertBAdministrative" parameterType="BAdministrative" useGeneratedKeys="true" keyProperty="id">

@ -47,42 +47,49 @@
</sql>
<select id="selectBEnterpriseNewList" parameterType="BEnterpriseNew" resultType="BEnterpriseNew">
select a.id,
a. enterprise_id,
SELECT s.*
FROM (
SELECT
a.id,
a.enterprise_id,
a.enterprise_name,
a.district,
a.SUPERVISION_LARGE,
a.RISK_LEVEL,
a.STAND_LEVEL,
a.EXAMINE_END_TIME,
a. create_id,
a.create_id,
a.create_by,
a.create_time,
a.update_id,
a.update_by,
a.update_time,
a. remark,
a.remark,
a.user_id,
a.dept_id,
CASE WHEN b.ent_code IS NOT NULL THEN 1 ELSE 2 END AS isPoint
from b_enterprise_new a
LEFT JOIN b_key_enterprise b ON a.enterprise_id = b.ent_code COLLATE utf8mb4_unicode_ci
FROM b_enterprise_new a
LEFT JOIN b_key_enterprise b ON a.enterprise_id = b.ent_code
) s
<where>
<if test="enterpriseId != null and enterpriseId != ''">and a.enterprise_id = #{enterpriseId}</if>
<if test="enterpriseName != null and enterpriseName != ''">and a.enterprise_name like concat('%',
<if test="enterpriseId != null and enterpriseId != ''">and s.enterprise_id = #{enterpriseId}</if>
<if test="enterpriseName != null and enterpriseName != ''">and s.enterprise_name like concat('%',
#{enterpriseName}, '%')
</if>
<if test="district != null and district != ''">and a.district = #{district}</if>
<if test="supervisionLarge != null and supervisionLarge != ''">and a.SUPERVISION_LARGE =
<if test="district != null and district != ''">and s.district like concat('%',
#{district}, '%')
</if>
<if test="supervisionLarge != null and supervisionLarge != ''">and s.SUPERVISION_LARGE =
#{supervisionLarge}
</if>
<if test="riskLevel != null and riskLevel != ''">and a.RISK_LEVEL = #{riskLevel}</if>
<if test="standLevel != null and standLevel != ''">and a.STAND_LEVEL = #{standLevel}</if>
<if test="examineEndTime != null ">and a.EXAMINE_END_TIME = #{examineEndTime}</if>
<if test="createId != null ">and a.create_id = #{createId}</if>
<if test="updateId != null ">and a.update_id = #{updateId}</if>
<if test="userId != null ">and a.user_id = #{userId}</if>
<if test="deptId != null ">and a.dept_id = #{deptId}</if>
<if test="riskLevel != null and riskLevel != ''">and s.RISK_LEVEL = #{riskLevel}</if>
<if test="standLevel != null and standLevel != ''">and s.STAND_LEVEL = #{standLevel}</if>
<if test="examineEndTime != null ">and s.EXAMINE_END_TIME = #{examineEndTime}</if>
<if test="createId != null ">and s.create_id = #{createId}</if>
<if test="updateId != null ">and s.update_id = #{updateId}</if>
<if test="userId != null ">and s.user_id = #{userId}</if>
<if test="deptId != null ">and s.dept_id = #{deptId}</if>
<if test="isPoint != null ">and s.isPoint = #{isPoint}</if>
</where>
</select>

@ -34,8 +34,8 @@
</sql>
<select id="selectBPlanEnterpriseList" parameterType="BPlanEnterprise" resultType="BPlanEnterprise">
SELECT DISTINCT
<select id="selectBPlanEnterpriseList" parameterType="BPlanEnterprise" resultType="BPlanEnterpriseResponse">
SELECT
a.id,
a.enterprise_id,
a.create_id,
@ -55,7 +55,7 @@
a.law_areas,
a.law_level,
a.law_hierarchy,
a.planned_month,
a.planned_month as plannedMonth,
a.status,
a.check_status,
a.check_id,
@ -63,10 +63,12 @@
c.RISK_LEVEL as riskLevel,
c.STAND_LEVEL as standLevel,
c.EXAMINE_END_TIME as examineEndTime,
CONCAT(d.district,'-', d.county) AS districtcounty,
CASE WHEN b.ent_code IS NOT NULL THEN 1 ELSE 2 END AS isPoint
FROM b_plan_enterprise a
LEFT JOIN b_key_enterprise b ON a.enterprise_id = b.ent_code
LEFT JOIN b_enterprise_new c ON a.enterprise_id = c.enterprise_id COLLATE utf8mb4_unicode_ci
LEFT JOIN b_enterprise_new c ON a.enterprise_id = c.enterprise_id
left join b_administrative_division d on a.district=d.county_code
<where>
<if test="enterpriseId != null and enterpriseId != ''">and a.enterprise_id = #{enterpriseId}</if>
<if test="createId != null ">and a.create_id = #{createId}</if>
@ -76,9 +78,17 @@
<if test="district != null and district != ''">and a.district like concat('%', #{district}, '%')</if>
<if test="plannedYear != null and plannedYear != ''">and a.planned_year = #{plannedYear}</if>
<if test="isPoint != null ">and a.is_point = #{isPoint}</if>
<if test="lawHierarchy != null ">and a.law_hierarchy = #{lawHierarchy}</if>
<if test="status != null ">and a.status = #{status}</if>
<if test="enterpriseName != null and enterpriseName != ''">and a.enterprise_name like
concat('%',#{enterpriseName}, '%')
</if>
<if test="plannedMonth != null and plannedMonth.length > 0">
AND a.planned_month IN
<foreach item="item" collection="plannedMonth" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
order by isPoint desc
</select>
@ -123,7 +133,7 @@
CASE WHEN b.ent_code IS NOT NULL THEN 1 ELSE 2 END AS isPoint
FROM b_plan_enterprise a
LEFT JOIN b_key_enterprise b ON a.enterprise_id = b.ent_code
LEFT JOIN b_enterprise_new c ON a.enterprise_id = c.enterprise_id COLLATE utf8mb4_unicode_ci
LEFT JOIN b_enterprise_new c ON a.enterprise_id = c.enterprise_id
<where>
<if test="req.plannedYear !=null and req.plannedYear !=''">
and a.planned_year =#{req.plannedYear}
@ -247,6 +257,7 @@
#{item}
</foreach>
</if>
and status=1
</where>
GROUP BY law_areas WITH ROLLUP
ORDER BY
@ -277,6 +288,7 @@
<if test="req.lawAreas !=null and req.lawAreas!='' ">
and law_areas =#{req.lawAreas}
</if>
and status=1
</where>
GROUP BY law_hierarchy WITH ROLLUP
ORDER BY

Loading…
Cancel
Save