소스 검색

眼科医生 忘记修改密码

wangjun 4 년 전
부모
커밋
18e3570faf

+ 11 - 2
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java

@ -10,9 +10,11 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.doctor.DoctorSpecialDiseaseDo;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.message.BaseBannerDoctorDO;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -65,6 +67,8 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
    @Autowired
    private HttpClientUtil httpClientUtil;
    private static String yktUrl_90 = "http://www.yanketong.com:90/";
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    /**
     * 查询医生信息分页列表.
     * @param city
@ -130,7 +134,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                " a.outpatient_type AS \"outpatientType\", " +
                " a.del AS \"del\", " +
                " b.dept_name AS \"deptName\", " +
                " e.req_fee AS \"money\"," +
                " e.req_fee AS \"money\", " +
                " a.charge_type as \"chargeType\" "+
                " FROM " +
                " base_doctor a " +
@ -333,7 +337,12 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
    }
    public Boolean updateDoctorPw(String id,String pw,String orgPw){
        if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            String res =resetYktPwdByPwd(null,id,pw,orgPw);
            BaseDoctorDO doctorDOs = baseDoctorDao.findById(id);
            DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(id);
            String res = "";
            if (null!=doctorDOs&&null!=doctorMappingDO){
                res =resetYktPwdByPwd(doctorDOs.getVerifyCode(),doctorMappingDO.getMappingCode(),pw,orgPw);
            }
            if (org.apache.commons.lang3.StringUtils.isNoneBlank(res)) {
                com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(res);
                if (object.getString("code").equalsIgnoreCase("10000")) {

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

@ -1780,7 +1780,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //下载银医通
        net.sf.json.JSONObject object1 = entranceService.qutpatientBalance(outpatientDO.getCardNo(), demoFlag);
        logger.info("下载银医通");
        net.sf.json.JSONObject rs = entranceService.BS10111(outpatientDO.getCardNo(), doctorMappingDO.getMappingCode(), outpatientDO.getDept(), null, outpatientDO.getWinNo(), demoFlag);
        String chargeType = null;
        if (StringUtils.isNoneBlank(outpatientDO.getChargeType())){
            if (outpatientDO.getChargeType().equalsIgnoreCase("33")){
                chargeType = outpatientDO.getChargeType();
            }
        }
        net.sf.json.JSONObject rs = entranceService.BS10111(outpatientDO.getCardNo(), doctorMappingDO.getMappingCode(), outpatientDO.getDept(), chargeType, outpatientDO.getWinNo(), demoFlag);
        net.sf.json.JSONObject res = rs.getJSONObject("resquest");
        logger.info("挂号结果 res: " + res.toString());
        String rsCode = res.getString("@RESULT");

+ 4 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -880,8 +880,11 @@ public class YkyyEntranceService {
        return wlyyPrescriptionVOList;
    }
    public String updateYkyyDoctor()throws Exception{
    public String updateYkyyDoctor(String idCard)throws Exception{
        String sql ="select y.code AS \"code\",y.name AS \"name\",y.expertise AS \"expertise\",y.introduce AS \"introduce\",y.mobile AS \"mobile\",y.idCard AS \"idcard\",y.jobtitlecode AS \"jobTitleCode\",y.jobTitleName AS \"jobTitleName\",y.dept AS \"dept\",y.deptName AS \"deptName\" from v_Hlw_Ysxx y where y.idcard is not null";
        if (StringUtils.isNoneBlank(idCard)){
            sql +=" and y.idcard ='"+idCard+"' ";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        HttpResponse response = HttpUtils.doGet(url,params);

+ 18 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/ykyy/service/YkyyService.java

@ -644,4 +644,22 @@ public class YkyyService {
    }
    /**
     * 医生端眼科通登陆
     * @param loginId 账户
     * @param password 密码
     * @return
     */
    public String DoctorLogin(String loginId,String password){
        String response="";
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("loginId",loginId);//账户
        jsonObject.put("password",password);//密码
        String url = "http://www.yanketong.com:90/api/Doctor/DoctorLogin";
        response = httpClientUtil.sendPost(url,jsonObject.toJSONString());
        logger.info("医生端登陆:"+response);
        return response;
    }
}

+ 6 - 1
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -1638,8 +1638,13 @@ public class ImService {
		if(cons.getRelationCode() != null){
			WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(cons.getRelationCode());
			if(wlyyOutpatientDO != null && wlyyOutpatientDO.getId() != null){
				wlyyOutpatientDO.setStatus("3");
				if (wlyyOutpatientDO.getStatus().equalsIgnoreCase("0")){
					wlyyOutpatientDO.setStatus("-1");
				}else {
					wlyyOutpatientDO.setStatus("3");
				}
				outpatientDao.save(wlyyOutpatientDO);
			}
			
			List<WlyyHospitalWaitingRoomDO> wlyyHospitalWaitingRoomDOS = hospitalWaitingRoomDao.findByOutpatientId(cons.getRelationCode());

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

@ -248,6 +248,18 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
     * ca标识
     */
    private Integer caFlag;
    /**
     *身份验证秘钥
     */
    private String verifyCode;
    @Column(name = "verify_code")
    public String getVerifyCode() {
        return verifyCode;
    }
    public void setVerifyCode(String verifyCode) {
        this.verifyCode = verifyCode;
    }
    @Column(name = "popularity")
    public Integer getPopularity() {

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

@ -1382,9 +1382,9 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        return ObjEnvelop.getError("手机号未注册!");
    }
    @RequestMapping(value = "/oauth/findDoctorPw", method = RequestMethod.POST)
    public Envelop findDoctorPw(String mobile,String client_id,String captcha,String pw){
    public Envelop findDoctorPw(String mobile,String client_id,String captcha,String pw) throws Exception{
        if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            String response = ykyyService.resetYktPwd(mobile,pw,captcha);
           String response =  ykyyService.ResetPwd(mobile,pw,captcha);
            if (org.apache.commons.lang3.StringUtils.isNoneBlank(response)){
                JSONObject object = JSONObject.parseObject(response);
                if (object.getString("code").equalsIgnoreCase("10000")){
@ -1393,15 +1393,15 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                    return ObjEnvelop.getSuccess("修改失败!");
                }
            }else {
                return ObjEnvelop.getError("手机号未注册!");
                return ObjEnvelop.getSuccess("修改失败!");
            }
        }else if ("xm_zsyy-wx".equalsIgnoreCase(wechatId)){
        }else if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
            if (wlyyRedisVerifyCodeService.verification(client_id, mobile, captcha)) {
                //验证码正确
            } else {
                return ObjEnvelop.getError("验证码错误!");
            }
            String rs = registerService.updateDoctorPw(mobile,pw);
            String rs = registerService.updateDoctorPw(mobile,pw,wechatId);
            if("ok".equals(rs)){
                return ObjEnvelop.getSuccess("修改成功!");
            }
@ -1651,4 +1651,139 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        }
    }
    /**
     * 登陆
     *
     * @param parameters  不定入参:
     *                    client_id 应用标识
     *                    captcha 验证码
     *                    password 密码
     *                    username 用户名/手机/身份证号
     *                    key 图形验证码键值
     *                    text 用户输入的图形验证码
     *                    login_type 用户类型 1或默认为user,2:医生登录,3:患者登录,4:第三方同步账号登录,5.易联众居民健康卡授权登录
     * @param httpSession
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/oauth/ykDoctorlogin", method = RequestMethod.POST)
    public ResponseEntity<Oauth2Envelop<WlyyUserSimple>> ykDoctorlogin(@RequestParam Map<String, String> parameters, HttpSession httpSession) throws Exception {
        logger.info("login:登录进入1");
        //图形验证码验证
        String key = parameters.get("key");
        String text = parameters.get("text");
        if(org.apache.commons.lang3.StringUtils.isNotBlank(key)&& org.apache.commons.lang3.StringUtils.isNotBlank(text)){
            if(!verifyCaptcha(key,text)){
                throw new ImgCaptchaException("img_captcha error");
            }
        }
        logger.info("login:登录进入2");
        String username = parameters.get("username");
        if (StringUtils.isEmpty(username)) {
            throw new InvalidRequestException("username");
        }
        String client_id = parameters.get("client_id");
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id");
        }
        if (StringUtils.isEmpty(parameters.get("captcha"))) {
            parameters.put("grant_type", "ihealthDcotor");
            //解密密码
            if (parameters.get("password") != null) {
                KeyPair keyPair = (KeyPair) httpSession.getAttribute("privateKey");
                String password = com.yihu.jw.security.utils.RSAUtils.decryptBase64(parameters.get("password"), keyPair);
                String response = ykyyService.DoctorLogin(parameters.get("username"),password);
                if (!StringUtils.isEmpty(response)){
                    JSONObject object = JSONObject.parseObject(response);
                    logger.info("眼科通登陆返回参数:"+object);
                    if (!object.getString("code").equalsIgnoreCase("10000")){
                        WlyyUserSimple userSimple = new WlyyUserSimple();
                        return getFailedResponse(object.getString("message"),-1,userSimple);
                    }else {
                        JSONObject jsonObject = object.getJSONObject("value");
                        if (jsonObject!=null) {
                            String idCard = jsonObject.getString("idCard");
                            String verifyCode = jsonObject.getString("verifyCode");
                            if (idCard==null||idCard==""){
                                logger.info("身份证为空");
                            }else {
                                ykyyService.updateYkyyDoctor(idCard,verifyCode);
                            }
                        }
                    }
                }
                parameters.remove("password");
            } else {
                //第三方同步账号模式登录
                parameters.put("grant_type", "ihealthDcotor");
            }
        } else {
            parameters.put("grant_type", "captcha");
        }
        logger.info("login:登录进入3");
        ClientDetails authenticatedClient = clientDetailsService.loadClientByClientId(client_id);
        if (null == authenticatedClient) {
            throw new InvalidRequestException("client_id");
        }
        logger.info("login:登录进入4"+authenticatedClient.getClientId());
        TokenRequest tokenRequest = oAuth2RequestFactory.createTokenRequest(parameters, authenticatedClient);
        oAuth2RequestValidator.validateScope(tokenRequest, authenticatedClient);
        OAuth2AccessToken token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
        if (token == null) {
            throw new UnsupportedGrantTypeException("Unsupported grant type: " + tokenRequest.getGrantType());
        }
        /*如果是移动端登陆则移除之前的token,
        在网关处通过HTTP状态码告知前端是过期(402)还是账号在别处登陆(403),
        实现同一账号只能在一处登陆*/
        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.setAccessToken(token.getValue());
        wlyyUserSimple.setTokenType(token.getTokenType());
        wlyyUserSimple.setExpiresIn(token.getExpiresIn());
        wlyyUserSimple.setRefreshToken(token.getRefreshToken().getValue());
        wlyyUserSimple.setUser(parameters.get("username"));
        wlyyUserSimple.setState(parameters.get("state"));
        String loginType = parameters.get("login_type");
        String openid = parameters.get("openid");
        String wechatId = parameters.get("wechatId");
        logger.info("login:登录进入7");
        //更新患者openId
        BaseLoginLogDO baseLoginLogDO = new BaseLoginLogDO();
        logger.info("gengxin开始");
        if (!StringUtils.isEmpty(openid) && !"undefined".equalsIgnoreCase(openid) && ("3".equals(loginType)||"4".equalsIgnoreCase(loginType))) {
            baseLoginLogDO.setOpenid(openid);
            logger.info("gengxin进入"+openid);
            userDetailsService.updateOpenId(openid, wlyyUserSimple.getId());
            if (!StringUtils.isEmpty(wechatId)&& !"undefined".equalsIgnoreCase(wechatId)){
                logger.info("gengxin进入"+wechatId);
                userDetailsService.updateOpenIdAndWechatId(openid,wlyyUserSimple.getId(),wechatId);
            }
        }
        if (parameters.get("password") != null) {
            //使用密码登录成功后, 更新失败次数为 0
            userDetailsService.addFailureCount(username, 0);
        }
        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 getResponse(wlyyUserSimple);
    }
}

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

