Ver código fonte

短信地址拼接

Qchen 1 ano atrás
pai
commit
c28d2eb999

+ 1 - 1
src/main/java/com/ydtech/modules/admin/controller/SysUserController.java

@@ -561,7 +561,7 @@ public class SysUserController extends BaseController {
         sysUserTrack.setApproveMess(reason);
         sysUserTrackService.save(sysUserTrack);
         Integer type = sysUser.getType();
-        if (type != null && type !=0 ) {
+        if (type != null && type != 0) {
             sysUserService.sendMsgPantner(sysUser.getMobile());
         }
 

+ 15 - 24
src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java

@@ -40,6 +40,7 @@ import com.ydtech.security.utils.PasswordUtils;
 import com.ydtech.utils.StringUtils;
 import com.ydtech.utils.idgen.IdGenerate;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -113,6 +114,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     @Resource
     private SysPartnerService sysPartnerService;
 
+    @Value("${httpUrl}")
+    private String httpUrl;
     @Override
     public IPage<SysUserBaseVO> findUserList(PageDto<SysUserDto> pageDto) {
         PageVo<SysUserBaseVO> pageVo = new PageVo();
@@ -290,20 +293,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                 return HttpResult.error("手机号不存在!");
             }
 //            }
-        String createTime = String.valueOf(sysUser.getCreateTime());
+        String timeCreate = String.valueOf(sysUser.getCreateTime());
         String userId = sysUser.getId();
         List<SysUserTrack> sysUserTracks = sysUserTrackService.list(new LambdaQueryWrapper<SysUserTrack>().eq(SysUserTrack::getUserId,userId).orderByDesc(SysUserTrack::getApproveTime));
         SysUserTrack sysUserTrack = sysUserTracks.get(0);
-        String apprveMess = sysUserTrack.getApproveMess();
-        Integer status = sysUserTrack.getStatus();
-        String status1 = "";
-        if (status == 3) {
-            status1 = "入司审核驳回";
-        }
 
         Integer type = sysUser.getType();
-        Integer level = sysUser.getLevel();
-        String source = sysUser.getManagementSource();
         String type1 = "";
         if (type == 1) {
             type1 = "合伙人申请";
@@ -320,29 +315,25 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 //                , TimeUnit.MINUTES);
 
         String result = null;
-        String url = "http://v.juhe.cn/sms/send";//请求接口地址
+        String urlNet = "http://v.juhe.cn/sms/send";//请求接口地址
         Map params = new HashMap();//请求参数
         params.put("mobile", phone);//接收短信的手机号码
         params.put("tpl_id", "71853");//短信模板ID,请参考个人中心短信模板设置
-//        String textVal = "#code#=" + randNumber ;
-//        params.put("tpl_value", textVal);//变量名和变量值对。如果你的变量名或者变量值中带有#&=中的任意一个特殊符号,请先分别进行urlencode编码后再传递,<a href="http://www.juhe.cn/news/index/id/50"
-        params.put("user_id", userId);
-        params.put("timeCreate", createTime);
+        String userIdVal = "#userId#=" + userId;
+        params.put("user_id", userIdVal);
+        String timeCreateVal = "#timeCreate#=" + timeCreate;
+        params.put("timeCreate", timeCreateVal);
+        String apprveMess ="#apprveMess#" + sysUserTrack.getApproveMess();
         params.put("apprveMess", apprveMess);
-        if (level != null) {
-            params.put("level", level);
-        }
-        if (source != null) {
-            params.put("source", source);
-        }
-        params.put("status", status1);
-        params.put("type", type1);
-    // target="_blank">详细说明></a>
+        String type2 = "#type#=" + type1;
+        params.put("type", type2);
+        String url ="#url#=" + httpUrl +"userId=" + userId +'&'+ "remark=" +sysUserTrack.getApproveMess() +'&'+"type="+ type;
+        params.put("url", url);
         params.put("key", "fbe7b165e9e13e52f3b1f2654eab9c0e");//应用APPKEY(应用详细页查询)
         params.put("dtype", "json");//返回数据的格式,xml或json,默认json
 
         try {
-            result = net(url, params, "GET");
+            result = net(urlNet, params, "GET");
             JSONObject object = JSONObject.parseObject(result);
             if (object.getInteger("error_code") == 0) {
 //				System.out.println(object.get("result"));