'完成订单'

dev-discount
= 4 years ago
parent 08420c07b8
commit 5f9a305eb9
  1. 75
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  2. 218
      hai-bweb/src/main/java/com/bweb/model/ExportHighOrderModel.java
  3. 42
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  4. 179
      hai-service/src/main/java/com/hai/model/HighOrderModel.java
  5. 7
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  6. 15
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.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<String,Object> 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<String,Object> 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<HighOrderModel> 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);
}
}
}

@ -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;
}
}

@ -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<HighOrderData> selectOrderDataList(@Param("map") Map<String,Object> map);
@Select({"<script>" +
" SELECT" +
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' end goodsType, " +
" a.goods_name goodsName, " +
" case a.giveaway_type when 1 then '赠送' when 0 then '购买' end giveawayType, " +
" b.order_no orderNo," +
" b.mem_name memName," +
" b.mem_phone memPhone," +
" case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " +
" case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' end payType, " +
" b.pay_serial_no paySerialNo," +
" b.total_price totalPrice," +
" b.mem_discount_name memDiscountName," +
" b.deduction_price deductionPrice," +
" case when b.pay_gold is null then 0 else pay_gold end payGold," +
" b.pay_price payPrice," +
" b.pay_real_price payRealPrice, " +
" case b.order_status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已退款' when 5 then '已取消' end orderStatus, " +
" b.create_time createTime," +
" b.pay_time payTime," +
" b.cancel_time cancelTime" +
" FROM" +
" high_child_order a," +
" high_order b" +
" WHERE" +
" a.order_id = b.id" +
" and a.goods_type = 1" +
" and a.giveaway_type = 0" +
"<if test='map.companyId != null'> and EXISTS (select 1 from high_coupon c where c.company_id = #{map.companyId} and c.id = a.goods_id)</if>",
"<if test='map.orderNo != null'> and b.order_no = #{map.orderNo}</if>",
"<if test='map.paySerialNo != null'> and b.pay_serial_no = #{map.paySerialNo} </if>",
"<if test='map.payModel != null'> and b.pay_model = #{map.payModel} </if>",
"<if test='map.payType != null'> and b.pay_type = #{map.payType} </if>",
"<if test='map.orderStatus != null'> and b.order_status in (#{map.orderStatus}) </if>",
"<if test='map.payTimeS != null'> <![CDATA[ and b.pay_time >= #{map.payTimeS} ]]> </if>",
"<if test='map.payTimeE != null'> <![CDATA[ and b.pay_time <= #{map.payTimeE} ]]> </if>",
" GROUP BY a.id" +
" ORDER BY b.create_time desc" +
"</script>"})
List<HighOrderModel> selectGoodsOrderList(@Param("map") Map<String,Object> map);
}

@ -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;
}
}

@ -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<HighOrder> getOrderList(Map<String,Object> map);
/**
* 查询订单列表
* @param map
* @return
*/
List<HighOrderModel> getGoodsOrderModelList(Map<String,Object> map) throws Exception;
/**
* @Author 胡锐
* @Description 查询需要关闭的订单列表

@ -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<HighOrderModel> getGoodsOrderModelList(Map<String, Object> 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<HighOrder> getCloseOrder() {
return highOrderMapperExt.getCloseOrder();

Loading…
Cancel
Save