ccjgmwz 4 éve
szülő
commit
e0e30ca2a5

+ 6 - 1
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/collect/CollectServiceImpl.java

@@ -3,6 +3,7 @@ package com.iotechn.unimall.admin.api.collect;
 
 import com.google.zxing.WriterException;
 import com.iotechn.unimall.admin.utils.DateUtils;
+import com.iotechn.unimall.biz.utils.GeTuiUtils;
 import com.iotechn.unimall.biz.utils.SendUtils;
 import com.iotechn.unimall.core.exception.AdminServiceException;
 import com.iotechn.unimall.core.exception.ExceptionDefinition;
@@ -53,6 +54,8 @@ public class CollectServiceImpl implements CollectService {
     private CollectDetailMapper collectDetailMapper;
     @Autowired
     private SendUtils sendUtils;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
     SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
     @Override
     public boolean delete(Long id,  Long adminId) throws ServiceException {
@@ -299,6 +302,7 @@ public class CollectServiceImpl implements CollectService {
             }
 
         }
+        Long userId = null;
         for(int i = 0;i<list.size();i+=2){
             CollectDTO tmp = list.get(i);
             if(list.size()%2!=0) {
@@ -338,8 +342,9 @@ public class CollectServiceImpl implements CollectService {
                 }
 
             }
-
+            userId = tmp.getOutPerson();
         }
+        geTuiUtils.pushByCid("新任务提醒","您收到了"+list.size()+"个出库任务,请及时完成",userId);
         return "OK";
     }
 

+ 9 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/report/ReportServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.iotechn.unimall.admin.config.SendWxMsg;
 import com.iotechn.unimall.admin.config.WebSocket;
 import com.iotechn.unimall.biz.service.user.UserBizService;
+import com.iotechn.unimall.biz.utils.GeTuiUtils;
 import com.iotechn.unimall.biz.utils.SendUtils;
 import com.iotechn.unimall.core.exception.AdminServiceException;
 import com.iotechn.unimall.core.exception.ExceptionDefinition;
