admin
2019-08-20 398f41e16c0230a94d277e297eba17b5839db71c
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
@@ -27,6 +27,7 @@
import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
import com.yeshi.fanli.service.inter.push.PushService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.StringUtil;
@@ -49,6 +50,9 @@
   
   @Resource
   private ThreeSaleSerivce threeSaleSerivce;
   @Resource
   private UserInfoService userInfoService;
   
   @Resource
   private UserInfoExtraService userInfoExtraService;
@@ -355,9 +359,11 @@
      } 
      
      Long remindId = null;
      boolean remindBoss = true;
      if (uid.longValue() == threeSale.getWorker().getId().longValue()) {
         remindId = threeSale.getBoss().getId(); // 提醒上级
      } else if (uid.longValue() == threeSale.getBoss().getId().longValue()) {
         remindBoss = false;
         remindId = threeSale.getWorker().getId(); // 提醒下级
      } 
      
@@ -366,13 +372,51 @@
         return;
      }
      
      UserInfo userInfo = userInfoService.selectByPKey(remindId);
      if (userInfo == null) {
         out.print(JsonUtil.loadFalseResult("被提醒人信息不存在"));
         return;
      }
      Long bossId = null;
      Long workerId = null;
      String title = "队员提醒消息";
      String content = "";
      if (remindBoss) {
         bossId = remindId;
         workerId = uid;
         content = "你的邀请人"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系帮助你更好的省钱,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
      } else {
         bossId = uid;
         workerId = remindId;
      }   content = "你的一级队员"+ userInfo.getNickName() +",提醒你添加微信号,以便于和你取得联系和学习省钱技巧,赶快去添加吧;注:请升级到本软件最新版本在“我的-我的信息”中添加。";
      try {
         List<String> listIOS = new ArrayList<String>();
         List<String> listAndroid = new ArrayList<String>();
         pushService.pushZNX(remindId, "", "", listIOS, listAndroid);
         userSystemMsgService.addUserSystemMsg(remindId, UserSystemMsgTypeEnum.question,
               "", "", UserSystemMsg.TIME_TAG_EMERGENT, null);
         pushService.pushZNX(remindId, title, content, listIOS, listAndroid);
         userSystemMsgService.addUserSystemMsg(remindId, UserSystemMsgTypeEnum.common,
               title, content, UserSystemMsg.TIME_TAG_COMMON, null);
         ThreeSaleExtraInfo newInfo = new ThreeSaleExtraInfo();
         if (remindBoss) {
            newInfo.setRemindBoss(1);
         } else {
            newInfo.setRemindWorker(1);
         }
         ThreeSaleExtraInfo threeExtra = threeSaleExtraInfoSerivce.getbyBossIdAndWorkerId(bossId, workerId);
         if (threeExtra != null) {
            newInfo.setId(threeExtra.getId());
            newInfo.setUpdateTime(new Date());
            threeSaleExtraInfoSerivce.updateByPrimaryKeySelective(newInfo);
         } else {
            newInfo.setCreateTime(new Date());
            newInfo.setUpdateTime(new Date());
            threeSaleExtraInfoSerivce.insertSelective(newInfo);
         }
         
         JSONObject data = new JSONObject();
         data.put("weiXinState", 2);