parent
3453471a92
commit
7c0bed1913
File diff suppressed because one or more lines are too long
@ -0,0 +1,77 @@ |
||||
package com.web.controller.notify; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hai.entity.HighGroupCode; |
||||
import com.hai.entity.HighGroupOrder; |
||||
import com.hai.entity.HighOrder; |
||||
import com.hai.group.GroupCodeService; |
||||
import com.hai.service.HighOrderService; |
||||
import com.hai.service.impl.OutRechargeOrderServiceImpl; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
import java.util.Date; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
@Controller |
||||
@RequestMapping(value = "/groupOrder") |
||||
@Api(value = "团购订单") |
||||
public class GroupOrderController { |
||||
private static final Logger log = LoggerFactory.getLogger(GroupOrderController.class); |
||||
|
||||
|
||||
@Resource |
||||
private GroupCodeService groupCodeService; |
||||
|
||||
@Resource |
||||
private HighOrderService highOrderService; |
||||
|
||||
|
||||
@RequestMapping(value = "/gorOrderNotify", method = RequestMethod.GET) |
||||
@ApiOperation(value = "团购订单回调") |
||||
@ResponseBody |
||||
public void gorOrderNotify(@RequestParam(name = "groupCode", required = false) String groupCode) { |
||||
try { |
||||
|
||||
|
||||
|
||||
log.info("============回调任务Start============="); |
||||
log.info("团购订单-回调参数: " + groupCode); |
||||
|
||||
Map<String , Object> map = new HashMap<>(); |
||||
map.put("groupCode" , groupCode); |
||||
|
||||
HighGroupCode highGroupCode = groupCodeService.findGroupCode(map); |
||||
|
||||
HighOrder highOrder = highOrderService.getOrderById(highGroupCode.getId()); |
||||
|
||||
HighGroupOrder highGroupOrder = groupCodeService.findGroupOrder(highOrder.getOrderNo()); |
||||
|
||||
highGroupCode.setStatus(2); |
||||
highGroupCode.setUpdateTime(new Date()); |
||||
groupCodeService.updateGroupCode(highGroupCode); |
||||
|
||||
|
||||
highGroupOrder.setStatus(3); |
||||
highGroupOrder.setUpdateTime(new Date()); |
||||
groupCodeService.updateGroupOrder(highGroupOrder); |
||||
|
||||
highOrder.setOrderStatus(3); |
||||
highOrder.getHighChildOrderList().get(0).setChildOrderStatus(3); |
||||
highOrderService.updateOrder(highOrder); |
||||
|
||||
log.info("============回调任务End============="); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("WechatPayController --> wechatNotify() error!", e); |
||||
} |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue