ccj il y a 1 an
Parent
commit
f39a8a77d0

+ 1 - 0
winsea-haixin-platform-backend/src/main/java/com/yh/saas/PlatformApplication.java

@@ -1,6 +1,7 @@
 package com.yh.saas;
 
 import com.winsea.svc.common.annotation.EnableService;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import com.yh.saas.plugin.yiliangyiyun.util.TestJson;
 import org.activiti.spring.boot.SecurityAutoConfiguration;
 import org.mybatis.spring.annotation.MapperScan;

+ 1 - 1
winsea-haixin-plugin-operation/src/main/java/com/yh/saas/plugin/operation/service/impl/VisitorRegisterServiceImpl.java

@@ -238,7 +238,7 @@ public class VisitorRegisterServiceImpl implements IVisitorRegisterService {
 //        Account account = new Account();
 //        account.setLoginName(manager.getManagerName());
 //        account.setLoginPassword(tenant.getPassword());
-//        account.setUserId(manager.getManagerId());
+//        account.initGeTui(manager.getManagerId());
 //        account.setUserMobilePhone(manager.getManagerMobilePhone());
 //        account.setAccountType(Account.AccountType.MANAGER);
 //        account.setEnabled(1);

+ 2 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CargoOwnerInfoServiceImpl.java

@@ -249,7 +249,7 @@ public class CargoOwnerInfoServiceImpl extends ServiceImpl<CargoOwnerInfoMapper,
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //驳回
@@ -269,7 +269,7 @@ public class CargoOwnerInfoServiceImpl extends ServiceImpl<CargoOwnerInfoMapper,
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             // 禁用

+ 2 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CarrierInfoServiceImpl.java

@@ -173,7 +173,7 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, HyCar
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             this.updateById(hyCarrierInfo);
@@ -296,7 +296,7 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, HyCar
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
         }

+ 1 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverCarInfoServiceImpl.java

@@ -276,7 +276,7 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //更改车辆状态信息

+ 2 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverInfoServiceImpl.java

@@ -425,7 +425,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //驳回
@@ -444,7 +444,7 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             // 禁用

+ 1 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FeedbackReportServiceImpl.java

@@ -183,7 +183,7 @@ public class FeedbackReportServiceImpl extends ServiceImpl<FeedbackReportMapper,
             newsInfo.setBussId(feedbackReport.getId());
             newsInfoService.addNewsInfo(newsInfo);
             //个推
-            geTuiUtils.setUserId(newsInfo.getReCommonId());
+            geTuiUtils.initGeTui(newsInfo.getReCommonId());
             geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
         }
         return "OK";

+ 1 - 1
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/NewsInfoServiceImpl.java

@@ -109,7 +109,7 @@ public class NewsInfoServiceImpl extends ServiceImpl<NewsInfoMapper, NewsInfo> i
                 newsInfo1.setNewsFlag("0");
                 this.insert(newsInfo1);
                 //个推
-                geTuiUtils.setUserId(newsInfo1.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo1.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo1.getNewsTitle(),newsInfo1.getNewsContent(),newsInfo1.getReCommonId());
             }
         }

+ 8 - 8
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/OrderInfoServiceImpl.java

@@ -166,7 +166,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                         newsInfo.setNewsType("超时通知");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                         //给平台发送消息
                         NewsInfo newsInfo1 = new NewsInfo();
@@ -187,7 +187,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                         newsInfo2.setNewsType("超时通知");
                         newsInfoService.addNewsInfo(newsInfo2);
                         //个推
-                        geTuiUtils.setUserId(newsInfo2.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo2.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo2.getNewsTitle(),newsInfo2.getNewsContent(),newsInfo2.getReCommonId());
                     }
                 }
@@ -532,7 +532,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //货主终止
@@ -553,7 +553,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //平台终止
@@ -572,7 +572,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
 
                 // 向货主发送信息
@@ -586,7 +586,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo1.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo1);
                 //个推
-                geTuiUtils.setUserId(newsInfo1.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo1.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo1.getNewsTitle(),newsInfo1.getNewsContent(),newsInfo1.getReCommonId());
             }
             orderInfo1.setOrderStatusKey(StatusEnum.DRIVER_ORDER_END.getFlag());
