Преглед на файлове

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

wangzhinan преди 4 години
родител
ревизия
0454433120

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

@ -1,5 +1,6 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.door.WlyyDoorPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
@ -63,4 +64,6 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    @Query("select a from WlyyPrescriptionDO a where a.createTime>?1 and  a.createTime <?2 and a.status <30 and a.status>=0")
    List<WlyyPrescriptionDO> findListByCheckStatus(Date startTime,Date endTime);
    @Query("select a from WlyyPrescriptionDO a,WlyyDoorPrescriptionDO p where a.id=p.code and p.orderId = ?1 and p.isAfterDoor = ?2  order by a.createTime desc")
    List<WlyyPrescriptionDO> findByOrderIdAndIsAfterDoor(String id, Integer isAfterDoor);
}

+ 7 - 15
common/common-entity/src/main/java/com/yihu/jw/entity/door/WlyyDoorServiceOrderDO.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.door;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import javax.persistence.Column;
import javax.persistence.Entity;
@ -548,9 +549,8 @@ public class WlyyDoorServiceOrderDO extends UuidIdentityEntityWithOperator {
    private String serviceStatus;//服务类型 1-预约项目 2-即时项目
    private String orderInfo;//工单详情 0-未推送 1-未确认 2-已确认
    private List<WlyyDoorPrescriptionDO> prescriptionDOList;//上门前开的方
    private List<WlyyDoorPrescriptionDO> afterPrescriptionList;//上门后开的方
    private String outpatientId;//关联门诊记录
    private List<WlyyPrescriptionDO> prescriptionDOList;//上门前开的方
    private List<WlyyPrescriptionDO> afterPrescriptionList;//上门后开的方
    /**
     * 快捷类型,1是快捷类型,其他值不是
@ -558,20 +558,20 @@ public class WlyyDoorServiceOrderDO extends UuidIdentityEntityWithOperator {
    private String shortcutType;
    @Transient
    public List<WlyyDoorPrescriptionDO> getPrescriptionDOList() {
    public List<WlyyPrescriptionDO> getPrescriptionDOList() {
        return prescriptionDOList;
    }
    public void setPrescriptionDOList(List<WlyyDoorPrescriptionDO> prescriptionDOList) {
    public void setPrescriptionDOList(List<WlyyPrescriptionDO> prescriptionDOList) {
        this.prescriptionDOList = prescriptionDOList;
    }
    @Transient
    public List<WlyyDoorPrescriptionDO> getAfterPrescriptionList() {
    public List<WlyyPrescriptionDO> getAfterPrescriptionList() {
        return afterPrescriptionList;
    }
    public void setAfterPrescriptionList(List<WlyyDoorPrescriptionDO> afterPrescriptionList) {
    public void setAfterPrescriptionList(List<WlyyPrescriptionDO> afterPrescriptionList) {
        this.afterPrescriptionList = afterPrescriptionList;
    }
@ -1183,12 +1183,4 @@ public class WlyyDoorServiceOrderDO extends UuidIdentityEntityWithOperator {
        this.shortcutType = shortcutType;
    }
    @Column(name = "outpatient_id")
    public String getOutpatientId() {
        return outpatientId;
    }
    public void setOutpatientId(String outpatientId) {
        this.outpatientId = outpatientId;
    }
}

+ 17 - 2
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoctorController.java

@ -4,8 +4,8 @@ import com.alibaba.fastjson.JSON;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.door.controller.BaseController;
import com.yihu.jw.door.service.common.WlyyMessageService;
import com.yihu.jw.door.service.common.PatientService;
import com.yihu.jw.door.service.common.WlyyMessageService;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * Created by yeshijie on 2020/12/30.
@ -80,7 +81,21 @@ public class DoctorController extends BaseController {
        }
    }
    @GetMapping(value = "/patientList")
    @ApiOperation("查询居民列表信息")
    public String patientList(
        @ApiParam(name = "name", value = "分页大小", required = false) @RequestParam(value = "name", required = false) String name,
        @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1") @RequestParam(value = "page") int page,
        @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15") @RequestParam(value = "size") int size
        ) {
        try {
            List<Map<String,Object>> p = patientService.patientList(name,page,size);
            return write(200, "查询成功", "data", p);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
    /**
     * 查询居民信息

+ 8 - 2
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java

@ -13,7 +13,9 @@ import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.door.*;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.dao.ConsultTeamDao;
import com.yihu.jw.im.util.ImUtil;
@ -127,6 +129,10 @@ public class DoorOrderService {
    private WlyyDoorCommentDao doorCommentDao;
    @Autowired
    private SystemMessageDao systemMessageDao;
    @Autowired
    private PrescriptionDao prescriptionDao;
    /**
     * 顶部状态栏订单各分类总条数
     * @param doctor
@ -342,8 +348,8 @@ public class DoorOrderService {
        doorServiceOrder.setDoorConclusion(doorConclusion);
        //获取上门前后开方详情
        List<WlyyDoorPrescriptionDO> doorBeforePrescriptionDOList = doorPrescriptionDao.findByOrderIdAndIsAfterDoor(id, 1);
        List<WlyyDoorPrescriptionDO> doorAfterPrescriptionDOList = doorPrescriptionDao.findByOrderIdAndIsAfterDoor(id, 2);
        List<WlyyPrescriptionDO> doorBeforePrescriptionDOList = prescriptionDao.findByOrderIdAndIsAfterDoor(id, 1);
        List<WlyyPrescriptionDO> doorAfterPrescriptionDOList = prescriptionDao.findByOrderIdAndIsAfterDoor(id, 2);
        doorServiceOrder.setPrescriptionDOList(doorBeforePrescriptionDOList);
        doorServiceOrder.setAfterPrescriptionList(doorAfterPrescriptionDOList);

+ 24 - 12
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java

@ -379,7 +379,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                        totalSubFee = totalSubFee.add(fee);
                    }
                    wlyyDoorFeeDetailService.delete(idStrSet.toArray());
                    totalFee = orderDO.getTotalFee().subtract(totalSubFee);
//                    totalFee = orderDO.getTotalFee().subtract(totalSubFee);
//                    orderDO.setTotalFee(totalFee);
                }
            }
@ -1020,8 +1020,8 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        orderJson.put("conclusion",conclusionJson);
        //获取上门前后开方详情
        List<WlyyDoorPrescriptionDO> doorBeforePrescriptionDOList = doorPrescriptionDao.findByOrderIdAndIsAfterDoor(id, 1);
        List<WlyyDoorPrescriptionDO> doorAfterPrescriptionDOList = doorPrescriptionDao.findByOrderIdAndIsAfterDoor(id, 2);
        List<WlyyPrescriptionDO> doorBeforePrescriptionDOList = prescriptionDao.findByOrderIdAndIsAfterDoor(id, 1);
        List<WlyyPrescriptionDO> doorAfterPrescriptionDOList = prescriptionDao.findByOrderIdAndIsAfterDoor(id, 2);
        orderJson.put("doorBeforePrescription",doorBeforePrescriptionDOList);
        orderJson.put("doorAfterPrescription", doorAfterPrescriptionDOList);
@ -2517,17 +2517,29 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
            doorPrescriptionDao.save(prescription);
        }else {
            //判断手动输入的处方号是否被关联过
            List<WlyyDoorPrescriptionDO> doorPrescriptionDOs = new ArrayList<>();
            String[] recipeNoString = prescriptionCode.split(",");
            for (int i = 0; i < recipeNoString.length; i++) {
                //判断是否被工单手工关联过
                List<WlyyDoorServiceOrderDO> orderDOList = wlyyDoorServiceOrderDao.findByPrescriptionCode("%" + recipeNoString[i] + "%");
/*                 //判断是否被工单手工关联过
               List<WlyyDoorServiceOrderDO> orderDOList = wlyyDoorServiceOrderDao.findByPrescriptionCode("%" + recipeNoString[i] + "%");
                WlyyDoorPrescriptionDO prescriptionDO = doorPrescriptionDao.findByRecipeNo(recipeNoString[i]);
                if(orderDOList.size() > 0 || prescriptionDO != null){
                    res.put("status", -1);
                    res.put("msg", "处方号:" + recipeNoString[i] + "已被关联过,请重新输入");
                    return res;
                }*/
                //关联处方关系
                List<WlyyPrescriptionDO>  prescriptionDOList = prescriptionDao.findByRealOrderList(recipeNoString[i]);
                if(prescriptionDOList.size()>0){
                    WlyyDoorPrescriptionDO prescriptionDO = new WlyyDoorPrescriptionDO();
                    prescriptionDO.setOrderId(orderId);
                    prescriptionDO.setIsAfterDoor(1);
                    prescriptionDO.setCode(prescriptionDOList.get(0).getId());
                    doorPrescriptionDOs.add(prescriptionDO);
                }
            }
            doorPrescriptionDao.save(doorPrescriptionDOs);
            //上门前手动开方即更新工单的处方号
            wlyyDoorServiceOrderDao.updatePrescriptionById(orderId, prescriptionCode, new Date());
            WlyyDoorServiceOrderDO orderDO = wlyyDoorServiceOrderDao.findOne(orderId);
