|
|
|
package com.ruoyi.compliancemanagement.service.impl;
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
|
import com.ruoyi.common.core.domain.PageQuery;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import com.ruoyi.compliancemanagement.domain.TblOutsideCounsel;
|
|
|
|
import com.ruoyi.compliancemanagement.domain.bo.TblOutsideCounselBo;
|
|
|
|
import com.ruoyi.compliancemanagement.domain.vo.TblOutsideCounselVo;
|
|
|
|
import com.ruoyi.compliancemanagement.mapper.TblOutsideCounselMapper;
|
|
|
|
import com.ruoyi.compliancemanagement.service.ITblOutsideCounselService;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Collection;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 【请填写功能名称】Service业务层处理
|
|
|
|
*
|
|
|
|
* @author ruoyi
|
|
|
|
* @date 2024-08-06
|
|
|
|
*/
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
@Service
|
|
|
|
public class TblOutsideCounselServiceImpl implements ITblOutsideCounselService {
|
|
|
|
|
|
|
|
private final TblOutsideCounselMapper baseMapper;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询【请填写功能名称】
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public TblOutsideCounselVo queryById(Long id){
|
|
|
|
return baseMapper.selectVoById(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询【请填写功能名称】列表
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public TableDataInfo<TblOutsideCounselVo> queryPageList(TblOutsideCounselBo bo, PageQuery pageQuery) {
|
|
|
|
LambdaQueryWrapper<TblOutsideCounsel> lqw = buildQueryWrapper(bo);
|
|
|
|
Page<TblOutsideCounselVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
|
return TableDataInfo.build(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查询【请填写功能名称】列表
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public List<TblOutsideCounselVo> queryList(TblOutsideCounselBo bo) {
|
|
|
|
LambdaQueryWrapper<TblOutsideCounsel> lqw = buildQueryWrapper(bo);
|
|
|
|
return baseMapper.selectVoList(lqw);
|
|
|
|
}
|
|
|
|
|
|
|
|
private LambdaQueryWrapper<TblOutsideCounsel> buildQueryWrapper(TblOutsideCounselBo bo) {
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
LambdaQueryWrapper<TblOutsideCounsel> lqw = Wrappers.lambdaQuery();
|
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getLawyerName()), TblOutsideCounsel::getLawyerName, bo.getLawyerName());
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getSpecial()), TblOutsideCounsel::getSpecial, bo.getSpecial());
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getSpecialAttachments()), TblOutsideCounsel::getSpecialAttachments, bo.getSpecialAttachments());
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getSponsorAttorney()), TblOutsideCounsel::getSponsorAttorney, bo.getSponsorAttorney());
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getTerm()), TblOutsideCounsel::getTerm, bo.getTerm());
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getAgreementFees()), TblOutsideCounsel::getAgreementFees, bo.getAgreementFees());
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getPaymentTerm()), TblOutsideCounsel::getPaymentTerm, bo.getPaymentTerm());
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getOpenOrConsultations()), TblOutsideCounsel::getOpenOrConsultations, bo.getOpenOrConsultations());
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getOesumeAttachments()), TblOutsideCounsel::getOesumeAttachments, bo.getOesumeAttachments());
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getResult()), TblOutsideCounsel::getResult, bo.getResult());
|
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getNotes()), TblOutsideCounsel::getNotes, bo.getNotes());
|
|
|
|
return lqw;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 新增【请填写功能名称】
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public Boolean insertByBo(TblOutsideCounselBo bo) {
|
|
|
|
TblOutsideCounsel add = BeanUtil.toBean(bo, TblOutsideCounsel.class);
|
|
|
|
validEntityBeforeSave(add);
|
|
|
|
boolean flag = baseMapper.insert(add) > 0;
|
|
|
|
if (flag) {
|
|
|
|
bo.setId(add.getId());
|
|
|
|
}
|
|
|
|
return flag;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 修改【请填写功能名称】
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public Boolean updateByBo(TblOutsideCounselBo bo) {
|
|
|
|
TblOutsideCounsel update = BeanUtil.toBean(bo, TblOutsideCounsel.class);
|
|
|
|
validEntityBeforeSave(update);
|
|
|
|
return baseMapper.updateById(update) > 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 保存前的数据校验
|
|
|
|
*/
|
|
|
|
private void validEntityBeforeSave(TblOutsideCounsel entity){
|
|
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 批量删除【请填写功能名称】
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
|
if(isValid){
|
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
}
|
|
|
|
return baseMapper.deleteBatchIds(ids) > 0;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|