Merge branch 'jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支' into dev_gy_0920

This commit is contained in:
mengkuiliang 2023-10-09 11:14:18 +08:00
commit 52ba21ab35
10 changed files with 171 additions and 0 deletions

View File

@ -253,3 +253,48 @@ trtc:
sdksecretkey: 83ab78d1a8513af6626d58cc2bacd7b28bfb2af06515fa02b0204129ebb53422
secretid: AKIDOBpP2ICALat0wP4lcIiAMtZ7XgUJ5vMO
secretkey: zxjJhGcx75lECyweHgphKYefWCkBPSHt
# 微信小程序参数配置信息
applet-chat-config:
# 微信小程序idwxdec3416aa3d60cab
applet-id: wxdc32268eca6b78f9
# 微信小程序密钥f58e19be0380c2ebc6e9e9684c0dacce
secret: 0d0e41432908750460aef2bf0aa871ae
# 微信小程序返回国家语言
lang: zh_CN
# 微信小程序授权类型
grant-type: authorization_code
# 微信小程序事件回调令牌
token: uI1NGHesp7ylIYVYQvp0TlcDmUTKCHj2
# 微信小程序事件回调消息加密密钥
encoding-aes-key: 5rbyhMBpdnxTEVT54zeHMNcXi3ccilQZ209QqGi89EW
# 护理员微信小程序参数配置信息
nurse-applet-chat-config:
# 微信小程序idwxa4f2b43d2ccb9908
applet-id: wxa4f2b43d2ccb9908
# 微信小程序密钥,
secret: faeba9fc043cfdcb088f43be1747e054
# 微信小程序返回国家语言
lang: zh_CN
# 微信小程序授权类型
grant-type: authorization_code
# 微信小程序事件回调令牌
token: Yw3vfW1ILpc34qAVDtTpB2hesAMCpvW0
# 微信小程序事件回调消息加密密钥
encoding-aes-key: Lr2uq0F3ds36ZA4AUv1h3Pki0JO1Ql0QeG0z1r4A3at
# 小程序首页路径
applet-page-config:
# 首页跳转路径
page-url: pages/startup/startup
# 个人中心-优惠券页面跳转路径
coupon-page-url: pages/coupon/coupon
# 商品订单页面跳转路径
goods-order-page-url: pages/CommodityOrder/CommodityOrder
# 预约订单页面跳转路径
appoint-order-page-url: pages/Nursingstationserviceorder/Nursingstationserviceorder
# 积分页面跳转路径
integral-page-url: pages/integral/integral
# 护理结构详情页面跳转路径
nursestation-details-page-url: pages/nursestation/nursestation

View File

@ -102,4 +102,18 @@ public class AppletLoginController extends BaseController {
}
return appletLoginService.nurseAppointment(dto);
}
/**
* 根据openid判断当前用户信息是否存在微信小程序登录页使用
*
* @param openId 微信用户的openid
* @return 护理人列表集合 标识LOGIN已登录NOT_LOGIN未登录
*/
@GetMapping("/existPatientInfo")
public AjaxResult existPatientInfo(String openId) {
if (StringUtils.isBlank(openId)) {
return AjaxResult.error("会员用户微信唯一标识不存在!");
}
return appletLoginService.existPatientInfo(openId);
}
}

View File

@ -0,0 +1,4 @@
package com.xinelu.applet.controller.newapp;
public class NewAppLoginController {
}

View File

@ -65,5 +65,20 @@ public class NurseAppLoginController extends BaseController {
}
return nurseAppLoginService.getAppStationItemAndConsumableInfo(itemInfoDTO);
}
/**
* APP个人中心查询
*
* @param patientId 用户编号id
* @return 结果
*/
@MobileRequestAuthorization
@GetMapping("/appPersonal")
public AjaxResult nurseAppPersonal(Long patientId) {
if (Objects.isNull(patientId)) {
return AjaxResult.error("用户信息不能为空!");
}
return nurseAppLoginService.nurseAppPersonal(patientId);
}
}

View File

@ -2,6 +2,7 @@ package com.xinelu.applet.mapper.nurseapplogin;
import com.xinelu.applet.vo.nurseapplogin.PatientAndDiseaseVO;
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -28,4 +29,12 @@ public interface NurseAppLoginMapper {
* @return 数量
*/
Integer getLoginFlagByPatientId(@Param("patientId") Long patientId);
/**
* 通过用户id查询用户所有订单
*
* @param patientId id
* @return GoodsOrder
*/
List<GoodsOrder> selectGoodsOrderListByPatient(Long patientId);
}

View File

@ -44,4 +44,12 @@ public interface AppletLoginService {
* @return 预约结果
*/
AjaxResult nurseAppointment(AppointmentInfoDTO dto);
/**
* 根据openid判断当前用户信息是否存在微信小程序登录页使用
*
* @param openId 微信用户的openid
* @return 护理人列表集合
*/
AjaxResult existPatientInfo(String openId);
}

View File

