瀏覽代碼

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

eganwu 1 年之前
父節點
當前提交
ebcf679a34

+ 6 - 0
src/custom/beans/time/Time.java

@@ -13,4 +13,10 @@ public class Time {
         Date date = new Date();
         return simpleDateFormat.format(date);
     }
+    public static String getDate_Str() {
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        simpleDateFormat.setTimeZone(TimeZone.getTimeZone("Etc/GMT-8"));
+        Date date = new Date();
+        return simpleDateFormat.format(date);
+    }
 }

+ 4 - 0
src/custom/restcontroller/R.java

@@ -6602,6 +6602,10 @@ public class R {
         }
     }
 
+    public static class ID2024060710172602 {
+        public static class v1 {
+        }
+    }
 }
 
 

+ 21 - 0
src/custom/restcontroller/common/signin/signin.java

@@ -1,5 +1,6 @@
 package restcontroller.common.signin;
 
+import beans.time.Time;
 import beans.user.User;
 import com.alibaba.fastjson.JSONObject;
 import common.Controller;
@@ -7,6 +8,7 @@ import common.YosException;
 import common.annotation.API;
 import common.annotation.CACHEING;
 import common.annotation.CACHEING_CLEAN;
+import common.data.InsertSQL;
 import common.data.Row;
 import common.data.Rows;
 import common.data.SQLFactory;
@@ -87,5 +89,24 @@ public class signin extends Controller {
         return getSucReturnObject().setData(signinRows).toString();
     }
 
+    @API(title = "签到", apiversion = R.ID2024060710172602.v1.class)
+    public String signinV2() throws YosException {
+
+        InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_signin");
+        insertSQL.setSiteid(siteid);
+        insertSQL.setUniqueid(createTableID("sys_signin"));
+        insertSQL.setValue("userid", userid);
+        insertSQL.setValue("name", username);
+        insertSQL.setValue("depname", getDepartment(userid).getString("depname"));
+        insertSQL.setValue("type", "签到");
+        insertSQL.setValue("sys_enterpriseid", sys_enterpriseid);
+        insertSQL.setValue("signindate", Time.getDate_Str());
+        insertSQL.setValue("signintime", Time.getDateTime_Str());
+        insertSQL.setWhere("not exists(select 1 from  sys_signin where type='签到' and userid=" + userid + " and signindate='" + Time.getDate_Str() + "' and siteid='" + siteid + "')");
+        insertSQL.insert();
+
+        return getSucReturnObject().toString();
+    }
+
 
 }

+ 2 - 1
src/custom/restcontroller/saletool/orderclue/web/orderclue.java

@@ -5,6 +5,7 @@ import beans.dataextend.DataExtend;
 import beans.datatag.DataTag;
 import beans.datateam.DataTeam;
 import beans.remind.Remind;
+import beans.time.Time;
 import beans.user.User;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
