suqinyi 3 mēneši atpakaļ
vecāks
revīzija
da072e62c3

+ 6 - 2
business/base-service/src/main/java/com/yihu/jw/article/service/KnowledgeArticleDictService.java

@ -704,8 +704,12 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
     */
    public HashMap<String, Object> findSendPatientList(String doctorCode, String patientCode, String sendType, int page, int pageSize) {
        String sql = " SELECT DISTINCT \n" +
                " b.doctor 'sendDoctorCode',b.doctor_name 'sendDoctorName',a.* \n" +
                " FROM wlyy_knowledge_article_dict a INNER JOIN base_patient_business b ON a.id=b.relation_code\n" +
                " b.doctor 'sendDoctorCode',b.doctor_name 'sendDoctorName'," +
                " c.fabulous 'userFabulous',\tc.is_read 'userIsRead',\tc.is_share 'userShare',\tc.collection 'userCollection'," +
                " a.* \n" +
                " FROM wlyy_knowledge_article_dict a " +
                " INNER JOIN base_patient_business b ON a.id=b.relation_code" +
                " LEFT JOIN  wlyy_knowledge_article_user c ON a.id=c.relation_code \n" +
                " WHERE 1=1 AND b.relation_type='" + sendType + "' ";
        if (StringUtils.isNotBlank(doctorCode)) {
            sql += " and  b.doctor='" + doctorCode + "' ";

+ 5 - 5
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/article/KnowledgeArticleDictDO.java

@ -44,13 +44,13 @@ public class KnowledgeArticleDictDO extends UuidIdentityEntity {
	private Integer status;// 0未审核 1已审核 2已退回
	private String cancelReason;//退回理由
	private Integer used;//常用数
	private Integer readCount;//已读数
	private Integer collection;//收藏数量
	private Integer fabulous;//点赞数量
	private Integer readCount=0;//已读数
	private Integer collection=0;//收藏数量
	private Integer fabulous=0;//点赞数量
	private Integer comment;//评论数量
	private Integer comment=0;//评论数量
	@Column(name = "is_share")
	private Integer share;//分享 数量
	private Integer share=0;//分享 数量
	private String intro;//简介
	private String homePage;//是否主业展示 1是 其他否

+ 7 - 11
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/article/ArticleEndpoint.java

@ -356,17 +356,13 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findArticleByCategoryAndName)
    @ApiOperation(value = "查询文章")
    public MixEnvelop findArticleByCategoryAndName(@ApiParam(name = "categoryFirst", value = "一级分类code")
                                                   @RequestParam(value = "categoryFirst", required = false) String categoryFirst,
                                                   @ApiParam(name = "categorySecond", value = "二级分类code")
                                                   @RequestParam(value = "categorySecond", required = false) String categorySecond,
                                                   @ApiParam(name = "keyWords", value = "关键词")
                                                   @RequestParam(value = "keyWords", required = false) String keyWords,
                                                   @ApiParam(name = "page", value = "当前页")
                                                   @RequestParam(value = "page", required = false) Integer page,
                                                   @ApiParam(name = "pageSize", value = "分页大小)")
                                                   @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception {
    public MixEnvelop findArticleByCategoryAndName(
            @ApiParam(name = "categoryFirst", value = "一级分类code") @RequestParam(value = "categoryFirst", required = false) String categoryFirst,
            @ApiParam(name = "categorySecond", value = "二级分类code") @RequestParam(value = "categorySecond", required = false) String categorySecond,
            @ApiParam(name = "keyWords", value = "关键词") @RequestParam(value = "keyWords", required = false) String keyWords,
            @ApiParam(name = "page", value = "当前页") @RequestParam(value = "page", required = false) Integer page,
            @ApiParam(name = "pageSize", value = "分页大小)") @RequestParam(value = "pageSize", required = false) Integer pageSize
    ) throws Exception {
        MixEnvelop mixEnvelop = knowledgeArticleDictService.findArticleByCategoryAndName(categoryFirst, categorySecond, keyWords, page, pageSize);
        return mixEnvelop;
    }

+ 4 - 6
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleDictEndpoint.java

@ -317,12 +317,10 @@ public class ArticleDictEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.findPatientFavorite)
    @ApiOperation(value = "查询收藏文章")
    public Envelop findPatientFavorite(@ApiParam(name = "patient", value = "病人id")
                                       @RequestParam(value = "patient", required = false) String patient,
                                       @ApiParam(name = "page", value = "当前页")
                                       @RequestParam(value = "page", required = false) Integer page,
                                       @ApiParam(name = "pageSize", value = "分页大小)")
                                       @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception {
    public Envelop findPatientFavorite(
            @ApiParam(name = "patient", value = "病人id") @RequestParam(value = "patient", required = false) String patient,
            @ApiParam(name = "page", value = "当前页") @RequestParam(value = "page", required = false) Integer page,
            @ApiParam(name = "pageSize", value = "分页大小)") @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception {
        try {
            return success(knowledgeArticleDictService.findPatientFavorite2(patient, page, pageSize));

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

@ -403,7 +403,7 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
            for (BasePatientBusinessDO patientBusinessDO : list) {
                Integer type = patientBusinessDO.getRelationType();
                if (type == 1) {
                if (type != 2) {
                    KnowledgeArticleDO knowledgeArticleDO = knowledgeArticleService.selectById(patientBusinessDO.getRelationCode());
                    if (knowledgeArticleDO != null) {
                        List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());

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

@ -440,12 +440,15 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
        if (StringUtils.isNotEmpty(patient)) {
            sql += " and t.user_code = '" + patient + "'";
        }
        if (StringUtils.isNotBlank(relationType)){
            sql+=" and t.relation_type = '" + relationType + "'";
        }
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, page, pageSize);
        if (list != null && list.size() > 0) {
            for (Map<String, Object> map : list) {
                String relationCode = map.get("relationCode").toString();
                String type = map.get("relationType").toString();
                if ("1".equalsIgnoreCase(type)) {
                if (!"2".equalsIgnoreCase(type)) {
                    KnowledgeArticleDO knowledgeArticleDO = this.selectById(relationCode);
                    if (knowledgeArticleDO != null) {
                        List<BaseDoctorHospitalDO> doctorHospitalDOS = doctorHospitalDao.findByDoctorCode(knowledgeArticleDO.getCreateUser());

+ 1 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/common/service/LabelService.java

@ -330,7 +330,7 @@ public class LabelService {
            sql += " AND b.`name` LIKE '%" + name + "%'\n";
        }
        sql += "GROUP BY a.label_code";
        sql += "GROUP BY a.label_code ";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }