Browse Source

账号申诉,意见反馈bug修改

LiTaohong 6 years ago
parent
commit
c03d2631c5

+ 0 - 13
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/FeedbackDO.java

@ -50,11 +50,6 @@ public class FeedbackDO extends IntegerIdentityEntity {
	 */
	private String feedbackContent;
    /**
	 * 问题回答
	 */
	private String answer;
    /**
	 * 图片,存图片地址,逗号分割
	 */
@ -81,14 +76,6 @@ public class FeedbackDO extends IntegerIdentityEntity {
        this.feedbackContent = feedbackContent;
    }
	@Column(name = "answer")
    public String getAnswer() {
        return answer;
    }
    public void setAnswer(String answer) {
        this.answer = answer;
    }
	@Column(name = "img")
    public String getImg() {
        return img;

+ 0 - 13
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/FeedbackVO.java

@ -33,12 +33,6 @@ public class FeedbackVO extends IntegerIdentityVO{
	@ApiModelProperty(value = "反馈内容,问题和建议", example = "模块1")
    private String feedbackContent;
    /**
	 * 问题回答
	 */
	@ApiModelProperty(value = "问题回答", example = "模块1")
    private String answer;
    /**
	 * 图片,存图片地址,逗号分割
	 */
@ -65,13 +59,6 @@ public class FeedbackVO extends IntegerIdentityVO{
        this.feedbackContent = feedbackContent;
    }
    public String getAnswer() {
        return answer;
    }
    public void setAnswer(String answer) {
        this.answer = answer;
    }
    public String getImg() {
        return img;
    }

+ 2 - 2
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/AccountAppealEndpoint.java

@ -42,8 +42,8 @@ public class AccountAppealEndpoint extends EnvelopRestEndpoint {
    public ObjEnvelop<AccountAppealVO> create(
            @ApiParam(name = "type", value = "申诉类型", required = true)
            @RequestParam AccountAppealDO.Type type,
            @ApiParam(name = "images", value = "申诉证件照", required = true)
            @RequestParam List<MultipartFile> images,
            @ApiParam(name = "images", value = "申诉证件照", required = false)
            @RequestParam(required = false) List<MultipartFile> images,
            @ApiParam(name = "mobile", value = "申诉手机号", required = true)
            @RequestParam String mobile,
            @ApiParam(name = "name", value = "申诉人姓名", required = true)

+ 2 - 2
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/FeedbackEndpoint.java

@ -44,8 +44,8 @@ public class FeedbackEndpoint extends EnvelopRestEndpoint {
    public ObjEnvelop<FeedbackVO> create(
            @ApiParam(name = "type", value = "反馈类型", required = true)
            @RequestParam FeedbackDO.Type type,
            @ApiParam(name = "images", value = "反馈图片", required = true)
            @RequestParam List<MultipartFile> images,
            @ApiParam(name = "images", value = "反馈图片", required = false)
            @RequestParam(required = false) List<MultipartFile> images,
            @ApiParam(name = "mobile", value = "反馈手机号", required = true)
            @RequestParam String mobile,
            @ApiParam(name = "content", value = "反馈内容", required = true)

+ 8 - 3
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/settings/AccountAppealService.java

@ -6,6 +6,7 @@ import com.yihu.jw.exception.business.file_upload.FailedUploadFileException;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.patient.dao.settings.AccountAppealDao;
import com.yihu.jw.restmodel.base.patient.AccountAppealVO;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -35,7 +36,7 @@ public class AccountAppealService extends BaseJpaService<AccountAppealDO, Accoun
    @Autowired
    private FileUploadService fileUploadService;
    @Value("fastDFS.fastdfs_file_url")
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfsUrl;
    @Transactional(rollbackFor = Exception.class)
@ -44,7 +45,9 @@ public class AccountAppealService extends BaseJpaService<AccountAppealDO, Accoun
        Assert.notNull(mobile, "申诉手机号不可为空");
        Assert.notNull(name, "申诉姓名不可为空");
        Assert.notNull(idcard, "申诉证件号不可为空");
        AccountAppealDO accoutAppeal = new AccountAppealDO();
        if (!CollectionUtils.isEmpty(images)) {
            StringBuilder img = new StringBuilder();
            images.forEach(one -> {
                InputStream inputStream = null;
                try {
@ -54,18 +57,20 @@ public class AccountAppealService extends BaseJpaService<AccountAppealDO, Accoun
                }
                String fileName = one.getOriginalFilename();
                try {
                    fileUploadService.uploadStream(inputStream, fileName, fastdfsUrl);
                  UploadVO uploadVO = fileUploadService.uploadStream(inputStream, fileName, fastdfsUrl);
                    img.append(uploadVO.getFullUrl()).append(",");
                } catch (Exception e) {
                    throw new FailedUploadFileException("账号申诉证件图片上传失败");
                }
            });
            accoutAppeal.setImg(img.toString());
        }
        AccountAppealDO accoutAppeal = new AccountAppealDO();
        accoutAppeal.setType(type.getValue());
        accoutAppeal.setName(name);
        accoutAppeal.setIdcard(idcard);
        accoutAppeal.setContent(content);
        accoutAppeal.setMobile(mobile);
        this.save(accoutAppeal);
        return accoutAppeal;
    }
}

+ 8 - 3
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/settings/FeedbackService.java

@ -5,6 +5,7 @@ import com.yihu.jw.entity.base.patient.FeedbackDO;
import com.yihu.jw.exception.business.file_upload.FailedUploadFileException;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.patient.dao.settings.FeedbackDao;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -36,7 +37,7 @@ public class FeedbackService extends BaseJpaService<FeedbackDO, FeedbackDao> {
    @Autowired
    private FileUploadService fileUploadService;
    @Value("fastDFS.fastdfs_file_url")
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfsUrl;
    /**
@ -51,7 +52,9 @@ public class FeedbackService extends BaseJpaService<FeedbackDO, FeedbackDao> {
        Assert.notNull(type,"反馈类型不可为空");
        Assert.notNull(feedbackContent,"反馈类型不可为空");
        Assert.notNull(mobile,"手机号不可为空");
        FeedbackDO feedback = new FeedbackDO();
        if(!CollectionUtils.isEmpty(images)){
            StringBuilder img = new StringBuilder();
            images.forEach( one -> {
                InputStream inputStream = null;
                try {
@ -61,16 +64,18 @@ public class FeedbackService extends BaseJpaService<FeedbackDO, FeedbackDao> {
                }
                String fileName = one.getOriginalFilename();
                try {
                    fileUploadService.uploadStream(inputStream,fileName,fastdfsUrl);
                    UploadVO uploadVO = fileUploadService.uploadStream(inputStream, fileName, fastdfsUrl);
                    img.append(uploadVO.getFullUrl()).append(",");
                } catch (Exception e) {
                    throw new FailedUploadFileException("上传反馈图片失败");
                }
            });
            feedback.setImg(img.toString());
        }
        FeedbackDO feedback = new FeedbackDO();
        feedback.setType(type.getValue());
        feedback.setFeedbackContent(feedbackContent);
        feedback.setMobile(mobile);
        this.save(feedback);
        return feedback;
    }
}

+ 1 - 1
svr/svr-patient/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-patient
    name: svr-patient-lith
  cloud:
    config:
      failFast: true