|
|
|
@@ -52,6 +52,8 @@ import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
import java.util.regex.Matcher; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
@@ -112,11 +114,28 @@ public class AsyncTask { |
|
|
|
if (value == null) { |
|
|
|
value = ""; |
|
|
|
} |
|
|
|
//管理员手机号校验手机号格式 |
|
|
|
if ("管理员手机号".equals(name)) { |
|
|
|
String _v = (String)value; |
|
|
|
if (StringUtils.isNotBlank(_v) && (!isMobile(_v))) { |
|
|
|
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"管理员手机号必须是移动号码"); |
|
|
|
} |
|
|
|
} |
|
|
|
return super.importHandler(obj, name, value); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private static boolean isMobile(String str) { |
|
|
|
Pattern p = null; |
|
|
|
Matcher m = null; |
|
|
|
boolean b = false; |
|
|
|
p = Pattern.compile("^[1][3,4,5,7,8][0-9]{9}$"); // 验证手机号 |
|
|
|
m = p.matcher(str); |
|
|
|
b = m.matches(); |
|
|
|
return b; |
|
|
|
} |
|
|
|
|
|
|
|
private class CardPriceExcelHandler extends ExcelDataHandlerDefaultImpl<WxCardPriceTemplate> { |
|
|
|
@Override |
|
|
|
public Object importHandler(WxCardPriceTemplate obj, String name, Object value) { |
|
|
|
@@ -547,7 +566,7 @@ public class AsyncTask { |
|
|
|
WxMerchant merchant = wxMerchantService.initMerchantByPoi(user,poiBase.getPoiName(), poiBase.getPoiId(),poiBase.getPhone()); |
|
|
|
poiBase.setMerchantId(String.valueOf(merchant.getId())); |
|
|
|
poiBase.setMerchantName(merchant.getName()); |
|
|
|
poiBase.setInitMerchantRemark("初始化商户成功."); |
|
|
|
poiBase.setInitMerchantRemark("初始化商户成功."+StringUtils.trimToEmpty(merchant.getInitLog())); |
|
|
|
}catch(Exception e) { |
|
|
|
poiBase.setInitMerchantRemark("初始化商户失败."+e.getMessage()); |
|
|
|
} |
|
|
|
|