提交代码

dev-discount
胡锐 3 years ago
parent e6aad7fe1b
commit f1f88724ea
  1. 86
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  2. 19
      hai-bweb/src/main/java/com/bweb/model/ExportHighOrderModel.java
  3. 2
      hai-bweb/src/main/resources/dev/application.yml
  4. 64
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  5. 1
      hai-service/src/main/java/com/hai/model/HighOrderModel.java
  6. 10
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  7. 23
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java

@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -416,6 +417,91 @@ public class HighOrderController {
} }
} }
@RequestMapping(value = "/getOrderListByIdCode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据表示查询订单")
public ResponseData getOrderListByIdCode(@RequestParam(name = "merchantId", required = false) Long merchantId,
@RequestParam(name = "identificationCode", required = false) String identificationCode,
@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 = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@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,
HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String,Object> map = new HashMap<>();
map.put("identificationCode", identificationCode);
map.put("orderNo", orderNo);
map.put("paySerialNo", paySerialNo);
map.put("payModel", payModel);
map.put("payType", payType);
map.put("orderStatus", orderStatus);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);
map.put("payTimeE", payTimeE);
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(highOrderService.getOrderListByIdCode(identificationCode, map)));
} catch (Exception e) {
log.error("HighOrderController --> getOrderListByIdCode() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/exportOrderListByIdCode", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "导出商品订单列表")
public ResponseData exportOrderListByIdCode(@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "merchantId", required = false) Long merchantId,
@RequestParam(name = "identificationCode", required = false) String identificationCode,
@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 = "createTimeS", required = false) Long createTimeS,
@RequestParam(name = "createTimeE", required = false) Long createTimeE,
@RequestParam(name = "payTimeS", required = false) Long payTimeS,
@RequestParam(name = "payTimeE", required = false) Long payTimeE,
HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String,Object> map = new HashMap<>();
map.put("orderNo", orderNo);
map.put("paySerialNo", paySerialNo);
map.put("payModel", payModel);
map.put("payType", payType);
map.put("orderStatus", orderStatus);
map.put("createTimeS", createTimeS);
map.put("createTimeE", createTimeE);
map.put("payTimeS", payTimeS);
map.put("payTimeE", payTimeE);
String name = "/goodsOrder/订单列表" + System.currentTimeMillis() + ".xlsx";
List<HighOrderModel> list = highOrderService.getOrderListByIdCode(identificationCode,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);
}
}
@RequestMapping(value = "/getMobileOrderList", method = RequestMethod.GET) @RequestMapping(value = "/getMobileOrderList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询话费充值订单列表") @ApiOperation(value = "查询话费充值订单列表")

