|
@ -44,7 +44,7 @@ public class UserMsgContentService extends BaseJpaService<BaseUserMsgContentDO,
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
//好评率计算
|
|
|
//好评率计算 修改成好评率 = 好评数量 / (总评价数量 - 未评价数量)
|
|
|
public List<Map<String, Object>> countPoint(String doctor){
|
|
|
Map<String,Object> params = new HashedMap();
|
|
|
/*sqlForExpert.append("select * from wlyy_consult a left join wlyy_consult_team b" +
|
|
@ -58,13 +58,15 @@ public class UserMsgContentService extends BaseJpaService<BaseUserMsgContentDO,
|
|
|
String countsqlForExpert = "SELECT COUNT(1) AS \"total\" FROM ("+sqlForExpert+") t";
|
|
|
//专家咨询业务数总量
|
|
|
Long count = 1L;
|
|
|
long countTmp = 0L;
|
|
|
//专家咨询业务数满意数量
|
|
|
Long expertFix = 0L;
|
|
|
System.out.println(countsqlForExpert);
|
|
|
List<Map<String,Object>> total = hibenateUtils.createSQLQuery(countsqlForExpert,params);
|
|
|
if(total!=null){
|
|
|
if (!"0".equals(total.get(0).get("total").toString())) {
|
|
|
count = hibenateUtils.objTransformLong(total.get(0).get("total"));
|
|
|
countTmp = Long.parseLong(total.get(0).get("total").toString());
|
|
|
if (countTmp!=0) {
|
|
|
count = countTmp;
|
|
|
}
|
|
|
//mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
|
|
|
|
|
@ -79,12 +81,14 @@ public class UserMsgContentService extends BaseJpaService<BaseUserMsgContentDO,
|
|
|
String countsqlForOnline= "SELECT COUNT(1) AS \"total\" FROM ("+sql+") t";
|
|
|
//在线复诊业务数总量
|
|
|
Long countOnlineTotal = 1L;
|
|
|
Long countOnlineTotalTmp = 1L;
|
|
|
//在线复诊业务数满意数量
|
|
|
Long onlineFix = 0L;
|
|
|
List<Map<String,Object>> totalOnline = hibenateUtils.createSQLQuery(countsqlForOnline,params);
|
|
|
if(totalOnline!=null){
|
|
|
if (!"0".equals(totalOnline.get(0).get("total").toString())){
|
|
|
countOnlineTotal = hibenateUtils.objTransformLong(totalOnline.get(0).get("total"));
|
|
|
countOnlineTotalTmp = Long.parseLong(totalOnline.get(0).get("total").toString());
|
|
|
if (countOnlineTotalTmp!=0){
|
|
|
countOnlineTotal = countOnlineTotalTmp;
|
|
|
|
|
|
}
|
|
|
//mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
|
|
@ -103,9 +107,22 @@ public class UserMsgContentService extends BaseJpaService<BaseUserMsgContentDO,
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
List<Map<String,Object>> resultList= new ArrayList<>();
|
|
|
Map<String,Object> resultMap = new HashMap<>();
|
|
|
resultMap.put("zjzx",df.format(expertMY * 100)+"%");
|
|
|
resultMap.put("zxfz",df.format(inlineMY * 100)+"%");
|
|
|
resultMap.put("totalCount",df.format(totalConunt * 100)+"%");
|
|
|
if(countTmp==0){
|
|
|
resultMap.put("zjzx","100%");
|
|
|
}else {
|
|
|
resultMap.put("zjzx",df.format(expertMY * 100)+"%");
|
|
|
}
|
|
|
if(countOnlineTotalTmp==0){
|
|
|
resultMap.put("zxfz","100%");
|
|
|
}else {
|
|
|
resultMap.put("zxfz",df.format(inlineMY * 100)+"%");
|
|
|
}
|
|
|
if((countOnlineTotalTmp+countTmp)==0){
|
|
|
resultMap.put("totalCount","100%");
|
|
|
}else {
|
|
|
resultMap.put("totalCount",df.format(totalConunt * 100)+"%");
|
|
|
}
|
|
|
|
|
|
resultMap.put("doctor",doctor);
|
|
|
resultList.add(resultMap);
|
|
|
return resultList;
|
|
@ -114,7 +131,7 @@ public class UserMsgContentService extends BaseJpaService<BaseUserMsgContentDO,
|
|
|
private String dealSql(String doctor,Boolean countExpert){
|
|
|
StringBuffer sqlForExpert = new StringBuffer();
|
|
|
sqlForExpert.append("select b.consult AS \"consult\" ,c.id AS \"id\" from wlyy_consult_team b \n" +
|
|
|
"left join base_evaluate_score c on b.consult = c.relation_code \n" +
|
|
|
"inner join base_evaluate_score c on b.consult = c.relation_code \n" +
|
|
|
"where 1=1");
|
|
|
if(StringUtils.isNotEmpty(doctor)){
|
|
|
sqlForExpert.append(" and b.doctor = '"+doctor+"'");
|