提交代码

dev
胡锐 3 months ago
parent bb4f322037
commit 2fb04fd18f
  1. 8
      bweb/src/main/java/com/bweb/controller/BsAgentMerAccountController.java
  2. 2
      service/src/main/java/com/hfkj/service/agent/impl/BsAgentMerAccountServiceImpl.java
  3. 6
      service/src/main/java/com/hfkj/service/merchant/impl/BsMerchantAccountServiceImpl.java

@ -149,9 +149,13 @@ public class BsAgentMerAccountController {
@RequestParam(value = "pageSize", required = true) Integer pageSize) { @RequestParam(value = "pageSize", required = true) Integer pageSize) {
try { try {
// 查询账户
BsAgentMerAccount account = agentMerAccountService.getAccount(agentId, merNo);
if (account == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到账户");
}
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
param.put("agentId", agentId); param.put("agentMerAccountId", account.getId());
param.put("merNo", merNo);
PageHelper.startPage(pageNum,pageSize); PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(agentMerAccountRecordService.getList(param))); return ResponseMsgUtil.success(new PageInfo<>(agentMerAccountRecordService.getList(param)));

@ -55,7 +55,7 @@ public class BsAgentMerAccountServiceImpl implements BsAgentMerAccountService {
@Override @Override
public BsAgentMerAccount getAccount(Long agentId, String merNo) { public BsAgentMerAccount getAccount(Long agentId, String merNo) {
BsAgentMerAccountExample example = new BsAgentMerAccountExample(); BsAgentMerAccountExample example = new BsAgentMerAccountExample();
example.createCriteria().andAgentIdEqualTo(agentId).andMerNoEqualTo(merNo); example.createCriteria().andAgentIdEqualTo(agentId).andMerNoEqualTo(merNo).andStatusNotEqualTo(0);;
List<BsAgentMerAccount> list = agentMerAccountMapper.selectByExample(example); List<BsAgentMerAccount> list = agentMerAccountMapper.selectByExample(example);
if (!list.isEmpty()) { if (!list.isEmpty()) {
return list.get(0); return list.get(0);

@ -57,7 +57,7 @@ public class BsMerchantAccountServiceImpl implements BsMerchantAccountService {
@Override @Override
public BsMerchantAccount getAccount(String merNo) { public BsMerchantAccount getAccount(String merNo) {
BsMerchantAccountExample example = new BsMerchantAccountExample(); BsMerchantAccountExample example = new BsMerchantAccountExample();
example.createCriteria().andMerNoEqualTo(merNo); example.createCriteria().andMerNoEqualTo(merNo).andStatusNotEqualTo(0);
List<BsMerchantAccount> list = merchantAccountMapper.selectByExample(example); List<BsMerchantAccount> list = merchantAccountMapper.selectByExample(example);
if (!list.isEmpty()) { if (!list.isEmpty()) {
return list.get(0); return list.get(0);
@ -126,7 +126,7 @@ public class BsMerchantAccountServiceImpl implements BsMerchantAccountService {
if (merAccount.getAmount().compareTo(amount) == -1) { if (merAccount.getAmount().compareTo(amount) == -1) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "余额不足"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "余额不足");
}*/ }*/
// 查询车队油卡 // 查询账户
BsMerchantAccount merAccount = getAccount(merNo); BsMerchantAccount merAccount = getAccount(merNo);
// 变更前金额 // 变更前金额
BigDecimal beforeAmount = merAccount.getAmount(); BigDecimal beforeAmount = merAccount.getAmount();
@ -173,7 +173,7 @@ public class BsMerchantAccountServiceImpl implements BsMerchantAccountService {
if (Boolean.TRUE.equals(lock)) { if (Boolean.TRUE.equals(lock)) {
try { try {
// 获取锁成功 // 获取锁成功
// 查询车队油卡 // 查询账户
BsMerchantAccount merAccount = getAccount(merNo); BsMerchantAccount merAccount = getAccount(merNo);
// 变更前金额 // 变更前金额
BigDecimal beforeAmount = merAccount.getAmount(); BigDecimal beforeAmount = merAccount.getAmount();

Loading…
Cancel
Save