Просмотр исходного кода

Merge branch 'master' into test

# Conflicts:
#	ruixuan-common/src/main/java/com/ruixuan/common/utils/DateUtils.java
zhaoxian 2 лет назад
Родитель
Сommit
e2c682d010
51 измененных файлов с 6658 добавлено и 325 удалено
  1. 7 0
      pom.xml
  2. 13 0
      ruixuan-admin/src/main/java/com/ruixuan/web/controller/system/SysUserController.java
  3. 32 28
      ruixuan-admin/src/main/resources/application-dev.yml
  4. 5 0
      ruixuan-admin/src/main/resources/application-prod.yml
  5. 51 51
      ruixuan-common/src/main/java/com/ruixuan/common/core/controller/BaseController.java
  6. 63 5
      ruixuan-common/src/main/java/com/ruixuan/common/utils/DateUtils.java
  7. 25 25
      ruixuan-framework/src/main/java/com/ruixuan/framework/config/SecurityConfig.java
  8. 15 1
      ruixuan-live/pom.xml
  9. 10 0
      ruixuan-live/src/main/java/com/ruixuan/isc/constants/KuaiShouConstants.java
  10. 325 0
      ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouItemCollectSamplesController.java
  11. 190 0
      ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouItemListController.java
  12. 87 0
      ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouPromoterController.java
  13. 1214 0
      ruixuan-live/src/main/java/com/ruixuan/isc/controller/SupplyChainController.java
  14. 86 0
      ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouItemCollectSampleExpress.java
  15. 352 0
      ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouItemCollectSamples.java
  16. 603 0
      ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouItemList.java
  17. 127 0
      ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouPromoter.java
  18. 55 0
      ruixuan-live/src/main/java/com/ruixuan/isc/enums/CompanyEnum.java
  19. 5 0
      ruixuan-live/src/main/java/com/ruixuan/isc/mapper/AccessTokenMapper.java
  20. 82 0
      ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouItemCollectSamplesMapper.java
  21. 28 0
      ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouItemListMapper.java
  22. 58 0
      ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouPromoterMapper.java
  23. 73 0
      ruixuan-live/src/main/java/com/ruixuan/isc/mapper/SupplyChainMapper.java
  24. 8 0
      ruixuan-live/src/main/java/com/ruixuan/isc/service/IAccessTokenService.java
  25. 80 0
      ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouItemCollectSamplesService.java
  26. 33 0
      ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouItemListService.java
  27. 63 0
      ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouPromoterService.java
  28. 98 0
      ruixuan-live/src/main/java/com/ruixuan/isc/service/ISupplyChainService.java
  29. 60 0
      ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/AccessTokenServiceImpl.java
  30. 240 0
      ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java
  31. 145 0
      ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemListServiceImpl.java
  32. 209 0
      ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java
  33. 183 0
      ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/SupplyChainServiceImpl.java
  34. BIN
      ruixuan-live/src/main/resources/lib/kuaishou-merchant-open-sdk-release_open_kwaishop_sdk-1.0.2546.jar
  35. 11 0
      ruixuan-live/src/main/resources/mapper/isc/AccessTokenMapper.xml
  36. 308 0
      ruixuan-live/src/main/resources/mapper/isc/KuaishouItemCollectSamplesMapper.xml
  37. 222 0
      ruixuan-live/src/main/resources/mapper/isc/KuaishouItemListMapper.xml
  38. 155 0
      ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml
  39. 1039 0
      ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml
  40. 4 0
      ruixuan-system/src/main/java/com/ruixuan/system/mapper/SysDeptMapper.java
  41. 23 15
      ruixuan-system/src/main/java/com/ruixuan/system/mapper/SysRoleMapper.java
  42. 19 21
      ruixuan-system/src/main/java/com/ruixuan/system/mapper/SysUserMapper.java
  43. 37 16
      ruixuan-system/src/main/java/com/ruixuan/system/service/ISysDeptService.java
  44. 36 25
      ruixuan-system/src/main/java/com/ruixuan/system/service/ISysRoleService.java
  45. 1 0
      ruixuan-system/src/main/java/com/ruixuan/system/service/ISysUserService.java
  46. 10 0
      ruixuan-system/src/main/java/com/ruixuan/system/service/impl/SysDeptServiceImpl.java
  47. 7 0
      ruixuan-system/src/main/java/com/ruixuan/system/service/impl/SysRoleServiceImpl.java
  48. 5 0
      ruixuan-system/src/main/java/com/ruixuan/system/service/impl/SysUserServiceImpl.java
  49. 134 126
      ruixuan-system/src/main/resources/mapper/system/SysDeptMapper.xml
  50. 6 0
      ruixuan-system/src/main/resources/mapper/system/SysRoleMapper.xml
  51. 16 12
      ruixuan-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 7 - 0
pom.xml

@@ -292,6 +292,13 @@
                     <encoding>${project.build.sourceEncoding}</encoding>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <includeSystemScope>true</includeSystemScope>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 

+ 13 - 0
ruixuan-admin/src/main/java/com/ruixuan/web/controller/system/SysUserController.java

@@ -48,6 +48,19 @@ public class SysUserController extends BaseController
     @Autowired
     private ISysPostService postService;
 
+
+    /**
+     * 根据userId获取roleKey
+     * @param userId
+     * @return
+     */
+    @GetMapping("/getRoleKeyByUserId")
+    public String getRoleKeyByUserId(String userId) {
+       String roleKey = userService.getRoleKeyByUserId(userId);
+        return roleKey;
+    }
+
+
     /**
      * 获取用户列表
      */

Разница между файлами не показана из-за своего большого размера
+ 32 - 28
ruixuan-admin/src/main/resources/application-dev.yml


Разница между файлами не показана из-за своего большого размера
+ 5 - 0
ruixuan-admin/src/main/resources/application-prod.yml


+ 51 - 51
ruixuan-common/src/main/java/com/ruixuan/common/core/controller/BaseController.java

@@ -1,12 +1,5 @@
 package com.ruixuan.common.core.controller;
 
-import java.beans.PropertyEditorSupport;
-import java.util.Date;
-import java.util.List;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.web.bind.WebDataBinder;
-import org.springframework.web.bind.annotation.InitBinder;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.ruixuan.common.constant.HttpStatus;
@@ -20,28 +13,32 @@ import com.ruixuan.common.utils.PageUtils;
 import com.ruixuan.common.utils.SecurityUtils;
 import com.ruixuan.common.utils.StringUtils;
 import com.ruixuan.common.utils.sql.SqlUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.web.bind.WebDataBinder;
+import org.springframework.web.bind.annotation.InitBinder;
+
+import java.beans.PropertyEditorSupport;
+import java.util.Date;
+import java.util.List;
 
 /**
  * web层通用数据处理
- * 
+ *
  * @author ruoyi
  */
-public class BaseController
-{
+public class BaseController {
     protected final Logger logger = LoggerFactory.getLogger(this.getClass());
 
     /**
      * 将前台传递过来的日期格式的字符串,自动转化为Date类型
      */
     @InitBinder
-    public void initBinder(WebDataBinder binder)
-    {
+    public void initBinder(WebDataBinder binder) {
         // Date 类型转换
-        binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
-        {
+        binder.registerCustomEditor(Date.class, new PropertyEditorSupport() {
             @Override
-            public void setAsText(String text)
-            {
+            public void setAsText(String text) {
                 setValue(DateUtils.parseDate(text));
             }
         });
@@ -50,19 +47,16 @@ public class BaseController
     /**
      * 设置请求分页数据
      */
-    protected void startPage()
-    {
+    protected void startPage() {
         PageUtils.startPage();
     }
 
     /**
      * 设置请求排序数据
      */
-    protected void startOrderBy()
-    {
+    protected void startOrderBy() {
         PageDomain pageDomain = TableSupport.buildPageRequest();
-        if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
-        {
+        if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) {
             String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
             PageHelper.orderBy(orderBy);
         }
@@ -71,17 +65,15 @@ public class BaseController
     /**
      * 清理分页的线程变量
      */
-    protected void clearPage()
-    {
+    protected void clearPage() {
         PageUtils.clearPage();
     }
 
     /**
      * 响应请求分页数据
      */
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    protected TableDataInfo getDataTable(List<?> list)
-    {
+    @SuppressWarnings({"rawtypes", "unchecked"})
+    protected TableDataInfo getDataTable(List<?> list) {
         TableDataInfo rspData = new TableDataInfo();
         rspData.setCode(HttpStatus.SUCCESS);
         rspData.setMsg("查询成功");
@@ -93,94 +85,102 @@ public class BaseController
     /**
      * 返回成功
      */
-    public AjaxResult success()
-    {
+    public AjaxResult success() {
         return AjaxResult.success();
     }
 
     /**
      * 返回失败消息
      */
-    public AjaxResult error()
-    {
+    public AjaxResult error() {
         return AjaxResult.error();
     }
 
     /**
      * 返回成功消息
      */
-    public AjaxResult success(String message)
-    {
+    public AjaxResult success(String message) {
         return AjaxResult.success(message);
     }
 
     /**
      * 返回失败消息
      */
-    public AjaxResult error(String message)
-    {
+    public AjaxResult error(String message) {
         return AjaxResult.error(message);
     }
 
     /**
      * 响应返回结果
-     * 
+     *
      * @param rows 影响行数
      * @return 操作结果
      */
-    protected AjaxResult toAjax(int rows)
-    {
+    protected AjaxResult toAjax(int rows) {
         return rows > 0 ? AjaxResult.success() : AjaxResult.error();
     }
 
     /**
      * 响应返回结果
-     * 
+     *
+     * @param rows 影响行数
+     * @return 操作结果
+     */
+    protected AjaxResult toAjax2(int rows) {
+        AjaxResult result = null;
+        switch (rows) {
+            case 0:
+                result = result.error("该数据已存在,请重新输入");
+                break;
+            case 1:
+                result = AjaxResult.success();
+                break;
+        }
+        return result;
+    }
+
+    /**
+     * 响应返回结果
+     *
      * @param result 结果
      * @return 操作结果
      */
-    protected AjaxResult toAjax(boolean result)
-    {
+    protected AjaxResult toAjax(boolean result) {
         return result ? success() : error();
     }
 
     /**
      * 页面跳转
      */
-    public String redirect(String url)
-    {
+    public String redirect(String url) {
         return StringUtils.format("redirect:{}", url);
     }
 
     /**
      * 获取用户缓存信息
      */
-    public LoginUser getLoginUser()
-    {
+    public LoginUser getLoginUser() {
         return SecurityUtils.getLoginUser();
     }
 
     /**
      * 获取登录用户id
      */
-    public Long getUserId()
-    {
+    public Long getUserId() {
         return getLoginUser().getUserId();
     }
 
     /**
      * 获取登录部门id
      */
-    public Long getDeptId()
-    {
+    public Long getDeptId() {
         return getLoginUser().getDeptId();
     }
 
     /**
      * 获取登录用户名
      */
-    public String getUsername()
-    {
+    public String getUsername() {
         return getLoginUser().getUsername();
     }
 }

+ 63 - 5
ruixuan-common/src/main/java/com/ruixuan/common/utils/DateUtils.java

@@ -1,7 +1,6 @@
 package com.ruixuan.common.utils;
 
 import java.lang.management.ManagementFactory;
-import java.sql.Timestamp;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
@@ -15,7 +14,6 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.commons.lang3.time.DateFormatUtils;
-import org.springframework.security.config.web.servlet.headers.HttpPublicKeyPinningDsl;
 
 /**
  * 时间工具类
@@ -50,6 +48,11 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         return new Date();
     }
 
+    public static String getNowDateStr() {
+        SimpleDateFormat simp = new SimpleDateFormat("yyyy-MM-dd");
+        return simp.format(new Date());
+    }
+
     /**
      * 获取当前日期, 默认格式为yyyy-MM-dd
      *
@@ -239,9 +242,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         //System.out.println(parseDateToStr(YYYY_MM_DD,getBeginDayOfWeek()));
         // System.out.println(parseDateToStr(YYYY_MM_DD,getEendDayOfWeek()));
 
-        //System.out.println(strDateToInt("2022-05"));
-        System.out.println(getSubtractTime(new Date(),6));
-
+        System.out.println(strDateToInt("2022-05"));
     }
 
     /**
@@ -340,4 +341,61 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 
 
 
+    public static Long getStartLongTime(String orderStartDate) {
+        String date = orderStartDate + " 00:00:00";
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Long orderCreateTimeStart = null;
+        try {
+            orderCreateTimeStart = sdf.parse(date).getTime();
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return orderCreateTimeStart;
+    }
+
+    public static Long getEndLongTime(String orderEndDate) {
+        String date = orderEndDate + " 23:60:00";
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Long orderCreateTimeEnd = null;
+        try {
+            orderCreateTimeEnd = sdf.parse(date).getTime();
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return orderCreateTimeEnd;
+    }
+
+    public static Integer getNowHour() {
+        Calendar cal = Calendar.getInstance();
+        Date date = new Date();
+        cal.setTime(date);
+        return cal.get(Calendar.HOUR_OF_DAY);
+    }
+
+    public static String getAnotherDay(String format, String date, Integer num) {
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        Date getDate = null;
+        try {
+            getDate = sdf.parse(date);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(getDate);
+        calendar.add(Calendar.DAY_OF_MONTH, num);
+        Date resultDate = calendar.getTime();
+        return sdf.format(resultDate);
+    }
+
+    public static Long getNowEndHourTemp(String dateStr, Integer hour) {
+        String date = dateStr + " " + hour + ":60:00";
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        Long orderCreateTimeEnd = null;
+        try {
+            orderCreateTimeEnd = sdf.parse(date).getTime();
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+        return orderCreateTimeEnd;
+    }
 }

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

@@ -1,6 +1,8 @@
 package com.ruixuan.framework.config;
 
 import com.ruixuan.framework.security.filter.JwtAuthenticationTokenFilter;
+import com.ruixuan.framework.security.handle.AuthenticationEntryPointImpl;
+import com.ruixuan.framework.security.handle.LogoutSuccessHandlerImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Bean;
 import org.springframework.http.HttpMethod;
@@ -15,23 +17,20 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
 import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
 import org.springframework.security.web.authentication.logout.LogoutFilter;
 import org.springframework.web.filter.CorsFilter;
-import com.ruixuan.framework.security.handle.AuthenticationEntryPointImpl;
-import com.ruixuan.framework.security.handle.LogoutSuccessHandlerImpl;
 
 /**
  * spring security配置
- * 
+ *
  * @author ruixuan
  */
 @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
-public class SecurityConfig extends WebSecurityConfigurerAdapter
-{
+public class SecurityConfig extends WebSecurityConfigurerAdapter {
     /**
      * 自定义用户认证逻辑
      */
     @Autowired
     private UserDetailsService userDetailsService;
-    
+
     /**
      * 认证失败处理类
      */
@@ -49,13 +48,13 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
      */
     @Autowired
     private JwtAuthenticationTokenFilter authenticationTokenFilter;
-    
+
     /**
      * 跨域过滤器
      */
     @Autowired
     private CorsFilter corsFilter;
-    
+
     /**
      * 解决 无法直接注入 AuthenticationManager
      *
@@ -64,8 +63,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
      */
     @Bean
     @Override
-    public AuthenticationManager authenticationManagerBean() throws Exception
-    {
+    public AuthenticationManager authenticationManagerBean() throws Exception {
         return super.authenticationManagerBean();
     }
 
@@ -85,8 +83,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
      * authenticated       |   用户登录后可访问
      */
     @Override
-    protected void configure(HttpSecurity httpSecurity) throws Exception
-    {
+    protected void configure(HttpSecurity httpSecurity) throws Exception {
         httpSecurity
                 // CSRF禁用,因为不使用session
                 .csrf().disable()
@@ -112,15 +109,20 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/webjars/**").anonymous()
                 .antMatchers("/*/api-docs").anonymous()
                 .antMatchers("/druid/**").anonymous()
-                    .antMatchers("/swagger/**").permitAll()
-                    .antMatchers("/test/**").permitAll()
-                    .antMatchers("/demoController/**").permitAll()
-                    .antMatchers("/sale/**").permitAll()
-                    .antMatchers("/live/**").permitAll()
-                    .antMatchers("/launch/**").permitAll()
-                    .antMatchers("/system/user/getUserRoleByUserId").permitAll()
-                    .antMatchers("/system/user/getUserByRoleName").permitAll()
-                    .antMatchers("/system/industry/**").permitAll()
+                .antMatchers("/swagger/**").permitAll()
+                .antMatchers("/test/**").permitAll()
+                .antMatchers("/demoController/**").permitAll()
+                .antMatchers("/sale/**").permitAll()
+                .antMatchers("/live/**").permitAll()
+                .antMatchers("/launch/**").permitAll()
+                .antMatchers("/system/user/getUserRoleByUserId").permitAll()
+                .antMatchers("/system/user/getUserByRoleName").permitAll()
+                .antMatchers("/system/industry/**").permitAll()
+                .antMatchers("/isv/supply_chain/*").permitAll()
+                .antMatchers("/itemCollectSamples/*").permitAll()
+                .antMatchers("/item/*").permitAll()
+                .antMatchers("/system/user/*").permitAll()
+                .antMatchers("/kuaishou/promoter/*").permitAll()
 
                 // 除上面外的所有请求全部需要鉴权认证
                 .anyRequest().authenticated()
@@ -138,8 +140,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
      * 强散列哈希加密实现
      */
     @Bean
-    public BCryptPasswordEncoder bCryptPasswordEncoder()
-    {
+    public BCryptPasswordEncoder bCryptPasswordEncoder() {
         return new BCryptPasswordEncoder();
     }
 
@@ -147,8 +148,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
      * 身份认证接口
      */
     @Override
-    protected void configure(AuthenticationManagerBuilder auth) throws Exception
-    {
+    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
         auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
     }
 }

+ 15 - 1
ruixuan-live/pom.xml

@@ -16,6 +16,19 @@
     </description>
 
     <dependencies>
+        <dependency>
+            <groupId>com.github.kuaidi100-api</groupId>
+            <artifactId>sdk</artifactId>
+            <version>1.0.11</version>
+        </dependency>
+
+        <dependency>
+            <groupId>thirtpart</groupId>
+            <artifactId>sdk</artifactId>
+            <version>1.0</version>
+            <scope>system</scope>
+            <systemPath>${project.basedir}/src/main/resources/lib/kuaishou-merchant-open-sdk-release_open_kwaishop_sdk-1.0.2546.jar</systemPath>
+        </dependency>
 
         <!-- 通用工具-->
         <dependency>
@@ -44,7 +57,6 @@
             <version>3.0.5</version>
         </dependency>
 
-
         <!-- csv -->
         <dependency>
             <groupId>de.siegmar</groupId>
@@ -54,4 +66,6 @@
 
     </dependencies>
 
+
+
 </project>

+ 10 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/constants/KuaiShouConstants.java

@@ -0,0 +1,10 @@
+package com.ruixuan.isc.constants;
+
+public class KuaiShouConstants {
+    public static final String KFX_URL = "https://openapi.kwaixiaodian.com/";
+    public static final String APP_KEY = "ks665688320292774929";
+    public static final String APP_SECRET = "3qAsvwcUYuHFVpxJ_OTSFg";
+    public static final String SIGN_SECRET = "8e21f5bc03b6d2dc63e6256225dac00b";
+
+
+}

+ 325 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouItemCollectSamplesController.java

@@ -0,0 +1,325 @@
+package com.ruixuan.isc.controller;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.servlet.http.HttpServletRequest;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.Gson;
+import com.kuaidi100.sdk.api.Subscribe;
+import com.kuaidi100.sdk.contant.ApiInfoConstant;
+import com.kuaidi100.sdk.contant.CompanyConstant;
+import com.kuaidi100.sdk.core.IBaseClient;
+import com.kuaidi100.sdk.request.SubscribeParam;
+import com.kuaidi100.sdk.request.SubscribeParameters;
+import com.kuaidi100.sdk.request.SubscribeReq;
+import com.kuaidi100.sdk.response.SubscribeResp;
+import com.ruixuan.common.annotation.Log;
+import com.ruixuan.common.core.controller.BaseController;
+import com.ruixuan.common.core.domain.AjaxResult;
+import com.ruixuan.common.core.domain.entity.SysUser;
+import com.ruixuan.common.core.page.TableDataInfo;
+import com.ruixuan.common.enums.BusinessType;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.isc.entity.KuaishouItemCollectSampleExpress;
+import com.ruixuan.isc.entity.KuaishouItemCollectSamples;
+import com.ruixuan.isc.enums.CompanyEnum;
+import com.ruixuan.isc.service.IKuaishouItemCollectSamplesService;
+import com.ruixuan.system.service.ISysDeptService;
+import com.ruixuan.system.service.ISysRoleService;
+import com.ruixuan.system.service.ISysUserService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.security.access.prepost.PreAuthorize;
+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.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 【商品领样】Controller
+ *
+ * @author ruoyi
+ * @date 2023-02-08
+ */
+@RestController
+@Slf4j
+@RequestMapping("/itemCollectSamples")
+public class KuaishouItemCollectSamplesController extends BaseController {
+    @Autowired
+    private IKuaishouItemCollectSamplesService kuaishouItemCollectSamplesService;
+
+    @Autowired
+    private ISysRoleService sysRoleService;
+    @Autowired
+    private ISysDeptService sysDeptService;
+    @Autowired
+    private ISysUserService sysUserService;
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(Long itemId, Long promoterId, Long userId, Integer collectSampleStatus) {
+        TableDataInfo tableDataInfo = new TableDataInfo();
+        try {
+            Map<String, Object> requestMap = new HashMap<>();
+            if (Check.isNull(userId)) {
+                throw new Exception("请传入登录人ID");
+            }
+            String roleId = sysRoleService.getRoleBYUserId(userId);
+            if (roleId.equals("courtshipManager") || roleId.equals("bdManager") || roleId.equals("associationManager")) { // 经理层级查看部门下所有数据
+                Long deptId = sysDeptService.getDeptIdByUserId(userId);
+                List<Long> userIds = sysDeptService.getDeptUserListByDeptId(deptId);
+                if (roleId.equals("bdManager") || roleId.equals("associationManager")) {
+                    requestMap.put("collectSampleIds", userIds);
+                } else {
+                    requestMap.put("itemCreateIds", userIds);
+                }
+            } else if (roleId.equals("association") || roleId.equals("bd")) { // 社群和bd查看申请人为自己的领样信息
+                requestMap.put("collectSampleId", userId);
+            } else if (roleId.equals("courtship")) { // 招商查看创建人为自己的领样信息
+                requestMap.put("itemCreateId", userId);
+            }
+            if (!Check.isNull(itemId)) {
+                requestMap.put("itemId", itemId);
+            }
+            if (!Check.isNull(promoterId)) {
+                requestMap.put("promoterId", promoterId);
+            }
+            if (!Check.isNull(collectSampleStatus)) {
+                requestMap.put("collectSampleStatus", collectSampleStatus);
+            }
+            startPage();
+            List<KuaishouItemCollectSamples> list = kuaishouItemCollectSamplesService.selectKuaishouItemCollectSamplesList(requestMap);
+            return getDataTable(list);
+        } catch (Exception e) {
+            tableDataInfo.setCode(-1);
+            tableDataInfo.setMsg(e.getMessage());
+        }
+        return tableDataInfo;
+    }
+
+
+    /**
+     * 领样预览
+     */
+
+    @PostMapping("/preview")
+    public JSONObject preview(@RequestBody JSONObject requestJson) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            Long userId = requestJson.getLong("userId");
+            if (Check.isNull(userId)) {
+                throw new Exception("请传入当前登录人ID");
+            }
+            SysUser sysUser = sysUserService.selectUserById(userId);
+            if (Check.isNull(sysUser)) {
+                throw new Exception("未获取到登录人信息");
+            }
+
+            JSONArray itemIds = requestJson.getJSONArray("itemIds");
+            if (Check.isNull(itemIds)) {
+                throw new Exception("请传入需要申请的商品列表");
+            }
+            JSONArray promoterIds = requestJson.getJSONArray("promoterIds");
+            if (Check.isNull(promoterIds)) {
+                throw new Exception("请传入需要申请的达人列表");
+            }
+            JSONObject previewJson = kuaishouItemCollectSamplesService.preview(userId, sysUser.getNickName(), itemIds, promoterIds);
+            returnJson.put("code", 0);
+            returnJson.put("message", "success");
+            returnJson.put("preview", previewJson);
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
+
+    /**
+     * 新增【请填写功能名称】
+     */
+
+    @PostMapping("/add")
+    public JSONObject add(@RequestBody JSONObject requestJson) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(requestJson)) {
+                throw new Exception("入参不能为空");
+            }
+            JSONArray temCollectSamples = requestJson.getJSONArray("temCollectSamples");
+            if (Check.isNull(temCollectSamples)) {
+                throw new Exception("认领信息不能为空");
+            }
+            kuaishouItemCollectSamplesService.batchAdd(temCollectSamples);
+            returnJson.put("code", 0);
+            returnJson.put("message", "领样信息增加成功");
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+
+        return returnJson;
+    }
+
+
+    @GetMapping("/getCompany")
+    public List<JSONObject> getCompany() {
+        return CompanyEnum.companyList();
+    }
+
+
+    /**
+     * 修改【请填写功能名称】
+     */
+
+    @PutMapping("/edit")
+    public JSONObject edit(@RequestBody KuaishouItemCollectSamples kuaishouItemCollectSamples) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            Long id = kuaishouItemCollectSamples.getId();
+            if (Check.isNull(id)) {
+                throw new Exception("id不能为空");
+            }
+            Integer collectSampleStatus = kuaishouItemCollectSamples.getCollectSampleStatus();
+            if (!Check.isNull(collectSampleStatus)) {
+                if (collectSampleStatus == 2) {
+                    String collectSampleDesc = kuaishouItemCollectSamples.getCollectSampleDesc();
+                    if (Check.isNull(collectSampleDesc)) {
+                        kuaishouItemCollectSamples.setCollectSampleDesc("领样审核拒绝");
+                    }
+                }
+                if (collectSampleStatus == 3) {
+                    kuaishouItemCollectSamples.setCollectSampleDesc("待录入订单号");
+                }
+                if (collectSampleStatus == 5) { // 招商审核作业拒绝
+                    String collectSampleDesc = kuaishouItemCollectSamples.getCollectSampleDesc();
+                    if (Check.isNull(collectSampleDesc)) {
+                        kuaishouItemCollectSamples.setCollectSampleDesc("招商审核作业拒绝,请重新提交");
+                    }
+                }
+                if (collectSampleStatus == 7) { // 作业完成
+                    kuaishouItemCollectSamples.setCollectSampleDesc("作业已完成");
+                }
+            }
+
+            String courierNumber = kuaishouItemCollectSamples.getCourierNumber();
+            if (!Check.isNull(courierNumber)) {
+                kuaishouItemCollectSamples.setCollectSampleStatus(4);
+                kuaishouItemCollectSamples.setCollectSampleDesc("商品已发货");
+                // 调用快递接口
+                kuaishouItemCollectSamplesService.subscribe(id, courierNumber, kuaishouItemCollectSamples.getCompanyCode());
+            }
+            String taskFileUrl = kuaishouItemCollectSamples.getTaskFileUrl();
+            if (Check.isNull(taskFileUrl)) { // 作业上传成功
+                kuaishouItemCollectSamples.setCollectSampleStatus(6);
+                kuaishouItemCollectSamples.setCollectSampleDesc("作业上传成功,待招商审核");
+            }
+
+            kuaishouItemCollectSamplesService.updateKuaishouItemCollectSamples(kuaishouItemCollectSamples);
+            returnJson.put("code", 0);
+            returnJson.put("message", "修改成功");
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
+
+    @PutMapping("/testSubscribe")
+    public JSONObject testSubscribe(String phone, String courierNumber) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            SubscribeParameters subscribeParameters = new SubscribeParameters();
+            subscribeParameters.setCallbackurl("http://ruixuan.api.tjyourong.com.cn/itemCollectSamples/callback");
+            subscribeParameters.setPhone(phone);
+            SubscribeParam subscribeParam = new SubscribeParam();
+            subscribeParam.setParameters(subscribeParameters);
+            subscribeParam.setCompany(CompanyConstant.YD);
+            subscribeParam.setNumber(courierNumber);
+            subscribeParam.setKey("BPEQUJxB9244");
+            SubscribeReq subscribeReq = new SubscribeReq();
+            subscribeReq.setSchema(ApiInfoConstant.SUBSCRIBE_SCHEMA);
+            subscribeReq.setParam(new Gson().toJson(subscribeParam));
+            IBaseClient subscribe = new Subscribe();
+
+            JSONObject jsonObject = JSONObject.parseObject(subscribe.execute(subscribeReq).getBody());
+            System.err.println(jsonObject);
+            System.out.println(subscribe.execute(subscribeReq));
+            returnJson.put("code", 0);
+            returnJson.put("message", "调用成功");
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
+
+    @PostMapping("/callback")
+    public SubscribeResp callback(HttpServletRequest request) {
+        SubscribeResp subscribeResp = new SubscribeResp();
+
+        try {
+            String param = request.getParameter("param");
+            log.info("快递回调信息:{}", param);
+            JSONObject paramJson = JSONObject.parseObject(param);
+            if (Check.isNull(paramJson)) {
+                throw new Exception("回调信息为空");
+            }
+            JSONObject lastResult = paramJson.getJSONObject("lastResult");
+            if (!Check.isNull(lastResult)) {
+                String state = lastResult.getString("state");
+                String nu = lastResult.getString("nu");
+                String com = lastResult.getString("com");
+                if ("3".equals(state)) {
+                    KuaishouItemCollectSamples updateSample = new KuaishouItemCollectSamples();
+                    updateSample.setCourierNumber(nu);
+                    updateSample.setCollectSampleStatus(5);
+                    updateSample.setCollectSampleDesc("快递已签收,待上传作业");
+                  //  kuaishouItemCollectSamplesService.updateByNum(updateSample);
+                }
+                JSONArray data = lastResult.getJSONArray("data");
+                KuaishouItemCollectSampleExpress express = new KuaishouItemCollectSampleExpress();
+                express.setCourierNumber(nu);
+                express.setCom(com);
+                express.setState(state);
+                if (!Check.isNull(data)) {
+                    express.setExpressData(data.toJSONString());
+                }
+              //  kuaishouItemCollectSamplesService.replaceExpress(express);
+            }
+            subscribeResp.setResult(Boolean.TRUE);
+            subscribeResp.setReturnCode("200");
+            subscribeResp.setMessage("回调成功");
+
+        } catch (Exception e) {
+            subscribeResp.setResult(Boolean.FALSE);
+            subscribeResp.setReturnCode("-1");
+            subscribeResp.setMessage(e.getMessage());
+        }
+        return subscribeResp;
+    }
+
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('system:samples:remove')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(kuaishouItemCollectSamplesService.deleteKuaishouItemCollectSamplesByIds(ids));
+    }
+}
+

+ 190 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouItemListController.java

@@ -0,0 +1,190 @@
+package com.ruixuan.isc.controller;
+
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.servlet.http.HttpServletResponse;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.annotation.Log;
+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.enums.BusinessType;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.common.utils.DateUtils;
+import com.ruixuan.isc.entity.KuaishouItemList;
+import com.ruixuan.isc.service.IAccessTokenService;
+import com.ruixuan.isc.service.IKuaishouItemListService;
+import com.ruixuan.system.service.ISysDeptService;
+import com.ruixuan.system.service.ISysRoleService;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+
+/**
+ * 【请填写功能名称】Controller
+ *
+ * @author ruoyi
+ * @date 2023-02-03
+ */
+@RestController
+@RequestMapping("/item")
+public class KuaishouItemListController extends BaseController {
+    @Autowired
+    private IKuaishouItemListService kuaishouItemListService;
+    @Autowired
+    private ISysRoleService sysRoleService;
+    @Autowired
+    private ISysDeptService sysDeptService;
+    @Autowired
+    private IAccessTokenService accessTokenService;
+
+
+    @GetMapping("/accessToken")
+    @ApiOperation(value = "商品列表")
+    public void accessToken() {
+        // accessTokenService.getAccessToken();
+        //   accessTokenService.getCodeAccessToken();
+    }
+
+
+    @GetMapping("/getItemPreview")
+    @ApiOperation(value = "商品详情预览")
+    public JSONObject getItemPreview(
+            @ApiParam("活动ID") @RequestParam(value = "activityId", required = false) Long activityId,
+            @ApiParam("商品ID") @RequestParam(value = "itemId", required = false) Long itemId) {
+        JSONObject returnJson = new JSONObject();
+        try {
+
+            if (Check.isNull(activityId)) {
+                throw new Exception("请传入活动ID");
+            }
+
+            if (Check.isNull(itemId)) {
+                throw new Exception("请传入商品ID");
+            }
+            String accessToken = accessTokenService.getAccessToken();
+            if (Check.isNull(accessToken)) {
+                throw new Exception("获取token授权信息为空");
+            }
+            returnJson = kuaishouItemListService.getItemDetail(activityId, itemId, accessToken);
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+            // dataInfo.setCode(-1);
+        }
+        return returnJson;
+    }
+
+
+    @GetMapping("/list")
+    @ApiOperation(value = "商品列表")
+    public TableDataInfo orderList(
+            @ApiParam("用户id") @RequestParam(value = "userId", required = false) Long userId,
+            @ApiParam("审核状态") @RequestParam(value = "examineStatus", required = false) Long examineStatus) {
+        TableDataInfo dataInfo = new TableDataInfo();
+        try {
+            Map<String, Object> requestMap = new HashMap<>();
+            if (Check.isNull(userId)) {
+                throw new Exception("请传入userId");
+            }
+            String roleKey = sysRoleService.getRoleBYUserId(userId);
+            if (roleKey.equals("courtship")) {
+                requestMap.put("userId", userId);
+            } else if (roleKey.equals("courtshipManager")) {
+                Long deptId = sysDeptService.getDeptIdByUserId(userId);
+                if (Check.isNull(deptId)) {
+                    throw new Exception("此用户未获取相关部门");
+                }
+                List<Long> userIds = sysDeptService.getDeptUserListByDeptId(deptId);
+                requestMap.put("userIds", userIds);
+            }
+            if (!Check.isNull(examineStatus)) {
+                requestMap.put("examineStatus", examineStatus);
+            }
+            startPage();
+            List<KuaishouItemList> list = kuaishouItemListService.getItemList(requestMap);
+            dataInfo = getDataTable(list);
+        } catch (Exception e) {
+            dataInfo.setMsg(e.getMessage());
+            dataInfo.setCode(-1);
+        }
+        return dataInfo;
+    }
+
+
+    @GetMapping("/checkItem")
+    @ApiOperation(value = "检查此商品是否被绑定")
+    @PostMapping
+    public JSONObject checkItem(@RequestBody KuaishouItemList kuaishouItemList) {
+        JSONObject returnJson = new JSONObject();
+        try {
+            Long itemId = kuaishouItemList.getItemId();
+            if (Check.isNull(itemId)) {
+                throw new Exception("请传入商品ID");
+            }
+            KuaishouItemList itemInfo = kuaishouItemListService.getItemInfoByItemId(itemId);
+            if (Check.isNull(itemInfo)) {
+                returnJson.put("code", 0);
+                returnJson.put("message", "true");
+            } else {
+                returnJson.put("code", -1);
+                returnJson.put("message", "此商品已被:" + itemInfo.getUserName() + "绑定!");
+            }
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
+
+    @GetMapping("/insertItem")
+    @ApiOperation(value = "商品列表")
+    @PostMapping
+    public JSONObject insertItem(@RequestBody KuaishouItemList kuaishouItemList) {
+
+        JSONObject returnJson = new JSONObject();
+        try {
+            Long itemId = kuaishouItemList.getItemId();
+            if (Check.isNull(itemId)) {
+                throw new Exception("请传入商品ID");
+            }
+            kuaishouItemListService.insertItem(kuaishouItemList);
+            returnJson.put("code", 0);
+            returnJson.put("message", "添加成功");
+
+        } catch (Exception e) {
+            returnJson.put("code", -1);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+
+    }
+
+    /**
+     * 修改
+     */
+
+    @Log(title = "修改", businessType = BusinessType.UPDATE)
+    @PutMapping("/edit")
+    public AjaxResult edit(@RequestBody KuaishouItemList kuaishouItemList) {
+        return toAjax(kuaishouItemListService.updateKuaishouItemList(kuaishouItemList));
+    }
+
+    /**
+     * 删除
+     */
+
+    @Log(title = "删除", businessType = BusinessType.DELETE)
+    @DeleteMapping("/remove")
+    public AjaxResult remove(@PathVariable Long[] itemIds) {
+        return toAjax(kuaishouItemListService.deleteKuaishouItemListByItemIds(itemIds));
+    }
+}
+

+ 87 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouPromoterController.java

@@ -0,0 +1,87 @@
+package com.ruixuan.isc.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.isc.entity.KuaishouPromoter;
+import com.ruixuan.isc.service.IKuaishouPromoterService;
+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.DeleteMapping;
+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;
+
+/**
+ * 快手达人 信息Controller
+ *
+ * @author ruoyi
+ * @date 2023-02-03
+ */
+
+@Api(tags = "快手达人")
+@RestController
+@RequestMapping("/kuaishou/promoter")
+public class KuaishouPromoterController extends BaseController {
+    @Autowired
+    private IKuaishouPromoterService kuaishouPromoterService;
+
+    /**
+     * 查询快手达人 信息列表
+     */
+    @GetMapping("/list")
+    @ApiOperation(value = "查询快手达人")
+    public TableDataInfo list(@ApiParam("创建人ID") @RequestParam(value = "userId", required = true) Long userId,
+                              @ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) Long promoterId,
+                              @ApiParam("达人名称") @RequestParam(value = "promoterNickName", required = false) String promoterNickName) {
+        startPage();
+        List<KuaishouPromoter> list = kuaishouPromoterService.selectKuaishouPromoterList(userId, promoterId, promoterNickName);
+        return getDataTable(list);
+    }
+
+    /**
+     * 获取快手达人 信息详细信息
+     */
+    @GetMapping(value = "/getById")
+    @ApiOperation(value = "获取快手达人信息详细信息")
+    public AjaxResult getById(@ApiParam("主键") @RequestParam(value = "id", required = true) Long id) {
+        return AjaxResult.success(kuaishouPromoterService.selectKuaishouPromoterById(id));
+    }
+
+
+    /**
+     * 新增快手达人 信息
+     */
+    @PostMapping(value = "/add")
+    @ApiOperation(value = "新增快手达人")
+    public AjaxResult add(@RequestBody KuaishouPromoter kuaishouPromoter) {
+        return toAjax2(kuaishouPromoterService.insertKuaishouPromoter(kuaishouPromoter));
+    }
+
+    /**
+     * 修改快手达人 信息
+     */
+    @PostMapping(value = "/edit")
+    @ApiOperation(value = "修改快手达人")
+    public AjaxResult edit(@RequestBody KuaishouPromoter kuaishouPromoter) {
+        return toAjax(kuaishouPromoterService.updateKuaishouPromoter(kuaishouPromoter));
+    }
+
+    /**
+     * 删除快手达人 信息
+     */
+    @DeleteMapping("/{ids}")
+//    @ApiOperation(value = "删除快手达人")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(kuaishouPromoterService.deleteKuaishouPromoterByIds(ids));
+    }
+}

Разница между файлами не показана из-за своего большого размера
+ 1214 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/controller/SupplyChainController.java


+ 86 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouItemCollectSampleExpress.java

@@ -0,0 +1,86 @@
+package com.ruixuan.isc.entity;
+
+
+import com.ruixuan.common.annotation.Excel;
+import com.ruixuan.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+
+/**
+ * 【请填写功能名称】对象 kuaishou_item_collect_sample_express
+ *
+ * @author ruoyi
+ * @date 2023-02-10
+ */
+public class KuaishouItemCollectSampleExpress extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private String courierNumber;
+
+    /**
+     * 快递
+     */
+    @Excel(name = "快递")
+    private String com;
+
+    /**
+     * 状态 0在途,1揽收,2疑难,3签收,4退签,5派件,8清关,14拒签
+     */
+    @Excel(name = "状态 0在途,1揽收,2疑难,3签收,4退签,5派件,8清关,14拒签")
+    private String state;
+
+    /**
+     * 物流更新列表
+     */
+    @Excel(name = "物流更新列表")
+    private String expressData;
+
+    public void setCourierNumber(String courierNumber) {
+        this.courierNumber = courierNumber;
+    }
+
+    public String getCourierNumber() {
+        return courierNumber;
+    }
+
+    public void setCom(String com) {
+        this.com = com;
+    }
+
+    public String getCom() {
+        return com;
+    }
+
+    public void setState(String state) {
+        this.state = state;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setExpressData(String expressData) {
+        this.expressData = expressData;
+    }
+
+    public String getExpressData() {
+        return expressData;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("courierNumber", getCourierNumber())
+                .append("com", getCom())
+                .append("state", getState())
+                .append("expressData", getExpressData())
+                .append("createTime", getCreateTime())
+                .append("updateTime", getUpdateTime())
+                .toString();
+    }
+}
+

+ 352 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouItemCollectSamples.java

@@ -0,0 +1,352 @@
+package com.ruixuan.isc.entity;
+
+
+import com.ruixuan.common.annotation.Excel;
+import com.ruixuan.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.springframework.data.annotation.Transient;
+
+
+/**
+ * 【请填写功能名称】对象 kuaishou_item_collect_samples
+ *
+ * @author ruoyi
+ * @date 2023-02-08
+ */
+public class KuaishouItemCollectSamples extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 商品ID */
+    @Excel(name = "商品ID")
+    private Long itemId;
+
+    /** 商品标题 */
+    @Excel(name = "商品标题")
+    private String itemTitle;
+
+    /** 商品单价-分 */
+    @Excel(name = "商品单价-分")
+    private Long itemPrice;
+
+    /** 商品图片链接 */
+    @Excel(name = "商品图片链接")
+    private String itemMgUrl;
+
+    /** 商品备注 */
+    @Excel(name = "商品备注")
+    private String itemDesc;
+
+    /** 佣金比例 */
+    @Excel(name = "佣金比例")
+    private Long commissionRate;
+
+    /** 服务费 */
+    @Excel(name = "服务费")
+    private Long regimentalPromotion;
+
+    /** 领样数量 */
+    @Excel(name = "领样数量")
+    private Integer sampleCount;
+
+    /** 领样规则 */
+    @Excel(name = "领样规则")
+    private String sampleRequirement;
+
+    /** 商品创建人ID */
+    @Excel(name = "商品创建人ID")
+    private Long itemCreateId;
+
+    /** 商品创建人姓名 */
+    @Excel(name = "商品创建人姓名")
+    private String itemCreateName;
+
+    /** 领样人ID */
+    @Excel(name = "领样人ID")
+    private Long collectSampleId;
+
+    /** 领样人姓名 */
+    @Excel(name = "领样人姓名")
+    private String collectSampleName;
+
+    /** 手卡信息 */
+    @Excel(name = "手卡信息")
+    private String partnerRecommendText;
+
+    /** 达人id */
+    @Excel(name = "达人id")
+    private Long promoterId;
+
+    /** 达人昵称 */
+    @Excel(name = "达人昵称")
+    private String promoterNickName;
+
+    /** 达人手机号 */
+    @Excel(name = "达人手机号")
+    private String promoterPhone;
+
+    /** 达人收获地址 */
+    @Excel(name = "达人收获地址")
+    private String promoterAddress;
+    private String promoterUrl;
+
+    /** 快递单号 */
+    @Excel(name = "快递单号")
+    private String courierNumber;
+
+    /** 作业地址 */
+    @Excel(name = "作业地址")
+    private String taskFileUrl;
+
+    /** 1-待审核 2-领样申请审核拒绝 3-领样审核通过-待录入订单号 4-已发货 5-已签收待上传作业 6-作业上传成功待招商审核 7-审核通过 */
+    @Excel(name = "1-待审核 2-领样申请审核拒绝 3-领样审核通过-待录入订单号 4-已发货 5-已签收待上传作业 6-作业上传成功待招商审核 7-审核通过")
+    private Integer collectSampleStatus;
+
+    /** 状态备注 */
+    @Excel(name = "状态备注")
+    private String collectSampleDesc;
+
+
+    @Transient
+    private String companyCode;
+
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(Long itemId) {
+        this.itemId = itemId;
+    }
+
+    public String getItemTitle() {
+        return itemTitle;
+    }
+
+    public void setItemTitle(String itemTitle) {
+        this.itemTitle = itemTitle;
+    }
+
+    public Long getItemPrice() {
+        return itemPrice;
+    }
+
+    public void setItemPrice(Long itemPrice) {
+        this.itemPrice = itemPrice;
+    }
+
+    public String getItemMgUrl() {
+        return itemMgUrl;
+    }
+
+    public void setItemMgUrl(String itemMgUrl) {
+        this.itemMgUrl = itemMgUrl;
+    }
+
+    public String getItemDesc() {
+        return itemDesc;
+    }
+
+    public void setItemDesc(String itemDesc) {
+        this.itemDesc = itemDesc;
+    }
+
+    public Long getCommissionRate() {
+        return commissionRate;
+    }
+
+    public void setCommissionRate(Long commissionRate) {
+        this.commissionRate = commissionRate;
+    }
+
+    public Long getRegimentalPromotion() {
+        return regimentalPromotion;
+    }
+
+    public void setRegimentalPromotion(Long regimentalPromotion) {
+        this.regimentalPromotion = regimentalPromotion;
+    }
+
+    public Integer getSampleCount() {
+        return sampleCount;
+    }
+
+    public void setSampleCount(Integer sampleCount) {
+        this.sampleCount = sampleCount;
+    }
+
+    public String getSampleRequirement() {
+        return sampleRequirement;
+    }
+
+    public void setSampleRequirement(String sampleRequirement) {
+        this.sampleRequirement = sampleRequirement;
+    }
+
+    public Long getItemCreateId() {
+        return itemCreateId;
+    }
+
+    public void setItemCreateId(Long itemCreateId) {
+        this.itemCreateId = itemCreateId;
+    }
+
+    public String getItemCreateName() {
+        return itemCreateName;
+    }
+
+    public void setItemCreateName(String itemCreateName) {
+        this.itemCreateName = itemCreateName;
+    }
+
+    public Long getCollectSampleId() {
+        return collectSampleId;
+    }
+
+    public void setCollectSampleId(Long collectSampleId) {
+        this.collectSampleId = collectSampleId;
+    }
+
+    public String getCollectSampleName() {
+        return collectSampleName;
+    }
+
+    public void setCollectSampleName(String collectSampleName) {
+        this.collectSampleName = collectSampleName;
+    }
+
+    public String getPartnerRecommendText() {
+        return partnerRecommendText;
+    }
+
+    public void setPartnerRecommendText(String partnerRecommendText) {
+        this.partnerRecommendText = partnerRecommendText;
+    }
+
+    public Long getPromoterId() {
+        return promoterId;
+    }
+
+    public void setPromoterId(Long promoterId) {
+        this.promoterId = promoterId;
+    }
+
+    public String getPromoterNickName() {
+        return promoterNickName;
+    }
+
+    public void setPromoterNickName(String promoterNickName) {
+        this.promoterNickName = promoterNickName;
+    }
+
+    public String getPromoterPhone() {
+        return promoterPhone;
+    }
+
+    public void setPromoterPhone(String promoterPhone) {
+        this.promoterPhone = promoterPhone;
+    }
+
+    public String getPromoterAddress() {
+        return promoterAddress;
+    }
+
+    public void setPromoterAddress(String promoterAddress) {
+        this.promoterAddress = promoterAddress;
+    }
+
+    public String getPromoterUrl() {
+        return promoterUrl;
+    }
+
+    public void setPromoterUrl(String promoterUrl) {
+        this.promoterUrl = promoterUrl;
+    }
+
+    public String getCourierNumber() {
+        return courierNumber;
+    }
+
+    public void setCourierNumber(String courierNumber) {
+        this.courierNumber = courierNumber;
+    }
+
+    public String getTaskFileUrl() {
+        return taskFileUrl;
+    }
+
+    public void setTaskFileUrl(String taskFileUrl) {
+        this.taskFileUrl = taskFileUrl;
+    }
+
+    public Integer getCollectSampleStatus() {
+        return collectSampleStatus;
+    }
+
+    public void setCollectSampleStatus(Integer collectSampleStatus) {
+        this.collectSampleStatus = collectSampleStatus;
+    }
+
+    public String getCollectSampleDesc() {
+        return collectSampleDesc;
+    }
+
+    public void setCollectSampleDesc(String collectSampleDesc) {
+        this.collectSampleDesc = collectSampleDesc;
+    }
+
+    public String getCompanyCode() {
+        return companyCode;
+    }
+
+    public void setCompanyCode(String companyCode) {
+        this.companyCode = companyCode;
+    }
+
+    @Override
+    public String toString() {
+        return "KuaishouItemCollectSamples{" +
+                "id=" + id +
+                ", itemId=" + itemId +
+                ", itemTitle='" + itemTitle + '\'' +
+                ", itemPrice=" + itemPrice +
+                ", itemMgUrl='" + itemMgUrl + '\'' +
+                ", itemDesc='" + itemDesc + '\'' +
+                ", commissionRate=" + commissionRate +
+                ", regimentalPromotion=" + regimentalPromotion +
+                ", sampleCount=" + sampleCount +
+                ", sampleRequirement='" + sampleRequirement + '\'' +
+                ", itemCreateId=" + itemCreateId +
+                ", itemCreateName='" + itemCreateName + '\'' +
+                ", collectSampleId=" + collectSampleId +
+                ", collectSampleName='" + collectSampleName + '\'' +
+                ", partnerRecommendText='" + partnerRecommendText + '\'' +
+                ", promoterId=" + promoterId +
+                ", promoterNickName='" + promoterNickName + '\'' +
+                ", promoterPhone='" + promoterPhone + '\'' +
+                ", promoterAddress='" + promoterAddress + '\'' +
+                ", promoterUrl='" + promoterUrl + '\'' +
+                ", courierNumber='" + courierNumber + '\'' +
+                ", taskFileUrl='" + taskFileUrl + '\'' +
+                ", collectSampleStatus=" + collectSampleStatus +
+                ", collectSampleDesc='" + collectSampleDesc + '\'' +
+                ", companyCode='" + companyCode + '\'' +
+                '}';
+    }
+}

+ 603 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouItemList.java

@@ -0,0 +1,603 @@
+package com.ruixuan.isc.entity;
+
+import com.ruixuan.common.annotation.Excel;
+import com.ruixuan.common.core.domain.BaseEntity;
+
+public class KuaishouItemList extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 商品ID
+     */
+    private Long itemId;
+
+    /**
+     * 商品标题
+     */
+    @Excel(name = "商品标题")
+    private String itemTitle;
+
+    /**
+     * 商品单价-分
+     */
+    @Excel(name = "商品单价-分")
+    private Long itemPrice;
+
+    /**
+     * 商品备注
+     */
+    @Excel(name = "商品备注")
+    private String itemDesc;
+
+    /**
+     * 商品折扣价
+     */
+    @Excel(name = "商品折扣价")
+    private Long zkFinalPrice;
+
+    /**
+     * 商品图片链接
+     */
+    @Excel(name = "商品图片链接")
+    private String itemMgUrl;
+
+    /**
+     * 商品详情图
+     */
+    @Excel(name = "商品详情图")
+    private String itemDescUrls;
+
+    /**
+     * 小店星级
+     */
+    @Excel(name = "小店星级")
+    private String shoStar;
+
+    /**
+     * 品牌名称
+     */
+    @Excel(name = "品牌名称")
+    private String mallLogisticsScore;
+
+    /**
+     * 活动商品审核状态,1-待审核,2审核通过,3审核失败(拒绝),5失效
+     */
+    @Excel(name = "活动商品审核状态,1-待审核,2审核通过,3审核失败", readConverterExp = "拒=绝")
+    private Integer activityItemStatus;
+
+    /**
+     * 类目ID店铺评分
+     */
+    @Excel(name = "类目ID店铺评分")
+    private String shopScore;
+
+    /**
+     * 类目ID
+     */
+    @Excel(name = "类目ID")
+    private Long categoryId;
+
+    /**
+     * 类目
+     */
+    @Excel(name = "类目")
+    private String categoryName;
+
+    /**
+     * 轮播图列表
+     */
+    @Excel(name = "轮播图列表")
+    private String itemGalleryUrls;
+
+    /**
+     * 1-商家报名、2-团长报名
+     */
+    @Excel(name = "1-商家报名、2-团长报名")
+    private Integer identity;
+
+    /**
+     * 活动id
+     */
+    @Excel(name = "活动id")
+    private Long activityId;
+
+    /**
+     * 点名名称
+     */
+    @Excel(name = "点名名称")
+    private String shopTitle;
+
+    /**
+     * 佣金比例
+     */
+    @Excel(name = "佣金比例")
+    private Long commissionRate;
+
+    /**
+     * 店铺服务分
+     */
+    @Excel(name = "店铺服务分")
+    private String mallServiceScore;
+
+    /**
+     * 店铺质量分
+     */
+    @Excel(name = "店铺质量分")
+    private String mallQualityScore;
+
+    /**
+     * 商品规格ID
+     */
+    @Excel(name = "商品规格ID")
+    private Long skuId;
+
+    /**
+     * 商品规格名称
+     */
+    @Excel(name = "商品规格名称")
+    private String specification;
+
+    /**
+     * 商品规格库存
+     */
+    @Excel(name = "商品规格库存")
+    private Long skuStock;
+
+    /**
+     * 商品规格价格(分)
+     */
+    @Excel(name = "商品规格价格", readConverterExp = "分=")
+    private Long skuPrice;
+
+    /**
+     * 创建人id
+     */
+    @Excel(name = "创建人id")
+    private Long userId;
+
+    /**
+     * 创建人
+     */
+    @Excel(name = "创建人")
+    private String userName;
+
+    /**
+     * 审核人id
+     */
+    @Excel(name = "审核人id")
+    private Long examineId;
+
+    /**
+     * 审核人名称
+     */
+    @Excel(name = "审核人名称")
+    private String examineName;
+
+    /**
+     * 1待审核 2审核通过 3审核失败
+     */
+    @Excel(name = "1待审核 2审核通过 3审核失败")
+    private Integer examineStatus;
+
+    /**
+     * 审核拒绝原因
+     */
+    @Excel(name = "审核拒绝原因")
+    private String refuseDetail;
+
+    /**
+     * 发货地址
+     */
+    @Excel(name = "发货地址")
+    private String postArea;
+
+    /**
+     * 未发货地址
+     */
+    @Excel(name = "未发货地址")
+    private String noPostArea;
+
+    /**
+     * 服务费率
+     */
+    @Excel(name = "服务费率")
+    private Long regimentalPromotionRate;
+
+    /**
+     * 服务费
+     */
+    @Excel(name = "服务费")
+    private Long regimentalPromotion;
+
+    /**
+     * 样品数量
+     */
+    @Excel(name = "样品数量")
+    private Integer sampleCount;
+
+    /**
+     * 领样要求
+     */
+    @Excel(name = "领样要求")
+    private String sampleRequirement;
+
+    /**
+     * 发货率
+     */
+    @Excel(name = "发货率")
+    private String deliveryRate;
+
+    /**
+     * 手卡信息
+     */
+    @Excel(name = "手卡信息")
+    private String partnerRecommendText;
+
+    /**
+     * 商品相信信息
+     */
+    @Excel(name = "商品相信信息")
+    private String detailUrl;
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getItemId() {
+        return itemId;
+    }
+
+    public void setItemId(Long itemId) {
+        this.itemId = itemId;
+    }
+
+    public String getItemTitle() {
+        return itemTitle;
+    }
+
+    public void setItemTitle(String itemTitle) {
+        this.itemTitle = itemTitle;
+    }
+
+    public Long getItemPrice() {
+        return itemPrice;
+    }
+
+    public void setItemPrice(Long itemPrice) {
+        this.itemPrice = itemPrice;
+    }
+
+    public String getItemDesc() {
+        return itemDesc;
+    }
+
+    public void setItemDesc(String itemDesc) {
+        this.itemDesc = itemDesc;
+    }
+
+    public Long getZkFinalPrice() {
+        return zkFinalPrice;
+    }
+
+    public void setZkFinalPrice(Long zkFinalPrice) {
+        this.zkFinalPrice = zkFinalPrice;
+    }
+
+    public String getItemMgUrl() {
+        return itemMgUrl;
+    }
+
+    public void setItemMgUrl(String itemMgUrl) {
+        this.itemMgUrl = itemMgUrl;
+    }
+
+    public String getItemDescUrls() {
+        return itemDescUrls;
+    }
+
+    public void setItemDescUrls(String itemDescUrls) {
+        this.itemDescUrls = itemDescUrls;
+    }
+
+    public String getShoStar() {
+        return shoStar;
+    }
+
+    public void setShoStar(String shoStar) {
+        this.shoStar = shoStar;
+    }
+
+    public String getMallLogisticsScore() {
+        return mallLogisticsScore;
+    }
+
+    public void setMallLogisticsScore(String mallLogisticsScore) {
+        this.mallLogisticsScore = mallLogisticsScore;
+    }
+
+    public Integer getActivityItemStatus() {
+        return activityItemStatus;
+    }
+
+    public void setActivityItemStatus(Integer activityItemStatus) {
+        this.activityItemStatus = activityItemStatus;
+    }
+
+    public String getShopScore() {
+        return shopScore;
+    }
+
+    public void setShopScore(String shopScore) {
+        this.shopScore = shopScore;
+    }
+
+    public Long getCategoryId() {
+        return categoryId;
+    }
+
+    public void setCategoryId(Long categoryId) {
+        this.categoryId = categoryId;
+    }
+
+    public String getCategoryName() {
+        return categoryName;
+    }
+
+    public void setCategoryName(String categoryName) {
+        this.categoryName = categoryName;
+    }
+
+    public String getItemGalleryUrls() {
+        return itemGalleryUrls;
+    }
+
+    public void setItemGalleryUrls(String itemGalleryUrls) {
+        this.itemGalleryUrls = itemGalleryUrls;
+    }
+
+    public Integer getIdentity() {
+        return identity;
+    }
+
+    public void setIdentity(Integer identity) {
+        this.identity = identity;
+    }
+
+    public Long getActivityId() {
+        return activityId;
+    }
+
+    public void setActivityId(Long activityId) {
+        this.activityId = activityId;
+    }
+
+    public String getShopTitle() {
+        return shopTitle;
+    }
+
+    public void setShopTitle(String shopTitle) {
+        this.shopTitle = shopTitle;
+    }
+
+    public Long getCommissionRate() {
+        return commissionRate;
+    }
+
+    public void setCommissionRate(Long commissionRate) {
+        this.commissionRate = commissionRate;
+    }
+
+    public String getMallServiceScore() {
+        return mallServiceScore;
+    }
+
+    public void setMallServiceScore(String mallServiceScore) {
+        this.mallServiceScore = mallServiceScore;
+    }
+
+    public String getMallQualityScore() {
+        return mallQualityScore;
+    }
+
+    public void setMallQualityScore(String mallQualityScore) {
+        this.mallQualityScore = mallQualityScore;
+    }
+
+    public Long getSkuId() {
+        return skuId;
+    }
+
+    public void setSkuId(Long skuId) {
+        this.skuId = skuId;
+    }
+
+    public String getSpecification() {
+        return specification;
+    }
+
+    public void setSpecification(String specification) {
+        this.specification = specification;
+    }
+
+    public Long getSkuStock() {
+        return skuStock;
+    }
+
+    public void setSkuStock(Long skuStock) {
+        this.skuStock = skuStock;
+    }
+
+    public Long getSkuPrice() {
+        return skuPrice;
+    }
+
+    public void setSkuPrice(Long skuPrice) {
+        this.skuPrice = skuPrice;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Long getExamineId() {
+        return examineId;
+    }
+
+    public void setExamineId(Long examineId) {
+        this.examineId = examineId;
+    }
+
+    public String getExamineName() {
+        return examineName;
+    }
+
+    public void setExamineName(String examineName) {
+        this.examineName = examineName;
+    }
+
+    public Integer getExamineStatus() {
+        return examineStatus;
+    }
+
+    public void setExamineStatus(Integer examineStatus) {
+        this.examineStatus = examineStatus;
+    }
+
+    public String getRefuseDetail() {
+        return refuseDetail;
+    }
+
+    public void setRefuseDetail(String refuseDetail) {
+        this.refuseDetail = refuseDetail;
+    }
+
+    public String getPostArea() {
+        return postArea;
+    }
+
+    public void setPostArea(String postArea) {
+        this.postArea = postArea;
+    }
+
+    public String getNoPostArea() {
+        return noPostArea;
+    }
+
+    public void setNoPostArea(String noPostArea) {
+        this.noPostArea = noPostArea;
+    }
+
+    public Long getRegimentalPromotionRate() {
+        return regimentalPromotionRate;
+    }
+
+    public void setRegimentalPromotionRate(Long regimentalPromotionRate) {
+        this.regimentalPromotionRate = regimentalPromotionRate;
+    }
+
+    public Long getRegimentalPromotion() {
+        return regimentalPromotion;
+    }
+
+    public void setRegimentalPromotion(Long regimentalPromotion) {
+        this.regimentalPromotion = regimentalPromotion;
+    }
+
+    public Integer getSampleCount() {
+        return sampleCount;
+    }
+
+    public void setSampleCount(Integer sampleCount) {
+        this.sampleCount = sampleCount;
+    }
+
+    public String getSampleRequirement() {
+        return sampleRequirement;
+    }
+
+    public void setSampleRequirement(String sampleRequirement) {
+        this.sampleRequirement = sampleRequirement;
+    }
+
+    public String getDeliveryRate() {
+        return deliveryRate;
+    }
+
+    public void setDeliveryRate(String deliveryRate) {
+        this.deliveryRate = deliveryRate;
+    }
+
+    public String getPartnerRecommendText() {
+        return partnerRecommendText;
+    }
+
+    public void setPartnerRecommendText(String partnerRecommendText) {
+        this.partnerRecommendText = partnerRecommendText;
+    }
+
+    public String getDetailUrl() {
+        return detailUrl;
+    }
+
+    public void setDetailUrl(String detailUrl) {
+        this.detailUrl = detailUrl;
+    }
+
+    @Override
+    public String toString() {
+        return "KuaishouItemList{" +
+                "itemId=" + itemId +
+                ", itemTitle='" + itemTitle + '\'' +
+                ", itemPrice=" + itemPrice +
+                ", itemDesc='" + itemDesc + '\'' +
+                ", zkFinalPrice=" + zkFinalPrice +
+                ", itemMgUrl='" + itemMgUrl + '\'' +
+                ", itemDescUrls='" + itemDescUrls + '\'' +
+                ", shoStar='" + shoStar + '\'' +
+                ", mallLogisticsScore='" + mallLogisticsScore + '\'' +
+                ", activityItemStatus=" + activityItemStatus +
+                ", shopScore='" + shopScore + '\'' +
+                ", categoryId=" + categoryId +
+                ", categoryName='" + categoryName + '\'' +
+                ", itemGalleryUrls='" + itemGalleryUrls + '\'' +
+                ", identity=" + identity +
+                ", activityId=" + activityId +
+                ", shopTitle='" + shopTitle + '\'' +
+                ", commissionRate=" + commissionRate +
+                ", mallServiceScore='" + mallServiceScore + '\'' +
+                ", mallQualityScore='" + mallQualityScore + '\'' +
+                ", skuId=" + skuId +
+                ", specification='" + specification + '\'' +
+                ", skuStock=" + skuStock +
+                ", skuPrice=" + skuPrice +
+                ", userId=" + userId +
+                ", userName='" + userName + '\'' +
+                ", examineId=" + examineId +
+                ", examineName='" + examineName + '\'' +
+                ", examineStatus=" + examineStatus +
+                ", refuseDetail='" + refuseDetail + '\'' +
+                ", postArea='" + postArea + '\'' +
+                ", noPostArea='" + noPostArea + '\'' +
+                ", regimentalPromotionRate=" + regimentalPromotionRate +
+                ", regimentalPromotion=" + regimentalPromotion +
+                ", sampleCount=" + sampleCount +
+                ", sampleRequirement='" + sampleRequirement + '\'' +
+                ", deliveryRate='" + deliveryRate + '\'' +
+                ", partnerRecommendText='" + partnerRecommendText + '\'' +
+                ", detailUrl='" + detailUrl + '\'' +
+                '}';
+    }
+}

+ 127 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouPromoter.java

@@ -0,0 +1,127 @@
+package com.ruixuan.isc.entity;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 快手达人 信息对象 kuaishou_promoter
+ */
+@Data
+@ApiModel(value = "KuaishouPromoter", description = "快手达人")
+public class KuaishouPromoter {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 创建人ID
+     */
+    @ApiModelProperty(name = "创建人ID")
+    private Long userId;
+
+    /**
+     * 创建人名称
+     */
+    @ApiModelProperty(name = "创建人名称")
+    private String userName;
+
+    /**
+     * 达人id(快手lD)
+     */
+    @ApiModelProperty(name = "达人id(快手lD)")
+    private Long promoterId;
+
+    /**
+     * 达人昵称
+     */
+    @ApiModelProperty(name = "达人昵称")
+    private String promoterNickName;
+
+    /**
+     * 达人状态:1-生效,0-无效
+     */
+    @ApiModelProperty(name = "达人状态:1-生效,0-无效")
+    private String state;
+
+    /**
+     * 省市
+     */
+    @ApiModelProperty(name = "省市")
+    private String province;
+
+    /**
+     * 佣金要求
+     */
+    @ApiModelProperty(name = "佣金要求")
+    private String commissionRequirement;
+
+    /**
+     * 品类要求
+     */
+    @ApiModelProperty(name = "品类要求")
+    private String categoryRequirement;
+    /**
+     * 收货人
+     */
+    @ApiModelProperty(name = "收货人")
+    private String consignee;
+
+    /**
+     * 联系电话
+     */
+    @ApiModelProperty(name = "联系电话")
+    private String phone;
+    /**
+     * 总销售额
+     */
+    @ApiModelProperty(name = "总销售额")
+    private String totalSale;
+    /**
+     * 粉丝数
+     */
+    @ApiModelProperty(name = "粉丝数")
+    private String fansNumber;
+
+    /**
+     * 发货地址
+     */
+    @ApiModelProperty(name = "发货地址")
+    private String promoterAddress;
+
+    /**
+     * 达人头像链接
+     */
+    @ApiModelProperty(name = "达人头像")
+    private String promoterUrl;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    public KuaishouPromoter() {
+    }
+
+    public KuaishouPromoter(Long id, String promoterNickName, String province, String promoterUrl, String fansNumber, String totalSale) {
+        this.id = id;
+        this.promoterNickName = promoterNickName;
+        this.province = province;
+        this.promoterUrl = promoterUrl;
+        this.fansNumber = fansNumber;
+        this.totalSale = totalSale;
+    }
+}

+ 55 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/enums/CompanyEnum.java

@@ -0,0 +1,55 @@
+package com.ruixuan.isc.enums;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public enum CompanyEnum {
+    yuantong("yuantong", "圆通速递"),
+    yunda("yunda", "韵达快递"),
+    zhongtong("zhongtong", "中通快递"),
+    shentong("shentong", "申通快递"),
+    jtexpress("jtexpress", "极兔速递"),
+    youzhengguonei("youzhengguonei", "邮政快递包裹"),
+    shunfeng("shunfeng", "顺丰速运"),
+    ems("ems", "EMS"),
+    jd("jd", "京东物流"),
+    youzhengbk("youzhengbk", "邮政标准快递"),
+    fengwang("fengwang", "丰网速运"),
+    debangkuaidi("debangkuaidi", "德邦快递"),
+    debangwuliu("debangwuliu", "德邦"),
+    zhongtongkuaiyun("zhongtongkuaiyun", "中通快运"),
+    jingdongkuaiyun("jingdongkuaiyun", "京东快运"),
+    tiantian("tiantian", "天天快递"),
+    huitongkuaidi("huitongkuaidi", "百世快递");
+
+
+    private String code;
+    private String name;
+
+
+    private CompanyEnum(String code, String name) {
+        this.name = name;
+        this.code = code;
+    }
+
+    public static List<JSONObject> companyList() {
+        List<JSONObject> list = new ArrayList<>();
+        for (CompanyEnum em : CompanyEnum.values()) {
+            JSONObject json = new JSONObject();
+            json.put("name", em.getName());
+            json.put("code", em.getCode());
+            list.add(json);
+        }
+        return list;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+}

+ 5 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/AccessTokenMapper.java

@@ -0,0 +1,5 @@
+package com.ruixuan.isc.mapper;
+
+public interface AccessTokenMapper {
+    String getAccessToken();
+}

+ 82 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouItemCollectSamplesMapper.java

@@ -0,0 +1,82 @@
+package com.ruixuan.isc.mapper;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.isc.entity.KuaishouItemCollectSampleExpress;
+import com.ruixuan.isc.entity.KuaishouItemCollectSamples;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author ruoyi
+ * @date 2023-02-08
+ */
+public interface KuaishouItemCollectSamplesMapper
+{
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public KuaishouItemCollectSamples selectKuaishouItemCollectSamplesById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param requestMap 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<KuaishouItemCollectSamples> selectKuaishouItemCollectSamplesList(Map<String,Object> requestMap);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param kuaishouItemCollectSamples 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertKuaishouItemCollectSamples(KuaishouItemCollectSamples kuaishouItemCollectSamples);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param kuaishouItemCollectSamples 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateKuaishouItemCollectSamples(KuaishouItemCollectSamples kuaishouItemCollectSamples);
+
+    /**
+     * 删除【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteKuaishouItemCollectSamplesById(Long id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouItemCollectSamplesByIds(Long[] ids);
+
+    List<JSONObject> getItemList(JSONArray itemIds);
+
+    List<JSONObject> promoterList(JSONArray promoterIds);
+
+    Integer check(@Param("itemId") Long itemId,@Param("promoterId") Long promoterId);
+
+    void batchAdd(@Param(value = "adds") List<KuaishouItemCollectSamples> adds);
+
+    void KuaishouItemCollectSamples(KuaishouItemCollectSamples updateSample);
+
+    void replaceExpress(KuaishouItemCollectSampleExpress express);
+}
+

+ 28 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouItemListMapper.java

@@ -0,0 +1,28 @@
+package com.ruixuan.isc.mapper;
+
+
+import com.ruixuan.isc.entity.KuaishouItemList;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author ruoyi
+ * @date 2023-02-03
+ */
+public interface KuaishouItemListMapper {
+
+    List<KuaishouItemList> getItemList( Map<String, Object> requestMap);
+
+    KuaishouItemList getItemInfoByItemId(Long itemId);
+
+    void insertItem(KuaishouItemList kuaishouItemList);
+
+    int updateKuaishouItemList(KuaishouItemList kuaishouItemList);
+
+    int deleteKuaishouItemListByItemIds(Long[] itemIds);
+}
+

+ 58 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouPromoterMapper.java

@@ -0,0 +1,58 @@
+package com.ruixuan.isc.mapper;
+
+import com.ruixuan.isc.entity.KuaishouPromoter;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface KuaishouPromoterMapper {
+    /**
+     * 查询快手达人 信息
+     *
+     * @param id 快手达人 信息主键
+     * @return 快手达人 信息
+     */
+    public KuaishouPromoter selectKuaishouPromoterById(Long id);
+
+    /**
+     * 查询快手达人 信息列表
+     *
+     * @param kuaishouPromoter 快手达人 信息
+     * @return 快手达人 信息集合
+     */
+    public List<KuaishouPromoter> selectKuaishouPromoterList(@Param("userList") List<Long> userList, @Param("promoterId") Long promoterId, @Param("promoterNickName") String promoterNickName);
+
+    /**
+     * 新增快手达人 信息
+     *
+     * @param kuaishouPromoter 快手达人 信息
+     * @return 结果
+     */
+    public int insertKuaishouPromoter(KuaishouPromoter kuaishouPromoter);
+
+    /**
+     * 修改快手达人 信息
+     *
+     * @param kuaishouPromoter 快手达人 信息
+     * @return 结果
+     */
+    public int updateKuaishouPromoter(KuaishouPromoter kuaishouPromoter);
+
+    /**
+     * 删除快手达人 信息
+     *
+     * @param id 快手达人 信息主键
+     * @return 结果
+     */
+    public int deleteKuaishouPromoterById(Long id);
+
+    /**
+     * 批量删除快手达人 信息
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouPromoterByIds(Long[] ids);
+
+    KuaishouPromoter getOneByIdAndPromoterId(@Param("userId") Long userId, @Param("promoterId") Long promoterId);
+}

+ 73 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/SupplyChainMapper.java

@@ -0,0 +1,73 @@
+package com.ruixuan.isc.mapper;
+
+import com.alibaba.fastjson.JSONObject;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+public interface SupplyChainMapper {
+    List<JSONObject> getOrderList(Map<String, Object> requestMap);
+
+    List<JSONObject> getTopOrders(Map<String, Object> requestMap);
+
+    List<JSONObject> anchorOrderDetail(Map<String, Object> requestMap);
+
+    List<JSONObject> orderStatistics(Map<String, Object> requestMap);
+
+    List<JSONObject> itemList(Map<String, Object> requestMap);
+
+    List<JSONObject> getTopAnchors(Map<String, Object> requestMap);
+
+    List<JSONObject> itemDetail(Map<String, Object> requestMap);
+
+    List<JSONObject> itemServiceCharge(Map<String, Object> requestMap);
+
+    JSONObject getOrderTotal(Map<String, Object> requestMap);
+
+    Double getOrderTotalRatio(Map<String, Object> ratioMap);
+
+    JSONObject getAmountTotal(Map<String, Object> requestMap);
+
+    Double getAmountTotalRatio(Map<String, Object> ratioMap);
+
+    JSONObject getServiceAmountTotal(Map<String, Object> ratioMap);
+
+    List<JSONObject> getOrderRankRatioList(Map<String, Object> requestMap);
+
+    List<JSONObject> getOrderRankList(Map<String, Object> requestMap);
+
+    List<JSONObject> getPromoterRankRatioList(Map<String, Object> requestMap);
+
+    List<JSONObject> getPromoterRatioList(Map<String, Object> requestMap);
+
+    List<JSONObject> exportPromoterTotal(Map<String, Object> requestMap);
+
+    List<JSONObject> exportPromoter(Map<String, Object> requestMap);
+
+    List<JSONObject> exportOrder(Map<String, Object> requestMap);
+
+    List<JSONObject> getTopPromoterByItemId(Map<String, Object> requestMap);
+
+    List<JSONObject> bindUserItemList(Map<String, Object> requestMap);
+
+    List<JSONObject> getSupplyChainUserList();
+
+    boolean unbindUser(@Param("itemId") Long itemId);
+
+    boolean bindUser(@Param("itemId") Long itemId, @Param("userId") Long userId, @Param("nikeName") String nikeName);
+
+    List<JSONObject> adminReportList(Map<String, Object> requestMap);
+
+    List<JSONObject> userItemDetail(Map<String, Object> requestMap);
+
+    JSONObject getTimeIntervalRatio(Map<String, Object> requestMap);
+
+    List<JSONObject> indexStatistics(Map<String, Object> requestMap);
+
+    JSONObject itemBindSummary();
+
+    JSONObject userItemTotal(Map<String, Object> requestMap);
+
+    List<JSONObject> exportUserItemDetail(Map<String, Object> requestMap);
+}

+ 8 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/IAccessTokenService.java

@@ -0,0 +1,8 @@
+package com.ruixuan.isc.service;
+
+public interface IAccessTokenService {
+
+    String getAccessToken();
+
+    void refreshAccessToken();
+}

+ 80 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouItemCollectSamplesService.java

@@ -0,0 +1,80 @@
+package com.ruixuan.isc.service;
+
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.isc.entity.KuaishouItemCollectSampleExpress;
+import com.ruixuan.isc.entity.KuaishouItemCollectSamples;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author ruoyi
+ * @date 2023-02-08
+ */
+public interface IKuaishouItemCollectSamplesService
+{
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public KuaishouItemCollectSamples selectKuaishouItemCollectSamplesById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @return 【请填写功能名称】集合
+     */
+    public List<KuaishouItemCollectSamples> selectKuaishouItemCollectSamplesList(Map<String,Object> requestMap);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param kuaishouItemCollectSamples 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertKuaishouItemCollectSamples(KuaishouItemCollectSamples kuaishouItemCollectSamples);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param kuaishouItemCollectSamples 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateKuaishouItemCollectSamples(KuaishouItemCollectSamples kuaishouItemCollectSamples);
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouItemCollectSamplesByIds(Long[] ids);
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteKuaishouItemCollectSamplesById(Long id);
+
+
+    JSONObject preview(Long userId, String nickName, JSONArray itemIds, JSONArray promoterIds);
+
+    void batchAdd(JSONArray temCollectSamples);
+
+    void subscribe(Long id, String courierNumber,String code) throws Exception;
+
+    void updateByNum(KuaishouItemCollectSamples updateSample);
+
+    void replaceExpress(KuaishouItemCollectSampleExpress express);
+}
+

+ 33 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouItemListService.java

@@ -0,0 +1,33 @@
+package com.ruixuan.isc.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.kuaishou.merchant.open.api.KsMerchantApiException;
+import com.ruixuan.isc.entity.KuaishouItemList;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IKuaishouItemListService {
+
+    List<KuaishouItemList> getItemList(Map<String, Object> requestMap);
+
+    /**
+     * 获取商品详情信息
+     *
+     * @param activityId
+     * @param itemId
+     * @param accessToken
+     * @return
+     */
+    JSONObject getItemDetail(Long activityId, Long itemId, String accessToken) throws Exception;
+
+    KuaishouItemList getItemInfoByItemId(Long itemId);
+
+    void insertItem(KuaishouItemList kuaishouItemList);
+
+
+    int updateKuaishouItemList(KuaishouItemList kuaishouItemList);
+
+    int deleteKuaishouItemListByItemIds(Long[] itemIds);
+}
+

+ 63 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouPromoterService.java

@@ -0,0 +1,63 @@
+package com.ruixuan.isc.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.isc.entity.KuaishouPromoter;
+
+import java.util.List;
+
+/**
+ * 快手达人 信息Service接口
+ *
+ * @author ruoyi
+ * @date 2023-02-03
+ */
+public interface IKuaishouPromoterService {
+    /**
+     * 查询快手达人 信息
+     *
+     * @param id 快手达人 信息主键
+     * @return 快手达人 信息
+     */
+    public JSONObject selectKuaishouPromoterById(Long id);
+
+    /**
+     * 查询快手达人 信息列表
+     *
+     * @param kuaishouPromoter 快手达人 信息
+     * @return 快手达人 信息集合
+     */
+    public List<KuaishouPromoter> selectKuaishouPromoterList(Long userId, Long promoterId, String promoterNickName);
+
+    /**
+     * 新增快手达人 信息
+     *
+     * @param kuaishouPromoter 快手达人 信息
+     * @return 结果
+     */
+    public int insertKuaishouPromoter(KuaishouPromoter kuaishouPromoter);
+
+    /**
+     * 修改快手达人 信息
+     *
+     * @param kuaishouPromoter 快手达人 信息
+     * @return 结果
+     */
+    public int updateKuaishouPromoter(KuaishouPromoter kuaishouPromoter);
+
+    /**
+     * 批量删除快手达人 信息
+     *
+     * @param ids 需要删除的快手达人 信息主键集合
+     * @return 结果
+     */
+    public int deleteKuaishouPromoterByIds(Long[] ids);
+
+    /**
+     * 删除快手达人 信息信息
+     *
+     * @param id 快手达人 信息主键
+     * @return 结果
+     */
+    public int deleteKuaishouPromoterById(Long id);
+
+}

+ 98 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/ISupplyChainService.java

@@ -0,0 +1,98 @@
+package com.ruixuan.isc.service;
+
+import com.alibaba.fastjson.JSONObject;
+
+import java.util.List;
+import java.util.Map;
+
+public interface ISupplyChainService {
+    // 获取订单数据
+    List<JSONObject> getOrderList(Map<String, Object> requestMap);
+
+    //达人带货详情
+    List<JSONObject> anchorOrderDetail(Map<String, Object> requestMap);
+
+    //订单统计
+    List<JSONObject> orderStatistics(Map<String, Object> requestMap);
+
+    //商品列表
+    List<JSONObject> itemList(Map<String, Object> requestMap);
+
+    //商品详情
+    List<JSONObject> itemDetail(Map<String, Object> requestMap);
+
+    //商品服务费
+    List<JSONObject> itemServiceCharge(Map<String, Object> requestMap);
+
+    //首页-订单数量查询
+    JSONObject getOrderTotal(Map<String, Object> requestMap);
+
+    // 首页-订单数量环比
+    Double getOrderTotalRatio(Map<String, Object> ratioMap);
+
+    // 首页-金额数据
+    JSONObject getAmountTotal(Map<String, Object> requestMap);
+
+    // 首页-金额数据环比
+    Double getAmountTotalRatio(Map<String, Object> ratioMap);
+
+    //首页-服务费数据
+    JSONObject getServiceAmountTotal(Map<String, Object> requestMap);
+
+    //首页-订单排行(环比)
+    List<JSONObject> getOrderRankRatioList(Map<String, Object> requestMap);
+
+    //首页-订单排行(无环比)
+    List<JSONObject> getOrderRankList(Map<String, Object> requestMap);
+
+    //首页-达人排行(环比)
+    List<JSONObject> getPromoterRankRatioList(Map<String, Object> requestMap);
+
+    //首页-达人排行(无环比)
+    List<JSONObject> getPromoterRatioList(Map<String, Object> requestMap);
+
+    // 一级页面达人数据
+    List<JSONObject> exportPromoterTotal(Map<String, Object> requestMap);
+
+    // 达人数据导出
+    List<JSONObject> exportPromoter(Map<String, Object> requestMap);
+
+    //订单数据导出
+    List<JSONObject> exportOrder(Map<String, Object> requestMap);
+
+    //根据商品ID获取top达人
+    List<JSONObject> getTopPromoterByItemId(Map<String, Object> requestMap);
+
+    //商品认领列表
+    List<JSONObject> bindUserItemList(Map<String, Object> requestMap);
+
+    // 获取供应链人员列表
+    List<JSONObject> getSupplyChainUserList();
+
+    // 商品解绑
+    boolean unbindUser(Long itemId);
+
+    // 商品绑定
+    boolean bindUser(Long itemId, Long userId, String nikeName);
+
+    //供应链管理员统计列表
+    List<JSONObject> adminReportList(Map<String, Object> requestMap);
+
+    // 认领商品列表
+    List<JSONObject> userItemDetail(Map<String, Object> requestMap);
+
+    // 获取时段数据对比
+    JSONObject getTimeIntervalRatio(Map<String, Object> requestMap);
+
+    // 首页-曲线图
+    List<JSONObject> indexStatistics(Map<String, Object> requestMap);
+
+    // 商品热认领汇总
+    JSONObject itemBindSummary();
+
+    // 商品绑定人员汇总
+    JSONObject userItemTotal(Map<String, Object> requestMap);
+
+    //认领列表导出
+    List<JSONObject> exportUserItemDetail(Map<String, Object> requestMap);
+}

+ 60 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/AccessTokenServiceImpl.java

@@ -0,0 +1,60 @@
+package com.ruixuan.isc.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.kuaishou.merchant.open.api.KsMerchantApiException;
+import com.kuaishou.merchant.open.api.client.oauth.OauthAccessTokenKsClient;
+import com.kuaishou.merchant.open.api.client.oauth.OauthCredentialKsClient;
+import com.kuaishou.merchant.open.api.response.oauth.KsAccessTokenResponse;
+import com.kuaishou.merchant.open.api.response.oauth.KsCredentialResponse;
+import com.ruixuan.common.utils.RedisUtil;
+import com.ruixuan.isc.mapper.AccessTokenMapper;
+import com.ruixuan.isc.service.IAccessTokenService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AccessTokenServiceImpl implements IAccessTokenService {
+    @Autowired
+    private AccessTokenMapper accessTokenMapper;
+
+
+    @Override
+    public String getAccessToken() {
+        return accessTokenMapper.getAccessToken();
+    }
+
+    @Override
+    public void refreshAccessToken() {
+        String appKey = "ks665688320292774929";
+        String appSecret = "3qAsvwcUYuHFVpxJ_OTSFg";
+        String grantCode = "86e73c07a93aa4434335c4d3e9a1773d6bcb573ec65b965a7251749c8b856990f845a095";
+        //    String serverRestUrl = "open.distribution.investment.activity.item.detail";
+
+/*        OauthAccessTokenKsClient oauthAccessTokenKsClient
+                = new OauthAccessTokenKsClient(appKey, appSecret, serverRestUrl);*/
+
+        OauthAccessTokenKsClient oauthAccessTokenKsClient
+                = new OauthAccessTokenKsClient(appKey, appSecret);
+
+// 生成AccessToken
+        try {
+            KsAccessTokenResponse response
+                    = oauthAccessTokenKsClient.getAccessToken(grantCode);
+            System.out.println(JSON.toJSONString(response));
+        } catch (KsMerchantApiException e) {
+            e.printStackTrace();
+        }
+
+        String refreshToken = "your app refreshToken";
+
+// 刷新AccessToken
+      /*  try {
+            KsAccessTokenResponse response
+                    = oauthAccessTokenKsClient.refreshAccessToken(refreshToken);
+            System.out.println(JSON.toJSONString(response));
+        } catch (KsMerchantApiException e) {
+            e.printStackTrace();
+        }*/
+    }
+}

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

@@ -0,0 +1,240 @@
+package com.ruixuan.isc.service.impl;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.google.gson.Gson;
+import com.kuaidi100.sdk.api.Subscribe;
+import com.kuaidi100.sdk.contant.ApiInfoConstant;
+import com.kuaidi100.sdk.contant.CompanyConstant;
+import com.kuaidi100.sdk.core.IBaseClient;
+import com.kuaidi100.sdk.pojo.HttpResult;
+import com.kuaidi100.sdk.request.SubscribeParam;
+import com.kuaidi100.sdk.request.SubscribeParameters;
+import com.kuaidi100.sdk.request.SubscribeReq;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.common.utils.DateUtils;
+import com.ruixuan.isc.entity.KuaishouItemCollectSampleExpress;
+import com.ruixuan.isc.entity.KuaishouItemCollectSamples;
+import com.ruixuan.isc.mapper.KuaishouItemCollectSamplesMapper;
+import com.ruixuan.isc.service.IKuaishouItemCollectSamplesService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-02-08
+ */
+@Service
+public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemCollectSamplesService {
+    @Autowired
+    private KuaishouItemCollectSamplesMapper kuaishouItemCollectSamplesMapper;
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public KuaishouItemCollectSamples selectKuaishouItemCollectSamplesById(Long id) {
+        return kuaishouItemCollectSamplesMapper.selectKuaishouItemCollectSamplesById(id);
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param requestMap 【请填写功能名称】
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public List<KuaishouItemCollectSamples> selectKuaishouItemCollectSamplesList(Map<String, Object> requestMap) {
+        return kuaishouItemCollectSamplesMapper.selectKuaishouItemCollectSamplesList(requestMap);
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param kuaishouItemCollectSamples 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int insertKuaishouItemCollectSamples(KuaishouItemCollectSamples kuaishouItemCollectSamples) {
+        kuaishouItemCollectSamples.setCreateTime(DateUtils.getNowDate());
+        return kuaishouItemCollectSamplesMapper.insertKuaishouItemCollectSamples(kuaishouItemCollectSamples);
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param kuaishouItemCollectSamples 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int updateKuaishouItemCollectSamples(KuaishouItemCollectSamples kuaishouItemCollectSamples) {
+        kuaishouItemCollectSamples.setUpdateTime(DateUtils.getNowDate());
+        return kuaishouItemCollectSamplesMapper.updateKuaishouItemCollectSamples(kuaishouItemCollectSamples);
+    }
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouItemCollectSamplesByIds(Long[] ids) {
+        return kuaishouItemCollectSamplesMapper.deleteKuaishouItemCollectSamplesByIds(ids);
+    }
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouItemCollectSamplesById(Long id) {
+        return kuaishouItemCollectSamplesMapper.deleteKuaishouItemCollectSamplesById(id);
+    }
+
+    @Override
+    public JSONObject preview(Long userId, String nickName, JSONArray itemIds, JSONArray promoterIds) {
+        JSONObject previewJson = new JSONObject();
+        List<JSONObject> itemList = kuaishouItemCollectSamplesMapper.getItemList(itemIds);
+        Map<Long, JSONObject> itemMap = new HashMap<>();
+        for (int i = 0; i < itemList.size(); i++) {
+            JSONObject itemJson = itemList.get(i);
+            itemMap.put(itemJson.getLong("itemId"), itemJson);
+        }
+        Map<Long, JSONObject> promoterMap = new HashMap<>();
+        List<JSONObject> promoterList = kuaishouItemCollectSamplesMapper.promoterList(promoterIds);
+        for (int i = 0; i < promoterList.size(); i++) {
+            JSONObject promoterJson = promoterList.get(i);
+            promoterMap.put(promoterJson.getLong("promoterId"), promoterJson);
+        }
+        Integer sampleReceivedCount = 0;
+        List<JSONObject> samples = new ArrayList<>();
+        for (int i = 0; i < itemIds.size(); i++) {
+            Long itemId = itemIds.getLong(i);
+            JSONObject itemJson = itemMap.get(itemId);
+            for (int j = 0; j < promoterIds.size(); j++) {
+                Long promoterId = promoterIds.getLong(j);
+                Integer count = kuaishouItemCollectSamplesMapper.check(itemId, promoterId);
+                if (count > 0) {
+                    sampleReceivedCount++;
+                    continue;
+                }
+                JSONObject sampleJson = new JSONObject();
+                sampleJson.put("itemId", itemJson.getLong("itemId"));
+                sampleJson.put("itemTitle", itemJson.getLong("itemTitle"));
+                sampleJson.put("itemPrice", itemJson.getLong("itemPrice"));
+                sampleJson.put("itemMgUrl", itemJson.getString("itemMgUrl"));
+                sampleJson.put("commissionRate", itemJson.getLong("commissionRate"));
+                sampleJson.put("regimentalPromotion", itemJson.getLong("regimentalPromotion"));
+                sampleJson.put("itemCreateId", itemJson.getLong("userId"));
+                sampleJson.put("itemCreateName", itemJson.getString("userName"));
+                sampleJson.put("collectSampleId", userId);
+                sampleJson.put("collectSampleName", nickName);
+                JSONObject promoterJson = promoterMap.get(promoterId);
+                sampleJson.put("promoterId", promoterJson.getLong("promoterId"));
+                sampleJson.put("promoterNickName", promoterJson.getString("promoterNickName"));
+                sampleJson.put("promoterPhone", promoterJson.getString("promoterPhone"));
+                sampleJson.put("promoterAddress", promoterJson.getString("promoterAddress"));
+                sampleJson.put("promoterUrl", promoterJson.getString("promoterUrl"));
+                sampleJson.put("collectSampleStatus", 1);
+                sampleJson.put("collectSampleDesc", "待招商审核");
+                samples.add(sampleJson);
+            }
+            previewJson.put("sampleReceivedCount", sampleReceivedCount);
+            previewJson.put("samples", samples);
+        }
+
+
+        return previewJson;
+    }
+
+    @Override
+    public void batchAdd(JSONArray temCollectSamples) {
+
+        List<KuaishouItemCollectSamples> adds = new ArrayList<>();
+        for (int i = 0; i < temCollectSamples.size(); i++) {
+            JSONObject sampleJson = temCollectSamples.getJSONObject(i);
+            KuaishouItemCollectSamples sample = new KuaishouItemCollectSamples();
+            sample.setItemId(sampleJson.getLong("item_id"));
+            sample.setItemTitle(sampleJson.getString("item_title"));
+            sample.setItemPrice(sampleJson.getLong("item_price"));
+            sample.setItemMgUrl(sampleJson.getString("item_mg_url"));
+            sample.setItemDesc(sampleJson.getString("item_desc"));
+            sample.setCommissionRate(sampleJson.getLong("commission_rate"));
+            sample.setRegimentalPromotion(sampleJson.getLong("regimental_promotion"));
+            sample.setSampleCount(sampleJson.getInteger("sample_count"));
+            sample.setSampleRequirement(sampleJson.getString("sample_requirement"));
+            sample.setItemId(sampleJson.getLong("item_create_id"));
+            sample.setItemCreateName(sampleJson.getString("item_create_name"));
+            sample.setCollectSampleId(sampleJson.getLong("collect_sample_id"));
+            sample.setCollectSampleName(sampleJson.getString("collect_sample_name"));
+            sample.setPartnerRecommendText(sampleJson.getString("partner_recommend_text"));
+            sample.setPromoterId(sampleJson.getLong("promoter_id"));
+            sample.setPromoterPhone(sampleJson.getString("promoter_phone"));
+            sample.setPromoterAddress(sampleJson.getString("promoter_address"));
+            sample.setCollectSampleStatus(sampleJson.getInteger("collect_sample_status"));
+            sample.setCollectSampleDesc(sampleJson.getString("collect_sample_desc"));
+            adds.add(sample);
+        }
+        if (!Check.isNull(adds)) {
+            kuaishouItemCollectSamplesMapper.batchAdd(adds);
+        }
+
+    }
+
+    @Override
+    public void subscribe(Long id, String courierNumber, String code) throws Exception {
+
+        KuaishouItemCollectSamples samples = kuaishouItemCollectSamplesMapper.selectKuaishouItemCollectSamplesById(id);
+        SubscribeParameters subscribeParameters = new SubscribeParameters();
+        subscribeParameters.setCallbackurl("http://ruixuan.api.tjyourong.com.cn/itemCollectSamples/callback");
+        subscribeParameters.setPhone(samples.getPromoterPhone());
+        SubscribeParam subscribeParam = new SubscribeParam();
+        subscribeParam.setParameters(subscribeParameters);
+        subscribeParam.setCompany(code);
+        subscribeParam.setNumber(courierNumber);
+        subscribeParam.setKey("BPEQUJxB9244");
+        SubscribeReq subscribeReq = new SubscribeReq();
+        subscribeReq.setSchema(ApiInfoConstant.SUBSCRIBE_SCHEMA);
+        subscribeReq.setParam(new Gson().toJson(subscribeParam));
+        IBaseClient subscribe = new Subscribe();
+        JSONObject jsonObject = JSONObject.parseObject(subscribe.execute(subscribeReq).getBody());
+        String returnCode = jsonObject.getString("returnCode");
+        KuaishouItemCollectSamples updateSample = new KuaishouItemCollectSamples();
+        updateSample.setId(id);
+        if ("200".equals(returnCode)) {
+            updateSample.setCollectSampleDesc("快递推送订阅成功");
+        } else {
+            updateSample.setCollectSampleStatus(3);
+            updateSample.setCollectSampleDesc("快递推送订阅失败,失败原因:" + jsonObject.getString("message"));
+        }
+        kuaishouItemCollectSamplesMapper.updateKuaishouItemCollectSamples(updateSample);
+    }
+
+    @Override
+    public void updateByNum(KuaishouItemCollectSamples updateSample) {
+        kuaishouItemCollectSamplesMapper.KuaishouItemCollectSamples(updateSample);
+    }
+
+    @Override
+    public void replaceExpress(KuaishouItemCollectSampleExpress express) {
+        kuaishouItemCollectSamplesMapper.replaceExpress(express);
+    }
+
+
+}
+

+ 145 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemListServiceImpl.java

@@ -0,0 +1,145 @@
+package com.ruixuan.isc.service.impl;
+
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.kuaishou.merchant.open.api.KsMerchantApiException;
+import com.kuaishou.merchant.open.api.client.AccessTokenKsMerchantClient;
+import com.kuaishou.merchant.open.api.common.utils.GsonUtils;
+import com.kuaishou.merchant.open.api.request.distribution.OpenDistributionInvestmentActivityInvalidItemListRequest;
+import com.kuaishou.merchant.open.api.request.distribution.OpenDistributionInvestmentActivityItemDetailRequest;
+import com.kuaishou.merchant.open.api.response.distribution.OpenDistributionInvestmentActivityInvalidItemListResponse;
+import com.kuaishou.merchant.open.api.response.distribution.OpenDistributionInvestmentActivityItemDetailResponse;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.isc.constants.KuaiShouConstants;
+import com.ruixuan.isc.entity.KuaishouItemList;
+import com.ruixuan.isc.mapper.KuaishouItemListMapper;
+import com.ruixuan.isc.service.IKuaishouItemListService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-02-03
+ */
+@Service
+@Slf4j
+public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
+    @Autowired
+    private KuaishouItemListMapper kuaishouItemListMapper;
+
+
+    @Override
+    public List<KuaishouItemList> getItemList(Map<String, Object> requestMap) {
+        return kuaishouItemListMapper.getItemList(requestMap);
+    }
+
+    @Override
+    public JSONObject getItemDetail(Long activityId, Long itemId, String accessToken) throws Exception {
+        JSONObject returnJson = new JSONObject();
+        AccessTokenKsMerchantClient client = new AccessTokenKsMerchantClient(KuaiShouConstants.KFX_URL, KuaiShouConstants.APP_KEY, KuaiShouConstants.SIGN_SECRET);
+        OpenDistributionInvestmentActivityItemDetailRequest request = new OpenDistributionInvestmentActivityItemDetailRequest();
+        request.setAccessToken(accessToken);
+        request.setApiMethodVersion(1L);
+        request.setActivityId(activityId);
+        List<Long> item = new ArrayList<>();
+        item.add(itemId);
+        request.setItemId(item);
+        OpenDistributionInvestmentActivityItemDetailResponse response = client.execute(request);
+        JSONObject itemJson = JSONObject.parseObject(GsonUtils.toJSON(response));
+        log.info("获取信息返回数据:{}", itemJson);
+        if (Check.isNull(itemJson)) {
+            throw new Exception("获取商品信息出错,请重新提交");
+        }
+        Integer code = itemJson.getInteger("code");
+        Integer subCode = itemJson.getInteger("sub_code");
+        if (code == 1 && subCode == 1) {
+            JSONArray data = itemJson.getJSONArray("data");
+            if (Check.isNull(data)) {
+                returnJson.put("code", -1);
+                returnJson.put("message", "数据查询失败");
+                return returnJson;
+            }
+            JSONObject itemJSon = data.getJSONObject(0);
+            returnJson.put("judgeStatus", 1);
+            returnJson.put("itemJSon", itemJSon);
+            returnJson.put("code", 0);
+            returnJson.put("message", "查询成功");
+        } else if (code == 807000 && (subCode == 24101 || subCode == 24214)) { // 商品下线
+            returnJson = getInvaliItemDetail(activityId, itemId, accessToken);
+        } else {
+            returnJson.put("code", -1);
+            returnJson.put("message", "数据查询失败");
+        }
+        return returnJson;
+    }
+
+    @Override
+    public KuaishouItemList getItemInfoByItemId(Long itemId) {
+        return kuaishouItemListMapper.getItemInfoByItemId(itemId);
+    }
+
+    @Override
+    public void insertItem(KuaishouItemList kuaishouItemList) {
+        kuaishouItemListMapper.insertItem(kuaishouItemList);
+    }
+
+    @Override
+    public int updateKuaishouItemList(KuaishouItemList kuaishouItemList) {
+        return kuaishouItemListMapper.updateKuaishouItemList(kuaishouItemList);
+    }
+
+    @Override
+    public int deleteKuaishouItemListByItemIds(Long[] itemIds) {
+        return kuaishouItemListMapper.deleteKuaishouItemListByItemIds(itemIds);
+    }
+
+
+    private JSONObject getInvaliItemDetail(Long activityId, Long itemId, String accessToken) throws Exception {
+        JSONObject returnJson = new JSONObject();
+        AccessTokenKsMerchantClient client = new AccessTokenKsMerchantClient(KuaiShouConstants.KFX_URL, KuaiShouConstants.APP_KEY, KuaiShouConstants.SIGN_SECRET);
+        OpenDistributionInvestmentActivityInvalidItemListRequest request = new OpenDistributionInvestmentActivityInvalidItemListRequest();
+        request.setAccessToken(accessToken);
+        request.setApiMethodVersion(1L);
+        request.setOffset("0");
+        request.setItemId(itemId);
+        request.setActivityId(activityId);
+        request.setLimit(10);
+        request.setCloseType(0);
+        OpenDistributionInvestmentActivityInvalidItemListResponse response = client.execute(request);
+        JSONObject itemJson = JSONObject.parseObject(GsonUtils.toJSON(response));
+        if (Check.isNull(itemJson)) {
+            returnJson.put("code", -1);
+            returnJson.put("message", "获取商品信息出错,请重新提交");
+            return returnJson;
+        }
+        Integer code = itemJson.getInteger("code");
+        Integer subCode = itemJson.getInteger("sub_code");
+
+        if (code == 1 && subCode == 1) {
+            JSONObject data = itemJson.getJSONObject("data");
+            JSONArray array = data.getJSONArray("item");
+            if (!Check.isNull(array)) {
+                returnJson = array.getJSONObject(0);
+                returnJson.put("judgeStatus", 2);
+                returnJson.put("code", 0);
+                returnJson.put("message", "查询成功");
+            }
+
+        } else {
+            returnJson.put("code", 0);
+            returnJson.put("message", "查询失败");
+        }
+        return returnJson;
+    }
+
+}
+

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

@@ -0,0 +1,209 @@
+package com.ruixuan.isc.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.core.domain.entity.SysUser;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.common.utils.DateUtils;
+import com.ruixuan.common.utils.RedisUtil;
+import com.ruixuan.common.utils.http.HttpUtil;
+import com.ruixuan.isc.entity.KuaishouPromoter;
+import com.ruixuan.isc.mapper.KuaishouPromoterMapper;
+import com.ruixuan.isc.service.IKuaishouPromoterService;
+import com.ruixuan.system.service.ISysDeptService;
+import com.ruixuan.system.service.ISysUserService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 快手达人 信息Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-02-03
+ */
+@Slf4j
+@Service
+public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
+
+    @Value("${promoter.start_ip_path}")
+    private String startIpPath;
+    @Value("${promoter.internal_ip_path}")
+    private String internalIpPath;
+
+    @Autowired
+    private ISysUserService sysUserService;
+
+    @Autowired
+    private KuaishouPromoterMapper kuaishouPromoterMapper;
+
+    @Autowired
+    private ISysDeptService deptService;
+
+    @Autowired
+    private RedisUtil redisUtil;
+
+    /**
+     * 查询快手达人 信息列表
+     *
+     * @param kuaishouPromoter 快手达人 信息
+     * @return 快手达人 信息
+     */
+    @Override
+    public List<KuaishouPromoter> selectKuaishouPromoterList(Long userId, Long promoterId, String promoterNickName) {
+        String roleKey = sysUserService.getRoleKeyByUserId(userId + "");
+        List<Long> userList = null;
+        //角色:供应链管理员、招商、招商经理可以看到所有的达人信息
+        if (roleKey.contains("courtship") || "supplyChainAdmin".equals(roleKey)) {
+
+        } else if ("bdManager".equals(roleKey) || "associationManager".equals(roleKey)) {
+            // 渠道经理、社群经理 可以看到自己创建的以及自己部门人员的达人信息
+            Long deptId = deptService.getDeptIdByUserId(userId);
+            userList = deptService.getDeptUserListByDeptId(deptId);
+        } else if ("bd".equals(roleKey) || "association".equals(roleKey)) {
+            // 渠道、社群 可以看到自己创建的达人信息
+            userList = Arrays.asList(userId);
+//        } else {
+//            return Collections.emptyList();
+        }
+
+        List<KuaishouPromoter> list = kuaishouPromoterMapper.selectKuaishouPromoterList(userList, promoterId, promoterNickName);
+        return list;
+    }
+
+    /**
+     * 查询快手达人 信息
+     *
+     * @param id 快手达人 信息主键
+     * @return 快手达人 信息
+     */
+    @Override
+    public JSONObject selectKuaishouPromoterById(Long id) {
+        JSONObject data = new JSONObject();
+        JSONObject result = null;
+        try {
+            KuaishouPromoter promoter = kuaishouPromoterMapper.selectKuaishouPromoterById(id);
+            if (Check.isNotNull(promoter)) {
+                Thread thread = new Thread() {
+                    @Override
+                    public void run() {
+                        try {
+                            //              demo:PromoterId:1424128656
+                            editPromoter(promoter.getId(), promoter.getPromoterId());
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                };
+                thread.start();
+
+                Long startTime = System.currentTimeMillis();
+                String content = HttpUtil.httpGetRequest(internalIpPath + "kuaiShou/promoter/getPromoterInfo?promoterId=" + promoter.getPromoterId());
+                result = JSONObject.parseObject(content);
+                log.info("获取达人详情数据,用时:{}s", (System.currentTimeMillis() - startTime) / 1000);
+                data.put("promoterInfo", promoter);
+                data.put("result", result);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("获取达人详情数据异常,{}", result);
+        }
+        return data;
+    }
+
+
+    /**
+     * 新增快手达人 信息
+     *
+     * @param kuaishouPromoter 快手达人 信息
+     */
+    @Override
+    public int insertKuaishouPromoter(KuaishouPromoter promoter) {
+        KuaishouPromoter one = kuaishouPromoterMapper.getOneByIdAndPromoterId(promoter.getUserId(), promoter.getPromoterId());
+        if (Check.isNotNull(one)) {
+            return 0;
+        }
+        SysUser sysUser = sysUserService.selectUserById(promoter.getUserId());
+        if (Check.isNotNull(sysUser)) {
+            promoter.setUserName(sysUser.getNickName());
+        }
+        int i = kuaishouPromoterMapper.insertKuaishouPromoter(promoter);
+        //              demoPromoterId:1424128656
+        editPromoter(promoter.getId(), promoter.getPromoterId());
+        return i;
+    }
+
+    /**
+     * 同步更新数据
+     */
+    private void editPromoter(Long id, Long promoterId) {
+        try {
+            /*缓存标记,每日第一次访问调用该接口,更新达人部分(昵称,省市,粉丝,总销售,头像等)数据*/
+            String key = DateUtils.getDate() + "_" + id + "_" + promoterId;
+            String value = (String) redisUtil.get(key);
+            if (Check.isNotNull(value) && "1".equals(value)) {
+                return;
+            }
+            redisUtil.set(key, "1", 60 * 60 * 24);
+
+            /*更新达人数据*/
+            Map<String, Object> param = new HashMap<>();
+            param.put("promoterId", promoterId);
+            Long startTime = System.currentTimeMillis();
+            String content = HttpUtil.httpPostRequest(startIpPath + "promoterInfo/getPromoterId", param, null);
+            JSONObject result = JSONObject.parseObject(content);
+            log.info("更新达人信息,用时:{}s,返回结果:{}", (System.currentTimeMillis() - startTime) / 1000, result);
+            if (Check.isNotNull(result)) {
+                KuaishouPromoter kuaishouPromoter = new KuaishouPromoter(
+                        id, result.getString("promoterNickName"),
+                        result.getString("province").concat("-").concat(result.getString("city")),
+                        result.getString("promoterHeadImgUrl"),
+                        result.getString("fanNum"),
+                        result.getString("totalSale"));
+                kuaishouPromoterMapper.updateKuaishouPromoter(kuaishouPromoter);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("更新达人信息异常", e);
+        }
+    }
+
+    /**
+     * 修改快手达人 信息
+     *
+     * @param kuaishouPromoter 快手达人 信息
+     * @return 结果
+     */
+    @Override
+    public int updateKuaishouPromoter(KuaishouPromoter kuaishouPromoter) {
+        return kuaishouPromoterMapper.updateKuaishouPromoter(kuaishouPromoter);
+    }
+
+    /**
+     * 批量删除快手达人 信息
+     *
+     * @param ids 需要删除的快手达人 信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouPromoterByIds(Long[] ids) {
+        return kuaishouPromoterMapper.deleteKuaishouPromoterByIds(ids);
+    }
+
+    /**
+     * 删除快手达人 信息信息
+     *
+     * @param id 快手达人 信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteKuaishouPromoterById(Long id) {
+        return kuaishouPromoterMapper.deleteKuaishouPromoterById(id);
+    }
+
+}

+ 183 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/SupplyChainServiceImpl.java

@@ -0,0 +1,183 @@
+package com.ruixuan.isc.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.ruixuan.common.utils.Check;
+import com.ruixuan.isc.mapper.SupplyChainMapper;
+import com.ruixuan.isc.service.ISupplyChainService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+@Service
+public class SupplyChainServiceImpl implements ISupplyChainService {
+    @Autowired
+    private SupplyChainMapper supplyChainMapper;
+
+    // 获取订单数据 
+    @Override
+    public List<JSONObject> getOrderList(Map<String, Object> requestMap) {
+        List<JSONObject> list = supplyChainMapper.getOrderList(requestMap);
+        if (!Check.isNull(list)) {
+            for (int i = 0; i < list.size(); i++) {
+                JSONObject jsonObject = list.get(i);
+                Long promoterId = jsonObject.getLong("promoterId");
+                requestMap.put("promoterId", promoterId);
+                List<JSONObject> topOrders = supplyChainMapper.getTopOrders(requestMap);
+                jsonObject.put("topOrders", topOrders);
+            }
+        }
+        return list;
+    }
+
+    //达人带货详情
+    @Override
+    public List<JSONObject> anchorOrderDetail(Map<String, Object> requestMap) {
+        return supplyChainMapper.anchorOrderDetail(requestMap);
+    }
+
+    //订单统计
+    @Override
+    public List<JSONObject> orderStatistics(Map<String, Object> requestMap) {
+        return supplyChainMapper.orderStatistics(requestMap);
+    }
+
+    //商品列表
+    @Override
+    public List<JSONObject> itemList(Map<String, Object> requestMap) {
+        List<JSONObject> list = supplyChainMapper.itemList(requestMap);
+
+        return list;
+    }
+
+    @Override
+    public List<JSONObject> itemDetail(Map<String, Object> requestMap) {
+        return supplyChainMapper.itemDetail(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> itemServiceCharge(Map<String, Object> requestMap) {
+        return supplyChainMapper.itemServiceCharge(requestMap);
+    }
+
+    @Override
+    public JSONObject getOrderTotal(Map<String, Object> requestMap) {
+        return supplyChainMapper.getOrderTotal(requestMap);
+    }
+
+    @Override
+    public Double getOrderTotalRatio(Map<String, Object> ratioMap) {
+        return supplyChainMapper.getOrderTotalRatio(ratioMap);
+    }
+
+    @Override
+    public JSONObject getAmountTotal(Map<String, Object> requestMap) {
+        return supplyChainMapper.getAmountTotal(requestMap);
+    }
+
+    @Override
+    public Double getAmountTotalRatio(Map<String, Object> ratioMap) {
+        return supplyChainMapper.getAmountTotalRatio(ratioMap);
+    }
+
+    @Override
+    public JSONObject getServiceAmountTotal(Map<String, Object> requestMap) {
+        return supplyChainMapper.getServiceAmountTotal(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> getOrderRankRatioList(Map<String, Object> requestMap) {
+        return supplyChainMapper.getOrderRankRatioList(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> getOrderRankList(Map<String, Object> requestMap) {
+        return supplyChainMapper.getOrderRankList(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> getPromoterRankRatioList(Map<String, Object> requestMap) {
+        return supplyChainMapper.getPromoterRankRatioList(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> getPromoterRatioList(Map<String, Object> requestMap) {
+        return supplyChainMapper.getPromoterRatioList(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> exportPromoterTotal(Map<String, Object> requestMap) {
+        return supplyChainMapper.exportPromoterTotal(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> exportPromoter(Map<String, Object> requestMap) {
+        return supplyChainMapper.exportPromoter(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> exportOrder(Map<String, Object> requestMap) {
+        return supplyChainMapper.exportOrder(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> getTopPromoterByItemId(Map<String, Object> requestMap) {
+        return supplyChainMapper.getTopPromoterByItemId(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> bindUserItemList(Map<String, Object> requestMap) {
+        return supplyChainMapper.bindUserItemList(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> getSupplyChainUserList() {
+        return supplyChainMapper.getSupplyChainUserList();
+    }
+
+    @Override
+    public boolean unbindUser(Long itemId) {
+        return supplyChainMapper.unbindUser(itemId);
+    }
+
+    @Override
+    public boolean bindUser(Long itemId, Long userId, String nikeName) {
+        return supplyChainMapper.bindUser(itemId, userId, nikeName);
+    }
+
+    @Override
+    public List<JSONObject> adminReportList(Map<String, Object> requestMap) {
+        return supplyChainMapper.adminReportList(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> userItemDetail(Map<String, Object> requestMap) {
+        return supplyChainMapper.userItemDetail(requestMap);
+    }
+
+    @Override
+    public JSONObject getTimeIntervalRatio(Map<String, Object> requestMap) {
+        return supplyChainMapper.getTimeIntervalRatio(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> indexStatistics(Map<String, Object> requestMap) {
+        return supplyChainMapper.indexStatistics(requestMap);
+    }
+
+    @Override
+    public JSONObject itemBindSummary() {
+        return supplyChainMapper.itemBindSummary();
+    }
+
+    @Override
+    public JSONObject userItemTotal(Map<String, Object> requestMap) {
+        return supplyChainMapper.userItemTotal(requestMap);
+    }
+
+    @Override
+    public List<JSONObject> exportUserItemDetail(Map<String, Object> requestMap) {
+        return supplyChainMapper.exportUserItemDetail(requestMap);
+    }
+}

BIN
ruixuan-live/src/main/resources/lib/kuaishou-merchant-open-sdk-release_open_kwaishop_sdk-1.0.2546.jar


+ 11 - 0
ruixuan-live/src/main/resources/mapper/isc/AccessTokenMapper.xml

@@ -0,0 +1,11 @@
+<?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.isc.mapper.AccessTokenMapper">
+
+
+    <select id="getAccessToken" resultType="java.lang.String">
+        select  access_token from kuaishou_access_token limit 1
+    </select>
+</mapper>

+ 308 - 0
ruixuan-live/src/main/resources/mapper/isc/KuaishouItemCollectSamplesMapper.xml

@@ -0,0 +1,308 @@
+<?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.isc.mapper.KuaishouItemCollectSamplesMapper">
+
+    <resultMap type="com.ruixuan.isc.entity.KuaishouItemCollectSamples" id="KuaishouItemCollectSamplesResult">
+        <result property="id" column="id"/>
+        <result property="itemId" column="item_id"/>
+        <result property="itemTitle" column="item_title"/>
+        <result property="itemPrice" column="item_price"/>
+        <result property="itemMgUrl" column="item_mg_url"/>
+        <result property="itemDesc" column="item_desc"/>
+        <result property="commissionRate" column="commission_rate"/>
+        <result property="regimentalPromotion" column="regimental_promotion"/>
+        <result property="sampleCount" column="sample_count"/>
+        <result property="sampleRequirement" column="sample_requirement"/>
+        <result property="itemCreateId" column="item_create_id"/>
+        <result property="itemCreateName" column="item_create_name"/>
+        <result property="collectSampleId" column="collect_sample_id"/>
+        <result property="collectSampleName" column="collect_sample_name"/>
+        <result property="partnerRecommendText" column="partner_recommend_text"/>
+        <result property="promoterId" column="promoter_id"/>
+        <result property="promoterNickName" column="promoter_nick_name"/>
+        <result property="promoterUrl" column="promoter_url"/>
+        <result property="promoterPhone" column="promoter_phone"/>
+        <result property="promoterAddress" column="promoter_address"/>
+        <result property="courierNumber" column="courier_number"/>
+        <result property="taskFileUrl" column="task_file_url"/>
+        <result property="collectSampleStatus" column="collect_sample_status"/>
+        <result property="collectSampleDesc" column="collect_sample_desc"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouItemCollectSamplesVo">
+        select id, item_id, item_title, item_price, item_mg_url, item_desc, commission_rate, regimental_promotion, sample_count, sample_requirement, item_create_id, item_create_name, collect_sample_id, collect_sample_name, partner_recommend_text, promoter_id, promoter_nick_name,promoter_url, promoter_phone, promoter_address, courier_number, task_file_url, collect_sample_status, collect_sample_desc, create_time, update_time from kuaishou_item_collect_samples
+    </sql>
+
+    <select id="selectKuaishouItemCollectSamplesList" parameterType="com.ruixuan.isc.entity.KuaishouItemCollectSamples"
+            resultMap="KuaishouItemCollectSamplesResult">
+        <include refid="selectKuaishouItemCollectSamplesVo"/>
+        <where>
+            <if test="itemId != null ">and item_id = #{itemId}</if>
+            <if test="promoterId != null ">and promoter_id = #{promoterId}</if>
+            <if test="collectSampleStatus != null ">and collect_sample_status = #{collectSampleStatus}</if>
+            <if test="itemCreateId != null and itemCreateId != ''">
+                and item_create_id = #{itemCreateId}
+            </if>
+            <if test='itemCreateIds != null and itemCreateIds.size() > 0'>
+                AND item_create_id in
+                <foreach collection="itemCreateId" item="item" separator=","
+                         open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="collectSampleId != null and collectSampleId != ''">
+                and collect_sample_id = #{collectSampleId}
+            </if>
+            <if test='collectSampleIds != null and collectSampleIds.size() > 0'>
+                AND collect_sample_id in
+                <foreach collection="collectSampleIds" item="item" separator=","
+                         open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+
+        </where>
+    </select>
+
+    <select id="selectKuaishouItemCollectSamplesById" parameterType="java.lang.Long"
+            resultMap="KuaishouItemCollectSamplesResult">
+        <include refid="selectKuaishouItemCollectSamplesVo"/>
+        where id = #{id}
+    </select>
+    <select id="getItemList" resultType="com.alibaba.fastjson.JSONObject"
+            parameterType="com.alibaba.fastjson.JSONArray">
+        select
+        item_id as 'itemId',
+        item_title as 'itemTitle',
+        item_price as 'itemPrice',
+        item_mg_url as 'itemMgUrl',
+        regimental_promotion as 'regimentalPromotion',
+        user_id as 'userId',
+        user_name as 'userName'
+        from kuaishou_item_list
+        where 1 =1
+        <if test='itemIds != null and itemIds.size() > 0'>
+            AND item_id in
+            <foreach collection="itemIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        group item_id
+
+    </select>
+    <select id="promoterList" resultType="com.alibaba.fastjson.JSONObject"
+            parameterType="com.alibaba.fastjson.JSONArray">
+        select
+        promoter_id as 'promoterId',
+        promoter_nick_name as 'promoterNickName',
+        promoter_url as 'promoterUrl',
+        promoter_address as 'promoterAddress',
+        from kuaishou_promoter
+        where 1 =1
+        <if test='itemIds != null and itemIds.size() > 0'>
+            AND promoter_id in
+            <foreach collection="promoterIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        group promoter_id
+    </select>
+    <select id="check" resultType="java.lang.Integer">
+        select count(1)  from kuaishou_item_collect_samples
+        where item_id = #{itemId}
+        and promoter_id = #{promoterId}
+
+    </select>
+
+
+    <insert id="insertKuaishouItemCollectSamples" parameterType="com.ruixuan.isc.entity.KuaishouItemCollectSamples">
+        insert into kuaishou_item_collect_samples
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="itemId != null">item_id,</if>
+            <if test="itemTitle != null">item_title,</if>
+            <if test="itemPrice != null">item_price,</if>
+            <if test="itemMgUrl != null">item_mg_url,</if>
+            <if test="itemDesc != null">item_desc,</if>
+            <if test="commissionRate != null">commission_rate,</if>
+            <if test="regimentalPromotion != null">regimental_promotion,</if>
+            <if test="sampleCount != null">sample_count,</if>
+            <if test="sampleRequirement != null">sample_requirement,</if>
+            <if test="itemCreateId != null">item_create_id,</if>
+            <if test="itemCreateName != null">item_create_name,</if>
+            <if test="collectSampleId != null">collect_sample_id,</if>
+            <if test="collectSampleName != null">collect_sample_name,</if>
+            <if test="partnerRecommendText != null">partner_recommend_text,</if>
+            <if test="promoterId != null">promoter_id,</if>
+            <if test="promoterNickName != null">promoter_nick_name,</if>
+            <if test="promoterUrl != null">promoter_url,</if>
+            <if test="promoterPhone != null">promoter_phone,</if>
+            <if test="promoterAddress != null">promoter_address,</if>
+            <if test="courierNumber != null">courier_number,</if>
+            <if test="taskFileUrl != null">task_file_url,</if>
+            <if test="collectSampleStatus != null">collect_sample_status,</if>
+            <if test="collectSampleDesc != null">collect_sample_desc,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="itemId != null">#{itemId},</if>
+            <if test="itemTitle != null">#{itemTitle},</if>
+            <if test="itemPrice != null">#{itemPrice},</if>
+            <if test="itemMgUrl != null">#{itemMgUrl},</if>
+            <if test="itemDesc != null">#{itemDesc},</if>
+            <if test="commissionRate != null">#{commissionRate},</if>
+            <if test="regimentalPromotion != null">#{regimentalPromotion},</if>
+            <if test="sampleCount != null">#{sampleCount},</if>
+            <if test="sampleRequirement != null">#{sampleRequirement},</if>
+            <if test="itemCreateId != null">#{itemCreateId},</if>
+            <if test="itemCreateName != null">#{itemCreateName},</if>
+            <if test="collectSampleId != null">#{collectSampleId},</if>
+            <if test="collectSampleName != null">#{collectSampleName},</if>
+            <if test="partnerRecommendText != null">#{partnerRecommendText},</if>
+            <if test="promoterId != null">#{promoterId},</if>
+            <if test="promoterNickName != null">#{promoterNickName},</if>
+            <if test="promoterUrl != null">#{promoterUrl},</if>
+            <if test="promoterPhone != null">#{promoterPhone},</if>
+            <if test="promoterAddress != null">#{promoterAddress},</if>
+            <if test="courierNumber != null">#{courierNumber},</if>
+            <if test="taskFileUrl != null">#{taskFileUrl},</if>
+            <if test="collectSampleStatus != null">#{collectSampleStatus},</if>
+            <if test="collectSampleDesc != null">#{collectSampleDesc},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+    <insert id="batchAdd">
+        insert into kuaishou_item_collect_samples(
+        id,
+        item_id,
+        item_title,
+        item_price,
+        item_mg_url,
+        item_desc,
+        commission_rate,
+        regimental_promotion,
+        sample_count,
+        sample_requirement,
+        item_create_id,
+        item_create_name,
+        collect_sample_id,
+        collect_sample_name,
+        partner_recommend_text,
+        promoter_id,
+        promoter_nick_name,
+        promoter_phone,
+        promoter_address,
+        courier_number,
+        task_file_url,
+        collect_sample_status,
+        collect_sample_desc
+        )
+        values
+        <foreach collection="adds" item="add" separator=",">
+            (
+            #{add.itemId},
+            #{add.itemTitle},
+            #{add.itemPrice},
+            #{add.itemMgUrl},
+            #{add.itemDesc},
+            #{add.commissionRate},
+            #{add.regimentalOromotion},
+            #{add.sampleCount},
+            #{add.sampleRequirement},
+            #{add.itemCreateId},
+            #{add.itemCreateName},
+            #{add.collectSampleId},
+            #{add.collectSampleName},
+            #{add.partnerRecommendText},
+            #{add.promoterId},
+            #{add.promoterNickName},
+            #{add.promoterPhone},
+            #{add.promoterAddress},
+            #{add.courierNumber},
+            #{add.taskFileUrl},
+            #{add.collectSampleStatus},
+            #{add.collectSampleDesc}
+            )
+        </foreach>
+
+    </insert>
+    <insert id="replaceExpress" parameterType="com.ruixuan.isc.entity.KuaishouItemCollectSampleExpress">
+
+        replace into kuaishou_item_collect_sample_express
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            courier_number,
+            com,
+            state,
+            express_data
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            #{courier_number},
+            #{com},
+            #{state},
+            #{express_data}
+        </trim>
+
+    </insert>
+
+    <update id="updateKuaishouItemCollectSamples" parameterType="com.ruixuan.isc.entity.KuaishouItemCollectSamples">
+        update kuaishou_item_collect_samples
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="itemId != null">item_id = #{itemId},</if>
+            <if test="itemTitle != null">item_title = #{itemTitle},</if>
+            <if test="itemPrice != null">item_price = #{itemPrice},</if>
+            <if test="itemMgUrl != null">item_mg_url = #{itemMgUrl},</if>
+            <if test="itemDesc != null">item_desc = #{itemDesc},</if>
+            <if test="commissionRate != null">commission_rate = #{commissionRate},</if>
+            <if test="regimentalPromotion != null">regimental_promotion = #{regimentalPromotion},</if>
+            <if test="sampleCount != null">sample_count = #{sampleCount},</if>
+            <if test="sampleRequirement != null">sample_requirement = #{sampleRequirement},</if>
+            <if test="itemCreateId != null">item_create_id = #{itemCreateId},</if>
+            <if test="itemCreateName != null">item_create_name = #{itemCreateName},</if>
+            <if test="collectSampleId != null">collect_sample_id = #{collectSampleId},</if>
+            <if test="collectSampleName != null">collect_sample_name = #{collectSampleName},</if>
+            <if test="partnerRecommendText != null">partner_recommend_text = #{partnerRecommendText},</if>
+            <if test="promoterId != null">promoter_id = #{promoterId},</if>
+            <if test="promoterNickName != null">promoter_nick_name = #{promoterNickName},</if>
+            <if test="promoterUrl != null">promoter_url = #{promoterUrl},</if>
+            <if test="promoterPhone != null">promoter_phone = #{promoterPhone},</if>
+            <if test="promoterAddress != null">promoter_address = #{promoterAddress},</if>
+            <if test="courierNumber != null">courier_number = #{courierNumber},</if>
+            <if test="taskFileUrl != null">task_file_url = #{taskFileUrl},</if>
+            <if test="collectSampleStatus != null">collect_sample_status = #{collectSampleStatus},</if>
+            <if test="collectSampleDesc != null">collect_sample_desc = #{collectSampleDesc},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+    <update id="KuaishouItemCollectSamples" parameterType="com.ruixuan.isc.entity.KuaishouItemCollectSamples">
+        update kuaishou_item_collect_samples
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="collectSampleStatus != null">collect_sample_status = #{collectSampleStatus},</if>
+            <if test="collectSampleDesc != null">collect_sample_desc = #{collectSampleDesc}</if>
+        </trim>
+        where courier_number = #{courierNumber}
+
+    </update>
+
+    <delete id="deleteKuaishouItemCollectSamplesById" parameterType="java.lang.Long">
+        delete from kuaishou_item_collect_samples where id = #{id}
+    </delete>
+
+    <delete id="deleteKuaishouItemCollectSamplesByIds" parameterType="java.lang.String">
+        delete from kuaishou_item_collect_samples where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

Разница между файлами не показана из-за своего большого размера
+ 222 - 0
ruixuan-live/src/main/resources/mapper/isc/KuaishouItemListMapper.xml


+ 155 - 0
ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml

@@ -0,0 +1,155 @@
+<?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.isc.mapper.KuaishouPromoterMapper">
+
+    <resultMap type="com.ruixuan.isc.entity.KuaishouPromoter" id="KuaishouPromoterResult">
+        <result property="id" column="id"/>
+        <result property="userId" column="user_id"/>
+        <result property="userName" column="user_name"/>
+        <result property="promoterId" column="promoter_id"/>
+        <result property="promoterNickName" column="promoter_nick_name"/>
+        <result property="state" column="state"/>
+        <result property="province" column="province"/>
+        <result property="commissionRequirement" column="commission_requirement"/>
+        <result property="categoryRequirement" column="category_requirement"/>
+        <result property="createTime" column="create_time"/>
+        <result property="promoterUrl" column="promoter_url"/>
+        <result property="totalSale" column="total_sale"/>
+        <result property="fansNumber" column="fans_number"/>
+        <result property="phone" column="phone"/>
+        <result property="consignee" column="consignee"/>
+        <result property="promoterAddress" column="promoter_address"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectKuaishouPromoterVo">
+        select id,
+               user_id,
+               user_name,
+               promoter_id,
+               promoter_nick_name,
+               `state`,
+               province,
+               commission_requirement,
+               category_requirement,
+               promoter_url,
+               phone,
+               consignee,
+               promoter_address,
+               total_sale,
+               fans_number,
+               create_time,
+               update_time
+        from kuaishou_promoter
+    </sql>
+
+    <select id="selectKuaishouPromoterList" resultMap="KuaishouPromoterResult">
+        <include refid="selectKuaishouPromoterVo"/>
+        <where>
+            <if test="userList != null and userList.size() > 0  ">
+                and user_id in
+                <foreach collection="userList" item="userId" open="(" separator="," close=")">
+                    #{userId}
+                </foreach>
+            </if>
+            <if test="promoterId != null ">
+                and promoter_id = #{promoterId}
+            </if>
+            <if test="promoterNickName != null  and promoterNickName != ''">
+                and promoter_nick_name like concat('%', #{promoterNickName}, '%')
+            </if>
+        </where>
+    </select>
+
+    <select id="selectKuaishouPromoterById" parameterType="Long" resultMap="KuaishouPromoterResult">
+        <include refid="selectKuaishouPromoterVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="getOneByIdAndPromoterId" resultMap="KuaishouPromoterResult">
+        <include refid="selectKuaishouPromoterVo"/>
+        where user_id = #{userId}
+        AND promoter_id = #{promoterId}
+    </select>
+
+    <insert id="insertKuaishouPromoter" parameterType="com.ruixuan.isc.entity.KuaishouPromoter" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into kuaishou_promoter
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="promoterId != null">promoter_id,</if>
+            <if test="promoterNickName != null">promoter_nick_name,</if>
+            <if test="state != null">state,</if>
+            <if test="province != null">province,</if>
+            <if test="commissionRequirement != null">commission_requirement,</if>
+            <if test="categoryRequirement != null">category_requirement,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="totalSale != null">total_sale,</if>
+            <if test="fansNumber != null">fans_number,</if>
+            <if test="promoterUrl != null">promoter_url,</if>
+            <if test="phone != null">phone,</if>
+            <if test="consignee != null">consignee,</if>
+            <if test="promoterAddress != null">promoter_address,</if>
+
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="promoterId != null">#{promoterId},</if>
+            <if test="promoterNickName != null">#{promoterNickName},</if>
+            <if test="state != null">#{state},</if>
+            <if test="province != null">#{province},</if>
+            <if test="commissionRequirement != null">#{commissionRequirement},</if>
+            <if test="categoryRequirement != null">#{categoryRequirement},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="totalSale != null">#{totalSale},</if>
+            <if test="fansNumber != null">#{fansNumber},</if>
+            <if test="promoterUrl != null">#{promoterUrl},</if>
+            <if test="phone != null">#{phone},</if>
+            <if test="consignee != null">#{consignee},</if>
+            <if test="promoterAddress != null">#{promoterAddress},</if>
+        </trim>
+    </insert>
+
+    <update id="updateKuaishouPromoter" parameterType="com.ruixuan.isc.entity.KuaishouPromoter">
+        update kuaishou_promoter
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="promoterId != null">promoter_id = #{promoterId},</if>
+            <if test="promoterNickName != null">promoter_nick_name = #{promoterNickName},</if>
+            <if test="totalSale != null">total_sale = #{totalSale},</if>
+            <if test="fansNumber != null">fans_number = #{fansNumber},</if>
+            <if test="promoterUrl != null">promoter_url = #{promoterUrl},</if>
+            <if test="phone != null">phone = #{phone},</if>
+            <if test="consignee != null">consignee = #{consignee},</if>
+            <if test="promoterAddress != null">promoter_address = #{promoterAddress},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="province != null">province = #{province},</if>
+            <if test="commissionRequirement != null">commission_requirement = #{commissionRequirement},</if>
+            <if test="categoryRequirement != null">category_requirement = #{categoryRequirement},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteKuaishouPromoterById" parameterType="Long">
+        delete
+        from kuaishou_promoter
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteKuaishouPromoterByIds" parameterType="String">
+        delete from kuaishou_promoter where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+</mapper>

Разница между файлами не показана из-за своего большого размера
+ 1039 - 0
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml


+ 4 - 0
ruixuan-system/src/main/java/com/ruixuan/system/mapper/SysDeptMapper.java

@@ -115,4 +115,8 @@ public interface SysDeptMapper
      * @return 结果
      */
     public int deleteDeptById(Long deptId);
+
+    Long getDeptIdByUserId(Long userId);
+
+    List<Long> getDeptUserListByDeptId(Long deptId);
 }

+ 23 - 15
ruixuan-system/src/main/java/com/ruixuan/system/mapper/SysRoleMapper.java

@@ -1,18 +1,18 @@
 package com.ruixuan.system.mapper;
 
 import java.util.List;
+
 import com.ruixuan.common.core.domain.entity.SysRole;
 
 /**
  * 角色表 数据层
- * 
+ *
  * @author ruixuan
  */
-public interface SysRoleMapper
-{
+public interface SysRoleMapper {
     /**
      * 根据条件分页查询角色数据
-     * 
+     *
      * @param role 角色信息
      * @return 角色数据集合信息
      */
@@ -20,7 +20,7 @@ public interface SysRoleMapper
 
     /**
      * 根据用户ID查询角色
-     * 
+     *
      * @param userId 用户ID
      * @return 角色列表
      */
@@ -28,14 +28,14 @@ public interface SysRoleMapper
 
     /**
      * 查询所有角色
-     * 
+     *
      * @return 角色列表
      */
     public List<SysRole> selectRoleAll();
 
     /**
      * 根据用户ID获取角色选择框列表
-     * 
+     *
      * @param userId 用户ID
      * @return 选中角色ID列表
      */
@@ -43,7 +43,7 @@ public interface SysRoleMapper
 
     /**
      * 通过角色ID查询角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 角色对象信息
      */
@@ -51,7 +51,7 @@ public interface SysRoleMapper
 
     /**
      * 根据用户ID查询角色
-     * 
+     *
      * @param userName 用户名
      * @return 角色列表
      */
@@ -59,7 +59,7 @@ public interface SysRoleMapper
 
     /**
      * 校验角色名称是否唯一
-     * 
+     *
      * @param roleName 角色名称
      * @return 角色信息
      */
@@ -67,7 +67,7 @@ public interface SysRoleMapper
 
     /**
      * 校验角色权限是否唯一
-     * 
+     *
      * @param roleKey 角色权限
      * @return 角色信息
      */
@@ -75,7 +75,7 @@ public interface SysRoleMapper
 
     /**
      * 修改角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -83,7 +83,7 @@ public interface SysRoleMapper
 
     /**
      * 新增角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -91,7 +91,7 @@ public interface SysRoleMapper
 
     /**
      * 通过角色ID删除角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -99,11 +99,19 @@ public interface SysRoleMapper
 
     /**
      * 批量删除角色信息
-     * 
+     *
      * @param roleIds 需要删除的角色ID
      * @return 结果
      */
     public int deleteRoleByIds(Long[] roleIds);
 
     String selectRoleByUserId(Long userId);
+
+    /**
+     * 根据用户ID获取角色id
+     *
+     * @param userId
+     * @return
+     */
+    String getRoleBYUserId(Long userId);
 }

+ 19 - 21
ruixuan-system/src/main/java/com/ruixuan/system/mapper/SysUserMapper.java

@@ -8,14 +8,13 @@ import com.ruixuan.common.core.domain.entity.SysUser;
 
 /**
  * 用户表 数据层
- * 
+ *
  * @author ruixuan
  */
-public interface SysUserMapper
-{
+public interface SysUserMapper {
     /**
      * 根据条件分页查询用户列表
-     * 
+     *
      * @param sysUser 用户信息
      * @return 用户信息集合信息
      */
@@ -23,7 +22,7 @@ public interface SysUserMapper
 
     /**
      * 根据条件分页查询已配用户角色列表
-     * 
+     *
      * @param user 用户信息
      * @return 用户信息集合信息
      */
@@ -31,7 +30,7 @@ public interface SysUserMapper
 
     /**
      * 根据条件分页查询未分配用户角色列表
-     * 
+     *
      * @param user 用户信息
      * @return 用户信息集合信息
      */
@@ -39,7 +38,7 @@ public interface SysUserMapper
 
     /**
      * 通过用户名查询用户
-     * 
+     *
      * @param userName 用户名
      * @return 用户对象信息
      */
@@ -52,9 +51,10 @@ public interface SysUserMapper
      * @return 用户对象信息
      */
     SysUser selectUserByNickName(String nickName);
+
     /**
      * 通过用户ID查询用户
-     * 
+     *
      * @param userId 用户ID
      * @return 用户对象信息
      */
@@ -62,7 +62,7 @@ public interface SysUserMapper
 
     /**
      * 新增用户信息
-     * 
+     *
      * @param user 用户信息
      * @return 结果
      */
@@ -70,7 +70,7 @@ public interface SysUserMapper
 
     /**
      * 修改用户信息
-     * 
+     *
      * @param user 用户信息
      * @return 结果
      */
@@ -78,16 +78,16 @@ public interface SysUserMapper
 
     /**
      * 修改用户头像
-     * 
+     *
      * @param userName 用户名
-     * @param avatar 头像地址
+     * @param avatar   头像地址
      * @return 结果
      */
     public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar);
 
     /**
      * 重置用户密码
-     * 
+     *
      * @param userName 用户名
      * @param password 密码
      * @return 结果
@@ -96,7 +96,7 @@ public interface SysUserMapper
 
     /**
      * 通过用户ID删除用户
-     * 
+     *
      * @param userId 用户ID
      * @return 结果
      */
@@ -104,7 +104,7 @@ public interface SysUserMapper
 
     /**
      * 批量删除用户信息
-     * 
+     *
      * @param userIds 需要删除的用户ID
      * @return 结果
      */
@@ -112,7 +112,7 @@ public interface SysUserMapper
 
     /**
      * 校验用户名称是否唯一
-     * 
+     *
      * @param userName 用户名称
      * @return 结果
      */
@@ -147,6 +147,7 @@ public interface SysUserMapper
 
     /**
      * 根据用户id 查询用户和角色信息
+     *
      * @param userId
      * @return
      */
@@ -154,15 +155,12 @@ public interface SysUserMapper
 
     /**
      * 根据角色名称 查询用户信息
+     *
      * @param roleCodeList
      * @return
      */
     List<JSONObject> getUserByRoleName(@Param("roleCodeList") List<String> roleCodeList);
 
 
-
-
-
-
-
+    String getRoleKeyByUserId(@Param("userId") String userId);
 }

+ 37 - 16
ruixuan-system/src/main/java/com/ruixuan/system/service/ISysDeptService.java

@@ -1,27 +1,48 @@
 package com.ruixuan.system.service;
 
 import java.util.List;
+
 import com.ruixuan.common.core.domain.TreeSelect;
 import com.ruixuan.common.core.domain.entity.SysDept;
 
 /**
  * 部门管理 服务层
- * 
+ *
  * @author ruixuan
  */
-public interface ISysDeptService
-{
+public interface ISysDeptService {
+
+    /**
+     * 根据用户ID获取部门ID
+     *
+     * @param userId
+     * @return
+     */
+    Long getDeptIdByUserId(Long userId);
+
+    /**
+     * 根据部门id获取此部门下所有人员
+     *
+     * @param deptId
+     * @return
+     */
+    List<Long> getDeptUserListByDeptId(Long deptId);
+
+
+    // List<Long> selectDeptUsertListBy(SysDept dept);
+
     /**
      * 查询部门管理数据
-     * 
+     *
      * @param dept 部门信息
      * @return 部门信息集合
      */
+
     public List<SysDept> selectDeptList(SysDept dept);
 
     /**
      * 构建前端所需要树结构
-     * 
+     *
      * @param depts 部门列表
      * @return 树结构列表
      */
@@ -29,7 +50,7 @@ public interface ISysDeptService
 
     /**
      * 构建前端所需要下拉树结构
-     * 
+     *
      * @param depts 部门列表
      * @return 下拉树结构列表
      */
@@ -37,7 +58,7 @@ public interface ISysDeptService
 
     /**
      * 根据角色ID查询部门树信息
-     * 
+     *
      * @param roleId 角色ID
      * @return 选中部门列表
      */
@@ -45,7 +66,7 @@ public interface ISysDeptService
 
     /**
      * 根据部门ID查询信息
-     * 
+     *
      * @param deptId 部门ID
      * @return 部门信息
      */
@@ -53,7 +74,7 @@ public interface ISysDeptService
 
     /**
      * 根据ID查询所有子部门(正常状态)
-     * 
+     *
      * @param deptId 部门ID
      * @return 子部门数
      */
@@ -61,7 +82,7 @@ public interface ISysDeptService
 
     /**
      * 是否存在部门子节点
-     * 
+     *
      * @param deptId 部门ID
      * @return 结果
      */
@@ -69,7 +90,7 @@ public interface ISysDeptService
 
     /**
      * 查询部门是否存在用户
-     * 
+     *
      * @param deptId 部门ID
      * @return 结果 true 存在 false 不存在
      */
@@ -77,7 +98,7 @@ public interface ISysDeptService
 
     /**
      * 校验部门名称是否唯一
-     * 
+     *
      * @param dept 部门信息
      * @return 结果
      */
@@ -85,14 +106,14 @@ public interface ISysDeptService
 
     /**
      * 校验部门是否有数据权限
-     * 
+     *
      * @param deptId 部门id
      */
     public void checkDeptDataScope(Long deptId);
 
     /**
      * 新增保存部门信息
-     * 
+     *
      * @param dept 部门信息
      * @return 结果
      */
@@ -100,7 +121,7 @@ public interface ISysDeptService
 
     /**
      * 修改保存部门信息
-     * 
+     *
      * @param dept 部门信息
      * @return 结果
      */
@@ -108,7 +129,7 @@ public interface ISysDeptService
 
     /**
      * 删除部门管理信息
-     * 
+     *
      * @param deptId 部门ID
      * @return 结果
      */

+ 36 - 25
ruixuan-system/src/main/java/com/ruixuan/system/service/ISysRoleService.java

@@ -2,19 +2,30 @@ package com.ruixuan.system.service;
 
 import java.util.List;
 import java.util.Set;
+
 import com.ruixuan.common.core.domain.entity.SysRole;
 import com.ruixuan.system.domain.SysUserRole;
 
 /**
  * 角色业务层
- * 
+ *
  * @author ruixuan
  */
-public interface ISysRoleService
-{
+public interface ISysRoleService {
+
+
+    /**
+     * 根据用户ID获取用户角色
+     *
+     * @param userId
+     * @return
+     */
+    String getRoleBYUserId(Long userId);
+
+
     /**
      * 根据条件分页查询角色数据
-     * 
+     *
      * @param role 角色信息
      * @return 角色数据集合信息
      */
@@ -22,7 +33,7 @@ public interface ISysRoleService
 
     /**
      * 根据用户ID查询角色列表
-     * 
+     *
      * @param userId 用户ID
      * @return 角色列表
      */
@@ -30,7 +41,7 @@ public interface ISysRoleService
 
     /**
      * 根据用户ID查询角色权限
-     * 
+     *
      * @param userId 用户ID
      * @return 权限列表
      */
@@ -38,14 +49,14 @@ public interface ISysRoleService
 
     /**
      * 查询所有角色
-     * 
+     *
      * @return 角色列表
      */
     public List<SysRole> selectRoleAll();
 
     /**
      * 根据用户ID获取角色选择框列表
-     * 
+     *
      * @param userId 用户ID
      * @return 选中角色ID列表
      */
@@ -53,7 +64,7 @@ public interface ISysRoleService
 
     /**
      * 通过角色ID查询角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 角色对象信息
      */
@@ -61,7 +72,7 @@ public interface ISysRoleService
 
     /**
      * 校验角色名称是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -69,7 +80,7 @@ public interface ISysRoleService
 
     /**
      * 校验角色权限是否唯一
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -77,21 +88,21 @@ public interface ISysRoleService
 
     /**
      * 校验角色是否允许操作
-     * 
+     *
      * @param role 角色信息
      */
     public void checkRoleAllowed(SysRole role);
 
     /**
      * 校验角色是否有数据权限
-     * 
+     *
      * @param roleId 角色id
      */
     public void checkRoleDataScope(Long roleId);
 
     /**
      * 通过角色ID查询角色使用数量
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -99,7 +110,7 @@ public interface ISysRoleService
 
     /**
      * 新增保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -107,7 +118,7 @@ public interface ISysRoleService
 
     /**
      * 修改保存角色信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -115,7 +126,7 @@ public interface ISysRoleService
 
     /**
      * 修改角色状态
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -123,7 +134,7 @@ public interface ISysRoleService
 
     /**
      * 修改数据权限信息
-     * 
+     *
      * @param role 角色信息
      * @return 结果
      */
@@ -131,7 +142,7 @@ public interface ISysRoleService
 
     /**
      * 通过角色ID删除角色
-     * 
+     *
      * @param roleId 角色ID
      * @return 结果
      */
@@ -139,7 +150,7 @@ public interface ISysRoleService
 
     /**
      * 批量删除角色信息
-     * 
+     *
      * @param roleIds 需要删除的角色ID
      * @return 结果
      */
@@ -147,7 +158,7 @@ public interface ISysRoleService
 
     /**
      * 取消授权用户角色
-     * 
+     *
      * @param userRole 用户和角色关联信息
      * @return 结果
      */
@@ -155,8 +166,8 @@ public interface ISysRoleService
 
     /**
      * 批量取消授权用户角色
-     * 
-     * @param roleId 角色ID
+     *
+     * @param roleId  角色ID
      * @param userIds 需要取消授权的用户数据ID
      * @return 结果
      */
@@ -164,8 +175,8 @@ public interface ISysRoleService
 
     /**
      * 批量选择授权用户角色
-     * 
-     * @param roleId 角色ID
+     *
+     * @param roleId  角色ID
      * @param userIds 需要删除的用户数据ID
      * @return 结果
      */

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

@@ -226,4 +226,5 @@ public interface ISysUserService {
 
     List<JSONObject> getUserByRoleName(List<String> roleCodeList);
 
+    String getRoleKeyByUserId(String userId);
 }

+ 10 - 0
ruixuan-system/src/main/java/com/ruixuan/system/service/impl/SysDeptServiceImpl.java

@@ -35,6 +35,16 @@ public class SysDeptServiceImpl implements ISysDeptService
     @Autowired
     private SysRoleMapper roleMapper;
 
+    @Override
+    public Long getDeptIdByUserId(Long userId) {
+        return deptMapper.getDeptIdByUserId(userId);
+    }
+
+    @Override
+    public List<Long> getDeptUserListByDeptId(Long deptId) {
+        return deptMapper.getDeptUserListByDeptId(deptId);
+    }
+
     /**
      * 查询部门管理数据
      * 

+ 7 - 0
ruixuan-system/src/main/java/com/ruixuan/system/service/impl/SysRoleServiceImpl.java

@@ -45,6 +45,13 @@ public class SysRoleServiceImpl implements ISysRoleService {
     @Autowired
     private SysRoleDeptMapper roleDeptMapper;
 
+    @Override
+    public String getRoleBYUserId(Long userId) {
+        return roleMapper.getRoleBYUserId(userId);
+    }
+
+
+
     /**
      * 根据条件分页查询角色数据
      *

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

@@ -540,4 +540,9 @@ public class SysUserServiceImpl implements ISysUserService {
         return userMapper.getUserByRoleName(roleCodeList);
     }
 
+    @Override
+    public String getRoleKeyByUserId(String userId) {
+        return userMapper.getRoleKeyByUserId(userId);
+    }
+
 }

+ 134 - 126
ruixuan-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -1,156 +1,164 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruixuan.system.mapper.SysDeptMapper">
 
-	<resultMap type="SysDept" id="SysDeptResult">
-		<id     property="deptId"     column="dept_id"     />
-		<result property="parentId"   column="parent_id"   />
-		<result property="ancestors"  column="ancestors"   />
-		<result property="deptName"   column="dept_name"   />
-		<result property="orderNum"   column="order_num"   />
-		<result property="leader"     column="leader"      />
-		<result property="phone"      column="phone"       />
-		<result property="email"      column="email"       />
-		<result property="status"     column="status"      />
-		<result property="delFlag"    column="del_flag"    />
-		<result property="parentName" column="parent_name" />
-		<result property="createBy"   column="create_by"   />
-		<result property="createTime" column="create_time" />
-		<result property="updateBy"   column="update_by"   />
-		<result property="updateTime" column="update_time" />
-	</resultMap>
-	
-	<sql id="selectDeptVo">
+    <resultMap type="SysDept" id="SysDeptResult">
+        <id property="deptId" column="dept_id"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="ancestors" column="ancestors"/>
+        <result property="deptName" column="dept_name"/>
+        <result property="orderNum" column="order_num"/>
+        <result property="leader" column="leader"/>
+        <result property="phone" column="phone"/>
+        <result property="email" column="email"/>
+        <result property="status" column="status"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="parentName" column="parent_name"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectDeptVo">
         select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time 
         from sys_dept d
     </sql>
-    
-	<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
+
+    <select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
         <include refid="selectDeptVo"/>
         where d.del_flag = '0'
-		<if test="deptId != null and deptId != 0">
-			AND dept_id = #{deptId}
-		</if>
+        <if test="deptId != null and deptId != 0">
+            AND dept_id = #{deptId}
+        </if>
         <if test="parentId != null and parentId != 0">
-			AND parent_id = #{parentId}
-		</if>
-		<if test="deptName != null and deptName != ''">
-			AND dept_name like concat('%', #{deptName}, '%')
-		</if>
-		<if test="status != null and status != ''">
-			AND status = #{status}
-		</if>
-		<!-- 数据范围过滤 -->
-		${params.dataScope}
-		order by d.parent_id, d.order_num
+            AND parent_id = #{parentId}
+        </if>
+        <if test="deptName != null and deptName != ''">
+            AND dept_name like concat('%', #{deptName}, '%')
+        </if>
+        <if test="status != null and status != ''">
+            AND status = #{status}
+        </if>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        order by d.parent_id, d.order_num
     </select>
-    
+
     <select id="selectDeptListByRoleId" resultType="Long">
-		select d.dept_id
-		from sys_dept d
-            left join sys_role_dept rd on d.dept_id = rd.dept_id
+        select d.dept_id
+        from sys_dept d
+        left join sys_role_dept rd on d.dept_id = rd.dept_id
         where rd.role_id = #{roleId}
-            <if test="deptCheckStrictly">
-              and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
-            </if>
-		order by d.parent_id, d.order_num
-	</select>
-    
+        <if test="deptCheckStrictly">
+            and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id =
+            rd.dept_id and rd.role_id = #{roleId})
+        </if>
+        order by d.parent_id, d.order_num
+    </select>
+
     <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
-		<include refid="selectDeptVo"/>
-		where dept_id = #{deptId}
-	</select>
-    
+        <include refid="selectDeptVo"/>
+        where dept_id = #{deptId}
+    </select>
+
     <select id="checkDeptExistUser" parameterType="Long" resultType="int">
 		select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
 	</select>
-	
-	<select id="hasChildByDeptId" parameterType="Long" resultType="int">
+
+    <select id="hasChildByDeptId" parameterType="Long" resultType="int">
 		select count(1) from sys_dept
 		where del_flag = '0' and parent_id = #{deptId} limit 1
 	</select>
-	
-	<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
+
+    <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
 		select * from sys_dept where find_in_set(#{deptId}, ancestors)
 	</select>
-	
-	<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
+
+    <select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
 		select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
 	</select>
-	
-	<select id="checkDeptNameUnique" resultMap="SysDeptResult">
-	    <include refid="selectDeptVo"/>
-		where dept_name=#{deptName} and parent_id = #{parentId} limit 1
+
+    <select id="checkDeptNameUnique" resultMap="SysDeptResult">
+        <include refid="selectDeptVo"/>
+        where dept_name=#{deptName} and parent_id = #{parentId} limit 1
+    </select>
+    <select id="getDeptIdByUserId" resultType="java.lang.Long" parameterType="java.lang.Long">
+		select  dept_id  from sys_user where user_id = #{userId}
+
+	</select>
+    <select id="getDeptUserListByDeptId" resultType="java.lang.Long" parameterType="java.lang.Long">
+		select  user_id from sys_user  where  dept_id = #{deptId}
 	</select>
-    
+
     <insert id="insertDept" parameterType="SysDept">
- 		insert into sys_dept(
- 			<if test="deptId != null and deptId != 0">dept_id,</if>
- 			<if test="parentId != null and parentId != 0">parent_id,</if>
- 			<if test="deptName != null and deptName != ''">dept_name,</if>
- 			<if test="ancestors != null and ancestors != ''">ancestors,</if>
- 			<if test="orderNum != null and orderNum != ''">order_num,</if>
- 			<if test="leader != null and leader != ''">leader,</if>
- 			<if test="phone != null and phone != ''">phone,</if>
- 			<if test="email != null and email != ''">email,</if>
- 			<if test="status != null">status,</if>
- 			<if test="createBy != null and createBy != ''">create_by,</if>
- 			create_time
- 		)values(
- 			<if test="deptId != null and deptId != 0">#{deptId},</if>
- 			<if test="parentId != null and parentId != 0">#{parentId},</if>
- 			<if test="deptName != null and deptName != ''">#{deptName},</if>
- 			<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
- 			<if test="orderNum != null and orderNum != ''">#{orderNum},</if>
- 			<if test="leader != null and leader != ''">#{leader},</if>
- 			<if test="phone != null and phone != ''">#{phone},</if>
- 			<if test="email != null and email != ''">#{email},</if>
- 			<if test="status != null">#{status},</if>
- 			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
- 		)
-	</insert>
-	
-	<update id="updateDept" parameterType="SysDept">
- 		update sys_dept
- 		<set>
- 			<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
- 			<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
- 			<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
- 			<if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
- 			<if test="leader != null">leader = #{leader},</if>
- 			<if test="phone != null">phone = #{phone},</if>
- 			<if test="email != null">email = #{email},</if>
- 			<if test="status != null and status != ''">status = #{status},</if>
- 			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
- 		</set>
- 		where dept_id = #{deptId}
-	</update>
-	
-	<update id="updateDeptChildren" parameterType="java.util.List">
-	    update sys_dept set ancestors =
-	    <foreach collection="depts" item="item" index="index"
-	        separator=" " open="case dept_id" close="end">
-	        when #{item.deptId} then #{item.ancestors}
-	    </foreach>
-	    where dept_id in
-	    <foreach collection="depts" item="item" index="index"
-	        separator="," open="(" close=")">
-	        #{item.deptId}
-	    </foreach>
-	</update>
-	 
-	<update id="updateDeptStatusNormal" parameterType="Long">
- 	    update sys_dept set status = '0' where dept_id in 
- 	    <foreach collection="array" item="deptId" open="(" separator="," close=")">
-        	#{deptId}
+        insert into sys_dept(
+        <if test="deptId != null and deptId != 0">dept_id,</if>
+        <if test="parentId != null and parentId != 0">parent_id,</if>
+        <if test="deptName != null and deptName != ''">dept_name,</if>
+        <if test="ancestors != null and ancestors != ''">ancestors,</if>
+        <if test="orderNum != null and orderNum != ''">order_num,</if>
+        <if test="leader != null and leader != ''">leader,</if>
+        <if test="phone != null and phone != ''">phone,</if>
+        <if test="email != null and email != ''">email,</if>
+        <if test="status != null">status,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        create_time
+        )values(
+        <if test="deptId != null and deptId != 0">#{deptId},</if>
+        <if test="parentId != null and parentId != 0">#{parentId},</if>
+        <if test="deptName != null and deptName != ''">#{deptName},</if>
+        <if test="ancestors != null and ancestors != ''">#{ancestors},</if>
+        <if test="orderNum != null and orderNum != ''">#{orderNum},</if>
+        <if test="leader != null and leader != ''">#{leader},</if>
+        <if test="phone != null and phone != ''">#{phone},</if>
+        <if test="email != null and email != ''">#{email},</if>
+        <if test="status != null">#{status},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        sysdate()
+        )
+    </insert>
+
+    <update id="updateDept" parameterType="SysDept">
+        update sys_dept
+        <set>
+            <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
+            <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
+            <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
+            <if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if>
+            <if test="leader != null">leader = #{leader},</if>
+            <if test="phone != null">phone = #{phone},</if>
+            <if test="email != null">email = #{email},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+            update_time = sysdate()
+        </set>
+        where dept_id = #{deptId}
+    </update>
+
+    <update id="updateDeptChildren" parameterType="java.util.List">
+        update sys_dept set ancestors =
+        <foreach collection="depts" item="item" index="index"
+                 separator=" " open="case dept_id" close="end">
+            when #{item.deptId} then #{item.ancestors}
+        </foreach>
+        where dept_id in
+        <foreach collection="depts" item="item" index="index"
+                 separator="," open="(" close=")">
+            #{item.deptId}
         </foreach>
-	</update>
-	
-	<delete id="deleteDeptById" parameterType="Long">
+    </update>
+
+    <update id="updateDeptStatusNormal" parameterType="Long">
+        update sys_dept set status = '0' where dept_id in
+        <foreach collection="array" item="deptId" open="(" separator="," close=")">
+            #{deptId}
+        </foreach>
+    </update>
+
+    <delete id="deleteDeptById" parameterType="Long">
 		update sys_dept set del_flag = '2' where dept_id = #{deptId}
 	</delete>
 

+ 6 - 0
ruixuan-system/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -109,6 +109,12 @@
         <include refid="selectRoleVo"/>
         where r.role_key=#{roleKey} limit 1
     </select>
+    <select id="getRoleBYUserId" resultType="java.lang.String" parameterType="java.lang.Long">
+       select  t2.role_key  from sys_user_role t1
+        left join  sys_role t2
+        on t1.role_id = t2.role_id
+        where  t1.user_id = #{userId};
+    </select>
 
     <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
         insert into sys_role(

+ 16 - 12
ruixuan-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -155,7 +155,7 @@
         where u.user_name = #{userName}
     </select>
 
-     <select id="selectUserByNickName" parameterType="String" resultMap="SysUserResult">
+    <select id="selectUserByNickName" parameterType="String" resultMap="SysUserResult">
         <include refid="selectUserVo"/>
         where u.nick_name = #{nickName}
     </select>
@@ -321,7 +321,6 @@
     </select>
 
 
-
     <!-- 根据用户id 查询用户和角色信息-->
     <select id="getUserRoleByUserId" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
@@ -343,17 +342,17 @@
     <!-- 根据角色名称 查询用户信息-->
     <select id="getUserByRoleName" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-            u.*,
-            r.role_name,
-            r.role_key
+        u.*,
+        r.role_name,
+        r.role_key
         FROM
-            sys_user u
-                LEFT JOIN sys_user_role ur ON ur.user_id = u.user_id
-                LEFT JOIN sys_role r ON r.role_id = ur.role_id
+        sys_user u
+        LEFT JOIN sys_user_role ur ON ur.user_id = u.user_id
+        LEFT JOIN sys_role r ON r.role_id = ur.role_id
         WHERE
-            r.del_flag = 0
-          AND u.del_flag = 0
-          AND u.STATUS = 0
+        r.del_flag = 0
+        AND u.del_flag = 0
+        AND u.STATUS = 0
         <if test="roleCodeList != null and roleCodeList.size() != 0 ">
             and r.role_key in
             <foreach collection="roleCodeList" item="item" separator=","
@@ -363,7 +362,12 @@
         </if>
 
     </select>
-
+    <select id="getRoleKeyByUserId" resultType="java.lang.String" parameterType="java.lang.String">
+         select t2.role_key
+         from sys_user_role t1
+         left join sys_role t2 on t1.role_id = t2.role_id
+         where t1.user_id = #{userId}
+    </select>
 
 
 </mapper>