GetESignConfigTableService.java 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package com.kingdee.eas.custom.esign.service;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.kingdee.bos.BOSException;
  4. import com.kingdee.bos.Context;
  5. import com.kingdee.bos.bsf.service.app.IHRMsfService;
  6. import com.kingdee.eas.common.EASBizException;
  7. import com.kingdee.eas.custom.esign.FieldMappingFactory;
  8. import com.kingdee.eas.custom.esign.FieldMappingInfo;
  9. import com.kingdee.shr.base.syssetting.MSFServiceFacadeFactory;
  10. import java.util.HashMap;
  11. import java.util.Map;
  12. public class GetESignConfigTableService implements IHRMsfService {
  13. @Override
  14. public Object process(Context context, Map map) throws EASBizException, BOSException {
  15. // 从参数映射中获取"number"参数值,用于定位配置信息
  16. Object o = map.get("number");
  17. // 从参数映射中获取"filter"参数值,用于构建查询过滤条件
  18. Object o1 = map.get("filter");
  19. Object otherParameters = map.get("otherParameters");
  20. // 若"number"参数为null,返回空字符串(无效请求)
  21. if(o==null){
  22. return "";
  23. }
  24. // 若"number"参数为null,返回空字符串(无效请求)
  25. if(o1==null){
  26. return "";
  27. }
  28. FieldMappingInfo fieldMappingInfo = FieldMappingFactory.getLocalInstance(context)
  29. .getFieldMappingInfo("where number = '" + o.toString() + "' ");
  30. String dataInterface = fieldMappingInfo.getDataInterface();
  31. if (dataInterface==null||dataInterface.equals("")){
  32. Map<String,Object> getSqlServiceMap = new HashMap<String,Object>();
  33. getSqlServiceMap.put("number",fieldMappingInfo.getNumber());
  34. getSqlServiceMap.put("filter",o1.toString());
  35. Object o2 = MSFServiceFacadeFactory.getLocalInstance(context)
  36. .processService("getESignConfigDataService", getSqlServiceMap);
  37. return o2;
  38. }else {
  39. JSONObject jsonObject = JSONObject.parseObject(otherParameters.toString());
  40. Map<String,Object> osfMap = new HashMap<String, Object>();
  41. for (String key : jsonObject.keySet()) {
  42. osfMap.put(key,jsonObject.getString(key));
  43. }
  44. osfMap.put("number",fieldMappingInfo.getNumber());
  45. Object o2 = MSFServiceFacadeFactory.getLocalInstance(context)
  46. .processService(dataInterface, osfMap);
  47. return o2;
  48. }
  49. }
  50. }