|
|
|
@ -9,6 +9,7 @@ import com.github.yulichang.toolkit.JoinWrappers;
|
|
|
|
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.dromara.system.domain.SysPrintTemplateList;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.dromara.system.domain.bo.SysPrintTemplateInfoBo;
|
|
|
|
|
import org.dromara.system.domain.vo.SysPrintTemplateInfoVo;
|
|
|
|
@ -39,7 +40,7 @@ public class SysPrintTemplateInfoServiceImpl implements ISysPrintTemplateInfoSer
|
|
|
|
|
* @return 打印模板信息
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public SysPrintTemplateInfoVo queryById(Long templateInfoId){
|
|
|
|
|
public SysPrintTemplateInfoVo queryById(Long templateInfoId) {
|
|
|
|
|
return baseMapper.selectVoById(templateInfoId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -72,16 +73,18 @@ public class SysPrintTemplateInfoServiceImpl implements ISysPrintTemplateInfoSer
|
|
|
|
|
private MPJLambdaWrapper<SysPrintTemplateInfo> buildQueryWrapper(SysPrintTemplateInfoBo bo) {
|
|
|
|
|
Map<String, Object> params = bo.getParams();
|
|
|
|
|
MPJLambdaWrapper<SysPrintTemplateInfo> lqw = JoinWrappers.lambda(SysPrintTemplateInfo.class)
|
|
|
|
|
.selectAll(SysPrintTemplateInfo.class)
|
|
|
|
|
.eq(bo.getTemplateInfoId() != null, SysPrintTemplateInfo::getTemplateInfoId, bo.getTemplateInfoId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getTemplateListId()), SysPrintTemplateInfo::getTemplateListId, bo.getTemplateListId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getPaperType()), SysPrintTemplateInfo::getPaperType, bo.getPaperType())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getWidth()), SysPrintTemplateInfo::getWidth, bo.getWidth())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getHeight()), SysPrintTemplateInfo::getHeight, bo.getHeight())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getBackgroundColor()), SysPrintTemplateInfo::getBackgroundColor, bo.getBackgroundColor())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getOrientation()), SysPrintTemplateInfo::getOrientation, bo.getOrientation())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), SysPrintTemplateInfo::getActiveFlag, bo.getActiveFlag())
|
|
|
|
|
.orderByAsc(SysPrintTemplateInfo::getCreateTime);
|
|
|
|
|
.selectAll(SysPrintTemplateInfo.class)
|
|
|
|
|
.select(SysPrintTemplateList::getTemplateName)
|
|
|
|
|
.leftJoin(SysPrintTemplateList.class, SysPrintTemplateList::getTemplateListId, SysPrintTemplateInfo::getTemplateListId)
|
|
|
|
|
.eq(bo.getTemplateInfoId() != null, SysPrintTemplateInfo::getTemplateInfoId, bo.getTemplateInfoId())
|
|
|
|
|
.eq(StringUtils.isNotNull(bo.getTemplateListId()), SysPrintTemplateInfo::getTemplateListId, bo.getTemplateListId())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getPaperType()), SysPrintTemplateInfo::getPaperType, bo.getPaperType())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getWidth()), SysPrintTemplateInfo::getWidth, bo.getWidth())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getHeight()), SysPrintTemplateInfo::getHeight, bo.getHeight())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getBackgroundColor()), SysPrintTemplateInfo::getBackgroundColor, bo.getBackgroundColor())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getOrientation()), SysPrintTemplateInfo::getOrientation, bo.getOrientation())
|
|
|
|
|
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), SysPrintTemplateInfo::getActiveFlag, bo.getActiveFlag())
|
|
|
|
|
.orderByAsc(SysPrintTemplateInfo::getCreateTime);
|
|
|
|
|
return lqw;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -118,7 +121,7 @@ public class SysPrintTemplateInfoServiceImpl implements ISysPrintTemplateInfoSer
|
|
|
|
|
/**
|
|
|
|
|
* 保存前的数据校验
|
|
|
|
|
*/
|
|
|
|
|
private void validEntityBeforeSave(SysPrintTemplateInfo entity){
|
|
|
|
|
private void validEntityBeforeSave(SysPrintTemplateInfo entity) {
|
|
|
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -131,7 +134,7 @@ public class SysPrintTemplateInfoServiceImpl implements ISysPrintTemplateInfoSer
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
|
|
if(isValid){
|
|
|
|
|
if (isValid) {
|
|
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
|
}
|
|
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
|
|