Commit c1f3fe4f by 宋祥

1.组织机构顶级为类型公司

parent 7aca0625
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>hggp_dev-sx</name> <name>hggp</name>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
......
...@@ -175,13 +175,7 @@ public class ServiceHGXSOrg extends ServiceBase { ...@@ -175,13 +175,7 @@ public class ServiceHGXSOrg extends ServiceBase {
dbOrg.setOrgId(orgId); dbOrg.setOrgId(orgId);
this.syncDcDeptAdd(accountCode, dcDeptList, dbOrg, dbPz009); this.syncDcDeptAdd(accountCode, dcDeptList, dbOrg, dbPz009);
} else { } else {
Map updateMap = new HashMap(); this.syncDcDeptModify(dcDeptList, orgId);
updateMap.put(Org.FIELD_ORG_ID, orgId);
updateMap.put(Org.FIELD_ORG_CNAME, dcDeptList.getNodeText());
updateMap.put(Org.FIELD_REC_REVISOR, "System");
updateMap.put(Org.FIELD_REC_REVISE_TIME, DateUtils.shortDateTime());
updateMap.put(Org.FIELD_IS_DELETED, DeleteFlagEnum.UN_REMOVE.getCode().toString());
dao.update(HgXsSqlConstant.HgXsOrg.UPDATE_ORG_CNAME, updateMap);
} }
} }
} }
...@@ -190,7 +184,7 @@ public class ServiceHGXSOrg extends ServiceBase { ...@@ -190,7 +184,7 @@ public class ServiceHGXSOrg extends ServiceBase {
* 新增数据 * 新增数据
* *
* @param accountCode * @param accountCode
* @param zbDept * @param dcDeptList
* @param dbOrg * @param dbOrg
* @param dbPz009 * @param dbPz009
*/ */
...@@ -199,7 +193,9 @@ public class ServiceHGXSOrg extends ServiceBase { ...@@ -199,7 +193,9 @@ public class ServiceHGXSOrg extends ServiceBase {
dbOrg.setAccountCode(accountCode); dbOrg.setAccountCode(accountCode);
dbOrg.setOrgEname(orgId); dbOrg.setOrgEname(orgId);
dbOrg.setOrgCname(dcDeptList.getNodeText()); dbOrg.setOrgCname(dcDeptList.getNodeText());
dbOrg.setOrgType(OrgTypeEnum.DEPT.getCode()); // parentId=-1:表示是组织机构顶级
dbOrg.setOrgType("-1".equals(dcDeptList.getParentId()) ? OrgTypeEnum.COMPANY.getCode()
: OrgTypeEnum.DEPT.getCode());
dbOrg.setParentOrgId("-1".equals(dcDeptList.getParentId()) dbOrg.setParentOrgId("-1".equals(dcDeptList.getParentId())
? accountCode : dbPz009.getLoginPrefix() + dcDeptList.getParentId()); ? accountCode : dbPz009.getLoginPrefix() + dcDeptList.getParentId());
dbOrg.setEstablishDate("20240101"); dbOrg.setEstablishDate("20240101");
...@@ -212,4 +208,20 @@ public class ServiceHGXSOrg extends ServiceBase { ...@@ -212,4 +208,20 @@ public class ServiceHGXSOrg extends ServiceBase {
dao.insert("XSOG01.insert", dbOrg); dao.insert("XSOG01.insert", dbOrg);
} }
/**
* 修改
*
* @param dcDeptList
* @param orgId
*/
private void syncDcDeptModify(DcDeptList dcDeptList, String orgId) {
Map updateMap = new HashMap();
updateMap.put(Org.FIELD_ORG_ID, orgId);
updateMap.put(Org.FIELD_ORG_CNAME, dcDeptList.getNodeText());
updateMap.put(Org.FIELD_REC_REVISOR, "System");
updateMap.put(Org.FIELD_REC_REVISE_TIME, DateUtils.shortDateTime());
updateMap.put(Org.FIELD_IS_DELETED, DeleteFlagEnum.UN_REMOVE.getCode().toString());
dao.update(HgXsSqlConstant.HgXsOrg.UPDATE_ORG_CNAME, updateMap);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment