|
@ -14,11 +14,8 @@ import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
|
|
|
import com.yihu.wlyy.service.BaseService;
|
|
|
import com.yihu.wlyy.service.common.account.DoctorService;
|
|
|
import com.yihu.wlyy.task.PushMsgTask;
|
|
|
import com.yihu.wlyy.util.http.HttpResponse;
|
|
|
import com.yihu.wlyy.util.http.HttpUtils;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
|
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONException;
|
|
@ -1882,10 +1879,11 @@ public class ManagerQuestionnaireService extends BaseService {
|
|
|
}
|
|
|
List<Map<String, Object>> groupPatient = null;
|
|
|
if (StringUtils.isNotBlank(labelHealthType) || StringUtils.isNotBlank(labelDiseaseType)) {
|
|
|
String sql = "SELECT DISTINCT s.patient as service_patient_code, f.`name` as service_patient_name, f.ssc,f.idcard,f.mobile,f.hospital,f.hospital_name,h.town,h.town_name FROM ( SELECT t.patient," +
|
|
|
String sql = "SELECT DISTINCT s.patient as servicePatientCode, f.`name` as servicePatientName, f.ssc,f.idcard,f.mobile,f.hospital,f.hospital_name as hospitalName, h.town,h.town_name as townName FROM ( SELECT t.patient," +
|
|
|
" GROUP_CONCAT(',',t.label_type,t.label,',') label FROM " +
|
|
|
" wlyy_sign_patient_label_info t WHERE t.patient IN (" +
|
|
|
tableSql + whereSql + ") AND t. STATUS = 1 GROUP BY t.patient ) s LEFT JOIN wlyy_sign_family f on s.patient=f.patient LEFT JOIN dm_hospital h on f.hospital=h.`code` where 1=1 ";
|
|
|
" wlyy_sign_patient_label_info t WHERE t.patient IN ( select p.code " +
|
|
|
" from wlyy_sign_family w ,wlyy_admin_team t, dm_hospital h , wlyy_sign_family_server s , wlyy_patient p " +
|
|
|
whereSql + ") AND t. STATUS = 1 GROUP BY t.patient ) s LEFT JOIN wlyy_sign_family f on s.patient=f.patient LEFT JOIN dm_hospital h on f.hospital=h.`code` where 1=1 ";
|
|
|
if (StringUtils.isNotBlank(labelHealthType)) {
|
|
|
String[] aa = labelHealthType.split(",");
|
|
|
String bb = "";
|
|
@ -1910,30 +1908,6 @@ public class ManagerQuestionnaireService extends BaseService {
|
|
|
return groupPatient;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 调用集美客服派发问卷协同服务接口
|
|
|
* @param jsonData
|
|
|
* @param patientInfo
|
|
|
* @param doctor
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONObject createWorkOrder(String jsonData, List<Map<String, Object>> patientInfo, String doctor) throws Exception{
|
|
|
JSONObject object = new JSONObject(jsonData);
|
|
|
JSONArray patientInfos = new JSONArray(patientInfo);
|
|
|
Doctor d = doctorService.findDoctorByCode(doctor);
|
|
|
object.put("createUser", d.getCode());
|
|
|
object.put("createUserName", d.getName());
|
|
|
object.put("createUserType", 1);
|
|
|
Map<String, Object> param = new HashedMap();
|
|
|
param.put("patientInfo", patientInfos.toString());
|
|
|
param.put("jsonData", object.toString());
|
|
|
HttpResponse response = null;
|
|
|
response = HttpUtils.doPost(customerUrl + "synergy/questionnaire/createWorkOrder", param);
|
|
|
JSONObject rs = new JSONObject(response.getContent());
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 保存问卷调查结果和答案
|
|
|
* @param jsonData
|