@ -139,7 +139,7 @@ public class RegisterService {
        return true;
    }
    public String updateDoctorPw(String mobile,String pw){
    public String updateDoctorPw(String mobile,String pw,String wxId){
        List<BaseDoctorDO> list = baseDoctorDao.findByMobile(mobile);
        if(list!=null&&list.size()>0){
            for(BaseDoctorDO doctorDO:list){
@ -158,6 +158,7 @@ public class RegisterService {
        return "ok";
    }
    public String updateDoctorMoble(String id,String mobile){
        BaseDoctorDO doctorDO = baseDoctorDao.findOne(id);
        //认证信息设置

+ 210 - 10
server/svr-authentication/src/main/java/com/yihu/jw/security/service/YkyyService.java

@ -1,15 +1,25 @@
package com.yihu.jw.security.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.security.dao.doctor.BaseDoctorDao;
import com.yihu.jw.security.dao.doctor.BaseDoctorHospitalDao;
import com.yihu.jw.security.dao.doctor.BaseDoctorRoleDao;
import com.yihu.jw.security.dao.doctor.DoctorMappingDao;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.idcard.IdCardUtil;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -18,6 +28,10 @@ import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import java.util.Date;
import java.util.List;
import static com.yihu.jw.util.common.PwdUtil.randomString;
/**
 * 眼科医院
@ -38,6 +52,23 @@ public class YkyyService {
    @Autowired
    private BasePatientDao patientDao;
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    @Autowired
    private BaseDoctorRoleDao baseDoctorRoleDao;
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    private final static String orgCode ="350211A5004";
    private final static String orgName ="厦门大学附属厦门眼科中心";
    private final static String url="http://192.168.20.55:10023/ykyy/createSQLQuery";
    private static String yktUrl = "http://www.yanketong.com:133/api/";
@ -118,31 +149,58 @@ public class YkyyService {
     */
    public String getResetCode(String type,String phone) throws  Exception{
        String response="";
        String codeResponse = getVerificationReal(phone,type,"");
        String veryCode = "";
        if (StringUtils.isNoneBlank(codeResponse)){
            JSONObject jsonObject = JSONObject.parseObject(codeResponse);
            if ("1000".equalsIgnoreCase(jsonObject.getString("code"))){
                veryCode =  jsonObject.getString("value");
            }
        }
        String url = yktUrl1+"api/Doctor/GetVerificationCode";
        Map param = new HashMap();
        param.put("loginid",phone);
        param.put("type",type);
        param.put("VerificationReal",veryCode);
        logger.info("请求参数:"+param.toString());
        response = httpClientUtil.httpPost(url,param);
        logger.info("眼科通验证码:"+response);
        return response;
    }
    /**修改眼科通密码信息
    /**获取图形验证码
     *
     * @param tel
     * @param loginid
     * @param type
     * @param IPAddress
     * @return
     */
    public String getVerificationReal(String loginid,String type,String IPAddress) throws  Exception{
        String response="";
        Map map = new HashMap();
        map.put("loginid",loginid);
        map.put("type",type);
        map.put("IPAddress",IPAddress);
        String url = yktUrl1+"api/Share/GetVerificationReal";
        response = httpClientUtil.httpPost(url,map);
        logger.info("修改眼科同密码后的信息:"+response);
        return response;
    }
    /**
     * 忘记密码修改
     * @param loginid
     * @param password
     * @param vercode
     * @return
     */
    public String resetYktPwd(String tel,String password,String vercode){
    public String ResetPwd(String loginid,String password,String verCode) throws  Exception{
        String response="";
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("loginid",tel);
        jsonObject.put("password",password);
        jsonObject.put("verCode",vercode);
        String url = yktUrl1+"api/Doctor/ResetPassword";
        response = httpClientUtil.sendPost(url,jsonObject.toJSONString());
        logger.info("修改眼科同密码后的信息:"+response);
        Map param = new HashMap();
        param.put("loginid",loginid);
        param.put("password",password);
        param.put("verCode",verCode);
        logger.info("请求参数:"+param.toString());
        response = httpClientUtil.httpPost(url,param);
        logger.info("眼科通验证码:"+response);
        return response;
    }
@ -327,4 +385,146 @@ public class YkyyService {
        }
    }
    /**
     * 医生端眼科通登陆
     * @param loginId 账户
     * @param password 密码
     * @return
     */
    public String DoctorLogin(String loginId,String password){
        String response="";
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("loginId",loginId);//账户
        jsonObject.put("password",password);//密码
        String url = "http://www.yanketong.com:90/api/Doctor/DoctorLogin";
        response = httpClientUtil.sendPost(url,jsonObject.toJSONString());
        logger.info("医生端登陆:"+response);
        return response;
    }
    public String updateYkyyDoctor(String idCard,String verifyCode)throws Exception{
        String sql ="select y.code AS \"code\",y.name AS \"name\",y.expertise AS \"expertise\",y.introduce AS \"introduce\",y.mobile AS \"mobile\",y.idCard AS \"idcard\",y.jobtitlecode AS \"jobTitleCode\",y.jobTitleName AS \"jobTitleName\",y.dept AS \"dept\",y.deptName AS \"deptName\" from v_Hlw_Ysxx y where y.idcard is not null";
        sql +=" and y.idcard ='"+idCard+"' ";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            JSONArray array = rs.getJSONArray("detailModelList");
            logger.info("doctor size:"+array.size());
            if(array!=null&&array.size()>0) {
                for (int i = 0; i < array.size(); i++) {
                    JSONObject doctorJson = array.getJSONObject(i);
                    String idcard = doctorJson.getString("idcard");
                    //过滤身份证脏数据
                    if(idcard.length()>=15){
                        BaseDoctorDO doctorDOs = baseDoctorDao.findByIdcard(idcard);
                        if(doctorDOs!=null){
                            BaseDoctorDO doctor = doctorDOs;
                            String salt = randomString(5);
                            String pw = idcard.substring(idcard.length() - 6);
                            doctor.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                            doctor.setSalt(salt);
                            doctor.setJobTitleCode(doctorJson.getString("jobtitlecode"));
                            doctor.setJobTitleName(doctorJson.getString("jobTitleName"));
                            doctor.setVerifyCode(verifyCode);
//                            doctor.setExpertise(doctorJson.getString("expertise"));
//                            doctor.setIntroduce(doctorJson.getString("introduce"));
//                            doctor.setMobile(doctorJson.getString("mobile"));
                            BaseDoctorDO temp = baseDoctorDao.save(doctor);
                            List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByOrgCodeAndDeptCodeAndDoctorCode(orgCode,doctorJson.getString("dept"),doctor.getId());
                            if(hospitalDOs!=null&&hospitalDOs.size()>0){
                                //机构信息部门信息
                                BaseDoctorHospitalDO hospitalDO = hospitalDOs.get(0);
                                hospitalDO.setDeptCode(doctorJson.getString("dept"));
                                hospitalDO.setDeptName(doctorJson.getString("deptName"));
                                hospitalDO.setDel("1");
                                baseDoctorHospitalDao.save(hospitalDO);
                            }
                        }else{
                            //新增医生
                            BaseDoctorDO doctor = new BaseDoctorDO();
                            doctor.setName(doctorJson.getString("name"));
                            doctor.setIdcard(idcard);
                            doctor.setSex(Integer.parseInt(com.yihu.jw.util.common.IdCardUtil.getSexForIdcard_new(idcard)));
                            doctor.setBirthday(com.yihu.jw.util.common.IdCardUtil.getBirthdayForIdcard(idcard));
                            doctor.setProvinceCode("350000");
                            doctor.setProvinceName("福建省");
                            doctor.setTownCode("350203");
                            doctor.setTownName("思明区");
                            doctor.setCityCode("350200");
                            doctor.setCityName("厦门市");
                            doctor.setVerifyCode(verifyCode);
//                            doctor.setExpertise(doctorJson.getString("expertise"));
//                            doctor.setIntroduce(doctorJson.getString("introduce"));
//                            doctor.setMobile(doctorJson.getString("mobile"));
                            //认证信息设置
                            String salt = randomString(5);
                            String pw = idcard.substring(idcard.length() - 6);
                            doctor.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                            doctor.setSalt(salt);
                            doctor.setDel("1");
                            doctor.setEnabled(1);
                            doctor.setLocked(0);
                            doctor.setCreateTime(new Date());
                            doctor.setJobTitleCode(doctorJson.getString("jobtitlecode"));
                            doctor.setJobTitleName(doctorJson.getString("jobTitleName"));
                            BaseDoctorDO temp = baseDoctorDao.save(doctor);
                            //机构信息部门信息
                            BaseDoctorHospitalDO hospitalDO = new BaseDoctorHospitalDO();
                            hospitalDO.setDoctorCode(temp.getId());
                            hospitalDO.setOrgCode(orgCode);
                            hospitalDO.setOrgName(orgName);
                            hospitalDO.setDeptCode(doctorJson.getString("dept"));
                            hospitalDO.setDeptName(doctorJson.getString("deptName"));
                            hospitalDO.setDel("1");
                            baseDoctorHospitalDao.save(hospitalDO);
                            //保存角色
                            BaseDoctorRoleDO role = new BaseDoctorRoleDO();
                            role.setDoctorCode(temp.getId());
                            role.setRoleCode("specialist");
                            baseDoctorRoleDao.save(role);
                            //保存mapping
                            DoctorMappingDO mappingDO = new DoctorMappingDO();
                            mappingDO.setIdcard(idcard);
                            mappingDO.setDoctor(temp.getId());
                            mappingDO.setDoctorName(temp.getName());
                            mappingDO.setOrgCode(orgCode);
                            mappingDO.setOrgName(orgName);
                            mappingDO.setMappingCode(doctorJson.getString("code"));
                            mappingDO.setMappingName(temp.getName());
                            mappingDO.setCreateTime(new Date());
                            doctorMappingDao.save(mappingDO);
                        }
                    }
                }
            }
        }
        return "success";
    }
}

+ 1 - 1
svr/svr-base/src/main/java/com/yihu/jw/base/service/sync/BaseSyncDataService.java

@ -139,7 +139,7 @@ public class BaseSyncDataService extends BaseJpaService<BaseSyncDataDO, BaseSync
                    logger.info("======================同步科室信息失败========================");
                }
                String re = ykyyEntranceService.updateYkyyDoctor();
                String re = ykyyEntranceService.updateYkyyDoctor(null);
                if (re.equalsIgnoreCase("success")){
                    logger.info("======================同步医生信息成功========================");
                }else {

+ 3 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/base/BaseInfoEndpoint.java

@ -186,8 +186,9 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "/updateYkyyDoctor")
    @ApiOperation(value = "同步医生信息", notes = "同步医生信息")
    public Envelop updateYkyyDoctor() throws Exception {
        return success(ykyyEntranceService.updateYkyyDoctor());
    public Envelop updateYkyyDoctor(@ApiParam(name = "idcard", value = "医生身份证")
                                        @RequestParam(value = "idcard", required = false)String idcard) throws Exception {
        return success(ykyyEntranceService.updateYkyyDoctor(idcard));
    }
    @GetMapping(value = "/getCFXX")

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

@ -61,7 +61,6 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import org.apache.axis.utils.StringUtils;
import org.apache.commons.collections.map.AbstractMapDecorator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -858,7 +857,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                        String title = null;
                                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
                                        if (wlyyOutpatientDO.getHisStatus()==null){
                                            fee=(prescriptionDO.getDrugFee()+15)+"";
                                            fee=(prescriptionDO.getDrugFee()+wlyyOutpatientDO.getFee())+"";
                                            title="您在厦门大学附属中山医院有一笔诊察/处方费用已支付完成!结算费用包含本次在线问诊的复诊诊查费:15元。";
                                        }else {
                                            fee=prescriptionDO.getDrugFee()+"";
@ -894,7 +893,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findByRealOrder(waitPayDetailVO.getRecipeNo());
                                        if (wlyyOutpatientDO!=null){
                                            if (wlyyOutpatientDO.getHisStatus()==null){
                                                String fee="15";
                                                String fee=wlyyOutpatientDO.getFee()+"";
                                                String title="您在厦门大学附属中山医院有一笔诊察/处方费用已支付完成!";
                                                String url = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+wlyyOutpatientDO.getId()+"";
                                                payInfoNoticeService.pushPrescriptionPay(wlyyOutpatientDO.getConsumer(),wlyyOutpatientDO.getDoctorName(),waitPayDetailVO.getVoucherNo(),null,null,fee,title,url);

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -265,7 +265,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    public ObjEnvelop checkOutpatient(@ApiParam(name = "patient", value = "续方明细")
                                      @RequestParam(value = "patient", required = true)String patient,
                                      @ApiParam(name = "flag", value = "标识是否开启结算")
                                      @RequestParam(value = "flag", required = true)boolean flag)throws Exception{
                                      @RequestParam(value = "flag", required = false)boolean flag)throws Exception{
        return success(prescriptionService.checkOutpatient(patient,wxId,flag));
    }