护理员app代码移植
This commit is contained in:
parent
f3ee015e67
commit
588e849cd2
@ -0,0 +1,222 @@
|
|||||||
|
package com.xinelu.applet.controller.nursepersonapplogin;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.nursepersonapplogin.OrderFallbackDTO;
|
||||||
|
import com.xinelu.applet.service.nursepersonapplogin.INursePersonAppLoginService;
|
||||||
|
import com.xinelu.applet.vo.nursepersonapplogin.NurseAppLoginSysUserVO;
|
||||||
|
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
||||||
|
import com.xinelu.applet.vo.nursepersonapplogin.PersonNurseStationAppVO;
|
||||||
|
import com.xinelu.common.annotation.MobileRequestAuthorization;
|
||||||
|
import com.xinelu.common.annotation.RepeatSubmit;
|
||||||
|
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.page.TableDataInfo;
|
||||||
|
import com.xinelu.common.custominterface.Insert;
|
||||||
|
import com.xinelu.common.custominterface.TaskInsert;
|
||||||
|
import com.xinelu.common.utils.regex.RegexUtil;
|
||||||
|
import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 护理人员APP登录注册控制器
|
||||||
|
* @Author zh
|
||||||
|
* @Date 2022-10-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/nurseApp/personLogin")
|
||||||
|
public class NursePersonAppLoginController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private INursePersonAppLoginService nursePersonAppLoginService;
|
||||||
|
@Resource
|
||||||
|
private RegexUtil regexUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单首页查询已完成以及未完成数量
|
||||||
|
*
|
||||||
|
* @param nurseStationPersonId 护理员id
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@MobileRequestAuthorization
|
||||||
|
@GetMapping("/selectOrderByNursePersonCount")
|
||||||
|
public AjaxResult selectOrderByNursePersonCount(Long nurseStationPersonId) {
|
||||||
|
return nursePersonAppLoginService.selectOrderByNursePersonCount(nurseStationPersonId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务人员我的任务界面 查询服务订单
|
||||||
|
*
|
||||||
|
* @param orderAndItem 预约订单信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@MobileRequestAuthorization
|
||||||
|
@GetMapping("/selectMission")
|
||||||
|
public TableDataInfo selectMission(OrderAndItemVO orderAndItem) {
|
||||||
|
startPage();
|
||||||
|
List<OrderAndItemVO> appointmentOrder = nursePersonAppLoginService.selectAppointmentOrder(orderAndItem);
|
||||||
|
return getDataTable(appointmentOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务人员-服务订单详情
|
||||||
|
*
|
||||||
|
* @param orderNo 订单编号
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@MobileRequestAuthorization
|
||||||
|
@GetMapping("/taskDetails")
|
||||||
|
public AjaxResult selectOrderDetailsAndPatient(String orderNo) {
|
||||||
|
if (Objects.isNull(orderNo)) {
|
||||||
|
return AjaxResult.error("订单信息不能为空!");
|
||||||
|
}
|
||||||
|
return nursePersonAppLoginService.selectOrderDetailsAndPatient(orderNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务人员 - 任务回退
|
||||||
|
*
|
||||||
|
* @param orderFallbackDTO 订单信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@MobileRequestAuthorization
|
||||||
|
@PostMapping("/orderFallback")
|
||||||
|
public AjaxResult updateAppointmentOrder(@Validated(Insert.class) @RequestBody OrderFallbackDTO orderFallbackDTO) {
|
||||||
|
return nursePersonAppLoginService.updateAppointmentOrder(orderFallbackDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务确认完成
|
||||||
|
*
|
||||||
|
* @param appointmentOrderDetails 图片路径
|
||||||
|
* @return AjaxResult
|
||||||
|
*/
|
||||||
|
@MobileRequestAuthorization
|
||||||
|
@PostMapping("/orderConfirm")
|
||||||
|
public AjaxResult updateOrderDetails(@Validated(TaskInsert.class) @RequestBody AppointmentOrderDetails appointmentOrderDetails) {
|
||||||
|
return nursePersonAppLoginService.updateOrderDetails(appointmentOrderDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理人员 注册用户信息
|
||||||
|
*
|
||||||
|
* @param nurseAppLogin 账号信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/nurseAppLoginSysUser")
|
||||||
|
public AjaxResult nurseAppLoginSysUser(@Validated(Insert.class) @RequestBody NurseAppLoginSysUserVO nurseAppLogin) {
|
||||||
|
//校验手机号
|
||||||
|
boolean regexPhone = regexUtil.regexPhone(nurseAppLogin.getPhonenumber());
|
||||||
|
if (BooleanUtils.isFalse(regexPhone)) {
|
||||||
|
return AjaxResult.error("您输入的手机号不正确,请重新输入!");
|
||||||
|
}
|
||||||
|
return nursePersonAppLoginService.nurseAppLoginSysUser(nurseAppLogin);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理人员 app登录
|
||||||
|
*
|
||||||
|
* @param phonenumber 账号
|
||||||
|
* @param stationPersonPassword 密码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/appLogin")
|
||||||
|
public AjaxResult logins(String phonenumber, String stationPersonPassword) {
|
||||||
|
if (StringUtils.isBlank(phonenumber)) {
|
||||||
|
return AjaxResult.error("请输入账号!");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(stationPersonPassword)) {
|
||||||
|
return AjaxResult.error("请输入密码!");
|
||||||
|
}
|
||||||
|
return nursePersonAppLoginService.logins(phonenumber, stationPersonPassword);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 忘记密码
|
||||||
|
*
|
||||||
|
* @param phonenumber 手机号
|
||||||
|
* @param stationPersonPassword 密码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/updatePassword")
|
||||||
|
public AjaxResult updatePassword(String phonenumber, String stationPersonPassword, String verification) {
|
||||||
|
if (StringUtils.isBlank(phonenumber)) {
|
||||||
|
return AjaxResult.error("手机号不能为空!");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(stationPersonPassword)) {
|
||||||
|
return AjaxResult.error("密码不能为空!");
|
||||||
|
}
|
||||||
|
return nursePersonAppLoginService.updatePassword(phonenumber, stationPersonPassword, verification);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站人员的个人信息
|
||||||
|
*
|
||||||
|
* @param nurseAppLoginSysUserVO 个人信息
|
||||||
|
* @return com.xinyilu.nurseapplet.domain.vo.nursepersonapplogin.NursePersonAppLoginsUserVO
|
||||||
|
**/
|
||||||
|
@MobileRequestAuthorization
|
||||||
|
@GetMapping("/nursePerson")
|
||||||
|
public AjaxResult nursePerson(NurseAppLoginSysUserVO nurseAppLoginSysUserVO) {
|
||||||
|
if (StringUtils.isBlank(nurseAppLoginSysUserVO.getPhonenumber())) {
|
||||||
|
return AjaxResult.error("账号异常,请联系管理员!");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(nurseAppLoginSysUserVO.getStationPersonPassword())) {
|
||||||
|
return AjaxResult.error("账号密码异常,请联系管理员!");
|
||||||
|
}
|
||||||
|
return AjaxResult.success(nursePersonAppLoginService.getNursePersonPersonalInformation(nurseAppLoginSysUserVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户护理人员的账户密码
|
||||||
|
*
|
||||||
|
* @param nurseAppLoginSysUserVO 用户信息
|
||||||
|
* @return int
|
||||||
|
**/
|
||||||
|
@MobileRequestAuthorization
|
||||||
|
@RepeatSubmit
|
||||||
|
@PostMapping("/userPassWord")
|
||||||
|
public AjaxResult userPassWord(@RequestBody NurseAppLoginSysUserVO nurseAppLoginSysUserVO) {
|
||||||
|
return nursePersonAppLoginService.updateUserPassWord(nurseAppLoginSysUserVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改被护理人人员上传文件头像
|
||||||
|
*
|
||||||
|
* @param multipartFile 文件
|
||||||
|
* @param userId userId护理人人员id
|
||||||
|
* @return com.xinyilu.common.core.domain.AjaxResult
|
||||||
|
* @throws Exception 异常信息
|
||||||
|
**/
|
||||||
|
@PostMapping("/updateHeadAvatarHead")
|
||||||
|
public AjaxResult updateHeadAvatarHead(@RequestParam("file") MultipartFile multipartFile, Long userId) throws Exception {
|
||||||
|
if (Objects.isNull(userId)) {
|
||||||
|
return AjaxResult.error("护理人人员id不能为空!");
|
||||||
|
}
|
||||||
|
if (Objects.isNull(multipartFile) || StringUtils.isBlank(multipartFile.getOriginalFilename())) {
|
||||||
|
return AjaxResult.error("当前文件不存在,无法上传!");
|
||||||
|
}
|
||||||
|
if (multipartFile.getOriginalFilename().contains(Constants.EMPTY)) {
|
||||||
|
return AjaxResult.error("当前文件名含有空格,请先去除空格在上传!");
|
||||||
|
}
|
||||||
|
return nursePersonAppLoginService.updateHeadAvatarHead(multipartFile, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站信息列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/personNurseStationLists")
|
||||||
|
public TableDataInfo personNurseStationLists(PersonNurseStationAppVO nurseStation) {
|
||||||
|
startPage();
|
||||||
|
List<PersonNurseStationAppVO> personNurseStationLists = nursePersonAppLoginService.getPersonNurseStationLists(nurseStation);
|
||||||
|
return getDataTable(personNurseStationLists);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.xinelu.applet.dto.nursepersonapplogin;
|
||||||
|
|
||||||
|
import com.xinelu.common.custominterface.Insert;
|
||||||
|
import lombok.Data;
|
||||||
|
import net.sf.jsqlparser.statement.update.Update;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 护理员任务退回传入DTO
|
||||||
|
* @Author 张恒
|
||||||
|
* @Date 2023-03-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OrderFallbackDTO implements Serializable {
|
||||||
|
private static final long serialVersionUID = -7304878110328260180L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "订单信息为空", groups = {Insert.class, Update.class})
|
||||||
|
private Long appointmentOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理员id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "用户信息为空", groups = {Insert.class, Update.class})
|
||||||
|
private Long stationPersonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单编号
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "订单编号为空", groups = {Insert.class, Update.class})
|
||||||
|
private String appointmentOrderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退回原因
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "退回原因为空", groups = {Insert.class})
|
||||||
|
private String taskReturnReason;
|
||||||
|
}
|
||||||
@ -0,0 +1,134 @@
|
|||||||
|
package com.xinelu.applet.mapper.nursepersonapplogin;
|
||||||
|
|
||||||
|
import com.xinelu.applet.vo.nursepersonapplogin.*;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 护理人员APP登录注册Mapper
|
||||||
|
* @Author zh
|
||||||
|
* @Date 2022-10-28
|
||||||
|
*/
|
||||||
|
public interface NursePersonAppLoginMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单首页查询已完成以及未完成数量
|
||||||
|
*
|
||||||
|
* @param nurseStationPersonId 护理员id
|
||||||
|
* @param orderStatusList 状态
|
||||||
|
* @return java.util.List<com.xinyilu.nurseapplet.domain.vo.nursepersonapplogin.OrderByNursePersonVO>
|
||||||
|
**/
|
||||||
|
List<OrderByNursePersonVO> selectOrderByNursePersonCount(@Param("nurseStationPersonId") Long nurseStationPersonId, @Param("orderStatusList") List<String> orderStatusList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务人员我的任务界面 查询服务订单
|
||||||
|
*
|
||||||
|
* @param orderAndItem 预约订单信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<OrderAndItemVO> selectOrderByNursePersonId(OrderAndItemVO orderAndItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务人员-服务订单详情
|
||||||
|
*
|
||||||
|
* @param orderNo 订单编号
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
OrderDetailsAndPatientVO getOrderDetailsAndPatientByDetailsId(String orderNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务退回
|
||||||
|
*
|
||||||
|
* @param orderNo 订单编号
|
||||||
|
* @param orderStatus 订单状态
|
||||||
|
* @param taskReturnReason 退还原因
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateAppointmentOrderByOrderNo(@Param("orderNo") String orderNo, @Param("orderStatus") String orderStatus, @Param("taskReturnReason") String taskReturnReason);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据手机号或者密码 查询 护理人员的注册信息
|
||||||
|
*
|
||||||
|
* @param phonenumber 手机号
|
||||||
|
* @param stationPersonPassword 密码
|
||||||
|
* @return int 数量
|
||||||
|
*/
|
||||||
|
int getSysUserPasswordByPhone(@Param("phonenumber") String phonenumber, @Param("stationPersonPassword") String stationPersonPassword);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站人员注册信息新增
|
||||||
|
*
|
||||||
|
* @param nurseAppLoginSysUserVO 注册信息
|
||||||
|
* @return int 结果
|
||||||
|
**/
|
||||||
|
int insertNurseAppLoginSysUser(NurseAppLoginSysUserVO nurseAppLoginSysUserVO);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户护理人员的账户密码去查询 返回护理人员信息
|
||||||
|
*
|
||||||
|
* @param phonenumber 手机号 账号
|
||||||
|
* @param stationPersonPassword 密码
|
||||||
|
* @return com.xinyilu.nurseapplet.domain.vo.nursepersonapplogin.NursePersonAppLoginsUserVO
|
||||||
|
**/
|
||||||
|
NursePersonAppLoginsUserVO getUserAndPerson(@Param("phonenumber") String phonenumber, @Param("stationPersonPassword") String stationPersonPassword);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据手机号查询用户id
|
||||||
|
*
|
||||||
|
* @param phonenumber 手机号码
|
||||||
|
* @return 完善信息
|
||||||
|
*/
|
||||||
|
Long getFromPhoneUserId(String phonenumber);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户护理人员的账户密码
|
||||||
|
*
|
||||||
|
* @param nurseAppLoginSysUserVO 用户信息
|
||||||
|
* @return int
|
||||||
|
**/
|
||||||
|
int updateUserPassWord(NurseAppLoginSysUserVO nurseAppLoginSysUserVO);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站人员的个人信息
|
||||||
|
*
|
||||||
|
* @param nurseAppLoginSysUserVO 个人信息
|
||||||
|
* @return com.xinyilu.nurseapplet.domain.vo.nursepersonapplogin.NursePersonAppLoginsUserVO
|
||||||
|
**/
|
||||||
|
NursePersonAppLoginsUserVO getNursePersonPersonalInformation(NurseAppLoginSysUserVO nurseAppLoginSysUserVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改被护理人人员上传文件头像
|
||||||
|
*
|
||||||
|
* @param avatar 头像地址
|
||||||
|
* @param userId userId护理人人员id
|
||||||
|
* @return com.xinyilu.common.core.domain.AjaxResult
|
||||||
|
**/
|
||||||
|
int updateHeadAvatarHeadUserId(@Param("userId") Long userId, @Param("avatar") String avatar);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站列表
|
||||||
|
*
|
||||||
|
* @param nurseStation 护理站列表
|
||||||
|
* @return com.xinyilu.base.domain.nursestation.NurseStation
|
||||||
|
**/
|
||||||
|
List<PersonNurseStationAppVO> getPersonNurseStationLists(PersonNurseStationAppVO nurseStation);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据userId查询信息
|
||||||
|
*
|
||||||
|
* @param userId 护理人员id
|
||||||
|
* @return int
|
||||||
|
**/
|
||||||
|
NursePersonAppLoginsUserVO getNursePersonUserId(Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据护理员id查询个人信息
|
||||||
|
*
|
||||||
|
* @param nursePersonId 护理员id
|
||||||
|
* @return com.xinyilu.nurseapplet.domain.vo.nursepersonapplogin.NurseStationPersonUserVO
|
||||||
|
**/
|
||||||
|
NurseStationPersonUserVO getNurseStationPersonById(Long nursePersonId);
|
||||||
|
}
|
||||||
@ -0,0 +1,136 @@
|
|||||||
|
package com.xinelu.applet.service.nursepersonapplogin;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.nursepersonapplogin.OrderFallbackDTO;
|
||||||
|
import com.xinelu.applet.vo.nursepersonapplogin.NurseAppLoginSysUserVO;
|
||||||
|
import com.xinelu.applet.vo.nursepersonapplogin.NursePersonAppLoginsUserVO;
|
||||||
|
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
||||||
|
import com.xinelu.applet.vo.nursepersonapplogin.PersonNurseStationAppVO;
|
||||||
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 护理人员APP登录注册业务层
|
||||||
|
* @Author zh
|
||||||
|
* @Date 2022-10-28
|
||||||
|
*/
|
||||||
|
public interface INursePersonAppLoginService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单首页查询已完成以及未完成数量
|
||||||
|
*
|
||||||
|
* @param nurseStationPersonId 护理员id
|
||||||
|
* @return int
|
||||||
|
**/
|
||||||
|
AjaxResult selectOrderByNursePersonCount(Long nurseStationPersonId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务人员我的任务界面 查询服务订单
|
||||||
|
*
|
||||||
|
* @param orderAndItem 预约订单信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
List<OrderAndItemVO> selectAppointmentOrder(OrderAndItemVO orderAndItem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务人员-服务订单详情
|
||||||
|
*
|
||||||
|
* @param orderNo 订单编号
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
AjaxResult selectOrderDetailsAndPatient(String orderNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务人员 - 任务回退
|
||||||
|
*
|
||||||
|
* @param orderFallbackDTO 订单信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
AjaxResult updateAppointmentOrder(OrderFallbackDTO orderFallbackDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务确认完成
|
||||||
|
*
|
||||||
|
* @param appointmentOrderDetails 图片路径
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
AjaxResult updateOrderDetails(AppointmentOrderDetails appointmentOrderDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理人员 注册用户信息
|
||||||
|
*
|
||||||
|
* @param nurseAppLogin 注册信息
|
||||||
|
* @return com.xinyilu.common.core.domain.AjaxResult
|
||||||
|
**/
|
||||||
|
AjaxResult nurseAppLoginSysUser(NurseAppLoginSysUserVO nurseAppLogin);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP登录用户信息
|
||||||
|
*
|
||||||
|
* @param phone 账号
|
||||||
|
* @param stationPersonPassword 密码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
AjaxResult logins(String phone, String stationPersonPassword);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 忘记密码
|
||||||
|
*
|
||||||
|
* @param phonenumber 账号
|
||||||
|
* @param stationPersonPassword 密码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
AjaxResult updatePassword(String phonenumber, String stationPersonPassword, String verification);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站人员的个人信息
|
||||||
|
*
|
||||||
|
* @param nurseAppLoginSysUserVO 个人信息
|
||||||
|
* @return com.xinyilu.nurseapplet.domain.vo.nursepersonapplogin.NursePersonAppLoginsUserVO
|
||||||
|
**/
|
||||||
|
NursePersonAppLoginsUserVO getNursePersonPersonalInformation(NurseAppLoginSysUserVO nurseAppLoginSysUserVO);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户护理人员的账户密码
|
||||||
|
*
|
||||||
|
* @param nurseAppLoginSysUserVO 用户信息
|
||||||
|
* @return int
|
||||||
|
**/
|
||||||
|
AjaxResult updateUserPassWord(NurseAppLoginSysUserVO nurseAppLoginSysUserVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改被护理人人员上传文件头像
|
||||||
|
*
|
||||||
|
* @param avatar 头像地址
|
||||||
|
* @param userId userId护理人人员id
|
||||||
|
* @return com.xinyilu.common.core.domain.AjaxResult
|
||||||
|
**/
|
||||||
|
boolean updateHeadAvatarHeadUserId(@Param("userId") Long userId, @Param("avatar") String avatar, String userIdAvatar);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改被护理人人员上传文件头像
|
||||||
|
*
|
||||||
|
* @param multipartFile 文件
|
||||||
|
* @param userId userId护理人人员id
|
||||||
|
* @return com.xinyilu.common.core.domain.AjaxResult
|
||||||
|
* @throws Exception 异常信息
|
||||||
|
**/
|
||||||
|
AjaxResult updateHeadAvatarHead(MultipartFile multipartFile, Long userId) throws Exception;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站列表
|
||||||
|
*
|
||||||
|
* @param nurseStation 护理站列表
|
||||||
|
* @return com.xinyilu.base.domain.nursestation.NurseStation
|
||||||
|
**/
|
||||||
|
List<PersonNurseStationAppVO> getPersonNurseStationLists(PersonNurseStationAppVO nurseStation);
|
||||||
|
}
|
||||||
@ -0,0 +1,489 @@
|
|||||||
|
package com.xinelu.applet.service.nursepersonapplogin.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.nursepersonapplogin.OrderFallbackDTO;
|
||||||
|
import com.xinelu.applet.mapper.nursepersonapplogin.NursePersonAppLoginMapper;
|
||||||
|
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;
|
||||||
|
import com.xinelu.common.utils.file.FileUploadUtils;
|
||||||
|
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;
|
||||||
|
import com.xinelu.manage.mapper.patientdiseaseinfo.PatientDiseaseInfoMapper;
|
||||||
|
import com.xinelu.manage.service.stationmessagepush.StationMessagePushService;
|
||||||
|
import com.xinelu.manage.vo.appointmentorder.AppointmentOrderRecordVO;
|
||||||
|
import com.xinelu.manage.vo.appointmentorder.AppointmentReceivingOrderVO;
|
||||||
|
import com.xinelu.manage.vo.nursestation.NurseStationSysUserVO;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.io.File;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 护理人员APP登录注册业务层实现类
|
||||||
|
* @Author ZH
|
||||||
|
* @Date 2022-10-28
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class NursePersonAppLoginServiceImpl implements INursePersonAppLoginService {
|
||||||
|
@Resource
|
||||||
|
private NursePersonAppLoginMapper nursePersonAppLoginMapper;
|
||||||
|
@Resource
|
||||||
|
private AppointmentOrderDetailsMapper appointmentOrderDetailsMapper;
|
||||||
|
@Resource
|
||||||
|
private RegexUtil regexUtil;
|
||||||
|
@Resource
|
||||||
|
private NurseStationMapper nurseStationMapper;
|
||||||
|
@Resource
|
||||||
|
private NursePersonAppLoginServiceImpl nursePersonAppLoginService;
|
||||||
|
@Resource
|
||||||
|
private NurseStationPersonMapper nurseStationPersonMapper;
|
||||||
|
@Resource
|
||||||
|
private XinELuConfig xinYiLuConfig;
|
||||||
|
@Resource
|
||||||
|
private AppointmentOrderProcessRecordMapper appointmentOrderProcessRecordMapper;
|
||||||
|
@Resource
|
||||||
|
private NurseStationPersonRevenueMapper nurseStationPersonRevenueMapper;
|
||||||
|
@Resource
|
||||||
|
private PatientDiseaseInfoMapper patientDiseaseInfoMapper;
|
||||||
|
@Resource
|
||||||
|
private StationMessagePushService stationMessagePushService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单首页查询已完成以及未完成数量
|
||||||
|
*
|
||||||
|
* @param nurseStationPersonId 护理员id
|
||||||
|
* @return int
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public AjaxResult selectOrderByNursePersonCount(Long nurseStationPersonId) {
|
||||||
|
OrderByNursePersonVO orderByNursePersonVO = new OrderByNursePersonVO();
|
||||||
|
if (Objects.isNull(nurseStationPersonId)) {
|
||||||
|
orderByNursePersonVO.setCompleteCount(0L);
|
||||||
|
orderByNursePersonVO.setNotFinishCount(0L);
|
||||||
|
return AjaxResult.success(orderByNursePersonVO);
|
||||||
|
}
|
||||||
|
List<String> orderStatusList = Arrays.asList(OrderStatusEnum.NOT_FINISH.getInfo(), OrderStatusEnum.WAIT_RECEIVE.getInfo(), OrderStatusEnum.COMPLETE.getInfo(), OrderStatusEnum.EVALUATED.getInfo());
|
||||||
|
List<OrderByNursePersonVO> orderByNursePersonList = nursePersonAppLoginMapper.selectOrderByNursePersonCount(nurseStationPersonId, orderStatusList);
|
||||||
|
long completeCount = orderByNursePersonList.stream().filter(Objects::nonNull).filter(order -> (StringUtils.isNotBlank(order.getOrderStatus())) && order.getOrderStatus().equals(OrderStatusEnum.COMPLETE.getInfo()) || order.getOrderStatus().equals(OrderStatusEnum.EVALUATED.getInfo())).count();
|
||||||
|
long notFinishCount = orderByNursePersonList.stream().filter(Objects::nonNull).filter(order -> (StringUtils.isNotBlank(order.getOrderStatus())) && order.getOrderStatus().equals(OrderStatusEnum.NOT_FINISH.getInfo()) || order.getOrderStatus().equals(OrderStatusEnum.WAIT_RECEIVE.getInfo())).count();
|
||||||
|
orderByNursePersonVO.setCompleteCount(completeCount);
|
||||||
|
orderByNursePersonVO.setNotFinishCount(notFinishCount);
|
||||||
|
return AjaxResult.success(orderByNursePersonVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务人员我的任务界面 查询服务订单
|
||||||
|
*
|
||||||
|
* @param orderAndItem 预约订单信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OrderAndItemVO> selectAppointmentOrder(OrderAndItemVO orderAndItem) {
|
||||||
|
List<OrderAndItemVO> appointmentOrderDetails = new ArrayList<>();
|
||||||
|
if (Objects.isNull(orderAndItem) || Objects.isNull(orderAndItem.getNursePersonId())) {
|
||||||
|
return appointmentOrderDetails;
|
||||||
|
}
|
||||||
|
List<String> orderStatusList;
|
||||||
|
//处理全部订单状态筛选条件
|
||||||
|
if (StringUtils.isBlank(orderAndItem.getOrderStatus())) {
|
||||||
|
orderStatusList = Arrays.asList(OrderStatusEnum.NOT_FINISH.getInfo(), OrderStatusEnum.WAIT_RECEIVE.getInfo(), OrderStatusEnum.COMPLETE.getInfo(), OrderStatusEnum.EVALUATED.getInfo());
|
||||||
|
orderAndItem.setOrderStatusList(orderStatusList);
|
||||||
|
}
|
||||||
|
//处理当前订单状态筛选条件
|
||||||
|
if (StringUtils.isNotBlank(orderAndItem.getOrderStatus()) && StringUtils.equals(OrderStatusEnum.NOT_FINISH.getInfo(), orderAndItem.getOrderStatus())) {
|
||||||
|
orderStatusList = Arrays.asList(OrderStatusEnum.NOT_FINISH.getInfo(), OrderStatusEnum.WAIT_RECEIVE.getInfo());
|
||||||
|
orderAndItem.setOrderStatusList(orderStatusList);
|
||||||
|
}
|
||||||
|
//已完成的订单状态筛选条件
|
||||||
|
if (StringUtils.isNotBlank(orderAndItem.getOrderStatus()) && StringUtils.equals(OrderStatusEnum.COMPLETE.getInfo(), orderAndItem.getOrderStatus())) {
|
||||||
|
orderStatusList = Arrays.asList(OrderStatusEnum.COMPLETE.getInfo(), OrderStatusEnum.EVALUATED.getInfo());
|
||||||
|
orderAndItem.setOrderStatusList(orderStatusList);
|
||||||
|
}
|
||||||
|
return nursePersonAppLoginMapper.selectOrderByNursePersonId(orderAndItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务人员-服务订单详情
|
||||||
|
*
|
||||||
|
* @param orderNo 订单编号
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult selectOrderDetailsAndPatient(String orderNo) {
|
||||||
|
OrderDetailsAndPatientVO patientByDetails = nursePersonAppLoginMapper.getOrderDetailsAndPatientByDetailsId(orderNo);
|
||||||
|
if (Objects.nonNull(patientByDetails) && Objects.nonNull(patientByDetails.getBirthDate())) {
|
||||||
|
patientByDetails.setAge(AgeUtil.getAgeMonth(String.valueOf(patientByDetails.getBirthDate())));
|
||||||
|
}
|
||||||
|
//健康状况
|
||||||
|
List<PatientDiseaseInfo> patientDiseaseInfo = patientDiseaseInfoMapper.selectPatientDiseaseInfoByOrderNo(patientByDetails.getOrderNo());
|
||||||
|
if (CollectionUtils.isNotEmpty(patientDiseaseInfo)) {
|
||||||
|
List<String> diseaseNameList = patientDiseaseInfo.stream().filter(Objects::nonNull).map(PatientDiseaseInfo::getDiseaseName).filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||||
|
String diseaseName = String.join(",", diseaseNameList);
|
||||||
|
patientByDetails.setDiseaseName(diseaseName);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(patientByDetails);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务人员 - 任务回退
|
||||||
|
*
|
||||||
|
* @param orderFallbackDTO 订单信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public AjaxResult updateAppointmentOrder(OrderFallbackDTO orderFallbackDTO) {
|
||||||
|
AppointmentReceivingOrderVO appointmentReceivingOrder = appointmentOrderDetailsMapper.getAppointmentReceivingOrder(orderFallbackDTO.getAppointmentOrderNo());
|
||||||
|
if (Objects.isNull(appointmentReceivingOrder)) {
|
||||||
|
return AjaxResult.error("当前订单不存在,无法退回!");
|
||||||
|
}
|
||||||
|
appointmentReceivingOrder.setTaskReturnReason(orderFallbackDTO.getTaskReturnReason());
|
||||||
|
int update = nursePersonAppLoginMapper.updateAppointmentOrderByOrderNo(orderFallbackDTO.getAppointmentOrderNo(), OrderStatusEnum.WAIT_DISPATCH.getInfo(), orderFallbackDTO.getTaskReturnReason());
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务确认完成
|
||||||
|
*
|
||||||
|
* @param appointmentOrderDetails 图片路径
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public AjaxResult updateOrderDetails(AppointmentOrderDetails appointmentOrderDetails) {
|
||||||
|
AppointmentOrderRecordVO orderDetails = appointmentOrderDetailsMapper.selectAppointmentOrderById(appointmentOrderDetails.getOrderNo());
|
||||||
|
if (Objects.isNull(orderDetails) || StringUtils.isBlank(orderDetails.getOrderStatus())) {
|
||||||
|
return AjaxResult.error("当前订单状态不存在,请重新选择!");
|
||||||
|
}
|
||||||
|
if (!orderDetails.getOrderStatus().equals(OrderStatusEnum.NOT_FINISH.getInfo())) {
|
||||||
|
return AjaxResult.error("订单状态异常,请选择未完成订单!");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(appointmentOrderDetails.getServeLocationLatitude()) || StringUtils.isBlank(appointmentOrderDetails.getServeLocationLatitude())) {
|
||||||
|
log.info("当前用户不同意获取位置信息,无法保存当前位置经纬度信息!");
|
||||||
|
}
|
||||||
|
appointmentOrderDetails.setUpdateTime(LocalDateTime.now());
|
||||||
|
appointmentOrderDetails.setOrderStatus(OrderStatusEnum.COMPLETE.getInfo());
|
||||||
|
int update = appointmentOrderDetailsMapper.updateOrderDetailsById(appointmentOrderDetails);
|
||||||
|
if (update <= 0) {
|
||||||
|
throw new ServiceException("信息上传失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
//新增护理员订单佣金收益信息表
|
||||||
|
NurseStationPersonRevenue nurseStationPersonRevenue = new NurseStationPersonRevenue();
|
||||||
|
nurseStationPersonRevenue.setNurseStationPersonId(Objects.isNull(orderDetails.getNurseStationPersonId()) ? null : orderDetails.getNurseStationPersonId());
|
||||||
|
nurseStationPersonRevenue.setAppointmentOrderId(Objects.isNull(orderDetails.getId()) ? null : orderDetails.getId());
|
||||||
|
nurseStationPersonRevenue.setRevenueAmount(Objects.isNull(orderDetails.getOrderCommissionAmount()) ? null : orderDetails.getOrderCommissionAmount());
|
||||||
|
nurseStationPersonRevenue.setFinishOrderTime(LocalDateTime.now());
|
||||||
|
nurseStationPersonRevenue.setCreateTime(LocalDateTime.now());
|
||||||
|
int stationPersonRevenue = nurseStationPersonRevenueMapper.insertNurseStationPersonRevenue(nurseStationPersonRevenue);
|
||||||
|
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();
|
||||||
|
nurseStationPersonMapper.updateTotalRevenueAmountById(nurseStationPersonId, orderCommissionAmount);
|
||||||
|
//异步发送信息
|
||||||
|
stationMessagePushService.orderCompletionOperationsPush(orderDetails);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理人员 注册用户信息
|
||||||
|
*
|
||||||
|
* @param nurseAppLogin 注册信息
|
||||||
|
* @return com.xinyilu.common.core.domain.AjaxResult
|
||||||
|
**/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public AjaxResult nurseAppLoginSysUser(NurseAppLoginSysUserVO nurseAppLogin) {
|
||||||
|
//校验手机号是否存在 sys_user 用户表与nurse_station_person 护理站人员信息表关联
|
||||||
|
NurseStationPerson nurseStationPersonPhoneUser = nurseStationPersonMapper.getNurseStationPersonPhoneUser(nurseAppLogin.getPhonenumber());
|
||||||
|
NurseAppLoginSysUserVO patient = new NurseAppLoginSysUserVO();
|
||||||
|
if (Objects.nonNull(nurseStationPersonPhoneUser)) {
|
||||||
|
patient.setNurseStationPersonId(Objects.isNull(nurseStationPersonPhoneUser.getId()) ? null : nurseStationPersonPhoneUser.getId());
|
||||||
|
} else {
|
||||||
|
log.warn("当前护理员信息在nurse_station_person表中不存在,请先前往Pc端护理站人员信息维护该护理人员信息!");
|
||||||
|
return AjaxResult.error("当前护理员信息不存在,请前往护理站管理平台新增个人信息!");
|
||||||
|
}
|
||||||
|
//校验手机号是否存在 sys_user 用户表与nurse_station_person 护理站人员信息表关联
|
||||||
|
int phoneCount = nursePersonAppLoginMapper.getSysUserPasswordByPhone(nurseAppLogin.getPhonenumber(), null);
|
||||||
|
if (phoneCount > 0) {
|
||||||
|
return AjaxResult.error("该手机号已注册,请重新输入!");
|
||||||
|
}
|
||||||
|
//调用md5加密方法
|
||||||
|
String changePassword = md5(nurseAppLogin.getStationPersonPassword());
|
||||||
|
patient.setPhonenumber(nurseAppLogin.getPhonenumber());
|
||||||
|
patient.setUserName(nurseAppLogin.getPhonenumber());
|
||||||
|
patient.setNickName(nurseAppLogin.getNickName());
|
||||||
|
patient.setStationPersonPassword(changePassword);
|
||||||
|
patient.setCreateTime(LocalDateTime.now());
|
||||||
|
patient.setNurseStationIds(nurseAppLogin.getNurseStationIds());
|
||||||
|
int row = nursePersonAppLoginMapper.insertNurseAppLoginSysUser(patient);
|
||||||
|
if (row <= 0) {
|
||||||
|
throw new ServiceException("注册失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app登录
|
||||||
|
*
|
||||||
|
* @param phonenumber 账号
|
||||||
|
* @param stationPersonPassword 密码
|
||||||
|
* @return AjaxResult
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult logins(String phonenumber, String stationPersonPassword) {
|
||||||
|
if (BooleanUtils.isFalse(regexUtil.regexPhone(phonenumber))) {
|
||||||
|
return AjaxResult.error("您输入的账号不正确,请重新输入!");
|
||||||
|
}
|
||||||
|
//校验手机号是否存在 sys_user 用户表与nurse_station_person 护理站人员信息表关联
|
||||||
|
NurseStationPerson nurseStationPersonPhoneUser = nurseStationPersonMapper.getNurseStationPersonPhoneUser(phonenumber);
|
||||||
|
if (Objects.isNull(nurseStationPersonPhoneUser)) {
|
||||||
|
return AjaxResult.error("当前护理员信息不存在,请前往护理站管理平台新增个人信息!");
|
||||||
|
}
|
||||||
|
//判断账号是否存在,不存在进行注册
|
||||||
|
int existsCount = nursePersonAppLoginMapper.getSysUserPasswordByPhone(phonenumber, null);
|
||||||
|
if (existsCount <= 0) {
|
||||||
|
return AjaxResult.error("当前账号不存在,请先注册!");
|
||||||
|
}
|
||||||
|
//账号存在,判断输入密码是否正确
|
||||||
|
int count = nursePersonAppLoginMapper.getSysUserPasswordByPhone(phonenumber, md5(stationPersonPassword));
|
||||||
|
if (count <= 0) {
|
||||||
|
return AjaxResult.error("您输入的密码不正确,请重新输入!");
|
||||||
|
}
|
||||||
|
NursePersonAppLoginsUserVO patient = nursePersonAppLoginMapper.getUserAndPerson(phonenumber, md5(stationPersonPassword));
|
||||||
|
return AjaxResult.success(patient);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 忘记密码
|
||||||
|
*
|
||||||
|
* @param phonenumber 账号
|
||||||
|
* @param stationPersonPassword 密码
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult updatePassword(String phonenumber, String stationPersonPassword, String verification) {
|
||||||
|
//校验手机号是否存在 sys_user 用户表与nurse_station_person 护理站人员信息表关联
|
||||||
|
NurseStationPerson nurseStationPersonPhoneUser = nurseStationPersonMapper.getNurseStationPersonPhoneUser(phonenumber);
|
||||||
|
if (Objects.isNull(nurseStationPersonPhoneUser)) {
|
||||||
|
return AjaxResult.error("当前护理员信息不存在,请前往护理站管理平台新增个人信息!");
|
||||||
|
}
|
||||||
|
Long patientId = nursePersonAppLoginMapper.getFromPhoneUserId(phonenumber);
|
||||||
|
if (Objects.isNull(patientId) || patientId == 0L) {
|
||||||
|
return AjaxResult.error("当前账号信息不存在,请重新输入!");
|
||||||
|
}
|
||||||
|
NurseAppLoginSysUserVO patientInfo = new NurseAppLoginSysUserVO();
|
||||||
|
patientInfo.setPhone(phonenumber);
|
||||||
|
patientInfo.setUserId(patientId);
|
||||||
|
patientInfo.setStationPersonPassword(md5(stationPersonPassword));
|
||||||
|
//判断是否修改成功`
|
||||||
|
int updatePassword = nursePersonAppLoginMapper.updateUserPassWord(patientInfo);
|
||||||
|
if (updatePassword <= 0) {
|
||||||
|
throw new ServiceException("修改密码失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站人员的个人信息
|
||||||
|
*
|
||||||
|
* @param nurseAppLoginSysUserVO 个人信息
|
||||||
|
* @return com.xinyilu.nurseapplet.domain.vo.nursepersonapplogin.NursePersonAppLoginsUserVO
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public NursePersonAppLoginsUserVO getNursePersonPersonalInformation(NurseAppLoginSysUserVO nurseAppLoginSysUserVO) {
|
||||||
|
nurseAppLoginSysUserVO.setStationPersonPassword(md5(nurseAppLoginSysUserVO.getStationPersonPassword()));
|
||||||
|
NursePersonAppLoginsUserVO personAppLoginsUserVO = nursePersonAppLoginMapper.getNursePersonPersonalInformation(nurseAppLoginSysUserVO);
|
||||||
|
//查询所属的护理站信息
|
||||||
|
if (StringUtils.isBlank(personAppLoginsUserVO.getNurseStationIds())) {
|
||||||
|
return personAppLoginsUserVO;
|
||||||
|
}
|
||||||
|
List<String> nurseTypeCodeList = Arrays.asList(StringUtils.split(personAppLoginsUserVO.getNurseStationIds(), ","));
|
||||||
|
List<Long> stationIdList = nurseTypeCodeList.stream().map(s -> Long.parseLong(s.trim())).distinct().collect(Collectors.toList());
|
||||||
|
List<NurseStationSysUserVO> stationIds = nurseStationMapper.getNurseStationIds(stationIdList);
|
||||||
|
personAppLoginsUserVO.setNurseStationSysUserVOList(stationIds);
|
||||||
|
return personAppLoginsUserVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户护理人员的账户密码
|
||||||
|
*
|
||||||
|
* @param nurseAppLoginSysUserVO 用户信息
|
||||||
|
* @return int
|
||||||
|
**/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public AjaxResult updateUserPassWord(NurseAppLoginSysUserVO nurseAppLoginSysUserVO) {
|
||||||
|
NurseStationPerson personInfo = nurseStationPersonMapper.getNurseStationPersonPhoneUser(nurseAppLoginSysUserVO.getPhonenumber());
|
||||||
|
if (Objects.isNull(personInfo)) {
|
||||||
|
return AjaxResult.error("当前护理人员信息不存在,无法修改个人信息!");
|
||||||
|
}
|
||||||
|
//有手机号才 进行校验
|
||||||
|
if (StringUtils.isNotBlank(nurseAppLoginSysUserVO.getPhonenumber())) {
|
||||||
|
if (BooleanUtils.isFalse(regexUtil.regexPhone(nurseAppLoginSysUserVO.getPhonenumber()))) {
|
||||||
|
return AjaxResult.error("您输入的电话号码" + nurseAppLoginSysUserVO.getPhonenumber() + "不正确,请重新输入!");
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(personInfo.getPhone()) && !StringUtils.equals(personInfo.getPhone(), nurseAppLoginSysUserVO.getPhonenumber())) {
|
||||||
|
int nurseStationPersonPhone = nurseStationPersonMapper.getNurseStationPersonPhone(nurseAppLoginSysUserVO.getPhonenumber());
|
||||||
|
if (nurseStationPersonPhone > 0) {
|
||||||
|
return AjaxResult.error("您输入的联系电话" + nurseAppLoginSysUserVO.getPhonenumber() + "重复!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//更新sysUser表信息
|
||||||
|
nursePersonAppLoginMapper.updateUserPassWord(nurseAppLoginSysUserVO);
|
||||||
|
//更新NurseStationPerson表信息
|
||||||
|
NurseStationPerson nurseStationPerson = new NurseStationPerson();
|
||||||
|
nurseStationPerson.setNursePersonName(nurseAppLoginSysUserVO.getNickName());
|
||||||
|
nurseStationPerson.setId(nurseAppLoginSysUserVO.getNurseStationPersonId());
|
||||||
|
nurseStationPersonMapper.updateNurseStationPerson(nurseStationPerson);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改被护理人人员上传文件头像
|
||||||
|
*
|
||||||
|
* @param avatar 头像地址
|
||||||
|
* @param userId userId护理人人员id
|
||||||
|
* @return com.xinyilu.common.core.domain.AjaxResult
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public boolean updateHeadAvatarHeadUserId(Long userId, String avatar, String userIdAvatar) {
|
||||||
|
//删除被护理人人员的头像
|
||||||
|
if (StringUtils.isNotBlank(userIdAvatar)) {
|
||||||
|
String picture = XinELuConfig.getProfile() + userIdAvatar.replaceAll("/profile", "");
|
||||||
|
File checkReportNameFile = new File(picture);
|
||||||
|
if (checkReportNameFile.exists()) {
|
||||||
|
boolean delete = checkReportNameFile.delete();
|
||||||
|
if (BooleanUtils.isFalse(delete)) {
|
||||||
|
throw new ServiceException("图片地址删除失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nursePersonAppLoginMapper.updateHeadAvatarHeadUserId(userId, avatar) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改被护理人人员上传文件头像
|
||||||
|
*
|
||||||
|
* @param multipartFile 文件
|
||||||
|
* @param userId userId护理人人员id
|
||||||
|
* @return com.xinyilu.common.core.domain.AjaxResult
|
||||||
|
* @throws Exception 异常信息
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public AjaxResult updateHeadAvatarHead(MultipartFile multipartFile, Long userId) throws Exception {
|
||||||
|
//根据userId查询SysUser表的信息
|
||||||
|
if (Objects.isNull(userId)) {
|
||||||
|
return AjaxResult.error("当前用户信息不存在,无法上传!");
|
||||||
|
}
|
||||||
|
//根据被护理人的id查询基本信息
|
||||||
|
NursePersonAppLoginsUserVO nursePersonUserId = nursePersonAppLoginMapper.getNursePersonUserId(userId);
|
||||||
|
if (Objects.isNull(nursePersonUserId)) {
|
||||||
|
return AjaxResult.error("当前用户信息不存在,无法上传!");
|
||||||
|
}
|
||||||
|
//原有用户头像地址
|
||||||
|
String userIdAvatar = StringUtils.isBlank(nursePersonUserId.getAvatar()) ? "" : nursePersonUserId.getAvatar();
|
||||||
|
//定义文件上传路径
|
||||||
|
String fileName = FileUploadUtils.uploadPictureUrlPath(XinELuConfig.getProfile() + xinYiLuConfig.getNurseStationAppPersonUrl(), multipartFile, MimeTypeUtils.IMAGE_EXTENSION);
|
||||||
|
if (StringUtils.isBlank(fileName)) {
|
||||||
|
throw new Exception("头像上传失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
if (nursePersonAppLoginService.updateHeadAvatarHeadUserId(userId, fileName, userIdAvatar)) {
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
ajax.put("imgUrl", fileName);
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
return AjaxResult.success("上传成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理站列表
|
||||||
|
*
|
||||||
|
* @param nurseStation 护理站列表
|
||||||
|
* @return com.xinyilu.base.domain.nursestation.NurseStation
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public List<PersonNurseStationAppVO> getPersonNurseStationLists(PersonNurseStationAppVO nurseStation) {
|
||||||
|
return nursePersonAppLoginMapper.getPersonNurseStationLists(nurseStation);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成BCryptPasswordEncoder密码
|
||||||
|
*
|
||||||
|
* @param getStationPersonPassword 密码
|
||||||
|
* @return 加密字符串
|
||||||
|
*/
|
||||||
|
private String md5(String getStationPersonPassword) {
|
||||||
|
getStationPersonPassword = Md5Utils.hash((getStationPersonPassword));
|
||||||
|
return getStationPersonPassword;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
package com.xinelu.applet.vo.nursepersonapplogin;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.xinelu.common.custominterface.Insert;
|
||||||
|
import lombok.Data;
|
||||||
|
import net.sf.jsqlparser.statement.update.Update;
|
||||||
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站人员注册信息类
|
||||||
|
*
|
||||||
|
* @author ljh
|
||||||
|
* @version 1.0
|
||||||
|
* Create by 2022/10/28 11:26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class NurseAppLoginSysUserVO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 3253830606920513883L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户账号
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 用户账号 用户昵称
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户姓名
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "用户姓名不能为空!", groups = {Insert.class, Update.class})
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
@Length(max = 11, message = "手机号码不能超过11位", groups = {Insert.class, Update.class})
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
@Length(max = 11, message = "手机号码不能超过11位", groups = {Insert.class, Update.class})
|
||||||
|
@NotBlank(message = "手机号码不能为空!", groups = {Insert.class, Update.class})
|
||||||
|
private String phonenumber;
|
||||||
|
/**
|
||||||
|
* 登录密码
|
||||||
|
*/
|
||||||
|
@Length(min = 6, max = 10, message = "密码不能低于6位并不能超过10位", groups = {Insert.class})
|
||||||
|
@NotBlank(message = "密码不能为空!", groups = {Insert.class, Update.class})
|
||||||
|
private String stationPersonPassword;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择护理站
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "选择护理站不能为空!", groups = {Insert.class, Update.class})
|
||||||
|
private String nurseStationIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像地址
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站人员表id
|
||||||
|
*/
|
||||||
|
private Long nurseStationPersonId;
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
package com.xinelu.applet.vo.nursepersonapplogin;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xinelu.manage.vo.nursestation.NurseStationSysUserVO;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ljh
|
||||||
|
* @version 1.0
|
||||||
|
* Create by 2022/10/28 14:15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class NursePersonAppLoginsUserVO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 8144014821044310693L;
|
||||||
|
/**
|
||||||
|
* 用户账号
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站id
|
||||||
|
*/
|
||||||
|
private Long nurseStationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
private String phonenumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户账号
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户昵称 用户姓名
|
||||||
|
*/
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户账号
|
||||||
|
*/
|
||||||
|
private String nurseStationIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户昵称 用户姓名
|
||||||
|
*/
|
||||||
|
private String nursePersonName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像地址
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码
|
||||||
|
*/
|
||||||
|
private String stationPersonPassword;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理人员id
|
||||||
|
*/
|
||||||
|
private Long nursePersonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站信息集合
|
||||||
|
*/
|
||||||
|
List<NurseStationSysUserVO> nurseStationSysUserVOList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色标识
|
||||||
|
*/
|
||||||
|
private String personRoleLoginFlag;
|
||||||
|
}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
package com.xinelu.applet.vo.nursepersonapplogin;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.nursestationperson.NurseStationPerson;
|
||||||
|
import com.xinelu.manage.domain.nursestationpersoncertificate.NurseStationPersonCertificate;
|
||||||
|
import com.xinelu.manage.vo.nursestation.NurseStationSysUserVO;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ljh
|
||||||
|
* @version 1.0
|
||||||
|
* Create by 2023/3/30 17:38
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class NurseStationPersonUserVO extends NurseStationPerson implements Serializable {
|
||||||
|
private static final long serialVersionUID = -7948807351529053663L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户账号
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
private String phonenumber;
|
||||||
|
/**
|
||||||
|
* 用户名称
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户昵称 用户姓名
|
||||||
|
*/
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户账号
|
||||||
|
*/
|
||||||
|
private String nurseStationIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 头像地址
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理人员id
|
||||||
|
*/
|
||||||
|
private Long nursePersonId;
|
||||||
|
/**
|
||||||
|
* 护理站信息集合
|
||||||
|
*/
|
||||||
|
@Valid
|
||||||
|
List<NurseStationSysUserVO> nurseStationSysUserVOList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理员证书资质信息表集合
|
||||||
|
**/
|
||||||
|
@Valid
|
||||||
|
private List<NurseStationPersonCertificate> nurseStationPersonCertificateList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年龄
|
||||||
|
*/
|
||||||
|
private Long age;
|
||||||
|
}
|
||||||
@ -0,0 +1,126 @@
|
|||||||
|
package com.xinelu.applet.vo.nursepersonapplogin;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务详情输出VO
|
||||||
|
*
|
||||||
|
* @author zhangheng
|
||||||
|
* @date 2022-11-1
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OrderAndItemVO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 5316795619405528012L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单明细表主键id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站id
|
||||||
|
*/
|
||||||
|
private Long stationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理项目id
|
||||||
|
*/
|
||||||
|
private Long stationItemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理项目订单id
|
||||||
|
*/
|
||||||
|
private Long stationItemPriceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单编号
|
||||||
|
*/
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单数量
|
||||||
|
*/
|
||||||
|
private Long orderCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务日期,格式:yyyy-MM-dd
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate serviceDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务开始时间,格式:HH:mm
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "HH:mm:ss")
|
||||||
|
private LocalTime serviceStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务结束时间,格式:HH:mm
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "HH:mm:ss")
|
||||||
|
private LocalTime serviceEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单状态,代付款:WAIT_PAY,待派单:WAIT_DISPATCH,未完成:NOT_FINISH,服务完成:COMPLETE
|
||||||
|
*/
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约总价格,单位:元
|
||||||
|
*/
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理项目名称
|
||||||
|
*/
|
||||||
|
private String nurseItemName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理项目服务时长和单位
|
||||||
|
*/
|
||||||
|
private String itemServeDurationUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理项目图片地址
|
||||||
|
*/
|
||||||
|
private String itemPictureUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理员id
|
||||||
|
*/
|
||||||
|
private Long nursePersonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已完成和已评价订单状态值集合
|
||||||
|
*/
|
||||||
|
private List<String> orderStatusList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务地址
|
||||||
|
*/
|
||||||
|
private String serviceAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单佣金金额
|
||||||
|
*/
|
||||||
|
private BigDecimal orderCommissionAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单类型,院内陪护:COMPANION_IN_HOSPITAL,其它:OTHER',
|
||||||
|
*/
|
||||||
|
private String orderType;
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package com.xinelu.applet.vo.nursepersonapplogin;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ljh
|
||||||
|
* @version 1.0
|
||||||
|
* Create by 2023/3/30 9:43
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OrderByNursePersonVO implements Serializable {
|
||||||
|
private static final long serialVersionUID = -3973147428969028472L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未完成数量
|
||||||
|
**/
|
||||||
|
private Long notFinishCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已完成数量
|
||||||
|
**/
|
||||||
|
private Long completeCount;
|
||||||
|
|
||||||
|
|
||||||
|
private String orderStatus;
|
||||||
|
}
|
||||||
@ -0,0 +1,157 @@
|
|||||||
|
package com.xinelu.applet.vo.nursepersonapplogin;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务详情输出VO
|
||||||
|
*
|
||||||
|
* @author zhangheng
|
||||||
|
* @date 2022-10-28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OrderDetailsAndPatientVO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 5800983517650859147L;
|
||||||
|
/**
|
||||||
|
* 订单主表主键id
|
||||||
|
*/
|
||||||
|
private Long appointmentOrderId;
|
||||||
|
/**
|
||||||
|
* 订单明细主键id
|
||||||
|
*/
|
||||||
|
private Long orderDetailsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单编号
|
||||||
|
*/
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单数量
|
||||||
|
*/
|
||||||
|
private Long orderCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务地址
|
||||||
|
*/
|
||||||
|
private String serviceAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务日期,格式:yyyy-MM-dd
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate serviceDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务开始时间,格式:HH:mm
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "HH:mm:ss")
|
||||||
|
private LocalTime serviceStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约总价格,单位:元
|
||||||
|
*/
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理项目名称
|
||||||
|
*/
|
||||||
|
private String nurseItemName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理项目服务时长和单位
|
||||||
|
*/
|
||||||
|
private String itemServeDurationUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户姓名
|
||||||
|
*/
|
||||||
|
private String patientName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人员地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出生日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate birthDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年龄
|
||||||
|
*/
|
||||||
|
private Long age;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住址经度
|
||||||
|
*/
|
||||||
|
private String homeLongitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住址纬度
|
||||||
|
*/
|
||||||
|
private String homeLatitude;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理项目图片地址
|
||||||
|
*/
|
||||||
|
private String itemPictureUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单状态,待派单:WAIT_DISPATCH,未完成:NOT_FINISH,服务完成:COMPLETE
|
||||||
|
*/
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务到岗图片路径
|
||||||
|
*/
|
||||||
|
private String onDutyPictureUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务进行中上传视频存放路径
|
||||||
|
*/
|
||||||
|
private String serviceProgressVideoUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务结束照片存放路径
|
||||||
|
*/
|
||||||
|
private String serviceEndPictureUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户签名确认图片存放路径
|
||||||
|
*/
|
||||||
|
private String userSignaturePictureUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失能情况,NOT_DISABLED:未失能,DISABLED:已失能
|
||||||
|
*/
|
||||||
|
private String disablingCondition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失能原因
|
||||||
|
*/
|
||||||
|
private String disablingReason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单佣金金额
|
||||||
|
*/
|
||||||
|
private BigDecimal orderCommissionAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 健康状态
|
||||||
|
*/
|
||||||
|
private String diseaseName;
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
package com.xinelu.applet.vo.nursepersonapplogin;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ljh
|
||||||
|
* @version 1.0
|
||||||
|
* Create by 2022/11/2 11:42
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PersonNurseStationAppVO implements Serializable {
|
||||||
|
private static final long serialVersionUID = -231488908366920143L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属区域编码
|
||||||
|
*/
|
||||||
|
private String areaCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站编号
|
||||||
|
*/
|
||||||
|
private String nurseStationCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站名称
|
||||||
|
*/
|
||||||
|
private String nurseStationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理类型,多个用逗号隔开
|
||||||
|
*/
|
||||||
|
private String nurseStationType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站经纬(横坐标)
|
||||||
|
*/
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站纬度(纵坐标)
|
||||||
|
*/
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人
|
||||||
|
*/
|
||||||
|
private String dutyPerson;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责人联系电话
|
||||||
|
*/
|
||||||
|
private String dutyPhone;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,418 @@
|
|||||||
|
<?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.nursepersonapplogin.NursePersonAppLoginMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.xinelu.applet.vo.nursepersonapplogin.NurseStationPersonUserVO" id="NursePersonVO">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="nurseStationIds" column="nurse_station_ids"/>
|
||||||
|
<result property="departmentCode" column="department_code"/>
|
||||||
|
<result property="userId" column="user_id"/>
|
||||||
|
<result property="userName" column="user_name"/>
|
||||||
|
<result property="nickName" column="nick_name"/>
|
||||||
|
<result property="phonenumber" column="phonenumber"/>
|
||||||
|
<result property="avatar" column="avatar"/>
|
||||||
|
<result property="nursePersonCode" column="nurse_person_code"/>
|
||||||
|
<result property="nursePersonName" column="nurse_person_name"/>
|
||||||
|
<result property="nursePersonType" column="nurse_person_type"/>
|
||||||
|
<result property="sex" column="sex"/>
|
||||||
|
<result property="phone" column="phone"/>
|
||||||
|
<result property="address" column="address"/>
|
||||||
|
<result property="birthDate" column="birth_date"/>
|
||||||
|
<result property="openid" column="openid"/>
|
||||||
|
<result property="unionid" column="unionid"/>
|
||||||
|
<result property="evaluateStarCount" column="evaluate_star_count"/>
|
||||||
|
<result property="positionalTitleLevel" column="positional_title_level"/>
|
||||||
|
<result property="geniusItem" column="genius_item"/>
|
||||||
|
<result property="totalRevenueAmount" column="total_revenue_amount"/>
|
||||||
|
<result property="workStatus" column="work_status"/>
|
||||||
|
<result property="modifyCheckStatus" column="modify_check_status"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<collection property="nurseStationPersonCertificateList" javaType="java.util.List"
|
||||||
|
resultMap="NursePersonCertificateInfoById"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="NurseStationPersonCertificate" id="NursePersonCertificateInfoById">
|
||||||
|
<result property="id" column="certificateId"/>
|
||||||
|
<result property="certificateName" column="certificate_name"/>
|
||||||
|
<result property="certificateUrl" column="certificate_url"/>
|
||||||
|
<result property="sort" column="sort"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectOrderByNursePersonCount"
|
||||||
|
resultType="com.xinelu.applet.vo.nursepersonapplogin.OrderByNursePersonVO">
|
||||||
|
SELECT
|
||||||
|
order_status
|
||||||
|
FROM appointment_order
|
||||||
|
<where>
|
||||||
|
<if test="nurseStationPersonId != null">
|
||||||
|
nurse_station_person_id = #{nurseStationPersonId}
|
||||||
|
</if>
|
||||||
|
<if test="orderStatusList != null and orderStatusList != ''">
|
||||||
|
AND order_status in
|
||||||
|
<foreach collection="orderStatusList" item="orderStatusList" open="(" separator="," close=")">
|
||||||
|
#{orderStatusList}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
and del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectOrderByNursePersonId"
|
||||||
|
resultType="com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO">
|
||||||
|
SELECT
|
||||||
|
ao.id,
|
||||||
|
aod.order_no,
|
||||||
|
aod.order_count,
|
||||||
|
aod.order_status,
|
||||||
|
ao.order_commission_amount,
|
||||||
|
aod.appointment_status,
|
||||||
|
aod.service_date,
|
||||||
|
aod.service_start_time,
|
||||||
|
aod.service_end_time,
|
||||||
|
aod.total_price,
|
||||||
|
aod.nurse_item_name,
|
||||||
|
aod.item_serve_duration_unit,
|
||||||
|
aod.create_time,
|
||||||
|
aod.service_address,
|
||||||
|
nsi.item_picture_url
|
||||||
|
FROM
|
||||||
|
appointment_order ao
|
||||||
|
LEFT JOIN appointment_order_details aod ON aod.order_no = ao.order_no
|
||||||
|
LEFT JOIN nurse_station_item nsi ON nsi.id = aod.nurse_station_item_id
|
||||||
|
<where>
|
||||||
|
<if test="nursePersonId != null">
|
||||||
|
ao.nurse_station_person_id = #{nursePersonId}
|
||||||
|
</if>
|
||||||
|
<!-- 已完成订单状态和未完成的订单状态 -->
|
||||||
|
<if test="orderStatusList != null and orderStatusList != ''">
|
||||||
|
AND ao.order_status in
|
||||||
|
<foreach collection="orderStatusList" item="orderStatus" open="(" separator="," close=")">
|
||||||
|
#{orderStatus}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="nurseItemName != null and nurseItemName != ''">
|
||||||
|
AND aod.nurse_item_name like concat('%', #{nurseItemName}, '%')
|
||||||
|
</if>
|
||||||
|
and ao.del_flag = 0
|
||||||
|
and aod.del_flag = 0
|
||||||
|
</where>
|
||||||
|
ORDER BY aod.order_status DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getOrderDetailsAndPatientByDetailsId"
|
||||||
|
resultType="com.xinelu.applet.vo.nursepersonapplogin.OrderDetailsAndPatientVO">
|
||||||
|
SELECT
|
||||||
|
ao.id appointmentOrderId,
|
||||||
|
aod.id orderDetailsId,
|
||||||
|
aod.order_no,
|
||||||
|
aod.service_address,
|
||||||
|
aod.order_count,
|
||||||
|
aod.service_date,
|
||||||
|
aod.service_start_time,
|
||||||
|
aod.service_end_time,
|
||||||
|
aod.total_price,
|
||||||
|
aod.nurse_item_name,
|
||||||
|
aod.item_serve_duration_unit,
|
||||||
|
aod.order_status,
|
||||||
|
ao.order_commission_amount,
|
||||||
|
nsi.item_picture_url,
|
||||||
|
pi.patient_name,
|
||||||
|
pi.birth_date,
|
||||||
|
pi.phone,
|
||||||
|
IFNULL(pi.address, '') address,
|
||||||
|
pi.home_longitude,
|
||||||
|
pi.home_latitude,
|
||||||
|
aod.disabling_condition,
|
||||||
|
aod.disabling_reason,
|
||||||
|
aod.on_duty_picture_url,
|
||||||
|
aod.service_end_picture_url,
|
||||||
|
aod.user_signature_picture_url,
|
||||||
|
aod.service_progress_video_url
|
||||||
|
FROM appointment_order ao
|
||||||
|
LEFT JOIN appointment_order_details aod ON aod.order_no = ao.order_no
|
||||||
|
LEFT JOIN patient_info pi ON pi.id = ao.patient_id
|
||||||
|
LEFT JOIN nurse_station_item nsi ON nsi.id = aod.nurse_station_item_id
|
||||||
|
<where>
|
||||||
|
<if test="orderNo != null and orderNo != ''">
|
||||||
|
AND ao.order_no = #{orderNo}
|
||||||
|
</if>
|
||||||
|
and aod.del_flag = 0
|
||||||
|
and ao.del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateAppointmentOrderByOrderNo">
|
||||||
|
UPDATE appointment_order a,
|
||||||
|
appointment_order_details b
|
||||||
|
SET a.order_status = #{orderStatus},
|
||||||
|
a.task_return_reason = #{taskReturnReason},
|
||||||
|
a.nurse_station_person_id = null,
|
||||||
|
b.order_status = #{orderStatus},
|
||||||
|
a.update_time = now(),
|
||||||
|
b.update_time = now()
|
||||||
|
WHERE
|
||||||
|
a.order_no = b.order_no
|
||||||
|
AND a.del_flag = 0
|
||||||
|
AND a.order_status <> #{orderStatus}
|
||||||
|
AND b.order_status <> #{orderStatus}
|
||||||
|
AND a.order_no = #{orderNo}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="getSysUserPasswordByPhone" resultType="int">
|
||||||
|
SELECT
|
||||||
|
count( 1 )
|
||||||
|
FROM
|
||||||
|
sys_user su
|
||||||
|
LEFT JOIN nurse_station_person nsp ON su.phonenumber = nsp.phone
|
||||||
|
<where>
|
||||||
|
<if test="phonenumber != null and phonenumber != ''">
|
||||||
|
and su.phonenumber = #{phonenumber}
|
||||||
|
</if>
|
||||||
|
<if test="stationPersonPassword != null and stationPersonPassword != ''">
|
||||||
|
and su.station_person_password = #{stationPersonPassword}
|
||||||
|
</if>
|
||||||
|
and su.del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertNurseAppLoginSysUser"
|
||||||
|
parameterType="com.xinelu.applet.vo.nursepersonapplogin.NurseAppLoginSysUserVO"
|
||||||
|
useGeneratedKeys="true" keyProperty="userId">
|
||||||
|
insert into sys_user
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="userName != null ">user_name,
|
||||||
|
</if>
|
||||||
|
<if test="nickName != null ">nick_name,
|
||||||
|
</if>
|
||||||
|
<if test="phonenumber != null ">phonenumber,
|
||||||
|
</if>
|
||||||
|
<if test="stationPersonPassword != null">station_person_password,
|
||||||
|
</if>
|
||||||
|
<if test="nurseStationIds != null">nurse_station_ids,
|
||||||
|
</if>
|
||||||
|
<if test="nurseStationPersonId != null">nurse_station_person_id,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">create_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="userName != null ">#{userName},
|
||||||
|
</if>
|
||||||
|
<if test="nickName != null ">#{nickName},
|
||||||
|
</if>
|
||||||
|
<if test="phonenumber != null ">#{phonenumber},
|
||||||
|
</if>
|
||||||
|
<if test="stationPersonPassword != null ">#{stationPersonPassword},
|
||||||
|
</if>
|
||||||
|
<if test="nurseStationPersonId != null ">#{nurseStationPersonId},
|
||||||
|
</if>
|
||||||
|
<if test="nurseStationIds != null ">#{nurseStationIds},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">#{createTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<update id="updateUserPassWord" parameterType="SysUser">
|
||||||
|
update sys_user
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="userName != null ">user_name = #{userName},
|
||||||
|
</if>
|
||||||
|
<if test="nickName != null ">nick_name = #{nickName},
|
||||||
|
</if>
|
||||||
|
<if test="phonenumber != null ">phonenumber = #{phonenumber},
|
||||||
|
</if>
|
||||||
|
<if test="stationPersonPassword != null ">station_person_password = #{stationPersonPassword},
|
||||||
|
</if>
|
||||||
|
<if test="avatar != null ">avatar = #{avatar},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
where user_id = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getUserAndPerson"
|
||||||
|
parameterType="com.xinelu.applet.vo.nursepersonapplogin.NursePersonAppLoginsUserVO"
|
||||||
|
resultType="com.xinelu.applet.vo.nursepersonapplogin.NursePersonAppLoginsUserVO">
|
||||||
|
SELECT
|
||||||
|
su.user_id,
|
||||||
|
su.user_name,
|
||||||
|
su.nick_name,
|
||||||
|
su.phonenumber,
|
||||||
|
su.nurse_station_ids,
|
||||||
|
su.station_person_password,
|
||||||
|
nsp.id nursePersonId,
|
||||||
|
nsp.nurse_station_id,
|
||||||
|
nsp.nurse_person_name,
|
||||||
|
nsp.phone
|
||||||
|
FROM
|
||||||
|
sys_user su
|
||||||
|
LEFT JOIN nurse_station_person nsp ON su.phonenumber = nsp.phone
|
||||||
|
<where>
|
||||||
|
<if test="phonenumber != null and phonenumber != ''">
|
||||||
|
and su.phonenumber = #{phonenumber}
|
||||||
|
</if>
|
||||||
|
<if test="stationPersonPassword != null and stationPersonPassword != ''">
|
||||||
|
and su.station_person_password = #{stationPersonPassword}
|
||||||
|
</if>
|
||||||
|
and su.del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getFromPhoneUserId" resultType="Long">
|
||||||
|
select
|
||||||
|
user_id
|
||||||
|
from sys_user
|
||||||
|
<where>
|
||||||
|
<if test="phonenumber != null and phonenumber != ''">
|
||||||
|
phonenumber = #{phonenumber}
|
||||||
|
</if>
|
||||||
|
and del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getNursePersonPersonalInformation"
|
||||||
|
parameterType="com.xinelu.applet.vo.nursepersonapplogin.NursePersonAppLoginsUserVO"
|
||||||
|
resultType="com.xinelu.applet.vo.nursepersonapplogin.NursePersonAppLoginsUserVO">
|
||||||
|
SELECT
|
||||||
|
su.user_id,
|
||||||
|
su.user_name,
|
||||||
|
su.nick_name,
|
||||||
|
su.phonenumber,
|
||||||
|
su.avatar,
|
||||||
|
su.nurse_station_ids
|
||||||
|
FROM
|
||||||
|
sys_user su
|
||||||
|
<where>
|
||||||
|
<if test="phonenumber != null and phonenumber != ''">
|
||||||
|
and su.phonenumber = #{phonenumber}
|
||||||
|
</if>
|
||||||
|
<if test="stationPersonPassword != null and stationPersonPassword != ''">
|
||||||
|
and su.station_person_password = #{stationPersonPassword}
|
||||||
|
</if>
|
||||||
|
and su.del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateHeadAvatarHeadUserId" parameterType="SysUser">
|
||||||
|
update sys_user
|
||||||
|
set avatar = #{avatar}
|
||||||
|
where user_id = #{userId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getPersonNurseStationLists"
|
||||||
|
parameterType="com.xinelu.applet.vo.nursepersonapplogin.PersonNurseStationAppVO"
|
||||||
|
resultType="com.xinelu.applet.vo.nursepersonapplogin.PersonNurseStationAppVO">
|
||||||
|
select id,
|
||||||
|
area_code,
|
||||||
|
user_id,
|
||||||
|
nurse_station_code,
|
||||||
|
nurse_station_name,
|
||||||
|
nurse_station_type,
|
||||||
|
longitude,
|
||||||
|
latitude,
|
||||||
|
phone,
|
||||||
|
address,
|
||||||
|
duty_person,
|
||||||
|
duty_phone,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time
|
||||||
|
from nurse_station
|
||||||
|
<where>
|
||||||
|
<if test="areaCode != null ">
|
||||||
|
and area_code = #{areaCode}
|
||||||
|
</if>
|
||||||
|
<if test="id != null ">
|
||||||
|
and id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="userId != null ">
|
||||||
|
and user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="nurseStationCode != null and nurseStationCode != ''">
|
||||||
|
and nurse_station_code like concat('%', #{nurseStationCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="nurseStationName != null and nurseStationName != ''">
|
||||||
|
and nurse_station_name like concat('%', #{nurseStationName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="nurseStationType != null and nurseStationType != ''">
|
||||||
|
and find_in_set(#{nurseStationType},nurse_station_type)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getNursePersonUserId" parameterType="Long"
|
||||||
|
resultType="com.xinelu.applet.vo.nursepersonapplogin.NursePersonAppLoginsUserVO">
|
||||||
|
SELECT
|
||||||
|
su.user_id,
|
||||||
|
su.user_name,
|
||||||
|
su.nick_name,
|
||||||
|
su.phonenumber,
|
||||||
|
su.avatar,
|
||||||
|
su.nurse_station_ids
|
||||||
|
FROM
|
||||||
|
sys_user su
|
||||||
|
<where>
|
||||||
|
<if test="userId != null ">
|
||||||
|
and su.user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
and su.del_flag = 0
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getNurseStationPersonById"
|
||||||
|
parameterType="integer"
|
||||||
|
resultMap="NursePersonVO">
|
||||||
|
SELECT
|
||||||
|
su.user_id,
|
||||||
|
su.user_name,
|
||||||
|
su.nick_name,
|
||||||
|
su.phonenumber,
|
||||||
|
su.avatar,
|
||||||
|
su.nurse_station_ids,
|
||||||
|
nsp.id nursePersonId,
|
||||||
|
nsp.department_code,
|
||||||
|
nsp.nurse_person_name,
|
||||||
|
nsp.nurse_person_type,
|
||||||
|
nsp.sex,
|
||||||
|
nsp.phone,
|
||||||
|
nsp.address,
|
||||||
|
nsp.birth_date,
|
||||||
|
nsp.openid,
|
||||||
|
nsp.unionid,
|
||||||
|
nsp.evaluate_star_count,
|
||||||
|
nsp.positional_title_level,
|
||||||
|
nsp.genius_item,
|
||||||
|
nsp.total_revenue_amount,
|
||||||
|
nsp.work_status,
|
||||||
|
nsp.modify_check_status,
|
||||||
|
nsp.create_by,
|
||||||
|
nsp.create_time,
|
||||||
|
nsp.update_by,
|
||||||
|
nsp.update_time,
|
||||||
|
nspc.id certificateId,
|
||||||
|
nspc.certificate_name,
|
||||||
|
nspc.certificate_url,
|
||||||
|
nspc.sort
|
||||||
|
FROM
|
||||||
|
nurse_station_person nsp
|
||||||
|
LEFT JOIN sys_user su ON su.phonenumber = nsp.phone
|
||||||
|
LEFT JOIN nurse_station_person_certificate nspc ON nspc.nurse_station_person_id = nsp.id
|
||||||
|
<where>
|
||||||
|
<if test="nursePersonId != null and nursePersonId != ''">
|
||||||
|
and nsp.id = #{nursePersonId}
|
||||||
|
</if>
|
||||||
|
and su.del_flag = 0
|
||||||
|
</where>
|
||||||
|
ORDER BY nspc.sort
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,81 @@
|
|||||||
|
package com.xinelu.manage.domain.nursestationpersonrevenue;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.xinelu.common.annotation.Excel;
|
||||||
|
import com.xinelu.common.core.domain.BaseDomain;
|
||||||
|
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 java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理员订单佣金收益信息对象 nurse_station_person_revenue
|
||||||
|
*
|
||||||
|
* @author xinyilu
|
||||||
|
* @date 2023-03-29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ApiModel(value = "护理员订单佣金收益信息对象", description = "nurse_station_person_revenue")
|
||||||
|
public class NurseStationPersonRevenue extends BaseDomain implements Serializable {
|
||||||
|
private static final long serialVersionUID = -5400211001451444886L;
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站人员表id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "护理站人员表id")
|
||||||
|
@Excel(name = "护理站人员表id")
|
||||||
|
private Long nurseStationPersonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单表id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "预约订单表id")
|
||||||
|
@Excel(name = "预约订单表id")
|
||||||
|
private Long appointmentOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收益金额
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "收益金额")
|
||||||
|
@Excel(name = "收益金额")
|
||||||
|
private BigDecimal revenueAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单完成时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "预约订单完成时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "预约订单完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime finishOrderTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("nurseStationPersonId", getNurseStationPersonId())
|
||||||
|
.append("appointmentOrderId", getAppointmentOrderId())
|
||||||
|
.append("revenueAmount", getRevenueAmount())
|
||||||
|
.append("finishOrderTime", getFinishOrderTime())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,89 @@
|
|||||||
|
package com.xinelu.manage.mapper.nursestationpersonrevenue;
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.nursestationpersonrevenue.NurseStationPersonRevenue;
|
||||||
|
import com.xinelu.manage.vo.nursestationpersonrevenue.NurseStationPersonRevenueVO;
|
||||||
|
import com.xinelu.manage.vo.nursestationpersonrevenue.PersonRevenueCountVO;
|
||||||
|
import com.xinelu.manage.vo.nursestationpersonrevenue.RevenueTimeDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理员订单佣金收益信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author xinyilu
|
||||||
|
* @date 2023-03-29
|
||||||
|
*/
|
||||||
|
public interface NurseStationPersonRevenueMapper {
|
||||||
|
/**
|
||||||
|
* 查询护理员订单佣金收益信息
|
||||||
|
*
|
||||||
|
* @param id 护理员订单佣金收益信息主键
|
||||||
|
* @return 护理员订单佣金收益信息
|
||||||
|
*/
|
||||||
|
NurseStationPersonRevenue selectNurseStationPersonRevenueById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询护理员订单佣金收益信息列表
|
||||||
|
*
|
||||||
|
* @param nurseStationPersonRevenue 护理员订单佣金收益信息
|
||||||
|
* @return 护理员订单佣金收益信息集合
|
||||||
|
*/
|
||||||
|
List<NurseStationPersonRevenue> selectNurseStationPersonRevenueList(NurseStationPersonRevenue nurseStationPersonRevenue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增护理员订单佣金收益信息
|
||||||
|
*
|
||||||
|
* @param nurseStationPersonRevenue 护理员订单佣金收益信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertNurseStationPersonRevenue(NurseStationPersonRevenue nurseStationPersonRevenue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改护理员订单佣金收益信息
|
||||||
|
*
|
||||||
|
* @param nurseStationPersonRevenue 护理员订单佣金收益信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateNurseStationPersonRevenue(NurseStationPersonRevenue nurseStationPersonRevenue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除护理员订单佣金收益信息
|
||||||
|
*
|
||||||
|
* @param id 护理员订单佣金收益信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteNurseStationPersonRevenueById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除护理员订单佣金收益信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteNurseStationPersonRevenueByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理员收益统计
|
||||||
|
*
|
||||||
|
* @param revenueTime 时间
|
||||||
|
* @return NurseStationPersonRevenueVO
|
||||||
|
*/
|
||||||
|
List<PersonRevenueCountVO> selectCount(RevenueTimeDTO revenueTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理员收益统计
|
||||||
|
*
|
||||||
|
* @param revenueTime 用户信息及时间
|
||||||
|
* @return NurseStationPersonRevenueVO
|
||||||
|
*/
|
||||||
|
PersonRevenueCountVO selectRevenueAmountById(RevenueTimeDTO revenueTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询收益明细
|
||||||
|
*
|
||||||
|
* @param revenueTime 护理员信息
|
||||||
|
* @return NurseStationPersonRevenueVO
|
||||||
|
*/
|
||||||
|
List<NurseStationPersonRevenueVO> selectRevenueDetails(RevenueTimeDTO revenueTime);
|
||||||
|
}
|
||||||
@ -0,0 +1,86 @@
|
|||||||
|
package com.xinelu.manage.mapper.patientdiseaseinfo;
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.patientdiseaseinfo.PatientDiseaseInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 患者疾病关系Mapper接口
|
||||||
|
*
|
||||||
|
* @author 纪寒
|
||||||
|
* @date 2022-09-02
|
||||||
|
*/
|
||||||
|
public interface PatientDiseaseInfoMapper {
|
||||||
|
/**
|
||||||
|
* 查询患者疾病关系
|
||||||
|
*
|
||||||
|
* @param id 患者疾病关系主键
|
||||||
|
* @return 患者疾病关系
|
||||||
|
*/
|
||||||
|
PatientDiseaseInfo selectPatientDiseaseInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询患者疾病关系列表
|
||||||
|
*
|
||||||
|
* @param patientDiseaseInfo 患者疾病关系
|
||||||
|
* @return 患者疾病关系集合
|
||||||
|
*/
|
||||||
|
List<PatientDiseaseInfo> selectPatientDiseaseInfoList(PatientDiseaseInfo patientDiseaseInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询患者疾病关系列表
|
||||||
|
*
|
||||||
|
* @param patientId 患者疾病关系
|
||||||
|
* @return 患者疾病关系集合
|
||||||
|
*/
|
||||||
|
List<PatientDiseaseInfo> selectPatientDiseasePatientId(Long patientId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增患者疾病关系
|
||||||
|
*
|
||||||
|
* @param patientDiseaseInfo 患者疾病关系
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertPatientDiseaseInfo(PatientDiseaseInfo patientDiseaseInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改患者疾病关系
|
||||||
|
*
|
||||||
|
* @param patientDiseaseInfo 患者疾病关系
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updatePatientDiseaseInfo(PatientDiseaseInfo patientDiseaseInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除患者疾病关系
|
||||||
|
*
|
||||||
|
* @param id 患者疾病关系主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deletePatientDiseaseInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除患者疾病关系
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deletePatientDiseaseInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量新增护理人疾病信息
|
||||||
|
*
|
||||||
|
* @param patientDiseaseInfoList 信息集合
|
||||||
|
* @return 新增数量
|
||||||
|
*/
|
||||||
|
int insertBatchPatientDiseaseInfo(List<PatientDiseaseInfo> patientDiseaseInfoList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单编号查询会员健康状况
|
||||||
|
*
|
||||||
|
* @param orderNo 订单编号
|
||||||
|
* @return PatientDiseaseInfo
|
||||||
|
*/
|
||||||
|
List<PatientDiseaseInfo> selectPatientDiseaseInfoByOrderNo(String orderNo);
|
||||||
|
}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
package com.xinelu.manage.vo.nursestationpersonrevenue;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.xinelu.manage.domain.nursestationpersonrevenue.NurseStationPersonRevenue;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收益明细
|
||||||
|
*
|
||||||
|
* @author zhangheng
|
||||||
|
* @date 2023-03—30
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class NurseStationPersonRevenueVO extends NurseStationPersonRevenue implements Serializable {
|
||||||
|
private static final long serialVersionUID = -2454392424237460279L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站人员id
|
||||||
|
*/
|
||||||
|
private Long nurseStationPersonRevenueId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理项目名称
|
||||||
|
*/
|
||||||
|
private String nurseItemName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务日期,格式:yyyy-MM-dd
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate serviceDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务开始时间,格式:HH:mm
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "HH:mm:ss")
|
||||||
|
private LocalTime serviceStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务结束时间,格式:HH:mm
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "HH:mm:ss")
|
||||||
|
private LocalTime serviceEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单完成时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime finishOrderTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单主表id
|
||||||
|
*/
|
||||||
|
private Long appointmentOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单编号
|
||||||
|
*/
|
||||||
|
private String orderNo;
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.xinelu.manage.vo.nursestationpersonrevenue;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收益统计
|
||||||
|
*
|
||||||
|
* @author zhangheng
|
||||||
|
* @date 2023-03—30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PersonRevenueCountVO implements Serializable {
|
||||||
|
private static final long serialVersionUID = -2454392424237460279L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理员id
|
||||||
|
*/
|
||||||
|
private Long nurseStationPersonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理员名称
|
||||||
|
*/
|
||||||
|
private String nursePersonName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属护理站名称
|
||||||
|
*/
|
||||||
|
private String nurseStationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单总数
|
||||||
|
*/
|
||||||
|
private Long orderCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单总收益
|
||||||
|
*/
|
||||||
|
private BigDecimal orderTotalPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月订单总数
|
||||||
|
*/
|
||||||
|
private Long monthOrderCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本月订单总收益
|
||||||
|
*/
|
||||||
|
private BigDecimal monthOrderTotalPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日订单总数
|
||||||
|
*/
|
||||||
|
private Long todayOrderCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 今日订单收益
|
||||||
|
*/
|
||||||
|
private BigDecimal todayOrderPrice;
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
package com.xinelu.manage.vo.nursestationpersonrevenue;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收益统计传入vo
|
||||||
|
*
|
||||||
|
* @author zhangheng
|
||||||
|
* @date 2023-03—31
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RevenueTimeDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站id
|
||||||
|
*/
|
||||||
|
private Long nurseStationId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理员id
|
||||||
|
*/
|
||||||
|
private Long nurseStationPersonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现在时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime nowTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 月开始时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate monthStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 月结束时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate monthEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 月份时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private LocalDate monthTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 月开始时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime monthStartDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 月结束时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime monthEndDateTime;
|
||||||
|
}
|
||||||
@ -0,0 +1,237 @@
|
|||||||
|
<?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.manage.mapper.nursestationpersonrevenue.NurseStationPersonRevenueMapper">
|
||||||
|
|
||||||
|
<resultMap type="NurseStationPersonRevenue" id="NurseStationPersonRevenueResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="nurseStationPersonId" column="nurse_station_person_id"/>
|
||||||
|
<result property="appointmentOrderId" column="appointment_order_id"/>
|
||||||
|
<result property="revenueAmount" column="revenue_amount"/>
|
||||||
|
<result property="finishOrderTime" column="finish_order_time"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectNurseStationPersonRevenueVo">
|
||||||
|
select id,
|
||||||
|
nurse_station_person_id,
|
||||||
|
appointment_order_id,
|
||||||
|
revenue_amount,
|
||||||
|
finish_order_time,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time
|
||||||
|
from nurse_station_person_revenue
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectNurseStationPersonRevenueList" parameterType="NurseStationPersonRevenue"
|
||||||
|
resultMap="NurseStationPersonRevenueResult">
|
||||||
|
<include refid="selectNurseStationPersonRevenueVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="nurseStationPersonId != null ">
|
||||||
|
and nurse_station_person_id = #{nurseStationPersonId}
|
||||||
|
</if>
|
||||||
|
<if test="appointmentOrderId != null ">
|
||||||
|
and appointment_order_id = #{appointmentOrderId}
|
||||||
|
</if>
|
||||||
|
<if test="revenueAmount != null ">
|
||||||
|
and revenue_amount = #{revenueAmount}
|
||||||
|
</if>
|
||||||
|
<if test="finishOrderTime != null ">
|
||||||
|
and finish_order_time = #{finishOrderTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectNurseStationPersonRevenueById" parameterType="Long"
|
||||||
|
resultMap="NurseStationPersonRevenueResult">
|
||||||
|
<include refid="selectNurseStationPersonRevenueVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertNurseStationPersonRevenue" parameterType="NurseStationPersonRevenue" useGeneratedKeys="true"
|
||||||
|
keyProperty="id">
|
||||||
|
insert into nurse_station_person_revenue
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="nurseStationPersonId != null">nurse_station_person_id,
|
||||||
|
</if>
|
||||||
|
<if test="appointmentOrderId != null">appointment_order_id,
|
||||||
|
</if>
|
||||||
|
<if test="revenueAmount != null">revenue_amount,
|
||||||
|
</if>
|
||||||
|
<if test="finishOrderTime != null">finish_order_time,
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">create_by,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">update_by,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="nurseStationPersonId != null">#{nurseStationPersonId},
|
||||||
|
</if>
|
||||||
|
<if test="appointmentOrderId != null">#{appointmentOrderId},
|
||||||
|
</if>
|
||||||
|
<if test="revenueAmount != null">#{revenueAmount},
|
||||||
|
</if>
|
||||||
|
<if test="finishOrderTime != null">#{finishOrderTime},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">#{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateNurseStationPersonRevenue" parameterType="NurseStationPersonRevenue">
|
||||||
|
update nurse_station_person_revenue
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="nurseStationPersonId != null">nurse_station_person_id =
|
||||||
|
#{nurseStationPersonId},
|
||||||
|
</if>
|
||||||
|
<if test="appointmentOrderId != null">appointment_order_id =
|
||||||
|
#{appointmentOrderId},
|
||||||
|
</if>
|
||||||
|
<if test="revenueAmount != null">revenue_amount =
|
||||||
|
#{revenueAmount},
|
||||||
|
</if>
|
||||||
|
<if test="finishOrderTime != null">finish_order_time =
|
||||||
|
#{finishOrderTime},
|
||||||
|
</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="deleteNurseStationPersonRevenueById" parameterType="Long">
|
||||||
|
delete
|
||||||
|
from nurse_station_person_revenue
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteNurseStationPersonRevenueByIds" parameterType="String">
|
||||||
|
delete from nurse_station_person_revenue where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectCount"
|
||||||
|
resultType="com.xinelu.manage.vo.nursestationpersonrevenue.PersonRevenueCountVO">
|
||||||
|
SELECT nsp.id nurseStationPersonId,
|
||||||
|
nsp.nurse_person_name,
|
||||||
|
ns.nurse_station_name,
|
||||||
|
(select count(1) FROM nurse_station_person_revenue WHERE nurse_station_person_id = nsp.id) orderCount,
|
||||||
|
(select IFNULL(SUM(revenue_amount), 0.00)
|
||||||
|
FROM nurse_station_person_revenue
|
||||||
|
where nurse_station_person_id = nsp.id) orderTotalPrice,
|
||||||
|
(select count(1)
|
||||||
|
FROM nurse_station_person_revenue
|
||||||
|
WHERE nurse_station_person_id = nsp.id
|
||||||
|
and finish_order_time >= #{monthStartDateTime}
|
||||||
|
and finish_order_time <= #{monthEndDateTime}) monthOrderCount,
|
||||||
|
(select IFNULL(SUM(revenue_amount), 0.00)
|
||||||
|
FROM nurse_station_person_revenue
|
||||||
|
where nurse_station_person_id = nsp.id
|
||||||
|
and finish_order_time >= #{monthStartDateTime}
|
||||||
|
and finish_order_time <= #{monthEndDateTime}) monthOrderTotalPrice,
|
||||||
|
(select count(1)
|
||||||
|
FROM nurse_station_person_revenue
|
||||||
|
WHERE nurse_station_person_id = nsp.id
|
||||||
|
and finish_order_time >= #{startTime}
|
||||||
|
and finish_order_time <= #{nowTime}) todayOrderCount,
|
||||||
|
(select IFNULL(SUM(revenue_amount), 0.00)
|
||||||
|
FROM nurse_station_person_revenue
|
||||||
|
where nurse_station_person_id = nsp.id
|
||||||
|
and finish_order_time >= #{startTime}
|
||||||
|
and finish_order_time <= #{nowTime}) todayOrderPrice
|
||||||
|
FROM nurse_station_person nsp
|
||||||
|
LEFT JOIN nurse_station_person_revenue nspr ON nsp.id = nspr.nurse_station_person_id
|
||||||
|
LEFT JOIN nurse_station ns ON ns.id = nsp.nurse_station_id
|
||||||
|
<where>
|
||||||
|
<if test="nurseStationPersonId != null ">
|
||||||
|
nsp.id = #{nurseStationPersonId}
|
||||||
|
</if>
|
||||||
|
<if test="nurseStationId != null ">
|
||||||
|
AND ns.id = #{nurseStationId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY nsp.id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRevenueAmountById"
|
||||||
|
resultType="com.xinelu.manage.vo.nursestationpersonrevenue.PersonRevenueCountVO">
|
||||||
|
select nsp.id nurseStationPersonId,
|
||||||
|
nsp.nurse_person_name,
|
||||||
|
(select IFNULL(SUM(revenue_amount), 0.00)
|
||||||
|
FROM nurse_station_person_revenue
|
||||||
|
where nurse_station_person_id = nspr.nurse_station_person_id
|
||||||
|
and finish_order_time >= #{startTime}
|
||||||
|
and finish_order_time <= #{endTime}) todayOrderPrice,
|
||||||
|
(select IFNULL(SUM(revenue_amount), 0.00)
|
||||||
|
FROM nurse_station_person_revenue
|
||||||
|
where nurse_station_person_id = nspr.nurse_station_person_id
|
||||||
|
and finish_order_time >= #{monthStartDateTime}
|
||||||
|
and finish_order_time <= #{monthEndDateTime}) monthOrderTotalPrice,
|
||||||
|
IFNULL(SUM(nspr.revenue_amount), 0.00) orderTotalPrice
|
||||||
|
FROM nurse_station_person_revenue nspr
|
||||||
|
LEFT JOIN nurse_station_person nsp on nsp.id = nspr.nurse_station_person_id
|
||||||
|
<where>
|
||||||
|
<if test="nurseStationPersonId != null ">
|
||||||
|
nspr.nurse_station_person_id = #{nurseStationPersonId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
group by nspr.nurse_station_person_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRevenueDetails"
|
||||||
|
resultType="com.xinelu.manage.vo.nursestationpersonrevenue.NurseStationPersonRevenueVO">
|
||||||
|
select
|
||||||
|
ao.order_no,
|
||||||
|
ao.id appointmentOrderId,
|
||||||
|
nspr.id nurseStationPersonRevenueId,
|
||||||
|
nspr.revenue_amount,
|
||||||
|
nspr.finish_order_time,
|
||||||
|
aod.nurse_item_name,
|
||||||
|
aod.service_date,
|
||||||
|
aod.service_start_time
|
||||||
|
FROM nurse_station_person_revenue nspr
|
||||||
|
LEFT JOIN appointment_order ao ON ao.id = nspr.appointment_order_id
|
||||||
|
LEFT JOIN appointment_order_details aod ON aod.order_no = ao.order_no
|
||||||
|
<where>
|
||||||
|
<if test="nurseStationPersonId != null ">
|
||||||
|
nspr.nurse_station_person_id = #{nurseStationPersonId}
|
||||||
|
</if>
|
||||||
|
<if test="monthStartDateTime != null">
|
||||||
|
and nspr.finish_order_time >= #{monthStartDateTime}
|
||||||
|
</if>
|
||||||
|
<if test="monthEndDateTime != null">
|
||||||
|
and nspr.finish_order_time <= #{monthEndDateTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY nspr.finish_order_time Desc
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,186 @@
|
|||||||
|
<?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.manage.mapper.patientdiseaseinfo.PatientDiseaseInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="PatientDiseaseInfo" id="PatientDiseaseInfoResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="patientId" column="patient_id"/>
|
||||||
|
<result property="diseaseId" column="disease_id"/>
|
||||||
|
<result property="userId" column="user_id"/>
|
||||||
|
<result property="diseaseName" column="disease_name"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectPatientDiseaseInfoVo">
|
||||||
|
select id,
|
||||||
|
patient_id,
|
||||||
|
disease_id,
|
||||||
|
user_id,
|
||||||
|
disease_name,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time
|
||||||
|
from patient_disease_info
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectPatientDiseaseInfoList" parameterType="PatientDiseaseInfo" resultMap="PatientDiseaseInfoResult">
|
||||||
|
<include refid="selectPatientDiseaseInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="patientId != null ">
|
||||||
|
and patient_id = #{patientId}
|
||||||
|
</if>
|
||||||
|
<if test="diseaseId != null ">
|
||||||
|
and disease_id = #{diseaseId}
|
||||||
|
</if>
|
||||||
|
<if test="userId != null ">
|
||||||
|
and user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="diseaseName != null ">
|
||||||
|
and disease_name = #{diseaseName}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectPatientDiseasePatientId" parameterType="PatientDiseaseInfo" resultMap="PatientDiseaseInfoResult">
|
||||||
|
<include refid="selectPatientDiseaseInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="patientId != null ">
|
||||||
|
and patient_id = #{patientId}
|
||||||
|
</if>
|
||||||
|
<if test="diseaseId != null ">
|
||||||
|
and disease_id = #{diseaseId}
|
||||||
|
</if>
|
||||||
|
<if test="userId != null ">
|
||||||
|
and user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="diseaseName != null ">
|
||||||
|
and disease_name = #{diseaseName}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectPatientDiseaseInfoById" parameterType="Long"
|
||||||
|
resultMap="PatientDiseaseInfoResult">
|
||||||
|
<include refid="selectPatientDiseaseInfoVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertPatientDiseaseInfo" parameterType="PatientDiseaseInfo" useGeneratedKeys="true"
|
||||||
|
keyProperty="id">
|
||||||
|
insert into patient_disease_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="patientId != null">patient_id,
|
||||||
|
</if>
|
||||||
|
<if test="diseaseId != null">disease_id,
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">user_id,
|
||||||
|
</if>
|
||||||
|
<if test="diseaseName != null ">disease_name,
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">create_by,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">update_by,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">update_time,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="patientId != null">#{patientId},
|
||||||
|
</if>
|
||||||
|
<if test="diseaseId != null">#{diseaseId},
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">#{userId},
|
||||||
|
</if>
|
||||||
|
<if test="diseaseName != null ">#{diseaseName},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">#{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updatePatientDiseaseInfo" parameterType="PatientDiseaseInfo">
|
||||||
|
update patient_disease_info
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="patientId != null">patient_id =
|
||||||
|
#{patientId},
|
||||||
|
</if>
|
||||||
|
<if test="diseaseId != null">disease_id =
|
||||||
|
#{diseaseId},
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">user_id =
|
||||||
|
#{userId},
|
||||||
|
</if>
|
||||||
|
<if test="diseaseName != null ">disease_name =
|
||||||
|
#{diseaseName},
|
||||||
|
</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="deletePatientDiseaseInfoById" parameterType="Long">
|
||||||
|
delete
|
||||||
|
from patient_disease_info
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deletePatientDiseaseInfoByIds" parameterType="String">
|
||||||
|
delete from patient_disease_info where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="insertBatchPatientDiseaseInfo">
|
||||||
|
insert into patient_disease_info(
|
||||||
|
patient_id,
|
||||||
|
disease_id,
|
||||||
|
disease_name,
|
||||||
|
create_time
|
||||||
|
) values
|
||||||
|
<foreach item="patientDisease" index="index" collection="list" separator=",">
|
||||||
|
(
|
||||||
|
#{patientDisease.patientId},
|
||||||
|
#{patientDisease.diseaseId},
|
||||||
|
#{patientDisease.diseaseName},
|
||||||
|
#{patientDisease.createTime}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="selectPatientDiseaseInfoByOrderNo"
|
||||||
|
resultType="com.xinelu.manage.domain.patientdiseaseinfo.PatientDiseaseInfo">
|
||||||
|
SELECT ao.patient_id,
|
||||||
|
pdi.disease_name
|
||||||
|
FROM appointment_order ao
|
||||||
|
LEFT JOIN patient_info pi ON ao.patient_id = pi.id
|
||||||
|
LEFT JOIN patient_disease_info pdi ON pdi.patient_id = pi.id
|
||||||
|
WHERE ao.order_no = #{orderNo}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user