Commit be27e69e authored by chenzhao's avatar chenzhao

登录问题修复 增加是否农户判断 及对微信报错抛出异常 勘察商务信息同步到资料归档

parent 17b260e1
......@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 农户信息 Mapper 接口
......@@ -32,4 +33,6 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> {
@UserEmpower(field={},dealerField={"developer_code","regional_companies_code","developer_user_id"} ,fieldConditions ={"eq","in","eq"} ,relationship="and")
List<PeasantHousehold> queryForPage( String developerCode,String ownersName,Long developerId,Integer isCertified);
List<Map<String,Object>> selectUserIsHouse(String telephone);
}
......@@ -66,5 +66,15 @@ and hygf_document_station.station_id is not null
</if>
ORDER BY rec_date DESC
</select>
<select id="selectUserIsHouse" resultType="java.util.Map">
SELECT
role.*
FROM
privilege_user_org_role role
INNER JOIN privilege_agency_user `user` ON `user`.USER_ID = role.USER_ID
AND role.ROLE_SEQ NOT IN ( 1702551322030534658 )
WHERE
`user`.MOBILE = #{telephone}
</select>
</mapper>
......@@ -297,8 +297,13 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
@Transactional(rollbackFor = Exception.class)
public PeasantHouseholdWxDto wxUserLogin(MobileLoginParamDto wxDTO) {
// 通过手机号和验证码调用平台接口进行验证
String phoneNo = this.parsePhoneNo(wxDTO);
if (phoneNo == null) {
String phoneNo ;
try{
phoneNo = this.parsePhoneNo(wxDTO);
}catch (Exception e){
throw new BadRequest("解析手机号失败");
}
if (phoneNo == null) {
log.error("获取手机号失败!");
throw new BadRequest("解析手机号失败");
}
......@@ -309,6 +314,11 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
RequestContext.setProduct("AMOS_STUDIO_WEB");
RequestContext.setToken(requestContext.getToken());
//判断是否非农户 如果存在即为非农户角色
List<Map<String, Object>> maps = peasantHouseholdMapper.selectUserIsHouse(phoneNo);
if (CollectionUtil.isNotEmpty(maps)){
throw new RuntimeException("该用户非农户,请切换后登录");
}
AgencyUserModel registerUserModel = null;
// region 判断有无在平台内部注册过用户 没有注册则去平台注册
FeignClientResult<LoginInfoModel> loginInfo = Privilege.agencyUserClient.getLoginInfo(phoneNo);
......@@ -393,16 +403,28 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
RequestContext.setProduct("AMOS_STUDIO_WEB");
RequestContext.setToken(requestContext.getToken());
PeasantHouseholdDto peasantHouseholdDto = this.buildDefaultPeasantHouseholdDto(wxDTO.getAmosUserId(), wxDTO.getQrCodeType(), wxDTO.getPhoneNo());
String phoneNo = this.parsePhoneNo(wxDTO);
String phoneNo = null;
Map<String, Object> resultMap = BeanUtil.beanToMap(peasantHouseholdDto);
resultMap.put("isRegister",1);
try {
phoneNo = this.parsePhoneNo(wxDTO);
}catch (Exception e){
resultMap.put("telephone","");
return resultMap;
}
//判断是否非农户 如果存在即为非农户角色
List<Map<String, Object>> maps = peasantHouseholdMapper.selectUserIsHouse(phoneNo);
if (CollectionUtil.isNotEmpty(maps)){
throw new BadRequest("该手机号已注册");
}
if (StringUtils.isNotEmpty(phoneNo)){
resultMap.put("telephone",phoneNo);
FeignClientResult<LoginInfoModel> loginInfo = Privilege.agencyUserClient.getLoginInfo(wxDTO.getPhoneNo());
List<PeasantHousehold> peasantHouseholds = this.query().eq("telephone", wxDTO.getPhoneNo()).eq("is_certified","1").orderByDesc("rec_date").list();
FeignClientResult<LoginInfoModel> loginInfo = Privilege.agencyUserClient.getLoginInfo(phoneNo);
List<PeasantHousehold> peasantHouseholds = this.query().eq("telephone", phoneNo).eq("is_certified","1").orderByDesc("rec_date").list();
if (loginInfo != null && 200 == loginInfo.getStatus()&& null!= loginInfo.getResult()
&&(peasantHouseholds.size()>0 || !CollectionUtil.isNotEmpty(peasantHouseholds))){
&&(peasantHouseholds.size()>0 || CollectionUtil.isNotEmpty(peasantHouseholds))){
resultMap.put("isRegister",0);
}
}else {
......
......@@ -187,6 +187,9 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
//更新资料归档信息
Information information = BeanDtoUtils.convert(surveyInfoAllDto.getInformation(), Information.class);
information.setHouseProve(null == commercial ?null :(CollectionUtil.isNotEmpty(commercial.getRealEstateLegal())? commercial.getRealEstateLegal():null));
information.setCardFile( null == commercial ?null:(CollectionUtil.isNotEmpty(commercial.getIdCardCredit())? commercial.getIdCardCredit():null));
information.setCardFile(commercial.getAgentLegal());
information.setArchivesNumber(this.getNo(CodeEnum.档案.getCode(),peasantHousehold.getRegionalCompaniesSeq()));
information.setFileNumber(this.getNo(CodeEnum.文件.getCode(),peasantHousehold.getRegionalCompaniesSeq()));
information.setSurveyInformationId(surveyInformation.getSequenceNbr());
......
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