Browse Source

家长预约接口修改

liu 2 years atrás
parent
commit
f52e6ec825

+ 2 - 2
src/main/java/com/template/controller/SmartVisitorController.java

@@ -207,7 +207,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
         //要进行家长数据重复判断
         //那是不是第二次预约的时间不能在那个可访问的时间段内
         //例如:比如,第一次约了7:00-10:00;那第二次:6:00-7:30 或 8:11-13:00都不行
-        Integer count = smartVisitorService.queryVisitorCount(su.getIdCard(), startTime, endTime);
+        Integer count = smartVisitorService.queryVisitorCount(su.getId(), startTime, endTime);
         if (count > 0) {
             return CommonResult.fail("该时间段已预约,请勿重复预约!");
         }
@@ -864,7 +864,7 @@ public class SmartVisitorController implements SmartVisitorControllerAPI {
         //要进行家长数据重复判断
         //那是不是第二次预约的时间不能在那个可访问的时间段内
         //例如:比如,第一次约了7:00-10:00;那第二次:6:00-7:30 或 8:11-13:00都不行
-        Integer count = smartVisitorService.queryVisitorCount(su.getIdCard(), startTime, endTime);
+        Integer count = smartVisitorService.queryVisitorCount(su.getId(), startTime, endTime);
         if (count > 0) {
             return CommonResult.fail("该时间段已预约,请勿重复预约!");
         }

+ 1 - 1
src/main/java/com/template/mapper/SmartVisitorMapper.java

@@ -24,7 +24,7 @@ import java.util.List;
 public interface SmartVisitorMapper extends BaseMapper<SmartVisitor> {
     IPage<VisitorPageVo> queryVisitorPage(IPage<VisitorPageVo> page, @Param("userId") Integer userId, @Param("statu") Integer statu, @Param("createStartTime") String createStartTime, @Param("createEndTime") String createEndTime, @Param("keyWord") String keyWord, @Param("visitorStartTime") String visitorStartTime, @Param("visitorEndTime") String visitorEndTime);
 
-    Integer queryVisitorCount(@Param("cardNo") String cardNo, @Param("startTime") String startTime, @Param("endTime") String endTime);
+    Integer queryVisitorCount(@Param("userId") Integer userId, @Param("startTime") String startTime, @Param("endTime") String endTime);
 
     IPage<SmartVisitor> queryVisitorPageDatas(IPage<SmartVisitor> page, @Param("type") Integer type, @Param("studentIds") List<Integer> studentIds, @Param("isAdmin") String isAdmin);
 

+ 1 - 1
src/main/java/com/template/services/SmartVisitorService.java

@@ -32,7 +32,7 @@ public interface SmartVisitorService extends IService<SmartVisitor> {
 
     PageUtils<VisitorPageListVo> smartVisitorPageByUserId(int currentPage, int pageCount, Integer userId, Integer statu, String createStartTime, String createEndTime, String keyWord, String visitorStartTime, String visitorEndTime);
 
-    Integer queryVisitorCount(String cardNo, String startTime, String endTime);
+    Integer queryVisitorCount(Integer userId, String startTime, String endTime);
 
     PageUtils<SmartVisitor> queryVisitorPageDatas(int currentPage, int pageCount, Integer type, List<Integer> studentIds, String isAdmin);
 

+ 2 - 2
src/main/java/com/template/services/impl/SmartVisitorServiceImpl.java

@@ -108,8 +108,8 @@ public class SmartVisitorServiceImpl extends ServiceImpl<SmartVisitorMapper, Sma
     }
 
     @Override
-    public Integer queryVisitorCount(String cardNo, String startTime, String endTime) {
-        Integer result = smartVisitorMapper.queryVisitorCount(cardNo, startTime, endTime);
+    public Integer queryVisitorCount(Integer userId, String startTime, String endTime) {
+        Integer result = smartVisitorMapper.queryVisitorCount(userId, startTime, endTime);
         return result;
     }
 

+ 1 - 1
src/main/resources/mapper/template/SmartVisitorMapper.xml

@@ -55,7 +55,7 @@
         select Count(*) from smart_visitor
         where 1=1
         <if test="cardNo != null and cardNo != ''">
-            and user_number = #{cardNo}
+            and user_id = #{userId}
         </if>
         <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
             and (