Browse Source

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

wangzhinan 1 year ago
parent
commit
53a9ec3d9d
19 changed files with 144 additions and 635 deletions
  1. 3 10
      business/base-service/src/main/java/com/yihu/jw/article/dao/KnowledgeArticleDictDao.java
  2. 18 11
      business/base-service/src/main/java/com/yihu/jw/article/service/BaseMenuManageService.java
  3. 15 13
      business/base-service/src/main/java/com/yihu/jw/article/service/KnowledgeArticleDictService.java
  4. 0 8
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java
  5. 1 1
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorRoleService.java
  6. 0 399
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java
  7. 0 15
      business/base-service/src/main/java/com/yihu/jw/doctor/service/DoctorSpecialDiseaseService.java
  8. 6 6
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  9. 15 0
      business/base-service/src/main/java/com/yihu/jw/utils/DmDBUtl.java
  10. 16 33
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  11. 8 8
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java
  12. 2 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/article/KnowledgeArticleDictDO.java
  13. 4 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/article/ArticleEndpoint.java
  14. 4 115
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  15. 11 5
      svr/svr-base/src/main/java/com/yihu/jw/base/service/role/WlyyUserRoleService.java
  16. 5 6
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/article/ArticleDictEndpoint.java
  17. 1 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/complaint/BaseComplaintEndPoint.java
  18. 35 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  19. 0 1
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/KnowledgeArticleService.java

+ 3 - 10
business/base-service/src/main/java/com/yihu/jw/article/dao/KnowledgeArticleDictDao.java

@ -14,16 +14,15 @@ import java.util.List;
 * @date 2019/9/10 14:07
 */
public interface KnowledgeArticleDictDao extends JpaRepository<KnowledgeArticleDictDO, String>, JpaSpecificationExecutor<KnowledgeArticleDictDO> {
	@Query("select a from KnowledgeArticleDictDO a where a.del=1 and (categoryFirst = ?1 or categorySecond=?1)")
	@Query("select a from KnowledgeArticleDictDO a where a.del=1 and (a.categoryFirst = ?1 or a.categorySecond=?1)")
	List<KnowledgeArticleDictDO> findByCategory(String category);
	@Query("select a from KnowledgeArticleDictDO a where a.del=1 and categoryFirst = ?1 ")
	@Query("select a from KnowledgeArticleDictDO a where a.del=1 and a.categoryFirst = ?1 ")
	List<KnowledgeArticleDictDO> findByCategoryFirst(String category);
	@Query("select a from KnowledgeArticleDictDO a where a.del=1 and  categorySecond=?1")
	@Query("select a from KnowledgeArticleDictDO a where a.del=1 and  a.categorySecond=?1")
	List<KnowledgeArticleDictDO> findByCategorySecond(String category);
	@Query("select a from KnowledgeArticleDictDO a where a.del=1 and a.id=?1")
	KnowledgeArticleDictDO findByIdAndDel(String id);
@ -36,11 +35,5 @@ public interface KnowledgeArticleDictDao extends JpaRepository<KnowledgeArticleD
	@Query(" select count(*) from KnowledgeArticleDictDO a where a.del=1 and  a.categorySecond IN (?1) and a.releaseStatus=1 and a.title like %?2%")
	Integer getCountByCategorySecond(List<String> category,String title);
	@Query("select a from KnowledgeArticleDictDO a where a.del=1 and  a.categorySecond IN ( ?1 ) and a.releaseStatus=1 order by  a.releaseTime desc,a.createTime desc ")
	List<KnowledgeArticleDictDO> findByCategorySecondAndPage(List<String> category,Pageable pageRequest);
	@Query("select a from KnowledgeArticleDictDO a where a.del=1 and  a.categorySecond IN ( ?1 ) and a.releaseStatus=1 and a.title like %?2% order by  a.releaseTime desc,a.createTime desc ")
	List<KnowledgeArticleDictDO> findByCategorySecondAndPage(List<String> category,String title,Pageable pageRequest);
}

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

