Commit 4b5df648 authored by leizhan's avatar leizhan

农户勘察详情中,返回设计信息对象

parent 5d998a47
package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.yeejoin.amos.boot.module.jxiop.api.dto.DesignInformationDto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
......@@ -23,4 +24,7 @@ public class SurveyInfoAllDto {
// 商务信息
CommercialDto commercial;
//设计信息
DesignInformationDto designInformation;
}
......@@ -10,6 +10,9 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.api.mapper.SurveyInformationMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.ISurveyInformationService;
import com.yeejoin.amos.boot.module.hygf.api.util.BeanDtoUtils;
import com.yeejoin.amos.boot.module.jxiop.api.dto.DesignInformationDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.DesignInformation;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.DesignInformationServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
......@@ -54,6 +57,9 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
PeasantHouseholdServiceImpl peasantHouseholdServiceImpl;
@Autowired
DesignInformationServiceImpl designInformationService;
@Autowired
RedisUtils redisUtils;
private static final String regionRedis="app_region_redis";
......@@ -119,12 +125,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
QueryWrapper<PeasantHousehold> peasantHouseholdQueryWrapper = new QueryWrapper<>();
peasantHouseholdQueryWrapper.eq("survey_information_id", surveyInformation.getSequenceNbr());
PeasantHousehold peasantHousehold = peasantHouseholdServiceImpl.getBaseMapper().selectOne(peasantHouseholdQueryWrapper);
if("submit".equals(operationType)){
peasantHousehold.setSurveyOrNot(1);
}else if("apply".equals(operationType)){
peasantHousehold.setSurveyOrNot(2);
peasantHousehold.setReview(1);
}
peasantHousehold.setOwnersName(surveyInfoAllDto.getSurveyInformation().getOwnersName());
peasantHousehold.setTelephone(surveyInfoAllDto.getSurveyInformation().getTelephone());
peasantHousehold.setIdCard(surveyInfoAllDto.getSurveyInformation().getIdCard());
......@@ -155,6 +156,14 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
}
}
peasantHousehold.setPermanentAddressName(permanentAddressName.substring(0, permanentAddressName.length() - 2));
if("submit".equals(operationType)){
peasantHousehold.setSurveyOrNot(1);
}else if("apply".equals(operationType)){
peasantHousehold.setSurveyOrNot(2);
peasantHousehold.setReview(1);
}
peasantHouseholdServiceImpl.saveOrUpdate(peasantHousehold);
return surveyInfoAllDto;
}
......@@ -233,6 +242,15 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
}else {
surveyInfoAllDto.setExtendedInformation(BeanDtoUtils.convert(extendedInformation, ExtendedInformationDto.class));
}
QueryWrapper<DesignInformation> designInformationQueryWrapper = new QueryWrapper<>();
designInformationQueryWrapper.eq("survey_information_id", surveyInformationId);
DesignInformation designInformation = designInformationService.getBaseMapper().selectOne(designInformationQueryWrapper);
if(information == null){
surveyInfoAllDto.setDesignInformation(new DesignInformationDto());
}else {
surveyInfoAllDto.setDesignInformation(BeanDtoUtils.convert(designInformation, DesignInformationDto.class));
}
return surveyInfoAllDto;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment