代码审批工作流
public String sapPaymentStatus(Context ctx,String resultJson) throws EASBizException, BOSException
{
System.out.print("进入接口.JSON="+resultJson);
//把回传的json字符串转为实体
SapPayMentBean sapPay=com.alibaba.fastjson.JSON.parseObject(resultJson,SapPayMentBean.class);
String result="0";
String seleSQL="select FASSIGNID ,FBILLENTITY ,FBIZOBJID,FBIZFUNCTION,FPERFORMERUNAME_L2 from T_WFR_Assign where FASSIGNID='"+sapPay.getWorkFlowId()+"'";
IRowSet rowSet = com.kingdee.eas.util.app.DbUtil.executeQuery(ctx, seleSQL);
if(rowSet.size()==0)
{
System.out.print(seleSQL+"未查询到相关数据");
return "3";
}
//在缓存中清楚审批信息
EngineUtil.getEngine(ctx).getCacheManager().removeAssignment(sapPay.getWorkFlowId());
//获取审批任务信息时,需要根据来源单据的id判断根据来源单据id找到对应单据的流程任务,获取id进行后续审批操作
//获取审批任务信息
//AssignInfo i=new AssignInfo();
AssignmentInfo assignmentInfo = EnactmentServiceFactory.createEnactService(ctx).getAssignmentById(sapPay.getWorkFlowId());
System.out.print("执行接口.businuessObjectId="+assignmentInfo.getBizObjectIds());
if (assignmentInfo.getState().getValue() > 2)
return result;
//修改上下文中的人员信息为审批任务当前节点的人员
ctx.setCaller(new ObjectUuidPK(assignmentInfo.getAssignInfo().getPersonUserID()));
//定义一个审批结果实体
MultiApproveInfo info = new MultiApproveInfo();
//审批任务
info.setAssignment(sapPay.getWorkFlowId());
//审批单据
info.setBillId(BOSUuid.read(assignmentInfo.getBizObjectIds()));
info.setExtendedProperty("businuessObjectId", assignmentInfo.getBizObjectIds());
info.setExtendedProperty("assignmentID", sapPay.getWorkFlowId());
info.setExtendedProperty("isAddNew", "isAddNew");
info.setIsMailNotifyNext(false);
info.setIsMobelNotifyNext(false);
//审批内容
info.setOpinion( sapPay.getOpinion());
//审批结果
info.setIsPass("submit".equals(sapPay.getActionType()) ? ApproveResult.PASS : ApproveResult.NOT_PASS);
info.setHandlerOpinion(0);
info.setHandlerContent("无");
info.setStatus(MultiApproveStatusEnum.SUBMIT);
info.setBosTypeStr("CAE44FAA");
MultiApproveFactory.getLocalInstance(ctx).save(info);
MultiApproveFactory.getLocalInstance(ctx).submit(info);
System.out.print("执行接口完成,result:"+result);
return result;
}
麻烦分享下这个类SapPayMentBean
代码审批工作流
本文2024-09-16 22:53:04发表“eas cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-eas-51006.html