Kaynağa Gözat

代码修改

LAPTOP-KB9HII50\70708 3 yıl önce
ebeveyn
işleme
dc6372e3e5

+ 0 - 8
svr/svr-wlyy-health-bank/pom.xml

@ -45,14 +45,6 @@
            <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <!-- redis start  -->
        <dependency>
            <groupId>org.springframework.boot</groupId>

+ 2 - 2
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/config/jpa/WlyyHealthBankJpa.java

@ -27,7 +27,7 @@ import java.util.Properties;
@EnableJpaRepositories(
        entityManagerFactoryRef = "wlyyHealthBankEntityManagerFactory",
        transactionManagerRef = "wlyyHealthBankTransactionManager",
        basePackages = {"com.yihu.jw.dao"})   //设置Repository所在位置
        basePackages = {"com.yihu.jw.dao","com.yihu.jw.restmodel.exception.dao","com.yihu.jw.util.dao"})   //设置Repository所在位置
public class WlyyHealthBankJpa {
    @Autowired
@ -39,7 +39,7 @@ public class WlyyHealthBankJpa {
        LocalContainerEntityManagerFactoryBean emfb = new LocalContainerEntityManagerFactoryBean();
        emfb.setDataSource(dataSource);
        emfb.setPackagesToScan("com.yihu.jw.entity.health");
        emfb.setPackagesToScan("com.yihu.jw.entity");
        emfb.setPersistenceUnitName("bank");
        JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
        emfb.setJpaVendorAdapter(vendorAdapter);

+ 0 - 1
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ExchangeGoodsService.java

@ -2,7 +2,6 @@ package com.yihu.jw.service;/**
 * Created by nature of king on 2018/5/3.
 */
import com.netflix.discovery.converters.jackson.EurekaXmlJacksonCodec;
import com.yihu.jw.dao.*;
import com.yihu.jw.entity.health.bank.*;
import com.yihu.jw.restmodel.web.MixEnvelop;

+ 0 - 13
svr/svr-wlyy-specialist/pom.xml

@ -41,23 +41,10 @@
            <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>
        <!-- 支持Tomcat启动 -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-sleuth</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-sleuth-zipkin</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>

+ 1 - 170
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/common/FileUploadController.java

@ -10,7 +10,7 @@ import com.yihu.jw.service.FileUploadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
@ -42,175 +42,6 @@ public class FileUploadController {
    @Autowired
    protected HttpServletRequest request;
    /*@PostMapping(value = IotRequestMapping.FileUpload.api_upload_stream_img)
    @ApiOperation(value = "文件流上传图片", notes = "文件流上传图片")
    public MixEnvelop<UploadVO, UploadVO> uploadImg(@ApiParam(value = "文件", required = true)
                                       @RequestParam(value = "file", required = true) MultipartFile file){
        try {
            // 得到文件的完整名称  xxx.txt
            String fullName = file.getOriginalFilename();
            if(StringUtils.isBlank(fullName)){
                return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
            }
            //得到文件类型
            String fileType = fullName.substring(fullName.lastIndexOf(".") + 1).toLowerCase();
            if(StringUtils.isBlank(fileType)||!"jpg,jpeg,png".contains(fileType)){
                return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
            }
            long size = file.getSize();
            long max = 5*1024*1024;
            if(size>max){
                return MixEnvelop.getError("文件大小不超过5M",IotRequestMapping.api_iot_fail);
            }
            String fileName = fullName.substring(0, fullName.lastIndexOf("."));
            //上传到fastdfs
            ObjectNode objectNode = null;
            //解析返回的objectNode
            UploadVO uploadVO = null;
            if(isneiwang){
                objectNode = fastDFSHelper.upload(file.getInputStream(), fileType, "");
                uploadVO = new UploadVO();
                uploadVO.setFileName(fileName);
                uploadVO.setFileType(fileType);
                uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
            }else {
                uploadVO = fileUploadService.request(request,file.getInputStream(),fullName);
                if(uploadVO==null){
                    return MixEnvelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                }
            }
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create, uploadVO);
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }
    }
    @PostMapping(value = IotRequestMapping.FileUpload.api_upload_stream_attachment)
    @ApiOperation(value = "文件流上传附件", notes = "文件流上传附件")
    public MixEnvelop<UploadVO, UploadVO> uploadAttachment(@ApiParam(value = "文件", required = true)
                                              @RequestParam(value = "file", required = true) MultipartFile file){
        try {
            // 得到文件的完整名称  xxx.txt
            String fullName = file.getOriginalFilename();
            if(StringUtils.isBlank(fullName)){
                return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
            }
            //得到文件类型
            String fileType = fullName.substring(fullName.lastIndexOf(".") + 1).toLowerCase();
            if(StringUtils.isBlank(fileType)||!"doc、docx、pdf、xls、xlsx、jpg、jpeg、png".contains(fileType)){
                return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload_format,IotRequestMapping.api_iot_fail);
            }
            long size = file.getSize();
            long max = 5*1024*1024;
            if(size>max){
                return MixEnvelop.getError("文件大小不超过5M",IotRequestMapping.api_iot_fail);
            }
            String fileName = fullName.substring(0, fullName.lastIndexOf("."));
            //上传到fastdfs
            ObjectNode objectNode = null;
            //解析返回的objectNode
            UploadVO uploadVO = null;
            if(isneiwang){
                objectNode = fastDFSHelper.upload(file.getInputStream(), fileType, "");
                uploadVO = new UploadVO();
                uploadVO.setFileName(fileName);
                uploadVO.setFileType(fileType);
                uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
            }else {
                uploadVO = fileUploadService.request(request,file.getInputStream(),fullName);
                if(uploadVO==null){
                    return MixEnvelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                }
            }
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create, uploadVO);
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }
    }
    @PostMapping(value = IotRequestMapping.FileUpload.api_upload_stream)
    @ApiOperation(value = "文件流上传文件", notes = "文件流上传文件")
    public MixEnvelop<UploadVO, UploadVO> uploadStream(@ApiParam(value = "文件", required = true) @RequestParam(value = "file", required = true) MultipartFile file) {
        try {
            // 得到文件的完整名称  xxx.txt
            String fullName = file.getOriginalFilename();
            //得到文件类型
            String fileType = fullName.substring(fullName.lastIndexOf(".") + 1).toLowerCase();
            String fileName = fullName.substring(0, fullName.lastIndexOf("."));
            //上传到fastdfs
            ObjectNode objectNode = null;
            //解析返回的objectNode
            UploadVO uploadVO = null;
            if(isneiwang){
                objectNode = fastDFSHelper.upload(file.getInputStream(), fileType, "");
                uploadVO = new UploadVO();
                uploadVO.setFileName(fileName);
                uploadVO.setFileType(fileType);
                uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
            }else {
                uploadVO = fileUploadService.request(request,file.getInputStream(),fullName);
                if(uploadVO==null){
                    return MixEnvelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                }
            }
            return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_create, uploadVO);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }
    }
    @PostMapping(value = IotRequestMapping.FileUpload.api_upload_string)
    @ApiOperation(value = "base64上传图片",notes = "base64上传图片")
    public MixEnvelop<UploadVO, UploadVO> uploadImages(@ApiParam(name = "jsonData", value = "头像转化后的输入流") @RequestBody String jsonData) throws Exception {
        try {
            String date = URLDecoder.decode(jsonData,"UTF-8");
            String[] fileStreams = date.split(",");
            String is = URLDecoder.decode(fileStreams[1],"UTF-8").replace(" ","+");
            byte[] in = Base64.getDecoder().decode(is);
            InputStream inputStream = new ByteArrayInputStream(in);
            ObjectNode objectNode = null;
            //上传到fastdfs
            String fileType = "png";
            //解析返回的objectNode
            UploadVO uploadVO = null;
            if(isneiwang){
                objectNode = fastDFSHelper.upload(inputStream, fileType, "");
                String groupName = objectNode.get("groupName").toString();
                String remoteFileName = objectNode.get("remoteFileName").toString();
                uploadVO = new UploadVO();
                uploadVO.setFileName(remoteFileName);
                uploadVO.setFileType(groupName);
                uploadVO.setFullUri(objectNode.get("fileId").toString().replaceAll("\"", ""));
                uploadVO.setFullUrl(fastdfs_file_url + objectNode.get("fileId").toString().replaceAll("\"", ""));
            }else {
                uploadVO = fileUploadService.request(request,inputStream,"");
                if(uploadVO ==null){
                    return MixEnvelop.getError("文件上传失败",IotRequestMapping.api_iot_fail);
                }
            }
            //返回文件路径
            return MixEnvelop.getSuccess(IotRequestMapping.FileUpload.message_success_upload, uploadVO);
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError(IotRequestMapping.FileUpload.message_fail_upload, IotRequestMapping.api_iot_fail);
        }
    }*/
    @RequestMapping(value = "commonUpload", method = RequestMethod.POST)
    @ResponseBody

+ 0 - 12
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/PatientLabelDao.java

@ -1,12 +0,0 @@
//package com.yihu.jw.dict;
//
//import com.yihu.jw.entity.specialist.PatientLabelDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
///**
// * Created by Trick on 2018/5/29.
// */
//public interface PatientLabelDao extends PagingAndSortingRepository<PatientLabelDO, String>,
//        JpaSpecificationExecutor<PatientLabelDO> {
//}

+ 0 - 12
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/PatientLabelInfoDao.java

@ -1,12 +0,0 @@
//package com.yihu.jw.dict;
//
//import com.yihu.jw.entity.specialist.PatientLabelDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
///**
// * Created by Trick on 2018/5/29.
// */
//public interface PatientLabelInfoDao extends PagingAndSortingRepository<PatientLabelDO, String>,
//        JpaSpecificationExecutor<PatientLabelDO> {
//}

+ 0 - 12
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistArticleDao.java

@ -1,12 +0,0 @@
//package com.yihu.jw.dict;
//
//import com.yihu.jw.entity.specialist.SpecialistArticleDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
///**
// * Created by Trick on 2018/4/25.
// */
//public interface SpecialistArticleDao extends PagingAndSortingRepository<SpecialistArticleDO, String>,
//        JpaSpecificationExecutor<SpecialistArticleDO> {
//}

+ 0 - 12
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistConsultDao.java

@ -1,12 +0,0 @@
//package com.yihu.jw.dict;
//
//import com.yihu.jw.entity.specialist.SpecialistConsultDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
///**
// * Created by Trick on 2018/4/25.
// */
//public interface SpecialistConsultDao extends PagingAndSortingRepository<SpecialistConsultDO, String>,
//        JpaSpecificationExecutor<SpecialistConsultDO> {
//}

+ 0 - 12
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/SpecialistDao.java

@ -1,12 +0,0 @@
//package com.yihu.jw.dict;
//
//import com.yihu.jw.entity.specialist.SpecialistDO;
//import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
//import org.springframework.data.repository.PagingAndSortingRepository;
//
///**
// * Created by Trick on 2018/4/25.
// */
//public interface SpecialistDao extends PagingAndSortingRepository<SpecialistDO, String>,
//        JpaSpecificationExecutor<SpecialistDO> {
//}

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistScreenResultService.java

@ -5,7 +5,7 @@ import com.yihu.jw.restmodel.specialist.SurveyTemplateQuestionsVo;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.util.common.IdCardUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;

+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -18,7 +18,7 @@ import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.rm.specialist.SpecialistMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;

+ 2 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/util/AddressUtils.java

@ -1,6 +1,7 @@
package com.yihu.jw.util;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import java.io.*;
import java.net.HttpURLConnection;