Parcourir la source

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

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
wangzhinan il y a 5 ans
Parent
commit
4447d1246b

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

@ -1903,6 +1903,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        //=====================电子病历=================================================end
        //=====================保存日志 start=========================================================
        List<WlyyPrescriptionCheckDO> prescriptionCheckDOS = prescriptionCheckDao.findByStatus(prescription.getId(),5);
        if (prescriptionCheckDOS==null || prescriptionCheckDOS.size() ==0){
            savePrescriptionCheck(prescription.getDoctor(),"开具处方",5,prescription.getId());
        }
        if (prescriptionDOs != null && prescriptionDOs.size() > 0) {
            savePrescriptionCheck(prescription.getDoctor(),"处方修改",3,prescription.getId());
        }
        //=====================保存日志 end=========================================================
        //判断是否有检查检验或药品开方
        if ("1".equals(type)) {
@ -1973,17 +1984,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //保存挂号费用
            prescription.setRegFee(getChargeFee(outpatientDO.getDoctor()));
            //=====================保存日志 start=========================================================
            List<WlyyPrescriptionCheckDO> prescriptionCheckDOS = prescriptionCheckDao.findByStatus(prescription.getId(),5);
            if (prescriptionCheckDOS==null || prescriptionCheckDOS.size() ==0){
                savePrescriptionCheck(prescription.getDoctor(),"开具处方",5,prescription.getId());
            }
            if (prescriptionDOs != null && prescriptionDOs.size() > 0) {
                savePrescriptionCheck(prescription.getDoctor(),"处方修改",3,prescription.getId());
            }
            //=====================保存日志 end=========================================================
            //保存费用
            prescriptionDao.save(prescription);
            if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){

+ 3 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -25,7 +25,9 @@ public abstract class IntegerIdentityEntity implements Serializable {
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
 /*   @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")*/
/*
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
*/
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
        return id;

+ 25 - 2
svr/svr-internet-hospital-entrance/src/main/resources/application.yml

@ -93,6 +93,12 @@ testPattern:
  sign: 0
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
spring:
  profiles: jwtest
@ -127,6 +133,11 @@ wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段  # todo 待配置
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
spring:
  profiles: jwprod
@ -163,7 +174,6 @@ express:
  sf_code: WH000102
  sf_check_word: TGUQASFNAZyjt9112
---
# 眼科医院前置机
spring:
@ -205,6 +215,10 @@ wlyy:
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段  # todo 待配置
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code:
  sf_check_word:
---
# 眼科医院前置机
spring:
@ -246,6 +260,10 @@ wlyy:
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code:
  sf_check_word:
---
#心脏中心前置机配置
spring:
@ -278,4 +296,9 @@ testPattern:
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_xzzx_wx  # base库中,wx_wechat 的id字段
  id: xm_xzzx_wx  # base库中,wx_wechat 的id字段
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code:
  sf_check_word:

+ 32 - 7
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java

@ -11,10 +11,14 @@ import com.yihu.jw.entity.base.wx.*;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDiagnosisDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
@ -24,6 +28,7 @@ import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.order.dao.ConsultOrderDao;
import com.yihu.jw.order.dao.ConsultTeamOrderDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.Envelop;
@ -107,6 +112,10 @@ public class UnSettledHISPrescriptionService {
    private ImService imService;
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    
    
    /**
@ -202,13 +211,6 @@ public class UnSettledHISPrescriptionService {
                            String outpatientId = pre.get(0).get("OUTPATIENT_ID").toString();
                            String prescriptionId = pre.get(0).get("ID").toString();
                            String doctorName = pre.get(0).get("DOCTOR_NAME").toString();
                            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
                            JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                            logger.info("11111参数入参"+object.toJSONString());
                            WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
                            imService.pushPrescriptionImMessage(prescriptionVO);
                            //判断是否发送过
                            String countSql = "SELECT id from WX_PUSH_LOG w WHERE w.RECEIVER = '"+patientDO.getId()
                                    +"' and w.OPENID = '"+prescriptionId+"' and w.scene = 'djsxxtz' and w.WECHAT_ID='"+wechatId+"'";
@ -244,6 +246,29 @@ public class UnSettledHISPrescriptionService {
                                    wxPushLogDO.setScene("djsxxtz");
                                    wxPushLogDao.save(wxPushLogDO);
                                }
                                WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
                                JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                                logger.info("wlyyPrescriptionDO参数入参"+object.toJSONString());
                                WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
                                List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                                List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS = new ArrayList<>();
                                for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:wlyyPrescriptionInfoDOS){
                                    JSONObject jsonObject = (JSONObject) JSONObject.toJSON(wlyyPrescriptionInfoDO);
                                    logger.info("wlyyPrescriptionInfoDO参数入参"+jsonObject.toJSONString());
                                    WlyyPrescriptionInfoVO prescriptionInfoVO = JSONObject.toJavaObject(jsonObject,WlyyPrescriptionInfoVO.class);
                                    wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
                                }
                                prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
                                List<WlyyPrescriptionDiagnosisDO> wlyyPrescriptionDiagnosisDOS = prescriptionDiagnosisDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                                List<WlyyPrescriptionDiagnosisVO> wlyyPrescriptionDiagnosisVOS = new ArrayList<>();
                                for (WlyyPrescriptionDiagnosisDO wlyyPrescriptionDiagnosisDO:wlyyPrescriptionDiagnosisDOS){
                                    JSONObject jsonObject = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDiagnosisDO);
                                    logger.info("wlyyPrescriptionDiagnosisDO参数入参"+jsonObject.toJSONString());
                                    WlyyPrescriptionDiagnosisVO prescriptionDiagnosisVO = JSONObject.toJavaObject(jsonObject,WlyyPrescriptionDiagnosisVO.class);
                                    wlyyPrescriptionDiagnosisVOS.add(prescriptionDiagnosisVO);
                                }
                                prescriptionVO.setDiagnosisVOs(wlyyPrescriptionDiagnosisVOS);
                                imService.pushPrescriptionImMessage(prescriptionVO);
                            }
                        }
                    }

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

@ -9,15 +9,18 @@ import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.hospital.prescription.dao.OauthYlzConfigDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.service.consult.SysDictService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
@ -49,6 +52,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -94,6 +98,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private BusinessOrderDao businessOrderDao;
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
@ -337,22 +343,33 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            result += inputLine;
        }
        request.getReader().close();
        Map<String, String> map = businessOrderService.getWxPayResultNotify(result);
        //im处方发消息
        Map<String,Object> wxrs =  XMLUtil.xmltoMap(result);
        if("SUCCESS".equals(wxrs.get("return_code").toString())){
            // 我方 订单号+时间差
            String seqNo = wxrs.get("out_trade_no")+"";
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByOrderNo(seqNo);
            if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
                WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(businessOrderDO.getRelationCode());
                JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                logger.info("11111参数入参"+object.toJSONString());
                WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
                imService.pushPrescriptionImMessage(prescriptionVO);
            if (businessOrderDO.getStatus()!=1){
                if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
                    WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(businessOrderDO.getRelationCode());
                    JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                    logger.info("wlyyPrescriptionDO参数入参"+object.toJSONString());
                    WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
                    List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                    List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS = new ArrayList<>();
                    for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:wlyyPrescriptionInfoDOS){
                        JSONObject jsonObject1 = (JSONObject) JSONObject.toJSON(wlyyPrescriptionInfoDO);
                        logger.info("wlyyPrescriptionInfoDO参数入参"+jsonObject1.toJSONString());
                        WlyyPrescriptionInfoVO prescriptionInfoVO = JSONObject.toJavaObject(jsonObject1,WlyyPrescriptionInfoVO.class);
                        wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
                    }
                    prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
                    prescriptionVO.setPayStatus(1);
                    imService.pushPrescriptionImMessage(prescriptionVO);
                }
            }
        }
        Map<String, String> map = businessOrderService.getWxPayResultNotify(result);
        return map;
    }
@ -402,16 +419,29 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                    JSONObject param = jsonObject.getJSONObject("param");
                    logger.info("param"+params);
                    String traceNo = param.getString("outChargeNo");
                    businessOrderService.updatePayStatus(traceNo);
                    //im处方发消息
                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByOrderNo(traceNo);
                    if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
                        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(businessOrderDO.getRelationCode());
                        JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                        logger.info("11111参数入参"+object.toJSONString());
                        WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
                        imService.pushPrescriptionImMessage(prescriptionVO);
                    if (businessOrderDO.getStatus()!=1){
                        if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
                            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(businessOrderDO.getRelationCode());
                            JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                            logger.info("wlyyPrescriptionDO参数入参"+object.toJSONString());
                            WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
                            List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                            List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS = new ArrayList<>();
                            for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:wlyyPrescriptionInfoDOS){
                                JSONObject jsonObject1 = (JSONObject) JSONObject.toJSON(wlyyPrescriptionInfoDO);
                                logger.info("wlyyPrescriptionInfoDO参数入参"+jsonObject1.toJSONString());
                                WlyyPrescriptionInfoVO prescriptionInfoVO = JSONObject.toJavaObject(jsonObject1,WlyyPrescriptionInfoVO.class);
                                wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
                            }
                            prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
                            prescriptionVO.setPayStatus(1);
                            imService.pushPrescriptionImMessage(prescriptionVO);
                        }
                    }
                    businessOrderService.updatePayStatus(traceNo);
                    response.getWriter().write("SUCCESS");
                }
            }

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

@ -7,6 +7,8 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
import com.yihu.jw.hospital.prescription.service.InspectionService;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
@ -17,6 +19,8 @@ import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.im.ConsultVO;
import com.yihu.jw.restmodel.web.Envelop;
@ -39,6 +43,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -82,6 +87,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    
    @Autowired
    private BusinessOrderService businessOrderService;
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    
    @Value("${demo.flag}")
    private boolean demoFlag;
@ -1313,8 +1322,26 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                System.out.println("发送诊断消息成功:"+immsg);
            }else if (status==2){
                JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
                System.out.println("11111参数入参"+object.toJSONString());
                System.out.println("wlyyPrescriptionDO参数入参"+object.toJSONString());
                WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
                List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS = new ArrayList<>();
                for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:wlyyPrescriptionInfoDOS){
                    JSONObject jsonObject = (JSONObject) JSONObject.toJSON(wlyyPrescriptionInfoDO);
                    System.out.println("wlyyPrescriptionInfoDO参数入参"+jsonObject.toJSONString());
                    WlyyPrescriptionInfoVO prescriptionInfoVO = JSONObject.toJavaObject(jsonObject,WlyyPrescriptionInfoVO.class);
                    wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
                }
                prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
                List<WlyyPrescriptionDiagnosisDO> wlyyPrescriptionDiagnosisDOS = prescriptionDiagnosisDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
                List<WlyyPrescriptionDiagnosisVO> wlyyPrescriptionDiagnosisVOS = new ArrayList<>();
                for (WlyyPrescriptionDiagnosisDO wlyyPrescriptionDiagnosisDO:wlyyPrescriptionDiagnosisDOS){
                    JSONObject jsonObject = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDiagnosisDO);
                    System.out.println("wlyyPrescriptionDiagnosisDO参数入参"+jsonObject.toJSONString());
                    WlyyPrescriptionDiagnosisVO prescriptionDiagnosisVO = JSONObject.toJavaObject(jsonObject,WlyyPrescriptionDiagnosisVO.class);
                    wlyyPrescriptionDiagnosisVOS.add(prescriptionDiagnosisVO);
                }
                prescriptionVO.setDiagnosisVOs(wlyyPrescriptionDiagnosisVOS);
                imService.pushPrescriptionImMessage(prescriptionVO);
            }