提交 bd4398c5 authored 作者: zhu's avatar zhu

1.develop

上级 8ea24dfa
...@@ -103,13 +103,13 @@ dependencyManagement { ...@@ -103,13 +103,13 @@ dependencyManagement {
} }
flyway { flyway {
driver = 'com.mysql.cj.jdbc.Driver' // driver = 'com.mysql.cj.jdbc.Driver'
url = 'jdbc:mysql://localhost:3306/aiming-hospital?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&failOverReadOnly=false&useSSL=false' // url = 'jdbc:mysql://localhost:3306/aiming-hospital?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&failOverReadOnly=false&useSSL=false'
user = 'root'
password = '123456'
// url = 'jdbc:mysql://175.24.172.212:3306/hospital-server?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&failOverReadOnly=false&useSSL=false'
// user = 'root' // user = 'root'
// password = 'jgx2vgk0p!15' // password = '123456'
url = 'jdbc:mysql://175.24.172.212:3306/hospital-server?serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&failOverReadOnly=false&useSSL=false'
user = 'root'
password = 'jgx2vgk0p!15'
} }
tasks.named('test') { tasks.named('test') {
......
...@@ -15,6 +15,7 @@ import me.chanjar.weixin.common.error.WxErrorException; ...@@ -15,6 +15,7 @@ import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.error.WxRuntimeException; import me.chanjar.weixin.common.error.WxRuntimeException;
import org.apache.commons.pool2.impl.GenericObjectPoolConfig; import org.apache.commons.pool2.impl.GenericObjectPoolConfig;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -33,6 +34,13 @@ import java.util.stream.Collectors; ...@@ -33,6 +34,13 @@ import java.util.stream.Collectors;
public class WxMaConfiguration { public class WxMaConfiguration {
private final WxMaProperties properties; private final WxMaProperties properties;
@Value("${spring.data.redis.host}")
private String redisHost;
private int redisPort = 6379;;
private int redisTimeo = 2000;
@Value("${spring.data.redis.password}")
private String redisPassword;
@Autowired @Autowired
public WxMaConfiguration(WxMaProperties properties) { public WxMaConfiguration(WxMaProperties properties) {
this.properties = properties; this.properties = properties;
...@@ -49,7 +57,7 @@ public class WxMaConfiguration { ...@@ -49,7 +57,7 @@ public class WxMaConfiguration {
configs.stream() configs.stream()
.map(a -> { .map(a -> {
// WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); // WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
WxMaDefaultConfigImpl config = new WxMaRedisConfigImpl(new JedisPool(new GenericObjectPoolConfig(),"localhost",6379,2000,"123456")); WxMaDefaultConfigImpl config = new WxMaRedisConfigImpl(new JedisPool(new GenericObjectPoolConfig(),redisHost,redisPort,redisTimeo,redisPassword));
// 使用上面的配置时,需要同时引入jedis-lock的依赖,否则会报类无法找到的异常 // 使用上面的配置时,需要同时引入jedis-lock的依赖,否则会报类无法找到的异常
config.setAppid(a.getAppid()); config.setAppid(a.getAppid());
config.setSecret(a.getSecret()); config.setSecret(a.getSecret());
......
...@@ -19,4 +19,8 @@ public class DoctorInfoDto { ...@@ -19,4 +19,8 @@ public class DoctorInfoDto {
private int orderCount; private int orderCount;
private int fansCount; private int fansCount;
private List<DoctorServiceInfo> doctorServiceInfoList; private List<DoctorServiceInfo> doctorServiceInfoList;
//是否关注
private Boolean attentionStatus;
private Long attentionId;
} }
...@@ -8,5 +8,8 @@ import java.util.List; ...@@ -8,5 +8,8 @@ import java.util.List;
@Data @Data
public class PatientMiniAppHomeDto { public class PatientMiniAppHomeDto {
private Long doctorId; private Long doctorId;
private DoctorInfo doctorInfo; private String DoctorName;
private String title;
private String departmentName;
private String avatar;
} }
...@@ -27,7 +27,8 @@ public interface DoctorInfoMapper extends DoctorInfoBaseMapper { ...@@ -27,7 +27,8 @@ public interface DoctorInfoMapper extends DoctorInfoBaseMapper {
List<DoctorDto> queryDoctorList(@Param("sickness")String sickness, List<DoctorDto> queryDoctorList(@Param("sickness")String sickness,
@Param("doctorName")String doctorName, @Param("doctorName")String doctorName,
@Param("departmentId")Long departmentId); @Param("departmentName")String departmentName,
@Param("departmentIdList") List<Long> departmentIdList);
DoctorInfoDto queryDoctorDetail(@Param("doctorId")Long doctorId); DoctorInfoDto queryDoctorDetail(@Param("doctorId")Long doctorId);
......
...@@ -93,11 +93,24 @@ public class DepartmentInfoController extends BaseController<DepartmentInfoServi ...@@ -93,11 +93,24 @@ public class DepartmentInfoController extends BaseController<DepartmentInfoServi
* *
* @param * @param
*/ */
@PostMapping("/queryAllDepartment") @GetMapping("/queryAllDepartment")
@Operation(summary = "查询科室列表") @Operation(summary = "查询科室列表")
public ApiResponse queryAllDepartment(@RequestParam(required = false) YesNoEnum showHidden) { public ApiResponse queryAllDepartment(@RequestParam(value = "showHidden",required = false) YesNoEnum showHidden) {
return ApiResponse.ok(this.service.queryAllDepartment(showHidden)); return ApiResponse.ok(this.service.queryAllDepartment(showHidden));
} }
/**
* 隐藏或展示科室
*
* @param
*/
@PostMapping("/hiddenDepartment")
@Operation(summary = "隐藏或展示科室")
public ApiResponse hiddenDepartment(@RequestParam("showHidden") YesNoEnum showHidden,
@RequestParam("departmentId") Long departmentId) {
return ApiResponse.ok(this.service.hiddenDepartment(showHidden,departmentId));
}
} }
...@@ -112,7 +112,13 @@ public class OrderController extends BaseController<OrderService, Order, OrderPa ...@@ -112,7 +112,13 @@ public class OrderController extends BaseController<OrderService, Order, OrderPa
@Operation(summary = "创建订单") @Operation(summary = "创建订单")
@ApiCommon @ApiCommon
public ApiResponse<Order> createOrder(@RequestBody CreateOrderDto createOrderDto, @AuthUser User user) { public ApiResponse<Order> createOrder(@RequestBody CreateOrderDto createOrderDto, @AuthUser User user) {
return ApiResponse.ok( this.service.createOrder(createOrderDto)); Order order = this.service.createOrder(createOrderDto);
if(null == order){
return ApiResponse.fail(ApiCode.ORDER_CREATE_FAIL);
}else {
return ApiResponse.ok(order);
}
} }
/** /**
......
...@@ -13,7 +13,8 @@ public enum ApiCode { ...@@ -13,7 +13,8 @@ public enum ApiCode {
FAILED(-1, "fail"), FAILED(-1, "fail"),
UNAUTHC(401, "You haven't signed in yet!"), UNAUTHC(401, "You haven't signed in yet!"),
UNAUTHZ(403, "You are not authorized!"), UNAUTHZ(403, "You are not authorized!"),
SERVER_ERROR(500, "server error!"); SERVER_ERROR(500, "server error!"),
ORDER_CREATE_FAIL(700,"订单创建失败");
private int code = 0; private int code = 0;
private String message = "success"; private String message = "success";
......
...@@ -18,4 +18,6 @@ public interface DepartmentInfoService extends BaseService<DepartmentInfo> { ...@@ -18,4 +18,6 @@ public interface DepartmentInfoService extends BaseService<DepartmentInfo> {
List queryAllDepartment(YesNoEnum showHidden); List queryAllDepartment(YesNoEnum showHidden);
boolean hiddenDepartment(YesNoEnum showHidden, Long departmentId);
} }
package com.xwd.hospital.server.service; package com.xwd.hospital.server.service;
import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse;
import com.xwd.hospital.server.enums.PayPathEnum; import com.xwd.hospital.server.enums.PayPathEnum;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
public interface PaymentService { public interface PaymentService {
String startPay(String orderNo, PayPathEnum payPath); PrepayWithRequestPaymentResponse startPay(String orderNo, PayPathEnum payPath);
void payNotify(HttpServletRequest request, HttpServletResponse response); void payNotify(HttpServletRequest request, HttpServletResponse response);
......
...@@ -80,5 +80,26 @@ public class DepartmentInfoServiceImpl extends ServiceImpl<DepartmentInfoMapper, ...@@ -80,5 +80,26 @@ public class DepartmentInfoServiceImpl extends ServiceImpl<DepartmentInfoMapper,
return parentDepartmentList; return parentDepartmentList;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public boolean hiddenDepartment(YesNoEnum showHidden, Long departmentId) {
DepartmentInfo departmentInfo = this.getById(departmentId);
if (null == departmentInfo) {
return false;
}
departmentInfo.setHiddenStatus(showHidden);
this.updateById(departmentInfo);
//如果是一级菜单,同时隐藏或取消下面的二级菜单
if(departmentInfo.getDepartmentLevel() == DepartmentLevelEnum.FIRST_LEVEL){
List<DepartmentInfo> departmentInfoList = this.list(Wrappers.<DepartmentInfo>query()
.eq("parent_id", departmentInfo.getId()));
//从departmentInfoList中取出id生成新的list
for (DepartmentInfo childDepartment : departmentInfoList) {
childDepartment.setHiddenStatus(showHidden);
}
this.updateBatchById(departmentInfoList);
}
return true;
}
} }
...@@ -13,14 +13,14 @@ import java.util.List; ...@@ -13,14 +13,14 @@ import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import com.xwd.hospital.server.domain.ArticleInfo; import cn.dev33.satoken.stp.StpUtil;
import com.xwd.hospital.server.domain.DepartmentInfo; import com.xwd.hospital.server.domain.*;
import com.xwd.hospital.server.domain.DoctorServiceInfo;
import com.xwd.hospital.server.dto.DoctorDto; import com.xwd.hospital.server.dto.DoctorDto;
import com.xwd.hospital.server.dto.DoctorInfoDto; import com.xwd.hospital.server.dto.DoctorInfoDto;
import com.xwd.hospital.server.enums.DepartmentLevelEnum;
import com.xwd.hospital.server.enums.YesNoEnum;
import com.xwd.hospital.server.rest.req.DoctorSearchParam; import com.xwd.hospital.server.rest.req.DoctorSearchParam;
import com.xwd.hospital.server.service.DepartmentInfoService; import com.xwd.hospital.server.service.*;
import com.xwd.hospital.server.service.DoctorServiceInfoService;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import com.baomidou.mybatisplus.core.enums.SqlMethod; import com.baomidou.mybatisplus.core.enums.SqlMethod;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...@@ -29,10 +29,8 @@ import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; ...@@ -29,10 +29,8 @@ import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
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 org.springframework.transaction.annotation.Transactional;
import com.xwd.hospital.server.service.DoctorInfoService;
import com.xwd.hospital.server.repository.DoctorInfoMapper; import com.xwd.hospital.server.repository.DoctorInfoMapper;
import com.xwd.hospital.server.repository.base.DoctorInfoBaseMapper; import com.xwd.hospital.server.repository.base.DoctorInfoBaseMapper;
import com.xwd.hospital.server.domain.DoctorInfo;
import com.xwd.hospital.server.rest.req.DoctorInfoParam; import com.xwd.hospital.server.rest.req.DoctorInfoParam;
@Service @Service
...@@ -41,6 +39,10 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI ...@@ -41,6 +39,10 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI
private DepartmentInfoService departmentInfoService; private DepartmentInfoService departmentInfoService;
@Resource @Resource
private DoctorServiceInfoService doctorServiceInfoService; private DoctorServiceInfoService doctorServiceInfoService;
@Resource
private UserAttentionInfoService userAttentionInfoService;
@Resource
private UserInfoService userInfoService;
@Override @Override
public int updateAllFieldsById(DoctorInfo entity) { public int updateAllFieldsById(DoctorInfo entity) {
...@@ -63,19 +65,53 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI ...@@ -63,19 +65,53 @@ public class DoctorInfoServiceImpl extends ServiceImpl<DoctorInfoMapper, DoctorI
@Override @Override
public List<DoctorDto> queryDoctorList(DoctorSearchParam param) { public List<DoctorDto> queryDoctorList(DoctorSearchParam param) {
if(!StringUtils.isBlank(param.getDepartmentName()) && null == param.getDepartmentId()){ List<Long> departmentIdList = new ArrayList<>();
DepartmentInfo department = departmentInfoService.getOne(Wrappers.<DepartmentInfo>query().eq("department_name", param.getDepartmentName())); if( null != param.getDepartmentId()){
param.setDepartmentId(department.getId()); DepartmentInfo department = departmentInfoService.getById(param.getDepartmentId());
if (null != department && department.getHiddenStatus() == YesNoEnum.NO ){
if (department.getDepartmentLevel() == DepartmentLevelEnum.FIRST_LEVEL) {
//一级菜单id输入查询所以二级菜单列表
List<DepartmentInfo> departmentInfoList = departmentInfoService.list(Wrappers.<DepartmentInfo>query()
.eq("parent_id", param.getDepartmentId())
.eq("hidden_status", YesNoEnum.NO));
//从departmentInfoList中取出id生成新的list
for (DepartmentInfo departmentInfo : departmentInfoList) {
departmentIdList.add(departmentInfo.getId());
}
}else {
departmentIdList.add(param.getDepartmentId());
}
}
}
//param传入一级菜单departmentId,同时此一级菜单下无二级菜单,此时应无医生可查询出
if(departmentIdList.size() == 0){
departmentIdList.add(0L);
} }
return this.getBaseMapper().queryDoctorList(param.getSickness(),param.getDoctorName(),param.getDepartmentId()); return this.getBaseMapper().queryDoctorList(param.getSickness(),param.getDoctorName(),param.getDepartmentName(),departmentIdList);
} }
@Override @Override
public DoctorInfoDto queryDoctorDetail(Long doctorId) { public DoctorInfoDto queryDoctorDetail(Long doctorId) {
//当前用户
Object userId = StpUtil.getExtra("userId");
UserInfo userInfo = userInfoService.getOne(Wrappers.<UserInfo>query().eq("user_id", Long.valueOf(userId.toString())));
if(null == userInfo){
return null;
}
DoctorInfoDto doctorInfoDto = this.getBaseMapper().queryDoctorDetail(doctorId); DoctorInfoDto doctorInfoDto = this.getBaseMapper().queryDoctorDetail(doctorId);
List<DoctorServiceInfo> doctorServiceInfoList = doctorServiceInfoService.list(Wrappers.<DoctorServiceInfo>query().eq("doctor_id", doctorId)); List<DoctorServiceInfo> doctorServiceInfoList = doctorServiceInfoService.list(Wrappers.<DoctorServiceInfo>query().eq("doctor_id", doctorId));
doctorInfoDto.setDoctorServiceInfoList(doctorServiceInfoList); doctorInfoDto.setDoctorServiceInfoList(doctorServiceInfoList);
UserAttentionInfo attentionInfo = userAttentionInfoService.getOne(Wrappers.<UserAttentionInfo>query().eq("doctor_id", doctorId)
.eq("user_info_id", userInfo.getId()));
if(null != attentionInfo){
doctorInfoDto.setAttentionStatus(true);
doctorInfoDto.setAttentionId(attentionInfo.getId());
}else {
doctorInfoDto.setAttentionStatus(false);
}
return doctorInfoDto; return doctorInfoDto;
} }
} }
...@@ -12,6 +12,7 @@ import com.wechat.pay.java.core.notification.NotificationConfig; ...@@ -12,6 +12,7 @@ import com.wechat.pay.java.core.notification.NotificationConfig;
import com.wechat.pay.java.core.notification.NotificationParser; import com.wechat.pay.java.core.notification.NotificationParser;
import com.wechat.pay.java.core.notification.RequestParam; import com.wechat.pay.java.core.notification.RequestParam;
import com.wechat.pay.java.service.payments.jsapi.JsapiService; import com.wechat.pay.java.service.payments.jsapi.JsapiService;
import com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension;
import com.wechat.pay.java.service.payments.jsapi.model.*; import com.wechat.pay.java.service.payments.jsapi.model.*;
import com.wechat.pay.java.service.payments.jsapi.model.Amount; import com.wechat.pay.java.service.payments.jsapi.model.Amount;
import com.wechat.pay.java.service.payments.model.Transaction; import com.wechat.pay.java.service.payments.model.Transaction;
...@@ -56,7 +57,7 @@ import java.util.TimeZone; ...@@ -56,7 +57,7 @@ import java.util.TimeZone;
@Slf4j @Slf4j
public class PaymentServiceImpl implements PaymentService { public class PaymentServiceImpl implements PaymentService {
public static JsapiService payService; public static JsapiServiceExtension payService;
public static RefundService refundService; public static RefundService refundService;
@Resource @Resource
...@@ -93,7 +94,7 @@ public class PaymentServiceImpl implements PaymentService { ...@@ -93,7 +94,7 @@ public class PaymentServiceImpl implements PaymentService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String startPay(String orderNo, PayPathEnum payPath) { public PrepayWithRequestPaymentResponse startPay(String orderNo, PayPathEnum payPath) {
if(payPath.equals(PayPathEnum.WX_PAY)){ if(payPath.equals(PayPathEnum.WX_PAY)){
//微信支付 //微信支付
// 使用自动更新平台证书的RSA配置 // 使用自动更新平台证书的RSA配置
...@@ -108,7 +109,7 @@ public class PaymentServiceImpl implements PaymentService { ...@@ -108,7 +109,7 @@ public class PaymentServiceImpl implements PaymentService {
.build(); .build();
// 初始化服务 // 初始化服务
payService = new JsapiService.Builder().config(config).build(); payService = new JsapiServiceExtension.Builder().config(config).build();
Order order = orderService.getOne(Wrappers.<Order>query().eq("order_no", orderNo)); Order order = orderService.getOne(Wrappers.<Order>query().eq("order_no", orderNo));
if(order.getOrderState() != OrderStateEnum.TO_PAY){ if(order.getOrderState() != OrderStateEnum.TO_PAY){
...@@ -137,9 +138,8 @@ public class PaymentServiceImpl implements PaymentService { ...@@ -137,9 +138,8 @@ public class PaymentServiceImpl implements PaymentService {
// 调用接口 // 调用接口
try { try {
PrepayResponse response = prepay(order, orderPay); PrepayWithRequestPaymentResponse response = prepay(order, orderPay);
log.info("微信支付串"+response.getPrepayId()); return response;
return response.getPrepayId();
} catch (Exception e) { // 发送HTTP请求失败 } catch (Exception e) { // 发送HTTP请求失败
// 调用e.getHttpRequest()获取请求打印日志或上报监控,更多方法见HttpException定义 // 调用e.getHttpRequest()获取请求打印日志或上报监控,更多方法见HttpException定义
log.error(e.getMessage()); log.error(e.getMessage());
...@@ -353,7 +353,7 @@ public class PaymentServiceImpl implements PaymentService { ...@@ -353,7 +353,7 @@ public class PaymentServiceImpl implements PaymentService {
payService.closeOrder(request); payService.closeOrder(request);
} }
/** JSAPI支付下单 */ /** JSAPI支付下单 */
public PrepayResponse prepay(Order order,OrderPay orderPay) { public PrepayWithRequestPaymentResponse prepay(Order order,OrderPay orderPay) {
PrepayRequest request = new PrepayRequest(); PrepayRequest request = new PrepayRequest();
// 调用request.setXxx(val)设置所需参数,具体参数可见Request定义 // 调用request.setXxx(val)设置所需参数,具体参数可见Request定义
...@@ -386,7 +386,8 @@ public class PaymentServiceImpl implements PaymentService { ...@@ -386,7 +386,8 @@ public class PaymentServiceImpl implements PaymentService {
payer.setOpenid(order.getUserInfo().getUser().getOpenId()); payer.setOpenid(order.getUserInfo().getUser().getOpenId());
request.setPayer(payer); request.setPayer(payer);
// 调用接口 // 调用接口
return payService.prepay(request); PrepayWithRequestPaymentResponse response = payService.prepayWithRequestPayment(request);
return response;
} }
/** 微信支付订单号查询订单 */ /** 微信支付订单号查询订单 */
public static Transaction queryOrderById() { public static Transaction queryOrderById() {
......
...@@ -21,20 +21,34 @@ knife4j: ...@@ -21,20 +21,34 @@ knife4j:
wx: wx:
miniapp: miniapp:
configs: configs:
- appid: #微信小程序的appid - appid: wxc447fccb6a2745ce
secret: #微信小程序的Secret secret: af277a664613a2276266eca024bff139
token: #微信小程序消息服务器配置的token token: #微信小程序消息服务器配置的token
aesKey: #微信小程序消息服务器配置的EncodingAESKey aesKey: #微信小程序消息服务器配置的EncodingAESKey
msgDataFormat: JSON msgDataFormat: JSON
- appid: #微信小程序的appid - appid: wxc447fccb6a2745ce
secret: #微信小程序的Secret secret: af277a664613a2276266eca024bff139
token: #微信小程序消息服务器配置的token token: #微信小程序消息服务器配置的token
aesKey: #微信小程序消息服务器配置的EncodingAESKey aesKey: #微信小程序消息服务器配置的EncodingAESKey
msgDataFormat: JSON msgDataFormat: JSON
pay: pay:
wx: wx:
appId: appId: wxc447fccb6a2745ce
merchantId: merchantId: 1535738101
keyPath: keyPath: /home/ubuntu/1535738101_20231012_cert/apiclient_key.pem
merchantSerialNumber: merchantSerialNumber: 52849767F52ACCC2743E0C5439F3EAFA816FA1D7
apiV3Key: apiV3Key: YG1e4n9oBPhuuYZaP7arXy232ejma6FW
payNotifyUrl: http://175.24.172.212:8099/pay/notify
refundNotifyUrl: http://175.24.172.212:8099/pay/refund/notify
tencent:
cloud:
secretId: AKIDZzDD2e4IURBhy2sUrzsXxXu4zf7LL7ex
secretKey: A52lGXaTAev274oMk4CBzay9C6nIbjeM
sms:
sdkAppId: 1400859846
templateId: 1946431
ronglian:
cloud:
account: T00000029722
secret: 88275dd0-6667-11ee-a6e8-a9e02a8e273e
host: https://openapis.7moor.com
...@@ -11,7 +11,7 @@ spring: ...@@ -11,7 +11,7 @@ spring:
application: application:
name: aiming-hospital-server name: aiming-hospital-server
profiles: profiles:
active: dev active: prod
jackson: jackson:
default-property-inclusion: non_null default-property-inclusion: non_null
date-format: yyyy-MM-dd HH:mm:ss date-format: yyyy-MM-dd HH:mm:ss
...@@ -57,7 +57,7 @@ spring: ...@@ -57,7 +57,7 @@ spring:
max-file-size: 50MB max-file-size: 50MB
max-request-size: 100MB max-request-size: 100MB
server: server:
port: ${port:8088} port: ${port:8099}
servlet: servlet:
encoding: encoding:
charset: UTF-8 charset: UTF-8
......
...@@ -66,8 +66,14 @@ ...@@ -66,8 +66,14 @@
<if test="doctorName != null and doctorName != ''"> <if test="doctorName != null and doctorName != ''">
AND di.doctor_name = #{doctorName} AND di.doctor_name = #{doctorName}
</if> </if>
<if test="departmentId != null and departmentId != ''"> <if test="departmentName != null and departmentName != ''">
AND pmq.department_id = #{departmentId} AND pmq.departmentName LIKE CONCAT('%', #{departmentName}, '%')
</if>
<if test="departmentIdList != null and departmentIdList != ''">
AND pmq.department_id in
<foreach collection="departmentIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if> </if>
GROUP BY di.id, di.doctor_name, h.hospital_name, d.department_name, di.expertise_area, di.introduction, pmq.title, u.avatar, s.service_price GROUP BY di.id, di.doctor_name, h.hospital_name, d.department_name, di.expertise_area, di.introduction, pmq.title, u.avatar, s.service_price
</select> </select>
......
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
</resultMap> </resultMap>
<resultMap id="ListResultMap" type="com.xwd.hospital.server.domain.Order" extends="com.xwd.hospital.server.repository.base.OrderBaseMapper.BaseResultMap"> <resultMap id="ListResultMap" type="com.xwd.hospital.server.domain.Order" extends="com.xwd.hospital.server.repository.base.OrderBaseMapper.BaseResultMap">
</resultMap>
<resultMap id="RecommendDoctorResultMap" type="com.xwd.hospital.server.dto.PatientMiniAppHomeDto" extends="com.xwd.hospital.server.repository.base.OrderBaseMapper.RecommendDoctorResultMap">
</resultMap> </resultMap>
<!-- 根据主键查询 --> <!-- 根据主键查询 -->
<select id="selectById" parameterType="java.io.Serializable" resultMap="ResultMap"> <select id="selectById" parameterType="java.io.Serializable" resultMap="ResultMap">
...@@ -63,10 +60,15 @@ ...@@ -63,10 +60,15 @@
</if> </if>
order by create_time desc order by create_time desc
</select> </select>
<select id="selectDoctorListByOrderCount" resultMap="RecommendDoctorResultMap"> <select id="selectDoctorListByOrderCount" resultType="com.xwd.hospital.server.dto.PatientMiniAppHomeDto">
select a.doctorId FROM SELECT di.doctor_name,pmq.title,pdi.department_name,su.avatar,di.id as doctorId
FROM pms_doctor_info di
INNER JOIN pms_medical_qualifications pmq on pmq.doctor_id = di.id
INNER JOIN pms_department_info pdi on pdi.id = pmq.department_id
INNER JOIN sys_user su on su.obj_id = di.id
WHERE di.id = (select a.doctorId FROM
(SELECT count(o.id) orderNum, o.doctor_id doctorId (SELECT count(o.id) orderNum, o.doctor_id doctorId
FROM pms_order o FROM pms_order o
WHERE 1=1 GROUP BY o.doctor_id ORDER BY orderNum desc LIMIT 3) a WHERE 1=1 GROUP BY o.doctor_id ORDER BY orderNum desc LIMIT 3) a)
</select> </select>
</mapper> </mapper>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
select select
ppi.* ppi.*
from pms_patient_prescription_info ppi from pms_patient_prescription_info ppi
inner join pms_prescription_order ppo on ppi..id = ppo..prescription_id inner join pms_prescription_order_record ppo on ppi.id = ppo.prescription_id
where ppo.id = #{orderId} where ppo.order_id = #{orderId}
</select> </select>
</mapper> </mapper>
...@@ -36,23 +36,19 @@ ...@@ -36,23 +36,19 @@
</resultMap> </resultMap>
<resultMap id="ResultMap" type="com.xwd.hospital.server.domain.Order" extends="BaseResultMap"> <resultMap id="ResultMap" type="com.xwd.hospital.server.domain.Order" extends="BaseResultMap">
<result column="patient_self_introduce" jdbcType="VARCHAR" property="patientSelfIntroduce" /> <result column="patient_self_introduce" jdbcType="VARCHAR" property="patientSelfIntroduce" />
<association column="user_info_id" property="userInfo" javaType="com.xwd.hospital.server.domain.PatientPrescriptionInfo" <association column="user_info_id" property="userInfo" javaType="com.xwd.hospital.server.domain.UserInfo"
select="com.xwd.hospital.server.repository.PatientPrescriptionInfoMapper.selectByOrderId" /> select="com.xwd.hospital.server.repository.UserInfoMapper.selectById" />
<!-- <association column="doctor_id" property="doctor" javaType="com.xwd.hospital.server.domain.DoctorInfo"--> <!-- <association column="doctor_id" property="doctor" javaType="com.xwd.hospital.server.domain.DoctorInfo"-->
<!-- select="com.xwd.hospital.server.repository.DoctorInfoMapper.selectById" />--> <!-- select="com.xwd.hospital.server.repository.DoctorInfoMapper.selectById" />-->
<!-- <association column="patient_id" property="patient" javaType="com.xwd.hospital.server.domain.PatientInfo"--> <!-- <association column="patient_id" property="patient" javaType="com.xwd.hospital.server.domain.PatientInfo"-->
<!-- select="com.xwd.hospital.server.repository.PatientInfoMapper.selectById" />--> <!-- select="com.xwd.hospital.server.repository.PatientInfoMapper.selectById" />-->
<!-- <association column="user_coupon_id" property="userCoupon" javaType="com.xwd.hospital.server.domain.UserCouponInfo"--> <!-- <association column="user_coupon_id" property="userCoupon" javaType="com.xwd.hospital.server.domain.UserCouponInfo"-->
<!-- select="com.xwd.hospital.server.repository.UserCouponInfoMapper.selectById" />--> <!-- select="com.xwd.hospital.server.repository.UserCouponInfoMapper.selectById" />-->
<association column="id" property="patientPrescriptionInfo" javaType="com.xwd.hospital.server.domain.UserInfo" <association column="id" property="patientPrescriptionInfo" javaType="com.xwd.hospital.server.domain.PatientPrescriptionInfo"
select="com.xwd.hospital.server.repository.UserInfoMapper.selectById" /> select="com.xwd.hospital.server.repository.PatientPrescriptionInfoMapper.selectByOrderId" />
<collection column="id" property="pictureList" javaType="list" <collection column="id" property="pictureList" javaType="list"
select="com.xwd.hospital.server.repository.OrderPictureMapper.selectByOrderId" /> select="com.xwd.hospital.server.repository.OrderPictureMapper.selectByOrderId" />
</resultMap> </resultMap>
<resultMap id="RecommendDoctorResultMap" type="com.xwd.hospital.server.dto.PatientMiniAppHomeDto">
<association column="doctorId" property="doctorInfo" javaType="com.xwd.hospital.server.domain.DoctorInfo"
select="com.xwd.hospital.server.repository.DoctorInfoMapper.selectById" />
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
`id`, `user_info_id`, `doctor_id`, `patient_id`, `order_no`, `order_state`, `order_type`, `order_price`, `order_discount`, `order_actual_pay`, `user_coupon_id`, `appointment_date`, `service_start_time`, `service_end_time`, `hospital_name`, `department_name`, `doctor_name`, `patient_name`, `patient_sex`, `patient_id_no`, `patient_phone_number`, `patient_born_date`, `cancel_reason`, `pay_time`, `confirm_time`, `complete_time`, `delete_status`, `editor_id`, `editor_name`, `create_time`, `update_time` `id`, `user_info_id`, `doctor_id`, `patient_id`, `order_no`, `order_state`, `order_type`, `order_price`, `order_discount`, `order_actual_pay`, `user_coupon_id`, `appointment_date`, `service_start_time`, `service_end_time`, `hospital_name`, `department_name`, `doctor_name`, `patient_name`, `patient_sex`, `patient_id_no`, `patient_phone_number`, `patient_born_date`, `cancel_reason`, `pay_time`, `confirm_time`, `complete_time`, `delete_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql> </sql>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论