代码提交
This commit is contained in:
parent
7b167fb212
commit
5642558ecb
|
@ -37,8 +37,8 @@ public class InjectionMetaObjectHandler implements MetaObjectHandler {
|
|||
baseEntity.setCreateBy(userId);
|
||||
// 当前已登录 且 更新人为空 则填充
|
||||
baseEntity.setUpdateBy(userId);
|
||||
// baseEntity.setCreateDept(ObjectUtil.isNotNull(baseEntity.getCreateDept())
|
||||
// ? baseEntity.getCreateDept() : loginUser.getDeptId());
|
||||
baseEntity.setCreateDept(ObjectUtil.isNotNull(baseEntity.getCreateDept())
|
||||
? baseEntity.getCreateDept() : loginUser.getDeptId());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -36,12 +36,6 @@ public class SysScaleFactor extends BaseEntity {
|
|||
* 因子所属量表id
|
||||
*/
|
||||
private Long scaleId;
|
||||
|
||||
/**
|
||||
* 测评量表标题
|
||||
*/
|
||||
private String scaleTitle;
|
||||
|
||||
/**
|
||||
* 分数范围及结果提示
|
||||
*/
|
||||
|
|
|
@ -38,12 +38,6 @@ public class SysScaleFactorBo extends BaseEntity {
|
|||
@NotNull(message = "因子所属量表id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long scaleId;
|
||||
|
||||
/**
|
||||
* 测评量表标题
|
||||
*/
|
||||
@NotBlank(message = "测评量表标题不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String scaleTitle;
|
||||
|
||||
/**
|
||||
* 分数范围及结果提示
|
||||
*/
|
||||
|
|
|
@ -13,7 +13,6 @@ import java.io.Serializable;
|
|||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 测评因子视图对象 sys_scale_factor
|
||||
*
|
||||
|
@ -64,5 +63,8 @@ public class SysScaleFactorVo implements Serializable {
|
|||
@ExcelProperty(value = "因子分计算公式")
|
||||
private Long formulaId;
|
||||
|
||||
|
||||
/**
|
||||
* 因子公式名称
|
||||
*/
|
||||
private String formulaName;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.scale.domain.SysScale;
|
||||
import org.dromara.scale.domain.SysScaleFormula;
|
||||
import org.dromara.scale.mapper.SysScaleFormulaMapper;
|
||||
import org.dromara.scale.mapper.SysScaleMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.scale.domain.bo.SysScaleFactorBo;
|
||||
import org.dromara.scale.domain.vo.SysScaleFactorVo;
|
||||
|
@ -30,12 +34,14 @@ import java.util.Collection;
|
|||
public class SysScaleFactorServiceImpl implements ISysScaleFactorService {
|
||||
|
||||
private final SysScaleFactorMapper baseMapper;
|
||||
private final SysScaleMapper sysScaleMapper;
|
||||
private final SysScaleFormulaMapper sysScaleFormulaMapper;
|
||||
|
||||
/**
|
||||
* 查询测评因子
|
||||
*/
|
||||
@Override
|
||||
public SysScaleFactorVo queryById(Long factorId){
|
||||
public SysScaleFactorVo queryById(Long factorId) {
|
||||
return baseMapper.selectVoById(factorId);
|
||||
}
|
||||
|
||||
|
@ -46,6 +52,13 @@ public class SysScaleFactorServiceImpl implements ISysScaleFactorService {
|
|||
public TableDataInfo<SysScaleFactorVo> queryPageList(SysScaleFactorBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysScaleFactor> lqw = buildQueryWrapper(bo);
|
||||
Page<SysScaleFactorVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
for (SysScaleFactorVo record : result.getRecords()) {
|
||||
SysScale sysScale = sysScaleMapper.selectById(record.getScaleId());
|
||||
record.setScaleTitle(sysScale.getScaleTitle());
|
||||
|
||||
SysScaleFormula sysScaleFormula = sysScaleFormulaMapper.selectById(record.getFormulaId());
|
||||
record.setFormulaName(sysScaleFormula.getFormulaName());
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
@ -63,7 +76,6 @@ public class SysScaleFactorServiceImpl implements ISysScaleFactorService {
|
|||
LambdaQueryWrapper<SysScaleFactor> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getFactorName()), SysScaleFactor::getFactorName, bo.getFactorName());
|
||||
lqw.eq(bo.getScaleId() != null, SysScaleFactor::getScaleId, bo.getScaleId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getScaleTitle()), SysScaleFactor::getScaleTitle, bo.getScaleTitle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFactorResult()), SysScaleFactor::getFactorResult, bo.getFactorResult());
|
||||
lqw.eq(bo.getFormulaId() != null, SysScaleFactor::getFormulaId, bo.getFormulaId());
|
||||
return lqw;
|
||||
|
@ -96,7 +108,7 @@ public class SysScaleFactorServiceImpl implements ISysScaleFactorService {
|
|||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(SysScaleFactor entity){
|
||||
private void validEntityBeforeSave(SysScaleFactor entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
|
@ -105,7 +117,7 @@ public class SysScaleFactorServiceImpl implements ISysScaleFactorService {
|
|||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
|
|
Loading…
Reference in New Issue