Explorar el Código

支持批量处理和单个

luoguangyi hace 2 años
padre
commit
82fd604e95

+ 7 - 0
src/main/java/com/persagy/excel/ExcelUtils.java

@@ -25,6 +25,8 @@ import java.util.List;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.Consumer;
 
+import static com.persagy.simulator_gaopin.Constant.BatchSend;
+
 /**
  * Excel 工具类
  *
@@ -67,6 +69,11 @@ public class ExcelUtils {
                     }
                     sb.append(parserEntity.building).append(";").append(parserEntity.gateway).append(";report;").append(DateUtil.formatDate(recordData.time))
                             .append(";").append(i).append(";").append(recordData.meter).append(";").append("1").append(";" + recordData.funcid + ";" + recordData.value);
+                    if(!BatchSend){
+                        ClientManager.AppendToSend(new Packet(sb.toString()));
+                        sb.setLength(0);
+                        continue;
+                    }
                     if(sb.length()>1500){
                         ClientManager.AppendToSend(new Packet(sb.toString()));
                         sb.setLength(0);

BIN
src/main/resources/report.xlsx


BIN
src/main/resources/set.xlsx