SYUtilsFacade.java 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. package com.kingdee.eas.custom.shuiyou.uitls;
  2. import com.kingdee.bos.framework.ejb.EJBRemoteException;
  3. import com.kingdee.bos.util.BOSObjectType;
  4. import java.rmi.RemoteException;
  5. import com.kingdee.bos.framework.AbstractBizCtrl;
  6. import com.kingdee.bos.orm.template.ORMObject;
  7. import com.kingdee.bos.Context;
  8. import com.kingdee.eas.custom.shuiyou.uitls.*;
  9. import com.kingdee.bos.BOSException;
  10. import java.util.Map;
  11. import com.kingdee.eas.custom.shuiyou.interfacelog.LogInfoInfo;
  12. import com.kingdee.eas.custom.shuiyou.interfaceiog.LogInfoInfo;
  13. import java.lang.String;
  14. import com.kingdee.eas.custom.shuiyou.task.TaskCatalogEnum;
  15. import com.kingdee.bos.framework.*;
  16. import cn.hutool.core.lang.Snowflake;
  17. import com.kingdee.bos.util.*;
  18. public class SYUtilsFacade extends AbstractBizCtrl implements ISYUtilsFacade
  19. {
  20. public SYUtilsFacade()
  21. {
  22. super();
  23. registerInterface(ISYUtilsFacade.class, this);
  24. }
  25. public SYUtilsFacade(Context ctx)
  26. {
  27. super(ctx);
  28. registerInterface(ISYUtilsFacade.class, this);
  29. }
  30. public BOSObjectType getType()
  31. {
  32. return new BOSObjectType("A069618E");
  33. }
  34. private SYUtilsFacadeController getController() throws BOSException
  35. {
  36. return (SYUtilsFacadeController)getBizController();
  37. }
  38. /**
  39. *签名-User defined method
  40. *@param param 需要签名的参数
  41. *@return
  42. */
  43. public String getSignature(String param) throws BOSException
  44. {
  45. try {
  46. return getController().getSignature(getContext(), param);
  47. }
  48. catch(RemoteException err) {
  49. throw new EJBRemoteException(err);
  50. }
  51. }
  52. /**
  53. *初始化配置-User defined method
  54. *@param filePath 配置文件地址
  55. */
  56. public void initConfig(String filePath) throws BOSException
  57. {
  58. try {
  59. getController().initConfig(getContext(), filePath);
  60. }
  61. catch(RemoteException err) {
  62. throw new EJBRemoteException(err);
  63. }
  64. }
  65. /**
  66. *写入日志-User defined method
  67. *@param logInfo 日志对象
  68. *@return
  69. */
  70. public LogInfoInfo log(LogInfoInfo logInfo) throws BOSException
  71. {
  72. try {
  73. return getController().log(getContext(), logInfo);
  74. }
  75. catch(RemoteException err) {
  76. throw new EJBRemoteException(err);
  77. }
  78. }
  79. /**
  80. *获取配置文件参数-User defined method
  81. *@return
  82. */
  83. public Map getConfig() throws BOSException
  84. {
  85. try {
  86. return getController().getConfig(getContext());
  87. }
  88. catch(RemoteException err) {
  89. throw new EJBRemoteException(err);
  90. }
  91. }
  92. /**
  93. *[description]该任务会循环调用,直到返回成功状态[%description][invokedemo][%invokedemo][returndesc]任务id[%returndesc]-User defined method
  94. *@param url 请求地址
  95. *@param requestId 请求id
  96. *@param osfServiceName 请求成功时回调
  97. *@param backParam 回调osf服务时会一并当成参数传入
  98. *@param catalog 任务类型
  99. *@return
  100. */
  101. public String backTask(String url, String requestId, String osfServiceName, String backParam, TaskCatalogEnum catalog) throws BOSException
  102. {
  103. try {
  104. return getController().backTask(getContext(), url, requestId, osfServiceName, backParam, catalog);
  105. }
  106. catch(RemoteException err) {
  107. throw new EJBRemoteException(err);
  108. }
  109. }
  110. /**
  111. *post请求-User defined method
  112. *@param url url
  113. *@param param jsonStr参数
  114. *@return
  115. */
  116. public String post(String url, String param) throws BOSException
  117. {
  118. try {
  119. return getController().post(getContext(), url, param);
  120. }
  121. catch(RemoteException err) {
  122. throw new EJBRemoteException(err);
  123. }
  124. }
  125. /**
  126. *get请求-User defined method
  127. *@param url url
  128. *@param param jsonStr参数
  129. *@return
  130. */
  131. public String get(String url, String param) throws BOSException
  132. {
  133. try {
  134. return getController().get(getContext(), url, param);
  135. }
  136. catch(RemoteException err) {
  137. throw new EJBRemoteException(err);
  138. }
  139. }
  140. /**
  141. *签名-User defined method
  142. *@param propt 配置文件Map
  143. *@param paramMap 参数Map
  144. *@return
  145. */
  146. public String getSignature(Map propt, Map paramMap) throws BOSException
  147. {
  148. try {
  149. return getController().getSignature(getContext(), propt, paramMap);
  150. }
  151. catch(RemoteException err) {
  152. throw new EJBRemoteException(err);
  153. }
  154. }
  155. /**
  156. *任务执行一次,不管成功失败-User defined method
  157. *@param osfServiceName osf服务名称
  158. *@param param 参数
  159. *@param catalog 任务类型
  160. *@param taskPreId 前置任务没有完成,任务不会执行。
  161. *@return
  162. */
  163. public String addTask(String osfServiceName, String param, TaskCatalogEnum catalog, String taskPreId) throws BOSException
  164. {
  165. try {
  166. return getController().addTask(getContext(), osfServiceName, param, catalog, taskPreId);
  167. }
  168. catch(RemoteException err) {
  169. throw new EJBRemoteException(err);
  170. }
  171. }
  172. /**
  173. *删除任务,如果该任务有前置任务或者后置任务,则前置任务或者后置任务也会被删除。-User defined method
  174. *@param taskId 任务id
  175. *@return
  176. */
  177. public boolean delTask(String taskId) throws BOSException
  178. {
  179. try {
  180. return getController().delTask(getContext(), taskId);
  181. }
  182. catch(RemoteException err) {
  183. throw new EJBRemoteException(err);
  184. }
  185. }
  186. /**
  187. *获取全局的雪花对象-User defined method
  188. *@return
  189. */
  190. public Snowflake getSnowflake() throws BOSException
  191. {
  192. try {
  193. return getController().getSnowflake(getContext());
  194. }
  195. catch(RemoteException err) {
  196. throw new EJBRemoteException(err);
  197. }
  198. }
  199. /**
  200. *获取业务编码-User defined method
  201. *@return
  202. */
  203. public String getBizNo() throws BOSException
  204. {
  205. try {
  206. return getController().getBizNo(getContext());
  207. }
  208. catch(RemoteException err) {
  209. throw new EJBRemoteException(err);
  210. }
  211. }
  212. /**
  213. *任务执行一次,不管成功失败-User defined method
  214. *@param osfServiceName osf服务名称
  215. *@param param 参数
  216. *@param catalog 任务类型
  217. *@param taskPreId 前置任务没有完成,任务不会执行。
  218. *@param sourceBillId 来源单据的id
  219. *@return
  220. */
  221. public String addTask(String osfServiceName, String param, TaskCatalogEnum catalog, String taskPreId, String sourceBillId) throws BOSException
  222. {
  223. try {
  224. return getController().addTask(getContext(), osfServiceName, param, catalog, taskPreId, sourceBillId);
  225. }
  226. catch(RemoteException err) {
  227. throw new EJBRemoteException(err);
  228. }
  229. }
  230. }