获取openid的bug修复
This commit is contained in:
@ -71,6 +71,7 @@ public class DeviceOtherMsgConsumer {
|
||||
if(jsonObject.getStr("type")!=null){
|
||||
if(jsonObject.getStr("type").equals("waterEleData")){
|
||||
String data1 = jsonObject.getStr("data");
|
||||
//收到定时报文
|
||||
if(JSONUtil.parseObj(data1).get("action").equals("timeMsg")){
|
||||
//更新设备在线状态
|
||||
updateDeviceOnlineStatus( productId,serialNumber);
|
||||
@ -79,6 +80,9 @@ public class DeviceOtherMsgConsumer {
|
||||
if(i<1){
|
||||
System.err.println("--------------------------保存使用记录失败!---------------------------");
|
||||
}
|
||||
}else if(JSONUtil.parseObj(data1).get("action").equals("safeMsg")){
|
||||
//续费在线状态
|
||||
updateDeviceOnlineStatus( productId,serialNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
@ -47,6 +48,9 @@ import static com.fastbee.common.constant.Constants.LANGUAGE;
|
||||
import static com.fastbee.common.utils.pay.RSAUtil.verifySignature;
|
||||
import static com.fastbee.rechargecard.service.impl.UserWechatPayServiceImpl.apiV3Key;
|
||||
|
||||
/**
|
||||
* @author mijiupro
|
||||
*/
|
||||
@Api(tags = "支付模块")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@ -87,6 +91,9 @@ public class WeChatPayController extends BaseController {
|
||||
@PostMapping("/getOpenId")
|
||||
public Map<String,Object> BuildOrder(@RequestBody String code)
|
||||
{
|
||||
if(StringUtils.isBlank(code)){
|
||||
return AjaxResult.error("code不能为空!");
|
||||
}
|
||||
Map<String ,Object> result=userWechatPayService.GetOpenId(code);
|
||||
Map<String,Object> returnParams=new HashMap<>();
|
||||
if(result.get("openid")==null && result.get("errcode")!=null)
|
||||
@ -105,6 +112,10 @@ public class WeChatPayController extends BaseController {
|
||||
//return warn("验证码已失效,请重新获取");
|
||||
}
|
||||
}
|
||||
if(result.get("openid")==null){
|
||||
return error("获取openid失败");
|
||||
}
|
||||
|
||||
return success(result.get("openid").toString());
|
||||
}
|
||||
|
||||
@ -121,10 +132,10 @@ public class WeChatPayController extends BaseController {
|
||||
{
|
||||
out_trade_no=UUID.randomUUID().toString().replace("-", "");;
|
||||
}
|
||||
//System.out.println(out_trade_no);
|
||||
System.err.println("随机字符串"+out_trade_no);
|
||||
recharge.setRechargeCode(out_trade_no);
|
||||
Map<String, String> result = userWechatPayService.CreateOrder(recharge); // 生成订单
|
||||
|
||||
System.err.println("创建订单完成:" +result);
|
||||
//打印出返回前端的所有参数
|
||||
// 获取键的集合
|
||||
Set<String> keySet = result.keySet();
|
||||
|
Reference in New Issue
Block a user