Index: ssts-web/src/main/webapp/systemmanage/orgUnitExt.js =================================================================== diff -u -r14406 -r15209 --- ssts-web/src/main/webapp/systemmanage/orgUnitExt.js (.../orgUnitExt.js) (revision 14406) +++ ssts-web/src/main/webapp/systemmanage/orgUnitExt.js (.../orgUnitExt.js) (revision 15209) @@ -398,7 +398,7 @@ this.enable(); return false; } - if(!validateOrgCodeAndName()){ //如果此部门编码和名称存在不给添加 + if(!validateOrgCode()){ //如果此部门编码和名称存在不给添加 this.enable(); return false; } @@ -422,7 +422,7 @@ this.enable(); return false; } - if(!validateOrgCodeAndName()){ //如果此部门编码和名称存在不给添加 + if(!validateOrgCode()){ //如果此部门编码和名称存在不给添加 this.enable(); return false; } @@ -450,7 +450,7 @@ this.enable(); return false; } - if(!validateOrgCodeAndName()){ //如果此部门编码和名称存在不给添加 + if(!validateOrgCode()){ //如果此部门编码和名称存在不给添加 this.enable(); return false; } @@ -483,34 +483,50 @@ Ext.getCmp('spelling').addClass('fieldReadOnlyNoRemove'); } - function validateOrgCodeAndName(){ - if(StringUtils.isBlank(id)){ //新添加的操作,验证部门编码和部门名称 + //科室编码不可以相同,科室名称可以相同(下面注释掉的的方法两者都不可以相同) + function validateOrgCode(){ + if(StringUtils.isBlank(id)){ //新添加的操作,验证部门编码即可 DWREngine.setAsync(false); OrgUnitTableManager.isRepeatCoding(Ext.getCmp('orgUnitCoding').getValue().Trim(),setIsRepeatCoding); - OrgUnitTableManager.isRepeatName(Ext.getCmp('name').getValue().Trim(),setIsRepeatName); DWREngine.setAsync(true); - } else { //更新的操作,就只验证部门名称就可以了 - if (oldName != Ext.getCmp('name').getValue().Trim()) { //如果改部门的名称就要去后台验证此部门是不是已经存在 - DWREngine.setAsync(false); - OrgUnitTableManager.isRepeatName(Ext.getCmp('name').getValue().Trim(),setIsRepeatName); - DWREngine.setAsync(true); - } else { - isNotRepeatName = true; - } - } + } - if (isNotRepeatCoding){ - if (isNotRepeatName) { //加一个校验如果存在这个名称的科室,也不给添加(陈家儒改) - return true; - } else { - alert('部门名称已经存在,请重新输入!'); - return false; - } - } else { - alert("部门编码已经存在,请重新输入!"); + if (!isNotRepeatCoding){ + alert("部门编码已经存在,请重新输入!"); return false; + } else { + return true; } } + +// function validateOrgCodeAndName(){ +// if(StringUtils.isBlank(id)){ //新添加的操作,验证部门编码和部门名称 +// DWREngine.setAsync(false); +// OrgUnitTableManager.isRepeatCoding(Ext.getCmp('orgUnitCoding').getValue().Trim(),setIsRepeatCoding); +// OrgUnitTableManager.isRepeatName(Ext.getCmp('name').getValue().Trim(),setIsRepeatName); +// DWREngine.setAsync(true); +// } else { //更新的操作,就只验证部门名称就可以了 +// if (oldName != Ext.getCmp('name').getValue().Trim()) { //如果改部门的名称就要去后台验证此部门是不是已经存在 +// DWREngine.setAsync(false); +// OrgUnitTableManager.isRepeatName(Ext.getCmp('name').getValue().Trim(),setIsRepeatName); +// DWREngine.setAsync(true); +// } else { +// isNotRepeatName = true; +// } +// } +// +// if (isNotRepeatCoding){ +// if (isNotRepeatName) { //加一个校验如果存在这个名称的科室,也不给添加(陈家儒改) +// return true; +// } else { +// alert('部门名称已经存在,请重新输入!'); +// return false; +// } +// } else { +// alert("部门编码已经存在,请重新输入!"); +// return false; +// } +// } function setIsRepeatCoding(isRepeat){ isNotRepeatCoding = isRepeat; Index: ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/service/DataSynchronizationManagerImpl.java =================================================================== diff -u -r14944 -r15209 --- ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/service/DataSynchronizationManagerImpl.java (.../DataSynchronizationManagerImpl.java) (revision 14944) +++ ssts-datasync-default-impl/src/main/java/com/forgon/disinfectsystem/datasynchronization/service/DataSynchronizationManagerImpl.java (.../DataSynchronizationManagerImpl.java) (revision 15209) @@ -238,25 +238,26 @@ OrgUnit orgUnit = (OrgUnit) orgUnitManager.getOrgUnitByCode(vo.coding); if(orgUnit != null && !更新交集数据) continue; //不是交集并且用户不希望更新交集 - OrgUnit tempOrgUnit = (OrgUnit) orgUnitManager.getCurrentOrgUintByName(vo.name); +// OrgUnit tempOrgUnit = (OrgUnit) orgUnitManager.getCurrentOrgUintByName(vo.name); //同步时允许同名的科室 if(orgUnit == null){ //需要同步的数据(新部门)(陈家儒改) - if (tempOrgUnit != null) { //如果此名称的部门已经存在了,则此同步操作失败 - throw new RuntimeException("nameError" + "(" + vo.name + ")此部门已经存在了,同步失败"); - } +// if (tempOrgUnit != null) { //如果此名称的部门已经存在了,则此同步操作失败 +// throw new RuntimeException("nameError" + "(" + vo.name + ")此部门已经存在了,同步失败"); +// } orgUnit = new OrgUnit(); orgUnit.setOrgUnitCoding(vo.coding);// 部门编码 orgUnit.setOrgForeignKey(vo.coding);// 部门外部ID orgUnit.setSource(Constants.SOURCE_SYNC); //是同步添加的数据(陈家儒改) orgUnit.setBarcodeDevice(newBarcodeOfOrgUnit()); - } else { //不是新部门 - if (tempOrgUnit != null) { //如果此名称的部门已经存在了 - if (!vo.getCoding().equals(tempOrgUnit.getOrgUnitCoding())) { //修改过部门名称,则说明修改的部门名称已经存在了 - throw new RuntimeException("nameError" + "(" + vo.name + ")此部门已经存在了,同步失败"); - } - } + } +// else { //不是新部门 +// if (tempOrgUnit != null) { //如果此名称的部门已经存在了 +// if (!vo.getCoding().equals(tempOrgUnit.getOrgUnitCoding())) { //修改过部门名称,则说明修改的部门名称已经存在了 +// throw new RuntimeException("nameError" + "(" + vo.name + ")此部门已经存在了,同步失败"); +// } +// } +// +// } - } - orgUnit.setName(vo.name);// 名称 orgUnit.setIdFromHisSync(vo.getIdFromHisSync());//his接口返回的科室id orgUnit.setSpelling(GB2Alpha.string2Alpha(vo.name)); Index: ssts-web/src/main/webapp/systemmanage/orgUnitExtView.js =================================================================== diff -u -r14505 -r15209 --- ssts-web/src/main/webapp/systemmanage/orgUnitExtView.js (.../orgUnitExtView.js) (revision 14505) +++ ssts-web/src/main/webapp/systemmanage/orgUnitExtView.js (.../orgUnitExtView.js) (revision 15209) @@ -187,6 +187,7 @@ var columns = [ {id:'operationDescription', header: "名称", width: 150, dataIndex: 'name', renderer : gotoPage, sortable: false}, {id :'barcode',header : '条码',width: 150, dataIndex: 'barcode', sortable: false}, + {header: "部门编码", width: 150, dataIndex: 'orgUnitCoding', sortable: false, menuDisabled: true}, {header: "负责人", width: 150, dataIndex: 'principal', sortable: false, menuDisabled: true}, {header: "分管领导", width: 150, dataIndex: 'subLeadName', sortable: false, menuDisabled: true}, {header: "数据来源", width: 100, dataIndex: 'source', sortable: false, menuDisabled: true}, //(陈家儒改) @@ -199,6 +200,7 @@ {name: 'parentId'}, {name: 'name'}, {name: 'barcode'}, + {name: 'orgUnitCoding'}, {name: 'principal'}, {name: 'source'}, {name: 'subLeadName'}