Commit 26a30d20 by 刘宇峰

试驾报表

1 parent 7a938a17
......@@ -31,12 +31,14 @@ public class ElectricFenceController {
@Autowired
private ElectricFenceService electricFenceService;
@ApiOperation(value = "围栏列表查询")
@GetMapping("/search")
public R search(ElectricFenceSearch search) {
PageInfo<ElectricFenceDTO> pageInfo = electricFenceService.search(search);
return R.ok().putPageData(pageInfo);
}
@ApiOperation(value = "围栏列表导出")
@GetMapping(value = "/export")
public void export(HttpServletResponse response, ElectricFenceSearch search) throws Exception {
List<ElectricFenceExport> list = electricFenceService.export(search);
......
package cn.com.glsx.admin.modules.controller;
import cn.com.glsx.admin.modules.model.EffectiveTestDriveDTO;
import cn.com.glsx.admin.modules.model.excel.EffectiveTestDriveReportExcel;
import cn.com.glsx.admin.modules.service.EffectiveTestDriveReportService;
import cn.com.glsx.admin.modules.model.export.TrialDriveReportExport;
import cn.com.glsx.admin.modules.model.param.TrialDriveReportSearch;
import cn.com.glsx.admin.modules.service.TrialDriveReportService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.glsx.plat.common.annotation.SysLog;
import com.glsx.plat.core.web.R;
import com.glsx.plat.office.excel.EasyExcelUtils;
......@@ -33,30 +32,30 @@ import java.util.Map;
*/
@Slf4j
@RestController
@RequestMapping(value = "/effectivetestdrivereport")
@RequestMapping(value = "/trialdrivereport")
@Api(value = "试驾报表管理", tags = {"试驾报表管理"})
public class EffectiveTestDriveReportController {
public class TrialDriveReportController {
@Autowired
private EffectiveTestDriveReportService effectiveTestDriveReportService;
private TrialDriveReportService trialDriveReportService;
@Autowired
private HttpServletResponse response;
@GetMapping("/list")
@GetMapping("/search")
@SysLog("查询试驾数据")
@ApiOperation(value = "试驾报表查询")
public R listGqWindReportPage(EffectiveTestDriveDTO reportRequest, PageInfo page) {
PageHelper.startPage(page.getPageNum(), page.getPageSize(), true);
public R search(TrialDriveReportSearch search) {
PageHelper.startPage(search.getPageNumber(), search.getPageSize(), true);
// 优先查询试驾 d_electric_fence_drive 表获取分页页数
List<EffectiveTestDriveReportExcel> testDrivePageList = effectiveTestDriveReportService.getTestDrivePageList(reportRequest);
List<TrialDriveReportExport> testDrivePageList = trialDriveReportService.search(search);
// 获取报表详细数据
List<EffectiveTestDriveReportExcel> reportList = effectiveTestDriveReportService.listEffectiveTestDriveReportPage(reportRequest, testDrivePageList);
List<TrialDriveReportExport> reportList = trialDriveReportService.listEffectiveTestDriveReportPage(search, testDrivePageList);
if (CollectionUtils.isNotEmpty(testDrivePageList) && CollectionUtils.isNotEmpty(reportList)) {
long total = ((Page<EffectiveTestDriveReportExcel>) testDrivePageList).getTotal();
long total = ((Page<TrialDriveReportExport>) testDrivePageList).getTotal();
Map data = new HashMap(3);
data.put("list", reportList);
data.put("totalPages", total);
......@@ -66,24 +65,24 @@ public class EffectiveTestDriveReportController {
return R.error();
}
@GetMapping(value = "/exportreport")
@GetMapping(value = "/export")
@SysLog("导出试驾车辆数据")
@ApiOperation(value = "试驾报表导出")
public void exportGqWindReport(EffectiveTestDriveDTO reportRequest) throws Exception {
public void exportGqWindReport(TrialDriveReportSearch search) throws Exception {
String fileName = "有效试驾次数统计(按日" + DateFormatUtils.format(new Date(), "yyyy-MM-dd") + ")表";
// 优先查询试驾 d_electric_fence_drive 表获取分页页数
List<EffectiveTestDriveReportExcel> testDrivePageList = effectiveTestDriveReportService.getTestDrivePageList(reportRequest);
List<TrialDriveReportExport> testDrivePageList = trialDriveReportService.search(search);
// 封装数据
List<EffectiveTestDriveReportExcel> testDriveReportExcels = effectiveTestDriveReportService.exportEffectiveTestDriveReport(reportRequest, testDrivePageList);
List<TrialDriveReportExport> testDriveReportExcels = trialDriveReportService.exportEffectiveTestDriveReport(search, testDrivePageList);
// 调用公用方法导出 excel表格
EasyExcelUtils.writeExcel((HttpServletResponse) response.getOutputStream(), testDriveReportExcels, fileName, "有效试驾次数统计(按日)表", EffectiveTestDriveReportExcel.class);
EasyExcelUtils.writeExcel((HttpServletResponse) response.getOutputStream(), testDriveReportExcels, fileName, "有效试驾次数统计(按日)表", TrialDriveReportExport.class);
}
@GetMapping(value = "/getyearwithdata")
@GetMapping(value = "/years")
@SysLog("获取下拉选接口")
@ApiOperation(value = "获取有试驾数据的年份")
public R getYearWithData() {
List<String> yearList = effectiveTestDriveReportService.getYearWithData();
List<String> yearList = trialDriveReportService.getYearWithData();
return R.ok().data(yearList);
}
}
......@@ -31,12 +31,14 @@ public class TrialDriveShopController {
@Autowired
private TrialDriveShopService trialDriveShopService;
@ApiOperation(value = "特约店列表查询")
@GetMapping("/search")
public R search(TrialDriveShopSearch search) {
PageInfo<TrialDriveShopDTO> pageInfo = trialDriveShopService.search(search);
return R.ok().putPageData(pageInfo);
}
@ApiOperation(value = "特约店列表导出")
@GetMapping(value = "/export")
public void export(HttpServletResponse response, TrialDriveShopSearch search) throws Exception {
List<TrialDriveShopExport> list = trialDriveShopService.export(search);
......
package cn.com.glsx.admin.modules.mapper;
import cn.com.glsx.admin.modules.entity.ElectricFenceDrive;
import cn.com.glsx.admin.modules.model.EffectiveTestDriveDTO;
import cn.com.glsx.admin.modules.model.excel.EffectiveTestDriveReportExcel;
import cn.com.glsx.admin.modules.model.export.TrialDriveReportExport;
import cn.com.glsx.admin.modules.model.param.TrialDriveReportSearch;
import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import org.apache.ibatis.annotations.Mapper;
......@@ -12,11 +12,11 @@ import java.util.List;
* 试驾数据Mapper层
*/
@Mapper
public interface EffectiveTestDriveReportMapper extends CommonBaseMapper<ElectricFenceDrive> {
public interface TrialDriveReportMapper extends CommonBaseMapper<ElectricFenceDrive> {
List<EffectiveTestDriveReportExcel> getTestDrivePageList(EffectiveTestDriveDTO reportRequest);
List<TrialDriveReportExport> getTestDrivePageList(TrialDriveReportSearch search);
List<EffectiveTestDriveReportExcel> getEffectiveTestDriveData(EffectiveTestDriveDTO reportRequest);
List<TrialDriveReportExport> getEffectiveTestDriveData(TrialDriveReportSearch search);
List<String> getYearWithData();
}
......@@ -15,11 +15,4 @@ public class ElectricFenceSnsDTO extends ElectricFenceSnsModel {
*/
private String lat;
/**
* 解析地址
*/
private String address;
private String gpsTime;
}
......@@ -23,4 +23,14 @@ public class ElectricFenceSnsModel {
*/
private String userTel;
/**
* gps上点时间
*/
private String gpsTime;
/**
* 解析位置
*/
private String address;
}
package cn.com.glsx.admin.modules.model.excel;
package cn.com.glsx.admin.modules.model.export;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
......@@ -10,7 +10,7 @@ import lombok.Data;
* @Date 2021/1/19
*/
@Data
public class EffectiveTestDriveReportExcel {
public class TrialDriveReportExport {
// 围栏Id
@ExcelIgnore
private Integer fenceId;
......
......@@ -19,9 +19,9 @@ public class ElectricFenceBO {
private Long id;
/**
* 栅栏名称
* 围栏名称
*/
@NotBlank(message = "栅栏名称不能为空")
@NotBlank(message = "围栏名称不能为空")
private String fenceName;
/**
* 围栏编号
......@@ -31,15 +31,12 @@ public class ElectricFenceBO {
* 业务围栏类型 0警情围栏,1试驾围栏
*/
private Integer bizFenceType;
/**
* 定位信息类型 1gps,2基站
*/
private Integer locationType;
/**
* 围栏形状类型 1.圆形(默认) 2.矩形 3.多边形 4.行政区域
*/
private Integer shapeType;
/**
* 半径(米)
*/
......
package cn.com.glsx.admin.modules.model.param;
import cn.hutool.db.Page;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.List;
@Data
@Accessors(chain = true)
public class TrialDriveReportSearch extends Page {
/**
* 勾选的id
*/
private List<String> idList;
/**
* 限制展示的车辆
*/
private List<String> splitList;
/**
* 广本分组ID
*/
private Integer guangBenClassId;
/**
* sn 号
*/
private String sn;
/**
* 查询年份
*/
private String year;
/**
* 查询月份
*/
private String month;
/**
* 特约店代码
*/
private String shopCode;
/**
* 特约店名称
*/
private String shopName;
}
<?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="cn.com.glsx.admin.modules.mapper.EffectiveTestDriveReportMapper">
<mapper namespace="TrialDriveReportMapper">
<resultMap id="BaseResultMap"
type="cn.com.glsx.admin.modules.model.excel.EffectiveTestDriveReportExcel">
type="cn.com.glsx.admin.modules.model.export.TrialDriveReportExport">
<result column="shopCode" jdbcType="VARCHAR" property="shopCode"/>
<result column="shopName" jdbcType="VARCHAR" property="shopName"/>
<result column="vehicleTypeName" jdbcType="VARCHAR" property="vehicleTypeName"/>
......@@ -15,7 +15,7 @@
</resultMap>
<resultMap id="PageBaseMap"
type="cn.com.glsx.admin.modules.model.excel.EffectiveTestDriveReportExcel">
type="cn.com.glsx.admin.modules.model.export.TrialDriveReportExport">
<result column="fenceId" jdbcType="INTEGER" property="fenceId"/>
<result column="electricFenceName" jdbcType="VARCHAR" property="electricFenceName"/>
<result column="shopCode" jdbcType="VARCHAR" property="shopCode"/>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!