Jelajahi Sumber

Merge branch 'dev' of huangzhanpeng/wlyy_management into dev

lyr 8 tahun lalu
induk
melakukan
dc75317a94

+ 7 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/health/repository/DevicePatientHealthIndexDao.java

@ -70,4 +70,11 @@ public interface DevicePatientHealthIndexDao
	@Query(value = "select a.* from device.wlyy_patient_health_index a where a.user=?1 and a.type=?2 order by a.record_date desc limit 0,1",nativeQuery = true)
	@Query(value = "select a.* from device.wlyy_patient_health_index a where a.user=?1 and a.type=?2 order by a.record_date desc limit 0,1",nativeQuery = true)
	DevicePatientHealthIndex findLastData(String patient, Integer type);
	DevicePatientHealthIndex findLastData(String patient, Integer type);
	/**
	 * 上次血糖值
     */
	@Query(value = "select a.value1 from device.wlyy_patient_health_index a where a.type=1 and a.user = ?1 and a.id<?2 and a.value2 = ?3 order by a.record_date desc limit 0,1",nativeQuery = true)
	String getPreValue(String user,Long id,String value2);
}
}

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

@ -40,7 +40,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query(" from Message a where a.read = 1 and over ='1' and a.sender = ?1 and a.receiver=?2 and a.signStatus='1'")
    @Query(" from Message a where a.read = 1 and over ='1' and a.sender = ?1 and a.receiver=?2 and a.signStatus='1'")
    Message findByPatient(String patient,String doctor);
    Message findByPatient(String patient,String doctor);
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.sender=?2 and a.tzType=?3")
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.sender=?2 and a.tzType=?3 order by a.czrq desc")
    List<Message> getHealthIndexMessageByPatient(String doctor,String patient,String type,Pageable pageRequest);
    List<Message> getHealthIndexMessageByPatient(String doctor,String patient,String type,Pageable pageRequest);
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2) 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) order by a.czrq desc")

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

