扣除名单编辑接口

This commit is contained in:
钱涛 2025-03-19 16:25:42 +08:00
parent 10f1ec1629
commit d7702d7cae
6 changed files with 59 additions and 1 deletions

View File

@ -0,0 +1,30 @@
package com.engine.salary.entity.deductionamount.param;
import com.engine.salary.util.valid.DataCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 扣除名单查询参数
* <p>Copyright: Copyright (c) 2023</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class DeductionAmountEditParam {
/**
* ID
*/
@DataCheck(require = true, message = "参数错误id不能为空")
private Long id;
@DataCheck(require = true, message = "请选择是否扣除")
private Integer deductFlag;
}

View File

@ -10,7 +10,7 @@ import java.util.Collection;
import java.util.Date;
/**
* 人员报送记录
* 扣除名单
*/
@Data
@Builder

View File

@ -18,6 +18,8 @@ public interface DeductionAmountService {
void add(DeductionAmountAddParam param);
void edit(DeductionAmountEditParam param);
void delete(DeductionAmountDeleteParam param);
Object query(DeductionAmountOnlineQueryParam param);

View File

@ -129,6 +129,19 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou
.forEach(deductionAmountPO -> getDeductionAmountMapper().insertIgnoreNull(deductionAmountPO));
}
@Override
public void edit(DeductionAmountEditParam param) {
ValidUtil.doValidator(param);
DeductionAmountPO po = getDeductionAmountMapper().getById(param.getId());
if (po == null) {
throw new SalaryRunTimeException("扣除名单不存在");
}
po.setDeductFlag(param.getDeductFlag());
getDeductionAmountMapper().updateIgnoreNull(po);
}
@Override
public void delete(DeductionAmountDeleteParam param) {
if (CollUtil.isEmpty(param.getIds())) {

View File

@ -51,6 +51,14 @@ public class DeductionAmountController {
return new ResponseResult<DeductionAmountAddParam, Object>(user).run(getDeductionAmountWrapper(user)::add, param);
}
@POST
@Path("/edit")
@Produces(MediaType.APPLICATION_JSON)
public String edit(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountEditParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<DeductionAmountEditParam, Object>(user).run(getDeductionAmountWrapper(user)::edit, param);
}
@POST
@Path("/delete")
@Produces(MediaType.APPLICATION_JSON)

View File

@ -32,6 +32,10 @@ public class DeductionAmountWrapper extends Service {
getDeductionAmountService(user).add(param);
}
public void edit(DeductionAmountEditParam param) {
getDeductionAmountService(user).edit(param);
}
public void delete(DeductionAmountDeleteParam param) {
getDeductionAmountService(user).delete(param);
}
@ -47,4 +51,5 @@ public class DeductionAmountWrapper extends Service {
public String feedback(DeductionAmountFeedBackParam param) {
return getDeductionAmountService(user).feedback(param);
}
}