Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/deviceInterface/deviceInterfaceForm.js =================================================================== diff -u -r29628 -r30339 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/deviceInterface/deviceInterfaceForm.js (.../deviceInterfaceForm.js) (revision 29628) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/deviceInterface/deviceInterfaceForm.js (.../deviceInterfaceForm.js) (revision 30339) @@ -337,7 +337,7 @@ }else if(deviceBrand == XINHUA){ var xinhuaModelComboStore = new Ext.data.SimpleStore({ fields : [ 'value' ], - data : [[CHANGLONG]] + data : [[CHANGLONG],[XINHUA_PC_L],[XINHUA_SUPER6000],[XINHUA_Repaid_A_520]] }) var interfaceTypeComboStore = new Ext.data.SimpleStore({ fields : [ 'value' ], Index: ssts-web/src/main/webapp/disinfectsystem/basedatamanager/deviceInterface/deviceInterfaceView.jsp =================================================================== diff -u -r29628 -r30339 --- ssts-web/src/main/webapp/disinfectsystem/basedatamanager/deviceInterface/deviceInterfaceView.jsp (.../deviceInterfaceView.jsp) (revision 29628) +++ ssts-web/src/main/webapp/disinfectsystem/basedatamanager/deviceInterface/deviceInterfaceView.jsp (.../deviceInterfaceView.jsp) (revision 30339) @@ -38,7 +38,21 @@ //读取设备的类型 var DEVICETYPE_LOW = '<%=DeviceInterface.DEVICETYPE_LOW%>'; var DEVICETYPE_HIGH = '<%=DeviceInterface.DEVICETYPE_HIGH%>'; + /** + * 负压清洗机(PC-L)(张家界市人民医院ZJJSRM-6) + */ + var XINHUA_PC_L = '<%=DeviceInterface.XINHUA_PC_L%>'; +/** + * 单舱清洗机(super6000)(张家界市人民医院ZJJSRM-6) + */ + var XINHUA_SUPER6000 = '<%=DeviceInterface.XINHUA_SUPER6000%>'; +/** + * Repaid-a-520(南方医科大学附属第三医院NYSY-28) + */ +var XINHUA_Repaid_A_520 = '<%=DeviceInterface.XINHUA_Repaid_A_520%>'; + +/** * 《供应商包添加》权限 */ var SSTS_Supplier_Create = true; Index: ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/device/service/XinHuaDataManagerImpl.java =================================================================== diff -u -r30330 -r30339 --- ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/device/service/XinHuaDataManagerImpl.java (.../XinHuaDataManagerImpl.java) (revision 30330) +++ ssts-maintain/src/main/java/com/forgon/disinfectsystem/maintain/device/service/XinHuaDataManagerImpl.java (.../XinHuaDataManagerImpl.java) (revision 30339) @@ -42,9 +42,9 @@ import com.forgon.tools.FileSystemHelper; import com.forgon.tools.MathTools; import com.forgon.tools.date.DateTools; +import com.forgon.tools.db.InitDbConnection; import com.forgon.tools.hibernate.ObjectDao; import com.forgon.tools.string.StringTools; -import com.forgon.tools.util.ConfigUtils; /** * 新华灭菌炉、清洗机数据处理 * @author shuyongfu @@ -58,7 +58,11 @@ private FtpFileManager ftpFileManager; private static final Logger logger = Logger .getLogger(XinHuaDataManagerImpl.class); - + private InitDbConnection dbConnection; + + public void setDbConnection(InitDbConnection dbConnection) { + this.dbConnection = dbConnection; + } public void setFtpFileManager(FtpFileManager ftpFileManager) { this.ftpFileManager = ftpFileManager; } @@ -905,10 +909,7 @@ if(StringUtils.isBlank(cycleCounter)){ return null; } - //张家界市人民医院有两个型号的清洗机,根据文件开头区分,负压清洗机:参数文件开头为:2WS;单舱清洗机(super6000):参数文件开头为:1WS - //南医三院有多台相同型号的清洗机,文件开头分别为1WS、2WS、3WS,而且保存在同一个目录下(文件格式和张家界的单舱清洗机(super6000)一致); - //配置项为true,表示所有清洗机文件格式一致,且不再根据文件名称开头区分不同型号 - Boolean sameDeviceModelInOneDirctoryAndDifferenceName = ConfigUtils.getSystemSetConfigByNameBool("sameDeviceModelInOneDirctoryAndDifferenceName"); + //3、遍历读取到的每一行信息 List washDateList = new ArrayList(); for (String line : records) { @@ -918,16 +919,15 @@ //防止读取后有换行符 line = line.replaceAll("\r|\n|\rn", ""); //若为结束阶段,则不用保存 - if(sameDeviceModelInOneDirctoryAndDifferenceName){ - if("07".equals(line.substring(14,16))){ + if(StringUtils.equals(DeviceInterface.XINHUA_PC_L, devInterface.getDeviceModel())){ + //负压清洗机:阶段编号为"09"则:表明为结束阶段 + if("09".equals(line.substring(14,16))){ isEnd =true; continue; } }else{ - //负压清洗机:参数文件开头为:2WS;机器号为2WS;阶段编号为"09"则:表明为结束阶段 - //单舱清洗机(super6000):参数文件开头为:1WS;机器号为1WS;阶段编号为"07"则:表明为结束阶段 - if(("2WS".equals(machineNumber) && "09".equals(line.substring(14,16))) - || ("1WS".equals(machineNumber) && "07".equals(line.substring(14,16)))){ + //单舱清洗机(super6000):阶段编号为"07"则:表明为结束阶段 + if("07".equals(line.substring(14,16))){ isEnd =true; continue; } @@ -940,39 +940,27 @@ record.setMachineNo(machineNumber); record.setDeviceInterfaceID(devInterface.getId().toString()); record.setTime(new SimpleDateFormat(DateTools.COMMON_DATE_HMS).format(startDate)); - if(sameDeviceModelInOneDirctoryAndDifferenceName){ + if(StringUtils.equals(DeviceInterface.XINHUA_PC_L, devInterface.getDeviceModel())){ + //负压清洗机(清洗机机器号为2WS) String t1Temp = line.substring(28,33); + String piMbar = line.substring(33,38); + record.setP1Mbar(StringTools.romoveUselessZeroToNumberStr(piMbar));//室内压力(去掉前面无用的0) + record.setT1Temp(StringTools.romoveUselessZeroToNumberStr(t1Temp));//室内温度(去掉前面无用的0) + } else { + //单舱清洗机(super6000)(清洗机机器号为1WS) + String t1Temp = line.substring(28,33); String t2Temp = line.substring(33,38); String t3Temp = line.substring(38,43); String t4Temp = line.substring(43,48); record.setT1Temp(StringTools.romoveUselessZeroToNumberStr(t1Temp));//内室温度(去掉前面无用的0) record.setT2Temp(StringTools.romoveUselessZeroToNumberStr(t2Temp));//空气温度(去掉前面无用的0) record.setT3Temp(StringTools.romoveUselessZeroToNumberStr(t3Temp));//消毒水箱温度(去掉前面无用的0) record.setT4Temp(StringTools.romoveUselessZeroToNumberStr(t4Temp));//清洗水箱温度(去掉前面无用的0) - }else{ - if("2WS".equals(machineNumber)){ - //负压清洗机(清洗机机器号为2WS) - String t1Temp = line.substring(28,33); - String piMbar = line.substring(33,38); - record.setP1Mbar(StringTools.romoveUselessZeroToNumberStr(piMbar));//室内压力(去掉前面无用的0) - record.setT1Temp(StringTools.romoveUselessZeroToNumberStr(t1Temp));//室内温度(去掉前面无用的0) - } else if("1WS".equals(machineNumber)){ - //单舱清洗机(super6000)(清洗机机器号为1WS) - String t1Temp = line.substring(28,33); - String t2Temp = line.substring(33,38); - String t3Temp = line.substring(38,43); - String t4Temp = line.substring(43,48); - record.setT1Temp(StringTools.romoveUselessZeroToNumberStr(t1Temp));//内室温度(去掉前面无用的0) - record.setT2Temp(StringTools.romoveUselessZeroToNumberStr(t2Temp));//空气温度(去掉前面无用的0) - record.setT3Temp(StringTools.romoveUselessZeroToNumberStr(t3Temp));//消毒水箱温度(去掉前面无用的0) - record.setT4Temp(StringTools.romoveUselessZeroToNumberStr(t4Temp));//清洗水箱温度(去掉前面无用的0) - } } record.setA0(StringTools.romoveUselessZeroToNumberStr(line.substring(48,53))); - //objectDao.saveOrUpdate(record); washDateList.add(record); } - objectDao.batchSaveOrUpdate(washDateList); + batchInsertIntoWashData(washDateList, devInterface.getDeviceModel()); //4、 // 保存本次读取的文件大小,用于下次判断,在此期间,文件是否有被修改过 sterilizerFileName.setLengthOfLastAccess(remoteFileLength); @@ -1009,6 +997,154 @@ } /** + * 批量插入 + * @param washDateList + * @param deviceModel + */ + private void batchInsertIntoWashData(List washDateList, String deviceModel) { + if(CollectionUtils.isEmpty(washDateList)){ + return; + } + if(dbConnection.isOracle()){ + batchInsertIntoWashDataOracle(washDateList, deviceModel); + }else{ + batchInsertIntoWashDataSqlServer(washDateList, deviceModel); + } + } + + private void batchInsertIntoWashDataOracle(List washDateList, String deviceModel) { + Long maxId = 0L; + String hql = "select po from WashData po order by po.id desc"; + List list = objectDao.findByHql(hql, 0, 1); + if(CollectionUtils.isNotEmpty(list)){ + maxId = list.get(0).getId(); + } + if(StringUtils.equals(DeviceInterface.XINHUA_PC_L, deviceModel)){ + List valueSql = new ArrayList(); + for (WashData washData : washDateList) { + StringBuffer tempSb = new StringBuffer("into WashData (id, cycleCounter, machineNo, deviceInterfaceID, Time, p1Mbar,t1Temp,a0) values ") + .append("(").append(++maxId) + .append(",'").append(washData.getCycleCounter()) + .append(",'").append(washData.getMachineNo()).append("'") + .append(",'").append(washData.getDeviceInterfaceID()).append("'") + .append(",'").append(washData.getTime()).append("'") + .append(",'").append(washData.getP1Mbar()).append("'") + .append(",'").append(washData.getT1Temp()).append("'") + .append(",'").append(washData.getA0()).append("'") + .append(")"); + valueSql.add(tempSb.toString()); + if(valueSql.size() == 1000){ + StringBuffer batchInsertSql = new StringBuffer("insert all "); + batchInsertSql.append(StringTools.join(valueSql, " ")); + batchInsertSql.append(" SELECT 1 FROM DUAL"); + objectDao.excuteSQL(batchInsertSql.toString()); + valueSql = new ArrayList(); + } + } + if(CollectionUtils.isNotEmpty(valueSql)){ + StringBuffer batchInsertSql = new StringBuffer("insert all "); + batchInsertSql.append(StringTools.join(valueSql, " ")); + batchInsertSql.append(" SELECT 1 FROM DUAL"); + objectDao.excuteSQL(batchInsertSql.toString()); + } + }else{ + List valueSql = new ArrayList(); + for (int i=0;i(); + } + } + if(CollectionUtils.isNotEmpty(valueSql)){ + StringBuffer batchInsertSql = new StringBuffer("insert all "); + batchInsertSql.append(StringTools.join(valueSql, " ")); + batchInsertSql.append(" SELECT 1 FROM DUAL"); + objectDao.excuteSQL(batchInsertSql.toString()); + } + } + } + + private void batchInsertIntoWashDataSqlServer(List washDateList, String deviceModel) { + Long maxId = 0L; + String hql = "select po from WashData po order by po.id desc"; + List list = objectDao.findByHql(hql, 0, 1); + if(CollectionUtils.isNotEmpty(list)){ + maxId = list.get(0).getId(); + } + if(StringUtils.equals(DeviceInterface.XINHUA_PC_L, deviceModel)){ + List valueSql = new ArrayList(); + for (WashData washData : washDateList) { + StringBuffer tempSb = new StringBuffer("(").append(++maxId) + .append(",'").append(washData.getCycleCounter()) + .append(",'").append(washData.getMachineNo()).append("'") + .append(",'").append(washData.getDeviceInterfaceID()).append("'") + .append(",'").append(washData.getTime()).append("'") + .append(",'").append(washData.getP1Mbar()).append("'") + .append(",'").append(washData.getT1Temp()).append("'") + .append(",'").append(washData.getA0()).append("'") + .append(")"); + valueSql.add(tempSb.toString()); + if(valueSql.size() == 1000){ + StringBuffer batchInsertSql = new StringBuffer("insert into WashData (id, cycleCounter, machineNo, deviceInterfaceID, Time, p1Mbar,t1Temp,a0) values"); + batchInsertSql.append(StringTools.join(valueSql, ",")); + objectDao.excuteSQL(batchInsertSql.toString()); + valueSql = new ArrayList(); + } + } + if(CollectionUtils.isNotEmpty(valueSql)){ + StringBuffer batchInsertSql = new StringBuffer("insert into WashData (id, cycleCounter, machineNo, deviceInterfaceID, Time, p1Mbar,t1Temp,a0) values"); + batchInsertSql.append(StringTools.join(valueSql, ",")); + objectDao.excuteSQL(batchInsertSql.toString()); + } + }else{ + List valueSql = new ArrayList(); + for (int i=0;i(); + } + } + if(CollectionUtils.isNotEmpty(valueSql)){ + StringBuffer batchInsertSql = new StringBuffer("insert into WashData (id, cycleCounter, machineNo, deviceInterfaceID, time, t1Temp, t2Temp, t3Temp, t4Temp,a0) values"); + batchInsertSql.append(StringTools.join(valueSql, ",")); + objectDao.excuteSQL(batchInsertSql.toString()); + } + } + } + + /** * 更新清洗机的温度压力数据 */ public void refreshWashRecordAmounts(String devInterfaceId,Long cycleCounter,String machineNo) Index: ssts-web/src/main/webapp/disinfectsystem/config/nfykdxfsdsyy/config.js =================================================================== diff -u -r30330 -r30339 --- ssts-web/src/main/webapp/disinfectsystem/config/nfykdxfsdsyy/config.js (.../config.js) (revision 30330) +++ ssts-web/src/main/webapp/disinfectsystem/config/nfykdxfsdsyy/config.js (.../config.js) (revision 30339) @@ -152,6 +152,5 @@ //是否允许回收数量减小的部分超过待装配数量 allowDecreaseRecyclingAmountGreatUnPackingAmount : true, //多套外来器械入同一篮筐 - multiForeignTousseIntoSameBasket : true, - sameDeviceModelInOneDirctoryAndDifferenceName:true + multiForeignTousseIntoSameBasket : true } \ No newline at end of file Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/deviceinterface/DeviceInterface.java =================================================================== diff -u -r29628 -r30339 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/deviceinterface/DeviceInterface.java (.../DeviceInterface.java) (revision 29628) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/basedatamanager/deviceinterface/DeviceInterface.java (.../DeviceInterface.java) (revision 30339) @@ -83,6 +83,22 @@ * 强生 型号STERRAD 100S */ public static final String JOHNSON_MODEL_STERRAD_100S = "STERRAD 100S"; + + /** + * 新华负压清洗机(PC-L)(张家界市人民医院ZJJSRM-6) + */ + public static final String XINHUA_PC_L = "负压清洗机(PC-L)"; + + /** + * 新华单舱清洗机(super6000)(张家界市人民医院ZJJSRM-6) + */ + public static final String XINHUA_SUPER6000 = "单舱清洗机(super6000)"; + + /** + * 新华Repaid-a-520(南方医科大学附属第三医院NYSY-28) + */ + public static final String XINHUA_Repaid_A_520 = "Repaid-a-520"; + private Long id; /**