parent
83a3e6661a
commit
f906a4dfb3
File diff suppressed because one or more lines are too long
@ -0,0 +1,114 @@ |
||||
package com.cweb.controller; |
||||
|
||||
import cn.binarywang.wx.miniapp.api.WxMaService; |
||||
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; |
||||
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; |
||||
import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.cweb.config.SysConst; |
||||
import com.cweb.config.WxMaConfiguration; |
||||
import com.hai.common.exception.ErrorCode; |
||||
import com.hai.common.exception.ErrorHelp; |
||||
import com.hai.common.exception.SysCode; |
||||
import com.hai.common.security.SessionObject; |
||||
import com.hai.common.security.UserCenter; |
||||
import com.hai.common.utils.*; |
||||
import com.hai.config.ChongQingCNPCService; |
||||
import com.hai.config.CommonSysConst; |
||||
import com.hai.dao.HighGasOrderPushMapper; |
||||
import com.hai.entity.*; |
||||
import com.hai.enum_type.OrderPushType; |
||||
import com.hai.model.HighUserModel; |
||||
import com.hai.model.ResponseData; |
||||
import com.hai.service.HighCouponCodeOtherService; |
||||
import com.hai.service.HighUserService; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.util.*; |
||||
|
||||
@Controller |
||||
@RequestMapping(value = "/notify") |
||||
@Api(value = "通知") |
||||
public class NotifyController { |
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(NotifyController.class); |
||||
|
||||
@Resource |
||||
private HighCouponCodeOtherService couponCodeOtherService; |
||||
|
||||
@Resource |
||||
private HighGasOrderPushMapper highGasOrderPushMapper; |
||||
|
||||
@RequestMapping(value = "/cqCnpcNotify", method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "重庆中石油通知") |
||||
public Object cqCnpcNotify(@RequestBody String paramsStr) { |
||||
System.out.println(paramsStr); |
||||
log.info(paramsStr); |
||||
try { |
||||
if (StringUtils.isNotBlank(paramsStr)) { |
||||
|
||||
JSONObject sendMessage = JSONObject.parseObject(paramsStr).getJSONObject("sendMessage"); |
||||
JSONObject body = ChongQingCNPCService.decryptBody(sendMessage.getString("body")); |
||||
couponCodeOtherService.cqCnpcUseNotify(body); |
||||
|
||||
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
||||
highGasOrderPush.setType(OrderPushType.type10.getType()); |
||||
highGasOrderPush.setOrderNo(body.getString("tradeId")); |
||||
highGasOrderPush.setCreateTime(new Date()); |
||||
highGasOrderPush.setRequestContent("核销回调"); |
||||
highGasOrderPush.setReturnContent(paramsStr); |
||||
highGasOrderPushMapper.insert(highGasOrderPush); |
||||
|
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("status", 1); |
||||
param.put("msg", "成功"); |
||||
String verifyCode = AESTool.Encrypt(JSONObject.toJSONString(param), CommonSysConst.getSysConfig().getChongQingCnpcMerKey()); |
||||
|
||||
Map<String, Object> returnContent = new HashMap<>(); |
||||
Map<String, Object> returnPostMessage = new HashMap<>(); |
||||
|
||||
Map<String, Object> returnHead = new HashMap<>(); |
||||
returnHead.put("verifyCode", MD5Util.encode((verifyCode + CommonSysConst.getSysConfig().getChongQingCnpcMerKey()).getBytes()).toLowerCase()); |
||||
returnHead.put("requestType", "couponNotice"); |
||||
returnPostMessage.put("head", returnHead); |
||||
|
||||
returnPostMessage.put("body", verifyCode); |
||||
returnContent.put("postMessage", returnPostMessage); |
||||
return returnContent; |
||||
} else { |
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("status", 0); |
||||
param.put("msg", "解析参数错误"); |
||||
String verifyCode = AESTool.Encrypt(JSONObject.toJSONString(param), CommonSysConst.getSysConfig().getChongQingCnpcMerKey()); |
||||
|
||||
Map<String, Object> returnContent = new HashMap<>(); |
||||
Map<String, Object> returnPostMessage = new HashMap<>(); |
||||
|
||||
Map<String, Object> returnHead = new HashMap<>(); |
||||
returnHead.put("verifyCode", MD5Util.encode((verifyCode + CommonSysConst.getSysConfig().getChongQingCnpcMerKey()).getBytes()).toLowerCase()); |
||||
returnHead.put("requestType", "couponNotice"); |
||||
returnPostMessage.put("head", returnHead); |
||||
|
||||
returnPostMessage.put("body", verifyCode); |
||||
returnContent.put("postMessage", returnPostMessage); |
||||
return returnContent; |
||||
} |
||||
|
||||
} catch (Exception e) { |
||||
return null; |
||||
// return ResponseMsgUtil.exception(e);
|
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,58 @@ |
||||
package com.hai.model; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* @className: OrderCouponModel |
||||
* @author: HuRui |
||||
* @date: 2022/9/30 |
||||
**/ |
||||
@Data |
||||
public class OrderCouponModel { |
||||
|
||||
@ExcelProperty(value = "交易订单号") |
||||
private String orderNo; |
||||
|
||||
@ExcelProperty(value = "客户电话") |
||||
private String memPhone; |
||||
|
||||
@ExcelProperty(value = "卡券名称") |
||||
private String couponName; |
||||
|
||||
@ExcelProperty(value = "总价格") |
||||
private BigDecimal totalPrice; |
||||
|
||||
@ExcelProperty(value = "优惠价格") |
||||
private BigDecimal deductionPrice; |
||||
|
||||
@ExcelProperty(value = "应付金额") |
||||
private BigDecimal payablePrice; |
||||
|
||||
@ExcelProperty(value = "积分抵扣") |
||||
private Long payGold; |
||||
|
||||
@ExcelProperty(value = "实付金额") |
||||
private BigDecimal payPrice; |
||||
|
||||
@ExcelProperty(value = "支付方式") |
||||
private String payType; |
||||
|
||||
@ExcelProperty(value = "支付卡号") |
||||
private String memCardNo; |
||||
|
||||
@ExcelProperty(value = "订单状态") |
||||
private String orderStatus; |
||||
|
||||
@ExcelProperty(value = "创建时间") |
||||
private Date createTime; |
||||
|
||||
@ExcelProperty(value = "支付时间") |
||||
private Date payTime; |
||||
|
||||
@ExcelProperty(value = "完成时间") |
||||
private Date finishTime; |
||||
} |
Loading…
Reference in new issue