瀏覽代碼

代码修改

LAPTOP-KB9HII50\70708 10 月之前
父節點
當前提交
f16262a2d5

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

@ -1165,13 +1165,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        Double price = 0.0;
        String chargeType1 = null;
        if (doctorDO!=null){
            if (outpatient.getOutpatientType().equalsIgnoreCase("1")){
            if ("1".equals(outpatient.getOutpatientType())){
                if(outpatientDO.getType().equalsIgnoreCase("1")){
                    chargeType1 = doctorDO.getTwfzChargeType();
                }else if(outpatientDO.getType().equalsIgnoreCase("2")){
                    chargeType1 = doctorDO.getSpfzChargeType();
                }
            }else if (outpatient.getOutpatientType().equalsIgnoreCase("3")){
            }else if ("3".equals(outpatient.getOutpatientType())||"5".equals(outpatient.getOutpatientType())){
                if(outpatientDO.getType().equalsIgnoreCase("1")){
                    chargeType1 = doctorDO.getTwzxChargeType();
                }else if(outpatientDO.getType().equalsIgnoreCase("2")){
@ -1202,11 +1202,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
            }
        }
        /*if (doctorDO != null && StringUtils.isNoneBlank(doctorDO.getFee())) {
            price = Double.parseDouble(doctorDO.getFee());
        }else {
            price = Double.parseDouble(hospitalSysDictDO.getDictValue());
        }*/
        if (price == 0.0) {
            outpatientDO.setPayStatus(1);
        } else {
@ -1223,7 +1218,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
        }else if (outpatient.getOutpatientType().equalsIgnoreCase("2")){
            businessOrderService.recharge(outpatient.getId(), "协同复诊-诊查费", "5", "协同复诊-诊查费", outpatient.getConsumer(), outpatient.getConsumerName(), outpatient.getDoctor(), price);
        }else if ("3".equalsIgnoreCase(outpatient.getOutpatientType())){
        }else if ("3".equals(outpatient.getOutpatientType())||"5".equals(outpatient.getOutpatientType())){
            BusinessOrderDO businessOrderDO = businessOrderService.recharge(outpatient.getId(), "专家咨询费", "1", "专家咨询费", outpatient.getConsumer(), outpatient.getConsumerName(), outpatient.getDoctor(), price);
        }else if ("4".equalsIgnoreCase(outpatient.getOutpatientType())){
            if(StringUtils.isNotBlank(outpatient.getPlanId())){
@ -1242,19 +1237,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        WlyyPatientRegisterTimeDO registerTimeDO = null;
        WlyyPatientRegisterTimeDO wlyyPatientRegisterTimeDO =new WlyyPatientRegisterTimeDO();
        try {
            //如果是视频预约咨询
            if (StringUtils.isNotBlank(registerJson)) {
                registerTimeDO = objectMapper.readValue(registerJson, WlyyPatientRegisterTimeDO.class);
                registerTimeDO.setOutpatientId(outpatient.getId());
                registerTimeDO.setCreateTime(new Date());
                wlyyPatientRegisterTimeDO = patientRegisterTimeDao.save(registerTimeDO);
                patientRegisterTimeDao.save(registerTimeDO);
            }
        } catch (Exception e) {
            throw new ServiceException("号源已经被预约,请选择其他号源");
        }
        if (!outpatientDO.getOutpatientType().equalsIgnoreCase("3")&&!outpatientDO.getOutpatientType().equalsIgnoreCase("4")){
        if ("1".equals(outpatient.getOutpatientType())||"2".equals(outpatient.getOutpatientType())){
            if (1==expressageDO.getOneselfPickupFlg()){
                if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                    String drugCode= expressageDO.getHospitalCode()==null?"5550":expressageDO.getHospitalCode();
@ -1662,13 +1656,26 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param orgCode
     * @return
     */
    public List<DictHospitalDeptVO> findDeptByHospital(String orgCode, String dept, String consultDeptFlag) {
        List<DictHospitalDeptDO> list;
        if (StringUtils.isNotBlank(consultDeptFlag) && "1".equals(consultDeptFlag)) {
            list = dictHospitalDeptDao.findByOrgCodeAndConsultDeptFlag(orgCode, consultDeptFlag);
    public List<DictHospitalDeptVO> findDeptByHospital(String orgCode, String dept, String consultDeptFlag,String diseaseId) {
        String sql = "select distinct d.* from dict_hospital_dept d where 1=1 ";
        if ("1".equals(consultDeptFlag)) {
            sql += " d.org_code = '"+ orgCode +"' and d.consult_dept_flag=1 ";
        } else {
            list = dictHospitalDeptDao.findByOrgCodeIn(Arrays.asList(orgCode.split(",")));
            sql += " d.org_code in ('"+ orgCode.replace(",","','") +"') ";
        }
        if (StringUtils.isNotBlank(diseaseId)) {
            List<Map<String,Object>> listTmp = jdbcTemplate.queryForList("select dept from base_disease_hospital where id='"+diseaseId+"' ");
            if(listTmp.size()>0){
                String depts = listTmp.get(0).get("dept")+"";
                if(depts.contains(",")){
                    sql += " AND d.dept_code in ('"+depts.replace(",","','")+"')  ";
                }else {
                    sql += " AND d.dept_code = '"+depts+"' ";
                }
            }
        }
        List<DictHospitalDeptDO> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(DictHospitalDeptDO.class));
        List<DictHospitalDeptVO> rs = new ArrayList<>();
        convertToModels(list, rs, DictHospitalDeptVO.class);
        if (rs != null && rs.size() > 0 && StringUtils.isNotBlank(dept)) {
@ -6405,7 +6412,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            sql += " AND room.reservation_type=2 ";
        } else if (4==type){
            //专家咨询
            sql += " AND room.reservation_type=3 AND room.consult_type =1";
            sql += " AND room.consult_type =1 AND room.reservation_type in(3,5)";
        } else if (5==type){
            //康复咨询
            sql += " AND room.reservation_type=4 AND room.consult_type =1";

+ 2 - 0
common/common-entity/src/db/2024.sql

@ -367,3 +367,5 @@ INSERT INTO `oauth_wlyy_config` (`id`, `app_id`, `app_secret`, `token_url`, `url
    ('addSurveyThird', '019bd04d-3cb2-433f-a530-03f0cdb083e5', '08cc3ec2-736b-4732-a8f0-f99eb6f9d311', 'https://www.xmtyw.cn/wlyytest/gc/accesstoken', 'https://www.xmtyw.cn/wlyytest/wlyygc/tongan/hospital/addSurveyThird', '厦门I健康新增三院疾病筛查管理记录');
INSERT INTO `oauth_wlyy_config` (`id`, `app_id`, `app_secret`, `token_url`, `url`, `remark`) VALUES
    ('getThirdNum', '019bd04d-3cb2-433f-a530-03f0cdb083e5', '08cc3ec2-736b-4732-a8f0-f99eb6f9d311', 'https://www.xmtyw.cn/wlyytest/gc/accesstoken', 'https://www.xmtyw.cn/wlyytest/wlyygc/tongan/hospital/getThirdNum', '厦门I健康三院疾病筛查数量');
ALTER TABLE `dict_hospital_dept` ADD COLUMN `update_time` datetime NULL COMMENT '更新时间' ;

+ 23 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictHospitalDeptDO.java

@ -2,7 +2,6 @@ package com.yihu.jw.entity.base.dict;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.IntegerIdentityEntity;
import org.springframework.beans.factory.annotation.Autowired;
import javax.persistence.*;
import java.util.Date;
@ -19,6 +18,7 @@ import java.util.Date;
@SequenceGenerator(name="id_generated", sequenceName="DICT_HOSPITAL_DEPT_SEQ")
public class DictHospitalDeptDO extends IntegerIdentityEntity {
    private String saasId;//排序
    /**
	 * 机构code,每个机构的科室不完全一样
	 */
@ -44,6 +44,9 @@ public class DictHospitalDeptDO extends IntegerIdentityEntity {
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date updateTime;//更新时间
    /**
     * 6总部7金榜8夏禾
     */
@ -146,7 +149,16 @@ public class DictHospitalDeptDO extends IntegerIdentityEntity {
        this.code = code;
    }
	@Column(name = "name")
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    @Column(name = "name")
    public String getName() {
        return name;
    }
@ -162,6 +174,15 @@ public class DictHospitalDeptDO extends IntegerIdentityEntity {
        this.createTime = createTime;
    }
    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    @Column(name = "dept_type_code")
    public String getDeptTypeCode() {
        return deptTypeCode;

+ 2 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/DictHospitalDeptService.java

@ -185,6 +185,7 @@ public class DictHospitalDeptService extends BaseJpaService<DictHospitalDeptDO,
            if(dictHospitalDeptDO.getCreateTime()==null){
                dictHospitalDeptDO.setCreateTime(new Date());
            }
            dictHospitalDeptDO.setUpdateTime(new Date());
            dictHospitalDeptDao.save(dictHospitalDeptDO);
            if (StringUtils.isNoneBlank(doctorIds)){
                if (doctorIds.contains(",")){
@ -275,6 +276,7 @@ public class DictHospitalDeptService extends BaseJpaService<DictHospitalDeptDO,
                dictHospitalDeptDO.setOrgName(baseOrgDO.getName());
            }
            dictHospitalDeptDO.setCreateTime(new Date());
            dictHospitalDeptDO.setUpdateTime(new Date());
            dictHospitalDeptDO.setDeptTypeCode("6");
            dictHospitalDeptDO = dictHospitalDeptDao.save(dictHospitalDeptDO);
            if (StringUtils.isNotBlank(doctorIds)){

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

@ -105,6 +105,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.util.StreamUtils;
import org.springframework.web.bind.annotation.*;
@ -274,6 +275,20 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private SystemMessageDao systemMessageDao;
    @GetMapping(value = "deptBySaaId")
    @ApiOperation(value = "科室排序", notes = "科室排序")
    public ListEnvelop orgInfo(@ApiParam(name = "size", value = "取前几条")
                              @RequestParam(value = "size", required = true)Integer size
    ) {
        try {
            String sql = "select * from dict_hospital_dept where consult_dept_flag=1 order by saas_id,update_time desc limit "+size;
            List<DictHospitalDeptDO> deptList = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(DictHospitalDeptDO.class));
            return ListEnvelop.getSuccess("查询成功",deptList);
        } catch (Exception e){
            e.printStackTrace();
            return ListEnvelop.getError("查询失败");
        }
    }
    @GetMapping(value = "orgInfo")
    @ApiOperation(value = "机构详情", notes = "机构详情")
@ -1955,11 +1970,13 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "orgCode", required = true)String orgCode,
                                          @ApiParam(name = "dept", value = "需要置顶部门")
                                          @RequestParam(value = "dept", required = false)String dept,
                                          @ApiParam(name = "diseaseId", value = "专病id")
                                          @RequestParam(value = "diseaseId", required = false)String diseaseId,
                                          @ApiParam(name = "consultDeptFlag", value = "1为查询开通服务部门")
                                          @RequestParam(value = "consultDeptFlag", required = false)String consultDeptFlag) {
        try {
            return success(prescriptionService.findDeptByHospital(orgCode,dept,consultDeptFlag));
            return success(prescriptionService.findDeptByHospital(orgCode,dept,consultDeptFlag,diseaseId));
        }catch (Exception e) {
            return failedListEnvelopException2(e);
        }

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

@ -517,11 +517,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                          @RequestParam(value = "orgCode", required = true) String orgCode,
                                          @ApiParam(name = "dept", value = "需要置顶部门")
                                          @RequestParam(value = "dept", required = false) String dept,
                                          @ApiParam(name = "diseaseId", value = "专病id")
                                              @RequestParam(value = "diseaseId", required = false)String diseaseId,
                                          @ApiParam(name = "consultDeptFlag", value = "1为查询开通服务部门")
                                          @RequestParam(value = "consultDeptFlag", required = false) String consultDeptFlag) {
        try {
            return success(prescriptionService.findDeptByHospital(orgCode, dept, consultDeptFlag));
            return success(prescriptionService.findDeptByHospital(orgCode, dept, consultDeptFlag,diseaseId));
        } catch (Exception e) {
            return failedListEnvelopException(e);
        }