新app登录、个人中心

This commit is contained in:
赵旭 2023-10-12 09:10:52 +08:00
parent 3d0034ef0d
commit 2f85d88146
12 changed files with 343 additions and 1 deletions

View File

@ -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()

View File

@ -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));
}
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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("账号或密码错误!");
}
}
}

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.applet.mapper.newapp.NewAppLoginMapper">
<select id="login" resultType="int">
select
count(1)
from hospital_person_info
<where>
<if test="personAccount != null">
person_account = #{personAccount}
</if>
<if test="personPassword != null">
and person_password = #{personPassword}
</if>
</where>
</select>
</mapper>

View File

@ -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));
}
/**
* 删除健康咨询-科室人员信息
*/

View File

@ -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();
}
}

View File

@ -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);
/**
* 删除健康咨询-科室人员信息
*

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -332,6 +332,57 @@
where id = #{id}
</update>
<update id="editHospitalPersonInfo" parameterType="com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDtoo">
update hospital_person_info
<trim prefix="SET" suffixOverrides=",">
<if test="hospitalId != null">hospital_id =
#{hospitalId},
</if>
<if test="departmentId != null">department_id =
#{departmentId},
</if>
<if test="personCode != null">person_code =
#{personCode},
</if>
<if test="personName != null">person_name =
#{personName},
</if>
person_phone = #{personPhone},
<if test="personAddress != null">person_address =
#{personAddress},
</if>
card_no = #{cardNo},
<if test="academicTitle != null">academic_title =
#{academicTitle},
</if>
<if test="consultingFee != null">consulting_fee =
#{consultingFee},
</if>
<if test="personIntroduce != null">person_introduce =
#{personIntroduce},
</if>
<if test="personSort != null">person_sort =
#{personSort},
</if>
<if test="personPictureUrl != null">person_picture_url =
#{personPictureUrl},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHospitalPersonInfoById" parameterType="Long">
delete
from hospital_person_info