소스 검색

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

humingfen 4 년 전
부모
커밋
e75fba8fa3

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseJobCategoryDao.java

@ -12,4 +12,6 @@ public interface BaseJobCategoryDao extends PagingAndSortingRepository<BaseJobCa
    List<BaseJobCategoryDO> findFirstCategoryList();
    @Query("from BaseJobCategoryDO t where t.pid = ?1 and t.del = 1")
    List<BaseJobCategoryDO> findSecondCategoryList(String pid);
    @Query("from BaseJobCategoryDO t where t.name = ?1 and t.del = 1")
    BaseJobCategoryDO findByName(String name);
}

+ 31 - 5
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -1,6 +1,8 @@
package com.yihu.jw.hospital.family.service;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dict.dao.BaseJobCategoryDao;
import com.yihu.jw.entity.base.dict.BaseJobCategoryDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.hospital.family.BasePatientMemberDictDO;
@ -62,6 +64,8 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
    private YkyyService ykyyService;
    @Value("${wechat.id}")
    private String wxId;
    @Autowired
    private BaseJobCategoryDao baseJobCategoryDao;
    //添加关联家属
    @Transactional
@ -325,9 +329,6 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
            mixEnvelop.setDetailModelList(resultList);
            if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
                PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByCode(medicare);
                if (patientMedicareCardDO==null){
                    patientMedicareCardDO = new PatientMedicareCardDO();
                }
                if (null!=patientMedicareCardDO){
                    if (!patientMedicareCardDO.getPatientCode().equalsIgnoreCase(sucessPatient.getId())){
                        mixEnvelop.setStatus(408);
@ -335,6 +336,9 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                        return mixEnvelop;
                    }
                }
                if (patientMedicareCardDO==null){
                    patientMedicareCardDO = new PatientMedicareCardDO();
                }
                patientMedicareCardDO.setCode(medicare);
                //patientMedicareCardDO.setType(medicareType);
                patientMedicareCardDO.setPatientCode(patientNewId);
@ -495,7 +499,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                        System.out.println("birthday:"+map.get("birthday").toString());
                    }
                    List<PatientMedicareCardDO> list1 = basePatientMedicareCardDao.findByPatientCode(patientId);
                    if (null!=list1&&list.size()>0){
                    if (null!=list1&&list1.size()>0){
                        map.put("card",list1.get(0));
                    }else {
                        map.put("card","");
@ -575,6 +579,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                    envelop.setStatus(-1);
                    return envelop;
                }
            }
            wlyyPatientFamilyMemberDao.save(wlyyPatientFamilyMemberDO);
            envelop.setMessage("删除成功");
@ -586,7 +591,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        }
    }
    //获取单个亲属详细信息
    public List<Map<String,Object>>  findMemberById(String id) throws ParseException {
    public List<Map<String,Object>>  findMemberById(String id) throws Exception {
        String sql="select t.id as \"id\",t.card_type as \"cardType\"," +
                "t.family_member as \"familyMember\",t.patient as \"patient\"," +
                "b.name as \"name\",b.idcard as \"idcard\",b.mobile as \"mobile\",t.clinicid as \"clinicid\"," +
@ -610,9 +615,30 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                        List<PatientMedicareCardDO> list1 = basePatientMedicareCardDao.findByPatientCode(map.get("familyMember").toString());
                        if (list1!=null&&list1.size()!=0){
                            map.put("card",list1.get(0));
                            JSONObject object = ykyyEntranceService.selectByAddress(list1.get(0).getCode());
                            if (object!=null){
                                map.put("address",object.getString("address"));
                                map.put("zydm",object.getString("zydm"));
                                if (StringUtils.isNotBlank(object.getString("zydm"))){
                                    BaseJobCategoryDO jobCategoryDO = baseJobCategoryDao.findOne(Integer.parseInt(object.getString("zydm")));
                                    if (jobCategoryDO!=null){
                                        map.put("zydmName",jobCategoryDO.getName());
                                    }
                                }else {
                                    map.put("zydmName","");
                                }
                                map.put("jtdh",object.getString("jtdh"));
                            }
                        }else {
                            map.put("card","");
                            map.put("address","");
                            map.put("zydm","");
                            map.put("jtdh","");
                            map.put("zydmName","");
                        }
                    }
                }
            }

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

