Parcourir la source

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

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/doctor/dao/DoctorWorkTimeDao.java
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
#	gateway/ag-basic/src/main/resources/bootstrap.yml
#	svr/svr-internet-hospital/src/main/resources/application.yml
wangzhinan il y a 4 ans
Parent
commit
e5a3e26506

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

@ -293,6 +293,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            BasePatientDO patientDO = basePatientDao.findById(patient);
            BasePatientDO patientDO = basePatientDao.findById(patient);
            outpatientVO.setSex(patientDO.getSex() + "");
            outpatientVO.setSex(patientDO.getSex() + "");
            outpatientVO.setBirthday(patientDO.getBirthday());
            outpatientVO.setBirthday(patientDO.getBirthday());
            outpatientVO.setPatient(patientDO.getIdcard());
            return outpatientVO;
            return outpatientVO;
        }
        }
        return null;
        return null;
@ -3167,7 +3168,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
//                Set<String> datelist = new HashSet<>();
//                Set<String> datelist = new HashSet<>();
                HashMap<String, List<Map<String, Object>>> waitinglist = new HashMap<>();
               /* HashMap<String, List<Map<String, Object>>> waitinglist = new HashMap<>();
                if (scoreList != null && scoreList.size() > 0) {
                if (scoreList != null && scoreList.size() > 0) {
                    for (Map<String, Object> scorepatient : scoreList) {
                    for (Map<String, Object> scorepatient : scoreList) {
@ -3185,7 +3186,34 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            waitinglist.put(id, _cu);
                            waitinglist.put(id, _cu);
                        }
                        }
                    }
                    }
                }*/
                List<Map<String,Object>> waitinglist = new ArrayList<>();
                if (scoreList != null && scoreList.size() > 0) {
                    List<String> stringList = new ArrayList<>();
                    for (Map<String, Object> scorepatient : scoreList) {
                        String id = (String) scorepatient.get("id");
                        if (id == null) {
                            continue;
                        }
                        if (!stringList.contains(id)){
                            stringList.add(id);
                        }
                    }
                    for (String str:stringList){
                        com.alibaba.fastjson.JSONArray array = new com.alibaba.fastjson.JSONArray();
                        Map<String,Object> map = new HashedMap();
                        for (Map<String, Object> scorepatient : scoreList){
                            String id = (String) scorepatient.get("id");
                            if (id!=null&&str.equalsIgnoreCase(id)){
                                array.add(scorepatient);
                            }
                        }
                        map.put(str,array);
                        waitinglist.add(map);
                    }
                }
                }
                rs.put("scoreList", waitinglist);
                rs.put("scoreList", waitinglist);
            } else {
            } else {
                rs.put("scoreList", null);
                rs.put("scoreList", null);
@ -5682,6 +5710,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                room.setDeptName(outpatientDO.getDeptName());
                room.setDeptName(outpatientDO.getDeptName());
                room.setDoctor(outpatientDO.getDoctor());
                room.setDoctor(outpatientDO.getDoctor());
                room.setDoctorName(outpatientDO.getDoctorName());
                room.setDoctorName(outpatientDO.getDoctorName());
                room.setConsultType(Integer.parseInt(outpatientDO.getType()));
                room.setChargeType(chargeType);
                room.setChargeType(chargeType);
            }
            }
            hospitalWaitingRoomDao.save(roomDOs);
            hospitalWaitingRoomDao.save(roomDOs);

+ 18 - 2
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -320,7 +320,7 @@ public class ImService {
				"AND a.patient= '" +patient+"' "+
				"AND a.patient= '" +patient+"' "+
				"AND b.to_doctor='" +doctor+"' "+
				"AND b.to_doctor='" +doctor+"' "+
				"AND a.del='1' " +
				"AND a.del='1' " +
				"AND (a.type<> 9 and a.type<> 16)" +
				"AND (a.type<> 9 and a.type<> 16 and a.type<>12 )" +
				"AND a.status=0";
				"AND a.status=0";
		
		
		List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(totalSql);
		List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(totalSql);
@ -2633,7 +2633,23 @@ public class ImService {
			
			
		}
		}
	}
	}
	
	public Long doctorConsults(String doctorCode){
		String sql=  "SELECT count(1) AS \"total\"  " +
					" FROM wlyy_consult a," +
					"wlyy_consult_team b," +
					"base_patient d  " +
					" WHERE a.id=b.consult " +
					" AND b.patient=d.id AND b.doctor='" + doctorCode + "' AND b.type in (1,15) and b.status = 0 and a.pay_status=1 " +
					" ORDER BY a.czrq desc ";
		List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
		Long consultCount = 0l;
		if (rstotal != null && rstotal.size() > 0) {
			consultCount = Long.parseLong(rstotal.get(0).get("total").toString());
		}
		return consultCount;
	}
	/**
	/**
	 * 医生待办事项列表
	 * 医生待办事项列表
	 * @param doctorCode
	 * @param doctorCode

+ 3 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -978,6 +978,9 @@ public class BaseHospitalRequestMapping {
    
    
        //医生端:进行中的专家咨询数量
        //医生端:进行中的专家咨询数量
        public static final String doctorSpecialistConsultCount="doctorSpecialistConsultCount";
        public static final String doctorSpecialistConsultCount="doctorSpecialistConsultCount";
        //医生端:进行中的专家咨询人数
        public static final String doctorSpecialistConsultCountNew="doctorSpecialistConsultCountNew";
    
    
        //医生端:图文复诊、视频复诊咨询数量、协同门诊候诊数量
        //医生端:图文复诊、视频复诊咨询数量、协同门诊候诊数量
        public static final String doctorReviewConsultCount="doctorReviewConsultCount";
        public static final String doctorReviewConsultCount="doctorReviewConsultCount";

+ 3 - 3
server/svr-authentication/pom.xml

@ -75,11 +75,11 @@
            <groupId>org.springframework.boot</groupId>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        </dependency>
       <!-- <dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <artifactId>HikariCP</artifactId>
            &lt;!&ndash; <scope>runtime</scope> &ndash;&gt;
        </dependency>-->
            <!-- <scope>runtime</scope> -->
        </dependency>
        <!-- Redis  -->
        <!-- Redis  -->
        <dependency>
        <dependency>

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

@ -199,7 +199,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        if (null == authenticatedClient) {
        if (null == authenticatedClient) {
            throw new InvalidRequestException("client_id");
            throw new InvalidRequestException("client_id");
        }
        }
        logger.info("login:登录进入4");
        logger.info("login:登录进入4"+authenticatedClient.getClientId());
        TokenRequest tokenRequest = oAuth2RequestFactory.createTokenRequest(parameters, authenticatedClient);
        TokenRequest tokenRequest = oAuth2RequestFactory.createTokenRequest(parameters, authenticatedClient);
        oAuth2RequestValidator.validateScope(tokenRequest, authenticatedClient);
        oAuth2RequestValidator.validateScope(tokenRequest, authenticatedClient);
        OAuth2AccessToken token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
        OAuth2AccessToken token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
@ -209,15 +210,15 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        /*如果是移动端登陆则移除之前的token,
        /*如果是移动端登陆则移除之前的token,
        在网关处通过HTTP状态码告知前端是过期(402)还是账号在别处登陆(403),
        在网关处通过HTTP状态码告知前端是过期(402)还是账号在别处登陆(403),
        实现同一账号只能在一处登陆*/
        实现同一账号只能在一处登陆*/
//        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
//        if (request.getHeader("login-device") != null && request.getHeader("login-device").equals("mobile")) {
//            tokenStore.removeAccessToken(token.getValue());
//            tokenStore.removeRefreshToken(token.getRefreshToken().getValue());
//            token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
//        }
//        if (token == null) {
//            throw new UnsupportedGrantTypeException("Unsupported grant type: " + tokenRequest.getGrantType());
//        }
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        if (request.getHeader("login-device") != null && (request.getHeader("login-device").equalsIgnoreCase("mobile")||request.getHeader("login-device").equalsIgnoreCase("pc"))) {
            tokenStore.removeAccessToken(token.getValue());
            tokenStore.removeRefreshToken(token.getRefreshToken().getValue());
            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 wlyyUserSimple = userDetailsService.authSuccess(parameters.get("username"));
        wlyyUserSimple.setAccessToken(token.getValue());
        wlyyUserSimple.setAccessToken(token.getValue());
        wlyyUserSimple.setTokenType(token.getTokenType());
        wlyyUserSimple.setTokenType(token.getTokenType());
@ -650,7 +651,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
            在网关处通过HTTP状态码告知前端是过期 还是账号在别处登陆
            在网关处通过HTTP状态码告知前端是过期 还是账号在别处登陆
            实现同一账号只能在一处登陆*/
            实现同一账号只能在一处登陆*/
            HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
            HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
            if (request.getHeader("login-device") != null && request.getHeader("login-device").equals("mobile")) {
            if (request.getHeader("login-device") != null && (request.getHeader("login-device").equalsIgnoreCase("mobile")||request.getHeader("login-device").equalsIgnoreCase("pc"))) {
                tokenStore.removeAccessToken(token.getValue());
                tokenStore.removeAccessToken(token.getValue());
                tokenStore.removeRefreshToken(token.getRefreshToken().getValue());
                tokenStore.removeRefreshToken(token.getRefreshToken().getValue());
                token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
                token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
@ -1511,15 +1512,15 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        /*如果是移动端登陆则移除之前的token,
        /*如果是移动端登陆则移除之前的token,
        在网关处通过HTTP状态码告知前端是过期(402)还是账号在别处登陆(403),
        在网关处通过HTTP状态码告知前端是过期(402)还是账号在别处登陆(403),
        实现同一账号只能在一处登陆*/
        实现同一账号只能在一处登陆*/
//        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
//        if (request.getHeader("login-device") != null && request.getHeader("login-device").equals("mobile")) {
//            tokenStore.removeAccessToken(token.getValue());
//            tokenStore.removeRefreshToken(token.getRefreshToken().getValue());
//            token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
//        }
//        if (token == null) {
//            throw new UnsupportedGrantTypeException("Unsupported grant type: " + tokenRequest.getGrantType());
//        }
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        if (request.getHeader("login-device") != null && (request.getHeader("login-device").equalsIgnoreCase("mobile")||request.getHeader("login-device").equalsIgnoreCase("pc"))) {
            tokenStore.removeAccessToken(token.getValue());
            tokenStore.removeRefreshToken(token.getRefreshToken().getValue());
            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 wlyyUserSimple = userDetailsService.authSuccess(parameters.get("username"));
        wlyyUserSimple.setAccessToken(token.getValue());
        wlyyUserSimple.setAccessToken(token.getValue());
        wlyyUserSimple.setTokenType(token.getTokenType());
        wlyyUserSimple.setTokenType(token.getTokenType());

+ 2 - 0
server/svr-authentication/src/main/resources/application.yml

@ -4,6 +4,8 @@ server:
spring:
spring:
  datasource:
  datasource:
  hikari:
    registerMbeans: true
    driver-class-name: com.mysql.jdbc.Driver
    driver-class-name: com.mysql.jdbc.Driver
    max-active: 100
    max-active: 100
    max-idle: 100 #最大空闲连接
    max-idle: 100 #最大空闲连接

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

@ -397,9 +397,15 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		if (data != null) {
		if (data != null) {
			for(Map<String,Object> consult :data){
			for(Map<String,Object> consult :data){
				//如果是协同门诊,多返回全科医生的详细信息
				//如果是协同门诊,多返回全科医生的详细信息
				if(13 == Integer.parseInt(consult.get("type").toString()) && StringUtils.isNoneBlank((String)consult.get("generalDoctor"))){
				if(12 == Integer.parseInt(consult.get("type").toString()) && StringUtils.isNoneBlank((String)consult.get("generalDoctor"))){
					BaseDoctorDO baseDoctorDO = baseDoctorDao.findById((String)consult.get("generalDoctor"));
					BaseDoctorDO baseDoctorDO = baseDoctorDao.findById((String)consult.get("generalDoctor"));
					List<BaseDoctorHospitalDO> baseDoctorHospitalDOList = baseDoctorHospitalDao.findByDoctorCode((String)consult.get("generalDoctor"));
					consult.put("generalDoctorName", baseDoctorDO.getName());
					consult.put("generalDoctorName", baseDoctorDO.getName());
					if (baseDoctorHospitalDOList!=null&&baseDoctorHospitalDOList.size()!=0){
						BaseDoctorHospitalDO baseDoctorHospitalDO = baseDoctorHospitalDOList.get(0);
						consult.put("generalOrgName",baseDoctorHospitalDO.getOrgName());
						consult.put("generalDeptName",baseDoctorHospitalDO.getDeptName());
					}
				}
				}
			}
			}
@ -527,6 +533,16 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		result.put("zjCount",zjCount+zjqzCount);//专家咨询数量
		result.put("zjCount",zjCount+zjqzCount);//专家咨询数量
		return success("请求成功",result);
		return success("请求成功",result);
	}
	}
	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.doctorSpecialistConsultCountNew)
	@ApiOperation(value = "医生端:进行中的专家咨询数量", notes = "医生端:进行中的专家咨询数量")
	public Envelop doctorSpecialistConsultCountNew(@ApiParam(name = "doctor", value = "医生CODE")
												@RequestParam(value = "doctor",required = true) String doctor){
		//专家咨询
		JSONObject result = new JSONObject();
		result.put("zjCount",imService.doctorConsults(doctor));//专家咨询数量
		return success("请求成功",result);
	}
	
	
	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.doctorReviewConsultCount)
	@GetMapping(value = BaseHospitalRequestMapping.DodtorIM.doctorReviewConsultCount)
	@ApiOperation(value = "医生端:图文复诊、视频复诊咨询数量、协同门诊候诊数量", notes = "医生端:图文复诊、视频复诊咨询数量、协同门诊候诊数量")
	@ApiOperation(value = "医生端:图文复诊、视频复诊咨询数量、协同门诊候诊数量", notes = "医生端:图文复诊、视频复诊咨询数量、协同门诊候诊数量")