Compare commits

...

5 Commits

  1. 6
      src/main/java/com/msdw/tms/service/impl/ExperimentalReportServiceImpl.java
  2. 3
      src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java
  3. 31
      src/main/java/com/msdw/tms/util/MD5.java
  4. 2
      src/main/resources/application-prod.properties
  5. 6
      src/main/resources/application-test.properties
  6. 2
      src/main/resources/application.properties
  7. 6
      src/main/resources/mapper/tms/ProjectRecordDao.xml
  8. 2
      src/main/resources/mapper/tms/SystemSetting.xml

@ -41,12 +41,12 @@ public class ExperimentalReportServiceImpl extends ServiceImpl<ExperimentalRepor
//python实验 //python实验
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("report", result); map.put("report", result);
if (systemId == 1 | systemId == 4 | systemId == 5) { // if (systemId == 1 | systemId == 4 | systemId == 5) {
List<AchievementManagementVO> data = achievementManagementDao.queryPythonTest(recordId); List<AchievementManagementVO> data = achievementManagementDao.queryPythonTest(recordId);
map.put("data", data); map.put("data", data);
return R.ok().put("data", map); return R.ok().put("data", map);
} // }
return R.ok().put("data", map); // return R.ok().put("data", map);
} }
//虚拟实验 //虚拟实验

@ -21,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;
@ -749,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);
}
}
}

@ -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

@ -24,9 +24,9 @@ tms.thread.keep-alive-time=10
#redis\u914D\u7F6E #redis\u914D\u7F6E
spring.redis.database=0 spring.redis.database=0
spring.redis.host=www.liuwanr.cn spring.redis.host=127.0.0.1
spring.redis.password=huoran spring.redis.password=huoran#2021
spring.redis.port=6379 spring.redis.port=6710
spring.redis.timeout=3000 spring.redis.timeout=3000
spring.redis.jedis.pool.max-idle=500 spring.redis.jedis.pool.max-idle=500
spring.redis.jedis.pool.min-idle=50 spring.redis.jedis.pool.min-idle=50

@ -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=prod spring.profiles.active=test

@ -64,7 +64,7 @@
<if test="systemId!=null and systemId!=''"> <if test="systemId!=null and systemId!=''">
and t.systemId = #{systemId} and t.systemId = #{systemId}
</if> </if>
GROUP BY c.recordId desc GROUP BY c.recordId
</select> </select>
<!-- 考核记录 --> <!-- 考核记录 -->
@ -235,7 +235,7 @@
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 projectPermissions = 0 AND projectPermissions = 0
GROUP BY c.recordId DESC; GROUP BY c.recordId
</select> </select>
<!-- 考核记录 --> <!-- 考核记录 -->
@ -261,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>

@ -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