@ -1,5 +1,6 @@
package com.bweb.model; package com.bweb.model;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -7,6 +8,10 @@ import java.util.Date;
public class ExportHighOrderModel { public class ExportHighOrderModel {
@ExcelIgnore
@ExcelProperty("订单编号")
private String orderId;
@ExcelProperty("商户名称") @ExcelProperty("商户名称")
private String merchantName; private String merchantName;
@ -19,7 +24,7 @@ public class ExportHighOrderModel {
@ExcelProperty("订单来源") @ExcelProperty("订单来源")
private String giveawayType; private String giveawayType;
@ExcelProperty("商品名称") @ExcelProperty("订单号")
private String orderNo; private String orderNo;
@ExcelProperty("用户名称") @ExcelProperty("用户名称")
@ -34,7 +39,7 @@ public class ExportHighOrderModel {
@ExcelProperty("支付方式") @ExcelProperty("支付方式")
private String payType; private String payType;
@ExcelProperty("支付流水") @ExcelProperty("第三方订单号")
private String paySerialNo; private String paySerialNo;
@ExcelProperty("订单总金额") @ExcelProperty("订单总金额")
@ -61,12 +66,20 @@ public class ExportHighOrderModel {
@ExcelProperty("生成时间") @ExcelProperty("生成时间")
private Date createTime; private Date createTime;
@ExcelProperty("支付") @ExcelProperty("支付时间")
private Date payTime; private Date payTime;
@ExcelProperty("取消时间") @ExcelProperty("取消时间")
private Date cancelTime; private Date cancelTime;
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getMerchantName() { public String getMerchantName() {
return merchantName; return merchantName;
} }

@ -9,7 +9,7 @@ debug: false
#datasource数据源设置 #datasource数据源设置
spring: spring:
datasource: datasource:
url: jdbc:mysql://122.9.135.148:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username: root username: root
password: HF123456. password: HF123456.
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource

@ -103,7 +103,7 @@ public interface HighOrderMapperExt {
" b.mem_name memName," + " b.mem_name memName," +
" b.mem_phone memPhone," + " b.mem_phone memPhone," +
" case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + " 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," + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' end payType," +
" b.pay_serial_no paySerialNo," + " b.pay_serial_no paySerialNo," +
" case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," +
" b.mem_discount_name memDiscountName," + " b.mem_discount_name memDiscountName," +
@ -158,7 +158,7 @@ public interface HighOrderMapperExt {
" b.mem_name memName," + " b.mem_name memName," +
" b.mem_phone memPhone," + " b.mem_phone memPhone," +
" case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + " 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," + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' end payType," +
" b.pay_serial_no paySerialNo," + " b.pay_serial_no paySerialNo," +
" case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," +
" b.mem_discount_name memDiscountName," + " b.mem_discount_name memDiscountName," +
@ -209,7 +209,7 @@ public interface HighOrderMapperExt {
" b.mem_name memName," + " b.mem_name memName," +
" b.mem_phone memPhone," + " b.mem_phone memPhone," +
" case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + " 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," + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' end payType," +
" b.pay_serial_no paySerialNo," + " b.pay_serial_no paySerialNo," +
" case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," +
" b.mem_discount_name memDiscountName," + " b.mem_discount_name memDiscountName," +
@ -261,7 +261,7 @@ public interface HighOrderMapperExt {
" b.mem_name memName," + " b.mem_name memName," +
" b.mem_phone memPhone," + " b.mem_phone memPhone," +
" case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + " 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," + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' end payType," +
" b.pay_serial_no paySerialNo," + " b.pay_serial_no paySerialNo," +
" case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," +
" b.mem_discount_name memDiscountName," + " b.mem_discount_name memDiscountName," +
@ -312,7 +312,7 @@ public interface HighOrderMapperExt {
" b.mem_name memName," + " b.mem_name memName," +
" b.mem_phone memPhone," + " b.mem_phone memPhone," +
" case b.pay_model when 1 then '金币' when 2 then '第三方' end payModel, " + " 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," + " case b.pay_type when 1 then '支付宝' when 2 then '微信' when 3 then '金币' when 4 then '工会卡' end payType," +
" b.pay_serial_no paySerialNo," + " b.pay_serial_no paySerialNo," +
" case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," + " case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," +
" b.mem_discount_name memDiscountName," + " b.mem_discount_name memDiscountName," +
@ -351,6 +351,56 @@ public interface HighOrderMapperExt {
"</script>"}) "</script>"})
List<HighOrderModel> getMobileOrderList(@Param("map") Map<String,Object> map); List<HighOrderModel> getMobileOrderList(@Param("map") Map<String,Object> map);
@Select({"<script>" +
" SELECT" +
" (select mer.merchant_name from high_merchant mer where EXISTS (select 1 from high_coupon cou where cou.id = a.goods_id and mer.id = cou.merchant_id)) merchantName," +
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' when 3 then '加油缴费' end goodsType, " +
" a.goods_name goodsName, " +
" a.goods_type goodsTypeId," +
" 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 '金币' when 4 then '工会卡' end payType," +
" b.pay_serial_no paySerialNo," +
" case a.giveaway_type when 0 then b.total_price when 1 then 0 end totalPrice," +
" b.mem_discount_name memDiscountName," +
" b.deduction_price deductionPrice," +
" case a.giveaway_type when 0 then case when b.pay_gold is null then 0 else pay_gold end when 1 then 0 end payGold," +
" case a.giveaway_type when 0 then b.pay_price when 1 then 0 end payPrice," +
" case a.giveaway_type when 0 then case when b.pay_gold is not null then convert(b.pay_gold / 100,decimal(10,2)) else b.pay_real_price end when 1 then 0 end payRealPrice," +
" case b.order_status when 1 then '待支付' when 2 then '已支付' when 3 then '已完成' when 4 then '已退款' when 5 then '已取消' when 6 then '退款中' when 7 then '退款失败' end orderStatus, " +
" b.order_status orderStatusId," +
" b.create_time createTime," +
" b.pay_time payTime," +
" b.cancel_time cancelTime," +
" b.refund_time refundTime," +
" b.refund_content refundContent," +
" b.refusal_refund_content refusalRefundContent" +
" FROM" +
" high_child_order a," +
" high_order b" +
" WHERE" +
" a.order_id = b.id" +
" and a.giveaway_type = 0" +
" and b.Identification_code = #{map.identificationCode}" +
" <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.memPhone != null'> and b.mem_phone = #{map.memPhone} </if> " +
" <if test='map.orderStatus != null'> and b.order_status in (#{map.orderStatus}) </if>" +
" <if test='map.createTimeS != null'> <![CDATA[ and b.create_time >= #{map.createTimeS} ]]> </if>" +
" <if test='map.createTimeE != null'> <![CDATA[ and b.create_time <= #{map.createTimeE} ]]> </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> getOrderListByIdCode(@Param("map") Map<String,Object> map);
/** /**
* 查询处于已经支付和待支付的话费订单 * 查询处于已经支付和待支付的话费订单
*/ */
@ -494,8 +544,8 @@ public interface HighOrderMapperExt {
}) })
List<HighOrder> selectAlreadyPaidCinemaOrder(); List<HighOrder> selectAlreadyPaidCinemaOrder();
@Select("select a.id,a.order_no,TRIM(BOTH '\"' FROM b.transaction_id) pay_serial_no from \n" + @Select("select a.id,a.order_no,TRIM(BOTH '\"' FROM b.transaction_id) pay_serial_no from " +
"(select id,order_no from high_order where order_status = 5 and create_time >= '2021-06-21 00:00:00') a\n" + "(select id,order_no from high_order where order_status = 5 and create_time >= '2021-06-21 00:00:00') a" +
"LEFT JOIN (select JSON_EXTRACT(body_info,'$.out_trade_no') out_trade_no,JSON_EXTRACT(body_info,'$.transaction_id') transaction_id from high_pay_record where create_time >= '2021-06-21 00:00:00' and res_type = 2 GROUP BY JSON_EXTRACT(body_info,'$.out_trade_no')) b on a.order_no = b.out_trade_no where b.out_trade_no is not null") "LEFT JOIN (select JSON_EXTRACT(body_info,'$.out_trade_no') out_trade_no,JSON_EXTRACT(body_info,'$.transaction_id') transaction_id from high_pay_record where create_time >= '2021-06-21 00:00:00' and res_type = 2 GROUP BY JSON_EXTRACT(body_info,'$.out_trade_no')) b on a.order_no = b.out_trade_no where b.out_trade_no is not null")
@Results({ @Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),

@ -4,7 +4,6 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
public class HighOrderModel { public class HighOrderModel {
private Long orderId; private Long orderId;
private String merchantName; private String merchantName;
private String goodsType; private String goodsType;

@ -168,6 +168,14 @@ public interface HighOrderService {
*/ */
List<HighOrderModel> getMobileOrderList(Map<String,Object> map) throws Exception; List<HighOrderModel> getMobileOrderList(Map<String,Object> map) throws Exception;
/**
* 根据标识码 查询订单
* @param identificationCode
* @return
* @throws Exception
*/
List<HighOrderModel> getOrderListByIdCode(String identificationCode, Map<String,Object> map) throws Exception;
/** /**
* @Author 胡锐 * @Author 胡锐
* @Description 查询需要关闭的订单列表 * @Description 查询需要关闭的订单列表
@ -177,7 +185,7 @@ public interface HighOrderService {
/** /**
* 根据优惠券代理商id 查询已消费的订单 * 根据优惠券代理商id 查询已消费的订单
* @param discountAgentId * @param discountCodeId
* @return * @return
*/ */
HighOrder getConsumeOrderByDiscountCode(Long discountCodeId); HighOrder getConsumeOrderByDiscountCode(Long discountCodeId);

@ -793,6 +793,29 @@ public class HighOrderServiceImpl implements HighOrderService {
return highOrderMapper.getMobileOrderList(map); return highOrderMapper.getMobileOrderList(map);
} }
@Override
public List<HighOrderModel> getOrderListByIdCode(String identificationCode, Map<String,Object> map) throws Exception {
map.put("identificationCode", identificationCode);
if(MapUtils.getLong(map, "createTimeS") != null) {
map.put("createTimeS", DateUtil.date2String(new Date(MapUtils.getLong(map, "createTimeS")), "yyyy-MM-dd HH:mm:ss"));
}
if(MapUtils.getLong(map, "createTimeE") != null) {
map.put("createTimeE", DateUtil.date2String(new Date(MapUtils.getLong(map, "createTimeE")), "yyyy-MM-dd HH:mm:ss"));
}
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.getOrderListByIdCode(map);
}
@Override @Override
public List<HighOrder> getCloseOrder() { public List<HighOrder> getCloseOrder() {
return highOrderMapperExt.getCloseOrder(); return highOrderMapperExt.getCloseOrder();

Loading…
Cancel
Save