|
@@ -133,17 +133,15 @@ public class OrgService extends BaseService<Org> {
|
|
|
public ResponseResultVO<?> insert(OrgVO orgVO) {
|
|
public ResponseResultVO<?> insert(OrgVO orgVO) {
|
|
|
// 转化实体
|
|
// 转化实体
|
|
|
Org organization = orgConvert.convertToPo(orgVO);
|
|
Org organization = orgConvert.convertToPo(orgVO);
|
|
|
- // 获取显示顺序
|
|
|
|
|
- Integer displayNo = commonService.getMaxDisplayNo(Constant.DisplayNoTable.ORG);
|
|
|
|
|
Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.ORG.getName(), true);
|
|
Map<String, Object> codeMap = commonService.getUniqueNoteCode(Constant.docNameConstant.ORG.getName(), true);
|
|
|
// 获取编码和主键UuId
|
|
// 获取编码和主键UuId
|
|
|
- organization.setDisplayNo(displayNo);
|
|
|
|
|
organization.setOrgId(codeMap.get("outId").toString());
|
|
organization.setOrgId(codeMap.get("outId").toString());
|
|
|
organization.setOrgCode(codeMap.get("outNote").toString());
|
|
organization.setOrgCode(codeMap.get("outNote").toString());
|
|
|
|
|
|
|
|
//查询 本次要加的 部门的 父级下 最大的DisplayNo 然后加1 就是现在要加的DisplayNo
|
|
//查询 本次要加的 部门的 父级下 最大的DisplayNo 然后加1 就是现在要加的DisplayNo
|
|
|
Map<String, Object> param = new HashMap<>();
|
|
Map<String, Object> param = new HashMap<>();
|
|
|
param.put("otherCond", "parent_id = #{parentID} ::uuid");
|
|
param.put("otherCond", "parent_id = #{parentID} ::uuid");
|
|
|
|
|
+ param.put("parentId",organization.getParentId());
|
|
|
organization.setDisplayNo(commonService.getMaxDisplayNo(Constant.DisplayNoTable.ORG ,param));
|
|
organization.setDisplayNo(commonService.getMaxDisplayNo(Constant.DisplayNoTable.ORG ,param));
|
|
|
if (organization.getParentId() != null) {
|
|
if (organization.getParentId() != null) {
|
|
|
Org org = orgMapper.selectById(organization.getParentId());
|
|
Org org = orgMapper.selectById(organization.getParentId());
|
|
@@ -151,7 +149,6 @@ public class OrgService extends BaseService<Org> {
|
|
|
organization.setTopId(org.getTopId());
|
|
organization.setTopId(org.getTopId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 插入组织部门数据
|
|
// 插入组织部门数据
|
|
|
super.insert(organization);
|
|
super.insert(organization);
|
|
|
//执行函数
|
|
//执行函数
|