注释掉不要的代码
This commit is contained in:
@@ -1,193 +1,193 @@
|
||||
package com.adc.da.sys.controller;
|
||||
|
||||
|
||||
import com.adc.da.sys.dao.mysql.MailEODao;
|
||||
import com.adc.da.sys.entity.MailEO;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.service.iservice.IUserEoService;
|
||||
import com.adc.da.sys.util.DefaultConfigurer;
|
||||
import com.adc.da.sys.util.EncryptUtil;
|
||||
import com.adc.da.sys.util.MailTestUtils;
|
||||
import com.adc.da.sys.util.SendEmailMessage;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* @Author sima
|
||||
* @Date 2022/6/24 13:06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/sys/mail")
|
||||
@Api(tags = {"Sys-发送邮件"})
|
||||
@Slf4j
|
||||
public class MailController {
|
||||
|
||||
@Resource
|
||||
private MailEODao mailEODao;
|
||||
@Resource
|
||||
private IUserEoService userEOService;
|
||||
|
||||
|
||||
@Value("${MAIL_SMTP}")
|
||||
private String mail_smtp;
|
||||
|
||||
@Value("${MAIL_SMTP_PORT}")
|
||||
private String mail_smtp_port;
|
||||
|
||||
@Value("${MAIL_USERNAME}")
|
||||
private String mail_username;
|
||||
|
||||
@Value("${MAIL_PASSWORD}")
|
||||
private String mail_password;
|
||||
@Value("${MAIL_POP_PORT}")
|
||||
private String mail_pop_port;
|
||||
|
||||
|
||||
@Value("${IPANDPORT}")
|
||||
private String piAndPort;
|
||||
|
||||
|
||||
/**
|
||||
* 废弃
|
||||
* @param mailEO
|
||||
* @return
|
||||
*/
|
||||
/* @ApiOperation("发送邮件")
|
||||
@PostMapping("/send")
|
||||
public ResponseMessage send(@RequestBody MailEO mailEO) {
|
||||
MailUtils sendmail = new MailUtils();
|
||||
sendmail.setHost(mail_smtp);
|
||||
sendmail.setPort(mail_smtp_port);
|
||||
sendmail.setUserName(mail_username); // 发送邮箱
|
||||
sendmail.setPassWord(mail_password); // 发送邮箱密码
|
||||
sendmail.setFrom(mail_username);// 发送邮箱
|
||||
sendmail.setSubject(mailEO.getSubject());
|
||||
sendmail.setContent(mailEO.getContent());
|
||||
|
||||
String mails = mailEO.getToMail();
|
||||
Set<String> set = strToList(mails);
|
||||
|
||||
int i = 0;
|
||||
for (String mail : set) {
|
||||
sendmail.setTo(mail); // 目的邮箱
|
||||
|
||||
if (sendmail.sendMail()) {
|
||||
mailEO.setSendDate(new Date());
|
||||
mailEO.setId(UUID.randomUUID().toString());
|
||||
mailEO.setToMail(mail);
|
||||
mailEODao.insert(mailEO);
|
||||
i++;
|
||||
//保存记录
|
||||
// return Result.success("成功");
|
||||
}
|
||||
}
|
||||
if(i>0){
|
||||
return Result.success("成功");
|
||||
}
|
||||
return Result.error("发送失败");
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
@ApiOperation("发送邮件")
|
||||
@PostMapping("/send")
|
||||
public ResponseMessage send(@RequestBody MailEO mailEO) throws Exception {
|
||||
|
||||
MailTestUtils eu = new MailTestUtils(mail_username, mail_password);
|
||||
SendEmailMessage sem = new SendEmailMessage();
|
||||
sem.setFrom(mail_username);
|
||||
sem.setRecipient(mailEO.getToMail());
|
||||
sem.setCopyRecipient(mailEO.getCcMail());
|
||||
sem.setSubject(mailEO.getSubject());
|
||||
sem.setContent(mailEO.getContent());
|
||||
|
||||
DefaultConfigurer defaultConfigurer = new DefaultConfigurer();
|
||||
defaultConfigurer.setMail_smtp(mail_smtp);
|
||||
defaultConfigurer.setMail_smtp_port(mail_smtp_port);
|
||||
defaultConfigurer.setMail_pop_port(mail_pop_port);
|
||||
try{
|
||||
eu.sendMail(defaultConfigurer.getSMTP(), sem);
|
||||
mailEO.setSendDate(new Date());
|
||||
mailEO.setId(UUID.randomUUID().toString().replaceAll("-",""));
|
||||
mailEO.setToMail(getUserByMail(mailEO.getToMail()));
|
||||
mailEO.setCcMail(getUserByMail(mailEO.getCcMail()));
|
||||
mailEODao.insert(mailEO);
|
||||
System.out.println("发送成功");
|
||||
return Result.success("发送成功");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
log.error("邮件发送失败:",e);
|
||||
return Result.error("发送失败");
|
||||
}
|
||||
|
||||
|
||||
// 收邮件
|
||||
// eu.receiveMail(defaultConfigurer.getPOP3(), "pop3"); // pop3收信
|
||||
// System.out.println("收取完毕");
|
||||
|
||||
// 使用IMAP收信会抛出 Failed to load IMAP envelope 异常
|
||||
//eu.receiveMail(DefaultConfigurer.getIMAP(), "imap"); // imap收信
|
||||
|
||||
}
|
||||
|
||||
private String getUserByMail(String mails) {
|
||||
if(null == mails || "".equals(mails)){
|
||||
return "";
|
||||
}
|
||||
List<String> mailList = Arrays.asList(mails.split(","));
|
||||
List<String> accountList = new ArrayList<>();
|
||||
for (int i = 0; i < mailList.size(); i++) {
|
||||
String mail = mailList.get(i);
|
||||
String account = mail.substring(0, mail.indexOf("@"));
|
||||
accountList.add(account);
|
||||
}
|
||||
// List<UserEO> userEOList = userEOService.getUserByMail(mailList);
|
||||
List<UserEO> userEOList = userEOService.getUserByAccount(accountList);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (UserEO user:userEOList) {
|
||||
sb.append(",");
|
||||
sb.append(user.getUsname());
|
||||
sb.append("-");
|
||||
sb.append(user.getDepartment());
|
||||
sb.append("<");
|
||||
sb.append(user.getAccount());
|
||||
sb.append("@Any3.com");
|
||||
sb.append(">");
|
||||
}
|
||||
return sb.toString().substring(1);
|
||||
}
|
||||
|
||||
@ApiOperation("发送记录")
|
||||
@PostMapping("/list")
|
||||
public ResponseMessage list(Integer pageNo, Integer pageSize) {
|
||||
pageNo = null == pageNo ? 1 : pageNo;
|
||||
pageSize = null == pageSize ? 10 : pageSize;
|
||||
IPage page = new Page();
|
||||
page.setCurrent(pageNo);
|
||||
page.setSize(pageSize);
|
||||
IPage<MailEO> list = mailEODao.list(page);
|
||||
List<MailEO> records = list.getRecords();
|
||||
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
||||
for (MailEO eo:records) {
|
||||
eo.setStrSendDate(sdf.format(eo.getSendDate()));
|
||||
}
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
//package com.adc.da.sys.controller;
|
||||
//
|
||||
//
|
||||
//import com.adc.da.sys.dao.mysql.MailEODao;
|
||||
//import com.adc.da.sys.entity.MailEO;
|
||||
//import com.adc.da.sys.entity.UserEO;
|
||||
//import com.adc.da.sys.service.iservice.IUserEoService;
|
||||
//import com.adc.da.sys.util.DefaultConfigurer;
|
||||
//import com.adc.da.sys.util.EncryptUtil;
|
||||
//import com.adc.da.sys.util.MailTestUtils;
|
||||
//import com.adc.da.sys.util.SendEmailMessage;
|
||||
//import com.adc.da.util.http.ResponseMessage;
|
||||
//import com.adc.da.util.http.Result;
|
||||
//import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import javax.annotation.Resource;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//import java.text.DateFormat;
|
||||
//import java.text.SimpleDateFormat;
|
||||
//import java.util.*;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * @Author sima
|
||||
// * @Date 2022/6/24 13:06
|
||||
// */
|
||||
//@RestController
|
||||
//@RequestMapping("/${restPath}/sys/mail")
|
||||
//@Api(tags = {"Sys-发送邮件"})
|
||||
//@Slf4j
|
||||
//public class MailController {
|
||||
//
|
||||
// @Resource
|
||||
// private MailEODao mailEODao;
|
||||
// @Resource
|
||||
// private IUserEoService userEOService;
|
||||
//
|
||||
//
|
||||
// @Value("${MAIL_SMTP}")
|
||||
// private String mail_smtp;
|
||||
//
|
||||
// @Value("${MAIL_SMTP_PORT}")
|
||||
// private String mail_smtp_port;
|
||||
//
|
||||
// @Value("${MAIL_USERNAME}")
|
||||
// private String mail_username;
|
||||
//
|
||||
// @Value("${MAIL_PASSWORD}")
|
||||
// private String mail_password;
|
||||
// @Value("${MAIL_POP_PORT}")
|
||||
// private String mail_pop_port;
|
||||
//
|
||||
//
|
||||
// @Value("${IPANDPORT}")
|
||||
// private String piAndPort;
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 废弃
|
||||
// * @param mailEO
|
||||
// * @return
|
||||
// */
|
||||
// /* @ApiOperation("发送邮件")
|
||||
// @PostMapping("/send")
|
||||
// public ResponseMessage send(@RequestBody MailEO mailEO) {
|
||||
// MailUtils sendmail = new MailUtils();
|
||||
// sendmail.setHost(mail_smtp);
|
||||
// sendmail.setPort(mail_smtp_port);
|
||||
// sendmail.setUserName(mail_username); // 发送邮箱
|
||||
// sendmail.setPassWord(mail_password); // 发送邮箱密码
|
||||
// sendmail.setFrom(mail_username);// 发送邮箱
|
||||
// sendmail.setSubject(mailEO.getSubject());
|
||||
// sendmail.setContent(mailEO.getContent());
|
||||
//
|
||||
// String mails = mailEO.getToMail();
|
||||
// Set<String> set = strToList(mails);
|
||||
//
|
||||
// int i = 0;
|
||||
// for (String mail : set) {
|
||||
// sendmail.setTo(mail); // 目的邮箱
|
||||
//
|
||||
// if (sendmail.sendMail()) {
|
||||
// mailEO.setSendDate(new Date());
|
||||
// mailEO.setId(UUID.randomUUID().toString());
|
||||
// mailEO.setToMail(mail);
|
||||
// mailEODao.insert(mailEO);
|
||||
// i++;
|
||||
// //保存记录
|
||||
//// return Result.success("成功");
|
||||
// }
|
||||
// }
|
||||
// if(i>0){
|
||||
// return Result.success("成功");
|
||||
// }
|
||||
// return Result.error("发送失败");
|
||||
//
|
||||
// }*/
|
||||
//
|
||||
//
|
||||
//
|
||||
// @ApiOperation("发送邮件")
|
||||
// @PostMapping("/send")
|
||||
// public ResponseMessage send(@RequestBody MailEO mailEO) throws Exception {
|
||||
//
|
||||
// MailTestUtils eu = new MailTestUtils(mail_username, mail_password);
|
||||
// SendEmailMessage sem = new SendEmailMessage();
|
||||
// sem.setFrom(mail_username);
|
||||
// sem.setRecipient(mailEO.getToMail());
|
||||
// sem.setCopyRecipient(mailEO.getCcMail());
|
||||
// sem.setSubject(mailEO.getSubject());
|
||||
// sem.setContent(mailEO.getContent());
|
||||
//
|
||||
// DefaultConfigurer defaultConfigurer = new DefaultConfigurer();
|
||||
// defaultConfigurer.setMail_smtp(mail_smtp);
|
||||
// defaultConfigurer.setMail_smtp_port(mail_smtp_port);
|
||||
// defaultConfigurer.setMail_pop_port(mail_pop_port);
|
||||
// try{
|
||||
// eu.sendMail(defaultConfigurer.getSMTP(), sem);
|
||||
// mailEO.setSendDate(new Date());
|
||||
// mailEO.setId(UUID.randomUUID().toString().replaceAll("-",""));
|
||||
// mailEO.setToMail(getUserByMail(mailEO.getToMail()));
|
||||
// mailEO.setCcMail(getUserByMail(mailEO.getCcMail()));
|
||||
// mailEODao.insert(mailEO);
|
||||
// System.out.println("发送成功");
|
||||
// return Result.success("发送成功");
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// log.error("邮件发送失败:",e);
|
||||
// return Result.error("发送失败");
|
||||
// }
|
||||
//
|
||||
//
|
||||
//// 收邮件
|
||||
//// eu.receiveMail(defaultConfigurer.getPOP3(), "pop3"); // pop3收信
|
||||
//// System.out.println("收取完毕");
|
||||
//
|
||||
//// 使用IMAP收信会抛出 Failed to load IMAP envelope 异常
|
||||
////eu.receiveMail(DefaultConfigurer.getIMAP(), "imap"); // imap收信
|
||||
//
|
||||
// }
|
||||
//
|
||||
// private String getUserByMail(String mails) {
|
||||
// if(null == mails || "".equals(mails)){
|
||||
// return "";
|
||||
// }
|
||||
// List<String> mailList = Arrays.asList(mails.split(","));
|
||||
// List<String> accountList = new ArrayList<>();
|
||||
// for (int i = 0; i < mailList.size(); i++) {
|
||||
// String mail = mailList.get(i);
|
||||
// String account = mail.substring(0, mail.indexOf("@"));
|
||||
// accountList.add(account);
|
||||
// }
|
||||
//// List<UserEO> userEOList = userEOService.getUserByMail(mailList);
|
||||
// List<UserEO> userEOList = userEOService.getUserByAccount(accountList);
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// for (UserEO user:userEOList) {
|
||||
// sb.append(",");
|
||||
// sb.append(user.getUsname());
|
||||
// sb.append("-");
|
||||
// sb.append(user.getDepartment());
|
||||
// sb.append("<");
|
||||
// sb.append(user.getAccount());
|
||||
// sb.append("@Any3.com");
|
||||
// sb.append(">");
|
||||
// }
|
||||
// return sb.toString().substring(1);
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("发送记录")
|
||||
// @PostMapping("/list")
|
||||
// public ResponseMessage list(Integer pageNo, Integer pageSize) {
|
||||
// pageNo = null == pageNo ? 1 : pageNo;
|
||||
// pageSize = null == pageSize ? 10 : pageSize;
|
||||
// IPage page = new Page();
|
||||
// page.setCurrent(pageNo);
|
||||
// page.setSize(pageSize);
|
||||
// IPage<MailEO> list = mailEODao.list(page);
|
||||
// List<MailEO> records = list.getRecords();
|
||||
// DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
||||
// for (MailEO eo:records) {
|
||||
// eo.setStrSendDate(sdf.format(eo.getSendDate()));
|
||||
// }
|
||||
// return Result.success(list);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
package com.adc.da.sys.controller;
|
||||
|
||||
import com.adc.da.sys.dao.mysql.MailEODao;
|
||||
import com.adc.da.sys.entity.MailEO;
|
||||
import com.adc.da.sys.util.DefaultConfigurer;
|
||||
import com.adc.da.sys.util.MailTestUtils;
|
||||
import com.adc.da.sys.util.MailUtils;
|
||||
import com.adc.da.sys.util.SendEmailMessage;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* @Author sima
|
||||
* @Date 2022/6/24 13:06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/sys/mailtest")
|
||||
@Api(tags = {"Sys-发送邮件test"})
|
||||
@Slf4j
|
||||
public class MailTestController {
|
||||
|
||||
@Value("${MAIL_USERNAME}")
|
||||
private String mail_username;
|
||||
|
||||
@Value("${MAIL_PASSWORD}")
|
||||
private String mail_password;
|
||||
|
||||
@Value("${MAIL_SMTP}")
|
||||
private String mail_smtp;
|
||||
|
||||
@Value("${MAIL_SMTP_PORT}")
|
||||
private String mail_smtp_port;
|
||||
|
||||
@Value("${MAIL_POP_PORT}")
|
||||
private String mail_pop_port;
|
||||
|
||||
/**
|
||||
* 程序入口点
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@ApiOperation("发送邮件")
|
||||
@PostMapping("/send")
|
||||
public ResponseMessage send(@RequestBody MailEO mailEO) throws Exception {
|
||||
|
||||
MailTestUtils eu = new MailTestUtils(mail_username, mail_password);
|
||||
SendEmailMessage sem = new SendEmailMessage();
|
||||
sem.setFrom(mail_username);
|
||||
sem.setRecipient(mailEO.getToMail());
|
||||
sem.setSubject("镇长");
|
||||
sem.setText("hello world");
|
||||
DefaultConfigurer defaultConfigurer = new DefaultConfigurer();
|
||||
defaultConfigurer.setMail_smtp(mail_smtp);
|
||||
defaultConfigurer.setMail_smtp_port(mail_smtp_port);
|
||||
defaultConfigurer.setMail_pop_port(mail_pop_port);
|
||||
eu.sendMail(defaultConfigurer.getSMTP(), sem);
|
||||
System.out.println("发送成功");
|
||||
// 收邮件
|
||||
// eu.receiveMail(defaultConfigurer.getPOP3(), "pop3"); // pop3收信
|
||||
// System.out.println("收取完毕");
|
||||
|
||||
// 使用IMAP收信会抛出 Failed to load IMAP envelope 异常
|
||||
//eu.receiveMail(DefaultConfigurer.getIMAP(), "imap"); // imap收信
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
//package com.adc.da.sys.controller;
|
||||
//
|
||||
//import com.adc.da.sys.dao.mysql.MailEODao;
|
||||
//import com.adc.da.sys.entity.MailEO;
|
||||
//import com.adc.da.sys.util.DefaultConfigurer;
|
||||
//import com.adc.da.sys.util.MailTestUtils;
|
||||
//import com.adc.da.sys.util.MailUtils;
|
||||
//import com.adc.da.sys.util.SendEmailMessage;
|
||||
//import com.adc.da.util.http.ResponseMessage;
|
||||
//import com.adc.da.util.http.Result;
|
||||
//import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import javax.annotation.Resource;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestBody;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//import java.text.DateFormat;
|
||||
//import java.text.SimpleDateFormat;
|
||||
//import java.util.*;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * @Author sima
|
||||
// * @Date 2022/6/24 13:06
|
||||
// */
|
||||
//@RestController
|
||||
//@RequestMapping("/${restPath}/sys/mailtest")
|
||||
//@Api(tags = {"Sys-发送邮件test"})
|
||||
//@Slf4j
|
||||
//public class MailTestController {
|
||||
//
|
||||
// @Value("${MAIL_USERNAME}")
|
||||
// private String mail_username;
|
||||
//
|
||||
// @Value("${MAIL_PASSWORD}")
|
||||
// private String mail_password;
|
||||
//
|
||||
// @Value("${MAIL_SMTP}")
|
||||
// private String mail_smtp;
|
||||
//
|
||||
// @Value("${MAIL_SMTP_PORT}")
|
||||
// private String mail_smtp_port;
|
||||
//
|
||||
// @Value("${MAIL_POP_PORT}")
|
||||
// private String mail_pop_port;
|
||||
//
|
||||
// /**
|
||||
// * 程序入口点
|
||||
// * @param
|
||||
// * @throws Exception
|
||||
// */
|
||||
// @ApiOperation("发送邮件")
|
||||
// @PostMapping("/send")
|
||||
// public ResponseMessage send(@RequestBody MailEO mailEO) throws Exception {
|
||||
//
|
||||
// MailTestUtils eu = new MailTestUtils(mail_username, mail_password);
|
||||
// SendEmailMessage sem = new SendEmailMessage();
|
||||
// sem.setFrom(mail_username);
|
||||
// sem.setRecipient(mailEO.getToMail());
|
||||
// sem.setSubject("镇长");
|
||||
// sem.setText("hello world");
|
||||
// DefaultConfigurer defaultConfigurer = new DefaultConfigurer();
|
||||
// defaultConfigurer.setMail_smtp(mail_smtp);
|
||||
// defaultConfigurer.setMail_smtp_port(mail_smtp_port);
|
||||
// defaultConfigurer.setMail_pop_port(mail_pop_port);
|
||||
// eu.sendMail(defaultConfigurer.getSMTP(), sem);
|
||||
// System.out.println("发送成功");
|
||||
//// 收邮件
|
||||
//// eu.receiveMail(defaultConfigurer.getPOP3(), "pop3"); // pop3收信
|
||||
//// System.out.println("收取完毕");
|
||||
//
|
||||
//// 使用IMAP收信会抛出 Failed to load IMAP envelope 异常
|
||||
////eu.receiveMail(DefaultConfigurer.getIMAP(), "imap"); // imap收信
|
||||
// return Result.success();
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -249,19 +249,19 @@ public class RoleEOController extends BaseController<RoleEO> {
|
||||
return Result.success(roleVO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "配置角色首页|RoleEO|")
|
||||
@PostMapping("/saveRoleHome")
|
||||
public ResponseMessage saveRoleHome(@RequestBody RoleVO roleVO) {
|
||||
roleEOService.saveRoleHome(beanMapper.map(roleVO, RoleEO.class));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "得到角色首页|RoleEO|")
|
||||
@GetMapping("/getRoleHome")
|
||||
public ResponseMessage getRoleHome(String roleId) throws Exception {
|
||||
List<MenuVO> homeList = roleEOService.getHomeMenu(roleId);
|
||||
return Result.success(homeList);
|
||||
}
|
||||
// @ApiOperation(value = "配置角色首页|RoleEO|")
|
||||
// @PostMapping("/saveRoleHome")
|
||||
// public ResponseMessage saveRoleHome(@RequestBody RoleVO roleVO) {
|
||||
// roleEOService.saveRoleHome(beanMapper.map(roleVO, RoleEO.class));
|
||||
// return Result.success();
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "得到角色权限|RoleEO|")
|
||||
// @GetMapping("/getRoleMenu")
|
||||
// public ResponseMessage getRoleMenu(String roleId) throws Exception {
|
||||
// List<MenuVO> homeList = roleEOService.getRoleMenu(roleId);
|
||||
// return Result.success(homeList);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -66,18 +66,18 @@ public class UserEOController extends BaseController<UserEO> {
|
||||
// *
|
||||
// * @see dozer
|
||||
// */
|
||||
|
||||
@Value("${MAIL_SMTP}")
|
||||
private String mail_smtp;
|
||||
|
||||
@Value("${MAIL_SMTP_PORT}")
|
||||
private String mail_smtp_port;
|
||||
|
||||
@Value("${MAIL_USERNAME}")
|
||||
private String mail_username;
|
||||
|
||||
@Value("${MAIL_PASSWORD}")
|
||||
private String mail_password;
|
||||
//
|
||||
// @Value("${MAIL_SMTP}")
|
||||
// private String mail_smtp;
|
||||
//
|
||||
// @Value("${MAIL_SMTP_PORT}")
|
||||
// private String mail_smtp_port;
|
||||
//
|
||||
// @Value("${MAIL_USERNAME}")
|
||||
// private String mail_username;
|
||||
//
|
||||
// @Value("${MAIL_PASSWORD}")
|
||||
// private String mail_password;
|
||||
|
||||
@Value("${isPassEncrypted}")
|
||||
private boolean isPassEncrypted;
|
||||
@@ -98,7 +98,7 @@ public class UserEOController extends BaseController<UserEO> {
|
||||
UserEO eo = gson.fromJson(element, UserEO.class);
|
||||
// UserEO eo=new UserEO();
|
||||
// BeanUtils.copyProperties(vo,eo);
|
||||
eo.setPassword("EI$XIL@vdc9ptev7");
|
||||
eo.setPassword("HZWLsoft.com123");
|
||||
if (StringUtils.isBlank(eo.getAccount())) {
|
||||
return Result.error("用户名不能为空!");
|
||||
}
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
package com.adc.da.sys.controller.ddm;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.sys.entity.MenuEO;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.service.MenuEOService;
|
||||
import com.adc.da.sys.service.iservice.IUserEoService;
|
||||
import com.adc.da.sys.util.EncryptUtil;
|
||||
import com.adc.da.sys.vo.ddm.DdmMenuListVO;
|
||||
import com.adc.da.sys.vo.ddm.DdmMenuVO;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${portalPath}")
|
||||
@Api(tags = {"ddm-菜单类接口"})
|
||||
public class DdmMenuEOController extends BaseController<UserEO> {
|
||||
//package com.adc.da.sys.controller.ddm;
|
||||
//
|
||||
@Resource
|
||||
private MenuEOService menuEOService;
|
||||
|
||||
/**
|
||||
* 日志
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(DdmMenuEOController.class);
|
||||
|
||||
@ApiOperation("查询菜单")
|
||||
@PostMapping("/model/list.do")
|
||||
public DdmResponseMessage list( ){
|
||||
try {
|
||||
|
||||
List<MenuEO> menuEOS = menuEOService.findAll();
|
||||
List<DdmMenuListVO> ddmMenuListVOList = new ArrayList<>();
|
||||
menuEOS.forEach(menuEO -> {
|
||||
DdmMenuListVO ddmMenuListVO = new DdmMenuListVO();
|
||||
ddmMenuListVO.setModelId(menuEO.getId());
|
||||
ddmMenuListVO.setModelName(menuEO.getName());
|
||||
ddmMenuListVO.setParentModelCode(menuEO.getParentId());
|
||||
ddmMenuListVOList.add(ddmMenuListVO);
|
||||
});
|
||||
HashMap<String,Object> dataMap =new HashMap<>();
|
||||
dataMap.put("modelList",ddmMenuListVOList);
|
||||
return DdmResult.success(dataMap) ;
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("查询菜单", e);
|
||||
return DdmResult.error("查询菜单:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//import com.adc.da.base.page.BasePage;
|
||||
//import com.adc.da.base.web.BaseController;
|
||||
//import com.adc.da.sys.entity.MenuEO;
|
||||
//import com.adc.da.sys.entity.UserEO;
|
||||
//import com.adc.da.sys.service.MenuEOService;
|
||||
//import com.adc.da.sys.service.iservice.IUserEoService;
|
||||
//import com.adc.da.sys.util.EncryptUtil;
|
||||
//import com.adc.da.sys.vo.ddm.DdmMenuListVO;
|
||||
//import com.adc.da.sys.vo.ddm.DdmMenuVO;
|
||||
//import com.adc.da.util.http.ResponseMessage;
|
||||
//import com.adc.da.util.http.Result;
|
||||
//import com.adc.da.util.utils.StringUtils;
|
||||
//import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import javax.annotation.Resource;
|
||||
//import org.springframework.web.bind.annotation.GetMapping;
|
||||
//import org.springframework.web.bind.annotation.PostMapping;
|
||||
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||
//import org.springframework.web.bind.annotation.RestController;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.HashMap;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
//@RestController
|
||||
//@RequestMapping("/${portalPath}")
|
||||
//@Api(tags = {"ddm-菜单类接口"})
|
||||
//public class DdmMenuEOController extends BaseController<UserEO> {
|
||||
////
|
||||
// @Resource
|
||||
// private MenuEOService menuEOService;
|
||||
//
|
||||
// /**
|
||||
// * 日志
|
||||
// */
|
||||
// private static final Logger logger = LoggerFactory.getLogger(DdmMenuEOController.class);
|
||||
//
|
||||
// @ApiOperation("查询菜单")
|
||||
// @PostMapping("/model/list.do")
|
||||
// public DdmResponseMessage list( ){
|
||||
// try {
|
||||
//
|
||||
// List<MenuEO> menuEOS = menuEOService.findAll();
|
||||
// List<DdmMenuListVO> ddmMenuListVOList = new ArrayList<>();
|
||||
// menuEOS.forEach(menuEO -> {
|
||||
// DdmMenuListVO ddmMenuListVO = new DdmMenuListVO();
|
||||
// ddmMenuListVO.setModelId(menuEO.getId());
|
||||
// ddmMenuListVO.setModelName(menuEO.getName());
|
||||
// ddmMenuListVO.setParentModelCode(menuEO.getParentId());
|
||||
// ddmMenuListVOList.add(ddmMenuListVO);
|
||||
// });
|
||||
// HashMap<String,Object> dataMap =new HashMap<>();
|
||||
// dataMap.put("modelList",ddmMenuListVOList);
|
||||
// return DdmResult.success(dataMap) ;
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// logger.error("查询菜单", e);
|
||||
// return DdmResult.error("查询菜单:" + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
package com.adc.da.sys.controller.ddm;
|
||||
|
||||
|
||||
public class DdmResponseMessage<T> {
|
||||
private String resCode;
|
||||
private String resMsg;
|
||||
private T data;
|
||||
|
||||
public DdmResponseMessage() {
|
||||
}
|
||||
|
||||
public DdmResponseMessage(String respCode, String message,T data) {
|
||||
this.resCode = respCode;
|
||||
this.resMsg = message;
|
||||
this.data=data;
|
||||
}
|
||||
|
||||
public DdmResponseMessage(String respCode, String message) {
|
||||
this.resCode = respCode;
|
||||
this.resMsg = message;
|
||||
}
|
||||
|
||||
public String getResCode() {
|
||||
return resCode;
|
||||
}
|
||||
|
||||
public void setResCode(String resCode) {
|
||||
this.resCode = resCode;
|
||||
}
|
||||
|
||||
public String getResMsg() {
|
||||
return resMsg;
|
||||
}
|
||||
|
||||
public void setResMsg(String resMsg) {
|
||||
this.resMsg = resMsg;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
//package com.adc.da.sys.controller.ddm;
|
||||
//
|
||||
//
|
||||
//public class DdmResponseMessage<T> {
|
||||
// private String resCode;
|
||||
// private String resMsg;
|
||||
// private T data;
|
||||
//
|
||||
// public DdmResponseMessage() {
|
||||
// }
|
||||
//
|
||||
// public DdmResponseMessage(String respCode, String message,T data) {
|
||||
// this.resCode = respCode;
|
||||
// this.resMsg = message;
|
||||
// this.data=data;
|
||||
// }
|
||||
//
|
||||
// public DdmResponseMessage(String respCode, String message) {
|
||||
// this.resCode = respCode;
|
||||
// this.resMsg = message;
|
||||
// }
|
||||
//
|
||||
// public String getResCode() {
|
||||
// return resCode;
|
||||
// }
|
||||
//
|
||||
// public void setResCode(String resCode) {
|
||||
// this.resCode = resCode;
|
||||
// }
|
||||
//
|
||||
// public String getResMsg() {
|
||||
// return resMsg;
|
||||
// }
|
||||
//
|
||||
// public void setResMsg(String resMsg) {
|
||||
// this.resMsg = resMsg;
|
||||
// }
|
||||
//
|
||||
// public T getData() {
|
||||
// return data;
|
||||
// }
|
||||
//
|
||||
// public void setData(T data) {
|
||||
// this.data = data;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
package com.adc.da.sys.controller.ddm;
|
||||
|
||||
public class DdmResult {
|
||||
public DdmResult() {
|
||||
}
|
||||
|
||||
|
||||
public static <T> DdmResponseMessage<T> success(String code, T t) {
|
||||
return new DdmResponseMessage(code, "success", t);
|
||||
}
|
||||
|
||||
public static <T> DdmResponseMessage<T> success( T t) {
|
||||
return success("0","success", t);
|
||||
}
|
||||
|
||||
public static <T> DdmResponseMessage<T> success() {
|
||||
return success("0","success");
|
||||
}
|
||||
|
||||
public static <T> DdmResponseMessage<T> success(String code, String message) {
|
||||
return new DdmResponseMessage(code, message);
|
||||
}
|
||||
|
||||
public static <T> DdmResponseMessage<T> success(String code, String message, T t) {
|
||||
return new DdmResponseMessage(code, message, t);
|
||||
}
|
||||
|
||||
|
||||
public static DdmResponseMessage error(String message) {
|
||||
return new DdmResponseMessage("1", message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
//package com.adc.da.sys.controller.ddm;
|
||||
//
|
||||
//public class DdmResult {
|
||||
// public DdmResult() {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public static <T> DdmResponseMessage<T> success(String code, T t) {
|
||||
// return new DdmResponseMessage(code, "success", t);
|
||||
// }
|
||||
//
|
||||
// public static <T> DdmResponseMessage<T> success( T t) {
|
||||
// return success("0","success", t);
|
||||
// }
|
||||
//
|
||||
// public static <T> DdmResponseMessage<T> success() {
|
||||
// return success("0","success");
|
||||
// }
|
||||
//
|
||||
// public static <T> DdmResponseMessage<T> success(String code, String message) {
|
||||
// return new DdmResponseMessage(code, message);
|
||||
// }
|
||||
//
|
||||
// public static <T> DdmResponseMessage<T> success(String code, String message, T t) {
|
||||
// return new DdmResponseMessage(code, message, t);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public static DdmResponseMessage error(String message) {
|
||||
// return new DdmResponseMessage("1", message);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -1,327 +1,327 @@
|
||||
package com.adc.da.sys.controller.ddm;
|
||||
|
||||
import com.adc.da.base.page.Pager;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.sys.constant.IsBelongEnum;
|
||||
import com.adc.da.sys.dao.mysql.RoleEODao;
|
||||
import com.adc.da.sys.dao.mysql.UserEODao;
|
||||
import com.adc.da.sys.entity.RoleEO;
|
||||
import com.adc.da.sys.entity.RoleMenuEO;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.entity.UserRoleEO;
|
||||
import com.adc.da.sys.page.RoleEOPage;
|
||||
import com.adc.da.sys.page.RoleMenuEOPage;
|
||||
import com.adc.da.sys.service.MenuEOService;
|
||||
import com.adc.da.sys.service.RoleEOService;
|
||||
import com.adc.da.sys.util.EncryptUtil;
|
||||
import com.adc.da.sys.vo.MenuVO;
|
||||
import com.adc.da.sys.vo.RoleVO;
|
||||
import com.adc.da.sys.vo.UserRoleVO;
|
||||
import com.adc.da.sys.vo.ddm.*;
|
||||
import com.adc.da.util.exception.AdcDaBaseException;
|
||||
import com.adc.da.util.http.PageInfo;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.adc.da.util.utils.BeanMapper;
|
||||
import com.adc.da.util.utils.CollectionUtils;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.shiro.crypto.hash.Hash;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE;
|
||||
|
||||
/**
|
||||
* 角色管理模块相关接口.
|
||||
* 1.分页查询
|
||||
* 2.角色详情
|
||||
* 3.角色列表
|
||||
* 4.新增角色
|
||||
* 5.修改角色
|
||||
* 6.删除角色
|
||||
* 7.配置角色菜单
|
||||
* date 2018/08/15
|
||||
*
|
||||
* @author comments created by Lee Kwanho
|
||||
* @see RoleEOService
|
||||
* @see RoleEO
|
||||
* @see RoleVO
|
||||
* @see RoleEOPage
|
||||
* @see RoleEODao
|
||||
* @see mybatis.mapper.sys
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${portalPath}")
|
||||
@Api(tags = {"ddm-角色类接口"})
|
||||
public class DdmRoleEOController extends BaseController<RoleEO> {
|
||||
|
||||
/**
|
||||
* 日志
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(DdmRoleEOController.class);
|
||||
|
||||
/**
|
||||
* 角色相关Service
|
||||
*/
|
||||
@Resource
|
||||
private RoleEOService roleEOService;
|
||||
|
||||
@Resource
|
||||
private RoleEODao roleEODao;
|
||||
|
||||
@Resource
|
||||
private UserEODao userEODao;
|
||||
|
||||
|
||||
/**
|
||||
* dozer相关,EO间VO转换
|
||||
*/
|
||||
@Resource
|
||||
private BeanMapper beanMapper;
|
||||
|
||||
|
||||
@ApiOperation(value = "|查询角色")
|
||||
@GetMapping("/role/list.do")
|
||||
// @RequiresPermissions("sys:role:list")
|
||||
public DdmResponseMessage<HashMap<String,List<DdmRoleVO>>> list() {
|
||||
List<RoleEO> roleEOList = roleEOService.findAll();
|
||||
List<DdmRoleVO> ddmRoleVOList = new ArrayList<>();
|
||||
for (RoleEO roleEO : roleEOList) {
|
||||
DdmRoleVO ddmRoleVO = new DdmRoleVO(roleEO);
|
||||
ddmRoleVOList.add(ddmRoleVO);
|
||||
}
|
||||
HashMap<String,List<DdmRoleVO>> dataMap = new HashMap<>();
|
||||
dataMap.put("roles",ddmRoleVOList);
|
||||
return DdmResult.success(dataMap);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "|角色创建")
|
||||
@PostMapping(consumes = APPLICATION_JSON_UTF8_VALUE, value = "/role/save.do")
|
||||
// @RequiresPermissions("sys:role:save")
|
||||
public DdmResponseMessage create(@RequestBody DdmRoleCreateVO ddmRoleCreateVO) {
|
||||
if (null == ddmRoleCreateVO || StringUtils.isEmpty(ddmRoleCreateVO.getRoleName())) {
|
||||
return DdmResult.error("角色名称不能为空");
|
||||
}
|
||||
try {
|
||||
RoleEO roleEO = new RoleEO();
|
||||
roleEO.setName(ddmRoleCreateVO.getRoleName());
|
||||
roleEO.setRemarks(ddmRoleCreateVO.getRoleDesc());
|
||||
roleEO = roleEOService.save(roleEO);
|
||||
} catch (Exception e) {
|
||||
logger.error("角色创建失败:", e);
|
||||
return DdmResult.error("角色创建失败:"+e.getMessage());
|
||||
}
|
||||
return DdmResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色修改")
|
||||
@PostMapping(consumes = APPLICATION_JSON_UTF8_VALUE, value = "/role/update.do")
|
||||
// @RequiresPermissions("sys:role:update")
|
||||
public DdmResponseMessage update(@RequestBody DdmRoleVO ddmRoleVO) {
|
||||
if (null == ddmRoleVO || StringUtils.isEmpty(ddmRoleVO.getRoleName()) || StringUtils.isEmpty(ddmRoleVO.getRoleId())) {
|
||||
return DdmResult.error("角色ID和角色名称不能为空");
|
||||
}
|
||||
try {
|
||||
RoleEO roleEO = new RoleEO();
|
||||
roleEO.setId(ddmRoleVO.getRoleId());
|
||||
roleEO.setRemarks(ddmRoleVO.getRoleDesc());
|
||||
roleEO.setName(ddmRoleVO.getRoleName());
|
||||
roleEOService.updateByPrimaryKeySelective(roleEO);
|
||||
return DdmResult.success();
|
||||
} catch (Exception e) {
|
||||
logger.error("角色修改失败:", e);
|
||||
return DdmResult.error("角色修改失败:"+e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除角色,逻辑删除,若角色有对应用户则不能删除
|
||||
*/
|
||||
//todo
|
||||
@ApiOperation(value = "|角色删除")
|
||||
@PostMapping("/role/delete.do")
|
||||
// @RequiresPermissions("sys:role:delete")
|
||||
public DdmResponseMessage delete(@RequestBody HashMap<String, String> query) {
|
||||
|
||||
if (CollectionUtils.isEmpty(query) || StringUtils.isEmpty(query.get("roleCode"))) {
|
||||
return DdmResult.error("角色ID不能为空");
|
||||
}
|
||||
String roleId = query.get("roleCode");
|
||||
try {
|
||||
RoleEO roleEO = roleEOService.selectByPrimaryKey(roleId);
|
||||
if ("管理员".equals(roleEO.getName())) {
|
||||
return DdmResult.error("管理员角色不能删除");
|
||||
}
|
||||
List<UserRoleEO> list = roleEOService.getUserRoleListByRoleId(roleId);
|
||||
// 如果角色有对应用户,则不允许删除
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
return DdmResult.error("该角色有对应用户,不能删除");
|
||||
}
|
||||
roleEOService.delete(roleId);
|
||||
} catch (Exception e) {
|
||||
logger.error("删除角色失败:", e);
|
||||
return DdmResult.error("删除角色失败:"+e.getMessage());
|
||||
}
|
||||
return DdmResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询角色用户")
|
||||
@PostMapping("/role/queryRoleUser.do")
|
||||
public DdmResponseMessage getRoleUsers(@RequestBody DdmRoleUserQuery query) {
|
||||
List<UserRoleVO> list;
|
||||
if (null == query.getPageSize()) {
|
||||
query.setPageSize(10000);
|
||||
}
|
||||
try {
|
||||
PageInfo<UserRoleVO> userInfoPage = roleEOService.getUserInfoPageByRoleId(query);
|
||||
List<DdmUserVO> ddmUserVOList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(userInfoPage.getList())) {
|
||||
userInfoPage.getList().forEach(userRoleVO -> {
|
||||
DdmUserVO ddmUserVO = new DdmUserVO();
|
||||
ddmUserVO.setUserId(userRoleVO.getUserId());
|
||||
ddmUserVO.setUserAccount(userRoleVO.getAccount());
|
||||
ddmUserVO.setUserName(userRoleVO.getUsname());
|
||||
ddmUserVOList.add(ddmUserVO);
|
||||
});
|
||||
}
|
||||
HashMap<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("recordCount", userInfoPage.getCount());
|
||||
resultMap.put("recordPages", userInfoPage.getPageCount());
|
||||
resultMap.put("userList", ddmUserVOList);
|
||||
return DdmResult.success(resultMap);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("查询角色用户失败", e);
|
||||
return DdmResult.error("查询角色用户失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色添加用户")
|
||||
@PostMapping("/role/roleAddUser.do")
|
||||
public DdmResponseMessage saveRoleUsers(@RequestBody DdmUserRoleAdd ddmUserRoleAdd) {
|
||||
if (null==ddmUserRoleAdd){
|
||||
return DdmResult.error("角色添加用户失败:" + "参数不能为空");
|
||||
}
|
||||
List<DdmUserRoleVO> userRoles = ddmUserRoleAdd.getUserRoles();
|
||||
try {
|
||||
userRoles.forEach(ddmUserRoleVO -> {
|
||||
//传参由用户id变成了用户账号,根绝用户id 找出account
|
||||
UserEO ddmUser = userEODao.getDdmUserEOByAccountNotDeleted(ddmUserRoleVO.getUserId());
|
||||
if (null==ddmUser){
|
||||
throw new AdcDaBaseException("角色添加用户失败:" + "用户"+ddmUserRoleVO.getUserId()+"不存在");
|
||||
}
|
||||
UserRoleEO userRoleEO = new UserRoleEO();
|
||||
userRoleEO.setRoleId(ddmUserRoleVO.getRoleId());
|
||||
userRoleEO.setUserId(ddmUser.getUsid());
|
||||
roleEOService.saveRoleUser(userRoleEO);
|
||||
});
|
||||
} catch (Exception e) {
|
||||
logger.error("角色添加用户失败", e);
|
||||
return DdmResult.error("角色添加用户失败:" + e.getMessage());
|
||||
}
|
||||
return DdmResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色删除用户")
|
||||
@PostMapping("/role/roleDelUser.do")
|
||||
public DdmResponseMessage deleteRoleUsers(@RequestBody DdmUserRolesDeleteVO ddmUserRolesDeleteVO) {
|
||||
try {
|
||||
if (null == ddmUserRolesDeleteVO || null == ddmUserRolesDeleteVO.getUserRoles()) {
|
||||
return DdmResult.error("参数不能为空");
|
||||
}
|
||||
List<DdmUserRoleVO> userRoles = ddmUserRolesDeleteVO.getUserRoles();
|
||||
|
||||
List<UserRoleEO> userRoleEOList = new ArrayList<>();
|
||||
userRoles.forEach(ddmUserRoleVO -> {
|
||||
//传参由用户id变成了用户账号,根绝用户id 找出account
|
||||
UserEO ddmUser = userEODao.getDdmUserEOByAccountNotDeleted(ddmUserRoleVO.getUserId());
|
||||
if (null==ddmUser){
|
||||
throw new AdcDaBaseException("角色删除用户失败:" + "用户"+ddmUserRoleVO.getUserId()+"不存在");
|
||||
}
|
||||
UserRoleEO userRoleEO = new UserRoleEO();
|
||||
userRoleEO.setUserId(ddmUser.getUsid());
|
||||
userRoleEO.setRoleId(ddmUserRoleVO.getRoleId());
|
||||
userRoleEOList.add(userRoleEO);
|
||||
});
|
||||
roleEOService.deleteRoleUsers(userRoleEOList);
|
||||
} catch (Exception e) {
|
||||
logger.error("角色删除用户失败", e);
|
||||
return DdmResult.error("角色删除用户失败:" + e.getMessage());
|
||||
}
|
||||
return DdmResult.success();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "查询角色菜单")
|
||||
@PostMapping("/role/queryRoleModel.do")
|
||||
public DdmResponseMessage getRoleMenus(@RequestBody HashMap<String, String> queryMap) {
|
||||
try {
|
||||
if (CollectionUtils.isEmpty(queryMap) || StringUtils.isEmpty(queryMap.get("roleId"))) {
|
||||
return DdmResult.error("参数不能为空");
|
||||
}
|
||||
String roleId = queryMap.get("roleId");
|
||||
List<DdmMenuVO> roleMenuEOList = roleEOService.getRoleMenuInfoList(roleId);
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
dataMap.put("modelList", roleMenuEOList);
|
||||
return DdmResult.success(dataMap);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("查询角色菜单失败", e);
|
||||
return DdmResult.error("查询角色菜单失败:" + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色添加菜单")
|
||||
@PostMapping("/role/roleAddModel.do")
|
||||
public DdmResponseMessage addRoleMenus(@RequestBody DdmRoleMenuCreate ddmRoleMenuCreate) {
|
||||
if (null==ddmRoleMenuCreate ||CollectionUtils.isEmpty( ddmRoleMenuCreate.getRoleModels())) {
|
||||
return DdmResult.error("参数不能为空");
|
||||
}
|
||||
try {
|
||||
List<DdmRoleMenuCreateVO> roleModels = ddmRoleMenuCreate.getRoleModels();
|
||||
roleEOService.saveRoleMenuByDdm(roleModels);
|
||||
return DdmResult.success();
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("角色添加菜单失败", e);
|
||||
return DdmResult.error("角色添加菜单失败:" + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色删除菜单")
|
||||
@PostMapping("/role/roleDelModel.do")
|
||||
public DdmResponseMessage deleteRoleMenus(@RequestBody DdmRoleMenuDelete ddmRoleMenuDelete) {
|
||||
try {
|
||||
if (null==ddmRoleMenuDelete ||CollectionUtils.isEmpty( ddmRoleMenuDelete.getRoleModels())) {
|
||||
return DdmResult.error("参数不能为空");
|
||||
}
|
||||
List<DdmRoleMenuCreateVO> roleModels = ddmRoleMenuDelete.getRoleModels();
|
||||
for (DdmRoleMenuCreateVO ddmRoleMenuCreateVO : roleModels) {
|
||||
/*新增角色关联*/
|
||||
roleEODao.deleteRoleMenu(ddmRoleMenuCreateVO.getRoleId(), ddmRoleMenuCreateVO.getModelId());
|
||||
}
|
||||
return DdmResult.success();
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("角色删除菜单失败", e);
|
||||
return DdmResult.error("角色删除菜单失败:" + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//package com.adc.da.sys.controller.ddm;
|
||||
//
|
||||
//import com.adc.da.base.page.Pager;
|
||||
//import com.adc.da.base.web.BaseController;
|
||||
//import com.adc.da.sys.constant.IsBelongEnum;
|
||||
//import com.adc.da.sys.dao.mysql.RoleEODao;
|
||||
//import com.adc.da.sys.dao.mysql.UserEODao;
|
||||
//import com.adc.da.sys.entity.RoleEO;
|
||||
//import com.adc.da.sys.entity.RoleMenuEO;
|
||||
//import com.adc.da.sys.entity.UserEO;
|
||||
//import com.adc.da.sys.entity.UserRoleEO;
|
||||
//import com.adc.da.sys.page.RoleEOPage;
|
||||
//import com.adc.da.sys.page.RoleMenuEOPage;
|
||||
//import com.adc.da.sys.service.MenuEOService;
|
||||
//import com.adc.da.sys.service.RoleEOService;
|
||||
//import com.adc.da.sys.util.EncryptUtil;
|
||||
//import com.adc.da.sys.vo.MenuVO;
|
||||
//import com.adc.da.sys.vo.RoleVO;
|
||||
//import com.adc.da.sys.vo.UserRoleVO;
|
||||
//import com.adc.da.sys.vo.ddm.*;
|
||||
//import com.adc.da.util.exception.AdcDaBaseException;
|
||||
//import com.adc.da.util.http.PageInfo;
|
||||
//import com.adc.da.util.http.ResponseMessage;
|
||||
//import com.adc.da.util.http.Result;
|
||||
//import com.adc.da.util.utils.BeanMapper;
|
||||
//import com.adc.da.util.utils.CollectionUtils;
|
||||
//import com.adc.da.util.utils.StringUtils;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import org.apache.shiro.crypto.hash.Hash;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import javax.annotation.Resource;
|
||||
//import org.springframework.validation.annotation.Validated;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//import javax.validation.constraints.NotBlank;
|
||||
//import javax.validation.constraints.NotNull;
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.HashMap;
|
||||
//import java.util.List;
|
||||
//
|
||||
//import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE;
|
||||
//
|
||||
///**
|
||||
// * 角色管理模块相关接口.
|
||||
// * 1.分页查询
|
||||
// * 2.角色详情
|
||||
// * 3.角色列表
|
||||
// * 4.新增角色
|
||||
// * 5.修改角色
|
||||
// * 6.删除角色
|
||||
// * 7.配置角色菜单
|
||||
// * date 2018/08/15
|
||||
// *
|
||||
// * @author comments created by Lee Kwanho
|
||||
// * @see RoleEOService
|
||||
// * @see RoleEO
|
||||
// * @see RoleVO
|
||||
// * @see RoleEOPage
|
||||
// * @see RoleEODao
|
||||
// * @see mybatis.mapper.sys
|
||||
// */
|
||||
//@RestController
|
||||
//@RequestMapping("/${portalPath}")
|
||||
//@Api(tags = {"ddm-角色类接口"})
|
||||
//public class DdmRoleEOController extends BaseController<RoleEO> {
|
||||
//
|
||||
// /**
|
||||
// * 日志
|
||||
// */
|
||||
// private static final Logger logger = LoggerFactory.getLogger(DdmRoleEOController.class);
|
||||
//
|
||||
// /**
|
||||
// * 角色相关Service
|
||||
// */
|
||||
// @Resource
|
||||
// private RoleEOService roleEOService;
|
||||
//
|
||||
// @Resource
|
||||
// private RoleEODao roleEODao;
|
||||
//
|
||||
// @Resource
|
||||
// private UserEODao userEODao;
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * dozer相关,EO间VO转换
|
||||
// */
|
||||
// @Resource
|
||||
// private BeanMapper beanMapper;
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value = "|查询角色")
|
||||
// @GetMapping("/role/list.do")
|
||||
//// @RequiresPermissions("sys:role:list")
|
||||
// public DdmResponseMessage<HashMap<String,List<DdmRoleVO>>> list() {
|
||||
// List<RoleEO> roleEOList = roleEOService.findAll();
|
||||
// List<DdmRoleVO> ddmRoleVOList = new ArrayList<>();
|
||||
// for (RoleEO roleEO : roleEOList) {
|
||||
// DdmRoleVO ddmRoleVO = new DdmRoleVO(roleEO);
|
||||
// ddmRoleVOList.add(ddmRoleVO);
|
||||
// }
|
||||
// HashMap<String,List<DdmRoleVO>> dataMap = new HashMap<>();
|
||||
// dataMap.put("roles",ddmRoleVOList);
|
||||
// return DdmResult.success(dataMap);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value = "|角色创建")
|
||||
// @PostMapping(consumes = APPLICATION_JSON_UTF8_VALUE, value = "/role/save.do")
|
||||
//// @RequiresPermissions("sys:role:save")
|
||||
// public DdmResponseMessage create(@RequestBody DdmRoleCreateVO ddmRoleCreateVO) {
|
||||
// if (null == ddmRoleCreateVO || StringUtils.isEmpty(ddmRoleCreateVO.getRoleName())) {
|
||||
// return DdmResult.error("角色名称不能为空");
|
||||
// }
|
||||
// try {
|
||||
// RoleEO roleEO = new RoleEO();
|
||||
// roleEO.setName(ddmRoleCreateVO.getRoleName());
|
||||
// roleEO.setRemarks(ddmRoleCreateVO.getRoleDesc());
|
||||
// roleEO = roleEOService.save(roleEO);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("角色创建失败:", e);
|
||||
// return DdmResult.error("角色创建失败:"+e.getMessage());
|
||||
// }
|
||||
// return DdmResult.success();
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "角色修改")
|
||||
// @PostMapping(consumes = APPLICATION_JSON_UTF8_VALUE, value = "/role/update.do")
|
||||
//// @RequiresPermissions("sys:role:update")
|
||||
// public DdmResponseMessage update(@RequestBody DdmRoleVO ddmRoleVO) {
|
||||
// if (null == ddmRoleVO || StringUtils.isEmpty(ddmRoleVO.getRoleName()) || StringUtils.isEmpty(ddmRoleVO.getRoleId())) {
|
||||
// return DdmResult.error("角色ID和角色名称不能为空");
|
||||
// }
|
||||
// try {
|
||||
// RoleEO roleEO = new RoleEO();
|
||||
// roleEO.setId(ddmRoleVO.getRoleId());
|
||||
// roleEO.setRemarks(ddmRoleVO.getRoleDesc());
|
||||
// roleEO.setName(ddmRoleVO.getRoleName());
|
||||
// roleEOService.updateByPrimaryKeySelective(roleEO);
|
||||
// return DdmResult.success();
|
||||
// } catch (Exception e) {
|
||||
// logger.error("角色修改失败:", e);
|
||||
// return DdmResult.error("角色修改失败:"+e.getMessage());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除角色,逻辑删除,若角色有对应用户则不能删除
|
||||
// */
|
||||
// //todo
|
||||
// @ApiOperation(value = "|角色删除")
|
||||
// @PostMapping("/role/delete.do")
|
||||
//// @RequiresPermissions("sys:role:delete")
|
||||
// public DdmResponseMessage delete(@RequestBody HashMap<String, String> query) {
|
||||
//
|
||||
// if (CollectionUtils.isEmpty(query) || StringUtils.isEmpty(query.get("roleCode"))) {
|
||||
// return DdmResult.error("角色ID不能为空");
|
||||
// }
|
||||
// String roleId = query.get("roleCode");
|
||||
// try {
|
||||
// RoleEO roleEO = roleEOService.selectByPrimaryKey(roleId);
|
||||
// if ("管理员".equals(roleEO.getName())) {
|
||||
// return DdmResult.error("管理员角色不能删除");
|
||||
// }
|
||||
// List<UserRoleEO> list = roleEOService.getUserRoleListByRoleId(roleId);
|
||||
// // 如果角色有对应用户,则不允许删除
|
||||
// if (CollectionUtils.isNotEmpty(list)) {
|
||||
// return DdmResult.error("该角色有对应用户,不能删除");
|
||||
// }
|
||||
// roleEOService.delete(roleId);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("删除角色失败:", e);
|
||||
// return DdmResult.error("删除角色失败:"+e.getMessage());
|
||||
// }
|
||||
// return DdmResult.success();
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "查询角色用户")
|
||||
// @PostMapping("/role/queryRoleUser.do")
|
||||
// public DdmResponseMessage getRoleUsers(@RequestBody DdmRoleUserQuery query) {
|
||||
// List<UserRoleVO> list;
|
||||
// if (null == query.getPageSize()) {
|
||||
// query.setPageSize(10000);
|
||||
// }
|
||||
// try {
|
||||
// PageInfo<UserRoleVO> userInfoPage = roleEOService.getUserInfoPageByRoleId(query);
|
||||
// List<DdmUserVO> ddmUserVOList = new ArrayList<>();
|
||||
// if (CollectionUtils.isNotEmpty(userInfoPage.getList())) {
|
||||
// userInfoPage.getList().forEach(userRoleVO -> {
|
||||
// DdmUserVO ddmUserVO = new DdmUserVO();
|
||||
// ddmUserVO.setUserId(userRoleVO.getUserId());
|
||||
// ddmUserVO.setUserAccount(userRoleVO.getAccount());
|
||||
// ddmUserVO.setUserName(userRoleVO.getUsname());
|
||||
// ddmUserVOList.add(ddmUserVO);
|
||||
// });
|
||||
// }
|
||||
// HashMap<String, Object> resultMap = new HashMap<>();
|
||||
// resultMap.put("recordCount", userInfoPage.getCount());
|
||||
// resultMap.put("recordPages", userInfoPage.getPageCount());
|
||||
// resultMap.put("userList", ddmUserVOList);
|
||||
// return DdmResult.success(resultMap);
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// logger.error("查询角色用户失败", e);
|
||||
// return DdmResult.error("查询角色用户失败:" + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "角色添加用户")
|
||||
// @PostMapping("/role/roleAddUser.do")
|
||||
// public DdmResponseMessage saveRoleUsers(@RequestBody DdmUserRoleAdd ddmUserRoleAdd) {
|
||||
// if (null==ddmUserRoleAdd){
|
||||
// return DdmResult.error("角色添加用户失败:" + "参数不能为空");
|
||||
// }
|
||||
// List<DdmUserRoleVO> userRoles = ddmUserRoleAdd.getUserRoles();
|
||||
// try {
|
||||
// userRoles.forEach(ddmUserRoleVO -> {
|
||||
// //传参由用户id变成了用户账号,根绝用户id 找出account
|
||||
// UserEO ddmUser = userEODao.getDdmUserEOByAccountNotDeleted(ddmUserRoleVO.getUserId());
|
||||
// if (null==ddmUser){
|
||||
// throw new AdcDaBaseException("角色添加用户失败:" + "用户"+ddmUserRoleVO.getUserId()+"不存在");
|
||||
// }
|
||||
// UserRoleEO userRoleEO = new UserRoleEO();
|
||||
// userRoleEO.setRoleId(ddmUserRoleVO.getRoleId());
|
||||
// userRoleEO.setUserId(ddmUser.getUsid());
|
||||
// roleEOService.saveRoleUser(userRoleEO);
|
||||
// });
|
||||
// } catch (Exception e) {
|
||||
// logger.error("角色添加用户失败", e);
|
||||
// return DdmResult.error("角色添加用户失败:" + e.getMessage());
|
||||
// }
|
||||
// return DdmResult.success();
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "角色删除用户")
|
||||
// @PostMapping("/role/roleDelUser.do")
|
||||
// public DdmResponseMessage deleteRoleUsers(@RequestBody DdmUserRolesDeleteVO ddmUserRolesDeleteVO) {
|
||||
// try {
|
||||
// if (null == ddmUserRolesDeleteVO || null == ddmUserRolesDeleteVO.getUserRoles()) {
|
||||
// return DdmResult.error("参数不能为空");
|
||||
// }
|
||||
// List<DdmUserRoleVO> userRoles = ddmUserRolesDeleteVO.getUserRoles();
|
||||
//
|
||||
// List<UserRoleEO> userRoleEOList = new ArrayList<>();
|
||||
// userRoles.forEach(ddmUserRoleVO -> {
|
||||
// //传参由用户id变成了用户账号,根绝用户id 找出account
|
||||
// UserEO ddmUser = userEODao.getDdmUserEOByAccountNotDeleted(ddmUserRoleVO.getUserId());
|
||||
// if (null==ddmUser){
|
||||
// throw new AdcDaBaseException("角色删除用户失败:" + "用户"+ddmUserRoleVO.getUserId()+"不存在");
|
||||
// }
|
||||
// UserRoleEO userRoleEO = new UserRoleEO();
|
||||
// userRoleEO.setUserId(ddmUser.getUsid());
|
||||
// userRoleEO.setRoleId(ddmUserRoleVO.getRoleId());
|
||||
// userRoleEOList.add(userRoleEO);
|
||||
// });
|
||||
// roleEOService.deleteRoleUsers(userRoleEOList);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("角色删除用户失败", e);
|
||||
// return DdmResult.error("角色删除用户失败:" + e.getMessage());
|
||||
// }
|
||||
// return DdmResult.success();
|
||||
// }
|
||||
//
|
||||
//
|
||||
// @ApiOperation(value = "查询角色菜单")
|
||||
// @PostMapping("/role/queryRoleModel.do")
|
||||
// public DdmResponseMessage getRoleMenus(@RequestBody HashMap<String, String> queryMap) {
|
||||
// try {
|
||||
// if (CollectionUtils.isEmpty(queryMap) || StringUtils.isEmpty(queryMap.get("roleId"))) {
|
||||
// return DdmResult.error("参数不能为空");
|
||||
// }
|
||||
// String roleId = queryMap.get("roleId");
|
||||
// List<DdmMenuVO> roleMenuEOList = roleEOService.getRoleMenuInfoList(roleId);
|
||||
// HashMap<String, Object> dataMap = new HashMap<>();
|
||||
// dataMap.put("modelList", roleMenuEOList);
|
||||
// return DdmResult.success(dataMap);
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// logger.error("查询角色菜单失败", e);
|
||||
// return DdmResult.error("查询角色菜单失败:" + e.getMessage());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "角色添加菜单")
|
||||
// @PostMapping("/role/roleAddModel.do")
|
||||
// public DdmResponseMessage addRoleMenus(@RequestBody DdmRoleMenuCreate ddmRoleMenuCreate) {
|
||||
// if (null==ddmRoleMenuCreate ||CollectionUtils.isEmpty( ddmRoleMenuCreate.getRoleModels())) {
|
||||
// return DdmResult.error("参数不能为空");
|
||||
// }
|
||||
// try {
|
||||
// List<DdmRoleMenuCreateVO> roleModels = ddmRoleMenuCreate.getRoleModels();
|
||||
// roleEOService.saveRoleMenuByDdm(roleModels);
|
||||
// return DdmResult.success();
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// logger.error("角色添加菜单失败", e);
|
||||
// return DdmResult.error("角色添加菜单失败:" + e.getMessage());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @ApiOperation(value = "角色删除菜单")
|
||||
// @PostMapping("/role/roleDelModel.do")
|
||||
// public DdmResponseMessage deleteRoleMenus(@RequestBody DdmRoleMenuDelete ddmRoleMenuDelete) {
|
||||
// try {
|
||||
// if (null==ddmRoleMenuDelete ||CollectionUtils.isEmpty( ddmRoleMenuDelete.getRoleModels())) {
|
||||
// return DdmResult.error("参数不能为空");
|
||||
// }
|
||||
// List<DdmRoleMenuCreateVO> roleModels = ddmRoleMenuDelete.getRoleModels();
|
||||
// for (DdmRoleMenuCreateVO ddmRoleMenuCreateVO : roleModels) {
|
||||
// /*新增角色关联*/
|
||||
// roleEODao.deleteRoleMenu(ddmRoleMenuCreateVO.getRoleId(), ddmRoleMenuCreateVO.getModelId());
|
||||
// }
|
||||
// return DdmResult.success();
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// logger.error("角色删除菜单失败", e);
|
||||
// return DdmResult.error("角色删除菜单失败:" + e.getMessage());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//}
|
||||
//
|
||||
|
||||
@@ -1,71 +1,71 @@
|
||||
package com.adc.da.sys.controller.ddm;
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.service.iservice.IUserEoService;
|
||||
import com.adc.da.sys.util.EncryptUtil;
|
||||
import com.adc.da.sys.util.RSAUtil;
|
||||
import com.adc.da.sys.vo.UserRoleVO;
|
||||
import com.adc.da.sys.vo.UserVO;
|
||||
import com.adc.da.sys.vo.ddm.DdmUserQueryVO;
|
||||
import com.adc.da.sys.vo.ddm.DdmUserVO;
|
||||
import com.adc.da.util.http.PageInfo;
|
||||
import com.adc.da.util.http.ResponseMessage;
|
||||
import com.adc.da.util.http.Result;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/${portalPath}")
|
||||
@Api(tags = {"ddm-用户类接口"})
|
||||
@Slf4j
|
||||
public class DdmUserEOController extends BaseController<UserEO> {
|
||||
//package com.adc.da.sys.controller.ddm;
|
||||
//
|
||||
@Resource
|
||||
private IUserEoService userEOService;
|
||||
|
||||
/**
|
||||
* 日志
|
||||
*/
|
||||
private static final Logger logger = LoggerFactory.getLogger(DdmUserEOController.class);
|
||||
|
||||
@ApiOperation("查询用户")
|
||||
@PostMapping("/user/list.do")
|
||||
public DdmResponseMessage list(@RequestBody DdmUserQueryVO userQueryVO){
|
||||
try {
|
||||
if (null==userQueryVO.getPageSize()){
|
||||
userQueryVO.setPageSize(100000);
|
||||
}
|
||||
PageInfo<DdmUserVO> userPage = userEOService.getUserPage(userQueryVO);
|
||||
HashMap<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("recordCount", userPage.getCount());
|
||||
resultMap.put("recordPages", userPage.getPageCount());
|
||||
resultMap.put("userList", userPage.getList());
|
||||
return DdmResult.success(resultMap);
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("查询角色用户失败", e);
|
||||
return DdmResult.error("查询角色用户失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//import com.adc.da.base.web.BaseController;
|
||||
//import com.adc.da.sys.entity.UserEO;
|
||||
//import com.adc.da.sys.service.iservice.IUserEoService;
|
||||
//import com.adc.da.sys.util.EncryptUtil;
|
||||
//import com.adc.da.sys.util.RSAUtil;
|
||||
//import com.adc.da.sys.vo.UserRoleVO;
|
||||
//import com.adc.da.sys.vo.UserVO;
|
||||
//import com.adc.da.sys.vo.ddm.DdmUserQueryVO;
|
||||
//import com.adc.da.sys.vo.ddm.DdmUserVO;
|
||||
//import com.adc.da.util.http.PageInfo;
|
||||
//import com.adc.da.util.http.ResponseMessage;
|
||||
//import com.adc.da.util.http.Result;
|
||||
//import com.adc.da.util.utils.StringUtils;
|
||||
//import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
//import com.google.gson.Gson;
|
||||
//import com.google.gson.JsonElement;
|
||||
//import com.google.gson.JsonParser;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.apache.commons.codec.binary.Base64;
|
||||
//import org.slf4j.Logger;
|
||||
//import org.slf4j.LoggerFactory;
|
||||
//import javax.annotation.Resource;
|
||||
//import org.springframework.beans.factory.annotation.Value;
|
||||
//import org.springframework.transaction.annotation.Transactional;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//import java.nio.charset.StandardCharsets;
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.HashMap;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//
|
||||
//@RestController
|
||||
//@RequestMapping("/${portalPath}")
|
||||
//@Api(tags = {"ddm-用户类接口"})
|
||||
//@Slf4j
|
||||
//public class DdmUserEOController extends BaseController<UserEO> {
|
||||
////
|
||||
// @Resource
|
||||
// private IUserEoService userEOService;
|
||||
//
|
||||
// /**
|
||||
// * 日志
|
||||
// */
|
||||
// private static final Logger logger = LoggerFactory.getLogger(DdmUserEOController.class);
|
||||
//
|
||||
// @ApiOperation("查询用户")
|
||||
// @PostMapping("/user/list.do")
|
||||
// public DdmResponseMessage list(@RequestBody DdmUserQueryVO userQueryVO){
|
||||
// try {
|
||||
// if (null==userQueryVO.getPageSize()){
|
||||
// userQueryVO.setPageSize(100000);
|
||||
// }
|
||||
// PageInfo<DdmUserVO> userPage = userEOService.getUserPage(userQueryVO);
|
||||
// HashMap<String, Object> resultMap = new HashMap<>();
|
||||
// resultMap.put("recordCount", userPage.getCount());
|
||||
// resultMap.put("recordPages", userPage.getPageCount());
|
||||
// resultMap.put("userList", userPage.getList());
|
||||
// return DdmResult.success(resultMap);
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// logger.error("查询角色用户失败", e);
|
||||
// return DdmResult.error("查询角色用户失败:" + e.getMessage());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
package com.adc.da.sys.dao.mysql;
|
||||
|
||||
import com.adc.da.base.dao.BaseDao;
|
||||
import com.adc.da.sys.entity.MenuEO;
|
||||
import com.adc.da.sys.entity.RoleHomeEO;
|
||||
import com.adc.da.sys.entity.RoleMenuEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* <br>
|
||||
* <b>功能:</b>TR_ROLE_MENU RoleMenuEODao<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2019-09-02 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
public interface RoleHomeEODao extends BaseMapper<RoleHomeEO> {
|
||||
|
||||
void insertRoleHomeBatch(@Param("rhList")List<RoleMenuEO> list);
|
||||
|
||||
List<MenuEO> getHomeListByRoleId(@Param("roleId")String roleId);
|
||||
|
||||
}
|
||||
//package com.adc.da.sys.dao.mysql;
|
||||
//
|
||||
//import com.adc.da.base.dao.BaseDao;
|
||||
//import com.adc.da.sys.entity.MenuEO;
|
||||
//import com.adc.da.sys.entity.RoleHomeEO;
|
||||
//import com.adc.da.sys.entity.RoleMenuEO;
|
||||
//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
//import org.apache.ibatis.annotations.Param;
|
||||
//
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// *
|
||||
// * <br>
|
||||
// * <b>功能:</b>TR_ROLE_MENU RoleMenuEODao<br>
|
||||
// * <b>作者:</b>code generator<br>
|
||||
// * <b>日期:</b> 2019-09-02 <br>
|
||||
// * <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
// */
|
||||
//public interface RoleHomeEODao extends BaseMapper<RoleHomeEO> {
|
||||
//
|
||||
// void insertRoleHomeBatch(@Param("rhList")List<RoleMenuEO> list);
|
||||
//
|
||||
// List<MenuEO> getHomeListByRoleId(@Param("roleId")String roleId);
|
||||
//
|
||||
//}
|
||||
|
||||
@@ -60,8 +60,8 @@ public class RoleEOService extends BaseService<RoleEO, String> {
|
||||
return dao;
|
||||
}
|
||||
|
||||
@Resource
|
||||
private RoleHomeEODao roleHomeEODao;
|
||||
// @Resource
|
||||
// private RoleHomeEODao roleHomeEODao;
|
||||
|
||||
@Resource
|
||||
private RoleMenuEODao roleMenuEODao;
|
||||
@@ -259,83 +259,88 @@ public class RoleEOService extends BaseService<RoleEO, String> {
|
||||
return dao.getRoleByCode(roleCode);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveRoleHome(RoleEO roleEO) {
|
||||
if (roleEO.getMenuEOIdList() == null || roleEO.getMenuEOIdList().size() == 0) {
|
||||
//将首页展示默认调整成角色菜单
|
||||
roleHomeEODao.delete(new QueryWrapper<RoleHomeEO>().eq("ROLEID", roleEO.getId()));
|
||||
List<RoleMenuEO> roleMenuList = roleMenuEODao.getRoleMenuList(roleEO.getId());
|
||||
roleHomeEODao.insertRoleHomeBatch(roleMenuList);
|
||||
} else {
|
||||
roleHomeEODao.delete(new QueryWrapper<RoleHomeEO>().eq("ROLEID", roleEO.getId()));
|
||||
List<RoleMenuEO> rmList = new ArrayList<>();
|
||||
roleEO.getMenuEOIdList().forEach(c -> {
|
||||
RoleMenuEO roleMenuEO = new RoleMenuEO();
|
||||
roleMenuEO.setRoleId(roleEO.getId());
|
||||
roleMenuEO.setMenuId(c);
|
||||
rmList.add(roleMenuEO);
|
||||
});
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void saveRoleHome(RoleEO roleEO) {
|
||||
// if (roleEO.getMenuEOIdList() == null || roleEO.getMenuEOIdList().size() == 0) {
|
||||
// //将首页展示默认调整成角色菜单
|
||||
// roleHomeEODao.delete(new QueryWrapper<RoleHomeEO>().eq("ROLEID", roleEO.getId()));
|
||||
// List<RoleMenuEO> roleMenuList = roleMenuEODao.getRoleMenuList(roleEO.getId());
|
||||
// roleHomeEODao.insertRoleHomeBatch(roleMenuList);
|
||||
// } else {
|
||||
// roleHomeEODao.delete(new QueryWrapper<RoleHomeEO>().eq("ROLEID", roleEO.getId()));
|
||||
// List<RoleMenuEO> rmList = new ArrayList<>();
|
||||
// roleEO.getMenuEOIdList().forEach(c -> {
|
||||
// RoleMenuEO roleMenuEO = new RoleMenuEO();
|
||||
// roleMenuEO.setRoleId(roleEO.getId());
|
||||
// roleMenuEO.setMenuId(c);
|
||||
// rmList.add(roleMenuEO);
|
||||
// });
|
||||
//
|
||||
// roleHomeEODao.insertRoleHomeBatch(rmList);
|
||||
// }
|
||||
// }
|
||||
|
||||
roleHomeEODao.insertRoleHomeBatch(rmList);
|
||||
}
|
||||
}
|
||||
|
||||
public List<MenuVO> getHomeMenu(String roleId) throws Exception {
|
||||
if (StringUtils.isEmpty(roleId)) {
|
||||
return new ArrayList<MenuVO>();
|
||||
}
|
||||
List<MenuEO> homeMenuList = roleHomeEODao.getHomeListByRoleId(roleId);
|
||||
List<MenuEO> roleMenuList=menuEODao.listMenuEOByRoleId(roleId);
|
||||
|
||||
List<String> idList = roleMenuList.stream().map(MenuEO::getId).collect(Collectors.toList());
|
||||
//已分配好的菜单权限为基础,`找出其中的配置首页
|
||||
|
||||
RoleEO roleEO = selectByPrimaryKey(roleId);
|
||||
List<MenuVO> allList;
|
||||
if ("管理员".equals(roleEO.getName())) {
|
||||
//管理员返回所有菜单权限
|
||||
allList = beanMapper.mapList(menuEODao.findAll(), MenuVO.class);
|
||||
allList.forEach(c -> {
|
||||
c.setBelong(1);
|
||||
});
|
||||
} else {
|
||||
allList = beanMapper.mapList(homeMenuList, MenuVO.class);
|
||||
allList.forEach(c -> {
|
||||
if (idList.contains(c.getId())) {
|
||||
c.setBelong(1);
|
||||
} else {
|
||||
c.setBelong(0);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
return allList;
|
||||
}
|
||||
// public List<MenuVO> getRoleMenu(String roleId) throws Exception {
|
||||
// if (StringUtils.isEmpty(roleId)) {
|
||||
// return new ArrayList<MenuVO>();
|
||||
// }
|
||||
//// List<MenuEO> homeMenuList = roleHomeEODao.getHomeListByRoleId(roleId);
|
||||
//
|
||||
//
|
||||
////
|
||||
// //已分配好的菜单权限为基础,`找出其中的配置首页
|
||||
//
|
||||
// RoleEO roleEO = selectByPrimaryKey(roleId);
|
||||
//
|
||||
//
|
||||
// List<MenuVO> allList;
|
||||
// if ("管理员".equals(roleEO.getName())) {
|
||||
// //管理员返回所有菜单权限
|
||||
// allList = beanMapper.mapList(menuEODao.findAll(), MenuVO.class);
|
||||
// allList.forEach(c -> {
|
||||
// c.setBelong(1);
|
||||
// });
|
||||
// } else {
|
||||
// List<MenuEO> roleMenuList=menuEODao.listMenuEOByRoleId(roleId);
|
||||
// List<String> idList = roleMenuList.stream().map(MenuEO::getId).collect(Collectors.toList());
|
||||
//
|
||||
// allList = beanMapper.mapList(roleMenuList, MenuVO.class);
|
||||
// allList.forEach(c -> {
|
||||
// if (idList.contains(c.getId())) {
|
||||
// c.setBelong(1);
|
||||
// } else {
|
||||
// c.setBelong(0);
|
||||
// }
|
||||
//
|
||||
// });
|
||||
// }
|
||||
// return allList;
|
||||
// }
|
||||
|
||||
//角色添加用户
|
||||
public int saveRoleUser(UserRoleEO userRoleEO) {
|
||||
QueryWrapper<UserRoleEO> queryWrapper1 = new QueryWrapper<UserRoleEO>().eq("USER_ID", userRoleEO.getUserId()).eq("ROLE_ID", userRoleEO.getRoleId());
|
||||
List<UserRoleEO> userRoleEOS1 = userRoleEODao.selectList(queryWrapper1);
|
||||
if (userRoleEOS1.size() > 0) {
|
||||
throw new AdcDaBaseException("此角色下该用户已存在,请不要重复添加");
|
||||
}
|
||||
//因为系统用户角色1对一 ,所以删除原先角色
|
||||
QueryWrapper<UserRoleEO> queryWrapper2 = new QueryWrapper<UserRoleEO>().eq("USER_ID", userRoleEO.getUserId());
|
||||
userRoleEODao.delete(queryWrapper2);
|
||||
|
||||
return userRoleEODao.insert(userRoleEO);
|
||||
}
|
||||
|
||||
//角色删除用户
|
||||
public int deleteRoleUsers(List<UserRoleEO> userRoleEOList) {
|
||||
int i = 0;
|
||||
for (UserRoleEO userRoleEO : userRoleEOList) {
|
||||
userRoleEODao.delete(new QueryWrapper<UserRoleEO>().eq("USER_ID", userRoleEO.getUserId()).eq("ROLE_ID", userRoleEO.getRoleId()));
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
public List<DdmMenuVO> getRoleMenuInfoList(@Param("roleId") String roleId) {
|
||||
return roleMenuEODao.getRoleMenuInfoList(roleId);
|
||||
}
|
||||
// public int saveRoleUser(UserRoleEO userRoleEO) {
|
||||
// QueryWrapper<UserRoleEO> queryWrapper1 = new QueryWrapper<UserRoleEO>().eq("USER_ID", userRoleEO.getUserId()).eq("ROLE_ID", userRoleEO.getRoleId());
|
||||
// List<UserRoleEO> userRoleEOS1 = userRoleEODao.selectList(queryWrapper1);
|
||||
// if (userRoleEOS1.size() > 0) {
|
||||
// throw new AdcDaBaseException("此角色下该用户已存在,请不要重复添加");
|
||||
// }
|
||||
// //因为系统用户角色1对一 ,所以删除原先角色
|
||||
// QueryWrapper<UserRoleEO> queryWrapper2 = new QueryWrapper<UserRoleEO>().eq("USER_ID", userRoleEO.getUserId());
|
||||
// userRoleEODao.delete(queryWrapper2);
|
||||
//
|
||||
// return userRoleEODao.insert(userRoleEO);
|
||||
// }
|
||||
//
|
||||
// //角色删除用户
|
||||
// public int deleteRoleUsers(List<UserRoleEO> userRoleEOList) {
|
||||
// int i = 0;
|
||||
// for (UserRoleEO userRoleEO : userRoleEOList) {
|
||||
// userRoleEODao.delete(new QueryWrapper<UserRoleEO>().eq("USER_ID", userRoleEO.getUserId()).eq("ROLE_ID", userRoleEO.getRoleId()));
|
||||
// }
|
||||
// return i;
|
||||
// }
|
||||
//
|
||||
// public List<DdmMenuVO> getRoleMenuInfoList(@Param("roleId") String roleId) {
|
||||
// return roleMenuEODao.getRoleMenuInfoList(roleId);
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -18,16 +18,6 @@ public class CompressUtil {
|
||||
if (!file.exists()) {
|
||||
throw new Exception("路径 " + path + " 不存在文件,无法进行压缩...");
|
||||
}
|
||||
// 用于存放压缩文件的文件夹
|
||||
// String generateFile = file.getParent() + File.separator + "CompressFile";
|
||||
// File compress = new File(generateFile);
|
||||
// // 如果文件夹不存在,进行创建
|
||||
// if (!compress.exists()) {
|
||||
// compress.mkdirs();
|
||||
// }
|
||||
//
|
||||
// // 目的压缩文件
|
||||
// String generateFileName = compress.getAbsolutePath() + File.separator + "AAA" + file.getName() + "." + format;
|
||||
|
||||
String generateFileName="/Users/sxh/test.rar";
|
||||
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
package com.adc.da.sys.vo;
|
||||
|
||||
public class ModuleVo{
|
||||
private String id;
|
||||
|
||||
private String moduleName;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getModuleName() {
|
||||
return moduleName;
|
||||
}
|
||||
|
||||
public void setModuleName(String moduleName) {
|
||||
this.moduleName = moduleName;
|
||||
}
|
||||
}
|
||||
//package com.adc.da.sys.vo;
|
||||
//
|
||||
//public class ModuleVo{
|
||||
// private String id;
|
||||
//
|
||||
// private String moduleName;
|
||||
//
|
||||
// public String getId() {
|
||||
// return id;
|
||||
// }
|
||||
//
|
||||
// public void setId(String id) {
|
||||
// this.id = id;
|
||||
// }
|
||||
//
|
||||
// public String getModuleName() {
|
||||
// return moduleName;
|
||||
// }
|
||||
//
|
||||
// public void setModuleName(String moduleName) {
|
||||
// this.moduleName = moduleName;
|
||||
// }
|
||||
//}
|
||||
@@ -31,13 +31,13 @@
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="getHomeListByRoleId" parameterType="string" resultMap="BaseResultMap">
|
||||
select t4.id, t4.del_flag, t4.name,t4. parent_id, t4.parent_ids, t4.href, t4.icon,t4.iconHref,t4.iconClick,t4.iconClickHref
|
||||
, t4.is_show, t4.permission, t4.remarks, t4.sort, t4.ext_info,t4.is_url
|
||||
from tr_role_home t3
|
||||
inner join ts_menu t4 on t3.menuId=t4.ID
|
||||
<if test="roleId!='' and roleId!=null">
|
||||
where t3.roleId=#{roleId}
|
||||
</if>
|
||||
</select>
|
||||
<!-- <select id="getHomeListByRoleId" parameterType="string" resultMap="BaseResultMap">-->
|
||||
<!-- select t4.id, t4.del_flag, t4.name,t4. parent_id, t4.parent_ids, t4.href, t4.icon,t4.iconHref,t4.iconClick,t4.iconClickHref-->
|
||||
<!-- , t4.is_show, t4.permission, t4.remarks, t4.sort, t4.ext_info,t4.is_url-->
|
||||
<!-- from tr_role_home t3-->
|
||||
<!-- inner join ts_menu t4 on t3.menuId=t4.ID-->
|
||||
<!-- <if test="roleId!='' and roleId!=null">-->
|
||||
<!-- where t3.roleId=#{roleId}-->
|
||||
<!-- </if>-->
|
||||
<!-- </select>-->
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user