Browse Source

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

linzhuo 8 years ago
parent
commit
0049e8e3ee

+ 1 - 1
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/dao/MessageDao.java

@ -17,7 +17,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select count(a) from Message a where a.type =1 and a.read= 1 and a.receiver=?1 ")
    int amountUnreadByReceiver(String doctor);
    @Query("select count(a) from Message a where a.read = 0 and over ='0'  and a.receiver=?1 and a.type=3 ")
    @Query("select count(a) from Message a where a.read = 1  and a.receiver=?1 and a.type=3 ")
    int amountUnreadSystemByReceiver(String doctor);

+ 5 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticlePatientService.java

@ -153,7 +153,7 @@ public class HealthEduArticlePatientService extends BaseService {
            page = 1 ;
        }
        int start = (page-1) * pagesize;
        String sql ="select a.article,b.summary,a.attached_content, a.czrq,count(a.patient) as amount,GROUP_CONCAT(p.name) as  patients,a.batch_no from "+
        String sql ="select a.article,b.title,b.summary,a.attached_content, a.czrq,count(a.patient) as amount,GROUP_CONCAT(p.name) as  patients,a.batch_no from "+
        " wlyy_health_edu_article_patient a, "+
        " wlyy_health_edu_article b,"+
        " wlyy_patient p"+
@ -175,7 +175,7 @@ public class HealthEduArticlePatientService extends BaseService {
     * @return
     */
    public List<Map<String,Object>> findByBatchNo(String doctor,String article, String  batchNo) {
        String sql ="select a.article,b.content,a.attached_content, a.czrq,a.batch_no,sum(a.is_read) as no_read from "+
        String sql ="select a.article,b.title,b.content,a.attached_content,b.url, a.czrq as send_time,b.czrq,a.batch_no,sum(a.is_read) as no_read from "+
                " wlyy_health_edu_article_patient a, "+
                " wlyy_health_edu_article b,"+
                " wlyy_patient p"+
@ -185,18 +185,18 @@ public class HealthEduArticlePatientService extends BaseService {
                " and a.doctor =? "+
                " and a.article =? "+
                (StringUtils.isNotBlank(batchNo)?" and a.batch_no =? ":"and a.batch_no is null ")+
                " group BY a.batch_no,a.article,b.content,b.summary,a.doctor";
                " group BY a.batch_no,a.article,b.content,b.summary,a.doctor,b.title";
        Object params[] =  (StringUtils.isNotBlank(batchNo)?new Object[]{doctor,article,batchNo}:new Object[]{doctor,article,});
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql,params);
        for(Map<String,Object> dataMap :list){
            String patientListSql ="select a.patient,p.name,a.is_read,sum(a.is_read) as amount"+
            String patientListSql ="select a.patient,p.name,a.is_read "+
            " from wlyy_health_edu_article_patient a,wlyy_health_edu_article b,wlyy_patient p"+
            " where "+
            " a.article = b.code " +
            " and a.doctor=? and  a.article =?"+
            (StringUtils.isNotBlank(batchNo)?" and a.batch_no =? ":" and a.batch_no is null ")+
            " and a.patient = p.code " +
            " group BY a.batch_no,a.article,b.content,a.attached_content,a.patient";
            " group BY a.batch_no,a.article,b.content,a.attached_content,a.patient,b.title";
            List<Map<String,Object>> patientList = jdbcTemplate.queryForList(patientListSql,params);
            dataMap.put("patients",patientList);
            dataMap.put("read_amount",patientList.size()-Integer.parseInt(dataMap.get("no_read").toString()));

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -456,7 +456,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                        JSONObject data = (JSONObject) map.get("json");
                        String first = (String)data.get("first");
                        data.remove("first");
                        data.put("first",weiXinOpenIdUtils.getTitleMes(p,j.getInt("relation"),member.getName()));
                        data.put("first",weiXinOpenIdUtils.getTitleMes(p,j.isNull("relation")?1:j.getInt("relation"),member.getName()));
                        if(StringUtils.isNotBlank(member.getOpenid())){
                            PushMsgTask.getInstance().putWxMsg(getAccessToken(), 9, member.getOpenid(), member.getName(), data);
                        }