old mode 100644
new mode 100755
| | |
| | | import com.java110.front.properties.WechatAuthProperties; |
| | | import com.java110.front.smo.AppAbstractComponentSMO; |
| | | import com.java110.front.smo.payment.IGoodsToPaySMO; |
| | | import com.java110.front.smo.payment.adapt.IPayAdapt; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.ServiceConstant; |
| | | import com.java110.utils.constant.WechatConstant; |
| | | import com.java110.utils.factory.ApplicationContextFactory; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | return responseEntity; |
| | | } |
| | | JSONObject orderInfo = JSONObject.parseObject(responseEntity.getBody().toString()); |
| | | if (orderInfo.getInteger("code") != ResultVo.CODE_OK) { |
| | | throw new IllegalArgumentException("下单失败:" + orderInfo.getString("msg")); |
| | | } |
| | | orderInfo = orderInfo.getJSONObject("data"); |
| | | String orderId = orderInfo.getString("orderId"); |
| | | double money = Double.parseDouble(orderInfo.getString("payPrice")); |
| | | String appType = OwnerAppUserDto.APP_TYPE_WECHAT_MINA; |
| | |
| | | appType = OwnerAppUserDto.APP_TYPE_APP; |
| | | } |
| | | Map tmpParamIn = new HashMap(); |
| | | tmpParamIn.put("userId", pd.getUserId()); |
| | | tmpParamIn.put("userId", paramIn.getString("personId")); |
| | | tmpParamIn.put("appType", appType); |
| | | responseEntity = super.getOwnerAppUser(pd, restTemplate, tmpParamIn); |
| | | logger.debug("查询用户信息返回报文:" + responseEntity); |
| | |
| | | |
| | | JSONObject realUserInfo = userResult.getJSONArray("data").getJSONObject(0); |
| | | String openId = realUserInfo.getString("openId"); |
| | | |
| | | Map result = super.java110Payment(outRestTemplate, paramIn.getString("feeName"), paramIn.getString("tradeType"), orderId, money, openId, smallWeChatDto); |
| | | String payAdapt = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.PAY_ADAPT); |
| | | payAdapt = StringUtil.isEmpty(payAdapt) ? DEFAULT_PAY_ADAPT : payAdapt; |
| | | //支付适配器 |
| | | IPayAdapt tPayAdapt = ApplicationContextFactory.getBean(payAdapt, IPayAdapt.class); |
| | | Map result = tPayAdapt.java110Payment(outRestTemplate, "商品购买", |
| | | paramIn.getString("tradeType"), orderId, money, openId, |
| | | smallWeChatDto, wechatAuthProperties.getGoodsNotifyUrl()); |
| | | responseEntity = new ResponseEntity(JSONObject.toJSONString(result), HttpStatus.OK); |
| | | |
| | | return responseEntity; |