| | |
| | | import org.yeshi.utils.mail.ShowMail;
|
| | |
|
| | | import com.yeshi.fanli.entity.elme.ElmeOrder;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | |
| | | String content = null;
|
| | |
|
| | | String columnName = firstRow.getCell(c).getStringCellValue().trim();
|
| | | if (cell == null)
|
| | | continue;
|
| | | if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
|
| | | if (HSSFDateUtil.isCellDateFormatted(cell)) { // 判断日期类型
|
| | | Date date = cell.getDateCellValue();
|
| | | content = TimeUtil.getGernalTime(date.getTime(), "yyyy-MM-dd");
|
| | | } else { // 否
|
| | | content = cell.getNumericCellValue() + "";
|
| | | content = cell.getNumericCellValue() + "";
|
| | | }
|
| | |
|
| | | } else if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
|
| | |
| | | }
|
| | | switch (columnName) {
|
| | | case "渠道号":
|
| | | order.setChannelId(new BigDecimal(content).longValue()+"");
|
| | | order.setChannelId(new BigDecimal(content).longValue() + "");
|
| | | break;
|
| | | case "渠道名称":
|
| | | order.setChannelName(content);
|
| | |
| | | order.setTrackPid(content);
|
| | | break;
|
| | | case "rid":
|
| | | order.setRid(new BigDecimal(content).longValue()+"");
|
| | | order.setRid(new BigDecimal(content).longValue() + "");
|
| | | break;
|
| | | case "订单日期":
|
| | | order.setOrderDate(new Date(TimeUtil.convertToTimeTemp(content, "yyyy-MM-dd")));
|
| | |
| | | for (int i = list.size() - 1; i >= 0; i--) {
|
| | | ShowMail showMail = new ShowMail((MimeMessage) list.get(i));
|
| | | if ("qiuming.wu<qiuming.wu@ele.me>".equalsIgnoreCase(showMail.getFrom())) {
|
| | | if (count++ > 4)
|
| | | if (count++ > 5)
|
| | | break;
|
| | | boolean attch = showMail.isContainAttach((Part) list.get(i));
|
| | | if (attch) {
|
| | | List<InputStream> attchList = showMail.saveAttachMent((Part) list.get(i));
|
| | | if (attchList.size() > 0) {
|
| | | List<ElmeOrder> orderList = ElmeOrderUtil.parseOrder(attchList.get(0));
|
| | | if (orderList != null && orderList.size() > 0)
|
| | | totalOrderList.addAll(orderList);
|
| | | try {
|
| | | boolean attch = showMail.isContainAttach((Part) list.get(i));
|
| | | if (attch) {
|
| | | List<InputStream> attchList = showMail.saveAttachMent((Part) list.get(i));
|
| | | if (attchList.size() > 0) {
|
| | | List<ElmeOrder> orderList = ElmeOrderUtil.parseOrder(attchList.get(0));
|
| | | if (orderList != null && orderList.size() > 0)
|
| | | totalOrderList.addAll(orderList);
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | return totalOrderList;
|
| | | }
|