Index: ssts-userecord/src/main/java/com/forgon/disinfectsystem/useRecord/util/UseRecordUtil.java =================================================================== diff -u -r29000 -r29014 --- ssts-userecord/src/main/java/com/forgon/disinfectsystem/useRecord/util/UseRecordUtil.java (.../UseRecordUtil.java) (revision 29000) +++ ssts-userecord/src/main/java/com/forgon/disinfectsystem/useRecord/util/UseRecordUtil.java (.../UseRecordUtil.java) (revision 29014) @@ -206,7 +206,10 @@ if(materialErrorDamageDataListForTousseInstance != null && materialErrorDamageDataListForTousseInstance.size() > 0){ for (int k = 0; k < materialErrorDamageDataListForTousseInstance.size(); k++) { JSONObject materialErrorDamage = materialErrorDamageDataListForTousseInstance.optJSONObject(k); - int errorAmount = materialErrorDamage.optInt("errorAmount"); + int errorAmount = materialErrorDamage.optInt("unconfirmedAmount"); + if(errorAmount == 0){ + errorAmount = materialErrorDamage.optInt("errorAmount"); + } Long materialDefinitionId = materialErrorDamage.optLong("materialId"); if(isModified){ setErrorDamageInfo(tousseInstance, materialDefinitionId, materialErrorDamage, objectDao, loginUser, recyclingItem, MaterialErrorDamageDetail.TYPE_ERROR,useRecord.getStatus()); @@ -216,7 +219,7 @@ } TousseMaterialErrorDamage tousseMaterialErrorDamage = new TousseMaterialErrorDamage(); tousseMaterialErrorDamage.setTousseInstanceId(itemId); - tousseMaterialErrorDamage.setAmount(materialErrorDamage.optInt("errorAmount")); + tousseMaterialErrorDamage.setAmount(errorAmount); tousseMaterialErrorDamage.setLinkType(TousseMaterialErrorDamage.LINKTYPE_USERECORD); tousseMaterialErrorDamage.setMaterialDefinitionId(materialDefinitionId); tousseMaterialErrorDamage.setOperationTime(now); @@ -232,7 +235,10 @@ if(materialErrorDamageDataListForTousseInstance != null && materialErrorDamageDataListForTousseInstance.size() > 0){ for (int k = 0; k < materialErrorDamageDataListForTousseInstance.size(); k++) { JSONObject materialErrorDamage = materialErrorDamageDataListForTousseInstance.optJSONObject(k); - int errorAmount = materialErrorDamage.optInt("errorAmount"); + int errorAmount = materialErrorDamage.optInt("unconfirmedAmount"); + if(errorAmount == 0){ + errorAmount = materialErrorDamage.optInt("errorAmount"); + } Long materialDefinitionId = materialErrorDamage.optLong("materialId"); if(isModified){ setErrorDamageInfo(tousseInstance, materialDefinitionId, materialErrorDamage, objectDao, loginUser, recyclingItem, MaterialErrorDamageDetail.TYPE_DAMAGE,useRecord.getStatus()); @@ -360,7 +366,10 @@ md.getId(),type,MaterialErrorDamageDetail.LINKTYPE_USERECORD, MaterialErrorDamageDetail.STATUS_TWO); MaterialErrorDamageDetail detail = (MaterialErrorDamageDetail)objectDao.getBySql(MaterialErrorDamageDetail.class.getSimpleName(), draftSql); - int errorAmount = materialErrorDamage.optInt("errorAmount"); + int errorAmount = materialErrorDamage.optInt("unconfirmedAmount"); + if(errorAmount == 0){ + errorAmount = materialErrorDamage.optInt("errorAmount"); + } if(detail == null){ if(errorAmount <= 0){ return;