H5报表,4楼看板

master
Yangwl 5 months ago
parent 2ae296d681
commit 7376533d62

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-bootstrap:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.7" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.11" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.11" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.7.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.69" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.69" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcutil-jdk15on:1.69" level="project" />
</component>
</module>

@ -1,104 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-openfeign:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.69" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.69" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcutil-jdk15on:1.69" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-openfeign-core:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.7" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form-spring:3.8.0" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form:3.8.0" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.4" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.7.6" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign:feign-core:11.10" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:11.10" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-loadbalancer:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-loadbalancer:3.1.5" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.26" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.4" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor.addons:reactor-extra:3.4.9" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.7.7" level="project" />
<orderEntry type="library" name="Maven: com.stoyanr:evictor:1.0.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.24" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:transmittable-thread-local:2.14.2" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.7" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.11" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.7.7" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.6" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.70" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.5.Final" level="project" />
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.3.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.4.2" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.4" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.fastjson2:fastjson2:2.0.25" level="project" />
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.1" level="project" />
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:4.1.2" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.15" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:SparseBitSet:1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.19" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.06" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.6.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-bootstrap:3.1.5" level="project" />
</component>
</module>

@ -112,6 +112,8 @@
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</dependency>
</dependencies>
</project>

@ -1,8 +1,10 @@
package com.op.common.core.utils.poi;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.math.BigDecimal;
@ -20,6 +22,8 @@ import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.ttl.threadpool.agent.internal.javassist.Modifier;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.RegExUtils;
import org.apache.commons.lang3.reflect.FieldUtils;
@ -49,6 +53,7 @@ import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.op.common.core.annotation.Excel;
@ -246,7 +251,7 @@ public class ExcelUtil<T> {
/**
* excellist
*
*
* @param is
* @return
*/
@ -256,7 +261,7 @@ public class ExcelUtil<T> {
/**
* excellist
*
*
* @param is
* @param titleNum
* @return
@ -267,7 +272,7 @@ public class ExcelUtil<T> {
/**
* excellist
*
*
* @param sheetName
* @param titleNum
* @param is
@ -433,7 +438,7 @@ public class ExcelUtil<T> {
/**
* listexcel
*
*
* @return
*/
public void exportExcel(HttpServletResponse response) {
@ -481,7 +486,7 @@ public class ExcelUtil<T> {
/**
* excel
*
*
* @param index
* @param row
*/
@ -538,7 +543,7 @@ public class ExcelUtil<T> {
/**
*
*
*
* @param wb
* @return
*/
@ -590,7 +595,7 @@ public class ExcelUtil<T> {
/**
* Excel
*
*
* @param wb
* @return
*/
@ -620,7 +625,7 @@ public class ExcelUtil<T> {
/**
* Excel
*
*
* @param wb
* @return
*/
@ -678,7 +683,7 @@ public class ExcelUtil<T> {
/**
*
*
*
* @param value
* @param attr
* @param cell
@ -802,7 +807,7 @@ public class ExcelUtil<T> {
/**
* POI XSSFSheet
*
*
* @param sheet
* @param textlist
* @param promptContent
@ -835,7 +840,7 @@ public class ExcelUtil<T> {
/**
* ,.
*
*
* @param sheet sheet.
* @param textlist
* @param promptContent
@ -911,7 +916,7 @@ public class ExcelUtil<T> {
/**
* =0,=1,=2
*
*
* @param propertyValue
* @param converterExp
* @param separator
@ -1112,7 +1117,7 @@ public class ExcelUtil<T> {
/**
*
*
*
* @param sheetNo sheet
* @param index
*/
@ -1127,7 +1132,7 @@ public class ExcelUtil<T> {
/**
*
*
*
* @param row
* @param column
* @return
@ -1168,7 +1173,7 @@ public class ExcelUtil<T> {
/**
*
*
*
* @param row
* @return
*/
@ -1187,7 +1192,7 @@ public class ExcelUtil<T> {
/**
*
*
*
* @param dateFormat
* @param val
* @return
@ -1239,7 +1244,7 @@ public class ExcelUtil<T> {
/**
*
*
*
* @param name
* @param pojoClass
* @return
@ -1256,4 +1261,63 @@ public class ExcelUtil<T> {
}
return method;
}
public static void exportToExcel(String fileName, Class<?> dynamicClass, Map<String, List<?>> mapList)
throws IOException, ReflectiveOperationException {
Workbook workbook = new XSSFWorkbook();
// 遍历 mapList 中的每个键值对,每个键对应一个 Sheet
for (Map.Entry<String, List<?>> entry : mapList.entrySet()) {
String sheetName = entry.getKey();
List<?> dataList = entry.getValue();
// 创建 Sheet
Sheet sheet = workbook.createSheet(sheetName);
// 创建 header 行
Row headerRow = sheet.createRow(0);
Method[] methods = dynamicClass.getDeclaredMethods();
int colNum = 0;
for (Method method : methods) {
if (method.getName().startsWith("get") && !Modifier.isStatic(method.getModifiers())) {
Cell cell = headerRow.createCell(colNum++);
cell.setCellValue(method.getName().substring(3));
}
}
// 填充数据行
int rowNum = 1;
for (Object obj : dataList) {
if (dynamicClass.isInstance(obj)) { // 确保 obj 是 dynamicClass 的实例
Row row = sheet.createRow(rowNum++);
colNum = 0;
for (Method method : methods) {
if (method.getName().startsWith("get") && !Modifier.isStatic(method.getModifiers())) {
Cell cell = row.createCell(colNum++);
try {
Object value = method.invoke(obj);
cell.setCellValue(value != null ? value.toString() : "");
} catch (IllegalAccessException | InvocationTargetException e) {
// 处理反射调用异常
e.printStackTrace();
}
}
}
} else {
// 处理 obj 不是 dynamicClass 实例的情况
System.err.println("对象 " + obj + " 不是 " + dynamicClass.getName() + " 的实例,已跳过处理。");
// 跳过非实例对象,不抛出异常
}
}
}
// 写入到文件
try (FileOutputStream fileOut = new FileOutputStream(fileName)) {
workbook.write(fileOut);
} finally {
workbook.close();
}
}
}

@ -11,119 +11,4 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="op-api-system" />
<orderEntry type="module" module-name="op-common-security" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.24" level="project" />
<orderEntry type="library" name="Maven: com.op:op-api-system:0.0.1" level="project" />
<orderEntry type="module" module-name="op-common-core" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-openfeign:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-openfeign-core:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.7" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form-spring:3.8.0" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form:3.8.0" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.4" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign:feign-core:11.10" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:11.10" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-loadbalancer:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-loadbalancer:3.1.5" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor.addons:reactor-extra:3.4.9" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.7.7" level="project" />
<orderEntry type="library" name="Maven: com.stoyanr:evictor:1.0.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.24" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:transmittable-thread-local:2.14.2" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.4.6" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.7.7" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:4.0.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:2.2.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.9" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.7" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.6" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.70" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.2.5.Final" level="project" />
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.3.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.13.4.2" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.13.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.13.4" level="project" />
<orderEntry type="library" name="Maven: com.alibaba.fastjson2:fastjson2:2.0.25" level="project" />
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt:0.9.1" level="project" />
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.12.0" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.11.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:4.1.2" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.15" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:SparseBitSet:1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.1.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.19" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.06" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:javax.servlet-api:4.0.1" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.6.2" level="project" />
<orderEntry type="module" module-name="op-common-redis" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.7.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.7.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.7.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.3.24" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.36" level="project" />
<orderEntry type="library" name="Maven: io.lettuce:lettuce-core:6.1.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.86.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.86.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.86.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.86.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport-native-unix-common:4.1.86.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.86.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.86.Final" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.26" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.4" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-bootstrap:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.7.7" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.11" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.30" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.7.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:3.1.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.11.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.69" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.69" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcutil-jdk15on:1.69" level="project" />
</component>
</module>
</module>

@ -17,7 +17,15 @@ public class H5 {
private String efficiencyAcRate;
private String feedbackTime;
private String parentOrder;
private String reason;
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public int getPlanProduction() {
return planProduction;

@ -2,7 +2,10 @@ package com.op.mes.mapper;
import com.op.mes.domain.EnergyExpend;
import com.op.mes.domain.H5;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
@ -21,5 +24,5 @@ public interface H5ApiMapper {
*/
public List<H5> selectMesLineProsdceLists(H5 h5);
List<EnergyExpend> EnergyExpend();
List<EnergyExpend> EnergyExpend(@Param("startDateTime") String startDateTime, @Param("endDateTime") String endDateTime);
}

@ -102,8 +102,9 @@ public interface MesReportWorkMapper {
@MapKey("equCodeHour")
Map<String, MesHourReport> getHourProductionList(MesHourReport mesHourReport);
//烘房当日产量0000-2400
List<Map> getHFDailyProduction();
//烘房当班产量
@MapKey("shiftId")
List<Map> getHFDailyProduction(String shiftId);
List<MesHourReport> getEquNames(MesHourReport mesHourReport);
@ -201,5 +202,6 @@ public interface MesReportWorkMapper {
List<MesHourReport> getEquNamess(MesHourReport mesHourReport);
List<Map<String, String>> getPlanNumber();
@MapKey("shiftId")
List<Map<String, String>> getPlanNumber(String shiftId);
}

@ -9,6 +9,10 @@ import com.op.mes.service.H5ApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
@ -68,6 +72,7 @@ public class H5ApiServiceImpl implements H5ApiService {
resultH5.setProductionDuration(totalProductionDuration); // 总和
resultH5.setPlanProduction((int) Math.round(totalPlanProduction)); // 总和
resultH5.setProduction((int) Math.round(totalProduction)); // 总和
resultH5.setReason(list.get(0).getReason());
return resultH5;
}
)
@ -157,7 +162,40 @@ public class H5ApiServiceImpl implements H5ApiService {
@Override
@DS("#header.poolName")
public List<EnergyExpend> EnergyExpend() {
return h5ApiMapper.EnergyExpend();
LocalDateTime now = LocalDateTime.now();
LocalTime startTime1 = LocalTime.of(7, 30); // 7:30
LocalTime endTime1 = LocalTime.of(19, 30); // 19:30
LocalTime endTime2 = LocalTime.of(7, 30); // 第二天的 7:30
LocalDate startDate=null;
LocalDate endDate=null;
// 当前时间在 7:30 到 19:30 之间
if (now.toLocalTime().isAfter(startTime1) && now.toLocalTime().isBefore(endTime1)) {
startDate = now.toLocalDate();
endDate = now.toLocalDate();
endTime1 = LocalTime.of(19, 30); // 结束时间为当天的 19:30
}
// 当前时间在 19:30 到第二天 7:30 之间
else if (now.toLocalTime().isAfter(endTime1) || now.toLocalTime().isBefore(endTime2)) {
startDate = now.toLocalDate();
endDate = now.toLocalDate().plusDays(1); // 结束时间为第二天的 7:30
startTime1=endTime1;
endTime1 = LocalTime.of(7, 30);
} else {
// 不在指定时间范围内
System.out.println("当前时间不在指定范围内。");
}
LocalDateTime startDateTime = startDate.atTime(startTime1); // 开始时间
LocalDateTime endDateTime = endDate.atTime(endTime1); // 结束时间
// 格式化输出
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
return h5ApiMapper.EnergyExpend(startDateTime.format(formatter),endDateTime.format(formatter));
}
}

@ -37,6 +37,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.*;
@ -923,8 +924,21 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
}
map.put("dryingroomList", dryingRoomListInfo);
/***查询 烘房当日产出**/
List<Map> mapperHourProductionList = this.getHFDailyProduction();
/***查询 烘房当班产出**/
String shiftId = "";
LocalTime now = LocalTime.now();
// 定义工作时间段
LocalTime startTime = LocalTime.of(7, 30); // 7:30
LocalTime endTime = LocalTime.of(19, 30); // 19:30
// 检查当前时间是否在工作时间段内
if (now.isAfter(startTime) && now.isBefore(endTime.plusSeconds(1))) {
shiftId = "5"; // 工作时间
} else {
shiftId = "2"; // 非工作时间
}
List<Map> mapperHourProductionList = this.getHFDailyProduction(shiftId);
for (Map<String, String> dryingRoomMap : dryingRoomListInfo) {
String equipment_code = dryingRoomMap.get("equipment_code"); // Get the attr2 field value
@ -944,12 +958,41 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService {
/**烘房耗电数据**/
private List<EnergyExpend> EnergyExpend(){
DynamicDataSourceContextHolder.push("ds_" + "1000");// 这是数据源的key
return h5ApiMapper.EnergyExpend();
LocalDateTime now = LocalDateTime.now();
LocalTime startTime1 = LocalTime.of(7, 30); // 7:30
LocalTime endTime1 = LocalTime.of(19, 30); // 19:30
LocalTime endTime2 = LocalTime.of(7, 30); // 第二天的 7:30
LocalDate startDate=null;
LocalDate endDate=null;
// 当前时间在 7:30 到 19:30 之间
if (now.toLocalTime().isAfter(startTime1) && now.toLocalTime().isBefore(endTime1)) {
startDate = now.toLocalDate();
endDate = now.toLocalDate();
endTime1 = LocalTime.of(19, 30); // 结束时间为当天的 19:30
}
// 当前时间在 19:30 到第二天 7:30 之间
else if (now.toLocalTime().isAfter(endTime1) || now.toLocalTime().isBefore(endTime2)) {
startDate = now.toLocalDate();
endDate = now.toLocalDate().plusDays(1); // 结束时间为第二天的 7:30
startTime1=endTime1;
endTime1 = LocalTime.of(7, 30);
} else {
// 不在指定时间范围内
System.out.println("当前时间不在指定范围内。");
}
LocalDateTime startDateTime = startDate.atTime(startTime1); // 开始时间
LocalDateTime endDateTime = endDate.atTime(endTime1); // 结束时间
// 格式化输出
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
return h5ApiMapper.EnergyExpend(startDateTime.format(formatter),endDateTime.format(formatter));
}
/***查询 烘房当日产出**/
private List<Map> getHFDailyProduction(){
private List<Map> getHFDailyProduction(String shiftId){
DynamicDataSourceContextHolder.push("ds_" + "999");// 这是数据源的key
return mesReportWorkMapper.getHFDailyProduction();
return mesReportWorkMapper.getHFDailyProduction(shiftId);
}
/**白坯工厂,修正设备**/

@ -5,6 +5,7 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@ -934,8 +935,22 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
@Override
@DS("#header.poolName")
public AjaxResult PlanAchievementRate() {
List<Map<String,String>> mapList=mesReportWorkMapper.getPlanNumber();
List<Map> maps=mesReportWorkMapper.getHFDailyProduction();
String shiftId = "";
LocalTime now = LocalTime.now();
// 定义工作时间段
LocalTime startTime = LocalTime.of(7, 30); // 7:30
LocalTime endTime = LocalTime.of(19, 30); // 19:30
// 检查当前时间是否在工作时间段内
if (now.isAfter(startTime) && now.isBefore(endTime.plusSeconds(1))) {
shiftId = "5"; // 工作时间
} else {
shiftId = "2"; // 非工作时间
}
List<Map<String,String>> mapList=mesReportWorkMapper.getPlanNumber(shiftId);
List<Map> maps=mesReportWorkMapper.getHFDailyProduction(shiftId);
int sumChe = 0;
for (Map<String, String> map : mapList) {

@ -18,32 +18,34 @@
<result property="standardEfficiency" column="standardEfficiency"/>
<result property="actualEfficiency" column="actualEfficiency"/>
<result property="efficiencyAcRate" column="efficiencyAcRate"/>
<result property="reason" column="reason"/>
</resultMap>
<select id="selectMesLineProdceList" parameterType="H5" resultMap="H5Result">
SELECT
mrws.workorder_code,
mrws.machine_name,
mrws.product_name,
bpa.category,
bp.umrez,
mrws.quantity as plan_production,
mrws.quantity_feedback ,
mlp.use_man as man_standar,
mrws.use_man,
mrws.work_time,
CAST(ROUND(mlp.efficiency / mlp.attr1 / mlp.use_man, 1) AS FLOAT) AS standardEfficiency,
CAST(ROUND(mrws.quantity_feedback / mrws.work_time / mrws.use_man, 1) AS FLOAT) AS actualEfficiency,
mrws.parent_order
mrws.workorder_code,
mrws.machine_name,
mrws.product_name,
bpa.category,
bp.umrez,
mrws.quantity AS plan_production,
mrws.quantity_feedback,
mlp.use_man AS man_standar,
mrws.use_man,
mrws.work_time,
CAST(ROUND(mlp.efficiency / NULLIF(mlp.attr1, 0) / NULLIF(mlp.use_man, 0), 1) AS FLOAT) AS standardEfficiency,
CAST(ROUND(mrws.quantity_feedback / NULLIF(mrws.work_time, 0) / NULLIF(mrws.use_man, 0), 1) AS FLOAT) AS actualEfficiency,
mrws.parent_order,
mrws.remark as reason
FROM
[dbo].[mes_report_work] mrws
LEFT JOIN pro_order_workorder pow ON mrws.workorder_code = pow.workorder_code
LEFT JOIN base_product_attached bpa ON bpa.product_code = RIGHT ( mrws.product_code, 11 )
LEFT JOIN base_product bp ON bp.product_code = mrws.product_code
LEFT JOIN mes_line_product mlp ON mlp.product_code=mrws.product_code AND mlp.line_code=mrws.machine_code
LEFT JOIN base_product_attached bpa ON bpa.product_code = RIGHT(mrws.product_code, 11)
LEFT JOIN base_product bp ON bp.product_code = mrws.product_code
LEFT JOIN mes_line_product mlp ON mlp.product_code = mrws.product_code AND mlp.line_code = mrws.machine_code
WHERE
CAST(mrws.feedback_time AS DATE) = #{feedbackTime}
AND mrws.del_flag = '0'
ORDER BY mrws.machine_name ASC
ORDER BY mrws.machine_name ASC;
</select>
@ -90,7 +92,8 @@ FROM
report_point_dnb
WHERE
monitor_id IN ( 'E0046_1800','E0046_1700','E0046_1600','E0046_1500','E0046_1400','E0046_1300', 'E0046_1200','E0046_1100','E0046_1000','E0046_0900','E0046_0800','E0046_0700','E0046_0600','E0046_0500','E0046_0400','E0046_0300', 'E0046_0200','E0046_0100' )
AND CAST(end_time AS DATE) = CAST(GETDATE() AS DATE)
<if test="startDateTime != null "> and CONVERT(varchar(16), end_time, 120) >= #{startDateTime}</if>
<if test="endDateTime != null "> and #{endDateTime} >= CONVERT(varchar(16), end_time, 120)</if>
GROUP BY
monitor_name,
monitor_id,

@ -1036,7 +1036,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pdate ASC; -- 按日期排序
</select>
<select id="getHFDailyProduction" resultType="java.util.Map">
<select id="getHFDailyProduction" resultType="java.util.Map" parameterType="String">
SELECT
mt.equipmentCode,
COUNT(*) AS RecordCount
@ -1047,15 +1047,13 @@ FROM
WHERE
mt.rfid_status = '1'
AND equ.equipment_type_code = 'equ_type_hf'
AND mt.update_time BETWEEN
CAST(CONVERT(date, GETDATE()) AS datetime) -- today's date at 00:00:00
AND DATEADD(second, -1, DATEADD(day, 1, CAST(CONVERT(date, GETDATE()) AS datetime))) -- today's date at 23:59:59
AND CONVERT ( DATE, mt.update_time ) = CONVERT ( DATE, GETDATE( ) )
AND mt.shift_id=#{shiftId}
GROUP BY
mt.equipmentCode;
</select>
<select id="getPlanNumber" resultType="java.util.Map">
SELECT
<select id="getPlanNumber" resultType="java.util.Map" parameterType="String">
SELECT
c.workorder_code,
c.product_code,
c.product_name,
@ -1077,6 +1075,7 @@ FROM
) T ON c.product_code= T.item_code
WHERE
CONVERT ( DATE, product_date ) = CONVERT ( DATE, GETDATE( ) )
AND c.shift_id=#{shiftId}
</select>

Loading…
Cancel
Save