Kaynağa Gözat

Merge branch '2.0' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into 2.0

LAPTOP-KB9HII50\70708 8 ay önce
ebeveyn
işleme
4091301024

+ 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;
    }
}

+ 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', c.is_read 'userIsRead',c.is_share 'userShare',c.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 - 29
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/article/ArticleEndpoint.java

@ -301,24 +301,6 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
    }
    /**
     * 查询文章发送记录
     * BasePatientBusinessDO
     */
    @PostMapping(value = "/findSendPatientList")
    @ApiOperation(value = "查询文章发送记录-发送文章/问卷")
    public ObjEnvelop findSendPatientList(
            @ApiParam(name = "doctorCode", value = "医生") @RequestParam(value = "doctorCode", required = false) String doctorCode,
            @ApiParam(name = "patientCode", value = "居民code") @RequestParam(value = "patientCode", required = false) String patientCode,
            @ApiParam(name = "sendType", value = "发送类型") @RequestParam(value = "sendType", required = false) String sendType,
            @ApiParam(name = "page", value = "页码") @RequestParam(value = "page", required = false) int page,
            @ApiParam(name = "pageSize", value = "数量") @RequestParam(value = "pageSize", required = false) int pageSize
    ) {
        HashMap<String, Object> result = knowledgeArticleDictService.findSendPatientList(doctorCode,patientCode, sendType, page, pageSize);
        ObjEnvelop objEnvelop = new ObjEnvelop();
        objEnvelop.setObj(result);
        return objEnvelop;
    }
    @PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.sendPatientBusiness)
@ -356,17 +338,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));

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

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.article.dao.KnowledgeArticleDao;
import com.yihu.jw.article.dao.KnowledgeArticleDictDao;
import com.yihu.jw.article.dao.KnowledgeArticleUserDao;
import com.yihu.jw.article.service.KnowledgeArticleDictService;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
@ -302,6 +303,26 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
        }
    }
    /**
     * 查询文章发送记录
     * BasePatientBusinessDO
     */
    @PostMapping(value = "/findSendPatientList")
    @ApiOperation(value = "查询文章发送记录-发送文章/问卷")
    public ObjEnvelop findSendPatientList(
            @ApiParam(name = "doctorCode", value = "医生") @RequestParam(value = "doctorCode", required = false) String doctorCode,
            @ApiParam(name = "patientCode", value = "居民code") @RequestParam(value = "patientCode", required = false) String patientCode,
            @ApiParam(name = "sendType", value = "发送类型") @RequestParam(value = "sendType", required = false) String sendType,
            @ApiParam(name = "page", value = "页码") @RequestParam(value = "page", required = false) int page,
            @ApiParam(name = "pageSize", value = "数量") @RequestParam(value = "pageSize", required = false) int pageSize
    ) {
        HashMap<String, Object> result = knowledgeArticleService.findSendPatientList(doctorCode,patientCode, sendType, page, pageSize);
        ObjEnvelop objEnvelop = new ObjEnvelop();
        objEnvelop.setObj(result);
        return objEnvelop;
    }
    @PostMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.sendPatientBusiness)
    @ApiOperation(value = "发送文章/问卷")
@ -403,7 +424,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());
@ -520,6 +541,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(

+ 32 - 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());
@ -465,4 +468,32 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
        return result;
    }
    /**
     * 业务类型1、文章2、问卷   relationType
     */
    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'," +
                " c.fabulous 'userFabulous', c.is_read 'userIsRead',c.is_share 'userShare',c.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 + "' ";
        }
        if (StringUtils.isNotBlank(doctorCode)) {
            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));
        Integer count = jdbcTemplate.queryForObject(countSql, Integer.class);
        HashMap<String, Object> resultMap = new HashMap<>();
        resultMap.put("data", list);
        resultMap.put("count", count);
        return resultMap;
    }
}

+ 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;
    }
}

+ 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;
    }

+ 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" +