浏览代码

Merge branch 'test'

zhaoxian 3 年之前
父节点
当前提交
6d064320b5
共有 28 个文件被更改,包括 328 次插入207 次删除
  1. 1 1
      ruixuan-admin/src/main/java/com/ruixuan/web/controller/system/SysIndustryController.java
  2. 1 1
      ruixuan-live/src/main/java/com/ruixuan/data/service/IKuaishouLiveDataAnalysisService.java
  3. 1 1
      ruixuan-live/src/main/java/com/ruixuan/data/service/IKuaishouLiveDataFunnelService.java
  4. 1 1
      ruixuan-live/src/main/java/com/ruixuan/data/service/IKuaishouLiveDataKanbanService.java
  5. 1 1
      ruixuan-live/src/main/java/com/ruixuan/data/service/IKuaishouLiveDataOverviewService.java
  6. 18 13
      ruixuan-live/src/main/java/com/ruixuan/data/service/impl/KuaishouLiveDataAnalysisServiceImpl.java
  7. 14 9
      ruixuan-live/src/main/java/com/ruixuan/data/service/impl/KuaishouLiveDataFunnelServiceImpl.java
  8. 27 22
      ruixuan-live/src/main/java/com/ruixuan/data/service/impl/KuaishouLiveDataKanbanServiceImpl.java
  9. 14 9
      ruixuan-live/src/main/java/com/ruixuan/data/service/impl/KuaishouLiveDataOverviewServiceImpl.java
  10. 7 2
      ruixuan-live/src/main/java/com/ruixuan/data/utils/ExportExcelUtils.java
  11. 3 0
      ruixuan-live/src/main/java/com/ruixuan/data/utils/LiveDataExcelUtils.java
  12. 2 2
      ruixuan-live/src/main/java/com/ruixuan/live/controller/KuaishouLiveBroadcastController.java
  13. 18 7
      ruixuan-live/src/main/java/com/ruixuan/live/controller/KuaishouLiveUserAccountController.java
  14. 5 4
      ruixuan-live/src/main/java/com/ruixuan/live/entity/KuaishouLiveBroadcast.java
  15. 5 2
      ruixuan-live/src/main/java/com/ruixuan/live/mapper/KuaishouLiveUserAccountMapper.java
  16. 2 2
      ruixuan-live/src/main/java/com/ruixuan/live/service/IKuaishouLiveBroadcastService.java
  17. 4 1
      ruixuan-live/src/main/java/com/ruixuan/live/service/IKuaishouLiveUserAccountService.java
  18. 81 93
      ruixuan-live/src/main/java/com/ruixuan/live/service/impl/KuaishouLiveBroadcastServiceImpl.java
  19. 9 3
      ruixuan-live/src/main/java/com/ruixuan/live/service/impl/KuaishouLiveUserAccountServiceImpl.java
  20. 2 1
      ruixuan-live/src/main/resources/mapper/live/KuaishouLiveBroadcastMapper.xml
  21. 12 17
      ruixuan-live/src/main/resources/mapper/live/KuaishouLiveUserAccountMapper.xml
  22. 23 5
      ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/controller/DemoController.java
  23. 8 0
      ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/mapper/TestMapper.java
  24. 15 7
      ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/pojo/TestPojo.java
  25. 7 0
      ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/service/impl/SaleClueInfoServiceImpl.java
  26. 1 1
      ruixuan-salesLeads/src/main/resources/mapper/salesLeads/SaleClueInfoMapper.xml
  27. 39 2
      ruixuan-salesLeads/src/main/resources/mapper/salesLeads/TestMapper.xml
  28. 7 0
      ruixuan-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 1 - 1
ruixuan-admin/src/main/java/com/ruixuan/web/controller/system/SysIndustryController.java

@@ -54,7 +54,7 @@ public class SysIndustryController extends BaseController
     @Autowired
     @Autowired
     private ISysIndustryService industryService;
     private ISysIndustryService industryService;
 
 
-    @ApiOperation(value = "根据用户id查询用户以及角色信息",notes = "根据用户id查询用户以及角色信息")
+    @ApiOperation(value = "查询所有行业信息",notes = "查询所有行业信息")
     @GetMapping("/getIndustryInfoList")
     @GetMapping("/getIndustryInfoList")
     public ResultResponse<List<SysIndustryInfo>> getIndustryInfoList(){
     public ResultResponse<List<SysIndustryInfo>> getIndustryInfoList(){
 
 

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/data/service/IKuaishouLiveDataAnalysisService.java

@@ -61,5 +61,5 @@ public interface IKuaishouLiveDataAnalysisService {
      */
      */
     public int deleteKuaishouLiveDataAnalysisByKsId(Long ksId);
     public int deleteKuaishouLiveDataAnalysisByKsId(Long ksId);
 
 
-    int inserExcelInfo(KuaishouLiveBroadcast broadcast,List<JSONObject> list);
+    int inserExcelInfo(KuaishouLiveBroadcast broadcast,List<JSONObject> list) throws Exception;
 }
 }

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/data/service/IKuaishouLiveDataFunnelService.java

@@ -61,5 +61,5 @@ public interface IKuaishouLiveDataFunnelService {
      */
      */
     public int deleteKuaishouLiveDataFunnelByKsId(Long ksId);
     public int deleteKuaishouLiveDataFunnelByKsId(Long ksId);
 
 
-    int inserExcelInfo(KuaishouLiveBroadcast broadcast,List<JSONObject> list);
+    int inserExcelInfo(KuaishouLiveBroadcast broadcast,List<JSONObject> list) throws Exception;
 }
 }

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/data/service/IKuaishouLiveDataKanbanService.java

@@ -61,5 +61,5 @@ public interface IKuaishouLiveDataKanbanService {
      */
      */
     public int deleteKuaishouLiveDataKanbanByKsId(Long ksId);
     public int deleteKuaishouLiveDataKanbanByKsId(Long ksId);
 
 
-    int inserExcelInfo(KuaishouLiveBroadcast broadcast,List<JSONObject> list);
+    int inserExcelInfo(KuaishouLiveBroadcast broadcast,List<JSONObject> list) throws Exception;
 }
 }

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/data/service/IKuaishouLiveDataOverviewService.java

@@ -61,5 +61,5 @@ public interface IKuaishouLiveDataOverviewService {
      */
      */
     public int deleteKuaishouLiveDataOverviewByKsId(Long ksId);
     public int deleteKuaishouLiveDataOverviewByKsId(Long ksId);
 
 
-    int inserExcelInfo(KuaishouLiveBroadcast broadcast,List<JSONObject> list);
+    int inserExcelInfo(KuaishouLiveBroadcast broadcast,List<JSONObject> list) throws Exception;
 }
 }

+ 18 - 13
ruixuan-live/src/main/java/com/ruixuan/data/service/impl/KuaishouLiveDataAnalysisServiceImpl.java

@@ -92,25 +92,29 @@ public class KuaishouLiveDataAnalysisServiceImpl implements IKuaishouLiveDataAna
     }
     }
 
 
     @Override
     @Override
