LAPTOP-KB9HII50\70708 hai 1 ano
pai
achega
3aea2ceee1

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

@ -19,9 +19,11 @@ import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.utils.DmDBUtl;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -60,7 +62,8 @@ public class BaseMenuManageService {
    private KnowledgeArticleDoctorDao knowledgeArticleDoctorDao;
    @Autowired
    private KnowledgeArticleBrowseDao knowledgeArticleBrowseDao;
    @Value("${wechat.id}")
    private String wxId;
    /**
     *
@ -743,7 +746,7 @@ public class BaseMenuManageService {
        return list;
    }
    public MixEnvelop findArticleByMenuId(String menuId,String title,Integer page,Integer pageSize,String isContent){
    public MixEnvelop findArticleByMenuId(String menuId,String title,Integer page,Integer pageSize,String isContent,String articleType){
        List<String> menuIds = new ArrayList<>();
        if (StringUtils.isNoneBlank(menuId)){
            String str[]= menuId.split(",");
@ -751,6 +754,20 @@ public class BaseMenuManageService {
                menuIds.add(str[i]);
            }
        }
        if(StringUtils.isNotBlank(articleType)){
            if(StringUtils.isBlank(menuId)){
                menuId = "";
            }
            String sqlType = "select * from base_menu_dict where article_type='"+articleType+"' and is_del='1' and status=1";
            List<BaseMenuDictDO> menuDictDOS = jdbcTemplate.query(sqlType,new BeanPropertyRowMapper<>(BaseMenuDictDO.class));
            if(menuDictDOS.size()>0){
                for (BaseMenuDictDO menuDictDO:menuDictDOS){
                    menuIds.add(menuDictDO.getId());
                    menuId +=",";
                }
                menuId = menuId.substring(0,menuId.length()-1);
            }
        }
        System.out.print("menuId"+menuId);
        Integer count;
@ -789,7 +806,7 @@ public class BaseMenuManageService {
                "  read_count,\n" +
                "  collection,\n" +
                "  fabulous,\n" +
                "  comment,\n" +
                DmDBUtl.changeField("comment",wxId)+"  ," +
                "  is_share,\n" +
                "  create_user_name   ,\n" +
                "  create_user_dept   ,\n" +
@ -1013,7 +1030,7 @@ public class BaseMenuManageService {
        if (flag==5){
            condition+=" and kau.is_read = "+status;
        }
        condition += "  GROUP BY kad.category_first ";
        condition += "  GROUP BY kad.category_first,kad.category_first_name,kad.category_second,kad.category_second_name ";
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql+condition);
        return mapList;
    }

+ 10 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -7036,6 +7036,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if(StringUtils.isNoneBlank(patientid)){
            sql+=" , follow.id AS \"followid\" " ;
        }
        sql += ",evaluate.score,a.total";
        sql+=" FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
@ -7179,7 +7180,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            params.put("consultStatus", consultStatus);
        }
        String groupBy = " group by d.id ";//同一个医生在不同科室的时候只展示一个
        String groupBy = " group by d.id,d.photo , d.name, d.expertise ,d.introduce ," +
                "d.job_title_code ,  d.job_title_name , d.charge_type ," +
                "h.dept_name , dw.workTotal , d.consult_status ," +
                "d.outpatient_type , a.total , h.org_name ," +
                "h.org_code ";//同一个医生在不同科室的时候只展示一个
        if(StringUtils.isNoneBlank(patientid)){
            groupBy+=" , follow.id" ;
        }
        groupBy += ", evaluate.score,a.total";
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("isSort").orElse(null);//isSort:1按照后台顺序,0按照系统排序
        if (hospitalSysDictDO!=null&&hospitalSysDictDO.getDictValue().equalsIgnoreCase("1")){
            sql +=" and d.del='1' "+groupBy+" order by d.sort asc  ";

+ 26 - 0
business/base-service/src/main/java/com/yihu/jw/utils/DmDBUtl.java

@ -0,0 +1,26 @@
package com.yihu.jw.utils;
import org.apache.commons.lang3.StringUtils;
/**
 * 达梦数据据看
 * Created by yeshijie on 2024/1/8.
 */
public class DmDBUtl {
    /**
     * 达梦数据库的关键字是双引号(""),而mysql的关键字是反引号(``),所以一些sql的字段加了关键字的,只能做下替换。
     * @param field
     * @param wxId
     * @return
     */
    public static String changeField(String field,String wxId){
        if(StringUtils.isBlank(field)){
            return "";
        }
        if("xm_qsyy_wx".equals(wxId)){
            field = "\""+field.toUpperCase()+"\"";
        }
        return field;
    }
}

+ 8 - 0
common/common-entity/src/db/2024.sql

@ -8,4 +8,11 @@ ALTER table wlyy_outpatient add COLUMN `plan_doctor` varchar(50) DEFAULT NULL CO
-- ALTER table base_suggestion add COLUMN `vitist_time` varchar(50) DEFAULT NULL COMMENT '就诊时间';
-- ALTER table base_suggestion add COLUMN `vitist_dept_code` varchar(50) DEFAULT NULL COMMENT '就诊科室编码';
-- ALTER table base_suggestion add COLUMN `vitist_detp_name` varchar(50) DEFAULT NULL COMMENT '就诊科室名称';
-- ALTER table base_suggestion add COLUMN `admission_no` varchar(50) DEFAULT NULL COMMENT '住院号';
ALTER table base_menu_dict add COLUMN `article_type` varchar(2) DEFAULT NULL COMMENT '文章类型 公告、广告、文章、帮助中心 article_menu_type';
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('article_menu_type1', NULL, 'article_menu_type', '1', '公告', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '文章类型 公告、广告、文章、帮助中心');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('article_menu_type2', NULL, 'article_menu_type', '2', '广告', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '文章类型 公告、广告、文章、帮助中心');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('article_menu_type3', NULL, 'article_menu_type', '3', '文章', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '文章类型 公告、广告、文章、帮助中心');
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('article_menu_type4', NULL, 'article_menu_type', '4', '帮助中心', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '文章类型 公告、广告、文章、帮助中心');

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/menu/BaseMenuDictDO.java

@ -34,6 +34,7 @@ public class BaseMenuDictDO extends UuidIdentityEntityWithOperator {
    private String menuTitle;//标题
    private String describtion;//描述
    private Integer type;//类型 1 官网菜单 2app文章菜单
    private String articleType;//文章类型 1公告、2广告、3文章、4帮助中心 article_menu_type
    private List<BaseDoctorDO> doctorList;//推荐医生
    private Integer collection;//收藏数量
@ -271,4 +272,13 @@ public class BaseMenuDictDO extends UuidIdentityEntityWithOperator {
    public void setIsFabulous(String isFabulous) {
        this.isFabulous = isFabulous;
    }
    @Column(name = "article_type")
    public String getArticleType() {
        return articleType;
    }
    public void setArticleType(String articleType) {
        this.articleType = articleType;
    }
}

+ 3 - 1
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/BasicZuulFilter.java

@ -429,7 +429,9 @@ public class BasicZuulFilter extends ZuulFilter {
                    "declare|sitename|net user|xp_cmdshell|or|create|" +
                    "table|from|grant|use|group_concat|column_name|" +
                    "information_schema.columns|table_schema|union|where|order|by|like|" ;//过滤掉的sql关键字,可以手动添加
            return str.matches(badStr);
            boolean flag = str.matches(badStr);
            logger.info("sqlValidate===:"+flag);
            return flag;
        }else {
            return true;
        }

+ 4 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/menu/BaseMenuNoLoginEndpoint.java

@ -3,7 +3,6 @@ package com.yihu.jw.base.endpoint.menu;
import com.yihu.jw.article.dao.KnowledgeArticleDictDao;
import com.yihu.jw.article.service.BaseMenuManageService;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDictDO;
import com.yihu.jw.healthCare.utils.StringUtils;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
@ -63,17 +62,19 @@ public class BaseMenuNoLoginEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "查询文章")
    public Envelop findArticleByMenuid(
            @ApiParam(name = "menuId", value = "menuId", required = false)
            @RequestParam(value = "menuId",required = true) String menuId,
            @RequestParam(value = "menuId",required = false) String menuId,
            @ApiParam(name = "title", value = "menuId", required = false)
            @RequestParam(value = "title",required = false) String title,
            @ApiParam(name = "isContent", value = "是否返回内容 1是0否", required = false)
            @RequestParam(value = "isContent",required = false) String isContent,
            @ApiParam(name = "articleType", value = "文章类型", required = false)
            @RequestParam(value = "articleType",required = false) String articleType,
            @ApiParam(name = "page", value = "page", required = false)
            @RequestParam(value = "page",required = true) Integer page,
            @ApiParam(name = "pageSize", value = "pageSize", required = false)
            @RequestParam(value = "pageSize",required = true) Integer pageSize) {
        try {
            return success(menuService.findArticleByMenuId(menuId,title,page,pageSize,isContent));
            return success(menuService.findArticleByMenuId(menuId,title,page,pageSize,isContent,articleType));
        }catch (Exception e){
            return failedException(e);
        }

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

@ -64,7 +64,9 @@ public class BaseMenuNoLoginEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "查询文章")
    public Envelop findArticleByMenuid(
            @ApiParam(name = "menuId", value = "menuId", required = false)
            @RequestParam(value = "menuId",required = true) String menuId,
            @RequestParam(value = "menuId",required = false) String menuId,
            @ApiParam(name = "articleType", value = "文章类型", required = false)
            @RequestParam(value = "articleType",required = false) String articleType,
            @ApiParam(name = "title", value = "menuId", required = false)
            @RequestParam(value = "title",required = false) String title,
            @ApiParam(name = "page", value = "page", required = false)
@ -72,7 +74,7 @@ public class BaseMenuNoLoginEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "pageSize", value = "pageSize", required = false)
            @RequestParam(value = "pageSize",required = true) Integer pageSize) {
        try {
            return success(menuService.findArticleByMenuId(menuId,title,page,pageSize,"0"));
            return success(menuService.findArticleByMenuId(menuId,title,page,pageSize,"0",articleType));
        }catch (Exception e){
            return failedException(e);
        }