导出表格

This commit is contained in:
Lenovo 2024-07-15 18:34:45 +08:00
parent 8fc60d48ea
commit 5c4c42d5c8
14 changed files with 754 additions and 20 deletions

View File

@ -23,11 +23,12 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -53,6 +54,8 @@ public class BusStoreInfoController extends BaseController {
private IBusReturnVisitInfoService iBusReturnVisitInfoService;
@Autowired
private IBusAgentInfoService agentInfoService;
@Autowired
private IBusStoreDayHistoryInfoService busStoreDayHistoryInfoService;
/**
* 查询店铺信息列表
@ -218,9 +221,61 @@ public class BusStoreInfoController extends BaseController {
// @PreAuthorize("@ss.hasPermi('business:store:export')")
@Log(title = "店铺信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BusStoreInfo busStoreInfo) {
List<BusStoreInfo> list = busStoreInfoService.selectBusStoreInfoList(busStoreInfo);
ExcelUtil<BusStoreInfo> util = new ExcelUtil<BusStoreInfo>(BusStoreInfo.class);
public void export(Long id,String expStartTime,String expEndTime,HttpServletResponse response) throws Exception {
String startTime = expStartTime;
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
BusStoreInfo storeInfo = busStoreInfoService.selectBusStoreInfoById(id);
List<BusStoreExcelInfo> list = new ArrayList<>();
if (storeInfo != null) {
int totalComments = 0;
BigDecimal totamMoney = new BigDecimal("0");
while (dateFormat.parse(startTime).getTime() <= dateFormat.parse(expEndTime).getTime()){
BusStoreExcelInfo excelInfo = new BusStoreExcelInfo();
excelInfo.setOrderDate(startTime);
excelInfo.setCommentsDate(startTime);
String sT = startTime+" 00:00:00";
String eT = startTime+" 23:59:59";
int visitCount = iBusReturnVisitInfoService.getByDate(storeInfo.getStoreCode(),sT,eT);
excelInfo.setVisitNumber(visitCount);
BusStoreDayHistoryInfo data = busStoreDayHistoryInfoService.getByDate(id,sT,eT);
if (data != null && data.getLastPositiveReviewsNum() != null){
excelInfo.setCommentsNumber(data.getLastPositiveReviewsNum());
totalComments += data.getLastPositiveReviewsNum();
}else{
excelInfo.setCommentsNumber(0);
}
// excelInfo.setPrice(storeInfo.getPrice());
excelInfo.setPrice("3");
BigDecimal money = new BigDecimal("3").multiply(new BigDecimal(visitCount));
excelInfo.setMoney(money.toString());
totamMoney = totamMoney.add(money);
list.add(excelInfo);
Calendar calendar = Calendar.getInstance();
calendar.setTime(dateFormat.parse(startTime));
calendar.add(Calendar.DAY_OF_YEAR, 1);
Date newDate = calendar.getTime();
startTime = dateFormat.format(newDate);
}
BusStoreExcelInfo info1 = new BusStoreExcelInfo();
info1.setOrderDate("合计好评量");
info1.setCommentsDate(String.valueOf(totalComments));
info1.setVisitNumber(null);
info1.setCommentsNumber(null);
BusStoreExcelInfo info2 = new BusStoreExcelInfo();
info2.setOrderDate("合计金额");
info2.setCommentsDate(totamMoney.toString());
info2.setVisitNumber(null);
info2.setCommentsNumber(null);
list.add(info1);
list.add(info2);
}
ExcelUtil<BusStoreExcelInfo> util = new ExcelUtil<>(BusStoreExcelInfo.class);
util.exportExcel(response, list, "店铺信息数据");
}

View File

@ -0,0 +1,150 @@
package com.ruoyi.business.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 店铺单日信息对象 bus_store_day_info
*
* @author ruoyi
* @date 2024-07-02
*/
public class BusStoreDayHistoryInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 店铺id */
@Excel(name = "店铺id")
private Long storeId;
/** 昨日订单量 */
@Excel(name = "昨日订单量")
private int lastOrderNum;
/** 昨日好评量 */
@Excel(name = "昨日好评量")
private Integer lastPositiveReviewsNum;
/** 昨日五星量 */
@Excel(name = "昨日五星量")
private int lastFiveStarReviewsNum;
/** 昨日回访量 */
@Excel(name = "昨日回访量")
private int lastReturnVisitNum;
/** 昨日回访比50% */
@Excel(name = "昨日回访比50%")
private String lastReturnVisitRate;
/** 今日回访量 */
@Excel(name = "今日回访量")
private int todayReturnVisitNum;
/** 评分 */
@Excel(name = "评分")
private String score;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setStoreId(Long storeId)
{
this.storeId = storeId;
}
public Long getStoreId()
{
return storeId;
}
public void setLastOrderNum(int lastOrderNum)
{
this.lastOrderNum = lastOrderNum;
}
public int getLastOrderNum()
{
return lastOrderNum;
}
public void setLastPositiveReviewsNum(Integer lastPositiveReviewsNum)
{
this.lastPositiveReviewsNum = lastPositiveReviewsNum;
}
public Integer getLastPositiveReviewsNum()
{
return lastPositiveReviewsNum;
}
public void setLastFiveStarReviewsNum(int lastFiveStarReviewsNum)
{
this.lastFiveStarReviewsNum = lastFiveStarReviewsNum;
}
public int getLastFiveStarReviewsNum()
{
return lastFiveStarReviewsNum;
}
public void setLastReturnVisitNum(int lastReturnVisitNum)
{
this.lastReturnVisitNum = lastReturnVisitNum;
}
public int getLastReturnVisitNum()
{
return lastReturnVisitNum;
}
public void setLastReturnVisitRate(String lastReturnVisitRate)
{
this.lastReturnVisitRate = lastReturnVisitRate;
}
public String getLastReturnVisitRate()
{
return lastReturnVisitRate;
}
public void setTodayReturnVisitNum(int todayReturnVisitNum)
{
this.todayReturnVisitNum = todayReturnVisitNum;
}
public int getTodayReturnVisitNum()
{
return todayReturnVisitNum;
}
public void setScore(String score)
{
this.score = score;
}
public String getScore()
{
return score;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("storeId", getStoreId())
.append("lastOrderNum", getLastOrderNum())
.append("lastPositiveReviewsNum", getLastPositiveReviewsNum())
.append("lastFiveStarReviewsNum", getLastFiveStarReviewsNum())
.append("lastReturnVisitNum", getLastReturnVisitNum())
.append("lastReturnVisitRate", getLastReturnVisitRate())
.append("todayReturnVisitNum", getTodayReturnVisitNum())
.append("score", getScore())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -0,0 +1,91 @@
package com.ruoyi.business.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 店铺信息对象 bus_store_info
*
* @author ruoyi
* @date 2024-07-03
*/
public class BusStoreExcelInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
@Excel(name = "订单日期")
private String orderDate;
/** 店铺编码 */
@Excel(name = "好评日期")
private String commentsDate;
/** 店铺名称 */
@Excel(name = "拨打电话量")
private Integer visitNumber;
/** 店铺账号 */
@Excel(name = "好评量")
private Integer commentsNumber;
/** 店铺密码 */
@Excel(name = "单价")
private String price;
/** 店铺cookie */
@Excel(name = "金额")
private String money;
public String getOrderDate() {
return orderDate;
}
public void setOrderDate(String orderDate) {
this.orderDate = orderDate;
}
public String getCommentsDate() {
return commentsDate;
}
public void setCommentsDate(String commentsDate) {
this.commentsDate = commentsDate;
}
public int getVisitNumber() {
return visitNumber;
}
public void setVisitNumber(Integer visitNumber) {
this.visitNumber = visitNumber;
}
public int getCommentsNumber() {
return commentsNumber;
}
public void setCommentsNumber(Integer commentsNumber) {
this.commentsNumber = commentsNumber;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getMoney() {
return money;
}
public void setMoney(String money) {
this.money = money;
}
}

View File

@ -66,4 +66,5 @@ public interface BusReturnVisitInfoMapper
List<BusReturnVisitInfo> selectBusReturnVisitInfoListByDate(@Param("storeCode") String storeCode,@Param("date") String date);
int countByToday(String storeCode);
int getByDate(@Param("storeCode") String storeCode, @Param("sT") String sT, @Param("eT") String eT);
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.business.mapper;
import com.ruoyi.business.domain.BusStoreDayHistoryInfo;
import com.ruoyi.business.domain.BusStoreDayInfo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 店铺单日信息Mapper接口
*
* @author ruoyi
* @date 2024-07-02
*/
public interface BusStoreDayHistoryInfoMapper
{
/**
* 查询店铺单日信息
*
* @param id 店铺单日信息主键
* @return 店铺单日信息
*/
public BusStoreDayHistoryInfo selectBusStoreDayHistoryInfoById(Long id);
/**
* 查询店铺单日信息列表
*
* @param busStoreDayHistoryInfo 店铺单日信息
* @return 店铺单日信息集合
*/
public List<BusStoreDayHistoryInfo> selectBusStoreDayHistoryInfoList(BusStoreDayHistoryInfo busStoreDayHistoryInfo);
/**
* 新增店铺单日信息
*
* @param busStoreDayHistoryInfo 店铺单日信息
* @return 结果
*/
public int insertBusStoreDayHistoryInfo(BusStoreDayHistoryInfo busStoreDayHistoryInfo);
/**
* 修改店铺单日信息
*
* @param busStoreDayHistoryInfo 店铺单日信息
* @return 结果
*/
public int updateBusStoreDayHistoryInfo(BusStoreDayHistoryInfo busStoreDayHistoryInfo);
/**
* 删除店铺单日信息
*
* @param id 店铺单日信息主键
* @return 结果
*/
public int deleteBusStoreDayHistoryInfoById(Long id);
/**
* 批量删除店铺单日信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBusStoreDayHistoryInfoByIds(Long[] ids);
BusStoreDayHistoryInfo getByDate(@Param("id") Long id, @Param("sT") String sT, @Param("eT") String eT);
}

View File

@ -62,4 +62,5 @@ public interface IBusReturnVisitInfoService
List<BusReturnVisitInfo> selectBusReturnVisitInfoListByDate(String storeCode, String date);
int countByToday(String storeCode);
int getByDate(String storeCode, String sT,String eT);
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.business.service;
import com.ruoyi.business.domain.BusStoreDayHistoryInfo;
import java.util.List;
/**
* 店铺单日信息Service接口
*
* @author ruoyi
* @date 2024-07-02
*/
public interface IBusStoreDayHistoryInfoService
{
/**
* 查询店铺单日信息
*
* @param id 店铺单日信息主键
* @return 店铺单日信息
*/
public BusStoreDayHistoryInfo selectBusStoreDayHistoryInfoById(Long id);
/**
* 查询店铺单日信息列表
*
* @param busStoreDayHistoryInfo 店铺单日信息
* @return 店铺单日信息集合
*/
public List<BusStoreDayHistoryInfo> selectBusStoreDayHistoryInfoList(BusStoreDayHistoryInfo busStoreDayHistoryInfo);
/**
* 新增店铺单日信息
*
* @param busStoreDayHistoryInfo 店铺单日信息
* @return 结果
*/
public int insertBusStoreDayHistoryInfo(BusStoreDayHistoryInfo busStoreDayHistoryInfo);
/**
* 修改店铺单日信息
*
* @param busStoreDayHistoryInfo 店铺单日信息
* @return 结果
*/
public int updateBusStoreDayHistoryInfo(BusStoreDayHistoryInfo busStoreDayHistoryInfo);
/**
* 批量删除店铺单日信息
*
* @param ids 需要删除的店铺单日信息主键集合
* @return 结果
*/
public int deleteBusStoreDayHistoryInfoByIds(Long[] ids);
/**
* 删除店铺单日信息信息
*
* @param id 店铺单日信息主键
* @return 结果
*/
public int deleteBusStoreDayHistoryInfoById(Long id);
BusStoreDayHistoryInfo getByDate(Long id, String sT,String eT);
}

View File

@ -115,4 +115,9 @@ public class BusReturnVisitInfoServiceImpl implements IBusReturnVisitInfoService
public int countByToday(String storeCode) {
return busReturnVisitInfoMapper.countByToday(storeCode);
}
@Override
public int getByDate(String storeCode, String sT, String eT) {
return busReturnVisitInfoMapper.getByDate(storeCode,sT,eT);
}
}

View File

@ -0,0 +1,104 @@
package com.ruoyi.business.service.impl;
import com.ruoyi.business.domain.BusStoreDayHistoryInfo;
import com.ruoyi.business.domain.BusStoreDayInfo;
import com.ruoyi.business.mapper.BusStoreDayHistoryInfoMapper;
import com.ruoyi.business.mapper.BusStoreDayInfoMapper;
import com.ruoyi.business.service.IBusStoreDayHistoryInfoService;
import com.ruoyi.business.service.IBusStoreDayInfoService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 店铺单日信息Service业务层处理
*
* @author ruoyi
* @date 2024-07-02
*/
@Service
public class BusStoreDayHistoryInfoServiceImpl implements IBusStoreDayHistoryInfoService
{
@Autowired
private BusStoreDayHistoryInfoMapper busStoreDayHistoryInfoMapper;
/**
* 查询店铺单日信息
*
* @param id 店铺单日信息主键
* @return 店铺单日信息
*/
@Override
public BusStoreDayHistoryInfo selectBusStoreDayHistoryInfoById(Long id)
{
return busStoreDayHistoryInfoMapper.selectBusStoreDayHistoryInfoById(id);
}
/**
* 查询店铺单日信息列表
*
* @param busStoreDayHistoryInfo 店铺单日信息
* @return 店铺单日信息
*/
@Override
public List<BusStoreDayHistoryInfo> selectBusStoreDayHistoryInfoList(BusStoreDayHistoryInfo busStoreDayHistoryInfo)
{
return busStoreDayHistoryInfoMapper.selectBusStoreDayHistoryInfoList(busStoreDayHistoryInfo);
}
/**
* 新增店铺单日信息
*
* @param busStoreDayHistoryInfo 店铺单日信息
* @return 结果
*/
@Override
public int insertBusStoreDayHistoryInfo(BusStoreDayHistoryInfo busStoreDayHistoryInfo)
{
busStoreDayHistoryInfo.setCreateTime(DateUtils.getNowDate());
return busStoreDayHistoryInfoMapper.insertBusStoreDayHistoryInfo(busStoreDayHistoryInfo);
}
/**
* 修改店铺单日信息
*
* @param busStoreDayHistoryInfo 店铺单日信息
* @return 结果
*/
@Override
public int updateBusStoreDayHistoryInfo(BusStoreDayHistoryInfo busStoreDayHistoryInfo)
{
return busStoreDayHistoryInfoMapper.updateBusStoreDayHistoryInfo(busStoreDayHistoryInfo);
}
/**
* 批量删除店铺单日信息
*
* @param ids 需要删除的店铺单日信息主键
* @return 结果
*/
@Override
public int deleteBusStoreDayHistoryInfoByIds(Long[] ids)
{
return busStoreDayHistoryInfoMapper.deleteBusStoreDayHistoryInfoByIds(ids);
}
/**
* 删除店铺单日信息信息
*
* @param id 店铺单日信息主键
* @return 结果
*/
@Override
public int deleteBusStoreDayHistoryInfoById(Long id)
{
return busStoreDayHistoryInfoMapper.deleteBusStoreDayHistoryInfoById(id);
}
@Override
public BusStoreDayHistoryInfo getByDate(Long id, String sT, String eT) {
return busStoreDayHistoryInfoMapper.getByDate(id, sT,eT);
}
}

View File

@ -31,6 +31,7 @@ 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;
@ -76,6 +77,8 @@ public class MeituanServiceImpl implements IMeituanService {
private BusReturnVisitInfoMapper busReturnVisitInfoMapper;
@Autowired
private BusStoreConfigInfoMapper busStoreConfigInfoMapper;
@Autowired
private BusStoreDayHistoryInfoMapper busStoreDayHistoryInfoMapper;
private static CloseableHttpClient client1 = HttpClientBuilder.create().build();
@ -611,6 +614,12 @@ public class MeituanServiceImpl implements IMeituanService {
busStoreDayInfo = list1.get(0);
busStoreDayInfo.setLastReturnVisitNum(list.size());
busStoreDayInfoMapper.updateBusStoreDayInfo(busStoreDayInfo);
BusStoreDayHistoryInfo target = new BusStoreDayHistoryInfo();
BeanUtils.copyProperties(busStoreDayInfo,target);
target.setId(null);
busStoreDayHistoryInfoMapper.insertBusStoreDayHistoryInfo(target);
}
}
}

View File

@ -98,4 +98,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="getByDate" resultType="java.lang.Integer">
select count(id) from bus_return_visit_info where store_code = #{storeCode} and return_visit_time between #{sT} and #{eT}
</select>
</mapper>

View File

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.business.mapper.BusStoreDayHistoryInfoMapper">
<resultMap type="BusStoreDayHistoryInfo" id="BusStoreDayHistoryInfoResult">
<result property="id" column="id" />
<result property="storeId" column="store_id" />
<result property="lastOrderNum" column="last_order_num" />
<result property="lastPositiveReviewsNum" column="last_positive_reviews_num" />
<result property="lastFiveStarReviewsNum" column="last_five_star_reviews_num" />
<result property="lastReturnVisitNum" column="last_return_visit_num" />
<result property="lastReturnVisitRate" column="last_return_visit_rate" />
<result property="todayReturnVisitNum" column="today_return_visit_num" />
<result property="score" column="score" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectBusStoreDayHistoryInfoVo">
select id, store_id, last_order_num, last_positive_reviews_num, last_five_star_reviews_num, last_return_visit_num, last_return_visit_rate, today_return_visit_num, score, create_time from bus_store_day_history_info
</sql>
<select id="selectBusStoreDayHistoryInfoList" parameterType="BusStoreDayHistoryInfo" resultMap="BusStoreDayHistoryInfoResult">
<include refid="selectBusStoreDayHistoryInfoVo"/>
<where>
<if test="storeId != null "> and store_id = #{storeId}</if>
<!-- <if test="lastOrderNum != null "> and last_order_num = #{lastOrderNum}</if>-->
<!-- <if test="lastPositiveReviewsNum != null "> and last_positive_reviews_num = #{lastPositiveReviewsNum}</if>-->
<!-- <if test="lastFiveStarReviewsNum != null "> and last_five_star_reviews_num = #{lastFiveStarReviewsNum}</if>-->
<!-- <if test="lastReturnVisitNum != null "> and last_return_visit_num = #{lastReturnVisitNum}</if>-->
<!-- <if test="lastReturnVisitRate != null and lastReturnVisitRate != ''"> and last_return_visit_rate = #{lastReturnVisitRate}</if>-->
<!-- <if test="todayReturnVisitNum != null "> and today_return_visit_num = #{todayReturnVisitNum}</if>-->
<!-- <if test="score != null and score != ''"> and score = #{score}</if>-->
</where>
</select>
<select id="selectBusStoreDayHistoryInfoById" parameterType="Long" resultMap="BusStoreDayHistoryInfoResult">
<include refid="selectBusStoreDayHistoryInfoVo"/>
where id = #{id}
</select>
<insert id="insertBusStoreDayHistoryInfo" parameterType="BusStoreDayHistoryInfo">
insert into bus_store_day_history_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="storeId != null">store_id,</if>
<if test="lastOrderNum != null">last_order_num,</if>
<if test="lastPositiveReviewsNum != null">last_positive_reviews_num,</if>
<if test="lastFiveStarReviewsNum != null">last_five_star_reviews_num,</if>
<if test="lastReturnVisitNum != null">last_return_visit_num,</if>
<if test="lastReturnVisitRate != null">last_return_visit_rate,</if>
<if test="todayReturnVisitNum != null">today_return_visit_num,</if>
<if test="score != null">score,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="storeId != null">#{storeId},</if>
<if test="lastOrderNum != null">#{lastOrderNum},</if>
<if test="lastPositiveReviewsNum != null">#{lastPositiveReviewsNum},</if>
<if test="lastFiveStarReviewsNum != null">#{lastFiveStarReviewsNum},</if>
<if test="lastReturnVisitNum != null">#{lastReturnVisitNum},</if>
<if test="lastReturnVisitRate != null">#{lastReturnVisitRate},</if>
<if test="todayReturnVisitNum != null">#{todayReturnVisitNum},</if>
<if test="score != null">#{score},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateBusStoreDayHistoryInfo" parameterType="BusStoreDayHistoryInfo">
update bus_store_day_history_info
<trim prefix="SET" suffixOverrides=",">
<if test="storeId != null">store_id = #{storeId},</if>
<if test="lastOrderNum != null">last_order_num = #{lastOrderNum},</if>
<if test="lastPositiveReviewsNum != null">last_positive_reviews_num = #{lastPositiveReviewsNum},</if>
<if test="lastFiveStarReviewsNum != null">last_five_star_reviews_num = #{lastFiveStarReviewsNum},</if>
<if test="lastReturnVisitNum != null">last_return_visit_num = #{lastReturnVisitNum},</if>
<if test="lastReturnVisitRate != null">last_return_visit_rate = #{lastReturnVisitRate},</if>
<if test="todayReturnVisitNum != null">today_return_visit_num = #{todayReturnVisitNum},</if>
<if test="score != null">score = #{score},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBusStoreDayHistoryInfoById" parameterType="Long">
delete from bus_store_day_history_info where id = #{id}
</delete>
<delete id="deleteBusStoreDayHistoryInfoByIds" parameterType="String">
delete from bus_store_day_history_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getByDate" resultMap="BusStoreDayHistoryInfoResult">
<include refid="selectBusStoreDayHistoryInfoVo"/>
where store_id = #{id} and create_time between #{sT} and #{eT}
</select>
</mapper>

View File

@ -82,4 +82,12 @@ export function nowIntegral() {
})
}
export function handleExport(data) {
return request({
url: '/business/store/export',
method: 'post',
data: data
})
}

