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