人员校验规则
This commit is contained in:
parent
26c3f4580e
commit
b812454cd3
|
|
@ -21,4 +21,9 @@ public class SalarySysConstant {
|
|||
* 顺序标识
|
||||
*/
|
||||
public static final String ASCORDESC_CODE = "ascOrDesc";
|
||||
|
||||
/**
|
||||
* 定位人员规则标识
|
||||
*/
|
||||
public static final String MATCH_EMPLOYEE_MODE = "matchEmployeeMode";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,5 +42,7 @@ public interface SalarySysConfService {
|
|||
|
||||
void updateOrderRule(OrderRuleParam param);
|
||||
|
||||
void saveMatchEmployeeModeRule(String rule);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.engine.salary.sys.entity.param.OrderRuleParam;
|
|||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
import com.engine.salary.sys.enums.AscOrDescEnum;
|
||||
import com.engine.salary.sys.enums.MatchEmployeeModeEnum;
|
||||
import com.engine.salary.sys.enums.OrderRuleEnum;
|
||||
import com.engine.salary.sys.enums.TaxDeclarationFunctionEnum;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
|
|
@ -188,4 +189,31 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveMatchEmployeeModeRule(String rule) {
|
||||
if (MatchEmployeeModeEnum.parseByValue(rule) == null) {
|
||||
throw new SalaryRunTimeException("无效规则!");
|
||||
}
|
||||
|
||||
SalarySysConfPO po = getOneByCode(MATCH_EMPLOYEE_MODE);
|
||||
if (po == null) {
|
||||
SalarySysConfPO build = SalarySysConfPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.confKey(ASCORDESC_CODE)
|
||||
.confValue(rule)
|
||||
.title("定位人员规则")
|
||||
.orderWeight(0)
|
||||
.module("basic")
|
||||
.updateTime(new Date())
|
||||
.createTime(new Date())
|
||||
.deleteType(0)
|
||||
.build();
|
||||
getSalarySysConfMapper().insertIgnoreNull(build);
|
||||
} else {
|
||||
po.setConfValue(rule);
|
||||
po.setUpdateTime(new Date());
|
||||
getSalarySysConfMapper().updateIgnoreNull(po);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ public class SalarySystemConfigController {
|
|||
|
||||
/**
|
||||
* 单个规则配置
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
|
|
@ -168,4 +169,12 @@ public class SalarySystemConfigController {
|
|||
return new ResponseResult<OrderRuleParam, OrderRuleVO>(user).run(getSalarySystemConfigWrapper(user)::orderRule);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/saveMatchEmployeeModeRule")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveMatchEmployeeModeRule(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody String param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<String, String>(user).run(getSalarySystemConfigWrapper(user)::saveMatchEmployeeModeRule, param);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,4 +112,8 @@ public class SalarySystemConfigWrapper extends Service {
|
|||
public OrderRuleVO orderRule() {
|
||||
return getSalarySysConfService(user).orderRule();
|
||||
}
|
||||
|
||||
public void saveMatchEmployeeModeRule(String rule) {
|
||||
getSalarySysConfService(user).saveMatchEmployeeModeRule(rule);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue