Jelajahi Sumber

fix 提现短信环境过滤;替换账号日志

zoujiajian 2 tahun lalu
induk
melakukan
7ff4d34b8e

+ 4 - 1
netflix-service/src/main/java/com/cyksj/service/cps/shop/YhShopManageServiceImpl.java

@@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alipay.api.AlipayResponse;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.common.EnvCommonService;
 import com.cyksj.common.constant.Constant;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.util.SmsUtil;
@@ -61,6 +62,8 @@ public class YhShopManageServiceImpl implements YhShopManageService{
 
 	private final YhShopDistributeMoneyApplyMapper yhShopDistributeMoneyApplyMapper;
 
+	private final EnvCommonService envCommonService;
+
 	@Override
 	public void getLoginCode(Integer type, String login, Integer cid) {
 		if (type > 2) {
@@ -257,7 +260,7 @@ public class YhShopManageServiceImpl implements YhShopManageService{
 			try {
 				yhShopDistributeMoneyApplyMapper.insert(distributeMoneyApply);
 				//大额提现 超过400
-				if (distributeMoneyApply.getVerifyStatus() == YhShopDistributeMoneyApply.Status.verifying && distributeMoneyApply.getMoney().compareTo(fourHundred) > 0) {
+				if (envCommonService.isPrdEnv() && distributeMoneyApply.getVerifyStatus() == YhShopDistributeMoneyApply.Status.verifying && distributeMoneyApply.getMoney().compareTo(fourHundred) > 0) {
 					SmsUtil.sendLuoKey2Msg(Constant.ZK_MOBILE, "小店店铺有大额提现申请【银河录像局】");
 				}
 			} catch (Exception e) {

+ 7 - 2
netflix-service/src/main/java/com/cyksj/service/mange/group/CmsGroupServiceImpl.java

@@ -287,9 +287,9 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
         if (afterExpiryTime == null) {
             afterExpiryTime = groupsAccountView.getExpiryTime();
         }
-
+        log.info("原账号accountId:{}", accountId);
         //替换账号
-        accountMapper.update(null, Wrappers.lambdaUpdate(Account.class)
+        int update = accountMapper.update(null, Wrappers.lambdaUpdate(Account.class)
                 .set(Account::getAccount, account)
                 .set(Account::getPassword, password)
                 .set(Account::getRemark, remark)
@@ -297,6 +297,11 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
                 .set(Account::getExpiryTime, afterExpiryTime)
                 .set(Account::getGptRefreshToken, StrUtil.EMPTY)
                 .eq(Account::getId, accountId));
+        if (update == 0) {
+            log.info("替换原账号oldAccount:{}至新账号newAccount:{}失败", groupsAccountView.getAccount(), account);
+            throw BusinessRuntimeException.getInstance("替换账号失败");
+        }
+
         if (StrUtil.isNotBlank(groupsAccountView.getGptRefreshToken())) {
             //清除gpt token
             redisService.del(RedisKey.CHATGPT_ACCESS_TOKEN + groupsAccountView.getAccount());

+ 1 - 1
netflix-web/src/main/java/com/cyksj/web/controller/user/DistributePopularizeController.java

@@ -335,7 +335,7 @@ public class DistributePopularizeController {
 			try {
 				distributeMoneyApplyMapper.insert(distributeMoneyApply);
 				//大额提现 超过400
-				if (distributeMoneyApply.getVerifyStatus() == DistributeMoneyApply.Status.verifying && distributeMoneyApply.getMoney().compareTo(fourHundred) > 0) {
+				if (envCommonService.isPrdEnv() && distributeMoneyApply.getVerifyStatus() == DistributeMoneyApply.Status.verifying && distributeMoneyApply.getMoney().compareTo(fourHundred) > 0) {
 					SmsUtil.sendLuoKey2Msg(Constant.ZK_MOBILE, "推广有大额提现申请【银河录像局】");
 				}
 			} catch (Exception e) {