View File

@ -217,6 +217,12 @@
icon="el-icon-mouse"
@click="handleOpen(scope.row)"
>后台</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-mouse"
@click="export1(scope.row)"
>导出</el-button>
</template>
</el-table-column>
</el-table>
@ -370,12 +376,33 @@
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="open1" width="800px" append-to-body>
<el-form ref="form1" :model="form1" label-width="150px">
<el-form-item label="导出时段" prop="start_time">
<el-date-picker
v-model="timeRange1"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
:picker-options="pickerOptions"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitExport"> </el-button>
<el-button @click="cancel1"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listStore, changeReturnVisitStatus, getMtUrl, changeSelfDeliveryStatus, getStoreConfig, updateStoreConfig, refresh, getStoreStatistics,nowIntegral } from "@/api/business/store";
import { listStore, changeReturnVisitStatus, getMtUrl, changeSelfDeliveryStatus, getStoreConfig, updateStoreConfig, refresh, getStoreStatistics,nowIntegral,handleExport } from "@/api/business/store";
import { listSaleA} from "@/api/business/sale";
export default {
@ -403,6 +430,8 @@ export default {
nowIntegral: 0,
//
open: false,
open1: false,
//
openDataScope: false,
map: {
@ -424,10 +453,17 @@ export default {
returnVisitStatus: undefined,
selfDeliveryStatus: 1
},
queryParams1: {
id: undefined,
expStartTime: undefined,
expEndTime: undefined
},
saleList: [],
timeRange: undefined,
timeRange1: undefined,
//
form: {},
form1: {},
defaultProps: {
children: "children",
label: "label"
@ -443,6 +479,9 @@ export default {
timeRange: [
{ required: true, message: "运营时间不能为空", trigger: "blur" }
],
timeRange1: [
{ required: true, message: "时间不能为空", trigger: "blur" }
],
quota: [
{ required: true, message: "限额不能为空", trigger: "blur" }
]
@ -530,12 +569,21 @@ export default {
this.open = false;
this.reset();
},
cancel1() {
this.open1 = false;
this.reset1();
},
//
cancelDataScope() {
this.openDataScope = false;
this.reset();
},
//
reset1() {
this.timeRange1 = ['',''];
this.form1= {};
this.resetForm("form1");
},
reset() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
@ -613,6 +661,12 @@ export default {
this.title = "新增配置";
}
});
},
export1(row) {
this.form1.id = row.id;
this.open1 = true;
},
/** 提交按钮 */
submitForm: function() {
@ -633,6 +687,24 @@ export default {
}
});
},
submitExport: function() {
if(this.timeRange1==undefined || this.timeRange1.length == 0){
this.$modal.msgSuccess("请填写时段!");
return
}
this.form1.exportStartTime = this.timeRange1[0]
this.form1.exportEndTime = this.timeRange1[1]
this.$refs["form1"].validate(valid => {
if (valid) {
this.queryParams1.expStartTime = this.form1.exportStartTime;
this.queryParams1.expEndTime = this.form1.exportEndTime;
this.queryParams1.id = this.form1.id;
this.handleExport(this.queryParams1);
this.cancel1();
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除解绑编号为"' + row.storeCode + '"的店铺?').then(function() {
@ -656,11 +728,11 @@ export default {
});
},
/** 导出按钮操作 */
handleExport() {
this.download('business/store/export', {
...this.queryParams
}, `role_${new Date().getTime()}.xlsx`)
}
handleExport(data) {
this.download('business/store/export', {
...this.queryParams1
}, `export_${new Date().getTime()}.xlsx`)
}
}
};
</script>