Merge branch 'master' of gitee.com:super-shopkeeper/chaozhanggui
This commit is contained in:
@@ -7,6 +7,7 @@ import cn.pluss.platform.api.Result;
|
||||
import cn.pluss.platform.api.ResultCode;
|
||||
import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.constants.ProjectConstant;
|
||||
import cn.pluss.platform.deviceStock.DeviceStockService;
|
||||
import cn.pluss.platform.dto.*;
|
||||
import cn.pluss.platform.entity.*;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
@@ -25,6 +26,7 @@ import cn.pluss.platform.sxf.pay.SxfPayService;
|
||||
import cn.pluss.platform.user.impl.GeneralPushUtil;
|
||||
import cn.pluss.platform.userApp.UserAppService;
|
||||
import cn.pluss.platform.util.StringUtil;
|
||||
import cn.pluss.platform.util.TokenUtil;
|
||||
import cn.pluss.platform.vo.MemberScanVO;
|
||||
import cn.pluss.platform.vo.MerchantOrderVO;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -68,6 +70,8 @@ public class MerchantOrderController {
|
||||
private final SxfPayService sxfPayService;
|
||||
private final RyxPayService ryxPayService;
|
||||
private final MerchantChannelStatusMapper merchantChannelStatusMapper;
|
||||
@Autowired
|
||||
private DeviceStockService deviceStockService;
|
||||
|
||||
@Setter(onMethod_ = {@Lazy, @Autowired})
|
||||
private IdCardService idCardService;
|
||||
@@ -424,6 +428,36 @@ public class MerchantOrderController {
|
||||
return ResultGenerator.genFailResult(e.getMessage());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 博实结pos机反扫支付
|
||||
* @param merchantOrderDTO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/posScanPay")
|
||||
public Result<Object> posScanPay(@RequestBody MerChantOrderDTO merchantOrderDTO) {
|
||||
//首先验签
|
||||
Map<String, String> token = TokenUtil.getToken(merchantOrderDTO.getTimestamp(), merchantOrderDTO.getRequestId());
|
||||
boolean sign = token.get("TOKEN").equals(merchantOrderDTO.getToken());
|
||||
System.out.println(token);
|
||||
MsgException.check(!sign,"签名错误");
|
||||
//通过后查询商户信息
|
||||
DeviceStock deviceStock = deviceStockService.checkBind(merchantOrderDTO.getSn());
|
||||
MerchantBaseInfo merchantBaseInfoById = merchantBaseInfoService.getMerchantBaseInfoById(Integer.valueOf(deviceStock.getActMercId()));
|
||||
MsgException.checkNull(merchantBaseInfoById, "找不到商户");
|
||||
merchantOrderDTO.setMerchantCode(merchantBaseInfoById.getMerchantCode());
|
||||
//校验金额
|
||||
if (!StringUtil.isMoney(String.valueOf(merchantOrderDTO.getConsumeFee()))){
|
||||
MsgException.throwException("金额异常");
|
||||
}
|
||||
//进行支付操作
|
||||
try {
|
||||
return merchantOrderService.toActivePay(merchantOrderDTO);
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return ResultGenerator.genFailResult(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 主扫会员支付
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.pluss.platform.api.ResultGenerator;
|
||||
import cn.pluss.platform.entity.MerchantCashPayCode;
|
||||
import cn.pluss.platform.entity.MerchantCashPlace;
|
||||
import cn.pluss.platform.entity.MerchantCashPlaceStaff;
|
||||
import cn.pluss.platform.exception.MsgException;
|
||||
import cn.pluss.platform.merchant.MerchantCashPlaceService;
|
||||
import cn.pluss.platform.merchant.MerchantCashPlaceStaffService;
|
||||
import cn.pluss.platform.vo.MerchantCashPlaceStaffVO;
|
||||
@@ -33,6 +34,9 @@ public class MerchantCashPlaceController {
|
||||
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody MerchantCashPlace merchantCashPlace) {
|
||||
//判定字符位数
|
||||
size(merchantCashPlace.getAddress());
|
||||
size(merchantCashPlace.getName());
|
||||
cashPlaceService.saveOrUpdate(merchantCashPlace);
|
||||
return ResultGenerator.genSuccessResult("保存成功", merchantCashPlace);
|
||||
}
|
||||
@@ -101,4 +105,9 @@ public class MerchantCashPlaceController {
|
||||
Page<MerchantCashPlaceStaffVO> pageData = cashPlaceStaffService.getRecord(page, condition, orderItem);
|
||||
return ResultGenerator.genSuccessResult(pageData);
|
||||
}
|
||||
private void size(String character){
|
||||
if (character.length() >= 50){
|
||||
throw new MsgException("输入内容过长");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,7 @@ public class TokenRegistryInterceptor extends HandlerInterceptorAdapter {
|
||||
limitUri.add("/api/callback/");
|
||||
limitUri.add("/api/open/login");
|
||||
limitUri.add("/api/index.html");
|
||||
limitUri.add("/api/merchantOrder/posScanPay");
|
||||
boolean passFlag = limitUri.stream().anyMatch(s -> s.equals(requestUri) || requestUri.startsWith(s));
|
||||
if (passFlag) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user