ChoiceTempIndexServiceImpl.java 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. package com.zx.dataservice.service.impl;
  2. import com.alibaba.fastjson.JSON;
  3. import com.zx.dataservice.controller.WebSocketController;
  4. import com.zx.dataservice.mapper1.ChoiceStockMapper;
  5. import com.zx.dataservice.pojo.StockRestPojo;
  6. import com.zx.dataservice.service.ChoiceTempIndexService;
  7. import com.zx.dataservice.utils.*;
  8. import com.zx.dataservice.vo.StockRestRedisVO;
  9. import com.zx.dataservice.vo.StockRestVO;
  10. import org.apache.commons.lang3.StringUtils;
  11. import org.slf4j.Logger;
  12. import org.slf4j.LoggerFactory;
  13. import org.springframework.beans.BeanUtils;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.stereotype.Service;
  16. import java.io.File;
  17. import java.math.BigDecimal;
  18. import java.util.*;
  19. @Service
  20. public class ChoiceTempIndexServiceImpl implements ChoiceTempIndexService {
  21. private static final Logger log = LoggerFactory.getLogger(ChoiceTempIndexServiceImpl.class);
  22. private static final String sourceFileUrl = "/www/wwwroot/csqdata/tempindex";
  23. private static final String goalFileUrl = "/www/wwwroot/csqdata/tempindex/backup";
  24. private static final String url = "http://qwer16888.vip/api/stock/updateBatchStockInfo.do";
  25. private static final String urlRedis = "http://qwer16888.vip/init/redis/updateInfo.do";
  26. private static final String sourceAfterFileUrl = "/www/wwwroot/csqdata/tempindex/after";
  27. private static final String goalAfterFileUrl = "/www/wwwroot/csqdata/tempindex/after/backup";
  28. @Autowired
  29. private ChoiceStockMapper choiceStockMapper;
  30. @Override
  31. public void analysisStockRestData(String type) {
  32. // 1.获取文件夹文件 按照时间顺序拿到一个
  33. List<File> files = FileTempIndexUtil.getFile(sourceFileUrl);
  34. if(null == files || 0 == files.size()){
  35. return;
  36. }
  37. List<StockRestPojo> stockRestPojoList = new ArrayList<>();
  38. List<StockRestVO> stockRestVOList = new ArrayList<>();
  39. List<StockRestRedisVO> stockRestRedisVOList = new ArrayList<>();
  40. StockRestPojo stockRestPojo;
  41. StockRestVO stockRestVO;
  42. StockRestRedisVO stockRestRedisVO;
  43. for (File file : files){
  44. // 2.移动文件去另外一个文件夹
  45. FileTempIndexUtil.moveFile(sourceFileUrl + File.separator + file.getName(), goalFileUrl);
  46. // 3.读取文件内容
  47. String str = FileTempIndexUtil.readFileContent(goalFileUrl + File.separator + file.getName());
  48. // 4.并解析
  49. if(StringUtils.isEmpty(str)){
  50. continue;
  51. }
  52. Map<String, List<String>> map = new HashMap<String, List<String>>();
  53. map = JSON.parseObject(str, HashMap.class);
  54. str = null;
  55. for (Map.Entry<String, List<String>> entry : map.entrySet()) {
  56. try {
  57. stockRestPojo = new StockRestPojo();
  58. stockRestPojo.setDate(String.valueOf(entry.getValue().get(0)));
  59. if(String.valueOf(entry.getValue().get(1)).equals("0")){
  60. continue;
  61. }
  62. stockRestPojo.setTime(String.valueOf(entry.getValue().get(1)));
  63. stockRestPojo.setNow(String.valueOf(entry.getValue().get(2)));
  64. stockRestPojo.setHigh(String.valueOf(entry.getValue().get(3)));
  65. stockRestPojo.setLow(String.valueOf(entry.getValue().get(4)));
  66. stockRestPojo.setOpen(String.valueOf(entry.getValue().get(5)));
  67. stockRestPojo.setPreclose(String.valueOf(entry.getValue().get(6)));
  68. stockRestPojo.setRoundlot(String.valueOf(entry.getValue().get(7)));
  69. stockRestPojo.setVolume(String.valueOf(entry.getValue().get(8)));
  70. stockRestPojo.setAmount(String.valueOf(entry.getValue().get(9)));
  71. stockRestPojo.setChange(String.valueOf(entry.getValue().get(10)));
  72. stockRestPojo.setPctchange(String.valueOf(entry.getValue().get(11)));
  73. stockRestPojo.setSpeed(String.valueOf(entry.getValue().get(12)));
  74. stockRestPojo.setVolumeratio("");
  75. stockRestPojo.setCommissionratio("");
  76. stockRestPojo.setCommissiondiff("");
  77. stockRestPojo.setTradestatus("");
  78. stockRestPojo.setOutvolume("");
  79. stockRestPojo.setInvolume("");
  80. stockRestPojo.setHighlimit("");
  81. stockRestPojo.setLowlimit("");
  82. stockRestPojo.setAverageprice("");
  83. stockRestPojo.setBuyprice1("");
  84. stockRestPojo.setBuyprice2("");
  85. stockRestPojo.setBuyprice3("");
  86. stockRestPojo.setBuyprice4("");
  87. stockRestPojo.setBuyprice5("");
  88. stockRestPojo.setBuyvolume1("");
  89. stockRestPojo.setBuyvolume2("");
  90. stockRestPojo.setBuyvolume3("");
  91. stockRestPojo.setBuyvolume4("");
  92. stockRestPojo.setBuyvolume5("");
  93. stockRestPojo.setSellprice1("");
  94. stockRestPojo.setSellprice2("");
  95. stockRestPojo.setSellprice3("");
  96. stockRestPojo.setSellprice4("");
  97. stockRestPojo.setSellprice5("");
  98. stockRestPojo.setSellvolume1("");
  99. stockRestPojo.setSellvolume2("");
  100. stockRestPojo.setSellvolume3("");
  101. stockRestPojo.setSellvolume4("");
  102. stockRestPojo.setSellvolume5("");
  103. stockRestPojo.setClosedtime("");
  104. stockRestPojo.setClosedvolume("");
  105. stockRestPojo.setClosedamount("");
  106. StringBuffer dateStr = new StringBuffer(stockRestPojo.getDate());
  107. if (StringUtils.isEmpty(stockRestPojo.getTime())) {
  108. dateStr = dateStr.append(000000);
  109. } else {
  110. if (5 == stockRestPojo.getTime().length()) {
  111. // 长度为5表示 小时前面需要补0
  112. dateStr = dateStr.append(0).append(stockRestPojo.getTime());
  113. } else {
  114. dateStr = dateStr.append(stockRestPojo.getTime());
  115. }
  116. }
  117. Date date = TimeUtil.strToDate(dateStr.toString());
  118. // 毫秒转成秒
  119. stockRestPojo.setRealTime(date.getTime() / 1000);
  120. Calendar calendar = Calendar.getInstance();
  121. calendar.setTime(date);
  122. int min = calendar.get(Calendar.MINUTE); // 获取分钟
  123. int sec = calendar.get(Calendar.SECOND); // 获取秒数
  124. // 1分钟数据
  125. if (sec != 0) {
  126. stockRestPojo.setDateOne(stockRestPojo.getRealTime() + 60 - sec);
  127. } else {
  128. stockRestPojo.setDateOne(stockRestPojo.getRealTime());
  129. }
  130. // 5分钟数据
  131. if (sec != 0 || min % 5 != 0) {
  132. stockRestPojo.setDateFive(stockRestPojo.getRealTime() + (5 * 60) - sec - (min % 5 * 60));
  133. } else {
  134. stockRestPojo.setDateFive(stockRestPojo.getRealTime());
  135. }
  136. // 15分钟数据
  137. if (sec != 0 || min % 15 != 0) {
  138. stockRestPojo.setDateFifteen(stockRestPojo.getRealTime() + (15 * 60) - sec - (min % 15 * 60));
  139. } else {
  140. stockRestPojo.setDateFifteen(stockRestPojo.getRealTime());
  141. }
  142. // 30分钟数据
  143. if (sec != 0 || min % 30 != 0) {
  144. stockRestPojo.setDateThirty(stockRestPojo.getRealTime() + (30 * 60) - sec - (min % 30 * 60));
  145. } else {
  146. stockRestPojo.setDateThirty(stockRestPojo.getRealTime());
  147. }
  148. // 60分钟数据
  149. if (sec != 0 || min % 60 != 0) {
  150. stockRestPojo.setDateSixty(stockRestPojo.getRealTime() + (60 * 60) - sec - (min % 60 * 60));
  151. } else {
  152. stockRestPojo.setDateSixty(stockRestPojo.getRealTime());
  153. }
  154. StringBuffer tableName = new StringBuffer("data_rt_");
  155. tableName.append(entry.getKey().replace(".", "_").toLowerCase());
  156. stockRestPojo.setCode(entry.getKey().toUpperCase());
  157. stockRestPojo.setTableName(tableName.toString());
  158. if(new BigDecimal(stockRestPojo.getNow()+"").compareTo(BigDecimal.ZERO)!=0) {
  159. stockRestPojoList.add(stockRestPojo);
  160. stockRestVO = new StockRestVO();
  161. BeanUtils.copyProperties(stockRestPojo, stockRestVO);
  162. stockRestVOList.add(stockRestVO);
  163. stockRestRedisVO = new StockRestRedisVO();
  164. stockRestRedisVO.setCode(entry.getKey().toUpperCase());
  165. stockRestRedisVO.setNowPrice(stockRestPojo.getNow());
  166. stockRestRedisVO.setChange(stockRestPojo.getChange());
  167. stockRestRedisVO.setHcrate(stockRestPojo.getPctchange());
  168. stockRestRedisVO.setHighlimit(stockRestPojo.getHighlimit());
  169. stockRestRedisVO.setLowlimit(stockRestPojo.getLowlimit());
  170. stockRestRedisVOList.add(stockRestRedisVO);
  171. }
  172. }catch (Exception e){
  173. log.error("错误数据导致失败" + e);
  174. }
  175. }
  176. map = null;
  177. }
  178. // 5.入库
  179. insertList(stockRestPojoList, stockRestVOList, stockRestRedisVOList,type);
  180. stockRestPojoList = null;
  181. }
  182. @Override
  183. public void analysisStockRestDataAfter(String type) {
  184. // 1.获取文件夹文件 按照时间顺序拿到一个
  185. List<File> files = FileTempIndexUtil.getFile(sourceAfterFileUrl);
  186. if(null == files || 0 == files.size()){
  187. return;
  188. }
  189. List<StockRestPojo> stockRestPojoList = new ArrayList<>();
  190. List<StockRestVO> stockRestVOList = new ArrayList<>();
  191. List<StockRestRedisVO> stockRestRedisVOList = new ArrayList<>();
  192. StockRestPojo stockRestPojo;
  193. StockRestVO stockRestVO;
  194. StockRestRedisVO stockRestRedisVO;
  195. for (File file : files){
  196. // 2.移动文件去另外一个文件夹
  197. FileTempIndexUtil.moveFile(sourceAfterFileUrl + File.separator + file.getName(), goalAfterFileUrl);
  198. // 3.读取文件内容
  199. String str = FileTempIndexUtil.readFileContent(goalAfterFileUrl + File.separator + file.getName());
  200. // 4.并解析
  201. if(StringUtils.isEmpty(str)){
  202. continue;
  203. }
  204. Map<String, List<String>> map = new HashMap<String, List<String>>();
  205. map = JSON.parseObject(str, HashMap.class);
  206. str = null;
  207. for (Map.Entry<String, List<String>> entry : map.entrySet()) {
  208. try {
  209. stockRestPojo = new StockRestPojo();
  210. stockRestPojo.setDate(String.valueOf(entry.getValue().get(0)));
  211. if(String.valueOf(entry.getValue().get(1)).equals("0")){
  212. continue;
  213. }
  214. stockRestPojo.setTime("150000");
  215. stockRestPojo.setNow(String.valueOf(entry.getValue().get(2)));
  216. stockRestPojo.setHigh(String.valueOf(entry.getValue().get(3)));
  217. stockRestPojo.setLow(String.valueOf(entry.getValue().get(4)));
  218. stockRestPojo.setOpen(String.valueOf(entry.getValue().get(5)));
  219. stockRestPojo.setPreclose(String.valueOf(entry.getValue().get(6)));
  220. stockRestPojo.setRoundlot(String.valueOf(entry.getValue().get(7)));
  221. stockRestPojo.setVolume(String.valueOf(entry.getValue().get(8)));
  222. stockRestPojo.setAmount(String.valueOf(entry.getValue().get(9)));
  223. stockRestPojo.setChange(String.valueOf(entry.getValue().get(10)));
  224. stockRestPojo.setPctchange(String.valueOf(entry.getValue().get(11)));
  225. stockRestPojo.setSpeed(String.valueOf(entry.getValue().get(12)));
  226. stockRestPojo.setVolumeratio("");
  227. stockRestPojo.setCommissionratio("");
  228. stockRestPojo.setCommissiondiff("");
  229. stockRestPojo.setTradestatus("");
  230. stockRestPojo.setOutvolume("");
  231. stockRestPojo.setInvolume("");
  232. stockRestPojo.setHighlimit("");
  233. stockRestPojo.setLowlimit("");
  234. stockRestPojo.setAverageprice("");
  235. stockRestPojo.setBuyprice1("");
  236. stockRestPojo.setBuyprice2("");
  237. stockRestPojo.setBuyprice3("");
  238. stockRestPojo.setBuyprice4("");
  239. stockRestPojo.setBuyprice5("");
  240. stockRestPojo.setBuyvolume1("");
  241. stockRestPojo.setBuyvolume2("");
  242. stockRestPojo.setBuyvolume3("");
  243. stockRestPojo.setBuyvolume4("");
  244. stockRestPojo.setBuyvolume5("");
  245. stockRestPojo.setSellprice1("");
  246. stockRestPojo.setSellprice2("");
  247. stockRestPojo.setSellprice3("");
  248. stockRestPojo.setSellprice4("");
  249. stockRestPojo.setSellprice5("");
  250. stockRestPojo.setSellvolume1("");
  251. stockRestPojo.setSellvolume2("");
  252. stockRestPojo.setSellvolume3("");
  253. stockRestPojo.setSellvolume4("");
  254. stockRestPojo.setSellvolume5("");
  255. stockRestPojo.setClosedtime("");
  256. stockRestPojo.setClosedvolume("");
  257. stockRestPojo.setClosedamount("");
  258. StringBuffer dateStr = new StringBuffer(stockRestPojo.getDate());
  259. if (StringUtils.isEmpty(stockRestPojo.getTime())) {
  260. dateStr = dateStr.append(000000);
  261. } else {
  262. if (5 == stockRestPojo.getTime().length()) {
  263. // 长度为5表示 小时前面需要补0
  264. dateStr = dateStr.append(0).append(stockRestPojo.getTime());
  265. } else {
  266. dateStr = dateStr.append(stockRestPojo.getTime());
  267. }
  268. }
  269. Date date = TimeUtil.strToDate(dateStr.toString());
  270. // 毫秒转成秒
  271. stockRestPojo.setRealTime(date.getTime() / 1000);
  272. Calendar calendar = Calendar.getInstance();
  273. calendar.setTime(date);
  274. int min = calendar.get(Calendar.MINUTE); // 获取分钟
  275. int sec = calendar.get(Calendar.SECOND); // 获取秒数
  276. // 1分钟数据
  277. if (sec != 0) {
  278. stockRestPojo.setDateOne(stockRestPojo.getRealTime() + 60 - sec);
  279. } else {
  280. stockRestPojo.setDateOne(stockRestPojo.getRealTime());
  281. }
  282. // 5分钟数据
  283. if (sec != 0 || min % 5 != 0) {
  284. stockRestPojo.setDateFive(stockRestPojo.getRealTime() + (5 * 60) - sec - (min % 5 * 60));
  285. } else {
  286. stockRestPojo.setDateFive(stockRestPojo.getRealTime());
  287. }
  288. // 15分钟数据
  289. if (sec != 0 || min % 15 != 0) {
  290. stockRestPojo.setDateFifteen(stockRestPojo.getRealTime() + (15 * 60) - sec - (min % 15 * 60));
  291. } else {
  292. stockRestPojo.setDateFifteen(stockRestPojo.getRealTime());
  293. }
  294. // 30分钟数据
  295. if (sec != 0 || min % 30 != 0) {
  296. stockRestPojo.setDateThirty(stockRestPojo.getRealTime() + (30 * 60) - sec - (min % 30 * 60));
  297. } else {
  298. stockRestPojo.setDateThirty(stockRestPojo.getRealTime());
  299. }
  300. // 60分钟数据
  301. if (sec != 0 || min % 60 != 0) {
  302. stockRestPojo.setDateSixty(stockRestPojo.getRealTime() + (60 * 60) - sec - (min % 60 * 60));
  303. } else {
  304. stockRestPojo.setDateSixty(stockRestPojo.getRealTime());
  305. }
  306. StringBuffer tableName = new StringBuffer("data_rt_");
  307. tableName.append(entry.getKey().replace(".", "_").toLowerCase());
  308. stockRestPojo.setCode(entry.getKey().toUpperCase());
  309. stockRestPojo.setTableName(tableName.toString());
  310. if(new BigDecimal(stockRestPojo.getNow()+"").compareTo(BigDecimal.ZERO)!=0) {
  311. stockRestPojoList.add(stockRestPojo);
  312. stockRestVO = new StockRestVO();
  313. BeanUtils.copyProperties(stockRestPojo, stockRestVO);
  314. stockRestVOList.add(stockRestVO);
  315. stockRestRedisVO = new StockRestRedisVO();
  316. stockRestRedisVO.setCode(entry.getKey().toUpperCase());
  317. stockRestRedisVO.setNowPrice(stockRestPojo.getNow());
  318. stockRestRedisVO.setChange(stockRestPojo.getChange());
  319. stockRestRedisVO.setHcrate(stockRestPojo.getPctchange());
  320. stockRestRedisVO.setHighlimit(stockRestPojo.getHighlimit());
  321. stockRestRedisVO.setLowlimit(stockRestPojo.getLowlimit());
  322. stockRestRedisVOList.add(stockRestRedisVO);
  323. }
  324. }catch (Exception e){
  325. log.error("错误数据导致失败" + e);
  326. }
  327. }
  328. map = null;
  329. }
  330. // 5.入库
  331. insertListAfter(stockRestPojoList, stockRestVOList, stockRestRedisVOList,type);
  332. stockRestPojoList = null;
  333. }
  334. private void insertListAfter(List<StockRestPojo> list, List<StockRestVO> stockRestVOList, List<StockRestRedisVO> stockRestRedisVOList,String type) {
  335. int insertLength = list.size();
  336. int i = 0;
  337. int insertSize = 500;
  338. while (insertLength > insertSize) {
  339. choiceStockMapper.insertBatchByAfter(list.subList(i, i + insertSize));
  340. List<StockRestVO> subList = stockRestVOList.subList(i, i + insertSize);
  341. List<StockRestRedisVO> subRedisList = stockRestRedisVOList.subList(i, i + insertSize);
  342. i = i + insertSize;
  343. insertLength = insertLength - insertSize;
  344. Thread thread=new Thread(new Runnable() {
  345. @Override
  346. public void run() {
  347. // HttpRequest.httpPostWithjson(url, JSON.toJSONString(subList));
  348. // if(BuyAndSellUtils.isTransState()){
  349. try {
  350. final String[] webArr = ZXOptions.get("ws.key").split(";");//websocket key
  351. for (int j = 0; j < webArr.length; j++) {
  352. new WebSocketController().sendSysMsg(webArr[j],JSON.toJSONString(subRedisList));
  353. }
  354. // HttpRequest.httpPostWithjson(urlRedis, JSON.toJSONString(subRedisList));
  355. }catch (Exception e){
  356. log.error("插入redis错误" + e);
  357. }
  358. // }
  359. }
  360. });
  361. thread.start();
  362. }
  363. if (insertLength > 0) {
  364. choiceStockMapper.insertBatchByAfter(list.subList(i, i + insertLength));
  365. List<StockRestVO> subList = stockRestVOList.subList(i, i + insertLength);
  366. List<StockRestRedisVO> subRedisList = stockRestRedisVOList.subList(i, i + insertLength);
  367. Thread thread=new Thread(new Runnable() {
  368. @Override
  369. public void run() {
  370. // HttpRequest.httpPostWithjson(url, JSON.toJSONString(subList));
  371. // if(BuyAndSellUtils.isTransState()){
  372. try {
  373. final String[] webArr = ZXOptions.get("ws.key").split(";");//websocket key
  374. for (int j = 0; j < webArr.length; j++) {
  375. new WebSocketController().sendSysMsg(webArr[j],JSON.toJSONString(subRedisList));
  376. }
  377. // HttpRequest.httpPostWithjson(urlRedis, JSON.toJSONString(subRedisList));
  378. }catch (Exception e){
  379. log.error("插入redis错误" + e);
  380. }
  381. // }
  382. }
  383. });
  384. thread.start();
  385. }
  386. }
  387. private void insertList(List<StockRestPojo> list, List<StockRestVO> stockRestVOList, List<StockRestRedisVO> stockRestRedisVOList,String type) {
  388. int insertLength = list.size();
  389. int i = 0;
  390. int insertSize = 500;
  391. while (insertLength > insertSize) {
  392. if("now".equals(type)){
  393. choiceStockMapper.insertBatch(list.subList(i, i + insertSize));
  394. }else {
  395. choiceStockMapper.insertBatchByAfter(list.subList(i, i + insertSize));
  396. }
  397. List<StockRestVO> subList = stockRestVOList.subList(i, i + insertSize);
  398. List<StockRestRedisVO> subRedisList = stockRestRedisVOList.subList(i, i + insertSize);
  399. i = i + insertSize;
  400. insertLength = insertLength - insertSize;
  401. Thread thread=new Thread(new Runnable() {
  402. @Override
  403. public void run() {
  404. // HttpRequest.httpPostWithjson(url, JSON.toJSONString(subList));
  405. // if(BuyAndSellUtils.isTransState()){
  406. try {
  407. final String[] webArr = ZXOptions.get("ws.key").split(";");//websocket key
  408. for (int j = 0; j < webArr.length; j++) {
  409. new WebSocketController().sendSysMsg(webArr[j],JSON.toJSONString(subRedisList));
  410. }
  411. // HttpRequest.httpPostWithjson(urlRedis, JSON.toJSONString(subRedisList));
  412. }catch (Exception e){
  413. log.error("插入redis错误" + e);
  414. }
  415. // }
  416. }
  417. });
  418. thread.start();
  419. }
  420. if (insertLength > 0) {
  421. if("now".equals(type)){
  422. choiceStockMapper.insertBatch(list.subList(i, i + insertLength));
  423. }else {
  424. choiceStockMapper.insertBatchByAfter(list.subList(i, i + insertLength));
  425. }
  426. List<StockRestVO> subList = stockRestVOList.subList(i, i + insertLength);
  427. List<StockRestRedisVO> subRedisList = stockRestRedisVOList.subList(i, i + insertLength);
  428. Thread thread=new Thread(new Runnable() {
  429. @Override
  430. public void run() {
  431. // HttpRequest.httpPostWithjson(url, JSON.toJSONString(subList));
  432. // if(BuyAndSellUtils.isTransState()){
  433. try {
  434. final String[] webArr = ZXOptions.get("ws.key").split(";");//websocket key
  435. for (int j = 0; j < webArr.length; j++) {
  436. new WebSocketController().sendSysMsg(webArr[j],JSON.toJSONString(subRedisList));
  437. }
  438. // HttpRequest.httpPostWithjson(urlRedis, JSON.toJSONString(subRedisList));
  439. }catch (Exception e){
  440. log.error("插入redis错误" + e);
  441. }
  442. // }
  443. }
  444. });
  445. thread.start();
  446. }
  447. }
  448. }