|
|
@ -29,7 +29,9 @@ import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardMapper; |
|
|
|
import com.yxt.yyth.biz.lpkgoods.LpkGoodsService; |
|
|
|
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService; |
|
|
|
import com.yxt.yyth.biz.lpkstore.LpkStoreService; |
|
|
|
import com.yxt.yyth.utils.StyleUtils; |
|
|
|
import org.apache.poi.ss.usermodel.HorizontalAlignment; |
|
|
|
import org.bouncycastle.jcajce.provider.symmetric.util.PBE; |
|
|
|
import org.junit.Test; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -127,38 +129,197 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa |
|
|
|
String endDate = query.getEndDate(); |
|
|
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBankName())) { |
|
|
|
qw.like("d.name", query.getBankName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBankSid())) { |
|
|
|
qw.eq("s.bankSid", query.getBankSid()); |
|
|
|
} |
|
|
|
qw.orderByAsc("o.reserveDate"); |
|
|
|
qw.orderByDesc("d.sort"); |
|
|
|
qw.orderByDesc("s.sort"); |
|
|
|
qw.orderByAsc("c.serialNumber"); |
|
|
|
|
|
|
|
|
|
|
|
qw.orderByDesc("o.reserveDate"); |
|
|
|
// qw.groupBy("o.reserveDate");
|
|
|
|
// qw.groupBy("t.goodsSid");
|
|
|
|
// qw.groupBy("s.name");
|
|
|
|
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<LpkReserveOrderVo> pagging = baseMapper.orderList(page, qw); |
|
|
|
List<LpkReserveOrderVo> records = pagging.getRecords(); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
records.forEach(s -> { |
|
|
|
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selByOrderSid(s.getSid()); |
|
|
|
List<OrderGoodsVo> goodsVoList = new ArrayList<>(); |
|
|
|
if (!orderGoods.isEmpty()) { |
|
|
|
for (LpkReserveOrderGoods orderGood : orderGoods) { |
|
|
|
OrderGoodsVo goodsVo = new OrderGoodsVo(); |
|
|
|
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) { |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid()); |
|
|
|
if (null != lpkGoods) { |
|
|
|
goodsVo.setGoodName(lpkGoods.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (orderGood.getGoodsNumber() != 0) { |
|
|
|
goodsVo.setNum((int) orderGood.getGoodsNumber()); |
|
|
|
} |
|
|
|
goodsVoList.add(goodsVo); |
|
|
|
} |
|
|
|
} |
|
|
|
s.setGoodsVo(goodsVoList); |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); |
|
|
|
s.setGoodsName(lpkGoods.getName()); |
|
|
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selByOrderSid(s.getSid());
|
|
|
|
// List<OrderGoodsVo> goodsVoList = new ArrayList<>();
|
|
|
|
// if (!orderGoods.isEmpty()) {
|
|
|
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
|
|
|
// OrderGoodsVo goodsVo = new OrderGoodsVo();
|
|
|
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
|
|
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
|
|
|
// if (null != lpkGoods) {
|
|
|
|
// goodsVo.setGoodName(lpkGoods.getName());
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (orderGood.getGoodsNumber() != 0) {
|
|
|
|
// goodsVo.setNum((int) orderGood.getGoodsNumber());
|
|
|
|
// }
|
|
|
|
// goodsVoList.add(goodsVo);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// s.setGoodsVo(goodsVoList);
|
|
|
|
}); |
|
|
|
} |
|
|
|
PagerVo<LpkReserveOrderVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return rb.success().setData(p); |
|
|
|
} |
|
|
|
public ResultBean<PagerVo<LpkReserveOrderVo>> orderListByStore(PagerQuery<LpkReserveOrderQuery> pq) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
LpkReserveOrderQuery query = pq.getParams(); |
|
|
|
QueryWrapper<LpkReserveOrder> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("1", "1"); |
|
|
|
if (StringUtils.isNotBlank(query.getStore())) { |
|
|
|
qw.like("s.name", query.getStore()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBankName())) { |
|
|
|
qw.like("d.name", query.getBankName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBankSid())) { |
|
|
|
qw.eq("s.bankSid", query.getBankSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getStartDate())) { |
|
|
|
|
|
|
|
String startDate = query.getStartDate(); |
|
|
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getEndDate())) { |
|
|
|
String endDate = query.getEndDate(); |
|
|
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); |
|
|
|
} |
|
|
|
|
|
|
|
qw.orderByAsc("o.reserveDate"); |
|
|
|
qw.orderByDesc("d.sort"); |
|
|
|
qw.orderByDesc("s.sort"); |
|
|
|
qw.groupBy("o.reserveDate"); |
|
|
|
qw.groupBy("t.goodsSid"); |
|
|
|
qw.groupBy("s.name"); |
|
|
|
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<LpkReserveOrderVo> pagging = baseMapper.orderListByStore(page, qw); |
|
|
|
List<LpkReserveOrderVo> records = pagging.getRecords(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
records.forEach(s -> { |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); |
|
|
|
s.setGoodsName(lpkGoods.getName()); |
|
|
|
// List<String> list=baseMapper.getOrderByStore(s.getStoreSid(),sdf.format(s.getReserveDate()));
|
|
|
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
|
|
|
// List<String> a=new ArrayList<>();
|
|
|
|
// if (!orderGoods.isEmpty()) {
|
|
|
|
// StringBuffer sb = new StringBuffer();
|
|
|
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
|
|
|
// String num = "";
|
|
|
|
// String goodsName = "";
|
|
|
|
// String finWord = "";
|
|
|
|
// String unitName = "";
|
|
|
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
|
|
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
|
|
|
// if (null != lpkGoods) {
|
|
|
|
// goodsName = lpkGoods.getName();
|
|
|
|
// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
|
|
|
// unitName = lpkGoods.getUnitName();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (orderGood.getGoodsNumber() != 0) {
|
|
|
|
// num = String.valueOf((int) orderGood.getGoodsNumber());
|
|
|
|
// }
|
|
|
|
// finWord = goodsName + num + unitName ;
|
|
|
|
// a.add(finWord);
|
|
|
|
//// sb.append(finWord).append("、");
|
|
|
|
// }
|
|
|
|
// if (sb.length() > 0) {
|
|
|
|
// sb.delete(sb.length() - 1, sb.length());
|
|
|
|
// s.setGoodsInfo(sb.toString());
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// s.setGoods(a);
|
|
|
|
}); |
|
|
|
} |
|
|
|
PagerVo<LpkReserveOrderVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return rb.success().setData(p); |
|
|
|
} |
|
|
|
public ResultBean<PagerVo<LpkReserveOrderVo>> orderListByBank(PagerQuery<LpkReserveOrderQuery> pq) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
LpkReserveOrderQuery query = pq.getParams(); |
|
|
|
QueryWrapper<LpkReserveOrder> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("1", "1"); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getStartDate())) { |
|
|
|
|
|
|
|
String startDate = query.getStartDate(); |
|
|
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getEndDate())) { |
|
|
|
String endDate = query.getEndDate(); |
|
|
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBankSid())) { |
|
|
|
qw.eq("s.bankSid", query.getBankSid()); |
|
|
|
} |
|
|
|
|
|
|
|
qw.groupBy("t.goodsSid"); |
|
|
|
qw.groupBy("o.reserveDate"); |
|
|
|
qw.orderByAsc("o.reserveDate"); |
|
|
|
qw.orderByDesc("d.sort"); |
|
|
|
qw.orderByDesc("s.sort"); |
|
|
|
// qw.groupBy("s.name");
|
|
|
|
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<LpkReserveOrderVo> pagging = baseMapper.orderListByBank(page, qw); |
|
|
|
List<LpkReserveOrderVo> records = pagging.getRecords(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
|
|
|
if (!records.isEmpty()) { |
|
|
|
records.forEach(s -> { |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); |
|
|
|
s.setGoodsName(lpkGoods.getName()); |
|
|
|
// List<String> list=baseMapper.getOrderByStore(s.getStoreSid(),sdf.format(s.getReserveDate()));
|
|
|
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
|
|
|
// List<String> a=new ArrayList<>();
|
|
|
|
// if (!orderGoods.isEmpty()) {
|
|
|
|
// StringBuffer sb = new StringBuffer();
|
|
|
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
|
|
|
// String num = "";
|
|
|
|
// String goodsName = "";
|
|
|
|
// String finWord = "";
|
|
|
|
// String unitName = "";
|
|
|
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
|
|
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
|
|
|
// if (null != lpkGoods) {
|
|
|
|
// goodsName = lpkGoods.getName();
|
|
|
|
// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
|
|
|
// unitName = lpkGoods.getUnitName();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (orderGood.getGoodsNumber() != 0) {
|
|
|
|
// num = String.valueOf((int) orderGood.getGoodsNumber());
|
|
|
|
// }
|
|
|
|
// finWord = goodsName + num + unitName ;
|
|
|
|
// a.add(finWord);
|
|
|
|
// sb.append(finWord).append("、");
|
|
|
|
// }
|
|
|
|
// if (sb.length() > 0) {
|
|
|
|
// sb.delete(sb.length() - 1, sb.length());
|
|
|
|
// s.setGoodsInfo(sb.toString());
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// s.setGoods(a);
|
|
|
|
}); |
|
|
|
} |
|
|
|
PagerVo<LpkReserveOrderVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return rb.success().setData(p); |
|
|
|
} |
|
|
|
public ResultBean<PagerVo<LpkReserveOrderVo>> orderListByZ(PagerQuery<LpkReserveOrderQuery> pq) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
LpkReserveOrderQuery query = pq.getParams(); |
|
|
|
QueryWrapper<LpkReserveOrder> qw = new QueryWrapper<>(); |
|
|
@ -181,46 +342,53 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa |
|
|
|
String endDate = query.getEndDate(); |
|
|
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); |
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getBankSid())) { |
|
|
|
qw.eq("s.bankSid", query.getBankSid()); |
|
|
|
} |
|
|
|
qw.orderByDesc("o.reserveDate"); |
|
|
|
qw.groupBy("s.name"); |
|
|
|
qw.groupBy("t.goodsSid"); |
|
|
|
qw.groupBy("o.reserveDate"); |
|
|
|
// qw.groupBy("s.name");
|
|
|
|
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<LpkReserveOrderVo> pagging = baseMapper.orderListByStore(page, qw); |
|
|
|
IPage<LpkReserveOrderVo> pagging = baseMapper.orderListByZ(page, qw); |
|
|
|
List<LpkReserveOrderVo> records = pagging.getRecords(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
if (!records.isEmpty()) { |
|
|
|
records.forEach(s -> { |
|
|
|
List<String> list=baseMapper.getOrderByStore(s.getStoreSid()); |
|
|
|
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list); |
|
|
|
List<String> a=new ArrayList<>(); |
|
|
|
if (!orderGoods.isEmpty()) { |
|
|
|
StringBuffer sb = new StringBuffer(); |
|
|
|
for (LpkReserveOrderGoods orderGood : orderGoods) { |
|
|
|
String num = ""; |
|
|
|
String goodsName = ""; |
|
|
|
String finWord = ""; |
|
|
|
String unitName = ""; |
|
|
|
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) { |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid()); |
|
|
|
if (null != lpkGoods) { |
|
|
|
goodsName = lpkGoods.getName(); |
|
|
|
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) { |
|
|
|
unitName = lpkGoods.getUnitName(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (orderGood.getGoodsNumber() != 0) { |
|
|
|
num = String.valueOf((int) orderGood.getGoodsNumber()); |
|
|
|
} |
|
|
|
finWord = goodsName + num + unitName ; |
|
|
|
a.add(finWord); |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); |
|
|
|
s.setGoodsName(lpkGoods.getName()); |
|
|
|
// List<String> list=baseMapper.getOrderByStore(s.getStoreSid(),sdf.format(s.getReserveDate()));
|
|
|
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
|
|
|
// List<String> a=new ArrayList<>();
|
|
|
|
// if (!orderGoods.isEmpty()) {
|
|
|
|
// StringBuffer sb = new StringBuffer();
|
|
|
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
|
|
|
// String num = "";
|
|
|
|
// String goodsName = "";
|
|
|
|
// String finWord = "";
|
|
|
|
// String unitName = "";
|
|
|
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
|
|
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
|
|
|
// if (null != lpkGoods) {
|
|
|
|
// goodsName = lpkGoods.getName();
|
|
|
|
// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
|
|
|
// unitName = lpkGoods.getUnitName();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (orderGood.getGoodsNumber() != 0) {
|
|
|
|
// num = String.valueOf((int) orderGood.getGoodsNumber());
|
|
|
|
// }
|
|
|
|
// finWord = goodsName + num + unitName ;
|
|
|
|
// a.add(finWord);
|
|
|
|
// sb.append(finWord).append("、");
|
|
|
|
} |
|
|
|
if (sb.length() > 0) { |
|
|
|
sb.delete(sb.length() - 1, sb.length()); |
|
|
|
s.setGoodsInfo(sb.toString()); |
|
|
|
} |
|
|
|
} |
|
|
|
s.setGoods(a); |
|
|
|
// }
|
|
|
|
// if (sb.length() > 0) {
|
|
|
|
// sb.delete(sb.length() - 1, sb.length());
|
|
|
|
// s.setGoodsInfo(sb.toString());
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// s.setGoods(a);
|
|
|
|
}); |
|
|
|
} |
|
|
|
PagerVo<LpkReserveOrderVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
@ -316,6 +484,9 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa |
|
|
|
if (StringUtils.isNotBlank(query.getStore())) { |
|
|
|
qw.like("s.name", query.getStore()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBankSid())) { |
|
|
|
qw.eq("s.bankSid", query.getBankSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getUserName())) { |
|
|
|
qw.like("o.userName", query.getUserName()); |
|
|
|
} |
|
|
@ -327,50 +498,55 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa |
|
|
|
String endDate = query.getEndDate(); |
|
|
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); |
|
|
|
} |
|
|
|
qw.orderByDesc("o.createTime"); |
|
|
|
qw.orderByAsc("o.reserveDate"); |
|
|
|
qw.orderByDesc("d.sort"); |
|
|
|
qw.orderByDesc("s.sort"); |
|
|
|
qw.orderByAsc("c.serialNumber"); |
|
|
|
//得到所有要导出的数据
|
|
|
|
List<ReserveOrderExport> exportList = baseMapper.exportExcel(qw); |
|
|
|
List<ReserveOrderExport> exportList1 = new ArrayList<>(); |
|
|
|
if (!exportList.isEmpty()) { |
|
|
|
exportList.forEach(s -> { |
|
|
|
if (StringUtils.isNotBlank(s.getUserPhone())) { |
|
|
|
// String phone = s.getUserPhone().substring(0, 3) + "****" + s.getUserPhone().substring(7);
|
|
|
|
String phone = s.getUserPhone(); |
|
|
|
s.setUserPhone(phone); |
|
|
|
} |
|
|
|
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selByOrderSid(s.getSid()); |
|
|
|
if (!orderGoods.isEmpty()) { |
|
|
|
int i=0; |
|
|
|
for (LpkReserveOrderGoods orderGood : orderGoods) { |
|
|
|
String num = ""; |
|
|
|
String goodsName = ""; |
|
|
|
String finWord = ""; |
|
|
|
String unitName = ""; |
|
|
|
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) { |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid()); |
|
|
|
if (null != lpkGoods) { |
|
|
|
goodsName = lpkGoods.getName(); |
|
|
|
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) { |
|
|
|
unitName = lpkGoods.getUnitName(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (orderGood.getGoodsNumber() != 0) { |
|
|
|
num = String.valueOf((int) orderGood.getGoodsNumber()); |
|
|
|
} |
|
|
|
finWord = goodsName+num + unitName ; |
|
|
|
i++; |
|
|
|
if(i>1){ |
|
|
|
ReserveOrderExport en=new ReserveOrderExport(); |
|
|
|
BeanUtil.copyProperties(s,en , "id"); |
|
|
|
en.setGoodsInfo(finWord); |
|
|
|
exportList1.add(en); |
|
|
|
}else{ |
|
|
|
s.setGoodsInfo(finWord); |
|
|
|
exportList1.add(s); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); |
|
|
|
s.setGoodsName(lpkGoods.getName()); |
|
|
|
// if (StringUtils.isNotBlank(s.getUserPhone())) {
|
|
|
|
//// String phone = s.getUserPhone().substring(0, 3) + "****" + s.getUserPhone().substring(7);
|
|
|
|
// String phone = s.getUserPhone();
|
|
|
|
// s.setUserPhone(phone);
|
|
|
|
// }
|
|
|
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selByOrderSid(s.getSid());
|
|
|
|
// if (!orderGoods.isEmpty()) {
|
|
|
|
// int i=0;
|
|
|
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
|
|
|
// String num = "";
|
|
|
|
// String goodsName = "";
|
|
|
|
// String finWord = "";
|
|
|
|
// String unitName = "";
|
|
|
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
|
|
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
|
|
|
// if (null != lpkGoods) {
|
|
|
|
// goodsName = lpkGoods.getName();
|
|
|
|
// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
|
|
|
// unitName = lpkGoods.getUnitName();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (orderGood.getGoodsNumber() != 0) {
|
|
|
|
// num = String.valueOf((int) orderGood.getGoodsNumber());
|
|
|
|
// }
|
|
|
|
// finWord = goodsName+num + unitName ;
|
|
|
|
// i++;
|
|
|
|
// if(i>1){
|
|
|
|
// ReserveOrderExport en=new ReserveOrderExport();
|
|
|
|
// BeanUtil.copyProperties(s,en , "id");
|
|
|
|
// en.setGoodsInfo(finWord);
|
|
|
|
// exportList1.add(en);
|
|
|
|
// }else{
|
|
|
|
// s.setGoodsInfo(finWord);
|
|
|
|
// exportList1.add(s);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}); |
|
|
|
} |
|
|
|
//定义导出的excel名字
|
|
|
@ -391,14 +567,16 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa |
|
|
|
WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
|
|
|
//设置 水平居中
|
|
|
|
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); |
|
|
|
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle); |
|
|
|
// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle);
|
|
|
|
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleUtils.getHeadStyle(), StyleUtils.getContentStyle()); |
|
|
|
|
|
|
|
EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器
|
|
|
|
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExport.class) |
|
|
|
//是否自动关闭输入流
|
|
|
|
.autoCloseStream(Boolean.TRUE) |
|
|
|
.registerWriteHandler(new MergeStrategy(exportList1.size(),1,5)).registerWriteHandler(horizontalCellStyleStrategy) |
|
|
|
.sheet().doWrite(exportList1); |
|
|
|
// .registerWriteHandler(new MergeStrategy(exportList.size(),1,5))
|
|
|
|
.registerWriteHandler(horizontalCellStyleStrategy) |
|
|
|
.sheet().doWrite(exportList); |
|
|
|
} catch (IOException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
@ -417,47 +595,62 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa |
|
|
|
if (StringUtils.isNotBlank(query.getStore())) { |
|
|
|
qw.like("s.name", query.getStore()); |
|
|
|
} |
|
|
|
qw.orderByDesc("o.createTime"); |
|
|
|
if (StringUtils.isNotBlank(query.getBankSid())) { |
|
|
|
qw.eq("s.bankSid", query.getBankSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBankName())) { |
|
|
|
qw.like("s.name", query.getBankName()); |
|
|
|
} |
|
|
|
qw.orderByAsc("o.reserveDate"); |
|
|
|
qw.orderByDesc("d.sort"); |
|
|
|
qw.orderByDesc("s.sort"); |
|
|
|
qw.groupBy("o.reserveDate"); |
|
|
|
qw.groupBy("t.goodsSid"); |
|
|
|
qw.groupBy("s.name"); |
|
|
|
// qw.orderByDesc("o.reserveDate");
|
|
|
|
// qw.groupBy("s.name");
|
|
|
|
//得到所有要导出的数据
|
|
|
|
List<ReserveOrderExportByStore> exportList = baseMapper.exportExcelByStore(qw); |
|
|
|
List<ReserveOrderExportByStore> exportList1 = new ArrayList<>(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
if (!exportList.isEmpty()) { |
|
|
|
exportList.forEach(s -> { |
|
|
|
List<String> list=baseMapper.getOrderByStore(s.getStoreSid()); |
|
|
|
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list); |
|
|
|
if (!orderGoods.isEmpty()) { |
|
|
|
int i=0; |
|
|
|
for (LpkReserveOrderGoods orderGood : orderGoods) { |
|
|
|
String num = ""; |
|
|
|
String goodsName = ""; |
|
|
|
String finWord = ""; |
|
|
|
String unitName = ""; |
|
|
|
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) { |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid()); |
|
|
|
if (null != lpkGoods) { |
|
|
|
goodsName = lpkGoods.getName(); |
|
|
|
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) { |
|
|
|
unitName = lpkGoods.getUnitName(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (orderGood.getGoodsNumber() != 0) { |
|
|
|
num = String.valueOf((int) orderGood.getGoodsNumber()); |
|
|
|
} |
|
|
|
finWord = goodsName+ num + unitName; |
|
|
|
i++; |
|
|
|
if(i>1){ |
|
|
|
ReserveOrderExportByStore en=new ReserveOrderExportByStore(); |
|
|
|
BeanUtil.copyProperties(s,en , "id"); |
|
|
|
en.setGoodsInfo(finWord); |
|
|
|
exportList1.add(en); |
|
|
|
}else{ |
|
|
|
s.setGoodsInfo(finWord); |
|
|
|
exportList1.add(s); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); |
|
|
|
s.setGoodsName(lpkGoods.getName()); |
|
|
|
// List<String> list=baseMapper.getOrderByStore(s.getStoreSid(),s.getReserveDate());
|
|
|
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
|
|
|
// if (!orderGoods.isEmpty()) {
|
|
|
|
// int i=0;
|
|
|
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
|
|
|
// String num = "";
|
|
|
|
// String goodsName = "";
|
|
|
|
// String finWord = "";
|
|
|
|
// String unitName = "";
|
|
|
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
|
|
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
|
|
|
// if (null != lpkGoods) {
|
|
|
|
// goodsName = lpkGoods.getName();
|
|
|
|
// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
|
|
|
// unitName = lpkGoods.getUnitName();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (orderGood.getGoodsNumber() != 0) {
|
|
|
|
// num = String.valueOf((int) orderGood.getGoodsNumber());
|
|
|
|
// }
|
|
|
|
// finWord = goodsName+ num + unitName;
|
|
|
|
// i++;
|
|
|
|
// if(i>1){
|
|
|
|
// ReserveOrderExportByStore en=new ReserveOrderExportByStore();
|
|
|
|
// BeanUtil.copyProperties(s,en , "id");
|
|
|
|
// en.setGoodsInfo(finWord);
|
|
|
|
// exportList1.add(en);
|
|
|
|
// }else{
|
|
|
|
// s.setGoodsInfo(finWord);
|
|
|
|
// exportList1.add(s);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}); |
|
|
|
} |
|
|
|
//定义导出的excel名字
|
|
|
@ -477,14 +670,16 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa |
|
|
|
WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
|
|
|
//设置 水平居中
|
|
|
|
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); |
|
|
|
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle); |
|
|
|
// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle);
|
|
|
|
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleUtils.getHeadStyle(), StyleUtils.getContentStyle()); |
|
|
|
|
|
|
|
EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器
|
|
|
|
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByStore.class) |
|
|
|
//是否自动关闭输入流
|
|
|
|
.autoCloseStream(Boolean.TRUE) |
|
|
|
.registerWriteHandler(new MergeStrategy(exportList1.size(),1,1)).registerWriteHandler(horizontalCellStyleStrategy) |
|
|
|
.sheet().doWrite(exportList1); |
|
|
|
// .registerWriteHandler(new MergeStrategy(exportList.size(),1,1))
|
|
|
|
.registerWriteHandler(horizontalCellStyleStrategy) |
|
|
|
.sheet().doWrite(exportList); |
|
|
|
} catch (IOException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
@ -504,53 +699,57 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa |
|
|
|
qw.like("s.name", query.getStore()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBankSid())) { |
|
|
|
qw.like("s.bankSid", query.getBankSid()); |
|
|
|
qw.eq("s.bankSid", query.getBankSid()); |
|
|
|
} |
|
|
|
qw.orderByDesc("o.createTime"); |
|
|
|
qw.groupBy("s.name"); |
|
|
|
qw.orderByDesc("o.reserveDate"); |
|
|
|
qw.groupBy("t.goodsSid"); |
|
|
|
qw.groupBy("o.reserveDate"); |
|
|
|
// qw.groupBy("s.name");
|
|
|
|
//得到所有要导出的数据
|
|
|
|
List<ReserveOrderExportByStore> exportList = baseMapper.exportExcelByStore(qw); |
|
|
|
List<ReserveOrderExportByStore> exportList1 = new ArrayList<>(); |
|
|
|
List<ReserveOrderExportByBank> exportList = baseMapper.exportExcelByBank(qw); |
|
|
|
List<ReserveOrderExportByBank> exportList1 = new ArrayList<>(); |
|
|
|
if (!exportList.isEmpty()) { |
|
|
|
exportList.forEach(s -> { |
|
|
|
List<String> list=baseMapper.getOrderByStore(s.getStoreSid()); |
|
|
|
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list); |
|
|
|
if (!orderGoods.isEmpty()) { |
|
|
|
int i=0; |
|
|
|
for (LpkReserveOrderGoods orderGood : orderGoods) { |
|
|
|
String num = ""; |
|
|
|
String goodsName = ""; |
|
|
|
String finWord = ""; |
|
|
|
String unitName = ""; |
|
|
|
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) { |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid()); |
|
|
|
if (null != lpkGoods) { |
|
|
|
goodsName = lpkGoods.getName(); |
|
|
|
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) { |
|
|
|
unitName = lpkGoods.getUnitName(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (orderGood.getGoodsNumber() != 0) { |
|
|
|
num = String.valueOf((int) orderGood.getGoodsNumber()); |
|
|
|
} |
|
|
|
finWord = goodsName+ num + unitName; |
|
|
|
i++; |
|
|
|
if(i>1){ |
|
|
|
ReserveOrderExportByStore en=new ReserveOrderExportByStore(); |
|
|
|
BeanUtil.copyProperties(s,en , "id"); |
|
|
|
en.setGoodsInfo(finWord); |
|
|
|
exportList1.add(en); |
|
|
|
}else{ |
|
|
|
s.setGoodsInfo(finWord); |
|
|
|
exportList1.add(s); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); |
|
|
|
s.setGoodsName(lpkGoods.getName()); |
|
|
|
// List<String> list=baseMapper.getOrderByStore(s.getStoreSid(),s.getReserveDate());
|
|
|
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
|
|
|
// if (!orderGoods.isEmpty()) {
|
|
|
|
// int i=0;
|
|
|
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
|
|
|
// String num = "";
|
|
|
|
// String goodsName = "";
|
|
|
|
// String finWord = "";
|
|
|
|
// String unitName = "";
|
|
|
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
|
|
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
|
|
|
// if (null != lpkGoods) {
|
|
|
|
// goodsName = lpkGoods.getName();
|
|
|
|
// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
|
|
|
// unitName = lpkGoods.getUnitName();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (orderGood.getGoodsNumber() != 0) {
|
|
|
|
// num = String.valueOf((int) orderGood.getGoodsNumber());
|
|
|
|
// }
|
|
|
|
// finWord = goodsName+ num + unitName;
|
|
|
|
// i++;
|
|
|
|
// if(i>1){
|
|
|
|
// ReserveOrderExportByBank en=new ReserveOrderExportByBank();
|
|
|
|
// BeanUtil.copyProperties(s,en , "id");
|
|
|
|
// en.setGoodsInfo(finWord);
|
|
|
|
// exportList1.add(en);
|
|
|
|
// }else{
|
|
|
|
// s.setGoodsInfo(finWord);
|
|
|
|
// exportList1.add(s);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}); |
|
|
|
} |
|
|
|
//定义导出的excel名字
|
|
|
|
String excelName = "配货信息.xlsx"; |
|
|
|
String excelName = "支行汇总信息.xlsx"; |
|
|
|
String fileNameURL = "1"; |
|
|
|
response.setContentType( "application/vnd.ms-excel"); |
|
|
|
response.setCharacterEncoding("utf8"); |
|
|
@ -558,27 +757,119 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa |
|
|
|
ServletOutputStream outputStream = null; |
|
|
|
try { |
|
|
|
WriteCellStyle headWriteCellStyle = new WriteCellStyle(); |
|
|
|
|
|
|
|
//设置头居中
|
|
|
|
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); |
|
|
|
|
|
|
|
//内容策略
|
|
|
|
WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
|
|
|
//设置 水平居中
|
|
|
|
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); |
|
|
|
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle); |
|
|
|
// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle);
|
|
|
|
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleUtils.getHeadStyle(), StyleUtils.getContentStyle()); |
|
|
|
|
|
|
|
EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器
|
|
|
|
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByStore.class) |
|
|
|
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByBank.class) |
|
|
|
//是否自动关闭输入流
|
|
|
|
.autoCloseStream(Boolean.TRUE) |
|
|
|
.registerWriteHandler(new MergeStrategy(exportList1.size(),1,1)).registerWriteHandler(horizontalCellStyleStrategy) |
|
|
|
.sheet().doWrite(exportList1); |
|
|
|
// .registerWriteHandler(new MergeStrategy(exportList.size(),1,5))
|
|
|
|
.registerWriteHandler(horizontalCellStyleStrategy) |
|
|
|
.sheet().doWrite(exportList); |
|
|
|
} catch (IOException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
} |
|
|
|
public void exportExcelByZ(LpkReserveOrderQuery query) { |
|
|
|
QueryWrapper<LpkReserveOrderQuery> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("1", "1"); |
|
|
|
if (StringUtils.isNotBlank(query.getStartDate())) { |
|
|
|
String startDate = query.getStartDate(); |
|
|
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(startDate), "date_format (o.reserveDate,'%Y-%m-%d') >= date_format('" + startDate + "','%Y-%m-%d')"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getEndDate())) { |
|
|
|
String endDate = query.getEndDate(); |
|
|
|
qw.apply(org.apache.commons.lang3.StringUtils.isNotEmpty(endDate), "date_format (o.reserveDate,'%Y-%m-%d') <= date_format('" + endDate + "','%Y-%m-%d')"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getStore())) { |
|
|
|
qw.like("s.name", query.getStore()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBankSid())) { |
|
|
|
qw.eq("s.bankSid", query.getBankSid()); |
|
|
|
} |
|
|
|
qw.orderByDesc("o.reserveDate"); |
|
|
|
qw.groupBy("t.goodsSid"); |
|
|
|
qw.groupBy("o.reserveDate"); |
|
|
|
// qw.groupBy("s.name");
|
|
|
|
//得到所有要导出的数据
|
|
|
|
List<ReserveOrderExportByZ> exportList = baseMapper.exportExcelByZ(qw); |
|
|
|
List<ReserveOrderExportByZ> exportList1 = new ArrayList<>(); |
|
|
|
if (!exportList.isEmpty()) { |
|
|
|
exportList.forEach(s -> { |
|
|
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid()); |
|
|
|
s.setGoodsName(lpkGoods.getName()); |
|
|
|
// List<String> list=baseMapper.getOrderByStore(s.getStoreSid(),s.getReserveDate());
|
|
|
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
|
|
|
// if (!orderGoods.isEmpty()) {
|
|
|
|
// int i=0;
|
|
|
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
|
|
|
// String num = "";
|
|
|
|
// String goodsName = "";
|
|
|
|
// String finWord = "";
|
|
|
|
// String unitName = "";
|
|
|
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
|
|
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
|
|
|
// if (null != lpkGoods) {
|
|
|
|
// goodsName = lpkGoods.getName();
|
|
|
|
// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
|
|
|
// unitName = lpkGoods.getUnitName();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (orderGood.getGoodsNumber() != 0) {
|
|
|
|
// num = String.valueOf((int) orderGood.getGoodsNumber());
|
|
|
|
// }
|
|
|
|
// finWord = goodsName+ num + unitName;
|
|
|
|
// i++;
|
|
|
|
// if(i>1){
|
|
|
|
// ReserveOrderExportByBank en=new ReserveOrderExportByBank();
|
|
|
|
// BeanUtil.copyProperties(s,en , "id");
|
|
|
|
// en.setGoodsInfo(finWord);
|
|
|
|
// exportList1.add(en);
|
|
|
|
// }else{
|
|
|
|
// s.setGoodsInfo(finWord);
|
|
|
|
// exportList1.add(s);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}); |
|
|
|
} |
|
|
|
//定义导出的excel名字
|
|
|
|
String excelName = "支行汇总信息.xlsx"; |
|
|
|
String fileNameURL = "1"; |
|
|
|
response.setContentType( "application/vnd.ms-excel"); |
|
|
|
response.setCharacterEncoding("utf8"); |
|
|
|
response.setHeader("Content-disposition","attachment;filename="+ excelName ); |
|
|
|
ServletOutputStream outputStream = null; |
|
|
|
try { |
|
|
|
WriteCellStyle headWriteCellStyle = new WriteCellStyle(); |
|
|
|
//设置头居中
|
|
|
|
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); |
|
|
|
//内容策略
|
|
|
|
WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
|
|
|
//设置 水平居中
|
|
|
|
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); |
|
|
|
// HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,contentWriteCellStyle);
|
|
|
|
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleUtils.getHeadStyle(), StyleUtils.getContentStyle()); |
|
|
|
|
|
|
|
EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器
|
|
|
|
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByZ.class) |
|
|
|
//是否自动关闭输入流
|
|
|
|
.autoCloseStream(Boolean.TRUE) |
|
|
|
// .registerWriteHandler(new MergeStrategy(exportList.size(),1,5))
|
|
|
|
.registerWriteHandler(horizontalCellStyleStrategy) |
|
|
|
.sheet().doWrite(exportList); |
|
|
|
} catch (IOException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
} |
|
|
|
public ResultBean<LpkReserveOrderVo> getStoreByCustomerSid(String sid) { |
|
|
|
return new ResultBean().success().setData(baseMapper.getStoreByCustomerSid(sid)); |
|
|
|
} |
|
|
@ -588,4 +879,5 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa |
|
|
|
public ResultBean<List<LpkReserveOrderCardVo>> selOrderByCardSid(String sid) { |
|
|
|
return new ResultBean().success().setData(baseMapper.selOrderByCardSid(sid)); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|