Browse Source

Merge branch 'dev' of yeshijie/patient-co-management into dev

lyr 8 years ago
parent
commit
7e457731af

+ 23 - 31
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -276,7 +276,7 @@ public class MessageService extends BaseService {
     */
    public List<Map<String, Object>> getHealthIndexMessage(String doctor) throws Exception {
        List<Map<String, Object>> re = new ArrayList<>();
        String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.czrq,'%Y-%c-%d %H:%i:%s')) last_time,a.has_read from wlyy_Message a where a.receiver='" + doctor + "' and a.type='2' group by a.sender,a.tz_type,a.has_read order by last_time desc";
        String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.create_time,'%Y-%c-%d %H:%i:%s')) last_time from wlyy_Message a where a.receiver='" + doctor + "' and a.has_read='1' and a.type='2' group by a.sender,a.tz_type order by last_time desc";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        Map<String,Map<String, Object>> map = new HashMap<>();
@ -287,38 +287,23 @@ public class MessageService extends BaseService {
            Patient patient = patientDao.findByCode(patientCode);
            if (patient != null) {
                String type = String.valueOf(item.get("tz_type")); //1血糖,2血压,3体重,4腰
                String read = String.valueOf(item.get("has_read")); //0已读,1未读
                String patientType = patientCode + type;
                if(map.containsKey(patientType)){
                    obj = map.get(patientType);
                    if(obj.get("time").toString().compareTo(item.get("last_time").toString())<0){
                        obj.put("time", item.get("last_time"));
                    }
                }else{
                    obj = new HashMap<>();
                    obj.put("patient", patientCode);
                    obj.put("type", type);
                    obj.put("time", item.get("last_time"));
                    obj.put("name", patient.getName());
                    obj.put("sex", patient.getSex());
                    obj.put("birthday", DateUtil.dateToStrShort(patient.getBirthday()));
                    obj.put("photo", patient.getPhoto());
                }
                if("1".equals(read)){
                    obj.put("count1", item.get("count"));
                }else{
                    obj.put("count0", item.get("count"));
                obj.put("patient", patientCode);
                obj.put("type", type);
                obj.put("time", item.get("last_time"));
                obj.put("name", patient.getName());
                obj.put("sex", patient.getSex());
                obj.put("birthday", DateUtil.dateToStrShort(patient.getBirthday()));
                obj.put("sex", patient.getSex());
                obj.put("photo", patient.getPhoto());
                if ("1".equals(type)) {
                    obj.put("message", "有" + item.get("count") + "条血糖异常未读消息");
                } else if ("2".equals(type)) {
                    obj.put("message", "有" + item.get("count") + "条血压异常未读消息");
                } else {
                    obj.put("message", "暂无未读消息");
                }
                map.put(patientType,obj);
//                if ("1".equals(type)) {
//                    obj.put("message", "有" + item.get("count") + "条血糖异常未读消息");
//                } else if ("2".equals(type)) {
//                    obj.put("message", "有" + item.get("count") + "条血压异常未读消息");
//                } else {
//                    break;
//                }
//                re.add(obj);
                re.add(obj);
            } else {
                System.out.print("not exit patient!code:" + patientCode);
            }
@ -337,6 +322,13 @@ public class MessageService extends BaseService {
            obj.put("sex", item.get("sex"));
            obj.put("birthday", item.get("birthday"));
            obj.put("photo", item.get("photo"));
            if ("1".equals(type)) {
                obj.put("message", "有" + count1 + "条血糖异常未读消息");
            } else if ("2".equals(type)) {
                obj.put("message", "有" + item.get("count") + "条血压异常未读消息");
            } else {
                break;
            }
            if ("1".equals(type)) {
                obj.put("message", "有血糖异常未读消息"+count1+"条,已读消息"+count0+"条");
            } else if ("2".equals(type)) {

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/reservation/PatientReservationService.java

@ -120,8 +120,8 @@ public class PatientReservationService extends BaseService {
     * 居民取消预约
     */
    @Transactional
    public void patientCancelOrder(Long id,String patient) {
        PatientReservation obj = patientReservationDao.findOne(id);
    public void patientCancelOrder(String code,String patient) {
        PatientReservation obj = patientReservationDao.findByCode(code);
        if (obj.getStatus()!=0) {
            obj.setStatus(0);
            obj.setCanceler(patient);

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/booking/PatientBookingController.java

@ -42,10 +42,10 @@ public class PatientBookingController extends WeixinBaseController{
    @ResponseBody
    @ApiOperation("取消挂号单")
    public String CancelOrder(@ApiParam(name = "orderId", value = "订单id", defaultValue = "48")
                              @RequestParam(value = "orderId", required = true) Long orderId) {
                              @RequestParam(value = "orderId", required = true) String orderId) {
        try {
            //获取订单信息
            PatientReservation obj = patientReservationService.findById(orderId);
            PatientReservation obj = patientReservationService.findByCode(orderId);
            boolean re = false;
            if (obj != null) {
                String type = obj.getType();