Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -16,6 +16,7 @@ import okhttp3.*;
|
|||||||
import com.srs.common.core.domain.AjaxResult; // ✅ RuoYi 的返回结果类
|
import com.srs.common.core.domain.AjaxResult; // ✅ RuoYi 的返回结果类
|
||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
import okhttp3.ResponseBody;
|
import okhttp3.ResponseBody;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@@ -38,41 +39,49 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/aitutor/aichat")
|
@RequestMapping("/aitutor/aichat")
|
||||||
public class AiChatController extends BaseController {
|
public class AiChatController extends BaseController {
|
||||||
/**
|
|
||||||
* Dify API的URL地址
|
|
||||||
* 用于发送聊天消息请求到Dify服务
|
|
||||||
*/
|
|
||||||
|
|
||||||
private static final String DIFY_API_URL = "http://47.112.118.149:8100/v1/chat-messages";
|
|
||||||
//private static final String DIFY_API_URL = "http://localhost:8080/v1/chat-messages";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Dify反馈API的基础URL
|
|
||||||
* 用于提交消息反馈(点赞、点踩等)
|
|
||||||
*/
|
|
||||||
private static final String DIFY_FEEDBACK_BASE_URL = "http://47.112.118.149:8100/v1/messages";
|
|
||||||
//private static final String DIFY_FEEDBACK_BASE_URL = "http://localhost:8080/v1/messages";
|
|
||||||
|
|
||||||
private static final String DIFY_API_HISTORY_URL = "http://47.112.118.149:8100/v1/messages";
|
|
||||||
//private static final String DIFY_API_HISTORY_URL = "http://localhost:8080/v1/messages";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Dify会话API的基础URL
|
|
||||||
* 用于获取会话列表
|
|
||||||
*/
|
|
||||||
private static final String DIFY_CONVERSATIONS_URL = "http://47.112.118.149:8100/v1/conversations";
|
|
||||||
//private static final String DIFY_CONVERSATIONS_URL = "http://localhost:8080/v1/conversations";
|
|
||||||
|
|
||||||
//文件上传
|
|
||||||
private static final String DIFY_FILES_URL = "http://47.112.118.149:8100/v1/files/upload";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dify API的访问密钥
|
* Dify API的访问密钥
|
||||||
* 用于身份验证,授权访问Dify服务
|
* 用于身份验证,授权访问Dify服务
|
||||||
*/
|
*/
|
||||||
private static final String DIFY_API_KEY = "app-2wjqcYI9n6igHTVHdH8qXlnh";
|
private static final String DIFY_API_KEY = "app-2wjqcYI9n6igHTVHdH8qXlnh";
|
||||||
//private static final String DIFY_API_KEY = "app-";
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dify API的URL地址
|
||||||
|
* 用于发送聊天消息请求到Dify服务
|
||||||
|
*/
|
||||||
|
|
||||||
|
private static final String DIFY_API_URL = "http://47.112.118.149:8100/v1/chat-messages";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dify反馈API的基础URL
|
||||||
|
* 用于提交消息反馈(点赞、点踩等)
|
||||||
|
*/
|
||||||
|
private static final String DIFY_FEEDBACK_BASE_URL = "http://47.112.118.149:8100/v1/messages";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dify获取反馈API的基础URL
|
||||||
|
* 用于获取消息反馈(点赞、点踩等)
|
||||||
|
*/
|
||||||
|
private static final String DIFY_API_FEEDBACK_URL = "http://47.112.118.149:8100/v1/app/feedbacks?page=";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dify消息历史记录API的基础URL
|
||||||
|
* 用于获取消息历史记录
|
||||||
|
*/
|
||||||
|
private static final String DIFY_API_HISTORY_URL = "http://47.112.118.149:8100/v1/messages";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dify会话API的基础URL
|
||||||
|
* 用于获取会话列表
|
||||||
|
*/
|
||||||
|
private static final String DIFY_CONVERSATIONS_URL = "http://47.112.118.149:8100/v1/conversations";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dify文件上传API的URL地址
|
||||||
|
* 用于上传文件到Dify服务,支持图文多模态理解
|
||||||
|
*/
|
||||||
|
private static final String DIFY_FILES_URL = "http://47.112.118.149:8100/v1/files/upload";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HTTP客户端实例
|
* HTTP客户端实例
|
||||||
@@ -386,12 +395,9 @@ public class AiChatController extends BaseController {
|
|||||||
// 参数校验和限制
|
// 参数校验和限制
|
||||||
int limitValue = Math.min(Math.max(Integer.parseInt(limit), 1), 100);
|
int limitValue = Math.min(Math.max(Integer.parseInt(limit), 1), 100);
|
||||||
|
|
||||||
// 构建请求URL
|
|
||||||
String url = "http://47.112.118.149:8100/v1/app/feedbacks?page=" + page + "&limit=" + limitValue;
|
|
||||||
|
|
||||||
// 构建请求
|
// 构建请求
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(url)
|
.url(DIFY_API_FEEDBACK_URL + page + "&limit=" + limitValue)
|
||||||
.addHeader("Authorization", "Bearer " + DIFY_API_KEY)
|
.addHeader("Authorization", "Bearer " + DIFY_API_KEY)
|
||||||
.addHeader("Content-Type", "application/json")
|
.addHeader("Content-Type", "application/json")
|
||||||
.get()
|
.get()
|
||||||
@@ -420,27 +426,6 @@ public class AiChatController extends BaseController {
|
|||||||
feedbackItem.put("app_id", feedbackNode.has("app_id") ? feedbackNode.get("app_id").asText() : null);
|
feedbackItem.put("app_id", feedbackNode.has("app_id") ? feedbackNode.get("app_id").asText() : null);
|
||||||
feedbackItem.put("conversation_id", feedbackNode.has("conversation_id") ? feedbackNode.get("conversation_id").asText() : null);
|
feedbackItem.put("conversation_id", feedbackNode.has("conversation_id") ? feedbackNode.get("conversation_id").asText() : null);
|
||||||
|
|
||||||
// 提取用户信息
|
|
||||||
if (feedbackNode.has("from_end_user")) {
|
|
||||||
JsonNode userNode = feedbackNode.get("from_end_user");
|
|
||||||
Map<String, Object> userMap = new HashMap<>();
|
|
||||||
userMap.put("id", userNode.has("id") ? userNode.get("id").asText() : null);
|
|
||||||
userMap.put("name", userNode.has("name") ? userNode.get("name").asText() : null);
|
|
||||||
userMap.put("email", userNode.has("email") ? userNode.get("email").asText() : null);
|
|
||||||
feedbackItem.put("from_end_user", userMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提取消息内容
|
|
||||||
if (feedbackNode.has("message")) {
|
|
||||||
JsonNode messageNode = feedbackNode.get("message");
|
|
||||||
Map<String, Object> messageMap = new HashMap<>();
|
|
||||||
messageMap.put("id", messageNode.has("id") ? messageNode.get("id").asText() : null);
|
|
||||||
messageMap.put("query", messageNode.has("query") ? messageNode.get("query").asText() : null);
|
|
||||||
messageMap.put("answer", messageNode.has("answer") ? messageNode.get("answer").asText() : null);
|
|
||||||
messageMap.put("created_at", messageNode.has("created_at") ? messageNode.get("created_at").asLong() : null);
|
|
||||||
feedbackItem.put("message", messageMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
feedbackList.add(feedbackItem);
|
feedbackList.add(feedbackItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -476,6 +461,7 @@ public class AiChatController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 权限标识为辅导员
|
// 权限标识为辅导员
|
||||||
|
@PreAuthorize("@ss.hasPermi('cph:teacher:list')")
|
||||||
@GetMapping("/getMessagesToAdmin")
|
@GetMapping("/getMessagesToAdmin")
|
||||||
public AjaxResult getMessagesToAdmin(@RequestParam String user,
|
public AjaxResult getMessagesToAdmin(@RequestParam String user,
|
||||||
@RequestParam(required = false) String firstId,
|
@RequestParam(required = false) String firstId,
|
||||||
|
|||||||
@@ -0,0 +1,129 @@
|
|||||||
|
package com.srs.web.controller.common;
|
||||||
|
|
||||||
|
import com.srs.common.core.controller.BaseController;
|
||||||
|
import com.srs.common.core.domain.AjaxResult;
|
||||||
|
import com.srs.common.core.domain.entity.SysUser;
|
||||||
|
import com.srs.common.core.domain.model.LoginUser;
|
||||||
|
import com.srs.common.utils.WeChatUtil;
|
||||||
|
import com.srs.framework.web.service.TokenService;
|
||||||
|
import com.srs.system.domain.StudentMentalRating;
|
||||||
|
import com.srs.system.mapper.StudentMentalRatingMapper;
|
||||||
|
import com.srs.system.mapper.SysUserMapper;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dify心理问题发送企业微信 知无涯
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/wechat")
|
||||||
|
public class WeChatMentalAlertController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private WeChatUtil weChatUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
@Autowired
|
||||||
|
private StudentMentalRatingMapper studentMentalRatingMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理心理预警通知请求
|
||||||
|
*/
|
||||||
|
@PostMapping("/mentalAlert")
|
||||||
|
public AjaxResult handleMentalAlert(@RequestBody MentalAlertRequest request,
|
||||||
|
HttpServletRequest httpRequest) {
|
||||||
|
|
||||||
|
// 校验 token 是否有效
|
||||||
|
LoginUser loginUser = tokenService.getLoginUser(httpRequest);
|
||||||
|
if (loginUser == null) {
|
||||||
|
return AjaxResult.error("Token无效或已过期");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询辅导员信息
|
||||||
|
SysUser teacher = sysUserMapper.selectTeacherByStuNo(request.getUserId());
|
||||||
|
if (teacher == null || !StringUtils.hasText(teacher.getUserName())) {
|
||||||
|
log.error("辅导员信息不完整,学号: {}", request.getUserId());
|
||||||
|
return AjaxResult.error("未分配辅导员或信息不完整");
|
||||||
|
}
|
||||||
|
/* 保存学生心理问题评级 */
|
||||||
|
StudentMentalRating record = new StudentMentalRating();
|
||||||
|
record.setStudentId(request.getUserId());
|
||||||
|
record.setRating(request.getRating());
|
||||||
|
studentMentalRatingMapper.insert(record);
|
||||||
|
|
||||||
|
// 构建并发送消息
|
||||||
|
try {
|
||||||
|
String content = buildContent(request, teacher);
|
||||||
|
weChatUtil.sendTextMessage(teacher.getUserName(), content);
|
||||||
|
return AjaxResult.success("消息已发送至辅导员");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("发送企业微信失败", e);
|
||||||
|
return AjaxResult.error("发送失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建企业微信消息内容
|
||||||
|
*/
|
||||||
|
private String buildContent(MentalAlertRequest request, SysUser teacher) {
|
||||||
|
String teacherName = StringUtils.hasText(teacher.getNickName())
|
||||||
|
? teacher.getNickName()
|
||||||
|
: teacher.getUserName();
|
||||||
|
return String.format(
|
||||||
|
"【心理预警通知】\n" +
|
||||||
|
"辅导员:%s(%s)\n" +
|
||||||
|
"学生姓名:%s\n" +
|
||||||
|
"学号:%s\n" +
|
||||||
|
"问题描述:%s\n" +
|
||||||
|
"AI建议:%s\n" +
|
||||||
|
"心理问题评级:%s",
|
||||||
|
teacherName,
|
||||||
|
teacher.getUserName(),
|
||||||
|
request.getUserName(),
|
||||||
|
request.getUserId(),
|
||||||
|
request.getStudentQuestion(),
|
||||||
|
request.getAiAnswer(),
|
||||||
|
request.getRating()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class MentalAlertRequest {
|
||||||
|
private String userId; // 学生学号
|
||||||
|
private String userName; // 学生姓名
|
||||||
|
private String studentQuestion; // 学生提问内容
|
||||||
|
private String aiAnswer; // AI回复内容
|
||||||
|
private String rating; // 心理问题评级
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取全部学生心理评级记录
|
||||||
|
*/
|
||||||
|
@GetMapping("/rating/all")
|
||||||
|
public AjaxResult allRatings() {
|
||||||
|
return AjaxResult.success(studentMentalRatingMapper.selectAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据学号获取全部记录
|
||||||
|
*/
|
||||||
|
@GetMapping("/rating/{stuNo}")
|
||||||
|
public AjaxResult listByStuNo(@PathVariable String stuNo) {
|
||||||
|
return AjaxResult.success(studentMentalRatingMapper.selectByStuNo(stuNo));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -284,4 +284,11 @@ public class CphAuditDetailsController extends BaseController {
|
|||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
return toAjax(cphAuditDetailsService.deleteCphAuditDetailsByIds(ids));
|
return toAjax(cphAuditDetailsService.deleteCphAuditDetailsByIds(ids));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 撤销审核
|
||||||
|
*/
|
||||||
|
@PostMapping("/cancelAudit/{ids}")
|
||||||
|
public AjaxResult cancelAudit(@PathVariable Long[] ids) {
|
||||||
|
return toAjax(cphAuditDetailsService.cancelAuditByIds(ids));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,16 +6,16 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核明细Mapper接口
|
* 审核明细Mapper接口
|
||||||
*
|
*
|
||||||
* @author 邓
|
* @author 邓
|
||||||
* @date 2023-07-04
|
* @date 2023-07-04
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface CphAuditDetailsMapper
|
public interface CphAuditDetailsMapper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询审核明细
|
* 查询审核明细
|
||||||
*
|
*
|
||||||
* @param id 审核明细主键
|
* @param id 审核明细主键
|
||||||
* @return 审核明细
|
* @return 审核明细
|
||||||
*/
|
*/
|
||||||
@@ -25,12 +25,12 @@ public interface CphAuditDetailsMapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询审核明细列表
|
* 查询审核明细列表
|
||||||
*
|
*
|
||||||
* @param cphAuditDetails 审核明细
|
* @param cphAuditDetails 审核明细
|
||||||
* @return 审核明细集合
|
* @return 审核明细集合
|
||||||
*/
|
*/
|
||||||
public List<CphAuditDetails> selectCphAuditDetailsList(CphAuditDetails cphAuditDetails);
|
public List<CphAuditDetails> selectCphAuditDetailsList(CphAuditDetails cphAuditDetails);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询已审核
|
* 查询已审核
|
||||||
* @author zhy
|
* @author zhy
|
||||||
@@ -50,7 +50,7 @@ public interface CphAuditDetailsMapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增审核明细
|
* 新增审核明细
|
||||||
*
|
*
|
||||||
* @param cphAuditDetails 审核明细
|
* @param cphAuditDetails 审核明细
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@@ -58,7 +58,7 @@ public interface CphAuditDetailsMapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改审核明细
|
* 修改审核明细
|
||||||
*
|
*
|
||||||
* @param cphAuditDetails 审核明细
|
* @param cphAuditDetails 审核明细
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@@ -66,7 +66,7 @@ public interface CphAuditDetailsMapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除审核明细
|
* 删除审核明细
|
||||||
*
|
*
|
||||||
* @param id 审核明细主键
|
* @param id 审核明细主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@@ -74,9 +74,10 @@ public interface CphAuditDetailsMapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除审核明细
|
* 批量删除审核明细
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的数据主键集合
|
* @param ids 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCphAuditDetailsByIds(Long[] ids);
|
public int deleteCphAuditDetailsByIds(Long[] ids);
|
||||||
|
public int cancelAudiByIds(Long[] ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ import com.srs.comprehensive.domain.Vo.CphSearch;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 审核明细Service接口
|
* 审核明细Service接口
|
||||||
*
|
*
|
||||||
* @author 邓
|
* @author 邓
|
||||||
* @date 2023-07-04
|
* @date 2023-07-04
|
||||||
*/
|
*/
|
||||||
public interface ICphAuditDetailsService
|
public interface ICphAuditDetailsService
|
||||||
{
|
{
|
||||||
|
|
||||||
public int reSub(CphResub param);
|
public int reSub(CphResub param);
|
||||||
@@ -30,7 +30,7 @@ public interface ICphAuditDetailsService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询审核明细
|
* 查询审核明细
|
||||||
*
|
*
|
||||||
* @param id 审核明细主键
|
* @param id 审核明细主键
|
||||||
* @return 审核明细
|
* @return 审核明细
|
||||||
*/
|
*/
|
||||||
@@ -48,7 +48,7 @@ public interface ICphAuditDetailsService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询审核明细列表
|
* 查询审核明细列表
|
||||||
*
|
*
|
||||||
* @param cphAuditDetails 审核明细
|
* @param cphAuditDetails 审核明细
|
||||||
* @return 审核明细集合
|
* @return 审核明细集合
|
||||||
*/
|
*/
|
||||||
@@ -64,7 +64,7 @@ public interface ICphAuditDetailsService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增审核明细
|
* 新增审核明细
|
||||||
*
|
*
|
||||||
* @param cphAuditDetails 审核明细
|
* @param cphAuditDetails 审核明细
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@@ -72,7 +72,7 @@ public interface ICphAuditDetailsService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改审核明细
|
* 修改审核明细
|
||||||
*
|
*
|
||||||
* @param cphAuditDetails 审核明细
|
* @param cphAuditDetails 审核明细
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@@ -94,15 +94,17 @@ public interface ICphAuditDetailsService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除审核明细
|
* 批量删除审核明细
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的审核明细主键集合
|
* @param ids 需要删除的审核明细主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteCphAuditDetailsByIds(Long[] ids);
|
public int deleteCphAuditDetailsByIds(Long[] ids);
|
||||||
|
//撤销
|
||||||
|
public int cancelAuditByIds(Long[] ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除审核明细信息
|
* 删除审核明细信息
|
||||||
*
|
*
|
||||||
* @param id 审核明细主键
|
* @param id 审核明细主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -519,7 +519,10 @@ public class CphAuditDetailsServiceImpl implements ICphAuditDetailsService {
|
|||||||
public int deleteCphAuditDetailsByIds(Long[] ids) {
|
public int deleteCphAuditDetailsByIds(Long[] ids) {
|
||||||
return cphAuditDetailsMapper.deleteCphAuditDetailsByIds(ids);
|
return cphAuditDetailsMapper.deleteCphAuditDetailsByIds(ids);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public int cancelAuditByIds(Long[] ids) {
|
||||||
|
return cphAuditDetailsMapper.cancelAudiByIds(ids);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 删除审核明细信息
|
* 删除审核明细信息
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -19,8 +19,10 @@ import com.srs.comprehensive.mapper.ClassCounMapper;
|
|||||||
import com.srs.comprehensive.mapper.Gxsdxy02JzgxxMapper;
|
import com.srs.comprehensive.mapper.Gxsdxy02JzgxxMapper;
|
||||||
import com.srs.comprehensive.mapper.InfoTeacherMapper;
|
import com.srs.comprehensive.mapper.InfoTeacherMapper;
|
||||||
import com.srs.comprehensive.util.ListSliceUtil;
|
import com.srs.comprehensive.util.ListSliceUtil;
|
||||||
|
import com.srs.system.domain.QgzxTeacher;
|
||||||
import com.srs.system.domain.SysPost;
|
import com.srs.system.domain.SysPost;
|
||||||
import com.srs.system.domain.SysUserRole;
|
import com.srs.system.domain.SysUserRole;
|
||||||
|
import com.srs.system.mapper.QgzxTeacherMapper;
|
||||||
import com.srs.system.mapper.SysRoleMapper;
|
import com.srs.system.mapper.SysRoleMapper;
|
||||||
import com.srs.system.mapper.SysUserMapper;
|
import com.srs.system.mapper.SysUserMapper;
|
||||||
import com.srs.system.mapper.SysUserRoleMapper;
|
import com.srs.system.mapper.SysUserRoleMapper;
|
||||||
@@ -47,6 +49,8 @@ public class CphTeacherServiceImpl implements ICphTeacherService
|
|||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private CphTeacherMapper cphTeacherMapper;
|
private CphTeacherMapper cphTeacherMapper;
|
||||||
|
@Autowired
|
||||||
|
private QgzxTeacherMapper qgzxTeacherMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private Gxsdxy02JzgxxMapper teacherMapper;
|
private Gxsdxy02JzgxxMapper teacherMapper;
|
||||||
@@ -350,14 +354,121 @@ public class CphTeacherServiceImpl implements ICphTeacherService
|
|||||||
}
|
}
|
||||||
|
|
||||||
//同步辅导员
|
//同步辅导员
|
||||||
|
// @Override
|
||||||
|
// @Transactional(rollbackFor = Exception.class)
|
||||||
|
// public void sqlserverSynchronousMYSQL(List<Map> list) {
|
||||||
|
// //辅导员列表
|
||||||
|
// List<CphTeacher> cphTeachers = cphTeacherMapper.selectTeacherList();
|
||||||
|
// //查找重复值
|
||||||
|
// List<Map> updateMap = list.stream()
|
||||||
|
// .filter(obj1 -> cphTeachers
|
||||||
|
// .stream().anyMatch(obj2 -> {
|
||||||
|
// Object xhObj = obj1.get("zgh");
|
||||||
|
// if (xhObj != null) {
|
||||||
|
// String zgh = xhObj.toString();
|
||||||
|
// return obj2.getEmployeeId().equals(zgh);
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }))
|
||||||
|
// .collect(Collectors.toList());
|
||||||
|
//
|
||||||
|
// //添加需要
|
||||||
|
// List<String> kshList2 = cphTeachers.stream()
|
||||||
|
// .map(CphTeacher::getEmployeeId)
|
||||||
|
// .collect(Collectors.toList());
|
||||||
|
//
|
||||||
|
// List<Map> insertMap = list.stream()
|
||||||
|
// .filter(obj -> {
|
||||||
|
// Object xhObj = obj.get("zgh");
|
||||||
|
// return xhObj != null && !kshList2.contains(xhObj.toString());
|
||||||
|
// })
|
||||||
|
// .collect(Collectors.toList());
|
||||||
|
// //添加
|
||||||
|
// List<CphTeacher> insertStudentList = new ArrayList<>();
|
||||||
|
// for (Map map:insertMap){
|
||||||
|
// CphTeacher cphTeacher = new CphTeacher();
|
||||||
|
// Object xmObj = map.get("xm");
|
||||||
|
// if (xmObj != null) {
|
||||||
|
// cphTeacher.setName(xmObj.toString());
|
||||||
|
// }
|
||||||
|
// Object xbObj = map.get("xb");
|
||||||
|
// if (xbObj != null) {
|
||||||
|
// String s = xbObj.toString();
|
||||||
|
// if (!Objects.equals(s, "NULL") && !Objects.equals(s, "null")&&!Objects.equals(s," ")) {
|
||||||
|
// cphTeacher.setGender(xbObj.toString());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// Object zghObj = map.get("zgh");
|
||||||
|
// if (zghObj != null) {
|
||||||
|
// cphTeacher.setEmployeeId(zghObj.toString());
|
||||||
|
// }
|
||||||
|
// //学院id
|
||||||
|
// Object yxdmObj = map.get("yxdm");
|
||||||
|
// if (yxdmObj!=null) {
|
||||||
|
// Long deptId = cphTeacherMapper.selectDeptCode(yxdmObj.toString());
|
||||||
|
// if (deptId != null) {
|
||||||
|
// cphTeacher.setDeptId(deptId);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// cphTeacher.setStatus("1");
|
||||||
|
// cphTeacher.setCreateTime(DateUtils.getNowDate());
|
||||||
|
// insertStudentList.add(cphTeacher);
|
||||||
|
// }
|
||||||
|
// if (insertStudentList.size()!=0) {
|
||||||
|
// cphTeacherMapper.insertBatchSomeColumn(insertStudentList);
|
||||||
|
// }
|
||||||
|
// //修改
|
||||||
|
// List<CphTeacher> updateSrsStudent = new ArrayList<>();
|
||||||
|
// for (Map map:updateMap){
|
||||||
|
// CphTeacher cphTeacher = new CphTeacher();
|
||||||
|
// Object xmObj = map.get("xm");
|
||||||
|
// if (xmObj != null) {
|
||||||
|
// cphTeacher.setName(xmObj.toString());
|
||||||
|
// }
|
||||||
|
// Object xbObj = map.get("xb");
|
||||||
|
// if (xbObj != null) {
|
||||||
|
// String s = xbObj.toString();
|
||||||
|
// if (!Objects.equals(s, "NULL") && !Objects.equals(s, "null")&&!Objects.equals(s," ")) {
|
||||||
|
// cphTeacher.setGender(xbObj.toString());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// Object zghObj = map.get("zgh");
|
||||||
|
// if (zghObj != null) {
|
||||||
|
// cphTeacher.setEmployeeId(zghObj.toString());
|
||||||
|
// }
|
||||||
|
// //学院id
|
||||||
|
// Object yxdmObj = map.get("yxdm");
|
||||||
|
// if (yxdmObj!=null) {
|
||||||
|
// Long ksh = cphTeacherMapper.selectDeptCode(yxdmObj.toString());
|
||||||
|
// if (ksh != null) {
|
||||||
|
// cphTeacher.setDeptId(ksh);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// cphTeacher.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
// updateSrsStudent.add(cphTeacher);
|
||||||
|
// }
|
||||||
|
// /*if (updateSrsStudent.size()!=0) {
|
||||||
|
// List<List<CphTeacher>> lists = ListSliceUtil.updateSlice(updateSrsStudent);
|
||||||
|
// if (lists != null) {
|
||||||
|
// for (List<CphTeacher> studentList : lists) {
|
||||||
|
// cphTeacherMapper.updateSrsClassList(studentList);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }*/
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
//同步教职工表
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void sqlserverSynchronousMYSQL(List<Map> list) {
|
public void sqlserverSynchronousMYSQL(List<Map> list) {
|
||||||
//辅导员列表
|
//教职工列表
|
||||||
List<CphTeacher> cphTeachers = cphTeacherMapper.selectTeacherList();
|
List<QgzxTeacher> qgzxTeachers = qgzxTeacherMapper.selectTeacherList();
|
||||||
//查找重复值
|
//查找重复值
|
||||||
List<Map> updateMap = list.stream()
|
List<Map> updateMap = list.stream()
|
||||||
.filter(obj1 -> cphTeachers
|
.filter(obj1 -> qgzxTeachers
|
||||||
.stream().anyMatch(obj2 -> {
|
.stream().anyMatch(obj2 -> {
|
||||||
Object xhObj = obj1.get("zgh");
|
Object xhObj = obj1.get("zgh");
|
||||||
if (xhObj != null) {
|
if (xhObj != null) {
|
||||||
@@ -369,8 +480,8 @@ public class CphTeacherServiceImpl implements ICphTeacherService
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
//添加需要
|
//添加需要
|
||||||
List<String> kshList2 = cphTeachers.stream()
|
List<String> kshList2 = qgzxTeachers.stream()
|
||||||
.map(CphTeacher::getEmployeeId)
|
.map(QgzxTeacher::getEmployeeId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
List<Map> insertMap = list.stream()
|
List<Map> insertMap = list.stream()
|
||||||
@@ -380,68 +491,68 @@ public class CphTeacherServiceImpl implements ICphTeacherService
|
|||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
//添加
|
//添加
|
||||||
List<CphTeacher> insertStudentList = new ArrayList<>();
|
List<QgzxTeacher> insertStudentList = new ArrayList<>();
|
||||||
for (Map map:insertMap){
|
for (Map map:insertMap){
|
||||||
CphTeacher cphTeacher = new CphTeacher();
|
QgzxTeacher qgzxTeacher = new QgzxTeacher();
|
||||||
Object xmObj = map.get("xm");
|
Object xmObj = map.get("xm");
|
||||||
if (xmObj != null) {
|
if (xmObj != null) {
|
||||||
cphTeacher.setName(xmObj.toString());
|
qgzxTeacher.setName(xmObj.toString());
|
||||||
}
|
}
|
||||||
Object xbObj = map.get("xb");
|
Object xbObj = map.get("xb");
|
||||||
if (xbObj != null) {
|
if (xbObj != null) {
|
||||||
String s = xbObj.toString();
|
String s = xbObj.toString();
|
||||||
if (!Objects.equals(s, "NULL") && !Objects.equals(s, "null")&&!Objects.equals(s," ")) {
|
if (!Objects.equals(s, "NULL") && !Objects.equals(s, "null")&&!Objects.equals(s," ")) {
|
||||||
cphTeacher.setGender(xbObj.toString());
|
qgzxTeacher.setGender(xbObj.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Object zghObj = map.get("zgh");
|
Object zghObj = map.get("zgh");
|
||||||
if (zghObj != null) {
|
if (zghObj != null) {
|
||||||
cphTeacher.setEmployeeId(zghObj.toString());
|
qgzxTeacher.setEmployeeId(zghObj.toString());
|
||||||
}
|
}
|
||||||
//学院id
|
//学院id
|
||||||
Object yxdmObj = map.get("yxdm");
|
Object yxdmObj = map.get("yxdm");
|
||||||
if (yxdmObj!=null) {
|
if (yxdmObj!=null) {
|
||||||
Long deptId = cphTeacherMapper.selectDeptCode(yxdmObj.toString());
|
Long deptId = qgzxTeacherMapper.selectDeptCode(yxdmObj.toString());
|
||||||
if (deptId != null) {
|
if (deptId != null) {
|
||||||
cphTeacher.setDeptId(deptId);
|
qgzxTeacher.setDeptId(deptId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cphTeacher.setStatus("1");
|
qgzxTeacher.setStatus("1");
|
||||||
cphTeacher.setCreateTime(DateUtils.getNowDate());
|
qgzxTeacher.setCreateTime(DateUtils.getNowDate());
|
||||||
insertStudentList.add(cphTeacher);
|
insertStudentList.add(qgzxTeacher);
|
||||||
}
|
}
|
||||||
if (insertStudentList.size()!=0) {
|
if (insertStudentList.size()!=0) {
|
||||||
cphTeacherMapper.insertBatchSomeColumn(insertStudentList);
|
qgzxTeacherMapper.insertBatchSomeColumn(insertStudentList);
|
||||||
}
|
}
|
||||||
//修改
|
//修改
|
||||||
List<CphTeacher> updateSrsStudent = new ArrayList<>();
|
List<QgzxTeacher> updateSrsStudent = new ArrayList<>();
|
||||||
for (Map map:updateMap){
|
for (Map map:updateMap){
|
||||||
CphTeacher cphTeacher = new CphTeacher();
|
QgzxTeacher qgzxTeacher = new QgzxTeacher();
|
||||||
Object xmObj = map.get("xm");
|
Object xmObj = map.get("xm");
|
||||||
if (xmObj != null) {
|
if (xmObj != null) {
|
||||||
cphTeacher.setName(xmObj.toString());
|
qgzxTeacher.setName(xmObj.toString());
|
||||||
}
|
}
|
||||||
Object xbObj = map.get("xb");
|
Object xbObj = map.get("xb");
|
||||||
if (xbObj != null) {
|
if (xbObj != null) {
|
||||||
String s = xbObj.toString();
|
String s = xbObj.toString();
|
||||||
if (!Objects.equals(s, "NULL") && !Objects.equals(s, "null")&&!Objects.equals(s," ")) {
|
if (!Objects.equals(s, "NULL") && !Objects.equals(s, "null")&&!Objects.equals(s," ")) {
|
||||||
cphTeacher.setGender(xbObj.toString());
|
qgzxTeacher.setGender(xbObj.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Object zghObj = map.get("zgh");
|
Object zghObj = map.get("zgh");
|
||||||
if (zghObj != null) {
|
if (zghObj != null) {
|
||||||
cphTeacher.setEmployeeId(zghObj.toString());
|
qgzxTeacher.setEmployeeId(zghObj.toString());
|
||||||
}
|
}
|
||||||
//学院id
|
//学院id
|
||||||
Object yxdmObj = map.get("yxdm");
|
Object yxdmObj = map.get("yxdm");
|
||||||
if (yxdmObj!=null) {
|
if (yxdmObj!=null) {
|
||||||
Long ksh = cphTeacherMapper.selectDeptCode(yxdmObj.toString());
|
Long ksh = qgzxTeacherMapper.selectDeptCode(yxdmObj.toString());
|
||||||
if (ksh != null) {
|
if (ksh != null) {
|
||||||
cphTeacher.setDeptId(ksh);
|
qgzxTeacher.setDeptId(ksh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cphTeacher.setUpdateTime(DateUtils.getNowDate());
|
qgzxTeacher.setUpdateTime(DateUtils.getNowDate());
|
||||||
updateSrsStudent.add(cphTeacher);
|
updateSrsStudent.add(qgzxTeacher);
|
||||||
}
|
}
|
||||||
/*if (updateSrsStudent.size()!=0) {
|
/*if (updateSrsStudent.size()!=0) {
|
||||||
List<List<CphTeacher>> lists = ListSliceUtil.updateSlice(updateSrsStudent);
|
List<List<CphTeacher>> lists = ListSliceUtil.updateSlice(updateSrsStudent);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.srs.comprehensive.mapper.CphAuditDetailsMapper">
|
<mapper namespace="com.srs.comprehensive.mapper.CphAuditDetailsMapper">
|
||||||
|
|
||||||
<resultMap type="CphAuditDetails" id="CphAuditDetailsResult">
|
<resultMap type="CphAuditDetails" id="CphAuditDetailsResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="projectName" column="project_name" />
|
<result property="projectName" column="project_name" />
|
||||||
@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectCphAuditDetailsList" parameterType="CphAuditDetails" resultMap="CphAuditDetailsResult">
|
<select id="selectCphAuditDetailsList" parameterType="CphAuditDetails" resultMap="CphAuditDetailsResult">
|
||||||
<include refid="selectCphAuditDetailsVo"/>
|
<include refid="selectCphAuditDetailsVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
|
<if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
|
||||||
<if test="submitterId != null "> and submitter_id = #{submitterId}</if>
|
<if test="submitterId != null "> and submitter_id = #{submitterId}</if>
|
||||||
<if test="submitterName != null and submitterName != ''"> and submitter_name like concat('%', #{submitterName}, '%')</if>
|
<if test="submitterName != null and submitterName != ''"> and submitter_name like concat('%', #{submitterName}, '%')</if>
|
||||||
@@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
order by stu_no,id desc
|
order by stu_no,id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectCphAuditDetailsById" parameterType="Long" resultMap="CphAuditDetailsResult">
|
<select id="selectCphAuditDetailsById" parameterType="Long" resultMap="CphAuditDetailsResult">
|
||||||
<include refid="selectCphAuditDetailsVo"/>
|
<include refid="selectCphAuditDetailsVo"/>
|
||||||
where ad.id = #{id}
|
where ad.id = #{id}
|
||||||
@@ -111,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectCphAuditDetailsVo"/>
|
<include refid="selectCphAuditDetailsVo"/>
|
||||||
where ad.project_id = #{id}
|
where ad.project_id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertCphAuditDetails" parameterType="CphAuditDetails" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertCphAuditDetails" parameterType="CphAuditDetails" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into cph_audit_details
|
insert into cph_audit_details
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
@@ -159,9 +159,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteCphAuditDetailsByIds" parameterType="String">
|
<delete id="deleteCphAuditDetailsByIds" parameterType="String">
|
||||||
delete from cph_audit_details where id in
|
delete from cph_audit_details where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
<update id="cancelAudiByIds" parameterType="String">
|
||||||
|
update cph_audit_details set status_code=1 where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ private static final long serialVersionUID=1L;
|
|||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@ApiModelProperty("学院")
|
@ApiModelProperty("学院")
|
||||||
@TableField("dept_name=false")
|
@TableField(exist=false)
|
||||||
@Excel(name = "学院")
|
@Excel(name = "学院")
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.srs.system.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.srs.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生心理问题评级表 知无涯
|
||||||
|
*/
|
||||||
|
public class StudentMentalRating extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
private String studentId;
|
||||||
|
private String rating;
|
||||||
|
|
||||||
|
|
||||||
|
public Long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStudentId() {
|
||||||
|
return studentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStudentId(String studentId) {
|
||||||
|
this.studentId = studentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRating() {
|
||||||
|
return rating;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRating(String rating) {
|
||||||
|
this.rating = rating;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date createdTime;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date updatedTime;
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.srs.system.domain.QgzxTeacher;
|
import com.srs.system.domain.QgzxTeacher;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 教职工信息Mapper接口
|
* 教职工信息Mapper接口
|
||||||
@@ -59,4 +60,8 @@ public interface QgzxTeacherMapper extends BaseMapper<QgzxTeacher> {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteQgzxTeacherByTeacherIds(Long[] teacherIds);
|
int deleteQgzxTeacherByTeacherIds(Long[] teacherIds);
|
||||||
|
|
||||||
|
public List<QgzxTeacher> selectTeacherList();
|
||||||
|
Long selectDeptCode(String ksh);
|
||||||
|
Integer insertBatchSomeColumn(@Param("list")List<QgzxTeacher> entityList);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.srs.system.mapper;
|
||||||
|
|
||||||
|
import com.srs.system.domain.StudentMentalRating;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface StudentMentalRatingMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按学号查询 知无涯
|
||||||
|
*/
|
||||||
|
StudentMentalRating selectByStudentId(String studentId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入
|
||||||
|
*/
|
||||||
|
int insert(StudentMentalRating record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按学号更新评级
|
||||||
|
*/
|
||||||
|
int updateRatingByStudentId(StudentMentalRating record);
|
||||||
|
|
||||||
|
/** 全部记录 */
|
||||||
|
List<StudentMentalRating> selectAll();
|
||||||
|
|
||||||
|
/** 单学号全部记录 */
|
||||||
|
List<StudentMentalRating> selectByStuNo(@Param("stuNo") String stuNo);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -39,7 +39,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<include refid="selectQgzxTeacherVo"/>
|
<include refid="selectQgzxTeacherVo"/>
|
||||||
where teacher_id = #{teacherId}
|
where teacher_id = #{teacherId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectTeacherList" resultType="com.srs.system.domain.QgzxTeacher">
|
||||||
|
select * from qgzx_teacher
|
||||||
|
</select>
|
||||||
|
<select id="selectDeptCode" resultType="java.lang.Long">
|
||||||
|
select a.dept_id
|
||||||
|
from sys_dept as a
|
||||||
|
where dept_code = #{ksh}
|
||||||
|
</select>
|
||||||
<insert id="insertQgzxTeacher" parameterType="QgzxTeacher" useGeneratedKeys="true" keyProperty="teacherId">
|
<insert id="insertQgzxTeacher" parameterType="QgzxTeacher" useGeneratedKeys="true" keyProperty="teacherId">
|
||||||
insert into qgzx_teacher
|
insert into qgzx_teacher
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
@@ -65,6 +72,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="insertBatchSomeColumn">
|
||||||
|
insert into qgzx_teacher(name,gender,age,employee_id,dept_id,status,create_time)
|
||||||
|
values
|
||||||
|
<foreach item="entity" collection="List" separator="," open="(" close=")">
|
||||||
|
(
|
||||||
|
<if test="entity.name != null and entity.name != ''">#{entity.name},</if>
|
||||||
|
<if test="entity.gender != null and entity.gender != ''">#{entity.gender},</if>
|
||||||
|
<if test="entity.age!=null">#{entity.age},</if>
|
||||||
|
<if test="entity.employeeId != null and entity.employeeId != ''">#{entity.employeeId},</if>
|
||||||
|
<if test="entity.deptId!=null">#{entity.deptId},</if>
|
||||||
|
<if test="entity.status != null and entity.status != ''">#{entity.status},</if>
|
||||||
|
<if test="entity.createTime!=null">#{entity.createTime},</if>
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateQgzxTeacher" parameterType="QgzxTeacher">
|
<update id="updateQgzxTeacher" parameterType="QgzxTeacher">
|
||||||
update qgzx_teacher
|
update qgzx_teacher
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.srs.system.mapper.StudentMentalRatingMapper">
|
||||||
|
<!-- 添加 知无涯-->
|
||||||
|
<select id="selectByStudentId" resultType="com.srs.system.domain.StudentMentalRating">
|
||||||
|
SELECT id, student_id, rating, created_time, updated_time
|
||||||
|
FROM student_mental_rating
|
||||||
|
WHERE student_id = #{studentId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="com.srs.system.domain.StudentMentalRating"
|
||||||
|
useGeneratedKeys="true" keyProperty="id">
|
||||||
|
INSERT INTO student_mental_rating(student_id, rating)
|
||||||
|
VALUES (#{studentId}, #{rating})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateRatingByStudentId" parameterType="com.srs.system.domain.StudentMentalRating">
|
||||||
|
UPDATE student_mental_rating
|
||||||
|
SET rating = #{rating}
|
||||||
|
WHERE student_id = #{studentId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 心理查询全部:知无涯 -->
|
||||||
|
<select id="selectAll" resultType="com.srs.system.domain.StudentMentalRating">
|
||||||
|
SELECT id,
|
||||||
|
student_id AS studentId,
|
||||||
|
rating,
|
||||||
|
created_time AS createdTime,
|
||||||
|
updated_time AS updatedTime
|
||||||
|
FROM student_mental_rating
|
||||||
|
ORDER BY created_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据学号查询心理:知无涯 -->
|
||||||
|
<select id="selectByStuNo" resultType="com.srs.system.domain.StudentMentalRating">
|
||||||
|
SELECT id,
|
||||||
|
student_id AS studentId,
|
||||||
|
rating,
|
||||||
|
created_time AS createdTime,
|
||||||
|
updated_time AS updatedTime
|
||||||
|
FROM student_mental_rating
|
||||||
|
WHERE student_id = #{stuNo}
|
||||||
|
ORDER BY created_time DESC
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -8,6 +8,8 @@ import com.srs.common.core.domain.entity.SysUser;
|
|||||||
import com.srs.common.enums.QgzxApplyStatus;
|
import com.srs.common.enums.QgzxApplyStatus;
|
||||||
import com.srs.comprehensive.domain.CphTeacher;
|
import com.srs.comprehensive.domain.CphTeacher;
|
||||||
import com.srs.comprehensive.mapper.CphTeacherMapper;
|
import com.srs.comprehensive.mapper.CphTeacherMapper;
|
||||||
|
import com.srs.system.domain.QgzxTeacher;
|
||||||
|
import com.srs.system.mapper.QgzxTeacherMapper;
|
||||||
import com.srs.system.mapper.SysDeptMapper;
|
import com.srs.system.mapper.SysDeptMapper;
|
||||||
import com.srs.system.mapper.SysUserMapper;
|
import com.srs.system.mapper.SysUserMapper;
|
||||||
import com.srs.workstudy.domain.QgzxMoney;
|
import com.srs.workstudy.domain.QgzxMoney;
|
||||||
@@ -61,6 +63,8 @@ public class QgzxPostServiceImpl extends ServiceImpl<QgzxPostMapper,QgzxPost> im
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CphTeacherMapper _teacherMapper;
|
private CphTeacherMapper _teacherMapper;
|
||||||
|
@Autowired
|
||||||
|
private QgzxTeacherMapper _qgzxteacherMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserMapper _userMapper;
|
private SysUserMapper _userMapper;
|
||||||
@@ -383,10 +387,14 @@ public class QgzxPostServiceImpl extends ServiceImpl<QgzxPostMapper,QgzxPost> im
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<CphTeacher> fzrQuery = new QueryWrapper<>();
|
// QueryWrapper<CphTeacher> fzrQuery = new QueryWrapper<>();
|
||||||
fzrQuery.eq("employee_id", param.fzrNo)
|
// fzrQuery.eq("employee_id", param.fzrNo)
|
||||||
.last("limit 1");
|
// .last("limit 1");
|
||||||
CphTeacher fzr = _teacherMapper.selectOne(fzrQuery);
|
// CphTeacher fzr = _teacherMapper.selectOne(fzrQuery);
|
||||||
|
QueryWrapper<QgzxTeacher> fzrQuery = new QueryWrapper<>();
|
||||||
|
fzrQuery.eq("employee_id", param.fzrNo)
|
||||||
|
.last("limit 1");
|
||||||
|
QgzxTeacher fzr = _qgzxteacherMapper.selectOne(fzrQuery);
|
||||||
if (fzr == null) {
|
if (fzr == null) {
|
||||||
throw new Exception("负责人工号不存在");
|
throw new Exception("负责人工号不存在");
|
||||||
} else {
|
} else {
|
||||||
@@ -437,10 +445,14 @@ public class QgzxPostServiceImpl extends ServiceImpl<QgzxPostMapper,QgzxPost> im
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<CphTeacher> fzrQuery = new QueryWrapper<>();
|
// QueryWrapper<CphTeacher> fzrQuery = new QueryWrapper<>();
|
||||||
|
// fzrQuery.eq("employee_id", param.fzrNo)
|
||||||
|
// .last("limit 1");
|
||||||
|
// CphTeacher fzr = _teacherMapper.selectOne(fzrQuery);
|
||||||
|
QueryWrapper<QgzxTeacher> fzrQuery = new QueryWrapper<>();
|
||||||
fzrQuery.eq("employee_id", param.fzrNo)
|
fzrQuery.eq("employee_id", param.fzrNo)
|
||||||
.last("limit 1");
|
.last("limit 1");
|
||||||
CphTeacher fzr = _teacherMapper.selectOne(fzrQuery);
|
QgzxTeacher fzr = _qgzxteacherMapper.selectOne(fzrQuery);
|
||||||
if (fzr == null) {
|
if (fzr == null) {
|
||||||
throw new Exception("负责人工号不存在");
|
throw new Exception("负责人工号不存在");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user