人员状态枚举适配

This commit is contained in:
钱涛 2022-09-22 11:42:02 +08:00
parent f10a320a62
commit 1573fc5bcf
5 changed files with 36 additions and 8 deletions

View File

@ -738,7 +738,7 @@
or (param.subcompanyIds != null and param.subcompanyIds.size()>0)
or (param.departmentIds != null and param.departmentIds.size()>0)
or (param.positionIds != null and param.positionIds.size()>0)
or (param.status != null and param.status != 'ALL')">
or (param.status != null and param.status.toString != 'ALL')">
AND employee_id IN
(
SELECT id FROM hrmresource em WHERE em.status not in (7)
@ -767,11 +767,11 @@
</foreach>
</if>
-- 在职
<if test="param.status != null and param.status == 'NORMAL'">
<if test="param.status != null and param.status.toString == 'NORMAL'">
AND em.status in (0,1,2,3)
</if>
-- 离职
<if test="param.status != null and param.status == 'UNAVAILABLE'">
<if test="param.status != null and param.status.toString == 'UNAVAILABLE'">
AND em.status in (4,5,6)
</if>
)

View File

@ -0,0 +1,25 @@
package com.engine.salary.sys.entity.param;
import com.engine.salary.util.valid.DataCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 保存人员定位规则参数
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MatchEmployeeModeSaveParam {
@DataCheck(require = true,message = "规则为空")
private String rule;
}

View File

@ -199,7 +199,7 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
if (po == null) {
SalarySysConfPO build = SalarySysConfPO.builder()
.id(IdGenerator.generate())
.confKey(ASCORDESC_CODE)
.confKey(MATCH_EMPLOYEE_MODE)
.confValue(rule)
.title("定位人员规则")
.orderWeight(0)

View File

@ -1,6 +1,7 @@
package com.engine.salary.web;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.sys.entity.param.MatchEmployeeModeSaveParam;
import com.engine.salary.sys.entity.param.OrderRuleParam;
import com.engine.salary.sys.entity.param.SalarySysConfQueryParam;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
@ -172,9 +173,9 @@ public class SalarySystemConfigController {
@POST
@Path("/saveMatchEmployeeModeRule")
@Produces(MediaType.APPLICATION_JSON)
public String saveMatchEmployeeModeRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody String param) {
public String saveMatchEmployeeModeRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody MatchEmployeeModeSaveParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<String, String>(user).run(getSalarySystemConfigWrapper(user)::saveMatchEmployeeModeRule, param);
return new ResponseResult<MatchEmployeeModeSaveParam, String>(user).run(getSalarySystemConfigWrapper(user)::saveMatchEmployeeModeRule, param);
}
}

View File

@ -2,6 +2,7 @@ package com.engine.salary.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.sys.entity.param.MatchEmployeeModeSaveParam;
import com.engine.salary.sys.entity.param.OrderRuleParam;
import com.engine.salary.sys.entity.param.SalarySysConfQueryParam;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
@ -113,7 +114,8 @@ public class SalarySystemConfigWrapper extends Service {
return getSalarySysConfService(user).orderRule();
}
public void saveMatchEmployeeModeRule(String rule) {
getSalarySysConfService(user).saveMatchEmployeeModeRule(rule);
public void saveMatchEmployeeModeRule(MatchEmployeeModeSaveParam param) {
ValidUtil.doValidator(param);
getSalarySysConfService(user).saveMatchEmployeeModeRule(param.getRule());
}
}