Browse Source

fix(hikiot): 调整用户类型和日期处理逻辑

- 将用户类型从 VISITOR 改为 "normal"
- 修正结束日期处理,增加一天以包含完整日期
- 更新主方法中的测试用例和调用参数- 修改设备序列号和员工编号用于测试
- 启用 addUserWeekPlan 方法并调整调用顺序
SheepHy 4 weeks ago
parent
commit
908a6f0275

+ 9 - 5
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/hikiot/HikiotTool.java

@@ -208,7 +208,8 @@ public class HikiotTool {
         if(null != endDate){
             LocalDateTime outputDate = endDate.toInstant()
                     .atZone(ZoneId.systemDefault())
-                    .toLocalDateTime();
+                    .toLocalDateTime()
+                    .plusDays(1);
             endOfDay = outputDate.with(LocalTime.MAX);
         }
         AddUserRequestDTO addUserRequestDTO = new AddUserRequestDTO();
@@ -220,7 +221,7 @@ public class HikiotTool {
         addUserRequestDTO.setDeviceSerial(deviceSerial);
         addUserRequestDTO.setPayload(new AddUserRequestDTO.Payload()
                 .setUserInfo(new AddUserRequestDTO.UserInfo()
-                        .setUserType(VISITOR)
+                        .setUserType("normal")
                         .setEmployeeNo(employeeNo)
                         .setName(name)
                         .setDoorRightPlan(doorRightPlans)
@@ -558,9 +559,12 @@ public class HikiotTool {
     }
 
     public static void main(String[] args) throws IOException, InterruptedException {
-        deleteExpiredVisitors("FX0889961");
-//        addUser(new Date(),"FX0889961","Sheep123","10011",null);
-//        addFace("FX0889961","10011","https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/tmp_81fc8aa195d37dac70fd57221d82845e_1756361097600.jpg");
+//        addUserPlanTemplate("FX0889961");
+//        deleteExpiredVisitors("FX0889961");
+//        queryUserInfo("FX0889961");
+        addUserWeekPlan("FX0889961");
+        addUser(new Date(),"FX0889961","Sheep","1999",null);
+        addFace("FX0889961","1999","https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/tmp_81fc8aa195d37dac70fd57221d82845e_1756361097600.jpg");
 //        addUser(new Date(),"FX0889961","Sheep123","10011");
 //        addFace("FX0889961","1001","https://national-motion.oss-cn-beijing.aliyuncs.com/opt/upFiles/tmp_81fc8aa195d37dac70fd57221d82845e_1756361097600.jpg");
 //        addUser();

+ 12 - 6
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppSitePlaceMapper.xml

@@ -17,7 +17,7 @@
 
         SELECT
             b.id,
-            a.name,
+            a.NAME,
             a.advance_time,
             MIN(b.original_price) AS original_price,
             MAX(b.selling_price) AS selling_price,
@@ -27,16 +27,22 @@
             COALESCE(o.sales, 0) AS sales
         FROM
             nm_site_place a
-                LEFT JOIN nm_site_price_rules b
-                          ON a.id = b.site_place_id
-                              AND b.day_of_week = DAYOFWEEK(NOW()) + 1
-                LEFT JOIN (SELECT product_id, COUNT(1) AS sales FROM nm_order_pro_info WHERE type = 0 GROUP BY  product_id) o ON b.id = o.product_id
+                INNER JOIN nm_site_price_rules b ON a.id = b.site_place_id
+                AND b.day_of_week = DAYOFWEEK(NOW()) - 1
+                AND b.del_flag = 0
+                LEFT JOIN (
+                SELECT product_id, COUNT(1) AS sales
+                FROM nm_order_pro_info
+                WHERE type = 0
+                GROUP BY product_id
+            ) o ON b.id = o.product_id
         WHERE
             a.site_id = #{id}
           AND a.type = 2
+          AND a.del_flag = 0
         GROUP BY
             b.id,
-            a.name,
+            a.NAME,
             a.advance_time,
             a.cover,
             a.reminder,