ソースを参照

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

liubing 4 年 前
コミット
fa96e15c46
25 ファイル変更698 行追加92 行削除
  1. 3 0
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyHospitalSysDictDao.java
  2. 10 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 18 13
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  4. 5 4
      business/base-service/src/main/java/com/yihu/jw/oauth/OauthSsoService.java
  5. 8 9
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  6. 1 1
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java
  7. 23 3
      business/base-service/src/main/java/com/yihu/jw/wechat/enterprise/EnterpriseService.java
  8. 5 2
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  9. 8 13
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  10. 83 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/common/DictDietDO.java
  11. 9 2
      server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java
  12. 3 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/dao/OauthRsaKeyDao.java
  13. 73 5
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  14. 25 18
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthSsoService.java
  15. 37 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthWjwConfigService.java
  16. 87 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/utils/AesEncryptUtils.java
  17. 17 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/DictDietDao.java
  18. 109 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/DictDietEndpoint.java
  19. 4 2
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java
  20. 23 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/DictDietService.java
  21. 44 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorToDoWorkEndpoint.java
  22. 84 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/DoctorMessageService.java
  23. 2 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/util/ConstantUtil.java
  24. 8 6
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java
  25. 9 9
      svr/svr-internet-hospital/src/main/resources/wechat/weixin_menu.txt

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyHospitalSysDictDao.java

@ -19,6 +19,9 @@ public interface WlyyHospitalSysDictDao extends PagingAndSortingRepository<WlyyH
    WlyyHospitalSysDictDO findById(String id);
    @Query("from WlyyHospitalSysDictDO where dictName = ?1  and  dictCode is null order by sort asc")
    List<WlyyHospitalSysDictDO> findByDictNameNotNull(String dictName);
    List<WlyyHospitalSysDictDO> findByDictName(String dictName);
    @Query("from WlyyHospitalSysDictDO where 1=1")
    List<WlyyHospitalSysDictDO> findAlldict();

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

