update - REQ-2324-批量设置待办为审批中接口增加subBizCodes参数

This commit is contained in:
yangqicheng 2024-05-23 16:53:01 +08:00
parent 7f227a4e8d
commit 839139eb26
4 changed files with 11 additions and 7 deletions

View File

@ -238,11 +238,11 @@ public class PendingMessageNewController implements PendingMessageClient {
}
@Override
public CommonResponse<Boolean> batchSetProcessing(List<String> identityCodes) {
public CommonResponse<Boolean> batchSetProcessing(List<String> identityCodes, List<String> subBizCodes) {
log.info("setProcessing, request={}", JSON.toJSONString(identityCodes));
Boolean result = null;
try {
result = todoManager.batchSetProcessing(identityCodes);
result = todoManager.batchSetProcessing(identityCodes, subBizCodes);
return CommonResponse.success(result);
} finally {
log.info("setProcessing. request={}, response={}", identityCodes, result);

View File

@ -386,10 +386,10 @@ public class TodoManager {
* 将待办设置为执行中
*/
@Transactional(rollbackFor = Exception.class)
public Boolean batchSetProcessing(List<String> identityCodes) {
public Boolean batchSetProcessing(List<String> identityCodes, List<String> subBizCodes) {
log.info("batch set processing...,request:{}", JSONUtil.toJsonStr(identityCodes));
BizAssertions.assertTrue(CollectionUtils.isNotEmpty(identityCodes), "identityCodes列表不能为空");
Boolean updated = todoDao.batchSetExecutableProcessing(identityCodes);
Boolean updated = todoDao.batchSetExecutableProcessing(identityCodes, subBizCodes);
if (updated) {
List<Todo> updatedTodos = todoDao.getByIdentityCodes(identityCodes);
TodoRequestContext ctx = TodoRequestContext.create("batchSetProcessing", identityCodes);

View File

@ -274,7 +274,7 @@ public interface PendingMessageClient {
* 批量将待办设置为处理中
*/
@PostMapping(value = "/pending-message/update/batchSetProcessing", produces = {MediaType.APPLICATION_JSON_VALUE})
CommonResponse<Boolean> batchSetProcessing(@RequestBody @Valid List<String> identityCodes);
CommonResponse<Boolean> batchSetProcessing(@RequestBody @Valid List<String> identityCodes, List<String> subBizCodes);
/**
* 通过BizCode获取最新代办

View File

@ -105,10 +105,14 @@ public class TodoDao extends ServiceImpl<TodoMapper, Todo> {
return new SampleTodos(todos);
}
public Boolean batchSetExecutableProcessing(List<String> identityCodes) {
public Boolean batchSetExecutableProcessing(List<String> identityCodes, List<String> subBizCodes) {
if (CollectionUtils.isEmpty(identityCodes) && CollectionUtils.isEmpty(subBizCodes)) {
throw new IllegalArgumentException("identityCodes and subBizCodes can't be empty");
}
return lambdaUpdate()
.eq(Todo::getType, TodoType.EXECUTABLE)
.in(Todo::getIdentityCode, identityCodes)
.in(CollectionUtils.isNotEmpty(identityCodes), Todo::getIdentityCode, identityCodes)
.in(CollectionUtils.isNotEmpty(subBizCodes), Todo::getSubBizCode, subBizCodes)
.in(Todo::getState, PendingMessageStateEnum.HAS_BEEN_SENT, PendingMessageStateEnum.PROCESSING)
.set(Todo::getState, PendingMessageStateEnum.PROCESSING)
.update();