|
@@ -1,6 +1,9 @@
|
|
|
package org.dromara.backstage.consumption.service.impl;
|
|
package org.dromara.backstage.consumption.service.impl;
|
|
|
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
|
|
+import org.dromara.backstage.consumption.domain.XfCreditAccount;
|
|
|
|
|
+import org.dromara.backstage.consumption.domain.bo.XfCreditAccountBo;
|
|
|
|
|
+import org.dromara.backstage.consumption.domain.vo.XfCreditAccountVo;
|
|
|
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;
|
|
@@ -10,9 +13,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.dromara.backstage.consumption.domain.bo.XfCreditaccountBo;
|
|
|
|
|
-import org.dromara.backstage.consumption.domain.vo.XfCreditaccountVo;
|
|
|
|
|
-import org.dromara.backstage.consumption.domain.XfCreditaccount;
|
|
|
|
|
import org.dromara.backstage.consumption.mapper.XfCreditaccountMapper;
|
|
import org.dromara.backstage.consumption.mapper.XfCreditaccountMapper;
|
|
|
import org.dromara.backstage.consumption.service.IXfCreditAccountService;
|
|
import org.dromara.backstage.consumption.service.IXfCreditAccountService;
|
|
|
|
|
|
|
@@ -40,7 +40,7 @@ public class XfCreditAccountServiceImpl implements IXfCreditAccountService {
|
|
|
* @return 资金收支明细
|
|
* @return 资金收支明细
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public XfCreditaccountVo queryById(String creditId){
|
|
|
|
|
|
|
+ public XfCreditAccountVo queryById(String creditId){
|
|
|
return baseMapper.selectVoById(creditId);
|
|
return baseMapper.selectVoById(creditId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -52,9 +52,9 @@ public class XfCreditAccountServiceImpl implements IXfCreditAccountService {
|
|
|
* @return 资金收支明细分页列表
|
|
* @return 资金收支明细分页列表
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public TableDataInfo<XfCreditaccountVo> queryPageList(XfCreditaccountBo bo, PageQuery pageQuery) {
|
|
|
|
|
- LambdaQueryWrapper<XfCreditaccount> lqw = buildQueryWrapper(bo);
|
|
|
|
|
- Page<XfCreditaccountVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
|
|
|
|
+ public TableDataInfo<XfCreditAccountVo> queryPageList(XfCreditAccountBo bo, PageQuery pageQuery) {
|
|
|
|
|
+ LambdaQueryWrapper<XfCreditAccount> lqw = buildQueryWrapper(bo);
|
|
|
|
|
+ Page<XfCreditAccountVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
return TableDataInfo.build(result);
|
|
return TableDataInfo.build(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -65,44 +65,44 @@ public class XfCreditAccountServiceImpl implements IXfCreditAccountService {
|
|
|
* @return 资金收支明细列表
|
|
* @return 资金收支明细列表
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public List<XfCreditaccountVo> queryList(XfCreditaccountBo bo) {
|
|
|
|
|
- LambdaQueryWrapper<XfCreditaccount> lqw = buildQueryWrapper(bo);
|
|
|
|
|
|
|
+ public List<XfCreditAccountVo> queryList(XfCreditAccountBo bo) {
|
|
|
|
|
+ LambdaQueryWrapper<XfCreditAccount> lqw = buildQueryWrapper(bo);
|
|
|
return baseMapper.selectVoList(lqw);
|
|
return baseMapper.selectVoList(lqw);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private LambdaQueryWrapper<XfCreditaccount> buildQueryWrapper(XfCreditaccountBo bo) {
|
|
|
|
|
|
|
+ private LambdaQueryWrapper<XfCreditAccount> buildQueryWrapper(XfCreditAccountBo bo) {
|
|
|
Map<String, Object> params = bo.getParams();
|
|
Map<String, Object> params = bo.getParams();
|
|
|
- LambdaQueryWrapper<XfCreditaccount> lqw = Wrappers.lambdaQuery();
|
|
|
|
|
- lqw.eq(bo.getUserId() != null, XfCreditaccount::getUserId, bo.getUserId());
|
|
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getUserNumb()), XfCreditaccount::getUserNumb, bo.getUserNumb());
|
|
|
|
|
- lqw.like(StringUtils.isNotBlank(bo.getRealName()), XfCreditaccount::getRealName, bo.getRealName());
|
|
|
|
|
- lqw.eq(bo.getDeptId() != null, XfCreditaccount::getDeptId, bo.getDeptId());
|
|
|
|
|
- lqw.like(StringUtils.isNotBlank(bo.getDeptName()), XfCreditaccount::getDeptName, bo.getDeptName());
|
|
|
|
|
- lqw.eq(bo.getTermNo() != null, XfCreditaccount::getTermNo, bo.getTermNo());
|
|
|
|
|
- lqw.like(StringUtils.isNotBlank(bo.getTermName()), XfCreditaccount::getTermName, bo.getTermName());
|
|
|
|
|
- lqw.eq(bo.getTermRecordId() != null, XfCreditaccount::getTermRecordId, bo.getTermRecordId());
|
|
|
|
|
- lqw.eq(bo.getCardNo() != null, XfCreditaccount::getCardNo, bo.getCardNo());
|
|
|
|
|
- lqw.eq(bo.getCardValue() != null, XfCreditaccount::getCardValue, bo.getCardValue());
|
|
|
|
|
- lqw.eq(bo.getCardType() != null, XfCreditaccount::getCardType, bo.getCardType());
|
|
|
|
|
- lqw.eq(bo.getCardCount() != null, XfCreditaccount::getCardCount, bo.getCardCount());
|
|
|
|
|
- lqw.like(StringUtils.isNotBlank(bo.getCardTypeName()), XfCreditaccount::getCardTypeName, bo.getCardTypeName());
|
|
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getMainCard()), XfCreditaccount::getMainCard, bo.getMainCard());
|
|
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getBagType()), XfCreditaccount::getBagType, bo.getBagType());
|
|
|
|
|
- lqw.eq(bo.getUseYpe() != null, XfCreditaccount::getUseYpe, bo.getUseYpe());
|
|
|
|
|
- lqw.eq(bo.getStationNumb() != null, XfCreditaccount::getStationNumb, bo.getStationNumb());
|
|
|
|
|
- lqw.like(StringUtils.isNotBlank(bo.getStationName()), XfCreditaccount::getStationName, bo.getStationName());
|
|
|
|
|
- lqw.eq(bo.getOperatorId() != null, XfCreditaccount::getOperatorId, bo.getOperatorId());
|
|
|
|
|
- lqw.like(StringUtils.isNotBlank(bo.getOperatorName()), XfCreditaccount::getOperatorName, bo.getOperatorName());
|
|
|
|
|
- lqw.eq(bo.getCreditTime() != null, XfCreditaccount::getCreditTime, bo.getCreditTime());
|
|
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getCreditType()), XfCreditaccount::getCreditType, bo.getCreditType());
|
|
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getPayStyle()), XfCreditaccount::getPayStyle, bo.getPayStyle());
|
|
|
|
|
- lqw.eq(bo.getReceiptMoney() != null, XfCreditaccount::getReceiptMoney, bo.getReceiptMoney());
|
|
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), XfCreditaccount::getAuditStatus, bo.getAuditStatus());
|
|
|
|
|
- lqw.eq(bo.getAuditDate() != null, XfCreditaccount::getAuditDate, bo.getAuditDate());
|
|
|
|
|
- lqw.eq(bo.getGroupId() != null, XfCreditaccount::getGroupId, bo.getGroupId());
|
|
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getOriginalId()), XfCreditaccount::getOriginalId, bo.getOriginalId());
|
|
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getSmsSend()), XfCreditaccount::getSmsSend, bo.getSmsSend());
|
|
|
|
|
- lqw.eq(bo.getRecordStatus() != null, XfCreditaccount::getRecordStatus, bo.getRecordStatus());
|
|
|
|
|
|
|
+ LambdaQueryWrapper<XfCreditAccount> lqw = Wrappers.lambdaQuery();
|
|
|
|
|
+ lqw.eq(bo.getUserId() != null, XfCreditAccount::getUserId, bo.getUserId());
|
|
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getUserNumb()), XfCreditAccount::getUserNumb, bo.getUserNumb());
|
|
|
|
|
+ lqw.like(StringUtils.isNotBlank(bo.getRealName()), XfCreditAccount::getRealName, bo.getRealName());
|
|
|
|
|
+ lqw.eq(bo.getDeptId() != null, XfCreditAccount::getDeptId, bo.getDeptId());
|
|
|
|
|
+ lqw.like(StringUtils.isNotBlank(bo.getDeptName()), XfCreditAccount::getDeptName, bo.getDeptName());
|
|
|
|
|
+ lqw.eq(bo.getTermNo() != null, XfCreditAccount::getTermNo, bo.getTermNo());
|
|
|
|
|
+ lqw.like(StringUtils.isNotBlank(bo.getTermName()), XfCreditAccount::getTermName, bo.getTermName());
|
|
|
|
|
+ lqw.eq(bo.getTermRecordId() != null, XfCreditAccount::getTermRecordId, bo.getTermRecordId());
|
|
|
|
|
+ lqw.eq(bo.getCardNo() != null, XfCreditAccount::getCardNo, bo.getCardNo());
|
|
|
|
|
+ lqw.eq(bo.getCardValue() != null, XfCreditAccount::getCardValue, bo.getCardValue());
|
|
|
|
|
+ lqw.eq(bo.getCardType() != null, XfCreditAccount::getCardType, bo.getCardType());
|
|
|
|
|
+ lqw.eq(bo.getCardCount() != null, XfCreditAccount::getCardCount, bo.getCardCount());
|
|
|
|
|
+ lqw.like(StringUtils.isNotBlank(bo.getCardTypeName()), XfCreditAccount::getCardTypeName, bo.getCardTypeName());
|
|
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getMainCard()), XfCreditAccount::getMainCard, bo.getMainCard());
|
|
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getBagType()), XfCreditAccount::getBagType, bo.getBagType());
|
|
|
|
|
+ lqw.eq(bo.getUseType() != null, XfCreditAccount::getUseType, bo.getUseType());
|
|
|
|
|
+ lqw.eq(bo.getStationNumb() != null, XfCreditAccount::getStationNumb, bo.getStationNumb());
|
|
|
|
|
+ lqw.like(StringUtils.isNotBlank(bo.getStationName()), XfCreditAccount::getStationName, bo.getStationName());
|
|
|
|
|
+ lqw.eq(bo.getOperatorId() != null, XfCreditAccount::getOperatorId, bo.getOperatorId());
|
|
|
|
|
+ lqw.like(StringUtils.isNotBlank(bo.getOperatorName()), XfCreditAccount::getOperatorName, bo.getOperatorName());
|
|
|
|
|
+ lqw.eq(bo.getCreditTime() != null, XfCreditAccount::getCreditTime, bo.getCreditTime());
|
|
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getCreditType()), XfCreditAccount::getCreditType, bo.getCreditType());
|
|
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getPayStyle()), XfCreditAccount::getPayStyle, bo.getPayStyle());
|
|
|
|
|
+ lqw.eq(bo.getReceiptMoney() != null, XfCreditAccount::getReceiptMoney, bo.getReceiptMoney());
|
|
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), XfCreditAccount::getAuditStatus, bo.getAuditStatus());
|
|
|
|
|
+ lqw.eq(bo.getAuditDate() != null, XfCreditAccount::getAuditDate, bo.getAuditDate());
|
|
|
|
|
+ lqw.eq(bo.getGroupId() != null, XfCreditAccount::getGroupId, bo.getGroupId());
|
|
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getOriginalId()), XfCreditAccount::getOriginalId, bo.getOriginalId());
|
|
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getSmsSend()), XfCreditAccount::getSmsSend, bo.getSmsSend());
|
|
|
|
|
+ lqw.eq(bo.getRecordStatus() != null, XfCreditAccount::getRecordStatus, bo.getRecordStatus());
|
|
|
return lqw;
|
|
return lqw;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -113,12 +113,14 @@ public class XfCreditAccountServiceImpl implements IXfCreditAccountService {
|
|
|
* @return 是否新增成功
|
|
* @return 是否新增成功
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public Boolean insertByBo(XfCreditaccountBo bo) {
|
|
|
|
|
- XfCreditaccount add = MapstructUtils.convert(bo, XfCreditaccount.class);
|
|
|
|
|
|
|
+ public Boolean insertByBo(XfCreditAccountBo bo) {
|
|
|
|
|
+ XfCreditAccount add = MapstructUtils.convert(bo, XfCreditAccount.class);
|
|
|
validEntityBeforeSave(add);
|
|
validEntityBeforeSave(add);
|
|
|
boolean flag = baseMapper.insert(add) > 0;
|
|
boolean flag = baseMapper.insert(add) > 0;
|
|
|
if (flag) {
|
|
if (flag) {
|
|
|
- bo.setCreditId(add.getCreditId());
|
|
|
|
|
|
|
+ if (add != null) {
|
|
|
|
|
+ bo.setCreditId(add.getCreditId());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return flag;
|
|
return flag;
|
|
|
}
|
|
}
|
|
@@ -130,8 +132,8 @@ public class XfCreditAccountServiceImpl implements IXfCreditAccountService {
|
|
|
* @return 是否修改成功
|
|
* @return 是否修改成功
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public Boolean updateByBo(XfCreditaccountBo bo) {
|
|
|
|
|
- XfCreditaccount update = MapstructUtils.convert(bo, XfCreditaccount.class);
|
|
|
|
|
|
|
+ public Boolean updateByBo(XfCreditAccountBo bo) {
|
|
|
|
|
+ XfCreditAccount update = MapstructUtils.convert(bo, XfCreditAccount.class);
|
|
|
validEntityBeforeSave(update);
|
|
validEntityBeforeSave(update);
|
|
|
return baseMapper.updateById(update) > 0;
|
|
return baseMapper.updateById(update) > 0;
|
|
|
}
|
|
}
|
|
@@ -139,7 +141,7 @@ public class XfCreditAccountServiceImpl implements IXfCreditAccountService {
|
|
|
/**
|
|
/**
|
|
|
* 保存前的数据校验
|
|
* 保存前的数据校验
|
|
|
*/
|
|
*/
|
|
|
- private void validEntityBeforeSave(XfCreditaccount entity){
|
|
|
|
|
|
|
+ private void validEntityBeforeSave(XfCreditAccount entity){
|
|
|
//TODO 做一些数据校验,如唯一约束
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -157,4 +159,13 @@ public class XfCreditAccountServiceImpl implements IXfCreditAccountService {
|
|
|
}
|
|
}
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public XfCreditAccountVo keepAccounts(XfCreditAccountBo bo) {
|
|
|
|
|
+ if(insertByBo(bo)){
|
|
|
|
|
+ return queryById(bo.getCreditId());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|