测评摘要;测评列表查询;其他优化

This commit is contained in:
cjw 2024-04-29 15:42:05 +08:00
parent b69c473dbc
commit 1c6ed99cf3
5 changed files with 26 additions and 6 deletions

View File

@ -67,6 +67,10 @@ public class SysScalePublishVo implements Serializable {
@ExcelProperty(value = "0:不允许1允许")
private Integer allowQueryResult;
private Long create_by;
private String createName;
private List<SysScaleVo> scaleList;

View File

@ -27,4 +27,6 @@ public interface SysScalePublishMapper extends BaseMapperPlus<SysScalePublish, S
List<EvaluationVo> selectUndoneEvaluationVoList(@Param("batchNo") Long batchNo);
SysScalePublishVo selectPublishVoById(@Param("batchNo") Long batchNo);
}

View File

@ -36,6 +36,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.rmi.ServerException;
import java.util.ArrayList;
import java.util.List;
@ -123,13 +124,22 @@ public class SysEvaluationRecordServiceImpl implements ISysEvaluationRecordServi
@Override
public XWPFTemplate getWordTemplate(BaseQueryBo bo) throws IOException {
Long userId = bo.getUserId();
if (userId == null) {
throw new ServerException("用户ID不能为空");
}
Long recordId = bo.getRecordId();
if (recordId == null) {
throw new ServerException("记录ID不能为空");
}
Long scaleId = bo.getScaleId();
if (scaleId == null) {
throw new ServerException("量表ID不能为空");
}
EvaluationEecordWordData wordData = new EvaluationEecordWordData();
SysUserVo user = userMapper.selectUserById(userId);
wordData.setNickName(user.getNickName());
wordData.setDeptName(user.getDept().getDeptName());
wordData.setSex("1".equals(user.getSex()) ? "" : "");
wordData.setSex("0".equals(user.getSex()) ? "" : "");
SysScaleVo scale = scaleMapper.selectVoById(scaleId);
wordData.setScaleName(scale.getScaleName());
wordData.setScaleDetails(scale.getScaleDetails());

View File

@ -61,7 +61,7 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
*/
@Override
public SysScalePublishVo queryById(Long batchNo) {
return baseMapper.selectVoById(batchNo);
return baseMapper.selectPublishVoById(batchNo);
}
/**
@ -84,13 +84,10 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
}
private LambdaQueryWrapper<SysScalePublish> buildQueryWrapper(SysScalePublishBo bo) {
//Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<SysScalePublish> lqw = Wrappers.lambdaQuery();
// lqw.eq(StringUtils.isNotBlank(bo.getScaleIds()), SysScalePublish::getScaleIds, bo.getScaleIds());
lqw.like(StringUtils.isNotBlank(bo.getScaleNames()), SysScalePublish::getScaleNames, bo.getScaleNames());
lqw.like(StringUtils.isNotBlank(bo.getSessionName()), SysScalePublish::getSessionName, bo.getSessionName());
// lqw.(StringUtils.isNotBlank(bo.getDeptIds()), SysScalePublish::getSessionName, bo.getSessionName());
// lqw.eq(bo.getExpireTime() != null, SysScalePublish::getExpireTime, bo.getExpireTime());
lqw.like(StringUtils.isNotBlank(bo.getDeptNames()), SysScalePublish::getDeptNames, bo.getDeptNames());
lqw.eq(bo.getStatus() != null, SysScalePublish::getStatus, bo.getStatus());
lqw.eq(bo.getAllowQueryResult() != null, SysScalePublish::getAllowQueryResult, bo.getAllowQueryResult());
return lqw;

View File

@ -54,4 +54,11 @@
and er.status = 0
order by d.dept_id
</select>
<select id="selectPublishVoById" resultType="org.dromara.scale.domain.vo.SysScalePublishVo">
select sp.*,
u.nick_name as `createName`
from sys_scale_publish sp
left join sys_user u on u.user_id = sp.create_by
</select>
</mapper>