12/17
This commit is contained in:
@@ -31,4 +31,5 @@ public class LpkGiftBag {
|
|||||||
private String boundary;
|
private String boundary;
|
||||||
private String boundaryPrice;
|
private String boundaryPrice;
|
||||||
private String iconUrl;
|
private String iconUrl;
|
||||||
|
private String isGrounding;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class LpkGiftBagDto implements Dto {
|
|||||||
private String boundary;
|
private String boundary;
|
||||||
private String boundaryPrice;
|
private String boundaryPrice;
|
||||||
private String iconUrl;
|
private String iconUrl;
|
||||||
|
private String isGrounding;
|
||||||
//商品sid
|
//商品sid
|
||||||
private List<GiftBagGoods> goods = new ArrayList<>();
|
private List<GiftBagGoods> goods = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,4 +20,6 @@ public class LpkGiftBagVo implements Vo {
|
|||||||
private String boundary;
|
private String boundary;
|
||||||
private String boundaryPrice;
|
private String boundaryPrice;
|
||||||
private String iconUrl;
|
private String iconUrl;
|
||||||
|
private String isEnable;
|
||||||
|
private String isGrounding;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ public class AppletVo {
|
|||||||
if(o<10){
|
if(o<10){
|
||||||
end=sdf.format(DateUtil.offsetDay(DateUtil.parse(dateEnd),10));
|
end=sdf.format(DateUtil.offsetDay(DateUtil.parse(dateEnd),10));
|
||||||
}else{
|
}else{
|
||||||
end=sdf.format(DateUtil.parse(dateEnd));
|
// end=sdf.format(DateUtil.parse(dateEnd));
|
||||||
|
end=sdf.format(DateUtil.offsetDay(DateUtil.parse(start),4));
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(String.valueOf(k).equals("1")){
|
if(String.valueOf(k).equals("1")){
|
||||||
|
|||||||
@@ -16,4 +16,5 @@ public class LpkReserveOrderQuery implements Query {
|
|||||||
private String userSid;
|
private String userSid;
|
||||||
private String storeSid;
|
private String storeSid;
|
||||||
private String bankSid;
|
private String bankSid;
|
||||||
|
private String bankName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,4 +27,9 @@ public class LpkReserveOrderVo implements Vo {
|
|||||||
private String goodsInfo;
|
private String goodsInfo;
|
||||||
private List<OrderGoodsVo> goodsVo = new ArrayList<>();
|
private List<OrderGoodsVo> goodsVo = new ArrayList<>();
|
||||||
private List<String> goods=new ArrayList<>();
|
private List<String> goods=new ArrayList<>();
|
||||||
|
private String bankName;
|
||||||
|
private String goodsSid;
|
||||||
|
private String goodsName;
|
||||||
|
private String goodsNumber;
|
||||||
|
private String serialNumber;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,34 +18,40 @@ import lombok.Setter;
|
|||||||
@Setter
|
@Setter
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode
|
||||||
public class ReserveOrderExport {
|
public class ReserveOrderExport {
|
||||||
|
|
||||||
@ColumnWidth(20)
|
@ColumnWidth(20)
|
||||||
@ExcelProperty(value = "预约时间",index = 0)
|
@ExcelProperty(value = "预约时间",index = 0)
|
||||||
private String reserveDate;
|
private String reserveDate;
|
||||||
|
|
||||||
@ColumnWidth(20)
|
@ColumnWidth(20)
|
||||||
@ExcelProperty(value = "提货门店",index = 1)
|
@ExcelProperty(value = "支行",index = 1)
|
||||||
|
private String bankName;
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "提货门店",index = 2)
|
||||||
private String store;
|
private String store;
|
||||||
|
|
||||||
@ColumnWidth(20)
|
@ColumnWidth(20)
|
||||||
@ExcelProperty(value = "姓名",index = 2)
|
@ExcelProperty(value = "礼包名称",index = 3)
|
||||||
private String userName;
|
|
||||||
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty(value = "联系方式",index = 3)
|
|
||||||
private String userPhone;
|
|
||||||
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty(value = "提货卡号",index = 4)
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
@ColumnWidth(20)
|
|
||||||
@ExcelProperty(value = "礼包名称",index = 5)
|
|
||||||
private String bagName;
|
private String bagName;
|
||||||
|
|
||||||
@ColumnWidth(20)
|
@ColumnWidth(20)
|
||||||
@ExcelProperty(value = "商品明细",index = 6)
|
@ExcelProperty(value = "提货卡序列号",index = 4)
|
||||||
private String goodsInfo;
|
private String serialNumber;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "姓名",index = 5)
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "联系方式",index = 6)
|
||||||
|
private String userPhone;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "商品名称",index = 7)
|
||||||
|
private String goodsName;
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "商品数量(份)",index = 8)
|
||||||
|
private String goodsNumber;
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private String sid;
|
private String sid;
|
||||||
|
@ExcelIgnore
|
||||||
|
private String goodsSid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.yxt.yyth.api.lpkreserveorder;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2023/12/11 13:58
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class ReserveOrderExportByBank {
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "预约时间",index = 0)
|
||||||
|
private String reserveDate;
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "支行",index = 1)
|
||||||
|
private String bankName;
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "商品名称",index = 2)
|
||||||
|
private String goodsName;
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "商品数量(份)",index = 3)
|
||||||
|
private String goodsNumber;
|
||||||
|
@ExcelIgnore
|
||||||
|
private String storeSid;
|
||||||
|
@ExcelIgnore
|
||||||
|
private String goodsSid;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -23,11 +23,21 @@ public class ReserveOrderExportByStore {
|
|||||||
@ExcelProperty(value = "预约时间",index = 0)
|
@ExcelProperty(value = "预约时间",index = 0)
|
||||||
private String reserveDate;
|
private String reserveDate;
|
||||||
@ColumnWidth(20)
|
@ColumnWidth(20)
|
||||||
@ExcelProperty(value = "提货门店",index = 1)
|
@ExcelProperty(value = "支行",index = 1)
|
||||||
private String store;
|
private String bankName;
|
||||||
@ColumnWidth(20)
|
@ColumnWidth(20)
|
||||||
@ExcelProperty(value = "商品明细",index = 2)
|
@ExcelProperty(value = "提货门店",index = 2)
|
||||||
private String goodsInfo;
|
private String store;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "商品名称",index = 3)
|
||||||
|
private String goodsName;
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "商品数量(份)",index = 4)
|
||||||
|
private String goodsNumber;
|
||||||
|
|
||||||
@ExcelIgnore
|
@ExcelIgnore
|
||||||
private String storeSid;
|
private String storeSid;
|
||||||
|
@ExcelIgnore
|
||||||
|
private String goodsSid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.yxt.yyth.api.lpkreserveorder;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2023/12/11 13:58
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class ReserveOrderExportByZ {
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "预约时间",index = 0)
|
||||||
|
private String reserveDate;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "商品名称",index = 1)
|
||||||
|
private String goodsName;
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "商品数量(份)",index = 2)
|
||||||
|
private String goodsNumber;
|
||||||
|
@ExcelIgnore
|
||||||
|
private String storeSid;
|
||||||
|
@ExcelIgnore
|
||||||
|
private String goodsSid;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,7 +12,8 @@
|
|||||||
date_format(dateEnd, '%Y-%m-%d') as dateEnd,
|
date_format(dateEnd, '%Y-%m-%d') as dateEnd,
|
||||||
boundary,
|
boundary,
|
||||||
boundaryPrice,
|
boundaryPrice,
|
||||||
iconUrl
|
iconUrl,
|
||||||
|
isEnable
|
||||||
from lpk_giftbag
|
from lpk_giftbag
|
||||||
<where>
|
<where>
|
||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
@@ -22,5 +23,6 @@
|
|||||||
select
|
select
|
||||||
*
|
*
|
||||||
from lpk_giftbag
|
from lpk_giftbag
|
||||||
|
where isGrounding=1
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -58,4 +58,9 @@ public class LpkGiftBagRest {
|
|||||||
public ResultBean giftBagList() {
|
public ResultBean giftBagList() {
|
||||||
return lpkGiftBagService.giftBagList();
|
return lpkGiftBagService.giftBagList();
|
||||||
}
|
}
|
||||||
|
@GetMapping("/isGrounding/{sid}/{state}")
|
||||||
|
@ApiOperation(value = "设置是否上下架")
|
||||||
|
public ResultBean isGrounding(@PathVariable("sid")String sid,@PathVariable("state") String state) {
|
||||||
|
return lpkGiftBagService.isGrounding(sid, state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.yxt.common.core.vo.PagerVo;
|
|||||||
import com.yxt.yyth.api.lpkcustomer.LpkCustomer;
|
import com.yxt.yyth.api.lpkcustomer.LpkCustomer;
|
||||||
import com.yxt.yyth.api.lpkgiftbag.*;
|
import com.yxt.yyth.api.lpkgiftbag.*;
|
||||||
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoods;
|
import com.yxt.yyth.api.lpkgiftbaggoods.LpkGiftBagGoods;
|
||||||
|
import com.yxt.yyth.api.lpkgiftcard.LpkGiftCard;
|
||||||
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
import com.yxt.yyth.api.lpkgoods.LpkGoods;
|
||||||
import com.yxt.yyth.api.lpkgoods.LpkGoodsQuery;
|
import com.yxt.yyth.api.lpkgoods.LpkGoodsQuery;
|
||||||
import com.yxt.yyth.api.lpkgoods.LpkGoodsVo;
|
import com.yxt.yyth.api.lpkgoods.LpkGoodsVo;
|
||||||
@@ -181,5 +182,11 @@ public class LpkGiftBagService extends MybatisBaseService<LpkGiftBagMapper, LpkG
|
|||||||
List<LpkGiftBagVo> pagging = baseMapper.giftBagList();
|
List<LpkGiftBagVo> pagging = baseMapper.giftBagList();
|
||||||
return rb.success().setData(pagging);
|
return rb.success().setData(pagging);
|
||||||
}
|
}
|
||||||
|
public ResultBean isGrounding(String sid,String state) {
|
||||||
|
ResultBean rb = new ResultBean().fail();
|
||||||
|
LpkGiftBag bag=baseMapper.selectOne(new QueryWrapper<LpkGiftBag>().eq("sid",sid));
|
||||||
|
bag.setIsGrounding(state);
|
||||||
|
baseMapper.updateById(bag);
|
||||||
|
return rb.success().setMsg("修改成功");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -640,6 +640,7 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
|||||||
sunday = sunday.plus(Period.ofDays(7));
|
sunday = sunday.plus(Period.ofDays(7));
|
||||||
System.out.println(sunday.compareTo(endD));
|
System.out.println(sunday.compareTo(endD));
|
||||||
} while (sunday.compareTo(endD) < 1);
|
} while (sunday.compareTo(endD) < 1);
|
||||||
|
weekMap.add("2024-01-01");
|
||||||
Object[] array = weekMap.stream().sorted().toArray();
|
Object[] array = weekMap.stream().sorted().toArray();
|
||||||
return rb.success().setData(array);
|
return rb.success().setData(array);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
|||||||
}
|
}
|
||||||
baseMapper.updateById(lpkGoods);
|
baseMapper.updateById(lpkGoods);
|
||||||
} else {
|
} else {
|
||||||
|
LpkGoods goods=baseMapper.selectOne(new QueryWrapper<LpkGoods>().eq("name",dto.getName()));
|
||||||
|
if(null!=goods){
|
||||||
|
return rb.setMsg("商品名不能重复");
|
||||||
|
}
|
||||||
LpkGoods lpkGoods = new LpkGoods();
|
LpkGoods lpkGoods = new LpkGoods();
|
||||||
sid = lpkGoods.getSid();
|
sid = lpkGoods.getSid();
|
||||||
BeanUtil.copyProperties(dto, lpkGoods, "id", "sid");
|
BeanUtil.copyProperties(dto, lpkGoods, "id", "sid");
|
||||||
|
|||||||
@@ -19,14 +19,18 @@ import java.util.List;
|
|||||||
public interface LpkReserveOrderMapper extends BaseMapper<LpkReserveOrder> {
|
public interface LpkReserveOrderMapper extends BaseMapper<LpkReserveOrder> {
|
||||||
IPage<LpkReserveOrderVo> orderList(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
IPage<LpkReserveOrderVo> orderList(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||||
IPage<LpkReserveOrderVo> orderListByStore(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
IPage<LpkReserveOrderVo> orderListByStore(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||||
|
IPage<LpkReserveOrderVo> orderListByBank(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||||
|
IPage<LpkReserveOrderVo> orderListByZ(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||||
List<LpkReserveOrderCardVo> orderByCardSid(String sid);
|
List<LpkReserveOrderCardVo> orderByCardSid(String sid);
|
||||||
|
|
||||||
IPage<LpkReserveOrderCardVo> orderListByUserSid(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
IPage<LpkReserveOrderCardVo> orderListByUserSid(IPage<LpkReserveOrder> page, @Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrder> qw);
|
||||||
|
|
||||||
List<ReserveOrderExport> exportExcel(@Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrderQuery> qw);
|
List<ReserveOrderExport> exportExcel(@Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrderQuery> qw);
|
||||||
List<ReserveOrderExportByStore> exportExcelByStore(@Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrderQuery> qw);
|
List<ReserveOrderExportByStore> exportExcelByStore(@Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrderQuery> qw);
|
||||||
@Select("select sid from lpk_reserve_order where storeSid=#{storeSid}")
|
List<ReserveOrderExportByBank> exportExcelByBank(@Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrderQuery> qw);
|
||||||
List<String> getOrderByStore(@Param("storeSid")String storeSid);
|
List<ReserveOrderExportByZ> exportExcelByZ(@Param(Constants.WRAPPER) QueryWrapper<LpkReserveOrderQuery> qw);
|
||||||
|
@Select("select sid from lpk_reserve_order where storeSid=#{storeSid} and reserveDate =#{reserveDate}")
|
||||||
|
List<String> getOrderByStore(@Param("storeSid")String storeSid,@Param("reserveDate")String reserveDate);
|
||||||
@Select("select * from lpk_reserve_order where customerSid =#{sid} order by createTime desc limit 1")
|
@Select("select * from lpk_reserve_order where customerSid =#{sid} order by createTime desc limit 1")
|
||||||
LpkReserveOrderVo getStoreByCustomerSid(@Param("sid") String sid);
|
LpkReserveOrderVo getStoreByCustomerSid(@Param("sid") String sid);
|
||||||
@Select("select * from lpk_reserve_order where cardSid =#{sid} order by reserveDate desc limit 1")
|
@Select("select * from lpk_reserve_order where cardSid =#{sid} order by reserveDate desc limit 1")
|
||||||
|
|||||||
@@ -26,11 +26,16 @@
|
|||||||
o.userPhone,
|
o.userPhone,
|
||||||
s.`name` as store,
|
s.`name` as store,
|
||||||
b.`name` as bagName,
|
b.`name` as bagName,
|
||||||
c.`code`
|
d.name as bankName,
|
||||||
|
c.`code`,c.serialNumber,
|
||||||
|
t.goodsSid as goodsSid,
|
||||||
|
t.goodsNumber as goodsNumber
|
||||||
from lpk_reserve_order as o
|
from lpk_reserve_order as o
|
||||||
|
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||||
left join lpk_store as s on o.storeSid = s.sid
|
left join lpk_store as s on o.storeSid = s.sid
|
||||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||||
|
left join lpk_bank as d on d.sid =s.bankSid
|
||||||
<where>
|
<where>
|
||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
@@ -40,15 +45,60 @@
|
|||||||
o.sid,
|
o.sid,
|
||||||
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||||
s.`name` as store,
|
s.`name` as store,
|
||||||
s.sid as storeSid
|
s.sid as storeSid,
|
||||||
|
d.name as bankName,
|
||||||
|
t.goodsSid as goodsSid,
|
||||||
|
sum(t.goodsNumber) as goodsNumber
|
||||||
from lpk_reserve_order as o
|
from lpk_reserve_order as o
|
||||||
|
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||||
left join lpk_store as s on o.storeSid = s.sid
|
left join lpk_store as s on o.storeSid = s.sid
|
||||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||||
|
left join lpk_bank as d on d.sid =s.bankSid
|
||||||
<where>
|
<where>
|
||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="orderListByBank" resultType="com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderVo">
|
||||||
|
select
|
||||||
|
o.sid,
|
||||||
|
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||||
|
s.`name` as store,
|
||||||
|
s.sid as storeSid,
|
||||||
|
d.name as bankName,
|
||||||
|
t.goodsSid as goodsSid,
|
||||||
|
sum(t.goodsNumber) as goodsNumber
|
||||||
|
from lpk_reserve_order as o
|
||||||
|
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||||
|
left join lpk_store as s on o.storeSid = s.sid
|
||||||
|
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||||
|
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||||
|
left join lpk_bank as d on d.sid =s.bankSid
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="orderListByZ" resultType="com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderVo">
|
||||||
|
SELECT
|
||||||
|
o.sid,
|
||||||
|
date_format( o.reserveDate, '%Y-%m-%d' ) AS reserveDate,
|
||||||
|
s.`name` AS store,
|
||||||
|
s.sid AS storeSid,
|
||||||
|
d.NAME AS bankName ,
|
||||||
|
t.goodsSid as goodsSid,
|
||||||
|
sum(t.goodsNumber) as goodsNumber
|
||||||
|
FROM
|
||||||
|
lpk_reserve_order AS o
|
||||||
|
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||||
|
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||||
|
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||||
|
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||||
|
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="orderByCardSid" resultType="com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo">
|
<select id="orderByCardSid" resultType="com.yxt.yyth.api.lpkreserveorder.LpkReserveOrderCardVo">
|
||||||
SELECT date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
SELECT date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||||
c.`code`,
|
c.`code`,
|
||||||
@@ -101,11 +151,16 @@
|
|||||||
o.userPhone,
|
o.userPhone,
|
||||||
s.`name` as store,
|
s.`name` as store,
|
||||||
b.`name` as bagName,
|
b.`name` as bagName,
|
||||||
c.`code`
|
d.name as bankName,
|
||||||
|
c.`code`,c.serialNumber,
|
||||||
|
t.goodsSid as goodsSid,
|
||||||
|
t.goodsNumber as goodsNumber
|
||||||
from lpk_reserve_order as o
|
from lpk_reserve_order as o
|
||||||
|
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||||
left join lpk_store as s on o.storeSid = s.sid
|
left join lpk_store as s on o.storeSid = s.sid
|
||||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||||
|
left join lpk_bank as d on d.sid =s.bankSid
|
||||||
<where>
|
<where>
|
||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
@@ -115,14 +170,57 @@
|
|||||||
o.sid,
|
o.sid,
|
||||||
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||||
s.`name` as store,
|
s.`name` as store,
|
||||||
s.sid as storeSid
|
s.sid as storeSid,
|
||||||
|
d.name as bankName,
|
||||||
|
t.goodsSid as goodsSid,
|
||||||
|
sum(t.goodsNumber) as goodsNumber
|
||||||
from lpk_reserve_order as o
|
from lpk_reserve_order as o
|
||||||
|
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||||
left join lpk_store as s on o.storeSid = s.sid
|
left join lpk_store as s on o.storeSid = s.sid
|
||||||
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||||
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||||
|
left join lpk_bank as d on d.sid =s.bankSid
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="exportExcelByBank" resultType="com.yxt.yyth.api.lpkreserveorder.ReserveOrderExportByBank">
|
||||||
|
select
|
||||||
|
o.sid,
|
||||||
|
date_format(o.reserveDate, '%Y-%m-%d') as reserveDate,
|
||||||
|
s.`name` as store,
|
||||||
|
s.sid as storeSid,
|
||||||
|
d.name as bankName,
|
||||||
|
t.goodsSid as goodsSid,
|
||||||
|
sum(t.goodsNumber) as goodsNumber
|
||||||
|
from lpk_reserve_order as o
|
||||||
|
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||||
|
left join lpk_store as s on o.storeSid = s.sid
|
||||||
|
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||||
|
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||||
|
left join lpk_bank as d on d.sid =s.bankSid
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="exportExcelByZ" resultType="com.yxt.yyth.api.lpkreserveorder.ReserveOrderExportByZ">
|
||||||
|
SELECT
|
||||||
|
o.sid,
|
||||||
|
date_format( o.reserveDate, '%Y-%m-%d' ) AS reserveDate,
|
||||||
|
s.`name` AS store,
|
||||||
|
s.sid AS storeSid,
|
||||||
|
d.NAME AS bankName ,
|
||||||
|
t.goodsSid as goodsSid,
|
||||||
|
sum(t.goodsNumber) as goodsNumber
|
||||||
|
FROM
|
||||||
|
lpk_reserve_order AS o
|
||||||
|
LEFT JOIN lpk_reserve_order_goods AS t ON t.orderSid = o.sid
|
||||||
|
LEFT JOIN lpk_store AS s ON o.storeSid = s.sid
|
||||||
|
LEFT JOIN lpk_giftcard AS c ON o.cardSid = c.sid
|
||||||
|
LEFT JOIN lpk_giftbag AS b ON c.giftbagSid = b.sid
|
||||||
|
LEFT JOIN lpk_bank AS d ON d.sid = s.bankSid
|
||||||
<where>
|
<where>
|
||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -48,13 +48,13 @@ public class LpkReserveOrderRest {
|
|||||||
@ApiOperation("订单门店支行汇总列表")
|
@ApiOperation("订单门店支行汇总列表")
|
||||||
@PostMapping("/orderListByBank")
|
@PostMapping("/orderListByBank")
|
||||||
public ResultBean<PagerVo<LpkReserveOrderVo>> orderListByBank(@RequestBody PagerQuery<LpkReserveOrderQuery> pq) {
|
public ResultBean<PagerVo<LpkReserveOrderVo>> orderListByBank(@RequestBody PagerQuery<LpkReserveOrderQuery> pq) {
|
||||||
return lpkReserveOrderService.orderListByStore(pq);
|
return lpkReserveOrderService.orderListByBank(pq);
|
||||||
|
}
|
||||||
|
@ApiOperation("订单总汇总列表")
|
||||||
|
@PostMapping("/orderListByZ")
|
||||||
|
public ResultBean<PagerVo<LpkReserveOrderVo>> orderListByZ(@RequestBody PagerQuery<LpkReserveOrderQuery> pq) {
|
||||||
|
return lpkReserveOrderService.orderListByZ(pq);
|
||||||
}
|
}
|
||||||
// @ApiOperation("订单门店总汇总列表")
|
|
||||||
// @PostMapping("/orderListByStore")
|
|
||||||
// public ResultBean<PagerVo<LpkReserveOrderVo>> orderListByZ(@RequestBody PagerQuery<LpkReserveOrderQuery> pq) {
|
|
||||||
// return lpkReserveOrderService.orderListByStore(pq);
|
|
||||||
// }
|
|
||||||
@ApiOperation("根据提货卡查询预约记录")
|
@ApiOperation("根据提货卡查询预约记录")
|
||||||
@GetMapping("/orderByCardSid/{sid}")
|
@GetMapping("/orderByCardSid/{sid}")
|
||||||
public ResultBean orderByCardSid(@PathVariable("sid") String sid) {
|
public ResultBean orderByCardSid(@PathVariable("sid") String sid) {
|
||||||
@@ -83,9 +83,14 @@ public class LpkReserveOrderRest {
|
|||||||
public void exportExcelByStore(@RequestBody LpkReserveOrderQuery query) {
|
public void exportExcelByStore(@RequestBody LpkReserveOrderQuery query) {
|
||||||
lpkReserveOrderService.exportExcelByStore(query);
|
lpkReserveOrderService.exportExcelByStore(query);
|
||||||
}
|
}
|
||||||
// @ApiOperation(value = "预约订单支行汇总导出")
|
@ApiOperation(value = "预约订单支行汇总导出")
|
||||||
// @PostMapping("/exportExcelByStore")
|
@PostMapping("/exportExcelByBank")
|
||||||
// public void exportExcelByBank(@RequestBody LpkReserveOrderQuery query) {
|
public void exportExcelByBank(@RequestBody LpkReserveOrderQuery query) {
|
||||||
// lpkReserveOrderService.exportExcelByBank(query);
|
lpkReserveOrderService.exportExcelByBank(query);
|
||||||
// }
|
}
|
||||||
|
@ApiOperation(value = "预约订单总汇总导出")
|
||||||
|
@PostMapping("/exportExcelByZ")
|
||||||
|
public void exportExcelByZ(@RequestBody LpkReserveOrderQuery query) {
|
||||||
|
lpkReserveOrderService.exportExcelByZ(query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ import com.yxt.yyth.biz.lpkgiftcard.LpkGiftCardMapper;
|
|||||||
import com.yxt.yyth.biz.lpkgoods.LpkGoodsService;
|
import com.yxt.yyth.biz.lpkgoods.LpkGoodsService;
|
||||||
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService;
|
import com.yxt.yyth.biz.lpkreserveordergoods.LpkReserveOrderGoodsService;
|
||||||
import com.yxt.yyth.biz.lpkstore.LpkStoreService;
|
import com.yxt.yyth.biz.lpkstore.LpkStoreService;
|
||||||
|
import com.yxt.yyth.utils.StyleUtils;
|
||||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||||
|
import org.bouncycastle.jcajce.provider.symmetric.util.PBE;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -127,38 +129,197 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
|||||||
String endDate = 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.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.groupBy("o.reserveDate");
|
||||||
qw.orderByDesc("o.reserveDate");
|
// qw.groupBy("t.goodsSid");
|
||||||
|
// qw.groupBy("s.name");
|
||||||
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq);
|
IPage<LpkReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||||
IPage<LpkReserveOrderVo> pagging = baseMapper.orderList(page, qw);
|
IPage<LpkReserveOrderVo> pagging = baseMapper.orderList(page, qw);
|
||||||
List<LpkReserveOrderVo> records = pagging.getRecords();
|
List<LpkReserveOrderVo> records = pagging.getRecords();
|
||||||
if (!records.isEmpty()) {
|
if (!records.isEmpty()) {
|
||||||
records.forEach(s -> {
|
records.forEach(s -> {
|
||||||
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selByOrderSid(s.getSid());
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid());
|
||||||
List<OrderGoodsVo> goodsVoList = new ArrayList<>();
|
s.setGoodsName(lpkGoods.getName());
|
||||||
if (!orderGoods.isEmpty()) {
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selByOrderSid(s.getSid());
|
||||||
for (LpkReserveOrderGoods orderGood : orderGoods) {
|
// List<OrderGoodsVo> goodsVoList = new ArrayList<>();
|
||||||
OrderGoodsVo goodsVo = new OrderGoodsVo();
|
// if (!orderGoods.isEmpty()) {
|
||||||
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
||||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
// OrderGoodsVo goodsVo = new OrderGoodsVo();
|
||||||
if (null != lpkGoods) {
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
||||||
goodsVo.setGoodName(lpkGoods.getName());
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
||||||
}
|
// if (null != lpkGoods) {
|
||||||
}
|
// goodsVo.setGoodName(lpkGoods.getName());
|
||||||
if (orderGood.getGoodsNumber() != 0) {
|
// }
|
||||||
goodsVo.setNum((int) orderGood.getGoodsNumber());
|
// }
|
||||||
}
|
// if (orderGood.getGoodsNumber() != 0) {
|
||||||
goodsVoList.add(goodsVo);
|
// goodsVo.setNum((int) orderGood.getGoodsNumber());
|
||||||
}
|
// }
|
||||||
}
|
// goodsVoList.add(goodsVo);
|
||||||
s.setGoodsVo(goodsVoList);
|
// }
|
||||||
|
// }
|
||||||
|
// s.setGoodsVo(goodsVoList);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
PagerVo<LpkReserveOrderVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<LpkReserveOrderVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
return rb.success().setData(p);
|
return rb.success().setData(p);
|
||||||
}
|
}
|
||||||
public ResultBean<PagerVo<LpkReserveOrderVo>> orderListByStore(PagerQuery<LpkReserveOrderQuery> pq) {
|
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();
|
ResultBean rb = ResultBean.fireFail();
|
||||||
LpkReserveOrderQuery query = pq.getParams();
|
LpkReserveOrderQuery query = pq.getParams();
|
||||||
QueryWrapper<LpkReserveOrder> qw = new QueryWrapper<>();
|
QueryWrapper<LpkReserveOrder> qw = new QueryWrapper<>();
|
||||||
@@ -181,46 +342,53 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
|||||||
String endDate = 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.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.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<LpkReserveOrder> page = PagerUtil.queryToPage(pq);
|
||||||
IPage<LpkReserveOrderVo> pagging = baseMapper.orderListByStore(page, qw);
|
IPage<LpkReserveOrderVo> pagging = baseMapper.orderListByZ(page, qw);
|
||||||
List<LpkReserveOrderVo> records = pagging.getRecords();
|
List<LpkReserveOrderVo> records = pagging.getRecords();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
if (!records.isEmpty()) {
|
if (!records.isEmpty()) {
|
||||||
records.forEach(s -> {
|
records.forEach(s -> {
|
||||||
List<String> list=baseMapper.getOrderByStore(s.getStoreSid());
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid());
|
||||||
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
s.setGoodsName(lpkGoods.getName());
|
||||||
List<String> a=new ArrayList<>();
|
// List<String> list=baseMapper.getOrderByStore(s.getStoreSid(),sdf.format(s.getReserveDate()));
|
||||||
if (!orderGoods.isEmpty()) {
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
||||||
StringBuffer sb = new StringBuffer();
|
// List<String> a=new ArrayList<>();
|
||||||
for (LpkReserveOrderGoods orderGood : orderGoods) {
|
// if (!orderGoods.isEmpty()) {
|
||||||
String num = "";
|
// StringBuffer sb = new StringBuffer();
|
||||||
String goodsName = "";
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
||||||
String finWord = "";
|
// String num = "";
|
||||||
String unitName = "";
|
// String goodsName = "";
|
||||||
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
// String finWord = "";
|
||||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
// String unitName = "";
|
||||||
if (null != lpkGoods) {
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
||||||
goodsName = lpkGoods.getName();
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
||||||
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
// if (null != lpkGoods) {
|
||||||
unitName = lpkGoods.getUnitName();
|
// goodsName = lpkGoods.getName();
|
||||||
}
|
// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
||||||
}
|
// unitName = lpkGoods.getUnitName();
|
||||||
}
|
// }
|
||||||
if (orderGood.getGoodsNumber() != 0) {
|
// }
|
||||||
num = String.valueOf((int) orderGood.getGoodsNumber());
|
// }
|
||||||
}
|
// if (orderGood.getGoodsNumber() != 0) {
|
||||||
finWord = goodsName + num + unitName ;
|
// num = String.valueOf((int) orderGood.getGoodsNumber());
|
||||||
a.add(finWord);
|
// }
|
||||||
|
// finWord = goodsName + num + unitName ;
|
||||||
|
// a.add(finWord);
|
||||||
// sb.append(finWord).append("、");
|
// sb.append(finWord).append("、");
|
||||||
}
|
// }
|
||||||
if (sb.length() > 0) {
|
// if (sb.length() > 0) {
|
||||||
sb.delete(sb.length() - 1, sb.length());
|
// sb.delete(sb.length() - 1, sb.length());
|
||||||
s.setGoodsInfo(sb.toString());
|
// s.setGoodsInfo(sb.toString());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
s.setGoods(a);
|
// s.setGoods(a);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
PagerVo<LpkReserveOrderVo> p = PagerUtil.pageToVo(pagging, null);
|
PagerVo<LpkReserveOrderVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
@@ -316,6 +484,9 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
|||||||
if (StringUtils.isNotBlank(query.getStore())) {
|
if (StringUtils.isNotBlank(query.getStore())) {
|
||||||
qw.like("s.name", query.getStore());
|
qw.like("s.name", query.getStore());
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(query.getBankSid())) {
|
||||||
|
qw.eq("s.bankSid", query.getBankSid());
|
||||||
|
}
|
||||||
if (StringUtils.isNotBlank(query.getUserName())) {
|
if (StringUtils.isNotBlank(query.getUserName())) {
|
||||||
qw.like("o.userName", query.getUserName());
|
qw.like("o.userName", query.getUserName());
|
||||||
}
|
}
|
||||||
@@ -327,50 +498,55 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
|||||||
String endDate = 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.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> exportList = baseMapper.exportExcel(qw);
|
||||||
List<ReserveOrderExport> exportList1 = new ArrayList<>();
|
List<ReserveOrderExport> exportList1 = new ArrayList<>();
|
||||||
if (!exportList.isEmpty()) {
|
if (!exportList.isEmpty()) {
|
||||||
exportList.forEach(s -> {
|
exportList.forEach(s -> {
|
||||||
if (StringUtils.isNotBlank(s.getUserPhone())) {
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid());
|
||||||
// String phone = s.getUserPhone().substring(0, 3) + "****" + s.getUserPhone().substring(7);
|
s.setGoodsName(lpkGoods.getName());
|
||||||
String phone = s.getUserPhone();
|
// if (StringUtils.isNotBlank(s.getUserPhone())) {
|
||||||
s.setUserPhone(phone);
|
//// String phone = s.getUserPhone().substring(0, 3) + "****" + s.getUserPhone().substring(7);
|
||||||
}
|
// String phone = s.getUserPhone();
|
||||||
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selByOrderSid(s.getSid());
|
// s.setUserPhone(phone);
|
||||||
if (!orderGoods.isEmpty()) {
|
// }
|
||||||
int i=0;
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selByOrderSid(s.getSid());
|
||||||
for (LpkReserveOrderGoods orderGood : orderGoods) {
|
// if (!orderGoods.isEmpty()) {
|
||||||
String num = "";
|
// int i=0;
|
||||||
String goodsName = "";
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
||||||
String finWord = "";
|
// String num = "";
|
||||||
String unitName = "";
|
// String goodsName = "";
|
||||||
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
// String finWord = "";
|
||||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
// String unitName = "";
|
||||||
if (null != lpkGoods) {
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
||||||
goodsName = lpkGoods.getName();
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
||||||
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
// if (null != lpkGoods) {
|
||||||
unitName = lpkGoods.getUnitName();
|
// goodsName = lpkGoods.getName();
|
||||||
}
|
// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
||||||
}
|
// unitName = lpkGoods.getUnitName();
|
||||||
}
|
// }
|
||||||
if (orderGood.getGoodsNumber() != 0) {
|
// }
|
||||||
num = String.valueOf((int) orderGood.getGoodsNumber());
|
// }
|
||||||
}
|
// if (orderGood.getGoodsNumber() != 0) {
|
||||||
finWord = goodsName+num + unitName ;
|
// num = String.valueOf((int) orderGood.getGoodsNumber());
|
||||||
i++;
|
// }
|
||||||
if(i>1){
|
// finWord = goodsName+num + unitName ;
|
||||||
ReserveOrderExport en=new ReserveOrderExport();
|
// i++;
|
||||||
BeanUtil.copyProperties(s,en , "id");
|
// if(i>1){
|
||||||
en.setGoodsInfo(finWord);
|
// ReserveOrderExport en=new ReserveOrderExport();
|
||||||
exportList1.add(en);
|
// BeanUtil.copyProperties(s,en , "id");
|
||||||
}else{
|
// en.setGoodsInfo(finWord);
|
||||||
s.setGoodsInfo(finWord);
|
// exportList1.add(en);
|
||||||
exportList1.add(s);
|
// }else{
|
||||||
}
|
// s.setGoodsInfo(finWord);
|
||||||
}
|
// exportList1.add(s);
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//定义导出的excel名字
|
//定义导出的excel名字
|
||||||
@@ -391,14 +567,16 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
|||||||
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
|
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
|
||||||
//设置 水平居中
|
//设置 水平居中
|
||||||
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
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实体类并响应到浏览器
|
EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器
|
||||||
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExport.class)
|
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExport.class)
|
||||||
//是否自动关闭输入流
|
//是否自动关闭输入流
|
||||||
.autoCloseStream(Boolean.TRUE)
|
.autoCloseStream(Boolean.TRUE)
|
||||||
.registerWriteHandler(new MergeStrategy(exportList1.size(),1,5)).registerWriteHandler(horizontalCellStyleStrategy)
|
// .registerWriteHandler(new MergeStrategy(exportList.size(),1,5))
|
||||||
.sheet().doWrite(exportList1);
|
.registerWriteHandler(horizontalCellStyleStrategy)
|
||||||
|
.sheet().doWrite(exportList);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
@@ -417,47 +595,62 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
|||||||
if (StringUtils.isNotBlank(query.getStore())) {
|
if (StringUtils.isNotBlank(query.getStore())) {
|
||||||
qw.like("s.name", 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.groupBy("s.name");
|
||||||
|
// qw.orderByDesc("o.reserveDate");
|
||||||
|
// qw.groupBy("s.name");
|
||||||
//得到所有要导出的数据
|
//得到所有要导出的数据
|
||||||
List<ReserveOrderExportByStore> exportList = baseMapper.exportExcelByStore(qw);
|
List<ReserveOrderExportByStore> exportList = baseMapper.exportExcelByStore(qw);
|
||||||
List<ReserveOrderExportByStore> exportList1 = new ArrayList<>();
|
List<ReserveOrderExportByStore> exportList1 = new ArrayList<>();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
if (!exportList.isEmpty()) {
|
if (!exportList.isEmpty()) {
|
||||||
exportList.forEach(s -> {
|
exportList.forEach(s -> {
|
||||||
List<String> list=baseMapper.getOrderByStore(s.getStoreSid());
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid());
|
||||||
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
s.setGoodsName(lpkGoods.getName());
|
||||||
if (!orderGoods.isEmpty()) {
|
// List<String> list=baseMapper.getOrderByStore(s.getStoreSid(),s.getReserveDate());
|
||||||
int i=0;
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
||||||
for (LpkReserveOrderGoods orderGood : orderGoods) {
|
// if (!orderGoods.isEmpty()) {
|
||||||
String num = "";
|
// int i=0;
|
||||||
String goodsName = "";
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
||||||
String finWord = "";
|
// String num = "";
|
||||||
String unitName = "";
|
// String goodsName = "";
|
||||||
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
// String finWord = "";
|
||||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
// String unitName = "";
|
||||||
if (null != lpkGoods) {
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
||||||
goodsName = lpkGoods.getName();
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
||||||
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
// if (null != lpkGoods) {
|
||||||
unitName = lpkGoods.getUnitName();
|
// goodsName = lpkGoods.getName();
|
||||||
}
|
// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
||||||
}
|
// unitName = lpkGoods.getUnitName();
|
||||||
}
|
// }
|
||||||
if (orderGood.getGoodsNumber() != 0) {
|
// }
|
||||||
num = String.valueOf((int) orderGood.getGoodsNumber());
|
// }
|
||||||
}
|
// if (orderGood.getGoodsNumber() != 0) {
|
||||||
finWord = goodsName+ num + unitName;
|
// num = String.valueOf((int) orderGood.getGoodsNumber());
|
||||||
i++;
|
// }
|
||||||
if(i>1){
|
// finWord = goodsName+ num + unitName;
|
||||||
ReserveOrderExportByStore en=new ReserveOrderExportByStore();
|
// i++;
|
||||||
BeanUtil.copyProperties(s,en , "id");
|
// if(i>1){
|
||||||
en.setGoodsInfo(finWord);
|
// ReserveOrderExportByStore en=new ReserveOrderExportByStore();
|
||||||
exportList1.add(en);
|
// BeanUtil.copyProperties(s,en , "id");
|
||||||
}else{
|
// en.setGoodsInfo(finWord);
|
||||||
s.setGoodsInfo(finWord);
|
// exportList1.add(en);
|
||||||
exportList1.add(s);
|
// }else{
|
||||||
}
|
// s.setGoodsInfo(finWord);
|
||||||
}
|
// exportList1.add(s);
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//定义导出的excel名字
|
//定义导出的excel名字
|
||||||
@@ -477,14 +670,16 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
|||||||
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
|
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
|
||||||
//设置 水平居中
|
//设置 水平居中
|
||||||
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
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实体类并响应到浏览器
|
EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器
|
||||||
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByStore.class)
|
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByStore.class)
|
||||||
//是否自动关闭输入流
|
//是否自动关闭输入流
|
||||||
.autoCloseStream(Boolean.TRUE)
|
.autoCloseStream(Boolean.TRUE)
|
||||||
.registerWriteHandler(new MergeStrategy(exportList1.size(),1,1)).registerWriteHandler(horizontalCellStyleStrategy)
|
// .registerWriteHandler(new MergeStrategy(exportList.size(),1,1))
|
||||||
.sheet().doWrite(exportList1);
|
.registerWriteHandler(horizontalCellStyleStrategy)
|
||||||
|
.sheet().doWrite(exportList);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
@@ -504,53 +699,57 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
|||||||
qw.like("s.name", query.getStore());
|
qw.like("s.name", query.getStore());
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(query.getBankSid())) {
|
if (StringUtils.isNotBlank(query.getBankSid())) {
|
||||||
qw.like("s.bankSid", query.getBankSid());
|
qw.eq("s.bankSid", query.getBankSid());
|
||||||
}
|
}
|
||||||
qw.orderByDesc("o.createTime");
|
qw.orderByDesc("o.reserveDate");
|
||||||
qw.groupBy("s.name");
|
qw.groupBy("t.goodsSid");
|
||||||
|
qw.groupBy("o.reserveDate");
|
||||||
|
// qw.groupBy("s.name");
|
||||||
//得到所有要导出的数据
|
//得到所有要导出的数据
|
||||||
List<ReserveOrderExportByStore> exportList = baseMapper.exportExcelByStore(qw);
|
List<ReserveOrderExportByBank> exportList = baseMapper.exportExcelByBank(qw);
|
||||||
List<ReserveOrderExportByStore> exportList1 = new ArrayList<>();
|
List<ReserveOrderExportByBank> exportList1 = new ArrayList<>();
|
||||||
if (!exportList.isEmpty()) {
|
if (!exportList.isEmpty()) {
|
||||||
exportList.forEach(s -> {
|
exportList.forEach(s -> {
|
||||||
List<String> list=baseMapper.getOrderByStore(s.getStoreSid());
|
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(s.getGoodsSid());
|
||||||
List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
s.setGoodsName(lpkGoods.getName());
|
||||||
if (!orderGoods.isEmpty()) {
|
// List<String> list=baseMapper.getOrderByStore(s.getStoreSid(),s.getReserveDate());
|
||||||
int i=0;
|
// List<LpkReserveOrderGoods> orderGoods = lpkReserveOrderGoodsService.selInOrderSid(list);
|
||||||
for (LpkReserveOrderGoods orderGood : orderGoods) {
|
// if (!orderGoods.isEmpty()) {
|
||||||
String num = "";
|
// int i=0;
|
||||||
String goodsName = "";
|
// for (LpkReserveOrderGoods orderGood : orderGoods) {
|
||||||
String finWord = "";
|
// String num = "";
|
||||||
String unitName = "";
|
// String goodsName = "";
|
||||||
if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
// String finWord = "";
|
||||||
LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
// String unitName = "";
|
||||||
if (null != lpkGoods) {
|
// if (StringUtils.isNotBlank(orderGood.getGoodsSid())) {
|
||||||
goodsName = lpkGoods.getName();
|
// LpkGoods lpkGoods = lpkGoodsService.fetchBySid(orderGood.getGoodsSid());
|
||||||
if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
// if (null != lpkGoods) {
|
||||||
unitName = lpkGoods.getUnitName();
|
// goodsName = lpkGoods.getName();
|
||||||
}
|
// if (StringUtils.isNotBlank(lpkGoods.getUnitName())) {
|
||||||
}
|
// unitName = lpkGoods.getUnitName();
|
||||||
}
|
// }
|
||||||
if (orderGood.getGoodsNumber() != 0) {
|
// }
|
||||||
num = String.valueOf((int) orderGood.getGoodsNumber());
|
// }
|
||||||
}
|
// if (orderGood.getGoodsNumber() != 0) {
|
||||||
finWord = goodsName+ num + unitName;
|
// num = String.valueOf((int) orderGood.getGoodsNumber());
|
||||||
i++;
|
// }
|
||||||
if(i>1){
|
// finWord = goodsName+ num + unitName;
|
||||||
ReserveOrderExportByStore en=new ReserveOrderExportByStore();
|
// i++;
|
||||||
BeanUtil.copyProperties(s,en , "id");
|
// if(i>1){
|
||||||
en.setGoodsInfo(finWord);
|
// ReserveOrderExportByBank en=new ReserveOrderExportByBank();
|
||||||
exportList1.add(en);
|
// BeanUtil.copyProperties(s,en , "id");
|
||||||
}else{
|
// en.setGoodsInfo(finWord);
|
||||||
s.setGoodsInfo(finWord);
|
// exportList1.add(en);
|
||||||
exportList1.add(s);
|
// }else{
|
||||||
}
|
// s.setGoodsInfo(finWord);
|
||||||
}
|
// exportList1.add(s);
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//定义导出的excel名字
|
//定义导出的excel名字
|
||||||
String excelName = "配货信息.xlsx";
|
String excelName = "支行汇总信息.xlsx";
|
||||||
String fileNameURL = "1";
|
String fileNameURL = "1";
|
||||||
response.setContentType( "application/vnd.ms-excel");
|
response.setContentType( "application/vnd.ms-excel");
|
||||||
response.setCharacterEncoding("utf8");
|
response.setCharacterEncoding("utf8");
|
||||||
@@ -558,27 +757,119 @@ public class LpkReserveOrderService extends MybatisBaseService<LpkReserveOrderMa
|
|||||||
ServletOutputStream outputStream = null;
|
ServletOutputStream outputStream = null;
|
||||||
try {
|
try {
|
||||||
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
|
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
|
||||||
|
|
||||||
//设置头居中
|
//设置头居中
|
||||||
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||||
|
|
||||||
//内容策略
|
//内容策略
|
||||||
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
|
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
|
||||||
//设置 水平居中
|
//设置 水平居中
|
||||||
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
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实体类并响应到浏览器
|
EasyExcel//将数据映射到DownloadDTO实体类并响应到浏览器
|
||||||
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByStore.class)
|
.write(new BufferedOutputStream(response.getOutputStream()), ReserveOrderExportByBank.class)
|
||||||
//是否自动关闭输入流
|
//是否自动关闭输入流
|
||||||
.autoCloseStream(Boolean.TRUE)
|
.autoCloseStream(Boolean.TRUE)
|
||||||
.registerWriteHandler(new MergeStrategy(exportList1.size(),1,1)).registerWriteHandler(horizontalCellStyleStrategy)
|
// .registerWriteHandler(new MergeStrategy(exportList.size(),1,5))
|
||||||
.sheet().doWrite(exportList1);
|
.registerWriteHandler(horizontalCellStyleStrategy)
|
||||||
|
.sheet().doWrite(exportList);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(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) {
|
public ResultBean<LpkReserveOrderVo> getStoreByCustomerSid(String sid) {
|
||||||
return new ResultBean().success().setData(baseMapper.getStoreByCustomerSid(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) {
|
public ResultBean<List<LpkReserveOrderCardVo>> selOrderByCardSid(String sid) {
|
||||||
return new ResultBean().success().setData(baseMapper.selOrderByCardSid(sid));
|
return new ResultBean().success().setData(baseMapper.selOrderByCardSid(sid));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
89
src/main/java/com/yxt/yyth/utils/StyleUtils.java
Normal file
89
src/main/java/com/yxt/yyth/utils/StyleUtils.java
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
package com.yxt.yyth.utils;
|
||||||
|
|
||||||
|
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
|
||||||
|
import com.alibaba.excel.write.metadata.style.WriteFont;
|
||||||
|
import org.apache.poi.ss.usermodel.BorderStyle;
|
||||||
|
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||||
|
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wangpengfei
|
||||||
|
* @date 2023/12/16 22:14
|
||||||
|
*/
|
||||||
|
public class StyleUtils { /**
|
||||||
|
* 标题样式
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static WriteCellStyle getHeadStyle(){
|
||||||
|
// 头的策略
|
||||||
|
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
|
||||||
|
// 背景颜色
|
||||||
|
// headWriteCellStyle.setFillForegroundColor(IndexedColors.LIGHT_TURQUOISE1.getIndex());
|
||||||
|
// headWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
|
||||||
|
|
||||||
|
// 字体
|
||||||
|
WriteFont headWriteFont = new WriteFont();
|
||||||
|
headWriteFont.setFontName("宋体");//设置字体名字
|
||||||
|
headWriteFont.setFontHeightInPoints((short)14);//设置字体大小
|
||||||
|
headWriteFont.setBold(true);//字体加粗
|
||||||
|
headWriteCellStyle.setWriteFont(headWriteFont); //在样式用应用设置的字体;
|
||||||
|
|
||||||
|
// 样式
|
||||||
|
headWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置底边框;
|
||||||
|
headWriteCellStyle.setBottomBorderColor((short) 0);//设置底边框颜色;
|
||||||
|
headWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边框;
|
||||||
|
headWriteCellStyle.setLeftBorderColor((short) 0);//设置左边框颜色;
|
||||||
|
headWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置右边框;
|
||||||
|
headWriteCellStyle.setRightBorderColor((short) 0);//设置右边框颜色;
|
||||||
|
headWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边框;
|
||||||
|
headWriteCellStyle.setTopBorderColor((short) 0); //设置顶边框颜色;
|
||||||
|
|
||||||
|
headWriteCellStyle.setWrapped(true); //设置自动换行;
|
||||||
|
|
||||||
|
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);//设置水平对齐的样式为居中对齐;
|
||||||
|
headWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); //设置垂直对齐的样式为居中对齐;
|
||||||
|
headWriteCellStyle.setShrinkToFit(true);//设置文本收缩至合适
|
||||||
|
|
||||||
|
return headWriteCellStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容样式
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static WriteCellStyle getContentStyle(){
|
||||||
|
// 内容的策略
|
||||||
|
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
|
||||||
|
|
||||||
|
// 背景绿色
|
||||||
|
// 这里需要指定 FillPatternType 为FillPatternType.SOLID_FOREGROUND 不然无法显示背景颜色.头默认了 FillPatternType所以可以不指定
|
||||||
|
// contentWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
|
||||||
|
// contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
|
||||||
|
|
||||||
|
// 设置字体
|
||||||
|
WriteFont contentWriteFont = new WriteFont();
|
||||||
|
contentWriteFont.setFontHeightInPoints((short) 12);//设置字体大小
|
||||||
|
contentWriteFont.setFontName("宋体"); //设置字体名字
|
||||||
|
contentWriteCellStyle.setWriteFont(contentWriteFont);//在样式用应用设置的字体;
|
||||||
|
|
||||||
|
//设置样式;
|
||||||
|
contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置底边框;
|
||||||
|
contentWriteCellStyle.setBottomBorderColor((short) 0);//设置底边框颜色;
|
||||||
|
contentWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边框;
|
||||||
|
contentWriteCellStyle.setLeftBorderColor((short) 0);//设置左边框颜色;
|
||||||
|
contentWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置右边框;
|
||||||
|
contentWriteCellStyle.setRightBorderColor((short) 0);//设置右边框颜色;
|
||||||
|
contentWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边框;
|
||||||
|
contentWriteCellStyle.setTopBorderColor((short) 0); ///设置顶边框颜色;
|
||||||
|
|
||||||
|
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);// 水平居中
|
||||||
|
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);// 垂直居中
|
||||||
|
contentWriteCellStyle.setWrapped(true); //设置自动换行;
|
||||||
|
|
||||||
|
// contentWriteCellStyle.setShrinkToFit(true);//设置文本收缩至合适
|
||||||
|
|
||||||
|
return contentWriteCellStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user