Bläddra i källkod

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

liubing 4 år sedan
förälder
incheckning
2b328fb164
17 ändrade filer med 620 tillägg och 146 borttagningar
  1. 87 3
      business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java
  2. 19 8
      business/base-service/src/main/java/com/yihu/jw/evaluate/score/service/BaseEvaluateScoreService.java
  3. 5 0
      business/base-service/src/main/java/com/yihu/jw/hospital/dict/WlyyHospitalSysDictDao.java
  4. 26 22
      business/base-service/src/main/java/com/yihu/jw/hospital/mapping/service/PatientMappingService.java
  5. 133 33
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  6. 137 29
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/WorkTimeService.java
  7. 38 8
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  8. 11 3
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  9. 4 3
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  10. 12 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorDO.java
  11. 6 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  12. 9 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/dao/patient/WlyyHospitalSysDictDao.java
  13. 51 16
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  14. 8 8
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/YkyyService.java
  15. 55 4
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java
  16. 15 7
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  17. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

+ 87 - 3
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorInfoService.java

@ -140,7 +140,8 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                "\tn.req_fee as \"spfzFee\",\n" +
                "\tp.req_fee as \"spzxFee\",\n" +
                "\tv.req_fee as \"twzxFee\",\n" +
                "\td.req_fee as \"xtzxFee\"\n" +
                "\td.req_fee as \"xtzxFee\",\n" +
                "\tg.req_fee as \"jyzxFee\"\n" +
                " FROM " +
                " base_doctor a " +
                " JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
