GetEntityInfoService.java 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package com.kingdee.eas.custom.dataconfig.utils.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.bos.metadata.entity.EntityObjectInfo;
  7. import com.kingdee.eas.common.EASBizException;
  8. import com.kingdee.eas.custom.dataconfig.utils.SqlUtils;
  9. import java.util.Map;
  10. public class GetEntityInfoService implements IHRMsfService {
  11. @Override
  12. public Object process(Context context, Map map) throws EASBizException, BOSException {
  13. Object o = map.get("entryFull");
  14. String entryFull = o.toString();
  15. SqlUtils sqlUtils = new SqlUtils();
  16. EntityObjectInfo entryInfo = sqlUtils.getEntryInfo(entryFull, context);
  17. JSONObject jsonObject = new JSONObject();
  18. if (entryInfo.getTable()!=null){
  19. jsonObject.put("code",200);
  20. JSONObject object = new JSONObject();
  21. object.put("name", entryInfo.getName());
  22. object.put("alias", entryInfo.getAlias());
  23. object.put("displayName", entryInfo.getAlias());
  24. jsonObject.put("data",object);
  25. }else {
  26. jsonObject.put("code",400);
  27. }
  28. return jsonObject;
  29. }
  30. }