Compare commits

..

5 Commits

  1. 6
      src/main/java/com/msdw/tms/common/utils/ConstantUtils.java
  2. 15
      src/main/java/com/msdw/tms/controller/StudentController.java
  3. 6
      src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java
  4. 31
      src/main/java/com/msdw/tms/util/MD5.java
  5. 52
      src/main/resources/application-chaohu.properties
  6. 52
      src/main/resources/application-hehai.properties
  7. 2
      src/main/resources/application-prod.properties
  8. 2
      src/main/resources/application.properties
  9. 42
      src/main/resources/application.yml
  10. 7
      src/main/resources/mapper/tms/ProjectRecordDao.xml
  11. 2
      src/main/resources/mapper/tms/StudentDao.xml
  12. 2
      src/main/resources/mapper/tms/SystemSetting.xml

@ -11,10 +11,8 @@ public class ConstantUtils {
//绑定巢湖学院的schoolId //绑定电子科大的schoolId
public static final Integer Keda_schoolId = 1006; public static final Integer Keda_schoolId = 2105;
//河海大學id
// public static final Integer Keda_schoolId = 729;
//绑定角色ID //绑定角色ID
public static final Integer STUDENT_ROLE = 4; public static final Integer STUDENT_ROLE = 4;

@ -1,14 +1,19 @@
package com.msdw.tms.controller; package com.msdw.tms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.msdw.tms.api.StudentControllerApi; import com.msdw.tms.api.StudentControllerApi;
import com.msdw.tms.common.utils.Constant;
import com.msdw.tms.common.utils.ConstantUtils; import com.msdw.tms.common.utils.ConstantUtils;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.common.utils.R; import com.msdw.tms.common.utils.R;
import com.msdw.tms.entity.StudentEntity;
import com.msdw.tms.entity.UserInfoEntity; import com.msdw.tms.entity.UserInfoEntity;
import com.msdw.tms.entity.vo.StudentVo; import com.msdw.tms.entity.vo.StudentVo;
import com.msdw.tms.service.StudentService; import com.msdw.tms.service.StudentService;
import com.msdw.tms.service.UserInfoService; import com.msdw.tms.service.UserInfoService;
import com.sun.xml.bind.v2.model.core.ID;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -16,8 +21,11 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/** /**
* 学生管理 * 学生管理
@ -43,8 +51,9 @@ public class StudentController implements StudentControllerApi{
studentVo.setSchoolId(ConstantUtils.Keda_schoolId); studentVo.setSchoolId(ConstantUtils.Keda_schoolId);
String account = studentVo.getAccount(); String account = studentVo.getAccount();
String phone = studentVo.getPhone(); String phone = studentVo.getPhone();
Integer result = studentService.queryStudentIdNumber(studentVo.getWorkNumber(),ConstantUtils.Keda_schoolId); Integer schoolId = studentVo.getSchoolId();
Integer res = userInfoService.queryStudentAccount(account,ConstantUtils.Keda_schoolId); Integer result = studentService.queryStudentIdNumber(studentVo.getWorkNumber(),schoolId);
Integer res = userInfoService.queryStudentAccount(account,schoolId);
if (phone!=null&&phone!=""){ if (phone!=null&&phone!=""){
Integer outcome = userInfoService.queryStudentPhone(phone); Integer outcome = userInfoService.queryStudentPhone(phone);
if(outcome==1){ if(outcome==1){
@ -63,7 +72,7 @@ public class StudentController implements StudentControllerApi{
userInfoList.setAccount(account) userInfoList.setAccount(account)
.setPhone(phone) .setPhone(phone)
.setEmail(studentVo.getEmail()) .setEmail(studentVo.getEmail())
.setSchoolId(ConstantUtils.Keda_schoolId) .setSchoolId(studentVo.getSchoolAppellationId())
.setUserName(studentVo.getUserName()) .setUserName(studentVo.getUserName())
.setToken(new ConstantUtils().token); .setToken(new ConstantUtils().token);
userInfoService.saveUserInfo(userInfoList); userInfoService.saveUserInfo(userInfoList);

@ -3,6 +3,7 @@ package com.msdw.tms.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference; import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.msdw.tms.common.exception.ExceptionCast; import com.msdw.tms.common.exception.ExceptionCast;
@ -11,6 +12,7 @@ import com.msdw.tms.common.utils.poi.ExcelExportUtil;
import com.msdw.tms.dao.SystemSetttingDao; import com.msdw.tms.dao.SystemSetttingDao;
import com.msdw.tms.dao.UserInfoDao; import com.msdw.tms.dao.UserInfoDao;
import com.msdw.tms.entity.StaffEntity; import com.msdw.tms.entity.StaffEntity;
import com.msdw.tms.entity.StudentEntity;
import com.msdw.tms.entity.UserInfoEntity; import com.msdw.tms.entity.UserInfoEntity;
import com.msdw.tms.entity.XlsxTemplateEntity; import com.msdw.tms.entity.XlsxTemplateEntity;
import com.msdw.tms.entity.response.CommonCode; import com.msdw.tms.entity.response.CommonCode;
@ -19,6 +21,7 @@ import com.msdw.tms.entity.vo.StaffVo;
import com.msdw.tms.service.AliyunOssService; import com.msdw.tms.service.AliyunOssService;
import com.msdw.tms.service.SystemSetttingService; import com.msdw.tms.service.SystemSetttingService;
import com.msdw.tms.service.XlsxTemplateService; import com.msdw.tms.service.XlsxTemplateService;
import com.msdw.tms.util.MD5;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -282,6 +285,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
String phone = staffVo.getPhone(); String phone = staffVo.getPhone();
String email = staffVo.getEmail(); String email = staffVo.getEmail();
//校验员工姓名 //校验员工姓名
if (staffVo.getUserName().equals("")) { if (staffVo.getUserName().equals("")) {
StaffExportVo vo = new StaffExportVo(); StaffExportVo vo = new StaffExportVo();
@ -746,7 +750,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
@Transactional @Transactional
public R resetPwd(Integer userId, String newPwd) { public R resetPwd(Integer userId, String newPwd) {
UserInfoEntity user = new UserInfoEntity(); UserInfoEntity user = new UserInfoEntity();
user.setPassword(newPwd); user.setPassword(MD5.encrypt(newPwd));
int count = userInfoDao.update(user, new QueryWrapper<UserInfoEntity>().eq("userId", userId)); int count = userInfoDao.update(user, new QueryWrapper<UserInfoEntity>().eq("userId", userId));
if (count > 0) { if (count > 0) {
return R.ok(); return R.ok();

@ -0,0 +1,31 @@
package com.msdw.tms.util;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public final class MD5 {
public static String encrypt(String strSrc) {
try {
char hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'a', 'b', 'c', 'd', 'e', 'f' };
byte[] bytes = strSrc.getBytes();
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(bytes);
bytes = md.digest();
int j = bytes.length;
char[] chars = new char[j * 2];
int k = 0;
for (int i = 0; i < bytes.length; i++) {
byte b = bytes[i];
chars[k++] = hexChars[b >>> 4 & 0xf];
chars[k++] = hexChars[b & 0xf];
}
return new String(chars);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
throw new RuntimeException("MD5加密出错!!+" + e);
}
}
}

@ -1,52 +0,0 @@
server.port=9001
server.servlet.context-path=/evaluation
#\u6B63\u5F0F\u6570\u636E\u5E93\u8FDE\u63A5
spring.datasource.url=jdbc:mysql://192.168.0.245:3306/chaohu?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=HuoRan@2021
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jackson.default-property-inclusion=non_null
# \u8FD9\u4E2A\u914D\u7F6E\u4F1A\u5C06\u6267\u884C\u7684sql\u6253\u5370\u51FA\u6765\uFF0C\u5728\u5F00\u53D1\u6216\u6D4B\u8BD5\u7684\u65F6\u5019\u53EF\u4EE5\u7528
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus.mapper-locations=classpath:/mapper/**/*.xml
mybatis-plus.global-config.db-config.id-type=auto
mybatis-plus.global-config.db-config.logic-delete-field=is_del
mybatis-plus.global-config.db-config.logic-delete-value=0
mybatis-plus.global-config.db-config.logic-not-delete-value=1
tms.thread.core-size=20
tms.thread.max-size=200
tms.thread.keep-alive-time=10
#redis\u914D\u7F6E
spring.redis.database=0
spring.redis.host=127.0.0.1
spring.redis.password=
spring.redis.port=6379
spring.redis.timeout=3000
spring.redis.jedis.pool.max-idle=500
spring.redis.jedis.pool.min-idle=50
spring.redis.jedis.pool.max-active=2000
spring.redis.jedis.pool.max-wait=1000
#\u65E5\u5FD7\u7EA7\u522B
logging.level.jdbc=OFF
logging.level.jdbc.sqltiming=DEBUG
logging.level.jdbc.resultsettable=DEBUG
logging.level.com.yipin.liuwar.mapper=DEBUG
logging.level.com.yipin.liuwanr.mapper=DEBUG
spring.elasticsearch.rest.uris=http://es-cn-v641e944a0006xtwy.elasticsearch.aliyuncs.com:9200
spring.elasticsearch.rest.username=elastic
spring.elasticsearch.rest.password=1qaz@WSX
# maxFileSize \u5355\u4E2A\u6570\u636E\u5927\u5C0F
spring.servlet.multipart.maxFileSize = 1024MB
# maxRequestSize \u662F\u603B\u6570\u636E\u5927\u5C0F
spring.servlet.multipart.maxRequestSize=10240MB
pagehelper.reasonable=false

@ -1,52 +0,0 @@
server.port=9090
server.servlet.context-path=/evaluation
#\u6B63\u5F0F\u6570\u636E\u5E93\u8FDE\u63A5
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=HeHai.3
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jackson.default-property-inclusion=non_null
# \u8FD9\u4E2A\u914D\u7F6E\u4F1A\u5C06\u6267\u884C\u7684sql\u6253\u5370\u51FA\u6765\uFF0C\u5728\u5F00\u53D1\u6216\u6D4B\u8BD5\u7684\u65F6\u5019\u53EF\u4EE5\u7528
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus.mapper-locations=classpath:/mapper/**/*.xml
mybatis-plus.global-config.db-config.id-type=auto
mybatis-plus.global-config.db-config.logic-delete-field=is_del
mybatis-plus.global-config.db-config.logic-delete-value=0
mybatis-plus.global-config.db-config.logic-not-delete-value=1
tms.thread.core-size=20
tms.thread.max-size=200
tms.thread.keep-alive-time=10
#redis\u914D\u7F6E
spring.redis.database=0
spring.redis.host=127.0.0.1
spring.redis.password=HeHai.6
spring.redis.port=6379
spring.redis.timeout=3000
spring.redis.jedis.pool.max-idle=500
spring.redis.jedis.pool.min-idle=50
spring.redis.jedis.pool.max-active=2000
spring.redis.jedis.pool.max-wait=1000
#\u65E5\u5FD7\u7EA7\u522B
logging.level.jdbc=OFF
logging.level.jdbc.sqltiming=DEBUG
logging.level.jdbc.resultsettable=DEBUG
logging.level.com.yipin.liuwar.mapper=DEBUG
logging.level.com.yipin.liuwanr.mapper=DEBUG
spring.elasticsearch.rest.uris=http://es-cn-v641e944a0006xtwy.elasticsearch.aliyuncs.com:9200
spring.elasticsearch.rest.username=elastic
spring.elasticsearch.rest.password=1qaz@WSX
# maxFileSize \u5355\u4E2A\u6570\u636E\u5927\u5C0F
spring.servlet.multipart.maxFileSize = 1024MB
# maxRequestSize \u662F\u603B\u6570\u636E\u5927\u5C0F
spring.servlet.multipart.maxRequestSize=10240MB
pagehelper.reasonable=false

@ -2,7 +2,7 @@ server.port=9090
server.servlet.context-path=/evaluation server.servlet.context-path=/evaluation
#\u6B63\u5F0F\u6570\u636E\u5E93\u8FDE\u63A5 #\u6B63\u5F0F\u6570\u636E\u5E93\u8FDE\u63A5
spring.datasource.url=jdbc:mysql://rm-wz90d92p0pf083nxzno.mysql.rds.aliyuncs.com:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai spring.datasource.url=jdbc:mysql://192.168.0.245:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=HuoRan@2021 spring.datasource.password=HuoRan@2021
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

@ -1,2 +1,2 @@
#\u9009\u62E9\u6307\u5B9A\u73AF\u5883,\u76EE\u524D\u53EA\u6709\u6D4B\u8BD5\u548C\u6B63\u5F0F\u73AF\u5883 #\u9009\u62E9\u6307\u5B9A\u73AF\u5883,\u76EE\u524D\u53EA\u6709\u6D4B\u8BD5\u548C\u6B63\u5F0F\u73AF\u5883
spring.profiles.active=chaohu spring.profiles.active=test

@ -0,0 +1,42 @@
spring:
jackson:
default-property-inclusion: non_null
datasource:
# url: jdbc:mysql://www.liuwanr.cn:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
# username: super
# password: huoran888
url: jdbc:mysql://rm-wz9y13wf7u8q8610fwo.mysql.rds.aliyuncs.com:3306/huoran?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
username: super
password: huoran888
# url: jdbc:mysql://localhost:3306/msdw_tms?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
# username: root
# password: root
driver-class-name: com.mysql.cj.jdbc.Driver
# redis:
# host: www.liuwanr.cn
# port: 6379
# password: huoran
redis:
host: 127.0.0.1
port: 6379
password:
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
mapper-locations: classpath:/mapper/**/*.xml
global-config:
db-config:
id-type: auto
logic-delete-field: is_del
logic-delete-value: 0
logic-not-delete-value: 1
server:
port: 9090
servlet:
context-path: /evaluation
tms:
thread:
core-size: 20
max-size: 200
keep-alive-time: 10

@ -58,6 +58,8 @@
INNER JOIN tms_project_record r ON r.recordId = c.recordId INNER JOIN tms_project_record r ON r.recordId = c.recordId
INNER JOIN tms_experimental_report re ON re.eventId = r.recordId INNER JOIN tms_experimental_report re ON re.eventId = r.recordId
WHERE c.userId = #{userId} WHERE c.userId = #{userId}
-- 教师端逻辑删除,学生端不做判断
-- and r.isdel = 0
and projectPermissions = #{projectPermissions} and projectPermissions = #{projectPermissions}
<if test="systemId!=null and systemId!=''"> <if test="systemId!=null and systemId!=''">
and t.systemId = #{systemId} and t.systemId = #{systemId}
@ -85,7 +87,9 @@
LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId LEFT JOIN tms_experimental_teaching tet ON tet.project_id = tpr.projectId
LEFT JOIN tms_experimental_report ter ON ter.projectId = tet.id LEFT JOIN tms_experimental_report ter ON ter.projectId = tet.id
WHERE tpr.userId = #{pro.userid} WHERE tpr.userId = #{pro.userid}
<if test="systemId!=null and systemId!=''">and systemId = #{systemId}</if> <if test="systemId!=null and systemId!=''">and systemId = #{systemId}</if>
AND tpr.isdel >= #{pro.isdel} AND tpr.isdel >= #{pro.isdel}
AND tp.projectPermissions !=0 AND tp.projectPermissions !=0
AND AND
@ -188,6 +192,7 @@
LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId
LEFT JOIN tms_experimental_report re ON re.eventId = tpr.recordId LEFT JOIN tms_experimental_report re ON re.eventId = tpr.recordId
WHERE tpr.userId = #{userid} WHERE tpr.userId = #{userid}
-- 注释掉报错,>=表示是否删除都导出
AND tpr.isdel >= #{isdel} AND tpr.isdel >= #{isdel}
AND tp.projectPermissions = 0 AND tp.projectPermissions = 0
</select> </select>
@ -256,7 +261,7 @@
AND tp.projectPermissions != 0 AND tp.projectPermissions != 0
AND ter.eventId = tpr.recordId AND ter.eventId = tpr.recordId
ORDER BY ORDER BY
tpr.recordId DESC; tpr.recordId DESC
</select> </select>
</mapper> </mapper>

@ -93,7 +93,7 @@ WHERE
<insert id="saveStudent" useGeneratedKeys="true" keyProperty="studentId"> <insert id="saveStudent" useGeneratedKeys="true" keyProperty="studentId">
INSERT INTO student ( schoolId, userId, workNumber, roleId, isdel,platformId ) INSERT INTO student ( schoolId, userId, workNumber, roleId, isdel,platformId )
VALUES VALUES
( 1006,#{userId},#{workNumber},#{roleId},#{isdel},#{platformId} ( #{schoolId},#{userId},#{workNumber},#{roleId},#{isdel},#{platformId}
) )
</insert> </insert>
<insert id="addStudentInfo"> <insert id="addStudentInfo">

@ -165,7 +165,7 @@
</select> </select>
<select id="queryDepartmentNameOrganization" resultType="java.lang.Integer"> <select id="queryDepartmentNameOrganization" resultType="java.lang.Integer">
select staffProfessionalArchitectureId from staff_professional_architecture where schoolId = #{schoolId} and staffProfessionalArchitectureName = #{staffProfessionalArchitectureName} select staffProfessionalArchitectureId from staff_professional_architecture where schoolId = #{schoolId} and staffProfessionalArchitectureName = #{staffProfessionalArchitectureName} and isdel = 0
</select> </select>
<select id="judgmentGrade" resultType="com.msdw.tms.entity.vo.StaffVo"> <select id="judgmentGrade" resultType="com.msdw.tms.entity.vo.StaffVo">
SELECT SELECT

Loading…
Cancel
Save