From 81da61b828e29b7745e1382dfbbaeb685dc083ef Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 23 一月 2024 17:17:55 +0800 Subject: [PATCH] 抖音转链修改 --- fanli/src/main/java/com/yeshi/fanli/lijin/manager/UserLijinMnager.java | 96 +++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 87 insertions(+), 9 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/lijin/manager/UserLijinMnager.java b/fanli/src/main/java/com/yeshi/fanli/lijin/manager/UserLijinMnager.java index 71059b9..946b5d2 100644 --- a/fanli/src/main/java/com/yeshi/fanli/lijin/manager/UserLijinMnager.java +++ b/fanli/src/main/java/com/yeshi/fanli/lijin/manager/UserLijinMnager.java @@ -3,6 +3,8 @@ import com.ks.lijin.service.LiJinExpendRecordService; import com.ks.lijin.service.LiJinLinkService; import com.ks.lijin.service.LijinCreateService; +import com.ks.vip.exception.LijinBalanceException; +import com.ks.vip.exception.OrderPayException; import com.ks.vip.exception.VipOrderException; import com.ks.vip.pojo.DO.*; import com.ks.vip.pojo.DTO.PayWayInfoDTO; @@ -11,10 +13,14 @@ import com.ks.vip.pojo.Enums.VIPEnum; import com.ks.vip.service.*; import com.yeshi.fanli.entity.SystemEnum; +import com.yeshi.fanli.entity.config.SystemConfigKeyEnum; import com.yeshi.fanli.entity.system.ConfigKeyEnum; import com.yeshi.fanli.lijin.dto.TodayLijinCreatedInfo; import com.yeshi.fanli.lijin.vo.UserLijinLevelInfoVO; import com.yeshi.fanli.service.inter.config.ConfigService; +import com.yeshi.fanli.service.inter.config.SystemConfigService; +import com.yeshi.fanli.service.inter.user.UserInfoService; +import com.yeshi.fanli.util.account.UserUtil; import org.apache.dubbo.config.annotation.Reference; import org.springframework.stereotype.Component; import org.yeshi.utils.TimeUtil; @@ -28,45 +34,72 @@ @Component public class UserLijinMnager { - @Reference(version = "1.0", check = false) - private LijinCreateService lijinCreateService; +// @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20904/com.ks.lijin.service.LijinCreateService") +// @Reference(version = "1.0", check = false, timeout = 30000) +// private LijinCreateService lijinCreateService; +// @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20902/com.ks.vip.service.VipCenterService") @Reference(version = "1.0", check = false) private VipCenterService vipCenterService; +// @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipCenterRecordService") @Reference(version = "1.0", check = false) private VipCenterRecordService vipCenterRecordService; +// @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20902/com.ks.vip.service.VipGradePotenceService") @Reference(version = "1.0", check = false) private VipGradePotenceService vipGradePotenceService; +// @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20902/com.ks.vip.service.VipGradeService") @Reference(version = "1.0", check = false) private VipGradeService vipGradeService; +// @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipComboService") @Reference(version = "1.0", check = false) private VipComboService vipComboService; +// @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20904/com.ks.lijin.service.LiJinLinkService") @Reference(version = "1.0", check = false) private LiJinLinkService liJinLinkService; +// @Reference(version = "1.0", check = false, url = "dubbo://193.112.35.168:20904/com.ks.lijin.service.LiJinExpendRecordService") @Reference(version = "1.0", check = false) private LiJinExpendRecordService liJinExpendRecordService; +// @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipOrederService") @Reference(version = "1.0", check = false) private VipOrederService vipOrederService; +// @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipOrederPayService") @Reference(version = "1.0", check = false) private VipOrederPayService vipOrederPayService; +// @Reference(version = "1.0", check = false,url="dubbo://193.112.35.168:20902/com.ks.vip.service.VipOrederPayService") + @Reference(version = "1.0", check = false) + private LijinBalanceService lijinBalanceService; + + @Reference(version = "1.0", check = false) + private LijinRecordService lijinRecordService; + @Resource private ConfigService configService; + + @Resource + private SystemConfigService systemConfigService; + + @Resource + private UserInfoService userInfoService; private String getUid(Long uid) { if (uid == null) return null; - return "tejia-" + uid; + + SystemEnum system = userInfoService.getUserSystem(uid); + if (system == null) + return null; + return systemConfigService.getValueCache(SystemConfigKeyEnum.thirdAppUidPrefix, system) + uid; } public VIPEnum getVIPRank(Long uid) { @@ -147,14 +180,14 @@ * @return */ public UserLijinLevelInfoVO getUserLevelInfo(Long uid, SystemEnum system) { - if (system == SystemEnum.yhqjx) { + if (system == SystemEnum.yhqjx || system == SystemEnum.hsb) { VIPEnum rank = getVIPRank(uid); UserLijinLevelInfoVO vo = new UserLijinLevelInfoVO(); vo.setUserLevel(getVIPRank(uid).name()); vo.setLoadingAdInfo(new UserLijinLevelInfoVO.ADInfo("gdt2", "9041686956722647")); if (rank == getDefaultRank()) { //褰撳墠涓洪粯璁ょ瓑绾э紝鍙互鍗囩骇 - vo.setUpgradeRights(new UserLijinLevelInfoVO.UpgradeRights("閾傞噾浼氬憳鍏嶅箍鍛婏紝绀奸噾鎻愰珮100%", configService.getValue(ConfigKeyEnum.lijinVIPLink, system))); + vo.setUpgradeRights(new UserLijinLevelInfoVO.UpgradeRights("閾傞噾浼氬憳鍏嶅箍鍛婏紝绀奸噾绾㈠寘鎻愰珮216%", configService.getValue(ConfigKeyEnum.lijinVIPLink, system))); } return vo; } @@ -232,7 +265,7 @@ dto.setPayAccount(null); dto.setPayMoney(vipCombo.getDiscountPrice()); dto.setPayWay(payWay); - dto.setThreeOrderId("tejia-vip-" + uid + "-" + TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyyMMddHHmmssSSS")); + dto.setThreeOrderId("tv" + TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyyMMddHHmmssSSS") + uid); return vipOrederPayService.addOrderWithPay(dto, notifuUrl, resturnUrl, ip); } @@ -252,7 +285,7 @@ * @param id * @return */ - public VipOrder checkPay(Long id) { + public VipOrder checkPay(Long id) throws OrderPayException, VipOrderException { return vipOrederPayService.checkOrderPayState(id); } @@ -269,12 +302,57 @@ public String getWXPaySuccessOutOrderNo(String notifyContent) throws Exception { - return vipOrederPayService.getWXPaySuccessOutOrderNo(notifyContent); + return vipOrederPayService.getWXPaySuccessOutOrderNo(notifyContent); } public String getAlipayPaySuccessOutOrderNo(Map<String, String> params) throws Exception { - return vipOrederPayService.getAlipayPaySuccessOutOrderNo(params); + return vipOrederPayService.getAlipayPaySuccessOutOrderNo(params); + } + + public void addLijin(Long uid, BigDecimal money, String title, String category) throws LijinBalanceException { + lijinBalanceService.addLijin(getUid(uid), money, title, category, null); + } + + public List<UserLijinRecord> getLijinRecord(Long uid, Integer type, int page, int pageSize) { + return lijinRecordService.listRecord(getUid(uid), type, page, pageSize); + } + + public long countLijinRecord(Long uid, Integer type) { + return lijinRecordService.countRecord(getUid(uid), type); + } + + public UserLijinRecord getLijinRecord(Long uid, Integer type, String category) { + return lijinRecordService.getRecord(getUid(uid), type, category, null); + } + + /** + * 鑾峰彇绀奸噾浣欓 + * + * @param uid + * @return + */ + public BigDecimal getLijinBalance(Long uid) { + return lijinBalanceService.getBalance(getUid(uid)); + } + + /** + * 鑾峰彇浣跨敤涓殑绀奸噾 + * + * @param uid + * @return + */ + public BigDecimal getUsingLijin(Long uid) { + return lijinBalanceService.getUsingLijin(getUid(uid)); + } + + /** + * 鍒濆鍖栦綑棰� + * + * @param uid + */ + public void initBalance(Long uid) { + lijinBalanceService.init(getUid(uid)); } -- Gitblit v1.8.0