change - 代码优化

master
wenjy 2 years ago
parent 85e37a11e5
commit 46f7c06a9b

@ -12,6 +12,7 @@
</profile> </profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel> <bytecodeTargetLevel>
<module name="config" target="8" />
<module name="deviceboard" target="8" /> <module name="deviceboard" target="8" />
<module name="productionboard" target="8" /> <module name="productionboard" target="8" />
<module name="visualboard" target="1.8" /> <module name="visualboard" target="1.8" />
@ -19,6 +20,7 @@
</component> </component>
<component name="JavacSettings"> <component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE"> <option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="config" options="-parameters" />
<module name="deviceboard" options="-parameters" /> <module name="deviceboard" options="-parameters" />
<module name="productionboard" options="-parameters" /> <module name="productionboard" options="-parameters" />
<module name="visualboard" options="-parameters" /> <module name="visualboard" options="-parameters" />

@ -6,6 +6,11 @@
<option name="name" value="Central Repository" /> <option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" /> <option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository> </remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository> <remote-repository>
<option name="id" value="central" /> <option name="id" value="central" />
<option name="name" value="Central Repository" /> <option name="name" value="Central Repository" />

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.roufid.tutorials:config:1.1">
<CLASSES>
<root url="jar://D:/开发环境/Maven/apache-maven-3.6.3/repository/com/roufid/tutorials/config/1.1/config-1.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://D:/开发环境/Maven/apache-maven-3.6.3/repository/com/roufid/tutorials/config/1.1/config-1.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://D:/开发环境/Maven/apache-maven-3.6.3/repository/com/roufid/tutorials/config/1.1/config-1.1-sources.jar!/" />
</SOURCES>
</library>
</component>

@ -6,6 +6,11 @@
<option value="$PROJECT_DIR$/pom.xml" /> <option value="$PROJECT_DIR$/pom.xml" />
</list> </list>
</option> </option>
<option name="ignoredFiles">
<set>
<option value="$PROJECT_DIR$/config/pom.xml" />
</set>
</option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />

@ -116,5 +116,6 @@
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" /> <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" /> <orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.8.0.M4" level="project" /> <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.8.0.M4" level="project" />
<orderEntry type="library" name="Maven: com.roufid.tutorials:config:1.1" level="project" />
</component> </component>
</module> </module>

@ -101,6 +101,12 @@
<version>5.8.0.M4</version> <version>5.8.0.M4</version>
</dependency> </dependency>
<dependency>
<groupId>com.roufid.tutorials</groupId>
<artifactId>config</artifactId>
<version>1.1</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

@ -116,5 +116,6 @@
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" /> <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" /> <orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.8.0.M4" level="project" /> <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.8.0.M4" level="project" />
<orderEntry type="library" name="Maven: com.roufid.tutorials:config:1.1" level="project" />
</component> </component>
</module> </module>

@ -0,0 +1,15 @@
package com.productionboard.config;
import com.roufid.tutorials.util.AInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new AInterceptor()).addPathPatterns("/**");
}
}

@ -197,10 +197,14 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService {
case "0": case "0":
List<String> deviceId = new ArrayList<String>(){ List<String> deviceId = new ArrayList<String>(){
{ {
if(number == 0){ if(in_id == 1){
this.add("FPX001"); if(number == 0){
}else{ this.add("FPX001");
this.add("FPX002"); }else{
this.add("FPX002");
}
}else if(in_id == 2){
this.add("FPX201");
} }
} }
}; };
@ -210,10 +214,14 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService {
case "1": case "1":
List<String> deviceId2 = new ArrayList<String>(){ List<String> deviceId2 = new ArrayList<String>(){
{ {
if(number == 0){ if(in_id == 1){
this.add("FPX003"); if(number == 0){
}else{ this.add("FPX003");
this.add("FPX004"); }else{
this.add("FPX004");
}
}else if(in_id == 2){
this.add("FPX202");
} }
} }
}; };
@ -230,21 +238,25 @@ public class FoamBoxDeviceInfoServiceImpl implements IFoamBoxDeviceInfoService {
for (int i = 0; i <interior.size(); i++) { for (int i = 0; i <interior.size(); i++) {
String nameStr = ""; String nameStr = "";
switch (interior.get(i).getDeviceId()){ if(in_id == 1){
case "FPX001": switch (interior.get(i).getDeviceId()){
nameStr = "A区"+interior.get(i).getPameterName().substring(0,4); case "FPX001":
break; nameStr = "A区"+interior.get(i).getPameterName().substring(0,4);
case "FPX002": break;
nameStr = "B区"+interior.get(i).getPameterName().substring(0,4); case "FPX002":
break; nameStr = "B区"+interior.get(i).getPameterName().substring(0,4);
case "FPX003": break;
nameStr = "C区"+interior.get(i).getPameterName().substring(0,4); case "FPX003":
break; nameStr = "C区"+interior.get(i).getPameterName().substring(0,4);
case "FPX004": break;
nameStr = "D区"+interior.get(i).getPameterName().substring(0,4); case "FPX004":
break; nameStr = "D区"+interior.get(i).getPameterName().substring(0,4);
default: break;
nameStr = interior.get(i).getPameterName().substring(0,4); default:
nameStr = interior.get(i).getPameterName().substring(0,4);
}
}else if(in_id == 2){
nameStr = interior.get(i).getPameterName().substring(0,3);
} }
if(!xValueList.contains(nameStr)){ if(!xValueList.contains(nameStr)){
xValueList.add(nameStr); xValueList.add(nameStr);

@ -12,6 +12,6 @@ mybatis-plus:
mapper-locations: classpath*:/mapper/**Mapper.xml mapper-locations: classpath*:/mapper/**Mapper.xml
server: server:
port: 6070 port: 6069
in_id: 2 in_id: 1

@ -27,6 +27,7 @@
</content> </content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" /> <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="config" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.6.6" level="project" /> <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.6.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.6.6" level="project" /> <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.6.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.6.6" level="project" /> <orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.6.6" level="project" />
@ -116,5 +117,6 @@
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" /> <orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.47" level="project" />
<orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" /> <orderEntry type="library" name="Maven: cn.easyproject:orai18n:12.1.0.2.0" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.8.0.M4" level="project" /> <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.8.0.M4" level="project" />
<orderEntry type="library" name="Maven: com.roufid.tutorials:config:1.1" level="project" />
</component> </component>
</module> </module>
Loading…
Cancel
Save