Procházet zdrojové kódy

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

LAPTOP-KB9HII50\70708 před 2 roky
rodič
revize
34f40d5491

+ 35 - 15
business/base-service/src/main/java/com/yihu/jw/healthUpload/service/BaseDoctorHealthUploadService.java

@ -1733,7 +1733,7 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
            condition +=" and dh.dept_code = '"+dept+"'";
        }
        String sql = "SELECT\n" +
                "\tdh.dept_name as deptName,\n" +
                "\thd.name as deptName,\n" +
                "\tCOUNT(DISTINCT d.doctor_id) AS total\n" +
                "FROM\n" +
                "\t(\n" +
@ -1752,7 +1752,8 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\tAND d2.createTime = d3.create_time\n" +
                "\t) d\n" +
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 \n" +
                "where dh.dept_name IS NOT NULL and d.schedule_status = 2  "+condition +
                " LEFT JOIN dict_hospital_dept hd ON dh.dept_code = hd.code "+
                "where d.schedule_status IN(2,3)  "+condition +
                "GROUP BY dh.dept_code \n" +
                "ORDER BY COUNT(DISTINCT d.doctor_id) DESC  ";
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
@ -1792,7 +1793,8 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\tAND d2.createTime = d3.create_time\n" +
                "\t) d\n" +
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 \n" +
                "where  dh.dept_name IS NOT NULL and d.schedule_status = 2\n" +condition+
                " LEFT JOIN dict_hospital_dept hd ON dh.dept_code = hd.code "+
                "where  d.schedule_status IN(2,3)\n" +condition+
                "GROUP BY d.city_name \n" +
                "ORDER BY COUNT(DISTINCT d.doctor_id) DESC ";
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
@ -1830,7 +1832,8 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\tAND d2.createTime = d3.create_time\n" +
                "\t) d\n" +
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 \n" +
                "where  dh.dept_name IS NOT NULL and d.schedule_status = 1 and d.town_name  !=''\n" + condition +
                " LEFT JOIN dict_hospital_dept hd ON dh.dept_code = hd.code "+
                "where  hd.name IS NOT NULL and d.schedule_status = 1 and d.town_name  !=''\n" + condition +
                "GROUP BY d.town_name \n" +
                "ORDER BY COUNT(DISTINCT d.doctor_id) DESC ";
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
@ -1844,19 +1847,35 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
     *
     * @return
     */
    public List<Map<String,Object>> selectIndexYichangList(String dept, int level) {
    public List<Map<String,Object>> selectIndexYichangList(String dept, int level,String startDate,String endDate,String doctorName) {
        String condition = "";
        if (level==2){
            condition +=" and dh.dept_code = '"+dept+"'";
        }
        if (StringUtils.isNoneBlank(startDate)){
            condition +=" and d.create_time >= '"+startDate+" 00:00:00'";
            condition +=" and d.create_time <= '"+endDate+" 23:59:59'";
        }
        if (StringUtils.isNoneBlank(doctorName)){
            condition +=" and d.doctor_name like '%"+doctorName+"%'";
        }
        String sql = "SELECT\n" +
                "\tdh.dept_name AS deptName,\n" +
                "\td.doctor_name AS doctorName,\n" +
                "\tbd.photo AS photo,\n" +
                "\td.id AS id,\n" +
                "\td.doctor_id AS doctorId,\n" +
                "\td.schedule_status AS scheduleStatus,\n" +
                "\td.province_name AS provinceName,\n" +
                "\td.city_name AS cityName,\n" +
                "\td.town_name AS townName,\n" +
                "\td.tour_code AS tourCode,\n" +
                "\td.health_code AS healthCode,\n" +
                "\td.temperature AS temperature,\n" +
                "\td.is_symptoms AS isSymptoms,\n" +
                "\td.is_epidemic AS isEpidemic,\n" +
                "\td.abnormal_symptoms AS abnormalSymptoms,\n" +
                "\td.abnormal_symptoms_other AS abnormalSymptomsOther,\n" +
                "\td.epidemic_person AS epidemicPerson,\n" +
                "\tdate_format(\n" +
                "\t\td.create_time,\n" +
@ -1878,7 +1897,8 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\tLEFT JOIN base_doctor_health_upload d3 ON d2.doctor_id = d3.doctor_id\n" +
                "\t\tAND d2.createTime = d3.create_time\n" +
                "\t) d\n" +
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id\n" +
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 " +
                "LEFT JOIN base_doctor bd ON bd.id=dh.doctor_code "+
                "WHERE\n" +
                "\t(\n" +
                "\t\td.health_code IN (2, 3)\n" +
@ -1923,7 +1943,7 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\tLEFT JOIN base_doctor_health_upload d3 ON d2.doctor_id = d3.doctor_id\n" +
                "\t\tAND d2.createTime = d3.create_time\n" +
                "\t) d\n" +
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id \n" + condition+
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 \n" + condition+
                "where d.is_nucleate !=1 and dh.dept_code is not null ";
        Map<String,Object> yizuoMap = jdbcTemplate.queryForMap(yizuohesuanSql);
        String yizuoTotals = "";
@ -1954,7 +1974,7 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\tLEFT JOIN base_doctor_health_upload d3 ON d2.doctor_id = d3.doctor_id\n" +
                "\t\tAND d2.createTime = d3.create_time\n" +
                "\t) d\n" +
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id \n" +condition+
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 \n" +condition+
                "where d.is_nucleate =1 and dh.dept_code is not null \n";
        Map<String,Object> weizuoMap = jdbcTemplate.queryForMap(weizuohesuanSql);
        String weizuoTotals = "";
@ -2002,10 +2022,10 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\t\t\tGROUP BY\n" +
                "\t\t\t\t\td1.doctor_id\n" +
                "\t\t\t) d2\n" +
                "\t\tLEFT JOIN base_doctor_health_upload d3 ON d2.doctor_id = d3.doctor_id\n" +
                "\t\tLEFT JOIN base_doctor_health_upload d3 ON d2.doctor_id = d3.doctor_id \n" +
                "\t\tAND d2.createTime = d3.create_time\n" +
                "\t) d "+
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id \n where 1=1 and dh.dept_code is not null  "+condition+" ";
                "LEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 \n where 1=1 and dh.dept_code is not null  "+condition+" ";
        String highSql = sql +" AND d.is_high=1 and d.create_time >='"+startDate+"' and d.create_time <='"+endDate+"'";
        String redSql = sql +" AND d.health_code=2 and d.create_time >='"+startDate+"' and d.create_time <='"+endDate+"'";
        String yellowSql = sql +" AND d.health_code=3 and d.create_time >='"+startDate+"' and d.create_time <='"+endDate+"'";
@ -2218,7 +2238,7 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\tCOUNT(DISTINCT d.doctor_id) AS total\n" +
                "\tFROM\n" +
                "\t\tbase_doctor_health_upload d\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 \n" +
                "\tWHERE\n" +
                "\t\t1 = 1\n" +
                condition+
@ -2231,7 +2251,7 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\tCOUNT(1) AS total\n" +
                "\tFROM\n" +
                "\t\tbase_doctor_health_upload d\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 \n" +
                "\tWHERE\n" +
                "\t\t1 = 1\n" +
                condition+
@ -2244,7 +2264,7 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\tCOUNT(1) AS total\n" +
                "\tFROM\n" +
                "\t\tbase_doctor_health_upload d\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 \n" +
                "\tWHERE\n" +
                "\t\t1 = 1\n" +
                condition+
@ -2258,7 +2278,7 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\tCOUNT(1) AS total\n" +
                "\tFROM\n" +
                "\t\tbase_doctor_health_upload d\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 \n" +
                "\tWHERE\n" +
                "\t\t1 = 1\n" +
                condition+
@ -2272,7 +2292,7 @@ public class BaseDoctorHealthUploadService extends BaseJpaService<BaseDoctorHeal
                "\t\tCOUNT(DISTINCT d.doctor_id) AS total\n" +
                "\tFROM\n" +
                "\t\tbase_doctor_health_upload d\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id\n" +
                "\tLEFT JOIN base_doctor_hospital dh ON dh.doctor_code = d.doctor_id and dh.del=1 \n" +
                "\tWHERE\n" +
                "\t\t1 = 1\n" +
                condition+

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

@ -140,6 +140,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.print.DocFlavor;
import javax.validation.constraints.Null;
import java.beans.Transient;
import java.io.IOException;
@ -15354,4 +15355,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        return null;
    }
  /*  public List<Map<String,Object>> selectSettlementInfo(String medicareState,String condition,String startDate,String endDate){
        String sql = ""
    }*/
}

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

