Prechádzať zdrojové kódy

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

ysj 5 rokov pred
rodič
commit
db0cfe9785

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorDao.java

@ -27,6 +27,9 @@ public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO,
    @Query("from BaseDoctorDO d where d.id = ?1 AND d.del ='1'")
    BaseDoctorDO findById(String id);
    @Query("from BaseDoctorDO d where  d.del ='1'")
    List<BaseDoctorDO> findByDel();
    @Modifying
    @Query("update BaseDoctorDO p set p.introduce = ?2,p.expertise = ?3,p.photo = ?4,p.outpatientType = ?5 where p.id = ?1")
    void update(String doctorId,String introduce,String expertise,String photo,String outpatientType);

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

@ -34,6 +34,7 @@ import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
@ -451,119 +452,26 @@ public class YkyyEntranceService {
    public String updateYkTDoctor()throws Exception{
        String response="";
        String url = "http://www.yanketong.com:133/api/doc_jkzl/doctor_list_had_bind_account?hospital_code=sb&page=1";
        response = httpClientUtil.get(url,"GBK");
        logger.info("response:"+response);
        JSONObject rs = JSON.parseObject(response);
        Integer status = rs.getInteger("code");
        if(status!=null&&status == 200){
            JSONObject object = rs.getJSONObject("data");
            JSONArray array = object.getJSONArray("list");
            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){
                        List<BaseDoctorDO> doctorDOs = baseDoctorDao.findByIdcard(idcard);
                        if(doctorDOs!=null&&doctorDOs.size()>0){
                            BaseDoctorDO doctor = doctorDOs.get(0);
                            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.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(IdCardUtil.getSexForIdcard_new(idcard)));
                            doctor.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
                            doctor.setProvinceCode("350000");
                            doctor.setProvinceName("福建省");
                            doctor.setTownCode("350203");
                            doctor.setTownName("思明区");
                            doctor.setCityCode("350200");
                            doctor.setCityName("厦门市");
//                            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);
                        }
                    }
        List<BaseDoctorDO> baseDoctorDOS = baseDoctorDao.findByDel();
        for (BaseDoctorDO baseDoctorDO:baseDoctorDOS){
            String response="";
            String url = "http://www.yanketong.com:133/api/doc_jkzl/doctor_list_had_bind_account?hospital_code=sb&page=1&id_card="+baseDoctorDO.getIdcard();
            response = httpClientUtil.get(url,"GBK");
            logger.info("response:"+response);
            JSONObject rs = JSON.parseObject(response);
            Integer status = rs.getInteger("code");
            if(status!=null&&status == 200){
                JSONObject object = rs.getJSONObject("data");
                JSONArray array = object.getJSONArray("list");
                if (array!=null&&array.size()!=0){
                    JSONObject jsonObject = array.getJSONObject(0);
                    DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(baseDoctorDO.getId());
                    String mappingCode = jsonObject.getString("DOCTORCODE");
                    doctorMappingDO.setMappingCode(mappingCode);
                    doctorMappingDao.save(doctorMappingDO);
                }else {
                    baseDoctorDO.setDel("0");
                    baseDoctorDao.save(baseDoctorDO);
                }
            }
        }
@ -1184,7 +1092,9 @@ public class YkyyEntranceService {
                hlwCf01DO.setJZKH(wlyyPrescriptionVO.getSsc());
                hlwCf01DO.setGUID(getCode());
                hlwCf01DO.setSJLY(1);
                hlwCf01DO.setJZXH(Integer.parseInt(wlyyPrescriptionVO.getAdmNo()));
                if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getAdmNo())){
                    hlwCf01DO.setJZXH(Integer.parseInt(wlyyPrescriptionVO.getAdmNo()));
                }
               /* hibenateUtils.save(hlwCf01DO);*/
                if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getRealOrder())){
                    hlwCf01DO.setCFSB(Integer.parseInt(wlyyPrescriptionVO.getRealOrder()));

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

@ -1640,7 +1640,7 @@ public class ImService {
	 * @param type
	 * @return
	 */
	public Integer SessionsUnreadMessageCount(String userid,Integer type){
	public Integer SessionsUnreadMessageCount(String userid,String type){
		return imUtil.SessionsUnreadMessageCount(userid,type);
	}
	

+ 2 - 2
business/im-service/src/main/java/com/yihu/jw/im/util/ImUtil.java

@ -712,8 +712,8 @@ public class ImUtil {
	 * @param type
	 * @return
	 */
	public Integer SessionsUnreadMessageCount(String userid,Integer type){
		String url = im_host + "api/v2/sessions/unread_message_count?user_id="+userid;
	public Integer SessionsUnreadMessageCount(String userid,String type){
		String url = im_host + "api/v2/sessions/unread_message_count?user_id="+userid+"&type="+type;
		String ret = HttpClientUtil.get(url,"utf-8");
		JSONObject obj = JSON.parseObject(ret);
//		if(obj.getInteger("count") ==200){

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

@ -206,6 +206,13 @@ public class BaseInfoEndpoint extends EnvelopRestEndpoint {
    public Envelop findPatientByMapingCode(String code) throws Exception {
        return success(ykyyEntranceService.findPatientByMapingCode(code));
    }
    @GetMapping(value = "/updateYkTDoctor")
    @ApiOperation(value = "同步眼科通医生信息", notes = "同步眼科通医生信息")
    public Envelop updateYkTDoctor() throws Exception {
        return success(ykyyEntranceService.updateYkTDoctor());
    }
//    @GetMapping(value = "/test")
//    @ApiOperation(value = "test", notes = "test")
//    public Envelop test() throws Exception {

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

@ -221,7 +221,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            Integer zjqzCount = imService.sessionCountByType(doctor.getId(),15,0);
    
            //专家咨询
            Integer unreadMessageCount = imService.SessionsUnreadMessageCount(doctor.getId(),1);
            Integer unreadMessageCount = imService.SessionsUnreadMessageCount(doctor.getId(),"1");
            result.put("zjCount",zjCount+zjqzCount);//专家咨询数量
            result.put("zjUnreadMessageCount",unreadMessageCount);//专家咨询未读数
        }else{
@ -246,10 +246,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        }
    
        //医生咨询
        Integer unreadMessageCount = imService.SessionsUnreadMessageCount(doctor.getId(),1);
        result.put("zxCount",unreadMessageCount);//咨询数量
        result.put("fzCount",prescriptionService.getWaitVideoCount(doctor.getId(),"1","1"));//图文复诊数量
        result.put("zxCount",imService.SessionsUnreadMessageCount(doctor.getId(),"1"));//专家咨询咨询数量
        result.put("fzCount",imService.SessionsUnreadMessageCount(doctor.getId(),"9"));//图文复诊数量
        return success("请求成功",result);
    }