|
@@ -2,6 +2,7 @@ package com.dayou.service.impl;
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.dayou.common.BaseEntity;
|
|
@@ -13,6 +14,7 @@ import com.dayou.entity.CertificateFixedAssets;
|
|
|
import com.dayou.entity.HouseExcelData;
|
|
|
import com.dayou.entity.HouseGuarantyArea;
|
|
|
import com.dayou.enums.BusinessEnum;
|
|
|
+import com.dayou.exception.ErrorCode;
|
|
|
import com.dayou.mapper.HouseExcelDataMapper;
|
|
|
import com.dayou.mapper.HouseGuarantyAreaMapper;
|
|
|
import com.dayou.service.CertificateFixedAssetsService;
|
|
@@ -69,7 +71,45 @@ public class HouseExcelDataServiceImpl extends ServiceImpl<HouseExcelDataMapper,
|
|
|
@Override
|
|
|
public BaseInfoDO getBaseDO(Long excelId) {
|
|
|
HouseExcelData base = getBase(excelId);
|
|
|
- return BeanUtil.copyProperties(base, BaseInfoDO.class);
|
|
|
+ //动态附件列表
|
|
|
+ StringBuffer affixs = new StringBuffer();
|
|
|
+ int index = 1;
|
|
|
+ if (StrUtil.isNotBlank(base.getAffix1())){
|
|
|
+ affixs.append(index+". "+base.getAffix1()).append("\n");
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(base.getAffix2())){
|
|
|
+ affixs.append(index+". "+base.getAffix2()).append("\n");
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(base.getAffix3())){
|
|
|
+ affixs.append(index+". "+base.getAffix3()).append("\n");
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(base.getAffix4())){
|
|
|
+ affixs.append(index+". "+base.getAffix4()).append("\n");
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(base.getAffix5())){
|
|
|
+ affixs.append(index+". "+base.getAffix5()).append("\n");
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(base.getAffix6())){
|
|
|
+ affixs.append(index+". "+base.getAffix6()).append("\n");
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(base.getAffix7())){
|
|
|
+ affixs.append(index+". "+base.getAffix7()).append("\n");
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(base.getAffix8())){
|
|
|
+ affixs.append(index+". "+base.getAffix8()).append("\n");
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ BaseInfoDO baseInfoDO = BeanUtil.copyProperties(base, BaseInfoDO.class);
|
|
|
+ baseInfoDO.setAffixs(affixs.toString());
|
|
|
+ return baseInfoDO;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -78,68 +118,75 @@ public class HouseExcelDataServiceImpl extends ServiceImpl<HouseExcelDataMapper,
|
|
|
ConditionDO condition = BeanUtil.copyProperties(hed, ConditionDO.class);
|
|
|
//一般假设
|
|
|
StringBuffer normalAssumptions = new StringBuffer();
|
|
|
- normalAssumptions.append(hed.getNormalAssumption1()).append("\n")
|
|
|
- .append(hed.getNormalAssumption2()).append("\n")
|
|
|
- .append(hed.getNormalAssumption3()).append("\n")
|
|
|
- .append(hed.getNormalAssumption4()).append("\n")
|
|
|
- .append(hed.getNormalAssumption5()).append("\n")
|
|
|
- .append(hed.getNormalAssumption6()).append("\n")
|
|
|
- .append(hed.getNormalAssumption7()).append("\n")
|
|
|
- .append(hed.getNormalAssumption8()).append("\n")
|
|
|
- .append(hed.getNormalAssumption9()).append("\n")
|
|
|
- .append(hed.getNormalAssumption10());
|
|
|
+ normalAssumptions
|
|
|
+ .append(strNull(hed.getNormalAssumption1(),false))
|
|
|
+ .append(strNull(hed.getNormalAssumption2(),false))
|
|
|
+ .append(strNull(hed.getNormalAssumption3(),false))
|
|
|
+ .append(strNull(hed.getNormalAssumption4(),false))
|
|
|
+ .append(strNull(hed.getNormalAssumption5(),false))
|
|
|
+ .append(strNull(hed.getNormalAssumption6(),false))
|
|
|
+ .append(strNull(hed.getNormalAssumption7(),false))
|
|
|
+ .append(strNull(hed.getNormalAssumption8(),false))
|
|
|
+ .append(strNull(hed.getNormalAssumption9(),false))
|
|
|
+ .append(strNull(hed.getNormalAssumption10(),true));
|
|
|
condition.setYBJS(normalAssumptions.toString());
|
|
|
//未定事项假设
|
|
|
StringBuffer undefinedAssumptions = new StringBuffer();
|
|
|
- undefinedAssumptions.append(hed.getUndefinedAssumption1()).append("\n")
|
|
|
- .append(hed.getUndefinedAssumption2()).append("\n")
|
|
|
- .append(hed.getUndefinedAssumption3()).append("\n")
|
|
|
- .append(hed.getUndefinedAssumption4()).append("\n")
|
|
|
- .append(hed.getUndefinedAssumption5()).append("\n")
|
|
|
- .append(hed.getUndefinedAssumption6());
|
|
|
+ undefinedAssumptions
|
|
|
+ .append(strNull(hed.getUndefinedAssumption1(),false))
|
|
|
+ .append(strNull(hed.getUndefinedAssumption2(),false))
|
|
|
+ .append(strNull(hed.getUndefinedAssumption3(),false))
|
|
|
+ .append(strNull(hed.getUndefinedAssumption4(),false))
|
|
|
+ .append(strNull(hed.getUndefinedAssumption5(),false))
|
|
|
+ .append(strNull(hed.getUndefinedAssumption6(),true));
|
|
|
condition.setWDSXJS(undefinedAssumptions.toString());
|
|
|
//不相一致假设
|
|
|
StringBuffer differentAssumptions = new StringBuffer();
|
|
|
- differentAssumptions.append(hed.getDifferentAssumption1()).append("\n")
|
|
|
- .append(hed.getDifferentAssumption2());
|
|
|
+ differentAssumptions
|
|
|
+ .append(strNull(hed.getDifferentAssumption1(),false))
|
|
|
+ .append(strNull(hed.getDifferentAssumption2(),true));
|
|
|
condition.setBXYZJS(differentAssumptions.toString());
|
|
|
//依据不足假设
|
|
|
StringBuffer deficiencyAssumptions = new StringBuffer();
|
|
|
- deficiencyAssumptions.append(hed.getDeficiencyAssumption1()).append("\n")
|
|
|
- .append(hed.getDeficiencyAssumption2()).append("\n")
|
|
|
- .append(hed.getDeficiencyAssumption3()).append("\n")
|
|
|
- .append(hed.getDeficiencyAssumption4()).append("\n")
|
|
|
- .append(hed.getDeficiencyAssumption5());
|
|
|
+ deficiencyAssumptions
|
|
|
+ .append(strNull(hed.getDeficiencyAssumption1(),false))
|
|
|
+ .append(strNull(hed.getDeficiencyAssumption2(),false))
|
|
|
+ .append(strNull(hed.getDeficiencyAssumption3(),false))
|
|
|
+ .append(strNull(hed.getDeficiencyAssumption4(),false))
|
|
|
+ .append(strNull(hed.getDeficiencyAssumption5(),true));
|
|
|
condition.setYJBZJS(deficiencyAssumptions.toString());
|
|
|
//限制条件
|
|
|
StringBuffer limitConditions = new StringBuffer();
|
|
|
- limitConditions.append(hed.getLimitCondition1()).append("\n")
|
|
|
- .append(hed.getLimitCondition2()).append("\n")
|
|
|
- .append(hed.getLimitCondition3()).append("\n")
|
|
|
- .append(hed.getLimitCondition4()).append("\n")
|
|
|
- .append(hed.getLimitCondition5()).append("\n")
|
|
|
- .append(hed.getLimitCondition6()).append("\n")
|
|
|
- .append(hed.getLimitCondition7()).append("\n")
|
|
|
- .append(hed.getLimitCondition8());
|
|
|
+ limitConditions
|
|
|
+ .append(strNull(hed.getLimitCondition1(),false))
|
|
|
+ .append(strNull(hed.getLimitCondition2(),false))
|
|
|
+ .append(strNull(hed.getLimitCondition3(),false))
|
|
|
+ .append(strNull(hed.getLimitCondition4(),false))
|
|
|
+ .append(strNull(hed.getLimitCondition5(),false))
|
|
|
+ .append(strNull(hed.getLimitCondition6(),false))
|
|
|
+ .append(strNull(hed.getLimitCondition7(),false))
|
|
|
+ .append(strNull(hed.getLimitCondition8(),true));
|
|
|
condition.setXZTJ(limitConditions.toString());
|
|
|
//使用本报告的一般说明
|
|
|
StringBuffer normalExplain = new StringBuffer();
|
|
|
- normalExplain.append(hed.getNormalExplain1()).append("\n")
|
|
|
- .append(hed.getNormalExplain2()).append("\n")
|
|
|
- .append(hed.getNormalExplain3()).append("\n")
|
|
|
- .append(hed.getNormalExplain4()).append("\n")
|
|
|
- .append(hed.getNormalExplain5()).append("\n")
|
|
|
- .append(hed.getNormalExplain6()).append("\n")
|
|
|
- .append(hed.getNormalExplain7()).append("\n")
|
|
|
- .append(hed.getNormalExplain8()).append("\n")
|
|
|
- .append(hed.getNormalExplain9());
|
|
|
+ normalExplain
|
|
|
+ .append(strNull(hed.getNormalExplain1(),false))
|
|
|
+ .append(strNull(hed.getNormalExplain2(),false))
|
|
|
+ .append(strNull(hed.getNormalExplain3(),false))
|
|
|
+ .append(strNull(hed.getNormalExplain4(),false))
|
|
|
+ .append(strNull(hed.getNormalExplain5(),false))
|
|
|
+ .append(strNull(hed.getNormalExplain6(),false))
|
|
|
+ .append(strNull(hed.getNormalExplain7(),false))
|
|
|
+ .append(strNull(hed.getNormalExplain8(),false))
|
|
|
+ .append(strNull(hed.getNormalExplain9(),true));
|
|
|
condition.setSYBGSM(normalExplain.toString());
|
|
|
//估价中的特殊处理事项
|
|
|
StringBuffer expeHandle = new StringBuffer();
|
|
|
- expeHandle.append(hed.getExpeHandle1()).append("\n")
|
|
|
- .append(hed.getExpeHandle2()).append("\n")
|
|
|
- .append(hed.getExpeHandle3()).append("\n")
|
|
|
- .append(hed.getExpeHandle4());
|
|
|
+ expeHandle
|
|
|
+ .append(strNull(hed.getExpeHandle1(),false))
|
|
|
+ .append(strNull(hed.getExpeHandle2(),false))
|
|
|
+ .append(strNull(hed.getExpeHandle3(),false))
|
|
|
+ .append(strNull(hed.getExpeHandle4(),true));
|
|
|
condition.setTSSXCL(expeHandle.toString());
|
|
|
return condition;
|
|
|
}
|
|
@@ -149,10 +196,11 @@ public class HouseExcelDataServiceImpl extends ServiceImpl<HouseExcelDataMapper,
|
|
|
HouseExcelData hed = houseExcelDataMapper.getResultReport(businessId);
|
|
|
GuarantyResultDO guarantyResultDO = BeanUtil.copyProperties(hed, GuarantyResultDO.class);
|
|
|
StringBuffer valueMeanings = new StringBuffer();
|
|
|
- valueMeanings.append(hed.getValueMeaning1()).append("\n")
|
|
|
- .append(hed.getValueMeaning2()).append("\n")
|
|
|
- .append(hed.getValueMeaning3()).append("\n")
|
|
|
- .append(hed.getValueMeaning4());
|
|
|
+ valueMeanings
|
|
|
+ .append(strNull(hed.getValueMeaning1(),false))
|
|
|
+ .append(strNull(hed.getValueMeaning2(),false))
|
|
|
+ .append(strNull(hed.getValueMeaning3(),false))
|
|
|
+ .append(strNull(hed.getValueMeaning4(),true));
|
|
|
guarantyResultDO.setValueMeaning(valueMeanings.toString());
|
|
|
|
|
|
//获取估价对象区位状况描述
|
|
@@ -160,10 +208,14 @@ public class HouseExcelDataServiceImpl extends ServiceImpl<HouseExcelDataMapper,
|
|
|
.select(HouseGuarantyArea::getDocContent).eq(BaseEntity::getDeleteStatus, false).orderByAsc(HouseGuarantyArea::getId));
|
|
|
StringBuffer docContent = new StringBuffer();
|
|
|
for (int i = 0; i < areas.size(); i++) {
|
|
|
+ String docContent1 = areas.get(i).getDocContent();
|
|
|
+ if (StrUtil.isBlank(docContent1)){
|
|
|
+ ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"区位描述未保存,请保存后再生成。");
|
|
|
+ }
|
|
|
if (i!= areas.size()-1){
|
|
|
- docContent.append("\t").append(areas.get(i).getDocContent()).append("\n");
|
|
|
+ docContent.append("\t").append(docContent1).append("\n");
|
|
|
}else {
|
|
|
- docContent.append("\t").append(areas.get(i).getDocContent());
|
|
|
+ docContent.append("\t").append(docContent1);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -191,6 +243,14 @@ public class HouseExcelDataServiceImpl extends ServiceImpl<HouseExcelDataMapper,
|
|
|
HouseExcelData::getSummary1,
|
|
|
HouseExcelData::getSummary2,
|
|
|
HouseExcelData::getWorkPurpose,
|
|
|
+ HouseExcelData::getAffix1,
|
|
|
+ HouseExcelData::getAffix2,
|
|
|
+ HouseExcelData::getAffix3,
|
|
|
+ HouseExcelData::getAffix4,
|
|
|
+ HouseExcelData::getAffix5,
|
|
|
+ HouseExcelData::getAffix6,
|
|
|
+ HouseExcelData::getAffix7,
|
|
|
+ HouseExcelData::getAffix8,
|
|
|
HouseExcelData::getExcelUri);
|
|
|
return this.getOne(queryWrapper);
|
|
|
}
|
|
@@ -313,11 +373,14 @@ public class HouseExcelDataServiceImpl extends ServiceImpl<HouseExcelDataMapper,
|
|
|
Row rowValue = sheet.getRow(row);
|
|
|
//估价对象
|
|
|
Cell cell0 = rowValue.getCell(0);
|
|
|
- houseGuarantyArea.setTid(cell0.getStringCellValue());
|
|
|
//坐落
|
|
|
Cell cell1 = rowValue.getCell(1);
|
|
|
+ houseGuarantyArea.setTid(cell0.getStringCellValue());
|
|
|
houseGuarantyArea.setLocation(cell1.getStringCellValue());
|
|
|
houseGuarantyArea.setExcelId(excelId);
|
|
|
+ if (StrUtil.isBlank(houseGuarantyArea.getTid()) || StrUtil.isBlank(houseGuarantyArea.getLocation())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
//获取经纬度 高德接口QPS太高会限制请求。估此处休眠半秒。
|
|
|
Thread.sleep(500);
|
|
|
LngLatDTO lngLatDTO = houseGuarantyAreaService.queryLngLat(houseGuarantyArea.getLocation());
|
|
@@ -327,4 +390,8 @@ public class HouseExcelDataServiceImpl extends ServiceImpl<HouseExcelDataMapper,
|
|
|
}
|
|
|
houseGuarantyAreaService.saveBatch(houseGuarantyAreas);
|
|
|
}
|
|
|
+
|
|
|
+ private String strNull(String str,boolean last){
|
|
|
+ return StrUtil.isNotBlank(str)&&!last?str+"\n":"";
|
|
|
+ }
|
|
|
}
|