Kaynağa Gözat

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

zd_123 7 yıl önce
ebeveyn
işleme
e1414b18ac

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/feedback/FeedbackService.java

@ -230,7 +230,7 @@ public class FeedbackService extends BaseService {
                    params.add(new BasicNameValuePair("remark", "感谢你的意见"));
                    SimpleDateFormat formatDate = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
                    String newDate = formatDate.format(new Date());
                    String keywords = patientName + "," + typeName + "," + result + "," + newDate;
                    String keywords = newDate + "," + result;
                    params.add(new BasicNameValuePair("keywords", keywords));
                    HttpClientUtil.post(url, params, "UTF-8");

+ 11 - 11
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/reservation/PatientReservationService.java

@ -111,18 +111,17 @@ public class PatientReservationService extends BaseService {
    }
    /**
     * 客服取消预约
     * 居民取消预约
     */
    @Transactional
    public void userCancelOrder(String code,String user) {
    public void patientCancelOrder(String code,String patient) {
        PatientReservation obj = patientReservationDao.findByCode(code);
        if (obj.getStatus()!=0) {
            obj.setStatus(0);
            User u =userDao.findByCode(user);
            obj.setCancelerName(u.getName());
            obj.setCancelerType(6);
            obj.setCanceler(patient);
            obj.setCancelerName(obj.getName());
            obj.setCancelerType(5);
            obj.setCancelerTime(DateUtil.dateToStrLong(new Date()));
            obj.setCanceler(user);
            patientReservationDao.save(obj);
        }
    }
@ -130,17 +129,18 @@ public class PatientReservationService extends BaseService {
    /**
     * 居民取消预约
     * 客服取消预约
     */
    @Transactional
    public void patientCancelOrder(String code,String patient) {
    public void userCancelOrder(String code,String user) {
        PatientReservation obj = patientReservationDao.findByCode(code);
        if (obj.getStatus()!=0) {
            obj.setStatus(0);
            obj.setCanceler(patient);
            obj.setCancelerName(obj.getName());
            obj.setCancelerType(5);
            User u =userDao.findByCode(user);
            obj.setCancelerName(u.getName());
            obj.setCancelerType(6);
            obj.setCancelerTime(DateUtil.dateToStrLong(new Date()));
            obj.setCanceler(user);
            patientReservationDao.save(obj);
        }
    }

+ 2 - 1
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -253,7 +253,8 @@ wlyyService:
image:
  imgUrlDomain: http://www.xmtyw.cn/
sign:
  check_upload: http://59.61.92.90:8072/wlyy_service
  check_upload: http://59.61.92.90:8087/wlyy_service
  #check_upload: http://59.61.92.90:8072/wlyy_service
server:
  server_url: http://www.xmtyw.cn/wlyy/
wechat:

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/PatientInfoService.java

@ -746,7 +746,7 @@ public class PatientInfoService extends BaseService {
        json.put("BLOOD",archive.getBlood());//血型【1.A型 2.3.O型4.AB型 5.不详】
        json.put("BLOOD_RH","1");//RH阴性【1.否 2.是 3.不详】
        json.put("MARRIAGE",archive.getMarry());//婚姻状况【10.未婚 20.已婚 30.丧偶 40.离婚 90.未说明的婚姻状况】
        json.put("INSUR_CARD_NO",p.getSsc());//医保卡号
        //补充参数

+ 84 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/PatientRemindService.java

@ -337,6 +337,70 @@ public class PatientRemindService extends BaseService {
        }
    }
//    /**
//     * 提醒所有患者关注微信
//     *
//     * @param doctor
//     */
//    public void remindPatientWechatFocusAll(String doctor) throws Exception {
//        try {
//            Calendar today = Calendar.getInstance();
//            today.set(Calendar.HOUR, 23);
//            today.set(Calendar.MINUTE, 59);
//            today.set(Calendar.SECOND, 59);
//            today.set(Calendar.MILLISECOND, 999);
//            int page = 0;
//            int start = 0;
//            boolean flag = true;
//            Doctor doc = doctorDao.findByCode(doctor);
//            if (doc == null) {
//                throw new Exception("doctor info can not find");
//            }
//            String sql = "select p.code,p.name,p.mobile" +
//                    "     from " +
//                    "        wlyy_sign_family f join wlyy_patient p on f.patient = p.code" +
//                    "     where " +
//                    "        (f.doctor = ? or f.doctor_health = ?) " +
//                    "        and f.status > 0 " +
//                    "        and f.expenses_status = '1' " +
//                    "        and LENGTH(trim(ifnull(p.openid,''))) < 1 limit ?,3000";
//            List<Map<String, Object>> patients = new ArrayList<>();
//            List<String> redisPatients = new ArrayList<>();
//            Set<String> exist = redisTemplate.opsForSet().members("wechat:focus:remind:set");
//            while (flag) {
//                List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, start});
//
//                if (result != null && result.size() > 0) {
//                    patients.addAll(result);
//                    for (Map<String, Object> map : result) {
//                        if (exist != null && exist.contains(map.get("code").toString())) {
//                            continue;
//                        }
//                        redisPatients.add(map.get("code").toString());
//                    }
//                    page = page + 1;
//                    start = page * 3000;
//                } else {
//                    flag = false;
//                }
//            }
//
//            if (patients.size() > 0) {
//                RemindFocusWechatTask task = new RemindFocusWechatTask(patients, doc,sMSService);
//                new Thread(task).start();
//                redisTemplate.opsForSet().add("wechat:focus:remind:set", redisPatients.toArray(new String[]{}));
//                redisTemplate.expire("wechat:focus:remind:set", today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(), TimeUnit.MILLISECONDS);
//            }
//
//            redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + doctor, "0");
//            redisTemplate.expire("wechat:focus:remind:doctor:" + doctor, 10, TimeUnit.MINUTES);
//        } catch (Exception e) {
//            redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + doctor, "0");
//            redisTemplate.expire("wechat:focus:remind:doctor:" + doctor, 10, TimeUnit.MINUTES);
//            e.printStackTrace();
//        }
//    }
    /**
     * 提醒所有患者关注微信
     *
@ -366,14 +430,14 @@ public class PatientRemindService extends BaseService {
                    "        and LENGTH(trim(ifnull(p.openid,''))) < 1 limit ?,3000";
            List<Map<String, Object>> patients = new ArrayList<>();
            List<String> redisPatients = new ArrayList<>();
            Set<String> exist = redisTemplate.opsForSet().members("wechat:focus:remind:set");
            Set<String> exist = redisTemplate.keys("wechat:focus:remind:flag:*");
            while (flag) {
                List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor, start});
                if (result != null && result.size() > 0) {
                    patients.addAll(result);
                    for (Map<String, Object> map : result) {
                        if (exist != null && exist.contains(map.get("code").toString())) {
                        if (exist != null && exist.size()>0&& isExist(map.get("code").toString(),exist)) {
                            continue;
                        }
                        redisPatients.add(map.get("code").toString());
@ -388,10 +452,11 @@ public class PatientRemindService extends BaseService {
            if (patients.size() > 0) {
                RemindFocusWechatTask task = new RemindFocusWechatTask(patients, doc,sMSService);
                new Thread(task).start();
                redisTemplate.opsForSet().add("wechat:focus:remind:set", redisPatients.toArray(new String[]{}));
                redisTemplate.expire("wechat:focus:remind:set", today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(), TimeUnit.MILLISECONDS);
                for(String pString:redisPatients){
                    redisTemplate.opsForValue().set("wechat:focus:remind:flag:"+pString, pString,2,TimeUnit.MINUTES);//向redis里存入数据和设置缓存时
                    //redisTemplate.opsForValue().set("wechat:focus:remind:flag:"+pString, pString,today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(),TimeUnit.MILLISECONDS);//向redis里存入数据和设置缓存时
                }
            }
            redisTemplate.opsForValue().set("wechat:focus:remind:doctor:" + doctor, "0");
            redisTemplate.expire("wechat:focus:remind:doctor:" + doctor, 10, TimeUnit.MINUTES);
        } catch (Exception e) {
@ -401,6 +466,15 @@ public class PatientRemindService extends BaseService {
        }
    }
    public boolean isExist(String code,Set<String> set){
        for(String c :set){
            if(c.contains(code)){
                return true;
            }
        }
        return false;
    }
    /**
     * 微信关注提醒
     *
@ -415,8 +489,11 @@ public class PatientRemindService extends BaseService {
        today.set(Calendar.SECOND, 59);
        today.set(Calendar.MILLISECOND, 59);
        JSONObject result = new JSONObject();
        redisTemplate.opsForSet().add("wechat:focus:remind:set", p.get("code").toString());
        redisTemplate.expireAt("wechat:focus:remind:set", today.getTime());
        redisTemplate.opsForValue().set("wechat:focus:remind:flag:"+ p.get("code").toString(),p.get("code").toString(),today.getTimeInMillis() - Calendar.getInstance().getTimeInMillis(),TimeUnit.MILLISECONDS);//向redis里存入数据和设置缓存时
//        redisTemplate.opsForSet().add("wechat:focus:remind:set", p.get("code").toString());
//        redisTemplate.expireAt("wechat:focus:remind:set", today.getTime());
        if (p.get("mobile") == null || StringUtils.isEmpty(p.get("mobile").toString())) {
            result.put("status", -1);

+ 27 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -405,10 +405,11 @@ public class SignWebService extends BaseService {
        List<String> result = jdbcTemplate.queryForList(sql, new Object[]{doctor, doctor}, String.class);
        if (result != null && result.size() > 0) {
            Set<String> set = redisTemplate.opsForSet().members("wechat:focus:remind:set");
            //Set<String> set = redisTemplate.opsForSet().members("wechat:focus:remind:set");
            Set<String> set = redisTemplate.keys("wechat:focus:remind:flag:*");
            if (set == null) {
                isAll = false;
            } else if (!set.containsAll(result)) {
            } else if (!isAllRemind(result,set)) {
                isAll = false;
            }
        } else {
@ -418,6 +419,30 @@ public class SignWebService extends BaseService {
        return isAll ? 1 : 0;
    }
    /**
     * 存在未提醒的返回false,全部提醒过返回true
     * @param result
     * @param set
     * @return
     */
    public boolean isAllRemind(List<String> result,Set<String> set){
        for(String code :result){
            //默认未提醒
            boolean flag = false;
            for(String c :set){
                if(c.contains(code)){
                    //提醒过标识
                   flag = true;
                }
            }
            if(!flag){
                //返回未提醒
                return false;
            }
        }
        return true;
    }
    /**
     * 查询家庭签约已缴费未关注人数
     *

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java

@ -293,7 +293,7 @@ public class DoctorSignController extends WeixinBaseController {
                    if (status == 3) {
                        boolean epTime = false;
                        try {
                            epTime = redisTemplate.opsForSet().isMember("wechat:focus:remind:set", temp.get("patient"));
                            epTime = redisTemplate.hasKey("wechat:focus:remind:flag:"+temp.get("patient"));
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/template/ThirdTemplateController.java

@ -29,6 +29,8 @@ public class ThirdTemplateController extends BaseController {
    private PushMsgTask pushMsgTask;
    @Value("${wechat.message.template_doctor_survey}")
    private String template_doctor_survey;
    @Value("${wechat.message.template_deal_with}")
    private String template_deal_with;
    /**
     * 发送模板消息
@ -101,7 +103,7 @@ public class ThirdTemplateController extends BaseController {
                templateId = template_doctor_survey;
                break;
            case "2":
                templateId = "";
                templateId = template_deal_with;
                break;
            default:
                templateId = template_doctor_survey;

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -66,6 +66,8 @@ wechat:
   template_doctor_service:  ezr5RlX0nvh7bGU9aVsGDMJbjKDp1uMKP-AGGYXwI5g
   #体检报告提醒
   template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
   #处理结果通知
   template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -66,6 +66,8 @@ wechat:
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
    #体检报告提醒
    template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
    #处理结果通知
    template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-local.yml

@ -66,6 +66,8 @@ wechat:
     template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
     #体检报告提醒
     template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
     #处理结果通知
     template_deal_with:  GyXCmXVYCD7PXi0IbHdPOD8apa-RQoSrSw-4-0pj9Go
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml

@ -66,6 +66,8 @@ wechat:
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
    #体检报告提醒
    template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
    #处理结果通知
    template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -65,6 +65,8 @@ wechat:
   template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
   #体检报告提醒
   template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
   #处理结果通知
   template_deal_with:  GyXCmXVYCD7PXi0IbHdPOD8apa-RQoSrSw-4-0pj9Go
yihu:

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -65,6 +65,8 @@ wechat:
   template_doctor_service:  i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
   #体检报告提醒
   template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
   #处理结果通知
   template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/