导出修改

This commit is contained in:
Lenovo 2024-07-19 15:41:55 +08:00
parent 477f161bb8
commit 7c70e102c4
10 changed files with 123 additions and 69 deletions

View File

@ -9,9 +9,11 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.business.domain.BusStoreDayHistoryInfo;
import com.ruoyi.business.domain.BusStoreDayInfo;
import com.ruoyi.business.domain.BusStoreExcelInfo;
import com.ruoyi.business.domain.BusStoreInfo;
import com.ruoyi.business.service.IBusReturnVisitInfoService;
import com.ruoyi.business.service.IBusStoreDayInfoService;
import com.ruoyi.business.service.IBusStoreInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
@ -44,6 +46,8 @@ public class BusStoreDayHistoryInfoController extends BaseController
@Autowired
private IBusStoreDayHistoryInfoService busStoreDayHistoryInfoService;
@Autowired
private IBusStoreDayInfoService busStoreDayInfoService;
@Autowired
private IBusStoreInfoService busStoreInfoService;
@Autowired
private IBusReturnVisitInfoService iBusReturnVisitInfoService;
@ -80,8 +84,9 @@ public class BusStoreDayHistoryInfoController extends BaseController
int visitCount = iBusReturnVisitInfoService.getByDate(storeInfo.getStoreCode(),sT,eT);
excelInfo.setVisitNumber(visitCount);
BusStoreDayHistoryInfo data = busStoreDayHistoryInfoService.getByDate(storeId,sT,eT);
if (data != null && data.getLastPositiveReviewsNum() != null){
// BusStoreDayHistoryInfo data = busStoreDayHistoryInfoService.getByDate(storeId,sT,eT);
BusStoreDayInfo data = busStoreDayInfoService.getByDate(storeId,sT,eT);
if (data != null){
excelInfo.setCommentsNumber(data.getLastPositiveReviewsNum());
totalComments += data.getLastPositiveReviewsNum();
}else{

View File

@ -314,6 +314,24 @@ public class BusStoreInfoController extends BaseController {
if(list1.size() == 1){
info.setReturnVisitUserRange(list1.get(0).getMinOrderNum()+"~"+list1.get(0).getMaxOrderNum());
}
if("1".equals(info.getPlatformType())){
info.setPlatformType("美团");
}
if ("1".equals(info.getGrantStatus())){
info.setGrantStatus("在线");
}else if("2".equals(info.getGrantStatus())){
info.setGrantStatus("掉线");
}
if ("1".equals(info.getReturnVisitStatus())){
info.setReturnVisitStatus("开启");
}else if("2".equals(info.getReturnVisitStatus())){
info.setReturnVisitStatus("关闭");
}
if ("1".equals(info.getSelfDeliveryStatus())){
info.setSelfDeliveryStatus("正常");
}else if("2".equals(info.getSelfDeliveryStatus())){
info.setSelfDeliveryStatus("自配送");
}
return info;
})
.collect(Collectors.toList());

View File

@ -1,5 +1,7 @@
package com.ruoyi.business.resp;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.ruoyi.business.domain.BusStoreInfo;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
@ -22,6 +24,7 @@ public class RespBusStoreInfo {
*/
@ApiModelProperty(name = "平台类型")
@Excel(name = "平台类型")
@JSONField(ordinal = 1)
private String platformType;
/**
@ -29,6 +32,7 @@ public class RespBusStoreInfo {
*/
@ApiModelProperty(name = "编号")
@Excel(name = "编号")
@JSONField(ordinal = 2)
private String storeCode;
/**
@ -36,6 +40,7 @@ public class RespBusStoreInfo {
*/
@ApiModelProperty(name = "名称")
@Excel(name = "名称")
@JSONField(ordinal = 3)
private String storeName;
/**
@ -44,11 +49,47 @@ public class RespBusStoreInfo {
// @ApiModelProperty(name = "归属")
private String storeBelong;
@ApiModelProperty(name = "昨日订单量")
@Excel(name = "昨日单量")
@JSONField(ordinal = 4)
private int lastOrderNum;
/** 昨日好评量 */
@ApiModelProperty(name = "昨日好评量")
@Excel(name = "昨日好评量")
@JSONField(ordinal = 5)
private int lastPositiveReviewsNum;
/** 昨日五星量 */
@ApiModelProperty(name = "昨日五星量")
@Excel(name = "昨日五星量")
@JSONField(ordinal = 6)
private int lastFiveStarReviewsNum;
/** 昨日回访量 */
@ApiModelProperty(name = "昨日回访量")
@Excel(name = "昨日回访量")
@JSONField(ordinal = 7)
private int lastReturnVisitNum;
/** 昨日回访比50% */
@ApiModelProperty(name = "昨日回访比50%")
@Excel(name = "昨日回访比")
@JSONField(ordinal = 8)
private String lastReturnVisitRate;
/** 今日回访量 */
@ApiModelProperty(name = "今日回访量")
@Excel(name = "今日回访量")
@JSONField(ordinal = 9)
private int todayReturnVisitNum;
/**
* 授权状态
*/
@ApiModelProperty(name = "授权状态")
@Excel(name = "在线状态")
@JSONField(ordinal = 10)
private String grantStatus;
/**
@ -56,6 +97,7 @@ public class RespBusStoreInfo {
*/
@ApiModelProperty(name = "回访状态")
@Excel(name = "是否开启")
@JSONField(ordinal = 11)
private String returnVisitStatus;
/**
@ -63,6 +105,7 @@ public class RespBusStoreInfo {
*/
@ApiModelProperty(name = "是否自配送")
@Excel(name = "是否自配送")
@JSONField(ordinal = 12)
private String selfDeliveryStatus;
/**
@ -70,6 +113,7 @@ public class RespBusStoreInfo {
*/
@ApiModelProperty(name = "回访用户区间{=营销用户下单?}")
@Excel(name = "营销用户区间")
@JSONField(ordinal = 13)
private String returnVisitUserRange;
/**
@ -83,6 +127,7 @@ public class RespBusStoreInfo {
*/
@ApiModelProperty(name = "归属销售姓名")
@Excel(name = "归属销售姓名")
@JSONField(ordinal = 14)
private String saleBindName;
/**
@ -91,38 +136,11 @@ public class RespBusStoreInfo {
@ApiModelProperty(name = "绑定时间(创建)")
private Date bindTime;
/** 昨日订单量 */
@ApiModelProperty(name = "昨日订单量")
@Excel(name = "昨日单量")
private int lastOrderNum;
/** 昨日好评量 */
@ApiModelProperty(name = "昨日好评量")
@Excel(name = "昨日好评量")
private int lastPositiveReviewsNum;
/** 昨日五星量 */
@ApiModelProperty(name = "昨日五星量")
@Excel(name = "昨日五星量")
private int lastFiveStarReviewsNum;
/** 昨日回访量 */
@ApiModelProperty(name = "昨日回访量")
@Excel(name = "昨日回访量")
private int lastReturnVisitNum;
/** 昨日回访比50% */
@ApiModelProperty(name = "昨日回访比50%")
@Excel(name = "昨日回访比")
private String lastReturnVisitRate;
/** 今日回访量 */
@ApiModelProperty(name = "今日回访量")
@Excel(name = "今日回访量")
private int todayReturnVisitNum;
/** 评分 */
@Excel(name = "评分")
@JSONField(ordinal = 15)
private String score;
public RespBusStoreInfo() {

View File

@ -1,7 +1,10 @@
package com.ruoyi.business.mapper;
import java.util.List;
import com.ruoyi.business.domain.BusStoreDayHistoryInfo;
import com.ruoyi.business.domain.BusStoreDayInfo;
import org.apache.ibatis.annotations.Param;
/**
* 店铺单日信息Mapper接口
@ -58,4 +61,5 @@ public interface BusStoreDayInfoMapper
* @return 结果
*/
public int deleteBusStoreDayInfoByIds(Long[] ids);
BusStoreDayInfo getByDate(@Param("id") Long id, @Param("sT") String sT, @Param("eT") String eT);
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.business.service;
import java.util.List;
import com.ruoyi.business.domain.BusStoreDayHistoryInfo;
import com.ruoyi.business.domain.BusStoreDayInfo;
/**
@ -58,4 +60,5 @@ public interface IBusStoreDayInfoService
* @return 结果
*/
public int deleteBusStoreDayInfoById(Long id);
BusStoreDayInfo getByDate(Long id, String sT, String eT);
}

View File

@ -1,6 +1,8 @@
package com.ruoyi.business.service.impl;
import java.util.List;
import com.ruoyi.business.domain.BusStoreDayHistoryInfo;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -92,4 +94,9 @@ public class BusStoreDayInfoServiceImpl implements IBusStoreDayInfoService
{
return busStoreDayInfoMapper.deleteBusStoreDayInfoById(id);
}
@Override
public BusStoreDayInfo getByDate(Long id, String sT, String eT) {
return busStoreDayInfoMapper.getByDate(id, sT,eT);
}
}

View File

@ -7,20 +7,16 @@ import com.ruoyi.business.domain.*;
import com.ruoyi.business.mapper.*;
import com.ruoyi.business.service.*;
import com.ruoyi.common.config.ProxyProperties;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import jdk.nashorn.internal.runtime.logging.Logger;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
@ -32,14 +28,12 @@ import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.apache.ibatis.javassist.Loader;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -47,7 +41,6 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
/**
* 采集美团数据service

View File

@ -31,12 +31,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ifnull(a.last_positive_reviews_num,0) as commentsNumber,
ifnull(b.price,0) as price,
(ifnull(b.price,0) * ifnull(a.last_return_visit_num,0)) as money
from bus_store_day_history_info a INNER JOIN bus_store_info b on b.id = a.store_id
from bus_store_day_info a INNER JOIN bus_store_info b on b.id = a.store_id
</sql>
<select id="selectBusStoreDayHistoryInfoList" parameterType="com.ruoyi.business.domain.BusStoreExcelInfo" resultType="com.ruoyi.business.domain.BusStoreExcelInfo">
<include refid="selectBusStoreDayHistoryInfoVo1"/>
<where>
DATE_FORMAT(a.create_time,'%Y-%m-%d') = DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 1 DAY),'%Y-%m-%d')
DATE_FORMAT(a.create_time,'%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
and b.self_delivery_status != '3'
<if test="storeList != null">
and a.store_id in

View File

@ -94,4 +94,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getByDate" resultMap="BusStoreDayInfoResult">
<include refid="selectBusStoreDayInfoVo"/>
where store_id = #{id} and DATE_SUB(create_time, INTERVAL 1 DAY) between #{sT} and #{eT}
</select>
</mapper>

View File

@ -789,7 +789,7 @@ export default {
handleExport(data) {
this.download('business/store/export', {
...this.queryParams1
}, `export_${new Date().getTime()}.xlsx`)
}, `store_${new Date().getTime()}.xlsx`)
}
}
};