Browse Source

Merge branch 'dev' of trick9191/wlyy2.0 into dev

trick9191 5 years ago
parent
commit
39078db1cd
18 changed files with 472 additions and 124 deletions
  1. 4 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/DoctorZsInfoDao.java
  2. 21 10
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 146 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java
  4. 92 0
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetService.java
  5. 6 6
      business/base-service/src/main/java/com/yihu/jw/wlyy/wlyyhttp/WlyyHttpService.java
  6. 0 1
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  7. 8 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionInfoVO.java
  8. 7 0
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java
  9. 82 74
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/DataUploadJob.java
  10. 15 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/QuartzHelper.java
  11. 1 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java
  12. 15 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/BaseController.java
  13. 62 18
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  14. 1 1
      svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml
  15. 2 0
      svr/svr-internet-hospital-job/src/main/resources/quartz.properties
  16. 2 2
      svr/svr-internet-hospital-job/src/main/resources/system.properties
  17. 7 7
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  18. 1 1
      svr/svr-internet-hospital/src/main/resources/bootstrap.yml

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/DoctorZsInfoDao.java

@ -4,8 +4,12 @@ import com.yihu.jw.entity.hospital.doctor.BaseDoctorZsInfoDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2019/9/16.
 */
public interface DoctorZsInfoDao extends PagingAndSortingRepository<BaseDoctorZsInfoDO, String>, JpaSpecificationExecutor<BaseDoctorZsInfoDO> {
    List<BaseDoctorZsInfoDO> findByIdNumber(String idNumber);
}

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

@ -243,17 +243,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " FROM " +
                " wlyy_outpatient o " +
                " WHERE " +
                " o.patient = '"+patient+"' AND o.outpatient_type != '2' ";
                " o.patient = ? AND o.outpatient_type != '2' ";
        List<Object> totalParams = new ArrayList<>();
        totalParams.add(patient);
        if(status!=null){
            totalSql +=  " AND o.status = "+status;
            totalSql +=  " AND o.status = ? ";
            totalParams.add(status);
        }
        if(StringUtils.isNotBlank(startTime)){
            totalSql += " AND create_time >='"+startTime+" 00:00:00'";
            totalSql += " AND create_time >= ? ";
            totalParams.add(startTime+" 00:00:00");
        }
        if(StringUtils.isNotBlank(endTime)){
            totalSql += " AND create_time <='"+endTime+" 23:59:59' ";
            totalSql += " AND create_time <= ? ";
            totalParams.add(endTime+" 23:59:59");
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql);
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(totalSql,totalParams.toArray());
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = (Long) rstotal.get(0).get("total");
@ -291,18 +296,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " FROM " +
                " wlyy_outpatient o " +
                " WHERE " +
                " o.patient = '"+patient+"'";
                " o.patient = ? ";
        List<Object> params = new ArrayList<>();
        params.add(patient);
        if(status!=null){
            sql +=  " AND o.status = "+status;
            sql +=  " AND o.status = ? ";
            params.add(status);
        }
        if(StringUtils.isNotBlank(startTime)){
            sql += " AND o.create_time >='"+startTime+" 00:00:00'";
            sql += " AND o.create_time >= ? ";
            params.add(startTime+" 00:00:00");
        }
        if(StringUtils.isNotBlank(endTime)){
            sql += " AND o.create_time <='"+endTime+" 23:59:59'";
            sql += " AND o.create_time <= ? ";
            params.add(endTime+" 23:59:59");
        }
        sql += " AND o.outpatient_type != '2' ORDER BY o.create_time DESC LIMIT " + (page - 1) * size + "," + size + " ";
        List<WlyyOutpatientVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WlyyOutpatientVO.class));
        List<WlyyOutpatientVO> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WlyyOutpatientVO.class),params.toArray());
        return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, count);
    }

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

@ -226,7 +226,20 @@ public class EntranceService {
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
        }
        return ConvertUtil.convertListEnvelopByString(resp);
        //剔除非激活的卡
        JSONArray res = ConvertUtil.convertListEnvelopByString(resp);
        if(res!=null&&res.size()>0){
            Iterator it = res.iterator();
            if(it.hasNext()){
                net.sf.json.JSONObject rs = (net.sf.json.JSONObject) it.next();
                String stat = rs.getString("CARD_STAT");
                if(!"激活".equals(stat)){
                    it.remove();
                }
            }
        }
        return res;
    }
    /**
@ -387,7 +400,7 @@ public class EntranceService {
            //查询信息结束
            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            logger.info("resp "+resp);
//            logger.info("resp "+resp);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);
        }
@ -453,6 +466,7 @@ public class EntranceService {
        }
        //发药时间
        String dispDate = null != jsonObjectBody.get("DISP_DATE") ? jsonObjectBody.get("DISP_DATE").toString() : "";
        if(StringUtils.isNotBlank(dispDate)){
            //根据处方号获取处方
            WlyyPrescriptionDO wlyyPrescriptionDO=prescriptionDao.findByRealOrder(realOrder);
@ -2138,4 +2152,134 @@ public class EntranceService {
        }
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
    /**
     * 同步医生信息
     * @param demoFlag
     * @return
     * @throws Exception
     */
    public int sysDoctorInfo(String docIdCard,boolean demoFlag) throws Exception {
        int i = 0;
        String fid = "MS02003";
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
            resp = MqSdkUtil.xml2jsonArrayRootRowMS02003(resp);
        } else {
            StringBuffer sbs = new StringBuffer();
            //AccessControl :用户、密码、服务id
            sbs.append("<ESBEntry><AccessControl><Fid>" + fid + "</Fid><UserName>" + mqUser + "</UserName><Password>" + mqPwd + "</Password></AccessControl>");
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>" + sourceSysCode + "</SourceSysCode><TargetSysCode>" + targetSysCode + "</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>10000</endNum><Msg></Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRowMS02003(resp);
        }
        net.sf.json.JSONObject jsonObject= net.sf.json.JSONObject.fromObject(resp);
        if(null!=jsonObject&&"1".equals(jsonObject.get("code").toString())){
            JSONArray jsonObjectMgsInfo=(JSONArray)jsonObject.get("MsgInfo");
            if(null!=jsonObjectMgsInfo){
                for (Object object : jsonObjectMgsInfo) {
                    net.sf.json.JSONObject jsonArraySub = (net.sf.json.JSONObject) object;
                    jsonObjectMgsInfo=(JSONArray)jsonArraySub.get("body");
                    if(jsonObjectMgsInfo instanceof JSONArray){
                        for (Object objectSub : jsonObjectMgsInfo) {
                            net.sf.json.JSONObject jsonObjectBody = (net.sf.json.JSONObject) objectSub;
                            String doctorCode = "";
                            String doctorName = "";
                            if (null != jsonObjectBody) {
                                //获取中山医院的医生
                                String winNo = "6";
                                doctorCode = null == jsonObjectBody.get("Emp_Code") ? "" : jsonObjectBody.get("Emp_Code").toString();
                                //根据医生及分部,获取医生号别
                                net.sf.json.JSONArray jsonArrayCharge = BS55010(winNo, doctorCode, null, false);
                                String chareType=null;
                                if(null!=jsonArrayCharge){
                                    for (Object objectCharge : jsonArrayCharge) {
                                        net.sf.json.JSONObject jsonObjectBodyCharge = (net.sf.json.JSONObject) objectCharge;
                                        if (null != jsonObjectBodyCharge) {
                                            chareType = null == jsonObjectBodyCharge.get("charge_type") ? null : jsonObjectBodyCharge.get("charge_type").toString();
                                        }
                                    }
                                }
                                //保存医生信息
                                BaseDoctorDO baseDoctorDO = new BaseDoctorDO();
                                String idCard = null == jsonObjectBody.get("Card_Id") ? "" : jsonObjectBody.get("Card_Id").toString();
                                //同步单条信息
                                if(docIdCard.equals(idCard)){
                                    baseDoctorDO.setIdcard(idCard);
                                    baseDoctorDO.setBirthday(IdCardUtil.getBirthdayForIdcard(idCard));
                                    baseDoctorDO.setSex(Integer.valueOf(IdCardUtil.getSexForIdcard(idCard)));
                                    baseDoctorDO.setLocked(0);
                                    baseDoctorDO.setEnabled(1);
                                    //拼音码
                                    baseDoctorDO.setSpell(null == jsonObjectBody.get("PinYin_Code") ? "" : jsonObjectBody.get("PinYin_Code").toString());
                                    String disableFlag = null == jsonObjectBody.get("Disable_Flag") ? "" : jsonObjectBody.get("Disable_Flag").toString();
                                    //互联网医院:1停用,0使用  转 i健康:1正常,0作废
                                    baseDoctorDO.setDel("1".equals(disableFlag) ? "0" : "1");
                                    //姓名
                                    doctorName = null == jsonObjectBody.get("Emp_Name") ? "" : jsonObjectBody.get("Emp_Name").toString();
                                    //号别
                                    baseDoctorDO.setChargeType(chareType);
                                    if (StringUtils.isNotBlank(idCard)) {
                                        baseDoctorDO.setSalt(PwdUtil.randomString(5));
                                        try {
                                            baseDoctorDO.setPassword(com.yihu.utils.security.MD5.md5Hex(baseDoctorDO.getIdcard().substring(baseDoctorDO.getIdcard().length()-6) + "{" + baseDoctorDO.getSalt() + "}"));
                                        } catch (Exception e) {
                                            logger.error(e.getMessage()+"docotr="+doctorCode+";idcard="+baseDoctorDO.getIdcard());
                                        }
                                    }else {
                                        baseDoctorDO.setPassword(com.yihu.utils.security.MD5.md5Hex("123456"+ "{" + baseDoctorDO.getSalt() + "}"));
                                    }
                                    baseDoctorDO.setName(doctorName);
                                    baseDoctorDO.setIsFamous(0);
                                    baseDoctorDO.setCreateTime(new Date());
                                    baseDoctorDO.setUpdateTime(new Date());
                                    baseDoctorDO.setMobile("0");
                                    baseDoctorDO = baseDoctorDao.save(baseDoctorDO);
                                    //根据医生和机构判断数据是否存在,若不存在则在mapping中追加记录
                                    List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByDoctorAndOrgCode(baseDoctorDO.getId(), "350211A1002");
                                    if (!(null != doctorMappingDOS && doctorMappingDOS.size() > 0)) {
                                        DoctorMappingDO doctorMappingDO = new DoctorMappingDO();
                                        doctorMappingDO.setDoctor(baseDoctorDO.getId());
                                        doctorMappingDO.setDoctorName(doctorName);
                                        doctorMappingDO.setMappingCode(doctorCode);
                                        doctorMappingDO.setMappingName(doctorName);
                                        doctorMappingDO.setOrgCode("350211A1002");
                                        doctorMappingDO.setOrgName("厦门大学附属中山医院");
                                        doctorMappingDao.save(doctorMappingDO);
                                    }
                                    // 用医生和机构id、部门判断数据是否存在,若不存在则保存医生机构关联关系
                                    String deptCode = null == jsonObjectBody.get("Dept_Code") ? "" : jsonObjectBody.get("Dept_Code").toString();
                                    List<BaseDoctorHospitalDO> baseDoctorHospitalDOS = baseDoctorHospitalDao.findByOrgCodeAndDeptCodeAndDoctorCode("350211A1002", deptCode, baseDoctorDO.getId());
                                    if (!(null != baseDoctorHospitalDOS && baseDoctorHospitalDOS.size() > 0)) {
                                        BaseDoctorHospitalDO baseDoctorHospitalDO = new BaseDoctorHospitalDO();
                                        baseDoctorHospitalDO.setOrgCode("350211A1002");
                                        baseDoctorHospitalDO.setOrgName("厦门大学附属中山医院");
                                        baseDoctorHospitalDO.setDoctorCode(baseDoctorDO.getId());
                                        baseDoctorHospitalDO.setDeptCode(deptCode);
                                        //根据机构编码获取机构名称
                                        List<DictHospitalDeptDO>  dictHospitalDeptDOS=  dictHospitalDeptDao.findByOrgCodeAndCode("350211A1002",deptCode);
                                        if(null!=dictHospitalDeptDOS&&dictHospitalDeptDOS.size()>0){
                                            DictHospitalDeptDO dictHospitalDeptDO=dictHospitalDeptDOS.get(0);
                                            baseDoctorHospitalDO.setDeptName(dictHospitalDeptDO.getName());
                                        }
                                        baseDoctorHospitalDO.setDel("1");
                                        baseDoctorHospitalDao.save(baseDoctorHospitalDO);
                                    }
                                    i++;
                                }
                            }
                        }
                    }
                }
            }}
        return i;
    }
}

+ 92 - 0
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetService.java

@ -1083,159 +1083,214 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
            case "0":
                res[0] = "1";
                res[1] = "预防保健科";
                break;
            case "1120000":
                res[0] = "1";
                res[1] = "预防保健科";
                break;
            case "1170000":
                res[0] = "1";
                res[1] = "预防保健科";
                break;
            case "3160000":
                res[0] = "1";
                res[1] = "预防保健科";
                break;
            case "1310000":
                res[0] = "2";
                res[1] = "全科医疗科";
                break;
            case "1000001":
                res[0] = "3";
                res[1] = "内科";
                break;
            case "1010000":
                res[0] = "3";
                res[1] = "内科";
                break;
            case "1010200":
                res[0] = "3.01";
                res[1] = "呼吸内科专业";
                break;
            case "1010100":
                res[0] = "3.02";
                res[1] = "消化内科专业";
                break;
            case "1140000":
                res[0] = "3.03";
                res[1] = "神经内科专业";
                break;
            case "1400000":
                res[0] = "3.04";
                res[1] = "心血管内科专业";
                break;
            case "1410000":
                res[0] = "3.04";
                res[1] = "心血管内科专业";
                break;
            case "1210000":
                res[0] = "3.05";
                res[1] = "血液内科专业";
                break;
            case "1010300":
                res[0] = "3.06";
                res[1] = "肾病学专业";
                break;
            case "1220000":
                res[0] = "3.07";
                res[1] = "内分泌专业";
                break;
            case "1010400":
                res[0] = "3.08";
                res[1] = "免疫学专业";
                break;
            case "1020000":
                res[0] = "4";
                res[1] = "外科";
                break;
            case "1020200":
                res[0] = "4";
                res[1] = "外科";
                break;
            case "1260000":
                res[0] = "4";
                res[1] = "外科";
                break;
            case "1520000":
                res[0] = "4";
                res[1] = "外科";
                break;
            case "1020100":
                res[0] = "4.01";
                res[1] = "普通外科专业";
                break;
            case "1150000":
                res[0] = "4.02";
                res[1] = "神经外科专业";
                break;
            case "1030000":
                res[0] = "4.03";
                res[1] = "骨科专业";
                break;
            case "1031000":
                res[0] = "4.03";
                res[1] = "骨科专业";
                break;
            case "1032000":
                res[0] = "4.03";
                res[1] = "骨科专业";
                break;
            case "1033000":
                res[0] = "4.03";
                res[1] = "骨科专业";
                break;
            case "1020300":
                res[0] = "4.04";
                res[1] = "泌尿外科专业";
                break;
            case "1020400":
                res[0] = "4.05";
                res[1] = "胸外科专业";
                break;
            case "1250000":
                res[0] = "4.06";
                res[1] = "心脏大血管外科专业";
                break;
            case "1300000":
                res[0] = "4.06";
                res[1] = "心脏大血管外科专业";
                break;
            case "1040000":
                res[0] = "5";
                res[1] = "妇产科";
                break;
            case "1050000":
                res[0] = "7";
                res[1] = "儿科";
                break;
            case "1510000":
                res[0] = "8";
                res[1] = "小儿外科";
                break;
            case "1090000":
                res[0] = "10";
                res[1] = "眼科";
                break;
            case "1100000":
                res[0] = "11";
                res[1] = "耳鼻咽喉科";
                break;
            case "1110000":
                res[0] = "12";
                res[1] = "口腔科";
                break;
            case "1160000":
                res[0] = "13";
                res[1] = "皮肤科";
                break;
            case "1230000":
                res[0] = "14";
                res[1] = "医疗美容科";
                break;
            case "1000002":
                res[0] = "15";
                res[1] = "精神科";
                break;
            case "3150000":
                res[0] = "16";
                res[1] = "传染科";
                break;
            case "1200000":
                res[0] = "19";
                res[1] = "肿瘤科";
                break;
            case "1190006":
                res[0] = "20";
                res[1] = "急诊医学科";
                break;
            case "1190007":
                res[0] = "20";
                res[1] = "急诊医学科";
                break;
            case "1280000":
                res[0] = "21";
                res[1] = "康复医学科";
                break;
            case "1130100":
                res[0] = "26";
                res[1] = "麻醉科";
                break;
            case "1130400":
                res[0] = "27";
                res[1] = "疼痛科";
                break;
            case "1400400":
                res[0] = "28";
                res[1] = "重症医学科";
                break;
            case "2070000":
                res[0] = "31";
                res[1] = "病理科";
                break;
            case "1020600":
                res[0] = "32.09";
                res[1] = "介入放射学专业";
                break;
            case "1240000":
                res[0] = "32.1";
                res[1] = "放射治疗专业";
                break;
            case "1080000":
                res[0] = "50";
                res[1] = "中医科";
                break;
            case "1060000":
                res[0] = "50.12";
                res[1] = "老年病科专业";
                break;
            default:
                res[0] = "1";
                res[1] = "预防保健科";
        }
        return  res;
    }
