public void chackUserCode(String policyNo, List<String> userCodelist) throws Exception {
List<InsureMainListDto> listInsureMainListDto = insureMainListApi.queryByPolicyNoAndValidity(policyNo);
if(listInsureMainListDto.size()<=0){
throw new BusinessException("此清单不存在");
}
InsureMainListDto insureMainListDto=listInsureMainListDto.get(0);
String inusrelistcode=insureMainListDto.getInusreListCode();
// 根据清单号,农户代码查询此农户在此清单内是否存在 fyanhui
List<NyxPolicyListDto> nyxPolicyListDtoList = nyxPolicyListApi.queryByInusreListCodeAndfcode(inusrelistcode);
List<HerdPolicyListDto> herdPolicyListDtoList = herdPolicyListApi.queryByInusreListCodeAndFcodeCheck(inusrelistcode);
Map<String,String> map=new HashMap<String,String>();
String nuserCode=null;
if(null!=nyxPolicyListDtoList&&nyxPolicyListDtoList.size()>0){
for(int i=0;i<nyxPolicyListDtoList.size();i++){
NyxPolicyListDto nyxPolicyListDto=nyxPolicyListDtoList.get(i);
nuserCode=nyxPolicyListDto.getfCode();
map.put(nuserCode,nuserCode);
}}
if(null!=herdPolicyListDtoList&&herdPolicyListDtoList.size()>0){
for (int k=0;k<herdPolicyListDtoList.size();k++){
HerdPolicyListDto herdPolicyListDto =herdPolicyListDtoList.get(k);
nuserCode=herdPolicyListDto.getfCode();
map.put(nuserCode,nuserCode);
}
}
for(int j=0;j<userCodelist.size();j++){
String userCode=userCodelist.get(j);
boolean result= map.containsKey(userCode);
if(result==false){
throw new BusinessException("此农户不在清单内,请核对!"+"农户代码:"+userCode);
}
}
}