## 币种配置去除国际化;
This commit is contained in:
parent
d5708d7422
commit
6f9614f40c
|
|
@ -16,17 +16,13 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 配置controller
|
* 配置controller
|
||||||
* @Author: sui q
|
|
||||||
* @Time: 2023/3/10 15:45
|
|
||||||
* @Classname: ConfigBaseController
|
|
||||||
* @PackageName: com.hzs.config.pub.controller
|
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public abstract class ConfigBaseController extends BaseController {
|
public abstract class ConfigBaseController extends BaseController {
|
||||||
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private IDelayedMessageApi delayedMessageApi;
|
IDelayedMessageApi delayedMessageApi;
|
||||||
|
|
||||||
protected boolean sendDelayedMessage(Object config, Integer delayBusType, String key, String... otherKey) {
|
protected boolean sendDelayedMessage(Object config, Integer delayBusType, String key, String... otherKey) {
|
||||||
Integer pkId = null;
|
Integer pkId = null;
|
||||||
|
|
@ -63,10 +59,7 @@ public abstract class ConfigBaseController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 校验object的属性值是Long类型还是Integer
|
* 校验object的属性值是Long类型还是Integer
|
||||||
* @author: zhang jing
|
|
||||||
* @date: 2024/5/20 16:01
|
|
||||||
* @param: [field, object]
|
|
||||||
**/
|
**/
|
||||||
public static boolean isLong(Object object) {
|
public static boolean isLong(Object object) {
|
||||||
if (object instanceof Long) {
|
if (object instanceof Long) {
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,10 @@ package com.hzs.system.config.controller.manage;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.hzs.common.core.annotation.Log;
|
import com.hzs.common.core.annotation.Log;
|
||||||
import com.hzs.common.core.constant.CacheConstants;
|
import com.hzs.common.core.constant.CacheConstants;
|
||||||
import com.hzs.common.core.constant.EnumsPrefixConstants;
|
|
||||||
import com.hzs.common.core.constant.SystemFieldConstants;
|
|
||||||
import com.hzs.common.core.constant.msg.ConfigMsgConstants;
|
import com.hzs.common.core.constant.msg.ConfigMsgConstants;
|
||||||
import com.hzs.common.core.domain.R;
|
import com.hzs.common.core.domain.R;
|
||||||
import com.hzs.common.core.enums.*;
|
import com.hzs.common.core.enums.*;
|
||||||
|
|
@ -21,7 +19,6 @@ import com.hzs.common.core.web.page.TableDataInfo;
|
||||||
import com.hzs.common.domain.system.config.BdAccount;
|
import com.hzs.common.domain.system.config.BdAccount;
|
||||||
import com.hzs.common.domain.system.config.ext.BdAccountExt;
|
import com.hzs.common.domain.system.config.ext.BdAccountExt;
|
||||||
import com.hzs.common.security.utils.SecurityUtils;
|
import com.hzs.common.security.utils.SecurityUtils;
|
||||||
import com.hzs.common.service.ITransactionCommonService;
|
|
||||||
import com.hzs.common.util.TransactionUtils;
|
import com.hzs.common.util.TransactionUtils;
|
||||||
import com.hzs.config.pub.controller.ConfigBaseController;
|
import com.hzs.config.pub.controller.ConfigBaseController;
|
||||||
import com.hzs.system.base.ITransactionServiceApi;
|
import com.hzs.system.base.ITransactionServiceApi;
|
||||||
|
|
@ -36,13 +33,9 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 币种配置表 前端控制器
|
* 币种配置表 前端控制器
|
||||||
*
|
|
||||||
* @author zhangjing
|
|
||||||
* @since 2022-08-25
|
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -50,34 +43,22 @@ import java.util.Map;
|
||||||
public class BdAccountController extends ConfigBaseController {
|
public class BdAccountController extends ConfigBaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBdAccountService accountService;
|
private IBdAccountService iBdAccountService;
|
||||||
@Autowired
|
|
||||||
private ITransactionCommonService iTransactionCommonService;
|
|
||||||
|
|
||||||
@DubboReference
|
|
||||||
ITransactionServiceApi iTransactionServiceApi;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
@Autowired
|
@DubboReference
|
||||||
public void setRedisService(RedisService redisService) {
|
ITransactionServiceApi iTransactionServiceApi;
|
||||||
this.redisService = redisService;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 查询币种配置列表
|
* 查询币种配置列表
|
||||||
* @author: zhang jing
|
|
||||||
* @date: 2022/8/29 9:56
|
|
||||||
* @param: [account]
|
|
||||||
* @return: com.hzs.common.core.web.page.TableDataInfo
|
|
||||||
**/
|
**/
|
||||||
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.SELECT)
|
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.SELECT)
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(BdAccountExt bdAccountExt) {
|
public TableDataInfo list(BdAccountExt bdAccountExt) {
|
||||||
startPage();
|
startPage();
|
||||||
bdAccountExt.setPkCountry(SecurityUtils.getPkCountry());
|
bdAccountExt.setPkCountry(SecurityUtils.getPkCountry());
|
||||||
List<BdAccountExt> list = accountService.selectBdAccountList(bdAccountExt);
|
List<BdAccountExt> list = iBdAccountService.selectBdAccountList(bdAccountExt);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,25 +71,21 @@ public class BdAccountController extends ConfigBaseController {
|
||||||
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.EXPORT)
|
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, BdAccountExt bdAccountExt) {
|
public void export(HttpServletResponse response, BdAccountExt bdAccountExt) {
|
||||||
List<BdAccountExt> list = accountService.selectBdAccountList(bdAccountExt);
|
List<BdAccountExt> list = iBdAccountService.selectBdAccountList(bdAccountExt);
|
||||||
ExcelUtil<BdAccountExt> util = new ExcelUtil<>(BdAccountExt.class);
|
ExcelUtil<BdAccountExt> util = new ExcelUtil<>(BdAccountExt.class);
|
||||||
util.exportExcel(response, list, "币种配置");
|
util.exportExcel(response, list, "币种配置");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 查询转换币种列表
|
* 查询转换币种列表
|
||||||
* @author: zhang jing
|
|
||||||
* @date: 2022/10/25 16:20
|
|
||||||
* @param: []
|
|
||||||
* @return: com.hzs.common.core.web.page.TableDataInfo
|
|
||||||
**/
|
**/
|
||||||
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.SELECT)
|
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.SELECT)
|
||||||
@GetMapping("/pkBdAccountList")
|
@GetMapping("/pkBdAccountList")
|
||||||
public TableDataInfo list() {
|
public TableDataInfo list() {
|
||||||
QueryWrapper<BdAccount> queryWrapper = new QueryWrapper<>();
|
LambdaQueryWrapper<BdAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
|
queryWrapper.eq(BdAccount::getPkCountry, SecurityUtils.getPkCountry());
|
||||||
queryWrapper.orderByAsc("SORT");
|
queryWrapper.orderByAsc(BdAccount::getSort);
|
||||||
List<BdAccount> list = accountService.list(queryWrapper);
|
List<BdAccount> list = iBdAccountService.list(queryWrapper);
|
||||||
List<PkBdAccountParam> paList = new ArrayList<>();
|
List<PkBdAccountParam> paList = new ArrayList<>();
|
||||||
list.forEach(item -> paList.add(BeanUtil.copyProperties(item, PkBdAccountParam.class)));
|
list.forEach(item -> paList.add(BeanUtil.copyProperties(item, PkBdAccountParam.class)));
|
||||||
return getDataTable(paList);
|
return getDataTable(paList);
|
||||||
|
|
@ -116,27 +93,19 @@ public class BdAccountController extends ConfigBaseController {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 充值列表
|
* 充值列表
|
||||||
* @author: zhang jing
|
|
||||||
* @date: 2023/7/12 14:06
|
|
||||||
* @param: []
|
|
||||||
* @return: com.hzs.common.core.web.page.TableDataInfo
|
|
||||||
**/
|
**/
|
||||||
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.SELECT)
|
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.SELECT)
|
||||||
@GetMapping("/rechargeList")
|
@GetMapping("/rechargeList")
|
||||||
public TableDataInfo rechargeList(PkBdAccountParam accountParam) {
|
public TableDataInfo rechargeList(PkBdAccountParam accountParam) {
|
||||||
List<BdAccount> list = accountService.queryAccountByType(accountParam.getAccountProperty(), SecurityUtils.getPkCountry());
|
List<BdAccount> list = iBdAccountService.queryAccountByType(accountParam.getAccountProperty(), SecurityUtils.getPkCountry());
|
||||||
List<PkBdAccountParam> paList = new ArrayList<>();
|
List<PkBdAccountParam> paList = new ArrayList<>();
|
||||||
list.forEach(item -> paList.add(BeanUtil.copyProperties(item, PkBdAccountParam.class)));
|
list.forEach(item -> paList.add(BeanUtil.copyProperties(item, PkBdAccountParam.class)));
|
||||||
return getDataTable(paList);
|
return getDataTable(paList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 新增币种配置
|
* 新增币种配置
|
||||||
* @author: zhang jing
|
|
||||||
* @date: 2022/8/29 9:58
|
|
||||||
* @param: [account]
|
|
||||||
* @return: com.hzs.common.core.web.domain.AjaxResult
|
|
||||||
**/
|
**/
|
||||||
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.INSERT)
|
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.INSERT)
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
|
|
@ -155,28 +124,28 @@ public class BdAccountController extends ConfigBaseController {
|
||||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL));
|
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<BdAccount> queryWrapper1 = new QueryWrapper<>();
|
LambdaQueryWrapper<BdAccount> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||||
queryWrapper1.eq("SORT", account.getSort());
|
queryWrapper1.eq(BdAccount::getSort, account.getSort());
|
||||||
queryWrapper1.eq("PK_COUNTRY", pkCountry);
|
queryWrapper1.eq(BdAccount::getPkCountry, pkCountry);
|
||||||
List<BdAccount> list1 = accountService.list(queryWrapper1);
|
List<BdAccount> list1 = iBdAccountService.list(queryWrapper1);
|
||||||
if (CollectionUtil.isNotEmpty(list1)) {
|
if (CollectionUtil.isNotEmpty(list1)) {
|
||||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.SORT_NOT_REPEAT));
|
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.SORT_NOT_REPEAT));
|
||||||
}
|
}
|
||||||
//校验在线充值
|
//校验在线充值
|
||||||
if (StringUtils.isNotNull(account.getOnLineRecharge()) && account.getOnLineRecharge() == EYesNo.YES.getIntValue()) {
|
if (StringUtils.isNotNull(account.getOnLineRecharge()) && account.getOnLineRecharge() == EYesNo.YES.getIntValue()) {
|
||||||
QueryWrapper<BdAccount> queryWrapper2 = new QueryWrapper<>();
|
LambdaQueryWrapper<BdAccount> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||||
queryWrapper2.eq("ON_LINE_RECHARGE", account.getOnLineRecharge());
|
queryWrapper2.eq(BdAccount::getOnLineRecharge, account.getOnLineRecharge());
|
||||||
queryWrapper2.eq("PK_COUNTRY", pkCountry);
|
queryWrapper2.eq(BdAccount::getPkCountry, pkCountry);
|
||||||
List<BdAccount> list2 = accountService.list(queryWrapper2);
|
List<BdAccount> list2 = iBdAccountService.list(queryWrapper2);
|
||||||
if (CollectionUtil.isNotEmpty(list2)) {
|
if (CollectionUtil.isNotEmpty(list2)) {
|
||||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.RECHARGE_NOT_REPEAT));
|
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.RECHARGE_NOT_REPEAT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<BdAccount> queryWrapper = new QueryWrapper<>();
|
LambdaQueryWrapper<BdAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq("PK_COUNTRY", pkCountry);
|
queryWrapper.eq(BdAccount::getPkCountry, pkCountry);
|
||||||
queryWrapper.eq("FIELD_VALUE", account.getFieldValue());
|
queryWrapper.eq(BdAccount::getFieldValue, account.getFieldValue());
|
||||||
List<BdAccount> list = accountService.list(queryWrapper);
|
List<BdAccount> list = iBdAccountService.list(queryWrapper);
|
||||||
if (CollectionUtil.isEmpty(list)) {
|
if (CollectionUtil.isEmpty(list)) {
|
||||||
account.setPkCountry(pkCountry);
|
account.setPkCountry(pkCountry);
|
||||||
account.setPkCreator(SecurityUtils.getUserId());
|
account.setPkCreator(SecurityUtils.getUserId());
|
||||||
|
|
@ -185,18 +154,14 @@ public class BdAccountController extends ConfigBaseController {
|
||||||
R<Integer> pkTransactionKey = iTransactionServiceApi.createTransaction(pkCountry, ETransactionKey.ACCOUNT,
|
R<Integer> pkTransactionKey = iTransactionServiceApi.createTransaction(pkCountry, ETransactionKey.ACCOUNT,
|
||||||
account.getAccountName(), EYesNo.YES, EYesNo.NO);
|
account.getAccountName(), EYesNo.YES, EYesNo.NO);
|
||||||
account.setPkTransactionKey(pkTransactionKey.getData());
|
account.setPkTransactionKey(pkTransactionKey.getData());
|
||||||
accountService.save(account);
|
iBdAccountService.save(account);
|
||||||
}
|
}
|
||||||
sendDelayedMessage(account, EDelayBusType.CURRENCY.getValue(), CacheConstants.BD_ACCOUNT + account.getPkId());
|
sendDelayedMessage(account, EDelayBusType.CURRENCY.getValue(), CacheConstants.BD_ACCOUNT + account.getPkId());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 修改币种配置
|
* 修改币种配置
|
||||||
* @author: zhang jing
|
|
||||||
* @date: 2022/8/29 9:58
|
|
||||||
* @param: [account]
|
|
||||||
* @return: com.hzs.common.core.web.domain.AjaxResult
|
|
||||||
**/
|
**/
|
||||||
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.UPDATE)
|
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.UPDATE)
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
|
|
@ -214,22 +179,22 @@ public class BdAccountController extends ConfigBaseController {
|
||||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL));
|
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL));
|
||||||
}
|
}
|
||||||
Integer pkCountry = SecurityUtils.getPkCountry();
|
Integer pkCountry = SecurityUtils.getPkCountry();
|
||||||
QueryWrapper<BdAccount> queryWrapper1 = new QueryWrapper<>();
|
LambdaQueryWrapper<BdAccount> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||||
queryWrapper1.eq("PK_COUNTRY", pkCountry);
|
queryWrapper1.eq(BdAccount::getPkCountry, pkCountry);
|
||||||
queryWrapper1.eq("SORT", account.getSort());
|
queryWrapper1.eq(BdAccount::getSort, account.getSort());
|
||||||
queryWrapper1.ne("PK_ID", account.getPkId());
|
queryWrapper1.ne(BdAccount::getPkId, account.getPkId());
|
||||||
List<BdAccount> list1 = accountService.list(queryWrapper1);
|
List<BdAccount> list1 = iBdAccountService.list(queryWrapper1);
|
||||||
if (CollectionUtil.isNotEmpty(list1)) {
|
if (CollectionUtil.isNotEmpty(list1)) {
|
||||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.SORT_NOT_REPEAT));
|
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.SORT_NOT_REPEAT));
|
||||||
}
|
}
|
||||||
|
|
||||||
//校验在线充值
|
//校验在线充值
|
||||||
if (account.getOnLineRecharge() == EYesNo.YES.getIntValue()) {
|
if (account.getOnLineRecharge() == EYesNo.YES.getIntValue()) {
|
||||||
QueryWrapper<BdAccount> queryWrapper2 = new QueryWrapper<>();
|
LambdaQueryWrapper<BdAccount> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||||
queryWrapper2.eq("ON_LINE_RECHARGE", account.getOnLineRecharge());
|
queryWrapper2.eq(BdAccount::getOnLineRecharge, account.getOnLineRecharge());
|
||||||
queryWrapper2.eq("PK_COUNTRY", pkCountry);
|
queryWrapper2.eq(BdAccount::getPkCountry, pkCountry);
|
||||||
queryWrapper2.ne("PK_ID", account.getPkId());
|
queryWrapper2.ne(BdAccount::getPkId, account.getPkId());
|
||||||
List<BdAccount> list2 = accountService.list(queryWrapper2);
|
List<BdAccount> list2 = iBdAccountService.list(queryWrapper2);
|
||||||
if (CollectionUtil.isNotEmpty(list2)) {
|
if (CollectionUtil.isNotEmpty(list2)) {
|
||||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.RECHARGE_NOT_REPEAT));
|
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.RECHARGE_NOT_REPEAT));
|
||||||
}
|
}
|
||||||
|
|
@ -263,32 +228,22 @@ public class BdAccountController extends ConfigBaseController {
|
||||||
redisService.deleteObject(CacheConstants.BD_ACCOUNT_CHANGE + account.getPkId());
|
redisService.deleteObject(CacheConstants.BD_ACCOUNT_CHANGE + account.getPkId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return toAjax(iBdAccountService.updateById(account));
|
||||||
|
|
||||||
return toAjax(accountService.updateById(account));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 获取单条币种配置信息
|
* 获取单条币种配置信息
|
||||||
* @author: zhang jing
|
|
||||||
* @date: 2022/8/29 9:58
|
|
||||||
* @param: [pkId]
|
|
||||||
* @return: com.hzs.common.core.web.domain.AjaxResult
|
|
||||||
**/
|
**/
|
||||||
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.SELECT)
|
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.SELECT)
|
||||||
@GetMapping("/getOne/{pkId}")
|
@GetMapping("/getOne/{pkId}")
|
||||||
public AjaxResult getOne(@PathVariable Long pkId) {
|
public AjaxResult getOne(@PathVariable Long pkId) {
|
||||||
BdAccount account = accountService.getById(pkId);
|
BdAccount account = iBdAccountService.getById(pkId);
|
||||||
BdAccountExt accountExt = BeanUtil.copyProperties(account, BdAccountExt.class);
|
BdAccountExt accountExt = BeanUtil.copyProperties(account, BdAccountExt.class);
|
||||||
return AjaxResult.success(accountExt);
|
return AjaxResult.success(accountExt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 修改启用禁用状态
|
* 修改启用禁用状态
|
||||||
* @author: zhang jing
|
|
||||||
* @date: 2022/8/29 9:58
|
|
||||||
* @param: [pkId, enable]
|
|
||||||
* @return: com.hzs.common.core.web.domain.AjaxResult
|
|
||||||
**/
|
**/
|
||||||
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.UPDATE)
|
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.UPDATE)
|
||||||
@PostMapping("/updateEnable/{pkId}/{enable}")
|
@PostMapping("/updateEnable/{pkId}/{enable}")
|
||||||
|
|
@ -298,23 +253,19 @@ public class BdAccountController extends ConfigBaseController {
|
||||||
account.setEnableState(enable);
|
account.setEnableState(enable);
|
||||||
account.setPkModified(SecurityUtils.getUserId());
|
account.setPkModified(SecurityUtils.getUserId());
|
||||||
account.setModifiedTime(new Date());
|
account.setModifiedTime(new Date());
|
||||||
accountService.updateById(account);
|
iBdAccountService.updateById(account);
|
||||||
redisService.deleteObject(CacheConstants.BD_ACCOUNT + pkId);
|
redisService.deleteObject(CacheConstants.BD_ACCOUNT + pkId);
|
||||||
redisService.deleteObject(CacheConstants.BD_ACCOUNT_CHANGE + account.getPkId());
|
redisService.deleteObject(CacheConstants.BD_ACCOUNT_CHANGE + account.getPkId());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 删除币种配置
|
* 删除币种配置
|
||||||
* @author: zhang jing
|
|
||||||
* @date: 2022/8/29 9:58
|
|
||||||
* @param: [pkId]
|
|
||||||
* @return: com.hzs.common.core.web.domain.AjaxResult
|
|
||||||
**/
|
**/
|
||||||
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.DELETE)
|
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.CURRENCY_CONFIG, method = EOperationMethod.DELETE)
|
||||||
@DeleteMapping("/{pkId}")
|
@DeleteMapping("/{pkId}")
|
||||||
public AjaxResult delete(@PathVariable Long pkId) {
|
public AjaxResult delete(@PathVariable Long pkId) {
|
||||||
BdAccount account = accountService.getById(pkId);
|
BdAccount account = iBdAccountService.getById(pkId);
|
||||||
BdAccountExt bdAccountExt = new BdAccountExt();
|
BdAccountExt bdAccountExt = new BdAccountExt();
|
||||||
Integer accountCount = 0;
|
Integer accountCount = 0;
|
||||||
if (StringUtils.isNotNull(account)) {
|
if (StringUtils.isNotNull(account)) {
|
||||||
|
|
@ -342,19 +293,19 @@ public class BdAccountController extends ConfigBaseController {
|
||||||
if (account.getFieldValue() == EAccount.REPURCHASE.getValue()) {
|
if (account.getFieldValue() == EAccount.REPURCHASE.getValue()) {
|
||||||
bdAccountExt.setAccount8(account.getFieldValue());
|
bdAccountExt.setAccount8(account.getFieldValue());
|
||||||
}
|
}
|
||||||
accountCount = accountService.selectMemberAccountCount(bdAccountExt);
|
accountCount = iBdAccountService.selectMemberAccountCount(bdAccountExt);
|
||||||
}
|
}
|
||||||
if (accountCount > 0) {
|
if (accountCount > 0) {
|
||||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.ENABLE_STATE_NOT_DELETE));
|
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.ENABLE_STATE_NOT_DELETE));
|
||||||
} else {
|
} else {
|
||||||
UpdateWrapper<BdAccount> updateWrapper = new UpdateWrapper<>();
|
LambdaUpdateWrapper<BdAccount> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
updateWrapper.eq("PK_ID", pkId);
|
updateWrapper.eq(BdAccount::getPkId, pkId);
|
||||||
updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue());
|
updateWrapper.set(BdAccount::getDelFlag, EDelFlag.DELETE.getValue());
|
||||||
updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId());
|
updateWrapper.set(BdAccount::getPkModified, SecurityUtils.getUserId());
|
||||||
updateWrapper.set("MODIFIED_TIME", new Date());
|
updateWrapper.set(BdAccount::getModifiedTime, new Date());
|
||||||
redisService.deleteObject(CacheConstants.BD_ACCOUNT + pkId);
|
redisService.deleteObject(CacheConstants.BD_ACCOUNT + pkId);
|
||||||
redisService.deleteObject(CacheConstants.BD_ACCOUNT_CHANGE + account.getPkId());
|
redisService.deleteObject(CacheConstants.BD_ACCOUNT_CHANGE + account.getPkId());
|
||||||
return AjaxResult.success(accountService.update(updateWrapper));
|
return AjaxResult.success(iBdAccountService.update(updateWrapper));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -370,15 +321,12 @@ public class BdAccountController extends ConfigBaseController {
|
||||||
// 返回数据
|
// 返回数据
|
||||||
List<EnumEntity> enumEntityList = new ArrayList<>();
|
List<EnumEntity> enumEntityList = new ArrayList<>();
|
||||||
|
|
||||||
QueryWrapper<BdAccount> queryWrapper = new QueryWrapper<>();
|
LambdaQueryWrapper<BdAccount> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.in(SystemFieldConstants.PK_ID, pkIdList);
|
queryWrapper.in(BdAccount::getPkId, pkIdList);
|
||||||
List<BdAccount> list = accountService.list(queryWrapper);
|
List<BdAccount> list = iBdAccountService.list(queryWrapper);
|
||||||
|
|
||||||
// 翻译MAP
|
|
||||||
Map<Integer, String> transactionMap = iTransactionCommonService.exportEnumTransactionByDB(EnumsPrefixConstants.KEY_ACC);
|
|
||||||
|
|
||||||
for (BdAccount bdAccount : list) {
|
for (BdAccount bdAccount : list) {
|
||||||
enumEntityList.add(new EnumEntity(bdAccount.getPkId(), transactionMap.get(bdAccount.getPkTransactionKey())));
|
enumEntityList.add(new EnumEntity(bdAccount.getPkId(), bdAccount.getAccountName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return AjaxResult.success(enumEntityList);
|
return AjaxResult.success(enumEntityList);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue