소스 검색

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

yeshijie 8 년 전
부모
커밋
f5e568b4f9

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -755,7 +755,7 @@ public class DoctorInfoService extends BaseService {
    @Transactional
    public JSONArray findWorkingDoctorListByDept(String dept, String hospital, String level, String key, int page, int pagesize) throws Exception {
        String sql = "select * from wlyy_doctor where  status = 1 and level = 1";
        String sql = "select * from wlyy_doctor where  status = 1 ";
        List<Object> args = new ArrayList<>();
        if (!StringUtils.isEmpty(dept)) {

+ 4 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorGuidanceTempService.java

@ -92,7 +92,8 @@ public class DoctorGuidanceTempService extends BaseService {
        guidanceTemp.setModelName(modelName);
        if (imagesUrl==null) {
        if (imagesUrl==null||"".equals(imagesUrl)) {
            imagesUrl=null;
        }else {
            String[] images = imagesUrl.split(",");
            for (String image : images) {
@ -135,7 +136,8 @@ public class DoctorGuidanceTempService extends BaseService {
        guidanceTemp.setModelName(modelName);
        guidanceTemp.setContent(content);
        if (imagesUrl==null) {
        if (imagesUrl==null||"".equals(imagesUrl)) {
            imagesUrl=null;
        }else {
            String[] images = imagesUrl.split(",");
            for (String image : images) {

+ 4 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/CommonUtil.java

@ -272,10 +272,12 @@ public class CommonUtil {
        }
    }
    public static String getVideoTimeAndImg(String sourcePath,String targetPath) throws  Exception{
    public static long getVideoTimeAndImg(String sourcePath,String targetPath) throws  Exception{
        File source = new File(sourcePath);
        Encoder encoder = new Encoder();
        MultimediaInfo m = encoder.getInfo(source);
        long ms = m.getDuration();
        if(ms<1000)return ms;
        File target = new File(targetPath);//转图片
        VideoAttributes video = new VideoAttributes();
        video.setCodec("png");//转图片
@ -286,7 +288,7 @@ public class CommonUtil {
        attrs.setDuration(0.01f);//设置转码持续时间(1秒)
        attrs.setVideoAttributes(video);
        encoder.encode(source, target, attrs);
        return m.getDuration()+"";
        return m.getDuration();
    }

+ 12 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/FileUploadController.java

@ -197,7 +197,15 @@ public class FileUploadController extends BaseController {
                    String pngPath = tempPath.substring(0,tempPath.lastIndexOf("."))+".png";
                    File tempFile = new File(tempPath);
                    File pngFile = new File(pngPath);
                    String times = CommonUtil.getVideoTimeAndImg(tempPath,pngPath);
                    long times = CommonUtil.getVideoTimeAndImg(tempPath,pngPath);
                    if(times<1000){
                        JSONObject json = new JSONObject();
                        json.put("status", -1);
                        json.put("success",true);
                        json.put("msg", "视频录制时间太短!");
                        json.put("times", times);
                        return json.toString();
                    }
                    ObjectNode imgNode = fastDFSUtil.upload(new FileInputStream(pngPath),"png","");
                    String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
                    ObjectNode videoNode = fastDFSUtil.upload(new FileInputStream(tempPath),fileExt,"");
@ -205,7 +213,7 @@ public class FileUploadController extends BaseController {
                            + "/" + imgNode.get("remoteFileName").toString().replaceAll("\"",""));
                    tempPaths.add(fastUrl + videoNode.get("groupName").toString().replaceAll("\"","")
                            + "/" + videoNode.get("remoteFileName").toString().replaceAll("\"",""));
                    tempPaths.add(times);
                    tempPaths.add(times+"");
                    if(tempFile!=null){
                        tempFile.delete();
                    }
@ -325,7 +333,7 @@ public class FileUploadController extends BaseController {
            String pngPath = tempPath.substring(0,tempPath.lastIndexOf("."))+".png";
            File tempFile = new File(tempPath);
            File pngFile = new File(pngPath);
            String times = CommonUtil.getVideoTimeAndImg(tempPath,pngPath);
            long times = CommonUtil.getVideoTimeAndImg(tempPath,pngPath);
            ObjectNode imgNode = fastDFSUtil.upload(new FileInputStream(pngPath),"png","");
            String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
            ObjectNode videoNode = fastDFSUtil.upload(new FileInputStream(tempPath),fileExt,"");
@ -333,7 +341,7 @@ public class FileUploadController extends BaseController {
                    + "/" + imgNode.get("remoteFileName").toString().replaceAll("\"",""));
            tempPaths.add(fastUrl + videoNode.get("groupName").toString().replaceAll("\"","")
                    + "/" + videoNode.get("remoteFileName").toString().replaceAll("\"",""));
            tempPaths.add(times);
            tempPaths.add(times+"");
            if(tempFile!=null){
                tempFile.delete();
            }

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -321,9 +321,9 @@ public class DoctorController extends BaseController {
    @ResponseBody
    public String findWorkingDoctorByDept(@RequestParam(required = false) String dept,
                                          @RequestParam(required = false) String hospital,
                                          @RequestParam(required = false, defaultValue = "") String level,
                                          @RequestParam(required = false, defaultValue = "1") String level,
                                          @RequestParam(required = false, defaultValue = "") String key,
                                          @RequestParam(required = false, defaultValue = "-1") int page,
                                          @RequestParam(required = false, defaultValue = "1") int page,
                                          @RequestParam(required = false, defaultValue = "15") int pagesize) {
        try {
            if (page >= 1) {

+ 4 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthGuidanceController.java

@ -142,7 +142,8 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
				guidance.setPatient(patient);
//				找到当前医生
				Doctor doctor = doctorService.findDoctorByCode(getUID());
				if (images==null) {
				if (images==null||"".equals(images)) {
					images=null;
				}else {
					String[] imgs = images.split(",");
					for (String image : imgs) {
@ -186,7 +187,8 @@ public class DoctorHealthGuidanceController extends WeixinBaseController {
				guidance.setDoctor(getUID());
				guidance.setPatient(patient);
				Doctor doctor = doctorService.findDoctorByCode(getUID());
				if (images==null) {
				if (images==null||"".equals(images)) {
					images = null;
				}else {
					String[] imgs = images.split(",");
					for (String image : imgs) {