Переглянути джерело

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

Conflicts:
	svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorServiceApplicationService.java
	svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java
	svr/svr-door-serivce/src/main/java/com/yihu/jw/door/util/MessageUtil.java
	svr/svr-door-serivce/src/main/resources/application.yml
yeshijie 4 роки тому
батько
коміт
4d2df2ae8a

+ 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;
    }
}

+ 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类型)