|
@ -5,19 +5,24 @@ import java.util.Arrays; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
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.controller.BaseController; |
|
|
import com.jianwei.common.core.domain.SearchParam; |
|
|
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.jianwei.common.utils.poi.ExcelUtil; |
|
|
import com.kms.build.domain.BsSgcJsjdBuiRealName; |
|
|
import com.kms.build.domain.*; |
|
|
import com.kms.build.domain.BsSgcJsjdBuiRealNameExcel; |
|
|
import com.kms.build.mapper.BsSgcjsjdBuiProInfoMapper; |
|
|
import com.kms.build.domain.BsSgcJsjdBuiSectionExcel; |
|
|
|
|
|
import com.kms.build.domain.BsSgcJsjdBuiSectionInfo; |
|
|
|
|
|
import com.kms.common.utils.BaseEntityUtils; |
|
|
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.Api; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import io.swagger.annotations.ApiOperation; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
@ -45,6 +50,14 @@ public class BsSgcJsjdBuiSectionInfoController extends BaseController |
|
|
@Autowired |
|
|
@Autowired |
|
|
private BsSgcJsjdBuiSectionInfoService bsSgcJsjdBuiSectionInfoService; |
|
|
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 { |
|
|
try { |
|
|
ExcelUtil<BsSgcJsjdBuiSectionExcel> util = new ExcelUtil<>(BsSgcJsjdBuiSectionExcel.class); |
|
|
ExcelUtil<BsSgcJsjdBuiSectionExcel> util = new ExcelUtil<>(BsSgcJsjdBuiSectionExcel.class); |
|
|
List<BsSgcJsjdBuiSectionExcel> list = util.importExcel(file.getInputStream()); |
|
|
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) { |
|
|
} catch (Exception e) { |
|
|
throw new RuntimeException(e); |
|
|
throw new RuntimeException(e); |
|
|
} |
|
|
} |
|
|