Browse Source

代码修改

suqinyi 8 months ago
parent
commit
424ee5f156

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

@ -10,6 +10,7 @@ import com.yihu.jw.entity.base.menu.BaseLinkDictDO;
import com.yihu.jw.entity.base.menu.BaseMenuDictDO;
import com.yihu.jw.entity.base.menu.BaseMenuDictUserDO;
import com.yihu.jw.entity.base.menu.BaseMenuShowDO;
import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleBrowseDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDictDO;
@ -1291,4 +1292,20 @@ public class BaseMenuManageService {
        List<KnowledgeArticleBrowseDO> browseDOS = knowledgeArticleBrowseDao.findByRelationCodeAndType(relationCode,type);
        return browseDOS.size();
    }
    public  List<KnowledgeArticleDictDO> findDoctorCollectionArticle(String doctor, 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" +
                "	WHERE 1=1 \n" +
                "	AND a.relation_type='2' \n" +
                "	AND a.`user`='"+doctor+"'\n" ;
        String limit = " limit "+(page-1)+","+size;
        sql+=limit;
        List<KnowledgeArticleDictDO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(KnowledgeArticleDictDO.class));
        return list;
    }
}

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

@ -520,6 +520,21 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
    }
    @GetMapping(value = "/getArticleGroupByName")
    @ApiOperation(value = "查询分类-二级分类")
    public MixEnvelop getArticleGroupByName(
            @ApiParam(name = "name", value = "name") @RequestParam(value = "name", required = false) String name
    ) {
        try {
            MixEnvelop envelop = knowledgeCategoryService.getArticleGroupByName(name);
            return envelop;
        } catch (Exception e) {
            return failedMixEnvelopException(e);
        }
    }
    /**
     * 查询指定分类的信息
     */

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

@ -219,6 +219,7 @@ public class BaseMenuManageEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.selectArticleDoctorById)
    @ApiOperation(value = "查询医生关联文章回复数据")
    public Envelop selectArticleDoctorById(
@ -234,6 +235,25 @@ public class BaseMenuManageEndpoint extends EnvelopRestEndpoint {
        }
    }
    /**
     * 查询医生收藏的文章
     */
    @GetMapping(value = "findDoctorCollectionArticle")
    @ApiOperation(value = "查询医生收藏的文章")
    public Envelop selectArticleDoctorById(
            @ApiParam(name = "doctor", value = "用户id") @RequestParam(value = "doctor", required = false) String doctor,
            @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));
        } catch (Exception e) {
            return failedException(e);
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.selectArticleDoctorByArticleIdAndUser)
    @ApiOperation(value = "判断该文章当前医生是否点赞或者收藏")
    public Envelop selectArticleDoctorByArticleIdAndUser(

+ 18 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeCategoryService.java

@ -105,4 +105,22 @@ public class KnowledgeCategoryService extends BaseJpaService<KnowledgeCategoryDO
        }
        return envelop;
    }
    public MixEnvelop getArticleGroupByName(String name) {
        String sqlPid = "select id as \"id\",name as \"name\",pid as \"pid\" from wlyy_knowledge_category  where pid = '0' and del = 1 and name='"+name+"'";
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sqlPid);
        String child = "select id as \"id\",name as \"name\",pid as \"pid\" from wlyy_knowledge_category  where del = 1";
        if (list.size() > 0) {
            for (Map<String, Object> map : list) {
                String pid = map.get("id").toString();
                child += " and pid = '" + pid + "'";
                List<Map<String, Object>> childList = hibenateUtils.createSQLQuery(child);
                map.put("childList", childList);
            }
        }
        MixEnvelop envelop = new MixEnvelop();
        envelop.setDetailModelList(list);
        return envelop;
    }
}

+ 4 - 3
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/template/controller/DoctorGuidanceTempController.java

@ -117,9 +117,10 @@ public class DoctorGuidanceTempController extends BaseController {
                return error(-1, "内容不能为空");
            }
            if (StringUtils.isEmpty(content) || content.length() > 5) {
                return error(-1, "内容5个汉字之内且不能为空");
            }
//            if (StringUtils.isEmpty(content) || content.length() > 5) {
//                return error(-1, "内容5个汉字之内且不能为空");
//            }
//            验证模板名称唯一性 还要去除掉其本身  (判断查出来的和要修改的同名)
            if (StringUtils.isBlank(doctorCode)){
                doctorCode=getUID();

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

@ -192,7 +192,7 @@ public class DoctorGuidanceTempService {
     * @param doctor 医生
     */
    public Map<String, Object> list(String doctor, String templeteName, int pageSize, int pageNo) throws Exception {
        String detailSql = "SELECT 	a.send_times ,b.* ";
        String detailSql = "SELECT 	a.send_times ,a.code 'guidanceCode',b.* ";
        String countSql = "SELECT 	count(1) ";
        String sql = "FROM\n" +
                "	wlyy_doctor_guidance_temp a\n" +