-    public int inserExcelInfo(KuaishouLiveBroadcast broadcast, List<JSONObject> list) {
+    public int inserExcelInfo(KuaishouLiveBroadcast broadcast, List<JSONObject> list) throws Exception {
         /* excel表头:商品名称	商品上架时间	商品价格	商品销售额	商品销量	待支付订单数
         /* excel表头:商品名称	商品上架时间	商品价格	商品销售额	商品销量	待支付订单数
            对应字段编码:0,1,2...
            对应字段编码:0,1,2...
          */
          */
         try {
         try {
             List<KuaishouLiveDataAnalysis> analysisList = new ArrayList<>();
             List<KuaishouLiveDataAnalysis> analysisList = new ArrayList<>();
             for (JSONObject cell : list) {
             for (JSONObject cell : list) {
-                KuaishouLiveDataAnalysis analysis = new KuaishouLiveDataAnalysis();
-                analysis.setKsId(broadcast.getKsId());
-                analysis.setKsName(broadcast.getKsName());
-                analysis.setAccountId(broadcast.getAccountId());
-                analysis.setAccountName(broadcast.getAccountName());
-                analysis.setWaresName(cell.getString("0"));
-                analysis.setWaresPutDate(cell.getString("1"));
-                analysis.setWaresPrice(cell.getBigDecimal("2"));
-                analysis.setWaresSalesAmount(cell.getBigDecimal("3"));
-                analysis.setWaresSalesVolume(cell.getBigDecimal("4"));
-                analysis.setTopayOrders(cell.getLong("5"));
-                analysisList.add(analysis);
+                if (cell.size() == 6) {
+                    KuaishouLiveDataAnalysis analysis = new KuaishouLiveDataAnalysis();
+                    analysis.setKsId(broadcast.getKsId());
+                    analysis.setKsName(broadcast.getKsName());
+                    analysis.setAccountId(broadcast.getAccountId());
+                    analysis.setAccountName(broadcast.getAccountName());
+                    analysis.setWaresName(cell.getString("0"));
+                    analysis.setWaresPutDate(cell.getString("1"));
+                    analysis.setWaresPrice(cell.getBigDecimal("2"));
+                    analysis.setWaresSalesAmount(cell.getBigDecimal("3"));
+                    analysis.setWaresSalesVolume(cell.getBigDecimal("4"));
+                    analysis.setTopayOrders(cell.getLong("5"));
+                    analysisList.add(analysis);
+                } else {
+                    throw new Exception("商品分析列不对");
+                }
             }
             }
 
 
             int i = kuaishouLiveDataAnalysisMapper.inserExcelBatchInfo(analysisList);
             int i = kuaishouLiveDataAnalysisMapper.inserExcelBatchInfo(analysisList);
@@ -119,6 +123,7 @@ public class KuaishouLiveDataAnalysisServiceImpl implements IKuaishouLiveDataAna
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
+            throw new Exception("商品分析数据列异常");
         }
         }
         return 0;
         return 0;
     }
     }

+ 14 - 9
ruixuan-live/src/main/java/com/ruixuan/data/service/impl/KuaishouLiveDataFunnelServiceImpl.java

@@ -92,20 +92,24 @@ public class KuaishouLiveDataFunnelServiceImpl implements IKuaishouLiveDataFunne
     }
     }
 
 
     @Override
     @Override
-    public int inserExcelInfo(KuaishouLiveBroadcast broadcast, List<JSONObject> list) {
+    public int inserExcelInfo(KuaishouLiveBroadcast broadcast, List<JSONObject> list) throws Exception {
          /* excel表头:日期	累计观看人数
          /* excel表头:日期	累计观看人数
            对应字段编码:0,1         */
            对应字段编码:0,1         */
         try {
         try {
             List<KuaishouLiveDataFunnel> funnelList = new ArrayList<>();
             List<KuaishouLiveDataFunnel> funnelList = new ArrayList<>();
             for (JSONObject cell : list) {
             for (JSONObject cell : list) {
-                KuaishouLiveDataFunnel funnel = new KuaishouLiveDataFunnel();
-                funnel.setKsId(broadcast.getKsId());
-                funnel.setKsName(broadcast.getKsName());
-                funnel.setAccountId(broadcast.getAccountId());
-                funnel.setAccountName(broadcast.getAccountName());
-                funnel.setStatDate(cell.getString("0"));
-                funnel.setAllViewers(cell.getLong("1"));
-                funnelList.add(funnel);
+                if (cell.size() == 2) {
+                    KuaishouLiveDataFunnel funnel = new KuaishouLiveDataFunnel();
+                    funnel.setKsId(broadcast.getKsId());
+                    funnel.setKsName(broadcast.getKsName());
+                    funnel.setAccountId(broadcast.getAccountId());
+                    funnel.setAccountName(broadcast.getAccountName());
+                    funnel.setStatDate(cell.getString("0"));
+                    funnel.setAllViewers(cell.getLong("1"));
+                    funnelList.add(funnel);
+                } else {
+                    throw new Exception("直播漏斗数据列不对");
+                }
             }
             }
             int i = kuaishouLiveDataFunnelMapper.inserExcelBatchInfo(funnelList);
             int i = kuaishouLiveDataFunnelMapper.inserExcelBatchInfo(funnelList);
             if (i > 0) {
             if (i > 0) {
@@ -113,6 +117,7 @@ public class KuaishouLiveDataFunnelServiceImpl implements IKuaishouLiveDataFunne
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
+            throw new Exception("直播漏斗数据列异常");
         }
         }
         return 0;
         return 0;
     }
     }

+ 27 - 22
ruixuan-live/src/main/java/com/ruixuan/data/service/impl/KuaishouLiveDataKanbanServiceImpl.java

@@ -92,34 +92,38 @@ public class KuaishouLiveDataKanbanServiceImpl implements IKuaishouLiveDataKanba
     }
     }
 
 
     @Override
     @Override
-    public int inserExcelInfo(KuaishouLiveBroadcast broadcast, List<JSONObject> list) {
+    public int inserExcelInfo(KuaishouLiveBroadcast broadcast, List<JSONObject> list) throws Exception {
       /* excel表头:实时在线观看人数	观看人数	观看次数	人均观看时长	粉丝平均观看时长	打赏数	上架商品数
       /* excel表头:实时在线观看人数	观看人数	观看次数	人均观看时长	粉丝平均观看时长	打赏数	上架商品数
       新增粉丝数	点赞数	商品点击人数	小黄车点击数	累计成交金额	累计成交人数	累计成交订单数	成交转化率
       新增粉丝数	点赞数	商品点击人数	小黄车点击数	累计成交金额	累计成交人数	累计成交订单数	成交转化率
            对应字段编码:0,1,2....         */
            对应字段编码:0,1,2....         */
         try {
         try {
             List<KuaishouLiveDataKanban> kanbanList = new ArrayList<>();
             List<KuaishouLiveDataKanban> kanbanList = new ArrayList<>();
             for (JSONObject cell : list) {
             for (JSONObject cell : list) {
-                KuaishouLiveDataKanban kanban = new KuaishouLiveDataKanban();
-                kanban.setKsId(broadcast.getKsId());
-                kanban.setKsName(broadcast.getKsName());
-                kanban.setAccountId(broadcast.getAccountId());
-                kanban.setAccountName(broadcast.getAccountName());
-                kanban.setOnlineViewers(cell.getLong("0"));
-                kanban.setViewers(cell.getLong("1"));
-                kanban.setViewingTimes(cell.getLong("2"));
-                kanban.setPerViewingTime(cell.getString("3"));
-                kanban.setFansViewingTime(cell.getString("4"));
-                kanban.setRewards(cell.getLong("5"));
-                kanban.setPutWares(cell.getLong("6"));
-                kanban.setNewFans(cell.getLong("7"));
-                kanban.setLikes(cell.getLong("8"));
-                kanban.setWaresClicks(cell.getLong("9"));
-                kanban.setCarClicks(cell.getLong("10"));
-                kanban.setAllAmount(cell.getBigDecimal("11"));
-                kanban.setAllTurnover(cell.getLong("12"));
-                kanban.setAllOrders(cell.getLong("13"));
-                kanban.setTurnoverRatio(cell.getString("14"));
-                kanbanList.add(kanban);
+                if (cell.size() == 15) {
+                    KuaishouLiveDataKanban kanban = new KuaishouLiveDataKanban();
+                    kanban.setKsId(broadcast.getKsId());
+                    kanban.setKsName(broadcast.getKsName());
+                    kanban.setAccountId(broadcast.getAccountId());
+                    kanban.setAccountName(broadcast.getAccountName());
+                    kanban.setOnlineViewers(cell.getLong("0"));
+                    kanban.setViewers(cell.getLong("1"));
+                    kanban.setViewingTimes(cell.getLong("2"));
+                    kanban.setPerViewingTime(cell.getString("3"));
+                    kanban.setFansViewingTime(cell.getString("4"));
+                    kanban.setRewards(cell.getLong("5"));
+                    kanban.setPutWares(cell.getLong("6"));
+                    kanban.setNewFans(cell.getLong("7"));
+                    kanban.setLikes(cell.getLong("8"));
+                    kanban.setWaresClicks(cell.getLong("9"));
+                    kanban.setCarClicks(cell.getLong("10"));
+                    kanban.setAllAmount(cell.getBigDecimal("11"));
+                    kanban.setAllTurnover(cell.getLong("12"));
+                    kanban.setAllOrders(cell.getLong("13"));
+                    kanban.setTurnoverRatio(cell.getString("14"));
+                    kanbanList.add(kanban);
+                } else {
+                    throw new Exception("直播数据看板数据列不对");
+                }
             }
             }
 
 
             int i = kuaishouLiveDataKanbanMapper.inserExcelBatchInfo(kanbanList);
             int i = kuaishouLiveDataKanbanMapper.inserExcelBatchInfo(kanbanList);
@@ -128,6 +132,7 @@ public class KuaishouLiveDataKanbanServiceImpl implements IKuaishouLiveDataKanba
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
+            throw new Exception("直播数据看板数据列异常");
         }
         }
         return 0;
         return 0;
     }
     }