@ -6660,6 +6660,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        rs.put("photo", basePatientDO.getPhoto());
        rs.put("address", basePatientDO.getAddress());
        rs.put("cardType",basePatientDO.getCardType());
        rs.put("healthStatus","");
        rs.put("diseaseType","");
        if (patientMedicareCardDO != null) {
            rs.put("ssc", patientMedicareCardDO.getCode());
        } else {
@ -6957,7 +6959,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return waitCount.toString();
    }
    public com.alibaba.fastjson.JSONArray getWaitingForVisitVideoPrescriptionByDoctor(String doctor, String wxId,String outpatientType,String keyWord) {
    public com.alibaba.fastjson.JSONArray getWaitingForVisitVideoPrescriptionByDoctor(String doctor, String wxId,String outpatientType,String keyWord,String patientId) {
        String condition = "";
        if ("xm_ykyy_wx".equals(wxId)) {
            if(flag){
@ -7010,12 +7012,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            sql+="  AND room.consult_type= 2 and room.reservation_type in (1,2)";
        } else if (StringUtils.isNotBlank(outpatientType)&&"4".equalsIgnoreCase(outpatientType)) {
            sql+="  AND room.consult_type= 2 and room.reservation_type = 3";
        } else {
        } else if (StringUtils.isNotBlank(outpatientType)&&"2".equalsIgnoreCase(outpatientType)) {
            sql+="  and room.reservation_type = 2 ";
        }else {
            sql += " AND room.consult_type= 2 ";
        }
        if (StringUtils.isNotBlank(keyWord)){
            sql += " AND outpatient.patient_name like '%"+keyWord+"%'";
        }
        if (StringUtils.isNotBlank(patientId)){
            sql += " AND room.patient_id = '"+patientId+"'";
        }
        if ("xm_ykyy_wx".equals(wxId)) {
            if(flag){
                sql += " AND room.reservation_time >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
@ -12072,7 +12079,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
        }
        sql += " order by t.appointment_time desc ";
        sql += " order by t.create_time desc ";
        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, page, pageSize);
        List<Map<String, Object>> listCount = hibenateUtils.createSQLQuery(sql);
        logger.info("查询数据" + sql);

+ 18 - 13
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -3025,8 +3025,10 @@ public class EntranceService {
                                ,String jumpUrl,String miniAppId,String miniAppUrl,String remark,String sender) throws Exception{
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("zsMsgFlowUrl");
        String url = "";
        String pyCode=null;
        if (wlyyHospitalSysDictDO!=null){
            url = wlyyHospitalSysDictDO.getDictValue();
            pyCode=wlyyHospitalSysDictDO.getPyCode();
        }
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("visitId",visitId);
@ -3047,20 +3049,23 @@ public class EntranceService {
        logger.info("消息中心入参=="+jsonObject.toString());
        logger.info("url"+url);
        try {
            response =  httpClientUtil.postBody(url,jsonObject);
            logger.info("response"+response);
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(response);
            //{"code":200,"message":"SUCCESS","data":null}
            WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
            wlyyHttpLogDO.setRequest(jsonObject.toString());
            wlyyHttpLogDO.setResponse(response);
            wlyyHttpLogDO.setName(remark+"url=="+url);
            wlyyHttpLogDO.setCreateTime(new Date());
            wlyyHttpLogDao.save(wlyyHttpLogDO);
            if(object.getInteger("code")==200){
                String message = object.getString("message");
                return message;
            if (StringUtils.isNoneBlank(pyCode)&&pyCode.equalsIgnoreCase("1")){
                response =  httpClientUtil.postBody(url,jsonObject);
                logger.info("response"+response);
                com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(response);
                //{"code":200,"message":"SUCCESS","data":null}
                WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
                wlyyHttpLogDO.setRequest(jsonObject.toString());
                wlyyHttpLogDO.setResponse(response);
                wlyyHttpLogDO.setName(remark+"url=="+url);
                wlyyHttpLogDO.setCreateTime(new Date());
                wlyyHttpLogDao.save(wlyyHttpLogDO);
                if(object.getInteger("code")==200){
                    String message = object.getString("message");
                    return message;
                }
            }
        }catch (Exception e){
            e.printStackTrace();
        }

ファイルの差分が大きいため隠しています
+ 5 - 4
business/base-service/src/main/java/com/yihu/jw/oauth/OauthSsoService.java


+ 8 - 9
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -1360,7 +1360,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        if (businessOrderDO==null){
            throw new Exception("查不到订单!");
        }
        if (businessOrderDO.getOrderCategory().equalsIgnoreCase("1")){
        if (businessOrderDO.getOrderCategory().equalsIgnoreCase("1")&&businessOrderDO.getStatus()==0){
            if ("0".equalsIgnoreCase(changeflag)){
                ConsultDo consultDo = consultOrderDao.findOne(businessOrderDO.getRelationCode());
                consultDo.setPayStatus(1);
@ -1396,7 +1396,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    }
                }
                if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                    String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                    String url=baseUrl+"/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                    enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url);
                }else if(wechatId.equalsIgnoreCase("xm_ykyy_wx")){
                    String url=baseUrl+"/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
@ -1405,7 +1405,6 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    String url="https://ih.xmheart.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                    enterpriseService.sendTWMesByDoctor("xm_xzzx_wx",outpatientDO.getDoctor(),title,msg,url);
                }
                System.out.println("发送企业模板消息成功");
                try {
                    if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
@ -1428,7 +1427,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
           }catch (Exception e){
               e.printStackTrace();
           }
           if (businessOrderDO.getStatus()!=null&&businessOrderDO.getStatus()!=1){
           if (businessOrderDO.getStatus()!=null&&businessOrderDO.getStatus()==0){
               //发送企业模板消息给医生
               BasePatientDO patientDO = new BasePatientDO();
               patientDO = patientDao.findById(outpatientDO.getPatient());
@ -1456,7 +1455,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                   }
               }
               if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                       String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                   String url=baseUrl+"/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                   enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url);
               }else if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){
                   String url=baseUrl+"/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
@ -1516,7 +1515,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
                wlyyOutpatientDO.setPayStatus(1);
                WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
                if (businessOrderDO.getStatus()!=null&&businessOrderDO.getStatus()!=1){
                if (businessOrderDO.getStatus()!=null&&businessOrderDO.getStatus()==0){
                    //发送企业模板消息给医生
                    BasePatientDO patientDO = new BasePatientDO();
                    patientDO = patientDao.findById(outpatientDO.getPatient());
@ -1541,7 +1540,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                        }
                    }
                    if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                        String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                        String url=baseUrl+"/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                        enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url);
                    }else if (wxId.equalsIgnoreCase("xm_xzzx_wx")){
                        String url="https://ih.xmheart.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
@ -1561,7 +1560,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
            wlyyOutpatientDO.setPayStatus(1);
            WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
            if (businessOrderDO.getStatus()!=null&&businessOrderDO.getStatus()!=1){
            if (businessOrderDO.getStatus()!=null&&businessOrderDO.getStatus()==0){
                //发送企业模板消息给医生
                BasePatientDO patientDO = new BasePatientDO();
                patientDO = patientDao.findById(outpatientDO.getPatient());
@ -1587,7 +1586,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    }
                }
                if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                    String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                    String url=baseUrl+"/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
                    enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url);
                }else if (wxId.equalsIgnoreCase("xm_xzzx_wx")){
                    String url="https://ih.xmheart.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java

@ -73,7 +73,7 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
    @Autowired
    private ObjectMapper objectMapper;
    
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired

+ 23 - 3
business/base-service/src/main/java/com/yihu/jw/wechat/enterprise/EnterpriseService.java

@ -7,12 +7,15 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.enterprise.WxEnterpriseDO;
import com.yihu.jw.entity.hospital.enterprise.WxEnterpriseTokenDO;
import com.yihu.jw.entity.hospital.enterprise.WxEnterpriseUserDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.wechat.enterprise.dao.WxEnterpriseDao;
import com.yihu.jw.wechat.enterprise.dao.WxEnterpriseTokenDao;
import com.yihu.jw.wechat.enterprise.dao.WxEnterpriseUserDao;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -47,6 +50,8 @@ public class EnterpriseService {
    private WxEnterpriseDao wxEnterpriseDao;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private WlyyHttpLogDao wlyyHttpLogDao;
    public String getToken(String enterpriseId)throws Exception{
@ -169,15 +174,30 @@ public class EnterpriseService {
        }
        return "";
    }
    public String sendTWMesByDoctor(String enterpriseId,String doctor,String title,String description,String url)throws Exception{
        BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctor);
        String res = "";
        if(baseDoctorDO!=null&&StringUtils.isNotBlank(baseDoctorDO.getMobile())){
            WxEnterpriseUserDO user = wxEnterpriseUserDao.findByEnterpriseIdAndMobile(enterpriseId,baseDoctorDO.getMobile());
            if(user!=null){
                return sendTWMes(enterpriseId,user.getUserid(),title,description,url);
                res =sendTWMes(enterpriseId,user.getUserid(),title,description,url);
                try {
                    if (StringUtils.isNoneBlank(url)){
                        String outPatientId = url.substring(url.lastIndexOf("=")+1,url.length());
                        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
                        wlyyHttpLogDO.setDoctor(doctor);
                        wlyyHttpLogDO.setRequest(url);
                        wlyyHttpLogDO.setName(title);
                        wlyyHttpLogDO.setCode(outPatientId);
                        wlyyHttpLogDO.setRequest("enterpriseId:"+enterpriseId+",doctor:"+doctor+",url:"+url);
                        wlyyHttpLogDO.setResponse(res);
                        wlyyHttpLogDao.save(wlyyHttpLogDO);
                    }
                }catch (Exception e){
                    e.printStackTrace();
                }
                return res;
            }
        }
        return "";

+ 5 - 2
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -16,6 +16,7 @@ import com.yihu.jw.es.util.SaveModel;
import com.yihu.jw.evaluate.score.service.BaseEvaluateScoreService;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -55,6 +56,8 @@ public class StatisticsEsService {
    private BaseCityDao cityDao;
    @Autowired
    private BaseEvaluateScoreService baseEvaluateScoreService;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Value("${wechat.id}")
    private String wxId;
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
@ -1265,8 +1268,8 @@ public class StatisticsEsService {
        }else if (flag ==2) {
            List<SaveModel> saveModels = elasticsearchUtil.findDateQuotaLevel0(startDate, endDate, area, level, index, SaveModel.timeLevel_ZL, null, "6");
            String deptSql = "select hd.CODE as \"CODE\",hd.NAME as \"NAME\" from DICT_HOSPITAL_DEPT hd where hd.ORG_CODE ='" + area + "' and CONSULT_DEPT_FLAG=1";
            List<Map<String, Object>> mapList = jdbcTemplate.queryForList(deptSql);
            String deptSql = "select hd.CODE as \"code\",hd.NAME as \"name\" from DICT_HOSPITAL_DEPT hd where hd.ORG_CODE ='" + area + "' and hd.CONSULT_DEPT_FLAG=1";
            List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(deptSql);
            List<JSONObject> result = new ArrayList<>();
            for (SaveModel saveModel : saveModels) {
                List<BaseDoctorHospitalDO> baseDoctorHospitalDOS = doctorHospitalDao.findByDoctorCode(saveModel.getDoctor());

+ 8 - 13
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -4505,10 +4505,8 @@ public class ImService {
				"  t.name as \"name\"," +
				"  t.idcard as \"idcard\"," +
				"  t.mobile as \"mobile\"," +
				"  op.doctor as \"doctor\"," +
				"  op.doctor_name as \"doctorName\"," +
				"  op.outpatient_type as \"outpatientType\"" +
				" from base_patient t left join wlyy_outpatient op " +
				"  op.doctor as \"doctor\"" +
				" from wlyy_outpatient op left join base_patient t " +
				" on t.id = op.patient where t.del ='1' and op.status!= -1";
		if (org.apache.commons.lang3.StringUtils.isNoneBlank(doctor)){
			sql+=" and op.doctor = '"+doctor+"'";
@ -4546,19 +4544,17 @@ public class ImService {
		return list;
	}
	@Transactional(readOnly = true)
	public List<Map<String,Object>>  findRecordCountByDoctor(String doctor,
	public Map<String,Object>  findRecordCountByDoctor(String doctor,
														String type, String patientIdCard,String patientName) {
		String[] outpatientType = type.split(",");
		List<Map<String,Object>> resultList = new ArrayList<>();
		Map map = new HashMap();
		for (int i=0;i<outpatientType.length;i++){
			String  sql = "select DISTINCT t.id as \"id\"," +
					"  t.name as \"name\"," +
					"  t.idcard as \"idcard\"," +
					"  t.mobile as \"mobile\"," +
					"  op.doctor as \"doctor\"," +
					"  op.doctor_name as \"doctorName\"," +
					"  op.outpatient_type as \"outpatientType\"" +
					" from base_patient t left join wlyy_outpatient op " +
					"  op.doctor as \"doctor\"" +
					" from wlyy_outpatient op left join  base_patient t " +
					" on t.id = op.patient where t.del ='1' and op.status!= -1";
			if (org.apache.commons.lang3.StringUtils.isNoneBlank(doctor)){
				sql+=" and op.doctor = '"+doctor+"'";
@ -4571,7 +4567,7 @@ public class ImService {
			}
			//咨询类型
			String mapKey = "";
			Map map = new HashMap();
			if(!StringUtils.isEmpty(outpatientType[i])){
				if (outpatientType[i].equalsIgnoreCase("1")){
					sql +=" AND  op.outpatient_type = 1";
@ -4590,11 +4586,10 @@ public class ImService {
				List<Map<String,Object>>  list = hibenateUtils.createSQLQuery(sql);
				map.put(mapKey,list==null?0:list.size());
			}
			resultList.add(map);
		}
		return resultList;
		return map;
	}
}

+ 83 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/common/DictDietDO.java

@ -0,0 +1,83 @@
package com.yihu.jw.entity.care.common;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/8
 * @Description: 饮食字典
 */
@Entity
@Table(name="dict_diet")
public class DictDietDO extends UuidIdentityEntity {
    /**
     * '食物名称'
     */
    private String name;
    /**
     * '食物分类'
     */
    private String type;
    private String typeName;
    /**
     *'热量(千卡)'
     */
    private String heat;
    /**
     *'可食部分(克)'
     */
    private String ediblePart;
    @Column(name = "name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name = "type")
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    @Transient
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    @Column(name = "heat")
    public String getHeat() {
        return heat;
    }
    public void setHeat(String heat) {
        this.heat = heat;
    }
    @Column(name = "edible_part")
    public String getEdiblePart() {
        return ediblePart;
    }
    public void setEdiblePart(String ediblePart) {
        this.ediblePart = ediblePart;
    }
}

+ 9 - 2
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -493,7 +493,10 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                        }
                );
            }
        } else if ("6".equals(loginType)) {
        }else if("6".equals(loginType)) {
            //第三方登陆
            users = this.getJdbcTemplate().query(DEFAULT_PATIENT_DETAILS_STATEMENT, new BeanPropertyRowMapper(WlyyUserDetails.class), username, username);
        }else if ("7".equals(loginType)) {
            String data[] = username.split(":");
            String patientId = data[0];
            String familyPatientId = data[2];
@ -669,7 +672,11 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
            //更新登录时间
            this.getJdbcTemplate().update("update base_patient p set p.login_failure_count = 0, p.login_date = ? where p.mobile = ? or p.idcard = ?", new Date(), username, username);
            users = this.getJdbcTemplate().query(DEFAULT_PATIENT_DETAILS_STATEMENT, new BeanPropertyRowMapper(WlyyUserSimple.class), username,username);
        } else if ("6".equals(loginType)) {
        }else if("6".equals(loginType)) {
            //第三方登陆
            this.getJdbcTemplate().update("update base_patient p set p.login_failure_count = 0, p.login_date = ? where p.mobile = ? or p.idcard = ?", new Date(), username, username);
            users = this.getJdbcTemplate().query(DEFAULT_PATIENT_DETAILS_STATEMENT, new BeanPropertyRowMapper(WlyyUserSimple.class), username,username);
        } else if ("7".equals(loginType)) {
            //更新登录时间
            this.getJdbcTemplate().update("update base_patient p set p.login_failure_count = 0, p.login_date = ? where p.mobile = ? or p.idcard = ?", new Date(), username, username);
            users = this.getJdbcTemplate().query(DEFAULT_PATIENT_DETAILS_STATEMENT, new BeanPropertyRowMapper(WlyyUserSimple.class), username, username);

+ 3 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/dao/OauthRsaKeyDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.security.dao;
import com.yihu.jw.entity.auth.OauthRsaKeyDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
@ -11,5 +12,6 @@ import java.util.List;
 */
public interface OauthRsaKeyDao extends PagingAndSortingRepository<OauthRsaKeyDO, String>, JpaSpecificationExecutor<OauthRsaKeyDO> {
    List<OauthRsaKeyDO> findByCodeAndAppId(String Code,String appId);
    @Query("from OauthRsaKeyDO where code=?1 and appId=?2")
    List<OauthRsaKeyDO> findByCodeAndAppId(String code,String appId);
}

+ 73 - 5
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -26,10 +26,7 @@ import com.yihu.jw.security.oauth2.core.redis.WlyyRedisVerifyCodeService;
import com.yihu.jw.security.oauth2.provider.WlyyTokenGranter;
import com.yihu.jw.security.oauth2.provider.error.WlyyOAuth2ExceptionTranslator;
import com.yihu.jw.security.service.*;
import com.yihu.jw.security.utils.AES;
import com.yihu.jw.security.utils.DateUtil;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.jw.security.utils.SerializeUtil;
import com.yihu.jw.security.utils.*;
import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.sms.service.ZBSmsService;
import com.yihu.jw.sms.service.ZhongShanSMSService;
@ -174,7 +171,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
     *                    username 用户名/手机/身份证号
     *                    key 图形验证码键值
     *                    text 用户输入的图形验证码
     *                    login_type 用户类型 1或默认为user,2:医生登录,3:患者登录,4:第三方同步账号登录,5.易联众居民健康卡授权登录 6医养项目家人登录
     *                    login_type 用户类型 1或默认为user,2:医生登录,3:患者登录,4:第三方同步账号登录,5.易联众居民健康卡授权登录
     *                    6医联康登录 7医养项目家人登录
     * @param httpSession
     * @return
     * @throws Exception
@ -1191,6 +1189,76 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    }
    /**
     * 医联康护授权登录
     * @param authCode
     * @param client_id
     * @return
     */
    @RequestMapping(value = "/oauth/ylkhLogin", method = RequestMethod.POST)
    public ObjEnvelop getYlkhDecrypt(String authCode,String client_id) {
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id is null");
        }
        try {
            logger.info("authCode :"+authCode);
            //固定秘钥解密
            String key = "46A61629A19AE04C";
            String result = AesEncryptUtils.decrypt(authCode,key);
            logger.info("wjwLogin :"+result);
            BasePatientDO patientDO = oauthWjwConfigService.savePatient(result);
            if(patientDO == null){
                return ObjEnvelop.getError("授权登录失败!");
            }
            ClientDetails authenticatedClient = clientDetailsService.loadClientByClientId(client_id);
            Map<String, String> parameters = new HashedMap();
            parameters.put("username",patientDO.getIdcard());
            parameters.put("grant_type", "ihealthCode");
            parameters.put("login_type","4");
            TokenRequest tokenRequest = oAuth2RequestFactory.createTokenRequest(parameters, authenticatedClient);
            if (authenticatedClient != null) {
                oAuth2RequestValidator.validateScope(tokenRequest, authenticatedClient);
            }
            OAuth2AccessToken token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
            if (token == null) {
                throw new UnsupportedGrantTypeException("Unsupported grant type: " + tokenRequest.getGrantType());
            }
            WlyyUserSimple wlyyUserSimple = userDetailsService.authSuccess(parameters.get("username"));
            wlyyUserSimple.setAccessToken(token.getValue());
            wlyyUserSimple.setTokenType(token.getTokenType());
            wlyyUserSimple.setExpiresIn(token.getExpiresIn());
            wlyyUserSimple.setRefreshToken(token.getRefreshToken().getValue());
            wlyyUserSimple.setUser(parameters.get("username"));
            String loginType = parameters.get("login_type");
            BaseLoginLogDO baseLoginLogDO = new BaseLoginLogDO();
            userDetailsService.setRolePhth(loginType, token, wlyyUserSimple.getId(), redisTemplate);
            baseLoginLogDO.setUserId(wlyyUserSimple.getId());
            baseLoginLogDO.setCreateTime(new Date());
            String userAgent = JSONObject.toJSONString(wlyyUserSimple);
            baseLoginLogDO.setUserAgent(userAgent);
            baseLoginLogDO.setLoginType(loginType);
            baseLoginLogService.save(baseLoginLogDO);
            return ObjEnvelop.getSuccess("success",wlyyUserSimple);
        }catch (Exception e){
            logger.error(e);
        }
        return ObjEnvelop.getError("登录失败!");
    }
//        /**
//         * 获取易联众授权码
//         * @return

ファイルの差分が大きいため隠しています
+ 25 - 18
server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthSsoService.java


+ 37 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthWjwConfigService.java

@ -3,7 +3,9 @@ package com.yihu.jw.security.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.security.dao.patient.WlyyPatientFamilyMemberDao;
import com.yihu.jw.security.utils.AES;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.utils.security.MD5;
@ -32,6 +34,8 @@ public class OauthWjwConfigService {
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private WlyyPatientFamilyMemberDao familyMemberDao;
    public BasePatientDO savePatient(String data)throws Exception{
        logger.info("savePatient :"+data);
@ -52,7 +56,24 @@ public class OauthWjwConfigService {
            if(StringUtils.isNotBlank(userIdNo)){
                BasePatientDO basePatientDO = basePatientDao.findByIdcardAndDel(userIdNo,"1");
                logger.info("12312321321===="+userIdNo);
                if(basePatientDO!=null){
                    WlyyPatientFamilyMemberDO basePatientFamilyMemberDO = familyMemberDao.findFamilyMemberByPatientAndRelationCode(basePatientDO.getId(),"7");
                    if (basePatientFamilyMemberDO==null){
                        basePatientFamilyMemberDO = new WlyyPatientFamilyMemberDO();
                        basePatientFamilyMemberDO.setPatient(basePatientDO.getId());
                        basePatientFamilyMemberDO.setFamilyRelation("7");
                        basePatientFamilyMemberDO.setFamilyRelationName("自己");
                        basePatientFamilyMemberDO.setCardType("身份证");
                        basePatientFamilyMemberDO.setCardNo(basePatientDO.getIdcard());
                        basePatientFamilyMemberDO.setCreateTime(new Date());
                        basePatientFamilyMemberDO.setUpdateTime(new Date());
                        basePatientFamilyMemberDO.setIsAuthorize(1);
                        basePatientFamilyMemberDO.setIsDel(1);
                        basePatientFamilyMemberDO.setFamilyMember(basePatientDO.getId());
                        familyMemberDao.save(basePatientFamilyMemberDO);
                    }
                    logger.info("==================");
                    return basePatientDO;
                }
@ -75,7 +96,22 @@ public class OauthWjwConfigService {
                patient.setBirthday(IdCardUtil.getBirthdayForIdcard(userIdNo));
                patient.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(userIdNo)));
                basePatientDao.save(patient);
                patient = basePatientDao.save(patient);
                WlyyPatientFamilyMemberDO basePatientFamilyMemberDO = familyMemberDao.findFamilyMemberByPatientAndRelationCode(patient.getId(),"7");
                if (basePatientFamilyMemberDO==null){
                    basePatientFamilyMemberDO = new WlyyPatientFamilyMemberDO();
                    basePatientFamilyMemberDO.setPatient(patient.getId());
                    basePatientFamilyMemberDO.setFamilyRelation("7");
                    basePatientFamilyMemberDO.setFamilyRelationName("自己");
                    basePatientFamilyMemberDO.setCardType("身份证");
                    basePatientFamilyMemberDO.setCardNo(patient.getIdcard());
                    basePatientFamilyMemberDO.setCreateTime(new Date());
                    basePatientFamilyMemberDO.setUpdateTime(new Date());
                    basePatientFamilyMemberDO.setIsAuthorize(1);
                    basePatientFamilyMemberDO.setIsDel(1);
                    basePatientFamilyMemberDO.setFamilyMember(patient.getId());
                    familyMemberDao.save(basePatientFamilyMemberDO);
                }
                return basePatientDO;

+ 87 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/utils/AesEncryptUtils.java

@ -0,0 +1,87 @@
package com.yihu.jw.security.utils;
import org.apache.commons.codec.binary.Base64;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.spec.SecretKeySpec;
/**
 * 前后端数据传输加密工具类
 * @author monkey
 *
 */
public class AesEncryptUtils {
    //可配置到Constant中,并读取配置文件注入,16位,自己定义
    private static final String KEY = "46A61629A19AE04C";
 
    //参数分别代表 算法名称/加密模式/数据填充方式
    private static final String ALGORITHMSTR = "AES/ECB/PKCS5Padding";
 
    /**
     * 加密
     * @param content 加密的字符串
     * @param encryptKey key值
     * @return
     * @throws Exception
     */
    public static String encrypt(String content, String encryptKey) throws Exception {
        KeyGenerator kgen = KeyGenerator.getInstance("AES");
        kgen.init(128);
        Cipher cipher = Cipher.getInstance(ALGORITHMSTR);
        cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(encryptKey.getBytes(), "AES"));
        byte[] b = cipher.doFinal(content.getBytes("utf-8"));
        // 采用base64算法进行转码,避免出现中文乱码
        return Base64.encodeBase64String(b);
 
    }
 
    /**
     * 解密
     * @param encryptStr 解密的字符串
     * @param decryptKey 解密的key值
     * @return
     * @throws Exception
     */
    public static String decrypt(String encryptStr, String decryptKey) throws Exception {
        KeyGenerator kgen = KeyGenerator.getInstance("AES");
        kgen.init(128);
        Cipher cipher = Cipher.getInstance(ALGORITHMSTR);
        cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(decryptKey.getBytes(), "AES"));
        // 采用base64算法进行转码,避免出现中文乱码
        byte[] encryptBytes = Base64.decodeBase64(encryptStr);
        byte[] decryptBytes = cipher.doFinal(encryptBytes);
        return new String(decryptBytes);
    }
 
    public static String encrypt(String content) throws Exception {
        return encrypt(content, KEY);
    }
    public static String decrypt(String encryptStr) throws Exception {
        return decrypt(encryptStr, KEY);
    }
 
 
    public static void main(String[] args) throws Exception {
        /*Map map=new HashMap<String,String>();
        map.put("idcard","350322198812052545");
        map.put("price","1");
        map.put("type","1");*/
        String content = "{\"data\":{\n" +
                "   \"userName\":\"王志南\",\n" +
                "\"userPhone\":\"17602157210\",\n" +
                "\"userIdNo\":\"350524199405230613\",\n" +
                "\"cardNo\":\"12321321\",\n" +
                "\"cardType\":\"321321321\",\n" +
                "\"userSex\":\"1\",\n" +
                "\"dType\":\"1\"\n" +
                "}}";
        System.out.println("加密前:" + content);
 
        String encrypt = encrypt(content, KEY);
        System.out.println("加密后:" + encrypt);
 
        String decrypt = decrypt(encrypt, KEY);
        System.out.println("解密后:" + decrypt);
    }
}

+ 17 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/dict/DictDietDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.base.dao.dict;
import com.yihu.jw.entity.care.common.DictDietDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/8
 * @Description:
 */
public interface DictDietDao extends PagingAndSortingRepository<DictDietDO, String>, JpaSpecificationExecutor<DictDietDO> {
}

+ 109 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/dict/DictDietEndpoint.java

@ -0,0 +1,109 @@
package com.yihu.jw.base.endpoint.dict;
import com.yihu.jw.base.service.dict.DictDietService;
import com.yihu.jw.entity.care.common.DictDietDO;
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.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/8
 * @Description:
 */
@RestController
@RequestMapping(value = "dictDiet", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "饮食字典管理", description = "饮食字典管理服务接口", tags = {"基础服务 - 饮食字典管理服务接口"})
public class DictDietEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private DictDietService dictDietService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @PostMapping(value = "create")
    @ApiOperation(value = "创建")
    public ObjEnvelop<DictDietDO> create (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        DictDietDO dictDiet = toEntity(jsonData, DictDietDO.class);
        dictDiet = dictDietService.save(dictDiet);
        return success(dictDiet);
    }
    @PostMapping(value = "delete")
    @ApiOperation(value = "删除")
    public Envelop delete(
            @ApiParam(name = "ids", value = "id串,中间用,分隔", required = true)
            @RequestParam(value = "ids") String ids) {
        dictDietService.delete(ids.split(","));
        return success("删除成功");
    }
    @PostMapping(value = "update")
    @ApiOperation(value = "更新")
    public ObjEnvelop<DictDietDO> update (
            @ApiParam(name = "jsonData", value = "Json数据", required = true)
            @RequestBody String jsonData) throws Exception {
        DictDietDO dictDiet = toEntity(jsonData, DictDietDO.class);
        if (null == dictDiet.getId()) {
            return failed("ID不能为空", ObjEnvelop.class);
        }
        dictDiet = dictDietService.save(dictDiet);
        return success(dictDiet);
    }
    @GetMapping(value = "page")
    @ApiOperation(value = "获取分页")
    public PageEnvelop<DictDietDO> page (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
            @RequestParam(value = "page") int page,
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<DictDietDO> dictDiets = dictDietService.search(fields, filters, sorts, page, size);
        List<WlyyHospitalSysDictDO> foods =  wlyyHospitalSysDictDao.findByDictNameNotNull("foodClassification");
        Map<String,String> foodDict = foods.stream().collect(Collectors.toMap(WlyyHospitalSysDictDO::getDictCode,WlyyHospitalSysDictDO::getDictValue));
        dictDiets.stream().forEach(one->{
            one.setTypeName(foodDict.get(one.getType()));
        });
        int count = (int)dictDietService.getCount(filters);
        return success(dictDiets, count, page, size, DictDietDO.class);
    }
    @GetMapping(value = "list")
    @ApiOperation(value = "获取列表")
    public ListEnvelop<DictDietDO> list (
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        List<DictDietDO> dictDiets = dictDietService.search(fields, filters, sorts);
        return success(dictDiets, DictDietDO.class);
    }
    
}

+ 4 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/servicePackage/ServicePackageEndpoint.java

@ -75,19 +75,21 @@ public class ServicePackageEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<ServicePackageDO> servicePackageDOS = servicePackageService.search(fields, filters, sorts, page, size);
        List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findByDictName("serviceType");
        List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS1 = wlyyHospitalSysDictDao.findByDictName("isEffect");
        for (ServicePackageDO servicePackageDO:servicePackageDOS){
            List<ServicePackageItemDO> itemDOList = servicePackageItemDao.findByServicePackageId(servicePackageDO.getId());
            List<String> orgNames = itemDOList.stream().map(p -> p.getOrgName()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
            List<String> teamNames = itemDOList.stream().map(p -> p.getTeamName()).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
            servicePackageDO.setOrgNames(StringUtils.join(orgNames,","));
            servicePackageDO.setTeamNames(StringUtils.join(teamNames,","));
            List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findByDictName("serviceType");
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:wlyyHospitalSysDictDOS){
                if (servicePackageDO.getType().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    servicePackageDO.setTypeName(wlyyHospitalSysDictDO.getDictValue());
                }
            }
            List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS1 = wlyyHospitalSysDictDao.findByDictName("isEffect");
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:wlyyHospitalSysDictDOS1){
                if (servicePackageDO.getDel().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    servicePackageDO.setDelName(wlyyHospitalSysDictDO.getDictValue());

+ 23 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/DictDietService.java

@ -0,0 +1,23 @@
package com.yihu.jw.base.service.dict;
import com.yihu.jw.base.dao.dict.DictDietDao;
import com.yihu.jw.entity.care.common.DictDietDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/8
 * @Description:
 */
@Service
public class DictDietService  extends BaseJpaService<DictDietDO, DictDietDao> {
    @Autowired
    private DictDietDao dictDietDao;
}

+ 44 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorToDoWorkEndpoint.java

@ -0,0 +1,44 @@
package com.yihu.jw.care.endpoint.doctor;
import com.yihu.jw.care.service.message.DoctorMessageService;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/***
 * @ClassName: DoctorToDoWorkEndpoint
 * @Description: 助老员 待办工作
 * @Auther: shi kejing
 * @Date: 2021/5/8 17:42
 */
@RestController
@RequestMapping(value = "doctor/todowork")
@Api(description = "助老员 - 待办工作")
public class DoctorToDoWorkEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private DoctorMessageService doctorMessageService;
    @GetMapping(value = "todowork")
    @ApiOperation("待办工作")
    public ObjEnvelop messages(@ApiParam(name = "serviceSype", value = "工作类型: 生活照料,安防监护=preventLost,紧急救助=emergencyAssistance,生活照料=fifeCare")
                               @RequestParam(value = "serviceSype", required = false) String serviceSype,
                               @ApiParam(name = "id", value = "查看详情需要传id")
                               @RequestParam(value = "id", required = false) String id,
                               @ApiParam(name = "doctor", value = "doctor")
                               @RequestParam(value = "doctor", required = true) String doctor){
        try {
            return ObjEnvelop.getSuccess("查询成功",doctorMessageService.getPreventLost(doctor,id,serviceSype));
        }catch (Exception e){
            e.printStackTrace();
            return ObjEnvelop.getError("查询失败"+e.getMessage());
        }
    }
}

+ 84 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/DoctorMessageService.java

@ -127,4 +127,88 @@ public class DoctorMessageService {
        return result;
    }
    public JSONObject getPreventLost(String doctor,String id,String type){
        JSONObject result = new JSONObject();
        boolean typeNull = StringUtils.isBlank(type);
        if (typeNull||type.equals("preventLost")){//安全监护
            String sql ="select id,patient_name,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') create_time,'preventLost' as service_type from base_security_monitoring_order ord where 1=1 \n" +
                    "and status <>-1 and status<> 7  \n" +
                    "and  EXISTS ( \n" +
                    "SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
                    "base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and \n" +
                    "r.service_package_id = i.service_package_id and  m.team_code = i.team_code  and i.del = 1 and sr.`status`=1  and i.code='preventLost' \n" +
                    "and m.doctor_code = '"+doctor+"' and m.del = '1') \n" +
                    "order by create_time DESC ";
            if (StringUtils.isNotBlank(id)){
                sql = "select * from base_security_monitoring_order ord where 1=1 \n" +
                        "AND id = '"+id+"'\n" +
                        "and status <>-1 and status<> 7  \n" +
                        "and  EXISTS ( \n" +
                        "SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
                        "base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and \n" +
                        "r.service_package_id = i.service_package_id and  m.team_code = i.team_code  and i.del = 1 and sr.`status`=1  and i.code='preventLost' \n" +
                        "and m.doctor_code = '13' and m.del = '1') ";
            }
            List<Map<String,Object>> sqlResult  = jdbcTemplate.queryForList(sql);
            result.put("preventLost",sqlResult);
        }
        if (typeNull||type.equals("emergencyAssistance")){//紧急救助
            String sql ="select id,patient_name,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') create_time,'emergencyAssistance' as service_type from base_emergency_assistance_order ord where 1=1\n" +
                    "and status =1 \n" +
                    "and EXISTS ( \n" +
                    "SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
                    "base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and \n" +
                    "r.service_package_id = i.service_package_id and  m.team_code = i.team_code  and i.del = 1 and sr.`status`=1  and i.code='emergencyAssistance' \n" +
                    "and m.doctor_code = '"+doctor+"' and m.del = '1')\n" +
                    "order by create_time DESC ";
            if (StringUtils.isNotBlank(id)){
                sql = "select * from base_emergency_assistance_order ord where 1=1\n" +
                        "\n" +
                        "AND id = '"+id+"'\n" +
                        "\n" +
                        "and status =1 \n" +
                        "and EXISTS ( \n" +
                        "SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,\n" +
                        "base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and \n" +
                        "r.service_package_id = i.service_package_id and  m.team_code = i.team_code  and i.del = 1 and sr.`status`=1  and i.code='emergencyAssistance' \n" +
                        "and m.doctor_code = '13' and m.del = '1')";
            }
            List<Map<String,Object>> sqlResult  = jdbcTemplate.queryForList(sql);
            result.put("emergencyAssistance",sqlResult);
        }
        if (typeNull||type.equals("fifeCare")){//生活照料
            String sql ="select id,patient_name,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') create_time,'fifeCare' as service_type from base_life_care_order lco where 1=1\n" +
                    "and status =1 \n" +
                    "and EXISTS ( \n" +
                    "SELECT 1 from base_service_package_sign_record sr,base_service_package_record r,\n" +
                    "base_team_member m where lco.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and sr.`status`=1 \n" +
                    "and m.team_code\n" +
                    "and m.doctor_code = '"+doctor+"' and m.del = '1')\n" +
                    "order by create_time DESC ";
            if (StringUtils.isNotBlank(id)){
                sql = "select * from base_life_care_order lco where 1=1\n" +
                        "AND id = '"+id+"'\n" +
                        "and status =1 \n" +
                        "and EXISTS ( \n" +
                        "SELECT 1 from base_service_package_sign_record sr,base_service_package_record r,\n" +
                        "base_team_member m where lco.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and sr.`status`=1 \n" +
                        "and m.doctor_code = '"+doctor+"' and m.del = '1')";
            }
            List<Map<String,Object>> sqlResult  = jdbcTemplate.queryForList(sql);
            result.put("fifeCare",sqlResult);
        }
        return result;
    }
}

+ 2 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/util/ConstantUtil.java

@ -39,6 +39,7 @@ public class ConstantUtil {
     sex 性别
     emergency_assistance_message //紧急救助快速消息
     emergency_assistance_call //紧急救助快速呼叫
     foodClassification 食物分类
     */
    public static final String DICT_ARCHIVETYPE = "archiveType";
    public static final String DICT_ARCHIVESTATUS = "archiveStatus";
@ -56,6 +57,7 @@ public class ConstantUtil {
    public static final String DICT_SEX= "sex";
    public static final String DICT_EMERGENCY_ASSISTANCE_MESSAGE= "emergency_assistance_message";
    public static final String DICT_EMERGENCY_ASSISTANCE_CALL= "emergency_assistance_call";
    public static final String DICT_FOODCLASSIFICATION= "foodClassification";
}

+ 8 - 6
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -603,9 +603,11 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "type", value = "1在线复诊2协同3专家咨询")
			@RequestParam(value = "type",required = false) String type,
            @ApiParam(name = "keyWord", value = "病人姓名")
            @RequestParam(value = "keyWord",required = false) String keyWord
            @RequestParam(value = "keyWord",required = false) String keyWord,
			@ApiParam(name = "patient", value = "病人id")
			@RequestParam(value = "patient",required = false) String patient
            )throws Exception{
		return success("请求成功",prescriptionService.getWaitingForVisitVideoPrescriptionByDoctor(doctor,wxId,type,keyWord));
		return success("请求成功",prescriptionService.getWaitingForVisitVideoPrescriptionByDoctor(doctor,wxId,type,keyWord,patient));
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.pickVideoPrescripitonWaitingPeople)
@ -1277,7 +1279,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	public ObjEnvelop findRecordByDoctor(@ApiParam(name = "doctor", value = "医生id")
											 @RequestParam(value = "doctor",required = false) String doctor,
										 @ApiParam(name = "type", value = "咨询类型")
											 @RequestParam(value = "type",required = true) String type,
											 @RequestParam(value = "type",required = false) String type,
										 @ApiParam(name = "patientName", value = "patientName")
											 @RequestParam(value = "patientName",required = false) String patientName,
										 @ApiParam(name = "idcard", value = "idcard")
@ -1296,13 +1298,13 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	public ObjEnvelop findRecordCountByDoctor(@ApiParam(name = "doctor", value = "医生id")
										 @RequestParam(value = "doctor",required = false) String doctor,
										 @ApiParam(name = "type", value = "咨询类型多个用逗号隔开")
										 @RequestParam(value = "type",required = true) String type,
										 @RequestParam(value = "type",required = false) String type,
										 @ApiParam(name = "patientName", value = "patientName")
										 @RequestParam(value = "patientName",required = false) String patientName,
										 @ApiParam(name = "idcard", value = "idcard")
										 @RequestParam(value = "idcard",required = false) String idcard)throws Exception {
		List<Map<String,Object>> list = imService.findRecordCountByDoctor(doctor,type,idcard,patientName);
		return ObjEnvelop.getSuccess("操作成功",list);
		return ObjEnvelop.getSuccess("操作成功",imService.findRecordCountByDoctor(doctor,type,idcard,patientName));
	}
}

+ 9 - 9
svr/svr-internet-hospital/src/main/resources/wechat/weixin_menu.txt

@ -5,7 +5,7 @@
            "sub_button":[
                {
                    "type":"miniprogram",
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FzsIndex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect",
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fwww.yankehao.com%2Fims-wx%2F%23%2FzsIndex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect",
                    "appid":"wx5329829ab3d77bc2",
                    "pagepath":"pages/patient/index",
                    "name":"互联网医院"
@ -23,27 +23,27 @@
                {
                    "type":"view",
                    "name":"核酸预约申请",
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3a%2f%2fintel.yanketong.com%2fims-wx%2f%23%2fpersonal%2ffamilyMember%2findex%3ftype%3dnucleicTest&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3a%2f%2fwww.yankehao.com%2fims-wx%2f%23%2fpersonal%2ffamilyMember%2findex%3ftype%3dnucleicTest&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                },
                {
                    "type":"view",
                    "name":"预约挂号",
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2Fappointment%2FhospitalList&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fwww.yankehao.com%2Fims-wx%2F%23%2Fappointment%2FhospitalList&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                },
                {
                    "type":"view",
                    "name":"充值缴费",
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FmedicalCard%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fwww.yankehao.com%2Fims-wx%2F%23%2FmedicalCard%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                },
                {
                    "type":"view",
                    "name":"专家咨询",
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FnDocList%3Fzjzx%3D2&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fwww.yankehao.com%2Fims-wx%2F%23%2FnDocList%3Fzjzx%3D2&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                },
                {
                    "type":"view",
                    "name":"在线复诊",
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FnDocList%3FisFz%3D1&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fwww.yankehao.com%2Fims-wx%2F%23%2FnDocList%3FisFz%3D1&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                }
            ]
        },
@ -53,7 +53,7 @@
                {
                    "type":"view",
                    "name":"个人中心",
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2Fpersonal%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fwww.yankehao.com%2Fims-wx%2F%23%2Fpersonal%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                },
                {
                    "type":"view",
@ -63,12 +63,12 @@
                {
                    "type":"view",
                    "name":"报告查询",
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FonlineCheck%2Findex&response_type=code&scope=snsapi_base&state=1#wechat_redirect"
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fwww.yankehao.com%2Fims-wx%2F%23%2FonlineCheck%2Findex&response_type=code&scope=snsapi_base&state=1#wechat_redirect"
                },
                {
                    "type":"view",
                    "name":"家庭成员管理",
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FfamilyControl%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fwww.yankehao.com%2Fims-wx%2F%23%2FfamilyControl%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                }
            ]
        }