@ -2550,15 +2562,15 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
     */
    public void savePrescription(String orderId,String prescriptionCode){
        WlyyDoorServiceOrderDO orderDO = wlyyDoorServiceOrderDao.findOne(orderId);
        orderDO.setPrescriptionCode(prescriptionCode);
        orderDO.setPrescriptionTime(new Date());
        orderDO.setPrescriptionStatus(1);
        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionCode);
        if(prescriptionDO!=null){
            orderDO.setOutpatientId(prescriptionDO.getOutpatientId());
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionCode);
        if(wlyyPrescriptionDO!=null){
            WlyyDoorPrescriptionDO prescriptionDO = new WlyyDoorPrescriptionDO();
            prescriptionDO.setOrderId(orderId);
            prescriptionDO.setIsAfterDoor(2);
            prescriptionDO.setCode(prescriptionCode);
            doorPrescriptionDao.save(prescriptionDO);
        }
        wlyyDoorServiceOrderDao.save(orderDO);
        //非代预约才发送im消息
        if(orderDO.getType() != null && orderDO.getType() != 3) {
            //发送 预约卡片信息(2101类型)

+ 57 - 14
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/PatientService.java

@ -8,12 +8,18 @@ import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by yeshijie on 2020/12/31.
@ -26,6 +32,57 @@ public class PatientService {
    private SignFamilyDao signFamilyDao;
    @Autowired
    private BasePatientMedicareCardDao patientMedicareCardDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public List<Map<String,Object>> patientList(String name, Integer page, Integer size){
        List<Map<String,Object>> resultList = new ArrayList<>(32);
        String sql = "select p.* from base_patient p where p.del = '1' and p.enabled = 1 ";
        if(StringUtils.isNoneBlank(name)){
            sql += " and p.name like '%"+name+"%'";
        }
        int start = 0 == page ? page++ : (page - 1) * size;
        int end = 0 == size ? 15 : size;
        sql += " limit "+start+","+end;
        List<BasePatientDO> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(BasePatientDO.class));
        for (BasePatientDO p:list){
            Map<String,Object> json = new HashedMap();
            json.put("id", p.getId());
            json.put("code", p.getId());
            // 设置患者姓名
            json.put("name", p.getName());
            // 设置患者手机号
            json.put("mobile", p.getMobile());
            // 设置患者微信openid
            json.put("openid", StringUtils.isNotEmpty(p.getOpenid()) ? p.getOpenid() : "");
            json.put("openidTime", DateUtil.dateToStr(p.getOpenidTime(), DateUtil.YYYY_MM_DD_HH_MM_SS));
            // 设置患者联系电话
            json.put("phone", p.getPhone());
            // 设置患者头像
            json.put("photo", p.getPhoto());
            // 设置患者年龄
            json.put("age", IdCardUtil.getAgeByIdcardOrBirthday(p.getIdcard(),p.getBirthday()));
            // 设置患者性别
            json.put("sex", p.getSex());
            // 身份证号
            json.put("idcard", p.getIdcard());
            //1.4.2新增medicareNumber
//        json.put("medicareNumber", p.getMedicareNumber());
            // 设置患者居住省份
            json.put("provinceName", p.getProvinceName());
            json.put("cityName", p.getCityName());
            json.put("townName", p.getTownName());
            json.put("streetName", p.getStreetName());
            // 设置患者地址
            json.put("address", p.getAddress());
            resultList.add(json);
        }
        return resultList;
    }
    /**
     * 查询单个居民信息
@ -101,8 +158,6 @@ public class PatientService {
            json.put("qyrq", familySign.getApplyDate() != null ? DateUtil.dateToStr((Date) familySign.getApplyDate(), DateUtil.YYYY_MM_DD) : "");
            // 设置签约日期
            json.put("patientApplyDate", familySign.getPatientApplyDate() != null ? DateUtil.dateToStr((Date) familySign.getPatientApplyDate(), DateUtil.YYYY_MM_DD) : "");
            // 设置签约类型
            json.put("signType", json.has("signType") ? 3 : 2);
            // 缴费情况
            json.put("expensesStatus", StringUtils.isNotEmpty(familySign.getExpensesStatus()) ? String.valueOf(familySign.getExpensesStatus()) : "0");
            // 缴费时间
@ -114,18 +169,6 @@ public class PatientService {
            json.put("jtBeginDate", DateUtil.dateToStr(familySign.getBegin(), DateUtil.YYYY_MM_DD));
            json.put("jtEndDate", DateUtil.dateToStr(familySign.getEnd(), DateUtil.YYYY_MM_DD));
//            Doctor jtDoctor = doctorDao.findByCode(familySign.getDoctor());
//            json.put("jtDoctor", familySign.getDoctor());
//            json.put("jtDoctorName", familySign.getDoctorName());
//            json.put("jtDoctorSex", jtDoctor.getSex());
//            json.put("jtDoctorPhoto", jtDoctor.getPhoto());
//            json.put("jtDoctorHealth", familySign.getDoctorHealth());
//            json.put("jtDoctorHealthName", familySign.getDoctorHealthName());
//            json.put("jtSpecialist", familySign.getSpecialist());
//            json.put("jtSpecialistName", familySign.getSpecialistName());
//            json.put("jtAdminTeam", familySign.getAdminTeamId());
//            json.put("jtHospital", familySign.getHospital());
//            json.put("jtHospitalName", familySign.getHospitalName());
        }