Bladeren bron

Merge remote-tracking branch 'origin/develop-yellow' into develop2

eganwu 11 maanden geleden
bovenliggende
commit
dcdf990d0e

+ 8 - 5
src/custom/restcontroller/common/usercenter/usercenter.java

@@ -320,7 +320,12 @@ public class usercenter extends Controller {
                     return getErrReturnObject().setErrMsg("团队成员已被绑定").toString();
                 }
             }
-
+            rows = dbConnect.runSqlQuery("SELECT * from sys_enterprise_hr WHERE userid='" + userid + "' and siteid ='" + siteid + "'");
+            if (rows.isNotEmpty()) {
+                if (rows.get(0).getLong("userid") > 0) {
+                    return getErrReturnObject().setErrMsg("当前账号已绑定微信!").toString();
+                }
+            }
         }
         WechatMiniProgram wechatMiniProgram = new WechatMiniProgram(systemclient);
         WechatUserID wechatUser = wechatMiniProgram.getWechatUserID(wechat_code);
@@ -328,14 +333,12 @@ public class usercenter extends Controller {
         String unionid = wechatUser.getUnionid();
         if (isbinging) {
             Rows openidsRows = dbConnect.runSqlQuery("select * from sys_wechatapp_openids where userid='" + userid + "' and systemclient='" + systemclient + "'");
-            if (openidsRows.isNotEmpty()) {
-//                if (!openidsRows.get(0).getString("openid").equals(openid)) {
+            if (openidsRows.isNotEmpty() && !openidsRows.get(0).getString("openid").equals(openid)) {
                 return getErrReturnObject().setErrMsg("当前账号已绑定微信!").toJSONString();
-//                }
             }
 
             Rows unionidsRows = dbConnect.runSqlQuery("select * from sys_wechatapp_unionids where userid='" + userid + "'");
-            if (unionidsRows.isNotEmpty()) {
+            if (unionidsRows.isNotEmpty() && !unionidsRows.get(0).getString("unionid").equals(unionid)) {
                 return getErrReturnObject().setErrMsg("当前账号已绑定微信!").toJSONString();
             }
         }

+ 7 - 5
src/custom/restcontroller/webmanage/saletool/data/DataDashboard.java

@@ -91,6 +91,8 @@ public class DataDashboard extends Controller {
         insertSQL.setValue("shareuserid", shareuserid);
         insertSQL.setValue("channel", channel);
         insertSQL.setValue("appname", appname);
+        insertSQL.setValue("ownerid", content.getLongValue("ownerid"));
+        insertSQL.setValue("ownertable", content.getStringValue("ownertable"));
         insertSQL.insert();
 
         return getSucReturnObject().toString();
@@ -111,11 +113,11 @@ public class DataDashboard extends Controller {
             }
             if (whereObject.containsKey("begindate") && !"".equals(whereObject.getString("begindate"))) {
                 begindate = whereObject.getStringValue("begindate");
-                type=0;
+                type = 0;
             }
             if (whereObject.containsKey("enddate") && !"".equals(whereObject.getString("enddate"))) {
                 enddate = whereObject.getStringValue("enddate");
-                type=0;
+                type = 0;
             }
         }
 
@@ -135,7 +137,7 @@ public class DataDashboard extends Controller {
             t2.setWhere("lastrequestdate >= CURRENT_DATE - INTERVAL 30 DAY");
         }
         if (!begindate.isEmpty() && !enddate.isEmpty()) {
-            t2.setWhere("lastrequestdate >= '"+begindate+"' and lastrequestdate<='"+enddate+" 23:59:59'");
+            t2.setWhere("lastrequestdate >= '" + begindate + "' and lastrequestdate<='" + enddate + " 23:59:59'");
         }
         t2.addQueryFields("lastrequestdate", "max(lastrequestdate)");
 
@@ -168,7 +170,7 @@ public class DataDashboard extends Controller {
             share.setWhere("createdate >= CURRENT_DATE - INTERVAL 30 DAY");
         }
         if (!begindate.isEmpty() && !enddate.isEmpty()) {
-            t2.setWhere("createdate >= '"+begindate+"' and createdate<='"+enddate+" 23:59:59'");
+            t2.setWhere("createdate >= '" + begindate + "' and createdate<='" + enddate + " 23:59:59'");
         }
         share.addGroupBy("createuserid");
         RowsMap shareRowsMap = share.query().toRowsMap("createuserid");
@@ -190,7 +192,7 @@ public class DataDashboard extends Controller {
             appointment.setWhere("createdate >= CURRENT_DATE - INTERVAL 30 DAY");
         }
         if (!begindate.isEmpty() && !enddate.isEmpty()) {
-            appointment.setWhere("createdate >= '"+begindate+"' and createdate<='"+enddate+" 23:59:59'");
+            appointment.setWhere("createdate >= '" + begindate + "' and createdate<='" + enddate + " 23:59:59'");
         }
         appointment.addGroupBy("createuserid");
         RowsMap appointmentRowsMap = appointment.query().toRowsMap("createuserid");

+ 31 - 15
src/custom/restcontroller/webmanage/saletool/sharematerial/DesignPic.java

@@ -122,8 +122,8 @@ public class DesignPic extends Controller {
         }
         Row detailRow = rows.isNotEmpty() ? rows.get(0) : new Row();
 
-        if(detailRow.getString("title").equals("")){
-            detailRow.put("title",detailRow.getString("title_c"));
+        if (detailRow.getString("title").equals("")) {
+            detailRow.put("title", detailRow.getString("title_c"));
         }
 
 
@@ -156,9 +156,9 @@ public class DesignPic extends Controller {
             Rows attPicRows = new Rows();
             Rows tempAttRows = attRowsMap.getOrDefault(row.getString("attachmentid"), new Rows());
             for (Row tempAttRow : tempAttRows) {
-               // if (tempAttRow.getString("usetype").equals(ownertable)) {
-                    attPicRows.add(tempAttRow);
-               // }
+                // if (tempAttRow.getString("usetype").equals(ownertable)) {
+                attPicRows.add(tempAttRow);
+                // }
             }
             row.put("attinfos", attPicRows);
         }
@@ -353,19 +353,35 @@ public class DesignPic extends Controller {
 
         }
         boolean iscollect = content.getBooleanValue("iscollect");
-        if (!iscollect) {
-            if (content.getLongValue("isnationwide") == 1) {
+        int querytype = content.getIntValue("querytype");
+        //1:全国精选
+        if (!iscollect && querytype == 1) {
+            where.append(" and (");
+            where.append("t1.isnationwide ='").append(content.getString("isnationwide")).append("' ");
+            where.append(")");
+
+        }
+        //2:门店设计、门店实景
+        if (!iscollect && querytype == 2) {
+            sys_enterpriseid = content.getLongValue("sys_enterpriseid");
+            if (usertype == 99) {
+//                where.append(" and (");
+//                where.append("t1.sys_enterpriseid ='" + sys_enterpriseid + "' ");
+//                where.append(")");
+
+            }
+            if (usertype == 21 || usertype == 22) {
                 where.append(" and (");
-                where.append("t1.isnationwide ='").append(content.getString("isnationwide")).append("' ");
+                where.append("t1.sys_enterpriseid ='" + sys_enterpriseid + "' ");
                 where.append(")");
-            } else {
-                if (usertype == 21 || usertype == 22) {
-                    where.append(" and (");
-                    where.append("t1.sys_enterpriseid ='" + sys_enterpriseid + "' ");
-                    where.append(")");
-                }
             }
-        } else {
+
+        }
+        //3:全国设计、全国实景,可查看所有物料(包含总部、所有经销商团队人员上传的物料),不处理
+        if (!iscollect && querytype == 3 && (usertype == 0 || usertype == 1 || usertype == 2)) {
+
+        }
+        if (iscollect) {
             where.append(" and (");
             where.append(" t1.sat_sharematerialid in (SELECT ownerid from sys_datacollect WHERE ownertable='sat_sharematerial' and type=1 and siteid='" + siteid + "' and userid=" + userid + ")");
             where.append(")");