后台bug修改
parent
c4df190033
commit
061afaa89a
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.ruoyi.common.core.utils.mail;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
import javax.activation.DataHandler;
|
||||||
|
import javax.activation.FileDataSource;
|
||||||
|
import javax.mail.Authenticator;
|
||||||
|
import javax.mail.BodyPart;
|
||||||
|
import javax.mail.Message;
|
||||||
|
import javax.mail.Multipart;
|
||||||
|
import javax.mail.PasswordAuthentication;
|
||||||
|
import javax.mail.Session;
|
||||||
|
import javax.mail.Transport;
|
||||||
|
import javax.mail.internet.AddressException;
|
||||||
|
import javax.mail.internet.InternetAddress;
|
||||||
|
import javax.mail.internet.MimeBodyPart;
|
||||||
|
import javax.mail.internet.MimeMessage;
|
||||||
|
import javax.mail.internet.MimeMultipart;
|
||||||
|
import javax.mail.internet.MimeUtility;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
public class ALiYunMailUtil {
|
||||||
|
|
||||||
|
private static final String SEND_ADDRESS = "mail@gbgobig.com";
|
||||||
|
private static final String SEND_PASSWORD = "ganbeigobig@2024";
|
||||||
|
private static final String HOST = "smtp.qiye.aliyun.com";
|
||||||
|
private static final String PORT = "25"; // 或80
|
||||||
|
private static final String SUBJECT = "Email verification code";
|
||||||
|
private static final String FILE_PATH = null;
|
||||||
|
private static final String CC = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param content 邮件内容
|
||||||
|
* @param internetAddress 收件人地址
|
||||||
|
* @throws Exception
|
||||||
|
* @throws AddressException
|
||||||
|
*/
|
||||||
|
public static void sendMail(String content, String internetAddress) throws AddressException, Exception {
|
||||||
|
// 设置SSL连接、邮件环境
|
||||||
|
// Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
|
||||||
|
// final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
|
||||||
|
Properties props = System.getProperties();
|
||||||
|
props.setProperty("mail.smtp.host", HOST);
|
||||||
|
// props.setProperty("mail.smtp.socketFactory.class", SSL_FACTORY);
|
||||||
|
props.setProperty("mail.smtp.socketFactory.fallback", "false");
|
||||||
|
props.setProperty("mail.smtp.port", PORT); // 设置端口
|
||||||
|
props.setProperty("mail.debug", "true"); // 启用调试
|
||||||
|
props.setProperty("mail.smtp.socketFactory.port", "465");
|
||||||
|
props.setProperty("mail.smtp.auth", "true");
|
||||||
|
|
||||||
|
// 建立邮件会话
|
||||||
|
Session session = Session.getDefaultInstance(props, new Authenticator() { // 身份认证
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(SEND_ADDRESS, SEND_PASSWORD); // 发件人账号、密码
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 建立邮件对象
|
||||||
|
MimeMessage message = new MimeMessage(session);
|
||||||
|
|
||||||
|
// 设置邮件的发件人、收件人、主题
|
||||||
|
message.setFrom(new InternetAddress(SEND_ADDRESS)); // 发件人账号
|
||||||
|
message.setRecipients(Message.RecipientType.TO, internetAddress); // 收件人账号
|
||||||
|
|
||||||
|
// 标题
|
||||||
|
message.setSubject(SUBJECT); // 邮件标题
|
||||||
|
|
||||||
|
// 内容
|
||||||
|
Multipart multipart = new MimeMultipart();
|
||||||
|
BodyPart contentPart = new MimeBodyPart();
|
||||||
|
// 将内容包装在HTML样式标签中,调整字体粗细
|
||||||
|
String styledContent = "<html><body><p style='font-weight: normal;'>"
|
||||||
|
+ content
|
||||||
|
+ "</p></body></html>";
|
||||||
|
contentPart.setContent(styledContent, "text/html;charset=utf-8"); // 邮件内容
|
||||||
|
multipart.addBodyPart(contentPart);
|
||||||
|
|
||||||
|
// 附件部分
|
||||||
|
if (StringUtils.isNotBlank(FILE_PATH)) {
|
||||||
|
BodyPart attachPart = new MimeBodyPart();
|
||||||
|
FileDataSource fileDataSource = new FileDataSource(FILE_PATH); // 附件地址 D:/题库上传模板v1.xlsx
|
||||||
|
attachPart.setDataHandler(new DataHandler(fileDataSource));
|
||||||
|
attachPart.setFileName(MimeUtility.encodeText(fileDataSource.getName()));
|
||||||
|
multipart.addBodyPart(attachPart);
|
||||||
|
}
|
||||||
|
|
||||||
|
message.setContent(multipart);
|
||||||
|
|
||||||
|
// 抄送地址
|
||||||
|
if (StringUtils.isNotBlank(CC)) {
|
||||||
|
InternetAddress[] internetAddressCC = new InternetAddress().parse(CC);
|
||||||
|
message.setRecipients(Message.RecipientType.CC, internetAddressCC);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送邮件
|
||||||
|
Transport.send(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -148,6 +148,19 @@
|
||||||
<groupId>org.thymeleaf</groupId>
|
<groupId>org.thymeleaf</groupId>
|
||||||
<artifactId>thymeleaf</artifactId>
|
<artifactId>thymeleaf</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- JavaMail API -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.mail</groupId>
|
||||||
|
<artifactId>javax.mail-api</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JavaMail implementation (e.g., for SMTP) -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sun.mail</groupId>
|
||||||
|
<artifactId>javax.mail</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ruoyi.app.controller;
|
package com.ruoyi.app.controller;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
|
||||||
|
|
@ -108,14 +108,14 @@ public class AppLoginController {
|
||||||
|
|
||||||
switch (register.getStatus()) {
|
switch (register.getStatus()) {
|
||||||
case 0:
|
case 0:
|
||||||
return R.fail(201, "请等待,您的账号正在审核中!");
|
return R.ok(null, "请等待,您的账号正在审核中!");
|
||||||
case 1:
|
case 1:
|
||||||
return R.fail(201, "您的账号已通过");
|
return R.ok(null, "您的账号已通过");
|
||||||
case 2:
|
case 2:
|
||||||
appRegisterService.updateAppRegisterByPhone(register);
|
appRegisterService.updateAppRegisterByPhone(register);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
AppRegister appRegister = setAppRegister(registerForm);
|
AppRegister appRegister = setAppRegister(registerForm);
|
||||||
appRegister.setInvitationCode(registerForm.getInvitationCode());
|
appRegister.setInvitationCode(registerForm.getInvitationCode());
|
||||||
int i = appRegisterService.insertAppRegister(appRegister);
|
int i = appRegisterService.insertAppRegister(appRegister);
|
||||||
|
|
@ -129,7 +129,25 @@ public class AppLoginController {
|
||||||
@ApiOperation(value = "登录", notes = "登录")
|
@ApiOperation(value = "登录", notes = "登录")
|
||||||
public R<?> login(@RequestBody LoginForm loginForm) {
|
public R<?> login(@RequestBody LoginForm loginForm) {
|
||||||
AppUser appUser = appUserService.selectAppUserByPhone(loginForm.getPhoneNumber());
|
AppUser appUser = appUserService.selectAppUserByPhone(loginForm.getPhoneNumber());
|
||||||
|
|
||||||
|
|
||||||
|
if (appUser == null) {
|
||||||
|
AppRegister register = appRegisterService.selectAppRegisterByphone(loginForm.getPhoneNumber());
|
||||||
|
|
||||||
|
if (register != null && register.getStatus() != null) {
|
||||||
|
|
||||||
|
switch (register.getStatus()) {
|
||||||
|
case 0:
|
||||||
|
return R.fail(201, "请等待,您的账号正在审核中!");
|
||||||
|
case 1:
|
||||||
|
return R.ok(null, "您的账号已通过");
|
||||||
|
case 2:
|
||||||
|
appRegisterService.updateAppRegisterByPhone(register);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
Assert.notNull(appUser, "手机号未注册");
|
Assert.notNull(appUser, "手机号未注册");
|
||||||
|
}
|
||||||
|
|
||||||
// Object cacheObject = redisService.getCacheObject(loginForm.getPhoneNumber());
|
// Object cacheObject = redisService.getCacheObject(loginForm.getPhoneNumber());
|
||||||
// if (cacheObject != null) {
|
// if (cacheObject != null) {
|
||||||
|
|
@ -213,13 +231,10 @@ public class AppLoginController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@DeleteMapping("logout")
|
@DeleteMapping("logout")
|
||||||
public R<?> logout(HttpServletRequest request)
|
public R<?> logout(HttpServletRequest request) {
|
||||||
{
|
|
||||||
String token = SecurityUtils.getToken(request);
|
String token = SecurityUtils.getToken(request);
|
||||||
if (StringUtils.isNotEmpty(token))
|
if (StringUtils.isNotEmpty(token)) {
|
||||||
{
|
|
||||||
// 删除用户缓存记录
|
// 删除用户缓存记录
|
||||||
AuthUtil.logoutByToken(token);
|
AuthUtil.logoutByToken(token);
|
||||||
}
|
}
|
||||||
|
|
@ -227,8 +242,8 @@ public class AppLoginController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(path = "/activation/{token}/{email}",method = RequestMethod.GET)
|
@RequestMapping(path = "/activation/{token}/{email}", method = RequestMethod.GET)
|
||||||
public String activation(@PathVariable String token , @PathVariable String email) {
|
public String activation(@PathVariable String token, @PathVariable String email) {
|
||||||
Map<String, Object> cacheMap = redisService.getCacheMap(token);
|
Map<String, Object> cacheMap = redisService.getCacheMap(token);
|
||||||
if (email.equals(cacheMap.get("email"))) {
|
if (email.equals(cacheMap.get("email"))) {
|
||||||
AppRegister appRegister = (AppRegister) cacheMap.get("email");
|
AppRegister appRegister = (AppRegister) cacheMap.get("email");
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,22 @@
|
||||||
package com.ruoyi.app.controller;
|
package com.ruoyi.app.controller;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.ruoyi.app.domain.vo.AppRegisterVo;
|
import com.ruoyi.app.domain.vo.AppRegisterVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.apache.http.client.HttpClient;
|
||||||
|
import org.apache.http.client.methods.HttpGet;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.ruoyi.common.log.annotation.Log;
|
import com.ruoyi.common.log.annotation.Log;
|
||||||
|
|
@ -28,8 +39,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/register")
|
@RequestMapping("/register")
|
||||||
@ApiIgnore
|
@ApiIgnore
|
||||||
public class AppRegisterController extends BaseController
|
public class AppRegisterController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAppRegisterService appRegisterService;
|
private IAppRegisterService appRegisterService;
|
||||||
|
|
||||||
|
|
@ -38,22 +48,21 @@ public class AppRegisterController extends BaseController
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("app:register:list")
|
@RequiresPermissions("app:register:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(AppRegister appRegister)
|
public TableDataInfo list(AppRegister appRegister) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
List<AppRegisterVo> list = appRegisterService.selectAppRegisterList(appRegister);
|
List<AppRegisterVo> list = appRegisterService.selectAppRegisterList(appRegister);
|
||||||
return getDataTable(list);
|
TableDataInfo dataTable = getDataTable(list);
|
||||||
|
dataTable.setTotal(appRegisterService.selectAppRegisterCount(appRegister));
|
||||||
|
return dataTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取注册审核详细信息
|
* 获取注册审核详细信息
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("app:register:query")
|
@RequiresPermissions("app:register:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
{
|
|
||||||
return success(appRegisterService.selectAppRegisterById(id));
|
return success(appRegisterService.selectAppRegisterById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,8 +72,7 @@ public class AppRegisterController extends BaseController
|
||||||
@RequiresPermissions("app:register:add")
|
@RequiresPermissions("app:register:add")
|
||||||
@Log(title = "注册审核", businessType = BusinessType.INSERT)
|
@Log(title = "注册审核", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody AppRegister appRegister)
|
public AjaxResult add(@RequestBody AppRegister appRegister) {
|
||||||
{
|
|
||||||
return toAjax(appRegisterService.insertAppRegister(appRegister));
|
return toAjax(appRegisterService.insertAppRegister(appRegister));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,8 +82,7 @@ public class AppRegisterController extends BaseController
|
||||||
@RequiresPermissions("app:register:edit")
|
@RequiresPermissions("app:register:edit")
|
||||||
@Log(title = "注册审核", businessType = BusinessType.UPDATE)
|
@Log(title = "注册审核", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody AppRegister appRegister)
|
public AjaxResult edit(@RequestBody AppRegister appRegister) {
|
||||||
{
|
|
||||||
return toAjax(appRegisterService.updateAppRegister(appRegister));
|
return toAjax(appRegisterService.updateAppRegister(appRegister));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,21 +92,36 @@ public class AppRegisterController extends BaseController
|
||||||
@RequiresPermissions("app:register:remove")
|
@RequiresPermissions("app:register:remove")
|
||||||
@Log(title = "注册审核", businessType = BusinessType.DELETE)
|
@Log(title = "注册审核", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
{
|
|
||||||
return toAjax(appRegisterService.deleteAppRegisterByIds(ids));
|
return toAjax(appRegisterService.deleteAppRegisterByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/pass")
|
@GetMapping("/pass")
|
||||||
public AjaxResult pass(@RequestParam("id") Long id){
|
public AjaxResult pass(@RequestParam("id") Long id) {
|
||||||
return toAjax(appRegisterService.passAppRegister(id));
|
return toAjax(appRegisterService.passAppRegister(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/reject")
|
@PostMapping("/reject")
|
||||||
public AjaxResult reject(@RequestBody AppRegister appRegister)
|
public AjaxResult reject(@RequestBody AppRegister appRegister) {
|
||||||
{
|
|
||||||
return toAjax(appRegisterService.rejectAppRegister(appRegister));
|
return toAjax(appRegisterService.rejectAppRegister(appRegister));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
HttpClient httpClient = HttpClients.createDefault();
|
||||||
|
String pushId = "7e63c670480d8f2060f8d21800c3ae17";
|
||||||
|
String url = "https://tcb-am7ffkwasxkewhf-3cpy096b83a1.service.tcloudbase.com/urlPush/pushId?pushId=" + pushId + "&title=审核失败&content=审核被驳回";
|
||||||
|
|
||||||
|
try {
|
||||||
|
HttpGet request = new HttpGet(url);
|
||||||
|
HttpResponse response = httpClient.execute(request);
|
||||||
|
|
||||||
|
// Get the response entity as a String
|
||||||
|
String jsonResponse = EntityUtils.toString(response.getEntity());
|
||||||
|
System.out.println(jsonResponse);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import java.util.List;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.system.api.domain.SysUser;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -17,6 +19,7 @@ import com.ruoyi.common.core.web.controller.BaseController;
|
||||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学校配置Controller
|
* 学校配置Controller
|
||||||
|
|
@ -55,15 +58,14 @@ public class AppSchoolController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 导出学校配置列表
|
* 导出学校配置列表
|
||||||
*/
|
*/
|
||||||
// @RequiresPermissions("app:school:export")
|
@Log(title = "学校配置", businessType = BusinessType.EXPORT)
|
||||||
// @Log(title = "学校配置", businessType = BusinessType.EXPORT)
|
@PostMapping("/export")
|
||||||
// @PostMapping("/export")
|
public void export(HttpServletResponse response, AppSchool appSchool)
|
||||||
// public void export(HttpServletResponse response, AppSchool appSchool)
|
{
|
||||||
// {
|
List<AppSchool> list = appSchoolService.selectAppSchoolList(appSchool);
|
||||||
// List<AppSchool> list = appSchoolService.selectAppSchoolList(appSchool);
|
ExcelUtil<AppSchool> util = new ExcelUtil<AppSchool>(AppSchool.class);
|
||||||
// ExcelUtil<AppSchool> util = new ExcelUtil<AppSchool>(AppSchool.class);
|
util.exportExcel(response, list, "学校配置数据");
|
||||||
// util.exportExcel(response, list, "学校配置数据");
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取学校配置详细信息
|
* 获取学校配置详细信息
|
||||||
|
|
@ -111,4 +113,21 @@ public class AppSchoolController extends BaseController
|
||||||
{
|
{
|
||||||
return toAjax(appSchoolService.deleteAppSchoolByIds(ids));
|
return toAjax(appSchoolService.deleteAppSchoolByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/importTemplate")
|
||||||
|
public void importTemplate(HttpServletResponse response) throws IOException
|
||||||
|
{
|
||||||
|
ExcelUtil<AppSchool> util = new ExcelUtil<AppSchool>(AppSchool.class);
|
||||||
|
util.importTemplateExcel(response, "学校数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/importData")
|
||||||
|
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
|
||||||
|
{
|
||||||
|
ExcelUtil<AppSchool> util = new ExcelUtil<AppSchool>(AppSchool.class);
|
||||||
|
List<AppSchool> userList = util.importExcel(file.getInputStream());
|
||||||
|
String message = appSchoolService.importSchool(userList, updateSupport);
|
||||||
|
return success(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,10 +116,15 @@ public class AppTopicController extends BaseController
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("app:topic:remove")
|
@RequiresPermissions("app:topic:remove")
|
||||||
@Log(title = "话题信息", businessType = BusinessType.DELETE)
|
@Log(title = "话题信息", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{id}")
|
||||||
@ApiOperation(value = "删除话题信息", notes = "删除话题信息", httpMethod = "DELETE")
|
@ApiOperation(value = "删除话题信息", notes = "删除话题信息", httpMethod = "DELETE")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long id)
|
||||||
{
|
{
|
||||||
return toAjax(appTopicService.deleteAppTopicByIds(ids));
|
|
||||||
|
if (appTopicService.hasChildById(id)) {
|
||||||
|
return warn("存在子集数据,不允许删除");
|
||||||
|
}
|
||||||
|
|
||||||
|
return toAjax(appTopicService.deleteAppTopicByIds(id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -219,6 +219,7 @@ public class PayController extends BaseController
|
||||||
order.setPaySoure(3);
|
order.setPaySoure(3);
|
||||||
order.setCreateTime(new Date());
|
order.setCreateTime(new Date());
|
||||||
order.setLevel(1);
|
order.setLevel(1);
|
||||||
|
order.setOutTradeNo( KeyUtil.generateUniqueKey());
|
||||||
appOrderMapper.insertAppOrder(order);
|
appOrderMapper.insertAppOrder(order);
|
||||||
|
|
||||||
//修改用户信息
|
//修改用户信息
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,60 @@
|
||||||
package com.ruoyi.app.domain.vo;
|
package com.ruoyi.app.domain.vo;
|
||||||
|
|
||||||
|
import com.ruoyi.app.domain.AppRegister;
|
||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class AppRegisterVo {
|
public class AppRegisterVo extends AppRegister {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 审核id */
|
/**
|
||||||
|
* 审核id
|
||||||
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 手机号 */
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
/** 用户名 */
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
/** 学校证明 */
|
/**
|
||||||
|
* 学校证明
|
||||||
|
*/
|
||||||
private String prove;
|
private String prove;
|
||||||
|
|
||||||
/** 头像 */
|
/**
|
||||||
|
* 头像
|
||||||
|
*/
|
||||||
private String avatarUrl;
|
private String avatarUrl;
|
||||||
|
|
||||||
/** 性别:0-男,1-女 */
|
/**
|
||||||
|
* 性别:0-男,1-女
|
||||||
|
*/
|
||||||
private Integer sex;
|
private Integer sex;
|
||||||
|
|
||||||
/** 地址 */
|
/**
|
||||||
|
* 地址
|
||||||
|
*/
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
/** 学校id */
|
/**
|
||||||
|
* 学校id
|
||||||
|
*/
|
||||||
private Long schoolId;
|
private Long schoolId;
|
||||||
private String schoolName;
|
private String schoolName;
|
||||||
|
|
||||||
/** 邮箱 */
|
/**
|
||||||
|
* 邮箱
|
||||||
|
*/
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,4 +64,7 @@ public interface AppRegisterMapper
|
||||||
String phoneNumber);
|
String phoneNumber);
|
||||||
|
|
||||||
int updateAppRegisterByPhone(AppRegister appRegister);
|
int updateAppRegisterByPhone(AppRegister appRegister);
|
||||||
|
|
||||||
|
long selectAppRegisterCount(AppRegister appRegister);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,4 +61,8 @@ public interface AppSchoolMapper
|
||||||
public int deleteAppSchoolByIds(Long[] ids);
|
public int deleteAppSchoolByIds(Long[] ids);
|
||||||
|
|
||||||
List<AppSchool> selectAppSchoolAllList(@Param("name") String name);
|
List<AppSchool> selectAppSchoolAllList(@Param("name") String name);
|
||||||
|
|
||||||
|
public AppSchool selectAppSchoolByName(String name);
|
||||||
|
|
||||||
|
public int updateAppSchoolByName(AppSchool appSchool);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,5 +59,7 @@ public interface AppTopicMapper
|
||||||
* @param ids 需要删除的数据主键集合
|
* @param ids 需要删除的数据主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteAppTopicByIds(Long[] ids);
|
public int deleteAppTopicByIds(Long id);
|
||||||
|
|
||||||
|
public int hasChildById(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,4 +68,6 @@ public interface IAppRegisterService
|
||||||
|
|
||||||
|
|
||||||
AppRegister selectAppRegisterByphone(String phoneNumber);
|
AppRegister selectAppRegisterByphone(String phoneNumber);
|
||||||
|
|
||||||
|
long selectAppRegisterCount(AppRegister appRegister);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.app.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.app.domain.AppSchool;
|
import com.ruoyi.app.domain.AppSchool;
|
||||||
|
import com.ruoyi.system.api.domain.SysUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学校配置Service接口
|
* 学校配置Service接口
|
||||||
|
|
@ -60,4 +61,6 @@ public interface IAppSchoolService
|
||||||
public int deleteAppSchoolById(Long id);
|
public int deleteAppSchoolById(Long id);
|
||||||
|
|
||||||
List<AppSchool> selectAppSchoolAllList(String name);
|
List<AppSchool> selectAppSchoolAllList(String name);
|
||||||
|
|
||||||
|
public String importSchool(List<AppSchool> userList, boolean updateSupport);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ public interface IAppTopicService
|
||||||
* @param ids 需要删除的话题信息主键集合
|
* @param ids 需要删除的话题信息主键集合
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteAppTopicByIds(Long[] ids);
|
public int deleteAppTopicByIds(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除话题信息信息
|
* 删除话题信息信息
|
||||||
|
|
@ -60,4 +60,6 @@ public interface IAppTopicService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteAppTopicById(Long id);
|
public int deleteAppTopicById(Long id);
|
||||||
|
|
||||||
|
boolean hasChildById(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
import com.ruoyi.app.domain.AppSchool;
|
import com.ruoyi.app.domain.AppSchool;
|
||||||
import com.ruoyi.app.domain.AppUser;
|
import com.ruoyi.app.domain.AppUser;
|
||||||
import com.ruoyi.app.domain.vo.AppRegisterVo;
|
import com.ruoyi.app.domain.vo.AppRegisterVo;
|
||||||
|
|
@ -12,8 +13,14 @@ import com.ruoyi.app.mapper.AppUserMapper;
|
||||||
import com.ruoyi.common.core.utils.DateUtils;
|
import com.ruoyi.common.core.utils.DateUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.common.core.utils.bean.BeanUtils;
|
import com.ruoyi.common.core.utils.bean.BeanUtils;
|
||||||
|
import com.ruoyi.common.core.utils.mail.ALiYunMailUtil;
|
||||||
import com.ruoyi.common.core.utils.mail.MailUtil;
|
import com.ruoyi.common.core.utils.mail.MailUtil;
|
||||||
import com.ruoyi.common.core.utils.uuid.IdUtils;
|
import com.ruoyi.common.core.utils.uuid.IdUtils;
|
||||||
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.apache.http.client.HttpClient;
|
||||||
|
import org.apache.http.client.methods.HttpGet;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.app.mapper.AppRegisterMapper;
|
import com.ruoyi.app.mapper.AppRegisterMapper;
|
||||||
|
|
@ -29,8 +36,7 @@ import javax.mail.MessagingException;
|
||||||
* @date 2024-04-23
|
* @date 2024-04-23
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class AppRegisterServiceImpl implements IAppRegisterService
|
public class AppRegisterServiceImpl implements IAppRegisterService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AppRegisterMapper appRegisterMapper;
|
private AppRegisterMapper appRegisterMapper;
|
||||||
|
|
||||||
|
|
@ -47,8 +53,7 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
||||||
* @return 注册审核
|
* @return 注册审核
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AppRegister selectAppRegisterById(Long id)
|
public AppRegister selectAppRegisterById(Long id) {
|
||||||
{
|
|
||||||
return appRegisterMapper.selectAppRegisterById(id);
|
return appRegisterMapper.selectAppRegisterById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,10 +64,10 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
||||||
* @return 注册审核
|
* @return 注册审核
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<AppRegisterVo> selectAppRegisterList(AppRegister appRegister)
|
public List<AppRegisterVo> selectAppRegisterList(AppRegister appRegister) {
|
||||||
{
|
|
||||||
List<AppRegister> appRegisters = appRegisterMapper.selectAppRegisterList(appRegister);
|
List<AppRegister> appRegisters = appRegisterMapper.selectAppRegisterList(appRegister);
|
||||||
List<AppRegisterVo> collect = appRegisters.stream().map(register -> {
|
return appRegisters.stream().map(register -> {
|
||||||
AppRegisterVo appRegisterVo = new AppRegisterVo();
|
AppRegisterVo appRegisterVo = new AppRegisterVo();
|
||||||
BeanUtils.copyBeanProp(appRegisterVo, register);
|
BeanUtils.copyBeanProp(appRegisterVo, register);
|
||||||
AppSchool appSchool = appSchoolMapper.selectAppSchoolById(register.getSchoolId());
|
AppSchool appSchool = appSchoolMapper.selectAppSchoolById(register.getSchoolId());
|
||||||
|
|
@ -72,7 +77,6 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
||||||
return appRegisterVo;
|
return appRegisterVo;
|
||||||
|
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
return collect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -82,8 +86,7 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertAppRegister(AppRegister appRegister)
|
public int insertAppRegister(AppRegister appRegister) {
|
||||||
{
|
|
||||||
appRegister.setCreateTime(DateUtils.getNowDate());
|
appRegister.setCreateTime(DateUtils.getNowDate());
|
||||||
return appRegisterMapper.insertAppRegister(appRegister);
|
return appRegisterMapper.insertAppRegister(appRegister);
|
||||||
}
|
}
|
||||||
|
|
@ -95,8 +98,7 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateAppRegister(AppRegister appRegister)
|
public int updateAppRegister(AppRegister appRegister) {
|
||||||
{
|
|
||||||
appRegister.setUpdateTime(DateUtils.getNowDate());
|
appRegister.setUpdateTime(DateUtils.getNowDate());
|
||||||
return appRegisterMapper.updateAppRegister(appRegister);
|
return appRegisterMapper.updateAppRegister(appRegister);
|
||||||
}
|
}
|
||||||
|
|
@ -114,8 +116,7 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteAppRegisterByIds(Long[] ids)
|
public int deleteAppRegisterByIds(Long[] ids) {
|
||||||
{
|
|
||||||
return appRegisterMapper.deleteAppRegisterByIds(ids);
|
return appRegisterMapper.deleteAppRegisterByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,8 +127,7 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteAppRegisterById(Long id)
|
public int deleteAppRegisterById(Long id) {
|
||||||
{
|
|
||||||
return appRegisterMapper.deleteAppRegisterById(id);
|
return appRegisterMapper.deleteAppRegisterById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -135,7 +135,7 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
||||||
public int passAppRegister(Long id) {
|
public int passAppRegister(Long id) {
|
||||||
AppRegister appRegister = appRegisterMapper.selectAppRegisterById(id);
|
AppRegister appRegister = appRegisterMapper.selectAppRegisterById(id);
|
||||||
Assert.isTrue(appRegister != null, "该申请不存在");
|
Assert.isTrue(appRegister != null, "该申请不存在");
|
||||||
Assert.isTrue( appRegister.getStatus()!= null && appRegister.getStatus() == 0, "该申请已审核");
|
Assert.isTrue(appRegister.getStatus() != null && appRegister.getStatus() == 0, "该申请已审核");
|
||||||
appRegister.setStatus(1);
|
appRegister.setStatus(1);
|
||||||
appRegister.setUpdateTime(DateUtils.getNowDate());
|
appRegister.setUpdateTime(DateUtils.getNowDate());
|
||||||
int i = appRegisterMapper.updateAppRegister(appRegister);
|
int i = appRegisterMapper.updateAppRegister(appRegister);
|
||||||
|
|
@ -144,23 +144,38 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
||||||
BeanUtils.copyProperties(appRegister, appUser);
|
BeanUtils.copyProperties(appRegister, appUser);
|
||||||
appUser.setCreateTime(DateUtils.getNowDate());
|
appUser.setCreateTime(DateUtils.getNowDate());
|
||||||
appUser.setUpdateTime(DateUtils.getNowDate());
|
appUser.setUpdateTime(DateUtils.getNowDate());
|
||||||
appUser.setPhone(appRegister.getPhone() != null ? appRegister.getPhone():null);
|
appUser.setPhone(appRegister.getPhone() != null ? appRegister.getPhone() : null);
|
||||||
appUser.setEmail(appRegister.getEmail() != null ? appRegister.getEmail():null);
|
appUser.setEmail(appRegister.getEmail() != null ? appRegister.getEmail() : null);
|
||||||
appUser.setSchool(appRegister.getSchoolId() != null ? appRegister.getSchoolId():null);
|
appUser.setSchool(appRegister.getSchoolId() != null ? appRegister.getSchoolId() : null);
|
||||||
appUser.setUsername(appRegister.getUsername() != null ? appRegister.getUsername():null);
|
appUser.setUsername(appRegister.getUsername() != null ? appRegister.getUsername() : null);
|
||||||
appUser.setAddress(appRegister.getAddress() != null ? appRegister.getAddress():null);
|
appUser.setAddress(appRegister.getAddress() != null ? appRegister.getAddress() : null);
|
||||||
appUser.setSex(Long.valueOf(appRegister.getSex() != null ? appRegister.getSex():null));
|
appUser.setSex(Long.valueOf(appRegister.getSex() != null ? appRegister.getSex() : null));
|
||||||
appUser.setAvatarUrl(appRegister.getAvatarUrl() != null ? appRegister.getAvatarUrl():null);
|
appUser.setAvatarUrl(appRegister.getAvatarUrl() != null ? appRegister.getAvatarUrl() : null);
|
||||||
appUser.setCompanyName(appRegister.getCompanyName() != null ? appRegister.getCompanyName():null);
|
appUser.setCompanyName(appRegister.getCompanyName() != null ? appRegister.getCompanyName() : null);
|
||||||
appUser.setEducation(appRegister.getEducation() != null ? appRegister.getEducation():null);
|
appUser.setEducation(appRegister.getEducation() != null ? appRegister.getEducation() : null);
|
||||||
appUser.setMajor(appRegister.getMajor() != null ? appRegister.getMajor():null);
|
appUser.setMajor(appRegister.getMajor() != null ? appRegister.getMajor() : null);
|
||||||
appUser.setPushId(appRegister.getPushId() != null ? appRegister.getPushId():null);
|
appUser.setPushId(appRegister.getPushId() != null ? appRegister.getPushId() : null);
|
||||||
appUser.setNickname(appRegister.getNickname() != null ? appRegister.getNickname():null);
|
appUser.setNickname(appRegister.getNickname() != null ? appRegister.getNickname() : null);
|
||||||
appUser.setProvinceId(appRegister.getProvinceId() != null ? appRegister.getProvinceId():null);
|
appUser.setProvinceId(appRegister.getProvinceId() != null ? appRegister.getProvinceId() : null);
|
||||||
appUser.setCityId(appRegister.getCityId() != null ? appRegister.getCityId():null);
|
appUser.setCityId(appRegister.getCityId() != null ? appRegister.getCityId() : null);
|
||||||
appUser.setTownId(appRegister.getTownId() != null ? appRegister.getTownId():null);
|
appUser.setTownId(appRegister.getTownId() != null ? appRegister.getTownId() : null);
|
||||||
appUserMapper.insertAppUser(appUser);
|
appUserMapper.insertAppUser(appUser);
|
||||||
|
HttpClient httpClient = HttpClients.createDefault();
|
||||||
|
String pushId = appRegister.getPushId() != null ? appRegister.getPushId() : null;
|
||||||
|
String url = "https://tcb-am7ffkwasxkewhf-3cpy096b83a1.service.tcloudbase.com/urlPush/pushId?pushId=" + pushId + "&title=审核完成&content=审核已通过!";
|
||||||
|
|
||||||
|
try {
|
||||||
|
HttpGet request = new HttpGet(url);
|
||||||
|
HttpResponse response = httpClient.execute(request);
|
||||||
|
|
||||||
|
// Get the response entity as a String
|
||||||
|
String jsonResponse = EntityUtils.toString(response.getEntity());
|
||||||
|
System.out.println(jsonResponse);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -175,7 +190,24 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
||||||
register.setRemark(appRegister.getRemark());
|
register.setRemark(appRegister.getRemark());
|
||||||
}
|
}
|
||||||
appRegister.setUpdateTime(DateUtils.getNowDate());
|
appRegister.setUpdateTime(DateUtils.getNowDate());
|
||||||
return appRegisterMapper.updateAppRegister(appRegister);
|
int i = appRegisterMapper.updateAppRegister(appRegister);
|
||||||
|
if (i > 0) {
|
||||||
|
HttpClient httpClient = HttpClients.createDefault();
|
||||||
|
String pushId = appRegister.getPushId() != null ? appRegister.getPushId() : null;
|
||||||
|
String url = "https://tcb-am7ffkwasxkewhf-3cpy096b83a1.service.tcloudbase.com/urlPush/pushId?pushId=" + pushId + "&title=审核失败&content=审核已被驳回!";
|
||||||
|
|
||||||
|
try {
|
||||||
|
HttpGet request = new HttpGet(url);
|
||||||
|
HttpResponse response = httpClient.execute(request);
|
||||||
|
|
||||||
|
// Get the response entity as a String
|
||||||
|
String jsonResponse = EntityUtils.toString(response.getEntity());
|
||||||
|
System.out.println(jsonResponse);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -184,18 +216,25 @@ public class AppRegisterServiceImpl implements IAppRegisterService
|
||||||
return appRegisterMapper.selectAppRegisterByphone(phoneNumber);
|
return appRegisterMapper.selectAppRegisterByphone(phoneNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long selectAppRegisterCount(AppRegister appRegister) {
|
||||||
|
return appRegisterMapper.selectAppRegisterCount(appRegister);
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
String token = "4e290542-53f3-4a33-96ff-9510dd050100";
|
String token = "4e290542-53f3-4a33-96ff-9510dd050100";
|
||||||
String email = "653809315@qq.com";
|
String email = "653809315@qq.com";
|
||||||
String EM = "<html><body><h2>欢迎来到我们的服务!!</h2>"
|
String EM = "<html><body><h2>欢迎来到我们的服务!!</h2>"
|
||||||
+ "<p>请点击下面的网址确认您的注册:</p>"
|
+ "<p>请点击下面的网址确认您的注册:</p>"
|
||||||
+ "<p>http://101.133.172.2:9204/app/activation/"+ token + "/" + email + "</p>"
|
+ "<p>http://127.0.0.1:9204/app/activation/" + token + "/" + email + "</p>"
|
||||||
+ "</body></html>";
|
+ "</body></html>";
|
||||||
try {
|
try {
|
||||||
MailUtil.send_mail( "653809315@qq.com",EM);
|
ALiYunMailUtil.sendMail(EM, email);
|
||||||
} catch (MessagingException e) {
|
} catch (MessagingException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,21 @@
|
||||||
package com.ruoyi.app.service.impl;
|
package com.ruoyi.app.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.exception.ServiceException;
|
||||||
import com.ruoyi.common.core.utils.DateUtils;
|
import com.ruoyi.common.core.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.utils.bean.BeanValidators;
|
||||||
import com.ruoyi.common.security.utils.SecurityUtils;
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.system.api.domain.SysUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.app.mapper.AppSchoolMapper;
|
import com.ruoyi.app.mapper.AppSchoolMapper;
|
||||||
import com.ruoyi.app.domain.AppSchool;
|
import com.ruoyi.app.domain.AppSchool;
|
||||||
import com.ruoyi.app.service.IAppSchoolService;
|
import com.ruoyi.app.service.IAppSchoolService;
|
||||||
|
|
||||||
|
import javax.validation.Validator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 学校配置Service业务层处理
|
* 学校配置Service业务层处理
|
||||||
*
|
*
|
||||||
|
|
@ -16,11 +23,14 @@ import com.ruoyi.app.service.IAppSchoolService;
|
||||||
* @date 2024-04-18
|
* @date 2024-04-18
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class AppSchoolServiceImpl implements IAppSchoolService
|
public class AppSchoolServiceImpl implements IAppSchoolService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AppSchoolMapper appSchoolMapper;
|
private AppSchoolMapper appSchoolMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected Validator validator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询学校配置
|
* 查询学校配置
|
||||||
*
|
*
|
||||||
|
|
@ -28,8 +38,7 @@ public class AppSchoolServiceImpl implements IAppSchoolService
|
||||||
* @return 学校配置
|
* @return 学校配置
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AppSchool selectAppSchoolById(Long id)
|
public AppSchool selectAppSchoolById(Long id) {
|
||||||
{
|
|
||||||
return appSchoolMapper.selectAppSchoolById(id);
|
return appSchoolMapper.selectAppSchoolById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -40,8 +49,7 @@ public class AppSchoolServiceImpl implements IAppSchoolService
|
||||||
* @return 学校配置
|
* @return 学校配置
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<AppSchool> selectAppSchoolList(AppSchool appSchool)
|
public List<AppSchool> selectAppSchoolList(AppSchool appSchool) {
|
||||||
{
|
|
||||||
return appSchoolMapper.selectAppSchoolList(appSchool);
|
return appSchoolMapper.selectAppSchoolList(appSchool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,8 +60,7 @@ public class AppSchoolServiceImpl implements IAppSchoolService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertAppSchool(AppSchool appSchool)
|
public int insertAppSchool(AppSchool appSchool) {
|
||||||
{
|
|
||||||
appSchool.setCreateTime(DateUtils.getNowDate());
|
appSchool.setCreateTime(DateUtils.getNowDate());
|
||||||
appSchool.setUpdateTime(DateUtils.getNowDate());
|
appSchool.setUpdateTime(DateUtils.getNowDate());
|
||||||
appSchool.setCreateBy(SecurityUtils.getUsername());
|
appSchool.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
|
@ -68,8 +75,7 @@ public class AppSchoolServiceImpl implements IAppSchoolService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateAppSchool(AppSchool appSchool)
|
public int updateAppSchool(AppSchool appSchool) {
|
||||||
{
|
|
||||||
appSchool.setUpdateTime(DateUtils.getNowDate());
|
appSchool.setUpdateTime(DateUtils.getNowDate());
|
||||||
appSchool.setUpdateBy(SecurityUtils.getUsername());
|
appSchool.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return appSchoolMapper.updateAppSchool(appSchool);
|
return appSchoolMapper.updateAppSchool(appSchool);
|
||||||
|
|
@ -82,8 +88,7 @@ public class AppSchoolServiceImpl implements IAppSchoolService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteAppSchoolByIds(Long[] ids)
|
public int deleteAppSchoolByIds(Long[] ids) {
|
||||||
{
|
|
||||||
return appSchoolMapper.deleteAppSchoolByIds(ids);
|
return appSchoolMapper.deleteAppSchoolByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -94,8 +99,7 @@ public class AppSchoolServiceImpl implements IAppSchoolService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteAppSchoolById(Long id)
|
public int deleteAppSchoolById(Long id) {
|
||||||
{
|
|
||||||
return appSchoolMapper.deleteAppSchoolById(id);
|
return appSchoolMapper.deleteAppSchoolById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -104,4 +108,48 @@ public class AppSchoolServiceImpl implements IAppSchoolService
|
||||||
return appSchoolMapper.selectAppSchoolAllList(name);
|
return appSchoolMapper.selectAppSchoolAllList(name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String importSchool(List<AppSchool> schoolList, boolean updateSupport) {
|
||||||
|
if (StringUtils.isNull(schoolList) || schoolList.size() == 0) {
|
||||||
|
throw new ServiceException("导入学校数据不能为空!");
|
||||||
|
}
|
||||||
|
int successNum = 0;
|
||||||
|
int failureNum = 0;
|
||||||
|
StringBuilder successMsg = new StringBuilder();
|
||||||
|
StringBuilder failureMsg = new StringBuilder();
|
||||||
|
for (AppSchool appSchool : schoolList) {
|
||||||
|
try {
|
||||||
|
// 验证是否存在这个用户
|
||||||
|
AppSchool s = appSchoolMapper.selectAppSchoolByName(appSchool.getName());
|
||||||
|
if (StringUtils.isNull(s)) {
|
||||||
|
BeanValidators.validateWithException(validator, appSchool);
|
||||||
|
appSchoolMapper.insertAppSchool(appSchool);
|
||||||
|
successNum++;
|
||||||
|
successMsg.append("<br/>" + successNum + "、学校 " + appSchool.getName() + " 导入成功");
|
||||||
|
} else if (updateSupport) {
|
||||||
|
BeanValidators.validateWithException(validator, appSchool);
|
||||||
|
appSchool.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
appSchoolMapper.updateAppSchoolByName(appSchool);
|
||||||
|
successNum++;
|
||||||
|
successMsg.append("<br/>" + successNum + "、学校 " + appSchool.getName() + " 更新成功");
|
||||||
|
} else {
|
||||||
|
failureNum++;
|
||||||
|
failureMsg.append("<br/>" + failureNum + "、学校 " + appSchool.getName() + " 已存在");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
failureNum++;
|
||||||
|
String msg = "<br/>" + failureNum + "、学校 " + appSchool.getName() + " 导入失败:";
|
||||||
|
failureMsg.append(msg + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (failureNum > 0) {
|
||||||
|
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||||
|
throw new ServiceException(failureMsg.toString());
|
||||||
|
} else {
|
||||||
|
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||||
|
}
|
||||||
|
return successMsg.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,13 +95,13 @@ public class AppTopicServiceImpl implements IAppTopicService
|
||||||
/**
|
/**
|
||||||
* 批量删除话题信息
|
* 批量删除话题信息
|
||||||
*
|
*
|
||||||
* @param ids 需要删除的话题信息主键
|
* @param id 需要删除的话题信息主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteAppTopicByIds(Long[] ids)
|
public int deleteAppTopicByIds(Long id)
|
||||||
{
|
{
|
||||||
return appTopicMapper.deleteAppTopicByIds(ids);
|
return appTopicMapper.deleteAppTopicByIds(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -115,4 +115,10 @@ public class AppTopicServiceImpl implements IAppTopicService
|
||||||
{
|
{
|
||||||
return appTopicMapper.deleteAppTopicById(id);
|
return appTopicMapper.deleteAppTopicById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasChildById(Long id) {
|
||||||
|
int i = appTopicMapper.hasChildById(id);
|
||||||
|
return i > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="schoolId != null "> and school_id = #{schoolId}</if>
|
<if test="schoolId != null "> and school_id = #{schoolId}</if>
|
||||||
<if test="email != null and email != ''"> and email = #{email}</if>
|
<if test="email != null and email != ''"> and email = #{email}</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectAppRegisterById" parameterType="Long" resultMap="AppRegisterResult">
|
<select id="selectAppRegisterById" parameterType="Long" resultMap="AppRegisterResult">
|
||||||
|
|
@ -75,6 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="major != null">major,</if>
|
<if test="major != null">major,</if>
|
||||||
<if test="companyName != null">company_name,</if>
|
<if test="companyName != null">company_name,</if>
|
||||||
<if test="nickname != null">nickname,</if>
|
<if test="nickname != null">nickname,</if>
|
||||||
|
<if test="provinceId != null">province_id,</if>
|
||||||
|
<if test="cityId != null">city_id,</if>
|
||||||
|
<if test="townId != null">town_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="phone != null">#{phone},</if>
|
<if test="phone != null">#{phone},</if>
|
||||||
|
|
@ -97,6 +101,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="major != null">#{major},</if>
|
<if test="major != null">#{major},</if>
|
||||||
<if test="companyName != null">#{companyName},</if>
|
<if test="companyName != null">#{companyName},</if>
|
||||||
<if test="nickname != null">#{nickname},</if>
|
<if test="nickname != null">#{nickname},</if>
|
||||||
|
<if test="provinceId != null">#{provinceId},</if>
|
||||||
|
<if test="cityId != null">#{cityId},</if>
|
||||||
|
<if test="townId != null">#{townId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
@ -167,4 +174,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
where phone = #{phone}
|
where phone = #{phone}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectAppRegisterCount" resultType="long">
|
||||||
|
select count(1) from app_register
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -102,4 +102,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAppSchoolByName" resultMap="AppSchoolResult">
|
||||||
|
<include refid="selectAppSchoolVo"/>
|
||||||
|
where name = #{name}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateAppSchoolByName">
|
||||||
|
update app_school
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
<if test="email != null">email = #{email},</if>
|
||||||
|
<if test="schoolImg != null">school_img = #{schoolImg},</if>
|
||||||
|
</trim>
|
||||||
|
where name = #{name}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -91,9 +91,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteAppTopicByIds" parameterType="String">
|
<delete id="deleteAppTopicByIds" parameterType="String">
|
||||||
delete from app_topic where id in
|
delete from app_topic where id = #{id}
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
||||||
#{id}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="hasChildById" resultType="Integer">
|
||||||
|
select count(1) from app_topic where parent_id = #{id}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -269,7 +269,6 @@ export default {
|
||||||
this.schoolList = response.rows;
|
this.schoolList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
console.log(response.rows);
|
|
||||||
this.schoolOptions = response.rows; // Correct way to update schoolOptions
|
this.schoolOptions = response.rows; // Correct way to update schoolOptions
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
@ -279,6 +278,7 @@ export default {
|
||||||
listRegister(this.queryParams).then(response => {
|
listRegister(this.queryParams).then(response => {
|
||||||
this.registerList = response.rows;
|
this.registerList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
|
console.log(response.total);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -36,25 +36,12 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="info"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-edit"
|
icon="el-icon-upload2"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="single"
|
@click="handleImport"
|
||||||
@click="handleUpdate"
|
>导入</el-button>
|
||||||
v-hasPermi="['app:school:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['app:school:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
|
|
@ -70,9 +57,24 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="schoolList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="schoolList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="学校id" align="center" prop="id" />
|
<el-table-column label="学校id" align="center" prop="id" />
|
||||||
<el-table-column label="学校名称" align="center" prop="name" />
|
<el-table-column label="学校名称" align="center" prop="name" />
|
||||||
|
<el-table-column label="邮箱后缀" align="center" prop="email" />
|
||||||
|
<el-table-column
|
||||||
|
prop="schoolImg"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
label="头像"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope" class="demo-image__preview">
|
||||||
|
<img
|
||||||
|
:src="scope.row.schoolImg"
|
||||||
|
width="40"
|
||||||
|
height="40"
|
||||||
|
class="head_pic"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
|
|
@ -110,28 +112,58 @@
|
||||||
<el-form-item label="邮箱域名" prop="email">
|
<el-form-item label="邮箱域名" prop="email">
|
||||||
<el-input v-model="form.email" placeholder="请输入邮箱域名" />
|
<el-input v-model="form.email" placeholder="请输入邮箱域名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="学校头像">
|
<!-- <el-form-item label="学校头像">-->
|
||||||
<el-upload
|
<!-- <el-upload-->
|
||||||
class="avatar-uploader"
|
<!-- class="avatar-uploader"-->
|
||||||
action="http://localhost:1024/dev-api//api/oss/upload"
|
<!-- action="http://localhost:1024/dev-api//api/oss/upload"-->
|
||||||
:show-file-list="false"
|
<!-- :show-file-list="false"-->
|
||||||
:on-success="handleAvatarSuccess"
|
<!-- :on-success="handleAvatarSuccess"-->
|
||||||
:before-upload="beforeAvatarUpload">
|
<!-- :before-upload="beforeAvatarUpload">-->
|
||||||
<img v-if="imageUrl" :src="imageUrl" class="avatar">
|
<!-- <img v-if="imageUrl" :src="imageUrl" class="avatar">-->
|
||||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
<!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i>-->
|
||||||
</el-upload>
|
<!-- </el-upload>-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||||
|
<el-upload
|
||||||
|
ref="upload"
|
||||||
|
:limit="1"
|
||||||
|
accept=".xlsx, .xls"
|
||||||
|
:headers="upload.headers"
|
||||||
|
:action="upload.url + '?updateSupport=' + upload.updateSupport"
|
||||||
|
:disabled="upload.isUploading"
|
||||||
|
:on-progress="handleFileUploadProgress"
|
||||||
|
:on-success="handleFileSuccess"
|
||||||
|
:auto-upload="false"
|
||||||
|
drag
|
||||||
|
>
|
||||||
|
<i class="el-icon-upload"></i>
|
||||||
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
|
<div class="el-upload__tip text-center" slot="tip">
|
||||||
|
<div class="el-upload__tip" slot="tip">
|
||||||
|
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
|
||||||
|
</div>
|
||||||
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||||
|
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
|
||||||
|
</div>
|
||||||
|
</el-upload>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||||
|
<el-button @click="upload.open = false">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listSchool, getSchool, delSchool, addSchool, updateSchool , uploadAvatar } from "@/api/app/school";
|
import { listSchool, getSchool, delSchool, addSchool, updateSchool , uploadAvatar } from "@/api/app/school";
|
||||||
|
import {getToken} from "@/utils/auth";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "School",
|
name: "School",
|
||||||
|
|
@ -165,7 +197,21 @@ export default {
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
}
|
},
|
||||||
|
upload: {
|
||||||
|
// 是否显示弹出层(学校导入)
|
||||||
|
open: false,
|
||||||
|
// 弹出层标题(学校导入)
|
||||||
|
title: "",
|
||||||
|
// 是否禁用上传
|
||||||
|
isUploading: false,
|
||||||
|
// 是否更新已经存在的用户数据
|
||||||
|
updateSupport: 0,
|
||||||
|
// 设置上传的请求头部
|
||||||
|
headers: { Authorization: "Bearer " + getToken() },
|
||||||
|
// 上传的地址
|
||||||
|
url: process.env.VUE_APP_BASE_API + "app/school/importData",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -265,7 +311,27 @@ export default {
|
||||||
this.download('app/school/export', {
|
this.download('app/school/export', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `school_${new Date().getTime()}.xlsx`)
|
}, `school_${new Date().getTime()}.xlsx`)
|
||||||
}
|
},
|
||||||
|
/** 导入按钮操作 */
|
||||||
|
handleImport() {
|
||||||
|
this.upload.title = "学校导入";
|
||||||
|
this.upload.open = true;
|
||||||
|
},
|
||||||
|
handleFileSuccess(response, file, fileList) {
|
||||||
|
this.upload.open = false;
|
||||||
|
this.upload.isUploading = false;
|
||||||
|
this.$refs.upload.clearFiles();
|
||||||
|
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
// 提交上传文件
|
||||||
|
submitFileForm() {
|
||||||
|
this.$refs.upload.submit();
|
||||||
|
},
|
||||||
|
importTemplate() {
|
||||||
|
this.download('app/school/importTemplate', {
|
||||||
|
}, `school_template_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
|
@ -28,43 +30,23 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="info"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-edit"
|
icon="el-icon-sort"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="single"
|
@click="toggleExpandAll"
|
||||||
@click="handleUpdate"
|
>展开/折叠</el-button>
|
||||||
v-hasPermi="['app:topic:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['app:topic:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['app:topic:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
|
|
||||||
|
v-if="refreshTable"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="topicList"
|
:data="topicList"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
|
:default-expand-all="isExpandAll"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||||
>
|
>
|
||||||
|
|
@ -143,14 +125,55 @@
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog :title="title" :visible.sync="openUpdate" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24" v-if="form.type === '0'">
|
||||||
|
<el-form-item label="话题分类" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入话题分类" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" v-if="form.type === '1'">
|
||||||
|
<el-form-item label="话题名称" prop="parentId">
|
||||||
|
<el-select
|
||||||
|
v-model="form.parentId"
|
||||||
|
placeholder="请选择话题分类"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in options"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" v-if="form.type === '1'">
|
||||||
|
<el-form-item label="话题名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入话题名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listTopic, getTopic, delTopic, addTopic, updateTopic ,listAppTopic } from "@/api/app/topic";
|
import { listTopic, getTopic, delTopic, addTopic, updateTopic ,listAppTopic } from "@/api/app/topic";
|
||||||
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
import IconSelect from "@/components/IconSelect";
|
||||||
export default {
|
export default {
|
||||||
name: "Topic",
|
name: "Topic",
|
||||||
|
components: { Treeselect, IconSelect },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
|
|
@ -163,6 +186,8 @@ export default {
|
||||||
multiple: true,
|
multiple: true,
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
|
refreshTable: true,
|
||||||
|
isExpandAll: false,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
// 话题信息表格数据
|
// 话题信息表格数据
|
||||||
|
|
@ -171,6 +196,7 @@ export default {
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
|
openUpdate: false,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
|
|
@ -195,7 +221,7 @@ export default {
|
||||||
/** 查询话题信息列表 */
|
/** 查询话题信息列表 */
|
||||||
getAppTopic() {
|
getAppTopic() {
|
||||||
|
|
||||||
this.loading = true;
|
// this.loading = true;
|
||||||
this.queryParams.parentId = 0;
|
this.queryParams.parentId = 0;
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
this.queryParams.pageSize = 10000;
|
this.queryParams.pageSize = 10000;
|
||||||
|
|
@ -222,14 +248,14 @@ export default {
|
||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
id: null,
|
id: undefined,
|
||||||
name: null,
|
name: undefined,
|
||||||
createTime: null,
|
createTime: undefined,
|
||||||
updateTime: null,
|
updateTime: undefined,
|
||||||
createBy: null,
|
createBy: undefined,
|
||||||
updateBy: null,
|
updateBy: undefined,
|
||||||
remark: null,
|
remark: undefined,
|
||||||
type: '0'
|
type: '1'
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
|
@ -259,11 +285,11 @@ export default {
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
handleUpdate(row) {
|
handleUpdate(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.getList();
|
this.getAppTopic();
|
||||||
const id = row.id || this.ids
|
const id = row.id || this.ids
|
||||||
getTopic(id).then(response => {
|
getTopic(id).then(response => {
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.openUpdate = true;
|
||||||
this.title = "修改话题信息";
|
this.title = "修改话题信息";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
@ -274,7 +300,9 @@ export default {
|
||||||
if (this.form.id != null) {
|
if (this.form.id != null) {
|
||||||
updateTopic(this.form).then(response => {
|
updateTopic(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.open = false;
|
this.openUpdate = false;
|
||||||
|
|
||||||
|
this.queryParams.parentId = null ;
|
||||||
this.getList();
|
this.getList();
|
||||||
this.reset();
|
this.reset();
|
||||||
});
|
});
|
||||||
|
|
@ -282,7 +310,9 @@ export default {
|
||||||
addTopic(this.form).then(response => {
|
addTopic(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.open = false;
|
this.open = false;
|
||||||
|
this.queryParams.parentId = null ;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.reset();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -303,7 +333,15 @@ export default {
|
||||||
this.download('app/topic/export', {
|
this.download('app/topic/export', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `topic_${new Date().getTime()}.xlsx`)
|
}, `topic_${new Date().getTime()}.xlsx`)
|
||||||
}
|
},
|
||||||
|
/** 展开/折叠操作 */
|
||||||
|
toggleExpandAll() {
|
||||||
|
this.refreshTable = false;
|
||||||
|
this.isExpandAll = !this.isExpandAll;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.refreshTable = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,7 @@ export default {
|
||||||
list(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
|
list(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
|
||||||
this.list = response.rows;
|
this.list = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
|
console.log(response.total);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue