BUG修复
This commit is contained in:
parent
afe4813427
commit
b11251701a
|
|
@ -145,4 +145,6 @@ public interface JobMapper {
|
|||
int selectByConditions(@Param("resourcePO") ResourcePO resourcePO);
|
||||
|
||||
List<String> listUsedId();
|
||||
|
||||
List<String> isAllowDelete(@Param("jobId") Long jobId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -502,6 +502,12 @@
|
|||
inner join hrmresource h on t.ec_jobtitle = h.jobtitle and t.ec_company = h.subcompanyid1 and
|
||||
t.ec_department = h.departmentid
|
||||
</select>
|
||||
<select id="isAllowDelete" resultType="java.lang.String">
|
||||
select t.id
|
||||
from jcl_org_job t
|
||||
inner join hrmresource h on t.ec_jobtitle = h.jobtitle and t.ec_company = h.subcompanyid1 and
|
||||
t.ec_department = h.departmentid and t.id = #{jobId}
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateJobCompany">
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
|
||||
if (2 == viewAttr) {
|
||||
params.put("viewattr", viewAttr);
|
||||
groupList = getCompanyConditionGroups(params);
|
||||
groupList = getCompanyConditionGroups(true, params);
|
||||
} else {
|
||||
HrmFieldGroupComInfo HrmFieldGroupComInfo = new HrmFieldGroupComInfo();
|
||||
HrmFieldComInfo HrmFieldComInfo = new HrmFieldComInfo();
|
||||
|
|
@ -349,7 +349,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
public Map<String, Object> getCompSaveForm(Map<String, Object> params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
apiDatas.put("condition", getCompanyConditionGroups(params));
|
||||
apiDatas.put("condition", getCompanyConditionGroups(false, params));
|
||||
return apiDatas;
|
||||
|
||||
}
|
||||
|
|
@ -412,7 +412,7 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
}
|
||||
}
|
||||
|
||||
private List<SearchConditionGroup> getCompanyConditionGroups(Map<String, Object> params) {
|
||||
private List<SearchConditionGroup> getCompanyConditionGroups(Boolean showAll, Map<String, Object> params) {
|
||||
String id = Util.null2String(params.get("id"));
|
||||
int viewAttr = Util.getIntValue(Util.null2String(params.get("viewattr")), 1);
|
||||
|
||||
|
|
@ -443,7 +443,11 @@ public class CompServiceImpl extends Service implements CompService {
|
|||
hfm.getCustomData(Util.getIntValue(id));
|
||||
List lsGroup = hfm.getLsGroup();
|
||||
List<SearchConditionGroup> groupList = new ArrayList<>();
|
||||
for (int tmp = 0; lsGroup != null && tmp < lsGroup.size(); tmp++) {
|
||||
int lsSize = 1;
|
||||
if (showAll && lsGroup != null) {
|
||||
lsSize = lsGroup.size();
|
||||
}
|
||||
for (int tmp = 0; tmp < lsSize; tmp++) {
|
||||
String groupId = (String) lsGroup.get(tmp);
|
||||
List lsField = hfm.getLsField(groupId);
|
||||
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
String id = Util.null2String(params.get("id"));
|
||||
if (2 == viewAttr) {
|
||||
params.put("viewattr", viewAttr);
|
||||
groupList = getDepartmentConditionGroups(params);
|
||||
groupList = getDepartmentConditionGroups(true, params);
|
||||
} else {
|
||||
|
||||
HrmFieldGroupComInfo HrmFieldGroupComInfo = new HrmFieldGroupComInfo();
|
||||
|
|
@ -405,7 +405,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
public Map<String, Object> getSaveForm(Map<String, Object> params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
apiDatas.put("condition", getDepartmentConditionGroups(params));
|
||||
apiDatas.put("condition", getDepartmentConditionGroups(false, params));
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
|
|
@ -835,7 +835,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
}
|
||||
}
|
||||
|
||||
private List<SearchConditionGroup> getDepartmentConditionGroups(Map<String, Object> params) {
|
||||
private List<SearchConditionGroup> getDepartmentConditionGroups(Boolean showAll, Map<String, Object> params) {
|
||||
List<SearchConditionGroup> groupList = new ArrayList<>();
|
||||
List<SearchConditionItem> itemList;
|
||||
|
||||
|
|
@ -863,7 +863,11 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
hfm.isReturnDecryptData(true);
|
||||
hfm.getCustomData(Util.getIntValue(id));
|
||||
List lsGroup = hfm.getLsGroup();
|
||||
for (int tmp = 0; lsGroup != null && tmp < lsGroup.size(); tmp++) {
|
||||
int lsSize = 1;
|
||||
if (showAll && lsGroup != null) {
|
||||
lsSize = lsGroup.size();
|
||||
}
|
||||
for (int tmp = 0; tmp < lsSize; tmp++) {
|
||||
String groupId = (String) lsGroup.get(tmp);
|
||||
List lsField = hfm.getLsField(groupId);
|
||||
|
||||
|
|
|
|||
|
|
@ -227,12 +227,12 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
// 工作地点
|
||||
SearchConditionItem workplaceItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "工作地点", "workplace");
|
||||
// 禁用标记
|
||||
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
||||
SearchConditionOption enableOption = new SearchConditionOption("true", "启用");
|
||||
SearchConditionOption disableOption = new SearchConditionOption("false", "封存");
|
||||
selectOptions.add(enableOption);
|
||||
selectOptions.add(disableOption);
|
||||
SearchConditionItem forbiddenTagItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "封存", "forbiddenTag");
|
||||
//List<SearchConditionOption> selectOptions = new ArrayList<>();
|
||||
//SearchConditionOption enableOption = new SearchConditionOption("true", "启用");
|
||||
//SearchConditionOption disableOption = new SearchConditionOption("false", "封存");
|
||||
//selectOptions.add(enableOption);
|
||||
//selectOptions.add(disableOption);
|
||||
//SearchConditionItem forbiddenTagItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "封存", "forbiddenTag");
|
||||
|
||||
conditionItems.add(jobNoItem);
|
||||
conditionItems.add(jobTitleNameItem);
|
||||
|
|
@ -240,7 +240,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
conditionItems.add(parentDeptBrowserItem);
|
||||
conditionItems.add(isKeyItem);
|
||||
conditionItems.add(workplaceItem);
|
||||
conditionItems.add(forbiddenTagItem);
|
||||
//conditionItems.add(forbiddenTagItem);
|
||||
|
||||
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
||||
apiDatas.put("conditions", addGroups);
|
||||
|
|
@ -479,6 +479,10 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
OrganizationAssert.notEmpty(ids, "请选择要删除的数据");
|
||||
List<JobPO> jobsByIds = getJobMapper().getJobsByIds(ids);
|
||||
for (JobPO jobsById : jobsByIds) {
|
||||
// 判断是否可以删除
|
||||
List<String> allowDelete = getJobMapper().isAllowDelete(jobsById.getId());
|
||||
OrganizationAssert.isTrue(CollectionUtils.isEmpty(allowDelete), "该岗位存在引用,不允许删除");
|
||||
|
||||
// jobsById.setForbiddenTag(1);
|
||||
//new OrganizationSyncEc(user, LogModuleNameEnum.JOB, OperateTypeEnum.CANCELED, null, jobsById).sync();
|
||||
// 删除拓展表、明细表
|
||||
|
|
@ -592,7 +596,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue