浏览代码

云信视频下载

wangjun 4 年之前
父节点
当前提交
872319e821

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

@ -10832,6 +10832,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 +10862,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());

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

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

@ -27,8 +27,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;
@ -238,7 +238,9 @@ 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);
                    }
                    //取消挂号
                } 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));
    }
}

+ 7 - 1
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 = "根据疾病名称,热门部门查询医生")
@ -1513,4 +1515,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);
    }
}