Commit db98727b by liuhui

首页前台后台拆分基本完成

parent 666bb2a0
Showing with 4637 additions and 20 deletions
......@@ -269,6 +269,13 @@
<artifactId>fastjson</artifactId>
</dependency>
<!-- 工具类 -->
<dependency>
<groupId>com.xiaoleilu</groupId>
<artifactId>hutool-all</artifactId>
<version>3.3.2</version>
</dependency>
</dependencies>
<build>
......@@ -277,39 +284,45 @@
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>static/fonts/**</exclude>
<exclude>static/file/**</exclude>
<exclude>**/*.woff</exclude>
<exclude>**/*.woff2</exclude>
<exclude>**/*.ttf</exclude>
</excludes>
<includes>
<include>application.yml</include>
<include>application-${profileActive}.yml</include>
<include>banner.txt</include>
<include>ehcache/*</include>
<include>i18n/*</include>
<include>log4j.xml</include>
<include>mybatis/**/*</include>
<include>static/**/*</include>
<include>templates/**/*</include>
<include>ehcache/*</include>
<include>log4j.xml</include>
<include>wps.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>static/fonts/**</include>
<include>static/file/**</include>
<include>**/*.woff</include>
<include>**/*.woff2</include>
<include>**/*.ttf</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......@@ -320,6 +333,24 @@
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>compile</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/lib</outputDirectory>
<includeScope>system</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
......@@ -131,7 +131,9 @@ public class ShiroRedisConfig {
redisManager.setHost(redisHost);
redisManager.setPort(redisPort);
redisManager.setTimeout(redisTimeout);
redisManager.setPassword(redisPassword);
if(!"".equals(redisPassword.trim())){
redisManager.setPassword(redisPassword);
}
return redisManager;
}
......
package com.sinobase.framework.config;
import java.util.Properties;
import com.alibaba.druid.filter.config.ConfigTools;
import com.alibaba.druid.util.DruidPasswordCallback;
/**
*
* @author shj 对配置文件中的数据库密码进行解密
*/
public class DbPasswordCallback extends DruidPasswordCallback {
@Override
public void setProperties(Properties properties) {
super.setProperties(properties);
String password = (String) properties.get("password");
String publickey = (String) properties.get("publicKey");
try {
String dbpassword = DbPasswordCallback.decryptStr(password);
setPassword(dbpassword.toCharArray());
} catch (Exception e) {
e.printStackTrace();
}
}
public static final byte[] SECRET_KEY = "0123456789abcdef".getBytes();
public static String decryptStr(String enStr) {
com.xiaoleilu.hutool.crypto.symmetric.SymmetricCrypto aes = new com.xiaoleilu.hutool.crypto.symmetric.SymmetricCrypto(
com.xiaoleilu.hutool.crypto.symmetric.SymmetricAlgorithm.AES, SECRET_KEY);
return aes.decryptStr(enStr);
}
public static String encryptStr(String enStr) {
com.xiaoleilu.hutool.crypto.symmetric.SymmetricCrypto aes = new com.xiaoleilu.hutool.crypto.symmetric.SymmetricCrypto(
com.xiaoleilu.hutool.crypto.symmetric.SymmetricAlgorithm.AES, SECRET_KEY);
return new String(aes.encryptHex(enStr));
}
}
......@@ -41,7 +41,7 @@ public class UserRealm extends AuthorizingRealm {
logger.debug("username: {} will validate" , username);
User user = new User();
if(isPlatform) { //如果集成SSO登录
user = platformService.getUserByLoginname(username);
user = platformService.setLoginUserInfo(username);
return new SimpleAuthenticationInfo(user, password, getName());
}else { //如果没有集成sso的情况下,需要开发者自行验证用户信息
if("developer".equals(username) && "123456".equals(password)) {
......
package com.sinobase.project.module.docsend.controller;
import com.github.pagehelper.PageHelper;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.page.PageDomain;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.framework.web.page.TableSupport;
import com.sinobase.project.module.docsend.service.IReadExtranetService;
import com.sinobase.project.module.docsend.service.IReadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
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.List;
import java.util.Map;
@Controller
@RequestMapping("/read")
public class ReadController extends BaseController {
@Autowired
private IReadService readService;
@Autowired
private IReadExtranetService readExtranetService;
@Value("${sinobase.isIntranet}")
private boolean isIntranet;
/**
* 获取已阅分页数据
* @param pageNumber 第几页数据
* @param countPerPage 每页有几条数据
* @return json型式的整页待办数据
*/
@RequestMapping("/list/{pageNumber}/{countPerPage}")
@ResponseBody
public List<Map<String, String>> getDocSendList(@PathVariable int pageNumber, @PathVariable int countPerPage){
int pageCount = 0;
if(isIntranet){
pageCount = readService.getPageCount(countPerPage);
}else{
pageCount = readExtranetService.getPageCount(countPerPage);
}
List<Map<String, String>> docSendList = null;
if(pageNumber <= pageCount) {
if(isIntranet){
docSendList = readService.docSendList(pageNumber, countPerPage,"self","","");
}else{
docSendList = readExtranetService.docSendList(pageNumber, countPerPage,"self","","");
}
}
return docSendList;
}
/**
* 获取列表信息
* @return
*/
@RequestMapping("/tablelist")
@ResponseBody
public TableDataInfo getDocSendTableList(String title,String number){
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);
}
int indexCount = 0;
List<Map<String, String>> docSendList = null;
if(isIntranet){
indexCount = readService.getIndexCount(title,number);
docSendList = readService.docSendList(pageNum, pageSize,"self",title,number);
}else{
indexCount = readExtranetService.getIndexCount(title,number);
docSendList = readExtranetService.docSendList(pageNum, pageSize,"self",title,number);
}
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(0);
rspData.setRows(docSendList);
rspData.setTotal(indexCount);
return rspData;
}
/**
* 获取已阅数据分页数量(页数)
* @param count 每页的数据条数
* @return 页数
*/
@RequestMapping("/page_count/{count}")
@ResponseBody
public int getPageCount(@PathVariable int count) {
int pageCount = 0;
if(isIntranet){
pageCount = readService.getPageCount(count);
}else{
pageCount = readExtranetService.getPageCount(count);
}
return pageCount;
}
}
package com.sinobase.project.module.docsend.dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.project.system.user.domain.User;
public class IndexReadHandler {
private static final Logger log = LoggerFactory.getLogger(IndexReadHandler.class);
/**
* 刷新已阅索引数据
* @param dataSource
* @return
*/
public static synchronized boolean refreshIndex(DruidDataSource dataSource) {
boolean result = true;
//step.1 查询索引表最新的日期
Date latestTime = new Date();
List<Map<String, Object>> localList = new ArrayList<Map<String, Object>>();
List<Map<String, Object>> remoteList = new ArrayList<Map<String, Object>>();
try {
latestTime = IndexReadHandler.getLatestOfIndex(dataSource);
} catch (SQLException e) {
result = false;
e.printStackTrace();
}
try {
//step.2 根据第一步的时间查询出本地缺少的已阅数据
localList = LocalSysReadHandler.getNotIndexedLocal(dataSource, latestTime);
//step.3 根据第一步的时间查询出远程缺少的已阅数
remoteList = RemoteSysReadHandler.getNotIndexedRemote(latestTime);
} catch (SQLException e) {
e.printStackTrace();
}
//step.4 把第二、三步查出来的数据插入到索引表当中(分批执行,每次执行1000条)
int bufferSize = 1000;
List<String> sqlList = new LinkedList<String>(); //切割后的批量插入sql语句集合
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
list.addAll(localList);
list.addAll(remoteList);
do {
List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
if(list.size() > bufferSize) {
tempList = list.subList(0, bufferSize - 1);
}else {
tempList = list;
}
String sqlFragment = IndexReadHandler.buildSQLFragment(tempList);
String sql = IndexReadHandler.buildSQLStatement(sqlFragment);
if(null != sql && !"".equals(sql.trim()))
sqlList.add(sql);
tempList.clear();
}while(list.size() != 0);
try {
IndexReadHandler.queryInsert4Index(dataSource, sqlList);
} catch (SQLException e) {
e.printStackTrace();
}
return result;
}
/**
* 从已阅索引中获取已阅数量
* @param dataSource
* @return
*/
public static int getIndexCount(DruidDataSource dataSource,String title,String number)
throws SQLException{
User user = ShiroUtils.getSysUser();
int count = 0;
String sql = "select count(1) as count from sys_read_index where (userid='"+user.getUserId()+"' or userid='"+user.getHistoryId()+"')";
if(StringUtils.isNotEmpty(title)){
sql += " and title like '%"+title+"%'";
}
if(StringUtils.isNotEmpty(title)){
sql += " and number like '%"+number+"%'";
}
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
conn = dataSource.getConnection();
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs && rs.next()) {
count = rs.getInt("count");
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
rs.close();
pstmt.close();
conn.close();
}
return count;
}
/**
* 从已阅列表中获取分页数据
* @param dataSource
* @param pageNumber
* @param countPerPage
* @return
*/
public static List<Map<String, Object>> paging(DruidDataSource dataSource, int pageNumber, int countPerPage,String title,String number){
User user = ShiroUtils.getSysUser();
String sql = "select id,doomsday,userid,source_system from sys_read_index where (userid='"+user.getUserId()+"' or userid='"+user.getHistoryId()+"')";
if(StringUtils.isNotEmpty(title)){
sql += " and title like '%"+title+"%'";
}
if(StringUtils.isNotEmpty(number)){
sql += " and number like '%"+number+"%'";
}
sql += " order by str_to_date(doomsday,'%Y-%m-%d %H:%i:%s') desc limit "+ (pageNumber-1)*countPerPage +","+ countPerPage;
List<Map<String, Object>> ret = new LinkedList<Map<String, Object>>();
try {
Connection conn = dataSource.getConnection();
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Map<String, Object> map = new HashMap<String, Object>();
String id = rs.getString("id");
Date doomsday = new Date(rs.getTimestamp("doomsday").getTime());
String userid = rs.getString("userid");
String source = rs.getString("source_system");
map.put("id", id);
map.put("doomsday", doomsday);
map.put("userid", userid);
map.put("source", source);
ret.add(map);
}
}
rs.close();
pstmt.close();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
return ret;
}
/**
* 获取所有的已阅
* @param dataSource
* @return
*/
public static List<Map<String, Object>> paging(DruidDataSource dataSource){
User user = ShiroUtils.getSysUser();
String sql = "select id,doomsday,userid,source_system from sys_read_index where (userid='"+user.getUserId()+"' or userid='"+user.getHistoryId()+"')" +
" order by str_to_date(doomsday,'%Y-%m-%d %H:%i:%s') desc ";
List<Map<String, Object>> ret = new LinkedList<Map<String, Object>>();
try {
Connection conn = dataSource.getConnection();
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Map<String, Object> map = new HashMap<String, Object>();
String id = rs.getString("id");
Date doomsday = new Date(rs.getTimestamp("doomsday").getTime());
String userid = rs.getString("userid");
String source = rs.getString("source_system");
map.put("id", id);
map.put("doomsday", doomsday);
map.put("userid", userid);
map.put("source", source);
ret.add(map);
}
}
rs.close();
pstmt.close();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
return ret;
}
//获取当前索引表中最近的时间
private static Date getLatestOfIndex(DruidDataSource dataSource)
throws SQLException {
User user = ShiroUtils.getSysUser();
String sql = "select id,doomsday,source_system from sys_read_index where (userid='"+user.getUserId()+"' or userid='"+user.getHistoryId()+"') order by doomsday desc limit 1";
Date latestOfIndex = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
latestOfIndex = sdf.parse("1970-01-01 08:00:00");
} catch (ParseException e1) {
e1.printStackTrace();
}
Connection conn = dataSource.getConnection();
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs && rs.next()) {
latestOfIndex = new Date(rs.getTimestamp("doomsday").getTime());
}
rs.close();
pstmt.close();
conn.close();
} catch(SQLException e) {
e.printStackTrace();
}
return latestOfIndex;
}
//向已阅索引表插入已阅数据
private static void queryInsert4Index(DruidDataSource dataSource, List<String> sqlList)
throws SQLException {
Connection conn = dataSource.getConnection();
Statement stmt = conn.createStatement();
int sqlSize = sqlList.size();
for(int ix = 0; ix < sqlSize; ++ ix) { //直接遍历执行所有sql语句,按理说应该不需要sleep
String sql = sqlList.get(ix);
//log.debug("query:"+sql);
stmt.executeUpdate(sql);
}
stmt.close();
conn.close();
}
//构建SQL语句片段
private static String buildSQLFragment(List<Map<String, Object>> list) {
StringBuffer fragment = new StringBuffer("");
int size = list.size();
for(int ix = 0; ix < size; ++ ix) {
Map<String, Object> cur = list.get(ix);
String id = String.valueOf(cur.get("id"));
String doomsday = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((Date)cur.get("doomsday"));
String userid = String.valueOf(cur.get("userid"));
String title = cur.get("title") == null ? "" : cur.get("title").toString();
String number = cur.get("number") == null ? "" : cur.get("number").toString();
String source = cur.get("source") == null ? "" : cur.get("source").toString();
if(0 != ix) {
fragment.append(",");
}
fragment.append("('"+id+"','"+doomsday+"','"+userid+"','"+title+"','"+number+"','"+source+"')");
}
return fragment.toString();
}
//将SQL语句片段构建成完整语句
private static String buildSQLStatement(String fragment) {
String sql = "";
if(null != fragment && !"".equals(fragment.trim())) {
sql = "insert into sys_read_index (id,doomsday,userid,title,number,source_system) values " + fragment;
}
return sql;
}
}
package com.sinobase.project.module.docsend.dao;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.project.system.user.domain.User;
import org.apache.poi.util.StringUtil;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.*;
public class LocalSysReadHandler {
public static final String SOURCE = "local";
/**
* 外网直接获取mysql中已阅数据
* @param dataSource
* @param pageNumber
* @param countPerPage
* @param title
* @return
* @throws SQLException
*/
public static List<Map<String, String>> getDoneList(DruidDataSource dataSource,int pageNumber,int countPerPage,String title,String number)
throws SQLException{
User user = ShiroUtils.getSysUser();
List<Map<String, String>> ret = new ArrayList<Map<String, String>>();
String fieldArray[] = new String[] {"send_id", "send_title", "user_notion", "view_url", "keyword", "relation_id", "relation_table", "relation_key", "notion_date"};
String filedStr = StringUtil.join(fieldArray, ",");
String sql = "select "+filedStr+" from doc_send where (in_user_id='"+user.getUserId()+"' or in_user_id='"+user.getHistoryId()+"')";
if(StringUtils.isNotEmpty(title)){
sql += " and title like '%"+title+"%'";
}
if(StringUtils.isNotEmpty(number)){
sql += " and number like '%"+number+"%'";
}
sql += " order by str_to_date(notion_date,'%Y-%m-%d %H:%i:%s') desc ";
if(pageNumber!=0&&countPerPage!=0){
sql += " limit "+ (pageNumber-1)*countPerPage +","+ countPerPage;
}
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
conn = dataSource.getConnection();
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Map<String, String> cur = new HashMap<String, String>();
for(int ix = 0; ix < fieldArray.length; ++ ix) {
String field = fieldArray[ix];
String val = rs.getString(field);
cur.put(field, val);
}
cur.put("source",LocalSysReadHandler.SOURCE);
ret.add(cur);
}
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
rs.close();
pstmt.close();
conn.close();
}
return ret;
}
/**
* 从已办表中查询一个时间点到当前时间的数据
* @param dataSource
* @param latestTime
* @return
* @throws SQLException
*/
static List<Map<String, Object>> getNotIndexedLocal(DruidDataSource dataSource, Date latestTime)
throws SQLException{
User user = ShiroUtils.getSysUser();
String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(latestTime);
List<Map<String, Object>> ret = new ArrayList<Map<String, Object>>(); //ArrayList即可,无需排序
String sql = "select send_id, str_to_date(notion_date, '%Y-%m-%d %H:%i:%s') as doomsday,in_user_id,send_title,user_notion " +
" from doc_send " +
" where (in_user_id='"+user.getUserId()+"' or in_user_id='"+user.getHistoryId()+"') and " +
"str_to_date(notion_date, '%Y-%m-%d %H:%i:%s') > str_to_date('"+time+"', '%Y-%m-%d %H:%i:%s') and see_flag='1'" +
" order by str_to_date(notion_date, '%Y-%m-%d %H:%i:%s') desc";
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
conn = dataSource.getConnection();
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Map<String, Object> temp = new HashMap<String, Object>();
String id = rs.getString("send_id");
Date doomsday = new Date(rs.getTimestamp("doomsday").getTime());
String userid = rs.getString("in_user_id");
String title = rs.getString("send_title");
String number = rs.getString("user_notion");
temp.put("id", id);
temp.put("doomsday", doomsday);
temp.put("userid", userid);
temp.put("title", title);
temp.put("number", number);
temp.put("source", LocalSysReadHandler.SOURCE);
ret.add(temp);
}
}
} catch(SQLException e) {
e.printStackTrace();
} finally {
rs.close();
pstmt.close();
conn.close();
}
return ret;
}
/**
* 根据已办ID批量获取已办信息(不排序)
* @param dataSource
* @param idList
* @return
*/
public static Map<String, Map<String, String>> getDoneListById(DruidDataSource dataSource, List<String> idList)
throws SQLException{
Map<String,Map<String, String>> ret = new HashMap<String, Map<String, String>>();
String fragment = LocalSysReadHandler.buildSQLFragment(idList);
if(StringUtils.isNotEmpty(fragment)){
String fieldArray[] = new String[] {"send_id", "send_title", "user_notion", "view_url", "keyword", "relation_id", "relation_table", "relation_key", "notion_date"};
String filedStr = StringUtil.join(fieldArray, ",");
String sql = "select "+filedStr+" from doc_send where send_id in ("+fragment+")";
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
conn = dataSource.getConnection();
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Map<String, String> cur = new HashMap<String, String>();
for(int ix = 0; ix < fieldArray.length; ++ ix) {
String field = fieldArray[ix];
String val = rs.getString(field);
cur.put(field, val);
}
ret.put(cur.get("send_id"), cur);
}
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
rs.close();
pstmt.close();
conn.close();
}
}
return ret;
}
//构建SQL语句片段
private static String buildSQLFragment(List<String> idList) {
StringBuffer fragment = new StringBuffer();
int size = idList.size();
for(int ix = 0; ix < size; ++ ix) {
if(ix != 0)
fragment.append(",");
fragment.append("'"+idList.get(ix)+"'");
}
return fragment.toString();
}
}
package com.sinobase.project.module.docsend.dao;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.common.utils.spring.SpringUtils;
import com.sinobase.datasource.aspectj.lang.enums.DataSourceType;
import com.sinobase.datasource.source.DynamicDataSourceContextHolder;
import com.sinobase.oldoa.util.Cp30Datasource;
import com.sinobase.project.system.user.domain.User;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.poi.util.StringUtil;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.*;
public class RemoteSysReadHandler {
public static final String SOURCE = "old";
public static QueryRunner qr = new QueryRunner(Cp30Datasource.getDataSource());
static List<Map<String, Object>> getNotIndexedRemote(Date latestTime)
throws SQLException {
User user = ShiroUtils.getSysUser();
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.ORACLE.name());
DataSource dataSource = (DataSource) SpringUtils.getBean("dynamicDataSource");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// format.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
String sql = "select send_id, TO_DATE(notion_date, 'yyyy-mm-dd hh24:mi:ss') as doomsday,in_user_id,send_title,user_notion from doc_send " +
" where (in_user_id='"+user.getUserId()+"' or in_user_id='"+user.getHistoryId()+"') and" +
" TO_DATE(notion_date, 'yyyy-mm-dd hh24:mi:ss') > TO_DATE('"+format.format(latestTime)+"', 'yyyy-mm-dd hh24:mi:ss') and see_flag='1' and keyword!='退文' and keyword!='收回'"+
" order by TO_DATE(notion_date, 'yyyy-mm-dd hh24:mi:ss') desc";
List<Map<String, Object>> list = new ArrayList<>();
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try {
conn = dataSource.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
getValue(conn,stmt,rs,resultList);
} catch (Exception e) {
e.printStackTrace();
}finally{
rs.close();
stmt.close();
conn.close();
DynamicDataSourceContextHolder.clearDataSourceType();
}
return resultList;
}
private static void getValue(Connection conn,Statement stmt,ResultSet rs,List<Map<String, Object>> resultList) throws Exception{
User user = ShiroUtils.getSysUser();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if(null != rs) {
while (rs.next()) {
Map<String, Object> temp = new HashMap<String, Object>();
String id = parseString(rs.getString("send_id"));
Date doomsday = format.parse(parseString(rs.getString("doomsday")));
String userid = parseString(rs.getString("in_user_id"));
String title = parseString(rs.getString("send_title"));
String number = parseString(rs.getString("user_notion"));
temp.put("id", id);
temp.put("doomsday", doomsday);
temp.put("userid", userid);
temp.put("title", title);
temp.put("number", number);
temp.put("source", RemoteSysReadHandler.SOURCE);
resultList.add(temp);
}
}
DynamicDataSourceContextHolder.clearDataSourceType();
}
private static String parseString(Object obj) {
String ret = "";
if(obj != null)
ret = obj.toString();
return ret;
}
public static synchronized Map<String, Map<String, String>> getDoneListById(List<String> idList)
throws SQLException {
Map<String,Map<String, String>> ret = new HashMap<String, Map<String, String>>();
String fragment = RemoteSysReadHandler.buildSQLFragment(idList);
if(StringUtils.isNotEmpty(fragment)){
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.ORACLE.name());
DataSource dataSource = (DataSource) SpringUtils.getBean("dynamicDataSource");
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
String fieldArray[] = new String[] {"send_id", "send_title", "user_notion", "view_url", "keyword", "relation_id", "relation_table", "relation_key", "notion_date"};
String filedStr = StringUtil.join(fieldArray, ",");
String sql = "select "+filedStr+" from doc_send where send_id in ("+fragment+")";
List<Map<String, Object>> list = new ArrayList<>();
try {
conn = dataSource.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
getValue(conn,stmt,rs,ret,fieldArray);
} catch (Exception e) {
e.printStackTrace();
}finally{
rs.close();
stmt.close();
conn.close();
DynamicDataSourceContextHolder.clearDataSourceType();
}
}
return ret;
}
private static void getValue(Connection conn,Statement stmt,ResultSet rs,Map<String,Map<String, String>> ret,String[] fieldArray) throws Exception{
if(null != rs) {
while (rs.next()) {
Map<String, String> cur = new HashMap<String, String>();
for(int i = 0; i < fieldArray.length; ++ i) {
String field = fieldArray[i];
String val = parseString(rs.getString(field));
cur.put(field, val);
}
ret.put(rs.getString("send_id"), cur);
}
}
DynamicDataSourceContextHolder.clearDataSourceType();
}
//构建SQL语句片段
private static String buildSQLFragment(List<String> idList) {
StringBuffer fragment = new StringBuffer();
int size = idList.size();
for(int ix = 0; ix < size; ++ ix) {
if(ix != 0)
fragment.append(",");
fragment.append("'"+idList.get(ix)+"'");
}
return fragment.toString();
}
}
package com.sinobase.project.module.docsend.service;
import java.util.List;
import java.util.Map;
public interface IReadExtranetService {
/**
* 获取已阅分页数据
* @param pageNumber 第几页数据
* @param countPerPage 每页有几条数据
* @return 整页待办数据
*/
public List<Map<String, String>> docSendList(int pageNumber, int countPerPage, String type, String title, String number);
/**
* 获取已阅数据分页数量(页数)
* @param count 每页的数据条数
* @return 页数
*/
public int getPageCount(int count);
/**
* 获取登录人所有记录数
* @return
*/
public int getIndexCount(String title, String number);
}
package com.sinobase.project.module.docsend.service;
import java.util.List;
import java.util.Map;
public interface IReadService {
/**
* 获取已阅分页数据
* @param pageNumber 第几页数据
* @param countPerPage 每页有几条数据
* @return 整页待办数据
*/
public List<Map<String, String>> docSendList(int pageNumber, int countPerPage,String type,String title,String number);
/**
* 获取已阅数据分页数量(页数)
* @param count 每页的数据条数
* @return 页数
*/
public int getPageCount(int count);
/**
* 获取登录人所有记录数
* @return
*/
public int getIndexCount(String title,String number);
}
package com.sinobase.project.module.docsend.service;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.project.module.docsend.dao.LocalSysReadHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@Service
public class ReadExtranetServiceImpl implements IReadExtranetService {
@Autowired
private DruidDataSource dataSource;
@Override
public List<Map<String, String>> docSendList(int pageNumber, int countPerPage,String type,String title,String number) {
List<Map<String, String>> ret = new LinkedList<Map<String,String>>();
try{
if(type.equals("table")){
ret = LocalSysReadHandler.getDoneList(dataSource, 0, 0,title,number);
}else{
ret = LocalSysReadHandler.getDoneList(dataSource, pageNumber, countPerPage,title,number);
}
}catch(Exception e){
e.printStackTrace();
}
return ret;
}
@Override
public int getPageCount(int count) {
int indexCount = 0;
List<Map<String, String>> ret = new LinkedList<Map<String,String>>();
try{
ret = LocalSysReadHandler.getDoneList(dataSource, 0, 0,null,null);
indexCount = ret.size();
}catch(Exception e){
e.printStackTrace();
}
// 计算页数并返回
int pageCount = indexCount / count;
if(0 != indexCount % count)
++ pageCount;
return pageCount;
}
@Override
public int getIndexCount(String title,String number) {
int indexCount = 0;
List<Map<String, String>> ret = new LinkedList<Map<String,String>>();
try{
ret = LocalSysReadHandler.getDoneList(dataSource, 0, 0,title,number);
indexCount = ret.size();
}catch(Exception e){
e.printStackTrace();
}
return indexCount;
}
}
package com.sinobase.project.module.docsend.service;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.project.module.docsend.dao.IndexReadHandler;
import com.sinobase.project.module.docsend.dao.LocalSysReadHandler;
import com.sinobase.project.module.docsend.dao.RemoteSysReadHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.SQLException;
import java.util.*;
@Service
public class ReadServiceImpl implements IReadService {
@Autowired
private DruidDataSource dataSource;
@Override
public List<Map<String, String>> docSendList(int pageNumber, int countPerPage,String type,String title,String number) {
// step.1 刷新待阅索引的数据
//IndexHandler.refreshIndex(dataSource);
// step.2 通过分页的形式查询索引表
List<Map<String, Object>> pagingList = new ArrayList<Map<String,Object>>();
if(type.equals("table")){
pagingList = IndexReadHandler.paging(dataSource);
}else{
pagingList = IndexReadHandler.paging(dataSource, pageNumber, countPerPage,title,number);
}
// step.3 根据分页表中的id和source_system字段,分别调用LocalSystemHandler和RemoteSysHandler类中的查询方法
List<String> localIds = new ArrayList<String>(); //本系统待办表中的ID集合
List<String> remoteOldIds = new ArrayList<String>(); //老系统待办表中的ID集合
for(int ix = 0; ix < pagingList.size(); ++ ix) {
Map<String, Object> cur = pagingList.get(ix);
String id = cur.get("id").toString();
String source = cur.get("source").toString();
switch(source) {
case LocalSysReadHandler.SOURCE:
localIds.add(id);
break;
case RemoteSysReadHandler.SOURCE:
remoteOldIds.add(id);
break;
}
}
Map<String, Map<String, String>> localDone = new HashMap<>();
Map<String, Map<String, String>> remoteOldDone = new HashMap<>();
try {
localDone = LocalSysReadHandler.getDoneListById(dataSource, localIds);
remoteOldDone = RemoteSysReadHandler.getDoneListById(remoteOldIds);
} catch (SQLException throwables) {
throwables.printStackTrace();
}
// step.4 把两个来源的数据进行排序操作,并返回
List<Map<String, String>> ret = new LinkedList<Map<String,String>>();
for(int ix = 0; ix < pagingList.size(); ++ ix) {
Map<String, Object> pMap = pagingList.get(ix);
String id = pMap.get("id").toString();
String source = pMap.get("source").toString();
Map<String, String> cur = null;
switch(source) {
case LocalSysReadHandler.SOURCE:
cur = localDone.get(id);
if(null != cur){
cur.put("source",LocalSysReadHandler.SOURCE);
}
break;
case RemoteSysReadHandler.SOURCE:
cur = remoteOldDone.get(id);
if(null != cur){
cur.put("source",RemoteSysReadHandler.SOURCE);
}
break;
}
if(null != cur)
ret.add(cur);
}
return ret;
}
@Override
public int getPageCount(int count) {
// step.1 刷新待办索引的数据
IndexReadHandler.refreshIndex(dataSource);
// step.2 查出待办索引表的数据量count(1)
int indexCount = 0;
try {
indexCount = IndexReadHandler.getIndexCount(dataSource,"","");
} catch (SQLException throwables) {
throwables.printStackTrace();
}
// step.3 计算页数并返回
int pageCount = indexCount / count;
if(0 != indexCount % count)
++ pageCount;
return pageCount;
}
@Override
public int getIndexCount(String title,String number) {
// step.1 刷新待办索引的数据
IndexReadHandler.refreshIndex(dataSource);
// step.2 查出待办索引表的数据量count(1)
int indexCount = 0;
try {
indexCount = IndexReadHandler.getIndexCount(dataSource,title,number);
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return indexCount;
}
}
# 获取已办数据信息
因为新旧系统同时运行,所以已办信息存在于MySQL和Oracle两个数据库中。
列表显示已办数据时,要把两个库的数据综合在一起做一个排序。
## 代码结构
`controller`
* `DoneController.java` 供前端请求的controller类
`service`
* `IDoneService.java` 获取已办相关信息的Service接口
* `DoneServiceImpl.java` 获取已办相关信息的Service实现类
`dao`
* `LocalSysHandler.java` 本地已办数据的查询方法类
* `RemoteSysHandler.java` 旧(其它)系统已办数据的方法类
`tools`
* 工具类,包含httpClient、排序算法等(用不上了,老系统的数据也在本地开发,无需http请求)
数据库表没建JavaBean,数据存储到Map中,字段名分别为:`id``doomsday``source`
> 本系统中的source值为 `local`
> 老系统中source值为 `old`
## 数据库
在数据库中建立了一个 *索引表* 用于存储两个系统中所有的已办信息ID和时间,用于排序。
```
drop table if exists sys_done_index;
create table sys_done_index
(
`id` varchar(50) NOT NULL,
`doomsday` datetime NOT NULL,
`source_system` varchar(50) NOT NULL,
primary key (`id`)
);
```
\ No newline at end of file
package com.sinobase.project.module.done.controller;
import com.github.pagehelper.PageHelper;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.page.PageDomain;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.framework.web.page.TableSupport;
import com.sinobase.project.module.done.service.IDoneExtranetService;
import com.sinobase.project.module.done.service.IDoneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
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.List;
import java.util.Map;
@Controller
@RequestMapping("/done")
public class DoneController extends BaseController {
@Autowired
private IDoneService doneService;
@Autowired
private IDoneExtranetService doneExtranetService;
@Value("${sinobase.isIntranet}")
private boolean isIntranet;
/**
* 获取已办分页数据
* @param pageNumber 第几页数据
* @param countPerPage 每页有几条数据
* @return json型式的整页待办数据
*/
@RequestMapping("/list/{pageNumber}/{countPerPage}")
@ResponseBody
public List<Map<String, String>> getDoneList(@PathVariable int pageNumber, @PathVariable int countPerPage){
int pageCount = 0;
if(isIntranet){
pageCount = doneService.getPageCount(countPerPage);
}else{
pageCount = doneExtranetService.getPageCount(countPerPage);
}
List<Map<String, String>> doneList = null;
if(pageNumber <= pageCount) {
if(isIntranet){
doneList = doneService.doneList(pageNumber, countPerPage,"self","");
}else{
doneList = doneExtranetService.doneList(pageNumber, countPerPage,"self","");
}
}
return doneList;
}
/**
* 获取列表信息
* @return
*/
@RequestMapping("/tablelist")
@ResponseBody
public TableDataInfo getDoneTableList(String title,String number){
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);
}
int indexCount = 0;
List<Map<String, String>> doneList = null;
if(isIntranet){
indexCount = doneService.getIndexCount(title);
doneList = doneService.doneList(pageNum, pageSize,"self",title);
}else{
indexCount = doneExtranetService.getIndexCount(title);
doneList = doneExtranetService.doneList(pageNum, pageSize,"self",title);
}
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(0);
rspData.setRows(doneList);
rspData.setTotal(indexCount);
return rspData;
}
/**
* 获取已办数据分页数量(页数)
* @param count 每页的数据条数
* @return 页数
*/
@RequestMapping("/page_count/{count}")
@ResponseBody
public int getPageCount(@PathVariable int count) {
int pageCount = 0;
if(isIntranet){
pageCount = doneService.getPageCount(count);
}else{
pageCount = doneExtranetService.getPageCount(count);
}
return pageCount;
}
/**
* 获取已办理文件数
* @return
*/
@RequestMapping("/getFileCount")
@ResponseBody
public int getFileCount() {
int fileCount = 0;
if(isIntranet){
fileCount = doneService.getIndexCount("");
}else{
fileCount = doneExtranetService.getIndexCount("");
}
return fileCount;
}
}
package com.sinobase.project.module.done.dao;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.project.system.user.domain.User;
import org.apache.poi.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.*;
public class LocalSysHandler {
public static final String SOURCE = "local";
private static final Logger log = LoggerFactory.getLogger(LocalSysHandler.class);
/**
* 外网直接获取mysql中已办数据
* @param dataSource
* @param pageNumber
* @param countPerPage
* @param title
* @return
* @throws SQLException
*/
public static List<Map<String, String>> getDoneList(DruidDataSource dataSource,int pageNumber,int countPerPage,String title)
throws SQLException{
User user = ShiroUtils.getSysUser();
List<Map<String, String>> ret = new ArrayList<Map<String, String>>();
String fieldArray[] = new String[] {"id", "title", "filetypeid", "filetypename", "workflowid", "workflowname", "recordid", "readtime","handdoneurl","docid"};
String filedStr = StringUtil.join(fieldArray, ",");
String sql = "select "+filedStr+" from flow_read_new as b where not exists(select 1 from flow_read_new where userid=b.userid and recordid= b.recordid " +
"and b.readtime<readtime ) and (userid='"+user.getUserId()+"' or userid='"+user.getHistoryId()+"')";
if(StringUtils.isNotEmpty(title)){
sql += " and title like '%"+title+"%'";
}
sql += " order by str_to_date(readtime,'%Y-%m-%d %H:%i:%s') desc ";
System.out.println("已办 sql "+sql);
if(pageNumber!=0&&countPerPage!=0){
sql += "limit "+ (pageNumber-1)*countPerPage +","+ countPerPage;
}
log.debug("flow_read_new:"+sql);
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
conn = dataSource.getConnection();
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Map<String, String> cur = new HashMap<String, String>();
for(int ix = 0; ix < fieldArray.length; ++ ix) {
String field = fieldArray[ix];
String val = rs.getString(field);
cur.put(field, val);
}
ret.add(cur);
}
}
} catch (SQLException e) {
e.printStackTrace();
}finally{
rs.close();
pstmt.close();
conn.close();
}
return ret;
}
/**
* 从已办表中查询一个时间点到当前时间的数据
* @param dataSource
* @param latestTime
* @return
* @throws SQLException
*/
static List<Map<String, Object>> getNotIndexedLocal(DruidDataSource dataSource, Date latestTime)
throws SQLException{
User user = ShiroUtils.getSysUser();
String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(latestTime);
List<Map<String, Object>> ret = new ArrayList<Map<String, Object>>(); //ArrayList即可,无需排序
String sql = "select id, str_to_date(readtime, '%Y-%m-%d %H:%i:%s') as doomsday,userid,title,recordid " +
" from flow_read_new as b where not EXISTS( select 1 from flow_read_new where userid=b.userid and recordid= b.recordid" +
" and b.readtime<readtime ) and (userid='"+user.getUserId()+"' or userid='"+user.getHistoryId()+"') and " +
" str_to_date(readtime, '%Y-%m-%d %H:%i:%s') > str_to_date('"+time+"', '%Y-%m-%d %H:%i:%s')" +
" order by str_to_date(readtime, '%Y-%m-%d %H:%i:%s') desc";
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
System.out.println("getNotIndexedLocal "+sql);
try {
conn = dataSource.getConnection();
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Map<String, Object> temp = new HashMap<String, Object>();
String id = rs.getString("id");
Date doomsday = new Date(rs.getTimestamp("doomsday").getTime());
String userid = rs.getString("userid");
String title = rs.getString("title");
String recordid = rs.getString("recordid");
temp.put("id", id);
temp.put("doomsday", doomsday);
temp.put("userid", userid);
temp.put("title", title);
temp.put("recordid", recordid);
temp.put("source", LocalSysHandler.SOURCE);
ret.add(temp);
}
}
} catch(SQLException e) {
e.printStackTrace();
}finally{
rs.close();
pstmt.close();
conn.close();
}
return ret;
}
/**
* 根据已办ID批量获取已办信息(不排序)
* @param dataSource
* @param idList
* @return
*/
public static Map<String, Map<String, String>> getDoneListById(DruidDataSource dataSource, List<String> idList)
throws SQLException{
Map<String,Map<String, String>> ret = new HashMap<String, Map<String, String>>();
String fragment = LocalSysHandler.buildSQLFragment(idList);
if(StringUtils.isNotEmpty(fragment)){
String fieldArray[] = new String[] {"id", "title", "filetypeid", "filetypename", "workflowid", "workflowname", "recordid", "readtime","handdoneurl","docid"};
String filedStr = StringUtil.join(fieldArray, ",");
String sql = "select "+filedStr+" from flow_read_new where id in ("+fragment+")";
log.debug("flow_read_new:"+sql);
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
conn = dataSource.getConnection();
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Map<String, String> cur = new HashMap<String, String>();
for(int ix = 0; ix < fieldArray.length; ++ ix) {
String field = fieldArray[ix];
String val = rs.getString(field);
cur.put(field, val);
}
ret.put(cur.get("id"), cur);
}
}
} catch (SQLException e) {
e.printStackTrace();
} finally{
rs.close();
pstmt.close();
conn.close();
}
}
return ret;
}
//构建SQL语句片段
private static String buildSQLFragment(List<String> idList) {
StringBuffer fragment = new StringBuffer();
int size = idList.size();
for(int ix = 0; ix < size; ++ ix) {
if(ix != 0)
fragment.append(",");
fragment.append("'"+idList.get(ix)+"'");
}
return fragment.toString();
}
}
package com.sinobase.project.module.done.dao;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.common.utils.spring.SpringUtils;
import com.sinobase.datasource.aspectj.lang.enums.DataSourceType;
import com.sinobase.datasource.source.DynamicDataSourceContextHolder;
import com.sinobase.project.system.user.domain.User;
import org.apache.poi.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.*;
public class RemoteSysHandler {
public static final String SOURCE = "old";
private static final Logger log = LoggerFactory.getLogger(RemoteSysHandler.class);
static List<Map<String, Object>> getNotIndexedRemote(Date latestTime)
throws SQLException {
User user = ShiroUtils.getSysUser();
List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>();
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.ORACLE.name());
DataSource dataSource = (DataSource) SpringUtils.getBean("dynamicDataSource");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// format.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
String sql = "select id, TO_DATE(readtime, 'yyyy-mm-dd hh24:mi:ss') as doomsday,userid,title,recordid from flow_read " +
" where (userid='"+user.getUserId()+"' or userid='"+user.getHistoryId()+"') and TO_DATE(readtime, 'yyyy-mm-dd hh24:mi:ss') > TO_DATE('"+format.format(latestTime)+"', 'yyyy-mm-dd hh24:mi:ss')"+
" order by TO_DATE(readtime, 'yyyy-mm-dd hh24:mi:ss') desc";
log.debug(sql);
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
System.out.println("getNotIndexedRemote "+sql);
try {
conn = dataSource.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
getValue(conn,stmt,rs,resultList);
} catch (Exception e) {
e.printStackTrace();
} finally {
rs.close();
stmt.close();
conn.close();
DynamicDataSourceContextHolder.clearDataSourceType();
}
return resultList;
}
private static void getValue(Connection conn,Statement stmt,ResultSet rs,List<Map<String, Object>> resultList) throws Exception{
User user = ShiroUtils.getSysUser();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if(null != rs) {
while (rs.next()) {
Map<String, Object> temp = new HashMap<String, Object>();
String id = parseString(rs.getString("id"));
Date doomsday = format.parse(parseString(rs.getString("doomsday")));
String userid = parseString(rs.getString("userid"));
String title = parseString(rs.getString("title"));
String recordid = parseString(rs.getString("recordid"));
temp.put("id", id);
temp.put("doomsday", doomsday);
temp.put("userid", userid);
temp.put("title", title);
temp.put("recordid", recordid);
temp.put("source", RemoteSysHandler.SOURCE);
resultList.add(temp);
}
}
DynamicDataSourceContextHolder.clearDataSourceType();
}
private static String parseString(Object obj) {
String ret = "";
if(obj != null)
ret = obj.toString();
return ret;
}
public static synchronized Map<String, Map<String, String>> getDoneListById(List<String> idList)
throws SQLException{
Map<String,Map<String, String>> ret = new HashMap<String, Map<String, String>>();
String fragment = RemoteSysHandler.buildSQLFragment(idList);
if(StringUtils.isNotEmpty(fragment)){
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.ORACLE.name());
DataSource dataSource = (DataSource) SpringUtils.getBean("dynamicDataSource");
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
String fieldArray[] = new String[] {"id", "title", "filetypeid", "filetypename", "workflowid", "workflowname", "recordid", "readtime","(select w.overdo_url||'&'||w.target_key||'=' from waitdo_config w where w.filetype_id=r.filetypeid and rownum=1) as readUrl"};
String fieldArray2[] = new String[] {"id", "title", "filetypeid", "filetypename", "workflowid", "workflowname", "recordid", "readtime","readUrl"};
String filedStr = StringUtil.join(fieldArray, ",");
String sql = "select "+filedStr+" from flow_read r where r.id in ("+fragment+")";
try {
conn = dataSource.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
getValue(conn,stmt,rs,ret,fieldArray2);
} catch (Exception e) {
e.printStackTrace();
}finally{
rs.close();
stmt.close();
conn.close();
DynamicDataSourceContextHolder.clearDataSourceType();
}
}
return ret;
}
private static void getValue(Connection conn,Statement stmt,ResultSet rs,Map<String,Map<String, String>> ret,String[] fieldArray2) throws Exception{
if(null != rs) {
while (rs.next()) {Map<String, String> cur = new HashMap<String, String>();
for(int i = 0; i < fieldArray2.length; ++ i) {
String field = fieldArray2[i];
String val = parseString(rs.getString(field));
cur.put(field, val);
}
ret.put(rs.getString("id"), cur);
}
}
DynamicDataSourceContextHolder.clearDataSourceType();
}
//构建SQL语句片段
private static String buildSQLFragment(List<String> idList) {
StringBuffer fragment = new StringBuffer();
int size = idList.size();
for(int ix = 0; ix < size; ++ ix) {
if(ix != 0)
fragment.append(",");
fragment.append("'"+idList.get(ix)+"'");
}
return fragment.toString();
}
}
package com.sinobase.project.module.done.service;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.project.module.done.dao.LocalSysHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@Service
public class DoneExtranetServiceImpl implements IDoneExtranetService {
@Autowired
private DruidDataSource dataSource;
@Override
public List<Map<String, String>> doneList(int pageNumber, int countPerPage,String type,String title) {
List<Map<String, String>> ret = new LinkedList<Map<String,String>>();
try{
if(type.equals("table")){
ret = LocalSysHandler.getDoneList(dataSource,0,0,title);
}else{
ret = LocalSysHandler.getDoneList(dataSource,pageNumber,countPerPage,title);
}
}catch(Exception e){
e.printStackTrace();
}
return ret;
}
@Override
public int getPageCount(int count) {
int indexCount = 0;
List<Map<String, String>> ret = new LinkedList<Map<String,String>>();
try{
ret = LocalSysHandler.getDoneList(dataSource,0,0,"");
indexCount = ret.size();
}catch(Exception e){
e.printStackTrace();
}
// 计算页数并返回
int pageCount = indexCount / count;
if(0 != indexCount % count)
++ pageCount;
return pageCount;
}
@Override
public int getIndexCount(String title) {
int indexCount = 0;
List<Map<String, String>> ret = new LinkedList<Map<String,String>>();
try{
ret = LocalSysHandler.getDoneList(dataSource,0,0,title);
indexCount = ret.size();
}catch(Exception e){
e.printStackTrace();
}
return indexCount;
}
}
package com.sinobase.project.module.done.service;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.project.module.done.dao.IndexHandler;
import com.sinobase.project.module.done.dao.LocalSysHandler;
import com.sinobase.project.module.done.dao.RemoteSysHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.sql.SQLException;
import java.util.*;
@Service
public class DoneServiceImpl implements IDoneService {
@Autowired
private DruidDataSource dataSource;
@Override
public List<Map<String, String>> doneList(int pageNumber, int countPerPage,String type,String title) {
// step.1 刷新待办索引的数据
//IndexHandler.refreshIndex(dataSource);
// step.2 通过分页的形式查询索引表
List<Map<String, Object>> pagingList = new ArrayList<Map<String,Object>>();
try{
if(type.equals("table")){
pagingList = IndexHandler.paging(dataSource);
}else{
pagingList = IndexHandler.paging(dataSource, pageNumber, countPerPage, title);
}
}catch (Exception e){
e.printStackTrace();
}
// step.3 根据分页表中的id和source_system字段,分别调用LocalSystemHandler和RemoteSysHandler类中的查询方法
List<String> localIds = new ArrayList<String>(); //本系统待办表中的ID集合
List<String> remoteOldIds = new ArrayList<String>(); //老系统待办表中的ID集合
for(int ix = 0; ix < pagingList.size(); ++ ix) {
Map<String, Object> cur = pagingList.get(ix);
String id = cur.get("id").toString();
String source = cur.get("source").toString();
switch(source) {
case LocalSysHandler.SOURCE:
localIds.add(id);
break;
case RemoteSysHandler.SOURCE:
remoteOldIds.add(id);
break;
}
}
Map<String, Map<String, String>> localDone = new HashMap<>();
Map<String, Map<String, String>> remoteOldDone = new HashMap<>();
try {
localDone = LocalSysHandler.getDoneListById(dataSource, localIds);
remoteOldDone = RemoteSysHandler.getDoneListById(remoteOldIds);
} catch (SQLException throwables) {
throwables.printStackTrace();
}
// step.4 把两个来源的数据进行排序操作,并返回
List<Map<String, String>> ret = new LinkedList<Map<String,String>>();
for(int ix = 0; ix < pagingList.size(); ++ ix) {
Map<String, Object> pMap = pagingList.get(ix);
String id = pMap.get("id").toString();
String source = pMap.get("source").toString();
Map<String, String> cur = null;
switch(source) {
case LocalSysHandler.SOURCE:
cur = localDone.get(id);
break;
case RemoteSysHandler.SOURCE:
cur = remoteOldDone.get(id);
break;
}
if(null != cur)
ret.add(cur);
}
return ret;
}
@Override
public int getPageCount(int count) {
// step.1 刷新待办索引的数据
IndexHandler.refreshIndex(dataSource);
// step.2 查出待办索引表的数据量count(1)
int indexCount = 0;
try {
indexCount = IndexHandler.getIndexCount(dataSource,"");
} catch (SQLException throwables) {
throwables.printStackTrace();
}
// step.3 计算页数并返回
int pageCount = indexCount / count;
if(0 != indexCount % count)
++ pageCount;
return pageCount;
}
@Override
public int getIndexCount(String title) {
// step.1 刷新待办索引的数据
IndexHandler.refreshIndex(dataSource);
// step.2 查出待办索引表的数据量count(1)
int indexCount = 0;
try {
indexCount = IndexHandler.getIndexCount(dataSource,title);
} catch (SQLException throwables) {
throwables.printStackTrace();
}
return indexCount;
}
}
package com.sinobase.project.module.done.service;
import java.util.List;
import java.util.Map;
public interface IDoneExtranetService {
/**
* 获取已办分页数据
* @param pageNumber 第几页数据
* @param countPerPage 每页有几条数据
* @return 整页待办数据
*/
public List<Map<String, String>> doneList(int pageNumber, int countPerPage, String type, String title);
/**
* 获取已办数据分页数量(页数)
* @param count 每页的数据条数
* @return 页数
*/
public int getPageCount(int count);
/**
* 获取登录人所有记录数
* @return
*/
public int getIndexCount(String title);
}
package com.sinobase.project.module.done.service;
import java.util.List;
import java.util.Map;
public interface IDoneService {
/**
* 获取已办分页数据
* @param pageNumber 第几页数据
* @param countPerPage 每页有几条数据
* @return 整页待办数据
*/
public List<Map<String, String>> doneList(int pageNumber, int countPerPage,String type,String title);
/**
* 获取已办数据分页数量(页数)
* @param count 每页的数据条数
* @return 页数
*/
public int getPageCount(int count);
/**
* 获取登录人所有记录数
* @return
*/
public int getIndexCount(String title);
}
package com.sinobase.project.module.homepage.mapper;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* 首页操作层通用
* @author liuhui
*/
@Repository
public interface HomePageMapper {
/**
* 获取通知信息
* @param recordid
* @return
*/
public Map<String, String> getTongZhiById(@Param("recordid") String recordid);
}
package com.sinobase.project.module.homepage.service;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sinobase.project.module.homepage.mapper.HomePageMapper;
/**
*
* 首页获取信息专用service层,替换原先的service层方法
*
* @author liuhui001
*
*/
@Service
public class HomePageSeriveImpl implements IHomePageSerive{
@Autowired
private HomePageMapper pageMapper;
@Override
public Map<String, String> getTongZhiById(String recordid) {
return pageMapper.getTongZhiById(recordid);
}
}
package com.sinobase.project.module.homepage.service;
import java.util.Map;
/**
*
* 首页获取信息专用service层,替换原先的service层方法
*
* @author liuhui001
*
*/
public interface IHomePageSerive {
/**
* 获取通知信息
* @param recordid
* @return
*/
public Map<String, String> getTongZhiById(String recordid);
}
package com.sinobase.project.module.toberead.comtroller;
import com.github.pagehelper.PageHelper;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.framework.web.page.PageDomain;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.framework.web.page.TableSupport;
import com.sinobase.project.module.toberead.service.ITobereadExtranetService;
import com.sinobase.project.module.toberead.service.ITobereadService;
import com.sinobase.project.system.user.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/toberead")
public class TobereadController extends BaseController {
@Autowired
ITobereadService tobereadService;
@Autowired
ITobereadExtranetService tobereadExtranetService;
@Value("${sinobase.isIntranet}")
private boolean isIntranet;
/**
* 获取待阅数据分页数量(页数)
* @param count 每页的数据条数
* @return 页数
*/
@RequestMapping("/page_count/{count}")
@ResponseBody
public int getPageCount(@PathVariable int count) {
if(isIntranet){
return tobereadService.getPageCount(count);
}else{
return tobereadExtranetService.getPageCount(count);
}
}
/**
* 获取所有待阅数据的数量
* @return 待阅数量
*/
@RequestMapping("/count")
@ResponseBody
public int getCount() {
if(isIntranet){
return tobereadService.getCount();
}else{
return tobereadExtranetService.getCount();
}
}
/**
* 获取待办分页数据
* @param pageNumber 第几页数据
* @param countPerPage 每页有几条数据
* @return json型式的整页待阅数据
*/
@RequestMapping("/list/{pageNumber}/{countPerPage}")
@ResponseBody
public Map<String,Object> getDoneList(@PathVariable int pageNumber, @PathVariable int countPerPage){
Map<String,Object> map = new HashMap<String,Object>();
User user = ShiroUtils.getSysUser();
if(isIntranet){
tobereadService.refreshIndex(user.getUserId());
map.put("list",tobereadService.getDoneList(pageNumber, countPerPage));
map.put("count",tobereadService.getCount());
}else{
map.put("list",tobereadExtranetService.getDoneList(pageNumber,countPerPage));
map.put("count",tobereadExtranetService.getCount());
}
return map;
}
/**
* 获取列表信息
* @return
*/
@RequestMapping("/tablelist")
@ResponseBody
public TableDataInfo getDoneTableList(){
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);
}
User user = ShiroUtils.getSysUser();
int indexCount = 0;
List<Object> doneList = null;
if(isIntranet){
tobereadService.refreshIndex(user.getUserId());
indexCount = tobereadService.getCount();
doneList = new ArrayList<Object>(tobereadService.getDoneList(pageNum, pageSize));
}else{
indexCount = tobereadExtranetService.getCount();
doneList = new ArrayList<Object>(tobereadExtranetService.getDoneList(pageNum,pageSize));
}
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(0);
rspData.setRows(doneList);
rspData.setTotal(indexCount);
return rspData;
}
/**
* 批量阅毕
* @param ids
* @param dataSources
* @return
*/
@RequestMapping("/afterReading")
@ResponseBody
public AjaxResult afterReading(String ids,String dataSources){
String[] idArray = ids.split(",");
String[] dataSourceArray = dataSources.split(",");
for(int i=0;i<idArray.length;i++){
String id = idArray[i];
String dataSource = dataSourceArray[i];
if(isIntranet){
tobereadService.afterReading(id,dataSource);
}else{
tobereadExtranetService.afterReading(id,dataSource);
}
}
return super.success();
}
}
package com.sinobase.project.module.toberead.dao;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.project.module.toberead.model.Toberead;
import com.sinobase.project.system.portal.constant.MessageConstants;
import com.sinobase.project.system.user.domain.User;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class LocalTobereadHandler {
public static final String SOURCE = "local";
public static List<Toberead> getTodo(DruidDataSource dataSource,int pageNumber,int countPerPage)
throws SQLException{
User user = ShiroUtils.getSysUser();
List<Toberead> ret = new ArrayList<Toberead>();
String sql = "select id, title, url, receive_time,grant_user_id,from_user_name,0 as leaderInsNum,wait_handle_primary_key_value as relationId,wait_handle_table_name as relationTable from sys_message where grant_user_id LIKE '%"+user.getUserId()+
"%' and message_type='"+ MessageConstants.MESSAGE_TYPE_DOC_SEND_WAIT +"'";
sql += " order by receive_time desc";
if(pageNumber!=0&&countPerPage!=0){
sql += " limit "+ (pageNumber-1)*countPerPage +","+ countPerPage;
}
System.out.println("待阅 mysql "+sql);
Connection conn = dataSource.getConnection();
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Toberead cur = new Toberead();
cur.setId(rs.getString("id"));
cur.setTitle(rs.getString("title"));
cur.setUrl(rs.getString("url"));
cur.setFromUserName(rs.getString("from_user_name"));
cur.setLeaderInsNum(rs.getString("leaderInsNum"));
cur.setRelationId(rs.getString("relationId"));
cur.setRelationTable(rs.getString("relationTable"));
Date receiveTime = rs.getTimestamp("receive_time");
//TODO: 因为redis从小到大排序,所以考虑是不是要把时间载戳变成负数
cur.setReceiveTime(0-receiveTime.getTime());
cur.setDataSource(SOURCE);
ret.add(cur);
}
}
}catch(SQLException e) {
e.printStackTrace();
}finally {
rs.close();
pstmt.close();
conn.close();
}
return ret;
}
}
package com.sinobase.project.module.toberead.dao;
import com.sinobase.common.utils.DateUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.common.utils.spring.SpringUtils;
import com.sinobase.datasource.aspectj.lang.enums.DataSourceType;
import com.sinobase.datasource.source.DynamicDataSourceContextHolder;
import com.sinobase.project.module.toberead.model.Toberead;
import com.sinobase.project.system.user.domain.User;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class RemoteTobereadHandler {
public static final String SOURCE = "old";
public static synchronized List<Toberead> getTodo(){
User user = ShiroUtils.getSysUser();
List<Toberead> ret = new ArrayList<Toberead>();
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.ORACLE.name());
DataSource dataSource = (DataSource) SpringUtils.getBean("dynamicDataSource");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String sql = "select send_id,send_title,view_url,cre_time,in_user_id,(select username from flow_user u where u.userid=t.cre_user_id) as fromusername," +
"case when (t.relation_table='YZ_ARCHIVES_IN')" +
" then (select count(*) from flow_idea a where tablename like 'YZ_ARCHIVES_IN' and a.stattag ='1' and a.wfisvisible ='1' and a.recordid =t.relation_id )" +
" when (t.relation_table='YZ_ARCHIVES_OUT')" +
" then (select count(*) from flow_idea a where tablename like 'YZ_ARCHIVES_OUT' and a.stattag ='1' and a.wfisvisible ='1' and a.recordid =t.relation_id )" +
" when (t.relation_table='YZ_ARCHIVES_SIGN')" +
" then (select count(*) from flow_idea a where tablename like 'YZ_ARCHIVES_SIGN' and a.stattag ='1' and a.wfisvisible ='1' and a.recordid =t.relation_id )" +
" when (t.relation_table='YZ_ARCHIVES_SUMMARY')" +
" then (select count(*) from flow_idea a where tablename like 'YZ_ARCHIVES_SUMMARY' and a.stattag ='1' and a.wfisvisible ='1' and a.recordid =t.relation_id )" +
" end as leaderInsNum,relation_id as relationId,relation_table as relationTable " +
" from doc_send t" +
" where t.is_GONGGAO is null and see_flag='0' and t.flag='1'";
sql += " and t.filing_cabinet_id is null and t.del_flag='1' " +
" and t.in_user_id='" + user.getHistoryId() + "' " +
"and t.relation_id not in (" +
"select t.NOTICE_ID from YZ_SDIC_NOTICEINFO t " +
"where t.USERID = '" + user.getHistoryId() + "' and t.STATUS = '1')" +
"and (case when relation_table = 'YZ_SDIC_WORKNOTICE'" +
" and exists( select 1 from YZ_SDIC_WORKNOTICE w where status = '2' and w.id=relation_id) then '1'" +
"when relation_table != 'YZ_SDIC_WORKNOTICE' then '1' else '0' end) = '1' order by t.cre_time desc";
System.out.println("待阅 oracle "+sql);
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try{
conn = dataSource.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
getValue(conn,stmt,rs,ret);
}catch(Exception e){
e.printStackTrace();
}finally{
DynamicDataSourceContextHolder.clearDataSourceType();
}
return ret;
}
private static void getValue(Connection conn,Statement stmt,ResultSet rs,List<Toberead> ret) throws Exception{
User user = ShiroUtils.getSysUser();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if(null != rs) {
while (rs.next()) {
Toberead cur = new Toberead();
String id = parseString(rs.getString("send_id"));
String title = parseString(rs.getString("send_title"));
String url = parseString(rs.getString("view_url"));
Date receivetime = format.parse(parseString(rs.getString("cre_time")));
String userid = parseString(rs.getString("in_user_id"));
String fromusername = parseString(rs.getString("fromusername"));
String leaderInsNum = parseString(rs.getString("leaderInsNum"));
String relationId = parseString(rs.getString("relationId"));
String relationTable = parseString(rs.getString("relationTable"));
cur.setId(id);
cur.setTitle(title);
cur.setUrl(url);
//TODO: 因为redis从小到大排序,所以考虑是不是要把时间载戳变成负数
cur.setReceiveTime(0-receivetime.getTime());
cur.setDataSource(SOURCE);
cur.setFromUserName(fromusername);
cur.setLeaderInsNum(leaderInsNum);
cur.setRelationId(relationId);
cur.setRelationTable(relationTable);
ret.add(cur);
}
}
rs.close();
stmt.close();
conn.close();
DynamicDataSourceContextHolder.clearDataSourceType();
}
private static String parseString(Object obj) {
String ret = "";
if(obj != null)
ret = obj.toString();
return ret;
}
/**
* 阅毕
* @param id
*/
public static void afterReading(String id){
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.ORACLE.name());
DataSource dataSource = (DataSource) SpringUtils.getBean("dynamicDataSource");
String sql = "update doc_send set see_flag='1' ,notion_date='"+ DateUtils.getNowDate("yyyy-MM-dd HH:mm:ss") +"' where send_id='"+id+"'";
Connection conn = null;
Statement stmt = null;
try{
conn = dataSource.getConnection();
stmt = conn.createStatement();
update(conn,stmt,sql);
}catch(Exception e){
e.printStackTrace();
}finally{
DynamicDataSourceContextHolder.clearDataSourceType();
}
}
private static void update(Connection conn,Statement stmt,String sql) throws Exception{
int i = stmt.executeUpdate(sql);
stmt.close();
conn.close();
DynamicDataSourceContextHolder.clearDataSourceType();
}
}
package com.sinobase.project.module.toberead.model;
import java.io.Serializable;
public class Toberead implements Serializable {
private String id; //数据ID
private String title; //待阅标题
private long receiveTime; //待阅接收到的时候,根据这个字段进行排序
private String url; //待阅url
private String fromUserName; //上一办理人
private String leaderInsNum; //领导批示数
private String relationId; //关联ID
private String relationTable; //关联表
private String dataSource; //数据来源
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public long getReceiveTime() {
return receiveTime;
}
public void setReceiveTime(long receiveTime) {
this.receiveTime = receiveTime;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getFromUserName() {
return fromUserName;
}
public void setFromUserName(String fromUserName) {
this.fromUserName = fromUserName;
}
public String getDataSource() {
return dataSource;
}
public void setDataSource(String dataSource) {
this.dataSource = dataSource;
}
public String getLeaderInsNum() {
return leaderInsNum;
}
public void setLeaderInsNum(String leaderInsNum) {
this.leaderInsNum = leaderInsNum;
}
public String getRelationId() {
return relationId;
}
public void setRelationId(String relationId) {
this.relationId = relationId;
}
public String getRelationTable() {
return relationTable;
}
public void setRelationTable(String relationTable) {
this.relationTable = relationTable;
}
}
package com.sinobase.project.module.toberead.service;
import com.sinobase.project.module.toberead.model.Toberead;
import java.util.List;
public interface ITobereadExtranetService {
public int getPageCount(int count);
public int getCount();
public List<Toberead> getDoneList(int pageNumber, int countPerPage);
public void afterReading(String id, String dataSource);
}
package com.sinobase.project.module.toberead.service;
import java.util.Set;
public interface ITobereadService {
public int getPageCount(int count);
public int getCount();
public Set<Object> getDoneList(int pageNumber, int countPerPage);
public void refreshIndex(String userId);
public void afterReading(String id, String dataSource);
}
package com.sinobase.project.module.toberead.service;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.common.utils.DateUtils;
import com.sinobase.common.utils.IdUtils;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.project.module.toberead.dao.LocalTobereadHandler;
import com.sinobase.project.module.toberead.dao.RemoteTobereadHandler;
import com.sinobase.project.module.toberead.model.Toberead;
import com.sinobase.project.system.portal.domain.Message;
import com.sinobase.project.system.portal.service.IMessageService;
import com.sinobase.project.system.readingmanagement.domain.DocSend;
import com.sinobase.project.system.readingmanagement.service.IDocSendService;
import com.sinobase.project.system.user.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class TobereadExtranetServiceImpl implements ITobereadExtranetService {
@Autowired
private DruidDataSource dataSource;
@Autowired
private IMessageService messageService;
@Autowired
IDocSendService docSendService;
@Override
public int getPageCount(int count) {
int itemCount = getCount();
int pageCount = itemCount / count;
if(0 != itemCount % count) {
++ pageCount;
}
return pageCount;
}
@Override
public int getCount() {
int count = 0;
try{
List<Toberead> localTodoList = LocalTobereadHandler.getTodo(dataSource,0,0);
count = localTodoList.size();
}catch(Exception e){
e.printStackTrace();
}
return count;
}
@Override
public List<Toberead> getDoneList(int pageNumber, int countPerPage) {
List<Toberead> localTodoList = null;
try{
localTodoList = LocalTobereadHandler.getTodo(dataSource,pageNumber,countPerPage);
}catch(Exception e){
e.printStackTrace();
}
return localTodoList;
}
/**
* 阅毕
* @param id
* @param dataSource
*/
public void afterReading(String id, String dataSource){
User user = ShiroUtils.getSysUser();
//新老数据判断
if(StringUtils.isNotEmpty(dataSource)&&dataSource.equals(LocalTobereadHandler.SOURCE)){
//获取message信息
Message msg = messageService.getMessage(id);
//向doc_send中插入已阅信息
DocSend doc = new DocSend();
doc.setSendId(IdUtils.getRandomIdByUUID());
doc.setRelationId(msg.getSubordinateId());
doc.setRelationTable(msg.getWaitHandleTableName());
doc.setRelationKey(msg.getWaitHandlePrimaryKeyName());
doc.setViewUrl(msg.getUrl());
doc.setInUserId(user.getUserId());
doc.setCreUserId(user.getUserId());
doc.setCreTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
doc.setNotionDate(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
doc.setSeeFlag("1");
doc.setKeyWord(msg.getCategoryTypes());
doc.setSendTitle(msg.getTitle());
doc.setNotionDate(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
docSendService.saveDocSend(doc);
//删除待阅信息
messageService.delMessage(id);
}else if(StringUtils.isNotEmpty(dataSource)&&dataSource.equals(RemoteTobereadHandler.SOURCE)){
// 外网只处理mysql待阅数据 oracle不进行处理
// RemoteTobereadHandler.afterReading(id);
}
}
}
package com.sinobase.project.module.toberead.service;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.common.utils.DateUtils;
import com.sinobase.common.utils.IdUtils;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.project.module.toberead.dao.LocalTobereadHandler;
import com.sinobase.project.module.toberead.dao.RemoteTobereadHandler;
import com.sinobase.project.module.toberead.model.Toberead;
import com.sinobase.project.system.portal.domain.Message;
import com.sinobase.project.system.portal.service.IMessageService;
import com.sinobase.project.system.readingmanagement.domain.DocSend;
import com.sinobase.project.system.readingmanagement.service.IDocSendService;
import com.sinobase.project.system.user.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.DefaultTypedTuple;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ZSetOperations;
import org.springframework.stereotype.Service;
import java.sql.SQLException;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@Service
public class TobereadServiceImpl implements ITobereadService {
@Autowired
private RedisTemplate<Object, Object> redisTemplate;
@Autowired
private DruidDataSource dataSource;
@Autowired
private IMessageService messageService;
@Autowired
IDocSendService docSendService;
@Override
public int getPageCount(int count) {
int itemCount = getCount();
int pageCount = itemCount / count;
if(0 != itemCount % count) {
++ pageCount;
}
return pageCount;
}
@Override
public int getCount() {
User user = ShiroUtils.getSysUser();
String userId = user.getUserId();
int count = redisTemplate.opsForZSet().zCard("toberead"+userId).intValue();
return count;
}
@Override
public Set<Object> getDoneList(int pageNumber, int countPerPage) {
User user = ShiroUtils.getSysUser();
String userId = user.getUserId();
int pageCount = getPageCount(countPerPage);
if(pageNumber > pageCount) { //如果要获取的页数大于实际页数
pageNumber = pageCount;
}
int start = (pageNumber - 1) * countPerPage;
int end = pageNumber * countPerPage - 1;
if(end > getCount()) {
end = -1;
}
Set<Object> ret = redisTemplate.opsForZSet().range("toberead"+userId, start, end);
return ret;
}
//从mysql和oracle中读取待阅数(根据用户ID)并添加到redis中,
public void refreshIndex(String userId) {
try {
List<Toberead> localTodoList = LocalTobereadHandler.getTodo(dataSource,0,0);
List<Toberead> remoteTodoList = RemoteTobereadHandler.getTodo();
localTodoList.addAll(remoteTodoList);
setRedisData(userId, localTodoList);
} catch (SQLException e) {
e.printStackTrace();
}
}
//将待阅数据更新到redis中
private void setRedisData(String userId, List<Toberead> todoList) {
redisTemplate.opsForZSet().removeRange("toberead"+userId, 0, -1);
/*for(Toberead todo : todoList) {
redisTemplate.opsForZSet().add("toberead"+userId, todo, todo.getReceiveTime());
}*/
Set<ZSetOperations.TypedTuple<Object>> tuples = new HashSet<ZSetOperations.TypedTuple<Object>>();
for(Toberead todo : todoList) {
ZSetOperations.TypedTuple<Object> curTuple = new DefaultTypedTuple(todo, (double)todo.getReceiveTime());
tuples.add(curTuple);
}
if(tuples.size()>0){
redisTemplate.opsForZSet().add("toberead" + userId, tuples);
}
}
/**
* 阅毕
* @param id
* @param dataSource
*/
public void afterReading(String id, String dataSource){
User user = ShiroUtils.getSysUser();
//新老数据判断
if(StringUtils.isNotEmpty(dataSource)&&dataSource.equals(LocalTobereadHandler.SOURCE)){
//获取message信息
Message msg = messageService.getMessage(id);
//向doc_send中插入已阅信息
DocSend doc = new DocSend();
doc.setSendId(IdUtils.getRandomIdByUUID());
doc.setRelationId(msg.getSubordinateId());
doc.setRelationTable(msg.getWaitHandleTableName());
doc.setRelationKey(msg.getWaitHandlePrimaryKeyName());
doc.setViewUrl(msg.getUrl());
doc.setInUserId(user.getUserId());
doc.setCreUserId(user.getUserId());
doc.setCreTime(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
doc.setNotionDate(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
doc.setSeeFlag("1");
doc.setKeyWord(msg.getCategoryTypes());
doc.setSendTitle(msg.getTitle());
doc.setNotionDate(DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date()));
docSendService.saveDocSend(doc);
//删除待阅信息
messageService.delMessage(id);
}else if(StringUtils.isNotEmpty(dataSource)&&dataSource.equals(RemoteTobereadHandler.SOURCE)){
RemoteTobereadHandler.afterReading(id);
}
}
}
package com.sinobase.project.module.todo.controller;
import com.github.pagehelper.PageHelper;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.framework.web.page.PageDomain;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.framework.web.page.TableSupport;
import com.sinobase.project.module.todo.model.Todo;
import com.sinobase.project.module.todo.service.IProcessJumpService;
import com.sinobase.project.module.todo.service.ITodoExtranetService;
import com.sinobase.project.module.todo.service.ITodoService;
import com.sinobase.project.system.user.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/processJump")
public class ProcessJumpController {
@Autowired
IProcessJumpService processJumpService;
/**
* 获取列表信息(跳节点)
* @return
*/
@RequestMapping("/tablelistAll")
@ResponseBody
public TableDataInfo getDoneTableListAll(String title){
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);
}
int indexCount = processJumpService.getCount("all",title);
List<Object> doneList = new ArrayList<Object>(processJumpService.getTodoList(pageNum, pageSize,"all",title));
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(0);
rspData.setRows(doneList);
rspData.setTotal(indexCount);
return rspData;
}
@RequestMapping("/tablelistAllDone")
@ResponseBody
public TableDataInfo getDoneTableListAllDone(String title){
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);
}
int indexCount = processJumpService.getDoneCount("all",title);
List<Object> doneList = new ArrayList<Object>(processJumpService.getDoneList(pageNum, pageSize,"all",title));
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(0);
rspData.setRows(doneList);
rspData.setTotal(indexCount);
return rspData;
}
}
package com.sinobase.project.module.todo.controller;
import com.github.pagehelper.PageHelper;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.framework.web.page.PageDomain;
import com.sinobase.framework.web.page.TableDataInfo;
import com.sinobase.framework.web.page.TableSupport;
import com.sinobase.project.module.todo.model.Todo;
import com.sinobase.project.module.todo.service.ITodoExtranetService;
import com.sinobase.project.module.todo.service.ITodoService;
import com.sinobase.project.system.user.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
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.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/todo")
public class TodoController {
@Autowired
ITodoService todoService;
@Autowired
ITodoExtranetService todoExtranetService;
@Value("${sinobase.isIntranet}")
private boolean isIntranet;
/**
* 获取待办数据分页数量(页数)
* @param count 每页的数据条数
* @return 页数
*/
@RequestMapping("/page_count/{count}")
@ResponseBody
public int getPageCount(@PathVariable int count) {
if(isIntranet){
return todoService.getPageCount(count);
}else{
return todoExtranetService.getPageCount(count);
}
}
/**
* 获取所有待办数据的数量
* @return 待办数量
*/
@RequestMapping("/count")
@ResponseBody
public int getCount() {
if(isIntranet){
return todoService.getCount();
}else{
return todoExtranetService.getCount();
}
}
/**
* 获取待办分页数据
* @param pageNumber 第几页数据
* @param countPerPage 每页有几条数据
* @return json型式的整页待办数据
*/
@RequestMapping("/list/{pageNumber}/{countPerPage}")
@ResponseBody
public Map<String,Object> getDoneList(@PathVariable int pageNumber, @PathVariable int countPerPage){
User user = ShiroUtils.getSysUser();
String userId = user.getUserId();
Map<String,Object> map = new HashMap<String,Object>();
if(isIntranet){
todoService.refreshIndex(userId);
map.put("list",todoService.getDoneList(pageNumber, countPerPage));
map.put("count",todoService.getCount());
}else{
map.put("list",todoExtranetService.getDoneList(pageNumber,countPerPage));
map.put("count",todoExtranetService.getCount());
}
return map;
}
/**
* 获取列表信息(更多)
* @return
*/
@RequestMapping("/tablelist")
@ResponseBody
public TableDataInfo getDoneTableList(String title){
User user = ShiroUtils.getSysUser();
String userId = user.getUserId();
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);
}
int indexCount = 0;
List<Object> doneList = null;
if(isIntranet){
todoService.refreshIndex(userId);
indexCount = todoService.getCount();
doneList = new ArrayList<Object>(todoService.getDoneList(pageNum, pageSize));
}else{
indexCount = todoExtranetService.getCount();
doneList = new ArrayList<Object>(todoExtranetService.getDoneList(pageNum, pageSize));
}
TableDataInfo rspData = new TableDataInfo();
rspData.setCode(0);
rspData.setRows(doneList);
rspData.setTotal(indexCount);
return rspData;
}
/**
* 根据sendclass获取待办列表信息
* @return
*/
@RequestMapping("/tablelistBySendclass")
@ResponseBody
public Map<String,List<Todo>> getDoneListBySendclass(){
Map<String,List<Todo>> map = null;
if(isIntranet){
map = todoService.getDoneList();
}else{
map = todoExtranetService.getDoneList();
}
return map;
}
}
package com.sinobase.project.module.todo.dao;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.project.module.todo.model.Todo;
import com.sinobase.project.system.portal.constant.MessageConstants;
import com.sinobase.project.system.user.domain.User;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class LocalTodoHandler {
public static final String SOURCE = "local";
public static List<Todo> getTodo(DruidDataSource dataSource,int pageNumber,int countPerPage)
throws SQLException{
User user = ShiroUtils.getSysUser();
List<Todo> ret = new ArrayList<Todo>();
String sql = "select id, title, url, receive_time,grant_user_id,from_user_name,subordinate_id,level,'' as sendclass,'' as filetypename,'' as wflevename,0 as leaderInsNum from sys_message where grant_user_id = '"+user.getUserId()
+"' and message_type='"+ MessageConstants.MESSAGE_TYPE_WORK_FLOW_WRITE +"'";
if(pageNumber!=0&&countPerPage!=0){
sql += " order by receive_time desc limit "+ (pageNumber-1)*countPerPage +","+ countPerPage;
}
System.out.println("LocalTodoHandler mysql "+sql);
Connection conn = dataSource.getConnection();
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Todo cur = new Todo();
cur.setId(rs.getString("id"));
cur.setTitle(rs.getString("title"));
cur.setUrl(rs.getString("url"));
cur.setFromUserName(rs.getString("from_user_name"));
Date receiveTime = rs.getTimestamp("receive_time");
//TODO: 因为redis从小到大排序,所以考虑是不是要把时间载戳变成负数
cur.setReceiveTime(0-receiveTime.getTime());
cur.setDataSource(SOURCE);
cur.setUrgency(rs.getString("level"));
cur.setSendclass(rs.getString("sendclass"));
cur.setFiletypename(rs.getString("filetypename"));
cur.setWflevename(rs.getString("wflevename"));
cur.setLeaderInsNum(rs.getString("leaderInsNum"));
cur.setRecordId(rs.getString("subordinate_id"));
cur.setTypeSort("");
cur.setLimitTime("");
cur.setFlowSort("");
cur.setFlowSort2("");
ret.add(cur);
}
}
}catch(SQLException e) {
e.printStackTrace();
}finally {
rs.close();
pstmt.close();
conn.close();
}
return ret;
}
}
package com.sinobase.project.module.todo.dao;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.project.module.done.dao.LocalSysHandler;
import com.sinobase.project.module.todo.model.Todo;
import com.sinobase.project.system.portal.constant.MessageConstants;
import com.sinobase.project.system.user.domain.User;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
public class ProcessJumpHandler {
public static final String SOURCE = "local";
public static List<Todo> getTodo(DruidDataSource dataSource,int pageNumber,int countPerPage,String isSelf,String title)
throws SQLException{
User user = ShiroUtils.getSysUser();
List<Todo> ret = new ArrayList<Todo>();
String sql = "select id, title, url, receive_time,grant_user_id,from_user_name,level,'' as sendclass from sys_message where 1=1 ";
if(StringUtils.isNotEmpty(isSelf)&&isSelf.equals("self")){
sql += " and grant_user_id = '"+user.getUserId()+"' ";
}else{
sql += " and url not like '%/questionnaire/%' ";
}
if(StringUtils.isNotEmpty(title)){
sql += " and title like '%"+title+"%' ";
}
sql += "and message_type='"+ MessageConstants.MESSAGE_TYPE_WORK_FLOW_WRITE +"'";
if(pageNumber!=0&&countPerPage!=0){
sql += " order by receive_time desc limit "+ (pageNumber-1)*countPerPage +","+ countPerPage;
}
System.out.println("LocalTodoHandler mysql "+sql);
Connection conn = dataSource.getConnection();
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Todo cur = new Todo();
cur.setId(rs.getString("id"));
cur.setTitle(rs.getString("title"));
cur.setUrl(rs.getString("url"));
cur.setFromUserName(rs.getString("from_user_name"));
Date receiveTime = rs.getTimestamp("receive_time");
//TODO: 因为redis从小到大排序,所以考虑是不是要把时间载戳变成负数
cur.setReceiveTime(0-receiveTime.getTime());
cur.setDataSource(SOURCE);
cur.setUrgency(rs.getString("level"));
cur.setSendclass(rs.getString("sendclass"));
ret.add(cur);
}
}
}catch(SQLException e) {
e.printStackTrace();
}finally {
rs.close();
pstmt.close();
conn.close();
}
return ret;
}
public static List<Map<String, Object>> getDone(DruidDataSource dataSource,int pageNumber,int countPerPage,String isSelf,String title)
throws SQLException{
User user = ShiroUtils.getSysUser();
List<Map<String, Object>> ret = new ArrayList<Map<String, Object>>();
String sql = "select id, title, filetypeid, filetypename,recordid,readtime,docid,userid from flow_read_new where 1=1 ";
if(StringUtils.isNotEmpty(isSelf)&&isSelf.equals("self")){
sql += " and userid = '"+user.getUserId()+"' ";
}else{
sql += " and handdoneurl not like '%/questionnaire/%' ";
}
if(StringUtils.isNotEmpty(title)){
sql += " and title like '%"+title+"%' ";
}
if(pageNumber!=0&&countPerPage!=0){
sql += " order by readtime desc limit "+ (pageNumber-1)*countPerPage +","+ countPerPage;
}
System.out.println("LocalDoneHandler mysql "+sql);
Connection conn = dataSource.getConnection();
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
if(null != rs) {
while(rs.next()) {
Map<String, Object> temp = new HashMap<String, Object>();
String id = rs.getString("id");
String userid = rs.getString("userid");
String til = rs.getString("title");
String recordid = rs.getString("recordid");
String docid = rs.getString("docid");
String filetypeid = rs.getString("filetypeid");
String filetypename = rs.getString("filetypename");
Date receiveTime = rs.getTimestamp("readtime");
temp.put("id", id);
temp.put("title", til);
temp.put("filetypeid", filetypeid);
temp.put("filetypename", filetypename);
temp.put("recordid", recordid);
temp.put("readtime", receiveTime);
temp.put("docid", docid);
temp.put("userid", userid);
ret.add(temp);
}
}
}catch(SQLException e) {
e.printStackTrace();
}finally {
rs.close();
pstmt.close();
conn.close();
}
return ret;
}
}
package com.sinobase.project.module.todo.dao;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.common.utils.spring.SpringUtils;
import com.sinobase.datasource.aspectj.lang.enums.DataSourceType;
import com.sinobase.datasource.source.DynamicDataSourceContextHolder;
import com.sinobase.project.module.todo.model.Todo;
import com.sinobase.project.system.user.domain.User;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class RemoteTodoHandler {
public static final String SOURCE = "old";
public static synchronized List<Todo> getTodo(){
User user = ShiroUtils.getSysUser();
List<Todo> ret = new ArrayList<Todo>();
DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.ORACLE.name());
DataSource dataSource = (DataSource) SpringUtils.getBean("dynamicDataSource");
String sql = "select t.id,t.title,t.recordid,t.url,t.createtime,t.userid,t.preusername,t.deptid,t.hj,t.sendclass,t.filetypename,t.wflevename,t.typesort,t.flowsort,t.flowsort2," +
"case when (t.sendclass='SW')" +
" then (select count(*) from flow_idea a where tablename like 'YZ_ARCHIVES_IN' and a.stattag ='1' and a.wfisvisible ='1' and a.recordid =t.recordid )" +
" when (t.sendclass='FW')" +
" then (select count(*) from flow_idea a where tablename like 'YZ_ARCHIVES_OUT' and a.stattag ='1' and a.wfisvisible ='1' and a.recordid =t.recordid )" +
" when (t.sendclass='QB')" +
" then (select count(*) from flow_idea a where tablename like 'YZ_ARCHIVES_SIGN' and a.stattag ='1' and a.wfisvisible ='1' and a.recordid =t.recordid )" +
" when (t.sendclass='HYJY')" +
" then (select count(*) from flow_idea a where tablename like 'YZ_ARCHIVES_SUMMARY' and a.stattag ='1' and a.wfisvisible ='1' and a.recordid =t.recordid )" +
" end as leaderInsNum" +
" from oa_db t where (userid='"+user.getUserId()+"' or userid='"+user.getHistoryId()+"')";
System.out.println("RemoteTodoHandler oracle "+sql);
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try{
conn = dataSource.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
getValue(conn,stmt,rs,ret);
}catch(Exception e){
e.printStackTrace();
}finally{
DynamicDataSourceContextHolder.clearDataSourceType();
}
return ret;
}
private static void getValue(Connection conn,Statement stmt,ResultSet rs,List<Todo> ret) throws Exception{
User user = ShiroUtils.getSysUser();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if(null != rs) {
while (rs.next()) {
Todo cur = new Todo();
String id = parseString(rs.getString("id"));
String title = parseString(rs.getString("title"));
String recordid = parseString(rs.getString("recordid"));
String url = parseString(rs.getString("url"));
String creTime = parseString(rs.getString("createtime"));
String deptid = parseString(rs.getString("deptid"));
String wflevename =parseString(rs.getString("wflevename"));
String filetypename = parseString(rs.getString("filetypename"));
String leaderInsNum = parseString(rs.getString("leaderInsNum"));
String typesort = parseString(rs.getString("typesort"));
String flowsort = parseString(rs.getString("flowsort"));
String flowsort2 = parseString(rs.getString("flowsort2"));
if(creTime.length()==10){
creTime += " 00:00:00";
}else if(creTime.length()==16){
creTime += ":00";
}else if(creTime.length()<10) {
creTime = format.format(new Date());
}
Date receivetime = format.parse(creTime);
String userid = parseString(rs.getString("userid"));
String fromusername = parseString(rs.getString("preusername"));
String hj = parseString(rs.getString("hj"));
String sendclass = parseString(rs.getString("sendclass"));
cur.setId(id);
cur.setTitle(title);
cur.setRecordId(recordid);
cur.setUrl(url);
//TODO: 因为redis从小到大排序,所以考虑是不是要把时间载戳变成负数
cur.setReceiveTime(0-receivetime.getTime());
cur.setDataSource(SOURCE);
cur.setFromUserName(fromusername);
cur.setFiletypename(filetypename);
cur.setWflevename(wflevename);
if(deptid!=null && !deptid.equals("")) {
cur.setDeptId(deptid);
}else {
cur.setDeptId(user.getDept().getHistoryId());
}
cur.setUrgency(hj);
cur.setSendclass(sendclass);
cur.setLeaderInsNum(leaderInsNum);
cur.setTypeSort(typesort);
cur.setFlowSort(flowsort);
cur.setFlowSort2(flowsort2);
ret.add(cur);
}
}
rs.close();
stmt.close();
conn.close();
DynamicDataSourceContextHolder.clearDataSourceType();
}
private static String parseString(Object obj) {
String ret = "";
if(obj != null)
ret = obj.toString();
return ret;
}
}
package com.sinobase.project.module.todo.model;
import java.io.Serializable;
public class Todo implements Serializable {
private String id; //数据ID
private String title; //待办标题
private String recordId; //业务ID
private long receiveTime; //待办接收到的时候,根据这个字段进行排序
private String url; //待办url
private String fromUserName; //上一办理人
private String dataSource; //数据来源
private String deptId;
private String urgency; //缓急
private String sendclass;
private String wflevename;
private String filetypename;
private String leaderInsNum; //领导批示数
private String typeSort; //类型
private String limitTime; //反馈结束时间
private String showLimitPNG; //显示反馈结束时间PNG图片
private String flowSort; //
private String flowSort2; //
public String getWflevename() {
return wflevename;
}
public void setWflevename(String wflevename) {
this.wflevename = wflevename;
}
public String getFiletypename() {
return filetypename;
}
public void setFiletypename(String filetypename) {
this.filetypename = filetypename;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public long getReceiveTime() {
return receiveTime;
}
public void setReceiveTime(long receiveTime) {
this.receiveTime = receiveTime;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getFromUserName() {
return fromUserName;
}
public void setFromUserName(String fromUserName) {
this.fromUserName = fromUserName;
}
public String getDataSource() {
return dataSource;
}
public void setDataSource(String dataSource) {
this.dataSource = dataSource;
}
public String getDeptId() {
return deptId;
}
public void setDeptId(String deptId) {
this.deptId = deptId;
}
public String getUrgency() {
return urgency;
}
public void setUrgency(String urgency) {
this.urgency = urgency;
}
public String getSendclass() {
return sendclass;
}
public void setSendclass(String sendclass) {
this.sendclass = sendclass;
}
public String getLeaderInsNum() {
return leaderInsNum;
}
public void setLeaderInsNum(String leaderInsNum) {
this.leaderInsNum = leaderInsNum;
}
public String getTypeSort() {
return typeSort;
}
public void setTypeSort(String typeSort) {
this.typeSort = typeSort;
}
public String getLimitTime() {
return limitTime;
}
public void setLimitTime(String limitTime) {
this.limitTime = limitTime;
}
public String getShowLimitPNG() {
return showLimitPNG;
}
public void setShowLimitPNG(String showLimitPNG) {
this.showLimitPNG = showLimitPNG;
}
public String getRecordId() {
return recordId;
}
public void setRecordId(String recordId) {
this.recordId = recordId;
}
public String getFlowSort() {
return flowSort;
}
public void setFlowSort(String flowSort) {
this.flowSort = flowSort;
}
public String getFlowSort2() {
return flowSort2;
}
public void setFlowSort2(String flowSort2) {
this.flowSort2 = flowSort2;
}
}
package com.sinobase.project.module.todo.service;
import com.sinobase.project.module.todo.model.Todo;
import java.util.List;
import java.util.Map;
public interface IProcessJumpService {
public int getCount(String isSelf, String title);
public List<Todo> getTodoList(int pageNumber, int countPerPage, String isSelf, String title);
public int getDoneCount(String isSelf, String title);
public List<Map<String, Object>> getDoneList(int pageNumber, int countPerPage,String isSelf,String title);
}
package com.sinobase.project.module.todo.service;
import com.sinobase.project.module.todo.model.Todo;
import java.util.List;
import java.util.Map;
public interface ITodoExtranetService {
public int getPageCount(int count);
public int getCount();
public List<Todo> getDoneList(int pageNumber, int countPerPage);
public Map<String, List<Todo>> getDoneList();
}
package com.sinobase.project.module.todo.service;
import com.sinobase.project.module.todo.model.Todo;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface ITodoService {
public int getPageCount(int count);
public int getCount();
public Set<Object> getDoneList(int pageNumber, int countPerPage);
public void refreshIndex(String userId);
public Map<String, List<Todo>> getDoneList();
}
package com.sinobase.project.module.todo.service;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.project.module.todo.dao.LocalTodoHandler;
import com.sinobase.project.module.todo.dao.ProcessJumpHandler;
import com.sinobase.project.module.todo.model.Todo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@Service
public class ProcessJumpServiceImpl implements IProcessJumpService {
@Autowired
private DruidDataSource dataSource;
@Override
public int getCount(String isSelf,String title) {
int count = 0;
try{
List<Todo> localTodoList = new ArrayList<>();
if(StringUtils.isNotEmpty(isSelf)&&isSelf.equals("all")){
localTodoList = ProcessJumpHandler.getTodo(dataSource,0,0,isSelf,title);
}else{
localTodoList = ProcessJumpHandler.getTodo(dataSource,0,0,"self",title);
}
count = localTodoList.size();
}catch(Exception e){
e.printStackTrace();
}
return count;
}
@Override
public List<Todo> getTodoList(int pageNumber, int countPerPage,String isSelf,String title) {
List<Todo> localTodoList = null;
try{
localTodoList = ProcessJumpHandler.getTodo(dataSource,pageNumber,countPerPage,isSelf,title);
}catch(Exception e){
e.printStackTrace();
}
return localTodoList;
}
@Override
public int getDoneCount(String isSelf,String title) {
int count = 0;
try{
List<Map<String, Object>> localTodoList = new ArrayList<>();
if(StringUtils.isNotEmpty(isSelf)&&isSelf.equals("all")){
localTodoList = ProcessJumpHandler.getDone(dataSource,0,0,isSelf,title);
}else{
localTodoList = ProcessJumpHandler.getDone(dataSource,0,0,"self",title);
}
count = localTodoList.size();
}catch(Exception e){
e.printStackTrace();
}
return count;
}
@Override
public List<Map<String, Object>> getDoneList(int pageNumber, int countPerPage,String isSelf,String title) {
List<Map<String, Object>> localTodoList = null;
try{
localTodoList = ProcessJumpHandler.getDone(dataSource,pageNumber,countPerPage,isSelf,title);
}catch(Exception e){
e.printStackTrace();
}
return localTodoList;
}
}
package com.sinobase.project.module.todo.service;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.project.module.todo.dao.LocalTodoHandler;
import com.sinobase.project.module.todo.model.Todo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
@Service
public class TodoExtranetServiceImpl implements ITodoExtranetService {
@Autowired
private DruidDataSource dataSource;
@Override
public int getPageCount(int count) {
int itemCount = getCount();
int pageCount = itemCount / count;
if(0 != itemCount % count) {
++ pageCount;
}
return pageCount;
}
@Override
public int getCount() {
int count = 0;
try{
List<Todo> localTodoList = LocalTodoHandler.getTodo(dataSource,0,0);
count = localTodoList.size();
}catch(Exception e){
e.printStackTrace();
}
return count;
}
@Override
public List<Todo> getDoneList(int pageNumber, int countPerPage) {
List<Todo> localTodoList = null;
try{
localTodoList = LocalTodoHandler.getTodo(dataSource,pageNumber,countPerPage);
}catch(Exception e){
e.printStackTrace();
}
return localTodoList;
}
public Map<String,List<Todo>> getDoneList(){
Set<String> keySet = new HashSet<String>();
Map<String,List<Todo>> map = new HashMap<String,List<Todo>>();
try{
List<Todo> localTodoList = LocalTodoHandler.getTodo(dataSource,0,0);
for(Todo todo : localTodoList){
if(StringUtils.isNotEmpty(todo.getSendclass())){
if(keySet.contains(todo.getSendclass())){
List<Todo> list = new ArrayList<Todo>();
list = map.get(todo.getSendclass());
list.add(todo);
map.put(todo.getSendclass(),list);
}else{
keySet.add(todo.getSendclass());
List<Todo> list = new ArrayList<Todo>();
list.add(todo);
map.put(todo.getSendclass(),list);
}
}
}
}catch(Exception e){
e.printStackTrace();
}
return map;
}
}
package com.sinobase.project.module.todo.service;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.DefaultTypedTuple;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ZSetOperations;
import org.springframework.stereotype.Service;
import com.alibaba.druid.pool.DruidDataSource;
import com.sinobase.common.utils.StringUtils;
import com.sinobase.common.utils.security.ShiroUtils;
import com.sinobase.project.module.homepage.service.IHomePageSerive;
import com.sinobase.project.module.todo.dao.LocalTodoHandler;
import com.sinobase.project.module.todo.dao.RemoteTodoHandler;
import com.sinobase.project.module.todo.model.Todo;
import com.sinobase.project.system.user.domain.User;
@Service
public class TodoServiceImpl implements ITodoService {
@Autowired
private RedisTemplate<Object, Object> redisTemplate;
private Map<String,Set<Object>> todoMap = new LinkedHashMap<>();
@Autowired
private IHomePageSerive homepageservice;
@Autowired
private DruidDataSource dataSource;
@Override
public int getPageCount(int count) {
int itemCount = getCount();
int pageCount = itemCount / count;
if(0 != itemCount % count) {
++ pageCount;
}
return pageCount;
}
@Override
public int getCount() {
User user = ShiroUtils.getSysUser();
String userId = user.getUserId();
int count = redisTemplate.opsForZSet().zCard("todo"+userId).intValue();
return count;
}
@Override
public Set<Object> getDoneList(int pageNumber, int countPerPage) {
User user = ShiroUtils.getSysUser();
String userId = user.getUserId();
int pageCount = getPageCount(countPerPage);
if(pageNumber > pageCount) { //如果要获取的页数大于实际页数
pageNumber = pageCount;
}
int start = (pageNumber - 1) * countPerPage;
int end = pageNumber * countPerPage - 1;
int maxIndex = getCount();
if(end > getCount()) {
end = maxIndex;
}
//获取临时存储的首页待办信息
Set<Object> ret = todoMap.get("sortedtodo"+userId);
//返回结果集
Set<Object> result = new LinkedHashSet<>();
//对工作通知进行处理
int num = 0;
if(ret!=null){
for(Object obj : ret){
if(num>=start&&num<=end){
Todo todo = (Todo) obj;
if(StringUtils.isNotEmpty(todo.getTypeSort())&&todo.getTypeSort().equals("worknotice")){
//通过ID获取通知信息,将反馈结束时间存入待办中
if(StringUtils.isNotEmpty(todo.getRecordId())){
Map<String,String> tongzhi = homepageservice.getTongZhiById(todo.getRecordId());
String limitTime = tongzhi.get("LIMIT_TIME");
if(StringUtils.isNotEmpty(limitTime)){
todo.setLimitTime(limitTime);
todo.setShowLimitPNG("true");
}else{
todo.setShowLimitPNG("false");
}
}
}
result.add(todo);
}
num++;
}
}
return result;
}
//从mysql和oracle中读取待办数(根据用户ID)并添加到redis中,
public void refreshIndex(String userId) {
try {
List<Todo> localTodoList = LocalTodoHandler.getTodo(dataSource,0,0);
List<Todo> remoteTodoList = RemoteTodoHandler.getTodo();
localTodoList.addAll(remoteTodoList);
setRedisData(userId, localTodoList);
} catch (SQLException e) {
e.printStackTrace();
}
}
//将待办数据更新到redis中
private void setRedisData(String userId, List<Todo> todoList) {
redisTemplate.opsForZSet().removeRange("todo"+userId, 0, redisTemplate.opsForZSet().size("todo"+userId));
redisTemplate.opsForZSet().removeRange("sortedtodo"+userId, 0, redisTemplate.opsForZSet().size("sortedtodo"+userId));
/*for(Todo todo : todoList) {
redisTemplate.opsForZSet().add("todo"+userId, todo, todo.getReceiveTime());
}*/
Set<ZSetOperations.TypedTuple<Object>> tuples = new HashSet<ZSetOperations.TypedTuple<Object>>();
for(Todo todo : todoList) {
ZSetOperations.TypedTuple<Object> curTuple = new DefaultTypedTuple(todo, (double)todo.getReceiveTime());
tuples.add(curTuple);
}
if(tuples.size()>0){
redisTemplate.opsForZSet().add("todo" + userId, tuples);
}
//获取redis中所有待办
Set<Object> retAll = redisTemplate.opsForZSet().range("todo"+userId, 0, redisTemplate.opsForZSet().size("todo"+userId));
//急文集合
Set<Object> urgencySet = new LinkedHashSet<>();
//其他集合
Set<Object> othersSet = new LinkedHashSet<>();
//遍历获取所有急文
for(Object obj : retAll){
Todo todo = (Todo) obj;
ZSetOperations.TypedTuple<Object> curTuple = new DefaultTypedTuple(todo, (double)todo.getReceiveTime());
if(StringUtils.isNotEmpty(todo.getUrgency())&&(todo.getUrgency().equals("特急")||todo.getUrgency().equals("加急")||todo.getUrgency().equals("是"))){
urgencySet.add(obj);
}else{
othersSet.add(obj);
}
}
urgencySet.addAll(othersSet);
if(urgencySet.size()>0){
todoMap.put("sortedtodo"+userId,urgencySet);
}
}
public Map<String,List<Todo>> getDoneList(){
User user = ShiroUtils.getSysUser();
String userId = user.getUserId();
Set<String> keySet = new HashSet<String>();
Map<String,List<Todo>> map = new HashMap<String,List<Todo>>();
Set<Object> ret = redisTemplate.opsForZSet().range("todo"+userId, 0, redisTemplate.opsForZSet().size("todo"+userId));
for(Object obj : ret){
Todo todo = (Todo) obj;
//将待办数据根据流程类型sendclass进行分类
if(StringUtils.isNotEmpty(todo.getSendclass())){
if(keySet.contains(todo.getSendclass())){
List<Todo> list = new ArrayList<Todo>();
list = map.get(todo.getSendclass());
list.add(todo);
map.put(todo.getSendclass(),list);
}else{
keySet.add(todo.getSendclass());
List<Todo> list = new ArrayList<Todo>();
list.add(todo);
map.put(todo.getSendclass(),list);
}
}
}
return map;
}
}
package com.sinobase.project.system.menu.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
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.config.SinoBaseConfig;
import com.sinobase.framework.web.controller.BaseController;
import com.sinobase.framework.web.domain.AjaxResult;
import com.sinobase.project.system.menu.domain.Menu;
import com.sinobase.project.system.menu.service.IMenuService;
import com.sinobase.project.system.role.domain.Role;
import com.sinobase.project.system.sino.service.PlatformService;
import com.sinobase.project.system.user.domain.User;
/**
* 菜单信息
*
* @author sinobase
*/
@Controller
@RequestMapping("/system/menu")
public class MenuController extends BaseController {
private String prefix = "system/menu";
@Autowired
private IMenuService menuService;
@Autowired
private PlatformService platformService;
@RequiresPermissions("system:menu:view")
@GetMapping()
public String menu() {
return prefix + "/menu";
}
/**
* 标签页面解析服务
* @param menuId 上组节点ID
* @return
*/
@GetMapping("/tab/{parentId}")
@ResponseBody
public List<Menu> tab(@PathVariable("parentId") String parentId) {
List<Menu> list = new ArrayList<Menu>();
User user = ShiroUtils.getSysUser();
if (SinoBaseConfig.isPlatform()) {
list = platformService.getTabs(user.getMenus(), parentId);
} else {
list = menuService.selectMenusByUser(user, Menu.TYPE_TAB, parentId);
}
return list;
}
@RequiresPermissions("system:menu:list")
@GetMapping("/list")
@ResponseBody
public List<Menu> list(Menu menu) {
List<Menu> menuList = menuService.selectMenuList(menu);
return menuList;
}
/**
* 删除菜单
*/
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
@RequiresPermissions("system:menu:remove")
@PostMapping("/remove/{menuId}")
@ResponseBody
public AjaxResult remove(@PathVariable("menuId") String menuId) {
if (menuService.selectCountMenuByParentId(menuId) > 0) {
return error(1, "存在子菜单,不允许删除");
}
if (menuService.selectCountRoleMenuByMenuId(menuId) > 0) {
return error(1, "菜单已分配,不允许删除");
}
return toAjax(menuService.deleteMenuById(menuId));
}
/**
* 新增
*/
@GetMapping("/add/{parentId}")
public String add(@PathVariable("parentId") String parentId, ModelMap mmap) {
Menu menu = null;
if (!parentId.equals("0".toString())) {
menu = menuService.selectMenuById(parentId);
} else {
menu = new Menu();
menu.setMenuId("0");
menu.setMenuName("主目录");
}
mmap.put("menu", menu);
return prefix + "/add";
}
/**
* 新增保存菜单
*/
@Log(title = "菜单管理", businessType = BusinessType.INSERT)
@RequiresPermissions("system:menu:add")
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(Menu menu) {
return toAjax(menuService.insertMenu(menu));
}
/**
* 修改菜单
*/
@GetMapping("/edit/{menuId}")
public String edit(@PathVariable("menuId") String menuId, ModelMap mmap) {
mmap.put("menu", menuService.selectMenuById(menuId));
return prefix + "/edit";
}
/**
* 修改保存菜单
*/
@Log(title = "菜单管理", businessType = BusinessType.UPDATE)
@RequiresPermissions("system:menu:edit")
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(Menu menu) {
return toAjax(menuService.updateMenu(menu));
}
/**
* 选择菜单图标
*/
@GetMapping("/icon")
public String icon() {
return prefix + "/icon";
}
/**
* 校验菜单名称
*/
@PostMapping("/checkMenuNameUnique")
@ResponseBody
public String checkMenuNameUnique(Menu menu) {
return menuService.checkMenuNameUnique(menu);
}
/**
* 加载角色菜单列表树
*/
@GetMapping("/roleMenuTreeData")
@ResponseBody
public List<Map<String, Object>> roleMenuTreeData(Role role) {
List<Map<String, Object>> tree = menuService.roleMenuTreeData(role);
return tree;
}
/**
* 加载所有菜单列表树
*/
@GetMapping("/menuTreeData")
@ResponseBody
public List<Map<String, Object>> menuTreeData(Role role) {
List<Map<String, Object>> tree = menuService.menuTreeData();
return tree;
}
/**
* 选择菜单树
*/
@GetMapping("/selectMenuTree/{menuId}")
public String selectMenuTree(@PathVariable("menuId") String menuId, ModelMap mmap) {
mmap.put("menu", menuService.selectMenuById(menuId));
return prefix + "/tree";
}
}
\ No newline at end of file
......@@ -151,6 +151,20 @@ public class PlatformService {
}
/**
* 设置用户登录后的相关信息
*
* @param loginName
* @return
*/
public User setLoginUserInfo(String loginName) {
User user = getUserByLoginname(loginName);
// 设置用户资源菜单 和 标签页面
user.setMenus(getResourceList(user.getUserId() + "",user.getDept().getParentId(),user));
return user;
}
/**
* 获取用户所有资源目录和标签
*
* @param userID 登录后的用户ID
......
spring:
redis:
host: 152.136.74.6
host: 172.30.13.53
port: 6379
password: bug48625
#连接超时时间(毫秒)
timeout: 2000
password:
pool:
#最大连接数(负数表示没有限制)
max-active: 1000
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sinobase.project.module.homepage.mapper.HomePageMapper">
<!--通过ID获取公文详情信息 -->
<select id="getTongZhiById" resultType="java.util.HashMap"
parameterType="String">
select * from yz_tongzhi_info where id=#{recordid}
</select>
</mapper>
\ No newline at end of file
/**
* @name jQuery FullScreen Plugin
* @author Martin Angelov, Morten Sjøgren
* @version 1.2
* @url http://tutorialzine.com/2012/02/enhance-your-website-fullscreen-api/
* @license MIT License
*/
/*jshint browser: true, jquery: true */
(function($){
"use strict";
// These helper functions available only to our plugin scope.
function supportFullScreen(){
var doc = document.documentElement;
return ('requestFullscreen' in doc) ||
('mozRequestFullScreen' in doc && document.mozFullScreenEnabled) ||
('webkitRequestFullScreen' in doc);
}
function requestFullScreen(elem){
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullScreen) {
elem.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
}
}
function fullScreenStatus(){
return document.fullscreen ||
document.mozFullScreen ||
document.webkitIsFullScreen ||
false;
}
function cancelFullScreen(){
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen();
}
}
function onFullScreenEvent(callback){
$(document).on("fullscreenchange mozfullscreenchange webkitfullscreenchange", function(){
// The full screen status is automatically
// passed to our callback as an argument.
callback(fullScreenStatus());
});
}
// Adding a new test to the jQuery support object
$.support.fullscreen = supportFullScreen();
// Creating the plugin
$.fn.fullScreen = function(props){
if(!$.support.fullscreen || this.length !== 1) {
// The plugin can be called only
// on one element at a time
return this;
}
if(fullScreenStatus()){
// if we are already in fullscreen, exit
cancelFullScreen();
return this;
}
// You can potentially pas two arguments a color
// for the background and a callback function
var options = $.extend({
'background' : '#111',
'callback' : $.noop( ),
'fullscreenClass' : 'fullScreen'
}, props),
elem = this,
// This temporary div is the element that is
// actually going to be enlarged in full screen
fs = $('<div>', {
'css' : {
'overflow-y' : 'auto',
'background' : options.background,
'width' : '100%',
'height' : '100%'
}
})
.insertBefore(elem)
.append(elem);
// You can use the .fullScreen class to
// apply styling to your element
elem.addClass( options.fullscreenClass );
// Inserting our element in the temporary
// div, after which we zoom it in fullscreen
requestFullScreen(fs.get(0));
fs.click(function(e){
if(e.target == this){
// If the black bar was clicked
cancelFullScreen();
}
});
elem.cancel = function(){
cancelFullScreen();
return elem;
};
onFullScreenEvent(function(fullScreen){
if(!fullScreen){
// We have exited full screen.
// Detach event listener
$(document).off( 'fullscreenchange mozfullscreenchange webkitfullscreenchange' );
// Remove the class and destroy
// the temporary div
elem.removeClass( options.fullscreenClass ).insertBefore(fs);
fs.remove();
}
// Calling the facultative user supplied callback
if(options.callback) {
options.callback(fullScreen);
}
});
return elem;
};
$.fn.cancelFullScreen = function( ) {
cancelFullScreen();
return this;
};
}(jQuery));
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
.toast-title {
font-weight: 700
}
.toast-message {
-ms-word-wrap: break-word;
word-wrap: break-word
}
.toast-message a, .toast-message label {
color: #fff
}
.toast-message a:hover {
color: #ccc;
text-decoration: none
}
.toast-close-button {
position: relative;
right: -.3em;
top: -.3em;
float: right;
font-size: 20px;
font-weight: 700;
color: #fff;
-webkit-text-shadow: 0 1px 0 #fff;
text-shadow: 0 1px 0 #fff;
opacity: .8;
-ms-filter: alpha(Opacity=80);
filter: alpha(opacity=80)
}
.toast-close-button:focus, .toast-close-button:hover {
color: #000;
text-decoration: none;
cursor: pointer;
opacity: .4;
-ms-filter: alpha(Opacity=40);
filter: alpha(opacity=40)
}
button.toast-close-button {
padding: 0;
cursor: pointer;
background: 0 0;
border: 0;
-webkit-appearance: none
}
.toast-top-center {
top: 0;
right: 0;
width: 100%
}
.toast-bottom-center {
bottom: 0;
right: 0;
width: 100%
}
.toast-top-full-width {
top: 0;
right: 0;
width: 100%
}
.toast-bottom-full-width {
bottom: 0;
right: 0;
width: 100%
}
.toast-top-left {
top: 12px;
left: 12px
}
.toast-top-right {
top: 12px;
right: 12px
}
.toast-bottom-right {
right: 12px;
bottom: 12px
}
.toast-bottom-left {
bottom: 12px;
left: 12px
}
#toast-container {
position: fixed;
z-index: 999999
}
#toast-container * {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box
}
#toast-container > div {
position: relative;
overflow: hidden;
margin: 0 0 6px;
padding: 15px 15px 15px 50px;
width: 300px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
background-position: 15px center;
background-repeat: no-repeat;
-moz-box-shadow: 0 0 12px #999;
-webkit-box-shadow: 0 0 12px #999;
box-shadow: 0 0 12px #999;
color: #fff;
opacity: .8;
-ms-filter: alpha(Opacity=80);
filter: alpha(opacity=80)
}
#toast-container > :hover {
-moz-box-shadow: 0 0 12px #000;
-webkit-box-shadow: 0 0 12px #000;
box-shadow: 0 0 12px #000;
opacity: 1;
-ms-filter: alpha(Opacity=100);
filter: alpha(opacity=100);
cursor: pointer
}
#toast-container > .toast-info {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGwSURBVEhLtZa9SgNBEMc9sUxxRcoUKSzSWIhXpFMhhYWFhaBg4yPYiWCXZxBLERsLRS3EQkEfwCKdjWJAwSKCgoKCcudv4O5YLrt7EzgXhiU3/4+b2ckmwVjJSpKkQ6wAi4gwhT+z3wRBcEz0yjSseUTrcRyfsHsXmD0AmbHOC9Ii8VImnuXBPglHpQ5wwSVM7sNnTG7Za4JwDdCjxyAiH3nyA2mtaTJufiDZ5dCaqlItILh1NHatfN5skvjx9Z38m69CgzuXmZgVrPIGE763Jx9qKsRozWYw6xOHdER+nn2KkO+Bb+UV5CBN6WC6QtBgbRVozrahAbmm6HtUsgtPC19tFdxXZYBOfkbmFJ1VaHA1VAHjd0pp70oTZzvR+EVrx2Ygfdsq6eu55BHYR8hlcki+n+kERUFG8BrA0BwjeAv2M8WLQBtcy+SD6fNsmnB3AlBLrgTtVW1c2QN4bVWLATaIS60J2Du5y1TiJgjSBvFVZgTmwCU+dAZFoPxGEEs8nyHC9Bwe2GvEJv2WXZb0vjdyFT4Cxk3e/kIqlOGoVLwwPevpYHT+00T+hWwXDf4AJAOUqWcDhbwAAAAASUVORK5CYII=) !important
}
#toast-container > .toast-error {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHOSURBVEhLrZa/SgNBEMZzh0WKCClSCKaIYOED+AAKeQQLG8HWztLCImBrYadgIdY+gIKNYkBFSwu7CAoqCgkkoGBI/E28PdbLZmeDLgzZzcx83/zZ2SSXC1j9fr+I1Hq93g2yxH4iwM1vkoBWAdxCmpzTxfkN2RcyZNaHFIkSo10+8kgxkXIURV5HGxTmFuc75B2RfQkpxHG8aAgaAFa0tAHqYFfQ7Iwe2yhODk8+J4C7yAoRTWI3w/4klGRgR4lO7Rpn9+gvMyWp+uxFh8+H+ARlgN1nJuJuQAYvNkEnwGFck18Er4q3egEc/oO+mhLdKgRyhdNFiacC0rlOCbhNVz4H9FnAYgDBvU3QIioZlJFLJtsoHYRDfiZoUyIxqCtRpVlANq0EU4dApjrtgezPFad5S19Wgjkc0hNVnuF4HjVA6C7QrSIbylB+oZe3aHgBsqlNqKYH48jXyJKMuAbiyVJ8KzaB3eRc0pg9VwQ4niFryI68qiOi3AbjwdsfnAtk0bCjTLJKr6mrD9g8iq/S/B81hguOMlQTnVyG40wAcjnmgsCNESDrjme7wfftP4P7SP4N3CJZdvzoNyGq2c/HWOXJGsvVg+RA/k2MC/wN6I2YA2Pt8GkAAAAASUVORK5CYII=) !important
}
#toast-container > .toast-success {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADsSURBVEhLY2AYBfQMgf///3P8+/evAIgvA/FsIF+BavYDDWMBGroaSMMBiE8VC7AZDrIFaMFnii3AZTjUgsUUWUDA8OdAH6iQbQEhw4HyGsPEcKBXBIC4ARhex4G4BsjmweU1soIFaGg/WtoFZRIZdEvIMhxkCCjXIVsATV6gFGACs4Rsw0EGgIIH3QJYJgHSARQZDrWAB+jawzgs+Q2UO49D7jnRSRGoEFRILcdmEMWGI0cm0JJ2QpYA1RDvcmzJEWhABhD/pqrL0S0CWuABKgnRki9lLseS7g2AlqwHWQSKH4oKLrILpRGhEQCw2LiRUIa4lwAAAABJRU5ErkJggg==) !important
}
#toast-container > .toast-warning {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGYSURBVEhL5ZSvTsNQFMbXZGICMYGYmJhAQIJAICYQPAACiSDB8AiICQQJT4CqQEwgJvYASAQCiZiYmJhAIBATCARJy+9rTsldd8sKu1M0+dLb057v6/lbq/2rK0mS/TRNj9cWNAKPYIJII7gIxCcQ51cvqID+GIEX8ASG4B1bK5gIZFeQfoJdEXOfgX4QAQg7kH2A65yQ87lyxb27sggkAzAuFhbbg1K2kgCkB1bVwyIR9m2L7PRPIhDUIXgGtyKw575yz3lTNs6X4JXnjV+LKM/m3MydnTbtOKIjtz6VhCBq4vSm3ncdrD2lk0VgUXSVKjVDJXJzijW1RQdsU7F77He8u68koNZTz8Oz5yGa6J3H3lZ0xYgXBK2QymlWWA+RWnYhskLBv2vmE+hBMCtbA7KX5drWyRT/2JsqZ2IvfB9Y4bWDNMFbJRFmC9E74SoS0CqulwjkC0+5bpcV1CZ8NMej4pjy0U+doDQsGyo1hzVJttIjhQ7GnBtRFN1UarUlH8F3xict+HY07rEzoUGPlWcjRFRr4/gChZgc3ZL2d8oAAAAASUVORK5CYII=) !important
}
#toast-container.toast-bottom-center > div, #toast-container.toast-top-center > div {
width: 300px;
margin: auto
}
#toast-container.toast-bottom-full-width > div, #toast-container.toast-top-full-width > div {
width: 96%;
margin: auto
}
.toast {
background-color: #030303
}
.toast-success {
background-color: #51a351
}
.toast-error {
background-color: #bd362f
}
.toast-info {
background-color: #2f96b4
}
.toast-warning {
background-color: #f89406
}
.toast-progress {
position: absolute;
left: 0;
bottom: 0;
height: 4px;
background-color: #000;
opacity: .4;
-ms-filter: alpha(Opacity=40);
filter: alpha(opacity=40)
}
@media all and (max-width: 240px) {
#toast-container > div {
padding: 8px 8px 8px 50px;
width: 11em
}
#toast-container .toast-close-button {
right: -.2em;
top: -.2em
}
}
@media all and (min-width: 241px) and (max-width: 480px) {
#toast-container > div {
padding: 8px 8px 8px 50px;
width: 18em
}
#toast-container .toast-close-button {
right: -.2em;
top: -.2em
}
}
@media all and (min-width: 481px) and (max-width: 768px) {
#toast-container > div {
padding: 15px 15px 15px 50px;
width: 25em
}
}
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
No preview for this file type
No preview for this file type
/*! layer弹层组件拓展类 */
;!function(){layer.use("skin/layer.ext.css",function(){layer.layui_layer_extendlayerextjs=!0});var a=layer.cache||{},b=function(b){return a.skin?" "+a.skin+" "+a.skin+"-"+b:""};layer.prompt=function(a,c){a=a||{},"function"==typeof a&&(c=a);var d,e=2==a.formType?'<textarea class="layui-layer-input">'+(a.value||"")+"</textarea>":function(){return'<input type="'+(1==a.formType?"password":"text")+'" class="layui-layer-input" value="'+(a.value||"")+'">'}();return layer.open($.extend({btn:["&#x786E;&#x5B9A;","&#x53D6;&#x6D88;"],content:e,skin:"layui-layer-prompt"+b("prompt"),success:function(a){d=a.find(".layui-layer-input"),d.focus()},yes:function(b){var e=d.val();""===e?d.focus():e.length>(a.maxlength||500)?layer.tips("&#x6700;&#x591A;&#x8F93;&#x5165;"+(a.maxlength||500)+"&#x4E2A;&#x5B57;&#x6570;",d,{tips:1}):c&&c(e,b,d)}},a))},layer.tab=function(a){a=a||{};var c=a.tab||{};return layer.open($.extend({type:1,skin:"layui-layer-tab"+b("tab"),title:function(){var a=c.length,b=1,d="";if(a>0)for(d='<span class="layui-layer-tabnow">'+c[0].title+"</span>";a>b;b++)d+="<span>"+c[b].title+"</span>";return d}(),content:'<ul class="layui-layer-tabmain">'+function(){var a=c.length,b=1,d="";if(a>0)for(d='<li class="layui-layer-tabli xubox_tab_layer">'+(c[0].content||"no content")+"</li>";a>b;b++)d+='<li class="layui-layer-tabli">'+(c[b].content||"no content")+"</li>";return d}()+"</ul>",success:function(a){var b=a.find(".layui-layer-title").children(),c=a.find(".layui-layer-tabmain").children();b.on("mousedown",function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;var b=$(this),d=b.index();b.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),c.eq(d).show().siblings().hide()})}},a))},layer.photos=function(a,c,d){function e(a,b,c){var d=new Image;d.onload=function(){d.onload=null,b(d)},d.onerror=function(a){d.onerror=null,c(a)},d.src=a}var f={};if(a=a||{},a.photos){var g=a.photos.constructor===Object,h=g?a.photos:{},i=h.data||[],j=h.start||0;if(f.imgIndex=j+1,g){if(0===i.length)return void layer.msg("&#x6CA1;&#x6709;&#x56FE;&#x7247;")}else{var k=$(a.photos),l=k.find(a.img||"img");if(0===l.length)return;if(c||k.find(h.img||"img").each(function(b){var c=$(this);i.push({alt:c.attr("alt"),pid:c.attr("layer-pid"),src:c.attr("layer-src")||c.attr("src"),thumb:c.attr("src")}),c.on("click",function(){layer.photos($.extend(a,{photos:{start:b,data:i,tab:a.tab},full:a.full}),!0)})}),!c)return}f.imgprev=function(a){f.imgIndex--,f.imgIndex<1&&(f.imgIndex=i.length),f.tabimg(a)},f.imgnext=function(a,b){f.imgIndex++,f.imgIndex>i.length&&(f.imgIndex=1,b)||f.tabimg(a)},f.keyup=function(a){if(!f.end){var b=a.keyCode;a.preventDefault(),37===b?f.imgprev(!0):39===b?f.imgnext(!0):27===b&&layer.close(f.index)}},f.tabimg=function(b){i.length<=1||(h.start=f.imgIndex-1,layer.close(f.index),layer.photos(a,!0,b))},f.event=function(){f.bigimg.hover(function(){f.imgsee.show()},function(){f.imgsee.hide()}),f.bigimg.find(".layui-layer-imgprev").on("click",function(a){a.preventDefault(),f.imgprev()}),f.bigimg.find(".layui-layer-imgnext").on("click",function(a){a.preventDefault(),f.imgnext()}),$(document).on("keyup",f.keyup)},f.loadi=layer.load(1,{shade:"shade"in a?!1:.9,scrollbar:!1}),e(i[j].src,function(c){layer.close(f.loadi),f.index=layer.open($.extend({type:1,area:function(){var b=[c.width,c.height],d=[$(window).width()-100,$(window).height()-100];return!a.full&&b[0]>d[0]&&(b[0]=d[0],b[1]=b[0]*d[1]/b[0]),[b[0]+"px",b[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,shift:5*Math.random()|0,skin:"layui-layer-photos"+b("photos"),content:'<div class="layui-layer-phimg"><img src="'+i[j].src+'" alt="'+(i[j].alt||"")+'" layer-pid="'+i[j].pid+'"><div class="layui-layer-imgsee">'+(i.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(d?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(i[j].alt||"")+"</a><em>"+f.imgIndex+"/"+i.length+"</em></span></div></div></div>",success:function(b,c){f.bigimg=b.find(".layui-layer-phimg"),f.imgsee=b.find(".layui-layer-imguide,.layui-layer-imgbar"),f.event(b),a.tab&&a.tab(i[j],b)},end:function(){f.end=!0,$(document).off("keyup",f.keyup)}},a))},function(){layer.close(f.loadi),layer.msg("&#x5F53;&#x524D;&#x56FE;&#x7247;&#x5730;&#x5740;&#x5F02;&#x5E38;<br>&#x662F;&#x5426;&#x7EE7;&#x7EED;&#x67E5;&#x770B;&#x4E0B;&#x4E00;&#x5F20;&#xFF1F;",{time:3e4,btn:["下一张","不看了"],yes:function(){i.length>1&&f.imgnext(!0,!0)}})})}}}();
/**
@Name: laydate 核心样式
@Author:贤心
@Site:http://sentsin.com/layui/laydate
**/
html{_background-image:url(about:blank); _background-attachment:fixed;}
.layer-date{display: inline-block!important;vertical-align:text-top;max-width:240px;}
.laydate_body .laydate_box, .laydate_body .laydate_box *{margin:0; padding:0;}
.laydate-icon,
.laydate-icon-default,
.laydate-icon-danlan,
.laydate-icon-dahong,
.laydate-icon-molv{height:34px; padding-right:20px;min-width:34px;vertical-align: text-top;border:1px solid #C6C6C6; background-repeat:no-repeat; background-position:right center; background-color:#fff; outline:0;}
.laydate-icon-default{ background-image:url(../skins/default/icon.png)}
.laydate-icon-danlan{border:1px solid #B1D2EC; background-image:url(../skins/danlan/icon.png)}
.laydate-icon-dahong{background-image:url(../skins/dahong/icon.png)}
.laydate-icon-molv{background-image:url(../skins/molv/icon.png)}
.laydate_body .laydate_box{width:240px; font:12px '\5B8B\4F53'; z-index:99999999; *margin:-2px 0 0 -2px; *overflow:hidden; _margin:0; _position:absolute!important; background-color:#fff;}
.laydate_body .laydate_box li{list-style:none;}
.laydate_body .laydate_box .laydate_void{cursor:text!important;}
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{text-decoration:none; blr:expression(this.onFocus=this.blur()); cursor:pointer;}
.laydate_body .laydate_box a:hover{text-decoration:none;}
.laydate_body .laydate_box cite, .laydate_body .laydate_box label{position:absolute; width:0; height:0; border-width:5px; border-style:dashed; border-color:transparent; overflow:hidden; cursor:pointer;}
.laydate_body .laydate_box .laydate_yms, .laydate_body .laydate_box .laydate_time{display:none;}
.laydate_body .laydate_box .laydate_show{display:block;}
.laydate_body .laydate_box input{outline:0; font-size:14px; background-color:#fff;}
.laydate_body .laydate_top{position:relative; height:26px; padding:5px; *width:100%; z-index:99;}
.laydate_body .laydate_ym{position:relative; float:left; height:24px; cursor:pointer;}
.laydate_body .laydate_ym input{float:left; height:24px; line-height:24px; text-align:center; border:none; cursor:pointer;}
.laydate_body .laydate_ym .laydate_yms{position:absolute; left: -1px; top: 24px; height:181px;}
.laydate_body .laydate_y{width:121px;}
.laydate_body .laydate_y input{width:64px; margin-right:15px;}
.laydate_body .laydate_y .laydate_yms{width:121px; text-align:center;}
.laydate_body .laydate_y .laydate_yms a{position:relative; display:block; height:20px;}
.laydate_body .laydate_y .laydate_yms ul{height:139px; padding:0; *overflow:hidden;}
.laydate_body .laydate_y .laydate_yms ul li{float:left; width:60px; height:20px; line-height: 20px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
.laydate_box *{box-sizing:content-box!important;}
.laydate_body .laydate_m{width:99px;float: right;margin-right:-2px;}
.laydate_body .laydate_m .laydate_yms{width:99px; padding:0;}
.laydate_body .laydate_m input{width:42px; margin-right:15px;}
.laydate_body .laydate_m .laydate_yms span{display:block; float:left; width:42px; margin: 5px 0 0 5px; line-height:24px; text-align:center; _display:inline;}
.laydate_body .laydate_choose{display:block; float:left; position:relative; width:20px; height:24px;}
.laydate_body .laydate_choose cite, .laydate_body .laydate_tab cite{left:50%; top:50%;}
.laydate_body .laydate_chtop cite{margin:-7px 0 0 -5px; border-bottom-style:solid;}
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{top:50%; margin:-2px 0 0 -5px; border-top-style:solid;}
.laydate_body .laydate_chprev cite{margin:-5px 0 0 -7px;}
.laydate_body .laydate_chnext cite{margin:-5px 0 0 -2px;}
.laydate_body .laydate_ym label{right:28px;}
.laydate_body .laydate_table{ width:230px; margin:0 5px; border-collapse:collapse; border-spacing:0px; }
.laydate_body .laydate_table td{width:31px; height:19px; line-height:19px; text-align: center; cursor:pointer; font-size: 12px;}
.laydate_body .laydate_table thead{height:22px; line-height:22px;}
.laydate_body .laydate_table thead th{font-weight:400; font-size:12px; text-align:center;}
.laydate_body .laydate_bottom{position:relative; height:22px; line-height:20px; padding:5px; font-size:12px;}
.laydate_body .laydate_bottom #laydate_hms{position: relative; z-index: 1; float:left; }
.laydate_body .laydate_time{ position:absolute; left:5px; bottom: 26px; width:129px; height:125px; *overflow:hidden;}
.laydate_body .laydate_time .laydate_hmsno{ padding:5px 0 0 5px;}
.laydate_body .laydate_time .laydate_hmsno span{display:block; float:left; width:24px; height:19px; line-height:19px; text-align:center; cursor:pointer; *margin-bottom:-5px;}
.laydate_body .laydate_time1{width:228px; height:154px;}
.laydate_body .laydate_time1 .laydate_hmsno{padding: 6px 0 0 8px;}
.laydate_body .laydate_time1 .laydate_hmsno span{width:21px; height:20px; line-height:20px;}
.laydate_body .laydate_msg{left:49px; bottom:67px; width:141px; height:auto; overflow: hidden;}
.laydate_body .laydate_msg p{padding:5px 10px;}
.laydate_body .laydate_bottom li{float:left; height:20px; line-height:20px; border-right:none; font-weight:900;}
.laydate_body .laydate_bottom .laydate_sj{width:33px; text-align:center; font-weight:400;}
.laydate_body .laydate_bottom input{float:left; width:21px; height:20px; line-height:20px; border:none; text-align:center; cursor:pointer; font-size:12px; font-weight:400;}
.laydate_body .laydate_bottom .laydte_hsmtex{height:20px; line-height:20px; text-align:center;}
.laydate_body .laydate_bottom .laydte_hsmtex span{position:absolute; width:20px; top:0; right:0px; cursor:pointer;}
.laydate_body .laydate_bottom .laydte_hsmtex span:hover{font-size:14px;}
.laydate_body .laydate_bottom .laydate_btn{position:absolute; right:5px; top:5px;}
.laydate_body .laydate_bottom .laydate_btn a{float:left; height:20px; padding:0 6px; _padding:0 5px;}
.laydate_body .laydate_bottom .laydate_v{position:absolute; left:10px; top:6px; font-family:Courier; z-index:0;}
/**
@Name: laydate皮肤:墨绿
@Author:贤心
@Site:http://sentsin.com/layui/laydate
**/
.laydate-icon{border:1px solid #ccc; background-image:url(icon.png)}
.laydate_body .laydate_bottom #laydate_hms,
.laydate_body .laydate_time{border:1px solid #ccc;}
.laydate_body .laydate_box,
.laydate_body .laydate_ym .laydate_yms,
.laydate_body .laydate_time{box-shadow: 2px 2px 5px rgba(0,0,0,.1);}
.laydate_body .laydate_box{border-top:none; border-bottom:none; background-color:#fff; color:#00625A;}
.laydate_body .laydate_box input{background:none!important; color:#fff;}
.laydate_body .laydate_box .laydate_void{color:#00E8D7!important;}
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{color:#00625A;}
.laydate_body .laydate_box a:hover{color:#666;}
.laydate_body .laydate_click{background-color:#009F95!important; color:#fff!important;}
.laydate_body .laydate_top{border-top:1px solid #009F95; background-color:#009F95}
.laydate_body .laydate_ym{border:1px solid #009F95; background-color:#009F95;}
.laydate_body .laydate_ym .laydate_yms{border:1px solid #009F95; background-color:#009F95; color:#fff;}
.laydate_body .laydate_y .laydate_yms a{border-bottom:1px solid #009F95;}
.laydate_body .laydate_y .laydate_yms .laydate_chdown{border-top:1px solid #009F95; border-bottom:none;}
.laydate_body .laydate_choose{border-left:1px solid #009F95;}
.laydate_body .laydate_chprev{border-left:none; border-right:1px solid #009F95;}
.laydate_body .laydate_choose:hover,
.laydate_body .laydate_y .laydate_yms a:hover{background-color:#00C1B3;}
.laydate_body .laydate_chtop cite{border-bottom-color:#fff;}
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{border-top-color:#fff;}
.laydate_body .laydate_chprev cite{border-right-style:solid; border-right-color:#fff;}
.laydate_body .laydate_chnext cite{border-left-style:solid; border-left-color:#fff;}
.laydate_body .laydate_table{width: 240px!important; margin: 0!important; border:1px solid #ccc; border-top:none; border-bottom:none;}
.laydate_body .laydate_table td{border:none; height:21px!important; line-height:21px!important; background-color:#fff; color:#00625A;}
.laydate_body .laydate_table .laydate_nothis{color:#999;}
.laydate_body .laydate_table thead{border-bottom:1px solid #ccc; height:21px!important; line-height:21px!important;}
.laydate_body .laydate_table thead th{}
.laydate_body .laydate_bottom{border:1px solid #ccc; border-top:none;}
.laydate_body .laydate_bottom #laydate_hms{background-color:#fff;}
.laydate_body .laydate_time{background-color:#fff;}
.laydate_body .laydate_time1{width: 226px!important; height: 152px!important;}
.laydate_body .laydate_bottom .laydate_sj{width:31px!important; border-right:1px solid #ccc; background-color:#fff;}
.laydate_body .laydate_bottom input{background-color:#fff; color:#00625A;}
.laydate_body .laydate_bottom .laydte_hsmtex{border-bottom:1px solid #ccc;}
.laydate_body .laydate_bottom .laydate_btn{border-right:1px solid #ccc;}
.laydate_body .laydate_bottom .laydate_v{color:#999}
.laydate_body .laydate_bottom .laydate_btn a{border: 1px solid #ccc; border-right:none; background-color:#fff;}
.laydate_body .laydate_bottom .laydate_btn a:hover{background-color:#F6F6F6; color:#00625A;}
.laydate_body .laydate_m .laydate_yms span:hover,
.laydate_body .laydate_time .laydate_hmsno span:hover,
.laydate_body .laydate_y .laydate_yms ul li:hover,
.laydate_body .laydate_table td:hover{background-color:#00C1B3; color:#fff;}
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<!--
2013-9-30: Created.
-->
<svg>
<metadata>
Created by iconfont
</metadata>
<defs>
<font id="laydate-icon" horiz-adv-x="1024" >
<font-face
font-family="laydate-icon"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
ascent="896"
descent="-128"
/>
<missing-glyph />
<glyph glyph-name="x" unicode="x" horiz-adv-x="1001"
d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5
t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5
t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" />
<glyph glyph-name="youyou" unicode="&#58882;" d="M283.648 721.918976 340.873216 780.926976 740.352 383.997952 340.876288-12.925952 283.648 46.077952 619.52 383.997952Z" horiz-adv-x="1024" />
<glyph glyph-name="zuozuo" unicode="&#58883;" d="M740.352 721.918976 683.126784 780.926976 283.648 383.997952 683.123712-12.925952 740.352 46.077952 404.48 383.997952Z" horiz-adv-x="1024" />
<glyph glyph-name="xiayiye" unicode="&#58970;" d="M62.573 384.103l423.401 423.662c18.985 18.985 49.757 18.985 68.727 0 18.982-18.972 18.985-49.746 0-68.729l-355.058-355.067 356.796-356.796c18.977-18.971 18.976-49.746 0-68.727-18.982-18.976-49.751-18.976-68.727 0l-39.753 39.753 0.269 0.246-385.655 385.661zM451.365 384.103l423.407 423.662c18.985 18.985 49.757 18.985 68.727 0 18.982-18.972 18.985-49.746 0-68.729l-355.058-355.067 356.796-356.796c18.977-18.971 18.976-49.746 0-68.727-18.982-18.976-49.757-18.977-68.727 0l-39.762 39.754 0.273 0.249-385.662 385.661zM451.365 384.103z" horiz-adv-x="1024" />
<glyph glyph-name="xiayiye1" unicode="&#58971;" d="M948.066926 382.958838l-411.990051-412.24426c-18.47333-18.47333-48.417689-18.47333-66.875207 0-18.47333 18.461167-18.47333 48.405526 0 66.875207L814.691135 383.088983 467.512212 730.269123c-18.466032 18.458735-18.466032 48.405526 0 66.873991 18.468465 18.464816 48.410391 18.464816 66.872774 0l38.682336-38.682336-0.261507-0.239614 375.259894-375.265975v0.003649m-378.312834 0L157.756743-29.285422c-18.47333-18.47333-48.415256-18.47333-66.872775 0-18.47333 18.461167-18.47333 48.405526 0 66.875207L436.369787 383.088983 89.19208 730.269123c-18.4636 18.458735-18.4636 48.405526 0 66.873991 18.470898 18.464816 48.415256 18.464816 66.872774 0l38.692067-38.682336-0.266372-0.239614 375.267191-375.265975-0.004865 0.003649m0 0z" horiz-adv-x="1024" />
</font>
</defs></svg>
/*! laydate-v5.0.9 日期与时间组件 MIT License http://www.layui.com/laydate/ By 贤心 */
.laydate-set-ym,.layui-laydate,.layui-laydate *,.layui-laydate-list{box-sizing:border-box}html #layuicss-laydate{display:none;position:absolute;width:1989px}.layui-laydate *{margin:0;padding:0}.layui-laydate{position:absolute;z-index:66666666;margin:5px 0;border-radius:2px;font-size:14px;-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-name:laydate-upbit;animation-name:laydate-upbit}.layui-laydate-main{width:272px}.layui-laydate-content td,.layui-laydate-header *,.layui-laydate-list li{transition-duration:.3s;-webkit-transition-duration:.3s}@-webkit-keyframes laydate-upbit{from{-webkit-transform:translate3d(0,20px,0);opacity:.3}to{-webkit-transform:translate3d(0,0,0);opacity:1}}@keyframes laydate-upbit{from{transform:translate3d(0,20px,0);opacity:.3}to{transform:translate3d(0,0,0);opacity:1}}.layui-laydate-static{position:relative;z-index:0;display:inline-block;margin:0;-webkit-animation:none;animation:none}.laydate-ym-show .laydate-next-m,.laydate-ym-show .laydate-prev-m{display:none!important}.laydate-ym-show .laydate-next-y,.laydate-ym-show .laydate-prev-y{display:inline-block!important}.laydate-time-show .laydate-set-ym span[lay-type=month],.laydate-time-show .laydate-set-ym span[lay-type=year],.laydate-time-show .layui-laydate-header .layui-icon,.laydate-ym-show .laydate-set-ym span[lay-type=month]{display:none!important}.layui-laydate-header{position:relative;line-height:30px;padding:10px 70px 5px}.laydate-set-ym span,.layui-laydate-header i{padding:0 5px;cursor:pointer}.layui-laydate-header *{display:inline-block;vertical-align:bottom}.layui-laydate-header i{position:absolute;top:10px;color:#999;font-size:18px}.layui-laydate-header i.laydate-prev-y{left:15px}.layui-laydate-header i.laydate-prev-m{left:45px}.layui-laydate-header i.laydate-next-y{right:15px}.layui-laydate-header i.laydate-next-m{right:45px}.laydate-set-ym{width:100%;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.laydate-time-text{cursor:default!important}.layui-laydate-content{position:relative;padding:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.layui-laydate-content table{border-collapse:collapse;border-spacing:0}.layui-laydate-content td,.layui-laydate-content th{width:36px;height:30px;padding:5px;text-align:center}.layui-laydate-content td{position:relative;cursor:pointer}.laydate-day-mark{position:absolute;left:0;top:0;width:100%;height:100%;line-height:30px;font-size:12px;overflow:hidden}.laydate-day-mark::after{position:absolute;content:'';right:2px;top:2px;width:5px;height:5px;border-radius:50%}.layui-laydate-footer{position:relative;height:46px;line-height:26px;padding:10px 20px}.layui-laydate-footer span{margin-right:15px;display:inline-block;cursor:pointer;font-size:12px}.layui-laydate-footer span:hover{color:#5FB878}.laydate-footer-btns{position:absolute;right:10px;top:10px}.laydate-footer-btns span{height:26px;line-height:26px;margin:0 0 0 -1px;padding:0 10px;border:1px solid #C9C9C9;background-color:#fff;white-space:nowrap;vertical-align:top;border-radius:2px}.layui-laydate-list>li,.layui-laydate-range .layui-laydate-main{display:inline-block;vertical-align:middle}.layui-laydate-list{position:absolute;left:0;top:0;width:100%;height:100%;padding:10px;background-color:#fff}.layui-laydate-list>li{position:relative;width:33.3%;height:36px;line-height:36px;margin:3px 0;text-align:center;cursor:pointer}.laydate-month-list>li{width:25%;margin:17px 0}.laydate-time-list>li{height:100%;margin:0;line-height:normal;cursor:default}.laydate-time-list p{position:relative;top:-4px;line-height:29px}.laydate-time-list ol{height:181px;overflow:hidden}.laydate-time-list>li:hover ol{overflow-y:auto}.laydate-time-list ol li{width:130%;padding-left:33px;line-height:30px;text-align:left;cursor:pointer}.layui-laydate-hint{position:absolute;top:115px;left:50%;width:250px;margin-left:-125px;line-height:20px;padding:15px;text-align:center;font-size:12px}.layui-laydate-range{width:546px}.layui-laydate-range .laydate-main-list-0 .laydate-next-m,.layui-laydate-range .laydate-main-list-0 .laydate-next-y,.layui-laydate-range .laydate-main-list-1 .laydate-prev-m,.layui-laydate-range .laydate-main-list-1 .laydate-prev-y{display:none}.layui-laydate-range .laydate-main-list-1 .layui-laydate-content{border-left:1px solid #e2e2e2}.layui-laydate,.layui-laydate-hint{border:1px solid #d2d2d2;box-shadow:0 2px 4px rgba(0,0,0,.12);background-color:#fff;color:#666}.layui-laydate-header{border-bottom:1px solid #e2e2e2}.layui-laydate-header i:hover,.layui-laydate-header span:hover{color:#5FB878}.layui-laydate-content{border-top:none 0;border-bottom:none 0}.layui-laydate-content th{font-weight:400;color:#333}.layui-laydate-content td{color:#666}.layui-laydate-content td.laydate-selected{background-color:#00F7DE}.laydate-selected:hover{background-color:#00F7DE!important}.layui-laydate-content td:hover,.layui-laydate-list li:hover{background-color:#eaeaea;color:#333}.laydate-time-list li ol{margin:0;padding:0;border:1px solid #e2e2e2;border-left-width:0}.laydate-time-list li:first-child ol{border-left-width:1px}.laydate-time-list>li:hover{background:0 0}.layui-laydate-content .laydate-day-next,.layui-laydate-content .laydate-day-prev{color:#d2d2d2}.laydate-selected.laydate-day-next,.laydate-selected.laydate-day-prev{background-color:#f8f8f8!important}.layui-laydate-footer{border-top:1px solid #e2e2e2}.layui-laydate-hint{color:#FF5722}.laydate-day-mark::after{background-color:#5FB878}.layui-laydate-content td.layui-this .laydate-day-mark::after{display:none}.layui-laydate-footer span[lay-type=date]{color:#5FB878}.layui-laydate .layui-this{background-color:#009688!important;color:#fff!important}.layui-laydate .laydate-disabled,.layui-laydate .laydate-disabled:hover{background:0 0!important;color:#d2d2d2!important;cursor:not-allowed!important;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.laydate-theme-molv{border:none}.laydate-theme-molv.layui-laydate-range{width:548px}.laydate-theme-molv .layui-laydate-main{width:274px}.laydate-theme-molv .layui-laydate-header{border:none;background-color:#009688}.laydate-theme-molv .layui-laydate-header i,.laydate-theme-molv .layui-laydate-header span{color:#f6f6f6}.laydate-theme-molv .layui-laydate-header i:hover,.laydate-theme-molv .layui-laydate-header span:hover{color:#fff}.laydate-theme-molv .layui-laydate-content{border:1px solid #e2e2e2;border-top:none;border-bottom:none}.laydate-theme-molv .laydate-main-list-1 .layui-laydate-content{border-left:none}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li,.laydate-theme-grid .layui-laydate-content td,.laydate-theme-grid .layui-laydate-content thead,.laydate-theme-molv .layui-laydate-footer{border:1px solid #e2e2e2}.laydate-theme-grid .laydate-selected,.laydate-theme-grid .laydate-selected:hover{background-color:#f2f2f2!important;color:#009688!important}.laydate-theme-grid .laydate-selected.laydate-day-next,.laydate-theme-grid .laydate-selected.laydate-day-prev{color:#d2d2d2!important}.laydate-theme-grid .laydate-month-list,.laydate-theme-grid .laydate-year-list{margin:1px 0 0 1px}.laydate-theme-grid .laydate-month-list>li,.laydate-theme-grid .laydate-year-list>li{margin:0 -1px -1px 0}.laydate-theme-grid .laydate-year-list>li{height:43px;line-height:43px}.laydate-theme-grid .laydate-month-list>li{height:71px;line-height:71px}@font-face{font-family:laydate-icon;src:url(font/iconfont.eot);src:url(font/iconfont.eot#iefix) format('embedded-opentype'),url(font/iconfont.svg#iconfont) format('svg'),url(font/iconfont.woff) format('woff'),url(font/iconfont.ttf) format('truetype')}.laydate-icon{font-family:laydate-icon!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
\ No newline at end of file
{
"status": 1,
"msg": "ok",
"data": [
{
"id": "100001",
"name": "Beaut-zihan",
"time": "10:23",
"face": "img/a1.jpg"
},
{
"id": "100002",
"name": "慕容晓晓",
"time": "昨天",
"face": "img/a2.jpg"
},
{
"id": "1000033",
"name": "乔峰",
"time": "2014-4.22",
"face": "img/a3.jpg"
},
{
"id": "10000333",
"name": "高圆圆",
"time": "2014-4.21",
"face": "img/a4.jpg"
}
]
}
{
"status": 1,
"msg": "ok",
"data": [
{
"name": "销售部",
"nums": 36,
"id": 1,
"item": [
{
"id": "100001",
"name": "郭敬明",
"face": "img/a5.jpg"
},
{
"id": "100002",
"name": "作家崔成浩",
"face": "img/a6.jpg"
},
{
"id": "1000022",
"name": "韩寒",
"face": "img/a7.jpg"
},
{
"id": "10000222",
"name": "范爷",
"face": "img/a8.jpg"
},
{
"id": "100002222",
"name": "小马哥",
"face": "img/a9.jpg"
}
]
},
{
"name": "大学同窗",
"nums": 16,
"id": 2,
"item": [
{
"id": "1000033",
"name": "苏醒",
"face": "img/a9.jpg"
},
{
"id": "10000333",
"name": "马云",
"face": "img/a8.jpg"
},
{
"id": "100003",
"name": "鬼脚七",
"face": "img/a7.jpg"
},
{
"id": "100004",
"name": "谢楠",
"face": "img/a6.jpg"
},
{
"id": "100005",
"name": "徐峥",
"face": "img/a5.jpg"
}
]
},
{
"name": "H+后台主题",
"nums": 38,
"id": 3,
"item": [
{
"id": "100006",
"name": "柏雪近在它香",
"face": "img/a4.jpg"
},
{
"id": "100007",
"name": "罗昌平",
"face": "img/a3.jpg"
},
{
"id": "100008",
"name": "Crystal影子",
"face": "img/a2.jpg"
},
{
"id": "100009",
"name": "艺小想",
"face": "img/a1.jpg"
},
{
"id": "100010",
"name": "天猫",
"face": "img/a8.jpg"
},
{
"id": "100011",
"name": "张泉灵",
"face": "img/a7.jpg"
}
]
}
]
}
{
"status": 1,
"msg": "ok",
"data": [
{
"name": "H+交流群",
"nums": 36,
"id": 1,
"item": [
{
"id": "101",
"name": "H+ Bug反馈",
"face": "http://tp2.sinaimg.cn/2211874245/180/40050524279/0"
},
{
"id": "102",
"name": "H+ 技术交流",
"face": "http://tp3.sinaimg.cn/1820711170/180/1286855219/1"
}
]
},
{
"name": "Bootstrap",
"nums": 16,
"id": 2,
"item": [
{
"id": "103",
"name": "Bootstrap中文",
"face": "http://tp2.sinaimg.cn/2211874245/180/40050524279/0"
},
{
"id": "104",
"name": "Bootstrap资源",
"face": "http://tp3.sinaimg.cn/1820711170/180/1286855219/1"
}
]
},
{
"name": "WebApp",
"nums": 106,
"id": 3,
"item": [
{
"id": "105",
"name": "移动开发",
"face": "http://tp2.sinaimg.cn/2211874245/180/40050524279/0"
},
{
"id": "106",
"name": "H5前言",
"face": "http://tp3.sinaimg.cn/1820711170/180/1286855219/1"
}
]
}
]
}
{
"status": 1,
"msg": "ok",
"data": [
{
"id": "100001",
"name": "無言的蒁説",
"face": "img/a1.jpg"
},
{
"id": "100002",
"name": "婷宝奢侈品",
"face": "img/a2.jpg"
},
{
"id": "100003",
"name": "忆恨思爱",
"face": "img/a3.jpg"
},
{
"id": "100004",
"name": "天涯奥拓慢",
"face": "img/a4.jpg"
},
{
"id": "100005",
"name": "雨落无声的天空",
"face": "img/a5.jpg"
},
{
"id": "100006",
"name": "李越LycorisRadiate",
"face": "img/a6.jpg"
},
{
"id": "100007",
"name": "冯胖妞张直丑",
"face": "img/a7.jpg"
},
{
"id": "100008",
"name": "陈龙hmmm",
"face": "img/a8.jpg"
},
{
"id": "100009",
"name": "别闹哥胆儿小",
"face": "img/a9.jpg"
},
{
"id": "100010",
"name": "锅锅锅锅萌哒哒 ",
"face": "img/a10.jpg"
}
]
}
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