parent
0bcafd3934
commit
61beec603e
|
|
@ -5,6 +5,8 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
|
|
@ -13,9 +15,6 @@ import lombok.NoArgsConstructor;
|
|||
public class PushParam {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long salaryAcctRecordId;
|
||||
|
||||
private List<Long> ids;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.engine.salary.entity.push.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WithdrawParam {
|
||||
|
||||
|
||||
private List<Long> ids;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.salary.entity.push.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 创建推送记录
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WithdrawPushParam {
|
||||
|
||||
|
||||
private List<Long> ids;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -123,4 +123,12 @@ public class PushController {
|
|||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PushParam, String>(user).run(getPushWrapper(user)::push, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/record/withdraw")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String push(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody WithdrawParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<WithdrawParam, String>(user).run(getPushWrapper(user)::withdraw, param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.push.dto.PushRecordDTO;
|
||||
|
|
@ -16,6 +17,7 @@ import com.engine.salary.util.page.PageInfo;
|
|||
import weaver.hrm.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
|
@ -67,10 +69,25 @@ public class PushWrapper extends Service {
|
|||
});
|
||||
}
|
||||
|
||||
public void push(PushParam pushParam) {
|
||||
getPushService(user).push(pushParam.getId());
|
||||
public void push(PushParam param) {
|
||||
List<Long> ids = param.getIds();
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
ids.forEach(id -> {
|
||||
getPushService(user).push(id);
|
||||
});
|
||||
}
|
||||
|
||||
public void withdraw(WithdrawParam param) {
|
||||
List<Long> ids = param.getIds();
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
ids.forEach(id -> {
|
||||
getPushService(user).withdraw(id);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public PageInfo<PushRecordDTO> recordList(RecordListQueryParam param) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue