BUG修复

pull/201/MERGE^2
dxfeng 3 years ago
parent 9c64467cc8
commit ff8660a586

@ -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;

@ -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,6 +201,11 @@ public class CompServiceImpl extends Service implements CompService {
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
Map<String, Object> 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);
}

@ -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<String, Object> 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<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);
}

Loading…
Cancel
Save