完善了之前的通知管理功能,支持对发送的通知的批量更改和删除;在学生证补办模块增加了完成制作功能。
This commit is contained in:
@@ -103,4 +103,13 @@ public class CphMsgController extends BaseController
|
|||||||
{
|
{
|
||||||
return toAjax(cphMsgService.deleteCphMsgByIds(ids));
|
return toAjax(cphMsgService.deleteCphMsgByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据学号查询用户ID
|
||||||
|
*/
|
||||||
|
@GetMapping("/getUserIdByStuNo/{stuNo}")
|
||||||
|
public AjaxResult getUserIdByStuNo(@PathVariable("stuNo") String stuNo)
|
||||||
|
{
|
||||||
|
return success(cphMsgService.getUserIdByStuNo(stuNo));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.srs.common.enums.BusinessType;
|
|||||||
import com.srs.common.annotation.Log;
|
import com.srs.common.annotation.Log;
|
||||||
import com.srs.common.core.page.TableDataInfo;
|
import com.srs.common.core.page.TableDataInfo;
|
||||||
import com.srs.comprehensive.domain.SrsGrade;
|
import com.srs.comprehensive.domain.SrsGrade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知管理Controller
|
* 通知管理Controller
|
||||||
*
|
*
|
||||||
@@ -28,18 +29,6 @@ public class NotificationManagementController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private INotificationManagementService notificationManagementService;
|
private INotificationManagementService notificationManagementService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询通知管理列表
|
|
||||||
*/
|
|
||||||
@PreAuthorize("@ss.hasPermi('routine:NotificationManagement:list')")
|
|
||||||
@GetMapping("/list")
|
|
||||||
@ApiOperation("查询通知管理列表")
|
|
||||||
public TableDataInfo list(NotificationManagement notificationManagement)
|
|
||||||
{
|
|
||||||
startPage();
|
|
||||||
List<NotificationManagement> list = notificationManagementService.selectNotificationManagementList(notificationManagement);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出通知管理列表
|
* 导出通知管理列表
|
||||||
@@ -97,9 +86,20 @@ public class NotificationManagementController extends BaseController {
|
|||||||
@Log(title = "通知管理", businessType = BusinessType.DELETE)
|
@Log(title = "通知管理", businessType = BusinessType.DELETE)
|
||||||
@PostMapping("/{ids}")
|
@PostMapping("/{ids}")
|
||||||
@ApiOperation("删除通知管理")
|
@ApiOperation("删除通知管理")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable String ids)
|
||||||
{
|
{
|
||||||
return toAjax(notificationManagementService.deleteNotificationManagementByIds(ids));
|
// 处理逗号分隔的ID字符串
|
||||||
|
String[] idArray = ids.split(",");
|
||||||
|
Long[] idLongArray = new Long[idArray.length];
|
||||||
|
for (int i = 0; i < idArray.length; i++) {
|
||||||
|
idLongArray[i] = Long.parseLong(idArray[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (idLongArray.length == 1) {
|
||||||
|
return toAjax(notificationManagementService.deleteNotificationManagementById(idLongArray[0]));
|
||||||
|
} else {
|
||||||
|
return toAjax(notificationManagementService.deleteNotificationManagementByIds(idLongArray));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -145,8 +145,16 @@ public class RtStuIdReissueController extends BaseController {
|
|||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增学生证补办")
|
@ApiOperation("新增学生证补办")
|
||||||
public AjaxResult add(@RequestBody RtStuIdReissue rtStuIdReissue) {
|
public AjaxResult add(@RequestBody RtStuIdReissue rtStuIdReissue) {
|
||||||
// rtStuIdReissue.setCounsellorId(SecurityUtils.getUserId());
|
// 检查该学号是否已有申请记录
|
||||||
rtStuIdReissue.setCreateBy(SecurityUtils.getUsername());
|
RtStuIdReissue existingApplication = rtStuIdReissueService.selectRtStuIdReissueByStuNo(rtStuIdReissue.getStuNo());
|
||||||
|
if (existingApplication != null) {
|
||||||
|
// 如果已有申请记录且未完成制作,则不允许重复提交
|
||||||
|
if (existingApplication.getInspectionProgress() < 3) {
|
||||||
|
return AjaxResult.error("您已有正在处理的申请,请勿重复提交");
|
||||||
|
}
|
||||||
|
// 如果已完成制作,允许提交新申请,但需要先删除旧记录
|
||||||
|
rtStuIdReissueService.deleteRtStuIdReissueById(existingApplication.getId());
|
||||||
|
}
|
||||||
return toAjax(rtStuIdReissueService.insertRtStuIdReissue(rtStuIdReissue));
|
return toAjax(rtStuIdReissueService.insertRtStuIdReissue(rtStuIdReissue));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,9 +177,30 @@ public class RtStuIdReissueController extends BaseController {
|
|||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperation("修改学生证补办")
|
@ApiOperation("修改学生证补办")
|
||||||
public AjaxResult edit(@RequestBody RtStuIdReissue rtStuIdReissue) {
|
public AjaxResult edit(@RequestBody RtStuIdReissue rtStuIdReissue) {
|
||||||
|
// 检查当前申请状态,如果已完成制作则不允许修改
|
||||||
|
RtStuIdReissue currentApplication = rtStuIdReissueService.selectRtStuIdReissueById(rtStuIdReissue.getId());
|
||||||
|
if (currentApplication != null && currentApplication.getInspectionProgress() >= 3) {
|
||||||
|
return AjaxResult.error("申请已完成制作,不可修改");
|
||||||
|
}
|
||||||
return toAjax(rtStuIdReissueService.updateRtStuIdReissue(rtStuIdReissue));
|
return toAjax(rtStuIdReissueService.updateRtStuIdReissue(rtStuIdReissue));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单个学生证补办申请(学生取消申请)
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('routine:stuIdReissue:remove')")
|
||||||
|
@Log(title = "取消学生证补办申请", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/cancel/{id}")
|
||||||
|
@ApiOperation("取消学生证补办申请")
|
||||||
|
public AjaxResult cancelApplication(@PathVariable Long id) {
|
||||||
|
// 先检查审核状态,如果已完成制作则不允许取消
|
||||||
|
RtStuIdReissue rtStuIdReissue = rtStuIdReissueService.selectRtStuIdReissueById(id);
|
||||||
|
if (rtStuIdReissue != null && rtStuIdReissue.getInspectionProgress() >= 3) {
|
||||||
|
return AjaxResult.error("当前审核已完成,不可取消");
|
||||||
|
}
|
||||||
|
return toAjax(rtStuIdReissueService.deleteRtStuIdReissueById(id));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除学生证补办
|
* 删除学生证补办
|
||||||
*/
|
*/
|
||||||
@@ -182,4 +211,6 @@ public class RtStuIdReissueController extends BaseController {
|
|||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
return toAjax(rtStuIdReissueService.deleteRtStuIdReissueByIds(ids));
|
return toAjax(rtStuIdReissueService.deleteRtStuIdReissueByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,4 +114,15 @@ public class RtStuMultiLevelReviewController extends BaseController {
|
|||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
return toAjax(rtStuMultiLevelReviewService.deleteRtStuMultiLevelReviewByIds(ids));
|
return toAjax(rtStuMultiLevelReviewService.deleteRtStuMultiLevelReviewByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新审核信息并同时更新学生证补办状态
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('routine:stuMultiLevelReview:edit')")
|
||||||
|
@Log(title = "更新审核信息并同时更新学生证补办状态", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/updateWithStuIdReissue")
|
||||||
|
@ApiOperation("更新审核信息并同时更新学生证补办状态")
|
||||||
|
public AjaxResult updateWithStuIdReissue(@RequestBody RtStuMultiLevelReview rtStuMultiLevelReview) {
|
||||||
|
return toAjax(rtStuMultiLevelReviewService.updateRtStuMultiLevelReviewWithStuIdReissue(rtStuMultiLevelReview));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,4 +62,13 @@ public interface CphMsgMapper extends BaseMapper<CphMsg>
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCphMsgByIds(Long[] ids);
|
public int deleteCphMsgByIds(Long[] ids);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据学号查询用户ID
|
||||||
|
*
|
||||||
|
* @param stuNo 学号
|
||||||
|
* @return 用户ID
|
||||||
|
*/
|
||||||
|
public Long getUserIdByStuNo(String stuNo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,4 +58,12 @@ public interface ICphMsgService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCphMsgById(Long id);
|
public int deleteCphMsgById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据学号查询用户ID
|
||||||
|
*
|
||||||
|
* @param stuNo 学号
|
||||||
|
* @return 用户ID
|
||||||
|
*/
|
||||||
|
public Long getUserIdByStuNo(String stuNo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,4 +95,16 @@ public class CphMsgServiceImpl extends ServiceImpl<CphMsgMapper,CphMsg> implemen
|
|||||||
{
|
{
|
||||||
return cphMsgMapper.deleteCphMsgById(id);
|
return cphMsgMapper.deleteCphMsgById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据学号查询用户ID
|
||||||
|
*
|
||||||
|
* @param stuNo 学号
|
||||||
|
* @return 用户ID
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Long getUserIdByStuNo(String stuNo)
|
||||||
|
{
|
||||||
|
return cphMsgMapper.getUserIdByStuNo(stuNo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,4 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="getUserIdByStuNo" parameterType="String" resultType="Long">
|
||||||
|
select user_id from sys_user where user_name = #{stuNo}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -6,10 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
import com.srs.common.core.domain.BaseEntity;
|
import com.srs.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知管理对象 cph_msg
|
* 通知管理对象 srs_notification
|
||||||
*
|
*
|
||||||
* @author srs
|
* @author srs
|
||||||
* @date 2025-07-30
|
* @date 2025-07-30
|
||||||
@@ -20,40 +18,63 @@ import com.srs.common.core.domain.BaseEntity;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
@ApiModel(value = "NotificationManagement对象" , description = "通知管理")
|
@ApiModel(value = "NotificationManagement对象" , description = "通知管理")
|
||||||
@TableName("cph_msg")
|
@TableName("srs_notification")
|
||||||
public class NotificationManagement extends BaseEntity{
|
public class NotificationManagement extends BaseEntity{
|
||||||
private static final long serialVersionUID=1L;
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* $column.columnComment
|
* 通知ID
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("${column.columnComment}")
|
@ApiModelProperty("通知ID")
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
@Excel(name = "${comment}" , readConverterExp = "$column.readConverterExp()")
|
@Excel(name = "通知ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送人用户id
|
* 通知标题
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("发送人用户id")
|
@ApiModelProperty("通知标题")
|
||||||
|
@TableField("title")
|
||||||
|
@Excel(name = "通知标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通知内容
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("通知内容")
|
||||||
|
@TableField("content")
|
||||||
|
@Excel(name = "通知内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级ID列表,以逗号分隔
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("年级ID列表,以逗号分隔")
|
||||||
|
@TableField("grade_ids")
|
||||||
|
@Excel(name = "年级ID列表")
|
||||||
|
private String gradeIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("年级名称")
|
||||||
|
@TableField("gradeName")
|
||||||
|
@Excel(name = "年级名称")
|
||||||
|
private String gradeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送人用户ID
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("发送人用户ID")
|
||||||
@TableField("sender")
|
@TableField("sender")
|
||||||
@Excel(name = "发送人用户id")
|
@Excel(name = "发送人用户ID")
|
||||||
private Long sender;
|
private Long sender;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 收信人用户id
|
* 接收人用户ID(用于cph_msg表)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("收信人用户id")
|
@ApiModelProperty("接收人用户ID")
|
||||||
@TableField("receiver")
|
@TableField("receiver")
|
||||||
private Long receiver;
|
private Long receiver;
|
||||||
|
|
||||||
/**
|
|
||||||
* 消息内容
|
|
||||||
*/
|
|
||||||
@ApiModelProperty("消息内容")
|
|
||||||
@TableField("content")
|
|
||||||
@Excel(name = "消息内容")
|
|
||||||
private String content;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ public class SendNotificationDto {
|
|||||||
@ApiModelProperty("选中的年级ID列表")
|
@ApiModelProperty("选中的年级ID列表")
|
||||||
private List<String> selectedGrades;
|
private List<String> selectedGrades;
|
||||||
|
|
||||||
|
@ApiModelProperty("通知标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
@ApiModelProperty("通知内容")
|
@ApiModelProperty("通知内容")
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
|||||||
@@ -76,15 +76,15 @@ public interface NotificationManagementMapper extends BaseMapper<NotificationMan
|
|||||||
List<Long> selectStudentIdsByGrades(@Param("gradeIds") List<String> gradeIds);
|
List<Long> selectStudentIdsByGrades(@Param("gradeIds") List<String> gradeIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据学号查询用户ID
|
* 根据年级ID列表查询学生学号列表
|
||||||
*
|
*
|
||||||
* @param stuNo 学号
|
* @param gradeIds 年级ID列表
|
||||||
* @return 用户ID
|
* @return 学生学号列表
|
||||||
*/
|
*/
|
||||||
Long selectUserIdByStuNo(@Param("stuNo") String stuNo);
|
List<String> selectStudentNosByGrades(@Param("gradeIds") List<String> gradeIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量插入通知记录
|
* 批量插入通知记录到cph_msg表
|
||||||
*
|
*
|
||||||
* @param notifications 通知记录列表
|
* @param notifications 通知记录列表
|
||||||
* @return 结果
|
* @return 结果
|
||||||
@@ -99,4 +99,23 @@ public interface NotificationManagementMapper extends BaseMapper<NotificationMan
|
|||||||
* @return 通知管理集合
|
* @return 通知管理集合
|
||||||
*/
|
*/
|
||||||
List<NotificationManagement> selectNotificationManagementListBySender(@Param("notification") NotificationManagement notificationManagement, @Param("senderId") Long senderId);
|
List<NotificationManagement> selectNotificationManagementListBySender(@Param("notification") NotificationManagement notificationManagement, @Param("senderId") Long senderId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除cph_msg表数据
|
||||||
|
*
|
||||||
|
* @param notificationList 通知列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int batchDeleteCphMsg(@Param("list") List<NotificationManagement> notificationList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新cph_msg表数据
|
||||||
|
*
|
||||||
|
* @param oldList 原数据列表
|
||||||
|
* @param newList 新数据列表
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int batchUpdateCphMsg(@Param("oldList") List<NotificationManagement> oldList, @Param("newList") List<NotificationManagement> newList);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,4 +63,14 @@ public interface RtStuMultiLevelReviewMapper extends BaseMapper<RtStuMultiLevelR
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteRtStuMultiLevelReviewByIds(Long[] ids);
|
int deleteRtStuMultiLevelReviewByIds(Long[] ids);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新审核信息并同时更新学生证补办状态
|
||||||
|
*
|
||||||
|
* @param rtStuMultiLevelReview 审核信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateRtStuMultiLevelReviewWithStuIdReissue(RtStuMultiLevelReview rtStuMultiLevelReview);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,21 +76,12 @@ public interface INotificationManagementService extends IService<NotificationMan
|
|||||||
int sendNotificationByGrades(SendNotificationDto sendNotificationDto);
|
int sendNotificationByGrades(SendNotificationDto sendNotificationDto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据年级获取学生用户ID列表
|
* 根据年级获取学生学号列表
|
||||||
*
|
*
|
||||||
* @param gradeIds 年级ID列表
|
* @param gradeIds 年级ID列表
|
||||||
* @return 学生用户ID列表
|
* @return 学生学号列表
|
||||||
*/
|
*/
|
||||||
List<Long> getStudentIdsByGrades(List<String> gradeIds);
|
List<String> getStudentNosByGrades(List<String> gradeIds);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据学号查询用户ID
|
|
||||||
*
|
|
||||||
* @param stuNo 学号
|
|
||||||
* @return 用户ID
|
|
||||||
*/
|
|
||||||
Long getUserIdByStuNo(String stuNo);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前用户发送的通知列表
|
* 查询当前用户发送的通知列表
|
||||||
@@ -99,6 +90,4 @@ public interface INotificationManagementService extends IService<NotificationMan
|
|||||||
* @return 通知管理集合
|
* @return 通知管理集合
|
||||||
*/
|
*/
|
||||||
List<NotificationManagement> selectNotificationManagementListBySender(NotificationManagement notificationManagement);
|
List<NotificationManagement> selectNotificationManagementListBySender(NotificationManagement notificationManagement);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,5 +70,13 @@ public interface IRtStuIdReissueService extends IService<RtStuIdReissue> {
|
|||||||
*/
|
*/
|
||||||
StuInfoReturnVo getStuInfo(String stuNo);
|
StuInfoReturnVo getStuInfo(String stuNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成制作
|
||||||
|
*
|
||||||
|
* @param id 学生证补办主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int completedRtStuIdReissue(Long id);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,4 +61,15 @@ public interface IRtStuMultiLevelReviewService extends IService<RtStuMultiLevelR
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteRtStuMultiLevelReviewById(Long id);
|
int deleteRtStuMultiLevelReviewById(Long id);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新审核信息并同时更新学生证补办状态
|
||||||
|
*
|
||||||
|
* @param rtStuMultiLevelReview 审核信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateRtStuMultiLevelReviewWithStuIdReissue(RtStuMultiLevelReview rtStuMultiLevelReview);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.srs.routine.service.impl;
|
package com.srs.routine.service.impl;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.ArrayList;
|
||||||
import com.srs.common.utils.DateUtils;
|
import com.srs.common.utils.DateUtils;
|
||||||
import com.srs.common.utils.SecurityUtils;
|
import com.srs.common.utils.SecurityUtils;
|
||||||
|
import com.srs.common.utils.WeChatUtil;
|
||||||
import com.srs.routine.domain.NotificationManagement;
|
import com.srs.routine.domain.NotificationManagement;
|
||||||
import com.srs.comprehensive.domain.SrsGrade;
|
import com.srs.comprehensive.domain.SrsGrade;
|
||||||
import com.srs.routine.domain.dto.SendNotificationDto;
|
import com.srs.routine.domain.dto.SendNotificationDto;
|
||||||
@@ -11,9 +13,7 @@ import com.srs.routine.service.INotificationManagementService;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知管理Service业务层处理
|
* 通知管理Service业务层处理
|
||||||
@@ -26,6 +26,9 @@ public class NotificationManagementServiceImpl extends ServiceImpl<NotificationM
|
|||||||
@Autowired
|
@Autowired
|
||||||
private NotificationManagementMapper notificationManagementMapper;
|
private NotificationManagementMapper notificationManagementMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public WeChatUtil weChatUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询通知管理
|
* 查询通知管理
|
||||||
*
|
*
|
||||||
@@ -41,7 +44,7 @@ public class NotificationManagementServiceImpl extends ServiceImpl<NotificationM
|
|||||||
* 查询通知管理列表
|
* 查询通知管理列表
|
||||||
*
|
*
|
||||||
* @param notificationManagement 通知管理
|
* @param notificationManagement 通知管理
|
||||||
* @return 通知管理
|
* @return 通知管理集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<NotificationManagement> selectNotificationManagementList(NotificationManagement notificationManagement) {
|
public List<NotificationManagement> selectNotificationManagementList(NotificationManagement notificationManagement) {
|
||||||
@@ -57,6 +60,7 @@ public class NotificationManagementServiceImpl extends ServiceImpl<NotificationM
|
|||||||
@Override
|
@Override
|
||||||
public int insertNotificationManagement(NotificationManagement notificationManagement) {
|
public int insertNotificationManagement(NotificationManagement notificationManagement) {
|
||||||
notificationManagement.setCreateTime(DateUtils.getNowDate());
|
notificationManagement.setCreateTime(DateUtils.getNowDate());
|
||||||
|
notificationManagement.setCreateBy(SecurityUtils.getUsername());
|
||||||
return notificationManagementMapper.insertNotificationManagement(notificationManagement);
|
return notificationManagementMapper.insertNotificationManagement(notificationManagement);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,9 +71,35 @@ public class NotificationManagementServiceImpl extends ServiceImpl<NotificationM
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public int updateNotificationManagement(NotificationManagement notificationManagement) {
|
public int updateNotificationManagement(NotificationManagement notificationManagement) {
|
||||||
|
// 获取修改前的通知信息
|
||||||
|
NotificationManagement originalNotification = selectNotificationManagementById(notificationManagement.getId());
|
||||||
|
|
||||||
|
// 更新srs_notification表
|
||||||
notificationManagement.setUpdateTime(DateUtils.getNowDate());
|
notificationManagement.setUpdateTime(DateUtils.getNowDate());
|
||||||
return notificationManagementMapper.updateNotificationManagement(notificationManagement);
|
notificationManagement.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
int result = notificationManagementMapper.updateNotificationManagement(notificationManagement);
|
||||||
|
|
||||||
|
// 如果更新成功,同步更新cph_msg表数据
|
||||||
|
if (result > 0 && originalNotification != null) {
|
||||||
|
// 构建更新条件:根据原内容、发送人和创建时间匹配
|
||||||
|
List<NotificationManagement> updateList = new ArrayList<>();
|
||||||
|
updateList.add(originalNotification);
|
||||||
|
|
||||||
|
// 构建新数据用于更新
|
||||||
|
List<NotificationManagement> newList = new ArrayList<>();
|
||||||
|
NotificationManagement newMsg = new NotificationManagement();
|
||||||
|
newMsg.setContent(notificationManagement.getContent());
|
||||||
|
newMsg.setSender(notificationManagement.getSender());
|
||||||
|
newMsg.setCreateTime(originalNotification.getCreateTime()); // 保持原创建时间不变
|
||||||
|
newList.add(newMsg);
|
||||||
|
|
||||||
|
// 批量更新cph_msg表
|
||||||
|
notificationManagementMapper.batchUpdateCphMsg(updateList, newList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,7 +109,22 @@ public class NotificationManagementServiceImpl extends ServiceImpl<NotificationM
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public int deleteNotificationManagementByIds(Long[] ids) {
|
public int deleteNotificationManagementByIds(Long[] ids) {
|
||||||
|
// 先删除相关的cph_msg表数据
|
||||||
|
List<NotificationManagement> notifications = new ArrayList<>();
|
||||||
|
for (Long id : ids) {
|
||||||
|
NotificationManagement notification = selectNotificationManagementById(id);
|
||||||
|
if (notification != null) {
|
||||||
|
notifications.add(notification);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!notifications.isEmpty()) {
|
||||||
|
notificationManagementMapper.batchDeleteCphMsg(notifications);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除srs_notification表数据
|
||||||
return notificationManagementMapper.deleteNotificationManagementByIds(ids);
|
return notificationManagementMapper.deleteNotificationManagementByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +135,17 @@ public class NotificationManagementServiceImpl extends ServiceImpl<NotificationM
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public int deleteNotificationManagementById(Long id) {
|
public int deleteNotificationManagementById(Long id) {
|
||||||
|
// 先删除相关的cph_msg表数据
|
||||||
|
NotificationManagement notification = selectNotificationManagementById(id);
|
||||||
|
if (notification != null) {
|
||||||
|
List<NotificationManagement> notifications = new ArrayList<>();
|
||||||
|
notifications.add(notification);
|
||||||
|
notificationManagementMapper.batchDeleteCphMsg(notifications);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除srs_notification表数据
|
||||||
return notificationManagementMapper.deleteNotificationManagementById(id);
|
return notificationManagementMapper.deleteNotificationManagementById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,60 +166,58 @@ public class NotificationManagementServiceImpl extends ServiceImpl<NotificationM
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public int sendNotificationByGrades(SendNotificationDto sendNotificationDto) {
|
public int sendNotificationByGrades(SendNotificationDto sendNotificationDto) {
|
||||||
// 获取当前登录用户ID作为发送人
|
// 1. 先插入srs_notification表
|
||||||
Long senderId = SecurityUtils.getUserId();
|
|
||||||
if (sendNotificationDto.getSenderId() != null) {
|
|
||||||
senderId = sendNotificationDto.getSenderId();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据年级获取学生用户ID列表
|
|
||||||
List<Long> studentIds = getStudentIdsByGrades(sendNotificationDto.getSelectedGrades());
|
|
||||||
|
|
||||||
if (studentIds == null || studentIds.isEmpty()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 批量构建通知记录
|
|
||||||
final Long finalSenderId = senderId;
|
|
||||||
List<NotificationManagement> notifications = studentIds.stream()
|
|
||||||
.map(studentId -> {
|
|
||||||
NotificationManagement notification = new NotificationManagement();
|
NotificationManagement notification = new NotificationManagement();
|
||||||
notification.setSender(finalSenderId);
|
notification.setTitle(sendNotificationDto.getTitle());
|
||||||
notification.setReceiver(studentId);
|
|
||||||
notification.setContent(sendNotificationDto.getContent());
|
notification.setContent(sendNotificationDto.getContent());
|
||||||
|
notification.setGradeIds(String.join(",", sendNotificationDto.getSelectedGrades()));
|
||||||
|
notification.setSender(SecurityUtils.getUserId());
|
||||||
notification.setCreateTime(DateUtils.getNowDate());
|
notification.setCreateTime(DateUtils.getNowDate());
|
||||||
return notification;
|
notification.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
|
||||||
|
int result = notificationManagementMapper.insertNotificationManagement(notification);
|
||||||
|
|
||||||
|
// 2. 如果插入成功,向cph_msg表插入学生通知记录
|
||||||
|
if (result > 0) {
|
||||||
|
// 根据年级获取学生用户ID列表
|
||||||
|
List<Long> studentIds = notificationManagementMapper.selectStudentIdsByGrades(sendNotificationDto.getSelectedGrades());
|
||||||
|
|
||||||
|
if (studentIds != null && !studentIds.isEmpty()) {
|
||||||
|
// 使用srs_notification表的create_time,确保两个表的时间一致
|
||||||
|
java.util.Date notificationCreateTime = notification.getCreateTime();
|
||||||
|
|
||||||
|
// 批量构建cph_msg记录
|
||||||
|
List<NotificationManagement> cphMsgList = studentIds.stream()
|
||||||
|
.map(studentId -> {
|
||||||
|
NotificationManagement msg = new NotificationManagement();
|
||||||
|
msg.setSender(SecurityUtils.getUserId());
|
||||||
|
msg.setReceiver(studentId);
|
||||||
|
msg.setContent(sendNotificationDto.getContent());
|
||||||
|
msg.setCreateTime(notificationCreateTime);
|
||||||
|
return msg;
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
// 批量插入
|
// 批量插入cph_msg表
|
||||||
return notificationManagementMapper.batchInsertNotification(notifications);
|
int i= notificationManagementMapper.batchInsertNotification(cphMsgList);
|
||||||
|
// 如果插入成功,发送企业微信消息
|
||||||
|
if (i > 0) {
|
||||||
|
//根据年级获取学生学号列表
|
||||||
|
List<String> studentNos = getStudentNosByGrades(sendNotificationDto.getSelectedGrades());
|
||||||
|
if (studentNos != null && !studentNos.isEmpty()) {
|
||||||
|
// 批量发送企业微信消息
|
||||||
|
sendWeChatMessagesBatch(studentNos, sendNotificationDto.getContent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
return result;
|
||||||
* 根据年级获取学生用户ID列表
|
|
||||||
*
|
|
||||||
* @param gradeIds 年级ID列表
|
|
||||||
* @return 学生用户ID列表
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<Long> getStudentIdsByGrades(List<String> gradeIds) {
|
|
||||||
return notificationManagementMapper.selectStudentIdsByGrades(gradeIds);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据学号查询用户ID
|
|
||||||
*
|
|
||||||
* @param stuNo 学号
|
|
||||||
* @return 用户ID
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Long getUserIdByStuNo(String stuNo) {
|
|
||||||
return notificationManagementMapper.selectUserIdByStuNo(stuNo);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询当前用户发送的通知列表
|
* 查询当前用户发送的通知列表
|
||||||
*
|
*
|
||||||
@@ -177,6 +230,34 @@ public class NotificationManagementServiceImpl extends ServiceImpl<NotificationM
|
|||||||
Long senderId = SecurityUtils.getUserId();
|
Long senderId = SecurityUtils.getUserId();
|
||||||
return notificationManagementMapper.selectNotificationManagementListBySender(notificationManagement, senderId);
|
return notificationManagementMapper.selectNotificationManagementListBySender(notificationManagement, senderId);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 批量发送企业微信消息
|
||||||
|
*
|
||||||
|
* @param studentNos 学生学号列表
|
||||||
|
* @param content 消息内容
|
||||||
|
*/
|
||||||
|
private void sendWeChatMessagesBatch(List<String> studentNos, String content) {
|
||||||
|
// 企业微信批量发送限制,每次最多发送1000个用户
|
||||||
|
int batchSize = 1000;
|
||||||
|
|
||||||
|
for (int i = 0; i < studentNos.size(); i += batchSize) {
|
||||||
|
List<String> batch = studentNos.subList(i, Math.min(i + batchSize, studentNos.size()));
|
||||||
|
// 拼接成"2023001|2023002|2023003"格式
|
||||||
|
String toUser = String.join("|", batch);
|
||||||
|
// 调用企业微信发送消息方法
|
||||||
|
weChatUtil.sendTextMessage(toUser, content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据年级获取学生学号列表
|
||||||
|
*
|
||||||
|
* @param gradeIds 年级ID列表
|
||||||
|
* @return 学生学号列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<String> getStudentNosByGrades(List<String> gradeIds) {
|
||||||
|
return notificationManagementMapper.selectStudentNosByGrades(gradeIds);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,4 +137,19 @@ public class RtStuIdReissueServiceImpl extends ServiceImpl<RtStuIdReissueMapper,
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完成制作
|
||||||
|
*
|
||||||
|
* @param id 学生证补办主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int completedRtStuIdReissue(Long id) {
|
||||||
|
RtStuIdReissue rtStuIdReissue = new RtStuIdReissue();
|
||||||
|
rtStuIdReissue.setId(id);
|
||||||
|
rtStuIdReissue.setInspectionProgress(3L); // 设置完成制作状态
|
||||||
|
rtStuIdReissue.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return rtStuIdReissueMapper.updateRtStuIdReissue(rtStuIdReissue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.srs.routine.service.impl;
|
package com.srs.routine.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import com.srs.common.utils.WeChatUtil;
|
||||||
import com.srs.common.utils.DateUtils;
|
import com.srs.common.utils.DateUtils;
|
||||||
import com.srs.common.utils.SecurityUtils;
|
import com.srs.common.utils.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -98,4 +98,29 @@ public class RtStuMultiLevelReviewServiceImpl extends ServiceImpl<RtStuMultiLeve
|
|||||||
public int deleteRtStuMultiLevelReviewById(Long id) {
|
public int deleteRtStuMultiLevelReviewById(Long id) {
|
||||||
return rtStuMultiLevelReviewMapper.deleteRtStuMultiLevelReviewById(id);
|
return rtStuMultiLevelReviewMapper.deleteRtStuMultiLevelReviewById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新审核信息并同时更新学生证补办状态
|
||||||
|
*
|
||||||
|
* @param rtStuMultiLevelReview 审核信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateRtStuMultiLevelReviewWithStuIdReissue(RtStuMultiLevelReview rtStuMultiLevelReview) {
|
||||||
|
rtStuMultiLevelReview.setReviewTime(DateUtils.getNowDate());
|
||||||
|
rtStuMultiLevelReview.setReviewer(SecurityUtils.getLoginUser().getUser().getNickName());
|
||||||
|
rtStuMultiLevelReview.setReviewerId(SecurityUtils.getUserId());
|
||||||
|
int result = rtStuMultiLevelReviewMapper.updateRtStuMultiLevelReviewWithStuIdReissue(rtStuMultiLevelReview);
|
||||||
|
if (result > 0) {
|
||||||
|
String messageContent = rtStuMultiLevelReview.getNotes();
|
||||||
|
if (messageContent == null || messageContent.trim().isEmpty()) {
|
||||||
|
messageContent = "你申请办理的学生证制作完成,长堽校区前往xxx领取,里建校区前往xxx领取";
|
||||||
|
}
|
||||||
|
WeChatUtil weChatUtil = new WeChatUtil();
|
||||||
|
weChatUtil.sendTextMessage(rtStuMultiLevelReview.getStuNo(), messageContent);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<resultMap type="NotificationManagement" id="NotificationManagementResult">
|
<resultMap type="NotificationManagement" id="NotificationManagementResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="sender" column="sender" />
|
<result property="title" column="title" />
|
||||||
<result property="receiver" column="receiver" />
|
|
||||||
<result property="content" column="content" />
|
<result property="content" column="content" />
|
||||||
|
<result property="gradeIds" column="grade_ids" />
|
||||||
|
<result property="gradeName" column="grade_name" />
|
||||||
|
<result property="sender" column="sender" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
@@ -27,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectNotificationManagementVo">
|
<sql id="selectNotificationManagementVo">
|
||||||
select id, sender, receiver, content, create_by, create_time, update_by, update_time from cph_msg
|
select id, title, content, grade_ids, sender, create_by, create_time, update_by, update_time from srs_notification
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="selectGradeVo">
|
<sql id="selectGradeVo">
|
||||||
@@ -37,43 +39,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectNotificationManagementList" parameterType="NotificationManagement" resultMap="NotificationManagementResult">
|
<select id="selectNotificationManagementList" parameterType="NotificationManagement" resultMap="NotificationManagementResult">
|
||||||
<include refid="selectNotificationManagementVo"/>
|
<include refid="selectNotificationManagementVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
|
||||||
|
<if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
|
||||||
|
<if test="gradeIds != null and gradeIds != ''"> and grade_ids = #{gradeIds}</if>
|
||||||
<if test="sender != null"> and sender = #{sender}</if>
|
<if test="sender != null"> and sender = #{sender}</if>
|
||||||
<if test="receiver != null "> and receiver = #{receiver}</if>
|
|
||||||
<if test="content != null and content != ''"> and content = #{content}</if>
|
|
||||||
</where>
|
</where>
|
||||||
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询当前用户发送的通知列表 -->
|
<!-- 查询当前用户发送的通知列表 -->
|
||||||
<select id="selectNotificationManagementListBySender" resultMap="NotificationManagementResult">
|
<select id="selectNotificationManagementListBySender" resultMap="NotificationManagementResult">
|
||||||
<include refid="selectNotificationManagementVo"/>
|
select n.id, n.title, n.content, n.grade_ids, n.sender, n.create_by, n.create_time, n.update_by, n.update_time,
|
||||||
|
GROUP_CONCAT(g.grade_name SEPARATOR ',') as grade_name
|
||||||
|
from srs_notification n
|
||||||
|
left join srs_grade g on FIND_IN_SET(g.grade_id, n.grade_ids) > 0
|
||||||
<where>
|
<where>
|
||||||
sender = #{senderId}
|
n.sender = #{senderId}
|
||||||
<if test="notification.receiver != null "> and receiver = #{notification.receiver}</if>
|
<if test="notification.title != null and notification.title != ''"> and n.title like concat('%', #{notification.title}, '%')</if>
|
||||||
<if test="notification.content != null and notification.content != ''"> and content = #{notification.content}</if>
|
<if test="notification.content != null and notification.content != ''"> and n.content like concat('%', #{notification.content}, '%')</if>
|
||||||
|
<if test="notification.gradeIds != null and notification.gradeIds != ''"> and n.grade_ids = #{notification.gradeIds}</if>
|
||||||
</where>
|
</where>
|
||||||
order by create_time desc
|
group by n.id, n.title, n.content, n.grade_ids, n.sender, n.create_by, n.create_time, n.update_by, n.update_time
|
||||||
|
order by n.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectNotificationManagementById" parameterType="Long" resultMap="NotificationManagementResult">
|
<select id="selectNotificationManagementById" parameterType="Long" resultMap="NotificationManagementResult">
|
||||||
<include refid="selectNotificationManagementVo"/>
|
<include refid="selectNotificationManagementVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 插入数据到通知管理表-->
|
||||||
<insert id="insertNotificationManagement" parameterType="NotificationManagement" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertNotificationManagement" parameterType="NotificationManagement" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into cph_msg
|
insert into srs_notification
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="sender != null">sender,</if>
|
<if test="title != null">title,</if>
|
||||||
<if test="receiver != null">receiver,</if>
|
|
||||||
<if test="content != null">content,</if>
|
<if test="content != null">content,</if>
|
||||||
|
<if test="gradeIds != null">grade_ids,</if>
|
||||||
|
<if test="sender != null">sender,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="sender != null">#{sender},</if>
|
<if test="title != null">#{title},</if>
|
||||||
<if test="receiver != null">#{receiver},</if>
|
|
||||||
<if test="content != null">#{content},</if>
|
<if test="content != null">#{content},</if>
|
||||||
|
<if test="gradeIds != null">#{gradeIds},</if>
|
||||||
|
<if test="sender != null">#{sender},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
@@ -82,11 +95,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateNotificationManagement" parameterType="NotificationManagement">
|
<update id="updateNotificationManagement" parameterType="NotificationManagement">
|
||||||
update cph_msg
|
update srs_notification
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="sender != null">sender = #{sender},</if>
|
<if test="title != null">title = #{title},</if>
|
||||||
<if test="receiver != null">receiver = #{receiver},</if>
|
|
||||||
<if test="content != null">content = #{content},</if>
|
<if test="content != null">content = #{content},</if>
|
||||||
|
<if test="gradeIds != null">grade_ids = #{gradeIds},</if>
|
||||||
|
<if test="sender != null">sender = #{sender},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
@@ -96,11 +110,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteNotificationManagementById" parameterType="Long">
|
<delete id="deleteNotificationManagementById" parameterType="Long">
|
||||||
delete from cph_msg where id = #{id}
|
delete from srs_notification where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteNotificationManagementByIds" parameterType="String">
|
<delete id="deleteNotificationManagementByIds" parameterType="String">
|
||||||
delete from cph_msg where id in
|
delete from srs_notification where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
@@ -126,8 +140,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据年级ID列表查询学生学号列表 -->
|
||||||
|
<select id="selectStudentNosByGrades" resultType="String">
|
||||||
|
SELECT DISTINCT ss.stu_no
|
||||||
|
FROM srs_student ss
|
||||||
|
left JOIN srs_class sc ON ss.class_id = sc.class_id
|
||||||
|
WHERE ss.stu_no IS NOT NULL
|
||||||
|
AND sc.grade_id IN
|
||||||
|
<foreach item="gradeId" collection="gradeIds" open="(" separator="," close=")">
|
||||||
|
#{gradeId}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 批量插入通知记录 -->
|
<!-- 批量插入通知记录到cph_msg表 -->
|
||||||
<insert id="batchInsertNotification" parameterType="java.util.List">
|
<insert id="batchInsertNotification" parameterType="java.util.List">
|
||||||
insert into cph_msg (sender, receiver, content, create_time)
|
insert into cph_msg (sender, receiver, content, create_time)
|
||||||
values
|
values
|
||||||
@@ -136,4 +161,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<!-- 批量删除cph_msg表数据 -->
|
||||||
|
<delete id="batchDeleteCphMsg" parameterType="java.util.List">
|
||||||
|
delete from cph_msg where (content, sender, create_time) in
|
||||||
|
<foreach collection="list" item="item" open="(" separator="," close=")">
|
||||||
|
(#{item.content}, #{item.sender}, #{item.createTime})
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 批量更新cph_msg表数据 -->
|
||||||
|
<update id="batchUpdateCphMsg" parameterType="java.util.Map">
|
||||||
|
update cph_msg
|
||||||
|
set content = #{newList[0].content}
|
||||||
|
where content = #{oldList[0].content}
|
||||||
|
and sender = #{oldList[0].sender}
|
||||||
|
and create_time = #{oldList[0].createTime}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -103,4 +103,28 @@
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<!-- 更新审核信息并同时更新学生证补办状态 -->
|
||||||
|
<update id="updateRtStuMultiLevelReviewWithStuIdReissue" parameterType="RtStuMultiLevelReview">
|
||||||
|
<!-- 更新审核信息表 -->
|
||||||
|
update rt_stu_multi_level_review
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="stuName != null">stu_name = #{stuName},</if>
|
||||||
|
<if test="stuNo != null and stuNo != ''">stuNo = #{stuNo},</if>
|
||||||
|
<if test="reason != null and reason != ''">reason = #{reason},</if>
|
||||||
|
<if test="reviewer != null">reviewer = #{reviewer},</if>
|
||||||
|
<if test="reviewerIdentity != null">reviewer_identity = #{reviewerIdentity},</if>
|
||||||
|
<if test="reviewTime != null">review_time = #{reviewTime},</if>
|
||||||
|
<if test="reviewerId != null">reviewer_id = #{reviewerId},</if>
|
||||||
|
<if test="notes != null">notes = #{notes},</if>
|
||||||
|
<if test="type != null">type = #{type},</if>
|
||||||
|
<if test="reviewerStatus != null">reviewer_status = #{reviewerStatus},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id};
|
||||||
|
|
||||||
|
<!-- 同时更新学生证补办表的审核状态 -->
|
||||||
|
update rt_stu_id_reissue
|
||||||
|
set inspection_progress = #{reviewerStatus}
|
||||||
|
where stu_no = #{stuNo};
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user