#上海港湾编制新增【用工性质】维度
This commit is contained in:
parent
26dc405ba0
commit
3a8fa123ee
|
|
@ -26,6 +26,7 @@ public class StaffBO {
|
|||
.ecDepartment(param.getEcDepartment())
|
||||
.jobId(param.getJobId())
|
||||
.staffNum(param.getStaffNum())
|
||||
.workRelation(param.getWorkRelation())
|
||||
.controlPolicy(param.getControlPolicy())
|
||||
.permanentNum(param.getPermanentNum() == null ? 0 : param.getPermanentNum())
|
||||
.freezeNum(param.getFreezeNum() == null ? 0 : param.getFreezeNum())
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ public class StaffOutParam {
|
|||
|
||||
private Integer job;
|
||||
|
||||
private Integer workRelation;
|
||||
|
||||
/**
|
||||
* 维度 1 分部 2 部门 3 岗位
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -34,6 +34,11 @@ public class StaffParams {
|
|||
*/
|
||||
private Integer deptId;
|
||||
private Integer ecDepartment;
|
||||
/**
|
||||
* 用工关系
|
||||
*/
|
||||
private Integer workRelation;
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -58,6 +58,11 @@ public class StaffSerachParam {
|
|||
* 缺编状态
|
||||
*/
|
||||
private Integer lackStatus;
|
||||
|
||||
/**
|
||||
* 用工关系
|
||||
*/
|
||||
private Integer workRelation;
|
||||
/**
|
||||
* 编制描述
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,6 +36,11 @@ public class StaffPO {
|
|||
*/
|
||||
private Integer deptId;
|
||||
private Integer ecDepartment;
|
||||
|
||||
/**
|
||||
* 用工关系
|
||||
*/
|
||||
private Integer workRelation;
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.engine.organization.entity.staff.vo;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.organization.annotation.*;
|
||||
import com.engine.organization.annotation.OrganizationTable;
|
||||
import com.engine.organization.annotation.OrganizationTableColumn;
|
||||
import com.engine.organization.annotation.OrganizationTableOperate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -18,7 +20,7 @@ import lombok.NoArgsConstructor;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@OrganizationTable(pageId = "0cdfd5bb-dc09-11ec-b69e-00ffcbed7508",
|
||||
fields = "t.id,t.is_used,s.control_dimension,t.plan_id,t.comp_id,t.dept_id,t.job_id,t.staff_num,t.permanent_num,t.freeze_num,t.lack_status,t.staff_desc",
|
||||
fields = "t.id,t.is_used,s.control_dimension,t.plan_id,t.comp_id,t.dept_id,t.job_id,t.staff_num,t.work_relation,t.permanent_num,t.freeze_num,t.lack_status,t.staff_desc",
|
||||
fromSql = "FROM jcl_org_staff t inner join jcl_org_staffplan s on t.plan_id = s.id",
|
||||
orderby = "id desc",
|
||||
primarykey = "id",
|
||||
|
|
@ -33,7 +35,7 @@ public class StaffTableVO {
|
|||
/**
|
||||
* 主键
|
||||
*/
|
||||
@OrganizationTableColumn(labelId = 21027, text = "主键",column = "id", display = false)
|
||||
@OrganizationTableColumn(labelId = 21027, text = "主键", column = "id", display = false)
|
||||
private Long id;
|
||||
/**
|
||||
* 是否被引用
|
||||
|
|
@ -65,6 +67,12 @@ public class StaffTableVO {
|
|||
// */
|
||||
// @OrganizationTableColumn(labelId = 547333, text = "岗位", width = "10%", column = "job_id", transmethod = "com.engine.organization.transmethod.JobTransMethod.getSpanById")
|
||||
// private String jobId;
|
||||
/**
|
||||
* 用工关系
|
||||
*/
|
||||
@OrganizationTableColumn(labelId = -85075, text = "用工关系", width = "10%", column = "work_relation", transmethod = "com.engine.organization.transmethod.WorkRelationTransMethod.getSpanById")
|
||||
private Integer workRelation;
|
||||
|
||||
/**
|
||||
* 编制数
|
||||
*/
|
||||
|
|
@ -83,12 +91,12 @@ public class StaffTableVO {
|
|||
/**
|
||||
* 缺编状态
|
||||
*/
|
||||
@OrganizationTableColumn(labelId = 547348, text = "缺编状态", width = "20%", column = "lack_status", transmethod = "com.engine.organization.transmethod.StaffTransMethod.getLackSpan",multiLanguage = true)
|
||||
@OrganizationTableColumn(labelId = 547348, text = "缺编状态", width = "20%", column = "lack_status", transmethod = "com.engine.organization.transmethod.StaffTransMethod.getLackSpan", multiLanguage = true)
|
||||
private String lackStatus;
|
||||
/**
|
||||
* 编制描述
|
||||
*/
|
||||
@OrganizationTableColumn(labelId = 547349, text = "编制描述", width = "10%", column = "staff_desc",display = false)
|
||||
@OrganizationTableColumn(labelId = 547349, text = "编制描述", width = "10%", column = "staff_desc", display = false)
|
||||
private String staffDesc;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public interface StaffMapper {
|
|||
* @param: [planId, companyId, departmentId, jobId]
|
||||
* @return: com.engine.organization.entity.staff.po.StaffPO
|
||||
*/
|
||||
List<StaffPO> customSelect(@Param("planId") Integer planId,@Param("companyId") Integer companyId, @Param("departmentId") Integer departmentId, @Param("jobId") Integer jobId);
|
||||
List<StaffPO> customSelect(@Param("planId") Integer planId,@Param("companyId") Integer companyId, @Param("departmentId") Integer departmentId, @Param("jobId") Integer jobId,@Param("workRelation") Integer workRelation);
|
||||
|
||||
/**
|
||||
* 插入编制方案
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
<result column="comp_id" property="compId"/>
|
||||
<result column="ec_company" property="ecCompany"/>
|
||||
<result column="ec_department" property="ecDepartment"/>
|
||||
<result column="work_relation" property="workRelation"/>
|
||||
<result column="job_id" property="jobId"/>
|
||||
<result column="staff_num" property="staffNum"/>
|
||||
<result column="control_policy" property="controlPolicy"/>
|
||||
|
|
@ -30,6 +31,7 @@
|
|||
, t.comp_id
|
||||
, t.ec_company
|
||||
, t.dept_id
|
||||
, t.work_relation
|
||||
, t.ec_department
|
||||
, t.job_id
|
||||
, t.staff_num
|
||||
|
|
@ -85,6 +87,9 @@
|
|||
<if test="jobId != null">
|
||||
and job_id = #{jobId}
|
||||
</if>
|
||||
<if test="workRelation != null">
|
||||
and work_relation = #{workRelation}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
|
@ -108,6 +113,7 @@
|
|||
comp_id=#{compId},
|
||||
ec_company=#{ecCompany},
|
||||
dept_id=#{deptId},
|
||||
work_relation=#{workRelation},
|
||||
ec_department=#{ecDepartment},
|
||||
job_id=#{jobId},
|
||||
staff_num=#{staffNum},
|
||||
|
|
@ -149,6 +155,9 @@
|
|||
<if test="ecCompany != null ">
|
||||
ec_company,
|
||||
</if>
|
||||
<if test="workRelation != null ">
|
||||
work_relation,
|
||||
</if>
|
||||
<if test="ecDepartment != null ">
|
||||
ec_department,
|
||||
</if>
|
||||
|
|
@ -203,6 +212,9 @@
|
|||
<if test="ecCompany != null ">
|
||||
#{ecCompany},
|
||||
</if>
|
||||
<if test="workRelation != null ">
|
||||
#{workRelation},
|
||||
</if>
|
||||
<if test="ecDepartment != null ">
|
||||
#{ecDepartment},
|
||||
</if>
|
||||
|
|
@ -272,6 +284,9 @@
|
|||
<if test="staffNum != null ">
|
||||
staff_num,
|
||||
</if>
|
||||
<if test="workRelation != null ">
|
||||
work_relation,
|
||||
</if>
|
||||
<if test="controlPolicy != null ">
|
||||
control_policy,
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ public class FunctionOutStaffServiceImpl {
|
|||
}
|
||||
|
||||
private StaffPO select(StaffOutParam param) {
|
||||
List<StaffPO> staffPO = staffMapper().customSelect(param.getPlanId(), param.getCompany(), param.getDepartment(), param.getJob());
|
||||
List<StaffPO> staffPO = staffMapper().customSelect(param.getPlanId(), param.getCompany(), param.getDepartment(), param.getJob(),param.getWorkRelation());
|
||||
OrganizationAssert.notEmpty(staffPO,SystemEnv.getHtmlLabelName(547474,user.getLanguage()));
|
||||
return staffPO.get(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,10 +134,10 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
public int saveStaff(StaffParams param) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID());
|
||||
OrganizationAssert.isFalse(staffPO.getStaffNum() < 0, SystemEnv.getHtmlLabelName(547449,user.getLanguage()));
|
||||
List<StaffPO> verify = getStaffMapper().customSelect(param.getPlanId(), param.getEcCompany(), param.getEcDepartment(), param.getJobId());
|
||||
OrganizationAssert.isFalse(staffPO.getStaffNum() < 0, SystemEnv.getHtmlLabelName(547449, user.getLanguage()));
|
||||
List<StaffPO> verify = getStaffMapper().customSelect(param.getPlanId(), param.getEcCompany(), param.getEcDepartment(), param.getJobId(), param.getWorkRelation());
|
||||
if (!verify.isEmpty()) {
|
||||
throw new OrganizationRunTimeException(SystemEnv.getHtmlLabelName(547450,user.getLanguage()));
|
||||
throw new OrganizationRunTimeException(SystemEnv.getHtmlLabelName(547450, user.getLanguage()));
|
||||
}
|
||||
checkRequired(staffPO);
|
||||
int ignoreNull = getStaffMapper().insertIgnoreNull(staffPO);
|
||||
|
|
@ -149,7 +149,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
@Override
|
||||
public int updateStaff(StaffParams param) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
List<StaffPO> verify = getStaffMapper().customSelect(param.getPlanId(), param.getEcCompany(), param.getEcDepartment(), param.getJobId());
|
||||
List<StaffPO> verify = getStaffMapper().customSelect(param.getPlanId(), param.getEcCompany(), param.getEcDepartment(), param.getJobId(), param.getWorkRelation());
|
||||
if (verify.size() > 1) {
|
||||
throw new OrganizationRunTimeException(SystemEnv.getHtmlLabelName(547451, user.getLanguage()));
|
||||
}
|
||||
|
|
@ -172,13 +172,17 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
// 更新编制表
|
||||
staffPO.setStaffNum(staffPO.getStaffNum() + changeNum);
|
||||
}
|
||||
OrganizationAssert.isFalse(staffPO.getStaffNum() < 0, SystemEnv.getHtmlLabelName(547452,user.getLanguage()));
|
||||
OrganizationAssert.isFalse(staffPO.getStaffNum() < 0, SystemEnv.getHtmlLabelName(547452, user.getLanguage()));
|
||||
StaffBO.buildStaffDesc(staffPO);
|
||||
if (staffPO.getControlPolicy().equals(HARDCONTROLLER) && staffPO.getStaffNum() < (staffPO.getPermanentNum() + staffPO.getFreezeNum())){
|
||||
throw new OrganizationRunTimeException(SystemEnv.getHtmlLabelName(547453,user.getLanguage()));
|
||||
if (staffPO.getControlPolicy().equals(HARDCONTROLLER) && staffPO.getStaffNum() < (staffPO.getPermanentNum() + staffPO.getFreezeNum())) {
|
||||
throw new OrganizationRunTimeException(SystemEnv.getHtmlLabelName(547453, user.getLanguage()));
|
||||
}
|
||||
// 更新主表
|
||||
int updateStaff = getStaffMapper().updateStaff(staffPO);
|
||||
|
||||
// 初始化编制在编数
|
||||
initStaffInfo(staffPO);
|
||||
|
||||
return updateStaff;
|
||||
}
|
||||
|
||||
|
|
@ -186,7 +190,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
OrganizationAssert.notEmpty(ids, SystemEnv.getHtmlLabelName(547138,user.getLanguage()));
|
||||
OrganizationAssert.notEmpty(ids, SystemEnv.getHtmlLabelName(547138, user.getLanguage()));
|
||||
return getStaffMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
|
@ -211,13 +215,18 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
SearchConditionItem freezeNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 2, 547347, "freezeNum");
|
||||
// 缺编状态
|
||||
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
||||
SearchConditionOption lackOption = new SearchConditionOption("1", SystemEnv.getHtmlLabelName(547351,user.getLanguage()));
|
||||
SearchConditionOption fullOption = new SearchConditionOption("2", SystemEnv.getHtmlLabelName(547350,user.getLanguage()));
|
||||
SearchConditionOption overOption = new SearchConditionOption("3", SystemEnv.getHtmlLabelName(547352,user.getLanguage()));
|
||||
SearchConditionOption lackOption = new SearchConditionOption("1", SystemEnv.getHtmlLabelName(547351, user.getLanguage()));
|
||||
SearchConditionOption fullOption = new SearchConditionOption("2", SystemEnv.getHtmlLabelName(547350, user.getLanguage()));
|
||||
SearchConditionOption overOption = new SearchConditionOption("3", SystemEnv.getHtmlLabelName(547352, user.getLanguage()));
|
||||
selectOptions.add(lackOption);
|
||||
selectOptions.add(fullOption);
|
||||
selectOptions.add(overOption);
|
||||
SearchConditionItem lackStatusItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, 547348, "lackStatus");
|
||||
|
||||
//自定义字段 用工关系
|
||||
List<SearchConditionOption> workRelationSelectOptions = getWorkRelationSelectOptions();
|
||||
SearchConditionItem workRelationItem = OrganizationFormItemUtil.selectItem(user, workRelationSelectOptions, 2, 16, 6, false, -85075, "workRelation");
|
||||
|
||||
// 编制描述
|
||||
SearchConditionItem staffDescItem = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, 547349, "staffDesc");
|
||||
// 说明
|
||||
|
|
@ -225,7 +234,8 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
conditionItems.add(compIdItem);
|
||||
conditionItems.add(deptIdItem);
|
||||
conditionItems.add(jobIdItem);
|
||||
// conditionItems.add(jobIdItem);
|
||||
conditionItems.add(workRelationItem);
|
||||
conditionItems.add(staffNumItem);
|
||||
conditionItems.add(permanentNumItem);
|
||||
conditionItems.add(freezeNumItem);
|
||||
|
|
@ -253,6 +263,15 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
SearchConditionItem ecCompanyItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, 547332, "164", "ecCompany", "compBrowser");
|
||||
// 部门
|
||||
SearchConditionItem ecDepartmentItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, 547331, "4", "ecDepartment", "deptBrowser");
|
||||
|
||||
//自定义字段 用工关系
|
||||
List<SearchConditionOption> workRelationSelectOptions = getWorkRelationSelectOptions();
|
||||
|
||||
SearchConditionItem workRelationItem = OrganizationFormItemUtil.selectItem(user, workRelationSelectOptions, 2, 16, 6, false, -85075, "workRelation");
|
||||
workRelationItem.setViewAttr(2);
|
||||
workRelationItem.setValue("");
|
||||
workRelationItem.setRules("required|string");
|
||||
|
||||
// 岗位
|
||||
SearchConditionItem jobIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, 547333, "666", "jobId", "");
|
||||
BrowserBean browserBean = jobIdItem.getBrowserConditionParam();
|
||||
|
|
@ -268,9 +287,9 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
staffNumItem.setMin("0");
|
||||
// 控制策略
|
||||
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
||||
SearchConditionOption option1 = new SearchConditionOption("1", SystemEnv.getHtmlLabelName(547454,user.getLanguage()));
|
||||
SearchConditionOption option2 = new SearchConditionOption("2", SystemEnv.getHtmlLabelName(547455,user.getLanguage()));
|
||||
SearchConditionOption option3 = new SearchConditionOption("3", SystemEnv.getHtmlLabelName(547456,user.getLanguage()));
|
||||
SearchConditionOption option1 = new SearchConditionOption("1", SystemEnv.getHtmlLabelName(547454, user.getLanguage()));
|
||||
SearchConditionOption option2 = new SearchConditionOption("2", SystemEnv.getHtmlLabelName(547455, user.getLanguage()));
|
||||
SearchConditionOption option3 = new SearchConditionOption("3", SystemEnv.getHtmlLabelName(547456, user.getLanguage()));
|
||||
selectOptions.add(option1);
|
||||
selectOptions.add(option2);
|
||||
selectOptions.add(option3);
|
||||
|
|
@ -285,8 +304,8 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
String id = Util.null2String(params.get("id"));
|
||||
if (!StringUtil.isEmpty(id)) {
|
||||
StaffPO staffPO = getStaffMapper().getStaffByID(Integer.parseInt(id));
|
||||
OrganizationAssert.notNull(staffPO, SystemEnv.getHtmlLabelName(547154,user.getLanguage()));
|
||||
staffPlanPO = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId());
|
||||
OrganizationAssert.notNull(staffPO, SystemEnv.getHtmlLabelName(547154, user.getLanguage()));
|
||||
staffPlanPO = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId());
|
||||
|
||||
BrowserBean planIdItemBean = planIdItem.getBrowserConditionParam();
|
||||
List<Map<String, Object>> planIdMaps = getStaffPlanMapper().listPlansByIds(DeleteParam.builder().ids(staffPO.getPlanId().toString()).build().getIds());
|
||||
|
|
@ -310,6 +329,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
staffNumItem.setValue(staffPO.getStaffNum());
|
||||
controlPolicyItem.setValue(Util.null2String(staffPO.getControlPolicy()));
|
||||
workRelationItem.setValue(Util.null2String(staffPO.getWorkRelation()));
|
||||
descriptionItem.setValue(staffPO.getDescription());
|
||||
}
|
||||
selectItems.add(planIdItem);
|
||||
|
|
@ -322,7 +342,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
if (StringUtil.isEmpty(id) || "3".equals(staffPlanPO.getControlDimension())) {
|
||||
selectItems.add(jobIdItem);
|
||||
}
|
||||
|
||||
selectItems.add(workRelationItem);
|
||||
selectItems.add(staffNumItem);
|
||||
selectItems.add(controlPolicyItem);
|
||||
selectItems.add(descriptionItem);
|
||||
|
|
@ -333,7 +353,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
item.setRules(null);
|
||||
});
|
||||
SearchConditionItem changeNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 3, 547357, "changeNum");
|
||||
changeNumItem.setHelpfulTip(SystemEnv.getHtmlLabelName(547359,user.getLanguage()));
|
||||
changeNumItem.setHelpfulTip(SystemEnv.getHtmlLabelName(547359, user.getLanguage()));
|
||||
staffNumItem.setRules("required");
|
||||
selectItems.add(changeNumItem);
|
||||
SearchConditionItem changeDescriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, false, 2, 50, 547358, "changeDescription");
|
||||
|
|
@ -341,7 +361,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
}
|
||||
|
||||
addGroups.add(new SearchConditionGroup(SystemEnv.getHtmlLabelName(547175,user.getLanguage()), true, selectItems));
|
||||
addGroups.add(new SearchConditionGroup(SystemEnv.getHtmlLabelName(547175, user.getLanguage()), true, selectItems));
|
||||
apiDatas.put("condition", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
|
@ -349,15 +369,15 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
@Override
|
||||
public Map<String, Object> getHasRight() {
|
||||
Map<String, List<MenuBtn>> datas = MenuBtn.getCommonBtnDatas(user.getLanguage());
|
||||
datas.get("topMenu").add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("import").menuIcon("icon-coms-leading-in").menuName(SystemEnv.getHtmlLabelName(547242,user.getLanguage())).type("BTN_BatchImport").build());
|
||||
datas.get("rightMenu").add(MenuBtn.builder().isBatch("1").isTop("0").menuFun("import").menuIcon("icon-coms-leading-in").menuName(SystemEnv.getHtmlLabelName(547242,user.getLanguage())).type("BTN_BatchImport").build());
|
||||
datas.get("topMenu").add(MenuBtn.builder().isBatch("1").isTop("1").menuFun("import").menuIcon("icon-coms-leading-in").menuName(SystemEnv.getHtmlLabelName(547242, user.getLanguage())).type("BTN_BatchImport").build());
|
||||
datas.get("rightMenu").add(MenuBtn.builder().isBatch("1").isTop("0").menuFun("import").menuIcon("icon-coms-leading-in").menuName(SystemEnv.getHtmlLabelName(547242, user.getLanguage())).type("BTN_BatchImport").build());
|
||||
Map<String, Object> map = new HashMap<>(datas);
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
// 方案
|
||||
SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 4, 6, 2, false, 547459, "162", "planId", "staffPlanBrowser");
|
||||
planIdItem.setRules("required|string");
|
||||
planIdItem.setHelpfulTip(SystemEnv.getHtmlLabelName(547343,user.getLanguage()));
|
||||
planIdItem.setHelpfulTip(SystemEnv.getHtmlLabelName(547343, user.getLanguage()));
|
||||
planIdItem.setLabelcol(2);
|
||||
|
||||
selectItems.add(planIdItem);
|
||||
|
|
@ -422,6 +442,10 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
if (null != lackStatus) {
|
||||
sqlWhere += " AND t.lack_status = '" + lackStatus + "'";
|
||||
}
|
||||
Integer workRelation= param.getWorkRelation();
|
||||
if (null != workRelation && !(-1 == workRelation)) {
|
||||
sqlWhere += " AND t.work_relation = '" + workRelation + "'";
|
||||
}
|
||||
String staffDesc = param.getStaffDesc();
|
||||
if (StringUtils.isNotBlank(staffDesc)) {
|
||||
sqlWhere += " AND t.staff_desc " + dbType.like(staffDesc);
|
||||
|
|
@ -448,11 +472,11 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
StaffPlanPO staffPlanByID = getStaffPlanMapper().getStaffPlanByID(staffPO.getPlanId());
|
||||
switch (staffPlanByID.getControlDimension()) {
|
||||
case "1":// 分部
|
||||
OrganizationAssert.notNull(staffPO.getEcCompany(), SystemEnv.getHtmlLabelName(547461,user.getLanguage()));
|
||||
OrganizationAssert.notNull(staffPO.getEcCompany(), SystemEnv.getHtmlLabelName(547461, user.getLanguage()));
|
||||
staffPO.setCompId(staffPO.getEcCompany());
|
||||
break;
|
||||
case "2":// 部门
|
||||
OrganizationAssert.notNull(staffPO.getEcDepartment(), SystemEnv.getHtmlLabelName(547460,user.getLanguage()));
|
||||
OrganizationAssert.notNull(staffPO.getEcDepartment(), SystemEnv.getHtmlLabelName(547460, user.getLanguage()));
|
||||
DepartmentPO jclDepartmentId = getDepartmentMapper().getDeptById(staffPO.getEcDepartment());
|
||||
if (null != jclDepartmentId) {
|
||||
staffPO.setDeptId(jclDepartmentId.getId());
|
||||
|
|
@ -461,7 +485,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
}
|
||||
break;
|
||||
case "3": // 岗位
|
||||
OrganizationAssert.notNull(staffPO.getJobId(), SystemEnv.getHtmlLabelName(547462,user.getLanguage()));
|
||||
OrganizationAssert.notNull(staffPO.getJobId(), SystemEnv.getHtmlLabelName(547462, user.getLanguage()));
|
||||
JobPO jobById = getJobMapper().getJobById(Long.valueOf(staffPO.getJobId()));
|
||||
if (null != jobById) {
|
||||
staffPO.setDeptId(jobById.getEcDepartment());
|
||||
|
|
@ -483,8 +507,16 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
public static void initStaffInfo(StaffPO staffPO) {
|
||||
boolean hasDepartment = null != staffPO.getEcDepartment() && 0 != staffPO.getEcDepartment();
|
||||
boolean hasJob = null != staffPO.getJobId() && 0 != staffPO.getJobId();
|
||||
boolean hasWorkRelation = null != staffPO.getWorkRelation() && -1 != staffPO.getWorkRelation();
|
||||
RecordSet rs = new RecordSet();
|
||||
String sql = "select count(1) as num from hrmresource where STATUS < 4";
|
||||
|
||||
if (hasWorkRelation) {
|
||||
int workRelation = staffPO.getWorkRelation();
|
||||
sql = "select count(1) as num from hrmresource a left join cus_fielddata b on a.id = b.id where status < 4 and b.scope = 'HrmCustomFieldByInfoType' and b.scopeid = 3 ";
|
||||
sql += " and field10 = " + workRelation;
|
||||
}
|
||||
|
||||
if (null != staffPO.getEcCompany() && 0 != staffPO.getEcCompany()) {
|
||||
ArrayList<String> subCompanyList = new ArrayList<>();
|
||||
subCompanyList.add(staffPO.getEcCompany().toString());
|
||||
|
|
@ -510,7 +542,8 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
sql += " and jobtitle = " + ecJobTitle;
|
||||
}
|
||||
|
||||
if ("false".equals(new BaseBean().getPropValue("hrmOrganization","accountType"))) {
|
||||
|
||||
if ("false".equals(new BaseBean().getPropValue("hrmOrganization", "accountType"))) {
|
||||
sql += " and accounttype != 1";
|
||||
}
|
||||
|
||||
|
|
@ -523,4 +556,28 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取获取用工关系下拉选项值
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<SearchConditionOption> getWorkRelationSelectOptions() {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<SearchConditionOption> workRelationSelectOptions = new ArrayList<>();
|
||||
SearchConditionOption option = new SearchConditionOption("-1", "不限");
|
||||
workRelationSelectOptions.add(option);
|
||||
//用工关系sql select selectvalue,selectname from cus_selectitem where fieldid = 33
|
||||
String sql = "select selectvalue,selectname from cus_selectitem where fieldid = 10";
|
||||
rs.execute(sql);
|
||||
while (rs.next()) {
|
||||
String selectvalue = Util.null2String(rs.getString("selectvalue"));
|
||||
String selectname = Util.null2String(rs.getString("selectname"));
|
||||
SearchConditionOption option1 = new SearchConditionOption(selectvalue, selectname);
|
||||
workRelationSelectOptions.add(option1);
|
||||
}
|
||||
|
||||
return workRelationSelectOptions;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.engine.organization.transmethod;
|
||||
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.general.Util;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author:wangj
|
||||
* @createTime: 2025/02/28
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class WorkRelationTransMethod {
|
||||
|
||||
public static String getSpanById(String Id) {
|
||||
RecordSet rs = new RecordSet();
|
||||
String names = "/";
|
||||
if (!"".equals(Id)) {
|
||||
String sql = "select selectvalue,selectname from cus_selectitem where fieldid = 10 and selectvalue = '" + Id + "'";
|
||||
rs.execute(sql);
|
||||
while (rs.next()) {
|
||||
names = Util.null2String(rs.getString("selectname"));
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
}
|
||||
|
|
@ -24,6 +24,7 @@ import org.apache.poi.xssf.usermodel.XSSFCell;
|
|||
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -51,6 +52,7 @@ public class StaffInfoImportUtil {
|
|||
importFieldsMap.put("部门", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("dept_id").fieldNameDesc("部门").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("岗位", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("job_id").fieldNameDesc("岗位").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
importFieldsMap.put("编制数", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("staff_num").fieldNameDesc("编制数").isrequired(1).controlType(1).browserType("2").customValue("[\"input\",\"int\"]").build());
|
||||
importFieldsMap.put("用工关系", ExtendInfoPO.builder().tableName("jcl_org_staff").fieldName("work_relation").fieldNameDesc("用工关系").isrequired(0).controlType(1).browserType("1").customValue("[\"input\",\"text\",\"100\"]").build());
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -188,6 +190,12 @@ public class StaffInfoImportUtil {
|
|||
map.put("ec_department", parentDepartmentId);
|
||||
}
|
||||
|
||||
// 用工关系
|
||||
if ("work_relation".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||
int workRelation = getWorkRelationValue(cellValue);
|
||||
map.put("work_relation", workRelation);
|
||||
}
|
||||
|
||||
// 岗位
|
||||
if ("job_id".equals(infoPO.getFieldName()) && StringUtils.isNotBlank(cellValue)) {
|
||||
if (null == parentCompanyId) {
|
||||
|
|
@ -290,7 +298,7 @@ public class StaffInfoImportUtil {
|
|||
if (null == staffPO.getControlPolicy()) {
|
||||
staffPO.setControlPolicy(1);
|
||||
}
|
||||
List<StaffPO> verify = MapperProxyFactory.getProxy(StaffMapper.class).customSelect(param.getPlanId(), param.getEcCompany(), param.getEcDepartment(), param.getJobId());
|
||||
List<StaffPO> verify = MapperProxyFactory.getProxy(StaffMapper.class).customSelect(param.getPlanId(), param.getEcCompany(), param.getEcDepartment(), param.getJobId(), param.getWorkRelation());
|
||||
if (!verify.isEmpty()) {
|
||||
checkMsg = "同一编制方案下,同一维度的编制信息不可重复创建!";
|
||||
}
|
||||
|
|
@ -339,4 +347,16 @@ public class StaffInfoImportUtil {
|
|||
lsGroup.add(groupItem);
|
||||
return lsGroup;
|
||||
}
|
||||
|
||||
|
||||
public static int getWorkRelationValue(String name){
|
||||
RecordSet rs = new RecordSet();
|
||||
int id = -1;
|
||||
String sql = "select selectvalue,selectname from cus_selectitem where fieldid = 10 and selectname = '" + name + "'";
|
||||
rs.execute(sql);
|
||||
while (rs.next()) {
|
||||
id = Util.getIntValue(rs.getString("selectvalue"));
|
||||
}
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue