Browse 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 5 năm trước cách đây
mục cha
commit
4f016ebd45
16 tập tin đã thay đổi với 267 bổ sung53 xóa
  1. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionLogDao.java
  2. 16 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionLogService.java
  3. 43 25
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  4. 1 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java
  5. 25 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java
  6. 11 3
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  7. 20 1
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  8. 36 18
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WxTemplateService.java
  9. 1 1
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  10. 15 0
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionInfoDO.java
  11. 2 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  12. 10 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionInfoVO.java
  13. 54 0
      svr/svr-base/src/main/resources/application.yml
  14. 14 0
      svr/svr-base/src/main/resources/bootstrap.yml
  15. 14 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  16. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ylz/YlzNotifyController.java

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/PrescriptionLogDao.java

@ -16,6 +16,6 @@ public interface PrescriptionLogDao extends PagingAndSortingRepository<WlyyPresc
    List<WlyyPrescriptionLogDO> findByPrescriptionCodeOrderByCreateTimeDesc(String prescriptionCode);
    @Query("select a from WlyyPrescriptionLogDO a where a.prescriptionCode = ?1 and a.status in(20,30,10,100) GROUP BY a.status order by a.createTime asc ")
    @Query("select a from WlyyPrescriptionLogDO a where a.prescriptionCode = ?1 and a.status in(20,30,10,100)  order by a.createTime asc ")
    List<WlyyPrescriptionLogDO> findByPrescriptionCodeByStatus(String prescriptionCode);
}

+ 16 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionLogService.java

@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -85,6 +86,20 @@ public class PrescriptionLogService  extends BaseJpaService<WlyyPrescriptionLogD
     * @return
     */
    public List<WlyyPrescriptionLogDO> findByPrescriptionCodeByStatus(String prescriptionCode){
        return logDao.findByPrescriptionCodeByStatus(prescriptionCode);
        List<WlyyPrescriptionLogDO> wlyyPrescriptionLogDOS = logDao.findByPrescriptionCodeByStatus(prescriptionCode);
        List<Integer> list = new ArrayList<>();
        List<WlyyPrescriptionLogDO> wlyyPrescriptionLogDOList=new ArrayList<>();
        for (WlyyPrescriptionLogDO prescriptionLogDO:wlyyPrescriptionLogDOS){
            if (list!=null&&list.size()!=0){
                if (!list.contains(prescriptionLogDO.getStatus())){
                    list.add(prescriptionLogDO.getStatus());
                    wlyyPrescriptionLogDOList.add(prescriptionLogDO);
                }
            }else {
                wlyyPrescriptionLogDOList.add(prescriptionLogDO);
            }
        }
        list.clear();
        return wlyyPrescriptionLogDOList;
    }
}

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

@ -445,15 +445,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            rs.put("expressage",null);
        }
        //物流配送新
        List<WlyyPrescriptionExpressageLogDO>  expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientIdOrderByCreateTimeDesc(outpatientId);
        List<WlyyPrescriptionExpressageLogVO> expressageLogVOs = new ArrayList<>();
        if(expressageLogDOs!=null&&expressageLogDOs.size()>0){
            rs.put("expressageLogs",convertToModels(expressageLogDOs,expressageLogVOs, WlyyPrescriptionExpressageLogVO.class));
        }else{
            rs.put("expressageLogs",null);
        if (!wechatId.equalsIgnoreCase("xm_ykyy_wx")){
            //物流配送新
            List<WlyyPrescriptionExpressageLogDO>  expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientIdOrderByCreateTimeDesc(outpatientId);
            List<WlyyPrescriptionExpressageLogVO> expressageLogVOs = new ArrayList<>();
            if(expressageLogDOs!=null&&expressageLogDOs.size()>0){
                rs.put("expressageLogs",convertToModels(expressageLogDOs,expressageLogVOs, WlyyPrescriptionExpressageLogVO.class));
            }else{
                rs.put("expressageLogs",null);
            }
        }
        //预约记录
        List<WlyyPatientRegisterTimeDO> timeDOs = patientRegisterTimeDao.findByOutpatientId(outpatientId);
        if(timeDOs!=null&&timeDOs.size()>0){
@ -1954,7 +1957,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if (prescriptionCheckDOS==null || prescriptionCheckDOS.size() ==0){
                savePrescriptionCheck(prescription.getDoctor(),"开具处方",5,prescription.getId());
            }
            if(StringUtils.isNoneBlank(prescriptionDO.getId())){
            if (prescriptionDOs != null && prescriptionDOs.size() > 0) {
                savePrescriptionCheck(prescription.getDoctor(),"处方修改",3,prescription.getId());
            }
@ -1985,7 +1989,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //上传his开方
                //sendHisDiagnosis(jsonData, outpatientDO, prescription)
                //zsSynHis(prescription.getId());
                return null;
                Map<String, Object> result1 = new HashedMap();
                result1.put("code", 1);
                result1.put("mes", "开方提交成功");
                return result1;
            }else {
                result.put("code", 1);
                result.put("mes", "诊断完成");
@ -5328,7 +5335,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param status
     */
    public void updateStatus(String prescriptionId,Integer status){
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
        prescriptionDao.updateStatus(prescriptionId,status,new Date());
        prescriptionLogService.addPrescriptionLog(prescriptionId,status,1,wlyyPrescriptionDO.getPatientCode(),wlyyPrescriptionDO.getPatientName(),null,new Date());
    }
@ -5366,38 +5375,41 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        prescriptionCheckDO = prescriptionCheckDao.save(prescriptionCheckDO);
        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
        if (status==2){
            prescriptionDao.updateCheckStatus(prescriptionId,2,reason,20);
            prescriptionLogService.addPrescriptionLog(prescriptionId,20,2,operate,operateName,reason,new Date());
            /*if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
            /*prescriptionDao.updateCheckStatus(prescriptionId,2,reason,20);*/
            logger.info("开始====="+wlyyPrescriptionDO.getCheckStatus());
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                try {
                    WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
                    List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId);
                    List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionId);
                    WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
                    List<WlyyPrescriptionInfoDO> infoDOS = prescriptionInfoDao.findByPrescriptionId(prescriptionId,1);
                    List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(prescriptionId,1);
                    WlyyOutpatientDO outpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
                    DoctorMappingDO doctorMappingDO = doctorMappingService.findMappingCode(outpatientDO.getDoctor(), outpatientDO.getHospital());
                    //his处方拼接开方条件
                    com.alibaba.fastjson.JSONArray jsonData = new com.alibaba.fastjson.JSONArray();
                    for (WlyyPrescriptionInfoDO info:infoDOS){
                        //设置his药品查询条件
                        setInfoJsonParam(jsonData, doctorMappingDO, outpatientDO, prescriptionDO, info, outpatientDO.getIcd10());
                        setInfoJsonParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, info, outpatientDO.getIcd10());
                    }
                    for (WlyyInspectionDO ins:inspectionDOS){
                        //设置his药品查询条件
                        setInspectionParam(jsonData, doctorMappingDO, outpatientDO, prescriptionDO, ins, outpatientDO.getIcd10());
                        setInspectionParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, ins, outpatientDO.getIcd10());
                    }
                    sendHisDiagnosis(jsonData, outpatientDO, prescriptionDO);
                    sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }*/
            }
            prescriptionLogService.addPrescriptionLog(prescriptionId,20,2,operate,operateName,reason,new Date());
            wlyyPrescriptionDO.setCheckStatus(2);
            wlyyPrescriptionDO.setCheckReason(reason);
            wlyyPrescriptionDO.setStatus(20);
        }else{
            wlyyPrescriptionDO.setCheckStatus(status);
            wlyyPrescriptionDO.setCheckReason(reason);
            wlyyPrescriptionDO.setStatus(11);
            prescriptionDao.save(wlyyPrescriptionDO);
        }
        prescriptionDao.save(wlyyPrescriptionDO);
        if (status==2||status==1){
            sendCheckMessage(status,wlyyPrescriptionDO,operate,operateName);
        }
@ -5489,21 +5501,27 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            systemMessageDO.setSender(operate);
            systemMessageDO.setSenderName(operateName);
            JSONObject data = new JSONObject();
            Integer age = 0;
            String gender = "";
            if (StringUtils.isNoneBlank(prescriptionDO.getIdcard())){
                age = IdCardUtil.getAgeForIdcard(prescriptionDO.getIdcard());
                gender=IdCardUtil.getSexForIdcard(prescriptionDO.getIdcard());
            }
            data.put("name",prescriptionDO.getPatientName());
            data.put("age",IdCardUtil.getAgeForIdcard(prescriptionDO.getIdcard()));
            data.put("gender",IdCardUtil.getSexForIdcard(prescriptionDO.getIdcard()));
            data.put("age",age);
            data.put("gender",gender);
            data.put("outpatientId",prescriptionDO.getOutpatientId());
            data.put("prescriptionId",prescriptionDO.getId());
            if (status==2){
                systemMessageDO.setType("9");
                systemMessageDO.setTitle("审方通过");
                data.put("message","审方通过");
                data.put("message","您为"+prescriptionDO.getPatientName()+"("+IdCardUtil.getAgeForIdcard(prescriptionDO.getIdcard())+"岁 "+IdCardUtil.getSexForIdcard(prescriptionDO.getIdcard())+")开具的处方已审核通过。");
                data.put("message","您为"+prescriptionDO.getPatientName()+"("+age+"岁 "+gender+")开具的处方已审核通过。");
            } else if (status==1) {
                systemMessageDO.setType("8");
                systemMessageDO.setTitle("审方退回");
                data.put("message","审方退回");
                data.put("message","您为"+prescriptionDO.getPatientName()+"("+IdCardUtil.getAgeForIdcard(prescriptionDO.getIdcard())+"岁 "+IdCardUtil.getSexForIdcard(prescriptionDO.getIdcard())+")开具的处方被审方退回,请尽快处理");
                data.put("message","您为"+prescriptionDO.getPatientName()+"("+age+"岁 "+gender+")开具的处方被审方退回,请尽快处理");
            }
            systemMessageDO.setData(data.toString());
            systemMessageService.saveMessage(systemMessageDO);

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

@ -325,6 +325,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            object.put("jbywbz",map.get("jbywbz"));//基本药物标志
            object.put("ydyp",map.get("ydyp"));//药店药品
            object.put("ypmc2",map.get("ypmc2"));//药品名称2
            object.put("t",map.get("pzwh"));//药品批文
            array.add(object);
        }
        return array;

