zhaoxian 2 лет назад
Родитель
Сommit
ea9b93a390
32 измененных файлов с 1764 добавлено и 344 удалено
  1. 36 60
      ruixuan-admin/src/main/java/com/ruixuan/web/controller/system/SysUserController.java
  2. 101 0
      ruixuan-common/src/main/java/com/ruixuan/common/utils/Result.java
  3. 1 1
      ruixuan-framework/src/main/java/com/ruixuan/framework/config/SecurityConfig.java
  4. 3 3
      ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java
  5. 1 1
      ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java
  6. 56 30
      ruixuan-live/src/main/java/com/ruixuan/jinniu/controller/KuaishouAccountController.java
  7. 13 2
      ruixuan-live/src/main/java/com/ruixuan/jinniu/controller/KuaishouAdvertiserController.java
  8. 46 3
      ruixuan-live/src/main/java/com/ruixuan/jinniu/controller/KuaishouProjectController.java
  9. 62 0
      ruixuan-live/src/main/java/com/ruixuan/jinniu/controller/KuaishouTransferAccountController.java
  10. 24 5
      ruixuan-live/src/main/java/com/ruixuan/jinniu/entity/KuaishouAccount.java
  11. 22 4
      ruixuan-live/src/main/java/com/ruixuan/jinniu/entity/KuaishouProject.java
  12. 72 0
      ruixuan-live/src/main/java/com/ruixuan/jinniu/entity/KuaishouProjectMember.java
  13. 99 0
      ruixuan-live/src/main/java/com/ruixuan/jinniu/entity/KuaishouTransferAccount.java
  14. 15 13
      ruixuan-live/src/main/java/com/ruixuan/jinniu/mapper/KuaishouAccountMapper.java
  15. 2 0
      ruixuan-live/src/main/java/com/ruixuan/jinniu/mapper/KuaishouProjectMapper.java
  16. 59 0
      ruixuan-live/src/main/java/com/ruixuan/jinniu/mapper/KuaishouProjectMemberMapper.java
  17. 55 0
      ruixuan-live/src/main/java/com/ruixuan/jinniu/mapper/KuaishouTransferAccountMapper.java
  18. 8 10
      ruixuan-live/src/main/java/com/ruixuan/jinniu/service/IKuaishouAccountService.java
  19. 59 0
      ruixuan-live/src/main/java/com/ruixuan/jinniu/service/IKuaishouProjectMemberService.java
  20. 4 0
      ruixuan-live/src/main/java/com/ruixuan/jinniu/service/IKuaishouProjectService.java
  21. 54 0
      ruixuan-live/src/main/java/com/ruixuan/jinniu/service/IKuaishouTransferAccountService.java
  22. 82 15
      ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouAccountServiceImpl.java
  23. 121 0
      ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouProjectMemberServiceImpl.java
  24. 53 3
      ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouProjectServiceImpl.java
  25. 114 0
      ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouTransferAccountServiceImpl.java
  26. 236 81
      ruixuan-live/src/main/resources/mapper/jinniu/KuaishouAccountMapper.xml
  27. 107 94
      ruixuan-live/src/main/resources/mapper/jinniu/KuaishouProjectMapper.xml
  28. 125 0
      ruixuan-live/src/main/resources/mapper/jinniu/KuaishouProjectMemberMapper.xml
  29. 115 0
      ruixuan-live/src/main/resources/mapper/jinniu/KuaishouTransferAccountMapper.xml
  30. 5 6
      ruixuan-system/src/main/java/com/ruixuan/system/mapper/SysUserMapper.java
  31. 2 1
      ruixuan-system/src/main/java/com/ruixuan/system/service/ISysUserService.java
  32. 12 12
      ruixuan-system/src/main/java/com/ruixuan/system/service/impl/SysUserServiceImpl.java

+ 36 - 60
ruixuan-admin/src/main/java/com/ruixuan/web/controller/system/SysUserController.java

@@ -31,14 +31,13 @@ import com.ruixuan.system.service.ISysUserService;
 
 /**
  * 用户信息
- * 
+ *
  * @author ruixuan
  */
-@Api(tags = "系统设置-用户",description = "system-user")
+@Api(tags = "系统设置-用户", description = "system-user")
 @RestController
 @RequestMapping("/system/user")
