Selaa lähdekoodia

账号失效检查自动任务无效错误修复
ios登陆时没有开通的就是原来帐号未激活的提示;如果是之前开通但是到期了,能不能提示帐号已到期,请前往续费

沈静伟 3 vuotta sitten
vanhempi
commit
da011898f3

+ 6 - 4
src/dsb/com/cnd3b/common/restful/SQL/手机账号列表查询.sql

@@ -23,10 +23,12 @@ select t1.tenterprise_userid
            when t6.tpayinfoid IS null and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
                                            (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then 1
            else 0 end                                                                as fisneedpay,
-       case
-           when t6.tpayinfoid IS null and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
-                                           (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then '当前账号未激活'
-           else '' end                                                               as fioserrmsg,
+      case
+       when t6.tpayinfoid IS null and not exists(select *from tpayinfo where tagentsid=t1.tagentsid OR tenterprise_userid=t1.tenterprise_userid) and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
+                                                 (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then '当前账号未激活'
+                 when t6.tpayinfoid IS null and exists(select *from tpayinfo where tagentsid=t1.tagentsid OR tenterprise_userid=t1.tenterprise_userid) and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
+                                                 (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then '账号已到期,请前往续费'
+                 else '' end                                                               as fioserrmsg,
        case
            when t6.tpayinfoid IS null and t1.fusertype = '经销商' then t5.fagentamount
            when t6.tpayinfoid IS null and t1.fusertype = '企业' then t5.FENTERPRISEUSERAMOUNT

+ 5 - 4
src/dsb/com/cnd3b/common/restful/SQL/持久化账号列表查询.sql

@@ -23,10 +23,11 @@ select t1.tenterprise_userid
            when t6.tpayinfoid IS null and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
                                            (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then 1
            else 0 end                                                               as fisneedpay,
-       case
-           when t6.tpayinfoid IS null and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
-                                           (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then '当前账号未激活'
-           else '' end                                                              as fioserrmsg,
+      case when t6.tpayinfoid IS null and not exists(select *from tpayinfo where tagentsid=t1.tagentsid OR tenterprise_userid=t1.tenterprise_userid) and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
+                                                 (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then '当前账号未激活'
+                 when t6.tpayinfoid IS null and exists(select *from tpayinfo where tagentsid=t1.tagentsid OR tenterprise_userid=t1.tenterprise_userid) and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
+                                                 (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then '账号已到期,请前往续费'
+                 else '' end                                                               as fioserrmsg,
        case
            when t6.tpayinfoid IS null and t1.fusertype = '经销商' then t5.fagentamount
            when t6.tpayinfoid IS null and t1.fusertype = '企业' then t5.FENTERPRISEUSERAMOUNT

+ 5 - 4
src/dsb/com/cnd3b/common/restful/SQL/账号列表查询.sql

@@ -23,10 +23,11 @@ select t1.tenterprise_userid
            when t6.tpayinfoid IS null and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
                                            (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then 1
            else 0 end                                                                as fisneedpay,
-       case
-           when t6.tpayinfoid IS null and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
-                                           (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then '当前账号未激活'
-           else '' end                                                               as fioserrmsg,
+      case when t6.tpayinfoid IS null and not exists(select *from tpayinfo where tagentsid=t1.tagentsid OR tenterprise_userid=t1.tenterprise_userid) and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
+                                                 (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then '当前账号未激活'
+                 when t6.tpayinfoid IS null and exists(select *from tpayinfo where tagentsid=t1.tagentsid OR tenterprise_userid=t1.tenterprise_userid) and ((t1.fusertype = '经销商' and t5.fagentamount > 0) or
+                                                 (t1.fusertype = '企业' and t5.FENTERPRISEUSERAMOUNT > 0)) then '账号已到期,请前往续费'
+                 else '' end                                                               as fioserrmsg,
        case
            when t6.tpayinfoid IS null and t1.fusertype = '经销商' then t5.fagentamount
            when t6.tpayinfoid IS null and t1.fusertype = '企业' then t5.FENTERPRISEUSERAMOUNT

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/system/payment/payment.java

@@ -129,7 +129,7 @@ public class payment extends Controller {
             }
             nativepay.after();
             if (!codeurl.equals("")) {
-                return getSucReturnObject().setData(codeurl).toString();
+                return getSucReturnObject().setData(JSONObject.parseObject(codeurl)).toString();
             }
         } catch (Exception e) {
             e.printStackTrace();

+ 5 - 4
src/dsb/com/cnd3b/service/SQL/失效账号查询.sql

@@ -1,7 +1,7 @@
-select distinct t1.tenterprise_userid as userid
+select distinct t1.tenterprise_userid as userid,tagentsid
 from tenterprise_users t1
          inner join tenterprise t2 on t1.siteid = t2.siteid and (fenddate is null or fenddate > getdate())
-         inner join tuserrequestlog t3 on t1.siteid=t3.siteid and t1.tenterprise_userid=t3.tenterprise_userid
+         --inner join tuserrequestlog t3 on t1.siteid=t3.siteid and t1.tenterprise_userid=t3.tenterprise_userid
          inner join tappmodelauth t5 on t1.siteid = t5.siteid and t5.fisdefault = 1
 where  ((t1.fusertype = '¾­ÏúÉÌ' and t5.fagentamount > 0) or
        (t1.fusertype = 'ÆóÒµ' and t5.fenterpriseuseramount > 0))
@@ -11,5 +11,6 @@ where  ((t1.fusertype = '
 		   (t1.fusertype = '¾­ÏúÉÌ' and t1.tagentsid = tpayinfo.tagentsid) or
                                                              (t1.fusertype = 'ÆóÒµ' and t1.tenterprise_userid = tpayinfo.tenterprise_userid)
 		   )
-        )
-group by t1.tenterprise_userid  having max(t3.flastrequestdate)>DATEADD(DAY,-3, GETDATE())
+        )and isnull(t1.accesstoken,'') !=''
+group by t1.tenterprise_userid,tagentsid
+--having max(t3.flastrequestdate)>DATEADD(DAY,-3, GETDATE())

+ 2 - 2
src/dsb/com/cnd3b/service/UserAutoLogOut.java

@@ -18,7 +18,7 @@ public class UserAutoLogOut extends BaseClass implements Runnable {
     @Override
     public void run() {
         try {
-            if (new SQLiteJDBC().checkServicesUsed("UserAutoLogOut", false)) {
+            if (new SQLiteJDBC().checkServicesUsed("UserAutoLogOut",false)) {
                 accountExpiration();
             }
         } catch (Exception e) {
@@ -39,8 +39,8 @@ public class UserAutoLogOut extends BaseClass implements Runnable {
                 String token = parameter.userIdList.get(userid).getString("token");
                 parameter.tokenlist.remove(token);
                 parameter.userIdList.remove(userid);
-                dbConnect.runSqlUpdate("update tenterprise_users set accesstoken=null where tenterprise_userid='" + userid + "'");
             }
+            dbConnect.runSqlUpdate("update tenterprise_users set accesstoken=null where tenterprise_userid='" + userid + "'");
         }
     }
 }