Przeglądaj źródła

满意度评价

trick9191 8 lat temu
rodzic
commit
caf041f988

+ 14 - 13
patient-co-wlyy/src/main/java/com/yihu/wlyy/job/consult/EvaluateScoreJob.java

@ -58,19 +58,20 @@ public class EvaluateScoreJob implements Job {
                    BigDecimal amount = new BigDecimal(evaluateList.get(0).get("score").toString());
                    BigDecimal amount = new BigDecimal(evaluateList.get(0).get("score").toString());
                    BigDecimal count = new BigDecimal(evaluateTimes.get(0).get("count").toString());
                    BigDecimal count = new BigDecimal(evaluateTimes.get(0).get("count").toString());
                    BigDecimal avg = amount.divide(count, 1, BigDecimal.ROUND_HALF_UP);
                    BigDecimal avg = amount.divide(count, 1, BigDecimal.ROUND_HALF_UP);
                    BigDecimal coefficient ;
                    if(count.compareTo(new BigDecimal(100))==-1&&count.compareTo(new BigDecimal(100))==0){
                        //如果数目小于等于100,系数为3
                        coefficient = new BigDecimal(3);
                    }else if(count.compareTo(new BigDecimal(1000))==1){
                        //如果数量大于1000,系数为1
                        coefficient = new BigDecimal(1);
                    }else{
                        //系数为2
                        coefficient = new BigDecimal(2);
                    }
                    //评分=80+(平均分-80)/系数
                    BigDecimal score = new BigDecimal(80).add((avg.subtract(new BigDecimal(80)).divide(coefficient,1,BigDecimal.ROUND_HALF_UP)));
//                    BigDecimal coefficient ;
//                    if(count.compareTo(new BigDecimal(100))==-1&&count.compareTo(new BigDecimal(100))==0){
//                        //如果数目小于等于100,系数为3
//                        coefficient = new BigDecimal(3);
//                    }else if(count.compareTo(new BigDecimal(1000))==1){
//                        //如果数量大于1000,系数为1
//                        coefficient = new BigDecimal(1);
//                    }else{
//                        //系数为2
//                        coefficient = new BigDecimal(2);
//                    }
//                    //评分=80+(平均分-80)/系数
//                    BigDecimal score = new BigDecimal(80).add((avg.subtract(new BigDecimal(80)).divide(coefficient,1,BigDecimal.ROUND_HALF_UP)));
                    BigDecimal score = avg;
                    Doctor d = doctorDao.findByCode(doctor);
                    Doctor d = doctorDao.findByCode(doctor);
                    if (d != null) {
                    if (d != null) {
                        d.setEvaluateScore(score.doubleValue());
                        d.setEvaluateScore(score.doubleValue());

+ 4 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -1803,13 +1803,13 @@ public class ConsultTeamService extends ConsultService {
                String openId = p.getOpenid();
                String openId = p.getOpenid();
                JSONObject json = new JSONObject();
                JSONObject json = new JSONObject();
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                json.put("keyword1", "满意度评价");
                json.put("keyword1", "医生评价");
                json.put("keyword2", sdf.format(new Date()));
                json.put("keyword2", sdf.format(new Date()));
                json.put("toUser", p.getCode());
                json.put("toUser", p.getCode());
                json.put("represented",p.getCode());//被代理人
                json.put("represented",p.getCode());//被代理人
                json.put("remark", "");
                json.put("remark", "");
                json.put("consult", consult);
                json.put("consult", consult);
                String first = endName + ",您好!您有1条咨询已结束,请及时对咨询医生进行满意度评价。";
                String first = endName + ",您好!您有1条咨询已结束,请及时对咨询医生进行评价。";
                json.put("first", first);
                json.put("first", first);
                if(StringUtils.isNotBlank(p.getOpenid())){
                if(StringUtils.isNotBlank(p.getOpenid())){
                    PushMsgTask.getInstance().putWxMsg(accessTokenUtils.getAccessToken(), 17, openId, p.getName(), json);
                    PushMsgTask.getInstance().putWxMsg(accessTokenUtils.getAccessToken(), 17, openId, p.getName(), json);
@ -1845,13 +1845,13 @@ public class ConsultTeamService extends ConsultService {
                String openId = p.getOpenid();
                String openId = p.getOpenid();
                JSONObject json = new JSONObject();
                JSONObject json = new JSONObject();
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                json.put("keyword1", "满意度评价");
                json.put("keyword1", "医生评价");
                json.put("keyword2", sdf.format(new Date()));
                json.put("keyword2", sdf.format(new Date()));
                json.put("toUser", p.getCode());
                json.put("toUser", p.getCode());
                json.put("represented",p.getCode());//被代理人
                json.put("represented",p.getCode());//被代理人
                json.put("remark", "");
                json.put("remark", "");
                json.put("consult", consult);
                json.put("consult", consult);
                String first = name + ",您好!您有1条咨询已结束,请及时对咨询医生进行满意度评价。";
                String first = name + ",您好!您有1条咨询已结束,请及时对咨询医生进行评价。";
                json.put("first", first);
                json.put("first", first);
                if(StringUtils.isNotBlank(p.getOpenid())){
                if(StringUtils.isNotBlank(p.getOpenid())){
                    PushMsgTask.getInstance().putWxMsg(accessTokenUtils.getAccessToken(), 17, openId, p.getName(), json);
                    PushMsgTask.getInstance().putWxMsg(accessTokenUtils.getAccessToken(), 17, openId, p.getName(), json);

+ 4 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/EvaluateService.java

@ -195,7 +195,10 @@ public class EvaluateService extends BaseService {
                evaluateScore.setScore(score.doubleValue());
                evaluateScore.setScore(score.doubleValue());
                //获取医生评价信息
                //获取医生评价信息
                JSONObject doctorInfo = doctorMap.get(doctor);
                JSONObject doctorInfo = doctorMap.get(doctor);
                String remark = (String)doctorInfo.get("remark");
                String remark = "";
                if(doctorInfo!=null){
                    remark = (String)doctorInfo.get("remark");
                }
                if(StringUtils.isNotBlank(remark)){
                if(StringUtils.isNotBlank(remark)){
                    evaluateScore.setRemark(remark);
                    evaluateScore.setRemark(remark);
                }else{
                }else{