@ -293,6 +293,21 @@ public class AppletLoginServiceImpl implements AppletLoginService {
return AjaxResult.success(appointmentOrderMapper.getAppointmentOrderByOrderNo(orderNo));
}
/**
* 根据openid判断当前用户信息是否存在微信小程序登录页使用
*
* @param openId 微信用户的openid
* @return 护理人列表集合
*/
@Override
public AjaxResult existPatientInfo(String openId) {
PatientInfo patientInfo = appletLoginMapper.getPatientInfoByOpenId(openId);
if (Objects.nonNull(patientInfo) && StringUtils.isNotBlank(patientInfo.getOpenid())) {
return AjaxResult.success("LOGIN");
}
return AjaxResult.success("NOT_LOGIN");
}
/**
* 校验预约服务时间
*

View File

@ -25,4 +25,12 @@ public interface NurseAppLoginService {
* @return 护理项目信息集合
*/
AjaxResult getAppStationItemAndConsumableInfo(StationItemInfoDTO itemInfoDTO);
/**
* 个人中心
*
* @param patientId 会员id
* @return 结果
*/
AjaxResult nurseAppPersonal(Long patientId);
}

View File

@ -11,6 +11,9 @@ import com.xinelu.applet.vo.nurseapplogin.PatientAndDiseaseVO;
import com.xinelu.applet.vo.specialdisease.WeekDaysVO;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.AppointmentTimeIntervalEnum;
import com.xinelu.common.enums.GooodsOrderStatusEnum;
import com.xinelu.common.utils.AgeUtil;
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
import com.xinelu.manage.mapper.sysarea.SysAreaMapper;
import com.xinelu.manage.vo.sysarea.SysAreaVO;
import com.xinelu.system.domain.SysConfig;
@ -138,4 +141,43 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
itemInfo.setAppointmentTimeList(appointmentTimeList);
return AjaxResult.success(itemInfo);
}
/**
* 个人中心查询
*
* @param patientId 会员id
* @return 结果
*/
@Override
public AjaxResult nurseAppPersonal(Long patientId) {
PatientAndDiseaseVO patientDisease = nurseAppLoginMapper.getPatientDiseaseByPatientId(patientId);
if (Objects.nonNull(patientDisease) && Objects.nonNull(patientDisease.getBirthDate())) {
patientDisease.setAge(AgeUtil.getAgeMonth(String.valueOf(patientDisease.getBirthDate())));
}
if (Objects.nonNull(patientDisease) && StringUtils.isNotBlank(patientDisease.getAreaCode())) {
SysAreaVO codeName = sysAreaMapper.getSubordinateRegionsFindSuperiorRegions(patientDisease.getAreaCode());
String provinceName = StringUtils.isBlank(codeName.getProvinceName()) ? "" : codeName.getProvinceName();
String cityName = StringUtils.isBlank(codeName.getCityName()) ? "" : codeName.getCityName();
String regionName = StringUtils.isBlank(codeName.getRegionName()) ? "" : codeName.getRegionName();
String streetName = StringUtils.isBlank(codeName.getStreetName()) ? "" : codeName.getStreetName();
patientDisease.setAreaName(provinceName + cityName + regionName + streetName);
} else {
patientDisease.setAreaName("");
}
//查询所有商品订单
List<GoodsOrder> goodsOrders = nurseAppLoginMapper.selectGoodsOrderListByPatient(patientId);
if (CollectionUtils.isEmpty(goodsOrders)) {
return AjaxResult.success(patientDisease);
}
//计算待付款订单待收货订单待评价订单已完成订单数量
long waitPayCount = goodsOrders.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getOrderStatus())).filter(item -> GooodsOrderStatusEnum.WAIT_PAY.getInfo().equals(item.getOrderStatus())).count();
long waitReceivedGoodsCount = goodsOrders.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getOrderStatus())).filter(item -> GooodsOrderStatusEnum.WAIT_RECEIVED_GOODS.getInfo().equals(item.getOrderStatus())).count();
long receivedGoodsCount = goodsOrders.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getOrderStatus())).filter(item -> GooodsOrderStatusEnum.RECEIVED_GOODS.getInfo().equals(item.getOrderStatus())).count();
long evaluatedCount = goodsOrders.stream().filter(Objects::nonNull).filter(item -> StringUtils.isNotBlank(item.getOrderStatus())).filter(item -> GooodsOrderStatusEnum.EVALUATED.getInfo().equals(item.getOrderStatus())).count();
patientDisease.setWaitPayCount(waitPayCount);
patientDisease.setWaitReceivedGoodsCount(waitReceivedGoodsCount);
patientDisease.setReceivedGoodsCount(receivedGoodsCount);
patientDisease.setEvaluatedCount(evaluatedCount);
return AjaxResult.success(patientDisease);
}
}

View File

@ -75,4 +75,15 @@
</if>
</where>
</select>
<select id="selectGoodsOrderListByPatient" resultType="com.xinelu.manage.domain.goodsOrder.GoodsOrder">
select id,
order_status
from goods_order
<where>
<if test="patientId != null">
patient_id = #{patientId}
</if>
</where>
</select>
</mapper>