|
@ -47,6 +47,10 @@ import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
|
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyOutpatientVO;
|
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
|
|
|
import com.yihu.jw.util.common.IdCardUtil;
|
|
|
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.wechat.dao.BasePatientWechatDao;
|
|
|
import com.yihu.jw.wechat.dao.WechatDao;
|
|
|
import com.yihu.mysql.query.BaseJpaService;
|
|
@ -121,6 +125,9 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
@Autowired
|
|
|
private BaseDoctorDao doctorDao;
|
|
|
|
|
|
@Autowired
|
|
|
private HttpClientUtil httpClientUtil;
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${demo.flag}")
|
|
@ -913,4 +920,45 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String saveVideoFile(String vip){
|
|
|
WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.findById("YXAPPKEY");
|
|
|
WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("YXAPPSECRET");
|
|
|
if (sysDictDO==null){
|
|
|
return "找不到对应的key";
|
|
|
}
|
|
|
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";
|
|
|
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");
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("vid",vip);
|
|
|
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");
|
|
|
String vedioUrl =object1.getString("origUrl");
|
|
|
String vedioName = object1.getString("videoName");
|
|
|
String filePath = "/Projects/Video/"+DateUtil.getStringDate("yyyyMMdd");
|
|
|
logger.info("filePath:"+filePath);
|
|
|
logger.info("vedioUrl"+vedioUrl);
|
|
|
FileUtil.saveUrlAs(vedioUrl,filePath,"GET",vedioName);
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|