haungfuli 1 年之前
父節點
當前提交
1a672c9e04
共有 17 個文件被更改,包括 552 次插入99 次删除
  1. 二進制
      templates/tmp.jpg
  2. 1 0
      winsea-haixin-platform-backend/src/main/java/com/yh/saas/PlatformApplication.java
  3. 13 0
      winsea-haixin-plugin-wangluohuoyun/pom.xml
  4. 11 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/NewsInfoController.java
  5. 3 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/CommonUserMapper.java
  6. 7 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/INewsInfoService.java
  7. 9 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CargoOwnerInfoServiceImpl.java
  8. 9 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CarrierInfoServiceImpl.java
  9. 1 2
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CommonUserServiceImpl.java
  10. 7 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverCarInfoServiceImpl.java
  11. 9 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/DriverInfoServiceImpl.java
  12. 6 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/FeedbackReportServiceImpl.java
  13. 34 1
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/NewsInfoServiceImpl.java
  14. 27 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/OrderInfoServiceImpl.java
  15. 90 0
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/PublishTaskInfoServiceImpl.java
  16. 3 3
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/EntityAnalyse.java
  17. 322 93
      winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/GeTuiUtils.java

二進制
templates/tmp.jpg


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

@@ -3,6 +3,7 @@ package com.yh.saas;
 import com.winsea.svc.common.annotation.EnableService;
 import com.yh.saas.plugin.yiliangyiyun.util.TestJson;
 import org.activiti.spring.boot.SecurityAutoConfiguration;
+import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.builder.SpringApplicationBuilder;

+ 13 - 0
winsea-haixin-plugin-wangluohuoyun/pom.xml

@@ -167,6 +167,19 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-aop</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.winnerlook</groupId>
+            <artifactId>voice-sdk</artifactId>
+            <version>1.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
     </dependencies>
 
 

+ 11 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/NewsInfoController.java

@@ -56,6 +56,17 @@ public class NewsInfoController {
         return newsInfoService.addNewsInfo(newsInfo);
     }
 
+    /**
+     * 后台管理批量发送消息
+     * @param newsInfo
+     * @return
+     */
+    @Log(title = "后台管理批量发送消息")
+    @PostMapping("/api/batchSendNews")
+    public String batchSendNews (@RequestBody NewsInfo newsInfo){
+        return newsInfoService.batchSendNews(newsInfo);
+    }
+
     /**
      * 编辑消息
      * @param newsInfo

+ 3 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/CommonUserMapper.java

@@ -3,7 +3,9 @@ package com.yh.saas.plugin.yiliangyiyun.mapper;
 import com.winsea.svc.notice.entity.NoticeTaskInfo;
 import com.yh.saas.plugin.yiliangyiyun.entity.CommonUser;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
 
 import java.util.List;
 import java.util.Map;
@@ -16,6 +18,7 @@ import java.util.Map;
  * @author Gongdc
  * @since 2021-07-12
  */