+ 25 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -304,6 +304,29 @@ public class YkyyEntranceService {
        return new JSONArray();
    }
    /**
     * 查找眼科his 已审核未付款的处方
     * @throws Exception
     */
    public JSONArray getNoUnsettledPrescription() throws Exception{
        String sql = "SELECT h.BRID,h.CFSB,h.SJLY from v_ms_dd01 h WHERE h.SPZT = 2 and h.FKZT = 0 order by h.KFRQ desc ";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        params.put("page","1");
        params.put("size","60");
        HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            return rs.getJSONArray("detailModelList");
        }
        return new JSONArray();
    }
    /**
     * HIS就诊患者历史查询
     * @throws Exception
@ -927,7 +950,8 @@ public class YkyyEntranceService {
                "yp.jbywbz AS \"jbywbz\"," +
                "yp.ydyp AS \"ydyp\"," +
                "yp.ypmc2 AS \"ypmc2\"," +
                "yp.gyffmc as \"gyffmc\""+  " FROM " +
                "yp.gyffmc as \"gyffmc\"," +
                "yp.pzwh as \"pzwh\""+  " FROM " +
                "V_ZKSG_MZ_YPXX yp where 1=1 ";
        if (StringUtils.isNoneBlank(ypdm)){
            sql+=" and yp.ypdm like '%"+ypdm+"%' ";

+ 11 - 3
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -639,6 +639,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
        String sql ="SELECT " +
                " a.id AS \"id\", " +
                " a.doctor as \"doctor\","+
                " a.doctor_name AS \"name\", " +
                " a.score AS \"score\", " +
                " a.patient_name AS \"patient_name\", " +
@ -650,7 +651,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                "JOIN base_evaluate e ON a.id = e.relation_code " +
                "JOIN base_doctor d ON d.id = a.doctor " +
                "WHERE " +
                " e.score_type = '4'";
                " e.score_type = '4' ";
        Map<String,Object> params = new HashedMap();
        if(StringUtils.isNotBlank(startDate)){
@ -675,6 +676,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
            Boolean errorFlag = false;
            JSONObject jb = new JSONObject();
            try{
                String interId = "";
                String idCard = info.get("docIdCard") == null ? "0":info.get("docIdCard").toString();
@ -686,7 +689,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
//                String[] dept = depToSubject(info.get("dept_code").toString());
                jb.put("id",orgCode +"_"+ (String)info.get("id"));
                jb.put("id",interId +"_"+ (String)info.get("id"));
                jb.put("id_doctor",interId == null ? "0":interId);
                jb.put("organ_code",orgCode);
                jb.put("organ_name", orgName);
@ -1180,6 +1183,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("pres_dept_code", info.get("dept")== null?"0":info.get("dept"));
                jb.put("pres_dept_name",info.get("dept_name")== null?"0":info.get("dept_name"));
                jb.put("pres_time", info.get("create_time")== null?"1900-01-01 00:00:00":DateUtil.dateToStrLong((Date)info.get("create_time")));
                jb.put("trial_time",DateUtil.dateToStrLong(new Date()));
                jb.put("pres_doc_code", visitDocCode);
                jb.put("pres_doc_name", info.get("doctor_name")== null?"0":info.get("doctor_name"));
                jb.put("pres_doc_id_no", info.get("docIdcard")== null?"0":info.get("docIdcard"));
@ -1251,7 +1255,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                "    a.supply_code AS \"supply_code\"," +
                "    a.specification AS \"specification\"," +
                "    a.pack_retprice AS \"pack_retprice\"," +
                "    a.pack_retprice AS \"drug_total_price\"" +
                "    a.pack_retprice AS \"drug_total_price\"," +
                "   a.days as \"days\"," +
                "   a.serial as \"serial\" "+
                "  from wlyy_prescription_info a " +
                "     JOIN wlyy_prescription b " +
                "     on b.id = a.prescription_id" +
@ -1289,7 +1295,9 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("drug_code", "");
                jb.put("drug_name", "");
                jb.put("drug_form", "");
                jb.put("approval_no",info.get("serial"));
                jb.put("dosage",info.get("dosage") == null? 0: info.get("dosage"));
                jb.put("Prescription days",Integer.parseInt(info.get("days").toString()));
                jb.put("dosage_unit", info.get("unit") == null? "0": info.get("unit"));
                jb.put("total_dosage", info.get("quantity") == null? 0: info.get("quantity"));
                jb.put("total_dosage_unit", info.get("pack_unit") == null? "0": info.get("pack_unit"));

+ 20 - 1
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -54,6 +54,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -631,6 +632,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                        wlyyPrescriptionDO.setStatus(30);
                        wlyyPrescriptionDO.setPayStatus(1);
                        prescriptionDao.save(wlyyPrescriptionDO);
                        prescriptionLogService.addPrescriptionLog(wlyyPrescriptionDO.getId(),30,1,wlyyPrescriptionDO.getPatientCode(),wlyyPrescriptionDO.getPatientName(),"",new Date());
                        String sql = " update v_ms_dd01 SET FKZT=1 where CFSB = '"+wlyyPrescriptionDO.getRealOrder()+"'";
                        try {
                            ykyyEntranceService.updateHisStatus(sql);
@ -913,6 +915,23 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    }
    public JSONObject selectOrderTime(String relationCode){
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("PAY_TIME");
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(relationCode);
        Date createDate = businessOrderDO.getCreateTime();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(createDate);
        if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
            calendar.add(Calendar.MINUTE,Integer.parseInt(wlyyHospitalSysDictDO.getPyCode()));
        }else {
            calendar.add(Calendar.MINUTE,Integer.parseInt(wlyyHospitalSysDictDO.getDictCode()));
        }
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String time = sdf.format(calendar.getTime());
        JSONObject object = new JSONObject();
        object.put("endTime",time);
        object.put("createTime",businessOrderDO.getCreateTime());
        return object;
    }
}

+ 36 - 18
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxTemplateService.java

@ -14,6 +14,7 @@ import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
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.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.oauth.OauthSsoService;
@ -41,10 +42,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * Created by Administrator on 2017/5/19 0019.
@ -99,6 +97,8 @@ public class WxTemplateService {
    private OutpatientDao outpatientDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private PrescriptionLogService prescriptionLogService;
    
    
    /**
@ -158,6 +158,23 @@ public class WxTemplateService {
     */
    public void unSettledHISPrescription() throws Exception{
        if("xm_ykyy_wx".equals(wechatId)){
            //获取审核失败
            JSONArray jsonArray = ykyyEntranceService.getNoUnsettledPrescription();
            if(jsonArray!=null&&jsonArray.size()>0) {
                for (int i = 0; i<jsonArray.size(); i++){
                    JSONObject json = jsonArray.getJSONObject(i);
                    String cfsb = json.getString("CFSB");
                    //查找对应的处方
                    String sql = "SELECT w.OUTPATIENT_ID,w.ID,w.DOCTOR_NAME from WLYY_PRESCRIPTION w WHERE REAL_ORDER = '"+cfsb+"' ORDER BY w.CREATE_TIME desc";
                    List<Map<String, Object>> pre = hibenateUtils.createSQLQuery(sql);
                    if(pre!=null && pre.size()>0){
                        String prescriptionId = pre.get(0).get("ID").toString();
                        //修改处方状态
                        String updateSql = "update WLYY_PRESCRIPTION set status = 11 where id = '"+prescriptionId+"'";
                        hibenateUtils.updateBySql(updateSql);
                    }
                }
            }
            //获取已审核未结算的处方
            JSONArray array = ykyyEntranceService.getUnsettledPrescription();
            //发送模板
@ -190,6 +207,7 @@ public class WxTemplateService {
                                    //修改处方状态
                                    String updateSql = "update WLYY_PRESCRIPTION set status = 20 where id = '"+prescriptionId+"' and status = 10";
                                    hibenateUtils.updateBySql(updateSql);
                                    prescriptionLogService.addPrescriptionLog(prescriptionId,20,2,"system","system","",new Date());
                                    ps.stream().forEach(one->{
                                        WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId,"template_unsettled_notice","djsxxtz",1);
@ -217,7 +235,6 @@ public class WxTemplateService {
                    }
                }
            }
        }
    }
