Commit 78912ee1 authored by 许润龙's avatar 许润龙

add:红旗项目门店月度预值接口

parent 758c684c
......@@ -8,6 +8,7 @@ import com.afanticar.activity.domain.vo.ApiActivityInfoVO;
import com.afanticar.afantiopenapi.constant.Constant;
import com.afanticar.afantiopenapi.model.BaseResponse;
import com.afanticar.afantiopenapi.model.dto.FawActivityDTO;
import com.afanticar.afantiopenapi.model.entity.HongqiProjectStoreExpectedValueInfo;
import com.afanticar.afantiopenapi.model.vo.*;
import com.afanticar.afantiopenapi.service.BaseService;
import com.afanticar.afantiopenapi.service.FawOpenService;
......@@ -87,6 +88,21 @@ public class FawOpenController extends BaseController {
static String monthly = "monthly", quarter = "quarter";
@ApiOperation(value = "红旗项目门店月度预值", notes = "红旗项目门店月度预值", produces = "application/json")
@ApiImplicitParams({
@ApiImplicitParam(name = "store_code", value = "门店编码", paramType = "path", dataType = "String"),
@ApiImplicitParam(name = "expected_month", value = "预值月份", paramType = "path", dataType = "Integer"),
@ApiImplicitParam(name = "current_page", value = "页码", paramType = "path", dataType = "Integer"),
@ApiImplicitParam(name = "page_size", value = "页数", paramType = "path", dataType = "Integer"),
})
@GetMapping("/statistics")
public BaseResponse<BasePageVO<HongqiProjectStoreExpectedValueInfo>> getStatisticsInfo(@Max(value = 500, message = "单页数据page_size过大") @RequestParam(name = "page_size", defaultValue = "100", required = false) Integer pageSize,
@RequestParam(name = "current_page", defaultValue = "1", required = false) Integer pageNum,
@RequestParam(name = "store_code", required = false) String storeCode,
@RequestParam(name = "expected_month", required = false) Integer expectedMonth) {
return success(fawOpenService.getStatisticsInfo(storeCode, expectedMonth, pageNum, pageSize));
}
@ApiOperation(value = "视频数据信息", notes = "视频数据", produces = "application/json")
@ApiImplicitParams({
@ApiImplicitParam(name = "publish_date_start", value = "开始时间,格式:2023-02-01 00:00:00", required = true, paramType = "path", dataType = "Date"),
......
package com.afanticar.afantiopenapi.mapper;
import com.afanticar.afantiopenapi.model.entity.HongqiProjectStoreExpectedValueInfo;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
@DS("tmp")
public interface HongqiProjectStoreExpectedValueInfoMapper extends BaseMapper<HongqiProjectStoreExpectedValueInfo> {
}
package com.afanticar.afantiopenapi.model.entity;
import com.alibaba.fastjson.annotation.JSONType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data;
import org.springframework.data.annotation.Id;
import java.math.BigDecimal;
import java.util.Date;
/**
* 红旗项目门店月度预值表
*/
@Data
@TableName("hongqi_project_store_expected_value_info")
@JsonNaming(value = com.fasterxml.jackson.databind.PropertyNamingStrategy.SnakeCaseStrategy.class)
@JSONType(naming = com.alibaba.fastjson.PropertyNamingStrategy.SnakeCase)
public class HongqiProjectStoreExpectedValueInfo {
@Id
private Integer id;
private String groupName;
private String storeCode;
private String storeName;
private Integer expectedMonth;
private BigDecimal dailyAwemeValue;
private BigDecimal dailyLiveValue;
private BigDecimal hotAwemeValue;
private BigDecimal hotLiveValue;
private BigDecimal growthIncentiveValue;
private BigDecimal negativeIncentiveValue;
private BigDecimal teamIncentiveValue;
private BigDecimal specialProjectValue;
private BigDecimal innovateAwemeRechargeValue;
private BigDecimal replyMinute3Rate;
private BigDecimal msgConversionRate;
private BigDecimal cpl;
private BigDecimal innovateAwemeValue;
private BigDecimal hotLiveLineValue;
private Date ctime;
private Date mtime;
}
......@@ -4,16 +4,14 @@ import com.afanticar.afantiopenapi.mapper.*;
import com.afanticar.afantiopenapi.mapper.struct.HongqiAwemeIncentiveStructMapper;
import com.afanticar.afantiopenapi.mapper.struct.HongqiLiveIncentiveStructMapper;
import com.afanticar.afantiopenapi.model.dto.FawActivityDTO;
import com.afanticar.afantiopenapi.model.entity.HongqiAwemeIncentiveMonthly;
import com.afanticar.afantiopenapi.model.entity.HongqiAwemeIncentiveQuarter;
import com.afanticar.afantiopenapi.model.entity.HongqiLiveIncentiveMonthly;
import com.afanticar.afantiopenapi.model.entity.HongqiLiveIncentiveQuarter;
import com.afanticar.afantiopenapi.model.entity.*;
import com.afanticar.afantiopenapi.model.vo.*;
import com.afanticar.afantiopenapi.utils.BaseUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.mapstruct.factory.Mappers;
import org.springframework.stereotype.Service;
......@@ -45,10 +43,27 @@ public class FawOpenService {
@Resource
DwdKuaishouAuthorInfoMapper dwdKuaishouAuthorInfoMapper;
@Resource
HongqiProjectStoreExpectedValueInfoMapper hongqiProjectStoreExpectedValueInfoMapper;
static String monthly = "monthly";
static String quarter = "quarter";
public BasePageVO<HongqiProjectStoreExpectedValueInfo> getStatisticsInfo(String storeCode, Integer expectedMonth, Integer pageNum, Integer pageSize) {
PageHelper.orderBy(" expected_month desc ");
IPage<HongqiProjectStoreExpectedValueInfo> page = new Page<>(pageNum, pageSize);
QueryWrapper<HongqiProjectStoreExpectedValueInfo> queryWrapper = new QueryWrapper<>();
if (StringUtils.isNotBlank(storeCode)) {
queryWrapper.eq("store_code", storeCode);
}
if (expectedMonth != null) {
queryWrapper.eq("expected_month", expectedMonth);
}
IPage<HongqiProjectStoreExpectedValueInfo> awemePage = hongqiProjectStoreExpectedValueInfoMapper.selectPage(page, queryWrapper);
return BasePageVO.restPage(pageNum, (int) awemePage.getSize(), (int) awemePage.getTotal(), (int) awemePage.getPages(), awemePage.getRecords());
}
public BasePageVO<HongqiAwemeIncentiveVO> awemes(Date publishDateStart, Date publishDateEnd, String type, Integer pageNum, Integer pageSize) {
try {
TimeUnit.MILLISECONDS.sleep(500L);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment