Commit 34770ed2 by xuwenhao

修改查看个人电子档案列表

parent aaea5227
...@@ -172,23 +172,23 @@ public class SchoolAuditoriumController extends BaseController ...@@ -172,23 +172,23 @@ public class SchoolAuditoriumController extends BaseController
schoolAuditorium.setApplyTime(DateUtils.getNowDate()); schoolAuditorium.setApplyTime(DateUtils.getNowDate());
schoolAuditoriumService.submitApply(schoolAuditorium, userName, AUDITORIUMAPPLY, new HashMap<>()); schoolAuditoriumService.submitApply(schoolAuditorium, userName, AUDITORIUMAPPLY, new HashMap<>());
/** 发送发送钉钉审批实例 */ // /** 发送发送钉钉审批实例 */
String ddInstanceId = schoolAuditoriumService.sendDdInstance(schoolAuditorium); // String ddInstanceId = schoolAuditoriumService.sendDdInstance(schoolAuditorium);
//
// //转换时间
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
// Date time = schoolAuditorium.getApplyTime();
// String applyTime = format.format(time);
//转换时间 // //发送钉钉消息到分管领导
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // //获取钉钉用户id
Date time = schoolAuditorium.getApplyTime();
String applyTime = format.format(time);
//发送钉钉消息到分管领导
//获取钉钉用户id
// String ddUserId = teacherService.getDdUserIdByUserId(schoolAuditorium.getLeadershipId()); // String ddUserId = teacherService.getDdUserIdByUserId(schoolAuditorium.getLeadershipId());
// //发送钉钉消息给分管领导 // //发送钉钉消息给分管领导
// DingMessageVo messageVo = new DingMessageVo(); // DingMessageVo messageVo = new DingMessageVo();
// OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg(); // OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
// msg.setOa(new OapiMessageCorpconversationAsyncsendV2Request.OA()); // msg.setOa(new OapiMessageCorpconversationAsyncsendV2Request.OA());
// msg.getOa().setHead(new OapiMessageCorpconversationAsyncsendV2Request.Head()); // msg.getOa().setHead(new OapiMessageCorpconversationAsyncsendV2Request.Head());
// msg.getOa().getHead().setText("二中校园测试"); // msg.getOa().getHead().setText("智慧校园");
// msg.getOa().setBody(new OapiMessageCorpconversationAsyncsendV2Request.Body()); // msg.getOa().setBody(new OapiMessageCorpconversationAsyncsendV2Request.Body());
// msg.getOa().getBody().setAuthor(schoolAuditorium.getApplyName()); // msg.getOa().getBody().setAuthor(schoolAuditorium.getApplyName());
// msg.getOa().getBody().setContent("申请内容:" + schoolAuditorium.getActivityName()); // msg.getOa().getBody().setContent("申请内容:" + schoolAuditorium.getActivityName());
...@@ -288,35 +288,35 @@ public class SchoolAuditoriumController extends BaseController ...@@ -288,35 +288,35 @@ public class SchoolAuditoriumController extends BaseController
//获取钉钉用户id //获取钉钉用户id
String ddUserId = teacherService.getDdUserIdByUserId(leave.getApplyId()); String ddUserId = teacherService.getDdUserIdByUserId(leave.getApplyId());
//发送钉钉消息给分管领导 //发送钉钉消息给分管领导
// DingMessageVo messageVo = new DingMessageVo(); DingMessageVo messageVo = new DingMessageVo();
// OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg(); OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
// msg.setOa(new OapiMessageCorpconversationAsyncsendV2Request.OA()); msg.setOa(new OapiMessageCorpconversationAsyncsendV2Request.OA());
// msg.getOa().setHead(new OapiMessageCorpconversationAsyncsendV2Request.Head()); msg.getOa().setHead(new OapiMessageCorpconversationAsyncsendV2Request.Head());
// msg.getOa().getHead().setText("二中校园测试"); msg.getOa().getHead().setText("智慧校园");
// msg.getOa().setBody(new OapiMessageCorpconversationAsyncsendV2Request.Body()); msg.getOa().setBody(new OapiMessageCorpconversationAsyncsendV2Request.Body());
// msg.getOa().getBody().setAuthor(leave.getLeadershipName()); msg.getOa().getBody().setAuthor(leave.getLeadershipName());
// msg.getOa().getBody().setContent(flag ? "已通过" : "已驳回"); msg.getOa().getBody().setContent(flag ? "已通过" : "已驳回");
// msg.getOa().getBody().setTitle("您好,您的礼堂预约申请已回复。"); msg.getOa().getBody().setTitle("您好,您的礼堂预约申请已回复。");
// msg.getOa().setPcMessageUrl("https://open.dingtalk.com/"); msg.getOa().setPcMessageUrl("https://open.dingtalk.com/");
// msg.getOa().setMessageUrl("https://open.dingtalk.com/"); msg.getOa().setMessageUrl("https://open.dingtalk.com/");
// msg.setMsgtype("oa"); msg.setMsgtype("oa");
// messageVo.setMsg(msg); messageVo.setMsg(msg);
// messageVo.setToAllUser(false); messageVo.setToAllUser(false);
// messageVo.setUseridList(ddUserId); messageVo.setUseridList(ddUserId);
// dingMessageUtils.sendMessage(messageVo); dingMessageUtils.sendMessage(messageVo);
//修改消息任务状态为已完成 //修改消息任务状态为已完成
// dingMessageUtils.updateStatusBar(leave.getDdTaskId(), "已完成", "0xFF78C06E"); dingMessageUtils.updateStatusBar(leave.getDdTaskId(), "已完成", "0xFF78C06E");
/**发送模板消息到申请人,审批结果*/ /**发送模板消息到申请人,审批结果*/
//获取申请人openId //获取申请人openId
String openId = teacherService.getOpenIdByUserId(leave.getApplyId()); // String openId = teacherService.getOpenIdByUserId(leave.getApplyId());
Map<String,Object> map = new HashMap<>(); // Map<String,Object> map = new HashMap<>();
map.put("toUserOpenId",openId); // map.put("toUserOpenId",openId);
map.put("first","您好,您的礼堂预约申请已回复。"); // map.put("first","您好,您的礼堂预约申请已回复。");
map.put("content",flag ? "已通过" : "已驳回"); // map.put("content",flag ? "已通过" : "已驳回");
map.put("remark","审批留言: "+ variables.get("comment")); // map.put("remark","审批留言: "+ variables.get("comment"));
VxTemlateSendApi.sendVxTemlate(map); // VxTemlateSendApi.sendVxTemlate(map);
// LeaveResultTemplate template = new LeaveResultTemplate(); // LeaveResultTemplate template = new LeaveResultTemplate();
// template.setFirst("您好,您的礼堂预约申请已回复。"); // template.setFirst("您好,您的礼堂预约申请已回复。");
// template.setToUserOpenId(openId); // template.setToUserOpenId(openId);
......
...@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.controller.teacher; ...@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.controller.teacher;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.core.utils.HolidayDateUtil; import com.core.utils.HolidayDateUtil;
import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
...@@ -42,6 +43,8 @@ import yangtz.cs.liu.campus.util.VxTemlateSendApi; ...@@ -42,6 +43,8 @@ import yangtz.cs.liu.campus.util.VxTemlateSendApi;
import yangtz.cs.liu.campus.vo.teacher.SchoolTeacherLeaveVO; import yangtz.cs.liu.campus.vo.teacher.SchoolTeacherLeaveVO;
import yangtz.cs.liu.campus.vo.teacher.SchoolTeacherVO; import yangtz.cs.liu.campus.vo.teacher.SchoolTeacherVO;
import yangtz.cs.liu.campus.vo.teacher.TeacherLeaveVO; import yangtz.cs.liu.campus.vo.teacher.TeacherLeaveVO;
import yangtz.cs.liu.dingding.utils.DingMessageUtils;
import yangtz.cs.liu.dingding.vo.DingMessageVo;
import yangtz.cs.liu.wechat.domain.template.LeaveStateTemplate; import yangtz.cs.liu.wechat.domain.template.LeaveStateTemplate;
import yangtz.cs.liu.wechat.domain.template.LeaveTemplate; import yangtz.cs.liu.wechat.domain.template.LeaveTemplate;
import yangtz.cs.liu.wechat.service.api.IWxApiService; import yangtz.cs.liu.wechat.service.api.IWxApiService;
...@@ -97,6 +100,10 @@ public class SchoolTeacherLeaveController extends BaseController { ...@@ -97,6 +100,10 @@ public class SchoolTeacherLeaveController extends BaseController {
@Autowired @Autowired
private ISysDeptService deptService; private ISysDeptService deptService;
//钉钉消息通知
@Autowired
private DingMessageUtils dingMessageUtils;
//职工 //职工
private static final String TYPE = "1"; private static final String TYPE = "1";
...@@ -265,35 +272,81 @@ public class SchoolTeacherLeaveController extends BaseController { ...@@ -265,35 +272,81 @@ public class SchoolTeacherLeaveController extends BaseController {
schoolTeacherLeave.setApplyTime(DateUtils.getNowDate()); schoolTeacherLeave.setApplyTime(DateUtils.getNowDate());
schoolTeacherLeaveService.submitApply(schoolTeacherLeave, userName, TEACHERLEAVE, new HashMap<>()); schoolTeacherLeaveService.submitApply(schoolTeacherLeave, userName, TEACHERLEAVE, new HashMap<>());
//转换时间 // //转换时间
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date time = schoolTeacherLeave.getApplyTime(); // Date time = schoolTeacherLeave.getApplyTime();
String applyTime = format.format(time); // String applyTime = format.format(time);
/** 发送申请通知 */ /** 发送申请通知 */
//获取openid //发送钉钉通知
String openId = schoolTeacherService.getOpenIdByUserId(schoolTeacherLeave.getHandUserId1());
Map<String,Object> map = new HashMap<>(); // String start = "";
map.put("toUserOpenId",openId); // String end = "";
map.put("applyTime",applyTime); // //请假开始时间、结束时间
map.put("remark","共计" + schoolTeacherLeave.getTotalTime() +"天,请您尽快处理"); // //教工
map.put("applyUser",schoolTeacherLeave.getTeacherName()); // if("0".equals(schoolTeacherLeave.getApplyType())){
String start = ""; // start = HolidayDateUtil.format.format(schoolTeacherLeave.getStartTime()) +" 第" + schoolTeacherLeave.getStartSort() + "节课";
String end = ""; // end = HolidayDateUtil.format.format(schoolTeacherLeave.getEndTime()) +" 第" + schoolTeacherLeave.getEndSort() + "节课";
//请假开始时间、结束时间 //
//教工 // }else{
if("0".equals(schoolTeacherLeave.getApplyType())){ // //教工
start = HolidayDateUtil.format.format(schoolTeacherLeave.getStartTime()) +" 第" + schoolTeacherLeave.getStartSort() + "节课"; // start = HolidayDateUtil.format.format(schoolTeacherLeave.getStartTime());
end = HolidayDateUtil.format.format(schoolTeacherLeave.getEndTime()) +" 第" + schoolTeacherLeave.getEndSort() + "节课"; // end = HolidayDateUtil.format.format(schoolTeacherLeave.getEndTime());
// }
//
// //获取钉钉用户id
// String ddUserId = schoolTeacherService.getDdUserIdByUserId(schoolTeacherLeave.getHandUserId1());
// //发送钉钉消息给级部/处室主任
// DingMessageVo messageVo = new DingMessageVo();
// OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
// msg.setOa(new OapiMessageCorpconversationAsyncsendV2Request.OA());
// msg.getOa().setHead(new OapiMessageCorpconversationAsyncsendV2Request.Head());
// msg.getOa().getHead().setText("智慧校园");
// msg.getOa().setBody(new OapiMessageCorpconversationAsyncsendV2Request.Body());
// msg.getOa().getBody().setAuthor(schoolTeacherLeave.getApplyUser());
// msg.getOa().getBody().setContent("申请内容:" + "从" + start + "至" + end);
// msg.getOa().getBody().setTitle(schoolTeacherLeave.getTeacherName() + "的请假申请需要您审批。");
// OapiMessageCorpconversationAsyncsendV2Request.Form form1 = new OapiMessageCorpconversationAsyncsendV2Request.Form();
// form1.setKey("申请时间:");
// form1.setValue(applyTime);
// msg.getOa().getBody().setForm(Arrays.asList(form1));
// msg.getOa().setPcMessageUrl("https://open.dingtalk.com/");
// msg.getOa().setMessageUrl("https://open.dingtalk.com/");
// msg.setMsgtype("oa");
// OapiMessageCorpconversationAsyncsendV2Request.StatusBar statusBar = new OapiMessageCorpconversationAsyncsendV2Request.StatusBar();
// statusBar.setStatusBg("0xFFF65E5E");
// statusBar.setStatusValue("进行中");
// msg.getOa().setStatusBar(statusBar);
// messageVo.setMsg(msg);
// messageVo.setToAllUser(false);
// messageVo.setUseridList(ddUserId);
// Long ddTaskId = dingMessageUtils.sendMessage(messageVo);
}else{
//教工
start = HolidayDateUtil.format.format(schoolTeacherLeave.getStartTime()); //获取openid
end = HolidayDateUtil.format.format(schoolTeacherLeave.getEndTime()); // String openId = schoolTeacherService.getOpenIdByUserId(schoolTeacherLeave.getHandUserId1());
} // Map<String,Object> map = new HashMap<>();
map.put("content","从" + start + "至" + end); // map.put("toUserOpenId",openId);
map.put("first",schoolTeacherLeave.getTeacherName() + "的请假申请需要您审批。"); // map.put("applyTime",applyTime);
VxTemlateSendApi.sendVxTemlate(map); // map.put("remark","共计" + schoolTeacherLeave.getTotalTime() +"天,请您尽快处理");
// map.put("applyUser",schoolTeacherLeave.getTeacherName());
// String start = "";
// String end = "";
// //请假开始时间、结束时间
// //教工
// if("0".equals(schoolTeacherLeave.getApplyType())){
// start = HolidayDateUtil.format.format(schoolTeacherLeave.getStartTime()) +" 第" + schoolTeacherLeave.getStartSort() + "节课";
// end = HolidayDateUtil.format.format(schoolTeacherLeave.getEndTime()) +" 第" + schoolTeacherLeave.getEndSort() + "节课";
//
// }else{
// //教工
// start = HolidayDateUtil.format.format(schoolTeacherLeave.getStartTime());
// end = HolidayDateUtil.format.format(schoolTeacherLeave.getEndTime());
// }
// map.put("content","从" + start + "至" + end);
// map.put("first",schoolTeacherLeave.getTeacherName() + "的请假申请需要您审批。");
// VxTemlateSendApi.sendVxTemlate(map);
// TeacherLeaveTemplate template = new TeacherLeaveTemplate(); // TeacherLeaveTemplate template = new TeacherLeaveTemplate();
// //String openId = userService.getOpenIdByUserId(schoolTeacherLeave.getHandUserId1()); // //String openId = userService.getOpenIdByUserId(schoolTeacherLeave.getHandUserId1());
......
...@@ -49,13 +49,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -49,13 +49,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selctTeacherByUserId" resultType="yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice"> <select id="selctTeacherByUserId" resultType="yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice">
SELECT fn.*,tf.state,tf.id as fId from teacher_files tf LEFT JOIN teacher_files_notice fn on fn.id= tf.notice_id WHERE tf.teacher_id = #{userId} SELECT fn.*,tf.state,tf.id as fId from teacher_files tf LEFT JOIN teacher_files_notice fn on fn.id= tf.notice_id WHERE tf.teacher_id = #{userId}
and fn.notice_state = 2 and fn.notice_state = 2
<if test="noticeRange != null and noticeRange != ''"> and fn.notice_range = #{teacherFiles.noticeRange}</if> <if test="teacherFiles.noticeRange != null and teacherFiles.noticeRange != ''"> and fn.notice_range = #{teacherFiles.noticeRange}</if>
<if test="noticeYear != null and noticeYear != ''"> and fn.notice_year = #{teacherFiles.noticeYear}</if> <if test="teacherFiles.noticeYear != null and teacherFiles.noticeYear != ''"> and fn.notice_year = #{teacherFiles.noticeYear}</if>
<if test="noticeSemester != null and noticeSemester != ''"> and fn.notice_semester = #{teacherFiles.noticeSemester}</if> <if test="teacherFiles.noticeSemester != null and teacherFiles.noticeSemester != ''"> and fn.notice_semester = #{teacherFiles.noticeSemester}</if>
<if test="noticeName != null and noticeName != ''"> and fn.notice_name like concat('%', #{teacherFiles.noticeName}, '%')</if> <if test="teacherFiles.noticeName != null and teacherFiles.noticeName != ''"> and fn.notice_name like concat('%', #{teacherFiles.noticeName}, '%')</if>
<if test="noticeState != null and noticeState != ''"> and fn.notice_state = #{teacherFiles.noticeState}</if> <if test="teacherFiles.noticeState != null and teacherFiles.noticeState != ''"> and fn.notice_state = #{teacherFiles.noticeState}</if>
<if test="startTime != null "> and start_time = #{teacherFiles.startTime}</if> <if test="teacherFiles.startTime != null "> and start_time = #{teacherFiles.startTime}</if>
<if test="endTime != null "> and end_time = #{teacherFiles.endTime}</if> <if test="teacherFiles.endTime != null "> and end_time = #{teacherFiles.endTime}</if>
</select> </select>
<select id="selectTeacherFilesNoticeListByUser" parameterType="TeacherFilesNotice" resultType="TeacherFilesNoticeTotal"> <select id="selectTeacherFilesNoticeListByUser" parameterType="TeacherFilesNotice" resultType="TeacherFilesNoticeTotal">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment