1个文件已删除
49个文件已添加
368个文件已修改
| | |
| | | /nbdist/ |
| | | /.nb-gradle/ |
| | | build/ |
| | | output/ |
| | | |
| | | ### VS Code ### |
| | | .vscode/ |
| New file |
| | |
| | | # WCS 国际化语言包说明 |
| | | |
| | | ## 读取位置 |
| | | |
| | | 当前实现有两层语言包来源: |
| | | |
| | | 1. 内置语言包 |
| | | |
| | | ```text |
| | | classpath:/i18n/<locale>/ |
| | | ``` |
| | | |
| | | 也就是仓库里的: |
| | | |
| | | ```text |
| | | src/main/resources/i18n/<locale>/ |
| | | ``` |
| | | |
| | | 这一层是项目自带的默认语言包,保证系统开箱可用。 |
| | | |
| | | 2. 外置语言包 |
| | | |
| | | ```text |
| | | ./stock/out/wcs/i18n/<locale>/ |
| | | ``` |
| | | |
| | | 这一层是运行时可安装、可替换、可覆盖的语言包目录,对应 `application.yml` 里的 `app.i18n.pack-path`。 |
| | | |
| | | 实际加载顺序: |
| | | |
| | | 1. 先读内置语言包 |
| | | 2. 再读外置语言包 |
| | | 3. 外置语言包同名 key 会覆盖内置值 |
| | | |
| | | 当前已配置语言: |
| | | |
| | | - `zh-CN` |
| | | - `en-US` |
| | | |
| | | 外置目录示例: |
| | | |
| | | ```text |
| | | stock/out/wcs/i18n/ |
| | | en-US/ |
| | | messages.properties |
| | | legacy.properties |
| | | zh-CN/ |
| | | messages.properties |
| | | legacy.properties |
| | | ``` |
| | | |
| | | ## 文件用途 |
| | | |
| | | ### `messages.properties` |
| | | |
| | | 用于稳定的 key 形式国际化。 |
| | | |
| | | 适合以下内容: |
| | | |
| | | - 菜单名称 |
| | | - 页面标题 |
| | | - 对话框标题 |
| | | - 按钮文案 |
| | | - 状态名称 |
| | | - 新增功能文案 |
| | | |
| | | ### `legacy.properties` |
| | | |
| | | 用于旧页面的纯文本兼容替换。 |
| | | |
| | | 这个项目里老的 Layui/jQuery 页面很多,存在大量直接写死的中文;这层是过渡方案,便于先让英文可用,再逐步把旧页面改成 key 化。 |
| | | |
| | | ## key 规则 |
| | | |
| | | ### 菜单 / 资源 key |
| | | |
| | | 后端菜单翻译 key 由 `sys_resource.code` 推导。 |
| | | |
| | | 例如: |
| | | |
| | | ```properties |
| | | resource.develop=Development |
| | | resource.ai.llm_config=AI Configuration |
| | | resource.notifyReport.notifyReport=Notification Report |
| | | resource.ai.llm_config.view=View |
| | | ``` |
| | | |
| | | ### 权限 key |
| | | |
| | | 权限翻译 key 由 `action` 推导。 |
| | | |
| | | 例如: |
| | | |
| | | ```properties |
| | | permission.function=Specified Functions |
| | | permission.user.resetPassword=Reset Password |
| | | ``` |
| | | |
| | | ### 通用 UI key |
| | | |
| | | 例如: |
| | | |
| | | ```properties |
| | | common.profile=Profile |
| | | common.logout=Log Out |
| | | index.homeTab=Control Center |
| | | login.title=WCS System V3.0 |
| | | ``` |
| | | |
| | | ## 安装语言包 |
| | | |
| | | 如果只是使用项目自带中文和英文,不需要额外操作。 |
| | | |
| | | 如果要安装外置语言包,按下面做: |
| | | |
| | | 1. 在 `stock/out/wcs/i18n/` 下创建新语言目录。 |
| | | 2. 从现有语言包复制 `messages.properties` 和 `legacy.properties` 作为模板。 |
| | | 3. 只翻译 value,不要改 key。 |
| | | 4. 刷新页面,或重启服务。 |
| | | |
| | | 系统会按配置周期检查外置目录,因此简单文本调整理论上不必重启;但正式环境建议仍按发布流程重启或重载。 |
| | | |
| | | ## 推荐维护方式 |
| | | |
| | | 1. 新增页面和新增接口文案,优先写入 `messages.properties`。 |
| | | 2. 老页面先通过 `legacy.properties` 兼容,不要一开始就全量重构。 |
| | | 3. 某个老页面重构时,再把它的纯文本逐步迁移到显式 key。 |
| | | |
| | | ## 说明 |
| | | |
| | | - 默认语言是 `zh-CN` |
| | | - 前端请求会自动携带 `X-Lang` |
| | | - 登录页和首页都已经支持语言切换 |
| | | - 非默认语言如果缺少菜单 key,后端会先尝试根据 `resource.code` 自动生成可读名称,再回退到原始中文名 |
| | |
| | | <parent> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-parent</artifactId> |
| | | <version>2.5.14</version> |
| | | <version>3.5.10</version> |
| | | <relativePath/> <!-- lookup parent from repository --> |
| | | </parent> |
| | | <groupId>com.zy</groupId> |
| | |
| | | <packaging>war</packaging> |
| | | |
| | | <properties> |
| | | <java.version>1.8</java.version> |
| | | <cool.version>3.4.0</cool.version> |
| | | <mysql-driver.version>5.1.47</mysql-driver.version> |
| | | <mybatis-plus.version>2.3.2</mybatis-plus.version> |
| | | <java.version>17</java.version> |
| | | <maven.compiler.release>${java.version}</maven.compiler.release> |
| | | <mybatis-plus.version>3.5.14</mybatis-plus.version> |
| | | <fastjson.version>1.2.83</fastjson.version> |
| | | <springfox.version>2.7.0</springfox.version> |
| | | <ortools.version>9.10.4067</ortools.version> |
| | | <lombok.version>1.18.38</lombok.version> |
| | | <mssql-jdbc.version>12.10.0.jre11</mssql-jdbc.version> |
| | | <swagger-annotations.version>1.6.16</swagger-annotations.version> |
| | | <springdoc.version>2.8.9</springdoc.version> |
| | | <spring-ai.version>1.1.2</spring-ai.version> |
| | | </properties> |
| | | |
| | | <dependencyManagement> |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework.ai</groupId> |
| | | <artifactId>spring-ai-bom</artifactId> |
| | | <version>${spring-ai.version}</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.cool</groupId> |
| | | <artifactId>framework</artifactId> |
| | | <version>3.4.0</version> |
| | | <scope>system</scope> |
| | | <systemPath>${project.basedir}/version/lib/framework-3.4.0.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>mysql</groupId> |
| | | <artifactId>mysql-connector-java</artifactId> |
| | | <version>5.1.46</version> |
| | | <groupId>com.mysql</groupId> |
| | | <artifactId>mysql-connector-j</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>mssql-jdbc</artifactId> |
| | | <version>8.2.2.jre8</version> |
| | | <version>${mssql-jdbc.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-boot-starter</artifactId> |
| | | <artifactId>mybatis-plus-spring-boot3-starter</artifactId> |
| | | <version>${mybatis-plus.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-jsqlparser</artifactId> |
| | | <version>${mybatis-plus.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | |
| | | <version>${fastjson.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger2</artifactId> |
| | | <version>${springfox.version}</version> |
| | | <groupId>org.springdoc</groupId> |
| | | <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> |
| | | <version>${springdoc.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | <version>${springfox.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>swagger-bootstrap-ui</artifactId> |
| | | <version>1.8.9</version> |
| | | <groupId>io.swagger</groupId> |
| | | <artifactId>swagger-annotations</artifactId> |
| | | <version>${swagger-annotations.version}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <version>1.16.22</version> |
| | | <version>${lombok.version}</version> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <dependency> |
| | |
| | | <artifactId>spring-boot-starter-actuator</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.ai</groupId> |
| | | <artifactId>spring-ai-openai</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.ortools</groupId> |
| | | <artifactId>ortools-java</artifactId> |
| | | <version>${ortools.version}</version> |
| | |
| | | <finalName>wcs</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <configuration> |
| | | <release>${maven.compiler.release}</release> |
| | | <annotationProcessorPaths> |
| | | <path> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <version>${lombok.version}</version> |
| | | </path> |
| | | </annotationProcessorPaths> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-war-plugin</artifactId> |
| | | <configuration> |
| | | <failOnMissingWebXml>false</failOnMissingWebXml> |
| | | </configuration> |
| | | <!-- <configuration>--> |
| | | <!-- <webResources>--> |
| | | <!-- <resource>--> |
| New file |
| | |
| | | package com.core.annotations; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | @Target({ElementType.TYPE, ElementType.METHOD}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface AppAuth { |
| | | |
| | | Auth value() default Auth.CHECK; |
| | | |
| | | String memo() default ""; |
| | | |
| | | enum Auth { |
| | | CHECK, |
| | | NONE |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.annotations; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | @Target({ElementType.TYPE, ElementType.FIELD}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface CoolTranslate { |
| | | |
| | | String value() default ""; |
| | | } |
| New file |
| | |
| | | package com.core.annotations; |
| | | |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | @Target({ElementType.TYPE, ElementType.METHOD}) |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | public @interface ManagerAuth { |
| | | |
| | | Auth value() default Auth.CHECK; |
| | | |
| | | String memo() default ""; |
| | | |
| | | enum Auth { |
| | | CHECK, |
| | | NONE |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.common; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | import java.nio.charset.StandardCharsets; |
| | | |
| | | public class AesUtils { |
| | | |
| | | private static final String DEFAULT_CHARSET = "utf-8"; |
| | | private static final int DEFAULT_KEY_LENGTH = 16; |
| | | |
| | | public static String encrypt(String data, String key) { |
| | | try { |
| | | if (key == null || "".equals(key) || key.length() != DEFAULT_KEY_LENGTH) { |
| | | return null; |
| | | } |
| | | byte[] raw = key.getBytes(StandardCharsets.UTF_8); |
| | | SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES"); |
| | | Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); |
| | | cipher.init(Cipher.ENCRYPT_MODE, skeySpec); |
| | | byte[] encrypted = cipher.doFinal(data.getBytes(StandardCharsets.UTF_8)); |
| | | return RadixTools.bytesToHexStr(encrypted); |
| | | } catch (Exception ex) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static String decrypt(String data, String key) { |
| | | try { |
| | | if (key == null || "".equals(key) || key.length() != DEFAULT_KEY_LENGTH) { |
| | | return null; |
| | | } |
| | | byte[] raw = key.getBytes(StandardCharsets.UTF_8); |
| | | SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES"); |
| | | Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); |
| | | cipher.init(Cipher.DECRYPT_MODE, skeySpec); |
| | | byte[] original = cipher.doFinal(RadixTools.hexStringToBytes(data)); |
| | | return new String(original, StandardCharsets.UTF_8); |
| | | } catch (Exception ex) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String key = "123456"; |
| | | String data = "15988786205×tamp=" + (System.currentTimeMillis() + 5000000L); |
| | | System.out.println(System.currentTimeMillis() + 5000000L); |
| | | System.out.println(encrypt(data, key)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.common; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | |
| | | public class Arith { |
| | | |
| | | private enum ArithType { |
| | | ADD(0), |
| | | DIVIDE(1), |
| | | SUBTRACT(2), |
| | | MULTIPLY(3); |
| | | |
| | | private final int value; |
| | | |
| | | ArithType(int value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int getValue() { |
| | | return value; |
| | | } |
| | | } |
| | | |
| | | public static double add(int scale, Number... nums) { |
| | | return getAirth(scale, ArithType.ADD.getValue(), nums); |
| | | } |
| | | |
| | | public static double subtract(int scale, Number... nums) { |
| | | return getAirth(scale, ArithType.SUBTRACT.getValue(), nums); |
| | | } |
| | | |
| | | public static double multiplys(int scale, Number... nums) { |
| | | return getAirth(scale, ArithType.MULTIPLY.getValue(), nums); |
| | | } |
| | | |
| | | public static double divides(int scale, Number... nums) { |
| | | return getAirth(scale, ArithType.DIVIDE.getValue(), nums); |
| | | } |
| | | |
| | | public static int percentage(Number... nums) { |
| | | return (int) (divides(2, nums) * 100); |
| | | } |
| | | |
| | | public static double remainder(Number... nums) { |
| | | return new BigDecimal(nums[0].toString()) |
| | | .remainder(new BigDecimal(String.valueOf(nums[1]))) |
| | | .doubleValue(); |
| | | } |
| | | |
| | | private static double getAirth(int scale, int type, Number... nums) { |
| | | if (nums == null || nums.length == 0) { |
| | | return 0D; |
| | | } |
| | | BigDecimal result = new BigDecimal(nums[0].toString()); |
| | | for (int i = 1; i < nums.length; i++) { |
| | | BigDecimal current = new BigDecimal(String.valueOf(nums[i])); |
| | | switch (type) { |
| | | case 0: |
| | | result = result.add(current); |
| | | break; |
| | | case 1: |
| | | result = result.divide(current, scale, RoundingMode.HALF_UP); |
| | | break; |
| | | case 2: |
| | | result = result.subtract(current); |
| | | break; |
| | | case 3: |
| | | result = result.multiply(current); |
| | | break; |
| | | default: |
| | | return 0D; |
| | | } |
| | | } |
| | | return result.setScale(scale, RoundingMode.HALF_UP).doubleValue(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.common; |
| | | |
| | | public interface BaseRes { |
| | | |
| | | String OK = "200-操作成功"; |
| | | String EMPTY = "201-暂无数据"; |
| | | String LIMIT = "202-无权限"; |
| | | String PARAM = "401-参数为空"; |
| | | String DENIED = "403-请重新登录"; |
| | | String REPEAT = "407-已存在"; |
| | | String NO_ACTIVATION = "409-请先激活系统"; |
| | | String ERROR = "500-服务器错误"; |
| | | } |
| New file |
| | |
| | | package com.core.common; |
| | | |
| | | import com.core.exception.ApplicationException; |
| | | |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.function.Supplier; |
| | | |
| | | public class Cache { |
| | | |
| | | private Map<String, Object> caches = new ConcurrentHashMap<>(); |
| | | |
| | | public <T> T get(Class<T> clazz) { |
| | | return (T) get(clazz.getName()); |
| | | } |
| | | |
| | | public Object get(String key) { |
| | | return get(key, true); |
| | | } |
| | | |
| | | public <T> T get(String key, Supplier<T> supplier) { |
| | | if (!hasKey(key)) { |
| | | put(key, supplier.get()); |
| | | } |
| | | return (T) get(key); |
| | | } |
| | | |
| | | public Object get(String key, boolean require) { |
| | | if (require && !hasKey(key)) { |
| | | throw new ApplicationException(this + "-找不到缓存对象:" + key); |
| | | } |
| | | return caches.get(key); |
| | | } |
| | | |
| | | public Cache put(Object value) { |
| | | String key = value.getClass().getName(); |
| | | put(key, value); |
| | | return this; |
| | | } |
| | | |
| | | public Cache put(String key, Object value) { |
| | | put(key, value, true); |
| | | return this; |
| | | } |
| | | |
| | | public Cache put(String key, Object value, boolean requireNotExists) { |
| | | if (requireNotExists && hasKey(key)) { |
| | | throw new ApplicationException(this + "-缓存" + key + "已存在"); |
| | | } |
| | | caches.put(key, value); |
| | | return this; |
| | | } |
| | | |
| | | public boolean hasKey(Class<?> clazz) { |
| | | return hasKey(clazz.getName()); |
| | | } |
| | | |
| | | public boolean hasKey(String key) { |
| | | return caches.containsKey(key); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.common; |
| | | |
| | | import com.core.annotations.CoolTranslate; |
| | | |
| | | import java.lang.reflect.Array; |
| | | import java.lang.reflect.Constructor; |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.lang.reflect.Modifier; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.security.MessageDigest; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | public class Cools { |
| | | |
| | | private static final char[] HEX_DIGITS = { |
| | | '0', '1', '2', '3', '4', '5', '6', '7', |
| | | '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' |
| | | }; |
| | | |
| | | public static boolean isEmpty(Object... objects) { |
| | | for (Object object : objects) { |
| | | if (isEmpty(object)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static boolean isEmpty(Object object) { |
| | | if (object == null) { |
| | | return true; |
| | | } |
| | | if (object instanceof String) { |
| | | return "".equals(object.toString().trim()); |
| | | } |
| | | if (object instanceof List) { |
| | | return ((List<?>) object).size() == 0; |
| | | } |
| | | if (object instanceof Map) { |
| | | return ((Map<?, ?>) object).size() == 0; |
| | | } |
| | | if (object instanceof Set) { |
| | | return ((Set<?>) object).size() == 0; |
| | | } |
| | | if (object instanceof Object[]) { |
| | | return ((Object[]) object).length == 0; |
| | | } |
| | | if (object instanceof int[]) { |
| | | return ((int[]) object).length == 0; |
| | | } |
| | | if (object instanceof long[]) { |
| | | return ((long[]) object).length == 0; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static int sqlLimitIndex(Integer curr, Integer limit) { |
| | | return (curr.intValue() - 1) * limit.intValue(); |
| | | } |
| | | |
| | | public static String enToken(String data, String key) { |
| | | return AesUtils.encrypt(data, zerofill(key, Integer.valueOf(16))); |
| | | } |
| | | |
| | | public static String deTokn(String data, String key) { |
| | | return AesUtils.decrypt(data, zerofill(key, Integer.valueOf(16))); |
| | | } |
| | | |
| | | public static String zerofill(String str, Integer length) { |
| | | if (str.length() == length.intValue()) { |
| | | return str; |
| | | } |
| | | if (str.length() > length.intValue()) { |
| | | return str.substring(0, 16); |
| | | } |
| | | StringBuilder builder = new StringBuilder(str); |
| | | for (int i = 0; i < length.intValue() - str.length(); i++) { |
| | | builder.append("0"); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | public static String deleteChar(String str, boolean end) { |
| | | if (isEmpty(str)) { |
| | | return ""; |
| | | } |
| | | if (end) { |
| | | return str.substring(0, str.length() - 1); |
| | | } |
| | | return str.substring(1); |
| | | } |
| | | |
| | | public static String deleteChar(String str) { |
| | | return deleteChar(str, true); |
| | | } |
| | | |
| | | public static <T> T conver(Map<? extends String, ?> map, Class<T> clazz) { |
| | | T target = null; |
| | | try { |
| | | Constructor<T> constructor = clazz.getDeclaredConstructor(); |
| | | boolean accessible = constructor.isAccessible(); |
| | | constructor.setAccessible(true); |
| | | target = constructor.newInstance(); |
| | | constructor.setAccessible(accessible); |
| | | } catch (IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | Class<?> current = clazz; |
| | | while (current != null && !Object.class.equals(current)) { |
| | | for (Field field : current.getDeclaredFields()) { |
| | | if (Modifier.isFinal(field.getModifiers()) |
| | | || Modifier.isStatic(field.getModifiers()) |
| | | || Modifier.isTransient(field.getModifiers())) { |
| | | continue; |
| | | } |
| | | String fieldName = field.getName(); |
| | | Object val = map.containsKey(fieldName) ? map.get(fieldName) : null; |
| | | if (val == null) { |
| | | continue; |
| | | } |
| | | boolean accessible = field.isAccessible(); |
| | | field.setAccessible(true); |
| | | Class<?> fieldType = field.getType(); |
| | | try { |
| | | field.set(target, convertFieldValue(fieldType, val)); |
| | | } catch (Exception ex) { |
| | | System.err.println("convert error ===> Class[" + current + "],Field:[" + fieldName |
| | | + "],Type:[" + fieldType + "],Value:[" + val + "]"); |
| | | } |
| | | field.setAccessible(accessible); |
| | | } |
| | | current = current.getSuperclass(); |
| | | } |
| | | return target; |
| | | } |
| | | |
| | | private static Object convertFieldValue(Class<?> fieldType, Object val) |
| | | throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { |
| | | if (fieldType.isInstance(val)) { |
| | | return val; |
| | | } |
| | | if (fieldType == String.class) { |
| | | return String.valueOf(val); |
| | | } |
| | | if (fieldType == Integer.class || fieldType == int.class) { |
| | | return Integer.valueOf(String.valueOf(val)); |
| | | } |
| | | if (fieldType == Long.class || fieldType == long.class) { |
| | | return Long.valueOf(String.valueOf(val)); |
| | | } |
| | | if (fieldType == Short.class || fieldType == short.class) { |
| | | return Short.valueOf(String.valueOf(val)); |
| | | } |
| | | if (fieldType == Double.class || fieldType == double.class) { |
| | | return Double.valueOf(String.valueOf(val)); |
| | | } |
| | | if (fieldType == Float.class || fieldType == float.class) { |
| | | return Float.valueOf(String.valueOf(val)); |
| | | } |
| | | if (fieldType == Boolean.class || fieldType == boolean.class) { |
| | | return Boolean.valueOf(String.valueOf(val)); |
| | | } |
| | | if (fieldType == Byte.class || fieldType == byte.class) { |
| | | return Byte.valueOf(String.valueOf(val)); |
| | | } |
| | | if (fieldType.isEnum()) { |
| | | return Enum.valueOf((Class<? extends Enum>) fieldType, String.valueOf(val)); |
| | | } |
| | | Constructor<?> constructor = fieldType.getDeclaredConstructor(String.class); |
| | | boolean constructorAccessible = constructor.isAccessible(); |
| | | constructor.setAccessible(true); |
| | | Object result = constructor.newInstance(String.valueOf(val)); |
| | | constructor.setAccessible(constructorAccessible); |
| | | return result; |
| | | } |
| | | |
| | | public static Map<String, Object> conver(Object object) { |
| | | Field[] fields = getAllFields(object.getClass()); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | for (Field field : fields) { |
| | | String fieldName = field.getName(); |
| | | boolean accessible = field.isAccessible(); |
| | | field.setAccessible(true); |
| | | Object val = null; |
| | | try { |
| | | val = field.get(object); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | field.setAccessible(accessible); |
| | | if (val != null) { |
| | | result.put(fieldName, val); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | public static Field[] getAllFields(Class<?> clazz) { |
| | | return getAllFields(clazz, null); |
| | | } |
| | | |
| | | private static Field[] getAllFields(Class<?> clazz, Field[] fields) { |
| | | Field[] allFields = fields == null ? clazz.getDeclaredFields() : fields; |
| | | Class<?> superClass = clazz.getSuperclass(); |
| | | if (superClass == null || superClass == Object.class) { |
| | | return allFields; |
| | | } |
| | | Field[] superFields = superClass.getDeclaredFields(); |
| | | allFields = addAll(allFields, superFields); |
| | | return getAllFields(superClass, allFields); |
| | | } |
| | | |
| | | public static <T> T[] addAll(T[] array1, T... array2) { |
| | | if (array1 == null) { |
| | | return clone(array2); |
| | | } |
| | | if (array2 == null) { |
| | | return clone(array1); |
| | | } |
| | | Class<?> type1 = array1.getClass().getComponentType(); |
| | | T[] joined = (T[]) Array.newInstance(type1, array1.length + array2.length); |
| | | System.arraycopy(array1, 0, joined, 0, array1.length); |
| | | try { |
| | | System.arraycopy(array2, 0, joined, array1.length, array2.length); |
| | | return joined; |
| | | } catch (ArrayStoreException ex) { |
| | | Class<?> type2 = array2.getClass().getComponentType(); |
| | | if (!type1.isAssignableFrom(type2)) { |
| | | throw new RuntimeException("Cannot store" + type2.getName() + " in an array of" + type1.getName(), ex); |
| | | } |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | private static <T> T[] clone(T[] array) { |
| | | return array == null ? null : (T[]) array.clone(); |
| | | } |
| | | |
| | | public static CoolMap add(String key, Object value) { |
| | | CoolMap map = new CoolMap(); |
| | | map.put(key, value); |
| | | return map; |
| | | } |
| | | |
| | | public static String md5(String str) { |
| | | try { |
| | | MessageDigest digest = MessageDigest.getInstance("MD5"); |
| | | byte[] bytes = digest.digest(str.getBytes(StandardCharsets.UTF_8)); |
| | | char[] chars = new char[bytes.length * 2]; |
| | | for (int i = 0; i < bytes.length; i++) { |
| | | int val = bytes[i]; |
| | | chars[i * 2] = HEX_DIGITS[(val & 0xF0) >> 4]; |
| | | chars[i * 2 + 1] = HEX_DIGITS[val & 0x0F]; |
| | | } |
| | | return new String(chars).toLowerCase(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("md5加密失败,str=".concat(str)); |
| | | } |
| | | } |
| | | |
| | | public static Map<String, Object> translate(Object object) { |
| | | Field[] fields = getAllFields(object.getClass()); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | for (Field field : fields) { |
| | | String fieldName = field.getName(); |
| | | if (field.isAnnotationPresent(CoolTranslate.class)) { |
| | | CoolTranslate translate = field.getAnnotation(CoolTranslate.class); |
| | | if (!isEmpty(translate.value())) { |
| | | fieldName = translate.value(); |
| | | } |
| | | } |
| | | boolean accessible = field.isAccessible(); |
| | | field.setAccessible(true); |
| | | Object val = null; |
| | | try { |
| | | val = field.get(object); |
| | | } catch (IllegalAccessException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | field.setAccessible(accessible); |
| | | if (val != null) { |
| | | result.put(fieldName, val); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | public static boolean eq(String left, String right) { |
| | | if (isEmpty(left) && isEmpty(right)) { |
| | | return true; |
| | | } |
| | | if (isEmpty(left) && !isEmpty(right)) { |
| | | return false; |
| | | } |
| | | if (isEmpty(right) && !isEmpty(left)) { |
| | | return false; |
| | | } |
| | | return left.equals(right); |
| | | } |
| | | |
| | | public static class CoolMap extends HashMap<String, Object> { |
| | | |
| | | public CoolMap add(String key, Object value) { |
| | | put(key, value); |
| | | return this; |
| | | } |
| | | |
| | | public CoolMap $(String key, Object value) { |
| | | put(key, value); |
| | | return this; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.common; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | public class DateUtils { |
| | | |
| | | public static final String yyyyMMdd_C = "yyyy年MM月dd日"; |
| | | public static final String yyyyMM_F = "yyyy-MM"; |
| | | public static final String yyyyMMdd_F = "yyyy-MM-dd"; |
| | | public static final String yyyyMMddHHmmss_F = "yyyy-MM-dd HH:mm:ss"; |
| | | public static final String yyyyMMddHHmmsssss_F = "yyyy-MM-dd HH:mm:ss:SSS"; |
| | | public static final String yyyy = "yyyy"; |
| | | public static final String yyyyMM = "yyyyMM"; |
| | | public static final String yyyyMMdd = "yyyyMMdd"; |
| | | public static final String yyyyMMddHH = "yyyyMMddHH"; |
| | | public static final String yyyyMMddHHmmss = "yyyyMMddHHmmss"; |
| | | public static final String YYMMDDHHMMSS = "yyMMddHHmmss"; |
| | | public static final String yyyyMMddHHmmsssss = "yyyyMMddHHmmssSSS"; |
| | | |
| | | public static String convert(Date date, String format) { |
| | | return new SimpleDateFormat(format).format(date); |
| | | } |
| | | |
| | | public static String convert(Date date) { |
| | | return convert(date, yyyyMMddHHmmss_F); |
| | | } |
| | | |
| | | public static Date convert(String text, String format) { |
| | | if (text.length() < format.length()) { |
| | | throw new RuntimeException("时间解析失败 ==>>" + text); |
| | | } |
| | | if (text.length() > format.length()) { |
| | | text = text.substring(0, format.length()); |
| | | } |
| | | try { |
| | | return new SimpleDateFormat(format).parse(text); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException("时间解析失败 ==>>" + text); |
| | | } |
| | | } |
| | | |
| | | public static Date convert(String text) { |
| | | return convert(text, yyyyMMddHHmmss_F); |
| | | } |
| | | |
| | | public static int diff(Date start, Date end) { |
| | | return getDaysByTimestamp(Math.abs(end.getTime() - start.getTime())); |
| | | } |
| | | |
| | | public static long diffToMinute(Date start, Date end) { |
| | | return Math.abs(end.getTime() - start.getTime()) / 1000L / 60L; |
| | | } |
| | | |
| | | public static long diffToSeconds(Date start, Date end) { |
| | | return Math.abs(end.getTime() - start.getTime()) / 1000L; |
| | | } |
| | | |
| | | private static int getDaysByTimestamp(long timestamp) { |
| | | double days = Arith.divides(2, timestamp, 86400000); |
| | | int value = (int) days; |
| | | if (days > value) { |
| | | return value + 1; |
| | | } |
| | | return value; |
| | | } |
| | | |
| | | public static int diffToNow(Date date) { |
| | | long val = new Date().getTime() - date.getTime(); |
| | | return (int) (Math.abs(val) / 1000L); |
| | | } |
| | | |
| | | public static String createTimeStamp() { |
| | | return Long.toString(System.currentTimeMillis() / 1000L); |
| | | } |
| | | |
| | | public static Date calculate(Date date, Long amount, TimeUnit unit, boolean before) { |
| | | if (Objects.isNull(date) || Objects.isNull(amount) || Objects.isNull(unit)) { |
| | | return null; |
| | | } |
| | | return new Date(before ? date.getTime() - unit.toMillis(amount) : date.getTime() + unit.toMillis(amount)); |
| | | } |
| | | |
| | | public static Date calculate(Date date, Long amount, TimeUnit unit) { |
| | | return calculate(date, amount, unit, false); |
| | | } |
| | | |
| | | public static DateEntity getDateEntity(Date date) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | DateEntity entity = new DateEntity(); |
| | | entity.setYear(calendar.get(Calendar.YEAR)); |
| | | entity.setMonth(calendar.get(Calendar.MONTH)); |
| | | entity.setDay(calendar.get(Calendar.DAY_OF_MONTH)); |
| | | entity.setHour(calendar.get(Calendar.HOUR_OF_DAY)); |
| | | entity.setMinute(calendar.get(Calendar.MINUTE)); |
| | | entity.setSecond(calendar.get(Calendar.SECOND)); |
| | | return entity; |
| | | } |
| | | |
| | | public static class DateEntity { |
| | | private int year; |
| | | private int month; |
| | | private int day; |
| | | private int hour; |
| | | private int minute; |
| | | private int second; |
| | | |
| | | public int getYear() { |
| | | return year; |
| | | } |
| | | |
| | | public void setYear(int year) { |
| | | this.year = year; |
| | | } |
| | | |
| | | public int getMonth() { |
| | | return month; |
| | | } |
| | | |
| | | public void setMonth(int month) { |
| | | this.month = month; |
| | | } |
| | | |
| | | public int getDay() { |
| | | return day; |
| | | } |
| | | |
| | | public void setDay(int day) { |
| | | this.day = day; |
| | | } |
| | | |
| | | public int getHour() { |
| | | return hour; |
| | | } |
| | | |
| | | public void setHour(int hour) { |
| | | this.hour = hour; |
| | | } |
| | | |
| | | public int getMinute() { |
| | | return minute; |
| | | } |
| | | |
| | | public void setMinute(int minute) { |
| | | this.minute = minute; |
| | | } |
| | | |
| | | public int getSecond() { |
| | | return second; |
| | | } |
| | | |
| | | public void setSecond(int second) { |
| | | this.second = second; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.common; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class Protocol<T> implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private int code; |
| | | private String msg; |
| | | private T data; |
| | | |
| | | public Protocol() { |
| | | } |
| | | |
| | | public Protocol(int code, String msg, T data) { |
| | | setCode(code); |
| | | setMsg(msg); |
| | | setData(data); |
| | | } |
| | | |
| | | public Protocol(int code, String msg) { |
| | | this(code, msg, null); |
| | | } |
| | | |
| | | public static <T> Protocol<T> ok() { |
| | | return parse(BaseRes.OK); |
| | | } |
| | | |
| | | public static <T> Protocol<T> ok(T data) { |
| | | Protocol<T> protocol = parse(BaseRes.OK); |
| | | protocol.setData(data); |
| | | return protocol; |
| | | } |
| | | |
| | | public static <T> Protocol<T> error() { |
| | | return parse(BaseRes.ERROR); |
| | | } |
| | | |
| | | public static <T> Protocol<T> error(String msg) { |
| | | Protocol<T> protocol = parse(BaseRes.ERROR); |
| | | protocol.setMsg(msg); |
| | | return protocol; |
| | | } |
| | | |
| | | public static <T> Protocol<T> parse(String baseRes) { |
| | | if (Cools.isEmpty(baseRes)) { |
| | | return parse(BaseRes.ERROR); |
| | | } |
| | | String[] arr = baseRes.split("-"); |
| | | if (arr.length == 2) { |
| | | return new Protocol<>(Integer.parseInt(arr[0]), arr[1]); |
| | | } |
| | | return parse("500-".concat(baseRes)); |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | | |
| | | public void setMsg(String msg) { |
| | | this.msg = msg; |
| | | } |
| | | |
| | | public T getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(T data) { |
| | | this.data = data; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.common; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | public class R extends HashMap<String, Object> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private static final String CODE = "code"; |
| | | private static final String MSG = "msg"; |
| | | private static final String DATA = "data"; |
| | | |
| | | public R(Integer code, String msg) { |
| | | super(); |
| | | put(CODE, code); |
| | | put(MSG, msg); |
| | | } |
| | | |
| | | public static R ok() { |
| | | return parse(BaseRes.OK); |
| | | } |
| | | |
| | | public static R ok(String msg) { |
| | | R r = ok(); |
| | | r.put(MSG, msg); |
| | | return r; |
| | | } |
| | | |
| | | public static R ok(Object data) { |
| | | return parse(BaseRes.OK).add(data); |
| | | } |
| | | |
| | | public static R error() { |
| | | return parse(BaseRes.ERROR); |
| | | } |
| | | |
| | | public static R error(String msg) { |
| | | R r = error(); |
| | | r.put(MSG, msg); |
| | | return r; |
| | | } |
| | | |
| | | public R add(Object data) { |
| | | put(DATA, data); |
| | | return this; |
| | | } |
| | | |
| | | public static R parse(String baseRes) { |
| | | if (Cools.isEmpty(baseRes)) { |
| | | return parse(BaseRes.ERROR); |
| | | } |
| | | String[] arr = baseRes.split("-"); |
| | | if (arr.length == 2) { |
| | | return new R(Integer.parseInt(arr[0]), arr[1]); |
| | | } |
| | | return parse("500-".concat(baseRes)); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.common; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.nio.charset.Charset; |
| | | |
| | | public class RadixTools { |
| | | |
| | | public static void main(String[] args) { |
| | | String val = toBinaryString((byte) 1); |
| | | System.out.println(val); |
| | | for (int i = val.length() - 1; i >= 0; i--) { |
| | | char c = val.charAt(i); |
| | | if (i == 7 && c == '1') { |
| | | System.out.println("==="); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static String toBinaryString(byte b) { |
| | | return Long.toBinaryString((b & 0xFF) + 0x100L).substring(1); |
| | | } |
| | | |
| | | public static String toBinaryString(byte[] bytes) { |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (byte b : bytes) { |
| | | builder.append(Long.toBinaryString((b & 0xFF) + 0x100L).substring(1)); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | public static byte[] hexStringToBytes(String hexString) { |
| | | if (hexString == null || "".equals(hexString)) { |
| | | return null; |
| | | } |
| | | String upper = hexString.toUpperCase(); |
| | | int length = upper.length() / 2; |
| | | char[] chars = upper.toCharArray(); |
| | | byte[] result = new byte[length]; |
| | | for (int i = 0; i < length; i++) { |
| | | int pos = i * 2; |
| | | result[i] = (byte) ((charToByte(chars[pos]) << 4) | charToByte(chars[pos + 1])); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | public static String bytesToHexStr(byte[] bytes) { |
| | | StringBuilder builder = new StringBuilder(bytes.length * 2); |
| | | for (byte b : bytes) { |
| | | builder.append(String.format("%02x", b & 0xFF)); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | private static byte charToByte(char c) { |
| | | return (byte) "0123456789ABCDEF".indexOf(c); |
| | | } |
| | | |
| | | public static String bytesToStr(byte[] bytes) { |
| | | return bytesToStr(bytes, Charset.forName("gbk")); |
| | | } |
| | | |
| | | public static String bytesToStr(byte[] bytes, Charset charset) { |
| | | return new String(bytes, charset).trim().toUpperCase(); |
| | | } |
| | | |
| | | public static byte[] strToBytes(String str) throws UnsupportedEncodingException { |
| | | return str.getBytes("gbk"); |
| | | } |
| | | |
| | | public static byte[] longToBytes(long value) { |
| | | long tmp = value; |
| | | byte[] bytes = new byte[8]; |
| | | for (int i = 0; i < bytes.length; i++) { |
| | | bytes[i] = Long.valueOf(tmp & 0xFF).byteValue(); |
| | | tmp = tmp >> 8; |
| | | } |
| | | return bytes; |
| | | } |
| | | |
| | | public static long bytesToLong(byte[] bytes) { |
| | | long result = 0L; |
| | | long b0 = bytes[0] & 0xFFL; |
| | | long b1 = (bytes[1] & 0xFFL) << 8; |
| | | long b2 = (bytes[2] & 0xFFL) << 16; |
| | | long b3 = (bytes[3] & 0xFFL) << 24; |
| | | long b4 = (bytes[4] & 0xFFL) << 32; |
| | | long b5 = (bytes[5] & 0xFFL) << 40; |
| | | long b6 = (bytes[6] & 0xFFL) << 48; |
| | | long b7 = (bytes[7] & 0xFFL) << 56; |
| | | result = b0 | b1 | b2 | b3 | b4 | b5 | b6 | b7; |
| | | return result; |
| | | } |
| | | |
| | | public static byte[] intToBytes(int value) { |
| | | int tmp = value; |
| | | byte[] bytes = new byte[4]; |
| | | for (int i = 0; i < bytes.length; i++) { |
| | | bytes[i] = Integer.valueOf(tmp & 0xFF).byteValue(); |
| | | tmp = tmp >> 8; |
| | | } |
| | | return bytes; |
| | | } |
| | | |
| | | public static int bytesToInt(byte[] bytes) { |
| | | int result; |
| | | int b0 = bytes[0] & 0xFF; |
| | | int b1 = (bytes[1] & 0xFF) << 8; |
| | | int b2 = (bytes[2] & 0xFF) << 16; |
| | | int b3 = (bytes[3] & 0xFF) << 24; |
| | | result = b0 | b1 | b2 | b3; |
| | | return result; |
| | | } |
| | | |
| | | public static short byteToShort(byte[] bytes) { |
| | | short result; |
| | | short b0 = (short) (bytes[0] & 0xFF); |
| | | short b1 = (short) ((bytes[1] & 0xFF) << 8); |
| | | result = (short) (b0 | b1); |
| | | return result; |
| | | } |
| | | |
| | | public static byte[] shortToByte(short value) { |
| | | int tmp = value; |
| | | byte[] bytes = new byte[2]; |
| | | for (int i = 0; i < bytes.length; i++) { |
| | | bytes[i] = Integer.valueOf(tmp & 0xFF).byteValue(); |
| | | tmp = tmp >> 8; |
| | | } |
| | | return bytes; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.common; |
| | | |
| | | public class SnowflakeIdWorker { |
| | | |
| | | private final long twepoch = 1420041600000L; |
| | | private final long sequenceBits = 12L; |
| | | private final long workerIdBits = 5L; |
| | | private final long datacenterIdBits = 5L; |
| | | private final long workerIdLeftShift = 12L; |
| | | private final long datacenterIdLeftShift = 17L; |
| | | private final long timestampLeftShift = 22L; |
| | | private final long maxWorkerId = 31L; |
| | | private final long maxDatacenterId = 31L; |
| | | private final long sequenceMask = 4095L; |
| | | |
| | | private long workerId; |
| | | private long datacenterId; |
| | | private long sequence = 0L; |
| | | private long lastTimestamp = -1L; |
| | | |
| | | public SnowflakeIdWorker(long workerId, long datacenterId) { |
| | | if (workerId > maxWorkerId || workerId < 0) { |
| | | throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId)); |
| | | } |
| | | if (datacenterId > maxDatacenterId || datacenterId < 0) { |
| | | throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId)); |
| | | } |
| | | this.workerId = workerId; |
| | | this.datacenterId = datacenterId; |
| | | } |
| | | |
| | | public SnowflakeIdWorker() { |
| | | this(0L, 0L); |
| | | } |
| | | |
| | | public synchronized long nextId() { |
| | | long timestamp = timeGen(); |
| | | if (timestamp < lastTimestamp) { |
| | | throw new RuntimeException(String.format( |
| | | "Clock moved backwards. Refusing to generate id for %d milliseconds", |
| | | lastTimestamp - timestamp)); |
| | | } |
| | | if (lastTimestamp == timestamp) { |
| | | sequence = (sequence + 1) & sequenceMask; |
| | | if (sequence == 0) { |
| | | timestamp = tilNextMillis(lastTimestamp); |
| | | } |
| | | } else { |
| | | sequence = 0L; |
| | | } |
| | | lastTimestamp = timestamp; |
| | | return ((timestamp - twepoch) << timestampLeftShift) |
| | | | (datacenterId << datacenterIdLeftShift) |
| | | | (workerId << workerIdLeftShift) |
| | | | sequence; |
| | | } |
| | | |
| | | protected long tilNextMillis(long lastTimestamp) { |
| | | long timestamp = timeGen(); |
| | | while (timestamp <= lastTimestamp) { |
| | | timestamp = timeGen(); |
| | | } |
| | | return timestamp; |
| | | } |
| | | |
| | | protected long timeGen() { |
| | | return System.currentTimeMillis(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0L, 0L); |
| | | for (int i = 0; i < 1000; i++) { |
| | | long id = idWorker.nextId(); |
| | | System.out.println(Long.toBinaryString(id)); |
| | | System.out.println(id); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.common; |
| | | |
| | | import com.core.exception.CoolException; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | |
| | | public class SpringUtils implements ApplicationContextAware { |
| | | |
| | | private static ApplicationContext application; |
| | | |
| | | public static void init(ApplicationContext applicationContext) { |
| | | application = applicationContext; |
| | | } |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
| | | application = applicationContext; |
| | | } |
| | | |
| | | private static ApplicationContext getApplicationContext() { |
| | | if (application == null) { |
| | | throw new CoolException(BaseRes.ERROR); |
| | | } |
| | | return application; |
| | | } |
| | | |
| | | public static <T> T getBean(Class<T> clazz) { |
| | | return getApplicationContext().getBean(clazz); |
| | | } |
| | | |
| | | public static Object getBean(String name) { |
| | | return getApplicationContext().getBean(name); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.config; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.DbType; |
| | | import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
| | | import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.common.SpringUtils; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | public class CoolBaseConfig { |
| | | |
| | | @Bean |
| | | public MybatisPlusInterceptor mybatisPlusInterceptor() { |
| | | MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
| | | interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); |
| | | return interceptor; |
| | | } |
| | | |
| | | @Bean |
| | | public SpringUtils getSpringUtils() { |
| | | return new SpringUtils(); |
| | | } |
| | | |
| | | @Bean |
| | | public SnowflakeIdWorker snowflakeIdWorker() { |
| | | return new SnowflakeIdWorker(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.controller; |
| | | |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | public abstract class AbstractBaseController { |
| | | |
| | | public <T> List exportSupport(List<T> list, List<String> fields) { |
| | | if (Cools.isEmpty(list)) { |
| | | throw new CoolException(BaseRes.EMPTY); |
| | | } |
| | | try { |
| | | List<Object> result = new ArrayList<>(); |
| | | Method[] methods = list.get(0).getClass().getMethods(); |
| | | for (T item : list) { |
| | | List<Object> row = new ArrayList<>(); |
| | | for (String field : fields) { |
| | | for (Method method : methods) { |
| | | if (("get" + field).toLowerCase().equals(method.getName().toLowerCase())) { |
| | | Object value = method.invoke(item); |
| | | row.add(value); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | result.add(row); |
| | | } |
| | | return result; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | public static Map<String, Object> excludeTrash(Map<String, Object> map) { |
| | | if (Cools.isEmpty(map)) { |
| | | return new HashMap<>(); |
| | | } |
| | | Iterator<Map.Entry<String, Object>> iterator = map.entrySet().iterator(); |
| | | while (iterator.hasNext()) { |
| | | Map.Entry<String, Object> entry = iterator.next(); |
| | | String key = entry.getKey(); |
| | | if ("curr".equals(key) |
| | | || "limit".equals(key) |
| | | || "orderByField".equals(key) |
| | | || "orderByType".equals(key) |
| | | || "condition".equals(key) |
| | | || Cools.isEmpty(entry.getValue())) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | public static String humpToLine(String str) { |
| | | Pattern pattern = Pattern.compile("[A-Z]"); |
| | | Matcher matcher = pattern.matcher(str); |
| | | StringBuffer buffer = new StringBuffer(); |
| | | while (matcher.find()) { |
| | | matcher.appendReplacement(buffer, "_" + matcher.group(0).toLowerCase()); |
| | | } |
| | | matcher.appendTail(buffer); |
| | | return buffer.toString(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.domain; |
| | | |
| | | public class KeyValueVo { |
| | | |
| | | private String name; |
| | | |
| | | private Object value; |
| | | |
| | | public KeyValueVo() { |
| | | } |
| | | |
| | | public KeyValueVo(String name, Object value) { |
| | | this.name = name; |
| | | this.value = value; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Object getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public void setValue(Object value) { |
| | | this.value = value; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.domain; |
| | | |
| | | import java.lang.annotation.Documented; |
| | | import java.lang.annotation.ElementType; |
| | | import java.lang.annotation.Retention; |
| | | import java.lang.annotation.RetentionPolicy; |
| | | import java.lang.annotation.Target; |
| | | |
| | | @Documented |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE}) |
| | | public @interface QueryField { |
| | | |
| | | String value() default ""; |
| | | |
| | | QueryType type() default QueryType.LIKE; |
| | | } |
| New file |
| | |
| | | package com.core.domain; |
| | | |
| | | public enum QueryType { |
| | | EQ, |
| | | NE, |
| | | GT, |
| | | GE, |
| | | LT, |
| | | LE, |
| | | LIKE, |
| | | NOT_LIKE, |
| | | LIKE_LEFT, |
| | | LIKE_RIGHT, |
| | | IS_NULL, |
| | | IS_NOT_NULL, |
| | | IN, |
| | | NOT_IN, |
| | | IN_STR, |
| | | NOT_IN_STR |
| | | } |
| New file |
| | |
| | | package com.core.exception; |
| | | |
| | | public class ApplicationException extends RuntimeException { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public ApplicationException(Throwable cause) { |
| | | super(cause); |
| | | } |
| | | |
| | | public ApplicationException(String message) { |
| | | super(message); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.exception; |
| | | |
| | | public class CoolException extends RuntimeException { |
| | | |
| | | public CoolException(Throwable cause) { |
| | | super(cause); |
| | | } |
| | | |
| | | public CoolException(String message) { |
| | | super(message); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.generators; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.core.generators.constant.SqlOsType; |
| | | import com.core.generators.domain.Column; |
| | | import com.core.generators.utils.GeneratorUtils; |
| | | |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.nio.file.FileAlreadyExistsException; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | | import java.nio.file.Paths; |
| | | import java.nio.file.StandardOpenOption; |
| | | import java.sql.Connection; |
| | | import java.sql.DatabaseMetaData; |
| | | import java.sql.DriverManager; |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | public class CoolGenerator { |
| | | |
| | | private static final String[] ALL_TEMPLATES = { |
| | | "Controller", "Service", "ServiceImpl", "Mapper", "Entity", |
| | | "Xml", "Html", "HtmlDetail", "Js", "Sql" |
| | | }; |
| | | private static final Set<String> SYSTEM_MODEL = new LinkedHashSet<>(Arrays.asList("User", "Host")); |
| | | |
| | | public String url; |
| | | public String username; |
| | | public String password; |
| | | public String table; |
| | | public String packagePath; |
| | | public boolean controller = true; |
| | | public boolean service = true; |
| | | public boolean mapper = true; |
| | | public boolean entity = true; |
| | | public boolean xml = true; |
| | | public boolean html = true; |
| | | public boolean htmlDetail = false; |
| | | public boolean js = true; |
| | | public boolean sql = true; |
| | | public SqlOsType sqlOsType; |
| | | public String backendPrefixPath = ""; |
| | | public String frontendPrefixPath = ""; |
| | | |
| | | private List<Column> columns = new ArrayList<>(); |
| | | private String fullEntityName; |
| | | private String simpleEntityName; |
| | | private String entityImport; |
| | | private String entityContent; |
| | | private String xmlContent; |
| | | private String htmlSearchContent; |
| | | private String htmlDialogContent; |
| | | private String htmlDetailContent; |
| | | private String jsTableContent; |
| | | private String jsDateContent; |
| | | private String primaryKeyColumn; |
| | | private String primaryKeyType; |
| | | private String majorColumn; |
| | | private String systemPackage; |
| | | |
| | | public void build() throws Exception { |
| | | init(); |
| | | System.out.println("开始生成表[" + table + "]对应代码,实体名[" + fullEntityName + "]"); |
| | | for (String templateName : ALL_TEMPLATES) { |
| | | boolean enabled = false; |
| | | String fileDir = ""; |
| | | String fileName = ""; |
| | | String routeSegment = templateName.toLowerCase(); |
| | | if (routeSegment.contains("impl")) { |
| | | routeSegment = routeSegment.substring(0, routeSegment.length() - 4) + "/" + routeSegment.substring(routeSegment.length() - 4); |
| | | } |
| | | switch (templateName) { |
| | | case "Controller": |
| | | enabled = controller; |
| | | fileDir = backendPrefixPath + "src/main/java/" + packagePath.replace(".", "/") + "/" + routeSegment + "/"; |
| | | fileName = fullEntityName + "Controller.java"; |
| | | break; |
| | | case "Service": |
| | | enabled = service; |
| | | fileDir = backendPrefixPath + "src/main/java/" + packagePath.replace(".", "/") + "/" + routeSegment + "/"; |
| | | fileName = fullEntityName + "Service.java"; |
| | | break; |
| | | case "ServiceImpl": |
| | | enabled = service; |
| | | fileDir = backendPrefixPath + "src/main/java/" + packagePath.replace(".", "/") + "/" + routeSegment + "/"; |
| | | fileName = fullEntityName + "ServiceImpl.java"; |
| | | break; |
| | | case "Mapper": |
| | | enabled = mapper; |
| | | fileDir = backendPrefixPath + "src/main/java/" + packagePath.replace(".", "/") + "/" + routeSegment + "/"; |
| | | fileName = fullEntityName + "Mapper.java"; |
| | | break; |
| | | case "Entity": |
| | | enabled = entity; |
| | | fileDir = backendPrefixPath + "src/main/java/" + packagePath.replace(".", "/") + "/" + routeSegment + "/"; |
| | | fileName = fullEntityName + ".java"; |
| | | break; |
| | | case "Xml": |
| | | enabled = xml; |
| | | fileDir = backendPrefixPath + "src/main/resources/mapper/"; |
| | | fileName = fullEntityName + "Mapper.xml"; |
| | | break; |
| | | case "Html": |
| | | enabled = html; |
| | | fileDir = frontendPrefixPath + "src/main/webapp//views/" + simpleEntityName + "/"; |
| | | fileName = simpleEntityName + ".html"; |
| | | break; |
| | | case "HtmlDetail": |
| | | enabled = htmlDetail; |
| | | fileDir = frontendPrefixPath + "src/main/webapp//views/" + simpleEntityName + "/"; |
| | | fileName = simpleEntityName + "_detail.html"; |
| | | break; |
| | | case "Js": |
| | | enabled = js; |
| | | fileDir = frontendPrefixPath + "src/main/webapp/static/js/" + simpleEntityName + "/"; |
| | | fileName = simpleEntityName + ".js"; |
| | | break; |
| | | case "Sql": |
| | | enabled = sql; |
| | | fileDir = backendPrefixPath + "version/sql/"; |
| | | fileName = simpleEntityName + ".sql"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | if (!enabled) { |
| | | continue; |
| | | } |
| | | try { |
| | | String template = loadTemplate(templateName + ".txt"); |
| | | String content = renderTemplate(template); |
| | | writeFile(fileDir, fileName, content, templateName); |
| | | } catch (Exception e) { |
| | | System.out.println(fullEntityName + templateName + " 源文件创建失败:" + e.getMessage()); |
| | | throw e; |
| | | } |
| | | } |
| | | System.out.println("表[" + table + "]代码生成结束"); |
| | | } |
| | | |
| | | private void init() throws Exception { |
| | | validate(); |
| | | systemPackage = resolveSystemPackage(); |
| | | fullEntityName = GeneratorUtils.getNameSpace(table); |
| | | simpleEntityName = GeneratorUtils.firstCharConvert(fullEntityName); |
| | | System.out.println("开始读取表结构:" + table); |
| | | Connection connection = createConnection(); |
| | | try { |
| | | switch (sqlOsType) { |
| | | case MYSQL: |
| | | columns = getMysqlColumns(connection, table, true, sqlOsType); |
| | | break; |
| | | case SQL_SERVER: |
| | | columns = getSqlServerColumns(connection, table, true, sqlOsType); |
| | | break; |
| | | default: |
| | | throw new IllegalArgumentException("Unsupported sql type: " + sqlOsType); |
| | | } |
| | | } finally { |
| | | connection.close(); |
| | | } |
| | | if (Cools.isEmpty(columns)) { |
| | | throw new IllegalStateException("table has no columns: " + table); |
| | | } |
| | | System.out.println("表结构读取完成,共 " + columns.size() + " 个字段"); |
| | | primaryKeyColumn = resolvePrimaryKeyColumn(); |
| | | primaryKeyType = resolvePrimaryKeyType(); |
| | | majorColumn = resolveMajorColumn(); |
| | | entityImport = buildEntityImports(); |
| | | entityContent = buildEntityContent(); |
| | | xmlContent = buildXmlContent(); |
| | | htmlSearchContent = buildHtmlSearchContent(); |
| | | htmlDialogContent = buildHtmlDialogContent(); |
| | | htmlDetailContent = buildHtmlDetailContent(); |
| | | jsTableContent = buildJsTableContent(); |
| | | jsDateContent = buildJsDateContent(); |
| | | } |
| | | |
| | | private void validate() { |
| | | if (Cools.isEmpty(url, username, password, table, packagePath) || sqlOsType == null) { |
| | | throw new IllegalArgumentException("url/username/password/table/packagePath/sqlOsType are required"); |
| | | } |
| | | } |
| | | |
| | | private String resolveSystemPackage() { |
| | | String[] arr = packagePath.split("\\."); |
| | | if (arr.length <= 2) { |
| | | return packagePath; |
| | | } |
| | | return arr[0] + "." + arr[1]; |
| | | } |
| | | |
| | | private Connection createConnection() throws Exception { |
| | | String jdbcUrl = url; |
| | | switch (sqlOsType) { |
| | | case MYSQL: |
| | | Class.forName("com.mysql.cj.jdbc.Driver"); |
| | | if (!jdbcUrl.startsWith("jdbc:mysql://")) { |
| | | jdbcUrl = "jdbc:mysql://" + jdbcUrl; |
| | | } |
| | | if (!jdbcUrl.contains("?")) { |
| | | jdbcUrl = jdbcUrl + "?useUnicode=true&characterEncoding=utf-8&useSSL=false&remarksReporting=true"; |
| | | } else if (!jdbcUrl.contains("remarksReporting=")) { |
| | | jdbcUrl = jdbcUrl + "&remarksReporting=true"; |
| | | } |
| | | return DriverManager.getConnection(jdbcUrl, username, password); |
| | | case SQL_SERVER: |
| | | Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); |
| | | if (!jdbcUrl.startsWith("jdbc:sqlserver://")) { |
| | | jdbcUrl = "jdbc:sqlserver://" + jdbcUrl; |
| | | } |
| | | return DriverManager.getConnection(jdbcUrl, username, password); |
| | | default: |
| | | throw new IllegalArgumentException("Unsupported sql type: " + sqlOsType); |
| | | } |
| | | } |
| | | |
| | | public static List<Column> getMysqlColumns(Connection connection, String table, boolean withForeignKey, SqlOsType sqlOsType) throws Exception { |
| | | return getColumns(connection, table, withForeignKey, sqlOsType); |
| | | } |
| | | |
| | | public static List<Column> getSqlServerColumns(Connection connection, String table, boolean withForeignKey, SqlOsType sqlOsType) throws Exception { |
| | | return getColumns(connection, table, withForeignKey, sqlOsType); |
| | | } |
| | | |
| | | private static List<Column> getColumns(Connection connection, String table, boolean withForeignKey, SqlOsType sqlOsType) throws Exception { |
| | | List<Column> columns = new ArrayList<>(); |
| | | DatabaseMetaData metaData = connection.getMetaData(); |
| | | TableRef tableRef = parseTableRef(table); |
| | | Set<String> primaryKeys = new LinkedHashSet<>(); |
| | | ResultSet pkRs = metaData.getPrimaryKeys(tableRef.catalog, tableRef.schema, tableRef.table); |
| | | try { |
| | | while (pkRs.next()) { |
| | | primaryKeys.add(pkRs.getString("COLUMN_NAME")); |
| | | } |
| | | } finally { |
| | | pkRs.close(); |
| | | } |
| | | |
| | | ResultSet columnRs = metaData.getColumns(tableRef.catalog, tableRef.schema, tableRef.table, null); |
| | | try { |
| | | while (columnRs.next()) { |
| | | String columnName = columnRs.getString("COLUMN_NAME"); |
| | | int sqlType = columnRs.getInt("DATA_TYPE"); |
| | | String type = GeneratorUtils.getType(sqlType); |
| | | if (Cools.isEmpty(type)) { |
| | | type = "String"; |
| | | } |
| | | String remarks = columnRs.getString("REMARKS"); |
| | | boolean primaryKey = primaryKeys.contains(columnName); |
| | | boolean mainKey = primaryKey && isAutoIncrement(columnRs); |
| | | boolean notNull = columnRs.getInt("NULLABLE") == DatabaseMetaData.columnNoNulls; |
| | | Integer length = GeneratorUtils.getColumnLength(columnRs.getString("TYPE_NAME")); |
| | | columns.add(new Column(connection, columnName, type, remarks, primaryKey, mainKey, notNull, length, |
| | | withForeignKey, sqlOsType)); |
| | | } |
| | | } finally { |
| | | columnRs.close(); |
| | | } |
| | | for (Column column : columns) { |
| | | System.out.println(column.toString()); |
| | | } |
| | | return columns; |
| | | } |
| | | |
| | | private static boolean isAutoIncrement(ResultSet columnRs) { |
| | | try { |
| | | return "YES".equalsIgnoreCase(columnRs.getString("IS_AUTOINCREMENT")); |
| | | } catch (SQLException e) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | private static TableRef parseTableRef(String table) { |
| | | if (table != null && table.contains(".")) { |
| | | String[] arr = table.split("\\."); |
| | | return new TableRef(null, arr[0], arr[arr.length - 1]); |
| | | } |
| | | return new TableRef(null, null, table); |
| | | } |
| | | |
| | | private String resolvePrimaryKeyColumn() { |
| | | for (Column column : columns) { |
| | | if (column.isPrimaryKey()) { |
| | | return column.getHumpName(); |
| | | } |
| | | } |
| | | return columns.get(0).getHumpName(); |
| | | } |
| | | |
| | | private String resolvePrimaryKeyType() { |
| | | for (Column column : columns) { |
| | | if (column.isPrimaryKey()) { |
| | | return column.getType(); |
| | | } |
| | | } |
| | | return columns.get(0).getType(); |
| | | } |
| | | |
| | | private String resolveMajorColumn() { |
| | | for (Column column : columns) { |
| | | if (column.isMajor()) { |
| | | return column.getHumpName(); |
| | | } |
| | | } |
| | | for (Column column : columns) { |
| | | if (!column.isPrimaryKey()) { |
| | | return column.getHumpName(); |
| | | } |
| | | } |
| | | return primaryKeyColumn; |
| | | } |
| | | |
| | | private String buildEntityImports() { |
| | | Set<String> imports = new LinkedHashSet<>(); |
| | | boolean hasTableId = false; |
| | | boolean hasTableField = false; |
| | | boolean hasDate = false; |
| | | boolean needCools = false; |
| | | boolean hasSpringUtils = false; |
| | | boolean hasTableLogic = false; |
| | | for (Column column : columns) { |
| | | if (column.isPrimaryKey()) { |
| | | hasTableId = true; |
| | | } else if (!column.getName().equals(column.getHumpName())) { |
| | | hasTableField = true; |
| | | } |
| | | if ("deleted".equals(column.getName())) { |
| | | hasTableLogic = true; |
| | | } |
| | | if ("Date".equals(column.getType())) { |
| | | hasDate = true; |
| | | needCools = true; |
| | | } |
| | | if (!Cools.isEmpty(column.getEnums()) || !Cools.isEmpty(column.getForeignKey())) { |
| | | needCools = true; |
| | | } |
| | | if (!Cools.isEmpty(column.getForeignKey())) { |
| | | hasSpringUtils = true; |
| | | imports.add("import " + getForeignBasePackage(column.getForeignKey()) + ".service." + column.getForeignKey() + "Service;"); |
| | | imports.add("import " + getForeignBasePackage(column.getForeignKey()) + ".entity." + column.getForeignKey() + ";"); |
| | | } |
| | | } |
| | | if (needCools) { |
| | | imports.add("import com.core.common.Cools;"); |
| | | } |
| | | if (hasSpringUtils) { |
| | | imports.add("import com.core.common.SpringUtils;"); |
| | | } |
| | | if (hasTableId) { |
| | | imports.add("import com.baomidou.mybatisplus.annotation.TableId;"); |
| | | imports.add("import com.baomidou.mybatisplus.annotation.IdType;"); |
| | | } |
| | | if (hasTableLogic) { |
| | | imports.add("import com.baomidou.mybatisplus.annotation.TableLogic;"); |
| | | } |
| | | if (hasTableField) { |
| | | imports.add("import com.baomidou.mybatisplus.annotation.TableField;"); |
| | | } |
| | | if (hasDate) { |
| | | imports.add("import java.text.SimpleDateFormat;"); |
| | | imports.add("import java.util.Date;"); |
| | | imports.add("import org.springframework.format.annotation.DateTimeFormat;"); |
| | | } |
| | | if (imports.isEmpty()) { |
| | | return ""; |
| | | } |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (String item : imports) { |
| | | builder.append(item).append("\n"); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | private String buildEntityContent() { |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (Column column : columns) { |
| | | builder.append(" /**\n"); |
| | | builder.append(" * ").append(column.getWholeComment()).append("\n"); |
| | | builder.append(" */\n"); |
| | | builder.append(" @ApiModelProperty(value= \"").append(escapeJava(column.getWholeComment())).append("\")\n"); |
| | | if (column.isPrimaryKey()) { |
| | | builder.append(" @TableId(value = \"").append(column.getName()).append("\", type = IdType.") |
| | | .append(column.isMainKey() ? "AUTO" : "INPUT").append(")\n"); |
| | | } else if (!column.getName().equals(column.getHumpName())) { |
| | | builder.append(" @TableField(\"").append(column.getName()).append("\")\n"); |
| | | } |
| | | if ("deleted".equals(column.getName())) { |
| | | builder.append(" @TableLogic\n"); |
| | | } |
| | | if ("Date".equals(column.getType())) { |
| | | builder.append(" @DateTimeFormat(pattern=\"yyyy-MM-dd HH:mm:ss\")\n"); |
| | | } |
| | | builder.append(" private ").append(column.getType()).append(" ").append(column.getHumpName()).append(";\n\n"); |
| | | } |
| | | List<Column> constructorColumns = getNonPrimaryColumns(); |
| | | builder.append(" public ").append(fullEntityName).append("() {}\n\n"); |
| | | if (!constructorColumns.isEmpty()) { |
| | | builder.append(" public ").append(fullEntityName).append("("); |
| | | for (Column column : constructorColumns) { |
| | | builder.append(column.getType()).append(" ").append(column.getHumpName()).append(","); |
| | | } |
| | | builder.deleteCharAt(builder.length() - 1); |
| | | builder.append(") {\n"); |
| | | for (Column column : constructorColumns) { |
| | | builder.append(" this.").append(column.getHumpName()).append(" = ").append(column.getHumpName()).append(";\n"); |
| | | } |
| | | builder.append(" }\n\n"); |
| | | |
| | | builder.append("// ").append(fullEntityName).append(" ").append(simpleEntityName) |
| | | .append(" = new ").append(fullEntityName).append("(\n"); |
| | | for (int i = 0; i < constructorColumns.size(); i++) { |
| | | Column column = constructorColumns.get(i); |
| | | builder.append("// null"); |
| | | if (i < constructorColumns.size() - 1) { |
| | | builder.append(","); |
| | | } |
| | | builder.append(" // ").append(column.getComment()); |
| | | if (column.isNotNull()) { |
| | | builder.append("[非空]"); |
| | | } |
| | | if (i < constructorColumns.size() - 1) { |
| | | builder.append("\n"); |
| | | } |
| | | } |
| | | builder.append("\n// );\n\n"); |
| | | } |
| | | List<String> displayGetters = buildDisplayGetters(); |
| | | for (String getter : displayGetters) { |
| | | builder.append(getter).append("\n\n"); |
| | | } |
| | | return trimTrailingBlankLines(builder.toString()); |
| | | } |
| | | |
| | | private List<String> buildDisplayGetters() { |
| | | List<String> getters = new ArrayList<>(); |
| | | for (Column column : columns) { |
| | | String field = column.getHumpName(); |
| | | String methodName = GeneratorUtils.firstCharConvert(field, false); |
| | | if ("Date".equals(column.getType())) { |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append(" public String get").append(methodName).append("$(){\n"); |
| | | builder.append(" if (Cools.isEmpty(this.").append(field).append(")){\n"); |
| | | builder.append(" return \"\";\n"); |
| | | builder.append(" }\n"); |
| | | builder.append(" return new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\").format(this.").append(field).append(");\n"); |
| | | builder.append(" }"); |
| | | getters.add(builder.toString()); |
| | | continue; |
| | | } |
| | | if (!Cools.isEmpty(column.getEnums())) { |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append(" public String get").append(methodName).append("$(){\n"); |
| | | builder.append(" if (null == this.").append(field).append("){ return null; }\n"); |
| | | builder.append(" switch (String.valueOf(this.").append(field).append(")){\n"); |
| | | for (Map<String, Object> map : column.getEnums()) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | builder.append(" case \"").append(escapeJava(entry.getKey())).append("\":\n"); |
| | | builder.append(" return \"").append(escapeJava(String.valueOf(entry.getValue()))).append("\";\n"); |
| | | } |
| | | } |
| | | builder.append(" default:\n"); |
| | | builder.append(" return String.valueOf(this.").append(field).append(");\n"); |
| | | builder.append(" }\n"); |
| | | builder.append(" }"); |
| | | getters.add(builder.toString()); |
| | | continue; |
| | | } |
| | | if (!Cools.isEmpty(column.getForeignKeyMajor())) { |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append(" public String get").append(methodName).append("$(){\n"); |
| | | builder.append(" ").append(column.getForeignKey()).append("Service service = SpringUtils.getBean(") |
| | | .append(column.getForeignKey()).append("Service.class);\n"); |
| | | builder.append(" ").append(column.getForeignKey()).append(" ") |
| | | .append(GeneratorUtils.firstCharConvert(column.getForeignKey())).append(" = service.getById(this.") |
| | | .append(field).append(");\n"); |
| | | builder.append(" if (!Cools.isEmpty(").append(GeneratorUtils.firstCharConvert(column.getForeignKey())) |
| | | .append(")){\n"); |
| | | builder.append(" return String.valueOf(").append(GeneratorUtils.firstCharConvert(column.getForeignKey())) |
| | | .append(".get").append(column.getForeignKeyMajor()).append("());\n"); |
| | | builder.append(" }\n"); |
| | | builder.append(" return null;\n"); |
| | | builder.append(" }"); |
| | | getters.add(builder.toString()); |
| | | } |
| | | } |
| | | return getters; |
| | | } |
| | | |
| | | private String buildXmlContent() { |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (Column column : columns) { |
| | | if (column.isPrimaryKey()) { |
| | | builder.append(" <id column=\"").append(column.getName()).append("\" property=\"") |
| | | .append(column.getHumpName()).append("\" />\n"); |
| | | } else { |
| | | builder.append(" <result column=\"").append(column.getName()).append("\" property=\"") |
| | | .append(column.getHumpName()).append("\" />\n"); |
| | | } |
| | | } |
| | | return trimTrailingBlankLines(builder.toString()); |
| | | } |
| | | |
| | | private String buildHtmlSearchContent() { |
| | | StringBuilder builder = new StringBuilder(); |
| | | builder.append(" <div class=\"layui-inline\">\n"); |
| | | builder.append(" <div class=\"layui-input-inline\">\n"); |
| | | builder.append(" <input class=\"layui-input\" type=\"text\" name=\"condition\" placeholder=\"请输入\" autocomplete=\"off\">\n"); |
| | | builder.append(" </div>\n"); |
| | | builder.append(" </div>\n"); |
| | | Column rangeColumn = resolveRangeSearchColumn(); |
| | | if (rangeColumn != null) { |
| | | builder.append(" <div class=\"layui-inline\" style=\"width: 300px\">\n"); |
| | | builder.append(" <div class=\"layui-input-inline\">\n"); |
| | | builder.append(" <input class=\"layui-input layui-laydate-range\" name=\"") |
| | | .append(rangeColumn.getName()).append("\" type=\"text\" placeholder=\"") |
| | | .append(GeneratorUtils.supportHtmlName(rangeColumn.getComment())) |
| | | .append("范围\" autocomplete=\"off\" style=\"width: 300px\">\n"); |
| | | builder.append(" </div>\n"); |
| | | builder.append(" </div>\n"); |
| | | } |
| | | return trimTrailingBlankLines(builder.toString()); |
| | | } |
| | | |
| | | private String buildHtmlDialogContent() { |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (Column column : columns) { |
| | | String field = column.getHumpName(); |
| | | if (column.isPrimaryKey()) { |
| | | builder.append(" <input name=\"").append(field).append("\" type=\"hidden\">\n"); |
| | | continue; |
| | | } |
| | | builder.append(" <div class=\"layui-form-item\">\n"); |
| | | builder.append(" <label class=\"layui-form-label"); |
| | | if (column.isNotNull()) { |
| | | builder.append(" layui-form-required"); |
| | | } |
| | | builder.append("\">").append(column.getComment()).append(": </label>\n"); |
| | | builder.append(" <div class=\"layui-input-block"); |
| | | if (!Cools.isEmpty(column.getForeignKeyMajor())) { |
| | | builder.append(" cool-auto-complete"); |
| | | } |
| | | builder.append("\">\n"); |
| | | appendFormField(builder, column, " "); |
| | | builder.append(" </div>\n"); |
| | | builder.append(" </div>\n"); |
| | | } |
| | | return trimTrailingBlankLines(builder.toString()); |
| | | } |
| | | |
| | | private String buildHtmlDetailContent() { |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (Column column : columns) { |
| | | String field = column.getHumpName(); |
| | | String label = GeneratorUtils.supportHtmlName(column.getComment()); |
| | | if (column.isPrimaryKey()) { |
| | | builder.append(" <div class=\"layui-inline\" style=\"display: none\">\n"); |
| | | builder.append(" <label class=\"layui-form-label\">").append(label).append(":</label>\n"); |
| | | builder.append(" <div class=\"layui-input-inline\">\n"); |
| | | builder.append(" <input id=\"").append(field).append("\" class=\"layui-input\" type=\"text\" placeholder=\"") |
| | | .append(column.getComment()).append("\">\n"); |
| | | builder.append(" </div>\n"); |
| | | builder.append(" </div>\n"); |
| | | continue; |
| | | } |
| | | builder.append(" <div class=\"layui-inline\">\n"); |
| | | builder.append(" <label class=\"layui-form-label\">"); |
| | | if (column.isNotNull()) { |
| | | builder.append("<span class=\"not-null\">*</span>"); |
| | | } |
| | | builder.append(label).append(":</label>\n"); |
| | | builder.append(" <div class=\"layui-input-inline"); |
| | | if (!Cools.isEmpty(column.getForeignKeyMajor())) { |
| | | builder.append(" cool-auto-complete"); |
| | | } |
| | | builder.append("\">\n"); |
| | | appendDetailFormField(builder, column, " "); |
| | | builder.append(" </div>\n"); |
| | | builder.append(" </div>\n"); |
| | | } |
| | | return trimTrailingBlankLines(builder.toString()); |
| | | } |
| | | |
| | | private String buildJsTableContent() { |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (Column column : columns) { |
| | | String field = resolveDisplayField(column); |
| | | builder.append(" ,{field: '").append(field).append("', align: 'center',title: '") |
| | | .append(escapeJs(column.getComment())).append("'"); |
| | | if (column.isCheckBox()) { |
| | | builder.append(", templet:function(row){\n") |
| | | .append(" var html = \"<input value='").append(column.getHumpName()) |
| | | .append("' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='\"+row.LAY_TABLE_INDEX+\"'\";\n") |
| | | .append(" if(row.").append(column.getHumpName()).append(" === 'Y'){html += \" checked \";}\n") |
| | | .append(" html += \">\";\n") |
| | | .append(" return html;\n") |
| | | .append(" }"); |
| | | } |
| | | if (column.isPrimaryKey()) { |
| | | builder.append(", sort: true"); |
| | | } |
| | | builder.append("}\n"); |
| | | } |
| | | return trimTrailingBlankLines(builder.toString()); |
| | | } |
| | | |
| | | private String buildJsDateContent() { |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (Column column : columns) { |
| | | if (column.isPrimaryKey()) { |
| | | continue; |
| | | } |
| | | if (!"Date".equals(column.getType())) { |
| | | continue; |
| | | } |
| | | builder.append(" layDate.render({\n"); |
| | | builder.append(" elem: '#").append(column.getHumpName()).append("$',\n"); |
| | | builder.append(" type: 'datetime',\n"); |
| | | builder.append(" value: data!==undefined?data['").append(column.getHumpName()).append("$']:null\n"); |
| | | builder.append(" });\n"); |
| | | } |
| | | return trimTrailingBlankLines(builder.toString()); |
| | | } |
| | | |
| | | private String resolveDisplayField(Column column) { |
| | | if ("Date".equals(column.getType()) || !Cools.isEmpty(column.getEnums()) || !Cools.isEmpty(column.getForeignKeyMajor())) { |
| | | return column.getHumpName() + "$"; |
| | | } |
| | | return column.getHumpName(); |
| | | } |
| | | |
| | | private List<Column> getNonPrimaryColumns() { |
| | | List<Column> result = new ArrayList<>(); |
| | | for (Column column : columns) { |
| | | if (!column.isPrimaryKey()) { |
| | | result.add(column); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private Column resolveRangeSearchColumn() { |
| | | for (Column column : columns) { |
| | | if ("Date".equals(column.getType()) && ("create_time".equals(column.getName()) || "createTime".equals(column.getHumpName()))) { |
| | | return column; |
| | | } |
| | | } |
| | | for (Column column : columns) { |
| | | if ("Date".equals(column.getType())) { |
| | | return column; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private String getForeignBasePackage(String foreignKey) { |
| | | if (SYSTEM_MODEL.contains(foreignKey)) { |
| | | return systemPackage + ".system"; |
| | | } |
| | | return packagePath; |
| | | } |
| | | |
| | | private void appendFormField(StringBuilder builder, Column column, String inputIndent) { |
| | | String field = column.getHumpName(); |
| | | if (Cools.isEmpty(column.getEnums())) { |
| | | builder.append(inputIndent).append("<input class=\"layui-input\" name=\"").append(field); |
| | | if ("Date".equals(column.getType())) { |
| | | builder.append("\" id=\"").append(field).append("$"); |
| | | } |
| | | builder.append("\" placeholder=\"请输入").append(column.getComment()).append("\""); |
| | | if (column.isNotNull()) { |
| | | builder.append(" lay-vertype=\"tips\" lay-verify=\"required\""); |
| | | } |
| | | if (!Cools.isEmpty(column.getForeignKeyMajor())) { |
| | | builder.append(" style=\"display: none\""); |
| | | } |
| | | builder.append(" autocomplete=\"off\">\n"); |
| | | if (!Cools.isEmpty(column.getForeignKeyMajor())) { |
| | | String queryKey = GeneratorUtils.firstCharConvert(column.getForeignKey()) + "QueryBy" + field; |
| | | builder.append(inputIndent).append("<input id=\"").append(field).append("$\" name=\"").append(field) |
| | | .append("$\" class=\"layui-input cool-auto-complete-div\" onclick=\"autoShow(this.id)\" type=\"text\" placeholder=\"请输入") |
| | | .append(column.getComment()).append("\" onfocus=this.blur() autocomplete=\"off\">\n"); |
| | | builder.append(inputIndent).append("<div class=\"cool-auto-complete-window\">\n"); |
| | | builder.append(inputIndent).append(" <input class=\"cool-auto-complete-window-input\" data-key=\"") |
| | | .append(queryKey).append("\" onkeyup=\"autoLoad(this.getAttribute('data-key'))\">\n"); |
| | | builder.append(inputIndent).append(" <select class=\"cool-auto-complete-window-select\" data-key=\"") |
| | | .append(queryKey).append("Select\" onchange=\"confirmed(this.getAttribute('data-key'))\" multiple=\"multiple\">\n"); |
| | | builder.append(inputIndent).append(" </select>\n"); |
| | | builder.append(inputIndent).append("</div>\n"); |
| | | } |
| | | return; |
| | | } |
| | | builder.append(inputIndent).append("<select name=\"").append(field).append("\""); |
| | | if (column.isNotNull()) { |
| | | builder.append(" lay-vertype=\"tips\" lay-verify=\"required\""); |
| | | } |
| | | builder.append(">\n"); |
| | | builder.append(inputIndent).append(" <option value=\"\">请选择").append(column.getComment()).append("</option>\n"); |
| | | for (Map<String, Object> map : column.getEnums()) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | builder.append(inputIndent).append(" <option value=\"").append(entry.getKey()).append("\">") |
| | | .append(entry.getValue()).append("</option>\n"); |
| | | } |
| | | } |
| | | builder.append(inputIndent).append("</select>\n"); |
| | | } |
| | | |
| | | private void appendDetailFormField(StringBuilder builder, Column column, String inputIndent) { |
| | | String field = column.getHumpName(); |
| | | if (Cools.isEmpty(column.getEnums())) { |
| | | if (!Cools.isEmpty(column.getForeignKeyMajor())) { |
| | | String queryKey = GeneratorUtils.firstCharConvert(column.getForeignKey()) + "QueryBy" + field; |
| | | builder.append(inputIndent).append("<input id=\"").append(field) |
| | | .append("\" class=\"layui-input\" type=\"text\" style=\"display: none\">\n"); |
| | | builder.append(inputIndent).append("<input id=\"").append(field).append("$\" class=\"layui-input cool-auto-complete-div\" onclick=\"autoShow(this.id)\" type=\"text\" placeholder=\"请输入") |
| | | .append(column.getComment()).append("\" onfocus=this.blur() autocomplete=\"off\">\n"); |
| | | builder.append(inputIndent).append("<div class=\"cool-auto-complete-window\">\n"); |
| | | builder.append(inputIndent).append(" <input class=\"cool-auto-complete-window-input\" data-key=\"") |
| | | .append(queryKey).append("\" onkeyup=\"autoLoad(this.getAttribute('data-key'))\">\n"); |
| | | builder.append(inputIndent).append(" <select class=\"cool-auto-complete-window-select\" data-key=\"") |
| | | .append(queryKey).append("Select\" onchange=\"confirmed(this.getAttribute('data-key'))\" multiple=\"multiple\">\n"); |
| | | builder.append(inputIndent).append(" </select>\n"); |
| | | builder.append(inputIndent).append("</div>\n"); |
| | | return; |
| | | } |
| | | builder.append(inputIndent).append("<input id=\"").append(field); |
| | | if ("Date".equals(column.getType())) { |
| | | builder.append("$"); |
| | | } |
| | | builder.append("\" class=\"layui-input\" type=\"text\" placeholder=\"").append(column.getComment()) |
| | | .append("\" autocomplete=\"off\""); |
| | | if (column.isNotNull()) { |
| | | builder.append(" lay-verify=\"required\""); |
| | | } |
| | | builder.append(">\n"); |
| | | return; |
| | | } |
| | | builder.append(inputIndent).append("<select id=\"").append(field).append("\""); |
| | | if (column.isNotNull()) { |
| | | builder.append(" lay-verify=\"required\""); |
| | | } |
| | | builder.append(">\n"); |
| | | builder.append(inputIndent).append(" <option value=\"\">请选择").append(column.getComment()).append("</option>\n"); |
| | | for (Map<String, Object> map : column.getEnums()) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | builder.append(inputIndent).append(" <option value=\"").append(entry.getKey()).append("\">") |
| | | .append(entry.getValue()).append("</option>\n"); |
| | | } |
| | | } |
| | | builder.append(inputIndent).append("</select>\n"); |
| | | } |
| | | |
| | | private String renderTemplate(String template) { |
| | | Map<String, String> values = new LinkedHashMap<>(); |
| | | values.put("COMPANYNAME", packagePath); |
| | | values.put("SYSTEMPACKAGE", systemPackage); |
| | | values.put("ENTITYNAME", fullEntityName); |
| | | values.put("SIMPLEENTITYNAME", simpleEntityName); |
| | | values.put("TABLENAME", table); |
| | | values.put("ENTITYIMPORT", entityImport); |
| | | values.put("ENTITYCONTENT", entityContent); |
| | | values.put("XMLCONTENT", xmlContent); |
| | | values.put("HTMLSEARCHCONTENT", htmlSearchContent); |
| | | values.put("HTMLDIALOGCONTENT", htmlDialogContent); |
| | | values.put("HTMLDETAILCONTENT", htmlDetailContent); |
| | | values.put("JSTABLECONTENT", jsTableContent); |
| | | values.put("JSDATECONTENT", jsDateContent); |
| | | values.put("PRIMARYKEYCOLUMN", GeneratorUtils.firstCharConvert(primaryKeyColumn, false)); |
| | | values.put("PRIMARYKEYCOLUMN0", primaryKeyColumn); |
| | | values.put("PRIMARYKEYTYPE", primaryKeyType); |
| | | values.put("MAJORCOLUMN", GeneratorUtils.humpToLine(majorColumn)); |
| | | values.put("UPCASEMARJORCOLUMN", GeneratorUtils.firstCharConvert(majorColumn, false)); |
| | | String content = template; |
| | | for (Map.Entry<String, String> entry : values.entrySet()) { |
| | | content = content.replace("@{" + entry.getKey() + "}", entry.getValue() == null ? "" : entry.getValue()); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | private void writeFile(String dir, String fileName, String content, String templateName) throws IOException { |
| | | Path directory = Paths.get(dir); |
| | | Files.createDirectories(directory); |
| | | Path file = directory.resolve(fileName); |
| | | if (Files.exists(file)) { |
| | | System.out.println(fullEntityName + templateName + " 源文件已经存在创建失败!"); |
| | | return; |
| | | } |
| | | try { |
| | | Files.write(file, content.getBytes(StandardCharsets.UTF_8), |
| | | StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE); |
| | | System.out.println(fullEntityName + templateName + " 源文件创建成功!"); |
| | | } catch (FileAlreadyExistsException e) { |
| | | System.out.println(fullEntityName + templateName + " 源文件已经存在创建失败!"); |
| | | } |
| | | } |
| | | |
| | | private String loadTemplate(String name) throws IOException { |
| | | InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("templates/" + name); |
| | | if (inputStream == null) { |
| | | throw new IOException("template not found: " + name); |
| | | } |
| | | try { |
| | | ByteArrayOutputStream output = new ByteArrayOutputStream(); |
| | | byte[] buffer = new byte[1024]; |
| | | int len; |
| | | while ((len = inputStream.read(buffer)) != -1) { |
| | | output.write(buffer, 0, len); |
| | | } |
| | | return new String(output.toByteArray(), StandardCharsets.UTF_8); |
| | | } finally { |
| | | inputStream.close(); |
| | | } |
| | | } |
| | | |
| | | private String trimTrailingBlankLines(String text) { |
| | | String trimmed = text; |
| | | while (trimmed.endsWith("\n\n")) { |
| | | trimmed = trimmed.substring(0, trimmed.length() - 1); |
| | | } |
| | | return trimmed; |
| | | } |
| | | |
| | | private String escapeJava(String text) { |
| | | return text == null ? "" : text.replace("\\", "\\\\").replace("\"", "\\\""); |
| | | } |
| | | |
| | | private String escapeJs(String text) { |
| | | return escapeJava(text).replace("'", "\\'"); |
| | | } |
| | | |
| | | private static class TableRef { |
| | | private final String catalog; |
| | | private final String schema; |
| | | private final String table; |
| | | |
| | | private TableRef(String catalog, String schema, String table) { |
| | | this.catalog = catalog; |
| | | this.schema = schema; |
| | | this.table = table; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.generators.constant; |
| | | |
| | | public enum SqlOsType { |
| | | MYSQL, |
| | | SQL_SERVER |
| | | } |
| New file |
| | |
| | | package com.core.generators.domain; |
| | | |
| | | import com.core.common.Cools; |
| | | import com.core.generators.CoolGenerator; |
| | | import com.core.generators.constant.SqlOsType; |
| | | import com.core.generators.utils.GeneratorUtils; |
| | | |
| | | import java.sql.Connection; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | public class Column { |
| | | |
| | | private String name; |
| | | private String type; |
| | | private String comment; |
| | | private String humpName; |
| | | private boolean primaryKey; |
| | | private boolean mainKey; |
| | | private boolean notNull; |
| | | private boolean major; |
| | | private boolean image; |
| | | private boolean checkBox; |
| | | private String foreignKey; |
| | | private String foreignKeyMajor; |
| | | private List<Map<String, Object>> enums; |
| | | private Integer length; |
| | | |
| | | public Column(Connection connection, String name, String type, String comment, boolean primaryKey, |
| | | boolean mainKey, boolean notNull, Integer length, boolean withForeignKey, SqlOsType sqlOsType) { |
| | | this.name = name; |
| | | this.type = type; |
| | | this.comment = ""; |
| | | if (!Cools.isEmpty(comment)) { |
| | | Pattern enumTitlePattern = Pattern.compile("(.+?)(?=\\{)"); |
| | | Matcher enumTitleMatcher = enumTitlePattern.matcher(comment); |
| | | Pattern foreignTitlePattern = Pattern.compile("(.+?)(?=\\[)"); |
| | | Matcher foreignTitleMatcher = foreignTitlePattern.matcher(comment); |
| | | if (enumTitleMatcher.find()) { |
| | | this.comment = enumTitleMatcher.group(); |
| | | Pattern enumPattern = Pattern.compile("(?<=\\{)(.+?)(?=})"); |
| | | Matcher enumMatcher = enumPattern.matcher(comment); |
| | | if (enumMatcher.find()) { |
| | | String enumText = enumMatcher.group(); |
| | | if (!Cools.isEmpty(enumText)) { |
| | | String[] enumArr = enumText.split(","); |
| | | this.enums = new ArrayList<>(); |
| | | for (String item : enumArr) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | String[] pair = item.split(":"); |
| | | if (pair.length >= 2) { |
| | | map.put(pair[0], pair[1]); |
| | | this.enums.add(map); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else if (foreignTitleMatcher.find()) { |
| | | this.comment = foreignTitleMatcher.group(); |
| | | Pattern foreignPattern = Pattern.compile("(?<=\\[)(.+?)(?=])"); |
| | | Matcher foreignMatcher = foreignPattern.matcher(comment); |
| | | if (foreignMatcher.find()) { |
| | | String foreignTable = foreignMatcher.group(); |
| | | if (!Cools.isEmpty(foreignTable)) { |
| | | this.foreignKey = GeneratorUtils.getNameSpace(foreignTable); |
| | | List<Column> foreignColumns = new ArrayList<>(); |
| | | if (withForeignKey) { |
| | | try { |
| | | switch (sqlOsType) { |
| | | case MYSQL: |
| | | foreignColumns = CoolGenerator.getMysqlColumns(connection, foreignTable, false, sqlOsType); |
| | | break; |
| | | case SQL_SERVER: |
| | | foreignColumns = CoolGenerator.getSqlServerColumns(connection, foreignTable, false, sqlOsType); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(foreignColumns)) { |
| | | for (Column column : foreignColumns) { |
| | | if (column.isMajor()) { |
| | | this.foreignKeyMajor = GeneratorUtils.firstCharConvert(column.getHumpName(), false); |
| | | } |
| | | } |
| | | if (Cools.isEmpty(this.foreignKeyMajor)) { |
| | | this.foreignKeyMajor = "Id"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | this.comment = comment; |
| | | } |
| | | if (comment.endsWith("(*)")) { |
| | | this.comment = comment.substring(0, comment.length() - 3); |
| | | this.major = true; |
| | | } |
| | | if (comment.endsWith("(img)")) { |
| | | this.comment = comment.substring(0, comment.length() - 5); |
| | | this.image = true; |
| | | } |
| | | if (comment.endsWith("(checkbox)")) { |
| | | this.comment = comment.substring(0, comment.length() - 10); |
| | | this.checkBox = true; |
| | | } |
| | | } |
| | | this.primaryKey = primaryKey; |
| | | this.mainKey = mainKey; |
| | | this.notNull = notNull; |
| | | this.length = length; |
| | | this.humpName = GeneratorUtils._convert(name); |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getComment() { |
| | | return comment; |
| | | } |
| | | |
| | | public String getWholeComment() { |
| | | if (!Cools.isEmpty(this.enums)) { |
| | | StringBuilder builder = new StringBuilder(""); |
| | | for (Map<String, Object> map : this.enums) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | builder.append(entry.getKey()).append(":").append(entry.getValue()).append(" "); |
| | | } |
| | | } |
| | | return new StringBuilder().append(this.comment).append(builder.toString()).toString(); |
| | | } |
| | | return this.comment; |
| | | } |
| | | |
| | | public void setComment(String comment) { |
| | | this.comment = comment; |
| | | } |
| | | |
| | | public String getHumpName() { |
| | | return humpName; |
| | | } |
| | | |
| | | public boolean isPrimaryKey() { |
| | | return primaryKey; |
| | | } |
| | | |
| | | public boolean isOnly() { |
| | | return primaryKey; |
| | | } |
| | | |
| | | public void setPrimaryKey(boolean primaryKey) { |
| | | this.primaryKey = primaryKey; |
| | | } |
| | | |
| | | public boolean isNotNull() { |
| | | return notNull; |
| | | } |
| | | |
| | | public void setNotNull(boolean notNull) { |
| | | this.notNull = notNull; |
| | | } |
| | | |
| | | public String getForeignKey() { |
| | | return foreignKey; |
| | | } |
| | | |
| | | public void setForeignKey(String foreignKey) { |
| | | this.foreignKey = foreignKey; |
| | | } |
| | | |
| | | public String getForeignKeyMajor() { |
| | | return foreignKeyMajor; |
| | | } |
| | | |
| | | public void setForeignKeyMajor(String foreignKeyMajor) { |
| | | this.foreignKeyMajor = foreignKeyMajor; |
| | | } |
| | | |
| | | public List<Map<String, Object>> getEnums() { |
| | | return enums; |
| | | } |
| | | |
| | | public void setEnums(List<Map<String, Object>> enums) { |
| | | this.enums = enums; |
| | | } |
| | | |
| | | public Integer getLength() { |
| | | return length; |
| | | } |
| | | |
| | | public void setLength(Integer length) { |
| | | this.length = length; |
| | | } |
| | | |
| | | public boolean isMajor() { |
| | | return major; |
| | | } |
| | | |
| | | public void setMajor(boolean major) { |
| | | this.major = major; |
| | | } |
| | | |
| | | public boolean isImage() { |
| | | return image; |
| | | } |
| | | |
| | | public void setImage(boolean image) { |
| | | this.image = image; |
| | | } |
| | | |
| | | public boolean isCheckBox() { |
| | | return checkBox; |
| | | } |
| | | |
| | | public void setCheckBox(boolean checkBox) { |
| | | this.checkBox = checkBox; |
| | | } |
| | | |
| | | public boolean isMainKey() { |
| | | return mainKey; |
| | | } |
| | | |
| | | public void setMainKey(boolean mainKey) { |
| | | this.mainKey = mainKey; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new StringBuilder() |
| | | .append("Column{name='").append(name).append('\'') |
| | | .append(", type='").append(type).append('\'') |
| | | .append(", comment='").append(comment).append('\'') |
| | | .append(", humpName='").append(humpName).append('\'') |
| | | .append(", primaryKey=").append(primaryKey) |
| | | .append(", notNull=").append(notNull) |
| | | .append(", major=").append(major) |
| | | .append(", image=").append(image) |
| | | .append(", foreignKey='").append(foreignKey).append('\'') |
| | | .append(", foreignKeyMajor='").append(foreignKeyMajor).append('\'') |
| | | .append(", enums=").append(enums) |
| | | .append(", length=").append(length) |
| | | .append('}') |
| | | .toString(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.generators.utils; |
| | | |
| | | import com.core.common.Cools; |
| | | |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | public class GeneratorUtils { |
| | | |
| | | public static String _convert(String text, boolean keepFirst) { |
| | | String[] arr = text.split("_"); |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (int i = 0; i < arr.length; i++) { |
| | | if (i == 0 && keepFirst) { |
| | | builder.append(arr[i]); |
| | | } else { |
| | | builder.append(arr[i].substring(0, 1).toUpperCase()).append(arr[i].substring(1)); |
| | | } |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | public static String _convert(String text) { |
| | | return _convert(text, true); |
| | | } |
| | | |
| | | public static String getType(int sqlType) { |
| | | switch (sqlType) { |
| | | case -7: |
| | | return "Boolean"; |
| | | case -6: |
| | | case 5: |
| | | return "Short"; |
| | | case 4: |
| | | return "Integer"; |
| | | case -5: |
| | | return "Long"; |
| | | case 8: |
| | | case 3: |
| | | return "Double"; |
| | | case -15: |
| | | case -9: |
| | | case 1: |
| | | case 12: |
| | | case 2004: |
| | | case -1: |
| | | return "String"; |
| | | case 91: |
| | | case 93: |
| | | return "Date"; |
| | | default: |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | public static String getNameSpace(String tableName) { |
| | | String[] arr = tableName.split("_"); |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (int i = 1; i < arr.length; i++) { |
| | | if (i != 1) { |
| | | builder.append("_"); |
| | | } |
| | | builder.append(arr[i]); |
| | | } |
| | | return _convert(builder.toString(), false); |
| | | } |
| | | |
| | | public static String supportHtmlName(String name) { |
| | | if (Cools.isEmpty(name)) { |
| | | return ""; |
| | | } |
| | | if (name.length() == 2) { |
| | | return new StringBuilder() |
| | | .append(name.charAt(0)) |
| | | .append(" ") |
| | | .append(name.charAt(1)) |
| | | .toString(); |
| | | } |
| | | if (name.length() == 3) { |
| | | return new StringBuilder() |
| | | .append(name.charAt(0)) |
| | | .append(" ") |
| | | .append(name.charAt(1)) |
| | | .append(" ") |
| | | .append(name.charAt(2)) |
| | | .toString(); |
| | | } |
| | | return name; |
| | | } |
| | | |
| | | public static Integer getColumnLength(String typeText) { |
| | | if (Cools.isEmpty(typeText)) { |
| | | return null; |
| | | } |
| | | Pattern pattern = Pattern.compile("(?<=\\()(.+?)(?=\\))"); |
| | | Matcher matcher = pattern.matcher(typeText); |
| | | if (matcher.find()) { |
| | | String value = matcher.group(); |
| | | if (value.contains(",")) { |
| | | value = value.split(",")[0]; |
| | | } |
| | | return Integer.valueOf(Integer.parseInt(value)); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static String firstCharConvert(String text, boolean lower) { |
| | | if (Cools.isEmpty(text)) { |
| | | return ""; |
| | | } |
| | | String first = text.substring(0, 1); |
| | | if (lower) { |
| | | first = first.toLowerCase(); |
| | | } else { |
| | | first = first.toUpperCase(); |
| | | } |
| | | return new StringBuilder().append(first).append(text.substring(1)).toString(); |
| | | } |
| | | |
| | | public static String firstCharConvert(String text) { |
| | | return firstCharConvert(text, true); |
| | | } |
| | | |
| | | public static String humpToLine(String text) { |
| | | Pattern pattern = Pattern.compile("[A-Z]"); |
| | | Matcher matcher = pattern.matcher(text); |
| | | StringBuffer buffer = new StringBuffer(); |
| | | while (matcher.find()) { |
| | | matcher.appendReplacement(buffer, "_" + matcher.group(0).toLowerCase()); |
| | | } |
| | | matcher.appendTail(buffer); |
| | | return buffer.toString(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.utils; |
| | | |
| | | /** |
| | | * 算法 |
| | | */ |
| | | public class Algorithm { |
| | | |
| | | private Algorithm() { |
| | | } |
| | | } |
| New file |
| | |
| | | package com.core.utils; |
| | | |
| | | import com.core.common.Cools; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public class SignUtils { |
| | | |
| | | public static String sign(Map<String, Object> param, String key) { |
| | | List<String> list = new ArrayList<>(); |
| | | for (String mapKey : param.keySet()) { |
| | | Object value = param.get(mapKey); |
| | | if ("sign".equals(mapKey) || value == null) { |
| | | continue; |
| | | } |
| | | list.add(mapKey + "=" + value + "&"); |
| | | } |
| | | String[] arr = list.toArray(new String[0]); |
| | | Arrays.sort(arr, String.CASE_INSENSITIVE_ORDER); |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (String item : arr) { |
| | | builder.append(item); |
| | | } |
| | | String text = builder.toString() + "key=" + key; |
| | | return Cools.md5(text).toUpperCase(); |
| | | } |
| | | } |
| | |
| | | |
| | | @EnableAsync |
| | | @EnableScheduling |
| | | @SpringBootApplication |
| | | @SpringBootApplication(scanBasePackages = {"com.zy", "com.core"}) |
| | | public class Boot extends SpringBootServletInitializer { |
| | | |
| | | public static void main(String[] args) { |
| | |
| | | package com.zy.ai.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.zy.ai.entity.LlmCallLog; |
| | |
| | | @RequestParam(required = false) Integer success, |
| | | @RequestParam(required = false) Long routeId, |
| | | @RequestParam(required = false) String traceId) { |
| | | EntityWrapper<LlmCallLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<LlmCallLog> wrapper = new QueryWrapper<>(); |
| | | if (!isBlank(scene)) { |
| | | wrapper.eq("scene", scene.trim()); |
| | | } |
| | |
| | | if (!isBlank(traceId)) { |
| | | wrapper.eq("trace_id", traceId.trim()); |
| | | } |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(llmCallLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(llmCallLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @PostMapping("/delete/auth") |
| | |
| | | if (id == null) { |
| | | return R.error("id不能为空"); |
| | | } |
| | | llmCallLogService.deleteById(id); |
| | | llmCallLogService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/clear/auth") |
| | | @ManagerAuth |
| | | public R clear() { |
| | | llmCallLogService.delete(new EntityWrapper<LlmCallLog>()); |
| | | llmCallLogService.remove(new QueryWrapper<LlmCallLog>()); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | package com.zy.ai.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | |
| | | @GetMapping("/list/auth") |
| | | @ManagerAuth |
| | | public R list() { |
| | | EntityWrapper<LlmRouteConfig> wrapper = new EntityWrapper<>(); |
| | | wrapper.orderBy("priority", true).orderBy("id", true); |
| | | List<LlmRouteConfig> list = llmRouteConfigService.selectList(wrapper); |
| | | QueryWrapper<LlmRouteConfig> wrapper = new QueryWrapper<>(); |
| | | wrapper.orderBy(true, true, "priority").orderBy(true, true, "id"); |
| | | List<LlmRouteConfig> list = llmRouteConfigService.list(wrapper); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | |
| | | if (config.getId() == null) { |
| | | llmRoutingService.fillAndNormalize(config, true); |
| | | llmRouteConfigService.insert(config); |
| | | llmRouteConfigService.save(config); |
| | | } else { |
| | | LlmRouteConfig db = llmRouteConfigService.selectById(config.getId()); |
| | | LlmRouteConfig db = llmRouteConfigService.getById(config.getId()); |
| | | if (db == null) { |
| | | return R.error("配置不存在"); |
| | | } |
| | |
| | | if (id == null) { |
| | | return R.error("id不能为空"); |
| | | } |
| | | llmRouteConfigService.deleteById(id); |
| | | llmRouteConfigService.removeById(id); |
| | | llmRoutingService.evictCache(); |
| | | return R.ok(); |
| | | } |
| | |
| | | if (id == null) { |
| | | return R.error("id不能为空"); |
| | | } |
| | | LlmRouteConfig cfg = llmRouteConfigService.selectById(id); |
| | | LlmRouteConfig cfg = llmRouteConfigService.getById(id); |
| | | if (cfg == null) { |
| | | return R.error("配置不存在"); |
| | | } |
| | |
| | | } |
| | | Map<String, Object> data = llmRoutingService.testRoute(config); |
| | | if (Boolean.TRUE.equals(data.get("ok")) && config.getId() != null) { |
| | | LlmRouteConfig db = llmRouteConfigService.selectById(config.getId()); |
| | | LlmRouteConfig db = llmRouteConfigService.getById(config.getId()); |
| | | if (db != null) { |
| | | db.setCooldownUntil(null); |
| | | db.setConsecutiveFailCount(0); |
| | |
| | | @GetMapping("/export/auth") |
| | | @ManagerAuth |
| | | public R exportConfig() { |
| | | EntityWrapper<LlmRouteConfig> wrapper = new EntityWrapper<>(); |
| | | wrapper.orderBy("priority", true).orderBy("id", true); |
| | | List<LlmRouteConfig> list = llmRouteConfigService.selectList(wrapper); |
| | | QueryWrapper<LlmRouteConfig> wrapper = new QueryWrapper<>(); |
| | | wrapper.orderBy(true, true, "priority").orderBy(true, true, "id"); |
| | | List<LlmRouteConfig> list = llmRouteConfigService.list(wrapper); |
| | | List<Map<String, Object>> routes = new ArrayList<>(); |
| | | if (list != null) { |
| | | for (LlmRouteConfig cfg : list) { |
| | |
| | | } |
| | | |
| | | if (replace) { |
| | | llmRouteConfigService.delete(new EntityWrapper<LlmRouteConfig>()); |
| | | llmRouteConfigService.remove(new QueryWrapper<LlmRouteConfig>()); |
| | | } |
| | | |
| | | HashMap<Long, LlmRouteConfig> dbById = new HashMap<>(); |
| | | if (!replace) { |
| | | List<LlmRouteConfig> current = llmRouteConfigService.selectList(new EntityWrapper<>()); |
| | | List<LlmRouteConfig> current = llmRouteConfigService.list(new QueryWrapper<>()); |
| | | if (current != null) { |
| | | for (LlmRouteConfig item : current) { |
| | | if (item != null && item.getId() != null) { |
| | |
| | | cfg.setLastUsedTime(null); |
| | | cfg.setLastError(null); |
| | | llmRoutingService.fillAndNormalize(cfg, true); |
| | | llmRouteConfigService.insert(cfg); |
| | | llmRouteConfigService.save(cfg); |
| | | inserted++; |
| | | } |
| | | |
| | |
| | | package com.zy.ai.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | |
| | | package com.zy.ai.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | |
| | | package com.zy.ai.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.ai.entity.LlmCallLog; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.ai.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.ai.entity.LlmRouteConfig; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import jakarta.annotation.PostConstruct; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.ai.entity.DeviceConfigsData; |
| | | import com.zy.ai.log.AiLogAppender; |
| | | import com.zy.ai.mcp.service.WcsDataFacade; |
| | |
| | | @Override |
| | | public Object getCrnDeviceStatus(JSONObject args) { |
| | | List<Integer> deviceNoList = optIntList(args, "crnNos"); |
| | | EntityWrapper<BasCrnp> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnp> wrapper = new QueryWrapper<>(); |
| | | if (deviceNoList != null && deviceNoList.size() > 0) { |
| | | wrapper.in("crn_no", deviceNoList); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | |
| | | List<Object> deviceList = new ArrayList<>(); |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(wrapper); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(wrapper); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, basCrnp.getCrnNo()); |
| | | if (crnThread == null) { |
| | |
| | | |
| | | @Override |
| | | public Object getStationDeviceStatus(JSONObject args) { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | JSONObject data = new JSONObject(); |
| | | |
| | | List<Object> stationList = new ArrayList<>(); |
| | |
| | | @Override |
| | | public Object getRgvDeviceStatus(JSONObject args) { |
| | | List<Integer> deviceNoList = optIntList(args, "rgvNos"); |
| | | EntityWrapper<BasRgv> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgv> wrapper = new QueryWrapper<>(); |
| | | if (deviceNoList != null && deviceNoList.size() > 0) { |
| | | wrapper.in("rgv_no", deviceNoList); |
| | | } |
| | | JSONObject data = new JSONObject(); |
| | | |
| | | List<Object> deviceList = new ArrayList<>(); |
| | | List<BasRgv> basRgvs = basRgvService.selectList(wrapper); |
| | | List<BasRgv> basRgvs = basRgvService.list(wrapper); |
| | | for (BasRgv basRgv : basRgvs) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, basRgv.getRgvNo()); |
| | | if (rgvThread == null) { |
| | |
| | | List<Integer> taskNos = optIntList(args, "taskNos"); |
| | | int limit = optInt(args, "limit", 200); |
| | | |
| | | EntityWrapper<WrkMast> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<WrkMast> wrapper = new QueryWrapper<>(); |
| | | if (taskNos != null && taskNos.size() > 0) { |
| | | wrapper.in("wrk_no", taskNos); |
| | | } |
| | |
| | | wrapper.eq("rgv_no", rgvNo); |
| | | } |
| | | |
| | | List<WrkMast> tasks = wrkMastService.selectList(wrapper); |
| | | List<WrkMast> tasks = wrkMastService.list(wrapper); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("tasks", tasks); |
| | | return data; |
| | |
| | | List<DeviceConfigsData> deviceConfigsDataList = new ArrayList<>(); |
| | | |
| | | List<Integer> crnNoList = optIntList(args, "crnNos"); |
| | | EntityWrapper<BasCrnp> crnWrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnp> crnWrapper = new QueryWrapper<>(); |
| | | if (crnNoList != null && crnNoList.size() > 0) { |
| | | crnWrapper.in("crn_no", crnNoList); |
| | | } |
| | | |
| | | List<Integer> rgvNoList = optIntList(args, "rgvNos"); |
| | | EntityWrapper<BasRgv> rgvWrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgv> rgvWrapper = new QueryWrapper<>(); |
| | | if (rgvNoList != null && rgvNoList.size() > 0) { |
| | | rgvWrapper.in("rgv_no", rgvNoList); |
| | | } |
| | | |
| | | List<Integer> devpNoList = optIntList(args, "devpNos"); |
| | | EntityWrapper<BasDevp> devpWrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDevp> devpWrapper = new QueryWrapper<>(); |
| | | if (devpNoList != null && devpNoList.size() > 0) { |
| | | devpWrapper.in("devp_no", devpNoList); |
| | | } |
| | | |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(crnWrapper); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(crnWrapper); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | DeviceConfigsData deviceConfigsData = new DeviceConfigsData(); |
| | | deviceConfigsData.setDeviceNo(basCrnp.getCrnNo()); |
| | |
| | | deviceConfigsDataList.add(deviceConfigsData); |
| | | } |
| | | |
| | | List<BasRgv> basRgvs = basRgvService.selectList(rgvWrapper); |
| | | List<BasRgv> basRgvs = basRgvService.list(rgvWrapper); |
| | | for (BasRgv basRgv : basRgvs) { |
| | | DeviceConfigsData deviceConfigsData = new DeviceConfigsData(); |
| | | deviceConfigsData.setDeviceNo(basRgv.getRgvNo()); |
| | |
| | | deviceConfigsDataList.add(deviceConfigsData); |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(devpWrapper); |
| | | List<BasDevp> basDevps = basDevpService.list(devpWrapper); |
| | | for (BasDevp basDevp : basDevps) { |
| | | DeviceConfigsData deviceConfigsData = new DeviceConfigsData(); |
| | | deviceConfigsData.setDeviceNo(basDevp.getDevpNo()); |
| | |
| | | @Override |
| | | public Object getSystemConfig(JSONObject args) { |
| | | JSONObject data = new JSONObject(); |
| | | List<Config> systemConfigList = configService.selectList(new EntityWrapper<Config>().notIn("dingdingReportUrl")); |
| | | List<Config> systemConfigList = configService.list(new QueryWrapper<Config>().ne("code", "dingdingReportUrl")); |
| | | data.put("systemConfigs", systemConfigList); |
| | | return data; |
| | | } |
| | |
| | | } |
| | | return list; |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.zy.ai.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.ai.entity.LlmCallLog; |
| | | |
| | | public interface LlmCallLogService extends IService<LlmCallLog> { |
| | |
| | | import com.zy.ai.entity.LlmRouteConfig; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.ai.openai.api.OpenAiApi; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestClientResponseException; |
| | | import org.springframework.web.reactive.function.client.WebClient; |
| | | import org.springframework.web.reactive.function.client.WebClientResponseException; |
| | | import reactor.core.publisher.Flux; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.Objects; |
| | | import java.util.UUID; |
| | | import java.util.concurrent.LinkedBlockingQueue; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | drain.setDaemon(true); |
| | | drain.start(); |
| | | |
| | | streamFlux(route, routeReq).subscribe(payload -> { |
| | | boolean springAiStreaming = canUseSpringAi(routeReq); |
| | | Flux<String> streamSource = springAiStreaming ? streamFluxWithSpringAi(route, routeReq) : streamFlux(route, routeReq); |
| | | streamSource.subscribe(payload -> { |
| | | if (payload == null || payload.isEmpty()) return; |
| | | if (springAiStreaming) { |
| | | queue.offer(payload); |
| | | appendLimited(outputBuffer, payload); |
| | | return; |
| | | } |
| | | String[] events = payload.split("\\r?\\n\\r?\\n"); |
| | | for (String part : events) { |
| | | String s = part; |
| | |
| | | .doOnError(ex -> log.error("调用 LLM 流式失败, route={}", route.tag(), ex)); |
| | | } |
| | | |
| | | private Flux<String> streamFluxWithSpringAi(ResolvedRoute route, ChatCompletionRequest req) { |
| | | OpenAiApi api = buildOpenAiApi(route); |
| | | OpenAiApi.ChatCompletionRequest springReq = buildSpringAiRequest(route, req, true); |
| | | return api.chatCompletionStream(springReq) |
| | | .flatMapIterable(chunk -> chunk == null || chunk.choices() == null ? List.<OpenAiApi.ChatCompletionChunk.ChunkChoice>of() : chunk.choices()) |
| | | .map(OpenAiApi.ChatCompletionChunk.ChunkChoice::delta) |
| | | .filter(Objects::nonNull) |
| | | .map(this::extractSpringAiContent) |
| | | .filter(text -> text != null && !text.isEmpty()) |
| | | .doOnError(ex -> log.error("调用 Spring AI 流式失败, route={}", route.tag(), ex)); |
| | | } |
| | | |
| | | private CompletionCallResult callCompletion(ResolvedRoute route, ChatCompletionRequest req) { |
| | | if (canUseSpringAi(req)) { |
| | | return callCompletionWithSpringAi(route, req); |
| | | } |
| | | return callCompletionWithWebClient(route, req); |
| | | } |
| | | |
| | | private CompletionCallResult callCompletionWithWebClient(ResolvedRoute route, ChatCompletionRequest req) { |
| | | WebClient client = WebClient.builder().baseUrl(route.baseUrl).build(); |
| | | RawCompletionResult raw = client.post() |
| | | .uri("/chat/completions") |
| | |
| | | throw new LlmRouteException(raw.statusCode, raw.payload); |
| | | } |
| | | return new CompletionCallResult(raw.statusCode, raw.payload, parseCompletion(raw.payload)); |
| | | } |
| | | |
| | | private CompletionCallResult callCompletionWithSpringAi(ResolvedRoute route, ChatCompletionRequest req) { |
| | | OpenAiApi api = buildOpenAiApi(route); |
| | | OpenAiApi.ChatCompletionRequest springReq = buildSpringAiRequest(route, req, false); |
| | | ResponseEntity<OpenAiApi.ChatCompletion> entity = api.chatCompletionEntity(springReq); |
| | | OpenAiApi.ChatCompletion body = entity.getBody(); |
| | | return new CompletionCallResult(entity.getStatusCode().value(), |
| | | body == null ? null : JSON.toJSONString(body), |
| | | toLegacyResponse(body)); |
| | | } |
| | | |
| | | private ChatCompletionRequest applyRoute(ChatCompletionRequest req, ResolvedRoute route, boolean stream) { |
| | |
| | | return quota ? route.switchOnQuota : route.switchOnError; |
| | | } |
| | | |
| | | private boolean canUseSpringAi(ChatCompletionRequest req) { |
| | | return req != null && (req.getTools() == null || req.getTools().isEmpty()); |
| | | } |
| | | |
| | | private void markSuccess(ResolvedRoute route) { |
| | | if (route.id != null) { |
| | | llmRoutingService.markSuccess(route.id); |
| | |
| | | } |
| | | return "status=" + e.statusCode + ", body=" + body; |
| | | } |
| | | if (ex instanceof RestClientResponseException) { |
| | | RestClientResponseException e = (RestClientResponseException) ex; |
| | | String body = e.getResponseBodyAsString(); |
| | | if (body != null && body.length() > 240) { |
| | | body = body.substring(0, 240); |
| | | } |
| | | return "status=" + e.getStatusCode().value() + ", body=" + body; |
| | | } |
| | | if (ex instanceof WebClientResponseException) { |
| | | WebClientResponseException e = (WebClientResponseException) ex; |
| | | String body = e.getResponseBodyAsString(); |
| | | if (body != null && body.length() > 240) { |
| | | body = body.substring(0, 240); |
| | | } |
| | | return "status=" + e.getStatusCode().value() + ", body=" + body; |
| | | } |
| | | return ex.getMessage() == null ? ex.toString() : ex.getMessage(); |
| | | } |
| | | |
| | | private boolean isQuotaExhausted(Throwable ex) { |
| | | if (!(ex instanceof LlmRouteException)) return false; |
| | | LlmRouteException e = (LlmRouteException) ex; |
| | | if (e.statusCode == 429) return true; |
| | | String text = (e.body == null ? "" : e.body).toLowerCase(); |
| | | Integer status = statusCodeOf(ex); |
| | | if (status != null && status == 429) { |
| | | return true; |
| | | } |
| | | String text = responseBodyOf(ex); |
| | | text = text == null ? "" : text.toLowerCase(Locale.ROOT); |
| | | return text.contains("insufficient_quota") |
| | | || text.contains("quota") |
| | | || text.contains("余额") |
| | |
| | | if (ex instanceof LlmRouteException) { |
| | | return ((LlmRouteException) ex).statusCode; |
| | | } |
| | | if (ex instanceof RestClientResponseException) { |
| | | return ((RestClientResponseException) ex).getStatusCode().value(); |
| | | } |
| | | if (ex instanceof WebClientResponseException) { |
| | | return ((WebClientResponseException) ex).getStatusCode().value(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private String responseBodyOf(Throwable ex) { |
| | | if (ex instanceof LlmRouteException) { |
| | | return cut(((LlmRouteException) ex).body, LOG_TEXT_LIMIT); |
| | | } |
| | | if (ex instanceof RestClientResponseException) { |
| | | return cut(((RestClientResponseException) ex).getResponseBodyAsString(), LOG_TEXT_LIMIT); |
| | | } |
| | | if (ex instanceof WebClientResponseException) { |
| | | return cut(((WebClientResponseException) ex).getResponseBodyAsString(), LOG_TEXT_LIMIT); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | return ex == null ? null : ex.getClass().getSimpleName(); |
| | | } |
| | | |
| | | private OpenAiApi buildOpenAiApi(ResolvedRoute route) { |
| | | return OpenAiApi.builder() |
| | | .baseUrl(route.baseUrl) |
| | | .apiKey(route.apiKey) |
| | | .build(); |
| | | } |
| | | |
| | | private OpenAiApi.ChatCompletionRequest buildSpringAiRequest(ResolvedRoute route, |
| | | ChatCompletionRequest req, |
| | | boolean stream) { |
| | | HashMap<String, Object> extraBody = new HashMap<>(); |
| | | if (route.thinkingEnabled || req.getThinking() != null) { |
| | | HashMap<String, Object> thinking = new HashMap<>(); |
| | | thinking.put("type", req.getThinking() != null && req.getThinking().getType() != null |
| | | ? req.getThinking().getType() |
| | | : "enable"); |
| | | extraBody.put("thinking", thinking); |
| | | } |
| | | return new OpenAiApi.ChatCompletionRequest( |
| | | toSpringAiMessages(req.getMessages()), |
| | | route.model, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | req.getMax_tokens(), |
| | | null, |
| | | 1, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | stream, |
| | | stream ? OpenAiApi.ChatCompletionRequest.StreamOptions.INCLUDE_USAGE : null, |
| | | req.getTemperature(), |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | null, |
| | | extraBody.isEmpty() ? null : extraBody |
| | | ); |
| | | } |
| | | |
| | | private List<OpenAiApi.ChatCompletionMessage> toSpringAiMessages(List<ChatCompletionRequest.Message> messages) { |
| | | ArrayList<OpenAiApi.ChatCompletionMessage> result = new ArrayList<>(); |
| | | if (messages == null) { |
| | | return result; |
| | | } |
| | | for (ChatCompletionRequest.Message message : messages) { |
| | | if (message == null) { |
| | | continue; |
| | | } |
| | | result.add(new OpenAiApi.ChatCompletionMessage( |
| | | message.getContent(), |
| | | toSpringAiRole(message.getRole()) |
| | | )); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private OpenAiApi.ChatCompletionMessage.Role toSpringAiRole(String role) { |
| | | if (role == null) { |
| | | return OpenAiApi.ChatCompletionMessage.Role.USER; |
| | | } |
| | | switch (role.trim().toLowerCase(Locale.ROOT)) { |
| | | case "system": |
| | | return OpenAiApi.ChatCompletionMessage.Role.SYSTEM; |
| | | case "assistant": |
| | | return OpenAiApi.ChatCompletionMessage.Role.ASSISTANT; |
| | | case "tool": |
| | | return OpenAiApi.ChatCompletionMessage.Role.TOOL; |
| | | default: |
| | | return OpenAiApi.ChatCompletionMessage.Role.USER; |
| | | } |
| | | } |
| | | |
| | | private ChatCompletionResponse toLegacyResponse(OpenAiApi.ChatCompletion completion) { |
| | | if (completion == null) { |
| | | return null; |
| | | } |
| | | ChatCompletionResponse response = new ChatCompletionResponse(); |
| | | response.setId(completion.id()); |
| | | response.setCreated(completion.created()); |
| | | response.setObjectName(completion.object()); |
| | | if (completion.usage() != null) { |
| | | ChatCompletionResponse.Usage usage = new ChatCompletionResponse.Usage(); |
| | | usage.setPromptTokens(completion.usage().promptTokens()); |
| | | usage.setCompletionTokens(completion.usage().completionTokens()); |
| | | usage.setTotalTokens(completion.usage().totalTokens()); |
| | | response.setUsage(usage); |
| | | } |
| | | if (completion.choices() != null) { |
| | | ArrayList<ChatCompletionResponse.Choice> choices = new ArrayList<>(); |
| | | for (OpenAiApi.ChatCompletion.Choice choice : completion.choices()) { |
| | | ChatCompletionResponse.Choice item = new ChatCompletionResponse.Choice(); |
| | | item.setIndex(choice.index()); |
| | | if (choice.finishReason() != null) { |
| | | item.setFinishReason(choice.finishReason().name().toLowerCase(Locale.ROOT)); |
| | | } |
| | | item.setMessage(toLegacyMessage(choice.message())); |
| | | choices.add(item); |
| | | } |
| | | response.setChoices(choices); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | private ChatCompletionRequest.Message toLegacyMessage(OpenAiApi.ChatCompletionMessage message) { |
| | | if (message == null) { |
| | | return null; |
| | | } |
| | | ChatCompletionRequest.Message result = new ChatCompletionRequest.Message(); |
| | | result.setContent(extractSpringAiContent(message)); |
| | | if (message.role() != null) { |
| | | result.setRole(message.role().name().toLowerCase(Locale.ROOT)); |
| | | } |
| | | result.setName(message.name()); |
| | | result.setTool_call_id(message.toolCallId()); |
| | | return result; |
| | | } |
| | | |
| | | private String extractSpringAiContent(OpenAiApi.ChatCompletionMessage message) { |
| | | if (message == null || message.rawContent() == null) { |
| | | return null; |
| | | } |
| | | Object content = message.rawContent(); |
| | | if (content instanceof String) { |
| | | return (String) content; |
| | | } |
| | | if (content instanceof List) { |
| | | try { |
| | | @SuppressWarnings("unchecked") |
| | | List<OpenAiApi.ChatCompletionMessage.MediaContent> media = |
| | | (List<OpenAiApi.ChatCompletionMessage.MediaContent>) content; |
| | | return OpenAiApi.getTextContent(media); |
| | | } catch (ClassCastException ignore) { |
| | | } |
| | | } |
| | | return String.valueOf(content); |
| | | } |
| | | |
| | | private String cut(String text, int maxLen) { |
| | | if (text == null) return null; |
| | | String clean = text.replace("\r", " "); |
| | |
| | | package com.zy.ai.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.ai.entity.LlmRouteConfig; |
| | | |
| | | public interface LlmRouteConfigService extends IService<LlmRouteConfig> { |
| | |
| | | package com.zy.ai.service; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.ai.entity.LlmRouteConfig; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | public void markSuccess(Long routeId) { |
| | | if (routeId == null) return; |
| | | try { |
| | | LlmRouteConfig db = llmRouteConfigService.selectById(routeId); |
| | | LlmRouteConfig db = llmRouteConfigService.getById(routeId); |
| | | if (db == null) return; |
| | | db.setSuccessCount(nvl(db.getSuccessCount()) + 1); |
| | | db.setConsecutiveFailCount(0); |
| | |
| | | public void markFailure(Long routeId, String errorText, boolean enterCooldown, Integer cooldownSeconds) { |
| | | if (routeId == null) return; |
| | | try { |
| | | LlmRouteConfig db = llmRouteConfigService.selectById(routeId); |
| | | LlmRouteConfig db = llmRouteConfigService.getById(routeId); |
| | | if (db == null) return; |
| | | Date now = new Date(); |
| | | db.setFailCount(nvl(db.getFailCount()) + 1); |
| | |
| | | if (now < cacheExpireAt && allRouteCache != null) { |
| | | return allRouteCache; |
| | | } |
| | | EntityWrapper<LlmRouteConfig> wrapper = new EntityWrapper<>(); |
| | | wrapper.orderBy("priority", true).orderBy("id", true); |
| | | List<LlmRouteConfig> list = llmRouteConfigService.selectList(wrapper); |
| | | QueryWrapper<LlmRouteConfig> wrapper = new QueryWrapper<>(); |
| | | wrapper.orderBy(true, true, "priority").orderBy(true, true, "id"); |
| | | List<LlmRouteConfig> list = llmRouteConfigService.list(wrapper); |
| | | if (list == null) { |
| | | allRouteCache = Collections.emptyList(); |
| | | } else { |
| | |
| | | package com.zy.ai.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.ai.entity.LlmCallLog; |
| | | import com.zy.ai.mapper.LlmCallLogMapper; |
| | | import com.zy.ai.service.LlmCallLogService; |
| | |
| | | return; |
| | | } |
| | | try { |
| | | insert(logItem); |
| | | save(logItem); |
| | | } catch (Exception e) { |
| | | String msg = e.getMessage() == null ? "" : e.getMessage(); |
| | | if (msg.contains("doesn't exist") || msg.contains("不存在")) { |
| | |
| | | package com.zy.ai.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.ai.entity.LlmRouteConfig; |
| | | import com.zy.ai.mapper.LlmRouteConfigMapper; |
| | | import com.zy.ai.service.LlmRouteConfigService; |
| | |
| | | package com.zy.ai.utils; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.ai.entity.DeviceConfigsData; |
| | | import com.zy.ai.entity.DeviceRealTimeData; |
| | | import com.zy.ai.entity.WcsDiagnosisRequest; |
| | |
| | | List<String> logs = AiLogAppender.getRecentLogs(logLimit); |
| | | request.setLogs(logs); |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<>()); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<>()); |
| | | request.setTasks(wrkMasts); |
| | | |
| | | List<DeviceRealTimeData> deviceRealTimeDataList = new ArrayList<>(); |
| | | List<DeviceConfigsData> deviceConfigsDataList = new ArrayList<>(); |
| | | |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>()); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, basCrnp.getCrnNo()); |
| | | if (crnThread == null) { |
| | |
| | | deviceConfigsDataList.add(deviceConfigsData); |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | |
| | | request.setDeviceRealtimeData(deviceRealTimeDataList); |
| | | request.setDeviceConfigs(deviceConfigsDataList); |
| | | |
| | | List<Config> systemConfigList = configService.selectList(new EntityWrapper<Config>().notIn("dingdingReportUrl")); |
| | | List<Config> systemConfigList = configService.list(new QueryWrapper<Config>().ne("code", "dingdingReportUrl")); |
| | | request.setSystemConfigs(systemConfigList); |
| | | |
| | | return request; |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | @RequestMapping(value = "/apiLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(apiLogService.selectById(String.valueOf(id))); |
| | | return R.ok(apiLogService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiLog/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<ApiLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<ApiLog> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(ApiLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("create_time", false); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} else { |
| | | wrapper.orderBy(true, false, "create_time"); |
| | | } |
| | | return R.ok(apiLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(apiLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/apiLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(ApiLog apiLog) { |
| | | apiLogService.insert(apiLog); |
| | | apiLogService.save(apiLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | apiLogService.deleteById(id); |
| | | apiLogService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/apiLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<ApiLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<ApiLog> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("apiLog")); |
| | | convert(map, wrapper); |
| | | List<ApiLog> list = apiLogService.selectList(wrapper); |
| | | List<ApiLog> list = apiLogService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<ApiLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<ApiLog> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("uuid", condition); |
| | | Page<ApiLog> page = apiLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<ApiLog> page = apiLogService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (ApiLog apiLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/apiLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<ApiLog> wrapper = new EntityWrapper<ApiLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != apiLogService.selectOne(wrapper)){ |
| | | QueryWrapper<ApiLog> wrapper = new QueryWrapper<ApiLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != apiLogService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(ApiLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | |
| | | @RequestMapping(value = "/basCrnp/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basCrnpService.selectById(String.valueOf(id))); |
| | | return R.ok(basCrnpService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnp/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasCrnp> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnp> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasCrnp.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basCrnpService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basCrnpService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basCrnp/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasCrnp basCrnp) { |
| | | basCrnpService.insert(basCrnp); |
| | | basCrnpService.save(basCrnp); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basCrnpService.deleteById(id); |
| | | basCrnpService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basCrnp/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasCrnp> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnp> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basCrnp")); |
| | | convert(map, wrapper); |
| | | List<BasCrnp> list = basCrnpService.selectList(wrapper); |
| | | List<BasCrnp> list = basCrnpService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnpQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasCrnp> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnp> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("crn_no", condition); |
| | | Page<BasCrnp> page = basCrnpService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasCrnp> page = basCrnpService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasCrnp basCrnp : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basCrnp/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasCrnp> wrapper = new EntityWrapper<BasCrnp>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basCrnpService.selectOne(wrapper)){ |
| | | QueryWrapper<BasCrnp> wrapper = new QueryWrapper<BasCrnp>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basCrnpService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasCrnp.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasCrnpErr; |
| | | import com.zy.asrs.service.BasCrnpErrService; |
| | |
| | | @RequestMapping(value = "/basCrnpErr/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basCrnpErrService.selectById(String.valueOf(id))); |
| | | return R.ok(basCrnpErrService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnpErr/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasCrnpErr> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnpErr> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasCrnpErr.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basCrnpErrService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basCrnpErrService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basCrnpErr/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasCrnpErr basCrnpErr) { |
| | | basCrnpErrService.insert(basCrnpErr); |
| | | basCrnpErrService.save(basCrnpErr); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basCrnpErrService.deleteById(id); |
| | | basCrnpErrService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basCrnpErr/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasCrnpErr> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnpErr> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basCrnpErr")); |
| | | convert(map, wrapper); |
| | | List<BasCrnpErr> list = basCrnpErrService.selectList(wrapper); |
| | | List<BasCrnpErr> list = basCrnpErrService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnpErrQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasCrnpErr> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnpErr> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasCrnpErr> page = basCrnpErrService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasCrnpErr> page = basCrnpErrService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasCrnpErr basCrnpErr : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basCrnpErr/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasCrnpErr> wrapper = new EntityWrapper<BasCrnpErr>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basCrnpErrService.selectOne(wrapper)){ |
| | | QueryWrapper<BasCrnpErr> wrapper = new QueryWrapper<BasCrnpErr>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basCrnpErrService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasCrnpErr.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasCrnpErrLog; |
| | | import com.zy.asrs.service.BasCrnpErrLogService; |
| | |
| | | @RequestMapping(value = "/basCrnpErrLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basCrnpErrLogService.selectById(String.valueOf(id))); |
| | | return R.ok(basCrnpErrLogService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnpErrLog/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasCrnpErrLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnpErrLog> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasCrnpErrLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basCrnpErrLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basCrnpErrLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basCrnpErrLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasCrnpErrLog basCrnpErrLog) { |
| | | basCrnpErrLogService.insert(basCrnpErrLog); |
| | | basCrnpErrLogService.save(basCrnpErrLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basCrnpErrLogService.deleteById(id); |
| | | basCrnpErrLogService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basCrnpErrLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasCrnpErrLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnpErrLog> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basCrnpErrLog")); |
| | | convert(map, wrapper); |
| | | List<BasCrnpErrLog> list = basCrnpErrLogService.selectList(wrapper); |
| | | List<BasCrnpErrLog> list = basCrnpErrLogService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnpErrLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasCrnpErrLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnpErrLog> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasCrnpErrLog> page = basCrnpErrLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasCrnpErrLog> page = basCrnpErrLogService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasCrnpErrLog basCrnpErrLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basCrnpErrLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasCrnpErrLog> wrapper = new EntityWrapper<BasCrnpErrLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basCrnpErrLogService.selectOne(wrapper)){ |
| | | QueryWrapper<BasCrnpErrLog> wrapper = new QueryWrapper<BasCrnpErrLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basCrnpErrLogService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasCrnpErrLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasCrnpOpt; |
| | | import com.zy.asrs.service.BasCrnpOptService; |
| | |
| | | @RequestMapping(value = "/basCrnpOpt/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basCrnpOptService.selectById(String.valueOf(id))); |
| | | return R.ok(basCrnpOptService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnpOpt/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasCrnpOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnpOpt> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasCrnpOpt.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("send_time", false); |
| | | return R.ok(basCrnpOptService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | wrapper.orderBy(true, false, "send_time"); |
| | | return R.ok(basCrnpOptService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basCrnpOpt/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasCrnpOpt basCrnpOpt) { |
| | | basCrnpOptService.insert(basCrnpOpt); |
| | | basCrnpOptService.save(basCrnpOpt); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids) { |
| | | basCrnpOptService.deleteById(id); |
| | | basCrnpOptService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basCrnpOpt/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasCrnpOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnpOpt> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basCrnpOpt")); |
| | | convert(map, wrapper); |
| | | List<BasCrnpOpt> list = basCrnpOptService.selectList(wrapper); |
| | | List<BasCrnpOpt> list = basCrnpOptService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnpOptQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasCrnpOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasCrnpOpt> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasCrnpOpt> page = basCrnpOptService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasCrnpOpt> page = basCrnpOptService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasCrnpOpt basCrnpOpt : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basCrnpOpt/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasCrnpOpt> wrapper = new EntityWrapper<BasCrnpOpt>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basCrnpOptService.selectOne(wrapper)){ |
| | | QueryWrapper<BasCrnpOpt> wrapper = new QueryWrapper<BasCrnpOpt>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basCrnpOptService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasCrnpOpt.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.domain.param.InitDevpStationParam; |
| | | import com.zy.asrs.entity.BasDevp; |
| | |
| | | @RequestMapping(value = "/basDevp/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basDevpService.selectById(String.valueOf(id))); |
| | | return R.ok(basDevpService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDevp/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasDevp> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDevp> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasDevp.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basDevpService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basDevpService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basDevp/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasDevp basDevp) { |
| | | basDevpService.insert(basDevp); |
| | | basDevpService.save(basDevp); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basDevpService.deleteById(id); |
| | | basDevpService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basDevp/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasDevp> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDevp> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basDevp")); |
| | | convert(map, wrapper); |
| | | List<BasDevp> list = basDevpService.selectList(wrapper); |
| | | List<BasDevp> list = basDevpService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDevpQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasDevp> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDevp> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasDevp> page = basDevpService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasDevp> page = basDevpService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasDevp basDevp : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basDevp/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasDevp> wrapper = new EntityWrapper<BasDevp>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basDevpService.selectOne(wrapper)){ |
| | | QueryWrapper<BasDevp> wrapper = new QueryWrapper<BasDevp>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basDevpService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasDevp.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | return R.error("参数不能为空"); |
| | | } |
| | | |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("devp_no", param.getDevpNo())); |
| | | BasDevp basDevp = basDevpService.getOne(new QueryWrapper<BasDevp>().eq("devp_no", param.getDevpNo())); |
| | | if(Cools.isEmpty(basDevp)){ |
| | | return R.error("设备不存在"); |
| | | } |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasDualCrnp; |
| | | import com.zy.asrs.service.BasDualCrnpService; |
| | |
| | | @RequestMapping(value = "/basDualCrnp/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basDualCrnpService.selectById(String.valueOf(id))); |
| | | return R.ok(basDualCrnpService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDualCrnp/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasDualCrnp> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnp> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasDualCrnp.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basDualCrnpService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basDualCrnpService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basDualCrnp/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasDualCrnp basDualCrnp) { |
| | | basDualCrnpService.insert(basDualCrnp); |
| | | basDualCrnpService.save(basDualCrnp); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basDualCrnpService.deleteById(id); |
| | | basDualCrnpService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basDualCrnp/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasDualCrnp> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnp> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basDualCrnp")); |
| | | convert(map, wrapper); |
| | | List<BasDualCrnp> list = basDualCrnpService.selectList(wrapper); |
| | | List<BasDualCrnp> list = basDualCrnpService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDualCrnpQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasDualCrnp> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnp> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("crn_no", condition); |
| | | Page<BasDualCrnp> page = basDualCrnpService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasDualCrnp> page = basDualCrnpService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasDualCrnp basDualCrnp : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basDualCrnp/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasDualCrnp> wrapper = new EntityWrapper<BasDualCrnp>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basDualCrnpService.selectOne(wrapper)){ |
| | | QueryWrapper<BasDualCrnp> wrapper = new QueryWrapper<BasDualCrnp>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basDualCrnpService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasDualCrnp.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasDualCrnpErr; |
| | | import com.zy.asrs.service.BasDualCrnpErrService; |
| | |
| | | @RequestMapping(value = "/basDualCrnpErr/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basDualCrnpErrService.selectById(String.valueOf(id))); |
| | | return R.ok(basDualCrnpErrService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDualCrnpErr/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasDualCrnpErr> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnpErr> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasDualCrnpErr.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basDualCrnpErrService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basDualCrnpErrService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basDualCrnpErr/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasDualCrnpErr basDualCrnpErr) { |
| | | basDualCrnpErrService.insert(basDualCrnpErr); |
| | | basDualCrnpErrService.save(basDualCrnpErr); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basDualCrnpErrService.deleteById(id); |
| | | basDualCrnpErrService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basDualCrnpErr/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasDualCrnpErr> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnpErr> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basDualCrnpErr")); |
| | | convert(map, wrapper); |
| | | List<BasDualCrnpErr> list = basDualCrnpErrService.selectList(wrapper); |
| | | List<BasDualCrnpErr> list = basDualCrnpErrService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDualCrnpErrQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasDualCrnpErr> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnpErr> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasDualCrnpErr> page = basDualCrnpErrService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasDualCrnpErr> page = basDualCrnpErrService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasDualCrnpErr basDualCrnpErr : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basDualCrnpErr/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasDualCrnpErr> wrapper = new EntityWrapper<BasDualCrnpErr>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basDualCrnpErrService.selectOne(wrapper)){ |
| | | QueryWrapper<BasDualCrnpErr> wrapper = new QueryWrapper<BasDualCrnpErr>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basDualCrnpErrService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasDualCrnpErr.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasDualCrnpErrLog; |
| | | import com.zy.asrs.service.BasDualCrnpErrLogService; |
| | |
| | | @RequestMapping(value = "/basDualCrnpErrLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basDualCrnpErrLogService.selectById(String.valueOf(id))); |
| | | return R.ok(basDualCrnpErrLogService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDualCrnpErrLog/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasDualCrnpErrLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnpErrLog> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasDualCrnpErrLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basDualCrnpErrLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basDualCrnpErrLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basDualCrnpErrLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasDualCrnpErrLog basDualCrnpErrLog) { |
| | | basDualCrnpErrLogService.insert(basDualCrnpErrLog); |
| | | basDualCrnpErrLogService.save(basDualCrnpErrLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basDualCrnpErrLogService.deleteById(id); |
| | | basDualCrnpErrLogService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basDualCrnpErrLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasDualCrnpErrLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnpErrLog> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basDualCrnpErrLog")); |
| | | convert(map, wrapper); |
| | | List<BasDualCrnpErrLog> list = basDualCrnpErrLogService.selectList(wrapper); |
| | | List<BasDualCrnpErrLog> list = basDualCrnpErrLogService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDualCrnpErrLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasDualCrnpErrLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnpErrLog> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasDualCrnpErrLog> page = basDualCrnpErrLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasDualCrnpErrLog> page = basDualCrnpErrLogService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasDualCrnpErrLog basDualCrnpErrLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basDualCrnpErrLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasDualCrnpErrLog> wrapper = new EntityWrapper<BasDualCrnpErrLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basDualCrnpErrLogService.selectOne(wrapper)){ |
| | | QueryWrapper<BasDualCrnpErrLog> wrapper = new QueryWrapper<BasDualCrnpErrLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basDualCrnpErrLogService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasDualCrnpErrLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasDualCrnpOpt; |
| | | import com.zy.asrs.service.BasDualCrnpOptService; |
| | |
| | | @RequestMapping(value = "/basDualCrnpOpt/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basDualCrnpOptService.selectById(String.valueOf(id))); |
| | | return R.ok(basDualCrnpOptService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDualCrnpOpt/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasDualCrnpOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnpOpt> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasDualCrnpOpt.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("send_time", false); |
| | | return R.ok(basDualCrnpOptService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | wrapper.orderBy(true, false, "send_time"); |
| | | return R.ok(basDualCrnpOptService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basDualCrnpOpt/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasDualCrnpOpt basDualCrnpOpt) { |
| | | basDualCrnpOptService.insert(basDualCrnpOpt); |
| | | basDualCrnpOptService.save(basDualCrnpOpt); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basDualCrnpOptService.deleteById(id); |
| | | basDualCrnpOptService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basDualCrnpOpt/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasDualCrnpOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnpOpt> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basDualCrnpOpt")); |
| | | convert(map, wrapper); |
| | | List<BasDualCrnpOpt> list = basDualCrnpOptService.selectList(wrapper); |
| | | List<BasDualCrnpOpt> list = basDualCrnpOptService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basDualCrnpOptQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasDualCrnpOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasDualCrnpOpt> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasDualCrnpOpt> page = basDualCrnpOptService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasDualCrnpOpt> page = basDualCrnpOptService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasDualCrnpOpt basDualCrnpOpt : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basDualCrnpOpt/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasDualCrnpOpt> wrapper = new EntityWrapper<BasDualCrnpOpt>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basDualCrnpOptService.selectOne(wrapper)){ |
| | | QueryWrapper<BasDualCrnpOpt> wrapper = new QueryWrapper<BasDualCrnpOpt>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basDualCrnpOptService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasDualCrnpOpt.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | @RequestMapping(value = "/basLocSts/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basLocStsService.selectById(id)); |
| | | return R.ok(basLocStsService.getById(id)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basLocSts/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<BasLocSts> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasLocSts> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basLocStsService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basLocStsService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == basLocSts.getLocSts()){ |
| | | basLocStsService.insert(basLocSts); |
| | | basLocStsService.save(basLocSts); |
| | | } else { |
| | | basLocStsService.updateById(basLocSts); |
| | | } |
| | |
| | | basLocSts.setModiTime(new Date()); |
| | | basLocSts.setAppeUser(getUserId()); |
| | | basLocSts.setAppeTime(new Date()); |
| | | basLocStsService.insert(basLocSts); |
| | | basLocStsService.save(basLocSts); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.error(); |
| | | } |
| | | for (BasLocSts entity : list){ |
| | | basLocStsService.delete(new EntityWrapper<>(entity)); |
| | | basLocStsService.remove(new QueryWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth(memo = "库位状态导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<BasLocSts> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasLocSts> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basLocSts")); |
| | | convert(map, wrapper); |
| | | List<BasLocSts> list = basLocStsService.selectList(wrapper); |
| | | List<BasLocSts> list = basLocStsService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basLocStsQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasLocSts> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasLocSts> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("loc_desc", condition); |
| | | Page<BasLocSts> page = basLocStsService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasLocSts> page = basLocStsService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasLocSts basLocSts : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basLocSts/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasLocSts> wrapper = new EntityWrapper<BasLocSts>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basLocStsService.selectOne(wrapper)){ |
| | | QueryWrapper<BasLocSts> wrapper = new QueryWrapper<BasLocSts>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basLocStsService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasLocSts.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.BasMap; |
| | |
| | | @RequestMapping(value = "/basMap/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basMapService.selectById(String.valueOf(id))); |
| | | return R.ok(basMapService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basMap/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasMap> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasMap> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasMap.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("lev"); |
| | | return R.ok(basMapService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | wrapper.orderBy(true, true, "lev"); |
| | | return R.ok(basMapService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basMap/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasMap basMap) { |
| | | basMapService.insert(basMap); |
| | | basMapService.save(basMap); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basMapService.deleteById(id); |
| | | basMapService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basMap/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasMap> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasMap> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basMap")); |
| | | convert(map, wrapper); |
| | | List<BasMap> list = basMapService.selectList(wrapper); |
| | | List<BasMap> list = basMapService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basMapQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasMap> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasMap> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasMap> page = basMapService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasMap> page = basMapService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasMap basMap : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basMap/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasMap> wrapper = new EntityWrapper<BasMap>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basMapService.selectOne(wrapper)){ |
| | | QueryWrapper<BasMap> wrapper = new QueryWrapper<BasMap>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basMapService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasMap.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | @GetMapping("/basMap/lev/{lev}/auth") |
| | | @ManagerAuth |
| | | public R getByLev(@PathVariable("lev") Integer lev) { |
| | | BasMap basMap = basMapService.selectOne(new EntityWrapper<BasMap>().eq("lev", lev)); |
| | | BasMap basMap = basMapService.getOne(new QueryWrapper<BasMap>().eq("lev", lev)); |
| | | if (basMap == null){ |
| | | return R.error("地图不存在"); |
| | | } |
| | |
| | | dataList.add(arrayList); |
| | | } |
| | | |
| | | BasMap basMap = basMapService.selectOne(new EntityWrapper<BasMap>().eq("lev", lev)); |
| | | BasMap basMap = basMapService.getOne(new QueryWrapper<BasMap>().eq("lev", lev)); |
| | | if (basMap == null) { |
| | | basMap = new BasMap(); |
| | | } |
| | |
| | | basMap.setCreateTime(new Date()); |
| | | basMap.setUpdateTime(new Date()); |
| | | basMap.setLev(lev); |
| | | basMapService.insertOrUpdate(basMap); |
| | | basMapService.saveOrUpdate(basMap); |
| | | } |
| | | |
| | | basStationService.delete(new EntityWrapper<>()); |
| | | basStationService.remove(new QueryWrapper<>()); |
| | | |
| | | deviceStationMap.forEach((deviceNo, stationList) -> { |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("devp_no", deviceNo)); |
| | | BasDevp basDevp = basDevpService.getOne(new QueryWrapper<BasDevp>().eq("devp_no", deviceNo)); |
| | | if (basDevp == null) { |
| | | basDevp = new BasDevp(); |
| | | basDevp.setDevpNo(deviceNo); |
| | |
| | | |
| | | basDevp.setStationList(JSON.toJSONString(stationList, SerializerFeature.DisableCircularReferenceDetect)); |
| | | basDevp.setUpdateTime(new Date()); |
| | | basDevpService.insertOrUpdate(basDevp); |
| | | basDevpService.saveOrUpdate(basDevp); |
| | | |
| | | DeviceConfig deviceConfig = deviceConfigService.selectOne(new EntityWrapper<DeviceConfig>().eq("device_no", deviceNo).eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | DeviceConfig deviceConfig = deviceConfigService.getOne(new QueryWrapper<DeviceConfig>().eq("device_no", deviceNo).eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | if (deviceConfig != null) { |
| | | deviceConfig.setFakeInitStatus(JSON.toJSONString(stationList)); |
| | | deviceConfigService.updateById(deviceConfig); |
| | |
| | | basStation.setStationLev(stationObjModel.getStationLev()); |
| | | basStation.setCreateTime(new Date()); |
| | | basStation.setStatus(1); |
| | | basStationService.insert(basStation); |
| | | basStationService.save(basStation); |
| | | } |
| | | }); |
| | | } catch (Exception e) { |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.BasDevp; |
| | |
| | | Map<String, Object> data = new HashMap<>(); |
| | | |
| | | List<Integer> stationIds = new ArrayList<>(); |
| | | List<BasDevp> devps = basDevpService.selectList(new EntityWrapper<BasDevp>().eq("status", 1)); |
| | | List<BasDevp> devps = basDevpService.list(new QueryWrapper<BasDevp>().eq("status", 1)); |
| | | for (BasDevp devp : devps) { |
| | | for (StationObjModel stationObjModel : devp.getOutStationList$()) { |
| | | stationIds.add(stationObjModel.getStationId()); |
| | |
| | | } |
| | | List<BasStation> stations = stationIds.isEmpty() |
| | | ? new ArrayList<>() |
| | | : basStationService.selectList(new EntityWrapper<BasStation>().in("station_id", stationIds)); |
| | | : basStationService.list(new QueryWrapper<BasStation>().in("station_id", stationIds)); |
| | | data.put("stations", stations); |
| | | |
| | | List<BasOutArea> areas = basOutAreaService.selectList(new EntityWrapper<>()); |
| | | List<BasOutArea> areas = basOutAreaService.list(new QueryWrapper<>()); |
| | | data.put("areas", areas); |
| | | |
| | | List<BasOutStationArea> relations = basOutStationAreaService.selectList(new EntityWrapper<>()); |
| | | List<BasOutStationArea> relations = basOutStationAreaService.list(new QueryWrapper<>()); |
| | | data.put("relations", relations); |
| | | |
| | | return R.ok(data); |
| | |
| | | JSONArray areas = payload.getJSONArray("areas"); |
| | | JSONArray relations = payload.getJSONArray("relations"); |
| | | |
| | | basOutAreaService.delete(new EntityWrapper<>()); |
| | | basOutStationAreaService.delete(new EntityWrapper<>()); |
| | | basOutAreaService.remove(new QueryWrapper<>()); |
| | | basOutStationAreaService.remove(new QueryWrapper<>()); |
| | | |
| | | if (areas != null && !areas.isEmpty()) { |
| | | List<BasOutArea> areaList = new ArrayList<>(); |
| | |
| | | areaList.add(a); |
| | | } |
| | | if (!areaList.isEmpty()) { |
| | | basOutAreaService.insertBatch(areaList); |
| | | basOutAreaService.saveBatch(areaList); |
| | | } |
| | | } |
| | | |
| | |
| | | relList.add(r); |
| | | } |
| | | if (!relList.isEmpty()) { |
| | | basOutStationAreaService.insertBatch(relList); |
| | | basOutStationAreaService.saveBatch(relList); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.zy.asrs.service.BasRgvService; |
| | |
| | | @RequestMapping(value = "/basRgv/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basRgvService.selectById(String.valueOf(id))); |
| | | return R.ok(basRgvService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basRgv/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasRgv> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgv> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasRgv.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basRgvService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basRgvService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basRgv/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasRgv basRgv) { |
| | | basRgvService.insert(basRgv); |
| | | basRgvService.save(basRgv); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basRgvService.deleteById(id); |
| | | basRgvService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basRgv/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasRgv> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgv> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basRgv")); |
| | | convert(map, wrapper); |
| | | List<BasRgv> list = basRgvService.selectList(wrapper); |
| | | List<BasRgv> list = basRgvService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basRgvQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasRgv> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgv> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("rgv_no", condition); |
| | | Page<BasRgv> page = basRgvService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasRgv> page = basRgvService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasRgv basRgv : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basRgv/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasRgv> wrapper = new EntityWrapper<BasRgv>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basRgvService.selectOne(wrapper)){ |
| | | QueryWrapper<BasRgv> wrapper = new QueryWrapper<BasRgv>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basRgvService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasRgv.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasRgvErr; |
| | | import com.zy.asrs.service.BasRgvErrService; |
| | |
| | | @RequestMapping(value = "/basRgvErr/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basRgvErrService.selectById(String.valueOf(id))); |
| | | return R.ok(basRgvErrService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basRgvErr/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasRgvErr> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgvErr> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasRgvErr.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basRgvErrService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basRgvErrService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basRgvErr/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasRgvErr basRgvErr) { |
| | | basRgvErrService.insert(basRgvErr); |
| | | basRgvErrService.save(basRgvErr); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basRgvErrService.deleteById(id); |
| | | basRgvErrService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basRgvErr/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasRgvErr> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgvErr> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basRgvErr")); |
| | | convert(map, wrapper); |
| | | List<BasRgvErr> list = basRgvErrService.selectList(wrapper); |
| | | List<BasRgvErr> list = basRgvErrService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basRgvErrQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasRgvErr> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgvErr> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasRgvErr> page = basRgvErrService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasRgvErr> page = basRgvErrService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasRgvErr basRgvErr : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basRgvErr/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasRgvErr> wrapper = new EntityWrapper<BasRgvErr>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basRgvErrService.selectOne(wrapper)){ |
| | | QueryWrapper<BasRgvErr> wrapper = new QueryWrapper<BasRgvErr>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basRgvErrService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasRgvErr.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasRgvErrLog; |
| | | import com.zy.asrs.service.BasRgvErrLogService; |
| | |
| | | @RequestMapping(value = "/basRgvErrLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basRgvErrLogService.selectById(String.valueOf(id))); |
| | | return R.ok(basRgvErrLogService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basRgvErrLog/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasRgvErrLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgvErrLog> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasRgvErrLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basRgvErrLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basRgvErrLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basRgvErrLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasRgvErrLog basRgvErrLog) { |
| | | basRgvErrLogService.insert(basRgvErrLog); |
| | | basRgvErrLogService.save(basRgvErrLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basRgvErrLogService.deleteById(id); |
| | | basRgvErrLogService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basRgvErrLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasRgvErrLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgvErrLog> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basRgvErrLog")); |
| | | convert(map, wrapper); |
| | | List<BasRgvErrLog> list = basRgvErrLogService.selectList(wrapper); |
| | | List<BasRgvErrLog> list = basRgvErrLogService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basRgvErrLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasRgvErrLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgvErrLog> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasRgvErrLog> page = basRgvErrLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasRgvErrLog> page = basRgvErrLogService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasRgvErrLog basRgvErrLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basRgvErrLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasRgvErrLog> wrapper = new EntityWrapper<BasRgvErrLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basRgvErrLogService.selectOne(wrapper)){ |
| | | QueryWrapper<BasRgvErrLog> wrapper = new QueryWrapper<BasRgvErrLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basRgvErrLogService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasRgvErrLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasRgvOpt; |
| | | import com.zy.asrs.service.BasRgvOptService; |
| | |
| | | @RequestMapping(value = "/basRgvOpt/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basRgvOptService.selectById(String.valueOf(id))); |
| | | return R.ok(basRgvOptService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basRgvOpt/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasRgvOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgvOpt> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasRgvOpt.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("send_time", false); |
| | | return R.ok(basRgvOptService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | wrapper.orderBy(true, false, "send_time"); |
| | | return R.ok(basRgvOptService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basRgvOpt/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasRgvOpt basRgvOpt) { |
| | | basRgvOptService.insert(basRgvOpt); |
| | | basRgvOptService.save(basRgvOpt); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basRgvOptService.deleteById(id); |
| | | basRgvOptService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basRgvOpt/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasRgvOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgvOpt> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basRgvOpt")); |
| | | convert(map, wrapper); |
| | | List<BasRgvOpt> list = basRgvOptService.selectList(wrapper); |
| | | List<BasRgvOpt> list = basRgvOptService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basRgvOptQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasRgvOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasRgvOpt> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasRgvOpt> page = basRgvOptService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasRgvOpt> page = basRgvOptService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasRgvOpt basRgvOpt : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basRgvOpt/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasRgvOpt> wrapper = new EntityWrapper<BasRgvOpt>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basRgvOptService.selectOne(wrapper)){ |
| | | QueryWrapper<BasRgvOpt> wrapper = new QueryWrapper<BasRgvOpt>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basRgvOptService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasRgvOpt.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.zy.asrs.service.BasStationService; |
| | |
| | | @RequestMapping(value = "/basStation/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basStationService.selectById(String.valueOf(id))); |
| | | return R.ok(basStationService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStation/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasStation> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasStation> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasStation.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basStationService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basStationService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basStation/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasStation basStation) { |
| | | basStationService.insert(basStation); |
| | | basStationService.save(basStation); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basStationService.deleteById(id); |
| | | basStationService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basStation/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasStation> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasStation> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basStation")); |
| | | convert(map, wrapper); |
| | | List<BasStation> list = basStationService.selectList(wrapper); |
| | | List<BasStation> list = basStationService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStationQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasStation> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasStation> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("station_id", condition); |
| | | Page<BasStation> page = basStationService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasStation> page = basStationService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasStation basStation : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basStation/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasStation> wrapper = new EntityWrapper<BasStation>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basStationService.selectOne(wrapper)){ |
| | | QueryWrapper<BasStation> wrapper = new QueryWrapper<BasStation>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basStationService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasStation.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.BasDualCrnp; |
| | |
| | | @RequestMapping("/list/auth") |
| | | @ManagerAuth |
| | | public R list() { |
| | | return R.ok(basStationDeviceService.selectList(new EntityWrapper<>())); |
| | | return R.ok(basStationDeviceService.list(new QueryWrapper<>())); |
| | | } |
| | | |
| | | @RequestMapping("/save/auth") |
| | |
| | | |
| | | // However, to be safer, we should probably only delete for the stations involved or delete all if it's a full save. |
| | | // Let's assume the UI sends the full current state of configuration. |
| | | basStationDeviceService.delete(new EntityWrapper<>()); |
| | | basStationDeviceService.remove(new QueryWrapper<>()); |
| | | if (list != null && !list.isEmpty()) { |
| | | basStationDeviceService.insertBatch(list); |
| | | basStationDeviceService.saveBatch(list); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | Map<String, Object> data = new HashMap<>(); |
| | | |
| | | List<Integer> stationList = new ArrayList<>(); |
| | | List<BasDevp> devps = basDevpService.selectList(new EntityWrapper<BasDevp>().eq("status", 1)); |
| | | List<BasDevp> devps = basDevpService.list(new QueryWrapper<BasDevp>().eq("status", 1)); |
| | | for (BasDevp devp : devps) { |
| | | for (StationObjModel stationObjModel : devp.getBarcodeStationList$()) { |
| | | stationList.add(stationObjModel.getStationId()); |
| | | } |
| | | } |
| | | |
| | | List<BasStation> stations = basStationService.selectList(new EntityWrapper<BasStation>().in("station_id", stationList)); |
| | | List<BasStation> stations = basStationService.list(new QueryWrapper<BasStation>().in("station_id", stationList)); |
| | | data.put("stations", stations); |
| | | |
| | | // Get Devices (Crn and DualCrn) |
| | | List<Map<String, Object>> devices = new ArrayList<>(); |
| | | |
| | | List<BasCrnp> crns = basCrnpService.selectList(new EntityWrapper<BasCrnp>().eq("status", 1)); |
| | | List<BasCrnp> crns = basCrnpService.list(new QueryWrapper<BasCrnp>().eq("status", 1)); |
| | | for (BasCrnp crn : crns) { |
| | | Map<String, Object> d = new HashMap<>(); |
| | | d.put("deviceNo", crn.getCrnNo()); |
| | |
| | | devices.add(d); |
| | | } |
| | | |
| | | List<BasDualCrnp> dualCrns = basDualCrnpService.selectList(new EntityWrapper<BasDualCrnp>().eq("status", 1)); |
| | | List<BasDualCrnp> dualCrns = basDualCrnpService.list(new QueryWrapper<BasDualCrnp>().eq("status", 1)); |
| | | for (BasDualCrnp dualCrn : dualCrns) { |
| | | Map<String, Object> d = new HashMap<>(); |
| | | d.put("deviceNo", dualCrn.getCrnNo()); |
| | |
| | | data.put("devices", devices); |
| | | |
| | | // Get existing relations |
| | | List<BasStationDevice> relations = basStationDeviceService.selectList(new EntityWrapper<>()); |
| | | List<BasStationDevice> relations = basStationDeviceService.list(new QueryWrapper<>()); |
| | | data.put("relations", relations); |
| | | |
| | | return R.ok(data); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.BasStationOpt; |
| | | import com.zy.asrs.service.BasStationOptService; |
| | |
| | | @RequestMapping(value = "/basStationOpt/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(basStationOptService.selectById(String.valueOf(id))); |
| | | return R.ok(basStationOptService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStationOpt/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<BasStationOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasStationOpt> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasStationOpt.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("send_time", false); |
| | | return R.ok(basStationOptService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | wrapper.orderBy(true, false, "send_time"); |
| | | return R.ok(basStationOptService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/basStationOpt/add/auth") |
| | | @ManagerAuth |
| | | public R add(BasStationOpt basStationOpt) { |
| | | basStationOptService.insert(basStationOpt); |
| | | basStationOptService.save(basStationOpt); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | basStationOptService.deleteById(id); |
| | | basStationOptService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/basStationOpt/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<BasStationOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasStationOpt> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basStationOpt")); |
| | | convert(map, wrapper); |
| | | List<BasStationOpt> list = basStationOptService.selectList(wrapper); |
| | | List<BasStationOpt> list = basStationOptService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basStationOptQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasStationOpt> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasStationOpt> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<BasStationOpt> page = basStationOptService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasStationOpt> page = basStationOptService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasStationOpt basStationOpt : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basStationOpt/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasStationOpt> wrapper = new EntityWrapper<BasStationOpt>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basStationOptService.selectOne(wrapper)){ |
| | | QueryWrapper<BasStationOpt> wrapper = new QueryWrapper<BasStationOpt>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basStationOptService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasStationOpt.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | @RequestMapping(value = "/basWrkIotype/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(basWrkIotypeService.selectById(String.valueOf(id))); |
| | | return R.ok(basWrkIotypeService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWrkIotype/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<BasWrkIotype> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasWrkIotype> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basWrkIotypeService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basWrkIotypeService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == basWrkIotype.getIoType()){ |
| | | basWrkIotypeService.insert(basWrkIotype); |
| | | basWrkIotypeService.save(basWrkIotype); |
| | | } else { |
| | | basWrkIotypeService.updateById(basWrkIotype); |
| | | } |
| | |
| | | basWrkIotype.setModiTime(new Date()); |
| | | basWrkIotype.setAppeUser(getUserId()); |
| | | basWrkIotype.setAppeTime(new Date()); |
| | | basWrkIotypeService.insert(basWrkIotype); |
| | | basWrkIotypeService.save(basWrkIotype); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.error(); |
| | | } |
| | | for (BasWrkIotype entity : list){ |
| | | basWrkIotypeService.delete(new EntityWrapper<>(entity)); |
| | | basWrkIotypeService.remove(new QueryWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth(memo = "入出库类型导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<BasWrkIotype> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasWrkIotype> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basWrkIotype")); |
| | | convert(map, wrapper); |
| | | List<BasWrkIotype> list = basWrkIotypeService.selectList(wrapper); |
| | | List<BasWrkIotype> list = basWrkIotypeService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWrkIotypeQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasWrkIotype> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasWrkIotype> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("io_desc", condition); |
| | | Page<BasWrkIotype> page = basWrkIotypeService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasWrkIotype> page = basWrkIotypeService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasWrkIotype basWrkIotype : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basWrkIotype/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasWrkIotype> wrapper = new EntityWrapper<BasWrkIotype>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basWrkIotypeService.selectOne(wrapper)){ |
| | | QueryWrapper<BasWrkIotype> wrapper = new QueryWrapper<BasWrkIotype>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basWrkIotypeService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasWrkIotype.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | @RequestMapping(value = "/basWrkStatus/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(basWrkStatusService.selectById(String.valueOf(id))); |
| | | return R.ok(basWrkStatusService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWrkStatus/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<BasWrkStatus> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasWrkStatus> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(basWrkStatusService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(basWrkStatusService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == basWrkStatus.getWrkSts()){ |
| | | basWrkStatusService.insert(basWrkStatus); |
| | | basWrkStatusService.save(basWrkStatus); |
| | | } else { |
| | | basWrkStatusService.updateById(basWrkStatus); |
| | | } |
| | |
| | | basWrkStatus.setModiTime(new Date()); |
| | | basWrkStatus.setAppeUser(getUserId()); |
| | | basWrkStatus.setAppeTime(new Date()); |
| | | basWrkStatusService.insert(basWrkStatus); |
| | | basWrkStatusService.save(basWrkStatus); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.error(); |
| | | } |
| | | for (BasWrkStatus entity : list){ |
| | | basWrkStatusService.delete(new EntityWrapper<>(entity)); |
| | | basWrkStatusService.remove(new QueryWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth(memo = "工作状态导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<BasWrkStatus> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasWrkStatus> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basWrkStatus")); |
| | | convert(map, wrapper); |
| | | List<BasWrkStatus> list = basWrkStatusService.selectList(wrapper); |
| | | List<BasWrkStatus> list = basWrkStatusService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWrkStatusQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<BasWrkStatus> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<BasWrkStatus> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("wrk_desc", condition); |
| | | Page<BasWrkStatus> page = basWrkStatusService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<BasWrkStatus> page = basWrkStatusService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasWrkStatus basWrkStatus : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/basWrkStatus/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<BasWrkStatus> wrapper = new EntityWrapper<BasWrkStatus>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basWrkStatusService.selectOne(wrapper)){ |
| | | QueryWrapper<BasWrkStatus> wrapper = new QueryWrapper<BasWrkStatus>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != basWrkStatusService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasWrkStatus.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | |
| | | public R stationLatestData() { |
| | | List<StationLatestDataVo> vos = new ArrayList<>(); |
| | | |
| | | WrkLastno inTaskRange = wrkLastnoService.selectById(WrkIoType.IN.id); |
| | | WrkLastno outTaskRange = wrkLastnoService.selectById(WrkIoType.OUT.id); |
| | | WrkLastno inTaskRange = wrkLastnoService.getById(WrkIoType.IN.id); |
| | | WrkLastno outTaskRange = wrkLastnoService.getById(WrkIoType.OUT.id); |
| | | |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig deviceConfig : devpList) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, |
| | |
| | | public R crnLatestData() { |
| | | List<CrnLatestDataVo> vos = new ArrayList<>(); |
| | | |
| | | List<DeviceConfig> crnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> crnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn))); |
| | | for (DeviceConfig deviceConfig : crnList) { |
| | | // 获取堆垛机信息 |
| | |
| | | vo.setCrnStatus(CrnStatusType.MACHINE_ERROR); |
| | | } else { |
| | | if (crnProtocol.getTaskNo() > 0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(crnProtocol.getTaskNo()); |
| | | WrkMast wrkMast = wrkMastService.getById(crnProtocol.getTaskNo()); |
| | | if (wrkMast != null) { |
| | | vo.setCrnStatus(CrnStatusType.process(wrkMast.getIoType())); |
| | | } else { |
| | |
| | | @ManagerAuth(memo = "双工位堆垛机实时数据") |
| | | public R dualCrnLatestData() { |
| | | List<CrnLatestDataVo> vos = new ArrayList<>(); |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.DualCrn))); |
| | | for (DeviceConfig deviceConfig : dualCrnList) { |
| | | DualCrnThread crnThread = (DualCrnThread) SlaveConnection.get(SlaveType.DualCrn, deviceConfig.getDeviceNo()); |
| | |
| | | @ManagerAuth(memo = "RGV实时数据") |
| | | public R rgvLatestData(){ |
| | | List<RgvLatestDataVo> vos = new ArrayList<>(); |
| | | List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> rgvList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | | for (DeviceConfig deviceConfig : rgvList) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, deviceConfig.getDeviceNo()); |
| | |
| | | } |
| | | CrnDetailVo vo = new CrnDetailVo(); |
| | | |
| | | DeviceConfig deviceConfig = deviceConfigService.selectOne(new EntityWrapper<DeviceConfig>() |
| | | DeviceConfig deviceConfig = deviceConfigService.getOne(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn)) |
| | | .eq("device_no", crnNo)); |
| | | |
| | |
| | | vo.setCrnStatus(crnProtocol.getStatusType().desc); |
| | | |
| | | if (crnProtocol.getAlarm() > 0) { |
| | | BasCrnpErr crnError = basCrnpErrService.selectById(crnProtocol.getAlarm()); |
| | | BasCrnpErr crnError = basCrnpErrService.getById(crnProtocol.getAlarm()); |
| | | vo.setError(crnError == null ? "未知异常" : crnError.getErrName()); |
| | | } |
| | | |
| | | if (crnProtocol.getTaskNo() > 0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(crnProtocol.getTaskNo()); |
| | | WrkMast wrkMast = wrkMastService.getById(crnProtocol.getTaskNo()); |
| | | if (wrkMast != null) { |
| | | vo.setSourceStaNo(String.valueOf(wrkMast.getSourceStaNo())); |
| | | vo.setStaNo(String.valueOf(wrkMast.getStaNo())); |
| | |
| | | } |
| | | |
| | | private List<List<HashMap<String, Object>>> buildLocMapBase() { |
| | | BasMap basMap = basMapService.selectOne(new EntityWrapper<BasMap>().eq("lev", 1)); |
| | | BasMap basMap = basMapService.getOne(new QueryWrapper<BasMap>().eq("lev", 1)); |
| | | if (Cools.isEmpty(basMap) || Cools.isEmpty(basMap.getData())) { |
| | | return null; |
| | | } |
| | |
| | | JSONArray data = JSON.parseArray(object.toString()); |
| | | return R.ok().add(data); |
| | | } |
| | | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<LocMast> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("lev1", 1); |
| | | List<LocMast> locMasts = locMastService.selectList(wrapper); |
| | | List<LocMast> locMasts = locMastService.list(wrapper); |
| | | redisUtil.set(RedisKeyType.LOC_MAST_MAP_LIST.key, JSON.toJSONString(locMasts), 60 * 60 * 24); |
| | | return R.ok().add(locMasts); |
| | | } |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | |
| | | @ManagerAuth(memo = "堆垛机信息表") |
| | | public R crnStateTable() { |
| | | List<CrnStateTableVo> list = new ArrayList<>(); |
| | | List<BasCrnp> crnps = basCrnpService.selectList(new EntityWrapper<BasCrnp>().orderBy("crn_no")); |
| | | List<BasCrnp> crnps = basCrnpService.list(new QueryWrapper<BasCrnp>().orderBy(true, true, "crn_no")); |
| | | for (BasCrnp basCrnp : crnps) { |
| | | // 表格行 |
| | | CrnStateTableVo vo = new CrnStateTableVo(); |
| | |
| | | } |
| | | |
| | | if (crnProtocol.getTaskNo() > 0) { |
| | | WrkMast wrkMast = wrkMastService.selectById(crnProtocol.getTaskNo()); |
| | | WrkMast wrkMast = wrkMastService.getById(crnProtocol.getTaskNo()); |
| | | if (wrkMast != null) { |
| | | vo.setSourceStaNo(String.valueOf(wrkMast.getSourceStaNo())); // 源站 |
| | | vo.setStaNo(String.valueOf(wrkMast.getStaNo())); // 目标站 |
| | |
| | | |
| | | vo.setWarnCode(String.valueOf(crnProtocol.getAlarm())); |
| | | if (crnProtocol.getAlarm() > 0) { |
| | | BasCrnpErr crnError = basCrnpErrService.selectById(crnProtocol.getAlarm()); |
| | | BasCrnpErr crnError = basCrnpErrService.getById(crnProtocol.getAlarm()); |
| | | vo.setAlarm(crnError == null ? "未知异常" : crnError.getErrName()); |
| | | vo.setDeviceStatus("ERROR"); |
| | | } |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.service.DeviceConfigService; |
| | |
| | | @RequestMapping(value = "/deviceConfig/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(deviceConfigService.selectById(String.valueOf(id))); |
| | | return R.ok(deviceConfigService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/deviceConfig/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<DeviceConfig> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<DeviceConfig> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(DeviceConfig.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(deviceConfigService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(deviceConfigService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @ManagerAuth |
| | | public R add(DeviceConfig deviceConfig) { |
| | | deviceConfig.setCreateTime(new Date()); |
| | | deviceConfigService.insert(deviceConfig); |
| | | deviceConfigService.save(deviceConfig); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | deviceConfigService.deleteById(id); |
| | | deviceConfigService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/deviceConfig/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<DeviceConfig> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<DeviceConfig> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("deviceConfig")); |
| | | convert(map, wrapper); |
| | | List<DeviceConfig> list = deviceConfigService.selectList(wrapper); |
| | | List<DeviceConfig> list = deviceConfigService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/deviceConfigQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<DeviceConfig> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<DeviceConfig> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<DeviceConfig> page = deviceConfigService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<DeviceConfig> page = deviceConfigService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (DeviceConfig deviceConfig : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/deviceConfig/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<DeviceConfig> wrapper = new EntityWrapper<DeviceConfig>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != deviceConfigService.selectOne(wrapper)){ |
| | | QueryWrapper<DeviceConfig> wrapper = new QueryWrapper<DeviceConfig>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != deviceConfigService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(DeviceConfig.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Path; |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | |
| | | @ManagerAuth(memo = "双工位堆垛机信息表") |
| | | public R dualCrnStateTable() { |
| | | List<DualCrnStateTableVo> list = new ArrayList<>(); |
| | | List<BasDualCrnp> crnps = basDualCrnpService.selectList(new EntityWrapper<BasDualCrnp>().orderBy("crn_no")); |
| | | List<BasDualCrnp> crnps = basDualCrnpService.list(new QueryWrapper<BasDualCrnp>().orderBy(true, true, "crn_no")); |
| | | for (BasDualCrnp basDualCrnp : crnps) { |
| | | DualCrnStateTableVo vo = new DualCrnStateTableVo(); |
| | | vo.setCrnNo(basDualCrnp.getCrnNo()); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.zy.asrs.service.HttpRequestLogService; |
| | |
| | | @RequestMapping(value = "/httpRequestLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(httpRequestLogService.selectById(String.valueOf(id))); |
| | | return R.ok(httpRequestLogService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/httpRequestLog/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<HttpRequestLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<HttpRequestLog> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(HttpRequestLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("create_time desc"); |
| | | return R.ok(httpRequestLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | wrapper.orderBy(true, false, "create_time"); |
| | | return R.ok(httpRequestLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/httpRequestLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(HttpRequestLog httpRequestLog) { |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | httpRequestLogService.save(httpRequestLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | httpRequestLogService.deleteById(id); |
| | | httpRequestLogService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @RequestMapping(value = "/httpRequestLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<HttpRequestLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<HttpRequestLog> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("httpRequestLog")); |
| | | convert(map, wrapper); |
| | | List<HttpRequestLog> list = httpRequestLogService.selectList(wrapper); |
| | | List<HttpRequestLog> list = httpRequestLogService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/httpRequestLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<HttpRequestLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<HttpRequestLog> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<HttpRequestLog> page = httpRequestLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<HttpRequestLog> page = httpRequestLogService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (HttpRequestLog httpRequestLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/httpRequestLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<HttpRequestLog> wrapper = new EntityWrapper<HttpRequestLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != httpRequestLogService.selectOne(wrapper)){ |
| | | QueryWrapper<HttpRequestLog> wrapper = new QueryWrapper<HttpRequestLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != httpRequestLogService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(HttpRequestLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | @RequestMapping(value = "/locMast/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(locMastService.selectById(String.valueOf(id))); |
| | | return R.ok(locMastService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locMast/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<LocMast> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(locMastService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(locMastService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | return R.error(); |
| | | } |
| | | for (LocMast entity : list){ |
| | | locMastService.delete(new EntityWrapper<>(entity)); |
| | | locMastService.remove(new QueryWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth(memo = "库位导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<LocMast> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("locMast")); |
| | | convert(map, wrapper); |
| | | List<LocMast> list = locMastService.selectList(wrapper); |
| | | List<LocMast> list = locMastService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locMastQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<LocMast> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("loc_no", condition); |
| | | Page<LocMast> page = locMastService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<LocMast> page = locMastService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (LocMast locMast : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/locMast/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<LocMast> wrapper = new EntityWrapper<LocMast>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != locMastService.selectOne(wrapper)){ |
| | | QueryWrapper<LocMast> wrapper = new QueryWrapper<LocMast>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != locMastService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(LocMast.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | @ManagerAuth(memo = "初始化库位") |
| | | @Transactional |
| | | public R locMastInit(@RequestParam Integer lev) { |
| | | BasMap basMap = basMapService.selectOne(new EntityWrapper<BasMap>().eq("lev", 1)); |
| | | BasMap basMap = basMapService.getOne(new QueryWrapper<BasMap>().eq("lev", 1)); |
| | | if (Cools.isEmpty(basMap)){ |
| | | return R.error("请先初始化地图"); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | locMastService.delete(new EntityWrapper<LocMast>()); |
| | | locMastService.remove(new QueryWrapper<LocMast>()); |
| | | |
| | | for (int i = 1; i <= lev; i++) { |
| | | int finalLev = i; |
| | |
| | | locMast.setLocType(Utils.getLocNo(mapX, mapY, finalLev)); |
| | | locMast.setStatus(1); |
| | | locMast.setAppeTime(new Date()); |
| | | locMastService.insert(locMast); |
| | | locMastService.save(locMast); |
| | | }); |
| | | } |
| | | |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | |
| | | result.put("notifyEndpoint", endpoint); |
| | | result.put("queueCount", loadQueueRecords(null, null).size()); |
| | | if (!Cools.isEmpty(endpoint)) { |
| | | result.put("logCount", httpRequestLogService.selectCount(new EntityWrapper<HttpRequestLog>().eq("name", endpoint))); |
| | | result.put("logCount", httpRequestLogService.count(new QueryWrapper<HttpRequestLog>().eq("name", endpoint))); |
| | | } else { |
| | | result.put("logCount", 0); |
| | | } |
| | |
| | | @RequestParam(required = false) Integer result, |
| | | @RequestParam(required = false) String condition) { |
| | | String endpoint = buildNotifyEndpoint(getConfigValue("notifyUri"), getConfigValue("notifyUriPath")); |
| | | EntityWrapper<HttpRequestLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<HttpRequestLog> wrapper = new QueryWrapper<>(); |
| | | if (!Cools.isEmpty(endpoint)) { |
| | | wrapper.eq("name", endpoint); |
| | | } else { |
| | |
| | | wrapper.like("request", "\"device\":" + device); |
| | | } |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.andNew().like("request", condition).or().like("response", condition); |
| | | wrapper.and(q -> q.like("request", condition).or().like("response", condition)); |
| | | } |
| | | if (result != null) { |
| | | wrapper.eq("result", result); |
| | | } |
| | | wrapper.orderBy("create_time", false); |
| | | wrapper.orderBy(true, false, "create_time"); |
| | | |
| | | Page<HttpRequestLog> logPage = httpRequestLogService.selectPage(new Page<>(curr, limit), wrapper); |
| | | Page<HttpRequestLog> logPage = httpRequestLogService.page(new Page<>(curr, limit), wrapper); |
| | | Page<NotifyReportVo> resultPage = new Page<>(curr, limit); |
| | | resultPage.setTotal(logPage.getTotal()); |
| | | |
| | |
| | | detail.put("sourceType", "log"); |
| | | detail.put("logId", logId); |
| | | |
| | | HttpRequestLog log = httpRequestLogService.selectById(logId); |
| | | HttpRequestLog log = httpRequestLogService.getById(logId); |
| | | if (log == null) { |
| | | detail.put("success", false); |
| | | detail.put("message", "通知日志不存在"); |
| | |
| | | } |
| | | |
| | | private String getConfigValue(String code) { |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", code)); |
| | | Config config = configService.getOne(new QueryWrapper<Config>().eq("code", code)); |
| | | return config == null ? null : config.getValue(); |
| | | } |
| | | |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // 获取堆垛机数据 |
| | | ArrayList<CrnProtocol> crnProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> crnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> crnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn))); |
| | | for (DeviceConfig device : crnList) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, device.getDeviceNo()); |
| | |
| | | |
| | | // 获取RGV数据 |
| | | ArrayList<RgvProtocol> rgvProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> rgvList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | | for (DeviceConfig device : rgvList) { |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, device.getDeviceNo()); |
| | |
| | | |
| | | // 获取双工位堆垛机数据 |
| | | ArrayList<DualCrnProtocol> dualCrnProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.DualCrn))); |
| | | for (DeviceConfig device : dualCrnList) { |
| | | DualCrnThread dualCrnThread = (DualCrnThread) SlaveConnection.get(SlaveType.DualCrn, device.getDeviceNo()); |
| | |
| | | |
| | | // 获取输送站点数据 |
| | | ArrayList<StationProtocol> stationProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> stationList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> stationList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig device : stationList) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, device.getDeviceNo()); |
| | |
| | | public R getStationStatus(@RequestBody GetStationStatusParam param) { |
| | | // 获取输送站点数据 |
| | | List<StationProtocol> stationProtocols = new ArrayList<>(); |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp)) |
| | | ); |
| | | for (DeviceConfig device : devpList) { |
| | |
| | | @OpenApiLog(memo = "获取全部库位信息") |
| | | public R getAllLocInformation(@RequestBody GetAllLocInformationParam param) { |
| | | List<HashMap<String, Object>> list = new ArrayList<>(); |
| | | EntityWrapper<LocMast> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<LocMast> wrapper = new QueryWrapper<>(); |
| | | |
| | | if (!Cools.isEmpty(param.getRow())) { |
| | | wrapper.eq("row1", param.getRow()); |
| | |
| | | wrapper.eq("lev1", param.getLev()); |
| | | } |
| | | |
| | | List<LocMast> locMasts = locMastService.selectList(wrapper); |
| | | List<LocMast> locMasts = locMastService.list(wrapper); |
| | | if (locMasts.isEmpty()) { |
| | | return R.ok().add(list); |
| | | } |
| | |
| | | @PostMapping("/queryTask") |
| | | @OpenApiLog(memo = "查询任务") |
| | | public R queryTask(@RequestBody QueryTaskParam param) { |
| | | EntityWrapper<WrkMast> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<WrkMast> wrapper = new QueryWrapper<>(); |
| | | if (param.getTaskNo() != null) { |
| | | wrapper.eq("wms_wrk_no", param.getTaskNo()); |
| | | } |
| | |
| | | } |
| | | wrapper.eq("io_type", ioType.id); |
| | | } |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(wrapper); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(wrapper); |
| | | return R.ok().add(wrkMasts); |
| | | } |
| | | |
| | |
| | | if (mainProcessPlugin.contains("Fake")) { |
| | | map.put("running", false); |
| | | map.put("isFake", true); |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | Config config = configService.getOne(new QueryWrapper<Config>().eq("code", "enableFake")); |
| | | if (config != null) { |
| | | if (config.getValue().equals("Y")) { |
| | | map.put("running", true); |
| | |
| | | @PostMapping("/startFakeSystem") |
| | | @OpenApiLog(memo = "启动仿真模拟") |
| | | public R startFakeSystem() { |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | Config config = configService.getOne(new QueryWrapper<Config>().eq("code", "enableFake")); |
| | | if (config != null) { |
| | | config.setValue("Y"); |
| | | configService.updateById(config); |
| | |
| | | @PostMapping("/stopFakeSystem") |
| | | @OpenApiLog(memo = "停止仿真模拟") |
| | | public R stopFakeSystem() { |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | Config config = configService.getOne(new QueryWrapper<Config>().eq("code", "enableFake")); |
| | | if (config != null) { |
| | | config.setValue("N"); |
| | | configService.updateById(config); |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | |
| | | @ManagerAuth(memo = "RGV信息表") |
| | | public R rgvStateTable() { |
| | | List<RgvStateTableVo> list = new ArrayList<>(); |
| | | List<BasRgv> rgvs = basRgvService.selectList(new EntityWrapper<BasRgv>().orderBy("rgv_no")); |
| | | List<BasRgv> rgvs = basRgvService.list(new QueryWrapper<BasRgv>().orderBy(true, true, "rgv_no")); |
| | | for (BasRgv basRgv : rgvs) { |
| | | RgvStateTableVo vo = new RgvStateTableVo(); |
| | | vo.setRgvNo(basRgv.getRgvNo()); |
| | |
| | | |
| | | vo.setWarnCode(String.valueOf(rgvProtocol.getAlarm())); |
| | | if (rgvProtocol.getAlarm() != null && rgvProtocol.getAlarm() > 0) { |
| | | BasRgvErr err = basRgvErrService.selectById(rgvProtocol.getAlarm()); |
| | | BasRgvErr err = basRgvErrService.getById(rgvProtocol.getAlarm()); |
| | | vo.setAlarm(err == null ? "未知异常" : err.getErrName()); |
| | | vo.setDeviceStatus("ERROR"); |
| | | } |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.asrs.domain.param.StationCommandBarcodeParam; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | |
| | | return R.error("当前系统未启用仿真插件"); |
| | | } |
| | | |
| | | Config enableFakeConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | Config enableFakeConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "enableFake")); |
| | | if (enableFakeConfig == null || !"Y".equals(enableFakeConfig.getValue())) { |
| | | return R.error("当前非仿真运行模式,禁止修改条码"); |
| | | } |
| | |
| | | } |
| | | |
| | | Integer devpNo = finalStation.getDeviceNo(); |
| | | DeviceConfig deviceConfig = deviceConfigService.selectOne(new EntityWrapper<DeviceConfig>() |
| | | DeviceConfig deviceConfig = deviceConfigService.getOne(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_no", devpNo) |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | if (deviceConfig == null || deviceConfig.getFake() == null || deviceConfig.getFake() != 1) { |
| | |
| | | return null; |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<BasDevp>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<BasDevp>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | List<StationObjModel> list = basDevp.getStationList$(); |
| | | for (StationObjModel entity : list) { |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | @RequestMapping(value = "/wrkLastno/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(wrkLastnoService.selectById(String.valueOf(id))); |
| | | return R.ok(wrkLastnoService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkLastno/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<WrkLastno> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<WrkLastno> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(wrkLastnoService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(wrkLastnoService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | wrkLastno.setModiTime(new Date()); |
| | | wrkLastno.setAppeUser(getUserId()); |
| | | wrkLastno.setAppeTime(new Date()); |
| | | wrkLastnoService.insert(wrkLastno); |
| | | wrkLastnoService.save(wrkLastno); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.error(); |
| | | } |
| | | for (WrkLastno entity : list){ |
| | | wrkLastnoService.delete(new EntityWrapper<>(entity)); |
| | | wrkLastnoService.remove(new QueryWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth(memo = "工作序号导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<WrkLastno> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<WrkLastno> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("wrkLastno")); |
| | | convert(map, wrapper); |
| | | List<WrkLastno> list = wrkLastnoService.selectList(wrapper); |
| | | List<WrkLastno> list = wrkLastnoService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkLastnoQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<WrkLastno> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<WrkLastno> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("wrk_mk", condition); |
| | | Page<WrkLastno> page = wrkLastnoService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<WrkLastno> page = wrkLastnoService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (WrkLastno wrkLastno : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/wrkLastno/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<WrkLastno> wrapper = new EntityWrapper<WrkLastno>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != wrkLastnoService.selectOne(wrapper)){ |
| | | QueryWrapper<WrkLastno> wrapper = new QueryWrapper<WrkLastno>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != wrkLastnoService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(WrkLastno.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<WrkMast> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<WrkMast> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | allLike(WrkMast.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){ |
| | | if (orderByField.endsWith("$")){ |
| | | orderByField = orderByField.substring(0, orderByField.length()-1); |
| | | } |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField)); |
| | | }else { |
| | | wrapper.orderBy("io_time", false); |
| | | wrapper.orderBy(true, false, "io_time"); |
| | | } |
| | | return R.ok(wrkMastService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(wrkMastService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | @RequestMapping(value = "/wrkMastLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(wrkMastLogService.selectById(String.valueOf(id))); |
| | | return R.ok(wrkMastLogService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastLog/list/auth") |
| | |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<WrkMastLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<WrkMastLog> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | allLike(WrkMastLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){ |
| | | if (orderByField.endsWith("$")){ |
| | | orderByField = orderByField.substring(0, orderByField.length()-1); |
| | | } |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField)); |
| | | }else { |
| | | wrapper.orderBy("modi_time", false); |
| | | wrapper.orderBy(true, false, "modi_time"); |
| | | } |
| | | return R.ok(wrkMastLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(wrkMastLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | |
| | | @RequestMapping(value = "/wrkMastLog/add/auth") |
| | | @ManagerAuth(memo = "工作历史档添加") |
| | | public R add(WrkMastLog wrkMastLog) { |
| | | wrkMastLogService.insert(wrkMastLog); |
| | | wrkMastLogService.save(wrkMastLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.error(); |
| | | } |
| | | for (WrkMastLog entity : list){ |
| | | wrkMastLogService.delete(new EntityWrapper<>(entity)); |
| | | wrkMastLogService.remove(new QueryWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth(memo = "工作历史档导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<WrkMastLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<WrkMastLog> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("wrkMastLog")); |
| | | convert(map, wrapper); |
| | | List<WrkMastLog> list = wrkMastLogService.selectList(wrapper); |
| | | List<WrkMastLog> list = wrkMastLogService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<WrkMastLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<WrkMastLog> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<WrkMastLog> page = wrkMastLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<WrkMastLog> page = wrkMastLogService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (WrkMastLog wrkMastLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/wrkMastLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<WrkMastLog> wrapper = new EntityWrapper<WrkMastLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != wrkMastLogService.selectOne(wrapper)){ |
| | | QueryWrapper<WrkMastLog> wrapper = new QueryWrapper<WrkMastLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != wrkMastLogService.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(WrkMastLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.core.common.Cools; |
| | | import com.zy.core.model.StationObjModel; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | @TableId(value = "crn_no", type = IdType.INPUT) |
| | | @TableField("crn_no") |
| | | private Integer crnNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | User user = service.getById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | User user = service.getById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | import com.zy.system.entity.User; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | public String getWrkSts$(){ |
| | | BasWrkStatusService service = SpringUtils.getBean(BasWrkStatusService.class); |
| | | BasWrkStatus basWrkStatus = service.selectById(this.wrkSts); |
| | | BasWrkStatus basWrkStatus = service.getById(this.wrkSts); |
| | | if (!Cools.isEmpty(basWrkStatus)){ |
| | | return String.valueOf(basWrkStatus.getWrkDesc()); |
| | | } |
| | |
| | | |
| | | public String getIoType$(){ |
| | | BasWrkIotypeService service = SpringUtils.getBean(BasWrkIotypeService.class); |
| | | BasWrkIotype basWrkIotype = service.selectById(this.ioType); |
| | | BasWrkIotype basWrkIotype = service.getById(this.ioType); |
| | | if (!Cools.isEmpty(basWrkIotype)){ |
| | | return String.valueOf(basWrkIotype.getIoDesc()); |
| | | } |
| | |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | | User user = service.getById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | import com.core.common.Cools; |
| | | import com.zy.core.model.StationObjModel; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | @TableId(value = "crn_no", type = IdType.INPUT) |
| | | @TableField("crn_no") |
| | | private Integer crnNo; |
| | | |
| | | /** |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | User user = service.getById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | User user = service.getById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | public String getWrkSts$(){ |
| | | BasWrkStatusService service = SpringUtils.getBean(BasWrkStatusService.class); |
| | | BasWrkStatus basWrkStatus = service.selectById(this.wrkSts); |
| | | BasWrkStatus basWrkStatus = service.getById(this.wrkSts); |
| | | if (!Cools.isEmpty(basWrkStatus)){ |
| | | return String.valueOf(basWrkStatus.getWrkDesc()); |
| | | } |
| | |
| | | |
| | | public String getIoType$(){ |
| | | BasWrkIotypeService service = SpringUtils.getBean(BasWrkIotypeService.class); |
| | | BasWrkIotype basWrkIotype = service.selectById(this.ioType); |
| | | BasWrkIotype basWrkIotype = service.getById(this.ioType); |
| | | if (!Cools.isEmpty(basWrkIotype)){ |
| | | return String.valueOf(basWrkIotype.getIoDesc()); |
| | | } |
| | |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | | User user = service.getById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.entity.User; |
| | |
| | | */ |
| | | @ApiModelProperty(value= "库位状态代号") |
| | | @TableId(value = "loc_sts", type = IdType.INPUT) |
| | | @TableField("loc_sts") |
| | | private String locSts; |
| | | |
| | | /** |
| | |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | User user = service.getById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | User user = service.getById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | @TableId(value = "rgv_no", type = IdType.INPUT) |
| | | @TableField("rgv_no") |
| | | private Integer rgvNo; |
| | | |
| | | /** |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | User user = service.getById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | User user = service.getById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | import com.zy.system.entity.User; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | public String getWrkSts$(){ |
| | | BasWrkStatusService service = SpringUtils.getBean(BasWrkStatusService.class); |
| | | BasWrkStatus basWrkStatus = service.selectById(this.wrkSts); |
| | | BasWrkStatus basWrkStatus = service.getById(this.wrkSts); |
| | | if (!Cools.isEmpty(basWrkStatus)){ |
| | | return String.valueOf(basWrkStatus.getWrkDesc()); |
| | | } |
| | |
| | | |
| | | public String getIoType$(){ |
| | | BasWrkIotypeService service = SpringUtils.getBean(BasWrkIotypeService.class); |
| | | BasWrkIotype basWrkIotype = service.selectById(this.ioType); |
| | | BasWrkIotype basWrkIotype = service.getById(this.ioType); |
| | | if (!Cools.isEmpty(basWrkIotype)){ |
| | | return String.valueOf(basWrkIotype.getIoDesc()); |
| | | } |
| | |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | | User user = service.getById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | @TableId(value = "station_id", type = IdType.INPUT) |
| | | @TableField("station_id") |
| | | private Integer stationId; |
| | | |
| | | /** |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getId()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.entity.User; |
| | |
| | | */ |
| | | @ApiModelProperty(value= "入出类型代号") |
| | | @TableId(value = "io_type", type = IdType.INPUT) |
| | | @TableField("io_type") |
| | | private Integer ioType; |
| | | |
| | | /** |
| | |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | User user = service.getById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | User user = service.getById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.entity.User; |
| | |
| | | */ |
| | | @ApiModelProperty(value= "代号") |
| | | @TableId(value = "wrk_sts", type = IdType.INPUT) |
| | | @TableField("wrk_sts") |
| | | private Long wrkSts; |
| | | |
| | | /** |
| | |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | User user = service.getById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | User user = service.getById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasLocStsService; |
| | |
| | | */ |
| | | @ApiModelProperty(value= "库位号") |
| | | @TableId(value = "loc_no", type = IdType.INPUT) |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | @ApiModelProperty(value= "库位状态") |
| | |
| | | |
| | | public String getLocSts$(){ |
| | | BasLocStsService service = SpringUtils.getBean(BasLocStsService.class); |
| | | BasLocSts basLocSts = service.selectById(this.locSts); |
| | | BasLocSts basLocSts = service.getById(this.locSts); |
| | | if (!Cools.isEmpty(basLocSts)){ |
| | | return String.valueOf(basLocSts.getLocDesc()); |
| | | } |
| | |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | User user = service.getById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | User user = service.getById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.entity.User; |
| | |
| | | */ |
| | | @ApiModelProperty(value= "类型") |
| | | @TableId(value = "wrk_mk", type = IdType.INPUT) |
| | | @TableField("wrk_mk") |
| | | private Integer wrkMk; |
| | | |
| | | /** |
| | |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | User user = service.getById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | User user = service.getById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.FieldStrategy; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.mapper.BasWrkIotypeMapper; |
| | |
| | | */ |
| | | @ApiModelProperty(value= "工作号") |
| | | @TableId(value = "wrk_no", type = IdType.INPUT) |
| | | @TableField("wrk_no") |
| | | private Integer wrkNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | |
| | | * 堆垛机号 |
| | | */ |
| | | @ApiModelProperty(value= "堆垛机号") |
| | | @TableField(value = "crn_no",strategy = FieldStrategy.IGNORED) |
| | | @TableField(value = "crn_no", insertStrategy = FieldStrategy.ALWAYS, updateStrategy = FieldStrategy.ALWAYS) |
| | | private Integer crnNo; |
| | | |
| | | /** |
| | | * 双工位堆垛机号 |
| | | */ |
| | | @ApiModelProperty(value= "双工位堆垛机号") |
| | | @TableField(value = "dual_crn_no",strategy = FieldStrategy.IGNORED) |
| | | @TableField(value = "dual_crn_no", insertStrategy = FieldStrategy.ALWAYS, updateStrategy = FieldStrategy.ALWAYS) |
| | | private Integer dualCrnNo; |
| | | |
| | | /** |
| | | * RGV号 |
| | | */ |
| | | @ApiModelProperty(value= "RGV号") |
| | | @TableField(value = "rgv_no",strategy = FieldStrategy.IGNORED) |
| | | @TableField(value = "rgv_no", insertStrategy = FieldStrategy.ALWAYS, updateStrategy = FieldStrategy.ALWAYS) |
| | | private Integer rgvNo; |
| | | |
| | | /** |
| | |
| | | |
| | | public String getLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | | LocMast locMast = service.getById(this.locNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | } |
| | |
| | | |
| | | public String getSourceLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.sourceLocNo); |
| | | LocMast locMast = service.getById(this.sourceLocNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | } |
| | |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | User user = service.getById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | User user = service.getById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.mapper.BasWrkIotypeMapper; |
| | |
| | | |
| | | public String getWrkNo$(){ |
| | | WrkMastService service = SpringUtils.getBean(WrkMastService.class); |
| | | WrkMast wrkMast = service.selectById(this.wrkNo); |
| | | WrkMast wrkMast = service.getById(this.wrkNo); |
| | | if (!Cools.isEmpty(wrkMast)){ |
| | | return String.valueOf(wrkMast.getWrkNo()); |
| | | } |
| | |
| | | |
| | | public String getLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | | LocMast locMast = service.getById(this.locNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | } |
| | |
| | | |
| | | public String getSourceLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.sourceLocNo); |
| | | LocMast locMast = service.getById(this.sourceLocNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | } |
| | |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | User user = service.getById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | User user = service.getById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasCrnpErrLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasCrnpErr; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasCrnpOpt; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasDualCrnpErrLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasDualCrnpErr; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasDualCrnp; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasDualCrnpOpt; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.BasLocSts; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasMap; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.BasOutArea; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.BasOutStationArea; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasRgvErrLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasRgvErr; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasRgvOpt; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.BasStationDevice; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.BasStationOpt; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.BasWrkIotype; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.BasWrkStatus; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.DeviceDataLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.WrkLastno; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import org.apache.ibatis.annotations.*; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | |
| | | public interface ApiLogService extends IService<ApiLog> { |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasCrnpErrLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasCrnpErrLogService extends IService<BasCrnpErrLog> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasCrnpErr; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasCrnpErrService extends IService<BasCrnpErr> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasCrnpOpt; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasCrnpOptService extends IService<BasCrnpOpt> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasCrnpService extends IService<BasCrnp> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasDevpService extends IService<BasDevp> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasDualCrnpErrLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasDualCrnpErrLogService extends IService<BasDualCrnpErrLog> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasDualCrnpErr; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasDualCrnpErrService extends IService<BasDualCrnpErr> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasDualCrnpOpt; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasDualCrnpOptService extends IService<BasDualCrnpOpt> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasDualCrnp; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasDualCrnpService extends IService<BasDualCrnp> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.BasLocSts; |
| | | |
| | | public interface BasLocStsService extends IService<BasLocSts> { |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasMapService extends IService<BasMap> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.BasOutArea; |
| | | |
| | | public interface BasOutAreaService extends IService<BasOutArea> { |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.BasOutStationArea; |
| | | |
| | | public interface BasOutStationAreaService extends IService<BasOutStationArea> { |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasRgvErrLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasRgvErrLogService extends IService<BasRgvErrLog> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasRgvErr; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasRgvErrService extends IService<BasRgvErr> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasRgvOpt; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasRgvOptService extends IService<BasRgvOpt> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasRgvService extends IService<BasRgv> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.BasStationDevice; |
| | | |
| | | public interface BasStationDeviceService extends IService<BasStationDevice> { |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasStationOpt; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasStationOptService extends IService<BasStationOpt> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface BasStationService extends IService<BasStation> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.BasWrkIotype; |
| | | |
| | | public interface BasWrkIotypeService extends IService<BasWrkIotype> { |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.BasWrkStatus; |
| | | |
| | | public interface BasWrkStatusService extends IService<BasWrkStatus> { |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface DeviceConfigService extends IService<DeviceConfig> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.DeviceDataLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface DeviceDataLogService extends IService<DeviceDataLog> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface HttpRequestLogService extends IService<HttpRequestLog> { |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.LocMast; |
| | | |
| | | import java.util.List; |
| | |
| | | result.setMessage("通知异常: " + e.getMessage()); |
| | | } finally { |
| | | httpRequestLog.setResult(result.isSuccess() ? 1 : 0); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | httpRequestLogService.save(httpRequestLog); |
| | | } |
| | | |
| | | if (!result.isSuccess() && updateRetryState && key != null) { |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.WrkLastno; |
| | | |
| | | public interface WrkLastnoService extends IService<WrkLastno> { |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | |
| | | public interface WrkMastLogService extends IService<WrkMastLog> { |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | |
| | | import java.util.List; |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.entity.ApiLog; |
| | | import com.zy.asrs.mapper.ApiLogMapper; |
| | |
| | | null, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | if (!this.insert(apiLog)) { |
| | | if (!this.save(apiLog)) { |
| | | log.error("接口调用日志保存失败!"); |
| | | } |
| | | } |
| | |
| | | import com.zy.asrs.mapper.BasCrnpErrLogMapper; |
| | | import com.zy.asrs.entity.BasCrnpErrLog; |
| | | import com.zy.asrs.service.BasCrnpErrLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basCrnpErrLogService") |
| | |
| | | import com.zy.asrs.mapper.BasCrnpErrMapper; |
| | | import com.zy.asrs.entity.BasCrnpErr; |
| | | import com.zy.asrs.service.BasCrnpErrService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basCrnpErrService") |
| | |
| | | import com.zy.asrs.mapper.BasCrnpOptMapper; |
| | | import com.zy.asrs.entity.BasCrnpOpt; |
| | | import com.zy.asrs.service.BasCrnpOptService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basCrnpOptService") |
| | |
| | | import com.zy.asrs.mapper.BasCrnpMapper; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basCrnpService") |
| | |
| | | import com.zy.asrs.mapper.BasDevpMapper; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basDevpService") |
| | |
| | | import com.zy.asrs.mapper.BasDualCrnpErrLogMapper; |
| | | import com.zy.asrs.entity.BasDualCrnpErrLog; |
| | | import com.zy.asrs.service.BasDualCrnpErrLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basDualCrnpErrLogService") |
| | |
| | | import com.zy.asrs.mapper.BasDualCrnpErrMapper; |
| | | import com.zy.asrs.entity.BasDualCrnpErr; |
| | | import com.zy.asrs.service.BasDualCrnpErrService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basDualCrnpErrService") |
| | |
| | | import com.zy.asrs.mapper.BasDualCrnpOptMapper; |
| | | import com.zy.asrs.entity.BasDualCrnpOpt; |
| | | import com.zy.asrs.service.BasDualCrnpOptService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basDualCrnpOptService") |
| | |
| | | import com.zy.asrs.mapper.BasDualCrnpMapper; |
| | | import com.zy.asrs.entity.BasDualCrnp; |
| | | import com.zy.asrs.service.BasDualCrnpService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basDualCrnpService") |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.BasLocSts; |
| | | import com.zy.asrs.mapper.BasLocStsMapper; |
| | | import com.zy.asrs.service.BasLocStsService; |
| | |
| | | import com.zy.asrs.mapper.BasMapMapper; |
| | | import com.zy.asrs.entity.BasMap; |
| | | import com.zy.asrs.service.BasMapService; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | |
| | | @Override |
| | | public List<Integer> getLevList() { |
| | | return this.baseMapper.selectList(new EntityWrapper<>()).stream().map(BasMap::getLev).collect(Collectors.toList()); |
| | | return this.baseMapper.selectList(new QueryWrapper<>()).stream().map(BasMap::getLev).collect(Collectors.toList()); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.BasOutArea; |
| | | import com.zy.asrs.mapper.BasOutAreaMapper; |
| | | import com.zy.asrs.service.BasOutAreaService; |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.BasOutStationArea; |
| | | import com.zy.asrs.mapper.BasOutStationAreaMapper; |
| | | import com.zy.asrs.service.BasOutStationAreaService; |
| | |
| | | import com.zy.asrs.mapper.BasRgvErrLogMapper; |
| | | import com.zy.asrs.entity.BasRgvErrLog; |
| | | import com.zy.asrs.service.BasRgvErrLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basRgvErrLogService") |
| | |
| | | import com.zy.asrs.mapper.BasRgvErrMapper; |
| | | import com.zy.asrs.entity.BasRgvErr; |
| | | import com.zy.asrs.service.BasRgvErrService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basRgvErrService") |
| | |
| | | import com.zy.asrs.mapper.BasRgvOptMapper; |
| | | import com.zy.asrs.entity.BasRgvOpt; |
| | | import com.zy.asrs.service.BasRgvOptService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basRgvOptService") |
| | |
| | | import com.zy.asrs.mapper.BasRgvMapper; |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.zy.asrs.service.BasRgvService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basRgvService") |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.BasStationDevice; |
| | | import com.zy.asrs.mapper.BasStationDeviceMapper; |
| | | import com.zy.asrs.service.BasStationDeviceService; |
| | |
| | | import com.zy.asrs.mapper.BasStationOptMapper; |
| | | import com.zy.asrs.entity.BasStationOpt; |
| | | import com.zy.asrs.service.BasStationOptService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basStationOptService") |
| | |
| | | import com.zy.asrs.mapper.BasStationMapper; |
| | | import com.zy.asrs.entity.BasStation; |
| | | import com.zy.asrs.service.BasStationService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("basStationService") |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.BasWrkIotype; |
| | | import com.zy.asrs.mapper.BasWrkIotypeMapper; |
| | | import com.zy.asrs.service.BasWrkIotypeService; |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.BasWrkStatus; |
| | | import com.zy.asrs.mapper.BasWrkStatusMapper; |
| | | import com.zy.asrs.service.BasWrkStatusService; |
| | |
| | | import com.zy.asrs.mapper.DeviceConfigMapper; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.service.DeviceConfigService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deviceConfigService") |
| | |
| | | import com.zy.asrs.mapper.DeviceDataLogMapper; |
| | | import com.zy.asrs.entity.DeviceDataLog; |
| | | import com.zy.asrs.service.DeviceDataLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deviceDataLogService") |
| | |
| | | import com.zy.asrs.mapper.HttpRequestLogMapper; |
| | | import com.zy.asrs.entity.HttpRequestLog; |
| | | import com.zy.asrs.service.HttpRequestLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("httpRequestLogService") |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.mapper.LocMastMapper; |
| | | import com.zy.asrs.service.LocMastService; |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | |
| | | public JSONObject calculateAndSaveSchedule() { |
| | | ArrayList<HashMap<String, Object>> crnDataList = new ArrayList<>(); |
| | | |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<BasCrnp>().eq("status", 1)); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<BasCrnp>().eq("status", 1)); |
| | | Map<Integer, StationObjModel> stationIndex = new HashMap<>(); |
| | | Map<Integer, String> stationCrnCodeIndex = new HashMap<>(); |
| | | |
| | |
| | | CrnProtocol p = crnThread.getStatus(); |
| | | Integer tNo = p.getTaskNo(); |
| | | if (tNo != null && tNo > 0) { |
| | | WrkMast task = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", tNo)); |
| | | WrkMast task = wrkMastService.getOne(new QueryWrapper<WrkMast>().eq("wrk_no", tNo)); |
| | | if (task != null) { |
| | | // Calculate current X, Y |
| | | double curX = (p.getBay() == null ? 0 : p.getBay()) * bayWidth; |
| | |
| | | } |
| | | |
| | | ArrayList<HashMap<String, Object>> taskDataList = new ArrayList<>(); |
| | | List<WrkMast> outTasks = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.NEW_OUTBOUND.sts)); |
| | | List<WrkMast> outTasks = wrkMastService.list(new QueryWrapper<WrkMast>().eq("wrk_sts", WrkStsType.NEW_OUTBOUND.sts)); |
| | | for (WrkMast wrkMast : outTasks) { |
| | | HashMap<String, Object> t = new HashMap<>(); |
| | | t.put("taskId", wrkMast.getWrkNo()); |
| | |
| | | taskDataList.add(t); |
| | | } |
| | | |
| | | List<WrkMast> moveTasks = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.NEW_LOC_MOVE.sts)); |
| | | List<WrkMast> moveTasks = wrkMastService.list(new QueryWrapper<WrkMast>().eq("wrk_sts", WrkStsType.NEW_LOC_MOVE.sts)); |
| | | for (WrkMast wrkMast : moveTasks) { |
| | | HashMap<String, Object> t = new HashMap<>(); |
| | | t.put("taskId", wrkMast.getWrkNo()); |
| | |
| | | taskDataList.add(t); |
| | | } |
| | | |
| | | List<WrkMast> inTasks = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.INBOUND_DEVICE_RUN.sts)); |
| | | List<WrkMast> inTasks = wrkMastService.list(new QueryWrapper<WrkMast>().eq("wrk_sts", WrkStsType.INBOUND_DEVICE_RUN.sts)); |
| | | for (WrkMast wrkMast : inTasks) { |
| | | HashMap<String, Object> t = new HashMap<>(); |
| | | t.put("taskId", wrkMast.getWrkNo()); |
| | |
| | | result = null; |
| | | } |
| | | } else { |
| | | Config uriCfg = configService.selectOne(new EntityWrapper<Config>().eq("code", "plannerSolverUri")); |
| | | Config pathCfg = configService.selectOne(new EntityWrapper<Config>().eq("code", "plannerSolverPath")); |
| | | Config uriCfg = configService.getOne(new QueryWrapper<Config>().eq("code", "plannerSolverUri")); |
| | | Config pathCfg = configService.getOne(new QueryWrapper<Config>().eq("code", "plannerSolverPath")); |
| | | if (uriCfg == null || pathCfg == null || uriCfg.getValue() == null || pathCfg.getValue() == null) { |
| | | // 如果是服务调用,这里无法直接返回R.error,返回null或者empty json |
| | | return null; |
| | |
| | | |
| | | private Double getDoubleConfig(String code, Double def) { |
| | | try { |
| | | Config c = configService.selectOne(new EntityWrapper<Config>().eq("code", code)); |
| | | Config c = configService.getOne(new QueryWrapper<Config>().eq("code", code)); |
| | | if (c != null && c.getValue() != null && c.getValue().trim().length() > 0) { |
| | | return Double.parseDouble(c.getValue().trim()); |
| | | } |
| | |
| | | |
| | | private Integer getIntConfig(String code, Integer def) { |
| | | try { |
| | | Config c = configService.selectOne(new EntityWrapper<Config>().eq("code", code)); |
| | | Config c = configService.getOne(new QueryWrapper<Config>().eq("code", code)); |
| | | if (c != null && c.getValue() != null && c.getValue().trim().length() > 0) { |
| | | String v = c.getValue().trim(); |
| | | if (v.endsWith("%")) v = v.substring(0, v.length() - 1); |
| | |
| | | |
| | | private Boolean getBoolConfig(String code, Boolean def) { |
| | | try { |
| | | Config c = configService.selectOne(new EntityWrapper<Config>().eq("code", code)); |
| | | Config c = configService.getOne(new QueryWrapper<Config>().eq("code", code)); |
| | | if (c != null && c.getValue() != null) { |
| | | String v = c.getValue().trim().toUpperCase(); |
| | | if ("Y".equals(v) || "TRUE".equals(v)) return true; |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.asrs.domain.vo.StationCycleCapacityVo; |
| | | import com.zy.asrs.domain.vo.StationCycleLoopVo; |
| | | import com.zy.asrs.entity.BasDevp; |
| | |
| | | } |
| | | |
| | | private void appendExcludeStationsFromDeviceConfig(Set<Integer> excludeStationSet) { |
| | | List<BasDevp> basDevpList = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevpList = basDevpService.list(new QueryWrapper<>()); |
| | | if (basDevpList == null || basDevpList.isEmpty()) { |
| | | return; |
| | | } |
| | |
| | | |
| | | private Map<Integer, Integer> buildStationWorkNoMap() { |
| | | Map<Integer, Integer> workNoMap = new HashMap<>(); |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | if (devpList == null || devpList.isEmpty()) { |
| | | return workNoMap; |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.WrkLastno; |
| | | import com.zy.asrs.mapper.WrkLastnoMapper; |
| | | import com.zy.asrs.service.WrkLastnoService; |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | import com.zy.asrs.mapper.WrkMastLogMapper; |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.mapper.WrkMastMapper; |
| | | import com.zy.asrs.service.WrkMastService; |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.asrs.domain.NotifyDto; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.service.DeviceConfigService; |
| | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public synchronized void notifyShuttle() { |
| | | List<DeviceConfig> deviceList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> deviceList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn))); |
| | | for (DeviceConfig device : deviceList) { |
| | | notifyMsg(String.valueOf(SlaveType.Crn), device.getDeviceNo()); |
| | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public synchronized void notifyForkLift() { |
| | | List<DeviceConfig> deviceList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> deviceList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | | for (DeviceConfig device : deviceList) { |
| | | notifyMsg(String.valueOf(SlaveType.Rgv), device.getDeviceNo()); |
| | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | public synchronized void notifyStation() { |
| | | List<DeviceConfig> deviceList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> deviceList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig device : deviceList) { |
| | | notifyMsg(String.valueOf(SlaveType.Devp), device.getDeviceNo()); |
| | |
| | | } |
| | | |
| | | private synchronized void notifyMsg(String notifyType, Integer device) { |
| | | Config notifyEnableConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyEnable")); |
| | | Config notifyEnableConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "notifyEnable")); |
| | | if (notifyEnableConfig == null) { |
| | | return; |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | Config notifyUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyUri")); |
| | | Config notifyUriConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "notifyUri")); |
| | | if (notifyUriConfig == null) { |
| | | return; |
| | | } |
| | | String notifyUri = notifyUriConfig.getValue(); |
| | | |
| | | Config notifyUriPathConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyUriPath")); |
| | | Config notifyUriPathConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "notifyUriPath")); |
| | | if (notifyUriPathConfig == null) { |
| | | return; |
| | | } |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.asrs.service.PlannerService; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | |
| | | public void schedulePlanner() { |
| | | try { |
| | | String crnRunMethod = "normal"; |
| | | Config crnRunMethodConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "crnRunMethod")); |
| | | Config crnRunMethodConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "crnRunMethod")); |
| | | if(crnRunMethodConfig != null) { |
| | | crnRunMethod = crnRunMethodConfig.getValue(); |
| | | } |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | @Transactional |
| | | public void executeIn(){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.COMPLETE_INBOUND.sts)); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>().eq("wrk_sts", WrkStsType.COMPLETE_INBOUND.sts)); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | |
| | | log.info("保存工作历史档[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | // 删除工作主档 |
| | | if (!wrkMastService.deleteById(wrkMast)) { |
| | | if (!wrkMastService.removeById(wrkMast.getWrkNo())) { |
| | | log.info("删除工作主档[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | |
| | |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | @Transactional |
| | | public void executeOut(){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.COMPLETE_OUTBOUND.sts)); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>().eq("wrk_sts", WrkStsType.COMPLETE_OUTBOUND.sts)); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | |
| | | log.info("保存工作历史档[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | // 删除工作主档 |
| | | if (!wrkMastService.deleteById(wrkMast)) { |
| | | if (!wrkMastService.removeById(wrkMast.getWrkNo())) { |
| | | log.info("删除工作主档[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | |
| | |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | @Transactional |
| | | public void executeLocMove(){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.COMPLETE_LOC_MOVE.sts)); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>().eq("wrk_sts", WrkStsType.COMPLETE_LOC_MOVE.sts)); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | |
| | | log.info("保存工作历史档[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | // 删除工作主档 |
| | | if (!wrkMastService.deleteById(wrkMast)) { |
| | | if (!wrkMastService.removeById(wrkMast.getWrkNo())) { |
| | | log.info("删除工作主档[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | |
| | |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | @Transactional |
| | | public void executeCancelTask(){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("mk", "taskCancel")); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>().eq("mk", "taskCancel")); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | |
| | | log.info("保存工作历史档[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | // 删除工作主档 |
| | | if (!wrkMastService.deleteById(wrkMast)) { |
| | | if (!wrkMastService.removeById(wrkMast.getWrkNo())) { |
| | | log.info("删除工作主档[workNo={}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | |
| | |
| | | @Scheduled(cron = "0/1 * * * * ? ") |
| | | @Transactional |
| | | public void processOutStationRun(){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.STATION_RUN.sts)); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>().eq("wrk_sts", WrkStsType.STATION_RUN.sts)); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.domain.NotifyDto; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | |
| | | |
| | | private boolean append(String notifyType, Integer device, String taskNo, String superTaskNo, NotifyMsgType msgType, String data) { |
| | | boolean notifyEnable = true; |
| | | Config notifyEnableConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyEnable")); |
| | | Config notifyEnableConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "notifyEnable")); |
| | | if (notifyEnableConfig != null) { |
| | | notifyEnable = notifyEnableConfig.getValue().equals("Y"); |
| | | } |
| | |
| | | dto.setSuperTaskNo(superTaskNo); |
| | | |
| | | //重试次数 |
| | | Config notifyFailTimesConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyFailTimes")); |
| | | Config notifyFailTimesConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "notifyFailTimes")); |
| | | if (notifyFailTimesConfig != null) { |
| | | dto.setFailTimes(Integer.parseInt(notifyFailTimesConfig.getValue())); |
| | | } |
| | | |
| | | //重试间隔 |
| | | Config notifyRetryTimeConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "notifyRetryTime")); |
| | | Config notifyRetryTimeConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "notifyRetryTime")); |
| | | if (notifyRetryTimeConfig != null) { |
| | | dto.setRetryTime(Integer.parseInt(notifyRetryTimeConfig.getValue())); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | |
| | | BasCrnpService basCrnpService = SpringUtils.getBean(BasCrnpService.class); |
| | | BasStationDeviceService basStationDeviceService = SpringUtils.getBean(BasStationDeviceService.class); |
| | | |
| | | List<BasStationDevice> stationDevices = basStationDeviceService.selectList(new EntityWrapper<BasStationDevice>().eq("station_id", stationId)); |
| | | List<BasStationDevice> stationDevices = basStationDeviceService.list(new QueryWrapper<BasStationDevice>().eq("station_id", stationId)); |
| | | boolean hasConfig = !stationDevices.isEmpty(); |
| | | List<Integer> allowedCrnNos = new ArrayList<>(); |
| | | if (hasConfig) { |
| | |
| | | currentCircleTaskCrnNo = Integer.parseInt(String.valueOf(object)); |
| | | } |
| | | |
| | | Wrapper<BasCrnp> wrapper = new EntityWrapper<BasCrnp>() |
| | | QueryWrapper<BasCrnp> wrapper = new QueryWrapper<BasCrnp>() |
| | | .eq("in_enable", "Y") |
| | | .eq("status", 1); |
| | | |
| | | if (currentCircleTaskCrnNo != null) { |
| | | currentCircleTaskCrnNo = currentCircleTaskCrnNo + 1; |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>() |
| | | BasCrnp basCrnp = basCrnpService.getOne(new QueryWrapper<BasCrnp>() |
| | | .eq("crn_no", currentCircleTaskCrnNo) |
| | | .eq("in_enable", "Y") |
| | | .eq("status", 1) |
| | | ); |
| | | List<WrkMast> currentCrnTask = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> currentCrnTask = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("crn_no", currentCircleTaskCrnNo) |
| | | ); |
| | | if (currentCrnTask.size() <= 1) { |
| | |
| | | } |
| | | |
| | | HashMap<Integer, Integer> map = new HashMap<>(); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(wrapper); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(wrapper); |
| | | |
| | | List<BasCrnp> baseList = new ArrayList<>(); |
| | | List<BasCrnp> extraList = new ArrayList<>(); |
| | |
| | | continue; |
| | | } |
| | | |
| | | List<WrkMast> inWrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> inWrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("crn_no", basCrnp.getCrnNo()) |
| | | .eq("io_type", WrkIoType.IN.id) |
| | | ); |
| | |
| | | BasDualCrnpService basDualCrnpService = SpringUtils.getBean(BasDualCrnpService.class); |
| | | BasStationDeviceService basStationDeviceService = SpringUtils.getBean(BasStationDeviceService.class); |
| | | |
| | | List<BasStationDevice> stationDevices = basStationDeviceService.selectList(new EntityWrapper<BasStationDevice>().eq("station_id", stationId)); |
| | | List<BasStationDevice> stationDevices = basStationDeviceService.list(new QueryWrapper<BasStationDevice>().eq("station_id", stationId)); |
| | | boolean hasConfig = !stationDevices.isEmpty(); |
| | | List<Integer> allowedCrnNos = new ArrayList<>(); |
| | | if (hasConfig) { |
| | |
| | | } |
| | | } |
| | | |
| | | Wrapper<BasDualCrnp> wrapper = new EntityWrapper<BasDualCrnp>() |
| | | QueryWrapper<BasDualCrnp> wrapper = new QueryWrapper<BasDualCrnp>() |
| | | .eq("in_enable", "Y") |
| | | .eq("status", 1); |
| | | |
| | | HashMap<Integer, Integer> map = new HashMap<>(); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<>()); |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.selectList(wrapper); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<>()); |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.list(wrapper); |
| | | |
| | | List<BasDualCrnp> baseList = new ArrayList<>(); |
| | | List<BasDualCrnp> extraList = new ArrayList<>(); |
| | |
| | | continue; |
| | | } |
| | | |
| | | List<WrkMast> inWrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> inWrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("dual_crn_no", basDualCrnp.getCrnNo()) |
| | | .eq("io_type", WrkIoType.IN.id) |
| | | ); |
| | |
| | | return rowList; |
| | | } |
| | | |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<BasCrnp>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<BasCrnp>()); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | String deepRowsStr = basCrnp.getDeepRows(); |
| | | if(!Cools.isEmpty(deepRowsStr)){ |
| | |
| | | } |
| | | } |
| | | |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.selectList(new EntityWrapper<BasDualCrnp>()); |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.list(new QueryWrapper<BasDualCrnp>()); |
| | | for (BasDualCrnp basDualCrnp : basDualCrnps) { |
| | | String deepRowsStr = basDualCrnp.getDeepRows(); |
| | | if(!Cools.isEmpty(deepRowsStr)){ |
| | |
| | | } |
| | | |
| | | List<Integer> controlRowList = null; |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>()); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | List<List<Integer>> rowList = basCrnp.getControlRows$(); |
| | | for (List<Integer> rows : rowList) { |
| | |
| | | } |
| | | |
| | | List<Integer> controlRowList = null; |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.list(new QueryWrapper<>()); |
| | | for (BasDualCrnp basDualCrnp : basDualCrnps) { |
| | | List<List<Integer>> rowList = basDualCrnp.getControlRows$(); |
| | | for (List<Integer> rows : rowList) { |
| | |
| | | |
| | | List<Integer> controlRowList = null; |
| | | List<Integer> deepRowList = null; |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>()); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | List<List<Integer>> rowList = basCrnp.getControlRows$(); |
| | | for (List<Integer> rows : rowList) { |
| | |
| | | |
| | | List<Integer> controlRowList = null; |
| | | List<Integer> deepRowList = null; |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.list(new QueryWrapper<>()); |
| | | for (BasDualCrnp basDualCrnp : basDualCrnps) { |
| | | List<List<Integer>> rowList = basDualCrnp.getControlRows$(); |
| | | for (List<Integer> rows : rowList) { |
| | |
| | | return null; |
| | | } |
| | | |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>()); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | List<List<Integer>> controlRows = basCrnp.getControlRows$(); |
| | | for (List<Integer> list : controlRows) { |
| | |
| | | } |
| | | } |
| | | |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.list(new QueryWrapper<>()); |
| | | for (BasDualCrnp basDualCrnp : basDualCrnps) { |
| | | List<List<Integer>> controlRows = basDualCrnp.getControlRows$(); |
| | | for (List<Integer> list : controlRows) { |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import jakarta.websocket.*; |
| | | import jakarta.websocket.server.ServerEndpoint; |
| | | import java.io.IOException; |
| | | import java.util.concurrent.CopyOnWriteArraySet; |
| | | |
| | |
| | | package com.zy.common.config; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | import org.springframework.lang.Nullable; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.method.HandlerMethod; |
| | | import org.springframework.web.servlet.HandlerInterceptor; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-06-13 |
| | | */ |
| | | @Component |
| | | public class AdminInterceptor extends HandlerInterceptorAdapter { |
| | | public class AdminInterceptor implements HandlerInterceptor { |
| | | |
| | | @Value("${super.pwd}") |
| | | private String superPwd; |
| | |
| | | // if (obj instanceof OperateLog) { |
| | | // OperateLog operate = (OperateLog) obj; |
| | | // operate.setResponse(String.valueOf(response.getStatus())); |
| | | // operateLogService.insert(operate); |
| | | // operateLogService.save(operate); |
| | | // } |
| | | } |
| | | |
| | | private boolean check(HttpServletRequest request, HttpServletResponse response, String memo) { |
| | | try { |
| | | String token = request.getHeader("token"); |
| | | UserLogin userLogin = userLoginService.selectOne(new EntityWrapper<UserLogin>().eq("token", token).eq("system_type", "WCS")); |
| | | UserLogin userLogin = userLoginService.getOne(new QueryWrapper<UserLogin>().eq("token", token).eq("system_type", "WCS")); |
| | | if (null == userLogin){ |
| | | Http.response(response, BaseRes.DENIED); |
| | | return false; |
| | | } |
| | | User user = userService.selectById(userLogin.getUserId()); |
| | | User user = userService.getById(userLogin.getUserId()); |
| | | String deToken = Cools.deTokn(token, user.getPassword()); |
| | | long timestamp = Long.parseLong(deToken.substring(0, 13)); |
| | | // 1天后过期 |
| | |
| | | operateLog.setUserId(user.getId()); |
| | | operateLog.setRequest(JSON.toJSONString(request.getParameterMap())); |
| | | operateLog.setResponse(JSON.toJSONString(request.getRequestURI())); |
| | | operateLogService.insert(operateLog); |
| | | operateLogService.save(operateLog); |
| | | // 请求缓存 |
| | | request.setAttribute("userId", user.getId()); |
| | | // request.setAttribute("operateLog", operateLog); |
| | |
| | | Permission permission = new Permission(); |
| | | permission.setAction(action); |
| | | permission.setStatus((short) 1); |
| | | Permission one = permissionService.selectOne(new EntityWrapper<>(permission)); |
| | | Permission one = permissionService.getOne(new QueryWrapper<>(permission)); |
| | | if (!Cools.isEmpty(one)) { |
| | | RolePermission rolePermission = rolePermissionService.selectOne(new EntityWrapper<>(new RolePermission(user.getRoleId(), permission.getId()))); |
| | | RolePermission rolePermission = rolePermissionService.getOne(new QueryWrapper<>(new RolePermission(user.getRoleId(), permission.getId()))); |
| | | return !Cools.isEmpty(rolePermission); |
| | | } |
| | | return true; |
| | |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | response.setHeader("Access-Control-Allow-Methods", "*"); |
| | | response.setHeader("Access-Control-Allow-Headers", "Content-Type,Access-Token"); |
| | | response.setHeader("Access-Control-Allow-Headers", "Content-Type,Access-Token,token,X-Lang,Accept-Language"); |
| | | response.setHeader("Access-Control-Expose-Headers", "*"); |
| | | |
| | | } |
| | |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | |
| | | } |
| | | |
| | | private void saveLog(ProceedingJoinPoint joinPoint, HttpServletRequest request, Object result, String memo) { |
| | | apiLogService.insert(new ApiLog( |
| | | apiLogService.save(new ApiLog( |
| | | null, |
| | | memo, |
| | | request != null ? Optional.ofNullable(String.valueOf(request.getRequestURI())).orElse(null) : null, |
| | |
| | | |
| | | private void saveErrLog(ProceedingJoinPoint joinPoint, HttpServletRequest request, Object response, Throwable ex, |
| | | String memo) { |
| | | apiLogService.insert(new ApiLog( |
| | | apiLogService.save(new ApiLog( |
| | | null, |
| | | memo, |
| | | request != null ? Optional.ofNullable(String.valueOf(request.getRequestURI())).orElse(null) : null, |
| | |
| | | |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.common.i18n.I18nMessageService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.HttpRequestMethodNotSupportedException; |
| | | import org.springframework.web.bind.annotation.ExceptionHandler; |
| | | import org.springframework.web.bind.annotation.RestControllerAdvice; |
| | |
| | | @RestControllerAdvice |
| | | public class CoolExceptionHandler { |
| | | |
| | | @Autowired |
| | | private I18nMessageService i18nMessageService; |
| | | |
| | | @ExceptionHandler(Exception.class) |
| | | public R handlerException(HandlerMethod handler, Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(); |
| | | return R.error(i18nMessageService.getMessage("response.common.systemError")); |
| | | } |
| | | |
| | | @ExceptionHandler(HttpRequestMethodNotSupportedException.class) |
| | | public R handleHttpRequestMethodNotSupportedException(HttpRequestMethodNotSupportedException e) { |
| | | return R.error(); |
| | | return R.error(i18nMessageService.getMessage("response.common.methodNotAllowed")); |
| | | } |
| | | |
| | | @ExceptionHandler(CoolException.class) |
| | |
| | | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
| | | import com.fasterxml.jackson.annotation.PropertyAccessor; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; |
| | | import org.springframework.cache.annotation.CachingConfigurerSupport; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | |
| | | // 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public |
| | | om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
| | | // 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常 |
| | | om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); |
| | | om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL); |
| | | jacksonSerializer.setObjectMapper(om); |
| | | |
| | | // 值采用json序列化 |
| | |
| | | package com.zy.common.config; |
| | | |
| | | import com.zy.common.i18n.RequestLocaleInterceptor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | |
| | | public class WebConfig implements WebMvcConfigurer { |
| | | |
| | | @Autowired |
| | | private RequestLocaleInterceptor requestLocaleInterceptor; |
| | | |
| | | @Autowired |
| | | private AdminInterceptor adminInterceptor; |
| | | |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(requestLocaleInterceptor) |
| | | .addPathPatterns("/**"); |
| | | registry.addInterceptor(adminInterceptor) |
| | | .addPathPatterns("/**") |
| | | ; |
| | |
| | | package com.zy.common.entity; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.entity.Config; |
| | |
| | | */ |
| | | public static Parameter reset() { |
| | | ConfigService configService = SpringUtils.getBean(ConfigService.class); |
| | | List<Config> configs = configService.selectList(new EntityWrapper<Config>().eq("status", "1")); |
| | | List<Config> configs = configService.list(new QueryWrapper<Config>().eq("status", "1")); |
| | | Map<String, Object> data = new HashMap<>(); |
| | | for (Config config : configs) { |
| | | if (config.getType() == 1) { |
| New file |
| | |
| | | package com.zy.common.i18n; |
| | | |
| | | import com.core.common.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("/i18n") |
| | | public class I18nController { |
| | | |
| | | @Autowired |
| | | private I18nMessageService i18nMessageService; |
| | | |
| | | @RequestMapping("/messages") |
| | | public R messages(@RequestParam(required = false) String lang) { |
| | | Locale locale = i18nMessageService.resolveLocale(lang); |
| | | Map<String, Object> result = new LinkedHashMap<>(); |
| | | result.put("locale", I18nLocaleUtils.toTag(locale)); |
| | | result.put("defaultLocale", i18nMessageService.getDefaultLocaleTag()); |
| | | result.put("supportedLocales", localeOptions(locale)); |
| | | result.put("messages", i18nMessageService.getMessages(locale)); |
| | | result.put("legacy", i18nMessageService.getLegacyMessages(locale)); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | private List<Map<String, String>> localeOptions(Locale locale) { |
| | | List<Map<String, String>> options = new ArrayList<>(); |
| | | for (String supportedLocale : i18nMessageService.getSupportedLocaleTags()) { |
| | | LinkedHashMap<String, String> option = new LinkedHashMap<>(); |
| | | option.put("tag", supportedLocale); |
| | | option.put("label", i18nMessageService.getMessage("lang." + supportedLocale, locale)); |
| | | options.add(option); |
| | | } |
| | | return options; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.common.i18n; |
| | | |
| | | import com.core.common.Cools; |
| | | |
| | | import java.util.*; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | public class I18nLocaleUtils { |
| | | |
| | | private static final Set<String> UPPERCASE_WORDS = new HashSet<>( |
| | | Arrays.asList("ai", "api", "wcs", "wms", "llm", "rgv", "crn", "plc", "http", "mcp", "erp", "io") |
| | | ); |
| | | |
| | | private static final Pattern WORD_BOUNDARY = Pattern.compile("([a-z0-9])([A-Z])"); |
| | | |
| | | private I18nLocaleUtils() { |
| | | } |
| | | |
| | | public static Locale defaultLocale(I18nProperties properties) { |
| | | return toLocale(properties.getDefaultLocale()); |
| | | } |
| | | |
| | | public static Locale toLocale(String value) { |
| | | if (Cools.isEmpty(value)) { |
| | | return Locale.SIMPLIFIED_CHINESE; |
| | | } |
| | | String normalized = value.replace('_', '-').trim(); |
| | | return Locale.forLanguageTag(normalized); |
| | | } |
| | | |
| | | public static String toTag(Locale locale) { |
| | | if (locale == null) { |
| | | return "zh-CN"; |
| | | } |
| | | String tag = locale.toLanguageTag(); |
| | | return Cools.isEmpty(tag) || "und".equalsIgnoreCase(tag) ? "zh-CN" : tag; |
| | | } |
| | | |
| | | public static Locale resolveLocale(String requested, I18nProperties properties) { |
| | | Locale fallback = defaultLocale(properties); |
| | | if (Cools.isEmpty(requested)) { |
| | | return fallback; |
| | | } |
| | | String requestedTag = requested.replace('_', '-').trim(); |
| | | if (requestedTag.contains(",")) { |
| | | requestedTag = requestedTag.substring(0, requestedTag.indexOf(',')).trim(); |
| | | } |
| | | if (requestedTag.contains(";")) { |
| | | requestedTag = requestedTag.substring(0, requestedTag.indexOf(';')).trim(); |
| | | } |
| | | for (String supported : properties.getSupportedLocales()) { |
| | | String supportedTag = supported.replace('_', '-').trim(); |
| | | if (supportedTag.equalsIgnoreCase(requestedTag)) { |
| | | return toLocale(supportedTag); |
| | | } |
| | | Locale supportedLocale = toLocale(supportedTag); |
| | | if (supportedLocale.getLanguage().equalsIgnoreCase(toLocale(requestedTag).getLanguage())) { |
| | | return supportedLocale; |
| | | } |
| | | } |
| | | return fallback; |
| | | } |
| | | |
| | | public static boolean isDefaultLocale(Locale locale, I18nProperties properties) { |
| | | return toTag(defaultLocale(properties)).equalsIgnoreCase(toTag(locale)); |
| | | } |
| | | |
| | | public static String humanizeCode(String code) { |
| | | if (Cools.isEmpty(code)) { |
| | | return null; |
| | | } |
| | | String normalized = code; |
| | | int hashIndex = normalized.indexOf('#'); |
| | | if (hashIndex > -1 && hashIndex < normalized.length() - 1) { |
| | | normalized = normalized.substring(hashIndex + 1); |
| | | } else { |
| | | int slashIndex = normalized.lastIndexOf('/'); |
| | | if (slashIndex > -1 && slashIndex < normalized.length() - 1) { |
| | | normalized = normalized.substring(slashIndex + 1); |
| | | } |
| | | if (normalized.endsWith(".html")) { |
| | | normalized = normalized.substring(0, normalized.length() - 5); |
| | | } |
| | | } |
| | | normalized = normalized.replaceAll("[^A-Za-z0-9_\\-]+", " "); |
| | | Matcher matcher = WORD_BOUNDARY.matcher(normalized); |
| | | normalized = matcher.replaceAll("$1 $2"); |
| | | normalized = normalized.replace('_', ' ').replace('-', ' '); |
| | | String[] parts = normalized.trim().split("\\s+"); |
| | | if (parts.length == 0) { |
| | | return code; |
| | | } |
| | | StringBuilder builder = new StringBuilder(); |
| | | for (String part : parts) { |
| | | if (Cools.isEmpty(part)) { |
| | | continue; |
| | | } |
| | | if (builder.length() > 0) { |
| | | builder.append(' '); |
| | | } |
| | | String lower = part.toLowerCase(Locale.ENGLISH); |
| | | if (UPPERCASE_WORDS.contains(lower)) { |
| | | builder.append(lower.toUpperCase(Locale.ENGLISH)); |
| | | } else { |
| | | builder.append(Character.toUpperCase(part.charAt(0))); |
| | | if (part.length() > 1) { |
| | | builder.append(part.substring(1)); |
| | | } |
| | | } |
| | | } |
| | | return builder.length() == 0 ? code : builder.toString(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.common.i18n; |
| | | |
| | | import com.core.common.Cools; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.context.i18n.LocaleContextHolder; |
| | | |
| | | import java.io.File; |
| | | import java.io.BufferedReader; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.MessageFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.regex.PatternSyntaxException; |
| | | |
| | | @Service |
| | | public class I18nMessageService { |
| | | |
| | | private static final String MESSAGE_BUNDLE = "messages"; |
| | | private static final String LEGACY_BUNDLE = "legacy"; |
| | | |
| | | private final Map<String, CacheEntry> cache = new ConcurrentHashMap<>(); |
| | | |
| | | @Autowired |
| | | private I18nProperties properties; |
| | | |
| | | public Locale getCurrentLocale() { |
| | | Locale locale = LocaleContextHolder.getLocale(); |
| | | return locale == null ? I18nLocaleUtils.defaultLocale(properties) : locale; |
| | | } |
| | | |
| | | public Locale resolveLocale(String requested) { |
| | | return I18nLocaleUtils.resolveLocale(requested, properties); |
| | | } |
| | | |
| | | public String getDefaultLocaleTag() { |
| | | return properties.getDefaultLocale(); |
| | | } |
| | | |
| | | public List<String> getSupportedLocaleTags() { |
| | | return properties.getSupportedLocales(); |
| | | } |
| | | |
| | | public String getMessage(String key, Object... args) { |
| | | return getMessage(key, getCurrentLocale(), args); |
| | | } |
| | | |
| | | public String getMessage(String key, Locale locale, Object... args) { |
| | | if (Cools.isEmpty(key)) { |
| | | return ""; |
| | | } |
| | | Locale resolvedLocale = locale == null ? I18nLocaleUtils.defaultLocale(properties) : locale; |
| | | String value = mergedBundle(resolvedLocale, MESSAGE_BUNDLE).get(key); |
| | | if (value == null && !I18nLocaleUtils.isDefaultLocale(resolvedLocale, properties)) { |
| | | value = mergedBundle(I18nLocaleUtils.defaultLocale(properties), MESSAGE_BUNDLE).get(key); |
| | | } |
| | | if (value == null) { |
| | | return key; |
| | | } |
| | | return args == null || args.length == 0 ? value : MessageFormat.format(value, args); |
| | | } |
| | | |
| | | public boolean hasMessage(String key, Locale locale) { |
| | | return mergedBundle(locale == null ? I18nLocaleUtils.defaultLocale(properties) : locale, MESSAGE_BUNDLE).containsKey(key); |
| | | } |
| | | |
| | | public Map<String, String> getMessages(Locale locale) { |
| | | return new LinkedHashMap<>(mergedBundle(locale, MESSAGE_BUNDLE)); |
| | | } |
| | | |
| | | public Map<String, String> getLegacyMessages(Locale locale) { |
| | | return new LinkedHashMap<>(mergedBundle(locale, LEGACY_BUNDLE)); |
| | | } |
| | | |
| | | public String translateLegacy(String text) { |
| | | return translateLegacy(text, getCurrentLocale()); |
| | | } |
| | | |
| | | public String translateLegacy(String text, Locale locale) { |
| | | if (Cools.isEmpty(text)) { |
| | | return text; |
| | | } |
| | | Locale resolvedLocale = locale == null ? I18nLocaleUtils.defaultLocale(properties) : locale; |
| | | if (I18nLocaleUtils.isDefaultLocale(resolvedLocale, properties)) { |
| | | return text; |
| | | } |
| | | Map<String, String> bundle = mergedBundle(resolvedLocale, LEGACY_BUNDLE); |
| | | String direct = directTranslate(text, bundle); |
| | | if (!text.equals(direct)) { |
| | | return direct; |
| | | } |
| | | String regex = regexTranslate(text, bundle); |
| | | if (!text.equals(regex)) { |
| | | return regex; |
| | | } |
| | | return fragmentTranslate(text, bundle); |
| | | } |
| | | |
| | | public String resolveResourceText(String fallbackName, String code, Long id) { |
| | | Locale locale = getCurrentLocale(); |
| | | String key = resourceKey(code, id); |
| | | if (hasMessage(key, locale)) { |
| | | return getMessage(key, locale); |
| | | } |
| | | if (!I18nLocaleUtils.isDefaultLocale(locale, properties)) { |
| | | String humanized = I18nLocaleUtils.humanizeCode(code); |
| | | if (!Cools.isEmpty(humanized)) { |
| | | return humanized; |
| | | } |
| | | } |
| | | return fallbackName; |
| | | } |
| | | |
| | | public String resolvePermissionText(String fallbackName, String action, Long id) { |
| | | Locale locale = getCurrentLocale(); |
| | | String key = permissionKey(action, id); |
| | | if (hasMessage(key, locale)) { |
| | | return getMessage(key, locale); |
| | | } |
| | | if (!I18nLocaleUtils.isDefaultLocale(locale, properties)) { |
| | | String humanized = I18nLocaleUtils.humanizeCode(action); |
| | | if (!Cools.isEmpty(humanized)) { |
| | | return humanized; |
| | | } |
| | | } |
| | | return fallbackName; |
| | | } |
| | | |
| | | public String resourceKey(String code, Long id) { |
| | | return "resource." + normalizeKey(code, id, "resource"); |
| | | } |
| | | |
| | | public String permissionKey(String action, Long id) { |
| | | return "permission." + normalizeKey(action, id, "permission"); |
| | | } |
| | | |
| | | private Map<String, String> mergedBundle(Locale locale, String bundleName) { |
| | | Locale resolvedLocale = locale == null ? I18nLocaleUtils.defaultLocale(properties) : locale; |
| | | LinkedHashMap<String, String> merged = new LinkedHashMap<>(); |
| | | Locale defaultLocale = I18nLocaleUtils.defaultLocale(properties); |
| | | merged.putAll(loadBundle(defaultLocale, bundleName)); |
| | | if (!I18nLocaleUtils.toTag(defaultLocale).equalsIgnoreCase(I18nLocaleUtils.toTag(resolvedLocale))) { |
| | | merged.putAll(loadBundle(resolvedLocale, bundleName)); |
| | | } |
| | | return merged; |
| | | } |
| | | |
| | | private Map<String, String> loadBundle(Locale locale, String bundleName) { |
| | | String localeTag = I18nLocaleUtils.toTag(locale); |
| | | String cacheKey = localeTag + ":" + bundleName; |
| | | CacheEntry cacheEntry = cache.get(cacheKey); |
| | | File externalFile = externalBundle(localeTag, bundleName); |
| | | long refreshMillis = Math.max(1, properties.getRefreshSeconds()) * 1000L; |
| | | long externalLastModified = externalFile.exists() ? externalFile.lastModified() : -1L; |
| | | if (cacheEntry != null |
| | | && (System.currentTimeMillis() - cacheEntry.loadedAt) < refreshMillis |
| | | && cacheEntry.externalLastModified == externalLastModified) { |
| | | return cacheEntry.values; |
| | | } |
| | | synchronized (cache.computeIfAbsent(cacheKey, key -> new CacheEntry())) { |
| | | CacheEntry latest = cache.get(cacheKey); |
| | | if (latest != null |
| | | && (System.currentTimeMillis() - latest.loadedAt) < refreshMillis |
| | | && latest.externalLastModified == externalLastModified) { |
| | | return latest.values; |
| | | } |
| | | LinkedHashMap<String, String> values = new LinkedHashMap<>(); |
| | | readClasspathBundle(values, localeTag, bundleName); |
| | | readExternalBundle(values, externalFile); |
| | | CacheEntry updated = new CacheEntry(); |
| | | updated.values = values; |
| | | updated.loadedAt = System.currentTimeMillis(); |
| | | updated.externalLastModified = externalLastModified; |
| | | cache.put(cacheKey, updated); |
| | | return updated.values; |
| | | } |
| | | } |
| | | |
| | | private void readClasspathBundle(Map<String, String> values, String localeTag, String bundleName) { |
| | | ClassPathResource resource = new ClassPathResource("i18n/" + localeTag + "/" + bundleName + ".properties"); |
| | | if (!resource.exists()) { |
| | | return; |
| | | } |
| | | try (InputStream inputStream = resource.getInputStream()) { |
| | | loadProperties(values, inputStream); |
| | | } catch (IOException ex) { |
| | | throw new IllegalStateException("Failed to load classpath i18n bundle: " + resource.getPath(), ex); |
| | | } |
| | | } |
| | | |
| | | private void readExternalBundle(Map<String, String> values, File file) { |
| | | if (!file.exists() || !file.isFile()) { |
| | | return; |
| | | } |
| | | try (InputStream inputStream = new FileInputStream(file)) { |
| | | loadProperties(values, inputStream); |
| | | } catch (IOException ex) { |
| | | throw new IllegalStateException("Failed to load external i18n bundle: " + file.getAbsolutePath(), ex); |
| | | } |
| | | } |
| | | |
| | | private void loadProperties(Map<String, String> values, InputStream inputStream) throws IOException { |
| | | try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { |
| | | String line; |
| | | while ((line = reader.readLine()) != null) { |
| | | parsePropertyLine(values, line); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void parsePropertyLine(Map<String, String> values, String line) { |
| | | if (line == null) { |
| | | return; |
| | | } |
| | | String trimmed = line.trim(); |
| | | if (trimmed.isEmpty() || trimmed.startsWith("#") || trimmed.startsWith("!")) { |
| | | return; |
| | | } |
| | | int separatorIndex = findSeparator(line); |
| | | String rawKey = separatorIndex >= 0 ? line.substring(0, separatorIndex) : line; |
| | | String rawValue = separatorIndex >= 0 ? line.substring(separatorIndex + 1) : ""; |
| | | while (!rawValue.isEmpty() && Character.isWhitespace(rawValue.charAt(0))) { |
| | | rawValue = rawValue.substring(1); |
| | | } |
| | | String key = unescapePropertyToken(rawKey); |
| | | String value = unescapePropertyToken(rawValue); |
| | | if (!key.isEmpty()) { |
| | | values.put(key, value); |
| | | } |
| | | } |
| | | |
| | | private int findSeparator(String line) { |
| | | boolean escaping = false; |
| | | for (int i = 0; i < line.length(); i++) { |
| | | char ch = line.charAt(i); |
| | | if (escaping) { |
| | | escaping = false; |
| | | continue; |
| | | } |
| | | if (ch == '\\') { |
| | | escaping = true; |
| | | continue; |
| | | } |
| | | if (ch == '=' || ch == ':') { |
| | | return i; |
| | | } |
| | | } |
| | | return -1; |
| | | } |
| | | |
| | | private String unescapePropertyToken(String text) { |
| | | StringBuilder builder = new StringBuilder(text.length()); |
| | | boolean escaping = false; |
| | | for (int i = 0; i < text.length(); i++) { |
| | | char ch = text.charAt(i); |
| | | if (!escaping) { |
| | | if (ch == '\\') { |
| | | escaping = true; |
| | | } else { |
| | | builder.append(ch); |
| | | } |
| | | continue; |
| | | } |
| | | switch (ch) { |
| | | case 't': |
| | | builder.append('\t'); |
| | | break; |
| | | case 'r': |
| | | builder.append('\r'); |
| | | break; |
| | | case 'n': |
| | | builder.append('\n'); |
| | | break; |
| | | case 'f': |
| | | builder.append('\f'); |
| | | break; |
| | | case 'u': |
| | | if (i + 4 < text.length()) { |
| | | String hex = text.substring(i + 1, i + 5); |
| | | try { |
| | | builder.append((char) Integer.parseInt(hex, 16)); |
| | | i += 4; |
| | | break; |
| | | } catch (NumberFormatException ex) { |
| | | builder.append('u'); |
| | | break; |
| | | } |
| | | } |
| | | builder.append('u'); |
| | | break; |
| | | default: |
| | | builder.append(ch); |
| | | break; |
| | | } |
| | | escaping = false; |
| | | } |
| | | if (escaping) { |
| | | builder.append('\\'); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | private File externalBundle(String localeTag, String bundleName) { |
| | | return new File(properties.getPackPath(), localeTag + File.separator + bundleName + ".properties"); |
| | | } |
| | | |
| | | private String directTranslate(String text, Map<String, String> bundle) { |
| | | String trimmed = text.trim(); |
| | | String translated = bundle.get(trimmed); |
| | | if (translated == null) { |
| | | return text; |
| | | } |
| | | return preserveOuterWhitespace(text, translated); |
| | | } |
| | | |
| | | private String regexTranslate(String text, Map<String, String> bundle) { |
| | | String trimmed = text == null ? "" : text.trim(); |
| | | for (Map.Entry<String, String> entry : bundle.entrySet()) { |
| | | String key = entry.getKey(); |
| | | if (Cools.isEmpty(key) || !key.startsWith("regex:")) { |
| | | continue; |
| | | } |
| | | String patternText = key.substring("regex:".length()); |
| | | if (Cools.isEmpty(patternText)) { |
| | | continue; |
| | | } |
| | | try { |
| | | Pattern pattern = Pattern.compile(patternText); |
| | | if (!trimmed.isEmpty()) { |
| | | Matcher trimmedMatcher = pattern.matcher(trimmed); |
| | | if (trimmedMatcher.matches()) { |
| | | return preserveOuterWhitespace(text, trimmedMatcher.replaceAll(entry.getValue())); |
| | | } |
| | | } |
| | | Matcher matcher = pattern.matcher(text); |
| | | if (matcher.find()) { |
| | | return matcher.replaceAll(entry.getValue()); |
| | | } |
| | | } catch (PatternSyntaxException ex) { |
| | | // Ignore invalid regex entries so a bad pack does not break all translations. |
| | | } |
| | | } |
| | | return text; |
| | | } |
| | | |
| | | private String fragmentTranslate(String text, Map<String, String> bundle) { |
| | | List<Map.Entry<String, String>> entries = new ArrayList<>(bundle.entrySet()); |
| | | entries.sort((left, right) -> Integer.compare(right.getKey().length(), left.getKey().length())); |
| | | String result = text; |
| | | for (Map.Entry<String, String> entry : entries) { |
| | | if (Cools.isEmpty(entry.getKey()) |
| | | || entry.getKey().length() < 2 |
| | | || entry.getKey().startsWith("regex:") |
| | | || entry.getKey().equals(entry.getValue())) { |
| | | continue; |
| | | } |
| | | result = result.replace(entry.getKey(), entry.getValue()); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private String preserveOuterWhitespace(String original, String translated) { |
| | | String trimmed = original == null ? "" : original.trim(); |
| | | if (trimmed.isEmpty()) { |
| | | return translated; |
| | | } |
| | | int leading = original.indexOf(trimmed); |
| | | int trailing = original.length() - leading - trimmed.length(); |
| | | StringBuilder builder = new StringBuilder(); |
| | | if (leading > 0) { |
| | | builder.append(original, 0, leading); |
| | | } |
| | | builder.append(translated); |
| | | if (trailing > 0) { |
| | | builder.append(original.substring(original.length() - trailing)); |
| | | } |
| | | return builder.toString(); |
| | | } |
| | | |
| | | private String normalizeKey(String raw, Long id, String prefix) { |
| | | if (Cools.isEmpty(raw)) { |
| | | return prefix + "." + (id == null ? "unknown" : id); |
| | | } |
| | | String normalized = raw.replaceAll("\\.html", ""); |
| | | normalized = normalized.replaceAll("[^A-Za-z0-9]+", "."); |
| | | normalized = normalized.replaceAll("\\.+", "."); |
| | | normalized = normalized.replaceAll("^\\.|\\.$", ""); |
| | | if (Cools.isEmpty(normalized)) { |
| | | return prefix + "." + (id == null ? "unknown" : id); |
| | | } |
| | | return normalized; |
| | | } |
| | | |
| | | private static class CacheEntry { |
| | | private Map<String, String> values = new LinkedHashMap<>(); |
| | | private long loadedAt; |
| | | private long externalLastModified = -1L; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.common.i18n; |
| | | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @Component |
| | | @ConfigurationProperties(prefix = "app.i18n") |
| | | public class I18nProperties { |
| | | |
| | | private String defaultLocale = "zh-CN"; |
| | | |
| | | private List<String> supportedLocales = Arrays.asList("zh-CN", "en-US"); |
| | | |
| | | private String packPath = "./stock/out/wcs/i18n"; |
| | | |
| | | private long refreshSeconds = 10; |
| | | |
| | | public String getDefaultLocale() { |
| | | return defaultLocale; |
| | | } |
| | | |
| | | public void setDefaultLocale(String defaultLocale) { |
| | | this.defaultLocale = defaultLocale; |
| | | } |
| | | |
| | | public List<String> getSupportedLocales() { |
| | | return supportedLocales; |
| | | } |
| | | |
| | | public void setSupportedLocales(List<String> supportedLocales) { |
| | | this.supportedLocales = supportedLocales; |
| | | } |
| | | |
| | | public String getPackPath() { |
| | | return packPath; |
| | | } |
| | | |
| | | public void setPackPath(String packPath) { |
| | | this.packPath = packPath; |
| | | } |
| | | |
| | | public long getRefreshSeconds() { |
| | | return refreshSeconds; |
| | | } |
| | | |
| | | public void setRefreshSeconds(long refreshSeconds) { |
| | | this.refreshSeconds = refreshSeconds; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.common.i18n; |
| | | |
| | | import com.core.common.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.MethodParameter; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.converter.HttpMessageConverter; |
| | | import org.springframework.http.server.ServerHttpRequest; |
| | | import org.springframework.http.server.ServerHttpResponse; |
| | | import org.springframework.web.bind.annotation.RestControllerAdvice; |
| | | import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; |
| | | |
| | | @RestControllerAdvice |
| | | public class I18nResponseBodyAdvice implements ResponseBodyAdvice<Object> { |
| | | |
| | | @Autowired |
| | | private I18nMessageService i18nMessageService; |
| | | |
| | | @Override |
| | | public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) { |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType, |
| | | Class<? extends HttpMessageConverter<?>> selectedConverterType, |
| | | ServerHttpRequest request, ServerHttpResponse response) { |
| | | if (body instanceof R) { |
| | | R result = (R) body; |
| | | Object msg = result.get("msg"); |
| | | if (msg instanceof String) { |
| | | result.put("msg", i18nMessageService.translateLegacy((String) msg)); |
| | | } |
| | | } |
| | | return body; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.common.i18n; |
| | | |
| | | import com.core.common.Cools; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.servlet.HandlerInterceptor; |
| | | |
| | | import jakarta.servlet.http.Cookie; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.Locale; |
| | | |
| | | @Component |
| | | public class RequestLocaleInterceptor implements HandlerInterceptor { |
| | | |
| | | public static final String LANG_COOKIE_NAME = "wcs_lang"; |
| | | |
| | | @Autowired |
| | | private I18nMessageService i18nMessageService; |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { |
| | | Locale locale = i18nMessageService.resolveLocale(extractLocale(request)); |
| | | org.springframework.context.i18n.LocaleContextHolder.setLocale(locale); |
| | | request.setAttribute("wcsLocale", locale); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) { |
| | | org.springframework.context.i18n.LocaleContextHolder.resetLocaleContext(); |
| | | } |
| | | |
| | | private String extractLocale(HttpServletRequest request) { |
| | | String locale = request.getParameter("lang"); |
| | | if (!Cools.isEmpty(locale)) { |
| | | return locale; |
| | | } |
| | | locale = request.getHeader("X-Lang"); |
| | | if (!Cools.isEmpty(locale)) { |
| | | return locale; |
| | | } |
| | | Cookie[] cookies = request.getCookies(); |
| | | if (cookies != null) { |
| | | for (Cookie cookie : cookies) { |
| | | if (LANG_COOKIE_NAME.equals(cookie.getName()) && !Cools.isEmpty(cookie.getValue())) { |
| | | return cookie.getValue(); |
| | | } |
| | | } |
| | | } |
| | | return request.getHeader("Accept-Language"); |
| | | } |
| | | } |
| | |
| | | package com.zy.common.service; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.param.*; |
| | |
| | | * @return workNo(工作号) |
| | | */ |
| | | public synchronized int getWorkNo(Integer wrkMk) { |
| | | WrkLastno wrkLastno = wrkLastnoService.selectById(wrkMk); |
| | | WrkLastno wrkLastno = wrkLastnoService.getById(wrkMk); |
| | | if (Cools.isEmpty(wrkLastno)) { |
| | | throw new CoolException("数据异常,请联系管理员"); |
| | | } |
| | |
| | | |
| | | if(wrkNo == null) { |
| | | if (!Cools.isEmpty(taskNo)) { |
| | | wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wms_wrk_no", taskNo)); |
| | | wrkMast = wrkMastService.getOne(new QueryWrapper<WrkMast>().eq("wms_wrk_no", taskNo)); |
| | | } |
| | | }else { |
| | | wrkMast = wrkMastService.selectByWorkNo(wrkNo); |
| | |
| | | |
| | | if(wrkNo == null) { |
| | | if (!Cools.isEmpty(taskNo)) { |
| | | wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wms_wrk_no", taskNo)); |
| | | wrkMast = wrkMastService.getOne(new QueryWrapper<WrkMast>().eq("wms_wrk_no", taskNo)); |
| | | } |
| | | }else { |
| | | wrkMast = wrkMastService.selectByWorkNo(wrkNo); |
| | |
| | | throw new CoolException("未知设备类型"); |
| | | } |
| | | |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | boolean res = wrkMastService.save(wrkMast); |
| | | if (!res) { |
| | | News.error("移库任务 --- 保存工作档失败!"); |
| | | throw new CoolException("保存工作档失败"); |
| | |
| | | throw new CoolException("未知设备类型"); |
| | | } |
| | | |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | boolean res = wrkMastService.save(wrkMast); |
| | | if (!res) { |
| | | News.error("入库任务 --- 保存工作档失败!"); |
| | | throw new CoolException("保存工作档失败"); |
| | |
| | | } |
| | | |
| | | if(Cools.isEmpty(staNo)) { |
| | | List<BasOutStationArea> areaList = basOutStationAreaService.selectList(new EntityWrapper<BasOutStationArea>().eq("area_code", outArea)); |
| | | List<BasOutStationArea> areaList = basOutStationAreaService.list(new QueryWrapper<BasOutStationArea>().eq("area_code", outArea)); |
| | | if (areaList.isEmpty()) { |
| | | throw new CoolException("出库区域不存在"); |
| | | } |
| | |
| | | } |
| | | |
| | | if (findCrnResult.getCrnType().equals(SlaveType.Crn)) { |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", crnNo)); |
| | | BasCrnp basCrnp = basCrnpService.getOne(new QueryWrapper<BasCrnp>().eq("crn_no", crnNo)); |
| | | if(basCrnp == null) { |
| | | throw new CoolException("未找到对应堆垛机数据"); |
| | | } |
| | | List<WrkMast> outWrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> outWrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("crn_no", crnNo) |
| | | .eq("io_type", WrkIoType.OUT.id) |
| | | ); |
| | |
| | | |
| | | wrkMast.setCrnNo(findCrnResult.getCrnNo()); |
| | | } else if (findCrnResult.getCrnType().equals(SlaveType.DualCrn)) { |
| | | BasDualCrnp basDualCrnp = basDualCrnpService.selectOne(new EntityWrapper<BasDualCrnp>().eq("crn_no", crnNo)); |
| | | BasDualCrnp basDualCrnp = basDualCrnpService.getOne(new QueryWrapper<BasDualCrnp>().eq("crn_no", crnNo)); |
| | | if(basDualCrnp == null) { |
| | | throw new CoolException("未找到对应双工位堆垛机数据"); |
| | | } |
| | | List<WrkMast> outWrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> outWrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("dual_crn_no", crnNo) |
| | | .eq("io_type", WrkIoType.OUT.id) |
| | | ); |
| | |
| | | throw new CoolException("未知设备类型"); |
| | | } |
| | | |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | boolean res = wrkMastService.save(wrkMast); |
| | | if (!res) { |
| | | News.error("出库任务 --- 保存工作档失败!"); |
| | | throw new CoolException("保存工作档失败"); |
| | |
| | | } |
| | | |
| | | public FindCrnNoResult findCrnNoByLocNo(String locNo) { |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>()); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | List<List<Integer>> rowList = basCrnp.getControlRows$(); |
| | | for (List<Integer> rows : rowList) { |
| | |
| | | } |
| | | } |
| | | |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.list(new QueryWrapper<>()); |
| | | for (BasDualCrnp basDualCrnp : basDualCrnps) { |
| | | List<List<Integer>> rowList = basDualCrnp.getControlRows$(); |
| | | for (List<Integer> rows : rowList) { |
| | |
| | | List<StationObjModel> stationList = new ArrayList<>(); |
| | | Integer crnNo = findCrnNoResult.getCrnNo(); |
| | | if (findCrnNoResult.getCrnType().equals(SlaveType.Crn)) { |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", crnNo)); |
| | | BasCrnp basCrnp = basCrnpService.getOne(new QueryWrapper<BasCrnp>().eq("crn_no", crnNo)); |
| | | if(basCrnp == null) { |
| | | return null; |
| | | } |
| | | stationList = basCrnp.getInStationList$(); |
| | | } else if (findCrnNoResult.getCrnType().equals(SlaveType.DualCrn)) { |
| | | BasDualCrnp basDualCrnp = basDualCrnpService.selectOne(new EntityWrapper<BasDualCrnp>().eq("crn_no", crnNo)); |
| | | BasDualCrnp basDualCrnp = basDualCrnpService.getOne(new QueryWrapper<BasDualCrnp>().eq("crn_no", crnNo)); |
| | | if(basDualCrnp == null) { |
| | | return null; |
| | | } |
| | |
| | | List<StationObjModel> stationList = new ArrayList<>(); |
| | | Integer crnNo = findCrnNoResult.getCrnNo(); |
| | | if (findCrnNoResult.getCrnType().equals(SlaveType.Crn)) { |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", crnNo)); |
| | | BasCrnp basCrnp = basCrnpService.getOne(new QueryWrapper<BasCrnp>().eq("crn_no", crnNo)); |
| | | if(basCrnp == null) { |
| | | return null; |
| | | } |
| | | stationList = basCrnp.getOutStationList$(); |
| | | } else if (findCrnNoResult.getCrnType().equals(SlaveType.DualCrn)) { |
| | | BasDualCrnp basDualCrnp = basDualCrnpService.selectOne(new EntityWrapper<BasDualCrnp>().eq("crn_no", crnNo)); |
| | | BasDualCrnp basDualCrnp = basDualCrnpService.getOne(new QueryWrapper<BasDualCrnp>().eq("crn_no", crnNo)); |
| | | if(basDualCrnp == null) { |
| | | return null; |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.R; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | |
| | | /** |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.BasMap; |
| | |
| | | |
| | | public List<List<NavigateNode>> getStationMap(int lev) { |
| | | BasMapService basMapService = SpringUtils.getBean(BasMapService.class); |
| | | BasMap basMap = basMapService.selectOne(new EntityWrapper<BasMap>().eq("lev", lev)); |
| | | BasMap basMap = basMapService.getOne(new QueryWrapper<BasMap>().eq("lev", lev)); |
| | | if (basMap == null) { |
| | | throw new CoolException("地图不存在"); |
| | | } |
| | |
| | | |
| | | public List<List<NavigateNode>> getRgvTrackMap(int lev) { |
| | | BasMapService basMapService = SpringUtils.getBean(BasMapService.class); |
| | | BasMap basMap = basMapService.selectOne(new EntityWrapper<BasMap>().eq("lev", lev)); |
| | | BasMap basMap = basMapService.getOne(new QueryWrapper<BasMap>().eq("lev", lev)); |
| | | if (basMap == null) { |
| | | throw new CoolException("地图不存在"); |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.common.model.NavigateNode; |
| | |
| | | private BasStationService basStationService; |
| | | |
| | | public synchronized List<NavigateNode> calcByStationId(Integer startStationId, Integer endStationId) { |
| | | BasStation startStation = basStationService.selectById(startStationId); |
| | | BasStation startStation = basStationService.getById(startStationId); |
| | | if (startStation == null) { |
| | | throw new CoolException("未找到该 起点 对应的站点数据"); |
| | | } |
| | |
| | | try { |
| | | DeviceConfigService deviceConfigService = SpringUtils.getBean(DeviceConfigService.class); |
| | | if (deviceConfigService != null) { |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig deviceConfig : devpList) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, deviceConfig.getDeviceNo()); |
| | |
| | | try { |
| | | ConfigService configService = SpringUtils.getBean(ConfigService.class); |
| | | if (configService != null) { |
| | | Config cfgLen = configService.selectOne(new EntityWrapper<Config>().eq("code", "stationPathLenWeightPercent")); |
| | | Config cfgLen = configService.getOne(new QueryWrapper<Config>().eq("code", "stationPathLenWeightPercent")); |
| | | if (cfgLen != null && cfgLen.getValue() != null) { |
| | | String v = cfgLen.getValue().trim(); |
| | | if (v.endsWith("%")) v = v.substring(0, v.length() - 1); |
| | | try { lenWeightPercent = Double.parseDouble(v); } catch (Exception ignore) {} |
| | | } |
| | | Config cfgCong = configService.selectOne(new EntityWrapper<Config>().eq("code", "stationPathCongWeightPercent")); |
| | | Config cfgCong = configService.getOne(new QueryWrapper<Config>().eq("code", "stationPathCongWeightPercent")); |
| | | if (cfgCong != null && cfgCong.getValue() != null) { |
| | | String v = cfgCong.getValue().trim(); |
| | | if (v.endsWith("%")) v = v.substring(0, v.length() - 1); |
| | |
| | | package com.zy.common.utils; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.awt.*; |
| | | import java.awt.image.BufferedImage; |
| | | import java.util.Map; |
| | |
| | | package com.zy.common.web; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.i18n.I18nMessageService; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.model.PowerDto; |
| | | import com.zy.common.model.enums.HtmlNavIconType; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | private RolePermissionService rolePermissionService; |
| | | @Autowired |
| | | private LicenseTimer licenseTimer; |
| | | @Autowired |
| | | private I18nMessageService i18nMessageService; |
| | | |
| | | @RequestMapping("/login.action") |
| | | @ManagerAuth(value = ManagerAuth.Auth.NONE, memo = "登录") |
| | | public R loginAction(String mobile, String password){ |
| | | //验证许可证是否有效 |
| | | if (!licenseTimer.getSystemSupport()){ |
| | | return R.parse(CodeRes.SYSTEM_20001); |
| | | return new R(20001, i18nMessageService.getMessage("response.system.licenseExpired")); |
| | | } |
| | | if (mobile.equals("super") && password.equals(Cools.md5(superPwd))) { |
| | | Map<String, Object> res = new HashMap<>(); |
| | |
| | | res.put("token", Cools.enToken(System.currentTimeMillis() + mobile, superPwd)); |
| | | return R.ok(res); |
| | | } |
| | | EntityWrapper<User> userWrapper = new EntityWrapper<>(); |
| | | QueryWrapper<User> userWrapper = new QueryWrapper<>(); |
| | | userWrapper.eq("mobile", mobile); |
| | | User user = userService.selectOne(userWrapper); |
| | | User user = userService.getOne(userWrapper); |
| | | if (Cools.isEmpty(user)){ |
| | | return R.parse(CodeRes.USER_10001); |
| | | return new R(10001, i18nMessageService.getMessage("response.user.notFound")); |
| | | } |
| | | if (user.getStatus()!=1){ |
| | | return R.parse(CodeRes.USER_10002); |
| | | return new R(10002, i18nMessageService.getMessage("response.user.disabled")); |
| | | } |
| | | if (!user.getPassword().equals(password)){ |
| | | return R.parse(CodeRes.USER_10003); |
| | | return new R(10003, i18nMessageService.getMessage("response.user.passwordMismatch")); |
| | | } |
| | | String token = Cools.enToken(System.currentTimeMillis() + mobile, user.getPassword()); |
| | | userLoginService.delete(new EntityWrapper<UserLogin>().eq("user_id", user.getId()).eq("system_type", "WCS")); |
| | | userLoginService.remove(new QueryWrapper<UserLogin>().eq("user_id", user.getId()).eq("system_type", "WCS")); |
| | | UserLogin userLogin = new UserLogin(); |
| | | userLogin.setUserId(user.getId()); |
| | | userLogin.setToken(token); |
| | | userLogin.setSystemType("WCS"); |
| | | userLoginService.insert(userLogin); |
| | | userLoginService.save(userLogin); |
| | | Map<String, Object> res = new HashMap<>(); |
| | | res.put("username", user.getUsername()); |
| | | res.put("token", token); |
| | |
| | | @RequestMapping("/user/detail/auth") |
| | | @ManagerAuth |
| | | public R userDetail(){ |
| | | return R.ok(userService.selectById(getUserId())); |
| | | return R.ok(userService.getById(getUserId())); |
| | | } |
| | | |
| | | @RequestMapping("/menu/auth") |
| | | @ManagerAuth(memo = "首页菜单") |
| | | public R menu(){ |
| | | // 获取所有一级菜单 |
| | | List<Resource> oneLevel = resourceService.selectList(new EntityWrapper<Resource>().eq("level", 1).eq("status", 1).orderBy("sort")); |
| | | List<Resource> oneLevel = resourceService.list(new QueryWrapper<Resource>().eq("level", 1).eq("status", 1).orderBy(true, true, "sort")); |
| | | User user = null; |
| | | Wrapper<Resource> resourceWrapper; |
| | | QueryWrapper<Resource> resourceWrapper; |
| | | if (getUserId() == 9527) { |
| | | resourceWrapper = new EntityWrapper<Resource>().eq("level", 2).eq("status", 1).orderBy("sort"); |
| | | resourceWrapper = new QueryWrapper<Resource>().eq("level", 2).eq("status", 1).orderBy(true, true, "sort"); |
| | | } else { |
| | | // 获取当前用户的所有二级菜单 |
| | | user = userService.selectById(getUserId()); |
| | | List<RoleResource> roleResources = roleResourceService.selectList(new EntityWrapper<RoleResource>().eq("role_id", user.getRoleId())); |
| | | user = userService.getById(getUserId()); |
| | | List<RoleResource> roleResources = roleResourceService.list(new QueryWrapper<RoleResource>().eq("role_id", user.getRoleId())); |
| | | List<Long> resourceIds = new ArrayList<>(); |
| | | roleResources.forEach(roleResource -> resourceIds.add(roleResource.getResourceId())); |
| | | if (resourceIds.isEmpty()){ |
| | | return R.ok(); |
| | | } |
| | | resourceWrapper = new EntityWrapper<Resource>().in("id", resourceIds).eq("level", 2).eq("status", 1).orderBy("sort"); |
| | | resourceWrapper = new QueryWrapper<Resource>().in("id", resourceIds).eq("level", 2).eq("status", 1).orderBy(true, true, "sort"); |
| | | } |
| | | List<Resource> twoLevel = resourceService.selectList(resourceWrapper); |
| | | List<Resource> twoLevel = resourceService.list(resourceWrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Resource menu : oneLevel) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | |
| | | // 是否拥有查看权限 |
| | | if (getUserId() != 9527) { |
| | | Resource view = resourceService.selectOne(new EntityWrapper<Resource>().eq("resource_id", resource.getId()).like("code", "view")); |
| | | Resource view = resourceService.getOne(new QueryWrapper<Resource>().eq("resource_id", resource.getId()).like("code", "view")); |
| | | if (!Cools.isEmpty(view)){ |
| | | RoleResource param = new RoleResource(); |
| | | param.setResourceId(view.getId()); |
| | | param.setRoleId(user.getRoleId()); |
| | | if (null == roleResourceService.selectOne(new EntityWrapper<>(param))){ |
| | | if (null == roleResourceService.getOne(new QueryWrapper<>(param))){ |
| | | continue; |
| | | } |
| | | } |
| | | } |
| | | |
| | | resource.setName(localizeResourceName(resource)); |
| | | subMenu.add(resource); |
| | | iterator.remove(); |
| | | } |
| | |
| | | map.put("menuId", menu.getId()); |
| | | map.put("menuCode", menu.getCode()); |
| | | map.put("menuIcon", HtmlNavIconType.get(menu.getCode())); |
| | | map.put("menu", menu.getName()); |
| | | map.put("menu", localizeResourceName(menu)); |
| | | map.put("subMenu", subMenu); |
| | | result.add(map); |
| | | } |
| | |
| | | @RequestMapping("/power/list/auth") |
| | | @ManagerAuth |
| | | public R powerList(){ |
| | | List<Resource> oneLevels = resourceService.selectList(new EntityWrapper<Resource>().eq("level", 1).eq("status", 1).orderBy("sort")); |
| | | List<Resource> oneLevels = resourceService.list(new QueryWrapper<Resource>().eq("level", 1).eq("status", 1).orderBy(true, true, "sort")); |
| | | List<Map> result = new ArrayList<>(); |
| | | // 一级 |
| | | for (Resource oneLevel : oneLevels){ |
| | | List<Map> twoLevelsList = new ArrayList<>(); |
| | | Map<String, Object> oneLevelMap = new HashMap<>(); |
| | | oneLevelMap.put("title", oneLevel.getName()); |
| | | oneLevelMap.put("title", localizeResourceName(oneLevel)); |
| | | oneLevelMap.put("id", oneLevel.getId()); |
| | | oneLevelMap.put("spread", true); |
| | | oneLevelMap.put("children", twoLevelsList); |
| | | List<Resource> twoLevels = resourceService.selectList(new EntityWrapper<Resource>().eq("resource_id", oneLevel.getId()).eq("level", 2).eq("status", 1).orderBy("sort")); |
| | | List<Resource> twoLevels = resourceService.list(new QueryWrapper<Resource>().eq("resource_id", oneLevel.getId()).eq("level", 2).eq("status", 1).orderBy(true, true, "sort")); |
| | | // 二级 |
| | | for (Resource twoLevel : twoLevels){ |
| | | Map<String, Object> twoLevelMap = new HashMap<>(); |
| | | twoLevelMap.put("title", twoLevel.getName()); |
| | | twoLevelMap.put("title", localizeResourceName(twoLevel)); |
| | | twoLevelMap.put("id", twoLevel.getId()); |
| | | twoLevelMap.put("spread", false); |
| | | |
| | | List<Map> threeLevelsList = new ArrayList<>(); |
| | | twoLevelMap.put("children", threeLevelsList); |
| | | // 三级 |
| | | List<Resource> threeLevels = resourceService.selectList(new EntityWrapper<Resource>().eq("resource_id", twoLevel.getId()).eq("level", 3).eq("status", 1).orderBy("sort")); |
| | | List<Resource> threeLevels = resourceService.list(new QueryWrapper<Resource>().eq("resource_id", twoLevel.getId()).eq("level", 3).eq("status", 1).orderBy(true, true, "sort")); |
| | | for (Resource threeLevel : threeLevels){ |
| | | Map<String, Object> threeLevelMap = new HashMap<>(); |
| | | threeLevelMap.put("title", threeLevel.getName()); |
| | | threeLevelMap.put("title", localizeResourceName(threeLevel)); |
| | | threeLevelMap.put("id", threeLevel.getId()); |
| | | threeLevelMap.put("checked", false); |
| | | threeLevelsList.add(threeLevelMap); |
| | |
| | | |
| | | // 功能模块 |
| | | Map<String, Object> functions = new HashMap<>(); |
| | | functions.put("title", "指定功能"); |
| | | functions.put("title", i18nMessageService.getMessage("permission.function")); |
| | | functions.put("id", "function"); |
| | | functions.put("spread", true); |
| | | List<Map> funcs = new ArrayList<>(); |
| | | functions.put("children", funcs); |
| | | List<Permission> permissions = permissionService.selectList(new EntityWrapper<Permission>().eq("status", 1)); |
| | | List<Permission> permissions = permissionService.list(new QueryWrapper<Permission>().eq("status", 1)); |
| | | for (Permission permission : permissions) { |
| | | Map<String, Object> func = new HashMap<>(); |
| | | func.put("title", permission.getName()); |
| | | func.put("title", i18nMessageService.resolvePermissionText(permission.getName(), permission.getAction(), permission.getId())); |
| | | func.put("id", permission.getAction()); |
| | | func.put("spread", true); |
| | | funcs.add(func); |
| | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | private String localizeResourceName(Resource resource) { |
| | | return i18nMessageService.resolveResourceText(resource.getName(), resource.getCode(), resource.getId()); |
| | | } |
| | | |
| | | @RequestMapping(value = "/power/{roleId}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("roleId") Long roleId) { |
| | | List<Object> result = new ArrayList<>(); |
| | | // 菜单 |
| | | List<RoleResource> roleResources = roleResourceService.selectList(new EntityWrapper<RoleResource>().eq("role_id", roleId)); |
| | | List<RoleResource> roleResources = roleResourceService.list(new QueryWrapper<RoleResource>().eq("role_id", roleId)); |
| | | for (RoleResource roleResource : roleResources){ |
| | | Resource resource = resourceService.selectById(roleResource.getResourceId()); |
| | | Resource resource = resourceService.getById(roleResource.getResourceId()); |
| | | if (!Cools.isEmpty(resource)){ |
| | | if (resource.getLevel() == 3){ |
| | | result.add(resource.getId()); |
| | |
| | | } |
| | | } |
| | | // 功能 |
| | | List<RolePermission> rolePermissions = rolePermissionService.selectList(new EntityWrapper<RolePermission>().eq("role_id", roleId)); |
| | | List<RolePermission> rolePermissions = rolePermissionService.list(new QueryWrapper<RolePermission>().eq("role_id", roleId)); |
| | | for (RolePermission rolePermission : rolePermissions){ |
| | | Permission permission = permissionService.selectById(rolePermission.getPermissionId()); |
| | | Permission permission = permissionService.getById(rolePermission.getPermissionId()); |
| | | if (!Cools.isEmpty(permission)){ |
| | | result.add(permission.getAction()); |
| | | } |
| | |
| | | @ManagerAuth(memo = "授权") |
| | | @Transactional |
| | | public R power(Long roleId, String powers){ |
| | | Role role = roleService.selectById(roleId); |
| | | Role role = roleService.getById(roleId); |
| | | Long leaderId = role.getLeader(); |
| | | roleResourceService.delete(new EntityWrapper<RoleResource>().eq("role_id", roleId)); |
| | | rolePermissionService.delete(new EntityWrapper<RolePermission>().eq("role_id", roleId)); |
| | | roleResourceService.remove(new QueryWrapper<RoleResource>().eq("role_id", roleId)); |
| | | rolePermissionService.remove(new QueryWrapper<RolePermission>().eq("role_id", roleId)); |
| | | if (!Cools.isEmpty(powers)){ |
| | | List<PowerDto> dtos = JSON.parseArray(powers, PowerDto.class); |
| | | for (PowerDto dto : dtos) { |
| | | Resource resource = resourceService.selectOne(new EntityWrapper<Resource>().eq("id", dto.getTwo()).eq("level", 2)); |
| | | Resource resource = resourceService.getOne(new QueryWrapper<Resource>().eq("id", dto.getTwo()).eq("level", 2)); |
| | | if (!Cools.isEmpty(resource)) { |
| | | // 校验上级权限 |
| | | if (leaderId != null) { |
| | | RoleResource roleResource = roleResourceService.selectOne(new EntityWrapper<RoleResource>().eq("role_id", leaderId).eq("resource_id", resource.getId())); |
| | | RoleResource roleResource = roleResourceService.getOne(new QueryWrapper<RoleResource>().eq("role_id", leaderId).eq("resource_id", resource.getId())); |
| | | if (null == roleResource) { |
| | | throw new CoolException(resource.getName().concat("无法授权给").concat(role.getName())); |
| | | } |
| | |
| | | RoleResource roleResource = new RoleResource(); |
| | | roleResource.setRoleId(roleId); |
| | | roleResource.setResourceId(resource.getId()); |
| | | roleResourceService.insert(roleResource); |
| | | roleResourceService.save(roleResource); |
| | | } else { |
| | | Permission permission = permissionService.selectOne(new EntityWrapper<Permission>().eq("action", dto.getTwo())); |
| | | Permission permission = permissionService.getOne(new QueryWrapper<Permission>().eq("action", dto.getTwo())); |
| | | if (!Cools.isEmpty(permission)){ |
| | | RolePermission rolePermission = new RolePermission(); |
| | | rolePermission.setRoleId(roleId); |
| | | rolePermission.setPermissionId(permission.getId()); |
| | | rolePermissionService.insert(rolePermission); |
| | | rolePermissionService.save(rolePermission); |
| | | } |
| | | } |
| | | for (String three : dto.getThree()){ |
| | | Resource resource1 = resourceService.selectOne(new EntityWrapper<Resource>().eq("id", three).eq("level", 3)); |
| | | Resource resource1 = resourceService.getOne(new QueryWrapper<Resource>().eq("id", three).eq("level", 3)); |
| | | if (!Cools.isEmpty(resource1)) { |
| | | // 校验上级权限 |
| | | if (leaderId != null) { |
| | | RoleResource roleResource = roleResourceService.selectOne(new EntityWrapper<RoleResource>().eq("role_id", leaderId).eq("resource_id", resource1.getId())); |
| | | RoleResource roleResource = roleResourceService.getOne(new QueryWrapper<RoleResource>().eq("role_id", leaderId).eq("resource_id", resource1.getId())); |
| | | if (null == roleResource) { |
| | | throw new CoolException(resource.getName().concat("的").concat(resource1.getName().concat("无法授权给").concat(role.getName()))); |
| | | } |
| | |
| | | RoleResource roleResource = new RoleResource(); |
| | | roleResource.setRoleId(roleId); |
| | | roleResource.setResourceId(resource1.getId()); |
| | | roleResourceService.insert(roleResource); |
| | | roleResourceService.save(roleResource); |
| | | } |
| | | } |
| | | } |
| | |
| | | public R buttonResource(@PathVariable("resourceId") Long resourceId) { |
| | | List<Resource> resources; |
| | | if (getUserId() == 9527) { |
| | | resources = resourceService.selectList(new EntityWrapper<Resource>().eq("level", 3).eq("resource_id", resourceId)); |
| | | resources = resourceService.list(new QueryWrapper<Resource>().eq("level", 3).eq("resource_id", resourceId)); |
| | | } else { |
| | | resources = roleResourceService.getMenuButtomResource(resourceId, getUserId()); |
| | | } |
| | |
| | | package com.zy.common.web; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.controller.AbstractBaseController; |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Modifier; |
| | | import java.util.ArrayList; |
| | |
| | | } |
| | | |
| | | protected User getUser(){ |
| | | User user = userService.selectById(getUserId()); |
| | | User user = userService.getById(getUserId()); |
| | | if (null == user) { |
| | | throw new CoolException(BaseRes.DENIED); |
| | | } |
| | |
| | | * @param set 排除字段集合 |
| | | * @param condition 搜索内容 |
| | | */ |
| | | protected <T> void allLike(Class<T> cls, Set<String> set, EntityWrapper<T> wrapper, String condition){ |
| | | protected <T> void allLike(Class<T> cls, Set<String> set, QueryWrapper<T> wrapper, String condition){ |
| | | if (Cools.isEmpty(condition)) { |
| | | return; |
| | | } |
| | |
| | | if (columns.isEmpty()) { |
| | | return; |
| | | } |
| | | for (int i=0;i<columns.size();i++){ |
| | | if (i==0){ |
| | | wrapper.andNew(); |
| | | } else { |
| | | wrapper.or(); |
| | | wrapper.and(q -> { |
| | | for (int i = 0; i < columns.size(); i++) { |
| | | q.like(columns.get(i), condition); |
| | | if (i < columns.size() - 1) { |
| | | q.or(); |
| | | } |
| | | } |
| | | wrapper.like(columns.get(i), condition); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-07-30 |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | import javax.annotation.PreDestroy; |
| | | import jakarta.annotation.PreDestroy; |
| | | |
| | | /** |
| | | * WCS主流程 |
| | |
| | | package com.zy.core; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.service.DeviceConfigService; |
| | |
| | | |
| | | private void initMq(){ |
| | | // 初始化堆垛机mq |
| | | List<DeviceConfig> crnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> crnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn))); |
| | | for (DeviceConfig crn : crnList) { |
| | | MessageQueue.init(SlaveType.Crn, crn.getDeviceNo()); |
| | | } |
| | | // 初始化双工位堆垛机mq |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.DualCrn))); |
| | | for (DeviceConfig crn : dualCrnList) { |
| | | MessageQueue.init(SlaveType.DualCrn, crn.getDeviceNo()); |
| | | } |
| | | // 初始化Rgv小车mq |
| | | List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> rgvList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | | for (DeviceConfig rgv : rgvList) { |
| | | MessageQueue.init(SlaveType.Rgv, rgv.getDeviceNo()); |
| | | } |
| | | // 初始化输送线mq |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig devp : devpList) { |
| | | MessageQueue.init(SlaveType.Devp, devp.getDeviceNo()); |
| | | } |
| | | // 初始化条码扫描仪mq |
| | | List<DeviceConfig> barcodeList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> barcodeList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Barcode))); |
| | | for (DeviceConfig barcode : barcodeList) { |
| | | MessageQueue.init(SlaveType.Barcode, barcode.getDeviceNo()); |
| | | } |
| | | // 初始化Led灯mq |
| | | List<DeviceConfig> ledList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> ledList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Led))); |
| | | for (DeviceConfig led : ledList) { |
| | | MessageQueue.init(SlaveType.Led, led.getDeviceNo()); |
| | |
| | | } |
| | | |
| | | private void initThread(){ |
| | | List<DeviceConfig> crnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> crnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Crn))); |
| | | if(!crnList.isEmpty()) { |
| | | News.info("初始化堆垛机........................................................"); |
| | |
| | | } |
| | | } |
| | | |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> dualCrnList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.DualCrn))); |
| | | if(!dualCrnList.isEmpty()) { |
| | | News.info("初始化双工位堆垛机........................................................"); |
| | |
| | | } |
| | | } |
| | | |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | if(!devpList.isEmpty()) { |
| | | News.info("初始化输送站........................................................"); |
| | |
| | | } |
| | | } |
| | | |
| | | List<DeviceConfig> rgvList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> rgvList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Rgv))); |
| | | if(!rgvList.isEmpty()) { |
| | | News.info("初始化RGV........................................................"); |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import jakarta.annotation.PostConstruct; |
| | | import java.util.HashMap; |
| | | |
| | | @Component |
| | |
| | | |
| | | @PostConstruct |
| | | public void init() { |
| | | WrkLastno wrkLastno = wrkLastnoService.selectById(WrkIoType.FAKE_TASK_NO.id); |
| | | WrkLastno wrkLastno = wrkLastnoService.getById(WrkIoType.FAKE_TASK_NO.id); |
| | | if (Cools.isEmpty(wrkLastno)) { |
| | | throw new CoolException("数据异常,请联系管理员"); |
| | | } |
| | |
| | | package com.zy.core.config; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.system.entity.Config; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import jakarta.annotation.PostConstruct; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | |
| | | public void init() { |
| | | HashMap<String, String> systemConfigMap = new HashMap<>(); |
| | | |
| | | List<Config> configList = configService.selectList(new EntityWrapper<>()); |
| | | List<Config> configList = configService.list(new QueryWrapper<>()); |
| | | for (Config config : configList) { |
| | | systemConfigMap.put(config.getCode(), config.getValue()); |
| | | } |
| | |
| | | List<NavigateNode> targetNavigateNodes = new ArrayList<>(); |
| | | |
| | | try { |
| | | BasStation startStation = basStationService.selectById(stationId); |
| | | BasStation startStation = basStationService.getById(stationId); |
| | | if (startStation == null) { |
| | | return; |
| | | } |
| | | |
| | | BasStation targetStation = basStationService.selectById(targetStationId); |
| | | BasStation targetStation = basStationService.getById(targetStationId); |
| | | if (targetStation == null) { |
| | | return; |
| | | } |
| | |
| | | 1, // 下发状态{0:未下发,1:已下发} |
| | | JSON.toJSONString(response) // 响应 |
| | | ); |
| | | bean.insert(basRgvOpt); |
| | | bean.save(basRgvOpt); |
| | | } |
| | | return response; |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasDevp; |
| | |
| | | } |
| | | |
| | | BasDevp basDevp = basDevpService |
| | | .selectOne(new EntityWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | .getOne(new QueryWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | if (basDevp == null) { |
| | | return Collections.emptyList(); |
| | | } |
| | |
| | | import HslCommunication.Profinet.Siemens.SiemensS7Net; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasDevp; |
| | |
| | | } |
| | | |
| | | BasDevp basDevp = basDevpService |
| | | .selectOne(new EntityWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | .getOne(new QueryWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | if (basDevp == null) { |
| | | return Collections.emptyList(); |
| | | } |
| | |
| | | import HslCommunication.Profinet.Siemens.SiemensS7Net; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasDevp; |
| | |
| | | } |
| | | |
| | | BasDevp basDevp = basDevpService |
| | | .selectOne(new EntityWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | .getOne(new QueryWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | if (basDevp == null) { |
| | | return Collections.emptyList(); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.domain.param.CreateInTaskParam; |
| | | import com.zy.asrs.domain.param.CreateOutTaskParam; |
| | |
| | | while (!Thread.currentThread().isInterrupted()) { |
| | | try { |
| | | Config enableFakeConfig = configService |
| | | .selectOne(new EntityWrapper<Config>().eq("code", "enableFake")); |
| | | .getOne(new QueryWrapper<Config>().eq("code", "enableFake")); |
| | | if (enableFakeConfig != null) { |
| | | enableFake = enableFakeConfig.getValue(); |
| | | } |
| | | |
| | | Config fakeRealTaskRequestWmsConfig = configService |
| | | .selectOne(new EntityWrapper<Config>().eq("code", "fakeRealTaskRequestWms")); |
| | | .getOne(new QueryWrapper<Config>().eq("code", "fakeRealTaskRequestWms")); |
| | | if (fakeRealTaskRequestWmsConfig != null) { |
| | | fakeRealTaskRequestWms = fakeRealTaskRequestWmsConfig.getValue(); |
| | | } |
| | | |
| | | Config fakeGenerateInTaskConfig = configService |
| | | .selectOne(new EntityWrapper<Config>().eq("code", "fakeGenerateInTask")); |
| | | .getOne(new QueryWrapper<Config>().eq("code", "fakeGenerateInTask")); |
| | | if (fakeGenerateInTaskConfig != null) { |
| | | fakeGenerateInTask = fakeGenerateInTaskConfig.getValue(); |
| | | } |
| | | |
| | | Config fakeGenerateOutTaskConfig = configService |
| | | .selectOne(new EntityWrapper<Config>().eq("code", "fakeGenerateOutTask")); |
| | | .getOne(new QueryWrapper<Config>().eq("code", "fakeGenerateOutTask")); |
| | | if (fakeGenerateOutTaskConfig != null) { |
| | | fakeGenerateOutTask = fakeGenerateOutTaskConfig.getValue(); |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | |
| | | return; |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | |
| | | |
| | | // 检测任务是否生成 |
| | | List<WrkMast> wrkMasts = wrkMastService |
| | | .selectList(new EntityWrapper<WrkMast>().eq("barcode", stationProtocol.getBarcode())); |
| | | .list(new QueryWrapper<WrkMast>().eq("barcode", stationProtocol.getBarcode())); |
| | | if (!wrkMasts.isEmpty()) { |
| | | continue; |
| | | } |
| | | |
| | | List<LocMast> locMastList = locMastService |
| | | .selectList(new EntityWrapper<LocMast>().eq("loc_sts", String.valueOf(LocStsType.O))); |
| | | .list(new QueryWrapper<LocMast>().eq("loc_sts", String.valueOf(LocStsType.O))); |
| | | if (locMastList.isEmpty()) { |
| | | continue; |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | |
| | | && !stationProtocol.isLoading() |
| | | && stationProtocol.getTaskNo() == 0) { |
| | | List<LocMast> locMastList = locMastService |
| | | .selectList(new EntityWrapper<LocMast>().eq("loc_sts", String.valueOf(LocStsType.F))); |
| | | .list(new QueryWrapper<LocMast>().eq("loc_sts", String.valueOf(LocStsType.F))); |
| | | if (locMastList.isEmpty()) { |
| | | continue; |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | |
| | | |
| | | // 检测任务是否生成 |
| | | List<WrkMast> wrkMasts = wrkMastService |
| | | .selectList(new EntityWrapper<WrkMast>() |
| | | .list(new QueryWrapper<WrkMast>() |
| | | .eq("barcode", stationProtocol.getBarcode())); |
| | | if (!wrkMasts.isEmpty()) { |
| | | continue; |
| | |
| | | |
| | | // 计算所有站点停留时间 |
| | | public synchronized void calcAllStationStayTime() { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | |
| | | |
| | | // 检测出库站点停留是否超时 |
| | | public synchronized void checkOutStationStayTimeOut() { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | List<StationObjModel> outStationList = basDevp.getOutStationList$(); |
| | | if (outStationList.isEmpty()) { |
| | |
| | | |
| | | // 检测入库站点堆垛机是否取走货物 |
| | | public synchronized void checkInStationCrnTake() { |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>()); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | List<StationObjModel> inStationList = basCrnp.getInStationList$(); |
| | | if (inStationList.isEmpty()) { |
| | |
| | | checkInStationListCrnTake(inStationList); |
| | | } |
| | | |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.list(new QueryWrapper<>()); |
| | | for (BasDualCrnp basDualCrnp : basDualCrnps) { |
| | | List<StationObjModel> inStationList = basDualCrnp.getInStationList$(); |
| | | if (inStationList.isEmpty()) { |
| | |
| | | |
| | | // 堆垛机任务执行完成 |
| | | public synchronized void crnIoExecuteFinish() { |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>()); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, basCrnp.getCrnNo()); |
| | | if (crnThread == null) { |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.domain.param.CreateInTaskParam; |
| | | import com.zy.asrs.entity.BasDevp; |
| | |
| | | return; |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | |
| | | |
| | | // 检测任务是否生成 |
| | | List<WrkMast> wrkMasts = wrkMastService |
| | | .selectList(new EntityWrapper<WrkMast>() |
| | | .list(new QueryWrapper<WrkMast>() |
| | | .eq("barcode", stationProtocol.getBarcode())); |
| | | if (!wrkMasts.isEmpty()) { |
| | | continue; |
| | |
| | | |
| | | //检测入库站是否有任务生成,并启动入库 |
| | | private synchronized void checkInStationHasTask() { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if(stationThread == null){ |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.domain.param.CreateInTaskParam; |
| | | import com.zy.asrs.entity.BasDevp; |
| | |
| | | return; |
| | | } |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | |
| | | |
| | | // 检测任务是否生成 |
| | | List<WrkMast> wrkMasts = wrkMastService |
| | | .selectList(new EntityWrapper<WrkMast>() |
| | | .list(new QueryWrapper<WrkMast>() |
| | | .eq("barcode", stationProtocol.getBarcode())); |
| | | if (!wrkMasts.isEmpty()) { |
| | | continue; |
| | |
| | | |
| | | //检测入库站是否有任务生成,并启动入库 |
| | | private synchronized void checkInStationHasTask() { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if(stationThread == null){ |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.BasMap; |
| | | import com.zy.asrs.service.BasMapService; |
| | |
| | | return; |
| | | } |
| | | |
| | | BasMap basMap = basMapService.selectOne(new EntityWrapper<BasMap>().eq("lev", 1)); |
| | | BasMap basMap = basMapService.getOne(new QueryWrapper<BasMap>().eq("lev", 1)); |
| | | if (Cools.isEmpty(basMap)){ |
| | | //缺少初始化库位地图 |
| | | return; |
| | |
| | | package com.zy.core.thread.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasRgv; |
| | |
| | | log.setStatus(1); |
| | | log.setCreateTime(new Date()); |
| | | log.setSystemStatus(JSON.toJSONString(rgvProtocol)); |
| | | errLogService.insert(log); |
| | | errLogService.save(log); |
| | | if (log.getId() != null) { |
| | | redisUtil.set(errFlagKey, log.getId(), 60 * 60 * 24); |
| | | } |
| | |
| | | |
| | | } |
| | | if (basRgvService != null) { |
| | | BasRgv basRgv = basRgvService.selectOne(new EntityWrapper<BasRgv>().eq("rgv_no", deviceConfig.getDeviceNo())); |
| | | BasRgv basRgv = basRgvService.getOne(new QueryWrapper<BasRgv>().eq("rgv_no", deviceConfig.getDeviceNo())); |
| | | if(basRgv == null) { |
| | | basRgv = new BasRgv(); |
| | | basRgv.setRgvNo(deviceConfig.getDeviceNo()); |
| | | basRgv.setStatus(1); |
| | | basRgv.setCreateTime(new Date()); |
| | | basRgvService.insert(basRgv); |
| | | basRgvService.save(basRgv); |
| | | } |
| | | } |
| | | } |
| | |
| | | JSON.toJSONString(response) |
| | | ); |
| | | if (bean != null) { |
| | | bean.insert(basRgvOpt); |
| | | bean.save(basRgvOpt); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.zy.core.thread.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | |
| | | |
| | | } |
| | | if (basCrnpService != null) { |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", deviceConfig.getDeviceNo())); |
| | | BasCrnp basCrnp = basCrnpService.getOne(new QueryWrapper<BasCrnp>().eq("crn_no", deviceConfig.getDeviceNo())); |
| | | if(basCrnp == null) { |
| | | basCrnp = new BasCrnp(); |
| | | basCrnp.setCrnNo(deviceConfig.getDeviceNo()); |
| | |
| | | basCrnp.setMaxInTask(5); |
| | | basCrnp.setMaxOutTask(5); |
| | | basCrnp.setCreateTime(new Date()); |
| | | basCrnpService.insert(basCrnp); |
| | | basCrnpService.save(basCrnp); |
| | | } |
| | | } |
| | | } |
| | |
| | | log.setStatus(1); |
| | | log.setCreateTime(new Date()); |
| | | log.setSystemStatus(JSON.toJSONString(crnProtocol)); |
| | | errLogService.insert(log); |
| | | errLogService.save(log); |
| | | if (log.getId() != null) { |
| | | redisUtil.set(errFlagKey, log.getId(), 60 * 60 * 24); |
| | | } |
| | |
| | | JSON.toJSONString(response) |
| | | ); |
| | | if (bean != null) { |
| | | bean.insert(basCrnpOpt); |
| | | bean.save(basCrnpOpt); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.zy.core.thread.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.*; |
| | |
| | | |
| | | } |
| | | if (basCrnpService != null) { |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", deviceConfig.getDeviceNo())); |
| | | BasCrnp basCrnp = basCrnpService.getOne(new QueryWrapper<BasCrnp>().eq("crn_no", deviceConfig.getDeviceNo())); |
| | | if(basCrnp == null) { |
| | | basCrnp = new BasCrnp(); |
| | | basCrnp.setCrnNo(deviceConfig.getDeviceNo()); |
| | |
| | | basCrnp.setMaxInTask(5); |
| | | basCrnp.setMaxOutTask(5); |
| | | basCrnp.setCreateTime(new Date()); |
| | | basCrnpService.insert(basCrnp); |
| | | basCrnpService.save(basCrnp); |
| | | } |
| | | } |
| | | } |
| | |
| | | log.setStatus(1); |
| | | log.setCreateTime(new Date()); |
| | | log.setSystemStatus(JSON.toJSONString(crnProtocol)); |
| | | errLogService.insert(log); |
| | | errLogService.save(log); |
| | | if (log.getId() != null) { |
| | | redisUtil.set(errFlagKey, log.getId(), 60 * 60 * 24); |
| | | } |
| | |
| | | JSON.toJSONString(response) |
| | | ); |
| | | if (bean != null) { |
| | | bean.insert(basCrnpOpt); |
| | | bean.save(basCrnpOpt); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.*; |
| | |
| | | |
| | | } |
| | | if (basDualCrnpService != null) { |
| | | BasDualCrnp basDualCrnp = basDualCrnpService.selectOne(new EntityWrapper<BasDualCrnp>().eq("crn_no", deviceConfig.getDeviceNo())); |
| | | BasDualCrnp basDualCrnp = basDualCrnpService.getOne(new QueryWrapper<BasDualCrnp>().eq("crn_no", deviceConfig.getDeviceNo())); |
| | | if(basDualCrnp == null) { |
| | | basDualCrnp = new BasDualCrnp(); |
| | | basDualCrnp.setCrnNo(deviceConfig.getDeviceNo()); |
| | |
| | | basDualCrnp.setMaxInTask(5); |
| | | basDualCrnp.setMaxOutTask(5); |
| | | basDualCrnp.setCreateTime(new Date()); |
| | | basDualCrnpService.insert(basDualCrnp); |
| | | basDualCrnpService.save(basDualCrnp); |
| | | } |
| | | } |
| | | } |
| | |
| | | log.setStatus(1); |
| | | log.setCreateTime(new Date()); |
| | | log.setSystemStatus(JSON.toJSONString(crnProtocol)); |
| | | errLogService.insert(log); |
| | | errLogService.save(log); |
| | | if (log.getId() != null) { |
| | | redisUtil.set(errFlagKey, log.getId(), 60 * 60 * 24); |
| | | } |
| | |
| | | JSON.toJSONString(response) |
| | | ); |
| | | if (bean != null) { |
| | | bean.insert(basDualCrnpOpt); |
| | | bean.save(basDualCrnpOpt); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.zy.core.thread.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.service.BasDevpService; |
| | |
| | | } |
| | | |
| | | BasDevp basDevp = basDevpService |
| | | .selectOne(new EntityWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | .getOne(new QueryWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | if (basDevp == null) { |
| | | return; |
| | | } |
| | |
| | | JSON.toJSONString(commandResponse) |
| | | ); |
| | | if (optService != null) { |
| | | optService.insert(basStationOpt); |
| | | optService.save(basStationOpt); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | |
| | | } |
| | | |
| | | BasDevp basDevp = basDevpService |
| | | .selectOne(new EntityWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | .getOne(new QueryWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | if (basDevp == null) { |
| | | return; |
| | | } |
| | |
| | | JSON.toJSONString(commandResponse) |
| | | ); |
| | | if (optService != null) { |
| | | optService.insert(basStationOpt); |
| | | optService.save(basStationOpt); |
| | | } |
| | | } |
| | | return commandResponse; |
| | |
| | | if (deviceConfigService == null) { |
| | | return null; |
| | | } |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig dc : devpList) { |
| | | com.zy.core.thread.StationThread t = (com.zy.core.thread.StationThread) SlaveConnection.get(SlaveType.Devp, dc.getDeviceNo()); |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | |
| | | } |
| | | |
| | | BasDevp basDevp = basDevpService |
| | | .selectOne(new EntityWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | .getOne(new QueryWrapper<BasDevp>().eq("devp_no", deviceConfig.getDeviceNo())); |
| | | if (basDevp == null) { |
| | | return; |
| | | } |
| | |
| | | JSON.toJSONString(commandResponse) |
| | | ); |
| | | if (optService != null) { |
| | | optService.insert(basStationOpt); |
| | | optService.save(basStationOpt); |
| | | } |
| | | } |
| | | return commandResponse; |
| | |
| | | if (deviceConfigService == null) { |
| | | return null; |
| | | } |
| | | List<DeviceConfig> devpList = deviceConfigService.selectList(new EntityWrapper<DeviceConfig>() |
| | | List<DeviceConfig> devpList = deviceConfigService.list(new QueryWrapper<DeviceConfig>() |
| | | .eq("device_type", String.valueOf(SlaveType.Devp))); |
| | | for (DeviceConfig dc : devpList) { |
| | | com.zy.core.thread.StationThread t = (com.zy.core.thread.StationThread) SlaveConnection.get(SlaveType.Devp, dc.getDeviceNo()); |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.domain.param.CreateLocMoveTaskParam; |
| | |
| | | |
| | | //入出库 ===>> 堆垛机入出库作业下发 |
| | | public synchronized void crnIoExecuteNormal() { |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>()); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, basCrnp.getCrnNo()); |
| | | if(crnThread == null){ |
| | |
| | | continue; |
| | | } |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("crn_no", basCrnp.getCrnNo()) |
| | | .in("wrk_sts", WrkStsType.INBOUND_RUN.sts, WrkStsType.OUTBOUND_RUN.sts, WrkStsType.LOC_MOVE_RUN.sts) |
| | | .orderBy("batch_seq", false) |
| | | .orderBy(true, false, "batch_seq") |
| | | ); |
| | | if(!wrkMasts.isEmpty()){ |
| | | continue; |
| | |
| | | } |
| | | |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | LocMast locMast = locMastService.getById(wrkMast.getLocNo()); |
| | | if (locMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "目标库位:{} 信息不存在", wrkMast.getLocNo()); |
| | | continue; |
| | |
| | | |
| | | Integer crnNo = basCrnp.getCrnNo(); |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("crn_no", crnNo) |
| | | .eq("wrk_sts", WrkStsType.NEW_OUTBOUND.sts) |
| | | .orderBy("batch_seq", false) |
| | | .orderBy(true, false, "batch_seq") |
| | | ); |
| | | |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | |
| | | } |
| | | |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | LocMast locMast = locMastService.getById(wrkMast.getSourceLocNo()); |
| | | if (locMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "源库位:{} 信息不存在", wrkMast.getSourceLocNo()); |
| | | continue; |
| | |
| | | } |
| | | |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | LocMast locMast = locMastService.getById(wrkMast.getLocNo()); |
| | | if (locMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "目标库位:{} 信息不存在", wrkMast.getLocNo()); |
| | | continue; |
| | |
| | | } |
| | | |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | LocMast locMast = locMastService.getById(wrkMast.getSourceLocNo()); |
| | | if (locMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "源库位:{} 信息不存在", wrkMast.getSourceLocNo()); |
| | | continue; |
| | |
| | | |
| | | Integer crnNo = basCrnp.getCrnNo(); |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("crn_no", crnNo) |
| | | .eq("wrk_sts", WrkStsType.NEW_LOC_MOVE.sts) |
| | | ); |
| | | |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | // 获取源库位信息 |
| | | LocMast sourceLocMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | LocMast sourceLocMast = locMastService.getById(wrkMast.getSourceLocNo()); |
| | | if (sourceLocMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "源库位:{} 信息不存在", wrkMast.getSourceLocNo()); |
| | | continue; |
| | |
| | | } |
| | | |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | LocMast locMast = locMastService.getById(wrkMast.getLocNo()); |
| | | if (locMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "库位:{} 信息不存在", wrkMast.getLocNo()); |
| | | continue; |
| | |
| | | |
| | | //堆垛机任务执行完成 |
| | | public synchronized void crnIoExecuteFinish() { |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>()); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, basCrnp.getCrnNo()); |
| | | if(crnThread == null){ |
| | |
| | | |
| | | public synchronized void plannerExecute() { |
| | | int nowSec = (int) (System.currentTimeMillis() / 1000); |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasCrnp> basCrnps = basCrnpService.list(new QueryWrapper<>()); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | String key = RedisKeyType.PLANNER_SCHEDULE.key + "CRN-" + basCrnp.getCrnNo(); |
| | | List<Object> items = redisUtil.lGet(key, 0, -1); |
| | |
| | | if (crnProtocol == null) { |
| | | continue; |
| | | } |
| | | List<WrkMast> running = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> running = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("crn_no", basCrnp.getCrnNo()) |
| | | .in("wrk_sts", WrkStsType.INBOUND_RUN.sts, WrkStsType.OUTBOUND_RUN.sts, WrkStsType.LOC_MOVE_RUN.sts) |
| | | ); |
| | |
| | | } |
| | | |
| | | // 获取源库位信息 |
| | | LocMast sourceLocMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | LocMast sourceLocMast = locMastService.getById(wrkMast.getSourceLocNo()); |
| | | if (sourceLocMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "源库位:{} 信息不存在", wrkMast.getSourceLocNo()); |
| | | return false; |
| | |
| | | } |
| | | |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | LocMast locMast = locMastService.getById(wrkMast.getLocNo()); |
| | | if (locMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "库位:{} 信息不存在", wrkMast.getLocNo()); |
| | | return false; |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | | import com.zy.asrs.domain.param.CreateLocMoveTaskParam; |
| | |
| | | |
| | | //入出库 ===>> 双工位堆垛机入出库作业下发 |
| | | public synchronized void dualCrnIoExecute() { |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.list(new QueryWrapper<>()); |
| | | for (BasDualCrnp basDualCrnp : basDualCrnps) { |
| | | DualCrnThread dualCrnThread = (DualCrnThread) SlaveConnection.get(SlaveType.DualCrn, basDualCrnp.getCrnNo()); |
| | | if(dualCrnThread == null){ |
| | |
| | | continue; |
| | | } |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("dual_crn_no", basDualCrnp.getCrnNo()) |
| | | .in("wrk_sts", WrkStsType.INBOUND_RUN.sts, WrkStsType.OUTBOUND_RUN.sts, WrkStsType.LOC_MOVE_RUN.sts) |
| | | ); |
| | |
| | | } |
| | | } |
| | | |
| | | if (taskList.isEmpty()) { |
| | | return list; |
| | | } |
| | | |
| | | // 获取任务 |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("dual_crn_no", basDualCrnp.getCrnNo()) |
| | | .in("wrk_no", taskList) |
| | | ); |
| | |
| | | return list; |
| | | } |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("dual_crn_no", basDualCrnp.getCrnNo()) |
| | | .eq("wrk_sts", WrkStsType.NEW_OUTBOUND.sts) |
| | | ); |
| | |
| | | |
| | | private List<WrkMast> getLocMoveTaskList(BasDualCrnp basDualCrnp) { |
| | | List<WrkMast> list = new ArrayList<>(); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("dual_crn_no", basDualCrnp.getCrnNo()) |
| | | .eq("wrk_sts", WrkStsType.NEW_LOC_MOVE.sts) |
| | | ); |
| | |
| | | } |
| | | |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | LocMast locMast = locMastService.getById(wrkMast.getLocNo()); |
| | | if (locMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "目标库位:{} 信息不存在", wrkMast.getLocNo()); |
| | | return null; |
| | |
| | | } |
| | | |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | LocMast locMast = locMastService.getById(wrkMast.getSourceLocNo()); |
| | | if (locMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "源库位:{} 信息不存在", wrkMast.getSourceLocNo()); |
| | | continue; |
| | |
| | | Integer crnNo = basDualCrnp.getCrnNo(); |
| | | |
| | | // 获取源库位信息 |
| | | LocMast sourceLocMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | LocMast sourceLocMast = locMastService.getById(wrkMast.getSourceLocNo()); |
| | | if (sourceLocMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "源库位:{} 信息不存在", wrkMast.getSourceLocNo()); |
| | | return null; |
| | |
| | | } |
| | | |
| | | // 获取库位信息 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | LocMast locMast = locMastService.getById(wrkMast.getLocNo()); |
| | | if (locMast == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "库位:{} 信息不存在", wrkMast.getLocNo()); |
| | | return null; |
| | |
| | | |
| | | //双工位堆垛机任务执行完成 |
| | | public synchronized void dualCrnIoExecuteFinish() { |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.selectList(new EntityWrapper<>()); |
| | | List<BasDualCrnp> basDualCrnps = basDualCrnpService.list(new QueryWrapper<>()); |
| | | for (BasDualCrnp basDualCrnp : basDualCrnps) { |
| | | DualCrnThread dualCrnThread = (DualCrnThread) SlaveConnection.get(SlaveType.DualCrn, basDualCrnp.getCrnNo()); |
| | | if(dualCrnThread == null){ |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.serializer.SerializerFeature; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.NotifyMsgType; |
| | |
| | | int[] currentStationTaskCountRef = new int[]{countCurrentStationTask()}; |
| | | LoadGuardState loadGuardState = buildLoadGuardState(limitConfig); |
| | | |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | |
| | | && stationProtocol.getTaskNo() > 0 |
| | | ) { |
| | | //检测任务是否生成 |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", stationProtocol.getBarcode())); |
| | | WrkMast wrkMast = wrkMastService.getOne(new QueryWrapper<WrkMast>().eq("barcode", stationProtocol.getBarcode())); |
| | | if (wrkMast == null) { |
| | | continue; |
| | | } |
| | |
| | | int[] currentStationTaskCountRef = new int[]{countCurrentStationTask()}; |
| | | LoadGuardState loadGuardState = buildLoadGuardState(limitConfig); |
| | | |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("wrk_sts", WrkStsType.OUTBOUND_RUN_COMPLETE.sts) |
| | | .isNotNull("crn_no") |
| | | ); |
| | |
| | | //执行双工位堆垛机输送站点出库任务 |
| | | public synchronized void dualCrnStationOutExecute() { |
| | | try { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .eq("wrk_sts", WrkStsType.OUTBOUND_RUN_COMPLETE.sts) |
| | | .isNotNull("dual_crn_no") |
| | | ); |
| | |
| | | //检测输送站点出库任务执行完成 |
| | | public synchronized void stationOutExecuteFinish() { |
| | | try { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.STATION_RUN.sts)); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>().eq("wrk_sts", WrkStsType.STATION_RUN.sts)); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | Integer wrkNo = wrkMast.getWrkNo(); |
| | | Integer targetStaNo = wrkMast.getStaNo(); |
| | | |
| | | boolean complete = false; |
| | | BasStation basStation = basStationService.selectOne(new EntityWrapper<BasStation>().eq("station_id", targetStaNo)); |
| | | BasStation basStation = basStationService.getOne(new QueryWrapper<BasStation>().eq("station_id", targetStaNo)); |
| | | if (basStation == null) { |
| | | continue; |
| | | } |
| | |
| | | // 检测任务转完成 |
| | | public synchronized void checkTaskToComplete() { |
| | | try { |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.STATION_RUN_COMPLETE.sts)); |
| | | List<WrkMast> wrkMasts = wrkMastService.list(new QueryWrapper<WrkMast>().eq("wrk_sts", WrkStsType.STATION_RUN_COMPLETE.sts)); |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | Integer wrkNo = wrkMast.getWrkNo(); |
| | | Integer targetStaNo = wrkMast.getStaNo(); |
| | |
| | | } |
| | | |
| | | boolean complete = false; |
| | | BasStation basStation = basStationService.selectOne(new EntityWrapper<BasStation>().eq("station_id", targetStaNo)); |
| | | BasStation basStation = basStationService.getOne(new QueryWrapper<BasStation>().eq("station_id", targetStaNo)); |
| | | if (basStation == null) { |
| | | continue; |
| | | } |
| | |
| | | //检测输送站点是否运行堵塞 |
| | | public synchronized void checkStationRunBlock() { |
| | | try { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | |
| | | |
| | | // 检测出库排序 |
| | | public synchronized void checkStationOutOrder() { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<BasDevp>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<BasDevp>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getId()); |
| | | if (stationThread == null) { |
| | |
| | | continue; |
| | | } |
| | | |
| | | List<WrkMast> batchWrkList = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | List<WrkMast> batchWrkList = wrkMastService.list(new QueryWrapper<WrkMast>() |
| | | .notIn("wrk_sts", WrkStsType.STATION_RUN_COMPLETE.sts, WrkStsType.COMPLETE_OUTBOUND.sts) |
| | | .eq("batch", wrkMast.getBatch()) |
| | | .orderBy("batch") |
| | | .orderBy(true, true, "batch") |
| | | ); |
| | | if (batchWrkList.isEmpty()) { |
| | | continue; |
| | |
| | | |
| | | // 监控绕圈站点 |
| | | public synchronized void watchCircleStation() { |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<BasDevp>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<BasDevp>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getId()); |
| | | if (stationThread == null) { |
| | |
| | | |
| | | public List<Integer> getAllOutOrderList() { |
| | | List<Integer> list = new ArrayList<>(); |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<BasDevp>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<BasDevp>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | List<Integer> orderList = basDevp.getOutOrderIntList(); |
| | | list.addAll(orderList); |
| | |
| | | |
| | | HashMap<String, Integer> batchMap = new HashMap<>(); |
| | | for (Integer station : checkList) { |
| | | BasStation basStation = basStationService.selectOne(new EntityWrapper<BasStation>().eq("station_id", station)); |
| | | BasStation basStation = basStationService.getOne(new QueryWrapper<BasStation>().eq("station_id", station)); |
| | | if (basStation == null) { |
| | | continue; |
| | | } |
| | |
| | | |
| | | private int countCurrentStationTask() { |
| | | int currentStationTaskCount = 0; |
| | | List<BasDevp> basDevps = basDevpService.selectList(new EntityWrapper<BasDevp>()); |
| | | List<BasDevp> basDevps = basDevpService.list(new QueryWrapper<BasDevp>()); |
| | | for (BasDevp basDevp : basDevps) { |
| | | StationThread stationThread = (StationThread) SlaveConnection.get(SlaveType.Devp, basDevp.getDevpNo()); |
| | | if (stationThread == null) { |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | |
| | | int result = 0; |
| | | try { |
| | | BasStation basStation = basStationService |
| | | .selectOne(new EntityWrapper<BasStation>().eq("station_id", sourceStaNo)); |
| | | .getOne(new QueryWrapper<BasStation>().eq("station_id", sourceStaNo)); |
| | | if (basStation == null) { |
| | | News.error("站点{}不存在", sourceStaNo); |
| | | return null; |
| | |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLog.setResult(result); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | httpRequestLogService.save(httpRequestLog); |
| | | } |
| | | return response; |
| | | } |
| | |
| | | // 申请任务重新分配库位 |
| | | public synchronized String applyReassignTaskLocNo(Integer taskNo, Integer stationId) { |
| | | String wmsUrl = null; |
| | | Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri")); |
| | | Config wmsSystemUriConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsSystemUri")); |
| | | if (wmsSystemUriConfig != null) { |
| | | wmsUrl = wmsSystemUriConfig.getValue(); |
| | | } |
| | |
| | | |
| | | String wmsSystemReassignInTaskUrl = null; |
| | | Config wmsSystemReassignInTaskUrlConfig = configService |
| | | .selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemReassignInTaskUrl")); |
| | | .getOne(new QueryWrapper<Config>().eq("code", "wmsSystemReassignInTaskUrl")); |
| | | if (wmsSystemReassignInTaskUrlConfig != null) { |
| | | wmsSystemReassignInTaskUrl = wmsSystemReassignInTaskUrlConfig.getValue(); |
| | | } |
| | |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLog.setResult(result); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | httpRequestLogService.save(httpRequestLog); |
| | | } |
| | | return response; |
| | | } |
| | |
| | | // 申请在库库位更换库位 |
| | | public synchronized String applyChangeLocNo(String locNo) { |
| | | String wmsUrl = null; |
| | | Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri")); |
| | | Config wmsSystemUriConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsSystemUri")); |
| | | if (wmsSystemUriConfig != null) { |
| | | wmsUrl = wmsSystemUriConfig.getValue(); |
| | | } |
| | |
| | | |
| | | String wmsSystemChangeLocNoUrl = null; |
| | | Config wmsSystemChangeLocNoUrlConfig = configService |
| | | .selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemChangeLocNoUrl")); |
| | | .getOne(new QueryWrapper<Config>().eq("code", "wmsSystemChangeLocNoUrl")); |
| | | if (wmsSystemChangeLocNoUrlConfig != null) { |
| | | wmsSystemChangeLocNoUrl = wmsSystemChangeLocNoUrlConfig.getValue(); |
| | | } |
| | |
| | | List<Integer> crnRows = new ArrayList<>(); |
| | | |
| | | if (findCrnNoResult.getCrnType().equals(SlaveType.Crn)) { |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", crnNo)); |
| | | BasCrnp basCrnp = basCrnpService.getOne(new QueryWrapper<BasCrnp>().eq("crn_no", crnNo)); |
| | | if (basCrnp == null) { |
| | | return null; |
| | | } |
| | |
| | | } |
| | | } else if (findCrnNoResult.getCrnType().equals(SlaveType.DualCrn)) { |
| | | BasDualCrnp basDualCrnp = basDualCrnpService |
| | | .selectOne(new EntityWrapper<BasDualCrnp>().eq("crn_no", crnNo)); |
| | | .getOne(new QueryWrapper<BasDualCrnp>().eq("crn_no", crnNo)); |
| | | if (basDualCrnp == null) { |
| | | return null; |
| | | } |
| | |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLog.setResult(result); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | httpRequestLogService.save(httpRequestLog); |
| | | } |
| | | return response; |
| | | } |
| | |
| | | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import jakarta.annotation.PostConstruct; |
| | | import javax.sql.DataSource; |
| | | import java.sql.Connection; |
| | | import java.sql.DatabaseMetaData; |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/api/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(apiService.selectById(String.valueOf(id))); |
| | | return R.ok(apiService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/api/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Api> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Api> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(apiService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(apiService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == api.getId()){ |
| | | apiService.insert(api); |
| | | apiService.save(api); |
| | | } else { |
| | | apiService.updateById(api); |
| | | } |
| | |
| | | @RequestMapping(value = "/api/add/auth") |
| | | @ManagerAuth |
| | | public R add(Api api) { |
| | | apiService.insert(api); |
| | | apiService.save(api); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | apiService.deleteBatchIds(Arrays.asList(ids)); |
| | | apiService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Api> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Api> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("api")); |
| | | convert(map, wrapper); |
| | | List<Api> list = apiService.selectList(wrapper); |
| | | List<Api> list = apiService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/apiQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Api> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Api> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<Api> page = apiService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Api> page = apiService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Api api : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @ManagerAuth |
| | | public R refreshCache(){ |
| | | HashMap<String, String> systemConfigMap = new HashMap<>(); |
| | | List<Config> configList = configService.selectList(new EntityWrapper<>()); |
| | | List<Config> configList = configService.list(new QueryWrapper<>()); |
| | | for (Config config : configList) { |
| | | systemConfigMap.put(config.getCode(), config.getValue()); |
| | | } |
| | |
| | | @RequestMapping(value = "/config/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(configService.selectById(String.valueOf(id))); |
| | | return R.ok(configService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/config/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Config> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(configService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(configService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/config/listAll/auth") |
| | | @ManagerAuth |
| | | public R listAll(){ |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(configService.selectList(wrapper)); |
| | | QueryWrapper<Config> wrapper = new QueryWrapper<>(); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(configService.list(wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | for (ConfigUpdateBatchParam param : params) { |
| | | String code = param.getCode(); |
| | | String value = param.getValue(); |
| | | Config config = configService.selectOne(new EntityWrapper<Config>().eq("code", code)); |
| | | Config config = configService.getOne(new QueryWrapper<Config>().eq("code", code)); |
| | | if (config == null) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | } |
| | | if (null == config.getId()){ |
| | | configService.insert(config); |
| | | configService.save(config); |
| | | } else { |
| | | configService.updateById(config); |
| | | Parameter.reset(); |
| | |
| | | return R.error("json解析失败"); |
| | | } |
| | | } |
| | | configService.insert(config); |
| | | configService.save(config); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | configService.deleteBatchIds(Arrays.asList(ids)); |
| | | configService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Config> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("config")); |
| | | convert(map, wrapper); |
| | | List<Config> list = configService.selectList(wrapper); |
| | | List<Config> list = configService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/configQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Config> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<Config> page = configService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Config> page = configService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Config config : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | @RequestMapping(value = "/config/getSelectTypes") |
| | | @ManagerAuth |
| | | public R getSelectTypes() { |
| | | EntityWrapper<Config> wrapper = new EntityWrapper<>(); |
| | | wrapper.setSqlSelect("DISTINCT select_type as selectType"); |
| | | QueryWrapper<Config> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("DISTINCT select_type as selectType"); |
| | | wrapper.isNotNull("select_type"); |
| | | List<Map<String, Object>> maps = configService.selectMaps(wrapper); |
| | | List<Map<String, Object>> maps = configService.listMaps(wrapper); |
| | | List<String> types = new ArrayList<>(); |
| | | for (Map<String, Object> map : maps) { |
| | | if (map != null && map.get("selectType") != null) { |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Arith; |
| | | import com.core.common.R; |
| | |
| | | @RequestMapping("/top") |
| | | @ManagerAuth |
| | | public R top(){ |
| | | int logTotal = operateLogService.selectCount(new EntityWrapper<>()); |
| | | long logTotal = operateLogService.count(new QueryWrapper<>()); |
| | | int logWeek = operateLogService.selectCountByCurrentWeek(); |
| | | int userTotal = userService.selectCount(new EntityWrapper<>()); |
| | | long userTotal = userService.count(new QueryWrapper<>()); |
| | | int loginWeek = userLoginService.selectCountByCurrentWeek(); |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/host/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(hostService.selectById(String.valueOf(id))); |
| | | return R.ok(hostService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/host/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Host> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Host> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(hostService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(hostService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == host.getId()){ |
| | | hostService.insert(host); |
| | | hostService.save(host); |
| | | } else { |
| | | hostService.updateById(host); |
| | | } |
| | |
| | | @RequestMapping(value = "/host/add/auth") |
| | | @ManagerAuth |
| | | public R add(Host host) { |
| | | hostService.insert(host); |
| | | hostService.save(host); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | hostService.deleteBatchIds(Arrays.asList(ids)); |
| | | hostService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Host> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Host> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("host")); |
| | | convert(map, wrapper); |
| | | List<Host> list = hostService.selectList(wrapper); |
| | | List<Host> list = hostService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/hostQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Host> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Host> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("name", condition); |
| | | Page<Host> page = hostService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Host> page = hostService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Host host : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | licenseInfos.setLicenseTime(formatLicenseTime(install)); |
| | | licenseInfos.setRequestCode(LicenseUtils.buildRequestCode(licenseSubject)); |
| | | licenseInfos.setCreateTime(new Date()); |
| | | if (!licenseInfosService.insert(licenseInfos)) { |
| | | if (!licenseInfosService.save(licenseInfos)) { |
| | | return R.error("许可证保存失败"); |
| | | } |
| | | |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/operateLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(operateLogService.selectById(String.valueOf(id))); |
| | | return R.ok(operateLogService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/operateLog/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<OperateLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<OperateLog> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(operateLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(operateLogService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == operateLog.getId()){ |
| | | operateLogService.insert(operateLog); |
| | | operateLogService.save(operateLog); |
| | | } else { |
| | | operateLogService.updateById(operateLog); |
| | | } |
| | |
| | | @RequestMapping(value = "/operateLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(OperateLog operateLog) { |
| | | operateLogService.insert(operateLog); |
| | | operateLogService.save(operateLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | operateLogService.deleteBatchIds(Arrays.asList(ids)); |
| | | operateLogService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<OperateLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<OperateLog> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("operateLog")); |
| | | convert(map, wrapper); |
| | | List<OperateLog> list = operateLogService.selectList(wrapper); |
| | | List<OperateLog> list = operateLogService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/operateLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<OperateLog> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<OperateLog> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<OperateLog> page = operateLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<OperateLog> page = operateLogService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (OperateLog operateLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/permission/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(permissionService.selectById(String.valueOf(id))); |
| | | return R.ok(permissionService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/permission/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Permission> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Permission> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(permissionService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(permissionService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == permission.getId()){ |
| | | permissionService.insert(permission); |
| | | permissionService.save(permission); |
| | | } else { |
| | | permissionService.updateById(permission); |
| | | } |
| | |
| | | @RequestMapping(value = "/permission/add/auth") |
| | | @ManagerAuth |
| | | public R add(Permission permission) { |
| | | permissionService.insert(permission); |
| | | permissionService.save(permission); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | permissionService.deleteBatchIds(Arrays.asList(ids)); |
| | | permissionService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Permission> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Permission> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("permission")); |
| | | convert(map, wrapper); |
| | | List<Permission> list = permissionService.selectList(wrapper); |
| | | List<Permission> list = permissionService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/permissionQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Permission> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Permission> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("name", condition); |
| | | Page<Permission> page = permissionService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Permission> page = permissionService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Permission permission : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.zy.common.i18n.I18nMessageService; |
| | | import com.zy.system.entity.Resource; |
| | | import com.zy.system.service.ResourceService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | @Autowired |
| | | private ResourceService resourceService; |
| | | @Autowired |
| | | private I18nMessageService i18nMessageService; |
| | | |
| | | @RequestMapping(value = "/resource/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(resourceService.selectById(String.valueOf(id))); |
| | | return R.ok(resourceService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/resource/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Resource> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Resource> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(resourceService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(resourceService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | if (resource.getSort() == null){ |
| | | resource.setSort(999); |
| | | } |
| | | resourceService.insert(resource); |
| | | resourceService.save(resource); |
| | | } else { |
| | | resourceService.updateById(resource); |
| | | } |
| | |
| | | @RequestMapping(value = "/resource/add/auth") |
| | | @ManagerAuth(memo = "菜单添加") |
| | | public R add(Resource resource) { |
| | | resourceService.insert(resource); |
| | | resourceService.save(resource); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth(memo = "菜单删除") |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | resourceService.deleteById(id); |
| | | resourceService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth(memo = "菜单导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Resource> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Resource> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("resource")); |
| | | convert(map, wrapper); |
| | | List<Resource> list = resourceService.selectList(wrapper); |
| | | List<Resource> list = resourceService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/resourceQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Resource> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Resource> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("name", condition); |
| | | Page<Resource> page = resourceService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Resource> page = resourceService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Resource resource : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", resource.getId()); |
| | | map.put("value", resource.getName().concat("(").concat(resource.getLevel$().substring(0, 2).concat(")"))); |
| | | String levelText = i18nMessageService.translateLegacy(Cools.isEmpty(resource.getLevel$()) ? "" : resource.getLevel$()); |
| | | String localizedName = i18nMessageService.resolveResourceText(resource.getName(), resource.getCode(), resource.getId()); |
| | | String shortLevelText = levelText.matches(".*[\\u4E00-\\u9FA5].*") |
| | | ? levelText.substring(0, Math.min(2, levelText.length())) |
| | | : levelText; |
| | | map.put("value", localizedName.concat("(").concat(shortLevelText).concat(")")); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<Resource> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Resource> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | else { |
| | | wrapper.orderBy("sort"); |
| | | wrapper.orderBy(true, true, "sort"); |
| | | } |
| | | return R.parse("0-操作成功").add(resourceService.selectList(wrapper)); |
| | | List<Resource> resources = resourceService.list(wrapper); |
| | | for (Resource resource : resources) { |
| | | resource.setName(i18nMessageService.resolveResourceText(resource.getName(), resource.getCode(), resource.getId())); |
| | | } |
| | | return R.parse("0-操作成功").add(resources); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/role/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(roleService.selectById(String.valueOf(id))); |
| | | return R.ok(roleService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/role/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Role> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Role> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | wrapper.orderBy(true, false, "id"); |
| | | |
| | | if (9527 == getUserId()) { |
| | | return R.ok(roleService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(roleService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | Long roleId = getUser().getRoleId(); |
| | | Role role = roleService.selectById(roleId); |
| | | Role role = roleService.getById(roleId); |
| | | Long leaderId = role.getLeader(); |
| | | if (null != leaderId) { |
| | | List<Long> leaderIds = new ArrayList<>(); |
| | | leaderIds.add(roleId); |
| | | while (leaderId != null) { |
| | | Role leader = roleService.selectById(leaderId); |
| | | Role leader = roleService.getById(leaderId); |
| | | leaderIds.add(leader.getId()); |
| | | leaderId = leader.getLeader(); |
| | | } |
| | |
| | | // if (null != role.getLevel()) { |
| | | // wrapper.gt("level", role.getLevel()); |
| | | // } |
| | | return R.ok(roleService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(roleService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == role.getId()){ |
| | | roleService.insert(role); |
| | | roleService.save(role); |
| | | } else { |
| | | roleService.updateById(role); |
| | | } |
| | |
| | | @RequestMapping(value = "/role/add/auth") |
| | | @ManagerAuth(memo = "角色添加") |
| | | public R add(Role role) { |
| | | roleService.insert(role); |
| | | roleService.save(role); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | roleService.deleteBatchIds(Arrays.asList(ids)); |
| | | roleService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth(memo = "角色导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<Role> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Role> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("role")); |
| | | convert(map, wrapper); |
| | | List<Role> list = roleService.selectList(wrapper); |
| | | List<Role> list = roleService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/roleQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Role> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<Role> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("name", condition); |
| | | // 上下级管理 |
| | | if (9527 != getUserId()) { |
| | | Long roleId = getUser().getRoleId(); |
| | | Role role = roleService.selectById(roleId); |
| | | Role role = roleService.getById(roleId); |
| | | Long leaderId = role.getLeader(); |
| | | if (null != leaderId) { |
| | | List<Long> leaderIds = new ArrayList<>(); |
| | | while (leaderId != null) { |
| | | Role leader = roleService.selectById(leaderId); |
| | | Role leader = roleService.getById(leaderId); |
| | | leaderIds.add(leader.getId()); |
| | | leaderId = leader.getLeader(); |
| | | } |
| | |
| | | // } |
| | | } |
| | | |
| | | Page<Role> page = roleService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<Role> page = roleService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Role role : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/user/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(userService.selectById(String.valueOf(id))); |
| | | return R.ok(userService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/user/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<User> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<User> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | wrapper.orderBy(true, false, "id"); |
| | | if (9527 == getUserId()) { |
| | | return R.ok(userService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(userService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | Long roleId = getUser().getRoleId(); |
| | | Role role = roleService.selectById(roleId); |
| | | Role role = roleService.getById(roleId); |
| | | Long leaderId = role.getLeader(); |
| | | if (null != leaderId) { |
| | | List<Long> leaderIds = new ArrayList<>(); |
| | | leaderIds.add(role.getId()); |
| | | while (leaderId != null) { |
| | | Role leader = roleService.selectById(leaderId); |
| | | Role leader = roleService.getById(leaderId); |
| | | leaderIds.add(leader.getId()); |
| | | leaderId = leader.getLeader(); |
| | | } |
| | | wrapper.notIn("role_id", leaderIds); |
| | | } |
| | | |
| | | return R.ok(userService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | return R.ok(userService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == user.getId()){ |
| | | userService.insert(user); |
| | | userService.save(user); |
| | | } else { |
| | | userService.updateById(user); |
| | | } |
| | |
| | | @RequestMapping(value = "/user/add/auth") |
| | | @ManagerAuth(memo = "系统用户添加") |
| | | public R add(User user) { |
| | | userService.insert(user); |
| | | userService.save(user); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(user) || null==user.getId()){ |
| | | return R.error(); |
| | | } |
| | | User entity = userService.selectById(user.getId()); |
| | | User entity = userService.getById(user.getId()); |
| | | if (user.getPassword()!=null) { |
| | | entity.setPassword(user.getPassword()); |
| | | } |
| | |
| | | @ManagerAuth(memo = "系统用户删除") |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | userService.deleteById(id); |
| | | userService.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | @ManagerAuth(memo = "系统用户导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<User> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<User> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("user")); |
| | | convert(map, wrapper); |
| | | List<User> list = userService.selectList(wrapper); |
| | | List<User> list = userService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/userQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<User> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<User> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("username", condition); |
| | | Page<User> page = userService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<User> page = userService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (User user : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | package com.zy.system.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | |
| | | @RequestMapping(value = "/userLogin/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(userLoginService.selectById(String.valueOf(id))); |
| | | return R.ok(userLoginService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/userLogin/list/auth") |
| | |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<UserLogin> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<UserLogin> wrapper = new QueryWrapper<>(); |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("id", false); |
| | | return R.ok(userLoginService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | wrapper.orderBy(true, false, "id"); |
| | | return R.ok(userLoginService.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private void convert(Map<String, Object> map, QueryWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == userLogin.getId()){ |
| | | userLoginService.insert(userLogin); |
| | | userLoginService.save(userLogin); |
| | | } else { |
| | | userLoginService.updateById(userLogin); |
| | | } |
| | |
| | | @RequestMapping(value = "/userLogin/add/auth") |
| | | @ManagerAuth |
| | | public R add(UserLogin userLogin) { |
| | | userLoginService.insert(userLogin); |
| | | userLoginService.save(userLogin); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Cools.isEmpty(ids)){ |
| | | return R.error(); |
| | | } |
| | | userLoginService.deleteBatchIds(Arrays.asList(ids)); |
| | | userLoginService.removeByIds(Arrays.asList(ids)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<UserLogin> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<UserLogin> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("userLogin")); |
| | | convert(map, wrapper); |
| | | List<UserLogin> list = userLoginService.selectList(wrapper); |
| | | List<UserLogin> list = userLoginService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/userLoginQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<UserLogin> wrapper = new EntityWrapper<>(); |
| | | QueryWrapper<UserLogin> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("token", condition); |
| | | Page<UserLogin> page = userLoginService.selectPage(new Page<>(0, 10), wrapper); |
| | | Page<UserLogin> page = userLoginService.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (UserLogin userLogin : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | |
| | | |
| | | public String getUserId$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.userId); |
| | | User user = service.getById(this.userId); |
| | | if (!Cools.isEmpty(user)){ |
| | | return user.getUsername(); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.ResourceService; |
| | |
| | | |
| | | public String getResourceName(){ |
| | | ResourceService service = SpringUtils.getBean(ResourceService.class); |
| | | Resource resource = service.selectById(this.resourceId); |
| | | Resource resource = service.getById(this.resourceId); |
| | | if (!Cools.isEmpty(resource)){ |
| | | return resource.getName(); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.ResourceService; |
| | |
| | | |
| | | public String getResourceName(){ |
| | | ResourceService service = SpringUtils.getBean(ResourceService.class); |
| | | Resource resource = service.selectById(this.resourceId); |
| | | Resource resource = service.getById(this.resourceId); |
| | | if (!Cools.isEmpty(resource)){ |
| | | return resource.getName(); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.RoleService; |
| | |
| | | |
| | | public String getLeader$(){ |
| | | RoleService service = SpringUtils.getBean(RoleService.class); |
| | | Role role = service.selectById(this.leader); |
| | | Role role = service.getById(this.leader); |
| | | if (!Cools.isEmpty(role)){ |
| | | return String.valueOf(role.getName()); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.PermissionService; |
| | |
| | | |
| | | public String getRoleName(){ |
| | | RoleService service = SpringUtils.getBean(RoleService.class); |
| | | Role role = service.selectById(this.roleId); |
| | | Role role = service.getById(this.roleId); |
| | | if (!Cools.isEmpty(role)){ |
| | | return role.getName(); |
| | | } |
| | |
| | | |
| | | public String getPermissionName(){ |
| | | PermissionService service = SpringUtils.getBean(PermissionService.class); |
| | | Permission permission = service.selectById(this.permissionId); |
| | | Permission permission = service.getById(this.permissionId); |
| | | if (!Cools.isEmpty(permission)){ |
| | | return permission.getName(); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.HostService; |
| | |
| | | |
| | | public String getHostName() { |
| | | HostService service = SpringUtils.getBean(HostService.class); |
| | | Host host = service.selectById(this.hostId); |
| | | Host host = service.getById(this.hostId); |
| | | if (!Cools.isEmpty(host)){ |
| | | return host.getName(); |
| | | } |
| | |
| | | |
| | | public String getRoleName(){ |
| | | RoleService service = SpringUtils.getBean(RoleService.class); |
| | | Role role = service.selectById(this.roleId); |
| | | Role role = service.getById(this.roleId); |
| | | if (!Cools.isEmpty(role)){ |
| | | return role.getName(); |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | |
| | | |
| | | public String getUserUsername(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.userId); |
| | | User user = service.getById(this.userId); |
| | | if (!Cools.isEmpty(user)){ |
| | | return user.getUsername(); |
| | | } |
| | |
| | | licenseInfos.setLicenseTime(formatLicenseTime(install)); |
| | | licenseInfos.setRequestCode(requestCode); |
| | | licenseInfos.setCreateTime(new Date()); |
| | | licenseInfosService.insert(licenseInfos); |
| | | licenseInfosService.save(licenseInfos); |
| | | } catch (Exception ignored) { |
| | | } |
| | | } |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Api; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Config; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Host; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.zy.system.entity.LicenseInfos; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.OperateLog; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Permission; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Resource; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Role; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.RolePermission; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.Resource; |
| | | import com.zy.system.entity.RoleResource; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.UserLogin; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | package com.zy.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.zy.system.entity.User; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Api; |
| | | |
| | | public interface ApiService extends IService<Api> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Config; |
| | | |
| | | public interface ConfigService extends IService<Config> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Host; |
| | | |
| | | public interface HostService extends IService<Host> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.zy.system.entity.LicenseInfos; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface LicenseInfosService extends IService<LicenseInfos> { |
| | | |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.OperateLog; |
| | | |
| | | import java.util.List; |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Permission; |
| | | |
| | | public interface PermissionService extends IService<Permission> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Resource; |
| | | |
| | | public interface ResourceService extends IService<Resource> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.RolePermission; |
| | | |
| | | public interface RolePermissionService extends IService<RolePermission> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Resource; |
| | | import com.zy.system.entity.RoleResource; |
| | | |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.Role; |
| | | |
| | | public interface RoleService extends IService<Role> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.UserLogin; |
| | | |
| | | public interface UserLoginService extends IService<UserLogin> { |
| | |
| | | package com.zy.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.system.entity.User; |
| | | |
| | | public interface UserService extends IService<User> { |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Api; |
| | | import com.zy.system.mapper.ApiMapper; |
| | | import com.zy.system.service.ApiService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.mapper.ConfigMapper; |
| | | import com.zy.system.service.ConfigService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Host; |
| | | import com.zy.system.mapper.HostMapper; |
| | | import com.zy.system.service.HostService; |
| | |
| | | import com.zy.system.mapper.LicenseInfosMapper; |
| | | import com.zy.system.entity.LicenseInfos; |
| | | import com.zy.system.service.LicenseInfosService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("licenseInfosService") |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.zy.system.entity.OperateLog; |
| | | import com.zy.system.mapper.OperateLogMapper; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Permission; |
| | | import com.zy.system.mapper.PermissionMapper; |
| | | import com.zy.system.service.PermissionService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Resource; |
| | | import com.zy.system.mapper.ResourceMapper; |
| | | import com.zy.system.service.ResourceService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.RolePermission; |
| | | import com.zy.system.mapper.RolePermissionMapper; |
| | | import com.zy.system.service.RolePermissionService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Resource; |
| | | import com.zy.system.entity.RoleResource; |
| | | import com.zy.system.mapper.RoleResourceMapper; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.Role; |
| | | import com.zy.system.mapper.RoleMapper; |
| | | import com.zy.system.service.RoleService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.UserLogin; |
| | | import com.zy.system.mapper.UserLoginMapper; |
| | | import com.zy.system.service.UserLoginService; |
| | |
| | | package com.zy.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.mapper.UserMapper; |
| | | import com.zy.system.service.UserService; |
| | |
| | | licenseInfos.setCreateTime(new Date()); |
| | | licenseInfos.setLicenseTime(response.getString("licenseTime")); |
| | | licenseInfos.setRequestCode(requestCode); |
| | | licenseInfosService.insert(licenseInfos); |
| | | licenseInfosService.save(licenseInfos); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| New file |
| | |
| | | org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.core.config.CoolBaseConfig |
| | |
| | | # 系统版本信息 |
| | | app: |
| | | version: 1.0.5.2 |
| | | version: 3.0.0.0 |
| | | version-type: dev # prd 或 dev |
| | | i18n: |
| | | default-locale: zh-CN |
| | | supported-locales: |
| | | - zh-CN |
| | | - en-US |
| | | # 内置语言包读取位置:classpath:/i18n/<locale>/*.properties |
| | | # 外置可安装语言包覆盖目录:./stock/out/@pom.build.finalName@/i18n/<locale>/*.properties |
| | | pack-path: ./stock/out/@pom.build.finalName@/i18n |
| | | # 外置语言包热加载检查周期(秒) |
| | | refresh-seconds: 10 |
| | | |
| | | server: |
| | | port: 9090 |
| | |
| | | hikari: |
| | | validation-timeout: 3000 |
| | | connection-test-query: select 1 |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://127.0.0.1:3306/wcs?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: root |
| | | mvc: |
| | | static-path-pattern: /** |
| | | redis: |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | database: 0 |
| | | # password: 123456 |
| | | data: |
| | | redis: |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | database: 0 |
| | | # password: 123456 |
| | | task: |
| | | scheduling: |
| | | pool: |
| New file |
| | |
| | | 账号=Account |
| | | 密码=Password |
| | | 登录=Sign In |
| | | 系统工具=System Tools |
| | | 推荐操作=Recommended Actions |
| | | 其他工具=Other Tools |
| | | 获取请求码=Get Request Code |
| | | 一键激活=Activate |
| | | 获取项目名称=Get Project Name |
| | | 获取系统配置=Get System Config |
| | | 录入许可证=Import License |
| | | 已复制到剪贴板=Copied to clipboard |
| | | 复制失败=Copy failed |
| | | 获取请求码失败=Failed to get request code |
| | | 获取系统配置信息失败=Failed to get system configuration |
| | | 许可证内容不能为空=License content cannot be empty |
| | | 许可证更新成功=License updated successfully |
| | | 许可证更新失败=Failed to update license |
| | | 许可证录入失败=Failed to import license |
| | | 激活成功=Activation successful |
| | | 激活失败=Activation failed |
| | | 获取项目名称失败=Failed to get project name |
| | | 请输入账号=Please enter account |
| | | 请输入密码=Please enter password |
| | | 搜索菜单=Search menu |
| | | 没有匹配菜单=No matching menus |
| | | 当前账号没有可用菜单=No available menus |
| | | 临时许可证有效期:=Temporary license valid: |
| | | 仿真运行中=Simulation Running |
| | | 仿真未运行=Simulation Stopped |
| | | 基本资料=Profile |
| | | 退出登录=Log Out |
| | | 关闭其他页签=Close Other Tabs |
| | | 返回控制中心=Back to Dashboard |
| | | 许可证即将过期=License Expiring Soon |
| | | 知道了=OK |
| | | 控制中心=Control Center |
| | | 实时监控=Real-time Monitoring |
| | | 账户中心=Account Center |
| | | 管理员=Admin |
| | | 正在加载页面...=Loading page... |
| | | AI助手=AI Assistant |
| | | 确定要停止仿真模拟吗?=Are you sure you want to stop the simulation? |
| | | 确定要启动仿真模拟吗?=Are you sure you want to start the simulation? |
| | | 仿真模拟已停止=Simulation stopped |
| | | 仿真模拟已启动=Simulation started |
| | | 操作失败=Operation failed |
| | | 菜单加载失败=Failed to load menu |
| | | 菜单加载失败,请检查接口状态=Failed to load menu. Please check the API status. |
| | | 工作页面=Work Page |
| | | 业务页面=Business Page |
| | | 编号=ID |
| | | 起始时间 - 终止时间=Start time - End time |
| | | 请输入=Please enter |
| | | 请输入...=Please enter... |
| | | 请选择数据=Please select data |
| | | 请选择要删除的数据=Please select data to delete |
| | | 无数据=No data |
| | | 已存在=Already exists |
| | | 不可用=Unavailable |
| | | 取消选择=Clear selection |
| | | 正常=Active |
| | | 禁用=Disabled |
| | | 启用=Enabled |
| | | 冻结=Frozen |
| | | 删除=Delete |
| | | 一级菜单=Level 1 Menu |
| | | 二级菜单=Level 2 Menu |
| | | 三级菜单=Level 3 Menu |
| | | 查询=Search |
| | | 重置=Reset |
| | | 新增=Add |
| | | 编辑=Edit |
| | | 修改=Edit |
| | | 导出=Export |
| | | 保存=Save |
| | | 取消=Cancel |
| | | 返回=Back |
| | | 详情=Details |
| | | 工作号=Work No. |
| | | WMS工作号=WMS Work No. |
| | | 源库位=Source Location |
| | | 目标库位=Target Location |
| | | 堆垛机=Crane |
| | | 双工位堆垛机=Dual-station Crane |
| | | 区域编码=Area Code |
| | | 未命名页面=Untitled Page |
| | | 未命名分组=Untitled Group |
| | | |
| | | # Generic controls |
| | | 操作=Actions |
| | | 打印=Print |
| | | 搜索=Search |
| | | 重置=Reset |
| | | 筛选列=Columns |
| | | 到第=Go to |
| | | 确定=OK |
| | | 编号=ID |
| | | 导出=Export |
| | | 起始时间 - 终止时间=Start Time - End Time |
| | | 修改人员=Updated By |
| | | 修改时间=Updated At |
| | | 备注=Remarks |
| | | 新增=Add |
| | | 工作号=Work No. |
| | | 降序=Descending |
| | | 升序=Ascending |
| | | 添加时间=Created At |
| | | 修改=Edit |
| | | 状态=Status |
| | | 目标库位=Target Location |
| | | 请选择=Please select |
| | | 无数据=No data |
| | | 尾页=Last Page |
| | | 正常=Active |
| | | 添加人员=Created By |
| | | 异常=Exception |
| | | 异常码=Error Code |
| | | 工作状态=Work Status |
| | | 没有选项=No options |
| | | 目标站=Target Station |
| | | 源站=Source Station |
| | | 堆垛机号=Crane No. |
| | | 命令=Command |
| | | 请求响应=Request/Response |
| | | 入出库类型=IO Type |
| | | 设备编号=Device No. |
| | | 条码=Barcode |
| | | 系统状态=System Status |
| | | 下发时间=Issued At |
| | | 下发状态=Issue Status |
| | | 作业=Operation |
| | | 创建时间=Created At |
| | | 发生时间=Occurred At |
| | | 结果=Result |
| | | 结束时间=Ended At |
| | | 类型=Type |
| | | 名称=Name |
| | | 起点库位=Source Location |
| | | 刷新=Refresh |
| | | 已下发=Issued |
| | | 保存=Save |
| | | 编码=Code |
| | | 成功=Success |
| | | 角色=Role |
| | | 接口地址=API Endpoint |
| | | 批次=Batch |
| | | 批次序列=Batch Sequence |
| | | 前往=Go |
| | | 设备类型=Device Type |
| | | 失败=Failed |
| | | 详情=Details |
| | | 用户=User |
| | | 优先级=Priority |
| | | 暂无数据=No Data |
| | | 注册时间=Registered At |
| | | 自动=Auto |
| | | RGV号=RGV No. |
| | | 关闭=Close |
| | | 工作时间=Work Time |
| | | 托盘码=Pallet Code |
| | | 源站点=Source Station |
| | | 目标站点=Target Station |
| | | 设备ip=Device IP |
| | | 设备端口=Device Port |
| | | 网关编号=Gateway No. |
| | | 实现类=Implementation Class |
| | | 虚拟设备=Virtual Device |
| | | 创建人员=Created By |
| | | 请求时间=Request Time |
| | | 响应参数=Response Payload |
| | | 请求参数=Request Payload |
| | | 请求内容=Request Content |
| | | 响应内容=Response Content |
| | | 名称空间=Namespace |
| | | 登录账户=Login Account |
| | | 手机号=Phone |
| | | 邮箱=Email |
| | | 确认修改=Confirm Update |
| | | 设置我的资料=Edit My Profile |
| | | 不可修改=Not Editable |
| | | 重要!一般用于后台登入=Important: usually used for admin login |
| | | 当前角色不可更改为其它角色=Current role cannot be changed |
| | | 手机号:=Phone: |
| | | 用户名:=Username: |
| | | 输入手机号=Enter phone number |
| | | 输入用户名=Enter username |
| | | 重置密码=Reset Password |
| | | 首页菜单=Home Menu |
| | | 客户端IP=Client IP |
| | | 请求数据=Request Data |
| | | 响应数据=Response Data |
| | | 操作内容=Operation Content |
| | | 凭证值=Credential Value |
| | | 员工=Employee |
| | | 菜单=Menu |
| | | 按钮=Button |
| | | 添加=Add |
| | | 菜单编码=Menu Code |
| | | 菜单名称=Menu Name |
| | | 权限名称=Permission Name |
| | | 所属菜单=Menu |
| | | 权限=Permissions |
| | | 上级=Parent |
| | | 账号=Account |
| | | 密码=Password |
| | | |
| | | # Common dynamic patterns |
| | | regex\:^(\\d+)\\s*条/页$=$1 / page |
| | | regex\:^(\\d+)条/页$=$1 / page |
| | | regex\:^共\\s*(\\d+)\\s*条$=Total $1 items |
| | | regex\:^共\\s*(\\d+)\\s*个设备$=Total $1 devices |
| | | regex\:^(\\d+)号堆垛机$=Crane $1 |
| | | regex\:^(\\d+)号双工位堆垛机$=Dual-station Crane $1 |
| | | regex\:^堆垛机\\s*(\\d+)$=Crane $1 |
| | | regex\:^双工位堆垛机\\s*(\\d+)$=Dual-station Crane $1 |
| | | regex\:^站点列表\\s*\\((\\d+)\\)$=Station List ($1) |
| | | regex\:^堆垛机设备\\s*\\((\\d+)\\)$=Crane Devices ($1) |
| | | regex\:^出库区域\\s*\\((\\d+)\\)$=Outbound Areas ($1) |
| | | regex\:^出库站点\\s*\\((\\d+)\\)$=Outbound Stations ($1) |
| | | regex\:^工作号\\s*(\\d+)\\s*\\|\\s*目标\\s*(.+)$=Work No. $1 | Target $2 |
| | | regex\:^A(\\d+)\\s*-\\s*月台(\\d+)$=A$1 - Dock $2 |
| | | |
| | | # Watch and map pages |
| | | 地图操作=Map Controls |
| | | 重置视图=Reset View |
| | | 站点颜色=Station Color |
| | | 收起面板=Collapse Panel |
| | | 监控工作台=Monitoring Workbench |
| | | 堆垛机监控=Crane Monitor |
| | | 双工位=Dual Station |
| | | 输送站=Stations |
| | | 上一页=Previous |
| | | 下一页=Next |
| | | 打开控制中心=Open Control Center |
| | | 楼层=Floor |
| | | 旋转=Rotate |
| | | 镜像=Mirror |
| | | 显示站点方向=Show Station Direction |
| | | 库位地图=Location Map |
| | | 点击库位后在右侧查看详情。=Click a location to view details on the right. |
| | | 点击库位可查看库位状态,点击站点可查看站点作业详情。地图操作在右上角工具面板中。=Click a location to view its status, or a station to view job details. Use the top-right tool panel for map controls. |
| | | 货架=Shelf |
| | | 实时数据=Live Data |
| | | 原始地图=Raw Map |
| | | 最近数据=Latest Data |
| | | 初始化库位=Initialize Locations |
| | | 导入地图=Import Map |
| | | |
| | | # Work pages |
| | | 任务管理=Task Management |
| | | 任务类型=Task Type |
| | | 系统消息=System Message |
| | | 源库位=Source Location |
| | | 时间=Time |
| | | |
| | | # Baseline data and enums |
| | | 1.入库=1. Inbound |
| | | 101.出库=101. Outbound |
| | | 201.移库任务=201. Transfer |
| | | 1.生成入库任务=1. Create Inbound Task |
| | | 2.设备上走=2. Device Moving Up |
| | | 3.设备搬运中=3. Device Handling |
| | | 9.入库完成=9. Inbound Completed |
| | | 109.出库完成=109. Outbound Completed |
| | | F.在库=F. In Stock |
| | | X.禁用=X. Disabled |
| | | O.空库位=O. Empty Location |
| | | C.充电占用=C. Charging Occupied |
| | | R.出库预约=R. Outbound Reserved |
| | | S.入库预约=S. Inbound Reserved |
| | | 出库站列表=Outbound Stations |
| | | 入库站列表=Inbound Stations |
| | | 深库位排号=Deep Location Row No. |
| | | 控制库位排号=Control Location Row No. |
| | | 站点数据=Station Data |
| | | 顶升移栽点=Lift Transfer Point |
| | | 出库站点数据=Outbound Station Data |
| | | 入库站点数据=Inbound Station Data |
| | | 站点别名=Station Alias |
| | | 站点楼层=Station Floor |
| | | 库位状态代号=Location Status Code |
| | | 库位状态描述=Location Status Description |
| | | 状态描述=Status Description |
| | | 入出类型代号=IO Type Code |
| | | 入出类型描述=IO Type Description |
| | | 当前ID=Current ID |
| | | 启动入库=Start Inbound |
| | | 起始ID=Start ID |
| | | 终止ID=End ID |
| | | 站点回退=Station Rollback |
| | | 移库任务=Transfer Task |
| | | 仿真随机工作号=Simulated Random Work No. |
| | | 低库位=Low Location |
| | | 高库位=High Location |
| | | 库位号=Location Code |
| | | 宽库位=Wide Location |
| | | 起止层=Start/End Level |
| | | 起止列=Start/End Column |
| | | 起止排=Start/End Row |
| | | 轻库位=Light Location |
| | | 窄库位=Narrow Location |
| | | 重库位=Heavy Location |
| | | 高低类型=High/Low Type |
| | | 库位类型=Location Type |
| | | |
| | | # Station and area configuration |
| | | 站点设备关系配置=Station-Device Mapping |
| | | 站点与堆垛机任务关联配置=Station-Crane Task Mapping |
| | | 保存配置=Save Configuration |
| | | 操作说明:拖拽左侧的【站点】到右侧的【设备】上即可建立关联。点击连线可删除关联。=Drag a station from the left to a device on the right to create a mapping. Click a link to remove it. |
| | | 出库站与出库区域绑定配置=Outbound Station-Area Binding |
| | | 区域名称=Area Name |
| | | 新增区域=Add Area |
| | | 操作说明:拖拽左侧【出库站点】到右侧【出库区域】上建立绑定。点击连线可删除绑定。=Drag an outbound station from the left to an outbound area on the right to create a binding. Click a link to remove the binding. |
| | | |
| | | # Notification report |
| | | 通知上报=Notification Report |
| | | 补发=Retry |
| | | 任务=Task |
| | | 任务号=Task No. |
| | | 设备号=Device No. |
| | | 输送线=Conveyor |
| | | 已开启=Enabled |
| | | 查看报文=View Request |
| | | 查看响应=View Response |
| | | 队列状态=Queue Status |
| | | 发送时间=Sent At |
| | | 批量补发=Retry Selected |
| | | 任务完成=Task Completed |
| | | 日志结果=Log Result |
| | | 筛选条件=Filters |
| | | 上报开关=Reporting Switch |
| | | 刷新全局=Refresh Global |
| | | |
| | | # Device logs |
| | | 设备日志=Device Logs |
| | | 全部=All |
| | | 下载=Download |
| | | 日期选择=Date Selection |
| | | 设备列表=Device List |
| | | 选中日期=Selected Date |
| | | 起始序号=Start Index |
| | | 最大文件=Max Files |
| | | 请输入编号=Enter ID |
| | | 文件下载中=Downloading file |
| | | 日志可视化 - ()=Device Logs - () |
| | | 暂无数据,请先选择日期=No data. Please select a date first. |
| | | |
| | | # Debug and system config |
| | | 调试参数=Debug Parameters |
| | | 充电参数=Charging Settings |
| | | 调度参数=Dispatch Settings |
| | | 避障内圈半径=Inner Avoidance Radius |
| | | 避障外圈半径=Outer Avoidance Radius |
| | | 定时充电开关=Scheduled Charging |
| | | 入库预留小车=Reserved Inbound AGV |
| | | 小车满电校准=Full Battery Calibration |
| | | 演示模式参数=Demo Mode Settings |
| | | 定时充电时间段=Scheduled Charging Window |
| | | 小车定时充电线=Scheduled Charging Line |
| | | 小车默认充电线=Default Charging Line |
| | | 演示模式-跑库=Demo Mode - Cycle Storage |
| | | 小车充电最大阈值=Max Charge Threshold |
| | | 小车电量预警阈值=Low Battery Threshold |
| | | 输出RCS调试日志=Output RCS Debug Logs |
| | | 演示模式-货物搬运=Demo Mode - Cargo Handling |
| | | 移动演示模式-楼层=Moving Demo Mode - Floor |
| | | 调度小车同层最大数量=Max AGVs Per Floor |
| | | 小车出提升机近点距离=AGV Lift Exit Distance |
| | | 小车移动连续下发指令=Continuous AGV Move Commands |
| | | 允许交管重新规划路径=Allow Traffic Replan |
| | | 地图母轨方向(x,y)=Map Main Rail Direction (x,y) |
| | | 移动演示模式-是否换层=Moving Demo Mode - Change Floor |
| | | 小车(x,y)命令运行方向颠倒=Invert AGV (x,y) Command Direction |
| | | 对应值=Value |
| | | 筛选类型=Filter Type |
| | | 刷新缓存=Refresh Cache |
| | | 出库迟到惩罚=Outbound Delay Penalty |
| | | 监控地图镜像=Monitor Map Mirror |
| | | 监控地图旋转=Monitor Map Rotation |
| | | |
| | | # AI page |
| | | AI配置=AI Configuration |
| | | 必填=Required |
| | | 测试=Test |
| | | 复制=Copy |
| | | 更多=More |
| | | 模型=Model |
| | | 启用=Enabled |
| | | 思考=Thinking |
| | | 冷却中=Cooling |
| | | 清冷却=Clear Cooldown |
| | | 总路由=Default Route |
| | | 调用日志=Call Logs |
| | | 额度切换=Quota Switch |
| | | 复制全文=Copy All |
| | | 故障切换=Failover |
| | | 冷却秒数=Cooldown Seconds |
| | | 路由名称=Route Name |
| | | 日志详情=Log Details |
| | | 新增路由=Add Route |
| | | 导出JSON=Export JSON |
| | | 导入JSON=Import JSON |
| | | |
| | | # Second-pass audit fixes |
| | | 查询=Query |
| | | 出库=Outbound |
| | | 入库=Inbound |
| | | 代号=Code |
| | | 排序=Sort |
| | | 筛选=Filter |
| | | 当前没有可展示的堆垛机数据=No crane data available |
| | | 当前没有待发送通知=No pending notifications |
| | | 双伸位堆垛机=Dual-reach Crane |
| | | 双伸位Crane=Dual-reach Crane |
| | | 通知地址=Notify URL |
| | | 通知ID=Notify ID |
| | | 消息描述=Message Description |
| | | 重试次数=Retry Count |
| | | 当前队列数=Current Queue Size |
| | | 间隔(s)=Interval (s) |
| | | 通知日志数=Notification Log Count |
| | | 当前通知队列=Current Notification Queue |
| | | 通知发送日志=Notification Send Logs |
| | | 通知类型=Notification Type |
| | | 通知Type=Notification Type |
| | | 上次重试时间=Last Retry Time |
| | | 上次重试Time=Last Retry Time |
| | | 消息类型/描述=Message Type / Description |
| | | 消息Type/描述=Message Type / Description |
| | | 通知查看与补发=Notification View & Retry |
| | | 通知查看与Retry=Notification View & Retry |
| | | 通知接口历史调用记录=Notification API History |
| | | 展示待发送和待重试通知=Show pending and retry notifications |
| | | 支持从历史日志重新发送通知=Support resending from history |
| | | 已选 0 条=0 selected |
| | | 站点ID=Station ID |
| | | 通知上报=Notification Report |
| | | 当前页签:通知队列=Current Tab: Notification Queue |
| | | 通知队列=Notification Queue |
| | | 通知日志=Notification Logs |
| | | 任务类型/描述=Task Type / Description |
| | | 消息类型=Message Type |
| | | 消息Type=Message Type |
| | | 通知类型/描述=Notification Type / Description |
| | | 设备日志=Device Logs |
| | | 日志可视化 - ()=Device Logs - () |
| | | 日志可视化=Device Logs |
| | | 日期选择=Date Selection |
| | | 选中日期=Selected Date |
| | | 起始序号=Start Index |
| | | 最大文件=Max Files |
| | | 文件下载中=Downloading file |
| | | 设备列表=Device List |
| | | 设备号=Device No. |
| | | 当前没有待发送通知=No notifications to send |
| | | 03月=03 |
| | | 03日=03 |
| | | 04日=04 |
| | | 05日=05 |
| | | 06日=06 |
| | | 07日=07 |
| | | 08日=08 |
| | | 09日=09 |
| | | 未知=Unknown |
| | | 宽窄类型=Width Type |
| | | 宽窄Type=Width Type |
| | | 轻重类型=Weight Type |
| | | 轻重Type=Weight Type |
| | | 堆垛机数量=Crane Count |
| | | Crane数量=Crane Count |
| | | 库位状态=Location Status |
| | | 库位Status=Location Status |
| | | 层数=Levels |
| | | 更新时间=Updated At |
| | | 更新Time=Updated At |
| | | 系统运行状态=System Runtime Status |
| | | 系统运行Status=System Runtime Status |
| | | 启动仿真模拟=Start Simulation |
| | | 停止仿真模拟=Stop Simulation |
| | | 异常情况=Exception Details |
| | | Exception情况=Exception Details |
| | | 系统状态数据=System Status Payload |
| | | System Status数据=System Status Payload |
| | | 最大出库任务数=Max Outbound Tasks |
| | | 最大出库Task数=Max Outbound Tasks |
| | | 最大入库任务数=Max Inbound Tasks |
| | | 最大入库Task数=Max Inbound Tasks |
| | | 可出(checkBox)=Outbound Enabled (Checkbox) |
| | | 可入(checkBox)=Inbound Enabled (Checkbox) |
| | | 工位1禁止执行列=Station 1 Disabled Columns |
| | | 工位2禁止执行列=Station 2 Disabled Columns |
| | | 出库站点=Outbound Stations |
| | | 入库站点=Inbound Stations |
| | | 出库排序交互点=Outbound Sort Interaction Point |
| | | 初始化站点数据=Initialize Station Data |
| | | 初始化Station Data=Initialize Station Data |
| | | 运行堵塞重新分配库位站点数据=Reassign blocked location station data |
| | | 运行堵塞重新分配库位Station Data=Reassign blocked location station data |
| | | 虚拟设备初始化设备状态=Virtual Device Initializes Device Status |
| | | Virtual Device初始化设备Status=Virtual Device Initializes Device Status |
| | | Initialize Locations后将Delete库存明细,请谨慎Actions!=Initializing locations will delete inventory details. Proceed carefully. |
| | | 绕圈最大承载量=Max Loop Load |
| | | 完工时间权重=Finish Time Weight |
| | | 完工Time权重=Finish Time Weight |
| | | 并行搜索线程数=Parallel Search Threads |
| | | 并行Search线程数=Parallel Search Threads |
| | | 最大求解时间(s)=Max Solve Time (s) |
| | | 最大求解Time(s)=Max Solve Time (s) |
| | | 任务等待时间权重=Task Wait Time Weight |
| | | Task等待Time权重=Task Wait Time Weight |
| | | 是否启用出库节拍=Enable Outbound Rhythm |
| | | 是否Enabled出库节拍=Enable Outbound Rhythm |
| | | 优先级早完成权重=Priority Early Completion Weight |
| | | Priority早完成权重=Priority Early Completion Weight |
| | | 站点点绕圈模式=Station Loop Mode |
| | | Stations点绕圈模式=Station Loop Mode |
| | | 同一出库组序列之间的最小间隔=Min Interval Between Same Outbound Group Sequences |
| | | 堆垛机货叉放货耗时(s)=Crane Fork Putaway Time (s) |
| | | Crane货叉放货耗时(s)=Crane Fork Putaway Time (s) |
| | | 堆垛机货叉取货耗时(s)=Crane Fork Pickup Time (s) |
| | | Crane货叉取货耗时(s)=Crane Fork Pickup Time (s) |
| | | 输送线命令分段长度=Conveyor Command Segment Length |
| | | ConveyorCommand分段长度=Conveyor Command Segment Length |
| | | 站点点最大任务数量上限=Max Tasks Per Station |
| | | Stations点最大Task数量上限=Max Tasks Per Station |
| | | 冷却到: -=Cooldown Until: - |
| | | 最近错误: -=Latest Error: - |
| | | 故障切换开启=Failover Enabled |
| | | Failover开启=Failover Enabled |
| | | 额度切换开启=Quota Switch Enabled |
| | | Quota Switch开启=Quota Switch Enabled |
| | | 优先级(越小越优先)=Priority (smaller is higher) |
| | | AI配置 - LLM路由=AI Configuration - LLM Routes |
| | | 支持多API、多模型、多Key,额度耗尽或故障自动切换=Supports multiple APIs, models, and keys with automatic failover on quota exhaustion or errors |
| | | 支持多API、多Model、多Key,额度耗尽或故障Auto切换=Supports multiple APIs, models, and keys with automatic failover on quota exhaustion or errors |
| | | 成功 0 / 失败 0 / 连续失败 0=Success 0 / Failed 0 / Consecutive Failures 0 |
| | | Success 0 / Failed 0 / 连续Failed 0=Success 0 / Failed 0 / Consecutive Failures 0 |
| | | Success 7 / Failed 2 / 连续Failed 0=Success 7 / Failed 2 / Consecutive Failures 0 |
| | | Success 8 / Failed 0 / 连续Failed 0=Success 8 / Failed 0 / Consecutive Failures 0 |
| | | 必填,例如: https://dashscope.aliyuncs.com/compatible-mode/v1=Required, for example: https://dashscope.aliyuncs.com/compatible-mode/v1 |
| | | Required,例如: https://dashscope.aliyuncs.com/compatible-mode/v1=Required, for example: https://dashscope.aliyuncs.com/compatible-mode/v1 |
| | | 最近错误:=Latest Error: |
| | | 冷却到:=Cooldown Until: |
| | | D.空桶/空栈板=D. Empty Tote/Pallet |
| | | E.出入专用轨道=E. Dedicated IO Rail |
| | | W.穿梭车母轨道=W. Shuttle Main Rail |
| | | P.拣料/盘点/并板出库中=P. Picking/Counting/Merging Outbound |
| | | Q.拣料/盘点/并板再入库=Q. Picking/Counting/Merging Re-Inbound |
| | | 4.设备搬运完成=4. Device Handling Completed |
| | | 10.库存更新完成=10. Inventory Update Completed |
| | | 102.设备搬运中=102. Device Handling In Progress |
| | | 104.站点运行中=104. Station Running |
| | | 502.设备搬运中=502. Device Handling In Progress |
| | | 103.设备搬运完成=103. Device Handling Completed |
| | | 110.库存更新完成=110. Inventory Update Completed |
| | | 503.设备搬运完成=503. Device Handling Completed |
| | | 509.移库完成=509. Transfer Completed |
| | | 101.生成出库任务=101. Create Outbound Task |
| | | 101.生成出库Task=101. Create Outbound Task |
| | | 501.生成移库任务=501. Create Transfer Task |
| | | 501.生成Transfer Task=501. Create Transfer Task |
| | | |
| | | 页=page |
| | | 排=Row |
| | | 列=Column |
| | | 层=Level |
| | | 是=Yes |
| | | 否=No |
| | | 开=On |
| | | 关=Off |
| | | 工作数据不存在=Work data does not exist |
| | | 已受理(异步执行)=Accepted (async) |
| | | Command已受理(异步执行)=Command accepted (async) |
| | | 通知上报中心=Notification Report Center |
| | | 查看当前待通知队列、接口发送日志,支持按任务/设备快速筛选,并对失败或待发送通知执行手动补发。=View pending notification queues and send logs, filter quickly by task or device, and manually resend failed or pending notifications. |
| | | Redis 中待上报或待重试通知=Notifications pending report or retry in Redis |
| | | 来源:notifyUri + notifyUriPath=Source: notifyUri + notifyUriPath |
| | | 队列与日志共用同一组查询条件,切换页签时保持一致。=Queue and log tabs share the same query conditions and stay in sync when switching tabs. |
| | | 通用搜索:任务号、消息描述、报文关键字、Redis Key=General search: Task No., message description, payload keyword, Redis key |
| | | 当前队列显示 Redis 实时数据,发送日志显示历史接口调用结果。=The current queue shows live Redis data, and send logs show historical API call results. |
| | | CraneInboundTask执行中=CraneInboundTask in progress |
| | | LLM调用日志=LLM Call Logs |
| | | 日志详情 - =Log Details - |
| | | 日志可视化 - =Device Logs - |
| | | 信息=Info |
| | | 确定导出Excel吗=Export to Excel? |
| | | 确定修改资料吗?=Confirm profile update? |
| | | 修改密码=Change Password |
| | | 当前密码=Current Password |
| | | 新密码=New Password |
| | | 确认新密码=Confirm New Password |
| | | 密码不匹配=Password does not match |
| | | 新密码不能为空=New password cannot be empty |
| | | 不能少于4个字符=Must be at least 4 characters |
| | | 与旧密码不能相同=Must differ from the current password |
| | | 密码不一致=Passwords do not match |
| | | 密码修改成功,请重新登录=Password updated successfully. Please sign in again. |
| | | 收起操作=Hide Controls |
| | | 隐藏站点方向=Hide Station Direction |
| | | 取消镜像=Disable Mirror |
| | | 展开面板=Expand Panel |
| | | 收起控制中心=Hide Control Center |
| | | 双工位堆垛机监控=Dual-station Crane Monitor |
| | | 输送监控=Station Monitor |
| | | RGV监控=RGV Monitor |
| | | 请输入堆垛机号=Enter crane number |
| | | 请输入RGV号=Enter RGV number |
| | | 请输入站号=Enter station number |
| | | 堆垛机号=Crane No. |
| | | RGV号=RGV No. |
| | | 站号=Station No. |
| | | 源点=Source Point |
| | | 目标点=Target Point |
| | | 输入源点=Enter source point |
| | | 输入目标点=Enter target point |
| | | 输入工作号=Enter work number |
| | | 输入目标站号=Enter target station no. |
| | | 取放货=Pick/Put |
| | | 移动=Move |
| | | 任务完成=Task Complete |
| | | 下发=Send |
| | | 复位=Reset |
| | | 编号=ID |
| | | 模式=Mode |
| | | 状态=Status |
| | | 是否有物=Loaded |
| | | 任务接收=Task Receive |
| | | 货叉定位=Fork Position |
| | | 载货台定位=Lift Position |
| | | 走行定位=Travel Position |
| | | 走行速度=Travel Speed |
| | | 升降速度=Lift Speed |
| | | 叉牙速度=Fork Speed |
| | | 称重数据=Weight |
| | | 条码数据=Barcode |
| | | 故障代码=Error Code |
| | | 故障描述=Alarm Description |
| | | 扩展数据=Extended Data |
| | | 当前没有可展示的堆垛机数据=No crane data available |
| | | 工位=Station |
| | | 工位1=Station 1 |
| | | 工位2=Station 2 |
| | | 编辑工位1任务号=Edit Station 1 Task No. |
| | | 编辑工位2任务号=Edit Station 2 Task No. |
| | | 当前没有可展示的双工位堆垛机数据=No dual-station crane data available |
| | | 异常码=Error Code |
| | | 工位1任务号=Station 1 Task No. |
| | | 工位2任务号=Station 2 Task No. |
| | | 设备工位1任务号=Device Station 1 Task No. |
| | | 设备工位2任务号=Device Station 2 Task No. |
| | | 工位1状态=Station 1 Status |
| | | 工位2状态=Station 2 Status |
| | | 工位1是否有物=Station 1 Loaded |
| | | 工位2是否有物=Station 2 Loaded |
| | | 工位1货叉定位=Station 1 Fork Position |
| | | 工位2货叉定位=Station 2 Fork Position |
| | | 工位1任务接收=Station 1 Task Receive |
| | | 工位2任务接收=Station 2 Task Receive |
| | | 工位1下发数据=Station 1 Sent Data |
| | | 工位2下发数据=Station 2 Sent Data |
| | | 站=Station |
| | | 任务=Task |
| | | 手动=Manual |
| | | 有物=Loaded |
| | | 可入=Inbound Enabled |
| | | 可出=Outbound Enabled |
| | | 空板信号=Empty Pallet Signal |
| | | 满板信号=Full Pallet Signal |
| | | 运行阻塞=Run Block |
| | | 托盘高度=Pallet Height |
| | | 条码=Barcode |
| | | 重量=Weight |
| | | 任务可写区=Task Writable Area |
| | | 故障信息=Error Message |
| | | 当前没有可展示的站点数据=No station data available |
| | | 例如 1=For example: 1 |
| | | 例如 2=For example: 2 |
| | | 例如 101=For example: 101 |
| | | 当前没有可展示的RGV数据=No RGV data available |
| | | 轨道位=Track Position |
| | | 库位详情=Location Details |
| | | 站点信息=Station Info |
| | | 站点作业状态、来源目标和作业参数=Station job status, source/target, and job parameters |
| | | 库位当前状态和所在排列层信息=Current location status and row/bay/level details |
| | | 站点颜色配置=Station Color Configuration |
| | | 暂无站点颜色配置项=No station color configuration items |
| | | regex\:^(\\d+)站$=Station $1 |
| | | regex\:^任务\\s*(.+)\\s*\\|\\s*目标站\\s*(.+)$=Task $1 | Target Station $2 |
| | | regex\:^轨道位\\s*(.+)\\s*\\|\\s*任务\\s*(.+)$=Track $1 | Task $2 |
| | | regex\:^工位1\\s*(.+)\\s*\\|\\s*工位2\\s*(.+)$=Station 1 $1 | Station 2 $2 |
| | | regex\:^(\\d+)号RGV$=RGV $1 |
| | | 15条/页=15 / page |
| | | 30条/页=30 / page |
| | | 50条/页=50 / page |
| | | 100条/页=100 / page |
| | | 200条/页=200 / page |
| | | 500条/页=500 / page |
| | | Stations点绕圈Mode=Station Loop Mode |
| | | 阿里百炼-MiniMax-M2.1=Alibaba Bailian - MiniMax-M2.1 |
| | | 阿里百炼-MiniMax-M2.5=Alibaba Bailian - MiniMax-M2.5 |
| | | 阿里百炼-qwen3.5-flash=Alibaba Bailian - qwen3.5-flash |
| | | 阿里百炼-qwen3.5-plus=Alibaba Bailian - qwen3.5-plus |
| | | 阿里百炼-kimi-k2.5=Alibaba Bailian - kimi-k2.5 |
| | | 阿里百炼-glm-5=Alibaba Bailian - glm-5 |
| | | 硅基流动=SiliconFlow |
| New file |
| | |
| | | lang.zh-CN=Chinese (Simplified) |
| | | lang.en-US=English |
| | | app.title=Zhejiang Zhongyang - Automated AS/RS - WCS |
| | | app.company=Zhejiang Zhongyang Warehouse Technology Co., Ltd. |
| | | common.loadingPage=Loading page... |
| | | common.loadingTab=Loading "{0}" ... |
| | | common.refreshingTab=Refreshing "{0}" ... |
| | | common.ok=OK |
| | | common.prompt=Prompt |
| | | common.language=Language |
| | | common.profile=Profile |
| | | common.logout=Log Out |
| | | common.closeOtherTabs=Close Other Tabs |
| | | common.backHome=Back to Dashboard |
| | | common.aiAssistant=AI Assistant |
| | | common.workPage=Work Page |
| | | common.businessPage=Business Page |
| | | login.title=WCS System V3.0 |
| | | login.username=Account |
| | | login.password=Password |
| | | login.submit=Sign In |
| | | login.tools.title=System Tools |
| | | login.tools.recommended=Recommended Actions |
| | | login.tools.recommendedDesc=Use "Get Request Code" and "Activate" first to complete license application and activation. |
| | | login.tools.others=Other Tools |
| | | login.tools.requestCode=Get Request Code |
| | | login.tools.activate=Activate |
| | | login.tools.projectName=Get Project Name |
| | | login.tools.serverInfo=Get System Config |
| | | login.tools.uploadLicense=Import License |
| | | login.dialog.copy=Copy |
| | | login.dialog.copied=Copied to clipboard |
| | | login.dialog.copyFailed=Copy failed |
| | | login.requestCode.title=Request Code |
| | | login.requestCode.label=Request Code |
| | | login.requestCode.tip=The request code already contains the project name and can be sent directly to the license service. |
| | | login.serverInfo.title=System Configuration |
| | | login.serverInfo.label=System Configuration |
| | | login.serverInfo.tip=Legacy projects can still use this hardware JSON to apply for a license. |
| | | index.searchMenu=Search menu |
| | | index.noMatchedMenu=No matching menus |
| | | index.noAvailableMenu=No available menus for current account |
| | | index.licenseDays=Temporary license valid: {0} day(s) |
| | | index.fakeRunning=Simulation Running |
| | | index.fakeStopped=Simulation Stopped |
| | | index.licenseExpiring=License Expiring Soon |
| | | index.homeTab=Control Center |
| | | index.homeGroup=Real-time Monitoring |
| | | index.profileGroup=Account Center |
| | | index.versionLoading=Version loading... |
| | | index.licenseExpireAt=The license will expire on {0}. Remaining validity: {1} day(s). |
| | | index.confirmStopFake=Are you sure you want to stop the simulation? |
| | | index.confirmStartFake=Are you sure you want to start the simulation? |
| | | index.fakeStoppedSuccess=Simulation stopped |
| | | index.fakeStartedSuccess=Simulation started |
| | | index.operationFailed=Operation failed |
| | | index.menuLoadFailed=Failed to load menu |
| | | index.menuLoadFailedDetail=Failed to load menu. Please check the API status. |
| | | response.user.notFound=Account does not exist |
| | | response.user.disabled=Account is disabled |
| | | response.user.passwordMismatch=Incorrect password |
| | | response.system.licenseExpired=License has expired |
| | | response.common.systemError=System error. Please try again later. |
| | | response.common.methodNotAllowed=Request method not supported |
| | | resource.index=Control Center |
| | | resource.system=System Management |
| | | resource.set=System Settings |
| | | resource.merchant=Customer Management |
| | | resource.develop=Development |
| | | resource.stock=Inventory |
| | | resource.logReport=Logs & Reports |
| | | resource.ioWork=Inbound/Outbound Jobs |
| | | resource.workFlow=Workflow |
| | | resource.base=Basic Data |
| | | resource.erp=ERP Integration |
| | | resource.sensor=Sensor Devices |
| | | resource.ai.llm_config=AI Configuration |
| | | resource.notifyReport.notifyReport=Notification Report |
| | | resource.view=View |
| | | permission.function=Specified Functions |
| | | el.colorpicker.confirm=OK |
| | | el.colorpicker.clear=Clear |
| | | el.datepicker.now=Now |
| | | el.datepicker.today=Today |
| | | el.datepicker.cancel=Cancel |
| | | el.datepicker.clear=Clear |
| | | el.datepicker.confirm=OK |
| | | el.datepicker.selectDate=Select date |
| | | el.datepicker.selectTime=Select time |
| | | el.datepicker.startDate=Start date |
| | | el.datepicker.startTime=Start time |
| | | el.datepicker.endDate=End date |
| | | el.datepicker.endTime=End time |
| | | el.datepicker.prevYear=Previous year |
| | | el.datepicker.nextYear=Next year |
| | | el.datepicker.prevMonth=Previous month |
| | | el.datepicker.nextMonth=Next month |
| | | el.datepicker.year= |
| | | el.datepicker.month1=January |
| | | el.datepicker.month2=February |
| | | el.datepicker.month3=March |
| | | el.datepicker.month4=April |
| | | el.datepicker.month5=May |
| | | el.datepicker.month6=June |
| | | el.datepicker.month7=July |
| | | el.datepicker.month8=August |
| | | el.datepicker.month9=September |
| | | el.datepicker.month10=October |
| | | el.datepicker.month11=November |
| | | el.datepicker.month12=December |
| | | el.datepicker.weeks.sun=Sun |
| | | el.datepicker.weeks.mon=Mon |
| | | el.datepicker.weeks.tue=Tue |
| | | el.datepicker.weeks.wed=Wed |
| | | el.datepicker.weeks.thu=Thu |
| | | el.datepicker.weeks.fri=Fri |
| | | el.datepicker.weeks.sat=Sat |
| | | el.datepicker.months.jan=Jan |
| | | el.datepicker.months.feb=Feb |
| | | el.datepicker.months.mar=Mar |
| | | el.datepicker.months.apr=Apr |
| | | el.datepicker.months.may=May |
| | | el.datepicker.months.jun=Jun |
| | | el.datepicker.months.jul=Jul |
| | | el.datepicker.months.aug=Aug |
| | | el.datepicker.months.sep=Sep |
| | | el.datepicker.months.oct=Oct |
| | | el.datepicker.months.nov=Nov |
| | | el.datepicker.months.dec=Dec |
| | | el.select.loading=Loading |
| | | el.select.noMatch=No matching data |
| | | el.select.noData=No data |
| | | el.select.placeholder=Please select |
| | | el.cascader.noMatch=No matching data |
| | | el.cascader.loading=Loading |
| | | el.cascader.placeholder=Please select |
| | | el.cascader.noData=No data |
| | | el.pagination.goto=Go to |
| | | el.pagination.pagesize=/page |
| | | el.pagination.total=Total {total} |
| | | el.pagination.pageClassifier= |
| | | el.messagebox.title=Prompt |
| | | el.messagebox.confirm=OK |
| | | el.messagebox.cancel=Cancel |
| | | el.messagebox.error=Invalid input |
| | | el.upload.deleteTip=Press delete to remove |
| | | el.upload.delete=Delete |
| | | el.upload.preview=Preview |
| | | el.upload.continue=Continue |
| | | legacy.regex.loopStatus=Zone {0} | Stations: {1} | Tasks: {2} | Load: {3} |
| | | legacy.regex.stationDeviceLink=Click to remove mapping: Station {0} -> Device {1} |
| | | deviceLogs.visualizationPrefix=Device Logs - |
| | | deviceLogs.downloadDialogTitle=Downloading file |
| | | llm.logsTitle=LLM Call Logs |
| | | llm.logDetailTitle=Log Details |
| | | llm.logDetailPrefix=Log Details - |
| | | el.table.emptyText=No data |
| | | el.table.confirmFilter=Columns |
| | | el.table.resetFilter=Reset |
| | | el.table.clearFilter=All |
| | | el.table.sumText=Sum |
| | | el.table.sort.ascending=Ascending |
| | | el.table.sort.descending=Descending |
| | | el.tree.emptyText=No data |
| | | el.transfer.noMatch=No matching data |
| | | el.transfer.noData=No data |
| | | el.transfer.titles.0=List 1 |
| | | el.transfer.titles.1=List 2 |
| | | el.transfer.filterPlaceholder=Enter keyword |
| | | el.transfer.noCheckedFormat=0 items |
| | | el.transfer.hasCheckedFormat={checked}/{total} checked |
| | | el.image.error=Load failed |
| | | el.pageHeader.title=Back |
| | | el.popconfirm.confirmButtonText=OK |
| | | el.popconfirm.cancelButtonText=Cancel |
| | | el.empty.description=No data |
| New file |
| | |
| | | 账号=账号 |
| | | 密码=密码 |
| | | 登录=登录 |
| | | 系统工具=系统工具 |
| | | 推荐操作=推荐操作 |
| | | 其他工具=其他工具 |
| | | 获取请求码=获取请求码 |
| | | 一键激活=一键激活 |
| | | 获取项目名称=获取项目名称 |
| | | 获取系统配置=获取系统配置 |
| | | 录入许可证=录入许可证 |
| | | 已复制到剪贴板=已复制到剪贴板 |
| | | 复制失败=复制失败 |
| | | 获取请求码失败=获取请求码失败 |
| | | 获取系统配置信息失败=获取系统配置信息失败 |
| | | 许可证内容不能为空=许可证内容不能为空 |
| | | 许可证更新成功=许可证更新成功 |
| | | 许可证更新失败=许可证更新失败 |
| | | 许可证录入失败=许可证录入失败 |
| | | 激活成功=激活成功 |
| | | 激活失败=激活失败 |
| | | 获取项目名称失败=获取项目名称失败 |
| | | 请输入账号=请输入账号 |
| | | 请输入密码=请输入密码 |
| | | 搜索菜单=搜索菜单 |
| | | 没有匹配菜单=没有匹配菜单 |
| | | 当前账号没有可用菜单=当前账号没有可用菜单 |
| | | 临时许可证有效期:=临时许可证有效期: |
| | | 仿真运行中=仿真运行中 |
| | | 仿真未运行=仿真未运行 |
| | | 基本资料=基本资料 |
| | | 退出登录=退出登录 |
| | | 关闭其他页签=关闭其他页签 |
| | | 返回控制中心=返回控制中心 |
| | | 许可证即将过期=许可证即将过期 |
| | | 知道了=知道了 |
| | | 控制中心=控制中心 |
| | | 实时监控=实时监控 |
| | | 账户中心=账户中心 |
| | | 管理员=管理员 |
| | | 正在加载页面...=正在加载页面... |
| | | AI助手=AI助手 |
| | | 确定要停止仿真模拟吗?=确定要停止仿真模拟吗? |
| | | 确定要启动仿真模拟吗?=确定要启动仿真模拟吗? |
| | | 仿真模拟已停止=仿真模拟已停止 |
| | | 仿真模拟已启动=仿真模拟已启动 |
| | | 操作失败=操作失败 |
| | | 菜单加载失败=菜单加载失败 |
| | | 菜单加载失败,请检查接口状态=菜单加载失败,请检查接口状态 |
| | | 工作页面=工作页面 |
| | | 业务页面=业务页面 |
| | | 编号=编号 |
| | | 起始时间 - 终止时间=起始时间 - 终止时间 |
| | | 请输入=请输入 |
| | | 请输入...=请输入... |
| | | 请选择数据=请选择数据 |
| | | 请选择要删除的数据=请选择要删除的数据 |
| | | 无数据=无数据 |
| | | 已存在=已存在 |
| | | 不可用=不可用 |
| | | 取消选择=取消选择 |
| | | 正常=正常 |
| | | 禁用=禁用 |
| | | 启用=启用 |
| | | 冻结=冻结 |
| | | 删除=删除 |
| | | 一级菜单=一级菜单 |
| | | 二级菜单=二级菜单 |
| | | 三级菜单=三级菜单 |
| | | 查询=查询 |
| | | 重置=重置 |
| | | 新增=新增 |
| | | 编辑=编辑 |
| | | 修改=修改 |
| | | 导出=导出 |
| | | 保存=保存 |
| | | 取消=取消 |
| | | 返回=返回 |
| | | 详情=详情 |
| | | 工作号=工作号 |
| | | WMS工作号=WMS工作号 |
| | | 源库位=源库位 |
| | | 目标库位=目标库位 |
| | | 堆垛机=堆垛机 |
| | | 双工位堆垛机=双工位堆垛机 |
| | | 区域编码=区域编码 |
| | | 未命名页面=未命名页面 |
| | | 未命名分组=未命名分组 |
| New file |
| | |
| | | lang.zh-CN=简体中文 |
| | | lang.en-US=英文 |
| | | app.title=浙江中扬 - 自动化立体仓库 - WCS |
| | | app.company=浙江中扬立库技术有限公司 |
| | | common.loadingPage=正在加载页面... |
| | | common.loadingTab=正在加载 “{0}” ... |
| | | common.refreshingTab=正在刷新 “{0}” ... |
| | | common.ok=好的 |
| | | common.prompt=提示 |
| | | common.language=语言 |
| | | common.profile=基本资料 |
| | | common.logout=退出登录 |
| | | common.closeOtherTabs=关闭其他页签 |
| | | common.backHome=返回控制中心 |
| | | common.aiAssistant=AI助手 |
| | | common.workPage=工作页面 |
| | | common.businessPage=业务页面 |
| | | login.title=WCS系统V3.0 |
| | | login.username=账号 |
| | | login.password=密码 |
| | | login.submit=登录 |
| | | login.tools.title=系统工具 |
| | | login.tools.recommended=推荐操作 |
| | | login.tools.recommendedDesc=优先使用“获取请求码”和“一键激活”完成许可证申请与激活。 |
| | | login.tools.others=其他工具 |
| | | login.tools.requestCode=获取请求码 |
| | | login.tools.activate=一键激活 |
| | | login.tools.projectName=获取项目名称 |
| | | login.tools.serverInfo=获取系统配置 |
| | | login.tools.uploadLicense=录入许可证 |
| | | login.dialog.copy=复制 |
| | | login.dialog.copied=已复制到剪贴板 |
| | | login.dialog.copyFailed=复制失败 |
| | | login.requestCode.title=获取请求码 |
| | | login.requestCode.label=请求码 |
| | | login.requestCode.tip=请求码中已包含项目名称,直接发给许可证服务端即可。 |
| | | login.serverInfo.title=获取系统配置 |
| | | login.serverInfo.label=系统配置信息 |
| | | login.serverInfo.tip=老项目仍可继续使用这份硬件信息 JSON 申请许可证。 |
| | | index.searchMenu=搜索菜单 |
| | | index.noMatchedMenu=没有匹配菜单 |
| | | index.noAvailableMenu=当前账号没有可用菜单 |
| | | index.licenseDays=临时许可证有效期:{0}天 |
| | | index.fakeRunning=仿真运行中 |
| | | index.fakeStopped=仿真未运行 |
| | | index.licenseExpiring=许可证即将过期 |
| | | index.homeTab=控制中心 |
| | | index.homeGroup=实时监控 |
| | | index.profileGroup=账户中心 |
| | | index.versionLoading=版本加载中... |
| | | index.licenseExpireAt=许可证将于 {0} 过期,剩余有效期:{1} 天。 |
| | | index.confirmStopFake=确定要停止仿真模拟吗? |
| | | index.confirmStartFake=确定要启动仿真模拟吗? |
| | | index.fakeStoppedSuccess=仿真模拟已停止 |
| | | index.fakeStartedSuccess=仿真模拟已启动 |
| | | index.operationFailed=操作失败 |
| | | index.menuLoadFailed=菜单加载失败 |
| | | index.menuLoadFailedDetail=菜单加载失败,请检查接口状态 |
| | | response.user.notFound=账号不存在 |
| | | response.user.disabled=账号已被禁用 |
| | | response.user.passwordMismatch=密码错误 |
| | | response.system.licenseExpired=许可证已失效 |
| | | response.common.systemError=系统异常,请稍后重试 |
| | | response.common.methodNotAllowed=请求方式不支持 |
| | | resource.index=控制中心 |
| | | resource.system=系统管理 |
| | | resource.set=系统配置 |
| | | resource.merchant=客户管理 |
| | | resource.develop=开发专用 |
| | | resource.stock=库存管理 |
| | | resource.logReport=日志报表 |
| | | resource.ioWork=入出库作业 |
| | | resource.workFlow=作业流程 |
| | | resource.base=基础资料 |
| | | resource.erp=ERP对接 |
| | | resource.sensor=感知设备 |
| | | resource.ai.llm_config=AI配置 |
| | | resource.notifyReport.notifyReport=通知上报 |
| | | resource.view=查看 |
| | | permission.function=指定功能 |
| | | el.colorpicker.confirm=确定 |
| | | el.colorpicker.clear=清空 |
| | | el.datepicker.now=此刻 |
| | | el.datepicker.today=今天 |
| | | el.datepicker.cancel=取消 |
| | | el.datepicker.clear=清空 |
| | | el.datepicker.confirm=确定 |
| | | el.datepicker.selectDate=选择日期 |
| | | el.datepicker.selectTime=选择时间 |
| | | el.datepicker.startDate=开始日期 |
| | | el.datepicker.startTime=开始时间 |
| | | el.datepicker.endDate=结束日期 |
| | | el.datepicker.endTime=结束时间 |
| | | el.datepicker.prevYear=前一年 |
| | | el.datepicker.nextYear=后一年 |
| | | el.datepicker.prevMonth=上个月 |
| | | el.datepicker.nextMonth=下个月 |
| | | el.datepicker.year=年 |
| | | el.datepicker.month1=1 月 |
| | | el.datepicker.month2=2 月 |
| | | el.datepicker.month3=3 月 |
| | | el.datepicker.month4=4 月 |
| | | el.datepicker.month5=5 月 |
| | | el.datepicker.month6=6 月 |
| | | el.datepicker.month7=7 月 |
| | | el.datepicker.month8=8 月 |
| | | el.datepicker.month9=9 月 |
| | | el.datepicker.month10=10 月 |
| | | el.datepicker.month11=11 月 |
| | | el.datepicker.month12=12 月 |
| | | el.datepicker.weeks.sun=日 |
| | | el.datepicker.weeks.mon=一 |
| | | el.datepicker.weeks.tue=二 |
| | | el.datepicker.weeks.wed=三 |
| | | el.datepicker.weeks.thu=四 |
| | | el.datepicker.weeks.fri=五 |
| | | el.datepicker.weeks.sat=六 |
| | | el.datepicker.months.jan=一月 |
| | | el.datepicker.months.feb=二月 |
| | | el.datepicker.months.mar=三月 |
| | | el.datepicker.months.apr=四月 |
| | | el.datepicker.months.may=五月 |
| | | el.datepicker.months.jun=六月 |
| | | el.datepicker.months.jul=七月 |
| | | el.datepicker.months.aug=八月 |
| | | el.datepicker.months.sep=九月 |
| | | el.datepicker.months.oct=十月 |
| | | el.datepicker.months.nov=十一月 |
| | | el.datepicker.months.dec=十二月 |
| | | el.select.loading=加载中 |
| | | el.select.noMatch=无匹配数据 |
| | | el.select.noData=无数据 |
| | | el.select.placeholder=请选择 |
| | | el.cascader.noMatch=无匹配数据 |
| | | el.cascader.loading=加载中 |
| | | el.cascader.placeholder=请选择 |
| | | el.cascader.noData=暂无数据 |
| | | el.pagination.goto=前往 |
| | | el.pagination.pagesize=条/页 |
| | | el.pagination.total=共 {total} 条 |
| | | el.pagination.pageClassifier=页 |
| | | el.messagebox.title=提示 |
| | | el.messagebox.confirm=确定 |
| | | el.messagebox.cancel=取消 |
| | | el.messagebox.error=输入的数据不合法 |
| | | el.upload.deleteTip=按 delete 键可删除 |
| | | el.upload.delete=删除 |
| | | el.upload.preview=查看图片 |
| | | el.upload.continue=继续上传 |
| | | legacy.regex.loopStatus=圈{0} | 站点: {1} | 任务: {2} | 承载: {3} |
| | | legacy.regex.stationDeviceLink=点击删除关联: 站点 {0} -> 设备 {1} |
| | | deviceLogs.visualizationPrefix=日志可视化 - |
| | | deviceLogs.downloadDialogTitle=文件下载中 |
| | | llm.logsTitle=LLM调用日志 |
| | | llm.logDetailTitle=日志详情 |
| | | llm.logDetailPrefix=日志详情 - |
| | | el.table.emptyText=暂无数据 |
| | | el.table.confirmFilter=筛选列 |
| | | el.table.resetFilter=重置 |
| | | el.table.clearFilter=全部 |
| | | el.table.sumText=合计 |
| | | el.table.sort.ascending=升序 |
| | | el.table.sort.descending=降序 |
| | | el.tree.emptyText=暂无数据 |
| | | el.transfer.noMatch=无匹配数据 |
| | | el.transfer.noData=无数据 |
| | | el.transfer.titles.0=列表 1 |
| | | el.transfer.titles.1=列表 2 |
| | | el.transfer.filterPlaceholder=请输入搜索内容 |
| | | el.transfer.noCheckedFormat=共 0 项 |
| | | el.transfer.hasCheckedFormat=已选 {checked}/{total} 项 |
| | | el.image.error=加载失败 |
| | | el.pageHeader.title=返回 |
| | | el.popconfirm.confirmButtonText=确定 |
| | | el.popconfirm.cancelButtonText=取消 |
| | | el.empty.description=暂无数据 |
| | |
| | | <!--info级别--> |
| | | <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${LOG_PATH}/info.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <FileNamePattern>${LOG_PATH}/info_%d{yyyy-MM-dd}.%i.log</FileNamePattern> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
| | | <fileNamePattern>${LOG_PATH}/info_%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <maxFileSize>10MB</maxFileSize> |
| | | <maxHistory>10</maxHistory> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>10MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</pattern> |
| | |
| | | <level>ERROR</level> |
| | | </filter> |
| | | <file>${LOG_PATH}/error.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <FileNamePattern>${LOG_PATH}/error_%d{yyyy-MM-dd}.%i.log</FileNamePattern> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
| | | <fileNamePattern>${LOG_PATH}/error_%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| | | <maxFileSize>10MB</maxFileSize> |
| | | <maxHistory>10</maxHistory> |
| | | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| | | <maxFileSize>10MB</maxFileSize> |
| | | </timeBasedFileNamingAndTriggeringPolicy> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</pattern> |
| New file |
| | |
| | | package @{COMPANYNAME}.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.core.domain.KeyValueVo; |
| | | import @{COMPANYNAME}.entity.@{ENTITYNAME}; |
| | | import @{COMPANYNAME}.service.@{ENTITYNAME}Service; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import @{SYSTEMPACKAGE}.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class @{ENTITYNAME}Controller extends BaseController { |
| | | |
| | | @Autowired |
| | | private @{ENTITYNAME}Service @{SIMPLEENTITYNAME}Service; |
| | | |
| | | @RequestMapping(value = "/@{SIMPLEENTITYNAME}/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(@{SIMPLEENTITYNAME}Service.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/@{SIMPLEENTITYNAME}/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | QueryWrapper<@{ENTITYNAME}> wrapper = new QueryWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(@{ENTITYNAME}.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));} |
| | | return R.ok(@{SIMPLEENTITYNAME}Service.page(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/@{SIMPLEENTITYNAME}/add/auth") |
| | | @ManagerAuth |
| | | public R add(@{ENTITYNAME} @{SIMPLEENTITYNAME}) { |
| | | @{SIMPLEENTITYNAME}Service.save(@{SIMPLEENTITYNAME}); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/@{SIMPLEENTITYNAME}/update/auth") |
| | | @ManagerAuth |
| | | public R update(@{ENTITYNAME} @{SIMPLEENTITYNAME}){ |
| | | if (Cools.isEmpty(@{SIMPLEENTITYNAME}) || null==@{SIMPLEENTITYNAME}.get@{PRIMARYKEYCOLUMN}()){ |
| | | return R.error(); |
| | | } |
| | | @{SIMPLEENTITYNAME}Service.updateById(@{SIMPLEENTITYNAME}); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/@{SIMPLEENTITYNAME}/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") @{PRIMARYKEYTYPE}[] ids){ |
| | | for (@{PRIMARYKEYTYPE} id : ids){ |
| | | @{SIMPLEENTITYNAME}Service.removeById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/@{SIMPLEENTITYNAME}/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | QueryWrapper<@{ENTITYNAME}> wrapper = new QueryWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("@{SIMPLEENTITYNAME}")); |
| | | convert(map, wrapper); |
| | | List<@{ENTITYNAME}> list = @{SIMPLEENTITYNAME}Service.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/@{SIMPLEENTITYNAME}Query/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | QueryWrapper<@{ENTITYNAME}> wrapper = new QueryWrapper<>(); |
| | | wrapper.like("@{MAJORCOLUMN}", condition); |
| | | Page<@{ENTITYNAME}> page = @{SIMPLEENTITYNAME}Service.page(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (@{ENTITYNAME} @{SIMPLEENTITYNAME} : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", @{SIMPLEENTITYNAME}.get@{PRIMARYKEYCOLUMN}()); |
| | | map.put("value", @{SIMPLEENTITYNAME}.get@{UPCASEMARJORCOLUMN}()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping("/@{SIMPLEENTITYNAME}/all/get/kv") |
| | | @ManagerAuth |
| | | public R getDataKV(@RequestParam(required = false) String condition) { |
| | | List<KeyValueVo> vos = new ArrayList<>(); |
| | | QueryWrapper<@{ENTITYNAME}> wrapper = new QueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like("@{MAJORCOLUMN}", condition); |
| | | } |
| | | @{SIMPLEENTITYNAME}Service.page(new Page<>(1, 30), wrapper).getRecords() |
| | | .forEach(item -> vos.add(new KeyValueVo(String.valueOf(item.get@{UPCASEMARJORCOLUMN}()), item.get@{PRIMARYKEYCOLUMN}()))); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @RequestMapping(value = "/@{SIMPLEENTITYNAME}/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | QueryWrapper<@{ENTITYNAME}> wrapper = new QueryWrapper<@{ENTITYNAME}>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != @{SIMPLEENTITYNAME}Service.getOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(@{ENTITYNAME}.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package @{COMPANYNAME}.entity; |
| | | |
| | | @{ENTITYIMPORT} |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("@{TABLENAME}") |
| | | public class @{ENTITYNAME} implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @{ENTITYCONTENT} |
| | | } |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | @{HTMLSEARCHCONTENT} |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="@{SIMPLEENTITYNAME}" lay-filter="@{SIMPLEENTITYNAME}"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/@{SIMPLEENTITYNAME}/@{SIMPLEENTITYNAME}.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | @{HTMLDIALOGCONTENT} |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | </html> |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 详情 --> |
| | | <div id="data-detail" class="layer_self_wrap"> |
| | | <form id="detail" class="layui-form"> |
| | | <!-- |
| | | <div class="layui-inline" style="display: none"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>编 号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="id" class="layui-input" type="text" placeholder="编号"> |
| | | </div> |
| | | </div> |
| | | --> |
| | | @{HTMLDETAILCONTENT} |
| | | |
| | | <hr class="layui-bg-gray"> |
| | | |
| | | <div id="data-detail-btn" class="layui-btn-container layui-form-item"> |
| | | <div id="data-detail-submit-save" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="save">保存</div> |
| | | <div id="data-detail-submit-edit" type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="edit">修改</div> |
| | | <div id="data-detail-close" type="button" class="layui-btn" lay-submit lay-filter="close">关闭</div> |
| | | </div> |
| | | |
| | | <div id="prompt"> |
| | | 温馨提示:请仔细填写相关信息,<span class="extrude"><span class="not-null">*</span> 为必填选项。</span> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/@{SIMPLEENTITYNAME}/@{SIMPLEENTITYNAME}.js" charset="utf-8"></script> |
| | | </html> |
| | | |
| New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#@{SIMPLEENTITYNAME}', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/@{SIMPLEENTITYNAME}/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | @{JSTABLECONTENT} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(@{SIMPLEENTITYNAME})', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(@{SIMPLEENTITYNAME})', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.@{PRIMARYKEYCOLUMN0}; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | '@{SIMPLEENTITYNAME}': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/@{SIMPLEENTITYNAME}/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(@{SIMPLEENTITYNAME})', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.@{PRIMARYKEYCOLUMN0}]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | form.val('detail', mData); |
| | | layDateRender(mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/@{SIMPLEENTITYNAME}/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/@{SIMPLEENTITYNAME}/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | @{JSDATECONTENT} |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
| New file |
| | |
| | | package @{COMPANYNAME}.mapper; |
| | | |
| | | import @{COMPANYNAME}.entity.@{ENTITYNAME}; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface @{ENTITYNAME}Mapper extends BaseMapper<@{ENTITYNAME}> { |
| | | |
| | | } |
| New file |
| | |
| | | package @{COMPANYNAME}.service; |
| | | |
| | | import @{COMPANYNAME}.entity.@{ENTITYNAME}; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface @{ENTITYNAME}Service extends IService<@{ENTITYNAME}> { |
| | | |
| | | } |
| New file |
| | |
| | | package @{COMPANYNAME}.service.impl; |
| | | |
| | | import @{COMPANYNAME}.mapper.@{ENTITYNAME}Mapper; |
| | | import @{COMPANYNAME}.entity.@{ENTITYNAME}; |
| | | import @{COMPANYNAME}.service.@{ENTITYNAME}Service; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("@{SIMPLEENTITYNAME}Service") |
| | | public class @{ENTITYNAME}ServiceImpl extends ServiceImpl<@{ENTITYNAME}Mapper, @{ENTITYNAME}> implements @{ENTITYNAME}Service { |
| | | |
| | | } |
| New file |
| | |
| | | -- save @{SIMPLEENTITYNAME} record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( '@{SIMPLEENTITYNAME}/@{SIMPLEENTITYNAME}.html', '@{SIMPLEENTITYNAME}管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( '@{SIMPLEENTITYNAME}#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( '@{SIMPLEENTITYNAME}#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( '@{SIMPLEENTITYNAME}#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( '@{SIMPLEENTITYNAME}#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( '@{SIMPLEENTITYNAME}#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'@{SIMPLEENTITYNAME}/@{SIMPLEENTITYNAME}.html', N'@{SIMPLEENTITYNAME}管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'@{SIMPLEENTITYNAME}#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'@{SIMPLEENTITYNAME}#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'@{SIMPLEENTITYNAME}#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'@{SIMPLEENTITYNAME}#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'@{SIMPLEENTITYNAME}#btn-export', N'导出', '', '3', '4', '1'); |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="@{COMPANYNAME}.mapper.@{ENTITYNAME}Mapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="@{COMPANYNAME}.entity.@{ENTITYNAME}"> |
| | | @{XMLCONTENT} |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | var baseUrl = "/wcs"; |
| | | |
| | | var WCS_I18N = (function (window, document) { |
| | | "use strict"; |
| | | |
| | | var STORAGE_KEY = "wcs_lang"; |
| | | var COOKIE_KEY = "wcs_lang"; |
| | | var I18N_PATH = "/i18n/messages"; |
| | | var TRANSLATABLE_RE = /[\u3400-\u9fff]/; |
| | | var state = { |
| | | ready: false, |
| | | loading: false, |
| | | locale: null, |
| | | defaultLocale: "zh-CN", |
| | | supportedLocales: ["zh-CN", "en-US"], |
| | | localeOptions: [], |
| | | messages: {}, |
| | | legacy: {}, |
| | | legacyEntries: [], |
| | | legacyRegexEntries: [], |
| | | builtinRegexEntries: [], |
| | | translateCache: {}, |
| | | translateCacheSize: 0, |
| | | callbacks: [], |
| | | observer: null, |
| | | bridgeAttempts: 0, |
| | | applying: false, |
| | | pendingNodes: [], |
| | | flushTimer: 0 |
| | | }; |
| | | |
| | | patchXmlHttpRequest(); |
| | | patchFetch(); |
| | | scheduleBridgeWrap(); |
| | | |
| | | if (document && document.documentElement) { |
| | | document.documentElement.lang = getLocale(); |
| | | } |
| | | |
| | | if (document.readyState === "loading") { |
| | | document.addEventListener("DOMContentLoaded", function () { |
| | | load(); |
| | | }); |
| | | } else { |
| | | load(); |
| | | } |
| | | |
| | | function normalizeLocale(locale) { |
| | | var value = (locale || "").replace(/_/g, "-").trim(); |
| | | if (!value) { |
| | | return state.defaultLocale; |
| | | } |
| | | if (/^en/i.test(value)) { |
| | | return "en-US"; |
| | | } |
| | | if (/^zh/i.test(value)) { |
| | | return "zh-CN"; |
| | | } |
| | | return value; |
| | | } |
| | | |
| | | function getBasePath() { |
| | | return typeof baseUrl === "string" && baseUrl ? baseUrl : ""; |
| | | } |
| | | |
| | | function isExternalUrl(url) { |
| | | return /^(?:[a-z]+:)?\/\//i.test(url || ""); |
| | | } |
| | | |
| | | function appendNonceUrl(url) { |
| | | var value = (url || "").trim(); |
| | | if (!value || isExternalUrl(value) || value.charAt(0) === "<") { |
| | | return url; |
| | | } |
| | | if (/[?&]_wcsI18nNonce=/.test(value)) { |
| | | return value; |
| | | } |
| | | return value + (value.indexOf("?") === -1 ? "?" : "&") + "_wcsI18nNonce=" + new Date().getTime(); |
| | | } |
| | | |
| | | function getCookie(name) { |
| | | var pattern = new RegExp("(?:^|; )" + name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "=([^;]*)"); |
| | | var matches = document.cookie.match(pattern); |
| | | return matches ? decodeURIComponent(matches[1]) : ""; |
| | | } |
| | | |
| | | function setCookie(name, value) { |
| | | var path = getBasePath() || "/"; |
| | | document.cookie = name + "=" + encodeURIComponent(value) + "; path=" + path + "; max-age=31536000"; |
| | | } |
| | | |
| | | function getStoredLocale() { |
| | | var locale = ""; |
| | | try { |
| | | locale = window.localStorage ? window.localStorage.getItem(STORAGE_KEY) : ""; |
| | | } catch (e) { |
| | | locale = ""; |
| | | } |
| | | if (!locale) { |
| | | locale = getCookie(COOKIE_KEY); |
| | | } |
| | | if (!locale && window.navigator) { |
| | | locale = window.navigator.language || (window.navigator.languages && window.navigator.languages[0]) || ""; |
| | | } |
| | | return normalizeLocale(locale || state.defaultLocale); |
| | | } |
| | | |
| | | function setStoredLocale(locale) { |
| | | var normalized = normalizeLocale(locale); |
| | | try { |
| | | if (window.localStorage) { |
| | | window.localStorage.setItem(STORAGE_KEY, normalized); |
| | | } |
| | | } catch (e) { |
| | | } |
| | | setCookie(COOKIE_KEY, normalized); |
| | | } |
| | | |
| | | function getLocale() { |
| | | if (!state.locale) { |
| | | state.locale = getStoredLocale(); |
| | | } |
| | | return state.locale; |
| | | } |
| | | |
| | | function setLocale(locale, reload) { |
| | | var normalized = normalizeLocale(locale); |
| | | state.locale = normalized; |
| | | setStoredLocale(normalized); |
| | | if (document && document.documentElement) { |
| | | document.documentElement.lang = normalized; |
| | | } |
| | | if (reload === false) { |
| | | state.ready = false; |
| | | load(); |
| | | return; |
| | | } |
| | | window.location.reload(); |
| | | } |
| | | |
| | | function onReady(callback) { |
| | | if (typeof callback !== "function") { |
| | | return; |
| | | } |
| | | if (state.ready) { |
| | | callback(api); |
| | | return; |
| | | } |
| | | state.callbacks.push(callback); |
| | | } |
| | | |
| | | function flushCallbacks() { |
| | | var queue = state.callbacks.slice(); |
| | | var i; |
| | | state.callbacks = []; |
| | | for (i = 0; i < queue.length; i++) { |
| | | try { |
| | | queue[i](api); |
| | | } catch (e) { |
| | | } |
| | | } |
| | | } |
| | | |
| | | function parseJson(text) { |
| | | try { |
| | | return JSON.parse(text); |
| | | } catch (e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | function request(url, success, failure) { |
| | | var xhr = new XMLHttpRequest(); |
| | | xhr.open("GET", url, true); |
| | | xhr.setRequestHeader("X-Lang", getLocale()); |
| | | xhr.onreadystatechange = function () { |
| | | if (xhr.readyState !== 4) { |
| | | return; |
| | | } |
| | | if (xhr.status >= 200 && xhr.status < 300) { |
| | | success(parseJson(xhr.responseText) || {}); |
| | | } else if (typeof failure === "function") { |
| | | failure(xhr); |
| | | } |
| | | }; |
| | | xhr.send(null); |
| | | } |
| | | |
| | | function load(callback) { |
| | | if (typeof callback === "function") { |
| | | onReady(callback); |
| | | } |
| | | if (state.loading || state.ready) { |
| | | return; |
| | | } |
| | | state.loading = true; |
| | | request(getBasePath() + I18N_PATH + "?lang=" + encodeURIComponent(getLocale()) + "&_t=" + new Date().getTime(), function (res) { |
| | | var data = res && res.code === 200 ? (res.data || {}) : {}; |
| | | state.loading = false; |
| | | state.ready = true; |
| | | state.locale = normalizeLocale(data.locale || getLocale()); |
| | | state.defaultLocale = normalizeLocale(data.defaultLocale || state.defaultLocale); |
| | | state.supportedLocales = readLocaleTags(data.supportedLocales); |
| | | state.localeOptions = readLocaleOptions(data.supportedLocales); |
| | | state.messages = data.messages || {}; |
| | | state.legacy = data.legacy || {}; |
| | | state.legacyRegexEntries = readLegacyRegexEntries(state.legacy); |
| | | state.legacyEntries = sortedLegacyEntries(state.legacy); |
| | | state.builtinRegexEntries = buildBuiltinRegexEntries(); |
| | | resetTranslateCache(); |
| | | if (document && document.documentElement) { |
| | | document.documentElement.lang = state.locale; |
| | | } |
| | | wrapLibraries(); |
| | | observeDom(); |
| | | apply(document.body || document.documentElement); |
| | | if (document.title) { |
| | | document.title = translate(document.title); |
| | | } |
| | | flushCallbacks(); |
| | | }, function () { |
| | | state.loading = false; |
| | | state.ready = true; |
| | | state.locale = getLocale(); |
| | | state.builtinRegexEntries = buildBuiltinRegexEntries(); |
| | | resetTranslateCache(); |
| | | wrapLibraries(); |
| | | flushCallbacks(); |
| | | }); |
| | | } |
| | | |
| | | function readLocaleTags(options) { |
| | | var tags = []; |
| | | var i; |
| | | if (!options || !options.length) { |
| | | return state.supportedLocales.slice(); |
| | | } |
| | | for (i = 0; i < options.length; i++) { |
| | | if (typeof options[i] === "string") { |
| | | tags.push(normalizeLocale(options[i])); |
| | | } else if (options[i] && options[i].tag) { |
| | | tags.push(normalizeLocale(options[i].tag)); |
| | | } |
| | | } |
| | | return tags.length ? tags : state.supportedLocales.slice(); |
| | | } |
| | | |
| | | function readLocaleOptions(options) { |
| | | var list = []; |
| | | var i; |
| | | if (!options || !options.length) { |
| | | options = state.supportedLocales.slice(); |
| | | } |
| | | for (i = 0; i < options.length; i++) { |
| | | if (typeof options[i] === "string") { |
| | | list.push({ tag: normalizeLocale(options[i]), label: options[i] }); |
| | | } else if (options[i] && options[i].tag) { |
| | | list.push({ |
| | | tag: normalizeLocale(options[i].tag), |
| | | label: options[i].label || options[i].tag |
| | | }); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | function sortedLegacyEntries(map) { |
| | | var entries = []; |
| | | var key; |
| | | for (key in map) { |
| | | if (map.hasOwnProperty(key) && key.indexOf("regex:") !== 0) { |
| | | entries.push([key, map[key]]); |
| | | } |
| | | } |
| | | entries.sort(function (left, right) { |
| | | return right[0].length - left[0].length; |
| | | }); |
| | | return entries; |
| | | } |
| | | |
| | | function readLegacyRegexEntries(map) { |
| | | var entries = []; |
| | | var key; |
| | | var source; |
| | | for (key in map) { |
| | | if (!map.hasOwnProperty(key) || key.indexOf("regex:") !== 0) { |
| | | continue; |
| | | } |
| | | source = key.substring(6); |
| | | if (!source) { |
| | | continue; |
| | | } |
| | | if (isBrokenRegexEntry(source, map[key])) { |
| | | continue; |
| | | } |
| | | try { |
| | | entries.push({ |
| | | source: source, |
| | | regex: new RegExp(source), |
| | | value: map[key] |
| | | }); |
| | | } catch (e) { |
| | | } |
| | | } |
| | | entries.sort(function (left, right) { |
| | | return right.source.length - left.source.length; |
| | | }); |
| | | return entries; |
| | | } |
| | | |
| | | function isBrokenRegexEntry(source, value) { |
| | | if (!source || !value) { |
| | | return false; |
| | | } |
| | | if (value.indexOf("$=") >= 0) { |
| | | return true; |
| | | } |
| | | return /\\s\*|\\d\+|\\\||\\:|\(\?:/.test(value); |
| | | } |
| | | |
| | | function format(template, params) { |
| | | var result = template || ""; |
| | | var index; |
| | | if (!params) { |
| | | return result; |
| | | } |
| | | if (Object.prototype.toString.call(params) === "[object Array]") { |
| | | for (index = 0; index < params.length; index++) { |
| | | result = result.replace(new RegExp("\\{" + index + "\\}", "g"), params[index]); |
| | | } |
| | | return result; |
| | | } |
| | | for (index in params) { |
| | | if (params.hasOwnProperty(index)) { |
| | | result = result.replace(new RegExp("\\{" + index + "\\}", "g"), params[index]); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | function resetTranslateCache() { |
| | | state.translateCache = {}; |
| | | state.translateCacheSize = 0; |
| | | } |
| | | |
| | | function rememberTranslateCache(text, translated) { |
| | | if (state.translateCacheSize > 4000) { |
| | | resetTranslateCache(); |
| | | } |
| | | if (!Object.prototype.hasOwnProperty.call(state.translateCache, text)) { |
| | | state.translateCacheSize += 1; |
| | | } |
| | | state.translateCache[text] = translated; |
| | | return translated; |
| | | } |
| | | |
| | | function canTranslateText(text) { |
| | | return !!(text && TRANSLATABLE_RE.test(text)); |
| | | } |
| | | |
| | | function buildBuiltinRegexEntries() { |
| | | return [ |
| | | { |
| | | regex: /^圈(\d+)\s*\|\s*站点:\s*(\d+)\s*\|\s*(?:任务|Task):\s*(\d+)\s*\|\s*承载:\s*([\d.]+%)$/, |
| | | key: "legacy.regex.loopStatus", |
| | | fallback: "Zone {0} | Stations: {1} | Tasks: {2} | Load: {3}" |
| | | }, |
| | | { |
| | | regex: /^点击(?:删除|Delete)关联:\s*站点\s*(\d+)\s*->\s*设备\s*(\d+)$/, |
| | | key: "legacy.regex.stationDeviceLink", |
| | | fallback: "Click to remove mapping: Station {0} -> Device {1}" |
| | | } |
| | | ]; |
| | | } |
| | | |
| | | function formatBuiltinRegex(entry, args) { |
| | | var value = t(entry.key, args); |
| | | if (value === entry.key && entry.fallback) { |
| | | return format(entry.fallback, args); |
| | | } |
| | | return value; |
| | | } |
| | | |
| | | function t(key, params) { |
| | | var value = state.messages[key]; |
| | | if (!value) { |
| | | return key; |
| | | } |
| | | return format(value, params); |
| | | } |
| | | |
| | | function preserveSpaces(original, translated) { |
| | | var match = original.match(/^(\s*)([\s\S]*?)(\s*)$/); |
| | | if (!match) { |
| | | return translated; |
| | | } |
| | | return match[1] + translated + match[3]; |
| | | } |
| | | |
| | | function exactLegacy(text) { |
| | | var trimmed = (text || "").trim(); |
| | | var translated = state.legacy[trimmed]; |
| | | if (!translated) { |
| | | return text; |
| | | } |
| | | return preserveSpaces(text, translated); |
| | | } |
| | | |
| | | function fragmentLegacy(text) { |
| | | var result = text; |
| | | var i; |
| | | var entry; |
| | | for (i = 0; i < state.legacyEntries.length; i++) { |
| | | entry = state.legacyEntries[i]; |
| | | if (!entry[0] || entry[0].length < 2 || entry[0] === entry[1]) { |
| | | continue; |
| | | } |
| | | result = result.split(entry[0]).join(entry[1]); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | function regexLegacy(text) { |
| | | var trimmed = (text || "").trim(); |
| | | var i; |
| | | var entry; |
| | | var translated; |
| | | for (i = 0; i < state.legacyRegexEntries.length; i++) { |
| | | entry = state.legacyRegexEntries[i]; |
| | | if (!entry || !entry.regex) { |
| | | continue; |
| | | } |
| | | if (trimmed) { |
| | | translated = trimmed.replace(entry.regex, entry.value); |
| | | if (translated !== trimmed) { |
| | | return preserveSpaces(text, translated); |
| | | } |
| | | } |
| | | translated = text.replace(entry.regex, entry.value); |
| | | if (translated !== text) { |
| | | return translated; |
| | | } |
| | | } |
| | | for (i = 0; i < state.builtinRegexEntries.length; i++) { |
| | | entry = state.builtinRegexEntries[i]; |
| | | if (!entry || !entry.regex) { |
| | | continue; |
| | | } |
| | | if (trimmed) { |
| | | translated = trimmed.replace(entry.regex, function () { |
| | | return formatBuiltinRegex(entry, Array.prototype.slice.call(arguments, 1, -2)); |
| | | }); |
| | | if (translated !== trimmed) { |
| | | return preserveSpaces(text, translated); |
| | | } |
| | | } |
| | | translated = text.replace(entry.regex, function () { |
| | | return formatBuiltinRegex(entry, Array.prototype.slice.call(arguments, 1, -2)); |
| | | }); |
| | | if (translated !== text) { |
| | | return translated; |
| | | } |
| | | } |
| | | return text; |
| | | } |
| | | |
| | | function translate(text) { |
| | | if (!text || !state.ready || state.locale === state.defaultLocale) { |
| | | return text; |
| | | } |
| | | if (Object.prototype.hasOwnProperty.call(state.translateCache, text)) { |
| | | return state.translateCache[text]; |
| | | } |
| | | if (!canTranslateText(text)) { |
| | | return rememberTranslateCache(text, text); |
| | | } |
| | | var exact = exactLegacy(text); |
| | | if (exact !== text) { |
| | | return rememberTranslateCache(text, exact); |
| | | } |
| | | var regex = regexLegacy(text); |
| | | if (regex !== text) { |
| | | return rememberTranslateCache(text, regex); |
| | | } |
| | | return rememberTranslateCache(text, fragmentLegacy(text)); |
| | | } |
| | | |
| | | function translateAttribute(element, attrName) { |
| | | var value = element.getAttribute(attrName); |
| | | var translated = translate(value); |
| | | if (translated && translated !== value) { |
| | | element.setAttribute(attrName, translated); |
| | | } |
| | | } |
| | | |
| | | function applyI18nKeys(element) { |
| | | var textKey = element.getAttribute("data-i18n-key"); |
| | | var placeholderKey = element.getAttribute("data-i18n-placeholder-key"); |
| | | var titleKey = element.getAttribute("data-i18n-title-key"); |
| | | var params = element.getAttribute("data-i18n-params"); |
| | | var parsedParams = params ? parseJson(params) : null; |
| | | if (textKey) { |
| | | if (/^(INPUT|TEXTAREA)$/i.test(element.tagName)) { |
| | | if (element.type === "button" || element.type === "submit" || element.type === "reset") { |
| | | var buttonText = t(textKey, parsedParams); |
| | | if (element.value !== buttonText) { |
| | | element.value = buttonText; |
| | | } |
| | | } |
| | | } else { |
| | | var textValue = t(textKey, parsedParams); |
| | | if (element.textContent !== textValue) { |
| | | element.textContent = textValue; |
| | | } |
| | | } |
| | | } |
| | | if (placeholderKey) { |
| | | var placeholderValue = t(placeholderKey, parsedParams); |
| | | if (element.getAttribute("placeholder") !== placeholderValue) { |
| | | element.setAttribute("placeholder", placeholderValue); |
| | | } |
| | | } |
| | | if (titleKey) { |
| | | var titleValue = t(titleKey, parsedParams); |
| | | if (element.getAttribute("title") !== titleValue) { |
| | | element.setAttribute("title", titleValue); |
| | | } |
| | | } |
| | | } |
| | | |
| | | function shouldSkipElement(element) { |
| | | if (!element || element.nodeType !== 1) { |
| | | return true; |
| | | } |
| | | return /^(SCRIPT|STYLE|TEXTAREA|CODE|PRE)$/i.test(element.tagName); |
| | | } |
| | | |
| | | function traverse(node) { |
| | | var child; |
| | | if (!node) { |
| | | return; |
| | | } |
| | | if (node.nodeType === 3) { |
| | | var translatedText = translate(node.nodeValue); |
| | | if (translatedText !== node.nodeValue) { |
| | | node.nodeValue = translatedText; |
| | | } |
| | | return; |
| | | } |
| | | if (node.nodeType !== 1 || shouldSkipElement(node)) { |
| | | return; |
| | | } |
| | | applyI18nKeys(node); |
| | | translateAttribute(node, "placeholder"); |
| | | translateAttribute(node, "title"); |
| | | translateAttribute(node, "aria-label"); |
| | | translateAttribute(node, "alt"); |
| | | if (/^(INPUT)$/i.test(node.tagName)) { |
| | | if (/^(button|submit|reset)$/i.test(node.type || "")) { |
| | | if (node.value) { |
| | | var translatedValue = translate(node.value); |
| | | if (translatedValue !== node.value) { |
| | | node.value = translatedValue; |
| | | } |
| | | } |
| | | } else if ((node.readOnly || node.disabled || node.getAttribute("readonly") !== null) && node.value) { |
| | | var translatedReadonlyValue = translate(node.value); |
| | | if (translatedReadonlyValue !== node.value) { |
| | | node.value = translatedReadonlyValue; |
| | | } |
| | | } |
| | | } |
| | | child = node.firstChild; |
| | | while (child) { |
| | | traverse(child); |
| | | child = child.nextSibling; |
| | | } |
| | | } |
| | | |
| | | function apply(root) { |
| | | if (!root || !state.ready) { |
| | | return; |
| | | } |
| | | state.applying = true; |
| | | try { |
| | | traverse(root); |
| | | } finally { |
| | | state.applying = false; |
| | | } |
| | | } |
| | | |
| | | function scheduleFlush() { |
| | | if (state.flushTimer) { |
| | | return; |
| | | } |
| | | var scheduler = window.requestAnimationFrame || function (callback) { |
| | | return window.setTimeout(callback, 16); |
| | | }; |
| | | state.flushTimer = scheduler(flushPendingNodes); |
| | | } |
| | | |
| | | function enqueueNode(node) { |
| | | if (!node || node.__wcsI18nQueued) { |
| | | return; |
| | | } |
| | | node.__wcsI18nQueued = true; |
| | | state.pendingNodes.push(node); |
| | | scheduleFlush(); |
| | | } |
| | | |
| | | function flushPendingNodes() { |
| | | var queue; |
| | | var i; |
| | | state.flushTimer = 0; |
| | | if (!state.pendingNodes.length) { |
| | | return; |
| | | } |
| | | if (state.applying) { |
| | | scheduleFlush(); |
| | | return; |
| | | } |
| | | queue = state.pendingNodes.slice(); |
| | | state.pendingNodes = []; |
| | | state.applying = true; |
| | | try { |
| | | for (i = 0; i < queue.length; i++) { |
| | | if (!queue[i]) { |
| | | continue; |
| | | } |
| | | queue[i].__wcsI18nQueued = false; |
| | | if (queue[i].nodeType === 3) { |
| | | var translatedText = translate(queue[i].nodeValue); |
| | | if (translatedText !== queue[i].nodeValue) { |
| | | queue[i].nodeValue = translatedText; |
| | | } |
| | | } else if (queue[i].nodeType === 1) { |
| | | traverse(queue[i]); |
| | | } |
| | | } |
| | | } finally { |
| | | state.applying = false; |
| | | } |
| | | if (state.pendingNodes.length) { |
| | | scheduleFlush(); |
| | | } |
| | | } |
| | | |
| | | function observeDom() { |
| | | if (state.observer || !window.MutationObserver || !document || !document.documentElement) { |
| | | return; |
| | | } |
| | | state.observer = new MutationObserver(function (mutations) { |
| | | var i; |
| | | if (state.applying) { |
| | | return; |
| | | } |
| | | for (i = 0; i < mutations.length; i++) { |
| | | if (mutations[i].type === "childList") { |
| | | for (var j = 0; j < mutations[i].addedNodes.length; j++) { |
| | | enqueueNode(mutations[i].addedNodes[j]); |
| | | } |
| | | } else if (mutations[i].type === "characterData" && mutations[i].target) { |
| | | enqueueNode(mutations[i].target); |
| | | } else if (mutations[i].type === "attributes" && mutations[i].target) { |
| | | enqueueNode(mutations[i].target); |
| | | } |
| | | } |
| | | }); |
| | | state.observer.observe(document.documentElement, { |
| | | childList: true, |
| | | subtree: true, |
| | | characterData: true, |
| | | attributes: true, |
| | | attributeFilter: ["placeholder", "title", "aria-label", "alt"] |
| | | }); |
| | | } |
| | | |
| | | function wrapLayer() { |
| | | if (!window.layer || window.layer.__wcsI18nWrapped) { |
| | | return; |
| | | } |
| | | var layer = window.layer; |
| | | var rawMsg = layer.msg; |
| | | var rawAlert = layer.alert; |
| | | var rawConfirm = layer.confirm; |
| | | var rawTips = layer.tips; |
| | | var rawOpen = layer.open; |
| | | |
| | | if (typeof rawMsg === "function") { |
| | | layer.msg = function (content, options, end) { |
| | | return rawMsg.call(layer, translate(content), options, end); |
| | | }; |
| | | } |
| | | if (typeof rawAlert === "function") { |
| | | layer.alert = function (content, options, yes) { |
| | | if (options && typeof options === "object" && typeof options.title === "string") { |
| | | options.title = translate(options.title); |
| | | } |
| | | return rawAlert.call(layer, translate(content), options, yes); |
| | | }; |
| | | } |
| | | if (typeof rawConfirm === "function") { |
| | | layer.confirm = function (content, options, yes, cancel) { |
| | | if (typeof options === "string") { |
| | | options = translate(options); |
| | | } else if (options && typeof options === "object") { |
| | | if (typeof options.title === "string") { |
| | | options.title = translate(options.title); |
| | | } else if (!options.title) { |
| | | options.title = translate("信息"); |
| | | } |
| | | if (Object.prototype.toString.call(options.btn) === "[object Array]") { |
| | | for (var i = 0; i < options.btn.length; i++) { |
| | | options.btn[i] = translate(options.btn[i]); |
| | | } |
| | | } |
| | | } |
| | | return rawConfirm.call(layer, translate(content), options, yes, cancel); |
| | | }; |
| | | } |
| | | if (typeof rawTips === "function") { |
| | | layer.tips = function (content, follow, options) { |
| | | return rawTips.call(layer, translate(content), follow, options); |
| | | }; |
| | | } |
| | | if (typeof rawOpen === "function") { |
| | | layer.open = function (options) { |
| | | if (options && typeof options === "object") { |
| | | if (typeof options.title === "string") { |
| | | options.title = translate(options.title); |
| | | } else if (Object.prototype.toString.call(options.title) === "[object Array]" && typeof options.title[0] === "string") { |
| | | options.title[0] = translate(options.title[0]); |
| | | } |
| | | if (typeof options.content === "string") { |
| | | if (options.type === 2) { |
| | | options.content = appendNonceUrl(options.content); |
| | | } else { |
| | | options.content = translate(options.content); |
| | | } |
| | | } |
| | | if (Object.prototype.toString.call(options.btn) === "[object Array]") { |
| | | for (var i = 0; i < options.btn.length; i++) { |
| | | options.btn[i] = translate(options.btn[i]); |
| | | } |
| | | } |
| | | } |
| | | return rawOpen.call(layer, options); |
| | | }; |
| | | } |
| | | window.layer.__wcsI18nWrapped = true; |
| | | } |
| | | |
| | | function wrapElement() { |
| | | if (!window.ELEMENT || window.ELEMENT.__wcsI18nWrapped) { |
| | | return; |
| | | } |
| | | var element = window.ELEMENT; |
| | | var methods = ["success", "warning", "info", "error"]; |
| | | var i; |
| | | if (typeof element.i18n === "function") { |
| | | element.i18n(function (key, value) { |
| | | return t(key, value); |
| | | }); |
| | | } |
| | | if (typeof element.Message === "function") { |
| | | var rawMessage = element.Message; |
| | | element.Message = function (options) { |
| | | if (typeof options === "string") { |
| | | return rawMessage.call(element, translate(options)); |
| | | } |
| | | if (options && typeof options === "object" && typeof options.message === "string") { |
| | | options.message = translate(options.message); |
| | | } |
| | | return rawMessage.call(element, options); |
| | | }; |
| | | for (i = 0; i < methods.length; i++) { |
| | | if (typeof rawMessage[methods[i]] === "function") { |
| | | (function (methodName) { |
| | | element.Message[methodName] = function (options) { |
| | | if (typeof options === "string") { |
| | | return rawMessage[methodName].call(rawMessage, translate(options)); |
| | | } |
| | | if (options && typeof options === "object" && typeof options.message === "string") { |
| | | options.message = translate(options.message); |
| | | } |
| | | return rawMessage[methodName].call(rawMessage, options); |
| | | }; |
| | | })(methods[i]); |
| | | } |
| | | } |
| | | } |
| | | if (element.MessageBox) { |
| | | wrapMessageBoxMethod(element.MessageBox, "alert"); |
| | | wrapMessageBoxMethod(element.MessageBox, "confirm"); |
| | | wrapMessageBoxMethod(element.MessageBox, "prompt"); |
| | | } |
| | | window.ELEMENT.__wcsI18nWrapped = true; |
| | | } |
| | | |
| | | function wrapMessageBoxMethod(box, methodName) { |
| | | if (typeof box[methodName] !== "function") { |
| | | return; |
| | | } |
| | | var raw = box[methodName]; |
| | | box[methodName] = function (message, title, options) { |
| | | if (typeof message === "string") { |
| | | message = translate(message); |
| | | } |
| | | if (typeof title === "string") { |
| | | title = translate(title); |
| | | } else if (title && typeof title === "object" && typeof title.message === "string") { |
| | | title.message = translate(title.message); |
| | | } |
| | | if (options && typeof options === "object") { |
| | | if (typeof options.confirmButtonText === "string") { |
| | | options.confirmButtonText = translate(options.confirmButtonText); |
| | | } |
| | | if (typeof options.cancelButtonText === "string") { |
| | | options.cancelButtonText = translate(options.cancelButtonText); |
| | | } |
| | | if (typeof options.title === "string") { |
| | | options.title = translate(options.title); |
| | | } |
| | | } |
| | | return raw.call(box, message, title, options); |
| | | }; |
| | | } |
| | | |
| | | function wrapLibraries() { |
| | | wrapLayer(); |
| | | wrapElement(); |
| | | } |
| | | |
| | | function scheduleBridgeWrap() { |
| | | var timer = window.setInterval(function () { |
| | | state.bridgeAttempts += 1; |
| | | wrapLibraries(); |
| | | if ((window.layer || !window.ELEMENT) && state.bridgeAttempts > 20) { |
| | | window.clearInterval(timer); |
| | | } |
| | | }, 300); |
| | | } |
| | | |
| | | function patchXmlHttpRequest() { |
| | | if (!window.XMLHttpRequest || window.XMLHttpRequest.__wcsI18nPatched) { |
| | | return; |
| | | } |
| | | var rawOpen = window.XMLHttpRequest.prototype.open; |
| | | var rawSend = window.XMLHttpRequest.prototype.send; |
| | | var rawSetHeader = window.XMLHttpRequest.prototype.setRequestHeader; |
| | | |
| | | window.XMLHttpRequest.prototype.open = function (method, url) { |
| | | this.__wcsI18nUrl = url; |
| | | this.__wcsI18nHeaderSet = false; |
| | | return rawOpen.apply(this, arguments); |
| | | }; |
| | | window.XMLHttpRequest.prototype.setRequestHeader = function (name, value) { |
| | | if (String(name).toLowerCase() === "x-lang") { |
| | | this.__wcsI18nHeaderSet = true; |
| | | } |
| | | return rawSetHeader.apply(this, arguments); |
| | | }; |
| | | window.XMLHttpRequest.prototype.send = function () { |
| | | try { |
| | | if (!this.__wcsI18nHeaderSet && shouldAttachLangHeader(this.__wcsI18nUrl)) { |
| | | rawSetHeader.call(this, "X-Lang", getLocale()); |
| | | this.__wcsI18nHeaderSet = true; |
| | | } |
| | | } catch (e) { |
| | | } |
| | | return rawSend.apply(this, arguments); |
| | | }; |
| | | window.XMLHttpRequest.__wcsI18nPatched = true; |
| | | } |
| | | |
| | | function patchFetch() { |
| | | if (!window.fetch || window.fetch.__wcsI18nPatched) { |
| | | return; |
| | | } |
| | | var rawFetch = window.fetch; |
| | | window.fetch = function (input, init) { |
| | | var requestUrl = typeof input === "string" ? input : (input && input.url); |
| | | init = init || {}; |
| | | if (shouldAttachLangHeader(requestUrl)) { |
| | | init.headers = init.headers || {}; |
| | | if (typeof Headers !== "undefined" && init.headers instanceof Headers) { |
| | | if (!init.headers.has("X-Lang")) { |
| | | init.headers.set("X-Lang", getLocale()); |
| | | } |
| | | } else if (!init.headers["X-Lang"] && !init.headers["x-lang"]) { |
| | | init.headers["X-Lang"] = getLocale(); |
| | | } |
| | | } |
| | | return rawFetch.call(window, input, init); |
| | | }; |
| | | window.fetch.__wcsI18nPatched = true; |
| | | } |
| | | |
| | | function shouldAttachLangHeader(url) { |
| | | if (!url) { |
| | | return true; |
| | | } |
| | | if (typeof url !== "string") { |
| | | return true; |
| | | } |
| | | return url.indexOf("http://") !== 0 && url.indexOf("https://") !== 0 || url.indexOf(window.location.origin) === 0; |
| | | } |
| | | |
| | | var api = { |
| | | load: load, |
| | | onReady: onReady, |
| | | t: t, |
| | | tl: translate, |
| | | apply: apply, |
| | | getLocale: getLocale, |
| | | setLocale: setLocale, |
| | | getLocaleOptions: function () { |
| | | return state.localeOptions.slice(); |
| | | }, |
| | | getSupportedLocales: function () { |
| | | return state.supportedLocales.slice(); |
| | | }, |
| | | getDefaultLocale: function () { |
| | | return state.defaultLocale; |
| | | }, |
| | | addNonceUrl: appendNonceUrl, |
| | | isReady: function () { |
| | | return state.ready; |
| | | } |
| | | }; |
| | | |
| | | return api; |
| | | })(window, document); |
| | | |
| | | // 赋值 |
| | | function setVal(el, val) { |
| | | if (el.text() !== val){ |
| | |
| | | return this.deviceList; |
| | | }, |
| | | visualizationTitle() { |
| | | return `日志可视化 - ${this.visDeviceType} ${this.visDeviceNo} (${this.searchForm.day})`; |
| | | return this.i18n('deviceLogs.visualizationPrefix', '日志可视化 - ') + this.visDeviceType + ' ' + this.visDeviceNo + ' (' + this.searchForm.day + ')'; |
| | | }, |
| | | downloadDialogTitle() { |
| | | return this.i18n('deviceLogs.downloadDialogTitle', '文件下载中'); |
| | | }, |
| | | maxSliderValue() { |
| | | return Math.max(0, this.endTime - this.startTime); |
| | |
| | | this.loadDeviceEnums(); |
| | | this.loadDateTree(); |
| | | }, |
| | | mounted() { |
| | | if (window.WCS_I18N && typeof window.WCS_I18N.onReady === 'function') { |
| | | let that = this; |
| | | window.WCS_I18N.onReady(function () { |
| | | that.$forceUpdate(); |
| | | }); |
| | | } |
| | | }, |
| | | methods: { |
| | | i18n(key, fallback, params) { |
| | | if (window.WCS_I18N && typeof window.WCS_I18N.t === 'function') { |
| | | var translated = window.WCS_I18N.t(key, params); |
| | | if (translated && translated !== key) { |
| | | return translated; |
| | | } |
| | | } |
| | | return fallback || key; |
| | | }, |
| | | // --- Initialization --- |
| | | loadDeviceEnums() { |
| | | let that = this; |
| | |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script src="../../static/js/marked.min.js"></script> |
| | | <script src="../../static/js/purify.min.js"></script> |
| | | <script> |
| | |
| | | <div class="route-card" :class="routeCardClass(route)" v-for="(route, idx) in routes" :key="route.id ? ('route_' + route.id) : ('new_' + idx)"> |
| | | <div class="route-head"> |
| | | <div class="route-title"> |
| | | <el-input v-model="route.name" size="mini" placeholder="路由名称"></el-input> |
| | | <el-input |
| | | :value="displayRouteName(route)" |
| | | size="mini" |
| | | placeholder="路由名称" |
| | | @input="handleRouteNameInput(route, $event)"></el-input> |
| | | <div class="route-id-line">#{{ route.id || 'new' }} · 优先级 {{ route.priority || 0 }}</div> |
| | | </div> |
| | | <div class="route-state"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <el-dialog title="LLM调用日志" :visible.sync="logDialogVisible" width="88%" :close-on-click-modal="false"> |
| | | <el-dialog :title="i18n('llm.logsTitle', 'LLM调用日志')" :visible.sync="logDialogVisible" width="88%" :close-on-click-modal="false"> |
| | | <div class="log-toolbar"> |
| | | <el-select v-model="logQuery.scene" size="mini" clearable placeholder="场景" style="width:180px;"> |
| | | <el-option label="chat" value="chat"></el-option> |
| | |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <el-dialog :title="logDetailTitle || '日志详情'" :visible.sync="logDetailVisible" width="82%" :close-on-click-modal="false" append-to-body> |
| | | <el-dialog :title="logDetailTitle || i18n('llm.logDetailTitle', '日志详情')" :visible.sync="logDetailVisible" width="82%" :close-on-click-modal="false" append-to-body> |
| | | <div class="log-detail-body">{{ logDetailText || '-' }}</div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button size="mini" @click="copyText(logDetailText)">复制全文</el-button> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script> |
| | | new Vue({ |
| | | el: '#app', |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | i18n: function(key, fallback, params) { |
| | | if (window.WCS_I18N && typeof window.WCS_I18N.t === 'function') { |
| | | var translated = window.WCS_I18N.t(key, params); |
| | | if (translated && translated !== key) { |
| | | return translated; |
| | | } |
| | | } |
| | | return fallback || key; |
| | | }, |
| | | translateLegacyText: function(text) { |
| | | if (window.WCS_I18N && typeof window.WCS_I18N.tl === 'function') { |
| | | return window.WCS_I18N.tl(text); |
| | | } |
| | | return text; |
| | | }, |
| | | displayRouteName: function(route) { |
| | | var value = route && route.name ? String(route.name) : ''; |
| | | return this.translateLegacyText(value); |
| | | }, |
| | | handleRouteNameInput: function(route, value) { |
| | | if (!route) { |
| | | return; |
| | | } |
| | | route.name = value; |
| | | }, |
| | | formatDateTime: function(input) { |
| | | if (!input) return '-'; |
| | | var d = input instanceof Date ? input : new Date(input); |
| | |
| | | + '错误: ' + (row.errorMessage || '-') + '\n\n' |
| | | + '请求:\n' + (row.requestContent || '-') + '\n\n' |
| | | + '响应:\n' + (row.responseContent || '-'); |
| | | this.logDetailTitle = '日志详情 - ' + (row.traceId || row.id || ''); |
| | | this.logDetailTitle = this.i18n('llm.logDetailPrefix', '日志详情 - ') + (row.traceId || row.id || ''); |
| | | this.logDetailText = text; |
| | | this.logDetailVisible = true; |
| | | }, |
| | |
| | | } |
| | | }, |
| | | mounted: function() { |
| | | var self = this; |
| | | if (window.WCS_I18N && typeof window.WCS_I18N.onReady === 'function') { |
| | | window.WCS_I18N.onReady(function() { |
| | | self.$forceUpdate(); |
| | | }); |
| | | } |
| | | this.loadRoutes(); |
| | | } |
| | | }); |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/apiLog/apiLog.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basCrnp/basCrnp.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basCrnp/basCrnp.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basCrnpErr/basCrnpErr.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basCrnpErr/basCrnpErr.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basCrnpErrLog/basCrnpErrLog.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basCrnpErrLog/basCrnpErrLog.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basCrnpOpt/basCrnpOpt.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basCrnpOpt/basCrnpOpt.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basDevp/basDevp.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basDevp/basDevp.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basDualCrnp/basDualCrnp.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basDualCrnp/basDualCrnp.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basDualCrnpErr/basDualCrnpErr.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basDualCrnpErr/basDualCrnpErr.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basDualCrnpErrLog/basDualCrnpErrLog.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basDualCrnpErrLog/basDualCrnpErrLog.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basDualCrnpOpt/basDualCrnpOpt.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basDualCrnpOpt/basDualCrnpOpt.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basLocSts/basLocSts.js" charset="utf-8"></script> |
| | | |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basLocSts/basLocSts.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basMap/basMap.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body>da |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basMap/basMap.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basOutStationArea/basOutStationArea.js"></script> |
| | | </body> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basRgv/basRgv.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basRgv/basRgv.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basRgvErr/basRgvErr.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basRgvErr/basRgvErr.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basRgvErrLog/basRgvErrLog.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basRgvErrLog/basRgvErrLog.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basRgvOpt/basRgvOpt.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basRgvOpt/basRgvOpt.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basStation/basStation.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basStation/basStation.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basStationDevice/basStationDevice.js"></script> |
| | | </body> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basStationOpt/basStationOpt.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basStationOpt/basStationOpt.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basWrkIotype/basWrkIotype.js" charset="utf-8"></script> |
| | | |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basWrkIotype/basWrkIotype.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basWrkStatus/basWrkStatus.js" charset="utf-8"></script> |
| | | |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/basWrkStatus/basWrkStatus.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/config/config.js" charset="utf-8"></script> |
| | | |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/config/config.js" charset="utf-8"></script> |
| | | |
| | |
| | | <title>调试参数</title> |
| | | <link rel="stylesheet" href="../../static/vue/element/element.css"> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1"></script> |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <style> |
| | |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../static/layui/css/layui.css" media="all"> |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js?v=20260309_i18n_fix1"></script> |
| | | <style> |
| | | body { |
| | | background-color: #fff; |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/deviceConfig/deviceConfig.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/deviceConfig/deviceConfig.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | </el-dialog> |
| | | |
| | | <!-- Download Progress Dialog --> |
| | | <el-dialog title="文件下载中" :visible.sync="downloadDialogVisible" width="400px" :close-on-click-modal="false" :show-close="false"> |
| | | <el-dialog :title="downloadDialogTitle" :visible.sync="downloadDialogVisible" width="400px" :close-on-click-modal="false" :show-close="false"> |
| | | <div style="padding: 10px;"> |
| | | <div style="margin-bottom: 5px; font-size: 14px;">压缩生成进度</div> |
| | | <el-progress :percentage="buildProgress" :text-inside="true" :stroke-width="18"></el-progress> |
| | |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script src="../../static/vue/js/vue.min.js"></script> |
| | | <script src="../../static/vue/element/element.js"></script> |
| | | <script src="../../components/MonitorCardKit.js"></script> |
| | |
| | | <script src="../../components/WatchRgvCard.js"></script> |
| | | <script src="../../components/WatchDualCrnCard.js"></script> |
| | | <script src="../../components/DevpCard.js"></script> |
| | | <script type="text/javascript" src="../../static/js/deviceLogs/deviceLogs.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/deviceLogs/deviceLogs.js?v=20260309_i18n_pagefix1" charset="utf-8"></script> |
| | | </body> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/httpRequestLog/httpRequestLog.js" charset="utf-8"></script> |
| | | </body> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/httpRequestLog/httpRequestLog.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .lang-select { |
| | | width: 160px; |
| | | } |
| | | |
| | | .header-right .el-tag { |
| | | border-radius: 999px; |
| | | } |
| | |
| | | size="small" |
| | | clearable |
| | | prefix-icon="el-icon-search" |
| | | placeholder="搜索菜单"> |
| | | :placeholder="t('index.searchMenu')"> |
| | | </el-input> |
| | | </div> |
| | | |
| | |
| | | <div class="aside-empty" v-if="filteredMenus.length === 0"> |
| | | <el-empty |
| | | :image-size="80" |
| | | :description="menuKeyword ? '没有匹配菜单' : '当前账号没有可用菜单'"> |
| | | :description="menuKeyword ? t('index.noMatchedMenu') : t('index.noAvailableMenu')"> |
| | | </el-empty> |
| | | </div> |
| | | </template> |
| | | </el-scrollbar> |
| | | |
| | | <div class="aside-footer" v-show="!isCollapse"> |
| | | <div class="aside-footer-copy">© 2026 浙江中扬立库技术有限公司</div> |
| | | <div class="aside-footer-copy">© 2026 {{ t('app.company') }}</div> |
| | | <div class="aside-footer-version"> |
| | | <span class="aside-footer-version-text">{{ versionText }}</span> |
| | | <el-tag |
| | |
| | | size="mini" |
| | | :type="licenseTagType" |
| | | effect="dark"> |
| | | 临时许可证有效期:{{ licenseDays }}天 |
| | | {{ t('index.licenseDays', [licenseDays]) }} |
| | | </el-tag> |
| | | <el-tag |
| | | v-if="fakeVisible" |
| | |
| | | :type="fakeRunning ? 'danger' : 'info'" |
| | | effect="dark" |
| | | @click.native="toggleFakeSystem"> |
| | | {{ fakeRunning ? '仿真运行中' : '仿真未运行' }} |
| | | {{ fakeRunning ? t('index.fakeRunning') : t('index.fakeStopped') }} |
| | | </el-tag> |
| | | <el-select |
| | | v-model="currentLocale" |
| | | size="mini" |
| | | class="lang-select" |
| | | @change="handleLocaleChange"> |
| | | <el-option |
| | | v-for="item in localeOptions" |
| | | :key="item.tag" |
| | | :label="item.label" |
| | | :value="item.tag"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-button circle size="mini" icon="el-icon-refresh" @click="refreshActiveTab"></el-button> |
| | | <el-button circle size="mini" icon="el-icon-full-screen" @click="toggleFullScreen"></el-button> |
| | | |
| | |
| | | <i class="el-icon-arrow-down"></i> |
| | | </span> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item command="profile">基本资料</el-dropdown-item> |
| | | <el-dropdown-item command="logout" divided>退出登录</el-dropdown-item> |
| | | <el-dropdown-item command="profile">{{ t('common.profile') }}</el-dropdown-item> |
| | | <el-dropdown-item command="logout" divided>{{ t('common.logout') }}</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </div> |
| | |
| | | </el-tabs> |
| | | |
| | | <div class="tabs-tools"> |
| | | <el-tooltip content="关闭其他页签" placement="top"> |
| | | <el-tooltip :content="t('common.closeOtherTabs')" placement="top"> |
| | | <el-button size="mini" icon="el-icon-close" @click="closeOtherTabs"></el-button> |
| | | </el-tooltip> |
| | | <el-tooltip content="返回控制中心" placement="top"> |
| | | <el-tooltip :content="t('common.backHome')" placement="top"> |
| | | <el-button size="mini" type="primary" icon="el-icon-house" @click="openHomeTab"></el-button> |
| | | </el-tooltip> |
| | | </div> |
| | |
| | | v-for="tab in tabs" |
| | | :key="'frame-' + tab.name" |
| | | class="page-frame" |
| | | :data-tab-name="tab.name" |
| | | v-show="activeTab === tab.name" |
| | | :src="tab.currentSrc" |
| | | @load="handleFrameLoad(tab.name)"> |
| | |
| | | </el-container> |
| | | |
| | | <el-dialog |
| | | title="许可证即将过期" |
| | | :title="t('index.licenseExpiring')" |
| | | :visible.sync="licenseDialogVisible" |
| | | width="420px" |
| | | :close-on-click-modal="false"> |
| | | <div class="license-dialog-text">{{ licenseDialogText }}</div> |
| | | <span slot="footer"> |
| | | <el-button type="primary" @click="licenseDialogVisible = false">知道了</el-button> |
| | | <el-button type="primary" @click="licenseDialogVisible = false">{{ t('common.ok') }}</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | |
| | | |
| | | <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../static/js/layer/layer.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js?v=20260309_i18n_fix1"></script> |
| | | <script type="text/javascript" src="../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../static/vue/element/element.js"></script> |
| | | <script> |
| | |
| | | }; |
| | | var TAB_STORAGE_KEY = "wcs-element-home-tabs"; |
| | | var USER_STORAGE_KEY = "username"; |
| | | var INDEX_I18N_FALLBACKS = { |
| | | "app.title": "浙江中扬 - 自动化立体仓库 - WCS", |
| | | "app.company": "浙江中扬立库技术有限公司", |
| | | "common.loadingPage": "正在加载页面...", |
| | | "common.loadingTab": "正在加载 “{0}” ...", |
| | | "common.refreshingTab": "正在刷新 “{0}” ...", |
| | | "common.ok": "知道了", |
| | | "common.prompt": "提示", |
| | | "common.profile": "基本资料", |
| | | "common.logout": "退出登录", |
| | | "common.closeOtherTabs": "关闭其他页签", |
| | | "common.backHome": "返回控制中心", |
| | | "common.aiAssistant": "AI助手", |
| | | "common.workPage": "工作页面", |
| | | "common.businessPage": "业务页面", |
| | | "index.searchMenu": "搜索菜单", |
| | | "index.noMatchedMenu": "没有匹配菜单", |
| | | "index.noAvailableMenu": "当前账号没有可用菜单", |
| | | "index.licenseDays": "临时许可证有效期:{0}天", |
| | | "index.fakeRunning": "仿真运行中", |
| | | "index.fakeStopped": "仿真未运行", |
| | | "index.licenseExpiring": "许可证即将过期", |
| | | "index.homeTab": "控制中心", |
| | | "index.homeGroup": "实时监控", |
| | | "index.profileGroup": "账户中心", |
| | | "index.versionLoading": "Version loading...", |
| | | "index.licenseExpireAt": "许可证将于 {0} 过期,剩余有效期:{1} 天。", |
| | | "index.confirmStopFake": "确定要停止仿真模拟吗?", |
| | | "index.confirmStartFake": "确定要启动仿真模拟吗?", |
| | | "index.fakeStoppedSuccess": "仿真模拟已停止", |
| | | "index.fakeStartedSuccess": "仿真模拟已启动", |
| | | "index.operationFailed": "操作失败", |
| | | "index.menuLoadFailed": "菜单加载失败", |
| | | "index.menuLoadFailedDetail": "菜单加载失败,请检查接口状态" |
| | | }; |
| | | |
| | | new Vue({ |
| | | el: "#app", |
| | |
| | | isCollapse: false, |
| | | menuLoading: true, |
| | | pageLoading: true, |
| | | loadingText: "正在加载页面...", |
| | | loadingText: window.WCS_I18N ? window.WCS_I18N.tl("正在加载页面...") : "正在加载页面...", |
| | | menuKeyword: "", |
| | | menus: [], |
| | | defaultOpeneds: [], |
| | |
| | | licenseDays: null, |
| | | licenseDialogVisible: false, |
| | | licenseDialogText: "", |
| | | currentLocale: window.WCS_I18N ? window.WCS_I18N.getLocale() : "zh-CN", |
| | | localeOptions: [], |
| | | fakeVisible: false, |
| | | fakeRunning: false, |
| | | fakeStatusInterval: null, |
| | | menuSyncVersion: 0, |
| | | menuSyncTimer: null, |
| | | userName: localStorage.getItem(USER_STORAGE_KEY) || "管理员", |
| | | userName: localStorage.getItem(USER_STORAGE_KEY) || (window.WCS_I18N ? window.WCS_I18N.tl("管理员") : "管理员"), |
| | | aiLayerIndex: null, |
| | | aiTipIndex: null |
| | | }; |
| | |
| | | return result; |
| | | }, |
| | | activeTabMeta: function () { |
| | | return this.getTabByName(this.activeTab) || this.createTab(HOME_TAB_CONFIG); |
| | | return this.getTabByName(this.activeTab) || this.createTab(this.resolveHomeConfig()); |
| | | }, |
| | | activeTabTitle: function () { |
| | | return this.activeTabMeta.title; |
| | |
| | | }, |
| | | versionText: function () { |
| | | if (!this.version) { |
| | | return "Version loading..."; |
| | | return this.t("index.versionLoading"); |
| | | } |
| | | return "Version " + this.version; |
| | | }, |
| | |
| | | return "info"; |
| | | }, |
| | | userShortName: function () { |
| | | return (this.userName || "管理员").substring(0, 1); |
| | | return (this.userName || this.tl("管理员")).substring(0, 1); |
| | | } |
| | | }, |
| | | watch: { |
| | | activeTab: function () { |
| | | var tab = this.getTabByName(this.activeTab); |
| | | this.syncMenuStateByUrl(tab ? tab.url : HOME_TAB_CONFIG.url); |
| | | this.syncMenuStateByUrl(tab ? tab.url : this.resolveHomeConfig().url); |
| | | this.pageLoading = !!(tab && !tab.loaded); |
| | | if (this.pageLoading) { |
| | | this.loadingText = "正在加载 “" + tab.title + "” ..."; |
| | | this.loadingText = this.t("common.loadingTab", [tab.title]); |
| | | } |
| | | document.title = (tab ? tab.title : HOME_TAB_CONFIG.title) + " - 浙江中扬 - 自动化立体仓库 - WCS"; |
| | | this.updateDocumentTitle(tab ? tab.title : this.resolveHomeConfig().title); |
| | | this.persistTabs(); |
| | | } |
| | | }, |
| | |
| | | } |
| | | |
| | | this.restoreTabs(); |
| | | this.bindI18n(); |
| | | this.installCompatBridge(); |
| | | this.loadSystemVersion(); |
| | | this.loadMenu(); |
| | |
| | | }, |
| | | mounted: function () { |
| | | $("#ai-assistant-btn").html(getAiIconHtml(60, 60)); |
| | | document.title = this.activeTabTitle + " - 浙江中扬 - 自动化立体仓库 - WCS"; |
| | | this.updateDocumentTitle(this.activeTabTitle); |
| | | }, |
| | | beforeDestroy: function () { |
| | | if (this.fakeStatusInterval) { |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | t: function (key, params) { |
| | | var value = window.WCS_I18N ? window.WCS_I18N.t(key, params) : key; |
| | | if (value !== key) { |
| | | return value; |
| | | } |
| | | value = INDEX_I18N_FALLBACKS[key] || key; |
| | | if (!params) { |
| | | return value; |
| | | } |
| | | if (Object.prototype.toString.call(params) === "[object Array]") { |
| | | for (var i = 0; i < params.length; i++) { |
| | | value = value.replace(new RegExp("\\{" + i + "\\}", "g"), params[i]); |
| | | } |
| | | return value; |
| | | } |
| | | return value; |
| | | }, |
| | | tl: function (text) { |
| | | return window.WCS_I18N ? window.WCS_I18N.tl(text) : text; |
| | | }, |
| | | bindI18n: function () { |
| | | var that = this; |
| | | if (!window.WCS_I18N) { |
| | | return; |
| | | } |
| | | window.WCS_I18N.onReady(function (i18n) { |
| | | that.currentLocale = i18n.getLocale(); |
| | | that.localeOptions = i18n.getLocaleOptions(); |
| | | that.refreshI18nState(); |
| | | }); |
| | | }, |
| | | refreshI18nState: function () { |
| | | var that = this; |
| | | var homeConfig = this.resolveHomeConfig(); |
| | | var profileConfig = this.resolveProfileConfig(); |
| | | var i; |
| | | HOME_TAB_CONFIG.title = homeConfig.title; |
| | | HOME_TAB_CONFIG.group = homeConfig.group; |
| | | PROFILE_TAB_CONFIG.title = profileConfig.title; |
| | | PROFILE_TAB_CONFIG.group = profileConfig.group; |
| | | for (i = 0; i < this.tabs.length; i++) { |
| | | if (this.isHomeTabUrl(this.tabs[i].url)) { |
| | | this.tabs[i].title = homeConfig.title; |
| | | this.tabs[i].group = homeConfig.group; |
| | | this.tabs[i].home = true; |
| | | } else if (this.resolveViewSrc(this.tabs[i].url) === this.resolveViewSrc(profileConfig.url)) { |
| | | this.tabs[i].title = profileConfig.title; |
| | | this.tabs[i].group = profileConfig.group; |
| | | } else { |
| | | this.tabs[i].title = this.translateTabTitle(this.tabs[i].title); |
| | | this.tabs[i].group = this.tl(this.tabs[i].group); |
| | | } |
| | | } |
| | | this.updateDocumentTitle(this.activeTabTitle); |
| | | this.persistTabs(); |
| | | this.updateLicenseDialogText(); |
| | | this.$nextTick(function () { |
| | | if (window.WCS_I18N) { |
| | | window.WCS_I18N.apply(document.body); |
| | | } |
| | | that.syncAllFramesI18n(); |
| | | }); |
| | | }, |
| | | handleLocaleChange: function (locale) { |
| | | if (window.WCS_I18N) { |
| | | window.WCS_I18N.setLocale(locale); |
| | | } |
| | | }, |
| | | resolveHomeConfig: function () { |
| | | return { |
| | | title: this.t("index.homeTab"), |
| | | url: HOME_TAB_CONFIG.url, |
| | | home: true, |
| | | group: this.t("index.homeGroup"), |
| | | menuKey: HOME_TAB_CONFIG.menuKey || "" |
| | | }; |
| | | }, |
| | | resolveProfileConfig: function () { |
| | | return { |
| | | title: this.t("common.profile"), |
| | | url: PROFILE_TAB_CONFIG.url, |
| | | home: false, |
| | | group: this.t("index.profileGroup"), |
| | | menuKey: PROFILE_TAB_CONFIG.menuKey || "" |
| | | }; |
| | | }, |
| | | translateTabTitle: function (title) { |
| | | return this.tl(title); |
| | | }, |
| | | updateDocumentTitle: function (title) { |
| | | document.title = title + " - " + this.t("app.title"); |
| | | }, |
| | | resolveMenuIcon: function (code) { |
| | | var iconMap = { |
| | | index: "el-icon-s-home", |
| | |
| | | title: config.title, |
| | | name: config.url, |
| | | url: config.url, |
| | | currentSrc: config.url, |
| | | currentSrc: this.addNonce(config.url), |
| | | home: !!config.home, |
| | | group: config.group || "", |
| | | menuKey: config.menuKey || "", |
| | |
| | | }, |
| | | normalizeStoredTab: function (tab) { |
| | | var created = this.createTab({ |
| | | title: tab.title, |
| | | title: this.translateTabTitle(tab.title), |
| | | url: this.resolveViewSrc(tab.url), |
| | | home: !!tab.home, |
| | | group: tab.group || "", |
| | | group: this.tl(tab.group || ""), |
| | | menuKey: tab.menuKey || "" |
| | | }); |
| | | created.loaded = false; |
| | | return created; |
| | | }, |
| | | restoreTabs: function () { |
| | | var homeTab = this.createTab(HOME_TAB_CONFIG); |
| | | var homeTab = this.createTab(this.resolveHomeConfig()); |
| | | var raw = localStorage.getItem(TAB_STORAGE_KEY); |
| | | var parsed; |
| | | var tabs = []; |
| | |
| | | |
| | | this.tabs = tabs; |
| | | this.activeTab = this.hasTab(active) ? active : homeTab.name; |
| | | this.loadingText = "正在加载 “" + this.activeTabTitle + "” ..."; |
| | | this.loadingText = this.t("common.loadingTab", [this.activeTabTitle]); |
| | | this.pageLoading = true; |
| | | document.title = this.activeTabTitle + " - 浙江中扬 - 自动化立体仓库 - WCS"; |
| | | this.updateDocumentTitle(this.activeTabTitle); |
| | | }, |
| | | persistTabs: function () { |
| | | var tabs = []; |
| | |
| | | return !!this.getTabByName(name); |
| | | }, |
| | | isHomeTabUrl: function (url) { |
| | | return this.resolveViewSrc(url || HOME_TAB_CONFIG.url) === this.resolveViewSrc(HOME_TAB_CONFIG.url); |
| | | var homeUrl = this.resolveHomeConfig().url; |
| | | return this.resolveViewSrc(url || homeUrl) === this.resolveViewSrc(homeUrl); |
| | | }, |
| | | getTabByName: function (name) { |
| | | var i; |
| | |
| | | } |
| | | } |
| | | |
| | | this.loadingText = "正在加载 “" + tab.title + "” ..."; |
| | | this.loadingText = this.t("common.loadingTab", [tab.title]); |
| | | this.pageLoading = !tab.loaded; |
| | | this.activeTab = tab.name; |
| | | this.syncMenuStateByUrl(tab.url); |
| | | }, |
| | | openHomeTab: function () { |
| | | this.addOrActivateTab(HOME_TAB_CONFIG); |
| | | this.addOrActivateTab(this.resolveHomeConfig()); |
| | | }, |
| | | openProfileTab: function () { |
| | | this.addOrActivateTab(PROFILE_TAB_CONFIG); |
| | | this.addOrActivateTab(this.resolveProfileConfig()); |
| | | }, |
| | | closeAllTabs: function () { |
| | | this.tabs = [this.createTab(HOME_TAB_CONFIG)]; |
| | | this.activeTab = HOME_TAB_CONFIG.url; |
| | | this.syncMenuStateByUrl(HOME_TAB_CONFIG.url); |
| | | var homeConfig = this.resolveHomeConfig(); |
| | | this.tabs = [this.createTab(homeConfig)]; |
| | | this.activeTab = homeConfig.url; |
| | | this.syncMenuStateByUrl(homeConfig.url); |
| | | this.pageLoading = true; |
| | | this.loadingText = "正在加载 “控制中心” ..."; |
| | | this.loadingText = this.t("common.loadingTab", [homeConfig.title]); |
| | | this.persistTabs(); |
| | | }, |
| | | closeOtherTabs: function () { |
| | | var active = this.getTabByName(this.activeTab); |
| | | var homeTab = this.createTab(HOME_TAB_CONFIG); |
| | | var homeTab = this.createTab(this.resolveHomeConfig()); |
| | | var result = [homeTab]; |
| | | |
| | | if (active && active.name !== homeTab.name) { |
| | |
| | | }, |
| | | removeTab: function (name) { |
| | | var i; |
| | | var nextTabName = HOME_TAB_CONFIG.url; |
| | | var nextTabName = this.resolveHomeConfig().url; |
| | | |
| | | for (i = 0; i < this.tabs.length; i++) { |
| | | if (this.tabs[i].name === name) { |
| | |
| | | } |
| | | |
| | | if (this.tabs.length === 0) { |
| | | this.tabs.push(this.createTab(HOME_TAB_CONFIG)); |
| | | nextTabName = HOME_TAB_CONFIG.url; |
| | | this.tabs.push(this.createTab(this.resolveHomeConfig())); |
| | | nextTabName = this.resolveHomeConfig().url; |
| | | } |
| | | |
| | | this.activeTab = nextTabName; |
| | |
| | | if (tab) { |
| | | tab.loaded = true; |
| | | } |
| | | this.syncFrameI18n(name); |
| | | if (this.activeTab === name) { |
| | | this.pageLoading = false; |
| | | } |
| | |
| | | } |
| | | tab.loaded = false; |
| | | tab.currentSrc = this.addNonce(tab.url); |
| | | this.loadingText = "正在刷新 “" + tab.title + "” ..."; |
| | | this.loadingText = this.t("common.refreshingTab", [tab.title]); |
| | | this.pageLoading = true; |
| | | }, |
| | | addNonce: function (url) { |
| | | return url + (url.indexOf("?") === -1 ? "?" : "&") + "_t=" + new Date().getTime(); |
| | | }, |
| | | findFrameElement: function (name) { |
| | | var frames; |
| | | var i; |
| | | if (!this.$el) { |
| | | return null; |
| | | } |
| | | frames = this.$el.querySelectorAll("iframe[data-tab-name]"); |
| | | for (i = 0; i < frames.length; i++) { |
| | | if (frames[i].getAttribute("data-tab-name") === name) { |
| | | return frames[i]; |
| | | } |
| | | } |
| | | return null; |
| | | }, |
| | | syncFrameI18n: function (name) { |
| | | var that = this; |
| | | var frame = this.findFrameElement(name); |
| | | var frameWindow; |
| | | var frameDocument; |
| | | var script; |
| | | |
| | | function applyFrameI18n() { |
| | | try { |
| | | if (!frameWindow.WCS_I18N || typeof frameWindow.WCS_I18N.onReady !== "function") { |
| | | return; |
| | | } |
| | | frameWindow.WCS_I18N.setLocale(that.currentLocale || "zh-CN", false); |
| | | frameWindow.WCS_I18N.onReady(function (i18n) { |
| | | i18n.apply(frameDocument.body || frameDocument.documentElement); |
| | | if (frameDocument.title) { |
| | | frameDocument.title = i18n.tl(frameDocument.title); |
| | | } |
| | | }); |
| | | } catch (e) { |
| | | } |
| | | } |
| | | |
| | | if (!frame) { |
| | | return; |
| | | } |
| | | try { |
| | | frameWindow = frame.contentWindow; |
| | | frameDocument = frameWindow.document; |
| | | } catch (e) { |
| | | return; |
| | | } |
| | | try { |
| | | frameWindow.localStorage.setItem("wcs_lang", this.currentLocale || "zh-CN"); |
| | | } catch (e) { |
| | | } |
| | | if (frameDocument && frameDocument.documentElement) { |
| | | frameDocument.documentElement.lang = this.currentLocale || "zh-CN"; |
| | | } |
| | | if (frameWindow.WCS_I18N && typeof frameWindow.WCS_I18N.onReady === "function") { |
| | | applyFrameI18n(); |
| | | return; |
| | | } |
| | | if (!frameDocument || !frameDocument.head || frameDocument.getElementById("wcs-i18n-bridge-script")) { |
| | | return; |
| | | } |
| | | script = frameDocument.createElement("script"); |
| | | script.id = "wcs-i18n-bridge-script"; |
| | | script.type = "text/javascript"; |
| | | script.src = baseUrl + "/static/js/common.js?v=20260309_i18n_fix1"; |
| | | script.onload = applyFrameI18n; |
| | | frameDocument.head.appendChild(script); |
| | | }, |
| | | syncAllFramesI18n: function () { |
| | | var i; |
| | | for (i = 0; i < this.tabs.length; i++) { |
| | | this.syncFrameI18n(this.tabs[i].name); |
| | | } |
| | | }, |
| | | toggleCollapse: function () { |
| | | this.isCollapse = !this.isCollapse; |
| | |
| | | item = group.subMenu[j]; |
| | | subMenu.push({ |
| | | id: item.id, |
| | | name: item.name || item.code || "未命名页面", |
| | | name: item.name || item.code || this.tl("未命名页面"), |
| | | code: item.code || "", |
| | | url: this.buildMenuSrc(item.code, item.id), |
| | | tabKey: this.buildMenuSrc(item.code, item.id) |
| | |
| | | |
| | | result.push({ |
| | | menuId: group.menuId, |
| | | menu: group.menu || "未命名分组", |
| | | menu: group.menu || this.tl("未命名分组"), |
| | | menuCode: group.menuCode || "", |
| | | subMenu: subMenu |
| | | }); |
| | |
| | | }, |
| | | resolveViewSrc: function (path) { |
| | | if (!path) { |
| | | return HOME_TAB_CONFIG.url; |
| | | return this.resolveHomeConfig().url; |
| | | } |
| | | if (/^https?:\/\//.test(path) || path.indexOf(baseUrl) === 0) { |
| | | return path; |
| | |
| | | } |
| | | }, |
| | | syncMenuStateByUrl: function (url) { |
| | | var targetUrl = this.resolveViewSrc(url || HOME_TAB_CONFIG.url); |
| | | var targetUrl = this.resolveViewSrc(url || this.resolveHomeConfig().url); |
| | | var activeMenuKey = ""; |
| | | var groupIndex = ""; |
| | | var that = this; |
| | |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/login"; |
| | | } else { |
| | | that.$message.error(res.msg || "菜单加载失败"); |
| | | that.$message.error(res.msg || that.t("index.menuLoadFailed")); |
| | | } |
| | | }, |
| | | error: function () { |
| | | that.menuLoading = false; |
| | | that.$message.error("菜单加载失败,请检查接口状态"); |
| | | that.$message.error(that.t("index.menuLoadFailedDetail")); |
| | | } |
| | | }); |
| | | }, |
| | |
| | | showPopup: function (days) { |
| | | var currentDate; |
| | | var expiryDate; |
| | | var formattedDate; |
| | | |
| | | if (days === "" || days === null || typeof days === "undefined") { |
| | | this.hidePopup(); |
| | |
| | | currentDate = new Date(); |
| | | expiryDate = new Date(); |
| | | expiryDate.setDate(currentDate.getDate() + Number(days) + 1); |
| | | this.licenseDialogText = "许可证将于 " + new Intl.DateTimeFormat("zh-CN").format(expiryDate) + |
| | | " 过期,剩余有效期:" + days + " 天。"; |
| | | formattedDate = new Intl.DateTimeFormat(this.currentLocale || "zh-CN").format(expiryDate); |
| | | this.licenseDialogText = this.t("index.licenseExpireAt", [formattedDate, days]); |
| | | this.licenseDialogVisible = true; |
| | | }, |
| | | updateLicenseDialogText: function () { |
| | | if (this.licenseDays === "" || this.licenseDays === null || typeof this.licenseDays === "undefined" || this.licenseDays > 15) { |
| | | return; |
| | | } |
| | | this.showPopup(this.licenseDays); |
| | | }, |
| | | hidePopup: function () { |
| | | this.licenseDialogVisible = false; |
| | |
| | | |
| | | if (this.fakeRunning) { |
| | | url = baseUrl + "/openapi/stopFakeSystem"; |
| | | text = "确定要停止仿真模拟吗?"; |
| | | successMsg = "仿真模拟已停止"; |
| | | text = this.t("index.confirmStopFake"); |
| | | successMsg = this.t("index.fakeStoppedSuccess"); |
| | | running = false; |
| | | } else { |
| | | url = baseUrl + "/openapi/startFakeSystem"; |
| | | text = "确定要启动仿真模拟吗?"; |
| | | successMsg = "仿真模拟已启动"; |
| | | text = this.t("index.confirmStartFake"); |
| | | successMsg = this.t("index.fakeStartedSuccess"); |
| | | running = true; |
| | | } |
| | | |
| | | this.$confirm(text, "提示", { |
| | | this.$confirm(text, this.t("common.prompt"), { |
| | | type: "warning" |
| | | }).then(function () { |
| | | $.ajax({ |
| | |
| | | that.fakeRunning = running; |
| | | that.$message.success(successMsg); |
| | | } else { |
| | | that.$message.error(res.msg || "操作失败"); |
| | | that.$message.error(res.msg || that.t("index.operationFailed")); |
| | | } |
| | | } |
| | | }); |
| | |
| | | }, |
| | | showAiTip: function () { |
| | | this.hideAiTip(); |
| | | this.aiTipIndex = layer.tips("AI助手", "#ai-assistant-btn", { |
| | | this.aiTipIndex = layer.tips(this.t("common.aiAssistant"), "#ai-assistant-btn", { |
| | | tips: [1, "#333"], |
| | | time: -1 |
| | | }); |
| | |
| | | startUserSync: function () { |
| | | var that = this; |
| | | this.userSyncTimer = setInterval(function () { |
| | | that.userName = localStorage.getItem(USER_STORAGE_KEY) || "管理员"; |
| | | that.userName = localStorage.getItem(USER_STORAGE_KEY) || that.tl("管理员"); |
| | | }, 1000); |
| | | }, |
| | | installCompatBridge: function () { |
| | |
| | | } |
| | | url = that.resolveViewSrc(param.menuPath); |
| | | that.addOrActivateTab({ |
| | | title: that.stripTags(param.menuName) || "工作页面", |
| | | title: that.stripTags(param.menuName) || that.t("common.workPage"), |
| | | url: url, |
| | | home: false, |
| | | group: "业务页面", |
| | | group: that.t("common.businessPage"), |
| | | menuKey: that.findMenuKeyByUrl(url) |
| | | }); |
| | | }; |
| | |
| | | } |
| | | url = that.resolveViewSrc(param.menuPath); |
| | | that.addOrActivateTab({ |
| | | title: that.stripTags(param.menuName) || HOME_TAB_CONFIG.title, |
| | | title: that.stripTags(param.menuName) || that.resolveHomeConfig().title, |
| | | url: url, |
| | | home: true, |
| | | group: HOME_TAB_CONFIG.group, |
| | | group: that.resolveHomeConfig().group, |
| | | menuKey: that.findMenuKeyByUrl(url) |
| | | }); |
| | | }; |
| | |
| | | <title>库位地图</title> |
| | | <link rel="stylesheet" href="../../static/vue/element/element.css"> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1"></script> |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <script src="../../static/js/gsap.min.js"></script> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/locMast/locMast.js" charset="utf-8"></script> |
| | | <iframe id="detail-iframe" scrolling="auto" style="display:none;"></iframe> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/locMast/locMast.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | <link rel="icon" type="image/x-icon" href="../static/images/wcs_logo.png" /> |
| | | <link rel="stylesheet" href="../static/css/animate.min.css"> |
| | | <script type="text/javascript" src="../static/layui/layui.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js?v=20260309_i18n_fix1"></script> |
| | | <style> |
| | | html{ |
| | | height: 100%; |
| | |
| | | border-radius: 4px; |
| | | height: 52px; |
| | | } |
| | | .login-lang { |
| | | position: fixed; |
| | | top: 20px; |
| | | right: 24px; |
| | | z-index: 2; |
| | | } |
| | | .login-lang select { |
| | | min-width: 140px; |
| | | height: 34px; |
| | | padding: 0 10px; |
| | | border: 1px solid #d6dbe6; |
| | | border-radius: 17px; |
| | | background: rgba(255, 255, 255, 0.92); |
| | | color: #3b4a5a; |
| | | outline: none; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body class="login-bg animsition"> |
| | | |
| | | <div class="login-lang"> |
| | | <select id="lang-switch" aria-label="Language"></select> |
| | | </div> |
| | | <div id="login-wrapper" class="animate__animated animate__bounceInDown"> |
| | | <header> |
| | | <h2 id="login-title" style="cursor: pointer; user-select: none;">WCS系统V3.0</h2> |
| | | <h2 id="login-title" data-i18n-key="login.title" style="cursor: pointer; user-select: none;">WCS系统V3.0</h2> |
| | | </header> |
| | | <div class="layui-form layadmin-user-login-body"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-icon layui-icon-cellphone layadmin-user-login-icon"></label> |
| | | <input id="mobile" class="layui-input" type="text" name="mobile" lay-verify="mobile" placeholder="账号"> |
| | | <input id="mobile" class="layui-input" type="text" name="mobile" lay-verify="mobile" data-i18n-placeholder-key="login.username" placeholder="账号"> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-icon layui-icon-password layadmin-user-login-icon"></label> |
| | | <input id="password" class="layui-input" type="password" name="password" lay-verify="password" placeholder="密码"> |
| | | <input id="password" class="layui-input" type="password" name="password" lay-verify="password" data-i18n-placeholder-key="login.password" placeholder="密码"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item login-submit"> |
| | | <button id="login-button" class="layui-btn layui-btn-fluid layui-btn-normal" lay-submit="" lay-filter="login">登     录</button> |
| | | <button id="login-button" data-i18n-key="login.submit" class="layui-btn layui-btn-fluid layui-btn-normal" lay-submit="" lay-filter="login">登     录</button> |
| | | </div> |
| | | </div> |
| | | <div id="system-tools-panel" style="display: none; padding: 20px;"> |
| | | <div style="margin-bottom: 18px;"> |
| | | <div style="margin-bottom: 10px; color: #666; font-weight: 600;">推荐操作</div> |
| | | <div data-i18n-key="login.tools.recommended" style="margin-bottom: 10px; color: #666; font-weight: 600;">推荐操作</div> |
| | | <div style="display: flex; flex-wrap: wrap; gap: 12px;"> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-request-code">获取请求码</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" id="btn-activate">一键激活</button> |
| | | <button data-i18n-key="login.tools.requestCode" class="layui-btn layui-btn-normal layui-btn-sm" id="btn-request-code">获取请求码</button> |
| | | <button data-i18n-key="login.tools.activate" class="layui-btn layui-btn-normal layui-btn-sm" id="btn-activate">一键激活</button> |
| | | </div> |
| | | <div style="margin-top: 8px; color: #999; font-size: 12px;">优先使用“获取请求码”和“一键激活”完成许可证申请与激活。</div> |
| | | <div data-i18n-key="login.tools.recommendedDesc" style="margin-top: 8px; color: #999; font-size: 12px;">优先使用“获取请求码”和“一键激活”完成许可证申请与激活。</div> |
| | | </div> |
| | | <div> |
| | | <div style="margin-bottom: 10px; color: #666; font-weight: 600;">其他工具</div> |
| | | <div data-i18n-key="login.tools.others" style="margin-bottom: 10px; color: #666; font-weight: 600;">其他工具</div> |
| | | <div style="display: flex; flex-wrap: wrap; gap: 12px;"> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-project-name">获取项目名称</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-server-info">获取系统配置</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-upload-license">录入许可证</button> |
| | | <button data-i18n-key="login.tools.projectName" class="layui-btn layui-btn-primary layui-btn-sm" id="btn-project-name">获取项目名称</button> |
| | | <button data-i18n-key="login.tools.serverInfo" class="layui-btn layui-btn-primary layui-btn-sm" id="btn-server-info">获取系统配置</button> |
| | | <button data-i18n-key="login.tools.uploadLicense" class="layui-btn layui-btn-primary layui-btn-sm" id="btn-upload-license">录入许可证</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | layer = layui.layer, |
| | | $ = layui.jquery; |
| | | |
| | | function initLanguageSwitch() { |
| | | WCS_I18N.onReady(function (i18n) { |
| | | var select = document.getElementById('lang-switch'); |
| | | var options = i18n.getLocaleOptions(); |
| | | var current = i18n.getLocale(); |
| | | var html = ''; |
| | | var i; |
| | | for (i = 0; i < options.length; i++) { |
| | | html += '<option value="' + options[i].tag + '"' + (options[i].tag === current ? ' selected' : '') + '>' + options[i].label + '</option>'; |
| | | } |
| | | select.innerHTML = html; |
| | | select.onchange = function () { |
| | | i18n.setLocale(this.value); |
| | | }; |
| | | document.title = i18n.t('login.title'); |
| | | }); |
| | | } |
| | | |
| | | initLanguageSwitch(); |
| | | |
| | | // 连续点击三次标题显示隐藏功能 |
| | | var titleClickCount = 0; |
| | | var titleClickTimer = null; |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script> |
| | | new Vue({ |
| | | el: '#app', |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/operateLog/operateLog.js" charset="utf-8"></script> |
| | | |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/operateLog/operateLog.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../static/js/tools/md5.js"></script> |
| | | <script type="text/javascript" src="../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script src="../static/layui/layui.js"></script> |
| | | <script> |
| | | layui.use(['form'], function() { |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/permission/permission.js" charset="utf-8"></script> |
| | | |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/permission/permission.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | </script> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | |
| | | <script> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260307" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/role/role.js" charset="utf-8"></script> |
| | | |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260307" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/role/role.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260307"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1"></script> |
| | | <script type="text/javascript" src="../../static/js/role/rolePower.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/tools/md5.js"></script> |
| | | <script type="text/javascript" src="../../static/js/user/user.js" charset="utf-8"></script> |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/tools/md5.js"></script> |
| | | <script type="text/javascript" src="../../static/js/user/user.js" charset="utf-8"></script> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/userLogin/userLogin.js" charset="utf-8"></script> |
| | | |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/userLogin/userLogin.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1"></script> |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <script src="../../static/js/gsap.min.js"></script> |
| | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1"></script> |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | </head> |
| | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1"></script> |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <script src="../../static/js/gsap.min.js"></script> |
| | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/watch/stationColorConfig.js" charset="utf-8"></script> |
| | | </body> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/wrkLastno/wrkLastno.js" charset="utf-8"></script> |
| | | |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/wrkLastno/wrkLastno.js" charset="utf-8"></script> |
| | | </html> |
| | |
| | | <link rel="stylesheet" href="../../static/vue/element/element.css"> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1"></script> |
| | | <script type="text/javascript" src="../../static/vue/js/vue.min.js"></script> |
| | | <script type="text/javascript" src="../../static/vue/element/element.js"></script> |
| | | <style> |
| | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/wrkMastLog/wrkMastLog.js" charset="utf-8"></script> |
| | | |
| | |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js?v=20260309_i18n_fix1" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/wrkMastLog/wrkMastLog.js" charset="utf-8"></script> |
| | | </html> |