Exemplo n.º 1
0
 /**
  * 审批
  *
  * @author
  * @date
  */
 @Action(value = "audit")
 public String audit() throws BizException {
   bill = getBillService().find(id);
   try {
     Object[] obj =
         executionAPIService.isAudit(
             null, bill.getId(), "", getOnlineUser().getUser().getLoginId());
     Boolean flag = (Boolean) obj[0];
     String counterSignRuleId = (String) obj[1];
     if (flag) {
       setJsonString("{success : true,msg : '" + counterSignRuleId + "'}");
     } else {
       throw new BizException("无审批权力!");
     }
   } catch (Exception e) {
     throw new BizException(e.getMessage());
   }
   return SUCCESS;
 }
Exemplo n.º 2
0
 /** 编辑数据 */
 @Action(value = "edit")
 public String edit() throws BizException {
   bill = getBillService().find_full(id);
   // 只有制单人才允许修改单据
   User onlineuser = getOnlineUser().getUser();
   if (!onlineuser.getId().equals(bill.getCreater())) {
     throw new BizException("只有制单人才可以修改单据!");
   }
   // 编辑状态和审批中状态允许编辑,因为流程有驳回功能,被驳回到制单人的单据仍然需要修改。
   if (BillState.EDIT != bill.getState() && BillState.BPMING != bill.getState()) {
     throw new BizException(
         "当前单据的状态为【".concat(bill.getEnumDescription("state")).concat("】,不允许修改!"));
   }
   if (BillState.BPMING == bill.getState()) {
     boolean isfrist = executionAPIService.isTheFirstNode(bill.getId());
     if (!isfrist) {
       throw new BizException("当前单据已经在流程中,不能进行编辑操作!");
     }
   }
   return load();
 }