|
|
@ -70,8 +70,7 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
// 刷新引用状态
|
|
|
|
// 刷新引用状态
|
|
|
|
RefreshIsUsedUtil.RefreshStaff("jcl_org_staff");
|
|
|
|
RefreshIsUsedUtil.RefreshStaff("jcl_org_staff");
|
|
|
|
OrganizationWeaTable<StaffTableVO> table = new OrganizationWeaTable<>(user, StaffTableVO.class);
|
|
|
|
OrganizationWeaTable<StaffTableVO> table = new OrganizationWeaTable<>(user, StaffTableVO.class);
|
|
|
|
StaffPO staffPO = StaffBO.convertParamToPO(params, (long) user.getUID());
|
|
|
|
String sqlWhere = buildSqlWhere(params);
|
|
|
|
String sqlWhere = buildSqlWhere(staffPO);
|
|
|
|
|
|
|
|
table.setSqlwhere(sqlWhere);
|
|
|
|
table.setSqlwhere(sqlWhere);
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
@ -104,7 +103,6 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
|
|
|
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
Map<String, Object> apiDatas = new HashMap<>();
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
|
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
|
|
@ -229,64 +227,67 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Map<String, Object> getHasRight() {
|
|
|
|
public Map<String, Object> getHasRight() {
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
|
|
|
|
return MenuBtn.getCommonBtnDatas();
|
|
|
|
return MenuBtn.getCommonBtnDatas();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询条件
|
|
|
|
* 查询条件
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param staffPO
|
|
|
|
* @param param
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private String buildSqlWhere(StaffPO staffPO) {
|
|
|
|
private String buildSqlWhere(StaffSearchParam param) {
|
|
|
|
DBType dbType = DBType.get(new RecordSet().getDBType());
|
|
|
|
DBType dbType = DBType.get(new RecordSet().getDBType());
|
|
|
|
String sqlWhere = " where t.delete_type ='0' ";
|
|
|
|
String sqlWhere = " where t.delete_type ='0' ";
|
|
|
|
|
|
|
|
|
|
|
|
Long planId = staffPO.getPlanId();
|
|
|
|
Long planId = param.getPlanId();
|
|
|
|
if (null != planId) {
|
|
|
|
if (null != planId) {
|
|
|
|
sqlWhere += " AND t.plan_id = '" + planId + "'";
|
|
|
|
sqlWhere += " AND t.plan_id = '" + planId + "'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Long compId = staffPO.getCompId();
|
|
|
|
Long compId = param.getCompId();
|
|
|
|
if (null != compId) {
|
|
|
|
if (null != compId) {
|
|
|
|
sqlWhere += " AND t.comp_id = '" + compId + "'";
|
|
|
|
sqlWhere += " AND t.comp_id = '" + compId + "'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Long deptId = staffPO.getDeptId();
|
|
|
|
Long deptId = param.getDeptId();
|
|
|
|
if (null != deptId) {
|
|
|
|
if (null != deptId) {
|
|
|
|
sqlWhere += " AND t.dept_id = '" + deptId + "'";
|
|
|
|
sqlWhere += " AND t.dept_id = '" + deptId + "'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Long jobId = staffPO.getJobId();
|
|
|
|
Long jobId = param.getJobId();
|
|
|
|
if (null != jobId) {
|
|
|
|
if (null != jobId) {
|
|
|
|
sqlWhere += " AND t.job_id = '" + jobId + "'";
|
|
|
|
sqlWhere += " AND t.job_id = '" + jobId + "'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Integer staffNum = staffPO.getStaffNum();
|
|
|
|
Integer staffNum = param.getStaffNum();
|
|
|
|
if (null != staffNum) {
|
|
|
|
if (null != staffNum) {
|
|
|
|
sqlWhere += " AND t.staff_num = '" + staffNum + "'";
|
|
|
|
sqlWhere += " AND t.staff_num = '" + staffNum + "'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Integer controlPolicy = staffPO.getControlPolicy();
|
|
|
|
Integer controlPolicy = param.getControlPolicy();
|
|
|
|
if (null != controlPolicy) {
|
|
|
|
if (null != controlPolicy) {
|
|
|
|
sqlWhere += " AND t.control_policy = '" + controlPolicy + "'";
|
|
|
|
sqlWhere += " AND t.control_policy = '" + controlPolicy + "'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Integer permanentNum = staffPO.getPermanentNum();
|
|
|
|
Integer permanentNum = param.getPermanentNum();
|
|
|
|
if (null != permanentNum) {
|
|
|
|
if (null != permanentNum) {
|
|
|
|
sqlWhere += " AND t.permanent_num = '" + permanentNum + "'";
|
|
|
|
sqlWhere += " AND t.permanent_num = '" + permanentNum + "'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Integer freezeNum = staffPO.getFreezeNum();
|
|
|
|
Integer freezeNum = param.getFreezeNum();
|
|
|
|
if (null != freezeNum) {
|
|
|
|
if (null != freezeNum) {
|
|
|
|
sqlWhere += " AND t.freeze_num = '" + freezeNum + "'";
|
|
|
|
sqlWhere += " AND t.freeze_num = '" + freezeNum + "'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Integer lackStatus = staffPO.getLackStatus();
|
|
|
|
Integer lackStatus = param.getLackStatus();
|
|
|
|
if (null != lackStatus) {
|
|
|
|
if (null != lackStatus) {
|
|
|
|
sqlWhere += " AND t.lack_status = '" + lackStatus + "'";
|
|
|
|
sqlWhere += " AND t.lack_status = '" + lackStatus + "'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String staffDesc = staffPO.getStaffDesc();
|
|
|
|
String staffDesc = param.getStaffDesc();
|
|
|
|
if (StringUtils.isNotBlank(staffDesc)) {
|
|
|
|
if (StringUtils.isNotBlank(staffDesc)) {
|
|
|
|
sqlWhere += " AND t.staff_desc " + dbType.like(staffDesc);
|
|
|
|
sqlWhere += " AND t.staff_desc " + dbType.like(staffDesc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String description = staffPO.getDescription();
|
|
|
|
String description = param.getDescription();
|
|
|
|
if (StringUtils.isNotBlank(description)) {
|
|
|
|
if (StringUtils.isNotBlank(description)) {
|
|
|
|
sqlWhere += " AND t.description " + dbType.like(description);
|
|
|
|
sqlWhere += " AND t.description " + dbType.like(description);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String staffName = param.getStaffName();
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(staffName)) {
|
|
|
|
|
|
|
|
sqlWhere += " AND t.plan_id in ( select id from jcl_org_staffplan where plan_name " + dbType.like(staffName) + ") ";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return sqlWhere;
|
|
|
|
return sqlWhere;
|
|
|
|
}
|
|
|
|
}
|
|
|
|