rong.liu 4 years ago
commit d42b783bf8
  1. 2
      src/main/java/com/msdw/tms/config/EmailUtils.java
  2. 6
      src/main/java/com/msdw/tms/controller/UserInfoController.java
  3. 2
      src/main/java/com/msdw/tms/dao/UserInfoDao.java
  4. 5
      src/main/java/com/msdw/tms/entity/vo/ProjectRecordVo.java
  5. 1
      src/main/java/com/msdw/tms/service/UserInfoService.java
  6. 8
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  7. 5
      src/main/java/com/msdw/tms/service/impl/UserInfoServiceImpl.java
  8. BIN
      src/main/resources/excel-template/教学实验报告导出模板.xlsx
  9. BIN
      src/main/resources/excel-template/练习记录模板.xlsx
  10. BIN
      src/main/resources/excel-template/考核记录模板.xlsx
  11. BIN
      src/main/resources/excel-template/虚拟仿真实验报告导出模板.xlsx
  12. 1
      src/main/resources/mapper/tms/ProjectRecordDao.xml
  13. 4
      src/main/resources/mapper/tms/UserInfoDao.xml

@ -30,6 +30,8 @@ public class EmailUtils {
try { try {
HtmlEmail email = new HtmlEmail(); HtmlEmail email = new HtmlEmail();
email.setHostName(SERVER_ADDRESS); email.setHostName(SERVER_ADDRESS);
email.setSSLOnConnect(true); //使用ssl加密true
email.setSslSmtpPort("465"); //使用465端口
email.setCharset("UTF-8"); email.setCharset("UTF-8");
email.addTo(emailaddress); email.addTo(emailaddress);

@ -182,6 +182,12 @@ public class UserInfoController implements UserInfoControllerApi {
UserInfoEntity userInfo = vo.getUserInfoEntity(); UserInfoEntity userInfo = vo.getUserInfoEntity();
Integer userId = userInfo.getUserId(); Integer userId = userInfo.getUserId();
String password = userInfo.getPassword(); String password = userInfo.getPassword();
//验证账号是否存在
int num = userInfoService.queryAccountExist(userInfo.getAccount());
if (num >= 1){
return R.error(500,"更新失败,账号不能重复");
}
String userPassword = userInfoService.queryPasword(userId); String userPassword = userInfoService.queryPasword(userId);
if (userPassword.equals(password)==true){ if (userPassword.equals(password)==true){
return R.error(400,"false,the password is the same!!!"); return R.error(400,"false,the password is the same!!!");

@ -66,4 +66,6 @@ public interface UserInfoDao extends BaseMapper<UserInfoEntity> {
List<String> queryStudentName(Integer userId); List<String> queryStudentName(Integer userId);
Integer getUserId(String token); Integer getUserId(String token);
Integer queryAccountExist(String account);
} }

@ -98,7 +98,10 @@ public class ProjectRecordVo extends ProjectRecordEntity implements Serializable
* 实验班级名 * 实验班级名
*/ */
private String experimentalClassName; private String experimentalClassName;
/**
* 实验名称
*/
private String experimentalName;
/** /**
* 封装多个项目id * 封装多个项目id
*/ */

@ -50,4 +50,5 @@ public interface UserInfoService extends IService<UserInfoEntity> {
R getUserId(String token); R getUserId(String token);
Integer queryAccountExist(String account);
} }

@ -178,13 +178,13 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
//2.加载模板流数据 //2.加载模板流数据
// org.springframework.core.io.Resource resource = new ClassPathResource("excel-template/虚拟仿真实验报告导出模板.xlsx"); // org.springframework.core.io.Resource resource = new ClassPathResource("excel-template/虚拟仿真实验报告导出模板.xlsx");
// FileInputStream fis = new FileInputStream(resource.getFile()); // FileInputStream fis = new FileInputStream(resource.getFile());
ClassPathResource resource = new ClassPathResource("excel-template/虚拟仿真实验报告导出模板.xlsx"); ClassPathResource resource = new ClassPathResource("excel-template/练习记录模板.xlsx");
InputStream inputStream = resource.getInputStream(); InputStream inputStream = resource.getInputStream();
//3、通过工具类下载文件 //3、通过工具类下载文件
new ExcelExportUtil(ProjectRecordImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). new ExcelExportUtil(ProjectRecordImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX).
export(response, inputStream, importRequests, "虚拟仿真实验报告.xlsx"); export(response, inputStream, importRequests, "练习记录.xlsx");
// new ExcelExportUtil(ProjectRecordImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). // new ExcelExportUtil(ProjectRecordImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX).
// export(response, fis, importRequests, "实验报告导出.xlsx"); // export(response, fis, importRequests, "实验报告导出.xlsx");
} }
@ -206,13 +206,13 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
}).collect(Collectors.toList()); }).collect(Collectors.toList());
//2.加载模板流数据 //2.加载模板流数据
ClassPathResource resource = new ClassPathResource("excel-template/教学实验报告导出模板.xlsx"); ClassPathResource resource = new ClassPathResource("excel-template/考核记录模板.xlsx");
InputStream inputStream = resource.getInputStream(); InputStream inputStream = resource.getInputStream();
//3、通过工具类下载文件 //3、通过工具类下载文件
new ExcelExportUtil(ExperimentProjectRecordImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). new ExcelExportUtil(ExperimentProjectRecordImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX).
export(response, inputStream, importRequests, "教学实验报告.xlsx"); export(response, inputStream, importRequests, "考核记录.xlsx");
} }
@Override @Override

@ -227,4 +227,9 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoDao, UserInfoEntity
Integer userId = userInfoDao.getUserId(token); Integer userId = userInfoDao.getUserId(token);
return R.ok().put("userId", userId); return R.ok().put("userId", userId);
} }
@Override
public Integer queryAccountExist(String account) {
return userInfoDao.queryAccountExist(account);
}
} }

@ -80,6 +80,7 @@
endTime, endTime,
recordState, recordState,
tet.experimental_class_name as experimentalClassName, tet.experimental_class_name as experimentalClassName,
tet.experimental_name as experimentalName,
systemId systemId
FROM tms_project_record tpr FROM tms_project_record tpr
LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId

@ -291,4 +291,8 @@
SELECT userId FROM hr_user_info where token = #{token} and isdel = 0 SELECT userId FROM hr_user_info where token = #{token} and isdel = 0
</select> </select>
<select id="queryAccountExist" resultType="java.lang.Integer">
SELECT count(*) FROM hr_user_info where account = #{account} and isdel = 0
</select>
</mapper> </mapper>
Loading…
Cancel
Save