diff --git a/src/main/java/com/cm/inspection/controller/apis/dischargepermit/DischargePermitController.java b/src/main/java/com/cm/inspection/controller/apis/dischargepermit/DischargePermitController.java index 19f05d6..bf4f2d4 100644 --- a/src/main/java/com/cm/inspection/controller/apis/dischargepermit/DischargePermitController.java +++ b/src/main/java/com/cm/inspection/controller/apis/dischargepermit/DischargePermitController.java @@ -13,6 +13,7 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.inspection.pojo.dtos.dischargepermit.DischargePermitDTO; +import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; import com.cm.inspection.pojo.vos.dischargepermit.DischargePermitVO; import com.cm.inspection.service.dischargepermit.IDischargePermitService; import io.swagger.annotations.*; @@ -117,4 +118,19 @@ public class DischargePermitController extends AbstractController { return securityComponent.getCurrentUserIdInfo(); } + + @ApiOperation(value = "排污许可证(超时)企业分页列表", notes = "排污许可证(超时)企业分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "timeout", value = "是否超时", paramType = "path", dataType = "boolean"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-enterprise/{timeout}") + public List listEnterprise(@PathVariable("timeout") Boolean timeout) { + Map params = requestParams(); + return dischargePermitService.listEnterprise(timeout, params); + } + } \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/controller/apis/eiareport/EiaReportController.java b/src/main/java/com/cm/inspection/controller/apis/eiareport/EiaReportController.java index debb787..fecc63b 100644 --- a/src/main/java/com/cm/inspection/controller/apis/eiareport/EiaReportController.java +++ b/src/main/java/com/cm/inspection/controller/apis/eiareport/EiaReportController.java @@ -13,6 +13,7 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.inspection.pojo.dtos.eiareport.EiaReportDTO; +import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; import com.cm.inspection.pojo.vos.eiareport.EiaReportVO; import com.cm.inspection.service.eiareport.IEiaReportService; import io.swagger.annotations.*; @@ -117,4 +118,18 @@ public class EiaReportController extends AbstractController { return securityComponent.getCurrentUserIdInfo(); } + @ApiOperation(value = "环评报告(超时)企业列表", notes = "环评报告(超时)企业列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "timeout", value = "是否超时", paramType = "path", dataType = "boolean"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-enterprise/{timeout}") + public List listPageEnterprise(@PathVariable("timeout") Boolean timeout) { + Map params = requestParams(); + return eiaReportService.listEnterprise(timeout, params); + } + } \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/controller/app/apis/dischargepermit/DischargePermitAppController.java b/src/main/java/com/cm/inspection/controller/app/apis/dischargepermit/DischargePermitAppController.java index 7f30b76..c0d4296 100644 --- a/src/main/java/com/cm/inspection/controller/app/apis/dischargepermit/DischargePermitAppController.java +++ b/src/main/java/com/cm/inspection/controller/app/apis/dischargepermit/DischargePermitAppController.java @@ -11,6 +11,7 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.inspection.pojo.dtos.dischargepermit.DischargePermitDTO; +import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; import com.cm.inspection.pojo.vos.dischargepermit.DischargePermitVO; import com.cm.inspection.service.dischargepermit.IDischargePermitService; import io.swagger.annotations.*; @@ -133,4 +134,18 @@ public class DischargePermitAppController extends AbstractController { return dischargePermitService.countDischargePermit(params); } + @ApiOperation(value = "排污许可证(超时)企业分页列表", notes = "排污许可证(超时)企业分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "timeout", value = "是否超时", paramType = "path", dataType = "boolean"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-enterprise/{timeout}") + public List listEnterprise(@PathVariable("timeout") Boolean timeout) { + Map params = requestParams(); + return dischargePermitService.listEnterprise(timeout, params); + } + } \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/controller/app/apis/eiareport/EiaReportAppController.java b/src/main/java/com/cm/inspection/controller/app/apis/eiareport/EiaReportAppController.java index 89143c3..c713b9b 100644 --- a/src/main/java/com/cm/inspection/controller/app/apis/eiareport/EiaReportAppController.java +++ b/src/main/java/com/cm/inspection/controller/app/apis/eiareport/EiaReportAppController.java @@ -11,6 +11,7 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.inspection.pojo.dtos.eiareport.EiaReportDTO; +import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; import com.cm.inspection.pojo.vos.eiareport.EiaReportVO; import com.cm.inspection.service.eiareport.IEiaReportService; import io.swagger.annotations.*; @@ -133,4 +134,18 @@ public class EiaReportAppController extends AbstractController { return eiaReportService.countEiaReport(params); } + @ApiOperation(value = "环评报告(超时)企业列表", notes = "环评报告(超时)企业列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "timeout", value = "是否超时", paramType = "path", dataType = "boolean"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-enterprise/{timeout}") + public List listPageEnterprise(@PathVariable("timeout") Boolean timeout) { + Map params = requestParams(); + return eiaReportService.listEnterprise(timeout, params); + } + } \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/dao/dischargepermit/IDischargePermitDao.java b/src/main/java/com/cm/inspection/dao/dischargepermit/IDischargePermitDao.java index 46fc932..8d3e8b2 100644 --- a/src/main/java/com/cm/inspection/dao/dischargepermit/IDischargePermitDao.java +++ b/src/main/java/com/cm/inspection/dao/dischargepermit/IDischargePermitDao.java @@ -5,6 +5,7 @@ import com.cm.common.exception.SaveException; import com.cm.common.exception.SearchException; import com.cm.common.exception.UpdateException; import com.cm.inspection.pojo.dtos.dischargepermit.DischargePermitDTO; +import com.cm.inspection.pojo.pos.dischargepermit.DischargePermitPO; import org.springframework.stereotype.Repository; import java.util.List; @@ -87,4 +88,13 @@ public interface IDischargePermitDao { * @throws SearchException */ List listLast(Map params) throws SearchException; + + /** + * 列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPO(Map params) throws SearchException; } \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/dao/eiareport/IEiaReportDao.java b/src/main/java/com/cm/inspection/dao/eiareport/IEiaReportDao.java index a85369e..6b8946b 100644 --- a/src/main/java/com/cm/inspection/dao/eiareport/IEiaReportDao.java +++ b/src/main/java/com/cm/inspection/dao/eiareport/IEiaReportDao.java @@ -5,6 +5,7 @@ import com.cm.common.exception.SaveException; import com.cm.common.exception.SearchException; import com.cm.common.exception.UpdateException; import com.cm.inspection.pojo.dtos.eiareport.EiaReportDTO; +import com.cm.inspection.pojo.pos.eiareport.EiaReportPO; import org.springframework.stereotype.Repository; import java.util.List; @@ -87,4 +88,13 @@ public interface IEiaReportDao { * @throws SearchException */ List listLast(Map params) throws SearchException; + + /** + * 列表 + * + * @param params + * @return + * @throws SearchException + */ + List listPO(Map params) throws SearchException; } \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/pojo/pos/dischargepermit/DischargePermitPO.java b/src/main/java/com/cm/inspection/pojo/pos/dischargepermit/DischargePermitPO.java new file mode 100644 index 0000000..1d5b157 --- /dev/null +++ b/src/main/java/com/cm/inspection/pojo/pos/dischargepermit/DischargePermitPO.java @@ -0,0 +1,25 @@ +package com.cm.inspection.pojo.pos.dischargepermit; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @ClassName: DischargePermitDTO + * @Description: 排污许可证 + * @Author: WenG + * @Date: 2021-03-29 21:49 + * @Version: 1.0 + **/ +@Data +public class DischargePermitPO { + + private String dischargePermitId; + private String enterpriseId; + private String title; + private String content; + private String remindTime; + private String files; + private String gmtCreate; + private String creator; +} diff --git a/src/main/java/com/cm/inspection/pojo/pos/eiareport/EiaReportPO.java b/src/main/java/com/cm/inspection/pojo/pos/eiareport/EiaReportPO.java new file mode 100644 index 0000000..aa07b05 --- /dev/null +++ b/src/main/java/com/cm/inspection/pojo/pos/eiareport/EiaReportPO.java @@ -0,0 +1,28 @@ +package com.cm.inspection.pojo.pos.eiareport; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: EiaReportPO + * @Description: 环评报告 + * @Author: wanggeng + * @Date: 2021/4/1 11:19 上午 + * @Version: 1.0 + */ +@Data +public class EiaReportPO { + + private String eiaReportId; + private String enterpriseId; + private String title; + private String content; + private String remindTime; + private String files; + private String gmtCreate; + private String creator; + +} diff --git a/src/main/java/com/cm/inspection/service/dischargepermit/IDischargePermitService.java b/src/main/java/com/cm/inspection/service/dischargepermit/IDischargePermitService.java index 5803957..63dade5 100644 --- a/src/main/java/com/cm/inspection/service/dischargepermit/IDischargePermitService.java +++ b/src/main/java/com/cm/inspection/service/dischargepermit/IDischargePermitService.java @@ -7,6 +7,7 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.inspection.pojo.dtos.dischargepermit.DischargePermitDTO; +import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; import com.cm.inspection.pojo.vos.dischargepermit.DischargePermitVO; import java.util.List; @@ -167,4 +168,13 @@ public interface IDischargePermitService { * 通知超时排污许可证 */ void noticeTimeout(); + + /** + * 排污许可证(超时)企业列表 + * + * @param timeout + * @param params + * @return + */ + List listEnterprise(Boolean timeout, Map params); } \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/service/dischargepermit/impl/DischargePermitServiceImpl.java b/src/main/java/com/cm/inspection/service/dischargepermit/impl/DischargePermitServiceImpl.java index e4844ff..a23471a 100644 --- a/src/main/java/com/cm/inspection/service/dischargepermit/impl/DischargePermitServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/dischargepermit/impl/DischargePermitServiceImpl.java @@ -9,11 +9,13 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.common.token.app.AppTokenManager; +import com.cm.common.utils.DateUtil; import com.cm.common.utils.HashMapUtil; import com.cm.common.utils.UUIDUtil; import com.cm.inspection.dao.dischargepermit.IDischargePermitDao; import com.cm.inspection.pojo.dtos.dischargepermit.DischargePermitDTO; import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; +import com.cm.inspection.pojo.pos.dischargepermit.DischargePermitPO; import com.cm.inspection.pojo.vos.dischargepermit.DischargePermitVO; import com.cm.inspection.runnable.dischargepermit.DischargePermitRunnable; import com.cm.inspection.service.dischargepermit.IDischargePermitService; @@ -216,6 +218,17 @@ public class DischargePermitServiceImpl extends AbstractService implements IDisc return new SuccessResultList<>(dischargePermitDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); } + private List listPO(Map params) throws SearchException { + return dischargePermitDao.listPO(params); + } + + private SuccessResultList> listPagePO(ListPage page) throws SearchException { + PageHelper.startPage(page.getPage(), page.getRows()); + List dischargePermitPOs = listPO(page.getParams()); + PageInfo pageInfo = new PageInfo<>(dischargePermitPOs); + return new SuccessResultList<>(dischargePermitPOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + @Override public Integer countNumberDischargePermit(Map params) throws SearchException { Integer count = dischargePermitDao.countDischargePermit(params); @@ -259,4 +272,22 @@ public class DischargePermitServiceImpl extends AbstractService implements IDisc scheduledExecutorService.schedule(new DischargePermitRunnable(noticeUrl, dischargePermits), 3, TimeUnit.SECONDS); } + @Override + public List listEnterprise(Boolean timeout, Map params) { + String today = DateUtil.getDay(); + if (timeout) { + params.put("timeoutDay", today); + } else { + params.put("noTimeoutDay", today); + } + List dischargePermitPOs = listPO(params); + List enterpriseIds = new ArrayList<>(); + dischargePermitPOs.forEach(eiaReportDTO -> { + enterpriseIds.add(eiaReportDTO.getEnterpriseId()); + }); + params.clear(); + params.put("enterpriseIds", enterpriseIds); + return enterpriseService.listEnterprise(params); + } + } \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/service/eiareport/IEiaReportService.java b/src/main/java/com/cm/inspection/service/eiareport/IEiaReportService.java index ddf3010..f84d1f7 100644 --- a/src/main/java/com/cm/inspection/service/eiareport/IEiaReportService.java +++ b/src/main/java/com/cm/inspection/service/eiareport/IEiaReportService.java @@ -7,6 +7,7 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.inspection.pojo.dtos.eiareport.EiaReportDTO; +import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; import com.cm.inspection.pojo.vos.eiareport.EiaReportVO; import java.util.List; @@ -167,4 +168,13 @@ public interface IEiaReportService { * 通知超时环评报告 */ void noticeTimeout(); + + /** + * 环评报告(超时)企业分页列表 + * + * @param timeout + * @param params + * @return + */ + List listEnterprise(Boolean timeout, Map params); } \ No newline at end of file diff --git a/src/main/java/com/cm/inspection/service/eiareport/impl/EiaReportServiceImpl.java b/src/main/java/com/cm/inspection/service/eiareport/impl/EiaReportServiceImpl.java index 23f84fb..7fe8d0e 100644 --- a/src/main/java/com/cm/inspection/service/eiareport/impl/EiaReportServiceImpl.java +++ b/src/main/java/com/cm/inspection/service/eiareport/impl/EiaReportServiceImpl.java @@ -9,11 +9,13 @@ import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.common.token.app.AppTokenManager; +import com.cm.common.utils.DateUtil; import com.cm.common.utils.HashMapUtil; import com.cm.common.utils.UUIDUtil; import com.cm.inspection.dao.eiareport.IEiaReportDao; import com.cm.inspection.pojo.dtos.eiareport.EiaReportDTO; import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO; +import com.cm.inspection.pojo.pos.eiareport.EiaReportPO; import com.cm.inspection.pojo.vos.eiareport.EiaReportVO; import com.cm.inspection.runnable.eiareport.EiaReportNoticeRunnable; import com.cm.inspection.service.eiareport.IEiaReportService; @@ -216,6 +218,17 @@ public class EiaReportServiceImpl extends AbstractService implements IEiaReportS return new SuccessResultList<>(eiaReportDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); } + private List listPO(Map params) throws SearchException { + return eiaReportDao.listPO(params); + } + + private SuccessResultList> listPagePO(ListPage page) throws SearchException { + PageHelper.startPage(page.getPage(), page.getRows()); + List eiaReportPOs = listPO(page.getParams()); + PageInfo pageInfo = new PageInfo<>(eiaReportPOs); + return new SuccessResultList<>(eiaReportPOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + @Override public Integer countNumberEiaReport(Map params) throws SearchException { Integer count = eiaReportDao.countEiaReport(params); @@ -259,4 +272,22 @@ public class EiaReportServiceImpl extends AbstractService implements IEiaReportS scheduledExecutorService.schedule(new EiaReportNoticeRunnable(noticeUrl, eiaReportDTOs), 3, TimeUnit.SECONDS); } + @Override + public List listEnterprise(Boolean timeout, Map params) { + String today = DateUtil.getDay(); + if (timeout) { + params.put("timeoutDay", today); + } else { + params.put("noTimeoutDay", today); + } + List eiaReports = listPO(params); + List enterpriseIds = new ArrayList<>(); + eiaReports.forEach(eiaReportDTO -> { + enterpriseIds.add(eiaReportDTO.getEnterpriseId()); + }); + params.clear(); + params.put("enterpriseIds", enterpriseIds); + return enterpriseService.listEnterprise(params); + } + } \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/dischargepermit/dischargepermit-mapper.xml b/src/main/resources/mybatis/mapper/dischargepermit/dischargepermit-mapper.xml index fce7b55..f95db95 100644 --- a/src/main/resources/mybatis/mapper/dischargepermit/dischargepermit-mapper.xml +++ b/src/main/resources/mybatis/mapper/dischargepermit/dischargepermit-mapper.xml @@ -13,6 +13,17 @@ + + + + + + + + + + + INSERT INTO gen_discharge_permit( @@ -152,6 +163,56 @@ + + + + + +