From 3d0034ef0d3d1a290adda34d7cd40754231f0e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=81=92?= <3226558941@qq.com> Date: Wed, 11 Oct 2023 16:11:59 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/nurseapplogin/NurseAppLoginController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java index 57e073d..1ad7185 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java @@ -97,5 +97,4 @@ public class NurseAppLoginController extends BaseController { List appointmentOrderDetails = nurseAppLoginService.selectAppServiceOrderItem(patientId, orderStatus); return getDataTable(appointmentOrderDetails); } -} - +} \ No newline at end of file From 2f85d88146a159e2b2c7631dcd2fb4377b8473e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=97=AD?= <17615834396@163.com> Date: Thu, 12 Oct 2023 09:10:52 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=96=B0app=E7=99=BB=E5=BD=95=E3=80=81?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/config/SecurityConfig.java | 2 +- .../newapp/NewAppLoginController.java | 29 ++++ .../mapper/newapp/NewAppLoginMapper.java | 14 ++ .../service/newapp/NewAppLoginService.java | 15 ++ .../newapp/impl/NewAppLoginServiceImpl.java | 30 ++++ .../applet/newapp/NewAppLoginMapper.xml | 21 +++ .../HospitalPersonInfoController.java | 10 ++ .../HospitalPersonInfoDtoo.java | 144 ++++++++++++++++++ .../HospitalPersonInfoMapper.java | 9 ++ .../IHospitalPersonInfoService.java | 8 + .../impl/HospitalPersonInfoServiceImpl.java | 11 ++ .../HospitalPersonInfoMapper.xml | 51 +++++++ 12 files changed, 343 insertions(+), 1 deletion(-) create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/newapp/NewAppLoginMapper.java create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/newapp/NewAppLoginService.java create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/newapp/impl/NewAppLoginServiceImpl.java create mode 100644 xinelu-nurse-applet/src/main/resources/mapper/applet/newapp/NewAppLoginMapper.xml create mode 100644 xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/hospitalpersoninfo/HospitalPersonInfoDtoo.java diff --git a/xinelu-framework/src/main/java/com/xinelu/framework/config/SecurityConfig.java b/xinelu-framework/src/main/java/com/xinelu/framework/config/SecurityConfig.java index d9cf943..23f6341 100644 --- a/xinelu-framework/src/main/java/com/xinelu/framework/config/SecurityConfig.java +++ b/xinelu-framework/src/main/java/com/xinelu/framework/config/SecurityConfig.java @@ -112,7 +112,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { // 过滤请求 .authorizeRequests() // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - .antMatchers("/login", "/register", "/captchaImage").anonymous() + .antMatchers("/login", "/register", "/captchaImage","/newapp/login/appLogin").anonymous() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/newapp/NewAppLoginController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/newapp/NewAppLoginController.java index 386fa41..997e35c 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/newapp/NewAppLoginController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/newapp/NewAppLoginController.java @@ -1,4 +1,33 @@ package com.xinelu.applet.controller.newapp; +import com.xinelu.applet.service.newapp.NewAppLoginService; +import com.xinelu.common.core.domain.AjaxResult; +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +@RestController +@RequestMapping("/newapp/login") public class NewAppLoginController { + + @Resource + private NewAppLoginService newAppLoginService; + + /** + * 新app登录 + * @param personAccount + * @param personPassword + * @return + */ + @PostMapping("/appLogin") + public AjaxResult login(@RequestParam("personAccount") String personAccount, @RequestParam("personPassword") String personPassword) { + if (StringUtils.isBlank(personAccount)) { + return AjaxResult.error("请输入账号!"); + } + if (StringUtils.isBlank(personPassword)) { + return AjaxResult.error("请输入密码!"); + } + return AjaxResult.success(newAppLoginService.login(personAccount, personPassword)); + } } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/newapp/NewAppLoginMapper.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/newapp/NewAppLoginMapper.java new file mode 100644 index 0000000..9a2319c --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/mapper/newapp/NewAppLoginMapper.java @@ -0,0 +1,14 @@ +package com.xinelu.applet.mapper.newapp; + +import org.apache.ibatis.annotations.Param; + +public interface NewAppLoginMapper { + + /** + * 新app登录 + * @param personAccount + * @param personPassword + * @return + */ + int login(@Param("personAccount") String personAccount, @Param("personPassword") String personPassword); +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/newapp/NewAppLoginService.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/newapp/NewAppLoginService.java new file mode 100644 index 0000000..bb892f2 --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/newapp/NewAppLoginService.java @@ -0,0 +1,15 @@ +package com.xinelu.applet.service.newapp; + +import com.xinelu.common.core.domain.AjaxResult; +import org.springframework.stereotype.Service; + +@Service +public interface NewAppLoginService { + /** + * 新app登录 + * @param personAccount + * @param personPassword + * @return + */ + AjaxResult login(String personAccount, String personPassword); +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/newapp/impl/NewAppLoginServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/newapp/impl/NewAppLoginServiceImpl.java new file mode 100644 index 0000000..353cd6c --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/newapp/impl/NewAppLoginServiceImpl.java @@ -0,0 +1,30 @@ +package com.xinelu.applet.service.newapp.impl; + +import com.xinelu.applet.mapper.newapp.NewAppLoginMapper; +import com.xinelu.applet.service.newapp.NewAppLoginService; +import com.xinelu.common.core.domain.AjaxResult; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; + +@Service +public class NewAppLoginServiceImpl implements NewAppLoginService { + + @Resource + private NewAppLoginMapper newAppLoginMapper; + + /** + * 新app登录 + * @param personAccount + * @param personPassword + * @return + */ + @Override + public AjaxResult login(String personAccount, String personPassword) { + int count = newAppLoginMapper.login(personAccount, personPassword); + if (count>0){ + return AjaxResult.success("登录成功!"); + }else { + return AjaxResult.error("账号或密码错误!"); + } + } +} diff --git a/xinelu-nurse-applet/src/main/resources/mapper/applet/newapp/NewAppLoginMapper.xml b/xinelu-nurse-applet/src/main/resources/mapper/applet/newapp/NewAppLoginMapper.xml new file mode 100644 index 0000000..c5f7b20 --- /dev/null +++ b/xinelu-nurse-applet/src/main/resources/mapper/applet/newapp/NewAppLoginMapper.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/hospitalpersoninfo/HospitalPersonInfoController.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/hospitalpersoninfo/HospitalPersonInfoController.java index 5165f48..412e32a 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/hospitalpersoninfo/HospitalPersonInfoController.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/hospitalpersoninfo/HospitalPersonInfoController.java @@ -10,6 +10,7 @@ import com.xinelu.common.enums.BusinessType; import com.xinelu.common.utils.poi.ExcelUtil; import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo; import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDTO; +import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDtoo; import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService; import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO; import io.swagger.annotations.Api; @@ -108,6 +109,15 @@ public class HospitalPersonInfoController extends BaseController { return hospitalPersonInfoService.updateHospitalPersonInfo(hospitalPersonInfo); } + /** + * 修改健康咨询-科室人员信息 + * @return + */ + @PostMapping("/update") + public AjaxResult update(@RequestBody HospitalPersonInfoDtoo hospitalPersonInfo) { + return AjaxResult.success(hospitalPersonInfoService.editHospitalPersonInfo(hospitalPersonInfo)); + } + /** * 删除健康咨询-科室人员信息 */ diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/hospitalpersoninfo/HospitalPersonInfoDtoo.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/hospitalpersoninfo/HospitalPersonInfoDtoo.java new file mode 100644 index 0000000..be76a74 --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/hospitalpersoninfo/HospitalPersonInfoDtoo.java @@ -0,0 +1,144 @@ +package com.xinelu.manage.dto.hospitalpersoninfo; + +import com.xinelu.common.annotation.Excel; +import com.xinelu.common.core.domain.BaseDomain; +import com.xinelu.common.custominterface.Insert; +import com.xinelu.common.custominterface.Update; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.hibernate.validator.constraints.Length; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 健康咨询-科室人员信息对象 hospital_person_info + * + * @author xinyilu + * @date 2023-02-14 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "健康咨询-科室人员信息对象", description = "hospital_person_info") +public class HospitalPersonInfoDtoo extends BaseDomain implements Serializable { + private static final long serialVersionUID = 8750821883343940709L; + /** + * 主键id + */ + private Long id; + + /** + * 所属医院id + */ + @ApiModelProperty(value = "所属医院id") + @Excel(name = "所属医院id") + private Long hospitalId; + + /** + * 所属部门id + */ + @ApiModelProperty(value = "所属部门id") + @Excel(name = "所属部门id") + private Long departmentId; + + /** + * 科室人员编码 + */ + @ApiModelProperty(value = "科室人员编码") + @Excel(name = "科室人员编码") + private String personCode; + + /** + * 科室人员名称 + */ + @ApiModelProperty(value = "科室人员名称") + @Excel(name = "科室人员名称") + @Length(max = 50, message = "科室人员名称不能超过50位", groups = {Insert.class, Update.class}) + private String personName; + + /** + * 科室人员联系电话 + */ + @ApiModelProperty(value = "科室人员联系电话") + @Excel(name = "科室人员联系电话") + private String personPhone; + + /** + * 科室人员地址 + */ + @ApiModelProperty(value = "科室人员地址") + @Excel(name = "科室人员地址") + @Length(max = 300, message = "科室人员地址不能超过300位", groups = {Insert.class, Update.class}) + private String personAddress; + + /** + * 身份证号 + */ + @ApiModelProperty(value = "身份证号") + @Excel(name = "身份证号") + 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") + @Excel(name = "人员职称,主任医师:CHIEF_PHYSICIAN,副主任医师:DEPUTY_CHIEF_PHYSICIAN,主治医师:ATTENDING_DOCTOR,医师:PHYSICIAN,医士:HEALER,住院医师:RESIDENT_PHYSICIAN") + private String academicTitle; + + /** + * 咨询费用 + */ + @ApiModelProperty(value = "咨询费用") + @Excel(name = "咨询费用") + private BigDecimal consultingFee; + + /** + * 个人简介 + */ + @ApiModelProperty(value = "个人简介") + @Excel(name = "个人简介") + private String personIntroduce; + + /** + * 显示顺序 + */ + @ApiModelProperty(value = "显示顺序") + @Excel(name = "显示顺序") + private Integer personSort; + + /** + * 科室人员头像地址 + */ + private String personPictureUrl; + + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("hospitalId", getHospitalId()) + .append("departmentId", getDepartmentId()) + .append("personCode", getPersonCode()) + .append("personName", getPersonName()) + .append("personPhone", getPersonPhone()) + .append("personAddress", getPersonAddress()) + .append("cardNo", getCardNo()) + .append("academicTitle", getAcademicTitle()) + .append("consultingFee", getConsultingFee()) + .append("personIntroduce", getPersonIntroduce()) + .append("personSort", getPersonSort()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .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 9a4492d..1a9e9ab 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 @@ -1,6 +1,7 @@ package com.xinelu.manage.mapper.hospitalpersoninfo; import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo; +import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDtoo; import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO; import java.util.List; import org.apache.ibatis.annotations.Param; @@ -53,6 +54,14 @@ public interface HospitalPersonInfoMapper { */ int updateHospitalPersonInfo(HospitalPersonInfo hospitalPersonInfo); + /** + * 修改健康咨询-科室人员信息 + * + * @param hospitalPersonInfo 健康咨询-科室人员信息 + * @return 结果 + */ + int editHospitalPersonInfo(HospitalPersonInfoDtoo 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 c792c35..f066d16 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 @@ -3,6 +3,7 @@ package com.xinelu.manage.service.hospitalpersoninfo; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo; import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDTO; +import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDtoo; import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO; import java.util.List; @@ -69,4 +70,11 @@ public interface IHospitalPersonInfoService { * @param pictureUrl 图片地址 **/ void deletePictureUrl(String pictureUrl); + + /** + * 修改医生手机号和密码 + * @param hospitalPersonInfo + * @return + */ + int editHospitalPersonInfo(HospitalPersonInfoDtoo 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 c55a4fe..3a24c3e 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 @@ -11,6 +11,7 @@ import com.xinelu.common.utils.regex.RegexUtil; import com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate; import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo; import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDTO; +import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDtoo; import com.xinelu.manage.mapper.hospitalpersoncertificate.HospitalPersonCertificateMapper; import com.xinelu.manage.mapper.hospitalpersoninfo.HospitalPersonInfoMapper; import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService; @@ -316,4 +317,14 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService } } } + + /** + * 修改医生手机号和密码 + * @param hospitalPersonInfo + * @return + */ + @Override + public int editHospitalPersonInfo(HospitalPersonInfoDtoo hospitalPersonInfo) { + return hospitalPersonInfoMapper.editHospitalPersonInfo(hospitalPersonInfo); + } } 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 98a8196..1932e78 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 @@ -332,6 +332,57 @@ where id = #{id} + + update hospital_person_info + + hospital_id = + #{hospitalId}, + + department_id = + #{departmentId}, + + person_code = + #{personCode}, + + 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}, + + create_by = + #{createBy}, + + create_time = + #{createTime}, + + update_by = + #{updateBy}, + + update_time = + #{updateTime}, + + + where id = #{id} + + delete from hospital_person_info From 5d0e66f56825440b1dbe3b87faa86dfbd06b8d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=81=92?= <3226558941@qq.com> Date: Thu, 12 Oct 2023 14:09:57 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=A7=BB=E6=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NurseAppLoginController.java | 16 +++++ .../nurseapplogin/NurseAppLoginService.java | 8 +++ .../impl/NurseAppLoginServiceImpl.java | 58 ++++++++----------- .../applet/vo/nurseapplogin/AppLoginVO.java | 45 ++++++++++++++ 4 files changed, 93 insertions(+), 34 deletions(-) create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nurseapplogin/AppLoginVO.java diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java index 1ad7185..8f4b3bb 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/nurseapplogin/NurseAppLoginController.java @@ -35,6 +35,22 @@ public class NurseAppLoginController extends BaseController { @Resource private NurseAppLoginService nurseAppLoginService; + + /** + * 判断用户是否完善信息-微信小程序和APP共用 + * + * @param patientId 用户id + * @return 结果 + */ + @MobileRequestAuthorization + @GetMapping("/AppIdentification") + public AjaxResult getIdentification(Long patientId) { + if (Objects.isNull(patientId)) { + return AjaxResult.error("当前用户信息不存在,无法完善个人信息!"); + } + return nurseAppLoginService.getIdentification(patientId); + } + /** * 查询护理人列表信息(会员小程序和App共用) * diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/NurseAppLoginService.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/NurseAppLoginService.java index d0e8947..7d51962 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/NurseAppLoginService.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/NurseAppLoginService.java @@ -14,6 +14,14 @@ import java.util.List; */ public interface NurseAppLoginService { + /** + * 判断用户是否完善信息-微信小程序和APP共用 + * + * @param patientId 用户id + * @return 结果 + */ + AjaxResult getIdentification(Long patientId); + /** * 查询护理人列表信息 * diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/impl/NurseAppLoginServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/impl/NurseAppLoginServiceImpl.java index 18f1336..55276f9 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/impl/NurseAppLoginServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseapplogin/impl/NurseAppLoginServiceImpl.java @@ -1,67 +1,36 @@ package com.xinelu.applet.service.nurseapplogin.impl; -import com.xinelu.applet.dto.appletlogin.AppletUserInfoDTO; import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO; import com.xinelu.applet.mapper.appletlogin.AppletLoginMapper; import com.xinelu.applet.mapper.nurseapplogin.NurseAppLoginMapper; -import com.xinelu.applet.mapper.patientcenter.PatientCenterMapper; -import com.xinelu.applet.service.messagepush.MessagePushService; import com.xinelu.applet.service.nurseapplogin.NurseAppLoginService; import com.xinelu.applet.utils.AppointmentTimeUtil; import com.xinelu.applet.vo.appletlogin.NurserStationItemConsumableVO; import com.xinelu.applet.vo.appletlogin.NurserStationItemInfoVO; +import com.xinelu.applet.vo.nurseapplogin.AppLoginVO; import com.xinelu.applet.vo.nurseapplogin.PatientAndDiseaseVO; import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO; import com.xinelu.applet.vo.specialdisease.WeekDaysVO; -import com.xinelu.common.config.AppletChatConfig; -import com.xinelu.common.config.XinELuConfig; -import com.xinelu.common.constant.Constants; import com.xinelu.common.core.domain.AjaxResult; -import com.xinelu.common.enums.*; -import com.xinelu.common.exception.ServiceException; +import com.xinelu.common.enums.AppointmentTimeIntervalEnum; +import com.xinelu.common.enums.GooodsOrderStatusEnum; import com.xinelu.common.utils.AgeUtil; -import com.xinelu.common.utils.bean.BeanUtils; -import com.xinelu.common.utils.codes.GenerateSystemCodeUtil; -import com.xinelu.common.utils.regex.RegexUtil; -import com.xinelu.manage.domain.coupon.Coupon; import com.xinelu.manage.domain.goodsOrder.GoodsOrder; -import com.xinelu.manage.domain.patientcouponreceive.PatientCouponReceive; -import com.xinelu.manage.domain.patientdiseaseinfo.PatientDiseaseInfo; -import com.xinelu.manage.domain.patientinfo.PatientInfo; -import com.xinelu.manage.domain.patientintegralchange.PatientIntegralChange; -import com.xinelu.manage.domain.receiveAddressInfo.ReceiveAddressInfo; -import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord; -import com.xinelu.manage.domain.systemsettingsinfo.SystemSettingsInfo; -import com.xinelu.manage.mapper.coupon.CouponMapper; -import com.xinelu.manage.mapper.patientcouponreceive.PatientCouponReceiveMapper; -import com.xinelu.manage.mapper.patientdiseaseinfo.PatientDiseaseInfoMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; -import com.xinelu.manage.mapper.patientintegralchange.PatientIntegralChangeMapper; -import com.xinelu.manage.mapper.receiveAddressInfo.ReceiveAddressInfoMapper; -import com.xinelu.manage.mapper.subscribemessagerecord.SubscribeMessageRecordMapper; import com.xinelu.manage.mapper.sysarea.SysAreaMapper; -import com.xinelu.manage.mapper.systemsettingsinfo.SystemSettingsInfoMapper; -import com.xinelu.manage.vo.patientcouponreceive.PatientCouponReceiveInfoVO; import com.xinelu.manage.vo.patientinfo.PatientInfoVO; import com.xinelu.manage.vo.sysarea.SysAreaVO; import com.xinelu.system.domain.SysConfig; import com.xinelu.system.mapper.SysConfigMapper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.compress.utils.Lists; -import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.io.File; import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.LocalDateTime; import java.time.LocalTime; import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -83,6 +52,27 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService { private AppointmentTimeUtil appointmentTimeUtil; @Resource private SysConfigMapper sysConfigMapper; + @Resource + private PatientInfoMapper patientInfoMapper; + + + /** + * 判断用户是否完善信息-微信小程序和APP共用 + * + * @param patientId 用户id + * @return 结果 + */ + @Override + public AjaxResult getIdentification(Long patientId) { + //判断当前用户信息是否存在 + PatientInfoVO patientInfo = patientInfoMapper.getPatientInfoById(patientId); + if (Objects.isNull(patientInfo)) { + return AjaxResult.error("当前用户信息不存在,无法完善个人信息!"); + } + AppLoginVO appLoginVO = new AppLoginVO(); + appLoginVO.setLoginFlag(Objects.nonNull(patientInfo.getLoginFlag()) && patientInfo.getLoginFlag() == 1); + return AjaxResult.success(appLoginVO); + } /** * 查询护理人列表信息 diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nurseapplogin/AppLoginVO.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nurseapplogin/AppLoginVO.java new file mode 100644 index 0000000..ab3ecc5 --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nurseapplogin/AppLoginVO.java @@ -0,0 +1,45 @@ +package com.xinelu.applet.vo.nurseapplogin; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 登录信息返回标识 + * + * @author zhangheng + * @date 2022-10-12 + */ +@Data +public class AppLoginVO implements Serializable { + private static final long serialVersionUID = 1820130502268738492L; + /** + * 返回提示信息 + */ + private String message; + + /** + * 登录标识标识 + */ + private Boolean registerFlag; + + /** + * 完善信息标识 + */ + private Boolean loginFlag; + + /** + * 用户id + */ + private Long patientId; + + /** + * 用户姓名 + */ + private String patientName; + + /** + * 用户手机号 + */ + private String phone; +} From 8cf706fa6e9cdc52c70f80872dc17c14405fdd06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=81=92?= <3226558941@qq.com> Date: Thu, 12 Oct 2023 14:39:10 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=A7=BB=E6=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AppletLoginServiceImpl.java | 17 -- ...NurseAppletPersonWorkOrderServiceImpl.java | 18 -- .../impl/NursePersonAppLoginServiceImpl.java | 31 --- .../AppointmentOrderProcessRecordMapper.java | 72 ------- .../impl/AppointmentOrderServiceImpl.java | 18 -- .../AppointmentOrderProcessRecordMapper.xml | 187 ------------------ .../OrderEvaluatePictureInfoMapper.xml | 0 7 files changed, 343 deletions(-) delete mode 100644 xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/appointmentorderprocessrecord/AppointmentOrderProcessRecordMapper.java delete mode 100644 xinelu-nurse-manage/src/main/resources/mapper/manage/appointmentorderprocessrecord/AppointmentOrderProcessRecordMapper.xml rename xinelu-nurse-manage/src/main/resources/{ => mapper/manage}/orderevaluatepictureinfo/OrderEvaluatePictureInfoMapper.xml (100%) diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/impl/AppletLoginServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/impl/AppletLoginServiceImpl.java index 3f5d240..d1ce709 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/impl/AppletLoginServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/impl/AppletLoginServiceImpl.java @@ -24,12 +24,10 @@ import com.xinelu.common.utils.StringUtils; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.manage.domain.appointmentorder.AppointmentOrder; import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails; -import com.xinelu.manage.domain.appointmentorderprocessrecord.AppointmentOrderProcessRecord; import com.xinelu.manage.domain.patientinfo.PatientInfo; import com.xinelu.manage.domain.sysarea.SysArea; import com.xinelu.manage.mapper.appointmentorder.AppointmentOrderMapper; import com.xinelu.manage.mapper.appointmentorderdetails.AppointmentOrderDetailsMapper; -import com.xinelu.manage.mapper.appointmentorderprocessrecord.AppointmentOrderProcessRecordMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; import com.xinelu.manage.mapper.sysarea.SysAreaMapper; import com.xinelu.manage.vo.patientinfo.PatientInfoVO; @@ -76,8 +74,6 @@ public class AppletLoginServiceImpl implements AppletLoginService { private AppointmentOrderDetailsMapper appointmentOrderDetailsMapper; @Resource private AppletAccessTokenUtil appletAccessTokenUtil; - @Resource - private AppointmentOrderProcessRecordMapper appointmentOrderProcessRecordMapper; /** @@ -444,19 +440,6 @@ public class AppletLoginServiceImpl implements AppletLoginService { log.info("新增预约订单主表失败,失败原因:[{}]", appointmentOrder); throw new ServiceException("预约护理信息失败,请联系管理员!"); } - //新增预约订单流程记录信息表 - AppointmentOrderProcessRecord appointment = new AppointmentOrderProcessRecord(); - appointment.setOperatePersonId(dto.getPatientId()); - appointment.setAppointmentOrderId(appointmentOrder.getId()); - appointment.setAppointmentOrderNo(orderNo); - appointment.setOperateTime(LocalDateTime.now()); - appointment.setOperateType(OrderProcessOperateTypeEnum.PLACE_ORDER.getInfo()); - appointment.setOperateDetails("预约订单下单操作"); - appointment.setCreateTime(LocalDateTime.now()); - int count = appointmentOrderProcessRecordMapper.insertAppointmentOrderProcessRecord(appointment); - if (count <= 0) { - throw new ServiceException("预约订单流程记录失败,请联系管理员!"); - } } /** diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseappletpersonworkorder/Impl/NurseAppletPersonWorkOrderServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseappletpersonworkorder/Impl/NurseAppletPersonWorkOrderServiceImpl.java index 1c82e10..bdf26ed 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseappletpersonworkorder/Impl/NurseAppletPersonWorkOrderServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nurseappletpersonworkorder/Impl/NurseAppletPersonWorkOrderServiceImpl.java @@ -4,13 +4,10 @@ package com.xinelu.applet.service.nurseappletpersonworkorder.Impl; import com.xinelu.applet.dto.nursepersonapplogin.OrderFallbackDTO; import com.xinelu.applet.service.nurseappletpersonworkorder.NurseAppletPersonWorkOrderService; import com.xinelu.common.core.domain.AjaxResult; -import com.xinelu.common.enums.OrderProcessOperateTypeEnum; import com.xinelu.common.enums.OrderStatusEnum; import com.xinelu.common.exception.ServiceException; -import com.xinelu.manage.domain.appointmentorderprocessrecord.AppointmentOrderProcessRecord; import com.xinelu.manage.mapper.appointmentorder.AppointmentOrderMapper; import com.xinelu.manage.mapper.appointmentorderdetails.AppointmentOrderDetailsMapper; -import com.xinelu.manage.mapper.appointmentorderprocessrecord.AppointmentOrderProcessRecordMapper; import com.xinelu.manage.service.stationmessagepush.StationMessagePushService; import com.xinelu.manage.vo.appointmentorder.AppointmentReceivingOrderVO; import lombok.extern.slf4j.Slf4j; @@ -18,7 +15,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.time.LocalDateTime; import java.util.Objects; /** @@ -33,8 +29,6 @@ public class NurseAppletPersonWorkOrderServiceImpl implements NurseAppletPersonW @Resource private AppointmentOrderMapper appointmentOrderMapper; @Resource - private AppointmentOrderProcessRecordMapper appointmentOrderProcessRecordMapper; - @Resource private StationMessagePushService stationMessagePushService; @Resource private AppointmentOrderDetailsMapper appointmentOrderDetailsMapper; @@ -56,18 +50,6 @@ public class NurseAppletPersonWorkOrderServiceImpl implements NurseAppletPersonW if (update < 0) { throw new ServiceException("接单失败,请联系管理员!"); } - AppointmentOrderProcessRecord appointmentOrderProcessRecord = new AppointmentOrderProcessRecord(); - appointmentOrderProcessRecord.setAppointmentOrderNo(orderFallbackDTO.getAppointmentOrderNo()); - appointmentOrderProcessRecord.setCreateTime(LocalDateTime.now()); - appointmentOrderProcessRecord.setOperatePersonId(orderFallbackDTO.getStationPersonId()); - appointmentOrderProcessRecord.setOperateTime(LocalDateTime.now()); - appointmentOrderProcessRecord.setOperateType(OrderProcessOperateTypeEnum.RECEIVE_ORDER.getInfo()); - appointmentOrderProcessRecord.setAppointmentOrderId(orderFallbackDTO.getAppointmentOrderId()); - appointmentOrderProcessRecord.setOperateDetails("接单"); - int count = appointmentOrderProcessRecordMapper.insertAppointmentOrderProcessRecord(appointmentOrderProcessRecord); - if (count <= 0) { - throw new ServiceException("增加预约订单流程记录失败,请联系管理员!"); - } //异步发送消息 stationMessagePushService.receivingOrdersOperationsPush(appointmentReceivingOrder); return AjaxResult.success(); diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nursepersonapplogin/impl/NursePersonAppLoginServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nursepersonapplogin/impl/NursePersonAppLoginServiceImpl.java index 4d112f3..31e4fd1 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nursepersonapplogin/impl/NursePersonAppLoginServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/nursepersonapplogin/impl/NursePersonAppLoginServiceImpl.java @@ -7,7 +7,6 @@ import com.xinelu.applet.service.nursepersonapplogin.INursePersonAppLoginService import com.xinelu.applet.vo.nursepersonapplogin.*; import com.xinelu.common.config.XinELuConfig; import com.xinelu.common.core.domain.AjaxResult; -import com.xinelu.common.enums.OrderProcessOperateTypeEnum; import com.xinelu.common.enums.OrderStatusEnum; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.AgeUtil; @@ -16,12 +15,10 @@ import com.xinelu.common.utils.file.MimeTypeUtils; import com.xinelu.common.utils.regex.RegexUtil; import com.xinelu.common.utils.sign.Md5Utils; import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails; -import com.xinelu.manage.domain.appointmentorderprocessrecord.AppointmentOrderProcessRecord; import com.xinelu.manage.domain.nursestationperson.NurseStationPerson; import com.xinelu.manage.domain.nursestationpersonrevenue.NurseStationPersonRevenue; import com.xinelu.manage.domain.patientdiseaseinfo.PatientDiseaseInfo; import com.xinelu.manage.mapper.appointmentorderdetails.AppointmentOrderDetailsMapper; -import com.xinelu.manage.mapper.appointmentorderprocessrecord.AppointmentOrderProcessRecordMapper; import com.xinelu.manage.mapper.nursestation.NurseStationMapper; import com.xinelu.manage.mapper.nursestationperson.NurseStationPersonMapper; import com.xinelu.manage.mapper.nursestationpersonrevenue.NurseStationPersonRevenueMapper; @@ -71,8 +68,6 @@ public class NursePersonAppLoginServiceImpl implements INursePersonAppLoginServi @Resource private XinELuConfig xinYiLuConfig; @Resource - private AppointmentOrderProcessRecordMapper appointmentOrderProcessRecordMapper; - @Resource private NurseStationPersonRevenueMapper nurseStationPersonRevenueMapper; @Resource private PatientDiseaseInfoMapper patientDiseaseInfoMapper; @@ -173,19 +168,6 @@ public class NursePersonAppLoginServiceImpl implements INursePersonAppLoginServi if (update <= 0) { throw new ServiceException("任务退回失败,请联系管理员!"); } - //流程记录 - AppointmentOrderProcessRecord appointmentOrderProcessRecord = new AppointmentOrderProcessRecord(); - appointmentOrderProcessRecord.setAppointmentOrderNo(orderFallbackDTO.getAppointmentOrderNo()); - appointmentOrderProcessRecord.setCreateTime(LocalDateTime.now()); - appointmentOrderProcessRecord.setOperatePersonId(orderFallbackDTO.getStationPersonId()); - appointmentOrderProcessRecord.setOperateTime(LocalDateTime.now()); - appointmentOrderProcessRecord.setOperateType(OrderProcessOperateTypeEnum.ACTIVE_BACK_ORDER.getInfo()); - appointmentOrderProcessRecord.setOperateDetails(orderFallbackDTO.getTaskReturnReason()); - appointmentOrderProcessRecord.setAppointmentOrderId(orderFallbackDTO.getAppointmentOrderId()); - int count = appointmentOrderProcessRecordMapper.insertAppointmentOrderProcessRecord(appointmentOrderProcessRecord); - if (count <= 0) { - throw new ServiceException("预约订单流程记录失败,请联系管理员!"); - } //异步发送信息 stationMessagePushService.refusalOrdersOperationsPush(appointmentReceivingOrder); return AjaxResult.success(); @@ -227,19 +209,6 @@ public class NursePersonAppLoginServiceImpl implements INursePersonAppLoginServi if (stationPersonRevenue <= 0) { throw new ServiceException("新增护理员订单佣金收益记录失败,请联系管理员!"); } - //新增预约订单流程记录信息表 - AppointmentOrderProcessRecord appointment = new AppointmentOrderProcessRecord(); - appointment.setOperatePersonId(Objects.isNull(orderDetails.getNurseStationPersonId()) ? null : orderDetails.getNurseStationPersonId()); - appointment.setAppointmentOrderId(Objects.isNull(orderDetails.getId()) ? null : orderDetails.getId()); - appointment.setAppointmentOrderNo(StringUtils.isBlank(orderDetails.getOrderNo()) ? "" : orderDetails.getOrderNo()); - appointment.setOperateTime(LocalDateTime.now()); - appointment.setOperateType(OrderProcessOperateTypeEnum.FINISH_ORDER.getInfo()); - appointment.setOperateDetails("预约订单任务完成操作"); - appointment.setCreateTime(LocalDateTime.now()); - int count = appointmentOrderProcessRecordMapper.insertAppointmentOrderProcessRecord(appointment); - if (count <= 0) { - throw new ServiceException("预约订单流程记录失败,请联系管理员!"); - } //更新护理员账户总金额 Long nurseStationPersonId = Objects.isNull(orderDetails.getNurseStationPersonId()) ? 0 : orderDetails.getNurseStationPersonId(); BigDecimal orderCommissionAmount = Objects.isNull(orderDetails.getOrderCommissionAmount()) ? BigDecimal.ZERO : orderDetails.getOrderCommissionAmount(); diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/appointmentorderprocessrecord/AppointmentOrderProcessRecordMapper.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/appointmentorderprocessrecord/AppointmentOrderProcessRecordMapper.java deleted file mode 100644 index e2930c4..0000000 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/mapper/appointmentorderprocessrecord/AppointmentOrderProcessRecordMapper.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.xinelu.manage.mapper.appointmentorderprocessrecord; - - - -import com.xinelu.manage.domain.appointmentorderprocessrecord.AppointmentOrderProcessRecord; - -import java.util.List; - - -/** - * 预约订单流程记录信息Mapper接口 - * - * @author xinyilu - * @date 2023-03-29 - */ -public interface AppointmentOrderProcessRecordMapper { - /** - * 查询预约订单流程记录信息 - * - * @param id 预约订单流程记录信息主键 - * @return 预约订单流程记录信息 - */ - AppointmentOrderProcessRecord selectAppointmentOrderProcessRecordById(Long id); - - /** - * 查询预约订单流程记录信息列表 - * - * @param appointmentOrderProcessRecord 预约订单流程记录信息 - * @return 预约订单流程记录信息集合 - */ - List selectAppointmentOrderProcessRecordList(AppointmentOrderProcessRecord appointmentOrderProcessRecord); - - /** - * 新增预约订单流程记录信息 - * - * @param appointmentOrderProcessRecord 预约订单流程记录信息 - * @return 结果 - */ - int insertAppointmentOrderProcessRecord(AppointmentOrderProcessRecord appointmentOrderProcessRecord); - - /** - * 修改预约订单流程记录信息 - * - * @param appointmentOrderProcessRecord 预约订单流程记录信息 - * @return 结果 - */ - int updateAppointmentOrderProcessRecord(AppointmentOrderProcessRecord appointmentOrderProcessRecord); - - /** - * 删除预约订单流程记录信息 - * - * @param id 预约订单流程记录信息主键 - * @return 结果 - */ - int deleteAppointmentOrderProcessRecordById(Long id); - - /** - * 批量删除预约订单流程记录信息 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - int deleteAppointmentOrderProcessRecordByIds(Long[] ids); - - /** - * 批量新增预约订单流程记录信息 - * - * @param appointmentOrderProcessRecordList 预约订单流程记录信息 - * @return 结果 - */ - int insertAppointmentOrderProcessRecordList(List appointmentOrderProcessRecordList); -} diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/appointmentorder/impl/AppointmentOrderServiceImpl.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/appointmentorder/impl/AppointmentOrderServiceImpl.java index 44dc677..e019e27 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/appointmentorder/impl/AppointmentOrderServiceImpl.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/appointmentorder/impl/AppointmentOrderServiceImpl.java @@ -3,18 +3,15 @@ package com.xinelu.manage.service.appointmentorder.impl; import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.enums.AppointmentOrderTypeEnum; -import com.xinelu.common.enums.OrderProcessOperateTypeEnum; import com.xinelu.common.enums.OrderStatusEnum; import com.xinelu.common.exception.ServiceException; import com.xinelu.common.utils.SecurityUtils; import com.xinelu.manage.domain.appointmentorder.AppointmentOrder; import com.xinelu.manage.domain.appointmentorderconsumable.AppointmentOrderConsumable; import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails; -import com.xinelu.manage.domain.appointmentorderprocessrecord.AppointmentOrderProcessRecord; import com.xinelu.manage.mapper.appointmentorder.AppointmentOrderMapper; import com.xinelu.manage.mapper.appointmentorderconsumable.AppointmentOrderConsumableMapper; import com.xinelu.manage.mapper.appointmentorderdetails.AppointmentOrderDetailsMapper; -import com.xinelu.manage.mapper.appointmentorderprocessrecord.AppointmentOrderProcessRecordMapper; import com.xinelu.manage.service.appointmentorder.IAppointmentOrderService; import com.xinelu.manage.service.stationmessagepush.StationMessagePushService; import com.xinelu.manage.vo.appointmentorder.AppointmentOrderVO; @@ -47,8 +44,6 @@ public class AppointmentOrderServiceImpl implements IAppointmentOrderService { private AppointmentOrderConsumableMapper appointmentOrderConsumableMapper; @Resource private StationMessagePushService stationMessagePushService; - @Resource - private AppointmentOrderProcessRecordMapper appointmentOrderProcessRecordMapper; /** * 查询预约订单信息 @@ -183,19 +178,6 @@ public class AppointmentOrderServiceImpl implements IAppointmentOrderService { if (updateAppointmentOrderStatus <= 0) { throw new ServiceException("派单失败,请联系管理员!"); } - //记录订单流程信息 - AppointmentOrderProcessRecord appointmentOrderProcessRecord = new AppointmentOrderProcessRecord(); - appointmentOrderProcessRecord.setAppointmentOrderNo(appointmentOrder.getOrderNo()); - appointmentOrderProcessRecord.setCreateTime(LocalDateTime.now()); - appointmentOrderProcessRecord.setOperatePersonId(appointmentOrder.getNurseStationPersonId()); - appointmentOrderProcessRecord.setOperateTime(LocalDateTime.now()); - appointmentOrderProcessRecord.setOperateType(OrderProcessOperateTypeEnum.DISPATCH_ORDER.getInfo()); - appointmentOrderProcessRecord.setAppointmentOrderId(appointmentOrders.getId()); - appointmentOrderProcessRecord.setOperateDetails("派单"); - int count = appointmentOrderProcessRecordMapper.insertAppointmentOrderProcessRecord(appointmentOrderProcessRecord); - if (count <= 0) { - throw new ServiceException("增加预约订单流程记录失败,请联系管理员!"); - } stationMessagePushService.waitReceiveMessagePush(appointmentOrder); return AjaxResult.success(); } diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/appointmentorderprocessrecord/AppointmentOrderProcessRecordMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/appointmentorderprocessrecord/AppointmentOrderProcessRecordMapper.xml deleted file mode 100644 index 541d12e..0000000 --- a/xinelu-nurse-manage/src/main/resources/mapper/manage/appointmentorderprocessrecord/AppointmentOrderProcessRecordMapper.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - select id, - operate_person_id, - appointment_order_id, - appointment_order_no, - operate_time, - operate_type, - operate_details, - create_by, - create_time, - update_by, - update_time - from appointment_order_process_record - - - - - - - - insert into appointment_order_process_record - - operate_person_id, - - appointment_order_id, - - appointment_order_no, - - operate_time, - - operate_type, - - operate_details, - - create_by, - - create_time, - - update_by, - - update_time, - - - - #{operatePersonId}, - - #{appointmentOrderId}, - - #{appointmentOrderNo}, - - #{operateTime}, - - #{operateType}, - - #{operateDetails}, - - #{createBy}, - - #{createTime}, - - #{updateBy}, - - #{updateTime}, - - - - - - update appointment_order_process_record - - operate_person_id = - #{operatePersonId}, - - appointment_order_id = - #{appointmentOrderId}, - - appointment_order_no = - #{appointmentOrderNo}, - - operate_time = - #{operateTime}, - - operate_type = - #{operateType}, - - operate_details = - #{operateDetails}, - - create_by = - #{createBy}, - - create_time = - #{createTime}, - - update_by = - #{updateBy}, - - update_time = - #{updateTime}, - - - where id = #{id} - - - - delete - from appointment_order_process_record - where id = #{id} - - - - delete from appointment_order_process_record where id in - - #{id} - - - - - insert into appointment_order_process_record( - appointment_order_id, - appointment_order_no, - operate_time, - operate_type, - operate_details, - create_time - ) values - - ( - #{appointmentOrderProcessRecordList.appointmentOrderId}, - #{appointmentOrderProcessRecordList.appointmentOrderNo}, - #{appointmentOrderProcessRecordList.operateTime}, - #{appointmentOrderProcessRecordList.operateType}, - #{appointmentOrderProcessRecordList.operateDetails}, - #{appointmentOrderProcessRecordList.createTime} - ) - - - diff --git a/xinelu-nurse-manage/src/main/resources/orderevaluatepictureinfo/OrderEvaluatePictureInfoMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/orderevaluatepictureinfo/OrderEvaluatePictureInfoMapper.xml similarity index 100% rename from xinelu-nurse-manage/src/main/resources/orderevaluatepictureinfo/OrderEvaluatePictureInfoMapper.xml rename to xinelu-nurse-manage/src/main/resources/mapper/manage/orderevaluatepictureinfo/OrderEvaluatePictureInfoMapper.xml From db302aa2adbb6726af41ab55a6d38046593391d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=97=AD?= <17615834396@163.com> Date: Fri, 13 Oct 2023 10:00:38 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E9=AA=8C=E8=AF=81=E6=98=AF=E5=90=A6=E5=B7=B2?= =?UTF-8?q?=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applet/ResidentPatientInfoController.java | 16 +-- .../mapper/ResidentPatientInfoMapper.java | 2 + .../service/IResidentPatientInfoService.java | 7 +- .../impl/ResidentPatientInfoServiceImpl.java | 46 ++++++++- .../applet/utils/AppletAccessTokenUtils.java | 98 +++++++++++++++++++ .../register/ResidentPatientInfoMapper.xml | 8 ++ 6 files changed, 161 insertions(+), 16 deletions(-) create mode 100644 xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/utils/AppletAccessTokenUtils.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 2ad4e55..12d3945 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 @@ -13,15 +13,9 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.domain.R; -import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.util.List; @@ -127,10 +121,16 @@ public class ResidentPatientInfoController extends BaseController { return R.ok(residentPatientInfoService.getCurrentResident(openid, cityCode)); } - @ApiOperation("是否已注册") + /*@ApiOperation("是否已注册") @GetMapping(value = "/isRegistered/{code}") public R isRegistered(@PathVariable("code") String code) { return R.ok(residentPatientInfoService.isRegistered(code)); + }*/ + + @ApiOperation("是否已注册") + @GetMapping(value = "/login/{loginCode}/{phoneCode}") + public AjaxResult isRegistered(@PathVariable("loginCode") String loginCode, @PathVariable("phoneCode") String phoneCode) { + return AjaxResult.success(residentPatientInfoService.login(loginCode,phoneCode)); } /** 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 1ae6046..8eb0e0c 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 @@ -94,4 +94,6 @@ public interface ResidentPatientInfoMapper { * @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo **/ PatientInfo getByCardNo(String cardNo); + + int selectPatientInfoByPhone(String phone); } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java index 2f8f316..f8122e9 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java @@ -3,9 +3,7 @@ package com.xinelu.familydoctor.applet.service; import com.alibaba.fastjson2.JSONObject; import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody; import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo; -import com.xinelu.familydoctor.applet.pojo.query.PatientInfoQuery; -import org.springframework.stereotype.Service; - +import java.util.HashMap; import java.util.List; /** @@ -122,5 +120,6 @@ public interface IResidentPatientInfoService { * @Param [code] * @return java.lang.Object **/ - PatientInfo isRegistered(String code); + //PatientInfo isRegistered(String code); + HashMap login(String logincode,String phoneCode); } 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 82bb98a..b80d9b0 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 @@ -2,14 +2,16 @@ package com.xinelu.familydoctor.applet.service.impl; import java.util.Arrays; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import com.xinelu.common.config.AppletChatConfig; -import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.entity.AppletPhoneVO; import com.xinelu.common.exception.ServiceException; +import com.xinelu.common.utils.AppletChatUtil; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.http.HttpService; import com.xinelu.common.utils.http.HttpUtils; @@ -19,10 +21,10 @@ 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.service.IResidentPatientInfoService; +import com.xinelu.familydoctor.applet.utils.AppletAccessTokenUtils; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -43,6 +45,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi private HttpService httpService; @Resource private AppletChatConfig appletChatConfig; + @Resource + private AppletAccessTokenUtils appletAccessTokenUtils; /** * @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo @@ -88,7 +92,9 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi if (!json.containsKey("openid")) { throw new ServiceException(json.getString("errmsg")); } - return json.getString("openid"); + String openid = json.getString("openid"); + return openid; + //return json.getString("openid"); } catch (Exception e) { throw new ServiceException(e.getMessage()); } @@ -322,8 +328,40 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi * @Param [code] * @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo **/ - @Override + /*@Override public PatientInfo isRegistered(String code) { return getCurrentResident(getOpenId(code), null); + }*/ + + @Override + public HashMap login(String loginCode,String phoneCode) { + HashMap HashMap = new HashMap<>(); + try { + SslUtils.ignoreSsl(); + String params = "appid=" + appletChatConfig.getAppletId() + "&secret=" + appletChatConfig.getSecret() + "&js_code=" + loginCode + "&grant_type=" + appletChatConfig.getGrantType(); + log.info("获取openID请求参数{}", params); + String result = HttpUtils.sendPost("https://api.weixin.qq.com/sns/jscode2session", params); + JSONObject json = JSONObject.parseObject(result); + // {"errcode":40029,"errmsg":"invalid code, rid: 650bf9c3-31a6c960-2b437029"} + log.info("获取openID响应结果{}", json.toJSONString()); + if (!json.containsKey("openid")) { + throw new ServiceException(json.getString("errmsg")); + } + String openid = json.getString("openid"); + HashMap.put("openid",openid); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + //获取微信accessToken + String accessToken; + //是否注册状态码 + String code; + accessToken = appletAccessTokenUtils.getAppletAccessToken(); + //获取用户手机号 + AppletPhoneVO appletPhoneInfo = AppletChatUtil.getAppletPhoneInfo(phoneCode, accessToken); + HashMap.put("phone",appletPhoneInfo.getPhoneInfo().getPhoneNumber()); + code = residentPatientInfoMapper.selectPatientInfoByPhone(appletPhoneInfo.getPhoneInfo().getPhoneNumber()) == 0 ? "0" : "1"; + HashMap.put("code",code); + return HashMap; } } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/utils/AppletAccessTokenUtils.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/utils/AppletAccessTokenUtils.java new file mode 100644 index 0000000..b126972 --- /dev/null +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/utils/AppletAccessTokenUtils.java @@ -0,0 +1,98 @@ +package com.xinelu.familydoctor.applet.utils; + +import com.xinelu.common.config.AppletChatConfig; +import com.xinelu.common.config.NurseAppletChatConfig; +import com.xinelu.common.constant.Constants; +import com.xinelu.common.entity.AppletAccessToken; +import com.xinelu.common.exception.ServiceException; +import com.xinelu.common.utils.AppletChatUtil; +import org.apache.commons.lang3.StringUtils; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.Objects; +import java.util.concurrent.TimeUnit; + +/** + * @Description 获取小程序AccessToken公共方法 + * @Author 纪寒 + * @Date 2023-02-27 18:02:05 + * @Version 1.0 + */ +@Component +public class AppletAccessTokenUtils { + + @Resource + private RedisTemplate redisTemplate; + @Resource + private AppletChatConfig appletChatConfig; + @Resource + private NurseAppletChatConfig nurseAppletChatConfig; + /** + * 返回成功状态码 + */ + private static final int SUCCESS_CODE = 0; + + /** + * 获取小程序AccessToken方法 + * + * @return 小程序的AccessToken + */ + public String getAppletAccessToken() { + String accessToken; + String accessTokenKey = Constants.NURSE_STATION_APPLET_ACCESS_TOKEN + "accessToken"; + //从Redis中取出accessToken + Object object = redisTemplate.opsForValue().get(accessTokenKey); + if (Objects.isNull(object)) { + //没有,获取accessToken + AppletAccessToken appletAccessToken = AppletChatUtil.getAppletAccessToken(appletChatConfig.getAppletId(), appletChatConfig.getSecret()); + if (Objects.isNull(appletAccessToken)) { + throw new ServiceException("获取微信小程序accessToken信息失败"); + } + if (Objects.nonNull(appletAccessToken.getErrcode()) && appletAccessToken.getErrcode() != SUCCESS_CODE) { + throw new ServiceException("获取微信小程序accessToken信息失败,失败信息为:" + appletAccessToken.getErrmsg(), 201); + } + if (StringUtils.isBlank(appletAccessToken.getAccessToken())) { + throw new ServiceException("accessToken信息为空"); + } + //存入Redis中 + redisTemplate.opsForValue().set(accessTokenKey, appletAccessToken.getAccessToken(), 3600, TimeUnit.SECONDS); + accessToken = appletAccessToken.getAccessToken(); + } else { + accessToken = (String) object; + } + return accessToken; + } + + /** + * 护理员小程序获取小程序AccessToken方法 + * + * @return 小程序的AccessToken + */ + public String getPersonAppletAccessToken() { + String accessToken; + String accessTokenKey = Constants.NURSE_STATION_PERSON_APPLET_ACCESS_TOKEN + "accessToken"; + //从Redis中取出accessToken + Object object = redisTemplate.opsForValue().get(accessTokenKey); + if (Objects.isNull(object)) { + //没有,获取accessToken + AppletAccessToken appletAccessToken = AppletChatUtil.getAppletAccessToken(nurseAppletChatConfig.getAppletId(), nurseAppletChatConfig.getSecret()); + if (Objects.isNull(appletAccessToken)) { + throw new ServiceException("获取微信小程序accessToken信息失败"); + } + if (Objects.nonNull(appletAccessToken.getErrcode()) && appletAccessToken.getErrcode() != SUCCESS_CODE) { + throw new ServiceException("获取微信小程序accessToken信息失败,失败信息为:" + appletAccessToken.getErrmsg(), 201); + } + if (StringUtils.isBlank(appletAccessToken.getAccessToken())) { + throw new ServiceException("accessToken信息为空"); + } + //存入Redis中 + redisTemplate.opsForValue().set(accessTokenKey, appletAccessToken.getAccessToken(), 3600, TimeUnit.SECONDS); + accessToken = appletAccessToken.getAccessToken(); + } else { + accessToken = (String) object; + } + return accessToken; + } +} \ No newline at end of file diff --git a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml index 4d26796..5574d49 100644 --- a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml +++ b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml @@ -451,4 +451,12 @@ update patient_info set is_checked = #{isChecked} where patient_code = #{patientCode} + + + + From c6aa56e95427b0e35228651e8a63b0853f120862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=97=AD?= <17615834396@163.com> Date: Fri, 13 Oct 2023 13:11:53 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E6=B3=A8=E5=86=8Cbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applet/ResidentPatientInfoController.java | 17 +------ .../service/IResidentPatientInfoService.java | 6 +-- .../impl/ResidentPatientInfoServiceImpl.java | 44 +++++-------------- 3 files changed, 16 insertions(+), 51 deletions(-) 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 12d3945..da46c82 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 @@ -1,11 +1,8 @@ package com.xinelu.web.controller.applet; -import com.alibaba.fastjson2.JSONObject; import com.xinelu.common.config.XinELuConfig; import com.xinelu.common.core.domain.AjaxResult; -import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.file.FileUploadUtils; -import com.xinelu.common.utils.file.MimeTypeUtils; + import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody; import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo; import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService; @@ -47,16 +44,6 @@ public class ResidentPatientInfoController extends BaseController { } } - @ApiOperation("获取微信手机号") - @GetMapping("/getPhone/{code}") - public R getPhone(@PathVariable String code) { - try { - return R.ok(residentPatientInfoService.getPhone(code)); - } catch (Exception e) { - return R.fail(e.getMessage()); - } - } - @ApiOperation("注册完善信息") @PostMapping("") public R register(@Validated @RequestBody PatientInfoBody body) { @@ -129,7 +116,7 @@ public class ResidentPatientInfoController extends BaseController { @ApiOperation("是否已注册") @GetMapping(value = "/login/{loginCode}/{phoneCode}") - public AjaxResult isRegistered(@PathVariable("loginCode") String loginCode, @PathVariable("phoneCode") String phoneCode) { + public AjaxResult isRegistered(@PathVariable("loginCode") String loginCode, @PathVariable("phoneCode") String phoneCode) throws Exception { return AjaxResult.success(residentPatientInfoService.login(loginCode,phoneCode)); } diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java index f8122e9..257ce37 100644 --- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java +++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/IResidentPatientInfoService.java @@ -1,6 +1,6 @@ package com.xinelu.familydoctor.applet.service; -import com.alibaba.fastjson2.JSONObject; +import com.xinelu.common.entity.AppletPhoneVO; import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody; import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo; import java.util.HashMap; @@ -48,7 +48,7 @@ public interface IResidentPatientInfoService { * @Param [code] * @return java.lang.String **/ - JSONObject getPhone(String code) throws Exception; + AppletPhoneVO getPhone(String code) throws Exception; /** * @return java.lang.String @@ -121,5 +121,5 @@ public interface IResidentPatientInfoService { * @return java.lang.Object **/ //PatientInfo isRegistered(String code); - HashMap login(String logincode,String phoneCode); + HashMap login(String logincode,String phoneCode) throws Exception; } 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 b80d9b0..de51f3c 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 @@ -1,9 +1,6 @@ package com.xinelu.familydoctor.applet.service.impl; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; import com.alibaba.fastjson2.JSON; @@ -11,7 +8,6 @@ import com.alibaba.fastjson2.JSONObject; import com.xinelu.common.config.AppletChatConfig; import com.xinelu.common.entity.AppletPhoneVO; import com.xinelu.common.exception.ServiceException; -import com.xinelu.common.utils.AppletChatUtil; import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.http.HttpService; import com.xinelu.common.utils.http.HttpUtils; @@ -25,6 +21,7 @@ import com.xinelu.familydoctor.applet.utils.AppletAccessTokenUtils; import lombok.extern.slf4j.Slf4j; 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 javax.annotation.Resource; @@ -47,7 +44,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi private AppletChatConfig appletChatConfig; @Resource private AppletAccessTokenUtils appletAccessTokenUtils; - + @Resource + private RedisTemplate redisTemplate; /** * @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo * @Author mengkuiliang @@ -94,7 +92,6 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi } String openid = json.getString("openid"); return openid; - //return json.getString("openid"); } catch (Exception e) { throw new ServiceException(e.getMessage()); } @@ -108,11 +105,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi * @Param [code] **/ @Override - public JSONObject getPhone(String code) { - - try { + 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(); @@ -126,25 +120,13 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi 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); - if (result == null) { - return null; - } - log.info("获取小程序手机号 : {}", result.toJSONString()); - if (result.getInteger("errcode") != 0) { - return null; - } - return result; - } catch (Exception e) { - e.printStackTrace(); - } - return null; + return JSON.parseObject(result.toString(), AppletPhoneVO.class); } /** @@ -334,7 +316,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi }*/ @Override - public HashMap login(String loginCode,String phoneCode) { + public HashMap login(String loginCode,String phoneCode) throws Exception { HashMap HashMap = new HashMap<>(); try { SslUtils.ignoreSsl(); @@ -352,15 +334,11 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi } catch (Exception e) { throw new ServiceException(e.getMessage()); } - //获取微信accessToken - String accessToken; - //是否注册状态码 String code; - accessToken = appletAccessTokenUtils.getAppletAccessToken(); - //获取用户手机号 - AppletPhoneVO appletPhoneInfo = AppletChatUtil.getAppletPhoneInfo(phoneCode, accessToken); - HashMap.put("phone",appletPhoneInfo.getPhoneInfo().getPhoneNumber()); - code = residentPatientInfoMapper.selectPatientInfoByPhone(appletPhoneInfo.getPhoneInfo().getPhoneNumber()) == 0 ? "0" : "1"; + AppletPhoneVO phone = getPhone(phoneCode); + String phoneNumber = phone.getPhoneInfo().getPhoneNumber(); + HashMap.put("phone",phoneNumber); + code = residentPatientInfoMapper.selectPatientInfoByPhone(phoneNumber) == 0 ? "0" : "1"; HashMap.put("code",code); return HashMap; } From 5adc8f677010c8f2f49a9eaa8ed114e84e08220e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=97=AD?= <17615834396@163.com> Date: Fri, 13 Oct 2023 14:16:52 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AFBug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xinelu/applet/vo/nurseapplogin/PatientAndDiseaseVO.java | 5 +++++ .../mapper/applet/nurseapplogin/NurseAppLoginMapper.xml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nurseapplogin/PatientAndDiseaseVO.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nurseapplogin/PatientAndDiseaseVO.java index 503ca73..d7f757e 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nurseapplogin/PatientAndDiseaseVO.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/vo/nurseapplogin/PatientAndDiseaseVO.java @@ -153,4 +153,9 @@ public class PatientAndDiseaseVO implements Serializable { */ private String disablingReason; + /** + * 用户编号 + */ + private String patientCode; + } diff --git a/xinelu-nurse-applet/src/main/resources/mapper/applet/nurseapplogin/NurseAppLoginMapper.xml b/xinelu-nurse-applet/src/main/resources/mapper/applet/nurseapplogin/NurseAppLoginMapper.xml index 34607d0..c4d7e1e 100644 --- a/xinelu-nurse-applet/src/main/resources/mapper/applet/nurseapplogin/NurseAppLoginMapper.xml +++ b/xinelu-nurse-applet/src/main/resources/mapper/applet/nurseapplogin/NurseAppLoginMapper.xml @@ -23,6 +23,7 @@ + @@ -79,6 +80,7 @@ pi.location_name, pi.disabling_condition, pi.disabling_reason, + pi.patient_code, pdi.id patientDiseaseId, pdi.disease_id, pdi.disease_name,