Commit b1f4c862 by liuhui

首页微服务拆分后台代码基本完成

parent dc2e4ce4
Showing with 4089 additions and 689 deletions
......@@ -90,6 +90,12 @@
</exclusion>
</exclusions>
</dependency>
<!-- 邮件 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<!-- log4j -->
<dependency>
......@@ -98,6 +104,13 @@
<version>1.3.8.RELEASE</version>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.0</version>
</dependency>
<!-- SLF4J日志 -->
<dependency>
<groupId>org.slf4j</groupId>
......@@ -117,6 +130,12 @@
<version>2.8.5</version>
</dependency>
<!-- pagehelper 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
</dependency>
<!-- SpringBoot内部依赖json处理库(数据绑定) -->
<dependency>
......@@ -144,6 +163,14 @@
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- sinobase-base -->
<dependency>
<groupId>com.sinobase</groupId>
<artifactId>sinobase-base</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<!-- 远程调用实现类 -->
<dependency>
<groupId>com.sinobase</groupId>
......
......@@ -8,9 +8,9 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ImportResource;
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@MapperScan({"com.sinobase.empty.*.mapper"})
@MapperScan({"com.sinobase.project.*.mapper","com.sinobase.project.*.*.mapper", "com.sinobase.project.**.mapper"})
@ImportResource(value = {"classpath:dubbo.xml"})
@EnableDiscoveryClient
//@EnableDiscoveryClient
public class HomePageApplication {
public static void main(String[] args){
......
package com.sinobase.common.util;
/**
* 常量专用类
*
* @author liuhui001
*
*/
public class CommonContent {
/**
* 国投智能外部单位
*
*/
public static String COMPANY_EXTEND = "231560";
}
package com.sinobase.common.utils;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.sinobase.framework.config.NoticeConfig;
import com.sinobase.project.tool.shortMessage.domain.SysMessageSynch;
import com.sinobase.project.tool.shortMessage.domain.UserSynchVo;
import java.util.Date;
/**
* @author WangSJ
* @ClassName NoticeUtil
* @Description 系统通知工具类,发送手机短信
* @Date 2019/7/18 10:13
* @Version 1.0
*/
@Component
public class NoticeUtil {
@Autowired
private NoticeConfig noticeConfig;
private static NoticeConfig n ;
@PostConstruct
public void init(){
n = this.noticeConfig;
}
/**
* 短信通知
* 200 : 成功
*
* @param remark 短信内容
* @param phone 手机号码
*/
public static String sendMsg(String remark, String phone) {
System.out.println("短信发送内容:"+remark);
//如果是正式环境 就将手机号码更改为开发人员手机号码或者测试人员号码 正式环境 就按照传入的手机号码发送短信
if (!n.getOpen()) { // false 为非正式环境
//phone = "";
}
System.out.println("-------------------------------------------------------------------------------");
System.out.println("发送开始时间"+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",new Date()));
System.out.println("-------------------------------------------------------------------------------");
String code = "";
StringBuilder content = new StringBuilder();
content.append("[国投集团]OA短信通知:");
if (StringUtils.isNotEmpty(remark)) {
content.append(remark);
}
UserSynchVo user = new UserSynchVo();
user.setReceiver(phone); // 手机号
user.setBContext(content.toString()); // 短信内容
SysMessageSynch synch = new SysMessageSynch();
try {
//-- TODO 测试环境运行慢,没有找到原因,为了不影响测试 把发送短信暂时注释 测试是否还有响应慢的现象
code = synch.sendMobileMessage(user); // 推送短信
System.out.println("-------------------------------------------------------------------------------");
System.out.println("发送结束时间"+DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",new Date()));
System.out.println("-------------------------------------------------------------------------------");
} catch (Exception e) {
e.printStackTrace();
}
return code;
}
/**
* 手机消息通知
* 200 : 成功
*
* @param remark 消息内容
* @param phone 手机号码
*/
public static String sendInformation(String remark, String phone) {
//如果是正式环境 就将手机号码更改为开发人员手机号码或者测试人员号码 正式环境 就按照传入的手机号码发送短信
if (!n.getOpen()) { // false 为非正式环境
phone = "15560028345";
}
String code = "";
StringBuilder content = new StringBuilder();
content.append("[国投集团]OA待办通知:");
if (StringUtils.isNotEmpty(remark)) {
content.append(remark);
}
UserSynchVo user = new UserSynchVo();
user.setReceiver(phone); // 手机号
user.setBContext(content.toString()); // 短信内容
SysMessageSynch synch = new SysMessageSynch();
try {
//-- TODO 测试环境运行慢,没有找到原因,为了不影响测试 把发送短信暂时注释 测试是否还有响应慢的现象
code = synch.sendInformation(user); // 推送短信
} catch (Exception e) {
e.printStackTrace();
}
return code;
}
/**
* APP push消息
* @param title 标题
* @param receiver 接收人OA登陆名
* @param url 打开push通知url
* @return
*/
public static int pushMsg(String title, String receiver, String url) {
int status =0;
url = StringUtils.isEmpty(url) ? "" : url;
try {
UserSynchVo user = new UserSynchVo();
user.setTitle(title);
user.setReceiver(receiver); //OA登陆名
user.setUrl(url);
SysMessageSynch synch = new SysMessageSynch();
//如果配置文件推送push开关打开,则调用接口推送push
if (n.getPushOpen()) {
status = synch.CallClientForIphoneNew(user);
}
} catch (Exception e) {
e.printStackTrace();
}
return status;
}
public static void main(String[] args) {
sendMsg("这个应该传送路径 但是不需要跳转只是测试JAR所以不填写", "15001297926");
System.out.println("-----------------------");
sendMsg("这个应该传送路径 但是不需要跳转只是测试JAR所以不填写", "15001297926");
System.out.println("-----------------------");
}
}
package com.sinobase.common.utils;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.sinobase.common.support.Convert;
/**
* 客户端工具类
*
* @author sinobase
*/
public class ServletUtils {
public static String[] getParameters(String name) {
return getRequest().getParameterValues(name);
}
/**
* 获取String参数
*/
public static String getParameter(String name) {
return Convert.toStr(getRequest().getParameter(name), "");
}
/**
* 获取String参数
*/
public static String getParameter(String name, String defaultValue) {
return Convert.toStr(getRequest().getParameter(name), defaultValue);
}
/**
* 获取Integer参数
*/
public static Integer getParameterToInt(String name) {
return Convert.toInt(getRequest().getParameter(name));
}
/**
* 获取Integer参数
*/
public static Integer getParameterToInt(String name, Integer defaultValue) {
return Convert.toInt(getRequest().getParameter(name), defaultValue);
}
/**
* 获取Boolean参数
* @return
*/
public static Boolean getParameterToBoolean(String name) {
return Convert.toBool(getRequest().getParameter(name));
}
/**
* 获取request
*/
public static HttpServletRequest getRequest() {
return getRequestAttributes().getRequest();
}
/**
* 获取response
*/
public static HttpServletResponse getResponse() {
return getRequestAttributes().getResponse();
}
/**
* 获取session
*/
public static HttpSession getSession() {
return getRequest().getSession();
}
public static ServletRequestAttributes getRequestAttributes() {
RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
return (ServletRequestAttributes) attributes;
}
/**
* 将字符串渲染到客户端
*
* @param response 渲染对象
* @param string 待渲染的字符串
* @return null
*/
public static String renderString(HttpServletResponse response, String string) {
try {
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
response.getWriter().print(string);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
/**
* 是否是Ajax异步请求
*
* @param request
*/
public static boolean isAjaxRequest(HttpServletRequest request) {
String accept = request.getHeader("accept");
if (accept != null && accept.indexOf("application/json") != -1) {
return true;
}
String xRequestedWith = request.getHeader("X-Requested-With");
if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1) {
return true;
}
String uri = request.getRequestURI();
if (StringUtils.inStringIgnoreCase(uri, ".json", ".xml")) {
return true;
}
String ajax = request.getParameter("__ajax");
if (StringUtils.inStringIgnoreCase(ajax, "json", "xml")) {
return true;
}
return false;
}
}
package com.sinobase.common.utils;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.sinobase.project.system.menu.domain.Menu;
/**
* 权限数据处理
*
* @author sinobase
*/
public class TreeUtils {
/**
* 根据父节点的ID获取所有子节点
*
* @param list 分类表
* @param parentId 传入的父节点ID
* @return String
*/
public static List<Menu> getChildPerms(List<Menu> list, String parentId) {
List<Menu> returnList = new ArrayList<Menu>();
for (Iterator<Menu> iterator = list.iterator(); iterator.hasNext();) {
Menu t = (Menu) iterator.next();
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
if (t.getParentId().equals(parentId)) {
//System.out.println((t.getUrl().indexOf("parse_tab") > -1)+"------------"+ t.getMenuName()+"--------"+ t.getUrl());
if(t.getUrl().indexOf("parse_tab") < 0){
recursionFn(list, t);
}
returnList.add(t);
}
}
return returnList;
}
/**
* 递归列表
*
* @param list
* @param t
*/
private static void recursionFn(List<Menu> list, Menu t) {
// 得到子节点列表
List<Menu> childList = getChildList(list, t);
t.setChildren(childList);
for (Menu tChild : childList) {
if (hasChild(list, tChild)) {
// 判断是否有子节点
Iterator<Menu> it = childList.iterator();
while (it.hasNext()) {
Menu n = (Menu) it.next();
recursionFn(list, n);
}
}
}
}
/**
* 得到子节点列表
*/
private static List<Menu> getChildList(List<Menu> list, Menu t) {
List<Menu> tlist = new ArrayList<Menu>();
//20200103 LoubBin 添加 模块设置 标签页面功能无效BUG
if(t.getUrl().indexOf("parse_tab") < 0 && !t.getMenuType().equals("C")){
//System.out.println(t.getMenuName() + "------------"+t.getUrl());
Iterator<Menu> it = list.iterator();
while (it.hasNext()) {
Menu n = (Menu) it.next();
if (n.getParentId().equals(t.getMenuId())) {
tlist.add(n);
}
}
}
return tlist;
}
List<Menu> returnList = new ArrayList<Menu>();
/**
* 根据父节点的ID获取所有子节点
*
* @param list 分类表
* @param typeId 传入的父节点ID
* @param prefix 子节点前缀
*/
public List<Menu> getChildPerms(List<Menu> list, int typeId, String prefix) {
if (list == null) {
return null;
}
for (Iterator<Menu> iterator = list.iterator(); iterator.hasNext();) {
Menu node = (Menu) iterator.next();
// 一、根据传入的某个父节点ID,遍历该父节点的所有子节点
if (node.getParentId().equals(typeId)) {
recursionFn(list, node, prefix);
}
// 二、遍历所有的父节点下的所有子节点
/*
* if (node.getParentId()==0) { recursionFn(list, node); }
*/
}
return returnList;
}
private void recursionFn(List<Menu> list, Menu node, String p) {
// 得到子节点列表
List<Menu> childList = getChildList(list, node);
if (hasChild(list, node)) {
// 判断是否有子节点
returnList.add(node);
Iterator<Menu> it = childList.iterator();
while (it.hasNext()) {
Menu n = (Menu) it.next();
n.setMenuName(p + n.getMenuName());
recursionFn(list, n, p + p);
}
} else {
returnList.add(node);
}
}
/**
* 判断是否有子节点
*/
private static boolean hasChild(List<Menu> list, Menu t) {
return getChildList(list, t).size() > 0 ? true : false;
}
}
package com.sinobase.common.utils.bean;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Bean 工具类
*
* @author sinobase
*/
public class BeanUtils
{
/** Bean方法名中属性名开始的下标 */
private static final int BEAN_METHOD_PROP_INDEX = 3;
/** * 匹配getter方法的正则表达式 */
private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)");
/** * 匹配setter方法的正则表达式 */
private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)");
/**
* Bean属性复制工具方法。
*
* @param dest 目标对象
* @param src 源对象
*/
public static void copyBeanProp(Object dest, Object src)
{
List<Method> destSetters = getSetterMethods(dest);
List<Method> srcGetters = getGetterMethods(src);
try
{
for (Method setter : destSetters)
{
for (Method getter : srcGetters)
{
if (isMethodPropEquals(setter.getName(), getter.getName())
&& setter.getParameterTypes()[0].equals(getter.getReturnType()))
{
setter.invoke(dest, getter.invoke(src));
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
/**
* 获取对象的setter方法。
*
* @param obj 对象
* @return 对象的setter方法列表
*/
public static List<Method> getSetterMethods(Object obj)
{
// setter方法列表
List<Method> setterMethods = new ArrayList<Method>();
// 获取所有方法
Method[] methods = obj.getClass().getMethods();
// 查找setter方法
for (Method method : methods)
{
Matcher m = SET_PATTERN.matcher(method.getName());
if (m.matches() && (method.getParameterTypes().length == 1))
{
setterMethods.add(method);
}
}
// 返回setter方法列表
return setterMethods;
}
/**
* 获取对象的getter方法。
*
* @param obj 对象
* @return 对象的getter方法列表
*/
public static List<Method> getGetterMethods(Object obj)
{
// getter方法列表
List<Method> getterMethods = new ArrayList<Method>();
// 获取所有方法
Method[] methods = obj.getClass().getMethods();
// 查找getter方法
for (Method method : methods)
{
Matcher m = GET_PATTERN.matcher(method.getName());
if (m.matches() && (method.getParameterTypes().length == 0))
{
getterMethods.add(method);
}
}
// 返回getter方法列表
return getterMethods;
}
/**
* 检查Bean方法名中的属性名是否相等。<br>
* 如getName()和setName()属性名一样,getName()和setAge()属性名不一样。
*
* @param m1 方法名1
* @param m2 方法名2
* @return 属性名一样返回true,否则返回false
*/
public static boolean isMethodPropEquals(String m1, String m2)
{
return m1.substring(BEAN_METHOD_PROP_INDEX).equals(m2.substring(BEAN_METHOD_PROP_INDEX));
}
}
package com.sinobase.common.utils.dboperate;
/**
* <p>Title: MyWork</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: ����</p>
* @author ��Сƽ
* @version 1.0
*/
import java.util.*;
public class DataMap {
private Object key;
private Object value;
private Vector vector = new Vector();
private int subIndex = 0;
public DataMap() {
}
public int getSubIndex(){
return this.subIndex;
}
public DataMap(Object key, Object value) {
this.key = key;
this.value = value;
}
public void addSubElement(DataMap DataMap) {
vector.addElement(DataMap);
}
public void addSubElement(Object subKey, Object subValue) {
DataMap subData = new DataMap(subKey, subValue);
vector.addElement(subData);
}
public void replaceSubElement(int i, DataMap dataMap) {
vector.remove(i);
vector.add(i, dataMap);
}
public void removeSubElement(int i) {
vector.remove(i);
}
public void removeSubElement(DataMap dataMap) {
vector.remove(dataMap);
}
public void clearSubElement() {
vector.clear();
}
public int getSubSize() {
if (vector == null) {
return 0;
}
else {
return vector.size();
}
}
public boolean hasMoreSubData() {
if (vector.size() > subIndex) {
subIndex++;
return true;
}
else {
return false;
}
}
public DataMap getNextSubData() {
return (DataMap) vector.elementAt(subIndex - 1);
}
public int containsSubKey(Object key) {
int j = -1;
for (int i = 0; i < getSubSize(); i++) {
if (getSubDataMap(i).getKey().equals(key)) {
j = i;
}
}
return j;
}
public int containsSubValue(Object value) {
int j = -1;
for (int i = 0; i < getSubSize(); i++) {
if (getSubDataMap(i).getValue().equals(value)) {
j = i;
}
}
return j;
}
public void reSetSubIndex() {
this.subIndex = 0;
}
public DataMap getSubDataMap(int i) {
return (DataMap) vector.elementAt(i);
}
public void setKey(Object key) {
this.key = key;
}
public void setValue(Object value) {
this.value = value;
}
public Object getKey() {
return this.key;
}
public Object getValue() {
return this.value;
}
}
package com.sinobase.common.utils.dboperate;
/**
* <p>Title: MyWork</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: ����</p>
* @author ��Сƽ
* @version 1.0
*/
import java.io.*;
import java.util.*;
public class LogWriter
{
public static final int NONE = 0;
public static final int ERROR = 1;
public static final int INFO = 2;
public static final int DEBUG = 3;
private static final String ERROR_TEXT = "error";
private static final String INFO_TEXT = "info";
private static final String DEBUG_TEXT = "debug";
private PrintWriter pw;
private String owner;
private int logLevel;
public LogWriter(String owner, int logLevel, PrintWriter pw)
{
this.pw = pw;
this.owner = owner;
this.logLevel = logLevel;
}
public LogWriter(String owner, int logLevel)
{
this(owner, logLevel, null);
}
public int getLogLevel()
{
return logLevel;
}
public PrintWriter getPrintWriter()
{
return pw;
}
public void setLogLevel(int logLevel)
{
this.logLevel = logLevel;
}
public void setPrintWriter(PrintWriter pw)
{
this.pw = pw;
}
public void log(String msg, int severityLevel)
{
if (pw != null)
{
if (severityLevel <= logLevel)
{
pw.println("[" + new Date() + "] " +
getSeverityString(severityLevel) + ": " +
owner + ": " + msg);
}
}
}
public void log(Throwable t, String msg, int severityLevel)
{
log(msg + " : " + toTrace(t), severityLevel);
}
private String getSeverityString(int severityLevel)
{
switch (severityLevel)
{
case ERROR:
return ERROR_TEXT;
case INFO:
return INFO_TEXT;
case DEBUG:
return DEBUG_TEXT;
default:
return "Unknown";
}
}
private String toTrace(Throwable e)
{
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
pw.flush();
return sw.toString();
}
}
package com.sinobase.common.utils.dboperate;
/**
* <p>Title: ������</p>
* <p>Description: �ڵ��Գ���ʱ�ѵ�����Ϣ��ӡ��һ������</p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: ����</p>
* @author ��Сƽ
* @version 1.0
*/
import java.awt.AWTEvent;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.event.WindowEvent;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Calendar;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
class MessageEFrame
extends JFrame {
JTextArea textArea;
public MessageEFrame() {
super("Debug��Ϣ");
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
textArea = new JTextArea();
textArea.setEditable(false);
JScrollPane scrollpane = new JScrollPane(textArea);
Container container = getContentPane();
getContentPane().add(scrollpane, BorderLayout.CENTER);
}
protected void processWindowEvent(WindowEvent e) {
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
dispose();
Message.messageEFrame = null;
}
else {
super.processWindowEvent(e);
}
}
}
public final class Message {
private Message() {
}
public static MessageEFrame messageEFrame;
private static boolean isDebug = false;
public static final void appendText(String text) {
JTextArea textArea = null;
if (messageEFrame != null) {
textArea = messageEFrame.textArea;
}
if (textArea == null && messageEFrame == null) {
messageEFrame = new MessageEFrame();
messageEFrame.setSize(500, 500);
messageEFrame.show();
textArea = messageEFrame.textArea;
}
if (textArea != null) {
textArea.append(text);
}
}
public static final void printException(Exception ex, boolean trace) {
// chensjע�ͣ������̨����Message�����쳣�����⡣
// if (trace) {
// ex.printStackTrace(out);
// }
// else {
// out.println(ex);
// }
}
private static final PrintWriter out = new PrintWriter(new MessageWriter());
//private static final PrintWriter outFile = new PrintWriter(new WriteLogFile());
/*******************************/
//public static final PrintWriter out = new PrintWriter(new WriteLogFile());
public static void println(Object obj) {
if (isDebug) {
Message.out.println(obj);
//Message.outFile.println(obj);
}
else {
return;
}
}
public static void println(boolean obj) {
if (isDebug) {
Message.out.println(obj);
//Message.outFile.println(obj);
}
else {
return;
}
}
public static void println(char obj) {
if (isDebug) {
Message.out.println(obj);
// Message.outFile.println(obj);
}
else {
return;
}
}
public static void println(char[] obj) {
if (isDebug) {
Message.out.println(obj);
//Message.outFile.println(obj);
}
else {
return;
}
}
public static void println(double obj) {
if (isDebug) {
Message.out.println(obj);
//Message.outFile.println(obj);
}
else {
return;
}
}
public static void println(float obj) {
if (isDebug) {
Message.out.println(obj);
//Message.outFile.println(obj);
}
else {
return;
}
}
public static void println(int obj) {
if (isDebug) {
Message.out.println(obj);
//Message.outFile.println(obj);
}
else {
return;
}
}
public static void println(long obj) {
if (isDebug) {
Message.out.println(obj);
//Message.outFile.println(obj);
}
else {
return;
}
}
public static void println(String obj) {
//System.out.println(obj);
}
public static void printDataMap(DataMap dataMap) {
Message.println("Element-0:{" + dataMap.getKey() + "=" + dataMap.getValue()+"}");
int j = 1;
for (int i = 0; i < dataMap.getSubSize(); i++) {
DataMap dataTemp = dataMap.getSubDataMap(i);
Message.println("��Element-" + j + ":{" + dataTemp.getKey() + "=" +
dataTemp.getValue() + "}");
if (dataTemp.getSubSize() > 0) {
printDataMap(dataTemp, j + 1);
}
}
}
public static void printHashMap(HashMap map,boolean key,boolean value){
Collection coll = map.entrySet();
java.util.Iterator it = coll.iterator();
HashMap hashMap = new HashMap();
int n = 0;
while(it.hasNext()){
Map.Entry entry = (Map.Entry)it.next();
if (key && !value) {
String[] strArr = (String[])entry.getKey();
String keyStr = n + ":[";
for(int i=0;i<strArr.length;i++){
keyStr = keyStr + strArr[i] + ",";
}
keyStr = keyStr.substring(0,keyStr.length()-1)+"]";
hashMap.put(keyStr,entry.getValue());
n++;
}
else if (!key && value) {
String[] strArr = (String[])entry.getValue();
String valueStr = n + ":[";
for(int i=0;i<strArr.length;i++){
valueStr = valueStr + strArr[i] + ",";
}
valueStr = valueStr.substring(0,valueStr.length()-1)+"]";
hashMap.put(entry.getKey(),valueStr);
n++;
}
else if (key && value) {
String[] strArrKey = (String[])entry.getKey();
String keyStr = n + ":[";
for(int i=0;i<strArrKey.length;i++){
keyStr = keyStr + strArrKey[i] + ",";
}
keyStr = keyStr.substring(0,keyStr.length()-1)+"]";
String[] strArr = (String[])entry.getValue();
String valueStr = n + ":[";
for(int i=0;i<strArr.length;i++){
valueStr = valueStr + strArr[i] + ",";
}
valueStr = valueStr.substring(0,valueStr.length()-1)+"]";
hashMap.put(keyStr,valueStr);
n++;
}
else {
hashMap = map;
}
Message.println(hashMap);
}
}
private static void printDataMap(DataMap dataMap, int j) {
String strPre = "��";
for(int i=0;i<j-1;i++){
strPre = strPre + "��";
}
for (int i = 0; i < dataMap.getSubSize(); i++) {
DataMap dataTemp = dataMap.getSubDataMap(i);
Message.println(strPre+"Element-" + j + ":{" + dataTemp.getKey() + "=" +
dataTemp.getValue() + "}");
if (dataTemp.getSubSize() > 0) {
printDataMap(dataTemp, j + 1);
}
}
}
public static void wirteFile(String str,String fileName){
PrintWriter outFile = new PrintWriter(new WriteLogFile(fileName));
outFile.println(str);
}
/*******************************/
}
class MessageWriter
extends java.io.Writer {
StringBuffer stringBuffer = new StringBuffer();
public void write(char cbuf[], int off, int len) throws IOException {
for (int i = 0; i < len; i++) {
stringBuffer.append(cbuf[off + i]);
if (cbuf[off + i] == '\n') {
flush();
}
}
}
public void flush() throws IOException {
Message.appendText(stringBuffer.toString());
stringBuffer = new StringBuffer();
}
public void close() throws IOException {
flush();
}
}
class WriteLogFile
extends Writer {
StringBuffer stringBuffer = new StringBuffer();
String fileName = "";
public WriteLogFile(){
}
public WriteLogFile(String fileName){
this.fileName = fileName;
}
public void write(char cbuf[], int off, int len) throws IOException {
for (int i = 0; i < len; i++) {
stringBuffer.append(cbuf[off + i]);
if (cbuf[off + i] == '\n') {
flush();
}
}
}
public void flush() throws IOException {
if(fileName.equals("")){
Calendar calendar = Calendar.getInstance();
String NowYear = Integer.toString(calendar.get(Calendar.YEAR));
String NowMonth = Integer.toString( (calendar.get(Calendar.MONTH) + 1));
String NowDay = Integer.toString(calendar.get(Calendar.DAY_OF_MONTH));
String NowHour = Integer.toString(calendar.get(Calendar.HOUR_OF_DAY));
String NowMinute = Integer.toString(calendar.get(Calendar.MINUTE));
String NowSecond = Integer.toString(calendar.get(Calendar.SECOND));
String NowDate = NowYear + "_" +
(NowMonth.length() == 1 ? "0" + NowMonth : NowMonth) + "_" +
(NowDay.length() == 1 ? "0" + NowDay : NowDay) + "_" +
(NowHour.length() == 1 ? "0" + NowHour : NowHour) + "_" +
(NowMinute.length() == 1 ? "0" + NowMinute : NowMinute) + "_" +
(NowSecond.length() == 1 ? "0" + NowSecond : NowSecond);
fileName = "c:/"+NowDate+".txt";
}
FileWriter fw = new FileWriter(fileName);
fw.write(stringBuffer.toString());
stringBuffer = new StringBuffer();
fw.close();
}
public void close() throws IOException {
}
}
package com.sinobase.common.utils.dboperate;
import java.io.File;
import java.util.*;
import org.w3c.dom.*;
public class PorpOperate {
private static Map<Object, Object> cache = new HashMap<Object, Object>();
private static String filePath = "";
public PorpOperate() {
}
/**
* 说明:从属性文件中读取数据源为strDbsource,表名为strTableName的主键和前缀,附加了缓存机制
* @param strDbsource 数据源
* @param strTableName 表名
* @return 成功返回数组 String[],【0】主键名称,【1】前缀pre 失败返回null
*/
public synchronized String[] getKey(String strDbsource, String strTableName) {
writeCache();
Map<Object, Object> tableMap = (Map<Object, Object>) ((MapModelEntry) cache.get(filePath)).databaseMap.get(strDbsource);
if (tableMap == null) {
return null;
}else {
return (String[]) tableMap.get(strTableName.toUpperCase());
}
}
/**
* 说明:从属性文件中读取所有的属性键值对
* @return
*/
public synchronized Map<Object, Object> getProp() {
writeCache();
return (Map<Object, Object>) ( (MapModelEntry) cache.get(filePath)).propMap;
}
/**
* 说明:如果是第一次读取或文件修改过,读取属性信息到缓存
*/
public void writeCache() {
try {
File xsltFile = new File(filePath);
long xslLastModified = xsltFile.lastModified();
MapModelEntry entry = (MapModelEntry) cache.get(filePath);
if (entry != null) {
if (xslLastModified > entry.lastModified) {
entry = null;
}
}
if (entry == null) {
javax.xml.parsers.DocumentBuilderFactory dbf =
javax.xml.parsers.DocumentBuilderFactory.newInstance();
javax.xml.parsers.DocumentBuilder docBuilder = dbf.newDocumentBuilder();
System.out.println("new File(filePath)==========================="+new File(filePath).getAbsolutePath());
Document doc = docBuilder.parse(new File(filePath));
System.out.println("porpDOC>>>>>>>>>>>>>>>>>>>>>>>>>"+doc);
Map<Object, Object> databaseMap = getDatabaseMap(doc);
Map<Object, Object> propMap = new TreeMap<Object, Object>();
getPropMap(doc, "connectionPool", propMap);
getPropMap(doc, "resource", propMap);
getPropMap(doc, "affix", propMap);
entry = new MapModelEntry(xslLastModified, databaseMap, propMap);
cache.put(filePath, entry);
}
}catch (Exception e) {
e.printStackTrace();
}
}
private void getPropMap(Document doc, String strNodeName, Map<Object, Object> map) {
NodeList list = doc.getDocumentElement().getElementsByTagName(strNodeName);
for (int i = 0; i < list.getLength(); i++) {
Element node = (Element) list.item(i);
NodeList propNodeList = node.getElementsByTagName("prop");
for (int t = 0; t < propNodeList.getLength(); t++) {
node = (Element) propNodeList.item(t);
if (node.hasAttribute("name")) {
if (node.getChildNodes().item(0) != null) {
map.put(node.getAttribute("name").trim(), node.getChildNodes().item(0).getNodeValue());
} else {
map.put(node.getAttribute("name").trim(), "");
}
}
}
}
}
/**
* 说明:读取配置的数据库和前缀
* @param doc 解析后的Document
* @return
*/
private Map<Object, Object> getDatabaseMap(Document doc) {
Map<Object, Object> databaseMap = new TreeMap<Object, Object>();
NodeList list = doc.getDocumentElement().getElementsByTagName("database");
for (int i = 0; i < list.getLength(); i++) {
Map<Object, Object> tableMap = new TreeMap<Object, Object>();
String datasource = "";
Element node = (Element) list.item(i);
if (node.hasAttribute("datasource")) {
datasource = node.getAttribute("datasource").trim();
}
NodeList tableNodeList = node.getElementsByTagName("table");
for (int t = 0; t < tableNodeList.getLength(); t++) {
node = (Element) tableNodeList.item(t);
String[] strArray = new String[2];
if (node.hasAttribute("key")) {
strArray[0] = node.getAttribute("key").trim();
}
if (node.hasAttribute("pre")) {
strArray[1] = node.getAttribute("pre").trim();
}
tableMap.put(node.getAttribute("name").trim().toUpperCase(), strArray);
}
databaseMap.put(datasource, tableMap);
}
return databaseMap;
}
static class MapModelEntry {
long lastModified;
Map<Object, Object> databaseMap; //存放数据库表主键配置
Map<Object, Object> propMap; //存放其它属性配置
MapModelEntry(long lastModified, Map<Object, Object> databaseMap, Map<Object, Object> propMap) {
this.lastModified = lastModified;
this.databaseMap = databaseMap;
this.propMap = propMap;
}
}
public void setFilePath(String filePath) {
this.filePath = filePath;
}
}
package com.sinobase.common.utils.dboperate;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class StatementWrapper implements Statement {
private Statement stat;
private List<String> batch = Collections.emptyList();
public StatementWrapper(Statement stat) {
this.stat = stat;
}
protected void logSql(String sql) {
//LogAdapter.log(sql);
}
protected void addSql(String sql) {
if (batch == Collections.EMPTY_LIST)
batch = new ArrayList<String>();
batch.add(sql);
}
public void addBatch(String sql) throws SQLException {
stat.addBatch(sql);
addSql(sql);
}
public void cancel() throws SQLException {
stat.cancel();
}
public void clearBatch() throws SQLException {
stat.clearBatch();
batch.clear();
}
public void clearWarnings() throws SQLException {
stat.clearWarnings();
}
public void close() throws SQLException {
stat.close();
}
public boolean execute(String sql) throws SQLException {
logSql(sql);
System.out.println(sql);
return stat.execute(sql);
}
public boolean execute(String sql, int autoGeneratedKeys)
throws SQLException {
logSql(sql);
return stat.execute(sql, autoGeneratedKeys);
}
public boolean execute(String sql, int[] columnIndexes) throws SQLException {
logSql(sql);
return stat.execute(sql, columnIndexes);
}
public boolean execute(String sql, String[] columnNames)
throws SQLException {
logSql(sql);
return stat.execute(sql, columnNames);
}
public int[] executeBatch() throws SQLException {
for (String s : batch)
logSql(s);
return stat.executeBatch();
}
public ResultSet executeQuery(String sql) throws SQLException {
logSql(sql);
return stat.executeQuery(sql);
}
public int executeUpdate(String sql) throws SQLException {
logSql(sql);
return stat.executeUpdate(sql);
}
public int executeUpdate(String sql, int autoGeneratedKeys)
throws SQLException {
logSql(sql);
return stat.executeUpdate(sql, autoGeneratedKeys);
}
public int executeUpdate(String sql, int[] columnIndexes)
throws SQLException {
logSql(sql);
return stat.executeUpdate(sql, columnIndexes);
}
public int executeUpdate(String sql, String[] columnNames)
throws SQLException {
logSql(sql);
return stat.executeUpdate(sql, columnNames);
}
public Connection getConnection() throws SQLException {
return stat.getConnection();
}
public int getFetchDirection() throws SQLException {
return stat.getFetchDirection();
}
public int getFetchSize() throws SQLException {
return stat.getFetchSize();
}
public ResultSet getGeneratedKeys() throws SQLException {
return stat.getGeneratedKeys();
}
public int getMaxFieldSize() throws SQLException {
return stat.getMaxFieldSize();
}
public int getMaxRows() throws SQLException {
return stat.getMaxRows();
}
public boolean getMoreResults() throws SQLException {
return stat.getMoreResults();
}
public boolean getMoreResults(int current) throws SQLException {
return stat.getMoreResults(current);
}
public int getQueryTimeout() throws SQLException {
return stat.getQueryTimeout();
}
public ResultSet getResultSet() throws SQLException {
return stat.getResultSet();
}
public int getResultSetConcurrency() throws SQLException {
return stat.getResultSetConcurrency();
}
public int getResultSetHoldability() throws SQLException {
return stat.getResultSetHoldability();
}
public int getResultSetType() throws SQLException {
return stat.getResultSetType();
}
public int getUpdateCount() throws SQLException {
return stat.getUpdateCount();
}
public SQLWarning getWarnings() throws SQLException {
return stat.getWarnings();
}
public void setCursorName(String name) throws SQLException {
stat.setCursorName(name);
}
public void setEscapeProcessing(boolean enable) throws SQLException {
stat.setEscapeProcessing(enable);
}
public void setFetchDirection(int direction) throws SQLException {
stat.setFetchDirection(direction);
}
public void setFetchSize(int rows) throws SQLException {
stat.setFetchSize(rows);
}
public void setMaxFieldSize(int max) throws SQLException {
stat.setMaxFieldSize(max);
}
public void setMaxRows(int max) throws SQLException {
stat.setMaxRows(max);
}
public void setQueryTimeout(int seconds) throws SQLException {
stat.setQueryTimeout(seconds);
}
public <T> T unwrap(Class<T> iface) throws SQLException {
// TODO Auto-generated method stub
return null;
}
public boolean isWrapperFor(Class<?> iface) throws SQLException {
// TODO Auto-generated method stub
return false;
}
public boolean isClosed() throws SQLException {
// TODO Auto-generated method stub
return false;
}
public void setPoolable(boolean poolable) throws SQLException {
// TODO Auto-generated method stub
}
public boolean isPoolable() throws SQLException {
// TODO Auto-generated method stub
return false;
}
@Override
public void closeOnCompletion() throws SQLException {
// TODO Auto-generated method stub
}
@Override
public boolean isCloseOnCompletion() throws SQLException {
// TODO Auto-generated method stub
return false;
}
}
package com.sinobase.common.utils.security;
import org.apache.commons.lang3.StringUtils;
import com.sinobase.common.constant.PermissionConstants;
import com.sinobase.common.utils.MessageUtils;
/**
* permission 工具类
*
* @author sinobase
*/
public class PermissionUtils
{
/**
* 权限错误消息提醒
*
* @param permissionsStr 错误信息
* @return
*/
public static String getMsg(String permissionsStr)
{
String permission = StringUtils.substringBetween(permissionsStr, "[", "]");
String msg = MessageUtils.message("no.view.permission", permission);
if (StringUtils.endsWithIgnoreCase(permission, PermissionConstants.ADD_PERMISSION))
{
msg = MessageUtils.message("no.create.permission", permission);
}
else if (StringUtils.endsWithIgnoreCase(permission, PermissionConstants.EDIT_PERMISSION))
{
msg = MessageUtils.message("no.update.permission", permission);
}
else if (StringUtils.endsWithIgnoreCase(permission, PermissionConstants.REMOVE_PERMISSION))
{
msg = MessageUtils.message("no.delete.permission", permission);
}
else if (StringUtils.endsWithIgnoreCase(permission, PermissionConstants.EXPORT_PERMISSION))
{
msg = MessageUtils.message("no.export.permission", permission);
}
else if (StringUtils.endsWithAny(permission, new String[] { PermissionConstants.VIEW_PERMISSION, PermissionConstants.LIST_PERMISSION }))
{
msg = MessageUtils.message("no.view.permission", permission);
}
return msg;
}
}
package com.sinobase.empty.test.contryller;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.sinobase.empty.test.model.HouseInfo;
import com.sinobase.empty.test.service.HouseInfoService;
@Controller
public class TestController {
protected Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private HouseInfoService houseInfoService;
@RequestMapping("/test")
@ResponseBody
public List<HouseInfo> test() {
logger.debug("inner test controller");
List<HouseInfo> list = houseInfoService.getAll();
return list;
}
@RequestMapping("test2")
public String test2(){
return "/index";
}
}
package com.sinobase.empty.test.model;
public class HouseInfo {
private String id;
private String city;
private String country;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country;
}
}
package com.sinobase.empty.test.service;
import java.util.List;
import com.sinobase.empty.test.model.HouseInfo;
public interface HouseInfoService {
public List<HouseInfo> getAll();
}
package com.sinobase.empty.test.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sinobase.datasource.aspectj.lang.annotation.DataSource;
import com.sinobase.datasource.aspectj.lang.enums.DataSourceType;
import com.sinobase.empty.test.mapper.HouseInfoMapper;
import com.sinobase.empty.test.model.HouseInfo;
@Service
public class HouseInfoServiceImpl implements HouseInfoService {
@Autowired
private HouseInfoMapper houseInfoMaper;
@DataSource(DataSourceType.MASTER)
public List<HouseInfo> getAll() {
return houseInfoMaper.getAll();
}
}
package com.sinobase.framework.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
/**
* 权限配置加载
*
* @author sinobase
*/
@Configuration
public class NoticeConfig {
@Value("${notice.open}")
private boolean open;
@Value("${notice.pushOpen}")
private boolean pushOpen;
@Value("${notice.shortmessage}")
private String shortmessage;
@Value("${notice.key}")
private String key;
public boolean getOpen() {
return open;
}
public void setOpen(boolean open) {
this.open = open;
}
public boolean getPushOpen() {
return pushOpen;
}
public void setPushOpen(boolean pushOpen) {
this.pushOpen = pushOpen;
}
public String getShortmessage() {
return shortmessage;
}
public void setShortmessage(String shortmessage) {
this.shortmessage = shortmessage;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
}
package com.sinobase.framework.service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.TreeUtils;
import com.sinobase.project.system.dept.domain.Dept;
import com.sinobase.project.system.menu.domain.Menu;
import com.sinobase.project.system.role.domain.Role;
import com.sinobase.project.system.user.domain.User;
import com.sinobase.transfer.service.ResourceService;
import com.sinobase.transfer.service.WorkflowService;
@Service
public class PlatformService {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private ResourceService resource;
@Autowired
private WorkflowService workflowService;
/**
* 在平台上业务系统的注册 ID
*/
@Value("${sinobase.system_id}")
private String SYSTEM_ID;
@SuppressWarnings("unchecked")
public User getUserByLoginname(String loginName) {
Map<String, Object> userMap = resource.getUserInfo(loginName, SYSTEM_ID);
User user = new User();
user.setUserId(getStr(userMap, "userId"));
user.setHistoryId(getStr(userMap, "historyId"));
user.setLoginName(getStr(userMap, "userName"));
user.setUserName(getStr(userMap, "userFullName"));
user.setSex(getStr(userMap, "userSex"));
user.setPhonenumber(getStr(userMap, "phone"));
user.setEmail(getStr(userMap, "email"));
user.setIdcNumber(getStr(userMap, "idCard"));
user.setPassword(getStr(userMap,"password"));
List<Map<String, String>> deptInfo = (List<Map<String, String>>) userMap.get("deptInfo");
List<Dept> deptList = new ArrayList<Dept>();
int deptCount = 1;
for (Map<String, String> map : deptInfo) {
//平台返回的部门信息不全,根据平台返回的部门id,查询业务库部门信息
Dept dept = new Dept();
dept.setDeptId(getStr(map, "deptId"));
dept.setDeptName(getStr(map, "deptName"));
dept.setDeptShort(getStr(map, "abbreviation"));
dept.setParentId(getStr(map, "superId"));
dept.setHistoryId(getStr(map, "historyId"));
dept.setUnitType(getStr(map, "unitType"));
//父级相关信息
Map<String, Object> supermap = resource.getSuperDepMessage(getStr(map, "superId"));
dept.setHistoryCompanyId(getStr(supermap, "historyId"));
dept.setCompanyShortNameDept(getStr(supermap, "abbreviation"));
dept.setCompanyIdDept(getStr(supermap, "deptId"));
dept.setCompanyNameDept(getStr(supermap, "deptName"));
//单个主部门
if (("true".equals(map.get("isDefault") + "") && StringUtils.isEmpty(user.getDeptId()))) {
setDeptInfo(user, dept);
} else if (deptCount == deptInfo.size() && StringUtils.isEmpty(user.getDeptId())) {
setDeptInfo(user, dept);
}
deptCount++;
deptList.add(dept);
}
user.setDepts(deptList); //部门集合
//用户权限
ArrayList<Role> userRoles = new ArrayList<Role>();
List<Map<String, String>> rolsMap = (List<Map<String, String>>) userMap.get("sysRoles");
for (Map<String, String> map : rolsMap) {
Role role = new Role();
role.setRoleId(getStr(map, "roleId"));
role.setRoleName(getStr(map, "roleName"));
userRoles.add(role);
}
user.setRoles(userRoles);
user.setRoleIds(getStr(userMap, "sysRoleIds"));
List<Map<String, String>> flowRoles = (List<Map<String, String>>) userMap.get("flowRoles");
user.setFlowRoles(flowRoles);
user.setFlowRoleIds(getStr(userMap, "flowRoleIds"));
return user;
}
private void setDeptInfo(User user, Dept dept) {
user.setDept(dept);
user.setDeptId(dept.getDeptId());
user.setDeptName(dept.getDeptName());
user.setCompanyId(dept.getCompanyId());
user.setCompanyName(dept.getCompanyName());
}
private String getStr(Map map, String key) {
if (map == null || map.get(key) == null) {
return "";
}
return map.get(key) + "";
}
public WorkflowService getWorkflowService() {
return workflowService;
}
public void setWorkflowService(WorkflowService workflowService) {
this.workflowService = workflowService;
}
/**
* 获取资源目录
*
* @param list 当前用户的所有资源
* @return
*/
public List<Menu> getMenus(List<Menu> list) {
List<Menu> rList = new ArrayList<Menu>();
if (list == null) {
return rList;
}
for (Menu menu : list) {
if (menu.getMenuType().equals("M") || "C".equals(menu.getMenuType())) {
rList.add(menu);
}
}
return TreeUtils.getChildPerms(list, "0");
}
}
......@@ -13,7 +13,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import com.sinobase.framework.service.PlatformService;
import com.sinobase.project.system.sino.service.PlatformService;
import com.sinobase.project.system.user.domain.User;
public class UserRealm extends AuthorizingRealm {
......
package com.sinobase.framework.web.controller;
import java.beans.PropertyEditorSupport;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sinobase.common.utils.DateUtils;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.project.system.user.domain.User;
import com.sinobase.framework.web.page.PageData;
import com.sinobase.framework.web.page.PageDomain;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.framework.web.page.TableSupport;
/**
* web层通用数据处理
......@@ -15,7 +26,74 @@ import com.sinobase.project.system.user.domain.User;
*/
public class BaseController {
/**
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
*/
@InitBinder
public void initBinder(WebDataBinder binder) {
// Date 类型转换
binder.registerCustomEditor(Date.class, new PropertyEditorSupport() {
@Override
public void setAsText(String text) {
setValue(DateUtils.parseDate(text));
}
});
}
/**
* 设置请求分页数据
*/
protected void startPage() {
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
String orderBy = pageDomain.getOrderBy();
PageHelper.startPage(pageNum, pageSize, orderBy);
}
}
/**
* 返回startSize和endSize
*/
protected JSONObject getPageInfo() {
JSONObject obj = new JSONObject();
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
//分页开始位置
obj.put("startSize", (pageNum-1)*(pageSize));
//每页最大数量
obj.put("pageSize", pageSize);
return obj;
}
/**
* 响应请求分页数据
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
protected TableDataInfo getDataTable(List<?> list) {
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(0);
rspData.setRows(list);
rspData.setTotal(new PageInfo(list).getTotal());
return rspData;
}
/**
* 响应请求分页数据-API接口用
* @author LouBin 20200204
* @param list
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
protected PageData getApiData(List<?> list){
PageData rspData = new PageData();
rspData.setList(list);
rspData.setTotal(new PageInfo(list).getTotal());
return rspData;
}
/**
* 响应返回结果
......@@ -104,34 +182,4 @@ public class BaseController {
return StringUtils.format("redirect:{}", url);
}
public User getSysUser() {
return ShiroUtils.getSysUser();
}
public void setSysUser(User user) {
ShiroUtils.setSysUser(user);
}
public String getUserId() {
return getSysUser().getUserId();
}
public String getLoginName() {
return getSysUser().getLoginName();
}
/**
* 去除特殊符号
* @param obj
* @return
*/
public Object clearSpecialSymbols(Object obj){
//去除换行及空格
if(ObjectUtils.isNotEmpty(obj)){
obj = obj.toString().replaceAll("\\r\\n","").trim();
}
return obj;
}
}
package com.sinobase.framework.web.controller;
import java.lang.reflect.ParameterizedType;
import org.springframework.beans.factory.annotation.Autowired;
import com.sinobase.common.utils.DateUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.framework.web.domain.FlowBaseEntity;
import com.sinobase.project.module.workflow.model.WorkFlow;
import com.sinobase.project.system.portal.service.IMessageService;
import com.sinobase.project.system.sino.service.PlatformService;
import com.sinobase.project.system.user.domain.User;
/**
* web层流程通用数据处理
*
* @author sinobase
*/
public class FlowController<T extends FlowBaseEntity> extends BaseController {
private String prefix;
private String actionPath;
@Autowired
private IMessageService messageService; //系统信息
@Autowired
private PlatformService platformService;
/**
* 初始化对象信息
* @param t
* @param args
* @return
*/
public T initObject(T t,String... args){
User user = ShiroUtils.getSysUser();
t.setCreDate(DateUtils.getNowDate());
t.setCreUserId(user.getUserId());
t.setCreUserName(user.getUserName());
t.setCreDeptId(user.getDeptId());
t.setCreDeptName(user.getDeptName());
try {
t.setSubflag(args[0]);
t.setFlowType(args[1]);
}catch (Exception e) {
}
return t;
}
public T killObject(T t,WorkFlow workflow,String idea) {
t.setSubflag("02");
//调用办结方法
String result = platformService.getWorkflowService().cleanUp(workflow.getWorkitemid(),idea);
//插入已办数据
messageService.readInsert(result);
//删除待办
messageService.delMessage(workflow.getWorkitemid());
return t;
}
@SuppressWarnings("unchecked")
public T newT(){
T newT;
try {
// 通过反射获取model的真实类型
ParameterizedType pt = (ParameterizedType) this.getClass().getGenericSuperclass();
Class<T> clazz = (Class<T>) pt.getActualTypeArguments()[0];
// 通过反射创建model的实例
newT = clazz.newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
return newT;
}
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getActionPath() {
return actionPath;
}
public void setActionPath(String actionPath) {
this.actionPath = actionPath;
}
}
package com.sinobase.framework.web.exception;
import org.apache.shiro.authz.AuthorizationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import com.sinobase.common.exception.BusinessException;
import com.sinobase.common.exception.DemoModeException;
import com.sinobase.common.utils.security.PermissionUtils;
import com.sinobase.framework.web.domain.AjaxResult;
/**
* 自定义异常处理器
*
* @author sinobase
*/
@RestControllerAdvice
public class DefaultExceptionHandler
{
private static final Logger log = LoggerFactory.getLogger(DefaultExceptionHandler.class);
/**
* 权限校验失败
*/
@ExceptionHandler(AuthorizationException.class)
public AjaxResult handleAuthorizationException(AuthorizationException e)
{
log.error(e.getMessage(), e);
return AjaxResult.error(PermissionUtils.getMsg(e.getMessage()));
}
/**
* 请求方式不支持
*/
@ExceptionHandler({ HttpRequestMethodNotSupportedException.class })
public AjaxResult handleException(HttpRequestMethodNotSupportedException e)
{
log.error(e.getMessage(), e);
return AjaxResult.error("不支持' " + e.getMethod() + "'请求");
}
/**
* 拦截未知的运行时异常
*/
@ExceptionHandler(RuntimeException.class)
public AjaxResult notFount(RuntimeException e)
{
log.error("运行时异常:", e);
return AjaxResult.error("运行时异常:" + e.getMessage());
}
/**
* 系统异常
*/
@ExceptionHandler(Exception.class)
public AjaxResult handleException(Exception e)
{
log.error(e.getMessage(), e);
return AjaxResult.error("服务器错误,请联系管理员");
}
/**
* 业务异常
*/
@ExceptionHandler(BusinessException.class)
public AjaxResult businessException(BusinessException e)
{
log.error(e.getMessage(), e);
return AjaxResult.error(e.getMessage());
}
/**
* 演示模式异常
*/
@ExceptionHandler(DemoModeException.class)
public AjaxResult demoModeException(DemoModeException e)
{
return AjaxResult.error("演示模式,不允许操作");
}
}
package com.sinobase.framework.web.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
public interface BaseMapper<T> extends com.baomidou.mybatisplus.core.mapper.BaseMapper<T>{
/**
* 分页列表
* @param queryWrapper
* @return
*/
public List<T> selectPageList(Wrapper<T> queryWrapper);
}
package com.sinobase.framework.web.page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.List;
/**
* 接口返回数据
*
* @author Mikasa33
*/
@ApiModel
public class ApiData<T> implements Serializable
{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "状态码")
private Integer code;
@ApiModelProperty(value = "返回信息")
private String msg;
@ApiModelProperty("返回数据")
private T data; // 数据
public ApiData(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public static<T> ApiData info(Integer code, String msg, T data) {
ApiData api = new ApiData(code, msg);
api.setData(data);
return api;
}
public static ApiData info(Integer code, String msg) {
ApiData api = new ApiData(code, msg);
return api;
}
public static<T> ApiData success(T data) {
ApiData api = new ApiData(0, "success");
api.setData(data);
return api;
}
public static<T> ApiData fail(T data) {
ApiData api = new ApiData(500, "error");
api.setData(data);
return api;
}
public static ApiData success() {
ApiData api = new ApiData(200, "success");
return api;
}
public static ApiData fail() {
ApiData api = new ApiData(500, "error");
return api;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
package com.sinobase.framework.web.page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* 接口返回列表数据
*
* @author Mikasa33
*/
@ApiModel
public class PageData<T> implements Serializable
{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "总页数")
private long total;
@ApiModelProperty("返回数据")
private T list;
public long getTotal() {
return total;
}
public void setTotal(long total) {
this.total = total;
}
public T getList() {
return list;
}
public void setList(T list) {
this.list = list;
}
}
package com.sinobase.framework.web.page;
import com.sinobase.common.utils.StringUtils;
/**
* 分页数据
*
* @author sinobase
*/
public class PageDomain
{
/** 当前记录起始索引 */
private Integer pageNum;
/** 每页显示记录数 */
private Integer pageSize;
/** 排序列 */
private String orderByColumn;
/** 排序的方向 "desc" 或者 "asc". */
private String isAsc;
public String getOrderBy()
{
if (StringUtils.isEmpty(orderByColumn))
{
return "";
}
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
}
public Integer getPageNum()
{
return pageNum;
}
public void setPageNum(Integer pageNum)
{
this.pageNum = pageNum;
}
public Integer getPageSize()
{
return pageSize;
}
public void setPageSize(Integer pageSize)
{
this.pageSize = pageSize;
}
public String getOrderByColumn()
{
return orderByColumn;
}
public void setOrderByColumn(String orderByColumn)
{
this.orderByColumn = orderByColumn;
}
public String getIsAsc()
{
return isAsc;
}
public void setIsAsc(String isAsc)
{
this.isAsc = isAsc;
}
}
package com.sinobase.framework.web.page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 表格分页数据对象
*
* @author sinobase
*/
public class TableDataInfo implements Serializable
{
private static final long serialVersionUID = 1L;
/** 总记录数 */
private long total;
/** 列表数据 */
private List<?> rows;
/** 消息状态码 */
private int code;
/**
* 表格数据对象
*/
public TableDataInfo()
{
}
/**
* 分页
*
* @param list 列表数据
* @param total 总记录数
*/
public TableDataInfo(List<?> list, int total)
{
this.rows = list;
this.total = total;
}
public long getTotal()
{
return total;
}
public void setTotal(long total)
{
this.total = total;
}
public List<?> getRows()
{
return rows;
}
public void setRows(List<?> rows)
{
this.rows = rows;
}
public int getCode()
{
return code;
}
public void setCode(int code)
{
this.code = code;
}
public TableDataInfo(IPage<?> page){
this.total = 0;
this.rows = new ArrayList<>();
this.code = 0;
if(page!=null){
this.total = page.getTotal();
this.rows = page.getRecords();
}
}
}
package com.sinobase.framework.web.page;
import com.sinobase.common.utils.ServletUtils;
import com.sinobase.common.constant.Constants;
/**
* 表格数据处理
*
* @author sinobase
*/
public class TableSupport {
/**
* 封装分页对象
*/
public static PageDomain getPageDomain() {
PageDomain pageDomain = new PageDomain();
pageDomain.setPageNum(ServletUtils.getParameterToInt(Constants.PAGE_NUM));
pageDomain.setPageSize(ServletUtils.getParameterToInt(Constants.PAGE_SIZE));
pageDomain.setOrderByColumn(ServletUtils.getParameter(Constants.ORDER_BY_COLUMN));
pageDomain.setIsAsc(ServletUtils.getParameter(Constants.IS_ASC));
return pageDomain;
}
public static PageDomain buildPageRequest() {
return getPageDomain();
}
}
package com.sinobase.framework.web.service;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;
/**
* SinoBase首创 js调用 thymeleaf 实现按钮权限可见性
*
* @author sinobase
*/
@Service("permission")
public class PermissionService
{
public String hasPermi(String permission)
{
return isPermittedOperator(permission) ? "" : "hidden";
}
private boolean isPermittedOperator(String permission)
{
return SecurityUtils.getSubject().isPermitted(permission);
}
}
package com.sinobase.project.module.commonidea.mapper;
import com.sinobase.framework.web.mapper.BaseMapper;
import com.sinobase.project.module.commonidea.model.CommonIdea;
public interface CommonIdeaMapper extends BaseMapper<CommonIdea> {
}
package com.sinobase.project.module.commonidea.model;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
/**
* 常用意见表
*/
@TableName(value = "common_idea")
public class CommonIdea implements Serializable{
/**
* 主键ID
*/
private String id;
/**
* 用户ID
*/
private String userId;
/**
* 意见信息
*/
private String content;
/**
* 存放类型
*/
private String type;
/**
* 创建时间
*/
private String creTime;
/**
* 排序
*/
private String sort;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getCreTime() {
return creTime;
}
public void setCreTime(String creTime) {
this.creTime = creTime;
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
}
package com.sinobase.project.module.commonidea.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sinobase.common.utils.DateUtils;
import com.sinobase.common.utils.IdUtils;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.dboperate.CommonOP;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.datasource.aspectj.lang.annotation.DataSource;
import com.sinobase.datasource.aspectj.lang.enums.DataSourceType;
import com.sinobase.project.module.commonidea.mapper.CommonIdeaMapper;
import com.sinobase.project.module.commonidea.model.CommonIdea;
import com.sinobase.project.system.user.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import java.util.ArrayList;
import java.util.List;
/**
* ClassName:LeaveServiceImpl
* Package:com.sinobase.project.module.leave.service
* Description:请假管理业务层
*
* @date:2019/4/22 18:45
* @author:Long
*/
@Service
@EnableTransactionManagement
public class CommonIdeaServiceImpl implements ICommonIdeaService {
@Autowired
private CommonIdeaMapper commonIdeaMapper;
@Override
public CommonIdea get(String id) {
return commonIdeaMapper.selectById(id);
}
@Override
public void saveIdea(CommonIdea commonIdea) {
commonIdea.setId(IdUtils.getRandomIdByUUID());
commonIdea.setUserId(ShiroUtils.getUserId());
commonIdea.setCreTime(DateUtils.dateTimeNow("yyyy-MM-dd HH:mm:ss"));
commonIdea.setType("userAdd");
commonIdeaMapper.insert(commonIdea);
}
/**
* 保存常用意见
*
* @param idea
*/
public void saveIdea(String idea) {
User user = ShiroUtils.getSysUser();
CommonIdea model = new CommonIdea();
model.setId(IdUtils.getRandomIdByUUID());
model.setContent(idea);
model.setUserId(user.getUserId());
model.setCreTime(DateUtils.dateTimeNow("yyyy-MM-dd HH:mm:ss"));
model.setType("userAdd");
commonIdeaMapper.insert(model);
}
/**
* 删除常用意见
*
* @param id
*/
public void delIdea(String id) {
commonIdeaMapper.deleteById(id);
}
/**
* 获取登陆人的常用意见
*
* @return
*/
public List<CommonIdea> ideaList() {
User user = ShiroUtils.getSysUser();
List<CommonIdea> list = new ArrayList<CommonIdea>();
QueryWrapper<CommonIdea> query = new QueryWrapper<CommonIdea>();
query.eq(StringUtils.isNotEmpty(user.getUserId()), "user_id", user.getUserId()).or().eq("type", "system");
query.orderByAsc("cre_time");
list = commonIdeaMapper.selectList(query);
return list;
}
@Override
public void updateIdea(CommonIdea commonIdea) {
commonIdeaMapper.updateById(commonIdea);
}
@Override
public List<CommonIdea> list(CommonIdea commonIdea) {
QueryWrapper<CommonIdea> queryWrapper = new QueryWrapper<>();
if(StringUtils.isNotEmpty(commonIdea.getContent())){
queryWrapper.like(StringUtils.isNotEmpty(commonIdea.getContent()), "content", commonIdea.getContent());
queryWrapper.eq("user_id",ShiroUtils.getUserId());
}else {
queryWrapper.eq("user_id", ShiroUtils.getUserId()).or().eq("type", "system");
}
queryWrapper.orderByAsc("sort");
return commonIdeaMapper.selectList(queryWrapper);
}
@Override
public String sort(CommonIdea commonIdea) {
QueryWrapper<CommonIdea> queryWrapper = new QueryWrapper<>();
queryWrapper.ne(StringUtils.isNotEmpty(commonIdea.getId()), "id", commonIdea.getId());
queryWrapper.eq(StringUtils.isNotEmpty(commonIdea.getSort()), "sort", commonIdea.getSort());
if (StringUtils.isEmpty(commonIdea.getType())) {
queryWrapper.eq("user_id", ShiroUtils.getUserId()).or().eq("type", "system");
} else {
queryWrapper.eq("user_id", ShiroUtils.getUserId());
queryWrapper.eq("type", commonIdea.getType());
}
List<CommonIdea> commonIdeas = commonIdeaMapper.selectList(queryWrapper);
int max = 0;
for (CommonIdea c : commonIdeas) {
if (StringUtils.isNotEmpty(c.getSort()) && max < Integer.parseInt(c.getSort())) {
max = Integer.parseInt(c.getSort());
}
}
return (max + 1) + "";
}
@Override
public void setSort(String[] ids, Integer startSort) {
for (String id : ids) {
CommonIdea commonIdea = new CommonIdea();
commonIdea.setId(id);
commonIdea.setSort((startSort + 1) + "");
this.updateIdea(commonIdea);
startSort++;
}
}
@DataSource(DataSourceType.ORACLE)
public void updateleaderType(String userId,String deptId,String recordId,String isGroup ,String ideaType){
if(isGroup.indexOf('3')>-1 ){ //1代表虚拟部门
if(deptId!=null && deptId.length()>3){
deptId = deptId.substring(0,deptId.length()-3);
}
}
if(ideaType ==null ||"".equals(ideaType)){
ideaType = "QF_NOTION";
}
String updatesql2 = "update FLOW_IDEA set WFISVISIBLE='0' where WFISVISIBLE='1' and STATTAG = '1' and WFISVISIBLE = '1' and ISVISIBLE = '1' and SUBISVISIBLE = '1' and IDEAFIELDNAME = '"+ideaType+"' and userid='"+userId+"' and RECORDID = '"+recordId+"' and deptid ='"+deptId+"'";
CommonOP.getOperateTable().updateSqlOperate(updatesql2);
}
}
package com.sinobase.project.module.commonidea.service;
import com.sinobase.project.module.commonidea.model.CommonIdea;
import java.util.List;
public interface ICommonIdeaService {
CommonIdea get(String id);
void saveIdea(CommonIdea commonIdea);
public void saveIdea(String idea);
public void delIdea(String id);
public List<CommonIdea> ideaList();
void updateIdea(CommonIdea commonIdea);
List<CommonIdea> list(CommonIdea commonIdea);
/**
* 返回当前用户的最新排序号
*
* @param commonIdea
* @return
*/
String sort(CommonIdea commonIdea);
/**
* 拖拽排序实现逻辑
* @param ids
* @param startSort
*/
void setSort(String [] ids,Integer startSort);
void updateleaderType(String userId,String deptId,String recordId,String isGroup ,String ideaType);
}
package com.sinobase.project.module.meeting.contants;
/**
* @author WangSJ
* @ClassName MeetingConstants
* @Description 会议静态变量类
* @Date 2019/4/9 11:05
* @Version 1.0
*/
public class MeetingConstants
{
/**
* 会议服务 启用
*/
public static String MEETING_SERVICE_ENABLE = "enable";
/**
* 会议服务 停用
*/
public static String MEETING_SERVICE_DEACTIVATE = "deactivate";
/**
* 收费
*/
public static String MEETING_SERVICE_CHARGES = "charges";
/**
* 免费
*/
public static String MEETING_SERVICE_FREE = "free";
/** 会议状态 */
/**
* 草稿
*/
public static String MEETING_SUBFLAG_00 = "00";
/**
* 审核中
*/
public static String MEETING_SUBFLAG_01 = "01";
/**
* 已发布
*/
public static String MEETING_SUBFLAG_02 = "02";
/** 会议室状态 */
/**
* 会议室 启用
*/
public static String MEETING_ROOM_ENABLE = "enable";
/**
* 会议室 停用
*/
public static String MEETING_ROOM_DEACTIVATE = "deactivate";
/** 会务状态 */
/**
* 会务草稿状态
*/
public static String MEETING_JOB_DRAFT = "draft";
/**
* 会务流程中状态
*/
public static String MEETING_JOB_PROCESS = "process";
}
package com.sinobase.project.module.meeting.controller;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.project.module.meeting.model.MeetingAffairsFeedback;
import com.sinobase.project.module.meeting.service.IMeetingAffairsFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @Author: PiscesYang
* @Description: 会务反馈
* @CreateTime: 2019-06-12 11:25
* @Version: 1.0
**/
@Controller
@RequestMapping("/meetingAffairsFeedback")
public class MeetingAffairsFeedbackController extends BaseController {
private String prefix = "module/meeting/meetingJobconnect";
@Autowired
IMeetingAffairsFeedbackService meetingAffairsFeedbackService; //会务反馈业务类
/**
* 保存或修改
* @param model
* @return
*/
@RequestMapping("/saveOrUpdate")
@ResponseBody
public AjaxResult saveOrUpdate(MeetingAffairsFeedback model){
meetingAffairsFeedbackService.saveOrUpdate(model);
return super.success();
}
/**
* 协作完成
* @return
*/
@RequestMapping("/completion")
@ResponseBody
public AjaxResult completion(MeetingAffairsFeedback model){
meetingAffairsFeedbackService.completion(model);
return super.success();
}
}
package com.sinobase.project.module.meeting.controller;
import com.sinobase.common.utils.poi.ExcelUtil;
import com.sinobase.framework.aspectj.lang.annotation.Log;
import com.sinobase.framework.aspectj.lang.enums.BusinessType;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.project.module.meeting.model.MeetingCollaborativeMatters;
import com.sinobase.project.module.meeting.service.IMeetingCollaborativeMattersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 会议协作事项 信息操作处理
*
* @author PiscesYang
* @date 2019-05-05
*/
@Controller
@RequestMapping("/meetingCollaborativeMatters")
public class MeetingCollaborativeMattersController extends BaseController {
private String prefix = "module/meeting/meetingCollaborativeMatters";
@Autowired
private IMeetingCollaborativeMattersService meetingCollaborativeMattersService;
@GetMapping()
public String meetingCollaborativeMatters() {
return prefix + "/meetingCollaborativeMatters";
}
/**
* 查询会议协作事项列表
*/
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(MeetingCollaborativeMatters meetingCollaborativeMatters) {
startPage();
List<MeetingCollaborativeMatters> list = meetingCollaborativeMattersService.selectMeetingCollaborativeMattersList(meetingCollaborativeMatters);
return getDataTable(list);
}
/**
* 导出会议协作事项列表
*/
@PostMapping("/export")
@ResponseBody
public AjaxResult export(MeetingCollaborativeMatters meetingCollaborativeMatters) {
List<MeetingCollaborativeMatters> list = meetingCollaborativeMattersService.selectMeetingCollaborativeMattersList(meetingCollaborativeMatters);
ExcelUtil<MeetingCollaborativeMatters> util = new ExcelUtil<MeetingCollaborativeMatters>(MeetingCollaborativeMatters.class);
return util.exportExcel(list, "meetingCollaborativeMatters");
}
/**
* 新增会议协作事项
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
* 新增保存会议协作事项
*/
@Log(title = "会议协作事项", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(MeetingCollaborativeMatters meetingCollaborativeMatters) {
return toAjax(meetingCollaborativeMattersService.insertMeetingCollaborativeMatters(meetingCollaborativeMatters));
}
/**
* 修改会议协作事项
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") String id, ModelMap mmap){
MeetingCollaborativeMatters meetingCollaborativeMatters = meetingCollaborativeMattersService.selectMeetingCollaborativeMattersById(id);
mmap.put("meetingCollaborativeMatters", meetingCollaborativeMatters);
return prefix + "/edit";
}
/**
* 修改保存会议协作事项
*/
@Log(title = "会议协作事项", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(MeetingCollaborativeMatters meetingCollaborativeMatters) {
return toAjax(meetingCollaborativeMattersService.updateMeetingCollaborativeMatters(meetingCollaborativeMatters));
}
/**
* 删除会议协作事项
*/
@Log(title = "会议协作事项", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids){
return toAjax(meetingCollaborativeMattersService.deleteMeetingCollaborativeMattersByIds(ids));
}
/**
* 通过cooperationId删除相关联的Matter信息
* @param cooperationId
* @return
*/
@Log(title = "会议协作事项", businessType = BusinessType.DELETE)
@PostMapping( "/removeByCooperationId")
@ResponseBody
public AjaxResult removeByCooperationId(String cooperationId){
meetingCollaborativeMattersService.deleteMattersByCooperationId(cooperationId);
return this.success();
}
}
package com.sinobase.project.module.meeting.controller;
import com.sinobase.common.utils.poi.ExcelUtil;
import com.sinobase.framework.aspectj.lang.annotation.Log;
import com.sinobase.framework.aspectj.lang.enums.BusinessType;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.project.module.meeting.model.MeetingCooperation;
import com.sinobase.project.module.meeting.service.IMeetingCooperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 会议协作明细 信息操作处理
*
* @author PiscesYang
* @date 2019-05-05
*/
@Controller
@RequestMapping("/meetingCooperation")
public class MeetingCooperationController extends BaseController {
private String prefix = "module/meeting/meetingCooperation";
@Autowired
private IMeetingCooperationService meetingCooperationService;
@GetMapping()
public String meetingCooperation() {
return prefix + "/meetingCooperation";
}
/**
* 查询会议协作明细列表
*/
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(MeetingCooperation meetingCooperation) {
startPage();
List<MeetingCooperation> list = meetingCooperationService.selectMeetingCooperationList(meetingCooperation);
return getDataTable(list);
}
/**
* 导出会议协作明细列表
*/
@PostMapping("/export")
@ResponseBody
public AjaxResult export(MeetingCooperation meetingCooperation) {
List<MeetingCooperation> list = meetingCooperationService.selectMeetingCooperationList(meetingCooperation);
ExcelUtil<MeetingCooperation> util = new ExcelUtil<MeetingCooperation>(MeetingCooperation.class);
return util.exportExcel(list, "meetingCooperation");
}
/**
* 新增会议协作明细
*/
@GetMapping("/add")
public String add() {
return prefix + "/add";
}
/**
* 新增保存会议协作明细
*/
@Log(title = "会议协作明细", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(MeetingCooperation meetingCooperation) {
return toAjax(meetingCooperationService.insertMeetingCooperation(meetingCooperation));
}
/**
* 修改会议协作明细
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") String id, ModelMap mmap){
MeetingCooperation meetingCooperation = meetingCooperationService.selectMeetingCooperationById(id);
mmap.put("meetingCooperation", meetingCooperation);
return prefix + "/edit";
}
/**
* 修改保存会议协作明细
*/
@Log(title = "会议协作明细", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(MeetingCooperation meetingCooperation) {
return toAjax(meetingCooperationService.updateMeetingCooperation(meetingCooperation));
}
/**
* 删除会议协作明细
*/
@Log(title = "会议协作明细", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids){
return toAjax(meetingCooperationService.deleteMeetingCooperationByIds(ids));
}
}
package com.sinobase.project.module.meeting.controller;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.framework.aspectj.lang.annotation.Log;
import com.sinobase.framework.aspectj.lang.enums.BusinessType;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.project.module.meeting.model.MeetingFeedback;
import com.sinobase.project.module.meeting.service.IMeetingFeedbackService;
import com.sinobase.project.system.user.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.List;
/**
* @Author: PiscesYang
* @Description: 会议反馈
* @CreateTime: 2019-06-12 11:25
* @Version: 1.0
**/
@Controller
@RequestMapping("/meetingFeedback")
public class MeetingFeedbackController extends BaseController {
private String prefix = "module/meeting/meetingFeedback";
@Autowired
IMeetingFeedbackService meetingFeedbackService; //会议反馈业务类
@RequestMapping("/{meetingId}")
public String meetingFeedback(ModelMap map,@PathVariable("meetingId")String meetingId) {
map.put("title", "会议反馈列表");
map.put("meetingId", meetingId);
return prefix + "/list";
}
/**
* 获取会议反馈列表
* @param meetingFeedback
* @return
*/
@RequestMapping("/listMeetingFeedback/{meetingId}")
@ResponseBody
public TableDataInfo listMeetingFeedback(MeetingFeedback meetingFeedback,@PathVariable("meetingId")String meetingId){
startPage();
meetingFeedback.setMeetingId(meetingId);
List<MeetingFeedback> list = new ArrayList<MeetingFeedback>();
list = meetingFeedbackService.selectMeetingFeedbackList(meetingFeedback);
return getDataTable(list);
}
/**
* 添加会议反馈 -- 跳转
* @return
*/
@RequestMapping("/addMeetingFeedback/{meetingId}")
public String addMeetingFeedback(@PathVariable("meetingId")String meetingId,ModelMap modelMap){
MeetingFeedback model = new MeetingFeedback();
User currentUser = ShiroUtils.getSysUser();
model.setCreUserid(currentUser.getUserId());
model.setMeetingId(meetingId);
List<MeetingFeedback> list = new ArrayList<MeetingFeedback>();
list = meetingFeedbackService.selectMeetingFeedbackList(model);
if(list.size()>0){
modelMap.put("info",list.get(0));
}else{
model = meetingFeedbackService.initMeetingFeedback(model);
modelMap.put("info",model);
}
return prefix + "/edit";
}
/**
* 添加会议反馈
* @param meetingFeedback
* @return
*/
@Log(title = "会议反馈",businessType = BusinessType.INSERT)
@RequestMapping("/saveMeetingFeedback")
@ResponseBody
public AjaxResult saveMeetingFeedback(MeetingFeedback meetingFeedback){
meetingFeedbackService.insertMeetingFeedback(meetingFeedback);
return super.success();
}
/**
* 修改会议反馈 -- 跳转
* @param meetingFeedbackId
* @param modelMap
* @return
*/
@RequestMapping("/updateMeetingFeedback/{meetingFeedbackId}")
public String updateMeetingFeedback(@PathVariable("meetingFeedbackId")String meetingFeedbackId,ModelMap modelMap){
modelMap.put("info",meetingFeedbackService.selectMeetingFeedbackById(meetingFeedbackId));
return prefix + "/edit";
}
/**
* 查看会议反馈 -- 跳转
* @param meetingFeedbackId
* @param modelMap
* @return
*/
@RequestMapping("/viewMeetingFeedback/{meetingFeedbackId}")
public String viewMeetingFeedback(@PathVariable("meetingFeedbackId")String meetingFeedbackId,ModelMap modelMap){
modelMap.put("info",meetingFeedbackService.selectMeetingFeedbackById(meetingFeedbackId));
return prefix + "/view";
}
/**
* 修改会议反馈
* @param meetingFeedback
* @return
*/
@Log(title = "会议反馈",businessType = BusinessType.UPDATE)
@RequestMapping("/updateMeetingFeedback")
@ResponseBody
public AjaxResult updateMeetingFeedback(MeetingFeedback meetingFeedback){
meetingFeedbackService.updateMeetingFeedback(meetingFeedback);
return super.success();
}
/**
* 删除会议反馈
* @param ids
* @return
*/
@Log(title = "会议反馈",businessType = BusinessType.DELETE)
@RequestMapping("/delMeetingFeedback")
@ResponseBody
public AjaxResult delMeetingFeedback(String ids){
meetingFeedbackService.deleteMeetingFeedbackByIds(ids);
return super.success();
}
}
package com.sinobase.project.module.meeting.controller;
import com.sinobase.framework.aspectj.lang.annotation.Log;
import com.sinobase.framework.aspectj.lang.enums.BusinessType;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.project.module.meeting.model.MeetingOutUser;
import com.sinobase.project.module.meeting.service.IMeetingOutUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* @Author: PiscesYang
* @Description: 会议外来人员
* @CreateTime: 2019-05-22 16:35
* @Version: 1.0
**/
@Controller
@RequestMapping("/meetingOutUser")
public class MeetingOutUserController extends BaseController {
private String prefix = "module/meeting/meetingOutUser";
@Autowired
IMeetingOutUserService meetingOutUserService; //会议外来人员业务类
@RequestMapping()
public String meetingOutUser(ModelMap map) {
map.put("title", "会议外来人员列表");
return prefix + "/list";
}
/**
* 获取会议外来人员列表
* @param meetingOutUser
* @return
*/
@RequestMapping("/listMeetingOutUser")
@ResponseBody
public TableDataInfo listMeetingOutUser(MeetingOutUser meetingOutUser){
startPage();
List<MeetingOutUser> meetinglist = meetingOutUserService.selectMeetingOutUserList(meetingOutUser);
return getDataTable(meetinglist);
}
/**
* 添加会议外来人员 -- 跳转
* @return
*/
@RequestMapping("/addMeetingOutUser")
public String addMeetingOutUser(){
return prefix + "/add";
}
/**
* 添加会议外来人员
* @param meetingOutUser
* @return
*/
@Log(title = "会议外来人员",businessType = BusinessType.INSERT)
@RequestMapping("/saveMeetingOutUser")
@ResponseBody
public AjaxResult saveMeetingOutUser(MeetingOutUser meetingOutUser){
meetingOutUserService.insertMeetingOutUser(meetingOutUser);
return super.success();
}
/**
* 修改会议外来人员 -- 跳转
* @param meetingOutUserId
* @param modelMap
* @return
*/
@RequestMapping("/updateMeetingOutUser/{meetingOutUserId}")
public String updateMeetingOutUser(@PathVariable("meetingOutUserId")String meetingOutUserId,ModelMap modelMap){
modelMap.put("meetingOutUser",meetingOutUserService.selectMeetingOutUserById(meetingOutUserId));
return prefix + "/edit";
}
/**
* 修改会议外来人员
* @param meetingOutUser
* @return
*/
@Log(title = "会议外来人员",businessType = BusinessType.UPDATE)
@RequestMapping("/updateMeetingOutUser")
@ResponseBody
public AjaxResult updateMeetingOutUser(MeetingOutUser meetingOutUser){
meetingOutUserService.updateMeetingOutUser(meetingOutUser);
return super.success();
}
/**
* 删除会议外来人员
* @param ids
* @return
*/
@Log(title = "会议外来人员",businessType = BusinessType.DELETE)
@RequestMapping("/delMeetingOutUser")
@ResponseBody
public AjaxResult delMeetingOutUser(String ids){
meetingOutUserService.deleteMeetingOutUserByIds(ids);
return super.success();
}
}
package com.sinobase.project.module.meeting.controller;
import com.sinobase.framework.aspectj.lang.annotation.Log;
import com.sinobase.framework.aspectj.lang.enums.BusinessType;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.project.module.meeting.model.MeetingProperty;
import com.sinobase.project.module.meeting.service.IMeetingPropertyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* @Author: PiscesYang
* @Description: 会议物业
* @CreateTime: 2019-06-12 11:35
* @Version: 1.0
**/
@Controller
@RequestMapping("/meetingProperty")
public class MeetingPropertyController extends BaseController {
private String prefix = "module/meeting/meetingProperty";
@Autowired
IMeetingPropertyService meetingPropertyService; //会议物业业务类
@RequestMapping()
public String meetingProperty(ModelMap map) {
map.put("title", "会议物业列表");
return prefix + "/list";
}
/**
* 获取会议物业列表
* @param meetingProperty
* @return
*/
@RequestMapping("/listMeetingProperty")
@ResponseBody
public TableDataInfo listMeetingProperty(MeetingProperty meetingProperty){
startPage();
List<MeetingProperty> list = meetingPropertyService.selectMeetingPropertyList(meetingProperty);
return getDataTable(list);
}
/**
* 添加会议物业 -- 跳转
* @return
*/
@RequestMapping("/addMeetingProperty")
public String addMeetingProperty(ModelMap modelMap){
modelMap.put("info",meetingPropertyService.initMeetingProperty());
return prefix + "/edit";
}
/**
* 添加会议物业
* @param meetingProperty
* @return
*/
@Log(title = "会议物业",businessType = BusinessType.INSERT)
@RequestMapping("/saveMeetingProperty")
@ResponseBody
public AjaxResult saveMeetingProperty(MeetingProperty meetingProperty){
meetingPropertyService.insertMeetingProperty(meetingProperty);
return super.success();
}
/**
* 修改会议物业 -- 跳转
* @param meetingPropertyId
* @param modelMap
* @return
*/
@RequestMapping("/updateMeetingProperty/{meetingPropertyId}")
public String updateMeetingProperty(@PathVariable("meetingPropertyId")String meetingPropertyId,ModelMap modelMap){
modelMap.put("info",meetingPropertyService.selectMeetingPropertyById(meetingPropertyId));
return prefix + "/edit";
}
/**
* 修改会议物业
* @param meetingProperty
* @return
*/
@Log(title = "会议物业",businessType = BusinessType.UPDATE)
@RequestMapping("/updateMeetingProperty")
@ResponseBody
public AjaxResult updateMeetingProperty(MeetingProperty meetingProperty){
meetingPropertyService.updateMeetingProperty(meetingProperty);
return super.success();
}
/**
* 删除会议物业
* @param ids
* @return
*/
@Log(title = "会议物业",businessType = BusinessType.DELETE)
@RequestMapping("/delMeetingProperty")
@ResponseBody
public AjaxResult delMeetingProperty(String ids){
meetingPropertyService.deleteMeetingPropertyByIds(ids);
return super.success();
}
}
package com.sinobase.project.module.meeting.controller;
import com.sinobase.framework.aspectj.lang.annotation.Log;
import com.sinobase.framework.aspectj.lang.enums.BusinessType;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.project.module.meeting.model.MeetingService;
import com.sinobase.project.module.meeting.service.IMeetingServiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.*;
/**
* @author WangSJ
* @ClassName MeetingServiceController
* @Description 会议服务控制器
* @Date 2019/4/9 16:59
* @Version 1.0
*/
@Controller
@RequestMapping("/meetingService")
public class MeetingServiceController extends BaseController {
private String prefix = "module/meeting/meetingService";
@Autowired
IMeetingServiceService meetingServiceService; //会议服务业务类
@RequestMapping()
public String meetingService(ModelMap map) {
map.put("title", "会议服务列表");
return prefix + "/list";
}
/**
* 添加会议服务 -- 跳转
*/
@RequestMapping("/addMeetingService")
public String addMeetingService() {
return prefix + "/add";
}
/**
* 修改会议服务 -- 跳转
*
* @return
*/
@RequestMapping("/updateMeetingService/{meetingServiceId}")
public String updateMeetingService(@PathVariable("meetingServiceId") String meetingServiceId, ModelMap modelMap) {
modelMap.put("meetingService", meetingServiceService.getMeetingService(meetingServiceId));
return prefix + "/edit";
}
/**
* 修改会议服务
*
* @param meetingService
* @return
*/
@Log(title = "会议服务", businessType = BusinessType.UPDATE)
@RequestMapping("/updateMeetingService")
@ResponseBody
public AjaxResult updateMeetingService(MeetingService meetingService) {
meetingServiceService.updateMeetingService(meetingService);
return super.success();
}
/**
* 添加会议服务
*
* @param meetingService
*/
@Log(title = "会议服务", businessType = BusinessType.INSERT)
@RequestMapping("/saveMeetingService")
@ResponseBody
public AjaxResult saveMeetingService(MeetingService meetingService) {
meetingServiceService.saveMeetingService(meetingService);
return super.success();
}
/**
* 删除会议
*
* @param ids
* @return
*/
@Log(title = "会议服务", businessType = BusinessType.DELETE)
@RequestMapping("/delMeetingService")
@ResponseBody
public AjaxResult delMeetingService(String ids) {
meetingServiceService.delMeetingService(ids.split(","));
return super.success();
}
/**
* 获取会议服务
*
* @param meetingService
* @return
*/
@RequestMapping("/listMeetingService")
@ResponseBody
public TableDataInfo listMeetingService(MeetingService meetingService) {
startPage();
List<MeetingService> meetingServiceList = meetingServiceService.listMeetingService(meetingService);
return getDataTable(meetingServiceList);
}
}
package com.sinobase.project.module.meeting.controller;
import com.sinobase.framework.aspectj.lang.annotation.Log;
import com.sinobase.framework.aspectj.lang.enums.BusinessType;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.project.module.meeting.model.MeetingTime;
import com.sinobase.project.module.meeting.service.IMeetingTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* @Author: PiscesYang
* @Description: 会议时间
* @CreateTime: 2019-05-15 10:35
* @Version: 1.0
**/
@Controller
@RequestMapping("/meetingTime")
public class MeetingTimeController extends BaseController {
private String prefix = "module/meeting/meetingTime";
@Autowired
IMeetingTimeService meetingTimeService; //会议时间业务类
@RequestMapping()
public String meetingTime(ModelMap map) {
map.put("title", "会议时间列表");
return prefix + "/list";
}
/**
* 获取会议时间列表
* @param meetingTime
* @return
*/
@RequestMapping("/listMeetingTime")
@ResponseBody
public TableDataInfo listMeetingTime(MeetingTime meetingTime){
startPage();
List<MeetingTime> meetinglist = meetingTimeService.selectMeetingTimeList(meetingTime);
return getDataTable(meetinglist);
}
/**
* 添加会议时间 -- 跳转
* @return
*/
@RequestMapping("/addMeetingTime")
public String addMeetingTime(){
return prefix + "/add";
}
/**
* 添加会议时间
* @param meetingTime
* @return
*/
@Log(title = "会议时间",businessType = BusinessType.INSERT)
@RequestMapping("/saveMeetingTime")
@ResponseBody
public AjaxResult saveMeetingTime(MeetingTime meetingTime){
meetingTimeService.insertMeetingTime(meetingTime);
return super.success();
}
/**
* 修改会议时间 -- 跳转
* @param meetingTimeId
* @param modelMap
* @return
*/
@RequestMapping("/updateMeetingTime/{meetingTimeId}")
public String updateMeetingTime(@PathVariable("meetingTimeId")String meetingTimeId,ModelMap modelMap){
modelMap.put("meetingTime",meetingTimeService.selectMeetingTimeById(meetingTimeId));
return prefix + "/edit";
}
/**
* 修改会议时间
* @param meetingTime
* @return
*/
@Log(title = "会议时间",businessType = BusinessType.UPDATE)
@RequestMapping("/updateMeetingTime")
@ResponseBody
public AjaxResult updateMeetingTime(MeetingTime meetingTime){
meetingTimeService.updateMeetingTime(meetingTime);
return super.success();
}
/**
* 删除会议时间
* @param ids
* @return
*/
@Log(title = "会议时间",businessType = BusinessType.DELETE)
@RequestMapping("/delMeetingTime")
@ResponseBody
public AjaxResult delMeetingTime(String ids){
meetingTimeService.deleteMeetingTimeByIds(ids);
return super.success();
}
/**
* 会议时间验证
* @param meetingTimes
* @param roomId
* @param id
* @return
*/
@RequestMapping("/checkMeetingTime")
@ResponseBody
public List<MeetingTime> checkMeetingTime(String meetingTimes,String roomId,String id){
List<MeetingTime> list = meetingTimeService.checkMeetingTime(meetingTimes,roomId,id);
return list;
}
}
package com.sinobase.project.module.meeting.controller;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.project.module.meeting.model.YzMeetingManager;
import com.sinobase.project.module.meeting.service.IYzMeetingManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author WangSJ
* @Description 旧OA会议管理控制器
* @Date 2019/6/29 11:16
* @Version 1.0
*/
@Controller
@RequestMapping("/system/yzMeetingManager")
public class YzMeetingManagerController extends BaseController {
@Autowired
IYzMeetingManagerService yzMeetingManagerService; //旧OA会议管理业务类
/**
* 根据会议管理实体类属性查询会议列表
* @param yzMeetingManager
* @return
*/
@RequestMapping("/listYzMeetingManager")
@ResponseBody
public TableDataInfo listYzMeetingManager(YzMeetingManager yzMeetingManager){
startPage();
List<YzMeetingManager> yzMeetingManagerList = yzMeetingManagerService.listYzMeetingManager(yzMeetingManager);
return getDataTable(yzMeetingManagerList);
}
/**
* 根据会议管理实体类属性查询会议列表JSON
* @param yzMeetingManager
* @return
*/
@RequestMapping("/listYzMeetingManagerToJSON")
@ResponseBody
public AjaxResult listYzMeetingManagerToJSON(YzMeetingManager yzMeetingManager){
List<YzMeetingManager> yzMeetingManagerList = yzMeetingManagerService.listYzMeetingManager(yzMeetingManager);
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("list", yzMeetingManagerList);
return super.success(resultMap);
}
/**
* 根据会议管理实体类属性查询会议列表
* @param yzMeetingManager
* @return
*/
@RequestMapping("/listYzMeetingManagerForCurrentUser")
@ResponseBody
public TableDataInfo listYzMeetingManagerForCurrentUser(YzMeetingManager yzMeetingManager){
startPage();
List<YzMeetingManager> yzMeetingManagerList = yzMeetingManagerService.listYzMeetingManagerFormCurrentUser(yzMeetingManager);
return getDataTable(yzMeetingManagerList);
}
/**
* 根据会议管理实体类属性查询会议列表JSON
* @param yzMeetingManager
* @return
*/
@RequestMapping("/listYzMeetingManagerForCurrentUserToJSON")
@ResponseBody
public AjaxResult listYzMeetingManagerForCurrentUserToJSON(YzMeetingManager yzMeetingManager){
List<YzMeetingManager> yzMeetingManagerList = yzMeetingManagerService.listYzMeetingManagerFormCurrentUser(yzMeetingManager);
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("list", yzMeetingManagerList);
return super.success(resultMap);
}
/**
* 根据会议管理主键ID获取会议管理详细信息
*
* @param id
* @return
*/
@RequestMapping("/getYzMeetingManager/{id}")
@ResponseBody
public AjaxResult getYzMeetingManager(@PathVariable("id") String id) {
if (StringUtils.isEmpty(id)) {
return super.error("获取错误:请选择要获取的数据");
} else {
YzMeetingManager yzMeetingManager = yzMeetingManagerService.getYzMeetingManager(id);
if (yzMeetingManager == null) {
return super.error("获取错误:未找到会议管理数据");
} else {
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("yzMeetingManager", yzMeetingManager);
return super.success(resultMap);
}
}
}
}
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.project.module.meeting.model.MeetingAffairsFeedback;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author PiscesYang
* @ClassName MeetingAffairsFeedbackMapper
* @Description meeting_affairs_feedback
* @Date 2019/6/12 10:18
* @Version 1.0
*/
@Repository
public interface MeetingAffairsFeedbackMapper{
void insertAffairsFeedback(MeetingAffairsFeedback model);
void updateAffairsFeedback(MeetingAffairsFeedback model);
void deleteAffairsFeedbackByIds(String[] ids);
List<MeetingAffairsFeedback> selectAffairsFeedbackList(MeetingAffairsFeedback model);
MeetingAffairsFeedback selectAffairsFeedbackById(String id);
}
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.project.module.meeting.model.MeetingCollaborativeMatters;
import java.util.List;
/**
* 会议协作事项 数据层
*
* @author PiscesYang
* @date 2019-05-05
*/
public interface MeetingCollaborativeMattersMapper {
/**
* 查询会议协作事项信息
*
* @param id 会议协作事项ID
* @return 会议协作事项信息
*/
public MeetingCollaborativeMatters selectMeetingCollaborativeMattersById(String id);
/**
* 查询会议协作事项列表
*
* @param meetingCollaborativeMatters 会议协作事项信息
* @return 会议协作事项集合
*/
public List<MeetingCollaborativeMatters> selectMeetingCollaborativeMattersList(MeetingCollaborativeMatters meetingCollaborativeMatters);
/**
* 新增会议协作事项
*
* @param meetingCollaborativeMatters 会议协作事项信息
* @return 结果
*/
public int insertMeetingCollaborativeMatters(MeetingCollaborativeMatters meetingCollaborativeMatters);
/**
* 修改会议协作事项
*
* @param meetingCollaborativeMatters 会议协作事项信息
* @return 结果
*/
public int updateMeetingCollaborativeMatters(MeetingCollaborativeMatters meetingCollaborativeMatters);
/**
* 删除会议协作事项
*
* @param id 会议协作事项ID
* @return 结果
*/
public int deleteMeetingCollaborativeMattersById(String id);
/**
* 批量删除会议协作事项
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteMeetingCollaborativeMattersByIds(String[] ids);
/**
* 通过cooperationId删除相关联的Matter数据
* @param cooperationId
* @return
*/
public int deleteMattersByCooperationId(String cooperationId);
}
\ No newline at end of file
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.project.module.meeting.model.MeetingCooperation;
import java.util.List;
/**
* 会议协作明细 数据层
*
* @author PiscesYang
* @date 2019-05-05
*/
public interface MeetingCooperationMapper {
/**
* 查询会议协作明细信息
*
* @param id 会议协作明细ID
* @return 会议协作明细信息
*/
public MeetingCooperation selectMeetingCooperationById(String id);
/**
* 查询会议协作明细列表
*
* @param meetingCooperation 会议协作明细信息
* @return 会议协作明细集合
*/
public List<MeetingCooperation> selectMeetingCooperationList(MeetingCooperation meetingCooperation);
/**
* 新增会议协作明细
*
* @param meetingCooperation 会议协作明细信息
* @return 结果
*/
public int insertMeetingCooperation(MeetingCooperation meetingCooperation);
/**
* 修改会议协作明细
*
* @param meetingCooperation 会议协作明细信息
* @return 结果
*/
public int updateMeetingCooperation(MeetingCooperation meetingCooperation);
/**
* 删除会议协作明细
*
* @param id 会议协作明细ID
* @return 结果
*/
public int deleteMeetingCooperationById(String id);
/**
* 批量删除会议协作明细
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteMeetingCooperationByIds(String[] ids);
}
\ No newline at end of file
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.project.module.meeting.model.MeetingFeedback;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author PiscesYang
* @ClassName MeetingFeedbackMapper
* @Description meeting_feedback
* @Date 2019/6/12 10:18
* @Version 1.0
*/
@Repository
public interface MeetingFeedbackMapper
{
/**
* 查询会议反馈信息
*
* @param id 会议反馈ID
* @return 会议反馈信息
*/
public MeetingFeedback selectMeetingFeedbackById(String id);
/**
* 查询会议反馈列表
*
* @param meetingFeedback 会议反馈信息
* @return 会议反馈集合
*/
public List<MeetingFeedback> selectMeetingFeedbackList(MeetingFeedback meetingFeedback);
/**
* 新增会议反馈
*
* @param meetingFeedback 会议反馈信息
* @return 结果
*/
public int insertMeetingFeedback(MeetingFeedback meetingFeedback);
/**
* 修改会议反馈
*
* @param meetingFeedback 会议反馈信息
* @return 结果
*/
public int updateMeetingFeedback(MeetingFeedback meetingFeedback);
/**
* 批量删除会议反馈
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteMeetingFeedbackByIds(String[] ids);
}
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.project.module.meeting.model.MeetingJobconnect;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 会议工作联系 数据层
*
* @author PiscesYang
* @date 2019-05-05
*/
@Repository
public interface MeetingJobconnectMapper {
/**
* 查询会议工作联系信息
*
* @param id 会议工作联系ID
* @return 会议工作联系信息
*/
public MeetingJobconnect selectMeetingJobconnectById(String id);
/**
* 查询会议工作联系列表
*
* @param meetingJobconnect 会议工作联系信息
* @return 会议工作联系集合
*/
public List<MeetingJobconnect> selectMeetingJobconnectList(MeetingJobconnect meetingJobconnect);
/**
* 新增会议工作联系
*
* @param meetingJobconnect 会议工作联系信息
* @return 结果
*/
public int insertMeetingJobconnect(MeetingJobconnect meetingJobconnect);
/**
* 修改会议工作联系
*
* @param meetingJobconnect 会议工作联系信息
* @return 结果
*/
public int updateMeetingJobconnect(MeetingJobconnect meetingJobconnect);
/**
* 删除会议工作联系
*
* @param id 会议工作联系ID
* @return 结果
*/
public int deleteMeetingJobconnectById(String id);
/**
* 批量删除会议工作联系
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteMeetingJobconnectByIds(String[] ids);
/**
* 获取审批会务列表
* @param model
* @return
*/
public List<MeetingJobconnect> listAffairApproval(MeetingJobconnect model);
}
\ No newline at end of file
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.project.module.meeting.model.Meeting;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author WangSJ
* @Description meeting
* @Date 2019/4/11 17:18
* @Version 1.0
*/
@Repository
public interface MeetingMapper {
/**
* 添加会议
* @param meeting
*/
void saveMeeting(Meeting meeting);
/**
* 修改会议
* @param meeting
*/
void updateMeeting(Meeting meeting);
/**
* 删除会议
* @param ids
*/
void delMeeting(String [] ids);
/**
* 查询会议列表
*
* @param meeting
* @return
*/
List<Meeting> listMeeting(Meeting meeting);
/**
* 获取审批会议列表
* @param meeting
* @return
*/
List<Meeting> listMeetingApproval(Meeting meeting);
/**
* 获取会议详细信息
* @param id
* @return
*/
Meeting getMeeting(String id);
/**
* 获取今天登录人的会议信息
* @param meeting
* @return
*/
List<Meeting> listMeetingToday(Meeting meeting);
/**
* 一周会议
* @param meeting
* @return
*/
List<Meeting> weekMeeting(Meeting meeting);
/**
* 获取待办信息
* @return
*/
List<Meeting> getDBList(Meeting model);
}
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.project.module.meeting.model.MeetingOutUser;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author PiscesYang
* @ClassName MeetingOutUserMapper
* @Description meeting_outuser
* @Date 2019/5/22 15:18
* @Version 1.0
*/
@Repository
public interface MeetingOutUserMapper
{
/**
* 查询会议外来人员信息
*
* @param id 会议外来人员ID
* @return 会议外来人员信息
*/
public MeetingOutUser selectMeetingOutUserById(String id);
/**
* 查询会议外来人员列表
*
* @param meetingOutUser 会议外来人员信息
* @return 会议外来人员集合
*/
public List<MeetingOutUser> selectMeetingOutUserList(MeetingOutUser meetingOutUser);
/**
* 新增会议外来人员
*
* @param meetingOutUser 会议外来人员信息
* @return 结果
*/
public int insertMeetingOutUser(MeetingOutUser meetingOutUser);
/**
* 修改会议外来人员
*
* @param meetingOutUser 会议外来人员信息
* @return 结果
*/
public int updateMeetingOutUser(MeetingOutUser meetingOutUser);
/**
* 批量删除会议外来人员
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteMeetingOutUserByIds(String[] ids);
}
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.project.module.meeting.model.MeetingProperty;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author PiscesYang
* @ClassName MeetingPropertyMapper
* @Description meeting_property
* @Date 2019/6/12 10:28
* @Version 1.0
*/
@Repository
public interface MeetingPropertyMapper
{
/**
* 查询会议物业
*
* @param id 会议物业ID
* @return 会议物业信息
*/
public MeetingProperty selectMeetingPropertyById(String id);
/**
* 查询会议物业列表
*
* @param meetingProperty 会议物业信息
* @return 会议物业集合
*/
public List<MeetingProperty> selectMeetingPropertyList(MeetingProperty meetingProperty);
/**
* 新增会议物业
*
* @param meetingProperty 会议物业信息
* @return 结果
*/
public int insertMeetingProperty(MeetingProperty meetingProperty);
/**
* 修改会议物业
*
* @param meetingProperty 会议物业信息
* @return 结果
*/
public int updateMeetingProperty(MeetingProperty meetingProperty);
/**
* 批量删除会议物业
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteMeetingPropertyByIds(String[] ids);
}
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.project.module.meeting.model.MeetingRoom;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author Lq
* @ClassName MeetingRoomMapper
* @Description meeting_room_manager
* @Date 2019/4/9 17:32
* @Version 1.0
*/
@Repository
public interface MeetingRoomMapper {
/**
* 新增会议室
* @param MeetingRoom 会议室信息
* @return 结果
*/
int insertMeetingRoom(MeetingRoom MeetingRoom);
/**
* 批量删除会议室
* @param ids 需要删除的数据id数组
* @return 结果
*/
void deleteMeetingRoomByIds(String[] ids);
/**
* 修改会议室信息
* @param MeetingRoom 会议室信息
* @return 结果
*/
int updateMeetingRoom(MeetingRoom MeetingRoom);
/**
* 查询会议室数据集合
* @param MeetingRoom 会议室信息
* @return 会议室数据集合
*/
List<MeetingRoom> listMeetingRoom(MeetingRoom MeetingRoom);
/**
* 根据ID 查询会议室信息
* @param id 会议室id
* @return 会议室信息
*/
MeetingRoom selectMeetingRoomById(String id);
List<MeetingRoom> listMeetingRoomAndTime(MeetingRoom meetingRoom);
}
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.project.module.meeting.model.MeetingService;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author WangSJ
* @ClassName MeetingServiceMapper
* @Description meeting_service_manager
* @Date 2019/4/16 17:18
* @Version 1.0
*/
@Repository
public interface MeetingServiceMapper
{
/**
* 保存会议服务
* @param meetingService
*/
void saveMeetingService(MeetingService meetingService);
/**
* 删除会议服务
* @param ids
*/
void delMeetingService(String [] ids);
/**
* 修改会议服务
* @param meetingService
*/
void updateMeetingService(MeetingService meetingService);
/**
* 查询会议服务列表
* @param meetingService
* @return
*/
List<MeetingService> listMeetingService(MeetingService meetingService);
}
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.project.module.meeting.model.MeetingTime;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author PiscesYang
* @ClassName MeetingTimeMapper
* @Description meeting_time
* @Date 2019/5/14 17:18
* @Version 1.0
*/
@Repository
public interface MeetingTimeMapper
{
/**
* 查询会议时间信息
*
* @param id 会议时间ID
* @return 会议时间信息
*/
public MeetingTime selectMeetingTimeById(String id);
/**
* 查询会议时间列表
*
* @param meetingTime 会议时间信息
* @return 会议时间集合
*/
public List<MeetingTime> selectMeetingTimeList(MeetingTime meetingTime);
public List<MeetingTime> getMeetingTimeBymeetingId(@Param("id") String id, @Param("currTime") String currTime);
/**
* 获取下一个会议时间(大于参数日期的下一个会议)
* @param date
* @param roomId
* @return
*/
public MeetingTime getNextTimeInfoByDate( @Param("currTime") String date, @Param("roomId") String roomId );
/**
* 新增会议时间
*
* @param meetingTime 会议时间信息
* @return 结果
*/
public int insertMeetingTime(MeetingTime meetingTime);
/**
* 修改会议时间
*
* @param meetingTime 会议时间信息
* @return 结果
*/
public int updateMeetingTime(MeetingTime meetingTime);
/**
* 批量删除会议时间
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteMeetingTimeByIds(String[] ids);
/**
* 验证会议时间是否占用
* @param meetingTime
* @return
*/
public int checkMeetingTime(MeetingTime meetingTime);
}
package com.sinobase.project.module.meeting.mapper;
import com.sinobase.framework.web.mapper.BaseMapper;
import com.sinobase.project.module.meeting.model.YzMeetingManager;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author WangSJ
* @ClassName YzMeetingManagerMapper
* @Description
* @Date 2019/5/14 17:18
* @Version 1.0
*/
@Repository
public interface YzMeetingManagerMapper extends BaseMapper<YzMeetingManager> {
/**
* 获取会议列表(旧OA的会议数据)
* @param yzMeetingManager
* @return
*/
List<YzMeetingManager> listYzMeetingManager(YzMeetingManager yzMeetingManager);
}
package com.sinobase.project.module.meeting.model;
import com.sinobase.framework.web.domain.BaseEntity;
import java.util.List;
/**
* @author PiscesYang
* @ClassName MeetingAffairsFeedback
* @Description 会务反馈信息 meeting_affairs_feedback
* @Date 2019/12/11 18:34
* @Version 1.0
*/
public class MeetingAffairsFeedback extends BaseEntity {
private static final long serialVersionUID = 1L; //做反向序列化时验证
private String id; /*主键id*/
private String content; /*反馈内容*/
private String affairsId; /*会务ID*/
private String pid; /*第一反馈ID,用于反馈分组*/
private String creTime; /*创建时间*/
private String creUserid; /*创建人ID*/
private String creUsername; /*创建人姓名*/
private String creDeptid; /*创建人部门ID*/
private String creDeptname; /*创建人部门名称*/
private List<MeetingAffairsFeedback> list;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getAffairsId() {
return affairsId;
}
public void setAffairsId(String affairsId) {
this.affairsId = affairsId;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getCreTime() {
return creTime;
}
public void setCreTime(String creTime) {
this.creTime = creTime;
}
public String getCreUserid() {
return creUserid;
}
public void setCreUserid(String creUserid) {
this.creUserid = creUserid;
}
public String getCreUsername() {
return creUsername;
}
public void setCreUsername(String creUsername) {
this.creUsername = creUsername;
}
public String getCreDeptid() {
return creDeptid;
}
public void setCreDeptid(String creDeptid) {
this.creDeptid = creDeptid;
}
public String getCreDeptname() {
return creDeptname;
}
public void setCreDeptname(String creDeptname) {
this.creDeptname = creDeptname;
}
public List<MeetingAffairsFeedback> getList() {
return list;
}
public void setList(List<MeetingAffairsFeedback> list) {
this.list = list;
}
}
\ No newline at end of file
package com.sinobase.project.module.meeting.model;
import com.sinobase.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 会议协作事项表 meeting_collaborative_matters
*
* @author PiscesYang
* @date 2019-05-05
*/
public class MeetingCollaborativeMatters extends BaseEntity{
private static final long serialVersionUID = 1L;
/** 主键id */
private String id;
/** 协作明细id */
private String cooperationId;
/** 事项id */
private String matterId;
/** 事项名称 */
private String matterName;
/** 事项内容 */
private String matterContent;
/** 创建时间 */
private String creTime;
public void setId(String id){
this.id = id;
}
public String getId(){
return id;
}
public void setCooperationId(String cooperationId){
this.cooperationId = cooperationId;
}
public String getCooperationId(){
return cooperationId;
}
public void setMatterId(String matterId){
this.matterId = matterId;
}
public String getMatterId(){
return matterId;
}
public void setMatterName(String matterName){
this.matterName = matterName;
}
public String getMatterName(){
return matterName;
}
public void setMatterContent(String matterContent){
this.matterContent = matterContent;
}
public String getMatterContent(){
return matterContent;
}
public void setCreTime(String creTime){
this.creTime = creTime;
}
public String getCreTime(){
return creTime;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("cooperationId", getCooperationId())
.append("matterId", getMatterId())
.append("matterName", getMatterName())
.append("matterContent", getMatterContent())
.append("creTime", getCreTime())
.toString();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment