编目系统-资源注册,添加批量提交功能

master
xiong_cl 7 months ago
parent 1077940aef
commit e6cf65add8
  1. 30
      shandan-bianmu/src/main/resources/static/js/business/metadata/metadata.js
  2. 1
      shandan-bianmu/src/main/resources/view/business/metadata/metadata.html
  3. 23
      shandan-system/src/main/java/com/keyware/shandan/bianmu/controller/ReviewRecordController.java

@ -185,6 +185,36 @@ layui.use(['layer', 'listPage', 'form', 'dict'], function () {
console.error(err);
})
})
});
listPage.addTableRowEvent('batchCommit', (data) => {
let checkRows = listPage.getCheckStatus();
let datas = checkRows.data;
if (datas.length == 0) {
showErrorMsg("请至少选择一条数据");
return;
}
layer.confirm('是否确定提交这些数据', {title: '提交'}, function () {
let ids = checkRows.data.map(d => d.id).join(',');
let param = {
ids: ids,
status: ReviewStatus.SUBMITTED,
opinion: '',
sendNotice: false,
};
Util.post(`/business/review/metadata/batch/change`, param).then(res => {
if (res.flag) {
layer.msg('提交成功');
listPage.reloadTable();
} else {
layer.msg('提交失败,' + res.msg);
}
}).catch(err => {
console.info(err);
layer.msg('提交失败,' + err.msg);
})
})
})
});

@ -30,6 +30,7 @@
<div class="layui-inline">
<button class="layui-btn layui-btn-sm" lay-event="add">新增</button>
<!--<button class="layui-btn layui-btn-sm" lay-event="add-zhikong">上传指控数据</button>-->
<button class="layui-btn layui-btn-sm" lay-event="batchCommit">提交</button>
<button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del">删除</button>
<input type="text" id="searchKeyInput" name="searchKeyInput" autocomplete="off"
placeholder="请输入关键字查询" class="layui-input layui-btn-sm">

@ -22,6 +22,7 @@ import org.springframework.web.servlet.ModelAndView;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* <p>
@ -138,6 +139,28 @@ public class ReviewRecordController extends BaseController<ReviewRecordService,
return Result.of(result, result);
}
/**
* 数据资源批量提交审核
*
* @param ids 主键
* @param status 要变更的审核状态
* @param opinion 审核意见
* @param sendNotice 是否发送通知
* @return 请求结果
*/
@PostMapping("/metadata/batch/change")
public Result<Object> metadatabatchSubmit(String ids, String status, String opinion, boolean sendNotice) {
if (StringUtils.isBlankAny(ids, status)) {
return Result.of(null, false, "参数错误");
}
ReviewStatus reviewStatus = ReviewStatus.valueOf(status);
Arrays.stream(ids.split(",")).forEach(id -> {
reviewRecordService.metadataReview(id, reviewStatus, opinion, sendNotice);
});
return Result.of(true, true);
}
/**
* 资源目录提交审核
*