From 31f7740e7cdf90279774af2b6f0baaadda06a703 Mon Sep 17 00:00:00 2001 From: mengkuiliang <1464081137@qq.com> Date: Wed, 11 Oct 2023 14:29:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=B0=83=E8=AF=95=E8=BF=87?= =?UTF-8?q?=E7=A8=8B=E4=B8=AD=E5=87=BA=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applet/ResidentPatientInfoController.java | 42 ++++--- .../ResidentServiceApplyController.java | 6 +- .../applet/ResidentSignApplyController.java | 39 +++++++ .../controller/applet/SignInfoController.java | 17 ++- .../src/main/resources/application.yml | 6 +- .../xinelu/common/config/XinELuConfig.java | 13 +++ .../xinelu/common/enums/RegionKeyType.java | 3 +- .../common/utils/spring/SpringUtils.java | 1 + .../applet/pojo/vo/PerformancePackageVo.java | 104 ++++++++++++++++++ .../service/IResidentPatientInfoService.java | 9 ++ .../IResidentServiceAppletService.java | 2 +- .../impl/ResidentPatientInfoServiceImpl.java | 16 +++ .../impl/ResidentServiceApplyServiceImpl.java | 6 +- 13 files changed, 235 insertions(+), 29 deletions(-) create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/PerformancePackageVo.java diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentPatientInfoController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentPatientInfoController.java index 652d66b..2ad4e55 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentPatientInfoController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentPatientInfoController.java @@ -127,6 +127,12 @@ public class ResidentPatientInfoController extends BaseController { return R.ok(residentPatientInfoService.getCurrentResident(openid, cityCode)); } + @ApiOperation("是否已注册") + @GetMapping(value = "/isRegistered/{code}") + public R isRegistered(@PathVariable("code") String code) { + return R.ok(residentPatientInfoService.isRegistered(code)); + } + /** * @Author mengkuiliang * @Description 居民头像上传 @@ -134,22 +140,22 @@ public class ResidentPatientInfoController extends BaseController { * @Param * @return **/ - @ApiOperation("居民头像上传") - @PostMapping(value = "/headPictureUpload") - public AjaxResult headPictureUpload(MultipartFile file) throws Exception { - if (StringUtils.isBlank(file.getOriginalFilename())) { - return AjaxResult.error("请选择所要上传的头像!"); - } - //获取路径名称 - String uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getHeadPictureUrl(); - //上传图片 - String pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, file, MimeTypeUtils.IMAGE_EXTENSION); - if (StringUtils.isBlank(pictureName)) { - throw new ServiceException(pictureName + "居民头像上传失败!"); - } - //获取返回值 - AjaxResult ajax = AjaxResult.success("上传成功!"); - ajax.put("imgUrl", pictureName); - return ajax; - } +// @ApiOperation("居民头像上传") +// @PostMapping(value = "/headPictureUpload") +// public AjaxResult headPictureUpload(MultipartFile file) throws Exception { +// if (StringUtils.isBlank(file.getOriginalFilename())) { +// return AjaxResult.error("请选择所要上传的头像!"); +// } +// //获取路径名称 +// String uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getHeadPictureUrl(); +// //上传图片 +// String pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, file, MimeTypeUtils.IMAGE_EXTENSION); +// if (StringUtils.isBlank(pictureName)) { +// throw new ServiceException(pictureName + "居民头像上传失败!"); +// } +// //获取返回值 +// AjaxResult ajax = AjaxResult.success("上传成功!"); +// ajax.put("imgUrl", pictureName); +// return ajax; +// } } diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentServiceApplyController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentServiceApplyController.java index 1ddc1d5..6f086d8 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentServiceApplyController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentServiceApplyController.java @@ -69,9 +69,9 @@ public class ResidentServiceApplyController extends BaseController { return R.ok(residentServiceAppletService.detail(bookingNo)); } - @ApiOperation(value = "获取服务预约列表", notes = "获取家医个性服务包和筛查项目") + @ApiOperation(value = "获取服务预约项目列表", notes = "获取家医个性服务包和筛查项目") @GetMapping("/getForm/{identity}") - public R> getForm(@PathVariable String identity, @RequestHeader("region") String region) { - return R.ok(residentServiceAppletService.getForm(identity, region)); + public R> getForm(@PathVariable String identity, String projectName, @RequestHeader("region") String region) { + return R.ok(residentServiceAppletService.getForm(identity, projectName,region)); } } diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentSignApplyController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentSignApplyController.java index 2954542..283fd6d 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentSignApplyController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/ResidentSignApplyController.java @@ -1,9 +1,14 @@ package com.xinelu.web.controller.applet; +import com.xinelu.common.config.XinELuConfig; import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.R; import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.exception.ServiceException; +import com.xinelu.common.utils.file.FileUploadUtils; +import com.xinelu.common.utils.file.FileUtils; +import com.xinelu.common.utils.file.MimeTypeUtils; import com.xinelu.familydoctor.applet.pojo.body.ResidentSignApplyBody; import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery; import com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo; @@ -12,6 +17,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.util.List; @@ -30,6 +36,8 @@ public class ResidentSignApplyController extends BaseController { @Resource private IResidentSignAppletService residentSignAppletService; + @Resource + private XinELuConfig xinELuConfig; @ApiOperation("提交签约申请") @PostMapping("/save") @@ -80,4 +88,35 @@ public class ResidentSignApplyController extends BaseController { } } + + @ApiOperation("居民签字上传") + @PostMapping(value = "/residentSignatureUpload") + public AjaxResult headPictureUpload(MultipartFile file) throws Exception { + if (StringUtils.isBlank(file.getOriginalFilename())) { + return AjaxResult.error("请选择所要上传的居民签字!"); + } + //获取路径名称 + String uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getResidentSignatureUrl(); + //上传图片 + String pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, file, MimeTypeUtils.IMAGE_EXTENSION); + if (StringUtils.isBlank(pictureName)) { + throw new ServiceException(pictureName + "居民头像上传失败!"); + } + //获取返回值 + AjaxResult ajax = AjaxResult.success("上传成功!"); + ajax.put("imgUrl", pictureName); + return ajax; + } + + @ApiOperation("获取居民签字(base64)") + @GetMapping( "/getResidentSignature/") + public AjaxResult getResidentSignature(String imgUrl) throws Exception { + //获取路径名称 + String pathUrl = XinELuConfig.getProfile() + imgUrl; + String base64 = FileUtils.PicToBase64(pathUrl); + AjaxResult ajax = AjaxResult.success("解析成功!"); + ajax.put("imgUrl", base64); + return ajax; + } + } diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/SignInfoController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/SignInfoController.java index 0494d33..eb44401 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/SignInfoController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/SignInfoController.java @@ -114,7 +114,7 @@ public class SignInfoController extends BaseController { return R.ok(JSONArray.parseArray(result.getJSONArray("data").toJSONString()).toJavaList(NearOrgVo.class)); } - @ApiOperation(value = "获取区划列表", notes = "山东省: 371400000000 德州市: 371400000000 东营市:370500000000") + @ApiOperation(value = "获取区划列表", notes = "山东省: 370000000000 德州市: 371400000000 东营市:370500000000") @GetMapping("/area/list/{pid}") public R> getPhArea(@PathVariable Long pid, @RequestHeader("region") String region) { String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/area/ph/list/" + pid, null, String.class); @@ -214,4 +214,19 @@ public class SignInfoController extends BaseController { } return R.ok(JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), ProtocolContentVo.class)); } + + @ApiOperation(value = "获取居民履约情况") + @GetMapping("/getPerformance/{identity}") + public R> getPerformance(@PathVariable String identity, @RequestHeader("region") String region) { + String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/performance/getPerPackage/" + identity + "/0", null, String.class); + JSONObject jsonObject = JSONObject.parseObject(result); + if ("0".equals(jsonObject.get("code"))) { + return R.fail(jsonObject.get("msg").toString()); + } + if (!jsonObject.containsKey("data") || jsonObject.get("data") == null) { + return R.ok(); + } + return R.ok(JSONArray.parseArray(jsonObject.getJSONArray("data").toJSONString()).toJavaList(PerformancePackageVo.class)); + } + } diff --git a/xinelu-admin/src/main/resources/application.yml b/xinelu-admin/src/main/resources/application.yml index b226acc..6617333 100644 --- a/xinelu-admin/src/main/resources/application.yml +++ b/xinelu-admin/src/main/resources/application.yml @@ -82,6 +82,8 @@ xinelu: left-eye-piture-url: /leftEyePitureUrl #眼底病变筛查右眼图片地址 right-eye-piture-url: /rightEyePitureUrl + #居民签约申请签字图片地址 + resident-signature-url: /residentSignatureUrl # 开发环境配置 server: @@ -247,8 +249,8 @@ xss: fd: dy: http://192.168.124.6:8001/fd/mp dz: http://192.168.124.6:8001/fd/mp - # 签约附近的机构多少公里内 - distance: 100.00 + # 签约附近的机构多少公里内 <=0时不限制 + distance: 0 # 腾讯云音视频 trtc: diff --git a/xinelu-common/src/main/java/com/xinelu/common/config/XinELuConfig.java b/xinelu-common/src/main/java/com/xinelu/common/config/XinELuConfig.java index 3c14cfa..84f5a8f 100644 --- a/xinelu-common/src/main/java/com/xinelu/common/config/XinELuConfig.java +++ b/xinelu-common/src/main/java/com/xinelu/common/config/XinELuConfig.java @@ -241,6 +241,11 @@ public class XinELuConfig { */ private String chatRecordFileUrl; + /** + * 居民签约申请签字图片地址 + */ + private String residentSignatureUrl; + public String getConsultationFileUrl() { return consultationFileUrl; } @@ -257,6 +262,14 @@ public class XinELuConfig { this.chatRecordFileUrl = chatRecordFileUrl; } + public String getResidentSignatureUrl() { + return residentSignatureUrl; + } + + public void setResidentSignatureUrl(String residentSignatureUrl) { + this.residentSignatureUrl = residentSignatureUrl; + } + public String getStationWechatCodeUrl() { return stationWechatCodeUrl; } diff --git a/xinelu-common/src/main/java/com/xinelu/common/enums/RegionKeyType.java b/xinelu-common/src/main/java/com/xinelu/common/enums/RegionKeyType.java index bae845e..3aecc6a 100644 --- a/xinelu-common/src/main/java/com/xinelu/common/enums/RegionKeyType.java +++ b/xinelu-common/src/main/java/com/xinelu/common/enums/RegionKeyType.java @@ -1,5 +1,6 @@ package com.xinelu.common.enums; +import com.xinelu.common.exception.ServiceException; import lombok.Getter; /** @@ -34,6 +35,6 @@ public enum RegionKeyType { return uploadType; } } - return null; + throw new ServiceException("获取区域配置出错"); } } diff --git a/xinelu-common/src/main/java/com/xinelu/common/utils/spring/SpringUtils.java b/xinelu-common/src/main/java/com/xinelu/common/utils/spring/SpringUtils.java index 1840b51..59792bc 100644 --- a/xinelu-common/src/main/java/com/xinelu/common/utils/spring/SpringUtils.java +++ b/xinelu-common/src/main/java/com/xinelu/common/utils/spring/SpringUtils.java @@ -1,6 +1,7 @@ package com.xinelu.common.utils.spring; import com.xinelu.common.enums.RegionKeyType; +import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.StringUtils; import org.springframework.aop.framework.AopContext; import org.springframework.beans.BeansException; diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/PerformancePackageVo.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/PerformancePackageVo.java new file mode 100644 index 0000000..43b3b61 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/PerformancePackageVo.java @@ -0,0 +1,104 @@ +package com.xinelu.familydoctor.applet.pojo.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @Author mengkuiliang + * @Description 履约明细服务包集合展示类 + * @Date 2023-10-11 011 9:19 + * @Param + * @return + **/ +@ApiModel("履约明细服务包集合展示类") +@Data +public class PerformancePackageVo { + + /** + * 履约明细业务主键 + */ + @ApiModelProperty(value = "履约明细业务主键") + private String performanceDetailNo; + + /** + * 服务包明细编号 + */ + @ApiModelProperty("服务包明细编号") + private String packageDetailNo; + /** + * 服务包编号 + */ + @ApiModelProperty("服务包编号") + private String packageNo; + + /** + * 服务包名称 + */ + @ApiModelProperty("服务包名称") + private String packageName; + + /** + * 价格(单位:元,#0.00) + */ + @ApiModelProperty(value = "价格(单位:元,#0.00)") + private BigDecimal packCost; + + /** + * 优惠价格(单位:元,#0.00) + */ + @ApiModelProperty(value = "优惠价格(单位:元,#0.00)") + private BigDecimal packCostCheap; + + /** + * 签约价格(单位:元,#0.00) + */ + @ApiModelProperty(value = "签约价格(单位:元,#0.00)") + private BigDecimal packSignCost; + + /** + * 服务周期 + */ + @ApiModelProperty(value = "服务周期") + private Integer servicePeriod; + + /** + * 单位(D:天,W:周,M:月,Y:年) + */ + @ApiModelProperty(value = "单位(D:天,W:周,M:月,Y:年)") + private String unit; + + /** + * 是否公共(市级机构才可创建) + * */ + @ApiModelProperty(value = "是否公共(市级机构才可创建)") + private Boolean common; + + /** + * 服务包类型(0:基本公共卫生服务包 1:家医服务包 2:精细化服务包) + */ + @ApiModelProperty(value = "服务包类型(0:基本公共卫生服务包 1:家医服务包 2:精细化服务包)") + private String packType; + + /** + * 服务包类别(0:基础服务包 1:个性化服务包) + * */ + @ApiModelProperty(value = "服务包类别(0:基础服务包 1:个性化服务包)") + private String packCategory; + + /** + * 服务包内容 + */ + @ApiModelProperty(value = "服务包内容") + private String packageContent; + + /** + * 服务项集合 + */ + @ApiModelProperty(value = "服务项集合") + private List formList; + +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java index f3561c8..2f8f316 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java @@ -114,4 +114,13 @@ public interface IResidentPatientInfoService { * @return void **/ PatientInfo getByCardNo(String cardNo); + + /** + * @Author mengkuiliang + * @Description 是否已注册 + * @Date 2023-10-11 011 10:45 + * @Param [code] + * @return java.lang.Object + **/ + PatientInfo isRegistered(String code); } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentServiceAppletService.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentServiceAppletService.java index 9ed4fa4..f8893f5 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentServiceAppletService.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentServiceAppletService.java @@ -104,5 +104,5 @@ public interface IResidentServiceAppletService { * @Param [identity] * @return java.lang.Object **/ - List getForm(String identity, String region); + List getForm(String identity, String projectName, String region); } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java index 56642db..82bb98a 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java @@ -8,6 +8,7 @@ import java.util.stream.Collectors; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.xinelu.common.config.AppletChatConfig; +import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.http.HttpService; @@ -168,6 +169,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi if(body.getDiseaseList() != null) { patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(","))); } + patientInfo.setLoginFlag(Long.valueOf(1)); updatePatientInfo(patientInfo); // 注册 } else { @@ -185,6 +187,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi entity.setIsChecked((list == null || list.size() == 0) ? "1" : "0"); entity.setCreateTime(new Date()); entity.setCreateBy(body.getCardNo()); + entity.setLoginFlag(Long.valueOf(1)); residentPatientInfoMapper.insertPatientInfo(entity); } else { if (!StringUtils.isBlank(patientInfo.getOpenid())) { @@ -200,6 +203,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi patientInfo.setUpdateBy(body.getCardNo()); patientInfo.setHeadPictureUrl(body.getHeadPictureUrl()); patientInfo.setDelFlag(0); + patientInfo.setLoginFlag(Long.valueOf(1)); if(body.getDiseaseList() != null) { patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(","))); } @@ -310,4 +314,16 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi public PatientInfo getByCardNo(String cardNo) { return residentPatientInfoMapper.getByCardNo(cardNo); } + + /** + * @Author mengkuiliang + * @Description 是否已注册 + * @Date 2023-10-11 011 10:46 + * @Param [code] + * @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo + **/ + @Override + public PatientInfo isRegistered(String code) { + return getCurrentResident(getOpenId(code), null); + } } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentServiceApplyServiceImpl.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentServiceApplyServiceImpl.java index 3e76322..208dcbd 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentServiceApplyServiceImpl.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentServiceApplyServiceImpl.java @@ -258,9 +258,8 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe * @Param [identity] **/ @Override - public List getForm(String identity, String region) { + public List getForm(String identity, String projectName, String region) { List projectList = new ArrayList<>(); - // 获取签约信息 String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/resident/signinfo/detail/" + identity, null, String.class); JSONObject jsonObject = JSONObject.parseObject(result); @@ -275,7 +274,7 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe throw new ServiceException("未查询到签约信息!"); } // 获取家医个性服务包 - result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/package/getPackageOfGX/" + identity, null, String.class); + result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/package/getPackageOfGX/" + identity + (!StringUtils.isBlank(projectName)? ("?formName=" + projectName): "?formName=null"), null, String.class); jsonObject = JSONObject.parseObject(result); if (!"1".equals(jsonObject.get("code"))) { throw new ServiceException(jsonObject.get("msg").toString()); @@ -316,6 +315,7 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe // 获取筛查项目 ScreeningProject query = new ScreeningProject(); query.setHospitalId(Hospital.getId()); + query.setProjectName(projectName); List screeningProjectList = screeningProjectService.findList(query); if(screeningProjectList != null && screeningProjectList.size() > 0) { ScreeningProjectVo sp;