2 Commits 4091301024 ... fef4c10152

Author SHA1 Message Date
  suqinyi fef4c10152 Merge remote-tracking branch 'origin/2.0' into 2.0 3 months ago
  suqinyi 2a91948a8c 代码修改 3 months ago

+ 4 - 4
business/base-service/src/main/java/com/yihu/jw/article/service/BaseMenuManageService.java

@ -1293,19 +1293,19 @@ public class BaseMenuManageService {
        return browseDOS.size();
    }
    public  List<KnowledgeArticleDictDO> findDoctorCollectionArticle(String doctor, Integer page, Integer size) {
    public  List<KnowledgeArticleDictDO> findDoctorCollectionArticle(String doctor, String relationType,Integer page, Integer size) {
        String sql="SELECT\n" +
                "	b.* \n" +
                "FROM\n" +
                "	base_knowledge_article_doctor a\n" +
                "	INNER  JOIN base_knowledge_dict b ON a.relation_code=b.id\n" +
                "	INNER  JOIN wlyy_knowledge_article_dict b ON a.relation_code=b.id\n" +
                "	WHERE 1=1 \n" +
                "	AND a.relation_type='2' \n" +
                "	AND a.relation_type='"+relationType+"' \n" +
                "	AND a.`user`='"+doctor+"'\n" ;
        String limit = " limit "+(page-1)+","+size;
        sql+=limit;
        System.out.println("sql==>"+sql);
        List<KnowledgeArticleDictDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(KnowledgeArticleDictDO.class));
        return list;
    }
}

+ 1 - 13
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleEndpoint.java

@ -316,6 +316,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "page", value = "页码") @RequestParam(value = "page", required = false) int page,
            @ApiParam(name = "pageSize", value = "数量") @RequestParam(value = "pageSize", required = false) int pageSize
    ) {
        System.out.println("doctorCode=>"+doctorCode+"  patientCode=>"+patientCode);
        HashMap<String, Object> result = knowledgeArticleService.findSendPatientList(doctorCode,patientCode, sendType, page, pageSize);
        ObjEnvelop objEnvelop = new ObjEnvelop();
        objEnvelop.setObj(result);
@ -347,19 +348,6 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
    /**
     * 医生把文章推送给居民
     * [
     *   {"user": "用户code"},
     *   {"userName": "用户名称"},
     *   {"relationCode": "文章code或者问卷code"},
     *   {"relationType": "1、文章 2、问卷  3、指导  4、im咨询"},
     *   {"relationName": "文章名称"},
     *   {"fabulous": "1已赞0未赞"},
     *   {"isRead": "1已读0未读"},
     *   {"share": "1已分享0未分享"},
     *   {"collection": "是否收藏1是0否"},
     *   {"used": "1常用0不常用"},
     *   {"del": "是否删除,1正常,0删除"}
     * ]
     */
    @PostMapping(value = "/sendArticleToUser")
    @ApiOperation(value = "发送文章/问卷")

+ 3 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/BaseMenuManageEndpoint.java

@ -241,13 +241,14 @@ public class BaseMenuManageEndpoint extends EnvelopRestEndpoint {
     */
    @GetMapping(value = "findDoctorCollectionArticle")
    @ApiOperation(value = "查询医生收藏的文章")
    public Envelop selectArticleDoctorById(
    public Envelop findDoctorCollectionArticle(
            @ApiParam(name = "doctor", value = "用户id") @RequestParam(value = "doctor", required = false) String doctor,
            @ApiParam(name = "relationType", value = "类型") @RequestParam(value = "relationType", required = false) String relationType,
            @ApiParam(name = "page", value = "当前页") @RequestParam(value = "page", required = false) Integer page,
            @ApiParam(name = "size", value = "分页大小)") @RequestParam(value = "size", required = false) Integer size
    ) throws Exception {
        try {
            return success(menuService.findDoctorCollectionArticle(doctor, page, size));
            return success(menuService.findDoctorCollectionArticle(doctor,relationType, page, size));
        } catch (Exception e) {
            return failedException(e);
        }

+ 10 - 5
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

@ -5,6 +5,7 @@ import com.yihu.jw.article.dao.KnowledgeArticleDao;
import com.yihu.jw.article.dao.KnowledgeArticleDeptDao;
import com.yihu.jw.article.dao.KnowledgeArticleDictDao;
import com.yihu.jw.article.dao.KnowledgeArticleUserDao;
import com.yihu.jw.constants.ServiceApi;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
@ -34,6 +35,8 @@ import org.springframework.stereotype.Service;
import java.util.*;
import static com.yihu.jw.constants.ServiceApi.AppPushMessage.list;
/**
 * 健康文章业务层代码
 *
@ -483,16 +486,18 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
        if (StringUtils.isNotBlank(doctorCode)) {
            sql += " and  b.doctor='" + doctorCode + "' ";
        }
        if (StringUtils.isNotBlank(doctorCode)) {
        if (StringUtils.isNotBlank(patientCode)) {
            sql += " and  b.patient='" + patientCode + "' ";
        }
        String countSql = " slect count(1) from (" + sql + ") qqq";
        sql += " order by create_time desc " + " LIMIT " + (page - 1) * pageSize + "," + pageSize + "";
        List<BasePatientBusinessDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BasePatientBusinessDO.class));
        String countSql = " select count(1) from (" + sql + ") qqq";
        sql += " order by a.create_time desc " + " LIMIT " + (page - 1) * pageSize + "," + pageSize + "";
        System.out.println("sql-->"+sql);
        System.out.println("countSql-->"+countSql);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        Integer count = jdbcTemplate.queryForObject(countSql, Integer.class);
        HashMap<String, Object> resultMap = new HashMap<>();
        resultMap.put("data", list);
        resultMap.put("data", ServiceApi.AppPushMessage.list);
        resultMap.put("count", count);
        return resultMap;
    }