From 9e38b9a2d9e4615dba7fb8087296696c66051d20 Mon Sep 17 00:00:00 2001 From: zhuyulei <1843199800@qq.com> Date: Fri, 1 Mar 2024 18:34:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=A2=84=E8=AD=A6=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...sjdBuiRegulatoryInspectionsController.java | 9 ++- .../kms/warn/domain/dto/RectificationDto.java | 46 +++++++++++++++ .../BsSgcJsjdBuiRectificationMapper.java | 6 ++ .../BsSgcJsjdBuiRectificationService.java | 57 ++++++++++++++++++- .../warn/BsSgcJsjdBuiRectificationMapper.xml | 34 +++++++++++ 5 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 jwtech-system/src/main/java/com/kms/warn/domain/dto/RectificationDto.java create mode 100644 jwtech-system/src/main/resources/mapper/warn/BsSgcJsjdBuiRectificationMapper.xml diff --git a/jwtech-system/src/main/java/com/kms/warn/controller/BsSgcJsjdBuiRegulatoryInspectionsController.java b/jwtech-system/src/main/java/com/kms/warn/controller/BsSgcJsjdBuiRegulatoryInspectionsController.java index b5240835..8f750e29 100644 --- a/jwtech-system/src/main/java/com/kms/warn/controller/BsSgcJsjdBuiRegulatoryInspectionsController.java +++ b/jwtech-system/src/main/java/com/kms/warn/controller/BsSgcJsjdBuiRegulatoryInspectionsController.java @@ -11,7 +11,9 @@ import com.kms.common.utils.BaseEntityUtils; import com.kms.earlyStage.domain.SpecialProjectPreDesign; +import com.kms.earlyStage.domain.SpecialProjectProposal; import com.kms.earlyStage.service.SpecialProjectPreDesignService; +import com.kms.earlyStage.service.SpecialProjectProposalService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -51,6 +53,9 @@ public class BsSgcJsjdBuiRegulatoryInspectionsController extends BaseController @Autowired private SpecialProjectPreDesignService specialProjectPreDesignService; + @Autowired + private SpecialProjectProposalService service; + /** * 查询监管检查列表 */ @@ -84,8 +89,8 @@ public class BsSgcJsjdBuiRegulatoryInspectionsController extends BaseController BsSgcJsjdBuiRegulatoryInspections byId = bsSgcJsjdBuiRegulatoryInspectionsService.getById(id); String proNo = byId.getProNo(); String proCode = byId.getProCode(); - SpecialProjectPreDesign one = specialProjectPreDesignService.getOne(Wrappers.lambdaQuery(SpecialProjectPreDesign.class) - .eq(SpecialProjectPreDesign::getProjectCode, proCode).eq(SpecialProjectPreDesign::getProNo, proNo)); + SpecialProjectProposal one = service.getOne(Wrappers.lambdaQuery(SpecialProjectProposal.class) + .eq(SpecialProjectProposal::getProjectCode, proCode).eq(SpecialProjectProposal::getProNo, proNo)); String projectName = one.getProjectName(); byId.setProjectName(projectName); diff --git a/jwtech-system/src/main/java/com/kms/warn/domain/dto/RectificationDto.java b/jwtech-system/src/main/java/com/kms/warn/domain/dto/RectificationDto.java new file mode 100644 index 00000000..6fc1598e --- /dev/null +++ b/jwtech-system/src/main/java/com/kms/warn/domain/dto/RectificationDto.java @@ -0,0 +1,46 @@ +package com.kms.warn.domain.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.jianwei.common.annotation.Excel; +import com.kms.warn.domain.BsSgcJsjdBuiRectification; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +@Data +public class RectificationDto implements Serializable { + + private String id; + + @Excel(name = "发文单位") + @ApiModelProperty("发文单位") + private String issuingUnit; + + /** 文号 */ + @Excel(name = "文号") + @ApiModelProperty("文号") + private String documentNumber; + + /** 通知生效时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "通知生效时间", width = 30, dateFormat = "yyyy-MM-dd") + @ApiModelProperty("通知生效时间") + private Date noticeBegainTime; + + /** 整改通知书 */ + @Excel(name = "整改通知书") + @ApiModelProperty("整改通知书") + private String rectificationAttachment; + + private String unit; + + private List unitArray; + + private String isFinish; + + private String rectificationSituation; + +} diff --git a/jwtech-system/src/main/java/com/kms/warn/mapper/BsSgcJsjdBuiRectificationMapper.java b/jwtech-system/src/main/java/com/kms/warn/mapper/BsSgcJsjdBuiRectificationMapper.java index efac94f0..618a51d6 100644 --- a/jwtech-system/src/main/java/com/kms/warn/mapper/BsSgcJsjdBuiRectificationMapper.java +++ b/jwtech-system/src/main/java/com/kms/warn/mapper/BsSgcJsjdBuiRectificationMapper.java @@ -1,9 +1,13 @@ package com.kms.warn.mapper; +import com.kms.warn.domain.dto.RectificationDto; +import org.apache.ibatis.annotations.Select; import org.springframework.stereotype.Repository; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.kms.warn.domain.BsSgcJsjdBuiRectification; +import java.util.List; + /** * 整改通知书Mapper接口 * @@ -13,4 +17,6 @@ import com.kms.warn.domain.BsSgcJsjdBuiRectification; @Repository public interface BsSgcJsjdBuiRectificationMapper extends BaseMapper { + + List select(String inspectionId); } diff --git a/jwtech-system/src/main/java/com/kms/warn/service/BsSgcJsjdBuiRectificationService.java b/jwtech-system/src/main/java/com/kms/warn/service/BsSgcJsjdBuiRectificationService.java index 6d60f547..0ae43d0c 100644 --- a/jwtech-system/src/main/java/com/kms/warn/service/BsSgcJsjdBuiRectificationService.java +++ b/jwtech-system/src/main/java/com/kms/warn/service/BsSgcJsjdBuiRectificationService.java @@ -1,10 +1,21 @@ package com.kms.warn.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.jianwei.common.core.domain.SearchParam; +import com.kms.build.domain.BsSgcJsjdBuiEnteInfo; +import com.kms.build.service.BsSgcJsjdBuiEnteInfoService; +import com.kms.warn.domain.dto.RectificationDto; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.jianwei.common.core.service.BaseService; import com.kms.warn.mapper.BsSgcJsjdBuiRectificationMapper; import com.kms.warn.domain.BsSgcJsjdBuiRectification; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + /** * 整改通知书Service接口 * @@ -12,6 +23,50 @@ import com.kms.warn.domain.BsSgcJsjdBuiRectification; * @date 2024-02-23 */ @Service -public class BsSgcJsjdBuiRectificationService extends BaseService{ +public class BsSgcJsjdBuiRectificationService extends BaseService { + + @Autowired + private BsSgcJsjdBuiRectificationMapper bsSgcJsjdBuiRectificationMapper; + + @Autowired + private BsSgcJsjdBuiEnteInfoService bsSgcJsjdBuiEnteInfoService; + + public IPage selectPage(SearchParam sp) { + BsSgcJsjdBuiRectification data = sp.getData(); + + List list = bsSgcJsjdBuiRectificationMapper.select(data.getInspectionId()); + + for (RectificationDto rectificationDto : list) { + String unit = rectificationDto.getUnit(); + if (unit != null) { + String[] split = unit.split(","); + List bsSgcJsjdBuiEnteInfos = bsSgcJsjdBuiEnteInfoService.listByIds(Arrays.asList(split)); + List stringList = bsSgcJsjdBuiEnteInfos.stream().map(BsSgcJsjdBuiEnteInfo::getEnterpriseName).collect(Collectors.toList()); + rectificationDto.setUnitArray(stringList); + } + + String rectificationSituation = rectificationDto.getRectificationSituation(); + if (rectificationSituation != null) { + String[] split = rectificationSituation.split(","); + for (String s : split) { + if (s.equals("0")) { + rectificationDto.setIsFinish("0"); + } + } + + if (rectificationDto.getRectificationSituation() != "0") { + rectificationDto.setIsFinish("1"); + } + } + } + + Page rectificationDtoPage = new Page<>(); + + rectificationDtoPage.setRecords(list); + rectificationDtoPage.setTotal(list.size()); + + + return rectificationDtoPage; + } } diff --git a/jwtech-system/src/main/resources/mapper/warn/BsSgcJsjdBuiRectificationMapper.xml b/jwtech-system/src/main/resources/mapper/warn/BsSgcJsjdBuiRectificationMapper.xml new file mode 100644 index 00000000..864363bb --- /dev/null +++ b/jwtech-system/src/main/resources/mapper/warn/BsSgcJsjdBuiRectificationMapper.xml @@ -0,0 +1,34 @@ + + + + + SELECT + br.id, + br.issuing_unit, + br.document_number, + br.notice_begain_time, + br.rectification_attachment, + GROUP_CONCAT(bz.rectification_situation) rectification_situation, + GROUP_CONCAT(bz.unit_id) unit_id + FROM + bs_sgc_jsjd_bui_rectification br + LEFT JOIN bs_sgc_jsjd_bui_zrdw bz ON br.id = bz.rectification_id + + + + + + + + + + + + + +