diff --git a/docs/脚本/Mysql/0818补丁.sql b/docs/脚本/Mysql/0818补丁.sql
index 2dd4c6c3..7c6ef079 100644
--- a/docs/脚本/Mysql/0818补丁.sql
+++ b/docs/脚本/Mysql/0818补丁.sql
@@ -1,4 +1,14 @@
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;
diff --git a/src/com/engine/organization/mapper/extend/ExtMapper.java b/src/com/engine/organization/mapper/extend/ExtMapper.java
index 7b91636a..2506e584 100644
--- a/src/com/engine/organization/mapper/extend/ExtMapper.java
+++ b/src/com/engine/organization/mapper/extend/ExtMapper.java
@@ -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);
}
diff --git a/src/com/engine/organization/mapper/extend/ExtMapper.xml b/src/com/engine/organization/mapper/extend/ExtMapper.xml
index cddb6748..f2029aae 100644
--- a/src/com/engine/organization/mapper/extend/ExtMapper.xml
+++ b/src/com/engine/organization/mapper/extend/ExtMapper.xml
@@ -54,6 +54,11 @@
where id = #{id}
+
+ delete
+ from ${tableName}
+ where id = #{id}
+
select ${fields}
diff --git a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml
index 38f2a5fc..9229ba2c 100644
--- a/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml
+++ b/src/com/engine/organization/mapper/extend/ExtendInfoMapper.xml
@@ -197,8 +197,9 @@
-
-
+
+
select JCL_FIELD_INFO_ID.currval from dual
INSERT INTO jcl_field_extendinfo
@@ -419,6 +420,7 @@
select ${fieldName}
from ${tableName}
+ where delete_type = 0
select
diff --git a/src/com/engine/organization/service/impl/CompServiceImpl.java b/src/com/engine/organization/service/impl/CompServiceImpl.java
index c710c247..28b15eaa 100644
--- a/src/com/engine/organization/service/impl/CompServiceImpl.java
+++ b/src/com/engine/organization/service/impl/CompServiceImpl.java
@@ -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,6 +201,11 @@ public class CompServiceImpl extends Service implements CompService {
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
Map map = new HashMap<>();
map.put("id", StringUtils.join(ids, ","));
+ 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);
}
diff --git a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java
index f7053a5f..de206a6c 100644
--- a/src/com/engine/organization/service/impl/DepartmentServiceImpl.java
+++ b/src/com/engine/organization/service/impl/DepartmentServiceImpl.java
@@ -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,6 +253,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
Map map = new HashMap<>();
map.put("id", StringUtils.join(ids, ","));
+ 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 deptListByPId = getDepartmentMapper().getDeptListByPId(moveParam.getId());
diff --git a/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java b/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java
index 60e662ab..463905b3 100644
--- a/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java
+++ b/src/com/engine/organization/service/impl/ImportCommonServiceImpl.java
@@ -554,6 +554,7 @@ public class ImportCommonServiceImpl extends Service implements ImportCommonServ
int lastRow = sheetAt.getLastRowNum();
List 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 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 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");
diff --git a/src/com/engine/organization/service/impl/JobServiceImpl.java b/src/com/engine/organization/service/impl/JobServiceImpl.java
index b058c925..9030636b 100644
--- a/src/com/engine/organization/service/impl/JobServiceImpl.java
+++ b/src/com/engine/organization/service/impl/JobServiceImpl.java
@@ -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 extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
+ List extendTitles = getExtendTitleMapper().getTitlesByGroupID(Long.parseLong(groupId));
if (CollectionUtils.isNotEmpty(extendTitles)) {
for (ExtendTitlePO extendTitle : extendTitles) {
List 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 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;
diff --git a/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java b/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java
index ca035625..f08e48e8 100644
--- a/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java
+++ b/src/com/engine/organization/service/impl/StaffPlanServiceImpl.java
@@ -70,7 +70,13 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
HasRightUtil.hasRight(user, RIGHT_NAME, false);
List 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 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);
}