|
@ -30,6 +30,7 @@ import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.BaseService;
|
|
import com.yihu.wlyy.service.app.device.PatientDeviceService;
|
|
import com.yihu.wlyy.service.app.device.PatientDeviceService;
|
|
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
|
|
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
|
|
|
|
import com.yihu.wlyy.service.app.statistics.ServiceStatisticsService;
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
import com.yihu.wlyy.service.app.team.AdminTeamService;
|
|
import com.yihu.wlyy.service.common.SMSService;
|
|
import com.yihu.wlyy.service.common.SMSService;
|
|
import com.yihu.wlyy.service.common.account.DoctorService;
|
|
import com.yihu.wlyy.service.common.account.DoctorService;
|
|
@ -41,6 +42,7 @@ import com.yihu.wlyy.util.DateUtil;
|
|
import com.yihu.wlyy.util.ElasticsearchUtil;
|
|
import com.yihu.wlyy.util.ElasticsearchUtil;
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
|
|
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
|
|
import com.yihu.wlyy.wechat.util.WeiXinOpenIdUtils;
|
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
@ -138,6 +140,8 @@ public class SignWebService extends BaseService {
|
|
* 厦门市
|
|
* 厦门市
|
|
*/
|
|
*/
|
|
public static String city = "350200";
|
|
public static String city = "350200";
|
|
|
|
@Autowired
|
|
|
|
private ServiceStatisticsService serviceStatisticsService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 根据医生代码及签约状态编码 获取该医生签约患者的信息列表
|
|
* 根据医生代码及签约状态编码 获取该医生签约患者的信息列表
|
|
@ -2160,21 +2164,37 @@ public class SignWebService extends BaseService {
|
|
" WHERE w.doctor in(" + doctorCodeSql + ") AND w.patient ='" + patient + "'" +
|
|
" WHERE w.doctor in(" + doctorCodeSql + ") AND w.patient ='" + patient + "'" +
|
|
" AND w.czrq <='" + DateUtil.getSignYear() + "-07-01' AND w.czrq >='" + (DateUtil.getSignYear() - 1) + "-07-01' ";
|
|
" AND w.czrq <='" + DateUtil.getSignYear() + "-07-01' AND w.czrq >='" + (DateUtil.getSignYear() - 1) + "-07-01' ";
|
|
//获取健康教育
|
|
//获取健康教育
|
|
String article_sql = "SELECT COUNT(1) AS articleCount FROM wlyy_health_edu_article_patient w,wlyy_health_edu_article w2 WHERE w.article = w2.code " +
|
|
|
|
"AND w.doctor IN(" + doctorCodeSql + ") AND w.patient ='" + patient + "' " +
|
|
|
|
"AND w.czrq <='" + DateUtil.getSignYear() + "-07-01' AND w.czrq >='" + (DateUtil.getSignYear() - 1) + "-07-01' ";
|
|
|
|
|
|
// String article_sql = "SELECT COUNT(1) AS articleCount FROM wlyy_health_edu_article_patient w,wlyy_health_edu_article w2 WHERE w.article = w2.code " +
|
|
|
|
// "AND w.doctor IN(" + doctorCodeSql + ") AND w.patient ='" + patient + "' " +
|
|
|
|
// "AND w.czrq <='" + DateUtil.getSignYear() + "-07-01' AND w.czrq >='" + (DateUtil.getSignYear() - 1) + "-07-01' ";
|
|
//获取健康指导
|
|
//获取健康指导
|
|
String guidance_sql = "SELECT COUNT(1) AS guidanceCount FROM wlyy_patient_health_guidance w " +
|
|
|
|
"WHERE w.doctor IN(" + doctorCodeSql + ") and w.patient ='" + patient + "' AND w.czrq <='" + DateUtil.getSignYear() + "-07-01' AND w.czrq >='" + (DateUtil.getSignYear() - 1) + "-07-01' ";
|
|
|
|
|
|
|
|
|
|
// String guidance_sql = "SELECT COUNT(1) AS guidanceCount FROM wlyy_patient_health_guidance w " +
|
|
|
|
// "WHERE w.doctor IN(" + doctorCodeSql + ") and w.patient ='" + patient + "' AND w.czrq <='" + DateUtil.getSignYear() + "-07-01' AND w.czrq >='" + (DateUtil.getSignYear() - 1) + "-07-01' ";
|
|
//咨询量
|
|
//咨询量
|
|
List<Map<String, Object>> consultResult = jdbcTemplate.queryForList(consult_sql);
|
|
List<Map<String, Object>> consultResult = jdbcTemplate.queryForList(consult_sql);
|
|
//待预约量
|
|
//待预约量
|
|
List<Map<String, Object>> reservationResult = jdbcTemplate.queryForList(reservation_sql);
|
|
List<Map<String, Object>> reservationResult = jdbcTemplate.queryForList(reservation_sql);
|
|
|
|
|
|
//健康教育量
|
|
//健康教育量
|
|
List<Map<String, Object>> articleResult = jdbcTemplate.queryForList(article_sql);
|
|
|
|
|
|
//List<Map<String, Object>> articleResult = jdbcTemplate.queryForList(article_sql);
|
|
|
|
Calendar today = Calendar.getInstance();
|
|
|
|
today.set(Calendar.DATE, 1);
|
|
|
|
JSONObject article = serviceStatisticsService.getArticleStatistics(patient,signFamily.getAdminTeamId(), DateUtil.dateToStrShort(signFamily.getBegin()), DateUtil.dateToStrShort(signFamily.getEnd()), DateUtil.dateToStrShort(today.getTime()));
|
|
|
|
List<Map<String, Object>> articleResult = new ArrayList<>();
|
|
|
|
Map<String,Object> ac = new HashedMap();
|
|
|
|
ac.put("articleCount",article.getInt("year"));
|
|
|
|
articleResult.add(ac);
|
|
|
|
|
|
//健康指导量
|
|
//健康指导量
|
|
List<Map<String, Object>> guidanceResult = jdbcTemplate.queryForList(guidance_sql);
|
|
|
|
|
|
//List<Map<String, Object>> guidanceResult = jdbcTemplate.queryForList(guidance_sql);
|
|
|
|
String monthBegin = DateUtil.dateToStrShort(today.getTime()) + " 00:00:00";
|
|
|
|
String yearBegin = DateUtil.dateToStrShort(signFamily.getBegin()) + " 00:00:00";
|
|
|
|
String yearEnd = DateUtil.dateToStrShort(signFamily.getEnd()) + " 23:59:59";
|
|
|
|
JSONObject guidance = serviceStatisticsService.getGuidanceStatistics(patient, signFamily.getAdminTeamId(), yearBegin, yearEnd, monthBegin);
|
|
|
|
List<Map<String, Object>> guidanceResult = new ArrayList<>();
|
|
|
|
Map<String,Object> gui = new HashedMap();
|
|
|
|
gui.put("guidanceCount",guidance.getInt("year"));
|
|
|
|
guidanceResult.add(gui);
|
|
|
|
|
|
Long consultTotal = 0L;
|
|
Long consultTotal = 0L;
|
|
if (consultResult != null && consultResult.size() > 0) {
|
|
if (consultResult != null && consultResult.size() > 0) {
|