Browse Source

标段导出

dev_kxc
zth 10 months ago
parent
commit
baef36fdc9
  1. 65
      jwtech-system/src/main/java/com/kms/build/controller/BsSgcJsjdBuiSectionInfoController.java
  2. 25
      jwtech-system/src/main/java/com/kms/build/domain/BsSgcJsjdBuiSectionExcel.java
  3. 10
      jwtech-system/src/main/java/com/kms/build/mapper/BsSgcjsjdBuiProInfoMapper.java
  4. 6
      jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java
  5. 49
      jwtech-system/src/main/resources/mapper/build/BsSgcjsjdBuiProInfoMapper.xml

65
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<BsSgcJsjdBuiSectionExcel> util = new ExcelUtil<>(BsSgcJsjdBuiSectionExcel.class);
List<BsSgcJsjdBuiSectionExcel> list = util.importExcel(file.getInputStream());
if (CollectionUtil.isNotEmpty(list)) {
for (BsSgcJsjdBuiSectionExcel bs : list) {
LambdaQueryWrapper<BsSgcjsjdBuiProInfo>lw=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())){
LambdaQueryWrapper<SysDictData>sys=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;i<split.length;i++){
LambdaQueryWrapper<SysXzqh>xzqh=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);
}

25
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;
}

10
jwtech-system/src/main/java/com/kms/build/mapper/BsSgcjsjdBuiProInfoMapper.java

@ -47,6 +47,16 @@ public interface BsSgcjsjdBuiProInfoMapper extends BaseMapper<BsSgcjsjdBuiProInf
@Param("proCode")String proCode,
@Param("isMajor")String isMajor);
List<BsSgcjsjdBuiProInfo>getCount(@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<BsSgcjsjdBuiProInfo> selectManagePage(@Param("userId") String userId,
@Param("userType") String userType,
@Param("id") String id,

6
jwtech-system/src/main/java/com/kms/build/service/BsSgcjsjdBuiProInfoService.java

@ -160,11 +160,13 @@ public class BsSgcjsjdBuiProInfoService extends BaseService<BsSgcjsjdBuiProInfoM
data.getProjectName(), sysXzqhService.getSubString(data.getAdcd()), (String) params.get("orderBy"), sp.getPageNum(), sp.getPageSize(),sp.getData().getProNo(),sp.getData().getProCode(),isMajor);
}
List<BsSgcjsjdBuiProInfo>bsSgcjsjdBuiProInfos = 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<BsSgcjsjdBuiProInfo> page = new Page<>();
page.setRecords(list);
page.setTotal(i);
page.setTotal(bsSgcjsjdBuiProInfos.size());
List<BsSgcjsjdBuiProInfo> records = page.getRecords();
for (BsSgcjsjdBuiProInfo record : records) {

49
jwtech-system/src/main/resources/mapper/build/BsSgcjsjdBuiProInfoMapper.xml

@ -183,6 +183,55 @@
</select>
<select id="getCount" resultMap="BsSgcjsjdBuiProInfo">
<include refid="info"/>
<if test="userType==01">
WHERE
pi.PRO_NO IN (
SELECT
PRO_NO
FROM
sys_user_pro
<where>
<if test="userId!=null and userId!=''">
AND user_id=#{userId})
</if>
<if test="projectName!=null and projectName!=''">
and pi.project_name like concat('%',#{projectName},'%')
</if>
<if test="proCode != null and proCode != ''">
and pi.PRO_CODE=#{proCode}
</if>
<if test="proNo != null and proNo != ''">
and pi.PRO_NO=#{proNo}
</if>
<if test="isMajor != null and isMajor != ''">
and pi.IS_MAJOR=#{isMajor}
</if>
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
</where>
</if>
<if test="userType==00">
<where>
<if test="projectName!=null and projectName!=''">
and pi.project_name like concat('%',#{projectName},'%')
</if>
<if test="proCode != null and proCode != ''">
and pi.PRO_CODE=#{proCode}
</if>
<if test="proNo != null and proNo != ''">
and pi.PRO_NO=#{proNo}
</if>
<if test="isMajor != null and isMajor != ''">
and pi.IS_MAJOR=#{isMajor}
</if>
<include refid="com.kms.system.mapper.SysXzqhMapper.xzqhCondition"></include>
</where>
</if>
</select>
<select id="selectManagePage" resultMap="projectManage">
<include refid="projectMangeInfo"></include>
<if test="userType==01">

Loading…
Cancel
Save