Browse Source

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

wangzhinan 4 years ago
parent
commit
46812465f4
17 changed files with 344 additions and 38 deletions
  1. 28 10
      business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java
  2. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java
  3. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionDao.java
  4. 11 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  5. 130 2
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  6. 1 1
      business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java
  7. 19 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/family/WlyyPatientFamilyMemberDO.java
  8. 9 0
      common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationTemplateDetailDO.java
  9. 4 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  10. 2 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  11. 3 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/PrescriptionOverdueJob.java
  12. 68 0
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java
  13. 8 2
      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/system.properties
  15. 45 16
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java
  16. 7 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  17. 6 0
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationPlanController.java

+ 28 - 10
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -26,10 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.management.MXBean;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service
public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMemberDO, WlyyPatientFamilyMemberDao> {
@ -50,6 +47,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
    public MixEnvelop addFamily(String id,String patientId, String familyName, String dictId, String cardType, String idCard, String phoneNum,boolean demo) throws Exception {
        BasePatientMemberDictDO basePatientMemberDictDO = basePatientMemberDictDao.findOne(dictId);
        BasePatientDO basePatientDO = basePatientDao.findByIdcard(idCard);
        Map<String,Object> resultMap = new HashMap<>();
        if(null==basePatientDO){
           basePatientDO = new BasePatientDO();
        }
@ -78,6 +76,8 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                result.setFamilyRelationName(dictName);
                result.setIsDel(1);
                result.setPatient(patientId);
                result.setCardNo(idCard);
                result.setCardType(cardType);
                //保存到base_patient表中
                basePatientDO.setMobile(phoneNum);
                if(null!=jsonObject.get("Birth_Date")){
@ -105,8 +105,16 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                patientMappingDO.setPatient(patientNewId);
                patientMappingDO.setCreateTime(new Date());
                patientMappingDao.save(patientMappingDO);
                resultMap.put("patientId",patientId);
                resultMap.put("familyId",patientNewId);
                resultMap.put("idCard",idCard);
                resultMap.put("phoneNum",phoneNum);
                resultMap.put("relationName",dictName);
                List<Map<String,Object>> resultList = new ArrayList();
                resultList.add(resultMap);
                mixEnvelop.setStatus(200);
                mixEnvelop.setMessage("添加成功");
                mixEnvelop.setDetailModelList(resultList);
            }
        }
        else {
@ -118,10 +126,10 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
    //根据患者id查询关联家属
    public List<Map<String,Object>> findFamilyByPatientId(String patientId) throws ParseException {
        String sql = "select t.patient as \"patient\",b.name as \"name\",b.sex as \"sex\"," +
                "b.birthday as\"birthday\",b.idcard as \"idcard\" " +
        String sql = "select t.id as \"id\",t.card_type as \"cardType\", t.patient as \"patient\",b.name as \"name\",b.sex as \"sex\"," +
                "b.birthday as\"birthday\",b.idcard as \"idcard\",c.relation_name as \"relationName\" " +
                " from wlyy_patient_family_member t left join base_patient b" +
                " on t.family_member = b.id where 1=1";
                " on t.family_member = b.id left join base_patient_member_dict c on t.family_relation=c.id where 1=1";
        if (StringUtils.isNotBlank(patientId)){
            sql += " and t.patient = '"+patientId+"'";
        }
@ -174,16 +182,26 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        }
    }
    //获取单个亲属详细信息
    public List<Map<String,Object>>  findMemberById(String id){
        String sql="select t.id as \"id\",t.patient as \"patient\"," +
    public List<Map<String,Object>>  findMemberById(String id) throws ParseException {
        String sql="select t.id as \"id\",t.card_type as \"cardType\",t.patient as \"patient\"," +
                "b.name as \"name\",b.idcard as \"idcard\",b.mobile as \"mobile\"," +
                "c.relation_name \"relation_name\" from wlyy_patient_family_member t left join base_patient b" +
                "c.relation_name \"relationName\",b.birthday as\"birthday\",b.sex as\"sex\"" +
                " from wlyy_patient_family_member t left join base_patient b" +
                " on t.family_member = b.id left join base_patient_member_dict c on t.family_relation=c.id " +
                " where 1=1";
        if (StringUtils.isNotBlank(id)){
            sql+=" and t.id='"+id+"'";
        }
       List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        if (list.size()>0){
            for (Map<String,Object> map:list){
                if (map.get("birthday")!=null){
                    SimpleDateFormat sp = new SimpleDateFormat("yyyy-MM-dd");
                    int age = getAgeByBirth(sp.parse(map.get("birthday").toString()));
                    map.put("age",age);
                }
            }
        }
        return list;
    }
}

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

@ -42,7 +42,7 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1")
    List<WlyyOutpatientDO> findByStatus();
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1 and a.createTime<'2020-08-30 23:59:59' and a.createTime>'2020-08-30 00:00:00'")
    @Query("from WlyyOutpatientDO a where a.status in(1,2) and a.payStatus = 1 and a.createTime<'2020-08-31 23:59:59'")
    List<WlyyOutpatientDO> findPreviousByStatus();
    List<WlyyOutpatientDO> findByDoctorAndCreateTimeAndPatientCancelRemark(String doctor,Date createTime,String patientCancelRemark);

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

@ -41,7 +41,7 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    @Query("update WlyyPrescriptionDO p set p.status=?1 ,p.finishTime =?2 where p.outpatientId=?3")
    void updateStatusByOutPatientId(Integer status, Date date,String id);
    @Query("select a from WlyyPrescriptionDO a where a.outpatientId = ?1 ")
    @Query("select a from WlyyPrescriptionDO a where a.outpatientId = ?1 and a.checkStatus <>4 ")
    List<WlyyPrescriptionDO> findByOutpatientId(String outpatientId);
    List<WlyyPrescriptionDO> findById(String id);

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

@ -609,7 +609,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " count(1) AS \"total\" " +
                " FROM " +
                " wlyy_prescription p ";
        totalSql += " WHERE 1=1 and p.check_status <>3 ";
        totalSql += " WHERE 1=1 and p.check_status <>3 and p.check_status <>4";
        if (StringUtils.isNotBlank(patient)) {
            totalSql += " AND p.patient_code ='" + patient + "'";
        }
@ -8384,5 +8384,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            prescriptionDO.setSignFlag(1);
        }
    }
    //删除处方
    public WlyyPrescriptionDO deletePrescription(String id){
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(id);
        if (null!=wlyyPrescriptionDO){
            wlyyPrescriptionDO.setCheckStatus(4);
            wlyyPrescriptionDO.setStatus(-1);
        }
        wlyyPrescriptionDO =  prescriptionDao.save(wlyyPrescriptionDO);
        return wlyyPrescriptionDO;
    }
}

+ 130 - 2
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -725,14 +725,14 @@ public class StatisticsEsService {
     * @param level2_type
     * @return
     * @throws Exception
     */
     *//*
    public JSONObject getPrescriptionLine(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
        JSONObject object = new JSONObject();
        //开方量增量曲线
        JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
        object.put("prescriptionLine",array);
        return object;
    }
    }*/
    /**
@ -3445,8 +3445,136 @@ public class StatisticsEsService {
        return object;
    }
    /**
     * 按日期柱状图统计处方量
     *
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level 2科室
     * @param index
     * @param level2_type 4 医院
     * @return
     * @throws Exception
     */
    public JSONObject getPrescriptionLine(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
        logger.info("service index:"+index+" and level2_type:"+level2_type+" and level:"+level);
        String[] indexes = index.split(",");
        JSONArray array = new JSONArray();
        JSONArray resultArray = new JSONArray();
        //问诊量
        JSONObject object = new JSONObject();
        if (interval==1){
             array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
        }else if (interval==2){
             array = weekTotalStatistics(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
        }else if (interval==3){
             array = monthTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
        }
        if (StringUtils.isNoneBlank(level2_type)){
            //问诊量表格
            List<SaveModel> specialistSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL,"",String.valueOf(interval),level2_type);
            //开具处方数量
            List<SaveModel> prescriptionSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL,"",String.valueOf(interval),"4");
            //每个医生根据传入时间查询开具处方数量
            List<SaveModel> doctorSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL,"",String.valueOf(interval),"6");
            for (int i=0;i<prescriptionSaveModels.size();i++){
                JSONObject jsonObject = new JSONObject();
                Double specialist = 0.0;
                Double totalOutpatient = 0.0;
                SaveModel saveModel = prescriptionSaveModels.get(i);
                jsonObject.put("hospitalCode",saveModel.getHospital());
                jsonObject.put("hospitalName",saveModel.getHospitalName());
                jsonObject.put("deptNo",saveModel.getDept());
                jsonObject.put("deptName",saveModel.getDeptName());
                jsonObject.put("name",saveModel.getHospitalName());
                jsonObject.put("specialist",saveModel.getResult1());
                jsonObject.put("doctorName",saveModel.getDoctorName());
                jsonObject.put("doctorcode",saveModel.getDoctor());
                specialist = saveModel.getResult1();
                jsonObject.put("specialist",specialist);
                totalOutpatient = specialistSaveModels.get(i).getResult1();
                String prescriptionRate = getRange(specialist.intValue(),totalOutpatient.intValue(),0);
                jsonObject.put("prescriptionRate",prescriptionRate);
                resultArray.add(jsonObject);
            }
            object.put("excelData",resultArray);
            object.put("detailList",prescriptionSaveModels);
        }
        return object;
    }
    /**
     * 按日期柱状图 取药方式统计处方量
     *
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level 2科室
     * @param index
     * @param level2_type 4 医院
     * @return
     * @throws Exception
     */
    public JSONObject getPrescriptionLineByType(String startDate, String endDate, String area, int level, String index,int interval, String level2_type) throws Exception {
        logger.info("service index:"+index+" and level2_type:"+level2_type+" and level:"+level);
        String[] indexes = index.split(",");
        JSONArray array = new JSONArray();
        JSONArray resultArray = new JSONArray();
        //问诊量
        JSONObject object = new JSONObject();
        if (interval==1){
            array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
        }else if (interval==2){
            array = weekTotalStatistics(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
        }else if (interval==3){
            array = monthTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
        }
        if (StringUtils.isNoneBlank(level2_type)){
            //问诊量表格
            List<SaveModel> specialistSaveModels = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[0], SaveModel.timeLevel_ZL,"",String.valueOf(interval),level2_type);
            //开具处方数量中自取的处方
            List<SaveModel> oneselfTake = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL,"1",String.valueOf(interval),level2_type);
            //开具处方数量中快递的处方
            List<SaveModel> mailPost = elasticsearchUtil.findDateQuotaLevel1(startDate, endDate, area, level, indexes[1], SaveModel.timeLevel_ZL,"0",String.valueOf(interval),level2_type);
            for(SaveModel saveModel:oneselfTake)
            {
            }
            /*for (int i=0;i<prescriptionSaveModels.size();i++){
                JSONObject jsonObject = new JSONObject();
                Double specialist = 0.0;
                Double totalOutpatient = 0.0;
                SaveModel saveModel = prescriptionSaveModels.get(i);
                jsonObject.put("hospitalCode",saveModel.getHospital());
                jsonObject.put("hospitalName",saveModel.getHospitalName());
                jsonObject.put("deptNo",saveModel.getDept());
                jsonObject.put("deptName",saveModel.getDeptName());
                jsonObject.put("name",saveModel.getHospitalName());
                jsonObject.put("specialist",saveModel.getResult1());
                specialist = saveModel.getResult1();
                totalOutpatient = specialistSaveModels.get(i).getResult1();
                String prescriptionRate = getRange(specialist.intValue(),totalOutpatient.intValue(),0);
                jsonObject.put("prescriptionRate",prescriptionRate);
                resultArray.add(jsonObject);
            }*/
            object.put("excelData",resultArray);
        }
        return object;
    }
}

+ 1 - 1
business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java

@ -788,7 +788,7 @@ public class ElasticsearchUtil {
        }
        if (StringUtils.isNotEmpty(area)) {
            if (SaveModel.doctorLevel.equals(level + "")) {
                if (SaveModel.doctorLevel.equals(level + "")) {
                sql.append(" doctor='" + area + "'");
            }else if (SaveModel.deptLevel.equals(level + "")) {
                sql.append(" dept='" + area + "'");

+ 19 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/family/WlyyPatientFamilyMemberDO.java

@ -35,6 +35,25 @@ public class WlyyPatientFamilyMemberDO extends UuidIdentityEntityWithOperator {
     */
    private Integer isDel;
    private String cardType;
    private String cardNo;
    public String getCardType() {
        return cardType;
    }
    public void setCardType(String cardType) {
        this.cardType = cardType;
    }
    public String getCardNo() {
        return cardNo;
    }
    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }
    public String getPatient() {
        return patient;
    }

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationTemplateDetailDO.java

@ -34,6 +34,7 @@ public class RehabilitationTemplateDetailDO extends UuidIdentityEntityWithOperat
    private String name;//服务项名称
    private Integer expense;//费用
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
@ -141,4 +142,12 @@ public class RehabilitationTemplateDetailDO extends UuidIdentityEntityWithOperat
    public void setName(String name) {
        this.name = name;
    }
    public Integer getExpense() {
        return expense;
    }
    public void setExpense(String name) {
        this.expense = expense;
    }
}

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

@ -175,6 +175,10 @@ public class BaseHospitalRequestMapping {
         * 获取用药频次
         */
        public static final String getDrugFrequency="/getDrugFrequency";
        /**
         * 删除处方草稿
         */
        public static final String deletePrescriptionByid="/deletePrescriptionByid";
        /**
         * 下诊断

+ 2 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -378,6 +378,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
            return result.toJSONString();
        }
        baseDoctorDO.setSalt(randomString(5));
        baseDoctorDO.setEnabled(1);
        baseDoctorDO.setLocked(0);
        baseDoctorDO.setPassword(MD5.md5Hex(baseDoctorDO.getIdcard().substring(12, 18) + "{" + baseDoctorDO.getSalt() + "}"));
        this.save(baseDoctorDO);

+ 3 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/PrescriptionOverdueJob.java

@ -4,6 +4,7 @@ import com.yihu.jw.service.channel.PrescriptionStatusUpdateService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.Trigger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -20,6 +21,8 @@ public class PrescriptionOverdueJob implements Job {
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("START========PrescriptionOverdueJob========");
        try {
            Trigger trigger =jobExecutionContext.getTrigger();
            System.out.println("执行时间为"+trigger.getNextFireTime());
            prescriptionStatusUpdateService.setOutPatientOver();
            logger.info("END========PrescriptionOverdueJob========");
        } catch (Exception e) {

+ 68 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java

@ -0,0 +1,68 @@
package com.yihu.jw.util;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.job.PrescriptionOverdueJob;
import com.yihu.jw.service.channel.PrescriptionStatusUpdateService;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.Trigger;
import org.springframework.scheduling.TriggerContext;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
@Lazy(false)
@Component
@EnableScheduling
public class OverdueJob implements SchedulingConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(OverdueJob.class);
    private static String cron = "0 0 1 * * ?";
    public OverdueJob(){
        cron="0 0 1 * * ?";
        System.out.println("初始化时的corn"+cron);
    }
    @Autowired
    private PrescriptionStatusUpdateService prescriptionStatusUpdateService;
    public String change(String corIn) {
        if (StringUtils.isNotBlank(corIn)) {
            cron = corIn;
        }
        return cron;
    }
    @Override
    public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
        taskRegistrar.addTriggerTask(new Runnable() {
            @Override
            public void run() {
                logger.info("START========OverdueJob========");
                try {
                    prescriptionStatusUpdateService.setOutPatientOver();
                    logger.info("END========OverdueJob========");
                } catch (Exception e) {
                    e.printStackTrace();
                    logger.error("END===ERROE===OverdueJob,message:"+e.getMessage());
                }
            }
        }, new Trigger() {
            @Override
            public Date nextExecutionTime(TriggerContext triggerContext) {
                // 任务触发,可修改任务的执行周期
                CronTrigger trigger = new CronTrigger(cron);
                System.out.println("OverdueJob任务触发,可修改任务的执行周期"+cron);
                Date nextExec = trigger.nextExecutionTime(triggerContext);
                return nextExec;
            }
        });
    }
}

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

@ -1,6 +1,5 @@
package com.yihu.jw.web.quota;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.im.service.ImService;
@ -16,6 +15,7 @@ import com.yihu.jw.repository.job.QuartzJobConfigDao;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.service.quota.JobService;
import com.yihu.jw.util.AutoTimeOutRemind;
import com.yihu.jw.util.OverdueJob;
import com.yihu.jw.util.SystemConf;
import com.yihu.jw.web.BaseController;
import com.yihu.jw.wechat.service.WxTemplateService;
@ -28,7 +28,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.sound.midi.Soundbank;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
@ -621,5 +620,12 @@ public class JobController extends BaseController {
        return autoTimeOutRemind.change(corn);
    }
    @RequestMapping(value = "changeOverDueTime", method = RequestMethod.GET)
    public String changeOverDueTime(String corn){
        OverdueJob autoTimeOutRemind = new OverdueJob();
        return autoTimeOutRemind.change(corn);
    }
}

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

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

+ 45 - 16
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -1,6 +1,7 @@
package com.yihu.jw.hospital.endpoint.hospital;
import com.alibaba.fastjson.JSONObject;
import com.sun.media.jfxmedia.logging.Logger;
import com.yihu.jw.entity.base.doctor.BaseDoctorBackgroundDO;
import com.yihu.jw.hospital.family.service.PatientMemberDictService;
import com.yihu.jw.hospital.family.service.WlyyFamilyMemberService;
@ -9,12 +10,15 @@ import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.sms.service.ZhongShanSMSService;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@ -39,9 +43,13 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    private EntranceService entranceService;
    @Autowired
    private RedisTemplate redisTemplate;
    @Autowired
    private YkyySMSService ykyySMSService;
    private final String KEY_SUFFIX = ":code";
    @Autowired
    private ZhongShanSMSService zhongShanSMSService;
    @Value("${wechat.id}")
    private String wxId;
    @ApiOperation("获取家人关系")
    @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findRelationDict)
@ -81,22 +89,43 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
            //发送短信获取验证码
        }
        String captcha = this.getCodeNumber();
        int result = 1;
        if (jsonArray.size() > 0) {
            result = zhongShanSMSService.ZhongShangSendSMS(username, "您好,您当前操作的验证码是:" + captcha + ",2分钟内有效。");
        } else {
            result = 2;
        }
        if (0 == result) {
            this.store(client_id, username, captcha, 120);
            mixEnvelop.setMessage("验证码发送成功");
        } else if (2 == result) {
            mixEnvelop.setStatus(408);
            mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
        } else {
            mixEnvelop.setMessage("验证码发送失败");
            mixEnvelop.setStatus(500);
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            System.out.println("发送眼科验证码开始");
            ResultMsg result= null;
            if (jsonArray.size() > 0) {
                result = ykyySMSService.ykyySendSMS(username, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。");
                if (result.isSuccess()){
                    this.store(client_id, username, captcha, 120);
                    mixEnvelop.setMessage("验证码发送成功");
                } else {
                    mixEnvelop.setMessage("验证码发送失败");
                    mixEnvelop.setStatus(500);
                }
            }else {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
            }
        }else {
            System.out.println("发送中山验证码开始");
            int result = 1;
            if (jsonArray.size() > 0) {
                result = zhongShanSMSService.ZhongShangSendSMS(username, "您好,您当前操作的验证码是:" + captcha + ",2分钟内有效。");
            } else {
                result = 2;
            }
            if (0 == result) {
                this.store(client_id, username, captcha, 120);
                mixEnvelop.setMessage("验证码发送成功");
            } else if (2 == result) {
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
            } else {
                mixEnvelop.setMessage("验证码发送失败");
                mixEnvelop.setStatus(500);
            }
        }
        return mixEnvelop;
    }
@ -199,7 +228,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    @ApiOperation("获取单个亲属信息")
    @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findSingleMember)
    public Envelop findSingleMember(@ApiParam(name = "id", value = "id", required = false)
                                    @RequestParam(value = "id", required = false) String id) {
                                    @RequestParam(value = "id", required = false) String id) throws ParseException {
        return success(wlyyFamilyMemberService.findMemberById(id));
    }
}

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

@ -410,8 +410,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    public ListEnvelop getDrugFrequency()throws Exception {
        return success(prescriptionService.getDrugFrequency());
    }
    
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.deletePrescriptionByid)
    @ApiOperation(value = "删除处方草稿", notes = "删除处方草稿")
    public Envelop deletePrescription(@ApiParam(name = "id", value = "处方id")
                                              @RequestParam(value = "id", required = true)String id)throws Exception {
        return success(prescriptionService.deletePrescription(id));
    }
    
    @PostMapping(value = BaseHospitalRequestMapping.Prescription.makeDiagnosis)
    @ApiOperation(value = "下诊断", notes = "下诊断接口")

+ 6 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationPlanController.java

@ -376,6 +376,12 @@ public class RehabilitationPlanController extends EnvelopRestEndpoint {
            JSONArray array = new JSONArray();
            for(Object planDetail : json.getJSONArray("detail")) {
                JSONObject j = (JSONObject)planDetail;
                String expense = j.getString("expense");
                if(expense.contains(".")){
                    int pointIndex = expense.indexOf(".");
                    expense = expense.substring(0,pointIndex);
                }
                j.put("expense",expense);
                if(j.has("executeTime")) {
                    String executeTime = j.get("executeTime").toString();
                    String[] result = null;