Sfoglia il codice sorgente

bugfix:学员周日补卡、湘麓轩机器未正确下发卡片

xiari 8 mesi fa
parent
commit
9f45d6fdda

+ 10 - 8
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/payment/service/impl/PtUserAccountServiceImpl.java

@@ -677,9 +677,9 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
     public List<PtUserAccountVo> getUserAccountVoByDay(Date startDate) {
         // 获取指定天数内有更新账户信息的
         Date date = new Date();
-        // 新增的账户和修改的账户
+        // 1.新增的账户
         LambdaQueryWrapper<PtUserAccount> between1 = Wrappers.lambdaQuery(PtUserAccount.class)
-            .between(PtUserAccount::getCreateTime, startDate, date).or().between(PtUserAccount::getUpdateTime, startDate, date);
+            .between(PtUserAccount::getCreateTime, startDate, date);
 //            .eq(PtUserAccount::getAccountStatus, UserAccountStatusEnum.IS_OPEN.code());
         List<PtUserAccountVo> increaseList = baseMapper.selectVoList(between1);
 
@@ -688,14 +688,14 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
             rs.addAll(increaseList);
         }
 
-        // 查询账户删除的
+        // 2.查询账户删除的
         List<PtUserAccountVo> deleteAccounts = baseMapper.getUserAccountByDateScope(startDate, date, DELETED);
         if(CollectionUtil.isNotEmpty(deleteAccounts)){
             rs.addAll(deleteAccounts);
         }
 
 
-        // 更新人脸的
+        // 3.更新人脸的
         //排除 全量同步的数据
         LambdaQueryWrapper<PtUserAccount> between = Wrappers.lambdaQuery(PtUserAccount.class)
 //            .ne(PtUserAccount::getUpdateBy, FULL_SYNC_ADMIN)
@@ -713,10 +713,10 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
             rs.addAll(updatePhotos);
         }
 
-        // 更新卡片的 卡片有可能是注销的
+        // 4.更新卡片的 卡片有可能是注销的
         List<PtCardVo> cardVos = ptCardService.getList(startDate, date);
         cardVos = cardVos.stream().filter(e -> e.getFactoryId() != 0L).toList();
-        List<Long> userIds = cardVos.stream().map(PtCardVo::getUserId).toList();
+        List<Long> userIds = cardVos.stream().map(PtCardVo::getUserId).distinct().toList();
         if (CollectionUtil.isNotEmpty(userIds)) {
             LambdaQueryWrapper<PtUserAccount> in = Wrappers.lambdaQuery(PtUserAccount.class).in(PtUserAccount::getUserId, userIds);
             List<PtUserAccountVo> userAccountVos1 = baseMapper.selectVoList(in);
@@ -727,8 +727,10 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
                 PtUserAccountVo userAccountVo = collect.get(userId);
                 // 没有对应的用户账户userAccountVo==null 说明 这个账号被删除了
                 if (userAccountVo != null) {
-                    userAccountVo.setCard(x);
-                    userAccountVoList.add(userAccountVo);
+                    // 复制一个新对象
+                    PtUserAccountVo newObject = BeanUtil.copyProperties(userAccountVo, PtUserAccountVo.class);
+                    newObject.setCard(x);
+                    userAccountVoList.add(newObject);
                 }
             });
             rs.addAll(userAccountVoList);

+ 2 - 2
ruoyi-server/ruoyi-server-hik/src/main/java/org/dromara/server/hik/service/impl/SendDeviceServiceImpl.java

@@ -1214,8 +1214,8 @@ public class SendDeviceServiceImpl implements ISendDeviceService {
                 XfTermVo termVo = xfTermService.getByMac(k);
                 if(termVo != null){
                     long l = System.currentTimeMillis() - t;
-                    // 正常在线的心跳时间间隔是30秒,但怕有网络延迟,这里设置60秒内都算在线
-                    if (l <= 60 * 1000) {
+                    // 正常在线的心跳时间间隔是30秒,但怕有网络延迟,这里设置35秒内都算在线
+                    if (l <= 35 * 1000) {
                         rs.add(termVo.getTermNo());
                     }
                 }