Commit 60b8b824 60b8b824da5589211d1dbd44fe6287f0c2eb5131 by xianghan

1.修改会员信息修改、账号信息修改的方式

1 parent 9c38b950
...@@ -5,6 +5,7 @@ import org.springframework.data.jpa.repository.JpaRepository; ...@@ -5,6 +5,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
5 import org.springframework.data.jpa.repository.JpaSpecificationExecutor; 5 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 import org.springframework.data.jpa.repository.Modifying; 6 import org.springframework.data.jpa.repository.Modifying;
7 import org.springframework.data.jpa.repository.Query; 7 import org.springframework.data.jpa.repository.Query;
8 import org.springframework.data.repository.query.Param;
8 9
9 import java.time.LocalDateTime; 10 import java.time.LocalDateTime;
10 import java.util.Optional; 11 import java.util.Optional;
...@@ -24,4 +25,35 @@ public interface UserTvRepository extends JpaRepository<UserTv, Long>, JpaSpecif ...@@ -24,4 +25,35 @@ public interface UserTvRepository extends JpaRepository<UserTv, Long>, JpaSpecif
24 @Modifying 25 @Modifying
25 @Query(value = "UPDATE `uc_user_tv` SET `vis_user_id` = ?2, `update_time` = ?3 WHERE `id` = ?1", nativeQuery = true) 26 @Query(value = "UPDATE `uc_user_tv` SET `vis_user_id` = ?2, `update_time` = ?3 WHERE `id` = ?1", nativeQuery = true)
26 Integer updateUserTvVisUserId(Long id, Long visUserId, LocalDateTime now); 27 Integer updateUserTvVisUserId(Long id, Long visUserId, LocalDateTime now);
28
29
30 @Modifying
31 @Query(value = "UPDATE `uc_user_tv` SET `member_id` = ?2, `update_time` = now() WHERE `platform_account` = ?1", nativeQuery = true)
32 void updateMemberId(String platformAccount, Long memberId);
33
34 @Modifying
35 @Query(value = "UPDATE `uc_user_tv` SET `priority_member_code` = ?2, `update_time` = now() WHERE `platform_account` = ?1", nativeQuery = true)
36 void updatePriorityMemberCode(String platformAccount, String priorityMemberCode);
37
38 @Modifying
39 @Query(value = "UPDATE `uc_user_tv` SET " +
40 " `cellphone` = :#{#resources.cellphone}, " +
41 " `username` = :#{#resources.username}, " +
42 " `nickname` = :#{#resources.nickname}, " +
43 " `image` = :#{#resources.image}, " +
44 " `platform` = :#{#resources.platform}, " +
45 " `login_days` = :#{#resources.loginDays}, " +
46 " `continue_days` = :#{#resources.continueDays}, " +
47 " `active_time` = :#{#resources.activeTime}, " +
48 " `groups` = :#{#resources.groups}, " +
49 " `tags` = :#{#resources.tags}, " +
50 " `login_type` = :#{#resources.loginType}, " +
51 " `status` = :#{#resources.status}, " +
52 " `description` = :#{#resources.description}, " +
53 " `create_by` = :#{#resources.createBy}, " +
54 " `update_by` = :#{#resources.updateBy}, " +
55 " `priority_member_code` = :#{#resources.priorityMemberCode}, " +
56 " `vis_user_id` = :#{#resources.visUserId}, " +
57 " `update_time` = now() WHERE `platform_account` = :#{#resources.platformAccount}", nativeQuery = true)
58 void updateUserTvByPlatformAccount(@Param("resources") UserTv userTv);
27 } 59 }
......
...@@ -88,4 +88,24 @@ public interface UserTvService { ...@@ -88,4 +88,24 @@ public interface UserTvService {
88 */ 88 */
89 UserTvDTO asyncUpdateUserTvVisUserId(UserTv resources); 89 UserTvDTO asyncUpdateUserTvVisUserId(UserTv resources);
90 90
91
92 /**
93 *
94 * @param platformAccount
95 * @param id
96 */
97 void updateMemberId(String platformAccount, Long id);
98
99 /**
100 *
101 * @param platformAccount
102 * @param priorityMemberCode
103 */
104 void updatePriorityMemberCode(String platformAccount, String priorityMemberCode);
105
106 /**
107 *
108 * @param userTv
109 */
110 void updateUserTvByPlatformAccount(UserTv userTv);
91 } 111 }
......
...@@ -44,6 +44,25 @@ public class UserTvServiceImpl implements UserTvService { ...@@ -44,6 +44,25 @@ public class UserTvServiceImpl implements UserTvService {
44 @Autowired 44 @Autowired
45 private UserTvRepository userTvRepository; 45 private UserTvRepository userTvRepository;
46 46
47 @Override
48 @Transactional(rollbackFor = Exception.class)
49 public void updateMemberId(String platformAccount, Long memberId) {
50 this.userTvRepository.updateMemberId(platformAccount, memberId);
51 }
52
53 @Override
54 @Transactional(rollbackFor = Exception.class)
55 public void updatePriorityMemberCode(String platformAccount, String priorityMemberCode) {
56 this.userTvRepository.updatePriorityMemberCode(platformAccount, priorityMemberCode);
57 }
58
59 @Override
60 @Transactional(rollbackFor = Exception.class)
61 public void updateUserTvByPlatformAccount(UserTv userTv) {
62 this.userTvRepository.updateUserTvByPlatformAccount(userTv);
63 }
64
65
47 /** 66 /**
48 * 获取大屏账户对应的会员 67 * 获取大屏账户对应的会员
49 * <Waring> 68 * <Waring>
......