diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BEnterpriseNewController.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BEnterpriseNewController.java index 083458e..25fd194 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BEnterpriseNewController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BEnterpriseNewController.java @@ -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 list = bEnterpriseNewService.selectBEnterpriseNewList(bEnterpriseNew); + List 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 list = bEnterpriseNewService.selectBEnterpriseNewList(bEnterpriseNew); - ExcelUtil util = new ExcelUtil(BEnterpriseNew.class); + public void export(HttpServletResponse response, BEnterpriseNewRequest bEnterpriseNew) { + List list = bEnterpriseNewService.selectBEnterpriseNewList(bEnterpriseNew); + ExcelUtil util = new ExcelUtil(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 list = bEnterpriseNewService.getList(bEnterpriseNew); + List list = bEnterpriseNewService.getList(bEnterpriseNew); return getDataTable(list); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java index 32a4918..4a48eaa 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/controller/BPlanEnterpriseController.java @@ -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; /** * 查询计划企业列表 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BEnterpriseNew.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BEnterpriseNew.java index bf3f5da..cb38d19 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BEnterpriseNew.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BEnterpriseNew.java @@ -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; - } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java index d220540..1347725 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/BPlanEnterprise.java @@ -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; /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BEnterpriseNewReponse.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BEnterpriseNewReponse.java new file mode 100644 index 0000000..3b74e12 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/entity/response/BEnterpriseNewReponse.java @@ -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; + +} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BEnterpriseNewMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BEnterpriseNewMapper.java index 67df8c5..52d6354 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BEnterpriseNewMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BEnterpriseNewMapper.java @@ -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 { * @param bEnterpriseNew 企业新表 * @return 企业新表集合 */ - List selectBEnterpriseNewList(BEnterpriseNew bEnterpriseNew); + List selectBEnterpriseNewList(BEnterpriseNewRequest bEnterpriseNew); /** * 新增企业新表 @@ -81,6 +83,6 @@ public interface BEnterpriseNewMapper extends BaseMapper { * * @return list */ - List getList(BEnterpriseNew bEnterpriseNew); + List getList(BEnterpriseNewRequest bEnterpriseNew); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java index 75c2bf0..013ee79 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/mapper/BPlanEnterpriseMapper.java @@ -120,5 +120,12 @@ public interface BPlanEnterpriseMapper extends BaseMapper { */ void updatePlan(BPlanEnterpriseRequest bPlanEnterprise); + + /** + * 定时任务修改更新计划表的检查状态、检查id、检查时效字段 + * @return + */ + List selectUpdateAll(); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java index ba82cac..e4a30a5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/quartz/EnterpristQuartz.java @@ -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 17 ? * SUN") @GetMapping("/updateExamine") @ApiOperation(value = "定时任务修改更新计划表的检查状态、检查id、检查时效字段") public AjaxResult updateExamine() { //查询计划表中的所有数据 - List list = bPlanEnterpriseService.selectBPlanEnterpriseList(null); - for (BPlanEnterpriseResponse a : list) { - BEnterpriseNew bEnterpriseNew = new BEnterpriseNew(); - List szEnforExamineList = szEnforExamineService.getByEnterPriseCode(a.getEnterpriseId()); - for (SzEnforExamine b : szEnforExamineList) { - bEnterpriseNew.setId(a.getId()); - bEnterpriseNew.setExamineEndTime(b.getExamineEndTime()); - bEnterpriseNewMapper.updateBEnterpriseNew(bEnterpriseNew); - } - } - return null; + List list =bPlanEnterpriseService.selectUpdateAll(); + bPlanEnterpriseService.updateBatchById(list); + return AjaxResult.success(); } - } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java index 0721f74..79ef9c1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/BPlanEnterpriseService.java @@ -113,5 +113,12 @@ public interface BPlanEnterpriseService extends IService { * @param bPlanEnterprise */ void updatePlan(BPlanEnterpriseRequest bPlanEnterprise); + + /** + * 定时任务修改更新计划表的检查状态、检查id、检查时效字段 + * + * @return + */ + List selectUpdateAll(); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBEnterpriseNewService.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBEnterpriseNewService.java index 8b34731..b825835 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBEnterpriseNewService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/IBEnterpriseNewService.java @@ -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 { * @param bEnterpriseNew 企业新表 * @return 企业新表集合 */ - List selectBEnterpriseNewList(BEnterpriseNew bEnterpriseNew); + List selectBEnterpriseNewList(BEnterpriseNewRequest bEnterpriseNew); /** * 新增企业新表 @@ -67,5 +69,5 @@ public interface IBEnterpriseNewService extends IService { * * @return list */ - List getList(BEnterpriseNew bEnterpriseNew); + List getList(BEnterpriseNewRequest bEnterpriseNew); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java index e2f9097..d8c670f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BEnterpriseNewServiceImpl.java @@ -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 selectBEnterpriseNewList(BEnterpriseNew bEnterpriseNew) { + public List selectBEnterpriseNewList(BEnterpriseNewRequest bEnterpriseNew) { return bEnterpriseNewMapper.selectBEnterpriseNewList(bEnterpriseNew); } @@ -56,7 +58,7 @@ public class BEnterpriseNewServiceImpl extends ServiceImpl getList(BEnterpriseNew bEnterpriseNew) { + public List getList(BEnterpriseNewRequest bEnterpriseNew) { return bEnterpriseNewMapper.getList(bEnterpriseNew); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java index 7099d4a..da53932 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/programManagement/service/impl/BPlanEnterpriseServiceImpl.java @@ -116,6 +116,11 @@ public class BPlanEnterpriseServiceImpl extends ServiceImpl selectUpdateAll() { + return bPlanEnterpriseMapper.selectUpdateAll(); + } + } diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml index 549bfd8..4979ead 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BEnterpriseNewMapper.xml @@ -46,7 +46,7 @@ - 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 s.* from( SELECT a.id, a.enterprise_id, diff --git a/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml b/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml index aeb61a5..0e818e8 100644 --- a/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/yingji/BPlanEnterpriseMapper.xml @@ -314,6 +314,23 @@ sort +