| | |
| | | *.class |
| | | .idea |
| | | .idea/* |
| | | target |
| | | target/* |
| | | */target/* |
| | | |
| | | # Mobile Tools for Java (J2ME) |
| | | .mtj.tmp/ |
| | | ruoyi-admin/target/* |
| | | |
| | | # Package Files # |
| | | *.jar |
| | | *.war |
| | | *.ear |
| | | |
| | | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
| | | hs_err_pid* |
| | | /ruoyi-admin/target |
| | | /ruoyi-buss/target |
| | | /ruoyi-common/target |
| | | /ruoyi-framework/target |
| | | /ruoyi-fuzhou/target |
| | | /ruoyi-generator/target |
| | | /ruoyi-manage/target |
| | | /ruoyi-quartz/target |
| | | /ruoyi-system/target |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi</artifactId> |
| | | <version>3.8.9</version> |
| | | |
| | | <name>ruoyi</name> |
| | | <url>http://www.ruoyi.vip</url> |
| | | <description>è¥ä¾ç®¡çç³»ç»</description> |
| | | |
| | | <properties> |
| | | <ruoyi.version>3.8.9</ruoyi.version> |
| | | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| | | <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| | | <java.version>17</java.version> |
| | | <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> |
| | | <mybatis-spring-boot.version>3.0.3</mybatis-spring-boot.version> |
| | | <druid.version>1.2.23</druid.version> |
| | | <bitwalker.version>1.21</bitwalker.version> |
| | | <swagger.version>3.0.0</swagger.version> |
| | | <kaptcha.version>2.3.3</kaptcha.version> |
| | | <pagehelper.boot.version>2.1.0</pagehelper.boot.version> |
| | | <fastjson.version>2.0.53</fastjson.version> |
| | | <oshi.version>6.6.5</oshi.version> |
| | | <commons.io.version>2.13.0</commons.io.version> |
| | | <poi.version>4.1.2</poi.version> |
| | | <velocity.version>2.3</velocity.version> |
| | | <jwt.version>0.9.1</jwt.version> |
| | | <mysql.version>8.2.0</mysql.version> |
| | | <jaxb-api.version>2.3.1</jaxb-api.version> |
| | | <jakarta.version>6.0.0</jakarta.version> |
| | | <springdoc.version>2.6.0</springdoc.version> |
| | | <dameng.version>8.1.3.140</dameng.version> |
| | | </properties> |
| | | |
| | | <!-- ä¾èµå£°æ --> |
| | | <dependencyManagement> |
| | | <dependencies> |
| | | |
| | | <!-- SpringBootçä¾èµé
ç½®--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-dependencies</artifactId> |
| | | <version>3.2.0</version> |
| | | <type>pom</type> |
| | | <scope>import</scope> |
| | | </dependency> |
| | | |
| | | <!-- é¿éæ°æ®åºè¿æ¥æ± --> |
| | | <dependency> |
| | | <groupId>com.alibaba</groupId> |
| | | <artifactId>druid-spring-boot-3-starter</artifactId> |
| | | <version>${druid.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- è§£æå®¢æ·ç«¯æä½ç³»ç»ãæµè§å¨ç --> |
| | | <dependency> |
| | | <groupId>eu.bitwalker</groupId> |
| | | <artifactId>UserAgentUtils</artifactId> |
| | | <version>${bitwalker.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.mybatis.spring.boot</groupId>--> |
| | | <!-- <artifactId>mybatis-spring-boot-starter</artifactId>--> |
| | | <!-- <version>${mybatis-spring-boot.version}</version>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-boot-starter</artifactId> |
| | | <version>3.5.4.1</version> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>mybatis-spring</artifactId> |
| | | <groupId>org.mybatis</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.mybatis</groupId> |
| | | <artifactId>mybatis-spring</artifactId> |
| | | <version>3.0.3</version> |
| | | </dependency> |
| | | <!-- pagehelper å页æä»¶ --> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.pagehelper</groupId>--> |
| | | <!-- <artifactId>pagehelper-spring-boot-starter</artifactId>--> |
| | | <!-- <version>${pagehelper.boot.version}</version>--> |
| | | <!-- <exclusions>--> |
| | | <!-- <exclusion>--> |
| | | <!-- <artifactId>mybatis-spring</artifactId>--> |
| | | <!-- <groupId>org.mybatis</groupId>--> |
| | | <!-- </exclusion>--> |
| | | <!-- <exclusion>--> |
| | | <!-- <artifactId>mybatis</artifactId>--> |
| | | <!-- <groupId>org.mybatis</groupId>--> |
| | | <!-- </exclusion>--> |
| | | <!-- </exclusions>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>com.mysql</groupId> |
| | | <artifactId>mysql-connector-j</artifactId> |
| | | <version>${mysql.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>javax.xml.bind</groupId> |
| | | <artifactId>jaxb-api</artifactId> |
| | | <version>${jaxb-api.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>jakarta.servlet</groupId> |
| | | <artifactId>jakarta.servlet-api</artifactId> |
| | | <version>${jakarta.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- è·åç³»ç»ä¿¡æ¯ --> |
| | | <dependency> |
| | | <groupId>com.github.oshi</groupId> |
| | | <artifactId>oshi-core</artifactId> |
| | | <version>${oshi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- spring-doc --> |
| | | <dependency> |
| | | <groupId>org.springdoc</groupId> |
| | | <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> |
| | | <version>${springdoc.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- io常ç¨å·¥å
·ç±» --> |
| | | <dependency> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | <version>${commons.io.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- excelå·¥å
· --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>${poi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- velocity代ç çæä½¿ç¨æ¨¡æ¿ --> |
| | | <dependency> |
| | | <groupId>org.apache.velocity</groupId> |
| | | <artifactId>velocity-engine-core</artifactId> |
| | | <version>${velocity.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- é¿éJSONè§£æå¨ --> |
| | | <dependency> |
| | | <groupId>com.alibaba.fastjson2</groupId> |
| | | <artifactId>fastjson2</artifactId> |
| | | <version>${fastjson.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- Tokençæä¸è§£æ--> |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | | <version>${jwt.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-boot-starter</artifactId> |
| | | <version>3.0.0</version> |
| | | </dependency> |
| | | |
| | | <!-- éªè¯ç --> |
| | | <dependency> |
| | | <groupId>pro.fessional</groupId> |
| | | <artifactId>kaptcha</artifactId> |
| | | <version>${kaptcha.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 宿¶ä»»å¡--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-quartz</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 代ç çæ--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-generator</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- æ ¸å¿æ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-framework</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- ç³»ç»æ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-system</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- éç¨å·¥å
·--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-common</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- éç¨å·¥å
·--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-fuzhou</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <!-- 大å±ä¸å¡æ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-manage</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-manage</artifactId> |
| | | <version>${ruoyi.version}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.dameng</groupId> |
| | | <artifactId>DmJdbcDriver18</artifactId> |
| | | <version>${dameng.version}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | </dependencyManagement> |
| | | |
| | | <modules> |
| | | <module>ruoyi-admin</module> |
| | | <module>ruoyi-framework</module> |
| | | <module>ruoyi-system</module> |
| | | <module>ruoyi-quartz</module> |
| | | <module>ruoyi-generator</module> |
| | | <module>ruoyi-common</module> |
| | | <module>ruoyi-fuzhou</module> |
| | | <module>ruoyi-manage</module> |
| | | <module>ruoyi-buss</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-compiler-plugin</artifactId> |
| | | <!-- <version>3.13.0</version>--> |
| | | <configuration> |
| | | <parameters>true</parameters> |
| | | <source>${java.version}</source> |
| | | <target>${java.version}</target> |
| | | <encoding>${project.build.sourceEncoding}</encoding> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>3.3.0</version> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | <repositories> |
| | | <repository> |
| | | <id>public</id> |
| | | <name>aliyun nexus</name> |
| | | <url>https://maven.aliyun.com/repository/public</url> |
| | | <releases> |
| | | <enabled>true</enabled> |
| | | </releases> |
| | | </repository> |
| | | </repositories> |
| | | |
| | | <pluginRepositories> |
| | | <pluginRepository> |
| | | <id>public</id> |
| | | <name>aliyun nexus</name> |
| | | <url>https://maven.aliyun.com/repository/public</url> |
| | | <releases> |
| | | <enabled>true</enabled> |
| | | </releases> |
| | | <snapshots> |
| | | <enabled>false</enabled> |
| | | </snapshots> |
| | | </pluginRepository> |
| | | </pluginRepositories> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" |
| | | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <parent> |
| | | <artifactId>ruoyi</artifactId> |
| | | <groupId>com.ruoyi</groupId> |
| | | <version>3.8.9</version> |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <packaging>jar</packaging> |
| | | <artifactId>ruoyi-admin</artifactId> |
| | | |
| | | <description> |
| | | webæå¡å
¥å£ |
| | | </description> |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- spring-boot-devtools --> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <optional>true</optional> <!-- 表示ä¾èµä¸ä¼ä¼ é --> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId> |
| | | <version>4.4.0</version> |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springdoc</groupId>--> |
| | | <!-- <artifactId>springdoc-openapi-ui</artifactId>--> |
| | | <!-- <version>1.8.0</version> <!– è¯·ä½¿ç¨ææ°çæ¬ –>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>org.springdoc</groupId> |
| | | <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId> |
| | | <version>2.6.0</version> <!-- çæ¬å·è¯·æ ¹æ®ä½ çSpring Bootçæ¬å¹é
--> |
| | | </dependency> |
| | | |
| | | <!-- Mysql驱å¨å
--> |
| | | <dependency> |
| | | <groupId>com.mysql</groupId> |
| | | <artifactId>mysql-connector-j</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- è¾¾æ¢¦æ°æ®åºé©±å¨å
--> |
| | | <dependency> |
| | | <groupId>com.dameng</groupId> |
| | | <artifactId>DmJdbcDriver18</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- æ ¸å¿æ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-framework</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 宿¶ä»»å¡--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-quartz</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 代ç çæ--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-generator</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- 代ç çæ--> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-fuzhou</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-manage</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-buss</artifactId> |
| | | <version>3.8.9</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-generator</artifactId> |
| | | <version>3.5.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>junit</groupId> |
| | | <artifactId>junit</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-manage</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <version>2.5.15</version> |
| | | <configuration> |
| | | <fork>true</fork> <!-- å¦ææ²¡æè¯¥é
ç½®ï¼devtoolsä¸ä¼çæ --> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-war-plugin</artifactId> |
| | | <version>3.1.0</version> |
| | | <configuration> |
| | | <failOnMissingWebXml>false</failOnMissingWebXml> |
| | | <warName>${project.artifactId}</warName> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | <finalName>${project.artifactId}</finalName> |
| | | </build> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <module version="4"> |
| | | <component name="FacetManager"> |
| | | <facet type="Spring" name="Spring"> |
| | | <configuration /> |
| | | </facet> |
| | | </component> |
| | | </module> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi; |
| | | |
| | | import com.ruoyi.common.utils.ip.IpUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.web.socket.config.annotation.EnableWebSocket; |
| | | import org.springframework.web.socket.server.standard.ServerEndpointExporter; |
| | | |
| | | /** |
| | | * å¯å¨ç¨åº |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Slf4j |
| | | @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) |
| | | @MapperScan("com.ruoyi.**.mapper") |
| | | @EnableWebSocket |
| | | public class RuoYiApplication { |
| | | |
| | | private static String serverPort; |
| | | |
| | | @Value("${server.port}") |
| | | public void setServerPort(String serverPort) { |
| | | RuoYiApplication.serverPort = serverPort; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | //http://127.0.0.1:8080/swagger-ui/index.html#/ |
| | | SpringApplication.run(RuoYiApplication.class, args); |
| | | log.info("APIææ¡£å°å:http://{}:{}/doc.html", IpUtils.getHostIp(), serverPort); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi; |
| | | |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | |
| | | /** |
| | | * web容å¨ä¸è¿è¡é¨ç½² |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class RuoYiServletInitializer extends SpringBootServletInitializer |
| | | { |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder application) |
| | | { |
| | | return application.sources(RuoYiApplication.class); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.common; |
| | | |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | import jakarta.annotation.Resource; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.FastByteArrayOutputStream; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.google.code.kaptcha.Producer; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.sign.Base64; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * éªè¯ç æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | public class CaptchaController { |
| | | @Resource(name = "captchaProducer") |
| | | private Producer captchaProducer; |
| | | |
| | | @Resource(name = "captchaProducerMath") |
| | | private Producer captchaProducerMath; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | /** |
| | | * çæéªè¯ç |
| | | */ |
| | | @GetMapping("/captchaImage") |
| | | public AjaxResult getCode(HttpServletResponse response) throws IOException { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | boolean captchaEnabled = configService.selectCaptchaEnabled(); |
| | | ajax.put("captchaEnabled", captchaEnabled); |
| | | if (!captchaEnabled) { |
| | | return ajax; |
| | | } |
| | | |
| | | // ä¿åéªè¯ç ä¿¡æ¯ |
| | | String uuid = IdUtils.simpleUUID(); |
| | | String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid; |
| | | |
| | | String capStr = null, code = null; |
| | | BufferedImage image = null; |
| | | |
| | | // çæéªè¯ç |
| | | String captchaType = RuoYiConfig.getCaptchaType(); |
| | | if ("math".equals(captchaType)) { |
| | | String capText = captchaProducerMath.createText(); |
| | | capStr = capText.substring(0, capText.lastIndexOf("@")); |
| | | code = capText.substring(capText.lastIndexOf("@") + 1); |
| | | image = captchaProducerMath.createImage(capStr); |
| | | } else if ("char".equals(captchaType)) { |
| | | capStr = code = captchaProducer.createText(); |
| | | image = captchaProducer.createImage(capStr); |
| | | } |
| | | |
| | | redisCache.setCacheObject(verifyKey, code, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES); |
| | | // è½¬æ¢æµä¿¡æ¯ååº |
| | | FastByteArrayOutputStream os = new FastByteArrayOutputStream(); |
| | | try { |
| | | ImageIO.write(image, "jpg", os); |
| | | } catch (IOException e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | |
| | | ajax.put("uuid", uuid); |
| | | ajax.put("img", Base64.encode(os.toByteArray())); |
| | | return ajax; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.common; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.framework.config.ServerConfig; |
| | | |
| | | /** |
| | | * éç¨è¯·æ±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/common") |
| | | public class CommonController |
| | | { |
| | | private static final Logger log = LoggerFactory.getLogger(CommonController.class); |
| | | |
| | | @Autowired |
| | | private ServerConfig serverConfig; |
| | | |
| | | private static final String FILE_DELIMETER = ","; |
| | | |
| | | /** |
| | | * éç¨ä¸è½½è¯·æ± |
| | | * |
| | | * @param fileName æä»¶åç§° |
| | | * @param delete æ¯å¦å é¤ |
| | | */ |
| | | @GetMapping("/download") |
| | | public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) |
| | | { |
| | | try |
| | | { |
| | | if (!FileUtils.checkAllowDownload(fileName)) |
| | | { |
| | | throw new Exception(StringUtils.format("æä»¶åç§°({})éæ³ï¼ä¸å
许ä¸è½½ã ", fileName)); |
| | | } |
| | | String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1); |
| | | String filePath = RuoYiConfig.getDownloadPath() + fileName; |
| | | |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | FileUtils.setAttachmentResponseHeader(response, realFileName); |
| | | FileUtils.writeBytes(filePath, response.getOutputStream()); |
| | | if (delete) |
| | | { |
| | | FileUtils.deleteFile(filePath); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("ä¸è½½æä»¶å¤±è´¥", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éç¨ä¸ä¼ 请æ±ï¼åä¸ªï¼ |
| | | */ |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file) throws Exception |
| | | { |
| | | try |
| | | { |
| | | // ä¸ä¼ æä»¶è·¯å¾ |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | // ä¸ä¼ å¹¶è¿åæ°æä»¶åç§° |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("url", url); |
| | | ajax.put("fileName", fileName); |
| | | ajax.put("newFileName", FileUtils.getName(fileName)); |
| | | ajax.put("originalFilename", file.getOriginalFilename()); |
| | | return ajax; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * éç¨ä¸ä¼ 请æ±ï¼å¤ä¸ªï¼ |
| | | */ |
| | | @PostMapping("/uploads") |
| | | public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception |
| | | { |
| | | try |
| | | { |
| | | // ä¸ä¼ æä»¶è·¯å¾ |
| | | String filePath = RuoYiConfig.getUploadPath(); |
| | | List<String> urls = new ArrayList<String>(); |
| | | List<String> fileNames = new ArrayList<String>(); |
| | | List<String> newFileNames = new ArrayList<String>(); |
| | | List<String> originalFilenames = new ArrayList<String>(); |
| | | for (MultipartFile file : files) |
| | | { |
| | | // ä¸ä¼ å¹¶è¿åæ°æä»¶åç§° |
| | | String fileName = FileUploadUtils.upload(filePath, file); |
| | | String url = serverConfig.getUrl() + fileName; |
| | | urls.add(url); |
| | | fileNames.add(fileName); |
| | | newFileNames.add(FileUtils.getName(fileName)); |
| | | originalFilenames.add(file.getOriginalFilename()); |
| | | } |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER)); |
| | | ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER)); |
| | | ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER)); |
| | | ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER)); |
| | | return ajax; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¬å°èµæºéç¨ä¸è½½ |
| | | */ |
| | | @GetMapping("/download/resource") |
| | | public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) |
| | | throws Exception |
| | | { |
| | | try |
| | | { |
| | | if (!FileUtils.checkAllowDownload(resource)) |
| | | { |
| | | throw new Exception(StringUtils.format("èµæºæä»¶({})éæ³ï¼ä¸å
许ä¸è½½ã ", resource)); |
| | | } |
| | | // æ¬å°èµæºè·¯å¾ |
| | | String localPath = RuoYiConfig.getProfile(); |
| | | // æ°æ®åºèµæºå°å |
| | | String downloadPath = localPath + StringUtils.substringAfter(resource, Constants.RESOURCE_PREFIX); |
| | | // ä¸è½½åç§° |
| | | String downloadName = StringUtils.substringAfterLast(downloadPath, "/"); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | FileUtils.setAttachmentResponseHeader(response, downloadName); |
| | | FileUtils.writeBytes(downloadPath, response.getOutputStream()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | log.error("ä¸è½½æä»¶å¤±è´¥", e); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.common; |
| | | |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.manage.domain.SysFileManage; |
| | | import com.ruoyi.manage.domain.vo.SysFileManageVO; |
| | | import com.ruoyi.manage.service.SysFileService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.FileSystemResource; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æä»¶ç®¡ç表 å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-05-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/sysFile") |
| | | @Tag(name = "大å±--æä»¶ç®¡ç") |
| | | public class SysFileController { |
| | | @Autowired |
| | | SysFileService sysFileService; |
| | | @Autowired |
| | | RuoYiConfig ruoYiConfig; |
| | | |
| | | /** |
| | | * æ¥è¯¢æä»¶ç®¡çå表 |
| | | */ |
| | | @GetMapping("/listAll") |
| | | @Operation(summary = "æ¥è¯¢æä»¶ç®¡çå表") |
| | | public AjaxResult listAll() |
| | | { |
| | | return AjaxResult.success(sysFileService.listAll()); |
| | | } |
| | | |
| | | /** |
| | | * å个ä¸ä¼ æä»¶ |
| | | */ |
| | | @PostMapping("/uploadFile") |
| | | @Operation(summary = "å个ä¸ä¼ æä»¶") |
| | | public AjaxResult uploadFile(MultipartFile file,String name,String type, |
| | | @RequestParam(value = "remark",required = false) String remark) { |
| | | SysFileManage sysFileManage = new SysFileManage(); |
| | | sysFileManage.setName(name); |
| | | sysFileManage.setType(type); |
| | | sysFileManage.setRemark(remark); |
| | | try { |
| | | int res = sysFileService.saveFile(file,sysFileManage); |
| | | return AjaxResult.success(res); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå 餿件 |
| | | */ |
| | | @PostMapping("/deleteBatch") |
| | | @Operation(summary = "æ¹éå 餿件") |
| | | public AjaxResult deleteBatch(@RequestBody List<String> ids) |
| | | { |
| | | List<String> res = sysFileService.deleteBatch(ids); |
| | | if(res.size()==0){ |
| | | return AjaxResult.success("å 餿å"); |
| | | } |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | | @PostMapping("/download") |
| | | @Operation(summary = "ä¸è½½æä»¶") |
| | | public ResponseEntity<FileSystemResource> resourceDownload(String id){ |
| | | try { |
| | | SysFileManage sysFileManage = sysFileService.getById(id); |
| | | String filePath = sysFileManage.getFilePath(); |
| | | String name = sysFileManage.getName(); |
| | | String realFilePath = filePath.replaceFirst("/profile",RuoYiConfig.getProfile()); |
| | | String ext = sysFileManage.getExt(); |
| | | if(ext!=null && !ext.isEmpty()){ |
| | | if(ext.equals("json")){ |
| | | realFilePath = filePath.replaceFirst("/profile",ruoYiConfig.getJson()); |
| | | } |
| | | } |
| | | String realFileName = name + realFilePath.substring(realFilePath.indexOf("_") + 1); |
| | | |
| | | File file = new File(realFilePath); |
| | | if(!file.exists()){ |
| | | return ResponseEntity.notFound().build(); |
| | | } |
| | | FileSystemResource resource = new FileSystemResource(file); |
| | | |
| | | return ResponseEntity.ok() |
| | | .header("Content-Disposition","attachment;filename=" + realFileName) |
| | | .body(resource); |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResponseEntity.status(500).build(); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/getCount") |
| | | @Operation(summary = "æ¥è¯¢æ»æ¡æ°") |
| | | public AjaxResult getCount(){ |
| | | return AjaxResult.success(sysFileService.queryCount()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å页æ¥è¯¢æä»¶ç®¡çå表 |
| | | */ |
| | | @PostMapping("/getPageList") |
| | | @Operation(summary = "å页æ¥è¯¢æä»¶ç®¡çå表") |
| | | public TableDataInfo getPageList(@Validated @RequestBody SysFileManageVO vo) { |
| | | List<SysFileManage> list = sysFileService.queryData(vo); |
| | | return paginate(list, vo.getPageNum(), vo.getPageSize()); |
| | | } |
| | | |
| | | //对å表è¿è¡å页 |
| | | private TableDataInfo paginate(List list, int pageNum, int pageSize) { |
| | | if (list == null || list.isEmpty()) { |
| | | return new TableDataInfo(new ArrayList<>(), 0); |
| | | } |
| | | int total = list.size(); |
| | | int formIndex = (pageNum - 1) * pageSize; |
| | | int toIndex = Math.min(formIndex + pageSize, total); |
| | | if (formIndex >= total) { |
| | | return new TableDataInfo(new ArrayList<>(), total); |
| | | } |
| | | List subList = list.subList(formIndex, toIndex); |
| | | return new TableDataInfo(subList, total); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.fuzhou; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.fuzhou.domain.ReceiveCarValueFinal; |
| | | import com.ruoyi.fuzhou.domain.vo.ReceiveValueListVo; |
| | | import com.ruoyi.fuzhou.service.ReceiveCarValueFinalService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * å·¥åµéé å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-04-25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/receiveCarValueFinal") |
| | | @Tag(name = "大å±--工嵿°æ®å¤çç»æ") |
| | | public class ReceiveCarValueFinalController { |
| | | @Autowired |
| | | private ReceiveCarValueFinalService receiveCarValueFinalService; |
| | | |
| | | @GetMapping("/listAll") |
| | | @Operation(summary = "æ¥è¯¢æææ°æ®å表") |
| | | public AjaxResult listAll() |
| | | { |
| | | return AjaxResult.success(receiveCarValueFinalService.listAll()); |
| | | } |
| | | |
| | | @PostMapping("/saveBatch") |
| | | @Operation(summary = "æ¹éæå
¥") |
| | | @Log(title = "工嵿°æ®æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult saveBatch(@RequestBody List<ReceiveCarValueFinal> carValueFinals) |
| | | { |
| | | return AjaxResult.success(receiveCarValueFinalService.saveBatch(carValueFinals)); |
| | | } |
| | | |
| | | @PostMapping("/queryData") |
| | | @Operation(summary = "æ¡ä»¶æ¥è¯¢") |
| | | @Log(title = "工嵿°æ®æ¥è¯¢", businessType = BusinessType.SELECT) |
| | | public AjaxResult queryData(@RequestBody ReceiveValueListVo vo) |
| | | { |
| | | return AjaxResult.success(receiveCarValueFinalService.queryData(vo)); |
| | | } |
| | | |
| | | @PostMapping("/deleteBatch") |
| | | @Operation(summary = "æ¹éå é¤") |
| | | @Log(title = "工嵿°æ®å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteBatch(@RequestBody List<Long> ids) |
| | | { |
| | | return AjaxResult.success(receiveCarValueFinalService.deleteBatch(ids)); |
| | | } |
| | | |
| | | @PostMapping("/updateDate") |
| | | @Operation(summary = "ä¿®æ¹æ´æ°") |
| | | @Log(title = "工嵿°æ®ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateDate(@RequestBody ReceiveCarValueFinal receiveCarValueFinal) |
| | | { |
| | | return AjaxResult.success(receiveCarValueFinalService.updateDate(receiveCarValueFinal)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.fuzhou; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.fuzhou.domain.ReceiveElectricityValueFinal; |
| | | import com.ruoyi.fuzhou.domain.vo.ReceiveValueListVo; |
| | | import com.ruoyi.fuzhou.service.ReceiveElectricityValueFinalService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * çµè®¾å¤æ°æ® å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-04-25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/receiveElectricityValueFinal") |
| | | @Tag(name = "大å±--çµæ°æ®å¤çç»æ") |
| | | public class ReceiveElectricityValueFinalController { |
| | | @Autowired |
| | | private ReceiveElectricityValueFinalService receiveElectricityValueFinalService; |
| | | |
| | | @GetMapping("/listAll") |
| | | @Operation(summary = "æ¥è¯¢æææ°æ®å表") |
| | | public AjaxResult listAll() |
| | | { |
| | | return AjaxResult.success(receiveElectricityValueFinalService.listAll()); |
| | | } |
| | | |
| | | @PostMapping("/saveBatch") |
| | | @Operation(summary = "æ¹éæå
¥") |
| | | @Log(title = "çµè¡¨æ°æ®æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult saveBatch(@RequestBody List<ReceiveElectricityValueFinal> electricityValueFinals) |
| | | { |
| | | return AjaxResult.success(receiveElectricityValueFinalService.saveBatch(electricityValueFinals)); |
| | | } |
| | | |
| | | @PostMapping("/queryData") |
| | | @Operation(summary = "æ¡ä»¶æ¥è¯¢") |
| | | @Log(title = "çµè¡¨æ°æ®æ¥è¯¢", businessType = BusinessType.SELECT) |
| | | public AjaxResult queryData(@RequestBody ReceiveValueListVo vo) |
| | | { |
| | | return AjaxResult.success(receiveElectricityValueFinalService.queryData(vo)); |
| | | } |
| | | |
| | | @PostMapping("/deleteBatch") |
| | | @Operation(summary = "æ¹éå é¤") |
| | | @Log(title = "çµè¡¨æ°æ®å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteBatch(@RequestBody List<Long> ids) |
| | | { |
| | | return AjaxResult.success(receiveElectricityValueFinalService.deleteBatch(ids)); |
| | | } |
| | | |
| | | @PostMapping("/updateDate") |
| | | @Operation(summary = "ä¿®æ¹æ´æ°") |
| | | @Log(title = "çµè¡¨æ°æ®ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateDate(@RequestBody ReceiveElectricityValueFinal receiveElectricityValueFinal) |
| | | { |
| | | return AjaxResult.success(receiveElectricityValueFinalService.updateDate(receiveElectricityValueFinal)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.fuzhou; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.fuzhou.domain.*; |
| | | import com.ruoyi.fuzhou.domain.vo.ReceiveValueListVo; |
| | | import com.ruoyi.fuzhou.enums.DataTypeEnum; |
| | | import com.ruoyi.fuzhou.service.*; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ°æ®æ¥æ¶ä¿¡æ¯ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author zhangyy |
| | | * @since 2025-03-10 |
| | | */ |
| | | @Tag(name = "è®¾å¤æ°æ®ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/dp/receiveInfo") |
| | | public class ReceiveInfoController { |
| | | |
| | | @Resource |
| | | private EquipmentService equipmentService; |
| | | |
| | | @Resource |
| | | private ReceiveOilValueService receiveOilValueService; |
| | | |
| | | @Resource |
| | | private ReceiveWaterValueService receiveWaterValueService; |
| | | |
| | | @Resource |
| | | private ReceiveWaterInfoService receiveWaterInfoService; |
| | | |
| | | @Resource |
| | | private ReceiveOilInfoService receiveOilInfoService; |
| | | |
| | | @Resource |
| | | private ReceiveElectricityInfoService receiveElectricityInfoService; |
| | | @Resource |
| | | private ReceiveWeatherInfoService receiveWeatherInfoService; |
| | | @Resource |
| | | private ReceiveWeatherValueService receiveWeatherValueService; |
| | | |
| | | @Resource |
| | | private ReceiveSlmInfoService receiveSlmInfoService; |
| | | |
| | | @Resource |
| | | private ReceiveSlmValueService receiveSlmValueService; |
| | | |
| | | @Resource |
| | | private ReceiveElectricityValueService receiveElectricityValueService; |
| | | |
| | | @Resource |
| | | private ReceiveCarRuleService receiveCarRuleService; |
| | | |
| | | @Resource |
| | | private ReceiveCarValueService receiveCarValueService; |
| | | |
| | | @Operation(summary = "设å¤å表å表") |
| | | @GetMapping("/list") |
| | | public R<List<DpEquipment>> list(@RequestParam(value = "deviceType", required = false) Integer deviceType) { |
| | | return R.ok(equipmentService.list(new LambdaQueryWrapper<DpEquipment>() {{ |
| | | or().eq(DpEquipment::getEquipmentTypeId, deviceType); |
| | | }})); |
| | | } |
| | | |
| | | @Operation(summary = "è·åè®¾å¤æ°æ®") |
| | | @PostMapping("/dataList") |
| | | public R<List> dataList(@Validated @RequestBody ReceiveValueListVo vo) { |
| | | DpEquipment receiveInfo = equipmentService.getById(vo.getId()); |
| | | if (receiveInfo == null) { |
| | | throw new ServiceException("设å¤ä¸åå¨ï¼"); |
| | | } |
| | | if (DataTypeEnum.LIJIUOIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.OIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || |
| | | DataTypeEnum.LIJIUJUN.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.NIGDETUIYOU.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveOilValueService.list(new LambdaQueryWrapper<ReceiveOilValue>() {{ |
| | | or().eq(ReceiveOilValue::getDeviceName, String.valueOf(receiveInfo.getId())) |
| | | .ge(vo.getStartTime() != null, ReceiveOilValue::getCreateTime, vo.getStartTime()) |
| | | .lt(vo.getEndTime() != null, ReceiveOilValue::getCreateTime, vo.getEndTime()) |
| | | .orderByDesc(ReceiveOilValue::getCreateTime); |
| | | }})); |
| | | } else if (DataTypeEnum.WATER_FLOW.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.WATER_YA.getCode().equals(receiveInfo.getEquipmentTypeId()) |
| | | || DataTypeEnum.WATER_DEPT.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveWaterValueService.list(new LambdaQueryWrapper<ReceiveWaterValue>() {{ |
| | | or().eq(ReceiveWaterValue::getDeviceName, String.valueOf(receiveInfo.getId())) |
| | | .ge(vo.getStartTime() != null, ReceiveWaterValue::getCreateTime, vo.getStartTime()) |
| | | .lt(vo.getEndTime() != null, ReceiveWaterValue::getCreateTime, vo.getEndTime()) |
| | | .orderByDesc(ReceiveWaterValue::getCreateTime); |
| | | }})); |
| | | } else if (DataTypeEnum.ELECTRICITY.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveElectricityValueService.list(new LambdaQueryWrapper<ReceiveElectricityValue>() {{ |
| | | or().eq(ReceiveElectricityValue::getDeviceName, String.valueOf(receiveInfo.getId())) |
| | | .ge(vo.getStartTime() != null, ReceiveElectricityValue::getCreateTime, vo.getStartTime()) |
| | | .lt(vo.getEndTime() != null, ReceiveElectricityValue::getCreateTime, vo.getEndTime()) |
| | | .orderByDesc(ReceiveElectricityValue::getCreateTime); |
| | | }})); |
| | | } else if (DataTypeEnum.GONGKUANG.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveCarValueService.list(new LambdaQueryWrapper<ReceiveCarValue>() {{ |
| | | or().eq(ReceiveCarValue::getVin, receiveInfo.getEquCode()) |
| | | .ge(vo.getStartTime() != null, ReceiveCarValue::getCreateTime, vo.getStartTime()) |
| | | .lt(vo.getEndTime() != null, ReceiveCarValue::getCreateTime, vo.getEndTime()) |
| | | .orderByDesc(ReceiveCarValue::getCreateTime); |
| | | }})); |
| | | }else if (DataTypeEnum.WEATHER.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveWeatherValueService.list(new LambdaQueryWrapper<ReceiveWeatherValue>() {{ |
| | | or().eq(ReceiveWeatherValue::getDeviceName, receiveInfo.getId()) |
| | | .ge(vo.getStartTime() != null, ReceiveWeatherValue::getCreateTime, vo.getStartTime()) |
| | | .lt(vo.getEndTime() != null, ReceiveWeatherValue::getCreateTime, vo.getEndTime()) |
| | | .orderByDesc(ReceiveWeatherValue::getCreateTime); |
| | | }})); |
| | | }else if (DataTypeEnum.SLM.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveSlmValueService.list(new LambdaQueryWrapper<ReceiveSlmValue>() {{ |
| | | or().eq(ReceiveSlmValue::getDeviceName, receiveInfo.getId()) |
| | | .ge(vo.getStartTime() != null, ReceiveSlmValue::getCreateTime, vo.getStartTime()) |
| | | .lt(vo.getEndTime() != null, ReceiveSlmValue::getCreateTime, vo.getEndTime()) |
| | | .orderByDesc(ReceiveSlmValue::getCreateTime); |
| | | }})); |
| | | } |
| | | return R.ok(new ArrayList()); |
| | | } |
| | | |
| | | @Operation(summary = "è·åè®¾å¤æ°æ®è¡¨å¤´") |
| | | @GetMapping("/tableList") |
| | | public R<List> tableList(@RequestParam("id") Long id) { |
| | | DpEquipment receiveInfo = equipmentService.getById(id); |
| | | if (receiveInfo == null) { |
| | | throw new ServiceException("设å¤ä¸åå¨ï¼"); |
| | | } |
| | | if (DataTypeEnum.LIJIUOIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.OIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || |
| | | DataTypeEnum.LIJIUJUN.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.NIGDETUIYOU.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveOilInfoService.list(new LambdaQueryWrapper<ReceiveOilInfo>() {{ |
| | | or().select(ReceiveOilInfo::getParam, ReceiveOilInfo::getParamCode, ReceiveOilInfo::getUnit).eq(ReceiveOilInfo::getDeviceName, String.valueOf(receiveInfo.getId())); |
| | | }})); |
| | | } else if (DataTypeEnum.WATER_FLOW.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.WATER_YA.getCode().equals(receiveInfo.getEquipmentTypeId()) |
| | | || DataTypeEnum.WATER_DEPT.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveWaterInfoService.list(new LambdaQueryWrapper<ReceiveWaterInfo>() {{ |
| | | or().select(ReceiveWaterInfo::getParam, ReceiveWaterInfo::getParamCode, ReceiveWaterInfo::getUnit).eq(ReceiveWaterInfo::getDeviceName, String.valueOf(receiveInfo.getId())); |
| | | }})); |
| | | } else if (DataTypeEnum.ELECTRICITY.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveElectricityInfoService.list(new LambdaQueryWrapper<ReceiveElectricityInfo>() {{ |
| | | or().select(ReceiveElectricityInfo::getParam, ReceiveElectricityInfo::getParamCode, ReceiveElectricityInfo::getUnit).eq(ReceiveElectricityInfo::getDeviceName, String.valueOf(receiveInfo.getId())); |
| | | }})); |
| | | } else if (DataTypeEnum.GONGKUANG.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | List<ReceiveElectricityInfo> receiveElectricityInfos = new ArrayList<>(); |
| | | List<ReceiveCarRule> list = receiveCarRuleService.list(); |
| | | ReceiveElectricityInfo electricityInfo; |
| | | for (ReceiveCarRule rule : list |
| | | ) { |
| | | electricityInfo = new ReceiveElectricityInfo(); |
| | | electricityInfo.setUnit(rule.getUnit()); |
| | | electricityInfo.setParamCode(rule.getCarCode()); |
| | | electricityInfo.setParam(rule.getDataName()); |
| | | receiveElectricityInfos.add(electricityInfo); |
| | | } |
| | | return R.ok(receiveElectricityInfos); |
| | | } else if (DataTypeEnum.WEATHER.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveWeatherInfoService.list(new LambdaQueryWrapper<ReceiveWeatherInfo>() {{ |
| | | or().select(ReceiveWeatherInfo::getParam, ReceiveWeatherInfo::getParamCode, ReceiveWeatherInfo::getUnit).eq(ReceiveWeatherInfo::getDeviceName, String.valueOf(receiveInfo.getId())); |
| | | }})); |
| | | } else if (DataTypeEnum.SLM.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveSlmInfoService.list(new LambdaQueryWrapper<ReceiveSlmInfo>() {{ |
| | | or().select(ReceiveSlmInfo::getParam, ReceiveSlmInfo::getParamCode, ReceiveSlmInfo::getUnit).eq(ReceiveSlmInfo::getDeviceName, String.valueOf(receiveInfo.getId())); |
| | | }})); |
| | | } |
| | | return R.ok(new ArrayList()); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.fuzhou; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.fuzhou.domain.*; |
| | | import com.ruoyi.fuzhou.domain.vo.ReceiveValueListVo; |
| | | import com.ruoyi.fuzhou.enums.DataTypeEnum; |
| | | import com.ruoyi.fuzhou.service.*; |
| | | import com.ruoyi.system.domain.SysOperLog; |
| | | import com.ruoyi.system.domain.vo.SysOperLogVO; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.system.service.ISysOperLogService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Tag(name = "大å±--è®¾å¤æ°æ®å¤çç»æ") |
| | | @RestController |
| | | @RequestMapping("/dp/receiveInfoFinal") |
| | | public class ReceiveInfoFinalController { |
| | | @Autowired |
| | | private EquipmentService equipmentService; |
| | | |
| | | @Autowired |
| | | private ReceiveWaterInfoService receiveWaterInfoService; |
| | | |
| | | @Autowired |
| | | private ReceiveOilInfoService receiveOilInfoService; |
| | | |
| | | @Autowired |
| | | private ReceiveElectricityInfoService receiveElectricityInfoService; |
| | | |
| | | @Autowired |
| | | private ReceiveCarRuleService receiveCarRuleService; |
| | | |
| | | @Autowired |
| | | private ReceiveOilValueFinalService receiveOilValueFinalService; |
| | | @Autowired |
| | | private ReceiveCarValueFinalService receiveCarValueFinalService; |
| | | @Autowired |
| | | private ReceiveElectricityValueFinalService receiveElectricityValueFinalService; |
| | | @Autowired |
| | | private ReceiveWaterValueFinalService receiveWaterValueFinalService; |
| | | @Autowired |
| | | private ISysOperLogService sysOperLogService; |
| | | |
| | | @Autowired |
| | | private ReceiveOilValueService oilValueService; |
| | | @Autowired |
| | | private ReceiveCarValueService carValueService; |
| | | @Autowired |
| | | private ReceiveElectricityValueService electricityValueService; |
| | | @Autowired |
| | | private ReceiveWaterValueService waterValueService; |
| | | |
| | | @Autowired |
| | | private ReceiveWeatherValueFinalService receiveWeatherValueFinalService; |
| | | @Autowired |
| | | private ReceiveWeatherInfoService receiveWeatherInfoService; |
| | | |
| | | |
| | | @Autowired |
| | | private ReceiveSlmValueFinalService receiveSlmValueFinalService; |
| | | @Autowired |
| | | private ReceiveSlmInfoService receiveSlmInfoService; |
| | | |
| | | |
| | | |
| | | |
| | | @Operation(summary = "è®¾å¤æ°æ®å表") |
| | | @GetMapping("/list") |
| | | public R<List<DpEquipment>> list(@RequestParam(value = "deviceType", required = false) Integer deviceType) { |
| | | return R.ok(equipmentService.list(new LambdaQueryWrapper<DpEquipment>() {{ |
| | | or().eq(DpEquipment::getEquipmentTypeId, deviceType); |
| | | }})); |
| | | } |
| | | |
| | | @Operation(summary = "è·åè®¾å¤æ°æ®") |
| | | @PostMapping("/dataList") |
| | | public R<List> dataList(@Validated @RequestBody ReceiveValueListVo vo) { |
| | | DpEquipment receiveInfo = equipmentService.getById(vo.getId()); |
| | | if (receiveInfo == null) { |
| | | throw new ServiceException("设å¤ä¸åå¨ï¼"); |
| | | } |
| | | if (DataTypeEnum.LIJIUOIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.OIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || |
| | | DataTypeEnum.LIJIUJUN.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.NIGDETUIYOU.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveOilValueFinalService.queryData(vo)); |
| | | } |
| | | else if (DataTypeEnum.WATER_FLOW.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.WATER_YA.getCode().equals(receiveInfo.getEquipmentTypeId()) |
| | | || DataTypeEnum.WATER_DEPT.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveWaterValueFinalService.queryData(vo)); |
| | | } else if (DataTypeEnum.ELECTRICITY.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveElectricityValueFinalService.queryData(vo)); |
| | | } else if (DataTypeEnum.GONGKUANG.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveCarValueFinalService.queryData(vo)); |
| | | }else if (DataTypeEnum.WEATHER.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveWeatherValueFinalService.queryData(vo)); |
| | | }else if (DataTypeEnum.SLM.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveSlmValueFinalService.queryData(vo)); |
| | | } |
| | | return R.ok(new ArrayList()); |
| | | } |
| | | |
| | | @Operation(summary = "æ¥è¯¢æ¶é´æ®µå
æ¯å¤©çç»è®¡æ°æ®") |
| | | @GetMapping("/selectDailyData") |
| | | public AjaxResult selectDailyData(@RequestParam(value = "startTime") String startTime, |
| | | @RequestParam(value = "endTime") String endTime, |
| | | @RequestParam(value = "title") String title) { |
| | | JSONArray jsonArray = new JSONArray(); |
| | | SysOperLogVO insertLog = new SysOperLogVO(); |
| | | insertLog.setTitle(title); |
| | | insertLog.setStartTime(startTime); |
| | | insertLog.setEndTime(endTime); |
| | | Map<String,List<SysOperLog>> map = sysOperLogService.queryByDate(insertLog); |
| | | for (Map.Entry<String,List<SysOperLog>> entry : map.entrySet()){ |
| | | int insertCount = 0; |
| | | int updateCount = 0; |
| | | int deleteCount = 0; |
| | | String date = entry.getKey(); |
| | | List<SysOperLog> logList = entry.getValue(); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | if(logList.size()>0){ |
| | | for (SysOperLog operLog : logList){ |
| | | if(operLog.getBusinessType()==1){ |
| | | insertCount++; |
| | | }else if(operLog.getBusinessType()==2){ |
| | | updateCount++; |
| | | }else if(operLog.getBusinessType()==3){ |
| | | deleteCount++; |
| | | } |
| | | } |
| | | } |
| | | jsonObject.put("dateTime",date); |
| | | jsonObject.put("insertCount",insertCount); |
| | | jsonObject.put("updateCount",updateCount); |
| | | jsonObject.put("deleteCount",deleteCount); |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | return AjaxResult.success(jsonArray); |
| | | } |
| | | |
| | | @Operation(summary = "æ°éç»è®¡") |
| | | @GetMapping("/queryCount") |
| | | public AjaxResult queryCount(@RequestParam(value = "title") String title){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | if(title.equals("æ²¹è¡¨æ°æ®")){ |
| | | jsonObject.put("processedData",receiveOilValueFinalService.queryCount()); |
| | | jsonObject.put("rawCount",oilValueService.count()); |
| | | }else if(title.equals("æ°´è¡¨æ°æ®")){ |
| | | jsonObject.put("processedData",receiveWaterValueFinalService.queryCount()); |
| | | jsonObject.put("rawCount",waterValueService.count()); |
| | | }else if(title.equals("çµè¡¨æ°æ®")){ |
| | | jsonObject.put("processedData",receiveElectricityValueFinalService.queryCount()); |
| | | jsonObject.put("rawCount",electricityValueService.count()); |
| | | }else if(title.equals("工嵿°æ®")){ |
| | | jsonObject.put("processedData",receiveCarValueFinalService.queryCount()); |
| | | jsonObject.put("rawCount",carValueService.count()); |
| | | } |
| | | return AjaxResult.success(jsonObject); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®titleæ¥è¯¢ç»è®¡æ°æ®(å页)") |
| | | @PostMapping("/selectData") |
| | | public AjaxResult selectData(@Validated @RequestBody SysOperLogVO sysOperLogVO) { |
| | | List<SysOperLog> logList = sysOperLogService.queryDataByTitle(sysOperLogVO); |
| | | TableDataInfo dataInfo = paginate(logList,sysOperLogVO.getPageNum(),sysOperLogVO.getPageSize()); |
| | | return AjaxResult.success(dataInfo); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "夿坹åºè¯·æ±è·¯å¾") |
| | | @GetMapping("/getUrl") |
| | | public R<String> getUrl(@RequestParam("equId") String equId) { |
| | | DpEquipment receiveInfo = equipmentService.getById(equId); |
| | | if (receiveInfo == null) { |
| | | throw new ServiceException("设å¤ä¸åå¨ï¼"); |
| | | } |
| | | if (DataTypeEnum.LIJIUOIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.OIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || |
| | | DataTypeEnum.LIJIUJUN.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.NIGDETUIYOU.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok("oilValueFinal"); |
| | | } |
| | | else if (DataTypeEnum.WATER_FLOW.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.WATER_YA.getCode().equals(receiveInfo.getEquipmentTypeId()) |
| | | || DataTypeEnum.WATER_DEPT.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok("receiveWaterValueFinal"); |
| | | } else if (DataTypeEnum.ELECTRICITY.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok("receiveElectricityValueFinal"); |
| | | } else if (DataTypeEnum.GONGKUANG.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok("receiveCarValueFinal"); |
| | | } else if (DataTypeEnum.WEATHER.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok("receiveWeatherValueFinal"); |
| | | } else if (DataTypeEnum.SLM.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok("receiveSlmValueFinal"); |
| | | } |
| | | return R.ok(null); |
| | | } |
| | | |
| | | @Operation(summary = "è·åè®¾å¤æ°æ®è¡¨å¤´") |
| | | @GetMapping("/tableList") |
| | | public R<List> tableList(@RequestParam("id") Long id) { |
| | | DpEquipment receiveInfo = equipmentService.getById(id); |
| | | if (receiveInfo == null) { |
| | | throw new ServiceException("设å¤ä¸åå¨ï¼"); |
| | | } |
| | | if (DataTypeEnum.LIJIUOIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.OIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || |
| | | DataTypeEnum.LIJIUJUN.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.NIGDETUIYOU.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveOilInfoService.list(new LambdaQueryWrapper<ReceiveOilInfo>() {{ |
| | | or().select(ReceiveOilInfo::getParam, ReceiveOilInfo::getParamCode, ReceiveOilInfo::getUnit).eq(ReceiveOilInfo::getDeviceName, String.valueOf(receiveInfo.getId())); |
| | | }})); |
| | | } |
| | | else if (DataTypeEnum.WATER_FLOW.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.WATER_YA.getCode().equals(receiveInfo.getEquipmentTypeId()) |
| | | || DataTypeEnum.WATER_DEPT.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveWaterInfoService.list(new LambdaQueryWrapper<ReceiveWaterInfo>() {{ |
| | | or().select(ReceiveWaterInfo::getParam, ReceiveWaterInfo::getParamCode, ReceiveWaterInfo::getUnit).eq(ReceiveWaterInfo::getDeviceName, String.valueOf(receiveInfo.getId())); |
| | | }})); |
| | | } else if (DataTypeEnum.ELECTRICITY.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveElectricityInfoService.list(new LambdaQueryWrapper<ReceiveElectricityInfo>() {{ |
| | | or().select(ReceiveElectricityInfo::getParam, ReceiveElectricityInfo::getParamCode, ReceiveElectricityInfo::getUnit).eq(ReceiveElectricityInfo::getDeviceName, String.valueOf(receiveInfo.getId())); |
| | | }})); |
| | | } else if (DataTypeEnum.GONGKUANG.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | List<ReceiveElectricityInfo> receiveElectricityInfos = new ArrayList<>(); |
| | | List<ReceiveCarRule> list = receiveCarRuleService.list(); |
| | | ReceiveElectricityInfo electricityInfo; |
| | | for (ReceiveCarRule rule : list |
| | | ) { |
| | | electricityInfo = new ReceiveElectricityInfo(); |
| | | electricityInfo.setUnit(rule.getUnit()); |
| | | electricityInfo.setParamCode(rule.getCarCode()); |
| | | electricityInfo.setParam(rule.getDataName()); |
| | | receiveElectricityInfos.add(electricityInfo); |
| | | } |
| | | return R.ok(receiveElectricityInfos); |
| | | } else if (DataTypeEnum.WEATHER.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveWeatherInfoService.list(new LambdaQueryWrapper<ReceiveWeatherInfo>() {{ |
| | | or().select(ReceiveWeatherInfo::getParam, ReceiveWeatherInfo::getParamCode, ReceiveWeatherInfo::getUnit).eq(ReceiveWeatherInfo::getDeviceName, String.valueOf(receiveInfo.getId())); |
| | | }})); |
| | | } else if (DataTypeEnum.SLM.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return R.ok(receiveSlmInfoService.list(new LambdaQueryWrapper<ReceiveSlmInfo>() {{ |
| | | or().select(ReceiveSlmInfo::getParam, ReceiveSlmInfo::getParamCode, ReceiveSlmInfo::getUnit).eq(ReceiveSlmInfo::getDeviceName, String.valueOf(receiveInfo.getId())); |
| | | }})); |
| | | } |
| | | return R.ok(new ArrayList()); |
| | | } |
| | | |
| | | //è·åè®¾å¤æ°æ®ä¸è¡¨å¤´(å页) |
| | | @PostMapping("/getPageListByIdRuoyi") |
| | | @Operation(summary = "è·åè®¾å¤æ°æ®ä¸è¡¨å¤´(å页)") |
| | | public AjaxResult getPageListByIdRuoyi(@Validated @RequestBody ReceiveValueListVo vo) { |
| | | List dataList = dataList(vo).getData(); |
| | | List tableList = tableList(vo.getId()).getData(); |
| | | |
| | | TableDataInfo dataInfo = paginate(dataList, vo.getPageNum(), vo.getPageSize()); |
| | | JSONObject object = new JSONObject(); |
| | | object.put("dataList", dataInfo); |
| | | object.put("tableList", tableList); |
| | | return AjaxResult.success(object); |
| | | } |
| | | |
| | | //对å表è¿è¡å页 |
| | | private TableDataInfo paginate(List list, int pageNum, int pageSize) { |
| | | if (list == null || list.isEmpty()) { |
| | | return new TableDataInfo(new ArrayList<>(), 0); |
| | | } |
| | | int total = list.size(); |
| | | int formIndex = (pageNum - 1) * pageSize; |
| | | int toIndex = Math.min(formIndex + pageSize, total); |
| | | if (formIndex >= total) { |
| | | return new TableDataInfo(new ArrayList<>(), total); |
| | | } |
| | | List subList = list.subList(formIndex, toIndex); |
| | | return new TableDataInfo(subList, total); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.fuzhou; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.fuzhou.domain.ReceiveOilValueFinal; |
| | | import com.ruoyi.fuzhou.domain.vo.ReceiveValueListVo; |
| | | import com.ruoyi.fuzhou.service.ReceiveOilValueFinalService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 油设å¤å®æ¶æ°æ® å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-04-25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/oilValueFinal") |
| | | @Tag(name = "大å±--æ²¹æ°æ®å¤çç»æ") |
| | | public class ReceiveOilValueFinalController { |
| | | |
| | | @Autowired |
| | | private ReceiveOilValueFinalService receiveOilValueFinalService; |
| | | |
| | | @GetMapping("/listAll") |
| | | @Operation(summary = "æ¥è¯¢æææ°æ®å表") |
| | | public AjaxResult listAll() |
| | | { |
| | | return AjaxResult.success(receiveOilValueFinalService.listAll()); |
| | | } |
| | | |
| | | @PostMapping("/saveBatch") |
| | | @Operation(summary = "æ¹éæå
¥") |
| | | @Log(title = "æ²¹è¡¨æ°æ®æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult saveBatch(@RequestBody List<ReceiveOilValueFinal> oilValueFinals) |
| | | { |
| | | return AjaxResult.success(receiveOilValueFinalService.saveBatch(oilValueFinals)); |
| | | } |
| | | |
| | | @PostMapping("/queryData") |
| | | @Operation(summary = "æ¡ä»¶æ¥è¯¢") |
| | | @Log(title = "æ²¹è¡¨æ°æ®æ¥è¯¢", businessType = BusinessType.SELECT) |
| | | public AjaxResult queryData(@RequestBody ReceiveValueListVo vo) |
| | | { |
| | | return AjaxResult.success(receiveOilValueFinalService.queryData(vo)); |
| | | } |
| | | |
| | | @PostMapping("/deleteBatch") |
| | | @Operation(summary = "æ¹éå é¤") |
| | | @Log(title = "æ²¹è¡¨æ°æ®å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteBatch(@RequestBody List<Long> ids) |
| | | { |
| | | return AjaxResult.success(receiveOilValueFinalService.deleteBatch(ids)); |
| | | } |
| | | |
| | | @PostMapping("/updateDate") |
| | | @Operation(summary = "ä¿®æ¹æ´æ°") |
| | | @Log(title = "æ²¹è¡¨æ°æ®ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateDate(@RequestBody ReceiveOilValueFinal receiveOilValueFinal) |
| | | { |
| | | return AjaxResult.success(receiveOilValueFinalService.updateDate(receiveOilValueFinal)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.fuzhou; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.fuzhou.domain.ReceiveSlmValueFinal; |
| | | import com.ruoyi.fuzhou.domain.ReceiveSlmValueFinal; |
| | | import com.ruoyi.fuzhou.domain.ReceiveWeatherValueFinal; |
| | | import com.ruoyi.fuzhou.domain.vo.ReceiveValueListVo; |
| | | import com.ruoyi.fuzhou.service.ReceiveSlmValueFinalService; |
| | | import com.ruoyi.fuzhou.service.ReceiveWeatherValueFinalService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ°´å®æ¶æ°æ® å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-04-25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/receiveSlmValueFinal") |
| | | @Tag(name = "大å±--æ°´æ°æ®å¤çç»æ") |
| | | public class ReceiveSlmValueFinalController { |
| | | |
| | | @Autowired |
| | | private ReceiveSlmValueFinalService receiveSlmValueFinalService; |
| | | |
| | | @GetMapping("/listAll") |
| | | @Operation(summary = "æ¥è¯¢æææ°æ®å表") |
| | | public AjaxResult listAll() |
| | | { |
| | | return AjaxResult.success(receiveSlmValueFinalService.listAll()); |
| | | } |
| | | |
| | | @PostMapping("/saveBatch") |
| | | @Operation(summary = "æ¹éæå
¥") |
| | | @Log(title = "æ°´è¡¨æ°æ®æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult saveBatch(@RequestBody List<ReceiveSlmValueFinal> waterValueFinals) |
| | | { |
| | | return AjaxResult.success(receiveSlmValueFinalService.saveBatchNew(waterValueFinals)); |
| | | } |
| | | |
| | | @PostMapping("/queryData") |
| | | @Operation(summary = "æ¡ä»¶æ¥è¯¢") |
| | | @Log(title = "æ°´è¡¨æ°æ®æ¥è¯¢", businessType = BusinessType.SELECT) |
| | | public AjaxResult queryData(@RequestBody ReceiveValueListVo vo) |
| | | { |
| | | return AjaxResult.success(receiveSlmValueFinalService.queryData(vo)); |
| | | } |
| | | |
| | | @PostMapping("/deleteBatch") |
| | | @Operation(summary = "æ¹éå é¤") |
| | | @Log(title = "æ°´è¡¨æ°æ®å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteBatch(@RequestBody List<Long> ids) |
| | | { |
| | | return AjaxResult.success(receiveSlmValueFinalService.deleteBatch(ids)); |
| | | } |
| | | |
| | | @PostMapping("/updateDate") |
| | | @Operation(summary = "ä¿®æ¹æ´æ°") |
| | | @Log(title = "æ°´è¡¨æ°æ®ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateDate(@RequestBody ReceiveSlmValueFinal ReceiveSlmValueFinal) |
| | | { |
| | | return AjaxResult.success(receiveSlmValueFinalService.updateDate(ReceiveSlmValueFinal)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.fuzhou; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.fuzhou.domain.ReceiveWaterValueFinal; |
| | | import com.ruoyi.fuzhou.domain.vo.ReceiveValueListVo; |
| | | import com.ruoyi.fuzhou.service.ReceiveWaterValueFinalService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ°´å®æ¶æ°æ® å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-04-25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/receiveWaterValueFinal") |
| | | @Tag(name = "大å±--æ°´æ°æ®å¤çç»æ") |
| | | public class ReceiveWaterValueFinalController { |
| | | @Autowired |
| | | private ReceiveWaterValueFinalService receiveWaterValueFinalService; |
| | | |
| | | @GetMapping("/listAll") |
| | | @Operation(summary = "æ¥è¯¢æææ°æ®å表") |
| | | public AjaxResult listAll() |
| | | { |
| | | return AjaxResult.success(receiveWaterValueFinalService.listAll()); |
| | | } |
| | | |
| | | @PostMapping("/saveBatch") |
| | | @Operation(summary = "æ¹éæå
¥") |
| | | @Log(title = "æ°´è¡¨æ°æ®æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult saveBatch(@RequestBody List<ReceiveWaterValueFinal> waterValueFinals) |
| | | { |
| | | return AjaxResult.success(receiveWaterValueFinalService.saveBatch(waterValueFinals)); |
| | | } |
| | | |
| | | @PostMapping("/queryData") |
| | | @Operation(summary = "æ¡ä»¶æ¥è¯¢") |
| | | @Log(title = "æ°´è¡¨æ°æ®æ¥è¯¢", businessType = BusinessType.SELECT) |
| | | public AjaxResult queryData(@RequestBody ReceiveValueListVo vo) |
| | | { |
| | | return AjaxResult.success(receiveWaterValueFinalService.queryData(vo)); |
| | | } |
| | | |
| | | @PostMapping("/deleteBatch") |
| | | @Operation(summary = "æ¹éå é¤") |
| | | @Log(title = "æ°´è¡¨æ°æ®å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteBatch(@RequestBody List<Long> ids) |
| | | { |
| | | return AjaxResult.success(receiveWaterValueFinalService.deleteBatch(ids)); |
| | | } |
| | | |
| | | @PostMapping("/updateDate") |
| | | @Operation(summary = "ä¿®æ¹æ´æ°") |
| | | @Log(title = "æ°´è¡¨æ°æ®ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateDate(@RequestBody ReceiveWaterValueFinal receiveWaterValueFinal) |
| | | { |
| | | return AjaxResult.success(receiveWaterValueFinalService.updateDate(receiveWaterValueFinal)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.fuzhou; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.fuzhou.domain.ReceiveWaterValueFinal; |
| | | import com.ruoyi.fuzhou.domain.ReceiveWeatherValueFinal; |
| | | import com.ruoyi.fuzhou.domain.vo.ReceiveValueListVo; |
| | | |
| | | import com.ruoyi.fuzhou.service.ReceiveWeatherValueFinalService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ°´å®æ¶æ°æ® å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-04-25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/receiveWeatherValueFinal") |
| | | @Tag(name = "大å±--æ°´æ°æ®å¤çç»æ") |
| | | public class ReceiveWeatherValueFinalController { |
| | | @Autowired |
| | | private ReceiveWeatherValueFinalService receiveWeatherValueFinalService; |
| | | |
| | | @GetMapping("/listAll") |
| | | @Operation(summary = "æ¥è¯¢æææ°æ®å表") |
| | | public AjaxResult listAll() |
| | | { |
| | | return AjaxResult.success(receiveWeatherValueFinalService.listAll()); |
| | | } |
| | | |
| | | @PostMapping("/saveBatch") |
| | | @Operation(summary = "æ¹éæå
¥") |
| | | @Log(title = "æ°´è¡¨æ°æ®æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult saveBatch(@RequestBody List<ReceiveWeatherValueFinal> waterValueFinals) |
| | | { |
| | | return AjaxResult.success(receiveWeatherValueFinalService.saveBatchNew(waterValueFinals)); |
| | | } |
| | | |
| | | @PostMapping("/queryData") |
| | | @Operation(summary = "æ¡ä»¶æ¥è¯¢") |
| | | @Log(title = "æ°´è¡¨æ°æ®æ¥è¯¢", businessType = BusinessType.SELECT) |
| | | public AjaxResult queryData(@RequestBody ReceiveValueListVo vo) |
| | | { |
| | | return AjaxResult.success(receiveWeatherValueFinalService.queryData(vo)); |
| | | } |
| | | |
| | | @PostMapping("/deleteBatch") |
| | | @Operation(summary = "æ¹éå é¤") |
| | | @Log(title = "æ°´è¡¨æ°æ®å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult deleteBatch(@RequestBody List<Long> ids) |
| | | { |
| | | return AjaxResult.success(receiveWeatherValueFinalService.deleteBatch(ids)); |
| | | } |
| | | |
| | | @PostMapping("/updateDate") |
| | | @Operation(summary = "ä¿®æ¹æ´æ°") |
| | | @Log(title = "æ°´è¡¨æ°æ®ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateDate(@RequestBody ReceiveWeatherValueFinal receiveWeatherValueFinal) |
| | | { |
| | | return AjaxResult.success(receiveWeatherValueFinalService.updateDate(receiveWeatherValueFinal)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.fuzhou.domain.DpEquipment; |
| | | import com.ruoyi.fuzhou.domain.ReceiveSlmValueFinal; |
| | | import com.ruoyi.fuzhou.domain.ReceiveWaterValue; |
| | | import com.ruoyi.fuzhou.domain.vo.DpEquipmentVO; |
| | | import com.ruoyi.fuzhou.service.EquipmentService; |
| | | import com.ruoyi.fuzhou.service.ReceiveWaterValueService; |
| | | import com.ruoyi.manage.domain.DmBerth; |
| | | import com.ruoyi.manage.service.DpBerthService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.manage.domain.DmHarbor; |
| | | import com.ruoyi.manage.service.IDmHarborService; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 港å£ä¿¡æ¯Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2025-03-17 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/harbor") |
| | | @Tag(name = "大å±--港å£ç®¡ç") |
| | | public class DmHarborController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IDmHarborService dmHarborService; |
| | | @Autowired |
| | | private DpBerthService dpBerthService; |
| | | @Resource |
| | | private EquipmentService dpEquipmentService; |
| | | @Resource |
| | | private ReceiveWaterValueService receiveWaterValueService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¸¯å£ä¿¡æ¯å表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @Operation(summary = "æ¥è¯¢æ¸¯å£ä¿¡æ¯å表") |
| | | public TableDataInfo list(DmHarbor dmHarbor) |
| | | { |
| | | |
| | | return dmHarborService.getList(dmHarbor); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æææ¸¯å£ä¿¡æ¯å表 |
| | | */ |
| | | @GetMapping("/listAll") |
| | | @Operation(summary = "æ¥è¯¢æææ¸¯å£ä¿¡æ¯å表") |
| | | public AjaxResult listAll() |
| | | { |
| | | return AjaxResult.success(dmHarborService.list()); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æææ¸¯å£ä¿¡æ¯å表 |
| | | */ |
| | | @GetMapping("/getListAll") |
| | | @Operation(summary = "æ¥è¯¢æææ¸¯å£ä¿¡æ¯") |
| | | public AjaxResult getListAll() |
| | | { |
| | | //è·åç¨æ·ä¿¡æ¯æ ¹æ®é¨é¨IDæ¥è¯¢æ¸¯å£ä¿¡æ¯ |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long deptId = loginUser.getDeptId(); |
| | | if(deptId.equals(100L)){ |
| | | return AjaxResult.success(dmHarborService.list()); |
| | | } |
| | | if(deptId.equals(4001L)){ |
| | | deptId = 101L; |
| | | } |
| | | if(deptId.equals(4002L)){ |
| | | deptId = 4000L; |
| | | } |
| | | QueryWrapper<DmHarbor> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("DEPT_ID",deptId); |
| | | return AjaxResult.success(dmHarborService.list(queryWrapper)); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¸¯å£åå
¶æ³ä½è¯¦æ
|
| | | */ |
| | | @GetMapping("/getHarborBerth") |
| | | @Operation(summary = "æ¥è¯¢æ¸¯å£åå
¶æ³ä½è¯¦æ
") |
| | | public AjaxResult getHarborBerth() |
| | | { |
| | | //è·åç¨æ·ä¿¡æ¯æ ¹æ®é¨é¨IDæ¥è¯¢æ¸¯å£ä¿¡æ¯ |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long deptId = loginUser.getDeptId(); |
| | | List<DmHarbor> reslist = new ArrayList<>(); |
| | | if(deptId.equals(100L)){ |
| | | List<DmHarbor> list = dmHarborService.list(); |
| | | for (DmHarbor dmHarbor : list){ |
| | | LambdaQueryWrapper<DmBerth> berthQueryWrapper = new LambdaQueryWrapper<>(); |
| | | berthQueryWrapper.eq(DmBerth::getHarborId,dmHarbor.getPkId()).notIn(DmBerth::getName,"ååº").orderByAsc(DmBerth::getOrderNum); |
| | | List<DmBerth> dmBerths = dpBerthService.list(berthQueryWrapper); |
| | | dmHarbor.setDmBerthList(dmBerths); |
| | | reslist.add(dmHarbor); |
| | | } |
| | | return AjaxResult.success(reslist); |
| | | }else { |
| | | if(deptId.equals(4001L)){ |
| | | deptId = 101L; |
| | | } |
| | | QueryWrapper<DmHarbor> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("DEPT_ID",deptId); |
| | | List<DmHarbor> list = dmHarborService.list(queryWrapper); |
| | | for (DmHarbor dmHarbor : list){ |
| | | LambdaQueryWrapper<DmBerth> QueryWrapper = new LambdaQueryWrapper<>(); |
| | | QueryWrapper.eq(DmBerth::getHarborId,dmHarbor.getPkId()).notIn(DmBerth::getName,"ååº").orderByAsc(DmBerth::getOrderNum); |
| | | List<DmBerth> dmBerths = dpBerthService.list(QueryWrapper); |
| | | dmHarbor.setDmBerthList(dmBerths); |
| | | reslist.add(dmHarbor); |
| | | } |
| | | return AjaxResult.success(reslist); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¸¯å£æ°´æ·±æ°æ®å表 |
| | | */ |
| | | @GetMapping("/getWaterDepthList") |
| | | @Operation(summary = "æ¥è¯¢æ¸¯å£æ°´æ·±æ°æ®å表") |
| | | public AjaxResult getWaterDepthList() { |
| | | //è·åç¨æ·ä¿¡æ¯æ ¹æ®é¨é¨IDæ¥è¯¢æ¸¯å£ä¿¡æ¯ |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | Long deptId = loginUser.getDeptId(); |
| | | List<DpEquipmentVO> resList = new ArrayList<>(); |
| | | if(deptId.equals(100L)){ |
| | | List<DmHarbor> list = dmHarborService.list(); |
| | | return AjaxResult.success(getWaterDepth(list)); |
| | | }else { |
| | | if(deptId.equals(4001L)){ |
| | | deptId = 101L; |
| | | } |
| | | QueryWrapper<DmHarbor> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("DEPT_ID",deptId); |
| | | List<DmHarbor> list = dmHarborService.list(queryWrapper); |
| | | return AjaxResult.success(getWaterDepth(list)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¸¯å£æ°´æ·±æ°æ®å表 |
| | | */ |
| | | @GetMapping("/getWaterListByIds") |
| | | @Operation(summary = "éè¿è®¾å¤idæ¥è¯¢æ°´æ·±æ°æ®å表") |
| | | public AjaxResult getWaterListByIds(String ids) { |
| | | |
| | | LocalDate today=LocalDate.now(); |
| | | LocalDateTime startOfDay=today.atStartOfDay(); |
| | | LocalDateTime endOfDay=today.plusDays(1).atStartOfDay().minusSeconds(1); |
| | | |
| | | |
| | | List<ReceiveWaterValue> result=receiveWaterValueService.list(new LambdaQueryWrapper<ReceiveWaterValue>() {{ |
| | | in(ReceiveWaterValue::getDeviceName,ids.split(",")) |
| | | .ge(ReceiveWaterValue::getCreateTime,startOfDay) |
| | | .le(ReceiveWaterValue::getCreateTime,endOfDay); |
| | | }}); |
| | | |
| | | List<Map<String,Object>>res=new ArrayList<>(); |
| | | String[] idArray=ids.split(","); |
| | | for (int i = 0; i < idArray.length; i++){ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("id",idArray[i]); |
| | | List<ReceiveWaterValue> ds=new ArrayList<>(); |
| | | for (int k = 0; k < result.size(); k++) { |
| | | ReceiveWaterValue data=result.get(k); |
| | | if(data.getDeviceName().equals(idArray[i])){ |
| | | ds.add(data); |
| | | } |
| | | } |
| | | map.put("data",ds); |
| | | res.add(map); |
| | | } |
| | | |
| | | return AjaxResult.success(res); |
| | | } |
| | | |
| | | private JSONArray getWaterDepth(List<DmHarbor> list){ |
| | | List<DpEquipmentVO> resList = new ArrayList<>(); |
| | | for (DmHarbor dmHarbor : list){ |
| | | List<DpEquipmentVO> dpEquipmentVOS = dpEquipmentService.getListByWhId(dmHarbor.getPkId().intValue()); |
| | | for (DpEquipmentVO dpEquipmentVO : dpEquipmentVOS){ |
| | | if(dpEquipmentVO.getEquipmentTypeId()==7){ |
| | | ReceiveWaterValue waterValue = receiveWaterValueService.getOne(new LambdaQueryWrapper<ReceiveWaterValue>() {{ |
| | | eq(ReceiveWaterValue::getDeviceName, String.valueOf(dpEquipmentVO.getId())) |
| | | .orderByDesc(ReceiveWaterValue::getCreateTime).last("LIMIT 1"); |
| | | }}); |
| | | if(waterValue!=null){ |
| | | dpEquipmentVO.setFieldName(waterValue.getWaterDeep()); |
| | | resList.add(dpEquipmentVO); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | JSONArray jsonArray = new JSONArray(); |
| | | for (DpEquipmentVO dpEquipmentVO : resList){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("equName",dpEquipmentVO.getEquName()); |
| | | jsonObject.put("waterDeep",dpEquipmentVO.getFieldName()); |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | return jsonArray; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å¯¼åºæ¸¯å£ä¿¡æ¯å表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:harbor:export')") |
| | | // @Log(title = "港å£ä¿¡æ¯", businessType = BusinessType.EXPORT) |
| | | // @PostMapping("/export") |
| | | // public void export(HttpServletResponse response, DmHarbor2 dmHarbor) |
| | | // { |
| | | // List<DmHarbor2> list = dmHarborService.selectDmHarborList(dmHarbor); |
| | | // ExcelUtil<DmHarbor2> util = new ExcelUtil<DmHarbor2>(DmHarbor2.class); |
| | | // util.exportExcel(response, list, "港å£ä¿¡æ¯æ°æ®"); |
| | | // } |
| | | |
| | | /** |
| | | * è·å港å£ä¿¡æ¯è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("/{pkId}") |
| | | @Operation(summary = "è·å港å£ä¿¡æ¯è¯¦ç»ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("pkId") Long pkId) |
| | | { |
| | | return success(dmHarborService.getById(pkId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ¸¯å£ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢æ¸¯å£ä¿¡æ¯") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DmHarbor dmHarbor) |
| | | { |
| | | return toAjax(dmHarborService.save(dmHarbor)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¸¯å£ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹æ¸¯å£ä¿¡æ¯") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DmHarbor dmHarbor) |
| | | { |
| | | return toAjax(dmHarborService.updateById(dmHarbor)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿¸¯å£ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "å 餿¸¯å£ä¿¡æ¯") |
| | | @DeleteMapping("/{pkId}") |
| | | public AjaxResult remove(@PathVariable Long pkId) |
| | | { |
| | | return toAjax(dmHarborService.removeById(pkId)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.manage.domain.DmBerth; |
| | | import com.ruoyi.manage.domain.DpShips; |
| | | import com.ruoyi.manage.domain.DmHarbor; |
| | | import com.ruoyi.manage.service.DpBerthService; |
| | | import com.ruoyi.manage.service.DpShipParkingService; |
| | | import com.ruoyi.manage.service.DpShipsService; |
| | | import com.ruoyi.manage.service.IDmHarborService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ³ä½ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author zhangyy |
| | | * @since 2025-03-11 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/dpBerth") |
| | | @Tag(name = "大å±--æ³ä½ç®¡ç") |
| | | public class DpBerthController extends BaseController { |
| | | @Autowired |
| | | private DpBerthService dpBerthService; |
| | | @Autowired |
| | | private DpShipParkingService dpShipParkingService; |
| | | @Autowired |
| | | private DpShipsService dpShipsService; |
| | | @Autowired |
| | | private IDmHarborService dmHarborService; |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "è·åæ³ä½å表") |
| | | public AjaxResult getList(Integer whId){ |
| | | LambdaQueryWrapper<DmBerth> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(DmBerth::getHarborId,whId); |
| | | return AjaxResult.success(dpBerthService.list(queryWrapper)); |
| | | } |
| | | |
| | | @GetMapping("/getBerthList") |
| | | @Operation(summary = "è·åæ³ä½è¯¦æ
å表") |
| | | public AjaxResult getBerthList(Integer whId){ |
| | | LambdaQueryWrapper<DmBerth> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(DmBerth::getHarborId,whId); |
| | | List<DmBerth> dpBerthList = dpBerthService.list(queryWrapper); |
| | | List<DmBerth> berthList = new ArrayList<>(); |
| | | for (DmBerth dmBerth : dpBerthList){ |
| | | // List<DpShipParking> parkingList = dpShipParkingService.getByWhBeId(whId,dmBerth.getPkid().intValue(),dmBerth.getShipsNum()); |
| | | List<DpShips> shipsList = dpShipsService.getByWhIdBeId(whId,dmBerth.getPkid().intValue()); |
| | | DmHarbor dmHarbor = dmHarborService.selectDmHarborByPkId(whId.longValue()); |
| | | dmBerth.setHarborName(dmHarbor.getHarborName()); |
| | | dmBerth.setShipsParking(shipsList); |
| | | berthList.add(dmBerth); |
| | | } |
| | | return AjaxResult.success(berthList); |
| | | } |
| | | |
| | | @GetMapping("/pageList") |
| | | @Operation(summary = "æ³ä½å页å表") |
| | | public TableDataInfo getPageList(DmBerth dpBerth) { |
| | | return dpBerthService.getPageList(dpBerth); |
| | | } |
| | | |
| | | @GetMapping("/exitName") |
| | | @Operation(summary = "éªè¯æ³ä½åç§°æ¯å¦åå¨") |
| | | public Boolean exitName(@RequestParam Integer whId,@RequestParam String name) { |
| | | QueryWrapper<DmBerth> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("HARBOR_ID",whId) |
| | | .eq("NAME",name); |
| | | return dpBerthService.exists(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * è·åç 头-æ³ä½è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/{beId}") |
| | | @Operation(summary = "è·åæ³ä½è¯¦ç»ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("beId") Long beId) |
| | | { |
| | | return success(dpBerthService.getById(beId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç 头-æ³ä½ |
| | | */ |
| | | @Operation(summary = "æ°å¢") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DmBerth dpBerth) |
| | | { |
| | | QueryWrapper<DmBerth> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("HARBOR_ID",dpBerth.getHarborId()) |
| | | .eq("NAME",dpBerth.getName()); |
| | | if(!dpBerthService.exists(queryWrapper)){ |
| | | return toAjax(dpBerthService.save(dpBerth)); |
| | | }else { |
| | | return AjaxResult.error("æ³ä½åç§°å·²åå¨"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç 头-æ³ä½ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DmBerth dpBerth) |
| | | { |
| | | return toAjax(dpBerthService.updateById(dpBerth)); |
| | | // QueryWrapper<DmBerth> queryWrapper = new QueryWrapper<>(); |
| | | // queryWrapper.eq("HARBOR_ID",dpBerth.getHarborId()) |
| | | // .eq("NAME",dpBerth.getName()); |
| | | // if(!dpBerthService.exists(queryWrapper)){ |
| | | // return toAjax(dpBerthService.updateById(dpBerth)); |
| | | // }else { |
| | | // return AjaxResult.error("æ³ä½åç§°å·²åå¨"); |
| | | // } |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç 头-æ³ä½ |
| | | */ |
| | | @Operation(summary = "å é¤") |
| | | @DeleteMapping("/{beId}") |
| | | public AjaxResult remove(@PathVariable Integer beId) |
| | | { |
| | | return toAjax(dpBerthService.removeById(beId)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.manage.domain.DpEffectAssessList; |
| | | import com.ruoyi.manage.service.DpEffectAssessListService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-05-23 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/dpEffectAssessList") |
| | | @Tag(name = "大å±--æè½è¯ä¼°ææ 管ç") |
| | | public class DpEffectAssessListController extends BaseController { |
| | | @Autowired |
| | | private DpEffectAssessListService dpEffectAssessListService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¸¯å£ä¿¡æ¯å表 |
| | | */ |
| | | @PostMapping("/list") |
| | | @Operation(summary = "æ¥è¯¢æè½è¯ä¼°ææ ä¿¡æ¯å表ï¼å页ï¼") |
| | | public TableDataInfo list(@RequestBody DpEffectAssessList dpEffectAssessList) |
| | | { |
| | | |
| | | return dpEffectAssessListService.getList(dpEffectAssessList); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æææ¸¯å£ä¿¡æ¯å表 |
| | | */ |
| | | @GetMapping("/listAll") |
| | | @Operation(summary = "æ¥è¯¢æææè½è¯ä¼°ææ å表") |
| | | public AjaxResult listAll() |
| | | { |
| | | return AjaxResult.success(dpEffectAssessListService.list()); |
| | | } |
| | | |
| | | /** |
| | | * è·å港å£ä¿¡æ¯è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("/{pkId}") |
| | | @Operation(summary = "è·åæè½è¯ä¼°ææ ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("pkId") Long pkId) |
| | | { |
| | | return success(dpEffectAssessListService.getById(pkId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢æ¸¯å£ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢æè½è¯ä¼°ææ ") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DpEffectAssessList dpEffectAssessList) |
| | | { |
| | | return toAjax(dpEffectAssessListService.save(dpEffectAssessList)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¸¯å£ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹æè½è¯ä¼°ææ ") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DpEffectAssessList dpEffectAssessList) |
| | | { |
| | | return toAjax(dpEffectAssessListService.updateById(dpEffectAssessList)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿¸¯å£ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "å 餿è½è¯ä¼°ææ ") |
| | | @DeleteMapping("/{pkId}") |
| | | public AjaxResult remove(@PathVariable Long pkId) |
| | | { |
| | | return toAjax(dpEffectAssessListService.removeById(pkId)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.fuzhou.domain.DpEquipment; |
| | | import com.ruoyi.fuzhou.domain.ReceiveElectricityValue; |
| | | import com.ruoyi.fuzhou.domain.ReceiveOilValue; |
| | | import com.ruoyi.fuzhou.domain.ReceiveWaterValue; |
| | | import com.ruoyi.fuzhou.domain.vo.DpEquipmentVO; |
| | | import com.ruoyi.fuzhou.domain.vo.QueryAnalysisVO; |
| | | import com.ruoyi.fuzhou.domain.vo.ReceiveValueListVo; |
| | | import com.ruoyi.fuzhou.enums.DataTypeEnum; |
| | | import com.ruoyi.fuzhou.service.*; |
| | | import com.ruoyi.manage.domain.DpEquipmentType; |
| | | import com.ruoyi.manage.domain.DsTaskList; |
| | | import com.ruoyi.manage.domain.SysFileManage; |
| | | import com.ruoyi.manage.domain.vo.Tree; |
| | | import com.ruoyi.manage.service.DpEquipmentTypeService; |
| | | import com.ruoyi.manage.service.SysFileService; |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import com.ruoyi.web.controller.fuzhou.ReceiveInfoController; |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.OutputStreamWriter; |
| | | import java.io.Writer; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author zhangyy |
| | | * @since 2025-03-11 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/dpEquipment") |
| | | @Tag(name = "大å±--设å¤ç®¡ç") |
| | | public class DpEquipmentController extends BaseController { |
| | | @Resource |
| | | private EquipmentService dpEquipmentService; |
| | | |
| | | @Resource |
| | | private ReceiveInfoController receiveInfoController; |
| | | |
| | | @Resource |
| | | private ISysDictDataService iSysDictDataService; |
| | | |
| | | @Resource |
| | | ReceiveModuleInfoService receiveModuleInfoService; |
| | | |
| | | @Resource |
| | | DsTaskListController dsTaskListController; |
| | | |
| | | @Resource |
| | | private ReceiveOilValueService receiveOilValueService; |
| | | |
| | | @Resource |
| | | private ReceiveWaterValueService receiveWaterValueService; |
| | | |
| | | @Resource |
| | | private ReceiveElectricityValueService receiveElectricityValueService; |
| | | |
| | | @Resource |
| | | private HikService hikService; |
| | | |
| | | @Resource |
| | | private DpEquipmentTypeService dpEquipmentTypeService; |
| | | |
| | | @Autowired |
| | | SysFileService sysFileService; |
| | | @Autowired |
| | | RuoYiConfig ruoYiConfig; |
| | | |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "设å¤å表") |
| | | public AjaxResult getList(Integer beId) { |
| | | List<Tree> treeList = new ArrayList<>(); |
| | | if (null != beId) { |
| | | List<DpEquipmentVO> list = dpEquipmentService.getListByBeId(beId); |
| | | if (null != list) { |
| | | Map<String, List<DpEquipmentVO>> result = list.stream().collect(Collectors.groupingBy(DpEquipmentVO::getEqutype)); |
| | | treeList = buildTree(result); |
| | | } |
| | | } |
| | | return AjaxResult.success(treeList); |
| | | } |
| | | |
| | | private List<Tree> buildTree(Map<String, List<DpEquipmentVO>> result) { |
| | | // æå»ºæ èç¹ |
| | | List<Tree> tree = new ArrayList<>(); |
| | | for (Map.Entry<String, List<DpEquipmentVO>> entry : result.entrySet()) { |
| | | Tree typeNode = new Tree(); |
| | | typeNode.setId(generateId()); |
| | | typeNode.setLabel(entry.getKey()); |
| | | typeNode.setChildren(entry.getValue().stream() |
| | | .map(equipment -> { |
| | | Tree equipmentNode = new Tree(); |
| | | equipmentNode.setLabel(equipment.getEquName()); |
| | | equipmentNode.setId(equipment.getId()); |
| | | equipmentNode.setIntervalTime(equipment.getIntervalTime()); |
| | | equipmentNode.setPeriodTime(equipment.getPeriodTime()); |
| | | equipmentNode.setIcon(equipment.getIcon()); |
| | | return equipmentNode; |
| | | }) |
| | | .collect(Collectors.toList())); |
| | | typeNode.setDisabled(true); |
| | | tree.add(typeNode); |
| | | } |
| | | |
| | | return tree; |
| | | |
| | | } |
| | | |
| | | //çæä¸éå¤ID |
| | | private int generateId() { |
| | | UUID uuid = UUID.randomUUID(); |
| | | long hash = uuid.hashCode(); |
| | | return (int) (hash & Integer.MAX_VALUE); |
| | | } |
| | | |
| | | @GetMapping("/pageList") |
| | | @Operation(summary = "æ³ä½è®¾å¤å页å表") |
| | | public TableDataInfo getPageList(DpEquipment dpEquipmentVO) { |
| | | return dpEquipmentService.getPageList(dpEquipmentVO); |
| | | } |
| | | |
| | | @Operation(summary = "设å¤è¯¦æ
") |
| | | @GetMapping("/{id}") |
| | | public AjaxResult getById(@PathVariable Integer id) { |
| | | DpEquipmentVO dpEquipmentVO = dpEquipmentService.selectById(id); |
| | | DpEquipment dpEquipment1 = receiveModuleInfoService.getIp(String.valueOf(dpEquipmentVO.getId()), dpEquipmentVO.getEquipmentTypeId()); |
| | | dpEquipmentVO.setIp(dpEquipment1.getIp()); |
| | | dpEquipmentVO.setPort(dpEquipment1.getPort()); |
| | | dpEquipmentVO.setDeviceAddress(dpEquipment1.getDeviceAddress()); |
| | | return AjaxResult.success(dpEquipmentVO); |
| | | } |
| | | |
| | | @GetMapping("/getListByWhId") |
| | | @Operation(summary = "æ ¹æ®ç 头IDè·åè®¾å¤æ ") |
| | | public AjaxResult getListByWhId(Integer whId) { |
| | | List<Tree> treeList = new ArrayList<>(); |
| | | List<DpEquipmentVO> list = dpEquipmentService.getListByWhId(whId); |
| | | if (null != list) { |
| | | Map<String, List<DpEquipmentVO>> result = list.stream().collect(Collectors.groupingBy(DpEquipmentVO::getEqutype)); |
| | | treeList = buildTree(result); |
| | | } |
| | | //æ ¹æ®ç³»ç»åå
¸æåº |
| | | SysDictData sysDictData = new SysDictData(); |
| | | sysDictData.setDictType("dp_equipment_type"); |
| | | List<SysDictData> dictDataList = iSysDictDataService.selectDictDataList(sysDictData); |
| | | Map<String, Integer> dictSortMap = new HashMap<>(); |
| | | for (SysDictData dictData : dictDataList) { |
| | | dictSortMap.put(dictData.getDictLabel(), dictData.getDictSort().intValue()); |
| | | } |
| | | treeList.sort(Comparator.comparingInt(tree -> dictSortMap.getOrDefault(tree.getLabel(), Integer.MAX_VALUE))); |
| | | |
| | | return AjaxResult.success(treeList); |
| | | } |
| | | |
| | | @GetMapping("/getEquipmentsByWhId") |
| | | @Operation(summary = "æ ¹æ®ç 头IDè·å设å¤è¯¦æ
å表") |
| | | public AjaxResult getEquipmentsByWhId(Integer whId) { |
| | | List<DpEquipmentVO> list = dpEquipmentService.getListByWhId(whId); |
| | | List<DpEquipmentVO> resList = new ArrayList<>(); |
| | | resList = equipmentStatusHandling(list); |
| | | |
| | | return AjaxResult.success(resList); |
| | | } |
| | | |
| | | @GetMapping("/getEquipmentsCount") |
| | | @Operation(summary = "设å¤ç¶ææ°éç»è®¡") |
| | | public AjaxResult getEquipmentsCount(Integer whId) { |
| | | List<DpEquipmentVO> list = dpEquipmentService.getListByWhId(whId); |
| | | List<DpEquipmentVO> resList = new ArrayList<>(); |
| | | resList = equipmentStatusHandling(list); |
| | | |
| | | LambdaQueryWrapper<DpEquipmentType> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.orderByAsc(DpEquipmentType::getId); |
| | | List<DpEquipmentType> typeList = dpEquipmentTypeService.list(lambdaQueryWrapper); |
| | | |
| | | Map<Integer, List<DpEquipmentVO>> groupMap = resList.stream().collect(Collectors.groupingBy(DpEquipmentVO::getEquipmentTypeId)); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | List<Integer> typeIds = Arrays.asList(1, 2, 3, 4); |
| | | |
| | | for (Map.Entry<Integer, List<DpEquipmentVO>> entry : groupMap.entrySet()) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("name", entry.getValue().get(0).getEqutype()); |
| | | Long online = (long) entry.getValue().size(); |
| | | if (typeIds.contains(entry.getKey())) { |
| | | online = entry.getValue().stream().filter(e -> e.getStatus() == 1).count(); |
| | | } |
| | | jsonObject.put("online", online); |
| | | jsonObject.put("total", entry.getValue().size()); |
| | | jsonObject.put("typeId", entry.getKey()); |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | |
| | | Set<Integer> typeIDs = groupMap.keySet(); |
| | | for (DpEquipmentType dpEquipmentType : typeList) { |
| | | if (!typeIDs.contains(dpEquipmentType.getId())) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("name", dpEquipmentType.getTypeName()); |
| | | jsonObject.put("online", 0); |
| | | jsonObject.put("total", 0); |
| | | jsonObject.put("typeId", dpEquipmentType.getId()); |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | } |
| | | |
| | | List<JSONObject> objects = jsonArray.toList(JSONObject.class); |
| | | objects.sort(Comparator.comparingInt(o -> o.getIntValue("typeId"))); |
| | | |
| | | jsonArray.clear(); |
| | | jsonArray.addAll(objects); |
| | | |
| | | return AjaxResult.success(jsonArray); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getEquipmentsByBeId") |
| | | @Operation(summary = "æ ¹æ®æ³ä½IDè·å设å¤å·¥åµä¿¡æ¯") |
| | | @Hidden |
| | | public AjaxResult getEquipmentsByBeId(@RequestParam Integer beId, @RequestParam String startTime) { |
| | | List<DpEquipmentVO> list = dpEquipmentService.getListByBeId(beId); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @GetMapping("/getListByBeIdTypeId") |
| | | @Operation(summary = "æ ¹æ®æ³ä½IDå设å¤ç±»åIDè·å设å¤ä¿¡æ¯å表") |
| | | public AjaxResult getListByBeIdTypeId(@RequestParam Integer beId, @RequestParam Integer typeId) { |
| | | R<DsTaskList> res = dsTaskListController.getByBeId(beId); |
| | | DsTaskList dsTaskList = res.getData(); |
| | | Date psTime = dsTaskList.getPsTime(); |
| | | List<Integer> typeIds = new ArrayList<>(); |
| | | if (typeId == 1) { |
| | | typeIds.add(1); |
| | | typeIds.add(12); |
| | | typeIds.add(13); |
| | | typeIds.add(14); |
| | | } else { |
| | | typeIds.add(typeId); |
| | | } |
| | | List<DpEquipmentVO> equList = dpEquipmentService.getListByBeIdTypeId(beId, typeIds); |
| | | List<DpEquipmentVO> voList = new ArrayList<>(); |
| | | for (DpEquipmentVO dpEquipmentVO : equList) { |
| | | ReceiveValueListVo voEL = new ReceiveValueListVo(); |
| | | voEL.setId(dpEquipmentVO.getId().longValue()); |
| | | voEL.setEndTime(psTime); |
| | | List dataList = receiveInfoController.dataList(voEL).getData(); |
| | | if (!dataList.isEmpty()) { |
| | | dpEquipmentVO.setDataHis(dataList.get(0)); |
| | | } |
| | | voList.add(dpEquipmentVO); |
| | | } |
| | | List<DpEquipmentVO> resList = equipmentStatusHandling(voList); |
| | | |
| | | JSONObject object = new JSONObject(); |
| | | if (!equList.isEmpty()) { |
| | | ReceiveValueListVo vo = new ReceiveValueListVo(); |
| | | ReceiveValueListVo voNew = new ReceiveValueListVo(); |
| | | vo.setId(equList.get(0).getId().longValue()); |
| | | vo.setEndTime(psTime); |
| | | voNew.setId(equList.get(0).getId().longValue()); |
| | | List dataList = receiveInfoController.dataList(vo).getData(); |
| | | List dataListNew = receiveInfoController.dataList(voNew).getData(); |
| | | List tableList = receiveInfoController.tableList(vo.getId()).getData(); |
| | | object.put("equList", resList); |
| | | if (!dataListNew.isEmpty()) { |
| | | object.put("dataOne", dataListNew.get(0)); |
| | | } else { |
| | | object.put("dataOne", ""); |
| | | } |
| | | if (!dataList.isEmpty()) { |
| | | object.put("dataHis", dataList.get(0)); |
| | | } else { |
| | | object.put("dataHis", ""); |
| | | } |
| | | object.put("tableList", tableList); |
| | | } |
| | | return AjaxResult.success(object); |
| | | } |
| | | |
| | | @GetMapping("/getDataOneById") |
| | | @Operation(summary = "æ ¹æ®IDè·åææ°ä¸æ¡æ°æ®") |
| | | public AjaxResult getDataOneById(Integer id) { |
| | | DpEquipmentVO dpEquipmentVO = dpEquipmentService.selectById(id); |
| | | R<DsTaskList> res = dsTaskListController.getByBeId(dpEquipmentVO.getBeId()); |
| | | DsTaskList dsTaskList = res.getData(); |
| | | Date psTime = dsTaskList.getPsTime(); |
| | | Date peTime = dsTaskList.getPeTime(); |
| | | Integer equTypeId = dpEquipmentVO.getEquipmentTypeId(); |
| | | |
| | | ReceiveValueListVo vo = new ReceiveValueListVo(); |
| | | vo.setId(id.longValue()); |
| | | vo.setStartTime(psTime); |
| | | vo.setEndTime(peTime); |
| | | JSONObject object = new JSONObject(); |
| | | List dataList = receiveInfoController.dataList(vo).getData(); |
| | | List tableList = receiveInfoController.tableList(vo.getId()).getData(); |
| | | if (dataList.size() > 0) { |
| | | object.put("dataOne", dataList.get(0)); |
| | | object.put("equUpTime", getEquUptime(dataList, equTypeId)); |
| | | } else { |
| | | object.put("dataOne", new JSONObject()); |
| | | object.put("equUpTime", null); |
| | | } |
| | | object.put("tableList", tableList); |
| | | return AjaxResult.success(object); |
| | | } |
| | | |
| | | private List<DpEquipmentVO> equipmentStatusHandling(List<DpEquipmentVO> list) { |
| | | |
| | | List<DpEquipmentVO> resList = new ArrayList<>(); |
| | | Map<String, Integer> onlineMap = new LinkedHashMap<>(); |
| | | ArrayList<String> arrayList = new ArrayList<>(); |
| | | |
| | | for (DpEquipmentVO equipmentVO : list) { |
| | | Integer typeId = equipmentVO.getEquipmentTypeId(); |
| | | if (typeId == 4 && equipmentVO.getFieldName() != null && !equipmentVO.getFieldName().isEmpty()) { |
| | | arrayList.add(equipmentVO.getFieldName()); |
| | | } |
| | | } |
| | | String[] indexCodes = arrayList.toArray(new String[arrayList.size()]); |
| | | onlineMap = hikService.getCameraOnline(indexCodes); |
| | | for (DpEquipmentVO dpEquipmentVO : list) { |
| | | Integer typeId = dpEquipmentVO.getEquipmentTypeId(); |
| | | Integer id = dpEquipmentVO.getId(); |
| | | if (DataTypeEnum.LIJIUOIL.getCode().equals(typeId) || DataTypeEnum.OIL.getCode().equals(typeId) || |
| | | DataTypeEnum.LIJIUJUN.getCode().equals(typeId)) { |
| | | ReceiveOilValue receiveOilValue = receiveOilValueService.getOne(new LambdaQueryWrapper<ReceiveOilValue>() {{ |
| | | or().eq(ReceiveOilValue::getDeviceName, String.valueOf(id)) |
| | | .orderByDesc(ReceiveOilValue::getCreateTime).last("LIMIT 1"); |
| | | }}); |
| | | if (receiveOilValue != null && receiveOilValue.getOilTimeFlow() != null) { |
| | | if (Double.parseDouble(receiveOilValue.getOilTimeFlow()) != 0.0) { |
| | | dpEquipmentVO.setStatus(1); |
| | | } |
| | | } |
| | | |
| | | } else if (DataTypeEnum.WATER_FLOW.getCode().equals(typeId) || DataTypeEnum.WATER_YA.getCode().equals(typeId) |
| | | || DataTypeEnum.WATER_DEPT.getCode().equals(typeId)) { |
| | | ReceiveWaterValue receiveWaterValue = receiveWaterValueService.getOne(new LambdaQueryWrapper<ReceiveWaterValue>() {{ |
| | | or().eq(ReceiveWaterValue::getDeviceName, String.valueOf(id)) |
| | | .orderByDesc(ReceiveWaterValue::getCreateTime).last("LIMIT 1"); |
| | | }}); |
| | | if (receiveWaterValue != null && receiveWaterValue.getTimeFlow() != null) { |
| | | if (Double.parseDouble(receiveWaterValue.getTimeFlow()) != 0.0) { |
| | | dpEquipmentVO.setStatus(1); |
| | | } |
| | | } |
| | | |
| | | } else if (DataTypeEnum.ELECTRICITY.getCode().equals(typeId)) { |
| | | ReceiveElectricityValue receiveElectricityValue = receiveElectricityValueService.getOne(new LambdaQueryWrapper<ReceiveElectricityValue>() {{ |
| | | or().eq(ReceiveElectricityValue::getDeviceName, String.valueOf(id)) |
| | | .orderByDesc(ReceiveElectricityValue::getCreateTime).last("LIMIT 1"); |
| | | }}); |
| | | if (receiveElectricityValue != null && receiveElectricityValue.getCurrentA() != null |
| | | && receiveElectricityValue.getCurrentB() != null && receiveElectricityValue.getCurrentC() != null) { |
| | | if (Double.parseDouble(receiveElectricityValue.getCurrentA()) != 0.0 || Double.parseDouble(receiveElectricityValue.getCurrentB()) != 0.0 |
| | | || Double.parseDouble(receiveElectricityValue.getCurrentC()) != 0.0) { |
| | | dpEquipmentVO.setStatus(1); |
| | | } |
| | | } |
| | | |
| | | } else if (typeId == 4) { |
| | | Integer status = onlineMap.getOrDefault(dpEquipmentVO.getFieldName(), 0); |
| | | dpEquipmentVO.setStatus(status); |
| | | } |
| | | resList.add(dpEquipmentVO); |
| | | } |
| | | return resList; |
| | | } |
| | | |
| | | private String getEquUptime(List dataList, Integer equTypeId) { |
| | | Integer size = dataList.size(); |
| | | if (equTypeId == 1 || equTypeId == 12 || equTypeId == 13 || equTypeId == 14) { |
| | | for (int i = size - 1; i >= 0; i--) { |
| | | ReceiveOilValue receiveOilValue = (ReceiveOilValue) dataList.get(i); |
| | | if (receiveOilValue.getOilTimeFlow() != null |
| | | && Double.parseDouble(receiveOilValue.getOilTimeFlow()) != 0.0) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String timeStr = sdf.format(receiveOilValue.getCreateTime()); |
| | | return timeCalculator(timeStr); |
| | | } |
| | | } |
| | | } else if (equTypeId == 2) { |
| | | for (int k = size - 1; k >= 0; k--) { |
| | | ReceiveWaterValue receiveWaterValue = (ReceiveWaterValue) dataList.get(k); |
| | | if (receiveWaterValue.getTimeFlow() != null |
| | | && Double.parseDouble(receiveWaterValue.getTimeFlow()) != 0.0) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String timeStr = sdf.format(receiveWaterValue.getCreateTime()); |
| | | return timeCalculator(timeStr); |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private String timeCalculator(String timeStr) { |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | LocalDateTime dateTime = LocalDateTime.parse(timeStr, formatter); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | Duration duration = Duration.between(dateTime, now); |
| | | long total = Math.abs(duration.toMinutes()); |
| | | long hour = total / 60; |
| | | long minutes = total % 60; |
| | | return hour + "å°æ¶" + minutes + "åé"; |
| | | } |
| | | |
| | | @GetMapping("/getXyzById") |
| | | @Operation(summary = "æ ¹æ®IDè·å设å¤è¯¦æ
") |
| | | public AjaxResult getXyzById(Integer id) { |
| | | DpEquipment dpEquipment = dpEquipmentService.getById(id); |
| | | DpEquipment dpEquipment1 = receiveModuleInfoService.getIp(String.valueOf(dpEquipment.getId()), dpEquipment.getEquipmentTypeId()); |
| | | dpEquipment.setIp(dpEquipment1.getIp()); |
| | | dpEquipment.setPort(dpEquipment1.getPort()); |
| | | dpEquipment.setDeviceAddress(dpEquipment1.getDeviceAddress()); |
| | | return AjaxResult.success(dpEquipment); |
| | | } |
| | | |
| | | //è·åè®¾å¤æ°æ®ä¸è¡¨å¤´ |
| | | @PostMapping("/getDataById") |
| | | @Operation(summary = "è·åè®¾å¤æ°æ®ä¸è¡¨å¤´") |
| | | public AjaxResult getDataById(@Validated @RequestBody ReceiveValueListVo vo) { |
| | | List dataList = receiveInfoController.dataList(vo).getData(); |
| | | List tableList = receiveInfoController.tableList(vo.getId()).getData(); |
| | | JSONObject object = new JSONObject(); |
| | | object.put("dataList", dataList); |
| | | object.put("tableList", tableList); |
| | | return AjaxResult.success(object); |
| | | } |
| | | |
| | | //è·åè®¾å¤æ°æ®ä¸è¡¨å¤´(å页) |
| | | @PostMapping("/getPageListById") |
| | | @Operation(summary = "è·åè®¾å¤æ°æ®ä¸è¡¨å¤´(å页)") |
| | | public AjaxResult getPageListById(@Validated @RequestBody ReceiveValueListVo vo) { |
| | | List dataList = receiveInfoController.dataList(vo).getData(); |
| | | List tableList = receiveInfoController.tableList(vo.getId()).getData(); |
| | | |
| | | List sampledList = new ArrayList(); |
| | | for (int i = 0; i < dataList.size(); i++) { |
| | | if (i % 5 == 0) { |
| | | sampledList.add(dataList.get(i)); |
| | | } |
| | | } |
| | | TableDataInfo dataInfo = paginate(sampledList, vo.getPageNum(), vo.getPageSize()); |
| | | |
| | | // TableDataInfo dataInfo = paginate(dataList, vo.getPageNum(), vo.getPageSize()); |
| | | JSONObject object = new JSONObject(); |
| | | object.put("dataList", dataInfo); |
| | | object.put("tableList", tableList); |
| | | return AjaxResult.success(object); |
| | | } |
| | | |
| | | //è·åè®¾å¤æ°æ®ä¸è¡¨å¤´(å页) |
| | | @PostMapping("/getPageListByIdRuoyi") |
| | | @Operation(summary = "è·åè®¾å¤æ°æ®ä¸è¡¨å¤´(å页)") |
| | | public AjaxResult getPageListByIdRuoyi(@Validated @RequestBody ReceiveValueListVo vo) { |
| | | List dataList = receiveInfoController.dataList(vo).getData(); |
| | | List tableList = receiveInfoController.tableList(vo.getId()).getData(); |
| | | |
| | | TableDataInfo dataInfo = paginate(dataList, vo.getPageNum(), vo.getPageSize()); |
| | | JSONObject object = new JSONObject(); |
| | | object.put("dataList", dataInfo); |
| | | object.put("tableList", tableList); |
| | | return AjaxResult.success(object); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢æ³ä½--è®¾å¤ |
| | | */ |
| | | @Operation(summary = "æ°å¢") |
| | | @PostMapping |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody DpEquipment dpEquipment) { |
| | | dpEquipment.setEquSeType(dpEquipment.getEquipmentTypeId()); |
| | | dpEquipmentService.save(dpEquipment); |
| | | receiveModuleInfoService.saveByModule(String.valueOf(dpEquipment.getId()), dpEquipment.getIp(), dpEquipment.getPort(), dpEquipment.getDeviceAddress(), dpEquipment.getEquipmentTypeId()); |
| | | return toAjax(true); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ³ä½--è®¾å¤ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹") |
| | | @PutMapping |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult edit(@RequestBody DpEquipment dpEquipment) { |
| | | DpEquipment equipment = dpEquipmentService.getById(dpEquipment.getId()); |
| | | if (equipment == null) { |
| | | throw new ServiceException("设å¤ä¸åå¨ï¼"); |
| | | } |
| | | receiveModuleInfoService.removeByModule(String.valueOf(equipment.getId()), equipment.getEquipmentTypeId()); |
| | | dpEquipment.setEquSeType(dpEquipment.getEquipmentTypeId()); |
| | | dpEquipmentService.updateById(dpEquipment); |
| | | receiveModuleInfoService.saveByModule(String.valueOf(dpEquipment.getId()), dpEquipment.getIp(), dpEquipment.getPort(), dpEquipment.getDeviceAddress(), dpEquipment.getEquipmentTypeId()); |
| | | return toAjax(true); |
| | | } |
| | | |
| | | /** |
| | | * å 餿³ä½--è®¾å¤ |
| | | */ |
| | | @Operation(summary = "å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Integer id) { |
| | | DpEquipment equipment = dpEquipmentService.getById(id); |
| | | if (equipment == null) { |
| | | throw new ServiceException("设å¤ä¸åå¨ï¼"); |
| | | } |
| | | receiveModuleInfoService.removeByModule(String.valueOf(equipment), equipment.getEquipmentTypeId()); |
| | | return toAjax(dpEquipmentService.removeById(id)); |
| | | } |
| | | |
| | | //夿¡ä»¶æ¥è¯¢è®¾å¤å表 |
| | | public List<DpEquipmentVO> queryDpEquipmentList(Integer beId, Integer typeId) { |
| | | List<Integer> typeIds = new ArrayList<>(); |
| | | if (typeId == 1) { |
| | | typeIds.add(1); |
| | | typeIds.add(12); |
| | | typeIds.add(13); |
| | | typeIds.add(14); |
| | | } else { |
| | | typeIds.add(typeId); |
| | | } |
| | | List<DpEquipmentVO> equList = dpEquipmentService.getListByBeIdTypeId(beId, typeIds); |
| | | return equList; |
| | | } |
| | | |
| | | //夿¡ä»¶æ¥è¯¢æ°´æ·±æå¿åææ°æ® |
| | | @PostMapping("/queryWaterDeepAnalysis") |
| | | @Operation(summary = "夿¡ä»¶æ¥è¯¢æ°´æ·±æå¿åææ°æ®") |
| | | public AjaxResult queryWaterDeepAnalysis(@Validated @RequestBody QueryAnalysisVO queryAnalysisVO) { |
| | | List<String> ids = new ArrayList<>(); |
| | | Integer beId = queryAnalysisVO.getBeId(); |
| | | List<DpEquipmentVO> equList = queryDpEquipmentList(beId, 7); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if (equList.size() > 0) { |
| | | for (DpEquipmentVO dpEquipmentVO : equList) { |
| | | ids.add(String.valueOf(dpEquipmentVO.getId())); |
| | | } |
| | | |
| | | LambdaQueryWrapper<ReceiveWaterValue> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | Date startTime = queryAnalysisVO.getStartTime(); |
| | | Date endTime = queryAnalysisVO.getEndTime(); |
| | | Integer interval = queryAnalysisVO.getInterval(); |
| | | |
| | | Map<String, Date> timeMap = new LinkedHashMap<>(); |
| | | LocalDate endDate = LocalDate.now(); |
| | | LocalDate startDate = LocalDate.now().minusDays(interval); |
| | | |
| | | if (startTime != null && endTime != null) { |
| | | timeMap = convertStartEndTime(startTime, endTime); |
| | | startDate = convertDate(timeMap.get("start")).toLocalDate(); |
| | | endDate = convertDate(timeMap.get("end")).toLocalDate(); |
| | | } else { |
| | | timeMap = getStartEndTime(interval); |
| | | } |
| | | |
| | | lambdaQueryWrapper.in(ReceiveWaterValue::getDeviceName, ids) |
| | | .ge(ReceiveWaterValue::getCreateTime, timeMap.get("start")) |
| | | .lt(ReceiveWaterValue::getCreateTime, timeMap.get("end")) |
| | | .orderByDesc(ReceiveWaterValue::getCreateTime); |
| | | List<ReceiveWaterValue> waterValues = receiveWaterValueService.list(lambdaQueryWrapper); |
| | | |
| | | List<LocalDate> dateRange = startDate.datesUntil(endDate.plusDays(1)).collect(Collectors.toList()); |
| | | |
| | | Map<LocalDate, List<ReceiveWaterValue>> groups = new LinkedHashMap<>(); |
| | | for (LocalDate localDate : dateRange) { |
| | | groups.put(localDate, new ArrayList<>()); |
| | | } |
| | | for (ReceiveWaterValue receiveWaterValue : waterValues) { |
| | | LocalDateTime localDateTime = convertDate(receiveWaterValue.getCreateTime()); |
| | | LocalDate localDate = localDateTime.toLocalDate(); |
| | | groups.computeIfPresent(localDate, (key, list) -> { |
| | | list.add(receiveWaterValue); |
| | | return list; |
| | | }); |
| | | } |
| | | |
| | | for (Map.Entry<LocalDate, List<ReceiveWaterValue>> entry : groups.entrySet()) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("date", entry.getKey()); |
| | | jsonObject.put("avg", "0.0"); |
| | | jsonObject.put("dif", "0.0"); |
| | | if (entry.getValue().size() > 0) { |
| | | Map<String, Double> map = waterDeepMaxMin(entry.getValue()); |
| | | Double max = map.get("max"); |
| | | Double min = map.get("min"); |
| | | jsonObject.put("avg", String.format("%.3f", (max + min) / 2)); |
| | | jsonObject.put("dif", String.format("%.3f", (max - min))); |
| | | } |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | } |
| | | return AjaxResult.success(jsonArray); |
| | | } |
| | | |
| | | private LocalDateTime convertDate(Date date) { |
| | | return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); |
| | | } |
| | | |
| | | private Map<String, Date> convertStartEndTime(Date startTime, Date endTime) { |
| | | SimpleDateFormat timeSDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | SimpleDateFormat dateSDF = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | String dateStartStr = dateSDF.format(startTime); |
| | | String dateEndStr = dateSDF.format(endTime); |
| | | |
| | | String startTimeStr = " 00:00:00"; |
| | | String endTimeStr = " 23:59:59"; |
| | | |
| | | String newStartStr = dateStartStr + startTimeStr; |
| | | String newEndStr = dateEndStr + endTimeStr; |
| | | |
| | | Map<String, Date> map = new LinkedHashMap<>(); |
| | | try { |
| | | Date start = timeSDF.parse(newStartStr); |
| | | Date end = timeSDF.parse(newEndStr); |
| | | map.put("start", start); |
| | | map.put("end", end); |
| | | } catch (Exception e) { |
| | | System.out.println(e.getMessage()); |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | private Map<String, Date> getStartEndTime(Integer interval) { |
| | | LocalDate endDate = LocalDate.now(); |
| | | LocalDate startDate = LocalDate.now().minusDays(interval); |
| | | String startTime = " 00:00:00"; |
| | | String endTime = " 23:59:59"; |
| | | DateTimeFormatter formatterDate = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | DateTimeFormatter formatterTime = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | String startStr = startDate.format(formatterDate) + startTime; |
| | | String endStr = endDate.format(formatterDate) + endTime; |
| | | LocalDateTime localDateTimeStart = LocalDateTime.parse(startStr, formatterTime); |
| | | LocalDateTime localDateTimeEnd = LocalDateTime.parse(endStr, formatterTime); |
| | | Instant instantStart = localDateTimeStart.atZone(ZoneId.systemDefault()).toInstant(); |
| | | Instant instantEnd = localDateTimeEnd.atZone(ZoneId.systemDefault()).toInstant(); |
| | | Date start = Date.from(instantStart); |
| | | Date end = Date.from(instantEnd); |
| | | |
| | | Map<String, Date> map = new HashMap<>(); |
| | | map.put("start", start); |
| | | map.put("end", end); |
| | | return map; |
| | | } |
| | | |
| | | private Map<String, Double> waterDeepMaxMin(List<ReceiveWaterValue> list) { |
| | | OptionalDouble max = list.stream() |
| | | .mapToDouble(e -> Double.parseDouble(e.getWaterDeep())) |
| | | .max(); |
| | | OptionalDouble min = list.stream() |
| | | .mapToDouble(e -> Double.parseDouble(e.getWaterDeep())) |
| | | .min(); |
| | | Map<String, Double> map = new HashMap<>(); |
| | | map.put("max", max.orElse(0.0)); |
| | | map.put("min", min.orElse(0.0)); |
| | | return map; |
| | | } |
| | | |
| | | private Double convertString(String str) { |
| | | if (str == null || str.trim().isEmpty()) { |
| | | return 0.0; |
| | | } |
| | | if (str.matches(".*[eE].*")) { |
| | | return 0.0; |
| | | } |
| | | try { |
| | | double value = Double.parseDouble(str); |
| | | return Math.abs(value); |
| | | } catch (Exception e) { |
| | | return 0.0; |
| | | } |
| | | } |
| | | |
| | | //夿¡ä»¶æ¥è¯¢çµè¡¨æå¿åææ°æ® |
| | | @PostMapping("/queryElectricityAnalysis") |
| | | @Operation(summary = "夿¡ä»¶æ¥è¯¢çµè¡¨æå¿åææ°æ®") |
| | | public AjaxResult queryElectricityAnalysis(@Validated @RequestBody QueryAnalysisVO queryAnalysisVO) { |
| | | List<String> ids = new ArrayList<>(); |
| | | Integer beId = queryAnalysisVO.getBeId(); |
| | | List<DpEquipmentVO> equList = queryDpEquipmentList(beId, 3); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if (equList.size() > 0) { |
| | | for (DpEquipmentVO dpEquipmentVO : equList) { |
| | | ids.add(String.valueOf(dpEquipmentVO.getId())); |
| | | } |
| | | |
| | | LambdaQueryWrapper<ReceiveElectricityValue> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | Date startTime = queryAnalysisVO.getStartTime(); |
| | | Date endTime = queryAnalysisVO.getEndTime(); |
| | | Integer interval = queryAnalysisVO.getInterval(); |
| | | |
| | | Map<String, Date> timeMap = new LinkedHashMap<>(); |
| | | LocalDate endDate = LocalDate.now(); |
| | | LocalDate startDate = LocalDate.now().minusDays(interval); |
| | | |
| | | if (startTime != null && endTime != null) { |
| | | timeMap = convertStartEndTime(startTime, endTime); |
| | | startDate = convertDate(timeMap.get("start")).toLocalDate(); |
| | | endDate = convertDate(timeMap.get("end")).toLocalDate(); |
| | | } else { |
| | | timeMap = getStartEndTime(interval); |
| | | } |
| | | |
| | | lambdaQueryWrapper.in(ReceiveElectricityValue::getDeviceName, ids) |
| | | .ge(ReceiveElectricityValue::getCreateTime, timeMap.get("start")) |
| | | .lt(ReceiveElectricityValue::getCreateTime, timeMap.get("end")) |
| | | .orderByDesc(ReceiveElectricityValue::getCreateTime); |
| | | List<ReceiveElectricityValue> electricityValues = receiveElectricityValueService.list(lambdaQueryWrapper); |
| | | |
| | | List<LocalDate> dateRange = startDate.datesUntil(endDate.plusDays(1)).collect(Collectors.toList()); |
| | | |
| | | Map<LocalDate, List<ReceiveElectricityValue>> groups = new LinkedHashMap<>(); |
| | | for (LocalDate localDate : dateRange) { |
| | | groups.put(localDate, new ArrayList<>()); |
| | | } |
| | | for (ReceiveElectricityValue receiveElectricityValue : electricityValues) { |
| | | LocalDateTime localDateTime = convertDate(receiveElectricityValue.getCreateTime()); |
| | | LocalDate localDate = localDateTime.toLocalDate(); |
| | | groups.computeIfPresent(localDate, (key, list) -> { |
| | | list.add(receiveElectricityValue); |
| | | return list; |
| | | }); |
| | | } |
| | | |
| | | for (Map.Entry<LocalDate, List<ReceiveElectricityValue>> entry : groups.entrySet()) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("date", entry.getKey()); |
| | | jsonObject.put("avg", "0.0"); |
| | | if (entry.getValue().size() > 0) { |
| | | List<ReceiveElectricityValue> valueList = entry.getValue(); |
| | | Integer size = valueList.size(); |
| | | Double total = 0.0; |
| | | for (ReceiveElectricityValue receiveElectricityValue : valueList) { |
| | | Double zhengValue = convertString(receiveElectricityValue.getZhengPower()); |
| | | total = total + zhengValue; |
| | | } |
| | | jsonObject.put("avg", String.format("%.3f", total / size)); |
| | | } |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | } |
| | | return AjaxResult.success(jsonArray); |
| | | } |
| | | |
| | | |
| | | //夿¡ä»¶æ¥è¯¢æ²¹è¡¨æå¿åææ°æ® |
| | | @PostMapping("/queryOilAnalysis") |
| | | @Operation(summary = "夿¡ä»¶æ¥è¯¢æ²¹è¡¨æå¿åææ°æ®") |
| | | public AjaxResult queryOilAnalysis(@Validated @RequestBody QueryAnalysisVO queryAnalysisVO) { |
| | | List<String> ids = new ArrayList<>(); |
| | | Integer beId = queryAnalysisVO.getBeId(); |
| | | List<DpEquipmentVO> equList = queryDpEquipmentList(beId, 1); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if (equList.size() > 0) { |
| | | for (DpEquipmentVO dpEquipmentVO : equList) { |
| | | ids.add(String.valueOf(dpEquipmentVO.getId())); |
| | | } |
| | | |
| | | LambdaQueryWrapper<ReceiveOilValue> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | Date startTime = queryAnalysisVO.getStartTime(); |
| | | Date endTime = queryAnalysisVO.getEndTime(); |
| | | Integer interval = queryAnalysisVO.getInterval(); |
| | | |
| | | Map<String, Date> timeMap = new LinkedHashMap<>(); |
| | | LocalDate endDate = LocalDate.now(); |
| | | LocalDate startDate = LocalDate.now().minusDays(interval); |
| | | |
| | | if (startTime != null && endTime != null) { |
| | | timeMap = convertStartEndTime(startTime, endTime); |
| | | startDate = convertDate(timeMap.get("start")).toLocalDate(); |
| | | endDate = convertDate(timeMap.get("end")).toLocalDate(); |
| | | } else { |
| | | timeMap = getStartEndTime(interval); |
| | | } |
| | | |
| | | lambdaQueryWrapper.in(ReceiveOilValue::getDeviceName, ids) |
| | | .ge(ReceiveOilValue::getCreateTime, timeMap.get("start")) |
| | | .lt(ReceiveOilValue::getCreateTime, timeMap.get("end")) |
| | | .orderByDesc(ReceiveOilValue::getCreateTime); |
| | | List<ReceiveOilValue> oilValues = receiveOilValueService.list(lambdaQueryWrapper); |
| | | |
| | | List<LocalDate> dateRange = startDate.datesUntil(endDate.plusDays(1)).collect(Collectors.toList()); |
| | | |
| | | Map<LocalDate, List<ReceiveOilValue>> groups = new LinkedHashMap<>(); |
| | | for (LocalDate localDate : dateRange) { |
| | | groups.put(localDate, new ArrayList<>()); |
| | | } |
| | | for (ReceiveOilValue receiveOilValue : oilValues) { |
| | | LocalDateTime localDateTime = convertDate(receiveOilValue.getCreateTime()); |
| | | LocalDate localDate = localDateTime.toLocalDate(); |
| | | groups.computeIfPresent(localDate, (key, list) -> { |
| | | list.add(receiveOilValue); |
| | | return list; |
| | | }); |
| | | } |
| | | |
| | | for (Map.Entry<LocalDate, List<ReceiveOilValue>> entry : groups.entrySet()) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("date", entry.getKey()); |
| | | jsonObject.put("avg", "0.0"); |
| | | if (entry.getValue().size() > 0) { |
| | | List<ReceiveOilValue> valueList = entry.getValue(); |
| | | Integer size = valueList.size(); |
| | | Double total = 0.0; |
| | | for (ReceiveOilValue receiveOilValue : valueList) { |
| | | Double flowTotalValue = convertString(receiveOilValue.getFlowTotal()); |
| | | total = total + flowTotalValue; |
| | | } |
| | | jsonObject.put("avg", String.format("%.3f", total / size)); |
| | | } |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.success(jsonArray); |
| | | } |
| | | |
| | | //夿¡ä»¶æ¥è¯¢æ°´è¡¨æå¿åææ°æ® |
| | | @PostMapping("/queryWaterAnalysis") |
| | | @Operation(summary = "夿¡ä»¶æ¥è¯¢æ°´è¡¨æå¿åææ°æ®") |
| | | public AjaxResult queryWaterAnalysis(@Validated @RequestBody QueryAnalysisVO queryAnalysisVO) { |
| | | List<String> ids = new ArrayList<>(); |
| | | Integer beId = queryAnalysisVO.getBeId(); |
| | | List<DpEquipmentVO> equList = queryDpEquipmentList(beId, 2); |
| | | |
| | | JSONArray jsonArray = new JSONArray(); |
| | | if (equList.size() > 0) { |
| | | for (DpEquipmentVO dpEquipmentVO : equList) { |
| | | ids.add(String.valueOf(dpEquipmentVO.getId())); |
| | | } |
| | | |
| | | LambdaQueryWrapper<ReceiveWaterValue> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | Date startTime = queryAnalysisVO.getStartTime(); |
| | | Date endTime = queryAnalysisVO.getEndTime(); |
| | | Integer interval = queryAnalysisVO.getInterval(); |
| | | |
| | | Map<String, Date> timeMap = new LinkedHashMap<>(); |
| | | LocalDate endDate = LocalDate.now(); |
| | | LocalDate startDate = LocalDate.now().minusDays(interval); |
| | | |
| | | if (startTime != null && endTime != null) { |
| | | timeMap = convertStartEndTime(startTime, endTime); |
| | | startDate = convertDate(timeMap.get("start")).toLocalDate(); |
| | | endDate = convertDate(timeMap.get("end")).toLocalDate(); |
| | | } else { |
| | | timeMap = getStartEndTime(interval); |
| | | } |
| | | |
| | | lambdaQueryWrapper.in(ReceiveWaterValue::getDeviceName, ids) |
| | | .ge(ReceiveWaterValue::getCreateTime, timeMap.get("start")) |
| | | .lt(ReceiveWaterValue::getCreateTime, timeMap.get("end")) |
| | | .orderByDesc(ReceiveWaterValue::getCreateTime); |
| | | List<ReceiveWaterValue> waterValues = receiveWaterValueService.list(lambdaQueryWrapper); |
| | | |
| | | List<LocalDate> dateRange = startDate.datesUntil(endDate.plusDays(1)).collect(Collectors.toList()); |
| | | |
| | | Map<LocalDate, List<ReceiveWaterValue>> groups = new LinkedHashMap<>(); |
| | | for (LocalDate localDate : dateRange) { |
| | | groups.put(localDate, new ArrayList<>()); |
| | | } |
| | | for (ReceiveWaterValue receiveWaterValue : waterValues) { |
| | | LocalDateTime localDateTime = convertDate(receiveWaterValue.getCreateTime()); |
| | | LocalDate localDate = localDateTime.toLocalDate(); |
| | | groups.computeIfPresent(localDate, (key, list) -> { |
| | | list.add(receiveWaterValue); |
| | | return list; |
| | | }); |
| | | } |
| | | |
| | | for (Map.Entry<LocalDate, List<ReceiveWaterValue>> entry : groups.entrySet()) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("date", entry.getKey()); |
| | | jsonObject.put("avg", "0.0"); |
| | | if (entry.getValue().size() > 0) { |
| | | List<ReceiveWaterValue> valueList = entry.getValue(); |
| | | Integer size = valueList.size(); |
| | | Double total = 0.0; |
| | | for (ReceiveWaterValue receiveWaterValue : valueList) { |
| | | Double zhengTotalValue = convertString(receiveWaterValue.getZhengTotal()); |
| | | total = total + zhengTotalValue; |
| | | } |
| | | jsonObject.put("avg", String.format("%.3f", total / size)); |
| | | } |
| | | jsonArray.add(jsonObject); |
| | | } |
| | | } |
| | | |
| | | return AjaxResult.success(jsonArray); |
| | | } |
| | | |
| | | /** |
| | | * ä¸åjsonæä»¶ |
| | | */ |
| | | @PostMapping("/uploadFile") |
| | | @Operation(summary = "ä¸åjsonæä»¶") |
| | | public AjaxResult uploadFile(@RequestBody JSONArray json, |
| | | @RequestParam(value = "name") String name) { |
| | | SysFileManage sysFileManage = new SysFileManage(); |
| | | sysFileManage.setName(name + "_" + System.currentTimeMillis()); |
| | | sysFileManage.setType("json"); |
| | | sysFileManage.setExt("json"); |
| | | String filePath = ruoYiConfig.getJson() + "/" + sysFileManage.getName() + ".json"; |
| | | String path = "/profile/" + sysFileManage.getName() + ".json"; |
| | | sysFileManage.setFilePath(path); |
| | | try { |
| | | File file = new File(filePath); |
| | | file.createNewFile(); |
| | | String jsonStr = JSON.toJSONString(json); |
| | | |
| | | Writer writer = new OutputStreamWriter(new FileOutputStream(file), "UTF-8"); |
| | | writer.write(jsonStr); |
| | | writer.flush(); |
| | | writer.close(); |
| | | |
| | | return AjaxResult.success(sysFileService.saveData(sysFileManage)); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //对å表è¿è¡å页 |
| | | private TableDataInfo paginate(List list, int pageNum, int pageSize) { |
| | | if (list == null || list.isEmpty()) { |
| | | return new TableDataInfo(new ArrayList<>(), 0); |
| | | } |
| | | int total = list.size(); |
| | | int formIndex = (pageNum - 1) * pageSize; |
| | | int toIndex = Math.min(formIndex + pageSize, total); |
| | | if (formIndex >= total) { |
| | | return new TableDataInfo(new ArrayList<>(), total); |
| | | } |
| | | List subList = list.subList(formIndex, toIndex); |
| | | return new TableDataInfo(subList, total); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getYdkfm") |
| | | @Operation(summary = "è·åæ²¹çµæ§éé¨") |
| | | public AjaxResult getYdkfm(Integer id) throws Exception { |
| | | if (null == id || id < 0L) return AjaxResult.error("id为空"); |
| | | DpEquipmentVO dpEquipmentVO = dpEquipmentService.selectById(id); |
| | | DpEquipment dp = receiveModuleInfoService.getIp(String.valueOf(dpEquipmentVO.getId()), dpEquipmentVO.getEquipmentTypeId()); |
| | | |
| | | DpEquipment eq = dpEquipmentService.getEpByField(String.valueOf(dp.getPort())); |
| | | if (null == eq || null == eq.getId()) return AjaxResult.error("æ¾ä¸å°æ²¹çµæ§éé¨"); |
| | | |
| | | Map<String, Object> map = receiveModuleInfoService.getYdkfmStatus(String.valueOf(eq.getId())); |
| | | return success(map); |
| | | } |
| | | |
| | | @GetMapping("/ctrlYdkfm") |
| | | @Operation(summary = "æ§å¶æ²¹çµæ§éé¨") |
| | | public AjaxResult ctrlYdkfm(Integer id, Boolean flag) throws Exception { |
| | | if (null == id || id < 0L) return AjaxResult.error("id为空"); |
| | | if (null == flag) return AjaxResult.error("flag为空"); |
| | | |
| | | DpEquipmentVO dpEquipmentVO = dpEquipmentService.selectById(id); |
| | | DpEquipment dp = receiveModuleInfoService.getIp(String.valueOf(dpEquipmentVO.getId()), dpEquipmentVO.getEquipmentTypeId()); |
| | | |
| | | DpEquipment eq = dpEquipmentService.getEpByField(String.valueOf(dp.getPort())); |
| | | if (null == eq || null == eq.getId()) return AjaxResult.error("æ¾ä¸å°æ²¹çµæ§éé¨"); |
| | | |
| | | Map<String, Object> map = receiveModuleInfoService.ctrlYdkfm(String.valueOf(eq.getId()), flag); |
| | | return success(map); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.manage.domain.DpEquipmentType; |
| | | import com.ruoyi.manage.service.DpEquipmentTypeService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * 设å¤ç±»å表 å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-03-18 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/dpEquipmentType") |
| | | @Tag(name = "大å±--设å¤ç±»å管ç") |
| | | public class DpEquipmentTypeController { |
| | | @Autowired |
| | | private DpEquipmentTypeService dpEquipmentTypeService; |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "è·å设å¤ç±»åå表") |
| | | public AjaxResult getList(){ |
| | | return AjaxResult.success(dpEquipmentTypeService.list()); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/pageList") |
| | | @Operation(summary = "设å¤ç±»åå页å表") |
| | | public TableDataInfo getPageList(DpEquipmentType dpEquipmentType) { |
| | | return dpEquipmentTypeService.getPageList(dpEquipmentType); |
| | | } |
| | | |
| | | |
| | | @GetMapping(value = "/{id}") |
| | | @Operation(summary = "è·å设å¤ç±»å详ç»ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("id") Integer id) |
| | | { |
| | | return AjaxResult.success(dpEquipmentTypeService.getById(id)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "æ°å¢") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DpEquipmentType dpEquipmentType) |
| | | { |
| | | return AjaxResult.success(dpEquipmentTypeService.save(dpEquipmentType)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "ä¿®æ¹") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DpEquipmentType dpEquipmentType) |
| | | { |
| | | return AjaxResult.success(dpEquipmentTypeService.updateById(dpEquipmentType)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "å é¤") |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Integer id) |
| | | { |
| | | return AjaxResult.success(dpEquipmentTypeService.removeById(id)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.fuzhou.domain.DpRfidTask; |
| | | import com.ruoyi.fuzhou.domain.OpenWZ; |
| | | import com.ruoyi.fuzhou.service.DpRfidTaskService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * RFIDä»»å¡è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-03-25 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/dpRfidTask") |
| | | @Tag(name = "大å±--RFID任塿°æ®") |
| | | public class DpRfidTaskController { |
| | | @Autowired |
| | | private DpRfidTaskService dpRfidTaskService; |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "è·åRFID任塿°æ®å表") |
| | | public AjaxResult getList(){ |
| | | return AjaxResult.success(dpRfidTaskService.list()); |
| | | } |
| | | |
| | | @Operation(summary = "RFID任塿°æ®å页å表") |
| | | public TableDataInfo getPageList(DpRfidTask dpRfidTask) { |
| | | return dpRfidTaskService.getPageList(dpRfidTask); |
| | | } |
| | | |
| | | |
| | | @GetMapping(value = "/{id}") |
| | | @Operation(summary = "è·åRFID任塿°æ®è¯¦ç»ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("id") Integer id) |
| | | { |
| | | return AjaxResult.success(dpRfidTaskService.getById(id)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "æ°å¢") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DpRfidTask dpRfidTask) |
| | | { |
| | | List<OpenWZ> openWZS = dpRfidTask.getWzData(); |
| | | dpRfidTask.setWzDataStr(JSON.toJSONString(openWZS)); |
| | | dpRfidTask.setWzData(null); |
| | | return AjaxResult.success(dpRfidTaskService.save(dpRfidTask)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "ä¿®æ¹") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DpRfidTask dpRfidTask) |
| | | { |
| | | return AjaxResult.success(dpRfidTaskService.updateById(dpRfidTask)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "å é¤") |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Integer id) |
| | | { |
| | | return AjaxResult.success(dpRfidTaskService.removeById(id)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.fuzhou.domain.DpRfidVehicle; |
| | | import com.ruoyi.fuzhou.domain.OpenWZ; |
| | | import com.ruoyi.fuzhou.domain.vo.RfidVehicleVO; |
| | | import com.ruoyi.fuzhou.service.DpRfidVehicleService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * RFID车è¾è®°å½è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-03-21 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/dpRfidVehicle") |
| | | @Tag(name = "大å±--车è¾RFIDæ°æ®") |
| | | public class DpRfidVehicleController { |
| | | @Autowired |
| | | private DpRfidVehicleService dpRfidVehicleService; |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "è·å车è¾RFIDæ°æ®å表") |
| | | public AjaxResult getList(){ |
| | | return AjaxResult.success(dpRfidVehicleService.list()); |
| | | } |
| | | |
| | | @GetMapping("/selectByTime") |
| | | @Operation(summary = "æ ¹æ®æ¶é´æ®µæ¥è¯¢æ°æ®") |
| | | public AjaxResult selectByTime(@RequestParam String startTime,@RequestParam String endTime){ |
| | | LambdaQueryWrapper<DpRfidVehicle> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.ge(DpRfidVehicle::getPassTime,startTime) |
| | | .le(DpRfidVehicle::getPassTime,endTime) |
| | | .orderByDesc(DpRfidVehicle::getPassTime); |
| | | return AjaxResult.success( |
| | | dpRfidVehicleService.list(lambdaQueryWrapper)); |
| | | } |
| | | |
| | | @GetMapping("/selectByNodeNum") |
| | | @Operation(summary = "æ ¹æ®ç»ç«¯IDæ¥è¯¢æ°æ®") |
| | | public AjaxResult selectByNodeNum(@RequestParam String nodeNum){ |
| | | LambdaQueryWrapper<DpRfidVehicle> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(DpRfidVehicle::getSn,nodeNum) |
| | | .orderByDesc(DpRfidVehicle::getPassTime); |
| | | return AjaxResult.success(dpRfidVehicleService.list(lambdaQueryWrapper)); |
| | | } |
| | | |
| | | @PostMapping("/selectRfidVehicle") |
| | | @Operation(summary = "æ¡ä»¶æ¥è¯¢RFIDè½¦è¾æ°æ®") |
| | | public AjaxResult selectRfidVehicle(@RequestBody RfidVehicleVO rfidVehicleVO){ |
| | | return AjaxResult.success(dpRfidVehicleService.selectRfidVehicle(rfidVehicleVO)); |
| | | } |
| | | |
| | | @GetMapping("/QueryVehicleByTask/{task}") |
| | | @Operation(summary = "æ ¹æ®rfid任塿¥è¯¢RFIDè½¦è¾æ°æ®") |
| | | public AjaxResult QueryVehicleByTask(@PathVariable("task") String task){ |
| | | return AjaxResult.success(dpRfidVehicleService.QueryVehicleByTask(task)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "车è¾RFIDæ°æ®å页å表") |
| | | public TableDataInfo getPageList(DpRfidVehicle dpRfidVehicle) { |
| | | return dpRfidVehicleService.getPageList(dpRfidVehicle); |
| | | } |
| | | |
| | | |
| | | @GetMapping(value = "/{id}") |
| | | @Operation(summary = "è·å车è¾RFIDæ°æ®è¯¦ç»ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("id") Integer id) |
| | | { |
| | | return AjaxResult.success(dpRfidVehicleService.getById(id)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "æ°å¢") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DpRfidVehicle dpRfidVehicle) |
| | | { |
| | | List<OpenWZ> openWZS = dpRfidVehicle.getWzData(); |
| | | dpRfidVehicle.setWzDataStr(JSON.toJSONString(openWZS)); |
| | | dpRfidVehicle.setWzData(null); |
| | | return AjaxResult.success(dpRfidVehicleService.save(dpRfidVehicle)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "ä¿®æ¹") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DpRfidVehicle dpRfidVehicle) |
| | | { |
| | | return AjaxResult.success(dpRfidVehicleService.updateById(dpRfidVehicle)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "å é¤") |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Integer id) |
| | | { |
| | | return AjaxResult.success(dpRfidVehicleService.removeById(id)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.manage.domain.DpShipDevice; |
| | | import com.ruoyi.manage.domain.DpShips; |
| | | import com.ruoyi.manage.service.DpShipDeviceService; |
| | | import com.ruoyi.manage.service.DpShipsService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * è°è设å¤è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-03-12 |
| | | */ |
| | | @Tag(name = "大å±--è°è¹è®¾å¤ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/dp/dpShipDevice") |
| | | public class DpShipDeviceController { |
| | | @Resource |
| | | private DpShipDeviceService dpShipDeviceService; |
| | | @Resource |
| | | private DpShipsService dpShipsService; |
| | | |
| | | @Operation(summary = "æ°å¢è°è¹è®¾å¤æ°æ®") |
| | | @PostMapping("/insertDpShipDevice") |
| | | public R<Boolean> insertDpShipDevice(@RequestBody DpShipDevice dpShipDevice) { |
| | | QueryWrapper<DpShipDevice> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("DEVICE_NAME",dpShipDevice.getDeviceName()); |
| | | if(!dpShipDeviceService.exists(queryWrapper)){ |
| | | return R.ok(dpShipDeviceService.save(dpShipDevice)); |
| | | }else { |
| | | return R.fail("åç§°å·²åå¨"); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Operation(summary = "æ´æ°è°è¹è®¾å¤æ°æ®") |
| | | @PostMapping("/updateDpShipDevice") |
| | | public R<Boolean> updateDpShipDevice(@RequestBody DpShipDevice dpShipDevice) { |
| | | return R.ok(dpShipDeviceService.updateById(dpShipDevice)); |
| | | } |
| | | |
| | | @Operation(summary = "å é¤è°è¹è®¾å¤æ°æ®") |
| | | @GetMapping("/deleteDpShipDevice") |
| | | public R<Boolean> deleteDpShipDevice( String id) { |
| | | return R.ok(dpShipDeviceService.removeById(id)); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®IDè·åè°è¹è®¾å¤æ°æ®") |
| | | @GetMapping ("/getDpShipDeviceByID") |
| | | public R<DpShipDevice> getDpShipDeviceByID( String id) { |
| | | DpShipDevice dpShipDevice = dpShipDeviceService.selectDpShipDevice(id); |
| | | return R.ok(dpShipDevice); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®åç§°è·åè°è¹è®¾å¤æ°æ®") |
| | | @GetMapping ("/getDpShipDeviceByName") |
| | | public R<DpShipDevice> getDpShipDeviceByName(String name) { |
| | | DpShipDevice dpShipDevice = dpShipDeviceService.selectDpShipDeviceByName(name); |
| | | return R.ok(dpShipDevice); |
| | | } |
| | | |
| | | @Operation(summary = "è·åè°è¹è®¾å¤æ°æ®å表") |
| | | @GetMapping ("/getDpShipDevices") |
| | | public R<List<DpShipDevice>> getDpShipDevices() { |
| | | return R.ok(dpShipDeviceService.getDpShipDevices()); |
| | | } |
| | | |
| | | @Operation(summary = "è·åè°è¹è®¾å¤å页å表") |
| | | @GetMapping ("/getDpShipDevicesPage") |
| | | public TableDataInfo getDpShipDevicesPage(DpShipDevice shipDevice) { |
| | | return dpShipDeviceService.getDpShipDevicesPage(shipDevice); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®è°è¹ç¼å·æ¥è¯¢è®¾å¤å表") |
| | | @GetMapping("/selectDpShipDeviceByShipId") |
| | | public R<List<DpShipDevice>> selectDpShipDeviceByShipId( String deviceShipId) { |
| | | return R.ok(dpShipDeviceService.selectDpShipDeviceByShipId(deviceShipId)); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.manage.domain.DpShipParking; |
| | | import com.ruoyi.manage.service.DpShipParkingService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ³ä½åè¹ä¿¡æ¯è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-03-22 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/dpShipParking") |
| | | @Tag(name = "大å±--æ³ä½åæ³è°è") |
| | | public class DpShipParkingController { |
| | | |
| | | @Autowired |
| | | private DpShipParkingService dpShipParkingService; |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "æ³ä½åæ³è°èå表") |
| | | public AjaxResult getList(){ |
| | | return AjaxResult.success(dpShipParkingService.list()); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/pageList") |
| | | @Operation(summary = "æ³ä½åæ³è°èå页å表") |
| | | public TableDataInfo getPageList(DpShipParking dpShipParking) { |
| | | return dpShipParkingService.getPageList(dpShipParking); |
| | | } |
| | | |
| | | |
| | | @GetMapping(value = "/{id}") |
| | | @Operation(summary = "è·åæ³ä½åæ³è°è详ç»ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("id") Integer id) |
| | | { |
| | | return AjaxResult.success(dpShipParkingService.getById(id)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "æ°å¢") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DpShipParking dpShipParking) |
| | | { |
| | | return AjaxResult.success(dpShipParkingService.save(dpShipParking)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "ä¿®æ¹") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DpShipParking dpShipParking) |
| | | { |
| | | return AjaxResult.success(dpShipParkingService.updateById(dpShipParking)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "å é¤") |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Integer id) |
| | | { |
| | | return AjaxResult.success(dpShipParkingService.removeById(id)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.manage.domain.DpShipType; |
| | | import com.ruoyi.manage.service.DpShipTypeService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * è°è¹ç±»å表 å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-03-18 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/dpShipType") |
| | | @Tag(name = "大å±--è°è¹ç±»å管ç") |
| | | public class DpShipTypeController { |
| | | @Autowired |
| | | private DpShipTypeService dpShipTypeService; |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "è·åè°è¹ç±»åå表") |
| | | public AjaxResult getList(){ |
| | | return AjaxResult.success(dpShipTypeService.list()); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/pageList") |
| | | @Operation(summary = "è°è¹ç±»åå页å表") |
| | | public TableDataInfo getPageList(DpShipType dpShipType) { |
| | | return dpShipTypeService.getPageList(dpShipType); |
| | | } |
| | | |
| | | |
| | | @GetMapping(value = "/{id}") |
| | | @Operation(summary = "è·åè°è¹ç±»å详ç»ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("id") Integer id) |
| | | { |
| | | return AjaxResult.success(dpShipTypeService.getById(id)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "æ°å¢") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DpShipType dpShipType) |
| | | { |
| | | return AjaxResult.success(dpShipTypeService.save(dpShipType)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "ä¿®æ¹") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DpShipType dpShipType) |
| | | { |
| | | return AjaxResult.success(dpShipTypeService.updateById(dpShipType)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "å é¤") |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Integer id) |
| | | { |
| | | return AjaxResult.success(dpShipTypeService.removeById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.manage.domain.DpShips; |
| | | import com.ruoyi.manage.domain.vo.ShipTypeVO; |
| | | import com.ruoyi.manage.domain.vo.Tree; |
| | | import com.ruoyi.manage.service.DpShipsService; |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * è°è¹è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author zhangyy |
| | | * @since 2025-03-11 |
| | | */ |
| | | @Tag(name = "大å±--è°è¹æ°æ®ç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/dp/dpShips") |
| | | public class DpShipsController { |
| | | |
| | | @Resource |
| | | private DpShipsService dpShipsService; |
| | | |
| | | @Operation(summary = "æ°å¢è°è¹æ°æ®") |
| | | @PostMapping("/insertDpShip") |
| | | public R<Boolean> insertDpShip(@RequestBody DpShips dpShips) { |
| | | return R.ok(dpShipsService.save(dpShips)); |
| | | } |
| | | |
| | | @Operation(summary = "æ´æ°è°è¹æ°æ®") |
| | | @PostMapping("/updateDpShip") |
| | | public R<Boolean> updateDpShip(@RequestBody DpShips dpShips) { |
| | | return R.ok(dpShipsService.updateById(dpShips)); |
| | | } |
| | | |
| | | @Operation(summary = "å é¤è°è¹æ°æ®") |
| | | @GetMapping("/deleteDpShip") |
| | | public R<Boolean> deleteDpShip( String id) { |
| | | return R.ok(dpShipsService.removeById(id)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "è·åè°è¹ById") |
| | | @GetMapping("/{id}") |
| | | public R<DpShips> getDpShipsById(@PathVariable String id) { |
| | | return R.ok(dpShipsService.getDpShipsById(id)); |
| | | } |
| | | |
| | | @Operation(summary = "è·åè°è¹æ°æ®å表") |
| | | @GetMapping("/getDpShips") |
| | | public R<List<DpShips>> getDpShips() { |
| | | return R.ok(dpShipsService.list()); |
| | | } |
| | | |
| | | @Operation(summary = "è·åè°è¹å页æ®å表") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(DpShips ships) { |
| | | return dpShipsService.getPageList(ships); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "æ ¹æ®ç 头IDæ¥è¯¢è¹è°ç±»å") |
| | | @PostMapping("/getDpShipTypeByWhId") |
| | | public R<List<ShipTypeVO>> getDpShipTypeByWhId(@Parameter(description = "ç 头ID", required = true) Integer whId) { |
| | | return R.ok(dpShipsService.getDpShipTypeByWhId(whId)); |
| | | } |
| | | |
| | | @Operation(summary = "(æ°)æ ¹æ®ç 头IDæ¥è¯¢è¹è°ç±»å") |
| | | @PostMapping("/getDpShipTypeByWhIdNEW") |
| | | public R<List<ShipTypeVO>> getDpShipTypeByWhIdNEW(@Parameter(description = "ç 头ID", required = true) Integer whId) { |
| | | return R.ok(dpShipsService.getDpShipTypeByWhIdNEW(whId)); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®ç 头IDåè°è¹ç±»åæ¥è¯¢è°è¹å表") |
| | | @PostMapping("/getDpShipsByWhIdType") |
| | | public AjaxResult getDpShipsByWhIdType(@Parameter(description = "ç 头ID", required = true) Integer whId, |
| | | @Parameter(description = "è¹è°ç±»åID", required = true) String shipType) { |
| | | return AjaxResult.success(dpShipsService.getDpShipsByWhIdType(whId,shipType)); |
| | | } |
| | | |
| | | @Operation(summary = "(æ°)æ ¹æ®ç 头IDåè°è¹ç±»åæ°ç»æ¥è¯¢å表") |
| | | @PostMapping("/getDpShipsByWhIdTypeNEW") |
| | | public AjaxResult getDpShipsByWhIdTypeNEW(@Parameter(description = "ç 头ID", required = true) Integer whId, |
| | | @RequestBody List<Integer> shipTypes) { |
| | | return AjaxResult.success(dpShipsService.getDpShipsByWhIdTypeNEW(whId,shipTypes)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.manage.domain.DpUnitSupplyTime; |
| | | import com.ruoyi.manage.service.DpUnitSupplyTimeService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * åä½è¡¥ç»æ¶é´è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-03-20 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/dpUnitSupplyTime") |
| | | @Tag(name = "大å±--åä½è¡¥ç»æ¶é´") |
| | | public class DpUnitSupplyTimeController { |
| | | @Autowired |
| | | private DpUnitSupplyTimeService dpUnitSupplyTimeService; |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "åä½è¡¥ç»æ¶é´å表") |
| | | public AjaxResult getList(){ |
| | | return AjaxResult.success(dpUnitSupplyTimeService.list()); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/pageList") |
| | | @Operation(summary = "åä½è¡¥ç»æ¶é´å页å表") |
| | | public TableDataInfo getPageList(DpUnitSupplyTime dpUnitSupplyTime) { |
| | | return dpUnitSupplyTimeService.getPageList(dpUnitSupplyTime); |
| | | } |
| | | |
| | | |
| | | @GetMapping(value = "/{id}") |
| | | @Operation(summary = "è·ååä½è¡¥ç»æ¶é´è¯¦ç»ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("id") Integer id) |
| | | { |
| | | return AjaxResult.success(dpUnitSupplyTimeService.getById(id)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "æ°å¢") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DpUnitSupplyTime dpUnitSupplyTime) |
| | | { |
| | | QueryWrapper<DpUnitSupplyTime> queryWrapperDesign = new QueryWrapper<>(); |
| | | queryWrapperDesign.eq("SHIP_DESIGN",dpUnitSupplyTime.getShipDesign()); |
| | | QueryWrapper<DpUnitSupplyTime> queryWrapperCategory = new QueryWrapper<>(); |
| | | queryWrapperCategory.eq("CATEGORY",dpUnitSupplyTime.getCategory()); |
| | | if(dpUnitSupplyTimeService.exists(queryWrapperDesign)){ |
| | | return AjaxResult.error("è°è¹åå·å·²åå¨"); |
| | | }else if(dpUnitSupplyTimeService.exists(queryWrapperCategory)){ |
| | | return AjaxResult.error("è¡¥ç»ç§ç±»å·²åå¨"); |
| | | }else { |
| | | return AjaxResult.success(dpUnitSupplyTimeService.save(dpUnitSupplyTime)); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "ä¿®æ¹") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DpUnitSupplyTime dpUnitSupplyTime) |
| | | { |
| | | QueryWrapper<DpUnitSupplyTime> queryWrapperDesign = new QueryWrapper<>(); |
| | | queryWrapperDesign.eq("SHIP_DESIGN",dpUnitSupplyTime.getShipDesign()); |
| | | QueryWrapper<DpUnitSupplyTime> queryWrapperCategory = new QueryWrapper<>(); |
| | | queryWrapperCategory.eq("CATEGORY",dpUnitSupplyTime.getCategory()); |
| | | if(dpUnitSupplyTimeService.exists(queryWrapperDesign)){ |
| | | return AjaxResult.error("è°è¹åå·å·²åå¨"); |
| | | }else if(dpUnitSupplyTimeService.exists(queryWrapperCategory)){ |
| | | return AjaxResult.error("è¡¥ç»ç§ç±»å·²åå¨"); |
| | | }else { |
| | | return AjaxResult.success(dpUnitSupplyTimeService.updateById(dpUnitSupplyTime)); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "å é¤") |
| | | @DeleteMapping("/{id}") |
| | | public AjaxResult remove(@PathVariable Integer id) |
| | | { |
| | | return AjaxResult.success(dpUnitSupplyTimeService.removeById(id)); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.manage.domain.DpWharf; |
| | | import com.ruoyi.manage.service.DpWharfService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * ç 头 å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author zhangyy |
| | | * @since 2025-03-11 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/dpWharf") |
| | | @Tag(name = "大å±--ç 头管ç") |
| | | public class DpWharfController extends BaseController { |
| | | @Resource |
| | | private DpWharfService dpWharfService; |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "ç 头å表") |
| | | public AjaxResult getList(){ |
| | | return AjaxResult.success(dpWharfService.list()); |
| | | } |
| | | |
| | | @GetMapping("/pageList") |
| | | @Operation(summary = "ç 头å页å表") |
| | | public TableDataInfo getPageList(DpWharf wharf) { |
| | | |
| | | // å建å页对象ï¼å½åé¡µï¼æ¯é¡µå¤§å°ï¼ |
| | | Page<DpWharf> page = new Page<>(wharf.getPageNum(), wharf.getPageSize()); |
| | | QueryWrapper<DpWharf> queryWrapper = new QueryWrapper<>(); |
| | | if (null!=wharf.getName()){ |
| | | queryWrapper.like("name", wharf.getName()); |
| | | } |
| | | IPage<DpWharf> result = dpWharfService.page(page, queryWrapper); |
| | | List<DpWharf> records = result.getRecords(); |
| | | long total = result.getTotal(); |
| | | return new TableDataInfo(records,Integer.parseInt(String.valueOf(total))); |
| | | } |
| | | |
| | | /** |
| | | * è·åç 头详ç»ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "è·åç 头详ç»ä¿¡æ¯") |
| | | @GetMapping(value = "/{whId}") |
| | | public AjaxResult getInfo(@PathVariable("whId") Long whId) { |
| | | return success(dpWharfService.getById(whId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç 头 |
| | | */ |
| | | @Operation(summary = "æ°å¢") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DpWharf dpWharf) { |
| | | return toAjax(dpWharfService.save(dpWharf)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç 头 |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DpWharf dpWharf) { |
| | | return toAjax(dpWharfService.updateById(dpWharf)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç 头 |
| | | */ |
| | | @Operation(summary = "å é¤") |
| | | @DeleteMapping("/{whId}") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult remove(@PathVariable Integer whId) { |
| | | try { |
| | | dpWharfService.deleteWhraf(whId); |
| | | }catch (Exception e){ |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | e.printStackTrace(); |
| | | return AjaxResult.error("å é¤å¤±è´¥"); |
| | | } |
| | | |
| | | return AjaxResult.success("å 餿å"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.buss.common.RfidUtil; |
| | | import com.ruoyi.buss.domain.vo.RfIdVo; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.manage.domain.*; |
| | | import com.ruoyi.manage.service.DpBerthService; |
| | | import com.ruoyi.manage.service.DpShipTypeService; |
| | | import com.ruoyi.manage.service.DpShipsService; |
| | | import com.ruoyi.manage.service.DsTaskListService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * ä»»å¡åé
详æ
表 å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author sunjiawei |
| | | * @since 2025-03-24 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/dp/dsTaskList") |
| | | @Tag(name = "大å±--ä»»å¡åé
详æ
") |
| | | public class DsTaskListController { |
| | | @Autowired |
| | | private DsTaskListService dsTaskListService; |
| | | @Autowired |
| | | private DpShipsService dpShipsService; |
| | | @Autowired |
| | | private DpShipTypeService dpShipTypeService; |
| | | @Autowired |
| | | private DpBerthService dpBerthService; |
| | | @Autowired |
| | | private RuoYiConfig ruoYiConfig; |
| | | |
| | | |
| | | @GetMapping("/list") |
| | | @Operation(summary = "ä»»å¡åé
详æ
å表") |
| | | public AjaxResult getList(){ |
| | | return AjaxResult.success(dsTaskListService.list()); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/pageList") |
| | | @Operation(summary = "ä»»å¡åé
详æ
å页å表") |
| | | public TableDataInfo getPageList(DsTaskList dsTaskList) { |
| | | return dsTaskListService.getPageList(dsTaskList); |
| | | } |
| | | |
| | | @GetMapping("/pageListDaily") |
| | | @Operation(summary = "æ¥å¸¸ä»»å¡åé
详æ
å页å表") |
| | | public TableDataInfo pageListDaily(DsTaskList dsTaskList) { |
| | | return dsTaskListService.getPageListDaily(dsTaskList); |
| | | } |
| | | |
| | | |
| | | @GetMapping(value = "/{id}") |
| | | @Operation(summary = "è·åä»»å¡åé
详æ
详ç»ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("id") Integer pkid) |
| | | { |
| | | return AjaxResult.success(dsTaskListService.getById(pkid)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "ç¾¤ç»æ°å¢") |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody DsTaskList dsTaskList) |
| | | { |
| | | return AjaxResult.success(dsTaskListService.save(dsTaskList)); |
| | | } |
| | | |
| | | @Operation(summary = "æ¥å¸¸æ°å¢") |
| | | @PostMapping(value = "/dailyAdd") |
| | | public AjaxResult dailyAdd(@RequestBody DsTaskList dsTaskList, |
| | | @RequestParam(value = "lon") Double lon, |
| | | @RequestParam(value = "lat") Double lat, |
| | | @RequestParam(value = "alt") Double alt, |
| | | @RequestParam(value = "heading") Double heading) |
| | | { |
| | | String shipType = dsTaskList.getShipType(); |
| | | LambdaQueryWrapper<DpShipType> shipTypeWrapper = new LambdaQueryWrapper<>(); |
| | | shipTypeWrapper.eq(DpShipType::getShipDesign,shipType); |
| | | DpShipType dpShipType = dpShipTypeService.getOne(shipTypeWrapper); |
| | | Integer shipTypeId = dpShipType.getId(); |
| | | Integer whId = dsTaskList.getHarborId().intValue(); |
| | | Integer beId = dsTaskList.getBerthId().intValue(); |
| | | String shipId = dsTaskList.getShipNo(); |
| | | |
| | | DpShips dpShip = new DpShips(); |
| | | dpShip.setShipTypeId(shipTypeId); |
| | | dpShip.setWhId(whId); |
| | | dpShip.setBeId(beId); |
| | | dpShip.setShipId(shipId); |
| | | dpShip.setShipName(shipId); |
| | | dpShip.setLon(lon); |
| | | dpShip.setLat(lat); |
| | | dpShip.setAlt(alt); |
| | | dpShip.setHeading(heading); |
| | | |
| | | DmBerth dmBerth =dpBerthService.getById(beId); |
| | | String path = dmBerth.getPath(); |
| | | |
| | | boolean taskListRes = dsTaskListService.save(dsTaskList); |
| | | if(taskListRes){ |
| | | List<RfIdVo> list = new ArrayList<>(); |
| | | RfIdVo rfIdVo = new RfIdVo(); |
| | | rfIdVo.setId((999+Integer.parseInt(shipId))); |
| | | rfIdVo.setName(String.valueOf(999+Integer.parseInt(shipId))); |
| | | rfIdVo.setPath(path); |
| | | list.add(rfIdVo); |
| | | RfidUtil.sendJsonPost(ruoYiConfig.getBussRfidUrl(),list.toString()); |
| | | } |
| | | boolean shipRes = dpShipsService.save(dpShip); |
| | | if(taskListRes && shipRes){ |
| | | return AjaxResult.success(); |
| | | }else { |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "ä¿®æ¹") |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody DsTaskList dsTaskList) |
| | | { |
| | | return AjaxResult.success(dsTaskListService.updateById(dsTaskList)); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "å é¤") |
| | | @DeleteMapping("/{pkid}") |
| | | public AjaxResult remove(@PathVariable Integer pkid) |
| | | { |
| | | return AjaxResult.success(dsTaskListService.removeById(pkid)); |
| | | } |
| | | |
| | | @Operation(summary = "æ¥å¸¸ä»»å¡å é¤") |
| | | @DeleteMapping("/deleteDaily/{pkid}") |
| | | public AjaxResult deleteDaily(@PathVariable Integer pkid) |
| | | { |
| | | DsTaskList dsTaskList = dsTaskListService.getById(pkid); |
| | | LambdaQueryWrapper<DpShips> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | lambdaQueryWrapper.eq(DpShips::getShipId,dsTaskList.getShipNo()); |
| | | boolean shipRes = dpShipsService.remove(lambdaQueryWrapper); |
| | | boolean taskRes = dsTaskListService.removeById(pkid); |
| | | if(shipRes && taskRes){ |
| | | return AjaxResult.success(); |
| | | }else { |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | } |
| | | |
| | | @GetMapping(value = "/getByBeId") |
| | | @Operation(summary = "æ ¹æ®æ³ä½IDè·åä»»å¡åé
详æ
") |
| | | public R<DsTaskList> getByBeId(@RequestParam("beId") Integer beId) |
| | | { |
| | | LambdaQueryWrapper<DsTaskList> lambdaQueryWrapper = new LambdaQueryWrapper(); |
| | | lambdaQueryWrapper.eq(DsTaskList::getBerthId,beId) |
| | | .eq(DsTaskList::getTaskId,999) |
| | | .orderByDesc(DsTaskList::getCreateTime) |
| | | .last("LIMIT 1"); |
| | | return R.ok(dsTaskListService.getOne(lambdaQueryWrapper)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.manage; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.fuzhou.domain.CameraPTZ; |
| | | import com.ruoyi.fuzhou.domain.DpEquipment; |
| | | import com.ruoyi.fuzhou.domain.HikEvent; |
| | | import com.ruoyi.fuzhou.domain.HikEventObj; |
| | | import com.ruoyi.fuzhou.service.EquipmentService; |
| | | import com.ruoyi.fuzhou.service.HikService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.OffsetDateTime; |
| | | import java.util.Date; |
| | | |
| | | @RestController |
| | | @RequestMapping("/dp/hik") |
| | | @Tag(name = "大å±--海康è§é¢") |
| | | public class HikController extends BaseController { |
| | | @Autowired |
| | | private HikService hikService; |
| | | @Autowired |
| | | private EquipmentService dpEquipmentService; |
| | | |
| | | @GetMapping("/getCameraPreviewURL/{cameraName}") |
| | | @Operation(summary = "æ ¹æ®nameæ¥è¯¢è§é¢ææ¾URL") |
| | | public AjaxResult getCameraPreviewURL(@PathVariable("cameraName") String cameraName) throws Exception { |
| | | return AjaxResult.success(hikService.getCameraPreviewURL(cameraName)); |
| | | } |
| | | |
| | | @GetMapping("/getCameraURL/{cameraIndexCode}") |
| | | @Operation(summary = "æ ¹æ®indexcodeæ¥è¯¢è§é¢ææ¾URL") |
| | | public AjaxResult getCameraURL(@PathVariable("cameraIndexCode") String cameraIndexCode) throws Exception { |
| | | return AjaxResult.success(hikService.getCameraURL(cameraIndexCode)); |
| | | } |
| | | |
| | | @GetMapping("/getCameraOnline/{indexCodes}") |
| | | @Operation(summary = "æ ¹æ®indexCodesæ°ç»æ¥è¯¢çæ§ç¶æ") |
| | | public AjaxResult getCameraOnline(@PathVariable("indexCodes") String[] indexCodes) throws Exception { |
| | | return AjaxResult.success(hikService.getCameraOnline(indexCodes)); |
| | | } |
| | | |
| | | @Operation(summary = "äºå°æä½") |
| | | @PostMapping("/cameraCommand") |
| | | public AjaxResult cameraCommand(@RequestBody CameraPTZ cameraPTZ) throws Exception{ |
| | | return AjaxResult.success(hikService.cameraCommand(cameraPTZ)); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®äºä»¶ç±»å订é
äºä»¶") |
| | | @PostMapping("/subByEventTypes") |
| | | public JSONObject subByEventTypes(@RequestBody HikEventObj hikEventObj) throws Exception{ |
| | | return hikService.subByEventTypes(hikEventObj); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®äºä»¶ç±»ååæ¶è®¢é
äºä»¶") |
| | | @PostMapping("/unSubByEventTypes") |
| | | public JSONObject unSubByEventTypes(@RequestBody HikEventObj hikEventObj) throws Exception{ |
| | | return hikService.unSubByEventTypes(hikEventObj); |
| | | } |
| | | |
| | | @Operation(summary = "æ¥è¯¢è®¢é
äºä»¶ä¿¡æ¯") |
| | | @PostMapping("/eventView") |
| | | public JSONObject eventView() throws Exception{ |
| | | return hikService.eventView(); |
| | | } |
| | | |
| | | @Operation(summary = "æ¥æ¶æµ·åº·äºä»¶ä¿¡æ¯") |
| | | @PostMapping("/eventRcv") |
| | | public JSONObject eventRcv(@RequestBody JSONObject jsonObject) throws Exception{ |
| | | String method = null; |
| | | JSONObject params = new JSONObject(); |
| | | JSONArray events = new JSONArray(); |
| | | JSONObject res = new JSONObject(); |
| | | String sendTime = null; |
| | | if(jsonObject.containsKey("method")){ |
| | | method = jsonObject.getString("method"); |
| | | } |
| | | if (jsonObject.containsKey("params")) { |
| | | params = jsonObject.getJSONObject("params"); |
| | | if(params.containsKey("sendTime")){ |
| | | sendTime = params.getString("sendTime"); |
| | | } |
| | | if (params.containsKey("events")) { |
| | | events = params.getJSONArray("events"); |
| | | if(events.size()>0){ |
| | | for (int i=0;i<events.size();i++){ |
| | | JSONObject event = events.getJSONObject(i); |
| | | |
| | | HikEvent hikEvent = new HikEvent(); |
| | | hikEvent.setSendTime(convertTime(sendTime)); |
| | | if(event.containsKey("srcIndex")){ |
| | | String srcIndex = event.getString("srcIndex"); |
| | | hikEvent.setSrcIndex(srcIndex); |
| | | } |
| | | if(event.containsKey("srcType")){ |
| | | String srcType = event.getString("srcType"); |
| | | hikEvent.setSrcType(srcType); |
| | | } |
| | | if(event.containsKey("srcName")){ |
| | | String srcName = event.getString("srcName"); |
| | | hikEvent.setSrcName(srcName); |
| | | } |
| | | if(event.containsKey("eventType")){ |
| | | Integer eventType = event.getIntValue("eventType"); |
| | | hikEvent.setEventType(eventType); |
| | | } |
| | | if(event.containsKey("happenTime")){ |
| | | String happenTime = event.getString("happenTime"); |
| | | hikEvent.setHappenTime(convertTime(happenTime)); |
| | | } |
| | | boolean reaIns = hikService.saveInsert(hikEvent); |
| | | if(reaIns){ |
| | | res.put("code","0"); |
| | | res.put("msg","success"); |
| | | } |
| | | |
| | | if(event.containsKey("data")){ |
| | | JSONObject data = event.getJSONObject("data"); |
| | | if(data.containsKey("regionEntrance")){ |
| | | JSONArray regionEntrance = data.getJSONArray("regionEntrance"); |
| | | if(regionEntrance.size()>0){ |
| | | for (int k=0;k<regionEntrance.size();k++){ |
| | | JSONObject region = regionEntrance.getJSONObject(k); |
| | | if(region.containsKey("targetAttrs")){ |
| | | JSONObject targetAttrs = region.getJSONObject("targetAttrs"); |
| | | if(targetAttrs.containsKey("cameraAddress")){ |
| | | String cameraAddress = targetAttrs.getString("cameraAddress"); |
| | | } |
| | | if(targetAttrs.containsKey("cameraIndexCode")){ |
| | | String cameraIndexCode = targetAttrs.getString("cameraIndexCode"); |
| | | } |
| | | if(targetAttrs.containsKey("deviceIndexCode")){ |
| | | String deviceIndexCode = targetAttrs.getString("deviceIndexCode"); |
| | | } |
| | | if(targetAttrs.containsKey("imageServerCode")){ |
| | | String imageServerCode = targetAttrs.getString("imageServerCode"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æµ·åº·äºä»¶å表 |
| | | */ |
| | | @PostMapping("/list") |
| | | @Operation(summary = "æ¥è¯¢æµ·åº·äºä»¶å表ï¼å页ï¼") |
| | | public TableDataInfo list(@RequestBody HikEvent hikEvent) |
| | | { |
| | | return hikService.getList(hikEvent); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æææµ·åº·äºä»¶å表 |
| | | */ |
| | | @GetMapping("/listAll") |
| | | @Operation(summary = "æ¥è¯¢æææµ·åº·äºä»¶å表") |
| | | public AjaxResult listAll() |
| | | { |
| | | return AjaxResult.success(hikService.list()); |
| | | } |
| | | |
| | | /** |
| | | * è·å港å£ä¿¡æ¯è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @Operation(summary = "è·å海康äºä»¶ä¿¡æ¯") |
| | | public AjaxResult getInfo(@PathVariable("id") String id) |
| | | { |
| | | return success(hikService.getById(id)); |
| | | } |
| | | |
| | | private Date convertTime(String time){ |
| | | OffsetDateTime offsetDateTime = OffsetDateTime.parse(time); |
| | | Date date = Date.from(offsetDateTime.toInstant()); |
| | | return date; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Properties; |
| | | import java.util.Set; |
| | | import java.util.TreeSet; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisCallback; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysCache; |
| | | |
| | | /** |
| | | * ç¼åçæ§ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/cache") |
| | | @Hidden |
| | | public class CacheController |
| | | { |
| | | @Autowired |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | |
| | | private final static List<SysCache> caches = new ArrayList<SysCache>(); |
| | | { |
| | | caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "ç¨æ·ä¿¡æ¯")); |
| | | caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "é
置信æ¯")); |
| | | caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "æ°æ®åå
¸")); |
| | | caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "éªè¯ç ")); |
| | | caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "é²éæäº¤")); |
| | | caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "éæµå¤ç")); |
| | | caches.add(new SysCache(CacheConstants.PWD_ERR_CNT_KEY, "å¯ç é误次æ°")); |
| | | } |
| | | |
| | | @SuppressWarnings("deprecation") |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping() |
| | | public AjaxResult getInfo() throws Exception |
| | | { |
| | | Properties info = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info()); |
| | | Properties commandStats = (Properties) redisTemplate.execute((RedisCallback<Object>) connection -> connection.info("commandstats")); |
| | | Object dbSize = redisTemplate.execute((RedisCallback<Object>) connection -> connection.dbSize()); |
| | | |
| | | Map<String, Object> result = new HashMap<>(3); |
| | | result.put("info", info); |
| | | result.put("dbSize", dbSize); |
| | | |
| | | List<Map<String, String>> pieList = new ArrayList<>(); |
| | | commandStats.stringPropertyNames().forEach(key -> { |
| | | Map<String, String> data = new HashMap<>(2); |
| | | String property = commandStats.getProperty(key); |
| | | data.put("name", StringUtils.removeStart(key, "cmdstat_")); |
| | | data.put("value", StringUtils.substringBetween(property, "calls=", ",usec")); |
| | | pieList.add(data); |
| | | }); |
| | | result.put("commandStats", pieList); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getNames") |
| | | public AjaxResult cache() |
| | | { |
| | | return AjaxResult.success(caches); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getKeys/{cacheName}") |
| | | public AjaxResult getCacheKeys(@PathVariable String cacheName) |
| | | { |
| | | Set<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | return AjaxResult.success(new TreeSet<>(cacheKeys)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @GetMapping("/getValue/{cacheName}/{cacheKey}") |
| | | public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey) |
| | | { |
| | | String cacheValue = redisTemplate.opsForValue().get(cacheKey); |
| | | SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue); |
| | | return AjaxResult.success(sysCache); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheName/{cacheName}") |
| | | public AjaxResult clearCacheName(@PathVariable String cacheName) |
| | | { |
| | | Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*"); |
| | | redisTemplate.delete(cacheKeys); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheKey/{cacheKey}") |
| | | public AjaxResult clearCacheKey(@PathVariable String cacheKey) |
| | | { |
| | | redisTemplate.delete(cacheKey); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:cache:list')") |
| | | @DeleteMapping("/clearCacheAll") |
| | | public AjaxResult clearCacheAll() |
| | | { |
| | | Collection<String> cacheKeys = redisTemplate.keys("*"); |
| | | redisTemplate.delete(cacheKeys); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.Server; |
| | | |
| | | /** |
| | | * æå¡å¨çæ§ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/server") |
| | | @Hidden |
| | | public class ServerController |
| | | { |
| | | @PreAuthorize("@ss.hasPermi('monitor:server:list')") |
| | | @GetMapping() |
| | | public AjaxResult getInfo() throws Exception |
| | | { |
| | | Server server = new Server(); |
| | | server.copyTo(); |
| | | return AjaxResult.success(server); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.service.SysPasswordService; |
| | | import com.ruoyi.system.domain.SysLogininfor; |
| | | import com.ruoyi.system.service.ISysLogininforService; |
| | | |
| | | /** |
| | | * ç³»ç»è®¿é®è®°å½ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/logininfor") |
| | | @Hidden |
| | | public class SysLogininforController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysLogininforService logininforService; |
| | | |
| | | @Autowired |
| | | private SysPasswordService passwordService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysLogininfor logininfor, |
| | | @RequestParam(value = "pageNum", required = false)Integer pageNum, |
| | | @RequestParam(value = "pageSize", required = false)Integer pageSize) |
| | | { |
| | | startPage(); |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | // return getDataTable(list); |
| | | return paginate(list,pageNum,pageSize); |
| | | } |
| | | |
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysLogininfor logininfor) |
| | | { |
| | | List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |
| | | ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class); |
| | | util.exportExcel(response, list, "ç»å½æ¥å¿"); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{infoIds}") |
| | | public AjaxResult remove(@PathVariable Long[] infoIds) |
| | | { |
| | | return toAjax(logininforService.deleteLogininforByIds(infoIds)); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") |
| | | @Log(title = "ç»å½æ¥å¿", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() |
| | | { |
| | | logininforService.cleanLogininfor(); |
| | | return success(); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:logininfor:unlock')") |
| | | @Log(title = "è´¦æ·è§£é", businessType = BusinessType.OTHER) |
| | | @GetMapping("/unlock/{userName}") |
| | | public AjaxResult unlock(@PathVariable("userName") String userName) |
| | | { |
| | | passwordService.clearLoginRecordCache(userName); |
| | | return success(); |
| | | } |
| | | |
| | | //对å表è¿è¡å页 |
| | | private TableDataInfo paginate(List list, int pageNum, int pageSize) { |
| | | if (list == null || list.isEmpty()) { |
| | | return new TableDataInfo(new ArrayList<>(), 0); |
| | | } |
| | | int total = list.size(); |
| | | int formIndex = (pageNum - 1) * pageSize; |
| | | int toIndex = Math.min(formIndex + pageSize, total); |
| | | if (formIndex >= total) { |
| | | return new TableDataInfo(new ArrayList<>(), total); |
| | | } |
| | | List subList = list.subList(formIndex, toIndex); |
| | | return new TableDataInfo(subList, total); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysOperLog; |
| | | import com.ruoyi.system.service.ISysOperLogService; |
| | | |
| | | /** |
| | | * æä½æ¥å¿è®°å½ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/operlog") |
| | | @Hidden |
| | | public class SysOperlogController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysOperLogService operLogService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysOperLog operLog, |
| | | @RequestParam(value = "pageNum", required = false)Integer pageNum, |
| | | @RequestParam(value = "pageSize", required = false)Integer pageSize) |
| | | { |
| | | startPage(); |
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | // return getDataTable(list); |
| | | return paginate(list,pageNum,pageSize); |
| | | } |
| | | |
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysOperLog operLog) |
| | | { |
| | | List<SysOperLog> list = operLogService.selectOperLogList(operLog); |
| | | ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class); |
| | | util.exportExcel(response, list, "æä½æ¥å¿"); |
| | | } |
| | | |
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.DELETE) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") |
| | | @DeleteMapping("/{operIds}") |
| | | public AjaxResult remove(@PathVariable Long[] operIds) |
| | | { |
| | | return toAjax(operLogService.deleteOperLogByIds(operIds)); |
| | | } |
| | | |
| | | @Log(title = "æä½æ¥å¿", businessType = BusinessType.CLEAN) |
| | | @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") |
| | | @DeleteMapping("/clean") |
| | | public AjaxResult clean() |
| | | { |
| | | operLogService.cleanOperLog(); |
| | | return success(); |
| | | } |
| | | |
| | | //对å表è¿è¡å页 |
| | | private TableDataInfo paginate(List list, int pageNum, int pageSize) { |
| | | if (list == null || list.isEmpty()) { |
| | | return new TableDataInfo(new ArrayList<>(), 0); |
| | | } |
| | | int total = list.size(); |
| | | int formIndex = (pageNum - 1) * pageSize; |
| | | int toIndex = Math.min(formIndex + pageSize, total); |
| | | if (formIndex >= total) { |
| | | return new TableDataInfo(new ArrayList<>(), total); |
| | | } |
| | | List subList = list.subList(formIndex, toIndex); |
| | | return new TableDataInfo(subList, total); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.monitor; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysUserOnline; |
| | | import com.ruoyi.system.service.ISysUserOnlineService; |
| | | |
| | | /** |
| | | * å¨çº¿ç¨æ·çæ§ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/monitor/online") |
| | | @Hidden |
| | | public class SysUserOnlineController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysUserOnlineService userOnlineService; |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(String ipaddr, String userName) |
| | | { |
| | | Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*"); |
| | | List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>(); |
| | | for (String key : keys) |
| | | { |
| | | LoginUser user = redisCache.getCacheObject(key); |
| | | if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); |
| | | } |
| | | else if (StringUtils.isNotEmpty(ipaddr)) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); |
| | | } |
| | | else if (StringUtils.isNotEmpty(userName) && StringUtils.isNotNull(user.getUser())) |
| | | { |
| | | userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); |
| | | } |
| | | else |
| | | { |
| | | userOnlineList.add(userOnlineService.loginUserToUserOnline(user)); |
| | | } |
| | | } |
| | | Collections.reverse(userOnlineList); |
| | | userOnlineList.removeAll(Collections.singleton(null)); |
| | | return getDataTable(userOnlineList); |
| | | } |
| | | |
| | | /** |
| | | * 强éç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')") |
| | | @Log(title = "å¨çº¿ç¨æ·", businessType = BusinessType.FORCE) |
| | | @DeleteMapping("/{tokenId}") |
| | | public AjaxResult forceLogout(@PathVariable String tokenId) |
| | | { |
| | | redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId); |
| | | return success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * åæ°é
ç½® ä¿¡æ¯æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/config") |
| | | @Hidden |
| | | public class SysConfigController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | /** |
| | | * è·ååæ°é
ç½®å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysConfig config) |
| | | { |
| | | startPage(); |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:config:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysConfig config) |
| | | { |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | | ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); |
| | | util.exportExcel(response, list, "åæ°æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:query')") |
| | | @GetMapping(value = "/{configId}") |
| | | public AjaxResult getInfo(@PathVariable Long configId) |
| | | { |
| | | return success(configService.selectConfigById(configId)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åæ°é®åæ¥è¯¢åæ°å¼ |
| | | */ |
| | | @GetMapping(value = "/configKey/{configKey}") |
| | | public AjaxResult getConfigKey(@PathVariable String configKey) |
| | | { |
| | | return success(configService.selectConfigByKey(configKey)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åæ°é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:add')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysConfig config) |
| | | { |
| | | if (!configService.checkConfigKeyUnique(config)) |
| | | { |
| | | return error("æ°å¢åæ°'" + config.getConfigName() + "'失败ï¼åæ°é®åå·²åå¨"); |
| | | } |
| | | config.setCreateBy(getUsername()); |
| | | return toAjax(configService.insertConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åæ°é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:edit')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysConfig config) |
| | | { |
| | | if (!configService.checkConfigKeyUnique(config)) |
| | | { |
| | | return error("ä¿®æ¹åæ°'" + config.getConfigName() + "'失败ï¼åæ°é®åå·²åå¨"); |
| | | } |
| | | config.setUpdateBy(getUsername()); |
| | | return toAjax(configService.updateConfig(config)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åæ°é
ç½® |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{configIds}") |
| | | public AjaxResult remove(@PathVariable Long[] configIds) |
| | | { |
| | | configService.deleteConfigByIds(configIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * å·æ°åæ°ç¼å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:config:remove')") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() |
| | | { |
| | | configService.resetConfigCache(); |
| | | return success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | |
| | | /** |
| | | * é¨é¨ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dept") |
| | | @Hidden |
| | | public class SysDeptController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | /** |
| | | * è·åé¨é¨å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysDept dept) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(dept); |
| | | return success(depts); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢é¨é¨åè¡¨ï¼æé¤èç¹ï¼ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @GetMapping("/list/exclude/{deptId}") |
| | | public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) |
| | | { |
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
| | | depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); |
| | | return success(depts); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®é¨é¨ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:query')") |
| | | @GetMapping(value = "/{deptId}") |
| | | public AjaxResult getInfo(@PathVariable Long deptId) |
| | | { |
| | | deptService.checkDeptDataScope(deptId); |
| | | return success(deptService.selectDeptById(deptId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢é¨é¨ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:add')") |
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDept dept) |
| | | { |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return error("æ°å¢é¨é¨'" + dept.getDeptName() + "'失败ï¼é¨é¨åç§°å·²åå¨"); |
| | | } |
| | | dept.setCreateBy(getUsername()); |
| | | return toAjax(deptService.insertDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹é¨é¨ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:edit')") |
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept) |
| | | { |
| | | Long deptId = dept.getDeptId(); |
| | | deptService.checkDeptDataScope(deptId); |
| | | if (!deptService.checkDeptNameUnique(dept)) |
| | | { |
| | | return error("ä¿®æ¹é¨é¨'" + dept.getDeptName() + "'失败ï¼é¨é¨åç§°å·²åå¨"); |
| | | } |
| | | else if (dept.getParentId().equals(deptId)) |
| | | { |
| | | return error("ä¿®æ¹é¨é¨'" + dept.getDeptName() + "'失败ï¼ä¸çº§é¨é¨ä¸è½æ¯èªå·±"); |
| | | } |
| | | else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) |
| | | { |
| | | return error("该é¨é¨å
嫿ªåç¨çåé¨é¨ï¼"); |
| | | } |
| | | dept.setUpdateBy(getUsername()); |
| | | return toAjax(deptService.updateDept(dept)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤é¨é¨ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:remove')") |
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{deptId}") |
| | | public AjaxResult remove(@PathVariable Long deptId) |
| | | { |
| | | if (deptService.hasChildByDeptId(deptId)) |
| | | { |
| | | return warn("åå¨ä¸çº§é¨é¨,ä¸å
许å é¤"); |
| | | } |
| | | if (deptService.checkDeptExistUser(deptId)) |
| | | { |
| | | return warn("é¨é¨åå¨ç¨æ·,ä¸å
许å é¤"); |
| | | } |
| | | deptService.checkDeptDataScope(deptId); |
| | | return toAjax(deptService.deleteDeptById(deptId)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * æ°æ®åå
¸ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dict/data") |
| | | @Hidden |
| | | public class SysDictDataController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDictDataService dictDataService; |
| | | |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictData dictData) |
| | | { |
| | | startPage(); |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictData dictData) |
| | | { |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); |
| | | util.exportExcel(response, list, "åå
¸æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åå
¸æ°æ®è¯¦ç» |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictCode}") |
| | | public AjaxResult getInfo(@PathVariable Long dictCode) |
| | | { |
| | | return success(dictDataService.selectDictDataById(dictCode)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ®ä¿¡æ¯ |
| | | */ |
| | | @GetMapping(value = "/type/{dictType}") |
| | | public AjaxResult dictType(@PathVariable String dictType) |
| | | { |
| | | List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); |
| | | if (StringUtils.isNull(data)) |
| | | { |
| | | data = new ArrayList<SysDictData>(); |
| | | } |
| | | return success(data); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setCreateBy(getUsername()); |
| | | return toAjax(dictDataService.insertDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿ååå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictData dict) |
| | | { |
| | | dict.setUpdateBy(getUsername()); |
| | | return toAjax(dictDataService.updateDictData(dict)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictCodes}") |
| | | public AjaxResult remove(@PathVariable Long[] dictCodes) |
| | | { |
| | | dictDataService.deleteDictDataByIds(dictCodes); |
| | | return success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDictType; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | |
| | | /** |
| | | * æ°æ®åå
¸ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/dict/type") |
| | | @Hidden |
| | | public class SysDictTypeController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysDictTypeService dictTypeService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:dict:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysDictType dictType, |
| | | @RequestParam(value = "pageNum", required = false)Integer pageNum, |
| | | @RequestParam(value = "pageSize", required = false)Integer pageSize) |
| | | { |
| | | startPage(); |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | // return getDataTable(list); |
| | | return paginate(list,pageNum,pageSize); |
| | | } |
| | | |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:dict:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysDictType dictType) |
| | | { |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); |
| | | util.exportExcel(response, list, "åå
¸ç±»å"); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åå
¸ç±»åè¯¦ç» |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:query')") |
| | | @GetMapping(value = "/{dictId}") |
| | | public AjaxResult getInfo(@PathVariable Long dictId) |
| | | { |
| | | return success(dictTypeService.selectDictTypeById(dictId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:add')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return error("æ°å¢åå
¸'" + dict.getDictName() + "'失败ï¼åå
¸ç±»åå·²åå¨"); |
| | | } |
| | | dict.setCreateBy(getUsername()); |
| | | return toAjax(dictTypeService.insertDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:edit')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDictType dict) |
| | | { |
| | | if (!dictTypeService.checkDictTypeUnique(dict)) |
| | | { |
| | | return error("ä¿®æ¹åå
¸'" + dict.getDictName() + "'失败ï¼åå
¸ç±»åå·²åå¨"); |
| | | } |
| | | dict.setUpdateBy(getUsername()); |
| | | return toAjax(dictTypeService.updateDictType(dict)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åå
¸ç±»å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{dictIds}") |
| | | public AjaxResult remove(@PathVariable Long[] dictIds) |
| | | { |
| | | dictTypeService.deleteDictTypeByIds(dictIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * å·æ°åå
¸ç¼å |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dict:remove')") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.CLEAN) |
| | | @DeleteMapping("/refreshCache") |
| | | public AjaxResult refreshCache() |
| | | { |
| | | dictTypeService.resetDictCache(); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * è·ååå
¸éæ©æ¡å表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); |
| | | return success(dictTypes); |
| | | } |
| | | |
| | | //对å表è¿è¡å页 |
| | | private TableDataInfo paginate(List list, int pageNum, int pageSize) { |
| | | if (list == null || list.isEmpty()) { |
| | | return new TableDataInfo(new ArrayList<>(), 0); |
| | | } |
| | | int total = list.size(); |
| | | int formIndex = (pageNum - 1) * pageSize; |
| | | int toIndex = Math.min(formIndex + pageSize, total); |
| | | if (formIndex >= total) { |
| | | return new TableDataInfo(new ArrayList<>(), total); |
| | | } |
| | | List subList = list.subList(formIndex, toIndex); |
| | | return new TableDataInfo(subList, total); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | |
| | | /** |
| | | * é¦é¡µ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @Hidden |
| | | public class SysIndexController |
| | | { |
| | | /** ç³»ç»åºç¡é
ç½® */ |
| | | @Autowired |
| | | private RuoYiConfig ruoyiConfig; |
| | | |
| | | /** |
| | | * 访é®é¦é¡µï¼æç¤ºè¯ |
| | | */ |
| | | @RequestMapping("/") |
| | | public String index() |
| | | { |
| | | return StringUtils.format("欢è¿ä½¿ç¨{}åå°ç®¡çæ¡æ¶ï¼å½åçæ¬ï¼v{}ï¼è¯·éè¿å端å°å访é®ã", ruoyiConfig.getName(), ruoyiConfig.getVersion()); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletRequest; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginBody; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.framework.web.service.SysLoginService; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | |
| | | /** |
| | | * ç»å½éªè¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @Tag(name = "ç¨æ·ç»å½") |
| | | public class SysLoginController |
| | | { |
| | | @Autowired |
| | | private SysLoginService loginService; |
| | | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * ç»å½æ¹æ³ |
| | | * |
| | | * @param loginBody ç»å½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @PostMapping("/login") |
| | | @Operation(summary = "ç»å½") |
| | | public AjaxResult login(@RequestBody LoginBody loginBody) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | // çæä»¤ç |
| | | String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(), |
| | | loginBody.getUuid()); |
| | | ajax.put(Constants.TOKEN, token); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·ä¿¡æ¯ |
| | | * |
| | | * @return ç¨æ·ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("getInfo") |
| | | @Operation(summary = "ç¨æ·ä¿¡æ¯") |
| | | public AjaxResult getInfo() |
| | | { |
| | | LoginUser loginUser = SecurityUtils.getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | // è§è²éå |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | | // æééå |
| | | Set<String> permissions = permissionService.getMenuPermission(user); |
| | | if (!loginUser.getPermissions().equals(permissions)) |
| | | { |
| | | loginUser.setPermissions(permissions); |
| | | tokenService.refreshToken(loginUser); |
| | | } |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", roles); |
| | | ajax.put("permissions", permissions); |
| | | return ajax; |
| | | } |
| | | |
| | | @DeleteMapping("logout") |
| | | @Operation(summary = "ç¨æ·ç»åº") |
| | | public AjaxResult logout(HttpServletRequest request){ |
| | | String userName = SecurityUtils.getUsername(); |
| | | SecurityContextHolder.clearContext(); |
| | | request.getSession().invalidate(); |
| | | return AjaxResult.success(userName+"ç»åºæå"); |
| | | } |
| | | |
| | | /** |
| | | * è·åè·¯ç±ä¿¡æ¯ |
| | | * |
| | | * @return è·¯ç±ä¿¡æ¯ |
| | | */ |
| | | @GetMapping("getRouters") |
| | | public AjaxResult getRouters() |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); |
| | | return AjaxResult.success(menuService.buildMenus(menus)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.UserConstants; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | |
| | | /** |
| | | * èåä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/menu") |
| | | @Hidden |
| | | public class SysMenuController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | /** |
| | | * è·åèåå表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:list')") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(SysMenu menu) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return success(menus); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®èåç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:query')") |
| | | @GetMapping(value = "/{menuId}") |
| | | public AjaxResult getInfo(@PathVariable Long menuId) |
| | | { |
| | | return success(menuService.selectMenuById(menuId)); |
| | | } |
| | | |
| | | /** |
| | | * è·åèå䏿æ å表 |
| | | */ |
| | | @GetMapping("/treeselect") |
| | | public AjaxResult treeselect(SysMenu menu) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(menu, getUserId()); |
| | | return success(menuService.buildMenuTreeSelect(menus)); |
| | | } |
| | | |
| | | /** |
| | | * å 载对åºè§è²èåå表æ |
| | | */ |
| | | @GetMapping(value = "/roleMenuTreeselect/{roleId}") |
| | | public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) |
| | | { |
| | | List<SysMenu> menus = menuService.selectMenuList(getUserId()); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢èå |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:add')") |
| | | @Log(title = "èå管ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return error("æ°å¢èå'" + menu.getMenuName() + "'失败ï¼èååç§°å·²åå¨"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return error("æ°å¢èå'" + menu.getMenuName() + "'失败ï¼å°åå¿
须以http(s)://å¼å¤´"); |
| | | } |
| | | menu.setCreateBy(getUsername()); |
| | | return toAjax(menuService.insertMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹èå |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:edit')") |
| | | @Log(title = "èå管ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysMenu menu) |
| | | { |
| | | if (!menuService.checkMenuNameUnique(menu)) |
| | | { |
| | | return error("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼èååç§°å·²åå¨"); |
| | | } |
| | | else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) |
| | | { |
| | | return error("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼å°åå¿
须以http(s)://å¼å¤´"); |
| | | } |
| | | else if (menu.getMenuId().equals(menu.getParentId())) |
| | | { |
| | | return error("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼ä¸çº§èåä¸è½éæ©èªå·±"); |
| | | } |
| | | menu.setUpdateBy(getUsername()); |
| | | return toAjax(menuService.updateMenu(menu)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤èå |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:menu:remove')") |
| | | @Log(title = "èå管ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{menuId}") |
| | | public AjaxResult remove(@PathVariable("menuId") Long menuId) |
| | | { |
| | | if (menuService.hasChildByMenuId(menuId)) |
| | | { |
| | | return warn("åå¨åèå,ä¸å
许å é¤"); |
| | | } |
| | | if (menuService.checkMenuExistRole(menuId)) |
| | | { |
| | | return warn("èåå·²åé
,ä¸å
许å é¤"); |
| | | } |
| | | return toAjax(menuService.deleteMenuById(menuId)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | |
| | | /** |
| | | * å
¬å ä¿¡æ¯æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/notice") |
| | | @Hidden |
| | | public class SysNoticeController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysNoticeService noticeService; |
| | | |
| | | /** |
| | | * è·åéç¥å
¬åå表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysNotice notice) |
| | | { |
| | | startPage(); |
| | | List<SysNotice> list = noticeService.selectNoticeList(notice); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®éç¥å
¬åç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:query')") |
| | | @GetMapping(value = "/{noticeId}") |
| | | public AjaxResult getInfo(@PathVariable Long noticeId) |
| | | { |
| | | return success(noticeService.selectNoticeById(noticeId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢éç¥å
Œ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:add')") |
| | | @Log(title = "éç¥å
Œ", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysNotice notice) |
| | | { |
| | | notice.setCreateBy(getUsername()); |
| | | return toAjax(noticeService.insertNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹éç¥å
Œ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:edit')") |
| | | @Log(title = "éç¥å
Œ", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysNotice notice) |
| | | { |
| | | notice.setUpdateBy(getUsername()); |
| | | return toAjax(noticeService.updateNotice(notice)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤éç¥å
Œ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:notice:remove')") |
| | | @Log(title = "éç¥å
Œ", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{noticeIds}") |
| | | public AjaxResult remove(@PathVariable Long[] noticeIds) |
| | | { |
| | | return toAjax(noticeService.deleteNoticeByIds(noticeIds)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | |
| | | /** |
| | | * å²ä½ä¿¡æ¯æä½å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/post") |
| | | @Hidden |
| | | public class SysPostController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | |
| | | /** |
| | | * è·åå²ä½å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysPost post) |
| | | { |
| | | startPage(); |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:post:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysPost post) |
| | | { |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class); |
| | | util.exportExcel(response, list, "å²ä½æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å²ä½ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:query')") |
| | | @GetMapping(value = "/{postId}") |
| | | public AjaxResult getInfo(@PathVariable Long postId) |
| | | { |
| | | return success(postService.selectPostById(postId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å²ä½ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:add')") |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return error("æ°å¢å²ä½'" + post.getPostName() + "'失败ï¼å²ä½åç§°å·²åå¨"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return error("æ°å¢å²ä½'" + post.getPostName() + "'失败ï¼å²ä½ç¼ç å·²åå¨"); |
| | | } |
| | | post.setCreateBy(getUsername()); |
| | | return toAjax(postService.insertPost(post)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å²ä½ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:edit')") |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysPost post) |
| | | { |
| | | if (!postService.checkPostNameUnique(post)) |
| | | { |
| | | return error("ä¿®æ¹å²ä½'" + post.getPostName() + "'失败ï¼å²ä½åç§°å·²åå¨"); |
| | | } |
| | | else if (!postService.checkPostCodeUnique(post)) |
| | | { |
| | | return error("ä¿®æ¹å²ä½'" + post.getPostName() + "'失败ï¼å²ä½ç¼ç å·²åå¨"); |
| | | } |
| | | post.setUpdateBy(getUsername()); |
| | | return toAjax(postService.updatePost(post)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å²ä½ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:post:remove')") |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{postIds}") |
| | | public AjaxResult remove(@PathVariable Long[] postIds) |
| | | { |
| | | return toAjax(postService.deletePostByIds(postIds)); |
| | | } |
| | | |
| | | /** |
| | | * è·åå²ä½éæ©æ¡å表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | List<SysPost> posts = postService.selectPostAll(); |
| | | return success(posts); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.config.RuoYiConfig; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUploadUtils; |
| | | import com.ruoyi.common.utils.file.MimeTypeUtils; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * ä¸ªäººä¿¡æ¯ ä¸å¡å¤ç |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/user/profile") |
| | | @Hidden |
| | | public class SysProfileController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | /** |
| | | * ä¸ªäººä¿¡æ¯ |
| | | */ |
| | | @GetMapping |
| | | public AjaxResult profile() |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | AjaxResult ajax = AjaxResult.success(user); |
| | | ajax.put("roleGroup", userService.selectUserRoleGroup(loginUser.getUsername())); |
| | | ajax.put("postGroup", userService.selectUserPostGroup(loginUser.getUsername())); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @Log(title = "个人信æ¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult updateProfile(@RequestBody SysUser user) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser currentUser = loginUser.getUser(); |
| | | currentUser.setNickName(user.getNickName()); |
| | | currentUser.setEmail(user.getEmail()); |
| | | currentUser.setPhonenumber(user.getPhonenumber()); |
| | | currentUser.setSex(user.getSex()); |
| | | if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) |
| | | { |
| | | return error("ä¿®æ¹ç¨æ·'" + loginUser.getUsername() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨"); |
| | | } |
| | | if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) |
| | | { |
| | | return error("ä¿®æ¹ç¨æ·'" + loginUser.getUsername() + "'失败ï¼é®ç®±è´¦å·å·²åå¨"); |
| | | } |
| | | if (userService.updateUserProfile(currentUser) > 0) |
| | | { |
| | | // æ´æ°ç¼åç¨æ·ä¿¡æ¯ |
| | | tokenService.setLoginUser(loginUser); |
| | | return success(); |
| | | } |
| | | return error("ä¿®æ¹ä¸ªäººä¿¡æ¯å¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | /** |
| | | * éç½®å¯ç |
| | | */ |
| | | @Log(title = "个人信æ¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/updatePwd") |
| | | public AjaxResult updatePwd(@RequestBody Map<String, String> params) |
| | | { |
| | | String oldPassword = params.get("oldPassword"); |
| | | String newPassword = params.get("newPassword"); |
| | | LoginUser loginUser = getLoginUser(); |
| | | String userName = loginUser.getUsername(); |
| | | String password = loginUser.getPassword(); |
| | | if (!SecurityUtils.matchesPassword(oldPassword, password)) |
| | | { |
| | | return error("ä¿®æ¹å¯ç å¤±è´¥ï¼æ§å¯ç é误"); |
| | | } |
| | | if (SecurityUtils.matchesPassword(newPassword, password)) |
| | | { |
| | | return error("æ°å¯ç ä¸è½ä¸æ§å¯ç ç¸å"); |
| | | } |
| | | newPassword = SecurityUtils.encryptPassword(newPassword); |
| | | if (userService.resetUserPwd(userName, newPassword) > 0) |
| | | { |
| | | // æ´æ°ç¼åç¨æ·å¯ç |
| | | loginUser.getUser().setPassword(newPassword); |
| | | tokenService.setLoginUser(loginUser); |
| | | return success(); |
| | | } |
| | | return error("ä¿®æ¹å¯ç å¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | /** |
| | | * 头åä¸ä¼ |
| | | */ |
| | | @Log(title = "ç¨æ·å¤´å", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/avatar") |
| | | public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception |
| | | { |
| | | if (!file.isEmpty()) |
| | | { |
| | | LoginUser loginUser = getLoginUser(); |
| | | String avatar = FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION); |
| | | if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("imgUrl", avatar); |
| | | // æ´æ°ç¼åç¨æ·å¤´å |
| | | loginUser.getUser().setAvatar(avatar); |
| | | tokenService.setLoginUser(loginUser); |
| | | return ajax; |
| | | } |
| | | } |
| | | return error("ä¸ä¼ å¾çå¼å¸¸ï¼è¯·è系管çå"); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.RegisterBody; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.service.SysRegisterService; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | |
| | | /** |
| | | * 注åéªè¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @Hidden |
| | | public class SysRegisterController extends BaseController |
| | | { |
| | | @Autowired |
| | | private SysRegisterService registerService; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @PostMapping("/register") |
| | | public AjaxResult register(@RequestBody RegisterBody user) |
| | | { |
| | | if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) |
| | | { |
| | | return error("å½åç³»ç»æ²¡æå¼å¯æ³¨ååè½ï¼"); |
| | | } |
| | | String msg = registerService.register(user); |
| | | return StringUtils.isEmpty(msg) ? success() : error(msg); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * è§è²ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/role") |
| | | @Hidden |
| | | public class SysRoleController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Autowired |
| | | private SysPermissionService permissionService; |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysRole role) |
| | | { |
| | | startPage(); |
| | | List<SysRole> list = roleService.selectRoleList(role); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:role:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysRole role) |
| | | { |
| | | List<SysRole> list = roleService.selectRoleList(role); |
| | | ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class); |
| | | util.exportExcel(response, list, "è§è²æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/{roleId}") |
| | | public AjaxResult getInfo(@PathVariable Long roleId) |
| | | { |
| | | roleService.checkRoleDataScope(roleId); |
| | | return success(roleService.selectRoleById(roleId)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:add')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysRole role) |
| | | { |
| | | if (!roleService.checkRoleNameUnique(role)) |
| | | { |
| | | return error("æ°å¢è§è²'" + role.getRoleName() + "'失败ï¼è§è²åç§°å·²åå¨"); |
| | | } |
| | | else if (!roleService.checkRoleKeyUnique(role)) |
| | | { |
| | | return error("æ°å¢è§è²'" + role.getRoleName() + "'失败ï¼è§è²æéå·²åå¨"); |
| | | } |
| | | role.setCreateBy(getUsername()); |
| | | return toAjax(roleService.insertRole(role)); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åè§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysRole role) |
| | | { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | if (!roleService.checkRoleNameUnique(role)) |
| | | { |
| | | return error("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è§è²åç§°å·²åå¨"); |
| | | } |
| | | else if (!roleService.checkRoleKeyUnique(role)) |
| | | { |
| | | return error("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è§è²æéå·²åå¨"); |
| | | } |
| | | role.setUpdateBy(getUsername()); |
| | | |
| | | if (roleService.updateRole(role) > 0) |
| | | { |
| | | // æ´æ°ç¼åç¨æ·æé |
| | | LoginUser loginUser = getLoginUser(); |
| | | if (StringUtils.isNotNull(loginUser.getUser()) && !loginUser.getUser().isAdmin()) |
| | | { |
| | | loginUser.setUser(userService.selectUserByUserName(loginUser.getUser().getUserName())); |
| | | loginUser.setPermissions(permissionService.getMenuPermission(loginUser.getUser())); |
| | | tokenService.setLoginUser(loginUser); |
| | | } |
| | | return success(); |
| | | } |
| | | return error("ä¿®æ¹è§è²'" + role.getRoleName() + "'失败ï¼è¯·è系管çå"); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åæ°æ®æé |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/dataScope") |
| | | public AjaxResult dataScope(@RequestBody SysRole role) |
| | | { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | return toAjax(roleService.authDataScope(role)); |
| | | } |
| | | |
| | | /** |
| | | * ç¶æä¿®æ¹ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysRole role) |
| | | { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | role.setUpdateBy(getUsername()); |
| | | return toAjax(roleService.updateRoleStatus(role)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:remove')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{roleIds}") |
| | | public AjaxResult remove(@PathVariable Long[] roleIds) |
| | | { |
| | | return toAjax(roleService.deleteRoleByIds(roleIds)); |
| | | } |
| | | |
| | | /** |
| | | * è·åè§è²éæ©æ¡å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() |
| | | { |
| | | return success(roleService.selectRoleAll()); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å·²åé
ç¨æ·è§è²å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/allocatedList") |
| | | public TableDataInfo allocatedList(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectAllocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æªåé
ç¨æ·è§è²å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @GetMapping("/authUser/unallocatedList") |
| | | public TableDataInfo unallocatedList(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectUnallocatedList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * åæ¶ææç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancel") |
| | | public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) |
| | | { |
| | | return toAjax(roleService.deleteAuthUser(userRole)); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éåæ¶ææç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/cancelAll") |
| | | public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) |
| | | { |
| | | return toAjax(roleService.deleteAuthUsers(roleId, userIds)); |
| | | } |
| | | |
| | | /** |
| | | * æ¹ééæ©ç¨æ·ææ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:edit')") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authUser/selectAll") |
| | | public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) |
| | | { |
| | | roleService.checkRoleDataScope(roleId); |
| | | return toAjax(roleService.insertAuthUsers(roleId, userIds)); |
| | | } |
| | | |
| | | /** |
| | | * è·å对åºè§è²é¨é¨æ å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping(value = "/deptTree/{roleId}") |
| | | public AjaxResult deptTree(@PathVariable("roleId") Long roleId) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); |
| | | ajax.put("depts", deptService.selectDeptTreeList(new SysDept())); |
| | | return ajax; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import io.swagger.v3.oas.annotations.Hidden; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysDept; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯ |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/user") |
| | | @Hidden |
| | | public class SysUserController extends BaseController |
| | | { |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | @Autowired |
| | | private ISysRoleService roleService; |
| | | |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | |
| | | /** |
| | | * è·åç¨æ·å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SysUser user) |
| | | { |
| | | startPage(); |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:user:export')") |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, SysUser user) |
| | | { |
| | | List<SysUser> list = userService.selectUserList(user); |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | util.exportExcel(response, list, "ç¨æ·æ°æ®"); |
| | | } |
| | | |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.IMPORT) |
| | | @PreAuthorize("@ss.hasPermi('system:user:import')") |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception |
| | | { |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | List<SysUser> userList = util.importExcel(file.getInputStream()); |
| | | String operName = getUsername(); |
| | | String message = userService.importUser(userList, updateSupport, operName); |
| | | return success(message); |
| | | } |
| | | |
| | | @PostMapping("/importTemplate") |
| | | public void importTemplate(HttpServletResponse response) |
| | | { |
| | | ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); |
| | | util.importTemplateExcel(response, "ç¨æ·æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·ç¼å·è·å详ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping(value = { "/", "/{userId}" }) |
| | | public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | if (StringUtils.isNotNull(userId)) |
| | | { |
| | | userService.checkUserDataScope(userId); |
| | | SysUser sysUser = userService.selectUserById(userId); |
| | | ajax.put(AjaxResult.DATA_TAG, sysUser); |
| | | ajax.put("postIds", postService.selectPostListByUserId(userId)); |
| | | ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); |
| | | } |
| | | List<SysRole> roles = roleService.selectRoleAll(); |
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | ajax.put("posts", postService.selectPostAll()); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:add')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysUser user) |
| | | { |
| | | deptService.checkDeptDataScope(user.getDeptId()); |
| | | roleService.checkRoleDataScope(user.getRoleIds()); |
| | | if (!userService.checkUserNameUnique(user)) |
| | | { |
| | | return error("æ°å¢ç¨æ·'" + user.getUserName() + "'失败ï¼ç»å½è´¦å·å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) |
| | | { |
| | | return error("æ°å¢ç¨æ·'" + user.getUserName() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) |
| | | { |
| | | return error("æ°å¢ç¨æ·'" + user.getUserName() + "'失败ï¼é®ç®±è´¦å·å·²åå¨"); |
| | | } |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | return toAjax(userService.insertUser(user)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysUser user) |
| | | { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | deptService.checkDeptDataScope(user.getDeptId()); |
| | | roleService.checkRoleDataScope(user.getRoleIds()); |
| | | if (!userService.checkUserNameUnique(user)) |
| | | { |
| | | return error("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'失败ï¼ç»å½è´¦å·å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) |
| | | { |
| | | return error("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'å¤±è´¥ï¼ææºå·ç å·²åå¨"); |
| | | } |
| | | else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) |
| | | { |
| | | return error("ä¿®æ¹ç¨æ·'" + user.getUserName() + "'失败ï¼é®ç®±è´¦å·å·²åå¨"); |
| | | } |
| | | user.setUpdateBy(getUsername()); |
| | | return toAjax(userService.updateUser(user)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç¨æ· |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:remove')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userIds}") |
| | | public AjaxResult remove(@PathVariable Long[] userIds) |
| | | { |
| | | if (ArrayUtils.contains(userIds, getUserId())) |
| | | { |
| | | return error("å½åç¨æ·ä¸è½å é¤"); |
| | | } |
| | | return toAjax(userService.deleteUserByIds(userIds)); |
| | | } |
| | | |
| | | /** |
| | | * éç½®å¯ç |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/resetPwd") |
| | | public AjaxResult resetPwd(@RequestBody SysUser user) |
| | | { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | user.setUpdateBy(getUsername()); |
| | | return toAjax(userService.resetPwd(user)); |
| | | } |
| | | |
| | | /** |
| | | * ç¶æä¿®æ¹ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public AjaxResult changeStatus(@RequestBody SysUser user) |
| | | { |
| | | userService.checkUserAllowed(user); |
| | | userService.checkUserDataScope(user.getUserId()); |
| | | user.setUpdateBy(getUsername()); |
| | | return toAjax(userService.updateUserStatus(user)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·ç¼å·è·åææè§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:query')") |
| | | @GetMapping("/authRole/{userId}") |
| | | public AjaxResult authRole(@PathVariable("userId") Long userId) |
| | | { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | SysUser user = userService.selectUserById(userId); |
| | | List<SysRole> roles = roleService.selectRolesByUserId(userId); |
| | | ajax.put("user", user); |
| | | ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·ææè§è² |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @Log(title = "ç¨æ·ç®¡ç", businessType = BusinessType.GRANT) |
| | | @PutMapping("/authRole") |
| | | public AjaxResult insertAuthRole(Long userId, Long[] roleIds) |
| | | { |
| | | userService.checkUserDataScope(userId); |
| | | roleService.checkRoleDataScope(roleIds); |
| | | userService.insertUserAuth(userId, roleIds); |
| | | return success(); |
| | | } |
| | | |
| | | /** |
| | | * è·åé¨é¨æ å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/deptTree") |
| | | public AjaxResult deptTree(SysDept dept) |
| | | { |
| | | return success(deptService.selectDeptTreeList(dept)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.ruoyi.web.core.config; |
| | | // |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.context.annotation.Bean; |
| | | //import org.springframework.context.annotation.Configuration; |
| | | //import com.ruoyi.common.config.RuoYiConfig; |
| | | //import io.swagger.v3.oas.models.Components; |
| | | //import io.swagger.v3.oas.models.OpenAPI; |
| | | //import io.swagger.v3.oas.models.info.Contact; |
| | | //import io.swagger.v3.oas.models.info.Info; |
| | | //import io.swagger.v3.oas.models.security.SecurityRequirement; |
| | | //import io.swagger.v3.oas.models.security.SecurityScheme; |
| | | // |
| | | ///** |
| | | // * Swagger2çæ¥å£é
ç½® |
| | | // * |
| | | // * @author ruoyi |
| | | // */ |
| | | //@Configuration |
| | | //public class SwaggerConfig { |
| | | // /** |
| | | // * ç³»ç»åºç¡é
ç½® |
| | | // */ |
| | | // @Autowired |
| | | // private RuoYiConfig ruoyiConfig; |
| | | // |
| | | // /** |
| | | // * èªå®ä¹ç OpenAPI 对象 |
| | | // */ |
| | | // @Bean |
| | | // public OpenAPI customOpenApi() { |
| | | // return new OpenAPI().components(new Components() |
| | | // // 设置认è¯ç请æ±å¤´ |
| | | // .addSecuritySchemes("apikey", securityScheme())) |
| | | // .addSecurityItem(new SecurityRequirement().addList("apikey")) |
| | | // .info(getApiInfo()); |
| | | // } |
| | | // |
| | | // @Bean |
| | | // public SecurityScheme securityScheme() { |
| | | // return new SecurityScheme() |
| | | // .type(SecurityScheme.Type.APIKEY) |
| | | // .name("Authorization") |
| | | // .in(SecurityScheme.In.HEADER) |
| | | // .scheme("Bearer"); |
| | | // } |
| | | // |
| | | // /** |
| | | // * æ·»å æè¦ä¿¡æ¯ |
| | | // */ |
| | | // public Info getApiInfo() { |
| | | // return new Info() |
| | | // // 设置æ é¢ |
| | | // .title("æ é¢ï¼æºæ
§æ¸¯å£_æ¥å£ææ¡£") |
| | | // // æè¿° |
| | | // .description("æè¿°ï¼æºæ
§æ¸¯å£") |
| | | // // ä½è
ä¿¡æ¯ |
| | | // .contact(new Contact().name(ruoyiConfig.getName())) |
| | | // // çæ¬ |
| | | // .version("çæ¬å·:" + ruoyiConfig.getVersion()); |
| | | // } |
| | | //} |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.core.config; |
| | | |
| | | import com.github.xiaoymin.knife4j.spring.configuration.Knife4jProperties; |
| | | import org.springdoc.core.models.GroupedOpenApi; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Configuration |
| | | public class SwaggerConfiguration { |
| | | |
| | | /** |
| | | * é
ç½® OpenAPI Group |
| | | * @return GroupedOpenApi |
| | | */ |
| | | @Bean |
| | | public GroupedOpenApi publicApi() { |
| | | return GroupedOpenApi.builder() |
| | | .group("public") // å®ä¹åç»åç§° |
| | | .packagesToScan("com.ruoyi.web.controller", "com.ruoyi.buss.controller") // æ«ææ§å¶å¨æå¨çå
|
| | | .build(); |
| | | } |
| | | |
| | | /** |
| | | * é
ç½® Knife4j |
| | | * @return Knife4jProperties |
| | | */ |
| | | // @Bean |
| | | // public Knife4jProperties knife4jProperties() { |
| | | // Knife4jProperties knife4jProperties = new Knife4jProperties(); |
| | | // knife4jProperties.setEnable(true); // å¯ç¨ Knife4j |
| | | // return knife4jProperties; |
| | | // } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web.webSocket; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.ruoyi.fuzhou.domain.*; |
| | | import com.ruoyi.fuzhou.enums.DataTypeEnum; |
| | | import com.ruoyi.fuzhou.service.*; |
| | | import com.ruoyi.manage.domain.DsTaskList; |
| | | import com.ruoyi.manage.service.DsTaskListService; |
| | | import jakarta.websocket.*; |
| | | import jakarta.websocket.server.PathParam; |
| | | import jakarta.websocket.server.ServerEndpoint; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.ScheduledExecutorService; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @ServerEndpoint("/dp/sendOil/{userId}") |
| | | @Component |
| | | public class WebSocketEquServer implements ApplicationContextAware { |
| | | private final static Logger log = LoggerFactory.getLogger(WebSocketEquServer.class); |
| | | /** |
| | | * å¨çº¿äººæ° |
| | | */ |
| | | private static int onlineCount = 0; |
| | | /** |
| | | * å¨çº¿äººåsession |
| | | */ |
| | | private static ConcurrentHashMap<String, WebSocketEquServer> webSocketMap = new ConcurrentHashMap<>(); |
| | | /** |
| | | * ä¸æä¸ªå®¢æ·ç«¯çè¿æ¥ä¼è¯ï¼éè¦éè¿å®æ¥ç»å®¢æ·ç«¯åéæ°æ® |
| | | */ |
| | | private Session session; |
| | | /** |
| | | * æ¥æ¶userId |
| | | */ |
| | | private String userId = ""; |
| | | |
| | | //宿¶ä»»å¡ |
| | | private ScheduledExecutorService scheduler; |
| | | //æ³ä½ID |
| | | private Integer beId = 0; |
| | | private static final Object lock = new Object(); |
| | | |
| | | private static ApplicationContext context; |
| | | |
| | | @Override |
| | | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
| | | context = applicationContext; |
| | | } |
| | | |
| | | public static <T> T getBean(Class<T> beanClass) { |
| | | return context.getBean(beanClass); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * è¿æ¥å»ºç«æåè°ç¨çæ¹æ³ |
| | | */ |
| | | @OnOpen |
| | | public void onOpen(Session session, @PathParam("userId") String userId) { |
| | | this.session = session; |
| | | this.userId = userId; |
| | | if (webSocketMap.containsKey(userId)) { |
| | | webSocketMap.remove(userId); |
| | | webSocketMap.put(userId, this); |
| | | } else { |
| | | webSocketMap.put(userId, this); |
| | | } |
| | | try { |
| | | sendMessage("è¿æ¥æå"); |
| | | } catch (IOException e) { |
| | | log.error("ç¨æ·:" + userId + ",ç½ç»å¼å¸¸!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * è¿æ¥å
³éè°ç¨çæ¹æ³ |
| | | */ |
| | | @OnClose |
| | | public void onClose() { |
| | | if (scheduler != null) { |
| | | scheduler.shutdown(); |
| | | } |
| | | if (webSocketMap.containsKey(userId)) { |
| | | webSocketMap.remove(userId); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¶å°å®¢æ·ç«¯æ¶æ¯åè°ç¨çæ¹æ³ |
| | | * |
| | | * @param message 客æ·ç«¯åéè¿æ¥çæ¶æ¯ |
| | | */ |
| | | @OnMessage |
| | | public void onMessage(String message, Session session) { |
| | | JSONObject beObject = JSONObject.parseObject(message); |
| | | String type = beObject.getString("type"); |
| | | try { |
| | | beId = Integer.parseInt(beObject.getString("beId")); |
| | | if (!type.isEmpty() && type.equals("startSupply") && beId != null && beId != 0) { |
| | | //åå»ºå®æ¶ä»»å¡ |
| | | scheduler = Executors.newSingleThreadScheduledExecutor(); |
| | | //æ¯10ç§æ§è¡ä¸æ¬¡ |
| | | scheduler.scheduleAtFixedRate(() -> { |
| | | try { |
| | | synchronized (lock) { |
| | | if (session != null && session.isOpen()) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("type", "Supply"); |
| | | EquipmentService equipmentService = getBean(EquipmentService.class); |
| | | LambdaQueryWrapper<DpEquipment> oilWrapper = new LambdaQueryWrapper<>(); |
| | | oilWrapper.eq(DpEquipment::getBeId, beId) |
| | | .in(DpEquipment::getEquipmentTypeId, DataTypeEnum.LIJIUOIL.getCode(), DataTypeEnum.OIL.getCode(), DataTypeEnum.LIJIUJUN.getCode()) |
| | | .orderByAsc(DpEquipment::getId); |
| | | List<DpEquipment> oilList = equipmentService.list(oilWrapper); |
| | | JSONArray oilArray = new JSONArray(); |
| | | for (DpEquipment dpEquipment : oilList) { |
| | | ReceiveOilValue oilValue = (ReceiveOilValue) equDataList(dpEquipment.getId()); |
| | | if (oilValue != null) { |
| | | oilValue.setId(dpEquipment.getId().longValue()); |
| | | } |
| | | oilArray.add(oilValue); |
| | | } |
| | | jsonObject.put("oil", oilArray); |
| | | |
| | | LambdaQueryWrapper<DpEquipment> waterWrapper = new LambdaQueryWrapper<>(); |
| | | waterWrapper.eq(DpEquipment::getBeId, beId) |
| | | .eq(DpEquipment::getEquipmentTypeId, 2) |
| | | .orderByAsc(DpEquipment::getId); |
| | | List<DpEquipment> waterList = equipmentService.list(waterWrapper); |
| | | JSONArray waterArray = new JSONArray(); |
| | | for (DpEquipment dpEquipment : waterList) { |
| | | ReceiveWaterValue waterValue = (ReceiveWaterValue) equDataList(dpEquipment.getId()); |
| | | if (waterValue != null) { |
| | | waterValue.setId(dpEquipment.getId().longValue()); |
| | | } |
| | | waterArray.add(waterValue); |
| | | } |
| | | jsonObject.put("water", waterArray); |
| | | |
| | | LambdaQueryWrapper<DpEquipment> elecWrapper = new LambdaQueryWrapper<>(); |
| | | elecWrapper.eq(DpEquipment::getBeId, beId) |
| | | .eq(DpEquipment::getEquipmentTypeId, 3) |
| | | .orderByAsc(DpEquipment::getId); |
| | | List<DpEquipment> elecList = equipmentService.list(elecWrapper); |
| | | JSONArray elecArray = new JSONArray(); |
| | | for (DpEquipment dpEquipment : elecList) { |
| | | ReceiveElectricityValue electricityValue = (ReceiveElectricityValue) equDataList(dpEquipment.getId()); |
| | | if (electricityValue != null) { |
| | | electricityValue.setId(dpEquipment.getId().longValue()); |
| | | } |
| | | elecArray.add(electricityValue); |
| | | } |
| | | jsonObject.put("elec", elecArray); |
| | | |
| | | DsTaskListService dsTaskListService = getBean(DsTaskListService.class); |
| | | |
| | | // QueryWrapper<DsTaskList> queryWrapper = new QueryWrapper<>(); |
| | | // queryWrapper.eq("BERTH_ID", beId).orderByDesc("PKID").last("LIMIT 1"); |
| | | |
| | | // String rfidNumStr = dsTaskList.getRfidNum(); |
| | | |
| | | QueryWrapper<DsTaskList> queryWrapperTask = new QueryWrapper<>(); |
| | | queryWrapperTask.eq("TASK_ID",999).orderByDesc("CREATE_TIME").last("LIMIT 1"); |
| | | DsTaskList dsTaskList = dsTaskListService.getOne(queryWrapperTask); |
| | | |
| | | String rfidNumStr = dsTaskList.getTaskId()+dsTaskList.getShipNo(); |
| | | //æ ¹æ®ä»»å¡å表ä¸çrfidNumæ¥è¯¢RFIDä»»å¡ |
| | | List<DpRfidTask> rfidTaskList = GetRfidTaskList(rfidNumStr); |
| | | jsonObject.put("RFID_Task", rfidTaskList); |
| | | |
| | | //RFIDä»»å¡GoodsListä¸è·åç©åä¿¡æ¯ |
| | | // if(rfidTaskList.size()>0){ |
| | | // DpRfidTask dpRfidTask = rfidTaskList.get(0); |
| | | // JSONArray jsonArray = JSON.parseArray(dpRfidTask.getGoodsList().toString()); |
| | | // JSONObject goods = jsonArray.getJSONObject(0); |
| | | // String rfidNum = goods.getString("rfid"); |
| | | // } |
| | | |
| | | //æ ¹æ®ä»»å¡å表ä¸çrfidNumæ¥è¯¢RFIDè½¦è¾æ°æ® |
| | | List<DpRfidVehicle> vehicleList = GetVehicleList(rfidNumStr); |
| | | jsonObject.put("RFID_Vehicle", vehicleList); |
| | | |
| | | sendMessage(jsonObject.toString()); |
| | | |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }, 0, 10, TimeUnit.SECONDS |
| | | |
| | | ); |
| | | } else if (type.equals("endSupply")) { |
| | | onClose(); |
| | | } else { |
| | | sendMessage("ä¼ å失败"); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | log.error("å¿è·³å¤±è´¥ï¼å®¢æ·ç«¯å·²æçº¿", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @param session |
| | | * @param error |
| | | */ |
| | | @OnError |
| | | public void onError(Session session, Throwable error) { |
| | | log.error("ç¨æ·é误:" + this.userId + ",åå :" + error.getMessage()); |
| | | error.printStackTrace(); |
| | | } |
| | | |
| | | /** |
| | | * å®ç°æå¡å¨ä¸»å¨æ¨é |
| | | */ |
| | | public void sendMessage(String message) throws IOException { |
| | | this.session.getBasicRemote().sendText(message); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åéèªå®ä¹æ¶æ¯ |
| | | */ |
| | | public static void sendInfo(String message, @PathParam("userId") String userId) throws IOException { |
| | | log.info("åéæ¶æ¯å°:" + userId + "ï¼æ¥æ:" + message); |
| | | if (StringUtils.isNotBlank(userId) && webSocketMap.containsKey(userId)) { |
| | | webSocketMap.get(userId).sendMessage(message); |
| | | } else { |
| | | log.error("ç¨æ·" + userId + ",ä¸å¨çº¿ï¼"); |
| | | } |
| | | } |
| | | |
| | | public static synchronized int getOnlineCount() { |
| | | return onlineCount; |
| | | } |
| | | |
| | | public static synchronized void addOnlineCount() { |
| | | WebSocketEquServer.onlineCount++; |
| | | } |
| | | |
| | | public static synchronized void subOnlineCount() { |
| | | WebSocketEquServer.onlineCount--; |
| | | } |
| | | |
| | | /** |
| | | * å®ç°æå¡å¨ä¸»å¨æ¨é |
| | | */ |
| | | public static void sendAllMessage(String message) { |
| | | Iterator<String> key = webSocketMap.keys().asIterator(); |
| | | while (key.hasNext()) { |
| | | String strList = (String) key.next(); |
| | | try { |
| | | log.info(strList); |
| | | webSocketMap.get(strList).sendMessage(message); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("æ¨é失败:", e); |
| | | } |
| | | } |
| | | } |
| | | //æ ¹æ®FIELD_NAMEæ¥è¯¢è®¾å¤è¯¦æ
ç»çº¬åº¦ï¼RFIDï¼ |
| | | private DpEquipment GetEquipmentByFieldName(String fieldName){ |
| | | EquipmentService equipmentService = getBean(EquipmentService.class); |
| | | QueryWrapper<DpEquipment> equipmentQueryWrapper = new QueryWrapper<>(); |
| | | equipmentQueryWrapper.eq("FIELD_NAME", fieldName); |
| | | return equipmentService.getOne(equipmentQueryWrapper); |
| | | } |
| | | //æ ¹æ®ä»»å¡å表ä¸çrfidNumæ¥è¯¢RFIDè½¦è¾æ°æ® |
| | | private List<DpRfidVehicle> GetVehicleList(String rfidNumStr){ |
| | | DpRfidVehicleService dpRfidVehicleService = getBean(DpRfidVehicleService.class); |
| | | List<DpRfidVehicle> rfidVehicleList = new ArrayList<>(); |
| | | |
| | | DpRfidVehicle rfidVehicle = dpRfidVehicleService.QueryVehicleByTask(rfidNumStr); |
| | | DpEquipment equipment = GetEquipmentByFieldName(rfidVehicle.getSn()); |
| | | |
| | | rfidVehicle.setEquId(equipment.getId()); |
| | | rfidVehicle.setX(equipment.getX()); |
| | | rfidVehicle.setY(equipment.getY()); |
| | | rfidVehicle.setZ(equipment.getZ()); |
| | | rfidVehicleList.add(rfidVehicle); |
| | | return rfidVehicleList; |
| | | } |
| | | //æ ¹æ®ä»»å¡å表ä¸çrfidNumæ¥è¯¢RFIDä»»å¡ |
| | | private List<DpRfidTask> GetRfidTaskList(String rfidNumStr){ |
| | | DpRfidTaskService dpRfidTaskService = getBean(DpRfidTaskService.class); |
| | | LambdaQueryWrapper<DpRfidTask> rfidTaskWrapper = new LambdaQueryWrapper<>(); |
| | | List<DpRfidTask> rfidTaskList = new ArrayList<>(); |
| | | rfidTaskWrapper.like(DpRfidTask::getWzData, rfidNumStr).orderByDesc(DpRfidTask::getPassTime).last("LIMIT 1"); |
| | | rfidTaskList = dpRfidTaskService.list(rfidTaskWrapper); |
| | | return rfidTaskList; |
| | | } |
| | | |
| | | private Object equDataList(Integer id) { |
| | | EquipmentService equipmentService = getBean(EquipmentService.class); |
| | | ReceiveOilValueService receiveOilValueService = getBean(ReceiveOilValueService.class); |
| | | ReceiveWaterValueService receiveWaterValueService = getBean(ReceiveWaterValueService.class); |
| | | ReceiveElectricityValueService receiveElectricityValueService = getBean(ReceiveElectricityValueService.class); |
| | | DpEquipment receiveInfo = equipmentService.getById(id); |
| | | if (receiveInfo == null) { |
| | | return new Object(); |
| | | } |
| | | if (DataTypeEnum.LIJIUOIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.OIL.getCode().equals(receiveInfo.getEquipmentTypeId()) || |
| | | DataTypeEnum.LIJIUJUN.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return receiveOilValueService.getOne(new LambdaQueryWrapper<ReceiveOilValue>() {{ |
| | | or().eq(ReceiveOilValue::getDeviceName, String.valueOf(receiveInfo.getId())) |
| | | .orderByDesc(ReceiveOilValue::getCreateTime).last("LIMIT 1"); |
| | | }}); |
| | | } else if (DataTypeEnum.WATER_FLOW.getCode().equals(receiveInfo.getEquipmentTypeId()) || DataTypeEnum.WATER_YA.getCode().equals(receiveInfo.getEquipmentTypeId()) |
| | | || DataTypeEnum.WATER_DEPT.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return receiveWaterValueService.getOne(new LambdaQueryWrapper<ReceiveWaterValue>() {{ |
| | | or().eq(ReceiveWaterValue::getDeviceName, String.valueOf(receiveInfo.getId())) |
| | | .orderByDesc(ReceiveWaterValue::getCreateTime).last("LIMIT 1"); |
| | | }}); |
| | | } else if (DataTypeEnum.ELECTRICITY.getCode().equals(receiveInfo.getEquipmentTypeId())) { |
| | | return receiveElectricityValueService.getOne(new LambdaQueryWrapper<ReceiveElectricityValue>() {{ |
| | | or().eq(ReceiveElectricityValue::getDeviceName, String.valueOf(receiveInfo.getId())) |
| | | .orderByDesc(ReceiveElectricityValue::getCreateTime).last("LIMIT 1"); |
| | | }}); |
| | | } |
| | | return new Object(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | restart.include.json=/com.alibaba.fastjson2.*.jar |
¶Ô±ÈÐÂÎļþ |
| | |
| | | # æ°æ®æºé
ç½® |
| | | spring: |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: dm.jdbc.driver.DmDriver |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | url: jdbc:dm://127.0.0.1:5236?schema=SYSDBA |
| | | # url: jdbc:dm://192.168.0.4:5236?schema=SYSDBA |
| | | username: SYSDBA |
| | | password: Sysdba2025! |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é |
| | | enabled: true |
| | | url: jdbc:dm://127.0.0.1:5236?schema=DATABASE |
| | | # url: jdbc:dm://192.168.0.4:5236?schema=DATABASE |
| | | username: SYSDBA |
| | | password: Sysdba2025! |
| | | # åå§è¿æ¥æ° |
| | | initialSize: 5 |
| | | # æå°è¿æ¥æ± æ°é |
| | | minIdle: 10 |
| | | # æå¤§è¿æ¥æ± æ°é |
| | | maxActive: 20 |
| | | # é
ç½®è·åè¿æ¥çå¾
è¶
æ¶çæ¶é´ |
| | | maxWait: 60000 |
| | | # é
ç½®è¿æ¥è¶
æ¶æ¶é´ |
| | | connectTimeout: 30000 |
| | | # é
ç½®ç½ç»è¶
æ¶æ¶é´ |
| | | socketTimeout: 60000 |
| | | # é
ç½®é´éå¤ä¹
æè¿è¡ä¸æ¬¡æ£æµï¼æ£æµéè¦å
³éç空é²è¿æ¥ï¼å使¯æ¯«ç§ |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿å°çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿大çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # é
ç½®æ£æµè¿æ¥æ¯å¦ææ |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: true |
| | | # 设置ç½ååï¼ä¸å¡«åå
许ææè®¿é® |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # æ§å¶å°ç®¡çç¨æ·ååå¯ç |
| | | login-username: ruoyi |
| | | login-password: 123456 |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
¶Ô±ÈÐÂÎļþ |
| | |
| | | # æ°æ®æºé
ç½® |
| | | spring: |
| | | jackson: |
| | | date-format: yyyy-MM-dd HH:mm:ss |
| | | time-zone: GMT+8 |
| | | datasource: |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | driverClassName: dm.jdbc.driver.DmDriver |
| | | druid: |
| | | # ä¸»åºæ°æ®æº |
| | | master: |
| | | url: jdbc:dm://10.1.10.10:5236?schema=SYSDBA |
| | | username: SYSDBA |
| | | password: Sysdba2025! |
| | | # ä»åºæ°æ®æº |
| | | slave: |
| | | # 仿°æ®æºå¼å
³/é»è®¤å
³é |
| | | enabled: true |
| | | url: jdbc:dm://10.1.10.10:5236?schema=DATABASE |
| | | username: SYSDBA |
| | | password: Sysdba2025! |
| | | # åå§è¿æ¥æ° |
| | | initialSize: 5 |
| | | # æå°è¿æ¥æ± æ°é |
| | | minIdle: 10 |
| | | # æå¤§è¿æ¥æ± æ°é |
| | | maxActive: 20 |
| | | # é
ç½®è·åè¿æ¥çå¾
è¶
æ¶çæ¶é´ |
| | | maxWait: 60000 |
| | | # é
ç½®è¿æ¥è¶
æ¶æ¶é´ |
| | | connectTimeout: 30000 |
| | | # é
ç½®ç½ç»è¶
æ¶æ¶é´ |
| | | socketTimeout: 60000 |
| | | # é
ç½®é´éå¤ä¹
æè¿è¡ä¸æ¬¡æ£æµï¼æ£æµéè¦å
³éç空é²è¿æ¥ï¼å使¯æ¯«ç§ |
| | | timeBetweenEvictionRunsMillis: 60000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿å°çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | minEvictableIdleTimeMillis: 300000 |
| | | # é
ç½®ä¸ä¸ªè¿æ¥å¨æ± 䏿大çåçæ¶é´ï¼å使¯æ¯«ç§ |
| | | maxEvictableIdleTimeMillis: 900000 |
| | | # é
ç½®æ£æµè¿æ¥æ¯å¦ææ |
| | | validationQuery: SELECT 1 FROM DUAL |
| | | testWhileIdle: true |
| | | testOnBorrow: false |
| | | testOnReturn: false |
| | | webStatFilter: |
| | | enabled: true |
| | | statViewServlet: |
| | | enabled: true |
| | | # 设置ç½ååï¼ä¸å¡«åå
许ææè®¿é® |
| | | allow: |
| | | url-pattern: /druid/* |
| | | # æ§å¶å°ç®¡çç¨æ·ååå¯ç |
| | | login-username: ruoyi |
| | | login-password: 123456 |
| | | filter: |
| | | stat: |
| | | enabled: true |
| | | # æ
¢SQLè®°å½ |
| | | log-slow-sql: true |
| | | slow-sql-millis: 1000 |
| | | merge-sql: true |
| | | wall: |
| | | config: |
| | | multi-statement-allow: true |
¶Ô±ÈÐÂÎļþ |
| | |
| | | # 项ç®ç¸å
³é
ç½® |
| | | ruoyi: |
| | | # åç§° |
| | | name: RuoYi |
| | | # çæ¬ |
| | | version: 3.8.9 |
| | | # çæå¹´ä»½ |
| | | copyrightYear: 2025 |
| | | # æä»¶è·¯å¾ 示ä¾ï¼ Windowsé
ç½®D:/ruoyi/uploadPathï¼Linuxé
ç½® /home/ruoyi/uploadPathï¼ |
| | | profile: /home/ruoyi/uploadPath |
| | | # jsonä¸´æ¶æä»¶è·¯å¾ ç¤ºä¾ï¼ Windowsé
ç½®D:/ruoyi/jsonï¼Linuxé
ç½® /home/ruoyi/jsonï¼ |
| | | json: /home/ruoyi/json |
| | | # è·åipå°åå¼å
³ |
| | | addressEnabled: false |
| | | # éªè¯ç ç±»å math æ°åè®¡ç® char å符éªè¯ |
| | | captchaType: math |
| | | bussRfidUrl: http://10.1.10.11:10800/open/goods/task |
| | | |
| | | knife4j: |
| | | # å¼å¯å¢å¼ºé
ç½® |
| | | enable: true |
| | | title: ç¦å· |
| | | description: æ¥å£ææ¡£ |
| | | version: 1.0.0 |
| | | |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| | | port: 8095 |
| | | servlet: |
| | | # åºç¨ç访é®è·¯å¾ |
| | | context-path: / |
| | | tomcat: |
| | | # tomcatçURIç¼ç |
| | | uri-encoding: UTF-8 |
| | | # è¿æ¥æ°æ»¡åçæéæ°ï¼é»è®¤ä¸º100 |
| | | accept-count: 1000 |
| | | threads: |
| | | # tomcatæå¤§çº¿ç¨æ°ï¼é»è®¤ä¸º200 |
| | | max: 800 |
| | | # Tomcatå¯å¨åå§åççº¿ç¨æ°ï¼é»è®¤å¼10 |
| | | min-spare: 100 |
| | | |
| | | # æ¥å¿é
ç½® |
| | | logging: |
| | | level: |
| | | com.ruoyi: debug |
| | | org.springframework: warn |
| | | |
| | | # ç¨æ·é
ç½® |
| | | user: |
| | | password: |
| | | # å¯ç æå¤§éè¯¯æ¬¡æ° |
| | | maxRetryCount: 5 |
| | | # å¯ç é宿¶é´ï¼é»è®¤10åéï¼ |
| | | lockTime: 10 |
| | | |
| | | # Springé
ç½® |
| | | spring: |
| | | jackson: |
| | | date-format: yyyy-MM-dd HH:mm:ss |
| | | time-zone: GMT+8 |
| | | # èµæºä¿¡æ¯ |
| | | messages: |
| | | # å½é
åèµæºæä»¶è·¯å¾ |
| | | basename: i18n/messages |
| | | profiles: |
| | | active: dev |
| | | # active: prod |
| | | # æä»¶ä¸ä¼ |
| | | servlet: |
| | | multipart: |
| | | # å个æä»¶å¤§å° |
| | | max-file-size: 1024MB |
| | | # 设置æ»ä¸ä¼ çæä»¶å¤§å° |
| | | max-request-size: 4096MB |
| | | # æå¡æ¨¡å |
| | | devtools: |
| | | restart: |
| | | # çé¨ç½²å¼å
³ |
| | | enabled: true |
| | | data: |
| | | # redis é
ç½® |
| | | redis: |
| | | # å°å |
| | | host: 127.0.0.1 |
| | | # 端å£ï¼é»è®¤ä¸º6379 |
| | | port: 6369 |
| | | # æ°æ®åºç´¢å¼ |
| | | database: 0 |
| | | # å¯ç |
| | | password: rediS_5L#F4_Server |
| | | # è¿æ¥è¶
æ¶æ¶é´ |
| | | timeout: 10s |
| | | lettuce: |
| | | pool: |
| | | # è¿æ¥æ± ä¸çæå°ç©ºé²è¿æ¥ |
| | | min-idle: 0 |
| | | # è¿æ¥æ± ä¸çæå¤§ç©ºé²è¿æ¥ |
| | | max-idle: 8 |
| | | # è¿æ¥æ± çæå¤§æ°æ®åºè¿æ¥æ° |
| | | max-active: 8 |
| | | # #è¿æ¥æ± æå¤§é»å¡çå¾
æ¶é´ï¼ä½¿ç¨è´å¼è¡¨ç¤ºæ²¡æéå¶ï¼ |
| | | max-wait: -1ms |
| | | mvc: |
| | | throw-exception-if-no-handler-found: false |
| | | static-path-pattern: "/**" |
| | | web: |
| | | resources: |
| | | add-mappings: true |
| | | |
| | | # tokené
ç½® |
| | | token: |
| | | # 令çèªå®ä¹æ è¯ |
| | | header: Authorization |
| | | # 令çå¯é¥ |
| | | secret: abcdefghijklmnopqrstuvwxyz |
| | | # ä»¤çæææï¼é»è®¤30åéï¼ |
| | | expireTime: 60 |
| | | |
| | | mybatis-plus: |
| | | type-aliases-package: com.ruoyi.**.domain |
| | | mapper-locations: classpath*:mapper/**/*Mapper.xml |
| | | config-location: classpath:mybatis/mybatis-config.xml |
| | | |
| | | # PageHelperå页æä»¶ |
| | | pagehelper: |
| | | helperDialect: mysql |
| | | supportMethodsArguments: true |
| | | params: count=countSql |
| | | |
| | | # Springdocé
ç½® |
| | | springdoc: |
| | | swagger-ui: |
| | | path: /swagger-ui.html # Swagger UI 访é®è·¯å¾ |
| | | api-docs: |
| | | path: /v3/api-docs |
| | | |
| | | # 鲿¢XSSæ»å» |
| | | xss: |
| | | # è¿æ»¤å¼å
³ |
| | | enabled: true |
| | | # æé¤é¾æ¥ï¼å¤ä¸ªç¨éå·åéï¼ |
| | | excludes: /system/notice |
| | | # å¹é
龿¥ |
| | | urlPatterns: /system/*,/monitor/*,/tool/* |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Application Version: ${ruoyi.version} |
| | | Spring Boot Version: ${spring-boot.version} |
| | | __ __ |
| | | /\ \__ /\ \__ |
| | | _ __ __ _____ ___ _ __\ \ ,_\ ____ __ __ ____\ \ ,_\ __ ___ ___ |
| | | /\`'__\/'__`\/\ '__`\ / __`\/\`'__\ \ \/ /',__\/\ \/\ \ /',__\\ \ \/ /'__`\/' __` __`\ |
| | | \ \ \//\ __/\ \ \L\ \/\ \L\ \ \ \/ \ \ \_ /\__, `\ \ \_\ \/\__, `\\ \ \_/\ __//\ \/\ \/\ \ |
| | | \ \_\\ \____\\ \ ,__/\ \____/\ \_\ \ \__\ \/\____/\/`____ \/\____/ \ \__\ \____\ \_\ \_\ \_\ |
| | | \/_/ \/____/ \ \ \/ \/___/ \/_/ \/__/ \/___/ `/___/> \/___/ \/__/\/____/\/_/\/_/\/_/ |
| | | \ \_\ /\___/ |
| | | \/_/ \/__/ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | #éè¯¯æ¶æ¯ |
| | | not.null=* å¿
须填å |
| | | user.jcaptcha.error=éªè¯ç é误 |
| | | user.jcaptcha.expire=éªè¯ç 已失æ |
| | | user.not.exists=ç¨æ·ä¸åå¨/å¯ç é误 |
| | | user.password.not.match=ç¨æ·ä¸åå¨/å¯ç é误 |
| | | user.password.retry.limit.count=å¯ç è¾å
¥é误{0}次 |
| | | user.password.retry.limit.exceed=å¯ç è¾å
¥é误{0}次ï¼å¸æ·éå®{1}åé |
| | | user.password.delete=对ä¸èµ·ï¼æ¨çè´¦å·å·²è¢«å é¤ |
| | | user.blocked=ç¨æ·å·²å°ç¦ï¼è¯·è系管çå |
| | | role.blocked=è§è²å·²å°ç¦ï¼è¯·è系管çå |
| | | login.blocked=å¾éæ¾ï¼è®¿é®IP已被åå
¥ç³»ç»é»åå |
| | | user.logout.success=éåºæå |
| | | |
| | | length.not.valid=é¿åº¦å¿
é¡»å¨{min}å°{max}个å符ä¹é´ |
| | | |
| | | user.username.not.valid=* 2å°20个æ±åãåæ¯ãæ°åæä¸åçº¿ç»æï¼ä¸å¿
须以鿰åå¼å¤´ |
| | | user.password.not.valid=* 5-50个å符 |
| | | |
| | | user.email.not.valid=é®ç®±æ ¼å¼é误 |
| | | user.mobile.phone.number.not.valid=ææºå·æ ¼å¼é误 |
| | | user.login.success=ç»å½æå |
| | | user.register.success=注åæå |
| | | user.notfound=è¯·éæ°ç»å½ |
| | | user.forcelogout=管çå强å¶éåºï¼è¯·éæ°ç»å½ |
| | | user.unknown.error=æªç¥é误ï¼è¯·éæ°ç»å½ |
| | | |
| | | ##æä»¶ä¸ä¼ æ¶æ¯ |
| | | upload.exceed.maxSize=ä¸ä¼ çæä»¶å¤§å°è¶
åºéå¶çæä»¶å¤§å°ï¼<br/>å
许çæä»¶æå¤§å¤§å°æ¯ï¼{0}MBï¼ |
| | | upload.filename.exceed.length=ä¸ä¼ çæä»¶åæé¿{0}个å符 |
| | | |
| | | ##æé |
| | | no.permission=æ¨æ²¡ææ°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
| | | no.create.permission=æ¨æ²¡æåå»ºæ°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
| | | no.update.permission=æ¨æ²¡æä¿®æ¹æ°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
| | | no.delete.permission=æ¨æ²¡æå 餿°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
| | | no.export.permission=æ¨æ²¡æå¯¼åºæ°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
| | | no.view.permission=æ¨æ²¡ææ¥çæ°æ®çæéï¼è¯·è系管çåæ·»å æé [{0}] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration> |
| | | <!-- æ¥å¿åæ¾è·¯å¾ --> |
| | | <property name="log.path" value="/home/ruoyi/logs" /> |
| | | <!-- æ¥å¿è¾åºæ ¼å¼ --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | | <!-- æ§å¶å°è¾åº --> |
| | | <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- ç³»ç»æ¥å¿è¾åº --> |
| | | <appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-info.log</file> |
| | | <!-- å¾ªç¯æ¿çï¼åºäºæ¶é´å建æ¥å¿æä»¶ --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- æ¥å¿æä»¶åæ ¼å¼ --> |
| | | <fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- æ¥å¿æå¤§çåå² 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- è¿æ»¤ççº§å« --> |
| | | <level>INFO</level> |
| | | <!-- å¹é
æ¶çæä½ï¼æ¥æ¶ï¼è®°å½ï¼ --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- ä¸å¹é
æ¶çæä½ï¼æç»ï¼ä¸è®°å½ï¼ --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-error.log</file> |
| | | <!-- å¾ªç¯æ¿çï¼åºäºæ¶é´å建æ¥å¿æä»¶ --> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- æ¥å¿æä»¶åæ ¼å¼ --> |
| | | <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- æ¥å¿æå¤§çåå² 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | <filter class="ch.qos.logback.classic.filter.LevelFilter"> |
| | | <!-- è¿æ»¤ççº§å« --> |
| | | <level>ERROR</level> |
| | | <!-- å¹é
æ¶çæä½ï¼æ¥æ¶ï¼è®°å½ï¼ --> |
| | | <onMatch>ACCEPT</onMatch> |
| | | <!-- ä¸å¹é
æ¶çæä½ï¼æç»ï¼ä¸è®°å½ï¼ --> |
| | | <onMismatch>DENY</onMismatch> |
| | | </filter> |
| | | </appender> |
| | | |
| | | <!-- ç¨æ·è®¿é®æ¥å¿è¾åº --> |
| | | <appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <file>${log.path}/sys-user.log</file> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!-- æå¤©åæ» daily --> |
| | | <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern> |
| | | <!-- æ¥å¿æå¤§çåå² 60天 --> |
| | | <maxHistory>60</maxHistory> |
| | | </rollingPolicy> |
| | | <encoder> |
| | | <pattern>${log.pattern}</pattern> |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- ç³»ç»æ¨¡åæ¥å¿çº§å«æ§å¶ --> |
| | | <logger name="com.ruoyi" level="info" /> |
| | | <!-- Springæ¥å¿çº§å«æ§å¶ --> |
| | | <logger name="org.springframework" level="warn" /> |
| | | |
| | | <root level="info"> |
| | | <appender-ref ref="console" /> |
| | | </root> |
| | | |
| | | <!--ç³»ç»æä½æ¥å¿--> |
| | | <root level="info"> |
| | | <appender-ref ref="file_info" /> |
| | | <appender-ref ref="file_error" /> |
| | | </root> |
| | | |
| | | <!--ç³»ç»ç¨æ·æä½æ¥å¿--> |
| | | <logger name="sys-user" level="info"> |
| | | <appender-ref ref="sys-user"/> |
| | | </logger> |
| | | </configuration> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE configuration |
| | | PUBLIC "-//mybatis.org//DTD Config 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-config.dtd"> |
| | | <configuration> |
| | | <!-- å
¨å±åæ° --> |
| | | <settings> |
| | | <!-- 使å
¨å±çæ å°å¨å¯ç¨æç¦ç¨ç¼å --> |
| | | <setting name="cacheEnabled" value="true" /> |
| | | <!-- å
许JDBC æ¯æèªå¨çæä¸»é® --> |
| | | <setting name="useGeneratedKeys" value="true" /> |
| | | <!-- é
ç½®é»è®¤çæ§è¡å¨.SIMPLEå°±æ¯æ®éæ§è¡å¨;REUSEæ§è¡å¨ä¼éç¨é¢å¤çè¯å¥(prepared statements);BATCHæ§è¡å¨å°éç¨è¯å¥å¹¶æ§è¡æ¹éæ´æ° --> |
| | | <setting name="defaultExecutorType" value="SIMPLE" /> |
| | | <!-- æå® MyBatis æç¨æ¥å¿çå
·ä½å®ç° --> |
| | | <setting name="logImpl" value="SLF4J" /> |
| | | <!-- 使ç¨é©¼å³°å½åæ³è½¬æ¢å段 --> |
| | | <!-- <setting name="mapUnderscoreToCamelCase" value="true"/> --> |
| | | </settings> |
| | | |
| | | </configuration> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.web; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.generator.FastAutoGenerator; |
| | | import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; |
| | | import com.baomidou.mybatisplus.generator.engine.VelocityTemplateEngine; |
| | | import com.baomidou.mybatisplus.generator.fill.Column; |
| | | import org.junit.Test; |
| | | |
| | | /** |
| | | * @className: MybatisPlusGeneraotr |
| | | * @description: mybatis plus代ç çæå¨ |
| | | **/ |
| | | public class MybatisPlusGeneraotr { |
| | | |
| | | @Test |
| | | public void mybatisPlusGenerator() { |
| | | // æ°æ®æºé
ç½® |
| | | FastAutoGenerator.create( |
| | | "jdbc:dm://localhost:5236/DATABASE?rewriteBatchedStatements=true&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8", |
| | | "SYSDBA", // è¾¾æ¢¦æ°æ®åºæ¨¡å¼å |
| | | "Sysdba2025!" // å¯ç |
| | | ) |
| | | // å
¨å±é
ç½® |
| | | .globalConfig( |
| | | builder -> { |
| | | builder |
| | | .author("sunjiawei")// ä½è
|
| | | .outputDir(System.getProperty("user.dir") + "/src/test/java")// æå®è¾åºç®å½ |
| | | .commentDate("yyyy-MM-dd")// 注éçæ¥æ |
| | | // ä¿®æ¹Dateç±»å为LocalDateTime |
| | | //.dateType(DateType.ONLY_DATE) |
| | | .enableSwagger() |
| | | .disableOpenDir();// ç¦æ¢æå¼è¾åºç®å½ï¼é»è®¤ï¼true |
| | | } |
| | | ) |
| | | // å
é
ç½® |
| | | .packageConfig( |
| | | builder -> { |
| | | builder |
| | | .parent(this.getClass().getPackageName() + ".base") // ç¶å
å |
| | | .entity("pojo.entity") // å®ä½ç±»å
å |
| | | .other("utils"); // èªå®ä¹æä»¶å
å |
| | | } |
| | | ) |
| | | // çç¥é
ç½® |
| | | .strategyConfig( |
| | | builder -> { |
| | | builder |
| | | //todo å¨è¿éæ·»å æ°æ®åºè¡¨å 设置éè¦çæç表åï¼å¤ä¸ªè¡¨ä¹é´å¯ä»¥ç¨éå·éå¼ |
| | | .addInclude("HIK_EVENT") |
| | | .controllerBuilder().enableRestStyle() // controlleré
ç½®çç¥ |
| | | .serviceBuilder().formatServiceFileName("%sService") // serviceé
ç½®çç¥ |
| | | .mapperBuilder().enableBaseColumnList().enableBaseResultMap().enableMapperAnnotation()// mapperé
ç½®çç¥ |
| | | .entityBuilder().enableLombok().enableRemoveIsPrefix().disableSerialVersionUID().enableTableFieldAnnotation() // å®ä½é
ç½®çç¥ |
| | | .logicDeleteColumnName("is_deleted")// é»è¾å é¤å段å |
| | | .naming(NamingStrategy.underline_to_camel)// æ°æ®åºè¡¨æ å°å°å®ä½çå½åçç¥ï¼ä¸å线转驼峰 |
| | | .columnNaming(NamingStrategy.underline_to_camel) // æ°æ®åºè¡¨å段æ å°çå½åçç¥ï¼ä¸å线转驼峰 |
| | | .addTableFills( // æ·»å è¡¨åæ®µå¡«å
ï¼"create_time"èªå¨å¡«å
为æå
¥æ¶é´ï¼"update_time"èªå¨å¡«å
ä¸ºä¿®æ¹æ¶é´ |
| | | new Column("create_time", FieldFill.INSERT), |
| | | new Column("update_time", FieldFill.INSERT_UPDATE) |
| | | ) |
| | | .idType(IdType.AUTO); |
| | | } |
| | | ) |
| | | // 模æ¿é
ç½® |
| | | .templateEngine(new VelocityTemplateEngine()) // 使ç¨çæ¯é»è®¤ç Velocity å¼ææ¨¡æ¿ |
| | | // æ§è¡ |
| | | .execute(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | |
| | | <parent> |
| | | <artifactId>ruoyi</artifactId> |
| | | <groupId>com.ruoyi</groupId> |
| | | <version>3.8.9</version> |
| | | </parent> |
| | | |
| | | <artifactId>ruoyi-buss</artifactId> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <name>ruoyi-buss</name> |
| | | |
| | | <description> |
| | | ä¸å¡ç³»ç»æ¨¡å |
| | | </description> |
| | | |
| | | |
| | | |
| | | <dependencies> |
| | | |
| | | <!-- éç¨å·¥å
·--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.ruoyi</groupId>--> |
| | | <!-- <artifactId>ruoyi-common</artifactId>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-framework</artifactId> |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.squareup.okhttp3</groupId>--> |
| | | <!-- <artifactId>okhttp</artifactId>--> |
| | | <!-- <version>4.10.0</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.xiaoymin</groupId>--> |
| | | <!-- <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>--> |
| | | <!-- <version>4.4.0</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springdoc</groupId>--> |
| | | <!-- <artifactId>springdoc-openapi-ui</artifactId>--> |
| | | <!-- <version>1.8.0</version> <!– è¯·ä½¿ç¨ææ°çæ¬ –>--> |
| | | <!-- </dependency>--> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>org.springdoc</groupId>--> |
| | | <!-- <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>--> |
| | | <!-- <version>2.6.0</version> <!– çæ¬å·è¯·æ ¹æ®ä½ çSpring Bootçæ¬å¹é
–>--> |
| | | <!-- </dependency>--> |
| | | |
| | | </dependencies> |
| | | |
| | | </project> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <module version="4"> |
| | | <component name="FacetManager"> |
| | | <facet type="Spring" name="Spring"> |
| | | <configuration /> |
| | | </facet> |
| | | </component> |
| | | </module> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss; |
| | | |
| | | import java.util.*; |
| | | |
| | | class Port { |
| | | String name; |
| | | int berths; |
| | | int supplyCapacity; |
| | | int x, y; // Coordinates for distance calculation |
| | | |
| | | public Port(String name, int berths, int supplyCapacity, int x, int y) { |
| | | this.name = name; |
| | | this.berths = berths; |
| | | this.supplyCapacity = supplyCapacity; |
| | | this.x = x; |
| | | this.y = y; |
| | | } |
| | | } |
| | | |
| | | class Ship { |
| | | String name; |
| | | int supplyNeed; |
| | | int x, y; // Current coordinates |
| | | |
| | | public Ship(String name, int supplyNeed, int x, int y) { |
| | | this.name = name; |
| | | this.supplyNeed = supplyNeed; |
| | | this.x = x; |
| | | this.y = y; |
| | | } |
| | | } |
| | | |
| | | class Assignment { |
| | | List<Integer> assignments; // Index of port for each ship |
| | | double fitness; |
| | | |
| | | public Assignment(List<Integer> assignments) { |
| | | this.assignments = assignments; |
| | | this.fitness = 0.0; |
| | | } |
| | | } |
| | | |
| | | public class GeneticFleetAssignment { |
| | | |
| | | private static final int POPULATION_SIZE = 50; |
| | | private static final int GENERATIONS = 100; |
| | | private static final double MUTATION_RATE = 0.1; |
| | | |
| | | public static double calculateDistance(Ship ship, Port port) { |
| | | return Math.sqrt(Math.pow(ship.x - port.x, 2) + Math.pow(ship.y - port.y, 2)); |
| | | } |
| | | |
| | | public static double evaluateFitness(Assignment assignment, List<Ship> ships, List<Port> ports) { |
| | | double totalDistance = 0.0; |
| | | int[] portBerths = new int[ports.size()]; |
| | | int[] portSupply = new int[ports.size()]; |
| | | |
| | | for (int i = 0; i < assignment.assignments.size(); i++) { |
| | | int portIndex = assignment.assignments.get(i); |
| | | Ship ship = ships.get(i); |
| | | Port port = ports.get(portIndex); |
| | | |
| | | totalDistance += calculateDistance(ship, port); |
| | | portBerths[portIndex]++; |
| | | portSupply[portIndex] += ship.supplyNeed; |
| | | } |
| | | |
| | | for (int i = 0; i < ports.size(); i++) { |
| | | if (portBerths[i] > ports.get(i).berths || portSupply[i] > ports.get(i).supplyCapacity) { |
| | | return Double.MAX_VALUE; // Invalid assignment |
| | | } |
| | | } |
| | | |
| | | return totalDistance; |
| | | } |
| | | |
| | | public static Assignment crossover(Assignment parent1, Assignment parent2) { |
| | | Random rand = new Random(); |
| | | int crossoverPoint = rand.nextInt(parent1.assignments.size()); |
| | | List<Integer> childAssignments = new ArrayList<>(parent1.assignments.subList(0, crossoverPoint)); |
| | | childAssignments.addAll(parent2.assignments.subList(crossoverPoint, parent2.assignments.size())); |
| | | return new Assignment(childAssignments); |
| | | } |
| | | |
| | | public static void mutate(Assignment assignment, int numPorts) { |
| | | Random rand = new Random(); |
| | | if (rand.nextDouble() < MUTATION_RATE) { |
| | | int index = rand.nextInt(assignment.assignments.size()); |
| | | assignment.assignments.set(index, rand.nextInt(numPorts)); |
| | | } |
| | | } |
| | | |
| | | public static Assignment geneticAlgorithm(List<Ship> ships, List<Port> ports) { |
| | | Random rand = new Random(); |
| | | List<Assignment> population = new ArrayList<>(); |
| | | |
| | | // Initialize population |
| | | for (int i = 0; i < POPULATION_SIZE; i++) { |
| | | List<Integer> assignments = new ArrayList<>(); |
| | | for (int j = 0; j < ships.size(); j++) { |
| | | assignments.add(rand.nextInt(ports.size())); |
| | | } |
| | | population.add(new Assignment(assignments)); |
| | | } |
| | | |
| | | for (int generation = 0; generation < GENERATIONS; generation++) { |
| | | // Evaluate fitness |
| | | for (Assignment assignment : population) { |
| | | assignment.fitness = evaluateFitness(assignment, ships, ports); |
| | | } |
| | | |
| | | // Sort by fitness |
| | | population.sort(Comparator.comparingDouble(a -> a.fitness)); |
| | | |
| | | // Selection and reproduction |
| | | List<Assignment> newPopulation = new ArrayList<>(); |
| | | for (int i = 0; i < POPULATION_SIZE / 2; i++) { |
| | | Assignment parent1 = population.get(i); |
| | | Assignment parent2 = population.get(rand.nextInt(POPULATION_SIZE / 2)); |
| | | Assignment child = crossover(parent1, parent2); |
| | | mutate(child, ports.size()); |
| | | newPopulation.add(child); |
| | | } |
| | | |
| | | population = newPopulation; |
| | | } |
| | | |
| | | // Return the best solution |
| | | return population.get(0); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | List<Port> ports = Arrays.asList( |
| | | new Port("Port A", 2, 100, 0, 0), |
| | | new Port("Port B", 1, 50, 5, 5), |
| | | new Port("Port C", 3, 150, 10, 10) |
| | | ); |
| | | |
| | | List<Ship> ships = Arrays.asList( |
| | | new Ship("Ship 1", 30, 0, 0), |
| | | new Ship("Ship 2", 70, 0, 0), |
| | | new Ship("Ship 3", 50, 9, 9) |
| | | ); |
| | | |
| | | Assignment bestAssignment = geneticAlgorithm(ships, ports); |
| | | |
| | | for (int i = 0; i < ships.size(); i++) { |
| | | System.out.println("Ship " + ships.get(i).name + " assigned to port " + ports.get(bestAssignment.assignments.get(i)).name); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.buss.domain.DsEffectAssessList; |
| | | |
| | | import javax.script.Invocable; |
| | | import javax.script.ScriptEngine; |
| | | import javax.script.ScriptEngineManager; |
| | | import javax.script.ScriptEngineFactory; |
| | | import javax.tools.*; |
| | | import java.lang.reflect.Method; |
| | | import java.net.URI; |
| | | import java.net.URL; |
| | | import java.net.URLClassLoader; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | public class AssessUtil { |
| | | |
| | | /** |
| | | * æ¹æ¬¡æ»è¡¥ç»æ°é æè½è¯ä¼°æ°å¼è®¡ç® |
| | | */ |
| | | public static double getPercentForShipCount(int count){ |
| | | if(count > 0 && count < 6){ |
| | | return 0.2; |
| | | } |
| | | else if(count >= 6 && count < 12){ |
| | | return 0.4; |
| | | } |
| | | else if(count >= 12 && count < 20){ |
| | | return 0.6; |
| | | } |
| | | else if(count >= 20 && count < 30){ |
| | | return 0.8; |
| | | } |
| | | else if(count >= 30){ |
| | | return 1.0; |
| | | } |
| | | return 0.0; |
| | | } |
| | | |
| | | /** |
| | | * æ¹æ¬¡åè°æå è¡¥ç»æ¶é´ æè½è¯ä¼°æ°å¼è®¡ç® |
| | | */ |
| | | public static double getPercentForShipEmpty(int count){ |
| | | if(count < 4){ |
| | | return 1.0; |
| | | } |
| | | else if(count < 8 && count >= 4){ |
| | | return 0.8; |
| | | } |
| | | else if(count >= 8 && count < 12){ |
| | | return 0.6; |
| | | } |
| | | else if(count >= 12 && count < 18){ |
| | | return 0.4; |
| | | } |
| | | else if(count >= 18 && count < 24){ |
| | | return 0.2; |
| | | } |
| | | return 0.0; |
| | | } |
| | | |
| | | /** |
| | | * 忏¯å£ç»ææå¤§æ¶é´å·® æè½è¯ä¼°æ°å¼è®¡ç® |
| | | */ |
| | | public static double getPercentForHarborTimeDif(int count){ |
| | | if(count < 4){ |
| | | return 1.0; |
| | | } |
| | | else if(count >= 4 && count < 8){ |
| | | return 0.8; |
| | | } |
| | | else if(count >= 8 && count < 12){ |
| | | return 0.6; |
| | | } |
| | | else if(count >= 12 && count < 18){ |
| | | return 0.4; |
| | | } |
| | | else if(count >= 18 && count < 24){ |
| | | return 0.2; |
| | | } |
| | | return 0.0; |
| | | } |
| | | |
| | | /** |
| | | * åè°å¹³ååé æ¶é´ æè½è¯ä¼°æ°å¼è®¡ç® |
| | | */ |
| | | public static double getPercentForShipStopTime(int hour){ |
| | | if(hour > 48){ |
| | | return 0.4; |
| | | } |
| | | else if(hour > 36 && hour <= 48){ |
| | | return 0.6; |
| | | } |
| | | else if(hour > 30 && hour <= 36){ |
| | | return 0.7; |
| | | } |
| | | else if(hour > 24 && hour <= 30){ |
| | | return 0.8; |
| | | } |
| | | else if(hour > 18 && hour <= 24){ |
| | | return 1.0; |
| | | } |
| | | else if(hour > 12 && hour <= 18){ |
| | | return 0.8; |
| | | } |
| | | else if(hour > 6 && hour <= 12){ |
| | | return 0.7; |
| | | } |
| | | else if(hour <= 6){ |
| | | return 0.6; |
| | | } |
| | | return 0.0; |
| | | } |
| | | |
| | | /** |
| | | * è¡¥ç»ä½ä¸æ¶é´åå¼ æè½è¯ä¼°æ°å¼è®¡ç® |
| | | */ |
| | | public static double getPercentForApplyTime(int hour){ |
| | | if(hour > 36){ |
| | | return 0.4; |
| | | } |
| | | else if(hour > 24 && hour <= 36){ |
| | | return 0.6; |
| | | } |
| | | else if(hour > 20 && hour <= 24){ |
| | | return 0.8; |
| | | } |
| | | else if(hour > 16 && hour <= 20){ |
| | | return 1.0; |
| | | } |
| | | else if(hour > 12 && hour <= 16){ |
| | | return 0.8; |
| | | } |
| | | else if(hour < 8){ |
| | | return 0.6; |
| | | } |
| | | return 0.0; |
| | | } |
| | | |
| | | /** |
| | | * è¡¥ç»éä½ä¸æ¶é´åå¼ æè½è¯ä¼°æ°å¼è®¡ç® |
| | | */ |
| | | public static double getPercentForNotApplyTime(int hour){ |
| | | if(hour > 24){ |
| | | return 0.0; |
| | | } |
| | | else if(hour > 16 && hour <= 24){ |
| | | return 0.2; |
| | | } |
| | | else if(hour > 12 && hour <= 16){ |
| | | return 0.4; |
| | | } |
| | | else if(hour > 8 && hour <= 12){ |
| | | return 0.6; |
| | | } |
| | | else if(hour > 4 && hour <= 8){ |
| | | return 0.8; |
| | | } |
| | | else if(hour <= 4){ |
| | | return 1.0; |
| | | } |
| | | return 0.0; |
| | | } |
| | | |
| | | /** |
| | | * æ³ä½æ¥åå¨è½¬è次 æè½è¯ä¼°æ°å¼è®¡ç® |
| | | */ |
| | | public static double getPercentForBerthTime(double hour){ |
| | | if (hour > 0) { |
| | | double result = (double)hour / 3.0; |
| | | return result > 1.0 ? 1.0 : result; |
| | | } |
| | | return 0.0; |
| | | } |
| | | |
| | | /** |
| | | * åæ²¿å åæ¶é¿åå¼ æè½è¯ä¼°æ°å¼è®¡ç® |
| | | */ |
| | | public static double getPercentForBerthHoldTime(double hour){ |
| | | if (hour > 0) { |
| | | double result = (double) hour / 24.0; |
| | | return result > 1 ? 1.0 : result; |
| | | } |
| | | return 0.0; |
| | | } |
| | | |
| | | /** |
| | | * åæ³ä½ç©èµè½¦æ¬¡åå¼ æè½è¯ä¼°æ°å¼è®¡ç® |
| | | */ |
| | | public static double getPercentForCar(double count){ |
| | | if (count > 0) { |
| | | double result = (double)count / 24.0; |
| | | return result > 1.0 ? 1.0 : result; |
| | | } |
| | | return 0.0; |
| | | } |
| | | |
| | | |
| | | private static Double getScore(Double list) { |
| | | try { |
| | | // å建Javaç¼è¯å¨ |
| | | JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); |
| | | DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>(); |
| | | |
| | | // å建æºä»£ç |
| | | String sourceCode = "public class DynamicScore {" + |
| | | " public static double calculateScore(double value) {" + |
| | | " return Math.round(value * 10 * 100) / 100.0;" + |
| | | " }" + |
| | | "}"; |
| | | |
| | | // å建å
åä¸çJavaæºæä»¶ |
| | | JavaFileObject sourceFile = new SimpleJavaFileObject( |
| | | URI.create("string:///DynamicScore.java"), |
| | | JavaFileObject.Kind.SOURCE) { |
| | | @Override |
| | | public CharSequence getCharContent(boolean ignoreEncodingErrors) { |
| | | return sourceCode; |
| | | } |
| | | }; |
| | | |
| | | // ç¼è¯æºä»£ç |
| | | StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null); |
| | | Iterable<? extends JavaFileObject> compilationUnits = Arrays.asList(sourceFile); |
| | | JavaCompiler.CompilationTask task = compiler.getTask(null, fileManager, diagnostics, null, null, compilationUnits); |
| | | boolean success = task.call(); |
| | | |
| | | if (success) { |
| | | // å建èªå®ä¹ç±»å è½½å¨ |
| | | ClassLoader classLoader = new URLClassLoader(new URL[0], AssessUtil.class.getClassLoader()); |
| | | Class<?> dynamicClass = Class.forName("DynamicScore", true, classLoader); |
| | | |
| | | // è°ç¨æ¹æ³ |
| | | Method method = dynamicClass.getMethod("calculateScore", double.class); |
| | | return (Double) method.invoke(null, list); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | System.out.println("计ç®åæ°å¤±è´¥"); |
| | | } |
| | | return 0.0; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(getScore(32.1)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.time.*; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | public class DateUtils { |
| | | |
| | | public static Date setToNextDayZero(Date originalDate) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(originalDate); |
| | | |
| | | // å¢å ä¸å¤© |
| | | calendar.add(Calendar.DAY_OF_MONTH, 1); |
| | | |
| | | // 设置为é¶ç¹ |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸¤ä¸ªæ¥æä¹é´ç天æ°å·® |
| | | * @param date1 |
| | | * @param date2 |
| | | * @return |
| | | */ |
| | | public static long getSubtractOfTowDate(Date date1, Date date2) { |
| | | // è®¡ç®æ¯«ç§å·® |
| | | long diffMillis = Math.abs(date2.getTime() - date1.getTime()); |
| | | // 转æ¢ä¸ºå¤©æ°å¹¶åä¸åæ´ |
| | | double days = (double) diffMillis / (24 * 60 * 60 * 1000); |
| | | long roundedDays = (long) Math.ceil(days); |
| | | return roundedDays; |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸¤ä¸ªæ¥æä¹é´çå°æ¶æ°å·® |
| | | * @param date1 |
| | | * @param date2 |
| | | * @return |
| | | */ |
| | | public static double getDisHourOfTowDate(Date date1, Date date2) { |
| | | // å°Date转æ¢ä¸ºInstant |
| | | Instant instant1 = date1.toInstant(); |
| | | Instant instant2 = date2.toInstant(); |
| | | |
| | | // è®¡ç®æç»æ¶é´ |
| | | Duration duration = Duration.between(instant1, instant2); |
| | | |
| | | // è·åæ»ç§æ°å¹¶è½¬æ¢ä¸ºå°æ¶ï¼åä¸åæ´ï¼ |
| | | long totalSeconds = duration.getSeconds(); |
| | | int hours = (int) Math.ceil((double) totalSeconds / 3600); |
| | | return hours; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å¼å§æ¶é´startTimeï¼è·åhourså°æ¶åçå
·ä½æ¶é´ |
| | | * @param startDate |
| | | * @param hours |
| | | * @return |
| | | */ |
| | | public static Date getDateAfterHours(Date startDate, int hours) { |
| | | // æDate转æ¢ä¸ºLocalDateTime |
| | | LocalDateTime localDateTime = startDate.toInstant() |
| | | .atZone(ZoneId.systemDefault()) |
| | | .toLocalDateTime(); |
| | | |
| | | // å 䏿å®çå°æ¶æ° |
| | | LocalDateTime newDateTime = localDateTime.plusHours(hours); |
| | | |
| | | // å转åDateç±»å |
| | | Instant instant = newDateTime.atZone(ZoneId.systemDefault()).toInstant(); |
| | | return Date.from(instant); |
| | | } |
| | | |
| | | /** |
| | | * å¤æä¸¤ä¸ªæ¶é´æ¯å¦å¨åä¸å¤©å
|
| | | * @param date1 |
| | | * @param date2 |
| | | * @return |
| | | */ |
| | | public static boolean isSameDay(Date date1, Date date2) { |
| | | // 转æ¢ä¸ºLocalDateï¼å¿½ç¥æ¶åºï¼ä½¿ç¨ç³»ç»é»è®¤æ¶åºï¼ |
| | | LocalDate localDate1 = date1.toInstant() |
| | | .atZone(ZoneId.systemDefault()) |
| | | .toLocalDate(); |
| | | LocalDate localDate2 = date2.toInstant() |
| | | .atZone(ZoneId.systemDefault()) |
| | | .toLocalDate(); |
| | | // 夿æ¯å¦ä¸ºåä¸å¤© |
| | | return localDate1.isEqual(localDate2); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String date1 = "2025-05-21 21:10:00"; |
| | | String date2 = "2025-05-22 23:20:00"; |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | // è§£æå符串为LocalDateTime |
| | | LocalDateTime localDateTime1 = LocalDateTime.parse(date1, formatter); |
| | | LocalDateTime localDateTime2 = LocalDateTime.parse(date2, formatter); |
| | | // 转æ¢ä¸ºDateï¼éè¦æå®æ¶åºï¼è¿é使ç¨ç³»ç»é»è®¤æ¶åºï¼ |
| | | Instant instant1 = localDateTime1.atZone(ZoneId.systemDefault()).toInstant(); |
| | | Instant instant2 = localDateTime2.atZone(ZoneId.systemDefault()).toInstant(); |
| | | Date date11 = Date.from(instant1); |
| | | Date date22 = Date.from(instant2); |
| | | long result = getSubtractOfTowDate(date11, date22); |
| | | System.out.println(result); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common; |
| | | |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * å½ä¸åç®æ³å·¥å
·ç±» |
| | | * |
| | | * @author yl |
| | | * @date 2025-03-20 |
| | | */ |
| | | |
| | | public class Normalization { |
| | | // æå° - æå¤§å½ä¸å |
| | | public static double[] minMaxNormalization(double[] data) { |
| | | double min = Arrays.stream(data).min().getAsDouble(); |
| | | double max = Arrays.stream(data).max().getAsDouble(); |
| | | double[] normalized = new double[data.length]; |
| | | for (int i = 0; i < data.length; i++) { |
| | | normalized[i] = (data[i] - min) / (max - min); |
| | | } |
| | | return normalized; |
| | | } |
| | | |
| | | // Z - åæ°å½ä¸å |
| | | public static double[] zScoreNormalization(double[] data) { |
| | | double mean = Arrays.stream(data).average().getAsDouble(); |
| | | double sumSquaredDiff = Arrays.stream(data).map(x -> Math.pow(x - mean, 2)).sum(); |
| | | double stdDev = Math.sqrt(sumSquaredDiff / data.length); |
| | | double[] normalized = new double[data.length]; |
| | | for (int i = 0; i < data.length; i++) { |
| | | normalized[i] = (data[i] - mean) / stdDev; |
| | | } |
| | | return normalized; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | double[] data = {12, 4, 0.9, 0.3}; |
| | | |
| | | // æå° - æå¤§å½ä¸å |
| | | double[] minMaxNormalized = minMaxNormalization(data); |
| | | System.out.println("æå° - æå¤§å½ä¸åç»æ: " + Arrays.toString(minMaxNormalized)); |
| | | |
| | | System.out.println("å ææ±å:" + Arrays.stream(minMaxNormalized).sum()); |
| | | // Z - åæ°å½ä¸å |
| | | double[] zScoreNormalized = zScoreNormalization(data); |
| | | System.out.println("Z - åæ°å½ä¸åç»æ: " + Arrays.toString(zScoreNormalized)); |
| | | System.out.println("Z - åæ°å ææ±å:" + Math.round(Arrays.stream(zScoreNormalized).sum())); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.Optional; |
| | | |
| | | public class NumberUtils { |
| | | |
| | | /** |
| | | * ä¿ç两ä½å°æ°ï¼åèäºå
¥ï¼ |
| | | * @param value åå§å¼ |
| | | * @return ä¿ç两ä½å°æ°åç double å¼ |
| | | */ |
| | | public static double roundToTwoDecimalPlaces(double value) { |
| | | if(value == 0.0){return 0.0;} |
| | | return BigDecimal.valueOf(value) |
| | | .setScale(2, RoundingMode.HALF_UP) |
| | | .doubleValue(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | double num = 123.456789; |
| | | System.out.println(roundToTwoDecimalPlaces(num)); // 123.46 |
| | | } |
| | | |
| | | public static <T> T getOrDefault(T obj, T defaultValue) { |
| | | return Optional.ofNullable(obj).orElse(defaultValue); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.buss.domain.vo.RfIdVo; |
| | | |
| | | import java.io.*; |
| | | import java.net.ConnectException; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.SocketTimeoutException; |
| | | import java.net.URL; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.concurrent.Future; |
| | | |
| | | public class RfidUtil { |
| | | |
| | | public static void main(String[] args) { |
| | | String result = sendJsonPost("http://192.168.0.2:10800/open/goods/task","{\"id\":12,\"name\":\"ä»»å¡åç§°\", \"path\": \"è·¯å¾ä¿¡æ¯\"}"); |
| | | List<RfIdVo> list = new ArrayList<>(); |
| | | list.add(new RfIdVo(1, "NAME1", "PATH1")); |
| | | list.add(new RfIdVo(2, "NAME2", "PATH2")); |
| | | list.add(new RfIdVo(3, "NAME3", "PATH3")); |
| | | list.add(new RfIdVo(4, "NAME4", "PATH4")); |
| | | list.add(new RfIdVo(5, "NAME5", "PATH5")); |
| | | list.add(new RfIdVo(6, "NAME6", "PATH6")); |
| | | |
| | | System.out.println("æ£å¸¸" + result); |
| | | } |
| | | |
| | | /** |
| | | * 弿¥åéè¯·æ± |
| | | * @param url |
| | | * @param list |
| | | */ |
| | | public static void asyncSendJsonPost(String url, List<RfIdVo> list){ |
| | | ExecutorService executor = Executors.newFixedThreadPool(50); // æ ¹æ®ç½ç»è°æ´çº¿ç¨æ° |
| | | List<Future<?>> futures = new ArrayList<>(); |
| | | |
| | | for (int i = 0, len = list.size(); i < len; i++) { |
| | | int finalI = i; |
| | | futures.add(executor.submit(() -> { |
| | | try { |
| | | URL realUrl = new URL(url); |
| | | HttpURLConnection conn = (HttpURLConnection)realUrl.openConnection(); |
| | | conn.setRequestMethod("POST"); |
| | | conn.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); |
| | | conn.setRequestProperty("Accept", "*/*"); |
| | | conn.setConnectTimeout(3000); // 3ç§è¶
æ¶ |
| | | conn.setDoOutput(true); |
| | | conn.setDoInput(true); |
| | | try(OutputStream os = conn.getOutputStream()){ |
| | | byte[] input = JSONObject.toJSONString(list.get(finalI)).getBytes("utf-8"); |
| | | os.write(input, 0, input.length); |
| | | } |
| | | conn.getResponseCode(); |
| | | } catch (Exception ignored) { |
| | | System.out.println("åéRFIDä»»å¡å¤±è´¥ï¼è¯·éè¯ã"+ JSONObject.toJSONString(list.get(finalI))); |
| | | } |
| | | })); |
| | | } |
| | | executor.shutdown(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åæå® URL åéPOSTæ¹æ³çè¯·æ± |
| | | * |
| | | * @param url åé请æ±ç URL |
| | | * @return æä»£è¡¨è¿ç¨èµæºçååºç»æ |
| | | */ |
| | | public static String sendJsonPost(String url, String jsonString) { |
| | | PrintWriter out = null; |
| | | BufferedReader in = null; |
| | | StringBuilder result = new StringBuilder(); |
| | | try |
| | | { |
| | | URL realUrl = new URL(url); |
| | | HttpURLConnection conn = (HttpURLConnection)realUrl.openConnection(); |
| | | |
| | | conn.setRequestMethod("POST"); |
| | | conn.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); |
| | | conn.setRequestProperty("Accept", "*/*"); |
| | | conn.setDoOutput(true); |
| | | conn.setDoInput(true); |
| | | try(OutputStream os = conn.getOutputStream()){ |
| | | byte[] input = jsonString.getBytes("utf-8"); |
| | | os.write(input, 0, input.length); |
| | | } |
| | | |
| | | int responseCode = conn.getResponseCode(); |
| | | if(responseCode == HttpURLConnection.HTTP_OK){ |
| | | try(BufferedReader br = new BufferedReader( |
| | | new InputStreamReader(conn.getInputStream(), "utf-8") |
| | | )){ |
| | | String responseLine; |
| | | while ((responseLine = br.readLine()) != null){ |
| | | result.append(responseLine.trim()); |
| | | } |
| | | System.out.println(result.toString()); |
| | | } |
| | | } |
| | | conn.disconnect(); |
| | | System.out.println("result=" + result); |
| | | } |
| | | catch (ConnectException e) |
| | | { |
| | | System.out.println("è°ç¨HttpUtils.sendPost ConnectException, url=" + url + ",param=" + jsonString); |
| | | e.printStackTrace(); |
| | | } |
| | | catch (SocketTimeoutException e) |
| | | { |
| | | System.out.println("è°ç¨HttpUtils.sendPost ConnectException, url=" + url + ",param=" + jsonString); |
| | | e.printStackTrace(); |
| | | } |
| | | catch (IOException e) |
| | | { |
| | | System.out.println("è°ç¨HttpUtils.sendPost ConnectException, url=" + url + ",param=" + jsonString); |
| | | e.printStackTrace(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | System.out.println("è°ç¨HttpUtils.sendPost ConnectException, url=" + url + ",param=" + jsonString); |
| | | e.printStackTrace(); |
| | | } |
| | | finally |
| | | { |
| | | try |
| | | { |
| | | if (out != null) |
| | | { |
| | | out.close(); |
| | | } |
| | | if (in != null) |
| | | { |
| | | in.close(); |
| | | } |
| | | } |
| | | catch (IOException ex) |
| | | { |
| | | System.out.println("è°ç¨HttpUtils.sendPost ConnectException, url=" + url + ",param=" + jsonString); |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | return result.toString(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.dynamic; |
| | | |
| | | import org.springframework.beans.factory.support.DefaultListableBeanFactory; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | |
| | | public class DynamicBeanRegistrar { |
| | | private final ConfigurableApplicationContext context; |
| | | private final DynamicCompiler compiler; |
| | | |
| | | public DynamicBeanRegistrar(ConfigurableApplicationContext context) { |
| | | this.context = context; |
| | | this.compiler = new DynamicCompiler(); |
| | | } |
| | | |
| | | public void registerBean(String beanName, String className, String sourceCode) throws Exception { |
| | | DefaultListableBeanFactory beanFactory = (DefaultListableBeanFactory) context.getBeanFactory(); |
| | | Class<?> clazz = compiler.compile(className, sourceCode); |
| | | beanFactory.registerSingleton(beanName, clazz.getDeclaredConstructor().newInstance()); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.dynamic; |
| | | |
| | | import javax.tools.*; |
| | | import java.net.URI; |
| | | import java.util.List; |
| | | |
| | | public class DynamicCompiler { |
| | | |
| | | private final JavaCompiler compiler; |
| | | private final StandardJavaFileManager stdFileManager; |
| | | |
| | | public DynamicCompiler() { |
| | | this.compiler = ToolProvider.getSystemJavaCompiler(); |
| | | this.stdFileManager = compiler.getStandardFileManager(null, null, null); |
| | | } |
| | | |
| | | public Class<?> compile(String className, String sourceCode) throws Exception { |
| | | MemoryJavaFileManager fileManager = new MemoryJavaFileManager(stdFileManager); |
| | | JavaFileObject javaFile = new StringJavaFileObject(className, sourceCode); |
| | | |
| | | List<String> options = List.of("--enable-preview", "--add-modules=jdk.compiler"); |
| | | compiler.getTask(null, fileManager, null, options, null, List.of(javaFile)).call(); |
| | | |
| | | return fileManager.getClassLoader().loadClass(className); |
| | | } |
| | | |
| | | private static class StringJavaFileObject extends SimpleJavaFileObject { |
| | | private final String code; |
| | | |
| | | protected StringJavaFileObject(String name, String code) { |
| | | super(URI.create("string:///" + name.replace('.','/') + Kind.SOURCE.extension), Kind.SOURCE); |
| | | this.code = code; |
| | | } |
| | | |
| | | @Override |
| | | public CharSequence getCharContent(boolean ignoreEncodingErrors) { |
| | | return code; |
| | | } |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.dynamic; |
| | | |
| | | import javax.tools.*; |
| | | import java.util.*; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.URI; |
| | | |
| | | public class MemoryJavaFileManager extends ForwardingJavaFileManager<JavaFileManager> { |
| | | private final Map<String, byte[]> classBytes = new HashMap<>(); |
| | | private final ClassLoader loader; |
| | | |
| | | public MemoryJavaFileManager(JavaFileManager fileManager) { |
| | | super(fileManager); |
| | | this.loader = new ClassLoader() { |
| | | @Override |
| | | protected Class<?> findClass(String name) throws ClassNotFoundException { |
| | | byte[] buf = classBytes.get(name); |
| | | if (buf == null) throw new ClassNotFoundException(name); |
| | | return defineClass(name, buf, 0, buf.length); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | @Override |
| | | public JavaFileObject getJavaFileForOutput(Location location, String className, |
| | | JavaFileObject.Kind kind, FileObject sibling) { |
| | | return new MemoryOutputJavaFileObject(className); |
| | | } |
| | | |
| | | public ClassLoader getClassLoader() { |
| | | return loader; |
| | | } |
| | | |
| | | class MemoryOutputJavaFileObject extends SimpleJavaFileObject { |
| | | private final String name; |
| | | |
| | | MemoryOutputJavaFileObject(String name) { |
| | | super(URI.create("mem:///" + name.replace('.','/') + Kind.CLASS.extension), Kind.CLASS); |
| | | this.name = name; |
| | | } |
| | | |
| | | @Override |
| | | public OutputStream openOutputStream() { |
| | | return new ByteArrayOutputStream() { |
| | | @Override |
| | | public void close() { |
| | | classBytes.put(name, toByteArray()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.liquor; |
| | | |
| | | import java.net.URI; |
| | | |
| | | /** |
| | | * This code mainly from: Arthas project |
| | | * */ |
| | | public class ClassUriWrapper { |
| | | private final URI uri; |
| | | |
| | | private final String className; |
| | | |
| | | public ClassUriWrapper(String className, URI uri) { |
| | | this.className = className; |
| | | this.uri = uri; |
| | | } |
| | | |
| | | public URI getUri() { |
| | | return uri; |
| | | } |
| | | |
| | | public String getClassName() { |
| | | return className; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.liquor; |
| | | |
| | | |
| | | import javax.lang.model.element.Modifier; |
| | | import javax.lang.model.element.NestingKind; |
| | | import javax.tools.JavaFileObject; |
| | | import java.io.*; |
| | | import java.net.URI; |
| | | |
| | | /** |
| | | * This code mainly from: Arthas project |
| | | * */ |
| | | public class CustomJavaFileObject implements JavaFileObject { |
| | | private final String className; |
| | | private final URI uri; |
| | | |
| | | public CustomJavaFileObject(String className, URI uri) { |
| | | this.uri = uri; |
| | | this.className = className; |
| | | } |
| | | |
| | | public URI toUri() { |
| | | return uri; |
| | | } |
| | | |
| | | public InputStream openInputStream() throws IOException { |
| | | return uri.toURL().openStream(); |
| | | } |
| | | |
| | | public OutputStream openOutputStream() { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public String getName() { |
| | | return this.className; |
| | | } |
| | | |
| | | public Reader openReader(boolean ignoreEncodingErrors) { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public CharSequence getCharContent(boolean ignoreEncodingErrors) { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public Writer openWriter() throws IOException { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public long getLastModified() { |
| | | return 0; |
| | | } |
| | | |
| | | public boolean delete() { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public Kind getKind() { |
| | | return Kind.CLASS; |
| | | } |
| | | |
| | | public boolean isNameCompatible(String simpleName, Kind kind) { |
| | | return Kind.CLASS.equals(getKind()) |
| | | && this.className.endsWith(simpleName); |
| | | } |
| | | |
| | | public NestingKind getNestingKind() { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public Modifier getAccessLevel() { |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | public String getClassName() { |
| | | return this.className; |
| | | } |
| | | |
| | | |
| | | public String toString() { |
| | | return this.getClass().getName() + "[" + this.toUri() + "]"; |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.liquor; |
| | | |
| | | |
| | | import com.ruoyi.framework.web.domain.server.Sys; |
| | | |
| | | import java.util.ArrayList; |
| | | |
| | | public class DemoApp { |
| | | |
| | | public static void main(String[] args) throws Exception{ |
| | | //å¯ä»¥å¤ç¨ï¼ä¸è¦ï¼ä¸æçæ°å»ºï¼ |
| | | String testParam = "hhhhh"; |
| | | String className = "HelloWorld"; |
| | | String classCode = "import java.util.List;\n\n"+ |
| | | "public class HelloWorld { " + |
| | | " public static String test99(List<String> code) { " + |
| | | " return \"hhhhhh\";" + |
| | | " } " + |
| | | "}"; |
| | | |
| | | Object obj = DynamicApp.exeJavaCode(classCode, className, "test99", new ArrayList<>()); |
| | | |
| | | System.out.println(obj.toString()); |
| | | // //æ·»å æºç ï¼å¯å¤ä¸ªï¼å¹¶ æå»º |
| | | // compiler.addSource(className, classCode).build(); |
| | | // |
| | | // Class<?> clazz = compiler.getClassLoader().loadClass(className); |
| | | // clazz.getMethod("test99", String.class).invoke(null, testParam); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.liquor; |
| | | |
| | | import com.ruoyi.buss.domain.DsEffectAssessList; |
| | | |
| | | import java.util.List; |
| | | |
| | | public class DynamicApp { |
| | | |
| | | public static Object exeJavaCode(String classCode, String className, String method, List<DsEffectAssessList> param) throws Exception{ |
| | | //å¯ä»¥å¤ç¨ï¼ä¸è¦ï¼ä¸æçæ°å»ºï¼ |
| | | DynamicCompiler compiler = new DynamicCompiler(); |
| | | String testParam = "hhhhh"; |
| | | //æ·»å æºç ï¼å¯å¤ä¸ªï¼å¹¶ æå»º |
| | | compiler.addSource(className, classCode).build(); |
| | | Class<?> clazz = compiler.getClassLoader().loadClass(className); |
| | | Object object = clazz.getMethod(method, java.util.List.class).invoke(null, param); |
| | | return object; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.liquor; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * This code mainly from: Arthas project |
| | | * */ |
| | | public class DynamicClassLoader extends ClassLoader { |
| | | private final Map<String, MemoryByteCode> byteCodes = new HashMap<>(); |
| | | |
| | | public DynamicClassLoader(ClassLoader classLoader) { |
| | | super(classLoader != null ? classLoader : Thread.currentThread().getContextClassLoader()); |
| | | } |
| | | |
| | | protected void registerCompiledSource(MemoryByteCode byteCode) { |
| | | byteCodes.put(byteCode.getClassName(), byteCode); |
| | | } |
| | | |
| | | protected Class<?> defineClass(MemoryByteCode byteCode) { |
| | | byteCode.defined = true; |
| | | byte[] bytes = byteCode.getByteCode(); |
| | | return super.defineClass(byteCode.getClassName(), bytes, 0, bytes.length); |
| | | } |
| | | |
| | | @Override |
| | | protected Class<?> findClass(String name) throws ClassNotFoundException { |
| | | MemoryByteCode byteCode = byteCodes.get(name); |
| | | if (byteCode == null || byteCode.defined) { |
| | | return super.findClass(name); |
| | | } |
| | | |
| | | return defineClass(byteCode); |
| | | } |
| | | |
| | | /** |
| | | * é¢å¤çç±»ï¼å®ææ¹éå®ä¹ï¼ |
| | | */ |
| | | protected void prepareClasses() { |
| | | for (MemoryByteCode byteCode : byteCodes.values()) { |
| | | if (byteCode.defined == false) { |
| | | defineClass(byteCode); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //================ |
| | | |
| | | /** |
| | | * è·åç±»åéå |
| | | */ |
| | | public Collection<String> getClassNames() { |
| | | return byteCodes.keySet(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç±»åèç |
| | | */ |
| | | public MemoryByteCode getClassBytes(String className) { |
| | | return byteCodes.get(className); |
| | | } |
| | | |
| | | /** |
| | | * è·åéåå¤§å° |
| | | */ |
| | | public int size() { |
| | | return byteCodes.size(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.liquor; |
| | | |
| | | import javax.tools.*; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.StreamSupport; |
| | | |
| | | /** |
| | | * 卿ç¼è¯å¨ï¼çº¿ç¨ä¸å®å
¨ï¼ |
| | | * |
| | | * This code mainly from: Arthas project |
| | | * */ |
| | | public class DynamicCompiler { |
| | | private final JavaCompiler javaCompiler = ToolProvider.getSystemJavaCompiler(); |
| | | private final StandardJavaFileManager standardFileManager; |
| | | private final List<String> options = new ArrayList<String>(); |
| | | private final ClassLoader parentClassLoader; |
| | | |
| | | private final Collection<JavaFileObject> compilationUnits = new ArrayList<JavaFileObject>(); |
| | | private final List<Diagnostic<? extends JavaFileObject>> errors = new ArrayList<Diagnostic<? extends JavaFileObject>>(); |
| | | private final List<Diagnostic<? extends JavaFileObject>> warnings = new ArrayList<Diagnostic<? extends JavaFileObject>>(); |
| | | |
| | | private DynamicClassLoader dynamicClassLoader; |
| | | |
| | | public DynamicCompiler() { |
| | | this(null); |
| | | } |
| | | |
| | | public DynamicCompiler(ClassLoader classLoader) { |
| | | if (classLoader == null) { |
| | | classLoader = Thread.currentThread().getContextClassLoader(); |
| | | } |
| | | |
| | | if (javaCompiler == null) { |
| | | throw new IllegalStateException( |
| | | "Can not load JavaCompiler from javax.tools.ToolProvider#getSystemJavaCompiler()," |
| | | + " please confirm the application running in JDK not JRE."); |
| | | } |
| | | standardFileManager = javaCompiler.getStandardFileManager(null, null, null); |
| | | |
| | | options.add("-Xlint:unchecked"); |
| | | options.add("-g"); |
| | | options.add("-XDuseUnsharedTable");//å¯é¿å
SharedNameTable å
å大涨 |
| | | |
| | | parentClassLoader = classLoader; |
| | | } |
| | | |
| | | /** |
| | | * è·åç±»å è½½å¨ |
| | | */ |
| | | public DynamicClassLoader getClassLoader() { |
| | | if (dynamicClassLoader == null) { |
| | | dynamicClassLoader = new DynamicClassLoader(parentClassLoader); |
| | | } |
| | | |
| | | return dynamicClassLoader; |
| | | } |
| | | |
| | | /** |
| | | * è·åé项 |
| | | */ |
| | | public List<String> getOptions() { |
| | | return options; |
| | | } |
| | | |
| | | /** |
| | | * åæ¢ç±»å è½½å¨ |
| | | * |
| | | * @param dynamicClassLoader å¨æç±»å è½½å¨ |
| | | */ |
| | | public void setClassLoader(DynamicClassLoader dynamicClassLoader) { |
| | | this.dynamicClassLoader = dynamicClassLoader; |
| | | } |
| | | |
| | | /** |
| | | * æ°å»ºç±»å è½½å¨ï¼æ¿æ¢æ§çï¼ |
| | | */ |
| | | public DynamicClassLoader newClassLoader() { |
| | | return new DynamicClassLoader(parentClassLoader); |
| | | } |
| | | |
| | | /** |
| | | * è·åä»£ç æä»¶ç®¡çå¨ |
| | | * |
| | | * @since 1.3.9 |
| | | */ |
| | | public StandardJavaFileManager getStandardFileManager() { |
| | | return standardFileManager; |
| | | } |
| | | |
| | | /** |
| | | * æ·»å ç±»è·¯å¾ |
| | | * |
| | | * @param classPath ç±»è·¯å¾ |
| | | * @since 1.3.9 |
| | | */ |
| | | public DynamicCompiler addClassPath(File classPath) throws IOException { |
| | | Iterable<? extends File> locations = standardFileManager.getLocation(StandardLocation.CLASS_PATH); |
| | | |
| | | List<File> classpaths = StreamSupport.stream(locations.spliterator(), false) |
| | | .collect(Collectors.toList()); |
| | | |
| | | classpaths.add(classPath); |
| | | |
| | | standardFileManager.setLocation(StandardLocation.CLASS_PATH, classpaths); |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æºç |
| | | * |
| | | * @param className ç±»å |
| | | * @param source æºç |
| | | */ |
| | | public DynamicCompiler addSource(String className, String source) { |
| | | addSource(new StringSource(className, source)); |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * æ·»å æºç |
| | | * |
| | | * @param javaFileObject æä»¶å¯¹è±¡ |
| | | */ |
| | | public DynamicCompiler addSource(JavaFileObject javaFileObject) { |
| | | compilationUnits.add(javaFileObject); |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * éç½® |
| | | */ |
| | | public void reset() { |
| | | dynamicClassLoader = null; |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¯ |
| | | */ |
| | | public void compile() { |
| | | errors.clear(); |
| | | warnings.clear(); |
| | | |
| | | JavaFileManager fileManager = new DynamicJavaFileManager(standardFileManager, getClassLoader()); |
| | | |
| | | DiagnosticCollector<JavaFileObject> collector = new DiagnosticCollector<JavaFileObject>(); |
| | | JavaCompiler.CompilationTask task = javaCompiler.getTask(null, fileManager, collector, options, null, |
| | | compilationUnits); |
| | | |
| | | try { |
| | | |
| | | if (!compilationUnits.isEmpty()) { |
| | | boolean result = task.call(); |
| | | |
| | | if (!result || collector.getDiagnostics().size() > 0) { |
| | | |
| | | for (Diagnostic<? extends JavaFileObject> diagnostic : collector.getDiagnostics()) { |
| | | switch (diagnostic.getKind()) { |
| | | case NOTE: |
| | | case MANDATORY_WARNING: |
| | | case WARNING: |
| | | warnings.add(diagnostic); |
| | | break; |
| | | case OTHER: |
| | | case ERROR: |
| | | default: |
| | | errors.add(diagnostic); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | if (!errors.isEmpty()) { |
| | | throw new DynamicCompilerException("Compilation Error", errors); |
| | | } |
| | | } |
| | | } |
| | | } catch (Throwable e) { |
| | | throw new DynamicCompilerException(e, errors); |
| | | } finally { |
| | | compilationUnits.clear(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æå»º |
| | | */ |
| | | public void build() { |
| | | compile(); |
| | | //é¢å¤çå è½½ç±»ï¼æï¼é¦æ¬¡è°ç¨ loadClass æ¶å è½½ï¼ |
| | | getClassLoader().prepareClasses(); |
| | | } |
| | | |
| | | private List<String> diagnosticToString(List<Diagnostic<? extends JavaFileObject>> diagnostics) { |
| | | |
| | | List<String> diagnosticMessages = new ArrayList<String>(); |
| | | |
| | | for (Diagnostic<? extends JavaFileObject> diagnostic : diagnostics) { |
| | | diagnosticMessages.add( |
| | | "line: " + diagnostic.getLineNumber() + ", message: " + diagnostic.getMessage(Locale.US)); |
| | | } |
| | | |
| | | return diagnosticMessages; |
| | | |
| | | } |
| | | |
| | | public List<Diagnostic<? extends JavaFileObject>> getOriginalErrors() { |
| | | return Collections.unmodifiableList(errors); |
| | | } |
| | | |
| | | public List<Diagnostic<? extends JavaFileObject>> getOriginalWarnings() { |
| | | return Collections.unmodifiableList(warnings); |
| | | } |
| | | |
| | | public List<String> getErrors() { |
| | | return diagnosticToString(errors); |
| | | } |
| | | |
| | | public List<String> getWarnings() { |
| | | return diagnosticToString(warnings); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.liquor; |
| | | |
| | | import javax.tools.Diagnostic; |
| | | import javax.tools.JavaFileObject; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * This code mainly from: Arthas project |
| | | * |
| | | * @author noear |
| | | * @since 1.3.12 |
| | | * */ |
| | | public class DynamicCompilerException extends RuntimeException { |
| | | private static final long serialVersionUID = 1L; |
| | | private List<Diagnostic<? extends JavaFileObject>> diagnostics; |
| | | |
| | | public DynamicCompilerException(String message, List<Diagnostic<? extends JavaFileObject>> diagnostics) { |
| | | super(message); |
| | | this.diagnostics = diagnostics; |
| | | } |
| | | |
| | | public DynamicCompilerException(Throwable cause, List<Diagnostic<? extends JavaFileObject>> diagnostics) { |
| | | super(cause); |
| | | this.diagnostics = diagnostics; |
| | | } |
| | | |
| | | private String getErrors() { |
| | | StringBuilder buf = new StringBuilder(); |
| | | |
| | | if (diagnostics != null) { |
| | | for (Diagnostic<? extends JavaFileObject> diagnostic : diagnostics) { |
| | | String packagePath = getPackagePath(diagnostic); |
| | | String diagnosticString = diagnostic.toString(); |
| | | |
| | | if (packagePath == null) { |
| | | buf.append(diagnosticString).append("\n"); |
| | | } else { |
| | | if (diagnosticString.startsWith(packagePath)) { |
| | | buf.append(diagnosticString).append("\n"); |
| | | } else { |
| | | buf.append(packagePath).append(diagnosticString).append("\n"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (buf.length() > 0) { |
| | | buf.setLength(buf.length() - 1); |
| | | } |
| | | |
| | | return buf.toString(); |
| | | } |
| | | |
| | | private String getPackagePath(Diagnostic<? extends JavaFileObject> diagnostic) { |
| | | try { |
| | | String source = diagnostic.getSource().getCharContent(true).toString(); |
| | | if (source.startsWith("package ")) { |
| | | int end = source.indexOf(";"); |
| | | if (end > 0) { |
| | | return "/" + source.substring("package ".length(), end).replace(".", "/"); |
| | | } |
| | | } |
| | | } catch (Exception skip) { |
| | | |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() { |
| | | return super.getMessage() + ":\n\n" + getErrors(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.liquor; |
| | | |
| | | import javax.tools.*; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * This code mainly from: Arthas project |
| | | * */ |
| | | public class DynamicJavaFileManager extends ForwardingJavaFileManager<JavaFileManager> { |
| | | private static final String[] superLocationNames = { StandardLocation.PLATFORM_CLASS_PATH.name(), |
| | | /** JPMS StandardLocation.SYSTEM_MODULES **/ |
| | | "SYSTEM_MODULES" }; |
| | | private final PackageInternalsFinder finder; |
| | | |
| | | private final DynamicClassLoader classLoader; |
| | | private final List<MemoryByteCode> byteCodes = new ArrayList<MemoryByteCode>(); |
| | | |
| | | public DynamicJavaFileManager(JavaFileManager fileManager, DynamicClassLoader classLoader) { |
| | | super(fileManager); |
| | | this.classLoader = classLoader; |
| | | this.finder = new PackageInternalsFinder(classLoader); |
| | | } |
| | | |
| | | @Override |
| | | public JavaFileObject getJavaFileForOutput(Location location, String className, |
| | | JavaFileObject.Kind kind, FileObject sibling) throws IOException { |
| | | |
| | | for (MemoryByteCode byteCode : byteCodes) { |
| | | if (byteCode.getClassName().equals(className)) { |
| | | return byteCode; |
| | | } |
| | | } |
| | | |
| | | MemoryByteCode innerClass = new MemoryByteCode(className); |
| | | byteCodes.add(innerClass); |
| | | classLoader.registerCompiledSource(innerClass); |
| | | return innerClass; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public ClassLoader getClassLoader(Location location) { |
| | | return classLoader; |
| | | } |
| | | |
| | | @Override |
| | | public String inferBinaryName(Location location, JavaFileObject file) { |
| | | if (file instanceof CustomJavaFileObject) { |
| | | return ((CustomJavaFileObject) file).getClassName(); |
| | | } else { |
| | | /** |
| | | * if it's not CustomJavaFileObject, then it's coming from standard file manager |
| | | * - let it handle the file |
| | | */ |
| | | return super.inferBinaryName(location, file); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Iterable<JavaFileObject> list(Location location, String packageName, Set<JavaFileObject.Kind> kinds, |
| | | boolean recurse) throws IOException { |
| | | if (location instanceof StandardLocation) { |
| | | String locationName = ((StandardLocation) location).name(); |
| | | for (String name : superLocationNames) { |
| | | if (name.equals(locationName)) { |
| | | return super.list(location, packageName, kinds, recurse); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // merge JavaFileObjects from specified ClassLoader |
| | | if (location == StandardLocation.CLASS_PATH && kinds.contains(JavaFileObject.Kind.CLASS)) { |
| | | return new IterableJoin<JavaFileObject>(super.list(location, packageName, kinds, recurse), |
| | | finder.find(packageName)); |
| | | } |
| | | |
| | | return super.list(location, packageName, kinds, recurse); |
| | | } |
| | | |
| | | static class IterableJoin<T> implements Iterable<T> { |
| | | private final Iterable<T> first, next; |
| | | |
| | | public IterableJoin(Iterable<T> first, Iterable<T> next) { |
| | | this.first = first; |
| | | this.next = next; |
| | | } |
| | | |
| | | @Override |
| | | public Iterator<T> iterator() { |
| | | return new IteratorJoin<T>(first.iterator(), next.iterator()); |
| | | } |
| | | } |
| | | |
| | | static class IteratorJoin<T> implements Iterator<T> { |
| | | private final Iterator<T> first, next; |
| | | |
| | | public IteratorJoin(Iterator<T> first, Iterator<T> next) { |
| | | this.first = first; |
| | | this.next = next; |
| | | } |
| | | |
| | | @Override |
| | | public boolean hasNext() { |
| | | return first.hasNext() || next.hasNext(); |
| | | } |
| | | |
| | | @Override |
| | | public T next() { |
| | | if (first.hasNext()) { |
| | | return first.next(); |
| | | } |
| | | return next.next(); |
| | | } |
| | | |
| | | @Override |
| | | public void remove() { |
| | | throw new UnsupportedOperationException("remove"); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.liquor; |
| | | |
| | | import javax.tools.SimpleJavaFileObject; |
| | | import java.io.ByteArrayOutputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.URI; |
| | | |
| | | /** |
| | | * This code mainly from: Arthas project |
| | | * */ |
| | | public class MemoryByteCode extends SimpleJavaFileObject { |
| | | private static final char PKG_SEPARATOR = '.'; |
| | | private static final char DIR_SEPARATOR = '/'; |
| | | private static final String CLASS_FILE_SUFFIX = ".class"; |
| | | |
| | | private ByteArrayOutputStream outputStream; |
| | | protected boolean defined; |
| | | |
| | | public MemoryByteCode(String className) { |
| | | super(URI.create("byte:///" + className.replace(PKG_SEPARATOR, DIR_SEPARATOR) |
| | | + Kind.CLASS.extension), Kind.CLASS); |
| | | } |
| | | |
| | | @Override |
| | | public OutputStream openOutputStream() { |
| | | if (outputStream == null) { |
| | | outputStream = new ByteArrayOutputStream(); |
| | | } |
| | | return outputStream; |
| | | } |
| | | |
| | | public byte[] getByteCode() { |
| | | return outputStream.toByteArray(); |
| | | } |
| | | |
| | | /** |
| | | * ç§»é¤åèç ï¼ä»¥åå°å
å坿¬ï¼ |
| | | */ |
| | | protected void delByteCode() { |
| | | outputStream = null; |
| | | } |
| | | |
| | | private String className; |
| | | |
| | | public String getClassName() { |
| | | if (className == null) { |
| | | //ç¼åï¼åå°è®¡ç® |
| | | className = getName(); |
| | | className = className.replace(DIR_SEPARATOR, PKG_SEPARATOR); |
| | | className = className.substring(1, className.indexOf(CLASS_FILE_SUFFIX)); |
| | | } |
| | | |
| | | return className; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.liquor; |
| | | |
| | | import javax.tools.JavaFileObject; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.net.JarURLConnection; |
| | | import java.net.URI; |
| | | import java.net.URL; |
| | | import java.net.URLDecoder; |
| | | import java.util.*; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.jar.JarEntry; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * This code mainly from: Arthas project |
| | | * */ |
| | | public class PackageInternalsFinder { |
| | | private final ClassLoader classLoader; |
| | | private static final String CLASS_FILE_EXTENSION = ".class"; |
| | | private static final Map<String, JarFileIndex> INDEXS = new ConcurrentHashMap<>(); |
| | | |
| | | public PackageInternalsFinder(ClassLoader classLoader) { |
| | | this.classLoader = classLoader; |
| | | } |
| | | |
| | | public List<JavaFileObject> find(String packageName) throws IOException { |
| | | String javaPackageName = packageName.replaceAll("\\.", "/"); |
| | | |
| | | List<JavaFileObject> result = new ArrayList<JavaFileObject>(); |
| | | |
| | | Enumeration<URL> urlEnumeration = classLoader.getResources(javaPackageName); |
| | | while (urlEnumeration.hasMoreElements()) { // one URL for each jar on the classpath that has the given package |
| | | URL packageFolderURL = urlEnumeration.nextElement(); |
| | | result.addAll(listUnder(packageName, packageFolderURL)); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private Collection<JavaFileObject> listUnder(String packageName, URL packageFolderURL) { |
| | | File directory = new File(decode(packageFolderURL.getFile())); |
| | | if (directory.isDirectory()) { // browse local .class files - useful for local execution |
| | | return processDir(packageName, directory); |
| | | } else { // browse a jar file |
| | | return processJar(packageName, packageFolderURL); |
| | | } |
| | | } |
| | | |
| | | private List<JavaFileObject> processJar(String packageName, URL packageFolderURL) { |
| | | try { |
| | | String jarUri = packageFolderURL.toExternalForm().substring(0, packageFolderURL.toExternalForm().lastIndexOf("!/")); |
| | | JarFileIndex jarFileIndex = INDEXS.get(jarUri); |
| | | if (jarFileIndex == null) { |
| | | jarFileIndex = new JarFileIndex(jarUri, URI.create(jarUri + "!/")); |
| | | INDEXS.put(jarUri, jarFileIndex); |
| | | } |
| | | List<JavaFileObject> result = jarFileIndex.search(packageName); |
| | | if (result != null) { |
| | | return result; |
| | | } |
| | | } catch (Exception e) { |
| | | // ignore |
| | | } |
| | | // ä¿åº |
| | | return fuse(packageFolderURL); |
| | | } |
| | | |
| | | private List<JavaFileObject> fuse(URL packageFolderURL) { |
| | | List<JavaFileObject> result = new ArrayList<JavaFileObject>(); |
| | | try { |
| | | String jarUri = packageFolderURL.toExternalForm().substring(0, packageFolderURL.toExternalForm().lastIndexOf("!/")); |
| | | |
| | | JarURLConnection jarConn = (JarURLConnection) packageFolderURL.openConnection(); |
| | | String rootEntryName = jarConn.getEntryName(); |
| | | |
| | | if (rootEntryName != null) { |
| | | //å¯è½ä¸º nullï¼å
鍿²¡æç±»æä»¶ï¼åªæ¯å¼ç¨å
¶å®å
ï¼ |
| | | int rootEnd = rootEntryName.length() + 1; |
| | | |
| | | Enumeration<JarEntry> entryEnum = jarConn.getJarFile().entries(); |
| | | while (entryEnum.hasMoreElements()) { |
| | | JarEntry jarEntry = entryEnum.nextElement(); |
| | | String name = jarEntry.getName(); |
| | | |
| | | if (name.startsWith(rootEntryName) && name.indexOf('/', rootEnd) == -1 && name.endsWith(CLASS_FILE_EXTENSION)) { |
| | | URI uri = URI.create(jarUri + "!/" + name); |
| | | String binaryName = name.replaceAll("/", "."); |
| | | binaryName = binaryName.replaceAll(CLASS_FILE_EXTENSION + "$", ""); |
| | | |
| | | result.add(new CustomJavaFileObject(binaryName, uri)); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("Wasn't able to open " + packageFolderURL + " as a jar file", e); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private List<JavaFileObject> processDir(String packageName, File directory) { |
| | | File[] files = directory.listFiles(item -> |
| | | item.isFile() && getKind(item.getName()) == JavaFileObject.Kind.CLASS); |
| | | if (files != null) { |
| | | return Arrays.stream(files).map(item -> { |
| | | String className = packageName + "." + item.getName() |
| | | .replaceAll(CLASS_FILE_EXTENSION + "$", ""); |
| | | return new CustomJavaFileObject(className, item.toURI()); |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | private String decode(String filePath) { |
| | | try { |
| | | return URLDecoder.decode(filePath, "utf-8"); |
| | | } catch (Exception e) { |
| | | // ignore, return original string |
| | | } |
| | | |
| | | return filePath; |
| | | } |
| | | |
| | | public static JavaFileObject.Kind getKind(String name) { |
| | | if (name.endsWith(JavaFileObject.Kind.CLASS.extension)) |
| | | return JavaFileObject.Kind.CLASS; |
| | | else if (name.endsWith(JavaFileObject.Kind.SOURCE.extension)) |
| | | return JavaFileObject.Kind.SOURCE; |
| | | else if (name.endsWith(JavaFileObject.Kind.HTML.extension)) |
| | | return JavaFileObject.Kind.HTML; |
| | | else |
| | | return JavaFileObject.Kind.OTHER; |
| | | } |
| | | |
| | | public static class JarFileIndex { |
| | | private String jarUri; |
| | | private URI uri; |
| | | |
| | | private Map<String, List<ClassUriWrapper>> packages = new HashMap<>(); |
| | | |
| | | public JarFileIndex(String jarUri, URI uri) throws IOException { |
| | | this.jarUri = jarUri; |
| | | this.uri = uri; |
| | | loadIndex(); |
| | | } |
| | | |
| | | private void loadIndex() throws IOException { |
| | | JarURLConnection jarConn = (JarURLConnection) uri.toURL().openConnection(); |
| | | String rootEntryName = jarConn.getEntryName() == null ? "" : jarConn.getEntryName(); |
| | | Enumeration<JarEntry> entryEnum = jarConn.getJarFile().entries(); |
| | | while (entryEnum.hasMoreElements()) { |
| | | JarEntry jarEntry = entryEnum.nextElement(); |
| | | String entryName = jarEntry.getName(); |
| | | if (entryName.startsWith(rootEntryName) && entryName.endsWith(CLASS_FILE_EXTENSION)) { |
| | | String className = entryName |
| | | .substring(0, entryName.length() - CLASS_FILE_EXTENSION.length()) |
| | | .replace(rootEntryName, "") |
| | | .replace("/", "."); |
| | | if (className.startsWith(".")) className = className.substring(1); |
| | | if (className.equals("package-info") |
| | | || className.equals("module-info") |
| | | || className.lastIndexOf(".") == -1) { |
| | | continue; |
| | | } |
| | | String packageName = className.substring(0, className.lastIndexOf(".")); |
| | | List<ClassUriWrapper> classes = packages.get(packageName); |
| | | if (classes == null) { |
| | | classes = new ArrayList<>(); |
| | | packages.put(packageName, classes); |
| | | } |
| | | classes.add(new ClassUriWrapper(className, URI.create(jarUri + "!/" + entryName))); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public List<JavaFileObject> search(String packageName) { |
| | | if (this.packages.isEmpty()) { |
| | | return null; |
| | | } |
| | | if (this.packages.containsKey(packageName)) { |
| | | return packages.get(packageName).stream().map(item -> { |
| | | return new CustomJavaFileObject(item.getClassName(), item.getUri()); |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | return Collections.emptyList(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.common.liquor; |
| | | |
| | | import javax.tools.SimpleJavaFileObject; |
| | | import java.io.IOException; |
| | | import java.net.URI; |
| | | |
| | | /** |
| | | * This code mainly from: Arthas project |
| | | * */ |
| | | public class StringSource extends SimpleJavaFileObject { |
| | | private final String contents; |
| | | |
| | | public StringSource(String className, String contents) { |
| | | super(URI.create("string:///" + className.replace('.', '/') + Kind.SOURCE.extension), Kind.SOURCE); |
| | | this.contents = contents; |
| | | } |
| | | |
| | | @Override |
| | | public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { |
| | | return contents; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.buss.common.AssessUtil; |
| | | import com.ruoyi.buss.common.NumberUtils; |
| | | import com.ruoyi.buss.domain.*; |
| | | import com.ruoyi.buss.domain.dto.TaskQueryParam; |
| | | import com.ruoyi.buss.domain.vo.TaskAssess; |
| | | import com.ruoyi.buss.domain.vo.TaskAssessHis; |
| | | import com.ruoyi.buss.service.*; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.script.Invocable; |
| | | import javax.script.ScriptEngine; |
| | | import javax.script.ScriptEngineManager; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Tag(name = "è½æè¯ä¼°æ¥å£") |
| | | @RestController |
| | | @RequestMapping("/buss/assess/ex") |
| | | public class DMAssessController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IDmHarbor2Service iDmHarbor2Service; |
| | | @Autowired |
| | | private IDsTaskDetailService iDsTaskDetailService; |
| | | @Autowired |
| | | private IDsTaskList2Service iDsTaskList2Service; |
| | | @Autowired |
| | | private IDsEffectAssessService dsEffectAssessService; |
| | | @Autowired |
| | | private IDsEffectAssessListService dsEffectAssessListService; |
| | | @Autowired |
| | | private IDsEffectAssessHisService dsEffectAssessHisService; |
| | | |
| | | private Double OIL_PLACE_PER = 0.3; |
| | | private Double MAT_PLACE_PER = 0.2; |
| | | private Double AMMO_PLACE_PER = 0.5; |
| | | |
| | | @Operation(summary = "è·åè½æè¯ä¼°å表") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public AjaxResult assessList() { |
| | | List<DsEffectAssess> list = dsEffectAssessService.selectDsEffectAssessList(new DsEffectAssess()); |
| | | if(null != list){ |
| | | return success(list); |
| | | } |
| | | return error("è·åè½æè¯ä¼°å表失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®ä»»å¡IDåé¨é¨ç¼ç è·åè¯ä¼°è¯¦æ
") |
| | | @GetMapping("/assess/{type}/{taskId}/{deptId}") |
| | | @ResponseBody |
| | | public AjaxResult getByTaskId(@Parameter(name = "type", required = true, description = "è¯ä¼°ç±»å") @PathVariable("type") String type, |
| | | @Parameter(name = "taskId", required = true, description = "ä»»å¡ID") @PathVariable("taskId") Long taskId, |
| | | @Parameter(name = "deptId", required = true, description = "é¨é¨ID") @PathVariable("deptId") Long deptId) { |
| | | DsEffectAssess assess = new DsEffectAssess(); |
| | | assess.setTaskId(taskId); |
| | | assess.setDeptId(deptId); |
| | | List<DsEffectAssess> assessList = dsEffectAssessService.selectDsEffectAssessList(assess); |
| | | if(null != assessList && assessList.size() > 0){ |
| | | DsEffectAssess dsEffectAssess = assessList.get(0); |
| | | DsEffectAssessHis assessHis = new DsEffectAssessHis(); |
| | | assessHis.setTaskId(taskId); |
| | | assessHis.setDeptId(deptId); |
| | | assessHis.setTYPE(type); |
| | | List<DsEffectAssessHis> hisList = dsEffectAssessHisService.selectDsEffectAssessHisList(assessHis); |
| | | TaskAssessHis taskAssess = new TaskAssessHis(); |
| | | taskAssess.setList(hisList); |
| | | taskAssess.setAssess(dsEffectAssess); |
| | | |
| | | return success(taskAssess); |
| | | } |
| | | else{ |
| | | return calcDsEffectByTime(taskId, type); |
| | | } |
| | | } |
| | | |
| | | @Operation(summary = "宿¶-æ ¹æ®ä»»å¡IDè·åè¯ä¼°è¯¦æ
") |
| | | @GetMapping("/assess/time/{type}/{taskid}") |
| | | @ResponseBody |
| | | public AjaxResult getTime(@Parameter(name = "type", required = true, description = "è¯ä¼°ç±»å") @PathVariable("type") String type, |
| | | @Parameter(name = "taskid", required = true, description = "ä»»å¡ID") @PathVariable("taskid") Long taskid) { |
| | | if(!type.equalsIgnoreCase("JD") && !type.equalsIgnoreCase("ZD")){ |
| | | return error("è·åè¯ä¼°ç±»åé误ï¼è¯·æ£æ¥åæ°"); |
| | | } |
| | | |
| | | return calcDsEffectByTime(taskid, type); |
| | | } |
| | | |
| | | // 宿¶è®¡ç®è¯ä¼°å¼ |
| | | private AjaxResult calcDsEffectByTime(Long taskid, String type){ |
| | | |
| | | DsEffectAssessList assessList = new DsEffectAssessList(); |
| | | assessList.setTYPE(type); |
| | | List<DsEffectAssessList> weightList = dsEffectAssessListService.selectDsEffectAssessListList(assessList); |
| | | |
| | | List<DsTaskDetail> detailList = iDsTaskDetailService.selectDsTaskDetailByTaskId(taskid, null); |
| | | TaskQueryParam taskQueryParam = new TaskQueryParam(); |
| | | if(null != taskid){taskQueryParam.setTaskId(taskid);} |
| | | List<DsTaskList2> taskList2List = iDsTaskList2Service.selectDsTaskListByParam(taskQueryParam); |
| | | List<DmHarbor2> harbor2List = iDmHarbor2Service.selectDmHarborList(new DmHarbor2()); |
| | | |
| | | List<DsEffectAssessList> dsEffectAssessLists = calcDsEffect(detailList, taskList2List, harbor2List); |
| | | // æ´æ°æéææ æè
æ¯æ°å¼ |
| | | dsEffectAssessLists = updateWeight(dsEffectAssessLists, weightList); |
| | | |
| | | List<DsEffectAssessHis> hisList = covertToHis(dsEffectAssessLists, taskid); |
| | | dsEffectAssessHisService.updateEffectAssessHisList(hisList); |
| | | |
| | | // è®¡ç®æç»è¯ä¼°ç»æ |
| | | double score = getScore(dsEffectAssessLists); |
| | | DsEffectAssess dsEffectAssess = new DsEffectAssess(taskid, score); |
| | | dsEffectAssess.setCreateTime(new Date()); |
| | | dsEffectAssess.setCreateBy(getUsername()); |
| | | dsEffectAssess.setDeptId(getDeptId()); |
| | | // ä¿åè¯ä¼°ç»æ |
| | | dsEffectAssessService.updateOrInsertDsEffectAssess(dsEffectAssess); |
| | | |
| | | |
| | | TaskAssess assess = new TaskAssess(); |
| | | assess.setList(dsEffectAssessLists); |
| | | assess.setAssess(dsEffectAssess); |
| | | if(null != dsEffectAssessLists){ |
| | | return success(assess); |
| | | } |
| | | |
| | | return error("è·åè½æè¯ä¼°è¯¦æ
失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | // è·åè¯ä»·è¯¦ç»å¼ |
| | | private List<DsEffectAssessList> calcDsEffect(List<DsTaskDetail> detailList, List<DsTaskList2> taskList2List, List<DmHarbor2> harbor2List){ |
| | | List<DsEffectAssessList> result = new ArrayList<>(); |
| | | if(null != detailList && detailList.size() >0){ |
| | | int harborCount = 0; // æ¸¯å£æ°é |
| | | int berthCount = 0; // æ³ä½æ°é |
| | | int supplyTime = 0; // 忏¯å£è¡¥ç»ä»»å¡æ»æ¶é¿ |
| | | int allocTime = 0; // 忏¯å£åé
任塿»æ¶é¿ |
| | | int supplyTimeDif = 0; // è¡¥ç»åä»»å¡åé
æ¶é¿å·®é¢æ»å |
| | | List<Integer> maxTimeDifList = new ArrayList<>(); // ä¸¤æ¸¯å£æå¤§æ¶é´å·® |
| | | |
| | | int shipSupplyTime = 0; //è°èè¡¥ç»æ¶é´æ»å |
| | | int shipAllocTime = 0; // è°èåæ³æ¶é´æ»å |
| | | |
| | | int allTime = 0; // 任塿»æ¶é¿ |
| | | int workTime = 0; // ç´¯è®¡è¡¥ç»æ¶é´æ»è®¡ |
| | | int stopTime = 0; // 累计åé æ¶é´ |
| | | int oilTime = 0; // æ²¹æè¡¥ç»æ»æ¶é¿ |
| | | int matTime = 0; // ç©èµè¡¥ç»æ»æ¶é¿ |
| | | int ammoTime = 0; // å¼¹è¯è¡¥ç»æ»æ¶é¿ |
| | | |
| | | double platMaxPer = 0.0; // åºå°å ç¨æå¤§å¼æ»å |
| | | int platHalfTime = 0; // æ³ä½å ç¨è¿åæ¶é´ |
| | | int posAreaNotSameCount = 0; |
| | | |
| | | Map<Long, List<DsTaskDetail>> groupedTaskList = detailList.stream() |
| | | .collect(Collectors.groupingBy(DsTaskDetail::getHarborId)); |
| | | |
| | | Set<Long> harborIds = new HashSet<>(); |
| | | Set<Long> berthIds = new HashSet<>(); |
| | | |
| | | AtomicReference<Double> carTotalCountRef = new AtomicReference<>(0.0); // åæ³ä½ç©èµè½¦æ¬¡æ»å¼ |
| | | |
| | | for (Map.Entry<Long, List<DsTaskDetail>> entry : groupedTaskList.entrySet()) { |
| | | |
| | | harborIds.add(entry.getKey()); |
| | | |
| | | Map<Long, List<DsTaskDetail>> groupedBerthTaskList = detailList.stream() |
| | | .collect(Collectors.groupingBy(DsTaskDetail::getBerthId)); |
| | | |
| | | int maxHarborTime = 0; // æ³ä½æå¤§æ¶é¿ |
| | | int allocHarborTime = 0; //s |
| | | for (Map.Entry<Long, List<DsTaskDetail>> berthEntry : groupedBerthTaskList.entrySet()) { |
| | | berthIds.add(berthEntry.getKey()); |
| | | |
| | | int maxOilTime = berthEntry.getValue().stream() |
| | | .mapToInt(DsTaskDetail::getOilTime) |
| | | .max() |
| | | .orElse(0); |
| | | int maxMatTime = berthEntry.getValue().stream() |
| | | .mapToInt(DsTaskDetail::getMatTime) |
| | | .max() |
| | | .orElse(0); |
| | | int maxAmmoTime = berthEntry.getValue().stream() |
| | | .mapToInt(DsTaskDetail::getAmmoTime) |
| | | .max() |
| | | .orElse(0); |
| | | |
| | | berthEntry.getValue().stream().forEach(item -> { |
| | | int matTmpTime = item.getMatTime(); |
| | | int totalCount = 0; |
| | | if(null != item.getFood()){ |
| | | totalCount += item.getFood(); |
| | | } |
| | | if(null != item.getFoodW()){ |
| | | totalCount += item.getFoodW(); |
| | | } |
| | | if(null != item.getFoodO()){ |
| | | totalCount += item.getFoodO(); |
| | | } |
| | | |
| | | if(matTmpTime <= 24) { |
| | | int finalTotalCount = totalCount; |
| | | carTotalCountRef.updateAndGet(v -> (v + finalTotalCount)); |
| | | } |
| | | else{ |
| | | int finalTotalCount1 = totalCount; |
| | | carTotalCountRef.updateAndGet(v -> (v + |
| | | NumberUtils.roundToTwoDecimalPlaces(finalTotalCount1 / matTmpTime * 24))); |
| | | } |
| | | }); |
| | | |
| | | int maxTime = Math.max(Math.max(maxOilTime, maxMatTime), maxAmmoTime); |
| | | oilTime += maxOilTime; |
| | | matTime += maxMatTime; |
| | | ammoTime += maxAmmoTime; |
| | | if(maxTime > maxHarborTime){maxHarborTime = maxTime;} |
| | | supplyTime += maxTime; |
| | | allocHarborTime += maxTime; |
| | | if(allTime < maxTime) {allTime = maxTime;} |
| | | |
| | | platMaxPer += getMaxPlat(berthEntry.getValue()); |
| | | platHalfTime += getPlatHalfTime(berthEntry.getValue()); |
| | | } |
| | | allocTime += groupedBerthTaskList.size() * maxHarborTime; |
| | | supplyTimeDif += (allocTime - allocHarborTime); |
| | | maxTimeDifList.add(maxHarborTime); |
| | | } |
| | | |
| | | for (DsTaskDetail detail : detailList) { |
| | | // åé
æ¶é´ |
| | | int maxTime = Math.max(Math.max(NumberUtils.getOrDefault(detail.getAmmoEtime(), 0) , |
| | | NumberUtils.getOrDefault(detail.getOilEtime(), 0)), NumberUtils.getOrDefault(detail.getMatEtime(), 0)); |
| | | // è¡¥ç»æ¶é´ |
| | | int tApplyTime = 0; |
| | | // è¡¥ç»æ¶é´ |
| | | if(null != detail.getSupplySeq() && (detail.getSupplySeq().equals("2") || detail.getSupplySeq().equals("3"))) { |
| | | // å¦æä¸ºå
æ²¹åå¼¹å两个æ¶é´ç¸å |
| | | tApplyTime = (detail.getAmmoTime() == null ? 0 : detail.getAmmoTime())+ (null == detail.getOilTime() ? 0 : detail.getOilTime()); |
| | | if(tApplyTime < detail.getMatTime()){ |
| | | tApplyTime = detail.getMatTime(); |
| | | } |
| | | } |
| | | else{ |
| | | // åæ¶è¡¥å
éæ©æå¤§å¼ |
| | | tApplyTime = Math.max(Math.max(Math.max(NumberUtils.getOrDefault(detail.getAmmoTime(), 0), |
| | | NumberUtils.getOrDefault(detail.getMatTime(), 0)), NumberUtils.getOrDefault(detail.getOilTime(), 0)), |
| | | NumberUtils.getOrDefault(detail.getWaterTime(), 0)); |
| | | } |
| | | shipSupplyTime += tApplyTime; |
| | | shipAllocTime += maxTime; |
| | | |
| | | if(!isShipPosAreaSame(taskList2List, detail.getTaskId(), detail.getShipNo(), harbor2List)){ |
| | | posAreaNotSameCount++; |
| | | } |
| | | } |
| | | |
| | | workTime = oilTime + matTime; |
| | | harborCount = harborIds.size(); |
| | | berthCount = berthIds.size(); |
| | | |
| | | int maxMinTimeDif = 0; |
| | | // 忏¯å£è¡¥ç»ä½ä¸æç»ç»æä¸¤ä¸¤æ¶é´å·®çæå¤§å¼A3 |
| | | if (!maxTimeDifList.isEmpty()) { |
| | | int maxTimeDif = maxTimeDifList.stream().mapToInt(Integer::intValue).max().orElse(0); |
| | | int minTimeDif = maxTimeDifList.stream().mapToInt(Integer::intValue).min().orElse(0); |
| | | maxMinTimeDif = maxTimeDif - minTimeDif; |
| | | // è¿éå¯ä»¥æ ¹æ®éè¦ä½¿ç¨ maxMinTimeDif åé |
| | | } |
| | | |
| | | // æ¬æ¹æ¬¡è°èæ°é |
| | | int shipCount = detailList.size(); // æ¬æ¹æ¬¡è¹æ°é |
| | | double days = NumberUtils.roundToTwoDecimalPlaces((double) allTime / 24); // æ»æ¹æ¬¡è¡¥ç»å¤©æ° |
| | | double carTotalCount = carTotalCountRef.get(); // åæ³ä½ç©èµè½¦æ¬¡æ»å¼ |
| | | |
| | | // è¡¥ç»æ¹æ¡ -- æ¹æ¬¡æ»è¡¥ç»æ°é |
| | | double harborShipCountPercent = NumberUtils.roundToTwoDecimalPlaces(AssessUtil.getPercentForShipCount(shipCount)); |
| | | // è¡¥ç»æ¹æ¡ -- æ¹æ¬¡åè°æå è¡¥ç»æ¶é´ |
| | | double harborShipEmptyPercent = NumberUtils.roundToTwoDecimalPlaces(AssessUtil.getPercentForShipEmpty(supplyTimeDif/ shipCount)); |
| | | // è¡¥ç»æ¹æ¡ -- 忏¯å£ç»ææå¤§æ¶é´å·® |
| | | double harborEndTimeAvgPercent = NumberUtils.roundToTwoDecimalPlaces(AssessUtil.getPercentForHarborTimeDif(maxMinTimeDif)); |
| | | // è¡¥ç»æ¹æ¡ -- æå¤§æ¶é´å·®å æ»æ¶é´æ¯ |
| | | double harborMaxDifPercent = NumberUtils.roundToTwoDecimalPlaces( 1 - (double)maxMinTimeDif / allTime ); |
| | | // è¡¥ç»æ¹æ¡ -- æ¬æ¹æ¬¡è·¨åºè°åº¦è°è¹æ° |
| | | double harborZoomDifPercent = NumberUtils.roundToTwoDecimalPlaces(1 - (double)posAreaNotSameCount / shipCount); |
| | | // è¡¥ç»æ¹æ¡ -- 忏¯å£ç»ææ¶é´å·® 0.4 å¼å§æ¶é´ ç»ææ¶é´ |
| | | // double harborAvgTimePercent = NumberUtils.roundToTwoDecimalPlaces(1-(double)(allocTime - supplyTime)/allocTime); |
| | | // // è¡¥ç»æ¹æ¡ -- æ¸¯å£æ¶é´å·®å æ¯åå¼ æ¯ä¸ªæ¸¯å£ è¡¥ç»æ¶é´ å¼å§ç»ææ¶é´å·® |
| | | // double harborTimePercent = NumberUtils.roundToTwoDecimalPlaces(1- (double)supplyTime / allocTime); |
| | | |
| | | // åè¡¥è°è¹ -- åè°å¹³ååé æ¶é´ |
| | | double applyShipAvgStopTimePercent = NumberUtils.roundToTwoDecimalPlaces(AssessUtil.getPercentForShipStopTime(supplyTime / shipCount)); |
| | | // åè¡¥è°è¹ -- è¡¥ç»ä½ä¸æ¶é´åå¼ |
| | | double applyShipWorkTimePercent = NumberUtils.roundToTwoDecimalPlaces(AssessUtil.getPercentForApplyTime(supplyTime / shipCount)); |
| | | // åè¡¥è°è¹ -- è¡¥ç»éä½ä¸æ¶é´åå¼ |
| | | double applyShipWorkNoTimePercent = NumberUtils.roundToTwoDecimalPlaces(AssessUtil.getPercentForNotApplyTime(supplyTimeDif/ shipCount)); |
| | | // åè¡¥è°è¹ -- è¡¥ç»ä½ä¸åæ³æ¯ä¾ 0.2 ææè¹è¡¥ç»æ»å ææè¹å ç¨æ¶é¿ |
| | | double shipStopPercent = NumberUtils.roundToTwoDecimalPlaces((double)shipSupplyTime/shipAllocTime); |
| | | // åè¡¥è°è¹ -- è¡¥ç»æ¶é´æå æ¯ä¾ æå¤§å¼å§-ç»ææ¶é´ ææè¹è¡¥ç»æ¶é´æ»å |
| | | double shipEmptyPercent = NumberUtils.roundToTwoDecimalPlaces(1 - (double)(shipSupplyTime/detailList.size()) / allTime); |
| | | |
| | | |
| | | // è¡¥ç»å
µå -- æ°´ä¿æ¥ä½ä¸æ¶é´æ¯ 0.2 é»è®¤å¼ 1 ï¼ä¸è®¡ç®ï¼ |
| | | double applyWaterPercent = 1; |
| | | // è¡¥ç»å
µå -- æ²¹ä¿æ¥ä½ä¸æ¶é´æ¯ å æ²¹æ»æ¶é¿/æ³ä½æ°/åé æ»æ¶é¿ |
| | | double applyOilPercent = NumberUtils.roundToTwoDecimalPlaces((double)oilTime / berthCount / allTime ); |
| | | // è¡¥ç»å
µå -- ç©èµæ¥ä½ä¸æ¶é´æ¯ å æ²¹æ»æ¶é¿/æ³ä½æ°/åé æ»æ¶é¿ |
| | | double applyMatPercent = NumberUtils.roundToTwoDecimalPlaces((double)matTime / allocTime); |
| | | |
| | | |
| | | // è¡¥ç»è®¾æ½ -- æ³ä½æ¥åå¨è½¬è次 |
| | | double facBerthPercent = NumberUtils.roundToTwoDecimalPlaces( |
| | | AssessUtil.getPercentForBerthTime( NumberUtils.roundToTwoDecimalPlaces(shipCount / days / berthCount ))); |
| | | // è¡¥ç»è®¾æ½ -- åæ²¿å 尿大åå¼ 0.2 |
| | | double facPartPercent = NumberUtils.roundToTwoDecimalPlaces(platMaxPer / berthCount / 1.5); |
| | | if(facPartPercent > 1) facPartPercent = 1.0; |
| | | // è¡¥ç»è®¾æ½ -- åæ²¿å åæ¶é¿åå¼ |
| | | double facPartTimePercent = NumberUtils.roundToTwoDecimalPlaces(AssessUtil.getPercentForBerthHoldTime((double) platHalfTime / berthCount)); |
| | | // è¡¥ç»è®¾æ½ -- å æ²¹è®¾æ½æ¥å使ç¨ç |
| | | double facOilPercent = NumberUtils.roundToTwoDecimalPlaces((double)oilTime / berthCount / allTime ); |
| | | // è¡¥ç»è®¾æ½ -- åæ³ä½ç©èµè½¦æ¬¡åå¼ |
| | | double facCarPercent = NumberUtils.roundToTwoDecimalPlaces(AssessUtil.getPercentForCar((double)carTotalCount / berthCount )); |
| | | |
| | | result.add(new DsEffectAssessList("JD","A12", harborShipCountPercent, 0.1, 0.4)); |
| | | result.add(new DsEffectAssessList("JD","A13", harborShipEmptyPercent, 0.2, 0.4)); |
| | | result.add(new DsEffectAssessList("JD","A14", harborEndTimeAvgPercent, 0.2, 0.4)); |
| | | result.add(new DsEffectAssessList("JD","A15", harborMaxDifPercent, 0.3, 0.4)); |
| | | result.add(new DsEffectAssessList("JD","A16", harborZoomDifPercent, 0.2, 0.4)); |
| | | |
| | | result.add(new DsEffectAssessList("JD","A21", applyShipAvgStopTimePercent, 0.2, 0.2)); |
| | | result.add(new DsEffectAssessList("JD","A22", applyShipWorkTimePercent, 0.2, 0.2)); |
| | | result.add(new DsEffectAssessList("JD","A23", applyShipWorkNoTimePercent, 0.2, 0.2)); |
| | | result.add(new DsEffectAssessList("JD","A24", shipStopPercent, 0.2, 0.2)); |
| | | result.add(new DsEffectAssessList("JD","A25", shipEmptyPercent, 0.2, 0.2)); |
| | | |
| | | result.add(new DsEffectAssessList("JD","A31", applyWaterPercent, 0.3, 0.2)); |
| | | result.add(new DsEffectAssessList("JD","A32", applyOilPercent, 0.4, 0.2)); |
| | | result.add(new DsEffectAssessList("JD","A33", applyMatPercent, 0.3,0.2)); |
| | | |
| | | result.add(new DsEffectAssessList("JD","A41", facBerthPercent, 0.3, 0.2)); |
| | | result.add(new DsEffectAssessList("JD","A42", facPartPercent, 0.1, 0.2)); |
| | | result.add(new DsEffectAssessList("JD","A43", facPartTimePercent, 0.2, 0.2)); |
| | | result.add(new DsEffectAssessList("JD","A44", facOilPercent, 0.2, 0.2)); |
| | | result.add(new DsEffectAssessList("JD","A45", facCarPercent, 0.2, 0.2)); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | // è·åæ³ä½æå¤§åºå°å ç¨ |
| | | private Double getMaxPlat(List<DsTaskDetail> list){ |
| | | double maxPlat = 0.0; |
| | | for (int i = 1; i <= 24; i++) { |
| | | int oilCount = 0; |
| | | int ammoCount = 0; |
| | | int matCount = 0; |
| | | for (DsTaskDetail task : list) { |
| | | if (task.getOilStime() != null && task.getOilStime() <= i && task.getOilEtime() >= i) { |
| | | oilCount++; |
| | | } else if (task.getAmmoStime() != null && task.getAmmoStime() <= i && task.getAmmoEtime() >= i) { |
| | | ammoCount++; |
| | | } else if (task.getMatStime() != null && task.getMatStime() <= i && task.getMatEtime() >= i) { |
| | | matCount++; |
| | | } |
| | | } |
| | | |
| | | Double totalSupply = NumberUtils.roundToTwoDecimalPlaces(oilCount * OIL_PLACE_PER + ammoCount * AMMO_PLACE_PER + matCount * MAT_PLACE_PER); |
| | | if(maxPlat < totalSupply){ |
| | | maxPlat = totalSupply; |
| | | } |
| | | } |
| | | return maxPlat; |
| | | } |
| | | |
| | | // è·åæ³ä½å ç¨è¿åçæ¶é´ |
| | | private Integer getPlatHalfTime(List<DsTaskDetail> list){ |
| | | Integer platTime = 0; |
| | | for (int i = 1; i <= 24; i++) { |
| | | int oilCount = 0; |
| | | int ammoCount = 0; |
| | | int matCount = 0; |
| | | for (DsTaskDetail task : list) { |
| | | if (task.getOilStime() != null && task.getOilStime() <= i && task.getOilEtime() >= i) { |
| | | oilCount++; |
| | | } else if (task.getAmmoStime() != null && task.getAmmoStime() <= i && task.getAmmoEtime() >= i) { |
| | | ammoCount++; |
| | | } else if (task.getMatStime() != null && task.getMatStime() <= i && task.getMatEtime() >= i) { |
| | | matCount++; |
| | | } |
| | | } |
| | | Double totalSupply = NumberUtils.roundToTwoDecimalPlaces(oilCount * OIL_PLACE_PER + ammoCount * AMMO_PLACE_PER + matCount * MAT_PLACE_PER); |
| | | if(totalSupply >= 0.5){ |
| | | platTime++; |
| | | } |
| | | } |
| | | return platTime; |
| | | } |
| | | |
| | | // è®¡ç®æç»åæ° |
| | | private Double getScore(List<DsEffectAssessList> list){ |
| | | Double score = 0.0; |
| | | if(null != list && list.size() > 0){ |
| | | Map<String, List<DsEffectAssessList>> groupedByCode = list.stream() |
| | | .collect(Collectors.groupingBy(item -> item.getCODE().substring(0, 2))); |
| | | |
| | | for (Map.Entry<String, List<DsEffectAssessList>> berthEntry : groupedByCode.entrySet()) { |
| | | DsEffectAssessList effectAssess = berthEntry.getValue().get(0); |
| | | Double classifyWeight = null == effectAssess.getClassifyWeight()?0.0:effectAssess.getClassifyWeight(); |
| | | |
| | | Double totalValue = berthEntry.getValue().stream() |
| | | .mapToDouble(item -> item.getVal() * item.getWEIGHT()) |
| | | .sum(); |
| | | score += totalValue * classifyWeight; |
| | | } |
| | | } |
| | | return NumberUtils.roundToTwoDecimalPlaces(score * 10); |
| | | } |
| | | |
| | | private Double getScore3(List<DsEffectAssessList> list){ |
| | | |
| | | ScriptEngineManager manager = new ScriptEngineManager(); |
| | | ScriptEngine engine = manager.getEngineByName("JavaScript"); |
| | | |
| | | try { |
| | | // æå»ºJavaScript彿° |
| | | String script = "function calculateScore(list) {" + |
| | | " var score = 0;" + |
| | | " if(list && list.length > 0) {" + |
| | | " var groupedByCode = {};" + |
| | | " for(var i = 0; i < list.length; i++) {" + |
| | | " var code = list[i].CODE.substring(0,2);" + |
| | | " if(!groupedByCode[code]) {" + |
| | | " groupedByCode[code] = [];" + |
| | | " }" + |
| | | " groupedByCode[code].push(list[i]);" + |
| | | " }" + |
| | | " for(var code in groupedByCode) {" + |
| | | " var items = groupedByCode[code];" + |
| | | " var classifyWeight = items[0].classifyWeight || 0;" + |
| | | " var totalValue = 0;" + |
| | | " for(var j = 0; j < items.length; j++) {" + |
| | | " totalValue += items[j].val * items[j].WEIGHT;" + |
| | | " }" + |
| | | " score += totalValue * classifyWeight;" + |
| | | " }" + |
| | | " }" + |
| | | " return Math.round(score * 10 * 100) / 100;" + |
| | | "}"; |
| | | |
| | | // ç¼è¯å¹¶æ§è¡èæ¬ |
| | | engine.eval(script); |
| | | |
| | | // å°Java对象转æ¢ä¸ºJSON |
| | | String jsonList = JSONObject.toJSONString(list); |
| | | |
| | | // è°ç¨JavaScript彿° |
| | | Invocable invocable = (Invocable) engine; |
| | | Object result = invocable.invokeFunction("calculateScore", jsonList); |
| | | |
| | | return Double.parseDouble(result.toString()); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | System.out.println("计ç®åæ°å¤±è´¥"); |
| | | return 0.0; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ä»»å¡IDåè·å·è·å对åºçä»»å¡ |
| | | * @param list |
| | | * @param taskid |
| | | * @param shipNo |
| | | * @return |
| | | */ |
| | | private boolean isShipPosAreaSame(List<DsTaskList2> list, Long taskid, String shipNo, List<DmHarbor2> harbor2List){ |
| | | Optional<DsTaskList2> tmpTaskOptions = list.stream().filter(task -> task.getTaskId() == taskid && task.getShipNo().equals(shipNo)).findFirst(); |
| | | if(!tmpTaskOptions.isEmpty()){ |
| | | Optional<DmHarbor2> harbor2 = harbor2List.stream().filter(dmHarbor2 -> |
| | | dmHarbor2.getDOCKNAME().equals(tmpTaskOptions.get().getPosArea()) && tmpTaskOptions.get().getHarborId() == dmHarbor2.getPKID()).findFirst(); |
| | | if(!harbor2.isEmpty()){ |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private DsEffectAssessHis covertToHis(DsEffectAssessList assessList, Long taskId){ |
| | | DsEffectAssessHis his = null; |
| | | if(null != assessList){ |
| | | his = new DsEffectAssessHis(); |
| | | his.setClassifyIndex(assessList.getClassifyIndex()); |
| | | his.setCODE(assessList.getCODE()); |
| | | his.setClassifyWeight(assessList.getClassifyWeight()); |
| | | his.setITEM(assessList.getITEM()); |
| | | his.setDeptId(assessList.getDeptId()); |
| | | his.setItemDetail(assessList.getItemDetail()); |
| | | his.setNORMAL(assessList.getNORMAL()); |
| | | his.setPLAN(assessList.getPLAN()); |
| | | his.setTaskId(assessList.getAssessId()); |
| | | his.setTYPE(assessList.getTYPE()); |
| | | his.setWEIGHT(assessList.getWEIGHT()); |
| | | his.setUNIT(assessList.getUNIT()); |
| | | his.setCreateBy(assessList.getCreateBy()); |
| | | his.setCreateTime(new Date()); |
| | | his.setVal(assessList.getVal()); |
| | | his.setTaskId(taskId); |
| | | } |
| | | return his; |
| | | } |
| | | |
| | | private List<DsEffectAssessHis> covertToHis(List<DsEffectAssessList> assessLists, Long taskId){ |
| | | List<DsEffectAssessHis> list = new ArrayList<>(); |
| | | for(DsEffectAssessList tmp : assessLists){ |
| | | list.add(this.covertToHis(tmp, taskId)); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | // æ´æ°æéå¼ |
| | | private List<DsEffectAssessList> updateWeight(List<DsEffectAssessList> list, List<DsEffectAssessList> weightList){ |
| | | Long deptId = getDeptId(); |
| | | List<DsEffectAssessList> result = new ArrayList<>(); |
| | | if(null != list && list.size() > 0 && null != weightList && weightList.size() > 0) { |
| | | for(DsEffectAssessList item : list){ |
| | | DsEffectAssessList tmpAssess = getWeightValFromList(weightList, item); |
| | | if(null != tmpAssess){ |
| | | item.setWEIGHT(tmpAssess.getWEIGHT()); |
| | | item.setClassifyWeight(tmpAssess.getClassifyWeight()); |
| | | item.setPLAN(tmpAssess.getPLAN()); |
| | | item.setITEM(tmpAssess.getITEM()); |
| | | item.setItemDetail(tmpAssess.getItemDetail()); |
| | | item.setUNIT(tmpAssess.getUNIT()); |
| | | item.setNORMAL(tmpAssess.getNORMAL()); |
| | | item.setClassifyIndex(tmpAssess.getClassifyIndex()); |
| | | item.setDeptId(deptId); |
| | | } |
| | | result.add(item); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | // è·å对åºçæéå¼è¡ |
| | | private DsEffectAssessList getWeightValFromList(List<DsEffectAssessList> list, DsEffectAssessList dsEffectAssessList){ |
| | | for (DsEffectAssessList assessList : list ){ |
| | | if(assessList.getTYPE().equals(dsEffectAssessList.getTYPE()) && assessList.getCODE().equals(dsEffectAssessList.getCODE())){ |
| | | return assessList; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import com.ruoyi.buss.domain.DsTaskDetail; |
| | | import com.ruoyi.buss.domain.DsTaskList2; |
| | | import com.ruoyi.buss.domain.vo.*; |
| | | import com.ruoyi.buss.service.IDsTaskDetailService; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | |
| | | @Tag(name = "岸æ
任塿¥å£") |
| | | @RestController |
| | | @RequestMapping("/buss/task/aq") |
| | | public class DMTaskAQController extends BaseController { |
| | | |
| | | private Double OIL_PLACE_PER = 0.3; |
| | | private Double MAT_PLACE_PER = 0.2; |
| | | private Double AMMO_PLACE_PER = 0.5; |
| | | private Double TOTAL_PLACE_PER = 1.5; |
| | | DecimalFormat decimalFormat = new DecimalFormat("#.##"); |
| | | |
| | | @Autowired |
| | | private IDsTaskDetailService dsTaskDetailService; |
| | | |
| | | @Operation(summary = "è·å岸æ
å½åä»»å¡å表") |
| | | @GetMapping("/plan/list/statis") |
| | | @ResponseBody |
| | | public AjaxResult listPlan(@Parameter(name = "deptId", description = "é¨é¨ç¼ç ") Long deptId) { |
| | | if(null == deptId)deptId = getDeptId(); |
| | | |
| | | // ç¶æä¸º2 å¹¶ä¸ |
| | | List<DsTaskDetail> detailList = dsTaskDetailService.selectAQCurTaskDetailList(deptId); |
| | | |
| | | if(null != detailList){ |
| | | return success(covertToStatis(detailList)); |
| | | } |
| | | return error("è·åä»»å¡å表失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "è·å岸æ
å½åä»»å¡å表TIME") |
| | | @GetMapping("/plan/list/statis/time") |
| | | @ResponseBody |
| | | public AjaxResult listPlanTime(@Parameter(name = "deptId", description = "é¨é¨ç¼ç ") Long deptId) { |
| | | if(null == deptId)deptId = getDeptId(); |
| | | |
| | | // ç¶æä¸º2 å¹¶ä¸ |
| | | List<DsTaskDetail> detailList = dsTaskDetailService.selectAQCurTaskDetailList(deptId); |
| | | |
| | | if(null != detailList){ |
| | | return success(covertToStatisTime(detailList)); |
| | | } |
| | | return error("è·åä»»å¡å表失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "ææä»»å¡å表") |
| | | @GetMapping("/plan/list") |
| | | @ResponseBody |
| | | public AjaxResult list(@Parameter(name = "deptId", description = "é¨é¨ç¼ç ") Long deptId) { |
| | | if(null == deptId)deptId = getDeptId(); |
| | | |
| | | // ç¶æä¸º2 å¹¶ä¸ |
| | | List<DsTaskDetail> detailList = dsTaskDetailService.selectAQCurTaskDetailList(deptId); |
| | | |
| | | if(null != detailList){ |
| | | return success(detailList); |
| | | } |
| | | return error("è·åä»»å¡å表失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "ææä»»å¡å表TIME") |
| | | @GetMapping("/plan/list/time") |
| | | @ResponseBody |
| | | public AjaxResult listTime(@Parameter(name = "deptId", description = "é¨é¨ç¼ç ") Long deptId) { |
| | | if(null == deptId)deptId = getDeptId(); |
| | | |
| | | // ç¶æä¸º2 å¹¶ä¸ |
| | | List<DsTaskDetail> detailList = dsTaskDetailService.selectAQCurTaskDetailList(deptId); |
| | | |
| | | List<DsTaskDetailVO> result = new ArrayList<>(); |
| | | for(DsTaskDetail detail : detailList){ |
| | | result.add(new DsTaskDetailVO(detail)); |
| | | } |
| | | |
| | | if(null != result){ |
| | | return success(result); |
| | | } |
| | | return error("è·åä»»å¡å表失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "è·ååºå°ç»ç¹") |
| | | @GetMapping("/place/list") |
| | | @ResponseBody |
| | | public AjaxResult getPlanList(@Parameter(name = "deptId", description = "é¨é¨ç¼ç ") Long deptId) { |
| | | if(null == deptId)deptId = getDeptId(); |
| | | // ç¶æä¸º2 å¹¶ä¸ |
| | | List<DsTaskDetail> detailList = dsTaskDetailService.selectAQCurTaskDetailList(deptId); |
| | | if(null != detailList){ |
| | | return success(covertToPlaceType(detailList)); |
| | | } |
| | | return error("è·åä»»å¡å表失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "ä¿®æ¹åºå°ä½ä¸å°ç»") |
| | | @PostMapping("/plan/edit/{id}") |
| | | @ResponseBody |
| | | public AjaxResult editPla(@Parameter(name = "id", required = true, description = "ä»»å¡ID") @PathVariable("id") Long id, |
| | | @Parameter(name = "workGrpId", required = true, description = "å·¥ä½å°ç»ID") Long workGrpId, |
| | | @Parameter(name = "type", description = "å·¥ä½å°ç»ç±»åï¼é»è®¤ä¸º1æ°´çµï¼2为ç©èµ") String type) { |
| | | DsTaskDetail detail = dsTaskDetailService.selectDsTaskDetailByPKID(id); |
| | | if(null != detail){ |
| | | if(StringUtils.isNotBlank(type) && type.equals("2")){ |
| | | detail.setWorkMatGrpId(workGrpId); |
| | | } |
| | | else{ |
| | | detail.setWorkGrpId(workGrpId); |
| | | } |
| | | int flag = dsTaskDetailService.updateDsTaskDetail(detail); |
| | | if(flag == 1){ |
| | | return success("æ´æ°ä½ä¸å°ç»æå"); |
| | | } |
| | | return error("æ´æ°ä½ä¸å°ç»å¤±è´¥"); |
| | | } |
| | | return error("è·åä»»å¡ä¿¡æ¯å¤±è´¥ï¼è¯·æ£æ¥ä»»å¡ID"); |
| | | } |
| | | |
| | | @Operation(summary = "ä¿®æ¹è®¡å") |
| | | @PostMapping("/plan/update") |
| | | @ResponseBody |
| | | public AjaxResult editPlanDetail(@RequestBody DsTaskDetail detail) { |
| | | if(null != detail){ |
| | | Long pkid = detail.getPKID(); |
| | | if(null == pkid){ |
| | | return error("对象IDä¸è½ä¸ºç©º"); |
| | | } |
| | | DsTaskDetail newDetail = dsTaskDetailService.selectDsTaskDetailByPKID(pkid); |
| | | if(null == newDetail){ |
| | | return error("æªè·åå°å¯¹åºç计åä¿¡æ¯"); |
| | | } |
| | | if(null != detail.getMatStime())newDetail.setMatStime(detail.getMatStime()); |
| | | if(null != detail.getMatEtime())newDetail.setMatEtime(detail.getMatEtime()); |
| | | if(null != detail.getWaterStime())newDetail.setWaterStime(detail.getWaterStime()); |
| | | if(null != detail.getWaterEtime())newDetail.setWaterEtime(detail.getWaterEtime()); |
| | | if(null != detail.getOilStime())newDetail.setOilStime(detail.getOilStime()); |
| | | if(null != detail.getOilEtime())newDetail.setOilEtime(detail.getOilEtime()); |
| | | if(null != detail.getAmmoStime())newDetail.setAmmoStime(detail.getAmmoStime()); |
| | | if(null != detail.getAmmoEtime())newDetail.setAmmoEtime(detail.getAmmoEtime()); |
| | | if(null != detail.getWorkGrpId())newDetail.setWorkGrpId(detail.getWorkGrpId()); |
| | | if(null != detail.getWorkMatGrpId())newDetail.setWorkMatGrpId(detail.getWorkMatGrpId()); |
| | | |
| | | int flag = dsTaskDetailService.updateDsTaskDetail(newDetail); |
| | | if(flag == 1){ |
| | | return success("æ´æ°è®¡å任塿å"); |
| | | } |
| | | return error("æ´æ°è®¡åä»»å¡å¤±è´¥"); |
| | | } |
| | | return error("è·åä»»å¡ä¿¡æ¯å¤±è´¥ï¼è¯·æ£æ¥ä»»å¡ID"); |
| | | } |
| | | |
| | | private List<TaskPlace> covertToPlaceType(List<DsTaskDetail> list){ |
| | | List<TaskPlace> taskPlaces = new ArrayList<>(); |
| | | |
| | | Map<Long, List<DsTaskDetail>> groupedByBerthId = new HashMap<>(); |
| | | for (DsTaskDetail task : list) { |
| | | Long berthId = task.getBerthId(); |
| | | if (!groupedByBerthId.containsKey(berthId)) { |
| | | groupedByBerthId.put(berthId, new ArrayList<>()); |
| | | } |
| | | groupedByBerthId.get(berthId).add(task); |
| | | } |
| | | |
| | | for (Map.Entry<Long, List<DsTaskDetail>> entry : groupedByBerthId.entrySet()) { |
| | | Long berthId = entry.getKey(); |
| | | List<DsTaskDetail> tasks = entry.getValue(); |
| | | String berthName = tasks.get(0).getBerthName(); |
| | | |
| | | TaskPlace waterSupply = new TaskPlace(berthId, berthName, "æ°´çµè¡¥ç»"); |
| | | TaskPlace oilSupply = new TaskPlace(berthId, berthName, "æ²¹æè¡¥ç»"); |
| | | TaskPlace ammoSupply = new TaskPlace(berthId, berthName, "å¼¹è¯è¡¥ç»"); |
| | | TaskPlace materialSupply = new TaskPlace(berthId, berthName, "ç©èµè¡¥ç»"); |
| | | TaskPlace totalSupply = new TaskPlace(berthId, berthName, "å计å ç¨"); |
| | | |
| | | |
| | | // åå«è®¡ç®ä¸åç§ç±»çå ç¨å°ä¸åæ¶é´å段ï¼ä¾å¦t1 代表æ¶é´1çå ç¨ï¼ä¸ç´å°t24 代表第24å°æ¶çå ç¨æ
åµï¼ |
| | | // waterSupply ä½¿ç¨ waterSTime ä¸ waterETime åæ®µï¼ oilSupplyä½¿ç¨ oilSTime ä¸oilETime åæ®µ |
| | | // ammoSupply ä½¿ç¨ ammoSTime ä¸ ammoETime åæ®µï¼ materialSupply ä½¿ç¨ matStime ä¸ matETime åæ®µ |
| | | // å¨å½ådstaskdetail对象ä¸ï¼ä¾å¦æ¥çæ°´çµè¡¥ç»ï¼éè¦æ¥ç waterStime åæ®µä»£è¡¨å¼å§æ¶é´ï¼watereTimeä»£è¡¨ç»ææ¶é´ |
| | | // totalSupply åæ®µä»£è¡¨å计å ç¨ éè¦æåé¢åç§ç±»åè¡¥ç»åå¹¶èµ·æ¥ã |
| | | for (int i = 1; i <= 24; i++) { |
| | | String timeSlot = "t" + i; |
| | | int oilCount = 0; |
| | | int ammoCount = 0; |
| | | int matCount = 0; |
| | | for (DsTaskDetail task : tasks) { |
| | | if (task.getOilStime() != null && task.getOilStime() <= i && task.getOilEtime() >= i) { |
| | | oilCount++; |
| | | } else if (task.getAmmoStime() != null && task.getAmmoStime() <= i && task.getAmmoEtime() >= i) { |
| | | ammoCount++; |
| | | } else if (task.getMatStime() != null && task.getMatStime() <= i && task.getMatEtime() >= i) { |
| | | matCount++; |
| | | } |
| | | } |
| | | waterSupply.setTimeSlot(timeSlot, 0.0); |
| | | oilSupply.setTimeSlot(timeSlot, Double.valueOf(decimalFormat.format(oilCount * OIL_PLACE_PER))); |
| | | ammoSupply.setTimeSlot(timeSlot, Double.valueOf(decimalFormat.format(ammoCount * AMMO_PLACE_PER))); |
| | | materialSupply.setTimeSlot(timeSlot, Double.valueOf(decimalFormat.format(matCount * MAT_PLACE_PER))); |
| | | totalSupply.setTimeSlot(timeSlot, Double.valueOf(decimalFormat.format(oilCount * OIL_PLACE_PER + ammoCount * AMMO_PLACE_PER + matCount * MAT_PLACE_PER))); |
| | | } |
| | | taskPlaces.add(waterSupply); |
| | | taskPlaces.add(oilSupply); |
| | | taskPlaces.add(ammoSupply); |
| | | taskPlaces.add(materialSupply); |
| | | taskPlaces.add(totalSupply); |
| | | } |
| | | |
| | | return taskPlaces; |
| | | } |
| | | |
| | | private List<TaskPlanStatis> covertToStatis(List<DsTaskDetail> list){ |
| | | Map<Long, List<DsTaskDetail>> groupedByBerthId = new HashMap<>(); |
| | | for (DsTaskDetail task : list) { |
| | | Long berthId = task.getBerthId(); |
| | | if (!groupedByBerthId.containsKey(berthId)) { |
| | | groupedByBerthId.put(berthId, new ArrayList<>()); |
| | | } |
| | | groupedByBerthId.get(berthId).add(task); |
| | | } |
| | | |
| | | List<TaskPlanStatis> result = new ArrayList<>(); |
| | | for (Map.Entry<Long, List<DsTaskDetail>> entry : groupedByBerthId.entrySet()) { |
| | | List<DsTaskDetail> tasks = entry.getValue(); |
| | | TaskPlanStatis statis = new TaskPlanStatis(); |
| | | statis.setBerthName(tasks.get(0).getBerthName()); |
| | | statis.setHarborName(tasks.get(0).getHarborName()); |
| | | statis.setBerthStrategy(tasks.get(0).getParkingType()); |
| | | statis.setShipInfo(tasks); |
| | | result.add(statis); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private List<TaskPlanStatisTime> covertToStatisTime(List<DsTaskDetail> list){ |
| | | Map<Long, List<DsTaskDetailVO>> groupedByBerthId = new HashMap<>(); |
| | | for (DsTaskDetail task : list) { |
| | | Long berthId = task.getBerthId(); |
| | | if (!groupedByBerthId.containsKey(berthId)) { |
| | | groupedByBerthId.put(berthId, new ArrayList<>()); |
| | | } |
| | | DsTaskDetailVO taskDetailVO = new DsTaskDetailVO(task); |
| | | groupedByBerthId.get(berthId).add(taskDetailVO); |
| | | } |
| | | |
| | | List<TaskPlanStatisTime> result = new ArrayList<>(); |
| | | for (Map.Entry<Long, List<DsTaskDetailVO>> entry : groupedByBerthId.entrySet()) { |
| | | List<DsTaskDetailVO> tasks = entry.getValue(); |
| | | TaskPlanStatisTime statis = new TaskPlanStatisTime(); |
| | | statis.setBerthName(tasks.get(0).getBerthName()); |
| | | statis.setHarborName(tasks.get(0).getHarborName()); |
| | | statis.setBerthStrategy(tasks.get(0).getParkingType()); |
| | | statis.setShipInfo(tasks); |
| | | result.add(statis); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | double value = 1.23456789 * 2.34567890; |
| | | DecimalFormat df = new DecimalFormat("#.##"); // è®¾ç½®æ ¼å¼ä¸ºä¿ç10ä½å°æ° |
| | | String formattedValue = df.format(value); |
| | | System.out.println(value); |
| | | System.out.println(Double.valueOf(formattedValue)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import com.ruoyi.buss.common.DateUtils; |
| | | import com.ruoyi.buss.domain.DmHarbor2; |
| | | import com.ruoyi.buss.domain.DsTask; |
| | | import com.ruoyi.buss.domain.DsTaskList2; |
| | | import com.ruoyi.buss.domain.dto.AllocationReqDTO; |
| | | import com.ruoyi.buss.domain.dto.DsTaskQueryParam; |
| | | import com.ruoyi.buss.domain.vo.TaskListStatis; |
| | | import com.ruoyi.buss.service.IDmHarbor2Service; |
| | | import com.ruoyi.buss.service.IDsTaskList2Service; |
| | | import com.ruoyi.buss.service.IDsTaskService; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.domain.server.Sys; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Tag(name = "åºå°ä»»å¡æ¥å£") |
| | | @RestController |
| | | @RequestMapping("/buss/task/ex") |
| | | public class DMTaskController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IDsTaskService iDsTaskService; |
| | | @Autowired |
| | | private IDsTaskList2Service iDsTaskListService; |
| | | @Autowired |
| | | private IDmHarbor2Service iDmHarborService; |
| | | |
| | | @Operation(summary = "è·åææä»»å¡å表") |
| | | @PostMapping("/histask/list") |
| | | @ResponseBody |
| | | public AjaxResult getTaskList(@RequestBody DsTaskQueryParam param) { |
| | | if(null != param.getEtime()){ |
| | | param.setEtime(DateUtils.setToNextDayZero(param.getEtime())); |
| | | } |
| | | List<DsTask> dsTaskList = iDsTaskService.selectDsTaskListByParam(param); |
| | | return success(dsTaskList); |
| | | } |
| | | |
| | | @Operation(summary = "ä»»å¡å®ææ¥å£_éè¿ID") |
| | | @PostMapping("/complete/{id}") |
| | | @ResponseBody |
| | | public AjaxResult complete(@Parameter(name = "id", required = true, description = "ä»»å¡ID") @PathVariable("id") Long id) { |
| | | DsTaskList2 taskList2 = iDsTaskListService.selectDsTaskListByPkid(id); |
| | | if(null != taskList2){ |
| | | taskList2.setStatus("10"); |
| | | taskList2.setUpdateBy(getUsername()); |
| | | int flag = iDsTaskListService.updateDsTaskList(taskList2); |
| | | if(flag == 1){ |
| | | return success("ä»»å¡å®ææå"); |
| | | } |
| | | return error("ä»»å¡å®æå¤±è´¥"); |
| | | } |
| | | return error("æªè·åå°ä»»å¡"); |
| | | } |
| | | |
| | | @Operation(summary = "ä»»å¡å®ææ¥å£_éè¿ä»»å¡Idåè·å·") |
| | | @PostMapping("/complete/taskandship/{taskid}/{shipno}") |
| | | @ResponseBody |
| | | public AjaxResult completeWithShipAndTaskId(@Parameter(name = "taskid", required = true, description = "ä»»å¡ID") @PathVariable("taskid") Long taskid, |
| | | @Parameter(name = "shipno", required = true, description = "è·å·") @PathVariable("shipno") String shipno) { |
| | | DsTaskList2 queryParam = new DsTaskList2(); |
| | | queryParam.setTaskId(taskid); |
| | | queryParam.setShipNo(shipno); |
| | | List<DsTaskList2> taskList2 = iDsTaskListService.selectDsTaskListList(queryParam); |
| | | if(null != taskList2 && taskList2.size() > 0){ |
| | | DsTaskList2 tmpTask = taskList2.get(0); |
| | | tmpTask.setStatus("10"); |
| | | tmpTask.setUpdateBy(getUsername()); |
| | | int flag = iDsTaskListService.updateDsTaskList(tmpTask); |
| | | if(flag == 1){ |
| | | return success("ä»»å¡å®ææå"); |
| | | } |
| | | return error("ä»»å¡å®æå¤±è´¥"); |
| | | } |
| | | return error("æªè·åå°ä»»å¡"); |
| | | } |
| | | |
| | | @Operation(summary = "ä»»å¡å表_é»è®¤è·åæ£å¨æ§è¡çä»»å¡") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public AjaxResult runningTask(@Parameter(name = "deptid", required = false, description = "é¨é¨ç¼ç ") @RequestParam(value = "deptid", required = false) Long deptid, |
| | | @Parameter(name = "status", description = "ç¶æç¼ç ") @RequestParam(value = "status", required = false, defaultValue = "2") String status) { |
| | | if(StringUtils.isBlank(status)){status = "2";} |
| | | DsTaskList2 queryParam = new DsTaskList2(); |
| | | queryParam.setStatus(status); |
| | | if(null != deptid){queryParam.setDeptId(deptid);} |
| | | List<DsTaskList2> taskList2 = iDsTaskListService.selectDsTaskListList(queryParam); |
| | | return success(taskList2); |
| | | } |
| | | |
| | | @Operation(summary = "åºå°ä»»å¡ä¸å") |
| | | @Log(title = "åºå°ä»»å¡ä¸å", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/apply/{taskid}") |
| | | @ResponseBody |
| | | public AjaxResult apply(@Parameter(name = "taskid", required = true, description = "ä»»å¡ID") @PathVariable("taskid") Long taskid) { |
| | | DsTask dsTask = iDsTaskService.selectDsTaskByPKID(taskid); |
| | | dsTask.setStatus("1"); |
| | | dsTask.setUpdateBy(getUsername()); |
| | | int flag = iDsTaskService.updateDsTask(dsTask); |
| | | List<DsTaskList2> taskList2s = iDsTaskListService.selectDsTaskListByTaskId(taskid); |
| | | for(DsTaskList2 task : taskList2s){ |
| | | task.setStatus("1"); |
| | | iDsTaskListService.updateDsTaskList(task); |
| | | } |
| | | if(flag == 1){ |
| | | return success(dsTask); |
| | | } |
| | | return error("ä¸å失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®ä»»å¡IDè·åä»»å¡å表") |
| | | @GetMapping("/taskId/{taskid}") |
| | | @ResponseBody |
| | | public AjaxResult getByTaskId(@Parameter(name = "taskid", required = true, description = "ä»»å¡ID") @PathVariable("taskid") Long taskid) { |
| | | List<DsTaskList2> dsTaskList2s = iDsTaskListService.selectDsTaskListByTaskId(taskid); |
| | | return success(covertTaskToStatis(dsTaskList2s)); |
| | | } |
| | | |
| | | /** |
| | | * ç 头è°åº¦åé
æ¥å£ |
| | | * |
| | | */ |
| | | @Operation(summary = "ç 头è°åº¦åé
") |
| | | @PostMapping("/allocation") |
| | | @ResponseBody |
| | | public AjaxResult allocation(@RequestBody AllocationReqDTO reqDTO) { |
| | | String shipnos = reqDTO.getShipnos(); |
| | | String rule = reqDTO.getRule(); |
| | | String harborIds = reqDTO.getHarborids(); |
| | | |
| | | // if(StringUtils.isBlank(shipnos)){ |
| | | // return error("è·å·ä¸è½ä¸ºç©º"); |
| | | // } |
| | | String[] shipArr = shipnos.split(","); |
| | | List<DsTaskList2> taskLists = iDsTaskListService.selectCurrentDsTaskListWithShipNoV2(shipArr); |
| | | if(taskLists.size() == 0){ |
| | | return error("æéè°è为空ï¼è¯·éæ°æ£æ¥åæ°"); |
| | | } |
| | | |
| | | if (StringUtils.isBlank(harborIds)) { |
| | | return error("ç 头IDä¸è½ä¸ºç©º"); |
| | | } |
| | | String[] harborIdArr = harborIds.split(","); |
| | | List<Long> harborIdList = Arrays.stream(harborIdArr) |
| | | .map(Long::parseLong) |
| | | .collect(Collectors.toList()); |
| | | List<DmHarbor2> harborList = iDmHarborService.selectDmHarborByPKIDs(harborIdList); |
| | | |
| | | // éæ°ç»ç»æ°æ®ç»æï¼ç¶ååé |
| | | List<DsTaskList2> allocTaskList = allocationHarbor(taskLists, harborList, rule); |
| | | // éæ°è®¾å®å¯¹è±¡ç»æï¼æç
§ç 头åç» |
| | | return success(covertTaskToStatis(allocTaskList)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿åä»»å¡åè¡¨ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "è°é
ä¿¡æ¯æ´æ°æ¥å£") |
| | | @PostMapping("/tasklist/add") |
| | | @ResponseBody |
| | | public AjaxResult addTaskListSave(@RequestBody List<DsTaskList2> taskList) { |
| | | // ç¼ºå°æ°æ®é空以ååæ³æ§æ ¡éª |
| | | |
| | | // å é¤å·²ç»åå¨çè¹è°æ°æ® |
| | | List<DsTaskList2> dsTaskList2s = iDsTaskListService.selectCurrentDsTaskListV2(); |
| | | // å¢å ä¸ä¸ªä»»å¡å¹¶ä¿å |
| | | DsTask dsTask = new DsTask(); |
| | | String taskName = String.format("ä»»å¡: %tF # %d", new Date(), System.currentTimeMillis()); |
| | | dsTask.setNAME(taskName); |
| | | int addTag = iDsTaskService.insertDsTask(dsTask); |
| | | |
| | | |
| | | try{ |
| | | if(addTag > 0){ |
| | | // 使ç¨Mapä¼åæ¥æ¾æç |
| | | Map<Long, DsTaskList2> existingTaskMap = dsTaskList2s.stream() |
| | | .collect(Collectors.toMap(DsTaskList2::getPKID, Function.identity())); |
| | | |
| | | // æ¹éæ´æ°ä»»å¡å表 |
| | | List<DsTaskList2> tasksToUpdate = taskList.stream() |
| | | .filter(tmpTaskList -> existingTaskMap.containsKey(tmpTaskList.getPKID())) |
| | | .map(tmpTaskList -> { |
| | | DsTaskList2 existingTask = existingTaskMap.get(tmpTaskList.getPKID()); |
| | | existingTask.setTaskId(dsTask.getPKID()); |
| | | existingTask.setHarborName(tmpTaskList.getHarborName()); |
| | | existingTask.setHarborId(tmpTaskList.getHarborId()); |
| | | existingTask.setDeptId(tmpTaskList.getDeptId()); |
| | | existingTask.setDeptName(tmpTaskList.getDeptName()); |
| | | return existingTask; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // æ¹éæ´æ°æ°æ®åº |
| | | if (!tasksToUpdate.isEmpty()) { |
| | | iDsTaskListService.batchUpdateDsTaskList(tasksToUpdate); |
| | | } |
| | | return success(dsTask); |
| | | } |
| | | }catch (Exception e){ |
| | | iDsTaskService.deleteDsTaskByPKID(dsTask.getPKID()); |
| | | } |
| | | |
| | | return error("å建任å¡å¤±è´¥ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡å表信æ¯å表 |
| | | */ |
| | | @Operation(summary = "NEW-è·å彿¥éè¦åé
çè°èä¿¡æ¯") |
| | | @PostMapping("/current/list") |
| | | @ResponseBody |
| | | public AjaxResult curListV2() { |
| | | List<DsTaskList2> list = iDsTaskListService.selectCurrentDsTaskListV2(); |
| | | return success(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡å表信æ¯å表 |
| | | */ |
| | | @Operation(summary = "è·å彿¥éè¦åé
çè°èä¿¡æ¯V1") |
| | | @PostMapping("/current/list/v1") |
| | | @ResponseBody |
| | | public AjaxResult curListV1() { |
| | | List<DsTaskList2> list = iDsTaskListService.selectCurrentDsTaskList(); |
| | | return success(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 对æ³ä½æç
§è§åè¿è¡åé
|
| | | * @param list |
| | | * @param rule |
| | | * @return |
| | | */ |
| | | private List<DsTaskList2> allocationHarbor(List<DsTaskList2> list, List<DmHarbor2> harborList, String rule){ |
| | | List<DsTaskList2> dsTaskList2s = new ArrayList<>(); |
| | | if(null != list && list.size() > 0){ |
| | | switch (rule){ |
| | | case "ZSBD": // ææ¯ç¼é |
| | | // åæè¯´æï¼æ²¹é齿¯æoil_a åæ®µï¼ å©ä½æ²¹éææ¸¯å£æ²¹åéåå»å·²ç»åé
è°èéè¦çæ²¹éæ±éï¼å¯ç¨æ³ä½ä¸º berth_no 港å£é¡ºåºæ¯æ å·²åé
è°èæ°é/å¯ç¨æ³ä½ æ£åºæå |
| | | // 1 å
çéåºæææ¯ç¼éçè°èï¼æ ¹æ®ææ¯ç¼éè¿è¡åç»ï¼ |
| | | // 2 åå«è®¡ç®æ¯ç»æ»çå æ²¹éï¼å¹¶è®¡ç®è¯¥ç»çæå¤§æ°´æ·±ï¼ |
| | | // 3 å¦æè¯¥ææ¯ç¼éçä½ç½®åºååæ®µå¼ä¸ä¸ºç©ºï¼é¦éæ ¹æ®æ¸¯å£æ°´æ·±å¤æè¯¥åºåæ¯å¦æ»¡è¶³ï¼å¦ææ»¡è¶³åå¤æè¯¥åºå港å£å·²ææ²¹éæ»¡è¶³éæ±ï¼å¦æé½æ»¡è¶³ååé
该港å£ï¼ |
| | | // 4 妿æä¸ä¸ªæ¡ä»¶ä¸æ»¡è¶³åè·åä¸ä¸ä¸ªæ¸¯å£è¿è¡å¤æï¼å¦ææææ¸¯å£é½ä¸æ»¡è¶³åéæ©ç¬¬ä¸ä¸ªæ¸¯å£ï¼å¹¶å¨remark åæ®µå¢å å¤æå¤±è´¥çåå ã |
| | | // 5 妿ä½ç½®åºååæ®µä¸ºç©ºï¼åæ ¹æ®æ¸¯å£é¡ºåºä¾æ¬¡éæ©æ¸¯å£è¿è¡å¤æï¼æ¯ä¸ªæ¸¯å£å
æ ¹æ®æ¸¯å£æ°´æ·±å¤æè¯¥åºåæ¯å¦æ»¡è¶³ï¼å¦ææ»¡è¶³åå¤æè¯¥åºå港å£å·²ææ²¹éæ»¡è¶³éæ±ï¼å¦æé½æ»¡è¶³ååé
该港å£ï¼ |
| | | // 6 å¦æææ¡ä»¶ä¸æ»¡è¶³å便¬¡éæ©ä¸ä¸ä¸ªæ¸¯å£è¿è¡å¤æç´å°æ¸¯å£éåå®ï¼å¦æè¿æªæ¾å°ååé
第ä¸ä¸ªæ¸¯å£ï¼å¹¶å¨remark åæ®µå¢å å¤æå¤±è´¥çåå |
| | | // 1-å
çéåºæææ¯ç¼éçè°èï¼æ ¹æ®ææ¯ç¼éè¿è¡åç»ï¼ |
| | | Map<String, List<DsTaskList2>> tacticalGroupMap = list.stream() |
| | | .collect(Collectors.groupingBy(task -> task.getGrpName() != null && !task.getGrpName().isEmpty() ? task.getGrpName() : UUID.randomUUID().toString())); |
| | | Map<Long, Double> allocatedOilMap = new HashMap<>(); |
| | | // 1.1- 计ç®è¯¥ç»æ»çoil_aéï¼æ ¹æ®æ»oil_aééæ©åéçæ¸¯å£ï¼ |
| | | for (Map.Entry<String, List<DsTaskList2>> entry : tacticalGroupMap.entrySet()) { |
| | | List<DsTaskList2> groupTasks = entry.getValue(); |
| | | double totalOilB = groupTasks.stream().mapToDouble(task -> { |
| | | double oilA = 0.0; |
| | | if (task.getOilB() != null) oilA += task.getOilB(); |
| | | return oilA; |
| | | }).sum(); |
| | | double maxDepth = groupTasks.stream().mapToDouble(task -> task.getDraft() != null ? task.getDraft() : 0).max().orElse(0); |
| | | |
| | | DmHarbor2 selectedHarbor = null; |
| | | List<DmHarbor2> suitableHarbors = harborList.stream() |
| | | .filter(harbor -> (harbor.getOilB() != null && harbor.getOilB() >= totalOilB) && harbor.getDraft() >= maxDepth) |
| | | .collect(Collectors.toList()); |
| | | |
| | | if (!suitableHarbors.isEmpty()) { |
| | | if (StringUtils.isNotBlank(groupTasks.get(0).getPosArea())) { |
| | | selectedHarbor = suitableHarbors.stream() |
| | | .filter(harbor -> harbor.getHarborName() != null && harbor.getHarborName().equals(groupTasks.get(0).getPosArea()) && (harbor.getAllocatedShipCount() != null ? harbor.getAllocatedShipCount() : 0) < harbor.getBerthNo()) |
| | | .findFirst() |
| | | .orElse(suitableHarbors.stream() |
| | | .filter(harbor -> (harbor.getAllocatedShipCount() != null ? harbor.getAllocatedShipCount() : 0) < harbor.getBerthNo()) |
| | | .findFirst() |
| | | .orElse(suitableHarbors.get(0))); |
| | | } else { |
| | | selectedHarbor = suitableHarbors.stream() |
| | | .filter(harbor -> (harbor.getOilB() != null ? harbor.getOilB() : 0) - (harbor.getAllocatedOilA() != null ? harbor.getAllocatedOilA() : 0) >= totalOilB && (harbor.getAllocatedShipCount() != null ? harbor.getAllocatedShipCount() : 0) < harbor.getBerthNo()) |
| | | .findFirst() |
| | | .orElse(suitableHarbors.stream() |
| | | .filter(harbor -> (harbor.getAllocatedShipCount() != null ? harbor.getAllocatedShipCount() : 0) < harbor.getBerthNo()) |
| | | .findFirst() |
| | | .orElse(suitableHarbors.get(0))); |
| | | } |
| | | } else { |
| | | selectedHarbor = harborList.stream() |
| | | .filter(harbor -> (harbor.getAllocatedShipCount() != null ? harbor.getAllocatedShipCount() : 0) < harbor.getBerthNo()) |
| | | .min(Comparator.comparingDouble(harbor -> (double) (harbor.getBerthNo() - (harbor.getAllocatedShipCount() != null ? harbor.getAllocatedShipCount() : 0)) / harbor.getBerthNo())) |
| | | .orElse(harborList.get(0)); |
| | | } |
| | | |
| | | DmHarbor2 finalSelectedHarbor = selectedHarbor; |
| | | groupTasks.forEach(task -> { |
| | | if (finalSelectedHarbor != null) { |
| | | task.setHarborId(finalSelectedHarbor.getPKID()); |
| | | task.setHarborName(finalSelectedHarbor.getHarborName()); |
| | | task.setDeptId(finalSelectedHarbor.getDeptId()); |
| | | task.setDeptName(finalSelectedHarbor.getDeptName()); |
| | | double allocatedOilA = finalSelectedHarbor.getAllocatedOilA() != null ? finalSelectedHarbor.getAllocatedOilA() : 0; |
| | | finalSelectedHarbor.setAllocatedOilA(allocatedOilA + (task.getOilB() != null ? task.getOilB() : 0)); |
| | | int allocatedShipCount = finalSelectedHarbor.getAllocatedShipCount() != null ? finalSelectedHarbor.getAllocatedShipCount() : 0; |
| | | finalSelectedHarbor.setAllocatedShipCount(allocatedShipCount + 1); |
| | | dsTaskList2s.add(task); |
| | | } |
| | | |
| | | // éæ°è®¡ç®ç©ºç½®æ¯ |
| | | harborList.forEach(harbor -> { |
| | | int currentAllocatedShipCount = harbor.getAllocatedShipCount() != null ? harbor.getAllocatedShipCount() : 0; |
| | | double vacancyRatio = (double) (harbor.getBerthNo() - currentAllocatedShipCount) / harbor.getBerthNo(); |
| | | // å¯ä»¥å¨æ¤å¤ä½¿ç¨vacancyRatioè¿è¡è¿ä¸æ¥çé»è¾å¤ç |
| | | }); |
| | | }); |
| | | } |
| | | break; |
| | | case "JTXH": // è°èåå· |
| | | // 1- å
æ ¹æ®è°èåå·è¿è¡åç»ï¼æ ¹æ®åç»ä¿¡æ¯ï¼å¦æåä¸ç»çä¼å
åé
åä¸ä¸ªç å¤´ï¼ |
| | | // 1.1- è®¡ç®æ¯ä¸ç»çæ»å æ²¹éï¼æ ¹æ®å æ²¹ééæ©åéçæ¸¯å£ï¼ |
| | | // 1.2- 妿å¤ä¸ªæ¸¯å£å æ²¹éé½å¯ä»¥æ»¡è¶³åæç
§ä½ç½®åºåéæ©æ¸¯å£ï¼ |
| | | // 1.3- 妿æ ä½ç½®åºåï¼åéæ©ç¬¬ä¸ä¸ªæ¸¯å£ã |
| | | // 1- å
æ ¹æ®è°èåå·è¿è¡åç» |
| | | Map<String, List<DsTaskList2>> shipTypeGroupMap = list.stream() |
| | | .collect(Collectors.groupingBy(DsTaskList2::getShipType)); |
| | | |
| | | for (Map.Entry<String, List<DsTaskList2>> entry : shipTypeGroupMap.entrySet()) { |
| | | List<DsTaskList2> groupTasks = entry.getValue(); |
| | | double totalOilB = groupTasks.stream().mapToDouble(task -> { |
| | | double oilB = 0.0; |
| | | if (task.getOilB() != null) oilB += task.getOilB(); |
| | | return oilB; |
| | | }).sum(); |
| | | double maxDepth = groupTasks.stream().mapToDouble(task -> task.getDraft() != null ? task.getDraft() : 0).max().orElse(0); |
| | | |
| | | DmHarbor2 selectedHarbor = null; |
| | | boolean harborFound = false; |
| | | |
| | | // 3- 妿åç»çä½ç½®åºååæ®µå¼ä¸ä¸ºç©º |
| | | if (groupTasks != null && !groupTasks.isEmpty() && groupTasks.get(0).getPosArea() != null && !groupTasks.get(0).getPosArea().isEmpty()) { |
| | | for (DmHarbor2 harbor : harborList) { |
| | | if (harbor != null && harbor.getDraft() >= maxDepth && |
| | | (harbor.getOilB() != null && harbor.getAllocatedOilA() != null && |
| | | (harbor.getOilB() - harbor.getAllocatedOilA() >= totalOilB)) && |
| | | harbor.getHarborName() != null && |
| | | harbor.getHarborName().equals(groupTasks.get(0).getPosArea())) { |
| | | selectedHarbor = harbor; |
| | | harborFound = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 5- 妿ä½ç½®åºååæ®µä¸ºç©º |
| | | if (!harborFound) { |
| | | for (DmHarbor2 harbor : harborList.stream().sorted(Comparator.comparingDouble(h -> { |
| | | int allocatedShipCount = h.getAllocatedShipCount() != null ? h.getAllocatedShipCount() : 0; |
| | | return (double) allocatedShipCount / (h.getBerthNo() != null ? h.getBerthNo() : 1); |
| | | })).collect(Collectors.toList())) { |
| | | double allocatedOilA = harbor.getAllocatedOilA() != null ? harbor.getAllocatedOilA() : 0; |
| | | if (harbor.getDraft() >= maxDepth && |
| | | (harbor.getOilB() != null && (harbor.getOilB() - allocatedOilA >= totalOilB))) { |
| | | selectedHarbor = harbor; |
| | | harborFound = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 4- å¦ææææ¸¯å£é½ä¸æ»¡è¶³åéæ©ç¬¬ä¸ä¸ªæ¸¯å£ï¼å¹¶å¨remark åæ®µå¢å å¤æå¤±è´¥çåå |
| | | if (!harborFound && !harborList.isEmpty()) { |
| | | selectedHarbor = harborList.get(0); |
| | | groupTasks.forEach(task -> task.setRemark("æææ¸¯å£å䏿»¡è¶³æ¡ä»¶")); |
| | | } |
| | | |
| | | DmHarbor2 finalSelectedHarbor = selectedHarbor; |
| | | groupTasks.forEach(task -> { |
| | | if (finalSelectedHarbor != null) { |
| | | task.setHarborId(finalSelectedHarbor.getPKID()); |
| | | task.setHarborName(finalSelectedHarbor.getHarborName()); |
| | | finalSelectedHarbor.setAllocatedOilA((finalSelectedHarbor.getAllocatedOilA() != null ? finalSelectedHarbor.getAllocatedOilA() : 0) + (task.getOilB() != null ? task.getOilB() : 0)); |
| | | finalSelectedHarbor.setAllocatedShipCount((finalSelectedHarbor.getAllocatedShipCount() != null ? finalSelectedHarbor.getAllocatedShipCount() : 0) + 1); |
| | | dsTaskList2s.add(task); |
| | | } else { |
| | | task.setRemark("æªæ¾å°åéçæ¸¯å£"); |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | case "BJZD": // è¡¥ç»éç¹ |
| | | for (DsTaskList2 task : list) { |
| | | Double taskDraft = task.getDraft() != null ? task.getDraft() : 0.0; |
| | | boolean ammoSupplyNeeded = (task.getAmmoD() != null && task.getAmmoD() > 0) || |
| | | (task.getAmmoO() != null && task.getAmmoO() > 0) || |
| | | (task.getAmmoP() != null && task.getAmmoP() > 0) || |
| | | (task.getAmmoS() != null && task.getAmmoS() > 0); |
| | | //harborList.stream().mapToDouble(h -> h.getDraft() != null ? h.getDraft() : 0.0).min().orElse(0.0); |
| | | DmHarbor2 selectedHarbor = null; |
| | | boolean harborFound = false; |
| | | if (ammoSupplyNeeded) { |
| | | boolean canDockAtQingyuOrJiaotou = harborList.stream() |
| | | .anyMatch(harbor -> (harbor.getHarborName().equals("é屿") || harbor.getHarborName().equals("ç¤å¤´")) && |
| | | harbor.getDraft() >= taskDraft); |
| | | |
| | | if (canDockAtQingyuOrJiaotou) { |
| | | for (DmHarbor2 harbor : harborList) { |
| | | if ((harbor.getHarborName().equals("é屿") || harbor.getHarborName().equals("ç¤å¤´")) && |
| | | harbor.getDraft() >= taskDraft && |
| | | (harbor.getOilB() - (harbor.getAllocatedOilA() != null ? harbor.getAllocatedOilA() : 0) >= task.getOilB()) && |
| | | (harbor.getAllocatedShipCount() != null ? harbor.getAllocatedShipCount() : 0) / (harbor.getBerthNo() != null ? harbor.getBerthNo() : 1) < 1) { |
| | | selectedHarbor = harbor; |
| | | harborFound = true; |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | for (DmHarbor2 harbor : harborList) { |
| | | if (harbor.getDraft() >= taskDraft) { |
| | | selectedHarbor = harbor; |
| | | harborFound = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!harborFound) { |
| | | for (DmHarbor2 harbor : harborList) { |
| | | if (harbor.getDraft() >= taskDraft) { |
| | | selectedHarbor = harbor; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (selectedHarbor != null) { |
| | | task.setHarborId(selectedHarbor.getPKID()); |
| | | task.setHarborName(selectedHarbor.getHarborName()); |
| | | selectedHarbor.setAllocatedOilA((selectedHarbor.getAllocatedOilA() != null ? selectedHarbor.getAllocatedOilA() : 0) + (task.getOilB() != null ? task.getOilB() : 0)); |
| | | selectedHarbor.setAllocatedShipCount((selectedHarbor.getAllocatedShipCount() != null ? selectedHarbor.getAllocatedShipCount() : 0) + 1); |
| | | dsTaskList2s.add(task); |
| | | } else { |
| | | task.setRemark("æªæ¾å°åéçæ¸¯å£"); |
| | | } |
| | | } |
| | | break; |
| | | case "WZQJ": // ä½ç½®åºé´ |
| | | // 1- å
æç
§å
å«ä½ç½®åºé´çè¿è¡åç» |
| | | // 2- å©ä½çæç
§æ³ä½æ°éå æ¯è¿è¡åé
ï¼ |
| | | // 3- å¦æå æ¯ç±»ä¼¼åæç
§é¡ºåºè¿è¡åºåã |
| | | // 1- å
æç
§æ¯å¦å
å«ä½ç½®åºé´è¿è¡åºå |
| | | // 1- å
æç
§ä½ç½®åºé´è¿è¡åç» |
| | | Map<String, List<DsTaskList2>> posAreaGroupMap = list.stream() |
| | | .collect(Collectors.groupingBy(task -> { |
| | | String posArea = task.getPosArea(); |
| | | return (posArea != null && !posArea.isEmpty()) ? posArea : UUID.randomUUID().toString(); |
| | | })); |
| | | |
| | | // 2- åå«è®¡ç®æ¯ç»æ»çå æ²¹éï¼ä»¥åæå¤§æ°´æ·±ï¼ |
| | | for (Map.Entry<String, List<DsTaskList2>> entry : posAreaGroupMap.entrySet()) { |
| | | List<DsTaskList2> groupTasks = entry.getValue(); |
| | | double totalOilB = groupTasks.stream().mapToDouble(task -> { |
| | | Double oilB = task.getOilB(); |
| | | return (oilB != null) ? oilB : 0.0; |
| | | }).sum(); |
| | | double maxDepth = groupTasks.stream().mapToDouble(task -> { |
| | | Double draft = task.getDraft(); |
| | | return (draft != null) ? draft : 0.0; |
| | | }).max().orElse(0.0); |
| | | |
| | | DmHarbor2 selectedHarbor = null; |
| | | boolean harborFound = false; |
| | | |
| | | // 3- å
éåä½ç½®åºé´ä¸ä¸ºç©ºçç» |
| | | if (groupTasks.get(0).getPosArea() != null && !groupTasks.get(0).getPosArea().isEmpty()) { |
| | | for (DmHarbor2 harbor : harborList) { |
| | | Double harborDraft = harbor.getDraft() != null ? harbor.getDraft() : 0.0; |
| | | Double harborOilB = harbor.getOilB() != null ? harbor.getOilB() : 0.0; |
| | | Double allocatedOilA = harbor.getAllocatedOilA() != null ? harbor.getAllocatedOilA() : 0.0; |
| | | |
| | | if (harborDraft >= maxDepth && (harborOilB - allocatedOilA >= totalOilB)) { |
| | | selectedHarbor = harbor; |
| | | harborFound = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 5- åéåä½ç½®åºé´ä¸ºç©ºçç» |
| | | if (!harborFound) { |
| | | for (DmHarbor2 harbor : harborList.stream() |
| | | .sorted(Comparator.comparingDouble(h -> { |
| | | int allocatedShipCount = h.getAllocatedShipCount() != null ? h.getAllocatedShipCount() : 0; |
| | | long berthNo = h.getBerthNo() != null ? h.getBerthNo() : 1; |
| | | return (double) allocatedShipCount / berthNo; |
| | | })) |
| | | .collect(Collectors.toList())) { |
| | | Double harborDraft = harbor.getDraft() != null ? harbor.getDraft() : 0.0; |
| | | Double harborOilB = harbor.getOilB() != null ? harbor.getOilB() : 0.0; |
| | | Double allocatedOilA = harbor.getAllocatedOilA() != null ? harbor.getAllocatedOilA() : 0.0; |
| | | |
| | | if (harborDraft >= maxDepth && (harborOilB - allocatedOilA >= totalOilB)) { |
| | | selectedHarbor = harbor; |
| | | harborFound = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!harborFound) { |
| | | selectedHarbor = harborList.stream() |
| | | .min(Comparator.comparingDouble(h -> { |
| | | int allocatedShipCount = h.getAllocatedShipCount() != null ? h.getAllocatedShipCount() : 0; |
| | | long berthNo = h.getBerthNo() != null ? h.getBerthNo() : 1; |
| | | return (double) allocatedShipCount / berthNo; |
| | | })) |
| | | .orElse(harborList.get(0)); |
| | | } |
| | | |
| | | DmHarbor2 finalSelectedHarbor = selectedHarbor; |
| | | groupTasks.forEach(task -> { |
| | | task.setHarborId(finalSelectedHarbor.getPKID()); |
| | | task.setHarborName(finalSelectedHarbor.getHarborName()); |
| | | task.setDeptId(finalSelectedHarbor.getDeptId()); |
| | | task.setDeptName(finalSelectedHarbor.getDeptName()); |
| | | double allocatedOilA = finalSelectedHarbor.getAllocatedOilA() != null ? finalSelectedHarbor.getAllocatedOilA() : 0.0; |
| | | finalSelectedHarbor.setAllocatedOilA(allocatedOilA + (task.getOilB() != null ? task.getOilB() : 0.0)); |
| | | int allocatedShipCount = finalSelectedHarbor.getAllocatedShipCount() != null ? finalSelectedHarbor.getAllocatedShipCount() : 0; |
| | | finalSelectedHarbor.setAllocatedShipCount(allocatedShipCount + 1); |
| | | dsTaskList2s.add(task); |
| | | }); |
| | | } |
| | | break; |
| | | default: |
| | | if(null != harborList && harborList.size() > 0){ |
| | | int harborLen1 = harborList.size(); |
| | | int shipCount1 = list.size(); |
| | | int harborWithShipCount1 = (int)Math.ceil((double) shipCount1 / harborLen1); |
| | | for(int i=0; i <shipCount1; i++){ |
| | | DsTaskList2 task = list.get(i); |
| | | int harborTag = (int) Math.ceil((double)(i+1) / harborWithShipCount1) - 1; |
| | | DmHarbor2 dmHarbor2 = harborList.get(harborTag); |
| | | task.setHarborId(dmHarbor2.getPKID()); |
| | | task.setHarborName(dmHarbor2.getHarborName()); |
| | | dsTaskList2s.add(task); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return dsTaskList2s; |
| | | } |
| | | |
| | | /** |
| | | * æç»æåè¡¨éæ°è½¬æ¢ä¸ºç»è®¡æ ¼å¼ |
| | | * @param allocTaskList |
| | | * @return |
| | | */ |
| | | private List<TaskListStatis> covertTaskToStatis(List<DsTaskList2> allocTaskList){ |
| | | List<TaskListStatis> taskListStatis = new ArrayList<>(); |
| | | Map<Long, List<DsTaskList2>> tmpTaskMap = new HashMap<>(); |
| | | allocTaskList.stream().forEach(item -> { |
| | | Long harborId = item.getHarborId(); |
| | | List<DsTaskList2> itemTaskLists = new ArrayList<>(); |
| | | if(tmpTaskMap.containsKey(harborId)){ |
| | | itemTaskLists = tmpTaskMap.get(harborId); |
| | | } |
| | | itemTaskLists.add(item); |
| | | tmpTaskMap.put(harborId, itemTaskLists); |
| | | }); |
| | | |
| | | tmpTaskMap.forEach((harborId, tasks) -> { |
| | | TaskListStatis statis = new TaskListStatis(); |
| | | DmHarbor2 harbor = iDmHarborService.selectDmHarborByPKID(harborId); |
| | | statis.setHarbor(harbor); |
| | | statis.setTasks(tasks); |
| | | |
| | | // ç»è®¡tasksæ°å¼å段çå¼ |
| | | DsTaskList2 taskStatis = new DsTaskList2(); |
| | | tasks.forEach(task -> { |
| | | taskStatis.setOilB((taskStatis.getOilB() == null ? 0 : taskStatis.getOilB()) + (task.getOilB() == null ? 0 : task.getOilB())); |
| | | taskStatis.setOilG((taskStatis.getOilG() == null ? 0 : taskStatis.getOilG()) + (task.getOilG() == null ? 0 : task.getOilG())); |
| | | taskStatis.setOilA((taskStatis.getOilA() == null ? 0 : taskStatis.getOilA()) + (task.getOilA() == null ? 0 : task.getOilA())); |
| | | taskStatis.setAmmoD((taskStatis.getAmmoD() == null ? 0 : taskStatis.getAmmoD()) + (task.getAmmoD() == null ? 0 : task.getAmmoD())); |
| | | taskStatis.setAmmoP((taskStatis.getAmmoP() == null ? 0 : taskStatis.getAmmoP()) + (task.getAmmoP() == null ? 0 : task.getAmmoP())); |
| | | taskStatis.setAmmoS((taskStatis.getAmmoS() == null ? 0 : taskStatis.getAmmoS()) + (task.getAmmoS() == null ? 0 : task.getAmmoS())); |
| | | taskStatis.setAmmoO((taskStatis.getAmmoO() == null ? 0 : taskStatis.getAmmoO()) + (task.getAmmoO() == null ? 0 : task.getAmmoO())); |
| | | taskStatis.setWATER((taskStatis.getWATER() == null ? 0 : taskStatis.getWATER()) + (task.getWATER() == null ? 0 : task.getWATER())); |
| | | taskStatis.setWaterP((taskStatis.getWaterP() == null ? 0 : taskStatis.getWaterP()) + (task.getWaterP() == null ? 0 : task.getWaterP())); |
| | | taskStatis.setFOOD((taskStatis.getFOOD() == null ? 0 : taskStatis.getFOOD()) + (task.getFOOD() == null ? 0 : task.getFOOD())); |
| | | taskStatis.setFoodW((taskStatis.getFoodW() == null ? 0 : taskStatis.getFoodW()) + (task.getFoodW() == null ? 0 : task.getFoodW())); |
| | | taskStatis.setFoodO((taskStatis.getFoodO() == null ? 0 : taskStatis.getFoodO()) + (task.getFoodO() == null ? 0 : task.getFoodO())); |
| | | }); |
| | | |
| | | statis.setStatis(taskStatis); |
| | | taskListStatis.add(statis); |
| | | }); |
| | | |
| | | return taskListStatis; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å¯¹è±¡IDè·å对åºå¯¹è±¡ |
| | | * @param list |
| | | * @param id |
| | | * @return |
| | | */ |
| | | private DsTaskList2 getDsTaskListById(List<DsTaskList2> list, Long id){ |
| | | for(DsTaskList2 task : list){ |
| | | if(task.getPKID() == id){ |
| | | return task; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | |
| | | import com.ruoyi.buss.common.DateUtils; |
| | | import com.ruoyi.buss.common.RfidUtil; |
| | | import com.ruoyi.buss.domain.*; |
| | | import com.ruoyi.buss.domain.dto.AllocBerthReqDTO; |
| | | import com.ruoyi.buss.domain.dto.AllocBerthTimeReqDTO; |
| | | import com.ruoyi.buss.domain.dto.DsTaskQueryParam; |
| | | import com.ruoyi.buss.domain.dto.TaskQueryParam; |
| | | import com.ruoyi.buss.domain.vo.RfIdVo; |
| | | import com.ruoyi.buss.service.*; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Tag(name = "æ¯é任塿¥å£") |
| | | @RestController |
| | | @RequestMapping("/buss/tasklist/ex") |
| | | public class DMTaskTimeController extends BaseController { |
| | | |
| | | @Autowired |
| | | private IDsTaskService iDsTaskService; |
| | | @Autowired |
| | | private IDsTaskList2Service iDsTaskListService; |
| | | @Autowired |
| | | private IDmBerth2Service dmBerthService; |
| | | @Autowired |
| | | private IDmHarbor2Service dmHarborService; |
| | | @Autowired |
| | | private IDmDdConfigService iDmDdConfigService; |
| | | @Autowired |
| | | private IDsTaskDetailService iDsTaskDetailService; |
| | | |
| | | @Value("${ruoyi.buss.rfid.url:http://192.168.0.2:10800/open/goods/task}") |
| | | private String rfidUrl; |
| | | |
| | | private static String WATER_FLAG = "water"; |
| | | private static String MATER_FLAG = "mater"; |
| | | private static String OIL_FLAG = "oil"; |
| | | private static String AMMO_FLAG = "ammo"; |
| | | private static String AMMO_O_FLAG = "ammo_o"; |
| | | |
| | | |
| | | @Operation(summary = "è·åæ¬æ¯éææä»»å¡å表") |
| | | @PostMapping("/histask/list") |
| | | @ResponseBody |
| | | public AjaxResult getTaskList(@RequestBody DsTaskQueryParam param) { |
| | | if(null != param.getEtime()){ |
| | | param.setEtime(DateUtils.setToNextDayZero(param.getEtime())); |
| | | } |
| | | List<DsTask> dsTaskList = iDsTaskService.selectDsTaskListByParam(param); |
| | | return success(dsTaskList); |
| | | } |
| | | |
| | | @Operation(summary = "æ¯éä»»å¡ä¸å") |
| | | @Log(title = "æ¯éä»»å¡ä¸å", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/apply/{taskid}/{deptid}") |
| | | @ResponseBody |
| | | public AjaxResult apply(@Parameter(name = "taskid", required = true, description = "ä»»å¡ç¼å·") @PathVariable("taskid") Long taskid, |
| | | @Parameter(name = "deptid", required = true, description = "é¨é¨ID") @PathVariable("deptid") Long deptid, |
| | | @Parameter(name = "ids", required = false, description = "ä»»å¡Ids") @RequestParam(value = "ids", required = false) String ids) { |
| | | TaskQueryParam queryParam = new TaskQueryParam(); |
| | | if(null != taskid){ |
| | | queryParam.setTaskId(taskid); |
| | | } |
| | | queryParam.setDeptId(deptid); |
| | | queryParam.setStatus("1"); |
| | | |
| | | if(StringUtils.isNotBlank(ids)){ |
| | | List<Long> idList = Arrays.stream(ids.split(",")) |
| | | .map(Long::valueOf) |
| | | .collect(Collectors.toList()); |
| | | if(null != idList && idList.size() > 0){ |
| | | queryParam.setIds(idList); |
| | | } |
| | | } |
| | | |
| | | List<DsTaskList2> dsTaskList = iDsTaskListService.selectDsTaskListByParam(queryParam); |
| | | if(null == dsTaskList || dsTaskList.size() == 0){ |
| | | return error("æªè·åå°å¯¹åºçä»»å¡"); |
| | | } |
| | | |
| | | |
| | | // è·åææçæ³ä½ä¿¡æ¯ |
| | | List<DmBerth2> berth2List = dmBerthService.selectDmBerthList(new DmBerth2()); |
| | | |
| | | Map<Long, DmBerth2> berth2Map = berth2List.stream().collect(Collectors.toMap(DmBerth2::getPKID, berth -> berth)); |
| | | |
| | | |
| | | List<DsTaskList2> taskToUpdate = dsTaskList.stream().map(tmp -> { |
| | | tmp.setStatus("2"); |
| | | DmBerth2 berth2 = berth2Map.get(tmp.getPKID()); |
| | | if(null != berth2){ |
| | | tmp.setPath(berth2.getPath()); |
| | | } |
| | | return tmp; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | if(!taskToUpdate.isEmpty()){ |
| | | iDsTaskListService.batchUpdateDsTaskList(taskToUpdate); |
| | | } |
| | | |
| | | List<RfIdVo> rfIdVoList = new ArrayList<>(); |
| | | //rfIdVoList.add(new RfIdVo(Integer.valueOf(task.getShipNo()), task.getShipNo()+"è°èè¡¥ç»ä»»å¡", task.getPath())); |
| | | |
| | | // æ¨éæ°æ®å° RFID |
| | | // try{ |
| | | // RfidUtil.asyncSendJsonPost(rfidUrl, rfIdVoList); |
| | | // }catch (Exception e){e.printStackTrace();} |
| | | |
| | | // æ´æ°Detail è·¯å¾è§å |
| | | this.updateDetailPath(taskid, deptid, berth2List); |
| | | |
| | | DsTaskList2 tmpTaskList = new DsTaskList2(); |
| | | tmpTaskList.setStatus("1"); |
| | | tmpTaskList.setTaskId(taskid); |
| | | List<DsTaskList2> taskList2List = iDsTaskListService.selectDsTaskListList(tmpTaskList); |
| | | |
| | | if(null != taskList2List && taskList2List.size() > 0){ |
| | | DsTask dsTask = iDsTaskService.selectDsTaskByPKID(taskid); |
| | | dsTask.setStatus("2"); |
| | | iDsTaskService.updateDsTask(dsTask); |
| | | return success("ä¸åæå"); |
| | | } |
| | | |
| | | |
| | | return error("ä¸å失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "æ¯éä»»å¡ä¸å") |
| | | @Log(title = "æ¯éä»»å¡ä¸å", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/apply/{deptid}") |
| | | @ResponseBody |
| | | public AjaxResult applyV2(@Parameter(name = "taskid", required = true, description = "ä»»å¡ç¼å·") @RequestParam("taskid") Long taskid, |
| | | @Parameter(name = "deptid", required = true, description = "é¨é¨ID") @PathVariable("deptid") Long deptid, |
| | | @Parameter(name = "ids", required = true, description = "ä»»å¡Ids") @RequestParam("ids") String ids) { |
| | | TaskQueryParam queryParam = new TaskQueryParam(); |
| | | if(null != taskid){ |
| | | queryParam.setTaskId(taskid); |
| | | } |
| | | queryParam.setDeptId(deptid); |
| | | queryParam.setStatus("1"); |
| | | |
| | | if(StringUtils.isNotBlank(ids)){ |
| | | List<Long> idList = Arrays.stream(ids.split(",")) |
| | | .map(Long::valueOf) |
| | | .collect(Collectors.toList()); |
| | | if(null != idList && idList.size() > 0){ |
| | | queryParam.setIds(idList); |
| | | } |
| | | } |
| | | |
| | | List<DsTaskList2> dsTaskList = iDsTaskListService.selectDsTaskListByParam(queryParam); |
| | | |
| | | if(null == dsTaskList || dsTaskList.size() == 0){ |
| | | return error("æªè·åå°å¯¹åºçä»»å¡"); |
| | | } |
| | | |
| | | int flag = 1; |
| | | for (DsTaskList2 task : dsTaskList) { |
| | | task.setStatus("2"); |
| | | int updateResult = iDsTaskListService.updateDsTaskList(task); |
| | | if (updateResult != 1) { |
| | | flag = 0; |
| | | break; |
| | | } |
| | | } |
| | | DsTaskList2 tmpTaskList = new DsTaskList2(); |
| | | tmpTaskList.setStatus("1"); |
| | | tmpTaskList.setTaskId(taskid); |
| | | List<DsTaskList2> taskList2List = iDsTaskListService.selectDsTaskListList(tmpTaskList); |
| | | if(null != taskList2List && taskList2List.size() == 0){ |
| | | DsTask dsTask = iDsTaskService.selectDsTaskByPKID(taskid); |
| | | dsTask.setStatus("2"); |
| | | iDsTaskService.updateDsTask(dsTask); |
| | | } |
| | | |
| | | if(flag == 1){ |
| | | return success("ä¸åæå"); |
| | | } |
| | | return error("ä¸å失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | |
| | | @Operation(summary = "è·åææ°ä¸åçä»»å¡å表") |
| | | @GetMapping("/task") |
| | | @ResponseBody |
| | | public AjaxResult getByTaskId(@Parameter(name = "deptId", description = "é¨é¨ç¼ç ") Long deptId) { |
| | | if(null == deptId)deptId = getDeptId(); |
| | | // è·åæ¯éæ£å¨è¿è¡çä»»å¡ |
| | | // DsTask taskEntity = new DsTask(); |
| | | // taskEntity.setStatus("1"); // 1 ç¶æä¸º æ¯é 2 ç¶æä¸º å®æç¶æã |
| | | // List<DsTask> tasks = iDsTaskService.selectDsTaskList(taskEntity); |
| | | // if(null != tasks && tasks.size() > 0){ |
| | | // DsTask curTask = tasks.get(0); |
| | | DsTaskList2 taskListEntity = new DsTaskList2(); |
| | | // taskListEntity.setTaskId(curTask.getPKID()); |
| | | taskListEntity.setDeptId(deptId); |
| | | taskListEntity.setStatus("1"); |
| | | List<DsTaskList2> dsTaskList2s = iDsTaskListService.selectDsTaskListList(taskListEntity); |
| | | return success(dsTaskList2s); |
| | | // } |
| | | // return success(); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ³ä½ä¿¡æ¯å表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢æ³ä½ä¿¡æ¯å表") |
| | | @GetMapping("/berth/list") |
| | | @ResponseBody |
| | | public AjaxResult dmBerthList(@Parameter(name = "deptId", description = "é¨é¨ç¼ç ") Long deptId) { |
| | | if(null == deptId)deptId = getDeptId(); |
| | | if(null == deptId){ |
| | | return error("è·åå½åç¨æ·ä¿¡æ¯å¤±è´¥ï¼è¯·éæ°ç»å½åå°è¯ã"); |
| | | } |
| | | DmHarbor2 harbor = new DmHarbor2(); |
| | | harbor.setDeptId(deptId); |
| | | List<DmHarbor2> harborList = dmHarborService.selectDmHarborList(harbor); |
| | | List<Long> tmpHarborIds = new ArrayList<>(); |
| | | harborList.stream().forEach(item -> { |
| | | tmpHarborIds.add(item.getPKID()); |
| | | }); |
| | | List<DmBerth2> list = dmBerthService.selectDmBerthByHarborIdsAndStatus(tmpHarborIds); |
| | | |
| | | list = list.stream() |
| | | .filter(task -> task.getDEPTH() != null) |
| | | .sorted(Comparator.comparing(DmBerth2::getHarborId).thenComparing(DmBerth2::getOrderNum)) |
| | | .collect(Collectors.toList()); |
| | | |
| | | return success(list); |
| | | } |
| | | |
| | | @Operation(summary = "æ¥è¯¢ç 头信æ¯è¯¦æ
") |
| | | @GetMapping("/harbor/id/{harborid}") |
| | | @ResponseBody |
| | | public AjaxResult dmBerthById(@Parameter(name = "harborid", description = "ç 头ç¼ç ") @PathVariable("harborid") Long harborid) { |
| | | return success(dmHarborService.selectDmHarborByPKID(harborid)); |
| | | } |
| | | |
| | | /** |
| | | * ç 头è°åº¦åé
æ¥å£ |
| | | * |
| | | */ |
| | | @Operation(summary = "ç 头è°åº¦åé
") |
| | | @PostMapping("/allocation") |
| | | @ResponseBody |
| | | public AjaxResult allocation(@RequestBody AllocBerthReqDTO reqDTO) { |
| | | Long deptId = getDeptId(); |
| | | if(null != reqDTO.getDeptId()){ |
| | | deptId =reqDTO.getDeptId(); |
| | | } |
| | | |
| | | if(null == reqDTO.getTaskId()){ |
| | | return error("ä»»å¡ç¼ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | if(StringUtils.isBlank(reqDTO.getBerthids())){ |
| | | return error("æ³ä½ç¼å·ä¸è½ä¸ºç©º"); |
| | | } |
| | | DsTaskList2 dsTaskList2Entity = new DsTaskList2(); |
| | | dsTaskList2Entity.setTaskId(reqDTO.getTaskId()); |
| | | dsTaskList2Entity.setDeptId(deptId); |
| | | List<DsTaskList2> taskLists = iDsTaskListService.selectDsTaskListList(dsTaskList2Entity); |
| | | if(taskLists.size() == 0){ |
| | | return error("æéè°è为空ï¼è¯·éæ°æ£æ¥åæ°"); |
| | | } |
| | | |
| | | return success(allocationBerth(taskLists, reqDTO.getRule(), reqDTO.getBerthids())); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿åä»»å¡åè¡¨ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ³ä½è°é
ä¿¡æ¯æ´æ°æ¥å£") |
| | | @Log(title = "æ³ä½è°é
ä¿¡æ¯æ´æ°æ¥å£", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/tasklist/update") |
| | | @ResponseBody |
| | | public AjaxResult addTaskListSave(@RequestBody List<DsTaskList2> taskList) { |
| | | // ç¼ºå°æ°æ®é空以ååæ³æ§æ ¡éª |
| | | |
| | | List<Long> pkidList = taskList.stream() |
| | | .map(DsTaskList2::getPKID) |
| | | .collect(Collectors.toList()); |
| | | |
| | | List<DsTaskList2> existingTaskLists = iDsTaskListService.selectDsTaskListByPkids(pkidList); |
| | | |
| | | for (DsTaskList2 existingTask : existingTaskLists) { |
| | | for (DsTaskList2 newTask : taskList) { |
| | | if (existingTask.getPKID().equals(newTask.getPKID())) { |
| | | existingTask.setBerthId(newTask.getBerthId()); |
| | | existingTask.setBerthName(newTask.getBerthName()); |
| | | existingTask.setUpdateBy(getUsername()); |
| | | iDsTaskListService.updateDsTaskList(existingTask); |
| | | } |
| | | } |
| | | } |
| | | return success("æ´æ°æå"); |
| | | } |
| | | |
| | | /** |
| | | * ç 头è°åº¦åé
æ¥å£ |
| | | * |
| | | */ |
| | | @Operation(summary = "æ³ä½è¡¥ç»è®¡ååé
") |
| | | @PostMapping("/berth/alloc") |
| | | @ResponseBody |
| | | public AjaxResult berthAllocation(@RequestBody AllocBerthTimeReqDTO reqDTO) { |
| | | //è·åå½åç¨æ·é¨é¨ç¼å· |
| | | Long deptId = getDeptId(); |
| | | if(null != reqDTO.getDeptId()){ |
| | | deptId = reqDTO.getDeptId(); |
| | | } |
| | | if(null == reqDTO.getTaskId()){ |
| | | return error("ä»»å¡ç¼å·ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | DsTaskList2 dsTaskList2Entity = new DsTaskList2(); |
| | | dsTaskList2Entity.setTaskId(reqDTO.getTaskId()); |
| | | dsTaskList2Entity.setDeptId(deptId); |
| | | List<DsTaskList2> taskLists = iDsTaskListService.selectDsTaskListList(dsTaskList2Entity); |
| | | if(taskLists.size() == 0){ |
| | | return error("å½åæ ä»»å¡ï¼è¯·éæ°æ£æ¥åæ°"); |
| | | } |
| | | // éæ°ç»ç»æ°æ®ç»æï¼ç¶ååé |
| | | return success(allocationBerthTime(taskLists, reqDTO.getRule())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è°èåç» |
| | | * @param list |
| | | * @param rule |
| | | * @param berthids |
| | | * @return |
| | | */ |
| | | private List<DsTaskList2> allocationBerth(List<DsTaskList2> list, String rule, String berthids){ |
| | | List<DsTaskList2> resultTask = new ArrayList<>(); |
| | | String[] berthArr = berthids.split(","); |
| | | |
| | | if(null != list && list.size() > 0){ |
| | | switch (rule){ |
| | | case "JTXH": //æè°èåå· |
| | | case "DYYX": //æå¼¹è¯ä¼å
|
| | | case "YXSX": //æä¼å
é¡ºåº |
| | | case "RGFZ": //æäººå·¥åç» |
| | | default: |
| | | if(null != berthArr && berthArr.length > 0){ |
| | | |
| | | Map<Long, List<DmBerth2>> harborBerthMap = new HashMap<>(); |
| | | |
| | | List<Long> berthIdList = Arrays.stream(berthArr) |
| | | .map(Long::valueOf) |
| | | .collect(Collectors.toList()); |
| | | List<DmBerth2> berthList = dmBerthService.selectDmBerthByHarborIds(berthIdList); |
| | | |
| | | for (DmBerth2 dmBerth2 : berthList) { |
| | | if (dmBerth2 != null) { |
| | | harborBerthMap.computeIfAbsent(dmBerth2.getHarborId(), k -> new ArrayList<>()).add(dmBerth2); |
| | | } |
| | | } |
| | | |
| | | for (DsTaskList2 task : list) { |
| | | Long harborId = task.getHarborId(); |
| | | List<DmBerth2> availableBerths = harborBerthMap.get(harborId); |
| | | if (availableBerths != null && !availableBerths.isEmpty()) { |
| | | DmBerth2 assignedBerth = availableBerths.remove(0); |
| | | task.setBerthId(assignedBerth.getPKID()); |
| | | task.setBerthName(assignedBerth.getNAME()); |
| | | resultTask.add(task); |
| | | } else { |
| | | // å¦ææ²¡æå¯ç¨çæ³ä½åç»§ç»æç
§åæ¥çé»è¾éå¤åé
|
| | | for (Map.Entry<Long, List<DmBerth2>> entry : harborBerthMap.entrySet()) { |
| | | if (!entry.getValue().isEmpty()) { |
| | | DmBerth2 assignedBerth = entry.getValue().remove(0); |
| | | task.setBerthId(assignedBerth.getPKID()); |
| | | task.setBerthName(assignedBerth.getNAME()); |
| | | resultTask.add(task); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return resultTask; |
| | | } |
| | | |
| | | /** |
| | | * è°èæ¶é´åé
|
| | | * @param list |
| | | * @param rule |
| | | * @return |
| | | */ |
| | | private List<DsTaskDetail> allocationBerthTime(List<DsTaskList2> list, String rule){ |
| | | List<DsTaskDetail> result = new ArrayList<>(); |
| | | |
| | | // è·åæ¶é´è®¡ç®é
ç½®ä¿¡æ¯ |
| | | List<DmDdConfig> configList = iDmDdConfigService.selectDmDdConfigList(new DmDdConfig()); |
| | | |
| | | // éåææéè¦è®¡ç®çè¹ä¿¡æ¯ |
| | | for (DsTaskList2 task : list) { |
| | | Long berthId = task.getBerthId(); |
| | | List<DsTaskDetail> taskDetails = new ArrayList<>(); |
| | | |
| | | // è·åå½åæ³ä½çææè¹åª |
| | | List<DsTaskList2> berthTasks = list.stream() |
| | | .filter(t -> t.getBerthId().equals(berthId)) |
| | | .sorted(Comparator.comparing(DsTaskList2::getLEVEL)) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // éåæ³ä½çææè¹åªï¼è®¡ç®æ¯èè¹ç工使¶é´ |
| | | for (DsTaskList2 berthTask : berthTasks) { |
| | | DsTaskDetail taskDetail = new DsTaskDetail(); |
| | | taskDetail.setTaskId(berthTask.getTaskId()); |
| | | taskDetail.setBerthId(berthTask.getBerthId()); |
| | | taskDetail.setShipNo(berthTask.getShipNo()); |
| | | taskDetail.setBerthName(berthTask.getBerthName()); |
| | | taskDetail.setHarborId(berthTask.getHarborId()); |
| | | taskDetail.setHarborName(berthTask.getHarborName()); |
| | | taskDetail.setParkingType(berthTask.getParkingType()); |
| | | taskDetail.setShipType(berthTask.getShipType()); |
| | | |
| | | // æ ¹æ®configListè®¡ç®æ¯ä¸ä¸ªç±»åç©èµå·¥ä½éè¦çæ¶é´ |
| | | double totalOil = 0.0; |
| | | double totalWater = 0.0; |
| | | double totalMater = 0.0; |
| | | double totalAmmo = 0.0; |
| | | |
| | | // æ²¹ |
| | | if (berthTask.getOilA() != null && berthTask.getOilA() > 0) { |
| | | totalOil += berthTask.getOilA(); |
| | | } |
| | | if (berthTask.getOilB() != null && berthTask.getOilB() > 0) { |
| | | totalOil += berthTask.getOilB(); |
| | | } |
| | | if (berthTask.getOilG() != null && berthTask.getOilG() > 0) { |
| | | totalOil += berthTask.getOilG(); |
| | | } |
| | | // æ°´ |
| | | if (berthTask.getWATER() != null && berthTask.getWATER() > 0) { |
| | | totalWater += berthTask.getWATER(); |
| | | } |
| | | if (berthTask.getWaterP() != null && berthTask.getWaterP() > 0) { |
| | | totalWater += berthTask.getWaterP(); |
| | | } |
| | | // ç©èµ |
| | | if (berthTask.getFOOD() != null && berthTask.getFOOD() > 0) { |
| | | totalMater += berthTask.getFOOD(); |
| | | } |
| | | if (berthTask.getFoodO() != null && berthTask.getFoodO() > 0) { |
| | | totalMater += berthTask.getFoodO(); |
| | | } |
| | | if (berthTask.getFoodW() != null && berthTask.getFoodW() > 0) { |
| | | totalMater += berthTask.getFoodW(); |
| | | } |
| | | |
| | | // ç®å¼¹ |
| | | if (berthTask.getAmmoD() != null && berthTask.getAmmoD() > 0) { |
| | | totalAmmo += berthTask.getAmmoD(); |
| | | } |
| | | if (berthTask.getAmmoP() != null && berthTask.getAmmoP() > 0) { |
| | | totalAmmo += berthTask.getAmmoP(); |
| | | } |
| | | if (berthTask.getAmmoS() != null && berthTask.getAmmoS() > 0) { |
| | | totalAmmo += berthTask.getAmmoS(); |
| | | } |
| | | |
| | | // taskDetail.setWaterTime(getTimeByType(configList, totalWater, WATER_FLAG)); |
| | | // taskDetail.setOilTime(getTimeByType(configList, totalOil, OIL_FLAG)); |
| | | // taskDetail.setMatTime(getTimeByType(configList, totalMater, MATER_FLAG)); |
| | | // å¼¹è¯æ¶é´éè¦æ ¹æ®å¼¹è¯ç§ç±»è¿è¡åå«è®¡ç® |
| | | Double totalAmmoTime = getTimeByType(configList, null == berthTask.getAmmoO() ? 0.0 : (double)(berthTask.getAmmoO()), AMMO_O_FLAG); |
| | | totalAmmoTime += getTimeByType(configList, totalAmmo, AMMO_FLAG); |
| | | |
| | | // taskDetail.setAmmoTime(totalAmmoTime); |
| | | |
| | | double totalTime = 0.0; |
| | | if ("TS".equals(rule)) { |
| | | totalTime = Math.max(taskDetail.getWaterTime(), Math.max(taskDetail.getOilTime(), Math.max(taskDetail.getMatTime(), taskDetail.getAmmoTime()))); |
| | | } else if ("XYHD".equals(rule)) { |
| | | totalTime = Math.max(taskDetail.getWaterTime(), Math.max(taskDetail.getMatTime(), taskDetail.getAmmoTime())) + taskDetail.getOilTime(); |
| | | } |
| | | // taskDetail.setTotalTime(totalTime); |
| | | |
| | | // å°è®¡ç®ç»ææ·»å å°ç»æåè¡¨ä¸ |
| | | taskDetails.add(taskDetail); |
| | | } |
| | | |
| | | // å°å½åæ³ä½çææè¹åªç计ç®ç»ææ·»å å°æç»ç»æä¸ |
| | | result.addAll(taskDetails); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç±»åè·åæ¶èæ¶é´ |
| | | * @param list |
| | | * @param val |
| | | * @param type |
| | | * @return |
| | | */ |
| | | private Double getTimeByType(List<DmDdConfig> list, Double val, String type){ |
| | | AtomicReference<Double> totalTime = new AtomicReference<>(0.0); |
| | | // åæ°ä¸ºç©º åè¿å0 |
| | | if(null != val && StringUtils.isNotBlank(type)){ |
| | | list.stream().forEach(item -> { |
| | | if(item.getTYPE().equals(type) && null != item.getTIME()){ |
| | | totalTime.set(item.getTIME() * val); |
| | | } |
| | | }); |
| | | } |
| | | return totalTime.get(); |
| | | } |
| | | |
| | | // æ ¹æ®IDè·åæ³ä½è·¯å¾ä¿¡æ¯è¯¦æ
|
| | | private String getBerthPathById(List<DmBerth2> list, Long id){ |
| | | for(DmBerth2 berth2 : list){ |
| | | if(berth2.getPKID() == id){ |
| | | return berth2.getPath(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | private void updateDetailPath(Long taskId, Long deptId, List<DmBerth2> berth2List){ |
| | | // è·åä»»å¡è¯¦æ
å表 |
| | | List<DsTaskDetail> taskDetails = iDsTaskDetailService.selectDsTaskDetailByTaskId(taskId, null); |
| | | |
| | | // å建æ³ä½IDå°è·¯å¾çæ å° |
| | | Map<Long, DmBerth2> berth2Map = berth2List.stream().collect(Collectors.toMap(DmBerth2::getPKID, berth -> berth)); |
| | | |
| | | |
| | | // æ¹éæ´æ°ä»»å¡è¯¦æ
|
| | | List<DsTaskDetail> updatedDetails = taskDetails.stream() |
| | | .filter(detail -> detail.getBerthId() != null) |
| | | .peek(detail -> detail.setPath(berth2Map.get(detail.getBerthId()).getPath())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | // æ¹éä¿åæ´æ° |
| | | if (!updatedDetails.isEmpty()) { |
| | | iDsTaskDetailService.batchUpdateDsTaskDetail(updatedDetails); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import com.ruoyi.buss.common.dynamic.DynamicBeanRegistrar; |
| | | import eu.bitwalker.useragentutils.Application; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.lang.reflect.Method; |
| | | |
| | | @Tag(name = "代ç å è½½æµè¯") |
| | | @RestController |
| | | @RequestMapping("/dynamic") |
| | | public class DemoController { |
| | | private final DynamicBeanRegistrar registrar; |
| | | |
| | | public DemoController(ApplicationContext context) { |
| | | this.registrar = new DynamicBeanRegistrar((ConfigurableApplicationContext) context); |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private ApplicationContext applicationContext; |
| | | |
| | | @Operation(summary = "卿代ç å è½½æµè¯") |
| | | @GetMapping("/compile") |
| | | @ResponseBody |
| | | public String compile(@RequestParam("code") String code) throws Exception { |
| | | String sourceCode = "public class Demo { public String test(String code) { return \"Hello\" + code; } }"; |
| | | String className = "DynamicService_" + System.currentTimeMillis(); |
| | | registrar.registerBean(className.toLowerCase(), "Demo", sourceCode); |
| | | System.out.println("Compiled:" + className); |
| | | Object bean = applicationContext.getBean(className); |
| | | Method method = bean.getClass().getMethod("test"); |
| | | Object object = method.invoke(code); |
| | | |
| | | System.out.println(object.toString()); |
| | | |
| | | return "Compiled: " + className; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.buss.domain.DmBerth2; |
| | | import com.ruoyi.buss.service.IDmBerth2Service; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * æ³ä½ä¿¡æ¯Controller |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | //@Tag(name = "æ³ä½ä¿¡æ¯") |
| | | //@Controller |
| | | //@RequestMapping("/buss/berth") |
| | | public class DmBerth2Controller extends BaseController |
| | | { |
| | | private String prefix = "buss/berth"; |
| | | |
| | | @Autowired |
| | | private IDmBerth2Service dmBerthService; |
| | | |
| | | @GetMapping() |
| | | public String berth() |
| | | { |
| | | return prefix + "/berth"; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ³ä½ä¿¡æ¯å表 |
| | | */ |
| | | @Operation(description = "æ¥è¯¢æ³ä½ä¿¡æ¯å表") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo list(DmBerth2 dmBerth2) |
| | | { |
| | | startPage(); |
| | | List<DmBerth2> list = dmBerthService.selectDmBerthList(dmBerth2); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢æ³ä½ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary="æ°å¢æ³ä½ä¿¡æ¯") |
| | | @GetMapping("/add") |
| | | public String add() |
| | | { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿åæ³ä½ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary="æ°å¢ä¿åæ³ä½ä¿¡æ¯") |
| | | @Log(title = "æ³ä½ä¿¡æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(DmBerth2 dmBerth2) |
| | | { |
| | | return toAjax(dmBerthService.insertDmBerth(dmBerth2)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ³ä½ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary="ä¿®æ¹æ³ä½ä¿¡æ¯") |
| | | @GetMapping("/edit/{PKID}") |
| | | public String edit(@PathVariable("PKID") Long PKID, ModelMap mmap) |
| | | { |
| | | DmBerth2 dmBerth2 = dmBerthService.selectDmBerthByPKID(PKID); |
| | | mmap.put("dmBerth", dmBerth2); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åæ³ä½ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary="ä¿®æ¹ä¿åæ³ä½ä¿¡æ¯") |
| | | @Log(title = "æ³ä½ä¿¡æ¯", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(DmBerth2 dmBerth2) |
| | | { |
| | | return toAjax(dmBerthService.updateDmBerth(dmBerth2)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿³ä½ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary="å 餿³ä½ä¿¡æ¯") |
| | | @Log(title = "æ³ä½ä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @PostMapping( "/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) |
| | | { |
| | | return toAjax(dmBerthService.deleteDmBerthByPKIDs(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.buss.domain.DmDdConfig; |
| | | import com.ruoyi.buss.service.IDmDdConfigService; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * è°é
é
置信æ¯Controller |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | @Tag(name = "è°é
é
置信æ¯") |
| | | @Controller |
| | | @RequestMapping("/buss/config") |
| | | public class DmDdConfigController extends BaseController |
| | | { |
| | | private String prefix = "buss/config"; |
| | | |
| | | @Autowired |
| | | private IDmDdConfigService dmDdConfigService; |
| | | |
| | | @GetMapping() |
| | | public String config() |
| | | { |
| | | return prefix + "/config"; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è°é
é
置信æ¯å表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢è°é
é
置信æ¯å表") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo list(DmDdConfig dmDdConfig) |
| | | { |
| | | startPage(); |
| | | List<DmDdConfig> list = dmDdConfigService.selectDmDdConfigList(dmDdConfig); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢è°é
é
ç½®ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢è°é
é
置信æ¯") |
| | | @GetMapping("/add") |
| | | public String add() |
| | | { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿åè°é
é
ç½®ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢ä¿åè°é
é
置信æ¯") |
| | | @Log(title = "è°é
é
置信æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(DmDdConfig dmDdConfig) |
| | | { |
| | | return toAjax(dmDdConfigService.insertDmDdConfig(dmDdConfig)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è°é
é
ç½®ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹è°é
é
置信æ¯") |
| | | @GetMapping("/edit/{PKID}") |
| | | public String edit(@PathVariable("PKID") Long PKID, ModelMap mmap) |
| | | { |
| | | DmDdConfig dmDdConfig = dmDdConfigService.selectDmDdConfigByPKID(PKID); |
| | | mmap.put("dmDdConfig", dmDdConfig); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åè°é
é
ç½®ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ä¿åè°é
é
置信æ¯") |
| | | @Log(title = "è°é
é
置信æ¯", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(DmDdConfig dmDdConfig) |
| | | { |
| | | return toAjax(dmDdConfigService.updateDmDdConfig(dmDdConfig)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è°é
é
ç½®ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "å é¤è°é
é
置信æ¯") |
| | | @Log(title = "è°é
é
置信æ¯", businessType = BusinessType.DELETE) |
| | | @PostMapping( "/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) |
| | | { |
| | | return toAjax(dmDdConfigService.deleteDmDdConfigByPKIDs(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.buss.domain.DmHarbor2; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.buss.service.IDmHarbor2Service; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * 港å£ä¿¡æ¯Controller |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | @Tag(name = "港å£ä¿¡æ¯") |
| | | @Controller |
| | | @RequestMapping("/buss/harbor") |
| | | public class DmHarbor2Controller extends BaseController |
| | | { |
| | | private String prefix = "buss/harbor"; |
| | | |
| | | @Autowired |
| | | private IDmHarbor2Service dmHarborService; |
| | | |
| | | @GetMapping() |
| | | public String harbor() |
| | | { |
| | | return prefix + "/harbor"; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¸¯å£ä¿¡æ¯å表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢æ¸¯å£ä¿¡æ¯å表") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo list(DmHarbor2 dmHarbor2) |
| | | { |
| | | startPage(); |
| | | List<DmHarbor2> list = dmHarborService.selectDmHarborList(dmHarbor2); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢æ¸¯å£ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢æ¸¯å£ä¿¡æ¯") |
| | | @GetMapping("/add") |
| | | public String add() |
| | | { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿å港å£ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢ä¿å港å£ä¿¡æ¯") |
| | | @Log(title = "港å£ä¿¡æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(DmHarbor2 dmHarbor2) |
| | | { |
| | | return toAjax(dmHarborService.insertDmHarbor(dmHarbor2)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ¸¯å£ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹æ¸¯å£ä¿¡æ¯") |
| | | @GetMapping("/edit/{PKID}") |
| | | public String edit(@PathVariable("PKID") Long PKID, ModelMap mmap) |
| | | { |
| | | DmHarbor2 dmHarbor2 = dmHarborService.selectDmHarborByPKID(PKID); |
| | | mmap.put("dmHarbor", dmHarbor2); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿å港å£ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ä¿å港å£ä¿¡æ¯") |
| | | @Log(title = "港å£ä¿¡æ¯", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(DmHarbor2 dmHarbor2) |
| | | { |
| | | return toAjax(dmHarborService.updateDmHarbor(dmHarbor2)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿¸¯å£ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "å 餿¸¯å£ä¿¡æ¯") |
| | | @Log(title = "港å£ä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @PostMapping( "/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) |
| | | { |
| | | return toAjax(dmHarborService.deleteDmHarborByPKIDs(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.buss.domain.DmWarship; |
| | | import com.ruoyi.buss.service.IDmWarshipService; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * è°èä¿¡æ¯Controller |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | @Tag(name = "è°èä¿¡æ¯") |
| | | @Controller |
| | | @RequestMapping("/buss/warship") |
| | | public class DmWarshipController extends BaseController |
| | | { |
| | | private String prefix = "buss/warship"; |
| | | |
| | | @Autowired |
| | | private IDmWarshipService dmWarshipService; |
| | | |
| | | @GetMapping() |
| | | public String warship() |
| | | { |
| | | return prefix + "/warship"; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è°èä¿¡æ¯å表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢è°èä¿¡æ¯å表") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo list(DmWarship dmWarship) |
| | | { |
| | | startPage(); |
| | | List<DmWarship> list = dmWarshipService.selectDmWarshipList(dmWarship); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢è°èä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢è°èä¿¡æ¯") |
| | | @GetMapping("/add") |
| | | public String add() |
| | | { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿åè°èä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢ä¿åè°èä¿¡æ¯") |
| | | @Log(title = "è°èä¿¡æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(DmWarship dmWarship) |
| | | { |
| | | return toAjax(dmWarshipService.insertDmWarship(dmWarship)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è°èä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹è°èä¿¡æ¯") |
| | | @GetMapping("/edit/{shipNo}") |
| | | public String edit(@PathVariable("shipNo") String shipNo, ModelMap mmap) |
| | | { |
| | | DmWarship dmWarship = dmWarshipService.selectDmWarshipByShipNo(shipNo); |
| | | mmap.put("dmWarship", dmWarship); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åè°èä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ä¿åè°èä¿¡æ¯") |
| | | @Log(title = "è°èä¿¡æ¯", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(DmWarship dmWarship) |
| | | { |
| | | return toAjax(dmWarshipService.updateDmWarship(dmWarship)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è°èä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "å é¤è°èä¿¡æ¯") |
| | | @Log(title = "è°èä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @PostMapping( "/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) |
| | | { |
| | | return toAjax(dmWarshipService.deleteDmWarshipByShipNos(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.buss.domain.DsEffectAssess; |
| | | import com.ruoyi.buss.service.IDsEffectAssessService; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * è½æè¯ä¼°Controller |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-24 |
| | | */ |
| | | @Tag(name = "è½æè¯ä¼°") |
| | | @Controller |
| | | @RequestMapping("/buss/assess") |
| | | public class DsEffectAssessController extends BaseController |
| | | { |
| | | private String prefix = "buss/assess"; |
| | | |
| | | @Autowired |
| | | private IDsEffectAssessService dsEffectAssessService; |
| | | |
| | | @GetMapping() |
| | | public String assess() |
| | | { |
| | | return prefix + "/assess"; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è½æè¯ä¼°å表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢è½æè¯ä¼°å表") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo list(DsEffectAssess dsEffectAssess) |
| | | { |
| | | startPage(); |
| | | List<DsEffectAssess> list = dsEffectAssessService.selectDsEffectAssessList(dsEffectAssess); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢è½æè¯ä¼° |
| | | */ |
| | | @Operation(summary = "æ°å¢è½æè¯ä¼°") |
| | | @GetMapping("/add") |
| | | public String add() |
| | | { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿åè½æè¯ä¼° |
| | | */ |
| | | @Operation(summary = "æ°å¢ä¿åè½æè¯ä¼°") |
| | | @Log(title = "è½æè¯ä¼°", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(DsEffectAssess dsEffectAssess) |
| | | { |
| | | return toAjax(dsEffectAssessService.insertDsEffectAssess(dsEffectAssess)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è½æè¯ä¼° |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹è½æè¯ä¼°") |
| | | @GetMapping("/edit/{PKID}") |
| | | public String edit(@PathVariable("PKID") String PKID, ModelMap mmap) |
| | | { |
| | | DsEffectAssess dsEffectAssess = dsEffectAssessService.selectDsEffectAssessByPKID(PKID); |
| | | mmap.put("dsEffectAssess", dsEffectAssess); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åè½æè¯ä¼° |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ä¿åè½æè¯ä¼°") |
| | | @Log(title = "è½æè¯ä¼°", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(DsEffectAssess dsEffectAssess) |
| | | { |
| | | return toAjax(dsEffectAssessService.updateDsEffectAssess(dsEffectAssess)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è½æè¯ä¼° |
| | | */ |
| | | @Operation(summary = "å é¤è½æè¯ä¼°") |
| | | @Log(title = "è½æè¯ä¼°", businessType = BusinessType.DELETE) |
| | | @PostMapping( "/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) |
| | | { |
| | | return toAjax(dsEffectAssessService.deleteDsEffectAssessByPKIDs(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.buss.domain.DsEffectAssessList; |
| | | import com.ruoyi.buss.service.IDsEffectAssessListService; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * è½æè¯ä¼°é¡¹è¯¦æ
Controller |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-24 |
| | | */ |
| | | @Tag(name = "è½æè¯ä¼°é¡¹è¯¦æ
") |
| | | @Controller |
| | | @RequestMapping("/buss/assesslist") |
| | | public class DsEffectAssessListController extends BaseController |
| | | { |
| | | private String prefix = "buss/assesslist"; |
| | | |
| | | @Autowired |
| | | private IDsEffectAssessListService dsEffectAssessListService; |
| | | |
| | | @GetMapping() |
| | | public String list() |
| | | { |
| | | return prefix + "/list"; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢è½æè¯ä¼°é¡¹è¯¦æ
å表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢è½æè¯ä¼°é¡¹è¯¦æ
å表") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo list(DsEffectAssessList dsEffectAssessList) |
| | | { |
| | | startPage(); |
| | | List<DsEffectAssessList> list = dsEffectAssessListService.selectDsEffectAssessListList(dsEffectAssessList); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢è½æè¯ä¼°é¡¹è¯¦æ
|
| | | */ |
| | | @Operation(summary = "æ°å¢è½æè¯ä¼°é¡¹è¯¦æ
") |
| | | @GetMapping("/add") |
| | | public String add() |
| | | { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿åè½æè¯ä¼°é¡¹è¯¦æ
|
| | | */ |
| | | @Operation(summary = "æ°å¢ä¿åè½æè¯ä¼°é¡¹è¯¦æ
") |
| | | @Log(title = "è½æè¯ä¼°é¡¹è¯¦æ
", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(DsEffectAssessList dsEffectAssessList) |
| | | { |
| | | return toAjax(dsEffectAssessListService.insertDsEffectAssessList(dsEffectAssessList)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è½æè¯ä¼°é¡¹è¯¦æ
|
| | | */ |
| | | @Operation(summary = "ä¿®æ¹è½æè¯ä¼°é¡¹è¯¦æ
") |
| | | @GetMapping("/edit/{PKID}") |
| | | public String edit(@PathVariable("PKID") String PKID, ModelMap mmap) |
| | | { |
| | | DsEffectAssessList dsEffectAssessList = dsEffectAssessListService.selectDsEffectAssessListByPKID(PKID); |
| | | mmap.put("dsEffectAssessList", dsEffectAssessList); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åè½æè¯ä¼°é¡¹è¯¦æ
|
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ä¿åè½æè¯ä¼°é¡¹è¯¦æ
") |
| | | @Log(title = "è½æè¯ä¼°é¡¹è¯¦æ
", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(DsEffectAssessList dsEffectAssessList) |
| | | { |
| | | return toAjax(dsEffectAssessListService.updateDsEffectAssessList(dsEffectAssessList)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è½æè¯ä¼°é¡¹è¯¦æ
|
| | | */ |
| | | @Operation(summary = "å é¤è½æè¯ä¼°é¡¹è¯¦æ
") |
| | | @Log(title = "è½æè¯ä¼°é¡¹è¯¦æ
", businessType = BusinessType.DELETE) |
| | | @PostMapping( "/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) |
| | | { |
| | | return toAjax(dsEffectAssessListService.deleteDsEffectAssessListByPKIDs(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import com.ruoyi.buss.domain.DmHarbor2; |
| | | import com.ruoyi.buss.domain.DsMatDispatch2; |
| | | import com.ruoyi.buss.service.IDmHarbor2Service; |
| | | import com.ruoyi.buss.service.IDsMatDispatch2Service; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Tag(name = "跨港åºè°åº¦æ¥å£") |
| | | @RestController |
| | | @RequestMapping("/buss/matdispatch") |
| | | public class DsMatDispatch2Controller extends BaseController { |
| | | |
| | | private static String STATUS_1 = "1"; // æªæäº¤ |
| | | private static String STATUS_2 = "2"; // 审æ¹ä¸ |
| | | private static String STATUS_3 = "3"; // 审æ¹éè¿ |
| | | private static String STATUS_4 = "4"; // 驳å |
| | | |
| | | |
| | | @Autowired |
| | | private IDmHarbor2Service iDmHarbor2Service; |
| | | |
| | | @Autowired |
| | | private IDsMatDispatch2Service iDsMatDispatch2Service; |
| | | |
| | | @Operation(summary = "è·åä»»å¡å表") |
| | | @PostMapping("/list/all") |
| | | @ResponseBody |
| | | public AjaxResult list() { |
| | | List<DsMatDispatch2> list = iDsMatDispatch2Service.selectDsMatDispatchForApply(); |
| | | if(null != list){ |
| | | return success(list); |
| | | } |
| | | return error("è·åä»»å¡å表失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "æ ¹æ®æ¡ä»¶è·åä»»å¡å表") |
| | | @PostMapping("/list/param") |
| | | @ResponseBody |
| | | public AjaxResult list(DsMatDispatch2 dsMatDispatch2) { |
| | | List<DsMatDispatch2> list = iDsMatDispatch2Service.selectDsMatDispatchList(dsMatDispatch2); |
| | | if(null != list){ |
| | | return success(list); |
| | | } |
| | | return error("è·åä»»å¡å表失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "è·åèªå·±æéå
çä»»å¡å表") |
| | | @PostMapping("/list/self") |
| | | @ResponseBody |
| | | public AjaxResult list3(@RequestParam(value = "status", required = false) String status) { |
| | | List<DsMatDispatch2> list = iDsMatDispatch2Service.selectDsMatDispatchByDeptId(getDeptId(), status); |
| | | if(null != list){ |
| | | return success(list); |
| | | } |
| | | return error("è·åä»»å¡å表失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "è·åä»»å¡å表") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public AjaxResult list2(@RequestParam(value = "status", required = false) String status) { |
| | | LoginUser loginUser = getLoginUser(); |
| | | DsMatDispatch2 dsMatDispatch2 = new DsMatDispatch2(); |
| | | dsMatDispatch2.setResHarborId(loginUser.getDeptId().toString()); |
| | | if(StringUtils.isNotBlank(status)){ |
| | | dsMatDispatch2.setStatus(status); |
| | | } |
| | | List<DsMatDispatch2> list = iDsMatDispatch2Service.selectDsMatDispatchList(dsMatDispatch2); |
| | | if(null != list){ |
| | | return success(list); |
| | | } |
| | | return error("è·åä»»å¡å表失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "è·åèªå·±æ°å»ºçä»»å¡å表") |
| | | @PostMapping("/list2") |
| | | @ResponseBody |
| | | public AjaxResult list2() { |
| | | LoginUser loginUser = getLoginUser(); |
| | | DsMatDispatch2 dsMatDispatch2 = new DsMatDispatch2(); |
| | | dsMatDispatch2.setResHarborId(loginUser.getDeptId().toString()); |
| | | dsMatDispatch2.setResHarborName(loginUser.getUsername()); |
| | | List<DsMatDispatch2> list = iDsMatDispatch2Service.selectDsMatDispatchList(new DsMatDispatch2()); |
| | | if(null != list){ |
| | | return success(list); |
| | | } |
| | | return error("è·åä»»å¡å表失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | @Operation(summary = "ä»»å¡æäº¤å®¡æ¹") |
| | | @PostMapping("/apply/{id}") |
| | | @ResponseBody |
| | | public AjaxResult toApply(@PathVariable("id") Long id) { |
| | | DsMatDispatch2 matDispatch2 = iDsMatDispatch2Service.selectDsMatDispatchById(id); |
| | | if(null != matDispatch2){ |
| | | if(matDispatch2.getStatus().equals(STATUS_1)){ |
| | | matDispatch2.setStatus(STATUS_2); |
| | | matDispatch2.setUpdateBy(getUsername()); |
| | | matDispatch2.setUpdateTime(new Date()); |
| | | int rst = iDsMatDispatch2Service.updateDsMatDispatch(matDispatch2); |
| | | if(rst > 0){ |
| | | return success("æäº¤å®¡æ¹æå"); |
| | | } |
| | | else { |
| | | return error("æäº¤å®¡æ¹å¤±è´¥"); |
| | | } |
| | | } |
| | | else { |
| | | return error("å½åä»»å¡ä¸å¯æäº¤å®¡æ¹"); |
| | | } |
| | | } |
| | | else{ |
| | | return error("è·åä»»å¡å¤±è´¥ï¼è¯·éè¯"); |
| | | } |
| | | } |
| | | |
| | | @Operation(summary = "ä»»å¡å®¡æ¹") |
| | | @PostMapping("/prove") |
| | | @ResponseBody |
| | | public AjaxResult prove(@RequestBody DsMatDispatch2 dsMatDispatch2) { |
| | | if(null != dsMatDispatch2 && null != dsMatDispatch2.getId()){ |
| | | DsMatDispatch2 matDispatch2 = iDsMatDispatch2Service.selectDsMatDispatchById(dsMatDispatch2.getId()); |
| | | DmHarbor2 harborRes = null; |
| | | List<DmHarbor2> harbor2List = iDmHarbor2Service.selectDmHarborList(new DmHarbor2()); |
| | | for(DmHarbor2 harbor2 : harbor2List){ |
| | | if(StringUtils.isNotBlank(dsMatDispatch2.getDesHarborId()) && harbor2.getPKID().toString().equals(dsMatDispatch2.getDesHarborId())){ |
| | | harborRes = harbor2; |
| | | } |
| | | } |
| | | if(null != matDispatch2){ |
| | | if(matDispatch2.getStatus().equals(STATUS_2)){ |
| | | if(dsMatDispatch2.getApplyResult().equals("1")){ |
| | | matDispatch2.setStatus(STATUS_3); |
| | | } |
| | | else{ |
| | | matDispatch2.setStatus(STATUS_4); |
| | | } |
| | | |
| | | matDispatch2.setApplyResult(dsMatDispatch2.getApplyResult()); |
| | | matDispatch2.setApplyTime(new Date()); |
| | | matDispatch2.setApplyContent(dsMatDispatch2.getApplyContent()); |
| | | matDispatch2.setApplyBy(getUsername()); |
| | | matDispatch2.setUpdateBy(getUsername()); |
| | | matDispatch2.setUpdateTime(new Date()); |
| | | if(null != harborRes){ |
| | | matDispatch2.setResHarborId(harborRes.getDeptId().toString()); |
| | | matDispatch2.setResHarborName(harborRes.getDeptName()); |
| | | } |
| | | int rst = iDsMatDispatch2Service.updateDsMatDispatch(matDispatch2); |
| | | if(rst > 0){ |
| | | return success("å®¡æ¹æå"); |
| | | } |
| | | else { |
| | | return error("审æ¹å¤±è´¥"); |
| | | } |
| | | } |
| | | else { |
| | | return error("å½åä»»å¡ä¸å¯å®¡æ¹"); |
| | | } |
| | | } |
| | | else{ |
| | | return error("è·åä»»å¡å¤±è´¥ï¼è¯·éè¯"); |
| | | } |
| | | } |
| | | return error("åæ°å¤±è´¥ï¼éè¦"); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿åæ³ä½ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary="æ°å¢è·¨æ¸¯åºè°åº¦ä¿¡æ¯") |
| | | @Log(title = "跨港åºè°åº¦ä¿¡æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(@RequestBody DsMatDispatch2 dsMatDispatch2) { |
| | | if(null == dsMatDispatch2){ |
| | | return error("åæ°ä¸è½ä¸ºç©º"); |
| | | } |
| | | if(StringUtils.isBlank(dsMatDispatch2.getContent())){ |
| | | return error("è°åº¦å
容ä¸è½ä¸ºç©º"); |
| | | } |
| | | LoginUser loginUser = getLoginUser(); |
| | | dsMatDispatch2.setResHarborId(loginUser.getDeptId().toString()); |
| | | dsMatDispatch2.setResHarborName(loginUser.getUsername()); |
| | | dsMatDispatch2.setCreateTime(new Date()); |
| | | dsMatDispatch2.setCreateBy(getUsername()); |
| | | dsMatDispatch2.setStatus(STATUS_1); |
| | | return toAjax(iDsMatDispatch2Service.insertDsMatDispatch(dsMatDispatch2)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åæ³ä½ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary="ä¿®æ¹ä¿å跨港åºè°åº¦ä¿¡æ¯") |
| | | @Log(title = "跨港åºè°åº¦ä¿¡æ¯", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(DsMatDispatch2 dsMatDispatch2) |
| | | { |
| | | return toAjax(iDsMatDispatch2Service.updateDsMatDispatch(dsMatDispatch2)); |
| | | } |
| | | |
| | | /** |
| | | * å 餿³ä½ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary="å é¤è·¨æ¸¯åºè°åº¦ä¿¡æ¯") |
| | | @Log(title = "æ³ä½ä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @PostMapping( "/remove/{id}") |
| | | @ResponseBody |
| | | public AjaxResult remove(@PathVariable("id") Long id) |
| | | { |
| | | return toAjax(iDsMatDispatch2Service.deleteDsMatDispatchById(id)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.buss.domain.DsTask; |
| | | import com.ruoyi.buss.service.IDsTaskService; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * ä»»å¡ä¿¡æ¯Controller |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | @Tag(name = "ä»»å¡ä¿¡æ¯") |
| | | @Controller |
| | | @RequestMapping("/buss/task") |
| | | public class DsTaskController extends BaseController |
| | | { |
| | | private String prefix = "buss/task"; |
| | | |
| | | @Autowired |
| | | private IDsTaskService dsTaskService; |
| | | |
| | | @GetMapping() |
| | | public String task() |
| | | { |
| | | return prefix + "/task"; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡ä¿¡æ¯å表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢ä»»å¡ä¿¡æ¯å表") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo list(DsTask dsTask) |
| | | { |
| | | startPage(); |
| | | List<DsTask> list = dsTaskService.selectDsTaskList(dsTask); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢ä»»å¡ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢ä»»å¡ä¿¡æ¯") |
| | | @GetMapping("/add") |
| | | public String add() |
| | | { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿åä»»å¡ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢ä¿åä»»å¡ä¿¡æ¯") |
| | | @Log(title = "ä»»å¡ä¿¡æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(DsTask dsTask) |
| | | { |
| | | return toAjax(dsTaskService.insertDsTask(dsTask)); |
| | | } |
| | | |
| | | // /** |
| | | // * ä¿®æ¹ä»»å¡ä¿¡æ¯ |
| | | // */ |
| | | // @Operation("ä»»å¡ä¸å") |
| | | // @GetMapping("/task/apply/{PKID}") |
| | | // public String apply(@PathVariable("PKID") Long PKID) |
| | | // { |
| | | // DsTask dsTask = dsTaskService.selectDsTaskByPKID(PKID); |
| | | // dsTask.setSTATUS("1"); |
| | | // dsTask.setUpdateTime(new Date()); |
| | | // dsTask.setUpdateBy(getLoginName()); |
| | | // return prefix + "/edit"; |
| | | // } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä»»å¡ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ä»»å¡ä¿¡æ¯") |
| | | @GetMapping("/edit/{PKID}") |
| | | public String edit(@PathVariable("PKID") Long PKID, ModelMap mmap) |
| | | { |
| | | DsTask dsTask = dsTaskService.selectDsTaskByPKID(PKID); |
| | | mmap.put("dsTask", dsTask); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åä»»å¡ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ä¿åä»»å¡ä¿¡æ¯") |
| | | @Log(title = "ä»»å¡ä¿¡æ¯", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(DsTask dsTask) |
| | | { |
| | | return toAjax(dsTaskService.updateDsTask(dsTask)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä»»å¡ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "å é¤ä»»å¡ä¿¡æ¯") |
| | | @Log(title = "ä»»å¡ä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @PostMapping( "/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) |
| | | { |
| | | return toAjax(dsTaskService.deleteDsTaskByPKIDs(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.buss.domain.DsTaskDetail; |
| | | import com.ruoyi.buss.service.IDsTaskDetailService; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * ä»»å¡è°é
详æ
ä¿¡æ¯Controller |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | @Tag(name = "ä»»å¡è°é
详æ
ä¿¡æ¯") |
| | | @Controller |
| | | @RequestMapping("/buss/detail") |
| | | public class DsTaskDetailController extends BaseController |
| | | { |
| | | private String prefix = "buss/detail"; |
| | | |
| | | @Autowired |
| | | private IDsTaskDetailService dsTaskDetailService; |
| | | |
| | | @GetMapping() |
| | | public String detail() |
| | | { |
| | | return prefix + "/detail"; |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡è°é
详æ
ä¿¡æ¯å表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢ä»»å¡è°é
详æ
ä¿¡æ¯å表") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo list(DsTaskDetail dsTaskDetail) |
| | | { |
| | | startPage(); |
| | | List<DsTaskDetail> list = dsTaskDetailService.selectDsTaskDetailList(dsTaskDetail); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢ä»»å¡è°é
详æ
ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢ä»»å¡è°é
详æ
ä¿¡æ¯") |
| | | @GetMapping("/add") |
| | | public String add() |
| | | { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿åä»»å¡è°é
详æ
ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢ä¿åä»»å¡è°é
详æ
ä¿¡æ¯") |
| | | @Log(title = "ä»»å¡è°é
详æ
ä¿¡æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(DsTaskDetail dsTaskDetail) |
| | | { |
| | | return toAjax(dsTaskDetailService.insertDsTaskDetail(dsTaskDetail)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä»»å¡è°é
详æ
ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ä»»å¡è°é
详æ
ä¿¡æ¯") |
| | | @GetMapping("/edit/{PKID}") |
| | | public String edit(@PathVariable("PKID") Long PKID, ModelMap mmap) |
| | | { |
| | | DsTaskDetail dsTaskDetail = dsTaskDetailService.selectDsTaskDetailByPKID(PKID); |
| | | mmap.put("dsTaskDetail", dsTaskDetail); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åä»»å¡è°é
详æ
ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ä¿åä»»å¡è°é
详æ
ä¿¡æ¯") |
| | | @Log(title = "ä»»å¡è°é
详æ
ä¿¡æ¯", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(DsTaskDetail dsTaskDetail) |
| | | { |
| | | return toAjax(dsTaskDetailService.updateDsTaskDetail(dsTaskDetail)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä»»å¡è°é
详æ
ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "å é¤ä»»å¡è°é
详æ
ä¿¡æ¯") |
| | | @Log(title = "ä»»å¡è°é
详æ
ä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @PostMapping( "/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) |
| | | { |
| | | return toAjax(dsTaskDetailService.deleteDsTaskDetailByPKIDs(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.buss.domain.DsTaskList2; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.buss.service.IDsTaskList2Service; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * ä»»å¡å表信æ¯Controller |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | @Tag(name = "ä»»å¡å表信æ¯") |
| | | @Controller("TaskListController") |
| | | @RequestMapping("/buss/list") |
| | | public class DsTaskList2Controller extends BaseController |
| | | { |
| | | private String prefix = "buss/list"; |
| | | |
| | | @Autowired |
| | | private IDsTaskList2Service dsTaskListService; |
| | | |
| | | @GetMapping() |
| | | public String list() |
| | | { |
| | | return prefix + "/list"; |
| | | } |
| | | |
| | | /** |
| | | * ç 头è°åº¦åé
æ¥å£ |
| | | */ |
| | | @Operation(summary = "ç 头è°åº¦åé
") |
| | | @PostMapping("/allocation") |
| | | @ResponseBody |
| | | public TableDataInfo allocation(String ship, String rule) |
| | | { |
| | | List<DsTaskList2> list = dsTaskListService.selectDsTaskListByTaskId(100l); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡å表信æ¯å表 |
| | | */ |
| | | @Operation(summary = "è·å彿¥éè¦åé
çè°èä¿¡æ¯") |
| | | @PostMapping("/current/list") |
| | | @ResponseBody |
| | | public TableDataInfo curList() |
| | | { |
| | | List<DsTaskList2> list = dsTaskListService.selectCurrentDsTaskList(); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ä»»å¡å表信æ¯å表 |
| | | */ |
| | | @Operation(summary = "æ¥è¯¢ä»»å¡å表信æ¯å表") |
| | | @PostMapping("/list") |
| | | @ResponseBody |
| | | public TableDataInfo list(DsTaskList2 dsTaskList2) |
| | | { |
| | | startPage(); |
| | | List<DsTaskList2> list = dsTaskListService.selectDsTaskListList(dsTaskList2); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢ä»»å¡åè¡¨ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢ä»»å¡å表信æ¯") |
| | | @GetMapping("/add") |
| | | public String add() |
| | | { |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ä¿åä»»å¡åè¡¨ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "æ°å¢ä¿åä»»å¡å表信æ¯") |
| | | @Log(title = "ä»»å¡å表信æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(DsTaskList2 dsTaskList2) |
| | | { |
| | | return toAjax(dsTaskListService.insertDsTaskList(dsTaskList2)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä»»å¡åè¡¨ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ä»»å¡å表信æ¯") |
| | | @GetMapping("/edit/{taskId}") |
| | | public String edit(@PathVariable("taskId") Long taskId, ModelMap mmap) |
| | | { |
| | | List<DsTaskList2> dsTaskList2 = dsTaskListService.selectDsTaskListByTaskId(taskId); |
| | | mmap.put("dsTaskList", dsTaskList2); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åä»»å¡åè¡¨ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "ä¿®æ¹ä¿åä»»å¡å表信æ¯") |
| | | @Log(title = "ä»»å¡å表信æ¯", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | @ResponseBody |
| | | public AjaxResult editSave(DsTaskList2 dsTaskList2) |
| | | { |
| | | return toAjax(dsTaskListService.updateDsTaskList(dsTaskList2)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ä»»å¡åè¡¨ä¿¡æ¯ |
| | | */ |
| | | @Operation(summary = "å é¤ä»»å¡å表信æ¯") |
| | | @Log(title = "ä»»å¡å表信æ¯", businessType = BusinessType.DELETE) |
| | | @PostMapping( "/remove") |
| | | @ResponseBody |
| | | public AjaxResult remove(String ids) |
| | | { |
| | | return toAjax(dsTaskListService.deleteDsTaskListByTaskIds(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.buss.domain.DmBerth2; |
| | | import com.ruoyi.buss.domain.DsTaskList2; |
| | | import com.ruoyi.buss.domain.dto.ShipGroupDTO; |
| | | import com.ruoyi.buss.domain.dto.Subdata; |
| | | import com.ruoyi.buss.domain.dto.TaskRecordList; |
| | | import com.ruoyi.buss.domain.dto.ZdGroupDTO; |
| | | import com.ruoyi.buss.service.IDmBerth2Service; |
| | | import com.ruoyi.buss.service.IDsTaskList2Service; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * æ¯é级è°è¹æ³ä½åç»é»è¾Controller |
| | | * |
| | | * @author yl |
| | | * @date 2025-03-20 |
| | | */ |
| | | |
| | | @Tag(name = "æ¯éè°è¹æ³ä½åç»") |
| | | @Controller |
| | | @RequestMapping("/buss/zd") |
| | | public class ZdBerthGroupController extends BaseController { |
| | | private static final Logger log = LoggerFactory.getLogger(ZdBerthGroupController.class); |
| | | |
| | | private final static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | @Autowired |
| | | private IDmBerth2Service dmBerthService; |
| | | |
| | | @Autowired |
| | | private IDsTaskList2Service dsTaskListService; |
| | | |
| | | /** |
| | | * è·åæ¯éç 头æ³ä½åç»æ°æ®ç»æã |
| | | * |
| | | * @return |
| | | */ |
| | | @Operation(description = "è·åæ¯éæ³ä½åç»ç»æ") |
| | | @Log(title = "æ¯éæ³ä½åç»", businessType = BusinessType.INSERT) |
| | | @PostMapping("/berthgroup") |
| | | @ResponseBody |
| | | public AjaxResult getZdBerthGroup(@RequestBody ZdGroupDTO zdGroupDTO) throws IOException { |
| | | String berthIds = zdGroupDTO.getBerthIds(); |
| | | String berthRuleStr = zdGroupDTO.getBerthGroupRule(); |
| | | String taskIdStr = zdGroupDTO.getTaskId(); |
| | | List<DmBerth2> dmBerthList = dmBerthService.getDmBerthListByIds(berthIds); |
| | | log.debug("dmBerthList = " + dmBerthList); |
| | | Integer berthRule = Integer.parseInt(berthRuleStr); |
| | | |
| | | // æ ¹æ®ç¨æ·æå±é¨é¨IDï¼æ¥è¯¢ç®¡è¾ç 头åé
çè°èä¿¡æ¯ |
| | | LoginUser sysUser = getLoginUser(); |
| | | Long deptId = sysUser.getDeptId(); |
| | | log.debug("deptId = : " + deptId); |
| | | List<DsTaskList2> dsTaskListList = dsTaskListService.getDsTaskListByTaskIdAndDeptId(Long.parseLong(taskIdStr), deptId); |
| | | log.debug("æ ¹æ®ä»»å¡ãé¨åIDè·åç 头JTä¿¡æ¯DsTaskList = " + dsTaskListList); |
| | | JSONArray jsonArray = null; |
| | | switch (berthRule) { |
| | | case 1: |
| | | // æJTåå·åç» |
| | | jsonArray = calcZdBerthGroupByJTModel(berthRuleStr, deptId, dmBerthList, dsTaskListList); |
| | | break; |
| | | case 2: |
| | | // æDYä¼å
åç» |
| | | jsonArray = calcZdBerthGroupByBullet(berthRuleStr, deptId, dmBerthList, dsTaskListList); |
| | | break; |
| | | case 3: |
| | | // æä¼å
顺åºåç» |
| | | jsonArray = calcZdBerthGroupByOrder(berthRuleStr, deptId, dmBerthList, dsTaskListList); |
| | | break; |
| | | case 4: |
| | | // æäººå·¥åç» |
| | | break; |
| | | default: |
| | | // é»è®¤æJTåå·åç» |
| | | } |
| | | return AjaxResult.success(jsonArray); |
| | | } |
| | | |
| | | /** |
| | | * æJTåå·åç»ç®æ³ã |
| | | * @param berthList |
| | | * @param dsTaskLists |
| | | * @return |
| | | */ |
| | | private JSONArray calcZdBerthGroupByJTModel(String parkingType, Long deptId, List<DmBerth2> berthList, List<DsTaskList2> dsTaskLists) { |
| | | // å®ä¹æ¯ä¸ªæ³ä½çæå¤§é¿åº¦ |
| | | Long[] berthLengths = new Long[berthList.size()]; |
| | | for(int i = 0; i < berthList.size(); i++){ |
| | | berthLengths[i] = berthList.get(i).getBerthLen(); |
| | | } |
| | | |
| | | // æåå·åç»å¹¶ä¸¤ä¸¤é
对 |
| | | Map<String, List<DsTaskList2>> typeShipMap = new HashMap<>(); |
| | | for (DsTaskList2 ship : dsTaskLists) { |
| | | typeShipMap.computeIfAbsent(ship.getShipType(), k -> new ArrayList<>()).add(ship); |
| | | } |
| | | log.debug("typeShipMap =====: " + typeShipMap); |
| | | |
| | | List<List<DsTaskList2>> shipPairs = new ArrayList<>(); |
| | | for (List<DsTaskList2> shipsOfType : typeShipMap.values()) { |
| | | for (int i = 0; i < shipsOfType.size(); i += 2) { |
| | | shipPairs.add(shipsOfType.subList(i, i + 2)); |
| | | } |
| | | } |
| | | log.debug("shipPairs =====: " + shipPairs); |
| | | |
| | | // ææ¯ç»ä¸ä¸¤èè¹åé æ¶é´æ»åä»å°å°å¤§æåº |
| | | shipPairs.sort(Comparator.comparingDouble(pair -> (pair.get(0).getDockTime() == null ? 0:pair.get(0).getDockTime()) + (pair.get(1).getDockTime()==null ? 0:pair.get(1).getDockTime()))); |
| | | |
| | | // è®°å½æ¯ä¸ªæ³ä½çå½åæ»åé æ¶é´ |
| | | int[] berthTotalTimes = new int[berthLengths.length]; |
| | | // è®°å½æ¯ç»è¹åé
å°çæ³ä½ |
| | | int[] pairAssignments = new int[shipPairs.size()]; |
| | | |
| | | // åé
è¹åªå°æ³ä½ |
| | | for (int i = 0; i < shipPairs.size(); i++) { |
| | | List<DsTaskList2> pair = shipPairs.get(i); |
| | | Double totalLength = pair.get(0).getShipLen(); // åè¹å¹¶é ï¼åä¸èè¹é¿åº¦å¤ææ¯å¦è½åé |
| | | int minTime = Integer.MAX_VALUE; |
| | | int bestBerth = -1; |
| | | for (int j = 0; j < berthLengths.length; j++) { |
| | | if (totalLength <= berthLengths[j]) { |
| | | Double dockTimeMax = Math.max(pair.get(0).getDockTime() == null ? 0 : pair.get(0).getDockTime(), pair.get(1).getDockTime() == null ? 0 : pair.get(1).getDockTime()); |
| | | int newTime = berthTotalTimes[j] + dockTimeMax.intValue(); |
| | | if (newTime < minTime) { |
| | | minTime = newTime; |
| | | bestBerth = j; |
| | | } |
| | | } |
| | | } |
| | | pairAssignments[i] = bestBerth; |
| | | berthTotalTimes[bestBerth] = minTime; |
| | | } |
| | | |
| | | // è¾åºç»æ |
| | | for (int i = 0; i < shipPairs.size(); i++) { |
| | | List<DsTaskList2> pair = shipPairs.get(i); |
| | | log.debug("è°è¹ " + pair.get(0).getShipNo() + " å " + pair.get(1).getShipNo() + "ï¼åå· " + pair.get(0).getShipType() + "ï¼åé 卿³ä½ " + (pairAssignments[i] + 1)); |
| | | } |
| | | int totalTime = Arrays.stream(berthTotalTimes).max().getAsInt(); |
| | | log.debug("ææè¹åé å°ç¦»å¼æ³ä½çæ»æ¶é´æç为: " + totalTime + " å°æ¶"); |
| | | |
| | | log.debug("******** ææ³ä½å·è§£æä¾æ¬¡æåçDsTaskList对象 ********"); |
| | | // ææ³ä½å·è§£æä¾æ¬¡æåçDsTaskList对象 |
| | | // æç
§æ³ä½å·é¡ºåºï¼è®¡ç®æ¯ä¸ªæ³ä½ä¸åé è°è¹ç对象DsTaskList |
| | | HashMap<String, List<DsTaskList2>> resultList = new HashMap<>(); |
| | | for (int i = 0; i < pairAssignments.length; i++) { |
| | | int berthNumber = pairAssignments[i]; |
| | | String berthKey = "" + (berthNumber + 1); |
| | | List<DsTaskList2> shipsOnBerth = resultList.computeIfAbsent(berthKey, k -> new ArrayList<>()); |
| | | List<DsTaskList2> pair = shipPairs.get(i); |
| | | shipsOnBerth.addAll(pair); |
| | | } |
| | | |
| | | // è¾åºç»æ |
| | | JSONArray rootJSONArray = new JSONArray(); |
| | | if (resultList != null) { |
| | | Date firstStartDate = new Date(System.currentTimeMillis()); |
| | | Date lastEndDate = new Date(System.currentTimeMillis()); |
| | | Long totalAmmoD = 0L;//æ»å¯¼å¼¹æ° |
| | | Long totalAmmoP = 0L;//æ»ç®å¼¹æ° |
| | | Long totalAmmoS = 0L;//æ»é±¼æ°´é·æ° |
| | | Long totalAmmoO = 0L;//æ»å
¶ä»å¼¹è¯æ° |
| | | Double totalWater = 0.0;//æ»æ·¡æ°´æ° |
| | | Double totalWaterP = 0.0;//æ»çº¯æ°´æ° |
| | | Long totalFood = 0L;//æ»ä¸»å¯é£æ° |
| | | Long totalFoodW = 0L;//æ»æ¡¶è£
æ°´æ° |
| | | Long totalFoodO = 0L;//æ»å
¶ä»ç©èµæ° |
| | | |
| | | for (Map.Entry<String, List<DsTaskList2>> entry : resultList.entrySet()) { |
| | | JSONObject rootJSONObj = new JSONObject(); |
| | | JSONObject sub1JsonObj = new JSONObject(); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | log.debug("JTåå·åç»æ³ä½ " + entry.getKey() + " ä¸åé çè°è¹ï¼"); |
| | | sub1JsonObj.put("berthName", entry.getKey()); |
| | | |
| | | JSONArray subJSONArray = new JSONArray(); |
| | | for (int i = 0; i < dsTaskLists.size(); i++) { |
| | | DsTaskList2 ship = dsTaskLists.get(i); |
| | | // æ´æ°DsTaskListæ°æ®ä¸çæ³ä½ç¼å·ãæ³ä½åç§°ãå¹¶é çç¥åè¡¥ç»é¡ºåºå段 |
| | | DsTaskList2 updateDsTaskList = new DsTaskList2(); |
| | | updateDsTaskList.setPKID(ship.getPKID()); |
| | | DmBerth2 berthValue = dmBerthService.selectDmBerthByPKID(Long.parseLong(entry.getKey())); |
| | | updateDsTaskList.setBerthId(berthValue.getPKID()); |
| | | updateDsTaskList.setBerthName(berthValue.getNAME()); |
| | | updateDsTaskList.setParkingType(parkingType); |
| | | updateDsTaskList.setSupplySeq(String.valueOf(i+1)); |
| | | updateDsTaskList.setDeptId(deptId); |
| | | log.debug("Update DsTaskList2 PKID =====: " + ship.getPKID()); |
| | | log.debug("Update DsTaskList2 BerthId =====: " + berthValue.getPKID()); |
| | | log.debug("Update DsTaskList2 BerthName =====: " + berthValue.getNAME()); |
| | | log.debug("Update DsTaskList2 ParkingType =====: " + parkingType); |
| | | log.debug("Update DsTaskList2 SupplySeq =====: " + (i+1)); |
| | | int result = dsTaskListService.updateDsTaskList(updateDsTaskList); |
| | | log.debug("==================================: " + result); |
| | | |
| | | totalAmmoD += ship.getAmmoD() == null ? 0 : ship.getAmmoD(); |
| | | totalAmmoP += ship.getAmmoP() == null ? 0 : ship.getAmmoP(); |
| | | totalAmmoS += ship.getAmmoS() == null ? 0 : ship.getAmmoS(); |
| | | totalAmmoO += ship.getAmmoO() == null ? 0 : ship.getAmmoO(); |
| | | |
| | | totalWater += ship.getWATER() == null ? 0 : ship.getWATER(); |
| | | totalWaterP += ship.getWaterP() == null ? 0 : ship.getWaterP(); |
| | | totalFood += ship.getFOOD() == null ? 0 : ship.getFOOD(); |
| | | totalFoodW += ship.getFoodW() == null ? 0 : ship.getFoodW(); |
| | | totalFoodO += ship.getFoodO() == null ? 0 : ship.getFoodO(); |
| | | |
| | | Date startDate = ship.getpSTime(); //è®¡åæµæ¸¯æ¶é´ |
| | | Date endDate = ship.getpETime(); //计å离港æ¶é´ |
| | | if (firstStartDate.after(startDate)) { |
| | | firstStartDate = startDate; |
| | | } |
| | | if (lastEndDate.before(endDate)) { |
| | | lastEndDate = endDate; |
| | | } |
| | | log.debug(" - è¹åï¼" + ship.getShipNo() + "ï¼åå·ï¼" + ship.getShipType() + "ï¼åé æ¶é´ï¼" + (ship.getDockTime() == null ? 0 : ship.getDockTime()) + " åé"); |
| | | |
| | | // æå»ºJSON对象 |
| | | JSONObject tmpJsonObject = new JSONObject(); |
| | | tmpJsonObject.put("pkId", ship.getPKID()); |
| | | tmpJsonObject.put("taskId", ship.getTaskId()); |
| | | tmpJsonObject.put("shipNo", ship.getShipNo()); |
| | | tmpJsonObject.put("shipType", ship.getShipType()); |
| | | tmpJsonObject.put("tonnage", ship.getTONNAGE()); |
| | | Long level = ship.getLEVEL() == null ? 1L : ship.getLEVEL(); |
| | | if(level == 2L){//å
æ²¹åå¼¹ |
| | | tmpJsonObject.put("supplySeq", "å
æ²¹åå¼¹"); |
| | | }else if(level == 3L){//å
弹忲¹ |
| | | tmpJsonObject.put("supplySeq", "å
弹忲¹"); |
| | | }else{ |
| | | tmpJsonObject.put("supplySeq", "åæ¶ä½ä¸"); |
| | | } |
| | | tmpJsonObject.put("level", ship.getLEVEL()); |
| | | tmpJsonObject.put("oilB", ship.getOilB() == null ? 0 : ship.getOilB()); |
| | | tmpJsonObject.put("oilG", ship.getOilG() == null ? 0 : ship.getOilG()); |
| | | tmpJsonObject.put("oilA", ship.getOilA() == null ? 0 : ship.getOilA()); |
| | | tmpJsonObject.put("ammoD", ship.getAmmoD() == null ? 0 : ship.getAmmoD()); |
| | | tmpJsonObject.put("ammoP", ship.getAmmoP() == null ? 0 : ship.getAmmoP()); |
| | | tmpJsonObject.put("ammoS", ship.getAmmoS() == null ? 0 : ship.getAmmoS()); |
| | | tmpJsonObject.put("ammoO", ship.getAmmoO() == null ? 0 : ship.getAmmoO()); |
| | | tmpJsonObject.put("water", ship.getWATER() == null ? 0 : ship.getWATER()); |
| | | tmpJsonObject.put("waterP", ship.getWaterP() == null ? 0 : ship.getWaterP()); |
| | | tmpJsonObject.put("food", ship.getFOOD() == null ? 0 : ship.getFOOD()); |
| | | tmpJsonObject.put("foodW", ship.getFoodW() == null ? 0 : ship.getFoodW()); |
| | | tmpJsonObject.put("foodO", ship.getFoodO() == null ? 0 : ship.getFoodO()); |
| | | tmpJsonObject.put("pSTime", ship.getpSTime() == null ? 0 : ship.getpSTime()); |
| | | tmpJsonObject.put("pETime", ship.getpETime() == null ? 0 : ship.getpETime()); |
| | | subJSONArray.add(tmpJsonObject); |
| | | sub1JsonObj.put("subData", subJSONArray); |
| | | } |
| | | jsonArray.add(sub1JsonObj); |
| | | rootJSONObj.put("parkingType", parkingType); |
| | | rootJSONObj.put("dsTaskList", jsonArray); |
| | | rootJSONObj.put("totalAmmoD", totalAmmoD); |
| | | rootJSONObj.put("totalAmmoP", totalAmmoP); |
| | | rootJSONObj.put("totalAmmoS", totalAmmoS); |
| | | rootJSONObj.put("totalAmmoO", totalAmmoO); |
| | | rootJSONObj.put("totalWater", totalWater); |
| | | rootJSONObj.put("totalWaterP", totalWaterP); |
| | | rootJSONObj.put("totalFood", totalFood); |
| | | rootJSONObj.put("totalFoodW", totalFoodW); |
| | | rootJSONObj.put("totalFoodO", totalFoodO); |
| | | rootJSONObj.put("firstStartDate", format.format(firstStartDate)); |
| | | rootJSONObj.put("lastEndDate", format.format(lastEndDate)); |
| | | rootJSONArray.add(rootJSONObj); |
| | | } |
| | | } |
| | | log.debug("************************************************"); |
| | | return rootJSONArray; |
| | | } |
| | | |
| | | /** |
| | | * æDYä¼å
åç»ç®æ³ã |
| | | */ |
| | | private JSONArray calcZdBerthGroupByBullet(String parkingType, Long deptId, List<DmBerth2> berthList, List<DsTaskList2> dsTaskLists) { |
| | | // æå æ²¹éæ±ãè¹ç±»ååæµæ¸¯æ¶é´æåº |
| | | dsTaskLists.sort(Comparator.comparing(DsTaskList2::needRefueling).reversed() |
| | | .thenComparing(DsTaskList2::getShipType) |
| | | .thenComparing(DsTaskList2::getpSTime)); |
| | | |
| | | // æååå· 2 èä¸ç»åç» |
| | | List<List<DsTaskList2>> shipGroups = new ArrayList<>(); |
| | | Map<String, List<DsTaskList2>> typeMap = new HashMap<>(); |
| | | for (DsTaskList2 ship : dsTaskLists) { |
| | | String shipType = ship.getShipType(); |
| | | typeMap.computeIfAbsent(shipType, k -> new ArrayList<>()).add(ship); |
| | | } |
| | | for (List<DsTaskList2> shipsOfType : typeMap.values()) { |
| | | for (int i = 0; i < shipsOfType.size(); i += 2) { |
| | | if (i + 1 < shipsOfType.size()) { |
| | | // ç¡®ä¿ä¸ç»ä¸éè¦å æ²¹çè¹æå¨åé¢ |
| | | if (!shipsOfType.get(i).needRefueling() && shipsOfType.get(i + 1).needRefueling()) { |
| | | Collections.swap(shipsOfType, i, i + 1); |
| | | } |
| | | shipGroups.add(Arrays.asList(shipsOfType.get(i), shipsOfType.get(i + 1))); |
| | | } else { |
| | | // å¤çåèå©ä½çæ
åµ |
| | | shipGroups.add(Collections.singletonList(shipsOfType.get(i))); |
| | | } |
| | | } |
| | | } |
| | | log.debug("æå¼¹è¯ä¼å
åç»shipGroups =====: " + shipGroups); |
| | | |
| | | Date currentTime = null; |
| | | try { |
| | | currentTime = format.parse("2025-03-01 00:00:00"); |
| | | }catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | |
| | | // 对è°è¹ç»æåé ç»ææ¶é´æåº |
| | | shipGroups.sort(Comparator.comparing(group -> { |
| | | long maxEndTime = 0; |
| | | for (DsTaskList2 ship : group) { |
| | | maxEndTime = Math.max(maxEndTime, ship.getpETime().getTime()); |
| | | } |
| | | return maxEndTime; |
| | | })); |
| | | |
| | | // 模æåé è¿ç¨ |
| | | Map<DsTaskList2, DmBerth2> dockingMap = new HashMap<>(); |
| | | Map<DmBerth2, Date> berthAvailableTime = new HashMap<>(); |
| | | for (DmBerth2 berth : berthList) { |
| | | berthAvailableTime.put(berth, currentTime); |
| | | } |
| | | |
| | | for (List<DsTaskList2> group : shipGroups) { |
| | | DmBerth2 bestBerth = null; |
| | | Date earliestAvailableTime = null; |
| | | for (DmBerth2 berth : berthList) { |
| | | if (canDock(group, berth)) { |
| | | Date availableTime = berthAvailableTime.get(berth); |
| | | if (earliestAvailableTime == null || availableTime.before(earliestAvailableTime)) { |
| | | earliestAvailableTime = availableTime; |
| | | bestBerth = berth; |
| | | } |
| | | } |
| | | } |
| | | if (bestBerth != null) { |
| | | for (DsTaskList2 ship : group) { |
| | | dockingMap.put(ship, bestBerth); |
| | | } |
| | | long startTime = Math.max(group.get(0).getpSTime().getTime(), earliestAvailableTime.getTime()); |
| | | long endTime = 0; |
| | | for (DsTaskList2 ship : group) { |
| | | endTime = Math.max(endTime, ship.getpETime().getTime()); |
| | | } |
| | | berthAvailableTime.put(bestBerth, new Date(endTime)); |
| | | } |
| | | } |
| | | |
| | | // æ´çè¾åºç»æ |
| | | Map<DmBerth2, List<DsTaskList2>> berthShipMap = new LinkedHashMap<>(); |
| | | for (Map.Entry<DsTaskList2, DmBerth2> entry : dockingMap.entrySet()) { |
| | | DmBerth2 berth = entry.getValue(); |
| | | DsTaskList2 ship = entry.getKey(); |
| | | berthShipMap.computeIfAbsent(berth, k -> new ArrayList<>()).add(ship); |
| | | } |
| | | log.debug("berthShipMap ========: " + berthShipMap); |
| | | |
| | | //****** add BerthShipMap handle ********// |
| | | // å° LinkedHashMap çé®å¼å¯¹è½¬ç§»å° List ä¸ |
| | | List<Map.Entry<DmBerth2, List<DsTaskList2>>> list = new ArrayList<>(berthShipMap.entrySet()); |
| | | |
| | | // 对 List è¿è¡æåº |
| | | Collections.sort(list, new Comparator<Map.Entry<DmBerth2, List<DsTaskList2>>>() { |
| | | @Override |
| | | public int compare(Map.Entry<DmBerth2, List<DsTaskList2>> o1, Map.Entry<DmBerth2, List<DsTaskList2>> o2) { |
| | | return (int) (((o1.getKey().getHarborId() * 100) + o1.getKey().getOrderNum()) - ((o2.getKey().getHarborId() * 100) + o2.getKey().getOrderNum())); |
| | | } |
| | | }); |
| | | |
| | | // å°æåºåçé®å¼å¯¹åäºæ°ç LinkedHashMap ä¸ |
| | | LinkedHashMap<DmBerth2, List<DsTaskList2>> sortedMap = new LinkedHashMap<>(); |
| | | for (Map.Entry<DmBerth2, List<DsTaskList2>> entry : list) { |
| | | sortedMap.put(entry.getKey(), entry.getValue()); |
| | | } |
| | | //***************************************// |
| | | |
| | | |
| | | // æåç»è¾åºç»æ |
| | | /** |
| | | for (Map.Entry<DmBerth, List<DsTaskList>> entry : berthShipMap.entrySet()) { |
| | | DmBerth berth = entry.getKey(); |
| | | List<DsTaskList> shipsInBerth = entry.getValue(); |
| | | StringBuilder shipNos = new StringBuilder(); |
| | | String shipType = shipsInBerth.get(0).getShipType(); |
| | | for (int i = 0; i < shipsInBerth.size(); i++) { |
| | | if (i > 0) { |
| | | shipNos.append(" å "); |
| | | } |
| | | shipNos.append(shipsInBerth.get(i).getShipNo()); |
| | | } |
| | | System.out.println("è¹ " + shipNos + "ï¼åå· " + shipType + "ï¼åé 卿³ä½ " + berth.getNAME()); |
| | | } |
| | | */ |
| | | |
| | | JSONArray jsonObj = getJSONObject(parkingType, deptId, sortedMap); |
| | | return jsonObj; |
| | | } |
| | | |
| | | private static boolean canDock(List<DsTaskList2> group, DmBerth2 berth) { |
| | | for (DsTaskList2 ship : group) { |
| | | if (ship.getShipLen() > berth.getBerthLen()) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * æä¼å
顺åºåç»ç®æ³ã |
| | | */ |
| | | private JSONArray calcZdBerthGroupByOrder(String parkingType, Long deptId, List<DmBerth2> berthList, List<DsTaskList2> dsTaskLists) { |
| | | // æä¼å
级ãè¹ç±»ååæµæ¸¯æ¶é´æåº |
| | | dsTaskLists.sort(Comparator.comparing(DsTaskList2::getLEVEL).reversed() |
| | | .thenComparing(DsTaskList2::getShipType) |
| | | .thenComparing(DsTaskList2::getpSTime)); |
| | | JSONArray jsonObj = null; |
| | | try { |
| | | jsonObj = handleJtGroup(parkingType, deptId, berthList, dsTaskLists); |
| | | }catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return jsonObj; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®æ³ä½ä¸è°è¹å¹¶æåé æ°éï¼å¯¹æåºåçè°è¹è¿è¡åç»æä½ï¼è¿ååæ³ä½çè°è¹åé ç»æã |
| | | * |
| | | * @return |
| | | */ |
| | | private JSONArray handleJtGroup(String parkingType, Long deptId, List<DmBerth2> berthList, List<DsTaskList2> dsTaskLists) throws ParseException { |
| | | // é»è®¤æååå· 2 èä¸ç»åç» |
| | | List<List<DsTaskList2>> shipGroups = new ArrayList<>(); |
| | | Map<String, List<DsTaskList2>> typeMap = new HashMap<>(); |
| | | for (DsTaskList2 ship : dsTaskLists) { |
| | | String shipType = ship.getShipType(); |
| | | typeMap.computeIfAbsent(shipType, k -> new ArrayList<>()).add(ship); |
| | | } |
| | | for (List<DsTaskList2> shipsOfType : typeMap.values()) { |
| | | for (int i = 0; i < shipsOfType.size(); i += 2) { |
| | | if (i + 1 < shipsOfType.size()) { |
| | | // ç¡®ä¿ä¸ç»ä¸éè¦å æ²¹çè¹æå¨åé¢ |
| | | if (!shipsOfType.get(i).needRefueling() && shipsOfType.get(i + 1).needRefueling()) { |
| | | Collections.swap(shipsOfType, i, i + 1); |
| | | } |
| | | shipGroups.add(Arrays.asList(shipsOfType.get(i), shipsOfType.get(i + 1))); |
| | | } else { |
| | | // å¤çåèå©ä½çæ
åµ |
| | | shipGroups.add(Collections.singletonList(shipsOfType.get(i))); |
| | | } |
| | | } |
| | | } |
| | | System.out.println("shipGroups =====: " + shipGroups); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date currentTime = sdf.parse("2025-03-23 00:00:00"); |
| | | |
| | | // 对è°è¹ç»æåé ç»ææ¶é´æåº |
| | | shipGroups.sort(Comparator.comparing(group -> { |
| | | long maxEndTime = 0; |
| | | for (DsTaskList2 ship : group) { |
| | | maxEndTime = Math.max(maxEndTime, ship.getpETime().getTime()); |
| | | } |
| | | return maxEndTime; |
| | | })); |
| | | |
| | | // 模æåé è¿ç¨ |
| | | Map<DsTaskList2, DmBerth2> dockingMap = new HashMap<>(); |
| | | Map<DmBerth2, Date> berthAvailableTime = new HashMap<>(); |
| | | for (DmBerth2 berth : berthList) { |
| | | berthAvailableTime.put(berth, currentTime); |
| | | } |
| | | |
| | | for (List<DsTaskList2> group : shipGroups) { |
| | | DmBerth2 bestBerth = null; |
| | | Date earliestAvailableTime = null; |
| | | for (DmBerth2 berth : berthList) { |
| | | if (canDock(group, berth)) { |
| | | Date availableTime = berthAvailableTime.get(berth); |
| | | if (earliestAvailableTime == null || availableTime.before(earliestAvailableTime)) { |
| | | earliestAvailableTime = availableTime; |
| | | bestBerth = berth; |
| | | } |
| | | } |
| | | } |
| | | if (bestBerth != null) { |
| | | for (DsTaskList2 ship : group) { |
| | | dockingMap.put(ship, bestBerth); |
| | | } |
| | | long startTime = Math.max(group.get(0).getpSTime().getTime(), earliestAvailableTime.getTime()); |
| | | long endTime = 0; |
| | | for (DsTaskList2 ship : group) { |
| | | endTime = Math.max(endTime, ship.getpETime().getTime()); |
| | | } |
| | | berthAvailableTime.put(bestBerth, new Date(endTime)); |
| | | } |
| | | } |
| | | |
| | | // æ´çè¾åºç»æ |
| | | Map<DmBerth2, List<DsTaskList2>> berthShipMap = new HashMap<>(); |
| | | for (Map.Entry<DsTaskList2, DmBerth2> entry : dockingMap.entrySet()) { |
| | | DmBerth2 berth = entry.getValue(); |
| | | DsTaskList2 ship = entry.getKey(); |
| | | berthShipMap.computeIfAbsent(berth, k -> new ArrayList<>()).add(ship); |
| | | } |
| | | |
| | | // æåç»è¾åºç»æ |
| | | // for (Map.Entry<DmBerth2, List<DsTaskList2>> entry : berthShipMap.entrySet()) { |
| | | // DmBerth2 berth = entry.getKey(); |
| | | // List<DsTaskList2> shipsInBerth = entry.getValue(); |
| | | // StringBuilder shipNos = new StringBuilder(); |
| | | // String shipType = shipsInBerth.get(0).getShipType(); |
| | | // for (int i = 0; i < shipsInBerth.size(); i++) { |
| | | // if (i > 0) { |
| | | // shipNos.append(" å "); |
| | | // } |
| | | // shipNos.append(shipsInBerth.get(i).getShipNo()); |
| | | // } |
| | | // System.out.println("è¹ " + shipNos + "ï¼åå· " + shipType + "ï¼åé 卿³ä½ " + berth.getNAME()); |
| | | // } |
| | | |
| | | //****** add BerthShipMap handle ********// |
| | | // å° LinkedHashMap çé®å¼å¯¹è½¬ç§»å° List ä¸ |
| | | List<Map.Entry<DmBerth2, List<DsTaskList2>>> list = new ArrayList<>(berthShipMap.entrySet()); |
| | | |
| | | // 对 List è¿è¡æåº |
| | | Collections.sort(list, new Comparator<Map.Entry<DmBerth2, List<DsTaskList2>>>() { |
| | | @Override |
| | | public int compare(Map.Entry<DmBerth2, List<DsTaskList2>> o1, Map.Entry<DmBerth2, List<DsTaskList2>> o2) { |
| | | return o1.getKey().getPKID().compareTo(o2.getKey().getPKID()); |
| | | } |
| | | }); |
| | | |
| | | // å°æåºåçé®å¼å¯¹åäºæ°ç LinkedHashMap ä¸ |
| | | LinkedHashMap<DmBerth2, List<DsTaskList2>> sortedMap = new LinkedHashMap<>(); |
| | | for (Map.Entry<DmBerth2, List<DsTaskList2>> entry : list) { |
| | | sortedMap.put(entry.getKey(), entry.getValue()); |
| | | } |
| | | //***************************************// |
| | | JSONArray jsonObj = getJSONObject(parkingType, deptId, sortedMap); |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * æå»ºè°è¹åç»çJSON对象ã |
| | | * @param berthShipMap |
| | | * @return |
| | | */ |
| | | private JSONArray getJSONObject(String parkingType, Long deptId, LinkedHashMap<DmBerth2, List<DsTaskList2>> berthShipMap) { |
| | | JSONArray rootJSONArray = new JSONArray(); |
| | | if(berthShipMap != null) { |
| | | Long totalAmmoD = 0L;//æ»å¯¼å¼¹æ° |
| | | Long totalAmmoP = 0L;//æ»ç®å¼¹æ° |
| | | Long totalAmmoS = 0L;//æ»é±¼æ°´é·æ° |
| | | Long totalAmmoO = 0L;//æ»å
¶ä»å¼¹è¯æ° |
| | | Double totalWater = 0.0;//æ»æ·¡æ°´æ° |
| | | Double totalWaterP = 0.0;//æ»çº¯æ°´æ° |
| | | Long totalFood = 0L;//æ»ä¸»å¯é£æ° |
| | | Long totalFoodW = 0L;//æ»æ¡¶è£
æ°´æ° |
| | | Long totalFoodO = 0L;//æ»å
¶ä»ç©èµæ° |
| | | Date firstStartDate = new Date(System.currentTimeMillis()); |
| | | Date lastEndDate = new Date(System.currentTimeMillis()); |
| | | |
| | | for (Map.Entry<DmBerth2, List<DsTaskList2>> entry : berthShipMap.entrySet()) { |
| | | JSONObject rootJSONObj = new JSONObject(); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | JSONObject sub1JsonObj = new JSONObject(); |
| | | List<DsTaskList2> dsTaskLists = entry.getValue(); |
| | | DmBerth2 berthValue = entry.getKey(); |
| | | String berthName = berthValue.getNAME(); |
| | | Long berthId = berthValue.getPKID(); |
| | | Long harborId = berthValue.getHarborId(); |
| | | String harborName = berthValue.getHarborName(); |
| | | sub1JsonObj.put("harborId", harborId); |
| | | sub1JsonObj.put("harborName", harborName); |
| | | sub1JsonObj.put("berthId", berthId); |
| | | sub1JsonObj.put("berthName", berthName); |
| | | |
| | | // è¾åºç»æ |
| | | if (dsTaskLists != null) { |
| | | JSONArray subJSONArray = new JSONArray(); |
| | | for (int i = 0; i < dsTaskLists.size(); i++) { |
| | | DsTaskList2 ship = dsTaskLists.get(i); |
| | | // æ´æ°DsTaskListæ°æ®ä¸çæ³ä½ç¼å·ãæ³ä½åç§°ãå¹¶é çç¥åè¡¥ç»é¡ºåºå段 |
| | | DsTaskList2 updateDsTaskList = new DsTaskList2(); |
| | | updateDsTaskList.setPKID(ship.getPKID()); |
| | | updateDsTaskList.setBerthId(berthValue.getPKID()); |
| | | updateDsTaskList.setBerthName(berthValue.getNAME()); |
| | | updateDsTaskList.setParkingType(parkingType); |
| | | updateDsTaskList.setSupplySeq(String.valueOf(i+1)); |
| | | updateDsTaskList.setDeptId(deptId); |
| | | log.debug("Update DsTaskList2 PKID =====: " + ship.getPKID()); |
| | | log.debug("Update DsTaskList2 BerthId =====: " + berthValue.getPKID()); |
| | | log.debug("Update DsTaskList2 BerthName =====: " + berthValue.getNAME()); |
| | | log.debug("Update DsTaskList2 ParkingType =====: " + parkingType); |
| | | log.debug("Update DsTaskList2 SupplySeq =====: " + (i+1)); |
| | | int result = dsTaskListService.updateDsTaskList(updateDsTaskList); |
| | | log.debug("==================================: " + result); |
| | | |
| | | totalAmmoD += ship.getAmmoD() == null ? 0 : ship.getAmmoO(); |
| | | totalAmmoP += ship.getAmmoP() == null ? 0 : ship.getAmmoP(); |
| | | totalAmmoS += ship.getAmmoS() == null ? 0 : ship.getAmmoS(); |
| | | totalAmmoO += ship.getAmmoO() == null ? 0 : ship.getAmmoO(); |
| | | |
| | | totalWater += ship.getWATER() == null ? 0 : ship.getWATER(); |
| | | totalWaterP += ship.getWaterP() == null ? 0 : ship.getWaterP(); |
| | | totalFood += ship.getFOOD() == null ? 0 : ship.getFOOD(); |
| | | totalFoodW += ship.getFoodW() == null ? 0 : ship.getFoodW(); |
| | | totalFoodO += ship.getFoodO() == null ? 0 : ship.getFoodW(); |
| | | |
| | | Date startDate = ship.getpSTime(); //è®¡åæµæ¸¯æ¶é´ |
| | | Date endDate = ship.getpETime(); //计å离港æ¶é´ |
| | | if (firstStartDate.after(startDate)) { |
| | | firstStartDate = startDate; |
| | | } |
| | | if (lastEndDate.before(endDate)) { |
| | | lastEndDate = endDate; |
| | | } |
| | | |
| | | // æå»ºJSON对象 |
| | | JSONObject tmpJsonObject = new JSONObject(); |
| | | tmpJsonObject.put("pkId", ship.getPKID()); |
| | | tmpJsonObject.put("taskId", ship.getTaskId()); |
| | | tmpJsonObject.put("shipNo", ship.getShipNo()); |
| | | tmpJsonObject.put("shipType", ship.getShipType()); |
| | | tmpJsonObject.put("tonnage", ship.getTONNAGE() == null ? 0 : ship.getTONNAGE()); |
| | | Long level = ship.getLEVEL() == null ? 1L : ship.getLEVEL(); |
| | | if(level == 2L){//å
æ²¹åå¼¹ |
| | | tmpJsonObject.put("supplySeq", "å
æ²¹åå¼¹"); |
| | | }else if(level == 3L){//å
弹忲¹ |
| | | tmpJsonObject.put("supplySeq", "å
弹忲¹"); |
| | | }else{ |
| | | tmpJsonObject.put("supplySeq", "åæ¶ä½ä¸"); |
| | | } |
| | | tmpJsonObject.put("level", ship.getLEVEL()); |
| | | tmpJsonObject.put("oilB", ship.getOilB() == null ? 0 : ship.getOilB()); |
| | | tmpJsonObject.put("oilG", ship.getOilG() == null ? 0 : ship.getOilG()); |
| | | tmpJsonObject.put("oilA", ship.getOilA() == null ? 0 : ship.getOilA()); |
| | | tmpJsonObject.put("ammoD", ship.getAmmoD() == null ? 0 : ship.getAmmoD()); |
| | | tmpJsonObject.put("ammoP", ship.getAmmoP() == null ? 0 : ship.getAmmoP()); |
| | | tmpJsonObject.put("ammoS", ship.getAmmoS() == null ? 0 : ship.getAmmoS()); |
| | | tmpJsonObject.put("ammoO", ship.getAmmoO() == null ? 0 : ship.getAmmoO()); |
| | | tmpJsonObject.put("water", ship.getWATER() == null ? 0 : ship.getWATER()); |
| | | tmpJsonObject.put("waterP", ship.getWaterP() == null ? 0 : ship.getWaterP()); |
| | | tmpJsonObject.put("food", ship.getFOOD() == null ? 0 : ship.getFOOD()); |
| | | tmpJsonObject.put("foodW", ship.getFoodW() == null ? 0 : ship.getFoodW()); |
| | | tmpJsonObject.put("foodO", ship.getFoodO() == null ? 0 : ship.getFoodO()); |
| | | tmpJsonObject.put("pSTime", ship.getpSTime()); |
| | | tmpJsonObject.put("pETime", ship.getpETime()); |
| | | subJSONArray.add(tmpJsonObject); |
| | | sub1JsonObj.put("subData", subJSONArray); |
| | | } |
| | | } |
| | | jsonArray.add(sub1JsonObj); |
| | | rootJSONObj.put("parkingType", parkingType); |
| | | rootJSONObj.put("dsTaskList", jsonArray); |
| | | rootJSONObj.put("totalAmmoD", totalAmmoD); |
| | | rootJSONObj.put("totalAmmoP", totalAmmoP); |
| | | rootJSONObj.put("totalAmmoS", totalAmmoS); |
| | | rootJSONObj.put("totalAmmoO", totalAmmoO); |
| | | rootJSONObj.put("totalWater", totalWater); |
| | | rootJSONObj.put("totalWaterP", totalWaterP); |
| | | rootJSONObj.put("totalFood", totalFood); |
| | | rootJSONObj.put("totalFoodW", totalFoodW); |
| | | rootJSONObj.put("totalFoodO", totalFoodO); |
| | | rootJSONObj.put("firstStartDate", format.format(firstStartDate)); |
| | | rootJSONObj.put("lastEndDate", format.format(lastEndDate)); |
| | | rootJSONArray.add(rootJSONObj); |
| | | } |
| | | } |
| | | log.debug("XXXXXX =====ï¼ " + rootJSONArray); |
| | | return rootJSONArray; |
| | | } |
| | | |
| | | /** |
| | | * æäººå·¥åç»ç®æ³ã |
| | | */ |
| | | private void calcZdBerthGroupByHandMove(List<DmBerth2> berthList, List<DsTaskList2> dsTaskLists) { |
| | | |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¯éç 头æ³ä½åç»æ°æ®ç»æã |
| | | * |
| | | * @return |
| | | */ |
| | | @Operation(description = "ä¿®æ¹è°è¹è¡¥ç»é¡ºåº") |
| | | @Log(title = "ä¿®æ¹è°è¹è¡¥ç»é¡ºåº", businessType = BusinessType.INSERT) |
| | | @PostMapping("/updatelevel") |
| | | @ResponseBody |
| | | public AjaxResult updateSupplyLevelBy(Long pkId, Long supplyLevel) { |
| | | DsTaskList2 dsTaskList2 = new DsTaskList2(); |
| | | dsTaskList2.setPKID(pkId); |
| | | dsTaskList2.setLEVEL(supplyLevel); |
| | | try { |
| | | int result = dsTaskListService.updateDsTaskList(dsTaskList2); |
| | | if (result > 0) { |
| | | return AjaxResult.success("PKID = [" + String.valueOf(pkId) + "]è®°å½è¡¥ç»é¡ºåºæ´æ°æå"); |
| | | } else { |
| | | return AjaxResult.success("æªæ¾å°ç¬¦åæ¡ä»¶çè®°å½è¿è¡æ´æ°"); |
| | | } |
| | | } catch (Exception ex) { |
| | | return AjaxResult.error("PKID = [" + String.valueOf(pkId) + "]è®°å½è¡¥ç»é¡ºåºæ´æ°å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | @Operation(description = "æ´æ°æ¯éåç»é¡ºåº") |
| | | @Log(title = "æ´æ°æ¯éåç»é¡ºåº", businessType = BusinessType.INSERT) |
| | | @PostMapping("/updategroupseq") |
| | | @ResponseBody |
| | | public AjaxResult updateShipGroupSeq(@RequestBody List<ShipGroupDTO> shipGroupDTOList){ |
| | | int flag = 0; |
| | | if(shipGroupDTOList != null && shipGroupDTOList.size() > 0){ |
| | | // è·åææçæ³ä½ä¿¡æ¯ |
| | | List<DmBerth2> berth2List = dmBerthService.selectDmBerthList(new DmBerth2()); |
| | | |
| | | for(ShipGroupDTO shipGroupDTO : shipGroupDTOList){ |
| | | // String parkingType = shipGroupDTO.getParkingType(); |
| | | List<TaskRecordList> taskRecordList = shipGroupDTO.getDsTaskList(); |
| | | Long berthId = taskRecordList.get(0).getBerthId(); |
| | | Long harborId = taskRecordList.get(0).getHarborId(); |
| | | List<Subdata> subDataList = taskRecordList.get(0).getSubData(); |
| | | if(subDataList!= null && subDataList.size() > 0){ |
| | | for(int i = 0; i < subDataList.size(); i++){ |
| | | Subdata subdata = subDataList.get(i); |
| | | Long pkId = subdata.getPkId(); |
| | | String supplySeq = subdata.getSupplySeq(); |
| | | if(supplySeq.equals("åæ¶ä½ä¸")){ |
| | | supplySeq = "1"; |
| | | } |
| | | else if(supplySeq.equals("å
æ²¹åå¼¹")){ |
| | | supplySeq = "2"; |
| | | }if(supplySeq.equals("å
弹忲¹")){ |
| | | supplySeq = "3"; |
| | | } |
| | | |
| | | // DsTaskList2 dsTaskList = new DsTaskList2(); |
| | | // dsTaskList.setPKID(pkId); |
| | | DsTaskList2 existDsTaskList = dsTaskListService.selectDsTaskListByPkid(pkId); |
| | | if(existDsTaskList != null){ |
| | | // Long tempBerthId = existDsTaskList.getBerthId(); |
| | | // Long tempHarborId = existDsTaskList.getHarborId(); |
| | | // String tempSupplySeq = existDsTaskList.getSupplySeq(); |
| | | // if(berthId != tempBerthId || harborId != tempHarborId){ |
| | | DsTaskList2 newDsTaskList = new DsTaskList2(); |
| | | newDsTaskList.setPKID(pkId); |
| | | newDsTaskList.setHarborId(harborId); |
| | | newDsTaskList.setBerthId(berthId); |
| | | newDsTaskList.setSupplySeq(supplySeq); |
| | | newDsTaskList.setPath(getBerthPathById(berth2List, berthId)); |
| | | int result = dsTaskListService.updateDsTaskList(newDsTaskList); |
| | | if(result > 0 || result == 0){ |
| | | flag += 1; |
| | | } |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(flag > 0){ |
| | | return AjaxResult.success("æ¯éåç»é¡ºåºæ´æ°æåï¼"); |
| | | }else{ |
| | | return AjaxResult.success("åç»é¡ºåºæ è°æ´ï¼"); |
| | | } |
| | | } |
| | | return AjaxResult.success("æ¯éåç»é¡ºåºæ²¡æååï¼æªæ´æ°ï¼"); |
| | | } |
| | | |
| | | // æ ¹æ®IDè·åæ³ä½è·¯å¾ä¿¡æ¯è¯¦æ
|
| | | private String getBerthPathById(List<DmBerth2> list, Long id){ |
| | | for(DmBerth2 berth2 : list){ |
| | | if(berth2.getPKID() == id){ |
| | | return berth2.getPath(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | |
| | | import com.ruoyi.buss.common.DateUtils; |
| | | import com.ruoyi.buss.common.NumberUtils; |
| | | import com.ruoyi.buss.domain.*; |
| | | import com.ruoyi.buss.domain.vo.TaskAssess; |
| | | import com.ruoyi.buss.service.*; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * æ¯éæè½è¯ä¼°é»è¾Controller |
| | | * |
| | | * @author yl |
| | | * @date 2025-03-20 |
| | | */ |
| | | |
| | | @Tag(name = "æ¯éæè½è¯ä¼°") |
| | | @Controller |
| | | @RequestMapping("/buss/zd/effect") |
| | | public class ZdEffectEstimateController extends BaseController { |
| | | private static final Logger log = LoggerFactory.getLogger(ZdEffectEstimateController.class); |
| | | |
| | | |
| | | private static DecimalFormat df = new DecimalFormat("#.00"); |
| | | private static DecimalFormat df2 = new DecimalFormat("#.0"); |
| | | |
| | | @Autowired |
| | | private IDsTaskList2Service dsTaskList2Service; |
| | | @Autowired |
| | | private IDmBerth2Service dmBerth2Service; |
| | | @Autowired |
| | | private ISysDictDataService sysDictDataService; |
| | | @Autowired |
| | | private IDsTaskDetailService iDsTaskDetailService; |
| | | @Autowired |
| | | private IDsEffectAssessService dsEffectAssessService; |
| | | @Autowired |
| | | private IDsEffectAssessListService dsEffectAssessListService; |
| | | @Autowired |
| | | private IDmHarbor2Service dmHarbor2Service; |
| | | |
| | | private final static double B11_VALUE = 24; // è°è¹å¹³å任塿¶é´ |
| | | |
| | | private final static int X_TOLERANCE_VALUE = 0; // è¹è¶æ°é |
| | | |
| | | private final static Double OIL_PLACE_PER = 0.3; |
| | | private final static Double MAT_PLACE_PER = 0.2; |
| | | private final static Double AMMO_PLACE_PER = 0.5; |
| | | |
| | | private final static int SUPPLY_X_TIME = 2; |
| | | |
| | | /** |
| | | * è®¡ç®æ¯éæè½è¯ä¼° |
| | | * @return |
| | | */ |
| | | @Operation(description = "æ¯éæè½è¯ä¼°è®¡ç®") |
| | | @Log(title = "æ¯éæè½è¯ä¼°è®¡ç®", businessType = BusinessType.INSERT) |
| | | @PostMapping("/estimate") |
| | | @ResponseBody |
| | | public AjaxResult estimate(@Parameter(name = "type", required = true, description = "è¯ä¼°ç±»å") String type, |
| | | @Parameter(name = "taskId", required = true, description = "ä»»å¡ID") Long taskId, |
| | | @Parameter(name = "deptId", required = true, description = "é¨é¨ID") Long deptId) { |
| | | DmHarbor2 dmHarbor2 = new DmHarbor2(); |
| | | dmHarbor2.setDeptId(deptId); |
| | | List<DmHarbor2> dmHarbor2List = dmHarbor2Service.selectDmHarborList(dmHarbor2); |
| | | String dmHarborPkIds = ""; |
| | | if (dmHarbor2List != null || dmHarbor2List.size() > 0) { |
| | | for (DmHarbor2 dmHarbor : dmHarbor2List){ |
| | | dmHarbor.getPKID(); |
| | | dmHarborPkIds += dmHarbor.getPKID() + ","; |
| | | } |
| | | dmHarborPkIds = dmHarborPkIds.substring(0, dmHarborPkIds.length() - 1); |
| | | dmHarborPkIds = "(" + dmHarborPkIds + ")"; |
| | | } |
| | | |
| | | DsEffectAssessList assess = new DsEffectAssessList(); |
| | | assess.setTYPE(type); |
| | | List<DsEffectAssessList> dsEffectAssessLists = dsEffectAssessListService.selectDsEffectAssessListList(assess); |
| | | List<DsTaskDetail> dsTaskDetailList = iDsTaskDetailService.selectDsTaskDetailByTaskIdAndHarborIds(taskId, dmHarborPkIds); |
| | | if (dsEffectAssessLists != null && dsEffectAssessLists.size() > 0) { |
| | | for(int i = 0; i < dsEffectAssessLists.size(); i++){ |
| | | DsEffectAssessList dsEffectAssessList = dsEffectAssessLists.get(i); |
| | | log.debug("ã" + dsEffectAssessList.getCODE() + "ã DsEffectAssessList Obj =====: " + dsEffectAssessList); |
| | | String code = dsEffectAssessList.getCODE(); |
| | | double weights = dsEffectAssessList.getWEIGHT(); |
| | | double classifyWeight = dsEffectAssessList.getClassifyWeight(); |
| | | |
| | | double itemResult = calcNormItemResult(code, weights, dsTaskDetailList); |
| | | DsEffectAssessList asscessList = new DsEffectAssessList(); |
| | | asscessList.setPKID(dsEffectAssessList.getPKID()); |
| | | asscessList.setVal(itemResult); |
| | | dsEffectAssessListService.updateDsEffectAssessList(asscessList); |
| | | } |
| | | } |
| | | |
| | | // è®¡ç®æç»è¯ä¼°ç»æ |
| | | List<DsEffectAssessList> dsEffectAssessLists2 = dsEffectAssessListService.selectDsEffectAssessListList(assess); |
| | | double score = getScore(dsEffectAssessLists2); |
| | | log.debug("Score =====ï¼ " + score); |
| | | DsEffectAssess dsEffectAssess = new DsEffectAssess(taskId, score); |
| | | dsEffectAssess.setCreateTime(new Date()); |
| | | dsEffectAssess.setCreateBy(getUsername()); |
| | | dsEffectAssess.setDeptId(getDeptId()); |
| | | // ä¿åè¯ä¼°ç»æ |
| | | dsEffectAssessService.updateOrInsertDsEffectAssess(dsEffectAssess); |
| | | log.debug("å®ææ´æ°/æ°å¢Accessè®°å½ã"); |
| | | |
| | | TaskAssess taskAssess = new TaskAssess(); |
| | | taskAssess.setList(dsEffectAssessLists); |
| | | taskAssess.setAssess(dsEffectAssess); |
| | | if(null != dsEffectAssessLists){ |
| | | return success(taskAssess); |
| | | } |
| | | return error("è·åè½æè¯ä¼°è¯¦æ
失败ï¼è¯·éè¯"); |
| | | } |
| | | |
| | | private double calcNormItemResult(String code, double weights, List<DsTaskDetail> dsTaskDetailList) { |
| | | int result = 0; |
| | | if ("B11".equals(code)) { |
| | | // ç¬ç«åèææ ä¸åä¸å æè®¡ç® |
| | | } else if ("B12".equals(code)) { |
| | | result = calcB12(dsTaskDetailList); |
| | | } else if ("B13".equals(code)) { |
| | | result = calcB13(dsTaskDetailList); |
| | | } else if ("B14".equals(code)) { |
| | | result = calcB14(dsTaskDetailList); |
| | | } else if ("B15".equals(code)) { |
| | | result = calcB15(dsTaskDetailList); |
| | | } else if ("B16".equals(code)) { |
| | | result = calcB16(dsTaskDetailList); |
| | | } else if ("B17".equals(code)) { |
| | | result = calcB17(dsTaskDetailList); |
| | | } else if ("B21".equals(code)) { |
| | | result = calcB21(dsTaskDetailList); |
| | | } else if ("B22".equals(code)) { |
| | | result = calcB22(dsTaskDetailList); |
| | | } else if ("B23".equals(code)) { |
| | | result = calcB23(dsTaskDetailList); |
| | | } else if ("B24".equals(code)) { |
| | | result = calcB24(dsTaskDetailList); |
| | | } else if ("B25".equals(code)) { |
| | | result = calcB25(dsTaskDetailList); |
| | | } else if ("B31".equals(code)) { |
| | | // ç¬ç«åèææ ä¸åä¸å æè®¡ç® |
| | | } else if ("B32".equals(code)) { |
| | | result = calcB32(dsTaskDetailList); |
| | | } else if ("B33".equals(code)) { |
| | | // ç¬ç«åèææ ä¸åä¸å æè®¡ç® |
| | | } else if ("B34".equals(code)) { |
| | | result = calcB34(dsTaskDetailList); |
| | | } else if ("B35".equals(code)) { |
| | | // ç¬ç«åèææ ä¸åä¸å æè®¡ç® |
| | | } else if ("B36".equals(code)) { |
| | | result = calcB36(dsTaskDetailList); |
| | | } else if ("B41".equals(code)) { |
| | | result = calcB41(dsTaskDetailList); |
| | | } else if ("B42".equals(code)) { |
| | | result = calcB42(dsTaskDetailList); |
| | | } else if ("B43".equals(code)) { |
| | | result = calcB43(dsTaskDetailList); |
| | | } else if ("B44".equals(code)) { |
| | | result = calcB44(dsTaskDetailList); |
| | | } else if ("B45".equals(code)) { |
| | | result = calcB45(dsTaskDetailList); |
| | | } |
| | | log.debug("ã" + code + "ãæéå¼ ===ï¼" + weights); |
| | | log.debug("ã" + code + "ã计ç®ç»æ ===ï¼" + result); |
| | | log.debug("ã" + code + "ãå æå¼ ===ï¼" + result * weights); |
| | | return result * weights; |
| | | } |
| | | |
| | | // è®¡ç®æç»åæ° |
| | | private Double getScore(List<DsEffectAssessList> list){ |
| | | Double score = 0.0; |
| | | if(null != list && list.size() > 0){ |
| | | Map<String, List<DsEffectAssessList>> groupedByCode = list.stream() |
| | | .collect(Collectors.groupingBy(item -> item.getCODE().substring(0, 2))); |
| | | |
| | | for (Map.Entry<String, List<DsEffectAssessList>> berthEntry : groupedByCode.entrySet()) { |
| | | DsEffectAssessList effectAssess = berthEntry.getValue().get(0); |
| | | Double classifyWeight = null == effectAssess.getClassifyWeight()?0.0:effectAssess.getClassifyWeight(); |
| | | |
| | | Double totalValue = berthEntry.getValue().stream() |
| | | .mapToDouble(item -> item.getVal() * item.getWEIGHT()) |
| | | .sum(); |
| | | score += totalValue * classifyWeight; |
| | | } |
| | | } |
| | | return NumberUtils.roundToTwoDecimalPlaces(score); |
| | | } |
| | | |
| | | /** |
| | | * B12ï¼è°è¹å¹³å任塿¶é´ï¼æ¬æ¸¯ä»Tæ¶å»èµ·ç®ï¼ææè°è¹ä»çå¾
å°å®æè¡¥ç»ç平忶é´ã |
| | | * å
¬å¼ï¼10*(该åå§ææ /B11)ãæ³¨ï¼è®¡ç®çæ¯è°è¹å¹³åè¡¥ç»æ¶é´ä¸å¹³å任塿¶é´çæ¯ä¾ï¼è¯¥å¼è¶å¤§è¶å¥½ |
| | | * @return |
| | | */ |
| | | private int calcB12(List<DsTaskDetail> dsTaskDetails) { |
| | | double result = 0; |
| | | if (dsTaskDetails != null && dsTaskDetails.size() > 0) { |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail1 = dsTaskDetails.get(i); |
| | | int oilTime = dsTaskDetail1.getOilTime(); |
| | | int matTime = dsTaskDetail1.getMatTime(); |
| | | int ammoTime = dsTaskDetail1.getAmmoTime(); |
| | | int waterTime = dsTaskDetail1.getWaterTime(); |
| | | // result += DateUtils.getDisHourOfTowDate(tTime,eTime1); |
| | | result += oilTime + matTime + ammoTime + waterTime; |
| | | } |
| | | } |
| | | double temp = (result / dsTaskDetails.size() / B11_VALUE) > 1 ? 1 : (result / dsTaskDetails.size() / B11_VALUE); |
| | | log.debug("B12 Value =====ï¼" + (10 * Double.parseDouble(df2.format(temp)))); |
| | | return (int) (10 * Double.parseDouble(df2.format(temp))); |
| | | } |
| | | |
| | | /** |
| | | * B13ï¼è°è¹å¹³åçå¾
æ¶é´ï¼æ¬æ¸¯ä»Tæ¶å»èµ·ç®ï¼åç»ææè°è¹çå¾
æ¶é´åå¼ã |
| | | * å
¬å¼ï¼10*(1-该åå§ææ /B11)ãæ³¨ï¼è®¡ç®çæ¯è°è¹å¹³åçå¾
æ¶é´ä¸å¹³å任塿¶é´çæ¯ä¾ï¼çå¾
æ¶é´è¶å°è¶å¥½ï¼æä»¥æç®ææ ç¨1åå»è¯¥å¼ |
| | | * @return |
| | | */ |
| | | private int calcB13(List<DsTaskDetail> dsTaskDetails){ |
| | | // æå æ²¹éæ±ãè¹ç±»ååæµæ¸¯æ¶é´æåº |
| | | dsTaskDetails.sort(Comparator.comparing(DsTaskDetail::getBerthId).thenComparing(DsTaskDetail::getSupplySeq)); |
| | | |
| | | // ææ³ä½å·è¿è¡åç» |
| | | Map<Long, List<DsTaskDetail>> detailMap = new HashMap<>(); |
| | | for (DsTaskDetail detail : dsTaskDetails) { |
| | | Long berthId = detail.getBerthId(); |
| | | detailMap.computeIfAbsent(berthId, k -> new ArrayList<>()).add(detail); |
| | | } |
| | | double waitTime = 0.0; |
| | | for (List<DsTaskDetail> groupDsTaskDetails : detailMap.values()) { |
| | | Date startTDate = null; |
| | | for (int i = 0; i < groupDsTaskDetails.size(); i++) { |
| | | DsTaskDetail detail = groupDsTaskDetails.get(i); |
| | | if (i == 0) { |
| | | startTDate = detail.getT1(); |
| | | } |
| | | Date sTime = detail.getSTIME(); |
| | | waitTime += DateUtils.getDisHourOfTowDate(startTDate, sTime); |
| | | } |
| | | } |
| | | double temp = (waitTime / B11_VALUE) > 1 ? 1 : (waitTime / B11_VALUE); |
| | | log.debug("B13 Value =====ï¼" + (10 * (1 - Double.parseDouble(df2.format(temp))))); |
| | | return (int) (10 * (1 - Double.parseDouble(df2.format(temp)))); |
| | | } |
| | | |
| | | /** |
| | | * B14ï¼åè°æå è¡¥ç»æ¶é´ï¼æ¬æ¸¯è¡¥ç»èµ·æ¢æ¶é´å·®/è°èæ°éã |
| | | * 24å°æ¶ä»¥ä¸0åï¼18-24å°æ¶2åï¼12-18å°æ¶4åï¼8-12å°æ¶6åï¼4-8å°æ¶8åï¼4å°æ¶ä»¥ä¸10å |
| | | * @return |
| | | */ |
| | | private int calcB14(List<DsTaskDetail> dsTaskDetails){ |
| | | double result = 0; |
| | | if (dsTaskDetails != null && dsTaskDetails.size() > 0) { |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail = dsTaskDetails.get(i); |
| | | // Date sTime1 = dsTaskDetail.getSTIME(); |
| | | int oilTime = dsTaskDetail.getOilTime(); |
| | | int matTime = dsTaskDetail.getMatTime(); |
| | | int ammoTime = dsTaskDetail.getAmmoTime(); |
| | | int waterTime = dsTaskDetail.getWaterTime(); |
| | | result += oilTime + matTime + ammoTime + waterTime; |
| | | // result += DateUtils.getDisHourOfTowDate(sTime1, eTime1); |
| | | } |
| | | double point = result / (dsTaskDetails.size()); |
| | | log.debug("B14 Value =====ï¼" + point); |
| | | if(point >= 24){ |
| | | return 0; |
| | | }else if(point > 18 && point <= 24){ |
| | | return 2; |
| | | }else if(point > 12 && point <= 18){ |
| | | return 4; |
| | | }else if(point > 8 && point <= 12){ |
| | | return 6; |
| | | }else if(point > 4 && point <= 8){ |
| | | return 8; |
| | | }else if(point <= 4){ |
| | | return 10; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * B15ï¼è°è¹åæ¶è¡¥ç»æ°éï¼æ¬æ¸¯æ ¹æ®æ³ä½æ°åå¹¶é çç¥ï¼è®¡ç®å¯åæ¶è¡¥ç»çè°è¹æ°ã |
| | | * 10*åå§ææ /ï¼2*æ»æ³ä½æ°ï¼ï¼æ³¨ï¼ææ¬æ¸¯æææ³ä½å¯ç¨ä¸åè°å¹¶é 为åèæ°ï¼å¤§äº10æ¶å10 |
| | | * @return |
| | | */ |
| | | private int calcB15(List<DsTaskDetail> dsTaskDetails){ |
| | | int berthCount = getBerthCountOfHarbor(); |
| | | |
| | | if (dsTaskDetails != null && dsTaskDetails.size() > 0) { |
| | | String parkingType = dsTaskDetails.get(0).getParkingType(); |
| | | if ("1".equals(parkingType)) { |
| | | if (dsTaskDetails.size() >= berthCount) { |
| | | return berthCount; |
| | | } else if (dsTaskDetails.size() < berthCount) { |
| | | return dsTaskDetails.size(); |
| | | } |
| | | } else if ("2".equals(parkingType)) { |
| | | if (dsTaskDetails.size() / 2 >= berthCount) { |
| | | return berthCount * 2; |
| | | } else if (dsTaskDetails.size() / 2 < berthCount) { |
| | | if (dsTaskDetails.size() % 2 == 0) { |
| | | return dsTaskDetails.size() / 2; |
| | | } else { |
| | | return (dsTaskDetails.size() / 2) + 1; |
| | | } |
| | | } |
| | | } else if ("3".equals(parkingType)) { |
| | | if (dsTaskDetails.size() / 3 >= berthCount) { |
| | | return berthCount * 3; |
| | | } else if (dsTaskDetails.size() / 3 < berthCount) { |
| | | if (dsTaskDetails.size() % 3 == 0) { |
| | | return dsTaskDetails.size() / 3; |
| | | } else { |
| | | return (dsTaskDetails.size() / 3) + 1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * B16ï¼åæ³ä½ç»ææ¶é´æå¤§å·®ï¼æ¬æ¸¯åæ³ä½è¡¥ç»ä½ä¸æç»ç»ææ¶é´æå¤§å·®å¼ã |
| | | * 24å°æ¶ä»¥ä¸0åï¼16-24å°æ¶2åï¼12-16å°æ¶4åï¼8-12å°æ¶6åï¼4-8å°æ¶8åï¼4å°æ¶ä»¥å
10å |
| | | * @return |
| | | */ |
| | | private int calcB16(List<DsTaskDetail> dsTaskDetails){ |
| | | List<Date> eTimeList = new ArrayList<>(); |
| | | if(dsTaskDetails != null && dsTaskDetails.size() > 0){ |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail1 = dsTaskDetails.get(i); |
| | | Date sTime = dsTaskDetail1.getSTIME(); |
| | | int oilTime = dsTaskDetail1.getOilTime(); |
| | | int matTime = dsTaskDetail1.getMatTime(); |
| | | int ammoTime = dsTaskDetail1.getAmmoTime(); |
| | | int waterTime = dsTaskDetail1.getWaterTime(); |
| | | int result = oilTime + matTime + ammoTime + waterTime; |
| | | Date eTime = DateUtils.getDateAfterHours(sTime, result); |
| | | eTimeList.add(eTime); |
| | | } |
| | | // è·åæå°æ¶é´ |
| | | Date minDate = Collections.min(eTimeList); |
| | | // è·åæå¤§æ¶é´ |
| | | Date maxDate = Collections.max(eTimeList); |
| | | // è®¡ç®æ¶é´å·® |
| | | double dateInterval = DateUtils.getDisHourOfTowDate(minDate, maxDate); |
| | | log.debug("B16 Value =====ï¼" + dateInterval); |
| | | if(dateInterval >= 24){ |
| | | return 0; |
| | | }else if(dateInterval >= 16 && dateInterval < 24){ |
| | | return 2; |
| | | }else if(dateInterval >= 12 && dateInterval < 16){ |
| | | return 4; |
| | | }else if (dateInterval >= 8 && dateInterval < 12){ |
| | | return 6; |
| | | }else if (dateInterval >= 4 && dateInterval < 8){ |
| | | return 8; |
| | | }else if (dateInterval < 4){ |
| | | return 10; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * B17ï¼è¡¥ç»å®¹å·®å æ¯åå¼ï¼æ¬æ¸¯åè°å®¹å·®Xç¸å¯¹äºè¡¥ç»æ¶é´A2æå æ¯ä¾çå¹³åå¼ã |
| | | * 10*(1-该åå§ææ å¼) |
| | | * @return |
| | | */ |
| | | private int calcB17(List<DsTaskDetail> dsTaskDetails) { |
| | | double allValue = 0.0; |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail detail = dsTaskDetails.get(i); |
| | | int oilTime = detail.getOilTime(); |
| | | int ammoTime = detail.getAmmoTime(); |
| | | int matTime = detail.getMatTime(); |
| | | int waterTime = detail.getWaterTime(); |
| | | int totalTime = oilTime + ammoTime + matTime + waterTime; |
| | | allValue += (double) totalTime / SUPPLY_X_TIME; |
| | | } |
| | | double avg = allValue / dsTaskDetails.size() > 1 ? 1 : allValue / dsTaskDetails.size(); |
| | | log.debug("B17 Value =====ï¼" + (10 * (1 - Double.parseDouble(df2.format(avg))))); |
| | | return (int) (10 * (1 - Double.parseDouble(df2.format(avg)))); |
| | | } |
| | | |
| | | /** |
| | | * B21ï¼åè°å¹³ååé æ¶é´ï¼æ¬æ¸¯åè°èä»Tæ¶å»å°T+Xè¡¥ç»ç»æçå¹³åå¼ã |
| | | * 48å°æ¶ä»¥ä¸4åï¼36-48å°æ¶6åï¼24-30å°æ¶8åï¼18-24å°æ¶10åï¼12-18å°æ¶8åï¼12å°æ¶ä»¥ä¸6åï¼ä»¥24å°æ¶ä¸ºä¸å¿çæ£æåå¸ã |
| | | * @return |
| | | */ |
| | | private int calcB21(List<DsTaskDetail> dsTaskDetails) { |
| | | double dateInterval = 0; |
| | | if (dsTaskDetails != null && dsTaskDetails.size() > 0) { |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail1 = dsTaskDetails.get(i); |
| | | Date tTime = dsTaskDetail1.getT1(); |
| | | int oilTime = dsTaskDetail1.getOilTime(); |
| | | int ammoTime = dsTaskDetail1.getAmmoTime(); |
| | | int matTime = dsTaskDetail1.getMatTime(); |
| | | int waterTime = dsTaskDetail1.getWaterTime(); |
| | | int totalTime = oilTime + ammoTime + matTime + waterTime; |
| | | dateInterval += totalTime + 1; |
| | | } |
| | | double avg = dateInterval / dsTaskDetails.size(); |
| | | log.debug("B21 Value =====ï¼" + avg); |
| | | if (avg >= 48) { |
| | | return 4; |
| | | } else if (avg >= 36 && avg < 48) { |
| | | return 6; |
| | | } else if (avg >= 24 && avg < 30) { |
| | | return 8; |
| | | } else if (avg >= 18 && avg < 24) { |
| | | return 10; |
| | | } else if (avg >= 12 && avg < 18) { |
| | | return 8; |
| | | } else if (avg < 12) { |
| | | return 6; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * B22ï¼è¡¥ç»ä½ä¸æ¶é´åå¼ï¼åè°è主线补ç»ä½ä¸æ¶é´çå¹³åå¼ã |
| | | * 36å°æ¶ä»¥ä¸4åï¼24-36å°æ¶6åï¼20-24å°æ¶8åï¼16-20å°æ¶10åï¼12-16å°æ¶8åï¼8å°æ¶ä»¥ä¸6åï¼ä»¥18å°æ¶ä¸ºä¸å¿çæ£æåå¸ã |
| | | * @return |
| | | */ |
| | | private int calcB22(List<DsTaskDetail> dsTaskDetails){ |
| | | double dateInterval = 0; |
| | | if (dsTaskDetails != null && dsTaskDetails.size() > 0) { |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail1 = dsTaskDetails.get(i); |
| | | Date sTime = dsTaskDetail1.getSTIME(); |
| | | int oilTime = dsTaskDetail1.getOilTime(); |
| | | int matTime = dsTaskDetail1.getMatTime(); |
| | | int ammoTime = dsTaskDetail1.getAmmoTime(); |
| | | int waterTime = dsTaskDetail1.getWaterTime(); |
| | | int result = oilTime + matTime + ammoTime + waterTime; |
| | | dateInterval += result - X_TOLERANCE_VALUE; |
| | | } |
| | | double avg = dateInterval / dsTaskDetails.size(); |
| | | log.debug("B22 Value =====ï¼" + avg); |
| | | if(avg >= 36){ |
| | | return 4; |
| | | }else if(avg >= 24 && avg < 36){ |
| | | return 6; |
| | | }else if(avg >= 20 && avg < 24){ |
| | | return 8; |
| | | }else if (avg >= 16 && avg < 20){ |
| | | return 10; |
| | | }else if (avg >= 12 && avg < 16){ |
| | | return 8; |
| | | }else if (avg < 8){ |
| | | return 6; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * B23ï¼è¡¥ç»éä½ä¸æ¶é´åå¼ï¼ï¼åè°èåæ³æ¶é´-ä½ä¸æ¶é´ï¼çå¹³åå¼ã |
| | | * 24å°æ¶ä»¥ä¸0åï¼16-24å°æ¶2åï¼12-16å°æ¶4åï¼8-12å°æ¶6åï¼4-8å°æ¶8åï¼4å°æ¶ä»¥å
10åã该å¼è¶å°è¶å¥½ï¼ä½ä¹ä¸å¯è½ä¸º0ï¼æä»¥4å°æ¶ä»¥ä¸å为æå¥½ã |
| | | * @return |
| | | */ |
| | | private int calcB23(List<DsTaskDetail> dsTaskDetails){ |
| | | double allTime = 0; |
| | | if (dsTaskDetails != null && dsTaskDetails.size() > 0) { |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail1 = dsTaskDetails.get(i); |
| | | int oilTime = dsTaskDetail1.getOilTime(); |
| | | int ammoTime = dsTaskDetail1.getAmmoTime(); |
| | | int matTime = dsTaskDetail1.getMatTime(); |
| | | int waterTime = dsTaskDetail1.getWaterTime(); |
| | | int totalTime = oilTime + ammoTime + matTime + waterTime; |
| | | |
| | | //int elecSTime = dsTaskDetail1.getElecStime(); |
| | | //int elecETime = dsTaskDetail1.getElecEtime(); |
| | | |
| | | int waterSTime = dsTaskDetail1.getWaterStime(); |
| | | int waterETime = dsTaskDetail1.getWaterEtime(); |
| | | |
| | | int oilSTime = dsTaskDetail1.getOilStime(); |
| | | int oilETime = dsTaskDetail1.getOilEtime(); |
| | | |
| | | int ammoSTime = dsTaskDetail1.getAmmoStime(); |
| | | int ammoETime = dsTaskDetail1.getAmmoEtime(); |
| | | |
| | | int matSTime = dsTaskDetail1.getMatStime(); |
| | | int matETime = dsTaskDetail1.getMatEtime(); |
| | | |
| | | int workTime = (waterETime - waterSTime) + (oilETime - oilSTime) + (ammoETime - ammoSTime) + (matETime - matSTime); |
| | | |
| | | allTime += Math.abs(totalTime + 1 - workTime); |
| | | } |
| | | double avg = allTime / dsTaskDetails.size(); |
| | | log.debug("B23 Value =====ï¼" + avg); |
| | | if(avg >= 24){ |
| | | return 0; |
| | | }else if(avg >= 16 && avg < 24){ |
| | | return 2; |
| | | }else if(avg >= 12 && avg < 16){ |
| | | return 4; |
| | | }else if (avg >= 8 && avg < 12){ |
| | | return 6; |
| | | }else if (avg >= 4 && avg < 8){ |
| | | return 8; |
| | | }else if (avg < 4){ |
| | | return 10; |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * B24ï¼è¡¥ç»ä½ä¸åæ³æ¯ä¾ï¼åè°ç´¯è®¡è¡¥ç»æ¶é´æ»å/ç´¯è®¡é æ³æ¶é´æ»å |
| | | * 10*该åå§ææ å¼ã |
| | | * @return |
| | | */ |
| | | private int calcB24(List<DsTaskDetail> dsTaskDetails) { |
| | | double allBerthTime = 0; |
| | | double allWorkTime = 0; |
| | | if (dsTaskDetails != null && dsTaskDetails.size() > 0) { |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail1 = dsTaskDetails.get(i); |
| | | int oilTime = dsTaskDetail1.getOilTime(); |
| | | int ammoTime = dsTaskDetail1.getAmmoTime(); |
| | | int matTime = dsTaskDetail1.getMatTime(); |
| | | int waterTime = dsTaskDetail1.getWaterTime(); |
| | | int totalTime = oilTime + ammoTime + matTime + waterTime; |
| | | |
| | | int waterSTime = dsTaskDetail1.getWaterStime(); |
| | | int waterETime = dsTaskDetail1.getWaterEtime(); |
| | | |
| | | int oilSTime = dsTaskDetail1.getOilStime(); |
| | | int oilETime = dsTaskDetail1.getOilEtime(); |
| | | |
| | | int ammoSTime = dsTaskDetail1.getAmmoStime(); |
| | | int ammoETime = dsTaskDetail1.getAmmoEtime(); |
| | | |
| | | int matSTime = dsTaskDetail1.getMatStime(); |
| | | int matETime = dsTaskDetail1.getMatEtime(); |
| | | |
| | | allWorkTime += (waterETime - waterSTime) + (oilETime - oilSTime) + (ammoETime - ammoSTime) + (matETime - matSTime); |
| | | allBerthTime += Math.abs(totalTime); |
| | | } |
| | | double temp = allWorkTime / allBerthTime > 1 ? 1 : allWorkTime / allBerthTime; |
| | | log.debug("B24 Value =====ï¼" + (10 * (Double.parseDouble(df2.format(temp))))); |
| | | return (int) (10 * (Double.parseDouble(df2.format(temp)))); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * B25ï¼è¡¥ç»æ¶é´æå æ¯ä¾ï¼æ¬æ¹è¡¥ç»èµ·æ¢æ¶é´å·®/åè°è¡¥ç»æ¶é´æ»å |
| | | * 10*(1-该åå§ææ å¼) |
| | | * @return |
| | | */ |
| | | private int calcB25(List<DsTaskDetail> dsTaskDetails){ |
| | | List<Date> eTimeList = new ArrayList<>(); |
| | | double allWorkTime = 0; |
| | | if (dsTaskDetails != null && dsTaskDetails.size() > 0) { |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail1 = dsTaskDetails.get(i); |
| | | eTimeList.add(dsTaskDetail1.getSTIME()); |
| | | int oilTime = dsTaskDetail1.getOilTime(); |
| | | int ammoTime = dsTaskDetail1.getAmmoTime(); |
| | | int matTime = dsTaskDetail1.getMatTime(); |
| | | int waterTime = dsTaskDetail1.getWaterTime(); |
| | | int totalTime = oilTime + ammoTime + matTime + waterTime + X_TOLERANCE_VALUE; |
| | | Date eTime = DateUtils.getDateAfterHours(dsTaskDetail1.getSTIME(), totalTime); |
| | | eTimeList.add(eTime); |
| | | |
| | | int waterSTime = dsTaskDetail1.getWaterStime(); |
| | | int waterETime = dsTaskDetail1.getWaterEtime(); |
| | | |
| | | int oilSTime = dsTaskDetail1.getOilStime(); |
| | | int oilETime = dsTaskDetail1.getOilEtime(); |
| | | |
| | | int ammoSTime = dsTaskDetail1.getAmmoStime(); |
| | | int ammoETime = dsTaskDetail1.getAmmoEtime(); |
| | | |
| | | int matSTime = dsTaskDetail1.getMatStime(); |
| | | int matETime = dsTaskDetail1.getMatEtime(); |
| | | |
| | | allWorkTime += (waterETime - waterSTime) + (oilETime - oilSTime) + (ammoETime - ammoSTime) + (matETime - matSTime); |
| | | } |
| | | // è·åæå°æ¶é´ |
| | | Date minDate = Collections.min(eTimeList); |
| | | // è·åæå¤§æ¶é´ |
| | | Date maxDate = Collections.max(eTimeList); |
| | | // è®¡ç®æ¶é´å·® |
| | | double dateInterval = DateUtils.getDisHourOfTowDate(maxDate, minDate); |
| | | double temp = (dateInterval / allWorkTime) > 1 ? 1 : (dateInterval / allWorkTime); |
| | | log.debug("B25 Value =====ï¼" + (10 * (1 - Double.parseDouble(df2.format(temp))))); |
| | | return (int) (10 * (1 - Double.parseDouble(df2.format(temp)))); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * B32ï¼æ°´çµä¿éæ¥ä½ä¸å¼ºåº¦ï¼åæ°´çµå°ç»24å°æ¶å
å¹³åä½ä¸æ¶é´/24å°æ¶ï¼å¹³åå¼ |
| | | * 10 * 该åå§ææ å¼ |
| | | * @return |
| | | */ |
| | | private int calcB32(List<DsTaskDetail> dsTaskDetails){ |
| | | double allTime = 0; |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail1 = dsTaskDetails.get(i); |
| | | // int elecSTime = dsTaskDetail1.getElecStime(); |
| | | // int elecETime = dsTaskDetail1.getElecEtime(); |
| | | // int eleTime = elecETime - elecSTime; |
| | | int waterTime = dsTaskDetail1.getWaterTime(); |
| | | allTime += waterTime; |
| | | } |
| | | double avgValue = (allTime / (dsTaskDetails.size() * 24)) > 1 ? 1 : (allTime / (dsTaskDetails.size() * 24)); |
| | | log.debug("B32 Value =====ï¼" + (10 * Double.parseDouble(df2.format(avgValue)))); |
| | | return (int) (10 * Double.parseDouble(df2.format(avgValue))); |
| | | } |
| | | |
| | | /** |
| | | * B34ï¼æ²¹æè¡¥ç»æ¥ä½ä¸å¼ºåº¦ï¼åå æ²¹å°ç»24å°æ¶å
å¹³åä½ä¸æ¶é´/24å°æ¶ï¼å¹³åå¼ |
| | | * 10 * 该åå§ææ å¼ |
| | | * @return |
| | | */ |
| | | private int calcB34(List<DsTaskDetail> dsTaskDetails){ |
| | | double days = 0; |
| | | double allTime = 0; |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail1 = dsTaskDetails.get(i); |
| | | Date sTime= dsTaskDetail1.getSTIME(); |
| | | int oilTime = dsTaskDetail1.getOilTime(); |
| | | Date oilEndTime = DateUtils.getDateAfterHours(sTime, oilTime); |
| | | |
| | | double hourDistance = DateUtils.getDisHourOfTowDate(sTime, oilEndTime); |
| | | if(hourDistance < 24){ |
| | | days += 1; |
| | | }else { |
| | | days += (int) Math.ceil(hourDistance / 24); |
| | | } |
| | | allTime += oilTime; |
| | | } |
| | | double avgValue = (allTime / (days * 24)) > 1 ? 1 : (allTime / (days * 24)); |
| | | log.debug("B34 Value =====ï¼" + (10 * Double.parseDouble(df2.format(avgValue)))); |
| | | return (int) (10 * Double.parseDouble(df2.format(avgValue))); |
| | | } |
| | | |
| | | /** |
| | | * B36ï¼ç©èµè¡¥ç»æ¥ä½ä¸å¼ºåº¦ï¼åç©èµè½¦è¾24å°æ¶å
ä½ä¸æ¶é´/24å°æ¶ï¼å¹³åå¼ |
| | | * 10 * 该åå§ææ å¼ |
| | | * @return |
| | | */ |
| | | private int calcB36(List<DsTaskDetail> dsTaskDetails) { |
| | | double days = 0; |
| | | double allTime = 0; |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail1 = dsTaskDetails.get(i); |
| | | Date sTime= dsTaskDetail1.getSTIME(); |
| | | int matTime = dsTaskDetail1.getMatTime(); |
| | | Date matEndTime = DateUtils.getDateAfterHours(sTime, matTime); |
| | | |
| | | double hourDistance = DateUtils.getDisHourOfTowDate(sTime, matEndTime); |
| | | if(hourDistance < 24){ |
| | | days += 1; |
| | | }else { |
| | | days += (int) Math.ceil(hourDistance / 24); |
| | | } |
| | | allTime += matTime; |
| | | } |
| | | double avgValue = (allTime / (days * 24)) > 1 ? 1 : (allTime / (days * 24)); |
| | | log.debug("B36 Value =====ï¼" + (10 * Double.parseDouble(df2.format(avgValue)))); |
| | | return (int) (10 * Double.parseDouble(df2.format(avgValue))); |
| | | } |
| | | |
| | | /** |
| | | * B41ï¼æ³ä½æ¥åå¨è½¬èæ¬¡ï¼æ¬æ¸¯è¡¥ç»è°è¹æ»æ°é/天æ°/æ³ä½æ° |
| | | * 10 * 该åå§ææ å¼/3ï¼æ³¨ï¼3为åèå¼ï¼é常æå¤§å¨è½¬éä¸å¤§äº3ï¼å°±æ¯ä¸èå¹¶é 1天çæ
åµï¼ï¼å¦æå¤§äº10ååå¼ä¸º10 |
| | | * @return |
| | | */ |
| | | private int calcB41(List<DsTaskDetail> dsTaskDetails) { |
| | | List<Date> timeList = new ArrayList<>(); |
| | | for (int i = 0; i < dsTaskDetails.size() - 1; i++) { |
| | | DsTaskDetail dsTaskDetail1 = dsTaskDetails.get(i); |
| | | timeList.add(dsTaskDetail1.getSTIME()); |
| | | int oilTime = dsTaskDetail1.getOilTime(); |
| | | int ammoTime = dsTaskDetail1.getAmmoTime(); |
| | | int matTime = dsTaskDetail1.getMatTime(); |
| | | int waterTime = dsTaskDetail1.getWaterTime(); |
| | | int totalTime = oilTime + ammoTime + matTime + waterTime; |
| | | Date eTime = DateUtils.getDateAfterHours(dsTaskDetail1.getSTIME(), totalTime + X_TOLERANCE_VALUE); |
| | | timeList.add(eTime); |
| | | } |
| | | // è·åæå°æ¶é´ |
| | | Date minDate = Collections.min(timeList); |
| | | // è·åæå¤§æ¶é´ |
| | | Date maxDate = Collections.max(timeList); |
| | | // è®¡ç®æ¶é´å·® |
| | | double days = DateUtils.getSubtractOfTowDate(maxDate, minDate); |
| | | int berthCount = getBerthCountOfHarbor(); |
| | | double originalValue = (dsTaskDetails.size() / days / berthCount / 3) > 1 ? 1 : (dsTaskDetails.size() / days / berthCount / 3); |
| | | log.debug("B41 Value =====ï¼" + (10 * Double.parseDouble(df2.format(originalValue)))); |
| | | return (int) (10 * Double.parseDouble(df2.format(originalValue))); |
| | | } |
| | | |
| | | /** |
| | | * B42ï¼å沿å 尿大åå¼ï¼æ¬æ¸¯è¡¥ç»å港åç 头忳使大å å°åå¼ |
| | | * æ£ç´¢ååæ²¿åºå°å ç¨çï¼åæå¤§å¼åå¼ |
| | | * @return |
| | | */ |
| | | private int calcB42(List<DsTaskDetail> dsTaskDetails) { |
| | | double allValue = 0.0; |
| | | for (int i = 1; i <= 24; i++) { |
| | | String timeSlot = "t" + i; |
| | | int oilCount = 0; |
| | | int ammoCount = 0; |
| | | int matCount = 0; |
| | | for (DsTaskDetail task : dsTaskDetails) { |
| | | if (task.getOilStime() != null && task.getOilStime() <= i && task.getOilEtime() >= i) { |
| | | oilCount++; |
| | | } else if (task.getAmmoStime() != null && task.getAmmoStime() <= i && task.getAmmoEtime() >= i) { |
| | | ammoCount++; |
| | | } else if (task.getMatStime() != null && task.getMatStime() <= i && task.getMatEtime() >= i) { |
| | | matCount++; |
| | | } |
| | | } |
| | | |
| | | Double totalSupply = NumberUtils.roundToTwoDecimalPlaces(oilCount * OIL_PLACE_PER + ammoCount * AMMO_PLACE_PER + matCount * MAT_PLACE_PER); |
| | | double maxPlat = 0.0; |
| | | if(maxPlat < totalSupply){ |
| | | maxPlat = totalSupply; |
| | | } |
| | | allValue += maxPlat; |
| | | } |
| | | double temp = (allValue / dsTaskDetails.size()) > 1 ? 1 : (allValue / dsTaskDetails.size()); |
| | | log.debug("B42 Value =====ï¼" + (10 * Double.parseDouble(df2.format(temp)))); |
| | | return (int) (10 * Double.parseDouble(df2.format(temp))); |
| | | } |
| | | |
| | | /** |
| | | * B43ï¼å沿å åæ¶é¿åå¼ï¼æ¬æ¸¯è¡¥ç»åæ³ä½é¦ä¸ª24å°æ¶å
å å°0.5以ä¸çæ¶é´åå¼ |
| | | * 10*该åå§ææ å¼/24ï¼æ³¨ï¼åºåå¼å24å°æ¶ |
| | | * @return |
| | | */ |
| | | private int calcB43(List<DsTaskDetail> dsTaskDetails) { |
| | | Integer platTime = 0; |
| | | for (int i = 1; i <= 24; i++) { |
| | | int oilCount = 0; |
| | | int ammoCount = 0; |
| | | int matCount = 0; |
| | | for (DsTaskDetail task : dsTaskDetails) { |
| | | if (task.getOilStime() != null && task.getOilStime() <= i && task.getOilEtime() >= i) { |
| | | oilCount++; |
| | | } else if (task.getAmmoStime() != null && task.getAmmoStime() <= i && task.getAmmoEtime() >= i) { |
| | | ammoCount++; |
| | | } else if (task.getMatStime() != null && task.getMatStime() <= i && task.getMatEtime() >= i) { |
| | | matCount++; |
| | | } |
| | | } |
| | | Double totalSupply = NumberUtils.roundToTwoDecimalPlaces(oilCount * OIL_PLACE_PER + ammoCount * AMMO_PLACE_PER + matCount * MAT_PLACE_PER); |
| | | if(totalSupply >= 0.5){ |
| | | platTime++; |
| | | } |
| | | } |
| | | double temp = (platTime / 24) > 1 ? 1 : (platTime / 24); |
| | | log.debug("B43 Value =====ï¼" + (10 * Double.parseDouble(df2.format(temp)))); |
| | | return (int) (10 * Double.parseDouble(df2.format(temp))); |
| | | } |
| | | |
| | | /** |
| | | * B44ï¼å æ²¹è®¾æ½æ¥å使ç¨çï¼æ¬æ¸¯ææ³ä½ç»è®¡è®¾æ½é¦ä¸ª24å°æ¶å
å æ²¹ä½ä¸æ¶é´/24å°æ¶ï¼æ±åå¼ |
| | | * æ£ç´¢åæ³ä½é¦ä¸ª24å°æ¶å
å æ²¹ä½ä¸æ¶é´/24 |
| | | * @return |
| | | */ |
| | | private int calcB44(List<DsTaskDetail> dsTaskDetails) { |
| | | // æå æ²¹éæ±ãè¹ç±»ååæµæ¸¯æ¶é´æåº |
| | | dsTaskDetails.sort(Comparator.comparing(DsTaskDetail::getBerthId).thenComparing(DsTaskDetail::getSupplySeq)); |
| | | |
| | | // ææ³ä½å·è¿è¡åç» |
| | | Map<Long, List<DsTaskDetail>> detailMap = new HashMap<>(); |
| | | for (DsTaskDetail detail : dsTaskDetails) { |
| | | Long berthId = detail.getBerthId(); |
| | | detailMap.computeIfAbsent(berthId, k -> new ArrayList<>()).add(detail); |
| | | } |
| | | Date after24Hour = null; // é¦ä¸ª24å°æ¶æªæ¢æ¶é´ |
| | | double allTime = 0.0; |
| | | for (List<DsTaskDetail> groupDsTaskDetails : detailMap.values()) { |
| | | for (int i = 0; i < groupDsTaskDetails.size(); i++) { |
| | | DsTaskDetail detail1 = groupDsTaskDetails.get(i); |
| | | int oilStartTime = detail1.getOilStime(); |
| | | int oilEndTime = detail1.getOilEtime(); |
| | | int oilTime = detail1.getOilTime(); |
| | | Date t1Date = detail1.getT1(); |
| | | Date oilStartDate = DateUtils.getDateAfterHours(t1Date, oilStartTime); |
| | | Date oilEndDate = DateUtils.getDateAfterHours(t1Date, oilTime); |
| | | |
| | | if (i == 0) { |
| | | after24Hour = DateUtils.getDateAfterHours(t1Date, 24); |
| | | } |
| | | |
| | | if (oilStartDate.before(after24Hour) && oilEndDate.before(after24Hour)) { |
| | | allTime += oilTime; |
| | | } else if (oilStartDate.before(after24Hour) && oilEndDate.after(after24Hour)) { |
| | | allTime += DateUtils.getDisHourOfTowDate(oilStartDate, after24Hour); |
| | | } else { |
| | | allTime += 0; |
| | | } |
| | | } |
| | | } |
| | | double temp = (allTime / 24) > 1 ? 1 : (allTime / 24); |
| | | log.debug("B44 Value =====ï¼" + (10 * Double.parseDouble(df2.format(temp)))); |
| | | return (int) (10 * Double.parseDouble(df2.format(temp))); |
| | | } |
| | | |
| | | /** |
| | | * B45ï¼åæ³ä½ç©èµè½¦æ¬¡åå¼ï¼æ¬æ¸¯è¡¥ç»åæ³ä½é¦ä¸ª24å°æ¶å
ç©èµè½¦è¾æ¥å¾æ¬¡æ°çåå¼ |
| | | * 10 * 该åå§ææ å¼/24ï¼æ³¨ï¼åºåå¼å24ï¼å³å¹³åæ¯å°æ¶1车次补ç»ã |
| | | * @return |
| | | */ |
| | | private static final int VECHILE_COUNT = 10; // è½¦è¾æ°é |
| | | private int calcB45(List<DsTaskDetail> dsTaskDetails) { |
| | | // ææ³ä½ãè¡¥ç»é¡ºåºæåº |
| | | dsTaskDetails.sort(Comparator.comparing(DsTaskDetail::getBerthId).thenComparing(DsTaskDetail::getSupplySeq)); |
| | | |
| | | // ææ³ä½å·è¿è¡åç» |
| | | Map<Long, List<DsTaskDetail>> detailMap = new HashMap<>(); |
| | | for (DsTaskDetail detail : dsTaskDetails) { |
| | | Long berthId = detail.getBerthId(); |
| | | detailMap.computeIfAbsent(berthId, k -> new ArrayList<>()).add(detail); |
| | | } |
| | | Date after24Hour = null; // é¦ä¸ª24å°æ¶æªæ¢æ¶é´ |
| | | double allCount = 0.0; |
| | | for (List<DsTaskDetail> groupDsTaskDetails : detailMap.values()) { |
| | | for (int i = 0; i < groupDsTaskDetails.size(); i++) { |
| | | DsTaskDetail detail1 = groupDsTaskDetails.get(i); |
| | | int matStartTime = detail1.getMatStime(); |
| | | int matEndTime = detail1.getMatEtime(); |
| | | int matTime = detail1.getMatTime(); |
| | | Date t1Date = detail1.getT1(); |
| | | Date matStartDate = DateUtils.getDateAfterHours(t1Date, matStartTime); |
| | | Date matEndDate = DateUtils.getDateAfterHours(t1Date, matEndTime); |
| | | |
| | | if (i == 0) { |
| | | after24Hour = DateUtils.getDateAfterHours(t1Date, 24); |
| | | } |
| | | |
| | | if (matStartDate.before(after24Hour) && matEndDate.before(after24Hour)) { |
| | | allCount += detail1.getFood() + detail1.getFoodO() + detail1.getFoodW(); |
| | | } else { |
| | | allCount += 0; |
| | | } |
| | | } |
| | | } |
| | | double temp = (allCount / VECHILE_COUNT / 24) > 1? 1 : (allCount / VECHILE_COUNT / 24); |
| | | log.debug("B45 Value =====ï¼" + (10 * Double.parseDouble(df2.format(temp)))); |
| | | return (int) (10 * Double.parseDouble(df2.format(temp))); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·å½åæå¨é¨é¨ï¼è·åç¨æ·ç®¡è¾ä¸çæ¸¯å£æ³ä½æ°éã |
| | | * @return |
| | | */ |
| | | private int getBerthCountOfHarbor(){ |
| | | LoginUser sysUser = getLoginUser(); |
| | | Long deptId = sysUser.getDeptId(); |
| | | DmBerth2 dmBerth2 = new DmBerth2(); |
| | | dmBerth2.setDeptId(deptId); |
| | | List<DmBerth2> dmBerth2List = dmBerth2Service.selectDmBerthList(dmBerth2); |
| | | return dmBerth2List.size(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.controller; |
| | | |
| | | /** |
| | | * æ¯éè°è¹è¡¥ç»è®¡åé»è¾Controller |
| | | * |
| | | * @author yl |
| | | * @date 2025-03-20 |
| | | */ |
| | | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.buss.domain.DsTaskDetail; |
| | | import com.ruoyi.buss.domain.DsTaskList2; |
| | | import com.ruoyi.buss.domain.dto.ZdSupplyPlanDTO; |
| | | import com.ruoyi.buss.service.IDsTaskDetailService; |
| | | import com.ruoyi.buss.service.IDsTaskList2Service; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Tag(name = "æ¯éè°è¹è¡¥ç»è®¡å") |
| | | @Controller |
| | | @RequestMapping("/buss/zd/supplyplan") |
| | | public class ZdSupplyPlanController extends BaseController { |
| | | private static final Logger log = LoggerFactory.getLogger(ZdSupplyPlanController.class); |
| | | |
| | | private static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | private static String OIL_SUPPLY_TYPE = "1"; |
| | | private static String MISSILE_SUPPLY_TYPE = "2"; |
| | | private static String GOODS_SUPPLY_TYPE = "3"; |
| | | private static String WATER_SUPPLY_TYPE = "4"; |
| | | |
| | | private static int OIL_UNIT_NUM = 100; // åä½ï¼100å¨ |
| | | private static int WATER_UNIT_NUM = 10; // åä½ï¼10å¨ |
| | | private static int GOODS_UNIT_NUM = 1; // åä½ï¼1车 |
| | | private static int MISSILE_UNIT_NUM = 4; //åä½ï¼4æ |
| | | |
| | | // å¦ä¸å®ä¹054ã056ã073è°åä¸åè¡¥ç»ç±»åå使°éæéæ¶é´ |
| | | private static int[] OIL_USE_TIME = new int[]{3, 3, 3, 3, 3}; // 100卿²¹ææéæ¶é´ |
| | | private static int[] WATER_USE_TIME = new int[]{1, 1, 1, 1, 1}; // 10卿·¡æ°´æéæ¶é´ |
| | | private static int[] GOODS_USE_TIME = new int[]{2, 2, 2, 2, 2}; // 1车ç©èµæ¬è¿ä¸è°2å°æ¶ |
| | | private static int[] MISSILE_USE_TIME = new int[]{4, 4, 4, 4, 4}; // 10å¨ç©èµæéæ¶é´ |
| | | |
| | | // å®ä¹è°å |
| | | private static String[] SHIP_TYPE = new String[]{"052D", "054A", "056A", "071", "072"}; |
| | | |
| | | @Autowired |
| | | private IDsTaskList2Service dsTaskListService; |
| | | @Autowired |
| | | private IDsTaskDetailService dsTaskDetailService; |
| | | @Autowired |
| | | private ISysDictDataService sysDictDataService; |
| | | |
| | | @Operation(description = "è·åæ¯éè°è¹è¡¥ç»è®¡å") |
| | | @Log(title = "æ¯éè¡¥ç»è®¡å", businessType = BusinessType.INSERT) |
| | | @PostMapping("/get") |
| | | @ResponseBody |
| | | public AjaxResult getZdSupplyPlan(@RequestBody ZdSupplyPlanDTO zdSupplyPlanDTO) throws IOException, ParseException { |
| | | Long taskId = zdSupplyPlanDTO.getTaskId(); |
| | | String t1Time = zdSupplyPlanDTO.getT1Time(); |
| | | String usedBerthIds = zdSupplyPlanDTO.getUsedBerthIds(); |
| | | |
| | | LoginUser sysUser = getLoginUser(); |
| | | Long deptId = sysUser.getDeptId(); |
| | | |
| | | JSONArray rootJSONArray = new JSONArray(); |
| | | if (usedBerthIds != null && usedBerthIds.length() > 0) { |
| | | String[] berthIdArray = usedBerthIds.split(","); // usedBerthIds为å¤ä¸ªæ³ä½IDï¼ä»¥éå·åé |
| | | for (int i = 0; i < berthIdArray.length; i++) { |
| | | JSONObject rootJSONObj = new JSONObject(); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | JSONObject sub1JsonObj = new JSONObject(); |
| | | List<DsTaskList2> dsTaskLists = dsTaskListService.getDsTaskListForSupplyPlan(deptId, taskId, Long.parseLong(berthIdArray[i])); |
| | | |
| | | // éååæ³ä½çåè°è¹ï¼è®¡ç®æ¯èè°è¹æéè¡¥ç»æ¶é´ï¼çæåè°è¹çè¡¥ç»è®¡åæ°æ® |
| | | if (dsTaskLists.size() > 0) { |
| | | sub1JsonObj.put("harborName", dsTaskLists.get(0).getHarborName()); |
| | | sub1JsonObj.put("berthName", dsTaskLists.get(0).getBerthName()); |
| | | sub1JsonObj.put("berthId", dsTaskLists.get(0).getBerthId()); |
| | | sub1JsonObj.put("parkingType", dsTaskLists.get(0).getParkingType()); |
| | | // 岸çµèç¹æ»æ¶é¿ |
| | | int andianTotalTime = 0; |
| | | // æ·¡æ°´è¡¥ç»æ»æ¶é¿ |
| | | int waterTotalTime = 0; |
| | | // çæè¡¥ç»æ»æ¶é¿ |
| | | int oilTotalTime = 0; |
| | | // å¼¹è¯è¡¥ç»æ»æ¶é¿ |
| | | int missileTotalTime = 0; |
| | | // ç©èµè¡¥ç»æ»æ¶é¿ |
| | | int goodsTotalTime = 0; |
| | | |
| | | JSONArray subJSONArray = new JSONArray(); |
| | | for (int j = 0; j < dsTaskLists.size(); j++) { |
| | | DsTaskDetail dsTaskDetail = new DsTaskDetail(); |
| | | JSONObject jsonObj = new JSONObject(); |
| | | DsTaskList2 tempDsTaskList = dsTaskLists.get(j); |
| | | String shipType = tempDsTaskList.getShipType(); // è°å |
| | | String shipNo = tempDsTaskList.getShipNo(); // è·å· |
| | | String supplySeq = tempDsTaskList.getSupplySeq(); // è¡¥ç»åºå |
| | | |
| | | String supplySeqLabel = sysDictDataService.selectDictLabel("dd_rule_supply", supplySeq); // è¡¥ç»åºåæ ç¾ |
| | | // 第ä¸ç¼ç»³ |
| | | String firstCabelLabel = "T" + (j + 1); |
| | | // å²¸çµæ¥çµèµ·å§æ¶é´Label |
| | | String andianStartTimeLabel = firstCabelLabel + "+1"; |
| | | |
| | | // æ·¡æ°´è¡¥ç»èµ·å§æ¶é´Label |
| | | String waterStartTimeLabel = firstCabelLabel + "+1"; |
| | | // æ·¡æ°´è¡¥ç»ç»ææ¶é´Label |
| | | int addWaterTimeNum = calcSupplyTimeBySupplyType(WATER_SUPPLY_TYPE, shipType, tempDsTaskList.getWATER()); |
| | | String waterEndTimeLabel = firstCabelLabel + "+" +(addWaterTimeNum + 1); |
| | | waterTotalTime += addWaterTimeNum; |
| | | |
| | | // çæ²¹è¡¥ç»æ¶é´Label |
| | | String oilStartTimeLabel = ""; |
| | | String oilEndTimeLabel = ""; |
| | | // å¼¹è¯è¡¥ç»æ¶é´Label |
| | | String missileStartTimeLabel = ""; |
| | | String missileEndTimeLabel = ""; |
| | | |
| | | // è¡¥ç»ç»ææµç®æ¶é´ |
| | | String supplyEndTimeLabel = ""; |
| | | Double oilA = tempDsTaskList.getOilA() == null ? 0 : tempDsTaskList.getOilA(); |
| | | Double oilB = tempDsTaskList.getOilB() == null ? 0 : tempDsTaskList.getOilB(); |
| | | Double oilG = tempDsTaskList.getOilG() == null ? 0 : tempDsTaskList.getOilG(); |
| | | double totalOilNum = oilA + oilB + oilG; // æ»å æ²¹é |
| | | int addOilTimeNum = calcSupplyTimeBySupplyType(OIL_SUPPLY_TYPE, shipType, totalOilNum); |
| | | Long ammoD = tempDsTaskList.getAmmoD() == null ? 0 : tempDsTaskList.getAmmoD(); |
| | | int addMissileTimeNum = calcSupplyTimeBySupplyType(MISSILE_SUPPLY_TYPE, shipType, (double) ammoD); |
| | | if("1".equals(tempDsTaskList.getSupplySeq())){//åæ¶è¿è¡ |
| | | oilStartTimeLabel = firstCabelLabel + "+" + "2"; |
| | | oilEndTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2); |
| | | missileStartTimeLabel = firstCabelLabel + "+" + "2";; |
| | | missileEndTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2); |
| | | if(addOilTimeNum > addMissileTimeNum){ |
| | | supplyEndTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2 + 1); |
| | | dsTaskDetail.setETIME(DateUtils.addDays(format.parse(t1Time), addOilTimeNum + 2 + 1)); |
| | | }else{ |
| | | supplyEndTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2 + 1); |
| | | dsTaskDetail.setETIME(DateUtils.addDays(format.parse(t1Time), addMissileTimeNum + 2 + 1)); |
| | | } |
| | | |
| | | dsTaskDetail.setOilStime(2); |
| | | dsTaskDetail.setOilEtime(2 + addOilTimeNum); |
| | | dsTaskDetail.setAmmoStime(2); |
| | | dsTaskDetail.setAmmoEtime(2 + addMissileTimeNum); |
| | | }else if("2".equals(tempDsTaskList.getSupplySeq())){//å
æ²¹åå¼¹ |
| | | oilStartTimeLabel = firstCabelLabel + "+" + "2"; |
| | | oilEndTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2); |
| | | missileStartTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2); |
| | | missileEndTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2 + addMissileTimeNum); |
| | | supplyEndTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2 + addMissileTimeNum + 1); |
| | | |
| | | dsTaskDetail.setOilStime(2); |
| | | dsTaskDetail.setOilEtime(2+ addOilTimeNum); |
| | | dsTaskDetail.setAmmoStime(addOilTimeNum + 2 + 1); |
| | | dsTaskDetail.setAmmoEtime(addOilTimeNum + 2 + 1 + addMissileTimeNum); |
| | | dsTaskDetail.setETIME(DateUtils.addDays(format.parse(t1Time), addOilTimeNum + 2 + addMissileTimeNum + 1)); |
| | | }else if("3".equals(tempDsTaskList.getSupplySeq())){//å
弹忲¹ |
| | | missileStartTimeLabel = firstCabelLabel + "+2"; |
| | | missileEndTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2); |
| | | oilStartTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2); |
| | | oilEndTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2 + addOilTimeNum); |
| | | supplyEndTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2 + addOilTimeNum + 1); |
| | | |
| | | dsTaskDetail.setOilStime(addMissileTimeNum + 2 + 1); |
| | | dsTaskDetail.setOilEtime(addMissileTimeNum + 2 + 1 + addOilTimeNum); |
| | | dsTaskDetail.setAmmoStime(2); |
| | | dsTaskDetail.setAmmoEtime(addMissileTimeNum + 2); |
| | | dsTaskDetail.setETIME(DateUtils.addDays(format.parse(t1Time), addMissileTimeNum + 2 + addOilTimeNum + 1)); |
| | | } |
| | | oilTotalTime += addOilTimeNum; |
| | | missileTotalTime += addMissileTimeNum; |
| | | |
| | | if(addOilTimeNum >= addMissileTimeNum){ |
| | | andianTotalTime += addOilTimeNum; |
| | | } else { |
| | | andianTotalTime += addMissileTimeNum; |
| | | } |
| | | |
| | | // ç©èµè¡¥ç»æ¶é´Label |
| | | String goodsStartTimeLabel = ""; |
| | | String goodsEndTimeLabel = ""; |
| | | Long food = tempDsTaskList.getFOOD() == null? 0 : tempDsTaskList.getFOOD(); |
| | | Long foodW = tempDsTaskList.getFoodW() == null? 0 : tempDsTaskList.getFoodW(); |
| | | Long foodO = tempDsTaskList.getFoodO() == null? 0 : tempDsTaskList.getFoodO(); |
| | | double totalGoodsNum = food + foodW + foodO; // æ»å ç©èµé |
| | | int addGoodTimeNum = calcSupplyTimeBySupplyType(GOODS_SUPPLY_TYPE, shipType, totalGoodsNum); |
| | | goodsStartTimeLabel = firstCabelLabel + "+2"; |
| | | goodsEndTimeLabel = firstCabelLabel + "+" + (addGoodTimeNum + 2); |
| | | goodsTotalTime += addGoodTimeNum; |
| | | |
| | | // æå»ºæ¯èè°è¹æå»ºJSON对象 |
| | | jsonObj.put("id", String.valueOf(j+1)); |
| | | jsonObj.put("shipType", shipType); |
| | | jsonObj.put("shipNo", shipNo); |
| | | jsonObj.put("supplySeq", supplySeqLabel); |
| | | jsonObj.put("sTime", firstCabelLabel); |
| | | jsonObj.put("electSTime", andianStartTimeLabel); |
| | | jsonObj.put("waterSTime", waterStartTimeLabel); |
| | | jsonObj.put("waterETime", waterEndTimeLabel); |
| | | jsonObj.put("oilSTime", oilStartTimeLabel); |
| | | jsonObj.put("oilETime", oilEndTimeLabel); |
| | | jsonObj.put("ammoSTime", missileStartTimeLabel); |
| | | jsonObj.put("ammoETime", missileEndTimeLabel); |
| | | jsonObj.put("matSTime", goodsStartTimeLabel); |
| | | jsonObj.put("matETime", goodsEndTimeLabel); |
| | | jsonObj.put("supplyETime", supplyEndTimeLabel); |
| | | jsonObj.put("path", tempDsTaskList.getPath()); |
| | | subJSONArray.add(jsonObj); |
| | | sub1JsonObj.put("subData", subJSONArray); |
| | | |
| | | // æ´æ°è¹è¶è¡¥ç»è®¡åæ°æ® |
| | | dsTaskDetail.setTaskId(taskId); |
| | | dsTaskDetail.setHarborId(tempDsTaskList.getHarborId()); |
| | | dsTaskDetail.setHarborName(tempDsTaskList.getHarborName()); |
| | | dsTaskDetail.setBerthId(Long.parseLong(berthIdArray[i])); |
| | | dsTaskDetail.setBerthName(tempDsTaskList.getBerthName()); |
| | | dsTaskDetail.setParkingType(tempDsTaskList.getParkingType()); |
| | | dsTaskDetail.setShipNo(tempDsTaskList.getShipNo()); |
| | | dsTaskDetail.setShipType(tempDsTaskList.getShipType()); |
| | | dsTaskDetail.setSTIME(format.parse(t1Time)); |
| | | dsTaskDetail.setElecStime(1); |
| | | dsTaskDetail.setWaterStime(1); |
| | | dsTaskDetail.setWaterEtime(addWaterTimeNum); |
| | | dsTaskDetail.setMatStime(2); |
| | | dsTaskDetail.setMatEtime(addGoodTimeNum + 2); |
| | | dsTaskDetail.setOilTime(addOilTimeNum); |
| | | dsTaskDetail.setAmmoTime(addMissileTimeNum); |
| | | dsTaskDetail.setMatTime(addGoodTimeNum); |
| | | dsTaskDetail.setWaterTime(addWaterTimeNum); |
| | | dsTaskDetail.setT1(format.parse(t1Time)); |
| | | dsTaskDetail.setSupplySeq(tempDsTaskList.getSupplySeq()); |
| | | dsTaskDetail.setCarCount((int) totalGoodsNum); |
| | | dsTaskDetail.setFood((double) food); |
| | | dsTaskDetail.setFoodW((double) foodW); |
| | | dsTaskDetail.setFoodO((double) foodO); |
| | | |
| | | // æ ¹æ®taskIdåshipNoåshipType夿æ¯å¦åå¨è¹è¶è¡¥ç»è®¡åæ°æ® |
| | | DsTaskDetail tempDsTaskDetail = new DsTaskDetail(); |
| | | tempDsTaskDetail.setTaskId(taskId); |
| | | tempDsTaskDetail.setShipNo(shipNo); |
| | | tempDsTaskDetail.setShipType(shipType); |
| | | List<DsTaskDetail> dsTaskDetails = dsTaskDetailService.selectDsTaskDetailList(tempDsTaskDetail); |
| | | if (dsTaskDetails != null && dsTaskDetails.size() > 0) { |
| | | dsTaskDetail.setPKID(dsTaskDetails.get(0).getPKID()); |
| | | dsTaskDetailService.updateDsTaskDetail(dsTaskDetail); |
| | | } else { |
| | | dsTaskDetailService.insertDsTaskDetail(dsTaskDetail); |
| | | } |
| | | } |
| | | jsonArray.add(sub1JsonObj); |
| | | rootJSONObj.put("berthDatas", jsonArray); |
| | | rootJSONObj.put("totalJiedianTime", andianTotalTime); |
| | | rootJSONObj.put("totalWaterTime", waterTotalTime); |
| | | rootJSONObj.put("totalOilTime", oilTotalTime); |
| | | rootJSONObj.put("totalAmmoTime", missileTotalTime); |
| | | rootJSONObj.put("totalMatTime", goodsTotalTime); |
| | | rootJSONArray.add(rootJSONObj); |
| | | } |
| | | } |
| | | } |
| | | return AjaxResult.success(rootJSONArray); |
| | | } |
| | | |
| | | @Operation(description = "è·åæ¯éæ¶é´è¡¥ç»è®¡å") |
| | | @Log(title = "æ¯éæ¯éæ¶é´è¡¥ç»è®¡å", businessType = BusinessType.INSERT) |
| | | @PostMapping("/getdate") |
| | | @ResponseBody |
| | | // 䏿¾ç¤ºTï¼æ¾ç¤ºyyyy-MM-dd HH:mm:ss |
| | | public AjaxResult getZdSupplyPlanDate(@RequestBody ZdSupplyPlanDTO zdSupplyPlanDTO) throws IOException, ParseException { |
| | | Long taskId = zdSupplyPlanDTO.getTaskId(); |
| | | String t1Time = zdSupplyPlanDTO.getT1Time(); |
| | | String usedBerthIds = zdSupplyPlanDTO.getUsedBerthIds(); |
| | | |
| | | LoginUser sysUser = getLoginUser(); |
| | | Long deptId = sysUser.getDeptId(); |
| | | |
| | | JSONArray rootJSONArray = new JSONArray(); |
| | | if (usedBerthIds != null && usedBerthIds.length() > 0) { |
| | | String[] berthIdArray = usedBerthIds.split(","); // usedBerthIds为å¤ä¸ªæ³ä½IDï¼ä»¥éå·åé |
| | | for (int i = 0; i < berthIdArray.length; i++) { |
| | | JSONObject rootJSONObj = new JSONObject(); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | JSONObject sub1JsonObj = new JSONObject(); |
| | | List<DsTaskList2> dsTaskLists = dsTaskListService.getDsTaskListForSupplyPlan(deptId, taskId, Long.parseLong(berthIdArray[i])); |
| | | |
| | | // éååæ³ä½çåè°è¹ï¼è®¡ç®æ¯èè°è¹æéè¡¥ç»æ¶é´ï¼çæåè°è¹çè¡¥ç»è®¡åæ°æ® |
| | | if (dsTaskLists.size() > 0) { |
| | | sub1JsonObj.put("harborName", dsTaskLists.get(0).getHarborName()); |
| | | sub1JsonObj.put("berthName", dsTaskLists.get(0).getBerthName()); |
| | | sub1JsonObj.put("berthId", dsTaskLists.get(0).getBerthId()); |
| | | sub1JsonObj.put("parkingType", dsTaskLists.get(0).getParkingType()); |
| | | // 岸çµèç¹æ»æ¶é¿ |
| | | int andianTotalTime = 0; |
| | | // æ·¡æ°´è¡¥ç»æ»æ¶é¿ |
| | | int waterTotalTime = 0; |
| | | // çæè¡¥ç»æ»æ¶é¿ |
| | | int oilTotalTime = 0; |
| | | // å¼¹è¯è¡¥ç»æ»æ¶é¿ |
| | | int missileTotalTime = 0; |
| | | // ç©èµè¡¥ç»æ»æ¶é¿ |
| | | int goodsTotalTime = 0; |
| | | |
| | | JSONArray subJSONArray = new JSONArray(); |
| | | for (int j = 0; j < dsTaskLists.size(); j++) { |
| | | DsTaskDetail dsTaskDetail = new DsTaskDetail(); |
| | | JSONObject jsonObj = new JSONObject(); |
| | | DsTaskList2 tempDsTaskList = dsTaskLists.get(j); |
| | | String shipType = tempDsTaskList.getShipType(); // è°å |
| | | String shipNo = tempDsTaskList.getShipNo(); // è·å· |
| | | String supplySeq = tempDsTaskList.getSupplySeq(); // è¡¥ç»åºå |
| | | |
| | | String supplySeqLabel = sysDictDataService.selectDictLabel("dd_rule_supply", supplySeq); // è¡¥ç»åºåæ ç¾ |
| | | // 第ä¸ç¼ç»³ |
| | | String firstCabelLabel = "T" + (j + 1); |
| | | String firstCabelLabelDate = format.format(addHoursToDate(t1Time, (j+1))); |
| | | |
| | | // å²¸çµæ¥çµèµ·å§æ¶é´Label |
| | | String andianStartTimeLabel = firstCabelLabel + "+1"; |
| | | String andianStartTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, 1)); |
| | | |
| | | // æ·¡æ°´è¡¥ç»èµ·å§æ¶é´Label |
| | | String waterStartTimeLabel = firstCabelLabel + "+1"; |
| | | String waterStartTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, 1)); |
| | | |
| | | // æ·¡æ°´è¡¥ç»ç»ææ¶é´Label |
| | | int addWaterTimeNum = calcSupplyTimeBySupplyType(WATER_SUPPLY_TYPE, shipType, tempDsTaskList.getWATER()); |
| | | String waterEndTimeLabel = firstCabelLabel + "+" +(addWaterTimeNum + 1); |
| | | String waterEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addWaterTimeNum + 1))); |
| | | waterTotalTime += addWaterTimeNum; |
| | | |
| | | // çæ²¹è¡¥ç»æ¶é´Label |
| | | String oilStartTimeLabel = ""; |
| | | String oilStartTimeLabelDate = ""; |
| | | String oilEndTimeLabel = ""; |
| | | String oilEndTimeLabelDate = ""; |
| | | // å¼¹è¯è¡¥ç»æ¶é´Label |
| | | String missileStartTimeLabel = ""; |
| | | String missileStartTimeLabelDate = ""; |
| | | String missileEndTimeLabel = ""; |
| | | String missileEndTimeLabelDate = ""; |
| | | |
| | | // è¡¥ç»ç»ææµç®æ¶é´ |
| | | String supplyEndTimeLabel = ""; |
| | | String supplyEndTimeLabelDate = ""; |
| | | Double oilA = tempDsTaskList.getOilA() == null ? 0 : tempDsTaskList.getOilA(); |
| | | Double oilB = tempDsTaskList.getOilB() == null ? 0 : tempDsTaskList.getOilB(); |
| | | Double oilG = tempDsTaskList.getOilG() == null ? 0 : tempDsTaskList.getOilG(); |
| | | double totalOilNum = oilA + oilB + oilG; // æ»å æ²¹é |
| | | int addOilTimeNum = calcSupplyTimeBySupplyType(OIL_SUPPLY_TYPE, shipType, totalOilNum); |
| | | Long ammoD = tempDsTaskList.getAmmoD() == null ? 0 : tempDsTaskList.getAmmoD(); |
| | | int addMissileTimeNum = calcSupplyTimeBySupplyType(MISSILE_SUPPLY_TYPE, shipType, (double) ammoD); |
| | | if("1".equals(tempDsTaskList.getSupplySeq())){//åæ¶è¿è¡ |
| | | oilStartTimeLabel = firstCabelLabel + "+" + "2"; |
| | | oilStartTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, 2)); |
| | | oilEndTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2); |
| | | oilEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addOilTimeNum + 2))); |
| | | missileStartTimeLabel = firstCabelLabel + "+" + "2";; |
| | | missileStartTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, 2)); |
| | | missileEndTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2); |
| | | missileEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addMissileTimeNum + 2))); |
| | | if(addOilTimeNum > addMissileTimeNum){ |
| | | supplyEndTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2 + 1); |
| | | supplyEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addOilTimeNum + 2 + 1))); |
| | | dsTaskDetail.setETIME(DateUtils.addHours(format.parse(t1Time), addOilTimeNum + 2 + 1)); |
| | | }else{ |
| | | supplyEndTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2 + 1); |
| | | supplyEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addMissileTimeNum + 2 + 1))); |
| | | dsTaskDetail.setETIME(DateUtils.addHours(format.parse(t1Time), addMissileTimeNum + 2 + 1)); |
| | | } |
| | | |
| | | dsTaskDetail.setOilStime(2); |
| | | dsTaskDetail.setOilEtime(2 + addOilTimeNum); |
| | | dsTaskDetail.setAmmoStime(2); |
| | | dsTaskDetail.setAmmoEtime(2 + addMissileTimeNum); |
| | | }else if("2".equals(tempDsTaskList.getSupplySeq())){//å
æ²¹åå¼¹ |
| | | oilStartTimeLabel = firstCabelLabel + "+" + "2"; |
| | | oilEndTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2); |
| | | missileStartTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2); |
| | | missileEndTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2 + addMissileTimeNum); |
| | | supplyEndTimeLabel = firstCabelLabel + "+" + (addOilTimeNum + 2 + addMissileTimeNum + 1); |
| | | oilStartTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, 2)); |
| | | oilEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addOilTimeNum + 2))); |
| | | missileStartTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addOilTimeNum + 2))); |
| | | missileEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addOilTimeNum + 2 + addMissileTimeNum))); |
| | | supplyEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addOilTimeNum + 2 + addMissileTimeNum + 1))); |
| | | |
| | | dsTaskDetail.setOilStime(2); |
| | | dsTaskDetail.setOilEtime(2+ addOilTimeNum); |
| | | dsTaskDetail.setAmmoStime(addOilTimeNum + 2 + 1); |
| | | dsTaskDetail.setAmmoEtime(addOilTimeNum + 2 + 1 + addMissileTimeNum); |
| | | dsTaskDetail.setETIME(DateUtils.addHours(format.parse(t1Time), addOilTimeNum + 2 + addMissileTimeNum + 1)); |
| | | }else if("3".equals(tempDsTaskList.getSupplySeq())){//å
弹忲¹ |
| | | missileStartTimeLabel = firstCabelLabel + "+2"; |
| | | missileEndTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2); |
| | | oilStartTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2); |
| | | oilEndTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2 + addOilTimeNum); |
| | | supplyEndTimeLabel = firstCabelLabel + "+" + (addMissileTimeNum + 2 + addOilTimeNum + 1); |
| | | oilStartTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addMissileTimeNum + 2))); |
| | | oilEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addMissileTimeNum + 2 + addOilTimeNum))); |
| | | missileStartTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, 2)); |
| | | missileEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addMissileTimeNum + 2))); |
| | | supplyEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addMissileTimeNum + 2 + addOilTimeNum + 1))); |
| | | |
| | | dsTaskDetail.setOilStime(addMissileTimeNum + 2 + 1); |
| | | dsTaskDetail.setOilEtime(addMissileTimeNum + 2 + 1 + addOilTimeNum); |
| | | dsTaskDetail.setAmmoStime(2); |
| | | dsTaskDetail.setAmmoEtime(addMissileTimeNum + 2); |
| | | dsTaskDetail.setETIME(DateUtils.addHours(format.parse(t1Time), addMissileTimeNum + 2 + addOilTimeNum + 1)); |
| | | } |
| | | oilTotalTime += addOilTimeNum; |
| | | missileTotalTime += addMissileTimeNum; |
| | | |
| | | if(addOilTimeNum >= addMissileTimeNum){ |
| | | andianTotalTime += addOilTimeNum; |
| | | } else { |
| | | andianTotalTime += addMissileTimeNum; |
| | | } |
| | | |
| | | // ç©èµè¡¥ç»æ¶é´Label |
| | | String goodsStartTimeLabel = ""; |
| | | String goodsStartTimeLabelDate = ""; |
| | | String goodsEndTimeLabel = ""; |
| | | String goodsEndTimeLabelDate = ""; |
| | | Long food = tempDsTaskList.getFOOD() == null? 0 : tempDsTaskList.getFOOD(); |
| | | Long foodW = tempDsTaskList.getFoodW() == null? 0 : tempDsTaskList.getFoodW(); |
| | | Long foodO = tempDsTaskList.getFoodO() == null? 0 : tempDsTaskList.getFoodO(); |
| | | double totalGoodsNum = food + foodW + foodO; // æ»å ç©èµé |
| | | int addGoodTimeNum = calcSupplyTimeBySupplyType(GOODS_SUPPLY_TYPE, shipType, totalGoodsNum); |
| | | goodsStartTimeLabel = firstCabelLabel + "+2"; |
| | | goodsStartTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, 2)); |
| | | goodsEndTimeLabel = firstCabelLabel + "+" + (addGoodTimeNum + 2); |
| | | goodsEndTimeLabelDate = format.format(addHoursToDate(firstCabelLabelDate, (addGoodTimeNum + 2))); |
| | | goodsTotalTime += addGoodTimeNum; |
| | | |
| | | // æå»ºæ¯èè°è¹æå»ºJSON对象 |
| | | jsonObj.put("id", String.valueOf(j+1)); |
| | | jsonObj.put("shipType", shipType); |
| | | jsonObj.put("shipNo", shipNo); |
| | | jsonObj.put("supplySeq", supplySeqLabel); |
| | | jsonObj.put("sTime", firstCabelLabelDate); |
| | | jsonObj.put("electSTime", andianStartTimeLabelDate); |
| | | jsonObj.put("waterSTime", waterStartTimeLabelDate); |
| | | jsonObj.put("waterETime", waterEndTimeLabelDate); |
| | | jsonObj.put("oilSTime", oilStartTimeLabelDate); |
| | | jsonObj.put("oilETime", oilEndTimeLabelDate); |
| | | jsonObj.put("ammoSTime", missileStartTimeLabelDate); |
| | | jsonObj.put("ammoETime", missileEndTimeLabelDate); |
| | | jsonObj.put("matSTime", goodsStartTimeLabelDate); |
| | | jsonObj.put("matETime", goodsEndTimeLabelDate); |
| | | jsonObj.put("supplyETime", supplyEndTimeLabelDate); |
| | | subJSONArray.add(jsonObj); |
| | | sub1JsonObj.put("subData", subJSONArray); |
| | | |
| | | // æ´æ°è¹è¶è¡¥ç»è®¡åæ°æ® |
| | | dsTaskDetail.setTaskId(taskId); |
| | | dsTaskDetail.setHarborId(tempDsTaskList.getHarborId()); |
| | | dsTaskDetail.setHarborName(tempDsTaskList.getHarborName()); |
| | | dsTaskDetail.setBerthId(Long.parseLong(berthIdArray[i])); |
| | | dsTaskDetail.setBerthName(tempDsTaskList.getBerthName()); |
| | | dsTaskDetail.setParkingType(tempDsTaskList.getParkingType()); |
| | | dsTaskDetail.setShipNo(tempDsTaskList.getShipNo()); |
| | | dsTaskDetail.setShipType(tempDsTaskList.getShipType()); |
| | | dsTaskDetail.setSTIME(format.parse(t1Time)); |
| | | dsTaskDetail.setElecStime(1); |
| | | dsTaskDetail.setWaterStime(1); |
| | | dsTaskDetail.setWaterEtime(addWaterTimeNum); |
| | | dsTaskDetail.setMatStime(2); |
| | | dsTaskDetail.setMatEtime(addGoodTimeNum + 2); |
| | | dsTaskDetail.setOilTime(addOilTimeNum); |
| | | dsTaskDetail.setAmmoTime(addMissileTimeNum); |
| | | dsTaskDetail.setMatTime(addGoodTimeNum); |
| | | dsTaskDetail.setWaterTime(addWaterTimeNum); |
| | | dsTaskDetail.setT1(format.parse(t1Time)); |
| | | dsTaskDetail.setSupplySeq(tempDsTaskList.getSupplySeq()); |
| | | dsTaskDetail.setCarCount((int) totalGoodsNum); |
| | | dsTaskDetail.setFood((double) food); |
| | | dsTaskDetail.setFoodW((double) foodW); |
| | | dsTaskDetail.setFoodO((double) foodO); |
| | | |
| | | // æ ¹æ®taskIdåshipNoåshipType夿æ¯å¦åå¨è¹è¶è¡¥ç»è®¡åæ°æ® |
| | | DsTaskDetail tempDsTaskDetail = new DsTaskDetail(); |
| | | tempDsTaskDetail.setTaskId(taskId); |
| | | tempDsTaskDetail.setShipNo(shipNo); |
| | | tempDsTaskDetail.setShipType(shipType); |
| | | List<DsTaskDetail> dsTaskDetails = dsTaskDetailService.selectDsTaskDetailList(tempDsTaskDetail); |
| | | if (dsTaskDetails == null && dsTaskDetails.size() > 0) { |
| | | dsTaskDetail.setPKID(dsTaskDetails.get(0).getPKID()); |
| | | dsTaskDetailService.updateDsTaskDetail(dsTaskDetail); |
| | | } else { |
| | | dsTaskDetailService.insertDsTaskDetail(dsTaskDetail); |
| | | } |
| | | } |
| | | jsonArray.add(sub1JsonObj); |
| | | rootJSONObj.put("berthDatas", jsonArray); |
| | | rootJSONObj.put("totalJiedianTime", andianTotalTime); |
| | | rootJSONObj.put("totalWaterTime", waterTotalTime); |
| | | rootJSONObj.put("totalOilTime", oilTotalTime); |
| | | rootJSONObj.put("totalAmmoTime", missileTotalTime); |
| | | rootJSONObj.put("totalMatTime", goodsTotalTime); |
| | | rootJSONArray.add(rootJSONObj); |
| | | } |
| | | } |
| | | } |
| | | return AjaxResult.success(rootJSONArray); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®è¡¥ç»éæ±éï¼è®¡ç®åç§è¡¥åæéæ¶é´ã |
| | | * @param supplyType |
| | | * @param shipType |
| | | * @param supplyTotalNum |
| | | * @return æ´å°æ¶ |
| | | */ |
| | | private int calcSupplyTimeBySupplyType(String supplyType, String shipType, double supplyTotalNum) { |
| | | if (OIL_SUPPLY_TYPE.equals(supplyType)) {//è¡¥ç»æ²¹æ |
| | | for (int i = 0; i < SHIP_TYPE.length; i++) { |
| | | if (shipType.equals(SHIP_TYPE[i])) { |
| | | return (int) Math.ceil(supplyTotalNum / OIL_UNIT_NUM * OIL_USE_TIME[i]); |
| | | } |
| | | } |
| | | } else if (MISSILE_SUPPLY_TYPE.equals(supplyType)) {//è¡¥ç»DY |
| | | for (int i = 0; i < SHIP_TYPE.length; i++) { |
| | | if (shipType.equals(SHIP_TYPE[i])) { |
| | | return (int) Math.ceil(supplyTotalNum / MISSILE_UNIT_NUM * MISSILE_USE_TIME[i]); |
| | | } |
| | | } |
| | | } else if (GOODS_SUPPLY_TYPE.equals(supplyType)) {//è¡¥ç»ç©èµ |
| | | for (int i = 0; i < SHIP_TYPE.length; i++) { |
| | | if (shipType.equals(SHIP_TYPE[i])) { |
| | | return (int) Math.ceil(supplyTotalNum / GOODS_UNIT_NUM * GOODS_USE_TIME[i]); |
| | | } |
| | | } |
| | | } else if (WATER_SUPPLY_TYPE.equals(supplyType)) {//è¡¥ç»æ·¡æ°´ |
| | | for (int i = 0; i < SHIP_TYPE.length; i++) { |
| | | if (shipType.equals(SHIP_TYPE[i])) { |
| | | return (int) Math.ceil(supplyTotalNum / WATER_UNIT_NUM * WATER_USE_TIME[i]); |
| | | } |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Operation(description = "ä¿®æ¹è°è¹è¡¥ç»é¡ºåº") |
| | | @Log(title = "ä¿®æ¹è°è¹è¡¥ç»é¡ºåº", businessType = BusinessType.INSERT) |
| | | @PostMapping("/changeSupplySeq") |
| | | @ResponseBody |
| | | public AjaxResult changeSupplySeqById(Long taskId, String shipNo, String supplySeq) throws IOException, ParseException { |
| | | // æ´æ°DsTaskList2ä¸çSupplySeqå¼ |
| | | DsTaskList2 dsTaskList2 = new DsTaskList2(); |
| | | dsTaskList2.setTaskId(taskId); |
| | | dsTaskList2.setShipNo(shipNo); |
| | | List<DsTaskList2> dsTaskLists = dsTaskListService.selectDsTaskListList(dsTaskList2); |
| | | int result1 = -1; |
| | | if(dsTaskLists != null && dsTaskLists.size() >0){ |
| | | dsTaskList2.setPKID(dsTaskLists.get(0).getPKID()); |
| | | dsTaskList2.setSupplySeq(supplySeq); |
| | | result1 = dsTaskListService.updateDsTaskList(dsTaskList2); |
| | | log.debug("æ´æ°DsTaskList表ä¸çSupplySeqåæ®µç»æ =====ï¼ " + result1); |
| | | } |
| | | // æ´æ°DsTaskDetailä¸çSupplySeqå¼ |
| | | DsTaskDetail dsTaskDetail = new DsTaskDetail(); |
| | | dsTaskDetail.setTaskId(taskId); |
| | | dsTaskDetail.setShipNo(shipNo); |
| | | List<DsTaskDetail> dsTaskDetails = dsTaskDetailService.selectDsTaskDetailList(dsTaskDetail); |
| | | int result2 = -1; |
| | | if(dsTaskDetails != null && dsTaskDetails.size() >0){ |
| | | dsTaskDetail.setPKID(dsTaskDetails.get(0).getPKID()); |
| | | dsTaskDetail.setSupplySeq(supplySeq); |
| | | result2 = dsTaskDetailService.updateDsTaskDetail(dsTaskDetail); |
| | | log.debug("æ´æ°DsTaskDetail表ä¸çSupplySeqåæ®µç»æ =====ï¼ " + result2); |
| | | } |
| | | if (result2 >= 0 && result2 >= 0) { |
| | | return AjaxResult.success("è¡¥ç»é¡ºåºä¿®æ¹æå"); |
| | | } else { |
| | | return AjaxResult.error(-1, "è¡¥ç»é¡ºåºä¿®æ¹å¤±è´¥"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 卿å®çæ¥æï¼å符串ï¼ä¸å¢å æå®çå°æ¶æ°ã |
| | | * @param dateStr |
| | | * @param hours |
| | | * @return |
| | | * @throws ParseException |
| | | */ |
| | | private Date addHoursToDate(String dateStr, int hours) throws ParseException { |
| | | // å°è¾å
¥çæ¥æå符串解æä¸º Date 对象 |
| | | Date date = format.parse(dateStr); |
| | | // å建 Calendar å®ä¾å¹¶è®¾ç½®æ¥æ |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | // å¢å æå®çå°æ¶æ° |
| | | calendar.add(Calendar.HOUR_OF_DAY, hours); |
| | | // è·åå¢å å°æ¶æ°åç Date 对象 |
| | | return calendar.getTime(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * æ³ä½ä¿¡æ¯å¯¹è±¡ dm_berth |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | public class DmBerth2 extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long PKID; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String NAME; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long harborId; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String harborName; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long berthLen; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long DEPTH; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String STATUS; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long orderNum; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String delFlag; |
| | | |
| | | private Long deptId; |
| | | |
| | | private String path; |
| | | |
| | | public void setPKID(Long PKID) |
| | | { |
| | | this.PKID = PKID; |
| | | } |
| | | |
| | | public Long getPKID() |
| | | { |
| | | return PKID; |
| | | } |
| | | |
| | | public void setNAME(String NAME) |
| | | { |
| | | this.NAME = NAME; |
| | | } |
| | | |
| | | public String getNAME() |
| | | { |
| | | return NAME; |
| | | } |
| | | |
| | | public void setHarborId(Long harborId) |
| | | { |
| | | this.harborId = harborId; |
| | | } |
| | | |
| | | public Long getHarborId() |
| | | { |
| | | return harborId; |
| | | } |
| | | |
| | | public void setHarborName(String harborName) |
| | | { |
| | | this.harborName = harborName; |
| | | } |
| | | |
| | | public String getHarborName() |
| | | { |
| | | return harborName; |
| | | } |
| | | |
| | | public void setBerthLen(Long berthLen) |
| | | { |
| | | this.berthLen = berthLen; |
| | | } |
| | | |
| | | public Long getBerthLen() |
| | | { |
| | | return berthLen; |
| | | } |
| | | |
| | | public void setDEPTH(Long DEPTH) |
| | | { |
| | | this.DEPTH = DEPTH; |
| | | } |
| | | |
| | | public Long getDEPTH() |
| | | { |
| | | return DEPTH; |
| | | } |
| | | |
| | | public void setSTATUS(String STATUS) |
| | | { |
| | | this.STATUS = STATUS; |
| | | } |
| | | |
| | | public String getSTATUS() |
| | | { |
| | | return STATUS; |
| | | } |
| | | |
| | | public void setOrderNum(Long orderNum) |
| | | { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public Long getOrderNum() |
| | | { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "DmBerth2 =: {" + |
| | | "PKID=" + PKID + |
| | | ", NAME='" + NAME + '\'' + |
| | | ", harborId=" + harborId + |
| | | ", harborName='" + harborName + '\'' + |
| | | ", berthLen=" + berthLen + |
| | | ", DEPTH=" + DEPTH + |
| | | ", STATUS='" + STATUS + '\'' + |
| | | ", orderNum=" + orderNum + |
| | | ", delFlag='" + delFlag + '\'' + |
| | | ", deptId=" + deptId + |
| | | '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * è°é
é
置信æ¯å¯¹è±¡ dm_dd_config |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | public class DmDdConfig extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long PKID; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String TYPE; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String UNIT; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String shipType; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double TIME; |
| | | |
| | | public void setPKID(Long PKID) |
| | | { |
| | | this.PKID = PKID; |
| | | } |
| | | |
| | | public Long getPKID() |
| | | { |
| | | return PKID; |
| | | } |
| | | |
| | | public void setTYPE(String TYPE) |
| | | { |
| | | this.TYPE = TYPE; |
| | | } |
| | | |
| | | public String getTYPE() |
| | | { |
| | | return TYPE; |
| | | } |
| | | |
| | | public void setUNIT(String UNIT) |
| | | { |
| | | this.UNIT = UNIT; |
| | | } |
| | | |
| | | public String getUNIT() |
| | | { |
| | | return UNIT; |
| | | } |
| | | |
| | | public void setShipType(String shipType) |
| | | { |
| | | this.shipType = shipType; |
| | | } |
| | | |
| | | public String getShipType() |
| | | { |
| | | return shipType; |
| | | } |
| | | |
| | | public void setTIME(Double TIME) |
| | | { |
| | | this.TIME = TIME; |
| | | } |
| | | |
| | | public Double getTIME() |
| | | { |
| | | return TIME; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("PKID", getPKID()) |
| | | .append("TYPE", getTYPE()) |
| | | .append("UNIT", getUNIT()) |
| | | .append("shipType", getShipType()) |
| | | .append("TIME", getTIME()) |
| | | .append("REMARK", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * 港å£ä¿¡æ¯å¯¹è±¡ dm_harbor |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | public class DmHarbor2 extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long PKID; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String harborName; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long deptId; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String deptName; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long berthNo; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Float oilB; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Float oilG; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Float oilA; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long ammoD; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long ammoP; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long ammoS; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String delFlag; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String DOCKNAME; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Float WATER; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Float MATERIAL; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long ammoO; |
| | | |
| | | private Integer vehicleCount; // VEHICLE_COUNT |
| | | |
| | | private String roadConditions; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double draft; |
| | | |
| | | @JsonIgnore |
| | | private Double allocatedOilA; |
| | | |
| | | @JsonIgnore |
| | | private Integer allocatedShipCount; |
| | | |
| | | public void setPKID(Long PKID) |
| | | { |
| | | this.PKID = PKID; |
| | | } |
| | | |
| | | public Long getPKID() |
| | | { |
| | | return PKID; |
| | | } |
| | | |
| | | public String getHarborName() { |
| | | return harborName; |
| | | } |
| | | |
| | | public void setHarborName(String harborName) { |
| | | this.harborName = harborName; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) |
| | | { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public Long getDeptId() |
| | | { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptName(String deptName) |
| | | { |
| | | this.deptName = deptName; |
| | | } |
| | | |
| | | public String getDeptName() |
| | | { |
| | | return deptName; |
| | | } |
| | | |
| | | public void setBerthNo(Long berthNo) |
| | | { |
| | | this.berthNo = berthNo; |
| | | } |
| | | |
| | | public Long getBerthNo() |
| | | { |
| | | return berthNo; |
| | | } |
| | | |
| | | public void setOilB(Float oilB) |
| | | { |
| | | this.oilB = oilB; |
| | | } |
| | | |
| | | public Float getOilB() |
| | | { |
| | | return oilB; |
| | | } |
| | | |
| | | public void setOilG(Float oilG) |
| | | { |
| | | this.oilG = oilG; |
| | | } |
| | | |
| | | public Float getOilG() |
| | | { |
| | | return oilG; |
| | | } |
| | | |
| | | public void setOilA(Float oilA) |
| | | { |
| | | this.oilA = oilA; |
| | | } |
| | | |
| | | public Float getOilA() |
| | | { |
| | | return oilA; |
| | | } |
| | | |
| | | public void setAmmoD(Long ammoD) |
| | | { |
| | | this.ammoD = ammoD; |
| | | } |
| | | |
| | | public Long getAmmoD() |
| | | { |
| | | return ammoD; |
| | | } |
| | | |
| | | public void setAmmoP(Long ammoP) |
| | | { |
| | | this.ammoP = ammoP; |
| | | } |
| | | |
| | | public Long getAmmoP() |
| | | { |
| | | return ammoP; |
| | | } |
| | | |
| | | public void setAmmoS(Long ammoS) |
| | | { |
| | | this.ammoS = ammoS; |
| | | } |
| | | |
| | | public Long getAmmoS() |
| | | { |
| | | return ammoS; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDOCKNAME(String DOCKNAME) |
| | | { |
| | | this.DOCKNAME = DOCKNAME; |
| | | } |
| | | |
| | | public String getDOCKNAME() |
| | | { |
| | | return DOCKNAME; |
| | | } |
| | | |
| | | public void setWATER(Float WATER) |
| | | { |
| | | this.WATER = WATER; |
| | | } |
| | | |
| | | public Float getWATER() |
| | | { |
| | | return WATER; |
| | | } |
| | | |
| | | public void setMATERIAL(Float MATERIAL) |
| | | { |
| | | this.MATERIAL = MATERIAL; |
| | | } |
| | | |
| | | public Float getMATERIAL() |
| | | { |
| | | return MATERIAL; |
| | | } |
| | | |
| | | public void setAmmoO(Long ammoO) |
| | | { |
| | | this.ammoO = ammoO; |
| | | } |
| | | |
| | | public Long getAmmoO() |
| | | { |
| | | return ammoO; |
| | | } |
| | | |
| | | public Double getAllocatedOilA() { |
| | | return allocatedOilA; |
| | | } |
| | | |
| | | public void setAllocatedOilA(Double allocatedOilA) { |
| | | this.allocatedOilA = allocatedOilA; |
| | | } |
| | | |
| | | public Integer getAllocatedShipCount() { |
| | | return allocatedShipCount; |
| | | } |
| | | |
| | | public void setAllocatedShipCount(Integer allocatedShipCount) { |
| | | this.allocatedShipCount = allocatedShipCount; |
| | | } |
| | | |
| | | public Integer getVehicleCount() { |
| | | return vehicleCount; |
| | | } |
| | | |
| | | public void setVehicleCount(Integer vehicleCount) { |
| | | this.vehicleCount = vehicleCount; |
| | | } |
| | | |
| | | public String getRoadConditions() { |
| | | return roadConditions; |
| | | } |
| | | |
| | | public void setRoadConditions(String roadConditions) { |
| | | this.roadConditions = roadConditions; |
| | | } |
| | | |
| | | public Double getDraft() { |
| | | return draft; |
| | | } |
| | | |
| | | public void setDraft(Double draft) { |
| | | this.draft = draft; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("PKID", getPKID()) |
| | | .append("harborName", getHarborName()) |
| | | .append("deptId", getDeptId()) |
| | | .append("deptName", getDeptName()) |
| | | .append("berthNo", getBerthNo()) |
| | | .append("oilB", getOilB()) |
| | | .append("oilG", getOilG()) |
| | | .append("oilA", getOilA()) |
| | | .append("ammoD", getAmmoD()) |
| | | .append("ammoP", getAmmoP()) |
| | | .append("ammoS", getAmmoS()) |
| | | .append("REMARK", getRemark()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("DOCKNAME", getDOCKNAME()) |
| | | .append("WATER", getWATER()) |
| | | .append("MATERIAL", getMATERIAL()) |
| | | .append("ammoO", getAmmoO()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain; |
| | | |
| | | import java.math.BigDecimal; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * è°èä¿¡æ¯å¯¹è±¡ dm_warship |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | public class DmWarship extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String shipNo; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String shipType; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private BigDecimal TONNAGE; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private BigDecimal DRAFT; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String LEADER; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long STAFF; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String grpName; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long LEVEL; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private BigDecimal LAT; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private BigDecimal LON; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String delFlag; |
| | | |
| | | public void setShipNo(String shipNo) |
| | | { |
| | | this.shipNo = shipNo; |
| | | } |
| | | |
| | | public String getShipNo() |
| | | { |
| | | return shipNo; |
| | | } |
| | | |
| | | public void setShipType(String shipType) |
| | | { |
| | | this.shipType = shipType; |
| | | } |
| | | |
| | | public String getShipType() |
| | | { |
| | | return shipType; |
| | | } |
| | | |
| | | public void setTONNAGE(BigDecimal TONNAGE) |
| | | { |
| | | this.TONNAGE = TONNAGE; |
| | | } |
| | | |
| | | public BigDecimal getTONNAGE() |
| | | { |
| | | return TONNAGE; |
| | | } |
| | | |
| | | public void setDRAFT(BigDecimal DRAFT) |
| | | { |
| | | this.DRAFT = DRAFT; |
| | | } |
| | | |
| | | public BigDecimal getDraft() |
| | | { |
| | | return DRAFT; |
| | | } |
| | | |
| | | public void setLEADER(String LEADER) |
| | | { |
| | | this.LEADER = LEADER; |
| | | } |
| | | |
| | | public String getLEADER() |
| | | { |
| | | return LEADER; |
| | | } |
| | | |
| | | public void setSTAFF(Long STAFF) |
| | | { |
| | | this.STAFF = STAFF; |
| | | } |
| | | |
| | | public Long getSTAFF() |
| | | { |
| | | return STAFF; |
| | | } |
| | | |
| | | public void setGrpName(String grpName) |
| | | { |
| | | this.grpName = grpName; |
| | | } |
| | | |
| | | public String getGrpName() |
| | | { |
| | | return grpName; |
| | | } |
| | | |
| | | public void setLEVEL(Long LEVEL) |
| | | { |
| | | this.LEVEL = LEVEL; |
| | | } |
| | | |
| | | public Long getLEVEL() |
| | | { |
| | | return LEVEL; |
| | | } |
| | | |
| | | public void setLAT(BigDecimal LAT) |
| | | { |
| | | this.LAT = LAT; |
| | | } |
| | | |
| | | public BigDecimal getLAT() |
| | | { |
| | | return LAT; |
| | | } |
| | | |
| | | public void setLON(BigDecimal LON) |
| | | { |
| | | this.LON = LON; |
| | | } |
| | | |
| | | public BigDecimal getLON() |
| | | { |
| | | return LON; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("shipNo", getShipNo()) |
| | | .append("shipType", getShipType()) |
| | | .append("TONNAGE", getTONNAGE()) |
| | | .append("DRAFT", getDraft()) |
| | | .append("LEADER", getLEADER()) |
| | | .append("STAFF", getSTAFF()) |
| | | .append("grpName", getGrpName()) |
| | | .append("LEVEL", getLEVEL()) |
| | | .append("LAT", getLAT()) |
| | | .append("LON", getLON()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * è½æè¯ä¼°å¯¹è±¡ ds_effect_assess |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-24 |
| | | */ |
| | | public class DsEffectAssess extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long PKID; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long taskId; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double SCORE; |
| | | |
| | | private Long deptId; |
| | | // |
| | | // private String type; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String delFlag; |
| | | |
| | | private String type; |
| | | |
| | | public void setPKID(Long PKID) |
| | | { |
| | | this.PKID = PKID; |
| | | } |
| | | |
| | | public Long getPKID() |
| | | { |
| | | return PKID; |
| | | } |
| | | |
| | | public void setTaskId(Long taskId) |
| | | { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | public Long getTaskId() |
| | | { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setSCORE(Double SCORE) |
| | | { |
| | | this.SCORE = SCORE; |
| | | } |
| | | |
| | | public Double getSCORE() |
| | | { |
| | | return SCORE; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public DsEffectAssess(Long taskId, Double SCORE) { |
| | | this.taskId = taskId; |
| | | this.SCORE = SCORE; |
| | | } |
| | | |
| | | public DsEffectAssess() { |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("PKID", getPKID()) |
| | | .append("taskId", getTaskId()) |
| | | .append("SCORE", getSCORE()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("REMARK", getRemark()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain; |
| | | |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * è½æè¯ä¼°é¡¹è¯¦æ
对象 ds_effect_assess_list |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-24 |
| | | */ |
| | | public class DsEffectAssessHis extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long PKID; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long taskId; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String TYPE; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String delFlag; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String PLAN; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String ITEM; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String itemDetail; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String UNIT; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String CODE; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String NORMAL; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double WEIGHT; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String classifyIndex; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double classifyWeight; |
| | | |
| | | private Double val; |
| | | |
| | | private Long deptId; |
| | | |
| | | public void setPKID(Long PKID) |
| | | { |
| | | this.PKID = PKID; |
| | | } |
| | | |
| | | public Long getPKID() |
| | | { |
| | | return PKID; |
| | | } |
| | | |
| | | public Long getTaskId() { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setTaskId(Long taskId) { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | public void setTYPE(String TYPE) |
| | | { |
| | | this.TYPE = TYPE; |
| | | } |
| | | |
| | | public String getTYPE() |
| | | { |
| | | return TYPE; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setPLAN(String PLAN) |
| | | { |
| | | this.PLAN = PLAN; |
| | | } |
| | | |
| | | public String getPLAN() |
| | | { |
| | | return PLAN; |
| | | } |
| | | |
| | | public void setITEM(String ITEM) |
| | | { |
| | | this.ITEM = ITEM; |
| | | } |
| | | |
| | | public String getITEM() |
| | | { |
| | | return ITEM; |
| | | } |
| | | |
| | | public void setItemDetail(String itemDetail) |
| | | { |
| | | this.itemDetail = itemDetail; |
| | | } |
| | | |
| | | public String getItemDetail() |
| | | { |
| | | return itemDetail; |
| | | } |
| | | |
| | | public void setUNIT(String UNIT) |
| | | { |
| | | this.UNIT = UNIT; |
| | | } |
| | | |
| | | public String getUNIT() |
| | | { |
| | | return UNIT; |
| | | } |
| | | |
| | | public void setCODE(String CODE) |
| | | { |
| | | this.CODE = CODE; |
| | | } |
| | | |
| | | public String getCODE() |
| | | { |
| | | return CODE; |
| | | } |
| | | |
| | | public void setNORMAL(String NORMAL) |
| | | { |
| | | this.NORMAL = NORMAL; |
| | | } |
| | | |
| | | public String getNORMAL() |
| | | { |
| | | return NORMAL; |
| | | } |
| | | |
| | | public void setWEIGHT(Double WEIGHT) |
| | | { |
| | | this.WEIGHT = WEIGHT; |
| | | } |
| | | |
| | | public Double getWEIGHT() |
| | | { |
| | | return WEIGHT; |
| | | } |
| | | |
| | | public void setClassifyIndex(String classifyIndex) |
| | | { |
| | | this.classifyIndex = classifyIndex; |
| | | } |
| | | |
| | | public String getClassifyIndex() |
| | | { |
| | | return classifyIndex; |
| | | } |
| | | |
| | | public void setClassifyWeight(Double classifyWeight) |
| | | { |
| | | this.classifyWeight = classifyWeight; |
| | | } |
| | | |
| | | public Double getClassifyWeight() |
| | | { |
| | | return classifyWeight; |
| | | } |
| | | |
| | | public DsEffectAssessHis() { |
| | | } |
| | | |
| | | public Double getVal() { |
| | | return val; |
| | | } |
| | | |
| | | public void setVal(Double val) { |
| | | this.val = val; |
| | | } |
| | | |
| | | public DsEffectAssessHis(String TYPE, String CODE, Double val, Double WEIGHT, Double classifyWeight) { |
| | | this.TYPE = TYPE; |
| | | this.CODE = CODE; |
| | | this.val = val; |
| | | this.WEIGHT = WEIGHT; |
| | | this.classifyWeight = classifyWeight; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("PKID", getPKID()) |
| | | .append("taskId", getTaskId()) |
| | | .append("TYPE", getTYPE()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("REMARK", getRemark()) |
| | | .append("PLAN", getPLAN()) |
| | | .append("ITEM", getITEM()) |
| | | .append("itemDetail", getItemDetail()) |
| | | .append("UNIT", getUNIT()) |
| | | .append("CODE", getCODE()) |
| | | .append("NORMAL", getNORMAL()) |
| | | .append("WEIGHT", getWEIGHT()) |
| | | .append("classifyIndex", getClassifyIndex()) |
| | | .append("classifyWeight", getClassifyWeight()) |
| | | .toString(); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * è½æè¯ä¼°é¡¹è¯¦æ
对象 ds_effect_assess_list |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-24 |
| | | */ |
| | | public class DsEffectAssessList extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long PKID; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long assessId; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String TYPE; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String delFlag; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String PLAN; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String ITEM; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String itemDetail; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String UNIT; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String CODE; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String NORMAL; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double WEIGHT; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String classifyIndex; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double classifyWeight; |
| | | |
| | | private Double val; |
| | | |
| | | private Long deptId; |
| | | |
| | | public void setPKID(Long PKID) |
| | | { |
| | | this.PKID = PKID; |
| | | } |
| | | |
| | | public Long getPKID() |
| | | { |
| | | return PKID; |
| | | } |
| | | |
| | | public void setAssessId(Long assessId) |
| | | { |
| | | this.assessId = assessId; |
| | | } |
| | | |
| | | public Long getAssessId() |
| | | { |
| | | return assessId; |
| | | } |
| | | |
| | | public void setTYPE(String TYPE) |
| | | { |
| | | this.TYPE = TYPE; |
| | | } |
| | | |
| | | public String getTYPE() |
| | | { |
| | | return TYPE; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setPLAN(String PLAN) |
| | | { |
| | | this.PLAN = PLAN; |
| | | } |
| | | |
| | | public String getPLAN() |
| | | { |
| | | return PLAN; |
| | | } |
| | | |
| | | public void setITEM(String ITEM) |
| | | { |
| | | this.ITEM = ITEM; |
| | | } |
| | | |
| | | public String getITEM() |
| | | { |
| | | return ITEM; |
| | | } |
| | | |
| | | public void setItemDetail(String itemDetail) |
| | | { |
| | | this.itemDetail = itemDetail; |
| | | } |
| | | |
| | | public String getItemDetail() |
| | | { |
| | | return itemDetail; |
| | | } |
| | | |
| | | public void setUNIT(String UNIT) |
| | | { |
| | | this.UNIT = UNIT; |
| | | } |
| | | |
| | | public String getUNIT() |
| | | { |
| | | return UNIT; |
| | | } |
| | | |
| | | public void setCODE(String CODE) |
| | | { |
| | | this.CODE = CODE; |
| | | } |
| | | |
| | | public String getCODE() |
| | | { |
| | | return CODE; |
| | | } |
| | | |
| | | public void setNORMAL(String NORMAL) |
| | | { |
| | | this.NORMAL = NORMAL; |
| | | } |
| | | |
| | | public String getNORMAL() |
| | | { |
| | | return NORMAL; |
| | | } |
| | | |
| | | public void setWEIGHT(Double WEIGHT) |
| | | { |
| | | this.WEIGHT = WEIGHT; |
| | | } |
| | | |
| | | public Double getWEIGHT() |
| | | { |
| | | return WEIGHT; |
| | | } |
| | | |
| | | public void setClassifyIndex(String classifyIndex) |
| | | { |
| | | this.classifyIndex = classifyIndex; |
| | | } |
| | | |
| | | public String getClassifyIndex() |
| | | { |
| | | return classifyIndex; |
| | | } |
| | | |
| | | public void setClassifyWeight(Double classifyWeight) |
| | | { |
| | | this.classifyWeight = classifyWeight; |
| | | } |
| | | |
| | | public Double getClassifyWeight() |
| | | { |
| | | return classifyWeight; |
| | | } |
| | | |
| | | public DsEffectAssessList() { |
| | | } |
| | | |
| | | public Double getVal() { |
| | | return val; |
| | | } |
| | | |
| | | public void setVal(Double val) { |
| | | this.val = val; |
| | | } |
| | | |
| | | public DsEffectAssessList(String TYPE, String CODE, Double val, Double WEIGHT, Double classifyWeight) { |
| | | this.TYPE = TYPE; |
| | | this.CODE = CODE; |
| | | this.val = val; |
| | | this.WEIGHT = WEIGHT; |
| | | this.classifyWeight = classifyWeight; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("PKID", getPKID()) |
| | | .append("assessId", getAssessId()) |
| | | .append("TYPE", getTYPE()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("REMARK", getRemark()) |
| | | .append("PLAN", getPLAN()) |
| | | .append("ITEM", getITEM()) |
| | | .append("itemDetail", getItemDetail()) |
| | | .append("UNIT", getUNIT()) |
| | | .append("CODE", getCODE()) |
| | | .append("NORMAL", getNORMAL()) |
| | | .append("WEIGHT", getWEIGHT()) |
| | | .append("classifyIndex", getClassifyIndex()) |
| | | .append("classifyWeight", getClassifyWeight()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class DsMatDispatch2 extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Long id; |
| | | |
| | | private String resHarborId; |
| | | |
| | | private String resHarborName; |
| | | |
| | | private String desHarborId; |
| | | |
| | | private String desHarborName; |
| | | |
| | | private String content; |
| | | |
| | | private String status; |
| | | |
| | | private String applyBy; |
| | | |
| | | private Date applyTime; |
| | | |
| | | private String applyResult; |
| | | |
| | | private String applyContent; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getResHarborId() { |
| | | return resHarborId; |
| | | } |
| | | |
| | | public void setResHarborId(String resHarborId) { |
| | | this.resHarborId = resHarborId; |
| | | } |
| | | |
| | | public String getResHarborName() { |
| | | return resHarborName; |
| | | } |
| | | |
| | | public void setResHarborName(String resHarborName) { |
| | | this.resHarborName = resHarborName; |
| | | } |
| | | |
| | | public String getDesHarborId() { |
| | | return desHarborId; |
| | | } |
| | | |
| | | public void setDesHarborId(String desHarborId) { |
| | | this.desHarborId = desHarborId; |
| | | } |
| | | |
| | | public String getDesHarborName() { |
| | | return desHarborName; |
| | | } |
| | | |
| | | public void setDesHarborName(String desHarborName) { |
| | | this.desHarborName = desHarborName; |
| | | } |
| | | |
| | | public String getContent() { |
| | | return content; |
| | | } |
| | | |
| | | public void setContent(String content) { |
| | | this.content = content; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getApplyBy() { |
| | | return applyBy; |
| | | } |
| | | |
| | | public void setApplyBy(String applyBy) { |
| | | this.applyBy = applyBy; |
| | | } |
| | | |
| | | public Date getApplyTime() { |
| | | return applyTime; |
| | | } |
| | | |
| | | public void setApplyTime(Date applyTime) { |
| | | this.applyTime = applyTime; |
| | | } |
| | | |
| | | public String getApplyResult() { |
| | | return applyResult; |
| | | } |
| | | |
| | | public void setApplyResult(String applyResult) { |
| | | this.applyResult = applyResult; |
| | | } |
| | | |
| | | public String getApplyContent() { |
| | | return applyContent; |
| | | } |
| | | |
| | | public void setApplyContent(String applyContent) { |
| | | this.applyContent = applyContent; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * ä»»å¡ä¿¡æ¯å¯¹è±¡ ds_task |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | public class DsTask extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long PKID; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String NAME; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String TYPE; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String status; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String NOTES; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String delFlag; |
| | | |
| | | public void setPKID(Long PKID) |
| | | { |
| | | this.PKID = PKID; |
| | | } |
| | | |
| | | public Long getPKID() |
| | | { |
| | | return PKID; |
| | | } |
| | | |
| | | public void setNAME(String NAME) |
| | | { |
| | | this.NAME = NAME; |
| | | } |
| | | |
| | | public String getNAME() |
| | | { |
| | | return NAME; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public void setTYPE(String TYPE) |
| | | { |
| | | this.TYPE = TYPE; |
| | | } |
| | | |
| | | public String getTYPE() |
| | | { |
| | | return TYPE; |
| | | } |
| | | |
| | | public void setNOTES(String NOTES) |
| | | { |
| | | this.NOTES = NOTES; |
| | | } |
| | | |
| | | public String getNOTES() |
| | | { |
| | | return NOTES; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("PKID", getPKID()) |
| | | .append("NAME", getNAME()) |
| | | .append("TYPE", getTYPE()) |
| | | .append("NOTES", getNOTES()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * ä»»å¡è°é
详æ
ä¿¡æ¯å¯¹è±¡ ds_task_detail |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | public class DsTaskDetail extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long PKID; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long taskId; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long harborId; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String harborName; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long berthId; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String berthName; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String parkingType; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String shipNo; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String shipType; |
| | | |
| | | /** */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date STIME; |
| | | |
| | | /** */ |
| | | private Integer elecStime; |
| | | |
| | | /** */ |
| | | private Integer elecEtime; |
| | | |
| | | /** */ |
| | | private Integer waterStime; |
| | | |
| | | /** */ |
| | | private Integer waterEtime; |
| | | |
| | | /** */ |
| | | private Integer oilStime; |
| | | |
| | | /** */ |
| | | private Integer oilEtime; |
| | | |
| | | /** */ |
| | | private Integer ammoStime; |
| | | |
| | | /** */ |
| | | private Integer ammoEtime; |
| | | |
| | | /** */ |
| | | private Integer matStime; |
| | | |
| | | /** */ |
| | | private Integer matEtime; |
| | | |
| | | /** */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date ETIME; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Integer oilTime; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Integer ammoTime; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Integer matTime; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Integer waterTime; |
| | | |
| | | private Integer totalTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date t1; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String delFlag; |
| | | |
| | | private String supplySeq; |
| | | |
| | | private Integer carCount; |
| | | |
| | | private Integer oilApply; |
| | | |
| | | private Integer oilReady; |
| | | |
| | | private Integer ammoTest; |
| | | |
| | | private Integer ammoStart; |
| | | |
| | | private Double food; |
| | | |
| | | private Double foodW; |
| | | |
| | | private Double foodO; |
| | | |
| | | private Long workGrpId; |
| | | |
| | | private String workGrpName; |
| | | |
| | | private Long deptId; |
| | | |
| | | private Long workMatGrpId; |
| | | |
| | | private String workMatGrpName; |
| | | |
| | | private String path; |
| | | |
| | | public void setPKID(Long PKID) |
| | | { |
| | | this.PKID = PKID; |
| | | } |
| | | |
| | | public Long getPKID() |
| | | { |
| | | return PKID; |
| | | } |
| | | |
| | | public void setTaskId(Long taskId) |
| | | { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | public Long getTaskId() |
| | | { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setHarborId(Long harborId) |
| | | { |
| | | this.harborId = harborId; |
| | | } |
| | | |
| | | public Long getHarborId() |
| | | { |
| | | return harborId; |
| | | } |
| | | |
| | | public void setHarborName(String harborName) |
| | | { |
| | | this.harborName = harborName; |
| | | } |
| | | |
| | | public String getHarborName() |
| | | { |
| | | return harborName; |
| | | } |
| | | |
| | | public void setBerthId(Long berthId) |
| | | { |
| | | this.berthId = berthId; |
| | | } |
| | | |
| | | public Long getBerthId() |
| | | { |
| | | return berthId; |
| | | } |
| | | |
| | | public void setBerthName(String berthName) |
| | | { |
| | | this.berthName = berthName; |
| | | } |
| | | |
| | | public String getBerthName() |
| | | { |
| | | return berthName; |
| | | } |
| | | |
| | | public void setParkingType(String parkingType) |
| | | { |
| | | this.parkingType = parkingType; |
| | | } |
| | | |
| | | public String getParkingType() |
| | | { |
| | | return parkingType; |
| | | } |
| | | |
| | | public void setShipNo(String shipNo) |
| | | { |
| | | this.shipNo = shipNo; |
| | | } |
| | | |
| | | public String getShipNo() |
| | | { |
| | | return shipNo; |
| | | } |
| | | |
| | | public void setShipType(String shipType) |
| | | { |
| | | this.shipType = shipType; |
| | | } |
| | | |
| | | public String getShipType() |
| | | { |
| | | return shipType; |
| | | } |
| | | |
| | | public void setSTIME(Date STIME) |
| | | { |
| | | this.STIME = STIME; |
| | | } |
| | | |
| | | public Date getSTIME() |
| | | { |
| | | return STIME; |
| | | } |
| | | |
| | | public Integer getElecStime() { |
| | | return elecStime; |
| | | } |
| | | |
| | | public void setElecStime(Integer elecStime) { |
| | | this.elecStime = elecStime; |
| | | } |
| | | |
| | | public Integer getElecEtime() { |
| | | return elecEtime; |
| | | } |
| | | |
| | | public void setElecEtime(Integer elecEtime) { |
| | | this.elecEtime = elecEtime; |
| | | } |
| | | |
| | | public Integer getWaterStime() { |
| | | return waterStime; |
| | | } |
| | | |
| | | public void setWaterStime(Integer waterStime) { |
| | | this.waterStime = waterStime; |
| | | } |
| | | |
| | | public Integer getWaterEtime() { |
| | | return waterEtime; |
| | | } |
| | | |
| | | public void setWaterEtime(Integer waterEtime) { |
| | | this.waterEtime = waterEtime; |
| | | } |
| | | |
| | | public Integer getOilStime() { |
| | | return oilStime; |
| | | } |
| | | |
| | | public void setOilStime(Integer oilStime) { |
| | | this.oilStime = oilStime; |
| | | } |
| | | |
| | | public Integer getOilEtime() { |
| | | return oilEtime; |
| | | } |
| | | |
| | | public void setOilEtime(Integer oilEtime) { |
| | | this.oilEtime = oilEtime; |
| | | } |
| | | |
| | | public Integer getAmmoStime() { |
| | | return ammoStime; |
| | | } |
| | | |
| | | public void setAmmoStime(Integer ammoStime) { |
| | | this.ammoStime = ammoStime; |
| | | } |
| | | |
| | | public Integer getAmmoEtime() { |
| | | return ammoEtime; |
| | | } |
| | | |
| | | public void setAmmoEtime(Integer ammoEtime) { |
| | | this.ammoEtime = ammoEtime; |
| | | } |
| | | |
| | | public Integer getMatStime() { |
| | | return matStime; |
| | | } |
| | | |
| | | public void setMatStime(Integer matStime) { |
| | | this.matStime = matStime; |
| | | } |
| | | |
| | | public Integer getMatEtime() { |
| | | return matEtime; |
| | | } |
| | | |
| | | public void setMatEtime(Integer matEtime) { |
| | | this.matEtime = matEtime; |
| | | } |
| | | |
| | | public void setETIME(Date ETIME) |
| | | { |
| | | this.ETIME = ETIME; |
| | | } |
| | | |
| | | public Date getETIME() |
| | | { |
| | | return ETIME; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public Date getT1() { |
| | | return t1; |
| | | } |
| | | |
| | | public void setT1(Date t1) { |
| | | this.t1 = t1; |
| | | } |
| | | |
| | | public String getSupplySeq() { |
| | | return supplySeq; |
| | | } |
| | | |
| | | public void setSupplySeq(String supplySeq) { |
| | | this.supplySeq = supplySeq; |
| | | } |
| | | |
| | | public Integer getCarCount() { |
| | | return carCount; |
| | | } |
| | | |
| | | public void setCarCount(Integer carCount) { |
| | | this.carCount = carCount; |
| | | } |
| | | |
| | | public Double getFood() { |
| | | return food; |
| | | } |
| | | |
| | | public Integer getOilTime() { |
| | | return oilTime; |
| | | } |
| | | |
| | | public void setOilTime(Integer oilTime) { |
| | | this.oilTime = oilTime; |
| | | } |
| | | |
| | | public Integer getAmmoTime() { |
| | | return ammoTime; |
| | | } |
| | | |
| | | public void setAmmoTime(Integer ammoTime) { |
| | | this.ammoTime = ammoTime; |
| | | } |
| | | |
| | | public Integer getMatTime() { |
| | | return matTime; |
| | | } |
| | | |
| | | public void setMatTime(Integer matTime) { |
| | | this.matTime = matTime; |
| | | } |
| | | |
| | | public Integer getWaterTime() { |
| | | return waterTime; |
| | | } |
| | | |
| | | public void setWaterTime(Integer waterTime) { |
| | | this.waterTime = waterTime; |
| | | } |
| | | |
| | | public Integer getTotalTime() { |
| | | return totalTime; |
| | | } |
| | | |
| | | public void setTotalTime(Integer totalTime) { |
| | | this.totalTime = totalTime; |
| | | } |
| | | |
| | | public Integer getOilApply() { |
| | | return oilApply; |
| | | } |
| | | |
| | | public void setOilApply(Integer oilApply) { |
| | | this.oilApply = oilApply; |
| | | } |
| | | |
| | | public Integer getOilReady() { |
| | | return oilReady; |
| | | } |
| | | |
| | | public void setOilReady(Integer oilReady) { |
| | | this.oilReady = oilReady; |
| | | } |
| | | |
| | | public Integer getAmmoTest() { |
| | | return ammoTest; |
| | | } |
| | | |
| | | public void setAmmoTest(Integer ammoTest) { |
| | | this.ammoTest = ammoTest; |
| | | } |
| | | |
| | | public Integer getAmmoStart() { |
| | | return ammoStart; |
| | | } |
| | | |
| | | public void setAmmoStart(Integer ammoStart) { |
| | | this.ammoStart = ammoStart; |
| | | } |
| | | |
| | | public void setFood(Double food) { |
| | | this.food = food; |
| | | } |
| | | |
| | | public Double getFoodW() { |
| | | return foodW; |
| | | } |
| | | |
| | | public void setFoodW(Double foodW) { |
| | | this.foodW = foodW; |
| | | } |
| | | |
| | | public Double getFoodO() { |
| | | return foodO; |
| | | } |
| | | |
| | | public void setFoodO(Double foodO) { |
| | | this.foodO = foodO; |
| | | } |
| | | |
| | | public Long getWorkGrpId() { |
| | | return workGrpId; |
| | | } |
| | | |
| | | public void setWorkGrpId(Long workGrpId) { |
| | | this.workGrpId = workGrpId; |
| | | } |
| | | |
| | | public String getWorkGrpName() { |
| | | return workGrpName; |
| | | } |
| | | |
| | | public void setWorkGrpName(String workGrpName) { |
| | | this.workGrpName = workGrpName; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public Long getWorkMatGrpId() { |
| | | return workMatGrpId; |
| | | } |
| | | |
| | | public void setWorkMatGrpId(Long workMatGrpId) { |
| | | this.workMatGrpId = workMatGrpId; |
| | | } |
| | | |
| | | public String getWorkMatGrpName() { |
| | | return workMatGrpName; |
| | | } |
| | | |
| | | public void setWorkMatGrpName(String workMatGrpName) { |
| | | this.workMatGrpName = workMatGrpName; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("PKID", getPKID()) |
| | | .append("taskId", getTaskId()) |
| | | .append("harborId", getHarborId()) |
| | | .append("harborName", getHarborName()) |
| | | .append("berthId", getBerthId()) |
| | | .append("berthName", getBerthName()) |
| | | .append("parkingType", getParkingType()) |
| | | .append("shipNo", getShipNo()) |
| | | .append("shipType", getShipType()) |
| | | .append("STIME", getSTIME()) |
| | | .append("elecStime", getElecStime()) |
| | | .append("elecEtime", getElecEtime()) |
| | | .append("waterStime", getWaterStime()) |
| | | .append("waterEtime", getWaterEtime()) |
| | | .append("oilStime", getOilStime()) |
| | | .append("oilEtime", getOilEtime()) |
| | | .append("ammoStime", getAmmoStime()) |
| | | .append("ammoEtime", getAmmoEtime()) |
| | | .append("matStime", getMatStime()) |
| | | .append("matEtime", getMatEtime()) |
| | | .append("ETIME", getETIME()) |
| | | .append("delFlag", getDelFlag()) |
| | | .append("createBy", getCreateBy()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateBy", getUpdateBy()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("deptId", getDeptId()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * ä»»å¡å表信æ¯å¯¹è±¡ ds_task_list |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | public class DsTaskList2 extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long PKID; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long taskId; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String shipNo; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String shipType; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double TONNAGE; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double draft; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String LEADER; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long STAFF; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String grpName; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long LEVEL; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double LAT; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double LON; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String delFlag; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double oilB; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double oilG; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double oilA; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long ammoD; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long ammoP; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long ammoS; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long ammoO; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double WATER; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Double waterP; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long FOOD; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long foodW; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long foodO; |
| | | |
| | | /** */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date pSTime; |
| | | |
| | | /** */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date pETime; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String status; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long harborId; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String harborName; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private Long berthId; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String berthName; |
| | | |
| | | /** */ |
| | | @Excel(name = "") |
| | | private String parkingType; |
| | | |
| | | private String deptName; |
| | | |
| | | private Long deptId; |
| | | |
| | | private String posArea; |
| | | |
| | | private Double width; |
| | | |
| | | private String supplySeq; |
| | | |
| | | private Double dockTime; |
| | | |
| | | private Double shipLen; |
| | | |
| | | private int dockIndex; |
| | | |
| | | private Date tTime; |
| | | |
| | | private String path; |
| | | |
| | | public int getDockIndex() { |
| | | return dockIndex; |
| | | } |
| | | |
| | | public void setDockIndex(int dockIndex) { |
| | | this.dockIndex = dockIndex; |
| | | } |
| | | |
| | | public Date gettTime() { |
| | | return tTime; |
| | | } |
| | | |
| | | public void settTime(Date tTime) { |
| | | this.tTime = tTime; |
| | | } |
| | | |
| | | public boolean needRefueling() { |
| | | return oilB > 0 || oilG > 0 || oilA > 0; |
| | | } |
| | | |
| | | public Double getShipLen() { |
| | | return shipLen; |
| | | } |
| | | |
| | | public void setShipLen(Double shipLen) { |
| | | this.shipLen = shipLen; |
| | | } |
| | | |
| | | public Double getDockTime() { |
| | | return dockTime; |
| | | } |
| | | |
| | | public void setDockTime(Double dockTime) { |
| | | this.dockTime = dockTime; |
| | | } |
| | | |
| | | public void setTaskId(Long taskId) |
| | | { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | public Long getTaskId() |
| | | { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setShipNo(String shipNo) |
| | | { |
| | | this.shipNo = shipNo; |
| | | } |
| | | |
| | | public String getShipNo() |
| | | { |
| | | return shipNo; |
| | | } |
| | | |
| | | public void setShipType(String shipType) |
| | | { |
| | | this.shipType = shipType; |
| | | } |
| | | |
| | | public String getShipType() |
| | | { |
| | | return shipType; |
| | | } |
| | | |
| | | public void setTONNAGE(Double TONNAGE) |
| | | { |
| | | this.TONNAGE = TONNAGE; |
| | | } |
| | | |
| | | public Double getTONNAGE() |
| | | { |
| | | return TONNAGE; |
| | | } |
| | | |
| | | public void setLEADER(String LEADER) |
| | | { |
| | | this.LEADER = LEADER; |
| | | } |
| | | |
| | | public String getLEADER() |
| | | { |
| | | return LEADER; |
| | | } |
| | | |
| | | public void setSTAFF(Long STAFF) |
| | | { |
| | | this.STAFF = STAFF; |
| | | } |
| | | |
| | | public Long getSTAFF() |
| | | { |
| | | return STAFF; |
| | | } |
| | | |
| | | public void setGrpName(String grpName) |
| | | { |
| | | this.grpName = grpName; |
| | | } |
| | | |
| | | public String getGrpName() |
| | | { |
| | | return grpName; |
| | | } |
| | | |
| | | public void setLEVEL(Long LEVEL) |
| | | { |
| | | this.LEVEL = LEVEL; |
| | | } |
| | | |
| | | public Long getLEVEL() |
| | | { |
| | | return LEVEL; |
| | | } |
| | | |
| | | public void setLAT(Double LAT) |
| | | { |
| | | this.LAT = LAT; |
| | | } |
| | | |
| | | public Double getLAT() |
| | | { |
| | | return LAT; |
| | | } |
| | | |
| | | public void setLON(Double LON) |
| | | { |
| | | this.LON = LON; |
| | | } |
| | | |
| | | public Double getLON() |
| | | { |
| | | return LON; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) |
| | | { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getDelFlag() |
| | | { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setOilB(Double oilB) |
| | | { |
| | | this.oilB = oilB; |
| | | } |
| | | |
| | | public Double getOilB() |
| | | { |
| | | return oilB; |
| | | } |
| | | |
| | | public void setOilG(Double oilG) |
| | | { |
| | | this.oilG = oilG; |
| | | } |
| | | |
| | | public Double getOilG() |
| | | { |
| | | return oilG; |
| | | } |
| | | |
| | | public void setOilA(Double oilA) |
| | | { |
| | | this.oilA = oilA; |
| | | } |
| | | |
| | | public Double getOilA() |
| | | { |
| | | return oilA; |
| | | } |
| | | |
| | | public void setAmmoD(Long ammoD) |
| | | { |
| | | this.ammoD = ammoD; |
| | | } |
| | | |
| | | public Long getAmmoD() |
| | | { |
| | | return ammoD; |
| | | } |
| | | |
| | | public void setAmmoP(Long ammoP) |
| | | { |
| | | this.ammoP = ammoP; |
| | | } |
| | | |
| | | public Long getAmmoP() |
| | | { |
| | | return ammoP; |
| | | } |
| | | |
| | | public void setAmmoS(Long ammoS) |
| | | { |
| | | this.ammoS = ammoS; |
| | | } |
| | | |
| | | public Long getAmmoS() |
| | | { |
| | | return ammoS; |
| | | } |
| | | |
| | | public void setAmmoO(Long ammoO) |
| | | { |
| | | this.ammoO = ammoO; |
| | | } |
| | | |
| | | public Long getAmmoO() |
| | | { |
| | | return ammoO; |
| | | } |
| | | |
| | | public void setWATER(Double WATER) |
| | | { |
| | | this.WATER = WATER; |
| | | } |
| | | |
| | | public Double getWATER() |
| | | { |
| | | return WATER; |
| | | } |
| | | |
| | | public void setWaterP(Double waterP) |
| | | { |
| | | this.waterP = waterP; |
| | | } |
| | | |
| | | public Double getWaterP() |
| | | { |
| | | return waterP; |
| | | } |
| | | |
| | | public void setFOOD(Long FOOD) |
| | | { |
| | | this.FOOD = FOOD; |
| | | } |
| | | |
| | | public Long getFOOD() |
| | | { |
| | | return FOOD; |
| | | } |
| | | |
| | | public void setFoodW(Long foodW) |
| | | { |
| | | this.foodW = foodW; |
| | | } |
| | | |
| | | public Long getFoodW() |
| | | { |
| | | return foodW; |
| | | } |
| | | |
| | | public void setFoodO(Long foodO) |
| | | { |
| | | this.foodO = foodO; |
| | | } |
| | | |
| | | public Long getFoodO() |
| | | { |
| | | return foodO; |
| | | } |
| | | |
| | | public void setpSTime(Date pSTime) |
| | | { |
| | | this.pSTime = pSTime; |
| | | } |
| | | |
| | | public Date getpSTime() |
| | | { |
| | | return pSTime; |
| | | } |
| | | |
| | | public void setpETime(Date pETime) |
| | | { |
| | | this.pETime = pETime; |
| | | } |
| | | |
| | | public Date getpETime() |
| | | { |
| | | return pETime; |
| | | } |
| | | |
| | | public void setHarborId(Long harborId) |
| | | { |
| | | this.harborId = harborId; |
| | | } |
| | | |
| | | public Long getHarborId() |
| | | { |
| | | return harborId; |
| | | } |
| | | |
| | | public void setHarborName(String harborName) |
| | | { |
| | | this.harborName = harborName; |
| | | } |
| | | |
| | | public String getHarborName() |
| | | { |
| | | return harborName; |
| | | } |
| | | |
| | | public void setBerthId(Long berthId) |
| | | { |
| | | this.berthId = berthId; |
| | | } |
| | | |
| | | public Long getBerthId() |
| | | { |
| | | return berthId; |
| | | } |
| | | |
| | | public void setBerthName(String berthName) |
| | | { |
| | | this.berthName = berthName; |
| | | } |
| | | |
| | | public String getBerthName() |
| | | { |
| | | return berthName; |
| | | } |
| | | |
| | | public void setParkingType(String parkingType) |
| | | { |
| | | this.parkingType = parkingType; |
| | | } |
| | | |
| | | public String getParkingType() |
| | | { |
| | | return parkingType; |
| | | } |
| | | |
| | | public void setPKID(Long PKID) |
| | | { |
| | | this.PKID = PKID; |
| | | } |
| | | |
| | | public Long getPKID() |
| | | { |
| | | return PKID; |
| | | } |
| | | |
| | | public String getDeptName() { |
| | | return deptName; |
| | | } |
| | | |
| | | public void setDeptName(String deptName) { |
| | | this.deptName = deptName; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public String getPosArea() { |
| | | return posArea; |
| | | } |
| | | |
| | | public void setPosArea(String posArea) { |
| | | this.posArea = posArea; |
| | | } |
| | | |
| | | public Double getWidth() { |
| | | return width; |
| | | } |
| | | |
| | | public void setWidth(Double width) { |
| | | this.width = width; |
| | | } |
| | | |
| | | public String getSupplySeq() { |
| | | return supplySeq; |
| | | } |
| | | |
| | | public void setSupplySeq(String supplySeq) { |
| | | this.supplySeq = supplySeq; |
| | | } |
| | | |
| | | public Double getDraft() { |
| | | return draft; |
| | | } |
| | | |
| | | public void setDraft(Double draft) { |
| | | this.draft = draft; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "DsTaskList2 =: {" + |
| | | "PKID=" + PKID + |
| | | ", taskId=" + taskId + |
| | | ", shipNo='" + shipNo + '\'' + |
| | | ", shipType='" + shipType + '\'' + |
| | | ", TONNAGE=" + TONNAGE + |
| | | ", DRAFT=" + draft + |
| | | ", LEADER='" + LEADER + '\'' + |
| | | ", STAFF=" + STAFF + |
| | | ", grpName='" + grpName + '\'' + |
| | | ", LEVEL=" + LEVEL + |
| | | ", LAT=" + LAT + |
| | | ", LON=" + LON + |
| | | ", delFlag='" + delFlag + '\'' + |
| | | ", oilB=" + oilB + |
| | | ", oilG=" + oilG + |
| | | ", oilA=" + oilA + |
| | | ", ammoD=" + ammoD + |
| | | ", ammoP=" + ammoP + |
| | | ", ammoS=" + ammoS + |
| | | ", ammoO=" + ammoO + |
| | | ", WATER=" + WATER + |
| | | ", waterP=" + waterP + |
| | | ", FOOD=" + FOOD + |
| | | ", foodW=" + foodW + |
| | | ", foodO=" + foodO + |
| | | ", pSTime=" + pSTime + |
| | | ", pETime=" + pETime + |
| | | ", STATUS='" + status + '\'' + |
| | | ", harborId=" + harborId + |
| | | ", harborName='" + harborName + '\'' + |
| | | ", berthId=" + berthId + |
| | | ", berthName='" + berthName + '\'' + |
| | | ", parkingType='" + parkingType + '\'' + |
| | | ", deptName='" + deptName + '\'' + |
| | | ", deptId=" + deptId + |
| | | ", posArea='" + posArea + '\'' + |
| | | ", width=" + width + |
| | | ", supplySeq='" + supplySeq + '\'' + |
| | | ", dockTime=" + dockTime + |
| | | ", shipLen=" + shipLen + |
| | | ", dockIndex=" + dockIndex + |
| | | ", tTime=" + tTime + |
| | | '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Schema(name = "AllocBerthReqDTO", description = "æ³ä½åé
DTO") |
| | | public class AllocBerthReqDTO implements Serializable { |
| | | |
| | | @Schema(name = "berthids", description = "åé
çæ³ä½id,å¤ä¸ªæ³ä½ç¨éå·åé") |
| | | private String berthids; |
| | | |
| | | @Schema(name = "rule", description = "æ³ä½åé
çç¥") |
| | | private String rule; |
| | | |
| | | @Schema(name = "deptId", description = "éè¦è¿è¡åé
çé¨é¨ç¼ç ") |
| | | private Long deptId; |
| | | |
| | | @Schema(name = "taskId", description = "ä»»å¡ç¼å·") |
| | | private Long taskId; |
| | | |
| | | public String getBerthids() { |
| | | return berthids; |
| | | } |
| | | |
| | | public void setBerthids(String berthids) { |
| | | this.berthids = berthids; |
| | | } |
| | | |
| | | public String getRule() { |
| | | return rule; |
| | | } |
| | | |
| | | public void setRule(String rule) { |
| | | this.rule = rule; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public Long getTaskId() { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setTaskId(Long taskId) { |
| | | this.taskId = taskId; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Schema(name = "AllocBerthTimeReqDTO", description = "æ³ä½åé
DTO") |
| | | public class AllocBerthTimeReqDTO implements Serializable { |
| | | |
| | | @Schema(name = "rule", description = "æ³ä½åé
çç¥") |
| | | private String rule; |
| | | |
| | | @Schema(name = "deptId", description = "éè¦è¿è¡åé
çé¨é¨ç¼ç ") |
| | | private Long deptId; |
| | | |
| | | @Schema(name = "taskId", description = "ä»»å¡ç¼å·") |
| | | private Long taskId; |
| | | |
| | | public String getRule() { |
| | | return rule; |
| | | } |
| | | |
| | | public void setRule(String rule) { |
| | | this.rule = rule; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public Long getTaskId() { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setTaskId(Long taskId) { |
| | | this.taskId = taskId; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Schema(name = "AllocationReqDTO", description = "è°è港å£åé
DTO") |
| | | public class AllocationReqDTO implements Serializable { |
| | | |
| | | @Schema(name = "shipnos", description = "è°è è·å·å符串ï¼å¤ä¸ªç¨éå·åé",required=true) |
| | | private String shipnos; |
| | | |
| | | @Schema(name = "rule", description = "港å£åé
çç¥") |
| | | private String rule; |
| | | |
| | | @Schema(name = "harborids", description = "港å£ç¼ç å符串ï¼å¤ä¸ªç¨éå·åé") |
| | | private String harborids; |
| | | |
| | | public String getShipnos() { |
| | | return shipnos; |
| | | } |
| | | |
| | | public void setShipnos(String shipnos) { |
| | | this.shipnos = shipnos; |
| | | } |
| | | |
| | | public String getRule() { |
| | | return rule; |
| | | } |
| | | |
| | | public void setRule(String rule) { |
| | | this.rule = rule; |
| | | } |
| | | |
| | | public String getHarborids() { |
| | | return harborids; |
| | | } |
| | | |
| | | public void setHarborids(String harborids) { |
| | | this.harborids = harborids; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class DsTaskQueryParam implements Serializable { |
| | | |
| | | private String name; |
| | | private String type; |
| | | private String status; |
| | | private String notes; |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date stime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date etime; |
| | | private Long deptId; |
| | | |
| | | 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 getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getNotes() { |
| | | return notes; |
| | | } |
| | | |
| | | public void setNotes(String notes) { |
| | | this.notes = notes; |
| | | } |
| | | |
| | | public Date getStime() { |
| | | return stime; |
| | | } |
| | | |
| | | public void setStime(Date stime) { |
| | | this.stime = stime; |
| | | } |
| | | |
| | | public Date getEtime() { |
| | | return etime; |
| | | } |
| | | |
| | | public void setEtime(Date etime) { |
| | | this.etime = etime; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.dto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class ShipGroupDTO implements Serializable { |
| | | private String parkingType; |
| | | private List<TaskRecordList> dsTaskList; |
| | | |
| | | public String getParkingType() { |
| | | return parkingType; |
| | | } |
| | | |
| | | public void setParkingType(String parkingType) { |
| | | this.parkingType = parkingType; |
| | | } |
| | | |
| | | public List<TaskRecordList> getDsTaskList() { |
| | | return dsTaskList; |
| | | } |
| | | |
| | | public void setDsTaskList(List<TaskRecordList> dsTaskList) { |
| | | this.dsTaskList = dsTaskList; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ShipGroupDTO =ï¼{" + |
| | | "parkingType='" + parkingType + '\'' + |
| | | ", taskRecordList=" + dsTaskList + |
| | | '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.dto; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class Subdata implements Serializable { |
| | | private Long pkId; |
| | | private Long taskId; |
| | | private String shipNo; |
| | | private String shipType; |
| | | private String tonnage; |
| | | private String supplySeq; |
| | | private Long oilB; |
| | | private Long oilG; |
| | | private Long oilA; |
| | | private Long ammoD; |
| | | private Long ammoP; |
| | | private Long ammoS; |
| | | private Long ammoO; |
| | | private Long water; |
| | | private Long waterP; |
| | | private Long food; |
| | | private Long foodW; |
| | | private Long foodO; |
| | | private String pSTime; |
| | | private String pETime; |
| | | |
| | | public Long getPkId() { |
| | | return pkId; |
| | | } |
| | | |
| | | public void setPkId(Long pkId) { |
| | | this.pkId = pkId; |
| | | } |
| | | |
| | | public Long getTaskId() { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setTaskId(Long taskId) { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | public String getShipNo() { |
| | | return shipNo; |
| | | } |
| | | |
| | | public void setShipNo(String shipNo) { |
| | | this.shipNo = shipNo; |
| | | } |
| | | |
| | | public String getShipType() { |
| | | return shipType; |
| | | } |
| | | |
| | | public void setShipType(String shipType) { |
| | | this.shipType = shipType; |
| | | } |
| | | |
| | | public String getTonnage() { |
| | | return tonnage; |
| | | } |
| | | |
| | | public void setTonnage(String tonnage) { |
| | | this.tonnage = tonnage; |
| | | } |
| | | |
| | | public String getSupplySeq() { |
| | | return supplySeq; |
| | | } |
| | | |
| | | public void setSupplySeq(String supplySeq) { |
| | | this.supplySeq = supplySeq; |
| | | } |
| | | |
| | | public Long getOilB() { |
| | | return oilB; |
| | | } |
| | | |
| | | public void setOilB(Long oilB) { |
| | | this.oilB = oilB; |
| | | } |
| | | |
| | | public Long getOilG() { |
| | | return oilG; |
| | | } |
| | | |
| | | public void setOilG(Long oilG) { |
| | | this.oilG = oilG; |
| | | } |
| | | |
| | | public Long getOilA() { |
| | | return oilA; |
| | | } |
| | | |
| | | public void setOilA(Long oilA) { |
| | | this.oilA = oilA; |
| | | } |
| | | |
| | | public Long getAmmoD() { |
| | | return ammoD; |
| | | } |
| | | |
| | | public void setAmmoD(Long ammoD) { |
| | | this.ammoD = ammoD; |
| | | } |
| | | |
| | | public Long getAmmoP() { |
| | | return ammoP; |
| | | } |
| | | |
| | | public void setAmmoP(Long ammoP) { |
| | | this.ammoP = ammoP; |
| | | } |
| | | |
| | | public Long getAmmoS() { |
| | | return ammoS; |
| | | } |
| | | |
| | | public void setAmmoS(Long ammoS) { |
| | | this.ammoS = ammoS; |
| | | } |
| | | |
| | | public Long getAmmoO() { |
| | | return ammoO; |
| | | } |
| | | |
| | | public void setAmmoO(Long ammoO) { |
| | | this.ammoO = ammoO; |
| | | } |
| | | |
| | | public Long getWater() { |
| | | return water; |
| | | } |
| | | |
| | | public void setWater(Long water) { |
| | | this.water = water; |
| | | } |
| | | |
| | | public Long getWaterP() { |
| | | return waterP; |
| | | } |
| | | |
| | | public void setWaterP(Long waterP) { |
| | | this.waterP = waterP; |
| | | } |
| | | |
| | | public Long getFood() { |
| | | return food; |
| | | } |
| | | |
| | | public void setFood(Long food) { |
| | | this.food = food; |
| | | } |
| | | |
| | | public Long getFoodW() { |
| | | return foodW; |
| | | } |
| | | |
| | | public void setFoodW(Long foodW) { |
| | | this.foodW = foodW; |
| | | } |
| | | |
| | | public Long getFoodO() { |
| | | return foodO; |
| | | } |
| | | |
| | | public void setFoodO(Long foodO) { |
| | | this.foodO = foodO; |
| | | } |
| | | |
| | | public String getpSTime() { |
| | | return pSTime; |
| | | } |
| | | |
| | | public void setpSTime(String pSTime) { |
| | | this.pSTime = pSTime; |
| | | } |
| | | |
| | | public String getpETime() { |
| | | return pETime; |
| | | } |
| | | |
| | | public void setpETime(String pETime) { |
| | | this.pETime = pETime; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Subdata =: {" + |
| | | "pkId=" + pkId + |
| | | ", taskId='" + taskId + '\'' + |
| | | ", shipNo='" + shipNo + '\'' + |
| | | ", shipType='" + shipType + '\'' + |
| | | ", tonnage='" + tonnage + '\'' + |
| | | ", supplySeq='" + supplySeq + '\'' + |
| | | ", oilB=" + oilB + |
| | | ", oilG=" + oilG + |
| | | ", oilA=" + oilA + |
| | | ", ammoD=" + ammoD + |
| | | ", ammoP=" + ammoP + |
| | | ", ammoS=" + ammoS + |
| | | ", ammoO=" + ammoO + |
| | | ", water=" + water + |
| | | ", waterP=" + waterP + |
| | | ", food=" + food + |
| | | ", foodW=" + foodW + |
| | | ", foodO=" + foodO + |
| | | ", pSTime='" + pSTime + '\'' + |
| | | ", pETime='" + pETime + '\'' + |
| | | '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.dto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class TaskQueryParam implements Serializable { |
| | | |
| | | private List<Long> ids; |
| | | |
| | | private Long deptId; |
| | | |
| | | private Long taskId; |
| | | |
| | | private String status; |
| | | |
| | | |
| | | public List<Long> getIds() { |
| | | return ids; |
| | | } |
| | | |
| | | public void setIds(List<Long> ids) { |
| | | this.ids = ids; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public Long getTaskId() { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setTaskId(Long taskId) { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | public String getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(String status) { |
| | | this.status = status; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.dto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class TaskRecordList implements Serializable { |
| | | private Long berthId; |
| | | private String berthName; |
| | | private Long harborId; |
| | | private String harborName; |
| | | private List<Subdata> subData; |
| | | |
| | | public Long getBerthId() { |
| | | return berthId; |
| | | } |
| | | |
| | | public void setBerthId(Long berthId) { |
| | | this.berthId = berthId; |
| | | } |
| | | |
| | | public String getBerthName() { |
| | | return berthName; |
| | | } |
| | | |
| | | public void setBerthName(String berthName) { |
| | | this.berthName = berthName; |
| | | } |
| | | |
| | | public Long getHarborId() { |
| | | return harborId; |
| | | } |
| | | |
| | | public void setHarborId(Long harborId) { |
| | | this.harborId = harborId; |
| | | } |
| | | |
| | | public String getHarborName() { |
| | | return harborName; |
| | | } |
| | | |
| | | public void setHarborName(String harborName) { |
| | | this.harborName = harborName; |
| | | } |
| | | |
| | | public List<Subdata> getSubData() { |
| | | return subData; |
| | | } |
| | | |
| | | public void setSubData(List<Subdata> subData) { |
| | | this.subData = subData; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TaskRecordList =: {" + |
| | | "berthId=" + berthId + |
| | | ", berthName='" + berthName + '\'' + |
| | | ", harborId=" + harborId + |
| | | ", harborName='" + harborName + '\'' + |
| | | ", subData=" + subData + |
| | | '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.dto; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class ZdGroupDTO implements Serializable { |
| | | |
| | | private String berthIds; |
| | | |
| | | private String berthGroupRule; |
| | | |
| | | private String taskId; |
| | | |
| | | public String getBerthIds() { |
| | | return berthIds; |
| | | } |
| | | |
| | | public void setBerthIds(String berthIds) { |
| | | this.berthIds = berthIds; |
| | | } |
| | | |
| | | public String getBerthGroupRule() { |
| | | return berthGroupRule; |
| | | } |
| | | |
| | | public void setBerthGroupRule(String berthGroupRule) { |
| | | this.berthGroupRule = berthGroupRule; |
| | | } |
| | | |
| | | public String getTaskId() { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setTaskId(String taskId) { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ZdGroupDTO =ï¼ {" + |
| | | "berthIds='" + berthIds + '\'' + |
| | | ", berthGroupRule='" + berthGroupRule + '\'' + |
| | | ", taskId='" + taskId + '\'' + |
| | | '}'; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.dto; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class ZdSupplyPlanDTO implements Serializable { |
| | | private Long taskId; |
| | | |
| | | private String t1Time; |
| | | |
| | | private String usedBerthIds; |
| | | |
| | | public Long getTaskId() { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setTaskId(Long taskId) { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | public String getT1Time() { |
| | | return t1Time; |
| | | } |
| | | |
| | | public void setT1Time(String t1Time) { |
| | | this.t1Time = t1Time; |
| | | } |
| | | |
| | | public String getUsedBerthIds() { |
| | | return usedBerthIds; |
| | | } |
| | | |
| | | public void setUsedBerthIds(String usedBerthIds) { |
| | | this.usedBerthIds = usedBerthIds; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.buss.domain.DsTaskDetail; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class DsTaskDetailVO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private Long PKID; |
| | | private Long taskId; |
| | | private Long harborId; |
| | | private String harborName; |
| | | private Long berthId; |
| | | private String berthName; |
| | | private String parkingType; |
| | | private String shipNo; |
| | | private String shipType; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date STIME; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date elecStime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date elecEtime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date waterStime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date waterEtime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date oilStime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date oilEtime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date ammoStime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date ammoEtime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date matStime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date matEtime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date ETIME; |
| | | |
| | | private Integer oilTime; |
| | | |
| | | private Integer ammoTime; |
| | | |
| | | private Integer matTime; |
| | | private Integer waterTime; |
| | | private Integer totalTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date t1; |
| | | |
| | | private String delFlag; |
| | | |
| | | private String supplySeq; |
| | | |
| | | private Integer carCount; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date oilApply; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date oilReady; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date ammoTest; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date ammoStart; |
| | | |
| | | private Double food; |
| | | |
| | | private Double foodW; |
| | | |
| | | private Double foodO; |
| | | |
| | | private Long workGrpId; |
| | | |
| | | private String workGrpName; |
| | | |
| | | private Long deptId; |
| | | |
| | | private Long workMatGrpId; |
| | | |
| | | private String workMatGrpName; |
| | | |
| | | public Long getPKID() { |
| | | return PKID; |
| | | } |
| | | |
| | | public void setPKID(Long PKID) { |
| | | this.PKID = PKID; |
| | | } |
| | | |
| | | public Long getTaskId() { |
| | | return taskId; |
| | | } |
| | | |
| | | public void setTaskId(Long taskId) { |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | public Long getHarborId() { |
| | | return harborId; |
| | | } |
| | | |
| | | public void setHarborId(Long harborId) { |
| | | this.harborId = harborId; |
| | | } |
| | | |
| | | public String getHarborName() { |
| | | return harborName; |
| | | } |
| | | |
| | | public void setHarborName(String harborName) { |
| | | this.harborName = harborName; |
| | | } |
| | | |
| | | public Long getBerthId() { |
| | | return berthId; |
| | | } |
| | | |
| | | public void setBerthId(Long berthId) { |
| | | this.berthId = berthId; |
| | | } |
| | | |
| | | public String getBerthName() { |
| | | return berthName; |
| | | } |
| | | |
| | | public void setBerthName(String berthName) { |
| | | this.berthName = berthName; |
| | | } |
| | | |
| | | public String getParkingType() { |
| | | return parkingType; |
| | | } |
| | | |
| | | public void setParkingType(String parkingType) { |
| | | this.parkingType = parkingType; |
| | | } |
| | | |
| | | public String getShipNo() { |
| | | return shipNo; |
| | | } |
| | | |
| | | public void setShipNo(String shipNo) { |
| | | this.shipNo = shipNo; |
| | | } |
| | | |
| | | public String getShipType() { |
| | | return shipType; |
| | | } |
| | | |
| | | public void setShipType(String shipType) { |
| | | this.shipType = shipType; |
| | | } |
| | | |
| | | public Date getSTIME() { |
| | | return STIME; |
| | | } |
| | | |
| | | public void setSTIME(Date STIME) { |
| | | this.STIME = STIME; |
| | | } |
| | | |
| | | public Date getElecStime() { |
| | | return elecStime; |
| | | } |
| | | |
| | | public void setElecStime(Date elecStime) { |
| | | this.elecStime = elecStime; |
| | | } |
| | | |
| | | public Date getElecEtime() { |
| | | return elecEtime; |
| | | } |
| | | |
| | | public void setElecEtime(Date elecEtime) { |
| | | this.elecEtime = elecEtime; |
| | | } |
| | | |
| | | public Date getWaterStime() { |
| | | return waterStime; |
| | | } |
| | | |
| | | public void setWaterStime(Date waterStime) { |
| | | this.waterStime = waterStime; |
| | | } |
| | | |
| | | public Date getWaterEtime() { |
| | | return waterEtime; |
| | | } |
| | | |
| | | public void setWaterEtime(Date waterEtime) { |
| | | this.waterEtime = waterEtime; |
| | | } |
| | | |
| | | public Date getOilStime() { |
| | | return oilStime; |
| | | } |
| | | |
| | | public void setOilStime(Date oilStime) { |
| | | this.oilStime = oilStime; |
| | | } |
| | | |
| | | public Date getOilEtime() { |
| | | return oilEtime; |
| | | } |
| | | |
| | | public void setOilEtime(Date oilEtime) { |
| | | this.oilEtime = oilEtime; |
| | | } |
| | | |
| | | public Date getAmmoStime() { |
| | | return ammoStime; |
| | | } |
| | | |
| | | public void setAmmoStime(Date ammoStime) { |
| | | this.ammoStime = ammoStime; |
| | | } |
| | | |
| | | public Date getAmmoEtime() { |
| | | return ammoEtime; |
| | | } |
| | | |
| | | public void setAmmoEtime(Date ammoEtime) { |
| | | this.ammoEtime = ammoEtime; |
| | | } |
| | | |
| | | public Date getMatStime() { |
| | | return matStime; |
| | | } |
| | | |
| | | public void setMatStime(Date matStime) { |
| | | this.matStime = matStime; |
| | | } |
| | | |
| | | public Date getMatEtime() { |
| | | return matEtime; |
| | | } |
| | | |
| | | public void setMatEtime(Date matEtime) { |
| | | this.matEtime = matEtime; |
| | | } |
| | | |
| | | public Date getETIME() { |
| | | return ETIME; |
| | | } |
| | | |
| | | public void setETIME(Date ETIME) { |
| | | this.ETIME = ETIME; |
| | | } |
| | | |
| | | public Integer getOilTime() { |
| | | return oilTime; |
| | | } |
| | | |
| | | public void setOilTime(Integer oilTime) { |
| | | this.oilTime = oilTime; |
| | | } |
| | | |
| | | public Integer getAmmoTime() { |
| | | return ammoTime; |
| | | } |
| | | |
| | | public void setAmmoTime(Integer ammoTime) { |
| | | this.ammoTime = ammoTime; |
| | | } |
| | | |
| | | public Integer getMatTime() { |
| | | return matTime; |
| | | } |
| | | |
| | | public void setMatTime(Integer matTime) { |
| | | this.matTime = matTime; |
| | | } |
| | | |
| | | public Integer getWaterTime() { |
| | | return waterTime; |
| | | } |
| | | |
| | | public void setWaterTime(Integer waterTime) { |
| | | this.waterTime = waterTime; |
| | | } |
| | | |
| | | public Integer getTotalTime() { |
| | | return totalTime; |
| | | } |
| | | |
| | | public void setTotalTime(Integer totalTime) { |
| | | this.totalTime = totalTime; |
| | | } |
| | | |
| | | public Date getT1() { |
| | | return t1; |
| | | } |
| | | |
| | | public void setT1(Date t1) { |
| | | this.t1 = t1; |
| | | } |
| | | |
| | | public String getDelFlag() { |
| | | return delFlag; |
| | | } |
| | | |
| | | public void setDelFlag(String delFlag) { |
| | | this.delFlag = delFlag; |
| | | } |
| | | |
| | | public String getSupplySeq() { |
| | | return supplySeq; |
| | | } |
| | | |
| | | public void setSupplySeq(String supplySeq) { |
| | | this.supplySeq = supplySeq; |
| | | } |
| | | |
| | | public Integer getCarCount() { |
| | | return carCount; |
| | | } |
| | | |
| | | public void setCarCount(Integer carCount) { |
| | | this.carCount = carCount; |
| | | } |
| | | |
| | | public Date getOilApply() { |
| | | return oilApply; |
| | | } |
| | | |
| | | public void setOilApply(Date oilApply) { |
| | | this.oilApply = oilApply; |
| | | } |
| | | |
| | | public Date getOilReady() { |
| | | return oilReady; |
| | | } |
| | | |
| | | public void setOilReady(Date oilReady) { |
| | | this.oilReady = oilReady; |
| | | } |
| | | |
| | | public Date getAmmoTest() { |
| | | return ammoTest; |
| | | } |
| | | |
| | | public void setAmmoTest(Date ammoTest) { |
| | | this.ammoTest = ammoTest; |
| | | } |
| | | |
| | | public Date getAmmoStart() { |
| | | return ammoStart; |
| | | } |
| | | |
| | | public void setAmmoStart(Date ammoStart) { |
| | | this.ammoStart = ammoStart; |
| | | } |
| | | |
| | | public Double getFood() { |
| | | return food; |
| | | } |
| | | |
| | | public void setFood(Double food) { |
| | | this.food = food; |
| | | } |
| | | |
| | | public Double getFoodW() { |
| | | return foodW; |
| | | } |
| | | |
| | | public void setFoodW(Double foodW) { |
| | | this.foodW = foodW; |
| | | } |
| | | |
| | | public Double getFoodO() { |
| | | return foodO; |
| | | } |
| | | |
| | | public void setFoodO(Double foodO) { |
| | | this.foodO = foodO; |
| | | } |
| | | |
| | | public Long getWorkGrpId() { |
| | | return workGrpId; |
| | | } |
| | | |
| | | public void setWorkGrpId(Long workGrpId) { |
| | | this.workGrpId = workGrpId; |
| | | } |
| | | |
| | | public String getWorkGrpName() { |
| | | return workGrpName; |
| | | } |
| | | |
| | | public void setWorkGrpName(String workGrpName) { |
| | | this.workGrpName = workGrpName; |
| | | } |
| | | |
| | | public Long getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Long deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public Long getWorkMatGrpId() { |
| | | return workMatGrpId; |
| | | } |
| | | |
| | | public void setWorkMatGrpId(Long workMatGrpId) { |
| | | this.workMatGrpId = workMatGrpId; |
| | | } |
| | | |
| | | public String getWorkMatGrpName() { |
| | | return workMatGrpName; |
| | | } |
| | | |
| | | public void setWorkMatGrpName(String workMatGrpName) { |
| | | this.workMatGrpName = workMatGrpName; |
| | | } |
| | | |
| | | public DsTaskDetailVO(Long PKID, Long taskId) { |
| | | this.PKID = PKID; |
| | | this.taskId = taskId; |
| | | } |
| | | |
| | | public DsTaskDetailVO(DsTaskDetail detail) { |
| | | this.PKID = detail.getPKID(); |
| | | this.taskId = detail.getTaskId(); |
| | | this.harborId = detail.getHarborId(); |
| | | this.harborName = detail.getHarborName(); |
| | | this.berthId = detail.getBerthId(); |
| | | this.berthName = detail.getBerthName(); |
| | | this.parkingType = detail.getParkingType(); |
| | | this.shipNo = detail.getShipNo(); |
| | | this.shipType = detail.getShipType(); |
| | | this.STIME = detail.getSTIME(); |
| | | |
| | | if (detail.getElecStime() != null) { |
| | | this.elecStime = new Date(detail.getT1().getTime() + detail.getElecStime() * 3600000); |
| | | } |
| | | if (detail.getElecEtime() != null) { |
| | | this.elecEtime = new Date(detail.getT1().getTime() + detail.getElecEtime() * 3600000); |
| | | } |
| | | if (detail.getWaterStime() != null) { |
| | | this.waterStime = new Date(detail.getT1().getTime() + detail.getWaterStime() * 3600000); |
| | | } |
| | | if (detail.getWaterEtime() != null) { |
| | | this.waterEtime = new Date(detail.getT1().getTime() + detail.getWaterEtime() * 3600000); |
| | | } |
| | | if (detail.getOilStime() != null) { |
| | | this.oilStime = new Date(detail.getT1().getTime() + detail.getOilStime() * 3600000); |
| | | } |
| | | if (detail.getOilEtime() != null) { |
| | | this.oilEtime = new Date(detail.getT1().getTime() + detail.getOilEtime() * 3600000); |
| | | } |
| | | if (detail.getAmmoStime() != null) { |
| | | this.ammoStime = new Date(detail.getT1().getTime() + detail.getAmmoStime() * 3600000); |
| | | } |
| | | if (detail.getAmmoEtime() != null) { |
| | | this.ammoEtime = new Date(detail.getT1().getTime() + detail.getAmmoEtime() * 3600000); |
| | | } |
| | | if (detail.getMatStime() != null) { |
| | | this.matStime = new Date(detail.getT1().getTime() + detail.getMatStime() * 3600000); |
| | | } |
| | | if (detail.getMatEtime() != null) { |
| | | this.matEtime = new Date(detail.getT1().getTime() + detail.getMatEtime() * 3600000); |
| | | } |
| | | this.ETIME = detail.getETIME(); |
| | | this.oilTime = detail.getOilTime(); |
| | | this.ammoTime = detail.getAmmoTime(); |
| | | this.matTime = detail.getMatTime(); |
| | | this.waterTime = detail.getWaterTime(); |
| | | this.totalTime = detail.getTotalTime(); |
| | | this.t1 = detail.getT1(); |
| | | this.delFlag = detail.getDelFlag(); |
| | | this.supplySeq = detail.getSupplySeq(); |
| | | this.carCount = detail.getCarCount(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.vo; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class MatReqVO implements Serializable { |
| | | |
| | | private String content; |
| | | |
| | | private String result; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.vo; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class RfIdVo implements Serializable { |
| | | |
| | | private Integer id; |
| | | private String name; |
| | | private String path; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getPath() { |
| | | return path; |
| | | } |
| | | |
| | | public void setPath(String path) { |
| | | this.path = path; |
| | | } |
| | | |
| | | public RfIdVo() { |
| | | } |
| | | |
| | | public RfIdVo(Integer id, String name, String path) { |
| | | this.id = id; |
| | | this.name = name; |
| | | this.path = path; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.vo; |
| | | |
| | | import com.ruoyi.buss.domain.DsEffectAssess; |
| | | import com.ruoyi.buss.domain.DsEffectAssessList; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class TaskAssess implements Serializable { |
| | | private DsEffectAssess assess; |
| | | private List<DsEffectAssessList> list; |
| | | |
| | | public DsEffectAssess getAssess() { |
| | | return assess; |
| | | } |
| | | |
| | | public void setAssess(DsEffectAssess assess) { |
| | | this.assess = assess; |
| | | } |
| | | |
| | | public List<DsEffectAssessList> getList() { |
| | | return list; |
| | | } |
| | | |
| | | public void setList(List<DsEffectAssessList> list) { |
| | | this.list = list; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.vo; |
| | | |
| | | import com.ruoyi.buss.domain.DsEffectAssess; |
| | | import com.ruoyi.buss.domain.DsEffectAssessHis; |
| | | import com.ruoyi.buss.domain.DsEffectAssessList; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class TaskAssessHis implements Serializable { |
| | | private DsEffectAssess assess; |
| | | private List<DsEffectAssessHis> list; |
| | | |
| | | public DsEffectAssess getAssess() { |
| | | return assess; |
| | | } |
| | | |
| | | public void setAssess(DsEffectAssess assess) { |
| | | this.assess = assess; |
| | | } |
| | | |
| | | public List<DsEffectAssessHis> getList() { |
| | | return list; |
| | | } |
| | | |
| | | public void setList(List<DsEffectAssessHis> list) { |
| | | this.list = list; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.vo; |
| | | |
| | | import com.ruoyi.buss.domain.DmHarbor2; |
| | | import com.ruoyi.buss.domain.DsTaskList2; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class TaskListStatis implements Serializable { |
| | | |
| | | private DmHarbor2 harbor; |
| | | |
| | | private List<DsTaskList2> tasks; |
| | | |
| | | private DsTaskList2 statis; |
| | | |
| | | public DmHarbor2 getHarbor() { |
| | | return harbor; |
| | | } |
| | | |
| | | public void setHarbor(DmHarbor2 harbor) { |
| | | this.harbor = harbor; |
| | | } |
| | | |
| | | public List<DsTaskList2> getTasks() { |
| | | return tasks; |
| | | } |
| | | |
| | | public void setTasks(List<DsTaskList2> tasks) { |
| | | this.tasks = tasks; |
| | | } |
| | | |
| | | public DsTaskList2 getStatis() { |
| | | return statis; |
| | | } |
| | | |
| | | public void setStatis(DsTaskList2 statis) { |
| | | this.statis = statis; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Schema(name = "TaskPlace", description = "ç 头åºå°ç»ç¹") |
| | | public class TaskPlace implements Serializable { |
| | | |
| | | private Long berthId; |
| | | |
| | | private String berthName; |
| | | |
| | | private String type; |
| | | |
| | | private Double t1; |
| | | |
| | | private Double t2; |
| | | |
| | | private Double t3; |
| | | |
| | | private Double t4; |
| | | |
| | | private Double t5; |
| | | |
| | | private Double t6; |
| | | |
| | | private Double t7; |
| | | |
| | | private Double t8; |
| | | |
| | | private Double t9; |
| | | |
| | | private Double t10; |
| | | |
| | | private Double t11; |
| | | |
| | | private Double t12; |
| | | |
| | | private Double t13; |
| | | |
| | | private Double t14; |
| | | |
| | | private Double t15; |
| | | |
| | | private Double t16; |
| | | |
| | | private Double t17; |
| | | |
| | | private Double t18; |
| | | |
| | | private Double t19; |
| | | |
| | | private Double t20; |
| | | |
| | | private Double t21; |
| | | |
| | | private Double t22; |
| | | |
| | | private Double t23; |
| | | |
| | | private Double t24; |
| | | |
| | | public Long getBerthId() { |
| | | return berthId; |
| | | } |
| | | |
| | | public void setBerthId(Long berthId) { |
| | | this.berthId = berthId; |
| | | } |
| | | |
| | | public String getBerthName() { |
| | | return berthName; |
| | | } |
| | | |
| | | public void setBerthName(String berthName) { |
| | | this.berthName = berthName; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Double getT1() { |
| | | return t1; |
| | | } |
| | | |
| | | public void setT1(Double t1) { |
| | | this.t1 = t1; |
| | | } |
| | | |
| | | public Double getT2() { |
| | | return t2; |
| | | } |
| | | |
| | | public void setT2(Double t2) { |
| | | this.t2 = t2; |
| | | } |
| | | |
| | | public Double getT3() { |
| | | return t3; |
| | | } |
| | | |
| | | public void setT3(Double t3) { |
| | | this.t3 = t3; |
| | | } |
| | | |
| | | public Double getT4() { |
| | | return t4; |
| | | } |
| | | |
| | | public void setT4(Double t4) { |
| | | this.t4 = t4; |
| | | } |
| | | |
| | | public Double getT5() { |
| | | return t5; |
| | | } |
| | | |
| | | public void setT5(Double t5) { |
| | | this.t5 = t5; |
| | | } |
| | | |
| | | public Double getT6() { |
| | | return t6; |
| | | } |
| | | |
| | | public void setT6(Double t6) { |
| | | this.t6 = t6; |
| | | } |
| | | |
| | | public Double getT7() { |
| | | return t7; |
| | | } |
| | | |
| | | public void setT7(Double t7) { |
| | | this.t7 = t7; |
| | | } |
| | | |
| | | public Double getT8() { |
| | | return t8; |
| | | } |
| | | |
| | | public void setT8(Double t8) { |
| | | this.t8 = t8; |
| | | } |
| | | |
| | | public Double getT9() { |
| | | return t9; |
| | | } |
| | | |
| | | public void setT9(Double t9) { |
| | | this.t9 = t9; |
| | | } |
| | | |
| | | public Double getT10() { |
| | | return t10; |
| | | } |
| | | |
| | | public void setT10(Double t10) { |
| | | this.t10 = t10; |
| | | } |
| | | |
| | | public Double getT11() { |
| | | return t11; |
| | | } |
| | | |
| | | public void setT11(Double t11) { |
| | | this.t11 = t11; |
| | | } |
| | | |
| | | public Double getT12() { |
| | | return t12; |
| | | } |
| | | |
| | | public void setT12(Double t12) { |
| | | this.t12 = t12; |
| | | } |
| | | |
| | | public Double getT13() { |
| | | return t13; |
| | | } |
| | | |
| | | public void setT13(Double t13) { |
| | | this.t13 = t13; |
| | | } |
| | | |
| | | public Double getT14() { |
| | | return t14; |
| | | } |
| | | |
| | | public void setT14(Double t14) { |
| | | this.t14 = t14; |
| | | } |
| | | |
| | | public Double getT15() { |
| | | return t15; |
| | | } |
| | | |
| | | public void setT15(Double t15) { |
| | | this.t15 = t15; |
| | | } |
| | | |
| | | public Double getT16() { |
| | | return t16; |
| | | } |
| | | |
| | | public void setT16(Double t16) { |
| | | this.t16 = t16; |
| | | } |
| | | |
| | | public Double getT17() { |
| | | return t17; |
| | | } |
| | | |
| | | public void setT17(Double t17) { |
| | | this.t17 = t17; |
| | | } |
| | | |
| | | public Double getT18() { |
| | | return t18; |
| | | } |
| | | |
| | | public void setT18(Double t18) { |
| | | this.t18 = t18; |
| | | } |
| | | |
| | | public Double getT19() { |
| | | return t19; |
| | | } |
| | | |
| | | public void setT19(Double t19) { |
| | | this.t19 = t19; |
| | | } |
| | | |
| | | public Double getT20() { |
| | | return t20; |
| | | } |
| | | |
| | | public void setT20(Double t20) { |
| | | this.t20 = t20; |
| | | } |
| | | |
| | | public Double getT21() { |
| | | return t21; |
| | | } |
| | | |
| | | public void setT21(Double t21) { |
| | | this.t21 = t21; |
| | | } |
| | | |
| | | public Double getT22() { |
| | | return t22; |
| | | } |
| | | |
| | | public void setT22(Double t22) { |
| | | this.t22 = t22; |
| | | } |
| | | |
| | | public Double getT23() { |
| | | return t23; |
| | | } |
| | | |
| | | public void setT23(Double t23) { |
| | | this.t23 = t23; |
| | | } |
| | | |
| | | public Double getT24() { |
| | | return t24; |
| | | } |
| | | |
| | | public void setT24(Double t24) { |
| | | this.t24 = t24; |
| | | } |
| | | |
| | | public TaskPlace() { |
| | | } |
| | | |
| | | public TaskPlace(Long berthId, String berthName, String type) { |
| | | this.berthId = berthId; |
| | | this.berthName = berthName; |
| | | this.type = type; |
| | | } |
| | | |
| | | public void setTimeSlot(String timeSlot, Double value) { |
| | | switch (timeSlot) { |
| | | case "t1": this.t1 = value; break; |
| | | case "t2": this.t2 = value; break; |
| | | case "t3": this.t3 = value; break; |
| | | case "t4": this.t4 = value; break; |
| | | case "t5": this.t5 = value; break; |
| | | case "t6": this.t6 = value; break; |
| | | case "t7": this.t7 = value; break; |
| | | case "t8": this.t8 = value; break; |
| | | case "t9": this.t9 = value; break; |
| | | case "t10": this.t10 = value; break; |
| | | case "t11": this.t11 = value; break; |
| | | case "t12": this.t12 = value; break; |
| | | case "t13": this.t13 = value; break; |
| | | case "t14": this.t14 = value; break; |
| | | case "t15": this.t15 = value; break; |
| | | case "t16": this.t16 = value; break; |
| | | case "t17": this.t17 = value; break; |
| | | case "t18": this.t18 = value; break; |
| | | case "t19": this.t19 = value; break; |
| | | case "t20": this.t20 = value; break; |
| | | case "t21": this.t21 = value; break; |
| | | case "t22": this.t22 = value; break; |
| | | case "t23": this.t23 = value; break; |
| | | case "t24": this.t24 = value; break; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.vo; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class TaskPlanList implements Serializable { |
| | | |
| | | private String type; |
| | | private Long berthId; |
| | | private String berthName; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.vo; |
| | | |
| | | import com.ruoyi.buss.domain.DsTaskDetail; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class TaskPlanStatis implements Serializable { |
| | | |
| | | private String harborName; |
| | | |
| | | private String berthName; |
| | | |
| | | private String berthStrategy; |
| | | |
| | | private List<DsTaskDetail> shipInfo; |
| | | |
| | | public String getHarborName() { |
| | | return harborName; |
| | | } |
| | | |
| | | public void setHarborName(String harborName) { |
| | | this.harborName = harborName; |
| | | } |
| | | |
| | | public String getBerthName() { |
| | | return berthName; |
| | | } |
| | | |
| | | public void setBerthName(String berthName) { |
| | | this.berthName = berthName; |
| | | } |
| | | |
| | | public String getBerthStrategy() { |
| | | return berthStrategy; |
| | | } |
| | | |
| | | public void setBerthStrategy(String berthStrategy) { |
| | | this.berthStrategy = berthStrategy; |
| | | } |
| | | |
| | | public List<DsTaskDetail> getShipInfo() { |
| | | return shipInfo; |
| | | } |
| | | |
| | | public void setShipInfo(List<DsTaskDetail> shipInfo) { |
| | | this.shipInfo = shipInfo; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.domain.vo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class TaskPlanStatisTime implements Serializable { |
| | | |
| | | private String harborName; |
| | | |
| | | private String berthName; |
| | | |
| | | private String berthStrategy; |
| | | |
| | | private List<DsTaskDetailVO> shipInfo; |
| | | |
| | | public String getHarborName() { |
| | | return harborName; |
| | | } |
| | | |
| | | public void setHarborName(String harborName) { |
| | | this.harborName = harborName; |
| | | } |
| | | |
| | | public String getBerthName() { |
| | | return berthName; |
| | | } |
| | | |
| | | public void setBerthName(String berthName) { |
| | | this.berthName = berthName; |
| | | } |
| | | |
| | | public String getBerthStrategy() { |
| | | return berthStrategy; |
| | | } |
| | | |
| | | public void setBerthStrategy(String berthStrategy) { |
| | | this.berthStrategy = berthStrategy; |
| | | } |
| | | |
| | | public List<DsTaskDetailVO> getShipInfo() { |
| | | return shipInfo; |
| | | } |
| | | |
| | | public void setShipInfo(List<DsTaskDetailVO> shipInfo) { |
| | | this.shipInfo = shipInfo; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.buss.domain.DmBerth2; |
| | | |
| | | /** |
| | | * æ³ä½ä¿¡æ¯Mapperæ¥å£ |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | public interface DmBerth2Mapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢æ³ä½ä¿¡æ¯ |
| | | * |
| | | * @param PKID æ³ä½ä¿¡æ¯ä¸»é® |
| | | * @return æ³ä½ä¿¡æ¯ |
| | | */ |
| | | public DmBerth2 selectDmBerthByPKID(Long PKID); |
| | | |
| | | /** |
| | | * æ¥è¯¢æ³ä½ä¿¡æ¯å表 |
| | | * |
| | | * @param dmBerth2 æ³ä½ä¿¡æ¯ |
| | | * @return æ³ä½ä¿¡æ¯éå |
| | | */ |
| | | public List<DmBerth2> selectDmBerthList(DmBerth2 dmBerth2); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢æ³ä½ä¿¡æ¯å表 |
| | | * |
| | | * @param harborIds æ³ä½ä¿¡æ¯ |
| | | * @return æ³ä½ä¿¡æ¯éå |
| | | */ |
| | | public List<DmBerth2> selectDmBerthByHarborIds(List<Long> harborIds); |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢æ³ä½ä¿¡æ¯å表(åªæ¥è¯¢ç¶æä¸ºæ£å¸¸ç) |
| | | * |
| | | * @param harborIds æ³ä½ä¿¡æ¯ |
| | | * @return æ³ä½ä¿¡æ¯éå |
| | | */ |
| | | public List<DmBerth2> selectDmBerthByHarborIdsAndStatus(List<Long> harborIds); |
| | | |
| | | /** |
| | | * æ°å¢æ³ä½ä¿¡æ¯ |
| | | * |
| | | * @param dmBerth2 æ³ä½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertDmBerth(DmBerth2 dmBerth2); |
| | | |
| | | /** |
| | | * ä¿®æ¹æ³ä½ä¿¡æ¯ |
| | | * |
| | | * @param dmBerth2 æ³ä½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateDmBerth(DmBerth2 dmBerth2); |
| | | |
| | | /** |
| | | * å 餿³ä½ä¿¡æ¯ |
| | | * |
| | | * @param PKID æ³ä½ä¿¡æ¯ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDmBerthByPKID(Long PKID); |
| | | |
| | | /** |
| | | * æ¹éå 餿³ä½ä¿¡æ¯ |
| | | * |
| | | * @param PKIDs éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDmBerthByPKIDs(String[] PKIDs); |
| | | |
| | | /** |
| | | * æ ¹æ®æ³ä½IDåºåæ¥è¯¢æ³ä½ä¿¡æ¯éå |
| | | * |
| | | * @param berthIds æ³ä½IDåºå |
| | | * @return æ³ä½ä¿¡æ¯éå |
| | | */ |
| | | public List<DmBerth2> getDmBerthListByIds(String berthIds); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.buss.mapper; |
| | | |
| | | import java.util.List; |
| | | import com.ruoyi.buss.domain.DmDdConfig; |
| | | |
| | | /** |
| | | * è°é
é
置信æ¯Mapperæ¥å£ |
| | | * |
| | | * @author lx |
| | | * @date 2025-03-14 |
| | | */ |
| | | public interface DmDdConfigMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢è°é
é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param PKID è°é
é
置信æ¯ä¸»é® |
| | | * @return è°é
é
ç½®ä¿¡æ¯ |
| | | */ |
| | | public DmDdConfig selectDmDdConfigByPKID(Long PKID); |
| | | |
| | | /** |
| | | * æ¥è¯¢è°é
é
置信æ¯å表 |
| | | * |
| | | * @param dmDdConfig è°é
é
ç½®ä¿¡æ¯ |
| | | * @return è°é
é
置信æ¯éå |
| | | */ |
| | | public List<DmDdConfig> selectDmDdConfigList(DmDdConfig dmDdConfig); |
| | | |
| | | /** |
| | | * æ°å¢è°é
é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param dmDdConfig è°é
é
ç½®ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertDmDdConfig(DmDdConfig dmDdConfig); |
| | | |
| | | /** |
| | | * ä¿®æ¹è°é
é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param dmDdConfig è°é
é
ç½®ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateDmDdConfig(DmDdConfig dmDdConfig); |
| | | |
| | | /** |
| | | * å é¤è°é
é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param PKID è°é
é
置信æ¯ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDmDdConfigByPKID(Long PKID); |
| | | |
| | | /** |
| | | * æ¹éå é¤è°é
é
ç½®ä¿¡æ¯ |
| | | * |
| | | * @param PKIDs éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteDmDdConfigByPKIDs(String[] PKIDs); |
| | | } |
ruoyi-buss/src/main/java/com/ruoyi/buss/mapper/DmHarbor2Mapper.java
ruoyi-buss/src/main/java/com/ruoyi/buss/mapper/DmWarshipMapper.java
ruoyi-buss/src/main/java/com/ruoyi/buss/mapper/DsEffectAssessHisMapper.java
ruoyi-buss/src/main/java/com/ruoyi/buss/mapper/DsEffectAssessListMapper.java
ruoyi-buss/src/main/java/com/ruoyi/buss/mapper/DsEffectAssessMapper.java
ruoyi-buss/src/main/java/com/ruoyi/buss/mapper/DsMatDispatchMapper2.java
ruoyi-buss/src/main/java/com/ruoyi/buss/mapper/DsTaskDetailMapper.java
ruoyi-buss/src/main/java/com/ruoyi/buss/mapper/DsTaskList2Mapper.java
ruoyi-buss/src/main/java/com/ruoyi/buss/mapper/DsTaskMapper.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/IDmBerth2Service.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/IDmDdConfigService.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/IDmHarbor2Service.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/IDmWarshipService.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/IDsEffectAssessHisService.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/IDsEffectAssessListService.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/IDsEffectAssessService.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/IDsMatDispatch2Service.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/IDsTaskDetailService.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/IDsTaskList2Service.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/IDsTaskService.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/impl/DmBerthService2Impl.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/impl/DmDdConfigServiceImpl.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/impl/DmHarbor2ServiceImpl.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/impl/DmWarshipServiceImpl.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/impl/DsEffectAssessHisServiceImpl.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/impl/DsEffectAssessListServiceImpl.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/impl/DsEffectAssessServiceImpl.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/impl/DsMatDispatch2ServiceImpl.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/impl/DsTaskDetailServiceImpl.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/impl/DsTaskList2ServiceImpl.java
ruoyi-buss/src/main/java/com/ruoyi/buss/service/impl/DsTaskServiceImpl.java
ruoyi-buss/src/main/resources/mapper/buss/DmBerth2Mapper.xml
ruoyi-buss/src/main/resources/mapper/buss/DmDdConfigMapper.xml
ruoyi-buss/src/main/resources/mapper/buss/DmHarbor2Mapper.xml
ruoyi-buss/src/main/resources/mapper/buss/DmWarshipMapper.xml
ruoyi-buss/src/main/resources/mapper/buss/DsEffectAssessHisMapper.xml
ruoyi-buss/src/main/resources/mapper/buss/DsEffectAssessListMapper.xml
ruoyi-buss/src/main/resources/mapper/buss/DsEffectAssessMapper.xml
ruoyi-buss/src/main/resources/mapper/buss/DsMatDispatchMapper.xml
ruoyi-buss/src/main/resources/mapper/buss/DsTaskDetailMapper.xml
ruoyi-buss/src/main/resources/mapper/buss/DsTaskList2Mapper.xml
ruoyi-buss/src/main/resources/mapper/buss/DsTaskMapper.xml
ruoyi-buss/src/main/resources/templates/buss/assess/add.html
ruoyi-buss/src/main/resources/templates/buss/assess/assess.html
ruoyi-buss/src/main/resources/templates/buss/assess/edit.html
ruoyi-buss/src/main/resources/templates/buss/berth/add.html
ruoyi-buss/src/main/resources/templates/buss/berth/berth.html
ruoyi-buss/src/main/resources/templates/buss/berth/edit.html
ruoyi-buss/src/main/resources/templates/buss/config/add.html
ruoyi-buss/src/main/resources/templates/buss/config/config.html
ruoyi-buss/src/main/resources/templates/buss/config/edit.html
ruoyi-buss/src/main/resources/templates/buss/detail/add.html
ruoyi-buss/src/main/resources/templates/buss/detail/detail.html
ruoyi-buss/src/main/resources/templates/buss/detail/edit.html
ruoyi-buss/src/main/resources/templates/buss/harbor/add.html
ruoyi-buss/src/main/resources/templates/buss/harbor/edit.html
ruoyi-buss/src/main/resources/templates/buss/harbor/harbor.html
ruoyi-buss/src/main/resources/templates/buss/list/add.html
ruoyi-buss/src/main/resources/templates/buss/list/edit.html
ruoyi-buss/src/main/resources/templates/buss/list/list.html
ruoyi-buss/src/main/resources/templates/buss/task/add.html
ruoyi-buss/src/main/resources/templates/buss/task/edit.html
ruoyi-buss/src/main/resources/templates/buss/task/task.html
ruoyi-buss/src/main/resources/templates/buss/warship/add.html
ruoyi-buss/src/main/resources/templates/buss/warship/edit.html
ruoyi-buss/src/main/resources/templates/buss/warship/warship.html
ruoyi-buss/src/main/ruoyi-buss.iml
ruoyi-common/pom.xml
ruoyi-common/ruoyi-common.iml
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Anonymous.java
ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataScope.java
ruoyi-common/src/main/java/com/ruoyi/common/annotation/DataSource.java
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excel.java
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Excels.java
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Log.java
ruoyi-common/src/main/java/com/ruoyi/common/annotation/RateLimiter.java
ruoyi-common/src/main/java/com/ruoyi/common/annotation/RepeatSubmit.java
ruoyi-common/src/main/java/com/ruoyi/common/annotation/Sensitive.java
ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
ruoyi-common/src/main/java/com/ruoyi/common/config/serializer/SensitiveJsonSerializer.java
ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
ruoyi-common/src/main/java/com/ruoyi/common/constant/GenConstants.java
ruoyi-common/src/main/java/com/ruoyi/common/constant/HttpStatus.java
ruoyi-common/src/main/java/com/ruoyi/common/constant/ScheduleConstants.java
ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/AjaxResult.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/R.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeEntity.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictType.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysMenu.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginBody.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginUser.java
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/RegisterBody.java
ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableSupport.java
ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java
ruoyi-common/src/main/java/com/ruoyi/common/core/text/CharsetKit.java
ruoyi-common/src/main/java/com/ruoyi/common/core/text/Convert.java
ruoyi-common/src/main/java/com/ruoyi/common/core/text/StrFormatter.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessStatus.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/BusinessType.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/DataSourceType.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/DesensitizedType.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/LimitType.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/OperatorType.java
ruoyi-common/src/main/java/com/ruoyi/common/enums/UserStatus.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/DemoModeException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/GlobalException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/ServiceException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/UtilException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/base/BaseException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileNameLengthLimitExceededException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileSizeLimitExceededException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/FileUploadException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/file/InvalidExtensionException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/job/TaskException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/BlackListException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/CaptchaExpireException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserNotExistsException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordNotMatchException.java
ruoyi-common/src/main/java/com/ruoyi/common/exception/user/UserPasswordRetryLimitExceedException.java
ruoyi-common/src/main/java/com/ruoyi/common/filter/PropertyPreExcludeFilter.java
ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatableFilter.java
ruoyi-common/src/main/java/com/ruoyi/common/filter/RepeatedlyRequestWrapper.java
ruoyi-common/src/main/java/com/ruoyi/common/filter/XssFilter.java
ruoyi-common/src/main/java/com/ruoyi/common/filter/XssHttpServletRequestWrapper.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/Arith.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/DesensitizedUtil.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/DictUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/ExceptionUtil.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/LogUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/ServletUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/StringUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/Threads.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/bean/BeanValidators.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/ImageUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/MimeTypeUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/html/EscapeUtil.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/html/HTMLFilter.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpHelper.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/http/HttpUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/AddressUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/ip/IpUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelHandlerAdapter.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/reflect/ReflectUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Base64.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/sign/Md5Utils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/sql/SqlUtil.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/IdUtils.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/Seq.java
ruoyi-common/src/main/java/com/ruoyi/common/utils/uuid/UUID.java
ruoyi-common/src/main/java/com/ruoyi/common/xss/Xss.java
ruoyi-common/src/main/java/com/ruoyi/common/xss/XssValidator.java
ruoyi-framework/pom.xml
ruoyi-framework/ruoyi-framework.iml
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataSourceAspect.java
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ApplicationConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/CaptchaConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/FastJson2JsonRedisSerializer.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/FilterConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/I18nConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/KaptchaTextCreator.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/MybatisPlusConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/RedisConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ServerConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ThreadPoolConfig.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/DruidProperties.java
ruoyi-framework/src/main/java/com/ruoyi/framework/config/properties/PermitAllUrlProperties.java
ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java
ruoyi-framework/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/RepeatSubmitInterceptor.java
ruoyi-framework/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
ruoyi-framework/src/main/java/com/ruoyi/framework/manager/AsyncManager.java
ruoyi-framework/src/main/java/com/ruoyi/framework/manager/ShutdownManager.java
ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java
ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/AuthenticationContextHolder.java
ruoyi-framework/src/main/java/com/ruoyi/framework/security/context/PermissionContextHolder.java
ruoyi-framework/src/main/java/com/ruoyi/framework/security/filter/JwtAuthenticationTokenFilter.java
ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/AuthenticationEntryPointImpl.java
ruoyi-framework/src/main/java/com/ruoyi/framework/security/handle/LogoutSuccessHandlerImpl.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/Server.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Cpu.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Jvm.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Mem.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/Sys.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/exception/GlobalExceptionHandler.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/PermissionService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPasswordService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/UserDetailsServiceImpl.java
ruoyi-fuzhou/pom.xml
ruoyi-fuzhou/ruoyi-fuzhou.iml
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/config/HikConfig.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/config/WebSocketConfig.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/CameraPTZ.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/DpEquipment.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/DpRfidTask.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/DpRfidVehicle.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/HikEvent.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/HikEventObj.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/OpenWZ.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveCarRule.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveCarValue.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveCarValueFinal.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveElectricityAnalyse.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveElectricityInfo.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveElectricityValue.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveElectricityValueFinal.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveInfo.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveModuleInfo.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveOilAnalyse.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveOilInfo.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveOilValue.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveOilValueFinal.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveSelectRule.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveSlmAnalyse.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveSlmInfo.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveSlmValue.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveSlmValueFinal.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveWaterAnalyse.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveWaterInfo.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveWaterValue.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveWaterValueFinal.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveWeatherAnalyse.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveWeatherInfo.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveWeatherValue.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/ReceiveWeatherValueFinal.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/vo/DpEquipmentVO.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/vo/QueryAnalysisVO.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/vo/ReceiveValueListVo.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/domain/vo/RfidVehicleVO.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/enums/DataTypeEnum.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/DpRfidTaskMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/DpRfidVehicleMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/EquipmentMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/HikEventMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveCarRuleMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveCarValueFinalMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveCarValueMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveElectricityAnalyseMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveElectricityInfoMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveElectricityValueFinalMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveElectricityValueMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveModuleInfoMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveOilAnalyseMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveOilInfoMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveOilValueFinalMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveOilValueMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveSelectRuleMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveSlmAnalyseMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveSlmInfoMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveSlmValueFinalMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveSlmValueMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveWaterAnalyseMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveWaterInfoMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveWaterValueFinalMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveWaterValueMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveWeatherAnalyseMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveWeatherInfoMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveWeatherValueFinalMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/mapper/ReceiveWeatherValueMapper.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/DpRfidTaskService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/DpRfidVehicleService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/EquipmentService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/HikService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveCarRuleService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveCarValueFinalService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveCarValueService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveElectricityAnalyseService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveElectricityInfoService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveElectricityValueFinalService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveElectricityValueService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveModuleInfoService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveOilAnalyseService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveOilInfoService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveOilValueFinalService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveOilValueService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveSelectRuleService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveSlmAnalyseService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveSlmInfoService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveSlmValueFinalService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveSlmValueService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveWaterAnalyseService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveWaterInfoService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveWaterValueFinalService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveWaterValueService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveWeatherAnalyseService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveWeatherInfoService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveWeatherValueFinalService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/ReceiveWeatherValueService.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/DpRfidTaskServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/DpRfidVehicleServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/EquipmentServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/HikServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveCarRuleServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveCarValueFinalServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveCarValueServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveElectricityAnalyseServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveElectricityInfoServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveElectricityValueFinalServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveElectricityValueServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveModuleInfoServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveOilAnalyseServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveOilInfoServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveOilValueFinalServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveOilValueServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveSelectRuleServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveSlmAnalyseServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveSlmInfoServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveSlmValueFinalServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveSlmValueServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveWaterAnalyseServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveWaterInfoServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveWaterValueFinalServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveWaterValueServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveWeatherAnalyseServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveWeatherInfoServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveWeatherValueFinalServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/service/impl/ReceiveWeatherValueServiceImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/AnalyseUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/Modbus4jUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/Modbus4jWriteUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/ModbusReadRtuUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/ModbusReadTcpUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/ModbusReadUdpUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/ModbusSlmServerUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/ModbusWeatherServerUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/ModbusYdkfmjUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/RS485TCPServer.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/RtuMasterUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/RtuSlaveUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/electricitymodbus/HexStringToInt.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/electricitymodbus/ModbusElectricityUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/hj1239/DataReceiver.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/hj1239/DataSender.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/hj1239/FileReadUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/hj1239/Main.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/hj1239/ProtocolDataEncoder.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/hj1239/StringToHexUtil.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/oilmodbus/Crc16Utils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/oilmodbus/ModbusFloatParserLittleUtil.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/oilmodbus/ModbusFloatParserUtil.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/oilmodbus/ModbusHexToFloat.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/oilmodbus/ModbusOilServerUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/rtu/MyProcessImageListener.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/rtu/SerialPortUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/rtu/SerialPortWrapperImpl.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/waterdept/ModbusWaterDeptUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/watermodbus/FloatInverseWaterParser.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/utils/watermodbus/ModbusWaterUtils.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/websocket/WebSocketOilServer.java
ruoyi-fuzhou/src/main/java/com/ruoyi/fuzhou/websocket/WebSocketServer.java
ruoyi-fuzhou/src/main/resources/mapper/DpRfidTaskMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/DpRfidVehicleMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/EquipmentMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/HikEventMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveCarRuleMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveCarValueFinalMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveCarValueMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveElectricityAnalyseMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveElectricityInfoMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveElectricityValueFinalMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveElectricityValueMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveModuleInfoMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveOilAnalyseMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveOilInfoMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveOilValueFinalMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveOilValueMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveSelectRuleMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveSlmAnalyseMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveSlmInfoMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveSlmValueFinalMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveSlmValueMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveWaterAnalyseMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveWaterInfoMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveWaterValueFinalMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveWaterValueMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveWeatherAnalyseMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveWeatherInfoMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveWeatherValueFinalMapper.xml
ruoyi-fuzhou/src/main/resources/mapper/ReceiveWeatherValueMapper.xml
ruoyi-generator/pom.xml
ruoyi-generator/ruoyi-generator.iml
ruoyi-generator/src/main/java/com/ruoyi/generator/config/GenConfig.java
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableColumnMapper.java
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/GenTableMapper.java
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableColumnServiceImpl.java
ruoyi-generator/src/main/java/com/ruoyi/generator/service/GenTableServiceImpl.java
ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableColumnService.java
ruoyi-generator/src/main/java/com/ruoyi/generator/service/IGenTableService.java
ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java
ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityInitializer.java
ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java
ruoyi-generator/src/main/resources/generator.yml
ruoyi-generator/src/main/resources/mapper/generator/GenTableColumnMapper.xml
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
ruoyi-generator/src/main/resources/vm/java/controller.java.vm
ruoyi-generator/src/main/resources/vm/java/domain.java.vm
ruoyi-generator/src/main/resources/vm/java/mapper.java.vm
ruoyi-generator/src/main/resources/vm/java/service.java.vm
ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm
ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm
ruoyi-generator/src/main/resources/vm/js/api.js.vm
ruoyi-generator/src/main/resources/vm/sql/sql.vm
ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm
ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
ruoyi-generator/src/main/resources/vm/vue/v3/index-tree.vue.vm
ruoyi-generator/src/main/resources/vm/vue/v3/index.vue.vm
ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm
ruoyi-manage/pom.xml
ruoyi-manage/ruoyi-manage.iml
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DmBerth.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DmHarbor.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DpBerth.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DpEffectAssessList.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DpEquipmentType.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DpShipDevice.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DpShipParking.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DpShipType.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DpShips.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DpUnitSupplyTime.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DpWharf.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/DsTaskList.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/MyMetaObjectHandler.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/SysFileManage.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/vo/ShipTypeVO.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/vo/SysFileManageVO.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/vo/Tree.java
ruoyi-manage/src/main/java/com/ruoyi/manage/domain/vo/TreeVO.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/DmHarborMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/DpBerthMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/DpEffectAssessListMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/DpEquipmentTypeMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/DpShipDeviceMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/DpShipParkingMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/DpShipTypeMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/DpShipsMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/DpUnitSupplyTimeMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/DpWharfMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/DsTaskListMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/mapper/SysFileMapper.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/DpBerthService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/DpEffectAssessListService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/DpEquipmentTypeService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/DpShipDeviceService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/DpShipParkingService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/DpShipTypeService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/DpShipsService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/DpUnitSupplyTimeService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/DpWharfService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/DsTaskListService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/IDmHarborService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/SysFileService.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/DmHarborServiceImpl.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/DpBerthServiceImpl.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/DpEffectAssessListServiceImpl.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/DpEquipmentTypeServiceImpl.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/DpShipDeviceServiceImpl.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/DpShipParkingServiceImpl.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/DpShipTypeServiceImpl.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/DpShipsServiceImpl.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/DpUnitSupplyTimeServiceImpl.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/DpWharfServiceImpl.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/DsTaskListServiceImpl.java
ruoyi-manage/src/main/java/com/ruoyi/manage/service/impl/SysFileServiceImpl.java
ruoyi-manage/src/main/resources/mapper/DmHarborMapper.xml
ruoyi-manage/src/main/resources/mapper/DpBerthMapper.xml
ruoyi-manage/src/main/resources/mapper/DpEffectAssessListMapper.xml
ruoyi-manage/src/main/resources/mapper/DpEquipmentTypeMapper.xml
ruoyi-manage/src/main/resources/mapper/DpShipDeviceMapper.xml
ruoyi-manage/src/main/resources/mapper/DpShipParkingMapper.xml
ruoyi-manage/src/main/resources/mapper/DpShipTypeMapper.xml
ruoyi-manage/src/main/resources/mapper/DpShipsMapper.xml
ruoyi-manage/src/main/resources/mapper/DpUnitSupplyTimeMapper.xml
ruoyi-manage/src/main/resources/mapper/DpWharfMapper.xml
ruoyi-manage/src/main/resources/mapper/DsTaskListMapper.xml
ruoyi-manage/src/main/resources/mapper/SysFileMapper.xml
ruoyi-quartz/pom.xml
ruoyi-quartz/ruoyi-quartz.iml
ruoyi-quartz/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJob.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/domain/SysJobLog.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobLogMapper.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/mapper/SysJobMapper.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobLogService.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/ISysJobService.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobLogServiceImpl.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/SysJobServiceImpl.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/ElectricityAnalyseTask.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/AbstractQuartzJob.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/CronUtils.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/JobInvokeUtil.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzDisallowConcurrentExecution.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/QuartzJobExecution.java
ruoyi-quartz/src/main/java/com/ruoyi/quartz/util/ScheduleUtils.java
ruoyi-quartz/src/main/resources/mapper/quartz/SysJobLogMapper.xml
ruoyi-quartz/src/main/resources/mapper/quartz/SysJobMapper.xml
ruoyi-system/pom.xml
ruoyi-system/ruoyi-system.iml
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysCache.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysConfig.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysNotice.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysOperLog.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysPost.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/SysOperLogVO.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml
ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml
ruoyi-ui/.editorconfig
ruoyi-ui/.env.development
ruoyi-ui/.env.production
ruoyi-ui/.env.staging
ruoyi-ui/.eslintignore
ruoyi-ui/.eslintrc.js
ruoyi-ui/.gitignore
ruoyi-ui/README.md
ruoyi-ui/babel.config.js
ruoyi-ui/bin/build.bat
ruoyi-ui/bin/package.bat
ruoyi-ui/bin/run-web.bat
ruoyi-ui/build/index.js
ruoyi-ui/package.json
ruoyi-ui/public/favicon.ico
ruoyi-ui/public/html/ie.html
ruoyi-ui/public/index.html
ruoyi-ui/public/robots.txt
ruoyi-ui/public/styles/theme-chalk/index.css
ruoyi-ui/src/App.vue
ruoyi-ui/src/api/login.js
ruoyi-ui/src/api/menu.js
ruoyi-ui/src/api/monitor/cache.js
ruoyi-ui/src/api/monitor/job.js
ruoyi-ui/src/api/monitor/jobLog.js
ruoyi-ui/src/api/monitor/logininfor.js
ruoyi-ui/src/api/monitor/online.js
ruoyi-ui/src/api/monitor/operlog.js
ruoyi-ui/src/api/monitor/server.js
ruoyi-ui/src/api/system/config.js
ruoyi-ui/src/api/system/dept.js
ruoyi-ui/src/api/system/dict/data.js
ruoyi-ui/src/api/system/dict/type.js
ruoyi-ui/src/api/system/menu.js
ruoyi-ui/src/api/system/notice.js
ruoyi-ui/src/api/system/post.js
ruoyi-ui/src/api/system/role.js
ruoyi-ui/src/api/system/user.js
ruoyi-ui/src/api/tool/gen.js
ruoyi-ui/src/assets/401_images/401.gif
ruoyi-ui/src/assets/404_images/404.png
ruoyi-ui/src/assets/404_images/404_cloud.png
ruoyi-ui/src/assets/icons/index.js
ruoyi-ui/src/assets/icons/svg/404.svg
ruoyi-ui/src/assets/icons/svg/bug.svg
ruoyi-ui/src/assets/icons/svg/build.svg
ruoyi-ui/src/assets/icons/svg/button.svg
ruoyi-ui/src/assets/icons/svg/cascader.svg
ruoyi-ui/src/assets/icons/svg/chart.svg
ruoyi-ui/src/assets/icons/svg/checkbox.svg
ruoyi-ui/src/assets/icons/svg/clipboard.svg
ruoyi-ui/src/assets/icons/svg/code.svg
ruoyi-ui/src/assets/icons/svg/color.svg
ruoyi-ui/src/assets/icons/svg/component.svg
ruoyi-ui/src/assets/icons/svg/dashboard.svg
ruoyi-ui/src/assets/icons/svg/date-range.svg
ruoyi-ui/src/assets/icons/svg/date.svg
ruoyi-ui/src/assets/icons/svg/dict.svg
ruoyi-ui/src/assets/icons/svg/documentation.svg
ruoyi-ui/src/assets/icons/svg/download.svg
ruoyi-ui/src/assets/icons/svg/drag.svg
ruoyi-ui/src/assets/icons/svg/druid.svg
ruoyi-ui/src/assets/icons/svg/edit.svg
ruoyi-ui/src/assets/icons/svg/education.svg
ruoyi-ui/src/assets/icons/svg/email.svg
ruoyi-ui/src/assets/icons/svg/example.svg
ruoyi-ui/src/assets/icons/svg/excel.svg
ruoyi-ui/src/assets/icons/svg/exit-fullscreen.svg
ruoyi-ui/src/assets/icons/svg/eye-open.svg
ruoyi-ui/src/assets/icons/svg/eye.svg
ruoyi-ui/src/assets/icons/svg/form.svg
ruoyi-ui/src/assets/icons/svg/fullscreen.svg
ruoyi-ui/src/assets/icons/svg/github.svg
ruoyi-ui/src/assets/icons/svg/guide.svg
ruoyi-ui/src/assets/icons/svg/icon.svg
ruoyi-ui/src/assets/icons/svg/input.svg
ruoyi-ui/src/assets/icons/svg/international.svg
ruoyi-ui/src/assets/icons/svg/job.svg
ruoyi-ui/src/assets/icons/svg/language.svg
ruoyi-ui/src/assets/icons/svg/link.svg
ruoyi-ui/src/assets/icons/svg/list.svg
ruoyi-ui/src/assets/icons/svg/lock.svg
ruoyi-ui/src/assets/icons/svg/log.svg
ruoyi-ui/src/assets/icons/svg/logininfor.svg
ruoyi-ui/src/assets/icons/svg/message.svg
ruoyi-ui/src/assets/icons/svg/money.svg
ruoyi-ui/src/assets/icons/svg/monitor.svg
ruoyi-ui/src/assets/icons/svg/nested.svg
ruoyi-ui/src/assets/icons/svg/number.svg
ruoyi-ui/src/assets/icons/svg/online.svg
ruoyi-ui/src/assets/icons/svg/password.svg
ruoyi-ui/src/assets/icons/svg/pdf.svg
ruoyi-ui/src/assets/icons/svg/people.svg
ruoyi-ui/src/assets/icons/svg/peoples.svg
ruoyi-ui/src/assets/icons/svg/phone.svg
ruoyi-ui/src/assets/icons/svg/post.svg
ruoyi-ui/src/assets/icons/svg/qq.svg
ruoyi-ui/src/assets/icons/svg/question.svg
ruoyi-ui/src/assets/icons/svg/radio.svg
ruoyi-ui/src/assets/icons/svg/rate.svg
ruoyi-ui/src/assets/icons/svg/redis-list.svg
ruoyi-ui/src/assets/icons/svg/redis.svg
ruoyi-ui/src/assets/icons/svg/row.svg
ruoyi-ui/src/assets/icons/svg/search.svg
ruoyi-ui/src/assets/icons/svg/select.svg
ruoyi-ui/src/assets/icons/svg/server.svg
ruoyi-ui/src/assets/icons/svg/shopping.svg
ruoyi-ui/src/assets/icons/svg/size.svg
ruoyi-ui/src/assets/icons/svg/skill.svg
ruoyi-ui/src/assets/icons/svg/slider.svg
ruoyi-ui/src/assets/icons/svg/star.svg
ruoyi-ui/src/assets/icons/svg/swagger.svg
ruoyi-ui/src/assets/icons/svg/switch.svg
ruoyi-ui/src/assets/icons/svg/system.svg
ruoyi-ui/src/assets/icons/svg/tab.svg
ruoyi-ui/src/assets/icons/svg/table.svg
ruoyi-ui/src/assets/icons/svg/textarea.svg
ruoyi-ui/src/assets/icons/svg/theme.svg
ruoyi-ui/src/assets/icons/svg/time-range.svg
ruoyi-ui/src/assets/icons/svg/time.svg
ruoyi-ui/src/assets/icons/svg/tool.svg
ruoyi-ui/src/assets/icons/svg/tree-table.svg
ruoyi-ui/src/assets/icons/svg/tree.svg
ruoyi-ui/src/assets/icons/svg/upload.svg
ruoyi-ui/src/assets/icons/svg/user.svg
ruoyi-ui/src/assets/icons/svg/validCode.svg
ruoyi-ui/src/assets/icons/svg/wechat.svg
ruoyi-ui/src/assets/icons/svg/zip.svg
ruoyi-ui/src/assets/icons/svgo.yml
ruoyi-ui/src/assets/images/dark.svg
ruoyi-ui/src/assets/images/light.svg
ruoyi-ui/src/assets/images/login-background.jpg
ruoyi-ui/src/assets/images/pay.png
ruoyi-ui/src/assets/images/profile.jpg
ruoyi-ui/src/assets/logo/logo.png
ruoyi-ui/src/assets/styles/btn.scss
ruoyi-ui/src/assets/styles/element-ui.scss
ruoyi-ui/src/assets/styles/element-variables.scss
ruoyi-ui/src/assets/styles/index.scss
ruoyi-ui/src/assets/styles/mixin.scss
ruoyi-ui/src/assets/styles/ruoyi.scss
ruoyi-ui/src/assets/styles/sidebar.scss
ruoyi-ui/src/assets/styles/transition.scss
ruoyi-ui/src/assets/styles/variables.scss
ruoyi-ui/src/components/Breadcrumb/index.vue
ruoyi-ui/src/components/Crontab/day.vue
ruoyi-ui/src/components/Crontab/hour.vue
ruoyi-ui/src/components/Crontab/index.vue
ruoyi-ui/src/components/Crontab/min.vue
ruoyi-ui/src/components/Crontab/month.vue
ruoyi-ui/src/components/Crontab/result.vue
ruoyi-ui/src/components/Crontab/second.vue
ruoyi-ui/src/components/Crontab/week.vue
ruoyi-ui/src/components/Crontab/year.vue
ruoyi-ui/src/components/DictData/index.js
ruoyi-ui/src/components/DictTag/index.vue
ruoyi-ui/src/components/Editor/index.vue
ruoyi-ui/src/components/FileUpload/index.vue
ruoyi-ui/src/components/Hamburger/index.vue
ruoyi-ui/src/components/HeaderSearch/index.vue
ruoyi-ui/src/components/IconSelect/index.vue
ruoyi-ui/src/components/IconSelect/requireIcons.js
ruoyi-ui/src/components/ImagePreview/index.vue
ruoyi-ui/src/components/ImageUpload/index.vue
ruoyi-ui/src/components/Pagination/index.vue
ruoyi-ui/src/components/PanThumb/index.vue
ruoyi-ui/src/components/ParentView/index.vue
ruoyi-ui/src/components/RightPanel/index.vue
ruoyi-ui/src/components/RightToolbar/index.vue
ruoyi-ui/src/components/RuoYi/Doc/index.vue
ruoyi-ui/src/components/RuoYi/Git/index.vue
ruoyi-ui/src/components/Screenfull/index.vue
ruoyi-ui/src/components/SizeSelect/index.vue
ruoyi-ui/src/components/SvgIcon/index.vue
ruoyi-ui/src/components/ThemePicker/index.vue
ruoyi-ui/src/components/TopNav/index.vue
ruoyi-ui/src/components/iFrame/index.vue
ruoyi-ui/src/directive/dialog/drag.js
ruoyi-ui/src/directive/dialog/dragHeight.js
ruoyi-ui/src/directive/dialog/dragWidth.js
ruoyi-ui/src/directive/index.js
ruoyi-ui/src/directive/module/clipboard.js
ruoyi-ui/src/directive/permission/hasPermi.js
ruoyi-ui/src/directive/permission/hasRole.js
ruoyi-ui/src/layout/components/AppMain.vue
ruoyi-ui/src/layout/components/IframeToggle/index.vue
ruoyi-ui/src/layout/components/InnerLink/index.vue
ruoyi-ui/src/layout/components/Navbar.vue
ruoyi-ui/src/layout/components/Settings/index.vue
ruoyi-ui/src/layout/components/Sidebar/FixiOSBug.js
ruoyi-ui/src/layout/components/Sidebar/Item.vue
ruoyi-ui/src/layout/components/Sidebar/Link.vue
ruoyi-ui/src/layout/components/Sidebar/Logo.vue
ruoyi-ui/src/layout/components/Sidebar/SidebarItem.vue
ruoyi-ui/src/layout/components/Sidebar/index.vue
ruoyi-ui/src/layout/components/TagsView/ScrollPane.vue
ruoyi-ui/src/layout/components/TagsView/index.vue
ruoyi-ui/src/layout/components/index.js
ruoyi-ui/src/layout/index.vue
ruoyi-ui/src/layout/mixin/ResizeHandler.js
ruoyi-ui/src/main.js
ruoyi-ui/src/permission.js
ruoyi-ui/src/plugins/auth.js
ruoyi-ui/src/plugins/cache.js
ruoyi-ui/src/plugins/download.js
ruoyi-ui/src/plugins/index.js
ruoyi-ui/src/plugins/modal.js
ruoyi-ui/src/plugins/tab.js
ruoyi-ui/src/router/index.js
ruoyi-ui/src/settings.js
ruoyi-ui/src/store/getters.js
ruoyi-ui/src/store/index.js
ruoyi-ui/src/store/modules/app.js
ruoyi-ui/src/store/modules/dict.js
ruoyi-ui/src/store/modules/permission.js
ruoyi-ui/src/store/modules/settings.js
ruoyi-ui/src/store/modules/tagsView.js
ruoyi-ui/src/store/modules/user.js
ruoyi-ui/src/utils/auth.js
ruoyi-ui/src/utils/dict/Dict.js
ruoyi-ui/src/utils/dict/DictConverter.js
ruoyi-ui/src/utils/dict/DictData.js
ruoyi-ui/src/utils/dict/DictMeta.js
ruoyi-ui/src/utils/dict/DictOptions.js
ruoyi-ui/src/utils/dict/index.js
ruoyi-ui/src/utils/errorCode.js
ruoyi-ui/src/utils/generator/config.js
ruoyi-ui/src/utils/generator/css.js
ruoyi-ui/src/utils/generator/drawingDefault.js
ruoyi-ui/src/utils/generator/html.js
ruoyi-ui/src/utils/generator/icon.json
ruoyi-ui/src/utils/generator/js.js
ruoyi-ui/src/utils/generator/render.js
ruoyi-ui/src/utils/index.js
ruoyi-ui/src/utils/jsencrypt.js
ruoyi-ui/src/utils/permission.js
ruoyi-ui/src/utils/request.js
ruoyi-ui/src/utils/ruoyi.js
ruoyi-ui/src/utils/scroll-to.js
ruoyi-ui/src/utils/validate.js
ruoyi-ui/src/views/dashboard/BarChart.vue
ruoyi-ui/src/views/dashboard/LineChart.vue
ruoyi-ui/src/views/dashboard/PanelGroup.vue
ruoyi-ui/src/views/dashboard/PieChart.vue
ruoyi-ui/src/views/dashboard/RaddarChart.vue
ruoyi-ui/src/views/dashboard/mixins/resize.js
ruoyi-ui/src/views/error/401.vue
ruoyi-ui/src/views/error/404.vue
ruoyi-ui/src/views/index.vue
ruoyi-ui/src/views/index_v1.vue
ruoyi-ui/src/views/login.vue
ruoyi-ui/src/views/monitor/cache/index.vue
ruoyi-ui/src/views/monitor/cache/list.vue
ruoyi-ui/src/views/monitor/druid/index.vue
ruoyi-ui/src/views/monitor/job/index.vue
ruoyi-ui/src/views/monitor/job/log.vue
ruoyi-ui/src/views/monitor/logininfor/index.vue
ruoyi-ui/src/views/monitor/online/index.vue
ruoyi-ui/src/views/monitor/operlog/index.vue
ruoyi-ui/src/views/monitor/server/index.vue
ruoyi-ui/src/views/redirect.vue
ruoyi-ui/src/views/register.vue
ruoyi-ui/src/views/system/config/index.vue
ruoyi-ui/src/views/system/dept/index.vue
ruoyi-ui/src/views/system/dict/data.vue
ruoyi-ui/src/views/system/dict/index.vue
ruoyi-ui/src/views/system/menu/index.vue
ruoyi-ui/src/views/system/notice/index.vue
ruoyi-ui/src/views/system/post/index.vue
ruoyi-ui/src/views/system/role/authUser.vue
ruoyi-ui/src/views/system/role/index.vue
ruoyi-ui/src/views/system/role/selectUser.vue
ruoyi-ui/src/views/system/user/authRole.vue
ruoyi-ui/src/views/system/user/index.vue
ruoyi-ui/src/views/system/user/profile/index.vue
ruoyi-ui/src/views/system/user/profile/resetPwd.vue
ruoyi-ui/src/views/system/user/profile/userAvatar.vue
ruoyi-ui/src/views/system/user/profile/userInfo.vue
ruoyi-ui/src/views/tool/build/CodeTypeDialog.vue
ruoyi-ui/src/views/tool/build/DraggableItem.vue
ruoyi-ui/src/views/tool/build/IconsDialog.vue
ruoyi-ui/src/views/tool/build/RightPanel.vue
ruoyi-ui/src/views/tool/build/TreeNodeDialog.vue
ruoyi-ui/src/views/tool/build/index.vue
ruoyi-ui/src/views/tool/gen/basicInfoForm.vue
ruoyi-ui/src/views/tool/gen/createTable.vue
ruoyi-ui/src/views/tool/gen/editTable.vue
ruoyi-ui/src/views/tool/gen/genInfoForm.vue
ruoyi-ui/src/views/tool/gen/importTable.vue
ruoyi-ui/src/views/tool/gen/index.vue
ruoyi-ui/src/views/tool/swagger/index.vue
ruoyi-ui/vue.config.js
sql/dameng/dameng.sql
sql/dameng/quartz.sql
sql/dameng/ry_20240629.sql
sql/quartz.sql
sql/ry_20240629.sql
ts.txt |