@ -231,13 +248,13 @@ public class WxTemplateService {
                List<BusinessOrderDO> businessOrderDOS = businessOrderDao.selectByStatus(0);
                //关闭处理
                for (BusinessOrderDO businessOrderDO:businessOrderDOS){
                    long nd = 1000 * 24 * 60 * 60;
                    long nh = 1000 * 60 * 60;
                    long nm = 1000 * 60;
                    Long diff = businessOrderDO.getCreateTime().getTime()- new Date().getTime();
                    Long min = diff % nd % nh / nm;
                    if (min==Long.parseLong(close)){
                    Calendar cal= Calendar.getInstance();
                    cal.setTime(businessOrderDO.getCreateTime());
                    cal.add(Calendar.MINUTE,Integer.parseInt(close));
                    Long now = new Date().getTime();
                    Long min = cal.getTime().getTime();
                    logger.info("关闭处理cal="+cal);
                    if (min==now){
                        String orderCategory = businessOrderDO.getOrderCategory();
                        String relationCode = businessOrderDO.getRelationCode();
                        if (orderCategory.equalsIgnoreCase("1")){
@ -259,13 +276,14 @@ public class WxTemplateService {
                    String orderType =businessOrderDO.getOrderType()+"";
                    String doctor = businessOrderDO.getDoctor();
                    String patient= businessOrderDO.getPatient();
                    long nd = 1000 * 24 * 60 * 60;
                    long nh = 1000 * 60 * 60;
                    long nm = 1000 * 60;
                    Long diff = businessOrderDO.getCreateTime().getTime()- new Date().getTime();
                    Long min = diff % nd % nh / nm;
                    if (min==Long.parseLong(remind)){
                    Calendar cal= Calendar.getInstance();
                    cal.setTime(businessOrderDO.getCreateTime());
                    cal.add(Calendar.MINUTE,Integer.parseInt(remind));
                    Long now = new Date().getTime();
                    Long min = cal.getTime().getTime();
                    logger.info("提醒处理cal="+cal);
                    if (min==now){
                        //判断是否发送过
                        String countSql = "SELECT id from WX_PUSH_LOG w WHERE w.RECEIVER = '"+patient
                                +"' and w.OPENID = '"+relationCode+"' and w.scene = 'zxzfts' and w.WECHAT_ID='"+wechatId+"'";

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

@ -2504,7 +2504,7 @@ public class ImService {
					"patient.idcard AS \"patientIdcard\"," +
					"patient.sex AS \"patientsex\"," +
					"patient.photo AS \"patientphoto\"," +
					"op.id AS \"outpatientid\"," ;
					"op.id AS \"outpatientId\"," ;
			if("xm_ykyy_wx".equals(wxId)){
				sql = sql + "to_char(op.register_date,'YYYY-MM-DD hh24:mi:ss')  AS \"registerDate\",";
			}else{

+ 15 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionInfoDO.java

@ -159,6 +159,12 @@ public class WlyyPrescriptionInfoDO extends UuidIdentityEntity {
    private Integer HisCode;
    /**
     * 药品批文
     */
    private String pzwh;
    @Column(name = "prescription_id")
    public String getPrescriptionId() {
        return prescriptionId;
@ -399,4 +405,13 @@ public class WlyyPrescriptionInfoDO extends UuidIdentityEntity {
    public void setHisCode(Integer hisCode) {
        HisCode = hisCode;
    }
    @Column(name = "pzwh")
    public String getPzwh() {
        return pzwh;
    }
    public void setPzwh(String pzwh) {
        this.pzwh = pzwh;
    }
}

+ 2 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -405,6 +405,8 @@ public class BaseHospitalRequestMapping {
        public static final String deleteById = "/deleteById";
        public static final String selectExpireTime = "/selectExpireTime";
    }

+ 10 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/hospital/prescription/WlyyPrescriptionInfoVO.java

@ -158,6 +158,8 @@ public class WlyyPrescriptionInfoVO extends UuidIdentityVOWithOperator {
    private String comm;
    private String pzwh;
    public String getPrescriptionId() {
        return prescriptionId;
@ -371,4 +373,12 @@ public class WlyyPrescriptionInfoVO extends UuidIdentityVOWithOperator {
    public void setHisCode(Integer hisCode) {
        HisCode = hisCode;
    }
    public String getPzwh() {
        return pzwh;
    }
    public void setPzwh(String pzwh) {
        this.pzwh = pzwh;
    }
}

+ 54 - 0
svr/svr-base/src/main/resources/application.yml

@ -254,6 +254,12 @@ spring:
    url: jdbc:oracle:thin:@172.26.0.141:1521:helowin
    username: normal
    password: normal
  jpa:
      properties:
        hibernate:
          dialect: org.hibernate.dialect.Oracle10gDialect
          show_sql: true
      database: oracle
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
@ -288,6 +294,54 @@ testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
---
spring:
  profiles: jwOracleProd
  datasource:
    driver-class-name: oracle.jdbc.driver.OracleDriver
    url: jdbc:oracle:thin:@10.10.10.16:1521/rac
    username: normal
    password: normal
  jpa:
    properties:
      hibernate:
        dialect: org.hibernate.dialect.Oracle10gDialect
        show_sql: true
    database: oracle
  elasticsearch:
    cluster-name: jkzl #集群名 默认elasticsearch
    cluster-nodes: 192.168.33.198:9300,192.168.33.198:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    client-transport-sniff: false
    jest:
      uris: http://172.19.103.45:9200,http://172.19.103.68:9200
      connection-timeout: 60000 # Connection timeout in milliseconds.
      multi-threaded: true # Enable connection requests from multiple execution threads.
  activemq:
    broker-url: tcp://172.19.103.87:61616
    user: admin
    password: admin
  redis:
    host: 192.168.33.198 # Redis server host.
    port: 6380 # Redis server port.
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
demo:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
wlyy:
  url: http://www.xmtyw.cn/wlyy/
wechat:
  id: xm_ykyy_wx
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
---
spring:
  profiles: iotprod

+ 14 - 0
svr/svr-base/src/main/resources/bootstrap.yml

@ -44,6 +44,20 @@ spring:
      uri: ${wlyy.pring.config.uri:http://172.16.100.63:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: jwOracleProd
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.33.199:1221}
      label: ${wlyy.spring.config.label:master}
---
spring:
  profiles: jwOracleTest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: local
  cloud:

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

@ -1390,5 +1390,19 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value= BaseHospitalRequestMapping.Prescription.selectExpireTime)
    @ApiOperation("查询过期时间")
    public ObjEnvelop selectExpireTime(
            @ApiParam(name = "relationCode", value = "relationCode", required = true)
            @RequestParam(required = true)String relationCode) throws Exception {
        try {
            return ObjEnvelop.getSuccess("ok",businessOrderService.selectOrderTime(relationCode));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    
}

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ylz/YlzNotifyController.java

@ -155,6 +155,7 @@ public class YlzNotifyController<T> {
			LOGGER.info("解密前:{}", JSON.toJSONString(encryptRes));
			ResponseParams<?> decryptRes = client.decryptNotifyResponse(encryptRes);
			LOGGER.info("解密后:{}", JSON.toJSONString(decryptRes));
			String param =JSON.toJSONString(decryptRes);
			boolean isDecrypt = ("-1".equals(decryptRes.getRespCode()) ? false : true); // 是否解密失败
			if (!isDecrypt) {
				response.getWriter().write("DECRYPT FAILURE");
@ -164,9 +165,10 @@ public class YlzNotifyController<T> {
				if (!isVerify) {
					response.getWriter().write("FAILURE");
				} else {
					String param = JSON.toJSONString(decryptRes.getParam());
					JSONObject object = JSONObject.parseObject(param);
					String orderNo = object.getString("outChargeNo");
					JSONObject jsonObject = object.getJSONObject("param");
					LOGGER.info("object"+object.toJSONString()+"jsonObject"+jsonObject.toJSONString());
					String orderNo = jsonObject.getString("outChargeNo");
					businessOrderService.updatePayStatus(orderNo);
					response.getWriter().write("SUCCESS");
				}