Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a420de86d0 | ||
|
|
54207e7be5 | ||
|
|
2f6ef82534 | ||
|
|
00e6bb43db | ||
|
|
b4e5fd6aa3 | ||
|
|
4ad5b3416c | ||
|
|
e7d8d85ea1 | ||
|
|
a97e33984d | ||
|
|
7f3ec09ce1 | ||
|
|
826ffa2c7b | ||
|
|
eb2156857c | ||
|
|
fbd0ab240c | ||
|
|
525d753064 | ||
|
|
689ad881b1 | ||
|
|
df5ef3c9f7 | ||
|
|
d9a5d041ae | ||
|
|
3ee4ea9870 | ||
| 05efa142e9 | |||
| 7ce0a794bd | |||
| ad5dbead9d | |||
| 7e21f59b7d | |||
| 607c7304e3 | |||
| 929956d66b | |||
| 1afcf13d26 | |||
| 2f7b61db7d | |||
| c0ad62aaff | |||
| e32476cb3b | |||
| 556123aab4 |
6
pom.xml
6
pom.xml
@@ -203,6 +203,12 @@
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
</dependency>
|
||||
<!-- 支付宝服务端通用SDK -->
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>4.39.165.ALL</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.chaozhanggui.system.cashierservice.alipayUtil;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.alipay.api.AlipayClient;
|
||||
import com.alipay.api.AlipayConfig;
|
||||
import com.alipay.api.DefaultAlipayClient;
|
||||
import com.alipay.api.internal.util.AlipayEncrypt;
|
||||
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
|
||||
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 支付宝通用SDK工具类
|
||||
*
|
||||
* @author tankaikai
|
||||
* @since 2024-09-23 16:15
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class AlipayUtil {
|
||||
|
||||
/**
|
||||
* 网关地址 线上:https://openapi.alipay.com/gateway.do 沙箱:https://openapi.alipaydev.com/gateway.do
|
||||
*/
|
||||
@Value("${alipay.sdk.config.serverUrl}")
|
||||
private String serverUrl;
|
||||
/**
|
||||
* 应用ID
|
||||
*/
|
||||
@Value("${alipay.sdk.config.appId}")
|
||||
private String appId;
|
||||
/**
|
||||
* 应用私钥
|
||||
*/
|
||||
@Value("${alipay.sdk.config.privateKey}")
|
||||
private String privateKey;
|
||||
/**
|
||||
* 支付宝公钥
|
||||
*/
|
||||
@Value("${alipay.sdk.config.alipayPublicKey}")
|
||||
private String alipayPublicKey;
|
||||
/**
|
||||
* 支付宝公钥
|
||||
*/
|
||||
@Value("${alipay.sdk.config.encryptKey}")
|
||||
private String encryptKey;
|
||||
|
||||
/**
|
||||
* 创建支付宝客户端
|
||||
* @return AlipayClient
|
||||
*/
|
||||
@SneakyThrows
|
||||
public AlipayClient createClient() {
|
||||
AlipayConfig alipayConfig = new AlipayConfig();
|
||||
//设置网关地址
|
||||
alipayConfig.setServerUrl(serverUrl);
|
||||
//设置应用ID
|
||||
alipayConfig.setAppId(appId);
|
||||
//设置应用私钥
|
||||
alipayConfig.setPrivateKey(privateKey);
|
||||
//设置支付宝公钥
|
||||
alipayConfig.setAlipayPublicKey(alipayPublicKey);
|
||||
return new DefaultAlipayClient(alipayConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付宝用户的openId
|
||||
* @param code 用户信息授权码
|
||||
* @return openId
|
||||
*/
|
||||
public String getOpenId(String code) throws Exception{
|
||||
AlipaySystemOauthTokenRequest req = new AlipaySystemOauthTokenRequest();
|
||||
//SDK已经封装掉了公共参数,这里只需要传入业务参数
|
||||
req.setCode(code);
|
||||
req.setGrantType("authorization_code");
|
||||
//此次只是参数展示,未进行字符串转义,实际情况下请转义
|
||||
//req.setBizContent(" {" + " \"primary_industry_name\":\"IT科技/IT软件与服务\"," + " \"primary_industry_code\":\"10001/20102\"," + " \"secondary_industry_code\":\"10001/20102\"," + " \"secondary_industry_name\":\"IT科技/IT软件与服务\"" + " }");
|
||||
AlipaySystemOauthTokenResponse response;
|
||||
try {
|
||||
response = createClient().execute(req);
|
||||
}catch (AlipayApiException e){
|
||||
log.error("获取支付宝用户信息失败,错误码:{},错误信息:{}", e.getErrCode(), e.getErrMsg());
|
||||
throw e;
|
||||
}
|
||||
log.info("获取支付宝用户信息成功,返回结果:{}", response.getBody());
|
||||
//调用失败
|
||||
if (!response.isSuccess()) {
|
||||
log.error("获取支付宝用户信息失败,错误码:{},错误信息:{}", response.getSubCode(), response.getSubMsg());
|
||||
throw new AlipayApiException(response.getSubCode(), response.getSubMsg());
|
||||
}
|
||||
//调用成功,则处理业务逻辑,为配合支付系统确定沿用支付宝的老标准使用userId
|
||||
return response.getUserId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取支付宝用户的手机号码
|
||||
* @param encryptedData 密文
|
||||
* @return mobile
|
||||
*/
|
||||
public String getMobile(String encryptedData) throws Exception{
|
||||
if(StrUtil.isEmpty(encryptedData)){
|
||||
throw new AlipayApiException("加密数据不能为空");
|
||||
}
|
||||
try {
|
||||
log.info("解密前的数据,返回结果:{}", encryptedData);
|
||||
String resp = AlipayEncrypt.decryptContent(encryptedData, "AES", encryptKey, "UTF-8");
|
||||
log.info("解密后的数据,返回结果:{}", resp);
|
||||
boolean isJson = JSONUtil.isJson(resp);
|
||||
if(!isJson){
|
||||
throw new AlipayApiException("解密后的数据不是json格式");
|
||||
}
|
||||
JSONObject jsonObject = JSONUtil.parseObj(resp);
|
||||
String code = jsonObject.getStr("code");
|
||||
String msg = jsonObject.getStr("msg");
|
||||
String mobile = jsonObject.getStr("mobile");
|
||||
if("10000".equals(code)){
|
||||
return mobile;
|
||||
}else{
|
||||
throw new AlipayApiException(code,msg);
|
||||
}
|
||||
}catch (AlipayApiException e){
|
||||
log.error("获取支付宝用户的手机号码失败,错误码:{},错误信息:{}", e.getErrCode(), e.getErrMsg());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.chaozhanggui.system.cashierservice.auth;
|
||||
|
||||
/**
|
||||
* 三方登录认证来源
|
||||
* @author tankaikai
|
||||
* @since 2024-09-23 17:51
|
||||
*/
|
||||
public enum AuthSource {
|
||||
WECHAT("微信", "wechat"),
|
||||
ALIPAY("支付宝", "alipay");
|
||||
|
||||
private String name;
|
||||
private String value;
|
||||
|
||||
AuthSource(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@@ -49,6 +49,7 @@ public class LoginFilter implements Filter {
|
||||
|
||||
// "cashierService/login/**",//登录部分接口不校验
|
||||
"cashierService/login/wx/**",//登录部分接口不校验
|
||||
"cashierService/login/auth/**",//登录部分接口不校验
|
||||
"cashierService/login/app/login",//登录部分接口不校验
|
||||
"cashierService/product/queryProduct",
|
||||
"cashierService/product/queryProductSku",
|
||||
@@ -94,7 +95,7 @@ public class LoginFilter implements Filter {
|
||||
return;
|
||||
}
|
||||
|
||||
//environment 环境标识 wx app 后续environment不可为空
|
||||
//environment 环境标识 wx alipay app 后续environment不可为空
|
||||
String environment = request.getHeader("environment");
|
||||
|
||||
// 判断用户TOKEN是否存在
|
||||
@@ -130,7 +131,7 @@ public class LoginFilter implements Filter {
|
||||
String userId = jsonObject1.getString("userId");
|
||||
tokenKey=RedisCst.ONLINE_APP_USER.concat(userId);
|
||||
//获取redis中的token
|
||||
}else if(environment.equals("wx")){
|
||||
}else if(environment.equals("wx") || environment.equals("alipay")){
|
||||
//获取当前登录人的用户id
|
||||
String openId = jsonObject1.getString("openId");
|
||||
if(StringUtils.isBlank(openId)){
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.chaozhanggui.system.cashierservice.controller;
|
||||
|
||||
import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.chaozhanggui.system.cashierservice.alipayUtil.AlipayUtil;
|
||||
import com.chaozhanggui.system.cashierservice.auth.AuthSource;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbMerchantAccountMapper;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbMerchantAccount;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbUserInfo;
|
||||
@@ -16,10 +18,12 @@ import com.chaozhanggui.system.cashierservice.service.LoginService;
|
||||
import com.chaozhanggui.system.cashierservice.service.OnlineUserService;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.chaozhanggui.system.cashierservice.util.*;
|
||||
import com.chaozhanggui.system.cashierservice.util.IpUtil;
|
||||
import com.chaozhanggui.system.cashierservice.util.MD5Utils;
|
||||
import com.chaozhanggui.system.cashierservice.util.StringUtil;
|
||||
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
|
||||
import com.chaozhanggui.system.cashierservice.wxUtil.WechatUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -60,28 +64,27 @@ public class LoginContoller {
|
||||
@Autowired
|
||||
RedisUtil redisUtil;
|
||||
|
||||
@Resource
|
||||
AlipayUtil alipayUtil;
|
||||
|
||||
|
||||
@RequestMapping("/wx/business/login")
|
||||
public Result wxBusinessLogin(@RequestParam(value = "code", required = false) String code,
|
||||
@RequestParam(value = "shopId", required = false) String shopId
|
||||
) {
|
||||
public Result wxBusinessLogin(@RequestParam(value = "code", required = false) String code, @RequestParam(value = "shopId", required = false) String shopId) {
|
||||
|
||||
JSONObject SessionKeyOpenId = WechatUtil.getSessionKeyOrOpenId(code, businessAppId, businessSecrete);
|
||||
String openid = SessionKeyOpenId.getString("openid");
|
||||
if(Objects.isNull(openid)){
|
||||
if (Objects.isNull(openid)) {
|
||||
return Result.fail("获取微信id失败");
|
||||
}
|
||||
|
||||
return loginService.wxBusinessLogin(openid,shopId);
|
||||
return loginService.wxBusinessLogin(openid, shopId);
|
||||
}
|
||||
|
||||
@GetMapping("/wx/business/openId")
|
||||
public Result getOpenId(
|
||||
@RequestParam String code
|
||||
) {
|
||||
public Result getOpenId(@RequestParam String code) {
|
||||
JSONObject SessionKeyOpenId = WechatUtil.getSessionKeyOrOpenId(code, customAppId, customSecrete);
|
||||
String openid = SessionKeyOpenId.getString("openid");
|
||||
if(Objects.isNull(openid)){
|
||||
if (Objects.isNull(openid)) {
|
||||
return Result.fail("获取微信id失败");
|
||||
}
|
||||
|
||||
@@ -95,50 +98,46 @@ public class LoginContoller {
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/wx/custom/login")
|
||||
public Result wxCustomLogin(HttpServletRequest request, @RequestBody Map<String, String> map) {
|
||||
@RequestMapping("/auth/custom/login")
|
||||
public Result authCustomLogin(HttpServletRequest request, @RequestBody Map<String, String> map) {
|
||||
if (ObjectUtil.isNull(map) || ObjectUtil.isEmpty(map) || !map.containsKey("code") || ObjectUtil.isEmpty(map.get("code"))) {
|
||||
Result.fail("code不能为空");
|
||||
}
|
||||
String code = map.get("code").toString();
|
||||
String rawData = map.get("rawData");
|
||||
// String signature = map.get("signature");
|
||||
// String encryptedData = map.get("encryptedData");
|
||||
// String ivStr = map.get("iv");
|
||||
// String phone = map.get("phone");
|
||||
// 用户非敏感信息:rawData
|
||||
// 签名:signature
|
||||
JSONObject rawDataJson = JSON.parseObject(rawData);
|
||||
// 1.接收小程序发送的code
|
||||
// 2.开发者服务器 登录凭证校验接口 appi + appsecret + code
|
||||
JSONObject SessionKeyOpenId = WechatUtil.getSessionKeyOrOpenId(code, customAppId, customSecrete);
|
||||
// 3.接收微信接口服务 获取返回的参数
|
||||
String openid = SessionKeyOpenId.getString("openid");
|
||||
// String sessionKey = SessionKeyOpenId.getString("session_key");
|
||||
|
||||
// 4.校验签名 小程序发送的签名signature与服务器端生成的签名signature2 = sha1(rawData + sessionKey)
|
||||
// String signature2 = DigestUtils.sha1Hex(rawData + sessionKey);
|
||||
// if (!signature.equals(signature2)) {
|
||||
// return Result.fail("签名校验失败");
|
||||
// }
|
||||
// String phone = "";
|
||||
// try{
|
||||
// String data = WxMaCryptUtils.decrypt(sessionKey, encryptedData, ivStr);
|
||||
// if (ObjectUtil.isNotEmpty(data) && JSONObject.parseObject(data).containsKey("phoneNumber")) {
|
||||
// }// phone =JSONObject.parseObject(data).get("phoneNumber").toString();
|
||||
// }catch (Exception e){
|
||||
// log.info("登录传参:获取手机号失败{}",e.getMessage());
|
||||
// }
|
||||
String nickName = rawDataJson.getString("nickName");
|
||||
String avatarUrl = rawDataJson.getString("avatarUrl");
|
||||
try {
|
||||
return loginService.wxCustomLogin(openid, avatarUrl, nickName, "", IpUtil.getIpAddr(request));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// 三方登录来源 wechat、alipay
|
||||
String source = map.getOrDefault("source",AuthSource.WECHAT.getValue());
|
||||
String code = map.get("code");
|
||||
if(AuthSource.WECHAT.getValue().equals(source)){
|
||||
try {
|
||||
// 1.接收小程序发送的code
|
||||
// 2.开发者服务器 登录凭证校验接口 appi + appsecret + code
|
||||
JSONObject wxResp = WechatUtil.getSessionKeyOrOpenId(code, customAppId, customSecrete);
|
||||
//Integer errCode = wxResp.getInteger("errcode");
|
||||
log.info("微信获取openid响应报文:{}", wxResp.toJSONString());
|
||||
boolean hasOpenId = wxResp.containsKey("openid");
|
||||
if (!hasOpenId) {
|
||||
return Result.fail("登录失败:" + wxResp.getString("errmsg"));
|
||||
}
|
||||
String a = "{\"width\":\"58\",\"printerNum\":\"1\",\"categoryList\":[{\"id\":30,\"name\":\"奶茶\",\"shortName\":null,\"tree\":null,\"pid\":null,\"pic\":null,\"merchantId\":null,\"shopId\":null,\"style\":null,\"isShow\":null,\"detail\":null,\"sort\":null,\"keyWord\":null,\"createdAt\":null,\"updatedAt\":null},{\"id\":35,\"name\":\"酒水饮料\",\"shortName\":null,\"tree\":null,\"pid\":null,\"pic\":null,\"merchantId\":null,\"shopId\":null,\"style\":null,\"isShow\":null,\"detail\":null,\"sort\":null,\"keyWord\":null,\"createdAt\":null,\"updatedAt\":null},{\"id\":65,\"name\":\"火锅\",\"shortName\":null,\"tree\":null,\"pid\":null,\"pic\":null,\"merchantId\":null,\"shopId\":null,\"style\":null,\"isShow\":null,\"detail\":null,\"sort\":null,\"keyWord\":null,\"createdAt\":null,\"updatedAt\":null},{\"id\":95,\"name\":\"串串\",\"shortName\":null,\"tree\":null,\"pid\":null,\"pic\":null,\"merchantId\":null,\"shopId\":null,\"style\":null,\"isShow\":null,\"detail\":null,\"sort\":null,\"keyWord\":null,\"createdAt\":null,\"updatedAt\":null},{\"id\":96,\"name\":\"烧烤\",\"shortName\":null,\"tree\":null,\"pid\":null,\"pic\":null,\"merchantId\":null,\"shopId\":null,\"style\":null,\"isShow\":null,\"detail\":null,\"sort\":null,\"keyWord\":null,\"createdAt\":null,\"updatedAt\":null}],\"model\":\"normal\",\"feet\":\"0\",\"autoCut\":\"1\"}";
|
||||
// 3.接收微信接口服务 获取返回的参数
|
||||
String openid = wxResp.getString("openid");
|
||||
return loginService.wxCustomLogin(openid, "", "", "", IpUtil.getIpAddr(request));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("登录失败:",e);
|
||||
}
|
||||
}else if(AuthSource.ALIPAY.getValue().equals(source)){
|
||||
try {
|
||||
String openId = alipayUtil.getOpenId(code);
|
||||
return loginService.alipayCustomLogin(openId);
|
||||
}catch (AlipayApiException e){
|
||||
log.error("登录失败:",e);
|
||||
return Result.fail("登录失败:"+e.getErrMsg());
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error("登录失败:",e);
|
||||
}
|
||||
}
|
||||
|
||||
return Result.fail("登录失败");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -179,14 +178,28 @@ public class LoginContoller {
|
||||
// return Result.fail("获取手机号失败,请重试!");
|
||||
// }
|
||||
@RequestMapping("getPhoneNumber")
|
||||
public Result getPhoneNumber(@RequestHeader String openId,@RequestBody Map<String, String> map) {
|
||||
|
||||
public Result getPhoneNumber(@RequestHeader String openId, @RequestBody Map<String, String> map) {
|
||||
String encryptedData = map.get("encryptedData");
|
||||
// 三方登录来源 wechat、alipay
|
||||
String source = map.getOrDefault("source",AuthSource.WECHAT.getValue());
|
||||
if (AuthSource.ALIPAY.getValue().equals(source)) {
|
||||
try {
|
||||
String mobile = alipayUtil.getMobile(encryptedData);
|
||||
return Result.success(CodeEnum.SUCCESS, mobile);
|
||||
}catch (AlipayApiException e){
|
||||
log.error("获取手机号失败:",e);
|
||||
return Result.fail("获取手机号失败:"+e.getErrMsg());
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error("登录手机号失败:",e);
|
||||
return Result.fail("获取手机号失败:未知错误");
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNull(map) || ObjectUtil.isEmpty(map) || !map.containsKey("code") || ObjectUtil.isEmpty(map.get("code"))) {
|
||||
Result.fail("code不能为空");
|
||||
}
|
||||
String code = map.get("code").toString();
|
||||
String code = map.get("code");
|
||||
|
||||
String encryptedData = map.get("encryptedData");
|
||||
|
||||
String ivStr = map.get("iv");
|
||||
if (StringUtils.isBlank(encryptedData) || StringUtils.isBlank(ivStr)) {
|
||||
@@ -201,14 +214,14 @@ public class LoginContoller {
|
||||
try {
|
||||
if (ObjectUtil.isNotEmpty(data) && JSONObject.parseObject(data).containsKey("phoneNumber")) {
|
||||
// if (!map.containsKey("shopId") || ObjectUtil.isEmpty(map.get("shopId"))) {
|
||||
return Result.success(CodeEnum.SUCCESS, JSONObject.parseObject(data).get("phoneNumber"));
|
||||
return Result.success(CodeEnum.SUCCESS, JSONObject.parseObject(data).get("phoneNumber"));
|
||||
// }
|
||||
// log.info("登录传参 获取手机号成功 sessionKey:{}\n encryptedData:{} \nivStr:{} \n data:{},",sessionKey,encryptedData,ivStr,JSONObject.parseObject(data).get("phoneNumber"));
|
||||
// return loginService.upPhone(openId,JSONObject.parseObject(data).get("phoneNumber").toString(),map.get("shopId").toString());
|
||||
}
|
||||
} catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
log.info("登录传参 获取手机号失败 sessionKey:{}\n encryptedData:{} \nivStr:{} \n data:{},",sessionKey,encryptedData,ivStr,data);
|
||||
log.info("登录传参 获取手机号失败 sessionKey:{}\n encryptedData:{} \nivStr:{} \n data:{},", sessionKey, encryptedData, ivStr, data);
|
||||
}
|
||||
return Result.fail("获取手机号失败,请重试!");
|
||||
}
|
||||
@@ -254,10 +267,8 @@ public class LoginContoller {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("createCardNo")
|
||||
public Result createCardNo(@RequestHeader("openId") String openId, @RequestHeader("token") String token, @RequestHeader("id") String id,
|
||||
@RequestParam("shopId") String shopId
|
||||
) {
|
||||
return loginService.createCardNo(id, openId,shopId);
|
||||
public Result createCardNo(@RequestHeader("openId") String openId, @RequestHeader("token") String token, @RequestHeader("id") String id, @RequestParam("shopId") String shopId) {
|
||||
return loginService.createCardNo(id, openId, shopId);
|
||||
}
|
||||
|
||||
@GetMapping("/userInfo")
|
||||
@@ -267,6 +278,7 @@ public class LoginContoller {
|
||||
|
||||
/**
|
||||
* 更新用户信息
|
||||
*
|
||||
* @param token
|
||||
* @param userInfo
|
||||
* @return
|
||||
@@ -281,16 +293,16 @@ public class LoginContoller {
|
||||
}
|
||||
|
||||
@PostMapping(value = "/upPass")
|
||||
public Result upPass(@RequestHeader String token,@RequestBody UserPassDto passVo){
|
||||
public Result upPass(@RequestHeader String token, @RequestBody UserPassDto passVo) {
|
||||
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
|
||||
String newPass = MD5Utils.MD5Encode(passVo.getNewPass(), "utf-8");
|
||||
if (ObjectUtil.isNull(passVo.getCode())) {
|
||||
String oldPass = MD5Utils.MD5Encode(passVo.getOldPass(), "utf-8");
|
||||
return loginService.upPass(userId,oldPass, newPass);
|
||||
return loginService.upPass(userId, oldPass, newPass);
|
||||
} else {
|
||||
boolean tf = loginService.validate(passVo.getCode(), passVo.getPhone());
|
||||
if (tf) {
|
||||
TbUserInfo userInfo=new TbUserInfo();
|
||||
TbUserInfo userInfo = new TbUserInfo();
|
||||
userInfo.setId(Integer.valueOf(userId));
|
||||
userInfo.setPassword(newPass);
|
||||
return loginService.upUserInfo(userInfo);
|
||||
@@ -301,16 +313,16 @@ public class LoginContoller {
|
||||
}
|
||||
|
||||
@PostMapping(value = "modityPass")
|
||||
public Result modityPass(@RequestHeader String token,@RequestBody UserPassDto passVo){
|
||||
public Result modityPass(@RequestHeader String token, @RequestBody UserPassDto passVo) {
|
||||
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
|
||||
String newPass = MD5Utils.MD5Encode(passVo.getNewPass(), "utf-8");
|
||||
if (ObjectUtil.isNull(passVo.getCode())) {
|
||||
String oldPass = MD5Utils.MD5Encode(passVo.getOldPass(), "utf-8");
|
||||
return loginService.upPass(userId,oldPass, newPass);
|
||||
return loginService.upPass(userId, oldPass, newPass);
|
||||
} else {
|
||||
boolean tf = loginService.validate(passVo.getCode(), passVo.getPhone());
|
||||
if (tf) {
|
||||
TbUserInfo userInfo=new TbUserInfo();
|
||||
TbUserInfo userInfo = new TbUserInfo();
|
||||
userInfo.setId(Integer.valueOf(userId));
|
||||
userInfo.setPassword(newPass);
|
||||
return loginService.upUserInfo(userInfo);
|
||||
@@ -359,12 +371,12 @@ public class LoginContoller {
|
||||
}
|
||||
//验证密码
|
||||
String mdPasswordString = MD5Utils.MD5Encode(authUserDto.getPassword(), "utf-8");
|
||||
return loginService.appLogin(authUserDto.getUsername(),openid, mdPasswordString);
|
||||
return loginService.appLogin(authUserDto.getUsername(), openid, mdPasswordString);
|
||||
} else {
|
||||
// tf = true;
|
||||
tf = loginService.validate(authUserDto.getCode(), authUserDto.getUsername());
|
||||
if (tf) {
|
||||
return loginService.appLogin(authUserDto.getUsername(),openid, null);
|
||||
return loginService.appLogin(authUserDto.getUsername(), openid, null);
|
||||
} else {
|
||||
return Result.fail("验证码输入有误");
|
||||
}
|
||||
@@ -393,29 +405,31 @@ public class LoginContoller {
|
||||
|
||||
/**
|
||||
* 重置资金密码
|
||||
*
|
||||
* @param token
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("resetPwd")
|
||||
public Result resetPwd(@RequestHeader String token,@RequestBody Map<String, Object> map){
|
||||
public Result resetPwd(@RequestHeader String token, @RequestBody Map<String, Object> map) {
|
||||
|
||||
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
|
||||
return loginService.resetPwd(userId,map);
|
||||
return loginService.resetPwd(userId, map);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*
|
||||
* @param token
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("mpdifyPwd")
|
||||
public Result mpdifyPwd(@RequestHeader String token,@RequestBody Map<String, Object> map){
|
||||
public Result mpdifyPwd(@RequestHeader String token, @RequestBody Map<String, Object> map) {
|
||||
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
|
||||
return loginService.modifyPwd(userId,map);
|
||||
return loginService.modifyPwd(userId, map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.chaozhanggui.system.cashierservice.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.chaozhanggui.system.cashierservice.annotation.LimitSubmit;
|
||||
import com.chaozhanggui.system.cashierservice.service.PayService;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
@@ -40,8 +41,17 @@ public class PayController {
|
||||
return Result.fail("订单号不允许为空");
|
||||
}
|
||||
|
||||
if (!map.containsKey("payType")) {
|
||||
return Result.fail("支付类型不允许为空");
|
||||
}
|
||||
|
||||
String payType = map.get("payType");
|
||||
if (StrUtil.isEmpty(payType)) {
|
||||
return Result.fail("支付类型不允许为空");
|
||||
}
|
||||
|
||||
try {
|
||||
return payService.payOrder(openId, map.get("orderId"), IpUtil.getIpAddr(request));
|
||||
return payService.payOrder(openId, map.get("orderId"), payType, IpUtil.getIpAddr(request));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -77,6 +87,8 @@ public class PayController {
|
||||
String userId = "";
|
||||
if (environment.equals("wx") && payType.equals("wechatPay")) {
|
||||
userId = TokenUtil.parseParamFromToken(token).getString("openId");
|
||||
} else if("aliPay".equals(payType)){
|
||||
userId = TokenUtil.parseParamFromToken(token).getString("openId");
|
||||
} else {
|
||||
userId = TokenUtil.parseParamFromToken(token).getString("userId");
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface TbShopAdDao {
|
||||
*
|
||||
* @return 对象列表
|
||||
*/
|
||||
@Select("select * from fycashier.tb_shop_ad where (shop_id = #{songId} or shop_id = 1) and status=1")
|
||||
@Select("select * from tb_shop_ad where (shop_id = #{songId} or shop_id = 1) and status=1")
|
||||
List<TbShopAd> shopAdList(Integer shopId);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ public interface TbShopSongMapper {
|
||||
|
||||
List<TbShopSong> selectAllAndSearch(Integer shopId, String keyWord);
|
||||
|
||||
@Select("select * from fycashier.tb_shop_song where id=#{songId} and status=1")
|
||||
@Select("select * from tb_shop_song where id=#{songId} and status=1")
|
||||
TbShopSong selectById(@Param("songId") Integer songId);
|
||||
|
||||
|
||||
@Update("update fycashier.tb_shop_song set sales_number=sales_number+#{num} where id=#{id}")
|
||||
@Update("update tb_shop_song set sales_number=sales_number+#{num} where id=#{id}")
|
||||
int incrNum(@Param("num") Integer num,@Param("id") Integer id);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public interface TbShopSongOrderMapper {
|
||||
" AND a.id=#{id}")
|
||||
Map<String, Object> selectByUserIdAndId(@Param("openId") String openId, @Param("id") Integer id);
|
||||
|
||||
@Select("select * from fycashier.tb_shop_song_order where order_no=#{orderNo};")
|
||||
@Select("select * from tb_shop_song_order where order_no=#{orderNo};")
|
||||
TbShopSongOrder selectByOrderNo(@Param("orderNo") String orderNo);
|
||||
|
||||
@Delete("DELETE FROM tb_shop_song_order\n" +
|
||||
|
||||
@@ -23,6 +23,8 @@ public class TbMerchantThirdApply implements Serializable {
|
||||
|
||||
private String smallAppid;
|
||||
|
||||
private String alipaySmallAppid;
|
||||
|
||||
private String storeId;
|
||||
|
||||
|
||||
@@ -117,4 +119,12 @@ public class TbMerchantThirdApply implements Serializable {
|
||||
public void setStoreId(String storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
public String getAlipaySmallAppid() {
|
||||
return alipaySmallAppid;
|
||||
}
|
||||
|
||||
public void setAlipaySmallAppid(String alipaySmallAppid) {
|
||||
this.alipaySmallAppid = alipaySmallAppid;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.chaozhanggui.system.cashierservice.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.chaozhanggui.system.cashierservice.dao.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.*;
|
||||
import com.chaozhanggui.system.cashierservice.exception.MsgException;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopOpenId;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopUser;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbUserInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbUserShopMsg;
|
||||
import com.chaozhanggui.system.cashierservice.redis.RedisCst;
|
||||
import com.chaozhanggui.system.cashierservice.redis.RedisUtil;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
@@ -141,34 +141,72 @@ public class LoginService {
|
||||
|
||||
}
|
||||
|
||||
private void buildNewUserInfo(TbUserInfo userInfo) {
|
||||
userInfo = new TbUserInfo();
|
||||
userInfo.setAmount(BigDecimal.ZERO);
|
||||
userInfo.setChargeAmount(BigDecimal.ZERO);
|
||||
userInfo.setLineOfCredit(BigDecimal.ZERO);
|
||||
userInfo.setConsumeNumber(0);
|
||||
userInfo.setConsumeAmount(BigDecimal.ZERO);
|
||||
userInfo.setTotalScore(0);
|
||||
userInfo.setLockScore(0);
|
||||
userInfo.setHeadImg("");
|
||||
userInfo.setNickName("");
|
||||
userInfo.setTelephone("");
|
||||
userInfo.setStatus(Byte.parseByte("1"));
|
||||
userInfo.setParentType("PERSON");
|
||||
userInfo.setIsResource(Byte.parseByte("0"));
|
||||
userInfo.setIsOnline(Byte.parseByte("0"));
|
||||
userInfo.setIsVip(Byte.parseByte("0"));
|
||||
userInfo.setIsAttentionMp(Byte.parseByte("0"));
|
||||
userInfo.setIsPwd("0");
|
||||
userInfo.setPwd(MD5Utils.md5("123456"));
|
||||
userInfo.setCreatedAt(System.currentTimeMillis());
|
||||
userInfo.setLastLogInAt(System.currentTimeMillis());
|
||||
userInfo.setUpdatedAt(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public Result wxCustomLogin(String openId, String headImage, String nickName, String telephone, String ip) {
|
||||
TbUserInfo userInfo = tbUserInfoMapper.selectByOpenId(openId);
|
||||
if (ObjectUtil.isNull(userInfo)) {
|
||||
userInfo = new TbUserInfo();
|
||||
userInfo.setAmount(BigDecimal.ZERO);
|
||||
userInfo.setChargeAmount(BigDecimal.ZERO);
|
||||
userInfo.setLineOfCredit(BigDecimal.ZERO);
|
||||
userInfo.setConsumeNumber(0);
|
||||
userInfo.setConsumeAmount(BigDecimal.ZERO);
|
||||
userInfo.setTotalScore(0);
|
||||
userInfo.setLockScore(0);
|
||||
buildNewUserInfo(userInfo);
|
||||
userInfo.setHeadImg(ObjectUtil.isNotNull(headImage) ? headImage : "");
|
||||
userInfo.setNickName(ObjectUtil.isNotNull(nickName) ? nickName : "微信用户");
|
||||
userInfo.setTelephone(ObjectUtil.isNotNull(telephone) ? telephone : "");
|
||||
userInfo.setMiniAppOpenId(openId);
|
||||
userInfo.setStatus(Byte.parseByte("1"));
|
||||
userInfo.setParentType("PERSON");
|
||||
userInfo.setIsResource(Byte.parseByte("0"));
|
||||
userInfo.setIsOnline(Byte.parseByte("0"));
|
||||
userInfo.setIsVip(Byte.parseByte("0"));
|
||||
userInfo.setSourcePath("WECHAT-APP");
|
||||
userInfo.setIsAttentionMp(Byte.parseByte("0"));
|
||||
userInfo.setSearchWord("||微信用户");
|
||||
userInfo.setIsPwd("0");
|
||||
userInfo.setPwd(MD5Utils.md5("123456"));
|
||||
userInfo.setCreatedAt(System.currentTimeMillis());
|
||||
userInfo.setLastLogInAt(System.currentTimeMillis());
|
||||
userInfo.setMiniAppOpenId(openId);
|
||||
tbUserInfoMapper.insert(userInfo);
|
||||
} else {
|
||||
userInfo.setUpdatedAt(System.currentTimeMillis());
|
||||
userInfo.setLastLogInAt(System.currentTimeMillis());
|
||||
tbUserInfoMapper.updateByPrimaryKeySelective(userInfo);
|
||||
}
|
||||
//生成token 信息
|
||||
String token = TokenUtil.generateToken(userInfo.getId(), userInfo.getMiniAppOpenId(), userInfo.getTelephone(), userInfo.getNickName());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("token", token);
|
||||
map.put("userInfo", userInfo);
|
||||
redisUtil.saveMessage(RedisCst.ONLINE_USER.concat(openId), JSON.toJSONString(map), 60 * 60 * 24 * 30L);
|
||||
log.info("登录传参 结果:" + JSONUtil.toJSONString(map));
|
||||
return Result.success(CodeEnum.SUCCESS, map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付宝用户登录
|
||||
* @param openId
|
||||
* @return
|
||||
*/
|
||||
public Result alipayCustomLogin(String openId) {
|
||||
TbUserInfo userInfo = tbUserInfoMapper.selectByOpenId(openId);
|
||||
if (ObjectUtil.isNull(userInfo)) {
|
||||
userInfo = new TbUserInfo();
|
||||
buildNewUserInfo(userInfo);
|
||||
userInfo.setNickName("支付宝用户");
|
||||
userInfo.setSourcePath("ALIPAY-APP");
|
||||
userInfo.setSearchWord("||支付宝用户");
|
||||
userInfo.setMiniAppOpenId(openId);
|
||||
tbUserInfoMapper.insert(userInfo);
|
||||
} else {
|
||||
userInfo.setUpdatedAt(System.currentTimeMillis());
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chaozhanggui.system.cashierservice.dao.*;
|
||||
@@ -35,7 +36,6 @@ import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -166,9 +166,29 @@ public class PayService {
|
||||
this.shopSongOrderService = shopSongOrderService;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result payOrderTest(String openId, String orderId, String payType, String ip) throws Exception {
|
||||
//thirdUrl;
|
||||
String appId = "66e3dd399a7621f45a6293c1";
|
||||
String reqbody = "茉莉蜜茶";
|
||||
BigDecimal money = new BigDecimal("0.10");
|
||||
long amount = money.setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue();
|
||||
payType = "ALIPAY";
|
||||
String smallAppid = "2021004145625815";
|
||||
openId = "2088812533865205";
|
||||
ip = "1.80.208.76";
|
||||
String timesSS = DateUtils.getsdfTimesSS();
|
||||
String storeId = "S2409148611";
|
||||
//callFSTBack
|
||||
//null
|
||||
String appToken = "jVQs9aBIFOj1mh2ioDp5RLiNBLcQoRnhniH9xlyc3ZKmDcwOpDargyEIYASCePtbA4hyJ5aeH841HfBA4rEKFsxl5AJjGcQa7qT28qU0SPN6v9dNzKYK1eTyvSw6mNBh";
|
||||
PublicResp<WxScanPayResp> wxScanPayResp = thirdPayService.scanpay(thirdUrl, appId, reqbody, reqbody, amount, payType, smallAppid, openId, ip, timesSS, storeId, callFSTBack, null, appToken);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
return Result.success(CodeEnum.SUCCESS, mapper.readTree(wxScanPayResp.getObjData().getPayInfo()));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result payOrder(String openId, String orderId, String ip) throws Exception {
|
||||
public Result payOrder(String openId, String orderId, String payType, String ip) throws Exception {
|
||||
|
||||
if (ObjectUtil.isEmpty(openId) || Objects.isNull(openId)) {
|
||||
return Result.fail("付款用户[userId]参数不能为空");
|
||||
@@ -205,6 +225,10 @@ public class PayService {
|
||||
return Result.fail("支付通道不存在");
|
||||
}
|
||||
|
||||
if ("aliPay".equals(payType) && StrUtil.isBlank(thirdApply.getAlipaySmallAppid())) {
|
||||
return Result.fail("店铺未配置支付宝小程序appId");
|
||||
}
|
||||
|
||||
TbOrderPayment payment = tbOrderPaymentMapper.selectByOrderId(orderId);
|
||||
if (ObjectUtil.isEmpty(payment) || payment == null) {
|
||||
payment = new TbOrderPayment();
|
||||
@@ -212,8 +236,12 @@ public class PayService {
|
||||
payment.setAmount(orderInfo.getOrderAmount());
|
||||
payment.setPaidAmount(orderInfo.getPayAmount());
|
||||
payment.setHasRefundAmount(BigDecimal.ZERO);
|
||||
payment.setPayName("微信支付");
|
||||
payment.setPayType("wechatPay");
|
||||
if ("wechatPay".equals(payType)) {
|
||||
payment.setPayName("微信支付");
|
||||
} else if ("aliPay".equals(payType)) {
|
||||
payment.setPayName("支付宝支付");
|
||||
}
|
||||
payment.setPayType(payType);
|
||||
payment.setReceived(payment.getAmount());
|
||||
payment.setChangeFee(BigDecimal.ZERO);
|
||||
payment.setMemberId(orderInfo.getMemberId());
|
||||
@@ -222,6 +250,12 @@ public class PayService {
|
||||
payment.setCreatedAt(System.currentTimeMillis());
|
||||
tbOrderPaymentMapper.insert(payment);
|
||||
} else {
|
||||
if (payType.equals("wechatPay")) {
|
||||
payment.setPayName("微信支付");
|
||||
} else if (payType.equals("aliPay")) {
|
||||
payment.setPayName("支付宝支付");
|
||||
}
|
||||
payment.setPayType(payType);
|
||||
payment.setUpdatedAt(System.currentTimeMillis());
|
||||
tbOrderPaymentMapper.updateByPrimaryKey(payment);
|
||||
}
|
||||
@@ -281,10 +315,27 @@ public class PayService {
|
||||
reqbody = body.toString();
|
||||
}
|
||||
|
||||
PublicResp<WxScanPayResp> publicResp = thirdPayService.scanpay(thirdUrl, thirdApply.getAppId(),
|
||||
reqbody, reqbody,
|
||||
String smallAppid = thirdApply.getSmallAppid();
|
||||
String appId = thirdApply.getAppId();
|
||||
String appToken = thirdApply.getAppToken();
|
||||
if ("aliPay".equals(payType)){
|
||||
smallAppid = thirdApply.getAlipaySmallAppid();
|
||||
}
|
||||
String convertPayType = "aliPay".equals(payType) ? "ALIPAY" : "WECHAT";
|
||||
PublicResp<WxScanPayResp> publicResp = thirdPayService.scanpay(thirdUrl,
|
||||
appId,
|
||||
reqbody,
|
||||
reqbody,
|
||||
payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(),
|
||||
"WECHAT", thirdApply.getSmallAppid(), openId, ip, DateUtils.getsdfTimesSS(), thirdApply.getStoreId(), callFSTBack, null, thirdApply.getAppToken());
|
||||
convertPayType,
|
||||
smallAppid,
|
||||
openId,
|
||||
ip,
|
||||
DateUtils.getsdfTimesSS(),
|
||||
thirdApply.getStoreId(),
|
||||
callFSTBack,
|
||||
null,
|
||||
appToken);
|
||||
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
|
||||
if ("000000".equals(publicResp.getCode())) {
|
||||
WxScanPayResp wxScanPayResp = publicResp.getObjData();
|
||||
@@ -398,6 +449,7 @@ public class PayService {
|
||||
orderInfo.setMemberId(memberId);
|
||||
orderInfo.setPayType("deposit");
|
||||
orderInfo.setStatus("closed");
|
||||
orderInfo.setPaidTime(System.currentTimeMillis());
|
||||
orderInfo.setPayOrderNo("deposit".concat(SnowFlakeUtil.generateOrderNo()));
|
||||
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
||||
//更新购物车状态
|
||||
@@ -407,7 +459,7 @@ public class PayService {
|
||||
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed");
|
||||
|
||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
||||
outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(),"closed");
|
||||
outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(), "closed");
|
||||
log.info("更新购物车:{}", cartCount);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
@@ -427,13 +479,13 @@ public class PayService {
|
||||
mQUtils.sendStockSaleMsg(data);
|
||||
|
||||
|
||||
JSONObject baObj=new JSONObject();
|
||||
baObj.put("userId",userInfo.getId());
|
||||
baObj.put("shopId",user.getShopId());
|
||||
baObj.put("amount",orderInfo.getOrderAmount());
|
||||
baObj.put("balance",user.getAmount());
|
||||
baObj.put("type","消费");
|
||||
baObj.put("time",flow.getCreateTime());
|
||||
JSONObject baObj = new JSONObject();
|
||||
baObj.put("userId", userInfo.getId());
|
||||
baObj.put("shopId", user.getShopId());
|
||||
baObj.put("amount", orderInfo.getOrderAmount());
|
||||
baObj.put("balance", user.getAmount());
|
||||
baObj.put("type", "消费");
|
||||
baObj.put("time", flow.getCreateTime());
|
||||
producer.balance(baObj.toString());
|
||||
|
||||
// 为代客下单清楚当前台桌最新订单
|
||||
@@ -528,6 +580,11 @@ public class PayService {
|
||||
if (ObjectUtil.isEmpty(thirdApply) || ObjectUtil.isNull(thirdApply)) {
|
||||
return Result.fail("支付通道不存在");
|
||||
}
|
||||
|
||||
if ("aliPay".equals(payType) && StrUtil.isBlank(thirdApply.getAlipaySmallAppid())) {
|
||||
return Result.fail("店铺未配置支付宝小程序appId");
|
||||
}
|
||||
|
||||
StringBuffer body = new StringBuffer();
|
||||
body.append(orderInfo.getProName());
|
||||
TbOrderPayment payment = tbOrderPaymentMapper.selectByOrderId(orderInfo.getOrderNo());
|
||||
@@ -605,14 +662,21 @@ public class PayService {
|
||||
} else {
|
||||
reqbody = body.toString();
|
||||
}
|
||||
String smallAppid = thirdApply.getSmallAppid();
|
||||
String appId = thirdApply.getAppId();
|
||||
String appToken = thirdApply.getAppToken();
|
||||
if ("aliPay".equals(payType)){
|
||||
smallAppid = thirdApply.getAlipaySmallAppid();
|
||||
}
|
||||
String convertPayType = "aliPay".equals(payType) ? "ALIPAY" : "WECHAT";
|
||||
PublicResp<WxScanPayResp> publicResp = thirdPayService.scanpay(
|
||||
thirdUrl,
|
||||
thirdApply.getAppId(),
|
||||
appId,
|
||||
reqbody,
|
||||
reqbody,
|
||||
payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(),
|
||||
"WECHAT",
|
||||
thirdApply.getSmallAppid(),
|
||||
convertPayType,
|
||||
smallAppid,
|
||||
userId,
|
||||
ip,
|
||||
// orderInfo.getOrderNo(),
|
||||
@@ -620,7 +684,7 @@ public class PayService {
|
||||
thirdApply.getStoreId(),
|
||||
callBackGroupurl,
|
||||
null,
|
||||
thirdApply.getAppToken());
|
||||
appToken);
|
||||
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
|
||||
if ("000000".equals(publicResp.getCode())) {
|
||||
WxScanPayResp wxScanPayResp = publicResp.getObjData();
|
||||
@@ -705,6 +769,7 @@ public class PayService {
|
||||
orderInfo.setPayType("wx_lite");
|
||||
orderInfo.setPayOrderNo(payment.getTradeNumber());
|
||||
orderInfo.setPayAmount(orderInfo.getOrderAmount());
|
||||
orderInfo.setPaidTime(System.currentTimeMillis());
|
||||
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
||||
|
||||
|
||||
@@ -757,6 +822,7 @@ public class PayService {
|
||||
orderInfo.setPayType("wx_lite");
|
||||
orderInfo.setPayOrderNo(payment.getTradeNumber());
|
||||
orderInfo.setPayAmount(orderInfo.getOrderAmount());
|
||||
orderInfo.setPaidTime(System.currentTimeMillis());
|
||||
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
||||
|
||||
|
||||
@@ -901,12 +967,13 @@ public class PayService {
|
||||
|
||||
//更新子单状态
|
||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(orderInfo.getId(), "closed");
|
||||
outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(),"closed");
|
||||
outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(), "closed");
|
||||
//修改主单状态
|
||||
orderInfo.setStatus("closed");
|
||||
orderInfo.setPayType("wx_lite");
|
||||
orderInfo.setPayOrderNo(payOrderNO);
|
||||
orderInfo.setPayAmount(orderInfo.getOrderAmount());
|
||||
orderInfo.setPaidTime(System.currentTimeMillis());
|
||||
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
||||
|
||||
|
||||
@@ -961,8 +1028,9 @@ public class PayService {
|
||||
orderInfo.setPayType("wx_lite");
|
||||
orderInfo.setPayOrderNo(payOrderNO);
|
||||
orderInfo.setPayAmount(orderInfo.getOrderAmount());
|
||||
orderInfo.setPaidTime(System.currentTimeMillis());
|
||||
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
||||
outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(),"closed");
|
||||
outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(), "closed");
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("token", 0);
|
||||
@@ -1133,7 +1201,7 @@ public class PayService {
|
||||
flow.setIsReturn("0");
|
||||
tbShopUserFlowMapper.insert(flow);
|
||||
//会员活动
|
||||
giveActivate(tbShopUser,memberIn.getAmount(),flow.getId());
|
||||
giveActivate(tbShopUser, memberIn.getAmount(), flow.getId());
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("shopId", memberIn.getShopId());
|
||||
@@ -1143,14 +1211,14 @@ public class PayService {
|
||||
return "success";
|
||||
}
|
||||
|
||||
public BigDecimal giveActivate(TbShopUser tbShopUser, BigDecimal memAmount,Integer flowId){
|
||||
public BigDecimal giveActivate(TbShopUser tbShopUser, BigDecimal memAmount, Integer flowId) {
|
||||
TbActivate activate = tbActivateMapper.selectByAmount(tbShopUser.getShopId(), memAmount);
|
||||
if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) {
|
||||
if (activate.getIsGiftPro() != null && activate.getIsGiftPro() == 1) {
|
||||
List<TbActivateProduct> tbActivateProducts = actProductMapper.queryAllByActivateId(activate.getId());
|
||||
List<TbActivateInRecord> actGiveRecords = new ArrayList<>();
|
||||
for (TbActivateProduct actPro : tbActivateProducts) {
|
||||
TbActivateInRecord record = new TbActivateInRecord(Integer.valueOf(tbShopUser.getId()), actPro.getProductId(), actPro.getNum(), Integer.valueOf(tbShopUser.getShopId()), activate.getId(),flowId);
|
||||
TbActivateInRecord record = new TbActivateInRecord(Integer.valueOf(tbShopUser.getId()), actPro.getProductId(), actPro.getNum(), Integer.valueOf(tbShopUser.getShopId()), activate.getId(), flowId);
|
||||
actGiveRecords.add(record);
|
||||
}
|
||||
activateInRecordMapper.insertBatch(actGiveRecords);
|
||||
@@ -1232,7 +1300,7 @@ public class PayService {
|
||||
flow.setIsReturn("0");
|
||||
tbShopUserFlowMapper.insert(flow);
|
||||
//会员活动
|
||||
BigDecimal awardAmount= giveActivate(tbShopUser,memberIn.getAmount(),flow.getId());
|
||||
BigDecimal awardAmount = giveActivate(tbShopUser, memberIn.getAmount(), flow.getId());
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("shopId", memberIn.getShopId());
|
||||
jsonObject.put("type", "wxMemberIn");
|
||||
@@ -1240,14 +1308,13 @@ public class PayService {
|
||||
producer.putOrderCollect(jsonObject.toJSONString());
|
||||
|
||||
|
||||
|
||||
JSONObject baObj=new JSONObject();
|
||||
JSONObject baObj = new JSONObject();
|
||||
baObj.put("userId", tbShopUser.getUserId());
|
||||
baObj.put("shopId",tbShopUser.getShopId());
|
||||
baObj.put("amount",ObjectUtil.isNull(awardAmount)?memberIn.getAmount():memberIn.getAmount().add(awardAmount));
|
||||
baObj.put("balance",tbShopUser.getAmount());
|
||||
baObj.put("type","充值");
|
||||
baObj.put("time",flow.getCreateTime());
|
||||
baObj.put("shopId", tbShopUser.getShopId());
|
||||
baObj.put("amount", ObjectUtil.isNull(awardAmount) ? memberIn.getAmount() : memberIn.getAmount().add(awardAmount));
|
||||
baObj.put("balance", tbShopUser.getAmount());
|
||||
baObj.put("type", "充值");
|
||||
baObj.put("time", flow.getCreateTime());
|
||||
producer.balance(baObj.toString());
|
||||
|
||||
return "SUCCESS";
|
||||
@@ -1282,7 +1349,6 @@ public class PayService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Result paySongOrder(String openId, String shopId, Integer orderId, String ip, TbMerchantThirdApply thirdApply) throws JsonProcessingException {
|
||||
if (ObjectUtil.isEmpty(openId) || Objects.isNull(openId)) {
|
||||
return Result.fail("付款用户[openId]参数不能为空");
|
||||
|
||||
@@ -23,11 +23,11 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@Component
|
||||
public class WxAccountUtil {
|
||||
@Value("${wx.ysk.appId}")
|
||||
// @Value("${wx.ysk.appId}")
|
||||
private static String appId = "wx212769170d2c6b2a";
|
||||
@Value("${wx.ysk.secrete}")
|
||||
// @Value("${wx.ysk.secrete}")
|
||||
private static String secrete = "8492a7e8d55bbb1b57f5c8276ea1add0";
|
||||
@Value("${wx.ysk.warnMsgTmpId}")
|
||||
// @Value("${wx.ysk.warnMsgTmpId}")
|
||||
private static String msgTmpId = "C08OUr80x6wGmUN1zpFhSQ3Sv7VF5vksdZigiEx2pD0";
|
||||
|
||||
private final TbShopMsgStateMapper shopMsgStateMapper;
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
spring:
|
||||
datasource:
|
||||
# url: jdbc:mysql://121.40.128.145:3306/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
# username: root
|
||||
# password: mysqlroot@123
|
||||
url: jdbc:mysql://101.37.12.135:3306/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true
|
||||
username: fycashier
|
||||
password: Twc6MrzzjBiWSsjh
|
||||
url: jdbc:mysql://rm-bp1kn7h89nz62cno1ro.mysql.rds.aliyuncs.com:3306/fycashier_test?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true
|
||||
username: cashier
|
||||
password: Cashier@1@
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
initialSize: 5
|
||||
minIdle: 5
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://121.40.128.145:3306/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
username: root
|
||||
password: mysqlroot@123
|
||||
# 内网地址
|
||||
url: jdbc:mysql://rm-bp1kn7h89nz62cno1.mysql.rds.aliyuncs.com:3306/fycashier_pre?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true
|
||||
username: cashier
|
||||
password: Cashier@1@
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
initialSize: 5
|
||||
minIdle: 5
|
||||
@@ -15,7 +16,7 @@ spring:
|
||||
# redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突
|
||||
database: 0
|
||||
# redis服务器地址(默认为localhost)
|
||||
host: 101.37.12.135
|
||||
host: localhost
|
||||
# redis端口(默认为6379)
|
||||
port: 6379
|
||||
# redis访问密码(默认为空)
|
||||
@@ -33,12 +34,11 @@ spring:
|
||||
main:
|
||||
allow-circular-references: true
|
||||
rabbitmq:
|
||||
host: 101.37.12.135
|
||||
host: localhost
|
||||
port: 5672
|
||||
username: admin
|
||||
password: Czg666888
|
||||
|
||||
|
||||
mybatis:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
@@ -55,9 +55,12 @@ thirdPay:
|
||||
callFSTBack: https://wxcashiertest.sxczgkj.cn/cashierService/notify/notifyfstCallBack
|
||||
songOrderBack: https://wxcashiertest.sxczgkj.cn/cashierService/notify/songOrderCallBack
|
||||
server:
|
||||
port: 9889
|
||||
prod: devyhq
|
||||
queue: cart_queue_putdevyhq
|
||||
port: 9888
|
||||
prod: dev1
|
||||
queue: cart_queue_putdev1
|
||||
subscribe:
|
||||
message:
|
||||
miniprogramState: trial
|
||||
|
||||
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://121.40.128.145:3306/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
username: root
|
||||
password: mysqlroot@123
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
initialSize: 5
|
||||
minIdle: 5
|
||||
maxActive: 20
|
||||
maxWait: 60000
|
||||
logging:
|
||||
level:
|
||||
com.chaozhanggui.system.openness: info
|
||||
redis:
|
||||
# redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突
|
||||
database: 0
|
||||
# redis服务器地址(默认为localhost)
|
||||
host: 101.37.12.135
|
||||
# redis端口(默认为6379)
|
||||
port: 6379
|
||||
# redis访问密码(默认为空)
|
||||
password: 111111
|
||||
# redis连接超时时间(单位为毫秒)
|
||||
timeout: 1000
|
||||
block-when-exhausted: true
|
||||
# redis连接池配置
|
||||
jedis:
|
||||
pool:
|
||||
max-active: 8
|
||||
max-idle: 1024
|
||||
min-idle: 0
|
||||
max-wait: -1
|
||||
main:
|
||||
allow-circular-references: true
|
||||
rabbitmq:
|
||||
host: 101.37.12.135
|
||||
port: 5672
|
||||
username: admin
|
||||
password: Czg666888
|
||||
|
||||
mybatis:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
ysk:
|
||||
url: https://gatewaytestapi.sxczgkj.cn/gate-service/
|
||||
callBackurl: https://cashierapplet.sxczgkj.cn/cashierService/notify/notifyCallBack
|
||||
callBackGroupurl: https://cashierapplet.sxczgkj.cn/cashierService/notify/notifyCallBackGroup
|
||||
callBackIn: https://cashierapplet.sxczgkj.cn/cashierService/notify/memberInCallBack
|
||||
default: 18710449883
|
||||
|
||||
|
||||
@@ -24,7 +24,20 @@ wx:
|
||||
appId: wx212769170d2c6b2a
|
||||
secrete: 8492a7e8d55bbb1b57f5c8276ea1add0
|
||||
warnMsgTmpId: C08OUr80x6wGmUN1zpFhSQ3Sv7VF5vksdZigiEx2pD0
|
||||
|
||||
alipay:
|
||||
sdk:
|
||||
config:
|
||||
serverUrl: https://openapi.alipay.com/gateway.do
|
||||
appId: 2021004145625815
|
||||
privateKey: MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCAjDBuS8K/IJb9ui+KuNm/sTUdEiaji4BNpZ92avO1N5JpNlGmac6ec4p3tNFT950sBLcQkClcUpQxUHQzAT6DYNNXOKyvfI/EmcqwCw6PaMNLs/8cV//J2WWZBUhLaOsjKurpm9/3W5MnTh4BGxIfBoeBMA8f8K3BgKdmyKtvIEV2h2cyjsMskdn+g6oNZcmWcms0pvpPHyH46mRaGFhpp0v19wX3WsamGldh1L2VntmaDN3C2XbSrXv90XYp5bEUqwTbLwXpMAlzTibF56d/iqv9oYi8cpAKougUFLOymnbutLNs2tLrEDSFwHcmG2/wbZHybZyYcIgFgv4arf+tAgMBAAECggEAf7hKKlw1y6Z6vvAtalxNZUuRZSfyog3p1bwYWxTavZPQcZ7Zs0lvVDmiO1u5m/7q96BbryY9IhCeUv0H5uF2lhwu/3s9AEL3qTPQkeb6eXxyhhX6A9RfPdM1Qbtg4CQHdHKg4qjP9znSVHwmDZ0y/QaEvdPdQzPjv92u9c2tn4N4x6XyBYcU5gzxiJNnIugCmBgcJo/3H2fgV+XXEhORPvy5of9b4oATHEaLS/8dAS2wuOjhzaGS4MXp3VkXn3XaYjwSzaL03qYWA+xm+aO5sJv8bmqZW7sNVck5o3sPo7cQ4VkBFVzyrRdmJcxcSRJ9MsB9JsrhoKI8pgaXrVie4QKBgQDU2vai0lpBIK/0jzRpPNoqdT8lnafnnWni8nU4kfAh+gCLi+HBPhQRT0kv4unQc2q2/gALE7sgZVO00JGY5a3R0orsojPoUSZlpypGW7GGqKy576NHn0nw4o/PdfysT92VWgt1hlfTf6qfCDhfE9APU+RGvlSWXcT8nxVel3iUaQKBgQCamoJN6+4v+chJvL2nqV8NVVRLp0vDIHxs1QOtKwUodx8Qp1D6CJYtavCXn8aNUFVNQJPJ7TQPpJjXP2rI4SN01weDwx+I+wh8PBGHV6/234R+6TvFgY1PrYgCdfNP4i/E7B4uyEhAxdU73PB8qkqRAeJGok05p7oG71KCOBiYpQKBgEZfGflcuDAeAW5GRhqg3rP4zWa/R7qgZVh9tll8jjp9b96y4XFE99d9MgId8BVVgyt6sEL5Q/2C4ni+F9TH4n6jMADp42VkJuCmsqhOOlP9whU67+2G8Sgtj0QUivPg964f9ffl8XVgGOW5DwIIB9p5btggptCLscufQK5kP545AoGADBvf6tR4wl8w9b2HqTMV08iEIqzGvVC1Dh0c/Zop/EJgN4CzUfIMOSBwGaAVAApzs+pD6QPgGP2OTwWTioo/qa4R05sbxDHNN1XJFa2jhZV6HiqMWOrNs5jm1zJ/zRjtHuJTdtyO9CvKiLbESy9XScY4/8lEfSiK5HIoJzTXkFUCgYAkYkvkW6psJpWj05XWq44UN0n6QOU/Igl35Um/iuOMVhsTmIt09STQVTuzJzfH82+sCqoRsD1blE5unKNUC1DK77aNKTv3Z0dxN9R7FAyfZRiYQXTrbBPBqWjay6FCNxn8e8UsJN4Z6FIV2LGlQI114krSap1MALKLVvnld0NaUQ==
|
||||
alipayPublicKey: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiQkrz+emAuS1mB3KKDOMmAZRd/BlPbh7fAIHAqAj1+QCZNcV3o2BTLIIqnuKpSlFXDG3uDzp2VsBxcizXuBbFyPGylnD9CgCj5abyh3+FIHPAZ2IM3TtpqImZ0TSPGXrMli4Nir7MvZktgccCqQKCC4o6iaDGz+UwWwJUIPna8fm2tiTZ+KH150CZbKVj4ZGNpBh5XSV/1dRgyQIV9D/EwSbkZ0n6VgKQLJBi0C2UE3QB17aL1Ir6+gDXIDbknN8O7GUD3aMGdThYdSRUb5wp9CZ5qfV7vCS/CgaRo38nhH3NOzkTL+7v0m1ZDHPmqEkn9VzZN6sCQdL7PoAOjHOCwIDAQAB
|
||||
encryptKey: Hp1TbhOqevbHCA5ji/VlqQ==
|
||||
decorator:
|
||||
datasource:
|
||||
p6spy:
|
||||
logging: file
|
||||
log-file: spy.log
|
||||
log-format: executionTime:%(executionTime) ms | sql:%(sqlSingleLine)
|
||||
#
|
||||
spring:
|
||||
profiles:
|
||||
@@ -55,7 +68,7 @@ logging:
|
||||
# web日志
|
||||
org.springframework.web: debug
|
||||
# mybatis日志
|
||||
org.mybatis: debug
|
||||
org.apache.ibatis: debug
|
||||
charset:
|
||||
# 输出控制台编码
|
||||
console: UTF-8
|
||||
|
||||
@@ -11,13 +11,14 @@
|
||||
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
|
||||
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
|
||||
<result column="small_appid" jdbcType="VARCHAR" property="smallAppid" />
|
||||
<result column="alipay_small_appid" jdbcType="VARCHAR" property="alipaySmallAppid" />
|
||||
<result column="store_id" jdbcType="VARCHAR" property="storeId" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.system.cashierservice.entity.TbMerchantThirdApply">
|
||||
<result column="app_token" jdbcType="LONGVARCHAR" property="appToken" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, type, app_id, status, pay_password, applyment_state, created_at, updated_at,small_appid,store_id
|
||||
id, type, app_id, status, pay_password, applyment_state, created_at, updated_at,small_appid,alipay_small_appid,store_id
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
app_token
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</select>
|
||||
<select id="selectAllAndSearch" resultType="com.chaozhanggui.system.cashierservice.entity.TbShopSong">
|
||||
select *
|
||||
from fycashier.tb_shop_song where shop_id=#{shopId}
|
||||
from tb_shop_song where shop_id=#{shopId}
|
||||
and status=1
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and name like CONCAT('%',#{keyWord},'%')
|
||||
|
||||
Reference in New Issue
Block a user