!121 复制分部 表结构更新

Merge pull request !121 from dxfeng/feature/dxf
pull/122/MERGE
dxfeng 3 years ago committed by Gitee
commit c241a20cb4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -297,6 +297,64 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 (
CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (ID) CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (ID)
); );
-- JCL_ORG_HRMRESOURCE
CREATE TABLE JCL_ORG_HRMRESOURCE (
ID NUMBER NOT NULL,
WORK_CODE NVARCHAR2(60) NULL,
LOGIN_ID NVARCHAR2(60) NULL,
LAST_NAME NVARCHAR2(60) NULL,
SEX NUMBER NULL,
ACCOUNT_TYPE NUMBER NULL,
BELONG_TO NUMBER NULL,
COMPANY_ID NUMBER NULL,
DEPARTMENT_ID NUMBER NULL,
JOB_ACTIVITY NUMBER NULL,
JOB_TITLE NUMBER NULL,
JOB_CALL NUMBER NULL,
JOB_LEVEL NUMBER NULL,
JOB_GROUP_ID NUMBER NULL,
JOB_ACTIVITY_DESC NVARCHAR2(200) NULL,
STATUS NUMBER NULL,
SYSTEM_LANGUAGE NUMBER NULL,
RESOURCE_IMAGE_ID NVARCHAR2(1000) NULL,
MESSAGER_URL NVARCHAR2(1000) NULL,
LOCATION_ID NUMBER NULL,
MANAGER_ID NUMBER NULL,
ASSISTANT_ID NUMBER NULL,
MOBILE NVARCHAR2(60) NULL,
TELEPHONE NVARCHAR2(60) NULL,
MOBILE_CALL NVARCHAR2(60) NULL,
FAX NVARCHAR2(60) NULL,
EMAIL NVARCHAR2(60) NULL,
WORKROOM NVARCHAR2(60) NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL,
UPDATE_TIME DATE NULL,
CONSTRAINT JCL_ORG_HRMRESOURCE_PK PRIMARY KEY (ID)
);
-- JCL_ORG_HRMRESOURCEEXT
CREATE TABLE JCL_ORG_HRMRESOURCEEXT (
ID NUMBER NOT NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL,
UPDATE_TIME DATE NULL,
CONSTRAINT JCL_ORG_HRMRESOURCEEXT_PK PRIMARY KEY (ID)
);
-- JCL_ORG_HRMRESOURCEEXT_DT1
CREATE TABLE JCL_ORG_HRMRESOURCEEXT_DT1 (
ID NUMBER NOT NULL,
MAINID NUMBER NULL,
CREATOR NUMBER NULL,
DELETE_TYPE NUMBER NULL,
CREATE_TIME DATE NULL,
UPDATE_TIME DATE NULL,
CONSTRAINT JCL_ORG_HRMRESOURCEEXT_DT1_PK PRIMARY KEY (ID)
);
-- JCL_ORG_STAFFPLAN -- JCL_ORG_STAFFPLAN
CREATE TABLE JCL_ORG_STAFFPLAN ( CREATE TABLE JCL_ORG_STAFFPLAN (
ID NUMBER NOT NULL, ID NUMBER NOT NULL,

@ -295,6 +295,64 @@ CREATE TABLE JCL_ORG_JOBEXT_DT1 (
CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (id) CONSTRAINT JCL_ORG_JOBEXT_DT1_PK PRIMARY KEY (id)
); );
-- JCL_ORG_HRMRESOURCE
CREATE TABLE JCL_ORG_HRMRESOURCE (
id int IDENTITY(1,1) NOT NULL,
work_code varchar(60) null,
login_id varchar(60) null,
last_name varchar(60) null,
sex int null,
account_type int null,
belong_to int null,
company_id int null,
department_id int null,
job_activity int null,
job_title int null,
job_call int null,
job_level int null,
job_group_id int null,
job_activity_desc varchar(200) null,
status int null,
system_language int null,
resource_image_id varchar(1000) null,
messager_url varchar(1000) null,
location_id int null,
manager_id int null,
assistant_id int null,
mobile varchar(60) null,
telephone varchar(60) null,
mobile_call varchar(60) null,
fax varchar(60) null,
email varchar(60) null,
workroom varchar(60) null,
creator int null,
delete_type int null,
create_time datetime null,
update_time datetime null,
CONSTRAINT JCL_ORG_HRMRESOURCE_PK PRIMARY KEY (id)
);
-- JCL_ORG_HRMRESOURCEEXT
CREATE TABLE JCL_ORG_HRMRESOURCEEXT (
id int IDENTITY(1,1) NOT NULL,
creator int null,
delete_type int null,
create_time datetime null,
update_time datetime null,
CONSTRAINT JCL_ORG_HRMRESOURCEEXT_PK PRIMARY KEY (id)
);
-- JCL_ORG_HRMRESOURCEEXT_DT1
CREATE TABLE JCL_ORG_HRMRESOURCEEXT_DT1 (
id int IDENTITY(1,1) NOT NULL,
mainid int NULL,
creator int null,
delete_type int null,
create_time datetime null,
update_time datetime null,
CONSTRAINT JCL_ORG_HRMRESOURCEEXT_DT1_PK PRIMARY KEY (id)
);
-- JCL_ORG_STAFFPLAN -- JCL_ORG_STAFFPLAN
CREATE TABLE JCL_ORG_STAFFPLAN ( CREATE TABLE JCL_ORG_STAFFPLAN (

@ -1,9 +1,11 @@
package com.engine.organization.service; package com.engine.organization.service;
import com.api.browser.bean.SearchConditionGroup;
import com.engine.organization.entity.company.param.CompSearchParam; import com.engine.organization.entity.company.param.CompSearchParam;
import com.engine.organization.entity.department.param.DepartmentMoveParam; import com.engine.organization.entity.department.param.DepartmentMoveParam;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -83,6 +85,14 @@ public interface CompService {
* @return * @return
*/ */
Map<String, Object> getCompSaveForm(); Map<String, Object> getCompSaveForm();
/**
*
*
* @return
*/
List<SearchConditionGroup> getMoveForm();
/** /**
* *
* *

@ -11,6 +11,7 @@ import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.hrm.entity.RuleCodeType; import com.engine.hrm.entity.RuleCodeType;
import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.DeleteParam;
import com.engine.organization.entity.codesetting.po.CodeRulePO; import com.engine.organization.entity.codesetting.po.CodeRulePO;
import com.engine.organization.entity.company.bo.CompBO; import com.engine.organization.entity.company.bo.CompBO;
import com.engine.organization.entity.company.dto.CompListDTO; import com.engine.organization.entity.company.dto.CompListDTO;
@ -294,11 +295,29 @@ public class CompServiceImpl extends Service implements CompService {
} }
@Override
public List<SearchConditionGroup> getMoveForm() {
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> condition = new ArrayList<>();
SearchConditionItem compBrowserItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "转移到", "161", "company", "compBrowser");
condition.add(compBrowserItem);
addGroups.add(new SearchConditionGroup("", true, condition));
return addGroups;
}
@Override @Override
public int moveCompany(DepartmentMoveParam moveParam) { public int moveCompany(DepartmentMoveParam moveParam) {
Long targetCompanyId = moveParam.getCompany(); Long targetCompanyId = moveParam.getCompany();
OrganizationAssert.notNull(targetCompanyId, "请选择要转移到的分部"); OrganizationAssert.notNull(targetCompanyId, "请选择要转移到的分部");
Long companyId = moveParam.getId(); Long companyId = moveParam.getId();
// 判断目标分部是否为它本身以及子元素
Set<Long> disableIds = new HashSet<>();
disableIds.add(companyId);
List<CompPO> compPOS = getCompMapper().listChild(DeleteParam.builder().ids(companyId.toString()).build().getIds());
if (CollectionUtils.isNotEmpty(compPOS)) {
addDisableIds(disableIds, compPOS);
}
OrganizationAssert.isFalse(disableIds.contains(targetCompanyId), "请勿选择当前分部本身及其子分部");
CompPO compPO = getCompMapper().listById(companyId); CompPO compPO = getCompMapper().listById(companyId);
compPO.setParentCompany(targetCompanyId); compPO.setParentCompany(targetCompanyId);
return getCompMapper().updateBaseComp(compPO); return getCompMapper().updateBaseComp(compPO);
@ -356,4 +375,18 @@ public class CompServiceImpl extends Service implements CompService {
return generateCode; return generateCode;
} }
/**
* ID
*
* @param disableIds
* @param compPOS
*/
private void addDisableIds(Set<Long> disableIds, List<CompPO> compPOS) {
for (CompPO compPO : compPOS) {
disableIds.add(compPO.getId());
List<CompPO> childCompPOS = getCompMapper().listChild(DeleteParam.builder().ids(compPO.getId().toString()).build().getIds());
addDisableIds(disableIds, childCompPOS);
}
}
} }

@ -63,7 +63,7 @@ public class CompController {
@POST @POST
@Path("/saveBaseComp") @Path("/saveBaseComp")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody Map<String,Object> params) { public ReturnResult saveBaseComp(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map<String, Object> params) {
try { try {
User user = HrmUserVarify.getUser(request, response); User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getCompWrapper(user).saveBaseComp(params)); return ReturnResult.successed(getCompWrapper(user).saveBaseComp(params));
@ -212,6 +212,18 @@ public class CompController {
} }
} }
@GET
@Path("/getMoveForm")
@Produces(MediaType.APPLICATION_JSON)
public ReturnResult getMoveForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
try {
User user = HrmUserVarify.getUser(request, response);
return ReturnResult.successed(getCompWrapper(user).getMoveForm());
} catch (Exception e) {
return ReturnResult.exceptionHandle(e.getMessage());
}
}
@POST @POST
@Path("/moveCompany") @Path("/moveCompany")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)

@ -1,5 +1,6 @@
package com.engine.organization.wrapper; package com.engine.organization.wrapper;
import com.api.browser.bean.SearchConditionGroup;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.organization.entity.company.param.CompSearchParam; import com.engine.organization.entity.company.param.CompSearchParam;
@ -9,6 +10,7 @@ import com.engine.organization.service.impl.CompServiceImpl;
import weaver.hrm.User; import weaver.hrm.User;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
@ -119,4 +121,8 @@ public class CompWrapper extends Service {
return getCompService(user).moveCompany(moveParam); return getCompService(user).moveCompany(moveParam);
} }
public List<SearchConditionGroup> getMoveForm() {
return getCompService(user).getMoveForm();
}
} }

Loading…
Cancel
Save