@ -6,6 +6,9 @@ import javax.transaction.Transactional;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.health.entity.DevicePatientHealthIndex;
import com.yihu.wlyy.health.repository.DevicePatientHealthIndexDao;
import com.yihu.wlyy.repository.deviece.DeviceDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.DateUtil;
@ -51,6 +54,9 @@ public class MessageService extends BaseService {
    private JdbcTemplate jdbcTemplate;
    private JdbcTemplate jdbcTemplate;
    @Autowired
    @Autowired
    private PatientDao patientDao;
    private PatientDao patientDao;
    @Autowired
    private DevicePatientHealthIndexDao devicePatientHealthIndexDao;
    /**
    /**
     * IM消息数量
     * IM消息数量
@ -273,7 +279,7 @@ public class MessageService extends BaseService {
     */
     */
    public List<Map<String, Object>> getHealthIndexMessage(String doctor) throws Exception {
    public List<Map<String, Object>> getHealthIndexMessage(String doctor) throws Exception {
        List<Map<String, Object>> re = new ArrayList<>();
        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 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";
        String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.czrq,'%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);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        for (Map<String, Object> item : list) {
        for (Map<String, Object> item : list) {
@ -329,7 +335,16 @@ public class MessageService extends BaseService {
                map.put("read", String.valueOf(item.getRead()));
                map.put("read", String.valueOf(item.getRead()));
                map.put("sex", String.valueOf(item.getSex()));
                map.put("sex", String.valueOf(item.getSex()));
                map.put("value1", String.valueOf(item.getValue1()));
                map.put("value1", String.valueOf(item.getValue1()));
                map.put("value2", String.valueOf(item.getValue2()));
                String value2 = String.valueOf(item.getValue2().intValue());
                map.put("value2",value2);
                //获取上次血糖值
                if("1".equals(type))
                {
                    String preValue = devicePatientHealthIndexDao.getPreValue(item.getSender(),Long.valueOf(item.getTzCode()),value2);
                    map.put("preValue",preValue);
                }
                map.put("czrq", DateUtil.dateToStrLong(item.getCzrq()));
                map.put("czrq", DateUtil.dateToStrLong(item.getCzrq()));
                re.add(map);
                re.add(map);

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/GuahaoXMService.java

@ -1045,7 +1045,7 @@ public class GuahaoXMService implements IGuahaoService {
            String startTime = map.get("startTime");
            String startTime = map.get("startTime");
            String endTime = map.get("endTime");
            String endTime = map.get("endTime");
            String response = jwSmjkService.webRegisterByFamily(cardNo, patientName, clinicCard, sectionType, startTime, hospitalId, hosDeptId, hosDeptName, doctorId, doctorName);
            String response = jwSmjkService.webRegisterByFamily(cardNo, patientName, clinicCard, sectionType, startTime, hospitalId, hosDeptId, hosDeptName, doctorId, doctorName,patientPhone);
            re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, dname, dcode);
            re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, dname, dcode);
        } else {
        } else {

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwSmjkService.java

@ -333,7 +333,7 @@ public class JwSmjkService {
    /**
    /**
     * (内网)预约挂号接口
     * (内网)预约挂号接口
     */
     */
    public String webRegisterByFamily(String idcard,String patientName,String ssid,String sectionType,String startTime,String orgCode,String deptCode,String deptName,String doctorCode,String doctorName)  throws Exception
    public String webRegisterByFamily(String idcard,String patientName,String ssid,String sectionType,String startTime,String orgCode,String deptCode,String deptName,String doctorCode,String doctorName,String patientPhone)  throws Exception
    {
    {
        String re = "";
        String re = "";
        String url = jwUrl + "/third/smjk/WebRegisterByFamily";
        String url = jwUrl + "/third/smjk/WebRegisterByFamily";
@ -349,6 +349,7 @@ public class JwSmjkService {
        params.add(new BasicNameValuePair("deptName", deptName));
        params.add(new BasicNameValuePair("deptName", deptName));
        params.add(new BasicNameValuePair("doctorCode", doctorCode));
        params.add(new BasicNameValuePair("doctorCode", doctorCode));
        params.add(new BasicNameValuePair("doctorName", doctorName));
        params.add(new BasicNameValuePair("doctorName", doctorName));
        params.add(new BasicNameValuePair("patientPhone", patientPhone));
        String response = HttpClientUtil.post(url, params, "UTF-8");
        String response = HttpClientUtil.post(url, params, "UTF-8");

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/BookingController.java

@ -390,7 +390,7 @@ public class BookingController extends WeixinBaseController {
                                      @ApiParam(name = "dname", value = "代预约医生名称", defaultValue = "组2全科医生")
                                      @ApiParam(name = "dname", value = "代预约医生名称", defaultValue = "组2全科医生")
                                      @RequestParam(value = "dname", required = true) String dname) {
                                      @RequestParam(value = "dname", required = true) String dname) {
        try {
        try {
            String orderCode = "aca163be-cd9f-4614-b01f-944c4bcf5c30";//guahaoXM.CreateOrderByDoctor(hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, arrangeDate, patient, patientName, cardNo, clinicCard, patientPhone, dname, dcode);
            String orderCode = guahaoXM.CreateOrderByDoctor(hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, arrangeDate, patient, patientName, cardNo, clinicCard, patientPhone, dname, dcode);
            //获取预约信息查询是否挂号成功
            //获取预约信息查询是否挂号成功
            PatientReservation obj = patientReservationService.findByCode(orderCode);
            PatientReservation obj = patientReservationService.findByCode(orderCode);
            if (obj != null) {
            if (obj != null) {
@ -419,7 +419,7 @@ public class BookingController extends WeixinBaseController {
                        json.put("doctorName", obj.getDeptName());
                        json.put("doctorName", obj.getDeptName());
                        json.put("deptName", obj.getDeptName());
                        json.put("deptName", obj.getDeptName());
                        json.put("remark", patientName + ",您好!\n" + msg);
                        json.put("remark", patientName + ",您好!\n" + msg);
                        //PushMsgTask.getInstance().putWxMsg(getAccessToken(), 6, p.getOpenid(), patientName, json);
                        PushMsgTask.getInstance().putWxMsg(getAccessToken(), 6, p.getOpenid(), patientName, json);
                    }
                    }
                    else{
                    else{
                        des +=" 微信提醒失败,患者无绑定微信!";
                        des +=" 微信提醒失败,患者无绑定微信!";

+ 1 - 1
patient-co-wlyy/src/main/resources/system.properties

@ -50,7 +50,7 @@ chat_server=http://weixin.xmtyw.cn/res/chat/
sign_check_upload=http://172.19.103.87:8011/wlyy_service
sign_check_upload=http://172.19.103.87:8011/wlyy_service
# IM配置
# IM配置
im_list_get=http://192.168.131.109:3008/
im_list_get=http://172.19.103.29:3000/
im_group_server=http://172.19.103.29:3000/api/v1/chats/gm
im_group_server=http://172.19.103.29:3000/api/v1/chats/gm
msg_push_server=http://172.19.103.29:3000/api/v1/chats/sm
msg_push_server=http://172.19.103.29:3000/api/v1/chats/sm