Przeglądaj źródła

修改用户分配

yumeng 3 lat temu
rodzic
commit
a9a7f9bc4e

+ 6 - 4
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/UserAllocationMapper.java

@@ -59,16 +59,18 @@ public interface UserAllocationMapper extends BaseMapper<UserAllocation> {
 
     List<JSONObject> selectAccountsByKuaishouUserId(@Param("userId") Long userId);
 
-    int updateProjectStrategyStatus(@Param("accountId") Long accountId,@Param("projectStrategy") Integer projectStrategy);
+    int updateProjectStrategyStatus(@Param("accountId") Long accountId, @Param("projectStrategy") Integer projectStrategy);
 
     List<Long> queryAutomaticAccounts(@Param("projectId") Long projectId);
 
 
+    Map<String, Object> getCwjsSettlementByAccountId(String accountId);
 
-    Map<String,Object>getCwjsSettlementByAccountId(String accountId);
     void updCwjsSettlementStatus(@Param("id") String id, @Param("status") Integer status);
 
-    List<UserAllocation> getAccountInfoBySalesId(@Param("sales")Set<String> sales,@Param("mediaId")String mediaId,@Param("advertiserId")String advertiserId,@Param("productId")String productId);
+    List<UserAllocation> getAccountInfoBySalesId(@Param("sales") Set<String> sales, @Param("mediaId") String mediaId, @Param("advertiserId") String advertiserId, @Param("productId") String productId);
 
-    List<JSONObject> getAccountListByProjectListV2(@Param("list")List list);
+    List<JSONObject> getAccountListByProjectListV2(@Param("list") List list);
+
+    List<JSONObject> getAccountListByProjectAndUserId(@Param("projectId") Long projectId, @Param("userId") String userId);
 }

+ 18 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/mapper/xml/UserAllocationMapper.xml

@@ -46,8 +46,9 @@
     <select id="getAccountListByProject" resultType="com.alibaba.fastjson.JSONObject">
        select
        t1.account_id as 'accountId',
-       (select  realname  from sys_user where  id = t1.user_id ) as 'userName',
-       t1.auth_name as 'authName'
+       t1.user_name as 'userName',
+       t1.auth_name as 'authName',
+       t1.account_status as 'accountStatus'
        from ctop_user_allocation t1
        where t1.project_id = #{projectId}
        order by t1.create_time desc
@@ -281,6 +282,21 @@
         and t1.account_status = 0
         order by t1.create_time desc
     </select>
+    <select id="getAccountListByProjectAndUserId" resultType="com.alibaba.fastjson.JSONObject">
+        select
+       t1.account_id as 'accountId',
+       t1.user_name as 'userName',
+       t1.auth_name as 'authName',
+       t1.account_status as 'accountStatus'
+       from ctop_user_allocation t1
+       where t1.project_id = #{projectId}
+        <if test="userId !=null and userId != '' ">
+            and t1.user_id = #{userId}
+        </if>
+       order by t1.create_time desc
+
+
+    </select>
     <!-- 修改状态 -->
     <update id="updCwjsSettlementStatus">
         UPDATE ctop_cwjs_settlement_info

+ 2 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/IUserAllocationService.java

@@ -72,4 +72,6 @@ public interface IUserAllocationService extends IService<UserAllocation> {
     Result<UserAllocation> editUserAlloCation(UserAllocation userAllocation);
 
     Map<Long, List<JSONObject>> getAccountListByProjectListV2(List<JSONObject> projectList);
+
+    List<JSONObject> getAccountListByProjectAndUserId(Long projectId, String userId);
 }

+ 8 - 3
jeecg-boot-module-system/src/main/java/cn/com/ctop/common/module/service/impl/UserAllocationServiceImpl.java

@@ -218,6 +218,11 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
     }
 
     @Override
+    public List<JSONObject> getAccountListByProjectAndUserId(Long projectId, String userId) {
+        return userAllocationMapper.getAccountListByProjectAndUserId(projectId, userId);
+    }
+
+    @Override
     public List<JSONObject> getUserIdListByProductId(Long productId) {
         return userAllocationMapper.getUserIdListByProductId(productId);
     }
@@ -310,9 +315,9 @@ public class UserAllocationServiceImpl extends ServiceImpl<UserAllocationMapper,
             }
 
             //同步 财务结算 状态
-            Map<String,Object> cwjs = userAllocationMapper.getCwjsSettlementByAccountId(String.valueOf(userAllocationEntity.getAccountId()));
-            if (!Check.isNull(cwjs)){
-                userAllocationMapper.updCwjsSettlementStatus(cwjs.get("id").toString(),accountStatus);
+            Map<String, Object> cwjs = userAllocationMapper.getCwjsSettlementByAccountId(String.valueOf(userAllocationEntity.getAccountId()));
+            if (!Check.isNull(cwjs)) {
+                userAllocationMapper.updCwjsSettlementStatus(cwjs.get("id").toString(), accountStatus);
             }
             LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
             SysLog sysLog = new SysLog();