提交代码
This commit is contained in:
1 parent
582031ac14
commit
cf21360ac1
4 files changed
+79
-41
No files matched your search
+46
-38
@@ -19,46 +19,54 @@ import java.util.Map;
|
||||
*/
|
||||
public interface XskhDisciplineRecordMapper extends BaseMapperPlus<XskhDisciplineRecord, XskhDisciplineRecordVo> {
|
||||
|
||||
/**
|
||||
* 查询学生选项列表(用于下拉框)
|
||||
*
|
||||
* @param keyword 搜索关键词(学号或姓名)
|
||||
* @return 学生选项列表
|
||||
*/
|
||||
List<XskhStudentOptionVo> selectStudentOptions(String keyword);
|
||||
/**
|
||||
* 查询学生选项列表(用于下拉框)
|
||||
*
|
||||
* @param keyword 搜索关键词(学号或姓名)
|
||||
* @return 学生选项列表
|
||||
*/
|
||||
List<XskhStudentOptionVo> selectStudentOptions(String keyword);
|
||||
|
||||
/**
|
||||
* 查询班主任班级的违纪处分记录列表(班主任专用)
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param bo 查询条件
|
||||
* @param classTeacherId 班主任ID
|
||||
* @return 分页查询结果
|
||||
*/
|
||||
Page<XskhDisciplineRecordVo> selectClassTeacherVoPage(@Param("page") Page<XskhDisciplineRecordVo> page,
|
||||
@Param("bo") XskhDisciplineRecordBo bo,
|
||||
@Param("classTeacherId") Long classTeacherId);
|
||||
/**
|
||||
* 查询班主任班级的违纪处分记录列表(班主任专用)
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param bo 查询条件
|
||||
* @param classTeacherId 班主任ID
|
||||
* @return 分页查询结果
|
||||
*/
|
||||
Page<XskhDisciplineRecordVo> selectClassTeacherVoPage(@Param("page") Page<XskhDisciplineRecordVo> page,
|
||||
@Param("bo") XskhDisciplineRecordBo bo,
|
||||
@Param("classTeacherId") Long classTeacherId);
|
||||
|
||||
/**
|
||||
* 获取指标关联的违纪处分类型和奖励类型
|
||||
*
|
||||
* @param indicatorId 指标ID
|
||||
* @return 包含disciplineTypeIds和rewardTypeIds的Map
|
||||
*/
|
||||
Map<String, String> selectIndicatorTypes(@Param("indicatorId") Long indicatorId);
|
||||
/**
|
||||
* 获取指标关联的违纪处分类型和奖励类型
|
||||
*
|
||||
* @param indicatorId 指标ID
|
||||
* @return 包含disciplineTypeIds和rewardTypeIds的Map
|
||||
*/
|
||||
Map<String, String> selectIndicatorTypes(@Param("indicatorId") Long indicatorId);
|
||||
|
||||
/**
|
||||
* 获取学生在指定时间范围内的违纪处分记录
|
||||
*
|
||||
* @param studentId 学生ID
|
||||
* @param disciplineTypeIds 违纪处分类型ID列表
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 违纪处分记录列表
|
||||
*/
|
||||
List<XskhDisciplineRecordVo> selectStudentDisciplineRecords(@Param("studentId") Long studentId,
|
||||
@Param("disciplineTypeIds") List<Long> disciplineTypeIds,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
/**
|
||||
* 获取学生在指定时间范围内的违纪处分记录
|
||||
*
|
||||
* @param studentId 学生ID
|
||||
* @param disciplineTypeIds 违纪处分类型ID列表
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 违纪处分记录列表
|
||||
*/
|
||||
List<XskhDisciplineRecordVo> selectStudentDisciplineRecords(@Param("studentId") Long studentId,
|
||||
@Param("disciplineTypeIds") List<Long> disciplineTypeIds,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 根据违纪记录ID逻辑删除宿舍卫生检查违纪关联记录
|
||||
*
|
||||
* @param disciplineRecordId 违纪记录ID
|
||||
* @return 删除的记录数量
|
||||
*/
|
||||
int deleteHygieneCheckViolationByDisciplineRecordId(@Param("disciplineRecordId") Long disciplineRecordId);
|
||||
|
||||
}
|
||||
+21
@@ -17,6 +17,8 @@ import org.dromara.xskh.domain.vo.XskhStudentOptionVo;
|
||||
import org.dromara.xskh.mapper.XskhDisciplineRecordMapper;
|
||||
import org.dromara.xskh.service.IXskhDisciplineRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -30,6 +32,7 @@ import java.util.stream.Collectors;
|
||||
* @author ruoyi
|
||||
* @date 2025-01-03
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XskhDisciplineRecordServiceImpl implements IXskhDisciplineRecordService {
|
||||
@@ -132,10 +135,28 @@ public class XskhDisciplineRecordServiceImpl implements IXskhDisciplineRecordSer
|
||||
* 批量删除学生违纪处分记录
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
|
||||
// 在删除违纪记录前,先删除相关的宿舍卫生检查违纪关联记录
|
||||
for (Long id : ids) {
|
||||
try {
|
||||
// 查询违纪记录,判断是否为宿舍卫生检查来源
|
||||
XskhDisciplineRecordVo disciplineRecord = baseMapper.selectVoById(id);
|
||||
if (disciplineRecord != null && "1".equals(disciplineRecord.getViolationSource())) {
|
||||
// 删除宿舍卫生检查违纪关联记录
|
||||
int deletedCount = baseMapper.deleteHygieneCheckViolationByDisciplineRecordId(id);
|
||||
log.info("删除违纪记录ID: {} 对应的宿舍卫生检查违纪关联记录,删除数量: {}", id, deletedCount);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("删除违纪记录ID: {} 对应的宿舍卫生检查违纪关联记录失败: {}", id, e.getMessage(), e);
|
||||
throw new RuntimeException("删除宿舍卫生检查违纪关联记录失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -125,4 +125,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<!-- 根据违纪记录ID逻辑删除宿舍卫生检查违纪关联记录 -->
|
||||
<update id="deleteHygieneCheckViolationByDisciplineRecordId" parameterType="Long">
|
||||
update xg_hygiene_check_violation
|
||||
set deleted = 1,
|
||||
update_time = now()
|
||||
where discipline_record_id = #{disciplineRecordId}
|
||||
and deleted = 0
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -184,9 +184,9 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="form-tip">
|
||||
<el-text size="small" type="info">录入违纪记录时,扣分必须在此范围内</el-text>
|
||||
</div>
|
||||
<!-- <div class="form-tip">
|
||||
<el-text size="small" type="info">录入违纪记录时,扣分范围参考</el-text>
|
||||
</div> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="类型说明" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
|
||||
Reference in new issue
Block a user