Merge branch 'jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支' into dev_gy_0920
This commit is contained in:
commit
9f4e611b0d
@ -0,0 +1,69 @@
|
||||
package com.xinelu.applet.controller.uploadfile;
|
||||
|
||||
import com.xinelu.applet.service.uploadfile.IUploadFileService;
|
||||
import com.xinelu.common.constant.Constants;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @version 1.0
|
||||
* Create by 2022/11/2 10:38
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/nurseApplet/uploadFile")
|
||||
public class UploadFileController {
|
||||
|
||||
@Resource
|
||||
private IUploadFileService uploadFileService;
|
||||
|
||||
/**
|
||||
* 会员App头像图片上传
|
||||
*
|
||||
* @param patientId 会员主键id
|
||||
* @param multipartFile 文件
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/uploadHeadPictureUrl")
|
||||
public AjaxResult uploadHeadPictureUrl(@RequestParam("file") MultipartFile multipartFile, @RequestParam(value = "patientId") Long patientId) throws Exception {
|
||||
if (Objects.isNull(patientId)) {
|
||||
return AjaxResult.error("会员头像信息不能为空!");
|
||||
}
|
||||
if (Objects.isNull(multipartFile) || StringUtils.isBlank(multipartFile.getOriginalFilename())) {
|
||||
return AjaxResult.error("当前文件视频不存在,无法上传!");
|
||||
}
|
||||
if (multipartFile.getOriginalFilename().contains(Constants.EMPTY)) {
|
||||
return AjaxResult.error("当前视频文件名含有空格,请先去除空格在上传!");
|
||||
}
|
||||
return uploadFileService.uploadHeadPictureUrl(multipartFile, patientId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 护理员App确认任务完成图片上传
|
||||
*
|
||||
* @param orderNo 编号
|
||||
* @param multipartFile 文件
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/uploadPictureUrl")
|
||||
public AjaxResult uploadPictureUrl(@RequestParam("file") MultipartFile multipartFile, @RequestParam(value = "orderNo") String orderNo) throws Exception {
|
||||
if (StringUtils.isBlank(orderNo)) {
|
||||
return AjaxResult.error("订单信息不能为空!");
|
||||
}
|
||||
if (Objects.isNull(multipartFile) || StringUtils.isBlank(multipartFile.getOriginalFilename())) {
|
||||
return AjaxResult.error("当前文件不存在,无法上传!");
|
||||
}
|
||||
if (multipartFile.getOriginalFilename().contains(Constants.EMPTY)) {
|
||||
return AjaxResult.error("当前文件名含有空格,请先去除空格在上传!");
|
||||
}
|
||||
return uploadFileService.uploadPictureUrl(multipartFile, orderNo);
|
||||
}
|
||||
}
|
||||
@ -176,6 +176,9 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
|
||||
if (Objects.nonNull(patientDisease) && Objects.nonNull(patientDisease.getBirthDate())) {
|
||||
patientDisease.setAge(AgeUtil.getAgeMonth(String.valueOf(patientDisease.getBirthDate())));
|
||||
}
|
||||
if (Objects.nonNull(patientDisease) && StringUtils.isNotBlank(patientDisease.getDisease())) {
|
||||
patientDisease.setDiseaseList(patientDisease.getDisease().split(""));
|
||||
}
|
||||
if (Objects.nonNull(patientDisease) && StringUtils.isNotBlank(patientDisease.getAreaCode())) {
|
||||
SysAreaVO codeName = sysAreaMapper.getSubordinateRegionsFindSuperiorRegions(patientDisease.getAreaCode());
|
||||
String provinceName = StringUtils.isBlank(codeName.getProvinceName()) ? "" : codeName.getProvinceName();
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package com.xinelu.applet.service.uploadfile;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* @Description APP和小程序头像图片上传方法
|
||||
* @Author zh
|
||||
* @Date 2022-11-2
|
||||
*/
|
||||
public interface IUploadFileService {
|
||||
|
||||
/**
|
||||
* 会员App头像图片上传
|
||||
*
|
||||
* @param patientId 会员主键id
|
||||
* @param multipartFile 文件
|
||||
* @return 结果
|
||||
* @throws Exception 异常信息
|
||||
*/
|
||||
AjaxResult uploadHeadPictureUrl(MultipartFile multipartFile, Long patientId) throws Exception;
|
||||
|
||||
/**
|
||||
* 护理员App确认任务完成图片上传
|
||||
*
|
||||
* @param orderNo 订单编号
|
||||
* @param multipartFile 文件
|
||||
* @return 结果
|
||||
* @throws Exception 异常信息
|
||||
**/
|
||||
AjaxResult uploadPictureUrl(MultipartFile multipartFile, String orderNo) throws Exception;
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.xinelu.applet.service.uploadfile.Impl;
|
||||
|
||||
import com.xinelu.applet.service.uploadfile.IUploadFileService;
|
||||
import com.xinelu.common.config.XinELuConfig;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.file.FileUploadUtils;
|
||||
import com.xinelu.common.utils.file.MimeTypeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description 头像上传
|
||||
* @Author ZH
|
||||
* @Date 2022-10-28
|
||||
*/
|
||||
@Service
|
||||
public class UploadFileServiceImpl implements IUploadFileService {
|
||||
|
||||
@Resource
|
||||
private XinELuConfig xinELuConfig;
|
||||
|
||||
/**
|
||||
* 会员App头像图片上传
|
||||
*
|
||||
* @param patientId 会员主键id
|
||||
* @param multipartFile 文件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult uploadHeadPictureUrl(MultipartFile multipartFile, Long patientId) throws Exception {
|
||||
//获取路径名称
|
||||
String uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getHeadPictureUrl() + "/" + patientId;
|
||||
//上传图片
|
||||
String pictureName = FileUploadUtils.uploadPictureUrlPath(uploadPathUrl, multipartFile, MimeTypeUtils.IMAGE_EXTENSION);
|
||||
if (StringUtils.isBlank(pictureName)) {
|
||||
throw new ServiceException("头像上传失败,请联系管理员!");
|
||||
}
|
||||
//获取返回值
|
||||
AjaxResult ajax = AjaxResult.success("上传成功!");
|
||||
ajax.put("imgUrl", pictureName);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
/**
|
||||
* 护理员App确认任务完成图片上传
|
||||
*
|
||||
* @param orderNo 订单编号
|
||||
* @param multipartFile 文件
|
||||
* @return 结果
|
||||
* @throws Exception 异常信息
|
||||
**/
|
||||
@Override
|
||||
public AjaxResult uploadPictureUrl(MultipartFile multipartFile, String orderNo) throws Exception {
|
||||
//获取路径名称
|
||||
String uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getAppointmentOrderDetailsUrl() + "/" + orderNo;
|
||||
//上传图片
|
||||
String pictureName = FileUploadUtils.uploadPictureUrlPath(uploadPathUrl, multipartFile, MimeTypeUtils.IMAGE_EXTENSION);
|
||||
if (StringUtils.isBlank(pictureName)) {
|
||||
throw new ServiceException("图片上传失败,请联系管理员!");
|
||||
}
|
||||
//获取返回值
|
||||
AjaxResult ajax = AjaxResult.success("上传成功!");
|
||||
ajax.put("imgUrl", pictureName);
|
||||
return ajax;
|
||||
}
|
||||
}
|
||||
@ -158,4 +158,10 @@ public class PatientAndDiseaseVO implements Serializable {
|
||||
*/
|
||||
private String patientCode;
|
||||
|
||||
|
||||
private String disease;
|
||||
/**
|
||||
* 基础疾病信息
|
||||
*/
|
||||
private String[] diseaseList;
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
<result property="disablingCondition" column="disabling_condition"/>
|
||||
<result property="disablingReason" column="disabling_reason"/>
|
||||
<result property="patientCode" column="patient_code"/>
|
||||
<result property="disease" column="disease"/>
|
||||
<collection property="patientDiseaseInfoList" javaType="java.util.List" resultMap="PatientDiseaseInfoResult"/>
|
||||
</resultMap>
|
||||
|
||||
@ -81,6 +82,7 @@
|
||||
pi.disabling_condition,
|
||||
pi.disabling_reason,
|
||||
pi.patient_code,
|
||||
pi.disease,
|
||||
pdi.id patientDiseaseId,
|
||||
pdi.disease_id,
|
||||
pdi.disease_name,
|
||||
|
||||
@ -242,6 +242,11 @@ public class PatientInfo extends BaseDomain implements Serializable {
|
||||
*/
|
||||
private String disablingReason;
|
||||
|
||||
/**
|
||||
* 基础疾病
|
||||
*/
|
||||
private String disease;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user