|
|
|
@ -10,6 +10,8 @@ import com.engine.core.impl.Service;
|
|
|
|
|
import com.engine.organization.component.OrganizationWeaTable;
|
|
|
|
|
import com.engine.organization.entity.DeleteParam;
|
|
|
|
|
import com.engine.organization.entity.browser.po.CustomBrowserBean;
|
|
|
|
|
import com.engine.organization.entity.company.po.CompPO;
|
|
|
|
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
|
|
|
|
import com.engine.organization.entity.staff.bo.StaffBO;
|
|
|
|
|
import com.engine.organization.entity.staff.param.StaffSearchParam;
|
|
|
|
|
import com.engine.organization.entity.staff.po.StaffPO;
|
|
|
|
@ -24,8 +26,10 @@ import com.engine.organization.mapper.staff.StaffPlanMapper;
|
|
|
|
|
import com.engine.organization.mapper.staff.StaffsMapper;
|
|
|
|
|
import com.engine.organization.service.StaffService;
|
|
|
|
|
import com.engine.organization.util.*;
|
|
|
|
|
import com.engine.organization.util.browser.OrganizationBrowserUtil;
|
|
|
|
|
import com.engine.organization.util.db.DBType;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.organization.util.relation.EcHrmRelationUtil;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.general.StringUtil;
|
|
|
|
@ -89,6 +93,15 @@ 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, "编制数不可小于0,请更正");
|
|
|
|
|
// 赋值
|
|
|
|
|
CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(staffPO.getEcCompany() + "");
|
|
|
|
|
if (null != jclCompanyId) {
|
|
|
|
|
staffPO.setCompId(jclCompanyId.getId());
|
|
|
|
|
}
|
|
|
|
|
DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(staffPO.getEcDepartment() + "");
|
|
|
|
|
if (null != jclDepartmentId) {
|
|
|
|
|
staffPO.setDeptId(jclDepartmentId.getId());
|
|
|
|
|
}
|
|
|
|
|
checkRequired(staffPO);
|
|
|
|
|
return getStaffMapper().insertIgnoreNull(staffPO);
|
|
|
|
|
}
|
|
|
|
@ -98,6 +111,15 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
StaffPO staffByID = getStaffMapper().getStaffByID(param.getId());
|
|
|
|
|
StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID());
|
|
|
|
|
// 赋值
|
|
|
|
|
CompPO jclCompanyId = EcHrmRelationUtil.getJclCompanyId(staffPO.getEcCompany() + "");
|
|
|
|
|
if (null != jclCompanyId) {
|
|
|
|
|
staffPO.setCompId(jclCompanyId.getId());
|
|
|
|
|
}
|
|
|
|
|
DepartmentPO jclDepartmentId = EcHrmRelationUtil.getJclDepartmentId(staffPO.getEcDepartment() + "");
|
|
|
|
|
if (null != jclDepartmentId) {
|
|
|
|
|
staffPO.setDeptId(jclDepartmentId.getId());
|
|
|
|
|
}
|
|
|
|
|
checkRequired(staffPO);
|
|
|
|
|
Integer changeNum = param.getChangeNum();
|
|
|
|
|
if (null == changeNum) {
|
|
|
|
@ -132,16 +154,13 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
//// 方案
|
|
|
|
|
//SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "方案11", "161", "planId", "staffPlanBrowser");
|
|
|
|
|
//planIdItem.setHide(true);
|
|
|
|
|
//planIdItem.setDisplay("none");
|
|
|
|
|
|
|
|
|
|
// 分部
|
|
|
|
|
SearchConditionItem compIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "161", "compId", "compBrowser");
|
|
|
|
|
SearchConditionItem compIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "164", "ecCompany", "");
|
|
|
|
|
// 部门
|
|
|
|
|
SearchConditionItem deptIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门", "161", "deptId", "deptBrowser");
|
|
|
|
|
SearchConditionItem deptIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门", "4", "ecDepartment", "");
|
|
|
|
|
// 岗位
|
|
|
|
|
SearchConditionItem jobIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位", "161", "jobId", "jobBrowser");
|
|
|
|
|
SearchConditionItem jobIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位", "666", "jobId", "");
|
|
|
|
|
// 编制数
|
|
|
|
|
SearchConditionItem staffNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 2, "编制数", "staffNum");
|
|
|
|
|
// 在编
|
|
|
|
@ -188,14 +207,11 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
|
SearchConditionItem planIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "方案", "161", "planId", "staffPlanBrowser");
|
|
|
|
|
planIdItem.setRules("required|string");
|
|
|
|
|
// 分部
|
|
|
|
|
SearchConditionItem compIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "161", "compId", "compBrowser");
|
|
|
|
|
//compIdItem.setRules("required|string");
|
|
|
|
|
SearchConditionItem ecCompanyItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "分部", "164", "ecCompany", "compBrowser");
|
|
|
|
|
// 部门
|
|
|
|
|
SearchConditionItem deptIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门", "161", "deptId", "deptBrowser");
|
|
|
|
|
//deptIdItem.setRules("required|string");
|
|
|
|
|
SearchConditionItem ecDepartmentItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "部门", "4", "ecDepartment", "deptBrowser");
|
|
|
|
|
// 岗位
|
|
|
|
|
SearchConditionItem jobIdItem = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "岗位", "666", "jobId", "");
|
|
|
|
|
//jobIdItem.setRules("required|string");
|
|
|
|
|
BrowserBean browserBean = jobIdItem.getBrowserConditionParam();
|
|
|
|
|
String s = JSONObject.toJSONString(browserBean);
|
|
|
|
|
CustomBrowserBean customBrowserBean = JSONObject.parseObject(s, CustomBrowserBean.class);
|
|
|
|
@ -231,18 +247,12 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
|
planIdItemBean.setReplaceDatas(planIdMaps);
|
|
|
|
|
planIdItem.setBrowserConditionParam(planIdItemBean);
|
|
|
|
|
|
|
|
|
|
if (null != staffPO.getCompId()) {
|
|
|
|
|
BrowserBean compIdItemBean = compIdItem.getBrowserConditionParam();
|
|
|
|
|
List<Map<String, Object>> compIdMaps = getCompMapper().listCompsByIds(DeleteParam.builder().ids(staffPO.getCompId().toString()).build().getIds());
|
|
|
|
|
compIdItemBean.setReplaceDatas(compIdMaps);
|
|
|
|
|
compIdItem.setBrowserConditionParam(compIdItemBean);
|
|
|
|
|
if (null != staffPO.getEcCompany()) {
|
|
|
|
|
OrganizationBrowserUtil.assignBrowser(user, staffPO.getEcCompany().toString(), 164, ecCompanyItem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (null != staffPO.getDeptId()) {
|
|
|
|
|
BrowserBean deptIdItemBean = deptIdItem.getBrowserConditionParam();
|
|
|
|
|
List<Map<String, Object>> deptIdMaps = getDepartmentMapper().listDeptsByIds(DeleteParam.builder().ids(staffPO.getDeptId().toString()).build().getIds());
|
|
|
|
|
deptIdItemBean.setReplaceDatas(deptIdMaps);
|
|
|
|
|
deptIdItem.setBrowserConditionParam(deptIdItemBean);
|
|
|
|
|
if (null != staffPO.getEcDepartment()) {
|
|
|
|
|
OrganizationBrowserUtil.assignBrowser(user, staffPO.getEcDepartment().toString(), 4, ecDepartmentItem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (null != staffPO.getJobId()) {
|
|
|
|
@ -257,8 +267,8 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
|
descriptionItem.setValue(staffPO.getDescription());
|
|
|
|
|
}
|
|
|
|
|
selectItems.add(planIdItem);
|
|
|
|
|
selectItems.add(compIdItem);
|
|
|
|
|
selectItems.add(deptIdItem);
|
|
|
|
|
selectItems.add(ecCompanyItem);
|
|
|
|
|
selectItems.add(ecDepartmentItem);
|
|
|
|
|
selectItems.add(jobIdItem);
|
|
|
|
|
selectItems.add(staffNumItem);
|
|
|
|
|
selectItems.add(controlPolicyItem);
|
|
|
|
@ -322,6 +332,14 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
|
if (null != deptId) {
|
|
|
|
|
sqlWhere += " AND t.dept_id = '" + deptId + "'";
|
|
|
|
|
}
|
|
|
|
|
Long ecCompany = param.getEcCompany();
|
|
|
|
|
if (null != ecCompany) {
|
|
|
|
|
sqlWhere += " AND t.ec_company = '" + ecCompany + "'";
|
|
|
|
|
}
|
|
|
|
|
Long ecDepartment = param.getEcDepartment();
|
|
|
|
|
if (null != ecDepartment) {
|
|
|
|
|
sqlWhere += " AND t.ec_department = '" + ecDepartment + "'";
|
|
|
|
|
}
|
|
|
|
|
Long jobId = param.getJobId();
|
|
|
|
|
if (null != jobId) {
|
|
|
|
|
sqlWhere += " AND t.job_id = '" + jobId + "'";
|
|
|
|
|