导出未测名单;其他优化
This commit is contained in:
parent
64b1ec420d
commit
b69c473dbc
|
@ -1,11 +1,13 @@
|
|||
package org.dromara.scale.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
|
@ -20,6 +22,8 @@ import org.dromara.scale.service.ISysScalePublishService;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 量表发布
|
||||
*
|
||||
|
@ -52,6 +56,16 @@ public class ScalePublishController extends BaseController {
|
|||
return sysScalePublishService.getEvaluationList(query, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取量测进度
|
||||
*/
|
||||
@SaCheckPermission("publish:evaluation:export")
|
||||
@GetMapping("/evaluation/undone/export")
|
||||
public void export(BaseQueryBo query, HttpServletResponse response) {
|
||||
List<EvaluationVo> list = sysScalePublishService.queryUndoneExportList(query);
|
||||
ExcelUtil.exportExcel(list, query.getSessionName() + "的未测名单", EvaluationVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取量表发布详细信息
|
||||
*
|
||||
|
@ -99,17 +113,5 @@ public class ScalePublishController extends BaseController {
|
|||
return toAjax(sysScalePublishService.end(bo));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 删除量表发布
|
||||
// *
|
||||
// * @param batchNos 主键串
|
||||
// */
|
||||
// @SaCheckPermission("scale:publish:remove")
|
||||
// @Log(title = "删除量表发布", businessType = BusinessType.DELETE)
|
||||
// @DeleteMapping("/{batchNo}")
|
||||
// public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long batchNos) {
|
||||
// return toAjax(sysScalePublishService.deleteWithValidByIds(List.of(batchNos), true));
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ public class ArchiveStatisticVo implements Serializable {
|
|||
|
||||
private String scaleName;
|
||||
|
||||
private Long recordId;
|
||||
|
||||
private Integer situation;
|
||||
|
||||
private String createTime;
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package org.dromara.scale.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
|
@ -13,6 +15,7 @@ import java.io.Serializable;
|
|||
* @date 2024/4/21 15:44
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class EvaluationVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
|
@ -22,15 +25,15 @@ public class EvaluationVo implements Serializable {
|
|||
private Long recordId;
|
||||
|
||||
private Long scaleId;
|
||||
|
||||
@ExcelProperty(value = "量表名称")
|
||||
private String scaleName;
|
||||
|
||||
private Long userId;
|
||||
|
||||
@ExcelProperty(value = "测试人姓名")
|
||||
private String nickName;
|
||||
|
||||
private Long deptId;
|
||||
|
||||
@ExcelProperty(value = "班级")
|
||||
private String deptName;
|
||||
|
||||
private Integer status;
|
||||
|
|
|
@ -25,4 +25,6 @@ public interface SysScalePublishMapper extends BaseMapperPlus<SysScalePublish, S
|
|||
|
||||
SysScalePublish selectUsePublishByDeptId(Long deptId);
|
||||
|
||||
List<EvaluationVo> selectUndoneEvaluationVoList(@Param("batchNo") Long batchNo);
|
||||
|
||||
}
|
||||
|
|
|
@ -53,4 +53,6 @@ public interface ISysScalePublishService {
|
|||
|
||||
TableDataInfo<EvaluationVo> getEvaluationList(BaseQueryBo query, PageQuery pageQuery);
|
||||
|
||||
List<EvaluationVo> queryUndoneExportList(BaseQueryBo query);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.scale.domain.vo.ArchiveStatisticVo;
|
||||
|
@ -28,7 +29,8 @@ public class ArchiveServiceImpl implements IArchiveService {
|
|||
@Override
|
||||
public TableDataInfo<ArchiveVo> queryPageList(ArchiveVo vo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ArchiveVo> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(vo.getNickName() != null, ArchiveVo::getNickName, vo.getNickName());
|
||||
lqw.like(StringUtils.isNotEmpty(vo.getNickName()), ArchiveVo::getNickName, vo.getNickName());
|
||||
lqw.like(StringUtils.isNotEmpty(vo.getPhonenumber()), ArchiveVo::getPhonenumber, vo.getPhonenumber());
|
||||
Page<ArchiveVo> result = archiveMapper.selectArchiveVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
|
|
@ -196,4 +196,9 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
|||
Page<EvaluationVo> result = baseMapper.selectEvaluationVoList(pageQuery.build(), batchNo, scaleId, deptId);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EvaluationVo> queryUndoneExportList(BaseQueryBo query) {
|
||||
return baseMapper.selectUndoneEvaluationVoList(query.getBatchNo());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
s.scale_id,
|
||||
s.scale_name,
|
||||
MAX(sfr.situation) as `situation`,
|
||||
er.create_time
|
||||
er.create_time,
|
||||
er.record_id
|
||||
from sys_evaluation_record er
|
||||
left join sys_scale s on s.scale_id = er.scale_id
|
||||
left join sys_scale_publish sp on sp.batch_no = er.batch_no
|
||||
|
|
|
@ -36,4 +36,22 @@
|
|||
where status = 1
|
||||
and find_in_set(#{deptId}, dept_ids)
|
||||
</select>
|
||||
|
||||
<select id="selectUndoneEvaluationVoList" resultType="org.dromara.scale.domain.vo.EvaluationVo">
|
||||
select d.dept_id,
|
||||
d.dept_name,
|
||||
u.user_id,
|
||||
u.nick_name,
|
||||
s.scale_id,
|
||||
s.scale_name,
|
||||
er.record_id,
|
||||
er.status
|
||||
from sys_evaluation_record er
|
||||
left join sys_scale s on s.scale_id = er.scale_id
|
||||
left join sys_dept d on d.dept_id = er.dept_id
|
||||
left join sys_user u on u.dept_id = d.dept_id
|
||||
where er.batch_no = #{batchNo}
|
||||
and er.status = 0
|
||||
order by d.dept_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue