LAPTOP-KB9HII50\70708 1 år sedan
förälder
incheckning
41803d36ac

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

@ -42,6 +42,10 @@ public interface SystemMessageDao extends JpaRepository<SystemMessageDO, String>
    List<SystemMessageDO> queryByRelationCodeAndTypeIn(String relationCode,String[] type);
    List<SystemMessageDO> queryByRelationCodeAndDelAndTypeIn(String relationCode,String del,String[] type);
    //获取资质申请审核有效的未结束已发送的消息
    @Query("select a from SystemMessageDO a where a.type in ('401','408') and a.del='1' and a.over='1' and a.relationCode = ?1  ")
    List<SystemMessageDO> findMessageByRelationCode(String relationCode);

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

@ -4887,25 +4887,25 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    public com.alibaba.fastjson.JSONObject doctorIndexStatis(String doctor){
        com.alibaba.fastjson.JSONObject json = new com.alibaba.fastjson.JSONObject();
        WlyyHospitalSysDictDO dictDO = hospitalSysDictDao.findOneByDictNameAndDictCode("HOSPITAL_INTEGRATE_VALIDITY_DICT","HOSPITAL_INTEGRATE_VALIDITY_DICT");
        com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray(dictDO.getDictValue());
        //[{"type":0,"flag":0,"dateTime":"2023-07-06T16:00:00.000Z","days":"","description":"<p>1111</p>"},
        //{"type":1,"flag":1,"dateTime":"","days":"2","description":"<p>5555</p>"}]
        int flag = 0;
        String dateTime = "";
        String days = "";
        for (int i=0;i<jsonArray.size();i++){
            com.alibaba.fastjson.JSONObject jsonObject = jsonArray.getJSONObject(i);
            if(jsonObject.get("type") instanceof Integer && jsonObject.getInteger("type")==1){
                flag = jsonObject.getInteger("flag");
                dateTime = jsonObject.getString("dateTime");
                days = jsonObject.getString("days");
            }
        }
        if(StringUtils.isNotBlank(dateTime)){
            dateTime = dateTime.substring(0,19);
            dateTime = dateTime.replaceAll("T"," ");
        }
//        WlyyHospitalSysDictDO dictDO = hospitalSysDictDao.findOneByDictNameAndDictCode("HOSPITAL_INTEGRATE_VALIDITY_DICT","HOSPITAL_INTEGRATE_VALIDITY_DICT");
//        com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray(dictDO.getDictValue());
//        //[{"type":0,"flag":0,"dateTime":"2023-07-06T16:00:00.000Z","days":"","description":"<p>1111</p>"},
//        //{"type":1,"flag":1,"dateTime":"","days":"2","description":"<p>5555</p>"}]
//        int flag = 0;
//        String dateTime = "";
//        String days = "";
//        for (int i=0;i<jsonArray.size();i++){
//            com.alibaba.fastjson.JSONObject jsonObject = jsonArray.getJSONObject(i);
//            if(jsonObject.get("type") instanceof Integer && jsonObject.getInteger("type")==1){
//                flag = jsonObject.getInteger("flag");
//                dateTime = jsonObject.getString("dateTime");
//                days = jsonObject.getString("days");
//            }
//        }
//        if(StringUtils.isNotBlank(dateTime)){
//            dateTime = dateTime.substring(0,19);
//            dateTime = dateTime.replaceAll("T"," ");
//        }
        //医生获取积分数据
        String integrateSql ="SELECT\n" +
                "\tIFNULL(SUM(integrate), 0) AS \"total\"\n" +
@ -4913,11 +4913,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "\tbase_hospital_user_integrate\n" +
                "WHERE\n" +
                "\tuser = '"+doctor+"' and status=1 ";
        if(flag==0){
            integrateSql += " and create_time>'"+dateTime+"' ";
        }else {
            integrateSql += " and (integrate_type=2 or (integrate_type=1 and DATEDIFF(NOW(),create_time)<'"+days+"')) ";
        }
//        if(flag==0){
//            integrateSql += " and create_time>'"+dateTime+"' ";
//        }else {
//            integrateSql += " and (integrate_type=2 or (integrate_type=1 and DATEDIFF(NOW(),create_time)<'"+days+"')) ";
//        }
        List<Map<String, Object>> rstotal = hibenateUtils.createSQLQuery(integrateSql);
        Double integrateTotal = 0.0;
        if (rstotal != null && rstotal.size() > 0) {
@ -9293,7 +9293,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            wlyyHttpLogDO.setCreateTime(new Date());
            wlyyHttpLogDao.save(wlyyHttpLogDO);
        }
        return outpatient;
    }

+ 1 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/survey/service/SurveyService.java

@ -961,6 +961,7 @@ public class SurveyService extends BaseJpaService<WlyySurveyQuestionDO, SurveyQu
        String sql = "SELECT " +
                " t.id as \"id\", " +
                " t.code as \"code\", " +
                " t.survey_temp_code AS \"surveyTempCode\", " +
                " t.survey_temp_title AS \"surveyTempTitle\", " +
                " t.patient as \"patient\"," +

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

@ -24,6 +24,7 @@ import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.httplog.service.BaseOperateLogService;
import com.yihu.jw.hospital.mapping.service.PatientMappingService;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
@ -172,6 +173,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    private QrcodeService qrcodeService;
    @Autowired
    private MlwyyPrescriptionService mlwyyPrescriptionService;
    @Autowired
    private SystemMessageDao systemMessageDao;
    @GetMapping(value = "visitedDoctorPage")
    @ApiOperation(value = "已就诊医生列表")
@ -1661,7 +1664,23 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                           @ApiParam(name = "chargeType", value = "号别")
                                           @RequestParam(value = "chargeType", required = false) String chargeType) throws Exception {
        try {
            return success(prescriptionService.saveOutpatientDoctor(outpatientJson, registerJson, chargeType));
            WlyyOutpatientDO one = prescriptionService.saveOutpatientDoctor(outpatientJson, registerJson, chargeType);
            List<SystemMessageDO> systemMessageDOS = systemMessageDao.queryByRelationCodeAndDelAndTypeIn(one.getId(),"1",new String[]{"1","2","3","15","17","18"});
            if(systemMessageDOS.size()>0){
                for (SystemMessageDO messageDO:systemMessageDOS){
                    messageDO.setDel("0");
                }
                systemMessageDao.saveAll(systemMessageDOS);
            }
            if (one.getPayStatus() != null && one.getPayStatus() == 1) {
                //发送系统消息
                SystemMessageDO systemMessageDO = prescriptionService.sendOutPatientMes(one, payFlag);
                //发送IM消息
                hospitalSystemMessageService.sendImMessage(systemMessageDO);
            }
            return success(one);
        } catch (Exception e) {
            return failedObjEnvelopException(e);
        }