PC订单评价代码移植,小程序完善信息移植
This commit is contained in:
parent
9a50b807b8
commit
f46aba9389
@ -0,0 +1,35 @@
|
|||||||
|
package com.xinelu.common.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 支付渠道枚举
|
||||||
|
* @Author 纪寒
|
||||||
|
* @Date 2022-10-18 15:23:01
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum OrderChannelEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机App
|
||||||
|
*/
|
||||||
|
MOBILE_APP("MOBILE_APP"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信小程序
|
||||||
|
*/
|
||||||
|
WECHAT_APPLET("WECHAT_APPLET"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付宝小程序
|
||||||
|
*/
|
||||||
|
ALI_PAY_APPLE("ALI_PAY_APPLE"),
|
||||||
|
;
|
||||||
|
|
||||||
|
final private String info;
|
||||||
|
|
||||||
|
OrderChannelEnum(String info) {
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package com.xinelu.common.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 会员信息来源枚举
|
||||||
|
* @Author 纪寒
|
||||||
|
* @Date 2023-02-24 14:08:25
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum PatientSourceEnum {
|
||||||
|
/**
|
||||||
|
* 好友邀请
|
||||||
|
*/
|
||||||
|
FRIEND_INVITATION("FRIEND_INVITATION"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自己搜索注册
|
||||||
|
*/
|
||||||
|
REGISTER_YOURSELF("REGISTER_YOURSELF"),
|
||||||
|
;
|
||||||
|
|
||||||
|
final private String info;
|
||||||
|
|
||||||
|
PatientSourceEnum(String info) {
|
||||||
|
this.info = info;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xinelu.applet.controller.nurseapplogin;
|
package com.xinelu.applet.controller.nurseapplogin;
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.appletlogin.AppletUserInfoDTO;
|
||||||
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
||||||
import com.xinelu.applet.service.nurseapplogin.NurseAppLoginService;
|
import com.xinelu.applet.service.nurseapplogin.NurseAppLoginService;
|
||||||
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
||||||
@ -7,14 +8,14 @@ import com.xinelu.common.annotation.MobileRequestAuthorization;
|
|||||||
import com.xinelu.common.core.controller.BaseController;
|
import com.xinelu.common.core.controller.BaseController;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.core.page.TableDataInfo;
|
import com.xinelu.common.core.page.TableDataInfo;
|
||||||
|
import com.xinelu.common.custominterface.Insert;
|
||||||
import com.xinelu.common.custominterface.Query;
|
import com.xinelu.common.custominterface.Query;
|
||||||
import com.xinelu.common.exception.ServiceException;
|
import com.xinelu.common.exception.ServiceException;
|
||||||
import com.xinelu.common.utils.regex.RegexUtil;
|
import com.xinelu.common.utils.regex.RegexUtil;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -36,6 +37,31 @@ public class NurseAppLoginController extends BaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
private NurseAppLoginService nurseAppLoginService;
|
private NurseAppLoginService nurseAppLoginService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完善用户信息-App和微信小程序共用
|
||||||
|
*
|
||||||
|
* @param appletUserInfoDTO 用户信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@MobileRequestAuthorization
|
||||||
|
@PostMapping("/appInformation")
|
||||||
|
public AjaxResult information(@RequestBody @Validated(Insert.class) AppletUserInfoDTO appletUserInfoDTO, BindingResult bindingResult) {
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
throw new ServiceException(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
||||||
|
}
|
||||||
|
if (Objects.isNull(appletUserInfoDTO.getPatientId())) {
|
||||||
|
return AjaxResult.error("当前用户信息不存在,无法完善信息!");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(appletUserInfoDTO.getPhone())) {
|
||||||
|
return AjaxResult.error("请输入手机号!");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(appletUserInfoDTO.getHomeLatitude()) && StringUtils.isBlank(appletUserInfoDTO.getHomeLongitude())) {
|
||||||
|
return AjaxResult.error("请输入位置信息!");
|
||||||
|
}
|
||||||
|
return nurseAppLoginService.appInformation(appletUserInfoDTO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询护理人列表信息(会员小程序和App共用)
|
* 查询护理人列表信息(会员小程序和App共用)
|
||||||
*
|
*
|
||||||
|
|||||||
@ -15,6 +15,30 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface NurseAppLoginMapper {
|
public interface NurseAppLoginMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询被护理人疾病
|
||||||
|
*
|
||||||
|
* @param patientId 被护理人id
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
int selectPatientDiseaseInfo(Long patientId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id删除被护理人疾病
|
||||||
|
*
|
||||||
|
* @param patientId 被护理人id
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
long deletePatientDiseaseInfo(Long patientId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询身份证数量
|
||||||
|
*
|
||||||
|
* @param cardNo 身份证号
|
||||||
|
* @return 数量
|
||||||
|
*/
|
||||||
|
int getCardNoCount(String cardNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人中心查询
|
* 个人中心查询
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xinelu.applet.service.nurseapplogin;
|
package com.xinelu.applet.service.nurseapplogin;
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.appletlogin.AppletUserInfoDTO;
|
||||||
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
||||||
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
@ -13,6 +14,14 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface NurseAppLoginService {
|
public interface NurseAppLoginService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完善用户信息-App和微信小程序共用
|
||||||
|
*
|
||||||
|
* @param appletUserInfoDTO 信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
AjaxResult appInformation(AppletUserInfoDTO appletUserInfoDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询护理人列表信息
|
* 查询护理人列表信息
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
package com.xinelu.applet.service.nurseapplogin.impl;
|
package com.xinelu.applet.service.nurseapplogin.impl;
|
||||||
|
|
||||||
|
import com.xinelu.applet.dto.appletlogin.AppletUserInfoDTO;
|
||||||
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
||||||
import com.xinelu.applet.mapper.appletlogin.AppletLoginMapper;
|
import com.xinelu.applet.mapper.appletlogin.AppletLoginMapper;
|
||||||
import com.xinelu.applet.mapper.nurseapplogin.NurseAppLoginMapper;
|
import com.xinelu.applet.mapper.nurseapplogin.NurseAppLoginMapper;
|
||||||
|
import com.xinelu.applet.mapper.patientcenter.PatientCenterMapper;
|
||||||
|
import com.xinelu.applet.service.messagepush.MessagePushService;
|
||||||
import com.xinelu.applet.service.nurseapplogin.NurseAppLoginService;
|
import com.xinelu.applet.service.nurseapplogin.NurseAppLoginService;
|
||||||
import com.xinelu.applet.utils.AppointmentTimeUtil;
|
import com.xinelu.applet.utils.AppointmentTimeUtil;
|
||||||
import com.xinelu.applet.vo.appletlogin.NurserStationItemConsumableVO;
|
import com.xinelu.applet.vo.appletlogin.NurserStationItemConsumableVO;
|
||||||
@ -10,24 +13,55 @@ import com.xinelu.applet.vo.appletlogin.NurserStationItemInfoVO;
|
|||||||
import com.xinelu.applet.vo.nurseapplogin.PatientAndDiseaseVO;
|
import com.xinelu.applet.vo.nurseapplogin.PatientAndDiseaseVO;
|
||||||
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
||||||
import com.xinelu.applet.vo.specialdisease.WeekDaysVO;
|
import com.xinelu.applet.vo.specialdisease.WeekDaysVO;
|
||||||
|
import com.xinelu.common.config.AppletChatConfig;
|
||||||
|
import com.xinelu.common.config.XinELuConfig;
|
||||||
|
import com.xinelu.common.constant.Constants;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.enums.AppointmentTimeIntervalEnum;
|
import com.xinelu.common.enums.*;
|
||||||
import com.xinelu.common.enums.GooodsOrderStatusEnum;
|
import com.xinelu.common.exception.ServiceException;
|
||||||
import com.xinelu.common.utils.AgeUtil;
|
import com.xinelu.common.utils.AgeUtil;
|
||||||
|
import com.xinelu.common.utils.bean.BeanUtils;
|
||||||
|
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
|
||||||
|
import com.xinelu.common.utils.regex.RegexUtil;
|
||||||
|
import com.xinelu.manage.domain.coupon.Coupon;
|
||||||
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
|
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
|
||||||
|
import com.xinelu.manage.domain.patientcouponreceive.PatientCouponReceive;
|
||||||
|
import com.xinelu.manage.domain.patientdiseaseinfo.PatientDiseaseInfo;
|
||||||
|
import com.xinelu.manage.domain.patientinfo.PatientInfo;
|
||||||
|
import com.xinelu.manage.domain.patientintegralchange.PatientIntegralChange;
|
||||||
|
import com.xinelu.manage.domain.receiveAddressInfo.ReceiveAddressInfo;
|
||||||
|
import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord;
|
||||||
|
import com.xinelu.manage.domain.systemsettingsinfo.SystemSettingsInfo;
|
||||||
|
import com.xinelu.manage.mapper.coupon.CouponMapper;
|
||||||
|
import com.xinelu.manage.mapper.patientcouponreceive.PatientCouponReceiveMapper;
|
||||||
|
import com.xinelu.manage.mapper.patientdiseaseinfo.PatientDiseaseInfoMapper;
|
||||||
|
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
|
||||||
|
import com.xinelu.manage.mapper.patientintegralchange.PatientIntegralChangeMapper;
|
||||||
|
import com.xinelu.manage.mapper.receiveAddressInfo.ReceiveAddressInfoMapper;
|
||||||
|
import com.xinelu.manage.mapper.subscribemessagerecord.SubscribeMessageRecordMapper;
|
||||||
import com.xinelu.manage.mapper.sysarea.SysAreaMapper;
|
import com.xinelu.manage.mapper.sysarea.SysAreaMapper;
|
||||||
|
import com.xinelu.manage.mapper.systemsettingsinfo.SystemSettingsInfoMapper;
|
||||||
|
import com.xinelu.manage.vo.patientcouponreceive.PatientCouponReceiveInfoVO;
|
||||||
|
import com.xinelu.manage.vo.patientinfo.PatientInfoVO;
|
||||||
import com.xinelu.manage.vo.sysarea.SysAreaVO;
|
import com.xinelu.manage.vo.sysarea.SysAreaVO;
|
||||||
import com.xinelu.system.domain.SysConfig;
|
import com.xinelu.system.domain.SysConfig;
|
||||||
import com.xinelu.system.mapper.SysConfigMapper;
|
import com.xinelu.system.mapper.SysConfigMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.compress.utils.Lists;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.io.File;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,13 +76,97 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
|
|||||||
@Resource
|
@Resource
|
||||||
private NurseAppLoginMapper nurseAppLoginMapper;
|
private NurseAppLoginMapper nurseAppLoginMapper;
|
||||||
@Resource
|
@Resource
|
||||||
|
private AppletLoginMapper appletLoginMapper;
|
||||||
|
@Resource
|
||||||
|
private GenerateSystemCodeUtil generateSystemCodeUtil;
|
||||||
|
@Resource
|
||||||
|
private PatientInfoMapper patientInfoMapper;
|
||||||
|
@Resource
|
||||||
|
private PatientDiseaseInfoMapper patientDiseaseInfoMapper;
|
||||||
|
@Resource
|
||||||
|
private ReceiveAddressInfoMapper receiveAddressInfoMapper;
|
||||||
|
@Resource
|
||||||
|
private RegexUtil regexUtil;
|
||||||
|
@Resource
|
||||||
private SysAreaMapper sysAreaMapper;
|
private SysAreaMapper sysAreaMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private AppletLoginMapper appletLoginMapper;
|
private AppointmentTimeUtil appointmentTimeUtil;
|
||||||
@Resource
|
@Resource
|
||||||
private SysConfigMapper sysConfigMapper;
|
private SysConfigMapper sysConfigMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private AppointmentTimeUtil appointmentTimeUtil;
|
private PatientCouponReceiveMapper patientCouponReceiveMapper;
|
||||||
|
@Resource
|
||||||
|
private CouponMapper couponMapper;
|
||||||
|
@Resource
|
||||||
|
private SystemSettingsInfoMapper systemSettingsInfoMapper;
|
||||||
|
@Resource
|
||||||
|
private PatientIntegralChangeMapper patientIntegralChangeMapper;
|
||||||
|
@Resource
|
||||||
|
private PatientCenterMapper patientCenterMapper;
|
||||||
|
@Resource
|
||||||
|
private AppletChatConfig appletChatConfig;
|
||||||
|
@Resource
|
||||||
|
private SubscribeMessageRecordMapper subscribeMessageRecordMapper;
|
||||||
|
@Resource
|
||||||
|
private MessagePushService messagePushService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 完善用户信息-App和微信小程序共用
|
||||||
|
*
|
||||||
|
* @param appletUserInfoDTO 输入参数
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public AjaxResult appInformation(AppletUserInfoDTO appletUserInfoDTO) {
|
||||||
|
//校验手机号
|
||||||
|
boolean regexPhone = regexUtil.regexPhone(StringUtils.isBlank(appletUserInfoDTO.getPhone()) ? "" : appletUserInfoDTO.getPhone());
|
||||||
|
if (BooleanUtils.isFalse(regexPhone)) {
|
||||||
|
return AjaxResult.error("您输入的手机号不正确,请重新输入!");
|
||||||
|
}
|
||||||
|
//校验身份证号
|
||||||
|
boolean cardNo = regexUtil.regexCardNo(StringUtils.isBlank(appletUserInfoDTO.getCardNo()) ? "" : appletUserInfoDTO.getCardNo());
|
||||||
|
if (BooleanUtils.isFalse(cardNo)) {
|
||||||
|
return AjaxResult.error("您输入的身份证号不正确,请重新输入!");
|
||||||
|
}
|
||||||
|
//修改护理人主表信息
|
||||||
|
PatientInfo patient = patientInfoMapper.getPatientInfoById(appletUserInfoDTO.getPatientId());
|
||||||
|
if (Objects.isNull(patient)) {
|
||||||
|
return AjaxResult.error("当前用户信息不存在,请先注册或登录!");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(patient.getPatientCode())) {
|
||||||
|
appletUserInfoDTO.setPatientCode(Constants.PATIENT_PREFIX + generateSystemCodeUtil.generatePatientCode(Constants.PATIENT_PREFIX));
|
||||||
|
}
|
||||||
|
this.updatePatientInfo(appletUserInfoDTO);
|
||||||
|
//新增会员疾病信息
|
||||||
|
this.insertPatientDiseaseInfo(appletUserInfoDTO, appletUserInfoDTO.getPatientId());
|
||||||
|
//新增收货人地址信息
|
||||||
|
this.insertReceiveAddress(appletUserInfoDTO);
|
||||||
|
//判断是否是第一次完善,如果是则发放新人优惠券信息
|
||||||
|
PatientCouponReceiveInfoVO receiveInfoVO = null;
|
||||||
|
if (Objects.isNull(patient.getLoginFlag())) {
|
||||||
|
receiveInfoVO = issueCoupons(patient, appletUserInfoDTO);
|
||||||
|
}
|
||||||
|
//删除原有头像信息
|
||||||
|
if (StringUtils.isNotBlank(appletUserInfoDTO.getHeadPictureUrl()) && StringUtils.isNotBlank(patient.getHeadPictureUrl())
|
||||||
|
&& !patient.getHeadPictureUrl().equals(appletUserInfoDTO.getHeadPictureUrl())) {
|
||||||
|
this.deleteHeadPicture(StringUtils.isBlank(patient.getHeadPictureUrl()) ? "" : patient.getHeadPictureUrl());
|
||||||
|
}
|
||||||
|
if (Objects.isNull(receiveInfoVO) || Objects.isNull(receiveInfoVO.getCouponId())) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
//查询微信小程序订阅消息记录表该会员是否已订阅
|
||||||
|
SubscribeMessageRecord subscribeMessageRecord = subscribeMessageRecordMapper.selectSubscribeMessageRecordByPatientId(null, patient.getOpenid(), appletChatConfig.getCouponReceiveTemplateId());
|
||||||
|
boolean subscribeMessage = Objects.nonNull(subscribeMessageRecord)
|
||||||
|
&& StringUtils.isNotBlank(subscribeMessageRecord.getSubscribeStatus())
|
||||||
|
&& SubscribeStatusEnum.ACCEPT.getInfo().equals(subscribeMessageRecord.getSubscribeStatus());
|
||||||
|
if (BooleanUtils.isTrue(subscribeMessage)) {
|
||||||
|
//完善用户信息领取优惠券异步发送信息
|
||||||
|
messagePushService.messageCouponReceiveThread(subscribeMessageRecord, receiveInfoVO);
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询护理人列表信息
|
* 查询护理人列表信息
|
||||||
@ -194,4 +312,237 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
|
|||||||
}
|
}
|
||||||
return nurseAppLoginMapper.selectAppointmentOrderDetailsByPatientId(patientId, orderStatus);
|
return nurseAppLoginMapper.selectAppointmentOrderDetailsByPatientId(patientId, orderStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改会员信息
|
||||||
|
*
|
||||||
|
* @param appletUserInfoDTO 输入参数
|
||||||
|
*/
|
||||||
|
private void updatePatientInfo(AppletUserInfoDTO appletUserInfoDTO) {
|
||||||
|
PatientInfo patientInfo = new PatientInfo();
|
||||||
|
appletUserInfoDTO.setUpdateTime(LocalDateTime.now());
|
||||||
|
BeanUtils.copyProperties(appletUserInfoDTO, patientInfo);
|
||||||
|
patientInfo.setId(appletUserInfoDTO.getPatientId());
|
||||||
|
patientInfo.setLoginFlag(new AtomicInteger(1).intValue());
|
||||||
|
patientInfo.setUpdateTime(LocalDateTime.now());
|
||||||
|
if (CollectionUtils.isNotEmpty(appletUserInfoDTO.getNurseTypeIdList())) {
|
||||||
|
String serviceIds = appletUserInfoDTO.getNurseTypeIdList().stream().map(String::valueOf).collect(Collectors.joining(","));
|
||||||
|
patientInfo.setServiceIds(serviceIds);
|
||||||
|
}
|
||||||
|
//查询省份证号数量,根据数量判断是否为主账号
|
||||||
|
int cardNoCount = nurseAppLoginMapper.getCardNoCount(appletUserInfoDTO.getCardNo());
|
||||||
|
patientInfo.setPrimaryAccountFlag(cardNoCount == 0 ? 0 : 1);
|
||||||
|
if (StringUtils.isNotBlank(appletUserInfoDTO.getSource())) {
|
||||||
|
patientInfo.setSource(appletUserInfoDTO.getSource());
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(appletUserInfoDTO.getInvitationPatientId())) {
|
||||||
|
patientInfo.setInvitationPatientId(appletUserInfoDTO.getInvitationPatientId());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(appletUserInfoDTO.getSex())) {
|
||||||
|
patientInfo.setSex(appletUserInfoDTO.getSex());
|
||||||
|
}
|
||||||
|
if (Objects.nonNull(appletUserInfoDTO.getBirthDate())) {
|
||||||
|
patientInfo.setBirthDate(appletUserInfoDTO.getBirthDate());
|
||||||
|
}
|
||||||
|
//修改
|
||||||
|
int updatePatientInfoCount = patientInfoMapper.updatePatientInfo(patientInfo);
|
||||||
|
if (updatePatientInfoCount <= 0) {
|
||||||
|
throw new ServiceException("完善信息失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
//判断是否是通过邀请好友方式进行完善的,赠送邀请请人积分以及记录积分变更记录
|
||||||
|
if (StringUtils.isNotBlank(appletUserInfoDTO.getSource()) && PatientSourceEnum.FRIEND_INVITATION.getInfo().equals(appletUserInfoDTO.getSource())) {
|
||||||
|
if (Objects.isNull(appletUserInfoDTO.getInvitationPatientId())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//查询邀请人信息
|
||||||
|
PatientInfoVO invitationPatientInfo = patientInfoMapper.getPatientInfoById(appletUserInfoDTO.getInvitationPatientId());
|
||||||
|
if (Objects.isNull(invitationPatientInfo)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SystemSettingsInfo settingsInfo = systemSettingsInfoMapper.getSystemSettingsInfoByType(SettingsTypeEnum.INVITE_FRIENDS.getInfo());
|
||||||
|
//赠送积分值
|
||||||
|
int changeIntegral = 0;
|
||||||
|
if (Objects.nonNull(settingsInfo) && Objects.nonNull(settingsInfo.getIntegralCount())) {
|
||||||
|
changeIntegral = settingsInfo.getIntegralCount();
|
||||||
|
}
|
||||||
|
patientCenterMapper.updatePatientIntegral(invitationPatientInfo.getId(), changeIntegral);
|
||||||
|
//邀请人账户原始积分值
|
||||||
|
int originalIntegral = Objects.isNull(invitationPatientInfo.getIntegral()) ? 0 : invitationPatientInfo.getIntegral();
|
||||||
|
this.insertPatientIntegral(invitationPatientInfo.getId(), originalIntegral, changeIntegral);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增会员疾病信息
|
||||||
|
*
|
||||||
|
* @param appletUserInfoDTO 输入参数
|
||||||
|
* @param patientId 被护理人Id
|
||||||
|
*/
|
||||||
|
private void insertPatientDiseaseInfo(AppletUserInfoDTO appletUserInfoDTO, Long patientId) {
|
||||||
|
//设置护理人疾病关系表信息
|
||||||
|
if (CollectionUtils.isNotEmpty(appletUserInfoDTO.getDiseaseInfoList())) {
|
||||||
|
//剔除疾病名称重复的信息
|
||||||
|
List<PatientDiseaseInfo> otherDiseaseList = appletUserInfoDTO.getDiseaseInfoList().stream().filter(item -> Objects.isNull(item.getDiseaseId())).collect(Collectors.toList());
|
||||||
|
List<PatientDiseaseInfo> dictDiseaseList = appletUserInfoDTO.getDiseaseInfoList().stream().filter(item -> Objects.nonNull(item.getDiseaseId())).collect(Collectors.toList());
|
||||||
|
List<PatientDiseaseInfo> dataListTwo = otherDiseaseList.stream()
|
||||||
|
.filter(item -> StringUtils.isNotBlank(item.getDiseaseName()))
|
||||||
|
.filter(otherInfo -> !dictDiseaseList.stream().map(PatientDiseaseInfo::getDiseaseName).filter(StringUtils::isNotBlank).collect(Collectors.toList()).contains(otherInfo.getDiseaseName())).collect(Collectors.toList());
|
||||||
|
if (CollectionUtils.isNotEmpty(dataListTwo)) {
|
||||||
|
dictDiseaseList.addAll(dataListTwo);
|
||||||
|
}
|
||||||
|
//根据id查询疾病信息表
|
||||||
|
int diseaseInfoCount = nurseAppLoginMapper.selectPatientDiseaseInfo(patientId);
|
||||||
|
if (diseaseInfoCount > 0) {
|
||||||
|
long deletePatientDiseaseCount = nurseAppLoginMapper.deletePatientDiseaseInfo(patientId);
|
||||||
|
if (deletePatientDiseaseCount <= 0) {
|
||||||
|
log.warn("删除patient_disease_info信息失败,会员id:[{}]", patientId);
|
||||||
|
throw new ServiceException("完善信息失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (PatientDiseaseInfo patientDiseaseInfo : dictDiseaseList) {
|
||||||
|
patientDiseaseInfo.setPatientId(patientId);
|
||||||
|
patientDiseaseInfo.setDiseaseId(Objects.isNull(patientDiseaseInfo.getDiseaseId()) ? null : patientDiseaseInfo.getDiseaseId());
|
||||||
|
patientDiseaseInfo.setDiseaseName(patientDiseaseInfo.getDiseaseName());
|
||||||
|
patientDiseaseInfo.setCreateTime(LocalDateTime.now());
|
||||||
|
}
|
||||||
|
//新增护理人疾病关系表信息
|
||||||
|
int insertBatchCount = patientDiseaseInfoMapper.insertBatchPatientDiseaseInfo(dictDiseaseList);
|
||||||
|
if (insertBatchCount <= 0) {
|
||||||
|
log.info("新增护理人疾病关系表信息失败,输入参数[{}]", appletUserInfoDTO.getDiseaseInfoList());
|
||||||
|
throw new ServiceException("完善信息失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增收货人地址信息
|
||||||
|
*
|
||||||
|
* @param appletUserInfoDTO 输入参数
|
||||||
|
*/
|
||||||
|
private void insertReceiveAddress(AppletUserInfoDTO appletUserInfoDTO) {
|
||||||
|
//判断当前收货地址信息是否存在
|
||||||
|
int receiveCount = receiveAddressInfoMapper.getReceiveAddressInfo(appletUserInfoDTO.getPatientId(), appletUserInfoDTO.getPatientName(), appletUserInfoDTO.getPhone(), appletUserInfoDTO.getAddress());
|
||||||
|
if (receiveCount > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//添加收货人地址信息
|
||||||
|
ReceiveAddressInfo receiveAddressInfo = new ReceiveAddressInfo();
|
||||||
|
receiveAddressInfo.setReceiveAddress(appletUserInfoDTO.getAddress());
|
||||||
|
receiveAddressInfo.setReceivePhone(appletUserInfoDTO.getPhone());
|
||||||
|
receiveAddressInfo.setAreaCode(appletUserInfoDTO.getAreaCode());
|
||||||
|
receiveAddressInfo.setPatientId(appletUserInfoDTO.getPatientId());
|
||||||
|
receiveAddressInfo.setReceiveName(appletUserInfoDTO.getPatientName());
|
||||||
|
int insertReceiveAddressInfo = receiveAddressInfoMapper.insertReceiveAddressInfo(receiveAddressInfo);
|
||||||
|
if (insertReceiveAddressInfo <= 0) {
|
||||||
|
throw new ServiceException("修改收货人地址信息失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发放优惠券方法胡
|
||||||
|
*
|
||||||
|
* @param patient 会员信息
|
||||||
|
*/
|
||||||
|
public PatientCouponReceiveInfoVO issueCoupons(PatientInfo patient, AppletUserInfoDTO appletUserInfoDTO) {
|
||||||
|
PatientCouponReceiveInfoVO receiveInfoVO = new PatientCouponReceiveInfoVO();
|
||||||
|
//查询新人福利的优惠券列表信息
|
||||||
|
Coupon coupon = new Coupon();
|
||||||
|
Long patientId = patient.getId();
|
||||||
|
coupon.setReceiveType(CouponReceiveTypeEnum.NEW_PEOPLE_WELFARE.getInfo());
|
||||||
|
List<Coupon> couponList = couponMapper.selectCouponList(coupon);
|
||||||
|
if (CollectionUtils.isEmpty(couponList)) {
|
||||||
|
return receiveInfoVO;
|
||||||
|
}
|
||||||
|
//组装优惠券信息
|
||||||
|
List<PatientCouponReceive> couponReceiveList = Lists.newArrayList();
|
||||||
|
for (Coupon couponInfo : couponList) {
|
||||||
|
if (Objects.isNull(couponInfo.getId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
PatientCouponReceive couponReceive = new PatientCouponReceive();
|
||||||
|
couponReceive.setPatientId(patientId);
|
||||||
|
couponReceive.setCouponId(couponInfo.getId());
|
||||||
|
couponReceive.setReceiveSource(CouponReceiveTypeEnum.NEW_PEOPLE_WELFARE.getInfo());
|
||||||
|
if (Objects.nonNull(appletUserInfoDTO.getCouponId()) && couponInfo.getId().equals(appletUserInfoDTO.getCouponId())) {
|
||||||
|
couponReceive.setUseStatus(CouponUseStatusEnum.NOT_USED.getInfo());
|
||||||
|
couponReceive.setExpirationStartTime(LocalDateTime.now());
|
||||||
|
couponReceive.setExpirationEndTime(LocalDate.now().plusDays(Objects.isNull(couponInfo.getCouponReductionDays()) ? 0 : couponInfo.getCouponReductionDays()).atTime(23, 59, 59));
|
||||||
|
couponReceive.setReceiveTime(LocalDateTime.now());
|
||||||
|
} else {
|
||||||
|
couponReceive.setUseStatus(CouponUseStatusEnum.WAIT_RECEIVE.getInfo());
|
||||||
|
couponReceive.setExpirationStartTime(null);
|
||||||
|
couponReceive.setExpirationEndTime(null);
|
||||||
|
couponReceive.setReceiveTime(null);
|
||||||
|
}
|
||||||
|
couponReceive.setCouponReductionDays(Objects.isNull(couponInfo.getCouponReductionDays()) ? 0 : couponInfo.getCouponReductionDays());
|
||||||
|
couponReceive.setCreateTime(LocalDateTime.now());
|
||||||
|
couponReceive.setCouponTitle(StringUtils.isBlank(couponInfo.getCouponTitle()) ? "" : couponInfo.getCouponTitle());
|
||||||
|
couponReceive.setCouponPrice(Objects.isNull(couponInfo.getCouponPrice()) ? BigDecimal.ZERO : couponInfo.getCouponPrice());
|
||||||
|
couponReceive.setCouponConsumePrice(Objects.isNull(couponInfo.getCouponConsumePrice()) ? BigDecimal.ZERO : couponInfo.getCouponConsumePrice());
|
||||||
|
couponReceive.setCouponDescription(StringUtils.isBlank(couponInfo.getCouponDescription()) ? "" : couponInfo.getCouponDescription());
|
||||||
|
couponReceiveList.add(couponReceive);
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(couponReceiveList)) {
|
||||||
|
int insertCount = patientCouponReceiveMapper.insertBatchPatientReceive(couponReceiveList);
|
||||||
|
if (insertCount <= 0) {
|
||||||
|
log.error("完善用户信息接口-新人送券执行失败,输入参数[{}]", couponReceiveList);
|
||||||
|
throw new ServiceException("完善用户信息失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//把要发放的优惠券数据塞入发送消息实体中
|
||||||
|
Coupon couponMessagePush = couponList.stream().filter(Objects::nonNull)
|
||||||
|
.filter(couponInfo -> (Objects.nonNull(appletUserInfoDTO.getCouponId()) && couponInfo.getId().equals(appletUserInfoDTO.getCouponId())))
|
||||||
|
.findFirst().orElse(new Coupon());
|
||||||
|
BeanUtils.copyProperties(couponMessagePush, receiveInfoVO);
|
||||||
|
receiveInfoVO.setReceiveTime(LocalDateTime.now());
|
||||||
|
receiveInfoVO.setCouponId(Objects.isNull(couponMessagePush.getId()) ? null : couponMessagePush.getId());
|
||||||
|
receiveInfoVO.setCouponType(CouponTypeEnum.FULL_REDUCTION_COUPON.getInfo());
|
||||||
|
return receiveInfoVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除个人头像图片
|
||||||
|
*
|
||||||
|
* @param pictureUrl 图片路径
|
||||||
|
*/
|
||||||
|
private void deleteHeadPicture(String pictureUrl) {
|
||||||
|
if (StringUtils.isBlank(pictureUrl)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String picture = XinELuConfig.getProfile() + pictureUrl.replaceAll("/profile", "");
|
||||||
|
File checkReportNameFile = new File(picture);
|
||||||
|
if (checkReportNameFile.exists()) {
|
||||||
|
//文件名称已存在,删除文件
|
||||||
|
boolean delete = checkReportNameFile.delete();
|
||||||
|
if (BooleanUtils.isFalse(delete)) {
|
||||||
|
throw new ServiceException("图片文件删除失败!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成积分积分信息
|
||||||
|
*
|
||||||
|
* @param invitationPatientId 邀请人id
|
||||||
|
* @param originalIntegral 原始账户积分
|
||||||
|
* @param changeIntegral 赠送变更积分
|
||||||
|
*/
|
||||||
|
private void insertPatientIntegral(Long invitationPatientId, int originalIntegral, int changeIntegral) {
|
||||||
|
PatientIntegralChange integralChange = new PatientIntegralChange();
|
||||||
|
integralChange.setPatientId(invitationPatientId);
|
||||||
|
integralChange.setOriginalIntegral(originalIntegral);
|
||||||
|
integralChange.setChangeIntegral(changeIntegral);
|
||||||
|
integralChange.setChangeTime(LocalDateTime.now());
|
||||||
|
integralChange.setChangeType(IntegralChangeType.FRIEND_INVITATION.getInfo());
|
||||||
|
integralChange.setChangeRemark("邀请好友赠送积分");
|
||||||
|
integralChange.setChangeIntegralChannel(OrderChannelEnum.WECHAT_APPLET.getInfo());
|
||||||
|
integralChange.setCreateTime(LocalDateTime.now());
|
||||||
|
int insertCount = patientIntegralChangeMapper.insertPatientIntegralChange(integralChange);
|
||||||
|
if (insertCount <= 0) {
|
||||||
|
log.error("邀请好友-生成积分变更记录表信息失败,积分变更信息:{}", integralChange);
|
||||||
|
throw new ServiceException("完善用户信息失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -33,6 +33,35 @@
|
|||||||
<result property="diseaseName" column="disease_name"/>
|
<result property="diseaseName" column="disease_name"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectPatientDiseaseInfo" resultType="int">
|
||||||
|
select
|
||||||
|
count(1)
|
||||||
|
from patient_disease_info
|
||||||
|
<where>
|
||||||
|
<if test="patientId != null">
|
||||||
|
patient_id = #{patientId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deletePatientDiseaseInfo" parameterType="long">
|
||||||
|
delete
|
||||||
|
from patient_disease_info
|
||||||
|
where patient_id = #{patientId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="getCardNoCount" resultType="java.lang.Integer">
|
||||||
|
select
|
||||||
|
count(1)
|
||||||
|
from patient_info
|
||||||
|
<where>
|
||||||
|
del_flag = 0
|
||||||
|
<if test="cardNo != null">
|
||||||
|
and card_no = #{cardNo}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getPatientDiseaseByPatientId" resultMap="PatientAndDiseaseVO">
|
<select id="getPatientDiseaseByPatientId" resultMap="PatientAndDiseaseVO">
|
||||||
SELECT
|
SELECT
|
||||||
pi.id patientId,
|
pi.id patientId,
|
||||||
|
|||||||
@ -0,0 +1,91 @@
|
|||||||
|
package com.xinelu.manage.controller.orderevaluateinfo;
|
||||||
|
|
||||||
|
import com.xinelu.common.annotation.Log;
|
||||||
|
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.enums.BusinessType;
|
||||||
|
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||||
|
import com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo;
|
||||||
|
import com.xinelu.manage.service.orderevaluateinfo.IOrderEvaluateInfoService;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约服务订单和商品订单评价信息Controller
|
||||||
|
*
|
||||||
|
* @author xinyilu
|
||||||
|
* @date 2022-11-17
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/orderEvaluateInfo")
|
||||||
|
public class OrderEvaluateInfoController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private IOrderEvaluateInfoService orderEvaluateInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约服务订单和商品订单评价信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:orderEvaluateInfo:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(OrderEvaluateInfo orderEvaluateInfo) {
|
||||||
|
startPage();
|
||||||
|
List<OrderEvaluateInfo> list = orderEvaluateInfoService.selectOrderEvaluateInfoList(orderEvaluateInfo);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出预约服务订单和商品订单评价信息列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:orderEvaluateInfo:export')")
|
||||||
|
@Log(title = "预约服务订单和商品订单评价信息", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, OrderEvaluateInfo orderEvaluateInfo) {
|
||||||
|
List<OrderEvaluateInfo> list = orderEvaluateInfoService.selectOrderEvaluateInfoList(orderEvaluateInfo);
|
||||||
|
ExcelUtil<OrderEvaluateInfo> util = new ExcelUtil<>(OrderEvaluateInfo.class);
|
||||||
|
util.exportExcel(response, list, "预约服务订单和商品订单评价信息数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取预约服务订单和商品订单评价信息详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:orderEvaluateInfo:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
|
return AjaxResult.success(orderEvaluateInfoService.selectOrderEvaluateInfoById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增预约服务订单和商品订单评价信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:orderEvaluateInfo:add')")
|
||||||
|
@Log(title = "预约服务订单和商品订单评价信息", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("add")
|
||||||
|
public AjaxResult add(@RequestBody OrderEvaluateInfo orderEvaluateInfo) {
|
||||||
|
return toAjax(orderEvaluateInfoService.insertOrderEvaluateInfo(orderEvaluateInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改预约服务订单和商品订单评价信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:orderEvaluateInfo:edit')")
|
||||||
|
@Log(title = "预约服务订单和商品订单评价信息", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("edit")
|
||||||
|
public AjaxResult edit(@RequestBody OrderEvaluateInfo orderEvaluateInfo) {
|
||||||
|
return toAjax(orderEvaluateInfoService.updateOrderEvaluateInfo(orderEvaluateInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除预约服务订单和商品订单评价信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:orderEvaluateInfo:remove')")
|
||||||
|
@Log(title = "预约服务订单和商品订单评价信息", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
|
return toAjax(orderEvaluateInfoService.deleteOrderEvaluateInfoByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.xinelu.manage.mapper.orderevaluatepictureinfo;
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.orderevaluatepictureinfo.OrderEvaluatePictureInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单评价图片信息Mapper接口
|
||||||
|
*
|
||||||
|
* @author xinyilu
|
||||||
|
* @date 2022-11-18
|
||||||
|
*/
|
||||||
|
public interface OrderEvaluatePictureInfoMapper {
|
||||||
|
/**
|
||||||
|
* 查询订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param id 订单评价图片信息主键
|
||||||
|
* @return 订单评价图片信息
|
||||||
|
*/
|
||||||
|
OrderEvaluatePictureInfo selectOrderEvaluatePictureInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单评价图片信息列表
|
||||||
|
*
|
||||||
|
* @param orderEvaluatePictureInfo 订单评价图片信息
|
||||||
|
* @return 订单评价图片信息集合
|
||||||
|
*/
|
||||||
|
List<OrderEvaluatePictureInfo> selectOrderEvaluatePictureInfoList(OrderEvaluatePictureInfo orderEvaluatePictureInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param orderEvaluatePictureInfo 订单评价图片信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertOrderEvaluatePictureInfo(OrderEvaluatePictureInfo orderEvaluatePictureInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param orderEvaluatePictureInfo 订单评价图片信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateOrderEvaluatePictureInfo(OrderEvaluatePictureInfo orderEvaluatePictureInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param id 订单评价图片信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteOrderEvaluatePictureInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteOrderEvaluatePictureInfoByIds(Long[] ids);
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
package com.xinelu.manage.service.orderevaluateinfo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约服务订单和商品订单评价信息Service接口
|
||||||
|
*
|
||||||
|
* @author xinyilu
|
||||||
|
* @date 2022-11-17
|
||||||
|
*/
|
||||||
|
public interface IOrderEvaluateInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约服务订单和商品订单评价信息
|
||||||
|
*
|
||||||
|
* @param id 预约服务订单和商品订单评价信息主键
|
||||||
|
* @return 预约服务订单和商品订单评价信息
|
||||||
|
*/
|
||||||
|
OrderEvaluateInfo selectOrderEvaluateInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约服务订单和商品订单评价信息列表
|
||||||
|
*
|
||||||
|
* @param orderEvaluateInfo 预约服务订单和商品订单评价信息
|
||||||
|
* @return 预约服务订单和商品订单评价信息集合
|
||||||
|
*/
|
||||||
|
List<OrderEvaluateInfo> selectOrderEvaluateInfoList(OrderEvaluateInfo orderEvaluateInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增预约服务订单和商品订单评价信息
|
||||||
|
*
|
||||||
|
* @param orderEvaluateInfo 预约服务订单和商品订单评价信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertOrderEvaluateInfo(OrderEvaluateInfo orderEvaluateInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改预约服务订单和商品订单评价信息
|
||||||
|
*
|
||||||
|
* @param orderEvaluateInfo 预约服务订单和商品订单评价信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateOrderEvaluateInfo(OrderEvaluateInfo orderEvaluateInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除预约服务订单和商品订单评价信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的预约服务订单和商品订单评价信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteOrderEvaluateInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,80 @@
|
|||||||
|
package com.xinelu.manage.service.orderevaluateinfo.impl;
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo;
|
||||||
|
import com.xinelu.manage.mapper.orderevaluateinfo.OrderEvaluateInfoMapper;
|
||||||
|
import com.xinelu.manage.service.orderevaluateinfo.IOrderEvaluateInfoService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约服务订单和商品订单评价信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author xinyilu
|
||||||
|
* @date 2022-11-17
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OrderEvaluateInfoServiceImpl implements IOrderEvaluateInfoService {
|
||||||
|
@Resource
|
||||||
|
private OrderEvaluateInfoMapper orderEvaluateInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约服务订单和商品订单评价信息
|
||||||
|
*
|
||||||
|
* @param id 预约服务订单和商品订单评价信息主键
|
||||||
|
* @return 预约服务订单和商品订单评价信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OrderEvaluateInfo selectOrderEvaluateInfoById(Long id) {
|
||||||
|
return orderEvaluateInfoMapper.selectOrderEvaluateInfoById(id, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询预约服务订单和商品订单评价信息列表
|
||||||
|
*
|
||||||
|
* @param orderEvaluateInfo 预约服务订单和商品订单评价信息
|
||||||
|
* @return 预约服务订单和商品订单评价信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OrderEvaluateInfo> selectOrderEvaluateInfoList(OrderEvaluateInfo orderEvaluateInfo) {
|
||||||
|
return orderEvaluateInfoMapper.selectOrderEvaluateInfoList(orderEvaluateInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增预约服务订单和商品订单评价信息
|
||||||
|
*
|
||||||
|
* @param orderEvaluateInfo 预约服务订单和商品订单评价信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertOrderEvaluateInfo(OrderEvaluateInfo orderEvaluateInfo) {
|
||||||
|
orderEvaluateInfo.setCreateTime(LocalDateTime.now());
|
||||||
|
return orderEvaluateInfoMapper.insertOrderEvaluateInfo(orderEvaluateInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改预约服务订单和商品订单评价信息
|
||||||
|
*
|
||||||
|
* @param orderEvaluateInfo 预约服务订单和商品订单评价信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateOrderEvaluateInfo(OrderEvaluateInfo orderEvaluateInfo) {
|
||||||
|
orderEvaluateInfo.setUpdateTime(LocalDateTime.now());
|
||||||
|
return orderEvaluateInfoMapper.updateOrderEvaluateInfo(orderEvaluateInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除预约服务订单和商品订单评价信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的预约服务订单和商品订单评价信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteOrderEvaluateInfoByIds(Long[] ids) {
|
||||||
|
return orderEvaluateInfoMapper.deleteOrderEvaluateInfoByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package com.xinelu.manage.service.orderevaluatepictureinfo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.orderevaluatepictureinfo.OrderEvaluatePictureInfo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单评价图片信息Service接口
|
||||||
|
*
|
||||||
|
* @author xinyilu
|
||||||
|
* @date 2022-11-18
|
||||||
|
*/
|
||||||
|
public interface IOrderEvaluatePictureInfoService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param id 订单评价图片信息主键
|
||||||
|
* @return 订单评价图片信息
|
||||||
|
*/
|
||||||
|
OrderEvaluatePictureInfo selectOrderEvaluatePictureInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单评价图片信息列表
|
||||||
|
*
|
||||||
|
* @param orderEvaluatePictureInfo 订单评价图片信息
|
||||||
|
* @return 订单评价图片信息集合
|
||||||
|
*/
|
||||||
|
List<OrderEvaluatePictureInfo> selectOrderEvaluatePictureInfoList(OrderEvaluatePictureInfo orderEvaluatePictureInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param orderEvaluatePictureInfo 订单评价图片信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int insertOrderEvaluatePictureInfo(OrderEvaluatePictureInfo orderEvaluatePictureInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param orderEvaluatePictureInfo 订单评价图片信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int updateOrderEvaluatePictureInfo(OrderEvaluatePictureInfo orderEvaluatePictureInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的订单评价图片信息主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
int deleteOrderEvaluatePictureInfoByIds(Long[] ids);
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
package com.xinelu.manage.service.orderevaluatepictureinfo.impl;
|
||||||
|
|
||||||
|
import com.xinelu.manage.domain.orderevaluatepictureinfo.OrderEvaluatePictureInfo;
|
||||||
|
import com.xinelu.manage.mapper.orderevaluatepictureinfo.OrderEvaluatePictureInfoMapper;
|
||||||
|
import com.xinelu.manage.service.orderevaluatepictureinfo.IOrderEvaluatePictureInfoService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单评价图片信息Service业务层处理
|
||||||
|
*
|
||||||
|
* @author xinyilu
|
||||||
|
* @date 2022-11-18
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class OrderEvaluatePictureInfoServiceImpl implements IOrderEvaluatePictureInfoService {
|
||||||
|
@Resource
|
||||||
|
private OrderEvaluatePictureInfoMapper orderEvaluatePictureInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param id 订单评价图片信息主键
|
||||||
|
* @return 订单评价图片信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public OrderEvaluatePictureInfo selectOrderEvaluatePictureInfoById(Long id) {
|
||||||
|
return orderEvaluatePictureInfoMapper.selectOrderEvaluatePictureInfoById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询订单评价图片信息列表
|
||||||
|
*
|
||||||
|
* @param orderEvaluatePictureInfo 订单评价图片信息
|
||||||
|
* @return 订单评价图片信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OrderEvaluatePictureInfo> selectOrderEvaluatePictureInfoList(OrderEvaluatePictureInfo orderEvaluatePictureInfo) {
|
||||||
|
return orderEvaluatePictureInfoMapper.selectOrderEvaluatePictureInfoList(orderEvaluatePictureInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param orderEvaluatePictureInfo 订单评价图片信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertOrderEvaluatePictureInfo(OrderEvaluatePictureInfo orderEvaluatePictureInfo) {
|
||||||
|
orderEvaluatePictureInfo.setCreateTime(LocalDateTime.now());
|
||||||
|
return orderEvaluatePictureInfoMapper.insertOrderEvaluatePictureInfo(orderEvaluatePictureInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param orderEvaluatePictureInfo 订单评价图片信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateOrderEvaluatePictureInfo(OrderEvaluatePictureInfo orderEvaluatePictureInfo) {
|
||||||
|
orderEvaluatePictureInfo.setUpdateTime(LocalDateTime.now());
|
||||||
|
return orderEvaluatePictureInfoMapper.updateOrderEvaluatePictureInfo(orderEvaluatePictureInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除订单评价图片信息
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的订单评价图片信息主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteOrderEvaluatePictureInfoByIds(Long[] ids) {
|
||||||
|
return orderEvaluatePictureInfoMapper.deleteOrderEvaluatePictureInfoByIds(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,111 @@
|
|||||||
|
<?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.orderevaluatepictureinfo.OrderEvaluatePictureInfoMapper">
|
||||||
|
|
||||||
|
<resultMap type="OrderEvaluatePictureInfo" id="OrderEvaluatePictureInfoResult">
|
||||||
|
<result property="id" column="id"/>
|
||||||
|
<result property="orderEvaluateId" column="order_evaluate_id"/>
|
||||||
|
<result property="evaluatePictureUrl" column="evaluate_picture_url"/>
|
||||||
|
<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="selectOrderEvaluatePictureInfoVo">
|
||||||
|
select id, order_evaluate_id, evaluate_picture_url, create_by, create_time, update_by, update_time
|
||||||
|
from order_evaluate_picture_info
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectOrderEvaluatePictureInfoList" parameterType="OrderEvaluatePictureInfo"
|
||||||
|
resultMap="OrderEvaluatePictureInfoResult">
|
||||||
|
<include refid="selectOrderEvaluatePictureInfoVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="orderEvaluateId != null ">
|
||||||
|
and order_evaluate_id = #{orderEvaluateId}
|
||||||
|
</if>
|
||||||
|
<if test="evaluatePictureUrl != null and evaluatePictureUrl != ''">
|
||||||
|
and evaluate_picture_url = #{evaluatePictureUrl}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectOrderEvaluatePictureInfoById" parameterType="Long"
|
||||||
|
resultMap="OrderEvaluatePictureInfoResult">
|
||||||
|
<include refid="selectOrderEvaluatePictureInfoVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertOrderEvaluatePictureInfo" parameterType="OrderEvaluatePictureInfo" useGeneratedKeys="true"
|
||||||
|
keyProperty="id">
|
||||||
|
insert into order_evaluate_picture_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="orderEvaluateId != null">order_evaluate_id,
|
||||||
|
</if>
|
||||||
|
<if test="evaluatePictureUrl != null">evaluate_picture_url,
|
||||||
|
</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="orderEvaluateId != null">#{orderEvaluateId},
|
||||||
|
</if>
|
||||||
|
<if test="evaluatePictureUrl != null">#{evaluatePictureUrl},
|
||||||
|
</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="updateOrderEvaluatePictureInfo" parameterType="OrderEvaluatePictureInfo">
|
||||||
|
update order_evaluate_picture_info
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="orderEvaluateId != null">order_evaluate_id =
|
||||||
|
#{orderEvaluateId},
|
||||||
|
</if>
|
||||||
|
<if test="evaluatePictureUrl != null">evaluate_picture_url =
|
||||||
|
#{evaluatePictureUrl},
|
||||||
|
</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="deleteOrderEvaluatePictureInfoById" parameterType="Long">
|
||||||
|
delete
|
||||||
|
from order_evaluate_picture_info
|
||||||
|
where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteOrderEvaluatePictureInfoByIds" parameterType="String">
|
||||||
|
delete from order_evaluate_picture_info where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user