├── .DS_Store ├── README.md ├── pom.xml └── src └── main ├── java └── com │ └── earth │ └── station │ ├── common │ ├── Base64.java │ ├── CookieUtil.java │ ├── CustomPropertyPlaceholderConfigurer.java │ ├── MD5Util.java │ ├── PageUtil.java │ ├── ResultInfo.java │ ├── SessionUtil.java │ ├── StringUtil.java │ ├── constant │ │ ├── SubjectConstant.java │ │ └── UserConstant.java │ ├── interceptor │ │ └── SecurityInterceptor.java │ └── tags │ │ └── Pagelink.java │ ├── controller │ ├── BaseController.java │ ├── IndexController.java │ ├── LoginController.java │ ├── StationController.java │ ├── SubjectController.java │ └── UserController.java │ ├── mapper │ ├── StationMapper.java │ ├── StationMapper.xml │ ├── StationUserMapper.java │ ├── StationUserMapper.xml │ ├── SubjectMapper.java │ └── SubjectMapper.xml │ ├── model │ ├── Station.java │ ├── StationCriteria.java │ ├── StationUser.java │ ├── StationUserCriteria.java │ ├── Subject.java │ └── SubjectCriteria.java │ └── service │ ├── StationService.java │ ├── SubjectService.java │ └── UserService.java ├── resources ├── generatorConfig.xml ├── jdbc.properties ├── log4j.properties ├── mybatis-config.xml └── spring-context.xml └── webapp ├── WEB-INF ├── index.tld └── web.xml ├── source ├── css │ └── common.css ├── image │ └── header_icon.png ├── js │ ├── base64.js │ ├── common.js │ ├── jquery-2.1.1.min.js │ └── jquery.cookie.js ├── sweetalert2 │ └── dist │ │ ├── sweetalert2.all.js │ │ ├── sweetalert2.all.min.js │ │ ├── sweetalert2.css │ │ ├── sweetalert2.js │ │ ├── sweetalert2.min.css │ │ └── sweetalert2.min.js └── wangEditor3 │ ├── fonts │ └── w-e-icon.woff │ ├── wangEditor.css │ ├── wangEditor.js │ ├── wangEditor.min.css │ ├── wangEditor.min.js │ └── wangEditor.min.js.map └── view ├── index ├── css │ └── index.css ├── index.jsp └── js │ └── index.js ├── login ├── css │ └── login.css ├── js │ └── login.js └── login.jsp ├── station ├── add.jsp ├── css │ ├── add.css │ ├── list.css │ └── update.css ├── js │ ├── add.js │ ├── list.js │ └── update.js ├── list.jsp └── update.jsp ├── subject ├── add.jsp ├── css │ ├── add.css │ ├── list.css │ └── update.css ├── js │ ├── add.js │ ├── list.js │ └── update.js ├── list.jsp └── update.jsp └── user ├── css ├── add.css ├── list.css └── update.css ├── js ├── add.js └── update.js └── update.jsp /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GeophysicalStationManagementSystem/cfb6c7252402e5c6635b8c23b809802ff86b55b3/.DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 全目录 2 | 3 | [更多系统、论文,供君选择 ~~>](https://www.yuque.com/wisebit/blog) 4 | # 185.GeophysicalStationManagementSystem 5 | 6 |

群: 983063232(大佬群 2TB学习资料,讲解)(入群获取sql文件)

7 | 8 |

185.地球物理台管理系统

9 | 10 | 11 |

12 | 13 | 14 | 15 | 16 |

17 | 18 | # 简介 19 | 20 | 21 | > 本代码来源于网络,仅供学习参考使用,请入群(983063232)后联系群主索要sql文件! 22 | > 23 | > 提供1.远程部署/2.修改代码/3.设计文档指导/4.框架代码讲解等服务 24 | > 25 | > http://localhost:8080/login.html 26 | > 27 | > admin 123456 28 | > 29 | 30 | 31 | 32 | # 环境 33 | 34 | - IntelliJ IDEA 2009.3 35 | 36 | - Mysql 5.7.26 37 | 38 | - Tomcat 7.0.73 39 | 40 | - JDK 1.8 41 | 42 | 43 | 44 | 45 | ## 缩略图 46 | 47 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/fc96028c-94ed-4265-80c6-320f3e09fc6a.png) 48 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/3a272713-0ece-4f41-86dc-b665f528244f.png) 49 | ![](https://bitwise.oss-cn-heyuan.aliyuncs.com/2024/9/10/a0a1020c-814e-4055-895b-5b77129a5de0.png) 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | com.earth.station 6 | earth-station 7 | war 8 | 0.0.1-SNAPSHOT 9 | earth station Maven Webapp 10 | 11 | UTF-8 12 | UTF-8 13 | 1.8 14 | 15 | 16 | 17 | javax.servlet.jsp 18 | jsp-api 19 | 2.1 20 | provided 21 | 22 | 23 | javax.servlet 24 | javax.servlet-api 25 | 3.0.1 26 | provided 27 | 28 | 29 | org.springframework 30 | spring-webmvc 31 | 4.3.3.RELEASE 32 | 33 | 34 | org.springframework 35 | spring-tx 36 | 4.3.3.RELEASE 37 | 38 | 39 | org.springframework 40 | spring-jdbc 41 | 4.3.3.RELEASE 42 | 43 | 44 | org.mybatis 45 | mybatis 46 | 3.4.1 47 | 48 | 49 | org.mybatis 50 | mybatis-spring 51 | 1.3.0 52 | 53 | 54 | mysql 55 | mysql-connector-java 56 | 5.0.8 57 | 58 | 59 | com.alibaba 60 | druid 61 | 1.0.18 62 | 63 | 64 | log4j 65 | log4j 66 | 1.2.16 67 | 68 | 69 | com.alibaba 70 | fastjson 71 | 1.2.33 72 | 73 | 74 | org.apache.commons 75 | commons-lang3 76 | 3.4 77 | 78 | 79 | com.thoughtworks.xstream 80 | xstream 81 | 1.4.7 82 | 83 | 84 | org.apache.httpcomponents 85 | httpclient 86 | 4.3.5 87 | 88 | 89 | joda-time 90 | joda-time 91 | 2.9.9 92 | 93 | 94 | commons-io 95 | commons-io 96 | 2.4 97 | 98 | 99 | 100 | earth-station 101 | 102 | 103 | org.apache.maven.plugins 104 | maven-compiler-plugin 105 | 3.5.1 106 | 107 | 1.8 108 | 1.8 109 | 110 | 111 | 112 | maven-resources-plugin 113 | 3.0.1 114 | 115 | 116 | copy-xmls 117 | process-sources 118 | 119 | copy-resources 120 | 121 | 122 | ${basedir}/target/classes 123 | 124 | 125 | ${basedir}/src/main/java 126 | 127 | **/*.xml 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | org.apache.tomcat.maven 137 | tomcat7-maven-plugin 138 | 2.2 139 | 140 | /earth-station 141 | 8081 142 | UTF-8 143 | 144 | 145 | 146 | org.mybatis.generator 147 | mybatis-generator-maven-plugin 148 | 1.3.7 149 | 150 | 151 | mysql 152 | mysql-connector-java 153 | 8.0.20 154 | runtime 155 | 156 | 157 | com.github.oceanc 158 | mybatis3-generator-plugin 159 | 0.4.0 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | central 169 | aliyun maven 170 | http://maven.aliyun.com/nexus/content/groups/public/ 171 | default 172 | 173 | true 174 | 175 | 176 | true 177 | 178 | 179 | 180 | 181 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/common/CookieUtil.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.common; 2 | 3 | import javax.servlet.http.Cookie; 4 | import javax.servlet.http.HttpServletRequest; 5 | 6 | /** 7 | * @Description CookieUtil 8 | * @Author yeyu 9 | * @Date 2020/5/23 10 | */ 11 | public class CookieUtil { 12 | 13 | /** 14 | * 获取cookie 15 | */ 16 | public static String getCookie(HttpServletRequest request, String name) { 17 | for (Cookie cookie : request.getCookies()) { 18 | if (cookie.getName().equalsIgnoreCase(name)) { 19 | return cookie.getValue(); 20 | } 21 | } 22 | return null; 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/common/CustomPropertyPlaceholderConfigurer.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.common; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | import java.util.Properties; 6 | 7 | import org.springframework.beans.BeansException; 8 | import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; 9 | import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; 10 | 11 | public class CustomPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer{ 12 | private static Map propertyMap; 13 | 14 | @Override 15 | protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) 16 | throws BeansException { 17 | super.processProperties(beanFactoryToProcess, props); 18 | propertyMap = new HashMap(); 19 | for (Object item : props.keySet()) { 20 | String key = item.toString(); 21 | String value = props.getProperty(key); 22 | propertyMap.put(key, value); 23 | } 24 | } 25 | public static String getProperty(String name) { 26 | return propertyMap.get(name); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/common/MD5Util.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.common; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import java.security.MessageDigest; 5 | import java.security.NoSuchAlgorithmException; 6 | import java.security.SecureRandom; 7 | import java.util.Arrays; 8 | 9 | public class MD5Util { 10 | private static final Integer SALT_LENGTH = 12; 11 | 12 | /** 13 | * 验证口令是否合法 14 | * 15 | * @param password 16 | * @param passwordInDb 17 | * @return 18 | * @throws NoSuchAlgorithmException 19 | * @throws UnsupportedEncodingException 20 | */ 21 | public static boolean validPassword(String password, String passwordInDb) { 22 | // 将16进制字符串格式口令转换成字节数组 23 | try { 24 | byte[] pwdInDb = Base64.decode(passwordInDb); 25 | // 声明盐变量 26 | byte[] salt = new byte[SALT_LENGTH]; 27 | // 将盐从数据库中保存的口令字节数组中提取出来 28 | System.arraycopy(pwdInDb, 0, salt, 0, SALT_LENGTH); 29 | // 创建消息摘要对象 30 | MessageDigest md = MessageDigest.getInstance("MD5"); 31 | // 将盐数据传入消息摘要对象 32 | md.update(salt); 33 | // 将口令的数据传给消息摘要对象 34 | md.update(password.getBytes("UTF-8")); 35 | // 生成输入口令的消息摘要 36 | byte[] digest = md.digest(); 37 | // 声明一个保存数据库中口令消息摘要的变量 38 | byte[] digestInDb = new byte[pwdInDb.length - SALT_LENGTH]; 39 | // 取得数据库中口令的消息摘要 40 | System.arraycopy(pwdInDb, SALT_LENGTH, digestInDb, 0, digestInDb.length); 41 | // 比较根据输入口令生成的消息摘要和数据库中消息摘要是否相同 42 | if (Arrays.equals(digest, digestInDb)) { 43 | // 口令正确返回口令匹配消息 44 | return true; 45 | } else { 46 | // 口令不正确返回口令不匹配消息 47 | return false; 48 | } 49 | } catch (Exception e) { 50 | e.printStackTrace(); 51 | return false; 52 | } 53 | } 54 | 55 | /** 56 | * 获得加密后的16进制形式口令 57 | * 58 | * @param password 59 | * @return 60 | * @throws NoSuchAlgorithmException 61 | * @throws UnsupportedEncodingException 62 | */ 63 | public static String encrypt(String password) { 64 | // 声明加密后的口令数组变量 65 | byte[] pwd = null; 66 | try { 67 | // 随机数生成器 68 | SecureRandom random = new SecureRandom(); 69 | // 声明盐数组变量 70 | byte[] salt = new byte[SALT_LENGTH]; 71 | // 将随机数放入盐变量中 72 | random.nextBytes(salt); 73 | 74 | // 声明消息摘要对象 75 | MessageDigest md = null; 76 | // 创建消息摘要 77 | md = MessageDigest.getInstance("MD5"); 78 | // 将盐数据传入消息摘要对象 79 | md.update(salt); 80 | // 将口令的数据传给消息摘要对象 81 | md.update(password.getBytes("UTF-8")); 82 | // 获得消息摘要的字节数组 83 | byte[] digest = md.digest(); 84 | 85 | // 因为要在口令的字节数组中存放盐,所以加上盐的字节长度 86 | pwd = new byte[digest.length + SALT_LENGTH]; 87 | // 将盐的字节拷贝到生成的加密口令字节数组的前12个字节,以便在验证口令时取出盐 88 | System.arraycopy(salt, 0, pwd, 0, SALT_LENGTH); 89 | // 将消息摘要拷贝到加密口令字节数组从第13个字节开始的字节 90 | System.arraycopy(digest, 0, pwd, SALT_LENGTH, digest.length); 91 | // 将字节数组格式加密后的口令转化为16进制字符串格式的口令 92 | } catch (Exception e) { 93 | e.printStackTrace(); 94 | } 95 | return Base64.encodeBytes(pwd); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/common/PageUtil.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.common; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 分页工具类 7 | * 8 | * @author Zongqian 9 | */ 10 | public class PageUtil { 11 | 12 | private int index; // 起始索引 13 | private int currentPage; // 当前页 14 | private int pageSize; // 每页显示数量 15 | private int totalCount; // 总记录数 16 | private int totalPage; // 总页数 17 | private List result; // 返回结果集 18 | 19 | public PageUtil(int currentPage, int pageSize) { 20 | this.index = (currentPage - 1) * pageSize; 21 | this.pageSize = pageSize; 22 | } 23 | 24 | public PageUtil(int index, int currentPage, int pageSize, int totalCount, int totalPage, List result) { 25 | super(); 26 | this.index = index; 27 | this.currentPage = currentPage; 28 | this.pageSize = pageSize; 29 | this.totalCount = totalCount; 30 | this.totalPage = totalPage; 31 | this.result = result; 32 | } 33 | 34 | public int getIndex() { 35 | return index; 36 | } 37 | 38 | public void setIndex(int index) { 39 | this.index = index; 40 | } 41 | 42 | public void setTotalPage(int totalPage) { 43 | this.totalPage = totalPage; 44 | } 45 | 46 | public int getCurrentPage() { 47 | return currentPage; 48 | } 49 | 50 | public void setCurrentPage(int currentPage) { 51 | this.currentPage = currentPage; 52 | } 53 | 54 | public int getPageSize() { 55 | return pageSize; 56 | } 57 | 58 | public void setPageSize(int pageSize) { 59 | this.pageSize = pageSize; 60 | } 61 | 62 | public int getTotalCount() { 63 | return totalCount; 64 | } 65 | 66 | public void setTotalCount(int totalCount) { 67 | this.totalCount = totalCount; 68 | } 69 | 70 | public int getTotalPage() { 71 | return totalPage; 72 | } 73 | 74 | public void setTotalPage() { 75 | this.totalPage = totalCount % pageSize == 0 ? totalCount / pageSize : (totalCount / pageSize + 1); 76 | } 77 | 78 | public List getResult() { 79 | return result; 80 | } 81 | 82 | public void setResult(List result) { 83 | this.result = result; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/common/ResultInfo.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.common; 2 | 3 | /** 4 | * 统一返回类 5 | * 6 | * @author Zongqian 7 | */ 8 | public class ResultInfo { 9 | 10 | private int code; // 0操作成功 11 | private T data; // 返回的数据,正确的信息或错误描述信息 12 | 13 | 14 | public ResultInfo(){ 15 | 16 | } 17 | public ResultInfo(T data){ 18 | this.data = data; 19 | } 20 | public ResultInfo(int code, T data){ 21 | this.code = code; 22 | this.data = data; 23 | } 24 | 25 | 26 | public int getCode() { 27 | return code; 28 | } 29 | 30 | public ResultInfo setCode(int code) { 31 | this.code = code; 32 | return this; 33 | } 34 | 35 | public T getData() { 36 | return data; 37 | } 38 | 39 | public ResultInfo setData(T data) { 40 | this.data = data; 41 | return this; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/common/SessionUtil.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.common; 2 | 3 | public class SessionUtil { 4 | //登录用户 5 | public static final String user = "user"; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/common/StringUtil.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.common; 2 | 3 | import java.beans.PropertyDescriptor; 4 | import java.lang.reflect.Method; 5 | import java.util.Map; 6 | 7 | import org.springframework.beans.BeanUtils; 8 | 9 | public class StringUtil { 10 | 11 | public static String format(Object object) { 12 | if (object == null) { 13 | return ""; 14 | } 15 | return ((String) object).trim(); 16 | } 17 | public static String format(Object object, String defaultValue) { 18 | if (object == null) { 19 | return defaultValue; 20 | } 21 | String val = object.toString().trim(); 22 | if(val.equals("")) 23 | return defaultValue; 24 | return val; 25 | } 26 | 27 | /** 28 | * 为字符串类型设置默认值 29 | */ 30 | public static void setDefaultValue(Object obj) { 31 | try { 32 | PropertyDescriptor[] propertys = BeanUtils.getPropertyDescriptors(obj.getClass()); 33 | for (PropertyDescriptor pro : propertys) { 34 | if (pro.getPropertyType() != String.class) { 35 | continue; 36 | } 37 | Method readMethod = pro.getReadMethod(); 38 | Object value = null; 39 | value = readMethod.invoke(obj); 40 | if (value != null) 41 | continue; 42 | Method writeMethod = pro.getWriteMethod(); 43 | writeMethod.invoke(obj, ""); 44 | } 45 | } catch (Exception e) { 46 | e.printStackTrace(); 47 | } 48 | } 49 | /** 50 | * StringBuffer字符串占位符替换 51 | */ 52 | public static void replaceAll(StringBuffer sb, Map map){ 53 | for (Map.Entry entry : map.entrySet()) { 54 | String key = "${" + entry.getKey() + "}"; 55 | int index = -1; 56 | while((index = sb.indexOf(key)) != -1){ 57 | String value = StringUtil.format(entry.getValue()); 58 | sb.replace(index, index + key.length(), value); 59 | } 60 | } 61 | } 62 | /** 63 | * 连接字符串数组 64 | */ 65 | public static String join(String separator, Object... array){ 66 | return join(separator, "", array); 67 | } 68 | /** 69 | * 连接字符串数组 70 | */ 71 | public static String join(String separator, String defaultValue, Object... array){ 72 | if (separator == null) { 73 | separator = ""; 74 | } 75 | StringBuffer buf = new StringBuffer(); 76 | for (Object item : array){ 77 | if(item == null) 78 | continue; 79 | String s = String.valueOf(item).trim(); 80 | if(s.equals("")) 81 | continue; 82 | if (buf.length() > 0) { 83 | buf.append(separator); 84 | } 85 | buf.append(s); 86 | } 87 | if(buf.length() == 0) 88 | return defaultValue; 89 | return buf.toString(); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/common/constant/SubjectConstant.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.common.constant; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * @Description SubjectConstant 8 | * @Author yeyu 9 | * @Date 2020/5/23 10 | */ 11 | public interface SubjectConstant { 12 | /** 13 | * 测震 14 | */ 15 | Integer TEST_EQ = 1; 16 | 17 | /** 18 | * 强震 19 | */ 20 | Integer STRONG_EQ = 2; 21 | 22 | /** 23 | * 地磁 24 | */ 25 | Integer TM = 3; 26 | 27 | /** 28 | * 流体 29 | */ 30 | Integer LIQUID = 4; 31 | 32 | /** 33 | * GNSS 34 | */ 35 | Integer GNSS = 5; 36 | 37 | /** 38 | * 重力 39 | */ 40 | Integer GRAVITY = 6; 41 | 42 | /** 43 | * 形变 44 | */ 45 | Integer DEFORMATION = 7; 46 | 47 | /** 48 | * 辅助 49 | */ 50 | Integer AID = 8; 51 | 52 | Map SUBJECT_MAPPING = new HashMap(){ 53 | { 54 | put(0, "所有"); 55 | put(TEST_EQ, "测震"); 56 | put(STRONG_EQ, "强震"); 57 | put(TM, "地磁"); 58 | put(LIQUID, "流体"); 59 | put(GNSS, "GNSS"); 60 | put(AID, "辅助"); 61 | put(DEFORMATION, "形变"); 62 | put(GRAVITY, "重力"); 63 | } 64 | }; 65 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/common/constant/UserConstant.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.common.constant; 2 | 3 | /** 4 | * @Description UserConstant 5 | * @Author yeyu 6 | * @Date 2020/5/23 7 | */ 8 | public interface UserConstant { 9 | 10 | /** 11 | * 用户等级 12 | */ 13 | interface Level { 14 | 15 | /** 16 | * 管理员 17 | */ 18 | Integer ADMIN = 1; 19 | Integer NORMAL = 2; 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/common/interceptor/SecurityInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.common.interceptor; 2 | 3 | import com.earth.station.common.CookieUtil; 4 | import com.earth.station.common.SessionUtil; 5 | import com.earth.station.common.constant.UserConstant; 6 | import com.earth.station.common.constant.UserConstant.Level; 7 | import com.earth.station.model.StationUser; 8 | import java.util.List; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | 13 | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; 14 | 15 | public class SecurityInterceptor extends HandlerInterceptorAdapter { 16 | 17 | private List excludedUrls; 18 | 19 | public void setExcludedUrls(List excludedUrls) { 20 | this.excludedUrls = excludedUrls; 21 | } 22 | 23 | @Override 24 | public boolean preHandle(HttpServletRequest req, HttpServletResponse resp, Object handler) throws Exception { 25 | String servletPath = req.getServletPath(); 26 | for (String url : excludedUrls) { // 放行的请求 27 | if (servletPath.startsWith(url)) { 28 | return true; 29 | } 30 | } 31 | StationUser user = (StationUser) req.getSession().getAttribute(SessionUtil.user); 32 | if (user == null) {//未登录或会话超时 33 | resp.sendRedirect(getDomain(req) + "login.html"); 34 | return false; 35 | } 36 | if (Level.ADMIN.equals(user.getLevel())) { 37 | String flag = req.getServletContext().getAttribute(user.getUserName()).toString(); 38 | String cookieFlag = CookieUtil.getCookie(req, user.getUserName()); 39 | if (cookieFlag == null || !cookieFlag.equalsIgnoreCase(flag)) { 40 | resp.sendRedirect(getDomain(req) + "login.html"); 41 | return false; 42 | } 43 | } 44 | return true; 45 | } 46 | 47 | /** 48 | * 获得域名 49 | * 50 | * @param request 51 | * @return 52 | */ 53 | protected String getDomain(HttpServletRequest request) { 54 | String path = request.getContextPath(); 55 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; 56 | return basePath; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/common/tags/Pagelink.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.common.tags; 2 | import java.io.IOException; 3 | 4 | import javax.servlet.ServletRequest; 5 | import javax.servlet.jsp.JspException; 6 | import javax.servlet.jsp.tagext.TagSupport; 7 | 8 | import com.earth.station.common.StringUtil; 9 | 10 | public class Pagelink extends TagSupport{ 11 | @Override 12 | public int doStartTag() throws JspException { 13 | return 2; 14 | } 15 | 16 | @Override 17 | public int doEndTag() throws JspException { 18 | try { 19 | ServletRequest request = pageContext.getRequest(); 20 | StringBuffer strBuffer = new StringBuffer(); 21 | 22 | int pageNo = Integer.parseInt(request.getAttribute("pageNo").toString()); 23 | int totalCount = Integer.parseInt(request.getAttribute("totalCount").toString());//记录数 24 | int pageSize = Integer.parseInt(request.getAttribute("pageSize").toString()); 25 | String params = StringUtil.format(request.getAttribute("params")); 26 | String domain = request.getAttribute("domain").toString(); 27 | String link = request.getAttribute("link").toString(); 28 | 29 | int pageTotal = totalCount / pageSize; 30 | if(totalCount % pageSize != 0) { 31 | pageTotal++; 32 | } 33 | if(pageTotal==1){ 34 | strBuffer.append("1"); 35 | pageContext.getOut().write(strBuffer.toString()); 36 | return EVAL_PAGE; 37 | } 38 | String href = null; 39 | if(params == null || params == "") { 40 | href = domain + "/" + link + "?p="; 41 | } else { 42 | href = domain + "/" + link + "?" + params + "&p="; 43 | } 44 | 45 | //固定9页 46 | if(pageTotal<=9){ 47 | for(int i =1;i<=pageTotal;i++){ 48 | if(i == pageNo){ 49 | strBuffer.append(""+i+""); 50 | }else{ 51 | strBuffer.append(""+i+""); 52 | } 53 | } 54 | pageContext.getOut().write(strBuffer.toString()); 55 | return EVAL_PAGE; 56 | } 57 | if(pageNo <= 5){//当前页<=5 58 | for(int i =1; i<=9; i++){ 59 | if(i == pageNo){ 60 | strBuffer.append(""+i+""); 61 | }else{ 62 | strBuffer.append(""+i+""); 63 | } 64 | } 65 | strBuffer.append(""); 66 | pageContext.getOut().write(strBuffer.toString()); 67 | return EVAL_PAGE; 68 | } 69 | if((pageNo+4)>=pageTotal){ 70 | strBuffer.append("上一页"); 71 | for(int i =(pageTotal-8);i<=pageTotal;i++){ 72 | if(i == pageNo){ 73 | strBuffer.append(""+i+""); 74 | }else{ 75 | strBuffer.append(""+i+""); 76 | } 77 | } 78 | pageContext.getOut().write(strBuffer.toString()); 79 | return EVAL_PAGE; 80 | } 81 | strBuffer.append("上一页"); 82 | for(int i =(pageNo-4);i<=(pageNo+4);i++){ 83 | if(i == pageNo){ 84 | strBuffer.append(""+i+""); 85 | }else{ 86 | strBuffer.append(""+i+""); 87 | } 88 | } 89 | strBuffer.append(""); 90 | pageContext.getOut().write(strBuffer.toString()); 91 | } catch (IOException e) { 92 | // TODO Auto-generated catch block 93 | e.printStackTrace(); 94 | } 95 | return EVAL_PAGE; 96 | } 97 | 98 | @Override 99 | public void release() { 100 | super.release(); 101 | } 102 | } 103 | 104 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/controller/BaseController.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.controller; 2 | 3 | import com.earth.station.common.ResultInfo; 4 | import javax.servlet.http.HttpServletRequest; 5 | 6 | public class BaseController { 7 | /** 8 | * 请求成功 9 | * 10 | * @param data 请求成功返回的内容 11 | * @return 12 | */ 13 | public Object success(Object data) { 14 | ResultInfo resultInfo = new ResultInfo(); 15 | resultInfo.setCode(200); 16 | resultInfo.setData(data); 17 | return resultInfo; 18 | } 19 | 20 | /** 21 | * 请求失败 22 | * 23 | * @param msg 失败信息 24 | * @return 25 | */ 26 | public Object fail(String msg) { 27 | ResultInfo resultInfo = new ResultInfo(); 28 | resultInfo.setCode(300); 29 | resultInfo.setData(msg); 30 | return resultInfo; 31 | } 32 | /** 33 | * 获得域名 34 | * @param request 35 | * @return 36 | */ 37 | protected String getDomain(HttpServletRequest request){ 38 | String path = request.getContextPath(); 39 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path; 40 | return basePath; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.controller; 2 | 3 | import com.earth.station.common.SessionUtil; 4 | import com.earth.station.model.StationUser; 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | import org.apache.log4j.Logger; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.servlet.ModelAndView; 11 | 12 | 13 | @Controller 14 | public class IndexController extends BaseController{ 15 | private static final Logger LOG = Logger.getLogger(IndexController.class); 16 | /** 17 | * 首页 18 | * 19 | * @return 20 | */ 21 | @RequestMapping("/index") 22 | public ModelAndView index(HttpServletRequest request) { 23 | try { 24 | StationUser user = (StationUser) request.getSession().getAttribute(SessionUtil.user); 25 | ModelAndView mv = new ModelAndView("index/index"); 26 | mv.addObject("user", user); 27 | return mv; 28 | } catch (Exception e) { 29 | LOG.error(e.getMessage(), e); 30 | } 31 | return null; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.controller; 2 | 3 | import com.earth.station.common.MD5Util; 4 | import com.earth.station.common.SessionUtil; 5 | import com.earth.station.common.constant.UserConstant; 6 | import com.earth.station.common.constant.UserConstant.Level; 7 | import com.earth.station.model.StationUser; 8 | import com.earth.station.service.UserService; 9 | import java.util.UUID; 10 | import javax.annotation.Resource; 11 | import javax.servlet.http.Cookie; 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | import org.apache.commons.lang3.StringUtils; 15 | import org.apache.log4j.Logger; 16 | import org.springframework.stereotype.Controller; 17 | import org.springframework.web.bind.annotation.RequestMapping; 18 | import org.springframework.web.bind.annotation.ResponseBody; 19 | import org.springframework.web.servlet.ModelAndView; 20 | 21 | @Controller("loginController") 22 | @RequestMapping 23 | public class LoginController extends BaseController { 24 | 25 | private static final Logger LOG = Logger.getLogger(LoginController.class); 26 | 27 | @Resource 28 | private UserService userService; 29 | 30 | /** 31 | * 首页 32 | */ 33 | @RequestMapping("/login") 34 | public ModelAndView login() { 35 | try { 36 | ModelAndView mv = new ModelAndView("login/login"); 37 | return mv; 38 | } catch (Exception e) { 39 | LOG.error(e.getMessage(), e); 40 | } 41 | return null; 42 | } 43 | 44 | /** 45 | * 登录 46 | */ 47 | @RequestMapping(value = "/doLogin") 48 | @ResponseBody 49 | public Object doLogin( 50 | HttpServletRequest request, HttpServletResponse response, 51 | String userName, 52 | String pwd) { 53 | try { 54 | //参数格式错误 55 | if (StringUtils.isBlank(userName) || StringUtils.isBlank(pwd)) { 56 | return this.fail("参数格式错误"); 57 | } 58 | StationUser user = userService.getByUserName(userName); 59 | 60 | if (user == null) { 61 | return this.fail("账号不存在"); 62 | } 63 | if (!MD5Util.validPassword(pwd, user.getPassword())) { 64 | return this.fail("密码错误"); 65 | } 66 | //保证admin只能在一台机器上登陆 67 | request.getSession().setAttribute(SessionUtil.user, user); 68 | if (Level.ADMIN.equals(user.getLevel())) { 69 | String flag = UUID.randomUUID().toString(); 70 | request.getServletContext().setAttribute(user.getUserName(), flag); 71 | Cookie cookie = new Cookie(user.getUserName(), flag); 72 | cookie.setPath("/"); 73 | response.addCookie(cookie); 74 | } 75 | return this.success("登录成功"); 76 | } catch (Exception e) { 77 | LOG.error(e.getMessage(), e); 78 | } 79 | return this.fail("系统错误"); 80 | } 81 | 82 | /** 83 | * 退出 84 | */ 85 | @RequestMapping("/loginout") 86 | @ResponseBody 87 | public Object loginout(HttpServletRequest request) { 88 | try { 89 | request.getSession().setAttribute(SessionUtil.user, null); 90 | return this.success(null); 91 | } catch (Exception e) { 92 | e.printStackTrace(); 93 | LOG.error(e.getMessage(), e); 94 | } 95 | return super.fail("退出失败"); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/controller/StationController.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.controller; 2 | 3 | import com.earth.station.model.Station; 4 | import com.earth.station.service.StationService; 5 | import java.util.List; 6 | import javax.annotation.Resource; 7 | import javax.jws.WebParam.Mode; 8 | import org.apache.log4j.Logger; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.ResponseBody; 12 | import org.springframework.web.servlet.ModelAndView; 13 | 14 | /** 15 | * @Description StationController 16 | * @Author yeyu 17 | * @Date 2020/5/23 18 | */ 19 | @Controller 20 | @RequestMapping("/station") 21 | public class StationController extends BaseController{ 22 | private static final Logger LOG = Logger.getLogger(StationController.class); 23 | 24 | @Resource 25 | private StationService stationService; 26 | 27 | /** 28 | * 查询 所有站点 29 | * @param name 名称 模糊查询 30 | * @param subject 存在该学科的站点 31 | * @return 32 | */ 33 | @RequestMapping("/list") 34 | public ModelAndView list(String name, Integer subject) { 35 | List list = stationService.search(name, subject); 36 | ModelAndView mav = new ModelAndView("station/list"); 37 | mav.addObject("list", list); 38 | mav.addObject("name", name); 39 | mav.addObject("subject", subject); 40 | return mav; 41 | } 42 | 43 | /** 44 | * 站台添加页面 45 | * @return 46 | */ 47 | @RequestMapping("/addPage") 48 | public String addPage() { 49 | return "station/add"; 50 | } 51 | 52 | /** 53 | * 添加站台 54 | * @param station 55 | * @return 56 | */ 57 | @RequestMapping("/add") 58 | @ResponseBody 59 | public Object add(Station station) { 60 | try { 61 | stationService.save(station); 62 | return success(null); 63 | }catch (Exception e) { 64 | LOG.error(e.getMessage(), e); 65 | } 66 | return fail("系统错误!"); 67 | } 68 | 69 | /** 70 | * 更新页面 71 | * @param id 要更新的记录ID 72 | * @return 73 | */ 74 | @RequestMapping("/updatePage") 75 | public ModelAndView updatePage(Integer id) { 76 | ModelAndView mav = new ModelAndView("station/update"); 77 | mav.addObject("entity", stationService.getById(id)); 78 | return mav; 79 | } 80 | 81 | /** 82 | * 更新站台 83 | * @param station 84 | * @return 85 | */ 86 | @ResponseBody 87 | @RequestMapping("/update") 88 | public Object update(Station station) { 89 | try { 90 | stationService.update(station); 91 | return success(null); 92 | }catch (Exception e) { 93 | LOG.error(e.getMessage(), e); 94 | } 95 | return fail("更新失败!"); 96 | } 97 | 98 | 99 | /** 100 | * 删除站台 101 | * @param id 站台ID 102 | * @return 103 | */ 104 | @ResponseBody 105 | @RequestMapping("/delete") 106 | public Object delete(Integer id) { 107 | try { 108 | stationService.delete(id); 109 | return success(null); 110 | }catch (Exception e) { 111 | LOG.error(e.getMessage(), e); 112 | } 113 | return fail("更新失败!"); 114 | } 115 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/controller/SubjectController.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.controller; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.alibaba.fastjson.JSONArray; 5 | import com.alibaba.fastjson.JSONObject; 6 | import com.earth.station.common.constant.SubjectConstant; 7 | import com.earth.station.model.Subject; 8 | import com.earth.station.service.StationService; 9 | import com.earth.station.service.SubjectService; 10 | import javax.annotation.Resource; 11 | import org.apache.log4j.Logger; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.ResponseBody; 15 | import org.springframework.web.servlet.ModelAndView; 16 | 17 | /** 18 | * @Description SubjectController 19 | * @Author yeyu 20 | * @Date 2020/5/23 21 | */ 22 | @Controller 23 | @RequestMapping("/subject") 24 | public class SubjectController extends BaseController{ 25 | private static final Logger LOG = Logger.getLogger(SubjectController.class); 26 | 27 | @Resource 28 | private SubjectService subjectService; 29 | @Resource 30 | private StationService stationService; 31 | 32 | 33 | @RequestMapping("/addPage") 34 | public ModelAndView addPage(Integer stationId, Integer type) { 35 | ModelAndView mav = new ModelAndView("subject/add"); 36 | mav.addObject("stationId", stationId); 37 | mav.addObject("type", type); 38 | return mav; 39 | } 40 | 41 | 42 | @ResponseBody 43 | @RequestMapping("/add") 44 | public Object add(Subject subject) { 45 | try { 46 | subjectService.save(subject); 47 | return success(null); 48 | }catch (Exception e) { 49 | LOG.error(e.getMessage(), e); 50 | } 51 | return fail("添加失败!"); 52 | } 53 | 54 | @RequestMapping("/list") 55 | public ModelAndView list(Integer id) { 56 | ModelAndView mav = new ModelAndView("subject/list"); 57 | Subject subject = subjectService.getById(id); 58 | mav.addObject("subject", subject); 59 | mav.addObject("station", stationService.getById(subject.getStationId())); 60 | return mav; 61 | } 62 | 63 | @ResponseBody 64 | @RequestMapping("/delete") 65 | public Object delete(Integer id) { 66 | try { 67 | subjectService.deleteById(id); 68 | return success(null); 69 | } catch (Exception e) { 70 | LOG.error(e.getMessage(), e); 71 | } 72 | return fail("删除失败!"); 73 | } 74 | 75 | @RequestMapping("/updatePage") 76 | public ModelAndView updatePage(Integer id) { 77 | ModelAndView mav = new ModelAndView("subject/update"); 78 | mav.addObject("subject", subjectService.getById(id)); 79 | return mav; 80 | } 81 | 82 | @ResponseBody 83 | @RequestMapping("/update") 84 | public Object update(Subject subject) { 85 | try { 86 | subjectService.update(subject); 87 | return success(null); 88 | }catch (Exception e) { 89 | LOG.error(e.getMessage(), e); 90 | } 91 | return fail("更新失败!"); 92 | } 93 | 94 | 95 | @ResponseBody 96 | @RequestMapping("/findAll") 97 | public Object findAll(){ 98 | JSONArray arr = new JSONArray(); 99 | SubjectConstant.SUBJECT_MAPPING.forEach((k, v) -> { 100 | arr.add(new String[]{k.toString(), v}); 101 | }); 102 | return arr; 103 | } 104 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.controller; 2 | 3 | import com.earth.station.common.MD5Util; 4 | import com.earth.station.common.SessionUtil; 5 | import com.earth.station.model.StationUser; 6 | import com.earth.station.service.UserService; 7 | import javax.annotation.Resource; 8 | import javax.servlet.http.HttpServletRequest; 9 | import org.apache.log4j.Logger; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.ResponseBody; 13 | import org.springframework.web.servlet.ModelAndView; 14 | 15 | /** 16 | * @Description UserController 17 | * @Date 2020/5/23 18 | */ 19 | @Controller 20 | @RequestMapping("/user") 21 | public class UserController extends BaseController { 22 | private static final Logger LOG = Logger.getLogger(UserController.class); 23 | @Resource 24 | private UserService userService; 25 | 26 | /** 27 | * 用户修改密码页面 28 | * @param request 29 | * @return 30 | */ 31 | @RequestMapping("updatePage") 32 | public ModelAndView updatePage(HttpServletRequest request) { 33 | try { 34 | ModelAndView mv = new ModelAndView("user/update"); 35 | mv.addObject("entity", request.getSession().getAttribute(SessionUtil.user)); 36 | return mv; 37 | } catch (Exception e) { 38 | LOG.error(e.getMessage(), e); 39 | } 40 | return null; 41 | } 42 | 43 | 44 | /** 45 | * 修改 46 | * 47 | * @return 48 | */ 49 | @RequestMapping("/update") 50 | @ResponseBody 51 | public Object update(int id, String password, HttpServletRequest request) { 52 | try { 53 | StationUser entity = userService.getById(id); 54 | password = password.trim(); 55 | if(!password.equals(entity.getPassword())) { 56 | entity.setPassword(MD5Util.encrypt(password)); 57 | } 58 | userService.update(entity); 59 | //修改密码重新登陆 60 | request.getSession().removeAttribute(SessionUtil.user); 61 | return this.success(null); 62 | } catch (Exception e) { 63 | LOG.error(e.getMessage(), e); 64 | } 65 | return this.fail("修改失败!"); 66 | } 67 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/mapper/StationMapper.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.mapper; 2 | 3 | import com.earth.station.model.Station; 4 | import com.earth.station.model.StationCriteria; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface StationMapper { 9 | long countByExample(StationCriteria example); 10 | 11 | int deleteByExample(StationCriteria example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(Station record); 16 | 17 | int insertSelective(Station record); 18 | 19 | List selectByExample(StationCriteria example); 20 | 21 | Station selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") Station record, @Param("example") StationCriteria example); 24 | 25 | int updateByExample(@Param("record") Station record, @Param("example") StationCriteria example); 26 | 27 | int updateByPrimaryKeySelective(Station record); 28 | 29 | int updateByPrimaryKey(Station record); 30 | 31 | void batchInsert(@Param("items") List items); 32 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/mapper/StationUserMapper.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.mapper; 2 | 3 | import com.earth.station.model.StationUser; 4 | import com.earth.station.model.StationUserCriteria; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface StationUserMapper { 9 | long countByExample(StationUserCriteria example); 10 | 11 | int deleteByExample(StationUserCriteria example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(StationUser record); 16 | 17 | int insertSelective(StationUser record); 18 | 19 | List selectByExample(StationUserCriteria example); 20 | 21 | StationUser selectByPrimaryKey(Integer id); 22 | 23 | int updateByExampleSelective(@Param("record") StationUser record, @Param("example") StationUserCriteria example); 24 | 25 | int updateByExample(@Param("record") StationUser record, @Param("example") StationUserCriteria example); 26 | 27 | int updateByPrimaryKeySelective(StationUser record); 28 | 29 | int updateByPrimaryKey(StationUser record); 30 | 31 | void batchInsert(@Param("items") List items); 32 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/mapper/StationUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | and ${criterion.condition} 19 | 20 | 21 | and ${criterion.condition} #{criterion.value} 22 | 23 | 24 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 25 | 26 | 27 | and ${criterion.condition} 28 | 29 | #{listItem} 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | and ${criterion.condition} 48 | 49 | 50 | and ${criterion.condition} #{criterion.value} 51 | 52 | 53 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 54 | 55 | 56 | and ${criterion.condition} 57 | 58 | #{listItem} 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | id, user_name, password, level 70 | 71 | 88 | 94 | 95 | delete from station_user 96 | where id = #{id,jdbcType=INTEGER} 97 | 98 | 99 | delete from station_user 100 | 101 | 102 | 103 | 104 | 105 | insert into station_user (id, user_name, password, 106 | level) 107 | values (#{id,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, 108 | #{level,jdbcType=INTEGER}) 109 | 110 | 111 | insert into station_user 112 | 113 | 114 | id, 115 | 116 | 117 | user_name, 118 | 119 | 120 | password, 121 | 122 | 123 | level, 124 | 125 | 126 | 127 | 128 | #{id,jdbcType=INTEGER}, 129 | 130 | 131 | #{userName,jdbcType=VARCHAR}, 132 | 133 | 134 | #{password,jdbcType=VARCHAR}, 135 | 136 | 137 | #{level,jdbcType=INTEGER}, 138 | 139 | 140 | 141 | 147 | 148 | update station_user 149 | 150 | 151 | id = #{record.id,jdbcType=INTEGER}, 152 | 153 | 154 | user_name = #{record.userName,jdbcType=VARCHAR}, 155 | 156 | 157 | password = #{record.password,jdbcType=VARCHAR}, 158 | 159 | 160 | level = #{record.level,jdbcType=INTEGER}, 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | update station_user 169 | set id = #{record.id,jdbcType=INTEGER}, 170 | user_name = #{record.userName,jdbcType=VARCHAR}, 171 | password = #{record.password,jdbcType=VARCHAR}, 172 | level = #{record.level,jdbcType=INTEGER} 173 | 174 | 175 | 176 | 177 | 178 | update station_user 179 | 180 | 181 | user_name = #{userName,jdbcType=VARCHAR}, 182 | 183 | 184 | password = #{password,jdbcType=VARCHAR}, 185 | 186 | 187 | level = #{level,jdbcType=INTEGER}, 188 | 189 | 190 | where id = #{id,jdbcType=INTEGER} 191 | 192 | 193 | update station_user 194 | set user_name = #{userName,jdbcType=VARCHAR}, 195 | password = #{password,jdbcType=VARCHAR}, 196 | level = #{level,jdbcType=INTEGER} 197 | where id = #{id,jdbcType=INTEGER} 198 | 199 | 200 | 201 | insert into station_user (id, user_name, password, 202 | level) 203 | values 204 | 205 | (#{item.id,jdbcType=INTEGER}, #{item.userName,jdbcType=VARCHAR}, #{item.password,jdbcType=VARCHAR}, 206 | #{item.level,jdbcType=INTEGER}) 207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/mapper/SubjectMapper.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.mapper; 2 | 3 | import com.earth.station.model.Subject; 4 | import com.earth.station.model.SubjectCriteria; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface SubjectMapper { 9 | long countByExample(SubjectCriteria example); 10 | 11 | int deleteByExample(SubjectCriteria example); 12 | 13 | int deleteByPrimaryKey(Integer id); 14 | 15 | int insert(Subject record); 16 | 17 | int insertSelective(Subject record); 18 | 19 | List selectByExampleWithBLOBs(SubjectCriteria example); 20 | 21 | List selectByExample(SubjectCriteria example); 22 | 23 | Subject selectByPrimaryKey(Integer id); 24 | 25 | int updateByExampleSelective(@Param("record") Subject record, @Param("example") SubjectCriteria example); 26 | 27 | int updateByExampleWithBLOBs(@Param("record") Subject record, @Param("example") SubjectCriteria example); 28 | 29 | int updateByExample(@Param("record") Subject record, @Param("example") SubjectCriteria example); 30 | 31 | int updateByPrimaryKeySelective(Subject record); 32 | 33 | int updateByPrimaryKeyWithBLOBs(Subject record); 34 | 35 | int updateByPrimaryKey(Subject record); 36 | 37 | void batchInsert(@Param("items") List items); 38 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/mapper/SubjectMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | and ${criterion.condition} 21 | 22 | 23 | and ${criterion.condition} #{criterion.value} 24 | 25 | 26 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 27 | 28 | 29 | and ${criterion.condition} 30 | 31 | #{listItem} 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | and ${criterion.condition} 50 | 51 | 52 | and ${criterion.condition} #{criterion.value} 53 | 54 | 55 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 56 | 57 | 58 | and ${criterion.condition} 59 | 60 | #{listItem} 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | id, type, station_id 72 | 73 | 74 | content 75 | 76 | 95 | 112 | 120 | 121 | delete from subject 122 | where id = #{id,jdbcType=INTEGER} 123 | 124 | 125 | delete from subject 126 | 127 | 128 | 129 | 130 | 131 | 132 | SELECT LAST_INSERT_ID() 133 | 134 | insert into subject (type, station_id, content 135 | ) 136 | values (#{type,jdbcType=INTEGER}, #{stationId,jdbcType=INTEGER}, #{content,jdbcType=LONGVARCHAR} 137 | ) 138 | 139 | 140 | 141 | SELECT LAST_INSERT_ID() 142 | 143 | insert into subject 144 | 145 | 146 | type, 147 | 148 | 149 | station_id, 150 | 151 | 152 | content, 153 | 154 | 155 | 156 | 157 | #{type,jdbcType=INTEGER}, 158 | 159 | 160 | #{stationId,jdbcType=INTEGER}, 161 | 162 | 163 | #{content,jdbcType=LONGVARCHAR}, 164 | 165 | 166 | 167 | 173 | 174 | update subject 175 | 176 | 177 | id = #{record.id,jdbcType=INTEGER}, 178 | 179 | 180 | type = #{record.type,jdbcType=INTEGER}, 181 | 182 | 183 | station_id = #{record.stationId,jdbcType=INTEGER}, 184 | 185 | 186 | content = #{record.content,jdbcType=LONGVARCHAR}, 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | update subject 195 | set id = #{record.id,jdbcType=INTEGER}, 196 | type = #{record.type,jdbcType=INTEGER}, 197 | station_id = #{record.stationId,jdbcType=INTEGER}, 198 | content = #{record.content,jdbcType=LONGVARCHAR} 199 | 200 | 201 | 202 | 203 | 204 | update subject 205 | set id = #{record.id,jdbcType=INTEGER}, 206 | type = #{record.type,jdbcType=INTEGER}, 207 | station_id = #{record.stationId,jdbcType=INTEGER} 208 | 209 | 210 | 211 | 212 | 213 | update subject 214 | 215 | 216 | type = #{type,jdbcType=INTEGER}, 217 | 218 | 219 | station_id = #{stationId,jdbcType=INTEGER}, 220 | 221 | 222 | content = #{content,jdbcType=LONGVARCHAR}, 223 | 224 | 225 | where id = #{id,jdbcType=INTEGER} 226 | 227 | 228 | update subject 229 | set type = #{type,jdbcType=INTEGER}, 230 | station_id = #{stationId,jdbcType=INTEGER}, 231 | content = #{content,jdbcType=LONGVARCHAR} 232 | where id = #{id,jdbcType=INTEGER} 233 | 234 | 235 | update subject 236 | set type = #{type,jdbcType=INTEGER}, 237 | station_id = #{stationId,jdbcType=INTEGER} 238 | where id = #{id,jdbcType=INTEGER} 239 | 240 | 241 | 242 | insert into subject (type, station_id, content 243 | ) 244 | values 245 | 246 | (#{item.type,jdbcType=INTEGER}, #{item.stationId,jdbcType=INTEGER}, #{item.content,jdbcType=LONGVARCHAR} 247 | ) 248 | 249 | 250 | 251 | -------------------------------------------------------------------------------- /src/main/java/com/earth/station/model/Station.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.model; 2 | 3 | import java.io.Serializable; 4 | 5 | public class Station implements Serializable { 6 | private Integer id; 7 | 8 | private String stationNo; 9 | 10 | private String name; 11 | 12 | private String level; 13 | 14 | private String hasWatch; 15 | 16 | private String lat; 17 | 18 | private String lng; 19 | 20 | private String elevation; 21 | 22 | private String buildTime; 23 | 24 | private Integer testEq; 25 | 26 | private Integer strongEq; 27 | 28 | private Integer tm; 29 | 30 | private Integer liquid; 31 | 32 | private Integer gnss; 33 | 34 | private Integer gravity; 35 | 36 | private Integer deformation; 37 | 38 | private Integer aid; 39 | 40 | private static final long serialVersionUID = 1L; 41 | 42 | public Integer getId() { 43 | return id; 44 | } 45 | 46 | public void setId(Integer id) { 47 | this.id = id; 48 | } 49 | 50 | public String getStationNo() { 51 | return stationNo; 52 | } 53 | 54 | public void setStationNo(String stationNo) { 55 | this.stationNo = stationNo == null ? null : stationNo.trim(); 56 | } 57 | 58 | public String getName() { 59 | return name; 60 | } 61 | 62 | public void setName(String name) { 63 | this.name = name == null ? null : name.trim(); 64 | } 65 | 66 | public String getLevel() { 67 | return level; 68 | } 69 | 70 | public void setLevel(String level) { 71 | this.level = level == null ? null : level.trim(); 72 | } 73 | 74 | public String getHasWatch() { 75 | return hasWatch; 76 | } 77 | 78 | public void setHasWatch(String hasWatch) { 79 | this.hasWatch = hasWatch == null ? null : hasWatch.trim(); 80 | } 81 | 82 | public String getLat() { 83 | return lat; 84 | } 85 | 86 | public void setLat(String lat) { 87 | this.lat = lat == null ? null : lat.trim(); 88 | } 89 | 90 | public String getLng() { 91 | return lng; 92 | } 93 | 94 | public void setLng(String lng) { 95 | this.lng = lng == null ? null : lng.trim(); 96 | } 97 | 98 | public String getElevation() { 99 | return elevation; 100 | } 101 | 102 | public void setElevation(String elevation) { 103 | this.elevation = elevation == null ? null : elevation.trim(); 104 | } 105 | 106 | public String getBuildTime() { 107 | return buildTime; 108 | } 109 | 110 | public void setBuildTime(String buildTime) { 111 | this.buildTime = buildTime == null ? null : buildTime.trim(); 112 | } 113 | 114 | public Integer getTestEq() { 115 | return testEq; 116 | } 117 | 118 | public void setTestEq(Integer testEq) { 119 | this.testEq = testEq; 120 | } 121 | 122 | public Integer getStrongEq() { 123 | return strongEq; 124 | } 125 | 126 | public void setStrongEq(Integer strongEq) { 127 | this.strongEq = strongEq; 128 | } 129 | 130 | public Integer getTm() { 131 | return tm; 132 | } 133 | 134 | public void setTm(Integer tm) { 135 | this.tm = tm; 136 | } 137 | 138 | public Integer getLiquid() { 139 | return liquid; 140 | } 141 | 142 | public void setLiquid(Integer liquid) { 143 | this.liquid = liquid; 144 | } 145 | 146 | public Integer getGnss() { 147 | return gnss; 148 | } 149 | 150 | public void setGnss(Integer gnss) { 151 | this.gnss = gnss; 152 | } 153 | 154 | public Integer getGravity() { 155 | return gravity; 156 | } 157 | 158 | public void setGravity(Integer gravity) { 159 | this.gravity = gravity; 160 | } 161 | 162 | public Integer getDeformation() { 163 | return deformation; 164 | } 165 | 166 | public void setDeformation(Integer deformation) { 167 | this.deformation = deformation; 168 | } 169 | 170 | public Integer getAid() { 171 | return aid; 172 | } 173 | 174 | public void setAid(Integer aid) { 175 | this.aid = aid; 176 | } 177 | 178 | @Override 179 | public boolean equals(Object that) { 180 | if (this == that) { 181 | return true; 182 | } 183 | if (that == null) { 184 | return false; 185 | } 186 | if (getClass() != that.getClass()) { 187 | return false; 188 | } 189 | Station other = (Station) that; 190 | return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) 191 | && (this.getStationNo() == null ? other.getStationNo() == null : this.getStationNo().equals(other.getStationNo())) 192 | && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) 193 | && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel())) 194 | && (this.getHasWatch() == null ? other.getHasWatch() == null : this.getHasWatch().equals(other.getHasWatch())) 195 | && (this.getLat() == null ? other.getLat() == null : this.getLat().equals(other.getLat())) 196 | && (this.getLng() == null ? other.getLng() == null : this.getLng().equals(other.getLng())) 197 | && (this.getElevation() == null ? other.getElevation() == null : this.getElevation().equals(other.getElevation())) 198 | && (this.getBuildTime() == null ? other.getBuildTime() == null : this.getBuildTime().equals(other.getBuildTime())) 199 | && (this.getTestEq() == null ? other.getTestEq() == null : this.getTestEq().equals(other.getTestEq())) 200 | && (this.getStrongEq() == null ? other.getStrongEq() == null : this.getStrongEq().equals(other.getStrongEq())) 201 | && (this.getTm() == null ? other.getTm() == null : this.getTm().equals(other.getTm())) 202 | && (this.getLiquid() == null ? other.getLiquid() == null : this.getLiquid().equals(other.getLiquid())) 203 | && (this.getGnss() == null ? other.getGnss() == null : this.getGnss().equals(other.getGnss())) 204 | && (this.getGravity() == null ? other.getGravity() == null : this.getGravity().equals(other.getGravity())) 205 | && (this.getDeformation() == null ? other.getDeformation() == null : this.getDeformation().equals(other.getDeformation())) 206 | && (this.getAid() == null ? other.getAid() == null : this.getAid().equals(other.getAid())); 207 | } 208 | 209 | @Override 210 | public int hashCode() { 211 | final int prime = 31; 212 | int result = 1; 213 | result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); 214 | result = prime * result + ((getStationNo() == null) ? 0 : getStationNo().hashCode()); 215 | result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); 216 | result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode()); 217 | result = prime * result + ((getHasWatch() == null) ? 0 : getHasWatch().hashCode()); 218 | result = prime * result + ((getLat() == null) ? 0 : getLat().hashCode()); 219 | result = prime * result + ((getLng() == null) ? 0 : getLng().hashCode()); 220 | result = prime * result + ((getElevation() == null) ? 0 : getElevation().hashCode()); 221 | result = prime * result + ((getBuildTime() == null) ? 0 : getBuildTime().hashCode()); 222 | result = prime * result + ((getTestEq() == null) ? 0 : getTestEq().hashCode()); 223 | result = prime * result + ((getStrongEq() == null) ? 0 : getStrongEq().hashCode()); 224 | result = prime * result + ((getTm() == null) ? 0 : getTm().hashCode()); 225 | result = prime * result + ((getLiquid() == null) ? 0 : getLiquid().hashCode()); 226 | result = prime * result + ((getGnss() == null) ? 0 : getGnss().hashCode()); 227 | result = prime * result + ((getGravity() == null) ? 0 : getGravity().hashCode()); 228 | result = prime * result + ((getDeformation() == null) ? 0 : getDeformation().hashCode()); 229 | result = prime * result + ((getAid() == null) ? 0 : getAid().hashCode()); 230 | return result; 231 | } 232 | 233 | @Override 234 | public String toString() { 235 | StringBuilder sb = new StringBuilder(); 236 | sb.append(getClass().getSimpleName()); 237 | sb.append(" ["); 238 | sb.append("Hash = ").append(hashCode()); 239 | sb.append(", id=").append(id); 240 | sb.append(", stationNo=").append(stationNo); 241 | sb.append(", name=").append(name); 242 | sb.append(", level=").append(level); 243 | sb.append(", hasWatch=").append(hasWatch); 244 | sb.append(", lat=").append(lat); 245 | sb.append(", lng=").append(lng); 246 | sb.append(", elevation=").append(elevation); 247 | sb.append(", buildTime=").append(buildTime); 248 | sb.append(", testEq=").append(testEq); 249 | sb.append(", strongEq=").append(strongEq); 250 | sb.append(", tm=").append(tm); 251 | sb.append(", liquid=").append(liquid); 252 | sb.append(", gnss=").append(gnss); 253 | sb.append(", gravity=").append(gravity); 254 | sb.append(", deformation=").append(deformation); 255 | sb.append(", aid=").append(aid); 256 | sb.append(", serialVersionUID=").append(serialVersionUID); 257 | sb.append("]"); 258 | return sb.toString(); 259 | } 260 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/model/StationUser.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.model; 2 | 3 | import java.io.Serializable; 4 | 5 | public class StationUser implements Serializable { 6 | private Integer id; 7 | 8 | private String userName; 9 | 10 | private String password; 11 | 12 | private Integer level; 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | public Integer getId() { 17 | return id; 18 | } 19 | 20 | public void setId(Integer id) { 21 | this.id = id; 22 | } 23 | 24 | public String getUserName() { 25 | return userName; 26 | } 27 | 28 | public void setUserName(String userName) { 29 | this.userName = userName == null ? null : userName.trim(); 30 | } 31 | 32 | public String getPassword() { 33 | return password; 34 | } 35 | 36 | public void setPassword(String password) { 37 | this.password = password == null ? null : password.trim(); 38 | } 39 | 40 | public Integer getLevel() { 41 | return level; 42 | } 43 | 44 | public void setLevel(Integer level) { 45 | this.level = level; 46 | } 47 | 48 | @Override 49 | public boolean equals(Object that) { 50 | if (this == that) { 51 | return true; 52 | } 53 | if (that == null) { 54 | return false; 55 | } 56 | if (getClass() != that.getClass()) { 57 | return false; 58 | } 59 | StationUser other = (StationUser) that; 60 | return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) 61 | && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName())) 62 | && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword())) 63 | && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel())); 64 | } 65 | 66 | @Override 67 | public int hashCode() { 68 | final int prime = 31; 69 | int result = 1; 70 | result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); 71 | result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode()); 72 | result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode()); 73 | result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode()); 74 | return result; 75 | } 76 | 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append(getClass().getSimpleName()); 81 | sb.append(" ["); 82 | sb.append("Hash = ").append(hashCode()); 83 | sb.append(", id=").append(id); 84 | sb.append(", userName=").append(userName); 85 | sb.append(", password=").append(password); 86 | sb.append(", level=").append(level); 87 | sb.append(", serialVersionUID=").append(serialVersionUID); 88 | sb.append("]"); 89 | return sb.toString(); 90 | } 91 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/model/Subject.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.model; 2 | 3 | import java.io.Serializable; 4 | 5 | public class Subject implements Serializable { 6 | private Integer id; 7 | 8 | private Integer type; 9 | 10 | private Integer stationId; 11 | 12 | private String content; 13 | 14 | private static final long serialVersionUID = 1L; 15 | 16 | public Integer getId() { 17 | return id; 18 | } 19 | 20 | public void setId(Integer id) { 21 | this.id = id; 22 | } 23 | 24 | public Integer getType() { 25 | return type; 26 | } 27 | 28 | public void setType(Integer type) { 29 | this.type = type; 30 | } 31 | 32 | public Integer getStationId() { 33 | return stationId; 34 | } 35 | 36 | public void setStationId(Integer stationId) { 37 | this.stationId = stationId; 38 | } 39 | 40 | public String getContent() { 41 | return content; 42 | } 43 | 44 | public void setContent(String content) { 45 | this.content = content == null ? null : content.trim(); 46 | } 47 | 48 | @Override 49 | public boolean equals(Object that) { 50 | if (this == that) { 51 | return true; 52 | } 53 | if (that == null) { 54 | return false; 55 | } 56 | if (getClass() != that.getClass()) { 57 | return false; 58 | } 59 | Subject other = (Subject) that; 60 | return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) 61 | && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) 62 | && (this.getStationId() == null ? other.getStationId() == null : this.getStationId().equals(other.getStationId())) 63 | && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent())); 64 | } 65 | 66 | @Override 67 | public int hashCode() { 68 | final int prime = 31; 69 | int result = 1; 70 | result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); 71 | result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); 72 | result = prime * result + ((getStationId() == null) ? 0 : getStationId().hashCode()); 73 | result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode()); 74 | return result; 75 | } 76 | 77 | @Override 78 | public String toString() { 79 | StringBuilder sb = new StringBuilder(); 80 | sb.append(getClass().getSimpleName()); 81 | sb.append(" ["); 82 | sb.append("Hash = ").append(hashCode()); 83 | sb.append(", id=").append(id); 84 | sb.append(", type=").append(type); 85 | sb.append(", stationId=").append(stationId); 86 | sb.append(", content=").append(content); 87 | sb.append(", serialVersionUID=").append(serialVersionUID); 88 | sb.append("]"); 89 | return sb.toString(); 90 | } 91 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/model/SubjectCriteria.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.model; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class SubjectCriteria { 7 | protected String orderByClause; 8 | 9 | protected boolean distinct; 10 | 11 | protected List oredCriteria; 12 | 13 | private Integer offset; 14 | 15 | private Integer limit; 16 | 17 | public SubjectCriteria() { 18 | oredCriteria = new ArrayList(); 19 | } 20 | 21 | public void setOrderByClause(String orderByClause) { 22 | this.orderByClause = orderByClause; 23 | } 24 | 25 | public String getOrderByClause() { 26 | return orderByClause; 27 | } 28 | 29 | public void setDistinct(boolean distinct) { 30 | this.distinct = distinct; 31 | } 32 | 33 | public boolean isDistinct() { 34 | return distinct; 35 | } 36 | 37 | public List getOredCriteria() { 38 | return oredCriteria; 39 | } 40 | 41 | public void or(Criteria criteria) { 42 | oredCriteria.add(criteria); 43 | } 44 | 45 | public Criteria or() { 46 | Criteria criteria = createCriteriaInternal(); 47 | oredCriteria.add(criteria); 48 | return criteria; 49 | } 50 | 51 | public Criteria createCriteria() { 52 | Criteria criteria = createCriteriaInternal(); 53 | if (oredCriteria.size() == 0) { 54 | oredCriteria.add(criteria); 55 | } 56 | return criteria; 57 | } 58 | 59 | protected Criteria createCriteriaInternal() { 60 | Criteria criteria = new Criteria(); 61 | return criteria; 62 | } 63 | 64 | public void clear() { 65 | oredCriteria.clear(); 66 | orderByClause = null; 67 | distinct = false; 68 | this.offset = null; 69 | this.limit = null; 70 | } 71 | 72 | public Integer getOffset() { 73 | return this.offset; 74 | } 75 | 76 | public void setOffset(Integer offset) { 77 | this.offset = offset; 78 | } 79 | 80 | public Integer getLimit() { 81 | return this.limit; 82 | } 83 | 84 | public void setLimit(Integer limit) { 85 | this.limit = limit; 86 | } 87 | 88 | public SubjectCriteria page(int offset, int limit) { 89 | this.offset = offset; 90 | this.limit = limit; 91 | return this; 92 | } 93 | 94 | protected abstract static class GeneratedCriteria { 95 | protected List criteria; 96 | 97 | protected GeneratedCriteria() { 98 | super(); 99 | criteria = new ArrayList(); 100 | } 101 | 102 | public boolean isValid() { 103 | return criteria.size() > 0; 104 | } 105 | 106 | public List getAllCriteria() { 107 | return criteria; 108 | } 109 | 110 | public List getCriteria() { 111 | return criteria; 112 | } 113 | 114 | protected void addCriterion(String condition) { 115 | if (condition == null) { 116 | throw new RuntimeException("Value for condition cannot be null"); 117 | } 118 | criteria.add(new Criterion(condition)); 119 | } 120 | 121 | protected void addCriterion(String condition, Object value, String property) { 122 | if (value == null) { 123 | throw new RuntimeException("Value for " + property + " cannot be null"); 124 | } 125 | criteria.add(new Criterion(condition, value)); 126 | } 127 | 128 | protected void addCriterion(String condition, Object value1, Object value2, String property) { 129 | if (value1 == null || value2 == null) { 130 | throw new RuntimeException("Between values for " + property + " cannot be null"); 131 | } 132 | criteria.add(new Criterion(condition, value1, value2)); 133 | } 134 | 135 | public Criteria andIdIsNull() { 136 | addCriterion("id is null"); 137 | return (Criteria) this; 138 | } 139 | 140 | public Criteria andIdIsNotNull() { 141 | addCriterion("id is not null"); 142 | return (Criteria) this; 143 | } 144 | 145 | public Criteria andIdEqualTo(Integer value) { 146 | addCriterion("id =", value, "id"); 147 | return (Criteria) this; 148 | } 149 | 150 | public Criteria andIdNotEqualTo(Integer value) { 151 | addCriterion("id <>", value, "id"); 152 | return (Criteria) this; 153 | } 154 | 155 | public Criteria andIdGreaterThan(Integer value) { 156 | addCriterion("id >", value, "id"); 157 | return (Criteria) this; 158 | } 159 | 160 | public Criteria andIdGreaterThanOrEqualTo(Integer value) { 161 | addCriterion("id >=", value, "id"); 162 | return (Criteria) this; 163 | } 164 | 165 | public Criteria andIdLessThan(Integer value) { 166 | addCriterion("id <", value, "id"); 167 | return (Criteria) this; 168 | } 169 | 170 | public Criteria andIdLessThanOrEqualTo(Integer value) { 171 | addCriterion("id <=", value, "id"); 172 | return (Criteria) this; 173 | } 174 | 175 | public Criteria andIdIn(List values) { 176 | addCriterion("id in", values, "id"); 177 | return (Criteria) this; 178 | } 179 | 180 | public Criteria andIdNotIn(List values) { 181 | addCriterion("id not in", values, "id"); 182 | return (Criteria) this; 183 | } 184 | 185 | public Criteria andIdBetween(Integer value1, Integer value2) { 186 | addCriterion("id between", value1, value2, "id"); 187 | return (Criteria) this; 188 | } 189 | 190 | public Criteria andIdNotBetween(Integer value1, Integer value2) { 191 | addCriterion("id not between", value1, value2, "id"); 192 | return (Criteria) this; 193 | } 194 | 195 | public Criteria andTypeIsNull() { 196 | addCriterion("type is null"); 197 | return (Criteria) this; 198 | } 199 | 200 | public Criteria andTypeIsNotNull() { 201 | addCriterion("type is not null"); 202 | return (Criteria) this; 203 | } 204 | 205 | public Criteria andTypeEqualTo(Integer value) { 206 | addCriterion("type =", value, "type"); 207 | return (Criteria) this; 208 | } 209 | 210 | public Criteria andTypeNotEqualTo(Integer value) { 211 | addCriterion("type <>", value, "type"); 212 | return (Criteria) this; 213 | } 214 | 215 | public Criteria andTypeGreaterThan(Integer value) { 216 | addCriterion("type >", value, "type"); 217 | return (Criteria) this; 218 | } 219 | 220 | public Criteria andTypeGreaterThanOrEqualTo(Integer value) { 221 | addCriterion("type >=", value, "type"); 222 | return (Criteria) this; 223 | } 224 | 225 | public Criteria andTypeLessThan(Integer value) { 226 | addCriterion("type <", value, "type"); 227 | return (Criteria) this; 228 | } 229 | 230 | public Criteria andTypeLessThanOrEqualTo(Integer value) { 231 | addCriterion("type <=", value, "type"); 232 | return (Criteria) this; 233 | } 234 | 235 | public Criteria andTypeIn(List values) { 236 | addCriterion("type in", values, "type"); 237 | return (Criteria) this; 238 | } 239 | 240 | public Criteria andTypeNotIn(List values) { 241 | addCriterion("type not in", values, "type"); 242 | return (Criteria) this; 243 | } 244 | 245 | public Criteria andTypeBetween(Integer value1, Integer value2) { 246 | addCriterion("type between", value1, value2, "type"); 247 | return (Criteria) this; 248 | } 249 | 250 | public Criteria andTypeNotBetween(Integer value1, Integer value2) { 251 | addCriterion("type not between", value1, value2, "type"); 252 | return (Criteria) this; 253 | } 254 | 255 | public Criteria andStationIdIsNull() { 256 | addCriterion("station_id is null"); 257 | return (Criteria) this; 258 | } 259 | 260 | public Criteria andStationIdIsNotNull() { 261 | addCriterion("station_id is not null"); 262 | return (Criteria) this; 263 | } 264 | 265 | public Criteria andStationIdEqualTo(Integer value) { 266 | addCriterion("station_id =", value, "stationId"); 267 | return (Criteria) this; 268 | } 269 | 270 | public Criteria andStationIdNotEqualTo(Integer value) { 271 | addCriterion("station_id <>", value, "stationId"); 272 | return (Criteria) this; 273 | } 274 | 275 | public Criteria andStationIdGreaterThan(Integer value) { 276 | addCriterion("station_id >", value, "stationId"); 277 | return (Criteria) this; 278 | } 279 | 280 | public Criteria andStationIdGreaterThanOrEqualTo(Integer value) { 281 | addCriterion("station_id >=", value, "stationId"); 282 | return (Criteria) this; 283 | } 284 | 285 | public Criteria andStationIdLessThan(Integer value) { 286 | addCriterion("station_id <", value, "stationId"); 287 | return (Criteria) this; 288 | } 289 | 290 | public Criteria andStationIdLessThanOrEqualTo(Integer value) { 291 | addCriterion("station_id <=", value, "stationId"); 292 | return (Criteria) this; 293 | } 294 | 295 | public Criteria andStationIdIn(List values) { 296 | addCriterion("station_id in", values, "stationId"); 297 | return (Criteria) this; 298 | } 299 | 300 | public Criteria andStationIdNotIn(List values) { 301 | addCriterion("station_id not in", values, "stationId"); 302 | return (Criteria) this; 303 | } 304 | 305 | public Criteria andStationIdBetween(Integer value1, Integer value2) { 306 | addCriterion("station_id between", value1, value2, "stationId"); 307 | return (Criteria) this; 308 | } 309 | 310 | public Criteria andStationIdNotBetween(Integer value1, Integer value2) { 311 | addCriterion("station_id not between", value1, value2, "stationId"); 312 | return (Criteria) this; 313 | } 314 | } 315 | 316 | public static class Criteria extends GeneratedCriteria { 317 | 318 | protected Criteria() { 319 | super(); 320 | } 321 | } 322 | 323 | public static class Criterion { 324 | private String condition; 325 | 326 | private Object value; 327 | 328 | private Object secondValue; 329 | 330 | private boolean noValue; 331 | 332 | private boolean singleValue; 333 | 334 | private boolean betweenValue; 335 | 336 | private boolean listValue; 337 | 338 | private String typeHandler; 339 | 340 | public String getCondition() { 341 | return condition; 342 | } 343 | 344 | public Object getValue() { 345 | return value; 346 | } 347 | 348 | public Object getSecondValue() { 349 | return secondValue; 350 | } 351 | 352 | public boolean isNoValue() { 353 | return noValue; 354 | } 355 | 356 | public boolean isSingleValue() { 357 | return singleValue; 358 | } 359 | 360 | public boolean isBetweenValue() { 361 | return betweenValue; 362 | } 363 | 364 | public boolean isListValue() { 365 | return listValue; 366 | } 367 | 368 | public String getTypeHandler() { 369 | return typeHandler; 370 | } 371 | 372 | protected Criterion(String condition) { 373 | super(); 374 | this.condition = condition; 375 | this.typeHandler = null; 376 | this.noValue = true; 377 | } 378 | 379 | protected Criterion(String condition, Object value, String typeHandler) { 380 | super(); 381 | this.condition = condition; 382 | this.value = value; 383 | this.typeHandler = typeHandler; 384 | if (value instanceof List) { 385 | this.listValue = true; 386 | } else { 387 | this.singleValue = true; 388 | } 389 | } 390 | 391 | protected Criterion(String condition, Object value) { 392 | this(condition, value, null); 393 | } 394 | 395 | protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { 396 | super(); 397 | this.condition = condition; 398 | this.value = value; 399 | this.secondValue = secondValue; 400 | this.typeHandler = typeHandler; 401 | this.betweenValue = true; 402 | } 403 | 404 | protected Criterion(String condition, Object value, Object secondValue) { 405 | this(condition, value, secondValue, null); 406 | } 407 | } 408 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/service/StationService.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.service; 2 | 3 | import com.earth.station.common.constant.SubjectConstant; 4 | import com.earth.station.mapper.StationMapper; 5 | import com.earth.station.model.Station; 6 | import com.earth.station.model.StationCriteria; 7 | import java.util.List; 8 | import javax.annotation.Resource; 9 | import org.apache.commons.lang3.StringUtils; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | /** 14 | * @Description StationService 15 | * @Author yeyu 16 | * @Date 2020/5/23 17 | */ 18 | @Service 19 | public class StationService { 20 | 21 | @Resource 22 | private StationMapper stationMapper; 23 | @Resource 24 | private SubjectService subjectService; 25 | 26 | public List search(String name, Integer subject) { 27 | StationCriteria example = new StationCriteria(); 28 | StationCriteria.Criteria criteria = example.createCriteria(); 29 | if (StringUtils.isNotBlank(name)) { 30 | criteria.andNameLike("%" + name + "%"); 31 | } 32 | if (SubjectConstant.AID.equals(subject)) { 33 | criteria.andAidNotEqualTo(0); 34 | } else if (SubjectConstant.DEFORMATION.equals(subject)) { 35 | criteria.andDeformationNotEqualTo(0); 36 | } else if (SubjectConstant.GNSS.equals(subject)) { 37 | criteria.andGnssNotEqualTo(0); 38 | } else if (SubjectConstant.GRAVITY.equals(subject)) { 39 | criteria.andGravityNotEqualTo(0); 40 | } else if (SubjectConstant.LIQUID.equals(subject)) { 41 | criteria.andLiquidNotEqualTo(0); 42 | } else if (SubjectConstant.STRONG_EQ.equals(subject)) { 43 | criteria.andStrongEqNotEqualTo(0); 44 | } else if (SubjectConstant.TEST_EQ.equals(subject)) { 45 | criteria.andTestEqNotEqualTo(0); 46 | } else if (SubjectConstant.TM.equals(subject)) { 47 | criteria.andTmNotEqualTo(0); 48 | } 49 | return stationMapper.selectByExample(example); 50 | } 51 | 52 | public void save(Station station) { 53 | stationMapper.insertSelective(station); 54 | } 55 | 56 | public Station getById(Integer id) { 57 | return stationMapper.selectByPrimaryKey(id); 58 | } 59 | 60 | public void update(Station station) { 61 | if (station == null || station.getId() == null || station.getId() ==0) { 62 | return; 63 | } 64 | stationMapper.updateByPrimaryKeySelective(station); 65 | } 66 | 67 | @Transactional(rollbackFor = Exception.class) 68 | public void delete(Integer id) { 69 | stationMapper.deleteByPrimaryKey(id); 70 | subjectService.deleteByStationId(id); 71 | } 72 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/service/SubjectService.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.service; 2 | 3 | import static com.earth.station.common.constant.SubjectConstant.AID; 4 | import static com.earth.station.common.constant.SubjectConstant.DEFORMATION; 5 | import static com.earth.station.common.constant.SubjectConstant.GNSS; 6 | import static com.earth.station.common.constant.SubjectConstant.GRAVITY; 7 | import static com.earth.station.common.constant.SubjectConstant.LIQUID; 8 | import static com.earth.station.common.constant.SubjectConstant.STRONG_EQ; 9 | import static com.earth.station.common.constant.SubjectConstant.TEST_EQ; 10 | import static com.earth.station.common.constant.SubjectConstant.TM; 11 | 12 | import com.earth.station.mapper.SubjectMapper; 13 | import com.earth.station.model.Station; 14 | import com.earth.station.model.Subject; 15 | import com.earth.station.model.SubjectCriteria; 16 | import javax.annotation.Resource; 17 | import org.springframework.stereotype.Service; 18 | import org.springframework.transaction.annotation.Transactional; 19 | 20 | /** 21 | * @Description SubectService 22 | * @Author yeyu 23 | * @Date 2020/5/23 24 | */ 25 | @Service 26 | public class SubjectService { 27 | 28 | @Resource 29 | private SubjectMapper subjectMapper; 30 | @Resource 31 | private StationService stationService; 32 | 33 | @Transactional(rollbackFor = Exception.class) 34 | public void save(Subject subject) { 35 | Station station = stationService.getById(subject.getStationId()); 36 | if (station == null) { 37 | return; 38 | } 39 | subjectMapper.insertSelective(subject); 40 | setStationSubject(station, subject.getType(), subject.getId()); 41 | stationService.update(station); 42 | } 43 | 44 | private void setStationSubject(Station station, Integer type, Integer subjectId) { 45 | 46 | if (TEST_EQ.equals(type)) { 47 | station.setTestEq(subjectId); 48 | }else if (STRONG_EQ.equals(type)) { 49 | station.setStrongEq(subjectId); 50 | } else if (GNSS.equals(type)) { 51 | station.setGnss(subjectId); 52 | } else if (GRAVITY.equals(type)) { 53 | station.setGravity(subjectId); 54 | } else if (AID.equals(type)) { 55 | station.setAid(subjectId); 56 | } else if (DEFORMATION.equals(type)) { 57 | station.setDeformation(subjectId); 58 | } else if (LIQUID.equals(type)) { 59 | station.setLiquid(subjectId); 60 | } else if (TM.equals(type)) { 61 | station.setTm(subjectId); 62 | } 63 | } 64 | 65 | @Transactional(rollbackFor = Exception.class) 66 | public void deleteByStationId(Integer stationId) { 67 | SubjectCriteria example = new SubjectCriteria(); 68 | example.createCriteria().andStationIdEqualTo(stationId); 69 | subjectMapper.deleteByExample(example); 70 | } 71 | 72 | @Transactional(rollbackFor = Exception.class) 73 | public void deleteById(Integer id) { 74 | Subject subject = getById(id); 75 | Station station = stationService.getById(subject.getStationId()); 76 | setStationSubject(station, subject.getType(), 0); 77 | stationService.update(station); 78 | subjectMapper.deleteByPrimaryKey(id); 79 | } 80 | 81 | public Subject getById(Integer id) { 82 | return subjectMapper.selectByPrimaryKey(id); 83 | } 84 | 85 | @Transactional(rollbackFor = Exception.class) 86 | public void update(Subject subject) { 87 | subjectMapper.updateByPrimaryKeySelective(subject); 88 | } 89 | } -------------------------------------------------------------------------------- /src/main/java/com/earth/station/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.earth.station.service; 2 | 3 | import com.earth.station.mapper.StationUserMapper; 4 | import com.earth.station.model.StationUser; 5 | import com.earth.station.model.StationUserCriteria; 6 | import java.util.List; 7 | import javax.annotation.Resource; 8 | import org.apache.commons.lang3.StringUtils; 9 | import org.springframework.stereotype.Service; 10 | import org.springframework.transaction.annotation.Transactional; 11 | import org.springframework.util.CollectionUtils; 12 | 13 | /** 14 | * @Description UserService 15 | * @Author yeyu 16 | * @Date 2020/5/23 17 | */ 18 | @Service 19 | public class UserService { 20 | @Resource 21 | private StationUserMapper stationUserMapper; 22 | 23 | public StationUser getByUserName(String userName) { 24 | if (StringUtils.isBlank(userName)) { 25 | return null; 26 | } 27 | 28 | StationUserCriteria example = new StationUserCriteria(); 29 | example.createCriteria().andUserNameEqualTo(userName); 30 | List list = stationUserMapper.selectByExample(example); 31 | if (CollectionUtils.isEmpty(list)) { 32 | return null; 33 | } 34 | return list.get(0); 35 | } 36 | 37 | public StationUser getById(int id) { 38 | return stationUserMapper.selectByPrimaryKey(id); 39 | } 40 | 41 | @Transactional(rollbackFor = Exception.class) 42 | public void update(StationUser user) { 43 | if (user == null) { 44 | return; 45 | } 46 | stationUserMapper.updateByPrimaryKeySelective(user); 47 | } 48 | } -------------------------------------------------------------------------------- /src/main/resources/generatorConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
64 |
65 |
66 | -------------------------------------------------------------------------------- /src/main/resources/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc.url=jdbc:mysql://localhost:3306/graduation_earth_station?&useSSL=false&serverTimezone=UTC 2 | jdbc.username=root 3 | jdbc.password=123456 4 | 5 | generate.mapper=com.earth.station.mapper 6 | generate.model=com.earth.station.model -------------------------------------------------------------------------------- /src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger = debug,file,stdout 2 | #log4j.rootLogger = error,file,stdout 3 | 4 | log4j.appender.file = org.apache.log4j.RollingFileAppender 5 | log4j.appender.file.File = /tmp/log.log 6 | log4j.appender.file.MaxFileSize = 10MB 7 | log4j.appender.file.MaxBackupIndex = 20 8 | log4j.appender.file.Append = true 9 | log4j.appender.file.layout = org.apache.log4j.PatternLayout 10 | log4j.appender.file.layout.ConversionPattern = %-d{yyyy-MM-dd HH\:mm\:ss} [%c]-[%p] [%t] (%F\:%L)->%m %n 11 | 12 | log4j.appender.stdout = org.apache.log4j.ConsoleAppender 13 | log4j.appender.stdout.Llayout = org.apache.log4j.PatternLayout -------------------------------------------------------------------------------- /src/main/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/spring-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | /login.html 33 | /doLogin.html 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | text/html;charset=UTF-8 46 | application/json 47 | application/xml;charset=UTF-8 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | classpath:jdbc.properties 57 | 58 | 59 | 60 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/index.tld: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2.2.3 5 | 1.2 6 | my 7 | /y 8 | "index Tags" 9 | 10 | pagelink 11 | com.earth.station.common.tags.Pagelink 12 | jsp 13 | 14 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | Archetype Created Web Application 7 | 8 | 9 | characterEncoding 10 | org.springframework.web.filter.CharacterEncodingFilter 11 | 12 | encoding 13 | UTF-8 14 | 15 | 16 | 17 | characterEncoding 18 | *.html 19 | 20 | 21 | spring4 22 | org.springframework.web.servlet.DispatcherServlet 23 | 24 | contextConfigLocation 25 | classpath:spring-context.xml 26 | 27 | 1 28 | 29 | 30 | spring4 31 | *.html 32 | 33 | 34 | 60 35 | 36 | 37 | 38 | /index.html 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/webapp/source/css/common.css: -------------------------------------------------------------------------------- 1 | *{ 2 | padding:0; 3 | margin:0; 4 | border:0; 5 | font-family:Microsoft YaHei; 6 | font-size: 14px; 7 | 8 | } 9 | .hide{ 10 | display: none; 11 | } 12 | a{ 13 | text-decoration: none; 14 | outline: 0; 15 | } 16 | .pagination{ 17 | left: 0; 18 | z-index: 5; 19 | position: fixed; 20 | bottom: 0; 21 | border-top: 1px solid #dbe3e9; 22 | border-bottom: 1px solid #dbe3e9; 23 | background-color: #f3f7fb; 24 | height: 50px; 25 | width: 100%; 26 | } 27 | .pagination-inner{ 28 | display: flex; 29 | justify-content: flex-end; 30 | margin: 0 30px 0 0 ; 31 | align-items: center; 32 | height: 100%; 33 | } 34 | .pagination-inner > *{ 35 | display: inline-block; 36 | width: 30px; 37 | height: 30px; 38 | line-height: 30px; 39 | text-decoration: none; 40 | border:1px solid #dcdcdc; 41 | text-align: center; 42 | margin-left: 7px; 43 | color: #404241; 44 | font-size: 15px; 45 | } 46 | .pagination-inner .current{ 47 | color: #fff; 48 | background-color: #51d2b7; 49 | border-color: #e7e7e7; 50 | } 51 | .pagination-inner .next, .pagination-inner .last{ 52 | width: 60px; 53 | } 54 | .pagination-inner>a:hover,.pagination-inner>a:focus { 55 | z-index: 2; 56 | background-color: #eee; 57 | border-color: #ddd 58 | } 59 | 60 | /*sweetalert2 */ 61 | .swal2-container{ 62 | z-index: 11060 !important; 63 | } -------------------------------------------------------------------------------- /src/main/webapp/source/image/header_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GeophysicalStationManagementSystem/cfb6c7252402e5c6635b8c23b809802ff86b55b3/src/main/webapp/source/image/header_icon.png -------------------------------------------------------------------------------- /src/main/webapp/source/js/base64.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Base64 encode / decode 4 | * 5 | * @author haitao.tu 6 | * @date 2010-04-26 7 | * @email tuhaitao@foxmail.com 8 | * 9 | */ 10 | 11 | function Base64() { 12 | 13 | // private property 14 | _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; 15 | 16 | // public method for encoding 17 | this.encode = function (input) { 18 | var output = ""; 19 | var chr1, chr2, chr3, enc1, enc2, enc3, enc4; 20 | var i = 0; 21 | input = _utf8_encode(input); 22 | while (i < input.length) { 23 | chr1 = input.charCodeAt(i++); 24 | chr2 = input.charCodeAt(i++); 25 | chr3 = input.charCodeAt(i++); 26 | enc1 = chr1 >> 2; 27 | enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 28 | enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 29 | enc4 = chr3 & 63; 30 | if (isNaN(chr2)) { 31 | enc3 = enc4 = 64; 32 | } else if (isNaN(chr3)) { 33 | enc4 = 64; 34 | } 35 | output = output + 36 | _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + 37 | _keyStr.charAt(enc3) + _keyStr.charAt(enc4); 38 | } 39 | return output; 40 | } 41 | 42 | // public method for decoding 43 | this.decode = function (input) { 44 | var output = ""; 45 | var chr1, chr2, chr3; 46 | var enc1, enc2, enc3, enc4; 47 | var i = 0; 48 | input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); 49 | while (i < input.length) { 50 | enc1 = _keyStr.indexOf(input.charAt(i++)); 51 | enc2 = _keyStr.indexOf(input.charAt(i++)); 52 | enc3 = _keyStr.indexOf(input.charAt(i++)); 53 | enc4 = _keyStr.indexOf(input.charAt(i++)); 54 | chr1 = (enc1 << 2) | (enc2 >> 4); 55 | chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); 56 | chr3 = ((enc3 & 3) << 6) | enc4; 57 | output = output + String.fromCharCode(chr1); 58 | if (enc3 != 64) { 59 | output = output + String.fromCharCode(chr2); 60 | } 61 | if (enc4 != 64) { 62 | output = output + String.fromCharCode(chr3); 63 | } 64 | } 65 | output = _utf8_decode(output); 66 | return output; 67 | } 68 | 69 | // private method for UTF-8 encoding 70 | _utf8_encode = function (string) { 71 | string = string.replace(/\r\n/g,"\n"); 72 | var utftext = ""; 73 | for (var n = 0; n < string.length; n++) { 74 | var c = string.charCodeAt(n); 75 | if (c < 128) { 76 | utftext += String.fromCharCode(c); 77 | } else if((c > 127) && (c < 2048)) { 78 | utftext += String.fromCharCode((c >> 6) | 192); 79 | utftext += String.fromCharCode((c & 63) | 128); 80 | } else { 81 | utftext += String.fromCharCode((c >> 12) | 224); 82 | utftext += String.fromCharCode(((c >> 6) & 63) | 128); 83 | utftext += String.fromCharCode((c & 63) | 128); 84 | } 85 | 86 | } 87 | return utftext; 88 | } 89 | 90 | // private method for UTF-8 decoding 91 | _utf8_decode = function (utftext) { 92 | var string = ""; 93 | var i = 0; 94 | var c = c1 = c2 = 0; 95 | while ( i < utftext.length ) { 96 | c = utftext.charCodeAt(i); 97 | if (c < 128) { 98 | string += String.fromCharCode(c); 99 | i++; 100 | } else if((c > 191) && (c < 224)) { 101 | c2 = utftext.charCodeAt(i+1); 102 | string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); 103 | i += 2; 104 | } else { 105 | c2 = utftext.charCodeAt(i+1); 106 | c3 = utftext.charCodeAt(i+2); 107 | string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); 108 | i += 3; 109 | } 110 | } 111 | return string; 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /src/main/webapp/source/js/common.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var hander = function(t){ 3 | var $self = $(t); 4 | var loaded = $self.attr("data-loaded"); 5 | if(loaded == "true"){ 6 | return ; 7 | } 8 | var url = $self.attr("data-url"); 9 | var selValue = $self.attr("data-value"); 10 | if(!url){ 11 | if (typeof(selValue) != "undefined") 12 | $self.val(selValue); 13 | return ; 14 | } 15 | //注意:不能放到ajax中 16 | $self.attr("data-loaded", "true"); 17 | $.ajax({ 18 | url: url, 19 | async : true, 20 | type: "post", 21 | dataType: "json", 22 | success: function (data) { 23 | var html = ''; 24 | for(var i in data){ 25 | var label = data[i][1]; 26 | var value = data[i][0] 27 | html += ''; 28 | } 29 | $self.append(html); 30 | } 31 | }); 32 | } 33 | 34 | $(".page_combox").each(function(){ 35 | hander(this); 36 | }); 37 | }); -------------------------------------------------------------------------------- /src/main/webapp/source/js/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Cookie plugin 3 | * 4 | * Copyright (c) 2006 Klaus Hartl (stilbuero.de) 5 | * Dual licensed under the MIT and GPL licenses: 6 | * http://www.opensource.org/licenses/mit-license.php 7 | * http://www.gnu.org/licenses/gpl.html 8 | * 9 | */ 10 | 11 | /** 12 | * Create a cookie with the given name and value and other optional parameters. 13 | * 14 | * @example $.cookie('the_cookie', 'the_value'); 15 | * @desc Set the value of a cookie. 16 | * @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true}); 17 | * @desc Create a cookie with all available options. 18 | * @example $.cookie('the_cookie', 'the_value'); 19 | * @desc Create a session cookie. 20 | * @example $.cookie('the_cookie', null); 21 | * @desc Delete a cookie by passing null as value. 22 | * 23 | * @param String name The name of the cookie. 24 | * @param String value The value of the cookie. 25 | * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. 26 | * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. 27 | * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. 28 | * If set to null or omitted, the cookie will be a session cookie and will not be retained 29 | * when the the browser exits. 30 | * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). 31 | * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). 32 | * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will 33 | * require a secure protocol (like HTTPS). 34 | * @type undefined 35 | * 36 | * @name $.cookie 37 | * @cat Plugins/Cookie 38 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 39 | */ 40 | 41 | /** 42 | * Get the value of a cookie with the given name. 43 | * 44 | * @example $.cookie('the_cookie'); 45 | * @desc Get the value of a cookie. 46 | * 47 | * @param String name The name of the cookie. 48 | * @return The value of the cookie. 49 | * @type String 50 | * 51 | * @name $.cookie 52 | * @cat Plugins/Cookie 53 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 54 | */ 55 | jQuery.cookie = function(name, value, options) { 56 | if (typeof value != 'undefined') { // name and value given, set cookie 57 | options = options || {}; 58 | if (value === null) { 59 | value = ''; 60 | options.expires = -1; 61 | } 62 | var expires = ''; 63 | if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { 64 | var date; 65 | if (typeof options.expires == 'number') { 66 | date = new Date(); 67 | date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); 68 | } else { 69 | date = options.expires; 70 | } 71 | expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE 72 | } 73 | var path = options.path ? '; path=' + options.path : ''; 74 | var domain = options.domain ? '; domain=' + options.domain : ''; 75 | var secure = options.secure ? '; secure' : ''; 76 | document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); 77 | } else { // only name given, get cookie 78 | var cookieValue = null; 79 | if (document.cookie && document.cookie != '') { 80 | var cookies = document.cookie.split(';'); 81 | for (var i = 0; i < cookies.length; i++) { 82 | var cookie = jQuery.trim(cookies[i]); 83 | // Does this cookie string begin with the name we want? 84 | if (cookie.substring(0, name.length + 1) == (name + '=')) { 85 | cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 86 | break; 87 | } 88 | } 89 | } 90 | return cookieValue; 91 | } 92 | }; -------------------------------------------------------------------------------- /src/main/webapp/source/wangEditor3/fonts/w-e-icon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JavaGraduationProject/GeophysicalStationManagementSystem/cfb6c7252402e5c6635b8c23b809802ff86b55b3/src/main/webapp/source/wangEditor3/fonts/w-e-icon.woff -------------------------------------------------------------------------------- /src/main/webapp/source/wangEditor3/wangEditor.min.css: -------------------------------------------------------------------------------- 1 | .w-e-text-container .w-e-panel-container .w-e-panel-tab-content button:focus,.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input:focus,.w-e-text-container .w-e-panel-container .w-e-panel-tab-content textarea:focus,.w-e-text:focus{outline:0}.w-e-menu-panel,.w-e-menu-panel *,.w-e-text-container,.w-e-text-container *,.w-e-toolbar,.w-e-toolbar *{padding:0;margin:0;box-sizing:border-box}.w-e-clear-fix:after{content:"";display:table;clear:both}.w-e-toolbar .w-e-droplist{position:absolute;left:0;top:0;background-color:#fff;border:1px solid #f1f1f1;border-right-color:#ccc;border-bottom-color:#ccc}.w-e-toolbar .w-e-droplist ul.w-e-block li.w-e-item:hover,.w-e-toolbar .w-e-droplist ul.w-e-list li.w-e-item:hover{background-color:#f1f1f1}.w-e-toolbar .w-e-droplist .w-e-dp-title{text-align:center;color:#999;line-height:2;border-bottom:1px solid #f1f1f1;font-size:13px}.w-e-toolbar .w-e-droplist ul.w-e-list{list-style:none;line-height:1}.w-e-toolbar .w-e-droplist ul.w-e-list li.w-e-item{color:#333;padding:5px 0}.w-e-toolbar .w-e-droplist ul.w-e-block{list-style:none;text-align:left;padding:5px}.w-e-toolbar .w-e-droplist ul.w-e-block li.w-e-item{display:inline-block;padding:3px 5px}@font-face{font-family:w-e-icon;src:url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAABhQAAsAAAAAGAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIPBGNtYXAAAAFoAAABBAAAAQQrSf4BZ2FzcAAAAmwAAAAIAAAACAAAABBnbHlmAAACdAAAEvAAABLwfpUWUWhlYWQAABVkAAAANgAAADYQp00kaGhlYQAAFZwAAAAkAAAAJAfEA+FobXR4AAAVwAAAAIQAAACEeAcD7GxvY2EAABZEAAAARAAAAERBSEX+bWF4cAAAFogAAAAgAAAAIAAsALZuYW1lAAAWqAAAAYYAAAGGmUoJ+3Bvc3QAABgwAAAAIAAAACAAAwAAAAMD3gGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA8fwDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEAOgAAAA2ACAABAAWAAEAIOkG6Q3pEulH6Wbpd+m56bvpxunL6d/qDepc6l/qZepo6nHqefAN8BTxIPHc8fz//f//AAAAAAAg6QbpDekS6UfpZel36bnpu+nG6cvp3+oN6lzqX+pi6mjqcep38A3wFPEg8dzx/P/9//8AAf/jFv4W+Bb0FsAWoxaTFlIWURZHFkMWMBYDFbUVsxWxFa8VpxWiEA8QCQ7+DkMOJAADAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACAAD/wAQAA8AABAATAAABNwEnAQMuAScTNwEjAQMlATUBBwGAgAHAQP5Anxc7MmOAAYDA/oDAAoABgP6ATgFAQAHAQP5A/p0yOxcBEU4BgP6A/YDAAYDA/oCAAAQAAAAABAADgAAQACEALQA0AAABOAExETgBMSE4ATEROAExITUhIgYVERQWMyEyNjURNCYjBxQGIyImNTQ2MzIWEyE1EwEzNwPA/IADgPyAGiYmGgOAGiYmGoA4KCg4OCgoOED9AOABAEDgA0D9AAMAQCYa/QAaJiYaAwAaJuAoODgoKDg4/biAAYD+wMAAAAIAAABABAADQAA4ADwAAAEmJy4BJyYjIgcOAQcGBwYHDgEHBhUUFx4BFxYXFhceARcWMzI3PgE3Njc2Nz4BNzY1NCcuAScmJwERDQED1TY4OXY8PT8/PTx2OTg2CwcICwMDAwMLCAcLNjg5djw9Pz89PHY5ODYLBwgLAwMDAwsIBwv9qwFA/sADIAgGBggCAgICCAYGCCkqKlktLi8vLi1ZKiopCAYGCAICAgIIBgYIKSoqWS0uLy8uLVkqKin94AGAwMAAAAAAAgDA/8ADQAPAABsAJwAAASIHDgEHBhUUFx4BFxYxMDc+ATc2NTQnLgEnJgMiJjU0NjMyFhUUBgIAQjs6VxkZMjJ4MjIyMngyMhkZVzo7QlBwcFBQcHADwBkZVzo7Qnh9fcxBQUFBzH19eEI7OlcZGf4AcFBQcHBQUHAAAAEAAAAABAADgAArAAABIgcOAQcGBycRISc+ATMyFx4BFxYVFAcOAQcGBxc2Nz4BNzY1NCcuAScmIwIANTIyXCkpI5YBgJA1i1BQRUZpHh4JCSIYGB5VKCAgLQwMKCiLXl1qA4AKCycbHCOW/oCQNDweHmlGRVArKClJICEaYCMrK2I2NjlqXV6LKCgAAQAAAAAEAAOAACoAABMUFx4BFxYXNyYnLgEnJjU0Nz4BNzYzMhYXByERByYnLgEnJiMiBw4BBwYADAwtICAoVR4YGCIJCR4eaUZFUFCLNZABgJYjKSlcMjI1al1eiygoAYA5NjZiKysjYBohIEkpKCtQRUZpHh48NJABgJYjHBsnCwooKIteXQAAAAACAAAAQAQBAwAAJgBNAAATMhceARcWFRQHDgEHBiMiJy4BJyY1JzQ3PgE3NjMVIgYHDgEHPgEhMhceARcWFRQHDgEHBiMiJy4BJyY1JzQ3PgE3NjMVIgYHDgEHPgHhLikpPRESEhE9KSkuLikpPRESASMjelJRXUB1LQkQBwgSAkkuKSk9ERISET0pKS4uKSk9ERIBIyN6UlFdQHUtCRAHCBICABIRPSkpLi4pKT0REhIRPSkpLiBdUVJ6IyOAMC4IEwoCARIRPSkpLi4pKT0REhIRPSkpLiBdUVJ6IyOAMC4IEwoCAQAABgBA/8AEAAPAAAMABwALABEAHQApAAAlIRUhESEVIREhFSEnESM1IzUTFTMVIzU3NSM1MxUVESM1MzUjNTM1IzUBgAKA/YACgP2AAoD9gMBAQECAwICAwMCAgICAgIACAIACAIDA/wDAQP3yMkCSPDJAku7+wEBAQEBAAAYAAP/ABAADwAADAAcACwAXACMALwAAASEVIREhFSERIRUhATQ2MzIWFRQGIyImETQ2MzIWFRQGIyImETQ2MzIWFRQGIyImAYACgP2AAoD9gAKA/YD+gEs1NUtLNTVLSzU1S0s1NUtLNTVLSzU1SwOAgP8AgP8AgANANUtLNTVLS/61NUtLNTVLS/61NUtLNTVLSwADAAAAAAQAA6AAAwANABQAADchFSElFSE1EyEVITUhJQkBIxEjEQAEAPwABAD8AIABAAEAAQD9YAEgASDggEBAwEBAAQCAgMABIP7g/wABAAAAAAACAB7/zAPiA7QAMwBkAAABIiYnJicmNDc2PwE+ATMyFhcWFxYUBwYPAQYiJyY0PwE2NCcuASMiBg8BBhQXFhQHDgEjAyImJyYnJjQ3Nj8BNjIXFhQPAQYUFx4BMzI2PwE2NCcmNDc2MhcWFxYUBwYPAQ4BIwG4ChMIIxISEhIjwCNZMTFZIyMSEhISI1gPLA8PD1gpKRQzHBwzFMApKQ8PCBMKuDFZIyMSEhISI1gPLA8PD1gpKRQzHBwzFMApKQ8PDysQIxISEhIjwCNZMQFECAckLS1eLS0kwCIlJSIkLS1eLS0kVxAQDysPWCl0KRQVFRTAKXQpDysQBwj+iCUiJC0tXi0tJFcQEA8rD1gpdCkUFRUUwCl0KQ8rEA8PJC0tXi0tJMAiJQAAAAAFAAD/wAQAA8AAGwA3AFMAXwBrAAAFMjc+ATc2NTQnLgEnJiMiBw4BBwYVFBceARcWEzIXHgEXFhUUBw4BBwYjIicuAScmNTQ3PgE3NhMyNz4BNzY3BgcOAQcGIyInLgEnJicWFx4BFxYnNDYzMhYVFAYjIiYlNDYzMhYVFAYjIiYCAGpdXosoKCgoi15dampdXosoKCgoi15dalZMTHEgISEgcUxMVlZMTHEgISEgcUxMVisrKlEmJiMFHBtWODc/Pzc4VhscBSMmJlEqK9UlGxslJRsbJQGAJRsbJSUbGyVAKCiLXl1qal1eiygoKCiLXl1qal1eiygoA6AhIHFMTFZWTExxICEhIHFMTFZWTExxICH+CQYGFRAQFEM6OlYYGRkYVjo6QxQQEBUGBvcoODgoKDg4KCg4OCgoODgAAAMAAP/ABAADwAAbADcAQwAAASIHDgEHBhUUFx4BFxYzMjc+ATc2NTQnLgEnJgMiJy4BJyY1NDc+ATc2MzIXHgEXFhUUBw4BBwYTBycHFwcXNxc3JzcCAGpdXosoKCgoi15dampdXosoKCgoi15dalZMTHEgISEgcUxMVlZMTHEgISEgcUxMSqCgYKCgYKCgYKCgA8AoKIteXWpqXV6LKCgoKIteXWpqXV6LKCj8YCEgcUxMVlZMTHEgISEgcUxMVlZMTHEgIQKgoKBgoKBgoKBgoKAAAQBl/8ADmwPAACkAAAEiJiMiBw4BBwYVFBYzLgE1NDY3MAcGAgcGBxUhEzM3IzceATMyNjcOAQMgRGhGcVNUbRobSUgGDWVKEBBLPDxZAT1sxizXNC1VJi5QGB09A7AQHh1hPj9BTTsLJjeZbwN9fv7Fj5AjGQIAgPYJDzdrCQcAAAAAAgAAAAAEAAOAAAkAFwAAJTMHJzMRIzcXIyURJyMRMxUhNTMRIwcRA4CAoKCAgKCggP8AQMCA/oCAwEDAwMACAMDAwP8AgP1AQEACwIABAAADAMAAAANAA4AAFgAfACgAAAE+ATU0Jy4BJyYjIREhMjc+ATc2NTQmATMyFhUUBisBEyMRMzIWFRQGAsQcIBQURi4vNf7AAYA1Ly5GFBRE/oRlKjw8KWafn58sPj4B2yJULzUvLkYUFPyAFBRGLi81RnQBRks1NUv+gAEASzU1SwAAAAACAMAAAANAA4AAHwAjAAABMxEUBw4BBwYjIicuAScmNREzERQWFx4BMzI2Nz4BNQEhFSECwIAZGVc6O0JCOzpXGRmAGxgcSSgoSRwYG/4AAoD9gAOA/mA8NDVOFhcXFk41NDwBoP5gHjgXGBsbGBc4Hv6ggAAAAAABAIAAAAOAA4AACwAAARUjATMVITUzASM1A4CA/sCA/kCAAUCAA4BA/QBAQAMAQAABAAAAAAQAA4AAPQAAARUjHgEVFAYHDgEjIiYnLgE1MxQWMzI2NTQmIyE1IS4BJy4BNTQ2Nz4BMzIWFx4BFSM0JiMiBhUUFjMyFhcEAOsVFjUwLHE+PnEsMDWAck5OcnJO/gABLAIEATA1NTAscT4+cSwwNYByTk5yck47bisBwEAdQSI1YiQhJCQhJGI1NExMNDRMQAEDASRiNTViJCEkJCEkYjU0TEw0NEwhHwAAAAcAAP/ABAADwAADAAcACwAPABMAGwAjAAATMxUjNzMVIyUzFSM3MxUjJTMVIwMTIRMzEyETAQMhAyMDIQMAgIDAwMABAICAwMDAAQCAgBAQ/QAQIBACgBD9QBADABAgEP2AEAHAQEBAQEBAQEBAAkD+QAHA/oABgPwAAYD+gAFA/sAAAAoAAAAABAADgAADAAcACwAPABMAFwAbAB8AIwAnAAATESERATUhFR0BITUBFSE1IxUhNREhFSElIRUhETUhFQEhFSEhNSEVAAQA/YABAP8AAQD/AED/AAEA/wACgAEA/wABAPyAAQD/AAKAAQADgPyAA4D9wMDAQMDAAgDAwMDA/wDAwMABAMDA/sDAwMAAAAUAAAAABAADgAADAAcACwAPABMAABMhFSEVIRUhESEVIREhFSERIRUhAAQA/AACgP2AAoD9gAQA/AAEAPwAA4CAQID/AIABQID/AIAAAAAABQAAAAAEAAOAAAMABwALAA8AEwAAEyEVIRchFSERIRUhAyEVIREhFSEABAD8AMACgP2AAoD9gMAEAPwABAD8AAOAgECA/wCAAUCA/wCAAAAFAAAAAAQAA4AAAwAHAAsADwATAAATIRUhBSEVIREhFSEBIRUhESEVIQAEAPwAAYACgP2AAoD9gP6ABAD8AAQA/AADgIBAgP8AgAFAgP8AgAAAAAABAD8APwLmAuYALAAAJRQPAQYjIi8BBwYjIi8BJjU0PwEnJjU0PwE2MzIfATc2MzIfARYVFA8BFxYVAuYQThAXFxCoqBAXFhBOEBCoqBAQThAWFxCoqBAXFxBOEBCoqBDDFhBOEBCoqBAQThAWFxCoqBAXFxBOEBCoqBAQThAXFxCoqBAXAAAABgAAAAADJQNuABQAKAA8AE0AVQCCAAABERQHBisBIicmNRE0NzY7ATIXFhUzERQHBisBIicmNRE0NzY7ATIXFhcRFAcGKwEiJyY1ETQ3NjsBMhcWExEhERQXFhcWMyEyNzY3NjUBIScmJyMGBwUVFAcGKwERFAcGIyEiJyY1ESMiJyY9ATQ3NjsBNzY3NjsBMhcWHwEzMhcWFQElBgUIJAgFBgYFCCQIBQaSBQUIJQgFBQUFCCUIBQWSBQUIJQgFBQUFCCUIBQVJ/gAEBAUEAgHbAgQEBAT+gAEAGwQGtQYEAfcGBQg3Ghsm/iUmGxs3CAUFBQUIsSgIFxYXtxcWFgkosAgFBgIS/rcIBQUFBQgBSQgFBgYFCP63CAUFBQUIAUkIBQYGBQj+twgFBQUFCAFJCAUGBgX+WwId/eMNCwoFBQUFCgsNAmZDBQICBVUkCAYF/eMwIiMhIi8CIAUGCCQIBQVgFQ8PDw8VYAUFCAACAAcASQO3Aq8AGgAuAAAJAQYjIi8BJjU0PwEnJjU0PwE2MzIXARYVFAcBFRQHBiMhIicmPQE0NzYzITIXFgFO/vYGBwgFHQYG4eEGBh0FCAcGAQoGBgJpBQUI/dsIBQUFBQgCJQgFBQGF/vYGBhwGCAcG4OEGBwcGHQUF/vUFCAcG/vslCAUFBQUIJQgFBQUFAAAAAQAjAAAD3QNuALMAACUiJyYjIgcGIyInJjU0NzY3Njc2NzY9ATQnJiMhIgcGHQEUFxYXFjMWFxYVFAcGIyInJiMiBwYjIicmNTQ3Njc2NzY3Nj0BETQ1NDU0JzQnJicmJyYnJicmIyInJjU0NzYzMhcWMzI3NjMyFxYVFAcGIwYHBgcGHQEUFxYzITI3Nj0BNCcmJyYnJjU0NzYzMhcWMzI3NjMyFxYVFAcGByIHBgcGFREUFxYXFhcyFxYVFAcGIwPBGTMyGhkyMxkNCAcJCg0MERAKEgEHFf5+FgcBFQkSEw4ODAsHBw4bNTUaGDExGA0HBwkJCwwQDwkSAQIBAgMEBAUIEhENDQoLBwcOGjU1GhgwMRgOBwcJCgwNEBAIFAEHDwGQDgcBFAoXFw8OBwcOGTMyGRkxMRkOBwcKCg0NEBEIFBQJEREODQoLBwcOAAICAgIMCw8RCQkBAQMDBQxE4AwFAwMFDNRRDQYBAgEICBIPDA0CAgICDAwOEQgJAQIDAwUNRSEB0AINDQgIDg4KCgsLBwcDBgEBCAgSDwwNAgICAg0MDxEICAECAQYMULYMBwEBBwy2UAwGAQEGBxYPDA0CAgICDQwPEQgIAQECBg1P/eZEDAYCAgEJCBEPDA0AAAIAAP+3A/8DtwATADkAAAEyFxYVFAcCBwYjIicmNTQ3ATYzARYXFh8BFgcGIyInJicmJyY1FhcWFxYXFjMyNzY3Njc2NzY3NjcDmygeHhq+TDdFSDQ0NQFtISn9+BcmJy8BAkxMe0c2NiEhEBEEExQQEBIRCRcIDxITFRUdHR4eKQO3GxooJDP+mUY0NTRJSTABSx/9sSsfHw0oek1MGhsuLzo6RAMPDgsLCgoWJRsaEREKCwQEAgABAAAAAAAA9evv618PPPUACwQAAAAAANbEBFgAAAAA1sQEWAAA/7cEAQPAAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAD//wQBAAEAAAAAAAAAAAAAAAAAAAAhBAAAAAAAAAAAAAAAAgAAAAQAAAAEAAAABAAAAAQAAMAEAAAABAAAAAQAAAAEAABABAAAAAQAAAAEAAAeBAAAAAQAAAAEAABlBAAAAAQAAMAEAADABAAAgAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAMlAD8DJQAAA74ABwQAACMD/wAAAAAAAAAKABQAHgBMAJQA+AE2AXwBwgI2AnQCvgLoA34EHgSIBMoE8gU0BXAFiAXgBiIGagaSBroG5AcoB+AIKgkcCXgAAQAAACEAtAAKAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGljb21vb24AaQBjAG8AbQBvAG8AblZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGljb21vb24AaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AblJlZ3VsYXIAUgBlAGcAdQBsAGEAcmljb21vb24AaQBjAG8AbQBvAG8AbkZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=) format('truetype');font-weight:400;font-style:normal}[class*=" w-e-icon-"],[class^=w-e-icon-]{font-family:w-e-icon!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.w-e-icon-close:before{content:"\f00d"}.w-e-icon-upload2:before{content:"\e9c6"}.w-e-icon-trash-o:before{content:"\f014"}.w-e-icon-header:before{content:"\f1dc"}.w-e-icon-pencil2:before{content:"\e906"}.w-e-icon-paint-brush:before{content:"\f1fc"}.w-e-icon-image:before{content:"\e90d"}.w-e-icon-play:before{content:"\e912"}.w-e-icon-location:before{content:"\e947"}.w-e-icon-undo:before{content:"\e965"}.w-e-icon-redo:before{content:"\e966"}.w-e-icon-quotes-left:before{content:"\e977"}.w-e-icon-list-numbered:before{content:"\e9b9"}.w-e-icon-list2:before{content:"\e9bb"}.w-e-icon-link:before{content:"\e9cb"}.w-e-icon-happy:before{content:"\e9df"}.w-e-icon-bold:before{content:"\ea62"}.w-e-icon-underline:before{content:"\ea63"}.w-e-icon-italic:before{content:"\ea64"}.w-e-icon-strikethrough:before{content:"\ea65"}.w-e-icon-table2:before{content:"\ea71"}.w-e-icon-paragraph-left:before{content:"\ea77"}.w-e-icon-paragraph-center:before{content:"\ea78"}.w-e-icon-paragraph-right:before{content:"\ea79"}.w-e-icon-terminal:before{content:"\f120"}.w-e-icon-page-break:before{content:"\ea68"}.w-e-icon-cancel-circle:before{content:"\ea0d"}.w-e-icon-font:before{content:"\ea5c"}.w-e-icon-text-heigh:before{content:"\ea5f"}.w-e-toolbar{display:-webkit-box;display:-ms-flexbox;display:flex;padding:0 5px}.w-e-toolbar .w-e-menu{position:relative;text-align:center;padding:5px 10px;cursor:pointer}.w-e-toolbar .w-e-menu i{color:#999}.w-e-toolbar .w-e-menu:hover i{color:#333}.w-e-toolbar .w-e-active i,.w-e-toolbar .w-e-active:hover i{color:#1e88e5}.w-e-text-container .w-e-panel-container{position:absolute;top:0;left:50%;border:1px solid #ccc;border-top:0;box-shadow:1px 1px 2px #ccc;color:#333;background-color:#fff}.w-e-text-container .w-e-panel-container .w-e-panel-close{position:absolute;right:0;top:0;padding:5px;margin:2px 5px 0 0;cursor:pointer;color:#999}.w-e-text-container .w-e-panel-container .w-e-panel-close:hover{color:#333}.w-e-text-container .w-e-panel-container .w-e-panel-tab-title{list-style:none;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:14px;margin:2px 10px 0;border-bottom:1px solid #f1f1f1}.w-e-text-container .w-e-panel-container .w-e-panel-tab-title .w-e-item{padding:3px 5px;color:#999;cursor:pointer;margin:0 3px;position:relative;top:1px}.w-e-text-container .w-e-panel-container .w-e-panel-tab-title .w-e-active{color:#333;border-bottom:1px solid #333;cursor:default;font-weight:700}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content{padding:10px 15px;font-size:16px}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content textarea{width:100%;border:1px solid #ccc;padding:5px}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content textarea:focus{border-color:#1e88e5}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text]{border:none;border-bottom:1px solid #ccc;font-size:14px;height:20px;color:#333;text-align:left}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text].small{width:30px;text-align:center}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text].block{display:block;width:100%;margin:10px 0}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content input[type=text]:focus{border-bottom:2px solid #1e88e5}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button{font-size:14px;color:#1e88e5;border:none;padding:5px 10px;background-color:#fff;cursor:pointer;border-radius:3px}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.left{float:left;margin-right:10px}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.right{float:right;margin-left:10px}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.gray{color:#999}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button.red{color:#c24f4a}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container button:hover{background-color:#f1f1f1}.w-e-text-container .w-e-panel-container .w-e-panel-tab-content .w-e-button-container:after{content:"";display:table;clear:both}.w-e-text-container .w-e-panel-container .w-e-emoticon-container .w-e-item{cursor:pointer;font-size:18px;padding:0 3px;display:inline-block}.w-e-text-container .w-e-panel-container .w-e-up-img-container{text-align:center}.w-e-text-container .w-e-panel-container .w-e-up-img-container .w-e-up-btn{display:inline-block;color:#999;cursor:pointer;font-size:60px;line-height:1}.w-e-text-container .w-e-panel-container .w-e-up-img-container .w-e-up-btn:hover{color:#333}.w-e-text-container{position:relative}.w-e-text-container .w-e-progress{position:absolute;background-color:#1e88e5;bottom:0;left:0;height:1px}.w-e-text{padding:0 10px;overflow-y:scroll}.w-e-text h1,.w-e-text h2,.w-e-text h3,.w-e-text h4,.w-e-text h5,.w-e-text p,.w-e-text pre,.w-e-text table{margin:10px 0;line-height:1.5}.w-e-text ol,.w-e-text ul{margin:10px 0 10px 20px}.w-e-text blockquote{display:block;border-left:8px solid #d0e5f2;padding:5px 10px;margin:10px 0;line-height:1.4;font-size:100%;background-color:#f1f1f1}.w-e-text code{display:inline-block;background-color:#f1f1f1;border-radius:3px;padding:3px 5px;margin:0 3px}.w-e-text pre code{display:block}.w-e-text table{border-top:1px solid #ccc;border-left:1px solid #ccc}.w-e-text table td,.w-e-text table th{border-bottom:1px solid #ccc;border-right:1px solid #ccc;padding:3px 5px}.w-e-text table th{border-bottom:2px solid #ccc;text-align:center}.w-e-text img{cursor:pointer}.w-e-text img:hover{box-shadow:0 0 5px #333} -------------------------------------------------------------------------------- /src/main/webapp/view/index/css/index.css: -------------------------------------------------------------------------------- 1 | .body-box{ 2 | display: flex; 3 | flex-direction: column; 4 | align-items: center; 5 | min-height:100vh; 6 | overflow-y: hidden; 7 | overflow-x: auto; 8 | } 9 | .header-box{ 10 | width: 100%; 11 | height: 50px; 12 | background-color: #2d303b; 13 | display: flex; 14 | align-items: center; 15 | justify-content: space-between; 16 | } 17 | .header-box .logo{ 18 | margin: 0 0 0 20px; 19 | color: #fff; 20 | font-size: 18px; 21 | } 22 | .header-box .links{ 23 | display: flex; 24 | align-items: center; 25 | } 26 | .header-box .links a{ 27 | color: #fff; 28 | } 29 | .header-box .links .message{ 30 | display: flex; 31 | align-items: center; 32 | } 33 | .header-box .links .message span{ 34 | display: inline-block; 35 | height: 14px; 36 | padding: 0 6px; 37 | background: #51d2b7; 38 | border-radius: 8px; 39 | color: #fff; 40 | font-size: 10px; 41 | font-family: Arial; 42 | font-style: normal; 43 | font-weight: normal; 44 | line-height: 15px; 45 | } 46 | .header-box .links .topNaviLink{ 47 | margin: 0 20px 0 50px; 48 | display: flex; 49 | align-items: center; 50 | } 51 | .header-box .links .topNaviLink i{ 52 | display: inline-block; 53 | color:#adb3c4; 54 | vertical-align: top; 55 | border:4px solid #adb3c4; 56 | margin: 4px 0 0 5px; 57 | } 58 | .header-box .links .topNaviLink .triangle_down{ 59 | border-color: #fff transparent transparent transparent; 60 | } 61 | .header-box .links .topNaviLink .triangle_up{ 62 | border-color: #fff transparent transparent transparent; 63 | } 64 | .header-box .userCenter-outer{ 65 | width:100%; 66 | height: 100%; 67 | position: absolute; 68 | top: 0; 69 | right: 0; 70 | display: flex; 71 | justify-content:flex-end; 72 | display: none; 73 | } 74 | .header-box .userCenter { 75 | width: 128px; 76 | height: 40px; 77 | background: #26262b; 78 | display: flex; 79 | flex-direction: column; 80 | position: absolute; 81 | top: 50px; 82 | right: 0; 83 | } 84 | .header-box .userCenter h3 { 85 | height: 50px; 86 | padding: 0 20px; 87 | color: #fff; 88 | font-size: 14px; 89 | text-align: left; 90 | line-height: 50px; 91 | } 92 | .header-box .userCenter .userBalance{ 93 | display: flex; 94 | align-items: center; 95 | justify-content:space-between; 96 | } 97 | .header-box .userCenter .userBalance .balance{ 98 | color: #fff; 99 | margin: 0 0 0 20px; 100 | } 101 | .header-box .userCenter .userBalance .recharge { 102 | display: inline-block; 103 | width: 68px; 104 | height: 38px; 105 | line-height: 38px; 106 | background: #e24732; 107 | border-radius: 3px; 108 | color: #fff; 109 | font-size: 14px; 110 | text-align: center; 111 | margin: 0 20px 0 0; 112 | } 113 | .header-box .userCenter .foot{ 114 | display: flex; 115 | align-items: flex-end; 116 | justify-content:flex-end; 117 | flex: 1; 118 | } 119 | .header-box .userCenter .foot .btn_logout{ 120 | display: inline-block; 121 | height: 40px; 122 | padding: 0; 123 | color: #999; 124 | font-size: 12px; 125 | line-height: 40px; 126 | margin: 0 20px 0 0; 127 | } 128 | .main-box{ 129 | display: flex; 130 | width: 100%; 131 | height: 100%; 132 | flex: 1; 133 | } 134 | .menus{ 135 | background-color: #31354B; 136 | width: 150px; 137 | overflow: hidden; 138 | } 139 | .menus > ul > li > a{ 140 | display: flex; 141 | align-items: center; 142 | height: 40px; 143 | background: rgba(63,69,91,.4); 144 | width: 100%; 145 | color: #adb3c4; 146 | font-size: 14px; 147 | padding-left: 20px; 148 | } 149 | .menus > ul > li > a:hover{ 150 | background: #4bd3b7; 151 | color: #fff; 152 | } 153 | .menus > ul > li > a i{ 154 | display: inline-block; 155 | color:#adb3c4; 156 | vertical-align: top; 157 | border:4px solid #adb3c4; 158 | margin: 0 15px 0 15px; 159 | } 160 | .menus > ul > li > a i.triangle_right{ 161 | border-color:transparent transparent transparent #adb3c4; 162 | transition-duration: 350ms; 163 | -webkit-transition-duration:350ms; 164 | -moz-transition-duration:350ms; 165 | } 166 | .menus > ul > li > a i.triangle_down{ 167 | border-color:#adb3c4 transparent transparent transparent; 168 | transition-duration: 350ms; 169 | -webkit-transition-duration:350ms; 170 | -moz-transition-duration:350ms; 171 | } 172 | .sub-menus{ 173 | display: none; 174 | } 175 | .sub-menus li a{ 176 | display: flex; 177 | align-items: center; 178 | height: 40px; 179 | background: rgba(45,47,59,.6); 180 | color: #7f87ab; 181 | width: 100%; 182 | padding: 0 0 0 36px; 183 | } 184 | .sub-menus li a:hover{ 185 | background: #4bd3b7; 186 | color: #fff; 187 | } 188 | .menus a.active{ 189 | background: #4bd3b7; 190 | color: #fff; 191 | } 192 | .content{ 193 | flex: 1; 194 | } 195 | .content iframe{ 196 | width: 100%; 197 | height: 100%; 198 | } -------------------------------------------------------------------------------- /src/main/webapp/view/index/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ page import="com.earth.station.model.StationUser" %> 4 | <% 5 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path; 7 | %> 8 | <% 9 | StationUser user = (StationUser)request.getAttribute("user"); 10 | %> 11 | 12 | 13 | 14 | 15 | 地球物理台网 16 | 17 | 18 | 19 | 20 | 21 | 22 | 27 | 28 | 29 |
30 |
31 | 32 | 35 |
36 |
37 |
38 | 退出 39 | 修改密码 40 |
41 |
42 |
43 | 44 |
45 |
46 |
47 | 48 |
49 |
50 |
51 | 52 | -------------------------------------------------------------------------------- /src/main/webapp/view/index/js/index.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | $(".menus > ul > li > a").on("click", function(){ 3 | var that = $(this); 4 | if(that.siblings().is(":hidden")){ 5 | that.find("i").removeClass("triangle_right").addClass("triangle_down"); 6 | }else{ 7 | that.find("i").removeClass("triangle_down").addClass("triangle_right"); 8 | } 9 | that.siblings().stop().slideToggle(150, "swing", function(){ 10 | 11 | }) 12 | }) 13 | $(".menus li a").on("click", function(){ 14 | var that = $(this); 15 | $(".menus li a").removeClass("active"); 16 | that.addClass("active"); 17 | }) 18 | $(".topNaviLink").on("click", function(){ 19 | var $con = $(".header-box .userCenter-outer"); 20 | if($con.is(":hidden")){ 21 | $con.show(); 22 | return ; 23 | } 24 | $con.hide(); 25 | }) 26 | $(".header-box .userCenter-outer").on("click", function(){ 27 | $(this).hide(); 28 | }) 29 | $(".header-box .userCenter-outer .userCenter").on("click", function(){ 30 | return false; 31 | }) 32 | //退出 33 | $("#logout").on("click", function(){ 34 | swal({ 35 | title: '退出系统', 36 | text: '确认要退出系统吗?', 37 | showCancelButton: true, 38 | confirmButtonText: '确认', 39 | cancelButtonText: '取消' 40 | }).then((result) => { 41 | if(result.value){ 42 | $.ajax({ 43 | url: getBasePath()+"/loginout.html", 44 | async : true, 45 | type: "post", 46 | dataType: "json", 47 | success: function (data) { 48 | if(data.code != 200){ 49 | showError(data.data); 50 | return ; 51 | } 52 | location.href = getBasePath()+"/login.html"; 53 | } 54 | }); 55 | } 56 | }) 57 | }) 58 | $("#update_passwd").on("click", function () { 59 | location.href= getBasePath() + "/user/updatePage.html"; 60 | }) 61 | }); -------------------------------------------------------------------------------- /src/main/webapp/view/login/css/login.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | border: 0; 5 | } 6 | body{ 7 | background-color: #f2f2f2; 8 | color: #666; 9 | } 10 | .form-box{ 11 | width: 375px; 12 | margin: 0 auto; 13 | padding: 110px 0; 14 | } 15 | .header p{ 16 | font-weight: 300; 17 | color: #000; 18 | text-align: center; 19 | padding-bottom: 20px; 20 | } 21 | .form-item{ 22 | margin-bottom: 15px; 23 | height: 40px; 24 | display: flex; 25 | justify-content: space-between; 26 | align-items: center; 27 | } 28 | .inp{ 29 | padding-left: 10px; 30 | height: 38px; 31 | line-height: 1.3; 32 | border-width: 1px; 33 | border-style: solid; 34 | background-color: #fff; 35 | border-radius: 2px; 36 | border-color: #e6e6e6; 37 | outline: 0; 38 | font-size: 14px; 39 | width: 100%; 40 | } 41 | input::-webkit-input-placeholder { 42 | /* placeholder颜色 */ 43 | color: #999; 44 | /* placeholder字体大小 */ 45 | font-size: 14px; 46 | /* placeholder位置 */ 47 | text-align: left; 48 | } 49 | img{ 50 | height: 38px; 51 | cursor: pointer; 52 | display : inline-block; 53 | vertical-align: baseline 54 | } 55 | .remember{ 56 | font-size: 14px; 57 | } 58 | .links a{ 59 | color: #3399ea; 60 | font-size: 14px; 61 | } 62 | .btn{ 63 | background-color: #009688; 64 | color: #fff; 65 | width: 100%; 66 | height: 38px; 67 | font-size: 14px; 68 | text-align:center; 69 | cursor: pointer; 70 | border-radius: 2px; 71 | outline: 0; 72 | } 73 | .btn:hover { 74 | background-color: #00a688; 75 | } 76 | -------------------------------------------------------------------------------- /src/main/webapp/view/login/js/login.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var userName = $.cookie('userName'); 3 | var password = $.cookie('password'); 4 | $("input[name=userName]").val(userName); 5 | $("input[name=password]").val(password); 6 | if(!password) 7 | $('input[name=remember]').prop('checked',true); 8 | //按回车登录 9 | $(document).keydown(function(e){ 10 | var curKey = e.which; 11 | if(curKey == 13){ 12 | $(".sub-btn").click(); 13 | return false; 14 | } 15 | }); 16 | //提交 17 | $(".sub-btn").on("click", function(){ 18 | var userName = $.trim($("input[name=userName]").val()); 19 | var password = $.trim($("input[name=password]").val()); 20 | if(!userName){ 21 | alert('请输入登录账号'); 22 | return ; 23 | } 24 | if(!password){ 25 | alert('请输入登录密码'); 26 | return ; 27 | } 28 | 29 | $.ajax({ 30 | url: getBasePath()+"/doLogin.html", 31 | async : true, 32 | type: "post", 33 | dataType: "json", 34 | data: {"userName":userName, "pwd":password}, 35 | success: function (data) { 36 | if(data.code != 200){ 37 | alert(data.data); 38 | return ; 39 | } 40 | $.cookie('userName', userName); 41 | if($('input[name=remember]').is(':checked')) { 42 | $.cookie('password', password); 43 | }else{ 44 | $.cookie('password', ''); 45 | } 46 | location.href = getBasePath()+"/index.html"; 47 | } 48 | }); 49 | }) 50 | }); -------------------------------------------------------------------------------- /src/main/webapp/view/login/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <% 4 | String path = request.getContextPath(); 5 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path; 6 | %> 7 | 8 | 9 | 10 | 11 | 登录-地球物理台 12 | 13 | 14 | 15 | 16 | 21 | 22 | 23 |
24 |
25 |

登录-地球物理台

26 |
27 |
28 | 29 |
30 |
31 | 32 |
33 |
34 | 35 |
36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /src/main/webapp/view/station/add.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <% 4 | String path = request.getContextPath(); 5 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path; 6 | %> 7 | 8 | 9 | 10 | 11 | 12 | 添加站台 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 25 | 26 | 27 |
28 |
29 |

添加站台

30 |
31 |
32 |
33 |
34 | 站台编号: 35 | 36 |
37 |
38 | 台站: 39 | 40 |
41 |
42 | 台站级别: 43 | 44 |
45 |
46 | 是否有人值守: 47 | 48 |
49 |
50 | 纬度: 51 | 52 |
53 |
54 | 经度: 55 | 56 |
57 |
58 | 高程(米): 59 | 60 |
61 |
62 | 台站建成时间: 63 | 64 |
65 |
66 | 提交 67 |
68 |
69 |
70 |
71 | 72 | 73 | -------------------------------------------------------------------------------- /src/main/webapp/view/station/css/add.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width: 100%; 3 | height:100%; 4 | background-color: #f3f7fb; 5 | } 6 | .body-box{ 7 | width: 100%; 8 | height:100%; 9 | display: flex; 10 | flex-direction: column; 11 | min-height:100vh; 12 | } 13 | .header{ 14 | display: flex; 15 | align-items: center; 16 | height: 34px; 17 | background: #d6dde1; 18 | } 19 | .header h2{ 20 | background: url(../../../source/image/header_icon.png) no-repeat; 21 | padding: 0 0 0 20px; 22 | margin: 0 0 0 12px; 23 | } 24 | .form-outer-box{ 25 | padding: 12px; 26 | flex: 1; 27 | } 28 | .form-box{ 29 | background-color: #fff; 30 | padding: 10px; 31 | display: flex; 32 | flex-direction: column; 33 | } 34 | .form-box .row{ 35 | display: flex; 36 | align-items: center; 37 | margin: 0 0 30px 0; 38 | } 39 | .form-box .row .lbl{ 40 | display: inline-block; 41 | width: 100px; 42 | text-align: right; 43 | padding: 0 4px 0 0; 44 | flex-shrink: 0; 45 | } 46 | .form-box .row .inp{ 47 | border: 1px solid #e7e7e7; 48 | outline: 0; 49 | padding: 0 5px 0 5px; 50 | height: 28px; 51 | line-height: 28px; 52 | font-size: 13px; 53 | width: 220px; 54 | } 55 | .form-box .row textarea{ 56 | border: 1px solid #e7e7e7; 57 | outline: 0; 58 | padding: 0 5px 0 5px; 59 | } 60 | .form-box .row .inp:focus{ 61 | border: 1px solid #2aafff; 62 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); 63 | color: #333 64 | } 65 | .form-box .row .inp::-webkit-input-placeholder{ 66 | color: #ccc 67 | } 68 | .form-box .row .inp:-moz-placeholder{ 69 | color: #ccc 70 | } 71 | .form-box .row .inp:-ms-input-placeholder{ 72 | color: #ccc 73 | } 74 | .btn{ 75 | display: inline-block; 76 | border-radius: 3px; 77 | text-align: center; 78 | background: #5fd2b5; 79 | color: #fff; 80 | width: 80px; 81 | height: 30px; 82 | line-height: 30px; 83 | margin: 0 10px 0 20px ; 84 | } 85 | .btn:hover { 86 | background: #4dddc0; 87 | color: #fff 88 | } 89 | -------------------------------------------------------------------------------- /src/main/webapp/view/station/css/list.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width: 100%; 3 | height:100%; 4 | background-color: #f3f7fb; 5 | } 6 | .body-box{ 7 | width: 100%; 8 | height:100%; 9 | } 10 | .header{ 11 | display: flex; 12 | align-items: center; 13 | height: 34px; 14 | background: #d6dde1; 15 | } 16 | .header h2{ 17 | background: url(../../../source/image/header_icon.png) no-repeat; 18 | padding: 0 0 0 20px; 19 | margin: 0 0 0 12px; 20 | } 21 | 22 | .search-box{ 23 | display: flex; 24 | padding: 15px 0 0 15px; 25 | } 26 | .search-box select{ 27 | border: 1px solid #dbe3e9; 28 | outline: 0; 29 | background-color:transparent; 30 | min-width: 150px; 31 | } 32 | .search-box .btn{ 33 | display: inline-block; 34 | border-radius: 5px; 35 | text-align: center; 36 | background: #5fd2b5; 37 | color: #fff; 38 | width: 80px; 39 | height: 30px; 40 | line-height: 30px; 41 | margin: 0 0 0 10px; 42 | outline: 0; 43 | cursor: pointer; 44 | } 45 | .search-box .btn:hover { 46 | background: #4dddc0; 47 | color: #fff 48 | } 49 | .search-box a{ 50 | display: inline-block; 51 | border-radius: 5px; 52 | text-align: center; 53 | background: #5fd2b5; 54 | color: #fff; 55 | width: 80px; 56 | height: 30px; 57 | line-height: 30px; 58 | margin: 0 0 0 10px; 59 | outline: 0; 60 | cursor: pointer; 61 | } 62 | 63 | .table-box{ 64 | border: 1px solid #dbe3e9; 65 | margin: 15px; 66 | margin-bottom: 65px; 67 | z-index: 0; 68 | } 69 | .table-head{ 70 | background: #f3f7fb; 71 | font-weight: 600; 72 | border-bottom: 1px solid #dde5eb; 73 | display: flex; 74 | align-items: center; 75 | } 76 | .table-head > *{ 77 | flex: 1; 78 | padding: 5px 5px 5px 5px; 79 | } 80 | 81 | .table-body .row{ 82 | border-bottom: 1px solid #dde5eb; 83 | display: flex; 84 | align-items: center; 85 | background-color: #fff; 86 | } 87 | .table-body .row:last-child{ 88 | border-bottom: 0 89 | } 90 | .table-body .row:nth-of-type(2n) { 91 | background: #f3f7fb; 92 | } 93 | .table-body .row:hover { 94 | background: #f9f8e8 95 | } 96 | .table-body .row > *{ 97 | flex: 1; 98 | padding: 5px 5px 5px 5px; 99 | overflow: hidden; 100 | } 101 | .table-body .row span{ 102 | color: #666; 103 | font-size: 14px; 104 | } 105 | .table-body .row a{ 106 | color: #2aafff; 107 | } 108 | .table-body .row a:hover{ 109 | color: #2aafff; 110 | text-decoration: underline; 111 | } 112 | .table-body .row img{ 113 | width: 80px; 114 | height: 80px; 115 | } 116 | -------------------------------------------------------------------------------- /src/main/webapp/view/station/css/update.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width: 100%; 3 | height:100%; 4 | background-color: #f3f7fb; 5 | } 6 | .body-box{ 7 | width: 100%; 8 | height:100%; 9 | display: flex; 10 | flex-direction: column; 11 | min-height:100vh; 12 | } 13 | .header{ 14 | display: flex; 15 | align-items: center; 16 | height: 34px; 17 | background: #d6dde1; 18 | } 19 | .header h2{ 20 | background: url(../../../source/image/header_icon.png) no-repeat; 21 | padding: 0 0 0 20px; 22 | margin: 0 0 0 12px; 23 | } 24 | .form-outer-box{ 25 | padding: 12px; 26 | flex: 1; 27 | } 28 | .form-box{ 29 | background-color: #fff; 30 | padding: 10px; 31 | display: flex; 32 | flex-direction: column; 33 | } 34 | .form-box .row{ 35 | display: flex; 36 | align-items: center; 37 | margin: 0 0 30px 0; 38 | } 39 | .form-box .row .lbl{ 40 | display: inline-block; 41 | width: 100px; 42 | text-align: right; 43 | padding: 0 4px 0 0; 44 | flex-shrink: 0; 45 | } 46 | .form-box .row .inp{ 47 | border: 1px solid #e7e7e7; 48 | outline: 0; 49 | padding: 0 5px 0 5px; 50 | height: 28px; 51 | line-height: 28px; 52 | font-size: 13px; 53 | width: 220px; 54 | } 55 | .form-box .row .inp:focus{ 56 | border: 1px solid #2aafff; 57 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); 58 | color: #333 59 | } 60 | .form-box .row .inp::-webkit-input-placeholder{ 61 | color: #ccc 62 | } 63 | .form-box .row .inp:-moz-placeholder{ 64 | color: #ccc 65 | } 66 | .form-box .row .inp:-ms-input-placeholder{ 67 | color: #ccc 68 | } 69 | .form-box .row textarea{ 70 | border: 1px solid #e7e7e7; 71 | outline: 0; 72 | padding: 0 5px 0 5px; 73 | } 74 | .btn{ 75 | display: inline-block; 76 | border-radius: 3px; 77 | text-align: center; 78 | background: #5fd2b5; 79 | color: #fff; 80 | width: 80px; 81 | height: 30px; 82 | line-height: 30px; 83 | margin: 0 10px 0 20px ; 84 | } 85 | .btn:hover { 86 | background: #4dddc0; 87 | color: #fff 88 | } 89 | -------------------------------------------------------------------------------- /src/main/webapp/view/station/js/add.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | //显示错误信息 4 | var showError = function(msg){ 5 | swal({ 6 | type: 'error', 7 | title: msg, 8 | showConfirmButton: false, 9 | timer: 2000 10 | }) 11 | } 12 | //提交 13 | $("#submit").on("click", function(){ 14 | var basePath = getBasePath(); 15 | var data = {}; 16 | //站台编号 17 | data.stationNo = $.trim($("input[name=stationNo]").val()); 18 | if (!data.stationNo) { 19 | showError("请输入站台编号!") 20 | return; 21 | } 22 | //站台名称 23 | data.name = $.trim($("input[name=name]").val()); 24 | if(!data.name ){ 25 | showError('请输入站台名称!'); 26 | return ; 27 | } 28 | //站台级别 29 | data.level = $.trim($("input[name=level]").val()); 30 | 31 | //是否有人值守 32 | data.hasWatch = $.trim($("input[name=hasWatch]").val()); 33 | //纬度 34 | data.lat = $.trim($("input[name=lat]").val()); 35 | //经度 36 | data.lng = $.trim($("input[name=lng]").val()); 37 | //高程 38 | data.elevation = $.trim($("input[name=elevation]").val()); 39 | //建成时间 40 | data.buildTime = $.trim($("input[name=buildTime]").val()); 41 | $.ajax({ 42 | url: getBasePath() + "/station/add.html", 43 | async : true, 44 | type: "post", 45 | dataType: "json", 46 | data: data, 47 | success: function (data) { 48 | if(data.code == 200){ 49 | swal({ 50 | type: 'success', 51 | title: "创建成功!", 52 | showConfirmButton: false, 53 | timer: 3000 54 | }) 55 | setTimeout(function(){ 56 | location.href = getBasePath() + "/station/list.html"; 57 | }, 3000); 58 | 59 | }else{ 60 | showError(data.data); 61 | } 62 | } 63 | }); 64 | }) 65 | }); -------------------------------------------------------------------------------- /src/main/webapp/view/station/js/list.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | //显示错误信息 3 | var showError = function(msg){ 4 | swal({ 5 | type: 'error', 6 | title: msg, 7 | showConfirmButton: false, 8 | timer: 2000 9 | }) 10 | } 11 | //删除 12 | $(".delete-btn").on("click", function(){ 13 | var id = $(this).attr("data-id"); 14 | swal({ 15 | title: '删除站台', 16 | text: '确认要删除该站台吗?', 17 | showCancelButton: true, 18 | confirmButtonText: '确认', 19 | cancelButtonText: '取消' 20 | }).then((result) => { 21 | if(result.value){ 22 | $.ajax({ 23 | url: getBasePath() + "/station/delete.html", 24 | async : true, 25 | type: "post", 26 | dataType: "json", 27 | data: {"id": id}, 28 | success: function (data) { 29 | if(data.code == 200){ 30 | swal({ 31 | type: 'success', 32 | title: "删除成功!", 33 | showConfirmButton: false, 34 | timer: 3000 35 | }) 36 | setTimeout(function(){ 37 | $(".search-box button[type=submit]").trigger("click"); 38 | }, 3000); 39 | 40 | }else{ 41 | showError(data.data); 42 | } 43 | } 44 | }); 45 | } 46 | }) 47 | }) 48 | }); -------------------------------------------------------------------------------- /src/main/webapp/view/station/js/update.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | //显示错误信息 4 | var showError = function(msg){ 5 | swal({ 6 | type: 'error', 7 | title: msg, 8 | showConfirmButton: false, 9 | timer: 2000 10 | }) 11 | } 12 | 13 | //提交 14 | $(".sub-btn").on("click", function(){ 15 | var basePath = getBasePath(); 16 | var data = {}; 17 | //站台编号 18 | data.stationNo = $.trim($("input[name=stationNo]").val()); 19 | if (!data.stationNo) { 20 | showError("请输入站台编号!") 21 | return; 22 | } 23 | //站台名称 24 | data.name = $.trim($("input[name=name]").val()); 25 | if(!data.name ){ 26 | showError('请输入站台名称!'); 27 | return ; 28 | } 29 | //站台级别 30 | data.level = $.trim($("input[name=level]").val()); 31 | 32 | //是否有人值守 33 | data.hasWatch = $.trim($("input[name=hasWatch]").val()); 34 | //纬度 35 | data.lat = $.trim($("input[name=lat]").val()); 36 | //经度 37 | data.lng = $.trim($("input[name=lng]").val()); 38 | //高程 39 | data.elevation = $.trim($("input[name=elevation]").val()); 40 | //建成时间 41 | data.buildTime = $.trim($("input[name=buildTime]").val()); 42 | 43 | data.id = $.trim($("input[name=id]").val()); 44 | $.ajax({ 45 | url: getBasePath() + "/station/update.html", 46 | async : true, 47 | type: "post", 48 | dataType: "json", 49 | data: data, 50 | success: function (data) { 51 | if(data.code == 200){ 52 | swal({ 53 | type: 'success', 54 | title: "修改成功!", 55 | showConfirmButton: false, 56 | timer: 3000 57 | }) 58 | setTimeout(function(){ 59 | location.href = getBasePath() + "/station/list.html"; 60 | }, 3000); 61 | 62 | }else{ 63 | showError(data.data); 64 | } 65 | } 66 | }); 67 | }) 68 | }); -------------------------------------------------------------------------------- /src/main/webapp/view/station/list.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ page import="java.util.*"%> 4 | <%@ page import="com.earth.station.model.Station" %> 5 | <%@ page import="com.earth.station.common.SessionUtil" %> 6 | <%@ page import="com.earth.station.model.StationUser" %> 7 | <%@ page import="com.earth.station.common.constant.UserConstant.Level" %> 8 | <%@ page import="com.earth.station.common.constant.SubjectConstant" %> 9 | <%@taglib uri="/y" prefix="my" %> 10 | <% 11 | String path = request.getContextPath(); 12 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path; 13 | StationUser user = (StationUser)request.getSession().getAttribute(SessionUtil.user); 14 | String name = (String) request.getAttribute("name"); 15 | name = name == null? "":name; 16 | Integer subject = (Integer) request.getAttribute("subject"); 17 | subject = subject== null? 0: subject; 18 | boolean isAdmin = Level.ADMIN.equals(user.getLevel()); 19 | %> 20 | 21 | 22 | 23 | 24 | 站台-地球物理台 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 38 | 39 | 40 |
41 |
42 |

站台列表

43 |
44 | 58 |
59 |
60 | <%--序号--%> 61 | 站台编码 62 | 台站 63 | 台站级别 64 | 是否有人值守 65 | 维度 66 | 经度 67 | 高程(米) 68 | 建成时间 69 | 测震 70 | 强震 71 | 地磁 72 | 流体 73 | GNSS 74 | 重力 75 | 形变 76 | 辅助 77 | <% if(isAdmin) {%> 78 | 操作 79 | <% } %> 80 |
81 |
82 | <% 83 | List list = (List)request.getAttribute("list"); 84 | for(int i=0; i< list.size(); i++){ 85 | %> 86 |
87 | <%--<%=i + 1%>--%> 88 | <%=list.get(i).getStationNo()%> 89 | <%=list.get(i).getName()%> 90 | <%=list.get(i).getLevel()%> 91 | <%=list.get(i).getHasWatch()%> 92 | <%=list.get(i).getLat()%> 93 | <%=list.get(i).getLng()%> 94 | <%=list.get(i).getElevation()%> 95 | <%=list.get(i).getBuildTime()%> 96 | 97 | <%if (list.get(i).getTestEq() == 0){%> 98 | <% if(isAdmin) {%> 99 | 添加 100 | <% } else { %> 101 | 无 102 | <% } %> 103 | <% } else {%> 104 | 详情 105 | <% } %> 106 | 107 | 108 | <%if (list.get(i).getStrongEq() == 0){%> 109 | <% if(isAdmin) {%> 110 | 添加 111 | <% } else { %> 112 | 无 113 | <% } %> 114 | <% } else {%> 115 | 详情 116 | <% } %> 117 | 118 | 119 | <%if (list.get(i).getTm() == 0){%> 120 | <% if(isAdmin) {%> 121 | 添加 122 | <% } else { %> 123 | 无 124 | <% } %> 125 | <% } else {%> 126 | 详情 127 | <% } %> 128 | 129 | 130 | <%if (list.get(i).getLiquid() == 0){%> 131 | <% if(isAdmin) {%> 132 | 添加 133 | <% } else { %> 134 | 无 135 | <% } %> 136 | <% } else {%> 137 | 详情 138 | <% } %> 139 | 140 | 141 | <%if (list.get(i).getGnss() == 0){%> 142 | <% if(isAdmin) {%> 143 | 添加 144 | <% } else { %> 145 | 无 146 | <% } %> 147 | <% } else {%> 148 | 详情 149 | <% } %> 150 | 151 | 152 | <%if (list.get(i).getGravity() == 0){%> 153 | <% if(isAdmin) {%> 154 | 添加 155 | <% } else { %> 156 | 无 157 | <% } %> 158 | <% } else {%> 159 | 详情 160 | <% } %> 161 | 162 | 163 | <%if (list.get(i).getDeformation() == 0){%> 164 | <% if(isAdmin) {%> 165 | 添加 166 | <% } else { %> 167 | 无 168 | <% } %> 169 | <% } else {%> 170 | 详情 171 | <% } %> 172 | 173 | 174 | <%if (list.get(i).getAid() == 0){%> 175 | <% if(isAdmin) {%> 176 | 添加 177 | <% } else { %> 178 | 无 179 | <%}%> 180 | <% } else {%> 181 | 详情 182 | <% } %> 183 | 184 | <% if(isAdmin) { %> 185 | 186 | 编辑 187 | 删除 188 | 189 | <% } %> 190 |
191 | <%}%> 192 |
193 |
194 |
195 | 196 | 197 | -------------------------------------------------------------------------------- /src/main/webapp/view/station/update.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="com.earth.station.model.Station" %> 2 | <%@ page language="java" contentType="text/html; charset=UTF-8" 3 | pageEncoding="UTF-8"%> 4 | <% 5 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path; 7 | %> 8 | <% 9 | Station entity = (Station)request.getAttribute("entity"); 10 | %> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 |
32 |
33 |

修改站台

34 |
35 |
36 |
37 |
38 | 站台编号: 39 | 40 |
41 |
42 | 站台: 43 | 44 |
45 |
46 | 台站级别: 47 | 48 |
49 |
50 | 是否有人值守: 51 | 52 |
53 |
54 | 纬度: 55 | 56 |
57 |
58 | 经度: 59 | 60 |
61 |
62 | 高程(米): 63 | 64 |
65 |
66 | 台站建成时间: 67 | 68 |
69 |
70 | 71 | 提交 72 |
73 |
74 |
75 |
76 | 77 | 78 | -------------------------------------------------------------------------------- /src/main/webapp/view/subject/add.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="com.earth.station.common.constant.SubjectConstant" %> 2 | <%@ page import="static com.earth.station.common.constant.SubjectConstant.STRONG_EQ" %> 3 | <%@ page import="static com.earth.station.common.constant.SubjectConstant.SUBJECT_MAPPING" %> 4 | <%@ page language="java" contentType="text/html; charset=UTF-8" 5 | pageEncoding="UTF-8"%> 6 | <% 7 | String path = request.getContextPath(); 8 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path; 9 | Integer stationId = (Integer) request.getAttribute("stationId"); 10 | Integer type = (Integer) request.getAttribute("type"); 11 | %> 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 |
33 |
34 |

添加学科(<%=SUBJECT_MAPPING.get(type)%>)

35 |
36 |
37 |
38 | 39 | 40 | <% if (SubjectConstant.TEST_EQ.equals(type)) { %> 41 |
42 | 地震计型号: 43 | 44 |
45 |
46 | 数采型号: 47 | 48 |
49 |
50 | 场地类型: 51 | 52 |
53 |
54 | 仪器序列号: 55 | 56 |
57 |
58 | 仪器生产厂家: 59 | 60 |
61 |
62 | IP地址: 63 | 64 |
65 |
66 | 传输方式: 67 | 68 |
69 |
70 | 运行日期: 71 | 72 |
73 | <% } else if (STRONG_EQ.equals(type)) { %> 74 |
75 | 加速度计型号: 76 | 77 |
78 |
79 | 数采型号: 80 | 81 |
82 |
83 | 场地类型: 84 | 85 |
86 |
87 | 仪器序列号: 88 | 89 |
90 |
91 | 仪器生产厂家: 92 | 93 |
94 |
95 | IP地址: 96 | 97 |
98 |
99 | 传输方式: 100 | 101 |
102 |
103 | 运行日期: 104 | 105 |
106 | <% } else {%> 107 |
108 | 测点编码: 109 | 110 |
111 |
112 | 仪器名称: 113 | 114 |
115 |
116 | 仪器型号: 117 | 118 |
119 |
120 | 仪器ID: 121 | 122 |
123 |
124 | 采样率: 125 | 126 |
127 |
128 | 观测时间: 129 | 130 |
131 |
132 | 运行状态: 133 | 134 |
135 | <% } %> 136 |
137 | 备注: 138 | 139 |
140 |
141 | 提交 142 |
143 |
144 |
145 |
146 | 147 | 148 | -------------------------------------------------------------------------------- /src/main/webapp/view/subject/css/add.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width: 100%; 3 | height:100%; 4 | background-color: #f3f7fb; 5 | } 6 | .body-box{ 7 | width: 100%; 8 | height:100%; 9 | display: flex; 10 | flex-direction: column; 11 | min-height:100vh; 12 | } 13 | .header{ 14 | display: flex; 15 | align-items: center; 16 | height: 34px; 17 | background: #d6dde1; 18 | } 19 | .header h2{ 20 | background: url(../../../source/image/header_icon.png) no-repeat; 21 | padding: 0 0 0 20px; 22 | margin: 0 0 0 12px; 23 | } 24 | .form-outer-box{ 25 | padding: 12px; 26 | flex: 1; 27 | } 28 | .form-box{ 29 | background-color: #fff; 30 | padding: 10px; 31 | display: flex; 32 | flex-direction: column; 33 | } 34 | .form-box .row{ 35 | display: flex; 36 | align-items: center; 37 | margin: 0 0 30px 0; 38 | } 39 | .form-box .row .lbl{ 40 | display: inline-block; 41 | width: 100px; 42 | text-align: right; 43 | padding: 0 4px 0 0; 44 | flex-shrink: 0; 45 | } 46 | .form-box .row .inp{ 47 | border: 1px solid #e7e7e7; 48 | outline: 0; 49 | padding: 0 5px 0 5px; 50 | height: 28px; 51 | line-height: 28px; 52 | font-size: 13px; 53 | width: 220px; 54 | } 55 | .form-box .row textarea{ 56 | border: 1px solid #e7e7e7; 57 | outline: 0; 58 | padding: 0 5px 0 5px; 59 | } 60 | .form-box .row .inp:focus{ 61 | border: 1px solid #2aafff; 62 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); 63 | color: #333 64 | } 65 | .form-box .row .inp::-webkit-input-placeholder{ 66 | color: #ccc 67 | } 68 | .form-box .row .inp:-moz-placeholder{ 69 | color: #ccc 70 | } 71 | .form-box .row .inp:-ms-input-placeholder{ 72 | color: #ccc 73 | } 74 | .btn{ 75 | display: inline-block; 76 | border-radius: 3px; 77 | text-align: center; 78 | background: #5fd2b5; 79 | color: #fff; 80 | width: 80px; 81 | height: 30px; 82 | line-height: 30px; 83 | margin: 0 10px 0 20px ; 84 | } 85 | .btn:hover { 86 | background: #4dddc0; 87 | color: #fff 88 | } 89 | -------------------------------------------------------------------------------- /src/main/webapp/view/subject/css/list.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width: 100%; 3 | height:100%; 4 | background-color: #f3f7fb; 5 | } 6 | .body-box{ 7 | width: 100%; 8 | height:100%; 9 | } 10 | .header{ 11 | display: flex; 12 | align-items: center; 13 | height: 34px; 14 | background: #d6dde1; 15 | } 16 | .header h2{ 17 | background: url(../../../source/image/header_icon.png) no-repeat; 18 | padding: 0 0 0 20px; 19 | margin: 0 0 0 12px; 20 | } 21 | 22 | .search-box{ 23 | display: flex; 24 | padding: 15px 0 0 15px; 25 | } 26 | .search-box select{ 27 | border: 1px solid #dbe3e9; 28 | outline: 0; 29 | background-color:transparent; 30 | min-width: 150px; 31 | } 32 | .search-box .btn{ 33 | display: inline-block; 34 | border-radius: 5px; 35 | text-align: center; 36 | background: #5fd2b5; 37 | color: #fff; 38 | width: 80px; 39 | height: 30px; 40 | line-height: 30px; 41 | margin: 0 0 0 10px; 42 | outline: 0; 43 | cursor: pointer; 44 | } 45 | .search-box .btn:hover { 46 | background: #4dddc0; 47 | color: #fff 48 | } 49 | .search-box a{ 50 | display: inline-block; 51 | border-radius: 5px; 52 | text-align: center; 53 | background: #5fd2b5; 54 | color: #fff; 55 | width: 80px; 56 | height: 30px; 57 | line-height: 30px; 58 | margin: 0 0 0 10px; 59 | outline: 0; 60 | cursor: pointer; 61 | } 62 | 63 | .table-box{ 64 | border: 1px solid #dbe3e9; 65 | margin: 15px; 66 | margin-bottom: 65px; 67 | z-index: 0; 68 | } 69 | .table-head{ 70 | background: #f3f7fb; 71 | font-weight: 600; 72 | border-bottom: 1px solid #dde5eb; 73 | display: flex; 74 | align-items: center; 75 | } 76 | .table-head > *{ 77 | flex: 1; 78 | padding: 5px 5px 5px 5px; 79 | } 80 | 81 | .table-body .row{ 82 | border-bottom: 1px solid #dde5eb; 83 | display: flex; 84 | align-items: center; 85 | background-color: #fff; 86 | } 87 | .table-body .row:last-child{ 88 | border-bottom: 0 89 | } 90 | .table-body .row:nth-of-type(2n) { 91 | background: #f3f7fb; 92 | } 93 | .table-body .row:hover { 94 | background: #f9f8e8 95 | } 96 | .table-body .row > *{ 97 | flex: 1; 98 | padding: 5px 5px 5px 5px; 99 | overflow: hidden; 100 | } 101 | .table-body .row span{ 102 | color: #666; 103 | font-size: 14px; 104 | } 105 | .table-body .row a{ 106 | color: #2aafff; 107 | } 108 | .table-body .row a:hover{ 109 | color: #2aafff; 110 | text-decoration: underline; 111 | } 112 | .table-body .row img{ 113 | width: 80px; 114 | height: 80px; 115 | } 116 | -------------------------------------------------------------------------------- /src/main/webapp/view/subject/css/update.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width: 100%; 3 | height:100%; 4 | background-color: #f3f7fb; 5 | } 6 | .body-box{ 7 | width: 100%; 8 | height:100%; 9 | display: flex; 10 | flex-direction: column; 11 | min-height:100vh; 12 | } 13 | .header{ 14 | display: flex; 15 | align-items: center; 16 | height: 34px; 17 | background: #d6dde1; 18 | } 19 | .header h2{ 20 | background: url(../../../source/image/header_icon.png) no-repeat; 21 | padding: 0 0 0 20px; 22 | margin: 0 0 0 12px; 23 | } 24 | .form-outer-box{ 25 | padding: 12px; 26 | flex: 1; 27 | } 28 | .form-box{ 29 | background-color: #fff; 30 | padding: 10px; 31 | display: flex; 32 | flex-direction: column; 33 | } 34 | .form-box .row{ 35 | display: flex; 36 | align-items: center; 37 | margin: 0 0 30px 0; 38 | } 39 | .form-box .row .lbl{ 40 | display: inline-block; 41 | width: 100px; 42 | text-align: right; 43 | padding: 0 4px 0 0; 44 | flex-shrink: 0; 45 | } 46 | .form-box .row .inp{ 47 | border: 1px solid #e7e7e7; 48 | outline: 0; 49 | padding: 0 5px 0 5px; 50 | height: 28px; 51 | line-height: 28px; 52 | font-size: 13px; 53 | width: 220px; 54 | } 55 | .form-box .row .inp:focus{ 56 | border: 1px solid #2aafff; 57 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); 58 | color: #333 59 | } 60 | .form-box .row .inp::-webkit-input-placeholder{ 61 | color: #ccc 62 | } 63 | .form-box .row .inp:-moz-placeholder{ 64 | color: #ccc 65 | } 66 | .form-box .row .inp:-ms-input-placeholder{ 67 | color: #ccc 68 | } 69 | .form-box .row textarea{ 70 | border: 1px solid #e7e7e7; 71 | outline: 0; 72 | padding: 0 5px 0 5px; 73 | } 74 | .btn{ 75 | display: inline-block; 76 | border-radius: 3px; 77 | text-align: center; 78 | background: #5fd2b5; 79 | color: #fff; 80 | width: 80px; 81 | height: 30px; 82 | line-height: 30px; 83 | margin: 0 10px 0 20px ; 84 | } 85 | .btn:hover { 86 | background: #4dddc0; 87 | color: #fff 88 | } 89 | -------------------------------------------------------------------------------- /src/main/webapp/view/subject/js/add.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | //显示错误信息 4 | var showError = function(msg){ 5 | swal({ 6 | type: 'error', 7 | title: msg, 8 | showConfirmButton: false, 9 | timer: 2000 10 | }) 11 | } 12 | //提交 13 | $(".sub-btn").on("click", function(){ 14 | var basePath = getBasePath(); 15 | var data = {}; 16 | //站台ID 17 | data.stationId = $.trim($("input[name=stationId]").val()); 18 | //x学科 19 | data.type = $.trim($("input[name=type]").val()); 20 | //详情内容 21 | var content = []; 22 | $(".row input").each(function(){ 23 | content.push([$(this).attr("name"), $.trim($(this).val())]); 24 | }); 25 | data.content = JSON.stringify(content); 26 | $.ajax({ 27 | url: getBasePath() + "/subject/add.html", 28 | async : true, 29 | type: "post", 30 | dataType: "json", 31 | data: data, 32 | success: function (data) { 33 | if(data.code == 200){ 34 | swal({ 35 | type: 'success', 36 | title: "创建成功!", 37 | showConfirmButton: false, 38 | timer: 3000 39 | }) 40 | setTimeout(function(){ 41 | location.href = getBasePath() + "/station/list.html"; 42 | }, 3000); 43 | 44 | }else{ 45 | showError(data.data); 46 | } 47 | } 48 | }); 49 | }) 50 | }); -------------------------------------------------------------------------------- /src/main/webapp/view/subject/js/list.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | //显示错误信息 3 | var showError = function(msg){ 4 | swal({ 5 | type: 'error', 6 | title: msg, 7 | showConfirmButton: false, 8 | timer: 2000 9 | }) 10 | } 11 | //删除 12 | $(".delete-btn").on("click", function(){ 13 | var id = $(this).attr("data-id"); 14 | swal({ 15 | title: '删除学科', 16 | text: '确认要删除该学科吗?', 17 | showCancelButton: true, 18 | confirmButtonText: '确认', 19 | cancelButtonText: '取消' 20 | }).then((result) => { 21 | if(result.value){ 22 | $.ajax({ 23 | url: getBasePath() + "/subject/delete.html", 24 | async : true, 25 | type: "post", 26 | dataType: "json", 27 | data: {"id": id}, 28 | success: function (data) { 29 | if(data.code == 200){ 30 | swal({ 31 | type: 'success', 32 | title: "删除成功!", 33 | showConfirmButton: false, 34 | timer: 3000 35 | }) 36 | setTimeout(function(){ 37 | location.href = getBasePath() + "/station/list.html"; 38 | }, 3000); 39 | 40 | }else{ 41 | showError(data.data); 42 | } 43 | } 44 | }); 45 | } 46 | }) 47 | }) 48 | }); -------------------------------------------------------------------------------- /src/main/webapp/view/subject/js/update.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | //显示错误信息 4 | var showError = function(msg){ 5 | swal({ 6 | type: 'error', 7 | title: msg, 8 | showConfirmButton: false, 9 | timer: 2000 10 | }) 11 | } 12 | 13 | //提交 14 | $(".sub-btn").on("click", function(){ 15 | var basePath = getBasePath(); 16 | var data = {}; 17 | data.id = $.trim($("input[name=id]").val()); 18 | //详情内容 19 | var content = []; 20 | $(".row input").each(function(){ 21 | content.push([$(this).attr("name"), $.trim($(this).val())]); 22 | }); 23 | data.content = JSON.stringify(content); 24 | $.ajax({ 25 | url: getBasePath() + "/subject/update.html", 26 | async : true, 27 | type: "post", 28 | dataType: "json", 29 | data: data, 30 | success: function (data) { 31 | if(data.code == 200){ 32 | swal({ 33 | type: 'success', 34 | title: "修改成功!", 35 | showConfirmButton: false, 36 | timer: 3000 37 | }) 38 | setTimeout(function(){ 39 | location.href = getBasePath() + "/subject/list.html?id=" + dataId; 40 | }, 3000); 41 | 42 | }else{ 43 | showError(data.data); 44 | } 45 | } 46 | }); 47 | }) 48 | }); -------------------------------------------------------------------------------- /src/main/webapp/view/subject/list.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ page import="java.util.*"%> 4 | <%@ page import="com.earth.station.model.Station" %> 5 | <%@ page import="com.earth.station.model.Subject" %> 6 | <%@ page import="com.alibaba.fastjson.JSONObject" %> 7 | <%@ page import="com.alibaba.fastjson.JSON" %> 8 | <%@ page import="static com.earth.station.common.constant.SubjectConstant.SUBJECT_MAPPING" %> 9 | <%@ page import="com.alibaba.fastjson.JSONArray" %> 10 | <%@ page import="com.earth.station.common.SessionUtil" %> 11 | <%@ page import="com.earth.station.common.constant.UserConstant.Level" %> 12 | <%@ page import="com.earth.station.model.StationUser" %> 13 | <%@taglib uri="/y" prefix="my" %> 14 | <% 15 | String path = request.getContextPath(); 16 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path; 17 | Station station = (Station) request.getAttribute("station"); 18 | Subject subject = (Subject) request.getAttribute("subject"); 19 | JSONArray array = JSON.parseArray(subject.getContent()); 20 | boolean isAdmin = Level.ADMIN.equals(((StationUser)request.getSession().getAttribute(SessionUtil.user)).getLevel()); 21 | %> 22 | 23 | 24 | 25 | 26 | 学科-地球物理台 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 40 | 41 | 42 |
43 |
44 |

<%=station.getStationNo()%>-<%=station.getName()%>-<%=SUBJECT_MAPPING.get(subject.getType())%>

45 |
46 |
47 |
48 | 台站编码 49 | 台站名称 50 | <% for (int i = 0; i < array.size(); i++){ %> 51 | <%=array.getJSONArray(i).getString(0)%> 52 | <%}%> 53 | <% if (isAdmin) {%> 54 | 操作 55 | <% } %> 56 |
57 |
58 |
59 | <%=station.getStationNo()%> 60 | <%=station.getName()%> 61 | <% for (int i=0; i< array.size(); i++){ %> 62 | <%=array.getJSONArray(i).getString(1)%> 63 | <%}%> 64 | <% if (isAdmin) {%> 65 | 66 | 编辑 67 | 删除 68 | 69 | <% } %> 70 |
71 |
72 |
73 |
74 | 75 | 76 | -------------------------------------------------------------------------------- /src/main/webapp/view/subject/update.jsp: -------------------------------------------------------------------------------- 1 | <%@ page import="com.earth.station.model.Subject" %> 2 | <%@ page import="com.alibaba.fastjson.JSON" %> 3 | <%@ page import="com.alibaba.fastjson.JSONArray" %> 4 | <%@ page language="java" contentType="text/html; charset=UTF-8" 5 | pageEncoding="UTF-8"%> 6 | <% 7 | String path = request.getContextPath(); 8 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path; 9 | Subject entity = (Subject)request.getAttribute("subject"); 10 | JSONArray content = JSON.parseArray(entity.getContent()); 11 | %> 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 |
34 |
35 |

修改学科

36 |
37 |
38 |
39 | <% for (int i=0; i< content.size(); i++) {%> 40 |
41 | <%=content.getJSONArray(i).getString(0)%>: 42 | 43 |
44 | <%}%> 45 | 46 |
47 | 提交 48 |
49 |
50 |
51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /src/main/webapp/view/user/css/add.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width: 100%; 3 | height:100%; 4 | background-color: #f3f7fb; 5 | } 6 | .body-box{ 7 | width: 100%; 8 | height:100%; 9 | display: flex; 10 | flex-direction: column; 11 | min-height:100vh; 12 | } 13 | .header{ 14 | display: flex; 15 | align-items: center; 16 | height: 34px; 17 | background: #d6dde1; 18 | } 19 | .header h2{ 20 | background: url(../../../source/image/header_icon.png) no-repeat; 21 | padding: 0 0 0 20px; 22 | margin: 0 0 0 12px; 23 | } 24 | .form-outer-box{ 25 | padding: 12px; 26 | flex: 1; 27 | } 28 | .form-box{ 29 | background-color: #fff; 30 | padding: 10px; 31 | display: flex; 32 | flex-direction: column; 33 | } 34 | .form-box .row{ 35 | display: flex; 36 | align-items: center; 37 | margin: 0 0 30px 0; 38 | } 39 | .form-box .row .lbl{ 40 | display: inline-block; 41 | width: 100px; 42 | text-align: right; 43 | padding: 0 4px 0 0; 44 | flex-shrink: 0; 45 | } 46 | .form-box .row .inp{ 47 | border: 1px solid #e7e7e7; 48 | outline: 0; 49 | padding: 0 5px 0 5px; 50 | height: 28px; 51 | line-height: 28px; 52 | font-size: 13px; 53 | width: 220px; 54 | } 55 | .form-box .row .inp:focus{ 56 | border: 1px solid #2aafff; 57 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); 58 | color: #333 59 | } 60 | .form-box .row .inp::-webkit-input-placeholder{ 61 | color: #ccc 62 | } 63 | .form-box .row .inp:-moz-placeholder{ 64 | color: #ccc 65 | } 66 | .form-box .row .inp:-ms-input-placeholder{ 67 | color: #ccc 68 | } 69 | .btn{ 70 | display: inline-block; 71 | border-radius: 3px; 72 | text-align: center; 73 | background: #5fd2b5; 74 | color: #fff; 75 | width: 80px; 76 | height: 30px; 77 | line-height: 30px; 78 | margin: 0 10px 0 20px ; 79 | } 80 | .btn:hover { 81 | background: #4dddc0; 82 | color: #fff 83 | } -------------------------------------------------------------------------------- /src/main/webapp/view/user/css/list.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width: 100%; 3 | height:100%; 4 | background-color: #f3f7fb; 5 | } 6 | .body-box{ 7 | width: 100%; 8 | height:100%; 9 | } 10 | .header{ 11 | display: flex; 12 | align-items: center; 13 | height: 34px; 14 | background: #d6dde1; 15 | } 16 | .header h2{ 17 | background: url(../../../source/image/header_icon.png) no-repeat; 18 | padding: 0 0 0 20px; 19 | margin: 0 0 0 12px; 20 | } 21 | 22 | .search-box{ 23 | display: flex; 24 | padding: 15px 0 0 15px; 25 | } 26 | .search-box select{ 27 | border: 1px solid #dbe3e9; 28 | outline: 0; 29 | background-color:transparent; 30 | min-width: 150px; 31 | } 32 | .search-box .btn{ 33 | display: inline-block; 34 | border-radius: 5px; 35 | text-align: center; 36 | background: #5fd2b5; 37 | color: #fff; 38 | width: 80px; 39 | height: 30px; 40 | line-height: 30px; 41 | margin: 0 0 0 10px; 42 | outline: 0; 43 | cursor: pointer; 44 | } 45 | .search-box .btn:hover { 46 | background: #4dddc0; 47 | color: #fff 48 | } 49 | .search-box a{ 50 | display: inline-block; 51 | border-radius: 5px; 52 | text-align: center; 53 | background: #5fd2b5; 54 | color: #fff; 55 | width: 80px; 56 | height: 30px; 57 | line-height: 30px; 58 | margin: 0 0 0 10px; 59 | outline: 0; 60 | cursor: pointer; 61 | } 62 | 63 | .table-box{ 64 | border: 1px solid #dbe3e9; 65 | margin: 15px; 66 | margin-bottom: 65px; 67 | z-index: 0; 68 | } 69 | .table-head{ 70 | background: #f3f7fb; 71 | font-weight: 600; 72 | border-bottom: 1px solid #dde5eb; 73 | display: flex; 74 | align-items: center; 75 | } 76 | .table-head > *{ 77 | flex: 1; 78 | padding: 5px 5px 5px 5px; 79 | } 80 | 81 | .table-body .row{ 82 | border-bottom: 1px solid #dde5eb; 83 | display: flex; 84 | align-items: center; 85 | background-color: #fff; 86 | } 87 | .table-body .row:last-child{ 88 | border-bottom: 0 89 | } 90 | .table-body .row:nth-of-type(2n) { 91 | background: #f3f7fb; 92 | } 93 | .table-body .row:hover { 94 | background: #f9f8e8 95 | } 96 | .table-body .row > *{ 97 | flex: 1; 98 | padding: 5px 5px 5px 5px; 99 | overflow: hidden; 100 | } 101 | .table-body .row span{ 102 | color: #666; 103 | font-size: 14px; 104 | } 105 | .table-body .row a{ 106 | color: #2aafff; 107 | } 108 | .table-body .row a:hover{ 109 | color: #2aafff; 110 | text-decoration: underline; 111 | } 112 | -------------------------------------------------------------------------------- /src/main/webapp/view/user/css/update.css: -------------------------------------------------------------------------------- 1 | body{ 2 | width: 100%; 3 | height:100%; 4 | background-color: #f3f7fb; 5 | } 6 | .body-box{ 7 | width: 100%; 8 | height:100%; 9 | display: flex; 10 | flex-direction: column; 11 | min-height:100vh; 12 | } 13 | .header{ 14 | display: flex; 15 | align-items: center; 16 | height: 34px; 17 | background: #d6dde1; 18 | } 19 | .header h2{ 20 | background: url(../../../../source/image/header_icon.png) no-repeat; 21 | padding: 0 0 0 20px; 22 | margin: 0 0 0 12px; 23 | } 24 | .form-outer-box{ 25 | padding: 12px; 26 | flex: 1; 27 | } 28 | .form-box{ 29 | background-color: #fff; 30 | padding: 10px; 31 | display: flex; 32 | flex-direction: column; 33 | } 34 | .form-box .row{ 35 | display: flex; 36 | align-items: center; 37 | margin: 0 0 30px 0; 38 | } 39 | .form-box .row .lbl{ 40 | display: inline-block; 41 | width: 100px; 42 | text-align: right; 43 | padding: 0 4px 0 0; 44 | flex-shrink: 0; 45 | } 46 | .form-box .row .inp{ 47 | border: 1px solid #e7e7e7; 48 | outline: 0; 49 | padding: 0 5px 0 5px; 50 | height: 28px; 51 | line-height: 28px; 52 | font-size: 13px; 53 | width: 220px; 54 | } 55 | .form-box .row .inp:focus{ 56 | border: 1px solid #2aafff; 57 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); 58 | color: #333 59 | } 60 | .form-box .row .inp::-webkit-input-placeholder{ 61 | color: #ccc 62 | } 63 | .form-box .row .inp:-moz-placeholder{ 64 | color: #ccc 65 | } 66 | .form-box .row .inp:-ms-input-placeholder{ 67 | color: #ccc 68 | } 69 | .btn{ 70 | display: inline-block; 71 | border-radius: 3px; 72 | text-align: center; 73 | background: #5fd2b5; 74 | color: #fff; 75 | width: 80px; 76 | height: 30px; 77 | line-height: 30px; 78 | margin: 0 10px 0 20px ; 79 | } 80 | .btn:hover { 81 | background: #4dddc0; 82 | color: #fff 83 | } -------------------------------------------------------------------------------- /src/main/webapp/view/user/js/add.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | //显示错误信息 4 | var showError = function(msg){ 5 | swal({ 6 | type: 'error', 7 | title: msg, 8 | showConfirmButton: false, 9 | timer: 2000 10 | }) 11 | } 12 | //提交 13 | $(".sub-btn").on("click", function(){ 14 | var basePath = getBasePath(); 15 | var data = {}; 16 | //账号 17 | data.loginId = $.trim($("input[name=loginId]").val()); 18 | if(data.loginId == ''){ 19 | showError('请输入账号!'); 20 | return ; 21 | } 22 | //密码 23 | data.password = $.trim($("input[name=password]").val()); 24 | if(data.password == ''){ 25 | showError('请输入密码!'); 26 | return ; 27 | } 28 | $.ajax({ 29 | url: getBasePath() + "/admin/add.html", 30 | async : true, 31 | type: "post", 32 | dataType: "json", 33 | data: data, 34 | success: function (data) { 35 | if(data.code == 200){ 36 | swal({ 37 | type: 'success', 38 | title: "创建成功!", 39 | showConfirmButton: false, 40 | timer: 3000 41 | }) 42 | setTimeout(function(){ 43 | location.href = getBasePath() + "/admin/list.html"; 44 | }, 3000); 45 | 46 | }else{ 47 | showError(data.data); 48 | } 49 | } 50 | }); 51 | }) 52 | }); -------------------------------------------------------------------------------- /src/main/webapp/view/user/js/update.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | //显示错误信息 4 | var showError = function(msg){ 5 | swal({ 6 | type: 'error', 7 | title: msg, 8 | showConfirmButton: false, 9 | timer: 2000 10 | }) 11 | } 12 | //提交 13 | $(".sub-btn").on("click", function(){ 14 | var basePath = getBasePath(); 15 | var data = {}; 16 | //密码 17 | data.password = $.trim($("input[name=password]").val()); 18 | if(data.password == ''){ 19 | showError('请输入密码!'); 20 | return ; 21 | } 22 | //状态 23 | data.id = $.trim($("input[name=id]").val()); 24 | $.ajax({ 25 | url: getBasePath() + "/user/update.html", 26 | async : true, 27 | type: "post", 28 | dataType: "json", 29 | data: data, 30 | success: function (data) { 31 | if(data.code == 200){ 32 | swal({ 33 | type: 'success', 34 | title: "修改成功!", 35 | showConfirmButton: false, 36 | timer: 3000 37 | }) 38 | setTimeout(function(){ 39 | location.href = getBasePath() + "/login.html"; 40 | }, 3000); 41 | 42 | }else{ 43 | showError(data.data); 44 | } 45 | } 46 | }); 47 | }) 48 | bindDelEventForBranch(); 49 | }); -------------------------------------------------------------------------------- /src/main/webapp/view/user/update.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ page import="com.earth.station.model.StationUser" %> 4 | <% 5 | String path = request.getContextPath(); 6 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path; 7 | %> 8 | <% 9 | StationUser user = (StationUser)request.getAttribute("entity"); 10 | %> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 |
32 |
33 |

修改密码

34 |
35 |
36 |
37 |
38 | 账号: 39 | <%=user.getUserName() %> 40 |
41 |
42 | 密码: 43 | 44 |
45 |
46 | 47 | 提交 48 |
49 |
50 |
51 |
52 | 53 | 54 | --------------------------------------------------------------------------------