Merge remote-tracking branch 'origin/lyf' into lyf
This commit is contained in:
commit
2f84bed116
|
|
@ -217,21 +217,20 @@ public class LoginContoller {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// /**
|
/**
|
||||||
// * 获取会员码
|
* 获取会员码
|
||||||
// *
|
*
|
||||||
// * @param openId
|
* @param openId
|
||||||
// * @param token
|
* @param token
|
||||||
// * @param id
|
* @param id
|
||||||
// * @return
|
* @return
|
||||||
// */
|
*/
|
||||||
// @GetMapping("createCardNo")
|
@GetMapping("createCardNo")
|
||||||
// public Result createCardNo(@RequestHeader("openId") String openId, @RequestHeader("token") String token, @RequestHeader("id") String id,
|
public Result createCardNo(@RequestHeader("openId") String openId, @RequestHeader("token") String token, @RequestHeader("id") String id,
|
||||||
//
|
@RequestParam("shopId") String shopId
|
||||||
// @RequestParam("shopId") String shopId
|
) {
|
||||||
// ) {
|
return loginService.createCardNo(id, openId,shopId);
|
||||||
// return loginService.createCardNo(id, openId,shopId);
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
@GetMapping("/userInfo")
|
@GetMapping("/userInfo")
|
||||||
public Result userInfo(@RequestParam("userId") Integer userId) {
|
public Result userInfo(@RequestParam("userId") Integer userId) {
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,13 @@ public class NotifyController {
|
||||||
Map<String, Object> map= getParameterMap(request);
|
Map<String, Object> map= getParameterMap(request);
|
||||||
log.info("fstmemberInCallBack回调返回信息:{}",JSONUtil.toJsonStr(map));
|
log.info("fstmemberInCallBack回调返回信息:{}",JSONUtil.toJsonStr(map));
|
||||||
if(ObjectUtil.isNotEmpty(map)&&map.containsKey("code")&&"000000".equals(map.get("code")+"")){
|
if(ObjectUtil.isNotEmpty(map)&&map.containsKey("code")&&"000000".equals(map.get("code")+"")){
|
||||||
Map<String,Object> object=(Map)map.get("bizData");
|
// Map<String,Object> object=(Map)map.get("bizData");
|
||||||
|
|
||||||
|
JSONObject object=JSONUtil.parseObj(map.get("bizData").toString());
|
||||||
if(ObjectUtil.isNotEmpty(object)&&object.containsKey("state")){
|
if(ObjectUtil.isNotEmpty(object)&&object.containsKey("state")){
|
||||||
if("TRADE_SUCCESS".equals(object.get("state").toString())){
|
if("TRADE_SUCCESS".equals(object.get("state").toString())){
|
||||||
String orderNo=map.get("mchOrderNo").toString();
|
String orderNo=object.get("mchOrderNo").toString();
|
||||||
String tradeNo=map.get("payOrderId").toString();
|
String tradeNo=object.get("payOrderId").toString();
|
||||||
return payService.fstMemberInSuccess(orderNo,tradeNo);
|
return payService.fstMemberInSuccess(orderNo,tradeNo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -90,11 +92,12 @@ public class NotifyController {
|
||||||
Map<String, Object> map= getParameterMap(request);
|
Map<String, Object> map= getParameterMap(request);
|
||||||
log.info("notifyfstCallBack回调返回信息:{}",JSONUtil.toJsonStr(map));
|
log.info("notifyfstCallBack回调返回信息:{}",JSONUtil.toJsonStr(map));
|
||||||
if(ObjectUtil.isNotEmpty(map)&&map.containsKey("code")&&"000000".equals(map.get("code")+"")){
|
if(ObjectUtil.isNotEmpty(map)&&map.containsKey("code")&&"000000".equals(map.get("code")+"")){
|
||||||
Map<String,Object> object=(Map)map.get("bizData");
|
|
||||||
|
JSONObject object=JSONUtil.parseObj(map.get("bizData").toString());
|
||||||
if(ObjectUtil.isNotEmpty(object)&&object.containsKey("state")){
|
if(ObjectUtil.isNotEmpty(object)&&object.containsKey("state")){
|
||||||
if("TRADE_SUCCESS".equals(object.get("state").toString())){
|
if("TRADE_SUCCESS".equals(object.get("state").toString())){
|
||||||
String orderNo=map.get("mchOrderNo").toString();
|
String orderNo=object.get("mchOrderNo").toString();
|
||||||
String tradeNo=map.get("payOrderId").toString();
|
String tradeNo=object.get("payOrderId").toString();
|
||||||
return payService.callBackPayFST(tradeNo);
|
return payService.callBackPayFST(tradeNo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,16 @@ public class PayController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("getActive")
|
||||||
|
public Result getActive(
|
||||||
|
@RequestHeader("token") String token,
|
||||||
|
@RequestParam("shopId") String shopId,
|
||||||
|
@RequestParam("page") int page,
|
||||||
|
@RequestParam("pageSize") int pageSize){
|
||||||
|
return payService.getActivate(shopId,page,pageSize);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值
|
* 充值
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|
@ -23,4 +24,6 @@ public interface TbActivateMapper {
|
||||||
int updateByPrimaryKey(TbActivate record);
|
int updateByPrimaryKey(TbActivate record);
|
||||||
|
|
||||||
TbActivate selectByAmount(@Param("shopId") String shopId,@Param("amount") BigDecimal amount);
|
TbActivate selectByAmount(@Param("shopId") String shopId,@Param("amount") BigDecimal amount);
|
||||||
|
|
||||||
|
List<TbActivate> selectByShpopId(String shopId);
|
||||||
}
|
}
|
||||||
|
|
@ -24,6 +24,8 @@ import com.chaozhanggui.system.cashierservice.thirdpay.service.ThirdPayService;
|
||||||
import com.chaozhanggui.system.cashierservice.util.*;
|
import com.chaozhanggui.system.cashierservice.util.*;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
@ -114,8 +116,11 @@ public class PayService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Value("${thirdPay.callBack}")
|
@Value("${thirdPay.callInBack}")
|
||||||
private String callBack;
|
private String callInBack;
|
||||||
|
|
||||||
|
@Value("${thirdPay.callFSTBack}")
|
||||||
|
private String callFSTBack;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ThirdPayService thirdPayService;
|
ThirdPayService thirdPayService;
|
||||||
|
|
@ -240,7 +245,7 @@ public class PayService {
|
||||||
reqbody=body.toString();
|
reqbody=body.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
PublicResp<WxScanPayResp> publicResp= thirdPayService.scanpay(thirdUrl,thirdApply.getAppId(),reqbody,reqbody,payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(),"WECHAT",thirdApply.getSmallAppid(),openId,ip,DateUtils.getsdfTimesSS(),thirdApply.getStoreId(),callBack,null,thirdApply.getAppToken());
|
PublicResp<WxScanPayResp> publicResp= thirdPayService.scanpay(thirdUrl,thirdApply.getAppId(),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());
|
||||||
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();
|
||||||
|
|
@ -784,7 +789,7 @@ 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(),callBack,null,thirdApply.getAppToken());
|
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());
|
||||||
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();
|
||||||
|
|
@ -921,6 +926,18 @@ public class PayService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Result getActivate(String shopId,int page ,int pageSize){
|
||||||
|
PageHelper.startPage(page, pageSize);
|
||||||
|
List<TbActivate> list=tbActivateMapper.selectByShpopId(shopId);
|
||||||
|
PageInfo pageInfo=new PageInfo(list);
|
||||||
|
return Result.success(CodeEnum.SUCCESS,pageInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成长度为12的随机串
|
* 生成长度为12的随机串
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ ysk:
|
||||||
callBackIn: https://p40312246f.goho.co/cashierService/notify/memberInCallBack
|
callBackIn: https://p40312246f.goho.co/cashierService/notify/memberInCallBack
|
||||||
default: 18710449883
|
default: 18710449883
|
||||||
server:
|
server:
|
||||||
port: 9888
|
port: 9889
|
||||||
prod: dev1
|
prod: dev1
|
||||||
queue: cart_queue_putdev1
|
queue: cart_queue_putdev1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,5 +57,6 @@ aliyun:
|
||||||
|
|
||||||
thirdPay:
|
thirdPay:
|
||||||
payType: fushangtong
|
payType: fushangtong
|
||||||
callBack: https://cashierclient.sxczgkj.cn${server.servlet.context-path}notify/fstmemberInCallBack
|
callInBack: https://wxcashiertest.sxczgkj.cn${server.servlet.context-path}notify/fstmemberInCallBack
|
||||||
|
callFSTBack: https://wxcashiertest.sxczgkj.cn${server.servlet.context-path}notify/notifyfstCallBack
|
||||||
url: https://paymentapi.sxczgkj.cn
|
url: https://paymentapi.sxczgkj.cn
|
||||||
|
|
|
||||||
|
|
@ -118,4 +118,8 @@
|
||||||
<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 * from tb_activate where shop_id=#{shopId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue