|
@@ -1,6 +1,7 @@
|
|
|
package org.dromara.backstage.payment.service.impl;
|
|
package org.dromara.backstage.payment.service.impl;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
|
+import org.dromara.backstage.cardCenter.service.IPtCardService;
|
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
import org.dromara.common.core.utils.MapstructUtils;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
@@ -31,6 +32,7 @@ import java.util.Collection;
|
|
|
public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
|
|
|
|
|
private final PtUserAccountMapper baseMapper;
|
|
private final PtUserAccountMapper baseMapper;
|
|
|
|
|
+ private final IPtCardService ptCardService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询一卡通账户
|
|
* 查询一卡通账户
|
|
@@ -173,7 +175,15 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
.set(PtUserAccount::getFreezeStatus,freezeStatus)
|
|
.set(PtUserAccount::getFreezeStatus,freezeStatus)
|
|
|
.eq(PtUserAccount::getUserId,userId));
|
|
.eq(PtUserAccount::getUserId,userId));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ * 根据Id更新账户的冻结状态
|
|
|
|
|
+ *
|
|
|
|
|
+ * date 2024-08-06 21:53:42 21:53
|
|
|
|
|
+ * @author: luoyibo
|
|
|
|
|
+ * @param userIds 待更新账户Id,英文逗号隔开
|
|
|
|
|
+ * @param freezeStatus 待更改的状态值
|
|
|
|
|
+ * @return 受影响的记录数据
|
|
|
|
|
+ */
|
|
|
@Override
|
|
@Override
|
|
|
public int updateFreezeStatus(Long[] userIds, String freezeStatus) {
|
|
public int updateFreezeStatus(Long[] userIds, String freezeStatus) {
|
|
|
for (Long userId : userIds) {
|
|
for (Long userId : userIds) {
|
|
@@ -183,4 +193,60 @@ public class PtUserAccountServiceImpl implements IPtUserAccountService {
|
|
|
}
|
|
}
|
|
|
return userIds.length;
|
|
return userIds.length;
|
|
|
}
|
|
}
|
|
|
|
|
+ /*
|
|
|
|
|
+ * 根据Id重置账户有效期
|
|
|
|
|
+ *
|
|
|
|
|
+ * date 2024-08-06 21:53:42 21:53
|
|
|
|
|
+ * @author: luoyibo
|
|
|
|
|
+ * @param userIds 待更新账户Id,英文逗号隔开
|
|
|
|
|
+ * @param freezeStatus 待更改的有效期
|
|
|
|
|
+ * @return 受影响的记录数据
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public int resetLifespan(Long[] userIds, String lifespan) {
|
|
|
|
|
+ for (Long userId : userIds) {
|
|
|
|
|
+ baseMapper.update(null,new LambdaUpdateWrapper<PtUserAccount>()
|
|
|
|
|
+ .set(PtUserAccount::getLifespan,lifespan)
|
|
|
|
|
+ .eq(PtUserAccount::getUserId,userId));
|
|
|
|
|
+ }
|
|
|
|
|
+ return ptCardService.resetLifespan(userIds, lifespan);
|
|
|
|
|
+// return userIds.length;
|
|
|
|
|
+ }
|
|
|
|
|
+ /*
|
|
|
|
|
+ * 根据Id更新账户的卡类
|
|
|
|
|
+ *
|
|
|
|
|
+ * date 2024-08-06 21:53:42 21:53
|
|
|
|
|
+ * @author: luoyibo
|
|
|
|
|
+ * @param userIds 待更新账户Id,英文逗号隔开
|
|
|
|
|
+ * @param freezeStatus 待更改的卡类
|
|
|
|
|
+ * @return 受影响的记录数据
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public int resetCardType(Long[] userIds, String cardType) {
|
|
|
|
|
+ for (Long userId : userIds) {
|
|
|
|
|
+ baseMapper.update(null,new LambdaUpdateWrapper<PtUserAccount>()
|
|
|
|
|
+ .set(PtUserAccount::getCardType,cardType)
|
|
|
|
|
+ .eq(PtUserAccount::getUserId,userId));
|
|
|
|
|
+ }
|
|
|
|
|
+ return ptCardService.resetCardType(userIds, cardType);
|
|
|
|
|
+// return userIds.length;
|
|
|
|
|
+ }
|
|
|
|
|
+ /*
|
|
|
|
|
+ * 根据Id更新账户的消费密码
|
|
|
|
|
+ *
|
|
|
|
|
+ * date 2024-08-06 21:53:42 21:53
|
|
|
|
|
+ * @author: luoyibo
|
|
|
|
|
+ * @param userIds 待更新账户Id,英文逗号隔开
|
|
|
|
|
+ * @param freezeStatus 待更改的消费密码
|
|
|
|
|
+ * @return 受影响的记录数据
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public int resetConsumePwd(Long[] userIds, String pwd) {
|
|
|
|
|
+ for (Long userId : userIds) {
|
|
|
|
|
+ baseMapper.update(null,new LambdaUpdateWrapper<PtUserAccount>()
|
|
|
|
|
+ .set(PtUserAccount::getConsumePwd,pwd)
|
|
|
|
|
+ .eq(PtUserAccount::getUserId,userId));
|
|
|
|
|
+ }
|
|
|
|
|
+ return userIds.length;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|