From baef36fdc9a7072dcf3006b3ad84d7399152ef5a Mon Sep 17 00:00:00 2001 From: zth <1205836521@qq.com> Date: Tue, 25 Jun 2024 17:24:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E6=AE=B5=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BsSgcJsjdBuiSectionInfoController.java | 65 +++++++++++++++++-- .../domain/BsSgcJsjdBuiSectionExcel.java | 25 ++----- .../mapper/BsSgcjsjdBuiProInfoMapper.java | 10 +++ .../service/BsSgcjsjdBuiProInfoService.java | 6 +- .../build/BsSgcjsjdBuiProInfoMapper.xml | 49 ++++++++++++++ 5 files changed, 128 insertions(+), 27 deletions(-) diff --git a/jwtech-system/src/main/java/com/kms/build/controller/BsSgcJsjdBuiSectionInfoController.java b/jwtech-system/src/main/java/com/kms/build/controller/BsSgcJsjdBuiSectionInfoController.java index e25fe9fb..29d55f67 100644 --- a/jwtech-system/src/main/java/com/kms/build/controller/BsSgcJsjdBuiSectionInfoController.java +++ b/jwtech-system/src/main/java/com/kms/build/controller/BsSgcJsjdBuiSectionInfoController.java @@ -5,19 +5,24 @@ import java.util.Arrays; import java.util.List; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.jianwei.common.core.controller.BaseController; import com.jianwei.common.core.domain.SearchParam; +import com.jianwei.common.core.domain.entity.SysDictData; +import com.jianwei.common.utils.BeanUtils; +import com.jianwei.common.utils.StringUtils; import com.jianwei.common.utils.poi.ExcelUtil; -import com.kms.build.domain.BsSgcJsjdBuiRealName; -import com.kms.build.domain.BsSgcJsjdBuiRealNameExcel; -import com.kms.build.domain.BsSgcJsjdBuiSectionExcel; -import com.kms.build.domain.BsSgcJsjdBuiSectionInfo; +import com.kms.build.domain.*; +import com.kms.build.mapper.BsSgcjsjdBuiProInfoMapper; import com.kms.common.utils.BaseEntityUtils; +import com.kms.system.domain.SysXzqh; +import com.kms.system.mapper.SysDictDataMapper; +import com.kms.system.service.SysXzqhService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; @@ -45,6 +50,14 @@ public class BsSgcJsjdBuiSectionInfoController extends BaseController @Autowired private BsSgcJsjdBuiSectionInfoService bsSgcJsjdBuiSectionInfoService; + @Autowired + private BsSgcjsjdBuiProInfoMapper bsSgcjsjdBuiProInfoMapper; + + @Autowired + private SysXzqhService sysXzqhService; + + @Autowired + private SysDictDataMapper sysDictDataMapper; /** * 查询标段基本信息管理列表 */ @@ -130,7 +143,47 @@ public class BsSgcJsjdBuiSectionInfoController extends BaseController try { ExcelUtil util = new ExcelUtil<>(BsSgcJsjdBuiSectionExcel.class); List list = util.importExcel(file.getInputStream()); - + if (CollectionUtil.isNotEmpty(list)) { + for (BsSgcJsjdBuiSectionExcel bs : list) { + LambdaQueryWrapperlw=new LambdaQueryWrapper<>(); + BsSgcjsjdBuiProInfo bsSgcjsjdBuiProInfo = bsSgcjsjdBuiProInfoMapper.selectOne(lw.eq(BsSgcjsjdBuiProInfo::getProNo,proNo) + .eq(BsSgcjsjdBuiProInfo::getProCode,proCode)); + BsSgcJsjdBuiSectionInfo bsSgcJsjdBuiSectionInfo=new BsSgcJsjdBuiSectionInfo(); + BeanUtils.copyBeanProp(bsSgcJsjdBuiSectionInfo,bs); + bsSgcJsjdBuiSectionInfo.setProCode(bsSgcjsjdBuiProInfo.getProCode()); + bsSgcJsjdBuiSectionInfo.setProNo(bsSgcjsjdBuiProInfo.getProNo()); + bsSgcJsjdBuiSectionInfo.setProjectName(bsSgcjsjdBuiProInfo.getProjectName()); + if (StringUtils.isNotEmpty(bsSgcJsjdBuiSectionInfo.getConstructionNature())){ + LambdaQueryWrappersys=new LambdaQueryWrapper<>(); + SysDictData sysDictData = sysDictDataMapper.selectOne(sys.eq(SysDictData::getDictType, "CONSTRUCTION_NATURE") + .eq(SysDictData::getDictLabel, bsSgcJsjdBuiSectionInfo.getConstructionNature())); + if (ObjectUtil.isNotEmpty(sysDictData)){ + bsSgcJsjdBuiSectionInfo.setConstructionNature(sysDictData.getDictValue()); + }else { + bsSgcJsjdBuiSectionInfo.setConstructionNature(null); + } + } + if (StringUtils.isNotEmpty(bsSgcJsjdBuiSectionInfo.getAdcd())){ + String[] split = bsSgcJsjdBuiSectionInfo.getAdcd().split("/"); + String parentId=null; + SysXzqh one=null; + for (int i=0;ixzqh=new LambdaQueryWrapper<>(); + if (StringUtils.isNotEmpty(parentId)){ + one = sysXzqhService.getOne(xzqh.eq(SysXzqh::getName, split[i]).eq(SysXzqh::getParentid,parentId)); + }else { + one = sysXzqhService.getOne(xzqh.eq(SysXzqh::getName, split[i])); + } + if (ObjectUtil.isNotEmpty(one)){ + parentId=one.getXzqhdm(); + } + } + bsSgcJsjdBuiSectionInfo.setAdcd(one.getXzqhdm()); + } + BaseEntityUtils.preInsert(bsSgcJsjdBuiSectionInfo); + bsSgcJsjdBuiSectionInfoService.save(bsSgcJsjdBuiSectionInfo); + } + } } catch (Exception e) { throw new RuntimeException(e); } diff --git a/jwtech-system/src/main/java/com/kms/build/domain/BsSgcJsjdBuiSectionExcel.java b/jwtech-system/src/main/java/com/kms/build/domain/BsSgcJsjdBuiSectionExcel.java index 25dd0d5b..17e099ef 100644 --- a/jwtech-system/src/main/java/com/kms/build/domain/BsSgcJsjdBuiSectionExcel.java +++ b/jwtech-system/src/main/java/com/kms/build/domain/BsSgcJsjdBuiSectionExcel.java @@ -15,9 +15,6 @@ public class BsSgcJsjdBuiSectionExcel { @ApiModelProperty("标段名称") private String sectionName; - @Excel(name = "相关项目名称(必填)") - @ApiModelProperty("项目名称") - private String projectName; /** 项目法人 */ @Excel(name = "项目法人") @ApiModelProperty("项目法人") @@ -29,26 +26,13 @@ public class BsSgcJsjdBuiSectionExcel { private String projectsuperinteidentPhone; - /** 工程等别 */ - @Excel(name = "工程等别") - @ApiModelProperty("工程等别") - private String engineeringGrade; - - /** 工程用途 */ - @Excel(name = "工程用途") - @ApiModelProperty("工程用途") - private String engineeringPurposes; - /** 项目建设地址 */ @Excel(name = "建设地址") @ApiModelProperty("建设地址") private String constructionAddress; - @Excel(name = "是否重大项目,填:是或否") - @ApiModelProperty("是否重大项目") - private String isMajor; - @Excel(name = "行政区划") + @Excel(name = "行政区划,格式xx省/xx市/xx区",width = 30) @ApiModelProperty("行政区划") private String adcd; @@ -62,12 +46,15 @@ public class BsSgcJsjdBuiSectionExcel { @ApiModelProperty("计划竣工日期") private Date plannedCompletionDate; - @Excel(name = "是否为安全度汛重点工程") + @Excel(name = "是否为安全度汛重点工程,填:是或否",width = 30) @ApiModelProperty("是否为安全度汛重点工程,填:是或否") private String isKeyProject; /** 是否穿破堤坝施工 */ - @Excel(name = "是否穿破堤坝施工") + @Excel(name = "是否穿破堤坝施工,填:是或否",width = 30) @ApiModelProperty("是否穿破堤坝施工,填:是或否") private String isPierceProject; + + @Excel(name = "建设性质:除险加固,扩建,改建,新建",width = 40) + private String constructionNature; } diff --git a/jwtech-system/src/main/java/com/kms/build/mapper/BsSgcjsjdBuiProInfoMapper.java b/jwtech-system/src/main/java/com/kms/build/mapper/BsSgcjsjdBuiProInfoMapper.java index a07420c3..562ab992 100644 --- a/jwtech-system/src/main/java/com/kms/build/mapper/BsSgcjsjdBuiProInfoMapper.java +++ b/jwtech-system/src/main/java/com/kms/build/mapper/BsSgcjsjdBuiProInfoMapper.java @@ -47,6 +47,16 @@ public interface BsSgcjsjdBuiProInfoMapper extends BaseMappergetCount(@Param("userId") String userId, + @Param("userType") String userType, + @Param("id") String id, + @Param("projectName") String projectName, + @Param("adcd") String adcd, + @Param("orderBy") String orderBy, + @Param("proNo") String proNo, + @Param("proCode")String proCode, + @Param("isMajor")String isMajor); + IPage selectManagePage(@Param("userId") String userId, @Param("userType") String userType, @Param("id") String id, diff --git a/jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java b/jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java index ecdcc392..fa9497e1 100644 --- a/jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java +++ b/jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java @@ -160,11 +160,13 @@ public class BsSgcjsjdBuiProInfoService extends BaseServicebsSgcjsjdBuiProInfos = bsSgcjsjdBuiProInfoMapper.getCount(sysUser.getId(), sysUser.getUserType(), data.getId(), data.getProjectName(), + sysXzqhService.getSubString(data.getAdcd()), + "create_time", sp.getData().getProNo(),sp.getData().getProCode(),isMajor); - Integer i = bsSgcjsjdBuiProInfoMapper.selectCount(null); Page page = new Page<>(); page.setRecords(list); - page.setTotal(i); + page.setTotal(bsSgcjsjdBuiProInfos.size()); List records = page.getRecords(); for (BsSgcjsjdBuiProInfo record : records) { diff --git a/jwtech-system/src/main/resources/mapper/build/BsSgcjsjdBuiProInfoMapper.xml b/jwtech-system/src/main/resources/mapper/build/BsSgcjsjdBuiProInfoMapper.xml index 448f78ee..7bb99649 100644 --- a/jwtech-system/src/main/resources/mapper/build/BsSgcjsjdBuiProInfoMapper.xml +++ b/jwtech-system/src/main/resources/mapper/build/BsSgcjsjdBuiProInfoMapper.xml @@ -183,6 +183,55 @@ + + +