@ -2,12 +2,15 @@ package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.BaseDictJobTitleDao;
import com.yihu.jw.dict.dao.BaseJobCategoryDao;
import com.yihu.jw.dict.dao.DictDeptDescDao;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
import com.yihu.jw.entity.base.area.BaseDrugStoreDO;
import com.yihu.jw.entity.base.dict.BaseJobCategoryDO;
import com.yihu.jw.entity.base.dict.DictDeptDescDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
@ -127,6 +130,8 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import static javafx.scene.input.KeyCode.L;
/**
 * Created by Trick on 2019/5/17.
 */
@ -274,6 +279,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @Autowired
    private PayInfoNoticeService payInfoNoticeService;
    @Autowired
    private BaseJobCategoryDao jobCategoryDao;
@ -10708,9 +10715,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            businessDO.setPayType(1);
            businessDO.setUpdateTime(new Date());
            businessOrderDao.save(businessDO);
            logger.info("更新建档信息");
            BaseJobCategoryDO jobCategoryDO =jobCategoryDao.findByName(firstJobName);
            Float zy= 0f;
            if (jobCategoryDO!=null){
                zy=Float.parseFloat(jobCategoryDO.getId()+"");
            }
            ykyyEntranceService.updatePatientJd(patientId,address,mobile,zy,demoFlag);
            //同步眼科医院
            logger.info("开始同步眼科医院");
            ykyyEntranceService.saveKsjc(baseNatAppointmentDO,demoFlag);
            //预约成功后发送支付模板消息
            sendYktemplateMessage(baseNatAppointmentDO.getId(),false);
            logger.info("结束同步眼科医院");
@ -10832,6 +10847,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    BeanUtils.copyProperties(config, newConfig);
                    newConfig.setFirst(config.getFirst().replace("key1",userName));
                    newConfig.setKeyword1("核酸检测预约单支付");
                    if ("3".equalsIgnoreCase(baseNatAppointmentDO.getHospitalFlag())){
                        newConfig.setKeyword2("厦门大学附属厦门眼科中心思北院区");
                    }else {
                        newConfig.setKeyword2("厦门大学附属厦门眼科中心五缘院区");
                    }
                    newConfig.setKeyword3(map.get("doctorName")==null?"":map.get("doctorName").toString());
                    newConfig.setKeyword4(userName);
                    newConfig.setKeyword5(DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()));
@ -10857,6 +10877,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    BeanUtils.copyProperties(configPayNotice, newPayNotice);
                    newPayNotice.setFirst(configPayNotice.getFirst().replace("key1",userName));
                    newPayNotice.setKeyword1("核酸检测预约单支付");
                    if ("3".equalsIgnoreCase(baseNatAppointmentDO.getHospitalFlag())){
                        newPayNotice.setKeyword2("厦门大学附属厦门眼科中心思北院区");
                    }else {
                        newPayNotice.setKeyword2("厦门大学附属厦门眼科中心五缘院区");
                    }
                    newPayNotice.setKeyword3(map.get("doctorName")==null?"":map.get("doctorName").toString());
                    newPayNotice.setRemark(configPayNotice.getRemark());
                    newPayNotice.setUrl(configPayNotice.getUrl()+baseNatAppointmentDO.getId());
@ -10895,6 +10920,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "t.pay_status as \"payStatus\"," +
                "t.medicare as \"medicare\","+
                "t.voucher_no as \"voucherNo\","+
                "t.dept as \"dept\","+
                "t.dept_name as \"deptName\","+
                "t.id as \"id\"," +
                "t.card_no_type as \"cardNoType\"," +
                "t.appointment_time as \"appointmentTime\" " +