@ -150,6 +151,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                " LEFT JOIN wlyy_charge_dict p ON a.spzx_charge_type = p.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict v ON a.twzx_charge_type = v.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict d ON a.xtfz_charge_type = d.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict g ON a.jyzx_charge_type = g.charge_type\n" +
                " LEFT JOIN base_doctor_mapping c ON a.id = c.doctor " +
                " WHERE 1=1";
        if (StringUtils.isNotBlank(city)){
@ -204,7 +206,8 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                "\tn.req_fee as \"spfzFee\",\n" +
                "\tp.req_fee as \"spzxFee\",\n" +
                "\tv.req_fee as \"twzxFee\",\n" +
                "\tq.req_fee as \"xtzxFee\"\n" +
                "\tq.req_fee as \"xtzxFee\",\n" +
                "\tg.req_fee as \"jyzxFee\"\n" +
                " FROM " +
                " base_doctor a " +
                " LEFT JOIN base_doctor_hospital b ON a.id = b.doctor_code " +
@ -216,6 +219,7 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
                " LEFT JOIN wlyy_charge_dict p ON a.spzx_charge_type = p.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict v ON a.twzx_charge_type = v.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict q ON a.xtfz_charge_type = q.charge_type\n" +
                " LEFT JOIN wlyy_charge_dict g ON a.jyzx_charge_type = g.charge_type\n" +
                " WHERE 1=1 ";
        if(StringUtils.isNotBlank(doctorId)){
            sql+=" AND a.id =:id";
@ -285,7 +289,64 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
        String outpatientType = jsonObject.get("outpatientType").toString();
        String newSpecialDisease = jsonObject.get("specialDisease").toString();
        String newSpecialDiseaseCode = jsonObject.get("specialDiseaseCode").toString();
        baseDoctorDao.update(doctorId,introduce,expertise,photo,outpatientType);
        BaseDoctorDO doctorDO = baseDoctorDao.findOne(doctorId);
        if (doctorDO!=null){
            doctorDO.setIntroduce(introduce);
            doctorDO.setExpertise(expertise);
            doctorDO.setPhoto(photo);
            doctorDO.setOutpatientType(outpatientType);
            if (StringUtils.isNoneBlank(jsonObject.get("TWZXFee")==null?"":jsonObject.get("TWZXFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("TWZXFee").toString(),doctorDO.getName());
                doctorDO.setTwzxChargeType(chargeType);
            }else {
                if (jsonObject.get("TWZXType")!=null) {
                    doctorDO.setTwzxChargeType(jsonObject.get("TWZXType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("SPZXFee")==null?"":jsonObject.get("SPZXFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("SPZXFee").toString(),doctorDO.getName());
                doctorDO.setSpzxChargeType(chargeType);
            }else {
                if (jsonObject.get("SPZXType")!=null) {
                    doctorDO.setSpzxChargeType(jsonObject.get("SPZXType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("TWFZFee")==null?"":jsonObject.get("TWFZFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("TWFZFee").toString(),doctorDO.getName());
                doctorDO.setTwfzChargeType(chargeType);
            }else {
                if (jsonObject.get("TWFZType")!=null){
                    doctorDO.setTwfzChargeType(jsonObject.get("TWFZType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("SPFZFee")==null?"":jsonObject.get("SPFZFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("SPFZFee").toString(),doctorDO.getName());
                doctorDO.setSpfzChargeType(chargeType);
            }else {
                if (jsonObject.get("SPFZType")!=null){
                    doctorDO.setSpfzChargeType(jsonObject.get("SPFZType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("JYZXFee")==null?"":jsonObject.get("JYZXFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("JYZXFee").toString(),doctorDO.getName());
                doctorDO.setJyzxChargeType(chargeType);
            }else {
                if (jsonObject.get("JYZXType")!=null){
                    doctorDO.setJyzxChargeType(jsonObject.get("JYZXType").toString());
                }
            }
            if (StringUtils.isNoneBlank(jsonObject.get("XTFZFee")==null?"":jsonObject.get("XTFZFee").toString())){
                String chargeType = findOrCreateChargeType(jsonObject.get("XTFZFee").toString(),doctorDO.getName());
                doctorDO.setXtfzChargeType(chargeType);
            }else {
                if (jsonObject.get("XTFZType")!=null){
                    doctorDO.setXtfzChargeType(jsonObject.get("XTFZType").toString());
                }
            }
        }
        //baseDoctorDao.update(doctorId,introduce,expertise,photo,outpatientType);
        baseDoctorDao.save(doctorDO);
        //删除医生旧专病门诊,保存新专病门诊
        Map<String,Object> params = new HashedMap();
        String sqlTotal ="SELECT " +
@ -487,4 +548,27 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
    public String findOrCreateChargeType(String fee,String doctorName){
        if (StringUtils.isNoneBlank(fee)){
            double chargeFee = Double.parseDouble(fee);
            WlyyChargeDictDO wlyyChargeDictDO = wlyyChargeDictDao.findByReqFee(chargeFee);
            if (null!=wlyyChargeDictDO){
                return wlyyChargeDictDO.getChargeType();
            }else {
                wlyyChargeDictDO = new WlyyChargeDictDO();
                wlyyChargeDictDO.setCreateTime(new Date());
                wlyyChargeDictDO.setReqFee(chargeFee);
                wlyyChargeDictDO.setChargeType(fee+"");
                wlyyChargeDictDO.setChargeName(doctorName+"创建的号别");
                wlyyChargeDictDO = wlyyChargeDictDao.save(wlyyChargeDictDO);
                return  wlyyChargeDictDO.getChargeType();
            }
        }else {
            return "";
        }
    }
    public List<WlyyChargeDictDO> findChargeDicts(){
        List<WlyyChargeDictDO> wlyyChargeDictDOS =  wlyyChargeDictDao.findByDeptTypeCode("6");
        return wlyyChargeDictDOS;
    }
}

+ 19 - 8
business/base-service/src/main/java/com/yihu/jw/evaluate/score/service/BaseEvaluateScoreService.java

@ -6,6 +6,7 @@ import com.yihu.jw.evaluate.score.dao.BaseEvaluateScoreDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -30,7 +31,8 @@ public class BaseEvaluateScoreService extends BaseJpaService<BaseEvaluateScoreDO
    private BaseEvaluateScoreDao baseEvaluateScoreDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Value("${wechat.id}")
    private String wxId;
    /**
     * 计算总评分,周同比,日环比
@ -70,7 +72,7 @@ public class BaseEvaluateScoreService extends BaseJpaService<BaseEvaluateScoreDO
     * @return
     */
    private Double getAvgScore(String startTime,String endTime,String area,int level){
        String sql = "select count(*) as total, sum(score) as score from base.base_evaluate_score o where ";
        String sql = "select count(*) as total, sum(score) as score from base_evaluate_score o where ";
        if (level == 4){
            sql += " o.doctor IN (SELECT doctor_code FROM `base_doctor_hospital` dh where dh.org_code ='"+area+"' and dh.del=1)";
@ -81,13 +83,22 @@ public class BaseEvaluateScoreService extends BaseJpaService<BaseEvaluateScoreDO
        }else if (level == 6){
            sql += " o.doctor ='"+area+"'";
        }
        if (startTime != null){
            sql += " and o.create_time >='" + startTime + "'";
        }
        if(endTime != null){
            sql += " and o.create_time <='" + endTime + "'";
        if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            if (startTime != null){
                sql += " and o.create_time >= to_date('" + startTime + "','yyyy-mm-dd hh24:mi:ss')";
            }
            if(endTime != null){
                sql += " and o.create_time <=to_date('" + endTime + "','yyyy-mm-dd hh24:mi:ss')";
            }
        }else {
            if (startTime != null){
                sql += " and o.create_time >='" + startTime + "'";
            }
            if(endTime != null){
                sql += " and o.create_time <='" + endTime + "'";
            }
        }
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        double total = 0d;
        double score = 0d;

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

@ -2,6 +2,7 @@ package com.yihu.jw.hospital.dict;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
@ -18,4 +19,8 @@ public interface WlyyHospitalSysDictDao extends PagingAndSortingRepository<WlyyH
    WlyyHospitalSysDictDO findById(String id);
    List<WlyyHospitalSysDictDO> findByDictName(String dictName);
    @Query("from WlyyHospitalSysDictDO where 1=1")
    List<WlyyHospitalSysDictDO> findAlldict();
    @Query("from WlyyHospitalSysDictDO where dictCode = ?1")
    List<WlyyHospitalSysDictDO> findByDictCode(String dictCode);
}

+ 26 - 22
business/base-service/src/main/java/com/yihu/jw/hospital/mapping/service/PatientMappingService.java

@ -110,33 +110,37 @@ public class PatientMappingService {
        }
    }
    public String findHisPatNoByPatient(String patient)throws Exception{
    public String findHisPatNoByPatient(String patient,String cardNo)throws Exception{
        logger.info("findHisPatNoByPatient:"+patient);
        BasePatientDO patientDO = basePatientDao.findById(patient);
        logger.info("patientDO:"+patientDO.toString());
        PatientMappingDO patientMappingDO = patientMappingDao.findByIdcardAndSource(patientDO.getIdcard(),"1");
        if(patientMappingDO!=null){
            return patientMappingDO.getMappingCode();
        }
        JSONArray rs = entranceService.BS15018(patientDO.getIdcard(),null,demoFlag);
        PatientMappingDO patientMappingDO = patientMappingDao.findByIdcardAndSource(patientDO.getIdcard(),"1");
        if(rs!=null&&rs.size()>0){
            //获取居民信息
            JSONObject json = rs.getJSONObject(0);
            String mappingCode = json.getString("PAT_NO").trim();
            //存储对应映射关系
            PatientMappingDO mappingDO = new PatientMappingDO();
            mappingDO.setSource("1");
            mappingDO.setPatientName(patientDO.getName());
            mappingDO.setPatient(patientDO.getId());
            mappingDO.setMappingCode(mappingCode);
            mappingDO.setCreateTime(new Date());
            mappingDO.setIdcard(patientDO.getIdcard());
            patientMappingDao.save(mappingDO);
            return mappingCode;
            for (int i=0;i<rs.size();i++){
                //获取居民信息
                JSONObject json = rs.getJSONObject(i);
                if (cardNo.equalsIgnoreCase(json.getString("CARD_NO").trim())){
                    String mappingCode = json.getString("PAT_NO").trim();
                    if (patientMappingDO!=null){
                        patientMappingDO.setMappingCode(mappingCode);
                        patientMappingDO = patientMappingDao.save(patientMappingDO);
                    }else {
                        //存储对应映射关系
                        PatientMappingDO mappingDO = new PatientMappingDO();
                        mappingDO.setSource("1");
                        mappingDO.setPatientName(patientDO.getName());
                        mappingDO.setPatient(patientDO.getId());
                        mappingDO.setMappingCode(mappingCode);
                        mappingDO.setCreateTime(new Date());
                        mappingDO.setIdcard(patientDO.getIdcard());
                        patientMappingDO = patientMappingDao.save(mappingDO);
                    }
                }
            }
            return patientMappingDO.getMappingCode();
        }else{
            return null;
        }

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

@ -12,7 +12,6 @@ import com.yihu.jw.entity.base.dict.DictDeptDescDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
@ -80,7 +79,6 @@ import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.utils.GenerateUserSig;
import com.yihu.jw.utils.Pkis.PKIService_PortType;
import com.yihu.jw.utils.Pkis.PKIService_ServiceLocator;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.WebserviceUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
@ -281,9 +279,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @return
     * @throws Exception
     */
    public List<WlyyOutpatientVO> findOutpatientList(String patient, String startTime, String endTime, boolean demoFlag,String ksdm) throws Exception {
    public List<WlyyOutpatientVO> findOutpatientList(String patient, String startTime, String endTime, boolean demoFlag,String ksdm,String cardNo) throws Exception {
        logger.info("findOutpatientList patient:" + patient);
        String patNo = patientMappingService.findHisPatNoByPatient(patient);
        String patNo = patientMappingService.findHisPatNoByPatient(patient,cardNo);
        if (StringUtils.isBlank(patNo)) {
            return null;
        }
@ -300,7 +298,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     */
    public WlyyOutpatientVO findOutpatientInfo(String patient, String conNo) throws Exception {
        logger.info("findOutpatientList patient:" + patient);
        String patNo = patientMappingService.findHisPatNoByPatient(patient);
        /*String patNo = patientMappingService.findHisPatNoByPatient(patient);*/
        BasePatientDO patientDO = basePatientDao.findById(patient);
        if (patientDO==null){
            return null;
        }
        PatientMappingDO patientMappingDO = patientMappingDao.findByIdcardAndSource(patientDO.getIdcard(),"1");
        String patNo = "";
        if (patientMappingDO!=null){
            patNo = patientMappingDO.getMappingCode();
        }
        if (StringUtils.isBlank(patNo)) {
            return null;
        }
@ -309,7 +316,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (list != null && list.size() > 0) {
            WlyyOutpatientVO outpatientVO = list.get(0);
            BasePatientDO patientDO = basePatientDao.findById(patient);
            outpatientVO.setSex(patientDO.getSex() + "");
            outpatientVO.setBirthday(patientDO.getBirthday());
            outpatientVO.setIdcard(patientDO.getIdcard());
@ -322,7 +328,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     *
     */
    public List<WlyyPrescriptionVO> findOriginPrescriptionList(String registerSn, String patient, String realOrder, String admNo, boolean demoFlag) throws Exception {
        String patNo = patientMappingService.findHisPatNoByPatient(patient);
        /*String patNo = patientMappingService.findHisPatNoByPatient(patient);*/
        BasePatientDO patientDO = basePatientDao.findById(patient);
        if (patientDO==null){
            return null;
        }
        PatientMappingDO patientMappingDO = patientMappingDao.findByIdcardAndSource(patientDO.getIdcard(),"1");
        String patNo = "";
        if (patientMappingDO!=null){
            patNo = patientMappingDO.getMappingCode();
        }
        if (StringUtils.isBlank(patNo)) {
            return null;
        }
@ -348,7 +363,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @throws Exception
     */
    public WlyyPrescriptionVO findOriginPrescription(String registerSn, String patient, String admNo, String realOrder, boolean demoFlag) throws Exception {
        String patNo = patientMappingService.findHisPatNoByPatient(patient);
        /*String patNo = patientMappingService.findHisPatNoByPatient(patient);*/
        BasePatientDO patientDO = basePatientDao.findById(patient);
        if (patientDO==null){
            return null;
        }
        PatientMappingDO patientMappingDO = patientMappingDao.findByIdcardAndSource(patientDO.getIdcard(),"1");
        String patNo = "";
        if (patientMappingDO!=null){
            patNo = patientMappingDO.getMappingCode();
        }
        if (StringUtils.isBlank(patNo)) {
            return null;
        }
@ -1453,7 +1477,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param dept
     * @return
     */
    public MixEnvelop findDoctorWithWork(String orgCode, String dept, String chargeType, String doctorCode, String outpatientType, String startDate, String endDate, String key, String consultStatus, Integer page, Integer size) {
    public MixEnvelop findDoctorWithWork(String orgCode, String dept, String chargeType, String doctorCode, String outpatientType, String startDate, String endDate, String key, String consultStatus, Integer page, Integer size,String ywCode) {
        String totalSql = "SELECT " +
                " count(1) AS \"total\" " +
@ -1607,7 +1631,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //获取排班
            for (Map<String, Object> doctor : list) {
                String id = (String) doctor.get("id");
                List<WlyyDoctorWorkTimeVO> times = findDoctorWorkTime(id, orgCode);
                List<WlyyDoctorWorkTimeVO> times = findDoctorWorkTime(id, orgCode,ywCode);
                doctor.put("workTime", times);
                String deptTyepCode = "";
                if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
@ -1631,6 +1655,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        "\ta.req_fee as \"spfzFee\",\n" +
                        "\tb.req_fee as \"spzxFee\",\n" +
                        "\tv.req_fee as \"twzxFee\",\n" +
                        "\tg.req_fee as \"jyzxFee\",\n" +
                        "\td.req_fee as \"xtzxFee\"\n" +
                        "FROM\n" +
                        "\tbase_doctor t\n" +
@ -1638,7 +1663,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                        "LEFT JOIN wlyy_charge_dict d ON t.twzx_charge_type = d.charge_type\n" +
                        " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                        "WHERE t.id = '"+doctor.get("id")+"' ";
                chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
                /*if (null!=doctor.get("chargeType")){
@ -1671,7 +1697,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, count);
    }
    public List<WlyyDoctorWorkTimeVO> findDoctorWorkTime(String doctor, String hospital) {
    public List<WlyyDoctorWorkTimeVO> findDoctorWorkTime(String doctor, String hospital,String ywCode) {
        List<WlyyHospitalWorkRuleDO> list = wlyyHospitalWorkRuleDao.findByHospital(hospital);
@ -1692,12 +1718,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            Date endDate = DateUtil.stringToDate(maxDateString, "yyyy-MM-dd HH:mm:ss");
            List<WlyyDoctorWorkTimeVO> timeVOs = new ArrayList<>();
            List<WlyyDoctorWorkTimeDO> timeDOs = doctorWorkTimeDao.findDoctorWorkTime(doctor, new Date(), endDate);
            if (timeDOs != null && timeDOs.size() > 0) {
                convertToModels(timeDOs, timeVOs, WlyyDoctorWorkTimeVO.class);
                if (timeVOs != null && timeVOs.size() > 0) {
                    for (WlyyDoctorWorkTimeVO timeVO : timeVOs) {
                        timeVO.setCount(findWorkTimeInfoCout(timeVO.getId()));
            String isCheckWork = "1";//1需要判断医生在班0不需要
            if (StringUtils.isNoneBlank(ywCode)){
                WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById(ywCode);
                if (wlyyHospitalSysDictDO!=null){
                    isCheckWork = wlyyHospitalSysDictDO.getDictValue();
                }
            }
            if ("1".equalsIgnoreCase(isCheckWork)){
                List<WlyyDoctorWorkTimeDO> timeDOs = doctorWorkTimeDao.findDoctorWorkTime(doctor, new Date(), endDate);
                if (timeDOs != null && timeDOs.size() > 0) {
                    convertToModels(timeDOs, timeVOs, WlyyDoctorWorkTimeVO.class);
                    if (timeVOs != null && timeVOs.size() > 0) {
                        for (WlyyDoctorWorkTimeVO timeVO : timeVOs) {
                            timeVO.setCount(findWorkTimeInfoCout(timeVO.getId()));
                        }
                    }
                }
            }
@ -3577,6 +3613,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "\ta.req_fee as \"spfzFee\",\n" +
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\tg.req_fee as \"jyzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
@ -3585,6 +3622,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                    "WHERE t.id = '"+doctorDO.getId()+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            rs.put("chargeTypeList",chargeDictDOLists);
@ -3598,7 +3636,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                rs.put("dept", hospitalDOs.get(0).getDeptCode());
                if (StringUtils.isNotBlank(withWork) && "1".equals(withWork)) {
                    List<WlyyDoctorWorkTimeVO> times = findDoctorWorkTime(doctor, hospitalDOs.get(0).getOrgCode());
                    List<WlyyDoctorWorkTimeVO> times = findDoctorWorkTime(doctor, hospitalDOs.get(0).getOrgCode(),"");
                    rs.put("workTime", times);
                }
            } else {
@ -3861,6 +3899,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "\ta.req_fee as \"spfzFee\",\n" +
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\tg.req_fee as \"jyzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
@ -3869,6 +3908,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                    "WHERE t.id = '"+doctorDO.getId()+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            rs.put("chargeTypeList",chargeDictDOLists);
@ -4676,7 +4716,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        } else {
            sql += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format,";
        }
        sql += "outpatient.disease_img AS \"disease_img\"," +
        sql += " outpatient.disease_img AS \"disease_img\"," +
                "outpatient.description AS \"description\"," +
                "room.reservation_type AS \"reservation_type\"," +
                "outpatient.origin_con_no AS \"origin_con_no\" " +
@ -4716,7 +4756,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //在线复诊
            sql += " AND room.reservation_type !=3 AND room.consult_type =2";
        } else {
            sql += " AND room.reservation_type !=2";
        }
        if (StringUtils.isNoneBlank(dept)) {
@ -5442,6 +5482,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "\ta.req_fee as \"spfzFee\",\n" +
                    "\tb.req_fee as \"spzxFee\",\n" +
                    "\tv.req_fee as \"twzxFee\",\n" +
                    "\tg.req_fee as \"jyzxFee\",\n" +
                    "\td.req_fee as \"xtzxFee\"\n" +
                    "FROM\n" +
                    "\tbase_doctor t\n" +
@ -5450,6 +5491,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
                    "WHERE t.id = '"+map.get("id")+"' ";
            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
            map.put("chargeTypeList",chargeDictDOLists);
@ -7635,7 +7677,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public JSONArray findPatientRecord(String idcard, String patient, String admitNum, String ybcard) throws Exception {
        String patientId = null;
        if (StringUtils.isNotBlank(patient)) {
            patientId = patientMappingService.findHisPatNoByPatient(patient);
            /*patientId = patientMappingService.findHisPatNoByPatient(patient);*/
            BasePatientDO patientDO = basePatientDao.findById(patient);
            if (patientDO==null){
                return null;
            }
            PatientMappingDO patientMappingDO = patientMappingDao.findByIdcardAndSource(patientDO.getIdcard(),"1");
            if (patientMappingDO!=null){
                patientId = patientMappingDO.getMappingCode();
            }
        }
        return entranceService.BS10008(idcard, null,null,patientId, admitNum, ybcard, demoFlag);
    }
@ -9655,19 +9705,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                                }
                                doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (!doctorDO.getOutpatientType().contains("zj")){
                                        doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zj");
                                    if (!doctorDO.getOutpatientType().contains("zjsp")){
                                        doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zjsp");
                                    }
                                }else {
                                    doctorDO.setOutpatientType("zj");
                                    doctorDO.setOutpatientType("zjsp");
                                }
                            }else {
                                if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
                                    if (doctorDO.getOutpatientType().contains("zj")){
                                        doctorDO.getOutpatientType().replace(",zj","");
                                    if (doctorDO.getOutpatientType().contains("zjsp")){
                                        doctorDO.getOutpatientType().replace(",zjsp","");
                                    }
                                }else{
                                    doctorDO.setOutpatientType("zj");
                                    doctorDO.setOutpatientType("zjsp");
                                }
                            }
@ -9753,11 +9803,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        }
                        doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                        if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
                            if (!doctorDO.getOutpatientType().contains("zj")) {
                                doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zj");
                            if (!doctorDO.getOutpatientType().contains("zjsp")) {
                                doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zjsp");
                            }
                        }else {
                            doctorDO.setOutpatientType("zj");
                            doctorDO.setOutpatientType("zjsp");
                        }
                    }
                    baseDoctorDao.save(doctorDO);
@ -9775,10 +9825,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "\tt.source as \"source\",\n" +
                "\tt.outpatient_type as \"outpatientType\",\n" +
                "\tt.create_time as \"createTime\",\n" +
                "\th.org_code as \"orgCode\",\n" +
                "\tb.idcard as \"idCard\" \n" +
                "FROM\n" +
                "\twlyy_outpatient t\n" +
                "\tLEFT JOIN base_patient b ON t.patient = b.id where 1=1 ";
                "\tLEFT JOIN base_patient b ON t.patient = b.id " +
                " left join base_doctor_hospital h on t.doctor = h.doctor_code where 1=1 ";
        if (StringUtils.isNoneBlank(startTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
@ -9805,11 +9857,59 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        for (Map<String,Object> map:list){
            if (map.get("createTime")!=null){
                map.put("createTime",DateUtil.dateToStrLong(DateUtil.strToDateLong(map.get("createTime").toString())));
                map.put("orgCode",wechatId);
            }
        }
        return list;
    }
    public com.alibaba.fastjson.JSONObject getWorkDoctorCount(String nowTime,String orgCode){
        String sql = "select count(*) as \"total\",t.doctor as \"doctor\" from wlyy_doctor_work_time t " +
                " left join base_doctor_hospital b on t.doctor = b.doctor_code where 1=1 ";
        if(StringUtils.isNoneBlank(nowTime)){
            if("xm_ykyy_wx".equals(wechatId)){
                if (flag){
                    sql+=" and t.start_time >= '" + nowTime + " 00:00:00' and t.end_time <='"+nowTime+" 23:59:59' ";
                }else {
                    sql+=" and t.start_time >= to_date('" + nowTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') and t.end_time <=to_date('"+nowTime+" 23:59:59', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and t.start_time >= '" + nowTime + " 00:00:00' and t.end_time <='"+nowTime+" 23:59:59' ";
            }
        }
        if(StringUtils.isNoneBlank(orgCode)){
            sql+=" and b.org_code ='"+orgCode+"'";
        }
        sql+=" group by t.doctor";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        long count =0;
        if(list!=null){
            count = list.size();
        }
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        jsonObject.put("workDoctorCount",count);
        return  jsonObject;
    }
    public List<WlyyHospitalSysDictDO> findAllDict(){
        List<WlyyHospitalSysDictDO> wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findAlldict();
        return  wlyyHospitalSysDictDOS;
    }
    public WlyyHospitalSysDictDO findDictById(String dictId){
        WlyyHospitalSysDictDO wlyyHospitalSysDictDOS = wlyyHospitalSysDictDao.findById(dictId);
        return  wlyyHospitalSysDictDOS;
    }
    public WlyyHospitalSysDictDO updateDictById(String dictId,String dictValue){
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById(dictId);
        if(wlyyHospitalSysDictDO!=null){
            if (StringUtils.isNoneBlank(dictValue)){
                wlyyHospitalSysDictDO.setDictValue(dictValue);
                wlyyHospitalSysDictDao.save(wlyyHospitalSysDictDO);
            }
        }
        return  wlyyHospitalSysDictDO;
    }
    public List<WlyyHospitalSysDictDO> findSysByDictCode(String dictCode){
        List<WlyyHospitalSysDictDO> isWork=sysDictDao.findByDictCode(dictCode);
        return isWork;
    }
}

+ 137 - 29
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/WorkTimeService.java

@ -1,5 +1,7 @@
package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
@ -7,14 +9,17 @@ import com.yihu.jw.doctor.service.excel.DoctorWorkTimeExcelDO;
import com.yihu.jw.doctor.service.excel.DoctorWorkTimeMainExcelDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.doctor.WlyyDoctorWorkTimeDO;
import com.yihu.jw.entity.hospital.prescription.WlyyHospitalWorkRuleDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.doctor.dao.DoctorWorkTimeDao;
import com.yihu.jw.hospital.prescription.dao.WlyyHospitalWorkRuleDao;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -52,6 +57,8 @@ public class WorkTimeService {
    @Autowired
    private BaseOrgDao baseOrgDao;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    /**
     * 保存排班规则
@ -59,13 +66,26 @@ public class WorkTimeService {
     * @return
     * @throws Exception
     */
    public WlyyHospitalWorkRuleDO saveWorkTimeRule(String workTimeRuleJson)throws Exception{
    public WlyyHospitalWorkRuleDO saveWorkTimeRule(String workTimeRuleJson,String isDoctorWork) throws Exception{
        WlyyHospitalWorkRuleDO ruleDO = objectMapper.readValue(workTimeRuleJson,WlyyHospitalWorkRuleDO.class);
        List<WlyyHospitalWorkRuleDO> orgRules = wlyyHospitalWorkRuleDao.findByHospital(ruleDO.getHospital());
        if(orgRules!=null&&orgRules.size()>0){
            wlyyHospitalWorkRuleDao.delete(orgRules);
        }
        wlyyHospitalWorkRuleDao.save(ruleDO);
        if (StringUtils.isNoneBlank(isDoctorWork)){
            JSONArray jsonArray = JSONArray.parseArray(isDoctorWork);
            if (jsonArray!=null&&jsonArray.size()>0){
                for(int i=0;i<jsonArray.size();i++){
                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                    WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById(jsonObject.getString("id"));
                    if (wlyyHospitalSysDictDO!=null&&StringUtils.isNoneBlank(jsonObject.get("value")==null?"":jsonObject.getString("value"))){
                        wlyyHospitalSysDictDO.setDictValue(jsonObject.getString("value"));
                        wlyyHospitalSysDictDao.save(wlyyHospitalSysDictDO);
                    }
                }
            }
        }
        return ruleDO;
    }
@ -87,34 +107,122 @@ public class WorkTimeService {
     * @param doctor
     * @return
     */
    public Boolean checkDoctorWork(String doctor){
        String sql = "SELECT " +
                " d.id " +
                " FROM " +
                " base_doctor d " +
                " WHERE " +
                " d.id =:doctor " +
                " AND ( " +
                " EXISTS ( " +
                "  SELECT " +
                "   t.id " +
                "  FROM " +
                "   wlyy_doctor_work_time t " +
                "  WHERE " +
                "   t.doctor = d.id " +
                "  AND t.start_time <=:startTime " +
                "  AND t.end_time >=:endTime" +
                " ) " +
                " OR d.consult_status = '1' " +
                ")";
        Map<String,Object> params = new HashedMap();
        params.put("doctor",doctor);
        Date date = new Date();
        params.put("startTime",date);
        params.put("endTime",date);
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params);
        if(list!=null&&list.size()>0){
            return true;
    public Boolean checkDoctorWork(String doctor,String ywCode){
        logger.info("当前判断的业务Code:"+ywCode);
        if (StringUtils.isNoneBlank(ywCode)){
            if (ywCode.contains(",")){
                String[] split = ywCode.split(",");
                for (int i = 0;i<split.length;i++){
                    WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById(split[i]);
                    String isCheckDoctorWork = "1";
                    if (wlyyHospitalSysDictDO!=null){
                        isCheckDoctorWork = wlyyHospitalSysDictDO.getDictValue();
                    }
                    if ("1".equalsIgnoreCase(isCheckDoctorWork)){
                        String sql = "SELECT " +
                                " d.id " +
                                " FROM " +
                                " base_doctor d " +
                                " WHERE " +
                                " d.id =:doctor " +
                                " AND ( " +
                                " EXISTS ( " +
                                "  SELECT " +
                                "   t.id " +
                                "  FROM " +
                                "   wlyy_doctor_work_time t " +
                                "  WHERE " +
                                "   t.doctor = d.id " +
                                "  AND t.start_time <=:startTime " +
                                "  AND t.end_time >=:endTime" +
                                " ) " +
                                " OR d.consult_status = '1' " +
                                ")";
                        Map<String,Object> params = new HashedMap();
                        params.put("doctor",doctor);
                        Date date = new Date();
                        params.put("startTime",date);
                        params.put("endTime",date);
                        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params);
                        if(list!=null&&list.size()>0){
                            return true;
                        }else {
                            return false;
                        }
                    }else {
                        return true;
                    }
                }
            }else {
                WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById(ywCode);
                String isCheckDoctorWork = "1";
                if (wlyyHospitalSysDictDO!=null){
                    isCheckDoctorWork = wlyyHospitalSysDictDO.getDictValue();
                }
                if ("1".equalsIgnoreCase(isCheckDoctorWork)){
                    String sql = "SELECT " +
                            " d.id " +
                            " FROM " +
                            " base_doctor d " +
                            " WHERE " +
                            " d.id =:doctor " +
                            " AND ( " +
                            " EXISTS ( " +
                            "  SELECT " +
                            "   t.id " +
                            "  FROM " +
                            "   wlyy_doctor_work_time t " +
                            "  WHERE " +
                            "   t.doctor = d.id " +
                            "  AND t.start_time <=:startTime " +
                            "  AND t.end_time >=:endTime" +
                            " ) " +
                            " OR d.consult_status = '1' " +
                            ")";
                    Map<String,Object> params = new HashedMap();
                    params.put("doctor",doctor);
                    Date date = new Date();
                    params.put("startTime",date);
                    params.put("endTime",date);
                    List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params);
                    if(list!=null&&list.size()>0){
                        return true;
                    }else {
                        return false;
                    }
                }else {
                    return true;
                }
            }
        }else {
            String sql = "SELECT " +
                    " d.id " +
                    " FROM " +
                    " base_doctor d " +
                    " WHERE " +
                    " d.id =:doctor " +
                    " AND ( " +
                    " EXISTS ( " +
                    "  SELECT " +
                    "   t.id " +
                    "  FROM " +
                    "   wlyy_doctor_work_time t " +
                    "  WHERE " +
                    "   t.doctor = d.id " +
                    "  AND t.start_time <=:startTime " +
                    "  AND t.end_time >=:endTime" +
                    " ) " +
                    " OR d.consult_status = '1' " +
                    ")";
            Map<String,Object> params = new HashedMap();
            params.put("doctor",doctor);
            Date date = new Date();
            params.put("startTime",date);
            params.put("endTime",date);
            List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,params);
            if(list!=null&&list.size()>0){
                return true;
            }
        }
        return false;
    }

+ 38 - 8
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -42,7 +42,6 @@ import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.order.pay.wx.WeChatConfig;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
@ -51,6 +50,8 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.mysql.query.BaseJpaService;
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;
@ -276,7 +277,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     *
     */
    public List<WlyyPrescriptionVO> findOriginPrescriptionList(String registerSn,String patient,String realOrder,String admNo,boolean demoFlag)throws Exception{
        String patNo =patientMappingService.findHisPatNoByPatient(patient);
        String patNo =patientMappingService.findHisPatNoByPatient(patient,null);
        if(StringUtils.isBlank(patNo)){
            return null;
        }
@ -844,7 +845,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     * @return
     * @throws Exception
     */
    public Map<String,Object> savePrescriptionOrder(String code,Double price,String tradeType,String wechatId) throws Exception {
    public Map<String,Object> savePrescriptionOrder(String code,Double price,String tradeType,String wechatId,String appletCode) throws Exception {
        WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
        Map<String,Object> map = new HashedMap();
        if(wxWechatDO==null){
@ -854,12 +855,22 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        if (businessOrderDO!=null){
            List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
            String openId = "";
            if (patientWechatDos!=null&&patientWechatDos.size()!=0){
                openId = patientWechatDos.get(0).getOpenid();
            }
            if (!StringUtils.isNoneBlank(tradeType)){
                tradeType=WeChatConfig.TRADE_TYPE_JSAPI;
            if (StringUtils.isNotBlank(appletCode)){
                logger.info("appletCode不为空"+appletCode);
                Map<String,Object> objectMap = checkApplets(appletCode,wxWechatDO.getApplets(),wxWechatDO.getAppletsSecret());
                if (objectMap!=null){
                    openId = objectMap.get("openid").toString();
                    logger.info("appletCode"+appletCode);
                    logger.info("openid"+openId);
                }
            }else {
                logger.info("appletCode为空"+appletCode);
                List<BasePatientWechatDo> patientWechatDo = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
                if (patientWechatDo!=null&&patientWechatDo.size()!=0){
                    openId = patientWechatDo.get(0).getOpenid();
                }
            }
            String url = wxWechatDO.getBaseUrl();
            String notifyUrl =url;
            String totalFee =businessOrderDO.getPayPrice().intValue()+"";
@ -868,6 +879,25 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        return map;
    }
    public Map<String, Object> checkApplets(String code,String appid,String appSecret) throws Exception {
        HttpUtils httpUtils = new HttpUtils();
        Map<String, Object> param = new HashedMap();
        param.put("appid", appid);
        param.put("secret", appSecret);
        param.put("js_code", code);
        param.put("grant_type", "authorization_code");
        HttpResponse response = httpUtils.doGet("https://api.weixin.qq.com/sns/jscode2session", param);
        org.json.JSONObject rs = new org.json.JSONObject(response.getContent());
        Map<String, Object> res = new HashedMap();
        logger.info("checkApplets:"+response.getContent());
        if (rs.has("openid")){
            res.put("openid", rs.getString("openid"));
            res.put("sessionKey", rs.getString("session_key"));
        }
        return res;
    }
    /**
     * 获取诊断

+ 11 - 3
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -20,6 +20,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -54,6 +55,8 @@ public class StatisticsEsService {
    private BaseCityDao cityDao;
    @Autowired
    private BaseEvaluateScoreService baseEvaluateScoreService;
    @Value("${wechat.id}")
    private String wxId;
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
@ -116,7 +119,12 @@ public class StatisticsEsService {
        object.put("prescriptionRate",prescriptionRate);//开方率
        String startTime = DateUtil.getStringDateShort()+" 00:00:00";
        String endTime = DateUtil.getStringDateShort() +" 23:59:59";
        String sql = "select count(*) as \"total\" from wlyy_consult_oupatient_info o where  o.create_time >='"+startTime+"' and o.create_time <='"+endTime+"'";
        String sql = "";
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            sql = "select count(*) as \"total\" from wlyy_consult_outpatient_info o where  o.create_time >= to_date('"+startTime+"','yyyy-mm-dd hh24:mi:ss') and o.create_time <= to_date('"+endTime+"','yyyy-mm-dd hh24:mi:ss')";
        }else {
            sql = "select count(*) as \"total\" from wlyy_consult_outpatient_info o where  o.create_time >='"+startTime+"' and o.create_time <='"+endTime+"'";
        }
        if (level==4){
            sql += " and o.doctor IN (SELECT doctor_code as \"doctor_code\" FROM `base_doctor_hospital` dh where dh.org_code ='"+area+"' and dh.del=1)";
        }if (level==2){
@ -129,7 +137,7 @@ public class StatisticsEsService {
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        Long count = 0L;
        if(rstotal!=null&&rstotal.size()>0){
            count = (Long) rstotal.get(0).get("total");
            count =Long.parseLong(rstotal.get(0).get("total").toString()) ;
        }
        object.put("todayOutPatientCount",count);//今日问诊量
        Map<String, Object> scoreAndPercentage = baseEvaluateScoreService.getScoreAndPercentage(area, level);
@ -1091,7 +1099,7 @@ public class StatisticsEsService {
            List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sqlCount);//总人数
            Long total = 0L;
            if(rstotal!=null&&rstotal.size()>0){
                total = (Long) rstotal.get(0).get("total");
                total = Long.parseLong(rstotal.get(0).get("total").toString()) ;
            }
            for (Map<String,Object> map:mapList){
                Integer count = Integer.parseInt(map.get("count").toString());

+ 4 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -1,5 +1,6 @@
package com.yihu.jw.entity;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
@ -18,13 +19,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
//==========mysql 环境 id策略======================================================
/*    @GeneratedValue(generator = "generator")
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)*/
    @Column(name = "id", unique = true, nullable = false)
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
 /*  @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

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

@ -276,6 +276,18 @@ public class BaseDoctorDO extends UuidIdentityEntityWithOperator {
     * 协同复诊号别
     */
    private String xtfzChargeType;
    /**
     * 家医咨询号别
     */
    private String jyzxChargeType;
    @Column(name = "jyzx_charge_type")
    public String getJyzxChargeType() {
        return jyzxChargeType;
    }
    public void setJyzxChargeType(String jyzxChargeType) {
        this.jyzxChargeType = jyzxChargeType;
    }
    @Column(name = "YKT_DOCTOR_ID")
    public String getYktDoctorId() {

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

@ -1415,6 +1415,12 @@ public class BaseHospitalRequestMapping {
        public static final String findHospitalInfo = "/findHospitalInfo";
        public static final String synYktZxPrice = "/synYktZxPrice";
        public static final String findHospitalConsultInfo = "/findHospitalConsultInfo";
        public static final String findDictLists = "/findDictLists";
        public static final String findWorkDoctorCount = "/findWorkDoctorCount";
        public static final String findAllDict = "/findAllDict";
        public static final String findDictById = "/findDictById";
        public static final String updateDictById = "/updateDictById";
        public static final String findDictByCode = "/findDictByCode";
    }
    /**

+ 9 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/dao/patient/WlyyHospitalSysDictDao.java

@ -0,0 +1,9 @@
package com.yihu.jw.security.dao.patient;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface WlyyHospitalSysDictDao  extends PagingAndSortingRepository<WlyyHospitalSysDictDO, String>, JpaSpecificationExecutor<WlyyHospitalSysDictDO> {
    WlyyHospitalSysDictDO findDictById(String id);
}

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

@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import com.netflix.discovery.converters.Auto;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.login.BaseLoginLogDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.restmodel.ResultStatus;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -16,6 +18,7 @@ import com.yihu.jw.security.dao.OauthKeypairDao;
import com.yihu.jw.security.dao.doctor.BaseDoctorDao;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.security.dao.patient.WechatDao;
import com.yihu.jw.security.dao.patient.WlyyHospitalSysDictDao;
import com.yihu.jw.security.exception.ImgCaptchaException;
import com.yihu.jw.security.login.service.BaseLoginLogService;
import com.yihu.jw.security.model.*;
@ -149,6 +152,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    private XzzxService xzzxService;
    @Autowired
    private WechatDao wechatDao;
    @Autowired
    private WlyyHospitalSysDictDao wlyyhospitalSysdictDao;
    @PostConstruct
    private void init() {
@ -174,12 +179,20 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    public ResponseEntity<Oauth2Envelop<WlyyUserSimple>> login(@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");
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedPictureCode");
        String isNeedPictureCode = "1";
        if (wlyyHospitalSysDictDO!=null){
            isNeedPictureCode = wlyyHospitalSysDictDO.getDictValue();
        }
        logger.info("isNeedPictureCode:"+isNeedPictureCode);
        if ("1".equalsIgnoreCase(isNeedPictureCode)){
            //图形验证码验证
            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");
@ -1720,14 +1733,25 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    public ResponseEntity<Oauth2Envelop<WlyyUserSimple>> ykLogin(@RequestParam Map<String, String> parameters, HttpSession httpSession) throws Exception {
        //图形验证码验证
        String key = parameters.get("key");
        String text = parameters.get("text");
        /*String key = parameters.get("key");
        String text = parameters.get("text");*/
        String captcha = parameters.get("captcha");
        String loginType = parameters.get("login_type");
        String appletCode = parameters.get("appletCode");
        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");
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedPictureCode");
        String isNeedPictureCode = "1";
        if (wlyyHospitalSysDictDO!=null){
            isNeedPictureCode = wlyyHospitalSysDictDO.getDictValue();
        }
        logger.info("isNeedPictureCode:"+isNeedPictureCode);
        if ("1".equalsIgnoreCase(isNeedPictureCode)){
            //图形验证码验证
            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");
                }
            }
        }
        String username = parameters.get("username");
@ -2025,12 +2049,23 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @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");
        String text = parameters.get("text");*/
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedPictureCode");
        String isNeedPictureCode = "1";
        if (wlyyHospitalSysDictDO!=null){
            isNeedPictureCode = wlyyHospitalSysDictDO.getDictValue();
        }
        logger.info("isNeedPictureCode:"+isNeedPictureCode);
        if ("1".equalsIgnoreCase(isNeedPictureCode)){
            //图形验证码验证
            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");

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

@ -19,7 +19,6 @@ 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.codec.digest.DigestUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -27,10 +26,10 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.yihu.jw.util.common.PwdUtil.randomString;
@ -405,7 +404,7 @@ public class YkyyService {
    public String updateYkyyDoctor(String idCard,String verifyCode,String yktDoctorId)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";
        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);
@ -435,9 +434,10 @@ public class YkyyService {
                            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"));
                            if(StringUtils.isNoneBlank(doctorJson.getString("jobTitleCode"))){
                                doctor.setJobTitleCode(doctorJson.getString("jobTitleCode"));
                                doctor.setJobTitleName(doctorJson.getString("jobTitleName"));
                            }
                            doctor.setVerifyCode(verifyCode);
                            doctor.setYktDoctorId(yktDoctorId);
//                            doctor.setExpertise(doctorJson.getString("expertise"));
@ -487,7 +487,7 @@ public class YkyyService {
                            doctor.setLocked(0);
                            doctor.setCreateTime(new Date());
                            doctor.setJobTitleCode(doctorJson.getString("jobtitlecode"));
                            doctor.setJobTitleCode(doctorJson.getString("jobTitleCode"));
                            doctor.setJobTitleName(doctorJson.getString("jobTitleName"));
                            BaseDoctorDO temp = baseDoctorDao.save(doctor);

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

@ -14,6 +14,7 @@ import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.*;
@ -674,8 +675,10 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.checkDoctorWork)
    @ApiOperation(value = "判断医生是否在班")
    public ObjEnvelop checkDoctorWork(@ApiParam(name = "doctor", value = "判断医生是否在班")
                                      @RequestParam(value = "doctor",required = true)String doctor) throws Exception{
        return success(workTimeService.checkDoctorWork(doctor));
                                      @RequestParam(value = "doctor",required = true)String doctor,
                                      @ApiParam(name = "ywCode", value = "业务code")
                                      @RequestParam(value = "ywCode",required = false)String ywCode) throws Exception{
        return success(workTimeService.checkDoctorWork(doctor,ywCode));
    }
@ -1206,11 +1209,59 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                      @ApiParam(name = "price", value = "支付费用")
                                      @RequestParam(value = "price", required = false)Double price,
                                      @ApiParam(name = "tradeType", value = "支付方式")
                                      @RequestParam(value = "tradeType", required = false)String tradeType)throws Exception {
                                      @RequestParam(value = "tradeType", required = false)String tradeType,
                                      @ApiParam(name = "appletCode", value = "appletCode", required = false)
                                          @RequestParam(value = "appletCode",required = false)String appletCode)throws Exception {
        try {
            return success("ok",ykyyPrescriptionService.savePrescriptionOrder(code,price,tradeType,wxId));
            return success("ok",ykyyPrescriptionService.savePrescriptionOrder(code,price,tradeType,wxId,appletCode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDictLists)
    @ApiOperation(value = "查询基础号别字典", notes = "查询基础号别字典")
    public ListEnvelop findDictLists() throws Exception{
        return success(baseDoctorService.findChargeDicts());
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findWorkDoctorCount)
    @ApiOperation(value = "查询医生排版数量", notes = "查询医生排版数量")
    public ObjEnvelop<JSONObject> findWorkDoctorCount(
            @ApiParam(name = "nowTime", value = "当前时间 yyyy-MM-dd hh:mm:ss")
            @RequestParam(value = "nowTime", required = false)String nowTime,
            @ApiParam(name = "orgCode", value = "医院code")
            @RequestParam(value = "orgCode", required = false)String orgCode) throws Exception{
        return success(prescriptionService.getWorkDoctorCount(nowTime,orgCode));
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findAllDict)
    @ApiOperation(value = "查询配置字典所有项", notes = "查询配置字典所有项")
    public ListEnvelop<WlyyHospitalSysDictDO> findAllDict() throws Exception{
        return success(prescriptionService.findAllDict());
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDictById)
    @ApiOperation(value = "根据id查询配置字典", notes = "根据id查询配置字典")
        public Envelop findDictById(@ApiParam(name = "dictId", value = "dictId")
                                                                      @RequestParam(value = "dictId", required = true)String dictId) throws Exception{
        return success(prescriptionService.findDictById(dictId));
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.updateDictById)
    @ApiOperation(value = "根据id修改配置字典", notes = "根据id修改配置字典")
    public Envelop updateDictById(@ApiParam(name = "dictId", value = "dictId")
                                @RequestParam(value = "dictId", required = true)String dictId,
                                  @ApiParam(name = "dictValue", value = "dictId")
                                  @RequestParam(value = "dictValue", required = true)String dictValue) throws Exception{
        return success(prescriptionService.updateDictById(dictId,dictValue));
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDictByCode)
    @ApiOperation(value = "根据id修改配置字典", notes = "根据id修改配置字典")
    public ListEnvelop findDictByCode(@ApiParam(name = "dictCode", value = "dictCode")
                                  @RequestParam(value = "dictCode", required = true, defaultValue = "isDoctorWork")String dictCode) throws Exception{
        return success(prescriptionService.findSysByDictCode(dictCode));
    }
}

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

@ -136,10 +136,12 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @ApiParam(name = "endTime", value = "结束时间")
                                          @RequestParam(value = "endTime",required = false) String endTime,
                                          @ApiParam(name = "ksdm", value = "科室代码")
                                              @RequestParam(value = "ksdm",required = false) String ksdm) throws Exception {
                                              @RequestParam(value = "ksdm",required = false) String ksdm,
                                          @ApiParam(name = "cardNo", value = "就诊卡", required = false)
                                              @RequestParam(value = "cardNo",required = false)String cardNo) throws Exception {
        startTime = startTime+" 00:00:00";
        endTime =endTime+" 23:59:59";
        List<WlyyOutpatientVO> vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag,ksdm);
        List<WlyyOutpatientVO> vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag,ksdm,cardNo);
        return success(vos);
    }
    
@ -591,12 +593,14 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "key", required = false)String key,
                                         @ApiParam(name = "consultStatus", value = "是否在线")
                                         @RequestParam(value = "consultStatus", required = false)String consultStatus,
                                         @ApiParam(name = "ywCode", value = "业务Code")
                                             @RequestParam(value = "ywCode", required = false)String ywCode,
                                         @ApiParam(name = "page", value = "第几页")
                                         @RequestParam(value = "page", required = true)Integer page,
                                         @ApiParam(name = "size", value = "每页大小")
                                         @RequestParam(value = "size", required = true)Integer size) {
        
        return success(prescriptionService.findDoctorWithWork(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,key,consultStatus,page,size));
        return success(prescriptionService.findDoctorWithWork(orgCode,dept,chargeType,doctorCode,outpatientType,startDate,endDate,key,consultStatus,page,size,ywCode));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorWithMouthWork)
@ -1335,16 +1339,20 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.saveWorkTimeRule)
    @ApiOperation(value = "保存排班规则")
    public ObjEnvelop saveWorkTimeRule(@ApiParam(name = "workTimeRuleJson", value = "保存排班规则")
                                       @RequestParam(value = "workTimeRuleJson",required = true)String workTimeRuleJson) throws Exception{
        return success(workTimeService.saveWorkTimeRule(workTimeRuleJson));
                                       @RequestParam(value = "workTimeRuleJson",required = true)String workTimeRuleJson,
                                       @ApiParam(name = "isDoctorWorkJson", value = "判断是否排班json数据")
                                       @RequestParam(value = "isDoctorWorkJson",required = false)String isDoctorWorkJson) throws Exception{
        return success(workTimeService.saveWorkTimeRule(workTimeRuleJson,isDoctorWorkJson));
    }
    
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.checkDoctorWork)
    @ApiOperation(value = "判断医生是否在班")
    public ObjEnvelop checkDoctorWork(@ApiParam(name = "doctor", value = "判断医生是否在班")
                                      @RequestParam(value = "doctor",required = true)String doctor) throws Exception{
        return success(workTimeService.checkDoctorWork(doctor));
                                      @RequestParam(value = "doctor",required = true)String doctor,
                                      @ApiParam(name = "ywCode", value = "业务code")
                                      @RequestParam(value = "ywCode",required = false) String ywCode) throws Exception{
        return success(workTimeService.checkDoctorWork(doctor,ywCode));
    }
    
    @PostMapping(value= BaseHospitalRequestMapping.Prescription.importDoctorWork)

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/YkyyPrescriptionEndpoint.java

@ -258,9 +258,11 @@ public class YkyyPrescriptionEndpoint extends EnvelopRestEndpoint {
                                       @ApiParam(name = "price", value = "支付费用")
                                       @RequestParam(value = "price", required = false)Double price,
                                      @ApiParam(name = "tradeType", value = "支付方式")
                                          @RequestParam(value = "tradeType", required = false)String tradeType)throws Exception {
                                          @RequestParam(value = "tradeType", required = false)String tradeType,
                                      @ApiParam(name = "appletCode", value = "appletCode", required = false)
                                          @RequestParam(value = "appletCode",required = false)String appletCode)throws Exception {
        try {
            return success("ok",prescriptionService.savePrescriptionOrder(code,price,tradeType,wxId));
            return success("ok",prescriptionService.savePrescriptionOrder(code,price,tradeType,wxId,appletCode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }