4 Commity 40b92a00eb ... 3b85695b64

Autor SHA1 Wiadomość Data
  missMyLove 3b85695b64 Merge branch 'master' of http://db.comtti.net:80/comtika2019/fad-comtika-safe 3 lat temu
  comtika2019 a467976a86 代码修改 3 lat temu
  comtika2019 acb82457d2 Merge branch 'master' of http://db.comtti.net:80/comtika2019/fad-comtika-safe.git 3 lat temu
  comtika2019 749d82fedd 修改代码 3 lat temu

+ 12 - 0
src/main/java/com/comtika/safe/service/equip/terminal/impl/EquipTerminalServiceImpl.java

@@ -121,6 +121,12 @@ public class EquipTerminalServiceImpl implements EquipTerminalService {
                 }
                 }
                 String dealCount = i < 10 ? ("0" + i) : i + "";
                 String dealCount = i < 10 ? ("0" + i) : i + "";
                 serialStr = equip.getSerialNo() + dealCount;
                 serialStr = equip.getSerialNo() + dealCount;
+                if(serialStr.length() < 12){
+                	int length = 12 - serialStr.length();
+                	for(int p =0 ;p < length; p++){
+                		serialStr = "0" + serialStr;
+                	}
+                }
                 socket.setSerialNo(serialStr);
                 socket.setSerialNo(serialStr);
                 socket.setEquipTerminalId(terminal.getTerminalId());
                 socket.setEquipTerminalId(terminal.getTerminalId());
                 socket.setSocketStatus(SocketStatus.IDLE.getId());//插座状态初始化?
                 socket.setSocketStatus(SocketStatus.IDLE.getId());//插座状态初始化?
@@ -219,6 +225,12 @@ public class EquipTerminalServiceImpl implements EquipTerminalService {
                     }
                     }
                     String dealCount = i < 10 ? ("0" + i) : i + "";
                     String dealCount = i < 10 ? ("0" + i) : i + "";
                     serialStr = serialNo + dealCount;
                     serialStr = serialNo + dealCount;
+                    if(serialStr.length() < 12){
+                    	int length = 12 - serialStr.length();
+                    	for(int p =0 ;p < length; p++){
+                    		serialStr = "0" + serialStr;
+                    	}
+                    }
                     socket.setSerialNo(serialStr);
                     socket.setSerialNo(serialStr);
                     socket.setEquipTerminalId(terminal.getTerminalId());
                     socket.setEquipTerminalId(terminal.getTerminalId());
                     socket.setSocketStatus(SocketStatus.IDLE.getId());//插座状态初始化?
                     socket.setSocketStatus(SocketStatus.IDLE.getId());//插座状态初始化?