|
@@ -10,6 +10,8 @@ import com.ylx.massage.domain.vo.HomeBlocks;
|
|
|
import com.ylx.massage.mapper.*;
|
|
|
import com.ylx.massage.service.TOrderService;
|
|
|
import com.ylx.massage.utils.DateTimeUtils;
|
|
|
+import com.ylx.massage.utils.WeChatUtil;
|
|
|
+import com.ylx.system.service.ISysOperLogService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -44,6 +46,9 @@ public class HomeController {
|
|
|
@Resource
|
|
|
private TWxUserMapper wxUserMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private ISysOperLogService operatorsLogService;
|
|
|
+
|
|
|
@Resource
|
|
|
private TJsMapper jsMapper;
|
|
|
|
|
@@ -53,6 +58,8 @@ public class HomeController {
|
|
|
@Resource
|
|
|
private TJsDayMapper jsDayMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private WeChatUtil weChatUtil;
|
|
|
@GetMapping("block")
|
|
|
@ApiOperation("首页数据块")
|
|
|
public HomeBlocks block(String deptId) {
|
|
@@ -133,6 +140,13 @@ public class HomeController {
|
|
|
homeBlocks.setUpJsNum(sumJs - currentHomeBlock.get(0).getJsNum());
|
|
|
}
|
|
|
//Optional<Integer> jsNumMax = blockJs.stream().max(Comparator.comparing(HomeBlock::getMonth)).map(i -> Optional.ofNullable(i.getJsNum()).orElse(MassageConstants.INTEGER_ZERO));
|
|
|
+ //昨日关注量
|
|
|
+ Date date = DateTimeUtils.addDays(new Date(), -1);
|
|
|
+ homeBlocks.setFollowers(weChatUtil.getFollowers(DateTimeUtils.formatDate(date), DateTimeUtils.formatDate(date)));
|
|
|
+
|
|
|
+ Integer pageViews = operatorsLogService.selectDate(DateTimeUtils.formatDate(date),DateTimeUtils.formatDate(new Date()));
|
|
|
+
|
|
|
+ homeBlocks.setPageViews(pageViews);
|
|
|
return homeBlocks;
|
|
|
}
|
|
|
|