dd00f6b3abe7029ccdc4f021b65591018acebcab.svn-base
69.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
package com.espeed.action;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import com.espeed.centre.pojo.CentreYxyedmNewcustomer;
import com.espeed.centre.pojo.CentreYxyedmOldcustomer;
import com.espeed.centre.pojo.YxyUserInfo;
import com.espeed.log.LogClass;
import com.espeed.pojo.YxyNoshieldEmail;
import com.espeed.pojo.YxySendMailMaster;
import com.espeed.pojo.YxySendSmtpInfo;
import com.espeed.pojo.YxySendSysFilter;
import com.espeed.pojo.YxyShieldDomain;
import com.espeed.pojo.YxyUserAddress;
import com.espeed.pojo.YxyUserSet;
import com.espeed.service.YxyAddressManageService;
import com.espeed.service.YxyContextSetService;
import com.espeed.service.YxyCustomerService;
import com.espeed.service.YxyNoshieldEmailService;
import com.espeed.service.YxyReadingInfoService;
import com.espeed.service.YxySendFilterAddressService;
import com.espeed.service.YxySendMailService;
import com.espeed.service.YxySendSysFilterService;
import com.espeed.service.YxyShieldDomainService;
import com.espeed.service.YxySysParamaterService;
import com.espeed.service.YxyUnsubscribeInfoService;
import com.espeed.service.YxyUserInfoService;
import com.espeed.tool.ConfigPath;
import com.espeed.tool.DateFormat;
import com.espeed.tool.DomParseXml;
import com.espeed.tool.GetRandom;
import com.espeed.webmail.pojo.YxyCustomerEmail;
import com.opensymphony.xwork2.ActionContext;
/**
* 程序名称: EspeedMail_时速邮箱
* 程序版本: V1.0
* 作 者: 深圳市科飞时速网络技术有限公司(0755-88843776)
* 版权所有: 深圳市科飞时速网络技术有限公司
* 技术支持: Tech@21gmail.com
* 单元名称: 邮件发送Action
* 开始时间: 2013.10.22
* 程 序 员: 谢勇
* 最后修改:
* 备 注: 邮件处理(营销)
*/
public class YxySendMailAction extends BaseAction{
private static final long serialVersionUID = 1L;
public final String emailreg=ConfigPath.getEmailYZ();//"[a-zA-Z0-9.-\\\\-_]{1,30}@[a-zA-Z0-9.-]{1,40}\\.(?!gif|jpg|png|pdf)[a-zA-Z]{2,10}";
/**判断是否有警示或者过滤(系统)*/
public String findWarnString(){
listResult.add("1");//当发送的邮件不包括警告内容和过滤内容,就返回1正常发送
try {
//获取用户session
ActionContext ac = ActionContext.getContext();
Map<String,Object> sess = ac.getSession();
YxyUserInfo user=(YxyUserInfo) sess.get("yxyuser");
loginid=user.getLogin_id();//用户账号
domain=user.getDomain();//用户所属域名
//查询所有过滤字符(系统级的)
List<YxySendSysFilter> filterlist=yxysendsysfilterservice.findAllFilterStr();
//警示字符
String warnString="";
//过滤字符
String fiterString="";
//当数据库存在多个警告字符和过滤字符时,要进行截取
String str1 = "";//过滤字符
String str2 = "";//警告字符
//循环判断
for(int i=0;i<filterlist.size();i++){
warnString=filterlist.get(i).getWarnstring();//警示字符
fiterString=filterlist.get(i).getFilterstring();//过滤字符
//过滤字符
if(fiterString!=null&&!"".equals(fiterString)){
if((title.indexOf(fiterString)!=-1||context.indexOf(fiterString)!=-1)){
str1 += fiterString + ";";
/*listResult.add("-2");
listResult.add(fiterString);
return "filter";*/
}
}
//警告字符
if(warnString!=null&&!warnString.equals("")){
if((title.indexOf(warnString)!=-1||context.indexOf(warnString)!=-1)){
str2 += warnString + ";";
/*listResult.add("-1");
listResult.add(warnString);
return "filter";*/
}
}
}
//1.当过滤字符不为"",警告字符为""
if(!str1.equals("") && str2.equals(""))
{
listResult.set(0, "-2");
listResult.add(str1);
}
//2.当警告字符不为"",过滤字符为""
if(!str2.equals("") && str1.equals("")){
listResult.set(0, "-1");
listResult.add(str2);
}
//3.当过滤字符和警告字符都不为""
if(!str2.equals("") && !str1.equals("")){
listResult.set(0, "-2");
listResult.add(str1);
}
} catch (Exception e) {
listResult.set(0, "0");
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
LogClass.errolog(str,loginid+"@"+domain);
}
return "filter";
}
/**导入地址*/
public String importAddress(){
try{
//定义反回值
importmap.put("result",0);//导入是否成功
importmap.put("success",0);//成功量
importmap.put("tolnum",0);//文件总量
importmap.put("unnum",0);//退订量
importmap.put("fcnum",0);//文件重复
importmap.put("scnum",0);//系统重复
importmap.put("nonum",0);//不合法量
importmap.put("crmnum",0);//crm库重复
importmap.put("selfnum",0);//本地库重复
importmap.put("filtercustomnum",0);//用户自定义过滤地址量
importmap.put("filtersysnum",0);//系统屏蔽量
importaddress.put("unaddr","");//退订地址
importaddress.put("fcaddr","");//文件重复地址
importaddress.put("scaddr","");//系统重复地址
importaddress.put("noaddr","");//不合法地址
importaddress.put("crmaddr","");//crm库重复
importaddress.put("selfaddr","");//本地库重复
importaddress.put("filtercustom","");//用户自定义过滤地址
importaddress.put("filtersys","");//系统屏蔽
String unaddr="";//退订地址
String fcaddr="";//文件重复地址
String scaddr="";//系统重复地址
String noaddr="";//不合法地址
String filtercustom="";//用户自定义过滤地址
String filtersys="";//系统屏蔽地址
String crmaddr="";//crm库重复
String selfaddr="";//本地库重复
//变量定义
int filelinenum=0;//文本行数
String filterstr="";//过滤字符
String filetype="";//文件类型
int filemaxline=0;//导入地址最大行数
//获取用户session
ActionContext ac = ActionContext.getContext();
Map<String,Object> sess = ac.getSession();
YxyUserInfo user=(YxyUserInfo) sess.get("yxyuser");
loginid=user.getLogin_id();//用户账号
domain=user.getDomain();//用户所属域名
//清除之前的sess
sess.remove("sendaddress");
//时间定义
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nowdate=df.format(new Date());
//读取上传文件路径
String addressFilePath=yxyaddr.getPath();
//判断文件格式是否正确
int i=addrfilename.lastIndexOf(".");
filetype=addrfilename.substring(i + 1);
//如是不是txt与xls类型文件则无法导入
if(!"txt".equals(filetype)&&!"xls".equals(filetype)&&!"xlsx".equals(filetype)){
importmap.put("result",-1);//不支持的文件类型
return "map";
}
//导入地址最大行数
filemaxline=ConfigPath.getFilemaxline();
//文件是否为空判断
if("txt".equals(filetype)){
filelinenum=DomParseXml.getTxtLineNum(addressFilePath);//txt文件条数
importmap.put("tolnum",filelinenum-1);//文件条数
if(filelinenum<=1){
importmap.put("result",-2);//文件无任何数据
return "map";
}else if(filelinenum>filemaxline){
importmap.put("result",-3);
importmap.put("scnum",filemaxline);
return "map";
}
}else if("xls".equals(filetype)){
InputStream in=new FileInputStream(new File(addressFilePath));
HSSFWorkbook wb = new HSSFWorkbook(in);
HSSFSheet sheet = wb.getSheetAt(0);//读取第一个工作表
filelinenum=sheet.getLastRowNum() + 1;//xls文件条数
importmap.put("tolnum",filelinenum-1);//文件条数
//判断是否有数据
if(filelinenum<=1){
importmap.put("result",-2);//文件无任何数据
return "map";
}else if(filelinenum>filemaxline){
importmap.put("result",-3);
importmap.put("scnum",filemaxline);
return "map";
}
}else if("xlsx".equals(filetype)){
InputStream in=new FileInputStream(new File(addressFilePath));
XSSFWorkbook workbook = new XSSFWorkbook(in);
XSSFSheet sheet = workbook.getSheetAt(0);
filelinenum=sheet.getLastRowNum() + 1;//xls文件条数
importmap.put("tolnum",filelinenum-1);//文件条数
//判断是否有数据
if(filelinenum<=1){
importmap.put("result",-2);//文件无任何数据
return "map";
}else if(filelinenum>filemaxline){
importmap.put("result",-3);
importmap.put("scnum",filemaxline);
return "map";
}
}
//查询用户个人设置
List<YxyUserSet> yxyuserset=yxysendmailservice.findUserSet(loginid,domain);
if(yxyuserset.size()>0){//有用户设置
//用户过滤的字符
filterstr=yxyuserset.get(0).getUser_set_fiterStr();
}
//查询用户地址库
List<Object> alllist = new ArrayList<Object>();
if(user.getUser_type() == 1){//营销邮用户有地址库,易外销用户没有地址库
alllist=yxyaddressmanageservice.findUserAllAddress(loginid,domain);
}
//查询用户退订地址
List<Object> unalllist=yxyunsubscribeinfoservice.findAllUnEmali(loginid,domain);
//可发地址对象
List<YxyUserAddress> sendAddrList = new ArrayList<YxyUserAddress>();
//查询屏蔽的域名
List<YxyShieldDomain> shielddoamin=shielddomainservice.findAllList();
//查询不屏蔽的邮件地址
List<YxyNoshieldEmail> noshieldemail=noshieldemailservice.findAllList();
//文本文件的地址集合
List<String> fileEmail=new ArrayList<String>();
//文件类型不同处理方案
if("txt".equals(filetype)){
//解析文件
String tmpLineVal;
String encoding = "";
BufferedInputStream bin = new BufferedInputStream(new FileInputStream(addressFilePath));
int p = (bin.read() << 8) + bin.read();
switch (p) {
case 0xefbb:
encoding = "UTF-8";
break;
case 0xfffe:
encoding = "Unicode";
break;
case 0xfeff:
encoding = "UTF-16BE";
break;
default:
encoding = "GBK";
}
InputStreamReader in1 = new InputStreamReader(new FileInputStream(addressFilePath), encoding);
BufferedReader bufread1 = new BufferedReader(in1);
String line_record ="";
int next=0;
while((tmpLineVal = bufread1.readLine())!=null){
next++;
if(next==1){
continue;
}
// 解析每一条记录返回结果
line_record = tmpLineVal;//raf.readLine();
if(line_record!=null&&!line_record.equals("")){
//去掉空格
line_record =line_record.trim();
line_record = line_record.replace("<", "<");
//该行做判断(地址@后面只能有两个点且只能是数字字母)
String yz1[]=line_record.split("@");
//字符长度不能大于60
if(line_record.length()>60){
noaddr+=line_record+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}else if(yz1.length!=2){//最多两个.
noaddr+=line_record+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
//以字母结尾
byte b=yz1[1].getBytes()[yz1[1].length()-1];
if((b>=97&&b<=122)||(b>=65&&b<=90)){
//System.out.println(yz1[1]);
}else{
noaddr+=line_record+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
Pattern yz = Pattern.compile(emailreg);
Matcher m = yz.matcher(line_record);
line_record=line_record.replaceAll(" ", "");
if(m.matches()){//是正确的
//易外销用户才验证crm库
if(user.getUser_type() == 0){
//判断是不是在crm库中
int exits=yxyaddressmanageservice.findcrmisexits(user.getCompany_id(),line_record);
if(exits==2){
crmaddr+=line_record+",";
int crmnum=importmap.get("crmnum")+1;
importmap.put("crmnum",crmnum);//crm库重复
continue;
}
}
//验证地址
int parseresult=parseRecord(line_record,alllist,unalllist,shielddoamin,noshieldemail,fileEmail,filterstr);
fileEmail.add(line_record);
//可发
if(parseresult==0){
int success=importmap.get("success")+1;
importmap.put("success",success);//成功量
//加入对象
YxyUserAddress addr = new YxyUserAddress();
addr.setUser_addr_email(line_record);//地址
addr.setUser_addr_type_id(typeid);//所属类别ID
addr.setUser_addr_name("");//姓名
addr.setUser_addr_add_date(nowdate);//建立时间
addr.setUser_loginid(loginid);//用户账号
addr.setUser_domain(domain);//用户所属域名
addr.setUser_addr_sex("男");//性别
sendAddrList.add(addr);
}else if(parseresult>0){//本地库重复
selfaddr+=line_record+",";
int selfnum=importmap.get("selfnum")+1;
importmap.put("selfnum",selfnum);//本地库重复
}else if(parseresult==-1){//文件重复
fcaddr+=line_record+",";
int fcnum=importmap.get("fcnum")+1;
importmap.put("fcnum",fcnum);//文件重复
}else if(parseresult==-2){//退订
unaddr+=line_record+",";
int unnum=importmap.get("unnum")+1;
importmap.put("unnum",unnum);//退订
}else if(parseresult==-3){//用户自定义过滤
filtercustom+=line_record+",";
int filter=importmap.get("filtercustomnum")+1;
importmap.put("filtercustomnum",filter);//用户自定义过滤量
}else if(parseresult==-4){//数据库重复
scaddr+=line_record+",";
int scnum=importmap.get("scnum")+1;
importmap.put("scnum",scnum);//成功量
}else if(parseresult==-5){//系统过滤
filtersys+=line_record+",";
int sysscnum=importmap.get("filtersysnum")+1;
importmap.put("filtersysnum",sysscnum);//成功量
}
}else{
noaddr+=line_record+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
}else{
noaddr+=line_record+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
}
}
bufread1.close();
in1.close();
}else if("xls".equals(filetype)){
InputStream in=new FileInputStream(new File(addressFilePath));
HSSFWorkbook wb = new HSSFWorkbook(in);
HSSFSheet sheet = wb.getSheetAt(0);//读取第一个工作表
for(int j = 1; j < sheet.getLastRowNum() + 1; j++){
HSSFRow row = sheet.getRow(j);
String Mail_Addr_Name_Var="";
if(row!=null){
for(int k = 0; k < row.getLastCellNum(); k++){
HSSFCell cell = row.getCell((short) k);
if(cell!=null){
if (cell.getCellType() == HSSFCell.CELL_TYPE_BOOLEAN){
// 返回布尔类型的值
Mail_Addr_Name_Var += String.valueOf(cell.getBooleanCellValue()+",");
}else if (cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC){
// 返回数值类型的值
Mail_Addr_Name_Var +=""+",";
}else{
// 返回字符串类型的值
Mail_Addr_Name_Var += String.valueOf(cell.getStringCellValue()+",");
}
}
}
//处理数据
String email="";
String name="";
String company="";
String selfbl="";
String[] emailarry=Mail_Addr_Name_Var.split(",");
if(emailarry==null||emailarry.length<=0){
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
//去掉空格
email=emailarry[0].trim();
email = email.replace("<", "<");
if(emailarry.length>=2){
name=emailarry[1];
}
if(emailarry.length>=3){
company=emailarry[2];
}
if(emailarry.length>=4){
selfbl=emailarry[3];
}
//该行做判断(地址@后面只能有两个点且只能是数字字母)
String yz1[]=email.split("@");
//字符长度不能大于60
if(email.length()>60){
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}else if(yz1.length!=2){//最多两个.
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
//以字母结尾
byte b=yz1[1].getBytes()[yz1[1].length()-1];
if((b>=97&&b<=122)||(b>=65&&b<=90)){
//System.out.println(yz1[1]);
}else{
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
Pattern yz = Pattern.compile(emailreg);
Matcher m = yz.matcher(email);
email=email.replaceAll(" ", "");
if(m.matches()){//是正确的
//易外销用户才验证crm库
if(user.getUser_type() == 0){
//判断是不是在crm库中
int exits=yxyaddressmanageservice.findcrmisexits(user.getCompany_id(),email);
if(exits==2){
crmaddr+=email+",";
int crmnum=importmap.get("crmnum")+1;
importmap.put("crmnum",crmnum);//crm库重复
continue;
}
}
int parseresult=parseRecord(email,alllist,unalllist,shielddoamin,noshieldemail,fileEmail,filterstr);
fileEmail.add(email);
if(parseresult==0){//可发
int success=importmap.get("success")+1;
importmap.put("success",success);//成功量
//加入对象
YxyUserAddress addr = new YxyUserAddress();
addr.setUser_addr_type_id(typeid);//所属类别ID
addr.setUser_addr_name(name);//姓名
addr.setUser_addr_add_date(nowdate);//建立时间
addr.setUser_loginid(loginid);//用户账号
addr.setUser_domain(domain);//用户所属域名
addr.setUser_addr_sex("男");//性别
addr.setUser_addr_email(email);//email
addr.setCompanyname(company);
addr.setUser_addr_variable(selfbl);
sendAddrList.add(addr);
}else if(parseresult>0){//本地库重复
selfaddr+=email+",";
int selfnum=importmap.get("selfnum")+1;
importmap.put("selfnum",selfnum);//本地库重复
}else if(parseresult==-1){//文件重复
fcaddr+=email+",";
int fcnum=importmap.get("fcnum")+1;
importmap.put("fcnum",fcnum);//文件重复
}else if(parseresult==-2){//退订
unaddr+=email+",";
int unnum=importmap.get("unnum")+1;
importmap.put("unnum",unnum);//退订
}else if(parseresult==-3){//用户自定义过滤
filtercustom+=email+",";
int filter=importmap.get("filtercustomnum")+1;
importmap.put("filtercustomnum",filter);//用户自定义过滤量
}else if(parseresult==-4){//数据库重复
scaddr+=email+",";
int scnum=importmap.get("scnum")+1;
importmap.put("scnum",scnum);//成功量
}else if(parseresult==-5){//系统过滤
filtersys+=email+",";
int sysscnum=importmap.get("filtersysnum")+1;
importmap.put("filtersysnum",sysscnum);//成功量
}
}else{
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
}
}else{
noaddr+="为空,";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
}
}
}else if("xlsx".equals(filetype)){
InputStream in=new FileInputStream(new File(addressFilePath));
XSSFWorkbook workbook = new XSSFWorkbook(in);
XSSFSheet sheet = workbook.getSheetAt(0);
for (int j = 1; j < sheet.getLastRowNum() + 1; j++) {
XSSFRow row = sheet.getRow(j);
String MailAddrAndName="";
if(row!=null){
for(int k = 0; k < row.getLastCellNum(); k++){
XSSFCell cell = row.getCell((short) k);
if(cell!=null){
if (cell.getCellType() == HSSFCell.CELL_TYPE_BOOLEAN){
// 返回布尔类型的值
MailAddrAndName += String.valueOf(cell.getBooleanCellValue()+",");
}
else if (cell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC){
// 返回数值类型的值
MailAddrAndName +=""+",";
}else {
// 返回字符串类型的值
MailAddrAndName += String.valueOf(cell.getStringCellValue()+",");
}
}
}
//处理数据
String email="";
String name="";
String company="";
String selfbl="";
String[] emailarry=MailAddrAndName.split(",");
if(emailarry==null||emailarry.length<=0){
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
//去掉空格
email=emailarry[0].trim();
email = email.replace("<", "<");
if(emailarry.length>=2){
name=emailarry[1];
}
if(emailarry.length>=3){
company=emailarry[2];
}
if(emailarry.length>=4){
selfbl=emailarry[3];
}
//该行做判断(地址@后面只能有两个点且只能是数字字母)
String yz1[]=email.split("@");
//字符长度不能大于60
if(email.length()>60){
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}else if(yz1.length!=2){//最多两个.
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
//以字母结尾
byte b=yz1[1].getBytes()[yz1[1].length()-1];
if((b>=97&&b<=122)||(b>=65&&b<=90)){
//System.out.println(yz1[1]);
}else{
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
Pattern yz = Pattern.compile(emailreg);
Matcher m = yz.matcher(email);
email=email.replaceAll(" ", "");
if(m.matches()){//是正确的
//易外销用户才验证crm库
if(user.getUser_type() == 0){
//判断是不是在crm库中
int exits=yxyaddressmanageservice.findcrmisexits(user.getCompany_id(),email);
if(exits==2){
crmaddr+=email+",";
int crmnum=importmap.get("crmnum")+1;
importmap.put("crmnum",crmnum);//crm库重复
continue;
}
}
int parseresult=parseRecord(email,alllist,unalllist,shielddoamin,noshieldemail,fileEmail,filterstr);
fileEmail.add(email);
if(parseresult==0){//可发
int success=importmap.get("success")+1;
importmap.put("success",success);//成功量
//加入对象
YxyUserAddress addr = new YxyUserAddress();
addr.setUser_addr_type_id(typeid);//所属类别ID
addr.setUser_addr_name(name);//姓名
addr.setUser_addr_add_date(nowdate);//建立时间
addr.setUser_loginid(loginid);//用户账号
addr.setUser_domain(domain);//用户所属域名
addr.setUser_addr_sex("男");//性别
addr.setUser_addr_email(email);//email
addr.setCompanyname(company);
addr.setUser_addr_variable(selfbl);
sendAddrList.add(addr);
}else if(parseresult>0){//本地库重复
selfaddr+=email+",";
int selfnum=importmap.get("selfnum")+1;
importmap.put("selfnum",selfnum);//本地库重复
}else if(parseresult==-1){//文件重复
fcaddr+=email+",";
int fcnum=importmap.get("fcnum")+1;
importmap.put("fcnum",fcnum);//文件重复
}else if(parseresult==-2){//退订
unaddr+=email+",";
int unnum=importmap.get("unnum")+1;
importmap.put("unnum",unnum);//退订
}else if(parseresult==-3){//用户自定义过滤
filtercustom+=email+",";
int filter=importmap.get("filtercustomnum")+1;
importmap.put("filtercustomnum",filter);//用户自定义过滤量
}else if(parseresult==-4){//数据库重复
scaddr+=email+",";
int scnum=importmap.get("scnum")+1;
importmap.put("scnum",scnum);//成功量
}else if(parseresult==-5){//系统过滤
filtersys+=email+",";
int sysscnum=importmap.get("filtersysnum")+1;
importmap.put("filtersysnum",sysscnum);//成功量
}
}else{
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
}
}else{
noaddr+="为空,";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
}
}
}
importaddress.put("unaddr",unaddr);//退订地址
importaddress.put("fcaddr",fcaddr);//文件重复地址
importaddress.put("scaddr",scaddr);//系统重复地址
importaddress.put("noaddr",noaddr);//不合法地址
importaddress.put("crmaddr",crmaddr);//crm重复
importaddress.put("selfaddr",selfaddr);//本地库重复
importaddress.put("filtercustom",filtercustom);//用户自定义过滤地址
importaddress.put("filtersys",filtersys);//系统屏蔽
importmap.put("result",1);//成功
//ActionContext actionContext = ActionContext.getContext();
//Map<String, Object> sion = actionContext.getSession();
sess.put("sendaddress", sendAddrList);
}catch (Exception e){
importmap.put("result",0);//异常
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
LogClass.errolog(str,loginid+"@"+domain);
}
return "map";
}
/**CRM库发信判断量是否超标*/
public String checkCRMSendLimit(){
try{
//获取用户session
ActionContext ac = ActionContext.getContext();
Map<String,Object> sess = ac.getSession();
YxyUserInfo user=(YxyUserInfo) sess.get("yxyuser");
loginid=user.getLogin_id();//用户账号
domain=user.getDomain();//用户所属域名
//单次发送量已大于设置的量
if(uploademail.split(",").length > ConfigPath.getSendOnceLimit()){
importmap.put("result", -1);
importmap.put("limit", ConfigPath.getSendOnceLimit());
}else{//单次量没超标则检查发送月发送量
int check = yxysendmailservice.getThisMonthSendLimit(user.getUser_id(),uploademail,send_time);
if(check == 0){//已超标
importmap.put("result", -2);
importmap.put("limit", ConfigPath.getSendMonthLimit());
}else{//没超标
importmap.put("result", 1);
}
}
}catch(Exception e){
importmap.put("result", 0);
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
LogClass.errolog(str,loginid+"@"+domain);
}
return "map";
}
/**新客户营销发信判断量是否超标*/
public String checkNewSendLimit(){
try{
//获取用户session
ActionContext ac = ActionContext.getContext();
Map<String,Object> sess = ac.getSession();
YxyUserInfo user=(YxyUserInfo) sess.get("yxyuser");
loginid=user.getLogin_id();//用户账号
domain=user.getDomain();//用户所属域名
int check = yxysendmailservice.getThisMonthSendLimit2(user.getCompany_id(),user.getUser_id(),send_nums,send_time);
if(check==1){//没超标
importmap.put("result", 1);
}else{//已超标
if(check==-1){//单次量超标
importmap.put("result", -1);
importmap.put("limit", ConfigPath.getSendOnceLimitNew());
}else if(check==-2){//月发量超标
importmap.put("result", -2);
importmap.put("limit", ConfigPath.getSendMonthLimitNew());
}else{
importmap.put("result", 1);
}
}
}catch(Exception e){
importmap.put("result", 0);
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
LogClass.errolog(str,loginid+"@"+domain);
}
return "map";
}
/**生成待发邮件*/
public String generationMail(){
try{
//返回值
importmap.put("result", 0);
//获取用户session
ActionContext ac = ActionContext.getContext();
Map<String,Object> sess = ac.getSession();
//获取session中的yxyuser
YxyUserInfo user=(YxyUserInfo) sess.get("yxyuser");
//用户账号
loginid=user.getLogin_id();
//用户所属域名
domain=user.getDomain();
//时间定义
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nowdate=df.format(new Date());
SimpleDateFormat df1=new SimpleDateFormat("yyyyMMddHHmmssSSS");
String romdate=df1.format(new Date());
//获取项目在服务器端的路径
String pathew = this.getClass().getClassLoader().getResource("/").getPath();
pathew = pathew.substring(1, pathew.length());
pathew = pathew.replace("/WEB-INF/classes/","");
//发件人
sender=sender.replace("lt&", "<");
sender=sender.replace("gt&", ">");
//发件人姓名
String sendname=sender.substring(0,sender.indexOf("<"));
//发件人地址
String sendaddr=sender.substring(sender.indexOf("<")+1,sender.lastIndexOf(">"));
//回复人地址
String replyaddr="";
replyemail=replyemail.replace("lt&", "<");
replyemail=replyemail.replace("gt&", ">");
if(replyemail.indexOf("<")==-1){
replyaddr=replyemail;
}else{
replyaddr=replyemail.substring(replyemail.indexOf("<")+1,replyemail.lastIndexOf(">"));
}
//用户提交的地址
List<YxyUserAddress> sendaddress =new ArrayList<YxyUserAddress>();
//用户提交的地址信息
sendaddress =(List<YxyUserAddress>)sess.get("sendaddress");
//用户是否选择了过滤分组功能
if(filterid>=0){
//根据过滤类别ID查询地址与域名
List<Object> filterAddressList=filteraddressservice.findByTypeidAddress(filterid);
//循环判断待发地址是否在过滤地址中
if(filterAddressList.size()>0){
String filterAddress="";
String addressStr="";
for(int l=0;l<filterAddressList.size();l++){
for(int u=0;u<sendaddress.size();u++){//address是用户上传的收件人地址
filterAddress=filterAddressList.get(l).toString();
addressStr=sendaddress.get(u).getUser_addr_email();
//判断用户上传的地址与过滤中地址是否相同
if(addressStr.equals(filterAddress)||addressStr.indexOf(filterAddress)!=-1){
//移出该对象
sendaddress.remove(u);
}
}
}
}
}
//用户并没有上传地址或者选择地址
if(sendaddress==null||sendaddress.size()<=0){
importmap.put("result", -1);//无地址
return "map";
}
//验证
if(sendci!=1){
int yz=sendYZ(sendaddress);
if(yz!=1){
importmap.put("result", yz);
return "map";
}
}
//生成待发邮件与地址
YxySendMailMaster masterinfo=new YxySendMailMaster();
masterinfo.setSubject(title);//主题
masterinfo.setSender(sendname);//发件人姓名
masterinfo.setSend_email(sendaddr);//发件人地址
masterinfo.setReply_email(replyaddr);//回复地址
masterinfo.setBody(context);//内容
masterinfo.setUser_loginid(loginid);//用户账号
masterinfo.setUser_domain(domain);//用户域名
masterinfo.setCreate_time(nowdate);//创建时间
masterinfo.setFolder_id(0);//所属文件类别ID
masterinfo.setAuto_change_subject(ismanytitle);//是否使用多主题
masterinfo.setAttarchment_path(pathew+"##P##"+attrpath);//加入附件路径
String random=GetRandom.getRandomString(10);//获取随机数据制定邮件唯一码
String mailUID=loginid+romdate+random;//邮件唯一码由用户域名+时间格式+随机数
masterinfo.setMail_uid(mailUID);//加入唯一码
masterinfo.setMainid(mainid);//加入主邮件id
masterinfo.setSendci(1);
//masterinfo.setUid(uid);
//是不是老客户营销
if(uploadtype==1||uploadtype==2){//新客户营销(导入地址、粘贴地址)
//本月新客户营销发送量已经超标或单次发送量超标则改为新客户营销但是我们系统得smtp发送
if(yxysendmailservice.getThisMonthSendLimit2(user.getCompany_id(),user.getUser_id(),sendaddress.size(),send_time)!=1){
masterinfo.setIsold(6);
}else{//发送量没超标
//获取EDM配置-开发客户配置信息
CentreYxyedmNewcustomer new_set = yxysendmailservice.getNewCusSet(user.getCompany_id());
if(new_set!=null){//有配置信息
//是自有域名且状态可以使用
if(new_set.getType() == 0 && new_set.getStatus() == 1){
//查询当前帐号是否有smtp信息
String hql = "from YxySendSmtpInfo where smtp_user_loginid = '"+loginid+"' and smtp_user_domain = '"+domain+"' and smtp_service_type = 5";
List<YxySendSmtpInfo> smtps = yxysendmailservice.findSmtpByHql(hql);
if(smtps.size() > 0){//开发客户的自有域名模式有对应的smtp
masterinfo.setIsold(5);//使用开发客户的自有域名得smtp发送
}else{
masterinfo.setIsold(0);//系统的smtp发送
}
}else{//非自有域名或者状态不可使用
masterinfo.setIsold(0);//系统的smtp发送
}
}else{//无配置信息
masterinfo.setIsold(0);//系统的smtp发送
}
}
}else if(uploadtype==4||uploadtype==7){//客户管理
//本月CRM库发送量已经超标或单次发量超标则改为CRM库营销但是老客户营销发送
if(yxysendmailservice.getThisMonthSendLimit(user.getUser_id(),uploademail,send_time) == 0 ||
uploademail.split(",").length > ConfigPath.getSendOnceLimit()){
masterinfo.setIsold(4);
}else{//发送量没超标
//获取EDM配置-盘活客户配置信息
CentreYxyedmOldcustomer old_set = yxysendmailservice.getOldCusSet(user.getCompany_id());
if(old_set!=null){//有配置信息
if(old_set.getStatus()==1){//状态可以用
if(old_set.getType()==0){//自有域名
//查询当前帐号是否有smtp信息
String hql = "from YxySendSmtpInfo where smtp_user_loginid = '"+loginid+"' and smtp_user_domain = '"+domain+"' and smtp_service_type = 3";
List<YxySendSmtpInfo> smtps = yxysendmailservice.findSmtpByHql(hql);
if(smtps.size() > 0){//有smtp信息
masterinfo.setIsold(3);//用自己的域名帐号发信
}else{//无smtp信息则改为CRM库营销但是老客户营销发送
masterinfo.setIsold(4);
}
}else{//代发模式
//查询当前帐号是否有smtp信息
String hql = "from YxySendSmtpInfo where smtp_user_domain = '"+domain+"' and smtp_service_type = 2";
List<YxySendSmtpInfo> smtps = yxysendmailservice.findSmtpByHql(hql);
if(smtps.size() > 0){//有smtp信息
masterinfo.setIsold(2);//该企业下的用户都用同一个指定的帐号发信
}else{//无smtp信息则改为CRM库营销但是老客户营销发送
masterinfo.setIsold(4);
}
}
}else{//状态不可以用则改为CRM库营销但是老客户营销发送
masterinfo.setIsold(4);
}
}else{//没配置信息则改为CRM库营销但是老客户营销发送
masterinfo.setIsold(4);
}
}
}else{
masterinfo.setIsold(1);//老客户跟进
}
//是不是在发一次
if(mailid>0){
masterinfo.setMainid(mailid);
}
//是否加入退订
masterinfo.setIs_unsubscribe(1);
//选择的退订语言
masterinfo.setUnsubscribe_language(unlanguage);
masterinfo.setUnstr(unselfstr);
//用户eml保存路径
String usersetpath=yxysysparamaterservice.findUserParamValue(loginid, domain, "yxy_user_data_save_path", "yxy_domain_save_path");
String sendStatus="send";
//判断是不是定时邮件
if(!timestr.equals("no")){
masterinfo.setStatus(2);//状态为定时邮件
masterinfo.setPlans_send(1);
masterinfo.setPlans_send_time(timestr);
sendStatus="time";
}
String saveemlpath=usersetpath+"\\"+domain+"\\"+loginid+"\\"+"\\"+sendStatus;
//调用业务层
yxysendmailservice.addMasterDetail(user.getUser_type(),user.getCompany_id(),user.getUser_id(),masterinfo,sendaddress,attrpath,saveemlpath,usersetpath,mailid,sendci,uploadtype,customerid,jinchengid);
//添加此次发送的邮件内容大小提供内容过滤使用
// YxySendContextSet yxysendcontextset = new YxySendContextSet();
// yxysendcontextset.setLogin_id(loginid);//登录帐号
// yxysendcontextset.setLogin_domain(domain);//登录域名
// yxysendcontextset.setEmail_subject(title);//邮件主题
// yxysendcontextset.setEmail_context_size(context.getBytes().length+"");//邮件大小(字节数)
// yxysendcontextset.setEmail_send_time(nowdate.split(" ")[0]);//邮件发送时间,格式为yyyy-mm-dd
// yxycontextsetservice.addContexsetInfo(yxysendcontextset);//添加邮件信息内容
//importmap.put("result", 1);
//地址量
importmap.put("result", sendaddress.size());
//清除地址session
sess.remove("importaddress");
}catch (Exception e){
importmap.put("result", 0);
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
LogClass.errolog(str,loginid+"@"+domain);
}
return "map";
}
/**验证地址(粘贴地址,crm库选择,本地库选择,再发送一次)*/
public String validateAddress(){
try{
//获取用户session
ActionContext ac = ActionContext.getContext();
Map<String,Object> sess = ac.getSession();
YxyUserInfo user=(YxyUserInfo) sess.get("yxyuser");
loginid=user.getLogin_id();//用户账号
domain=user.getDomain();//用户所属域名
//当前时间
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nowdate=df.format(new Date());
//返回参数定义
importmap.put("result",0);//结果
importmap.put("success",0);//成功量
importmap.put("tolnum",0);//地址总量
importmap.put("unnum",0);//退订量
importmap.put("fcnum",0);//文件重复
importmap.put("scnum",0);//系统重复
importmap.put("crmnum",0);//CRM重复
importmap.put("nonum",0);//不合法量
importmap.put("filtercustomnum",0);//用户自定义过滤地址
importmap.put("filtersysnum",0);//系统屏蔽
importaddress.put("unaddr","");//退订地址
importaddress.put("fcaddr","");//文件重复地址
importaddress.put("scaddr","");//系统重复地址
importaddress.put("crmaddr","");//CRM重复
importaddress.put("noaddr","");//不合法地址
importaddress.put("filtercustom","");//用户自定义过滤地址
importaddress.put("filtersys","");//系统屏蔽
String unaddr="";//退订地址
String fcaddr="";//文件重复地址
String scaddr="";//系统重复地址
String crmaddr="";//系统重复地址
String noaddr="";//不合法地址
String filtercustom="";//用户自定义过滤地址
String filtersys="";//系统屏蔽地址
String filterstr="";//用户自定义过滤字符
//查询用户个人设置多少天不可以发送相同邮件地址
List<YxyUserSet> yxyuserset=yxysendmailservice.findUserSet(loginid,domain);
if(yxyuserset.size()>0){
//用户自定义过滤字符
filterstr=yxyuserset.get(0).getUser_set_fiterStr();
}
// //地址集合
// List<Object> alllist = new ArrayList<Object>();
// if(uploadtype==7){//客户管理转过来的
// //查询crm库(新营销去掉整个企业的CRM库地址)
// alllist=customerservice.findCusEmailList(user.getCompany_id());
// }else{
// //查询本地用户地址库
// alllist=yxyaddressmanageservice.findUserAllAddress(loginid,domain);
// }
//查询用户退订地址
List<Object> unalllist=yxyunsubscribeinfoservice.findAllUnEmali(loginid,domain);
//可发地址对象
List<YxyUserAddress> sendAddrList = new ArrayList<YxyUserAddress>();
//查询屏蔽的域名
List<YxyShieldDomain> shielddoamin=shielddomainservice.findAllList();
//查询不屏蔽的邮件地址
List<YxyNoshieldEmail> noshieldemail=noshieldemailservice.findAllList();
//存放判断之后的地址
List<String> fileEmail=new ArrayList<String>();
//需要判断的地址集合
List<Object> yzaddresslist=new ArrayList<Object>();
List<YxyCustomerEmail> crmaddresslist=new ArrayList<YxyCustomerEmail>();
//判断提交方式
if(uploadtype==2){//粘贴的去掉本地地址库里的,与crm库里面的
uploademail=uploademail.replaceAll(";", ",");
uploademail=uploademail.replaceAll(" ", "");
String[] arrayemail=uploademail.split(",");
if(uploadtype==2&&arrayemail.length>20){
importmap.put("result",-1);//结果
return "map";
}
//处理空字符
for(int i=0;i<arrayemail.length;i++){
if(arrayemail[i]!=null&&!"".equals(arrayemail[i])){
String [] addrArry={arrayemail[i],""};
yzaddresslist.add(addrArry);
}
}
}else if(uploadtype==6){//本地库地址选择
uploademail=uploademail.replaceAll(";", ",");
uploademail=uploademail.replaceAll(" ", "");
String[] arrayemail=uploademail.split(",");
//处理空字符
for(int i=0;i<arrayemail.length;i++){
if(arrayemail[i]!=null&&!"".equals(arrayemail[i])){
String [] addrArry={arrayemail[i],""};
yzaddresslist.add(addrArry);
}
}
}else if(uploadtype==3){//本地库类别选择
//查询本地库地址(根据类别)
yzaddresslist=yxyaddressmanageservice.findAddressTypeid(loginid,domain,typeid);
if(yzaddresslist.size()<=0){
importmap.put("result",1);//结果
return "map";
}
}else if(uploadtype==4){//crm分类
crmaddresslist=customerservice.findEmailByCusid(uploademail);
if(crmaddresslist==null||crmaddresslist.size()<=0){
importmap.put("result",1);//结果
return "map";
}else{
for(int i=0;i<crmaddresslist.size();i++){
String fullname=crmaddresslist.get(i).getFull_name();
String cusname=crmaddresslist.get(i).getCustomer_name();
String email=crmaddresslist.get(i).getEmail();
int customer_id=crmaddresslist.get(i).getCustomer_id();
Object[] obj={email,customer_id,fullname,cusname};
yzaddresslist.add(obj);
}
}
}else if(uploadtype==5){//再发一次
//判断邮件间隔时间大于90天的不能再发一次
String timejian=DateFormat.nDaysAfterOneDateString(nowdate,-90);
//往前推时时间修改为00:00:00而不是08:00:00
timejian = timejian.split(" ")[0] + " 00:00:00";
//判断最后一封邮件的时间
String lasttime=yxysendmailservice.findLastMail(mailid);
if(lasttime.compareTo(timejian)<0){
importmap.put("result",-3);//结果
return "map";
}
//项目路进
String pathew = this.getClass().getClassLoader().getResource("/").getPath();
pathew = pathew.substring(1, pathew.length());
pathew = pathew.replace("/WEB-INF/classes/","");
//获取txt名称
String txtname=yxysendmailservice.findMailTxtPath(mailid);
if("".equals(txtname)){
importmap.put("result",-2);//结果
return "map";
}
//组装路径
String txtfilepath="userSaveFile/"+domain+"/"+loginid+"/"+txtname;
//判断文件是否存在
File f=new File(pathew+"/"+txtfilepath);
if(f.exists()){
//判断txt还是excel
String[] typeArry=txtname.split("\\.");
String typename=typeArry[typeArry.length-1];
if("txt".equals(typename)){
//获取文件内容
InputStreamReader in = new InputStreamReader(new FileInputStream(f), "UTF-8");
BufferedReader bufread = new BufferedReader(in);
String line_record ="";
int line=0;
while((line_record = bufread.readLine())!=null){
line++;
if(line==1){
continue;
}
String [] sendarry={line_record,"","","",""};
yzaddresslist.add(sendarry);
}
}else if("xls".equals(typename)){
//获取文件内容excel
InputStream in=new FileInputStream(f);
HSSFWorkbook wb = new HSSFWorkbook(in);
HSSFSheet getsheet = wb.getSheetAt(0);//读取第一个工作表
for(int j = 1; j < getsheet.getLastRowNum() + 1; j++){
HSSFRow getrow = getsheet.getRow(j);
String readinfo="";
if(getrow!=null){
for(int k = 0; k < getrow.getLastCellNum(); k++){
HSSFCell getcell = getrow.getCell((short) k);
if(getcell!=null){
if (getcell.getCellType() == HSSFCell.CELL_TYPE_BOOLEAN){
// 返回布尔类型的值
readinfo += String.valueOf(getcell.getBooleanCellValue()+",");
}else if (getcell.getCellType() == HSSFCell.CELL_TYPE_NUMERIC){
// 返回数值类型的值
readinfo +=Integer.valueOf(getcell.getStringCellValue())+",";
}else{
// 返回字符串类型的值
readinfo += String.valueOf(getcell.getStringCellValue()+",");
}
}
}
//处理数据
String email="";
String name="";
String company="";
String selfbl="";
String[] emailarry=readinfo.split(",");
if(emailarry==null||emailarry.length<=0){
continue;
}
//去掉空格
email=emailarry[0].trim();
if(emailarry.length>=2){
name=emailarry[1];
}
if(emailarry.length>=3){
company=emailarry[2];
}
if(emailarry.length>=4){
selfbl=emailarry[3];
}
String [] sendarry={email,name,company,selfbl};
yzaddresslist.add(sendarry);
}
}
}
}else{
importmap.put("result",-2);//结果
return "map";
}
}else if(uploadtype==7){//客户管理转过来的
crmaddresslist=customerservice.findEmailByCusid(uploademail);
if(crmaddresslist==null||crmaddresslist.size()<=0){
importmap.put("result",1);//结果
return "map";
}else{
for(int i=0;i<crmaddresslist.size();i++){
String fullname=crmaddresslist.get(i).getFull_name();
String cusname=crmaddresslist.get(i).getCustomer_name();
String email=crmaddresslist.get(i).getEmail();
int customer_id=crmaddresslist.get(i).getCustomer_id();
Object[] obj={email,customer_id,fullname,cusname};
yzaddresslist.add(obj);
}
}
// uploademail=uploademail.replaceAll(";", ",");
// uploademail=uploademail.replaceAll(" ", "");
// String[] arrayemail=uploademail.split(",");
// //循环处理数据
// for(int i=0;i<arrayemail.length;i++){
// if(arrayemail[i]!=null&&!"".equals(arrayemail[i])){
// String [] addrArry={arrayemail[i],""};
// yzaddresslist.add(addrArry);
// }
// }
}
List<Object> readlist=null;
if(uploadtype==5){//在发一次去掉点读的(当前邮件的)
readlist=yxyreadinginfoservice.findMailReadAddress(loginid,domain,mailid);
}
//地址集合
List<Object> alllist = new ArrayList<Object>();
if(uploadtype == 1 || uploadtype == 2 || uploadtype==3 || uploadtype==6){//发送地址的方式1:上传,2:粘贴,3:本地库类别选择,6:本地库地址选择
if(user.getUser_type() == 0){//易外销用户
alllist=customerservice.findCusEmailList(user.getCompany_id());
}else{//营销邮用户
alllist=yxyaddressmanageservice.findUserAllAddress(loginid,domain);
}
}
//循环判断地址
our:for(int s=0;s<yzaddresslist.size();s++){
//发送地址的方式1:上传2:粘贴3:本地库类别选择4:crm分类5:在发一次6:本地库多地址选择7:客户管理传来的8:通讯录
Object[] obj=(Object[]) yzaddresslist.get(s);
String email=obj[0].toString();
if(uploadtype==1||uploadtype==2){//邮件地址格式判断只针对于上传和粘贴
if(obj[0]==null){
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
//字符长度不能大于60
if(email.length()==0||email.length()>60){
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
//该行做判断(地址@后面只能有两个点且只能是数字字母)
String yz1[]=email.split("@");
if(yz1.length!=2){//最多两个.
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
//以字母结尾
byte b=yz1[1].getBytes()[yz1[1].length()-1];
if(!(b>=97&&b<=122)&&!(b>=65&&b<=90)){
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
//去掉空格
email=email.trim();
Pattern yz = Pattern.compile(emailreg);
Matcher m = yz.matcher(email);
email=email.replaceAll(" ", "");
if(!m.matches()){
noaddr+=email+",";
int nonum=importmap.get("nonum")+1;
importmap.put("nonum",nonum);//不合法量
continue;
}
}
//是正确的
if(uploadtype==5){//在发一次去掉点读的(当前邮件的)
//是否有点读(去掉点读的)
if(readlist!=null){
for(int r=0;r<readlist.size();r++){
String reademail=readlist.get(r).toString();
if(email.equals(reademail)){
continue our;
}
}
}
}
//验证合法性
int parseresult=parseRecord(email,alllist,unalllist,shielddoamin,noshieldemail,fileEmail,filterstr);
fileEmail.add(email);
//粘贴去掉本地地址库
if(uploadtype==2){
if(parseresult>0){
parseresult=-4;
}else{
//查询crm库(新营销去掉整个企业的CRM库地址)
int exits=yxyaddressmanageservice.findcrmisexits(user.getCompany_id(),email);
if(exits==2){
parseresult=-6;
break;
}
}
}
//判断结果
if(parseresult>=0){//存在的地址
//加入对象
YxyUserAddress addr = new YxyUserAddress();
//是否历史存在
if(parseresult>0){//大于0说明是匹配到了本地库的信息即uploadtype=1或uploadtype=2
addr=yxyaddressmanageservice.findaddressinfo(parseresult);
}else{//说明parseresult=0
addr.setUser_addr_id(0);//地址id
addr.setUser_addr_email(email);//地址
addr.setUser_addr_type_id(typeid);//所属类别ID
addr.setUser_addr_name("");//姓名
addr.setUser_addr_add_date(nowdate);//建立时间
addr.setUser_loginid(loginid);//用户账号
addr.setUser_domain(domain);//用户所属域名
addr.setUser_addr_sex("男");//性别
if(uploadtype==5){//再发一次
addr.setUser_addr_name(obj[1].toString());//姓名
addr.setCompanyname(obj[2].toString());
addr.setUser_addr_variable(obj[3].toString());
}
else if(uploadtype==4 || uploadtype==7){//从CRM库选择
addr.setCustomerid(Integer.parseInt(obj[1].toString()));//客户id
addr.setUser_addr_name(obj[2].toString());//姓名
addr.setCompanyname(obj[3].toString());//客户名称
}
}
sendAddrList.add(addr);
}else if(parseresult==-1){//文件重复
fcaddr+=email+",";
int fcnum=importmap.get("fcnum")+1;
importmap.put("fcnum",fcnum);//文件重复
}else if(parseresult==-2){//退订
unaddr+=email+",";
int unnum=importmap.get("unnum")+1;
importmap.put("unnum",unnum);//退订
}else if(parseresult==-3){//用户自定义过滤
filtercustom+=email+",";
int filter=importmap.get("filtercustomnum")+1;
importmap.put("filtercustom",filter);//过滤量
}else if(parseresult==-4){//数据库重复
scaddr+=email+",";
int scnum=importmap.get("scnum")+1;
importmap.put("scnum",scnum);//过滤量
}else if(parseresult==-5){//系统屏蔽
filtersys+=email+",";
int scnum=importmap.get("filtersysnum")+1;
importmap.put("filtersysnum",scnum);//系统屏蔽量
}else if(parseresult==-6){//CRM重复
crmaddr+=email+",";
int crmnum=importmap.get("crmnum")+1;
importmap.put("crmnum",crmnum);//CRM重复量
}
}
//保存值
ActionContext actionContext = ActionContext.getContext();
Map<String, Object> sion = actionContext.getSession();
sion.put("sendaddress", sendAddrList);
//返回结果
importmap.put("success",sendAddrList.size());//结果
importaddress.put("unaddr",unaddr);//退订地址
importaddress.put("fcaddr",fcaddr);//文件重复地址
importaddress.put("scaddr",scaddr);//系统重复地址
importaddress.put("noaddr",noaddr);//不合法地址
importaddress.put("filtercustom",filtercustom);//用户自定义过滤地址
importaddress.put("filtersys",filtersys);//系统屏蔽
importmap.put("result",1);//结果
}catch(Exception e){
importmap.put("result",0);//结果
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
LogClass.errolog(str,loginid+"@"+domain);
}
return "map";
}
/**解析记录验证正确性*/
public int parseRecord(String line_record,List<Object> existAddress,
List<Object> unAddress,List<YxyShieldDomain> shielddoamin,
List<YxyNoshieldEmail> noshieldemail,List<String> fileEmail,String filter){//,int isrepeatday
//发送地址的方式1:上传2:粘贴
if(uploadtype==1||uploadtype==2){
//判断此地址在之前是否导入过
for(int v=0;v<fileEmail.size();v++){
if(line_record.equals(fileEmail.get(v))){
return -1;
}
}
}
//地址是否是退订地址
for(int u=0;u<unAddress.size();u++){
//判断是否与退订地址一样
if(unAddress.get(u).equals(line_record)){
return -2;
}
}
//自定义过滤
if(filter!=null&&!filter.equals("")){
//判断此地址是否过滤
String []fiterArry=filter.split(";");
for(int f=0;f<fiterArry.length;f++){
if(line_record.split("@")[0].equals(fiterArry[f])){
return -3;
}
}
}
boolean isshield=true;
//不屏蔽相关后缀的邮箱
for(int n=0;n<noshieldemail.size();n++){
if(line_record.equals(noshieldemail.get(n).getEmail())){
isshield=false;
break;
}
}
//屏蔽相关后缀的邮箱
if(isshield){
for(int s=0;s<shielddoamin.size();s++){
if(line_record.contains(shielddoamin.get(s).getShielddomain())){
return -5;
}
}
}
//发送地址的方式1:上传,2:粘贴,3:本地库类别选择,6:本地库地址选择
if(uploadtype==1||uploadtype==2||uploadtype==3||uploadtype==6){
//地址是否重复
Object[] emailarry=null;
for(int i=0;i<existAddress.size();i++){
emailarry=(Object[]) existAddress.get(i);
int addressid=Integer.parseInt(emailarry[0].toString());//地址ID
String email=emailarry[1].toString();//地址
if(line_record.equals(email)){//已存在
return addressid;
}
}
}
return 0;
}
/**发送邮件的各种判断*/
public int sendYZ(List<YxyUserAddress> sendaddress){
try {
//获取用户session
ActionContext ac = ActionContext.getContext();
Map<String,Object> sess = ac.getSession();
YxyUserInfo user=(YxyUserInfo) sess.get("yxyuser");
loginid=user.getLogin_id();//用户账号
domain=user.getDomain();//用户所属域名
//当前时间
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String nowdate=df.format(new Date());
String nowDay=nowdate.split(" ")[0];
if(sendaddress.size()<=0){
return -6;//过滤后无可发地址
}
//待发送地址量
int sendaddressnum=sendaddress.size();
//量控制
Map<String,String> usergraph=yxysysparamaterservice.findParamaterByLevel(4, loginid,domain);//查询控制参数(用户级)
//Map<String,String> domaingraph=yxysysparamaterservice.findParamaterByLevel(1, loginid,domain);//查询控制参数(企业级)
//判断是不是定时邮件
if(!timestr.equals("no")){//定时邮件
//相差的天数
int nday = DateFormat.nDaysBetweenTwoDate(nowDay,timestr);
//判断定时的时间是否当天,若是则要判断用户的发信量
if(nday == 0){//说明定时邮件是当天,则要判断用户的发信量
//判断用户发信量限制
int sendresult=yxysendmailservice.findSendNum(loginid,domain,sendaddressnum,usergraph);
if(sendresult!=1){//-2日超,-3月超,-4总超,-5单次超
return sendresult;
}
}else{//定时邮件不是当天的,则要判断定时邮件的时间的用户发信量是否超标
int sendresult=yxysendmailservice.findSendNumTime(loginid,domain,sendaddressnum,usergraph,timestr);
if(sendresult!=1){//-2日超,-3月超,-4总超,-5单次超
return sendresult;
}
}
}else{//不是定时邮件
//判断用户发信量限制
int sendresult=yxysendmailservice.findSendNum(loginid,domain,sendaddressnum,usergraph);
if(sendresult!=1){//-2日超,-3月超,-4总超,-5单次超
return sendresult;
}
}
//相同邮件内容的发送判断(通过内容的大小的字节数与主题去判断)
// List<YxyUserSet> userset = yxysendmailservice.findUserSet(loginid,domain);//查询用户个人设置多少天不可以发送相同邮件地址
// if(userset.size() > 0){
// //获取天数据
// int notsendday=userset.get(0).getUser_not_send_repeat_context_num();
// //获取日期
// String ntimer=DateFormat.nDaysAfterOneDateString(nowdate,notsendday);
// String bodylength=context.getBytes().length+"";
// List<YxySendContextSet> contextset=yxycontextsetservice.findByTime(nowDay,nowDay,bodylength,ntimer,title);
// if(contextset.size()>0){//有相同的
// return -8;
// }
// }
} catch (Exception e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
LogClass.errolog(str,loginid+"@"+domain);
return 0;
}
return 1;
}
/**判断定时邮件定时时间是否在当前时间后6小时*/
public String sendTimeBegin(){
try {
//获取用户session
ActionContext ac = ActionContext.getContext();
Map<String,Object> sess = ac.getSession();
YxyUserInfo user=(YxyUserInfo) sess.get("yxyuser");
loginid=user.getLogin_id();//用户账号
domain=user.getDomain();//用户所属域名
String nowdate=DateFormat.getNowDate();
long begintime=DateFormat.minutes(nowdate,timestr);
if(begintime>360){
result=1;
}else{
result=-1;
}
} catch (Exception e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
LogClass.errolog(str,loginid+"@"+domain);
}
return SUCCESS;
}
/**判断当前用户是否有新客户营销权限:0没有,1有*/
public String getNewCusPower(){
try {
//获取用户session
ActionContext ac = ActionContext.getContext();
Map<String,Object> sess = ac.getSession();
YxyUserInfo user=(YxyUserInfo) sess.get("yxyuser");
loginid = user.getLogin_id();//用户账号
domain=user.getDomain();//用户所属域名
result = yxysendmailservice.getNewCusPower(domain,user.getCompany_id(),user.getUser_id());
} catch (Exception e) {
result = 0;
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
LogClass.errolog(str,loginid+"@"+domain);
}
return SUCCESS;
}
/**若发送的是客户则处理发送发送后的业务*/
public String updateCustomerService(){
try {
//获取用户session
ActionContext ac = ActionContext.getContext();
Map<String,Object> sess = ac.getSession();
YxyUserInfo user=(YxyUserInfo) sess.get("yxyuser");
loginid = user.getLogin_id();//用户账号
domain=user.getDomain();//用户所属域名
yxysendmailservice.updateCustomerService(user.getDomain(),user.getLogin_id(),user.getCompany_id(),user.getUser_id(),timestr,uploadtype,customerid,jinchengid,title);
result = 1;
} catch (Exception e) {
result = 0;
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
LogClass.errolog(str,loginid+"@"+domain);
}
return SUCCESS;
}
private int filterid;//过滤类别ID
private int ismanytitle;//是否使用多主题
private int unlanguage;//退订语言(1:中文2:英文3:自定义)
private int mailid;//邮件id
private int sendci;//发送次数
private int uploadtype;//发送地址的方式1:上传2:粘贴3:本地库类别选择4:crm分类5:在发一次6:本地库多地址选择7:客户管理传来的8:通讯录
private int result;//返回结果
private int typeid;//地址所属类别ID
private int mainid;//在发一次的主邮件id
private int jinchengid;//进程id(客户管理)
private String unselfstr;//自定义退订字符
private String loginid="erro";//用户账号
private String domain="erro";//用户域名
private String sender;//发件人
private String replyemail;//回复地址
private String context;//内容
private String timestr;//是否是定时邮件(不是则为no,是则为定时时间)
private String title;//主题
private String uploademail;//提交的地址
private String linkadderss;//链接地址
private String attrpath;//附件
private String txtfilename;//邮件txt文件名
private String addrfilename;//上传文件名
private String customerid;//客户id(多个)
private Map<String,Integer> importmap=new HashMap<String, Integer>();
private Map<String,String> importaddress=new HashMap<String, String>();
private Map<String,List<String>> erromap=new HashMap<String, List<String>>();
private File yxyaddr;//导入的文件路径
private YxySendMailService yxysendmailservice;//营销service
private YxyAddressManageService yxyaddressmanageservice;//地址库service
private YxyUnsubscribeInfoService yxyunsubscribeinfoservice;//退订地址service
private YxyContextSetService yxycontextsetservice;//内容重复判断service
private YxySysParamaterService yxysysparamaterservice;//控制参数serviec
private YxySendFilterAddressService filteraddressservice;//过滤分组地址service
private YxySendSysFilterService yxysendsysfilterservice;//过滤字符service
private YxyUserInfoService yxyuserinfoservice;//用户service
private YxyNoshieldEmailService noshieldemailservice;//不屏蔽的邮件地址service
private YxyShieldDomainService shielddomainservice;//屏蔽的域名service
private YxyCustomerService customerservice;//客户service
private YxyReadingInfoService yxyreadinginfoservice;//点击service
private String salesResult;//返回crm销售进程结果
private List<String> listResult=new ArrayList<String>();//发送邮件返回不健康的邮件主题
private String send_time;//定时邮件的时间
private int send_nums;//新客户营销发送的邮件地址数
public int getSend_nums() {
return send_nums;
}
public void setSend_nums(int send_nums) {
this.send_nums = send_nums;
}
public String getSend_time() {
return send_time;
}
public void setSend_time(String send_time) {
this.send_time = send_time;
}
public String getSalesResult() {
return salesResult;
}
public void setSalesResult(String salesResult) {
this.salesResult = salesResult;
}
public List<String> getListResult() {
return listResult;
}
public void setListResult(List<String> listResult) {
this.listResult = listResult;
}
public YxySendMailService getYxysendmailservice() {
return yxysendmailservice;
}
public void setYxysendmailservice(YxySendMailService yxysendmailservice) {
this.yxysendmailservice = yxysendmailservice;
}
public YxyAddressManageService getYxyaddressmanageservice() {
return yxyaddressmanageservice;
}
public void setYxyaddressmanageservice(
YxyAddressManageService yxyaddressmanageservice) {
this.yxyaddressmanageservice = yxyaddressmanageservice;
}
public YxyUnsubscribeInfoService getYxyunsubscribeinfoservice() {
return yxyunsubscribeinfoservice;
}
public void setYxyunsubscribeinfoservice(
YxyUnsubscribeInfoService yxyunsubscribeinfoservice) {
this.yxyunsubscribeinfoservice = yxyunsubscribeinfoservice;
}
public YxyContextSetService getYxycontextsetservice() {
return yxycontextsetservice;
}
public void setYxycontextsetservice(YxyContextSetService yxycontextsetservice) {
this.yxycontextsetservice = yxycontextsetservice;
}
public YxySysParamaterService getYxysysparamaterservice() {
return yxysysparamaterservice;
}
public void setYxysysparamaterservice(
YxySysParamaterService yxysysparamaterservice) {
this.yxysysparamaterservice = yxysysparamaterservice;
}
public YxySendFilterAddressService getFilteraddressservice() {
return filteraddressservice;
}
public void setFilteraddressservice(
YxySendFilterAddressService filteraddressservice) {
this.filteraddressservice = filteraddressservice;
}
public YxySendSysFilterService getYxysendsysfilterservice() {
return yxysendsysfilterservice;
}
public void setYxysendsysfilterservice(
YxySendSysFilterService yxysendsysfilterservice) {
this.yxysendsysfilterservice = yxysendsysfilterservice;
}
public YxyUserInfoService getYxyuserinfoservice() {
return yxyuserinfoservice;
}
public void setYxyuserinfoservice(YxyUserInfoService yxyuserinfoservice) {
this.yxyuserinfoservice = yxyuserinfoservice;
}
public YxyNoshieldEmailService getNoshieldemailservice() {
return noshieldemailservice;
}
public void setNoshieldemailservice(YxyNoshieldEmailService noshieldemailservice) {
this.noshieldemailservice = noshieldemailservice;
}
public YxyShieldDomainService getShielddomainservice() {
return shielddomainservice;
}
public void setShielddomainservice(YxyShieldDomainService shielddomainservice) {
this.shielddomainservice = shielddomainservice;
}
public String getLoginid() {
return loginid;
}
public void setLoginid(String loginid) {
this.loginid = loginid;
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public Map<String, Integer> getImportmap() {
return importmap;
}
public void setImportmap(Map<String, Integer> importmap) {
this.importmap = importmap;
}
public File getYxyaddr() {
return yxyaddr;
}
public void setYxyaddr(File yxyaddr) {
this.yxyaddr = yxyaddr;
}
public String getAddrfilename() {
return addrfilename;
}
public void setAddrfilename(String addrfilename) {
this.addrfilename = addrfilename;
}
public int getResult() {
return result;
}
public void setResult(int result) {
this.result = result;
}
public int getTypeid() {
return typeid;
}
public void setTypeid(int typeid) {
this.typeid = typeid;
}
public Map<String, List<String>> getErromap() {
return erromap;
}
public void setErromap(Map<String, List<String>> erromap) {
this.erromap = erromap;
}
public int getUploadtype() {
return uploadtype;
}
public void setUploadtype(int uploadtype) {
this.uploadtype = uploadtype;
}
public String getUploademail() {
return uploademail;
}
public void setUploademail(String uploademail) {
this.uploademail = uploademail;
}
public int getFilterid() {
return filterid;
}
public void setFilterid(int filterid) {
this.filterid = filterid;
}
public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context;
}
public String getTimestr() {
return timestr;
}
public void setTimestr(String timestr) {
this.timestr = timestr;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getIsmanytitle() {
return ismanytitle;
}
public void setIsmanytitle(int ismanytitle) {
this.ismanytitle = ismanytitle;
}
public String getLinkadderss() {
return linkadderss;
}
public void setLinkadderss(String linkadderss) {
this.linkadderss = linkadderss;
}
public String getAttrpath() {
return attrpath;
}
public void setAttrpath(String attrpath) {
this.attrpath = attrpath;
}
public String getEmailreg() {
return emailreg;
}
public Map<String, String> getImportaddress() {
return importaddress;
}
public void setImportaddress(Map<String, String> importaddress) {
this.importaddress = importaddress;
}
public String getTxtfilename() {
return txtfilename;
}
public void setTxtfilename(String txtfilename) {
this.txtfilename = txtfilename;
}
public int getMailid() {
return mailid;
}
public void setMailid(int mailid) {
this.mailid = mailid;
}
public int getSendci() {
return sendci;
}
public void setSendci(int sendci) {
this.sendci = sendci;
}
public String getSender() {
return sender;
}
public void setSender(String sender) {
this.sender = sender;
}
public String getReplyemail() {
return replyemail;
}
public void setReplyemail(String replyemail) {
this.replyemail = replyemail;
}
public int getUnlanguage() {
return unlanguage;
}
public void setUnlanguage(int unlanguage) {
this.unlanguage = unlanguage;
}
public String getUnselfstr() {
return unselfstr;
}
public void setUnselfstr(String unselfstr) {
this.unselfstr = unselfstr;
}
public int getMainid() {
return mainid;
}
public void setMainid(int mainid) {
this.mainid = mainid;
}
public YxyCustomerService getCustomerservice() {
return customerservice;
}
public void setCustomerservice(YxyCustomerService customerservice) {
this.customerservice = customerservice;
}
public YxyReadingInfoService getYxyreadinginfoservice() {
return yxyreadinginfoservice;
}
public void setYxyreadinginfoservice(YxyReadingInfoService yxyreadinginfoservice) {
this.yxyreadinginfoservice = yxyreadinginfoservice;
}
public int getJinchengid() {
return jinchengid;
}
public void setJinchengid(int jinchengid) {
this.jinchengid = jinchengid;
}
public String getCustomerid() {
return customerid;
}
public void setCustomerid(String customerid) {
this.customerid = customerid;
}
}