From 5f9a305eb925f11c675d48d982c695ebbc8c925d Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 11 May 2021 22:04:45 +0800 Subject: [PATCH] =?UTF-8?q?'=E5=AE=8C=E6=88=90=E8=AE=A2=E5=8D=95'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bweb/controller/HighOrderController.java | 75 ++++++ .../com/bweb/model/ExportHighOrderModel.java | 218 ++++++++++++++++++ .../java/com/hai/dao/HighOrderMapperExt.java | 42 ++++ .../java/com/hai/model/HighOrderModel.java | 179 ++++++++++++++ .../com/hai/service/HighOrderService.java | 7 + .../service/impl/HighOrderServiceImpl.java | 15 ++ 6 files changed, 536 insertions(+) create mode 100644 hai-bweb/src/main/java/com/bweb/model/ExportHighOrderModel.java create mode 100644 hai-service/src/main/java/com/hai/model/HighOrderModel.java diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java index 59f2a61d..3ce71385 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java @@ -1,5 +1,8 @@ package com.bweb.controller; +import com.alibaba.excel.EasyExcel; +import com.bweb.config.SysConst; +import com.bweb.model.ExportHighOrderModel; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.hai.common.exception.ErrorCode; @@ -8,6 +11,7 @@ import com.hai.common.exception.SysCode; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; import com.hai.common.utils.ResponseMsgUtil; +import com.hai.model.HighOrderModel; import com.hai.model.HighUserModel; import com.hai.model.ResponseData; import com.hai.model.UserInfoModel; @@ -25,6 +29,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -136,4 +141,74 @@ public class HighOrderController { return ResponseMsgUtil.exception(e); } } + + + @RequestMapping(value = "/getGoodsOrderList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商品订单列表") + public ResponseData getGoodsOrderList(@RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "paySerialNo", required = false) String paySerialNo, + @RequestParam(name = "payModel", required = false) Integer payModel, + @RequestParam(name = "payType", required = false) Integer payType, + @RequestParam(name = "orderStatus", required = false) Integer orderStatus, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map map = new HashMap<>(); + map.put("companyId", companyId); + map.put("orderNo", orderNo); + map.put("paySerialNo", paySerialNo); + map.put("payModel", payModel); + map.put("payType", payType); + map.put("orderStatus", orderStatus); + map.put("payTimeS", payTimeS); + map.put("payTimeE", payTimeE); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getGoodsOrderModelList(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getUserOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/exportGoodsOrderList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "导出商品订单列表") + public ResponseData exportGoodsOrderList(@RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "orderNo", required = false) String orderNo, + @RequestParam(name = "paySerialNo", required = false) String paySerialNo, + @RequestParam(name = "payModel", required = false) Integer payModel, + @RequestParam(name = "payType", required = false) Integer payType, + @RequestParam(name = "orderStatus", required = false) Integer orderStatus, + @RequestParam(name = "payTimeS", required = false) Long payTimeS, + @RequestParam(name = "payTimeE", required = false) Long payTimeE, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map map = new HashMap<>(); + map.put("companyId", companyId); + map.put("orderNo", orderNo); + map.put("paySerialNo", paySerialNo); + map.put("payModel", payModel); + map.put("payType", payType); + map.put("orderStatus", orderStatus); + map.put("payTimeS", payTimeS); + map.put("payTimeE", payTimeE); + + String name = "/goodsOrder/商品订单" + System.currentTimeMillis() + ".xlsx"; + List list = highOrderService.getGoodsOrderModelList(map); + String fileName = SysConst.getSysConfig().getFileUrl() + name; + EasyExcel.write(fileName, ExportHighOrderModel.class).sheet("商品订单").doWrite(list); + return ResponseMsgUtil.success(name); + + } catch (Exception e) { + log.error("HighOrderController --> exportGoodsOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/hai-bweb/src/main/java/com/bweb/model/ExportHighOrderModel.java b/hai-bweb/src/main/java/com/bweb/model/ExportHighOrderModel.java new file mode 100644 index 00000000..7e0f6321 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/model/ExportHighOrderModel.java @@ -0,0 +1,218 @@ +package com.bweb.model; + +import com.alibaba.excel.annotation.ExcelProperty; + +import java.math.BigDecimal; +import java.util.Date; + +public class ExportHighOrderModel { + + @ExcelProperty("商品类型") + private String goodsType; + + @ExcelProperty("商品名称") + private String goodsName; + + @ExcelProperty("订单来源") + private String giveawayType; + + @ExcelProperty("商品名称") + private String orderNo; + + @ExcelProperty("用户名称") + private String memName; + + @ExcelProperty("用户手机号") + private String memPhone; + + @ExcelProperty("支付模式") + private String payModel; + + @ExcelProperty("支付方式") + private String payType; + + @ExcelProperty("支付流水") + private String paySerialNo; + + @ExcelProperty("订单总金额") + private BigDecimal totalPrice; + + @ExcelProperty("优惠券名称") + private String memDiscountName; + + @ExcelProperty("优惠券金额") + private BigDecimal deductionPrice; + + @ExcelProperty("支付金币(数量) 1:100") + private Integer payGold; + + @ExcelProperty("支付金额") + private BigDecimal payPrice; + + @ExcelProperty("实付金额") + private BigDecimal payRealPrice; + + @ExcelProperty("订单状态") + private String orderStatus; + + @ExcelProperty("生成时间") + private Date createTime; + + @ExcelProperty("支付") + private Date payTime; + + @ExcelProperty("取消时间") + private Date cancelTime; + + public String getGoodsType() { + return goodsType; + } + + public void setGoodsType(String goodsType) { + this.goodsType = goodsType; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getGiveawayType() { + return giveawayType; + } + + public void setGiveawayType(String giveawayType) { + this.giveawayType = giveawayType; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getMemName() { + return memName; + } + + public void setMemName(String memName) { + this.memName = memName; + } + + public String getMemPhone() { + return memPhone; + } + + public void setMemPhone(String memPhone) { + this.memPhone = memPhone; + } + + public String getPayModel() { + return payModel; + } + + public void setPayModel(String payModel) { + this.payModel = payModel; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public String getPaySerialNo() { + return paySerialNo; + } + + public void setPaySerialNo(String paySerialNo) { + this.paySerialNo = paySerialNo; + } + + public BigDecimal getTotalPrice() { + return totalPrice; + } + + public void setTotalPrice(BigDecimal totalPrice) { + this.totalPrice = totalPrice; + } + + public String getMemDiscountName() { + return memDiscountName; + } + + public void setMemDiscountName(String memDiscountName) { + this.memDiscountName = memDiscountName; + } + + public BigDecimal getDeductionPrice() { + return deductionPrice; + } + + public void setDeductionPrice(BigDecimal deductionPrice) { + this.deductionPrice = deductionPrice; + } + + public Integer getPayGold() { + return payGold; + } + + public void setPayGold(Integer payGold) { + this.payGold = payGold; + } + + public BigDecimal getPayPrice() { + return payPrice; + } + + public void setPayPrice(BigDecimal payPrice) { + this.payPrice = payPrice; + } + + public BigDecimal getPayRealPrice() { + return payRealPrice; + } + + public void setPayRealPrice(BigDecimal payRealPrice) { + this.payRealPrice = payRealPrice; + } + + public String getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getPayTime() { + return payTime; + } + + public void setPayTime(Date payTime) { + this.payTime = payTime; + } + + public Date getCancelTime() { + return cancelTime; + } + + public void setCancelTime(Date cancelTime) { + this.cancelTime = cancelTime; + } +} diff --git a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java index 68729d2f..d6bfd7ea 100644 --- a/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java @@ -2,6 +2,7 @@ package com.hai.dao; import com.hai.entity.HighOrder; import com.hai.model.HighOrderData; +import com.hai.model.HighOrderModel; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Results; @@ -91,4 +92,45 @@ public interface HighOrderMapperExt { }) List selectOrderDataList(@Param("map") Map map); + @Select({""}) + List selectGoodsOrderList(@Param("map") Map map); + } diff --git a/hai-service/src/main/java/com/hai/model/HighOrderModel.java b/hai-service/src/main/java/com/hai/model/HighOrderModel.java new file mode 100644 index 00000000..94df268b --- /dev/null +++ b/hai-service/src/main/java/com/hai/model/HighOrderModel.java @@ -0,0 +1,179 @@ +package com.hai.model; + +import java.math.BigDecimal; +import java.util.Date; + +public class HighOrderModel { + + private String goodsType; + private String goodsName; + private String giveawayType; + private String orderNo; + private String memName; + private String memPhone; + private String payModel; + private String payType; + private String paySerialNo; + private BigDecimal totalPrice; + private String memDiscountName; + private BigDecimal deductionPrice; + private Integer payGold; + private BigDecimal payPrice; + private BigDecimal payRealPrice; + private String orderStatus; + private Date createTime; + private Date payTime; + private Date cancelTime; + + public String getGoodsType() { + return goodsType; + } + + public void setGoodsType(String goodsType) { + this.goodsType = goodsType; + } + + public String getGoodsName() { + return goodsName; + } + + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + public String getGiveawayType() { + return giveawayType; + } + + public void setGiveawayType(String giveawayType) { + this.giveawayType = giveawayType; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getMemName() { + return memName; + } + + public void setMemName(String memName) { + this.memName = memName; + } + + public String getMemPhone() { + return memPhone; + } + + public void setMemPhone(String memPhone) { + this.memPhone = memPhone; + } + + public String getPayModel() { + return payModel; + } + + public void setPayModel(String payModel) { + this.payModel = payModel; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public String getPaySerialNo() { + return paySerialNo; + } + + public void setPaySerialNo(String paySerialNo) { + this.paySerialNo = paySerialNo; + } + + public BigDecimal getTotalPrice() { + return totalPrice; + } + + public void setTotalPrice(BigDecimal totalPrice) { + this.totalPrice = totalPrice; + } + + public String getMemDiscountName() { + return memDiscountName; + } + + public void setMemDiscountName(String memDiscountName) { + this.memDiscountName = memDiscountName; + } + + public BigDecimal getDeductionPrice() { + return deductionPrice; + } + + public void setDeductionPrice(BigDecimal deductionPrice) { + this.deductionPrice = deductionPrice; + } + + public Integer getPayGold() { + return payGold; + } + + public void setPayGold(Integer payGold) { + this.payGold = payGold; + } + + public BigDecimal getPayPrice() { + return payPrice; + } + + public void setPayPrice(BigDecimal payPrice) { + this.payPrice = payPrice; + } + + public BigDecimal getPayRealPrice() { + return payRealPrice; + } + + public void setPayRealPrice(BigDecimal payRealPrice) { + this.payRealPrice = payRealPrice; + } + + public String getOrderStatus() { + return orderStatus; + } + + public void setOrderStatus(String orderStatus) { + this.orderStatus = orderStatus; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getPayTime() { + return payTime; + } + + public void setPayTime(Date payTime) { + this.payTime = payTime; + } + + public Date getCancelTime() { + return cancelTime; + } + + public void setCancelTime(Date cancelTime) { + this.cancelTime = cancelTime; + } +} diff --git a/hai-service/src/main/java/com/hai/service/HighOrderService.java b/hai-service/src/main/java/com/hai/service/HighOrderService.java index 9c2e870e..8f40495f 100644 --- a/hai-service/src/main/java/com/hai/service/HighOrderService.java +++ b/hai-service/src/main/java/com/hai/service/HighOrderService.java @@ -3,6 +3,7 @@ package com.hai.service; import com.hai.entity.HighChildOrder; import com.hai.entity.HighOrder; import com.hai.model.HighOrderData; +import com.hai.model.HighOrderModel; import java.util.List; import java.util.Map; @@ -98,6 +99,12 @@ public interface HighOrderService { **/ List getOrderList(Map map); + /** + * 查询订单列表 + * @param map + * @return + */ + List getGoodsOrderModelList(Map map) throws Exception; /** * @Author 胡锐 * @Description 查询需要关闭的订单列表 diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 97d6172c..eb015a55 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -11,6 +11,7 @@ import com.hai.entity.*; import com.hai.model.HighCouponHandselModel; import com.hai.model.HighCouponModel; import com.hai.model.HighOrderData; +import com.hai.model.HighOrderModel; import com.hai.service.*; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; @@ -337,6 +338,20 @@ public class HighOrderServiceImpl implements HighOrderService { return list; } + @Override + public List getGoodsOrderModelList(Map map) throws Exception { + + if(MapUtils.getLong(map, "payTimeS") != null) { + map.put("payTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeS")), "yyyy-MM-dd HH:mm:ss")); + } + + if(MapUtils.getLong(map, "payTimeE") != null) { + map.put("payTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "payTimeE")), "yyyy-MM-dd HH:mm:ss")); + } + + return highOrderMapper.selectGoodsOrderList(map); + } + @Override public List getCloseOrder() { return highOrderMapperExt.getCloseOrder();