|
@@ -42,6 +42,8 @@ import java.math.BigDecimal;
|
|
|
import java.math.BigInteger;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.List;
|
|
|
+import java.util.regex.Matcher;
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
import static com.google.common.collect.Lists.newArrayList;
|
|
|
|
|
@@ -1008,6 +1010,44 @@ public class AsyncTaskImportService {
|
|
|
String housetype = housetypeCell.getStringCellValue().trim();
|
|
|
String customerGroup = customergroupCell.getStringCellValue().trim();
|
|
|
|
|
|
+ //校验手机号是否正确
|
|
|
+ if(StringUtils.isNotBlank(telephone)){
|
|
|
+ String regex = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$";
|
|
|
+ if(telephone.length() != 11){
|
|
|
+ failTime++ ;
|
|
|
+ msg +="客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,";
|
|
|
+ log.info("客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,");
|
|
|
+ c_remark.setCellValue("客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,");
|
|
|
+ continue;
|
|
|
+ }else{
|
|
|
+ Pattern p = Pattern.compile(regex);
|
|
|
+ Matcher m = p.matcher(telephone);
|
|
|
+ boolean isMatch = m.matches();
|
|
|
+ if(!isMatch){
|
|
|
+ failTime++ ;
|
|
|
+ msg +="客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,";
|
|
|
+ log.info("客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,");
|
|
|
+ c_remark.setCellValue("客户编码【"+accountnumber+"】您输入的手机号格式有误,请重新输入,");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //校验邮箱是否正确
|
|
|
+ if(StringUtils.isNotBlank(email)){
|
|
|
+ String check = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
|
|
|
+ Pattern p = Pattern.compile(check);
|
|
|
+ Matcher m = p.matcher(email);
|
|
|
+ boolean isMatch = m.matches();
|
|
|
+ if(!isMatch){
|
|
|
+ failTime++ ;
|
|
|
+ msg +="客户编码【"+accountnumber+"】您输入的邮箱格式有误,请重新输入,";
|
|
|
+ log.info("客户编码【"+accountnumber+"】您输入的邮箱格式有误,请重新输入,");
|
|
|
+ c_remark.setCellValue("客户编码【"+accountnumber+"】您输入的邮箱格式有误,请重新输入,");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
PayBaseCustomerandmeterrela customer = new PayBaseCustomerandmeterrela();//实例化开户实体
|
|
|
//根据客户编码寻找客户id
|
|
|
PayBaseAccount accounts = payBaseCustomerandmeterrelaMapper.getAccountId(loginUser.getSiteId(),loginUser.getCustomerId(),accountnumber);
|
|
@@ -1029,14 +1069,14 @@ public class AsyncTaskImportService {
|
|
|
failTime++ ;
|
|
|
msg +="客户编码【"+accountnumber+"】用水性质不能为空,";
|
|
|
log.info("客户编码【"+accountnumber+"】用水性质不能为空,");
|
|
|
- //c_remark.setCellValue("客户编码【"+accountnumber+"】住房类型不能为空,");
|
|
|
+ c_remark.setCellValue("客户编码【"+accountnumber+"】用水性质不能为空,");
|
|
|
continue;
|
|
|
}
|
|
|
if(office == null){
|
|
|
failTime++ ;
|
|
|
msg+="客户编码【"+accountnumber+"】机构信息有误,";
|
|
|
log.info("客户编码【"+accountnumber+"】机构信息有误,");
|
|
|
- //c_remark.setCellValue("客户编码【"+accountnumber+"】机构信息有误,");
|
|
|
+ c_remark.setCellValue("客户编码【"+accountnumber+"】机构信息有误,");
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -1045,7 +1085,7 @@ public class AsyncTaskImportService {
|
|
|
failTime++ ;
|
|
|
msg +="【"+accountnumber+"】添加开户失败,客户信息有误,";
|
|
|
log.info("【"+accountnumber+"】添加开户失败,客户信息有误,");
|
|
|
- //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,客户信息有误,");
|
|
|
+ c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,客户信息有误,");
|
|
|
continue;
|
|
|
//throw new ServiceException(ResultStatus.PAY_ADD_CUSTOMER_GETACCOUNT);
|
|
|
}
|
|
@@ -1053,7 +1093,7 @@ public class AsyncTaskImportService {
|
|
|
failTime++ ;
|
|
|
msg += "【"+accountnumber+"】添加开户失败,水表信息有误,";
|
|
|
log.info("【"+accountnumber+"】添加开户失败,水表信息有误,");
|
|
|
- //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,水表信息有误,");
|
|
|
+ c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,水表信息有误,");
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -1064,11 +1104,26 @@ public class AsyncTaskImportService {
|
|
|
failTime++ ;
|
|
|
msg +="【"+accountnumber+"】添加开户失败,该客户未验收,";
|
|
|
log.info("【"+accountnumber+"】添加开户失败,该客户未验收,");
|
|
|
- //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户未验收,");
|
|
|
+ c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户未验收,");
|
|
|
continue;
|
|
|
}
|
|
|
Integer value = 0;
|
|
|
customer.setVatno(vatno);
|
|
|
+
|
|
|
+ PayBaseAccount saveAccount = payBaseAccountMapper.get(accounts.getId());
|
|
|
+ if(idtype != null && idtype != ""){
|
|
|
+ value = paySysDictService.getDictValue("证件类型",idtype,siteId,customerId);
|
|
|
+ saveAccount.setIdtype(value);
|
|
|
+ if(value != null && StringUtils.isBlank(idcardno)){
|
|
|
+ failTime++ ;
|
|
|
+ msg += "【"+accountnumber+"】添加开户失败,证件号码不能为空,";
|
|
|
+ log.info("【"+accountnumber+"】添加开户失败,证件号码不能为空,");
|
|
|
+ c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,证件号码不能为空,");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ saveAccount.setIdcardno(idcardno);
|
|
|
+ }
|
|
|
+
|
|
|
//判断客户是否销户后在开户
|
|
|
PayBaseCustomerandmeterrela baseCustomer = payBaseCustomerandmeterrelaMapper.queryCancelInfo(loginUser.getSiteId(),loginUser.getCustomerId(),accountnumber,metercode);
|
|
|
if(baseCustomer != null && baseCustomer.getBusinessstate() != 1){
|
|
@@ -1085,7 +1140,7 @@ public class AsyncTaskImportService {
|
|
|
failTime++ ;
|
|
|
msg += "【"+accountnumber+"】添加开户失败,结算水量不能为空,";
|
|
|
log.info("【"+accountnumber+"】添加开户失败,结算水量不能为空,");
|
|
|
- //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户已存在,");
|
|
|
+ c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,结算水量不能为空,");
|
|
|
continue;
|
|
|
}
|
|
|
customer.setFixedamount(BigDecimal.valueOf(Double.valueOf(fixedamount)));//固定量
|
|
@@ -1111,7 +1166,7 @@ public class AsyncTaskImportService {
|
|
|
failTime++ ;
|
|
|
msg += "【"+accountnumber+"】添加开户失败,该客户已存在,";
|
|
|
log.info("【"+accountnumber+"】添加开户失败,该客户已存在,");
|
|
|
- //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户已存在,");
|
|
|
+ c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户已存在,");
|
|
|
continue;
|
|
|
}
|
|
|
|
|
@@ -1126,7 +1181,7 @@ public class AsyncTaskImportService {
|
|
|
failTime++ ;
|
|
|
msg += "【"+accountnumber+"】添加开户失败,结算水量不能为空,";
|
|
|
log.info("【"+accountnumber+"】添加开户失败,结算水量不能为空,");
|
|
|
- //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户已存在,");
|
|
|
+ c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,结算水量不能为空,");
|
|
|
continue;
|
|
|
}
|
|
|
customer.setFixedamount(BigDecimal.valueOf(Double.valueOf(fixedamount)));//固定量
|
|
@@ -1160,20 +1215,7 @@ public class AsyncTaskImportService {
|
|
|
}
|
|
|
|
|
|
//修改客户信息
|
|
|
- PayBaseAccount saveAccount = payBaseAccountMapper.get(accounts.getId());
|
|
|
saveAccount.setName(accountnameCell.getStringCellValue());
|
|
|
- if(idtype != null && idtype != ""){
|
|
|
- value = paySysDictService.getDictValue("证件类型",idtype,siteId,customerId);
|
|
|
- saveAccount.setIdtype(value);
|
|
|
- if(value != null && StringUtils.isBlank(idcardno)){
|
|
|
- failTime++ ;
|
|
|
- msg += "【"+accountnumber+"】添加开户失败,证件号码不能为空,";
|
|
|
- log.info("【"+accountnumber+"】添加开户失败,证件号码不能为空,");
|
|
|
- //c_remark.setCellValue( "【"+accountnumber+"】添加开户失败,该客户已存在,");
|
|
|
- continue;
|
|
|
- }
|
|
|
- saveAccount.setIdcardno(idcardno);
|
|
|
- }
|
|
|
saveAccount.setTelephone(telephone);
|
|
|
saveAccount.setMobilephone(telephone);
|
|
|
saveAccount.setId(accounts.getId());
|