Skip to content

Commit

Permalink
be: this._defaultBackPath
Browse files Browse the repository at this point in the history
  • Loading branch information
getrebuild committed Nov 15, 2023
1 parent 88a3cc9 commit aece228
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package com.rebuild.web.robot.approval;

import cn.devezhao.commons.web.ServletUtils;
import cn.devezhao.persist4j.Entity;
import cn.devezhao.persist4j.Record;
import cn.devezhao.persist4j.engine.ID;
import com.alibaba.fastjson.JSON;
Expand Down Expand Up @@ -79,14 +80,16 @@ public JSON getWorkable(HttpServletRequest request, @IdParam(name = "record") ID

@GetMapping("state")
public RespBody getApprovalState(HttpServletRequest request, @IdParam(name = "record") ID recordId) {
if (!MetadataHelper.hasApprovalField(MetadataHelper.getEntity(recordId.getEntityCode()))) {
final Entity approvalEntity = MetadataHelper.getEntity(recordId.getEntityCode());
if (!MetadataHelper.hasApprovalField(approvalEntity)) {
return RespBody.error("NOT AN APPROVAL ENTITY");
}

final ID user = getRequestUser(request);
final ApprovalStatus status = ApprovalHelper.getApprovalStatus(recordId);

JSONObject data = new JSONObject();
data.put("entityName", approvalEntity.getName());

int stateVal = status.getCurrentState().getState();
data.put("state", stateVal);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/web/assets/js/admin/approval-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class ApprovalReferral extends RbModalHandler {
$mp.end()

if (res.error_code === 0) {
RbHighbar.success(res.data > 0 ? $L('已转审 %d 条审批记录') : $L('批量转审完成'))
RbHighbar.success(res.data > 0 ? $L('已转审 %d 条审批记录', res.data) : $L('批量转审完成'))
setTimeout(() => that.hide(), 1500)
} else {
RbHighbar.error(res.error_msg)
Expand Down

0 comments on commit aece228

Please sign in to comment.