|
@ -11,6 +11,7 @@ import com.yihu.ehr.framework.util.sql.RequestParamTransformer;
|
|
|
import com.yihu.ehr.standard.model.standard.resultModel.PublisherResultModel;
|
|
|
import com.yihu.ehr.system.model.SystemOrganization;
|
|
|
import org.hibernate.Criteria;
|
|
|
import org.hibernate.Query;
|
|
|
import org.hibernate.Session;
|
|
|
import org.hibernate.criterion.Order;
|
|
|
import org.hibernate.criterion.Restrictions;
|
|
@ -106,4 +107,23 @@ public class StdPublisherService extends SQLGeneralDAO {
|
|
|
return Result.error("获取机构信息失败");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public Result getStandardPublisher() {
|
|
|
try {
|
|
|
String paramSql = "select s.org_id from system_param s where s.param_key = '"+ Constants.STANDARD+"'";
|
|
|
Query paramQuery = getCurrentSession().createSQLQuery(paramSql);
|
|
|
String publisherCode = (String) paramQuery.uniqueResult();
|
|
|
Criteria criteria = getCurrentSession().createCriteria(SystemOrganization.class);
|
|
|
criteria.add(Restrictions.eq("code", publisherCode));
|
|
|
SystemOrganization systemOrganization = (SystemOrganization) criteria.uniqueResult();
|
|
|
PublisherResultModel publisherResultModel = new PublisherResultModel();
|
|
|
publisherResultModel.setCode(systemOrganization.getCode());
|
|
|
publisherResultModel.setName(systemOrganization.getFullName());
|
|
|
publisherResultModel.setSuccessFlg(true);
|
|
|
publisherResultModel.setMessage("获取机构信息成功");
|
|
|
return publisherResultModel;
|
|
|
} catch (Exception e) {
|
|
|
throw new ApiException(ErrorCode.GetPublisherFailed);
|
|
|
}
|
|
|
}
|
|
|
}
|