zhaoxian пре 2 година
родитељ
комит
e3c8779b1c

+ 2 - 2
ruixuan-live/src/main/java/com/ruixuan/jinniu/controller/KuaishouTransferAccountController.java

@@ -38,8 +38,8 @@ public class KuaishouTransferAccountController extends BaseController {
      */
     @ApiOperation(value = "查询账户转让记录列表")
     @GetMapping("/list")
-    public TableDataInfo list(@ApiParam("userId") @RequestParam(value = "userId", required = true) Long userId) {
-        List<JSONObject> list = kuaishouTransferAccountService.selectKuaishouTransferAccountList(userId);
+    public TableDataInfo list(KuaishouTransferAccount account) {
+        List<JSONObject> list = kuaishouTransferAccountService.selectKuaishouTransferAccountList(account);
         return getDataTable(list);
     }
 

+ 5 - 0
ruixuan-live/src/main/java/com/ruixuan/jinniu/entity/KuaishouTransferAccount.java

@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.Date;
+import java.util.List;
 
 /**
  * 账户转让记录对象 kuaishou_transfer_account
@@ -96,4 +97,8 @@ public class KuaishouTransferAccount extends BaseEntity {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
+    List<Long> userList;
+    private String accountName;
+    private String projectName;
+
 }

+ 1 - 2
ruixuan-live/src/main/java/com/ruixuan/jinniu/mapper/KuaishouTransferAccountMapper.java

@@ -3,7 +3,6 @@ package com.ruixuan.jinniu.mapper;
 
 import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.jinniu.entity.KuaishouTransferAccount;
-import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -28,7 +27,7 @@ public interface KuaishouTransferAccountMapper {
      * @param kuaishouTransferAccount 账户转让记录
      * @return 账户转让记录集合
      */
-    public List<JSONObject> selectKuaishouTransferAccountList(@Param("userList") List<Long> userList);
+    public List<JSONObject> selectKuaishouTransferAccountList(KuaishouTransferAccount account);
 
     /**
      * 新增账户转让记录

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/IKuaishouTransferAccountService.java

@@ -27,7 +27,7 @@ public interface IKuaishouTransferAccountService {
      * @param kuaishouTransferAccount 账户转让记录
      * @return 账户转让记录集合
      */
-    public List<JSONObject> selectKuaishouTransferAccountList(Long userId);
+    public List<JSONObject> selectKuaishouTransferAccountList(KuaishouTransferAccount account);
 
     /**
      * 新增账户转让记录

+ 18 - 2
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouProjectServiceImpl.java

@@ -5,8 +5,10 @@ import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.utils.Check;
 import com.ruixuan.common.utils.PageUtils;
 import com.ruixuan.common.utils.Result;
+import com.ruixuan.jinniu.entity.KuaishouAccount;
 import com.ruixuan.jinniu.entity.KuaishouProject;
 import com.ruixuan.jinniu.mapper.KuaishouProjectMapper;
+import com.ruixuan.jinniu.service.IKuaishouAccountService;
 import com.ruixuan.jinniu.service.IKuaishouProjectMemberService;
 import com.ruixuan.jinniu.service.IKuaishouProjectService;
 import com.ruixuan.system.service.ISysDeptService;
@@ -34,7 +36,8 @@ public class KuaishouProjectServiceImpl implements IKuaishouProjectService {
     private ISysUserService sysUserService;
     @Autowired
     private ISysDeptService deptService;
-
+    @Autowired
+    private IKuaishouAccountService kuaishouAccountService;
     @Autowired
     private IKuaishouProjectMemberService kuaishouProjectMemberService;
 
@@ -124,7 +127,20 @@ public class KuaishouProjectServiceImpl implements IKuaishouProjectService {
      */
     @Override
     public int updateKuaishouProject(KuaishouProject kuaishouProject) {
-        return projectMapper.updateKuaishouProject(kuaishouProject);
+        int i = 0;
+        KuaishouProject project = projectMapper.selectKuaishouProjectById(kuaishouProject.getId());
+        if (Check.isNotNull(project)) {
+            i = projectMapper.updateKuaishouProject(kuaishouProject);
+            if (i > 0 && Check.isNotNull(kuaishouProject.getProjectName()) && !project.getProjectName().equals(kuaishouProject.getProjectName())) {
+                //修改项目名称的时候,同步到关联的账户中;
+                List<KuaishouAccount> accounts = kuaishouAccountService.getAccountByProjectId(kuaishouProject.getId());
+                for (KuaishouAccount account : accounts) {
+                    account.setProjectName(kuaishouProject.getProjectName());
+                    kuaishouAccountService.updateKuaishouAccount(account);
+                }
+            }
+        }
+        return i;
     }
 
     /**

+ 5 - 4
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouTransferAccountServiceImpl.java

@@ -57,20 +57,21 @@ public class KuaishouTransferAccountServiceImpl implements IKuaishouTransferAcco
      * @return 账户转让记录
      */
     @Override
-    public List<JSONObject> selectKuaishouTransferAccountList(Long userId) {
-        String roleKey = sysUserService.getRoleKeyByUserId(userId);
+    public List<JSONObject> selectKuaishouTransferAccountList(KuaishouTransferAccount account) {
+        String roleKey = sysUserService.getRoleKeyByUserId(account.getUserId());
         List<Long> userList;
         if ("operationsManager".equals(roleKey)) {
             //运营经理 可以看自己部门所有人
-            Long deptId = deptService.getDeptIdByUserId(userId);
+            Long deptId = deptService.getDeptIdByUserId(account.getUserId());
             userList = deptService.getDeptUserListByDeptId(deptId);
+            account.setUserList(userList);
         } else if ("admin".equals(roleKey) || "directorOperations".equals(roleKey)) {
             userList = null;
         } else {
             return Collections.emptyList();
         }
         PageUtils.startPage();
-        return kuaishouTransferAccountMapper.selectKuaishouTransferAccountList(userList);
+        return kuaishouTransferAccountMapper.selectKuaishouTransferAccountList(account);
     }
 
     /**

+ 15 - 0
ruixuan-live/src/main/resources/mapper/jinniu/KuaishouTransferAccountMapper.xml

@@ -64,7 +64,22 @@
                     #{userId}
                 </foreach>
             </if>
+            <if test="status != null ">and t1.status = #{status}</if>
+            <if test="auditor != null  and auditor != ''">and t1.auditor = #{auditor}</if>
+            <if test="assignee != null ">and t1.assignee = #{assignee}</if>
+            <if test="transferor != null ">and t1.transferor = #{transferor}</if>
+            <if test="accountId != null ">and t1.account_id = #{accountId}</if>
+            <if test="accountName != null  and accountName != ''">
+                and t4.account_name like concat('%', #{accountName}, '%')
+            </if>
+            <if test="projectName != null  and projectName != ''">
+                and t4.project_name like concat('%', #{projectName}, '%')
+            </if>
+            <if test="projectId != null ">and t1.project_id = #{projectId}</if>
+            <if test="transferorDate != null  and transferorDate != ''">and t1.transferor_date = #{transferorDate}</if>
+            <if test="assigneeDate != null  and assigneeDate != ''">and t1.assignee_date = #{assigneeDate}</if>
         </where>
+
     </select>
 
     <select id="selectKuaishouTransferAccountById" parameterType="Long" resultMap="KuaishouTransferAccountResult">