@@ -1005,7 +1005,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //驳回
@@ -1027,7 +1027,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             this.updateById(orderInfo1);

+ 29 - 29
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PublishTaskInfoServiceImpl.java

@@ -179,7 +179,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //身份证到期前10天
@@ -195,7 +195,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //身份证到期前3天
@@ -211,7 +211,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                 }
@@ -263,7 +263,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //授权书到期前10天
@@ -279,7 +279,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //授权书到期前3天
@@ -295,7 +295,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
             });
@@ -354,7 +354,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //身份证到期前10天
@@ -370,7 +370,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //身份证到期前3天
@@ -386,7 +386,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                 }
@@ -415,7 +415,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //驾驶证到期前10天
@@ -431,7 +431,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //驾驶证到期前3天
@@ -447,7 +447,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //从业资格证
@@ -475,7 +475,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //从业资格证到期前10天
@@ -491,7 +491,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //从业资格证到期前3天
@@ -507,7 +507,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
             });
@@ -540,7 +540,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //行驶证到期前10天
@@ -556,7 +556,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //行驶证到期前3天
@@ -572,7 +572,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 if (hyDriverCarInfo.getTrailerLicenseValidityDate() != null) {
@@ -597,7 +597,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //挂车行驶证到期前10天
@@ -613,7 +613,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //挂车行驶证到期前3天
@@ -629,7 +629,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                 }
@@ -654,7 +654,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //道路运输证到期前10天
@@ -670,7 +670,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //道路运输证到期前3天
@@ -686,7 +686,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
                     //个推
-                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.initGeTui(newsInfo.getReCommonId());
                     geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 if (hyDriverCarInfo.getTrailerOperationCertificateValidityDate() != null) {
@@ -711,7 +711,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //挂车运输证到期前10天
@@ -727,7 +727,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //挂车运输证到期前3天
@@ -743,7 +743,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
                         //个推
-                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.initGeTui(newsInfo.getReCommonId());
                         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                 }
@@ -1633,7 +1633,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
         newsInfo.setNewsType("承运通知");
         newsInfoService.addNewsInfo(newsInfo);
         //个推
-        geTuiUtils.setUserId(newsInfo.getReCommonId());
+        geTuiUtils.initGeTui(newsInfo.getReCommonId());
         geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
         //新增承运信息
         HyCarrierInfo hyCarrierInfo = new HyCarrierInfo();
@@ -1684,7 +1684,7 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
                 //个推
-                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.initGeTui(newsInfo.getReCommonId());
                 geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //更改信息

+ 128 - 186
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/GeTuiUtils.java

@@ -19,7 +19,6 @@ import com.getui.push.v2.sdk.dto.req.message.ios.Alert;
 import com.getui.push.v2.sdk.dto.req.message.ios.Aps;
 import com.getui.push.v2.sdk.dto.req.message.ios.IosDTO;
 import com.gexin.rp.sdk.base.IPushResult;
-import com.winnerlook.model.VoiceNotifyBody;
 import com.gexin.rp.sdk.base.impl.SingleMessage;
 import com.gexin.rp.sdk.base.impl.Target;
 import com.gexin.rp.sdk.base.payload.APNPayload;
@@ -30,14 +29,9 @@ import com.winsea.svc.base.base.entity.CommonStaff;
 import com.winsea.svc.base.base.mapper.CommonStaffMapper;
 import com.yh.saas.plugin.yiliangyiyun.entity.CommonUser;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CommonUserMapper;