-public class SysUserController extends BaseController
-{
+public class SysUserController extends BaseController {
     @Autowired
     private ISysUserService userService;
 
@@ -51,12 +50,13 @@ public class SysUserController extends BaseController
 
     /**
      * 根据userId获取roleKey
+     *
      * @param userId
      * @return
      */
     @GetMapping("/getRoleKeyByUserId")
-    public String getRoleKeyByUserId(String userId) {
-       String roleKey = userService.getRoleKeyByUserId(userId);
+    public String getRoleKeyByUserId(Long userId) {
+        String roleKey = userService.getRoleKeyByUserId(userId);
         return roleKey;
     }
 
@@ -66,8 +66,7 @@ public class SysUserController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:user:list')")
     @GetMapping("/list")
-    public TableDataInfo list(SysUser user)
-    {
+    public TableDataInfo list(SysUser user) {
         startPage();
         List<SysUser> list = userService.selectUserList(user);
         return getDataTable(list);
@@ -76,8 +75,7 @@ public class SysUserController extends BaseController
     @Log(title = "用户管理", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('system:user:export')")
     @PostMapping("/export")
-    public void export(HttpServletResponse response, SysUser user)
-    {
+    public void export(HttpServletResponse response, SysUser user) {
         List<SysUser> list = userService.selectUserList(user);
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         util.exportExcel(response, list, "用户数据");
@@ -86,8 +84,7 @@ public class SysUserController extends BaseController
     @Log(title = "用户管理", businessType = BusinessType.IMPORT)
     @PreAuthorize("@ss.hasPermi('system:user:import')")
     @PostMapping("/importData")
-    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
-    {
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         List<SysUser> userList = util.importExcel(file.getInputStream());
         String operName = getUsername();
@@ -96,8 +93,7 @@ public class SysUserController extends BaseController
     }
 
     @PostMapping("/importTemplate")
-    public void importTemplate(HttpServletResponse response)
-    {
+    public void importTemplate(HttpServletResponse response) {
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         util.importTemplateExcel(response, "用户数据");
     }
@@ -106,16 +102,14 @@ public class SysUserController extends BaseController
      * 根据用户编号获取详细信息
      */
     @PreAuthorize("@ss.hasPermi('system:user:query')")
-    @GetMapping(value = { "/", "/{userId}" })
-    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
-    {
+    @GetMapping(value = {"/", "/{userId}"})
+    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) {
         userService.checkUserDataScope(userId);
         AjaxResult ajax = AjaxResult.success();
         List<SysRole> roles = roleService.selectRoleAll();
         ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList()));
         ajax.put("posts", postService.selectPostAll());
-        if (StringUtils.isNotNull(userId))
-        {
+        if (StringUtils.isNotNull(userId)) {
             SysUser sysUser = userService.selectUserById(userId);
             ajax.put(AjaxResult.DATA_TAG, sysUser);
             ajax.put("postIds", postService.selectPostListByUserId(userId));
@@ -130,20 +124,14 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:add')")
     @Log(title = "用户管理", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@Validated @RequestBody SysUser user)
-    {
-        if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName())))
-        {
+    public AjaxResult add(@Validated @RequestBody SysUser user) {
+        if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(user.getUserName()))) {
             return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
-        }
-        else if (StringUtils.isNotEmpty(user.getPhonenumber())
-                && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
-        {
+        } else if (StringUtils.isNotEmpty(user.getPhonenumber())
+                && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
             return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
-        }
-        else if (StringUtils.isNotEmpty(user.getEmail())
-                && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
-        {
+        } else if (StringUtils.isNotEmpty(user.getEmail())
+                && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
             return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
         }
         user.setCreateBy(getUsername());
@@ -157,18 +145,14 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@Validated @RequestBody SysUser user)
-    {
+    public AjaxResult edit(@Validated @RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         if (StringUtils.isNotEmpty(user.getPhonenumber())
-                && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
-        {
+                && UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) {
             return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
-        }
-        else if (StringUtils.isNotEmpty(user.getEmail())
-                && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
-        {
+        } else if (StringUtils.isNotEmpty(user.getEmail())
+                && UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user))) {
             return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
         }
         user.setUpdateBy(getUsername());
@@ -181,10 +165,8 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @Log(title = "用户管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{userIds}")
-    public AjaxResult remove(@PathVariable Long[] userIds)
-    {
-        if (ArrayUtils.contains(userIds, getUserId()))
-        {
+    public AjaxResult remove(@PathVariable Long[] userIds) {
+        if (ArrayUtils.contains(userIds, getUserId())) {
             return error("当前用户不能删除");
         }
         return toAjax(userService.deleteUserByIds(userIds));
@@ -196,8 +178,7 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping("/resetPwd")
-    public AjaxResult resetPwd(@RequestBody SysUser user)
-    {
+    public AjaxResult resetPwd(@RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
@@ -211,8 +192,7 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
     @PutMapping("/changeStatus")
-    public AjaxResult changeStatus(@RequestBody SysUser user)
-    {
+    public AjaxResult changeStatus(@RequestBody SysUser user) {
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         user.setUpdateBy(getUsername());
@@ -224,8 +204,7 @@ public class SysUserController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:user:query')")
     @GetMapping("/authRole/{userId}")
-    public AjaxResult authRole(@PathVariable("userId") Long userId)
-    {
+    public AjaxResult authRole(@PathVariable("userId") Long userId) {
         AjaxResult ajax = AjaxResult.success();
         SysUser user = userService.selectUserById(userId);
         List<SysRole> roles = roleService.selectRolesByUserId(userId);
@@ -240,29 +219,26 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.GRANT)
     @PutMapping("/authRole")
-    public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
-    {
+    public AjaxResult insertAuthRole(Long userId, Long[] roleIds) {
         userService.checkUserDataScope(userId);
         userService.insertUserAuth(userId, roleIds);
         return success();
     }
 
 
-    @ApiOperation(value = "根据用户id查询用户以及角色信息",notes = "根据用户id查询用户以及角色信息")
+    @ApiOperation(value = "根据用户id查询用户以及角色信息", notes = "根据用户id查询用户以及角色信息")
     @GetMapping("/getUserRoleByUserId")
-    public AjaxResult getUserRoleByUserId( @ApiParam("用户id") @RequestParam(value = "userId")  Long userId) {
-        return AjaxResult.success("查询成功",userService.getUserRoleByUserId(userId));
+    public AjaxResult getUserRoleByUserId(@ApiParam("用户id") @RequestParam(value = "userId") Long userId) {
+        return AjaxResult.success("查询成功", userService.getUserRoleByUserId(userId));
     }
 
 
-    @ApiOperation(value = "根据角色名称code查询用户信息",notes = "根据角色名称code查询用户信息-可以传入多个角色code")
+    @ApiOperation(value = "根据角色名称code查询用户信息", notes = "根据角色名称code查询用户信息-可以传入多个角色code")
     @GetMapping("/getUserByRoleName")
-    public AjaxResult getUserByRoleName( @ApiParam("角色名称的code") @RequestParam(value = "roleName") String roleName) {
-        List<String> roleCodeList = Arrays.asList(StringUtils.split(roleName,","));
-        return AjaxResult.success("查询成功",userService.getUserByRoleName(roleCodeList));
+    public AjaxResult getUserByRoleName(@ApiParam("角色名称的code") @RequestParam(value = "roleName") String roleName) {
+        List<String> roleCodeList = Arrays.asList(StringUtils.split(roleName, ","));
+        return AjaxResult.success("查询成功", userService.getUserByRoleName(roleCodeList));
     }
 
 
-
-
 }

+ 101 - 0
ruixuan-common/src/main/java/com/ruixuan/common/utils/Result.java

@@ -0,0 +1,101 @@
+package com.ruixuan.common.utils;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 接口返回数据格式
+ */
+@Data
+public class Result<T> implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 返回处理消息
+     */
+    private String message = "success";
+
+    /**
+     * 返回代码
+     */
+    private Integer code = 0;
+
+    /**
+     * 返回数据对象 data
+     */
+    private T result;
+
+
+    public Result() {
+
+    }
+
+    public Result<T> success(String message) {
+        this.message = message;
+        this.code = 0;
+        return this;
+    }
+
+    public static <T> Result<T> success() {
+        Result<T> r = new Result<T>();
+        r.setCode(0);
+        r.setMessage("success");
+        return r;
+    }
+
+    public static <T> Result<T> success(T data) {
+        Result<T> r = new Result<T>();
+        r.setCode(0);
+        r.setMessage("success");
+        r.setResult(data);
+        return r;
+    }
+
+    public static <T> Result<T> success(String msg, T data) {
+        Result<T> r = new Result<T>();
+        r.setCode(0);
+        r.setMessage(msg);
+        r.setResult(data);
+        return r;
+    }
+
+    /**
+     * ================================================================================
+     */
+
+    public static <T> Result<T> error(String msg) {
+        Result<T> r = new Result<T>();
+        r.setCode(-1);
+        r.setMessage(msg);
+        return r;
+    }
+
+    public static <T> Result<T> error(String msg, T data) {
+        Result<T> r = new Result<T>();
+        r.setCode(-1);
+        r.setMessage(msg);
+        r.setResult(data);
+        return r;
+    }
+
+    public static Result<Object> error500(String msg) {
+        return error(500, msg);
+    }
+
+    public static Result<Object> error(int code, String msg) {
+        Result<Object> r = new Result<Object>();
+        r.setCode(code);
+        r.setMessage(msg);
+        return r;
+    }
+
+    /**
+     * 无权限访问返回结果
+     */
+    public static Result<Object> noauth(String msg) {
+        return error(510, msg);
+    }
+
+}

+ 1 - 1
ruixuan-framework/src/main/java/com/ruixuan/framework/config/SecurityConfig.java

@@ -123,7 +123,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/item/*").permitAll()
                 .antMatchers("/system/user/*").permitAll()
                 .antMatchers("/kuaishou/promoter/*").permitAll()
-                .antMatchers("/rx/**").permitAll()
+                .antMatchers("/kuaishou/**").permitAll()
                 .antMatchers("/agent/account/**").permitAll()
 
                 // 除上面外的所有请求全部需要鉴权认证

+ 3 - 3
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java

@@ -357,7 +357,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
 
     @Override
     public JSONObject getPersonalInfo(Long userId, String type) {
-        String roleKey = userService.getRoleKeyByUserId(String.valueOf(userId));
+        String roleKey = userService.getRoleKeyByUserId(userId);
         List<Long> userList = null;
         if ("courtshipManager".equals(roleKey) || "bdManager".equals(roleKey) || "associationManager".equals(roleKey)) {
             Long deptId = deptService.getDeptIdByUserId(userId);
@@ -392,7 +392,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
 
     @Override
     public JSONObject getOrderData(Long userId, String startDate, String endDate, String type) {
-        String roleKey = userService.getRoleKeyByUserId(String.valueOf(userId));
+        String roleKey = userService.getRoleKeyByUserId(userId);
         List<Long> userList = null;
         if ("courtshipManager".equals(roleKey) || "bdManager".equals(roleKey)) {
             Long deptId = deptService.getDeptIdByUserId(userId);
@@ -577,7 +577,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
 
     @Override
     public JSONObject getDataAnalysis(Long userId, String startDate, String endDate, String type) {
-        String roleKey = userService.getRoleKeyByUserId(String.valueOf(userId));
+        String roleKey = userService.getRoleKeyByUserId(userId);
         List<Long> userList = null;
         if ("courtshipManager".equals(roleKey) || "bdManager".equals(roleKey)) {
             Long deptId = deptService.getDeptIdByUserId(userId);

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -64,7 +64,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
      */
     @Override
     public List<KuaishouPromoter> selectKuaishouPromoterList(Long userId, Long promoterId, String promoterNickName, String parameter, String orderBy) {
-        String roleKey = sysUserService.getRoleKeyByUserId(userId + "");
+        String roleKey = sysUserService.getRoleKeyByUserId(userId);
         List<Long> userList = null;
         //角色:供应链管理员、招商、招商经理可以看到所有的达人信息
         if (roleKey.contains("courtship") || "supplyChainAdmin".equals(roleKey) || "admin".equals(roleKey)) {

+ 56 - 30
ruixuan-live/src/main/java/com/ruixuan/jinniu/controller/KuaishouAccountController.java

@@ -1,79 +1,105 @@
 package com.ruixuan.jinniu.controller;
 
 
-import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-
+import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.core.controller.BaseController;
 import com.ruixuan.common.core.domain.AjaxResult;
 import com.ruixuan.common.core.page.TableDataInfo;
 import com.ruixuan.jinniu.entity.KuaishouAccount;
 import com.ruixuan.jinniu.service.IKuaishouAccountService;
-import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * 账户Controller
  *
  * @author ruoyi
  * @date 2023-03-15
  */
+@Api(tags = "-------------磁力金牛------------- 账户Controller")
 @RestController
-@RequestMapping("/system/account")
+@RequestMapping("/kuaishou/account")
 public class KuaishouAccountController extends BaseController {
     @Autowired
     private IKuaishouAccountService kuaishouAccountService;
 
     /**
-     * 查询账户列表
+     * 查询未绑定账户
      */
-    @PreAuthorize("@ss.hasPermi('system:account:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(KuaishouAccount kuaishouAccount) {
+    @ApiOperation(value = "查询未绑定账户")
+    @GetMapping("/unboundAccountList")
+    public TableDataInfo unboundAccountList(
+            @ApiParam("账户ID") @RequestParam(value = "accountId", required = false) Long accountId,
+            @ApiParam("快手ID") @RequestParam(value = "ksId", required = false) Long ksId,
+            @ApiParam("账户名") @RequestParam(value = "accountName", required = false) String accountName,
+            @ApiParam("状态 1-认证,2-未认证") @RequestParam(value = "status", required = false) Long status
+    ) {
         startPage();
-        List<KuaishouAccount> list = kuaishouAccountService.selectKuaishouAccountList(kuaishouAccount);
+        List<JSONObject> list = kuaishouAccountService.selectUnboundAccountList(accountId, ksId, accountName, status);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询账户
+     */
+    @ApiOperation(value = "查询账户")
+    @GetMapping("/list")
+    public TableDataInfo list(
+            @ApiParam("登录人ID") @RequestParam(value = "userId", required = true) Long userId,
+            @ApiParam("账户ID") @RequestParam(value = "accountId", required = false) Long accountId,
+            @ApiParam("账户名") @RequestParam(value = "accountName", required = false) String accountName) {
+        List<KuaishouAccount> list = kuaishouAccountService.selectKuaishouAccountList(userId, accountId, accountName);
         return getDataTable(list);
     }
 
 
     /**
-     * 获取账户详细信息
+     * 按项目Id获取帐户
      */
-    @PreAuthorize("@ss.hasPermi('system:account:query')")
-    @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id) {
-        return AjaxResult.success(kuaishouAccountService.selectKuaishouAccountById(id));
+    @ApiOperation(value = "按项目Id获取帐户")
+    @GetMapping("/getAccountByProjectId")
+    public TableDataInfo getAccountByProjectId(@ApiParam("项目ID") @RequestParam(value = "projectId", required = false) Long projectId) {
+        List<KuaishouAccount> list = kuaishouAccountService.getAccountByProjectId(projectId);
+        return getDataTable(list);
     }
 
+
     /**
-     * 新增账户
+     * 获取账户详细信息
      */
-    @PostMapping
-    public AjaxResult add(@RequestBody KuaishouAccount kuaishouAccount) {
-        return toAjax(kuaishouAccountService.insertKuaishouAccount(kuaishouAccount));
+    @ApiOperation(value = "获取账户详细信息")
+    @GetMapping(value = "/getInfo")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(kuaishouAccountService.selectKuaishouAccountById(id));
     }
 
     /**
-     * 修改账户
+     * 删除
      */
-    @PutMapping
-    public AjaxResult edit(@RequestBody KuaishouAccount kuaishouAccount) {
-        return toAjax(kuaishouAccountService.updateKuaishouAccount(kuaishouAccount));
+    @ApiOperation(value = "删除")
+    @GetMapping(value = "/deleteById")
+    public AjaxResult deleteById(@ApiParam("id") @RequestParam(value = "id", required = true) Long id) {
+        return AjaxResult.success(kuaishouAccountService.deleteKuaishouAccountById(id));
     }
 
     /**
-     * 删除账户
+     * 认领账户
      */
-    @DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids) {
-        return toAjax(kuaishouAccountService.deleteKuaishouAccountByIds(ids));
+    @ApiOperation(value = "认领账户")
+    @PostMapping("/claimAccount")
+    public AjaxResult claimAccount(@RequestBody JSONObject o) {
+        return toAjax(kuaishouAccountService.insertKuaishouAccount(o));
     }
+
 }

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

@@ -7,12 +7,14 @@ import com.ruixuan.jinniu.entity.KuaishouAdvertiser;
 import com.ruixuan.jinniu.service.IKuaishouAdvertiserService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
@@ -23,9 +25,9 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-03-14
  */
-@Api(tags = "广告主")
+@Api(tags = "-------------磁力金牛-------------广告主Controller")
 @RestController
-@RequestMapping("/Kuaishou/advertiser")
+@RequestMapping("/kuaishou/advertiser")
 public class KuaishouAdvertiserController extends BaseController {
     @Autowired
     private IKuaishouAdvertiserService KuaishouAdvertiserService;
@@ -66,5 +68,14 @@ public class KuaishouAdvertiserController extends BaseController {
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(KuaishouAdvertiserService.selectKuaishouAdvertiserById(id));
     }
+
+    /**
+     * 删除
+     */
+    @ApiOperation(value = "删除")
+    @GetMapping(value = "/deleteById")
+    public AjaxResult deleteById(@ApiParam("id") @RequestParam(value = "id", required = true) Long id) {
+        return AjaxResult.success(KuaishouAdvertiserService.deleteKuaishouAdvertiserById(id));
+    }
 }
 

+ 46 - 3
ruixuan-live/src/main/java/com/ruixuan/jinniu/controller/KuaishouProjectController.java

@@ -1,19 +1,24 @@
 package com.ruixuan.jinniu.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.core.controller.BaseController;
 import com.ruixuan.common.core.domain.AjaxResult;
 import com.ruixuan.common.core.page.TableDataInfo;
+import com.ruixuan.common.utils.Result;
 import com.ruixuan.jinniu.entity.KuaishouProject;
+import com.ruixuan.jinniu.service.IKuaishouProjectMemberService;
 import com.ruixuan.jinniu.service.IKuaishouProjectService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
@@ -24,20 +29,22 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-03-14
  */
-@Api(tags = "项目")
+@Api(tags = "-------------磁力金牛-------------项目信息Controller")
 @RestController
-@RequestMapping("/Kuaishou/project")
+@RequestMapping("/kuaishou/project")
 public class KuaishouProjectController extends BaseController {
     @Autowired
     private IKuaishouProjectService KuaishouProjectService;
 
+    @Autowired
+    private IKuaishouProjectMemberService kuaishouProjectMemberService;
+
     /**
      * 查询项目信息列表
      */
     @ApiOperation(value = "查询项目信息列表")
     @GetMapping("/list")
     public TableDataInfo list(KuaishouProject kuaishouProject) {
-        startPage();
         List<KuaishouProject> list = KuaishouProjectService.selectKuaishouProjectList(kuaishouProject);
         return getDataTable(list);
     }
@@ -67,4 +74,40 @@ public class KuaishouProjectController extends BaseController {
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(KuaishouProjectService.selectKuaishouProjectById(id));
     }
+
+    /**
+     * 删除
+     */
+    @ApiOperation(value = "删除")
+    @GetMapping(value = "/deleteById")
+    public AjaxResult deleteById(@ApiParam("id") @RequestParam(value = "id", required = true) Long id) {
+        return AjaxResult.success(KuaishouProjectService.deleteKuaishouProjectById(id));
+    }
+
+    /**
+     * 查询优化目标
+     */
+    @ApiOperation(value = "查询优化目标")
+    @GetMapping("/getOcpxActionType")
+    public Result<Object> getOcpxActionType() {
+        return KuaishouProjectService.getOcpxActionType();
+    }
+
+    /**
+     * 查询项目的参与人员名称
+     */
+    @ApiOperation(value = "查询项目的参与人员名称")
+    @GetMapping("/queryProjectUsers")
+    public Result<Object> queryProjectUsers(@ApiParam("项目ID") @RequestParam(value = "projectId", required = true) Long projectId) {
+        return kuaishouProjectMemberService.queryProjectUsers(projectId);
+    }
+
+    /**
+     * 增加参与项目人员
+     */
+    @ApiOperation(value = "增加参与项目人员")
+    @PostMapping("/addProjectUsers")
+    public Result<Object> addProjectUsers(@RequestBody JSONObject o) {
+        return kuaishouProjectMemberService.addProjectUsers(o);
+    }
 }

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

@@ -0,0 +1,62 @@
+package com.ruixuan.jinniu.controller;
+
+
+import com.ruixuan.common.core.controller.BaseController;
+import com.ruixuan.common.core.domain.AjaxResult;
+import com.ruixuan.common.core.page.TableDataInfo;
+import com.ruixuan.jinniu.entity.KuaishouTransferAccount;
+import com.ruixuan.jinniu.service.IKuaishouTransferAccountService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 账户转让记录Controller
+ *
+ * @author ruoyi
+ * @date 2023-03-16
+ */
+@Api(tags = "-------------磁力金牛-------------账户转让记录Controller")
+@RestController
+@RequestMapping("/kuaishou/transfer")
+public class KuaishouTransferAccountController extends BaseController {
+    @Autowired
+    private IKuaishouTransferAccountService kuaishouTransferAccountService;
+
+    /**
+     * 查询账户转让记录列表
+     */
+    @ApiOperation(value = "查询账户转让记录列表")
+    @GetMapping("/list")
+    public TableDataInfo list(@ApiParam("userId") @RequestParam(value = "userId", required = true) Long userId) {
+        List<KuaishouTransferAccount> list = kuaishouTransferAccountService.selectKuaishouTransferAccountList(userId);
+        return getDataTable(list);
+    }
+
+    /**
+     * 新增账户转让记录
+     */
+    @ApiOperation(value = "新增账户转让记录")
+    @PostMapping("/addTransferAccount")
+    public AjaxResult addTransferAccount(@RequestBody KuaishouTransferAccount kuaishouTransferAccount) {
+        return toAjax(kuaishouTransferAccountService.insertKuaishouTransferAccount(kuaishouTransferAccount));
+    }
+
+    /**
+     * 更新账户转让状态
+     */
+    @ApiOperation(value = "更新账户转让状态")
+    @PostMapping("/editTransferAccountStatus")
+    public AjaxResult editTransferAccountStatus(@RequestBody KuaishouTransferAccount kuaishouTransferAccount) {
+        return toAjax(kuaishouTransferAccountService.updateKuaishouTransferAccount(kuaishouTransferAccount));
+    }
+}

+ 24 - 5
ruixuan-live/src/main/java/com/ruixuan/jinniu/entity/KuaishouAccount.java

@@ -3,15 +3,16 @@ package com.ruixuan.jinniu.entity;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruixuan.common.core.domain.BaseEntity;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.util.Date;
 
 /**
  * 账户对象 kuaishou_account
  *
- * @author ruoyi
  * @date 2023-03-15
  */
+@Data
 public class KuaishouAccount extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
@@ -66,13 +67,13 @@ public class KuaishouAccount extends BaseEntity {
      * 运营(优化)负责人Id
      */
     @ApiModelProperty(name = "运营(优化)负责人Id")
-    private String operatorId;
+    private Long operatorId;
 
     /**
      * 运营(优化)负责人
      */
     @ApiModelProperty(name = "运营(优化)负责人")
-    private String operatorLeader;
+    private String operatorName;
 
     /**
      * 产品名称
@@ -99,12 +100,30 @@ public class KuaishouAccount extends BaseEntity {
     private String corporationName;
 
     /**
-     * 账户状态
+     * 账户状态 0 无效,1有效
      */
-    @ApiModelProperty(name = "账户状态")
+    @ApiModelProperty(name = "账户状态 0 无效,1有效")
     private String accountStatus;
 
     /**
+     * 1-自运营,2代运营
+     */
+    @ApiModelProperty(name = "1-自运营,2代运营")
+    private String accountType;
+
+    /**
+     * 绑定日期
+     */
+    @ApiModelProperty(name = "绑定日期")
+    private String bindTime;
+
+    /**
+     * 账户创建时间
+     */
+    @ApiModelProperty(name = "账户创建时间")
+    private String accountCreateTime;
+
+    /**
      * 更新时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

+ 22 - 4
ruixuan-live/src/main/java/com/ruixuan/jinniu/entity/KuaishouProject.java

@@ -8,12 +8,13 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
- * 项目信息对象 rx_project
+ * 项目信息对象 kuaishou_project
  */
 @Data
-@ApiModel(value = "rx_project", description = "项目信息对象")
+@ApiModel(value = "kuaishou_project", description = "项目信息对象")
 public class KuaishouProject implements Serializable {
     private static final long serialVersionUID = -124355905527263391L;
     /**
@@ -55,13 +56,13 @@ public class KuaishouProject implements Serializable {
      * 运营负责人ID
      */
     @ApiModelProperty(name = "运营负责人ID")
-    private Long businessId;
+    private Long operatorId;
 
     /**
      * 运营负责人
      */
     @ApiModelProperty(name = "运营负责人")
-    private String businessName;
+    private String operatorName;
 
     /**
      * 设计负责人ID
@@ -103,4 +104,21 @@ public class KuaishouProject implements Serializable {
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
+    /**
+     * 登录人ID
+     */
+    @ApiModelProperty(name = "登录人ID")
+    private Long userId;
+    /**
+     * 运营ID集
+     */
+    private  List<Long> operatorIdList;
+    /**
+     * 设计ID集
+     */
+    private  List<Long> designIdList;
+    /**
+     * 销售ID集
+     */
+    private List<Long> saleIdList;
 }

+ 72 - 0
ruixuan-live/src/main/java/com/ruixuan/jinniu/entity/KuaishouProjectMember.java

@@ -0,0 +1,72 @@
+package com.ruixuan.jinniu.entity;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruixuan.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 项目人员信息对象 kuaishou_project_member
+ *
+ * @author ruoyi
+ * @date 2023-03-16
+ */
+@Data
+@ApiModel(value = "kuaishou_project_member", description = "项目人员信息对象")
+public class KuaishouProjectMember extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    /**
+     * 项目id
+     */
+    @ApiModelProperty(name = "项目id")
+    private Long projectId;
+
+    /**
+     * 项目名称
+     */
+    @ApiModelProperty(name = "项目名称")
+    private String projectName;
+
+    /**
+     * 成员id
+     */
+    @ApiModelProperty(name = "成员id")
+    private Long userId;
+
+    /**
+     * 用户名称
+     */
+    @ApiModelProperty(name = "用户名称")
+    private String userName;
+
+    /**
+     * 角色权限字符串
+     */
+    @ApiModelProperty(name = "角色权限字符串")
+    private String roleKey;
+
+    /**
+     * 角色名称
+     */
+    @ApiModelProperty(name = "角色名称")
+    private String roleName;
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+}

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

@@ -0,0 +1,99 @@
+package com.ruixuan.jinniu.entity;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruixuan.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 账户转让记录对象 kuaishou_transfer_account
+ *
+ * @author ruoyi
+ * @date 2023-03-16
+ */
+@Data
+@ApiModel(value = "kuaishou_transfer_account", description = "账户转让记录")
+public class KuaishouTransferAccount extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    private Long id;
+
+    /**
+     * 操作人
+     */
+    @ApiModelProperty(name = "操作人")
+    private Long userId;
+
+    /**
+     * 转户账号
+     */
+    @ApiModelProperty(name = "转户账号")
+    private Long accountId;
+
+    /**
+     * 项目id
+     */
+    @ApiModelProperty(name = "项目id")
+    private Long projectId;
+
+    /**
+     * 转让人
+     */
+    @ApiModelProperty(name = "转让人")
+    private Long transferor;
+
+    /**
+     * 受让人
+     */
+    @ApiModelProperty(name = "受让人")
+    private Long assignee;
+
+    /**
+     * 转户人绩效统计截止日期
+     */
+    @ApiModelProperty(name = "转户人绩效统计截止日期")
+    private String transferorDate;
+
+    /**
+     * 受让人绩效统计开始日期
+     */
+    @ApiModelProperty(name = "受让人绩效统计开始日期")
+    private String assigneeDate;
+
+    /**
+     * 审核人
+     */
+    @ApiModelProperty(name = "审核人")
+    private String auditor;
+
+    /**
+     * 审核状态 0:新建 1:通过 2:拒绝
+     */
+    @ApiModelProperty(name = "审核状态 0:新建 1:通过 2:拒绝")
+    private Integer status;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(name = "备注")
+    private String remarks;
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+}

+ 15 - 13
ruixuan-live/src/main/java/com/ruixuan/jinniu/mapper/KuaishouAccountMapper.java

@@ -1,7 +1,9 @@
 package com.ruixuan.jinniu.mapper;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.jinniu.entity.KuaishouAccount;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -12,6 +14,9 @@ import java.util.List;
  * @date 2023-03-15
  */
 public interface KuaishouAccountMapper {
+
+    List<JSONObject> selectUnboundAccountList(@Param("accountId") Long accountId, @Param("ksId") Long ksId, @Param("accountName") String accountName, @Param("status") Long status);
+
     /**
      * 查询账户
      *
@@ -21,20 +26,20 @@ public interface KuaishouAccountMapper {
     public KuaishouAccount selectKuaishouAccountById(Long id);
 
     /**
-     * 查询账户列表
+     * 新增账户
      *
      * @param kuaishouAccount 账户
-     * @return 账户集合
+     * @return 结果
      */
-    public List<KuaishouAccount> selectKuaishouAccountList(KuaishouAccount kuaishouAccount);
+    public int insertKuaishouAccount(KuaishouAccount kuaishouAccount);
 
     /**
-     * 新增账户
+     * 修改账户
      *
      * @param kuaishouAccount 账户
      * @return 结果
      */
-    public int insertKuaishouAccount(KuaishouAccount kuaishouAccount);
+    public int updateKuaishouAccount(KuaishouAccount kuaishouAccount);
 
     /**
      * 修改账户
@@ -42,7 +47,7 @@ public interface KuaishouAccountMapper {
      * @param kuaishouAccount 账户
      * @return 结果
      */
-    public int updateKuaishouAccount(KuaishouAccount kuaishouAccount);
+    public int updateKuaishouAccountByAccountId(KuaishouAccount kuaishouAccount);
 
     /**
      * 删除账户
@@ -52,11 +57,8 @@ public interface KuaishouAccountMapper {
      */
     public int deleteKuaishouAccountById(Long id);
 
-    /**
-     * 批量删除账户
-     *
-     * @param ids 需要删除的数据主键集合
-     * @return 结果
-     */
-    public int deleteKuaishouAccountByIds(Long[] ids);
+    List<KuaishouAccount> selectKuaishouAccountList(@Param("userList") List<Long> userList, @Param("accountId") Long accountId, @Param("accountName") String accountName);
+
+    List<KuaishouAccount> getAccountByProjectId(@Param("projectId") Long projectId);
+
 }

+ 2 - 0
ruixuan-live/src/main/java/com/ruixuan/jinniu/mapper/KuaishouProjectMapper.java

@@ -1,5 +1,6 @@
 package com.ruixuan.jinniu.mapper;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.jinniu.entity.KuaishouProject;
 
 import java.util.List;
@@ -51,4 +52,5 @@ public interface KuaishouProjectMapper {
      */
     public int deleteKuaishouProjectById(Long id);
 
+    List<JSONObject> getOcpxActionType();
 }

+ 59 - 0
ruixuan-live/src/main/java/com/ruixuan/jinniu/mapper/KuaishouProjectMemberMapper.java

@@ -0,0 +1,59 @@
+package com.ruixuan.jinniu.mapper;
+
+import com.ruixuan.common.utils.Result;
+import com.ruixuan.jinniu.entity.KuaishouProjectMember;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 项目人员信息Mapper接口
+ *
+ * @author ruoyi
+ * @date 2023-03-16
+ */
+public interface KuaishouProjectMemberMapper {
+    /**
+     * 查询项目人员信息
+     *
+     * @param id 项目人员信息主键
+     * @return 项目人员信息
+     */
+    public KuaishouProjectMember selectKuaishouProjectMemberById(Long id);
+
+    /**
+     * 查询项目人员信息列表
+     *
+     * @param kuaishouProjectMember 项目人员信息
+     * @return 项目人员信息集合
+     */
+    public List<KuaishouProjectMember> selectKuaishouProjectMemberList(KuaishouProjectMember kuaishouProjectMember);
+
+    /**
+     * 新增项目人员信息
+     *
+     * @param kuaishouProjectMember 项目人员信息
+     * @return 结果
+     */
+    public int insertKuaishouProjectMember(KuaishouProjectMember kuaishouProjectMember);
+
+    /**
+     * 修改项目人员信息
+     *
+     * @param kuaishouProjectMember 项目人员信息
+     * @return 结果
+     */
+    public int updateKuaishouProjectMember(KuaishouProjectMember kuaishouProjectMember);
+
+    /**
+     * 删除项目人员信息
+     *
+     * @param id 项目人员信息主键
+     * @return 结果
+     */
+    public int deleteKuaishouProjectMemberById(Long id);
+
+    List<KuaishouProjectMember> queryProjectUsers(Long projectId);
+
+    int replaceBatch(@Param("list") List<KuaishouProjectMember> list);
+}

+ 55 - 0
ruixuan-live/src/main/java/com/ruixuan/jinniu/mapper/KuaishouTransferAccountMapper.java

@@ -0,0 +1,55 @@
+package com.ruixuan.jinniu.mapper;
+
+
+import com.ruixuan.jinniu.entity.KuaishouTransferAccount;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 账户转让记录Mapper接口
+ *
+ * @author ruoyi
+ * @date 2023-03-16
+ */
+public interface KuaishouTransferAccountMapper {
+    /**
+     * 查询账户转让记录
+     *
+     * @param id 账户转让记录主键
+     * @return 账户转让记录
+     */
+    public KuaishouTransferAccount selectKuaishouTransferAccountById(Long id);
+
+    /**
+     * 查询账户转让记录列表
+     *
+     * @param kuaishouTransferAccount 账户转让记录
+     * @return 账户转让记录集合
+     */
+    public List<KuaishouTransferAccount> selectKuaishouTransferAccountList(@Param("userList") List<Long> userList);
+
+    /**
+     * 新增账户转让记录
+     *
+     * @param kuaishouTransferAccount 账户转让记录
+     * @return 结果
+     */
+    public int insertKuaishouTransferAccount(KuaishouTransferAccount kuaishouTransferAccount);
+
+    /**
+     * 修改账户转让记录
+     *
+     * @param kuaishouTransferAccount 账户转让记录
+     * @return 结果
+     */
+    public int updateKuaishouTransferAccount(KuaishouTransferAccount kuaishouTransferAccount);
+
+    /**
+     * 删除账户转让记录
+     *
+     * @param id 账户转让记录主键
+     * @return 结果
+     */
+    public int deleteKuaishouTransferAccountById(Long id);
+}

+ 8 - 10
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/IKuaishouAccountService.java

@@ -1,6 +1,7 @@
 package com.ruixuan.jinniu.service;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.jinniu.entity.KuaishouAccount;
 
 import java.util.List;
@@ -12,6 +13,9 @@ import java.util.List;
  * @date 2023-03-15
  */
 public interface IKuaishouAccountService {
+
+    List<JSONObject> selectUnboundAccountList(Long accountId, Long ksId, String accountName, Long status);
+
     /**
      * 查询账户
      *
@@ -26,15 +30,16 @@ public interface IKuaishouAccountService {
      * @param kuaishouAccount 账户
      * @return 账户集合
      */
-    public List<KuaishouAccount> selectKuaishouAccountList(KuaishouAccount kuaishouAccount);
+    public List<KuaishouAccount> selectKuaishouAccountList(Long userId, Long accountId, String accountName);
 
+    List<KuaishouAccount> getAccountByProjectId(Long projectId);
     /**
      * 新增账户
      *
      * @param kuaishouAccount 账户
      * @return 结果
      */
-    public int insertKuaishouAccount(KuaishouAccount kuaishouAccount);
+    public int insertKuaishouAccount(JSONObject o);
 
     /**
      * 修改账户
@@ -45,18 +50,11 @@ public interface IKuaishouAccountService {
     public int updateKuaishouAccount(KuaishouAccount kuaishouAccount);
 
     /**
-     * 批量删除账户
-     *
-     * @param ids 需要删除的账户主键集合
-     * @return 结果
-     */
-    public int deleteKuaishouAccountByIds(Long[] ids);
-
-    /**
      * 删除账户信息
      *
      * @param id 账户主键
      * @return 结果
      */
     public int deleteKuaishouAccountById(Long id);
+
 }

+ 59 - 0
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/IKuaishouProjectMemberService.java

@@ -0,0 +1,59 @@
+package com.ruixuan.jinniu.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.utils.Result;
+import com.ruixuan.jinniu.entity.KuaishouProjectMember;
+
+import java.util.List;
+
+/**
+ * 项目人员信息Service接口
+ *
+ * @author ruoyi
+ * @date 2023-03-16
+ */
+public interface IKuaishouProjectMemberService {
+    /**
+     * 查询项目人员信息
+     *
+     * @param id 项目人员信息主键
+     * @return 项目人员信息
+     */
+    public KuaishouProjectMember selectKuaishouProjectMemberById(Long id);
+
+    /**
+     * 查询项目人员信息列表
+     *
+     * @param kuaishouProjectMember 项目人员信息
+     * @return 项目人员信息集合
+     */
+    public List<KuaishouProjectMember> selectKuaishouProjectMemberList(KuaishouProjectMember kuaishouProjectMember);
+
+    /**
+     * 新增项目人员信息
+     *
+     * @param kuaishouProjectMember 项目人员信息
+     * @return 结果
+     */
+    public int insertKuaishouProjectMember(KuaishouProjectMember kuaishouProjectMember);
+
+    /**
+     * 修改项目人员信息
+     *
+     * @param kuaishouProjectMember 项目人员信息
+     * @return 结果
+     */
+    public int updateKuaishouProjectMember(KuaishouProjectMember kuaishouProjectMember);
+
+    /**
+     * 删除项目人员信息信息
+     *
+     * @param id 项目人员信息主键
+     * @return 结果
+     */
+    public int deleteKuaishouProjectMemberById(Long id);
+
+    Result<Object> queryProjectUsers(Long projectId);
+
+    Result<Object> addProjectUsers(JSONObject o);
+}

+ 4 - 0
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/IKuaishouProjectService.java

@@ -1,5 +1,7 @@
 package com.ruixuan.jinniu.service;
 
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.utils.Result;
 import com.ruixuan.jinniu.entity.KuaishouProject;
 
 import java.util.List;
@@ -50,4 +52,6 @@ public interface IKuaishouProjectService {
      * @return 结果
      */
     public int deleteKuaishouProjectById(Long id);
+
+    Result<Object> getOcpxActionType();
 }

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

@@ -0,0 +1,54 @@
+package com.ruixuan.jinniu.service;
+
+
+import com.ruixuan.jinniu.entity.KuaishouTransferAccount;
+
+import java.util.List;
+
+/**
+ * 账户转让记录Service接口
+ *
+ * @author ruoyi
+ * @date 2023-03-16
+ */
+public interface IKuaishouTransferAccountService {
+    /**
+     * 查询账户转让记录
+     *
+     * @param id 账户转让记录主键
+     * @return 账户转让记录
+     */
+    public KuaishouTransferAccount selectKuaishouTransferAccountById(Long id);
+
+    /**
+     * 查询账户转让记录列表
+     *
+     * @param kuaishouTransferAccount 账户转让记录
+     * @return 账户转让记录集合
+     */
+    public List<KuaishouTransferAccount> selectKuaishouTransferAccountList(Long userId);
+
+    /**
+     * 新增账户转让记录
+     *
+     * @param kuaishouTransferAccount 账户转让记录
+     * @return 结果
+     */
+    public int insertKuaishouTransferAccount(KuaishouTransferAccount kuaishouTransferAccount);
+
+    /**
+     * 修改账户转让记录
+     *
+     * @param kuaishouTransferAccount 账户转让记录
+     * @return 结果
+     */
+    public int updateKuaishouTransferAccount(KuaishouTransferAccount kuaishouTransferAccount);
+
+    /**
+     * 删除账户转让记录信息
+     *
+     * @param id 账户转让记录主键
+     * @return 结果
+     */
+    public int deleteKuaishouTransferAccountById(Long id);
+}

+ 82 - 15
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouAccountServiceImpl.java

@@ -1,11 +1,24 @@
 package com.ruixuan.jinniu.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.entity.SysUser;
+import com.ruixuan.common.utils.DateUtils;
+import com.ruixuan.common.utils.PageUtils;
 import com.ruixuan.jinniu.entity.KuaishouAccount;
+import com.ruixuan.jinniu.entity.KuaishouAgentAccountList;
+import com.ruixuan.jinniu.entity.KuaishouProject;
 import com.ruixuan.jinniu.mapper.KuaishouAccountMapper;
+import com.ruixuan.jinniu.mapper.KuaishouAgentAccountListMapper;
+import com.ruixuan.jinniu.mapper.KuaishouProjectMapper;
 import com.ruixuan.jinniu.service.IKuaishouAccountService;
+import com.ruixuan.jinniu.service.IKuaishouProjectMemberService;
+import com.ruixuan.system.service.ISysDeptService;
+import com.ruixuan.system.service.ISysUserService;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -19,6 +32,26 @@ public class KuaishouAccountServiceImpl implements IKuaishouAccountService {
     @Autowired
     private KuaishouAccountMapper kuaishouAccountMapper;
 
+    @Autowired
+    private KuaishouAgentAccountListMapper agentAccountListMapper;
+
+    @Autowired
+    private ISysUserService sysUserService;
+
+    @Autowired
+    private KuaishouProjectMapper projectMapper;
+
+    @Autowired
+    private ISysDeptService deptService;
+
+    @Autowired
+    private IKuaishouProjectMemberService kuaishouProjectMemberService;
+
+    @Override
+    public List<JSONObject> selectUnboundAccountList(Long accountId, Long ksId, String accountName, Long status) {
+        return kuaishouAccountMapper.selectUnboundAccountList(accountId, ksId, accountName, status);
+    }
+
     /**
      * 查询账户
      *
@@ -37,8 +70,26 @@ public class KuaishouAccountServiceImpl implements IKuaishouAccountService {
      * @return 账户
      */
     @Override
-    public List<KuaishouAccount> selectKuaishouAccountList(KuaishouAccount kuaishouAccount) {
-        return kuaishouAccountMapper.selectKuaishouAccountList(kuaishouAccount);
+    public List<KuaishouAccount> selectKuaishouAccountList(Long userId, Long accountId, String accountName) {
+        String roleKey = sysUserService.getRoleKeyByUserId(userId);
+        List<Long> userList;
+        if ("admin".equals(roleKey)) {
+            //查看所有
+            userList = null;
+        } else if ("operationsManager".equals(roleKey) || "directorOperations".equals(roleKey)) {
+            //运营总监 和 运营经理 可以看自己部门所有人的(自己和下属的)
+            Long deptId = deptService.getDeptIdByUserId(userId);
+            userList = deptService.getDeptUserListByDeptId(deptId);
+        } else {
+            userList = Arrays.asList(userId);
+        }
+        PageUtils.startPage();
+        return kuaishouAccountMapper.selectKuaishouAccountList(userList, accountId, accountName);
+    }
+
+    @Override
+    public List<KuaishouAccount> getAccountByProjectId(Long projectId) {
+        return kuaishouAccountMapper.getAccountByProjectId(projectId);
     }
 
     /**
@@ -48,8 +99,35 @@ public class KuaishouAccountServiceImpl implements IKuaishouAccountService {
      * @return 结果
      */
     @Override
-    public int insertKuaishouAccount(KuaishouAccount kuaishouAccount) {
-        return kuaishouAccountMapper.insertKuaishouAccount(kuaishouAccount);
+    public int insertKuaishouAccount(JSONObject o) {
+        Long accountId = o.getLong("accountId");
+        Long userId = o.getLong("userId");
+        Long projectId = o.getLong("projectId");
+        KuaishouAgentAccountList agentAccount = agentAccountListMapper.selectKuaishouAgentAccountListByAccountId(accountId);
+        KuaishouAccount kuaishouAccount = new KuaishouAccount();
+        BeanUtils.copyProperties(agentAccount, kuaishouAccount);
+        SysUser sysUser = sysUserService.selectUserById(userId);
+        KuaishouProject project = projectMapper.selectKuaishouProjectById(projectId);
+        kuaishouAccount.setOperatorId(userId);
+        kuaishouAccount.setOperatorName(sysUser.getNickName());
+        kuaishouAccount.setKsId(agentAccount.getUserId());
+        kuaishouAccount.setKsName(agentAccount.getUserName());
+        kuaishouAccount.setAccountType(o.getString("accountType"));
+        kuaishouAccount.setMediaCode(o.getString("mediaCode"));
+        kuaishouAccount.setProjectId(projectId);
+        kuaishouAccount.setProjectName(project.getProjectName());
+        kuaishouAccount.setAccountCreateTime(DateUtils.formatDate(agentAccount.getAccountCreateTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
+        kuaishouAccount.setBindTime(DateUtils.getDate());
+        int i = kuaishouAccountMapper.insertKuaishouAccount(kuaishouAccount);
+        if (i > 0) {
+            //添加 参与项目人员
+            JSONObject mem = new JSONObject();
+            mem.put("projectId", projectId);
+            mem.put("projectName", project.getProjectName());
+            mem.put("userIds", Arrays.asList(userId));
+            kuaishouProjectMemberService.addProjectUsers(mem);
+        }
+        return i;
     }
 
     /**
@@ -64,17 +142,6 @@ public class KuaishouAccountServiceImpl implements IKuaishouAccountService {
     }
 
     /**
-     * 批量删除账户
-     *
-     * @param ids 需要删除的账户主键
-     * @return 结果
-     */
-    @Override
-    public int deleteKuaishouAccountByIds(Long[] ids) {
-        return kuaishouAccountMapper.deleteKuaishouAccountByIds(ids);
-    }
-
-    /**
      * 删除账户信息
      *
      * @param id 账户主键

+ 121 - 0
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouProjectMemberServiceImpl.java

@@ -0,0 +1,121 @@
+package com.ruixuan.jinniu.service.impl;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.entity.SysUser;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.common.utils.Result;
+import com.ruixuan.jinniu.entity.KuaishouProject;
+import com.ruixuan.jinniu.entity.KuaishouProjectMember;
+import com.ruixuan.jinniu.mapper.KuaishouProjectMemberMapper;
+import com.ruixuan.jinniu.service.IKuaishouProjectMemberService;
+import com.ruixuan.jinniu.service.IKuaishouProjectService;
+import com.ruixuan.system.service.ISysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 项目人员信息Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-03-16
+ */
+@Service
+public class KuaishouProjectMemberServiceImpl implements IKuaishouProjectMemberService {
+    @Autowired
+    private KuaishouProjectMemberMapper kuaishouProjectMemberMapper;
+    @Autowired
+    private IKuaishouProjectService KuaishouProjectService;
+    @Autowired
+    private ISysUserService sysUserService;
+
+    /**
+     * 查询项目人员信息
+     *
+     * @param id 项目人员信息主键
+     * @return 项目人员信息
+     */
+    @Override
+    public KuaishouProjectMember selectKuaishouProjectMemberById(Long id) {
+        return kuaishouProjectMemberMapper.selectKuaishouProjectMemberById(id);
+    }
+
+    /**
+     * 查询项目人员信息列表
+     *
+     * @param kuaishouProjectMember 项目人员信息
+     * @return 项目人员信息
+     */
+    @Override
+    public List<KuaishouProjectMember> selectKuaishouProjectMemberList(KuaishouProjectMember kuaishouProjectMember) {
+        return kuaishouProjectMemberMapper.selectKuaishouProjectMemberList(kuaishouProjectMember);
+    }
+
+    /**
+     * 新增项目人员信息
+     *
+     * @param kuaishouProjectMember 项目人员信息
+     * @return 结果
+     */
+    @Override
+    public int insertKuaishouProjectMember(KuaishouProjectMember kuaishouProjectMember) {
+        return kuaishouProjectMemberMapper.insertKuaishouProjectMember(kuaishouProjectMember);
+    }
+
+    /**
+     * 修改项目人员信息
+     *
+     * @param kuaishouProjectMember 项目人员信息
+     * @return 结果
+     */
+    @Override
+    public int updateKuaishouProjectMember(KuaishouProjectMember kuaishouProjectMember) {
+        return kuaishouProjectMemberMapper.updateKuaishouProjectMember(kuaishouProjectMember);
+    }
+
+    /**
+     * 删除项目人员信息信息
+     *
+     * @param id 项目人员信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouProjectMemberById(Long id) {
+        return kuaishouProjectMemberMapper.deleteKuaishouProjectMemberById(id);
+    }
+
+    @Override
+    public Result<Object> queryProjectUsers(Long projectId) {
+        List<KuaishouProjectMember> list = kuaishouProjectMemberMapper.queryProjectUsers(projectId);
+        return Result.success(list);
+    }
+
+    @Override
+    public Result<Object> addProjectUsers(JSONObject o) {
+        Long projectId = o.getLong("projectId");
+        JSONArray userIds = o.getJSONArray("userIds");
+        String projectName = o.getString("projectName");
+        if (Check.isNull(projectName)) {
+            KuaishouProject project = KuaishouProjectService.selectKuaishouProjectById(projectId);
+            projectName = project.getProjectName();
+        }
+        List<KuaishouProjectMember> list = new ArrayList<>();
+        for (Object userId : userIds) {
+            KuaishouProjectMember projectMember = new KuaishouProjectMember();
+            projectMember.setProjectId(projectId);
+            projectMember.setProjectName(projectName);
+            SysUser sysUser = sysUserService.selectUserById(Long.valueOf(userId.toString()));
+            projectMember.setUserId(sysUser.getUserId());
+            projectMember.setUserName(sysUser.getNickName());
+            projectMember.setRoleKey(sysUser.getRoles().get(0).getRoleKey());
+            projectMember.setRoleName(sysUser.getRoles().get(0).getRoleName());
+            list.add(projectMember);
+        }
+        kuaishouProjectMemberMapper.replaceBatch(list);
+        return Result.success();
+    }
+}

+ 53 - 3
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouProjectServiceImpl.java

@@ -1,12 +1,19 @@
 package com.ruixuan.jinniu.service.impl;
 
 
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.utils.PageUtils;
+import com.ruixuan.common.utils.Result;
 import com.ruixuan.jinniu.entity.KuaishouProject;
 import com.ruixuan.jinniu.mapper.KuaishouProjectMapper;
 import com.ruixuan.jinniu.service.IKuaishouProjectService;
+import com.ruixuan.system.service.ISysDeptService;
+import com.ruixuan.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -19,6 +26,10 @@ import java.util.List;
 public class KuaishouProjectServiceImpl implements IKuaishouProjectService {
     @Autowired
     private KuaishouProjectMapper KuaishouProjectMapper;
+    @Autowired
+    private ISysUserService sysUserService;
+    @Autowired
+    private ISysDeptService deptService;
 
     /**
      * 查询项目信息
@@ -33,12 +44,45 @@ public class KuaishouProjectServiceImpl implements IKuaishouProjectService {
 
     /**
      * 查询项目信息列表
-     *
-     * @param kuaishouProject 项目信息
-     * @return 项目信息
+     * 权限:admin 查所有
      */
     @Override
     public List<KuaishouProject> selectKuaishouProjectList(KuaishouProject kuaishouProject) {
+        Long userId = kuaishouProject.getUserId();
+        String roleKey = sysUserService.getRoleKeyByUserId(userId);
+        List<Long> userList;
+        if ("admin".equals(roleKey)) {
+            //查看所有
+            userList = null;
+        } else if ("electricPin".equals(roleKey) || "facePin".equals(roleKey)) {
+            //电销 面销
+            kuaishouProject.setSaleIdList(Arrays.asList(userId));
+        } else if ("eBayAmazon".equals(roleKey) || "salesDirector".equals(roleKey)) {
+            //销售组长、销售总监
+            Long deptId = deptService.getDeptIdByUserId(userId);
+            userList = deptService.getDeptUserListByDeptId(deptId);
+            kuaishouProject.setSaleIdList(userList);
+        } else if ("operations".equals(roleKey) || "operator".equals(roleKey)) {
+            //运营 运营专员
+            kuaishouProject.setOperatorIdList(Arrays.asList(userId));
+        } else if ("operationsManager".equals(roleKey) || "directorOperations".equals(roleKey)) {
+            //运营经理、运营总监
+            Long deptId = deptService.getDeptIdByUserId(userId);
+            userList = deptService.getDeptUserListByDeptId(deptId);
+            kuaishouProject.setOperatorIdList(userList);
+        } else if ("design".equals(roleKey)) {
+            //设计
+            kuaishouProject.setDesignIdList(Arrays.asList(userId));
+        } else if ("designLeader".equals(roleKey)) {
+            //设计负责人
+            Long deptId = deptService.getDeptIdByUserId(userId);
+            userList = deptService.getDeptUserListByDeptId(deptId);
+            kuaishouProject.setDesignIdList(userList);
+        } else {
+            //非销售、运营、设计角色,无权查看账户
+            return Collections.emptyList();
+        }
+        PageUtils.startPage();
         return KuaishouProjectMapper.selectKuaishouProjectList(kuaishouProject);
     }
 
@@ -74,4 +118,10 @@ public class KuaishouProjectServiceImpl implements IKuaishouProjectService {
     public int deleteKuaishouProjectById(Long id) {
         return KuaishouProjectMapper.deleteKuaishouProjectById(id);
     }
+
+    @Override
+    public Result<Object> getOcpxActionType() {
+        List<JSONObject> list = KuaishouProjectMapper.getOcpxActionType();
+        return Result.success(list);
+    }
 }

+ 114 - 0
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouTransferAccountServiceImpl.java

@@ -0,0 +1,114 @@
+package com.ruixuan.jinniu.service.impl;
+
+
+import com.ruixuan.common.core.domain.entity.SysUser;
+import com.ruixuan.common.utils.DateUtils;
+import com.ruixuan.common.utils.PageUtils;
+import com.ruixuan.jinniu.entity.KuaishouAccount;
+import com.ruixuan.jinniu.entity.KuaishouTransferAccount;
+import com.ruixuan.jinniu.mapper.KuaishouAccountMapper;
+import com.ruixuan.jinniu.mapper.KuaishouTransferAccountMapper;
+import com.ruixuan.jinniu.service.IKuaishouTransferAccountService;
+import com.ruixuan.system.service.ISysDeptService;
+import com.ruixuan.system.service.ISysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * 账户转让记录Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-03-16
+ */
+@Service
+public class KuaishouTransferAccountServiceImpl implements IKuaishouTransferAccountService {
+    @Autowired
+    private KuaishouTransferAccountMapper kuaishouTransferAccountMapper;
+    @Autowired
+    private KuaishouAccountMapper kuaishouAccountMapper;
+    @Autowired
+    private ISysUserService sysUserService;
+    @Autowired
+    private ISysDeptService deptService;
+
+    /**
+     * 查询账户转让记录
+     *
+     * @param id 账户转让记录主键
+     * @return 账户转让记录
+     */
+    @Override
+    public KuaishouTransferAccount selectKuaishouTransferAccountById(Long id) {
+        return kuaishouTransferAccountMapper.selectKuaishouTransferAccountById(id);
+    }
+
+    /**
+     * 查询账户转让记录列表
+     *
+     * @param kuaishouTransferAccount 账户转让记录
+     * @return 账户转让记录
+     */
+    @Override
+    public List<KuaishouTransferAccount> selectKuaishouTransferAccountList(Long userId) {
+        String roleKey = sysUserService.getRoleKeyByUserId(userId);
+        List<Long> userList;
+        if ("operationsManager".equals(roleKey)) {
+            //运营经理 可以看自己部门所有人
+            Long deptId = deptService.getDeptIdByUserId(userId);
+            userList = deptService.getDeptUserListByDeptId(deptId);
+        } else if ("admin".equals(roleKey) || "directorOperations".equals(roleKey)) {
+            userList = null;
+        } else {
+            return Collections.emptyList();
+        }
+        PageUtils.startPage();
+        return kuaishouTransferAccountMapper.selectKuaishouTransferAccountList(userList);
+    }
+
+    /**
+     * 新增账户转让记录
+     *
+     * @param kuaishouTransferAccount 账户转让记录
+     * @return 结果
+     */
+    @Override
+    public int insertKuaishouTransferAccount(KuaishouTransferAccount kuaishouTransferAccount) {
+        return kuaishouTransferAccountMapper.insertKuaishouTransferAccount(kuaishouTransferAccount);
+    }
+
+    /**
+     * 修改账户转让记录
+     */
+    @Override
+    public int updateKuaishouTransferAccount(KuaishouTransferAccount kuaishouTransferAccount) {
+        KuaishouTransferAccount transferAccount = kuaishouTransferAccountMapper.selectKuaishouTransferAccountById(kuaishouTransferAccount.getId());
+        transferAccount.setStatus(kuaishouTransferAccount.getStatus());
+        transferAccount.setAuditor(kuaishouTransferAccount.getAuditor());
+        transferAccount.setRemarks(DateUtils.getDate());
+        int i = kuaishouTransferAccountMapper.updateKuaishouTransferAccount(transferAccount);
+        if (i > 0 && kuaishouTransferAccount.getStatus() == 1) {
+            // 通过转让审核,账户运营人变为受让人
+            SysUser sysUser = sysUserService.selectUserById(transferAccount.getAssignee());
+            KuaishouAccount kuaishouAccount = new KuaishouAccount();
+            kuaishouAccount.setAccountId(transferAccount.getAccountId());
+            kuaishouAccount.setOperatorId(sysUser.getUserId());
+            kuaishouAccount.setOperatorName(sysUser.getNickName());
+            kuaishouAccountMapper.updateKuaishouAccountByAccountId(kuaishouAccount);
+        }
+        return i;
+    }
+
+    /**
+     * 删除账户转让记录信息
+     *
+     * @param id 账户转让记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouTransferAccountById(Long id) {
+        return kuaishouTransferAccountMapper.deleteKuaishouTransferAccountById(id);
+    }
+}

+ 236 - 81
ruixuan-live/src/main/resources/mapper/jinniu/KuaishouAccountMapper.xml

@@ -2,137 +2,292 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ruixuan.jinniu.mapper.KuaishouProjectMapper">
+<mapper namespace="com.ruixuan.jinniu.mapper.KuaishouAccountMapper">
 
-    <resultMap type="com.ruixuan.jinniu.entity.KuaishouProject" id="KuaishouProjectResult">
+    <resultMap type="com.ruixuan.jinniu.entity.KuaishouAccount" id="KuaishouAccountResult">
         <result property="id" column="id"/>
+        <result property="accountId" column="account_id"/>
+        <result property="accountName" column="account_name"/>
+        <result property="projectId" column="project_id"/>
         <result property="projectName" column="project_name"/>
         <result property="mediaCode" column="media_code"/>
-        <result property="supplierCode" column="supplier_code"/>
-        <result property="saleId" column="sale_id"/>
-        <result property="saleName" column="sale_name"/>
-        <result property="businessId" column="business_id"/>
-        <result property="businessName" column="business_name"/>
-        <result property="designResponsibleId" column="design_responsible_id"/>
-        <result property="designResponsibleName" column="design_responsible_name"/>
-        <result property="ocpxActionType" column="ocpx_action_type"/>
-        <result property="advertiserName" column="advertiser_name"/>
-        <result property="advertiserId" column="advertiser_id"/>
+        <result property="ksId" column="ks_id"/>
+        <result property="ksName" column="ks_name"/>
+        <result property="operatorId" column="operator_id"/>
+        <result property="operatorName" column="operator_name"/>
+        <result property="productName" column="product_name"/>
+        <result property="industry" column="industry"/>
+        <result property="secondIndustry" column="second_industry"/>
+        <result property="corporationName" column="corporation_name"/>
+        <result property="accountStatus" column="account_status"/>
+        <result property="accountType" column="account_type"/>
+        <result property="bindTime" column="bind_time"/>
+        <result property="accountCreateTime" column="account_create_time"/>
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
-    <sql id="selectKuaishouProjectVo">
+    <sql id="selectKuaishouAccountVo">
         select id,
+               account_id,
+               account_name,
+               project_id,
                project_name,
                media_code,
-               supplier_code,
-               sale_id,
-               sale_name,
-               business_id,
-               business_name,
-               design_responsible_id,
-               design_responsible_name,
-               ocpx_action_type,
-               advertiser_name,
-               advertiser_id,
+               ks_id,
+               ks_name,
+               operator_id,
+               operator_name,
+               product_name,
+               industry,
+               second_industry,
+               corporation_name,
+               account_status,
+               account_type,
+               bind_time,
+               account_create_time,
                create_time,
                update_time
-        from Kuaishou_project
+        from kuaishou_account
     </sql>
 
-    <select id="selectKuaishouProjectList" parameterType="com.ruixuan.jinniu.entity.KuaishouProject" resultMap="KuaishouProjectResult">
-        <include refid="selectKuaishouProjectVo"/>
+    <select id="selectKuaishouAccountList" parameterType="com.ruixuan.jinniu.entity.KuaishouAccount"
+            resultMap="KuaishouAccountResult">
+        <include refid="selectKuaishouAccountVo"/>
         <where>
-            <if test="projectName != null  and projectName != ''">and project_name like concat('%', #{projectName},
-                '%')
+            <if test="accountId != null ">
+                and account_id = #{accountId}
             </if>
-            <if test="mediaCode != null  and mediaCode != ''">and media_code = #{mediaCode}</if>
-            <if test="supplierCode != null  and supplierCode != ''">and supplier_code = #{supplierCode}</if>
-            <if test="saleId != null ">and sale_id = #{saleId}</if>
-            <if test="saleName != null  and saleName != ''">and sale_name like concat('%', #{saleName}, '%')</if>
-            <if test="businessId != null ">and business_id = #{businessId}</if>
-            <if test="businessName != null  and businessName != ''">and business_name like concat('%', #{businessName},
-                '%')
+            <if test="accountName != null  and accountName != ''">
+                and account_name like concat('%', #{accountName}, '%')
             </if>
-            <if test="designResponsibleId != null ">and design_responsible_id = #{designResponsibleId}</if>
-            <if test="designResponsibleName != null  and designResponsibleName != ''">and design_responsible_name like
-                concat('%', #{designResponsibleName}, '%')
+            <if test="userList != null and userList.size() >0 ">
+                and operator_id in
+                <foreach collection="userList" item="userId" open="(" separator="," close=")">
+                    #{userId}
+                </foreach>
             </if>
-            <if test="ocpxActionType != null  and ocpxActionType != ''">and ocpx_action_type = #{ocpxActionType}</if>
-            <if test="advertiserName != null  and advertiserName != ''">and advertiser_name like concat('%',
-                #{advertiserName}, '%')
-            </if>
-            <if test="advertiserId != null  and advertiserId != ''">and advertiser_id = #{advertiserId}</if>
         </where>
+        order by create_time desc
+    </select>
+
+
+    <select id="getAccountByProjectId" parameterType="com.ruixuan.jinniu.entity.KuaishouAccount"
+            resultMap="KuaishouAccountResult">
+        <include refid="selectKuaishouAccountVo"/>
+        where project_id = #{projectId}
+        order by create_time desc
     </select>
 
-    <select id="selectKuaishouProjectById" parameterType="Long" resultMap="KuaishouProjectResult">
-        <include refid="selectKuaishouProjectVo"/>
+    <select id="selectKuaishouAccountById" parameterType="Long" resultMap="KuaishouAccountResult">
+        <include refid="selectKuaishouAccountVo"/>
         where id = #{id}
     </select>
 
-    <insert id="insertKuaishouProject" parameterType="com.ruixuan.jinniu.entity.KuaishouProject" useGeneratedKeys="true" keyProperty="id">
-        insert into Kuaishou_project
+    <insert id="insertKuaishouAccount" parameterType="com.ruixuan.jinniu.entity.KuaishouAccount" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into kuaishou_account
         <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="accountId != null">account_id,</if>
+            <if test="accountName != null">account_name,</if>
+            <if test="projectId != null">project_id,</if>
             <if test="projectName != null">project_name,</if>
             <if test="mediaCode != null">media_code,</if>
-            <if test="supplierCode != null">supplier_code,</if>
-            <if test="saleId != null">sale_id,</if>
-            <if test="saleName != null">sale_name,</if>
-            <if test="businessId != null">business_id,</if>
-            <if test="businessName != null">business_name,</if>
-            <if test="designResponsibleId != null">design_responsible_id,</if>
-            <if test="designResponsibleName != null">design_responsible_name,</if>
-            <if test="ocpxActionType != null">ocpx_action_type,</if>
-            <if test="advertiserName != null">advertiser_name,</if>
-            <if test="advertiserId != null">advertiser_id,</if>
+            <if test="ksId != null">ks_id,</if>
+            <if test="ksName != null">ks_name,</if>
+            <if test="operatorId != null">operator_id,</if>
+            <if test="operatorName != null">operator_name,</if>
+            <if test="productName != null">product_name,</if>
+            <if test="industry != null">industry,</if>
+            <if test="secondIndustry != null">second_industry,</if>
+            <if test="corporationName != null">corporation_name,</if>
+            <if test="accountStatus != null">account_status,</if>
+            <if test="accountType != null">account_type,</if>
+            <if test="bindTime != null">bind_time,</if>
+            <if test="accountCreateTime != null">account_create_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="accountId != null">#{accountId},</if>
+            <if test="accountName != null">#{accountName},</if>
+            <if test="projectId != null">#{projectId},</if>
             <if test="projectName != null">#{projectName},</if>
             <if test="mediaCode != null">#{mediaCode},</if>
-            <if test="supplierCode != null">#{supplierCode},</if>
-            <if test="saleId != null">#{saleId},</if>
-            <if test="saleName != null">#{saleName},</if>
-            <if test="businessId != null">#{businessId},</if>
-            <if test="businessName != null">#{businessName},</if>
-            <if test="designResponsibleId != null">#{designResponsibleId},</if>
-            <if test="designResponsibleName != null">#{designResponsibleName},</if>
-            <if test="ocpxActionType != null">#{ocpxActionType},</if>
-            <if test="advertiserName != null">#{advertiserName},</if>
-            <if test="advertiserId != null">#{advertiserId},</if>
+            <if test="ksId != null">#{ksId},</if>
+            <if test="ksName != null">#{ksName},</if>
+            <if test="operatorId != null">#{operatorId},</if>
+            <if test="operatorName != null">#{operatorName},</if>
+            <if test="productName != null">#{productName},</if>
+            <if test="industry != null">#{industry},</if>
+            <if test="secondIndustry != null">#{secondIndustry},</if>
+            <if test="corporationName != null">#{corporationName},</if>
+            <if test="accountStatus != null">#{accountStatus},</if>
+            <if test="accountType != null">#{accountType},</if>
+            <if test="bindTime != null">#{bindTime},</if>
+            <if test="accountCreateTime != null">#{accountCreateTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
         </trim>
     </insert>
 
-    <update id="updateKuaishouProject" parameterType="com.ruixuan.jinniu.entity.KuaishouProject">
-        update Kuaishou_project
+    <update id="updateKuaishouAccount" parameterType="com.ruixuan.jinniu.entity.KuaishouAccount">
+        update kuaishou_account
         <trim prefix="SET" suffixOverrides=",">
+            <if test="accountId != null">account_id = #{accountId},</if>
+            <if test="accountName != null">account_name = #{accountName},</if>
+            <if test="projectId != null">project_id = #{projectId},</if>
             <if test="projectName != null">project_name = #{projectName},</if>
             <if test="mediaCode != null">media_code = #{mediaCode},</if>
-            <if test="supplierCode != null">supplier_code = #{supplierCode},</if>
-            <if test="saleId != null">sale_id = #{saleId},</if>
-            <if test="saleName != null">sale_name = #{saleName},</if>
-            <if test="businessId != null">business_id = #{businessId},</if>
-            <if test="businessName != null">business_name = #{businessName},</if>
-            <if test="designResponsibleId != null">design_responsible_id = #{designResponsibleId},</if>
-            <if test="designResponsibleName != null">design_responsible_name = #{designResponsibleName},</if>
-            <if test="ocpxActionType != null">ocpx_action_type = #{ocpxActionType},</if>
-            <if test="advertiserName != null">advertiser_name = #{advertiserName},</if>
-            <if test="advertiserId != null">advertiser_id = #{advertiserId},</if>
+            <if test="ksId != null">ks_id = #{ksId},</if>
+            <if test="ksName != null">ks_name = #{ksName},</if>
+            <if test="operatorId != null">operator_id = #{operatorId},</if>
+            <if test="operatorName != null">operator_name = #{operatorName},</if>
+            <if test="productName != null">product_name = #{productName},</if>
+            <if test="industry != null">industry = #{industry},</if>
+            <if test="secondIndustry != null">second_industry = #{secondIndustry},</if>
+            <if test="corporationName != null">corporation_name = #{corporationName},</if>
+            <if test="accountStatus != null">account_status = #{accountStatus},</if>
+            <if test="accountType != null">account_type = #{accountType},</if>
+            <if test="bindTime != null">bind_time = #{bindTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>
 
-    <delete id="deleteKuaishouProjectById" parameterType="Long">
+    <update id="updateKuaishouAccountByAccountId" parameterType="com.ruixuan.jinniu.entity.KuaishouAccount">
+        update kuaishou_account
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="accountId != null">account_id = #{accountId},</if>
+            <if test="accountName != null">account_name = #{accountName},</if>
+            <if test="projectId != null">project_id = #{projectId},</if>
+            <if test="projectName != null">project_name = #{projectName},</if>
+            <if test="mediaCode != null">media_code = #{mediaCode},</if>
+            <if test="ksId != null">ks_id = #{ksId},</if>
+            <if test="ksName != null">ks_name = #{ksName},</if>
+            <if test="operatorId != null">operator_id = #{operatorId},</if>
+            <if test="operatorName != null">operator_name = #{operatorName},</if>
+            <if test="productName != null">product_name = #{productName},</if>
+            <if test="industry != null">industry = #{industry},</if>
+            <if test="secondIndustry != null">second_industry = #{secondIndustry},</if>
+            <if test="corporationName != null">corporation_name = #{corporationName},</if>
+            <if test="accountStatus != null">account_status = #{accountStatus},</if>
+            <if test="accountType != null">account_type = #{accountType},</if>
+            <if test="bindTime != null">bind_time = #{bindTime},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteKuaishouAccountById" parameterType="Long">
         delete
-        from Kuaishou_project
+        from kuaishou_account
         where id = #{id}
     </delete>
 
+    <select id="selectUnboundAccountList" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT *
+        FROM (
+        <if test="status == null or status == '' ">
+            ( SELECT
+            t1.account_id as 'accountId',
+            t1.account_name as 'accountName',
+            'JN' as 'type',
+            t1.user_id as 'ksId',
+            t1.user_name as 'ksName',
+            date_format(t1.account_create_time,'%Y-%m-%d') as 'accountCreateTime',
+            t1.product_name as 'productName',
+            '-' as 'operatorName'
+            FROM kuaishou_agent_account_list t1
+            WHERE NOT EXISTS
+            (SELECT 1 FROM kuaishou_account t2 WHERE t2.account_id = t1.account_id)
+            <if test="accountId != null and accountId != '' ">
+                AND t1.account_id = #{accountId}
+            </if>
+            <if test="accountName != null and accountName != '' ">
+                AND t1.account_name Like concat('%', #{accountName}, '%')
+            </if>
+            <if test="ksId != null and ksId != '' ">
+                AND t1.user_id = #{ksId}
+            </if>
+            ORDER BY account_create_time DESC
+            )
+            union all
+            (SELECT
+            account_id as 'accountId',
+            account_name as 'accountName',
+            media_code as 'type',
+            ks_id as 'ksId',
+            ks_name as 'ksName',
+            date_format(account_create_time,'%Y-%m-%d') as 'accountCreateTime',
+            product_name as 'productName',
+            operator_name as 'operatorName'
+            FROM kuaishou_account
+            <where>
+                <if test="accountId != null and accountId != '' ">
+                    AND account_id = #{accountId}
+                </if>
+                <if test="accountName != null and accountName != '' ">
+                    AND account_name Like concat('%', #{accountName}, '%')
+                </if>
+                <if test="ksId != null and ksId != '' ">
+                    AND ks_id = #{ksId}
+                </if>
+            </where>
+            ORDER BY account_create_time DESC
+            )
+        </if>
+        <if test="status == 2 ">
+            SELECT
+            t1.account_id as 'accountId',
+            t1.account_name as 'accountName',
+            'JN' as 'type',
+            t1.user_id as 'ksId',
+            t1.user_name as 'ksName',
+            date_format(t1.account_create_time,'%Y-%m-%d') as 'accountCreateTime',
+            t1.product_name as 'productName',
+            '-' as 'operatorName'
+            FROM kuaishou_agent_account_list t1
+            WHERE NOT EXISTS
+            (SELECT 1 FROM kuaishou_account t2 WHERE t2.account_id = t1.account_id)
+            <if test="accountId != null and accountId != '' ">
+                AND t1.account_id = #{accountId}
+            </if>
+            <if test="accountName != null and accountName != '' ">
+                AND t1.account_name Like concat('%', #{accountName}, '%')
+            </if>
+            <if test="ksId != null and ksId != '' ">
+                AND t1.user_id = #{ksId}
+            </if>
+            ORDER BY account_create_time DESC
+        </if>
+        <if test="status == 1">
+            SELECT
+            account_id as 'accountId',
+            account_name as 'accountName',
+            media_code as 'type',
+            ks_id as 'ksId',
+            ks_name as 'ksName',
+            date_format(account_create_time,'%Y-%m-%d') as 'accountCreateTime',
+            product_name as 'productName',
+            operator_name as 'operatorName'
+            FROM kuaishou_account
+            <where>
+                <if test="accountId != null and accountId != '' ">
+                    AND account_id = #{accountId}
+                </if>
+                <if test="accountName != null and accountName != '' ">
+                    AND account_name Like concat('%', #{accountName}, '%')
+                </if>
+                <if test="ksId != null and ksId != '' ">
+                    AND ks_id = #{ksId}
+                </if>
+            </where>
+            ORDER BY account_create_time DESC
+        </if>
+        ) t
+    </select>
+
 </mapper>

+ 107 - 94
ruixuan-live/src/main/resources/mapper/jinniu/KuaishouProjectMapper.xml

@@ -2,157 +2,170 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ruixuan.jinniu.mapper.KuaishouAccountMapper">
+<mapper namespace="com.ruixuan.jinniu.mapper.KuaishouProjectMapper">
 
-    <resultMap type="com.ruixuan.jinniu.entity.KuaishouAccount" id="KuaishouAccountResult">
+    <resultMap type="com.ruixuan.jinniu.entity.KuaishouProject" id="KuaishouProjectResult">
         <result property="id" column="id"/>
-        <result property="accountId" column="account_id"/>
-        <result property="accountName" column="account_name"/>
-        <result property="projectId" column="project_id"/>
         <result property="projectName" column="project_name"/>
         <result property="mediaCode" column="media_code"/>
-        <result property="ksId" column="ks_id"/>
-        <result property="ksName" column="ks_name"/>
+        <result property="supplierCode" column="supplier_code"/>
+        <result property="saleId" column="sale_id"/>
+        <result property="saleName" column="sale_name"/>
         <result property="operatorId" column="operator_id"/>
-        <result property="operatorLeader" column="operator_leader"/>
-        <result property="productName" column="product_name"/>
-        <result property="industry" column="industry"/>
-        <result property="secondIndustry" column="second_industry"/>
-        <result property="corporationName" column="corporation_name"/>
-        <result property="accountStatus" column="account_status"/>
+        <result property="operatorName" column="operator_name"/>
+        <result property="designResponsibleId" column="design_responsible_id"/>
+        <result property="designResponsibleName" column="design_responsible_name"/>
+        <result property="ocpxActionType" column="ocpx_action_type"/>
+        <result property="advertiserName" column="advertiser_name"/>
+        <result property="advertiserId" column="advertiser_id"/>
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
-    <sql id="selectKuaishouAccountVo">
+    <sql id="selectKuaishouProjectVo">
         select id,
-               account_id,
-               account_name,
-               project_id,
                project_name,
                media_code,
-               ks_id,
-               ks_name,
+               supplier_code,
+               sale_id,
+               sale_name,
                operator_id,
-               operator_leader,
-               product_name,
-               industry,
-               second_industry,
-               corporation_name,
-               account_status,
+               operator_name,
+               design_responsible_id,
+               design_responsible_name,
+               ocpx_action_type,
+               advertiser_name,
+               advertiser_id,
                create_time,
                update_time
-        from kuaishou_account
+        from kuaishou_project
     </sql>
 
-    <select id="selectKuaishouAccountList" parameterType="com.ruixuan.jinniu.entity.KuaishouAccount"
-            resultMap="KuaishouAccountResult">
-        <include refid="selectKuaishouAccountVo"/>
+    <select id="selectKuaishouProjectList" parameterType="com.ruixuan.jinniu.entity.KuaishouProject"
+            resultMap="KuaishouProjectResult">
+        <include refid="selectKuaishouProjectVo"/>
         <where>
-            <if test="accountId != null ">and account_id = #{accountId}</if>
-            <if test="accountName != null  and accountName != ''">and account_name like concat('%', #{accountName},
-                '%')
+            <if test="projectName != null  and projectName != ''">
+                and project_name like concat('%', #{projectName}, '%')
             </if>
-            <if test="projectId != null ">and project_id = #{projectId}</if>
-            <if test="projectName != null  and projectName != ''">and project_name like concat('%', #{projectName},
-                '%')
+            <if test="mediaCode != null  and mediaCode != ''">
+                and media_code = #{mediaCode}
             </if>
-            <if test="mediaCode != null  and mediaCode != ''">and media_code = #{mediaCode}</if>
-            <if test="ksId != null ">and ks_id = #{ksId}</if>
-            <if test="ksName != null  and ksName != ''">and ks_name like concat('%', #{ksName}, '%')</if>
-            <if test="operatorId != null  and operatorId != ''">and operator_id = #{operatorId}</if>
-            <if test="operatorLeader != null  and operatorLeader != ''">and operator_leader = #{operatorLeader}</if>
-            <if test="productName != null  and productName != ''">and product_name like concat('%', #{productName},
-                '%')
+            <if test="supplierCode != null  and supplierCode != ''">
+                and supplier_code = #{supplierCode}
             </if>
-            <if test="industry != null  and industry != ''">and industry = #{industry}</if>
-            <if test="secondIndustry != null  and secondIndustry != ''">and second_industry = #{secondIndustry}</if>
-            <if test="corporationName != null  and corporationName != ''">and corporation_name like concat('%',
-                #{corporationName}, '%')
+            <if test="saleIdList != null and saleIdList.size() >0 ">
+                and sale_id in
+                <foreach collection="saleIdList" item="userId" open="(" separator="," close=")">
+                    #{userId}
+                </foreach>
+            </if>
+            <if test="saleName != null  and saleName != ''">
+                and sale_name like concat('%', #{saleName}, '%')
+            </if>
+            <if test="operatorIdList != null and operatorIdList.size() >0 ">
+                and operator_id in
+                <foreach collection="operatorIdList" item="userId" open="(" separator="," close=")">
+                    #{userId}
+                </foreach>
+            </if>
+            <if test="operatorName != null  and operatorName != ''">
+                and operator_name like concat('%', #{operatorName}, '%')
+            </if>
+            <if test="designIdList != null and designIdList.size() >0 ">
+                and design_responsible_id in
+                <foreach collection="designIdList" item="userId" open="(" separator="," close=")">
+                    #{userId}
+                </foreach>
+            </if>
+            <if test="designResponsibleName != null  and designResponsibleName != ''">
+                and design_responsible_name like concat('%', #{designResponsibleName}, '%')
+            </if>
+            <if test="ocpxActionType != null  and ocpxActionType != ''">
+                and ocpx_action_type = #{ocpxActionType}
+            </if>
+            <if test="advertiserName != null  and advertiserName != ''">
+                and advertiser_name like concat('%', #{advertiserName}, '%')
+            </if>
+            <if test="advertiserId != null  and advertiserId != ''">
+                and advertiser_id = #{advertiserId}
             </if>
-            <if test="accountStatus != null  and accountStatus != ''">and account_status = #{accountStatus}</if>
         </where>
     </select>
 
-    <select id="selectKuaishouAccountById" parameterType="Long" resultMap="KuaishouAccountResult">
-        <include refid="selectKuaishouAccountVo"/>
+    <select id="selectKuaishouProjectById" parameterType="Long" resultMap="KuaishouProjectResult">
+        <include refid="selectKuaishouProjectVo"/>
         where id = #{id}
     </select>
 
-    <insert id="insertKuaishouAccount" parameterType="com.ruixuan.jinniu.entity.KuaishouAccount" useGeneratedKeys="true"
+    <insert id="insertKuaishouProject" parameterType="com.ruixuan.jinniu.entity.KuaishouProject" useGeneratedKeys="true"
             keyProperty="id">
-        insert into kuaishou_account
+        insert into kuaishou_project
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="accountId != null">account_id,</if>
-            <if test="accountName != null">account_name,</if>
-            <if test="projectId != null">project_id,</if>
             <if test="projectName != null">project_name,</if>
             <if test="mediaCode != null">media_code,</if>
-            <if test="ksId != null">ks_id,</if>
-            <if test="ksName != null">ks_name,</if>
+            <if test="supplierCode != null">supplier_code,</if>
+            <if test="saleId != null">sale_id,</if>
+            <if test="saleName != null">sale_name,</if>
             <if test="operatorId != null">operator_id,</if>
-            <if test="operatorLeader != null">operator_leader,</if>
-            <if test="productName != null">product_name,</if>
-            <if test="industry != null">industry,</if>
-            <if test="secondIndustry != null">second_industry,</if>
-            <if test="corporationName != null">corporation_name,</if>
-            <if test="accountStatus != null">account_status,</if>
+            <if test="operatorName != null">operator_name,</if>
+            <if test="designResponsibleId != null">design_responsible_id,</if>
+            <if test="designResponsibleName != null">design_responsible_name,</if>
+            <if test="ocpxActionType != null">ocpx_action_type,</if>
+            <if test="advertiserName != null">advertiser_name,</if>
+            <if test="advertiserId != null">advertiser_id,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="accountId != null">#{accountId},</if>
-            <if test="accountName != null">#{accountName},</if>
-            <if test="projectId != null">#{projectId},</if>
             <if test="projectName != null">#{projectName},</if>
             <if test="mediaCode != null">#{mediaCode},</if>
-            <if test="ksId != null">#{ksId},</if>
-            <if test="ksName != null">#{ksName},</if>
+            <if test="supplierCode != null">#{supplierCode},</if>
+            <if test="saleId != null">#{saleId},</if>
+            <if test="saleName != null">#{saleName},</if>
             <if test="operatorId != null">#{operatorId},</if>
-            <if test="operatorLeader != null">#{operatorLeader},</if>
-            <if test="productName != null">#{productName},</if>
-            <if test="industry != null">#{industry},</if>
-            <if test="secondIndustry != null">#{secondIndustry},</if>
-            <if test="corporationName != null">#{corporationName},</if>
-            <if test="accountStatus != null">#{accountStatus},</if>
+            <if test="operatorName != null">#{operatorName},</if>
+            <if test="designResponsibleId != null">#{designResponsibleId},</if>
+            <if test="designResponsibleName != null">#{designResponsibleName},</if>
+            <if test="ocpxActionType != null">#{ocpxActionType},</if>
+            <if test="advertiserName != null">#{advertiserName},</if>
+            <if test="advertiserId != null">#{advertiserId},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
         </trim>
     </insert>
 
-    <update id="updateKuaishouAccount" parameterType="com.ruixuan.jinniu.entity.KuaishouAccount">
-        update kuaishou_account
+    <update id="updateKuaishouProject" parameterType="com.ruixuan.jinniu.entity.KuaishouProject">
+        update kuaishou_project
         <trim prefix="SET" suffixOverrides=",">
-            <if test="accountId != null">account_id = #{accountId},</if>
-            <if test="accountName != null">account_name = #{accountName},</if>
-            <if test="projectId != null">project_id = #{projectId},</if>
             <if test="projectName != null">project_name = #{projectName},</if>
             <if test="mediaCode != null">media_code = #{mediaCode},</if>
-            <if test="ksId != null">ks_id = #{ksId},</if>
-            <if test="ksName != null">ks_name = #{ksName},</if>
+            <if test="supplierCode != null">supplier_code = #{supplierCode},</if>
+            <if test="saleId != null">sale_id = #{saleId},</if>
+            <if test="saleName != null">sale_name = #{saleName},</if>
             <if test="operatorId != null">operator_id = #{operatorId},</if>
-            <if test="operatorLeader != null">operator_leader = #{operatorLeader},</if>
-            <if test="productName != null">product_name = #{productName},</if>
-            <if test="industry != null">industry = #{industry},</if>
-            <if test="secondIndustry != null">second_industry = #{secondIndustry},</if>
-            <if test="corporationName != null">corporation_name = #{corporationName},</if>
-            <if test="accountStatus != null">account_status = #{accountStatus},</if>
+            <if test="operatorName != null">operator_name = #{operatorName},</if>
+            <if test="designResponsibleId != null">design_responsible_id = #{designResponsibleId},</if>
+            <if test="designResponsibleName != null">design_responsible_name = #{designResponsibleName},</if>
+            <if test="ocpxActionType != null">ocpx_action_type = #{ocpxActionType},</if>
+            <if test="advertiserName != null">advertiser_name = #{advertiserName},</if>
+            <if test="advertiserId != null">advertiser_id = #{advertiserId},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
         </trim>
         where id = #{id}
     </update>
 
-    <delete id="deleteKuaishouAccountById" parameterType="Long">
+    <delete id="deleteKuaishouProjectById" parameterType="Long">
         delete
-        from kuaishou_account
+        from kuaishou_project
         where id = #{id}
     </delete>
 
-    <delete id="deleteKuaishouAccountByIds" parameterType="String">
-        delete from kuaishou_account where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
+
+    <select id="getOcpxActionType" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT ocpx_action_type AS 'code', ocpx_action_name AS 'name'
+        FROM kuaishou_ocpx_action_type
+        ORDER BY create_time
+    </select>
 </mapper>

+ 125 - 0
ruixuan-live/src/main/resources/mapper/jinniu/KuaishouProjectMemberMapper.xml

@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruixuan.jinniu.mapper.KuaishouProjectMemberMapper">
+
+    <resultMap type="com.ruixuan.jinniu.entity.KuaishouProjectMember" id="KuaishouProjectMemberResult">
+        <result property="id" column="id"/>
+        <result property="projectId" column="project_id"/>
+        <result property="projectName" column="project_name"/>
+        <result property="userId" column="user_id"/>
+        <result property="userName" column="user_name"/>
+        <result property="roleKey" column="role_key"/>
+        <result property="roleName" column="role_name"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouProjectMemberVo">
+        select id,
+               project_id,
+               project_name,
+               user_id,
+               user_name,
+               role_key,
+               role_name,
+               create_time,
+               update_time
+        from kuaishou_project_member
+    </sql>
+
+    <select id="selectKuaishouProjectMemberList" parameterType="com.ruixuan.jinniu.entity.KuaishouProjectMember"
+            resultMap="KuaishouProjectMemberResult">
+        <include refid="selectKuaishouProjectMemberVo"/>
+        <where>
+            <if test="projectId != null ">and project_id = #{projectId}</if>
+            <if test="projectName != null  and projectName != ''">and project_name like concat('%', #{projectName},
+                '%')
+            </if>
+            <if test="userId != null  and userId != ''">and user_id = #{userId}</if>
+            <if test="userName != null  and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
+            <if test="roleKey != null  and roleKey != ''">and role_key = #{roleKey}</if>
+            <if test="roleName != null  and roleName != ''">and role_name like concat('%', #{roleName}, '%')</if>
+        </where>
+    </select>
+
+    <select id="selectKuaishouProjectMemberById" parameterType="Long" resultMap="KuaishouProjectMemberResult">
+        <include refid="selectKuaishouProjectMemberVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="queryProjectUsers" parameterType="Long" resultMap="KuaishouProjectMemberResult">
+        <include refid="selectKuaishouProjectMemberVo"/>
+        where project_id = #{projectId}
+    </select>
+
+    <insert id="insertKuaishouProjectMember" parameterType="com.ruixuan.jinniu.entity.KuaishouProjectMember"
+            useGeneratedKeys="true"
+            keyProperty="id">
+        insert into kuaishou_project_member
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="projectId != null">project_id,</if>
+            <if test="projectName != null">project_name,</if>
+            <if test="userId != null and userId != ''">user_id,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="roleKey != null and roleKey != ''">role_key,</if>
+            <if test="roleName != null and roleName != ''">role_name,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="projectId != null">#{projectId},</if>
+            <if test="projectName != null">#{projectName},</if>
+            <if test="userId != null and userId != ''">#{userId},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="roleKey != null and roleKey != ''">#{roleKey},</if>
+            <if test="roleName != null and roleName != ''">#{roleName},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <insert id="replaceBatch">
+        replace into kuaishou_project_member(
+        project_id,
+        project_name,
+        user_id,
+        user_name,
+        role_key,
+        role_name
+        )
+        values
+        <foreach collection="list" item="member" separator=",">
+            (
+            #{member.projectId},
+            #{member.projectName},
+            #{member.userId},
+            #{member.userName},
+            #{member.roleKey},
+            #{member.roleName}
+            )
+        </foreach>
+    </insert>
+
+    <update id="updateKuaishouProjectMember" parameterType="com.ruixuan.jinniu.entity.KuaishouProjectMember">
+        update kuaishou_project_member
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="projectId != null">project_id = #{projectId},</if>
+            <if test="projectName != null">project_name = #{projectName},</if>
+            <if test="userId != null and userId != ''">user_id = #{userId},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
+            <if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteKuaishouProjectMemberById" parameterType="Long">
+        delete
+        from kuaishou_project_member
+        where id = #{id}
+    </delete>
+</mapper>

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

@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruixuan.jinniu.mapper.KuaishouTransferAccountMapper">
+
+    <resultMap type="com.ruixuan.jinniu.entity.KuaishouTransferAccount" id="KuaishouTransferAccountResult">
+        <result property="id" column="id"/>
+        <result property="userId" column="user_id"/>
+        <result property="accountId" column="account_id"/>
+        <result property="projectId" column="project_id"/>
+        <result property="transferor" column="transferor"/>
+        <result property="assignee" column="assignee"/>
+        <result property="transferorDate" column="transferor_date"/>
+        <result property="assigneeDate" column="assignee_date"/>
+        <result property="auditor" column="auditor"/>
+        <result property="status" column="status"/>
+        <result property="remarks" column="remarks"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouTransferAccountVo">
+        select id,
+               user_id,
+               account_id,
+               project_id,
+               transferor,
+               assignee,
+               transferor_date,
+               assignee_date,
+               auditor,
+               status,
+               remarks,
+               create_time,
+               update_time
+        from kuaishou_transfer_account
+    </sql>
+
+    <select id="selectKuaishouTransferAccountList" parameterType="com.ruixuan.jinniu.entity.KuaishouTransferAccount"
+            resultMap="KuaishouTransferAccountResult">
+        <include refid="selectKuaishouTransferAccountVo"/>
+        <where>
+            <if test="userList != null ">and transferor in
+                <foreach collection="userList" item="userId" open="(" separator="," close=")">
+                    #{userId}
+                </foreach>
+            </if>
+        </where>
+    </select>
+
+    <select id="selectKuaishouTransferAccountById" parameterType="Long" resultMap="KuaishouTransferAccountResult">
+        <include refid="selectKuaishouTransferAccountVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertKuaishouTransferAccount" parameterType="com.ruixuan.jinniu.entity.KuaishouTransferAccount"
+            useGeneratedKeys="true"
+            keyProperty="id">
+        insert into kuaishou_transfer_account
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="accountId != null">account_id,</if>
+            <if test="projectId != null">project_id,</if>
+            <if test="transferor != null">transferor,</if>
+            <if test="assignee != null">assignee,</if>
+            <if test="transferorDate != null">transferor_date,</if>
+            <if test="assigneeDate != null">assignee_date,</if>
+            <if test="auditor != null">auditor,</if>
+            <if test="status != null">status,</if>
+            <if test="remarks != null">remarks,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="accountId != null">#{accountId},</if>
+            <if test="projectId != null">#{projectId},</if>
+            <if test="transferor != null">#{transferor},</if>
+            <if test="assignee != null">#{assignee},</if>
+            <if test="transferorDate != null">#{transferorDate},</if>
+            <if test="assigneeDate != null">#{assigneeDate},</if>
+            <if test="auditor != null">#{auditor},</if>
+            <if test="status != null">#{status},</if>
+            <if test="remarks != null">#{remarks},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateKuaishouTransferAccount" parameterType="com.ruixuan.jinniu.entity.KuaishouTransferAccount">
+        update kuaishou_transfer_account
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="accountId != null">account_id = #{accountId},</if>
+            <if test="projectId != null">project_id = #{projectId},</if>
+            <if test="transferor != null">transferor = #{transferor},</if>
+            <if test="assignee != null">assignee = #{assignee},</if>
+            <if test="transferorDate != null">transferor_date = #{transferorDate},</if>
+            <if test="assigneeDate != null">assignee_date = #{assigneeDate},</if>
+            <if test="auditor != null">auditor = #{auditor},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteKuaishouTransferAccountById" parameterType="Long">
+        delete
+        from kuaishou_transfer_account
+        where id = #{id}
+    </delete>
+</mapper>

+ 5 - 6
ruixuan-system/src/main/java/com/ruixuan/system/mapper/SysUserMapper.java

@@ -1,10 +1,10 @@
 package com.ruixuan.system.mapper;
 
-import java.util.List;
-
 import com.alibaba.fastjson.JSONObject;
-import org.apache.ibatis.annotations.Param;
 import com.ruixuan.common.core.domain.entity.SysUser;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 用户表 数据层
@@ -161,8 +161,7 @@ public interface SysUserMapper {
      */
     List<JSONObject> getUserByRoleName(@Param("roleCodeList") List<String> roleCodeList);
 
+    String getRoleKeyByUserId(@Param("userId") Long userId);
 
-    String getRoleKeyByUserId(@Param("userId") String userId);
-
-    List<Long> getUserIdByRoleKey(@Param("roleKey")  String roleKey);
+    List<Long> getUserIdByRoleKey(@Param("roleKey") String roleKey);
 }

+ 2 - 1
ruixuan-system/src/main/java/com/ruixuan/system/service/ISysUserService.java

@@ -42,6 +42,7 @@ public interface ISysUserService {
      * @return 用户对象信息
      */
     public SysUser selectUserByUserName(String userName);
+
     /**
      * 通过用户昵称查询用户
      *
@@ -226,7 +227,7 @@ public interface ISysUserService {
 
     List<JSONObject> getUserByRoleName(List<String> roleCodeList);
 
-    String getRoleKeyByUserId(String userId);
+    String getRoleKeyByUserId(Long userId);
 
     List<Long> getUserIdByRoleKey(String roleKey);
 }

+ 12 - 12
ruixuan-system/src/main/java/com/ruixuan/system/service/impl/SysUserServiceImpl.java

@@ -1,17 +1,6 @@
 package com.ruixuan.system.service.impl;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Collectors;
-import javax.validation.Validator;
-
 import com.alibaba.fastjson.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
 import com.ruixuan.common.annotation.DataScope;
 import com.ruixuan.common.constant.UserConstants;
 import com.ruixuan.common.core.domain.entity.SysRole;
@@ -31,6 +20,17 @@ import com.ruixuan.system.mapper.SysUserPostMapper;
 import com.ruixuan.system.mapper.SysUserRoleMapper;
 import com.ruixuan.system.service.ISysConfigService;
 import com.ruixuan.system.service.ISysUserService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import javax.validation.Validator;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 用户 业务层处理
@@ -541,7 +541,7 @@ public class SysUserServiceImpl implements ISysUserService {
     }
 
     @Override
-    public String getRoleKeyByUserId(String userId) {
+    public String getRoleKeyByUserId(Long userId) {
         return userMapper.getRoleKeyByUserId(userId);
     }