@@ -66,6 +67,8 @@ public class ReportServiceImpl implements ReportService {
     @Autowired
     private SendUtils sendUtils;
     @Autowired
+    private GeTuiUtils geTuiUtils;
+    @Autowired
     private BuyMapper buyMapper;
     @Autowired
     private StoreMapper storeMapper;
@@ -371,6 +374,8 @@ public class ReportServiceImpl implements ReportService {
                     map.put("header", "待办任务提醒");
                     map.put("remark", "请进入小程序(我的-我的合同)进行查看");
                     sendUtils.sendMessageForNotice(map);
+
+                    geTuiUtils.pushByCid("新任务提醒","您有新的付款审核任务,请及时完成",userDO.getId());
 //                    SendWxMsg.sendSubscribeMessageSH(adminMapper.selectById(adminId).getRealname(),userDO,userBizService.getWxMiniAccessToken());
                     TaskDO taskDO = new TaskDO();
                     taskDO.setTaskType("付款审核任务");
@@ -442,6 +447,7 @@ public class ReportServiceImpl implements ReportService {
                     map.put("header", "待办任务提醒");
                     map.put("remark", "请进入小程序(我的-我的合同)进行查看");
                     sendUtils.sendMessageForNotice(map);
+                    geTuiUtils.pushByCid("新任务提醒","您有新的付款审核任务,请及时完成",userDO.getId());
 //                    SendWxMsg.sendSubscribeMessageSH(adminMapper.selectById(adminId).getRealname(),userDO,userBizService.getWxMiniAccessToken());
                     TaskDO taskDO = new TaskDO();
                     taskDO.setTaskType("付款审核任务");
@@ -558,6 +564,8 @@ public class ReportServiceImpl implements ReportService {
             map.put("header", "您有新的收款,请及时查收");
             map.put("remark", "点击查看凭证");
             sendUtils.sendMessageForPay(map);
+            geTuiUtils.pushByCid("收款提醒","您有新的收款,请及时查收",userId);
+
         }
 
 
@@ -647,6 +655,7 @@ public class ReportServiceImpl implements ReportService {
             map.put("header", "您有新的收款,请及时查收");
             map.put("remark", "点击查看凭证");
             sendUtils.sendMessageForPay(map);
+            geTuiUtils.pushByCid("收款提醒","您有新的收款,请及时查收",userId);
         }
         return "ok";
     }

+ 11 - 1
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/trade/TradeServiceImpl.java

@@ -6,6 +6,7 @@ import com.iotechn.unimall.admin.config.SendWxMsg;
 import com.iotechn.unimall.admin.config.WebSocket;
 import com.iotechn.unimall.admin.utils.DateUtils;
 import com.iotechn.unimall.biz.service.user.UserBizService;
+import com.iotechn.unimall.biz.utils.GeTuiUtils;
 import com.iotechn.unimall.biz.utils.SendUtils;
 import com.iotechn.unimall.core.exception.AdminServiceException;
 import com.iotechn.unimall.core.exception.AppServiceException;
@@ -40,6 +41,8 @@ public class TradeServiceImpl implements TradeService {
     @Autowired
     private SendUtils sendUtils;
     @Autowired
+    private GeTuiUtils geTuiUtils;
+    @Autowired
     private TradeMapper tradeMapper;
     @Autowired
     private SaleReportMapper saleReportMapper;
@@ -333,7 +336,7 @@ public class TradeServiceImpl implements TradeService {
             }
             if (tradeDO.getType() == 1) {
                 Map<String, Object> map = new HashMap<>();
-                map.put("header", "你的合同" + tradeDO.getTradeContractNo() + "已通过审核,请及时发货");
+                map.put("header", "您的合同:" + tradeDO.getTradeContractNo() + "已通过审核,请及时发货");
                 map.put("userName", tradeDO.getSeller());
                 map.put("value", "已通过");
                 map.put("valueOne", DateUtils.formatDate(new Date(), DateUtils.DATE_FMT_YYYYMMDDHH_MM_SS));
@@ -342,6 +345,8 @@ public class TradeServiceImpl implements TradeService {
                 map.put("userId", tradeDO.getUserId());
                 map.put("remark", "点击进入小程序进行发车作业");
                 sendUtils.sendMessageForDeliver(map);
+
+                geTuiUtils.pushByCid("发货提醒","您的合同:" + tradeDO.getTradeContractNo() + "已通过审核,请及时发货",tradeDO.getUserId());
             } else {
                 Map<String, Object> map = new HashMap<>();
                 map.put("header", "交易审核信息");
@@ -352,6 +357,7 @@ public class TradeServiceImpl implements TradeService {
                 map.put("templateId", "8t4RKKFczLf16eeaaZK489u7BNuQXKwXEC6kQAN4xDU");
                 map.put("userId", tradeDO.getUserId());
                 sendUtils.sendMessage(map);
+                geTuiUtils.pushByCid("审核通过","您申请的交易已审核通过",tradeDO.getUserId());
             }
         } else {
             throw new AppServiceException(ExceptionDefinition.APP_UNKNOWN_EXCEPTION);
@@ -443,6 +449,7 @@ public class TradeServiceImpl implements TradeService {
             map.put("userId", tradeDO.getUserId());
             map.put("remark", "点击进入小程序进行查看");
             sendUtils.sendMessageForNotice(map);
+            geTuiUtils.pushByCid("成交通知","您申请的销售交易已经成交",tradeDO.getUserId());
         } else {
 //            SendWxMsg.sendSubscribeMessageTZ(tradeDO.getOrderNo(),tradeDO.getBuyer(),"交易成交信息",userDO,userBizService.getWxMiniAccessToken());
             Map<String, Object> map = new HashMap<>();
@@ -456,6 +463,7 @@ public class TradeServiceImpl implements TradeService {
             map.put("userId", tradeDO.getUserId());
             map.put("remark", "点击进入小程序进行查看");
             sendUtils.sendMessageForNotice(map);
+            geTuiUtils.pushByCid("成交通知","您申请的采购交易已经成交",tradeDO.getUserId());
 
 
         }
@@ -569,6 +577,7 @@ public class TradeServiceImpl implements TradeService {
             map.put("userId", tradeDO.getUserId());
             map.put("remark", "平仓数量:"+flatTotal+"请到小程序查看");
             sendUtils.sendMessageForNotice(map);
+            geTuiUtils.pushByCid("平仓通知","您的合同:" + tradeDO.getTradeContractNo() + " 平仓成功,累计平仓数量:"+flatTotal+"吨",tradeDO.getUserId());
         }
         else{
             Wrapper wrapper1 = new EntityWrapper();
@@ -613,6 +622,7 @@ public class TradeServiceImpl implements TradeService {
             map.put("userId", tradeDO.getUserId());
             map.put("remark", "平仓数量:"+flatTotal+"请到小程序查看");
             sendUtils.sendMessageForNotice(map);
+            geTuiUtils.pushByCid("平仓通知","您的合同:" + tradeDO.getTradeContractNo() + " 平仓成功,累计平仓数量:"+flatTotal+"吨",tradeDO.getUserId());
         }
 
 

+ 7 - 11
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/user/AdminUserServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.iotechn.unimall.admin.config.WebSocket;
+import com.iotechn.unimall.biz.utils.GeTuiUtils;
 import com.iotechn.unimall.biz.utils.SendUtils;
 import com.iotechn.unimall.core.exception.AdminServiceException;
 import com.iotechn.unimall.core.exception.ExceptionDefinition;
@@ -66,7 +67,7 @@ public class AdminUserServiceImpl implements AdminUserService {
     private SendUtils sendUtils;
 
     WebSocket webSocket = new WebSocket();
-
+    GeTuiUtils geTuiUtils = new GeTuiUtils();
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean addUser(Long adminId, UserDO user) throws ServiceException {
@@ -271,16 +272,11 @@ public class AdminUserServiceImpl implements AdminUserService {
 
     @Override
     public void test() throws Exception {
-        Map<String, Object> map = new HashMap<>();
-        map.put("value", "123");
-        map.put("valueOne", "付款审核任务");
-        map.put("valueTwo", "123");
-        map.put("url", "https://taohaoliang.oss-cn-beijing.aliyuncs.com/admin/5dc2099ab5554334ba49934259f850c6.png");
-        map.put("templateId", "ZjfkR3lhNridBsIu4ai3ViTgphg_hSB7cGUUHZpsBS8");
-        map.put("userId", 1856);
-        map.put("header", "待办任务提醒");
-        map.put("remark", "请进入小程序(我的-我的合同)进行查看");
-        sendUtils.sendMessageForNotice(map);
+        String title="中秋快乐123";
+        String content="国庆快乐123";
+//        UserDO userDO = userMapper.selectById(21);
+        geTuiUtils.pushByCid(title,content,21l);
+//        geTuiUtils.pushToAll(title,content,"");
     }
 
 

+ 4 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/task/TaskAppServiceImpl.java

@@ -8,6 +8,7 @@ import com.iotechn.unimall.admin.utils.DateUtils;
 import com.iotechn.unimall.app.api.tran.TranAppServiceImpl;
 import com.iotechn.unimall.app.utils.PdfUtil;
 import com.iotechn.unimall.biz.service.user.UserBizService;
+import com.iotechn.unimall.biz.utils.GeTuiUtils;
 import com.iotechn.unimall.biz.utils.SendUtils;
 import com.iotechn.unimall.core.exception.AdminServiceException;
 import com.iotechn.unimall.core.exception.AppServiceException;
@@ -42,6 +43,8 @@ public class TaskAppServiceImpl implements TaskAppService{
     @Autowired
     private SendUtils sendUtils;
     @Autowired
+    private GeTuiUtils geTuiUtils;
+    @Autowired
     TaskMapper taskMapper;
     @Autowired
     ReportMapper reportMapper;
@@ -1842,6 +1845,7 @@ public class TaskAppServiceImpl implements TaskAppService{
                 map.put("header", "您的订单已发货");
                 map.put("remark","点击进入小程序查看");
                 sendUtils.sendMessageForDeliver(map);
+                geTuiUtils.pushByCid("发货通知","您的合同:" + tradeDO.getTradeContractNo() + " 已发货,请及时查收",tradeDO.getUserId());
             }
             SaleReportDO saleReportDO = reportMapper.getTradeSaleContract(taskId);
             saleReportDO.setGmtCreate(now);

+ 7 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/trade/TradeAppServiceImpl.java

@@ -2,6 +2,7 @@ package com.iotechn.unimall.app.api.trade;
 
 import com.iotechn.unimall.admin.config.WebSocket;
 import com.iotechn.unimall.admin.utils.DateUtils;
+import com.iotechn.unimall.biz.utils.GeTuiUtils;
 import com.iotechn.unimall.biz.utils.SendUtils;
 import com.iotechn.unimall.core.exception.AdminServiceException;
 import com.iotechn.unimall.core.exception.AppServiceException;
@@ -60,6 +61,8 @@ public class TradeAppServiceImpl implements TradeAppService {
     @Autowired
     private SendUtils sendUtils;
     @Autowired
+    private GeTuiUtils geTuiUtils;
+    @Autowired
     private PositionReportMapper positionReportMapper;
 
     WebSocket webSocket = new WebSocket();
@@ -168,6 +171,7 @@ public class TradeAppServiceImpl implements TradeAppService {
                         map.put("header", "您好,您有一条下单任务可完成");
                         map.put("remark", "点击进入小程序完成任务");
                         sendUtils.sendMessageForNotice(map);
+                        geTuiUtils.pushByCid("新任务提醒","您有新的下单任务,请及时完成",userDO.getId());
                     });
                 }
             }
@@ -335,6 +339,7 @@ public class TradeAppServiceImpl implements TradeAppService {
                 map.put("header", "您好,客户已确定可完成入库任务!");
                 map.put("remark", "点击进入小程序完成任务");
                 sendUtils.sendMessageForDeliver(map);
+                geTuiUtils.pushByCid("客户确认提醒","客户已确认可以卸货,请及时完成入库任务",taskDO.getUserId());
             }
 
         }
@@ -523,6 +528,7 @@ public class TradeAppServiceImpl implements TradeAppService {
                     map.put("userId", tradeDO.getUserId());
                     map.put("remark", "点击进入小程序进行发车作业");
                     sendUtils.sendMessageForDeliver(map);
+                    geTuiUtils.pushByCid("发货提醒","你的合同" + tradeDO.getTradeContractNo() + "已通过审核,请及时发货",tradeDO.getUserId());
                 } else {
                     Map<String, Object> map = new HashMap<>();
                     map.put("header", "交易审核信息");
@@ -533,6 +539,7 @@ public class TradeAppServiceImpl implements TradeAppService {
                     map.put("templateId", "8t4RKKFczLf16eeaaZK489u7BNuQXKwXEC6kQAN4xDU");
                     map.put("userId", tradeDO.getUserId());
                     sendUtils.sendMessage(map);
+                    geTuiUtils.pushByCid("审核通过","您的交易已通过审核",tradeDO.getUserId());
                 }
             } else {
                 throw new AppServiceException(ExceptionDefinition.APP_UNKNOWN_EXCEPTION);

+ 5 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/tradeContract/TradeContractServiceImpl.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.iotechn.unimall.app.api.trade.TradeAppService;
 import com.iotechn.unimall.app.common.ErrorCodeEnums;
 import com.iotechn.unimall.app.common.ResultVO;
+import com.iotechn.unimall.biz.utils.GeTuiUtils;
 import com.iotechn.unimall.biz.utils.SendUtils;
 import com.iotechn.unimall.core.exception.AdminServiceException;
 import com.iotechn.unimall.core.exception.AppServiceException;
@@ -47,6 +48,8 @@ public class TradeContractServiceImpl implements TradeContractService {
     private UserMapper userMapper;
     @Autowired
     private SendUtils sendUtils;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
 
     //查询交易合同信息
     @Override
@@ -137,6 +140,8 @@ public class TradeContractServiceImpl implements TradeContractService {
             map.put("header", "工作提醒");
             map.put("remark","点击进入小程序完成任务");
             sendUtils.sendMessageForDeliver(map);
+
+            geTuiUtils.pushByCid("新任务提醒","您有新的入库任务,请及时完成",storeUserDO.getUserId());
         }
 
         //新增CAR表

+ 4 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/tran/TranAppServiceImpl.java

@@ -10,6 +10,7 @@ import com.iotechn.unimall.admin.config.SendWxMsg;
 import com.iotechn.unimall.app.utils.HttpUtils;
 import com.iotechn.unimall.app.utils.PdfUtil;
 import com.iotechn.unimall.biz.service.user.UserBizService;
+import com.iotechn.unimall.biz.utils.GeTuiUtils;
 import com.iotechn.unimall.biz.utils.SendUtils;
 import com.iotechn.unimall.core.annotation.HttpParam;
 import com.iotechn.unimall.core.annotation.HttpParamType;
@@ -82,6 +83,8 @@ public class TranAppServiceImpl implements TranAppService{
     SaleContractMapper saleContractMapper;
     @Autowired
     private SendUtils sendUtils;
+    @Autowired
+    private GeTuiUtils geTuiUtils;
 //    @Autowired
 //    YkRecordMapper ykRecordMapper;
     @Autowired
@@ -433,6 +436,7 @@ public class TranAppServiceImpl implements TranAppService{
                         map.put("header", "您好,您的车辆申请卸货,请及时确认!");
                         map.put("remark","点击进入小程序确认卸货");
                         sendUtils.sendMessageForDeliver(map);
+                        geTuiUtils.pushByCid("卸货确认提醒","您好,您有车辆申请卸货,请及时确认!",tradeDO.getUserId());
                     }
                 }
                 carDO.setCheckType(1);

+ 11 - 3
unimall-biz/pom.xml

@@ -57,8 +57,16 @@
 			<groupId>com.github.binarywang</groupId>
 			<artifactId>weixin-java-pay</artifactId>
 		</dependency>
-
-
+		<dependency>
+			<groupId>com.getui.push</groupId>
+			<artifactId>restful-sdk</artifactId>
+			<version>1.0.0.1</version>
+		</dependency>
 	</dependencies>
-
+	<repositories>
+		<repository>
+			<id>getui-nexus</id>
+			<url>http://mvn.gt.getui.com/nexus/content/repositories/releases/</url>
+		</repository>
+	</repositories>
 </project>

+ 140 - 0
unimall-biz/src/main/java/com/iotechn/unimall/biz/utils/GeTuiUtils.java

@@ -0,0 +1,140 @@
+package com.iotechn.unimall.biz.utils;
+
+import com.getui.push.v2.sdk.ApiHelper;
+import com.getui.push.v2.sdk.GtApiConfiguration;
+import com.getui.push.v2.sdk.api.PushApi;
+import com.getui.push.v2.sdk.common.ApiResult;
+import com.getui.push.v2.sdk.dto.req.Audience;
+import com.getui.push.v2.sdk.dto.req.Settings;
+import com.getui.push.v2.sdk.dto.req.Strategy;
+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.iotechn.unimall.data.domain.UserDO;
+import com.iotechn.unimall.data.mapper.UserMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author:chengchangjiang
+ * @Description:
+ * @Date:Created in 9:38 2021-06-03
+ */
+
+@Component
+public class GeTuiUtils {
+    @Autowired
+    private UserMapper userMapper;
+    private static String appId = "q2frjgRYqt7RuC9Vjj6Va9";
+    private static String appKey = "L0gnzFQa2O8aFW15lPRzh2";
+    private static String masterSecret = "NhuCKHZJhp877ofHWtlQWA";
+    PushApi pushApi = null;
+
+    //别名推送方式
+    static String host = "http://sdk.open.api.igexin.com/apiex.htm";
+
+    public GeTuiUtils(){
+        GtApiConfiguration apiConfiguration = new GtApiConfiguration();
+        //填写应用配置
+        apiConfiguration.setAppId(appId);
+        apiConfiguration.setAppKey(appKey);
+        apiConfiguration.setMasterSecret(masterSecret);
+        // 接口调用前缀,请查看文档: 接口调用规范 -> 接口前缀, 可不填写appId
+        apiConfiguration.setDomain("https://restapi.getui.com/v2/");
+        // 实例化ApiHelper对象,用于创建接口对象
+        ApiHelper apiHelper = ApiHelper.build(apiConfiguration);
+        // 创建对象,建议复用。目前有PushApi、StatisticApi、UserApi
+        pushApi = apiHelper.creatApi(PushApi.class);
+    }
+
+    public void pushByCid(String title,String content,Long userId){
+        try{
+            UserDO userDO =  userMapper.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);
+            //安卓离线厂商通道推送消息体
+//            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();
+            pushDTO.setPushMessage(pushMessage);
+            pushMessage.setTransmission(" {title:\""+title+"\",content:\""+content+"\",payload:\"test\"}");
+//            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(apiResult.getData());
+            } else {
+                // failed
+                System.out.println("code:" + apiResult.getCode() + ", msg: " + apiResult.getMsg());
+            }
+        }
+        catch (Exception e){
+            System.out.println("推送异常:" + e.getMessage());
+        }
+    }
+
+}