发布添加部门名称字段

This commit is contained in:
cjw 2024-04-28 17:25:35 +08:00
parent 735eefce57
commit f5a92e89c2
7 changed files with 18 additions and 10 deletions

View File

@ -33,7 +33,6 @@ public class WebController extends BaseController {
private final IWebService webService;
/**
* 查询发布量表
*/

View File

@ -37,10 +37,6 @@ public class SysScalePublish {
*/
@AutoMapping(target = "scaleIds", expression = "java(cn.hutool.core.util.StrUtil.split(source.getScaleIds(), \",\"))")
private String scaleIds;
/**
* 量表名称 以逗号隔开
*/
@AutoMapping(target = "scaleNames", expression = "java(cn.hutool.core.util.StrUtil.split(source.getScaleNames(), \",\"))")
private String scaleNames;
@ -54,6 +50,8 @@ public class SysScalePublish {
*/
@AutoMapping(target = "deptIds", expression = "java(cn.hutool.core.util.StrUtil.split(source.getDeptIds(), \",\"))")
private String deptIds;
@AutoMapping(target = "deptNames", expression = "java(cn.hutool.core.util.StrUtil.split(source.getDeptNames(), \",\"))")
private String deptNames;
/**
* 截止日期

View File

@ -52,6 +52,7 @@ public class SysScalePublishBo {
@AutoMapping(target = "deptIds", expression = "java(java.lang.String.join(\",\", source.getDeptIds()))")
private List<String> deptIds;
private String deptNames;
/**
* 截止日期
*/

View File

@ -34,11 +34,6 @@ public class SysScalePublishVo implements Serializable {
*/
@ExcelProperty(value = "量表id以逗号隔开")
List<String> scaleIds;
/**
* 量表名称 以逗号隔开
*/
@ExcelProperty(value = "量表名称 以逗号隔开")
List<String> scaleNames;
/**
@ -52,6 +47,7 @@ public class SysScalePublishVo implements Serializable {
*/
@ExcelProperty(value = "部门分组id")
private List<String> deptIds;
private List<String> deptNames;
/**
* 截止日期

View File

@ -26,6 +26,8 @@ import org.dromara.scale.mapper.SysScaleMapper;
import org.dromara.scale.mapper.SysScalePublishMapper;
import org.dromara.scale.service.ISysEvaluationRecordService;
import org.dromara.scale.service.ISysScalePublishService;
import org.dromara.system.domain.vo.SysDeptVo;
import org.dromara.system.mapper.SysDeptMapper;
import org.springframework.stereotype.Service;
import java.util.Collection;
@ -52,6 +54,8 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
private final ISysEvaluationRecordService evaluationRecordService;
private final SysDeptMapper deptMapper;
/**
* 查询量发布
*/
@ -120,6 +124,8 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
}
//sysScaleMapper.updateBatchById(scaleList, 100);
}
List<SysDeptVo> deptList = deptMapper.findDeptByIds(StrUtil.join(StrUtil.COMMA, bo.getDeptIds()));
add.setDeptNames(deptList.stream().map(SysDeptVo::getDeptName).collect(Collectors.joining(StrUtil.COMMA)));
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setBatchNo(add.getBatchNo());

View File

@ -47,4 +47,6 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo> {
String selectAncestorsById(Long deptId);
List<SysDeptVo> findDeptByIds(String deptIds);
}

View File

@ -29,4 +29,10 @@
<select id="selectAncestorsById" resultType="java.lang.String">
select ancestors from sys_dept where dept_id = #{deptId}
</select>
<select id="findDeptByIds" resultMap="SysDeptResult">
SELECT *
FROM sys_dept d
WHERE FIND_IN_SET(d.dept_id, #{deptIds})
</select>
</mapper>