|
@@ -54,10 +54,11 @@ public class ConsumeController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 请求消费(校园码)
|
|
* 请求消费(校园码)
|
|
|
|
|
+ *
|
|
|
* @param record 消费信息
|
|
* @param record 消费信息
|
|
|
- * @param mac 校验码
|
|
|
|
|
|
|
+ * @param mac 校验码
|
|
|
* @param qrcode 校园码
|
|
* @param qrcode 校园码
|
|
|
- * @param xfPwd 消费密码
|
|
|
|
|
|
|
+ * @param xfPwd 消费密码
|
|
|
* @return 请求消费结果
|
|
* @return 请求消费结果
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/ConsumeOriginal/virtualCard")
|
|
@PostMapping("/ConsumeOriginal/virtualCard")
|
|
@@ -66,8 +67,8 @@ public class ConsumeController {
|
|
|
@RequestParam(name = "xfPwd", required = false) String xfPwd) {
|
|
@RequestParam(name = "xfPwd", required = false) String xfPwd) {
|
|
|
JSONObject yc = JSONUtil.parseObj(record);
|
|
JSONObject yc = JSONUtil.parseObj(record);
|
|
|
long userNo = ObjectUtil.isEmpty(yc.get("employeeID")) ? 0L : Long.parseLong(yc.get("employeeID").toString());
|
|
long userNo = ObjectUtil.isEmpty(yc.get("employeeID")) ? 0L : Long.parseLong(yc.get("employeeID").toString());
|
|
|
- Object redisQrCode = RedisUtils.getCacheMapValue(CacheNames.SCHOOL_CODE,Long.toString(userNo));
|
|
|
|
|
- if(ObjectUtil.equals(qrcode,redisQrCode)){
|
|
|
|
|
|
|
+ Object redisQrCode = RedisUtils.getCacheMapValue(CacheNames.SCHOOL_CODE, Long.toString(userNo));
|
|
|
|
|
+ if (ObjectUtil.equals(qrcode, redisQrCode)) {
|
|
|
ErrorResult result = ErrorResult.instance(HttpStatus.FORBIDDEN, "处理失败", 1, "PARAM_ERROR", "二维码失效",
|
|
ErrorResult result = ErrorResult.instance(HttpStatus.FORBIDDEN, "处理失败", 1, "PARAM_ERROR", "二维码失效",
|
|
|
"请勿重复使用相同的二维码消费。");
|
|
"请勿重复使用相同的二维码消费。");
|
|
|
return new ResponseEntity<Object>(result, null, HttpStatus.FORBIDDEN);
|
|
return new ResponseEntity<Object>(result, null, HttpStatus.FORBIDDEN);
|
|
@@ -79,9 +80,10 @@ public class ConsumeController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 请求消费(实体卡)
|
|
* 请求消费(实体卡)
|
|
|
|
|
+ *
|
|
|
* @param record 消费信息
|
|
* @param record 消费信息
|
|
|
- * @param mac 校验码
|
|
|
|
|
- * @param xfPwd 消费密码
|
|
|
|
|
|
|
+ * @param mac 校验码
|
|
|
|
|
+ * @param xfPwd 消费密码
|
|
|
* @return 请求消费结果
|
|
* @return 请求消费结果
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/ConsumeOriginal")
|
|
@PostMapping("/ConsumeOriginal")
|
|
@@ -92,8 +94,9 @@ public class ConsumeController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 上传消费记录
|
|
* 上传消费记录
|
|
|
|
|
+ *
|
|
|
* @param record 消费信息
|
|
* @param record 消费信息
|
|
|
- * @param mac 校验码
|
|
|
|
|
|
|
+ * @param mac 校验码
|
|
|
* @return 上传消费记录结果
|
|
* @return 上传消费记录结果
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/Consume")
|
|
@PostMapping("/Consume")
|
|
@@ -103,9 +106,10 @@ public class ConsumeController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 请求消费 + 消费记录上传
|
|
* 请求消费 + 消费记录上传
|
|
|
|
|
+ *
|
|
|
* @param record 消费信息
|
|
* @param record 消费信息
|
|
|
- * @param mac 校验码
|
|
|
|
|
- * @param xfPwd 消费密码
|
|
|
|
|
|
|
+ * @param mac 校验码
|
|
|
|
|
+ * @param xfPwd 消费密码
|
|
|
* @return 处理结果
|
|
* @return 处理结果
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/Consume/all")
|
|
@PostMapping("/Consume/all")
|
|
@@ -116,6 +120,7 @@ public class ConsumeController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* kafka 推送消费信息处理
|
|
* kafka 推送消费信息处理
|
|
|
|
|
+ *
|
|
|
* @param bo 消费业务对象
|
|
* @param bo 消费业务对象
|
|
|
* @return 处理结果
|
|
* @return 处理结果
|
|
|
*/
|
|
*/
|
|
@@ -126,10 +131,11 @@ public class ConsumeController {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 消费业务初步处理
|
|
* 消费业务初步处理
|
|
|
|
|
+ *
|
|
|
* @param record 消费信息
|
|
* @param record 消费信息
|
|
|
- * @param type 接口类型
|
|
|
|
|
- * @param mac 校验码
|
|
|
|
|
- * @param xfPwd 消费密码
|
|
|
|
|
|
|
+ * @param type 接口类型
|
|
|
|
|
+ * @param mac 校验码
|
|
|
|
|
+ * @param xfPwd 消费密码
|
|
|
* @return 处理结果
|
|
* @return 处理结果
|
|
|
*/
|
|
*/
|
|
|
private Object doRecordData(Object record, String type, String mac, String xfPwd) {
|
|
private Object doRecordData(Object record, String type, String mac, String xfPwd) {
|
|
@@ -147,7 +153,7 @@ public class ConsumeController {
|
|
|
R<ErrorInfo> errorInfo;
|
|
R<ErrorInfo> errorInfo;
|
|
|
if (Objects.equals(type, "requestConsume")) {
|
|
if (Objects.equals(type, "requestConsume")) {
|
|
|
errorInfo = consumeBusiness.createOrder(bo, mac, xfPwd);
|
|
errorInfo = consumeBusiness.createOrder(bo, mac, xfPwd);
|
|
|
- //是否推送云端消费
|
|
|
|
|
|
|
+ // 是否推送云端消费
|
|
|
if (ObjectUtil.equals(defaultConfig.getLocationFlag(), DefaultConstants.LOCAL_FLAG)) {
|
|
if (ObjectUtil.equals(defaultConfig.getLocationFlag(), DefaultConstants.LOCAL_FLAG)) {
|
|
|
baseBusiness.sendCloudConsume(cloudConsumeBo);
|
|
baseBusiness.sendCloudConsume(cloudConsumeBo);
|
|
|
}
|
|
}
|