Commit 830b9844 by 杨林龙

开发试驾数据

1 parent d7edeb1b
...@@ -37,6 +37,9 @@ public class TrialDriveReportController { ...@@ -37,6 +37,9 @@ public class TrialDriveReportController {
@Autowired @Autowired
private TrialDriveReportService trialDriveReportService; private TrialDriveReportService trialDriveReportService;
@Autowired
private HttpServletResponse response;
@GetMapping("/search") @GetMapping("/search")
@SysLog("查询试驾数据") @SysLog("查询试驾数据")
@ApiOperation(value = "试驾报表查询") @ApiOperation(value = "试驾报表查询")
...@@ -56,9 +59,9 @@ public class TrialDriveReportController { ...@@ -56,9 +59,9 @@ public class TrialDriveReportController {
} }
@GetMapping(value = "/export") @GetMapping(value = "/export")
@SysLog("导出试驾车辆数据")
@ApiOperation(value = "试驾报表导出") @ApiOperation(value = "试驾报表导出")
public void exportTrialDriveReport(HttpServletResponse response, TrialDriveReportSearch search) throws Exception { public void exportTrialDriveReport(TrialDriveReportSearch search) throws Exception {
log.info("试驾报表导出===start");
String fileName = "有效试驾次数统计(按日" + DateFormatUtils.format(new Date(), "yyyy-MM-dd") + ")表"; String fileName = "有效试驾次数统计(按日" + DateFormatUtils.format(new Date(), "yyyy-MM-dd") + ")表";
// 优先查询试驾 d_electric_fence_drive 表获取分页页数 // 优先查询试驾 d_electric_fence_drive 表获取分页页数
List<TrialDriveReportExport> testDrivePageList = trialDriveReportService.search(search); List<TrialDriveReportExport> testDrivePageList = trialDriveReportService.search(search);
...@@ -66,6 +69,7 @@ public class TrialDriveReportController { ...@@ -66,6 +69,7 @@ public class TrialDriveReportController {
List<TrialDriveReportExport> testDriveReportExcels = trialDriveReportService.exportEffectiveTestDriveReport(search, testDrivePageList); List<TrialDriveReportExport> testDriveReportExcels = trialDriveReportService.exportEffectiveTestDriveReport(search, testDrivePageList);
// 调用公用方法导出 excel表格 // 调用公用方法导出 excel表格
EasyExcelUtils.writeExcel(response, testDriveReportExcels, fileName, "有效试驾次数统计(按日)表", TrialDriveReportExport.class); EasyExcelUtils.writeExcel(response, testDriveReportExcels, fileName, "有效试驾次数统计(按日)表", TrialDriveReportExport.class);
log.info("试驾报表导出===end");
} }
@GetMapping(value = "/years") @GetMapping(value = "/years")
......
...@@ -2,11 +2,13 @@ package cn.com.glsx.admin.modules.model.param; ...@@ -2,11 +2,13 @@ package cn.com.glsx.admin.modules.model.param;
import cn.hutool.db.Page; import cn.hutool.db.Page;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@EqualsAndHashCode(callSuper = true)
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class TrialDriveReportSearch extends Page { public class TrialDriveReportSearch extends Page {
......
...@@ -96,12 +96,7 @@ public class TrialDriveReportService { ...@@ -96,12 +96,7 @@ public class TrialDriveReportService {
return null; return null;
} }
// 将数据集合按照店代码排序 // 将数据集合按照店代码排序
testDrivePageList.sort(new Comparator<TrialDriveReportExport>() { testDrivePageList.sort((o1, o2) -> o1.getShopCode().compareToIgnoreCase(o2.getShopCode()));
@Override
public int compare(TrialDriveReportExport o1, TrialDriveReportExport o2) {
return o1.getShopCode().compareToIgnoreCase(o2.getShopCode());
}
});
return testDrivePageList; return testDrivePageList;
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
left join t_user tu on tu.id = tef.created_by left join t_user tu on tu.id = tef.created_by
left join t_vehicle tv on tv.vin = tefs.vin left join t_vehicle tv on tv.vin = tefs.vin
where tefs.fence_id = tef.id where tefs.fence_id = tef.id
and tef.biz_fence_type = 1 and tef.biz_fence_type = 12
<if test="shopCode!=null and shopCode!=''"> <if test="shopCode!=null and shopCode!=''">
and tu.account like '%${shopCode}%' and tu.account like '%${shopCode}%'
</if> </if>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!