|
@ -5,11 +5,14 @@ import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
|
|
|
import com.yihu.ehr.framework.constrant.Constants;
|
|
|
import com.yihu.ehr.framework.constrant.ErrorCode;
|
|
|
import com.yihu.ehr.framework.exception.ApiException;
|
|
|
import com.yihu.ehr.framework.model.DataGridResult;
|
|
|
import com.yihu.ehr.framework.model.TreeResult;
|
|
|
import com.yihu.ehr.framework.util.operator.CollectionUtil;
|
|
|
import com.yihu.ehr.framework.util.operator.StringUtil;
|
|
|
import com.yihu.ehr.framework.util.sql.RequestParamTransformer;
|
|
|
import com.yihu.ehr.framework.util.sql.SqlCreator;
|
|
|
import com.yihu.ehr.standard.model.adapter.AdapterSchemeModel;
|
|
|
import com.yihu.ehr.standard.model.adapter.AdapterSchemeVersionModel;
|
|
|
import com.yihu.ehr.standard.model.standard.StandardModel;
|
|
|
import com.yihu.ehr.standard.model.standard.StandardVersionModel;
|
|
|
import com.yihu.ehr.standard.service.bo.StandardVersion;
|
|
@ -18,6 +21,7 @@ import org.hibernate.Query;
|
|
|
import org.hibernate.Session;
|
|
|
import org.hibernate.criterion.Order;
|
|
|
import org.hibernate.criterion.Restrictions;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.dao.DataAccessException;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@ -337,4 +341,35 @@ public class StandardVersionService extends SQLGeneralDAO {
|
|
|
insertBatch(insertSql);
|
|
|
insertBatch(updateSql);
|
|
|
}
|
|
|
|
|
|
public DataGridResult getVersion() throws Exception {
|
|
|
String SchemeSql = "from AdapterSchemeModel";
|
|
|
|
|
|
List<AdapterSchemeModel>std=(List<AdapterSchemeModel>)super.hibernateTemplate.find(SchemeSql);
|
|
|
DataGridResult data=new DataGridResult();
|
|
|
List<TreeResult>results=new ArrayList<>();
|
|
|
for(int i=0;i<std.size();i++){
|
|
|
TreeResult re=new TreeResult();
|
|
|
//re.setPid("0");
|
|
|
re.setText(std.get(i).getName());
|
|
|
re.setId(String.valueOf(std.get(i).getId()));
|
|
|
results.add(re);
|
|
|
String sql = "from AdapterSchemeVersionModel ";
|
|
|
sql+="where schemeId="+std.get(i).getId();
|
|
|
List<AdapterSchemeVersionModel>stdModel=(List<AdapterSchemeVersionModel>)super.hibernateTemplate.find(sql);
|
|
|
for(int j=0;j<stdModel.size();j++)
|
|
|
{
|
|
|
TreeResult tmpTree=new TreeResult();
|
|
|
tmpTree.setId(String.valueOf(stdModel.get(j).getId()));
|
|
|
tmpTree.setText(stdModel.get(j).getName());
|
|
|
tmpTree.setPid(String.valueOf(std.get(i).getId()));
|
|
|
results.add(tmpTree);
|
|
|
}
|
|
|
}
|
|
|
data.setTotalCount(results.size());
|
|
|
data.setDetailModelList(results);
|
|
|
return data;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|