Merge branch 'jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支' of http://182.92.166.109:3000/jihan/xinelu-api into jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支
This commit is contained in:
commit
3bcc435d29
@ -234,3 +234,48 @@ trtc:
|
||||
sdksecretkey: 83ab78d1a8513af6626d58cc2bacd7b28bfb2af06515fa02b0204129ebb53422
|
||||
secretid: AKIDOBpP2ICALat0wP4lcIiAMtZ7XgUJ5vMO
|
||||
secretkey: zxjJhGcx75lECyweHgphKYefWCkBPSHt
|
||||
|
||||
# 微信小程序参数配置信息
|
||||
applet-chat-config:
|
||||
# 微信小程序id,wxdec3416aa3d60cab
|
||||
applet-id: wxdc32268eca6b78f9
|
||||
# 微信小程序密钥,f58e19be0380c2ebc6e9e9684c0dacce
|
||||
secret: 0d0e41432908750460aef2bf0aa871ae
|
||||
# 微信小程序返回国家语言
|
||||
lang: zh_CN
|
||||
# 微信小程序授权类型
|
||||
grant-type: authorization_code
|
||||
# 微信小程序事件回调令牌
|
||||
token: uI1NGHesp7ylIYVYQvp0TlcDmUTKCHj2
|
||||
# 微信小程序事件回调消息加密密钥
|
||||
encoding-aes-key: 5rbyhMBpdnxTEVT54zeHMNcXi3ccilQZ209QqGi89EW
|
||||
|
||||
# 护理员微信小程序参数配置信息
|
||||
nurse-applet-chat-config:
|
||||
# 微信小程序id,wxa4f2b43d2ccb9908
|
||||
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
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,9 +2,11 @@ package com.xinelu.applet.controller.nurseapplogin;
|
||||
|
||||
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
||||
import com.xinelu.applet.service.nurseapplogin.NurseAppLoginService;
|
||||
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
||||
import com.xinelu.common.annotation.MobileRequestAuthorization;
|
||||
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.Query;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.regex.RegexUtil;
|
||||
@ -15,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
;
|
||||
@ -65,5 +68,35 @@ 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* App查询预约服务订单
|
||||
*
|
||||
* @param patientId 用户id
|
||||
* @param orderStatus 预约订单状态
|
||||
* @return 结果
|
||||
*/
|
||||
@MobileRequestAuthorization
|
||||
@GetMapping("/appServiceOrder")
|
||||
public TableDataInfo selectAppServiceOrder(Long patientId, String orderStatus) {
|
||||
startPage();
|
||||
List<OrderAndItemVO> appointmentOrderDetails = nurseAppLoginService.selectAppServiceOrderItem(patientId, orderStatus);
|
||||
return getDataTable(appointmentOrderDetails);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,8 @@ package com.xinelu.applet.mapper.nurseapplogin;
|
||||
|
||||
|
||||
import com.xinelu.applet.vo.nurseapplogin.PatientAndDiseaseVO;
|
||||
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
||||
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -21,6 +23,15 @@ public interface NurseAppLoginMapper {
|
||||
*/
|
||||
PatientAndDiseaseVO getPatientDiseaseByPatientId(@Param("patientId") Long patientId);
|
||||
|
||||
/**
|
||||
* 预约查询预约订单明细
|
||||
*
|
||||
* @param patientId 预约订单明细主键
|
||||
* @param orderStatus 预约状态
|
||||
* @return 预约订单明细
|
||||
*/
|
||||
List<OrderAndItemVO> selectAppointmentOrderDetailsByPatientId(@Param("patientId") Long patientId, @Param("orderStatus") String orderStatus);
|
||||
|
||||
/**
|
||||
* 查询信息完善标识符
|
||||
*
|
||||
@ -28,4 +39,12 @@ public interface NurseAppLoginMapper {
|
||||
* @return 数量
|
||||
*/
|
||||
Integer getLoginFlagByPatientId(@Param("patientId") Long patientId);
|
||||
|
||||
/**
|
||||
* 通过用户id查询用户所有订单
|
||||
*
|
||||
* @param patientId id
|
||||
* @return GoodsOrder
|
||||
*/
|
||||
List<GoodsOrder> selectGoodsOrderListByPatient(Long patientId);
|
||||
}
|
||||
|
||||
@ -44,4 +44,12 @@ public interface AppletLoginService {
|
||||
* @return 预约结果
|
||||
*/
|
||||
AjaxResult nurseAppointment(AppointmentInfoDTO dto);
|
||||
|
||||
/**
|
||||
* 根据openid判断当前用户信息是否存在,微信小程序登录页使用
|
||||
*
|
||||
* @param openId 微信用户的openid
|
||||
* @return 护理人列表集合
|
||||
*/
|
||||
AjaxResult existPatientInfo(String openId);
|
||||
}
|
||||
|
||||
@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验预约服务时间
|
||||
*
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package com.xinelu.applet.service.nurseapplogin;
|
||||
|
||||
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
|
||||
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description APP登录注册业务层
|
||||
* @Author zh
|
||||
@ -25,4 +28,21 @@ public interface NurseAppLoginService {
|
||||
* @return 护理项目信息集合
|
||||
*/
|
||||
AjaxResult getAppStationItemAndConsumableInfo(StationItemInfoDTO itemInfoDTO);
|
||||
|
||||
/**
|
||||
* 个人中心
|
||||
*
|
||||
* @param patientId 会员id
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult nurseAppPersonal(Long patientId);
|
||||
|
||||
/**
|
||||
* App查询预约服务订单
|
||||
*
|
||||
* @param patientId 用户id
|
||||
* @param orderStatus 预约订单状态
|
||||
* @return 结果
|
||||
*/
|
||||
List<OrderAndItemVO> selectAppServiceOrderItem(Long patientId, String orderStatus);
|
||||
}
|
||||
|
||||
@ -8,9 +8,13 @@ import com.xinelu.applet.utils.AppointmentTimeUtil;
|
||||
import com.xinelu.applet.vo.appletlogin.NurserStationItemConsumableVO;
|
||||
import com.xinelu.applet.vo.appletlogin.NurserStationItemInfoVO;
|
||||
import com.xinelu.applet.vo.nurseapplogin.PatientAndDiseaseVO;
|
||||
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
|
||||
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;
|
||||
@ -23,10 +27,7 @@ import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -138,4 +139,59 @@ 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* App查询预约服务订单
|
||||
*
|
||||
* @param patientId 用户id
|
||||
* @param orderStatus 预约订单状态
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public List<OrderAndItemVO> selectAppServiceOrderItem(Long patientId, String orderStatus) {
|
||||
List<OrderAndItemVO> appointmentOrderDetails = new ArrayList<>();
|
||||
if (Objects.isNull(patientId) && StringUtils.isBlank(orderStatus)) {
|
||||
return appointmentOrderDetails;
|
||||
}
|
||||
return nurseAppLoginMapper.selectAppointmentOrderDetailsByPatientId(patientId, orderStatus);
|
||||
}
|
||||
}
|
||||
@ -65,6 +65,40 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppointmentOrderDetailsByPatientId"
|
||||
resultType="com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO">
|
||||
SELECT
|
||||
aod.id,
|
||||
aod. nurse_station_item_id stationItemId,
|
||||
aod.nurse_station_item_price_id stationItemPriceId,
|
||||
aod.order_no,
|
||||
aod.order_count,
|
||||
aod.order_status,
|
||||
aod.appointment_status,
|
||||
aod.total_price,
|
||||
aod.nurse_item_name,
|
||||
aod.item_serve_duration_unit,
|
||||
aod.create_time,
|
||||
nsi.item_picture_url,
|
||||
ns.id stationId,
|
||||
ao.order_type
|
||||
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
|
||||
LEFT JOIN nurse_station ns ON ns.id = nsi.nurse_station_id
|
||||
<where>
|
||||
ao.del_flag = 0
|
||||
<if test="patientId != null and patientId != ''">
|
||||
and ao.patient_id = #{patientId}
|
||||
</if>
|
||||
<if test="orderStatus != null and orderStatus != ''">
|
||||
AND ao.order_status = #{orderStatus}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY aod.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getLoginFlagByPatientId" resultType="integer">
|
||||
select login_flag
|
||||
from patient_info
|
||||
@ -75,4 +109,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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user