'提交代码'

dev-discount
= 3 years ago
parent 51accb2d04
commit 24a98e81c3
  1. 100
      hai-bweb/src/main/java/com/bweb/controller/HighOrderController.java
  2. 5
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java
  3. 99
      hai-service/src/main/java/com/hai/dao/HighOrderMapperExt.java
  4. 23
      hai-service/src/main/java/com/hai/service/HighOrderService.java
  5. 26
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  6. 6
      hai-service/src/main/java/com/hai/service/impl/HighQzOrderServiceImpl.java

@ -293,5 +293,105 @@ public class HighOrderController {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getKfcOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询KFC订单列表")
public ResponseData getKfcOrderList(@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "merchantId", required = false) Long merchantId,
@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,
HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String,Object> map = new HashMap<>();
// 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商
if(userInfoModel.getSecUser().getObjectType() == 0) {
map.put("companyId", companyId);
} else if (userInfoModel.getSecUser().getObjectType() == 1) {
map.put("companyId", userInfoModel.getBsCompany().getId());
map.put("merchantId", merchantId);
} else if (userInfoModel.getSecUser().getObjectType() == 2) {
map.put("merchantId", userInfoModel.getMerchant().getId());
}
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.getGasOrderModelList(map)));
} catch (Exception e) {
log.error("HighOrderController --> getGasOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getCinemaOrderList", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询电影订单列表")
public ResponseData getCinemaOrderList(@RequestParam(name = "companyId", required = false) Long companyId,
@RequestParam(name = "merchantId", required = false) Long merchantId,
@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,
HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String,Object> map = new HashMap<>();
// 用户来源 0:超级管理员 1:公司 2:商户 3:门店 4. 代理商
if(userInfoModel.getSecUser().getObjectType() == 0) {
map.put("companyId", companyId);
} else if (userInfoModel.getSecUser().getObjectType() == 1) {
map.put("companyId", userInfoModel.getBsCompany().getId());
map.put("merchantId", merchantId);
} else if (userInfoModel.getSecUser().getObjectType() == 2) {
map.put("merchantId", userInfoModel.getMerchant().getId());
}
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.getGasOrderModelList(map)));
} catch (Exception e) {
log.error("HighOrderController --> getGasOrderList() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -252,8 +252,7 @@ public class OrderController {
// 组装千猪订单
HighOrder qzOrder = highQzOrderService.assemblyQzOrder(orderNo, source);
return ResponseMsgUtil.success(qzOrder);
/* if (qzOrder != null) {
if (qzOrder != null) {
Map<String,Object> map = new HashMap<>();
map.put("orderNo", qzOrder.getOrderNo());
map.put("payPrice", qzOrder.getPayPrice());
@ -291,7 +290,7 @@ public class OrderController {
SortedMap<Object, Object> sortedMap = wechatPayUtil.goWechatPay(weChatPayReqInfo,payMap);
return ResponseMsgUtil.success(sortedMap);
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单号");*/
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的订单号");
} catch (Exception e) {
log.error("orderToPay error!", e);
return ResponseMsgUtil.exception(e);

@ -191,6 +191,105 @@ public interface HighOrderMapperExt {
"</script>"})
List<HighOrderModel> selectGasOrderList(@Param("map") Map<String,Object> map);
@Select({"<script>" +
" SELECT" +
" (select st.store_name from high_merchant_store st where st.id = a.goods_id) merchantName," +
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' when 3 then '加油缴费' end goodsType," +
" b.id orderId, " +
" 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 '金币' 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.goods_type = 4" +
" and a.giveaway_type = 0" +
" and EXISTS (select 1 from high_merchant_store c where c.id = a.goods_id " +
" <if test='map.companyId != null'> and c.company_id = #{map.companyId} </if> " +
" <if test='map.merchantId != null'> and c.merchant_id = #{map.merchantId} </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> selectKfcOrderList(@Param("map") Map<String,Object> map);
@Select({"<script>" +
" SELECT" +
" (select st.store_name from high_merchant_store st where st.id = a.goods_id) merchantName," +
" case a.goods_type when 1 then '卡券' when 2 then '金币充值' when 3 then '加油缴费' end goodsType," +
" b.id orderId, " +
" 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 '金币' 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.goods_type = 5" +
" and a.giveaway_type = 0" +
" and EXISTS (select 1 from high_merchant_store c where c.id = a.goods_id " +
" <if test='map.companyId != null'> and c.company_id = #{map.companyId} </if> " +
" <if test='map.merchantId != null'> and c.merchant_id = #{map.merchantId} </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> selectCinemaOrderList(@Param("map") Map<String,Object> map);
@Select({"select a.id orderId,b.id childOrderId from high_order a,high_child_order b where a.id = b.order_id and b.goods_type = 3 and a.order_status = 2 and TIMESTAMPDIFF(MINUTE,a.pay_time,SYSDATE()) > 60*24 GROUP BY b.id"})
List<Map<String,Object>> selectFinishGasOrder();

@ -118,7 +118,30 @@ public interface HighOrderService {
*/
List<HighOrderModel> getGoodsOrderModelList(Map<String,Object> map) throws Exception;
/**
* 查询加油订单
* @param map
* @return
* @throws Exception
*/
List<HighOrderModel> getGasOrderModelList(Map<String,Object> map) throws Exception;
/**
* 查询肯德基订单
* @param map
* @return
* @throws Exception
*/
List<HighOrderModel> getKfcOrderModelList(Map<String,Object> map) throws Exception;
/**
* 查询电影订单
* @param map
* @return
* @throws Exception
*/
List<HighOrderModel> getCinemaOrderList(Map<String,Object> map) throws Exception;
/**
* @Author 胡锐
* @Description 查询需要关闭的订单列表

@ -383,6 +383,32 @@ public class HighOrderServiceImpl implements HighOrderService {
return highOrderMapper.selectGasOrderList(map);
}
@Override
public List<HighOrderModel> getKfcOrderModelList(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.selectKfcOrderList(map);
}
@Override
public List<HighOrderModel> getCinemaOrderList(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.selectCinemaOrderList(map);
}
@Override
public List<HighOrder> getCloseOrder() {
return highOrderMapperExt.getCloseOrder();

@ -41,10 +41,9 @@ public class HighQzOrderServiceImpl implements HighQzOrderService {
if (orderDetail != null && orderDetail.getBoolean("success") == true) {
JSONObject data = orderDetail.getJSONObject("data");
HighOrder order = highOrderService.getOrderByOrderNo(orderNo);
if (order != null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单已存在");
return order;
}
HighUser highUser = highUserService.findByUnionId(data.getString("platformUniqueId"));
if (highUser == null) {
@ -59,7 +58,8 @@ public class HighQzOrderServiceImpl implements HighQzOrderService {
highOrder.setPayType(2);
highOrder.setPayPrice(data.getBigDecimal("totalPrice"));
highOrder.setTotalPrice(data.getBigDecimal("totalPrice"));
highOrder.setDeductionPrice(new BigDecimal("0"));
highOrder.setDeductionPrice(new BigDecimal(
"0"));
highOrder.setOrderStatus(1);
highOrder.setCreateTime(data.getDate("createTime"));
highOrder.setRemarks(data.getString("userRemark"));

Loading…
Cancel
Save