@ -19,7 +19,6 @@ 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;
@ -47,6 +46,8 @@ public class BaseMenuManageService {
    @Autowired
    private KnowledgeArticleDictDao knowledgeArticleDictDao;
    @Autowired
    private KnowledgeArticleDictService knowledgeArticleDictService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
@ -358,6 +359,7 @@ public class BaseMenuManageService {
                menuOld.setType(type);
                //menuOld.setIsShow(menuDO.getIsShow());
                menuOld.setMenuImg(menuDO.getMenuImg());
                menuOld.setArticleType(menuDO.getArticleType());
                menuOld.setDescribtion(menuDO.getDescribtion());
                menuOld.setMenuTitle(menuDO.getMenuTitle());
                menuOld.setBgImg(menuDO.getBgImg());
@ -806,7 +808,7 @@ public class BaseMenuManageService {
                "  read_count,\n" +
                "  collection,\n" +
                "  fabulous,\n" +
                DmDBUtl.changeField("comment",wxId)+"  ," +
                "  comment_num as \"comment\",\n" +
                "  is_share,\n" +
                "  create_user_name   ,\n" +
                "  create_user_dept   ,\n" +
@ -898,7 +900,7 @@ public class BaseMenuManageService {
    public KnowledgeArticleUserDO updateArticleUser(Integer flag, String articleId, String userCode, Integer status){
        KnowledgeArticleUserDO knowledgeArticleUserDO = knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(articleId,userCode);
        BasePatientDO patientDO = patientDao.findByIdAndDel(userCode,"1");
        KnowledgeArticleDictDO knowledgeArticleDictDO = knowledgeArticleDictDao.findByIdAndDel(articleId);
        KnowledgeArticleDictDO knowledgeArticleDictDO = knowledgeArticleDictService.findByIdAndDel(articleId);
        if (knowledgeArticleUserDO!=null){
            if (flag==1){
                knowledgeArticleUserDO.setFabulous(status);
@ -1213,19 +1215,24 @@ public class BaseMenuManageService {
     * @return
     */
    public JSONObject findArticleStaticsByArticleId(String articleId){
        List<KnowledgeArticleDoctorDO> knowledgeArticleDoctorDOS = knowledgeArticleDoctorDao.findByRelationCodeAndType(articleId,2);//获取点赞
        List<KnowledgeArticleDoctorDO> knowledgeArticleDoctorDOList = knowledgeArticleDoctorDao.findByRelationCodeAndType(articleId,3);//获取收藏
        List<KnowledgeArticleDoctorDO> knowledgeArticleDoctorDOList1 = knowledgeArticleDoctorDao.findByRelationCodeAndType(articleId,1);//获取评论
        List<KnowledgeArticleDoctorDO> knowledgeArticleDoctorDOList2 = knowledgeArticleDoctorDao.findByRelationCodeAndType(articleId,4);//获取评论
        Integer knowledgeArticleDoctorDOS = findByRelationCodeAndType(articleId,2);//获取点赞
        Integer knowledgeArticleDoctorDOList = findByRelationCodeAndType(articleId,3);//获取收藏
        Integer knowledgeArticleDoctorDOList1 = findByRelationCodeAndType(articleId,1);//获取评论
        Integer knowledgeArticleDoctorDOList2 = findByRelationCodeAndType(articleId,4);//获取评论
        JSONObject object = new JSONObject();
        object.put("eulogyTotal",knowledgeArticleDoctorDOS.size());//点赞数量
        object.put("collectTotal",knowledgeArticleDoctorDOList.size());//收藏数量
        object.put("commentTotal",knowledgeArticleDoctorDOList1.size());//评论数量
        object.put("browseTotal",knowledgeArticleDoctorDOList2.size());//浏览量
        object.put("eulogyTotal",knowledgeArticleDoctorDOS);//点赞数量
        object.put("collectTotal",knowledgeArticleDoctorDOList);//收藏数量
        object.put("commentTotal",knowledgeArticleDoctorDOList1);//评论数量
        object.put("browseTotal",knowledgeArticleDoctorDOList2);//浏览量
        return object;
    }
    public Integer findByRelationCodeAndType(String relationCode,Integer type){
        String sql = "select count(*) from base_knowledge_article_doctor where relation_code='"+relationCode+"' and type="+type;
        return jdbcTemplate.queryForObject(sql,Integer.class);
    }
    /**
     * 判断该文章/医生当前医生是否点赞或者收藏

+ 15 - 13
business/base-service/src/main/java/com/yihu/jw/article/service/KnowledgeArticleDictService.java

@ -9,11 +9,9 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.menu.BaseMenuDictDO;
import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDeptDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDictDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDoctorDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.survey.WlyySurveyTemplateDO;
@ -126,7 +124,7 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
	public boolean delArticle(String id){
		String str[]= id.split(",");
		for (int i=0;i<str.length;i++){
			KnowledgeArticleDictDO knowledgeArticleDictDO = knowledgeArticleDictDao.findByIdAndDel(str[i]);
			KnowledgeArticleDictDO knowledgeArticleDictDO = findByIdAndDel(str[i]);
			if (knowledgeArticleDictDO!=null){
				knowledgeArticleDictDO.setDel(0);
				knowledgeArticleDictDao.save(knowledgeArticleDictDO);
@ -137,6 +135,10 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
	public KnowledgeArticleDictDO findById(String id){
		return knowledgeArticleDictDao.findById(id).orElse(null);
	}
	public KnowledgeArticleDictDO findByIdAndDel(String id){
		return knowledgeArticleDictDao.findByIdAndDel(id);
	}
@ -155,7 +157,7 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
				articleNeedCheck=false;
			}
		}
		if (!StringUtils.isNotBlank(knowledgeArticleDO.getId()) ) {
		if (StringUtils.isBlank(knowledgeArticleDO.getId()) ) {
			// 新增
			knowledgeArticleDO.setId(UUID.randomUUID().toString().replace("-", ""));
			knowledgeArticleDO.setCreateTime(new Date());
@ -187,7 +189,7 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
			knowledgeArticleDO = knowledgeArticleDictDao.save(knowledgeArticleDO);
			return knowledgeArticleDO;
		} else {
			KnowledgeArticleDictDO one = knowledgeArticleDictDao.findById(knowledgeArticleDO.getId()).orElse(null);;
			KnowledgeArticleDictDO one = findById(knowledgeArticleDO.getId());
			one.setTitle(knowledgeArticleDO.getTitle());
			one.setContent(knowledgeArticleDO.getContent());
			one.setImage(knowledgeArticleDO.getImage());
@ -251,7 +253,7 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
	//审核/退回文章
	public KnowledgeArticleDictDO reviewArticle(String articleId,Integer status,String reason) throws Exception{
		KnowledgeArticleDictDO knowledgeArticleDO = knowledgeArticleDictDao.findById(articleId).orElse(null);;
		KnowledgeArticleDictDO knowledgeArticleDO = findById(articleId);
		if (null == knowledgeArticleDO) {
			throw new Exception("该文章不存在");
		} else {
@ -297,9 +299,9 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
	 */
	public List<Map<String,Object>> findDeptByArticle(String articleId)throws Exception{
		String sql ="SELECT " +
				" d.article_id AS articleId," +
				" d.dept, " +
				" d.dept_name AS deptName " +
				" d.article_id AS \"articleId\"," +
				" d.dept as \"dept\", " +
				" d.dept_name AS \"deptName\" " +
				" FROM " +
				" wlyy_knowledge_article t " +
				" JOIN wlyy_knowledge_article_dept d ON t.id = d.article_id " +
@ -355,7 +357,7 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
		String ids[] = articleId.split(",");
		KnowledgeArticleDictDO knowledgeArticleDictDO = new KnowledgeArticleDictDO();
		for (int i=0;i<ids.length;i++){
			knowledgeArticleDictDO = knowledgeArticleDictDao.findByIdAndDel(ids[i]);
			knowledgeArticleDictDO = findByIdAndDel(ids[i]);
			if (null!=knowledgeArticleDictDO){
				knowledgeArticleDictDO.setReleaseStatus(releaseStatus);
				knowledgeArticleDictDao.save(knowledgeArticleDictDO);
@ -385,7 +387,7 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
				patientBusinessDO.setDel(1);
				patientBusinessDO = patientBusinessDao.save(patientBusinessDO);
					if (patientBusinessDO.getRelationType()==1){
						KnowledgeArticleDictDO knowledgeArticleDO = knowledgeArticleDictDao.findByIdAndDel(patientBusinessDO.getRelationCode());
						KnowledgeArticleDictDO knowledgeArticleDO = findByIdAndDel(patientBusinessDO.getRelationCode());
					System.out.println("content:"+JSON.toJSONString(knowledgeArticleDO));
					JSONObject object = new JSONObject();
					object.put("id",knowledgeArticleDO.getId());
@ -430,7 +432,7 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
	 * @return
	 */
	public KnowledgeArticleDictDO setUsed(String id,Integer used,String doctor){
		KnowledgeArticleDictDO knowledgeArticleDO = knowledgeArticleDictDao.findByIdAndDel(id);
		KnowledgeArticleDictDO knowledgeArticleDO = findByIdAndDel(id);
		BaseDoctorDO doctorDO = doctorDao.findById(doctor).orElse(null);;
		KnowledgeArticleUserDO knowledgeArticleUserDO =knowledgeArticleUserDao.findByrelationCodeAndUserAndDel(id,doctor);
		if (knowledgeArticleUserDO==null){
@ -475,7 +477,7 @@ public class KnowledgeArticleDictService extends BaseJpaService<KnowledgeArticle
	public KnowledgeArticleDictDO selectById(String id){
		return knowledgeArticleDictDao.findByIdAndDel(id);
		return findByIdAndDel(id);
	}
	//根据分类查询文章
	public MixEnvelop findArticleByCategoryAndName(String categoryFirst, String categorySecond, String keyWords, Integer page, Integer pageSize){

+ 0 - 8
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java

@ -463,14 +463,6 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
        return response;
    }
/*    public static void main(String[] args) {
        String salt = "ssdq1";
        String pw6 = "250037";
        String pw = MD5.md5Hex(pw6 + "{" + salt + "}");
        System.out.println(pw);
    }*/
    public Boolean updateDoctorPw(String id,String pw,String orgPw){
        if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            BaseDoctorDO doctorDOs = baseDoctorDao.findByIdAndDel(id);

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorRoleService.java

@ -35,7 +35,7 @@ public class BaseDoctorRoleService extends BaseJpaService<BaseDoctorRoleDO, Base
    public Envelop page (String roleCode,String name,String idcard,int page,int size) {
        String sql = "SELECT r.role_code roleCode,d.id doctorCode,d.name,d.idcard,d.mobile  " ;
        String sql = "SELECT r.role_code as \"roleCode\",d.id as \"doctorCode\",d.name as \"name\",d.idcard as \"idcard\",d.mobile as \"mobile\"  " ;
        String countSql = " select count(d.id) ";
        String from = " from base_doctor_role r,base_doctor d";
        String filters = " where r.role_code = '"+roleCode+"' and r.doctor_code = d.id";

+ 0 - 399
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorService.java

@ -1,399 +0,0 @@
//package com.yihu.jw.doctor.service;
//
//import com.alibaba.fastjson.JSON;
//import com.yihu.jw.doctor.dict.BaseDoctorDao;
//import com.yihu.jw.doctor.dict.DoctorSpecialDiseaseDao;
//import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
//import com.yihu.jw.entity.base.doctor.DoctorSpecialDiseaseDo;
//import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
//import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
//import com.yihu.jw.restmodel.web.Envelop;
//import com.yihu.jw.restmodel.web.MixEnvelop;
//import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
//import com.yihu.jw.util.date.DateUtil;
//import com.yihu.jw.utils.hibernate.HibenateUtils;
//import com.yihu.mysql.query.BaseJpaService;
//import com.yihu.jw.util.encrypt.MD5;
//import net.sf.json.JSONArray;
//import net.sf.json.JSONObject;
//import org.apache.commons.collections.map.HashedMap;
//import org.apache.commons.lang3.StringUtils;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.data.redis.core.StringRedisTemplate;
//import org.springframework.jdbc.core.JdbcTemplate;
//import org.springframework.stereotype.Service;
//
//import java.util.Date;
//import java.util.List;
//import java.util.Map;
//import java.util.Random;
//
//@Service
//public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDao> {
//
//    private static Logger logger = LoggerFactory.getLogger(BaseDoctorService.class);
//
//
//    @Autowired
//    private BaseDoctorDao baseDoctorDao;
//    @Autowired
//    private DoctorSpecialDiseaseDao specialDiseaseDao;
//    @Autowired
//    private JdbcTemplate jdbcTemplate;
//    @Autowired
//    private HibenateUtils hibenateUtils;
//    @Autowired
//    private StringRedisTemplate redisTemplate;
//    @Autowired
//    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
//
//
//    /**
//     * 查询医生信息分页列表.
//     * @param city
//     * @param hospital
//     * @param status
//     * @param name
//     * @param page
//     * @param pageSize
//     */
//    public Envelop queryList(String city, String hospital, String status, String name, String type,String typeCode,String dept, int page, int pageSize){
//        Map<String,Object> params = new HashedMap();
//        String sqlTotal ="SELECT " +
//                " COUNT(1) AS \"total\" " +
//                " FROM " +
//                " base_doctor a " +
//                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
//                " LEFT JOIN (SELECT * FROM wlyy_charge_dict t WHERE t.dept_type_code ='6') e ON a.charge_type = e.charge_type " +
//                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " +
//                " WHERE " +
//                " 1 = 1";
//        if (StringUtils.isNotBlank(city)){
//            sqlTotal += " AND a.city_name =:city";
//            params.put("city",city);
//        }
//        if (StringUtils.isNotBlank(hospital)){
//            sqlTotal += " AND b.org_code =:hospital";
//            params.put("hospital",hospital);
//        }
//        if (StringUtils.isNotBlank(status)){
//            sqlTotal += " AND a.del =:status";
//            params.put("status",status);
//        }
//        if (StringUtils.isNotBlank(name)){
//            name = "%"+name+"%";
//            sqlTotal += " AND (a.name like:name or b.dept_name like:name)";
//            params.put("name",name);
//        }
//        if (StringUtils.isNotBlank(type)){
//            type = "%"+type+"%";
//            sqlTotal += " AND a.outpatient_type like:type";
//            params.put("type",type);
//        }
//        if(StringUtils.isNotBlank(typeCode)){
//            sqlTotal += " AND e.dept_type_code =:typeCode";
//            params.put("typeCode",typeCode);
//        }
//        if(StringUtils.isNotBlank(dept)){
//            sqlTotal += " AND b.dept_code =:dept";
//            params.put("dept",dept);
//        }
//
//        Long count = 0L;
//        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlTotal,params);
//        if(count!=null){
//            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
//            count = hibenateUtils.objTransformLong(total.get(0).get("total"));
//        }
//        String sql ="SELECT " +
//                " a.id AS \"id\", " +
//                " a.NAME AS \"name\", " +
//                " a.introduce AS \"introduce\", " +
//                " a.expertise AS \"expertise\", " +
//                " a.outpatient_type AS \"outpatientType\", " +
//                " a.del AS \"del\", " +
//                " b.dept_name AS \"deptName\", " +
//                " e.req_fee AS \"money\" " +
//                " FROM " +
//                " base_doctor a " +
//                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
//                " LEFT JOIN (SELECT * FROM wlyy_charge_dict t WHERE t.dept_type_code ='6') e ON a.charge_type = e.charge_type " +
//                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " +
//                " WHERE 1=1";
//        if (StringUtils.isNotBlank(city)){
//            sql += " AND a.city_name =:city";
//        }
//        if (StringUtils.isNotBlank(hospital)){
//            sql += " AND b.org_code =:hospital";
//        }
//        if (StringUtils.isNotBlank(status)){
//            sql += " AND a.del =:status";
//        }
//        if (StringUtils.isNotBlank(name)){
//            sql += " AND (a.name like:name or b.dept_name like:name)";
//        }
//        if (StringUtils.isNotBlank(type)){
//            sql += " AND a.outpatient_type like:type";
//        }
//        if(StringUtils.isNotBlank(typeCode)){
//            sql += " AND e.dept_type_code =:typeCode";
//        }
//        if(StringUtils.isNotBlank(dept)){
//            sql += " AND b.dept_code =:dept";
//        }
//
//        logger.info("queryList sql:"+sql);
//
//        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params,page,pageSize);
//
//        return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, pageSize, count);
//    }
//
//    /**
//     * 根据医生ID,获取医生基础信息
//     * @param doctorId
//     * @return
//     */
//    public Object queryById(String doctorId,String typeCode) {
//        Map<String,Object> params = new HashedMap();
//        String sql ="SELECT " +
//                " a.NAME AS \"name\", " +
//                " a.job_title_name AS \"jobTitleName\", " +
//                " a.introduce AS \"introduce\", " +
//                " a.expertise AS \"expertise\", " +
//                " a.photo AS \"photo\", " +
//                " a.outpatient_type AS \"outpatientType\", " +
//                " b.dept_name AS \"deptName\", " +
//                " b.org_name AS \"orgName\", " +
//                " c.mapping_code AS \"jobNumber\", " +
//                " d.disease_name AS \"diseaseName\", " +
//                " d.disease_code AS \"diseaseCode\", " +
//                " e.req_fee AS \"money\" " +
//                " FROM " +
//                " base_doctor a " +
//                " LEFT JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
//                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " +
//                " LEFT JOIN wlyy_doctor_special_disease d ON a.id = d.doctor_code " +
//                " LEFT JOIN wlyy_charge_dict e ON a.charge_type = e.charge_type " +
//                " WHERE 1=1 ";
//        if(StringUtils.isNotBlank(doctorId)){
//            sql+=" AND a.id =:id";
//            params.put("id",doctorId);
//        }
//        if(StringUtils.isNotBlank(typeCode)){
//            sql+=" AND e.dept_type_code =:typeCode";
//            params.put("typeCode",typeCode);
//        }
//
//        logger.info("queryById sql:"+sql);
//
//        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params);
//        StringBuilder disease = new StringBuilder();
//        StringBuilder code = new StringBuilder();
//        if (null != list && list.size() > 0){
//            if (list.size() == 1){
//                return  list.get(0);
//            }else {
//                for (int i=0;i<list.size();i++){
//                    if (i == 0 ){
//                        disease.append(list.get(i).get("diseaseName"));
//                        code.append(list.get(i).get("diseaseCode"));
//                    }else {
//                        disease.append(","+list.get(i).get("diseaseName"));
//                        code.append(","+list.get(i).get("diseaseCode"));
//                    }
//                }
//                list.get(0).put("diseaseName",disease);
//                list.get(0).put("diseaseCode",code);
//                return  list.get(0);
//            }
//        }
//
//        return null;
//    }
//
//    public Boolean updateList(JSONArray jsonArray){
//        if(jsonArray!=null&&jsonArray.size()>0){
//            for(int i=0;i<jsonArray.size();i++){
//                JSONObject doctor = jsonArray.getJSONObject(i);
//                try {
//                    updateInfo(doctor);
//                }catch (Exception e){
//                    logger.info("update doctor error:"+e.toString());
//                }
//            }
//        }
//        return true;
//    }
//
//    /**
//     * 修改医生服务配置
//     * @param jsonObject
//     */
//    public Boolean update(JSONObject jsonObject)throws Exception{
//        //取出数据
//        String doctorId = jsonObject.get("doctorId").toString();
//        String introduce = jsonObject.get("introduce").toString();
//        String expertise = jsonObject.get("expertise").toString();
//        String photo = jsonObject.get("photo").toString();
//        String outpatientType = jsonObject.get("outpatientType").toString();
//        String newSpecialDisease = jsonObject.get("specialDisease").toString();
//        String newSpecialDiseaseCode = jsonObject.get("specialDiseaseCode").toString();
//        baseDoctorDao.update(doctorId,introduce,expertise,photo,outpatientType);
//        //删除医生旧专病门诊,保存新专病门诊
//        Map<String,Object> params = new HashedMap();
//        String sqlTotal ="SELECT " +
//                " COUNT(1) AS \"total\" " +
//                " FROM " +
//                " wlyy_doctor_special_disease a " +
//                " WHERE " +
//                " 1 = 1";
//        sqlTotal += " AND a.doctor_code =:doctorId";
//        params.put("doctorId",doctorId);
//        Long count = 0L;
//        List<Map<String, Object>> total = hibenateUtils.createSQLQuery(sqlTotal, params);
//        //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
//        count = hibenateUtils.objTransformLong(total.get(0).get("total"));
//        if (count > 0){
//            specialDiseaseDao.deleteByDoctorCode(doctorId);
//        }
//        if(StringUtils.isNotBlank(newSpecialDisease) && StringUtils.isNotBlank(newSpecialDiseaseCode)){
//            String[] split = newSpecialDisease.split(",");
//            String[] splitCode = newSpecialDiseaseCode.split(",");
//            specialDiseaseDao.deleteByDoctorCode(doctorId);
//            for (int i=0;i<split.length;i++ ){
//                DoctorSpecialDiseaseDo specialDiseaseDo = new DoctorSpecialDiseaseDo();
//                specialDiseaseDo.setDoctorCode(doctorId);
//                specialDiseaseDo.setDiseaseName(split[i]);
//                specialDiseaseDo.setDiseaseCode(splitCode[i]);
//                specialDiseaseDao.save(specialDiseaseDo);
//            }
//        }
//
//        return true;
//    }
//
//    public Boolean updateInfo(JSONObject jsonObject)throws Exception{
//        //取出数据
//        String doctorId = jsonObject.get("doctorId").toString();
//        String outpatientType = jsonObject.get("outpatientType").toString();
//        logger.info("doctor:"+doctorId+" outpatientType:"+outpatientType);
//        BaseDoctorDO doctorDO = baseDoctorDao.getOne(doctorId);
//        doctorDO.setOutpatientType(outpatientType);
//        baseDoctorDao.save(doctorDO);
//        return true;
//    }
//
//
//    /**
//     * 修改医生状态
//     * @param doctorId
//     * @param status
//     */
//    public void updateStatus(String doctorId,String status)throws Exception{
//        baseDoctorDao.updateStatus(doctorId,status);
//    }
//
//    public Boolean updateDoctorPw(String id,String pw,String orgPw){
//        BaseDoctorDO doctorDO = baseDoctorDao.findById(id).orElse(null);
//
//        String orgPwMd5 = MD5.md5Hex(orgPw + "{" + doctorDO.getSalt() + "}");
//        if(!orgPwMd5.equals(doctorDO.getPassword())){
//            return false;
//        }
//        //认证信息设置
//        String salt = randomString(5);
//        doctorDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
//        doctorDO.setSalt(salt);
//
//        baseDoctorDao.save(doctorDO);
//
//        //设置更新时间
//        saveDoctorPwlimitDate(id);
//
//        return true;
//    }
//
//    public String randomString(int length) {
//        String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
//        StringBuffer buffer = new StringBuffer();
//        Random random = new Random();
//
//        for(int i = 0; i < length; ++i) {
//            int pos = random.nextInt(str.length());
//            buffer.append(str.charAt(pos));
//        }
//
//        return buffer.toString();
//    }
//
//    public com.alibaba.fastjson.JSONObject findDoctorPwlimitDate(String doctor){
//        String key = "hlwyy:authPw:doctor:" + doctor;
//        String authPw = redisTemplate.opsForValue().get(key);
//        com.alibaba.fastjson.JSONObject valueJson = null;
//        if(StringUtils.isNotBlank(authPw)){
//
//            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.getOne("pwOverDue");
//            String code[] = wlyyHospitalSysDictDO.getDictCode().split(",");
//            Integer maxDateInt = Integer.parseInt(code[0]);
//            Integer remainDateInt = Integer.parseInt(code[1]);
//
//            valueJson = JSON.parseObject(authPw);
//            Long updateTimeLong = valueJson.getLong("updateTime");
//            Date updateTime = new Date();
//            updateTime.setTime(updateTimeLong);
//            Date maxDate = DateUtil.getPreDays(updateTime,maxDateInt);
//
//            Long betweenDate = (maxDate.getTime() - new Date().getTime())/(60*60*24*1000);
//            valueJson.put("betweenDate",betweenDate);
//            if(betweenDate<remainDateInt){
//                valueJson.put("remaind",true);
//            }else {
//                valueJson.put("remaind",false);
//            }
//        }else {
//            valueJson = new com.alibaba.fastjson.JSONObject();
//            valueJson.put("isChanged",false);
//        }
//        return valueJson;
//    }
//
//    public boolean saveDoctorPwlimitDate(String doctor){
//        String key = "hlwyy:authPw:doctor:" + doctor;
//        com.alibaba.fastjson.JSONObject valueJson = new com.alibaba.fastjson.JSONObject();
//        valueJson.put("updateTime",new Date().getTime());
//        valueJson.put("isChanged",true);
//        redisTemplate.opsForValue().set(key,valueJson.toJSONString());
//        return true;
//    }
//
//
//
//
////    public static void main(String ag[]){
////        long betweenDate = (DateUtil.strToDate("2020-04-11","yyyy-MM-dd").getTime() - new Date().getTime())/(60*60*24*1000);
////        System.out.println(betweenDate);
////    }
//
////    public static void main(String ag[]){
////        String str = "[ " +
////                "{ " +
////                "\"title\":\"Java 开发\", " +
////                "\"edition\":3, " +
////                "\"author\":[\"smith\",\"张三\",\"李四\"] " +
////                "}, " +
////                "{ " +
////                "\"title\":\"Web 开发\", " +
////                "\"edition\":3, " +
////                "\"author\":[\"Allen\",\"王五\",\"赵六\"] " +
////                "} " +
////                "]";
////        JSONArray json = JSONArray.fromObject(str);
////        for(int i=0;i<json.size();i++){
////            JSONObject doctor = json.getJSONObject(i);
////            doctor.getString("doctor");
////        }
////    }
//}

+ 0 - 15
business/base-service/src/main/java/com/yihu/jw/doctor/service/DoctorSpecialDiseaseService.java

@ -1,15 +0,0 @@
package com.yihu.jw.doctor.service;
import com.yihu.jw.doctor.dao.DoctorSpecialDiseaseDao;
import com.yihu.jw.entity.base.doctor.DoctorSpecialDiseaseDo;
import com.yihu.jw.mysql.query.BaseJpaService;
import org.springframework.stereotype.Service;
/**
 * @author zmk
 * @vsrsion 1.0
 * Created at 2019/12/10
 */
@Service
public class DoctorSpecialDiseaseService extends BaseJpaService<DoctorSpecialDiseaseDo, DoctorSpecialDiseaseDao> {
}

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

@ -4614,7 +4614,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //医生获取积分数据
            String integrateSql ="SELECT\n" +
                    "\tIFNULL(SUM(integrate), 0) AS total\n" +
                    "\tIFNULL(SUM(integrate), 0) AS \"total\"\n" +
                    "FROM\n" +
                    "\tbase_hospital_user_integrate\n" +
                    "WHERE\n" +
@ -4627,7 +4627,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            rs.put("integrateTotal",integrateTotal.intValue());
            //粉丝、点赞、收藏
            String followSql= " SELECT IFNULL(COUNT(1), 0) AS total FROM base_doctor_patient_follow where doctor= '"+doctor+"' ";
            String followSql= " SELECT IFNULL(COUNT(1), 0) AS \"total\" FROM base_doctor_patient_follow where doctor= '"+doctor+"' ";
            List<Map<String, Object>> followRstotal = hibenateUtils.createSQLQuery(followSql);
            Long followTotal = 0L;
            if (followRstotal != null && followRstotal.size() > 0) {
@ -4636,7 +4636,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            rs.put("followTotal",followTotal);//粉丝数量
            String eulogySql= " SELECT\n" +
                    "\tIFNULL(COUNT(1), 0)  AS total\n" +
                    "\tIFNULL(COUNT(1), 0)  AS \"total\"\n" +
                    "FROM\n" +
                    "\tbase_knowledge_article_doctor\n" +
                    "WHERE\n" +
@ -4659,7 +4659,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            String collectSql= " SELECT\n" +
                    "\tIFNULL(COUNT(1), 0)  AS total\n" +
                    "\tIFNULL(COUNT(1), 0)  AS \"total\"\n" +
                    "FROM\n" +
                    "\tbase_knowledge_article_doctor\n" +
                    "WHERE\n" +
@ -7036,7 +7036,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if(StringUtils.isNoneBlank(patientid)){
            sql+=" , follow.id AS \"followid\" " ;
        }
        sql += ",evaluate.score,a.total";
        sql += ",evaluate.score as \"score\",a.total as \"total\"";
        sql+=" FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
@ -7188,7 +7188,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if(StringUtils.isNoneBlank(patientid)){
            groupBy+=" , follow.id" ;
        }
        groupBy += ", evaluate.score,a.total";
        groupBy += ", evaluate.score as \"score\",a.total as \"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  ";

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

@ -23,4 +23,19 @@ public class DmDBUtl {
        }
        return field;
    }
    //字段拼接 逗号间隔
    public static String group_concat(String field,String wxId){
        if(StringUtils.isBlank(field)){
            return "";
        }
        if("xm_qsyy_wx".equals(wxId)){
            field = " listagg("+field+",',')";//达梦数据库
        } else if("xm_ykyy_wx".equals(wxId)){
            field = " wm_concat ("+field+" || ',') ";//oracle
        }else {
            field = " GROUP_CONCAT("+field+")";//mysql
        }
        return field;
    }
}

+ 16 - 33
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -1248,43 +1248,10 @@ public class ImService {
                }
            }
            //2. 调用HIS挂号接口---START  移到CONTROLER层,直接调用挂号接口
//			DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(doctorCode,wlyyOutpatientDO.getHospital());
//			if(doctorMappingDO==null){
//				throw new RuntimeException("未找到医生映射信息");
//			}
//
//			net.sf.json.JSONObject rs = entranceService.BS10111(wlyyOutpatientDO.getCardNo(),doctorMappingDO.getMappingCode(),wlyyOutpatientDO.getDept(),null,wlyyOutpatientDO.getWinNo(),demoFlag);
//			String rsCode = (String)rs.get("@RESULT");
//			if("0".equals(rsCode)){
//				//存储挂号号
//				String serialNo = (String)rs.get("serial_no");
//				wlyyOutpatientDO.setRegisterNo(serialNo);
//				String conNo = (String)rs.get("@times");
//				wlyyOutpatientDO.setConNo(conNo);
//			}
//
//			//保存日志
//			WlyyHttpLogDO log = new WlyyHttpLogDO();
//			log.setCode("registerOutPatient");
//			log.setName("挂号");
//			log.setPatient(wlyyOutpatientDO.getPatient());
//			log.setDoctor(doctorCode);
//			log.setResponse(rs.toString());
//			log.setRequest("outPatientId="+outpatientCode+"&doctor="+doctorCode);
//			log.setStatus(rsCode);
//			log.setCreateTime(new Date());
//			wlyyHttpLogDao.save(log);
            // 调用HIS挂号接口---END
            /**
             * toto 判断是否存在未审核的复诊
             */
            BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(doctorCode);
//			doctorCode = doctor.getCode();
            // 查询患者信息
@ -1332,6 +1299,11 @@ public class ImService {
                        consultTitle = "家医咨询";
                    }
                }else if("4".equals(wlyyOutpatientDO.getOutpatientType())){
                    //康复咨询
                    users.put(patient, 0);
                    ct.setType(28);
                    consultTitle = "图文咨询";
                } else {
                    users.put(patient, 0);
                    consultTitle = "申请复诊";
@ -1404,6 +1376,15 @@ public class ImService {
                    } else {
                        obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_GENERAL_EXPERT);
                    }
                }else if("4".equals(wlyyOutpatientDO.getOutpatientType())){
                    messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
                    //5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+28(图文,视频,图文+视频)
                    sessionId = patient + "_" + outpatientCode + "_" + ct.getType();
                    if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                        //康复咨询
                        obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_KANGFUConsult);
                    }
                } else {
                    messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
                    //5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+9(图文,视频,图文+视频)
@ -1734,6 +1715,8 @@ public class ImService {
            msgStr = msgStr + "  已开始复诊";
        } else if ("2".equals(wlyyOutpatientDO.getOutpatientType())) {
            msgStr = msgStr + "  已开始协同门诊";
        } else if("4".equals(wlyyOutpatientDO.getOutpatientType())){
            msgStr = msgStr + "  已开始康复咨询";
        } else {
            msgStr = msgStr + "  已开始专家咨询";
        }

+ 8 - 8
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java

@ -308,7 +308,7 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
    private String atddrNo;//国码
    private String identity;//身份1是总经理,0是员工
//    private String identity;//身份1是总经理,0是员工 日报系统用,达梦数据库不支持先注释
    private String functionSetting;//功能设置
@ -320,13 +320,13 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
        this.functionSetting = functionSetting;
    }
    public String getIdentity() {
        return identity;
    }
    public void setIdentity(String identity) {
        this.identity = identity;
    }
//    public String getIdentity() {
//        return identity;
//    }
//
//    public void setIdentity(String identity) {
//        this.identity = identity;
//    }
    public String getAtddrNo() {
        return atddrNo;

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

@ -47,6 +47,7 @@ public class KnowledgeArticleDictDO extends UuidIdentityEntity {
	private Integer collection;//收藏数量
	private Integer fabulous;//点赞数量
	@Column(name = "comment_num")
	private Integer comment;//评论数量
	@Column(name = "is_share")
	private Integer share;//分享 数量
@ -420,6 +421,7 @@ public class KnowledgeArticleDictDO extends UuidIdentityEntity {
		this.url = url;
	}
	@Column(name = "comment_num")
	public Integer getComment() {
		return comment;
	}

+ 4 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/article/ArticleEndpoint.java

@ -10,7 +10,6 @@ import com.yihu.jw.entity.base.patient.BasePatientBusinessDO;
import com.yihu.jw.entity.base.role.RoleDO;
import com.yihu.jw.entity.base.user.UserDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDictDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDoctorDO;
import com.yihu.jw.entity.hospital.article.KnowledgeCategoryDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
@ -22,8 +21,9 @@ import com.yihu.jw.user.UserDao;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
@ -49,6 +49,8 @@ public class ArticleEndpoint extends EnvelopRestEndpoint {
	private UserDao userdao;
	@Autowired
	private RoleDao roleDao;
	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	@GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.searchKnowledgePageList)
	@ApiOperation(value = "获取文章列表")

+ 4 - 115
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -214,49 +214,6 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        String nameOrIdcardValue = null == nameOrIdcard ? "" : "%" + nameOrIdcard + "%";
        int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : page * size;
//        String sql = "select" +
//                "  tb.id as id," +
//                "  tb.name as name," +
//                "  tb.idcard as idcard,  " +
//                "  tb.sex as sex,  " +
//                "  tb.mobile as mobile,  " +
//                "  GROUP_CONCAT(tb.org SEPARATOR ',') as orgInfo,  " +
//                "  tb.job_title_name as jobTitleName,  " +
//                "  tb.status as status " +
//                "from  " +
//                "  (  " +
//                "    select  " +
//                "     doc.id,  " +
//                "     doc.name,  " +
//                "     doc.idcard,  " +
//                "     case doc.sex when 1 then '男' when 2 then '女' else '未知' end as sex,  " +
//                "     doc.mobile,  " +
//                "     concat(hos.org_name,'/',dept.name,'/',hos.doctor_duty_name) as org,  " +
//                "     doc.job_title_name,  " +
//                "     case doc.del when 0 then '已失效' when 1 then '生效中' end as status,  " +
//                "      doc.create_time  " +
//                "   from  " +
//                "     base_doctor doc,  " +
//                "     base_doctor_hospital hos,  " +
//                "     dict_hospital_dept dept  " +
//                "  where  " +
//                "    doc.id = hos.doctor_code  " +
//                "    and  " +
//                "    hos.org_code = dept.org_code " +
//                "    and " +
//                "    hos.dept_code = dept.code  " +
//                "    and  " +
//                "    ((doc.idcard like '{idcard}' or ''= '{idcard}' ) or (doc.name like '{name}'  or ''= '{name}' )  and (hos.org_code = '{orgCode}' or ''= '{orgCode}') and (doc.del = '{docStatus}' or ''= '{docStatus}'))  " +
//                "  ) tb  " +
//                "GROUP BY tb.id order by tb.create_time desc limit {start},{end} ";
//        String finalSql = sql
//                .replace("{idcard}",nameOrIdcardValue)
//                .replace("{name}",nameOrIdcardValue)
//                .replace("{orgCode}",orgCodeVale)
//                .replace("{docStatus}",del)
//                .replace("{start}",String.valueOf(start))
//                .replace("{end}",String.valueOf(end));
        String sql="SELECT\n" +
                "\ttb.id AS \"id\",\n" +
                "\ttb.idcard AS \"idcard\",\n" +
@ -274,7 +231,9 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                sql+="  wm_concat (tb.org || ',') AS \"orgInfo\",";
            }
        }else {
        } else if("xm_qsyy_wx".equalsIgnoreCase(wechatId)){
            sql+=" listagg(tb.org,',') AS \"orgInfo\",";
        } else {
            sql+=" GROUP_CONCAT(tb.org SEPARATOR ',') AS orgInfo,";
        }
        sql+="tb.job_title_name AS \"jobTitleName\",\n" +
@ -312,13 +271,7 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                " base_doctor doc LEFT join base_doctor_hospital hos on doc.id = hos.doctor_code " +
                " LEFT JOIN dict_hospital_dept dept on hos.org_code = dept.org_code" +
                " AND hos.dept_code = dept.code"+
                /*"\tbase_doctor doc,\n" +
                "\tbase_doctor_hospital hos,\n" +
                "\tdict_hospital_dept dept\n" +*/
                " WHERE 1=1";
                /*"\tdoc.id = hos.doctor_code\n" +
                "AND hos.org_code = dept.org_code\n" +
                "AND hos.dept_code = dept.code\n"*/
        if (!StringUtils.isEmpty(nameOrIdcard)){
            sql += " and (doc.idcard LIKE '%"+nameOrIdcard+"%' or doc.name LIKE '%"+nameOrIdcard+"%')";
        }if (!StringUtils.isEmpty(orgCode)){
@ -335,69 +288,12 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                "\ttb.sex,\n" +
                "\ttb.mobile,\n" +
                "\ttb.job_title_name,\n" +
                "\ttb.status,\n" +"\ttb.orgName,\n" +"\ttb.deptname,\n" +"\ttb.doctorDutyName,\n" +
                "\ttb.status,\n" +"\ttb.orgName,\n" +"\ttb.deptname,\n" +"\ttb.doctorDutyName,tb.status,\n" +
                "  tb.create_time\n" +
                "ORDER BY\n" +
                "\ttb.create_time DESC";
//        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
//            sql+=" GROUP BY\n" +
//                    "\ttb. ID,\n" +
//                    "\ttb.idcard,\n" +
//                    "\ttb. NAME,\n" +
//                    "\ttb.sex,\n" +
//                    "\ttb.mobile,\n" +
//                    "\ttb.job_title_name,\n" +
//                    "\ttb.status,\n" +
//                    "  tb.create_time\n" +
//                    "ORDER BY\n" +
//                    "\ttb.create_time DESC";
//        }else {
//            sql+=" GROUP BY\n" +
//                    "\ttb. ID\n" +
//                    "ORDER BY\n" +
//                    "\ttb.create_time DESC";
//        }
        List<Map<String,Object>> list=null;
        list = hibenateUtils.createSQLQuery(sql,page,size);
       /* if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            if (flag){
                sql+=" LIMIT  " + (page - 1) * size + "," + size + "";
                Logger.getAnonymousLogger().info("finalCountSql="+sql);
                list = jdbcTemplate.queryForList(sql);
            }else {
                String oracleSql="SELECT\n" +
                        "\t*\n" +
                        "FROM\n" +
                        "\t(\n" +
                        "\t\tSELECT\n" +
                        "\t\t\tA .*\n" +
                        "\t\tFROM\n" +
                        "\t\t\t(";
                oracleSql+=sql;
                oracleSql+="\t\t\t) A\n" +
                        "\t\tWHERE\n" +
                        "  ROWNUM <="+page*size +
                        "\t) \n" +
                        "WHERE\n" +
                        "\tROWNUM >= "+(page-1)*size;
                Logger.getAnonymousLogger().info("oracleSql="+oracleSql);
                list = jdbcTemplate.queryForList(oracleSql);
            }
        }else {
            sql+=" LIMIT  " + (page - 1) * size + "," + size + "";
            Logger.getAnonymousLogger().info("finalCountSql="+sql);
            list = jdbcTemplate.queryForList(sql);
        }*/
        String countSql = " select " +
                "     COUNT(DISTINCT (doc.id)) as count " +
@ -420,7 +316,6 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            countSql += " and doc.del  = '"+del+"'";
        }
//        List<Map<String,Object>> list = jdbcTemplate.queryForList(finalSql);
        Logger.getAnonymousLogger().info("finalCountSql="+countSql);
        int count = jdbcTemplate.queryForObject(countSql,Integer.class);
        List<WlyyHospitalSysDictDO> listDict = wlyyHospitalSysDictDao.findByDictName("doctor_level");
@ -429,11 +324,6 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            String deptname = map.get("deptname")==null?"":map.get("deptname").toString();
            String doctorDutyName = map.get("doctorDutyName")==null?"":map.get("doctorDutyName").toString();
            map.put("orgInfo",orgname+"/"+deptname+"/"+doctorDutyName);
            /*for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:listDict){
                if (map.get("doctorlevel").toString().equals(wlyyHospitalSysDictDO.getDictCode())){
                    map.put("levelName",wlyyHospitalSysDictDO.getDictValue());
                }
            }*/
        }
        result.put("count", count);
        result.put("msg", JavaBeanUtils.getInstance().mapListJson(list));
@ -574,7 +464,6 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        // 组装医生任职机构及职业信息,医生默认可以没有角色,没有机构/部门信息等
        if (!CollectionUtils.isEmpty(hospital)) {
            BaseDoctorHospitalDO baseDoctorHospitalDO = null;
            List<BaseDoctorHospitalDO> hospitalDOList = new ArrayList<>();
            String orgName = "";
            try {
                for (Object object : hospital) {

+ 11 - 5
svr/svr-base/src/main/java/com/yihu/jw/base/service/role/WlyyUserRoleService.java

@ -7,8 +7,10 @@ import com.yihu.jw.entity.care.role.DoctorRole;
import com.yihu.jw.entity.care.role.WlyyUserRole;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.utils.DmDBUtl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -26,6 +28,8 @@ public class WlyyUserRoleService extends BaseJpaService<WlyyUserRole, WlyyUserRo
    private WlyyRoleDao wlyyRoleDao;
    @Autowired
    private WlyyUserRoleDao wlyyUserRoleDao;
    @Value("${wechat.id}")
    private String wxId;
    /**
     * 获取管理员列表
@ -33,10 +37,11 @@ public class WlyyUserRoleService extends BaseJpaService<WlyyUserRole, WlyyUserRo
     */
    public PageEnvelop<List<Map<String,Object>>> getAdminList(String name,String idcard,String mobile,Integer page,Integer size){
        page = page>0?page-1:0;
        String sql = " select ur.id,doc.name,doc.idcard,doc.id doctorCode,doc.mobile,ur.role,wr.code,wr.name roleName,wr.level from base_doctor doc " +
                " INNER JOIN wlyy_user_role ur on doc.id = ur.`user` INNER JOIN wlyy_role wr on ur.role = wr.`code` where 1=1 " ;
        String sql = " select ur.id as \"id\",doc.name as \"name\",doc.idcard as \"idcard\",doc.id as \"doctorCode\",doc.mobile as \"mobile\",ur.role as \"role\",wr.code as \"code\"" +
                ",wr.name as \"roleName\",wr.level as \"level\" from base_doctor doc " +
                " INNER JOIN wlyy_user_role ur on doc.id = ur."+ DmDBUtl.changeField("user",wxId) +" INNER JOIN wlyy_role wr on ur.role = wr.code where 1=1 " ;
        String sqlCount = " select count(ur.id) from base_doctor doc " +
                " INNER JOIN wlyy_user_role ur on doc.id = ur.`user` INNER JOIN wlyy_role wr on ur.role = wr.`code` where 1=1 ";
                " INNER JOIN wlyy_user_role ur on doc.id = ur."+ DmDBUtl.changeField("user",wxId) +" INNER JOIN wlyy_role wr on ur.role = wr.code where 1=1 ";
        String filter  = " ";
        if (StringUtils.isNotBlank(name)){
            filter += " and doc.`name`like '%"+name+"%' ";
@ -108,8 +113,9 @@ public class WlyyUserRoleService extends BaseJpaService<WlyyUserRole, WlyyUserRo
     *根据id获取权限详情
     */
    public Map<String,Object> getUserRoleById(String id){
        String sql = " select ur.id,doc.name,doc.idcard,doc.id doctorCode,doc.mobile,ur.role,wr.code,wr.name roleName,wr.level from base_doctor doc " +
                " INNER JOIN wlyy_user_role ur on doc.id = ur.`user` INNER JOIN wlyy_role wr on ur.role = wr.`code` where ur.id='"+id+"' " ;
        String sql = " select ur.id as \"id\",doc.name as \"name\",doc.idcard as \"idcard\",doc.id \"doctorCode\"" +
                ",doc.mobile \"mobile\",ur.role as \"role\",wr.code as \"code\",wr.name \"roleName\",wr.level as \"level\" from base_doctor doc " +
                " INNER JOIN wlyy_user_role ur on doc.id = ur.user INNER JOIN wlyy_role wr on ur.role = wr.code where ur.id='"+id+"' " ;
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        if (list.size()>0){
            return list.get(0);

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

@ -1,6 +1,5 @@
package com.yihu.jw.hospital.endpoint.article;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.article.dao.KnowledgeArticleDictDao;
import com.yihu.jw.article.service.BaseMenuManageService;
@ -17,13 +16,12 @@ import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
 * app文章
@ -62,7 +60,6 @@ public class ArticleDictEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
			@ApiParam(name = "pageSize", value = "每页分页大小", required = true, defaultValue = "10")
			@RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize)throws Exception{
		try {
			String userId=getUID();
			BaseDoctorRoleDO roleDO = doctorRoleDao.findByDoctorCodeAndRoleCode(userId, CommonContant.DR_ARTICLEREVIEWER);
@ -130,7 +127,7 @@ public class ArticleDictEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "id", value = "id", required = true)
			@RequestParam(value = "id", required = true)String id){
		try {
			KnowledgeArticleDictDO articleDO = knowledgeArticleDictDao.findById(id).orElse(null);
			KnowledgeArticleDictDO articleDO = knowledgeArticleDictService.findById(id);
			return success(articleDO);
		}catch (Exception e){
			return failedException2(e);
@ -245,13 +242,15 @@ public class ArticleDictEndpoint extends EnvelopRestEndpoint {
		}
	}
	@GetMapping(value = "open/queryById")
	@ApiOperation(value = "根据id查询文章")
	public Envelop queryByCodeOpen(
			@ApiParam(name = "id", value = "id", required = true)
			@RequestParam(value = "id", required = true)String id){
		try {
			KnowledgeArticleDictDO articleDO = knowledgeArticleDictDao.findById(id).orElse(null);
			KnowledgeArticleDictDO articleDO = knowledgeArticleDictService.findById(id);
			return success(articleDO);
		}catch (Exception e){
			return failedException2(e);

+ 1 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/complaint/BaseComplaintEndPoint.java

@ -11,8 +11,6 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/complaint" )
@Api(tags = "投诉管理员管理", description = "互联网医院")
@ -381,4 +379,5 @@ public class BaseComplaintEndPoint  extends EnvelopRestEndpoint {
            return failedException(e);
        }
    }
}

+ 35 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.article.dao.KnowledgeArticleUserDao;
import com.yihu.jw.contant.CommonContant;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.dict.service.BaseDictJobTitleService;
import com.yihu.jw.dict.service.HospitalDeptService;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
@ -15,6 +16,7 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
@ -57,6 +59,7 @@ import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.order.pay.utils.PayLogService;
import com.yihu.jw.order.pay.ylz.YlzPayService;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
@ -255,7 +258,39 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private EnterpriseService enterpriseService;
    @Autowired
    private WxEnterpriseDao wxEnterpriseDao;
    @Autowired
    private BaseOrgDao baseOrgDao;
    @Autowired
    private DictHospitalDeptDao dictHospitalDeptDao;
    @GetMapping(value = "orgInfo")
    @ApiOperation(value = "机构详情", notes = "机构详情")
    public ObjEnvelop orgInfo(@ApiParam(name = "orgCode", value = "机构编码")
                              @RequestParam(value = "orgCode", required = true)String orgCode
    ) {
        try {
            BaseOrgDO orgDO = baseOrgDao.findByCode(orgCode);
            return ObjEnvelop.getSuccess("查询成功",orgDO);
        } catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "deptInfo")
    @ApiOperation(value = "科室详情", notes = "科室详情")
    public ObjEnvelop deptInfo(@ApiParam(name = "deptId", value = "科室id")
                              @RequestParam(value = "deptId", required = true)Integer deptId
    ) {
        try {
            DictHospitalDeptDO orgDO = dictHospitalDeptDao.findById(deptId).orElse(null);
            return ObjEnvelop.getSuccess("查询成功",orgDO);
        } catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)

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

@ -242,7 +242,6 @@ public class KnowledgeArticleService extends BaseJpaService<KnowledgeArticleDO,
		return true;
	}
	/**
	 *	患者接收问卷/文章
	 * @param businessDOS