xdd 4 днів тому
батько
коміт
4d59e87466

+ 28 - 3
fs-admin/src/main/java/com/fs/stats/SalesWatchStatisController.java

@@ -8,6 +8,8 @@ import com.fs.sop.vo.QwSopTask;
 import com.fs.statis.domain.FsStatisSalerWatch;
 import com.fs.statis.dto.StatsWatchLogPageListDTO;
 import com.fs.statis.service.FsStatisSalerWatchService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import lombok.AllArgsConstructor;
 import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -40,8 +42,16 @@ public class SalesWatchStatisController {
      */
     @PostMapping("/seller/pageList")
     public R sellerQueryList(@RequestBody StatsWatchLogPageListDTO param){
+        if(param.getPageNum() == null) {
+            param.setPageNum(1);
+        }
+        if(param.getPageSize() == null) {
+            param.setPageSize(10);
+        }
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+
         List<FsStatisSalerWatch> list = fsStatisSalerWatchService.queryList(param);
-        return R.ok().put("data",list);
+        return R.ok().put("data",new PageInfo<>(list));
     }
 
     /**
@@ -51,8 +61,16 @@ public class SalesWatchStatisController {
      */
     @PostMapping("/period/pageList")
     public R periodQueryList(@RequestBody StatsWatchLogPageListDTO param){
+        if(param.getPageNum() == null) {
+            param.setPageNum(1);
+        }
+        if(param.getPageSize() == null) {
+            param.setPageSize(10);
+        }
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+
         List<FsStatisSalerWatch> list = fsStatisSalerWatchService.queryPeriodList(param);
-        return R.ok().put("data", list);
+        return R.ok().put("data", new PageInfo<>(list));
     }
 
     /**
@@ -62,8 +80,15 @@ public class SalesWatchStatisController {
      */
     @PostMapping("/everyDay/pageList")
     public R everyDayQueryList(@RequestBody StatsWatchLogPageListDTO param){
+        if(param.getPageNum() == null) {
+            param.setPageNum(1);
+        }
+        if(param.getPageSize() == null) {
+            param.setPageSize(10);
+        }
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
         List<FsStatisSalerWatch> list = fsStatisSalerWatchService.queryTodayList(param);
-        return R.ok().put("data", list);
+        return R.ok().put("data", new PageInfo<>(list));
     }
 
     /**

+ 1 - 1
fs-service-system/src/main/java/com/fs/sop/mapper/QwSopMapper.java

@@ -371,7 +371,7 @@ public interface QwSopMapper extends BaseMapper<QwSop> {
     @Select("select * FROM qw_sop where is_rating = 1 and send_type in(2,3) and min_conversion_day is not null and max_conversion_day is not null order by create_time desc")
     List<QwSop> selectQwSopByIsRatingNotNull();
 
-
+    @DataSource(DataSourceType.SOP)
     List<QwSop> selectQwSopAllList();
 
     List<QwSop> selectQwSopListByQwUserIds(List<String> qwUserIdList);

+ 1 - 0
fs-service-system/src/main/java/com/fs/sop/service/IQwSopService.java

@@ -94,4 +94,5 @@ public interface IQwSopService
     List<SopVoiceListVo> getSopVoiceList(String id);
 
     List<QwSop> selectWxSop();
+
 }

+ 3 - 0
fs-service-system/src/main/java/com/fs/statis/dto/StatsWatchLogPageListDTO.java

@@ -27,4 +27,7 @@ public class StatsWatchLogPageListDTO implements Serializable {
      */
     private List<String> periodList;
 
+    private Integer pageNum;
+    private Integer pageSize;
+
 }

+ 9 - 0
fs-service-system/src/main/java/com/fs/statis/service/impl/FsStatisSalerWatchServiceImpl.java

@@ -129,6 +129,9 @@ public class FsStatisSalerWatchServiceImpl implements FsStatisSalerWatchService
 
     @Override
     public List<FsStatisSalerWatch> queryList(StatsWatchLogPageListDTO param) {
+        if(StringUtils.isNull(param.getStartDate()) && StringUtils.isNull(param.getEndDate())) {
+            return Collections.emptyList();
+        }
         List<FsStatisSalerWatch> fsStatisSalerWatches = fsStatisSalerWatchMapper.queryList(param);
         for (FsStatisSalerWatch item : fsStatisSalerWatches) {
             if(item.getDeptId() != null) {
@@ -158,6 +161,9 @@ public class FsStatisSalerWatchServiceImpl implements FsStatisSalerWatchService
 
     @Override
     public List<FsStatisSalerWatch> queryPeriodList(StatsWatchLogPageListDTO param) {
+        if(StringUtils.isNull(param.getStartDate()) && StringUtils.isNull(param.getEndDate())) {
+            return Collections.emptyList();
+        }
         List<FsStatisSalerWatch> fsStatisSalerWatches = fsStatisSalerWatchMapper.queryPeriodList(param);
         for (FsStatisSalerWatch item : fsStatisSalerWatches) {
             if(item.getDeptId() != null) {
@@ -186,6 +192,9 @@ public class FsStatisSalerWatchServiceImpl implements FsStatisSalerWatchService
 
     @Override
     public List<FsStatisSalerWatch> queryTodayList(StatsWatchLogPageListDTO param) {
+        if(StringUtils.isNull(param.getStartDate()) && StringUtils.isNull(param.getEndDate())) {
+            return Collections.emptyList();
+        }
         List<FsStatisSalerWatch> fsStatisSalerWatches = fsStatisSalerWatchMapper.queryTodayList(param);
         for (FsStatisSalerWatch item : fsStatisSalerWatches) {
             if(item.getDeptId() != null) {