Commit a0c03fec authored by 周健威's avatar 周健威

修改保险

parent c639ac78
...@@ -61,11 +61,11 @@ public class CommonBaseController { ...@@ -61,11 +61,11 @@ public class CommonBaseController {
} }
} }
public void export(Logger log, Map<String, Object> headerAlias, Supplier<List<Map>> function, String title) throws Exception { public void export(Logger log, Map<String, Object> headerAlias, Supplier<List<Map>> function, String fileName) throws Exception {
HttpServletResponse httpServletResponse = getResponse(); HttpServletResponse httpServletResponse = getResponse();
ExcelWriter writer = ExcelUtil.getWriter(true); ExcelWriter writer = ExcelUtil.getWriter(true);
if(StrUtil.isBlank(title)) { if(StrUtil.isBlank(fileName)) {
title = System.currentTimeMillis()+ ""; fileName = System.currentTimeMillis()+ "";
} }
try { try {
...@@ -89,7 +89,7 @@ public class CommonBaseController { ...@@ -89,7 +89,7 @@ public class CommonBaseController {
log.info("list: {} ", JSONUtil.toJsonStr(list)); log.info("list: {} ", JSONUtil.toJsonStr(list));
writer.write(list); writer.write(list);
httpServletResponse.setContentType("application/octet-stream;charset=utf-8"); httpServletResponse.setContentType("application/octet-stream;charset=utf-8");
httpServletResponse.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode(title+ ".xlsx","utf-8")); httpServletResponse.setHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode(fileName+ ".xlsx","utf-8"));
writer.flush(httpServletResponse.getOutputStream()); writer.flush(httpServletResponse.getOutputStream());
}catch (Exception ex) { }catch (Exception ex) {
log.error(ex.getMessage(), ex); log.error(ex.getMessage(), ex);
...@@ -99,10 +99,10 @@ public class CommonBaseController { ...@@ -99,10 +99,10 @@ public class CommonBaseController {
} }
} }
public <T>void exportBean(Logger log, T headerAlias, Supplier<List<Map>> function, String title) throws Exception { public <T>void exportBean(Logger log, T headerAlias, Supplier<List<Map>> function, String fileName) throws Exception {
export(log, BeanUtil.beanToMap(headerAlias), ()-> export(log, BeanUtil.beanToMap(headerAlias), ()->
function.get() function.get()
, title); , fileName);
} }
} }
...@@ -68,6 +68,7 @@ public class PgOrderPersonInsuranceController extends BaseController<OrderPerson ...@@ -68,6 +68,7 @@ public class PgOrderPersonInsuranceController extends BaseController<OrderPerson
List<OrderPersonInsurance> bgList = baseBiz.selectInsuranceInfo(dto); List<OrderPersonInsurance> bgList = baseBiz.selectInsuranceInfo(dto);
List<Map> list = CollUtil.newArrayList(); List<Map> list = CollUtil.newArrayList();
bgList.forEach(vo -> { bgList.forEach(vo -> {
//OrderNo Name IdCard
PageExportDTO ped = BeanUtil.toBean(vo, PageExportDTO.class); PageExportDTO ped = BeanUtil.toBean(vo, PageExportDTO.class);
switch (vo.getStatus()) { switch (vo.getStatus()) {
case OrderPersonInsurance.STATUS_PAY: case OrderPersonInsurance.STATUS_PAY:
......
...@@ -21,12 +21,20 @@ ...@@ -21,12 +21,20 @@
<select id="selectOrderInfo" resultType="com.xxfc.platform.order.pojo.personinsurance.BgPageVO"> <select id="selectOrderInfo" resultType="com.xxfc.platform.order.pojo.personinsurance.BgPageVO">
select distinct ob.no, ob.insure_pic select distinct ob.no, ob.insure_pic
<include refid="commonFromWhere"></include> <include refid="commonFromWhere"></include>
order by
ob.no desc
</select> </select>
<select id="selectInsuranceInfo" resultType="com.xxfc.platform.order.entity.OrderPersonInsurance"> <select id="selectInsuranceInfo" resultType="com.xxfc.platform.order.entity.OrderPersonInsurance">
select opi.* select opi.*
<include refid="commonFromWhere"></include> <include refid="commonFromWhere"></include>
order by
ob.no desc
</select> </select>
<sql id="commonFromWhere"> <sql id="commonFromWhere">
......
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