Merge remote-tracking branch 'origin/lyf' into lyf

This commit is contained in:
wangguocheng 2024-05-22 11:43:13 +08:00
commit 2f84bed116
8 changed files with 64 additions and 27 deletions

View File

@ -217,21 +217,20 @@ public class LoginContoller {
}
// /**
// * 获取会员码
// *
// * @param openId
// * @param token
// * @param id
// * @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);
// }
/**
* 获取会员码
*
* @param openId
* @param token
* @param id
* @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);
}
@GetMapping("/userInfo")
public Result userInfo(@RequestParam("userId") Integer userId) {

View File

@ -53,11 +53,13 @@ public class NotifyController {
Map<String, Object> map= getParameterMap(request);
log.info("fstmemberInCallBack回调返回信息:{}",JSONUtil.toJsonStr(map));
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("TRADE_SUCCESS".equals(object.get("state").toString())){
String orderNo=map.get("mchOrderNo").toString();
String tradeNo=map.get("payOrderId").toString();
String orderNo=object.get("mchOrderNo").toString();
String tradeNo=object.get("payOrderId").toString();
return payService.fstMemberInSuccess(orderNo,tradeNo);
}
}
@ -90,11 +92,12 @@ public class NotifyController {
Map<String, Object> map= getParameterMap(request);
log.info("notifyfstCallBack回调返回信息:{}",JSONUtil.toJsonStr(map));
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("TRADE_SUCCESS".equals(object.get("state").toString())){
String orderNo=map.get("mchOrderNo").toString();
String tradeNo=map.get("payOrderId").toString();
String orderNo=object.get("mchOrderNo").toString();
String tradeNo=object.get("payOrderId").toString();
return payService.callBackPayFST(tradeNo);
}
}

View File

@ -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);
}
/**
* 充值
*

View File

@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.List;
@Component
@Mapper
@ -23,4 +24,6 @@ public interface TbActivateMapper {
int updateByPrimaryKey(TbActivate record);
TbActivate selectByAmount(@Param("shopId") String shopId,@Param("amount") BigDecimal amount);
List<TbActivate> selectByShpopId(String shopId);
}

View File

@ -24,6 +24,8 @@ import com.chaozhanggui.system.cashierservice.thirdpay.service.ThirdPayService;
import com.chaozhanggui.system.cashierservice.util.*;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -114,8 +116,11 @@ public class PayService {
@Value("${thirdPay.callBack}")
private String callBack;
@Value("${thirdPay.callInBack}")
private String callInBack;
@Value("${thirdPay.callFSTBack}")
private String callFSTBack;
@Autowired
ThirdPayService thirdPayService;
@ -240,7 +245,7 @@ public class PayService {
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("000000".equals(publicResp.getCode())){
WxScanPayResp wxScanPayResp= publicResp.getObjData();
@ -784,7 +789,7 @@ public class PayService {
}
}
}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("000000".equals(publicResp.getCode())){
WxScanPayResp wxScanPayResp= publicResp.getObjData();
@ -921,6 +926,18 @@ public class PayService {
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的随机串
*

View File

@ -59,7 +59,7 @@ ysk:
callBackIn: https://p40312246f.goho.co/cashierService/notify/memberInCallBack
default: 18710449883
server:
port: 9888
port: 9889
prod: dev1
queue: cart_queue_putdev1

View File

@ -57,5 +57,6 @@ aliyun:
thirdPay:
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

View File

@ -118,4 +118,8 @@
<select id="selectByAmount" resultMap="BaseResultMap">
select * from tb_activate where shop_id=#{shopId} and is_del=0 and min_num &lt;= #{amount} and max_num &gt;={amount}
</select>
<select id="selectByShpopId" resultMap="BaseResultMap">
select * from tb_activate where shop_id=#{shopId}
</select>
</mapper>