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

@ -0,0 +1,27 @@
update jcl_field_extendinfo set isrequired = 1 where table_name ='JCL_ORG_JOB' and field_name ='job_name';
update jcl_field_extendinfo set isrequired = 1 where table_name ='JCL_ORG_JOB' and field_name ='ec_company';
update jcl_field_extendinfo set custom_value='["browser",{"valueSpan":"行业","replaceDatas":[{"itemorderid":"63","name":"行业","id":"63","parenttitle":"客户","title":"客户-行业"}],"value":"63"}]' where table_name ='JCL_ORG_COMP' and field_name='industry' ;
update jcl_field_extendinfo set custom_value='["browser",{"valueSpan":"人力资源","replaceDatas":[{"name":"人力资源","id":"1"}],"value":"1"}]' where table_name ='JCL_ORG_COMP' and field_name='comp_principal' ;
update jcl_field_extendinfo set custom_value='["textarea","",""]' where table_name ='JCL_ORG_COMP' and field_name='description' ;
update jcl_field_extendinfo set custom_value='["browser",{"valueSpan":"人力资源","replaceDatas":[{"name":"人力资源","id":"1"}],"value":"1"}]' where table_name ='JCL_ORG_DEPT' and field_name='dept_principal' ;
update jcl_field_extendinfo set custom_value='["input","int"]' where table_name ='JCL_ORG_DEPT' and field_name='show_order' ;
update jcl_field_extendinfo set custom_value='["textarea","",""]' where table_name ='JCL_ORG_DEPT' and field_name='description' ;
update jcl_field_extendinfo set custom_value='["textarea","",""]' where table_name ='JCL_ORG_JOB' and field_name='description' ;
update jcl_field_extendinfo set custom_value='["textarea","",""]' where table_name ='JCL_ORG_JOB' and field_name='work_duty' ;
update jcl_field_extendinfo set custom_value='["textarea","",""]' where table_name ='JCL_ORG_JOB' and field_name='work_authority';
delete from SystemRightDetail where rightid =2714;
delete from SystemRightsLanguage where id =2714;
delete from SystemRights where id =2714;
delete from SystemRightToGroup where rightid =2714;
delete from SystemRightType where id =37;
delete from SystemRightGroups where id =-23;
insert into SystemRights (id,rightdesc,righttype,detachable) values (2714,'组织数据导入','37',0);
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (2714,8,'Organization data import','Organization data import');
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (2714,9,'組織數據導入','組織數據導入');
insert into SystemRightsLanguage (id,languageid,rightname,rightdesc) values (2714,7,'组织数据导入','组织数据导入');
insert into SystemRightDetail (id,rightdetailname,rightdetail,rightid) values (43998,'组织数据导入权限','DataImport:All',2714);
insert into SystemRightToGroup(rightid,groupid) values (2714,-23);
insert into SystemRightGroups (id,rightgroupmark, rightgroupname, rightgroupremark) values(-23,'ORGANIZATION','组织管理权限组','组织管理');
insert into SystemRightType(id,rightTypeName,rightTypeDesc) VALUES (37,'组织管理','组织管理');

@ -1,6 +1,7 @@
package com.engine.organization.mapper.extend;
import com.engine.organization.entity.extend.param.ExtendInfoParams;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
@ -51,4 +52,6 @@ public interface ExtMapper {
* @return
*/
int updateTable(ExtendInfoParams params);
int deleteByID(@Param("tableName") String tableName, @Param("id") long id);
}

@ -54,6 +54,11 @@
</foreach>
where id = #{id}
</update>
<delete id="deleteByID">
delete
from ${tableName}
where id = #{id}
</delete>
<select id="listExt" parameterType="com.engine.organization.entity.extend.param.ExtendInfoParams" resultType="map">
select ${fields}

@ -197,8 +197,9 @@
</trim>
</insert>
<insert id="insertExtendInfo" parameterType="com.engine.organization.entity.extend.po.ExtendInfoPO" databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
<insert id="insertExtendInfo" parameterType="com.engine.organization.entity.extend.po.ExtendInfoPO"
databaseId="oracle">
<selectKey keyProperty="id" resultType="long" order="AFTER">
select JCL_FIELD_INFO_ID.currval from dual
</selectKey>
INSERT INTO jcl_field_extendinfo
@ -419,6 +420,7 @@
<select id="listFieldsByTableName" resultType="java.lang.Object">
select ${fieldName}
from ${tableName}
where delete_type = 0
</select>
<select id="getExtendInfosByIds" resultMap="BaseResultMap">
select

