|
@ -0,0 +1,49 @@
|
|
|
package com.yihu.wlyy.service.app.application;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.wlyy.entity.application.Application;
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
|
import com.yihu.wlyy.repository.application.ApplicationDao;
|
|
|
import com.yihu.wlyy.repository.doctor.DoctorDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by yeshijie on 2017/11/13.
|
|
|
*/
|
|
|
@Service
|
|
|
public class ApplicationService extends BaseService{
|
|
|
|
|
|
@Autowired
|
|
|
private ApplicationDao applicationDao;
|
|
|
@Autowired
|
|
|
private DoctorDao doctorDao;
|
|
|
|
|
|
/**
|
|
|
* 获取应用
|
|
|
* @param type
|
|
|
* @param doctor
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray getAppList(String type,String doctor){
|
|
|
JSONArray re = new JSONArray();
|
|
|
Doctor d = doctorDao.findByCode(doctor);
|
|
|
List<Application> appList = applicationDao.findByTypeAndHopital(type,d.getHospital());
|
|
|
appList.forEach(application -> {
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("name",application.getName());
|
|
|
json.put("code",application.getCode());
|
|
|
json.put("icon",application.getIcon());
|
|
|
json.put("type",application.getType());
|
|
|
json.put("url",application.getUrl());
|
|
|
re.add(json);
|
|
|
});
|
|
|
|
|
|
return re;
|
|
|
}
|
|
|
|
|
|
}
|