提交 5fb169d8 authored 作者: zhu's avatar zhu

1.增加prod配置文件

2.增加第三方匿名电话部分代码 3.修改mysql 8.0+版本 sql脚本问题
上级 e9910fea
......@@ -67,6 +67,8 @@ dependencies {
implementation 'com.qcloud:cos_api:5.6.173'
implementation 'com.qcloud:cos-sts_api:3.1.1'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.tencentcloudapi:tencentcloud-sdk-java:3.1.874'
annotationProcessor "org.projectlombok:lombok:${lombokPluginVersion}"
......@@ -100,9 +102,12 @@ dependencyManagement {
flyway {
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'
password = '123456'
password = 'jgx2vgk0p!15'
}
tasks.named('test') {
......
......@@ -8,8 +8,10 @@ package com.xwd.hospital.server;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication
@EnableTransactionManagement
public class ServerApplication {
public static void main(String[] args) {
......
......@@ -38,7 +38,9 @@ public class SaTokenConfig implements WebMvcConfigurer {
// 放行用户登录注册相关接口
.excludePathPatterns("/v1/system/user/login")
.excludePathPatterns("/v1/system/user/register")
.excludePathPatterns("/v1/system/home/test")
.excludePathPatterns("/v1/system/user/miniAppLogin")
.excludePathPatterns("/v1/system/user/miniAppRegister")
.excludePathPatterns("/v1/system/sms/sendSms")
// swagger 放行
.excludePathPatterns("/webjars/**")
.excludePathPatterns("/doc.html")
......
......@@ -89,12 +89,6 @@ public class MedicalQualifications extends BaseDomain {
@TableField(value = "audit_state")
@Schema(description = "审核状态", nullable = false)
private AuditStateEnum auditState;
/**
* 医疗资格证件图片
*/
@TableField(value = "certificate_picture")
@Schema(description = "医疗资格证件图片", nullable = false)
private String certificatePicture;
/**
* 操作人Id
*/
......@@ -183,12 +177,6 @@ public class MedicalQualifications extends BaseDomain {
}
return false;
}
if (this.getCertificatePicture() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "医疗资格证件图片不能为空!");
}
return false;
}
if (this.getEditorId() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "操作人Id不能为空!");
......
package com.xwd.hospital.server.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.xwd.hospital.server.domain.PatientInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Data
public class CreatePrescriptionDto {
/**
* 就诊人Id
*/
private Long patientId;
/**
* 医院名称
*/
private String hospitalName;
/**
* 科室名称
*/
private String departmentName;
/**
* 处方时间
*/
private String prescriptionTime;
/**
* 处方说明
*/
private String prescriptionIntroduce;
/**
* 处方图片
*/
private List<String> pictureList;
}
package com.xwd.hospital.server.dto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.xwd.hospital.server.domain.DepartmentInfo;
import com.xwd.hospital.server.domain.DoctorInfo;
import com.xwd.hospital.server.domain.HospitalInfo;
import com.xwd.hospital.server.enums.AuditStateEnum;
import com.xwd.hospital.server.enums.DoctorTitleEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class MedicalQualificationDto {
/**
* 医生Id
*/
@TableField(value = "doctor_id")
@Schema(description = "医生Id", nullable = false)
private Long doctorId;
/**
* 医院Id
*/
@TableField(value = "hospital_id")
@Schema(description = "医院Id", nullable = false)
private Long hospitalId;
/**
* 科室Id
*/
@TableField(value = "department_id")
@Schema(description = "科室Id", nullable = false)
private Long departmentId;
/**
* 职称
*/
@TableField(value = "title")
@Schema(description = "职称", nullable = false)
private DoctorTitleEnum title;
}
......@@ -12,6 +12,7 @@ public class UpdateUserInfoDto {
private String bornDate;
private String idCardPictureFront;
private String idCardPictureBack;
private String headUrl;
private UserTypeEnum userType;
......
......@@ -22,6 +22,7 @@ import com.xwd.hospital.server.annotation.ApiCommon;
import com.xwd.hospital.server.annotation.AuthUser;
import com.xwd.hospital.server.base.BaseController;
import com.xwd.hospital.server.domain.User;
import com.xwd.hospital.server.dto.MedicalQualificationDto;
import com.xwd.hospital.server.rest.res.ApiCode;
import com.xwd.hospital.server.domain.MedicalQualifications;
import com.xwd.hospital.server.rest.req.MedicalQualificationsParam;
......@@ -87,5 +88,17 @@ public class MedicalQualificationsController extends BaseController<MedicalQuali
return ApiResponse.ok(this.service.saveBatch(entityList));
}
/**
* 医生上传资质
*
*/
@PostMapping("/uploadQualification")
@Operation(summary = "医生上传资质")
public ApiResponse uploadQualification(@RequestBody MedicalQualificationDto dto, @AuthUser User user) {
return ApiResponse.ok(this.service.uploadQualification(dto));
}
}
......@@ -21,7 +21,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xwd.hospital.server.annotation.ApiCommon;
import com.xwd.hospital.server.annotation.AuthUser;
import com.xwd.hospital.server.base.BaseController;
import com.xwd.hospital.server.domain.Order;
import com.xwd.hospital.server.domain.User;
import com.xwd.hospital.server.dto.CreateOrderDto;
import com.xwd.hospital.server.dto.CreatePrescriptionDto;
import com.xwd.hospital.server.rest.res.ApiCode;
import com.xwd.hospital.server.domain.PatientPrescriptionInfo;
import com.xwd.hospital.server.rest.req.PatientPrescriptionInfoParam;
......@@ -87,5 +90,16 @@ public class PatientPrescriptionInfoController extends BaseController<PatientPre
return ApiResponse.ok(this.service.saveBatch(entityList));
}
/**
* 新增处方
*
*/
@PostMapping("/create")
@Operation(summary = "新增处方")
@ApiCommon
public ApiResponse<PatientPrescriptionInfo> createOrder(@RequestBody CreatePrescriptionDto createPrescriptionDto, @AuthUser User user) {
return ApiResponse.ok( this.service.create(createPrescriptionDto));
}
}
......@@ -32,4 +32,16 @@ public class SmsController {
public ApiResponse sendSms(@RequestParam("phone") String phone) {
return ApiResponse.ok(smsService.sendSms(phone));
}
/**
* <pre>
* 绑定手机号码
* </pre>
*/
@Operation(summary = "绑定手机号码")
@PostMapping("/bindPhone")
@ApiCommon
public ApiResponse bindPhone(@RequestParam("phone") String phone) {
return ApiResponse.ok(smsService.bindPhone(phone));
}
}
......@@ -161,27 +161,6 @@ public class UserController extends BaseController<UserService, User, UserParam>
return ApiResponse.ok(result);
}
/**
* <pre>
* 用户登陆接口
* </pre>
*/
@Operation(summary = "小程序用户登陆接口")
@PostMapping("/miniAppLogin")
@ApiCommon
public ApiResponse<Map> miniAppLogin(@RequestBody LoginDto loginDto) {
Map<String, Object> result = new HashMap<>();
UserDto userDto = this.service.miniAppLogin(loginDto);
result.put("userDto", userDto);
var loginModel = new SaLoginModel();
loginModel.setExtra("userId", userDto.getUser().getId());
StpUtil.login(userDto.getUser().getUsername(), loginModel);
result.put("token", StpUtil.getTokenValue());
return ApiResponse.ok(result);
}
/**
* <pre>
* 用户登出接口
......@@ -231,6 +210,26 @@ public class UserController extends BaseController<UserService, User, UserParam>
return ApiResponse.ok(this.service.updateUserInfo(updateInfoDto));
}
/**
* <pre>
* 用户登陆接口
* </pre>
*/
@Operation(summary = "小程序用户登陆接口")
@PostMapping("/miniAppLogin")
@ApiCommon
public ApiResponse<Map> miniAppLogin(@RequestBody LoginDto loginDto) {
Map<String, Object> result = new HashMap<>();
UserDto userDto = this.service.miniAppLogin(loginDto);
result.put("userDto", userDto);
var loginModel = new SaLoginModel();
loginModel.setExtra("userId", userDto.getUser().getId());
StpUtil.login(userDto.getUser().getUsername(), loginModel);
result.put("token", StpUtil.getTokenValue());
return ApiResponse.ok(result);
}
/**
* <pre>
......
......@@ -72,11 +72,6 @@ public class MedicalQualificationsParam extends BaseParam<MedicalQualifications>
*/
@Parameter(description = "审核状态 IN值List")
private List<String> auditStateList;
/**
* 医疗资格证件图片
*/
@Parameter(description = "医疗资格证件图片")
private String certificatePicture;
/**
* 操作人Id
*/
......@@ -148,17 +143,6 @@ public class MedicalQualificationsParam extends BaseParam<MedicalQualifications>
wrapper.in(this.getTitleList() != null && this.getTitleList().size() > 0, columnPrefix + "title", this.getTitleList());
wrapper.eq(this.getAuditState() != null, columnPrefix + "audit_state", this.getAuditState());
wrapper.in(this.getAuditStateList() != null && this.getAuditStateList().size() > 0, columnPrefix + "audit_state", this.getAuditStateList());
if (this.getCertificatePicture() != null) {
if (this.getCertificatePicture().startsWith("%") && this.getCertificatePicture().endsWith("%")) {
wrapper.like(columnPrefix + "certificate_picture", this.getCertificatePicture().substring(1, this.getCertificatePicture().length() - 1));
} else if (this.getCertificatePicture().startsWith("%") && !this.getCertificatePicture().endsWith("%")) {
wrapper.likeLeft(columnPrefix + "certificate_picture", this.getCertificatePicture().substring(1));
} else if (this.getCertificatePicture().endsWith("%")) {
wrapper.likeRight(columnPrefix + "certificate_picture", this.getCertificatePicture().substring(0, this.getCertificatePicture().length() - 1));
} else {
wrapper.eq(columnPrefix + "certificate_picture", this.getCertificatePicture());
}
}
wrapper.eq(this.getEditorId() != null, columnPrefix + "editor_id", this.getEditorId());
if (this.getEditorName() != null) {
if (this.getEditorName().startsWith("%") && this.getEditorName().endsWith("%")) {
......
package com.xwd.hospital.server.rest.thirdPartReq;
import lombok.Data;
import retrofit2.http.Body;
@Data
public class BindNumberReq {
private String midNum;
private String called;
private Integer icDisplayFlag = 1;
private Boolean needRecord = true;
private Integer expiration = 0;
}
package com.xwd.hospital.server.service;
import com.google.gson.JsonObject;
import com.xwd.hospital.server.rest.thirdPartReq.BindNumberReq;
import org.springframework.web.bind.annotation.RequestBody;
import retrofit2.Call;
import retrofit2.http.*;
......@@ -7,9 +10,9 @@ import java.util.Map;
public interface CallApiService {
@FormUrlEncoded
@POST("/v20160818/rlxh/midNumBind/{account}")
Call<String> bindNumber(@HeaderMap Map<String, String> headers,@FieldMap Map<String, Object> map,@Path("account") String account);
Call<JsonObject> bindNumber(@HeaderMap Map<String, String> headers, @Body BindNumberReq body, @Path("account") String account, @Query("sig") String sig);
@FormUrlEncoded
@POST("/v20160818/rlxh/midNumUnBinding/{account}")
......
......@@ -10,9 +10,12 @@ package com.xwd.hospital.server.service;
import java.util.List;
import com.xwd.hospital.server.base.BaseService;
import com.xwd.hospital.server.domain.DoctorInfo;
import com.xwd.hospital.server.domain.MedicalQualifications;
import com.xwd.hospital.server.dto.MedicalQualificationDto;
import com.xwd.hospital.server.rest.req.MedicalQualificationsParam;
public interface MedicalQualificationsService extends BaseService<MedicalQualifications> {
DoctorInfo uploadQualification(MedicalQualificationDto dto);
}
......@@ -11,8 +11,10 @@ package com.xwd.hospital.server.service;
import java.util.List;
import com.xwd.hospital.server.base.BaseService;
import com.xwd.hospital.server.domain.PatientPrescriptionInfo;
import com.xwd.hospital.server.dto.CreatePrescriptionDto;
import com.xwd.hospital.server.rest.req.PatientPrescriptionInfoParam;
public interface PatientPrescriptionInfoService extends BaseService<PatientPrescriptionInfo> {
PatientPrescriptionInfo create(CreatePrescriptionDto createPrescriptionDto);
}
......@@ -8,4 +8,6 @@ public interface SmsService {
* @return
*/
String sendSms(String phoneNumber);
String bindPhone(String phoneNumber);
}
......@@ -67,7 +67,7 @@ public interface UserService extends BaseService<User> {
* 更新用户信息
* @return
*/
User updateUserInfo(UpdateUserInfoDto updateInfoDto);
UserDto updateUserInfo(UpdateUserInfoDto updateInfoDto);
/**
* 微信获取手机号码
......
......@@ -13,6 +13,8 @@ import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
import com.xwd.hospital.server.domain.DoctorInfo;
import com.xwd.hospital.server.dto.MedicalQualificationDto;
import jakarta.annotation.Resource;
import com.baomidou.mybatisplus.core.enums.SqlMethod;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -48,5 +50,9 @@ public class MedicalQualificationsServiceImpl extends ServiceImpl<MedicalQualifi
return executeBatch(entityList, batchSize, (sqlSession, entity) -> sqlSession.insert(sqlStatement, entity));
}
@Override
public DoctorInfo uploadQualification(MedicalQualificationDto dto) {
return null;
}
}
......@@ -315,6 +315,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
//todo 根据订单类型,写入相关记录表
//电话订单
if(order.getOrderType() == OrderTypeEnum.TELEPHONE){
PhoneOrderRecord phoneOrderRecord = new PhoneOrderRecord();
phoneOrderRecord.setOrderId(order.getId());
phoneOrderRecord.setOrderNo(orderNo);
phoneOrderRecord.setPatientPhoneNo(order.getPatientPhoneNumber());
}
......
......@@ -13,6 +13,14 @@ import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
import cn.dev33.satoken.stp.StpUtil;
import com.xwd.hospital.server.domain.PatientPrescriptionInfoPicture;
import com.xwd.hospital.server.domain.User;
import com.xwd.hospital.server.domain.UserInfo;
import com.xwd.hospital.server.dto.CreatePrescriptionDto;
import com.xwd.hospital.server.service.PatientPrescriptionInfoPictureService;
import com.xwd.hospital.server.service.UserInfoService;
import com.xwd.hospital.server.service.UserService;
import jakarta.annotation.Resource;
import com.baomidou.mybatisplus.core.enums.SqlMethod;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
......@@ -28,6 +36,12 @@ import com.xwd.hospital.server.rest.req.PatientPrescriptionInfoParam;
@Service
public class PatientPrescriptionInfoServiceImpl extends ServiceImpl<PatientPrescriptionInfoMapper, PatientPrescriptionInfo> implements PatientPrescriptionInfoService {
@Resource
private UserInfoService userInfoService;
@Resource
private UserService userService;
@Resource
private PatientPrescriptionInfoPictureService pictureService;
@Override
public int updateAllFieldsById(PatientPrescriptionInfo entity) {
......@@ -48,5 +62,39 @@ public class PatientPrescriptionInfoServiceImpl extends ServiceImpl<PatientPresc
return executeBatch(entityList, batchSize, (sqlSession, entity) -> sqlSession.insert(sqlStatement, entity));
}
@Override
public PatientPrescriptionInfo create(CreatePrescriptionDto dto) {
Object userId = StpUtil.getExtra("userId");
UserInfo userInfo = userInfoService.getOne(Wrappers.<UserInfo>query().eq("user_id", userId));
if(null == userInfo){
return null;
}
User sysUser = userService.getById(Long.valueOf(userId.toString()));
PatientPrescriptionInfo patientPrescriptionInfo = new PatientPrescriptionInfo();
patientPrescriptionInfo.setPatientId(dto.getPatientId());
patientPrescriptionInfo.setHospitalName(dto.getHospitalName());
patientPrescriptionInfo.setDepartmentName(dto.getDepartmentName());
patientPrescriptionInfo.setPrescriptionTime(dto.getPrescriptionTime());
patientPrescriptionInfo.setPrescriptionIntroduce(dto.getPrescriptionIntroduce());
patientPrescriptionInfo.setEditorId(sysUser.getId());
patientPrescriptionInfo.setEditorName(sysUser.getUsername());
boolean save = this.save(patientPrescriptionInfo);
if(null != dto.getPictureList()
&& dto.getPictureList().size()>0){
ArrayList<PatientPrescriptionInfoPicture> pictureList = new ArrayList<>();
for (String picUrl:dto.getPictureList()) {
PatientPrescriptionInfoPicture infoPicture = new PatientPrescriptionInfoPicture();
infoPicture.setPatientPrescriptionInfoId(patientPrescriptionInfo.getId());
infoPicture.setPrescriptionPicture(picUrl);
infoPicture.setEditorId(sysUser.getId());
infoPicture.setEditorName(sysUser.getUsername());
pictureList.add(infoPicture);
}
pictureService.saveBatch(pictureList);
}
return patientPrescriptionInfo;
}
}
package com.xwd.hospital.server.service.impl;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.sms.v20210111.SmsClient;
import com.tencentcloudapi.sms.v20210111.models.SendSmsRequest;
import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
import com.xwd.hospital.server.constants.Constant;
import com.xwd.hospital.server.rest.thirdPartReq.BindNumberReq;
import com.xwd.hospital.server.service.CallApiService;
import com.xwd.hospital.server.service.RedisService;
import com.xwd.hospital.server.service.SmsService;
import com.xwd.hospital.server.util.CallUtil;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import okhttp3.OkHttpClient;
import okhttp3.RequestBody;
import org.springframework.stereotype.Service;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.TimeUnit;
@Service
@Slf4j
public class SmsServiceImpl implements SmsService {
@Resource
private RedisService redisService;
private static final String secretId = "AKIDZzDD2e4IURBhy2sUrzsXxXu4zf7LL7ex";
private static final String secretKey = "A52lGXaTAev274oMk4CBzay9C6nIbjeM";
private static final String sdkAppId = "1400859846";
private static final String templateId = "1946431";
@Override
public String sendSms(String phoneNumber) {
//随机生成六位数字验证码
Random random = new Random();
// 生成一个100000到999999之间的随机整数
int randomNumber = random.nextInt(900000) + 100000;
//TODO 调用短信sdk发送短信
//调用短信sdk发送短信
// sendAuth(String.valueOf(randomNumber),phoneNumber);
//存入redis中,缓存默认5分钟失效
redisService.setExpire(Constant.SMS_PREFIX+phoneNumber,String.valueOf(randomNumber),5, TimeUnit.MINUTES);
return String.valueOf(randomNumber);
}
public static void sendAuth(String authNumber,String phone) {
try {
Credential cred = new Credential(secretId, secretKey);
// 实例化一个http选项,可选,没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();
httpProfile.setReqMethod("POST");
httpProfile.setConnTimeout(60);
httpProfile.setEndpoint("sms.tencentcloudapi.com");
/* 非必要步骤:
* 实例化一个客户端配置对象,可以指定超时时间等配置 */
ClientProfile clientProfile = new ClientProfile();
/* SDK默认用TC3-HMAC-SHA256进行签名
* 非必要请不要修改这个字段 */
clientProfile.setSignMethod("HmacSHA256");
clientProfile.setHttpProfile(httpProfile);
SmsClient client = new SmsClient(cred, "ap-nanjing",clientProfile);
SendSmsRequest req = new SendSmsRequest();
/* 短信应用ID: 短信SdkAppId在 [短信控制台] 添加应用后生成的实际SdkAppId,示例如1400006666 */
req.setSmsSdkAppId(sdkAppId);
/* 短信签名内容: 使用 UTF-8 编码,必须填写已审核通过的签名 */
// 签名信息可前往 [国内短信](https://console.cloud.tencent.com/smsv2/csms-sign) 或 [国际/港澳台短信](https://console.cloud.tencent.com/smsv2/isms-sign) 的签名管理查看
String signName = "海思临科";
req.setSignName(signName);
/* 模板 ID: 必须填写已审核通过的模板 ID */
req.setTemplateId(templateId);
/* 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,若无模板参数,则设置为空 */
String[] templateParamSet = {authNumber};
req.setTemplateParamSet(templateParamSet);
/* 下发手机号码,采用 E.164 标准,+[国家或地区码][手机号]
* 示例如:+8613711112222, 其中前面有一个+号 ,86为国家码,13711112222为手机号,最多不要超过200个手机号 */
String[] phoneNumberSet = {"+86"+phone};
req.setPhoneNumberSet(phoneNumberSet);
/* 用户的 session 内容(无需要可忽略): 可以携带用户侧 ID 等上下文信息,server 会原样返回 */
// String sessionContext = "";
// req.setSessionContext(sessionContext);
/* 短信码号扩展号(无需要可忽略): 默认未开通,如需开通请联系 [腾讯云短信小助手] */
// String extendCode = "";
// req.setExtendCode(extendCode);
/* 国内短信无需填写该项;国际/港澳台短信已申请独立 SenderId 需要填写该字段,默认使用公共 SenderId,无需填写该字段。注:月度使用量达到指定量级可申请独立 SenderId 使用,详情请联系 [腾讯云短信小助手](https://cloud.tencent.com/document/product/382/3773#.E6.8A.80.E6.9C.AF.E4.BA.A4.E6.B5.81)。*/
// String senderid = "";
// req.setSenderId(senderid);
/* 通过 client 对象调用 SendSms 方法发起请求。注意请求方法名与请求对象是对应的
* 返回的 res 是一个 SendSmsResponse 类的实例,与请求对象对应 */
SendSmsResponse res = client.SendSms(req);
// 输出json格式的字符串回包
log.info(SendSmsResponse.toJsonString(res));
} catch (TencentCloudSDKException e) {
e.printStackTrace();
}
}
@Override
public String bindPhone(String phoneNumber) {
String mappingId = "";
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(CallUtil.host)
.addConverterFactory(GsonConverterFactory.create())
.client(new OkHttpClient.Builder().build())
.build();
CallApiService service = retrofit.create(CallApiService.class);
Map<String, String> sigAndAuth = CallUtil.getSigAndAuth();
HashMap<String, String> headers = new HashMap<>();
headers.put("Authorization",sigAndAuth.get("auth"));
BindNumberReq bindNumberReq = new BindNumberReq();
bindNumberReq.setMidNum("17085298640");//小号
bindNumberReq.setCalled(phoneNumber);//被叫号码
Call<JsonObject> call = service.bindNumber(headers, bindNumberReq, CallUtil.account, sigAndAuth.get("sig"));
try {
Response<JsonObject> execute = call.execute();
mappingId = execute.body().get("mappingId").getAsString();
log.info(execute.body().toString());
} catch (IOException e) {
throw new RuntimeException(e);
}
return mappingId;
}
}
......@@ -22,9 +22,10 @@ import java.util.Map;
@Slf4j
public class CallUtil {
private static final String account = "N000*****91";//替换为您的账户
private static final String secret = "5fdb6********bb88e4b";//替换为您的api密码
private static final String host = "http://apis.7moor.com";
public static final String account = "T00000029722";//替换为您的账户
public static final String secret = "88275dd0-6667-11ee-a6e8-a9e02a8e273e";//替换为您的api密码
public static final String host = "https://openapis.7moor.com";
public static void call() {
String time = getDateTime();
......@@ -90,13 +91,4 @@ public class CallUtil {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
return sdf.format(new Date());
}
public void test(){
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://api.github.com/")
.client(new OkHttpClient.Builder().build())
.build();
CallApiService service = retrofit.create(CallApiService.class);
}
}
spring:
application:
name: aiming-hospital-server-dev
datasource:
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
username: root
password: jgx2vgk0p!15
data:
redis:
host: 175.24.172.212
port: 6379
password: haisi123456
logging:
config: classpath:logback-dev.xml
level:
root: info
sql: debug
web: info
knife4j:
production: false
wx:
miniapp:
configs:
- appid: #微信小程序的appid
secret: #微信小程序的Secret
token: #微信小程序消息服务器配置的token
aesKey: #微信小程序消息服务器配置的EncodingAESKey
msgDataFormat: JSON
- appid: #微信小程序的appid
secret: #微信小程序的Secret
token: #微信小程序消息服务器配置的token
aesKey: #微信小程序消息服务器配置的EncodingAESKey
msgDataFormat: JSON
pay:
wx:
appId:
merchantId:
keyPath:
merchantSerialNumber:
apiV3Key:
......@@ -11,7 +11,7 @@ spring:
application:
name: aiming-hospital-server
profiles:
active: dev
active: prod
jackson:
default-property-inclusion: non_null
date-format: yyyy-MM-dd HH:mm:ss
......
......@@ -6,9 +6,9 @@ create table `pms_doctor_info`
medical_qualification_id int(11) null comment '医生医疗资质Id',
doctor_state varchar(50) not null default 'NORMAL' comment '医生状态 [NORMAL.正常 DISABLED.失效]',
doctor_name varchar(255) not null comment '医生姓名',
sex varchar(50) not null default 'MALE' comment '性别 [MALE.男 FEMALE.女]',
id_no varchar(255) not null comment '身份证号码',
born_date varchar(255) not null comment '出生日期',
sex varchar(50) null default 'MALE' comment '性别 [MALE.男 FEMALE.女]',
id_no varchar(255) null comment '身份证号码',
born_date varchar(255) null comment '出生日期',
phone_number varchar(255) null comment '手机号码',
expertise_area varchar(255) null comment '擅长领域',
introduction varchar(255) null comment '简介',
......@@ -31,7 +31,6 @@ create table `pms_medical_qualifications`
department_id int(11) not null comment '科室Id',
title varchar(50) not null default 'RESIDENT_DOCTOR' comment '职称 [RESIDENT_DOCTOR.住院医师 ATTENDING_DOCTOR.主治医师 ASSOCIATE_DOCTOR.副主任医师 SENIOR_DOCTOR.主任医师]',
audit_state varchar(50) not null default 'TO_AUDIT' comment '审核状态 [TO_AUDIT.待审核 AUDIT_SUCCESS.审核通过 AUDIT_FAIL.审核失败]',
certificate_picture varchar(255) not null comment '医疗资格证件图片',
editor_id int(11) not null default 1 comment '操作人Id',
editor_name varchar(255) not null default 'admin' comment '操作人',
create_time datetime not null default CURRENT_TIMESTAMP comment '创建时间',
......@@ -92,9 +91,9 @@ create table `pms_user_info`
user_id int(11) not null comment '用户Id',
name varchar(255) not null comment '姓名',
sex varchar(50) not null default 'MALE' comment '性别 [MALE.男 FEMALE.女]',
id_no varchar(255) not null comment '身份证号码',
born_date varchar(50) not null comment '出生日期',
phone_number varchar(255) not null comment '手机号码',
id_no varchar(255) null comment '身份证号码',
born_date varchar(50) null comment '出生日期',
phone_number varchar(255) null comment '手机号码',
id_card_picture_front varchar(255) null comment '身份证图片正面',
id_card_picture_back varchar(255) null comment '身份证图片背面',
personal_info_filled varchar(50) not null default 'NO' comment '是否完善好个人信息 [YES.是 NO.否]',
......
......@@ -40,6 +40,7 @@
<!-- 小程序查询医生列表 -->
<select id="queryDoctorList" resultType="com.xwd.hospital.server.dto.DoctorDto">
select
di.id as doctorId,
di.doctor_name,
h.hospital_name,
d.department_name,
......
......@@ -8,7 +8,6 @@
<result column="department_id" jdbcType="BIGINT" property="departmentId" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="audit_state" jdbcType="VARCHAR" property="auditState" />
<result column="certificate_picture" jdbcType="VARCHAR" property="certificatePicture" />
<result column="editor_id" jdbcType="BIGINT" property="editorId" />
<result column="editor_name" jdbcType="VARCHAR" property="editorName" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
......@@ -23,19 +22,19 @@
select="com.xwd.hospital.server.repository.DepartmentInfoMapper.selectById" />
</resultMap>
<sql id="Base_Column_List">
`id`, `doctor_id`, `hospital_id`, `department_id`, `title`, `audit_state`, `certificate_picture`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `doctor_id`, `hospital_id`, `department_id`, `title`, `audit_state`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql id="Base_Column_List_With_Prefix">
t.`id`, t.`doctor_id`, t.`hospital_id`, t.`department_id`, t.`title`, t.`audit_state`, t.`certificate_picture`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
t.`id`, t.`doctor_id`, t.`hospital_id`, t.`department_id`, t.`title`, t.`audit_state`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<insert id="batchInsert">
insert into pms_medical_qualifications (
`doctor_id`, `hospital_id`, `department_id`, `title`, `audit_state`, `certificate_picture`, `editor_id`, `editor_name`
`doctor_id`, `hospital_id`, `department_id`, `title`, `audit_state`, `editor_id`, `editor_name`
)
values
<foreach collection="records" item="record" separator=",">
(
#{record.doctorId, jdbcType=BIGINT}, #{record.hospitalId, jdbcType=BIGINT}, #{record.departmentId, jdbcType=BIGINT}, #{record.title, jdbcType=VARCHAR}, #{record.auditState, jdbcType=VARCHAR}, #{record.certificatePicture, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
#{record.doctorId, jdbcType=BIGINT}, #{record.hospitalId, jdbcType=BIGINT}, #{record.departmentId, jdbcType=BIGINT}, #{record.title, jdbcType=VARCHAR}, #{record.auditState, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
)
</foreach>
</insert>
......@@ -47,7 +46,6 @@
department_id = #{et.departmentId, jdbcType=BIGINT},
title = #{et.title, jdbcType=VARCHAR},
audit_state = #{et.auditState, jdbcType=VARCHAR},
certificate_picture = #{et.certificatePicture, jdbcType=VARCHAR},
editor_id = #{et.editorId, jdbcType=BIGINT},
editor_name = #{et.editorName, jdbcType=VARCHAR},
</trim>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论