未知的修改功能
This commit is contained in:
@@ -50,7 +50,8 @@ public class LoginFilter implements Filter {
|
|||||||
"cashierService/product/productInfo",
|
"cashierService/product/productInfo",
|
||||||
"cashierService/notify/**",//登录部分接口不校验
|
"cashierService/notify/**",//登录部分接口不校验
|
||||||
"notify/**",
|
"notify/**",
|
||||||
"cashierService/table/**"//回调部分接口不校验
|
"cashierService/table/**",//回调部分接口不校验
|
||||||
|
"cashierService/pay/**"
|
||||||
);
|
);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@@ -1,20 +1,17 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.controller;
|
package com.chaozhanggui.system.cashierservice.controller;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.dto.ReturnGroupOrderDto;
|
|
||||||
import com.chaozhanggui.system.cashierservice.service.PayService;
|
import com.chaozhanggui.system.cashierservice.service.PayService;
|
||||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||||
import com.chaozhanggui.system.cashierservice.util.IpUtil;
|
import com.chaozhanggui.system.cashierservice.util.IpUtil;
|
||||||
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
|
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
@@ -31,19 +28,18 @@ public class PayController {
|
|||||||
/**
|
/**
|
||||||
* 支付
|
* 支付
|
||||||
*
|
*
|
||||||
* @param request
|
* @param request payType wechatPay:微信支付;aliPay:支付宝支付;
|
||||||
* payType wechatPay:微信支付;aliPay:支付宝支付;
|
|
||||||
* @param map
|
* @param map
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping("orderPay")
|
@RequestMapping("orderPay")
|
||||||
public Result pay(HttpServletRequest request, @RequestHeader("openId") String openId, @RequestBody Map<String,String> map) {
|
public Result pay(HttpServletRequest request, @RequestHeader("openId") String openId, @RequestBody Map<String, String> map) {
|
||||||
if(ObjectUtil.isEmpty(map)||map.size()<=0||!map.containsKey("orderId")||ObjectUtil.isEmpty(map.get("orderId"))){
|
if (ObjectUtil.isEmpty(map) || map.size() <= 0 || !map.containsKey("orderId") || ObjectUtil.isEmpty(map.get("orderId"))) {
|
||||||
return Result.fail("订单号不允许为空");
|
return Result.fail("订单号不允许为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return payService.payOrder(openId,map.get("orderId").toString(), IpUtil.getIpAddr(request));
|
return payService.payOrder(openId, map.get("orderId"), IpUtil.getIpAddr(request));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -51,10 +47,9 @@ public class PayController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 储值卡支付
|
* 储值卡支付
|
||||||
|
*
|
||||||
* @param token
|
* @param token
|
||||||
* @param orderId
|
* @param orderId
|
||||||
* @param memberId
|
* @param memberId
|
||||||
@@ -64,26 +59,26 @@ public class PayController {
|
|||||||
public Result accountPay(@RequestHeader("token") String token,
|
public Result accountPay(@RequestHeader("token") String token,
|
||||||
@RequestParam("orderId") String orderId,
|
@RequestParam("orderId") String orderId,
|
||||||
@RequestParam("memberId") String memberId
|
@RequestParam("memberId") String memberId
|
||||||
){
|
) {
|
||||||
return payService.accountPay(orderId,memberId,token);
|
return payService.accountPay(orderId, memberId, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("groupOrderPay")
|
@RequestMapping("groupOrderPay")
|
||||||
public Result groupOrderPay(HttpServletRequest request, @RequestHeader String environment,@RequestHeader String token, @RequestBody Map<String, String> map) {
|
public Result groupOrderPay(HttpServletRequest request, @RequestHeader String environment, @RequestHeader String token, @RequestBody Map<String, String> map) {
|
||||||
if (ObjectUtil.isEmpty(map) || map.size() <= 0 || !map.containsKey("orderId") || ObjectUtil.isEmpty(map.get("orderId"))) {
|
if (ObjectUtil.isEmpty(map) || map.size() <= 0 || !map.containsKey("orderId") || ObjectUtil.isEmpty(map.get("orderId"))) {
|
||||||
return Result.fail("订单号不允许为空");
|
return Result.fail("订单号不允许为空");
|
||||||
}
|
}
|
||||||
String orderId = map.get("orderId").toString();
|
String orderId = map.get("orderId");
|
||||||
// String orderType = map.get("orderType").toString();
|
// String orderType = map.get("orderType").toString();
|
||||||
String payType = map.get("payType").toString();
|
String payType = map.get("payType");
|
||||||
String userId="";
|
String userId = "";
|
||||||
if(environment.equals("wx")){
|
if (environment.equals("wx")) {
|
||||||
userId = TokenUtil.parseParamFromToken(token).getString("openId");
|
userId = TokenUtil.parseParamFromToken(token).getString("openId");
|
||||||
}else {
|
} else {
|
||||||
userId = TokenUtil.parseParamFromToken(token).getString("userId");
|
userId = TokenUtil.parseParamFromToken(token).getString("userId");
|
||||||
}
|
}
|
||||||
//订单支付 orderId:62,payType=wechatPay,userId:or1l860rwM-rU_j9KrgMOwued
|
//订单支付 orderId:62,payType=wechatPay,userId:or1l860rwM-rU_j9KrgMOwued
|
||||||
log.info("订单支付 orderId:{},payType={},userId:{}",orderId,payType,userId);
|
log.info("订单支付 orderId:{},payType={},userId:{}", orderId, payType, userId);
|
||||||
try {
|
try {
|
||||||
// if(StringUtils.isNotBlank(orderType) && orderType.equals("group")){
|
// if(StringUtils.isNotBlank(orderType) && orderType.equals("group")){
|
||||||
// return payService.groupOrderPay(orderId, payType, userId, IpUtil.getIpAddr(request));
|
// return payService.groupOrderPay(orderId, payType, userId, IpUtil.getIpAddr(request));
|
||||||
@@ -132,8 +127,8 @@ public class PayController {
|
|||||||
@RequestHeader("token") String token,
|
@RequestHeader("token") String token,
|
||||||
@RequestParam("shopId") String shopId,
|
@RequestParam("shopId") String shopId,
|
||||||
@RequestParam("page") int page,
|
@RequestParam("page") int page,
|
||||||
@RequestParam("pageSize") int pageSize){
|
@RequestParam("pageSize") int pageSize) {
|
||||||
return payService.getActivate(shopId,page,pageSize);
|
return payService.getActivate(shopId, page, pageSize);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +144,22 @@ public class PayController {
|
|||||||
public Result memeberIn(HttpServletRequest request, @RequestHeader("openId") String openId, @RequestHeader("id") String id,
|
public Result memeberIn(HttpServletRequest request, @RequestHeader("openId") String openId, @RequestHeader("id") String id,
|
||||||
@RequestBody Map<String, Object> map
|
@RequestBody Map<String, Object> map
|
||||||
) {
|
) {
|
||||||
return payService.memberIn(openId, id, map.get("amount").toString(), map.get("shopId").toString(), IpUtil.getIpAddr(request));
|
try {
|
||||||
|
return payService.memberIn(openId, id, map.get("amount").toString(), map.get("shopId").toString(), IpUtil.getIpAddr(request));
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("getShopByMember")
|
||||||
|
public Result getShopByMember(@RequestHeader("token") String token,
|
||||||
|
@RequestParam("page") int page,
|
||||||
|
@RequestParam("pageSize") int pageSize,
|
||||||
|
@RequestParam("userId") String userId,
|
||||||
|
@RequestParam("shopId") String shopId
|
||||||
|
) {
|
||||||
|
return payService.getShopByMember(userId,shopId,page,pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.dao;
|
package com.chaozhanggui.system.cashierservice.dao;
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbMerchantAccount;
|
import com.chaozhanggui.system.cashierservice.entity.TbMerchantAccount;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@Mapper
|
||||||
public interface TbMerchantAccountMapper {
|
public interface TbMerchantAccountMapper {
|
||||||
|
|
||||||
TbMerchantAccount selectByAccount(String account);
|
TbMerchantAccount selectByAccount(String account);
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TbShopUserMapper {
|
public interface TbShopUserMapper {
|
||||||
@@ -25,7 +28,7 @@ public interface TbShopUserMapper {
|
|||||||
TbShopUser selectByUserIdAndShopId(@Param("userId") String userId,@Param("shopId") String shopId);
|
TbShopUser selectByUserIdAndShopId(@Param("userId") String userId,@Param("shopId") String shopId);
|
||||||
|
|
||||||
|
|
||||||
TbShopUser selectByUserId(@Param("userId") String userId);
|
List<Map<String,Object>> selectByUserId(@Param("userId") String userId,@Param("shopId") String shopId);
|
||||||
|
|
||||||
TbShopUser selectByOpenId(@Param("openId") String openId);
|
TbShopUser selectByOpenId(@Param("openId") String openId);
|
||||||
|
|
||||||
|
|||||||
@@ -45,9 +45,6 @@ public class TbShopUser implements Serializable {
|
|||||||
|
|
||||||
private String dynamicCode;
|
private String dynamicCode;
|
||||||
|
|
||||||
private String isPwd;
|
|
||||||
|
|
||||||
private String pwd;
|
|
||||||
|
|
||||||
private Byte isAttention;
|
private Byte isAttention;
|
||||||
|
|
||||||
@@ -229,21 +226,6 @@ public class TbShopUser implements Serializable {
|
|||||||
this.dynamicCode = dynamicCode;
|
this.dynamicCode = dynamicCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIsPwd() {
|
|
||||||
return isPwd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsPwd(String isPwd) {
|
|
||||||
this.isPwd = isPwd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPwd() {
|
|
||||||
return pwd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPwd(String pwd) {
|
|
||||||
this.pwd = pwd;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Byte getIsAttention() {
|
public Byte getIsAttention() {
|
||||||
return isAttention;
|
return isAttention;
|
||||||
|
|||||||
@@ -99,6 +99,15 @@ public class TbUserInfo implements Serializable {
|
|||||||
|
|
||||||
private String phone="";
|
private String phone="";
|
||||||
|
|
||||||
|
|
||||||
|
private String isPwd;
|
||||||
|
|
||||||
|
private String pwd;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getPhone() {
|
public String getPhone() {
|
||||||
return phone;
|
return phone;
|
||||||
}
|
}
|
||||||
@@ -484,4 +493,20 @@ public class TbUserInfo implements Serializable {
|
|||||||
public void setPassword(String password) {
|
public void setPassword(String password) {
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getIsPwd() {
|
||||||
|
return isPwd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsPwd(String isPwd) {
|
||||||
|
this.isPwd = isPwd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPwd() {
|
||||||
|
return pwd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPwd(String pwd) {
|
||||||
|
this.pwd = pwd;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -77,6 +77,8 @@ public class LoginService {
|
|||||||
userInfo.setSourcePath("WECHAT-APP");
|
userInfo.setSourcePath("WECHAT-APP");
|
||||||
userInfo.setIsAttentionMp(Byte.parseByte("0"));
|
userInfo.setIsAttentionMp(Byte.parseByte("0"));
|
||||||
userInfo.setSearchWord("||微信用户");
|
userInfo.setSearchWord("||微信用户");
|
||||||
|
userInfo.setIsPwd("0");
|
||||||
|
userInfo.setPwd(MD5Utils.md5("123456"));
|
||||||
userInfo.setLastLogInAt(System.currentTimeMillis());
|
userInfo.setLastLogInAt(System.currentTimeMillis());
|
||||||
userInfo.setCreatedAt(System.currentTimeMillis());
|
userInfo.setCreatedAt(System.currentTimeMillis());
|
||||||
userInfo.setUpdatedAt(System.currentTimeMillis());
|
userInfo.setUpdatedAt(System.currentTimeMillis());
|
||||||
@@ -276,8 +278,7 @@ public class LoginService {
|
|||||||
public Result resetPwd(String userId,Map<String,Object> map){
|
public Result resetPwd(String userId,Map<String,Object> map){
|
||||||
if(ObjectUtil.isNull(map)||ObjectUtil.isEmpty(map)||!map.containsKey("pwd")
|
if(ObjectUtil.isNull(map)||ObjectUtil.isEmpty(map)||!map.containsKey("pwd")
|
||||||
||ObjectUtil.isEmpty(map.get("pwd"))||!map.containsKey("code")
|
||ObjectUtil.isEmpty(map.get("pwd"))||!map.containsKey("code")
|
||||||
||ObjectUtil.isEmpty(map.get("code"))||
|
||ObjectUtil.isEmpty(map.get("code"))
|
||||||
!map.containsKey("shopId")||ObjectUtil.isEmpty(map.get("shopId"))
|
|
||||||
){
|
){
|
||||||
return Result.fail("参数错误");
|
return Result.fail("参数错误");
|
||||||
}
|
}
|
||||||
@@ -289,16 +290,10 @@ public class LoginService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TbShopUser user=tbShopUserMapper.selectByUserIdAndShopId(userId,map.get("shopId").toString());
|
userInfo.setIsPwd("1");
|
||||||
if(ObjectUtil.isEmpty(user)||ObjectUtil.isNull(user)){
|
userInfo.setPwd(MD5Utils.md5(map.get("pwd").toString()));
|
||||||
return Result.fail("店铺用户信息不存在");
|
userInfo.setUpdatedAt(System.currentTimeMillis());
|
||||||
}
|
tbUserInfoMapper.updateByPrimaryKey(userInfo);
|
||||||
|
|
||||||
|
|
||||||
user.setIsPwd("1");
|
|
||||||
user.setPwd(MD5Utils.md5(map.get("pwd").toString()));
|
|
||||||
user.setUpdatedAt(System.currentTimeMillis());
|
|
||||||
tbShopUserMapper.updateByPrimaryKey(user);
|
|
||||||
|
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
return Result.success(CodeEnum.SUCCESS);
|
||||||
|
|
||||||
@@ -309,26 +304,25 @@ public class LoginService {
|
|||||||
public Result modifyPwd(String userId,Map<String,Object> map){
|
public Result modifyPwd(String userId,Map<String,Object> map){
|
||||||
if(ObjectUtil.isNull(map)||ObjectUtil.isEmpty(map)||!map.containsKey("pwd")
|
if(ObjectUtil.isNull(map)||ObjectUtil.isEmpty(map)||!map.containsKey("pwd")
|
||||||
||ObjectUtil.isEmpty(map.get("pwd"))||!map.containsKey("oldpwd")
|
||ObjectUtil.isEmpty(map.get("pwd"))||!map.containsKey("oldpwd")
|
||||||
||ObjectUtil.isEmpty(map.get("oldpwd"))||
|
||ObjectUtil.isEmpty(map.get("oldpwd"))
|
||||||
!map.containsKey("shopId")||ObjectUtil.isEmpty(map.get("shopId"))
|
|
||||||
){
|
){
|
||||||
return Result.fail("参数错误");
|
return Result.fail("参数错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
TbShopUser user=tbShopUserMapper.selectByUserIdAndShopId(userId,map.get("shopId").toString());
|
TbUserInfo userInfo=tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));
|
||||||
if(ObjectUtil.isEmpty(user)||ObjectUtil.isNull(user)){
|
if(ObjectUtil.isEmpty(userInfo)||ObjectUtil.isNull(userInfo)){
|
||||||
return Result.fail("店铺用户信息不存在");
|
return Result.fail("用户基本信息不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!user.getPwd().equals(MD5Utils.md5(map.get("oldpwd").toString()))){
|
if(!userInfo.getPwd().equals(MD5Utils.md5(map.get("oldpwd").toString()))){
|
||||||
return Result.fail("用户旧密码错误");
|
return Result.fail("用户旧密码错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
user.setIsPwd("1");
|
userInfo.setIsPwd("1");
|
||||||
user.setPwd(MD5Utils.md5(map.get("pwd").toString()));
|
userInfo.setPwd(MD5Utils.md5(map.get("pwd").toString()));
|
||||||
user.setUpdatedAt(System.currentTimeMillis());
|
userInfo.setUpdatedAt(System.currentTimeMillis());
|
||||||
tbShopUserMapper.updateByPrimaryKey(user);
|
tbUserInfoMapper.updateByPrimaryKey(userInfo);
|
||||||
|
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
return Result.success(CodeEnum.SUCCESS);
|
||||||
|
|
||||||
|
|||||||
@@ -125,6 +125,9 @@ public class PayService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
ThirdPayService thirdPayService;
|
ThirdPayService thirdPayService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
TbUserInfoMapper tbUserInfoMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
@@ -715,11 +718,15 @@ public class PayService {
|
|||||||
|
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Result memberIn(String openId,String userId,String amount,String shopId,String ip){
|
public Result memberIn(String openId,String userId,String amount,String shopId,String ip) throws JsonProcessingException {
|
||||||
if(ObjectUtil.isEmpty(openId)||ObjectUtil.isEmpty(userId)){
|
if(ObjectUtil.isEmpty(openId)||ObjectUtil.isEmpty(userId)){
|
||||||
return Result.fail("用户信息允许为空");
|
return Result.fail("用户信息允许为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TbUserInfo userInfo= tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));
|
||||||
|
if(ObjectUtil.isEmpty(userInfo)){
|
||||||
|
return Result.fail("用户基本信息不存在");
|
||||||
|
}
|
||||||
|
|
||||||
TbShopUser tbShopUser= tbShopUserMapper.selectByUserIdAndShopId(userId,shopId);
|
TbShopUser tbShopUser= tbShopUserMapper.selectByUserIdAndShopId(userId,shopId);
|
||||||
if(ObjectUtil.isEmpty(tbShopUser)){
|
if(ObjectUtil.isEmpty(tbShopUser)){
|
||||||
@@ -727,7 +734,7 @@ public class PayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if("0".equals(tbShopUser.getIsPwd())){
|
if("0".equals(userInfo.getIsPwd())){
|
||||||
return Result.fail("用户支付密码未设置");
|
return Result.fail("用户支付密码未设置");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -789,18 +796,19 @@ public class PayService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
PublicResp<WxScanPayResp> publicResp= thirdPayService.scanpay(thirdUrl,thirdApply.getAppId(),"会员充值","会员充值",new BigDecimal(amount).setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(),"WECHAT",thirdApply.getSmallAppid(),userId,ip, DateUtils.getsdfTimesSS(),thirdApply.getStoreId(),callInBack,null,thirdApply.getAppToken());
|
String orderNo=DateUtils.getsdfTimesSS();
|
||||||
|
PublicResp<WxScanPayResp> publicResp= thirdPayService.scanpay(thirdUrl,thirdApply.getAppId(),"会员充值","会员充值",new BigDecimal(amount).setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(),"WECHAT",thirdApply.getSmallAppid(),openId,ip, orderNo,thirdApply.getStoreId(),callInBack,null,thirdApply.getAppToken());
|
||||||
if(ObjectUtil.isNotNull(publicResp)&&ObjectUtil.isNotEmpty(publicResp)){
|
if(ObjectUtil.isNotNull(publicResp)&&ObjectUtil.isNotEmpty(publicResp)){
|
||||||
if("000000".equals(publicResp.getCode())){
|
if("000000".equals(publicResp.getCode())){
|
||||||
WxScanPayResp wxScanPayResp= publicResp.getObjData();
|
WxScanPayResp wxScanPayResp= publicResp.getObjData();
|
||||||
if("TRADE_SUCCESS".equals(wxScanPayResp.getState())){
|
if("TRADE_AWAIT".equals(wxScanPayResp.getState())){
|
||||||
|
|
||||||
memberIn.setOrderNo(wxScanPayResp.getPayOrderId());
|
memberIn.setOrderNo(orderNo);
|
||||||
|
memberIn.setTradeNo(wxScanPayResp.getPayOrderId());
|
||||||
memberIn.setUpdateTime(new Date());
|
memberIn.setUpdateTime(new Date());
|
||||||
tbMemberInMapper.updateByPrimaryKeySelective(memberIn);
|
tbMemberInMapper.updateByPrimaryKeySelective(memberIn);
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
return Result.success(CodeEnum.SUCCESS,wxScanPayResp.getPayInfo());
|
return Result.success(CodeEnum.SUCCESS,mapper.readTree(wxScanPayResp.getPayInfo()));
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
return Result.fail(publicResp.getMsg());
|
return Result.fail(publicResp.getMsg());
|
||||||
@@ -936,6 +944,15 @@ public class PayService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public Result getShopByMember(String userId,String shopId,int page,int pageSize){
|
||||||
|
PageHelper.startPage(page, pageSize);
|
||||||
|
List<Map<String,Object>> list= tbShopUserMapper.selectByUserId(userId,shopId);
|
||||||
|
PageInfo pageInfo=new PageInfo(list);
|
||||||
|
return Result.success(CodeEnum.SUCCESS,pageInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1040,6 +1057,10 @@ public class PayService {
|
|||||||
return "充值记录不存在";
|
return "充值记录不存在";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!"7".equals(memberIn.getStatus())){
|
||||||
|
return "订单已处理";
|
||||||
|
}
|
||||||
|
|
||||||
memberIn.setTradeNo(tradeNo);
|
memberIn.setTradeNo(tradeNo);
|
||||||
memberIn.setStatus("0");
|
memberIn.setStatus("0");
|
||||||
memberIn.setUpdateTime(new Date());
|
memberIn.setUpdateTime(new Date());
|
||||||
@@ -1051,6 +1072,7 @@ public class PayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!"1".equals(tbShopUser.getIsVip().toString())){
|
if(!"1".equals(tbShopUser.getIsVip().toString())){
|
||||||
|
tbShopUser.setCode(DateUtils.getsdfTimesSS());
|
||||||
tbShopUser.setIsVip(Byte.parseByte("1"));
|
tbShopUser.setIsVip(Byte.parseByte("1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,8 +83,6 @@ public class ProductService {
|
|||||||
tbShopUser.setShopId(shopId);
|
tbShopUser.setShopId(shopId);
|
||||||
tbShopUser.setUserId(userId);
|
tbShopUser.setUserId(userId);
|
||||||
tbShopUser.setMiniOpenId(openId);
|
tbShopUser.setMiniOpenId(openId);
|
||||||
tbShopUser.setPwd(MD5Util.encrypt("123456"));
|
|
||||||
tbShopUser.setIsPwd("0");
|
|
||||||
tbShopUser.setCreatedAt(System.currentTimeMillis());
|
tbShopUser.setCreatedAt(System.currentTimeMillis());
|
||||||
tbShopUser.setUpdatedAt(System.currentTimeMillis());
|
tbShopUser.setUpdatedAt(System.currentTimeMillis());
|
||||||
tbShopUserMapper.insert(tbShopUser);
|
tbShopUserMapper.insert(tbShopUser);
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ public class ThirdPayService {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public PublicResp<WxScanPayResp> scanpay(String url,String appId, String subject, String body, Long amount,String payType, String subAppId, String userId,
|
public PublicResp<WxScanPayResp> scanpay(String url,String appId, String subject, String body, Long amount,String payType, String subAppId, String userId,
|
||||||
|
|
||||||
String clinetIp,String orderNo, String storeId, String notifyUrl,String returnUrl,
|
String clinetIp,String orderNo, String storeId, String notifyUrl,String returnUrl,
|
||||||
String key){
|
String key){
|
||||||
WxScanPayReq scanPayReq=new WxScanPayReq(subject,body,amount,"cny",payType,subAppId,userId,clinetIp,orderNo,storeId,notifyUrl,returnUrl);
|
WxScanPayReq scanPayReq=new WxScanPayReq(subject,body,amount,"cny",payType,subAppId,userId,clinetIp,orderNo,storeId,notifyUrl,returnUrl);
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectByAmount" resultMap="BaseResultMap">
|
<select id="selectByAmount" resultMap="BaseResultMap">
|
||||||
select * from tb_activate where shop_id=#{shopId} and is_del=0 and min_num <= #{amount} and max_num >={amount}
|
select * from tb_activate where shop_id=#{shopId} and is_del=0 and min_num <= #{amount} and max_num >= #{amount}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByShpopId" resultMap="BaseResultMap">
|
<select id="selectByShpopId" resultMap="BaseResultMap">
|
||||||
|
|||||||
@@ -380,13 +380,30 @@
|
|||||||
select * from tb_shop_user where user_id=#{userId} and shop_id=#{shopId}
|
select * from tb_shop_user where user_id=#{userId} and shop_id=#{shopId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByUserId" resultMap="BaseResultMap">
|
|
||||||
select * from tb_shop_user where user_id=#{userId}
|
|
||||||
</select>
|
|
||||||
<select id="selectByOpenId" resultType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
<select id="selectByOpenId" resultType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
||||||
select * from tb_shop_user where mini_open_id = #{openId}
|
select * from tb_shop_user where mini_open_id = #{openId}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectParams" resultType="com.chaozhanggui.system.cashierservice.entity.TbParams">
|
<select id="selectParams" resultType="com.chaozhanggui.system.cashierservice.entity.TbParams">
|
||||||
select * from tb_params where id = 1
|
select * from tb_params where id = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByUserId" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
i.id as shopId,
|
||||||
|
i.shop_name as shopName,
|
||||||
|
i.chain_name as chainName,
|
||||||
|
i.logo,
|
||||||
|
i.detail,
|
||||||
|
u.amount,
|
||||||
|
u.`code`,
|
||||||
|
u.is_vip
|
||||||
|
FROM
|
||||||
|
tb_shop_user u
|
||||||
|
left join tb_shop_info i on u.shop_id=i.id
|
||||||
|
WHERE
|
||||||
|
u.user_id = #{userId}
|
||||||
|
<if test="shopId != null and shopId !=''">
|
||||||
|
and shop_id = #{shopId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user