From ca0611cbb55d9fa75fd7012aaf43f6e34e05c00d Mon Sep 17 00:00:00 2001 From: mengkuiliang <1464081137@qq.com> Date: Tue, 17 Oct 2023 15:58:26 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E8=AF=84=E4=BB=B7=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5=EF=BC=9B=20=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9=EF=BC=9B?= =?UTF-8?q?=20=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=88=B7=E4=B8=BB=E7=9B=B8=E5=85=B3=E5=AD=97=E6=AE=B5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applet/PatientScoreController.java | 2 +- .../applet/ResidentPatientInfoController.java | 12 +- .../ResidentServiceApplyController.java | 60 ++++-- .../xinelu/common/utils/http/HttpUtils.java | 6 +- .../applet/pojo/body/PatientInfoBody.java | 12 ++ .../applet/pojo/entity/PatientInfo.java | 13 ++ .../applet/pojo/query/PatientInfoQuery.java | 5 + .../applet/pojo/query/ServiceRecordQuery.java | 74 +++++++ .../pojo/vo/ResidentServiceApplyVo.java | 12 -- .../pojo/vo/ResidentServiceRecordVo.java | 194 ++++++++++++++++++ .../impl/ResidentPatientInfoServiceImpl.java | 8 +- .../register/ResidentPatientInfoMapper.xml | 28 ++- .../OrderEvaluateAndPictureDTO.java | 13 ++ .../applet/appletlogin/AppletLoginMapper.xml | 1 + .../AppOrderEvaluateMapper.xml | 4 + .../orderevaluateinfo/OrderEvaluateInfo.java | 13 ++ .../OrderEvaluateInfoMapper.java | 9 + .../IOrderEvaluateInfoService.java | 11 +- .../impl/OrderEvaluateInfoServiceImpl.java | 14 +- .../OrderEvaluateInfoMapper.xml | 31 +++ 20 files changed, 484 insertions(+), 38 deletions(-) create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/query/ServiceRecordQuery.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/ResidentServiceRecordVo.java diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/PatientScoreController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/PatientScoreController.java index bc2635b..4992134 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/PatientScoreController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/applet/PatientScoreController.java @@ -37,7 +37,7 @@ public class PatientScoreController extends BaseController { if (!jsonObject.get("code").toString().equals("1")) { return R.fail(jsonObject.get("msg").toString()); } - return R.ok("请求成功", jsonObject.getString("data")); + return R.ok(jsonObject.getString("data")); } @ApiOperation("获取居民积分记录列表") 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 d09c38e..70f2fa7 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 @@ -47,9 +47,9 @@ public class ResidentPatientInfoController extends BaseController { @ApiOperation("注册完善信息") @PostMapping("") public R register(@Validated @RequestBody PatientInfoBody body) { - if(body.getDiseaseList() == null || body.getDiseaseList().size() == 0) { - return R.fail("请选择基础疾病"); - } +// if(body.getDiseaseList() == null || body.getDiseaseList().size() == 0) { +// return R.fail("请选择基础疾病"); +// } try { residentPatientInfoService.register(body); return R.ok(); @@ -78,9 +78,9 @@ public class ResidentPatientInfoController extends BaseController { } @ApiOperation("获取已注册列表") - @GetMapping("/getList/{openid}/{cityCode}") - public R> getList(@PathVariable String openid, @PathVariable String cityCode) { - return R.ok(residentPatientInfoService.getList(openid, cityCode)); + @GetMapping("/getList/{openid}") + public R> getList(@PathVariable String openid) { + return R.ok(residentPatientInfoService.getList(openid, null)); } @ApiOperation("切换账号") 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 e25b5a8..d7cd75a 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 @@ -1,14 +1,24 @@ package com.xinelu.web.controller.applet; +import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.xinelu.common.core.controller.BaseController; 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.http.HttpService; +import com.xinelu.common.utils.spring.SpringUtils; import com.xinelu.familydoctor.applet.pojo.body.ResidentServiceApplyBody; +import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo; import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery; +import com.xinelu.familydoctor.applet.pojo.query.ServiceRecordQuery; import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo; +import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceRecordVo; import com.xinelu.familydoctor.applet.pojo.vo.ScreeningProjectVo; +import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService; import com.xinelu.familydoctor.applet.service.IResidentServiceAppletService; +import com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo; +import com.xinelu.manage.service.orderevaluateinfo.IOrderEvaluateInfoService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; @@ -16,6 +26,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; +import java.util.stream.Collectors; /** * @Author mengkuiliang @@ -31,6 +42,12 @@ public class ResidentServiceApplyController extends BaseController { @Resource private IResidentServiceAppletService residentServiceAppletService; + @Resource + private HttpService httpService; + @Resource + private IResidentPatientInfoService residentPatientInfoService; + @Resource + private IOrderEvaluateInfoService orderEvaluateInfoService; @ApiOperation("提交服务预约") @PostMapping("/save") @@ -38,7 +55,7 @@ public class ResidentServiceApplyController extends BaseController { if (body == null || StringUtils.isBlank(body.getPackageNo()) || StringUtils.isBlank(body.getFormNo())) { return R.fail("请求参数不能为空"); } - if(StringUtils.isBlank(body.getIdentity())) { + if (StringUtils.isBlank(body.getIdentity())) { return R.fail("居民身份证号不能为空"); } residentServiceAppletService.insert(body); @@ -76,21 +93,40 @@ public class ResidentServiceApplyController extends BaseController { @ApiOperation(value = "获取服务预约项目列表", notes = "获取家医个性服务包和筛查项目") @GetMapping("/getForm/{identity}") public R> getForm(@PathVariable String identity, String projectName, @RequestHeader("region") String region) { - return R.ok(residentServiceAppletService.getForm(identity, projectName,region)); + return R.ok(residentServiceAppletService.getForm(identity, projectName, region)); } @ApiOperation("服务记录列表") - @PostMapping("/record") - public TableDataInfo performanceBookingRecord(@RequestBody ApplyQuery query) { - if (StringUtils.isBlank(query.getIdentity())) { - throw new ServiceException("居民身份证号不能为空"); + @GetMapping("/record/{identity}") + public R> performanceBookingRecord(@PathVariable String identity, ServiceRecordQuery query, @RequestHeader("region") String region) { + query.setIdentity(identity); + if(query.getPageNum() == null) { + query.setPageNum(1); } - try { - startPage(); - return getDataTable(residentServiceAppletService.record(query)); - } catch (Exception e) { - e.printStackTrace(); - throw new ServiceException(e.getMessage()); + if(query.getPageSize() == null) { + query.setPageSize(100); } + JSONObject result = httpService.post(SpringUtils.getFdUrl(region) + "/performance/recordV1", null, JSONObject.parseObject(JSONObject.toJSONString(query))); + if (result.get("code").toString().equals("0")) { + throw new ServiceException(result.get("msg").toString()); + } + if (result.get("data") != null) { + List perRecordList = JSONArray.parseArray(result.getJSONObject("data").getJSONArray("list").toJSONString()).toJavaList(ResidentServiceRecordVo.class); + if (perRecordList != null && perRecordList.size() > 0) { + // 查询评价 + List list = orderEvaluateInfoService.selectOrderEvaluateByServiceNos(perRecordList.stream().map(ResidentServiceRecordVo::getPerformanceNo).collect(Collectors.toList()), "FAMILY_DOCTOR"); + if (list != null && list.size() > 0) { + List orderEvaluateInfoTempList; + for (ResidentServiceRecordVo record : perRecordList) { + orderEvaluateInfoTempList = list.stream().filter(o -> o.getServiceCode().equals(record.getPerformanceNo())).collect(Collectors.toList()); + if (orderEvaluateInfoTempList.size() > 0) { + record.setOrderEvaluateInfo(orderEvaluateInfoTempList.get(0)); + } + } + } + } + return R.ok(perRecordList); + } + return R.ok(); } } diff --git a/xinelu-common/src/main/java/com/xinelu/common/utils/http/HttpUtils.java b/xinelu-common/src/main/java/com/xinelu/common/utils/http/HttpUtils.java index 216d1d1..5b3a8d3 100644 --- a/xinelu-common/src/main/java/com/xinelu/common/utils/http/HttpUtils.java +++ b/xinelu-common/src/main/java/com/xinelu/common/utils/http/HttpUtils.java @@ -78,7 +78,7 @@ public class HttpUtils { while ((line = in.readLine()) != null) { result.append(line); } - log.info("recv - {}", result); +// log.info("recv - {}", result); } catch (ConnectException e) { log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e); } catch (SocketTimeoutException e) { @@ -129,7 +129,7 @@ public class HttpUtils { while ((line = in.readLine()) != null) { result.append(line); } - log.info("recv - {}", result); +// log.info("recv - {}", result); } catch (ConnectException e) { log.error("调用HttpUtils.sendPost ConnectException, url=" + url + ",param=" + param, e); } catch (SocketTimeoutException e) { @@ -181,7 +181,7 @@ public class HttpUtils { result.append(new String(ret.getBytes(StandardCharsets.ISO_8859_1), StandardCharsets.UTF_8)); } } - log.info("recv - {}", result); +// log.info("recv - {}", result); conn.disconnect(); br.close(); } catch (ConnectException e) { diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/PatientInfoBody.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/PatientInfoBody.java index a379a27..2eb55bb 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/PatientInfoBody.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/PatientInfoBody.java @@ -250,4 +250,16 @@ public class PatientInfoBody extends BaseEntity { @ApiModelProperty(value = "当前是否选中(0: 否 1:是)", hidden = true) private String isChecked; + /** + * 与户主关系 (1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;与户主关系 1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;) + */ + @ApiModelProperty(value = "与户主关系 (1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;与户主关系 1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;)") + private String householdRelationship; + + /** + * 户主身份证号 + */ + @ApiModelProperty(value = "户主身份证号") + private String householdCardNo; + } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/entity/PatientInfo.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/entity/PatientInfo.java index 1fd7df9..4c013f0 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/entity/PatientInfo.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/entity/PatientInfo.java @@ -288,6 +288,17 @@ public class PatientInfo extends BaseEntity { @Excel(name = "当前是否选中(0: 否 1:是)") private String isChecked; + /** + * 与户主关系 (1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;与户主关系 1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;) + */ + @ApiModelProperty(value = "与户主关系 (1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;与户主关系 1.户主本人;2.配偶;3.子女;4.(外)孙子女;5.父母;6.(外)祖父母;7.兄弟姐妹;8.儿媳;9.女婿;10.孙子女;11.侄子女;12.曾孙子女;13.祖父母;99.其他;)") + private String householdRelationship; + + /** + * 户主身份证号 + */ + @ApiModelProperty(value = "户主身份证号") + private String householdCardNo; @Override public String toString() { @@ -331,6 +342,8 @@ public class PatientInfo extends BaseEntity { .append("cityCode", getCityCode()) .append("bindingTime", getBindingTime()) .append("isChecked", getIsChecked()) + .append("householdRelationship", getHouseholdRelationship()) + .append("householdCardNo", getHouseholdCardNo()) .toString(); } } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/query/PatientInfoQuery.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/query/PatientInfoQuery.java index f004673..d8e4917 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/query/PatientInfoQuery.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/query/PatientInfoQuery.java @@ -71,4 +71,9 @@ public class PatientInfoQuery extends BaseEntity { @ApiModelProperty(value = "当前是否选中(0: 否 1:是)") private String isChecked; + /** + * 户主身份证号 + */ + @ApiModelProperty(value = "户主身份证号") + private String householdCardNo; } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/query/ServiceRecordQuery.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/query/ServiceRecordQuery.java new file mode 100644 index 0000000..3a8998e --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/query/ServiceRecordQuery.java @@ -0,0 +1,74 @@ +package com.xinelu.familydoctor.applet.pojo.query; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @Author mengkuiliang + * @Description 服务记录查询类 + * @Date 2023-10-17 017 14:50 + * @Param + * @return + **/ +@Data +@ApiModel("服务记录查询类") +public class ServiceRecordQuery { + + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号", hidden = true) + private String identity; + + /** + * 服务包编号 + */ + @ApiModelProperty(value = "服务包编号") + private String packageNo; + + /** + * 服务包名称 + */ + @ApiModelProperty(value = "服务包名称") + private String packageName; + + /** + * 服务项编号 + */ + @ApiModelProperty(value = "服务项编号") + private String formNo; + + /** + * 服务项名称 + */ + @ApiModelProperty(value = "服务项名称") + private String formName; + + /** + * 开始日期(yyyy-MM-dd) + */ + @ApiModelProperty(value = "开始日期(yyyy-MM-dd)") + private Date startDate; + + /** + * 结束日期(yyyy-MM-dd) + */ + @ApiModelProperty(value = "结束日期(yyyy-MM-dd)") + private Date endDate; + + /** + * 页码 + */ + @ApiModelProperty("页码") + private Integer pageNum; + + /** + * 页面大小 + */ + @ApiModelProperty("页面大小") + private Integer pageSize; + +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/ResidentServiceApplyVo.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/ResidentServiceApplyVo.java index 608a42a..23890ba 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/ResidentServiceApplyVo.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/ResidentServiceApplyVo.java @@ -155,16 +155,4 @@ public class ResidentServiceApplyVo { @ApiModelProperty("签约编号") private String signNo; - /** - * 评价编号 - */ - @ApiModelProperty("评价编号") - private String evaluateNo; - - /** - * 服务评价对象 - */ - @ApiModelProperty("服务评价对象") - OrderEvaluateInfoVo orderEvaluateInfo; - } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/ResidentServiceRecordVo.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/ResidentServiceRecordVo.java new file mode 100644 index 0000000..5aeecdd --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/ResidentServiceRecordVo.java @@ -0,0 +1,194 @@ +package com.xinelu.familydoctor.applet.pojo.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @Author mengkuiliang + * @Description 服务记录展示类 + * @Date 2023-10-17 017 11:32 + * @Param + * @return + **/ +@ApiModel("服务记录展示类") +@Data +public class ResidentServiceRecordVo { + + /** + * 履约业务主键 + */ + @ApiModelProperty(value = "履约业务主键") + private String performanceNo; + + /** + * 签约编号 + */ + @ApiModelProperty(value = "签约编号") + private String signNo; + + /** + * 居民编号 + */ + @ApiModelProperty(value = "居民编号") + private String residentNo; + + /** + * 居民身份证号 + */ + @ApiModelProperty(value = "居民身份证号") + private String identity; + + /** + * 居民姓名 + */ + @ApiModelProperty(value = "居民姓名") + private String residentName; + + + /** + * 履约明细业务主键 + */ + @ApiModelProperty(value = "履约明细业务主键") + private String performanceDetailNo; + + /** + * 服务包明细业务主键 + */ + @ApiModelProperty(value = "服务包明细业务主键") + private String packageDetailNo; + + /** + * 服务包编号 + */ + @ApiModelProperty(value = "服务包编号", required = true) + private String packageNo; + + /** + * 服务包名称 + */ + @ApiModelProperty(value = "服务包名称", required = true) + private String packageName; + + /** + * 服务项表单编号 + */ + @ApiModelProperty(value = "服务项表单编号") + private String formNo; + + /** + * 服务项表单名称 + */ + @ApiModelProperty(value = "服务项表单名称") + private String formName; + + /** + * 履约时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiModelProperty(value = "履约时间") + private Date performanceTime; + + /** + * 随访时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiModelProperty(value = "随访时间") + private Date followupTime; + + /** + * 下次履约时间 + */ + @ApiModelProperty(value = "下次履约时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date performanceNextTime; + + /** + * 机构业务编号 + */ + @ApiModelProperty(value = "机构业务编号") + private String orgNo; + + /** + * 机构名称 + */ + @ApiModelProperty(value = "机构名称", required = true) + private String orgName; + + /** + * 团队业务编号 + */ + @ApiModelProperty(value = "团队业务编号", required = true) + private String teamNo; + + /** + * 团队名称 + */ + @ApiModelProperty(value = "团队名称", required = true) + private String teamName; + + /** + * 履约医生 + */ + @ApiModelProperty(value = "履约医生") + private String userNo; + + /** + * 履约医生名称 + */ + @ApiModelProperty(value = "履约医生名称") + private String userName; + + /** + * 下次随访日期 + */ + @ApiModelProperty(value = "下次随访日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date followupNextTime; + + /** + * 履约方式(1:家庭,2:门诊,3:电话,99:其他) + */ + @ApiModelProperty(value = "履约方式(1:家庭,2:门诊,3:电话,99:其他)") + private String performanceWay; + + /** + * 履约方式名称(1:家庭,2:门诊,3:电话,99:其他) + */ + @ApiModelProperty(value = "履约方式(1:家庭,2:门诊,3:电话,99:其他)") + private String performanceWayName; + + /** + * 生成方式(1:手动添加 2:随访自动同步) + */ + @ApiModelProperty(value = "生成方式(1:手动添加 2:随访自动同步)") + private String generateWay; + + /** + * 生成方式名称(1:手动添加 2:随访自动同步) + */ + @ApiModelProperty(value = "生成方式(1:手动添加 2:随访自动同步)") + private String generateWayName; + + /** + * 应服务次数 + */ + @ApiModelProperty(value = "应服务次数") + private Integer serviceFreq; + + /** + * 已履约次数 + */ + @ApiModelProperty(value = "已履约次数") + private Integer performanceCount; + + /** + * 服务评价对象 + */ + @ApiModelProperty("服务评价对象") + OrderEvaluateInfo orderEvaluateInfo; +} 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 de51f3c..55d4889 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 @@ -156,6 +156,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi BeanUtils.copyBeanProp(patientInfo, body); if(body.getDiseaseList() != null) { patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(","))); + } else { + patientInfo.setDisease("0"); } patientInfo.setLoginFlag(Long.valueOf(1)); updatePatientInfo(patientInfo); @@ -169,6 +171,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi BeanUtils.copyBeanProp(entity, body); if(body.getDiseaseList() != null) { entity.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(","))); + } else { + entity.setDisease("0"); } entity.setPatientCode(IdUtils.fastSimpleUUID()); entity.setBindingTime(new Date()); @@ -194,6 +198,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi patientInfo.setLoginFlag(Long.valueOf(1)); if(body.getDiseaseList() != null) { patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(","))); + } else { + patientInfo.setDisease("0"); } residentPatientInfoMapper.updatePatientInfo(patientInfo); } @@ -266,7 +272,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi **/ @Override public PatientInfo getCurrentResident(String openid, String cityCode) { - List list = residentPatientInfoMapper.getList(openid, cityCode); + List list = residentPatientInfoMapper.getList(openid, null); if (list == null || list.size() == 0) { return null; } diff --git a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml index 5574d49..e7c3870 100644 --- a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml +++ b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml @@ -45,6 +45,9 @@ + + + @@ -87,7 +90,9 @@ disease, city_code, binding_time, - is_checked + is_checked, + household_relationship, + household_card_no from patient_info @@ -119,6 +124,9 @@ and is_checked = #{isChecked} + + and household_card_no = #{householdCardNo} + order by binding_time desc @@ -207,6 +215,12 @@ is_checked, + + household_relationship, + + + household_card_no, + #{areaCode}, @@ -286,6 +300,12 @@ #{isChecked}, + + #{householdRelationship}, + + + #{householdCardNo}, + @@ -406,6 +426,12 @@ is_checked = #{isChecked}, + + household_relationship = #{householdRelationship}, + + + household_card_no = #{householdCardNo}, + where patient_code = #{patientCode} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/apporderevaluate/OrderEvaluateAndPictureDTO.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/apporderevaluate/OrderEvaluateAndPictureDTO.java index 1b8136f..49d59c9 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/apporderevaluate/OrderEvaluateAndPictureDTO.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/apporderevaluate/OrderEvaluateAndPictureDTO.java @@ -2,6 +2,7 @@ package com.xinelu.applet.dto.apporderevaluate; import com.xinelu.common.custominterface.Insert; import com.xinelu.manage.domain.orderevaluatepictureinfo.OrderEvaluatePictureInfo; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -47,6 +48,12 @@ public class OrderEvaluateAndPictureDTO implements Serializable { @NotBlank(message = "请选择订单编号", groups = {Insert.class}) private String orderNo; + /** + * 服务编号 + */ + @ApiModelProperty(value = "服务编号") + private String serviceCode; + /** * 评价内容 */ @@ -69,6 +76,12 @@ public class OrderEvaluateAndPictureDTO implements Serializable { @NotNull(message = "请选择评分", groups = {Insert.class}) private Integer compositeScore; + /** + * 订单来源,泉医模块:SPRING_DOCTOR,家医模块:FAMILY_DOCTOR + */ + @ApiModelProperty(value = "订单来源,泉医模块:SPRING_DOCTOR,家医模块:FAMILY_DOCTOR") + private String orderSource; + /** * 创建时间 */ diff --git a/xinelu-nurse-applet/src/main/resources/mapper/applet/appletlogin/AppletLoginMapper.xml b/xinelu-nurse-applet/src/main/resources/mapper/applet/appletlogin/AppletLoginMapper.xml index b18063c..ddb9d76 100644 --- a/xinelu-nurse-applet/src/main/resources/mapper/applet/appletlogin/AppletLoginMapper.xml +++ b/xinelu-nurse-applet/src/main/resources/mapper/applet/appletlogin/AppletLoginMapper.xml @@ -84,6 +84,7 @@ and openid = #{openId} + limit 1 @@ -78,6 +85,16 @@ + + + insert into order_evaluate_info @@ -92,6 +109,8 @@ order_no, + service_code, + evaluate_content, evaluate_channel, @@ -100,6 +119,8 @@ composite_score, + order_source, + create_by, create_time, @@ -120,6 +141,8 @@ #{orderNo}, + #{serviceCode}, + #{evaluateContent}, #{evaluateChannel}, @@ -128,6 +151,8 @@ #{compositeScore}, + #{orderSource}, + #{createBy}, #{createTime}, @@ -154,6 +179,9 @@ order_no = #{orderNo}, + service_code = + #{serviceCode}, + evaluate_content = #{evaluateContent}, @@ -166,6 +194,9 @@ composite_score = #{compositeScore}, + + order_source = #{orderSource}, + create_by = #{createBy}, From b15520a6bdaa79b9b016f3f004ae5b2ca1b6341e Mon Sep 17 00:00:00 2001 From: gaoyu Date: Wed, 18 Oct 2023 14:11:08 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E8=87=AA=E8=AF=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeviceBindResidentController.java | 24 ++-- .../EvaluateAdviceTemplateController.java | 65 +++++++++++ .../EvaluateSurveyController.java | 88 +++++++++++++++ .../familydoctor/PhysicalSignController.java | 34 +++--- .../common/enums/SurveySubjectEnum.java | 32 ++++++ .../familydoctor/entity/DeviceBfRecord.java | 15 ++- .../familydoctor/entity/DeviceBgRecord.java | 14 ++- .../entity/DeviceBindResident.java | 4 +- .../familydoctor/entity/DeviceBmiRecord.java | 12 +- .../familydoctor/entity/DeviceBoRecord.java | 13 ++- .../familydoctor/entity/DeviceBpRecord.java | 15 ++- .../familydoctor/entity/DeviceHrRecord.java | 13 ++- .../familydoctor/entity/DeviceTempRecord.java | 12 +- .../entity/EvaluateAdviceTemplate.java | 71 ++++++++++++ .../familydoctor/entity/EvaluateAnswer.java | 38 +++++++ .../familydoctor/entity/EvaluateOption.java | 38 +++++++ .../familydoctor/entity/EvaluateQuestion.java | 47 ++++++++ .../familydoctor/entity/EvaluateRecord.java | 53 +++++++++ .../familydoctor/entity/EvaluateSurvey.java | 70 ++++++++++++ .../mapper/EvaluateAdviceTemplateMapper.java | 23 ++++ .../mapper/EvaluateAnswerMapper.java | 21 ++++ .../mapper/EvaluateOptionMapper.java | 32 ++++++ .../mapper/EvaluateQuestionMapper.java | 31 +++++ .../mapper/EvaluateRecordMapper.java | 19 ++++ .../mapper/EvaluateSurveyMapper.java | 30 +++++ .../EvaluateAdviceTemplateService.java | 13 +++ .../service/EvaluateRecordService.java | 15 +++ .../service/EvaluateSurveyService.java | 22 ++++ .../EvaluateAdviceTemplateServiceImpl.java | 63 +++++++++++ .../impl/EvaluateRecordServiceImpl.java | 79 +++++++++++++ .../impl/EvaluateSurveyServiceImpl.java | 106 ++++++++++++++++++ .../vo/EvaluateRecordResultVO.java | 20 ++++ .../vo/EvaluateRecordTimelineVO.java | 18 +++ .../mapper/EvaluateAdviceTemplateMapper.xml | 93 +++++++++++++++ .../resources/mapper/EvaluateAnswerMapper.xml | 51 +++++++++ .../resources/mapper/EvaluateOptionMapper.xml | 57 ++++++++++ .../mapper/EvaluateQuestionMapper.xml | 64 +++++++++++ .../resources/mapper/EvaluateRecordMapper.xml | 37 ++++++ .../resources/mapper/EvaluateSurveyMapper.xml | 92 +++++++++++++++ 39 files changed, 1504 insertions(+), 40 deletions(-) create mode 100644 xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateAdviceTemplateController.java create mode 100644 xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateSurveyController.java create mode 100644 xinelu-common/src/main/java/com/xinelu/common/enums/SurveySubjectEnum.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateAdviceTemplate.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateAnswer.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateOption.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateQuestion.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateRecord.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateSurvey.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateAdviceTemplateMapper.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateAnswerMapper.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateOptionMapper.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateQuestionMapper.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateRecordMapper.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateSurveyMapper.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateAdviceTemplateService.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateRecordService.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateSurveyService.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateAdviceTemplateServiceImpl.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateRecordServiceImpl.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateSurveyServiceImpl.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/EvaluateRecordResultVO.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/EvaluateRecordTimelineVO.java create mode 100644 xinelu-familydoctor/src/main/resources/mapper/EvaluateAdviceTemplateMapper.xml create mode 100644 xinelu-familydoctor/src/main/resources/mapper/EvaluateAnswerMapper.xml create mode 100644 xinelu-familydoctor/src/main/resources/mapper/EvaluateOptionMapper.xml create mode 100644 xinelu-familydoctor/src/main/resources/mapper/EvaluateQuestionMapper.xml create mode 100644 xinelu-familydoctor/src/main/resources/mapper/EvaluateRecordMapper.xml create mode 100644 xinelu-familydoctor/src/main/resources/mapper/EvaluateSurveyMapper.xml diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/DeviceBindResidentController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/DeviceBindResidentController.java index d230d62..84b7084 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/DeviceBindResidentController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/DeviceBindResidentController.java @@ -1,7 +1,7 @@ package com.xinelu.web.controller.familydoctor; import com.xinelu.common.core.controller.BaseController; -import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.domain.R; import com.xinelu.familydoctor.entity.DeviceBindResident; import com.xinelu.familydoctor.service.DeviceBindResidentService; import io.swagger.annotations.Api; @@ -26,38 +26,34 @@ public class DeviceBindResidentController extends BaseController { @ApiOperation("绑定设备") @PostMapping("binding") - public AjaxResult bind(@RequestBody DeviceBindResident entity) { + public R bind(@RequestBody DeviceBindResident entity) { if (deviceBindResidentService.repeatBind(entity)) { - return AjaxResult.error("设备【" + entity.getSn() + "】已绑定"); + return R.fail("设备【" + entity.getSn() + "】已绑定"); } - AjaxResult ajaxResult; int row = deviceBindResidentService.bindDevice(entity); if (row > 0) { - ajaxResult = AjaxResult.success(); + return R.ok(); } else { - ajaxResult = AjaxResult.error("绑定失败"); + return R.fail("绑定失败"); } - return ajaxResult; } @ApiOperation("已绑定的设备") @GetMapping("bound/{identity}") @ApiImplicitParam(name = "identity", value = "身份证号", required = true) - public AjaxResult boundDevice(@PathVariable String identity) { + public R> boundDevice(@PathVariable String identity) { List list = deviceBindResidentService.boundDevice(identity); - return AjaxResult.success(list); + return R.ok(list); } @ApiOperation("解绑设备") @PostMapping("unbind") - public AjaxResult unbindDevice(@RequestBody DeviceBindResident entity) { - AjaxResult ajaxResult; + public R unbindDevice(@RequestBody DeviceBindResident entity) { int row = deviceBindResidentService.unbindDevice(entity); if (row > 0) { - ajaxResult = AjaxResult.success(); + return R.ok(); } else { - ajaxResult = AjaxResult.error("解绑失败"); + return R.fail("解绑失败"); } - return ajaxResult; } } diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateAdviceTemplateController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateAdviceTemplateController.java new file mode 100644 index 0000000..72a5752 --- /dev/null +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateAdviceTemplateController.java @@ -0,0 +1,65 @@ +package com.xinelu.web.controller.familydoctor; + +import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.page.TableDataInfo; +import com.xinelu.familydoctor.entity.EvaluateAdviceTemplate; +import com.xinelu.familydoctor.service.EvaluateAdviceTemplateService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author gaoyu + * @description 自我评估处方模板接口控制器 + * @date 2023-10-16 16:59 + */ +@Api(tags = {"自我评估处方模板接口控制器"}) +@RestController +@RequestMapping("/evaluate/advice/template") +public class EvaluateAdviceTemplateController extends BaseController { + + @Resource + private EvaluateAdviceTemplateService evaluateAdviceTemplateService; + + @ApiOperation("模板列表") + @GetMapping("list") + public TableDataInfo list(EvaluateAdviceTemplate entity) { + startPage(); + List list = evaluateAdviceTemplateService.findList(entity); + return getDataTable(list); + } + + @ApiOperation("新增/编辑模板") + @PostMapping("save") + public AjaxResult save(@RequestBody EvaluateAdviceTemplate entity) { + evaluateAdviceTemplateService.save(entity); + return AjaxResult.success(); + } + + @ApiOperation("修改模板状态") + @PostMapping("change/status") + public AjaxResult changeStatus(@RequestBody EvaluateAdviceTemplate entity) { + evaluateAdviceTemplateService.changeStatus(entity); + return AjaxResult.success(); + } + + @ApiOperation("逻辑删除模板") + @PostMapping("del/{id}") + @ApiImplicitParam(name = "id", value = "模板ID", required = true) + public AjaxResult del(@PathVariable Long id) { + evaluateAdviceTemplateService.delTemplate(id); + return AjaxResult.success(); + } + + @ApiOperation("根据自评结果获取处方模板") + @GetMapping("get/{templateType}") + @ApiImplicitParam(name = "templateType", value = "处方模板类型", required = true) + public AjaxResult getTemplate(@PathVariable String templateType) { + return AjaxResult.success(evaluateAdviceTemplateService.getTemplate(templateType)); + } +} diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateSurveyController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateSurveyController.java new file mode 100644 index 0000000..a51b713 --- /dev/null +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateSurveyController.java @@ -0,0 +1,88 @@ +package com.xinelu.web.controller.familydoctor; + +import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.page.TableDataInfo; +import com.xinelu.familydoctor.entity.EvaluateRecord; +import com.xinelu.familydoctor.entity.EvaluateSurvey; +import com.xinelu.familydoctor.service.EvaluateRecordService; +import com.xinelu.familydoctor.service.EvaluateSurveyService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author gaoyu + * @description 自我评估问卷控制器 + * @date 2023-10-10 11:02 + */ +@Api(tags = {"自我评估问卷控制器"}) +@RestController +@RequestMapping("/evaluate") +public class EvaluateSurveyController extends BaseController { + @Resource + private EvaluateSurveyService evaluateSurveyService; + @Resource + private EvaluateRecordService evaluateRecordService; + + @ApiOperation("问卷列表") + @GetMapping("survey/list") + public TableDataInfo surveyList(EvaluateSurvey entity) { + startPage(); + List list = evaluateSurveyService.findList(entity); + return getDataTable(list); + } + + @ApiOperation("问卷新增") + @PostMapping("survey/save") + public AjaxResult surveySave(@RequestBody EvaluateSurvey entity) { + evaluateSurveyService.insert(entity); + return AjaxResult.success(); + } + + @ApiOperation("问卷编辑") + @PostMapping("survey/update") + public AjaxResult surveyUpdate(@RequestBody EvaluateSurvey entity) { + evaluateSurveyService.update(entity); + return AjaxResult.success(); + } + + @ApiOperation("修改问卷状态(启用/停用)") + @PostMapping("survey/change/state") + public AjaxResult changeState() { + return AjaxResult.success(); + } + + @ApiOperation("获取问卷") + @GetMapping("survey/get/{subject}") + @ApiImplicitParam(name = "subject", value = "问卷主题", required = true) + public AjaxResult getSurvey(@PathVariable String subject) { + EvaluateSurvey survey = evaluateSurveyService.getSurvey(subject); + return AjaxResult.success(survey); + } + + @ApiOperation("问卷提交") + @PostMapping("survey/submit") + public AjaxResult surveySubmit(EvaluateRecord evaluateRecord) { + evaluateRecordService.submit(evaluateRecord); + return AjaxResult.success(); + } + + @ApiOperation("获取评估记录") + @GetMapping("record/timeline/{userId}") + @ApiImplicitParam(name = "userId", value = "用户ID", required = true) + public AjaxResult record(@PathVariable Long userId) { + return AjaxResult.success(evaluateRecordService.getEvaluateTimeline(userId)); + } + + @ApiOperation("获取评估问卷答案") + @GetMapping("survey/answer/{recordId}") + @ApiImplicitParam(name = "recordId", value = "评估记录ID", required = true) + public AjaxResult detail(@PathVariable Long recordId) { + return AjaxResult.success(evaluateRecordService.getAnswers(recordId)); + } +} diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/PhysicalSignController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/PhysicalSignController.java index f4dad3f..bee20b7 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/PhysicalSignController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/PhysicalSignController.java @@ -1,7 +1,7 @@ package com.xinelu.web.controller.familydoctor; import com.xinelu.common.core.controller.BaseController; -import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.domain.R; import com.xinelu.familydoctor.entity.*; import com.xinelu.familydoctor.service.PhysicalSignService; import io.swagger.annotations.Api; @@ -27,51 +27,51 @@ public class PhysicalSignController extends BaseController { @ApiOperation("上传血糖") @PostMapping("bg/save") - public AjaxResult saveBg(@RequestBody DeviceBgRecord record) { + public R saveBg(@RequestBody DeviceBgRecord record) { physicalSignService.saveBg(record); - return AjaxResult.success(); + return R.ok(); } @ApiOperation("上传血压") @PostMapping("bp/save") - public AjaxResult saveBp(@RequestBody DeviceBpRecord record) { + public R saveBp(@RequestBody DeviceBpRecord record) { physicalSignService.saveBp(record); - return AjaxResult.success(); + return R.ok(); } @ApiOperation("上传血脂") @PostMapping("bf/save") - public AjaxResult saveBf(@RequestBody DeviceBfRecord record) { + public R saveBf(@RequestBody DeviceBfRecord record) { physicalSignService.saveBf(record); - return AjaxResult.success(); + return R.ok(); } @ApiOperation("上传BMI") @PostMapping("bmi/save") - public AjaxResult saveBmi(@RequestBody DeviceBmiRecord record) { + public R saveBmi(@RequestBody DeviceBmiRecord record) { physicalSignService.saveBmi(record); - return AjaxResult.success(); + return R.ok(); } @ApiOperation("上传血氧") @PostMapping("bo/save") - public AjaxResult saveBo(@RequestBody DeviceBoRecord record) { + public R saveBo(@RequestBody DeviceBoRecord record) { physicalSignService.saveBo(record); - return AjaxResult.success(); + return R.ok(); } @ApiOperation("上传心率") @PostMapping("hr/save") - public AjaxResult saveHr(@RequestBody DeviceHrRecord record) { + public R saveHr(@RequestBody DeviceHrRecord record) { physicalSignService.saveHr(record); - return AjaxResult.success(); + return R.ok(); } @ApiOperation("上传体温") @PostMapping("temp/save") - public AjaxResult saveTemp(@RequestBody DeviceTempRecord record) { + public R saveTemp(@RequestBody DeviceTempRecord record) { physicalSignService.saveTemp(record); - return AjaxResult.success(); + return R.ok(); } @ApiOperation("获取体征记录") @@ -79,8 +79,8 @@ public class PhysicalSignController extends BaseController { @ApiImplicitParams({@ApiImplicitParam(name = "identity", value = "身份证号", required = true), @ApiImplicitParam(name = "type", value = "时间类型0:全部1:周2:月3:年", required = true), @ApiImplicitParam(name = "label", value = "查询标识1:血糖2:血压3:血脂4:bmi5:血氧6:心率7:体温", required = true)}) - public AjaxResult record(String identity, String type, String label) { + public R record(String identity, String type, String label) { Map map = physicalSignService.record(identity, type, label); - return AjaxResult.success(map); + return R.ok(map); } } diff --git a/xinelu-common/src/main/java/com/xinelu/common/enums/SurveySubjectEnum.java b/xinelu-common/src/main/java/com/xinelu/common/enums/SurveySubjectEnum.java new file mode 100644 index 0000000..29109f3 --- /dev/null +++ b/xinelu-common/src/main/java/com/xinelu/common/enums/SurveySubjectEnum.java @@ -0,0 +1,32 @@ +package com.xinelu.common.enums; +/** + * @description: 问卷主题枚举 + * @author gaoyu + * @date 2023-10-11 10:44 + */ +public enum SurveySubjectEnum { + HBP_EVALUATE("1001", "高血压评估问卷"), + BG_EVALUATE("1002", "糖尿病评估问卷"), + STOKE_EVALUATE("1003", "脑卒中评估问卷"), + COPD_EVALUATE("1004", "慢阻肺评估问卷"), + CHRONIC_EVALUATE("1005", "慢病评估问卷"), + NS_EVALUATE("1006", "糖尿病肾病评估问卷"), + ED_EVALUATE("1007", "糖尿病眼病评估问卷"), + FD_EVALUATE("1008", "糖尿病足病评估问卷"); + + private final String code; + private final String label; + + SurveySubjectEnum(String code, String label) { + this.code = code; + this.label = label; + } + + public String getCode() { + return code; + } + + public String getLabel() { + return label; + } +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBfRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBfRecord.java index 89bbe02..7f798ad 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBfRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBfRecord.java @@ -3,48 +3,61 @@ package com.xinelu.familydoctor.entity; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * 血脂记录表 * @TableName device_bf_record */ +@ApiModel("血脂记录表") @Data public class DeviceBfRecord implements Serializable { /** * 自增主键 */ + @ApiModelProperty("自增主键") private Long id; /** * 居民身份证号 */ + @ApiModelProperty("居民身份证号") private String identity; /** * 血清总胆固醇(单位:mmol/L) */ + @ApiModelProperty("血清总胆固醇(单位:mmol/L)") private BigDecimal tc; /** * 甘油三酯(单位:mmol/L) */ + @ApiModelProperty("甘油三酯(单位:mmol/L)") private BigDecimal tg; /** * 高密度脂蛋白胆固醇(单位:mmol/L) */ + @ApiModelProperty("高密度脂蛋白胆固醇(单位:mmol/L)") private BigDecimal hdl; /** * 低密度脂蛋白胆固醇(单位:mmol/L) */ + @ApiModelProperty("低密度脂蛋白胆固醇(单位:mmol/L)") private BigDecimal ldl; /** * 测量时间 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty("测量时间") private Date measureTime; private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBgRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBgRecord.java index ddfd25d..c280e7c 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBgRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBgRecord.java @@ -3,43 +3,55 @@ package com.xinelu.familydoctor.entity; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * 血糖记录表 * @TableName device_bg_record */ +@ApiModel("血糖记录表") @Data public class DeviceBgRecord implements Serializable { /** * 自增主键 */ + @ApiModelProperty("自增主键") private Long id; /** * 居民身份证号 */ + @ApiModelProperty("居民身份证号") private String identity; /** * 血糖值(单位:mmol/L) */ + @ApiModelProperty("血糖值(单位:mmol/L)") private BigDecimal bg; /** * 时间段1:凌晨2:早餐前3:早晨后4:午餐前5:午餐后6:晚餐前7:晚餐后8:睡前 */ + @ApiModelProperty("时间段1:凌晨2:早餐前3:早晨后4:午餐前5:午餐后6:晚餐前7:晚餐后8:睡前") private String bucket; /** * 测量时间 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty("测量时间") private Date measureTime; /** * 上传方式1:手动2:自动 */ + @ApiModelProperty("上传方式1:手动2:自动") private String uploadType; private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBindResident.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBindResident.java index a805ad2..0011b76 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBindResident.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBindResident.java @@ -34,9 +34,9 @@ public class DeviceBindResident implements Serializable { private String sn; /** - * 设备类型(0: 其他 1:血压计 2:血糖仪 3:血脂仪 4:血氧仪 5:体重秤 6:体温计) + * 设备类型(1:血压计 2:血糖仪 3:动态血压仪) */ - @ApiModelProperty("设备类型(0: 其他 1:血压计 2:血糖仪 3:血脂仪 4:血氧仪 5:体重秤 6:体温计)") + @ApiModelProperty("设备类型(1:血压计 2:血糖仪 3:动态血压仪)") private String deviceType; /** diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBmiRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBmiRecord.java index 6b382a9..43cfa46 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBmiRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBmiRecord.java @@ -3,33 +3,43 @@ package com.xinelu.familydoctor.entity; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * BMI记录表 * @TableName device_bmi_record */ +@ApiModel("BMI记录表") @Data public class DeviceBmiRecord implements Serializable { /** * 自增主键 */ + @ApiModelProperty("自增主键") private Long id; /** * 居民身份证号 */ + @ApiModelProperty("居民身份证号") private String identity; /** * BMI(单位:kg/m^2) */ + @ApiModelProperty("BMI(单位:kg/m^2)") private BigDecimal bmi; /** * 测量时间 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty("测量时间") private Date measureTime; private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBoRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBoRecord.java index 879080f..6ba73cf 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBoRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBoRecord.java @@ -2,38 +2,49 @@ package com.xinelu.familydoctor.entity; import java.io.Serializable; import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * 血氧记录表 * @TableName device_bo_record */ +@ApiModel("血氧记录表") @Data public class DeviceBoRecord implements Serializable { /** * 自增主键 */ + @ApiModelProperty("自增主键") private Long id; /** * 居民身份证号 */ + @ApiModelProperty("居民身份证号") private String identity; /** * 血氧(单位:%) */ + @ApiModelProperty("血氧(单位:%)") private Integer spo2; /** * 脉搏(单位:次/分) */ + @ApiModelProperty("脉搏(单位:次/分)") private Integer pulse; /** * 测量时间 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty("测量时间") private Date measureTime; private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBpRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBpRecord.java index c12925b..371ef25 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBpRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBpRecord.java @@ -2,48 +2,61 @@ package com.xinelu.familydoctor.entity; import java.io.Serializable; import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * 血压记录表 * @TableName device_bp_record */ +@ApiModel("血压记录表") @Data public class DeviceBpRecord implements Serializable { /** * 自增主键 */ + @ApiModelProperty("自增主键") private Long id; /** * 居民身份证号 */ + @ApiModelProperty("居民身份证号") private String identity; /** * 收缩压(单位:mmHg) */ + @ApiModelProperty("收缩压(单位:mmHg)") private Integer sbp; /** * 舒张压(单位:mmHg) */ + @ApiModelProperty("舒张压(单位:mmHg)") private Integer dbp; /** * 心率(单位:次/分) */ + @ApiModelProperty("心率(单位:次/分)") private Integer hr; /** * 测量时间 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty("测量时间") private Date measureTime; /** * 上传方式1:手动2:自动 */ + @ApiModelProperty("上传方式1:手动2:自动") private String uploadType; private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceHrRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceHrRecord.java index 392635a..12f31af 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceHrRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceHrRecord.java @@ -2,38 +2,49 @@ package com.xinelu.familydoctor.entity; import java.io.Serializable; import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * 心率记录表 * @TableName device_hr_record */ +@ApiModel("心率记录表") @Data public class DeviceHrRecord implements Serializable { /** * 自增主键 */ + @ApiModelProperty("自增主键") private Long id; /** * 居民身份证号 */ + @ApiModelProperty("居民身份证号") private String identity; /** * 心率(单位:次/分) */ + @ApiModelProperty("心率(单位:次/分)") private Integer hr; /** * 测量时间 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty("测量时间") private Date measureTime; /** * 上传方式1:手动2:自动 */ + @ApiModelProperty("上传方式1:手动2:自动") private String uploadType; private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceTempRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceTempRecord.java index 32c4f35..9b3c6dd 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceTempRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceTempRecord.java @@ -3,33 +3,43 @@ package com.xinelu.familydoctor.entity; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * 体温记录表 * @TableName device_temp_record */ +@ApiModel("体温记录表") @Data public class DeviceTempRecord implements Serializable { /** * 自增主键 */ + @ApiModelProperty("自增主键") private Long id; /** * 居民身份证号 */ + @ApiModelProperty("居民身份证号") private String identity; /** * 体温(单位:℃) */ + @ApiModelProperty("体温(单位:℃)") private BigDecimal temp; /** * 测量时间 */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @ApiModelProperty("测量时间") private Date measureTime; private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateAdviceTemplate.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateAdviceTemplate.java new file mode 100644 index 0000000..b784d2b --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateAdviceTemplate.java @@ -0,0 +1,71 @@ +package com.xinelu.familydoctor.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.Map; + +/** + * 自我评估健康处方模板表 + * @TableName evaluate_advice_template + */ +@Data +public class EvaluateAdviceTemplate implements Serializable { + /** + * 自增主键 + */ + private Long id; + + /** + * 模板类型 + */ + private String templateType; + + /** + * 模板内容 + */ + private String content; + + /** + * 模板状态1:启用2:停用 + */ + private String useFlag; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 更新人 + */ + private Long updateBy; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识1:正常2:删除 + */ + private String delFlag; + + /** + * 请求参数 + */ + private Map params; + + private static final long serialVersionUID = 1L; +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateAnswer.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateAnswer.java new file mode 100644 index 0000000..a750fc9 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateAnswer.java @@ -0,0 +1,38 @@ +package com.xinelu.familydoctor.entity; + +import java.io.Serializable; +import lombok.Data; + +/** + * 自评问卷答案表 + * @TableName evaluate_answer + */ +@Data +public class EvaluateAnswer implements Serializable { + /** + * 自增主键 + */ + private Long id; + + /** + * 自评记录ID + */ + private Long recordId; + + /** + * 问题ID + */ + private Long questionId; + + /** + * 选项ID + */ + private Long optionId; + + /** + * 选项内容 + */ + private String optionContent; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateOption.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateOption.java new file mode 100644 index 0000000..e99dd03 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateOption.java @@ -0,0 +1,38 @@ +package com.xinelu.familydoctor.entity; + +import java.io.Serializable; +import lombok.Data; + +/** + * 自评问题选项表 + * @TableName evaluate_option + */ +@Data +public class EvaluateOption implements Serializable { + /** + * 自增主键 + */ + private Long id; + + /** + * 问题ID + */ + private Long questionId; + + /** + * 问卷ID + */ + private Long surveyId; + + /** + * 选项名称 + */ + private String optionName; + + /** + * 选项排序 + */ + private Integer optionSort; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateQuestion.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateQuestion.java new file mode 100644 index 0000000..f987fb5 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateQuestion.java @@ -0,0 +1,47 @@ +package com.xinelu.familydoctor.entity; + +import java.io.Serializable; +import java.util.List; + +import lombok.Data; + +/** + * 自评问题表 + * @TableName evaluate_question + */ +@Data +public class EvaluateQuestion implements Serializable { + /** + * 自增主键 + */ + private Long id; + + /** + * 问卷ID + */ + private Long surveyId; + + /** + * 问题主题 + */ + private String questionName; + + /** + * 问题类型1:单选2:多选3:填空 + */ + private String questionType; + + /** + * 问题排序 + */ + private Integer questionSort; + + /** + * 是否必填1:必填2:非必填 + */ + private String requiredFlag; + + private List options; + + private static final long serialVersionUID = 1L; +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateRecord.java new file mode 100644 index 0000000..e020623 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateRecord.java @@ -0,0 +1,53 @@ +package com.xinelu.familydoctor.entity; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +import lombok.Data; + +/** + * 自评记录表 + * @TableName evaluate_record + */ +@Data +public class EvaluateRecord implements Serializable { + /** + * 自增主键 + */ + private Long id; + + /** + * 用户ID + */ + private Long userId; + + /** + * 问卷ID + */ + private Long surveyId; + + /** + * 问卷主题 + */ + private String surveySubject; + + /** + * 评估结果 + */ + private String evaluateResult; + + /** + * 健康处方 + */ + private String advice; + + /** + * 创建时间 + */ + private Date createTime; + + private List answers; + + private static final long serialVersionUID = 1L; +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateSurvey.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateSurvey.java new file mode 100644 index 0000000..1957da3 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/EvaluateSurvey.java @@ -0,0 +1,70 @@ +package com.xinelu.familydoctor.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 自评问卷表 + * @TableName evaluate_survey + */ +@Data +public class EvaluateSurvey implements Serializable { + /** + * 自增主键 + */ + private Long id; + + /** + * 问卷主题1001:高血压评估问卷,1002:糖尿病评估问卷,1003:脑卒中评估问卷,1004:慢阻肺评估问卷,1005:慢病评估问卷, + * 1006:糖尿病肾病评估问卷,1007:糖尿病眼病评估问卷,1008:糖尿病足病评估问卷 + */ + private String surveySubject; + + /** + * 问卷状态1:启用2:停用 + */ + private String useFlag; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 创建人 + */ + private Long createBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 更新人 + */ + private Long updateBy; + + /** + * 删除标识1:正常2:删除 + */ + private String delFlag; + + /** + * 备注 + */ + private String remark; + + private List questions; + + /** + * 请求参数 + */ + private Map params; + + private static final long serialVersionUID = 1L; +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateAdviceTemplateMapper.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateAdviceTemplateMapper.java new file mode 100644 index 0000000..437e255 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateAdviceTemplateMapper.java @@ -0,0 +1,23 @@ +package com.xinelu.familydoctor.mapper; + +import com.xinelu.familydoctor.entity.EvaluateAdviceTemplate; + +import java.util.List; + +/** +* @author gaoyu +* @description 针对表【evaluate_advice_template(自我评估健康处方模板表)】的数据库操作Mapper +* @createDate 2023-10-16 16:51:09 +* @Entity com.xinelu.familydoctor.entity.EvaluateAdviceTemplate +*/ +public interface EvaluateAdviceTemplateMapper { + + List findList(EvaluateAdviceTemplate record); + + EvaluateAdviceTemplate getTemplateByType(String templateType); + + int insert(EvaluateAdviceTemplate record); + + int update(EvaluateAdviceTemplate record); + +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateAnswerMapper.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateAnswerMapper.java new file mode 100644 index 0000000..32fe80b --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateAnswerMapper.java @@ -0,0 +1,21 @@ +package com.xinelu.familydoctor.mapper; + +import com.xinelu.familydoctor.entity.EvaluateAnswer; + +import java.util.List; + +/** +* @author gaoyu +* @description 针对表【evaluate_answer(自评问卷答案表)】的数据库操作Mapper +* @createDate 2023-10-11 09:51:39 +* @Entity com.xinelu.familydoctor.entity.EvaluateAnswer +*/ +public interface EvaluateAnswerMapper { + + List getAnswers(Long recordId); + + int insert(EvaluateAnswer record); + + int update(EvaluateAnswer recordId); + +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateOptionMapper.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateOptionMapper.java new file mode 100644 index 0000000..91d8cab --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateOptionMapper.java @@ -0,0 +1,32 @@ +package com.xinelu.familydoctor.mapper; + +import com.xinelu.familydoctor.entity.EvaluateOption; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** +* @author gaoyu +* @description 针对表【evaluate_option(自评问题选项表)】的数据库操作Mapper +* @createDate 2023-10-11 09:51:26 +* @Entity com.xinelu.familydoctor.entity.EvaluateOption +*/ +public interface EvaluateOptionMapper { + + List getOptions(Long questionId); + + int insert(EvaluateOption record); + + int update(EvaluateOption record); + + /** + * 清空问卷ID与wentiID + * @param questionId 问题ID + * @param surveyId 问卷ID + * @return {@link int} + * @author gaoyu + * @date 2023-10-11 17:31 + */ + int clearRelationId(@Param("questionId") Long questionId, @Param("surveyId") Long surveyId); + +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateQuestionMapper.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateQuestionMapper.java new file mode 100644 index 0000000..9e7a224 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateQuestionMapper.java @@ -0,0 +1,31 @@ +package com.xinelu.familydoctor.mapper; + +import com.xinelu.familydoctor.entity.EvaluateQuestion; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** +* @author gaoyu +* @description 针对表【evaluate_question(自评问题表)】的数据库操作Mapper +* @createDate 2023-10-11 09:51:20 +* @Entity com.xinelu.familydoctor.entity.EvaluateQuestion +*/ +public interface EvaluateQuestionMapper { + + List getQuestions(Long surveyId); + + int insert(EvaluateQuestion record); + + int update(EvaluateQuestion record); + + /** + * 清空问卷ID + * @param surveyId 问卷ID + * @return {@link int} + * @author gaoyu + * @date 2023-10-11 17:33 + */ + int clearSurveyId(@Param("surveyId") Long surveyId); + +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateRecordMapper.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateRecordMapper.java new file mode 100644 index 0000000..60c666f --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateRecordMapper.java @@ -0,0 +1,19 @@ +package com.xinelu.familydoctor.mapper; + +import com.xinelu.familydoctor.entity.EvaluateRecord; + +import java.util.List; + +/** +* @author gaoyu +* @description 针对表【evaluate_record(自评记录表)】的数据库操作Mapper +* @createDate 2023-10-11 09:51:34 +* @Entity com.xinelu.familydoctor.entity.EvaluateRecord +*/ +public interface EvaluateRecordMapper { + + List getTimeline(Long userId); + + int insert(EvaluateRecord record); + +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateSurveyMapper.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateSurveyMapper.java new file mode 100644 index 0000000..fa84949 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/EvaluateSurveyMapper.java @@ -0,0 +1,30 @@ +package com.xinelu.familydoctor.mapper; + +import com.xinelu.familydoctor.entity.EvaluateSurvey; + +import java.util.List; + +/** +* @author gaoyu +* @description 针对表【evaluate_survey(自评问卷表)】的数据库操作Mapper +* @createDate 2023-10-11 09:51:11 +* @Entity com.xinelu.familydoctor.entity.EvaluateSurvey +*/ +public interface EvaluateSurveyMapper { + + List findList(EvaluateSurvey entity); + + /** + * 获取问卷 + * @param surveySubject 问卷主题 + * @return {@link com.xinelu.familydoctor.entity.EvaluateSurvey} + * @author gaoyu + * @date 2023-10-12 17:22 + */ + EvaluateSurvey getSurvey(String surveySubject); + + int insert(EvaluateSurvey record); + + int update(EvaluateSurvey record); + +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateAdviceTemplateService.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateAdviceTemplateService.java new file mode 100644 index 0000000..edd279d --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateAdviceTemplateService.java @@ -0,0 +1,13 @@ +package com.xinelu.familydoctor.service; + +import com.xinelu.familydoctor.entity.EvaluateAdviceTemplate; + +import java.util.List; + +public interface EvaluateAdviceTemplateService { + List findList(EvaluateAdviceTemplate entity); + EvaluateAdviceTemplate getTemplate(String templateType); + void save(EvaluateAdviceTemplate entity); + void changeStatus(EvaluateAdviceTemplate entity); + void delTemplate(Long id); +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateRecordService.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateRecordService.java new file mode 100644 index 0000000..0009b70 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateRecordService.java @@ -0,0 +1,15 @@ +package com.xinelu.familydoctor.service; + +import com.xinelu.familydoctor.entity.EvaluateAnswer; +import com.xinelu.familydoctor.entity.EvaluateRecord; +import com.xinelu.familydoctor.vo.EvaluateRecordTimelineVO; + +import java.util.List; + +public interface EvaluateRecordService { + void submit(EvaluateRecord entity); + + List getEvaluateTimeline(Long userId); + + List getAnswers(Long recordId); +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateSurveyService.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateSurveyService.java new file mode 100644 index 0000000..00c4ef1 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/EvaluateSurveyService.java @@ -0,0 +1,22 @@ +package com.xinelu.familydoctor.service; + +import com.xinelu.familydoctor.entity.EvaluateSurvey; + +import java.util.List; + +public interface EvaluateSurveyService { + List findList(EvaluateSurvey entity); + + /** + * 获取问卷 + * @param surveySubject 问卷主题 + * @return {@link com.xinelu.familydoctor.entity.EvaluateSurvey} + * @author gaoyu + * @date 2023-10-12 17:23 + */ + EvaluateSurvey getSurvey(String surveySubject); + + void insert(EvaluateSurvey entity); + + void update(EvaluateSurvey entity); +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateAdviceTemplateServiceImpl.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateAdviceTemplateServiceImpl.java new file mode 100644 index 0000000..6b0b1d7 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateAdviceTemplateServiceImpl.java @@ -0,0 +1,63 @@ +package com.xinelu.familydoctor.service.impl; + +import com.xinelu.common.utils.SecurityUtils; +import com.xinelu.familydoctor.entity.EvaluateAdviceTemplate; +import com.xinelu.familydoctor.mapper.EvaluateAdviceTemplateMapper; +import com.xinelu.familydoctor.service.EvaluateAdviceTemplateService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @author gaoyu + * @description 自我评估处方模板实现类 + * @date 2023-10-16 16:58 + */ +@Service +public class EvaluateAdviceTemplateServiceImpl implements EvaluateAdviceTemplateService { + @Resource + private EvaluateAdviceTemplateMapper evaluateAdviceTemplateMapper; + + @Override + public List findList(EvaluateAdviceTemplate entity) { + return evaluateAdviceTemplateMapper.findList(entity); + } + + @Override + public EvaluateAdviceTemplate getTemplate(String templateType) { + return evaluateAdviceTemplateMapper.getTemplateByType(templateType); + } + + @Override + public void save(EvaluateAdviceTemplate entity) { + if (entity.getId() == null) { + entity.setCreateTime(new Date()); + entity.setCreateBy(SecurityUtils.getUserId()); + entity.setDelFlag("1"); + evaluateAdviceTemplateMapper.insert(entity); + } else { + entity.setUpdateBy(SecurityUtils.getUserId()); + entity.setUpdateTime(new Date()); + evaluateAdviceTemplateMapper.update(entity); + } + } + + @Override + public void changeStatus(EvaluateAdviceTemplate entity) { + entity.setUpdateBy(SecurityUtils.getUserId()); + entity.setUpdateTime(new Date()); + evaluateAdviceTemplateMapper.update(entity); + } + + @Override + public void delTemplate(Long id) { + EvaluateAdviceTemplate entity = new EvaluateAdviceTemplate(); + entity.setId(id); + entity.setDelFlag("2"); + entity.setUpdateBy(SecurityUtils.getUserId()); + entity.setUpdateTime(new Date()); + evaluateAdviceTemplateMapper.update(entity); + } +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateRecordServiceImpl.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateRecordServiceImpl.java new file mode 100644 index 0000000..16e098c --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateRecordServiceImpl.java @@ -0,0 +1,79 @@ +package com.xinelu.familydoctor.service.impl; + +import com.xinelu.common.utils.DateUtils; +import com.xinelu.familydoctor.entity.EvaluateAnswer; +import com.xinelu.familydoctor.entity.EvaluateRecord; +import com.xinelu.familydoctor.mapper.EvaluateAnswerMapper; +import com.xinelu.familydoctor.mapper.EvaluateRecordMapper; +import com.xinelu.familydoctor.service.EvaluateRecordService; +import com.xinelu.familydoctor.vo.EvaluateRecordResultVO; +import com.xinelu.familydoctor.vo.EvaluateRecordTimelineVO; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @author gaoyu + * @description 自评记录 + * @date 2023-10-16 9:23 + */ +@Service +public class EvaluateRecordServiceImpl implements EvaluateRecordService { + @Resource + private EvaluateRecordMapper evaluateRecordMapper; + @Resource + private EvaluateAnswerMapper evaluateAnswerMapper; + + @Override + public void submit(EvaluateRecord entity) { + entity.setCreateTime(new Date()); + evaluateRecordMapper.insert(entity); + List answers = entity.getAnswers(); + if (CollectionUtils.isEmpty(answers)) { + for (EvaluateAnswer answer : answers) { + answer.setRecordId(entity.getId()); + evaluateAnswerMapper.insert(answer); + } + } + } + + @Override + public List getEvaluateTimeline(Long userId) { + List records = evaluateRecordMapper.getTimeline(userId); + List timeline = new ArrayList<>(); + Map> map = new HashMap<>(); + if (!CollectionUtils.isEmpty(records)) { + records.forEach(r -> { + List resultList; + if (!map.containsKey(DateUtils.formatDate(r.getCreateTime(), "yyyy-MM-dd"))) { + resultList = new ArrayList<>(); + } else { + resultList = map.get(DateUtils.formatDate(r.getCreateTime(), "yyyy-MM-dd")); + } + EvaluateRecordResultVO resultVO = new EvaluateRecordResultVO(); + resultVO.setRecordId(r.getId()); + resultVO.setEvaluateResult(r.getEvaluateResult()); + resultVO.setSurveySubject(r.getSurveySubject()); + resultVO.setAdvice(r.getAdvice()); + resultVO.setTime(DateUtils.formatDate(r.getCreateTime(), "HH:mm:ss")); + resultVO.setDate(DateUtils.formatDate(r.getCreateTime(), "yyyy-MM-dd")); + resultList.add(resultVO); + map.put(DateUtils.formatDate(r.getCreateTime(), "yyyy-MM-dd"), resultList); + }); + map.forEach((k, v) -> { + EvaluateRecordTimelineVO recordLine = new EvaluateRecordTimelineVO(); + recordLine.setDate(k); + recordLine.setRecords(v); + timeline.add(recordLine); + }); + } + return timeline; + } + + @Override + public List getAnswers(Long recordId) { + return evaluateAnswerMapper.getAnswers(recordId); + } +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateSurveyServiceImpl.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateSurveyServiceImpl.java new file mode 100644 index 0000000..b3bd420 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateSurveyServiceImpl.java @@ -0,0 +1,106 @@ +package com.xinelu.familydoctor.service.impl; + +import com.xinelu.common.utils.SecurityUtils; +import com.xinelu.familydoctor.entity.EvaluateOption; +import com.xinelu.familydoctor.entity.EvaluateQuestion; +import com.xinelu.familydoctor.entity.EvaluateSurvey; +import com.xinelu.familydoctor.mapper.EvaluateOptionMapper; +import com.xinelu.familydoctor.mapper.EvaluateQuestionMapper; +import com.xinelu.familydoctor.mapper.EvaluateSurveyMapper; +import com.xinelu.familydoctor.service.EvaluateSurveyService; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * @author gaoyu + * @description 自评问卷业务实现类 + * @date 2023-10-11 13:24 + */ +@Service +public class EvaluateSurveyServiceImpl implements EvaluateSurveyService { + @Resource + private EvaluateSurveyMapper evaluateSurveyMapper; + @Resource + private EvaluateQuestionMapper evaluateQuestionMapper; + @Resource + private EvaluateOptionMapper evaluateOptionMapper; + + @Override + public List findList(EvaluateSurvey entity) { + return evaluateSurveyMapper.findList(entity); + } + + @Override + public EvaluateSurvey getSurvey(String surveySubject) { + return evaluateSurveyMapper.getSurvey(surveySubject); + } + + @Override + public void insert(EvaluateSurvey entity) { + entity.setCreateBy(SecurityUtils.getUserId()); + entity.setCreateTime(new Date()); + entity.setDelFlag("1"); + int row = evaluateSurveyMapper.insert(entity); + if (row > 0) { + List questions = entity.getQuestions(); + if (!CollectionUtils.isEmpty(questions)) { + for (EvaluateQuestion question : questions) { + question.setSurveyId(entity.getId()); + row = evaluateQuestionMapper.insert(question); + if (row > 0) { + List options = question.getOptions(); + if (!CollectionUtils.isEmpty(options)) { + for (EvaluateOption option : options) { + option.setSurveyId(entity.getId()); + option.setQuestionId(question.getId()); + evaluateOptionMapper.insert(option); + } + } + } + } + } + } + } + + @Override + public void update(EvaluateSurvey entity) { + entity.setUpdateBy(SecurityUtils.getUserId()); + entity.setUpdateTime(new Date()); + entity.setDelFlag("1"); + int row = evaluateSurveyMapper.update(entity); + if (row > 0) { + List questions = entity.getQuestions(); + if (!CollectionUtils.isEmpty(questions)) { + evaluateQuestionMapper.clearSurveyId(entity.getId()); + for (EvaluateQuestion question : questions) { + question.setSurveyId(entity.getId()); + if (Objects.isNull(question.getId())) { + row = evaluateQuestionMapper.insert(question); + } else { + row = evaluateQuestionMapper.update(question); + } + if (row > 0) { + List options = question.getOptions(); + if (!CollectionUtils.isEmpty(options)) { + evaluateOptionMapper.clearRelationId(question.getId(), entity.getId()); + for (EvaluateOption option : options) { + option.setSurveyId(entity.getId()); + option.setQuestionId(question.getId()); + if (Objects.isNull(option.getId())) { + evaluateOptionMapper.insert(option); + } else { + evaluateOptionMapper.update(option); + } + } + } + } + } + } + } + } +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/EvaluateRecordResultVO.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/EvaluateRecordResultVO.java new file mode 100644 index 0000000..b24ab3b --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/EvaluateRecordResultVO.java @@ -0,0 +1,20 @@ +package com.xinelu.familydoctor.vo; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +/** + * @author gaoyu + * @description 自评记录结果视图 + * @date 2023-10-16 11:38 + */ +@ApiModel("自评记录结果视图") +@Data +public class EvaluateRecordResultVO { + private Long recordId; + private String surveySubject; + private String evaluateResult; + private String advice; + private String time; + private String date; +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/EvaluateRecordTimelineVO.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/EvaluateRecordTimelineVO.java new file mode 100644 index 0000000..ec64ae6 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/EvaluateRecordTimelineVO.java @@ -0,0 +1,18 @@ +package com.xinelu.familydoctor.vo; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.util.List; + +/** + * @author gaoyu + * @description 评估记录时间轴视图 + * @date 2023-10-16 11:30 + */ +@ApiModel("评估记录时间轴视图") +@Data +public class EvaluateRecordTimelineVO { + private String date; + private List records; +} diff --git a/xinelu-familydoctor/src/main/resources/mapper/EvaluateAdviceTemplateMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/EvaluateAdviceTemplateMapper.xml new file mode 100644 index 0000000..6f025ad --- /dev/null +++ b/xinelu-familydoctor/src/main/resources/mapper/EvaluateAdviceTemplateMapper.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + id,template_type,content, + use_flag,create_time,create_by, + update_time,update_by,remark, + del_flag + + + + + + + + insert into evaluate_advice_template + ( id,template_type,content + ,use_flag,create_time,create_by + ,update_time,update_by,remark + ,del_flag) + values (#{id,jdbcType=BIGINT},#{templateType,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR} + ,#{useFlag,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{createBy,jdbcType=BIGINT} + ,#{updateTime,jdbcType=TIMESTAMP},#{updateBy,jdbcType=BIGINT},#{remark,jdbcType=VARCHAR} + ,#{delFlag,jdbcType=VARCHAR}) + + + update evaluate_advice_template + + + template_type = #{templateType,jdbcType=VARCHAR}, + + + content = #{content,jdbcType=VARCHAR}, + + + use_flag = #{useFlag,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + create_by = #{createBy,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + update_by = #{updateBy,jdbcType=BIGINT}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + del_flag = #{delFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + diff --git a/xinelu-familydoctor/src/main/resources/mapper/EvaluateAnswerMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/EvaluateAnswerMapper.xml new file mode 100644 index 0000000..0289279 --- /dev/null +++ b/xinelu-familydoctor/src/main/resources/mapper/EvaluateAnswerMapper.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + id,record_id,question_id, + option_id,option_content + + + + + + insert into evaluate_answer + (record_id,question_id + ,option_id,option_content) + values (#{recordId,jdbcType=BIGINT},#{questionId,jdbcType=BIGINT} + ,#{optionId,jdbcType=BIGINT},#{optionContent,jdbcType=VARCHAR}) + + + update evaluate_answer + + + record_id = #{recordId,jdbcType=BIGINT}, + + + question_id = #{questionId,jdbcType=BIGINT}, + + + option_id = #{optionId,jdbcType=BIGINT}, + + + option_content = #{optionContent,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + diff --git a/xinelu-familydoctor/src/main/resources/mapper/EvaluateOptionMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/EvaluateOptionMapper.xml new file mode 100644 index 0000000..2a6d823 --- /dev/null +++ b/xinelu-familydoctor/src/main/resources/mapper/EvaluateOptionMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + id,question_id,survey_id, + option_name,option_sort + + + + + + insert into evaluate_option + (question_id,survey_id + ,option_name,option_sort) + values (#{questionId,jdbcType=BIGINT},#{surveyId,jdbcType=BIGINT} + ,#{optionName,jdbcType=VARCHAR},#{optionSort,jdbcType=INTEGER}) + + + update evaluate_option + + + question_id = #{questionId,jdbcType=BIGINT}, + + + survey_id = #{surveyId,jdbcType=BIGINT}, + + + option_name = #{optionName,jdbcType=VARCHAR}, + + + option_sort = #{optionSort,jdbcType=INTEGER}, + + + where id = #{id,jdbcType=BIGINT} + + + + update evaluate_option set question_id = null, survey_id = null + where question_id = #{questionId,jdbcType=BIGINT} and survey_id = #{surveyId,jdbcType=BIGINT} + + diff --git a/xinelu-familydoctor/src/main/resources/mapper/EvaluateQuestionMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/EvaluateQuestionMapper.xml new file mode 100644 index 0000000..e6c5a5b --- /dev/null +++ b/xinelu-familydoctor/src/main/resources/mapper/EvaluateQuestionMapper.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + t1.id,t1.survey_id,t1.question_name, + t1.question_type,t1.question_sort,t1.required_flag + + + + + + insert into evaluate_question + (survey_id,question_name + ,question_type,question_sort,required_flag) + values (#{surveyId,jdbcType=BIGINT},#{questionName,jdbcType=VARCHAR} + ,#{questionType,jdbcType=VARCHAR},#{questionSort,jdbcType=INTEGER},#{requiredFlag,jdbcType=VARCHAR}) + + + update evaluate_question + + + survey_id = #{surveyId,jdbcType=BIGINT}, + + + question_name = #{questionName,jdbcType=VARCHAR}, + + + question_type = #{questionType,jdbcType=VARCHAR}, + + + question_sort = #{questionSort,jdbcType=INTEGER}, + + + required_flag = #{requiredFlag,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + + update evaluate_question set survey_id = null where survey_id = #{surveyId,jdbcType=BIGINT} + + diff --git a/xinelu-familydoctor/src/main/resources/mapper/EvaluateRecordMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/EvaluateRecordMapper.xml new file mode 100644 index 0000000..2bfab9d --- /dev/null +++ b/xinelu-familydoctor/src/main/resources/mapper/EvaluateRecordMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + id,user_id,survey_id,survey_subject, + evaluate_result,advice,create_time + + + + + + insert into evaluate_record + (user_id,survey_id,survey_subject + ,evaluate_result,advice,create_time + ) + values (#{userId,jdbcType=BIGINT},#{surveyId,jdbcType=BIGINT},#{surveySubject,jdbcType=VARCHAR} + ,#{evaluateResult,jdbcType=VARCHAR},#{advice,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP} + ) + + diff --git a/xinelu-familydoctor/src/main/resources/mapper/EvaluateSurveyMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/EvaluateSurveyMapper.xml new file mode 100644 index 0000000..f7aad1a --- /dev/null +++ b/xinelu-familydoctor/src/main/resources/mapper/EvaluateSurveyMapper.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + id,survey_name,use_flag, + create_time,create_by,update_time, + update_by,del_flag,remark + + + + + + + + insert into evaluate_survey + (survey_subject,use_flag + ,create_time,create_by,update_time + ,update_by,del_flag,remark + ) + values (#{surveySubject,jdbcType=VARCHAR},#{useFlag,jdbcType=VARCHAR} + ,#{createTime,jdbcType=TIMESTAMP},#{createBy,jdbcType=BIGINT},#{updateTime,jdbcType=TIMESTAMP} + ,#{updateBy,jdbcType=BIGINT},#{delFlag,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR} + ) + + + update evaluate_survey + + + survey_subject = #{surveySubject,jdbcType=VARCHAR}, + + + use_flag = #{useFlag,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + create_by = #{createBy,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + update_by = #{updateBy,jdbcType=BIGINT}, + + + del_flag = #{delFlag,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + From 1002c6c2fc34e9a2c6fd8e126f711630139ca75f Mon Sep 17 00:00:00 2001 From: mengkuiliang <1464081137@qq.com> Date: Wed, 18 Oct 2023 17:33:58 +0800 Subject: [PATCH 03/15] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E8=AF=84=E4=BB=B7=E6=8E=A5=E5=8F=A3=EF=BC=9B=202?= =?UTF-8?q?=E3=80=81=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E8=AF=84=E4=BB=B7=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=EF=BC=9B?= =?UTF-8?q?=203=E3=80=81=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF=E8=A1=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AD=BE=E7=BA=A6=E7=BC=96=E5=8F=B7=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applet/ResidentPatientInfoController.java | 1 + .../ResidentServiceApplyController.java | 42 +++++++++++--- .../common/config/AppletChatConfig.java | 16 ++++++ .../xinelu/common/enums/RegionKeyType.java | 2 +- .../applet/pojo/body/MessagePushBody.java | 49 ++++++++++++++++ .../applet/pojo/body/PatientInfoBody.java | 5 ++ .../applet/pojo/entity/PatientInfo.java | 6 ++ .../applet/pojo/vo/OrderEvaluateVo.java | 56 +++++++++++++++++++ .../impl/ResidentPatientInfoServiceImpl.java | 33 ++++++++++- .../register/ResidentPatientInfoMapper.xml | 16 +++++- .../Impl/MessagePushServiceImpl.java | 47 ++++++++++++++++ .../messagepush/MessagePushService.java | 10 ++++ .../OrderEvaluateInfoController.java | 4 +- .../orderevaluateinfo/OrderEvaluateInfo.java | 7 --- .../OrderEvaluateInfoMapper.java | 2 +- .../IOrderEvaluateInfoService.java | 2 +- .../impl/OrderEvaluateInfoServiceImpl.java | 6 +- .../OrderEvaluateInfoMapper.xml | 13 +---- 18 files changed, 279 insertions(+), 38 deletions(-) create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/MessagePushBody.java create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/OrderEvaluateVo.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 70f2fa7..e57d9bf 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 @@ -54,6 +54,7 @@ public class ResidentPatientInfoController extends BaseController { residentPatientInfoService.register(body); return R.ok(); } catch (Exception e) { + e.printStackTrace(); return R.fail(e.getMessage()); } } 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 d7cd75a..5f2ac67 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 @@ -12,9 +12,7 @@ import com.xinelu.familydoctor.applet.pojo.body.ResidentServiceApplyBody; import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo; import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery; import com.xinelu.familydoctor.applet.pojo.query.ServiceRecordQuery; -import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo; -import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceRecordVo; -import com.xinelu.familydoctor.applet.pojo.vo.ScreeningProjectVo; +import com.xinelu.familydoctor.applet.pojo.vo.*; import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService; import com.xinelu.familydoctor.applet.service.IResidentServiceAppletService; import com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo; @@ -100,11 +98,11 @@ public class ResidentServiceApplyController extends BaseController { @GetMapping("/record/{identity}") public R> performanceBookingRecord(@PathVariable String identity, ServiceRecordQuery query, @RequestHeader("region") String region) { query.setIdentity(identity); - if(query.getPageNum() == null) { + if (query.getPageNum() == null) { query.setPageNum(1); } - if(query.getPageSize() == null) { - query.setPageSize(100); + if (query.getPageSize() == null) { + query.setPageSize(1000); } JSONObject result = httpService.post(SpringUtils.getFdUrl(region) + "/performance/recordV1", null, JSONObject.parseObject(JSONObject.toJSONString(query))); if (result.get("code").toString().equals("0")) { @@ -118,7 +116,7 @@ public class ResidentServiceApplyController extends BaseController { if (list != null && list.size() > 0) { List orderEvaluateInfoTempList; for (ResidentServiceRecordVo record : perRecordList) { - orderEvaluateInfoTempList = list.stream().filter(o -> o.getServiceCode().equals(record.getPerformanceNo())).collect(Collectors.toList()); + orderEvaluateInfoTempList = list.stream().filter(o -> o.getOrderNo().equals(record.getPerformanceNo())).collect(Collectors.toList()); if (orderEvaluateInfoTempList.size() > 0) { record.setOrderEvaluateInfo(orderEvaluateInfoTempList.get(0)); } @@ -129,4 +127,34 @@ public class ResidentServiceApplyController extends BaseController { } return R.ok(); } + + @ApiOperation("获取服务记录详情") + @GetMapping("/serviceRecordDetail/{identity}/{performanceNo}") + public R serviceRecordDetail(@PathVariable String identity, @PathVariable String performanceNo, @RequestHeader("region") String region) { + String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/performance/detail/" + identity + "/" + performanceNo, null, String.class); + JSONObject jsonObject = JSONObject.parseObject(result); + if (jsonObject.getInteger("code") != 1) { + throw new ServiceException(jsonObject.getString("msg")); + } + if (jsonObject.get("data") != null) { + return R.ok(JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), ResidentServiceRecordVo.class)); + } + return R.ok(); + } + + @ApiOperation("服务评价列表") + @GetMapping("/evaluateRecord/{identity}") + public R> performanceEvaluateRecord(@PathVariable String identity) { + PatientInfo patientInfo = residentPatientInfoService.getByCardNo(identity); + if (patientInfo != null && !StringUtils.isBlank(patientInfo.getCityCode())) { + String result = (String) httpService.get(SpringUtils.getFdUrl(patientInfo.getCityCode()) + "/performance/recordV2/" + identity, null, String.class); + JSONObject jsonObject = JSONObject.parseObject(result); + if (jsonObject.getInteger("code") == 1) { + if (jsonObject.get("data") != null && jsonObject.getJSONArray("data").size() > 0) { + return R.ok(JSONArray.parseArray(jsonObject.getJSONArray("data").toJSONString()).toJavaList(OrderEvaluateVo.class)); + } + } + } + return R.ok(); + } } diff --git a/xinelu-common/src/main/java/com/xinelu/common/config/AppletChatConfig.java b/xinelu-common/src/main/java/com/xinelu/common/config/AppletChatConfig.java index d2c2b96..5ff0de3 100644 --- a/xinelu-common/src/main/java/com/xinelu/common/config/AppletChatConfig.java +++ b/xinelu-common/src/main/java/com/xinelu/common/config/AppletChatConfig.java @@ -64,4 +64,20 @@ public class AppletChatConfig { * 签到通知模板 */ private String signTemplateId; + + /** + * 家庭医生消息通知默认模版 + */ + private String fdMessageDefaultTempId; + + /** + * 家庭医生预约成功通知模版 + */ + private String fdMessageApplyTempId; + + /** + * 家庭医生用药提醒通知模版 + */ + private String fdMessageMedicineTempId; + } 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 3aecc6a..acaae97 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 @@ -35,6 +35,6 @@ public enum RegionKeyType { return uploadType; } } - throw new ServiceException("获取区域配置出错"); + throw new ServiceException("未查询到区域配置"); } } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/MessagePushBody.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/MessagePushBody.java new file mode 100644 index 0000000..52ccda4 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/MessagePushBody.java @@ -0,0 +1,49 @@ +package com.xinelu.familydoctor.applet.pojo.body; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author mengkuiliang + * @Description 消息推送请求对象 + * @Date 2023-10-18 018 14:26 + * @Param + * @return + **/ +@Data +@ApiModel(value = "消息推送请求对象") +public class MessagePushBody { + + /** + * 业务类型(1: 预约申请通知 2: 审批结果通知 3:用药提醒通知) + */ + @ApiModelProperty(value = "务类型(1: 预约申请通知 2: 审批结果通知 3:用药提醒通知)") + private String busType; + + /** + * openid + */ + @ApiModelProperty(value = "openid") + private String openid; + + /** + * 发送人 + */ + @ApiModelProperty(value = "发送人") + private String senderName; + + /** + * 发送标题 + */ + @ApiModelProperty(value = "发送标题") + private String sendTitle; + + /** + * 发送时间(yyyy-MM-dd HH:mm:ss) + */ + @ApiModelProperty(value = "发送时间(yyyy-MM-dd HH:mm:ss)") + private String sendTime; + + +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/PatientInfoBody.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/PatientInfoBody.java index 2eb55bb..1b23687 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/PatientInfoBody.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/PatientInfoBody.java @@ -262,4 +262,9 @@ public class PatientInfoBody extends BaseEntity { @ApiModelProperty(value = "户主身份证号") private String householdCardNo; + /** + * 签约编号 + */ + @ApiModelProperty(value = "签约编号") + private String signNo; } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/entity/PatientInfo.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/entity/PatientInfo.java index 4c013f0..c73c8ca 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/entity/PatientInfo.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/entity/PatientInfo.java @@ -300,6 +300,12 @@ public class PatientInfo extends BaseEntity { @ApiModelProperty(value = "户主身份证号") private String householdCardNo; + /** + * 签约编号 + */ + @ApiModelProperty(value = "签约编号") + private String signNo; + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/OrderEvaluateVo.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/OrderEvaluateVo.java new file mode 100644 index 0000000..9369245 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/OrderEvaluateVo.java @@ -0,0 +1,56 @@ +package com.xinelu.familydoctor.applet.pojo.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author mengkuiliang + * @Description 履约记录-小程序评价列表展示类 + * @Date 2023-10-18 16:43 + * @Param + * @return + **/ +@ApiModel("履约记录-小程序评价列表展示类") +@Data +public class OrderEvaluateVo { + + /** + * 居民身份证号 + */ + @ApiModelProperty(value = "居民身份证号") + private String cardNo; + + /** + * 订单编号 + */ + @ApiModelProperty(value = "订单编号") + private String orderNo; + + /** + * 订单状态 + */ + @ApiModelProperty(value = "订单状态") + private String orderStatus; + + /** + * 订单名称 + */ + @ApiModelProperty(value = "订单名称") + private String orderName; + + /** + * 订单类型 + */ + @ApiModelProperty(value = "订单类型") + private String orderType; + + /** + * 下单时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiModelProperty(value = "下单时间") + private String createTime; + +} 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 b0c3424..a8db06a 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 @@ -6,16 +6,19 @@ 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.R; import com.xinelu.common.entity.AppletPhoneVO; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.http.HttpService; import com.xinelu.common.utils.http.HttpUtils; import com.xinelu.common.utils.http.SslUtils; +import com.xinelu.common.utils.spring.SpringUtils; import com.xinelu.common.utils.uuid.IdUtils; import com.xinelu.familydoctor.applet.mapper.ResidentPatientInfoMapper; import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody; import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo; +import com.xinelu.familydoctor.applet.pojo.vo.SignInfoDetailVo; import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService; import com.xinelu.familydoctor.applet.utils.AppletAccessTokenUtils; import lombok.extern.slf4j.Slf4j; @@ -161,12 +164,13 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi patientInfo.setDisease("0"); } patientInfo.setLoginFlag(Long.valueOf(1)); + patientInfo.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo())); updatePatientInfo(patientInfo); - // 注册 } + // 注册 } else { // 获取当前微信绑定的居民 - List list = residentPatientInfoMapper.getList(body.getOpenid(), body.getCityCode()); + List list = residentPatientInfoMapper.getList(body.getOpenid(), null); PatientInfo patientInfo = residentPatientInfoMapper.isRegisterByCardNo(body.getCardNo()); if (patientInfo == null) { PatientInfo entity = new PatientInfo(); @@ -182,6 +186,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi entity.setCreateTime(new Date()); entity.setCreateBy(body.getCardNo()); entity.setLoginFlag(Long.valueOf(1)); + entity.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo())); residentPatientInfoMapper.insertPatientInfo(entity); } else { if (!StringUtils.isBlank(patientInfo.getOpenid())) { @@ -203,12 +208,36 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi } else { patientInfo.setDisease("0"); } + patientInfo.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo())); residentPatientInfoMapper.updatePatientInfo(patientInfo); } } + } } + // 获取签约信息 + private String getSignInfo(String region, String identity) { + if(!StringUtils.isBlank(region)) { + try { + // 查询签约信息 + String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/resident/signinfo/detail/" + identity, null, String.class); + JSONObject jsonObject = JSONObject.parseObject(result); + if ("1".equals(jsonObject.get("code"))) { + if(jsonObject.getJSONObject("data") != null) { + SignInfoDetailVo signInfo = JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), SignInfoDetailVo.class); + if(signInfo != null) { + return signInfo.getSignNo(); + } + } + } + } catch (Exception e) { + log.error("注册完善信息-更新签约标识出错:{}", e.getMessage()); + } + } + return null; + } + /** * @return void * @Author mengkuiliang diff --git a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml index e06f9b6..31960eb 100644 --- a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml +++ b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml @@ -47,7 +47,7 @@ - + @@ -92,7 +92,8 @@ binding_time, is_checked, household_relationship, - household_card_no + household_card_no, + sign_no from patient_info @@ -221,6 +222,9 @@ household_card_no, + + sign_no, + #{areaCode}, @@ -306,6 +310,9 @@ #{householdCardNo}, + + #{signNo}, + @@ -429,9 +436,12 @@ household_relationship = #{householdRelationship}, - + household_card_no = #{householdCardNo}, + + sign_no = #{signNo}, + where patient_code = #{patientCode} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/Impl/MessagePushServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/Impl/MessagePushServiceImpl.java index 2647526..ddbd284 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/Impl/MessagePushServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/Impl/MessagePushServiceImpl.java @@ -1,6 +1,7 @@ package com.xinelu.applet.service.messagepush.Impl; import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; import com.xinelu.applet.service.messagepush.MessagePushService; import com.xinelu.common.config.AppletChatConfig; import com.xinelu.common.config.AppletPageConfig; @@ -218,4 +219,50 @@ public class MessagePushServiceImpl implements MessagePushService { } } } + + /** + * @return void + * @Author mengkuiliang + * @Description 家医申请审批结果消息推送 + * @Date 2023-10-18 018 14:03 + * @Param [appletAccessToken, paramsMap, busType] + **/ + @Override + public void fdApprovePush(JSONObject body) { + AppletAccessToken appletAccessToken = AppletChatUtil.getAppletAccessToken(appletChatConfig.getAppletId(), appletChatConfig.getSecret()); + if (Objects.isNull(appletAccessToken)) { + log.error("获取微信小程序accessToken信息失败!"); + } + if (Objects.nonNull(appletAccessToken.getErrcode()) && appletAccessToken.getErrcode() != AppletSubscriptionMessageEnum.SUCCESS_ERRCODE.getValue()) { + log.error("获取微信小程序accessToken信息失败,失败信息为:" + appletAccessToken.getErrmsg(), 201); + } + if (StringUtils.isBlank(appletAccessToken.getAccessToken())) { + log.error("accessToken信息为空!"); + } + + String tempId = ""; + switch (body.getString("1")) { + // 申请 + case "2": + tempId = appletChatConfig.getFdMessageApplyTempId(); + // 用药 + case "3": + tempId = appletChatConfig.getFdMessageMedicineTempId(); + // 默认 + default: + tempId = appletChatConfig.getFdMessageDefaultTempId(); + } + + Map paramsMap = new HashMap<>(); + paramsMap.put("touser", body.getString("openid")); + paramsMap.put("template_id", tempId); + paramsMap.put("page", appletPageConfig.getIntegralPageUrl()); + //模板内容 + Map messageValueEntityMap = new LinkedHashMap<>(); + messageValueEntityMap.put("thing1", new MessageValueEntity(body.getString("senderName"))); + messageValueEntityMap.put("time2", new MessageValueEntity(body.getString("sendTime"))); + messageValueEntityMap.put("thing3", new MessageValueEntity(body.getString("sendTitle"))); + //发送 + this.sendPosts(appletAccessToken, paramsMap); + } } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/MessagePushService.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/MessagePushService.java index 92f823b..ec50ca0 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/MessagePushService.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/MessagePushService.java @@ -1,6 +1,7 @@ package com.xinelu.applet.service.messagepush; +import com.alibaba.fastjson2.JSONObject; import com.xinelu.common.entity.AppletAccessToken; import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord; import com.xinelu.manage.vo.patientcouponreceive.PatientCouponReceiveInfoVO; @@ -38,4 +39,13 @@ public interface MessagePushService { * @param paramsMap 模板 **/ void sendPosts(AppletAccessToken appletAccessToken, Map paramsMap); + + /** + * @Author mengkuiliang + * @Description 家医申请审批结果消息推送 + * @Date 2023-10-18 018 13:58 + * @Param [appletAccessToken, paramsMap] + * @return void + **/ + void fdApprovePush(JSONObject body); } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/orderevaluateinfo/OrderEvaluateInfoController.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/orderevaluateinfo/OrderEvaluateInfoController.java index 1aa2d70..b4d5ca0 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/orderevaluateinfo/OrderEvaluateInfoController.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/orderevaluateinfo/OrderEvaluateInfoController.java @@ -62,7 +62,7 @@ public class OrderEvaluateInfoController extends BaseController { /** * 新增预约服务订单和商品订单评价信息 */ - @PreAuthorize("@ss.hasPermi('system:orderEvaluateInfo:add')") +// @PreAuthorize("@ss.hasPermi('system:orderEvaluateInfo:add')") @Log(title = "预约服务订单和商品订单评价信息", businessType = BusinessType.INSERT) @PostMapping("add") public AjaxResult add(@RequestBody OrderEvaluateInfo orderEvaluateInfo) { @@ -88,4 +88,4 @@ public class OrderEvaluateInfoController extends BaseController { public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(orderEvaluateInfoService.deleteOrderEvaluateInfoByIds(ids)); } -} \ No newline at end of file +} diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/orderevaluateinfo/OrderEvaluateInfo.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/orderevaluateinfo/OrderEvaluateInfo.java index 143825a..1923f9c 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/orderevaluateinfo/OrderEvaluateInfo.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/orderevaluateinfo/OrderEvaluateInfo.java @@ -65,13 +65,6 @@ public class OrderEvaluateInfo extends BaseDomain implements Serializable { @NotBlank(message = "请选择订单编号", groups = {Insert.class}) private String orderNo; - /** - * 服务编号 - */ - @ApiModelProperty(value = "服务编号") - @Excel(name = "服务编号") - private String serviceCode; - /** * 评价内容 */ diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/orderevaluateinfo/OrderEvaluateInfoMapper.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/orderevaluateinfo/OrderEvaluateInfoMapper.java index 2c78ccc..248c13b 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/orderevaluateinfo/OrderEvaluateInfoMapper.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/orderevaluateinfo/OrderEvaluateInfoMapper.java @@ -70,5 +70,5 @@ public interface OrderEvaluateInfoMapper { * @Param [serviceNoList] * @return java.util.List **/ - List selectOrderEvaluateByServiceNos(@Param("serviceNoList") List serviceNoList, @Param("orderSource") String orderSource); + List selectOrderEvaluateByServiceNos(@Param("orderNoList") List orderNoList, @Param("orderSource") String orderSource); } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/orderevaluateinfo/IOrderEvaluateInfoService.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/orderevaluateinfo/IOrderEvaluateInfoService.java index 70c5ef0..5905a5e 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/orderevaluateinfo/IOrderEvaluateInfoService.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/orderevaluateinfo/IOrderEvaluateInfoService.java @@ -61,6 +61,6 @@ public interface IOrderEvaluateInfoService { * @Param [orderEvaluateInfo] * @return java.util.List **/ - List selectOrderEvaluateByServiceNos(List serviceNoList, String orderSource); + List selectOrderEvaluateByServiceNos(List orderNoList, String orderSource); } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/orderevaluateinfo/impl/OrderEvaluateInfoServiceImpl.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/orderevaluateinfo/impl/OrderEvaluateInfoServiceImpl.java index 06714f9..7bbfb0d 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/orderevaluateinfo/impl/OrderEvaluateInfoServiceImpl.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/orderevaluateinfo/impl/OrderEvaluateInfoServiceImpl.java @@ -82,11 +82,11 @@ public class OrderEvaluateInfoServiceImpl implements IOrderEvaluateInfoService { * @Author mengkuiliang * @Description 根据服务编号查询服务评价列表 * @Date 2023-10-17 017 11:36 - * @Param [serviceNoList] + * @Param [orderNoList] * @return java.util.List **/ @Override - public List selectOrderEvaluateByServiceNos(List serviceNoList, String orderSource) { - return orderEvaluateInfoMapper.selectOrderEvaluateByServiceNos(serviceNoList, orderSource); + public List selectOrderEvaluateByServiceNos(List orderNoList, String orderSource) { + return orderEvaluateInfoMapper.selectOrderEvaluateByServiceNos(orderNoList, orderSource); } } diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/orderevaluateinfo/OrderEvaluateInfoMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/orderevaluateinfo/OrderEvaluateInfoMapper.xml index 0abd8a7..9267d9c 100644 --- a/xinelu-nurse-manage/src/main/resources/mapper/manage/orderevaluateinfo/OrderEvaluateInfoMapper.xml +++ b/xinelu-nurse-manage/src/main/resources/mapper/manage/orderevaluateinfo/OrderEvaluateInfoMapper.xml @@ -10,7 +10,6 @@ - @@ -28,7 +27,6 @@ openid, unionid, order_no, - service_code, evaluate_content, evaluate_channel, evaluate_satisfaction, @@ -88,8 +86,8 @@ select ,p.address,p.phone from resident_service_apply s - left join patient_info p on p.patient_code = s.patient_id + left join patient_info p on p.card_no = s.identity where 1=1 and s.identity = #{identity} @@ -269,6 +273,9 @@ and s.user_no = #{userNo} + + and s.form_no = #{formNo} + and s.booking_time >= #{startDate} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscreeningrecord/AppletScreeningRecordController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscreeningrecord/AppletScreeningRecordController.java index 01dcb6d..01e2e41 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscreeningrecord/AppletScreeningRecordController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscreeningrecord/AppletScreeningRecordController.java @@ -1,6 +1,7 @@ package com.xinelu.applet.controller.appletscreeningrecord; import com.alibaba.fastjson2.JSONObject; +import com.xinelu.applet.service.messagepush.MessagePushService; import com.xinelu.common.annotation.RepeatSubmit; import com.xinelu.common.config.XinELuConfig; import com.xinelu.common.constant.ScreeningProjectConstants; @@ -19,6 +20,7 @@ import com.xinelu.manage.vo.screeningrecord.ScreeningRecordVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import java.io.File; +import java.util.Date; import java.util.List; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; @@ -45,6 +47,9 @@ public class AppletScreeningRecordController extends BaseController { @Resource private IScreeningRecordService screeningRecordService; + @Resource + private MessagePushService messagePushService; + @GetMapping("/record") @ApiOperation(value = "获取筛查结果记录") public TableDataInfo record(ScreeningRecordDTO query) { @@ -83,7 +88,11 @@ public class AppletScreeningRecordController extends BaseController { if(!DateUtils.formatDate(body.getApplyStartTime(), "yyyy-MM-dd").equals(DateUtils.formatDate(body.getApplyEndTime(), "yyyy-MM-dd"))) { return R.fail("预约日期请选择在同一天"); } - return R.ok(screeningRecordService.save(body)); + JSONObject result = screeningRecordService.save(body); + if(result != null && result.containsKey("openid")) { + messagePushService.fdApprovePush(result); + } + return R.ok(result.getString("patientId")); } catch (Exception e) { return R.fail(e.getMessage()); } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDMessageExtentDto.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDMessageExtentDto.java new file mode 100644 index 0000000..52419dd --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDMessageExtentDto.java @@ -0,0 +1,43 @@ +package com.xinelu.applet.dto.messagepush; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author mengkuiliang + * @Description 家医订阅消息请求参数扩展类 + * @Date 2023-10-19 019 10:15 + * @Param + * @return + **/ +@Data +public class FDMessageExtentDto { + + @ApiModelProperty("居民姓名") + private String residentName; + + @ApiModelProperty("医院名称") + private String hospitalName; + + @ApiModelProperty("医生名称") + private String doctorName; + + @ApiModelProperty("团队名称") + private String teamName; + + @ApiModelProperty("申请内容(比如:申请签约、申请随访、申请转诊等)") + private String applyContent; + + @ApiModelProperty("申请结果(比如:成功、失败、处理中等)") + private String applyResult; + + @ApiModelProperty("处理时间") + private String handleDate; + + @ApiModelProperty("药品名称") + private String drugName; + + @ApiModelProperty("药品用法") + private String drugUsage; + +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDMessagePushDto.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDMessagePushDto.java new file mode 100644 index 0000000..c8f6f6f --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDMessagePushDto.java @@ -0,0 +1,66 @@ +package com.xinelu.applet.dto.messagepush; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author mengkuiliang + * @Description 消息推送请求对象 + * @Date 2023-10-18 018 14:26 + * @Param + * @return + **/ +@Data +@ApiModel(value = "消息推送请求对象") +public class FDMessagePushDto extends FDMessageExtentDto{ + + @ApiModelProperty("业务主键") + private String messageNo; + + @ApiModelProperty(value = "消息类别 1:通知公告,2:健康推送,3:在线咨询", required = true) + private String messageCategory; + + @ApiModelProperty("通知适用人群(0:全部人群)") + private String crowds; + + @ApiModelProperty("通知适用人群名称") + private String crowdsName; + + @ApiModelProperty("发送人编号") + private String senderNo; + + @ApiModelProperty("发送人姓名") + private String senderName; + + @ApiModelProperty("发送时间") + private String sendTime; + + @ApiModelProperty("接收人身份证号") + private String recipientIdentity; + + @ApiModelProperty("接收人编号") + private String recipientNo; + + @ApiModelProperty("接收人姓名") + private String recipientName; + + @ApiModelProperty("消息类型,1:健康推送,2:日常提醒, 3:风险评估完成, 4:推送筛查项目,5:预约筛查成功, 6:筛查完成,7:康复处方,8:随访提醒,9:纳入管理,10:申请转诊,11:转诊申请通过,12:申请会诊,13:会诊申请通过,14:处理异常") + private String messageType; + + @ApiModelProperty("标题") + private String title; + + @ApiModelProperty("消息内容") + private String content; + + @ApiModelProperty("消息内容Id用于点击跳转") + private String contentId; + + @ApiModelProperty("已读状态,0:未读,1:已读") + private String readStatus; + + @ApiModelProperty(value = "模版类型(MessageTemplateType枚举)", required = true) + private String templateType; + +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDWxMegDto.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDWxMegDto.java new file mode 100644 index 0000000..03672ca --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDWxMegDto.java @@ -0,0 +1,35 @@ +package com.xinelu.applet.dto.messagepush; + +import lombok.Data; + +import java.util.Map; + +/** + * @Author mengkuiliang + * @Description 小程序推送所需数据 + * @Date 2023-10-19 019 10:36 + * @Param + * @return + **/ +@Data +public class FDWxMegDto { + + /** + * 用户openid + * */ + private String touser; + + /** + * 订阅消息模版id + * */ + private String template_id; + + /** + * 默认跳到小程序首页 + * */ + private String page = "pages/index/index"; + /** + * 推送文字 + * */ + private Map data; +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/TemplateData.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/TemplateData.java new file mode 100644 index 0000000..2a79de4 --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/TemplateData.java @@ -0,0 +1,17 @@ +package com.xinelu.applet.dto.messagepush; + +import lombok.AllArgsConstructor; +import lombok.Data; + +/** + * @Author mengkuiliang + * @Description 消息的内容 + * @Date 2023-10-19 019 10:36 + * @Param + * @return + **/ +@Data +@AllArgsConstructor +public class TemplateData { + private String value; +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/Impl/MessagePushServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/Impl/MessagePushServiceImpl.java index ddbd284..bb6fd7d 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/Impl/MessagePushServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/Impl/MessagePushServiceImpl.java @@ -2,23 +2,26 @@ package com.xinelu.applet.service.messagepush.Impl; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; +import com.xinelu.applet.dto.messagepush.FDMessagePushDto; +import com.xinelu.applet.dto.messagepush.FDWxMegDto; +import com.xinelu.applet.dto.messagepush.TemplateData; import com.xinelu.applet.service.messagepush.MessagePushService; import com.xinelu.common.config.AppletChatConfig; import com.xinelu.common.config.AppletPageConfig; import com.xinelu.common.constant.Constants; import com.xinelu.common.entity.AppletAccessToken; import com.xinelu.common.entity.MessageValueEntity; -import com.xinelu.common.enums.AppletSubscriptionMessageEnum; -import com.xinelu.common.enums.CouponTypeEnum; -import com.xinelu.common.enums.SettingsTypeEnum; -import com.xinelu.common.enums.SubscribeStatusEnum; +import com.xinelu.common.enums.*; import com.xinelu.common.utils.AppletChatUtil; import com.xinelu.common.utils.http.HttpUtils; +import com.xinelu.common.utils.map.MapUtil; import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord; import com.xinelu.manage.domain.systemsettingsinfo.SystemSettingsInfo; import com.xinelu.manage.mapper.subscribemessagerecord.SubscribeMessageRecordMapper; import com.xinelu.manage.mapper.systemsettingsinfo.SystemSettingsInfoMapper; +import com.xinelu.manage.service.patientinfo.IPatientInfoService; import com.xinelu.manage.vo.patientcouponreceive.PatientCouponReceiveInfoVO; +import com.xinelu.manage.vo.patientinfo.PatientInfoVO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.scheduling.annotation.Async; @@ -28,10 +31,7 @@ import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDate; import java.time.format.DateTimeFormatter; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Objects; +import java.util.*; /** * @Description 消息推送实现层 @@ -50,6 +50,8 @@ public class MessagePushServiceImpl implements MessagePushService { private SystemSettingsInfoMapper systemSettingsInfoMapper; @Resource private AppletPageConfig appletPageConfig; + @Resource + private IPatientInfoService patientInfoService; /** * 微信消息推送url @@ -209,7 +211,7 @@ public class MessagePushServiceImpl implements MessagePushService { log.error("不合法的 template_id!"); break; case Constants.ARGUMENT_INVALID: - log.error("参数无效!"); + log.error("参数无效!{}", result); break; case Constants.DENY_SUBSCRIPTION: log.error("用户拒接订阅!"); @@ -223,11 +225,12 @@ public class MessagePushServiceImpl implements MessagePushService { /** * @return void * @Author mengkuiliang - * @Description 家医申请审批结果消息推送 + * @Description 家医申请审批结果订阅消息推送 * @Date 2023-10-18 018 14:03 * @Param [appletAccessToken, paramsMap, busType] **/ @Override + @Async("asyncThreadServiceExecutor") public void fdApprovePush(JSONObject body) { AppletAccessToken appletAccessToken = AppletChatUtil.getAppletAccessToken(appletChatConfig.getAppletId(), appletChatConfig.getSecret()); if (Objects.isNull(appletAccessToken)) { @@ -240,29 +243,106 @@ public class MessagePushServiceImpl implements MessagePushService { log.error("accessToken信息为空!"); } - String tempId = ""; - switch (body.getString("1")) { + //模板内容 + Map messageValueEntityMap = new LinkedHashMap<>(); + switch (body.getString("busType")) { // 申请 - case "2": - tempId = appletChatConfig.getFdMessageApplyTempId(); - // 用药 - case "3": - tempId = appletChatConfig.getFdMessageMedicineTempId(); - // 默认 + case "10": + messageValueEntityMap.put("name2", new MessageValueEntity(body.getString("receiveName"))); + messageValueEntityMap.put("thing6", new MessageValueEntity(body.getString("text1"))); + messageValueEntityMap.put("thing5", new MessageValueEntity(body.getString("text2"))); + messageValueEntityMap.put("thing8", new MessageValueEntity(body.getString("sendTime"))); + messageValueEntityMap.put("thing9", new MessageValueEntity(body.getString("sendContent"))); + break; + // 用药 + case "9": + messageValueEntityMap.put("thing1", new MessageValueEntity(body.getString("text1"))); + messageValueEntityMap.put("thing2", new MessageValueEntity(body.getString("text2"))); + messageValueEntityMap.put("time3", new MessageValueEntity(body.getString("sendTime"))); + messageValueEntityMap.put("thing4", new MessageValueEntity(body.getString("sendContent"))); + break; + // 默认 default: - tempId = appletChatConfig.getFdMessageDefaultTempId(); + messageValueEntityMap.put("thing1", new MessageValueEntity(body.getString("senderName"))); + messageValueEntityMap.put("time2", new MessageValueEntity(body.getString("sendTime"))); + messageValueEntityMap.put("thing3", new MessageValueEntity(body.getString("sendContent"))); + break; } Map paramsMap = new HashMap<>(); paramsMap.put("touser", body.getString("openid")); - paramsMap.put("template_id", tempId); + paramsMap.put("template_id", MessageTemplateType.getFolllowupTypeByCode(body.getString("busType")).getTemplateId()); paramsMap.put("page", appletPageConfig.getIntegralPageUrl()); - //模板内容 - Map messageValueEntityMap = new LinkedHashMap<>(); - messageValueEntityMap.put("thing1", new MessageValueEntity(body.getString("senderName"))); - messageValueEntityMap.put("time2", new MessageValueEntity(body.getString("sendTime"))); - messageValueEntityMap.put("thing3", new MessageValueEntity(body.getString("sendTitle"))); + paramsMap.put("data", messageValueEntityMap); //发送 this.sendPosts(appletAccessToken, paramsMap); } + + /** + * @return void + * @Author mengkuiliang + * @Description 家医推送订阅消息 + * @Date 2023-10-19 019 10:20 + * @Param [body] + **/ + @Override + @Async("asyncThreadServiceExecutor") + public void FdPushMessage(JSONObject req) throws Exception { + log.info("订阅消息-请求参数:{}", JSON.toJSONString(req)); + FDMessagePushDto body = JSONObject.parseObject(req.toJSONString()).toJavaObject(FDMessagePushDto.class); + if (!StringUtils.isBlank(body.getRecipientIdentity())) { + PatientInfoVO patientInfo = patientInfoService.selectPatientInfoByCardNo(body.getRecipientIdentity()); + if (patientInfo == null) { + log.error("接收方未注册 {}", body.getRecipientIdentity()); + } + AppletAccessToken appletAccessToken = AppletChatUtil.getAppletAccessToken(appletChatConfig.getAppletId(), appletChatConfig.getSecret()); + if (Objects.isNull(appletAccessToken)) { + log.error("获取微信小程序accessToken信息失败!"); + } + if (Objects.nonNull(appletAccessToken.getErrcode()) && appletAccessToken.getErrcode() != AppletSubscriptionMessageEnum.SUCCESS_ERRCODE.getValue()) { + log.error("获取微信小程序accessToken信息失败,失败信息为:" + appletAccessToken.getErrmsg(), 201); + } + if (StringUtils.isBlank(appletAccessToken.getAccessToken())) { + log.error("accessToken信息为空!"); + } + //发送 + this.sendPosts(appletAccessToken, MapUtil.object2Map(getTemplate(body, patientInfo.getOpenid()))); + } + } + + /** + * 配置消息模版请求参数 + */ + private FDWxMegDto getTemplate(FDMessagePushDto message, String openid) { + FDWxMegDto wxMegDto = new FDWxMegDto(); + wxMegDto.setTouser(openid); + wxMegDto.setTemplate_id(MessageTemplateType.getFolllowupTypeByCode(message.getTemplateType()).getTemplateId()); + Map meg = new HashMap<>(); + switch (message.getTemplateType()) { + // 用药提醒 + case "9": + meg.put("thing1", new TemplateData(message.getDrugName())); + meg.put("thing2", new TemplateData(message.getDrugUsage())); + meg.put("time3", new TemplateData(message.getHandleDate())); + meg.put("thing4", new TemplateData((!StringUtils.isBlank(message.getRecipientName())? message.getRecipientName(): "") + message.getContent())); + break; + // 筛查预约成功 + case "10": + meg.put("name2", new TemplateData(message.getRecipientName())); + meg.put("thing5", new TemplateData(message.getApplyContent())); + meg.put("thing6", new TemplateData(message.getHospitalName())); + meg.put("thing8", new TemplateData(message.getHandleDate())); + meg.put("thing9", new TemplateData(message.getContent())); + break; + // 家庭医生消息通知 + default: + meg.put("thing1", new TemplateData(message.getDoctorName())); + meg.put("time2", new TemplateData(message.getSendTime())); + meg.put("thing3", new TemplateData(message.getContent())); + break; + } + wxMegDto.setPage(MessageTypePath.getPathByType(message.getMessageType()).getPath() + (StringUtils.isBlank(message.getContentId()) ? "" : message.getContentId())); + wxMegDto.setData(meg); + return wxMegDto; + } } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/MessagePushService.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/MessagePushService.java index ec50ca0..05cdac0 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/MessagePushService.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/messagepush/MessagePushService.java @@ -2,6 +2,7 @@ package com.xinelu.applet.service.messagepush; import com.alibaba.fastjson2.JSONObject; +import com.xinelu.applet.dto.messagepush.FDMessagePushDto; import com.xinelu.common.entity.AppletAccessToken; import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord; import com.xinelu.manage.vo.patientcouponreceive.PatientCouponReceiveInfoVO; @@ -48,4 +49,13 @@ public interface MessagePushService { * @return void **/ void fdApprovePush(JSONObject body); + + /** + * @Author mengkuiliang + * @Description 家医推送订阅消息 + * @Date 2023-10-19 019 10:20 + * @Param [message] + * @return void + **/ + void FdPushMessage(JSONObject req) throws Exception; } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/IScreeningRecordService.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/IScreeningRecordService.java index a5184ec..d0eb893 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/IScreeningRecordService.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/IScreeningRecordService.java @@ -43,7 +43,7 @@ public interface IScreeningRecordService { * @Param [body] * @return void **/ - String save(ScreeningApplyDTO body) throws Exception; + JSONObject save(ScreeningApplyDTO body) throws Exception; /** * 修改 diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/impl/ScreeningRecordServiceImpl.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/impl/ScreeningRecordServiceImpl.java index 0a214af..701aeaa 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/impl/ScreeningRecordServiceImpl.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/screeningrecord/impl/ScreeningRecordServiceImpl.java @@ -97,7 +97,7 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService { **/ @Override @Transactional(rollbackFor = Exception.class) - public String save(ScreeningApplyDTO body) throws Exception { + public JSONObject save(ScreeningApplyDTO body) throws Exception { // 校验是否已经注册 PatientInfoVO registerVo = patientService.selectPatientInfoByCardNo(body.getIdentity()); if(registerVo == null) { @@ -130,24 +130,22 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService { } catch (Exception e) { e.printStackTrace(); } + JSONObject result = new JSONObject(); + result.put("patientId", body.getPatientId()); int flag = screeningRecordMapper.insert(recordBody); if(flag > 0) { - // 推送消息 - //JSONObject jsonObject = new JSONObject(); - //jsonObject.fluentPut("recipientName", registerVo.getPatientName()) - // .fluentPut("handleDate", recordBody.getApplyStartTime()) - // .fluentPut("hospitalName", recordBody.getDeptName()) - // .fluentPut("applyContent", recordBody.getProjectName()) - // .fluentPut("recipientIdentity", registerVo.getIdentity()) - // .fluentPut("sendTime", DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss")) - // .fluentPut("messageType", "5") - // .fluentPut("messageCategory", "1") - // .fluentPut("templateType", MessageTypeEnum.SCREENING_APPLY.getType()) - // .fluentPut("content", "预约成功,请准时赴约筛查!") - // .fluentPut("contentId", recordBody.getScreeningId()); - //FdmpPushMegUtil.sendPost(jsonObject); + // 组装发送消息通知参数 + result.put("busType", "10"); + result.put("openid", registerVo.getOpenid()); + result.put("receiveName", registerVo.getPatientName()); + result.put("text1", body.getHospitalName()); + result.put("text2", (body.getProjectName().length() >= 17? (body.getProjectName().substring(0, 17) + "..."): body.getProjectName())); + result.put("sendTime", DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss", new Date())); + result.put("busType", "10"); + result.put("sendContent", registerVo.getPatientName() + "预约筛查成功"); + result.put("messageType", "5"); } - return body.getPatientId(); + return result; } @Override From e83666f45a764e1253b47049cd7827d448339247 Mon Sep 17 00:00:00 2001 From: mengkuiliang <1464081137@qq.com> Date: Fri, 20 Oct 2023 17:08:31 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E5=AE=B6=E5=8C=BB?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8C=E6=AD=A5=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=A7=91=E5=AE=A4=E4=BA=BA=E5=91=98=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/controller/fd/FDController.java | 93 +++++++++++--- .../pojo/body/SyncHospitalPersonInfoBody.java | 115 ++++++++++++++++++ .../applet/pojo/vo/DoctorDetailVo.java | 6 +- .../applet/pojo/vo/OrgDetailVo.java | 6 +- .../service/IResidentSignAppletService.java | 1 + .../impl/ResidentServiceApplyServiceImpl.java | 56 ++++----- .../impl/ResidentSignApplyServiceImpl.java | 6 +- .../domain/hospitalinfo/HospitalInfo.java | 6 + .../HospitalPersonInfo.java | 25 ++-- .../HospitalPersonInfoMapper.java | 18 +++ .../IHospitalPersonInfoService.java | 27 ++++ .../impl/HospitalPersonInfoServiceImpl.java | 37 ++++++ .../hospitalinfo/HospitalInfoMapper.xml | 15 ++- .../HospitalPersonInfoMapper.xml | 97 ++++++++++++++- 14 files changed, 437 insertions(+), 71 deletions(-) create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/SyncHospitalPersonInfoBody.java diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/fd/FDController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/fd/FDController.java index acd2eb1..89003bf 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/fd/FDController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/fd/FDController.java @@ -1,9 +1,11 @@ package com.xinelu.web.controller.fd; + import com.alibaba.fastjson2.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.xinelu.common.core.domain.R; import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody; +import com.xinelu.familydoctor.applet.pojo.body.SyncHospitalPersonInfoBody; import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery; import com.xinelu.familydoctor.applet.pojo.vo.ResidentRescindApplyVo; import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo; @@ -11,11 +13,16 @@ import com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo; import com.xinelu.familydoctor.applet.service.IResidentRescindApplyService; import com.xinelu.familydoctor.applet.service.IResidentServiceAppletService; import com.xinelu.familydoctor.applet.service.IResidentSignAppletService; +import com.xinelu.manage.domain.hospitalinfo.HospitalInfo; +import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo; +import com.xinelu.manage.service.hospitalinfo.IHospitalInfoService; +import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService; import com.xinelu.manage.service.patientinfo.IPatientInfoService; import com.xinelu.manage.vo.patientinfo.PatientInfoVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -31,8 +38,12 @@ public class FDController { private IResidentSignAppletService residentSignAppletService; @Resource private IResidentServiceAppletService residentServiceAppletService; - @Resource - private IPatientInfoService patientInfoService; + @Resource + private IPatientInfoService patientInfoService; + @Resource + private IHospitalPersonInfoService hospitalPersonInfoService; + @Resource + private IHospitalInfoService hospitalInfoService; @ApiOperation("服务申请列表") @PostMapping("/performanceBooking/list") @@ -40,6 +51,7 @@ public class FDController { PageHelper.startPage(query.getPageNum(), query.getPageSize()); return R.ok(PageInfo.of(residentServiceAppletService.findList(query))); } + @ApiOperation("服务申请详情") @GetMapping("/performanceBooking/detail/{bookingNo}") public R performanceBookingDetail(@PathVariable String bookingNo) { @@ -66,13 +78,14 @@ public class FDController { @ApiOperation("解约申请列表") @PostMapping("/rescindApply/list") public R> rescindApplyList(@RequestBody ApplyQuery query) { - if(StringUtils.isBlank(query.getUserNo())) { + if (StringUtils.isBlank(query.getUserNo())) { return R.fail("医生编号不能为空"); } PageHelper.startPage(query.getPageNum(), query.getPageSize()); query.setBookingStatus("0"); return R.ok(PageInfo.of(residentRescindApplyService.findList(query))); } + @ApiOperation("解约申请详情") @GetMapping("/rescindApply/detail/{applyNo}") public R rescindApplyDetail(@PathVariable String applyNo) { @@ -92,7 +105,7 @@ public class FDController { @ApiOperation("签约申请列表") @PostMapping("/signBooking/list") public R> signBookingList(@RequestBody ApplyQuery query) { - if(StringUtils.isBlank(query.getUserNo())) { + if (StringUtils.isBlank(query.getUserNo())) { return R.fail("医生编号不能为空"); } PageHelper.startPage(query.getPageNum(), query.getPageSize()); @@ -116,15 +129,67 @@ public class FDController { return R.ok(); } - @ApiOperation("根据签约主键查询绑定编号") - @GetMapping("/signBooking/getBySignNo/{cardNo}") - public R getBySignNo(@PathVariable String cardNo) { - JSONObject retObj = new JSONObject(); + @ApiOperation("根据签约主键查询绑定编号") + @GetMapping("/signBooking/getBySignNo/{cardNo}") + public R getBySignNo(@PathVariable String cardNo) { + JSONObject retObj = new JSONObject(); PatientInfoVO patientInfo = patientInfoService.selectPatientInfoByCardNo(cardNo); - if (patientInfo != null) { - retObj.fluentPut("bindingNo", patientInfo.getPatientCode()) - .fluentPut("openid", patientInfo.getOpenid()); - } - return R.ok(retObj); - } + if (patientInfo != null) { + retObj.fluentPut("bindingNo", patientInfo.getPatientCode()) + .fluentPut("openid", patientInfo.getOpenid()); + } + return R.ok(retObj); + } + + @ApiOperation("家医医生同步科室人员信息") + @PostMapping("/synHospatialPersonInfo") + public R synHospatialPersonInfo(@RequestBody SyncHospitalPersonInfoBody body) { + if (body == null) { + return R.fail("请求参数不能为空"); + } + if (StringUtils.isBlank(body.getPersonCode())) { + return R.fail("科室人员编号不能为空"); + } + if (StringUtils.isBlank(body.getOrgCode())) { + return R.fail("家医机构编号不能为空"); + } + // 判断是否已存在 + HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoService.getByPersonCode(body.getPersonCode(), body.getStatus()); + // 根据家医机构查询医院信息 + HospitalInfo hospital = hospitalInfoService.getHosptalByOrgCode(body.getOrgCode()); + // 新增 + if (hospitalPersonInfo == null) { + hospitalPersonInfo = new HospitalPersonInfo(); + BeanUtils.copyProperties(body, hospitalPersonInfo); + hospitalPersonInfo.setCreateBy(body.getPersonCode()); + hospitalPersonInfo.setStatus("1"); + if (hospital != null) { + hospitalPersonInfo.setHospitalId(hospital.getId()); + } + hospitalPersonInfoService.insert(hospitalPersonInfo); + + // 修改 + } else { + if (!String.valueOf(hospitalPersonInfo.getPersonAccount()).equals(String.valueOf(body.getPersonAccount())) + || !String.valueOf(hospitalPersonInfo.getPersonPhone()).equals(String.valueOf(body.getPersonPhone())) + || !String.valueOf(hospitalPersonInfo.getPersonName()).equals(String.valueOf(body.getPersonName())) + || !String.valueOf(hospitalPersonInfo.getPersonIntroduce()).equals(String.valueOf(body.getPersonIntroduce())) + || !String.valueOf(hospitalPersonInfo.getCardNo()).equals(String.valueOf(body.getCardNo())) + ) { + hospitalPersonInfo.setPersonName(body.getPersonName()); + hospitalPersonInfo.setPersonPhone(body.getPersonPhone()); + hospitalPersonInfo.setPersonAddress(body.getPersonAddress()); + hospitalPersonInfo.setPersonAccount(body.getPersonAccount()); + hospitalPersonInfo.setPersonIntroduce(body.getPersonIntroduce()); + hospitalPersonInfo.setCardNo(body.getCardNo()); + if (hospital != null) { + hospitalPersonInfo.setHospitalId(hospital.getId()); + } + hospitalPersonInfo.setUpdateBy(body.getPersonCode()); + hospitalPersonInfoService.updateByPersonCode(hospitalPersonInfo); + } + } + return R.ok(); + } + } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/SyncHospitalPersonInfoBody.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/SyncHospitalPersonInfoBody.java new file mode 100644 index 0000000..4abface --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/body/SyncHospitalPersonInfoBody.java @@ -0,0 +1,115 @@ +package com.xinelu.familydoctor.applet.pojo.body; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @Author mengkuiliang + * @Description 同步科室人员信息请求对象 + * @Date 2023-10-20 020 14:18 + * @Param + * @return + **/ +@Data +@ApiModel(value = "同步科室人员信息请求对象") +public class SyncHospitalPersonInfoBody { + + /** + * 所属医院id + */ + @ApiModelProperty(value = "所属医院id") + private Long hospitalId; + + /** + * 所属部门id + */ + @ApiModelProperty(value = "所属部门id") + private Long departmentId; + + /** + * 科室人员编码 + */ + @ApiModelProperty(value = "科室人员编码") + private String personCode; + + /** + * 科室人员名称 + */ + @ApiModelProperty(value = "科室人员名称") + private String personName; + + /** + * 科室人员联系电话 + */ + @ApiModelProperty(value = "科室人员联系电话") + private String personPhone; + + /** + * 科室人员地址 + */ + @ApiModelProperty(value = "科室人员地址") + private String personAddress; + + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + private String cardNo; + + /** + * 人员职称,主任医师:CHIEF_PHYSICIAN,副主任医师:DEPUTY_CHIEF_PHYSICIAN,主治医师:ATTENDING_DOCTOR,医师:PHYSICIAN,医士:HEALER,住院医师:RESIDENT_PHYSICIAN + */ + @ApiModelProperty(value = "人员职称,主任医师:CHIEF_PHYSICIAN,副主任医师:DEPUTY_CHIEF_PHYSICIAN,主治医师:ATTENDING_DOCTOR,医师:PHYSICIAN,医士:HEALER,住院医师:RESIDENT_PHYSICIAN") + private String academicTitle; + + /** + * 咨询费用 + */ + @ApiModelProperty(value = "咨询费用") + private BigDecimal consultingFee; + + /** + * 个人简介 + */ + @ApiModelProperty(value = "个人简介") + private String personIntroduce; + + /** + * 显示顺序 + */ + @ApiModelProperty(value = "显示顺序") + private Integer personSort; + + /** + * 科室人员头像地址 + */ + @ApiModelProperty(value = "科室人员头像地址") + private String personPictureUrl; + + /** + * 科室人员账号 + */ + @ApiModelProperty(value = "科室人员账号") + private String personAccount; + + /** + * 科室人员密码 + */ + @ApiModelProperty(value = "科室人员密码") + private String personPassword; + + /** + *1:家医医生 2:泉医医生 3:专病医生 + */ + @ApiModelProperty(value = "1:家医医生 2:泉医医生 3:专病医生") + private String status; + + /** + *1:家医机构编号 + */ + @ApiModelProperty(value = "家医机构编号") + private String orgCode; +} diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/DoctorDetailVo.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/DoctorDetailVo.java index 89e25e0..7f55739 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/DoctorDetailVo.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/DoctorDetailVo.java @@ -149,10 +149,10 @@ public class DoctorDetailVo { private String phOrgId; /** - * 公卫机构编号 + * 家医机构编号 */ - @ApiModelProperty("公卫机构编号") - private String phOrgCode; + @ApiModelProperty("家医机构编号") + private String orgCode; /** * 个人简介 diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/OrgDetailVo.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/OrgDetailVo.java index 36aad3d..9a1f327 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/OrgDetailVo.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/vo/OrgDetailVo.java @@ -59,10 +59,10 @@ public class OrgDetailVo { private String phOrgId; /** - * 公卫机构编码 + * 家医机构编码 */ - @ApiModelProperty("公卫机构编码") - private String phOrgCode; + @ApiModelProperty("家医机构编码") + private String orgCode; /** * 机构类型(0:卫健委,1:卫健局,2:医院,3:乡镇卫生院,4:街道卫生服务中心,5:社区服务站,6:村卫生室) diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentSignAppletService.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentSignAppletService.java index 8ebf01d..dab39ae 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentSignAppletService.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentSignAppletService.java @@ -3,6 +3,7 @@ package com.xinelu.familydoctor.applet.service; import com.github.pagehelper.PageInfo; import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody; import com.xinelu.familydoctor.applet.pojo.body.ResidentSignApplyBody; +import com.xinelu.familydoctor.applet.pojo.body.SyncHospitalPersonInfoBody; import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery; import com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo; 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 94f3567..47da88e 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 @@ -275,7 +275,7 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe if (signInfo == null) { throw new ServiceException("未查询到签约信息!"); } - // 获取家医个性服务包 + // 1、获取家医个性服务包 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"))) { @@ -307,41 +307,31 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe } } - // 获取签约机构下的筛查项目 - // 获取家医机构详情 - result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/org/getOrgDetail/" + signInfo.getOrgNo(), null, String.class); - jsonObject = JSONObject.parseObject(result); - if ("1".equals(jsonObject.get("code"))) { - if (jsonObject.containsKey("data") && jsonObject.get("data") != null) { - OrgDetailVo org = JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), OrgDetailVo.class); - if (org != null && !StringUtils.isBlank(org.getPhOrgId())) { - // 根据机构编码获取筛查机构 - HospitalInfo Hospital = hospitalInfoService.getHosptalByOrgCode(org.getPhOrgId()); - if (Hospital != null) { - // 获取筛查项目 - ScreeningProject query = new ScreeningProject(); - query.setHospitalId(Hospital.getId()); - query.setProjectName(projectName); - List screeningProjectList = screeningProjectService.findList(query); - if (screeningProjectList != null && screeningProjectList.size() > 0) { - ScreeningProjectVo sp; - for (ScreeningProject project : screeningProjectList) { - sp = new ScreeningProjectVo(); - sp.setSourceType("2"); - sp.setHospitalId(String.valueOf(project.getHospitalId())); - sp.setHospitalName(project.getHospitalName()); - sp.setProjectId(project.getProjectId()); - sp.setProjectName(project.getProjectName()); - sp.setPrice(project.getPrice()); - sp.setDiscountPrice(project.getDiscountPrice()); - projectList.add(sp); - } - } - } - + // 2、获取签约机构下的筛查项目 + // 根据机构编码获取筛查机构 + HospitalInfo Hospital = hospitalInfoService.getHosptalByOrgCode(signInfo.getOrgNo()); + if (Hospital != null) { + // 获取筛查项目 + ScreeningProject query = new ScreeningProject(); + query.setHospitalId(Hospital.getId()); + query.setProjectName(projectName); + List screeningProjectList = screeningProjectService.findList(query); + if (screeningProjectList != null && screeningProjectList.size() > 0) { + ScreeningProjectVo sp; + for (ScreeningProject project : screeningProjectList) { + sp = new ScreeningProjectVo(); + sp.setSourceType("2"); + sp.setHospitalId(String.valueOf(project.getHospitalId())); + sp.setHospitalName(project.getHospitalName()); + sp.setProjectId(project.getProjectId()); + sp.setProjectName(project.getProjectName()); + sp.setPrice(project.getPrice()); + sp.setDiscountPrice(project.getDiscountPrice()); + projectList.add(sp); } } } + return projectList; } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentSignApplyServiceImpl.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentSignApplyServiceImpl.java index c65aa18..11150a3 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentSignApplyServiceImpl.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentSignApplyServiceImpl.java @@ -75,7 +75,7 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService if (patientInfo == null) { throw new ServiceException("未查询到注册信息"); } - if(StringUtils.isBlank(body.getPatientId())) { + if (StringUtils.isBlank(body.getPatientId())) { entity.setPatientId(patientInfo.getPatientCode()); } @@ -85,10 +85,10 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService // 审批状态0:待批准 1:已同意 2:已拒绝 entity.setApprovalStatus("0"); entity.setBookingNo(IdUtils.simpleUUID()); - if(StringUtils.isBlank(entity.getNation())) { + if (StringUtils.isBlank(entity.getNation())) { entity.setNation("1"); } - if(entity.getSignYears() == null || entity.getSignYears() <= 0) { + if (entity.getSignYears() == null || entity.getSignYears() <= 0) { entity.setSignYears(1); } entity.setCrowdsNo(body.getCrowdList().stream().map(CrowdDto::getCrowdNo).collect(Collectors.joining(","))); diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalinfo/HospitalInfo.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalinfo/HospitalInfo.java index b03d980..fd4d15d 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalinfo/HospitalInfo.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalinfo/HospitalInfo.java @@ -85,6 +85,11 @@ public class HospitalInfo extends BaseDomain implements Serializable { @NotNull(message = "显示顺序不能为空", groups = {Insert.class, Update.class}) private Integer hospitalSort; + /** + * 家医机构编号 + */ + @ApiModelProperty(value = "家医机构编号") + private String orgCode; @Override public String toString() { @@ -100,6 +105,7 @@ public class HospitalInfo extends BaseDomain implements Serializable { .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) + .append("orgCode", getOrgCode()) .toString(); } } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalpersoninfo/HospitalPersonInfo.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalpersoninfo/HospitalPersonInfo.java index 10058c9..d26850c 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalpersoninfo/HospitalPersonInfo.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/hospitalpersoninfo/HospitalPersonInfo.java @@ -6,10 +6,12 @@ import com.xinelu.common.custominterface.Insert; import com.xinelu.common.custominterface.Update; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import java.io.Serializable; import java.math.BigDecimal; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; + import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; @@ -64,7 +66,7 @@ public class HospitalPersonInfo extends BaseDomain implements Serializable { */ @ApiModelProperty(value = "科室人员名称") @Excel(name = "科室人员名称") - @NotBlank(message = "科室人员名称不能为空!", groups = { Insert.class, Update.class}) + @NotBlank(message = "科室人员名称不能为空!", groups = {Insert.class, Update.class}) @Length(max = 50, message = "科室人员名称不能超过50位", groups = {Insert.class, Update.class}) private String personName; @@ -128,16 +130,21 @@ public class HospitalPersonInfo extends BaseDomain implements Serializable { */ private String personPictureUrl; - /** - * 科室人员账号 - */ - private String personAccount; + /** + * 科室人员账号 + */ + private String personAccount; - /** - * 科室人员密码 - */ - private String personPassword; + /** + * 科室人员密码 + */ + private String personPassword; + /** + *1:家医医生 2:泉医医生 3:专病医生 + */ + @ApiModelProperty(value = "1:家医医生 2:泉医医生 3:专病医生") + private String status; @Override public String toString() { diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/hospitalpersoninfo/HospitalPersonInfoMapper.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/hospitalpersoninfo/HospitalPersonInfoMapper.java index 1a9e9ab..8de9b62 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/hospitalpersoninfo/HospitalPersonInfoMapper.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/hospitalpersoninfo/HospitalPersonInfoMapper.java @@ -109,4 +109,22 @@ public interface HospitalPersonInfoMapper { * @return int **/ int selectHospitalPersonInfoByIdCount(Long id); + + /** + * @Author mengkuiliang + * @Description 根据科室人员编码查询人员信息 + * @Date 2023-10-20 020 14:37 + * @Param [personCode] + * @return com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo + **/ + HospitalPersonInfo getByPersonCode(@Param("personCode") String personCode, @Param("status") String status); + + /** + * @Author mengkuiliang + * @Description 根据科室人员编号更新 + * @Date 2023-10-20 020 15:03 + * @Param [hospitalPersonInfo] + * @return int + **/ + int updateByPersonCode(HospitalPersonInfo hospitalPersonInfo); } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/IHospitalPersonInfoService.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/IHospitalPersonInfoService.java index f066d16..520950c 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/IHospitalPersonInfoService.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/IHospitalPersonInfoService.java @@ -77,4 +77,31 @@ public interface IHospitalPersonInfoService { * @return */ int editHospitalPersonInfo(HospitalPersonInfoDtoo hospitalPersonInfo); + + /** + * @Author mengkuiliang + * @Description 根据科室人员编码查询人员信息 + * @Date 2023-10-20 020 14:34 + * @Param + * @return + **/ + HospitalPersonInfo getByPersonCode(String personCode, String status); + + /** + * @Author mengkuiliang + * @Description 新增 + * @Date 2023-10-20 020 14:42 + * @Param [body] + * @return void + **/ + int insert(HospitalPersonInfo body); + + /** + * @Author mengkuiliang + * @Description 根据科室人员编号更新 + * @Date 2023-10-20 020 15:02 + * @Param [hospitalPersonInfo] + * @return void + **/ + int updateByPersonCode(HospitalPersonInfo hospitalPersonInfo); } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/impl/HospitalPersonInfoServiceImpl.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/impl/HospitalPersonInfoServiceImpl.java index 3b2ac95..ee8ddfb 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/impl/HospitalPersonInfoServiceImpl.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/hospitalpersoninfo/impl/HospitalPersonInfoServiceImpl.java @@ -329,4 +329,41 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService public int editHospitalPersonInfo(HospitalPersonInfoDtoo hospitalPersonInfo) { return hospitalPersonInfoMapper.editHospitalPersonInfo(hospitalPersonInfo); } + + /** + * @Author mengkuiliang + * @Description 根据科室人员编码查询人员信息 + * @Date 2023-10-20 020 14:37 + * @Param [personCode] + * @return com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo + **/ + @Override + public HospitalPersonInfo getByPersonCode(String personCode, String status) { + return hospitalPersonInfoMapper.getByPersonCode(personCode, status); + } + + /** + * @Author mengkuiliang + * @Description 新增 + * @Date 2023-10-20 020 14:54 + * @Param [body] + * @return void + **/ + @Override + public int insert(HospitalPersonInfo body) { + return hospitalPersonInfoMapper.insertHospitalPersonInfo(body); + } + + /** + * @Author mengkuiliang + * @Description 根据科室人员编号更新 + * @Date 2023-10-20 020 15:02 + * @Param [hospitalPersonInfo] + * @return int + **/ + @Override + public int updateByPersonCode(HospitalPersonInfo hospitalPersonInfo) { + return hospitalPersonInfoMapper.updateByPersonCode(hospitalPersonInfo); + } + } diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/hospitalinfo/HospitalInfoMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/hospitalinfo/HospitalInfoMapper.xml index 6cc5dec..3a9d51c 100644 --- a/xinelu-nurse-manage/src/main/resources/mapper/manage/hospitalinfo/HospitalInfoMapper.xml +++ b/xinelu-nurse-manage/src/main/resources/mapper/manage/hospitalinfo/HospitalInfoMapper.xml @@ -16,6 +16,7 @@ + @@ -29,7 +30,8 @@ create_by, create_time, update_by, - update_time + update_time, + org_code from hospital_info @@ -91,6 +93,9 @@ update_time, + + org_code, + #{hospitalName}, @@ -113,6 +118,9 @@ #{updateTime}, + + #{orgCode}, + @@ -149,6 +157,9 @@ update_time = #{updateTime}, + + org_code = #{orgCode}, + where id = #{id} @@ -183,6 +194,6 @@ diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/hospitalpersoninfo/HospitalPersonInfoMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/hospitalpersoninfo/HospitalPersonInfoMapper.xml index 6ff9497..c65a246 100644 --- a/xinelu-nurse-manage/src/main/resources/mapper/manage/hospitalpersoninfo/HospitalPersonInfoMapper.xml +++ b/xinelu-nurse-manage/src/main/resources/mapper/manage/hospitalpersoninfo/HospitalPersonInfoMapper.xml @@ -24,6 +24,7 @@ + @@ -46,6 +47,7 @@ + @@ -78,7 +80,8 @@ create_by, create_time, update_by, - update_time + update_time, + status from hospital_person_info @@ -104,7 +107,8 @@ hpi.create_by, hpi.create_time, hpi.update_by, - hpi.update_time + hpi.update_time, + status FROM hospital_person_info hpi LEFT JOIN hospital_department_info hdi ON hpi.department_id = hdi.id @@ -142,6 +146,9 @@ and hpi.person_sort = #{personSort} + + and hpi.status = #{status} + ORDER BY id DESC @@ -162,7 +169,8 @@ hpi.create_by, hpi.create_time, hpi.update_by, - hpi.update_time + hpi.update_time, + status FROM hospital_person_info hpi @@ -180,6 +188,9 @@ and hpi.academic_title = #{academicTitle} + + and hpi.status = #{status} + ORDER BY id DESC @@ -205,6 +216,7 @@ hpi.create_time, hpi.update_by, hpi.update_time, + hpi.status, hpc.hospital_person_id, hpc.certificate_name, hpc.certificate_code, @@ -254,6 +266,9 @@ update_time, + + status, + #{hospitalId}, @@ -290,6 +305,9 @@ #{updateTime}, + + #{status}, + @@ -346,6 +364,9 @@ update_time = #{updateTime}, + + status = #{status}, + where id = #{id} @@ -403,6 +424,9 @@ update_time = #{updateTime}, + + status = #{status}, + where id = #{id} @@ -452,7 +476,8 @@ create_by, create_time, update_by, - update_time + update_time, + status from hospital_person_info @@ -489,4 +514,68 @@ + + + + + + + update hospital_person_info + + hospital_id = + #{hospitalId}, + + department_id = + #{departmentId}, + + person_name = + #{personName}, + + + person_phone = #{personPhone}, + + person_address = + #{personAddress}, + + + card_no = #{cardNo}, + + academic_title = + #{academicTitle}, + + consulting_fee = + #{consultingFee}, + + person_introduce = + #{personIntroduce}, + + person_sort = + #{personSort}, + + person_picture_url = + #{personPictureUrl}, + + person_account = + #{personAccount}, + + person_password = + #{personPassword}, + + update_by = + #{updateBy}, + + + status = #{status}, + + update_time = now(), + + where person_code = #{personCode} + From f8a08aaa80f9b9c1166ccf27efa307c988f72710 Mon Sep 17 00:00:00 2001 From: gaoyu Date: Fri, 20 Oct 2023 17:38:45 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E4=BD=93=E5=BE=81=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../familydoctor/PhysicalSignController.java | 9 ++++ .../familydoctor/entity/DeviceBfRecord.java | 2 +- .../familydoctor/entity/DeviceBgRecord.java | 2 +- .../familydoctor/entity/DeviceBmiRecord.java | 14 +++++- .../familydoctor/entity/DeviceBoRecord.java | 2 +- .../familydoctor/entity/DeviceBpRecord.java | 2 +- .../familydoctor/entity/DeviceHrRecord.java | 2 +- .../familydoctor/entity/DeviceTempRecord.java | 2 +- .../mapper/DeviceBgRecordMapper.java | 2 + .../service/PhysicalSignService.java | 11 +++++ .../service/impl/PhysicalSignServiceImpl.java | 5 ++ .../familydoctor/vo/PhysicalLastRecordVO.java | 27 ++++++++++ .../resources/mapper/DeviceBgRecordMapper.xml | 23 +++++++++ .../mapper/DeviceBmiRecordMapper.xml | 49 +++++++++++-------- .../resources/mapper/DeviceBpRecordMapper.xml | 8 +-- 15 files changed, 129 insertions(+), 31 deletions(-) create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/PhysicalLastRecordVO.java diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/PhysicalSignController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/PhysicalSignController.java index bee20b7..55685e2 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/PhysicalSignController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/PhysicalSignController.java @@ -4,6 +4,7 @@ import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.domain.R; import com.xinelu.familydoctor.entity.*; import com.xinelu.familydoctor.service.PhysicalSignService; +import com.xinelu.familydoctor.vo.PhysicalLastRecordVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -11,6 +12,7 @@ import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.List; import java.util.Map; /** @@ -83,4 +85,11 @@ public class PhysicalSignController extends BaseController { Map map = physicalSignService.record(identity, type, label); return R.ok(map); } + + @ApiOperation("获取最后一次体征记录") + @GetMapping("record/last/{identity}") + @ApiImplicitParam(name = "identity", value = "身份证号", required = true) + public R> lastRecord(@PathVariable String identity) { + return R.ok(physicalSignService.getLastRecord(identity)); + } } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBfRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBfRecord.java index 7f798ad..726428b 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBfRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBfRecord.java @@ -55,7 +55,7 @@ public class DeviceBfRecord implements Serializable { /** * 测量时间 */ - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @ApiModelProperty("测量时间") private Date measureTime; diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBgRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBgRecord.java index c280e7c..6fab43a 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBgRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBgRecord.java @@ -43,7 +43,7 @@ public class DeviceBgRecord implements Serializable { /** * 测量时间 */ - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @ApiModelProperty("测量时间") private Date measureTime; diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBmiRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBmiRecord.java index 43cfa46..9dc2fb6 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBmiRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBmiRecord.java @@ -28,6 +28,18 @@ public class DeviceBmiRecord implements Serializable { @ApiModelProperty("居民身份证号") private String identity; + /** + * 身高(cm) + */ + @ApiModelProperty("身高(cm)") + private BigDecimal height; + + /** + * 体重(kg) + */ + @ApiModelProperty("体重(kg)") + private BigDecimal weight; + /** * BMI(单位:kg/m^2) */ @@ -37,7 +49,7 @@ public class DeviceBmiRecord implements Serializable { /** * 测量时间 */ - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @ApiModelProperty("测量时间") private Date measureTime; diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBoRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBoRecord.java index 6ba73cf..5fe559b 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBoRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBoRecord.java @@ -42,7 +42,7 @@ public class DeviceBoRecord implements Serializable { /** * 测量时间 */ - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @ApiModelProperty("测量时间") private Date measureTime; diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBpRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBpRecord.java index 371ef25..db10f3b 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBpRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceBpRecord.java @@ -48,7 +48,7 @@ public class DeviceBpRecord implements Serializable { /** * 测量时间 */ - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @ApiModelProperty("测量时间") private Date measureTime; diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceHrRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceHrRecord.java index 12f31af..adfe60f 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceHrRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceHrRecord.java @@ -36,7 +36,7 @@ public class DeviceHrRecord implements Serializable { /** * 测量时间 */ - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @ApiModelProperty("测量时间") private Date measureTime; diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceTempRecord.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceTempRecord.java index 9b3c6dd..462946d 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceTempRecord.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/entity/DeviceTempRecord.java @@ -37,7 +37,7 @@ public class DeviceTempRecord implements Serializable { /** * 测量时间 */ - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @ApiModelProperty("测量时间") private Date measureTime; diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/DeviceBgRecordMapper.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/DeviceBgRecordMapper.java index e8ddbfe..f0665ac 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/DeviceBgRecordMapper.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/mapper/DeviceBgRecordMapper.java @@ -2,6 +2,7 @@ package com.xinelu.familydoctor.mapper; import com.xinelu.familydoctor.entity.DeviceBgRecord; import com.xinelu.familydoctor.vo.BgCalcVO; +import com.xinelu.familydoctor.vo.PhysicalLastRecordVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -38,4 +39,5 @@ public interface DeviceBgRecordMapper { int update(DeviceBgRecord record); + List getLastRecord(String identity); } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/PhysicalSignService.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/PhysicalSignService.java index e02cffc..8aae3f9 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/PhysicalSignService.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/PhysicalSignService.java @@ -1,7 +1,9 @@ package com.xinelu.familydoctor.service; import com.xinelu.familydoctor.entity.*; +import com.xinelu.familydoctor.vo.PhysicalLastRecordVO; +import java.util.List; import java.util.Map; public interface PhysicalSignService { @@ -22,4 +24,13 @@ public interface PhysicalSignService { * @date 2023-10-9 10:10 */ Map record(String identity, String type, String label); + + /** + * 获取最后一次记录 + * @param identity 身份证号 + * @return {@link java.util.List} + * @author gaoyu + * @date 2023-10-20 14:56 + */ + List getLastRecord(String identity); } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/PhysicalSignServiceImpl.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/PhysicalSignServiceImpl.java index 5b07dce..5ed14e8 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/PhysicalSignServiceImpl.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/PhysicalSignServiceImpl.java @@ -99,6 +99,11 @@ public class PhysicalSignServiceImpl implements PhysicalSignService { return map; } + @Override + public List getLastRecord(String identity) { + return deviceBgRecordMapper.getLastRecord(identity); + } + private Map bgRecord(String identity, String type) { Map map = new HashMap<>(); List list = deviceBgRecordMapper.getBgRecord(identity, type); diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/PhysicalLastRecordVO.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/PhysicalLastRecordVO.java new file mode 100644 index 0000000..6e3c7f2 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/vo/PhysicalLastRecordVO.java @@ -0,0 +1,27 @@ +package com.xinelu.familydoctor.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + * @author gaoyu + * @description 体征检测最后一次记录 + * @date 2023-10-20 14:28 + */ +@ApiModel("体征检测最后一次记录") +@Data +public class PhysicalLastRecordVO { + @ApiModelProperty("类型1:血糖2:血压3:血脂4:bmi5:血氧6:心率7:体温") + private String type; + @ApiModelProperty("日期") + @JsonFormat(pattern = "yyyy/MM/dd", timezone = "GMT+8") + private Date date; + @ApiModelProperty("时间段1:凌晨2:早餐前3:早晨后4:午餐前5:午餐后6:晚餐前7:晚餐后8:睡前") + private String bucket; + @ApiModelProperty("值") + private String val; +} diff --git a/xinelu-familydoctor/src/main/resources/mapper/DeviceBgRecordMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/DeviceBgRecordMapper.xml index 65ff150..2ff4165 100644 --- a/xinelu-familydoctor/src/main/resources/mapper/DeviceBgRecordMapper.xml +++ b/xinelu-familydoctor/src/main/resources/mapper/DeviceBgRecordMapper.xml @@ -105,4 +105,27 @@ where id = #{id,jdbcType=BIGINT} + + diff --git a/xinelu-familydoctor/src/main/resources/mapper/DeviceBmiRecordMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/DeviceBmiRecordMapper.xml index 6ce7de4..74efbf5 100644 --- a/xinelu-familydoctor/src/main/resources/mapper/DeviceBmiRecordMapper.xml +++ b/xinelu-familydoctor/src/main/resources/mapper/DeviceBmiRecordMapper.xml @@ -7,13 +7,15 @@ + + - id,identity,bmi, - measure_time + id,identity,height, + weight,bmi,measure_time select ifnull(max(bmi), 0) "maxVal", - ifnull(min(bmi), 0) "minVal", - ifnull(avg(bmi), 0) "avgVal", - count(case when bmi >= 18.5 and bmi <= 23.9 then 1 else null end) "normalNum", - count(case when bmi < 18.5 or bmi >= 24 then 1 else null end) "overNum" + ifnull(min(bmi), 0) "minVal", + ifnull(avg(bmi), 0) "avgVal", + count(case when bmi >= 18.5 and bmi <= 23.9 then 1 else null end) "normalNum", + count(case when bmi < 18.5 or bmi >= 24 then 1 else null end) "overNum" from device_bmi_record where identity = #{identity} @@ -73,26 +75,33 @@ - insert into device_bmi_record - (identity,bmi - ,measure_time) - values (#{identity,jdbcType=VARCHAR},#{bmi,jdbcType=DECIMAL} - ,#{measureTime,jdbcType=TIMESTAMP}) + (identity,height + ,weight,bmi,measure_time + ) + values (#{identity,jdbcType=VARCHAR},#{height,jdbcType=DECIMAL} + ,#{weight,jdbcType=DECIMAL},#{bmi,jdbcType=DECIMAL},#{measureTime,jdbcType=TIMESTAMP} + ) update device_bmi_record - - identity = #{identity,jdbcType=VARCHAR}, - - - bmi = #{bmi,jdbcType=DECIMAL}, - - - measure_time = #{measureTime,jdbcType=TIMESTAMP}, - + + identity = #{identity,jdbcType=VARCHAR}, + + + height = #{height,jdbcType=DECIMAL}, + + + weight = #{weight,jdbcType=DECIMAL}, + + + bmi = #{bmi,jdbcType=DECIMAL}, + + + measure_time = #{measureTime,jdbcType=TIMESTAMP}, + where id = #{id,jdbcType=BIGINT} diff --git a/xinelu-familydoctor/src/main/resources/mapper/DeviceBpRecordMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/DeviceBpRecordMapper.xml index e3271ba..e1f307e 100644 --- a/xinelu-familydoctor/src/main/resources/mapper/DeviceBpRecordMapper.xml +++ b/xinelu-familydoctor/src/main/resources/mapper/DeviceBpRecordMapper.xml @@ -51,7 +51,7 @@ select concat(sbp, '/', dbp) "maxSbpVal" from device_bp_record where sbp = (select max(sbp) from device_bp_record - and identity = #{identity} + where identity = #{identity} @@ -99,7 +99,7 @@ select concat(sbp, '/', dbp) "maxDbpVal" from device_bp_record where dbp = (select max(dbp) from device_bp_record - and identity = #{identity} + where identity = #{identity} @@ -147,7 +147,7 @@ select concat(sbp, '/', dbp) "minSbpVal" from device_bp_record where sbp = (select min(sbp) from device_bp_record - and identity = #{identity} + where identity = #{identity} @@ -195,7 +195,7 @@ select concat(sbp, '/', dbp) "minDbpVal" from device_bp_record where dbp = (select min(dbp) from device_bp_record - and identity = #{identity} + where identity = #{identity} From 5c84d8a7cf73b151a0659d9edff5d78b51d7bc25 Mon Sep 17 00:00:00 2001 From: mengkuiliang <1464081137@qq.com> Date: Mon, 23 Oct 2023 09:23:33 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xinelu-familydoctor/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xinelu-familydoctor/pom.xml b/xinelu-familydoctor/pom.xml index 84cb4ac..d32f405 100644 --- a/xinelu-familydoctor/pom.xml +++ b/xinelu-familydoctor/pom.xml @@ -39,5 +39,9 @@ com.xinelu xinelu-nurse-manage + + com.xinelu + xinelu-nurse-applet + From 366cd7b1e17809ea29ba9a2fe03ab5a54156da0a Mon Sep 17 00:00:00 2001 From: mengkuiliang <1464081137@qq.com> Date: Tue, 24 Oct 2023 09:03:00 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83=E6=B7=BB=E5=8A=A0=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=AD=BE=E7=BA=A6=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/ResidentPatientInfoMapper.java | 1 + .../impl/ResidentPatientInfoServiceImpl.java | 91 ++++++++++--------- .../register/ResidentPatientInfoMapper.xml | 1 - .../impl/NurseAppLoginServiceImpl.java | 38 +++++++- .../vo/nurseapplogin/PatientAndDiseaseVO.java | 1 + .../nurseapplogin/NurseAppLoginMapper.xml | 1 + .../mapper/patientinfo/PatientInfoMapper.java | 9 ++ .../manage/patientinfo/PatientInfoMapper.xml | 6 ++ 8 files changed, 101 insertions(+), 47 deletions(-) diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java index 1a5eccc..e656909 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java @@ -103,4 +103,5 @@ public interface ResidentPatientInfoMapper { *@return PatientInfo **/ PatientInfo getPatientInfoByPatientCode(String patientCode); + } 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 a8db06a..3ec65cc 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 @@ -26,6 +26,7 @@ import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; @@ -49,6 +50,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi private AppletAccessTokenUtils appletAccessTokenUtils; @Resource private RedisTemplate redisTemplate; + /** * @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo * @Author mengkuiliang @@ -109,27 +111,27 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi **/ @Override public AppletPhoneVO getPhone(String code) throws Exception { - JSONObject result; - // 获取token - String token_url = String.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appletChatConfig.getAppletId(), appletChatConfig.getSecret()); - SslUtils.ignoreSsl(); - String tokenResult = HttpUtils.sendGet(token_url); - if (tokenResult == null) { - return null; - } - result = JSON.parseObject(tokenResult); - log.info("获取小程序token : {}", result.toJSONString()); - String accessToken = result.getString("access_token"); - if (StringUtils.isEmpty(accessToken)) { - return null; - } - //获取手机号 https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-info/phone-number/getPhoneNumber.html - String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber" + "?access_token=" + accessToken; - JSONObject params = new JSONObject(); - params.put("code", code); - SslUtils.ignoreSsl(); - result = httpService.post(url, null, params); - return JSON.parseObject(result.toString(), AppletPhoneVO.class); + JSONObject result; + // 获取token + String token_url = String.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appletChatConfig.getAppletId(), appletChatConfig.getSecret()); + SslUtils.ignoreSsl(); + String tokenResult = HttpUtils.sendGet(token_url); + if (tokenResult == null) { + return null; + } + result = JSON.parseObject(tokenResult); + log.info("获取小程序token : {}", result.toJSONString()); + String accessToken = result.getString("access_token"); + if (StringUtils.isEmpty(accessToken)) { + return null; + } + //获取手机号 https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-info/phone-number/getPhoneNumber.html + String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber" + "?access_token=" + accessToken; + JSONObject params = new JSONObject(); + params.put("code", code); + SslUtils.ignoreSsl(); + result = httpService.post(url, null, params); + return JSON.parseObject(result.toString(), AppletPhoneVO.class); } /** @@ -154,7 +156,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi public void register(PatientInfoBody body) { if (ObjectUtils.isNotEmpty(body.getCardNo())) { // 修改 - if(!StringUtils.isBlank(body.getPatientCode())) { + if (!StringUtils.isBlank(body.getPatientCode())) { PatientInfo patientInfo = residentPatientInfoMapper.getPatientInfoByPatientCode(body.getPatientCode()); if (ObjectUtils.isNotEmpty(patientInfo)) { BeanUtils.copyBeanProp(patientInfo, body); @@ -164,7 +166,6 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi patientInfo.setDisease("0"); } patientInfo.setLoginFlag(Long.valueOf(1)); - patientInfo.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo())); updatePatientInfo(patientInfo); } // 注册 @@ -175,7 +176,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi if (patientInfo == null) { PatientInfo entity = new PatientInfo(); BeanUtils.copyBeanProp(entity, body); - if(body.getDiseaseList() != null) { + if (body.getDiseaseList() != null) { entity.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(","))); } else { entity.setDisease("0"); @@ -186,7 +187,6 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi entity.setCreateTime(new Date()); entity.setCreateBy(body.getCardNo()); entity.setLoginFlag(Long.valueOf(1)); - entity.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo())); residentPatientInfoMapper.insertPatientInfo(entity); } else { if (!StringUtils.isBlank(patientInfo.getOpenid())) { @@ -203,12 +203,11 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi patientInfo.setHeadPictureUrl(body.getHeadPictureUrl()); patientInfo.setDelFlag(0); patientInfo.setLoginFlag(Long.valueOf(1)); - if(body.getDiseaseList() != null) { + if (body.getDiseaseList() != null) { patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(","))); } else { patientInfo.setDisease("0"); } - patientInfo.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo())); residentPatientInfoMapper.updatePatientInfo(patientInfo); } } @@ -218,15 +217,15 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi // 获取签约信息 private String getSignInfo(String region, String identity) { - if(!StringUtils.isBlank(region)) { + if (!StringUtils.isBlank(region)) { try { // 查询签约信息 String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/resident/signinfo/detail/" + identity, null, String.class); JSONObject jsonObject = JSONObject.parseObject(result); if ("1".equals(jsonObject.get("code"))) { - if(jsonObject.getJSONObject("data") != null) { + if (jsonObject.getJSONObject("data") != null) { SignInfoDetailVo signInfo = JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), SignInfoDetailVo.class); - if(signInfo != null) { + if (signInfo != null) { return signInfo.getSignNo(); } } @@ -278,6 +277,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi * @Param [registerCode] **/ @Override + @Transactional(rollbackFor = Exception.class) public PatientInfo switchResident(String openid, String patientCode) { PatientInfo register = residentPatientInfoMapper.selectPatientInfoByCode(patientCode); if (register == null) { @@ -294,6 +294,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi return residentPatientInfoMapper.selectPatientInfoByCode(patientCode); } + /** 判断2个参数是否一样 */ + /** * @return java.lang.String * @Author mengkuiliang @@ -307,25 +309,27 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi if (list == null || list.size() == 0) { return null; } + PatientInfo patientInfo = null; // 获取当前选中的 List currentList = list.stream().filter(p -> p.getIsChecked().equals("1")).collect(Collectors.toList()); if (currentList.size() > 0) { - if(!StringUtils.isBlank(currentList.get(0).getDisease())) { + if (!StringUtils.isBlank(currentList.get(0).getDisease())) { currentList.get(0).setDiseaseList(Arrays.asList(currentList.get(0).getDisease().split(","))); } - return currentList.get(0); - } else { + patientInfo = currentList.get(0); // 没有已选择的,则取最新注册的一条数据 + } else { // 更新选择标识 residentPatientInfoMapper.updateChecked(list.get(0).getPatientCode(), "1"); - if(!StringUtils.isBlank(list.get(0).getDisease())) { + if (!StringUtils.isBlank(list.get(0).getDisease())) { list.get(0).setDiseaseList(Arrays.asList(list.get(0).getDisease().split(","))); } list.get(0).setIsChecked("1"); - return list.get(0); + patientInfo = list.get(0); } + return patientInfo; } /** @@ -341,19 +345,18 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi } /** + * @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo * @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); }*/ - @Override - public HashMap login(String loginCode,String phoneCode) throws Exception { + public HashMap login(String loginCode, String phoneCode) throws Exception { HashMap HashMap = new HashMap<>(); try { SslUtils.ignoreSsl(); @@ -367,7 +370,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi throw new ServiceException(json.getString("errmsg")); } String openid = json.getString("openid"); - HashMap.put("openid",openid); + HashMap.put("openid", openid); } catch (Exception e) { throw new ServiceException(e.getMessage()); } @@ -376,17 +379,17 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi String cityCode = ""; AppletPhoneVO phone = getPhone(phoneCode); String phoneNumber = phone.getPhoneInfo().getPhoneNumber(); - HashMap.put("phone",phoneNumber); + HashMap.put("phone", phoneNumber); List infoList = residentPatientInfoMapper.selectPatientInfoByPhone(phoneNumber); - code = infoList.size()== 0 ? "0" : "1"; + code = infoList.size() == 0 ? "0" : "1"; //返回绑定城市 - if ("1".equals(code)){ + if ("1".equals(code)) { for (PatientInfo patientInfo : infoList) { cityCode = patientInfo.getCityCode(); } } - HashMap.put("code",code); - HashMap.put("cityCode",cityCode); + HashMap.put("code", code); + HashMap.put("cityCode", cityCode); return HashMap; } } diff --git a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml index 31960eb..7c11c77 100644 --- a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml +++ b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml @@ -487,7 +487,6 @@ update patient_info set is_checked = #{isChecked} where patient_code = #{patientCode} - + + + + + + insert into chat_record message_category, + message_no, + consultation_id, crowds, @@ -165,6 +226,8 @@ #{messageCategory}, + #{messageNo}, + #{consultationId}, #{crowds}, @@ -286,6 +349,32 @@ where del_flag = '0' and read_status = '0' and recipient_id = #{recipientId} + + + update chat_record + + message_category = #{messageCategory}, + consultation_id = #{consultationId}, + crowds = #{crowds}, + crowds_name = #{crowdsName}, + sender_id = #{senderId}, + sender_name = #{senderName}, + send_time = #{sendTime}, + recipient_id = #{recipientId}, + recipient_name = #{recipientName}, + message_type = #{messageType}, + title = #{title}, + content = #{content}, + content_id = #{contentId}, + read_status = #{readStatus}, + read_time = #{readTime}, + del_flag =#{delFlag}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where message_no = #{messageNo} + + delete from chat_record @@ -298,4 +387,9 @@ #{id} + + + + delete from chat_record where message_no = #{messageNo} + diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/chatRecord/ChatRecord.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/chatRecord/ChatRecord.java index 664a888..39cb003 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/chatRecord/ChatRecord.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/chatRecord/ChatRecord.java @@ -34,6 +34,11 @@ public class ChatRecord extends BaseEntity implements Serializable { */ private Long id; + /** + * 消息业务主键 + */ + private String messageNo; + /** * 消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知 */ From 6f499cd4a55513727bfc69f068d7ff86ae03a6e9 Mon Sep 17 00:00:00 2001 From: mengkuiliang <1464081137@qq.com> Date: Wed, 25 Oct 2023 17:23:00 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=8E=A5=E5=8F=A3=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applet/pojo/dto/FDMessageDto.java | 2 +- .../chatrecord/ChatRecordController.java | 16 +++++ .../applet/dto/chatrecord/MarkReadDto.java | 2 +- .../dto/chatrecord/MessageSearchDto.java | 4 +- .../dto/messagepush/FDMessagePushDto.java | 2 +- .../mapper/chatrecord/ChatRecordMapper.java | 9 +++ .../chatRecord/IChatRecordService.java | 9 +++ .../impl/ChatRecordServiceImpl.java | 64 +++++++++++++++++-- .../applet/vo/chatrecord/MessageCenterVo.java | 2 +- .../applet/vo/chatrecord/MessageVo.java | 2 +- .../applet/chatrecord/ChatRecordMapper.xml | 36 +++++++++++ .../manage/patientinfo/PatientInfoMapper.xml | 4 +- 12 files changed, 139 insertions(+), 13 deletions(-) diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/dto/FDMessageDto.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/dto/FDMessageDto.java index 8e17161..5919e50 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/dto/FDMessageDto.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/pojo/dto/FDMessageDto.java @@ -16,7 +16,7 @@ import lombok.Data; @Data public class FDMessageDto extends FDMessageExtentDto { - @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询") + @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知") private String messageCategory; @ApiModelProperty("通知适用人群(0:全部人群)") diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/chatrecord/ChatRecordController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/chatrecord/ChatRecordController.java index 6b80fdd..81c117c 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/chatrecord/ChatRecordController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/chatrecord/ChatRecordController.java @@ -4,12 +4,15 @@ import com.xinelu.applet.dto.chatrecord.ChatRecordDTO; import com.xinelu.applet.dto.chatrecord.MessageSearchDto; import com.xinelu.applet.service.chatRecord.IChatRecordService; import com.xinelu.applet.vo.chatrecord.MessageCenterVo; +import com.xinelu.applet.vo.chatrecord.MessageVo; import com.xinelu.common.annotation.Log; import com.xinelu.common.constant.Constants; 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.enums.BusinessType; +import com.xinelu.common.exception.ServiceException; import com.xinelu.common.socket.WebSocketUtils; import com.xinelu.manage.domain.chatRecord.ChatRecord; import io.swagger.annotations.Api; @@ -101,6 +104,19 @@ public class ChatRecordController extends BaseController { return R.ok(chatRecordService.getMegVoList(messageDto)); } + @ApiOperation(value = "获取指定类型的消息记录", notes = "1:通知公告 2:健康推送 4:消息通知") + @GetMapping("/getMegList") + public TableDataInfo getMegList(MessageSearchDto messageDto) { + if (messageDto.getPatientId() == null) { + throw new ServiceException("居民业务主键不能为空"); + } + if (StringUtils.isBlank(messageDto.getMessageCategory())) { + throw new ServiceException("消息类型不能为空"); + } + startPage(); + return getDataTable(chatRecordService.getMegList(messageDto)); + } + @ApiOperation("删除消息") @GetMapping("/deleteMegs") public R deleteMegs(@RequestBody List ids) { diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MarkReadDto.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MarkReadDto.java index a56809c..08a910e 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MarkReadDto.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MarkReadDto.java @@ -14,7 +14,7 @@ import lombok.Data; @ApiModel("标记为已读传输对象") public class MarkReadDto { - @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询") + @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知") private String messageCategory; @ApiModelProperty("绑定编号") diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MessageSearchDto.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MessageSearchDto.java index c85521e..c63a489 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MessageSearchDto.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/MessageSearchDto.java @@ -14,14 +14,14 @@ import lombok.Data; @Data public class MessageSearchDto { - @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询") + @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知") private String messageCategory; @ApiModelProperty("通知适用人群(0:全部人群)") private String crowds; @ApiModelProperty(value = "居民注册业务主键") - private String bindingNo; + private Long patientId; @ApiModelProperty("发送人编号") private Long senderId; diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDMessagePushDto.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDMessagePushDto.java index c8f6f6f..8885af9 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDMessagePushDto.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/messagepush/FDMessagePushDto.java @@ -18,7 +18,7 @@ public class FDMessagePushDto extends FDMessageExtentDto{ @ApiModelProperty("业务主键") private String messageNo; - @ApiModelProperty(value = "消息类别 1:通知公告,2:健康推送,3:在线咨询", required = true) + @ApiModelProperty(value = "消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知", required = true) private String messageCategory; @ApiModelProperty("通知适用人群(0:全部人群)") diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/chatrecord/ChatRecordMapper.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/chatrecord/ChatRecordMapper.java index 484f981..68551d2 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/chatrecord/ChatRecordMapper.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/chatrecord/ChatRecordMapper.java @@ -18,6 +18,15 @@ public interface ChatRecordMapper { List selectMegVoList(MessageSearchDto messageDto); + /** + * @Author mengkuiliang + * @Description + * @Date 2023-10-25 025 15:25 + * @Param [bindingNo, doctorNo] + * @return com.xinelu.applet.vo.chatrecord.MessageCenterVo + **/ + List selectMegList(MessageSearchDto messageDto); + MessageCenterVo selectOneChatRecord(@Param("bindingNo")Long bindingNo, @Param("doctorNo")Long doctorNo); /** * 查询图文咨询-聊天记录 diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/IChatRecordService.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/IChatRecordService.java index dadd924..77fbc76 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/IChatRecordService.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/IChatRecordService.java @@ -81,6 +81,15 @@ public interface IChatRecordService { List getMegVoList(MessageSearchDto messageDto); + /** + * @Author mengkuiliang + * @Description 获取指定类型的消息记录 + * @Date 2023-10-25 025 15:22 + * @Param [messageDto] + * @return java.util.List + **/ + List getMegList(MessageSearchDto messageDto); + Integer deleteMegs(List ids); diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/impl/ChatRecordServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/impl/ChatRecordServiceImpl.java index 2df83dd..83363db 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/impl/ChatRecordServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/chatRecord/impl/ChatRecordServiceImpl.java @@ -1,5 +1,6 @@ package com.xinelu.applet.service.chatRecord.impl; +import com.alibaba.fastjson2.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.xinelu.applet.dto.chatrecord.ChatRecordDTO; @@ -10,6 +11,7 @@ import com.xinelu.applet.vo.chatrecord.MessageCenterVo; import com.xinelu.applet.vo.chatrecord.MessageVo; import com.xinelu.common.config.XinELuConfig; import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.domain.R; import com.xinelu.common.core.dto.MessageTemplate; import com.xinelu.common.enums.MessageContentType; import com.xinelu.common.exception.ServiceException; @@ -19,19 +21,20 @@ import com.xinelu.common.utils.DateUtils; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.file.FileUploadUtils; import com.xinelu.common.utils.file.MimeTypeUtils; +import com.xinelu.common.utils.http.HttpService; +import com.xinelu.common.utils.spring.SpringUtils; import com.xinelu.common.utils.uuid.IdUtils; import com.xinelu.manage.domain.chatRecord.ChatRecord; import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.time.ZoneId; +import java.util.*; import java.util.stream.Collectors; import javax.annotation.Resource; import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo; import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService; +import com.xinelu.manage.service.patientinfo.IPatientInfoService; +import com.xinelu.manage.vo.patientinfo.PatientInfoVO; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -51,6 +54,10 @@ public class ChatRecordServiceImpl implements IChatRecordService { private XinELuConfig xinYiLuConfig; @Resource private IHospitalPersonInfoService hospitalPersonInfoService; + @Resource + private IPatientInfoService patientInfoService; + @Resource + private HttpService httpService; /** * 查询图文咨询-聊天记录 @@ -224,6 +231,53 @@ public class ChatRecordServiceImpl implements IChatRecordService { return messageCenterVos; } + /** + * @Author mengkuiliang + * @Description 获取指定类型的消息记录 + * @Date 2023-10-25 025 15:21 + * @Param [messageDto] + * @return java.util.List + **/ + @Override + public List getMegList(MessageSearchDto messageDto) { + // 获取注册信息 + PatientInfoVO patientInfo = patientInfoService.selectPatientInfoById(messageDto.getPatientId()); + if (patientInfo == null) { + throw new ServiceException("未查询到注册信息"); + } + String bindTimeStr = String.valueOf(patientInfo.getBindingTime().getYear()) + String.valueOf(patientInfo.getBindingTime().getMonthValue()) + String.valueOf(patientInfo.getBindingTime().getDayOfMonth()) + String.valueOf(patientInfo.getBindingTime().getHour()) + String.valueOf(patientInfo.getBindingTime().getMinute()) + String.valueOf(patientInfo.getBindingTime().getSecond()); + messageDto.setBindingTime(DateUtils.parseDate(bindTimeStr)); + + // 通知公告 + if(messageDto.getMessageCategory().equals("1")) { + return chatRecordMapper.selectMegList(messageDto); + // 健康推送 + } else if(messageDto.getMessageCategory().equals("2")) { + String result = (String) httpService.get(SpringUtils.getFdUrl(patientInfo.getCityCode()) + "/resident/signinfo/detail/" + patientInfo.getCardNo(), null, String.class); + JSONObject jsonObject = JSONObject.parseObject(result); + if (!"1".equals(jsonObject.get("code"))) { + throw new ServiceException(jsonObject.get("msg").toString()); + } + if (!jsonObject.containsKey("data") || jsonObject.get("data") == null) { + throw new ServiceException("未查询到签约信息"); + } + JSONObject signInfoObject = jsonObject.getJSONObject("data"); + HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoService.getByPersonCode(signInfoObject.getString("userNo"), null); + if (hospitalPersonInfo == null) { + throw new ServiceException("未查询到医生信息"); + } + messageDto.setSenderId(hospitalPersonInfo.getId()); + messageDto.setCrowdNoList(Arrays.asList(signInfoObject.getString("crowdsNo").split(","))); + return chatRecordMapper.selectMegList(messageDto); + // 消息通知 + } else if(messageDto.getMessageCategory().equals("4")) { + messageDto.setRecipientId(patientInfo.getId()); + return chatRecordMapper.selectMegList(messageDto); + } else { + return new ArrayList<>(); + } + } + @Override public Integer deleteMegs(List ids) { return chatRecordMapper.deleteMegs(ids); } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageCenterVo.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageCenterVo.java index 4cdbb0f..dda4074 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageCenterVo.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageCenterVo.java @@ -15,7 +15,7 @@ import lombok.Data; @Data public class MessageCenterVo { - @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询") + @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知") private String messageCategory; @ApiModelProperty("通知适用人群(0:全部人群)") diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageVo.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageVo.java index d495ee3..a5a401e 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageVo.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/chatrecord/MessageVo.java @@ -18,7 +18,7 @@ public class MessageVo { @ApiModelProperty("业务主键") private String messageNo; - @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询") + @ApiModelProperty("消息类别 1:通知公告,2:健康推送,3:在线咨询 4:消息通知") private String messageCategory; @ApiModelProperty("通知适用人群(0:全部人群)") diff --git a/xinelu-nurse-applet/src/main/resources/mapper/applet/chatrecord/ChatRecordMapper.xml b/xinelu-nurse-applet/src/main/resources/mapper/applet/chatrecord/ChatRecordMapper.xml index 2659791..7ef99ca 100644 --- a/xinelu-nurse-applet/src/main/resources/mapper/applet/chatrecord/ChatRecordMapper.xml +++ b/xinelu-nurse-applet/src/main/resources/mapper/applet/chatrecord/ChatRecordMapper.xml @@ -78,6 +78,42 @@ order by send_time desc + + + diff --git a/xinelu-familydoctor/src/main/resources/mapper/EvaluateSurveyMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/EvaluateSurveyMapper.xml index f7aad1a..efc198c 100644 --- a/xinelu-familydoctor/src/main/resources/mapper/EvaluateSurveyMapper.xml +++ b/xinelu-familydoctor/src/main/resources/mapper/EvaluateSurveyMapper.xml @@ -21,7 +21,7 @@ - id,survey_name,use_flag, + id,survey_subject,use_flag, create_time,create_by,update_time, update_by,del_flag,remark From d60716f02ed581234d138989ae7fb683a77ad604 Mon Sep 17 00:00:00 2001 From: HaoWang <1477026787@qq.com> Date: Fri, 27 Oct 2023 11:00:23 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E8=87=AA=E8=AF=84=E7=AD=94=E6=A1=88=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/familydoctor/EvaluateSurveyController.java | 2 +- .../service/impl/EvaluateRecordServiceImpl.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateSurveyController.java b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateSurveyController.java index a51b713..5c8fa2e 100644 --- a/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateSurveyController.java +++ b/xinelu-admin/src/main/java/com/xinelu/web/controller/familydoctor/EvaluateSurveyController.java @@ -67,7 +67,7 @@ public class EvaluateSurveyController extends BaseController { @ApiOperation("问卷提交") @PostMapping("survey/submit") - public AjaxResult surveySubmit(EvaluateRecord evaluateRecord) { + public AjaxResult surveySubmit(@RequestBody EvaluateRecord evaluateRecord) { evaluateRecordService.submit(evaluateRecord); return AjaxResult.success(); } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateRecordServiceImpl.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateRecordServiceImpl.java index 16e098c..c4c5af3 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateRecordServiceImpl.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/service/impl/EvaluateRecordServiceImpl.java @@ -8,8 +8,8 @@ import com.xinelu.familydoctor.mapper.EvaluateRecordMapper; import com.xinelu.familydoctor.service.EvaluateRecordService; import com.xinelu.familydoctor.vo.EvaluateRecordResultVO; import com.xinelu.familydoctor.vo.EvaluateRecordTimelineVO; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.util.*; @@ -31,7 +31,7 @@ public class EvaluateRecordServiceImpl implements EvaluateRecordService { entity.setCreateTime(new Date()); evaluateRecordMapper.insert(entity); List answers = entity.getAnswers(); - if (CollectionUtils.isEmpty(answers)) { + if (CollectionUtils.isNotEmpty(answers)) { for (EvaluateAnswer answer : answers) { answer.setRecordId(entity.getId()); evaluateAnswerMapper.insert(answer); @@ -44,7 +44,7 @@ public class EvaluateRecordServiceImpl implements EvaluateRecordService { List records = evaluateRecordMapper.getTimeline(userId); List timeline = new ArrayList<>(); Map> map = new HashMap<>(); - if (!CollectionUtils.isEmpty(records)) { + if (CollectionUtils.isNotEmpty(records)) { records.forEach(r -> { List resultList; if (!map.containsKey(DateUtils.formatDate(r.getCreateTime(), "yyyy-MM-dd"))) {