@ -11004,54 +11031,71 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            try {
                BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
                if (null!=baseNatAppointmentDO){
                    res = entranceService.BS10145("3150000","0001",DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),demoFlag);
                    logger.info("核酸检测预约取消"+res);
                    com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
                    Boolean flag = false;
                    if (jsonObject!=null){
                        com.alibaba.fastjson.JSONObject object = jsonObject.getJSONObject("MsgInfo");
                        String Msg = object.getString("Msg");
                        if (Msg.contains("Error")){
                            throw new Exception(Msg);
                        }else {
                            baseNatAppointmentDO.setIsSuccess("-1");
                            baseNatAppointmentDO.setCancelReson("患者本人取消");
                            baseNatAppointmentDO.setCancelTime(new Date());
                            baseNatAppointmentDO.setCancelBy(patientId);
                            baseNatAppointmentDao.save(baseNatAppointmentDO);
                            if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
                                //删除处方
                                logger.info("删除处方开始");
                                net.sf.json.JSONObject jsondate = new JSONObject();
                                jsondate.put("checkPart","鼻/咽拭子");
                                jsondate.put("cardNo",baseNatAppointmentDO.getMedicare());
                                jsondate.put("chargeFlag","2");
                                jsondate.put("chargeCode","361322");
                                jsondate.put("icdCode","Z00.000");
                                jsondate.put("socialNo",baseNatAppointmentDO.getCardNo());
                                jsondate.put("tellPhone",baseNatAppointmentDO.getMobile());
                                jsondate.put("address1",baseNatAppointmentDO.getProvinceName());
                                jsondate.put("address2",baseNatAppointmentDO.getCityName());
                                jsondate.put("address3",baseNatAppointmentDO.getTownName());
                                jsondate.put("address4",baseNatAppointmentDO.getStreetName());
                                jsondate.put("address5",2);
                                jsondate.put("area",baseNatAppointmentDO.getAddress());
                                jsondate.put("winNo",6);
                                jsondate.put("target",2);
                                jsondate.put("quantity",1);
                                jsondate.put("serialNo",baseNatAppointmentDO.getRegisterNo());
                                jsondate.put("dept",baseNatAppointmentDO.getDept());
                                jsondate.put("doctor",baseNatAppointmentDO.getDoctorId());
                                jsondate.put("realOrder",baseNatAppointmentDO.getRealOrder());
                                JSONArray array = new JSONArray();
                                array.add(jsondate);
                                JSONObject object1  = entranceService.BS10112(array.toString(),demoFlag);
                                logger.info("删除处方结束");
                            }
                    if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                        res = entranceService.BS10145("3150000","0001",DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),demoFlag);
                        logger.info("核酸检测预约取消"+res);
                        com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
                        Boolean flag = false;
                        if (jsonObject!=null){
                            com.alibaba.fastjson.JSONObject object = jsonObject.getJSONObject("MsgInfo");
                            String Msg = object.getString("Msg");
                            if (Msg.contains("Error")){
                                throw new Exception(Msg);
                            }else {
                                baseNatAppointmentDO.setIsSuccess("-1");
                                baseNatAppointmentDO.setCancelReson("患者本人取消");
                                baseNatAppointmentDO.setCancelTime(new Date());
                                baseNatAppointmentDO.setCancelBy(patientId);
                                baseNatAppointmentDao.save(baseNatAppointmentDO);
                                if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
                                    //删除处方
                                    logger.info("删除处方开始");
                                    net.sf.json.JSONObject jsondate = new JSONObject();
                                    jsondate.put("checkPart","鼻/咽拭子");
                                    jsondate.put("cardNo",baseNatAppointmentDO.getMedicare());
                                    jsondate.put("chargeFlag","2");
                                    jsondate.put("chargeCode","361322");
                                    jsondate.put("icdCode","Z00.000");
                                    jsondate.put("socialNo",baseNatAppointmentDO.getCardNo());
                                    jsondate.put("tellPhone",baseNatAppointmentDO.getMobile());
                                    jsondate.put("address1",baseNatAppointmentDO.getProvinceName());
                                    jsondate.put("address2",baseNatAppointmentDO.getCityName());
                                    jsondate.put("address3",baseNatAppointmentDO.getTownName());
                                    jsondate.put("address4",baseNatAppointmentDO.getStreetName());
                                    jsondate.put("address5",2);
                                    jsondate.put("area",baseNatAppointmentDO.getAddress());
                                    jsondate.put("winNo",6);
                                    jsondate.put("target",2);
                                    jsondate.put("quantity",1);
                                    jsondate.put("serialNo",baseNatAppointmentDO.getRegisterNo());
                                    jsondate.put("dept",baseNatAppointmentDO.getDept());
                                    jsondate.put("doctor",baseNatAppointmentDO.getDoctorId());
                                    jsondate.put("realOrder",baseNatAppointmentDO.getRealOrder());
                                    JSONArray array = new JSONArray();
                                    array.add(jsondate);
                                    JSONObject object1  = entranceService.BS10112(array.toString(),demoFlag);
                                    logger.info("删除处方结束");
                                }
                            }
                        }
                    }else if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                        baseNatAppointmentDO.setIsSuccess("-1");
                        baseNatAppointmentDO.setCancelReson("患者本人取消");
                        baseNatAppointmentDO.setCancelTime(new Date());
                        baseNatAppointmentDO.setCancelBy(patientId);
                        baseNatAppointmentDao.save(baseNatAppointmentDO);
                        if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
                            logger.info("同步his订单状态"+baseNatAppointmentDO.getRealOrder());
                            String updateJcsq = "update V_EMR_JCSQ set ZFBZ = 1 where yjxh = "+baseNatAppointmentDO.getRealOrder();
                            ykyyEntranceService.updateHisStatus(updateJcsq);
                            String update01sq = "update V_MS_YJ01 set ZFPB = 1 where yjxh = "+baseNatAppointmentDO.getRealOrder();
                            ykyyEntranceService.updateHisStatus(update01sq);
                        }
                    }
                }
            } catch (Exception e) {

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

@ -51,6 +51,7 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.CheckSumBuilder;
import com.yihu.jw.utils.FileUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.mysql.query.BaseJpaService;
@ -66,6 +67,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@ -928,13 +930,12 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        }
        Long endTime = new Date().getTime();
        Long startTime = new Date().getTime()-24*60*60*1000;
        List vids = new ArrayList();
        String appKey = sysDictDO.getDictValue();
        String appSecret = hospitalSysDictDO.getDictValue();
        String nonce =  randomInt(10);
        String curTime = String.valueOf((new Date()).getTime() / 1000L);
        String checkSum = CheckSumBuilder.getCheckSum(appSecret, nonce ,curTime);//参考 计算CheckSum的java代码
        String url = "https://vcloud.163.com/app/vod/video/get";
        String url = "https://vcloud.163.com/app/vod/video/list";
        Map<String,Object> httpPost = new HashedMap();
        // 设置请求的header
        httpPost.put("AppKey", appKey);
