Browse Source

项目预警开发

dev_kxc
zhuyulei 1 year ago
parent
commit
9e38b9a2d9
  1. 9
      jwtech-system/src/main/java/com/kms/warn/controller/BsSgcJsjdBuiRegulatoryInspectionsController.java
  2. 46
      jwtech-system/src/main/java/com/kms/warn/domain/dto/RectificationDto.java
  3. 6
      jwtech-system/src/main/java/com/kms/warn/mapper/BsSgcJsjdBuiRectificationMapper.java
  4. 57
      jwtech-system/src/main/java/com/kms/warn/service/BsSgcJsjdBuiRectificationService.java
  5. 34
      jwtech-system/src/main/resources/mapper/warn/BsSgcJsjdBuiRectificationMapper.xml

9
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);

46
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<String> unitArray;
private String isFinish;
private String rectificationSituation;
}

6
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<BsSgcJsjdBuiRectification> {
List<RectificationDto> select(String inspectionId);
}

57
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<BsSgcJsjdBuiRectificationMapper, BsSgcJsjdBuiRectification>{
public class BsSgcJsjdBuiRectificationService extends BaseService<BsSgcJsjdBuiRectificationMapper, BsSgcJsjdBuiRectification> {
@Autowired
private BsSgcJsjdBuiRectificationMapper bsSgcJsjdBuiRectificationMapper;
@Autowired
private BsSgcJsjdBuiEnteInfoService bsSgcJsjdBuiEnteInfoService;
public IPage selectPage(SearchParam<BsSgcJsjdBuiRectification> sp) {
BsSgcJsjdBuiRectification data = sp.getData();
List<RectificationDto> list = bsSgcJsjdBuiRectificationMapper.select(data.getInspectionId());
for (RectificationDto rectificationDto : list) {
String unit = rectificationDto.getUnit();
if (unit != null) {
String[] split = unit.split(",");
List<BsSgcJsjdBuiEnteInfo> bsSgcJsjdBuiEnteInfos = bsSgcJsjdBuiEnteInfoService.listByIds(Arrays.asList(split));
List<String> 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<RectificationDto> rectificationDtoPage = new Page<>();
rectificationDtoPage.setRecords(list);
rectificationDtoPage.setTotal(list.size());
return rectificationDtoPage;
}
}

34
jwtech-system/src/main/resources/mapper/warn/BsSgcJsjdBuiRectificationMapper.xml

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.kms.warn.mapper.BsSgcJsjdBuiRectificationMapper">
<sql id="info">
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
</sql>
<resultMap id="RectificationDto" type="RectificationDto">
<id property="id" column="id"/>
<result property="unit" column="unit_id"/>
<result property="rectificationAttachment" column="rectification_attachment"/>
<result property="documentNumber" column="document_number"/>
<result property="noticeBegainTime" column="notice_begain_time"/>
<result property="issuingUnit" column="issuing_unit"/>
</resultMap>
<select id="select" resultMap="RectificationDto">
<include refid="info"></include>
</select>
</mapper>
Loading…
Cancel
Save