组织人事测试、优化
This commit is contained in:
parent
f671e4b1e7
commit
f035662fb6
|
|
@ -9,6 +9,7 @@ target/
|
|||
.idea
|
||||
|
||||
/src/test
|
||||
/src/rebel.xml
|
||||
/src/META-INF
|
||||
|
||||
/log
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class CompListDTO {
|
|||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableTitle(title = "编号", dataIndex = "compNo", key = "compNo",sorter = true)
|
||||
@TableTitle(title = "编号", dataIndex = "compNo", key = "compNo")
|
||||
private String compNo;
|
||||
|
||||
/**
|
||||
|
|
@ -73,7 +73,7 @@ public class CompListDTO {
|
|||
@TableTitle(title = "负责人", dataIndex = "compPrincipal", key = "compPrincipal")
|
||||
private String compPrincipal;
|
||||
|
||||
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder")
|
||||
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder", sorter = true)
|
||||
private Integer showOrder;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class DepartmentListDTO {
|
|||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder")
|
||||
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder",sorter = true)
|
||||
private int showOrder;
|
||||
|
||||
///**
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ public class JobBO {
|
|||
.description(param.getDescription())
|
||||
.workDuty(param.getWorkDuty())
|
||||
.workAuthority(param.getWorkAuthority())
|
||||
.showOrder(param.getShowOrder())
|
||||
.forbiddenTag(param.getForbiddenTag() == null ? null : param.getForbiddenTag() ? 0 : 1)
|
||||
.deleteType(0)
|
||||
.createTime(new Date())
|
||||
|
|
@ -88,6 +89,7 @@ public class JobBO {
|
|||
.parentJob(e.getParentJob())
|
||||
.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName())
|
||||
.isKey(JobTransMethod.getIsKeySpan(e.getIsKey()))
|
||||
.showOrder(e.getShowOrder())
|
||||
.forbiddenTag(e.getForbiddenTag())
|
||||
.build()).collect(Collectors.toList());
|
||||
Map<Long, List<JobListDTO>> collects = dtoList.stream().filter(item -> null != item.getParentJob() && 0 != item.getParentJob()).collect(Collectors.groupingBy(JobListDTO::getParentJob));
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.engine.organization.entity.job.dto;
|
|||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import com.engine.organization.annotation.TableTitle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -22,15 +21,7 @@ import java.util.List;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@OrganizationTable(pageId = "0efea835-dfc5-11ec-a09e-00e04c680716",
|
||||
tableType = WeaTableType.NONE,
|
||||
operates = {
|
||||
@OrganizationTableOperate(text = "编辑"),
|
||||
@OrganizationTableOperate(index = "1", text = "删除"),
|
||||
@OrganizationTableOperate(index = "2", text = "合并"),
|
||||
@OrganizationTableOperate(index = "3", text = "转移"),
|
||||
@OrganizationTableOperate(index = "4", text = "联查岗位"),
|
||||
@OrganizationTableOperate(index = "4", text = "联查人员")
|
||||
})
|
||||
tableType = WeaTableType.NONE)
|
||||
public class JobListDTO {
|
||||
/**
|
||||
* 主键
|
||||
|
|
@ -82,6 +73,12 @@ public class JobListDTO {
|
|||
@TableTitle(title = "是否关键岗", dataIndex = "isKey", key = "isKey")
|
||||
private String isKey;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@TableTitle(title = "显示顺序", dataIndex = "showOrder", key = "showOrder", sorter = true)
|
||||
private Integer showOrder;
|
||||
|
||||
/**
|
||||
* 禁用标记
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -74,6 +74,11 @@ public class JobSearchParam extends BaseQueryParam {
|
|||
*/
|
||||
private Boolean forbiddenTag;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer showOrder;
|
||||
|
||||
private Long subcompanyid1;
|
||||
|
||||
private Long departmentid;
|
||||
|
|
|
|||
|
|
@ -74,6 +74,10 @@ public class JobPO {
|
|||
* 禁用标记
|
||||
*/
|
||||
private Integer forbiddenTag;
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer showOrder;
|
||||
|
||||
|
||||
private Long creator;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ import lombok.NoArgsConstructor;
|
|||
@OrganizationTable(pageId = "e04abd72-dbd6-11ec-b69e-00ffcbed7508",
|
||||
fields = "t.id,t.is_used, t.plan_no, t.plan_name, t.plan_year, t.time_start, t.time_end, t.forbidden_tag",
|
||||
fromSql = "FROM jcl_org_staffplan t ",
|
||||
orderby = "id desc",
|
||||
orderby = "plan_no",
|
||||
sortway = "asc",
|
||||
primarykey = "id",
|
||||
operates = {
|
||||
@OrganizationTableOperate(text = "编辑"),
|
||||
|
|
@ -46,7 +47,7 @@ public class StaffPlanTableVO {
|
|||
/**
|
||||
* 编号
|
||||
*/
|
||||
@OrganizationTableColumn(text = "编号", width = "16%", column = "plan_no")
|
||||
@OrganizationTableColumn(text = "编号", width = "16%", column = "plan_no", orderkey = "plan_no")
|
||||
private String planNo;
|
||||
/**
|
||||
* 名称
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
<result column="work_duty" property="workDuty"/>
|
||||
<result column="work_authority" property="workAuthority"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="show_order" property="showOrder"/>
|
||||
<result column="forbidden_tag" property="forbiddenTag"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
|
|
@ -40,6 +41,7 @@
|
|||
t.description,
|
||||
t.work_duty,
|
||||
t.work_authority,
|
||||
t.show_order,
|
||||
t.forbidden_tag
|
||||
</sql>
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.job.po.JobPO"
|
||||
|
|
@ -96,6 +98,9 @@
|
|||
<if test="workAuthority != null ">
|
||||
work_authority,
|
||||
</if>
|
||||
<if test="showOrder != null ">
|
||||
show_order,
|
||||
</if>
|
||||
forbidden_tag,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
|
|
@ -148,6 +153,9 @@
|
|||
<if test="workAuthority != null ">
|
||||
#{workAuthority},
|
||||
</if>
|
||||
<if test="showOrder != null ">
|
||||
#{showOrder},
|
||||
</if>
|
||||
0,
|
||||
</trim>
|
||||
</insert>
|
||||
|
|
@ -167,6 +175,7 @@
|
|||
description=#{description},
|
||||
work_duty=#{workDuty},
|
||||
work_authority=#{workAuthority},
|
||||
show_order=#{showOrder},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
|
@ -225,6 +234,7 @@
|
|||
<if test=" forbiddenTag != null ">
|
||||
and t.forbidden_tag = #{forbiddenTag}
|
||||
</if>
|
||||
order by show_order
|
||||
</select>
|
||||
|
||||
<select id="listNoFilter" resultType="com.engine.organization.entity.job.dto.JobListDTO">
|
||||
|
|
@ -243,7 +253,7 @@
|
|||
t.sequence_id = c.id
|
||||
left join jcl_org_scheme d on
|
||||
t.scheme_id = d.id
|
||||
WHERE t.delete_type = 0
|
||||
WHERE t.delete_type = 0 order by show_order
|
||||
</select>
|
||||
|
||||
<select id="getJobById" resultMap="BaseResultMap">
|
||||
|
|
|
|||
|
|
@ -309,7 +309,8 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
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_DEPT : JCL_ORG_DEPTEXT, viewAttr, id, extendTitle.getId().toString(), "dept_no");
|
||||
List<SearchConditionItem> items = getExtService(user).getExtForm(user, EXTEND_TYPE + "", GROUP_ID.equals(Long.parseLong(groupId)) ? JCL_ORG_DEPT : JCL_ORG_DEPTEXT, viewAttr, id, extendTitle.getId().toString(), "");
|
||||
|
||||
if (CollectionUtils.isNotEmpty(items)) {
|
||||
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
|
||||
}
|
||||
|
|
@ -560,7 +561,7 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
* @return
|
||||
*/
|
||||
private String repeatDetermine(String deptNo) {
|
||||
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.SUBCOMPANY.getValue());
|
||||
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.DEPARTMENT.getValue());
|
||||
if (StringUtils.isNotBlank(deptNo)) {
|
||||
deptNo = CodeRuleUtil.generateCode(RuleCodeType.DEPARTMENT, deptNo);
|
||||
List<DepartmentPO> list = getDepartmentMapper().listByNo(Util.null2String(deptNo));
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.hrm.entity.RuleCodeType;
|
||||
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.company.bo.CompBO;
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.bo.DepartmentBO;
|
||||
|
|
@ -27,6 +28,7 @@ import com.engine.organization.entity.job.po.JobPO;
|
|||
import com.engine.organization.entity.scheme.po.GradePO;
|
||||
import com.engine.organization.entity.searchtree.SearchTree;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
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.ExtendTitleMapper;
|
||||
|
|
@ -47,6 +49,7 @@ import com.engine.organization.util.page.PageInfo;
|
|||
import com.engine.organization.util.page.PageUtil;
|
||||
import com.engine.organization.util.tree.SearchTreeUtil;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -284,7 +287,7 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
List<ExtendTitlePO> extendTitles = getExtendTitleMapper().getTitlesByGroupID(GROUP_ID);
|
||||
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(), "job_no");
|
||||
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(), "");
|
||||
if (CollectionUtils.isNotEmpty(items)) {
|
||||
addGroups.add(new SearchConditionGroup(extendTitle.getTitle(), true, items));
|
||||
}
|
||||
|
|
@ -328,16 +331,15 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
@Override
|
||||
public int saveBaseForm(Map<String, Object> params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
|
||||
String jobNo = (String) params.get("job_no");
|
||||
// 判断是否开启自动编号
|
||||
jobNo = repeatDetermine(jobNo);
|
||||
params.put("job_no", jobNo);
|
||||
|
||||
// 处理自动编号
|
||||
searchParam.setJobNo(CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, searchParam.getJobNo()));
|
||||
List<JobPO> list = getJobMapper().listByNo(Util.null2String(searchParam.getJobNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
JobSearchParam searchParam = JSONObject.parseObject(JSONObject.toJSONString(params), JobSearchParam.class);
|
||||
JobPO jobPO = JobBO.convertParamsToPO(searchParam, user.getUID());
|
||||
jobPO.setIsKey(null == jobPO.getIsKey() ? 0 : jobPO.getIsKey());
|
||||
int insertCount = getJobMapper().insertIgnoreNull(jobPO);
|
||||
params.put("job_no", jobPO.getJobNo());
|
||||
params.put("is_key", jobPO.getIsKey());
|
||||
DepartmentPO departmentPO = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(jobPO.getParentDept());
|
||||
params.put("parent_comp", departmentPO.getParentComp());
|
||||
|
|
@ -365,6 +367,13 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
if ("0".equals(groupId)) {
|
||||
groupId = GROUP_ID.toString();
|
||||
}
|
||||
String oldJobNo = getJobMapper().getJobById(searchParam.getId()).getJobNo();
|
||||
String jobNo = searchParam.getJobNo();
|
||||
if (!oldJobNo.equals(jobNo)) {
|
||||
jobNo = repeatDetermine(jobNo);
|
||||
params.put("job_no", jobNo);
|
||||
}
|
||||
|
||||
int updateCount = 0;
|
||||
// 更新主表数据
|
||||
params.put("is_key", searchParam.getIsKey());
|
||||
|
|
@ -559,4 +568,37 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断编号是否重复
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String repeatDetermine(String jobNo) {
|
||||
CodeRulePO codeRuleByType = MapperProxyFactory.getProxy(CodeRuleMapper.class).getCodeRuleByType(RuleCodeType.JOBTITLES.getValue());
|
||||
if (StringUtils.isNotBlank(jobNo)) {
|
||||
jobNo = CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, jobNo);
|
||||
List<JobPO> list = getJobMapper().listByNo(Util.null2String(jobNo));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
} else {
|
||||
if (null != codeRuleByType && "1".equals(codeRuleByType.getSerialEnable())) {
|
||||
jobNo = autoCreateCompanyNo();
|
||||
}
|
||||
}
|
||||
return jobNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动编号处理
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String autoCreateCompanyNo() {
|
||||
String generateCode = CodeRuleUtil.generateCode(RuleCodeType.JOBTITLES, "");
|
||||
List<JobPO> list = getJobMapper().listByNo(Util.null2String(generateCode));
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
generateCode = autoCreateCompanyNo();
|
||||
}
|
||||
return generateCode;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,12 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
public int updateStaffPlan(StaffPlanSearchParam param) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
StaffPlanPO staffPlanPO = StaffPlanBO.convertParamToPO(param, (long) user.getUID());
|
||||
// 更新前先查询下旧编号,
|
||||
String oldPlanNo = getStaffPlanMapper().getStaffPlanByID(staffPlanPO.getId()).getPlanNo();
|
||||
if (!oldPlanNo.equals(staffPlanPO.getPlanNo())) {
|
||||
List<StaffPlanPO> list = getStaffPlanMapper().listByNo(Util.null2String(staffPlanPO.getPlanNo()));
|
||||
OrganizationAssert.isEmpty(list, "编号不允许重复");
|
||||
}
|
||||
return getStaffPlanMapper().updateStaffPlan(staffPlanPO);
|
||||
}
|
||||
|
||||
|
|
@ -173,8 +179,8 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
planNoItem.setValue(staffPlanPO.getPlanNo());
|
||||
planNameItem.setValue(staffPlanPO.getPlanName());
|
||||
planYearItem.setValue(staffPlanPO.getPlanYear() + "");
|
||||
timeStartItem.setValue(DateUtil.getDate(staffPlanPO.getTimeStart(),"yyyy-MM-dd"));
|
||||
timeEndItem.setValue(DateUtil.getDate(staffPlanPO.getTimeEnd(),"yyyy-MM-dd"));
|
||||
timeStartItem.setValue(DateUtil.getDate(staffPlanPO.getTimeStart(), "yyyy-MM-dd"));
|
||||
timeEndItem.setValue(DateUtil.getDate(staffPlanPO.getTimeEnd(), "yyyy-MM-dd"));
|
||||
|
||||
BrowserBean browserBean = companyIdtItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> maps = getCompMapper().listCompsByIds(DeleteParam.builder().ids(staffPlanPO.getCompanyId()).build().getIds());
|
||||
|
|
@ -184,7 +190,7 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
descriptionItem.setValue(staffPlanPO.getDescription());
|
||||
|
||||
// 编辑状态下,编号只读
|
||||
planNoItem.setViewAttr(1);
|
||||
// planNoItem.setViewAttr(1);
|
||||
}
|
||||
|
||||
selectItems.add(planNoItem);
|
||||
|
|
@ -250,4 +256,5 @@ public class StaffPlanServiceImpl extends Service implements StaffPlanService {
|
|||
return sqlWhere;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,7 +261,16 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
return MenuBtn.getCommonBtnDatas();
|
||||
Map<String, Object> datas = MenuBtn.getCommonBtnDatas();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
// 方案
|
||||
SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "编制方案", "161", "planId", "staffPlanBrowser");
|
||||
planIdItem.setRules("required|string");
|
||||
selectItems.add(planIdItem);
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
||||
datas.put("condition", addGroups);
|
||||
return datas;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -277,6 +286,8 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
Long planId = param.getPlanId();
|
||||
if (null != planId) {
|
||||
sqlWhere += " AND t.plan_id = '" + planId + "'";
|
||||
} else {
|
||||
sqlWhere = " 1=2 ";
|
||||
}
|
||||
Long compId = param.getCompId();
|
||||
if (null != compId) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue