记得上下班打卡 | git大法好,push需谨慎

Commit 75e795f9 authored by jiangxiulong's avatar jiangxiulong

admin 代理管理-演出列表 按月份导出 excel

parent a3e47f1a
package com.liquidnet.client.admin.zhengzai.smile.dto;
import com.liquidnet.client.admin.common.annotation.Excel;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.format.DateTimeFormatter;
/**
* @author jiangxiulong
*/
@Data
public class SmileShowExportVo implements Serializable, Cloneable {
@Excel(name = "演出id", cellType = Excel.ColumnType.STRING)
private String performancesId;
@Excel(name = "演出名", cellType = Excel.ColumnType.STRING)
private String title;
@Excel(name = "城市", cellType = Excel.ColumnType.STRING)
private String cityName;
@Excel(name = "演出开始时间", cellType = Excel.ColumnType.STRING)
private String timeStart;
@Excel(name = "演出结束时间", cellType = Excel.ColumnType.STRING)
private String timeEnd;
@Excel(name = "总销售数量", cellType = Excel.ColumnType.NUMERIC)
private BigDecimal open;
@Excel(name = "总销售金额", cellType = Excel.ColumnType.NUMERIC)
private BigDecimal totalSalePrice;
@Excel(name = "总售出代理", cellType = Excel.ColumnType.NUMERIC)
private Integer totalOutAgent;
@Excel(name = "演出状态", cellType = Excel.ColumnType.STRING)
private String statusName;
@Excel(name = "打款状态", cellType = Excel.ColumnType.STRING)
private String status;
private static final SmileShowExportVo obj = new SmileShowExportVo();
public static SmileShowExportVo getNew() {
try {
return (SmileShowExportVo) obj.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return new SmileShowExportVo();
}
public SmileShowExportVo copyExportVo(ShowVo source) {
this.setPerformancesId(source.getPerformancesId());
this.setTitle(source.getTitle());
this.setCityName(source.getCityName());
this.setOpen(source.getOpen());
this.setTotalSalePrice(source.getTotalSalePrice());
this.setTotalOutAgent(source.getTotalOutAgent());
this.setTimeEnd(source.getTimeEnd().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
this.setTimeStart(source.getTimeStart().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
this.setStatusName(source.getStatusName());
if (source.getStatus() == "1") {
this.setStatus("已打款");
} else {
this.setStatus("未打款");
}
return this;
}
}
...@@ -16,9 +16,11 @@ import com.google.common.collect.Lists; ...@@ -16,9 +16,11 @@ import com.google.common.collect.Lists;
import com.liquidnet.client.admin.common.core.domain.AjaxResult; import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.core.page.TableDataInfo; import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.common.utils.StringUtils; import com.liquidnet.client.admin.common.utils.StringUtils;
import com.liquidnet.client.admin.common.utils.poi.ExcelUtil;
import com.liquidnet.client.admin.zhengzai.smile.dto.*; import com.liquidnet.client.admin.zhengzai.smile.dto.*;
import com.liquidnet.client.admin.zhengzai.smile.service.ISmileShowService; import com.liquidnet.client.admin.zhengzai.smile.service.ISmileShowService;
import com.liquidnet.client.admin.zhengzai.smile.utils.SmileRedisUtils; import com.liquidnet.client.admin.zhengzai.smile.utils.SmileRedisUtils;
import com.liquidnet.client.admin.zhengzai.sweet.dto.SweetYbActivityExportVo;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.galaxy.utils.ObjectUtil; import com.liquidnet.service.galaxy.utils.ObjectUtil;
import com.liquidnet.service.goblin.constant.SmileRedisConst; import com.liquidnet.service.goblin.constant.SmileRedisConst;
...@@ -99,10 +101,35 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc ...@@ -99,10 +101,35 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
@Override @Override
public TableDataInfo listShow(SmileShowParam smileShowParam) { public TableDataInfo listShow(SmileShowParam smileShowParam) {
PageHelper.startPage(smileShowParam.getPageNum(), smileShowParam.getPageSize()); // PageHelper.startPage(smileShowParam.getPageNum(), smileShowParam.getPageSize());
TableDataInfo rspData = new TableDataInfo(); // TableDataInfo rspData = new TableDataInfo();
//查询所有代理的演出id // //查询所有代理的演出id
List<KylinPerformancesDto> kylinPerformancesList = kylinPerformancesMapper.selectPerIdByAgent(smileShowParam.getName()); // List<KylinPerformancesDto> kylinPerformancesList = kylinPerformancesMapper.selectPerIdByAgent(smileShowParam.getName());
// List<ShowVo> showVoList = kylinPerformancesList.stream().map(kylinPerformancesDto -> {
// ShowVo vo = ShowVo.getNew().copy(kylinPerformancesDto);
// Integer ordNum = kylinOrderTicketRelationsMapper.concatByAgentDed(kylinPerformancesDto.getPerformancesId());
// vo.setTotalOutAgent(ordNum);
// //打款状态
// vo.setStatus(smileRedisUtils.getShowStatus(kylinPerformancesDto.getPerformancesId()));
// //判断该演出是否打款
// Integer showPriceId = smileRedisUtils.getShowPriceId(kylinPerformancesDto.getPerformancesId());
// if (showPriceId != null) {
// //返回记录中的缓存 保证打款外部数据不变
// return smileRedisUtils.getShowVoByPerId(kylinPerformancesDto.getPerformancesId());
// } else {
// //redis保存演出数据
// smileRedisUtils.setShowVoByPerId(vo);
// return vo;
// }
// }).collect(Collectors.toList());
// rspData.setCode(0);
// rspData.setRows(showVoList);
// rspData.setTotal(new PageInfo(kylinPerformancesList).getTotal());
// return rspData;
// /usr/local/var/www/uploadPath/download
List<KylinPerformancesDto> kylinPerformancesList = kylinPerformancesMapper.selectPerIdByAgent(smileShowParam.getName(), "2024-03-01", "2024-03-31 23:59:59");
List<ShowVo> showVoList = kylinPerformancesList.stream().map(kylinPerformancesDto -> { List<ShowVo> showVoList = kylinPerformancesList.stream().map(kylinPerformancesDto -> {
ShowVo vo = ShowVo.getNew().copy(kylinPerformancesDto); ShowVo vo = ShowVo.getNew().copy(kylinPerformancesDto);
Integer ordNum = kylinOrderTicketRelationsMapper.concatByAgentDed(kylinPerformancesDto.getPerformancesId()); Integer ordNum = kylinOrderTicketRelationsMapper.concatByAgentDed(kylinPerformancesDto.getPerformancesId());
...@@ -120,9 +147,19 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc ...@@ -120,9 +147,19 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
return vo; return vo;
} }
}).collect(Collectors.toList()); }).collect(Collectors.toList());
rspData.setCode(0); List<SmileShowExportVo> list = new ArrayList<>();
rspData.setRows(showVoList); for (ShowVo showVo : showVoList) {
rspData.setTotal(new PageInfo(kylinPerformancesList).getTotal()); SmileShowExportVo smileShowExportVo = SmileShowExportVo.getNew().copyExportVo(showVo);
list.add(smileShowExportVo);
}
ExcelUtil<SmileShowExportVo> util = new ExcelUtil(SmileShowExportVo.class);
util.exportExcel(list, "3月份代理演出列表");
// /usr/local/var/www/uploadPath/download
TableDataInfo rspData = new TableDataInfo();
return rspData; return rspData;
} }
......
...@@ -68,7 +68,7 @@ public interface KylinPerformancesMapper extends BaseMapper<KylinPerformances> { ...@@ -68,7 +68,7 @@ public interface KylinPerformancesMapper extends BaseMapper<KylinPerformances> {
List<KylinPerformances> selectByComment(); List<KylinPerformances> selectByComment();
List<KylinPerformancesDto> selectPerIdByAgent(@Param("title") String title ); List<KylinPerformancesDto> selectPerIdByAgent(@Param("title") String title, @Param("timeEndS") String timeEndS, @Param("timeEndE") String timeEndE);
List<KylinPerformancesDao> selectTicketIdByPerId(@Param("performancesId") String performancesId); List<KylinPerformancesDao> selectTicketIdByPerId(@Param("performancesId") String performancesId);
......
...@@ -769,6 +769,14 @@ GROUP BY user_mobile,tickets_id; ...@@ -769,6 +769,14 @@ GROUP BY user_mobile,tickets_id;
) AS map ON map.performance_id = kp.performances_id ) AS map ON map.performance_id = kp.performances_id
<where> <where>
kp.performances_id IN ( SELECT sa.performance_id FROM smile_agent AS sa WHERE sa.del_tag = 0 GROUP BY sa.performance_id ) kp.performances_id IN ( SELECT sa.performance_id FROM smile_agent AS sa WHERE sa.del_tag = 0 GROUP BY sa.performance_id )
<if test="timeEndS!=null">
AND kp.time_end >= #{timeEndS}
</if>
<if test="timeEndE!=null">
AND kp.time_end &lt; #{timeEndE}
</if>
<if test="title!=''"> <if test="title!=''">
AND kp.title LIKE concat('%', #{title}, '%') AND kp.title LIKE concat('%', #{title}, '%')
</if> </if>
......
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