Pārlūkot izejas kodu

老用户回馈页面

wangxiaoming 6 gadi atpakaļ
vecāks
revīzija
3aed5bee31

+ 10 - 0
watero-common-core/src/main/java/com/iamberry/wechat/core/entity/thanksgiving/ThanksGiving.java

@@ -21,6 +21,8 @@ public class ThanksGiving  implements  Serializable{
     private String thanksGivingOpenId;
     //领取的优惠券id'
     private String couponItemId;
+    //领取的优惠券id'
+    private String thanksGivingName;
 
     public Integer getThanksGivingId(){
         return thanksGivingId;
@@ -69,4 +71,12 @@ public class ThanksGiving  implements  Serializable{
     public void setCouponItemId(String couponItemId) {
         this.couponItemId = couponItemId;
     }
+
+    public String getThanksGivingName() {
+        return thanksGivingName;
+    }
+
+    public void setThanksGivingName(String thanksGivingName) {
+        this.thanksGivingName = thanksGivingName;
+    }
 }

+ 9 - 0
watero-wechat-interface/src/main/java/com/iamberry/wechat/face/thanksgiving/ThanksGivingService.java

@@ -16,12 +16,21 @@ public interface ThanksGivingService {
      * @return List
      */
     List<ThanksGiving> getThanksGivingList(ThanksGiving thanksGiving);
+
     /**
      * 查询单条数据
      * @param  id
      * @return  thanksGiving
      */
     ThanksGiving  getThanksGivingById(Integer  id);
+
+    /**
+     * 查询手机号码
+     * @param  phone
+     * @return  thanksGiving
+     */
+    ThanksGiving  getThanksGivingByPhone(String  phone);
+
     /**
      * 增加数据
      * @param  thanksGiving

+ 8 - 0
watero-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/ThanksGivingMapper.java

@@ -22,6 +22,14 @@ public interface ThanksGivingMapper {
      * @return  thanksGiving
      */
     ThanksGiving  getThanksGivingById(Integer  id);
+
+    /**
+     * 查询手机号码
+     * @param  phone
+     * @return  thanksGiving
+     */
+    ThanksGiving  getThanksGivingByPhone(String  phone);
+
     /**
      * 增加数据
      * @param  thanksGiving

+ 10 - 0
watero-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/thanksGivingMapper.xml

@@ -45,6 +45,14 @@
         from tb_iamberry_thanks_giving t
         where t.thanks_giving_id= #{thanksGivingId}
     </select>
+
+    <select id="getThanksGivingByPhone" resultMap="BaseResultMap" parameterType="String" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_thanks_giving t
+        where  t.thanks_giving_phone = #{thanksGivingPhone}
+    </select>
+
     <insert id="save" parameterType="ThanksGiving" >
         insert into
         tb_iamberry_thanks_giving
@@ -53,6 +61,7 @@
         thanks_giving_status,
         thanks_giving_time,
         thanks_giving_open_id,
+        thanks_giving_name,
         coupon_item_id
         )
         values
@@ -61,6 +70,7 @@
         #{thanksGivingStatus},
         #{thanksGivingTime},
         #{thanksGivingOpenId},
+        #{thanksGivingName},
         #{couponItemId}
         )
     </insert>

+ 6 - 0
watero-wechat-service/src/main/java/com/iamberry/wechat/service/thanksgiving/ThanksGivingServiceImpl.java

@@ -52,6 +52,12 @@ public class ThanksGivingServiceImpl  implements ThanksGivingService {
     public  ThanksGiving  getThanksGivingById(Integer  id){
         return  thanksGivingMapper.getThanksGivingById(id);
     }
+
+    @Override
+    public ThanksGiving getThanksGivingByPhone(String phone) {
+        return  thanksGivingMapper.getThanksGivingByPhone(phone);
+    }
+
     /**
      * 增加数据
      * @param  thanksGiving

+ 12 - 0
watero-wechat-web/pom.xml

@@ -57,6 +57,18 @@
 			<version>1.0.20</version>
 		</dependency>
 
+		<!-- POI -->
+		<dependency>
+			<groupId>org.apache.poi</groupId>
+			<artifactId>poi-ooxml</artifactId>
+			<version>3.14</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.poi</groupId>
+			<artifactId>poi-ooxml-schemas</artifactId>
+			<version>3.14</version>
+		</dependency>
+
 		<!-- 解析User-Agent -->
 		<dependency>
 			<groupId>User-Agent-Utils</groupId>

+ 63 - 0
watero-wechat-web/src/main/java/com/iamberry/wechat/handles/official/ProspectusHandler.java

@@ -2,13 +2,17 @@ package com.iamberry.wechat.handles.official;
 
 import com.iamberry.wechat.core.entity.ResultMsg;
 import com.iamberry.wechat.core.entity.official.Prospectus;
+import com.iamberry.wechat.core.entity.thanksgiving.ThanksGiving;
 import com.iamberry.wechat.face.official.ProspectusService;
+import com.iamberry.wechat.face.thanksgiving.ThanksGivingService;
+import com.iamberry.wechat.utils.ExcelUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -20,6 +24,8 @@ public class ProspectusHandler {
 
 	@Autowired
 	ProspectusService prospectusService;
+	@Autowired
+	private ThanksGivingService thanksGivingService;
 
 	/**
 	 *
@@ -50,4 +56,61 @@ public class ProspectusHandler {
 	}
 
 
+	/**
+	 *
+	 * @param request
+	 * @return
+	 * @throws Exception
+	 */
+	@ResponseBody
+//	@RequestMapping("/export_excel")
+	public ResultMsg exportExcel(HttpServletRequest request) throws Exception {
+		String filePath = "E:\\java-work\\iamberry-watero\\watero-wechat-web\\src\\test\\java\\excel.xls";
+		ResultMsg remsg=new ResultMsg();
+		List<String> phoneList = new ArrayList<String>();
+		List<String> nameList = new ArrayList<String>();
+		List<String> landlineList = new ArrayList<String>();
+		try {
+			phoneList = ExcelUtil.readCell(filePath, "手机号码");
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		for (int i=0;i<phoneList.size();i++) {
+			String phone = phoneList.get(i);
+			phone = phone.replaceAll("\r|\n|\t", "");
+			try{
+				String[] phones = phone.split("@");
+				String name = phones[0];
+				phone = phones[1];
+				if (phone.length() == 11) {
+					ThanksGiving thanksGiving = thanksGivingService.getThanksGivingByPhone(phone);
+					if(thanksGiving == null){
+						ThanksGiving tg = new ThanksGiving();
+						tg.setThanksGivingPhone(phone);
+						tg.setThanksGivingStatus(1);
+						tg.setThanksGivingName(name);
+						Integer flag = thanksGivingService.save(tg);
+						if(flag < 1){
+							landlineList.add(phone);
+						}
+					}
+				} else {
+					landlineList.add(phone);
+				}
+			}catch (Exception e){
+				e.printStackTrace();
+				landlineList.add(phone);
+			}
+		}
+
+		System.out.println("========kaishi============");
+		//格式不对的手机号码
+		for (String landline : landlineList) {
+			System.out.println(landline);
+		}
+		System.out.println("========结束============");
+		return remsg;
+	}
+
 }

+ 505 - 0
watero-wechat-web/src/main/java/com/iamberry/wechat/utils/ExcelUtil.java

@@ -0,0 +1,505 @@
+package com.iamberry.wechat.utils;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+import java.io.*;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+/**
+ * Excel工具类
+ *
+ * @author 献
+ * @company 深圳爱贝源科技有限公司
+ * @website www.iamberry.com
+ * @tel 18271840547
+ * @date 2017/5/25
+ */
+@Component
+public class ExcelUtil {
+
+    private static final org.slf4j.Logger logger = LoggerFactory.getLogger(ExcelUtil.class);
+
+    /**
+     * 读取Excel文件头
+     *
+     * @param filePath
+     * @return
+     */
+    public static List<String> readExcelHead(String filePath) throws IOException {
+        List<String> heads = new ArrayList<String>();
+        // 判断文件是否存在
+        File file = new File(filePath);
+        if (!file.exists()) {
+            return null;
+        }
+        // 获取Workbook
+        InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
+        Workbook wb = null;
+        if (filePath.endsWith("xls")) {
+            wb = new HSSFWorkbook(inputStream);
+        } else {
+            wb = new XSSFWorkbook(inputStream);
+        }
+        inputStream.close();
+
+        // 获取Sheet
+        Sheet sheet = wb.getSheetAt(0);
+        // 获取第一行数据
+        Row row = sheet.rowIterator().next();
+
+        Iterator<Cell> cells = row.cellIterator();
+        // 获得第一行的迭代器,并遍历cell
+        while (cells.hasNext()) {
+            Cell cell = cells.next();
+            heads.add(cell.getStringCellValue());
+        }
+
+        return heads;
+    }
+
+    /**
+     * 读取Excel内容
+     * 去除重复
+     *
+     * @param filePath
+     * @return
+     */
+    public static List<String> readCell(String filePath, String cellName) throws IOException {
+        // 判断文件是否存在
+        File file = new File(filePath);
+        if (!file.exists()) {
+            return null;
+        }
+        // 获取Workbook
+        InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
+        Workbook wb = null;
+        if (filePath.endsWith("xls")) {
+            wb = new HSSFWorkbook(inputStream);
+        } else {
+            wb = new XSSFWorkbook(inputStream);
+        }
+        inputStream.close();
+
+        // 获取Sheet
+        Sheet sheet = wb.getSheetAt(0);
+        Iterator<Row> rows = sheet.rowIterator();
+
+        // 获取第一行的数据,匹配到表头
+        int cellNum = -1;
+        Row row = rows.next();
+        Iterator<Cell> cells = row.cellIterator();
+        while (cells.hasNext()) {
+            Cell cell = cells.next();
+            if (cellName.trim().equals(cell.getStringCellValue().trim())) {
+                cellNum = cell.getColumnIndex();
+                break;
+            }
+        }
+        if (cellNum == -1) return null;
+
+        // 读取数据
+        Map<String, String> map = new HashMap<>();
+        while (rows.hasNext()) {
+            Row temp = rows.next();
+            Cell cell = temp.getCell(cellNum);
+            // 非空的列需要使用
+            if (cell == null) {
+                continue;
+            }
+            String name = getValue(cell);
+            if (name != null && !"".equals(name.trim())) {
+                String cellValue = getValue(cell);
+                if (map.get(cellValue) == null) {
+                    map.put(cellValue, cellValue);
+                }
+            }
+        }
+
+        // Map to List
+        Collection<String> valueCollection = map.values();
+        return new ArrayList<String>(valueCollection);
+    }
+
+    /**
+     * 读取Excel内容 -- 行数是否超过100,超过false  不超过true;
+     * @param filePath
+     * @return
+     */
+    public static boolean readExcelNumber(String filePath,Integer maxNuber) throws IOException {
+        // 判断文件是否存在
+        File file = new File(filePath);
+        if (!file.exists()) {
+            return false;
+        }
+        // 获取Workbook
+        InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
+        Workbook wb = null;
+        if (filePath.endsWith("xls")) {
+            wb = new HSSFWorkbook(inputStream);
+        } else {
+            wb = new XSSFWorkbook(inputStream);
+        }
+        inputStream.close();
+
+        // 获取Sheet
+        Sheet sheet = wb.getSheetAt(0);
+
+        Integer number = 0;     //控制有效行数在maxNumber之内
+        Integer i = 0;         //控制总行数在MaxNumber之内,因为会出现无效行数的问题,如果一直循环,会循环65535行
+
+        Iterator<Row> rows = sheet.rowIterator();
+        while (rows.hasNext()) {
+            Row row = rows.next();
+            Cell cell = row.getCell(0);
+            // 非空的列需要使用
+            if (cell == null) {
+                continue;
+            }
+            String name = getValue(cell);
+            String cellValue = "";
+            if (name != null && !"".equals(name.trim())) {
+                cellValue = getValue(cell);
+            }
+
+            if (cellValue != null && !"".equals(cellValue)) {
+                number ++;
+            }
+            i++;
+
+            if(number > maxNuber+1){
+                return false;
+            }
+
+            if(i > maxNuber+1){
+                break;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * 读取Excel内容
+     * 不去除重复
+     *
+     * @param filePath
+     * @return
+     */
+    public static List<String> readCell2(String filePath, String cellName) throws IOException {
+        // 判断文件是否存在
+        File file = new File(filePath);
+        if (!file.exists()) {
+            return null;
+        }
+        // 获取Workbook
+        InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
+        Workbook wb = null;
+        if (filePath.endsWith("xls")) {
+            wb = new HSSFWorkbook(inputStream);
+        } else {
+            wb = new XSSFWorkbook(inputStream);
+        }
+        inputStream.close();
+
+        // 获取Sheet
+        Sheet sheet = wb.getSheetAt(0);
+        Iterator<Row> rows = sheet.rowIterator();
+
+        // 获取第一行的数据,匹配到表头
+        int cellNum = -1;
+        Row row = rows.next();
+        Iterator<Cell> cells = row.cellIterator();
+        while (cells.hasNext()) {
+            Cell cell = cells.next();
+            if (cellName.trim().equals(cell.getStringCellValue().trim())) {
+                cellNum = cell.getColumnIndex();
+                break;
+            }
+        }
+        if (cellNum == -1) return null;
+
+        // 读取数据
+        ArrayList<String> arreyMap = new ArrayList<String>();
+        while (rows.hasNext()) {
+            Row temp = rows.next();
+            Cell cell = temp.getCell(cellNum);
+            // 非空的列需要使用
+            if (cell == null) {
+                continue;
+            }
+            String name = getValue(cell);
+            if (name != null && !"".equals(name.trim())) {
+                String cellValue = getValue(cell);
+                arreyMap.add(cellValue);
+            }
+        }
+
+        // Map to List
+        /*Collection<String> valueCollection = map.values();*/
+        return arreyMap;
+    }
+
+    /**
+     * 读取Excel内容(上传excel文档)
+     * 不去除重复
+     *
+     * @param filePath
+     * @return
+     */
+    public static List<String> readCell3(String filePath) throws IOException {
+        // 判断文件是否存在
+        File file = new File(filePath);
+        if (!file.exists()) {
+            return null;
+        }
+        // 获取Workbook
+        InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
+        Workbook wb = null;
+        if (filePath.endsWith("xls")) {
+            wb = new HSSFWorkbook(inputStream);
+        } else {
+            wb = new XSSFWorkbook(inputStream);
+        }
+        inputStream.close();
+
+        // 获取Sheet
+        Sheet sheet = wb.getSheetAt(0);
+        Iterator<Row> rows = sheet.rowIterator();
+
+        // 获取第一行的数据,匹配到表头
+        int cellNum = -1;
+        Row row = rows.next();
+        Iterator<Cell> cells = row.cellIterator();
+        while (cells.hasNext()) {
+            Cell cell = cells.next();
+                cellNum = cell.getColumnIndex();
+                break;
+        }
+        if (cellNum == -1) return null;
+
+        // 读取数据
+        ArrayList<String> arreyMap = new ArrayList<String>();
+        while (rows.hasNext()) {
+            Row temp = rows.next();
+            Cell cell = temp.getCell(cellNum);
+            // 非空的列需要使用
+            if (cell == null) {
+                continue;
+            }
+            String name = getValue(cell);
+            if (name != null && !"".equals(name.trim())) {
+                String cellValue = getValue(cell);
+                arreyMap.add(cellValue);
+            }
+        }
+
+        // Map to List
+        /*Collection<String> valueCollection = map.values();*/
+        return arreyMap;
+    }
+
+    /**
+     *获取值
+     * @param cell
+     * @return
+     */
+    private static Object getExcelCell(Cell cell){
+        Object obj;
+        if (null != cell) {
+            switch (cell.getCellType()) {
+                case HSSFCell.CELL_TYPE_NUMERIC: // 数字
+                    double cellValue = cell.getNumericCellValue();
+                    obj = new DecimalFormat("#").format(cellValue);
+                    break;
+                case HSSFCell.CELL_TYPE_STRING: // 字符串
+                    obj = cell.getStringCellValue();
+                    break;
+                case HSSFCell.CELL_TYPE_BOOLEAN: // Boolean
+                    obj = cell.getBooleanCellValue();
+                    break;
+                case HSSFCell.CELL_TYPE_FORMULA: // 公式
+                    obj = cell.getCellFormula();
+                    break;
+                case HSSFCell.CELL_TYPE_BLANK: // 空值
+                    obj = "";
+                    break;
+                case HSSFCell.CELL_TYPE_ERROR: // 故障
+                    obj = "";
+                    break;
+                default:
+                    obj = "";
+                    break;
+            }
+        } else {
+            obj = "";
+        }
+        return obj;
+    }
+
+    /**
+     * 地址 - 整体切割符
+     */
+    private static String[] ENTIRETY_SPLIT;
+
+    /**
+     * 地址 - 省份数据切割符
+     */
+    private static String[][] PROVINCE_CITY_AERA_SPLIT;
+
+    static {
+        ENTIRETY_SPLIT = new String[]{" ", "-", "_", "*"};
+        PROVINCE_CITY_AERA_SPLIT = new String[][]{
+                {"省", "市", "区"},
+                {"省", "市", "县"},
+                {"省", "市", "乡"},
+                {"省", "市", "镇"},
+                {"省", "市", "市"},
+
+                {"自治区", "市", "区"},
+                {"自治区", "市", "县"},
+                {"自治区", "市", "乡"},
+                {"自治区", "市", "镇"},
+                {"自治区", "市", "市"},
+
+                {"省", "州", "区"},
+                {"省", "州", "县"},
+                {"省", "州", "乡"},
+                {"省", "州", "市"},
+                {"省", "州", "镇"},
+
+                {"市", "市", "区"},
+                {"市", "市", "县"},
+                {"市", "市", "镇"},
+                {"市", "市", "乡"},
+
+                {"市", "区"},
+                {"市", "乡"},
+                {"市", "镇"},
+                {"市", "县"},
+
+                {"省", "县", "镇"}
+        };
+    }
+
+    /**
+     * 切割地址
+     */
+    private static String[] splitAddress(String addrInfo) {
+        String[] addrs = null;
+
+        // 首先通过整体切割符合切割
+        for (String charSplit : ENTIRETY_SPLIT) {
+            addrs = StringUtils.split(addrInfo, charSplit);
+            if (addrs != null && addrs.length >= 4) {
+                break;
+            } else if (addrs != null && addrs.length == 3 && !addrs[0].contains("省")) {
+                break;
+            }
+        }
+
+        // 详细地址不能直接切割
+        if (addrs != null && addrs.length >= 4) {
+            // 防止区域数据出现小区 扰乱数据
+            if (!addrs[2].contains("小区")) {
+                return new String[]{addrs[0], addrs[1], addrs[2], addrInfo};
+            }
+
+        } else if (addrs != null && addrs.length == 3) {
+            // 防止区域数据出现小区 扰乱数据
+            if (!addrs[1].contains("小区")) {
+                return new String[]{addrs[0], addrs[0], addrs[1], addrInfo};
+            }
+        }
+
+        for (String[] splits : PROVINCE_CITY_AERA_SPLIT) {
+
+            // 每组独立切割字符单独循环
+            String tempInfo = addrInfo;
+            addrs = new String[splits.length + 1];
+            boolean isNext = false;
+            for (int i = 0; i < splits.length; i++) {
+                String splitChar = splits[i];
+                String[] temps = StringUtils.split(tempInfo, splitChar);
+                if (temps.length >= 2) {
+                    // 获取到第一个地址
+                    addrs[i] = temps[0] + splitChar;
+                    // 下一次迭代内容
+                    tempInfo = StringUtils.substring(tempInfo, temps[0].length() + splitChar.length());
+                } else {
+                    // 如果首次匹配失败,则停止匹配
+                    isNext = true;
+                    break;
+                }
+            }
+            if (!isNext) {
+                if ((addrs.length - 1) == 2) {
+                    // 防止区域数据出现小区 扰乱数据
+                    if (addrs[1].contains("小区")) {
+                        continue;
+                    }
+                    // 只有两级地址
+                    return new String[]{addrs[0], addrs[0], addrs[1], addrInfo};
+                } else if ((addrs.length - 1) == 3) {
+                    // 防止区域数据出现小区 扰乱数据
+                    if (addrs[2].contains("小区")) {
+                        continue;
+                    }
+                    // 三级地址
+                    return new String[]{addrs[0], addrs[1], addrs[2], addrInfo};
+                }
+            }
+        }
+
+        return addrs;
+    }
+
+    public static void main(String[] args) throws IOException {
+        String[] add = splitAddress("海南省 临高县 博厚镇衍宏海港小镇(303县道西)衍宏海港小镇37栋602");
+        if (add == null) {
+            System.out.println("切割失败...");
+        }
+        for (String i : add) {
+            System.out.println(i);
+        }
+    }
+
+    private static SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
+
+    public static String getValue(Cell cell) {
+        if (cell == null) return null;
+        switch (cell.getCellType()) {
+            case Cell.CELL_TYPE_STRING: //文本
+                return cell.getStringCellValue();
+            case Cell.CELL_TYPE_NUMERIC: //数字、日期
+                if (DateUtil.isCellDateFormatted(cell)) {
+                    return fmt.format(cell.getDateCellValue()); //日期型
+                }
+                DecimalFormat df = new DecimalFormat("#");
+                return df.format(new Double(cell.getNumericCellValue())); //数字
+            case Cell.CELL_TYPE_BOOLEAN: //布尔型
+                return String.valueOf(cell.getBooleanCellValue());
+            case Cell.CELL_TYPE_BLANK: //空白
+                return cell.getStringCellValue();
+            default: //错误
+                return "ERROR";
+        }
+    }
+
+    /**
+     * excel 强制获取text文本
+     * @param cell
+     * @return
+     */
+    public static String getTextValue(Cell cell) {
+        if (cell == null) return null;
+        return cell.getStringCellValue();
+    }
+
+}

+ 8 - 0
watero-wechat-web/src/main/resources/jdbc.properties

@@ -1,7 +1,15 @@
 jdbc.driver=com.mysql.jdbc.Driver
+
 jdbc.url=jdbc:mysql://watero2db.mysql.rds.aliyuncs.com/test_watero?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
 jdbc.username=watero
 jdbc.password=wateroTech123
+
+
+#jdbc.url=jdbc:mysql://watero2db.mysql.rds.aliyuncs.com/watero?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&autoReconnect=true&failOverReadOnly=false&zeroDateTimeBehavior=convertToNull
+#jdbc.username=watero
+#jdbc.password=wateroTech123
+
+
 #pool settings
 jdbc.pool.init=1
 jdbc.pool.minIdle=3

+ 44 - 0
watero-wechat-web/src/test/java/SendMessages.java

@@ -0,0 +1,44 @@
+import com.iamberry.wechat.utils.ExcelUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 发送短信
+ */
+public class SendMessages {
+
+    static String filePath = "E:\\java-work\\iamberry-watero\\watero-wechat-web\\src\\test\\java\\excel.xls";
+
+    //手机校验
+    private final static String regExp = "^((13[0-9])|(15[^4])|(18[0,2,3,5-9])|(17[0-8])|(147))\\d{8}$";
+
+    public static void main(String[] args) {
+        List<String> phoneList = new ArrayList<String>();
+        List<String> landlineList = new ArrayList<String>();
+        try {
+            phoneList = ExcelUtil.readCell(filePath, "联系方式");
+        } catch (Exception e) {
+        }
+
+        for (String phone : phoneList) {
+            if (phone.length() == 11) {
+
+//                if (!falg)
+//                    landlineList.add(phone);
+            } else {
+                landlineList.add(phone);
+            }
+        }
+
+        //格式不对的手机号码
+        for (String landline : landlineList) {
+            System.out.println(landline);
+        }
+
+        return;
+    }
+
+
+
+}

BIN
watero-wechat-web/src/test/java/excel.xls