@ -23,6 +23,8 @@ import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.extend.ExtDTMapper;
import com.engine.organization.mapper.extend.ExtMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.service.CompService;
import com.engine.organization.service.ExtService;
@ -199,7 +201,12 @@ public class CompServiceImpl extends Service implements CompService {
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
Map<String, Object> map = new HashMap<>();
map.put("id", StringUtils.join(ids, ","));
new Thread(new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.CANCELED, map)).start();
for (Long id : ids) {
// 删除拓展表、明细表
MapperProxyFactory.getProxy(ExtMapper.class).deleteByID("jcl_org_compext", id);
MapperProxyFactory.getProxy(ExtDTMapper.class).deleteByMainID("jcl_org_compext_dt1", id);
}
new OrganizationRunable(user, LogModuleNameEnum.COMPANY, OperateTypeEnum.CANCELED, map).run();
return getCompMapper().deleteByIds(ids);
}

@ -29,6 +29,8 @@ import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtDTMapper;
import com.engine.organization.mapper.extend.ExtMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.mapper.job.JobMapper;
import com.engine.organization.service.DepartmentService;
@ -251,7 +253,12 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
Map<String, Object> map = new HashMap<>();
map.put("id", StringUtils.join(ids, ","));
new Thread(new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map)).start();
for (Long id : ids) {
// 删除拓展表、明细表
MapperProxyFactory.getProxy(ExtMapper.class).deleteByID("jcl_org_deptext", id);
MapperProxyFactory.getProxy(ExtDTMapper.class).deleteByMainID("jcl_org_deptext_dt1", id);
}
new OrganizationRunable(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map).run();
return getDepartmentMapper().deleteByIds(ids);
}
@ -508,7 +515,6 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
deptById.setParentComp(company);
deptById.setParentDept(null);
} else if ("1".equals(moveParam.getMoveType())) {
// TODO 判断是否选择子部门
Long department = moveParam.getDepartment();
OrganizationAssert.notNull(department, "请选择要转移到的部门");
List<DepartmentPO> deptListByPId = getDepartmentMapper().getDeptListByPId(moveParam.getId());

@ -554,6 +554,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
int lastRow = sheetAt.getLastRowNum();
List<ExtendInfoPO> extendInfoPOS = new ArrayList<>();
OrganizationAssert.isTrue(lastRow > 0, "导入数据为空");
short lastCellNum = sheetAt.getRow(0).getLastCellNum();
// 遍历每一行数据
@ -568,11 +569,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
String companyName = "";
historyDetailPO.setRowNums(String.valueOf(i + 1));
for (int cellIndex = 0; cellIndex < row.getLastCellNum(); cellIndex++) {
for (int cellIndex = 0; cellIndex < lastCellNum; cellIndex++) {
XSSFCell cell = row.getCell((short) cellIndex);
if (cell == null) {
continue;
}
String cellValue = getCellValue(cell).trim();
if (i == 0) {
// 首行 初始化字段信息
@ -607,7 +605,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
if ("comp_name".equals(infoPO.getFieldName())) {
historyDetailPO.setRelatedName(cellValue);
String[] split = cellValue.split(">");
if (split.length > 1) {
if (split.length > 0) {
if (split.length > 8) {
historyDetailPO.setOperateDetail("分部层级不能大于10");
historyDetailPO.setStatus("0");
@ -711,6 +709,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
int lastRow = sheetAt.getLastRowNum();
List<ExtendInfoPO> extendInfoPOS = new ArrayList<>();
OrganizationAssert.isTrue(lastRow > 0, "导入数据为空");
short lastCellNum = sheetAt.getRow(0).getLastCellNum();
// 遍历每一行数据
@ -726,11 +725,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
String departmentName = "";
historyDetailPO.setRowNums(String.valueOf(i + 1));
for (int cellIndex = 0; cellIndex < row.getLastCellNum(); cellIndex++) {
for (int cellIndex = 0; cellIndex < lastCellNum; cellIndex++) {
XSSFCell cell = row.getCell((short) cellIndex);
if (cell == null) {
continue;
}
String cellValue = getCellValue(cell).trim();
if (i == 0) {
// 首行 初始化字段信息
@ -765,7 +761,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
// 上级分部
if ("parent_comp".equals(infoPO.getFieldName())) {
String[] split = cellValue.split(">");
if (split.length > 1) {
if (split.length > 0) {
if (split.length > 8) {
historyDetailPO.setOperateDetail("分部层级不能大于10");
historyDetailPO.setStatus("0");
@ -793,7 +789,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
}
historyDetailPO.setRelatedName(cellValue);
String[] split = cellValue.split(">");
if (split.length > 1) {
if (split.length > 0) {
if (split.length > 8) {
historyDetailPO.setOperateDetail("部门层级不能大于10");
historyDetailPO.setStatus("0");
@ -898,7 +894,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
int lastRow = sheetAt.getLastRowNum();
List<ExtendInfoPO> extendInfoPOS = new ArrayList<>();
OrganizationAssert.isTrue(lastRow > 0, "导入数据为空");
short lastCellNum = sheetAt.getRow(0).getLastCellNum();
// 遍历每一行数据
nextRow:
@ -914,11 +910,8 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
String jobName = "";
historyDetailPO.setRowNums(String.valueOf(i + 1));
for (int cellIndex = 0; cellIndex < row.getLastCellNum(); cellIndex++) {
for (int cellIndex = 0; cellIndex < lastCellNum; cellIndex++) {
XSSFCell cell = row.getCell((short) cellIndex);
if (cell == null) {
continue;
}
String cellValue = getCellValue(cell).trim();
if (i == 0) {
// 首行 初始化字段信息
@ -953,7 +946,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
// 上级分部
if ("ec_company".equals(infoPO.getFieldName())) {
String[] split = cellValue.split(">");
if (split.length > 1) {
if (split.length > 0) {
if (split.length > 8) {
historyDetailPO.setOperateDetail("分部层级不能大于10");
historyDetailPO.setStatus("0");
@ -975,7 +968,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
if ("ec_department".equals(infoPO.getFieldName())) {
String[] split = cellValue.split(">");
if (split.length > 1) {
if (split.length > 0) {
if (split.length > 8) {
historyDetailPO.setOperateDetail("部门层级不能大于10");
historyDetailPO.setStatus("0");
@ -1003,7 +996,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
}
historyDetailPO.setRelatedName(cellValue);
String[] split = cellValue.split(">");
if (split.length > 1) {
if (split.length > 0) {
if (split.length > 8) {
historyDetailPO.setOperateDetail("岗位层级不能大于10");
historyDetailPO.setStatus("0");

@ -31,6 +31,8 @@ import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.mapper.codesetting.CodeRuleMapper;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtDTMapper;
import com.engine.organization.mapper.extend.ExtMapper;
import com.engine.organization.mapper.extend.ExtendTitleMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.mapper.job.JobMapper;
@ -276,7 +278,7 @@ public class JobServiceImpl extends Service implements JobService {
if ("0".equals(groupId)) {
groupId = GROUP_ID.toString();
}
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId));
if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : extendTitles) {
List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_JOB : JCL_ORG_JOBEXT, viewAttr, id, extendTitle.getId().toString(), "scheme_id", "parent_comp");
@ -406,6 +408,9 @@ public class JobServiceImpl extends Service implements JobService {
List<JobPO> jobsByIds = getJobMapper().getJobsByIds(ids);
int delete = getJobMapper().deleteByIds(ids);
for (JobPO jobsById : jobsByIds) {
// 删除拓展表、明细表
MapperProxyFactory.getProxy(ExtMapper.class).deleteByID("jcl_org_jobext", jobsById.getId());
MapperProxyFactory.getProxy(ExtDTMapper.class).deleteByMainID("jcl_org_jobext_dt1", jobsById.getId());
new Thread(new OrganizationRunable(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobsById)).start();
}
return delete;

@ -70,7 +70,13 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
List<StaffPlanPO> list = getStaffPlanMapper().listByNo(Util.null2String(param.getPlanNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
// 结束时间大于开始时间
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID());
String timeStart = param.getTimeStart();
String timeEnd = param.getTimeEnd();
Date startDate = DateUtil.parseToDate(timeStart);
Date endDate = DateUtil.parseToDate(timeEnd);
OrganizationAssert.isFalse(startDate.after(endDate), "开始时间不允许在结束时间之后");
return getStaffPlanMapper().insertIgnoreNull(staffPlanPO);
}
@ -84,6 +90,12 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
List<StaffPlanPO> list = getStaffPlanMapper().listByNo(Util.null2String(staffPlanPO.getPlanNo()));
OrganizationAssert.isEmpty(list, "编号不允许重复");
}
// 结束时间大于开始时间
String timeStart = param.getTimeStart();
String timeEnd = param.getTimeEnd();
Date startDate = DateUtil.parseToDate(timeStart);
Date endDate = DateUtil.parseToDate(timeEnd);
OrganizationAssert.isFalse(startDate.after(endDate), "开始时间不允许在结束时间之后");
return getStaffPlanMapper().updateStaffPlan(staffPlanPO);
}

@ -4,10 +4,14 @@ import com.engine.common.util.ServiceUtil;
import com.engine.hrm.service.impl.HrmJobServiceImpl;
import com.engine.hrm.service.impl.OrganizationServiceImpl;
import com.engine.organization.entity.commom.RecordInfo;
import com.engine.organization.entity.company.po.CompPO;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.extend.param.ExtendInfoParams;
import com.engine.organization.entity.job.po.JobPO;
import com.engine.organization.enums.LogModuleNameEnum;
import com.engine.organization.enums.OperateTypeEnum;
import com.engine.organization.mapper.comp.CompMapper;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.mapper.extend.ExtMapper;
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
import com.engine.organization.mapper.job.JobMapper;
@ -313,17 +317,33 @@ public class OrganizationRunable implements Runnable {
String forbiddenTag = Util.null2String(params.get("forbiddenTag"));
List<String> idList = new ArrayList<>();
String[] split = departmentIds.split(",");
for (String s : split) {
idList.add(EcHrmRelationUtil.getEcDepartmentId(s));
if (StringUtils.isBlank(forbiddenTag)) {
long currentTimeMillis = System.currentTimeMillis();
for (String s : split) {
DepartmentPO departmentPO = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(Long.parseLong(s));
params.put("dept_name_short", departmentPO.getDeptNameShort() + currentTimeMillis);
params.put("dept_name", departmentPO.getDeptName() + currentTimeMillis);
params.put("parent_comp", departmentPO.getParentComp());
params.put("parent_dept", departmentPO.getParentDept());
params.put("show_order", departmentPO.getShowOrder());
params.put("dept_no", departmentPO.getDeptNo());
params.put("dept_principal", departmentPO.getDeptPrincipal());
updateDepartment();
idList.add(EcHrmRelationUtil.getEcDepartmentId(s));
}
} else {
for (String s : split) {
idList.add(EcHrmRelationUtil.getEcDepartmentId(s));
}
}
Map<String, Object> map = new HashMap<>();
map.put("id", StringUtils.join(idList, ","));
if (StringUtils.isBlank(forbiddenTag) || "1".equals(forbiddenTag)) {
// 封存
ServiceUtil.getService(OrganizationServiceImpl.class, user).doDepartmentCancel(map, user);
} else {
if ("0".equals(forbiddenTag)) {
// 解封
ServiceUtil.getService(OrganizationServiceImpl.class, user).doDepartmentISCanceled(map, user);
} else {
// 封存
ServiceUtil.getService(OrganizationServiceImpl.class, user).doDepartmentCancel(map, user);
}
}
@ -407,17 +427,33 @@ public class OrganizationRunable implements Runnable {
String forbiddenTag = Util.null2String(params.get("forbiddenTag"));
List<String> idList = new ArrayList<>();
String[] split = companyIds.split(",");
for (String s : split) {
idList.add(EcHrmRelationUtil.getEcCompanyId(s));
if (StringUtils.isBlank(forbiddenTag)) {
long currentTimeMillis = System.currentTimeMillis();
for (String s : split) {
// 更新名称为:名称+时间戳
CompPO comp = MapperProxyFactory.getProxy(CompMapper.class).listById(Long.parseLong(s));
params.put("parent_company", comp.getParentCompany());
params.put("comp_no", comp.getCompNo());
params.put("comp_name", comp.getCompName() + currentTimeMillis);
params.put("comp_name_short", comp.getCompNameShort() + currentTimeMillis);
params.put("show_order", comp.getShowOrder());
updateCompany();
idList.add(EcHrmRelationUtil.getEcCompanyId(s));
}
} else {
for (String s : split) {
idList.add(EcHrmRelationUtil.getEcCompanyId(s));
}
}
Map<String, Object> map = new HashMap<>();
map.put("id", StringUtils.join(idList, ","));
if (StringUtils.isBlank(forbiddenTag) || "1".equals(forbiddenTag)) {
// 封存
ServiceUtil.getService(OrganizationServiceImpl.class, user).doSubCompanyCancel(map, user);
} else {
if ("0".equals(forbiddenTag)) {
// 解封
ServiceUtil.getService(OrganizationServiceImpl.class, user).doSubCompanyISCanceled(map, user);
} else {
// 删除封存、禁用封存
ServiceUtil.getService(OrganizationServiceImpl.class, user).doSubCompanyCancel(map, user);
}
}

Loading…
Cancel
Save