ソースを参照

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

huangwenjie 7 年 前
コミット
b6c5177416

+ 2 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/specialist/HopsitalServiceItemController.java

@ -26,7 +26,7 @@ public class HopsitalServiceItemController extends BaseController {
    @RequestMapping(value = "initial")
    public String listInit() {
        return "desizenMan/service_project_management";
        return "desizenMan/new-institutional-projects";
    }
@ -56,7 +56,7 @@ public class HopsitalServiceItemController extends BaseController {
     * 获取机构
     * @return
     */
    @RequestMapping(value = "selectByHospitals", method = RequestMethod.POST)
    @RequestMapping(value = "selectByHospital", method = RequestMethod.POST)
    @ResponseBody
    public String selectHospitals(){
        try {

+ 22 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/specialist/ServiceItemController.java

@ -105,4 +105,26 @@ public class ServiceItemController  extends BaseController {
        }
    }
    /**
     * 查询历史记录
     *
     * @param serviceItem
     * @param page
     * @param size
     * @return
     */
    @RequestMapping(value = "selectOperate", method = RequestMethod.POST)
    @ResponseBody
    public String selectOperate(@RequestParam(name = "serviceItem") String serviceItem,
                                    @RequestParam(name = "page",defaultValue = "1")Integer page,
                                    @RequestParam(name = "size",defaultValue = "10")Integer size){
        try {
            return write(200, "操作成功", "data",serviceItemService.selectOperate(serviceItem,page,size));
        } catch (Exception ex) {
            error(ex);
            return error(-1, "操作失败");
        }
    }
}

+ 25 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/ServiceItemService.java

@ -141,6 +141,31 @@ public class ServiceItemService extends BaseService {
        return JSONObject.parseObject(response);
    }
    /**
     * 查询历史记录
     *
     * @param operateLog
     * @param page
     * @param size
     * @return
     * @throws Exception
     */
    public JSONObject selectOperate(String operateLog,Integer page,Integer size) throws Exception {
        String response = null;
        String url =getBaseUrl() + "selectByOperate";
        Map<String,String> params = new HashMap<>();
        params.put("operateLog",operateLog);
        params.put("page",page.toString());
        params.put("size",size.toString());
        try {
            response = httpClientUtil.httpPost(url,params);
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return JSONObject.parseObject(response);
    }
    /*public JSONObject importData(HttpServletRequest request) throws Exception {
        String response = null;

+ 4 - 27
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/specialist/SpecialistHospitalItemService.java

@ -5,13 +5,11 @@ package com.yihu.wlyy.service.manager.specialist;/**
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.Hospital;
import com.yihu.wlyy.repository.HospitalDao;
import com.yihu.wlyy.repository.SystemDictDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.HttpClientUtil;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
@ -29,33 +27,12 @@ import java.util.Map;
public class SpecialistHospitalItemService extends BaseService {
    private static org.slf4j.Logger logger = LoggerFactory.getLogger(SpecialistHospitalItemService.class);
    private static String URL = "specialist:url";
    @Autowired
    private HospitalDao hospitalDao;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private RedisTemplate redisTemplate;
    @Autowired
    private SystemDictDao systemDictDao;
    /**
     * 获取url
     *
     * @return
     */
    public  String getBaseUrl(){
        String url = (String) redisTemplate.opsForValue().get(URL);
        String url1 = systemDictDao.findByDictNameAndCode3("SPECIALIST_URL","SPECIALIST_URL");
        if (url != null && url1.equalsIgnoreCase(url)){
            return url;
        }else {
            redisTemplate.opsForValue().set(URL,url1);
            return url1;
        }
    }
    @Value("${specialist.url}")
    private String specialistUrl;
    /**
     *
@ -68,7 +45,7 @@ public class SpecialistHospitalItemService extends BaseService {
    public JSONObject insert(String hospitalServiceItem){
        String response = null;
        String url =getBaseUrl() + "createHospitalServiceItem";
        String url =specialistUrl + "svr-specialist/createHospitalServiceItem";
        Map<String,String> params = new HashMap<>();
        params.put("hospitalServiceItem",hospitalServiceItem);
        try {
@ -89,7 +66,7 @@ public class SpecialistHospitalItemService extends BaseService {
     */
    public JSONObject selectItemByHospital(String hospital){
        String response = null;
        String url =getBaseUrl() + "selectItemByHospital";
        String url =specialistUrl + "svr-specialist/selectItemByHospital";
        Map<String,String> params = new HashMap<>();
        params.put("hospital",hospital);
        try {

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -60,7 +60,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("update Message a set a.read = 0 where a.receiver = ?1 and a.sender=?2 and a.tzType=?3")
    int updateHealthIndexMessageByPatient(String doctor, String patient, String type);
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,16,17,18) order by a.czrq desc")
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,16,17,18,19,20,21,22) order by a.czrq desc")
    List<Message> getSystemMessageUnread(String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type in (6,7) order by a.createTime desc")
@ -147,4 +147,6 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.code = ?1")
    Message findByCode(String code);
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.type in (19,20,21,22) order by a.czrq desc")
    List<Message> getSpecialistUnRead(String receiver);
}

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

@ -243,6 +243,24 @@ public class MessageService extends BaseService {
            familyMesJson.put("amount", 0);
        }
        //专科消息
        List<Message> specialistList = messageDao.getSpecialistUnRead(doctor);
        JSONObject specialistMesJson = new JSONObject();
        JSONArray jsonArray = new JSONArray();
        if (specialistList != null && specialistList.size() > 0) {
            specialistMesJson.put("amount", specialistList.size());
            JSONObject  specialistJson = new JSONObject();
            specialistJson.put("title", specialistList.get(0).getTitle());
            specialistJson.put("type", specialistList.get(0).getType());
            specialistJson.put("msg", "您有"+specialistList.size()+"个专科服务消息,请查看!");
            specialistJson.put("msgTime", DateUtil.dateToStrLong(specialistList.get(0).getCreateTime()));
            specialistJson.put("relationCode",specialistList.get(0).getRelationCode());
            specialistJson.put("reason",specialistList.get(0).getReason());
            specialistMesJson.put("lastMessage", specialistJson);
        }else{
            specialistMesJson.put("amount", 0);
        }
        JSONObject json = new JSONObject();
        json.put("imMsgCount", getImMsgAmount(doctor));//IM消息数量
@ -254,6 +272,7 @@ public class MessageService extends BaseService {
        json.put("articleCheck", articleMesJson);//健康文章审核消息
        json.put("deviceUnbind",deviceMesJson);//设备解绑消息
        json.put("familyList",familyMesJson);//居民签约申请
        json.put("specialistList",specialistMesJson);//专科服务消息
        return json;
    }
@ -596,7 +615,7 @@ public class MessageService extends BaseService {
        }
        buffer.deleteCharAt(buffer.length()-1);
        buffer.append(")");
        String sql = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = ?1 and "+buffer;
        String sql = " update wlyy_message a set a.has_read = 0,a.over = '0' where a.receiver = '"+doctor+"' and "+buffer;
        int i = jdbcTemplate.update(sql);
        return Integer.toString(i);
@ -922,4 +941,5 @@ public class MessageService extends BaseService {
}

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -615,6 +615,7 @@ public class DoctorMessageController extends BaseController {
            message1.setSender(object.getString("sender"));
            message1.setType(object.getInteger("type"));
            message1.setReceiver(object.getString("receiver"));
            message1.setRelationCode(object.getString("relationCode"));
            return write(200, "获取消息成功!","data",specialistEvaluateSevice.sendMessage(message1,hospital,patient,time));
        } catch (Exception e) {
            error(e);
@ -629,9 +630,9 @@ public class DoctorMessageController extends BaseController {
     * @param types
     * @return
     */
    @RequestMapping(value = "setMessageReads",method = RequestMethod.GET)
    @RequestMapping(value = "setMessageReads",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("专科医生待处理消息")
    @ApiOperation("一键已读" )
    public String setMessageRead(@ApiParam(name = "types",value = "消息集合")
                                     @RequestParam(value = "types")String types) {
        try {