@ -946,6 +947,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        object.put("currentPage",500);
        object.put("pageSize",1);
        object.put("status",40);
        object.put("type",0);
        object.put("beginTime",startTime);
        object.put("endTime",endTime);
        logger.info("入参"+object.toJSONString());
@ -956,14 +958,13 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            if (jsonObject.getString("code").equalsIgnoreCase("200")){
                JSONObject object1 = jsonObject.getJSONObject("ret");
                if (object1!=null){
                    Integer total = object1.getInteger("totalRecords");
                    JSONArray jsonArray = object1.getJSONArray("list");
                    if (jsonArray!=null&&jsonArray.size()>0){
                        for (int i=0;i<jsonArray.size();i++){
                            JSONObject object2 = jsonArray.getJSONObject(i);
                            if (object2!=null){
                                String vedioUrl =object1.getString("origUrl");
                                String vedioName = object1.getString("videoName");
                                String vedioUrl =object2.getString("origUrl");
                                String vedioName = object2.getString("videoName");
                                String filePath = "/Projects/Video/"+DateUtil.getStringDate("yyyyMMdd");
                                logger.info("filePath:"+filePath);
                                logger.info("vedioUrl"+vedioUrl);
@ -1016,6 +1017,70 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        }
        return null;
    }
    public String saveVideoFileList(String startTime,String endTime,Integer status,Integer page ,Integer pageSize){
        WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.findById("YXAPPKEY");
        WlyyHospitalSysDictDO hospitalSysDictDO =  hospitalSysDictDao.findById("YXAPPSECRET");
        if (sysDictDO==null){
            return  "找不到对应的key";
        }
        JSONObject object = new JSONObject();
        if (StringUtils.isNoneBlank(startTime)){
            Long start = DateUtil.strToDate(startTime).getTime();
            object.put("beginTime",start);
        }
        if (StringUtils.isNoneBlank(endTime)){
            Long end = DateUtil.strToDate(endTime).getTime();
            object.put("endTime",end);
        }
        if (status!=null){
            object.put("status",40);
        }
        object.put("type",0);
        String appKey = sysDictDO.getDictValue();
        String appSecret = hospitalSysDictDO.getDictValue();
        String nonce =  randomInt(10);
        String curTime = String.valueOf((new Date()).getTime() / 1000L);
        String checkSum = CheckSumBuilder.getCheckSum(appSecret, nonce ,curTime);//参考 计算CheckSum的java代码
        String url = "https://vcloud.163.com/app/vod/video/list";
        Map<String,Object> httpPost = new HashedMap();
        // 设置请求的header
        httpPost.put("AppKey", appKey);
        httpPost.put("Nonce", nonce);
        httpPost.put("CurTime", curTime);
        httpPost.put("CheckSum", checkSum);
        httpPost.put("Content-Type", "application/json");
        object.put("currentPage",page);
        object.put("pageSize",pageSize);
        logger.info("入参"+object.toJSONString());
        String response = httpClientUtil.postBodyHead(url,object,httpPost);
        logger.info("返回日志"+response);
        if(StringUtils.isNoneBlank(response)){
            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(response);
            if (jsonObject.getString("code").equalsIgnoreCase("200")){
                JSONObject object1 = jsonObject.getJSONObject("ret");
                if (object1!=null){
                    JSONArray jsonArray = object1.getJSONArray("list");
                    if (jsonArray!=null&&jsonArray.size()>0){
                        for (int i=0;i<jsonArray.size();i++){
                            JSONObject object2 = jsonArray.getJSONObject(i);
                            if (object2!=null){
                                String vedioUrl =object2.getString("origUrl");
                                String vedioName = object2.getString("videoName");
                                String filePath = "/Projects/Video/"+DateUtil.getStringDate("yyyyMMdd");
                                //String filePath = "D:\\Backup\\桌面\\配置及相关文档\\"+DateUtil.getStringDate("yyyyMMdd");
                                logger.info("filePath:"+filePath);
                                logger.info("vedioUrl"+vedioUrl);
                                FileUtil.saveUrlAs(vedioUrl,filePath,"GET",vedioName);
                            }
                        }
                    }
                }
            }
        }
        return null;
    }
}

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

@ -8,6 +8,7 @@ import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorRoleDao;
import com.yihu.jw.entity.base.dict.BaseJobCategoryDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictIcd10DO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
@ -67,17 +68,19 @@ public class YkyyEntranceService {
    private static Logger logger = LoggerFactory.getLogger(YkyyEntranceService.class);
    private final static String url="http://192.168.33.197:10023/ykyy/createSQLQuery";
    private final static String url="http://192.168.20.55:10023/ykyy/createSQLQuery";
//    private final static String url="http://localhost:10023/ykyy/createSQLQuery";
    private final static String saveUrl="http://192.168.33.197:10023/ykyy/save";
    private final static String orderUrl="http://192.168.33.197:10023/ykyy/outPatientOrder";
    private final static String saveUrl="http://192.168.20.55:10023/ykyy/save";
    private final static String orderUrl="http://192.168.20.55:10023/ykyy/outPatientOrder";
    private final static String updateUrl="http://192.168.33.197:10023/ykyy/updateBySql";
    private final static String updateUrl="http://192.168.20.55:10023/ykyy/updateBySql";
    private final static String updateEntityUrl="http://192.168.33.197:10023/ykyy/update";
    private final static String updateEntityUrl="http://192.168.20.55:10023/ykyy/update";
    private final static String jdbcUrl="http://192.168.33.197:10023/ykyy/jdbcSQLQuery";
    private final static String jdbcUrl="http://192.168.20.55:10023/ykyy/jdbcSQLQuery";
    private final static String updateJdxx="http://192.168.20.55:10023/ykyy/updateJdxx";
    private final static String orgCode ="350211A5004";
@ -133,8 +136,6 @@ public class YkyyEntranceService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private DictDoctorDutyDao dictDoctorDutyDao;
    @Autowired
    private BasePatientMedicareCardDao patientMedicareCardDao;
    @Autowired
    private WlyyInspectionDao wlyyInspectionDao;
@ -2130,6 +2131,7 @@ public class YkyyEntranceService {
            JSONObject object = array.getJSONObject(0);
            String yjxh = object.getString("yjxh");
            natAppointmentDO.setRealOrder(yjxh);
            natAppointmentDO.setIsSuccess("1");
            baseNatAppointmentDao.save(natAppointmentDO);
        }else {
        }
@ -3029,6 +3031,63 @@ public class YkyyEntranceService {
    public JSONObject selectByAddress(String cardNo) throws Exception {
        JSONObject jsonObject = new JSONObject();
        String address = null;
        String zydm = null;
        String jtdh = null;
        JSONArray array = new JSONArray();
        String sql = "SELECT brid as \"brid\",hkdz as \"hkdz\",zydm as \"zydm\",jtdh as \"jtdh\" from portal_his.V_ZKSG_BRCX@xec_link where jzkh = '"+cardNo+"'";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            array = rs.getJSONArray("detailModelList");
            if (array!=null&&array.size()!=0){
                JSONObject object = array.getJSONObject(0);
                address=object.getString("hkdz");
                zydm = object.getString("zydm");
                jtdh = object.getString("jtdh");
                jsonObject.put("address",address);
                jsonObject.put("zydm",zydm);
                jsonObject.put("jtdh",jtdh);
            }
        }
        return  jsonObject;
    }
    /**
     * 通过卡号更新患者信息
     */
    public void updatePatientJd(String patient,String address,String phone,Float zy, boolean demoFlag) throws Exception {
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
        JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
        if(jsonArray!=null&&jsonArray.size()>0){
            //获取居民信息
            JSONObject json = jsonArray.getJSONObject(0);
            String brid = json.getString("brid");
            Float id = Float.parseFloat(brid);
            Map<String,Object> params = new HashedMap();
            params.put("brid",id);
            params.put("sfzh",basePatientDO.getIdcard());
            params.put("lxdh",phone);
            params.put("lxdz",address);
            params.put("zy",zy);
            HttpResponse response = HttpUtils.doGet(updateJdxx,params);
            logger.info("更新患者信息"+response);
        }
    }
    public String saveJdxx(String brxm,String csny,Float brxb,String czgh,String sfzh,Float sjhm,String ybkh,String lxdz,Float zy){
        return  hibenateUtils.saveJdxx(brxm,DateUtil.strToDateShort(csny),brxb,czgh,sfzh,sjhm,ybkh,lxdz,zy);

+ 20 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/TimeoutOverDueService.java

@ -20,6 +20,7 @@ import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.dao.ConsultTeamDao;
@ -27,8 +28,8 @@ import com.yihu.jw.im.service.ImService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.DateUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -92,6 +93,8 @@ public class TimeoutOverDueService {
    private EntranceService entranceService;
    @Autowired
    private PatientMappingDao patientMappingDao;
    @Autowired
    private YkyyEntranceService ykyyEntranceService;
    /**
     *  取消未结束门诊
     */
@ -238,7 +241,22 @@ public class TimeoutOverDueService {
                    if (patientMappingDO != null) {
                        userNo = patientMappingDO.getMappingCode();
                    }
                    entranceService.BS10145(baseNatAppointmentDO.getDept(),baseNatAppointmentDO.getDoctorId(), DateUtil.dateToStr(baseNatAppointmentDO.getAppointmentTime(),"yyyy-MM-dd hh:mm:ss"),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),userNo,baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),false);
                    if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
                        entranceService.BS10145("3150000","0001", DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),false);
                    }
                    if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                        baseNatAppointmentDO.setIsSuccess("-1");
                        baseNatAppointmentDO.setCancelReson("系统超时取消");
                        baseNatAppointmentDO.setCancelTime(new Date());
                        baseNatAppointmentDO.setCancelBy("system");
                        baseNatAppointmentDao.save(baseNatAppointmentDO);
                        if (StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
                            String updateJcsq = "update V_EMR_JCSQ set ZFBZ = 1 where yjxh = "+baseNatAppointmentDO.getRealOrder();
                            ykyyEntranceService.updateHisStatus(updateJcsq);
                            String update01sq = "update V_MS_YJ01 set ZFPB = 1 where yjxh = "+baseNatAppointmentDO.getRealOrder();
                            ykyyEntranceService.updateHisStatus(update01sq);
                        }
                    }
                    //取消挂号
                } catch (Exception e) {
                    e.printStackTrace();

+ 1 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/CancelNotPay.java

@ -22,7 +22,7 @@ import java.util.Date;
public class CancelNotPay implements SchedulingConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(CancelNotPay.class);
    private static String cron = "0 */1 * * * ?";//"0 0 0 * * ?";0 */5 * * * ?
    private static String cron = "0 0 0 * * ?";//"0 0 0 * * ?";0 */5 * * * ?
    @Autowired
    private TimeoutOverDueService timeoutOverDueService;
    public String change(String corIn) {

+ 9 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
@ -721,4 +722,12 @@ public class JobController extends BaseController {
        return success(ykyyPrescriptionService.saveVideoFile(vip));
    }
    @RequestMapping(value = "saveVideoFileList", method = RequestMethod.GET)
    @ApiOperation("下载云信录制")
    public String saveVideoFile(@RequestParam(value = "startTime", required = false)String startTime,
                                @RequestParam(value = "endTime", required = false)String endTime, Integer status, Integer page , Integer pageSize){
        return success(ykyyPrescriptionService.saveVideoFileList(startTime,endTime,status,page,pageSize));
    }
}

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -399,7 +399,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    @ApiOperation("获取单个亲属信息")
    @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findSingleMember)
    public Envelop findSingleMember(@ApiParam(name = "id", value = "id", required = false)
                                    @RequestParam(value = "id", required = false) String id) throws ParseException {
                                    @RequestParam(value = "id", required = false) String id) throws Exception {
        return success(wlyyFamilyMemberService.findMemberById(id));
    }
    public boolean verifyCaptcha(String key,String text){

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

@ -48,6 +48,7 @@ import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
@ -182,7 +183,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private BaseBannerDoctorService baseBannerDoctorService;
    @Autowired
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @Autowired
    private YkyySMSService ykyySMSService;
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
@ -1498,8 +1500,9 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                    @RequestParam(value = "page", required = false)Integer page,
                                    @ApiParam(name = "pageSize", value = "每页大小")
                                        @RequestParam(value = "pageSize", required = false)Integer pageSize) throws Exception {
        prescriptionService.savePayStatusByHis(patientId);
        if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
            prescriptionService.savePayStatusByHis(patientId);
        }
        logger.info("同步数据成功");
        return  prescriptionService.getNatRecords(patientId,id,payStatus,appointmentTime,isSuccess,page,pageSize);
    }
