|
|
@ -38,6 +38,8 @@ import weaver.general.BaseBean;
|
|
|
|
import weaver.general.GCONST;
|
|
|
|
import weaver.general.GCONST;
|
|
|
|
import weaver.general.StringUtil;
|
|
|
|
import weaver.general.StringUtil;
|
|
|
|
import weaver.general.Util;
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
|
|
|
import weaver.hrm.company.DepartmentComInfo;
|
|
|
|
|
|
|
|
import weaver.hrm.company.SubCompanyComInfo;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.FileOutputStream;
|
|
|
|
import java.io.FileOutputStream;
|
|
|
@ -471,15 +473,27 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
* @param staffPO 编制信息实体列
|
|
|
|
* @param staffPO 编制信息实体列
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static void initStaffInfo(StaffPO staffPO) {
|
|
|
|
public static void initStaffInfo(StaffPO staffPO) {
|
|
|
|
|
|
|
|
boolean hasDepartment = null != staffPO.getEcDepartment() && 0 != staffPO.getEcDepartment();
|
|
|
|
|
|
|
|
boolean hasJob = null != staffPO.getJobId() && 0 != staffPO.getJobId();
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
RecordSet rs = new RecordSet();
|
|
|
|
String sql = "select count(1) as num from hrmresource where STATUS < 4";
|
|
|
|
String sql = "select count(1) as num from hrmresource where STATUS < 4";
|
|
|
|
if (null != staffPO.getEcCompany() && 0 != staffPO.getEcCompany()) {
|
|
|
|
if (null != staffPO.getEcCompany() && 0 != staffPO.getEcCompany()) {
|
|
|
|
sql += " and subcompanyid1 = " + staffPO.getEcCompany();
|
|
|
|
ArrayList<String> subCompanyList = new ArrayList<>();
|
|
|
|
|
|
|
|
subCompanyList.add(staffPO.getEcCompany().toString());
|
|
|
|
|
|
|
|
if (!hasJob && !hasDepartment) {
|
|
|
|
|
|
|
|
new SubCompanyComInfo().getSubCompanyLists(staffPO.getEcCompany().toString(), subCompanyList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (null != staffPO.getEcDepartment() && 0 != staffPO.getEcDepartment()) {
|
|
|
|
sql += " and subcompanyid1 in (" + StringUtils.join(subCompanyList, ",") + ")";
|
|
|
|
sql += " and departmentid = " + staffPO.getEcDepartment();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (null != staffPO.getJobId() && 0 != staffPO.getJobId()) {
|
|
|
|
if (hasDepartment) {
|
|
|
|
|
|
|
|
ArrayList<String> departmentList = new ArrayList<>();
|
|
|
|
|
|
|
|
departmentList.add(staffPO.getEcDepartment().toString());
|
|
|
|
|
|
|
|
if (!hasJob) {
|
|
|
|
|
|
|
|
new DepartmentComInfo().getAllChildDeptByDepId(departmentList, staffPO.getEcDepartment().toString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sql += " and departmentid in (" + StringUtils.join(departmentList, ",") + ")";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasJob) {
|
|
|
|
JobPO jobById = MapperProxyFactory.getProxy(JobMapper.class).getJobById(Long.valueOf(staffPO.getJobId()));
|
|
|
|
JobPO jobById = MapperProxyFactory.getProxy(JobMapper.class).getJobById(Long.valueOf(staffPO.getJobId()));
|
|
|
|
if (null == jobById) {
|
|
|
|
if (null == jobById) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|