|
@@ -30,7 +30,7 @@ public class GhDetailServiceImpl implements GhDetailService {
|
|
|
private GhDetailMapper ghDetailMapper;
|
|
|
|
|
|
@Override
|
|
|
- public CommonResponse<Page<GhDetailVo>> getGhDetailList(Integer pageNum, Integer pageSize, String ghId) {
|
|
|
+ public CommonResponse<Page<GhDetailVo>> getGhDetailList(Integer pageNum, Integer pageSize, String accountId) {
|
|
|
if (pageNum == null) {
|
|
|
pageNum = 1;
|
|
|
}
|
|
@@ -44,8 +44,8 @@ public class GhDetailServiceImpl implements GhDetailService {
|
|
|
page.setCurrentPage(pageNum);
|
|
|
page.setPageSize(pageSize);
|
|
|
GhDetailExample example = new GhDetailExample();
|
|
|
- if (StringUtils.isNotEmpty(ghId)) {
|
|
|
- example.createCriteria().andGhIdEqualTo(ghId);
|
|
|
+ if (StringUtils.isNotEmpty(accountId)) {
|
|
|
+ example.createCriteria().andGhIdEqualTo(accountId);
|
|
|
}
|
|
|
example.setPage(page);
|
|
|
long total = ghDetailMapper.countByExample(example);
|
|
@@ -57,6 +57,8 @@ public class GhDetailServiceImpl implements GhDetailService {
|
|
|
for (GhDetail ghDetail : ghDetails) {
|
|
|
GhDetailVo ghDetailVo = new GhDetailVo();
|
|
|
BeanUtils.copyProperties(ghDetail, ghDetailVo);
|
|
|
+ ghDetailVo.setAccountId(ghDetail.getGhId());
|
|
|
+ ghDetailVo.setAccountName(ghDetail.getGhName());
|
|
|
ghDetailVo.setTypeName(GhTypeEnum.getTypeName(ghDetailVo.getType()));
|
|
|
ghDetailVos.add(ghDetailVo);
|
|
|
}
|
|
@@ -68,16 +70,18 @@ public class GhDetailServiceImpl implements GhDetailService {
|
|
|
@Override
|
|
|
public CommonResponse<Void> addGhDetail(GhDetailVo ghDetailVo) {
|
|
|
if (ghDetailVo == null
|
|
|
- || StringUtils.isEmpty(ghDetailVo.getGhId())
|
|
|
- || StringUtils.isEmpty(ghDetailVo.getGhName())
|
|
|
+ || StringUtils.isEmpty(ghDetailVo.getAccountId())
|
|
|
+ || StringUtils.isEmpty(ghDetailVo.getAccountName())
|
|
|
|| ghDetailVo.getType() == null
|
|
|
|| StringUtils.isEmpty(ghDetailVo.getCategory1())) {
|
|
|
- CommonResponse.create(500, "参数错误");
|
|
|
+ return CommonResponse.create(500, "参数错误");
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
GhDetail ghDetail = new GhDetail();
|
|
|
BeanUtils.copyProperties(ghDetailVo, ghDetail);
|
|
|
+ ghDetail.setGhId(ghDetailVo.getAccountId());
|
|
|
+ ghDetail.setGhName(ghDetailVo.getAccountName());
|
|
|
ghDetailMapper.insert(ghDetail);
|
|
|
return CommonResponse.success();
|
|
|
} catch (Exception e) {
|
|
@@ -91,6 +95,8 @@ public class GhDetailServiceImpl implements GhDetailService {
|
|
|
try {
|
|
|
GhDetail ghDetail = new GhDetail();
|
|
|
BeanUtils.copyProperties(ghDetailVo, ghDetail);
|
|
|
+ ghDetail.setGhId(ghDetailVo.getAccountId());
|
|
|
+ ghDetail.setGhName(ghDetailVo.getAccountName());
|
|
|
ghDetailMapper.updateByPrimaryKeySelective(ghDetail);
|
|
|
return CommonResponse.success();
|
|
|
} catch (Exception e) {
|