|
@@ -44,38 +44,41 @@ public class QRCodeController {
|
|
public APIResult callback(@RequestParam("data") String data)
|
|
public APIResult callback(@RequestParam("data") String data)
|
|
{
|
|
{
|
|
|
|
|
|
- Map<String, Object> requestMap = FastJsonUtils.stringToCollect(data);
|
|
|
|
-
|
|
|
|
- boolean status = (boolean) requestMap.get("status");
|
|
|
|
- Map<String, Object> dataMap = (Map<String, Object>) requestMap.get("data");
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- Map<String, Object> qrcodeMap = (Map<String, Object>) dataMap.get("qrcode");
|
|
|
|
- String eid = (String) qrcodeMap.get("user");
|
|
|
|
- long time = (long) qrcodeMap.get("time");
|
|
|
|
-
|
|
|
|
- QRCode qrcode = new QRCode();
|
|
|
|
- qrcode.setEid(eid);
|
|
|
|
- //qrcode.setTime(new Date(time));
|
|
|
|
-
|
|
|
|
- QRCode entity = qrcodeService.findFirst(qrcode);
|
|
|
|
-
|
|
|
|
- if(null == entity){
|
|
|
|
- log.error("qrcode/callback error ,qrcode is null");
|
|
|
|
- return APIResult.ok("扫码失败,未找到二维码信息");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if(status){
|
|
|
|
- qrcodeCallback(eid, entity.getSimple(), dataMap);
|
|
|
|
- entity.setStatus(2);
|
|
|
|
- qrcodeService.update(entity);
|
|
|
|
- return APIResult.ok("扫码成功");
|
|
|
|
- }else{
|
|
|
|
- entity.setStatus(1);
|
|
|
|
- qrcodeService.update(entity);
|
|
|
|
|
|
+ try{
|
|
|
|
+ Map<String, Object> requestMap = FastJsonUtils.stringToCollect(data);
|
|
|
|
+
|
|
|
|
+ boolean status = (boolean) requestMap.get("status");
|
|
|
|
+ Map<String, Object> dataMap = (Map<String, Object>) requestMap.get("data");
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Map<String, Object> qrcodeMap = (Map<String, Object>) dataMap.get("qrcode");
|
|
|
|
+ String eid = (String) qrcodeMap.get("user");
|
|
|
|
+ long time = (long) qrcodeMap.get("time");
|
|
|
|
+
|
|
|
|
+ QRCode qrcode = new QRCode();
|
|
|
|
+ qrcode.setEid(eid);
|
|
|
|
+ //qrcode.setTime(new Date(time));
|
|
|
|
+
|
|
|
|
+ QRCode entity = qrcodeService.findFirst(qrcode);
|
|
|
|
+
|
|
|
|
+ if(null == entity){
|
|
|
|
+ log.error("qrcode/callback error ,qrcode is null");
|
|
|
|
+ return APIResult.ok("扫码失败,未找到二维码信息");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(status){
|
|
|
|
+ qrcodeCallback(eid, entity.getSimple(), dataMap);
|
|
|
|
+ entity.setStatus(2);
|
|
|
|
+ qrcodeService.update(entity);
|
|
|
|
+ return APIResult.ok("扫码成功");
|
|
|
|
+ }else{
|
|
|
|
+ entity.setStatus(1);
|
|
|
|
+ qrcodeService.update(entity);
|
|
|
|
+ return APIResult.ok("扫码失败");
|
|
|
|
+ }
|
|
|
|
+ }catch(Exception e){
|
|
return APIResult.ok("扫码失败");
|
|
return APIResult.ok("扫码失败");
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|