@@ -456,7 +457,7 @@ public class orderclue extends Controller {
         sqlFactory.addParameter("longitude", content.getStringValue("longitude"));
         sqlFactory.addParameter("address", content.getStringValue("address"));
         if (content.getStringValue("createdate").equals("")) {
-            sqlFactory.addParameter("createdate", getDateTime_Str());
+            sqlFactory.addParameter("createdate", Time.getDateTime_Str());
         } else {
             sqlFactory.addParameter("createdate", content.getStringValue("createdate"));
         }

+ 5 - 4
src/custom/restcontroller/webmanage/saletool/courseware/coursewaredetail.java

@@ -2,6 +2,7 @@ package restcontroller.webmanage.saletool.courseware;
 
 import beans.datacontrllog.DataContrlLog;
 import beans.datatag.DataTag;
+import beans.time.Time;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import common.Controller;
@@ -81,7 +82,7 @@ public class coursewaredetail extends Controller {
         updateSQL.setSiteid(siteid);
         updateSQL.setValue("status", type == 0 ? "下架" : "上架");
         updateSQL.setValue("sendby", type == 0 ? "null" : username);
-        updateSQL.setValue("senddate", type == 0 ? "null" : getDateTime_Str());
+        updateSQL.setValue("senddate", type == 0 ? "null" : Time.getDateTime_Str());
         updateSQL.setWhere("sat_coursewaredetailid", sat_coursewaredetailids.toArray());
         updateSQL.update();
 
@@ -238,8 +239,8 @@ public class coursewaredetail extends Controller {
             insertSQL.setValue("userid", userid);
             insertSQL.setValue("sys_enterpriseid", sys_enterpriseid);
             insertSQL.setValue("hrid", hrid);
-            insertSQL.setValue("firstreadtime", getDateTime_Str());
-            insertSQL.setValue("lastreadtime", getDateTime_Str());
+            insertSQL.setValue("firstreadtime", Time.getDateTime_Str());
+            insertSQL.setValue("lastreadtime", Time.getDateTime_Str());
             insertSQL.setValue("studycount", 1);
 
             insertSQL.insert();
@@ -251,7 +252,7 @@ public class coursewaredetail extends Controller {
             updateSQL.setSiteid(siteid);
             updateSQL.setValue("sys_enterpriseid", sys_enterpriseid);
             updateSQL.setValue("hrid", hrid);
-            updateSQL.setValue("lastreadtime", getDateTime_Str());
+            updateSQL.setValue("lastreadtime", Time.getDateTime_Str());
             updateSQL.setValue("studycount", studycount + 1);
 
             updateSQL.update();

+ 2 - 2
src/custom/restcontroller/webmanage/saletool/courseware/coursewaretesthead.java

@@ -503,7 +503,7 @@ public class coursewaretesthead extends Controller {
             UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sat_courseware_test");
             updateSQL.setUniqueid(sat_courseware_testid);
             updateSQL.setSiteid(siteid);
-            updateSQL.setValue("begdate", getDateTime_Str());
+            updateSQL.setValue("begdate", Time.getDateTime_Str());
             updateSQL.setValue("status", "进行中");
             updateSQL.update();
         }
@@ -650,7 +650,7 @@ public class coursewaretesthead extends Controller {
         UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sat_courseware_test");
         updateSQL.setUniqueid(sat_courseware_testid);
         updateSQL.setSiteid(siteid);
-        updateSQL.setValue("submitdate", getDateTime_Str());
+        updateSQL.setValue("submitdate", Time.getDateTime_Str());
         updateSQL.setValue("status", "已完成");
         updateSQL.setValue("countdown", content.getStringValue("countdown"));
         updateSQL.setValue("score", scoreRows.get(0).getBigDecimal("score"));

+ 31 - 33
src/custom/restcontroller/webmanage/users/visitors.java

@@ -34,36 +34,36 @@ public class visitors extends Controller {
     @API(title = "【游客,工作台】个人信息", apiversion = R.ID20240510104102.v1.class)
     public String visitorsInfo() throws YosException {
         Row row = new Row();
-        //统计我的访问店铺数量
-        Rows rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_store_history WHERE userid=" + userid + " and siteid='" + siteid + "'");
-        row.put("count_historystore", rows.get(0).getLong("count"));
-        //预约
-        rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_appointment WHERE createuserid=" + userid + " and siteid='" + siteid + "'");
-        row.put("count_appointment",  rows.get(0).getLong("count"));
-        //地址
-        rows = dbConnect.runSqlQuery("SELECT count(*) count from sys_enterprise_contacts WHERE createuserid=" + userid + " and siteid='" + siteid + "' and deleted=0");
-        row.put("count_address", rows.get(0).getLong("count"));
-        //收藏
-        rows = dbConnect.runSqlQuery("SELECT count(*) count from sys_datacollect WHERE userid=" + userid + " and siteid='" + siteid + "' and type=1");
-        row.put("count_collect", rows.get(0).getLong("count"));
-        //订单
-        rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_custorder WHERE createuserid=" + userid + " and siteid='" + siteid + "' and deleted=0");
-        row.put("count_order", rows.get(0).getLong("count"));
-        //  通讯录
-        rows = dbConnect.runSqlQuery("SELECT count(*) count from sys_phonebook WHERE sys_phonebookgroupid in (SELECT sys_phonebookgroupid from sys_phonebookgroup WHERE classid=1) and siteid='"+siteid+"'");
-        row.put("count_addressbook",  rows.get(0).getLong("count"));
-        //考试成绩
-        rows = dbConnect.runSqlQuery("SELECT count(*) count from sat_courseware_test WHERE userid=" + userid + " and siteid='" + siteid + "' ");
-        row.put("count_coursewaretest", rows.get(0).getLong("count"));
-        //  问卷调查
-        row.put("count_questions", 0);
-        rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_feedback WHERE changeuserid=" + userid + " and siteid='" + siteid + "' ");
-        // 意见反馈
-        row.put("count_feedback",  rows.get(0).getLong("count"));
-
-        rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_awardmx WHERE createuserid=" + userid + " and siteid='" + siteid + "' ");
-        // 中奖明细
-        row.put("count_awardmx",  rows.get(0).getLong("count"));
+//        //统计我的访问店铺数量
+//        Rows rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_store_history WHERE userid=" + userid + " and siteid='" + siteid + "'");
+//        row.put("count_historystore", rows.get(0).getLong("count"));
+//        //预约
+//        rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_appointment WHERE createuserid=" + userid + " and siteid='" + siteid + "'");
+//        row.put("count_appointment",  rows.get(0).getLong("count"));
+//        //地址
+//        rows = dbConnect.runSqlQuery("SELECT count(*) count from sys_enterprise_contacts WHERE createuserid=" + userid + " and siteid='" + siteid + "' and deleted=0");
+//        row.put("count_address", rows.get(0).getLong("count"));
+//        //收藏
+//        rows = dbConnect.runSqlQuery("SELECT count(*) count from sys_datacollect WHERE userid=" + userid + " and siteid='" + siteid + "' and type=1");
+//        row.put("count_collect", rows.get(0).getLong("count"));
+//        //订单
+//        rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_custorder WHERE createuserid=" + userid + " and siteid='" + siteid + "' and deleted=0");
+//        row.put("count_order", rows.get(0).getLong("count"));
+//        //  通讯录
+//        rows = dbConnect.runSqlQuery("SELECT count(*) count from sys_phonebook WHERE sys_phonebookgroupid in (SELECT sys_phonebookgroupid from sys_phonebookgroup WHERE classid=1) and siteid='"+siteid+"'");
+//        row.put("count_addressbook",  rows.get(0).getLong("count"));
+//        //考试成绩
+//        rows = dbConnect.runSqlQuery("SELECT count(*) count from sat_courseware_test WHERE userid=" + userid + " and siteid='" + siteid + "' ");
+//        row.put("count_coursewaretest", rows.get(0).getLong("count"));
+//        //  问卷调查
+//        row.put("count_questions", 0);
+//        rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_feedback WHERE changeuserid=" + userid + " and siteid='" + siteid + "' ");
+//        // 意见反馈
+//        row.put("count_feedback",  rows.get(0).getLong("count"));
+//
+//        rows = dbConnect.runSqlQuery("SELECT count(*) count from sa_awardmx WHERE createuserid=" + userid + " and siteid='" + siteid + "' ");
+//        // 中奖明细
+//        row.put("count_awardmx",  rows.get(0).getLong("count"));
 
         row.putAll(getUser(userid));
         row.put("headpic", getHeadPic(userid));
@@ -79,9 +79,7 @@ public class visitors extends Controller {
         long days = ChronoUnit.DAYS.between(startDate, endDate);
         row.put("joindays", days);
         //签到时间
-        Rows signRows = dbConnect.runSqlQuery("SELECT count(DISTINCT t1.sat_sharematerialid) count from sat_sharematerial_read t1 " +
-                "inner join sat_sharematerial t2 ON t2.sat_sharematerialid=t1.sat_sharematerialid " +
-                "WHERE t2.classid=1 and t1.createuserid=" + userid + " and t1.type=0 and t1.siteid='" + siteid + "'");
+        Rows signRows = dbConnect.runSqlQuery("SELECT count(*) count from sys_signin WHERE type='签到' and siteid='" + siteid + "' and  userid='" + userid + "'");
         row.put("signdays", signRows.get(0).getLong("count"));
 
         Rows storerows = dbConnect.runSqlQuery("SELECT t1.*from sa_store t1 \n" +

+ 2 - 1
src/custom/service/AutoDockItemService.java

@@ -1,6 +1,7 @@
 package service;
 
 import beans.parameter.Parameter;
+import beans.time.Time;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import common.BaseClass;
@@ -223,7 +224,7 @@ public class AutoDockItemService extends ServiceController {
                         updateSQL.setValue("cheek", cheek);//工艺
                         updateSQL.setValue("changeuserid","1");
                         updateSQL.setValue("changeby","admin");
-                        updateSQL.setValue("changedate",getDateTime_Str());
+                        updateSQL.setValue("changedate", Time.getDateTime_Str());
                         updateSQL.setValue("itemname", jsonObject.getString("fitemname"));//品名
 //                        updateSQL.setValue("standards","");//规格
                         updateSQL.setValue("color", color);//颜色

+ 3 - 2
src/custom/service/AutoPublishNoticeService.java

@@ -1,5 +1,6 @@
 package service;
 
+import beans.time.Time;
 import common.ServiceController;
 import common.YosException;
 import common.data.Row;
@@ -26,7 +27,7 @@ public class AutoPublishNoticeService extends ServiceController {
             updateSQL.setValue("changeby", username);
             updateSQL.setValue("changeuserid", userid);
             updateSQL.setValue("checkby", username);
-            updateSQL.setValue("checkdate", getDateTime_Str());
+            updateSQL.setValue("checkdate", Time.getDateTime_Str());
             updateSQL.setUniqueid(row.getLong("sat_noticeid"));
             updateSQL.setSiteid(row.getString("siteid"));
             sqlList.add(updateSQL.getSQL());
@@ -41,7 +42,7 @@ public class AutoPublishNoticeService extends ServiceController {
             updateSQL.setValue("changeby", username);
             updateSQL.setValue("changeuserid", userid);
             updateSQL.setValue("checkby", username);
-            updateSQL.setValue("checkdate", getDateTime_Str());
+            updateSQL.setValue("checkdate", Time.getDateTime_Str());
             updateSQL.setUniqueid(row.getLong("sat_coursewareid"));
             updateSQL.setSiteid(row.getString("siteid"));
             sqlList.add(updateSQL.getSQL());