fix - 简单修改篮球入场订单逻辑

This commit is contained in:
2026-03-29 10:19:12 +08:00
parent 9f3a1c02c3
commit 14a9944c72
10 changed files with 198 additions and 166 deletions

View File

@@ -1,9 +1,13 @@
package com.sv.netty.controller;
import com.enums.DeviceStatusEnum;
import com.enums.EnterEnum;
import com.sv.entity.Device;
import com.sv.netty.config.NettyConstant;
import com.sv.netty.config.VenueBarCode;
import com.sv.netty.config.VenueMessage;
import com.sv.netty.netty.service.MessageService;
import com.sv.netty.utils.JsonUtils;
import com.sv.netty.utils.MakeCode;
import com.sv.service.common.DoorLockUtil;
import com.sv.service.oms.DeviceService;
@@ -48,6 +52,29 @@ public class AdminNettyController extends BaseApiController {
return ResponseDTO.ok();
}
/**
* 检验客户端读取能力
* @return
*/
@RequestMapping("/user/check/barcode")
public ResponseDTO uploadLog(@RequestParam("code") String code) {
code = code.substring(1,code.length()-1);
logger.info("核销二维码开门了...");
String offline = MakeCode.decodeOfflineCode(code);
if (offline.startsWith("venue-")) {
// 这是线下开门的逻辑
messageService.offlineOpenDoor(code);
} else {
VenueBarCode venueBarCode = MakeCode.decodeCode(code);
if (EnterEnum.ENTER.getValue() == venueBarCode.getDirection()) {
messageService.enterVenue(code);
} else {
messageService.outVenue(code);
}
}
return ResponseDTO.ok();
}
@RequestMapping(value = "/admin/out/{id}", method = RequestMethod.POST)
public ResponseDTO out(@PathVariable("id") Integer id) {
Device device = deviceService.findById(id);

View File

@@ -2,6 +2,8 @@ package com.sv.wx;
import com.WeiXinApplication;
import com.dw.ccm.wechat.base.pay.MD5Utils;
import com.sv.service.api.OrderService;
import com.sv.service.api.config.WechatPayService;
import com.sv.service.api.util.EncryptionUtil;
import com.sv.service.api.util.XmlUtils;
import com.ydd.framework.core.common.utils.JsonUtils;
@@ -10,36 +12,22 @@ import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.Map;
@RunWith(SpringRunner.class)
@SpringBootTest(classes={WeiXinApplication.class})
public class WxRefundTest {
// @Resource
// PayConfigService payConfigService;
@Resource
private WechatPayService wechatPayService;
@Test
public void refundTest(){
String mapStr = "{\"nonce_str\":\"ee73143e484c693845aefc9679435c50\",\"req_info\":\"vElcoXDbKNN9Uu5uA2vsAXxuHTDo5ZSjoSTTf9xHSqxnG9AZTUXtj9a5emospwQBnk01VFHw1DtOIQvVVXEEuy0khE7wSz7A5ZYgAmPHUcaCSH1uZdgLuCxQ6k21GrGWpCXx+7npP5/cliGl2eiv7iZbjhaxQDYhfLQo8wO9JfWie7E8eGyX/0UnNyrlejfVSj02YJCbkQVKrDuBWI48rgLCdGFcg1zc0qsEi+s3GoTJTBxAVytHbq9w8XAkgLAlN2DhtrSIhseJINeEebgtk7XvxzZhno2tUZ2djAcj+HmudBXh9XplCLg9lrIK85yeTS8sPO8079fhXlKlzx475vDeQj+nYrSSXvRF51qBucv9/l8/e6ayKU39Ot0eJ3WYjDB7c+u4qHnGN0mYHfdIosNDN6XIHato7nQHZl264QtC1QVI6icCijZ6s51v0TTwpEZsTABVDgip9g/e+T0SOXTlTMvixF8v7IrXbxRZni9wyYlITiildhfrjyLfK/6dpYeptjp7slwf9WoHjm0ceQG3YpaDwhjhMAdVnD8/4blNrE9xMuAUXgf3rh0XIH9Q52nK+3FQicpjR1qg6vcoRiLNl7wll/3iKmpbVRikKEdeNHjnZxvKGlc42LeCwksGv7Jve/lluSn3rwbDA8jT5Qcaetz2xCvtT18cUo2l/uhjQ8+cBVYqkdkbyuTSlIMVQs4KvG6kPvk4yJsG0vazegUNyFiE6AcUd/3kzRw1TORppHL2EG/j5ZEAsLTNkDPNWJrtlfNW8R5nPQuTR1SGjt+/WbY/gDVjGSEeUefZ/FO6cTyq0kdmZLKnNiDCjpApq47k3p9mBG74EZoz147U/CyNJCUmLYxlNt+A+t/SL4yKZSiqu9CbCEEhu/Zff6lNgeGjcHfESok8c83eQMYThVia7ZXzVvEeZz0Lk0dUho7DlU5ir4kQ07HKY9QNawhoY935TLnXEePHxC4zIplyJA/qbxjeEkYOfDt5F/eLLwXXvGi66Du0SAha+AqALkpbOjA8AgDg8E/+armlZPA5ORNgfjrW07gl1uCPCwfPWT1TuogB6wiDKPvJu/wqtMSD\",\"appid\":\"wx73eb8a9ed10a029d\",\"mch_id\":\"1505718751\",\"return_code\":\"SUCCESS\"}";
public void refundTest() throws IOException {
String mapStr = "{\"transaction_id\":\"4200003100202603299982043817\",\"nonce_str\":\"Ry43aTRErVhu3d2fN7fTmzhv57Ayoz\",\"bank_type\":\"OTHERS\",\"openid\":\"oQ5kM5KDmBn5e08gNV0HzOcJdGKI\",\"sign\":\"380E9C640F7BCD5A78D621F28D117C0B\",\"fee_type\":\"CNY\",\"mch_id\":\"1505718751\",\"cash_fee\":\"800\",\"out_trade_no\":\"260329073632925370\",\"appid\":\"wx73eb8a9ed10a029d\",\"total_fee\":\"800\",\"trade_type\":\"JSAPI\",\"result_code\":\"SUCCESS\",\"time_end\":\"20260329073640\",\"is_subscribe\":\"N\",\"return_code\":\"SUCCESS\"}";
Map<String,String> params = JsonUtils.decode(mapStr, Map.class);
// 读取输入流
if (params.get("return_code").equals("SUCCESS")) {
String reqInfo = params.get("req_info");//加密信息
// PayConfig payConfig = payConfigService.findKey("face"); //得到秘钥
String key = MD5Utils.md5("jYrMMG4RPNxI2xCnH7zgh8LTwBrtjal9").toString();
key = key.toLowerCase();
String refundInfo = EncryptionUtil.Aes256Decode(reqInfo,key);
Map<String,Object> map = XmlUtils.getResult(refundInfo);
// 更新‘用户退款记录表’
String refundStatus = map.get("refund_status").toString(); //退款状态
String outTradeNo = map.get("out_trade_no").toString(); //商户订单号
String successTime = map.get("success_time").toString(); //退款成功时间
// memberRefundService.updateInfo(refundStatus,outTradeNo,successTime,platformId);
}
wechatPayService.notify(params);
}