laozt 11 months ago
commit 2148af934c

@ -5,6 +5,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.programManagement.entity.BEnterpriseNew;
import com.ruoyi.programManagement.entity.request.BEnterpriseNewRequest;
import com.ruoyi.programManagement.entity.response.BEnterpriseNewReponse;
import com.ruoyi.programManagement.service.IBEnterpriseNewService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -30,11 +32,11 @@ public class BEnterpriseNewController extends BaseController {
/**
*
*/
@ApiOperation(value = "查询企业新表列表", response = BEnterpriseNew.class)
@ApiOperation(value = "查询企业新表列表", response = BEnterpriseNewReponse.class)
@GetMapping("/list")
public TableDataInfo list(BEnterpriseNew bEnterpriseNew) {
public TableDataInfo list(BEnterpriseNewRequest bEnterpriseNew) {
startPage();
List<BEnterpriseNew> list = bEnterpriseNewService.selectBEnterpriseNewList(bEnterpriseNew);
List<BEnterpriseNewReponse> list = bEnterpriseNewService.selectBEnterpriseNewList(bEnterpriseNew);
return getDataTable(list);
}
@ -43,9 +45,9 @@ public class BEnterpriseNewController extends BaseController {
*/
@ApiOperation(value = "导出企业新表列表")
@PostMapping("/export")
public void export(HttpServletResponse response, BEnterpriseNew bEnterpriseNew) {
List<BEnterpriseNew> list = bEnterpriseNewService.selectBEnterpriseNewList(bEnterpriseNew);
ExcelUtil<BEnterpriseNew> util = new ExcelUtil<BEnterpriseNew>(BEnterpriseNew.class);
public void export(HttpServletResponse response, BEnterpriseNewRequest bEnterpriseNew) {
List<BEnterpriseNewReponse> list = bEnterpriseNewService.selectBEnterpriseNewList(bEnterpriseNew);
ExcelUtil<BEnterpriseNewReponse> util = new ExcelUtil<BEnterpriseNewReponse>(BEnterpriseNewReponse.class);
util.exportExcel(response, list, "企业新表数据");
}
@ -90,9 +92,9 @@ public class BEnterpriseNewController extends BaseController {
*/
@GetMapping("/getList")
@ApiOperation("企业新表企业不存在计划表list")
public TableDataInfo getList(BEnterpriseNew bEnterpriseNew) {
public TableDataInfo getList(BEnterpriseNewRequest bEnterpriseNew) {
startPage();
List<BEnterpriseNew> list = bEnterpriseNewService.getList(bEnterpriseNew);
List<BEnterpriseNewReponse> list = bEnterpriseNewService.getList(bEnterpriseNew);
return getDataTable(list);
}
}

@ -54,15 +54,6 @@ public class BPlanEnterpriseController extends BaseController {
@Resource
private BPlanEnterpriseMapper bPlanEnterpriseMapper;
@Resource
private BKeyEnterpriseService bKeyEnterpriseService;
@Autowired
private IBAdministrativeService bAdministrativeService;
@Resource
private IBAdministrativeDivisionService bAdministrativeDivisionService;
/**
*

@ -1,6 +1,7 @@
package com.ruoyi.programManagement.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
@ -20,7 +21,8 @@ import java.util.Date;
*/
@Data
@ApiModel("企业新表")
public class BEnterpriseNew extends BaseEntity {
@TableName("b_enterprise_new")
public class BEnterpriseNew {
private static final long serialVersionUID = 1L;
/**
@ -106,13 +108,6 @@ public class BEnterpriseNew extends BaseEntity {
@ApiModelProperty(value = "部门权限id")
private Long deptId;
/**
*
*/
@TableField(exist = false)
@ApiModelProperty(value = "是否重点企业")
private Long isPoint;
}

@ -26,7 +26,7 @@ import java.util.Date;
@Data
@ApiModel("计划企业表实体类")
@TableName("b_plan_enterprise")
public class BPlanEnterprise extends BaseEntity {
public class BPlanEnterprise {
private static final long serialVersionUID = -98531345456142440L;
/**

@ -5,6 +5,7 @@ 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 com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -17,7 +18,7 @@ import java.util.Date;
*/
@Data
@ApiModel("计划企业新增请求类")
public class BPlanEnterpriseRequest {
public class BPlanEnterpriseRequest {
private static final long serialVersionUID = -98531345456142440L;
/**
*

@ -0,0 +1,107 @@
package com.ruoyi.programManagement.entity.response;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
@Data
@ApiModel("企业新表响应类")
public class BEnterpriseNewReponse extends BaseEntity {
/**
* $column.columnComment
*/
private Long id;
/**
* id
*/
@Excel(name = "企业id")
@ApiModelProperty(value = "企业id")
private String enterpriseId;
/**
*
*/
@Excel(name = "企业名称")
@ApiModelProperty(value = "企业名称")
private String enterpriseName;
/**
*
*/
@Excel(name = "行政区划")
@ApiModelProperty(value = "行政区划")
private String district;
/**
*
*/
@Excel(name = "行业监管大类编码")
@ApiModelProperty(value = "行业监管大类编码")
private String supervisionLarge;
/**
*
*/
@Excel(name = "安全风险等级")
@ApiModelProperty(value = "安全风险等级")
private String riskLevel;
/**
*
*/
@Excel(name = "标准化等级")
@ApiModelProperty(value = "标准化等级")
private String standLevel;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "上次检查时间")
@Excel(name = "上次检查时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date examineEndTime;
/**
* ID
*/
@Excel(name = "创建者ID")
@ApiModelProperty(value = "创建者ID")
private Integer createId;
/**
* ID
*/
@Excel(name = "更新者ID")
@ApiModelProperty(value = "更新者ID")
private Integer updateId;
/**
* id
*/
@Excel(name = "用户权限id")
@ApiModelProperty(value = "用户权限id")
private Long userId;
/**
* id
*/
@Excel(name = "部门权限id")
@ApiModelProperty(value = "部门权限id")
private Long deptId;
/**
*
*/
@TableField(exist = false)
@ApiModelProperty(value = "是否重点企业")
private Long isPoint;
}

@ -2,6 +2,8 @@ package com.ruoyi.programManagement.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.programManagement.entity.BEnterpriseNew;
import com.ruoyi.programManagement.entity.request.BEnterpriseNewRequest;
import com.ruoyi.programManagement.entity.response.BEnterpriseNewReponse;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -29,7 +31,7 @@ public interface BEnterpriseNewMapper extends BaseMapper<BEnterpriseNew> {
* @param bEnterpriseNew
* @return
*/
List<BEnterpriseNew> selectBEnterpriseNewList(BEnterpriseNew bEnterpriseNew);
List<BEnterpriseNewReponse> selectBEnterpriseNewList(BEnterpriseNewRequest bEnterpriseNew);
/**
*
@ -81,6 +83,6 @@ public interface BEnterpriseNewMapper extends BaseMapper<BEnterpriseNew> {
*
* @return list
*/
List<BEnterpriseNew> getList(BEnterpriseNew bEnterpriseNew);
List<BEnterpriseNewReponse> getList(BEnterpriseNewRequest bEnterpriseNew);
}

@ -120,5 +120,12 @@ public interface BPlanEnterpriseMapper extends BaseMapper<BPlanEnterprise> {
*/
void updatePlan(BPlanEnterpriseRequest bPlanEnterprise);
/**
* id
* @return
*/
List<BPlanEnterprise> selectUpdateAll();
}

@ -2,15 +2,13 @@ package com.ruoyi.programManagement.quartz;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.programManagement.entity.BEnterpriseNew;
import com.ruoyi.programManagement.entity.SzEnforExamine;
import com.ruoyi.programManagement.entity.response.BPlanEnterpriseResponse;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.mapper.BEnterpriseNewMapper;
import com.ruoyi.programManagement.service.BPlanEnterpriseService;
import com.ruoyi.programManagement.service.IBEnterpriseNewService;
import com.ruoyi.programManagement.service.ISzEnforExamineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
@ -36,14 +34,12 @@ public class EnterpristQuartz {
private BEnterpriseNewMapper bEnterpriseNewMapper;
@Autowired
private ISzEnforExamineService szEnforExamineService;
@Resource
private BPlanEnterpriseService bPlanEnterpriseService;
@Resource
private IBEnterpriseNewService bEnterpriseNewService;
@Resource
private BPlanEnterpriseService bPlanEnterpriseService;
// 每周一早上五点5点执行一次任务 生成企业新表
// @Scheduled(cron = "0 0 17 ? * SUN")
@ -58,25 +54,16 @@ public class EnterpristQuartz {
return AjaxResult.success();
}
// 定时任务修改更新计划表的检查状态、检查id、检查时效字段
// @Scheduled(cron = "0 0 1 * * ?")
@GetMapping("/updateExamine")
@ApiOperation(value = "定时任务修改更新计划表的检查状态、检查id、检查时效字段")
public AjaxResult updateExamine() {
//查询计划表中的所有数据
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) {
bEnterpriseNew.setId(a.getId());
bEnterpriseNew.setExamineEndTime(b.getExamineEndTime());
bEnterpriseNewMapper.updateBEnterpriseNew(bEnterpriseNew);
}
}
return null;
List<BPlanEnterprise> list =bPlanEnterpriseService.selectUpdateAll();
bPlanEnterpriseService.updateBatchById(list);
return AjaxResult.success();
}
}

@ -113,5 +113,12 @@ public interface BPlanEnterpriseService extends IService<BPlanEnterprise> {
* @param bPlanEnterprise
*/
void updatePlan(BPlanEnterpriseRequest bPlanEnterprise);
/**
* id
*
* @return
*/
List<BPlanEnterprise> selectUpdateAll();
}

@ -2,6 +2,8 @@ package com.ruoyi.programManagement.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.programManagement.entity.BEnterpriseNew;
import com.ruoyi.programManagement.entity.request.BEnterpriseNewRequest;
import com.ruoyi.programManagement.entity.response.BEnterpriseNewReponse;
import java.util.List;
@ -27,7 +29,7 @@ public interface IBEnterpriseNewService extends IService<BEnterpriseNew> {
* @param bEnterpriseNew
* @return
*/
List<BEnterpriseNew> selectBEnterpriseNewList(BEnterpriseNew bEnterpriseNew);
List<BEnterpriseNewReponse> selectBEnterpriseNewList(BEnterpriseNewRequest bEnterpriseNew);
/**
*
@ -67,5 +69,5 @@ public interface IBEnterpriseNewService extends IService<BEnterpriseNew> {
*
* @return list
*/
List<BEnterpriseNew> getList(BEnterpriseNew bEnterpriseNew);
List<BEnterpriseNewReponse> getList(BEnterpriseNewRequest bEnterpriseNew);
}

@ -5,6 +5,8 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.programManagement.entity.BEnterpriseNew;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.entity.request.BEnterpriseNewRequest;
import com.ruoyi.programManagement.entity.response.BEnterpriseNewReponse;
import com.ruoyi.programManagement.mapper.BEnterpriseNewMapper;
import com.ruoyi.programManagement.mapper.BPlanEnterpriseMapper;
import com.ruoyi.programManagement.service.BPlanEnterpriseService;
@ -43,7 +45,7 @@ public class BEnterpriseNewServiceImpl extends ServiceImpl<BEnterpriseNewMapper,
* @return
*/
@Override
public List<BEnterpriseNew> selectBEnterpriseNewList(BEnterpriseNew bEnterpriseNew) {
public List<BEnterpriseNewReponse> selectBEnterpriseNewList(BEnterpriseNewRequest bEnterpriseNew) {
return bEnterpriseNewMapper.selectBEnterpriseNewList(bEnterpriseNew);
}
@ -56,7 +58,7 @@ public class BEnterpriseNewServiceImpl extends ServiceImpl<BEnterpriseNewMapper,
*/
@Override
public int insertBEnterpriseNew(BEnterpriseNew bEnterpriseNew) {
bEnterpriseNew.setCreateTime(DateUtils.getNowDate());
return bEnterpriseNewMapper.insertBEnterpriseNew(bEnterpriseNew);
}
@ -68,7 +70,7 @@ public class BEnterpriseNewServiceImpl extends ServiceImpl<BEnterpriseNewMapper,
*/
@Override
public int updateBEnterpriseNew(BEnterpriseNew bEnterpriseNew) {
bEnterpriseNew.setUpdateTime(DateUtils.getNowDate());
return bEnterpriseNewMapper.updateBEnterpriseNew(bEnterpriseNew);
}
@ -95,7 +97,7 @@ public class BEnterpriseNewServiceImpl extends ServiceImpl<BEnterpriseNewMapper,
}
@Override
public List<BEnterpriseNew> getList(BEnterpriseNew bEnterpriseNew) {
public List<BEnterpriseNewReponse> getList(BEnterpriseNewRequest bEnterpriseNew) {
return bEnterpriseNewMapper.getList(bEnterpriseNew);
}
}

@ -3,6 +3,7 @@ package com.ruoyi.programManagement.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.entity.request.*;
@ -108,14 +109,21 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl<BPlanEnterpriseMappe
@Override
public void insert(BPlanEnterpriseRequest bPlanEnterprise) {
bPlanEnterprise.setCreateTime(DateUtils.getNowDate());
bPlanEnterpriseMapper.insertPlan(bPlanEnterprise);
}
@Override
public void updatePlan(BPlanEnterpriseRequest bPlanEnterprise) {
bPlanEnterprise.setUpdateTime(DateUtils.getNowDate());
bPlanEnterpriseMapper.updatePlan(bPlanEnterprise);
}
@Override
public List<BPlanEnterprise> selectUpdateAll() {
return bPlanEnterpriseMapper.selectUpdateAll();
}
}

@ -46,7 +46,7 @@
</sql>
<select id="selectBEnterpriseNewList" parameterType="BEnterpriseNew" resultType="BEnterpriseNew">
<select id="selectBEnterpriseNewList" parameterType="BEnterpriseNew" resultType="BEnterpriseNewReponse">
SELECT s.*
FROM (
SELECT
@ -201,7 +201,7 @@
GROUP BY USC_CODE
) e ON a.enterprise_id = e.USC_CODE COLLATE utf8mb4_unicode_ci;
</select>
<select id="getList" resultType="com.ruoyi.programManagement.entity.BEnterpriseNew">
<select id="getList" resultType="com.ruoyi.programManagement.entity.response.BEnterpriseNewReponse">
select s.* from( SELECT
a.id,
a.enterprise_id,

@ -314,6 +314,23 @@
sort
</select>
<select id="selectUpdateAll" resultType="com.ruoyi.programManagement.entity.BPlanEnterprise">
SELECT a.id,a.enterprise_id, a.district, a.planned_year, a.is_point, a.enterprise_name, a.law_sort, a.law_areas, a.law_level, a.law_hierarchy, a.planned_month, a.status,
CASE
WHEN e.MAX_EXAMINE_END_TIME IS NULL THEN 0
WHEN YEAR(e.MAX_EXAMINE_END_TIME) = a.planned_year AND MONTH(e.MAX_EXAMINE_END_TIME) = a.planned_month THEN 1
WHEN YEAR(e.MAX_EXAMINE_END_TIME) &lt; a.planned_year OR (YEAR(e.MAX_EXAMINE_END_TIME) = a.planned_year AND MONTH(e.MAX_EXAMINE_END_TIME) &lt; a.planned_month) THEN 2
ELSE 3
END AS check_ageing,
e.ID AS check_id
FROM b_plan_enterprise a
LEFT JOIN (
SELECT USC_CODE, MAX(EXAMINE_END_TIME) AS MAX_EXAMINE_END_TIME, ID
FROM sz_enfor_examine
WHERE YEAR(EXAMINE_END_TIME) = YEAR(CURDATE())
GROUP BY USC_CODE, ID
) e ON a.enterprise_id = e.USC_CODE;
</select>
<update id="updateIdList" parameterType="java.util.List">

Loading…
Cancel
Save