店铺导出
This commit is contained in:
parent
661c503aee
commit
5c20ca12ed
|
@ -273,8 +273,50 @@ public class BusStoreInfoController extends BaseController {
|
|||
// @PreAuthorize("@ss.hasPermi('business:store:export')")
|
||||
@Log(title = "店铺信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(Long id,String expStartTime,String expEndTime,HttpServletResponse response) throws Exception {
|
||||
public void export(ReqBusStoreInfo reqBusStoreInfo,HttpServletResponse response) throws Exception {
|
||||
BusStoreInfo busStoreInfo = new BusStoreInfo();
|
||||
BeanUtils.copyProperties(reqBusStoreInfo, busStoreInfo);
|
||||
LoginUser user = SecurityUtils.getLoginUser();
|
||||
if (!"admin".equals(user.getUsername())) {
|
||||
busStoreInfo.setBindUser(user.getUsername());
|
||||
}
|
||||
List<BusStoreInfo> list = busStoreInfoService.selectBusStoreInfoList(busStoreInfo);
|
||||
List<RespBusStoreInfo> tableList = list.stream()
|
||||
.map(busStoreInfo1 -> {
|
||||
RespBusStoreInfo info = new RespBusStoreInfo(busStoreInfo1);
|
||||
BusStoreDayInfo busStoreDayInfo = new BusStoreDayInfo();
|
||||
busStoreDayInfo.setStoreId(info.getId());
|
||||
List<BusStoreDayInfo> ll = busStoreDayInfoService.selectBusStoreDayInfoList(busStoreDayInfo);
|
||||
int a = ll.get(0).getLastPositiveReviewsNum();//todo 好评-五星
|
||||
int b = ll.get(0).getLastReturnVisitNum();
|
||||
info.setLastOrderNum(ll.get(0).getLastOrderNum());
|
||||
info.setLastReturnVisitNum(b);
|
||||
info.setLastPositiveReviewsNum(a);
|
||||
info.setLastFiveStarReviewsNum(ll.get(0).getLastFiveStarReviewsNum());
|
||||
// String date = LocalDateTime.now().minusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
// List<BusReturnVisitInfo> llll = iBusReturnVisitInfoService.selectBusReturnVisitInfoListByDate(busStoreInfo1.getStoreCode(),date);
|
||||
// info.setLastReturnVisitNum(llll.size());
|
||||
info.setScore(ll.get(0).getScore());
|
||||
if (a != 0 && b != 0) {
|
||||
info.setLastReturnVisitRate(getRate(a,b));
|
||||
} else {
|
||||
info.setLastReturnVisitRate("0");
|
||||
}
|
||||
String today = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
List<BusReturnVisitInfo> lll = iBusReturnVisitInfoService.selectBusReturnVisitInfoListByDate(busStoreInfo1.getStoreCode(),today);
|
||||
info.setTodayReturnVisitNum(lll.size());
|
||||
BusStoreConfigInfo busStoreConfigInfo = new BusStoreConfigInfo();
|
||||
busStoreConfigInfo.setStoreCode(busStoreInfo1.getStoreCode());
|
||||
List<BusStoreConfigInfo> list1 = iBusStoreConfigInfoService.selectBusStoreConfigInfoList(busStoreConfigInfo);
|
||||
if(list1.size() == 1){
|
||||
info.setReturnVisitUserRange(list1.get(0).getMinOrderNum()+"~"+list1.get(0).getMaxOrderNum());
|
||||
}
|
||||
return info;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
ExcelUtil<RespBusStoreInfo> util = new ExcelUtil<>(RespBusStoreInfo.class);
|
||||
util.exportExcel(response, tableList, "店铺信息");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -21,36 +21,41 @@ public class RespBusStoreInfo {
|
|||
* 平台类型
|
||||
*/
|
||||
@ApiModelProperty(name = "平台类型")
|
||||
@Excel(name = "平台")
|
||||
private String platformType;
|
||||
|
||||
/**
|
||||
* 店铺编码
|
||||
*/
|
||||
@ApiModelProperty(name = "店铺编码")
|
||||
@ApiModelProperty(name = "编号")
|
||||
@Excel(name = "编号")
|
||||
private String storeCode;
|
||||
|
||||
/**
|
||||
* 店铺名称
|
||||
*/
|
||||
@ApiModelProperty(name = "店铺名称")
|
||||
@ApiModelProperty(name = "名称")
|
||||
@Excel(name = "名称")
|
||||
private String storeName;
|
||||
|
||||
/**
|
||||
* 店铺归属
|
||||
*/
|
||||
@ApiModelProperty(name = "店铺归属")
|
||||
// @ApiModelProperty(name = "归属")
|
||||
private String storeBelong;
|
||||
|
||||
/**
|
||||
* 授权状态
|
||||
*/
|
||||
@ApiModelProperty(name = "授权状态")
|
||||
@Excel(name = "在线状态")
|
||||
private String grantStatus;
|
||||
|
||||
/**
|
||||
* 回访状态
|
||||
*/
|
||||
@ApiModelProperty(name = "回访状态")
|
||||
@Excel(name = "是否开启")
|
||||
private String returnVisitStatus;
|
||||
|
||||
/**
|
||||
|
@ -63,6 +68,7 @@ public class RespBusStoreInfo {
|
|||
* 回访用户区间(营销用户下单?)
|
||||
*/
|
||||
@ApiModelProperty(name = "回访用户区间{=营销用户下单?}")
|
||||
@Excel(name = "营销用户下单")
|
||||
private String returnVisitUserRange;
|
||||
|
||||
/**
|
||||
|
@ -75,36 +81,44 @@ public class RespBusStoreInfo {
|
|||
* 归属销售姓名
|
||||
*/
|
||||
@ApiModelProperty(name = "归属销售姓名")
|
||||
@Excel(name = "归属人姓名")
|
||||
private String saleBindName;
|
||||
|
||||
/**
|
||||
* 绑定时间(创建)
|
||||
*/
|
||||
@ApiModelProperty(name = "绑定时间(创建)")
|
||||
@Excel(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;
|
||||
|
||||
/** 评分 */
|
||||
|
|
Loading…
Reference in New Issue