@ -1246,12 +1301,18 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        switch (status) {
            case "-1":
                res = "0";
                break;
            case "0":
                res = "1";
                break;
            case "1":
                res = "1";
                break;
            case "2":
                res = "1";
                break;
            default:
                res = "";
        }
        return res;
    }
@ -1290,96 +1351,127 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
            case "1303":
                res[0] = "243";
                res[1] = "主管药师";
                break;
            case "1304":
                res[0] = "243";
                res[1] = "主管药师";
                break;
            case "1101":
                res[0] = "231";
                res[1] = "主任医师";
                break;
            case "065":
                res[0] = "231";
                res[1] = "主任医师";
                break;
            case "1201":
                res[0] = "232";
                res[1] = "副主任医师";
                break;
            case "067":
                res[0] = "232";
                res[1] = "副主任医师";
                break;
            case "1301":
                res[0] = "233";
                res[1] = "主治医师";
                break;
            case "066":
                res[0] = "233";
                res[1] = "主治医师";
                break;
            case "1310":
                res[0] = "233";
                res[1] = "主治医师";
                break;
            case "1401":
                res[0] = "234";
                res[1] = "医师";
                break;
            case "061":
                res[0] = "234";
                res[1] = "医师";
                break;
            case "1501":
                res[0] = "235";
                res[1] = "医士";
                break;
            case "1103":
                res[0] = "241";
                res[1] = "主任药师";
                break;
            case "1104":
                res[0] = "241";
                res[1] = "主任药师";
                break;
            case "1203":
                res[0] = "242";
                res[1] = "副主任药师";
                break;
            case "1403":
                res[0] = "244";
                res[1] = "药师";
                break;
            case "1404":
                res[0] = "244";
                res[1] = "药师";
                break;
            case "1503":
                res[0] = "245";
                res[1] = "药士";
                break;
            case "1102":
                res[0] = "251";
                res[1] = "主任护师";
                break;
            case "1204":
                res[0] = "252";
                res[1] = "副主护师";
                break;
            case "1302":
                res[0] = "253";
                res[1] = "主管护师";
                break;
            case "1402":
                res[0] = "254";
                res[1] = "护师";
                break;
            case "1502":
                res[0] = "255";
                res[1] = "护士";
                break;
            case "1107":
                res[0] = "261";
                res[1] = "主任技师";
                break;
            case "1207":
                res[0] = "262";
                res[1] = "副主任技师";
                break;
            case "1307":
                res[0] = "263";
                res[1] = "主管技师";
                break;
            case "056":
                res[0] = "263";
                res[1] = "主管技师";
                break;
            case "1407":
                res[0] = "264";
                res[1] = "技师";
                break;
            case "006":
                res[0] = "264";
                res[1] = "技师";
                break;
            case "053":
                res[0] = "264";
                res[1] = "技师";
                break;
            case "1202":
                res[0] = "252";
                res[1] = "副主护师";
                break;
            default:
                res[0] = "0";
                res[1] = "未知";

+ 6 - 6
business/base-service/src/main/java/com/yihu/jw/wlyy/wlyyhttp/WlyyHttpService.java

@ -31,7 +31,7 @@ public class WlyyHttpService {
    @Autowired
    private HttpClientUtil httpClientUtil;
    
    /**
     * @param configId 配置ID
     * @param param key为param,的参数
@ -56,26 +56,26 @@ public class WlyyHttpService {
            if (status == 10000) {
                //设置入参
                List<NameValuePair> p = new ArrayList<>();
                
                //组装key为param的入参
                if(param != null){
                    p.add(new BasicNameValuePair("param", param.toJSONString()));
                }
                
                
                //组装map形式的传参
                if(mapParams!= null && !mapParams.keySet().isEmpty()){
                    for (String paramkey:mapParams.keySet()){
                        p.add(new BasicNameValuePair(paramkey, mapParams.get(paramkey)));
                    }
                }
                
                //设置头部
                token = rsjson.getJSONObject("result").getString("accesstoken");
                Map<String,Object> headerMap = new HashedMap();
                headerMap.put("accesstoken",token);
                System.out.println(oauthWlyyConfigDO.getUrl());
                logger.info("sendWlyyMes url :"+oauthWlyyConfigDO.getUrl());
                String rs = httpClientUtil.headerPost(oauthWlyyConfigDO.getUrl(),p,"UTF-8",headerMap);
                logger.info("sendWlyyMes headerPost :"+rs);

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

@ -1604,7 +1604,6 @@ public class ImService {
		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
		
		result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
		
		return result;
	}
	

+ 8 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionInfoVO.java

@ -319,4 +319,12 @@ public class WlyyPrescriptionInfoVO extends UuidIdentityVOWithOperator {
    public void setPostCount(String postCount) {
        this.postCount = postCount;
    }
    public String getComm() {
        return comm;
    }
    public void setComm(String comm) {
        this.comm = comm;
    }
}

+ 7 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/MqSdkController.java

@ -543,5 +543,12 @@ public class MqSdkController extends EnvelopRestEndpoint {
        return success(obj);
    }
    @GetMapping(value = "/sysDoctorInfo")
    @ApiOperation(value = "单个同步医生")
    public ObjEnvelop sysDoctorInfo(
            @ApiParam(name = "idcard", value = "医生同步")
            @RequestParam(value = "idcard",defaultValue = "") String idcard) throws Exception {
        return success(entranceService.sysDoctorInfo(idcard,demoFlag));
    }
    //==================预约挂号end================
}

+ 82 - 74
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/DataUploadJob.java

@ -21,80 +21,87 @@ public class DataUploadJob implements Job {
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========DataUploadJob========");
        try {
            //1、获取 JOB 执行区间  执行时间点的前一天  时间点定在每天的 00:00:00 执行,同步前一天的数据
            String endDate = DateUtil.dateToStrLong(DateUtil.getNow());
            String startDate = DateUtil.dateToStrLong(DateUtil.getPreDays(DateUtil.getNow(),1));
            String res = "";
            // 2、分步执行需要JOB执行的服务
            logger.info("START========2.5 网上预约挂号上传开始========");
            try {
                res = internetService.upAppointmentOnline(startDate,endDate,null);
            }catch (Exception e){
                logger.error(e.toString());
            }
            logger.info("END==========2.5 网上预约挂号上传结束========" + res);
            logger.info("START========2.6 网上医技预约上传开始========");
            try {
                res = internetService.upMedicalOnline(startDate,endDate,null);
            }catch (Exception e){
                logger.error(e.toString());
            }
            logger.info("END==========2.6 网上医技预约上传结束========" + res);
            logger.info("START========2.7 医生评价信息开始========");
            try {
                res = internetService.upNsDoctorScore(startDate,endDate,null);
            }catch (Exception e){
                logger.error(e.toString());
            }
            logger.info("END==========2.7 医生评价信息结束========" + res);
            logger.info("START========2.8 网络咨询服务信息开始========");
            try {
                res = internetService.upNsOnlineAsk(startDate,endDate,null);
            }catch (Exception e){
                logger.error(e.toString());
            }
            logger.info("END==========2.8 网络咨询服务信息结束========" + res);
            logger.info("START========2.9 网络诊疗服务信息========");
            try {
                res = internetService.upNsOnlineMed(startDate,endDate,null);
            }catch (Exception e){
                logger.error(e.toString());
            }
            logger.info("END==========2.9 网络诊疗服务信息========" + res);
            logger.info("START========2.10 电子处方表开始========");
            try {
                res = internetService.upPrescription(startDate,endDate,null);
            }catch (Exception e){
                logger.error(e.toString());
            }
            logger.info("END==========2.10 电子处方表结束========" + res);
            logger.info("START========2.11 电子处方_药品明细表开始 ========");
            try {
                res = internetService.upPrescriptionDrug(startDate,endDate,null);
            }catch (Exception e){
                logger.error(e.toString());
            }
            logger.info("END==========2.11 电子处方_药品明细表结束 ========" + res);
//            //1、获取 JOB 执行区间  执行时间点的前一天  时间点定在每天的 02:00:00 执行,同步前一天的数据
//            String endDate = DateUtil.dateToStr(DateUtil.getNow(),"yyyy-MM-dd")+" 00:00:00";
//            String startDate = DateUtil.dateToStr(DateUtil.getPreDays(DateUtil.getNow(),-1),"yyyy-MM-dd")+" 00:00:00";
//
//            String res = "";
//
//            //2、分步执行需要JOB执行的服务
//            logger.info("START========2.5 网上预约挂号上传开始========");
//            try {
//                res = internetService.upAppointmentOnline(startDate,endDate,null);
//            }catch (Exception e){
//                e.printStackTrace();
//                logger.error(e.toString());
//            }
//            logger.info("END==========2.5 网上预约挂号上传结束========" + res);
//
//
//
//            logger.info("START========2.6 网上医技预约上传开始========");
//            try {
//                res = internetService.upMedicalOnline(startDate,endDate,null);
//            }catch (Exception e){
//                e.printStackTrace();
//                logger.error(e.toString());
//            }
//            logger.info("END==========2.6 网上医技预约上传结束========" + res);
//
//
//
//            logger.info("START========2.7 医生评价信息开始========");
//            try {
//                res = internetService.upNsDoctorScore(startDate,endDate,null);
//            }catch (Exception e){
//                e.printStackTrace();
//                logger.error(e.toString());
//            }
//            logger.info("END==========2.7 医生评价信息结束========" + res);
//
//
//
//            logger.info("START========2.8 网络咨询服务信息开始========");
//            try {
//                res = internetService.upNsOnlineAsk(startDate,endDate,null);
//            }catch (Exception e){
//                e.printStackTrace();
//                logger.error(e.toString());
//            }
//            logger.info("END==========2.8 网络咨询服务信息结束========" + res);
//
//
//
//            logger.info("START========2.9 网络诊疗服务信息========");
//            try {
//                res = internetService.upNsOnlineMed(startDate,endDate,null);
//            }catch (Exception e){
//                e.printStackTrace();
//                logger.error(e.toString());
//            }
//            logger.info("END==========2.9 网络诊疗服务信息========" + res);
//
//
//
//            logger.info("START========2.10 电子处方表开始========");
//            try {
//                res = internetService.upPrescription(startDate,endDate,null);
//            }catch (Exception e){
//                e.printStackTrace();
//                logger.error(e.toString());
//            }
//            logger.info("END==========2.10 电子处方表结束========" + res);
//
//
//
//            logger.info("START========2.11 电子处方_药品明细表开始 ========");
//            try {
//                res = internetService.upPrescriptionDrug(startDate,endDate,null);
//            }catch (Exception e){
//                e.printStackTrace();
//                logger.error(e.toString());
//            }
//            logger.info("END==========2.11 电子处方_药品明细表结束 ========" + res);
            logger.info("END========DataUploadJob 执行结束========");
@ -103,4 +110,5 @@ public class DataUploadJob implements Job {
            logger.error("END===ERROE===DataUploadJob,message:"+e.getMessage());
        }
    }
}

+ 15 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/QuartzHelper.java

@ -1,5 +1,6 @@
package com.yihu.jw.job;
import org.apache.commons.collections.map.HashedMap;
import org.quartz.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
@ -7,6 +8,8 @@ import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.quartz.SimpleScheduleBuilder.simpleSchedule;
@ -28,6 +31,15 @@ public class QuartzHelper {
        }
    }
    public Map<String,Object> getCalendar()throws Exception{
        Map<String,Object> rs = new HashedMap();
        rs.put("JobGroupNames ",scheduler.getJobGroupNames());
        rs.put("SchedulerName ",scheduler.getSchedulerName());
        rs.put("TriggerGroups ",scheduler.getPausedTriggerGroups());
        return rs;
    }
    public void addJob(Class jobClass, String cronString, String jobKey,
                       Map<String, Object> params) throws Exception {
        if (!CronExpression.isValidExpression(cronString)) {
@ -55,7 +67,9 @@ public class QuartzHelper {
    public void removeJob(String jobKeyString) throws Exception {
        TriggerKey triggerKey = new TriggerKey("trigger-name:" + jobKeyString,
                "trigger-group:" + jobKeyString);
        JobKey jobName = new JobKey("job-group:" + jobKeyString, "job-id:"
//        JobKey jobName = new JobKey("job-group:" + jobKeyString, "job-id:"
//                + jobKeyString);
        JobKey jobName = new JobKey("job-id:" + jobKeyString, "job-group:"
                + jobKeyString);
        scheduler.pauseTrigger(triggerKey);// 停止触发器
        scheduler.unscheduleJob(triggerKey);// 移除触发器

+ 1 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java

@ -82,7 +82,7 @@ public class PrescriptionStatusUpdateService {
            Map<String, Object> params = new HashMap<>();
            params.put("registerSn", null);
            params.put("patNo", patientMappingCode);
            params.put("admNo", admNo);
//            params.put("admNo", admNo);
            params.put("realOrder", realOrder);
            //判断处方是否存在
            boolean preExistFlag = true;

+ 15 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/BaseController.java

@ -1,6 +1,7 @@
package com.yihu.jw.web;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.util.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -553,4 +554,18 @@ public class BaseController {
        return simplifiedBean;
    }
    protected <J> ObjEnvelop<J> success(J obj){
        return success("success", obj);
    }
    protected <J> ObjEnvelop<J> success(String message, J obj){
        return success(message, 200, obj);
    }
    protected <J> ObjEnvelop<J> success(String message, int status, J obj){
        ObjEnvelop<J> objEnvelop = new ObjEnvelop<>();
        objEnvelop.setMessage(message);
        objEnvelop.setStatus(status);
        objEnvelop.setObj(obj);
        return objEnvelop;
    }
}

+ 62 - 18
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -4,12 +4,13 @@ import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.internet.service.DataGeneratorService;
import com.yihu.jw.internet.service.InternetService;
import com.yihu.jw.job.DataUploadJob;
import com.yihu.jw.job.PrescriptionOverdueJob;
import com.yihu.jw.job.PrescriptionStatusUpdateJob;
import com.yihu.jw.job.QuartzHelper;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.service.quota.JobService;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.SystemConf;
import com.yihu.jw.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
@ -52,31 +54,73 @@ public class JobController extends BaseController {
        this.quartzHelper = quartzHelper;
    }
    /**
     * 启动任务
     *
     * @param id id
     * @return
     */
    @RequestMapping(value = "startNowById", method = RequestMethod.GET)
    public String startNowById(String id) {
        try {
            jobService.startNowById(id);
            return success("启动成功!");
    @RequestMapping(value = "removeJob", method = RequestMethod.GET)
    public String removeJob(String taskId) {
        try {
            if(quartzHelper.isExistJob(taskId)){
                quartzHelper.removeJob(taskId);
                return success("删除成功!");
            }
            return success("删除成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "启动失败:" + e.getMessage());
            return invalidUserException(e, -1, "删除失败:" + e.getMessage());
        }
    }
    @RequestMapping(value = "getCalendar", method = RequestMethod.GET)
    public ObjEnvelop getCalendar() throws Exception{
       return success(quartzHelper.getCalendar());
    }
    @RequestMapping(value = "isExist", method = RequestMethod.GET)
    public String isExist(String id) {
    public String isExist(String taskId) {
        try {
            if(quartzHelper.isExistJob(id)){
                return success("启动成功!");
            if(quartzHelper.isExistJob(taskId)){
                return success("job已经存在!");
            }
            return success("启动失败!");
            return success("job不存在!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "执行失败:" + e.getMessage());
        }
    }
    @RequestMapping(value = "reStartById", method = RequestMethod.GET)
    public String reStartById(String taskId) {
        try {
            if(quartzHelper.isExistJob(taskId)){
                quartzHelper.removeJob(taskId);
            }
            switch(taskId){
                case "prescription_overdue_job":
                    if (!quartzHelper.isExistJob("prescription_overdue_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("prescription_overdue_job");
                        quartzHelper.addJob(PrescriptionOverdueJob.class, trigger, "prescription_overdue_job", new HashMap<String, Object>());
                        logger.info("prescription_overdue_job  job success");
                    } else {
                        logger.info("prescription_overdue_job  job exist");
                    }
                    break;
                case "data_upload_job" :
                    //互联网医院 监管平台上报
                    if (!quartzHelper.isExistJob("data_upload_job")) {
                        String trigger = SystemConf.getInstance().getSystemProperties().getProperty("data_upload_job");
                        quartzHelper.addJob(DataUploadJob.class, trigger, "data_upload_job", new HashMap<String, Object>());
                        logger.info("data_upload_job  job success");
                    } else {
                        logger.info("data_upload_job  job exist");
                    }
                    break;
                default :
            }
            return success("启动成功!");
        } catch (Exception e) {
            error(e);

+ 1 - 1
svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-internet-hospital-job
    name: svr-internet-hospital-job-yx
  cloud:
    config:
      failFast: true

+ 2 - 0
svr/svr-internet-hospital-job/src/main/resources/quartz.properties

@ -14,6 +14,8 @@ org.quartz.threadPool.threadPriority: 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread: true
 
org.quartz.jobStore.misfireThreshold: 60000
#是否集群
org.quartz.jobStore.isClustered=false
 
#============================================================================
# Configure JobStore

+ 2 - 2
svr/svr-internet-hospital-job/src/main/resources/system.properties

@ -5,8 +5,8 @@ prescriptionStatus_update_job=0 */2 * * * ?
# 门诊记录过期job,每天1 点触发
prescription_overdue_job=0 0 1 * * ?
#每天1 点触发
data_upload_job=0 0 2 * * ?
#每天13 点触发
data_upload_job=0 0 13 * * ?
#data_upload_25_job=0 0 1 * * ?
#

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

@ -83,13 +83,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findOriginPrescriptionList)
    @ApiOperation(value = "门诊下所有处方信息")
    public ListEnvelop findOriginPrescriptionList(
            @ApiParam(name = "registerSn", value = "流水号", required = false)
            @RequestParam(value = "registerSn",required = true) String registerSn,
            @ApiParam(name = "patNo", value = "病人id", required = false)
            @RequestParam(value = "patNo",required = true) String patNo,
            @ApiParam(name = "admNo", value = "住院唯一号", required = false)
            @RequestParam(value = "admNo",required = true) String admNo,
            @ApiParam(name = "realOrder", value = "处方号", required = false)
            @ApiParam(name = "registerSn", value = "流水号")
            @RequestParam(value = "registerSn",required = false) String registerSn,
            @ApiParam(name = "patNo", value = "病人id")
            @RequestParam(value = "patNo",required = false) String patNo,
            @ApiParam(name = "admNo", value = "住院唯一号")
            @RequestParam(value = "admNo",required = false) String admNo,
            @ApiParam(name = "realOrder", value = "处方号")
            @RequestParam(value = "realOrder",required = false) String realOrder) throws Exception {
        List<WlyyPrescriptionVO> obj = prescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo,demoFlag);
        return success(obj);

+ 1 - 1
svr/svr-internet-hospital/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-internet-hospital
    name: svr-internet-hospital-kk
  cloud:
    config:
      failFast: true