+ 14 - 9
ruixuan-live/src/main/java/com/ruixuan/data/service/impl/KuaishouLiveDataOverviewServiceImpl.java

@@ -92,21 +92,25 @@ public class KuaishouLiveDataOverviewServiceImpl implements IKuaishouLiveDataOve
     }
     }
 
 
     @Override
     @Override
-    public int inserExcelInfo(KuaishouLiveBroadcast broadcast, List<JSONObject> list) {
+    public int inserExcelInfo(KuaishouLiveBroadcast broadcast, List<JSONObject> list) throws Exception {
         /* excel表头:日期	成交金额
         /* excel表头:日期	成交金额
         对应字段编码:0,1
         对应字段编码:0,1
         */
         */
         try {
         try {
             List<KuaishouLiveDataOverview> overviewList = new ArrayList<>();
             List<KuaishouLiveDataOverview> overviewList = new ArrayList<>();
             for (JSONObject cell : list) {
             for (JSONObject cell : list) {
-                KuaishouLiveDataOverview overview = new KuaishouLiveDataOverview();
-                overview.setKsId(broadcast.getKsId());
-                overview.setKsName(broadcast.getKsName());
-                overview.setAccountId(broadcast.getAccountId());
-                overview.setAccountName(broadcast.getAccountName());
-                overview.setStatDate(cell.getString("0"));
-                overview.setAmounts(cell.getBigDecimal("1"));
-                overviewList.add(overview);
+                if (cell.size() == 2) {
+                    KuaishouLiveDataOverview overview = new KuaishouLiveDataOverview();
+                    overview.setKsId(broadcast.getKsId());
+                    overview.setKsName(broadcast.getKsName());
+                    overview.setAccountId(broadcast.getAccountId());
+                    overview.setAccountName(broadcast.getAccountName());
+                    overview.setStatDate(cell.getString("0"));
+                    overview.setAmounts(cell.getBigDecimal("1"));
+                    overviewList.add(overview);
+                } else {
+                    throw new Exception("直播数据概览数据列不对");
+                }
             }
             }
             int i = kuaishouLiveDataOverviewMapper.inserExcelBatchInfo(overviewList);
             int i = kuaishouLiveDataOverviewMapper.inserExcelBatchInfo(overviewList);
             if (i > 0) {
             if (i > 0) {
@@ -114,6 +118,7 @@ public class KuaishouLiveDataOverviewServiceImpl implements IKuaishouLiveDataOve
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
+            throw new Exception("直播数据概览数据列异常");
         }
         }
         return 0;
         return 0;
 
 

+ 7 - 2
ruixuan-live/src/main/java/com/ruixuan/data/utils/ExportExcelUtils.java

@@ -310,7 +310,12 @@ public class ExportExcelUtils {
                         Date date = cell.getDateCellValue();
                         Date date = cell.getDateCellValue();
                         if (date != null) {
                         if (date != null) {
                             if (date.getHours() > 0 || date.getMinutes() > 0) {
                             if (date.getHours() > 0 || date.getMinutes() > 0) {
-                                value = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
+                                value = new SimpleDateFormat("yyyy-MM-dd").format(date);
+                                if ("1899-12-31".equals(value)) {
+                                    value = new SimpleDateFormat("HH:mm:ss").format(date);
+                                } else {
+                                    value = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
+                                }
                             } else {
                             } else {
                                 value = new SimpleDateFormat("yyyy-MM-dd").format(date);
                                 value = new SimpleDateFormat("yyyy-MM-dd").format(date);
                             }
                             }
@@ -318,7 +323,7 @@ public class ExportExcelUtils {
                             value = "";
                             value = "";
                         }
                         }
                     } else {
                     } else {
-                        value = new DecimalFormat("0.00").format(cell.getNumericCellValue()).replace(".00", "");
+                        value = new DecimalFormat("0.0000").format(cell.getNumericCellValue()).replace(".0000", "");
                     }
                     }
                     break;
                     break;
                 case STRING: // 字符串
                 case STRING: // 字符串

+ 3 - 0
ruixuan-live/src/main/java/com/ruixuan/data/utils/LiveDataExcelUtils.java

@@ -4,9 +4,12 @@ import cn.hutool.core.util.CharsetUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.utils.StringUtils;
 import com.ruixuan.common.utils.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 

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

@@ -100,7 +100,7 @@ public class KuaishouLiveBroadcastController extends BaseController {
     @ApiOperation(value = "数据上传")
     @ApiOperation(value = "数据上传")
     public ResultResponse dataUpload(
     public ResultResponse dataUpload(
             @ApiParam("直播id") @RequestParam(value = "id", required = true) String id,
             @ApiParam("直播id") @RequestParam(value = "id", required = true) String id,
-            @ApiParam("实际GMV") @RequestParam(value = "actualGmv", required = true) Long actualGmv,
+            @ApiParam("实际GMV") @RequestParam(value = "actualGmv", required = true) String actualGmv,
             @ApiParam("文件集") @RequestParam(value = "files", required = false) MultipartFile[] files,
             @ApiParam("文件集") @RequestParam(value = "files", required = false) MultipartFile[] files,
             @ApiParam("数据大盘图片链接") @RequestParam(value = "dapanUrls", required = false) String dapanUrls,
             @ApiParam("数据大盘图片链接") @RequestParam(value = "dapanUrls", required = false) String dapanUrls,
             @ApiParam("画像分析图片链接") @RequestParam(value = "portraitUrls", required = false) String portraitUrls) {
             @ApiParam("画像分析图片链接") @RequestParam(value = "portraitUrls", required = false) String portraitUrls) {
@@ -125,7 +125,7 @@ public class KuaishouLiveBroadcastController extends BaseController {
     public ResultResponse replay(
     public ResultResponse replay(
             @ApiParam("直播id") @RequestParam(value = "id", required = true) String id,
             @ApiParam("直播id") @RequestParam(value = "id", required = true) String id,
             @ApiParam("图片") @RequestParam(value = "replayPictureUrls", required = false) String replayPictureUrls,
             @ApiParam("图片") @RequestParam(value = "replayPictureUrls", required = false) String replayPictureUrls,
-            @ApiParam("复盘数据") @RequestParam(value = "replayFile", required = false) MultipartFile replayFile) {
+            @ApiParam("复盘数据") @RequestParam(value = "replayFile", required = false) String replayFile) {
 
 
         try {
         try {
             if ( Check.isNull(replayPictureUrls) && Check.isNull(replayFile)) {
             if ( Check.isNull(replayPictureUrls) && Check.isNull(replayFile)) {

+ 18 - 7
ruixuan-live/src/main/java/com/ruixuan/live/controller/KuaishouLiveUserAccountController.java

@@ -51,13 +51,24 @@ public class KuaishouLiveUserAccountController extends BaseController {
     }
     }
 
 
     /**
     /**
-     * 查询快手昵称/账户集合
+     * 查询快手昵称
      */
      */
     @GetMapping("/queryNicknameList")
     @GetMapping("/queryNicknameList")
-    @ApiOperation(value = "查询快手昵称/账户集合")
-    public TableDataInfo queryNicknameList(KuaishouLiveUserAccount kuaishouLiveUserAccount) {
-        startPage();
-        List<JSONObject> list = kuaishouLiveUserAccountService.queryNicknameList(kuaishouLiveUserAccount);
+    @ApiOperation(value = "查询快手昵称集合")
+    public TableDataInfo queryNicknameList() {
+        // startPage();
+        List<JSONObject> list = kuaishouLiveUserAccountService.queryNicknameList();
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询快手账户集合
+     */
+    @GetMapping("/queryAccountListByKsId")
+    @ApiOperation(value = "查询快手账户集合")
+    public TableDataInfo queryAccountListByKsId(@ApiParam("快手ID") @RequestParam(value = "ksId", required = true) Long ksId) {
+        // startPage();
+        List<JSONObject> list = kuaishouLiveUserAccountService.queryAccountListByKsId(ksId);
         return getDataTable(list);
         return getDataTable(list);
     }
     }
 
 
@@ -65,8 +76,8 @@ public class KuaishouLiveUserAccountController extends BaseController {
      * 查询运营/销售
      * 查询运营/销售
      */
      */
     @GetMapping("/queryRoles")
     @GetMapping("/queryRoles")
-    @ApiOperation(value = "查询(1-运营/2-销售)人员集")
-    public ResultResponse queryRoles(@ApiParam("类型:1-运营/2-销售") @RequestParam(value = "type", required = true) String type) {
+    @ApiOperation(value = "查询(1-运营/2-销售/3-设计)人员集")
+    public ResultResponse queryRoles(@ApiParam("类型:1-运营/2-销售/3-设计") @RequestParam(value = "type", required = false) String type) {
         return kuaishouLiveUserAccountService.queryRoles(type);
         return kuaishouLiveUserAccountService.queryRoles(type);
     }
     }
 
 

+ 5 - 4
ruixuan-live/src/main/java/com/ruixuan/live/entity/KuaishouLiveBroadcast.java

@@ -7,6 +7,7 @@ import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
+import java.util.Iterator;
 
 
 /**
 /**
  * 快手—直播对象 kuaishou_live_broadcast
  * 快手—直播对象 kuaishou_live_broadcast
@@ -52,25 +53,25 @@ public class KuaishouLiveBroadcast implements Serializable {
      * 实际GMV
      * 实际GMV
      */
      */
     @ApiModelProperty(name = "实际GMV")
     @ApiModelProperty(name = "实际GMV")
-    private Long actualGmv;
+    private String actualGmv;
 
 
     /**
     /**
      * 目标GMV
      * 目标GMV
      */
      */
     @ApiModelProperty(name = "目标GMV")
     @ApiModelProperty(name = "目标GMV")
-    private Long goalGmv;
+    private String goalGmv;
 
 
     private String gmvRoi;
     private String gmvRoi;
 
 
     /**
     /**
      * 上传文件数 (默认为0,后续上传数据时更新)
      * 上传文件数 (默认为0,后续上传数据时更新)
      */
      */
-    private int uploadFileCount;
+    private Integer uploadFileCount;
 
 
     /**
     /**
      * 上传图片数 (默认为0,后续上传数据时更新)
      * 上传图片数 (默认为0,后续上传数据时更新)
      */
      */
-    private int uploadPictureCount;
+    private Integer uploadPictureCount;
 
 
     /**
     /**
      * 直播时间
      * 直播时间

+ 5 - 2
ruixuan-live/src/main/java/com/ruixuan/live/mapper/KuaishouLiveUserAccountMapper.java

@@ -61,7 +61,10 @@ public interface KuaishouLiveUserAccountMapper {
      */
      */
     int deleteKuaishouLiveUserAccountByIds(String[] ids);
     int deleteKuaishouLiveUserAccountByIds(String[] ids);
 
 
-    List<JSONObject> queryNicknameList(KuaishouLiveUserAccount kuaishouLiveUserAccount);
+    List<JSONObject> queryNicknameList();
+
+    List<JSONObject> queryAccountListByKsId(Long ksId);
+
+    KuaishouLiveUserAccount getOne(@Param("ksId") Long ksId, @Param("accountName") String accountName);
 
 
-    KuaishouLiveUserAccount getOne(@Param("ksId") Long ksId,@Param("accountName") String accountName);
 }
 }

+ 2 - 2
ruixuan-live/src/main/java/com/ruixuan/live/service/IKuaishouLiveBroadcastService.java

@@ -63,7 +63,7 @@ public interface IKuaishouLiveBroadcastService {
      */
      */
     public int deleteKuaishouLiveBroadcastById(String id);
     public int deleteKuaishouLiveBroadcastById(String id);
 
 
-    ResultResponse dataUpload(String id, Long actualGmv, String dapanUrls, String portraitUrls, MultipartFile[] files) throws Exception;
+    ResultResponse dataUpload(String id, String actualGmv, String dapanUrls, String portraitUrls, MultipartFile[] files) throws Exception;
 
 
-    ResultResponse replay(String id, String replayPictureUrls, MultipartFile replayFile);
+    ResultResponse replay(String id, String replayPictureUrls, String replayFile);
 }
 }

+ 4 - 1
ruixuan-live/src/main/java/com/ruixuan/live/service/IKuaishouLiveUserAccountService.java

@@ -62,7 +62,10 @@ public interface IKuaishouLiveUserAccountService {
      */
      */
     public int deleteKuaishouLiveUserAccountById(String id);
     public int deleteKuaishouLiveUserAccountById(String id);
 
 
-    List<JSONObject> queryNicknameList(KuaishouLiveUserAccount kuaishouLiveUserAccount);
+    List<JSONObject> queryNicknameList();
+
+    List<JSONObject> queryAccountListByKsId(Long ksId);
 
 
     ResultResponse queryRoles(String type);
     ResultResponse queryRoles(String type);
+
 }
 }

+ 81 - 93
ruixuan-live/src/main/java/com/ruixuan/live/service/impl/KuaishouLiveBroadcastServiceImpl.java

@@ -1,9 +1,9 @@
 package com.ruixuan.live.service.impl;
 package com.ruixuan.live.service.impl;
 
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.core.domain.ResultResponse;
 import com.ruixuan.common.core.domain.ResultResponse;
-import com.ruixuan.common.cos.CosUpload;
 import com.ruixuan.common.utils.Check;
 import com.ruixuan.common.utils.Check;
 import com.ruixuan.data.service.IKuaishouLiveDataAnalysisService;
 import com.ruixuan.data.service.IKuaishouLiveDataAnalysisService;
 import com.ruixuan.data.service.IKuaishouLiveDataFunnelService;
 import com.ruixuan.data.service.IKuaishouLiveDataFunnelService;
@@ -132,7 +132,7 @@ public class KuaishouLiveBroadcastServiceImpl implements IKuaishouLiveBroadcastS
         KuaishouLiveBroadcast checkOne = kuaishouLiveBroadcastMapper.getOne(broadcast);
         KuaishouLiveBroadcast checkOne = kuaishouLiveBroadcastMapper.getOne(broadcast);
         if (checkOne == null) {
         if (checkOne == null) {
             KuaishouLiveBroadcast copy = new KuaishouLiveBroadcast();
             KuaishouLiveBroadcast copy = new KuaishouLiveBroadcast();
-            BeanUtils.copyProperties(copy, broadcast);
+            BeanUtils.copyProperties(broadcast, copy);
             copy.setId(null);
             copy.setId(null);
             if (kuaishouLiveBroadcastMapper.getOne(copy) != null) {
             if (kuaishouLiveBroadcastMapper.getOne(copy) != null) {
                 return ResultResponse.error("当前时间段已存在直播!");
                 return ResultResponse.error("当前时间段已存在直播!");
@@ -168,7 +168,7 @@ public class KuaishouLiveBroadcastServiceImpl implements IKuaishouLiveBroadcastS
     }
     }
 
 
     @Override
     @Override
-    public ResultResponse dataUpload(String id, Long actualGmv, String dapanUrls, String portraitUrls, MultipartFile[] files) throws Exception {
+    public ResultResponse dataUpload(String id, String actualGmv, String dapanUrls, String portraitUrls, MultipartFile[] files) throws Exception {
         KuaishouLiveBroadcast broadcast = kuaishouLiveBroadcastMapper.selectKuaishouLiveBroadcastById(id);
         KuaishouLiveBroadcast broadcast = kuaishouLiveBroadcastMapper.selectKuaishouLiveBroadcastById(id);
         if (broadcast == null) {
         if (broadcast == null) {
             return ResultResponse.error("未查询到直播!");
             return ResultResponse.error("未查询到直播!");
@@ -178,108 +178,105 @@ public class KuaishouLiveBroadcastServiceImpl implements IKuaishouLiveBroadcastS
         String msg = "";
         String msg = "";
         //记录上传文件
         //记录上传文件
         int count = 0;
         int count = 0;
-        for (MultipartFile file : files) {
-            String fileName = file.getOriginalFilename();
-            if (!(fileName.endsWith(".xls") || fileName.endsWith(".xlsx") || fileName.endsWith(".csv"))) {
-                msg += fileName + "、";
-                continue;
-            }
-            List<JSONObject> list = LiveDataExcelUtils.analysisFile(file, fileName);
-            if (Check.isNotNull(list)) {
-                if (fileName.contains("看板")) {
-                    count += kanbanService.inserExcelInfo(broadcast, list);
-                } else if (fileName.contains("概览")) {
-                    count += overviewService.inserExcelInfo(broadcast, list);
-                } else if (fileName.contains("漏斗")) {
-                    count += funnelService.inserExcelInfo(broadcast, list);
-                } else if (fileName.contains("分析")) {
-                    count += analysisService.inserExcelInfo(broadcast, list);
+        try {
+            if (!(Check.isNull(files) || "".equals(files[0].getOriginalFilename()))) {
+                for (MultipartFile file : files) {
+                    String fileName = file.getOriginalFilename();
+                    if (!(fileName.endsWith(".xls") || fileName.endsWith(".xlsx") || fileName.endsWith(".csv"))) {
+                        msg += fileName + "、";
+                        continue;
+                    }
+
+                    List<JSONObject> list = LiveDataExcelUtils.analysisFile(file, fileName);
+                    if (Check.isNotNull(list)) {
+                        if (fileName.contains("看板")) {
+                            count += kanbanService.inserExcelInfo(broadcast, list);
+                        } else if (fileName.contains("概览")) {
+                            count += overviewService.inserExcelInfo(broadcast, list);
+                        } else if (fileName.contains("漏斗")) {
+                            count += funnelService.inserExcelInfo(broadcast, list);
+                        } else if (fileName.contains("分析")) {
+                            count += analysisService.inserExcelInfo(broadcast, list);
+                        }
+                    }
                 }
                 }
             }
             }
+        } catch (Exception e) {
+            return ResultResponse.error(e.getMessage());
         }
         }
-
         //上传到cos的文件夹名称 (操盘手)
         //上传到cos的文件夹名称 (操盘手)
         String upFileName = "CaoPanShou";
         String upFileName = "CaoPanShou";
-        KuaishouLiveBroadcastFiles file = new KuaishouLiveBroadcastFiles();
+        KuaishouLiveBroadcastFiles file = null;
         //上传数据大盘
         //上传数据大盘
-        if (Check.isNotNull(dapanUrls)) {
-            List<String> urls = Arrays.asList(dapanUrls.split(","));
+        if (Check.isNotNull(dapanUrls) && !"[]".equals(dapanUrls)) {
+            file = new KuaishouLiveBroadcastFiles();
+            file.setId(id);
+            List<String> urls = JSONArray.parseArray(dapanUrls, String.class);
             HashSet<String> set = new HashSet<>(urls);
             HashSet<String> set = new HashSet<>(urls);
             String urlFix = "";
             String urlFix = "";
             String names = "";
             String names = "";
-            int dapanCount = 0;
+            int dapanCount = set.size();
             for (String url : set) {
             for (String url : set) {
-                String pictureName = "dapan_000" + (dapanCount + 1);
-                String cosUrl = CosUpload.getJPGCosUrl(url, upFileName, pictureName);
-                if (Check.isNotNull(cosUrl)) {
-                    dapanCount++;
-                    int lastNo = cosUrl.lastIndexOf("/") + 1;
-                    urlFix = cosUrl.substring(0, lastNo);
-                    String name = cosUrl.substring(lastNo);
-                    if (dapanCount > 1) {
-                        names += "," + name;
-                    } else {
-                        names = name;
-                    }
+//                String pictureName = "dapan_000" + (dapanCount + 1);
+//                String cosUrl = CosUpload.getJPGCosUrl(url, upFileName, pictureName);
+                if (Check.isNotNull(url)) {
+                    int lastNo = url.lastIndexOf("/") + 1;
+                    urlFix = "https:" + url.substring(0, lastNo);
+                    String name = url.substring(lastNo);
+                    names += "," + name;
                 }
                 }
             }
             }
             file.setUpCommonUrl(urlFix);
             file.setUpCommonUrl(urlFix);
             file.setDapanCount(dapanCount);
             file.setDapanCount(dapanCount);
-            file.setDapanNames(names);
-            if (set.size() == dapanCount) {
-                file.setDapanMsg("success");
-            } else {
-                file.setDapanMsg("共上传" + set.size() + "张,成功" + dapanCount + "张");
-            }
+            file.setDapanNames(names.substring(1));
+            file.setDapanMsg("success");
         }
         }
 
 
         //画像分析上传
         //画像分析上传
-        if (Check.isNotNull(portraitUrls)) {
-            List<String> urls = Arrays.asList(portraitUrls.split(","));
+        if (Check.isNotNull(portraitUrls) && !"[]".equals(portraitUrls)) {
+            file = new KuaishouLiveBroadcastFiles();
+            file.setId(id);
+            List<String> urls = JSONArray.parseArray(portraitUrls, String.class);
             HashSet<String> set = new HashSet<>(urls);
             HashSet<String> set = new HashSet<>(urls);
             String urlFix = "";
             String urlFix = "";
             String names = "";
             String names = "";
-            int portraitCount = 0;
+            int portraitCount = set.size();
             for (String url : set) {
             for (String url : set) {
-                String pictureName = "portrait_000" + (portraitCount + 1);
-                String cosUrl = CosUpload.getJPGCosUrl(url, upFileName, pictureName);
-                if (Check.isNotNull(cosUrl)) {
-                    portraitCount++;
-                    int lastNo = cosUrl.lastIndexOf("/") + 1;
-                    urlFix = cosUrl.substring(0, lastNo);
-                    String name = cosUrl.substring(lastNo);
-                    if (portraitCount > 1) {
-                        names += "," + name;
-                    } else {
-                        names = name;
-                    }
+//                String pictureName = "portrait_000" + (portraitCount + 1);
+//                String cosUrl = CosUpload.getJPGCosUrl(url, upFileName, pictureName);
+                if (Check.isNotNull(url)) {
+                    int lastNo = url.lastIndexOf("/") + 1;
+                    urlFix = "https:" + url.substring(0, lastNo);
+                    String name = url.substring(lastNo);
+                    names += "," + name;
                 }
                 }
             }
             }
+            file.setUpCommonUrl(urlFix);
             file.setPortraitCount(portraitCount);
             file.setPortraitCount(portraitCount);
-            file.setPortraitNames(names);
-            if (set.size() == portraitCount) {
-                file.setPortraitMsg("success");
-            } else {
-                file.setPortraitMsg("共上传" + set.size() + "张,成功" + portraitCount + "张");
-            }
+            file.setPortraitNames(names.substring(1));
+            file.setPortraitMsg("success");
         }
         }
         KuaishouLiveBroadcastFiles one = filesMapper.selectKuaishouLiveBroadcastFilesById(id);
         KuaishouLiveBroadcastFiles one = filesMapper.selectKuaishouLiveBroadcastFilesById(id);
-        file.setId(id);
-        if (Check.isNull(one)) {
-            filesMapper.insertKuaishouLiveBroadcastFiles(file);
-        } else {
-            filesMapper.updateKuaishouLiveBroadcastFiles(file);
+        int uploadPictureCount = 0;
+        if (Check.isNotNull(file)) {
+            if (Check.isNull(one)) {
+                filesMapper.insertKuaishouLiveBroadcastFiles(file);
+            } else {
+                filesMapper.updateKuaishouLiveBroadcastFiles(file);
+            }
+            Integer dapanCount = Check.isNotNull(file.getDapanCount()) ? file.getDapanCount() : 0;
+            Integer portraitCount = Check.isNotNull(file.getPortraitCount()) ? file.getPortraitCount() : 0;
+            uploadPictureCount = dapanCount + portraitCount;
         }
         }
 
 
         //更新直播表
         //更新直播表
         KuaishouLiveBroadcast updateEntity = new KuaishouLiveBroadcast();
         KuaishouLiveBroadcast updateEntity = new KuaishouLiveBroadcast();
         updateEntity.setId(id);
         updateEntity.setId(id);
         updateEntity.setUploadFileCount(count);
         updateEntity.setUploadFileCount(count);
-        updateEntity.setUploadPictureCount(file.getDapanCount() + file.getPortraitCount());
+        updateEntity.setUploadPictureCount(uploadPictureCount);
         updateEntity.setActualGmv(actualGmv);
         updateEntity.setActualGmv(actualGmv);
         kuaishouLiveBroadcastMapper.updateKuaishouLiveBroadcast(updateEntity);
         kuaishouLiveBroadcastMapper.updateKuaishouLiveBroadcast(updateEntity);
 
 
-
         if (msg.length() > 0) {
         if (msg.length() > 0) {
             msg = msg.substring(0, msg.length() - 1) + "不支持文件格式";
             msg = msg.substring(0, msg.length() - 1) + "不支持文件格式";
         } else {
         } else {
@@ -290,43 +287,34 @@ public class KuaishouLiveBroadcastServiceImpl implements IKuaishouLiveBroadcastS
     }
     }
 
 
     @Override
     @Override
-    public ResultResponse replay(String id, String replayPictureUrls, MultipartFile replayFile) {
+    public ResultResponse replay(String id, String replayPictureUrls, String replayFile) {
         //上传到cos的文件夹名称 (操盘手)
         //上传到cos的文件夹名称 (操盘手)
         String upFileName = "CaoPanShou";
         String upFileName = "CaoPanShou";
         KuaishouLiveBroadcastFiles file = new KuaishouLiveBroadcastFiles();
         KuaishouLiveBroadcastFiles file = new KuaishouLiveBroadcastFiles();
         //上传复盘图片
         //上传复盘图片
-        if (Check.isNotNull(replayPictureUrls)) {
-            List<String> urls = Arrays.asList(replayPictureUrls.split(","));
+        if (Check.isNotNull(replayPictureUrls) && !"[]".equals(replayPictureUrls)) {
+            List<String> urls = JSONArray.parseArray(replayPictureUrls, String.class);
             HashSet<String> set = new HashSet<>(urls);
             HashSet<String> set = new HashSet<>(urls);
             String urlFix = "";
             String urlFix = "";
             String names = "";
             String names = "";
-            int replayPictureCount = 0;
+            int replayPictureCount = set.size();
             for (String url : set) {
             for (String url : set) {
-                String pictureName = "replayPicture_000" + (replayPictureCount + 1);
-                String cosUrl = CosUpload.getJPGCosUrl(url, upFileName, pictureName);
-                if (Check.isNotNull(cosUrl)) {
-                    replayPictureCount++;
-                    int lastNo = cosUrl.lastIndexOf("/") + 1;
-                    urlFix = cosUrl.substring(0, lastNo);
-                    String name = cosUrl.substring(lastNo);
-                    if (replayPictureCount > 1) {
-                        names += "," + name;
-                    } else {
-                        names = name;
-                    }
+//                String pictureName = "replayPicture_000" + (replayPictureCount + 1);
+//                String cosUrl = CosUpload.getJPGCosUrl(url, upFileName, pictureName);
+                if (Check.isNotNull(url)) {
+                    int lastNo = url.lastIndexOf("/") + 1;
+                    urlFix = "https:" + url.substring(0, lastNo);
+                    String name = url.substring(lastNo);
+                    names += "," + name;
                 }
                 }
             }
             }
             file.setReplayCommonUrl(urlFix);
             file.setReplayCommonUrl(urlFix);
             file.setReplayPictureCount(replayPictureCount);
             file.setReplayPictureCount(replayPictureCount);
-            file.setReplayPictureNames(names);
-            if (set.size() == replayPictureCount) {
-                file.setReplayPictureMsg("success");
-            } else {
-                file.setReplayPictureMsg("共上传" + set.size() + "张,成功" + replayPictureCount + "张");
-            }
+            file.setReplayPictureNames(names.substring(1));
+            file.setReplayPictureMsg("success");
         }
         }
         if (Check.isNotNull(replayFile)) {
         if (Check.isNotNull(replayFile)) {
-            file.setReplayFileUrl(CosUpload.getFileCosUrl(replayFile, upFileName));
+            file.setReplayFileUrl(replayFile);
         }
         }
         KuaishouLiveBroadcastFiles one = filesMapper.selectKuaishouLiveBroadcastFilesById(id);
         KuaishouLiveBroadcastFiles one = filesMapper.selectKuaishouLiveBroadcastFilesById(id);
         file.setId(id);
         file.setId(id);

+ 9 - 3
ruixuan-live/src/main/java/com/ruixuan/live/service/impl/KuaishouLiveUserAccountServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.core.domain.ResultResponse;
 import com.ruixuan.common.core.domain.ResultResponse;
+import com.ruixuan.common.utils.Check;
 import com.ruixuan.live.entity.KuaishouLiveUserAccount;
 import com.ruixuan.live.entity.KuaishouLiveUserAccount;
 import com.ruixuan.live.entity.KuaishouLiveUserAccountPart;
 import com.ruixuan.live.entity.KuaishouLiveUserAccountPart;
 import com.ruixuan.live.mapper.KuaishouLiveUserAccountMapper;
 import com.ruixuan.live.mapper.KuaishouLiveUserAccountMapper;
@@ -82,7 +83,7 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
                 obj.put("accountName", account.getAccountName());
                 obj.put("accountName", account.getAccountName());
                 obj.put("createrId", account.getCreaterId());
                 obj.put("createrId", account.getCreaterId());
             }
             }
-            if (collaborators != null) {
+            if (Check.isNotNull(collaborators)) {
                 accountPartMapper.replaceBatch(collaborators);
                 accountPartMapper.replaceBatch(collaborators);
             }
             }
         }
         }
@@ -148,8 +149,13 @@ public class KuaishouLiveUserAccountServiceImpl implements IKuaishouLiveUserAcco
     }
     }
 
 
     @Override
     @Override
-    public List<JSONObject> queryNicknameList(KuaishouLiveUserAccount kuaishouLiveUserAccount) {
-        return kuaishouLiveUserAccountMapper.queryNicknameList(kuaishouLiveUserAccount);
+    public List<JSONObject> queryNicknameList() {
+        return kuaishouLiveUserAccountMapper.queryNicknameList();
+    }
+
+    @Override
+    public List<JSONObject> queryAccountListByKsId(Long ksId) {
+        return kuaishouLiveUserAccountMapper.queryAccountListByKsId(ksId);
     }
     }
 
 
     @Override
     @Override

+ 2 - 1
ruixuan-live/src/main/resources/mapper/live/KuaishouLiveBroadcastMapper.xml

@@ -42,7 +42,7 @@
                ks_name,
                ks_name,
                account_id,
                account_id,
                account_name,
                account_name,
-               if(goal_gmv > 10000, CONCAT(ROUND(goal_gmv / 10000, 2), 'W'), goal_gmv) as 'goal_gmv',
+               if(goal_gmv >= 10000, CONCAT(ROUND(goal_gmv / 10000, 2), 'W'), goal_gmv) as 'goal_gmv',
                actual_gmv,
                actual_gmv,
                if(actual_gmv is null, '-', CONCAT(ROUND(actual_gmv / goal_gmv * 100, 2), '%')) as 'gmvRoi',
                if(actual_gmv is null, '-', CONCAT(ROUND(actual_gmv / goal_gmv * 100, 2), '%')) as 'gmvRoi',
                live_time,
                live_time,
@@ -105,6 +105,7 @@
                 like concat('%', #{inputController}, '%')
                 like concat('%', #{inputController}, '%')
             </if>
             </if>
         </where>
         </where>
+        ORDER BY create_time desc
     </select>
     </select>
 
 
     <select id="selectKuaishouLiveBroadcastById" parameterType="String" resultMap="KuaishouLiveBroadcastResult">
     <select id="selectKuaishouLiveBroadcastById" parameterType="String" resultMap="KuaishouLiveBroadcastResult">

+ 12 - 17
ruixuan-live/src/main/resources/mapper/live/KuaishouLiveUserAccountMapper.xml

@@ -58,7 +58,7 @@
         put_type,
         put_type,
         IFNULL(t2.count,0) as 'count'
         IFNULL(t2.count,0) as 'count'
         from kuaishou_live_user_account t1
         from kuaishou_live_user_account t1
-        left join  (
+        left join (
         SELECT ks_id as ksId,account_name as accountName, sum(1) as 'count' FROM kuaishou_live_user_account_part
         SELECT ks_id as ksId,account_name as accountName, sum(1) as 'count' FROM kuaishou_live_user_account_part
         GROUP BY ks_id,account_name
         GROUP BY ks_id,account_name
         ) t2 ON t2.accountName = t1.account_name AND t2.ksId = t1.ks_id
         ) t2 ON t2.accountName = t1.account_name AND t2.ksId = t1.ks_id
@@ -80,9 +80,10 @@
                 #{designerLeaderId}
                 #{designerLeaderId}
             </if>
             </if>
             <if test="designerLeader != null  and designerLeader != ''">and designer_leader = #{designerLeader}</if>
             <if test="designerLeader != null  and designerLeader != ''">and designer_leader = #{designerLeader}</if>
-            <if test="putType != null  and putType != ''">and put_type = #{putType}</if>
+            <if test="putType != null  and putType != ''">and put_type like concat('%', #{putType}, '%')</if>
             <if test="createrId != null  and createrId != ''">and creater_id = #{createrId}</if>
             <if test="createrId != null  and createrId != ''">and creater_id = #{createrId}</if>
         </where>
         </where>
+        ORDER BY create_time desc
     </select>
     </select>
 
 
     <select id="getOne" parameterType="String" resultType="com.ruixuan.live.entity.KuaishouLiveUserAccount">
     <select id="getOne" parameterType="String" resultType="com.ruixuan.live.entity.KuaishouLiveUserAccount">
@@ -99,22 +100,16 @@
         where id = #{id}
         where id = #{id}
     </select>
     </select>
 
 
-    <select id="queryNicknameList" parameterType="com.ruixuan.live.entity.KuaishouLiveUserAccount"
-            resultType="com.alibaba.fastjson.JSONObject">
-        select
-        ks_id as 'ksId',
-        ks_name as 'ksName',
-        account_id as 'accountId',
-        account_name as 'accountName'
+    <select id="queryNicknameList" resultType="com.alibaba.fastjson.JSONObject">
+        select ks_id as 'ksId', ks_name as 'ksName'
         from kuaishou_live_user_account
         from kuaishou_live_user_account
-        <where>
-            <if test="ksId != null ">and ks_id = #{ksId}</if>
-            <if test="ksName != null  and ksName != ''">and ks_name like concat('%', #{ksName}, '%')</if>
-            <if test="accountId != null ">and account_id = #{accountId}</if>
-            <if test="accountName != null  and accountName != ''">and account_name like concat('%', #{accountName},
-                '%')
-            </if>
-        </where>
+        GROUP BY ks_id
+    </select>
+
+    <select id="queryAccountListByKsId" parameterType="Long" resultType="com.alibaba.fastjson.JSONObject">
+        select ks_id as 'ksId', ks_name as 'ksName', account_id as 'accountId', account_name as 'accountName'
+        from kuaishou_live_user_account
+        where ks_id = #{ksId}
     </select>
     </select>
 
 
 
 

+ 23 - 5
ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/controller/DemoController.java

@@ -1,12 +1,14 @@
 package com.ruixuan.salesLeads.controller;
 package com.ruixuan.salesLeads.controller;
 
 
 import com.alibaba.excel.EasyExcel;
 import com.alibaba.excel.EasyExcel;
+import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.core.controller.BaseController;
 import com.ruixuan.common.core.controller.BaseController;
 import com.ruixuan.common.core.domain.AjaxResult;
 import com.ruixuan.common.core.domain.AjaxResult;
 import com.ruixuan.common.core.domain.ResultResponse;
 import com.ruixuan.common.core.domain.ResultResponse;
 import com.ruixuan.common.utils.StringUtils;
 import com.ruixuan.common.utils.StringUtils;
 import com.ruixuan.common.utils.poi.ExcelUtil;
 import com.ruixuan.common.utils.poi.ExcelUtil;
 import com.ruixuan.salesLeads.listener.ImportExcelListener;
 import com.ruixuan.salesLeads.listener.ImportExcelListener;
+import com.ruixuan.salesLeads.mapper.TestMapper;
 import com.ruixuan.salesLeads.pojo.SaleClueInfoPojo;
 import com.ruixuan.salesLeads.pojo.SaleClueInfoPojo;
 import com.ruixuan.salesLeads.pojo.TestPojo;
 import com.ruixuan.salesLeads.pojo.TestPojo;
 import com.ruixuan.salesLeads.service.ITestService;
 import com.ruixuan.salesLeads.service.ITestService;
@@ -71,8 +73,8 @@ public class DemoController extends BaseController {
 
 
 
 
          //读取Excel
          //读取Excel
-        EasyExcel.read(testPojo.getFile().getInputStream(),null,
-                    new ImportExcelListener()).sheet().headRowNumber(1).doRead();
+//        EasyExcel.read(testPojo.getFile().getInputStream(),null,
+//                    new ImportExcelListener()).sheet().headRowNumber(1).doRead();
 
 
 
 
         // 从监听中获取结果集
         // 从监听中获取结果集
@@ -129,20 +131,36 @@ public class DemoController extends BaseController {
                                       @ApiParam("wenjianwenjian") @RequestParam("file") MultipartFile file
                                       @ApiParam("wenjianwenjian") @RequestParam("file") MultipartFile file
 
 
                                        ) throws Exception{
                                        ) throws Exception{
+        //logger.info("jieguo====>>>{}",lisMap);
 
 
+        return ResultResponse.successMsg("cheng.",null);
+    }
 
 
 
 
+    @Autowired
+    private TestMapper testMapper;
 
 
+    @ApiOperation(value = "导入",notes = "swagger不支持上传,请移步使用postman上传仅支持form-data。")
+    @PostMapping(value = "/importUserInit")
+    public ResultResponse importUserInit(@ApiParam("file") @RequestParam("file") MultipartFile file) throws Exception{
+        //logger.info("jieguo====>>>{}",lisMap);
 
 
 
 
+        ExcelUtil<TestPojo> util = new ExcelUtil<TestPojo>(TestPojo.class);
+        List<TestPojo> userList = util.importExcel(file.getInputStream(),1);
 
 
+        for (TestPojo testPojo : userList) {
+            JSONObject deptJson = testMapper.getDeptNameByName(testPojo.getDeptName());
+            testPojo.setDeptId(deptJson.getString("dept_id"));
+            testPojo.setUserName(testPojo.getEmail().substring(0,testPojo.getEmail().indexOf("@")));
+        }
 
 
+        testMapper.replaceUserInfoBatchInit(userList);
+        return ResultResponse.successMsg("cheng.",null);
+    }
 
 
-        //logger.info("jieguo====>>>{}",lisMap);
 
 
 
 
 
 
-        return ResultResponse.successMsg("cheng.",null);
-    }
 
 
 }
 }

+ 8 - 0
ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/mapper/TestMapper.java

@@ -1,6 +1,9 @@
 package com.ruixuan.salesLeads.mapper;
 package com.ruixuan.salesLeads.mapper;
 
 
+import com.alibaba.fastjson.JSONObject;
+import com.fasterxml.jackson.databind.JsonNode;
 import com.ruixuan.salesLeads.pojo.TestPojo;
 import com.ruixuan.salesLeads.pojo.TestPojo;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -16,4 +19,9 @@ public interface TestMapper {
 
 
 
 
     List<TestPojo> selectDemoList();
     List<TestPojo> selectDemoList();
+
+    void replaceUserInfoBatchInit(@Param("userList")List<TestPojo> userList);
+
+    JSONObject getDeptNameByName(@Param("deptName")String deptName);
+
 }
 }

+ 15 - 7
ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/pojo/TestPojo.java

@@ -1,8 +1,8 @@
 package com.ruixuan.salesLeads.pojo;
 package com.ruixuan.salesLeads.pojo;
 
 
 
 
+import com.ruixuan.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 
@@ -22,13 +22,21 @@ import java.util.List;
 public class TestPojo {
 public class TestPojo {
 
 
 
 
-    @ApiModelProperty("用户ID")
-    private Long userId;
+    @Excel(name = "序号")
+    private int number;
 
 
-    @ApiModelProperty("角色ID")
-    private Long roleId;
+    @Excel(name = "姓名")
+    private String nickName;
+    private String userName;
 
 
-    @ApiModelProperty("实体中的文件")
-    private MultipartFile file;
+    @Excel(name = "部门")
+    private String deptName;
+    private String deptId;
+
+    @Excel(name = "联系电话")
+    private String phonenumber;
+
+    @Excel(name = "邮箱")
+    private String email;
 
 
 }
 }

+ 7 - 0
ruixuan-salesLeads/src/main/java/com.ruixuan.salesLeads/service/impl/SaleClueInfoServiceImpl.java

@@ -172,6 +172,13 @@ public class SaleClueInfoServiceImpl implements ISaleClueInfoService {
             clue.setTransitionFlag(dataMap.get("transitionFlag"));
             clue.setTransitionFlag(dataMap.get("transitionFlag"));
             clue.setCreateUserId(createUserId);
             clue.setCreateUserId(createUserId);
             clue.setUploadDate(uploadDate);
             clue.setUploadDate(uploadDate);
+
+            SaleRecordVo recordVo = saleClueInfoMapper.selectSaleClueInfoBySellerId(clue.getSellerId());
+            clue.setState(StringUtils.isNotNull(recordVo) ? recordVo.getState() : 1);
+            clue.setSaleId(StringUtils.isNotNull(recordVo) && StringUtils.isNotNull(recordVo.getSaleId()) ? recordVo.getSaleId() : 0L);
+            clue.setOfflineSaleFlag(StringUtils.isNotNull(recordVo) ? recordVo.getOfflineSaleFlag() : 1);
+
+
             //查询行业
             //查询行业
             SysIndustryInfo industryInfo = sysIndustryInfoMapper.getIndustryInfoByName(dataMap.get("industryId"));
             SysIndustryInfo industryInfo = sysIndustryInfoMapper.getIndustryInfoByName(dataMap.get("industryId"));
             clue.setIndustryId(StringUtils.isNull(industryInfo) ? 0 : industryInfo.getId());
             clue.setIndustryId(StringUtils.isNull(industryInfo) ? 0 : industryInfo.getId());

+ 1 - 1
ruixuan-salesLeads/src/main/resources/mapper/salesLeads/SaleClueInfoMapper.xml

@@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		upload_date,
 		upload_date,
 		distribution_sale_flag,
 		distribution_sale_flag,
 		sale_id,
 		sale_id,
-		state,
+		`state`,
 		offline_sale_flag,
 		offline_sale_flag,
 		create_user_id,
 		create_user_id,
 		create_time)
 		create_time)

+ 39 - 2
ruixuan-salesLeads/src/main/resources/mapper/salesLeads/TestMapper.xml

@@ -5,13 +5,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 <mapper namespace="com.ruixuan.salesLeads.mapper.TestMapper">
 <mapper namespace="com.ruixuan.salesLeads.mapper.TestMapper">
 
 
 
 
-	
+	<!--
 	<select id="selectDemoList" resultType="com.ruixuan.salesLeads.pojo.TestPojo">
 	<select id="selectDemoList" resultType="com.ruixuan.salesLeads.pojo.TestPojo">
 
 
 		select * from test
 		select * from test
 
 
 	</select>
 	</select>
-	
+	-->
+
+
+	<!-- 批量用户信息 init-->
+	<insert id="replaceUserInfoBatchInit">
+		replace into sys_user(
+		dept_id,
+		user_name,
+		nick_name,
+		email,
+		phonenumber,
+		password,
+		create_by,
+		create_time)
+		values
+		<foreach collection="userList" item="info" separator=",">
+			(
+			#{info.deptId},
+			#{info.userName},
+			#{info.nickName},
+			#{info.email},
+			#{info.phonenumber},
+			'$2a$10$sZHmOSoeopPqXWFgPz0nbemoguGvLzl5YAkbbhMFWBgZI5dzNvWnq',
+			'admin',
+			NOW()
+			)
+		</foreach>
+	</insert>
+
+
+	<select id="getDeptNameByName" resultType="com.alibaba.fastjson.JSONObject">
+		SELECT * FROM sys_dept
+		WHERE dept_name = #{deptName}
+			limit 1
+
+	</select>
+
+
 
 
 
 
 
 

+ 7 - 0
ruixuan-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -295,6 +295,13 @@
             )
             )
             )
             )
         </if>
         </if>
+        <if test="type == 3 ">
+            AND t2.role_id in (
+            SELECT role_id FROM sys_role WHERE role_key in (
+            'designLeader'
+            )
+            )
+        </if>
     </select>
     </select>
 
 
     <select id="queryUserByIds" parameterType="String" resultType="com.alibaba.fastjson.JSONObject">
     <select id="queryUserByIds" parameterType="String" resultType="com.alibaba.fastjson.JSONObject">