@ -1513,4 +1516,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        return  success(prescriptionService.findBaseAddress(addressFlag,parentName));
    }
    @GetMapping("/testsms")
    public void testsms(String mobile ,String contet){
        ykyySMSService.ykyySendSMS(mobile,contet);
    }
}

+ 4 - 4
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceSimService.java

@ -162,11 +162,11 @@ public class IotDeviceSimService  extends BaseJpaService<IotDeviceSimDO, IotDevi
        ArrayList<IotDeviceSimDO> list = new ArrayList<>();
        mapList.forEach(one->{
            IotDeviceSimDO iotDeviceSimDO = JSONObject.parseObject(JSONObject.toJSONString(one), IotDeviceSimDO.class);
            if (one.get("patient_name")!=null){
                iotDeviceSimDO.setContactsName(AesEncryptUtils.decrypt(one.get("patient_name").toString()));
            if (one.get("contacts_name")!=null){
                iotDeviceSimDO.setContactsName(AesEncryptUtils.decrypt(one.get("contacts_name").toString()));
            }
            if (one.get("mobile")!=null){
                iotDeviceSimDO.setContactsMobile(AesEncryptUtils.decrypt(one.get("mobile").toString()));
            if (one.get("contacts_mobile")!=null){
                iotDeviceSimDO.setContactsMobile(AesEncryptUtils.decrypt(one.get("contacts_mobile").toString()));
            }
            if (one.get("sn")!=null){
                iotDeviceSimDO.setDeviceSn(one.get("sn").toString());