| | |
| | | import com.dy.common.webUtil.BaseResponse; |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.ResultCodeMsg; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeVcRefund; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeVcRefundItem; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeVirtualCard; |
| | | import com.dy.pipIrrGlobal.pojoSe.SeWebchatLogonState; |
| | | import com.dy.pipIrrGlobal.pojoSe.*; |
| | | import com.dy.pipIrrGlobal.voSe.VoClient; |
| | | import com.dy.pipIrrSell.client.ClientSv; |
| | | import com.dy.pipIrrSell.result.SellResultCode; |
| | |
| | | String openid = job.getString("openid"); |
| | | String sessionKey = job.getString("session_key"); |
| | | |
| | | // 检验登录态 |
| | | //JSONObject checkSessionKey = payHelper.checkSessionKey(appid, secret, openid, sessionKey); |
| | | //if(checkSessionKey != null) { |
| | | // Integer errcode = checkSessionKey.getInteger("errcode"); |
| | | // String errmsg = checkSessionKey.getString("errmsg"); |
| | | //} |
| | | |
| | | // 重置登录态 |
| | | //JSONObject resetUserSessionKey = payHelper.resetUserSessionKey(appid, secret, openid, sessionKey); |
| | | //if(resetUserSessionKey != null) { |
| | | // Integer errcode = checkSessionKey.getInteger("errcode"); |
| | | // String errmsg = checkSessionKey.getString("errmsg"); |
| | | // String openid_New = checkSessionKey.getString("openid"); |
| | | // String sessionKey_New = checkSessionKey.getString("session_key"); |
| | | //} |
| | | |
| | | // 添加登录态记录 |
| | | SeWebchatLogonState po = new SeWebchatLogonState(); |
| | | po.setOpenId(openid); |
| | |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | // 接收参数:登录态ID、农户ID、虚拟卡ID、充值金额 |
| | | String sessionId = order.getSessionId(); |
| | | Long sessionId = order.getSessionId(); |
| | | Long virtualId = order.getVirtualId(); |
| | | Integer rechargeAmount = order.getRechargeAmount(); |
| | | |
| | | String prepayId = ""; |
| | | SeWebchatLogonState po = paymentSv.selectOne(Long.parseLong(sessionId)); |
| | | //SeWebchatLogonState po = paymentSv.selectOne(Long.parseLong(sessionId)); |
| | | //String openid = po.getOpenId(); |
| | | |
| | | SeOpenId po = paymentSv.selectOne(sessionId); |
| | | String openid = po.getOpenId(); |
| | | |
| | | SeVirtualCard seVirtualCard = virtualCardSv.selectVirtuCardById(virtualId); |
| | |
| | | headers.put("Content-Type", "application/json"); |
| | | |
| | | // 暂时注释掉,认证通过后再放开 |
| | | //JSONObject job_result = restTemplateUtil.post(PayInfo.orderUrl, body, headers); |
| | | //if(job_result != null) { |
| | | // System.out.println(job_result.toString()); |
| | | // prepayId = job_result.getString("prepay_id"); |
| | | //} |
| | | JSONObject job_result = restTemplateUtil.post(PayInfo.orderUrl, body, headers); |
| | | if(job_result != null) { |
| | | System.out.println(job_result.toString()); |
| | | prepayId = job_result.getString("prepay_id"); |
| | | } |
| | | |
| | | return BaseResponseUtils.buildSuccess(prepayId) ; |
| | | } |