Parcourir la source

验证码完工,添加网销公司完工验证码

hxh il y a 1 mois
Parent
commit
86f2a952f5

+ 5 - 2
src/custom/restcontroller/webmanage/sale/serviceorder/serviceorder.java

@@ -965,7 +965,7 @@ public class serviceorder extends Controller {
         dbConnect.runSqlUpdate("update sa_workorder set verificationcode='" + verificationCode + "' where sa_workorderid=" + sa_workorderid);
         Rows wxserviceRows = dbConnect.runSqlQuery("select t2.userid from sys_wechatapp_openids t1 inner join sys_users t2 on t1.userid=t2.userid where t2.phonenumber='" + customerphone + "'");
         Row row = new Row();
-        if (wxserviceRows.isEmpty()) {
+        if (wxserviceRows.isNotEmpty()) {
             ArrayList<Long> userids = wxserviceRows.toArrayList("userid", new ArrayList<>());
             JSONObject extradata = new JSONObject();
             extradata.put("extraUserList", userids);
@@ -1015,6 +1015,8 @@ public class serviceorder extends Controller {
         }
         long createuserid = rows.get(0).getLong("createuserid");
         String type = rows.get(0).getString("type");
+        Rows rows_nterprise = dbConnect.runSqlQuery("select t1.userid from sys_users t1 inner join sys_enterprise_hr t2 on t1.userid = t2.userid where t2.sys_enterpriseid=84846");
+        RowsMap rows_nterpriseMap = rows_nterprise.toRowsMap("userid");
         Rows userrows = dbConnect.runSqlQuery("select t2.usertype,t1.phonenumber from  sys_users t1 inner join sys_usersite t2 on t1.userid = t2.userid where t2.siteid = '" + siteid + "' and t1.userid=" + createuserid);
         long usertype = 0;
         if (userrows.isNotEmpty()) {
@@ -1031,9 +1033,10 @@ public class serviceorder extends Controller {
             }
         }
         String code = content.getStringValue("code");
+
         boolean isgeneralcompletioncode = Parameter.getBoolean(siteid, "isgeneralcompletioncode");
         String generalcompletioncode = Parameter.getString(siteid, "generalcompletioncode");
-        if (isgeneralcompletioncode) {
+        if (isgeneralcompletioncode || rows_nterpriseMap.containsKey(createuserid)) {
             if (!code.equals(generalcompletioncode)) {
                 if (!message_map.containsKey(customerphone) || !message_map.get(customerphone).check(code)) {
                     return getErrReturnObject().setErrMsg("验证码错误或者过期").toString();