提交 ad3b1cd9 authored 作者: huyufan's avatar huyufan

修改接口

上级 855987ca
...@@ -56,8 +56,8 @@ public class OwnerAccountController { ...@@ -56,8 +56,8 @@ public class OwnerAccountController {
@UnitCovert(param = false) @UnitCovert(param = false)
public Result<Map> accountInfo() { public Result<Map> accountInfo() {
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo(); UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
List<OwnerAccountVO> accountVOList = ownerAccountService.accountInfo(loginUserInfo.getUserNo()); Map<String,OwnerAccountVO> result = ownerAccountService.accountInfo(loginUserInfo.getUserNo());
return Result.ok(accountVOList.stream().collect(Collectors.groupingBy(OwnerAccountVO::getAccountType))); return Result.ok(result);
} }
@ApiOperation(value = "货主充值记录列表", notes = "<br>By:胡宇帆") @ApiOperation(value = "货主充值记录列表", notes = "<br>By:胡宇帆")
......
...@@ -10,6 +10,7 @@ import com.clx.user.vo.pc.owner.OwnerBindCardVO; ...@@ -10,6 +10,7 @@ import com.clx.user.vo.pc.owner.OwnerBindCardVO;
import org.apache.poi.xssf.streaming.SXSSFWorkbook; import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import java.util.List; import java.util.List;
import java.util.Map;
public interface OwnerAccountService { public interface OwnerAccountService {
IPage<OwnerAccountVO> pageList(PageOwnerAccountListParam param); IPage<OwnerAccountVO> pageList(PageOwnerAccountListParam param);
...@@ -18,7 +19,7 @@ public interface OwnerAccountService { ...@@ -18,7 +19,7 @@ public interface OwnerAccountService {
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PagePlatformPrepaidFreightAccountParam param); IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PagePlatformPrepaidFreightAccountParam param);
List<OwnerAccountVO> accountInfo(Long ownerUserNo); Map<String,OwnerAccountVO> accountInfo(Long ownerUserNo);
Long accountTopUp(OwnerTopUpParam param); Long accountTopUp(OwnerTopUpParam param);
......
...@@ -35,9 +35,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -35,9 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.LinkedList;
import java.util.List;
@Slf4j @Slf4j
@Service @Service
...@@ -78,8 +76,17 @@ public class OwnerAccountServiceImpl implements OwnerAccountService { ...@@ -78,8 +76,17 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
} }
@Override @Override
public List<OwnerAccountVO> accountInfo(Long ownerUserNo) { public Map<String,OwnerAccountVO> accountInfo(Long ownerUserNo) {
return ownerAccountStruct.convertList(ownerAccountDao.accountInfo(ownerUserNo)); Map<String,OwnerAccountVO> result = new HashMap<>(2);
List<OwnerAccountVO> list = ownerAccountStruct.convertList(ownerAccountDao.accountInfo(ownerUserNo));
for (OwnerAccountVO ownerAccountVO : list) {
if (OwnerAccountEnum.AccountTypeStatus.MARGIN_ACCOUNT.getCode().equals(ownerAccountVO.getAccountType())) {
result.put(OwnerAccountEnum.AccountTypeStatus.MARGIN_ACCOUNT.getMsg(), ownerAccountVO);
} else {
result.put(OwnerAccountEnum.AccountTypeStatus.PREPAID_FREIGHT_ACCOUNT.getMsg(), ownerAccountVO);
}
}
return result;
} }
@Override @Override
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论