comtika2019 %!s(int64=3) %!d(string=hai) anos
pai
achega
a467976a86

+ 4 - 2
src/main/java/com/comtika/safe/service/equip/terminal/impl/EquipTerminalServiceImpl.java

@@ -122,7 +122,8 @@ public class EquipTerminalServiceImpl implements EquipTerminalService {
                 String dealCount = i < 10 ? ("0" + i) : i + "";
                 serialStr = equip.getSerialNo() + dealCount;
                 if(serialStr.length() < 12){
-                	for(int p =0 ;p < 12 - serialStr.length(); p++){
+                	int length = 12 - serialStr.length();
+                	for(int p =0 ;p < length; p++){
                 		serialStr = "0" + serialStr;
                 	}
                 }
@@ -225,7 +226,8 @@ public class EquipTerminalServiceImpl implements EquipTerminalService {
                     String dealCount = i < 10 ? ("0" + i) : i + "";
                     serialStr = serialNo + dealCount;
                     if(serialStr.length() < 12){
-                    	for(int p =0 ;p < 12 - serialStr.length(); p++){
+                    	int length = 12 - serialStr.length();
+                    	for(int p =0 ;p < length; p++){
                     		serialStr = "0" + serialStr;
                     	}
                     }