-import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-import javax.annotation.Resource;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -50,8 +44,6 @@ import java.util.Map;
 public class GeTuiUtils {
     @Autowired
     private CommonUserMapper commonUserMapper;
-    @Autowired
-    private CommonStaffMapper commonStaffMapper;
     private String appId = "";
     private String appKey = "";
     private String masterSecret = "";
@@ -59,15 +51,8 @@ public class GeTuiUtils {
     @Value("${com.changyuntong.env}")
     private String ENV;
 
-    public void setUserId(String userId) {
+    public void initGeTui(String userId) {
         this.userId = userId;
-    }
-
-    public String userId;
-    //别名推送方式
-    static String host = "http://sdk.open.api.igexin.com/apiex.htm";
-
-    public GeTuiUtils(){
         CommonUser userDO = this.commonUserMapper.selectById(userId);
         if("1".equals(userDO.getIdentification())){
             //司机端
@@ -80,7 +65,6 @@ public class GeTuiUtils {
             appKey = "xhF3JuJh2Y8xjyQY4LFqo";
             masterSecret = "e72ag0SXpU5LOvgroi7Oh5";
         }
-
         GtApiConfiguration apiConfiguration = new GtApiConfiguration();
         //填写应用配置
         apiConfiguration.setAppId(appId);
@@ -94,6 +78,10 @@ public class GeTuiUtils {
         pushApi = apiHelper.creatApi(PushApi.class);
     }
 
+    public String userId;
+    //别名推送方式
+    static String host = "http://sdk.open.api.igexin.com/apiex.htm";
+
     public void pushByCid(String title,String content,String userId){
         if ("3".equals(ENV)) {
             try {
@@ -218,175 +206,129 @@ public class GeTuiUtils {
             }
         }
     }
-    public void pushByCidPhone(String title,String content,String staffId){
-        if ("3".equals(ENV)) {
-            try {
-//                CommonUser userDO = commonUserMapper.selectById(userId);
-                CommonStaff commonStaff = commonStaffMapper.selectById(staffId);
-                List<CommonUser> list = commonUserMapper.selectList(new EntityWrapper<CommonUser>()
-                        .eq("phone",commonStaff.getStaffMobilePhone())
-                        .eq("delete_flag",0));
-                String cid = "";
-                if(list.size() > 0){
-                    cid = list.get(0).getCid();
-                }
-                else{
-                    return;
-                }
-                //根据cid进行单推
-                PushDTO<Audience> pushDTO = new PushDTO<Audience>();
-                // 设置推送参数
-                pushDTO.setRequestId(System.currentTimeMillis() + "");//requestid需要每次变化唯一
-                //配置推送条件
-                // 1: 表示该消息在用户在线时推送个推通道,用户离线时推送厂商通道;
-                // 2: 表示该消息只通过厂商通道策略下发,不考虑用户是否在线;
-                // 3: 表示该消息只通过个推通道下发,不考虑用户是否在线;
-                // 4: 表示该消息优先从厂商通道下发,若消息内容在厂商通道代发失败后会从个推通道下发。
-                Strategy strategy = new Strategy();
-                strategy.setDef(1);
-                Settings settings = new Settings();
-                settings.setStrategy(strategy);
-                pushDTO.setSettings(settings);
-                settings.setTtl(3600000);//消息有效期,走厂商消息需要设置该值
-                //推送苹果离线通知标题内容
-                Alert alert = new Alert();
-                alert.setTitle(title);
-                alert.setBody(content);
-                Aps aps = new Aps();
-                //1表示静默推送(无通知栏消息),静默推送时不需要填写其他参数。
-                //苹果建议1小时最多推送3条静默消息
-                aps.setContentAvailable(0);
-                aps.setSound("pushsound.caf");
-                aps.setAlert(alert);
-                IosDTO iosDTO = new IosDTO();
-                iosDTO.setAps(aps);
-                iosDTO.setType("notify");
-                PushChannel pushChannel = new PushChannel();
-                pushChannel.setIos(iosDTO);
-                //安卓离线厂商通道推送消息体
-//            PushChannel pushChannel = new PushChannel();
-                AndroidDTO androidDTO = new AndroidDTO();
-                Ups ups = new Ups();
-                ThirdNotification notification1 = new ThirdNotification();
-                ;
-                notification1.setTitle(title);
-                notification1.setBody(content);
-                notification1.setClickType("intent");
-                notification1.setIntent("intent:#Intent;launchFlags=0x04000000;action=android.intent.action.oppopush;component=uni.UNI7297DA2/io.dcloud.PandoraEntry;S.UP-OL-SU=true;S.title=" + title + ";S.content=" + content + ";S.payload=test;end");
-                ups.setNotification(notification1);
-                //各厂商自有功能单项设置
-                ups.addOption("HW", "/message/android/notification/badge/class", "io.dcloud.PandoraEntry ");
-                ups.addOption("HW", "/message/android/notification/badge/add_num", 1);
-                ups.addOption("HW", "/message/android/notification/sound", "/raw/ring");
-                ups.addOption("HW", "/message/android/notification/channel_id", "task2");
-                ups.addOption("HW", "/message/android/notification/importance", "NORMAL");
-                ups.addOption("HW", "/message/android/notification/category", "WORK");
-                ups.addOption("HW", "/message/android/notification/default_sound", false);
-                ups.addOption("XM", "/extra.sound_uri", "android.resource://uni.UNI7297DA2/raw/task1");
-                ups.addOption("XM", "/extra.channel_id", "high_custom_5");
-                //ups.addOption("VV","classification",1);
-                androidDTO.setUps(ups);
-                pushChannel.setAndroid(androidDTO);
-                pushDTO.setPushChannel(pushChannel);
-                // PushMessage在线走个推通道才会起作用的消息体
-                PushMessage pushMessage = new PushMessage();
-                GTNotification gtNotification = new GTNotification();
-                gtNotification.setTitle(title);
-                gtNotification.setBody(content);
-                gtNotification.setRingName("ring");
-                gtNotification.setChannelId("task1");
-                gtNotification.setChannelName("工作事项提醒");
-                gtNotification.setChannelLevel("4");
-                gtNotification.setClickType("startapp");
-                gtNotification.setLogo("logo.png");
-                pushMessage.setNotification(gtNotification);
-//            pushMessage.setTransmission(" {title:\""+title+"\",content:\""+content+"\",payload:\"test\"}");
-                pushDTO.setPushMessage(pushMessage);
-//            pushMessage.setTransmission(" {title:\"标题\",content:\"内容\",payload:\"自定义数据\"}");
-                // 设置接收人信息
-                Audience audience = new Audience();
-                pushDTO.setAudience(audience);
-                audience.addCid(cid);
-
-                // 进行cid单推
-                ApiResult<Map<String, Map<String, String>>> apiResult = pushApi.pushToSingleByCid(pushDTO);
-                if (apiResult.isSuccess()) {
-                    // success
-                    System.out.println("个推 通知消息3:" + apiResult.getData());
-                } else {
-                    // failed
-                    System.out.println("code:" + apiResult.getCode() + ", msg: " + apiResult.getMsg());
-                }
-                //推送穿透消息
-                IGtPush push = new IGtPush(host, appKey, masterSecret);
-                TransmissionTemplate template = genTransmissionTemplate(content, title, appId, appKey);// 设定消息模式为透传
-                SingleMessage msg = new SingleMessage();// 个人推送
-                msg.setOffline(true);
-                msg.setOfflineExpireTime(2 * 1000 * 3600);
-                msg.setData(template);
-                Target target = new Target();// 设定接收人
-                target.setAppId(appId);
-                target.setClientId(cid);
-                try {
-                    IPushResult ret = push.pushMessageToSingle(msg, target);
-                    System.out.println("个推 通知消息1:" + ret.getResponse().toString());
-                } catch (RequestException e) {
-                    String requstId = e.getRequestId();
-                    IPushResult ret = push.pushMessageToSingle(msg, target, requstId);
-                    System.out.println("个推 通知消息2:" + ret.getResponse().toString());
-                }
-                System.out.println("推送成功:" + list.get(0).getUserName() + "," + title + "," + content);
-            } catch (Exception e) {
-                System.out.println("推送异常:" + e.getMessage());
-            }
-        }
-    }
-
-    public void callPhone(String userId) throws Exception {
-        CommonStaff commonStaff= commonStaffMapper.selectById(userId);
-        System.out.println("result = " + commonStaff.getStaffName());
-        System.out.println("----------------------");
-        // 电话信息
-
-        /*请修改为平台分配的accountId*/
-        String accountId="285481";
-        /*请修改为平台分配的token*/
-        String token="9e412526531a43f296d23bb29771c761";
-        VoiceNotifyBody message = new VoiceNotifyBody();
-        /*用户接收回执的服务器地址*/
-        message.setCallbackUrl("http://192.168.1.102:9780/voice/api/VoiceWeb/receiveRecord");
-//        CommonStaff commonStaff= commonStaffMapper.selectById(userId);
-//        message.setCalleeNumber("18840825257");
-        if(commonStaff != null){
-            message.setCalleeNumber(commonStaff.getStaffMobilePhone());
-        }
-        message.setReplayTimes(3);
-        message.setDisplayNumber("");
-
-        /*设置平台分配的模板ID*/
-        message.setTemplateId("401047");
-
-        LinkedHashMap<String,String> params = new LinkedHashMap<String,String>();
-        /*设置模板参数*/
-//        params.put("{1}","八就二六五四三五一");
-        /*params.put("{2}","您好");
-        params.put("{3}","895621");*/
-        message.setTemplateArgs(params);
-
-        try {
-//            VoiceResponseResult result = VoiceSender.httpsSendVoiceNotify(message, accountId, token);
-
-//            System.out.println("result = " + result);
-
-        }catch (Exception e) {
-            //Log.e(this.getClass(), " e = " + e);
-            e.printStackTrace();
-        }
-
-    }
-
-
-
+//    public void pushByCidPhone(String title,String content,String staffId){
+//        if ("3".equals(ENV)) {
+//            try {
+////                CommonUser userDO = commonUserMapper.selectById(userId);
+//                CommonStaff commonStaff = commonStaffMapper.selectById(staffId);
+//                List<CommonUser> list = commonUserMapper.selectList(new EntityWrapper<CommonUser>()
+//                        .eq("phone",commonStaff.getStaffMobilePhone())
+//                        .eq("delete_flag",0));
+//                String cid = "";
+//                if(list.size() > 0){
+//                    cid = list.get(0).getCid();
+//                }
+//                else{
+//                    return;
+//                }
+//                //根据cid进行单推
+//                PushDTO<Audience> pushDTO = new PushDTO<Audience>();
+//                // 设置推送参数
+//                pushDTO.setRequestId(System.currentTimeMillis() + "");//requestid需要每次变化唯一
+//                //配置推送条件
+//                // 1: 表示该消息在用户在线时推送个推通道,用户离线时推送厂商通道;
+//                // 2: 表示该消息只通过厂商通道策略下发,不考虑用户是否在线;
+//                // 3: 表示该消息只通过个推通道下发,不考虑用户是否在线;
+//                // 4: 表示该消息优先从厂商通道下发,若消息内容在厂商通道代发失败后会从个推通道下发。
+//                Strategy strategy = new Strategy();
+//                strategy.setDef(1);
+//                Settings settings = new Settings();
+//                settings.setStrategy(strategy);
+//                pushDTO.setSettings(settings);
+//                settings.setTtl(3600000);//消息有效期,走厂商消息需要设置该值
+//                //推送苹果离线通知标题内容
+//                Alert alert = new Alert();
+//                alert.setTitle(title);
+//                alert.setBody(content);
+//                Aps aps = new Aps();
+//                //1表示静默推送(无通知栏消息),静默推送时不需要填写其他参数。
+//                //苹果建议1小时最多推送3条静默消息
+//                aps.setContentAvailable(0);
+//                aps.setSound("pushsound.caf");
+//                aps.setAlert(alert);
+//                IosDTO iosDTO = new IosDTO();
+//                iosDTO.setAps(aps);
+//                iosDTO.setType("notify");
+//                PushChannel pushChannel = new PushChannel();
+//                pushChannel.setIos(iosDTO);
+//                //安卓离线厂商通道推送消息体
+////            PushChannel pushChannel = new PushChannel();
+//                AndroidDTO androidDTO = new AndroidDTO();
+//                Ups ups = new Ups();
+//                ThirdNotification notification1 = new ThirdNotification();
+//                ;
+//                notification1.setTitle(title);
+//                notification1.setBody(content);
+//                notification1.setClickType("intent");
+//                notification1.setIntent("intent:#Intent;launchFlags=0x04000000;action=android.intent.action.oppopush;component=uni.UNI7297DA2/io.dcloud.PandoraEntry;S.UP-OL-SU=true;S.title=" + title + ";S.content=" + content + ";S.payload=test;end");
+//                ups.setNotification(notification1);
+//                //各厂商自有功能单项设置
+//                ups.addOption("HW", "/message/android/notification/badge/class", "io.dcloud.PandoraEntry ");
+//                ups.addOption("HW", "/message/android/notification/badge/add_num", 1);
+//                ups.addOption("HW", "/message/android/notification/sound", "/raw/ring");
+//                ups.addOption("HW", "/message/android/notification/channel_id", "task2");
+//                ups.addOption("HW", "/message/android/notification/importance", "NORMAL");
+//                ups.addOption("HW", "/message/android/notification/category", "WORK");
+//                ups.addOption("HW", "/message/android/notification/default_sound", false);
+//                ups.addOption("XM", "/extra.sound_uri", "android.resource://uni.UNI7297DA2/raw/task1");
+//                ups.addOption("XM", "/extra.channel_id", "high_custom_5");
+//                //ups.addOption("VV","classification",1);
+//                androidDTO.setUps(ups);
+//                pushChannel.setAndroid(androidDTO);
+//                pushDTO.setPushChannel(pushChannel);
+//                // PushMessage在线走个推通道才会起作用的消息体
+//                PushMessage pushMessage = new PushMessage();
+//                GTNotification gtNotification = new GTNotification();
+//                gtNotification.setTitle(title);
+//                gtNotification.setBody(content);
+//                gtNotification.setRingName("ring");
+//                gtNotification.setChannelId("task1");
+//                gtNotification.setChannelName("工作事项提醒");
+//                gtNotification.setChannelLevel("4");
+//                gtNotification.setClickType("startapp");
+//                gtNotification.setLogo("logo.png");
+//                pushMessage.setNotification(gtNotification);
+////            pushMessage.setTransmission(" {title:\""+title+"\",content:\""+content+"\",payload:\"test\"}");
+//                pushDTO.setPushMessage(pushMessage);
+////            pushMessage.setTransmission(" {title:\"标题\",content:\"内容\",payload:\"自定义数据\"}");
+//                // 设置接收人信息
+//                Audience audience = new Audience();
+//                pushDTO.setAudience(audience);
+//                audience.addCid(cid);
+//
+//                // 进行cid单推
+//                ApiResult<Map<String, Map<String, String>>> apiResult = pushApi.pushToSingleByCid(pushDTO);
+//                if (apiResult.isSuccess()) {
+//                    // success
+//                    System.out.println("个推 通知消息3:" + apiResult.getData());
+//                } else {
+//                    // failed
+//                    System.out.println("code:" + apiResult.getCode() + ", msg: " + apiResult.getMsg());
+//                }
+//                //推送穿透消息
+//                IGtPush push = new IGtPush(host, appKey, masterSecret);
+//                TransmissionTemplate template = genTransmissionTemplate(content, title, appId, appKey);// 设定消息模式为透传
+//                SingleMessage msg = new SingleMessage();// 个人推送
+//                msg.setOffline(true);
+//                msg.setOfflineExpireTime(2 * 1000 * 3600);
+//                msg.setData(template);
+//                Target target = new Target();// 设定接收人
+//                target.setAppId(appId);
+//                target.setClientId(cid);
+//                try {
+//                    IPushResult ret = push.pushMessageToSingle(msg, target);
+//                    System.out.println("个推 通知消息1:" + ret.getResponse().toString());
+//                } catch (RequestException e) {
+//                    String requstId = e.getRequestId();
+//                    IPushResult ret = push.pushMessageToSingle(msg, target, requstId);
+//                    System.out.println("个推 通知消息2:" + ret.getResponse().toString());
+//                }
+//                System.out.println("推送成功:" + list.get(0).getUserName() + "," + title + "," + content);
+//            } catch (Exception e) {
+//                System.out.println("推送异常:" + e.getMessage());
+//            }
+//        }
+//    }
 
     private static TransmissionTemplate genTransmissionTemplate(String content, String title, String appId, String appKey) throws Exception {
         TransmissionTemplate template = new TransmissionTemplate();