Commit f6eeedbe authored by xiaoguang.xu's avatar xiaoguang.xu

默认开启phoneHash同步

parent b8683339
...@@ -25,7 +25,6 @@ public class SyncHashController { ...@@ -25,7 +25,6 @@ public class SyncHashController {
private Boolean isContinue = false; private Boolean isContinue = false;
public static Boolean fight = true;
@Autowired @Autowired
private IUserRepository userRepository; private IUserRepository userRepository;
...@@ -88,10 +87,4 @@ public class SyncHashController { ...@@ -88,10 +87,4 @@ public class SyncHashController {
isContinue = false; isContinue = false;
return JsonResult.buildSuccessResult(null); return JsonResult.buildSuccessResult(null);
} }
@GetMapping("/fight")
public JsonResult fight() {
fight = true;
return JsonResult.buildSuccessResult(null);
}
} }
package cn.quantgroup.xyqb.event; package cn.quantgroup.xyqb.event;
import cn.quantgroup.xyqb.controller.external.SyncHashController;
import cn.quantgroup.xyqb.entity.UserHashMapping; import cn.quantgroup.xyqb.entity.UserHashMapping;
import cn.quantgroup.xyqb.model.UserRegisterParam; import cn.quantgroup.xyqb.model.UserRegisterParam;
import cn.quantgroup.xyqb.repository.IUserHashMappingRepository; import cn.quantgroup.xyqb.repository.IUserHashMappingRepository;
...@@ -22,10 +21,6 @@ public class PhoneHashEventListener implements ApplicationListener<RegisterEvent ...@@ -22,10 +21,6 @@ public class PhoneHashEventListener implements ApplicationListener<RegisterEvent
String phoneNo = userRegisterParam.getPhoneNo(); String phoneNo = userRegisterParam.getPhoneNo();
Long userId = userRegisterParam.getUser().getId(); Long userId = userRegisterParam.getUser().getId();
if(!SyncHashController.fight){
return;
}
UserHashMapping userHashMapping = userHashMappingRepository.findByUserId(userId); UserHashMapping userHashMapping = userHashMappingRepository.findByUserId(userId);
if (userHashMapping != null && userHashMapping.getIdNoMd5() != null) { if (userHashMapping != null && userHashMapping.getIdNoMd5() != null) {
//已存在的用户, 并且已存在身份证号 //已存在的用户, 并且已存在身份证号
......
...@@ -47,9 +47,6 @@ public interface IUserRepository extends JpaRepository<User, Long>, JpaSpecifica ...@@ -47,9 +47,6 @@ public interface IUserRepository extends JpaRepository<User, Long>, JpaSpecifica
@Query(value = "update user set enable=?1 where phone_no=?2", nativeQuery = true) @Query(value = "update user set enable=?1 where phone_no=?2", nativeQuery = true)
int forbiddenUser(Boolean enable, String phoneNo); int forbiddenUser(Boolean enable, String phoneNo);
@Query(value = "select * from user where id >= ?1 limit ?2", nativeQuery = true)
List<User> findByIdLimit(Long id, Long limit);
List<User> findByIdBetween(Long id, Long endId); List<User> findByIdBetween(Long id, Long endId);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment