#上海港湾编制新增【用工性质】维度

feature/geoharbour
wangjie 3 weeks ago
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",
@ -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;
/**
*
*/

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

@ -135,7 +135,7 @@ public class StaffServiceImpl extends Service implements StaffService {
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());
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()));
}
@ -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()));
}
@ -179,6 +179,10 @@ public class StaffServiceImpl extends Service implements StaffService {
}
// 更新主表
int updateStaff = getStaffMapper().updateStaff(staffPO);
// 初始化编制在编数
initStaffInfo(staffPO);
return updateStaff;
}
@ -218,6 +222,11 @@ public class StaffServiceImpl extends Service implements StaffService {
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();
@ -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);
@ -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);
@ -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,6 +542,7 @@ public class StaffServiceImpl extends Service implements StaffService {
sql += " and jobtitle = " + ecJobTitle;
}
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…
Cancel
Save