@ -1617,42 +1617,45 @@ public class EntranceService {
        String origTraceNo = businessOrderDO.getTraceNo();
        logger.info("第一次调用his退费接口开始");
        //调用his退费接口
        BS15051(operatorId, operatorName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
        logger.info("第一次调用his退费接口结束");
        //调用易联众预缴金退款接口
        String refund = ylzPayService.refund(operatorId, operatorName, cardType, accountType, cardNo, idNo, amount, outChargeNo, userName, "1", traceSerial, outRefundNo,cardNo);
        BusinessOrderRefundDO businessOrderRefundDO = new BusinessOrderRefundDO();
        businessOrderRefundDO.setOrderNo(businessOrderDO.getOrderNo());
        businessOrderRefundDO.setOutRefundNo(outRefundNo);
        businessOrderRefundDO.setStatus(1);
        businessOrderRefundDO.setCreateTime(new Date());
        businessOrderRefundDO.setUpdateTime(new Date());
        businessOrderRefundDO.setPatient(businessOrderDO.getPatient());
        businessOrderRefundDO.setPatientName(businessOrderDO.getPatientName());
        businessOrderRefundDO = orderRefundDao.save(businessOrderRefundDO);
        JSONObject jsonObject = JSONObject.parseObject(refund);
        //获取调用易联众退费接口交易状态
        String respCode = jsonObject.getString("respCode");
        if (respCode.equals("000000")){
            businessOrderRefundDO.setRefundTime(new Date());
            businessOrderRefundDO.setStatus(2);
            orderRefundDao.save(businessOrderRefundDO);
            businessOrderDO.setStatus(9);
            businessOrderDao.save(businessOrderDO);
            tradeState = "succ";
        }else {
            tradeState = "fail";
        }
        logger.info("第二次调用his退费接口开始");
        net.sf.json.JSONObject object1 = qutpatientBalance(outpatientDO.getCardNo(), false);
        Double cardFee = object1.getDouble("ZHYE");
        logger.info("cardFee==="+cardFee);
        JSONArray res = BS15051(operatorId, operatorName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
        JSONArray resp = new JSONArray();
        resp = BS15051(operatorId, operatorName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
        logger.info("第二次调用his退费接口结束");
        if (res!=null&&res.size()!=0){
            net.sf.json.JSONObject object = res.getJSONObject(0);
            logger.info("object"+object.toString());
            if (object.getString("retCodeOut").equalsIgnoreCase("00")){
                logger.info("第一次调用his退费接口结束");
                //调用易联众预缴金退款接口
                String refund = ylzPayService.refund(operatorId, operatorName, cardType, accountType, cardNo, idNo, amount, outChargeNo, userName, "1", traceSerial, outRefundNo,cardNo);
                BusinessOrderRefundDO businessOrderRefundDO = new BusinessOrderRefundDO();
                businessOrderRefundDO.setOrderNo(businessOrderDO.getOrderNo());
                businessOrderRefundDO.setOutRefundNo(outRefundNo);
                businessOrderRefundDO.setStatus(1);
                businessOrderRefundDO.setCreateTime(new Date());
                businessOrderRefundDO.setUpdateTime(new Date());
                businessOrderRefundDO.setPatient(businessOrderDO.getPatient());
                businessOrderRefundDO.setPatientName(businessOrderDO.getPatientName());
                businessOrderRefundDO = orderRefundDao.save(businessOrderRefundDO);
                JSONObject jsonObject = JSONObject.parseObject(refund);
                //获取调用易联众退费接口交易状态
                String respCode = jsonObject.getString("respCode");
                if (respCode.equals("000000")){
                    businessOrderRefundDO.setRefundTime(new Date());
                    businessOrderRefundDO.setStatus(2);
                    orderRefundDao.save(businessOrderRefundDO);
                    businessOrderDO.setStatus(9);
                    businessOrderDao.save(businessOrderDO);
                    tradeState = "succ";
                }else {
                    tradeState = "fail";
                }
                logger.info("第二次调用his退费接口开始");
                resp = BS15051(operatorId, operatorName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
                logger.info("第二次调用his退费接口结束");
            }
        }
        return resp;
    }

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

@ -4077,9 +4077,11 @@ public class ImService {
                "op.source as \"source\"  ," +
                "op.card_no as \"cardNo\"  ," +
                "op.medical_state as \"medicalState\"  ," +
                "bop.status as \"payStatus\" ," +
                "op.patient_cancel_value as \"patientCancelValue\" ," +
                "op.patient_cancel_remark as \"patient_cancel_remark\"  " +
                "FROM wlyy_outpatient op LEFT JOIN wlyy_consult a  ON a.relation_code = op.id \n" +
                " LEFT join base_business_order_pay bop on bop.relation_code = op.id" +
                " LEFT join wlyy_consult_team b on a.id = b.consult" +
                " LEFT JOIN base_patient d on op.patient = d.id " +
                " WHERE 1=1 ";

+ 8 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/healthUpload/HealthUploadPoint.java

@ -408,9 +408,15 @@ public class HealthUploadPoint extends EnvelopRestEndpoint {
    public Envelop selectIndexYichangList(@ApiParam(name = "dept", value = "院级管理员无需传科室code")
                                              @RequestParam(value = "dept", required = false) String dept,
                                          @ApiParam(name = "level", value = "1院级管理员,2科室管理员")
                                              @RequestParam(value = "level", required = false) Integer level) throws Exception {
                                              @RequestParam(value = "level", required = false) Integer level,
                                          @ApiParam(name = "startDate", value = "开始时间")
                                              @RequestParam(value = "startDate", required = false) String startDate,
                                          @ApiParam(name = "endDate", value = "结束时间")
                                              @RequestParam(value = "endDate", required = false) String endDate,
                                          @ApiParam(name = "condition", value = "条件(医生名称)")
                                              @RequestParam(value = "condition", required = false) String condition) throws Exception {
        try{
            return success(baseDoctorHealthUploadService.selectIndexYichangList(dept,level));
            return success(baseDoctorHealthUploadService.selectIndexYichangList(dept,level,startDate,endDate,condition));
        }catch (Exception e) {
            return failedMixEnvelopException(e);
        }