+@Repository
 public interface CommonUserMapper extends BaseMapper<CommonUser> {
 
 

+ 7 - 0
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/INewsInfoService.java

@@ -36,6 +36,13 @@ public interface INewsInfoService extends IService<NewsInfo> {
      */
     String addNewsInfo (NewsInfo newsInfo);
 
+    /**
+     * 后台管理批量发送消息
+     * @param newsInfo
+     * @return
+     */
+    String batchSendNews (NewsInfo newsInfo);
+
     /**
      * 编辑消息
      * @param newsInfo

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

@@ -12,6 +12,7 @@ import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CargoOwnerInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -36,6 +37,8 @@ public class CargoOwnerInfoServiceImpl extends ServiceImpl<CargoOwnerInfoMapper,
     private INewsInfoService newsInfoService;
     @Autowired
     private ICompanyInfoService companyInfoService;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
 
     /**
      * 根据手机号查询货主信息
@@ -245,6 +248,9 @@ public class CargoOwnerInfoServiceImpl extends ServiceImpl<CargoOwnerInfoMapper,
                 newsInfo.setNewsTypeKey("1");
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //驳回
             else if("2".equals(hyCargoOwnerInfo.getFlag())){
@@ -262,6 +268,9 @@ public class CargoOwnerInfoServiceImpl extends ServiceImpl<CargoOwnerInfoMapper,
                 newsInfo.setNewsTypeKey("1");
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             // 禁用
 //            else if("3".equals(hyCargoOwnerInfo.getFlag())){

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

@@ -13,6 +13,7 @@ import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.CarrierInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -56,6 +57,8 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, HyCar
     private IHyTokenService hyToken;
     @Autowired
     private IPublishTaskInfoService publishTaskInfoService;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
 
     /**
      * 查看装车信息
@@ -169,6 +172,9 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, HyCar
                 newsInfo.setNewsTypeKey("2");
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             this.updateById(hyCarrierInfo);
         }
@@ -289,6 +295,9 @@ public class CarrierInfoServiceImpl extends ServiceImpl<CarrierInfoMapper, HyCar
                 newsInfo.setNewsTypeKey("2");
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
         }
         return "OK";

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

@@ -505,7 +505,6 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
     @Override
     @Transactional(rollbackFor = Exception.class)
     public CommonUser loginVerifyCode(CommonUser commonUser) throws ServiceException {
-        java.util.Date now = new java.util.Date();
         if (!commonUser.getVerifyCode().equals("123456")) {
             //1.校验验证码
             checkVerifyCode(commonUser.getPhone(), commonUser.getVerifyCode());
@@ -523,7 +522,7 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
             //检查帐号是否已经冻结
             if (userDO.getStatus() == 0) {
                 throw new AppServiceException(ExceptionDefinition.USER_CAN_NOT_ACTICE);
-            } else {
+            } else if (commonUser.getCid() != null && !commonUser.getCid().isEmpty())  {
                 userDO.setCid(commonUser.getCid());
             }
         }

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

@@ -20,6 +20,8 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.service.IDriverInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.INewsInfoService;
 import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
+import com.yh.saas.plugin.yiliangyiyun.util.GeneratorUtil;
 import com.yh.saas.plugin.yiliangyiyun.util.MonitoringSystemReporting;
 import net.sf.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -54,6 +56,8 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
     private INewsInfoService newsInfoService;
     @Autowired
     private IDriverCarInfoService driverCarInfoService;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
     @Value("${com.changyuntong.env}")
     private String ENV;
 
@@ -271,6 +275,9 @@ public class DriverCarInfoServiceImpl extends ServiceImpl<DriverCarInfoMapper, H
                 newsInfo.setNewsTypeKey("1");
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //更改车辆状态信息
             this.updateById(hyDriverCarInfo1);

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

@@ -14,6 +14,7 @@ import com.yh.saas.plugin.yiliangyiyun.mapper.DriverInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import com.yh.saas.plugin.yiliangyiyun.util.MonitoringSystemReporting;
 import net.sf.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -52,6 +53,8 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
     private IOrderInfoService orderInfoService;
     @Autowired
     private IDriverInfoService driverInfoService;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
     @Value("${com.changyuntong.env}")
     private String ENV;
 
@@ -421,6 +424,9 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
                 newsInfo.setNewsTypeKey("1");
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //驳回
             else if ("2".equals(hyDriverInfo.getFlag())) {
@@ -437,6 +443,9 @@ public class DriverInfoServiceImpl extends ServiceImpl<DriverInfoMapper, HyDrive
                 newsInfo.setNewsTypeKey("1");
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             // 禁用
 //            else if("3".equals(hyDriverInfo.getFlag())){

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

@@ -15,6 +15,7 @@ import com.yh.saas.plugin.yiliangyiyun.service.IDriverInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IFeedbackReportService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.service.INewsInfoService;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -40,6 +41,8 @@ public class FeedbackReportServiceImpl extends ServiceImpl<FeedbackReportMapper,
     private INewsInfoService newsInfoService;
     @Autowired
     private IDriverInfoService driverInfoService;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
 
     /**
      * 投诉举报编号列表集合
@@ -179,6 +182,9 @@ public class FeedbackReportServiceImpl extends ServiceImpl<FeedbackReportMapper,
             }
             newsInfo.setBussId(feedbackReport.getId());
             newsInfoService.addNewsInfo(newsInfo);
+            //个推
+            geTuiUtils.setUserId(newsInfo.getReCommonId());
+            geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
         }
         return "OK";
     }

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

@@ -10,8 +10,12 @@ import com.yh.saas.plugin.yiliangyiyun.entity.OrderInfo;
 import com.yh.saas.plugin.yiliangyiyun.mapper.NewsInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.INewsInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import org.activiti.engine.impl.util.CollectionUtil;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.HashMap;
 import java.util.List;
@@ -28,7 +32,8 @@ import java.util.Map;
 @Service
 public class NewsInfoServiceImpl extends ServiceImpl<NewsInfoMapper, NewsInfo> implements INewsInfoService {
 
-
+    @Autowired
+    private GeTuiUtils geTuiUtils;
 
     /**
      * 消息列表
@@ -62,6 +67,7 @@ public class NewsInfoServiceImpl extends ServiceImpl<NewsInfoMapper, NewsInfo> i
      * @return
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Long unreadMessage (NewsInfo newsInfo){
         Map<String, Object> pageView = new HashMap<>(3);
         //用户id
@@ -78,6 +84,7 @@ public class NewsInfoServiceImpl extends ServiceImpl<NewsInfoMapper, NewsInfo> i
      * @return
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public String addNewsInfo (NewsInfo newsInfo){
         newsInfo.setId(IdGenerator.generateUUID());
         newsInfo.setNewsFlag("0");
@@ -85,6 +92,30 @@ public class NewsInfoServiceImpl extends ServiceImpl<NewsInfoMapper, NewsInfo> i
         return "ok";
     }
 
+    /**
+     * 后台管理批量发送消息
+     * @param newsInfo
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String batchSendNews (NewsInfo newsInfo){
+        List<NewsInfo> newsInfos = newsInfo.getNewsInfoList();
+        if (CollectionUtils.isNotEmpty(newsInfos)){
+            for(NewsInfo newsInfo1 : newsInfos){
+                newsInfo1.setId(IdGenerator.generateUUID());
+                newsInfo1.setNewsType("系统消息");
+                newsInfo1.setNewsTypeKey("1");
+                newsInfo1.setNewsFlag("0");
+                this.insert(newsInfo1);
+                //个推
+                geTuiUtils.setUserId(newsInfo1.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo1.getNewsTitle(),newsInfo1.getNewsContent(),newsInfo1.getReCommonId());
+            }
+        }
+        return "ok";
+    }
+
 
     /**
      * 编辑消息
@@ -92,6 +123,7 @@ public class NewsInfoServiceImpl extends ServiceImpl<NewsInfoMapper, NewsInfo> i
      * @return
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public String editNewsInfo (NewsInfo newsInfo){
         NewsInfo newsInfo1= this.selectById(newsInfo.getId());
         if(newsInfo1 != null){
@@ -110,6 +142,7 @@ public class NewsInfoServiceImpl extends ServiceImpl<NewsInfoMapper, NewsInfo> i
      * @return
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public String editAllNewsInfo (NewsInfo newsInfo){
         List<NewsInfo> newsInfoList= this.selectList(new EntityWrapper<NewsInfo>().eq("re_common_id",newsInfo.getReCommonId()));
         if(CollectionUtil.isNotEmpty(newsInfoList)){

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

@@ -18,6 +18,7 @@ import com.yh.saas.plugin.yiliangyiyun.mapper.OrderInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.util.EntityAnalyse;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import com.yh.saas.plugin.yiliangyiyun.util.MonitoringSystemReporting;
 import com.yh.saas.plugin.yiliangyiyun.util.PdfUtil;
 import lombok.Getter;
@@ -111,6 +112,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
     private IOrderInfoService orderInfoService;
     @Autowired
     private IHyCarCaptainInfoService hyCarCaptainInfoService;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
     @Value("${file-root-path}")
     private String localPath;
     @Getter
@@ -162,6 +165,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                         newsInfo.setNewsTypeKey("5");
                         newsInfo.setNewsType("超时通知");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                         //给平台发送消息
                         NewsInfo newsInfo1 = new NewsInfo();
                         newsInfo1.setReCommonId("84f62127b7384dcdbaeaddfe460329fc");
@@ -180,6 +186,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                         newsInfo2.setNewsTypeKey("5");
                         newsInfo2.setNewsType("超时通知");
                         newsInfoService.addNewsInfo(newsInfo2);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo2.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo2.getNewsTitle(),newsInfo2.getNewsContent(),newsInfo2.getReCommonId());
                     }
                 }
             });
@@ -522,6 +531,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo.setNewsTypeKey("2");
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //货主终止
             else if ("2".equals(orderInfo.getTerminator())) {
@@ -540,6 +552,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo.setNewsTypeKey("2");
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //平台终止
             else {
@@ -556,6 +571,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo.setNewsTypeKey("2");
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
 
                 // 向货主发送信息
                 NewsInfo newsInfo1 = new NewsInfo();
@@ -567,6 +585,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo1.setNewsTypeKey("2");
                 newsInfo1.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo1);
+                //个推
+                geTuiUtils.setUserId(newsInfo1.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo1.getNewsTitle(),newsInfo1.getNewsContent(),newsInfo1.getReCommonId());
             }
             orderInfo1.setOrderStatusKey(StatusEnum.DRIVER_ORDER_END.getFlag());
             orderInfo1.setOrderStatus(StatusEnum.DRIVER_ORDER_END.getName());
@@ -983,6 +1004,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo.setNewsTypeKey("2");
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //驳回
             else {
@@ -1002,6 +1026,9 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
                 newsInfo.setNewsTypeKey("2");
                 newsInfo.setNewsType("承运通知");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             this.updateById(orderInfo1);
         }

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

@@ -15,6 +15,7 @@ import com.yh.saas.plugin.yiliangyiyun.mapper.PublishTaskInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.util.EntCoordUtil;
+import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import com.yh.saas.plugin.yiliangyiyun.util.PdfUtil;
 import com.yh.saas.plugin.yiliangyiyun.util.RandomUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -72,6 +73,8 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
     private IHyBindCarCaptainInfoService hyBindCarCaptainInfoService;
     @Autowired
     private IHyCarCaptainInfoService hyCarCaptainInfoService;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
 
     /**
      * 地球半径,单位 km
@@ -175,6 +178,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //身份证到期前10天
                     int result10 = cargoOwnerInfo.getCardValidityDate().compareTo(sdate10);
@@ -188,6 +194,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //身份证到期前3天
                     int result3 = cargoOwnerInfo.getCardValidityDate().compareTo(sdate3);
@@ -201,6 +210,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                 }
                 cargoOwnerInfoService.updateById(cargoOwnerInfo);
@@ -250,6 +262,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //授权书到期前10天
                 int result10 = cargoOwnerCompInfo.getAuthorizationDeadline().compareTo(sdate10);
@@ -263,6 +278,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //授权书到期前3天
                 int result3 = cargoOwnerCompInfo.getAuthorizationDeadline().compareTo(sdate3);
@@ -276,6 +294,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
             });
         }
@@ -332,6 +353,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //身份证到期前10天
                     int result110 = driverInfo.getCardValidityDate().compareTo(sdate10);
@@ -345,6 +369,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //身份证到期前3天
                     int result13 = driverInfo.getCardValidityDate().compareTo(sdate3);
@@ -358,6 +385,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                 }
                 //驾驶证
@@ -384,6 +414,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //驾驶证到期前10天
                 int result210 = driverInfo.getDriverLicenseValidityDate().compareTo(sdate10);
@@ -397,6 +430,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //驾驶证到期前3天
                 int result23 = driverInfo.getDriverLicenseValidityDate().compareTo(sdate3);
@@ -410,6 +446,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //从业资格证
                 int result5 = driverInfo.getQualificationCertificateValidityDate().compareTo(date1);
@@ -435,6 +474,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //从业资格证到期前10天
                 int result510 = driverInfo.getQualificationCertificateValidityDate().compareTo(date10);
@@ -448,6 +490,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //从业资格证到期前3天
                 int result53 = driverInfo.getQualificationCertificateValidityDate().compareTo(date3);
@@ -461,6 +506,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
             });
         }
@@ -491,6 +539,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //行驶证到期前10天
                 int result310 = hyDriverCarInfo.getDrivingLicenseValidityDate().compareTo(date10);
@@ -504,6 +555,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //行驶证到期前3天
                 int result33 = hyDriverCarInfo.getDrivingLicenseValidityDate().compareTo(date3);
@@ -517,6 +571,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 if (hyDriverCarInfo.getTrailerLicenseValidityDate() != null) {
                     //挂车行驶证
@@ -539,6 +596,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //挂车行驶证到期前10天
                     int result410 = hyDriverCarInfo.getTrailerLicenseValidityDate().compareTo(date10);
@@ -552,6 +612,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //挂车行驶证到期前3天
                     int result43 = hyDriverCarInfo.getTrailerLicenseValidityDate().compareTo(date3);
@@ -565,6 +628,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                 }
                 //道路运输证
@@ -587,6 +653,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //道路运输证到期前10天
                 int result610 = hyDriverCarInfo.getOperationCertificateValidityDate().compareTo(date10);
@@ -600,6 +669,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 //道路运输证到期前3天
                 int result63 = hyDriverCarInfo.getOperationCertificateValidityDate().compareTo(date3);
@@ -613,6 +685,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                     newsInfo.setNewsTypeKey("1");
                     newsInfo.setNewsType("系统消息");
                     newsInfoService.addNewsInfo(newsInfo);
+                    //个推
+                    geTuiUtils.setUserId(newsInfo.getReCommonId());
+                    geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                 }
                 if (hyDriverCarInfo.getTrailerOperationCertificateValidityDate() != null) {
                     //挂车运输证
@@ -635,6 +710,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //挂车运输证到期前10天
                     int result710 = hyDriverCarInfo.getTrailerOperationCertificateValidityDate().compareTo(date10);
@@ -648,6 +726,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                     //挂车运输证到期前3天
                     int result73 = hyDriverCarInfo.getTrailerOperationCertificateValidityDate().compareTo(date3);
@@ -661,6 +742,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                         newsInfo.setNewsTypeKey("1");
                         newsInfo.setNewsType("系统消息");
                         newsInfoService.addNewsInfo(newsInfo);
+                        //个推
+                        geTuiUtils.setUserId(newsInfo.getReCommonId());
+                        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
                     }
                 }
             });
@@ -1548,6 +1632,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
         newsInfo.setNewsTypeKey("2");
         newsInfo.setNewsType("承运通知");
         newsInfoService.addNewsInfo(newsInfo);
+        //个推
+        geTuiUtils.setUserId(newsInfo.getReCommonId());
+        geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
         //新增承运信息
         HyCarrierInfo hyCarrierInfo = new HyCarrierInfo();
         hyCarrierInfo.setId(IdGenerator.generateUUID());
@@ -1596,6 +1683,9 @@ public class PublishTaskInfoServiceImpl extends ServiceImpl<PublishTaskInfoMappe
                 newsInfo.setNewsTypeKey("1");
                 newsInfo.setNewsType("系统消息");
                 newsInfoService.addNewsInfo(newsInfo);
+                //个推
+                geTuiUtils.setUserId(newsInfo.getReCommonId());
+                geTuiUtils.pushByCid(newsInfo.getNewsTitle(),newsInfo.getNewsContent(),newsInfo.getReCommonId());
             }
             //更改信息
             this.updateById(publishTaskInfo1);

+ 3 - 3
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/EntityAnalyse.java

@@ -684,7 +684,7 @@ public class EntityAnalyse {
             // 释放链接
             httpClient.close();
         }
-        return "通过";
+        return "";
     }
 
     /**
@@ -745,7 +745,7 @@ public class EntityAnalyse {
             // 释放链接
             httpClient.close();
         }
-        return "通过";
+        return "";
     }
 
     /**
@@ -802,7 +802,7 @@ public class EntityAnalyse {
             // 释放链接
             httpClient.close();
         }
-        return "通过";
+        return "";
     }
 
     /**

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

@@ -1,5 +1,6 @@
 package com.yh.saas.plugin.yiliangyiyun.util;
 
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.getui.push.v2.sdk.ApiHelper;
 import com.getui.push.v2.sdk.GtApiConfiguration;
 import com.getui.push.v2.sdk.api.PushApi;
@@ -11,25 +12,32 @@ import com.getui.push.v2.sdk.dto.req.message.PushChannel;
 import com.getui.push.v2.sdk.dto.req.message.PushDTO;
 import com.getui.push.v2.sdk.dto.req.message.PushMessage;
 import com.getui.push.v2.sdk.dto.req.message.android.AndroidDTO;
+import com.getui.push.v2.sdk.dto.req.message.android.GTNotification;
 import com.getui.push.v2.sdk.dto.req.message.android.ThirdNotification;
 import com.getui.push.v2.sdk.dto.req.message.android.Ups;
 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.gexin.rp.sdk.base.impl.AppMessage;
+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;
 import com.gexin.rp.sdk.exceptions.RequestException;
 import com.gexin.rp.sdk.http.IGtPush;
 import com.gexin.rp.sdk.template.TransmissionTemplate;
+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 java.util.ArrayList;
+import javax.annotation.Resource;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -38,20 +46,41 @@ import java.util.Map;
  * @Description: 个推Util类
  * @Date:Created in 9:38 2021-06-03
  */
-
 @Component
 public class GeTuiUtils {
     @Autowired
     private CommonUserMapper commonUserMapper;
-    private static String appId = "q2frjgRYqt7RuC9Vjj6Va9";
-    private static String appKey = "L0gnzFQa2O8aFW15lPRzh2";
-    private static String masterSecret = "NhuCKHZJhp877ofHWtlQWA";
+    @Autowired
+    private CommonStaffMapper commonStaffMapper;
+    private String appId = "";
+    private String appKey = "";
+    private String masterSecret = "";
     PushApi pushApi = null;
+    @Value("${com.changyuntong.env}")
+    private String ENV;
+
+    public void setUserId(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())){
+            //司机端
+            appId = "EjFcDQXGAu7MR3rvxqPB77";
+            appKey = "e2CbYjkmzs8gyPtOHRlwZ4";
+            masterSecret = "biZ1A0Evm2ABIuk0lKDVA";
+        }else {
+            //货主端
+            appId = "cESNrYEdCn5rDqpBoHC4N5";
+            appKey = "xhF3JuJh2Y8xjyQY4LFqo";
+            masterSecret = "e72ag0SXpU5LOvgroi7Oh5";
+        }
+
         GtApiConfiguration apiConfiguration = new GtApiConfiguration();
         //填写应用配置
         apiConfiguration.setAppId(appId);
@@ -66,100 +95,300 @@ public class GeTuiUtils {
     }
 
     public void pushByCid(String title,String content,String userId){
-        try{
-            CommonUser userDO =  commonUserMapper.selectById(userId);
-            String cid = userDO.getCid();
-            //根据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("default");
-            aps.setAlert(alert);
-            IosDTO iosDTO = new IosDTO();
-            iosDTO.setAps(aps);
-            iosDTO.setType("notify");
-            PushChannel pushChannel = new PushChannel();
-            pushChannel.setIos(iosDTO);
-            //安卓离线厂商通道推送消息体
+        if ("3".equals(ENV)) {
+            try {
+                CommonUser userDO = commonUserMapper.selectById(userId);
+                if("1".equals(userDO.getIdentification())){
+                    //司机端
+                    appId = "EjFcDQXGAu7MR3rvxqPB77";
+                    appKey = "e2CbYjkmzs8gyPtOHRlwZ4";
+                    masterSecret = "biZ1A0Evm2ABIuk0lKDVA";
+                }else {
+                    //货主端
+                    appId = "cESNrYEdCn5rDqpBoHC4N5";
+                    appKey = "xhF3JuJh2Y8xjyQY4LFqo";
+                    masterSecret = "e72ag0SXpU5LOvgroi7Oh5";
+                }
+                String cid = userDO.getCid();
+                //根据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();;
-            ups.setNotification(notification1);
-            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.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/importance", "HIGH");
-            //ups.addOption("VV","classification",1);
-            androidDTO.setUps(ups);
-            pushChannel.setAndroid(androidDTO);
-            pushDTO.setPushChannel(pushChannel);
-            // PushMessage在线走个推通道才会起作用的消息体
-            PushMessage pushMessage = new PushMessage();
-            pushMessage.setTransmission(" {title:\""+title+"\",content:\""+content+"\",payload:\"test\"}");
-            pushDTO.setPushMessage(pushMessage);
+                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());
+                // 设置接收人信息
+                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("推送成功:" + userDO.getUserName() + "," + title + "," + content);
+            } catch (Exception e) {
+                System.out.println("推送异常:" + e.getMessage());
             }
-            //推送穿透消息
-            IGtPush push = new IGtPush(host, appKey, masterSecret);
-            TransmissionTemplate template = genTransmissionTemplate(content, title);// 设定消息模式为透传
-            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);
+        }
+    }
+    public void pushByCidPhone(String title,String content,String staffId){
+        if ("3".equals(ENV)) {
             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());
+//                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());
             }
         }
-        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();
+        }
+
     }
-    private static TransmissionTemplate genTransmissionTemplate(String content, String title) throws Exception {
+
+
+
+
+    private static TransmissionTemplate genTransmissionTemplate(String content, String title, String appId, String appKey) throws Exception {
         TransmissionTemplate template = new TransmissionTemplate();
         template.setAppId(appId);
         template.setAppkey(appKey);
@@ -175,7 +404,7 @@ public class GeTuiUtils {
 
         apnpayload.setContentAvailable(1);// 推送直接带有透传数据
         // apnpayload.setBadge(0);//应用icon上显示的数字
-        apnpayload.setSound("default");// 通知铃声文件名
+        apnpayload.setSound("pushsound.caf");// 通知铃声文件名
 //        apnpayload.setAlertMsg(alertMsg);
         template.setAPNInfo(apnpayload);
         template.setTransmissionType(2);