Merge pull request 'BUG修复,岗位关联关系调整' (#90) from feature/dxf into develop
Reviewed-on: http://221.226.25.34:3000/liang.cheng/weaver-hrm-organization/pulls/90
This commit is contained in:
commit
57cbf3db8b
|
|
@ -31,4 +31,5 @@ public class DeptSearchParam extends BaseQueryParam {
|
|||
private String uuid;
|
||||
private Double showOrder;
|
||||
private Integer showOrderOfTree;
|
||||
private Boolean forbiddenTag;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ import com.engine.organization.entity.job.param.JobSearchParam;
|
|||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
|
||||
import com.engine.organization.entity.searchtree.SearchTree;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.transmethod.JobTransMethod;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import weaver.hrm.job.JobTitlesComInfo;
|
||||
|
||||
|
|
@ -157,4 +159,11 @@ public class JobBO {
|
|||
public static String getJobTitleNameByEcJobTitle(String ecJobTitle) {
|
||||
return new JobTitlesComInfo().getJobTitlesname(ecJobTitle);
|
||||
}
|
||||
|
||||
public static JobPO getEcJobTitleByJobId(Long jobId) {
|
||||
if (null == jobId) {
|
||||
return null;
|
||||
}
|
||||
return MapperProxyFactory.getProxy(JobMapper.class).getJobById(jobId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,16 +215,19 @@
|
|||
</sql>
|
||||
|
||||
<sql id="isCanceled">
|
||||
and ifnull(canceled,0)=
|
||||
#{CompanyPO.canceled}
|
||||
<if test=" CompanyPO.canceled != null and CompanyPO.canceled != '' ">
|
||||
and ifnull(canceled,0)= #{CompanyPO.canceled}
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="isCanceled" databaseId="oracle">
|
||||
and nvl(canceled,0)=
|
||||
#{CompanyPO.canceled}
|
||||
<if test=" CompanyPO.canceled != null and CompanyPO.canceled != '' ">
|
||||
and nvl(canceled,0)= #{CompanyPO.canceled}
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="isCanceled" databaseId="sqlserver">
|
||||
and isnull(canceled,0)=
|
||||
#{CompanyPO.canceled}
|
||||
<if test=" CompanyPO.canceled != null and CompanyPO.canceled != '' ">
|
||||
and isnull(canceled,0)= #{CompanyPO.canceled}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -182,16 +182,19 @@
|
|||
</sql>
|
||||
|
||||
<sql id="isCanceled">
|
||||
and ifnull(canceled,0)=
|
||||
#{departmentPO.canceled}
|
||||
<if test=" departmentPO.canceled != null and departmentPO.canceled != '' ">
|
||||
and ifnull(canceled,0)= #{departmentPO.canceled}
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="isCanceled" databaseId="oracle">
|
||||
and nvl(canceled,0)=
|
||||
#{departmentPO.canceled}
|
||||
<if test=" departmentPO.canceled != null and departmentPO.canceled != '' ">
|
||||
and nvl(canceled,0)= #{departmentPO.canceled}
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="isCanceled" databaseId="sqlserver">
|
||||
and isnull(canceled,0)=
|
||||
#{departmentPO.canceled}
|
||||
<if test=" departmentPO.canceled != null and departmentPO.canceled != '' ">
|
||||
and isnull(canceled,0)= #{departmentPO.canceled}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
<result column="id" property="id"/>
|
||||
<result column="job_no" property="jobNo"/>
|
||||
<result column="jobtitlename" property="jobTitleName"/>
|
||||
<result column="ecJobTitle" property="ecJobTitle"/>
|
||||
<result column="ec_jobTitle" property="ecJobTitle"/>
|
||||
<result column="ec_company" property="ecCompany"/>
|
||||
<result column="ec_department" property="ecDepartment"/>
|
||||
<result column="sequence_id" property="sequenceId"/>
|
||||
|
|
|
|||
|
|
@ -182,10 +182,10 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
|||
@Override
|
||||
public int updateForbiddenTagById(DeptSearchParam params) {
|
||||
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
||||
DepartmentPO departmentPO = DepartmentPO.builder().id(params.getId()).canceled(params.getCanceled() ? 0 : 1).build();
|
||||
DepartmentPO departmentPO = DepartmentPO.builder().id(params.getId()).canceled(params.getForbiddenTag() ? 0 : 1).build();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", departmentPO.getId());
|
||||
map.put("forbiddenTag", departmentPO.getCanceled());
|
||||
map.put("id", Util.null2String(departmentPO.getId()));
|
||||
map.put("forbiddenTag", Util.null2String(departmentPO.getCanceled()));
|
||||
new OrganizationSyncEc(user, LogModuleNameEnum.DEPARTMENT, OperateTypeEnum.CANCELED, map).sync();
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -462,8 +462,14 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
}
|
||||
Long jobTitle = params.getJobTitle();
|
||||
if (null != jobTitle) {
|
||||
// TODO BUG修复
|
||||
sqlWhere += " AND t.jobtitle = '" + jobTitle + "'";
|
||||
JobPO ecJobTitleByJobId = JobBO.getEcJobTitleByJobId(jobTitle);
|
||||
if (null != ecJobTitleByJobId) {
|
||||
sqlWhere += " AND t.subcompanyid1 = '" + ecJobTitleByJobId.getEcCompany() + "'";
|
||||
sqlWhere += " AND t.departmentid = '" + ecJobTitleByJobId.getEcDepartment() + "'";
|
||||
sqlWhere += " AND t.jobtitle = '" + ecJobTitleByJobId.getEcJobTitle() + "'";
|
||||
} else {
|
||||
sqlWhere = " where 1 = 2 ";
|
||||
}
|
||||
}
|
||||
|
||||
// 分权查询
|
||||
|
|
|
|||
|
|
@ -499,8 +499,16 @@ public class JobServiceImpl extends Service implements JobService {
|
|||
@Override
|
||||
public Map<String, Object> getHrmListByJobId(Long jobId) {
|
||||
OrganizationWeaTable<EmployeeTableVO> table = new OrganizationWeaTable<>(user, EmployeeTableVO.class);
|
||||
// TODO BUG修复
|
||||
table.setSqlwhere(" where jobtitle = '" + jobId + "' and status<4");
|
||||
String sqlWhere = " where 1=1 ";
|
||||
JobPO ecJobTitleByJobId = JobBO.getEcJobTitleByJobId(jobId);
|
||||
if (null != ecJobTitleByJobId) {
|
||||
sqlWhere += " AND t.subcompanyid1 = '" + ecJobTitleByJobId.getEcCompany() + "'";
|
||||
sqlWhere += " AND t.departmentid = '" + ecJobTitleByJobId.getEcDepartment() + "'";
|
||||
sqlWhere += " AND t.jobtitle = '" + ecJobTitleByJobId.getEcJobTitle() + "'";
|
||||
} else {
|
||||
sqlWhere = " where 1 = 2 ";
|
||||
}
|
||||
table.setSqlwhere(sqlWhere + " and status<4");
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
|
|
|
|||
Loading…
Reference in New Issue