提交 864c34de authored 作者: zhu's avatar zhu

1.develop

2.fix bug
上级 24c4086d
......@@ -41,6 +41,9 @@ repositories {
// 本地maven仓库没有则从远程仓库下载jar包,并保存到 环境变量GRADLE_USER_HOME 配置的路径下
// 设置maven仓库阿里镜像地址
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
maven {
url 'https://repository.aspose.com/repo/'
}
// 配置使用Maven的中央仓库
mavenCentral()
}
......@@ -78,6 +81,29 @@ dependencies {
// 二维码绘图相关
implementation 'com.google.zxing:core:3.3.3'
implementation 'com.google.zxing:javase:3.3.3'
// implementation 'com.dclunie:pixelmed:20211114'
// //DICOM
// implementation 'org.dcm4che:dcm4che-core:5.27.0'
// implementation 'org.dcm4che:dcm4che-imageio:5.27.0'
// implementation 'com.github.jai-imageio:jai-imageio-jpeg2000:1.3.0'
implementation 'com.aspose:aspose-imaging:23.9:jdk16'
......
......@@ -23,9 +23,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.xwd.hospital.server.base.BaseDomain;
import com.xwd.hospital.server.enums.CouponTypeEnum;
import com.xwd.hospital.server.domain.CouponInfo;
import com.xwd.hospital.server.domain.UserCouponInfo;
import com.xwd.hospital.server.domain.User;
import com.xwd.hospital.server.domain.UserInfo;
import com.xwd.hospital.server.domain.Career;
@Data
@Builder(builderMethodName = "newBuilder")
......@@ -53,18 +52,6 @@ public class CouponSendRecord extends BaseDomain {
@Schema(description = "优惠券Id")
@TableField(exist = false)
private CouponInfo coupon;
/**
* 用户优惠券关系id
*/
@TableField(value = "user_coupon_id")
@Schema(description = "用户优惠券关系id", nullable = false)
private Long userCouponId;
/**
* 用户优惠券关系id
*/
@Schema(description = "用户优惠券关系id")
@TableField(exist = false)
private UserCouponInfo userCoupon;
/**
* 优惠券名称
*/
......@@ -96,17 +83,23 @@ public class CouponSendRecord extends BaseDomain {
@TableField(exist = false)
private User send;
/**
* 接收人员id
* 发放原因
*/
@TableField(value = "send_reason")
@Schema(description = "发放原因")
private String sendReason;
/**
* 职业Id
*/
@TableField(value = "user_info_id")
@Schema(description = "接收人员id", nullable = false)
private Long userInfoId;
@TableField(value = "career_id")
@Schema(description = "职业Id")
private Long careerId;
/**
* 接收人员id
* 职业Id
*/
@Schema(description = "接收人员id")
@Schema(description = "职业Id")
@TableField(exist = false)
private UserInfo userInfo;
private Career career;
/**
* 操作人Id
*/
......@@ -168,12 +161,6 @@ public class CouponSendRecord extends BaseDomain {
}
return false;
}
if (this.getUserCouponId() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "用户优惠券关系id不能为空!");
}
return false;
}
if (this.getCouponName() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "优惠券名称不能为空!");
......@@ -198,12 +185,6 @@ public class CouponSendRecord extends BaseDomain {
}
return false;
}
if (this.getUserInfoId() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "接收人员id不能为空!");
}
return false;
}
if (this.getEditorId() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "操作人Id不能为空!");
......
......@@ -62,6 +62,12 @@ public class DepartmentInfo extends BaseDomain {
@TableField(value = "parent_id")
@Schema(description = "上级科室id")
private Long parentId;
/**
* 排序
*/
@TableField(value = "order_extra")
@Schema(description = "排序")
private Long orderExtra;
/**
* 是否隐藏
*/
......
......@@ -87,6 +87,18 @@ public class DoctorFamilyAddressInfo extends BaseDomain {
@TableField(value = "detail_address")
@Schema(description = "详细地址", nullable = false)
private String detailAddress;
/**
* 经度
*/
@TableField(value = "lng")
@Schema(description = "经度")
private String lng;
/**
* 纬度
*/
@TableField(value = "lat")
@Schema(description = "纬度")
private String lat;
/**
* 审核状态
*/
......
......@@ -81,19 +81,19 @@ public class DoctorInfo extends BaseDomain {
* 性别
*/
@TableField(value = "sex")
@Schema(description = "性别", nullable = false)
@Schema(description = "性别")
private SexTypeEnum sex;
/**
* 身份证号码
*/
@TableField(value = "id_no")
@Schema(description = "身份证号码", nullable = false)
@Schema(description = "身份证号码")
private String idNo;
/**
* 出生日期
*/
@TableField(value = "born_date")
@Schema(description = "出生日期", nullable = false)
@Schema(description = "出生日期")
private String bornDate;
/**
* 手机号码
......@@ -113,6 +113,12 @@ public class DoctorInfo extends BaseDomain {
@TableField(value = "introduction", select = false)
@Schema(description = "简介")
private String introduction;
/**
* 最大时间段服务人数限制
*/
@TableField(value = "max_order_count")
@Schema(description = "最大时间段服务人数限制", nullable = false)
private Integer maxOrderCount;
/**
* 身份证图片正面
*/
......@@ -169,6 +175,9 @@ public class DoctorInfo extends BaseDomain {
if (this.getSex() == null) {
this.setSex(SexTypeEnum.MALE);
}
if (this.getMaxOrderCount() == null) {
this.setMaxOrderCount(10);
}
if (this.getDeleteStatus() == null) {
this.setDeleteStatus(YesNoEnum.NO);
}
......@@ -210,21 +219,9 @@ public class DoctorInfo extends BaseDomain {
}
return false;
}
if (this.getSex() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "性别不能为空!");
}
return false;
}
if (this.getIdNo() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "身份证号码不能为空!");
}
return false;
}
if (this.getBornDate() == null) {
if (this.getMaxOrderCount() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "出生日期不能为空!");
throw new ApiCode.ApiException(-1, "最大时间段服务人数限制不能为空!");
}
return false;
}
......
/**
* 项目:互联网医疗
* 模型分组:服务管理
* 模型名称:医生工作时间配置表
* @Author: xiongwei
* @Date: 2023-09-05 09:42:00
*/
package com.xwd.hospital.server.domain;
import java.io.Serializable;
import com.xwd.hospital.server.rest.res.ApiCode;
import lombok.*;
import java.util.List;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.xwd.hospital.server.base.BaseDomain;
import com.xwd.hospital.server.enums.YesNoEnum;
@Data
@Builder(builderMethodName = "newBuilder")
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@TableName("`pms_doctor_time_config`")
@Schema(name = "DoctorTimeConfig", description = "医生工作时间配置表")
public class DoctorTimeConfig extends BaseDomain {
/**
* Id
*/
@TableId(value = "id", type = IdType.AUTO)
@Schema(description = "Id", nullable = false)
private Long id;
/**
* 医生Id
*/
@TableField(value = "doctor_id")
@Schema(description = "医生Id", nullable = false)
private Long doctorId;
/**
* 工作时间段
*/
@TableField(value = "work_time")
@Schema(description = "工作时间段", nullable = false)
private String workTime;
/**
* 工作状态
*/
@TableField(value = "work_status")
@Schema(description = "工作状态", nullable = false)
private YesNoEnum workStatus;
/**
* 操作人Id
*/
@TableField(value = "editor_id")
@Schema(description = "操作人Id", nullable = false)
private Long editorId;
/**
* 操作人
*/
@TableField(value = "editor_name")
@Schema(description = "操作人", nullable = false)
private String editorName;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间", nullable = false)
private java.util.Date createTime;
/**
* 更新时间
*/
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新时间", nullable = false)
private java.util.Date updateTime;
/**
* 设置默认值
*/
@Override
public DoctorTimeConfig setDefault() {
if (this.getWorkStatus() == null) {
this.setWorkStatus(YesNoEnum.NO);
}
if (this.getEditorId() == null) {
this.setEditorId(1L);
}
if (this.getEditorName() == null) {
this.setEditorName("admin");
}
if (this.getCreateTime() == null) {
this.setCreateTime(new java.util.Date());
}
if (this.getUpdateTime() == null) {
this.setUpdateTime(new java.util.Date());
}
return this;
}
/**
* 数据验证
*/
@Override
public boolean validate(boolean throwException) {
if (this.getDoctorId() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "医生Id不能为空!");
}
return false;
}
if (this.getWorkTime() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "工作时间段不能为空!");
}
return false;
}
if (this.getWorkStatus() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "工作状态不能为空!");
}
return false;
}
if (this.getEditorId() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "操作人Id不能为空!");
}
return false;
}
if (this.getEditorName() == null) {
if (throwException) {
throw new ApiCode.ApiException(-1, "操作人不能为空!");
}
return false;
}
return true;
}
/**
* 数据验证
*/
@Override
public boolean validate() {
return this.validate(false);
}
}
......@@ -102,6 +102,12 @@ public class UserCouponInfo extends BaseDomain {
@TableField(value = "coupon_use_state")
@Schema(description = "优惠券可用状态", nullable = false)
private CouponUseStateEnum couponUseState;
/**
* 优惠券发放记录Id
*/
@TableField(value = "coupon_send_id")
@Schema(description = "优惠券发放记录Id")
private Long couponSendId;
/**
* 操作人Id
*/
......
......@@ -8,6 +8,6 @@ import java.util.List;
public class ConsumerCouponInfoDto {
private List<Long> consumerList;
private Long couponId;
private String sendReason;
private Boolean isAll;
}
......@@ -6,4 +6,5 @@ import lombok.Data;
public class CouponInfoSendDto {
private Long couponInfoId;
private Long careerId;
private String sendReason;
}
......@@ -11,5 +11,6 @@ public class DepartmentDto {
private String departmentName;
private String departmentIntroduce;
private Long parentId;
private Long orderExtra;
private List<DepartmentDto> childList;
}
package com.xwd.hospital.server.dto;
import lombok.Data;
@Data
public class PictureDto {
private String imageUrl;
private String sourceFileUrl;
}
......@@ -13,12 +13,16 @@ public class UpdateUserInfoDto {
private String idCardPictureFront;
private String idCardPictureBack;
private String headUrl;
private Long careerId;
private String careerName;
private UserTypeEnum userType;
private String expertiseArea;
private String introduction;
private Integer maxOrderCount;
private Boolean defaultFlag = false;
}
......@@ -11,7 +11,9 @@ package com.xwd.hospital.server.enums;
*/
public enum SysSettingEnum {
PROXY_PHONE("匿名小号");
PROXY_PHONE("匿名小号"),
INVITED_COUPON_ID("邀请注册送优惠券-被邀请者"),
INVITE_COUPON_ID("邀请注册送优惠券-邀请者");
SysSettingEnum(String name) {
this.name = name;
......
......@@ -23,5 +23,5 @@ import com.xwd.hospital.server.repository.base.DoctorFamilyAddressInfoBaseMapper
@Repository
public interface DoctorFamilyAddressInfoMapper extends DoctorFamilyAddressInfoBaseMapper {
List<DoctorFamilyAddressInfo> queryNearbyDoctorList(@Param("lat") String lat,@Param("lng") String lng);
}
/**
* 项目:互联网医疗
* 模型分组:服务管理
* 模型名称:医生工作时间配置表
* @Author: xiongwei
* @Date: 2023-09-05 09:42:00
*/
package com.xwd.hospital.server.repository;
import java.io.Serializable;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Param;
import com.xwd.hospital.server.domain.DoctorTimeConfig;
import com.xwd.hospital.server.repository.base.DoctorTimeConfigBaseMapper;
@Repository
public interface DoctorTimeConfigMapper extends DoctorTimeConfigBaseMapper {
}
/**
* 项目:互联网医疗
* 模型分组:服务管理
* 模型名称:医生工作时间配置表
* @Author: xiongwei
* @Date: 2023-09-05 09:42:00
*/
package com.xwd.hospital.server.repository.base;
import java.io.Serializable;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.springframework.stereotype.Repository;
import org.apache.ibatis.annotations.Param;
import com.xwd.hospital.server.domain.DoctorTimeConfig;
@Repository
public interface DoctorTimeConfigBaseMapper extends BaseMapper<DoctorTimeConfig> {
/**
* 根据 ID 更新所有字段
*
* @param entity 实体对象
*/
int updateAllFieldsById(@Param(Constants.ENTITY) DoctorTimeConfig entity);
/**
* 批量插入
*
* @param records 实体对象列表
*/
int batchInsert(@Param("records") List<DoctorTimeConfig> records);
}
......@@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.gson.JsonObject;
import com.xwd.hospital.server.annotation.ApiCommon;
import com.xwd.hospital.server.annotation.AuthUser;
import com.xwd.hospital.server.base.BaseController;
......@@ -27,15 +28,24 @@ import com.xwd.hospital.server.rest.res.ApiCode;
import com.xwd.hospital.server.domain.DoctorFamilyAddressInfo;
import com.xwd.hospital.server.rest.req.DoctorFamilyAddressInfoParam;
import com.xwd.hospital.server.rest.res.ApiResponse;
import com.xwd.hospital.server.rest.thirdPartReq.BindNumberReq;
import com.xwd.hospital.server.service.CallApiService;
import com.xwd.hospital.server.service.DoctorFamilyAddressInfoService;
import com.xwd.hospital.server.service.MapApiService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import okhttp3.OkHttpClient;
import org.apache.commons.lang3.StringUtils;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.util.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
import java.util.Arrays;
import java.util.HashMap;
......@@ -48,6 +58,12 @@ import java.util.Map;
@RequestMapping("/v1/pms/doctor-family-address-info")
public class DoctorFamilyAddressInfoController extends BaseController<DoctorFamilyAddressInfoService, DoctorFamilyAddressInfo, DoctorFamilyAddressInfoParam> {
@Value("${gaode.map.host}")
public String host;
@Value("${gaode.map.key}")
public String key;
@Resource
public void setService(DoctorFamilyAddressInfoService service) {
this.service = service;
......@@ -66,10 +82,52 @@ public class DoctorFamilyAddressInfoController extends BaseController<DoctorFami
entity.setEditorId(user.getId());
entity.setEditorName(user.getUsername());
entity.setDefault().validate(true);
//根据地址获取gps坐标
String location = mapToGeo(entity.getProvince() + entity.getCity() + entity.getDistrict() + entity.getDetailAddress());
if(StringUtils.isEmpty(location)){
throw new RuntimeException("地址转化失败");
}
String[] split = location.split(",");
entity.setLng(split[0]);
entity.setLat(split[1]);
this.service.save(entity);
return ApiResponse.ok(this.service.getById(entity.getId()));
}
/**
* 更新
*
* @param entity 要更新的对象
* @return 更新后的对象
*/
@PutMapping("/")
@Operation(summary = "更新")
@ApiCommon
@Override
public ApiResponse<DoctorFamilyAddressInfo> update(
@RequestBody DoctorFamilyAddressInfo entity,
@RequestParam(value = "updateAllFields", defaultValue = "false") boolean updateAllFields,
@AuthUser User user) {
//根据地址获取gps坐标
String location = mapToGeo(entity.getProvince() + entity.getCity() + entity.getDistrict() + entity.getDetailAddress());
if(StringUtils.isEmpty(location)){
throw new RuntimeException("地址转化失败");
}
String[] split = location.split(",");
entity.setLng(split[0]);
entity.setLat(split[1]);
if (updateAllFields) {
this.service.updateAllFieldsById(entity);
} else {
this.service.updateById(entity);
}
return ApiResponse.ok(this.service.getById(entity.getId()));
}
/**
* 批量新增
*
......@@ -106,5 +164,59 @@ public class DoctorFamilyAddressInfoController extends BaseController<DoctorFami
return ApiResponse.ok(this.service.auditFail(id, rejectReason,user));
}
@PostMapping("/test")
@Operation(summary = "test")
public ApiResponse auditFail(@RequestParam("address") String address) {
String location = mapToGeo(address);
return ApiResponse.ok(location);
}
public String mapToGeo(String address) {
String location = "";
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(host)
.addConverterFactory(GsonConverterFactory.create())
.client(new OkHttpClient.Builder().build())
.build();
MapApiService service = retrofit.create(MapApiService.class);
log.info("地址转化中,地址{}",address);
Call<JsonObject> call = service.geo(key, address);
try {
Response<JsonObject> execute = call.execute();
log.info("返回结果{}",execute.toString());
JsonObject body = execute.body();
if (body != null) {
String status = body.get("status").getAsString();
if ("1".equals(status)) {
JsonObject geocodes = body.getAsJsonArray("geocodes").get(0).getAsJsonObject();
location = geocodes.get("location").getAsString();
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return location;
}
//todo 获取用户定位gps,推荐附近的医生
/**
* 根据地址查询附近医生列表
*/
@GetMapping("/queryNearbyDoctorList")
@Operation(summary = "根据地址查询附近医生列表")
public ApiResponse queryNearbyDoctorList(@RequestParam("address") String address) {
//根据地址获取gps坐标
String location = mapToGeo(address);
if(StringUtils.isEmpty(location)){
throw new RuntimeException("地址转化失败");
}
String[] split = location.split(",");
String lng = split[0];
String lat = split[1];
return ApiResponse.ok(this.service.queryNearbyDoctorList(lat, lng));
}
}
/**
* 项目:互联网医疗
* 模型分组:服务管理
* 模型名称:医生工作时间配置表
* @Author: xiongwei
* @Date: 2023-09-05 09:42:00
*/
package com.xwd.hospital.server.rest;
import java.util.List;
import java.util.Arrays;
import cn.dev33.satoken.stp.SaLoginModel;
import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.User;
import com.xwd.hospital.server.rest.res.ApiCode;
import com.xwd.hospital.server.domain.DoctorTimeConfig;
import com.xwd.hospital.server.rest.req.DoctorTimeConfigParam;
import com.xwd.hospital.server.rest.res.ApiResponse;
import com.xwd.hospital.server.service.DoctorTimeConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@RestController
@Tag(name = "DoctorTimeConfigController", description = "医生工作时间配置表管理")
@RequestMapping("/v1/pms/doctor-time-config")
public class DoctorTimeConfigController extends BaseController<DoctorTimeConfigService, DoctorTimeConfig, DoctorTimeConfigParam> {
@Resource
public void setService(DoctorTimeConfigService service) {
this.service = service;
}
/**
* 新增
*
* @param entity 要新增的对象
* @return 新增的对象
*/
@PostMapping("/")
@Operation(summary = "新增")
@Override
public ApiResponse<DoctorTimeConfig> add(@RequestBody DoctorTimeConfig entity, @AuthUser User user) {
entity.setEditorId(user.getId());
entity.setEditorName(user.getUsername());
entity.setDefault().validate(true);
this.service.save(entity);
return ApiResponse.ok(this.service.getById(entity.getId()));
}
/**
* 批量新增
*
* @param entityList 要新增的对象
* @return boolean 成功或失败
*/
@PostMapping("/batch-save")
@Operation(summary = "批量新增")
@Override
public ApiResponse<Boolean> batchSave(@RequestBody List<DoctorTimeConfig> entityList, @AuthUser User user) {
entityList.forEach(entity -> {
entity.setEditorId(user.getId());
entity.setEditorName(user.getUsername());
entity.setDefault().validate(true);
});
return ApiResponse.ok(this.service.saveBatch(entityList));
}
}
/**
* 项目:互联网医疗
*
* @Author: xiongwei
* @Date: 2023-09-05 09:42:00
*/
package com.xwd.hospital.server.rest;
import com.aspose.imaging.Image;
import com.aspose.imaging.ImageOptionsBase;
import com.aspose.imaging.imageoptions.Jpeg2000Options;
import com.aspose.imaging.imageoptions.JpegOptions;
import com.xwd.hospital.server.annotation.ApiCommon;;
import com.xwd.hospital.server.annotation.AuthUsername;;
import com.xwd.hospital.server.dto.PictureDto;
import com.xwd.hospital.server.rest.res.ApiCode;
import com.xwd.hospital.server.rest.res.ApiResponse;
import com.xwd.hospital.server.util.FileUtils;
import com.xwd.hospital.server.util.TencentCOSUtil;
......@@ -15,10 +22,20 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.imageio.ImageIO;
import javax.imageio.spi.ImageReaderSpi;
import java.awt.image.BufferedImage;
import java.io.*;
import java.nio.file.Files;
import java.util.Iterator;
import java.util.UUID;
@Tag(name = "UploadController", description = "文件上传")
@Slf4j
@RestController
......@@ -36,4 +53,58 @@ public class UploadController {
return ApiResponse.ok(upload);
}
@Operation(summary = "CT报告上传")
@PostMapping("/uploadCTFile")
@ApiCommon
public ApiResponse uploadCTFile(@RequestParam MultipartFile file) {
PictureDto pictureDto = new PictureDto();
String sourceFileUrl = tencentCOSUtil.upLoadFile(file);
pictureDto.setSourceFileUrl(sourceFileUrl);
if (hasDicomExtension(file)) {
//dicom文件,需要转化成jpeg
try {
String fileUrl = convertDicomToJpg(file);
File temporaryFile = new File(fileUrl);
String temporaryFileUrl = tencentCOSUtil.upLoadTemporaryFile(temporaryFile);
pictureDto.setImageUrl(temporaryFileUrl);
Files.delete(temporaryFile.toPath());
} catch (Exception e) {
throw new ApiCode.ApiException(-1, "dicom文件转换失败");
}
} else {
//非dicom文件,直接上传
pictureDto.setImageUrl(sourceFileUrl);
}
return ApiResponse.ok(pictureDto);
}
public static boolean hasDicomExtension(MultipartFile file) {
String fileName = file.getOriginalFilename();
// Check if the file has a ".dcm" extension
return fileName.toLowerCase().endsWith(".dcm");
}
public static String convertDicomToJpg(MultipartFile dicomFile) throws IOException {
try (InputStream inputStream = dicomFile.getInputStream();
Image image = Image.load(inputStream)) {
ImageOptionsBase exportOptions = new JpegOptions();
// 创建临时文件
String jpgFile = UUID.randomUUID().toString() + ".jpeg";
// String jpgFile = String.format("%s\\%s\\%s-%s-to-%s.%s", templatesFolder, "convert", "convert-", "", "jpg", "jpg");
image.save(jpgFile, exportOptions);
System.out.println("File saved: " + jpgFile);
return jpgFile;
} catch (Exception e) {
e.printStackTrace();
throw new ApiCode.ApiException(-1, "dicom文件转换失败");
}
}
}
......@@ -31,6 +31,7 @@ import com.xwd.hospital.server.domain.User;
import com.xwd.hospital.server.rest.req.UserParam;
import com.xwd.hospital.server.rest.res.ApiResponse;
import com.xwd.hospital.server.service.UserService;
import com.xwd.hospital.server.service.impl.UserServiceImpl;
import com.xwd.hospital.server.util.TencentOCRUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -374,7 +375,7 @@ public class UserController extends BaseController<UserService, User, UserParam>
@Operation(summary = "获取小程序推广码")
@GetMapping("/getWxQrCode")
@ApiCommon
public ApiResponse getWxQrCode(@AuthUser User user, HttpServletResponse response) {
public void getWxQrCode(@AuthUser User user, HttpServletResponse response) {
try{
OutputStream stream = null;
Object userId = StpUtil.getExtra("userId");
......@@ -388,7 +389,6 @@ public class UserController extends BaseController<UserService, User, UserParam>
}catch (IOException e){
e.printStackTrace();
}
return ApiResponse.ok(null);
}
/**
......@@ -415,4 +415,11 @@ public class UserController extends BaseController<UserService, User, UserParam>
return ApiResponse.ok(this.service.getUserCaseAndReportCount(userInfoId));
}
@PostMapping("/test")
@Operation(summary = "test")
public ApiResponse auditFail(@RequestParam("doctorId") Long doctorId) {
this.service.createDoctorWorkTime(doctorId);
return ApiResponse.ok(null);
}
}
......@@ -41,11 +41,6 @@ public class CouponSendRecordParam extends BaseParam<CouponSendRecord> {
*/
@Parameter(description = "优惠券Id")
private Long couponId;
/**
* 用户优惠券关系id
*/
@Parameter(description = "用户优惠券关系id")
private Long userCouponId;
/**
* 优惠券名称
*/
......@@ -72,10 +67,15 @@ public class CouponSendRecordParam extends BaseParam<CouponSendRecord> {
@Parameter(description = "发放人员id")
private Long sendId;
/**
* 接收人员id
* 发放原因
*/
@Parameter(description = "发放原因")
private String sendReason;
/**
* 职业Id
*/
@Parameter(description = "接收人员id")
private Long userInfoId;
@Parameter(description = "职业Id")
private Long careerId;
/**
* 操作人Id
*/
......@@ -141,7 +141,6 @@ public class CouponSendRecordParam extends BaseParam<CouponSendRecord> {
wrapper.eq(this.getId() != null, columnPrefix + "id", this.getId());
wrapper.in(this.getIdList() != null && this.getIdList().size() > 0, columnPrefix + "id", this.getIdList());
wrapper.eq(this.getCouponId() != null, columnPrefix + "coupon_id", this.getCouponId());
wrapper.eq(this.getUserCouponId() != null, columnPrefix + "user_coupon_id", this.getUserCouponId());
if (this.getCouponName() != null) {
if (this.getCouponName().startsWith("%") && this.getCouponName().endsWith("%")) {
wrapper.like(columnPrefix + "coupon_name", this.getCouponName().substring(1, this.getCouponName().length() - 1));
......@@ -157,7 +156,18 @@ public class CouponSendRecordParam extends BaseParam<CouponSendRecord> {
wrapper.in(this.getCouponTypeList() != null && this.getCouponTypeList().size() > 0, columnPrefix + "coupon_type", this.getCouponTypeList());
wrapper.eq(this.getCouponDiscount() != null, columnPrefix + "coupon_discount", this.getCouponDiscount());
wrapper.eq(this.getSendId() != null, columnPrefix + "send_id", this.getSendId());
wrapper.eq(this.getUserInfoId() != null, columnPrefix + "user_info_id", this.getUserInfoId());
if (this.getSendReason() != null) {
if (this.getSendReason().startsWith("%") && this.getSendReason().endsWith("%")) {
wrapper.like(columnPrefix + "send_reason", this.getSendReason().substring(1, this.getSendReason().length() - 1));
} else if (this.getSendReason().startsWith("%") && !this.getSendReason().endsWith("%")) {
wrapper.likeLeft(columnPrefix + "send_reason", this.getSendReason().substring(1));
} else if (this.getSendReason().endsWith("%")) {
wrapper.likeRight(columnPrefix + "send_reason", this.getSendReason().substring(0, this.getSendReason().length() - 1));
} else {
wrapper.eq(columnPrefix + "send_reason", this.getSendReason());
}
}
wrapper.eq(this.getCareerId() != null, columnPrefix + "career_id", this.getCareerId());
wrapper.eq(this.getEditorId() != null, columnPrefix + "editor_id", this.getEditorId());
if (this.getEditorName() != null) {
if (this.getEditorName().startsWith("%") && this.getEditorName().endsWith("%")) {
......
......@@ -62,6 +62,11 @@ public class DepartmentInfoParam extends BaseParam<DepartmentInfo> {
*/
@Parameter(description = "上级科室id")
private Long parentId;
/**
* 排序
*/
@Parameter(description = "排序")
private Long orderExtra;
/**
* 是否隐藏
*/
......@@ -161,6 +166,7 @@ public class DepartmentInfoParam extends BaseParam<DepartmentInfo> {
wrapper.eq(this.getDepartmentLevel() != null, columnPrefix + "department_level", this.getDepartmentLevel());
wrapper.in(this.getDepartmentLevelList() != null && this.getDepartmentLevelList().size() > 0, columnPrefix + "department_level", this.getDepartmentLevelList());
wrapper.eq(this.getParentId() != null, columnPrefix + "parent_id", this.getParentId());
wrapper.eq(this.getOrderExtra() != null, columnPrefix + "order_extra", this.getOrderExtra());
wrapper.eq(this.getHiddenStatus() != null, columnPrefix + "hidden_status", this.getHiddenStatus());
wrapper.in(this.getHiddenStatusList() != null && this.getHiddenStatusList().size() > 0, columnPrefix + "hidden_status", this.getHiddenStatusList());
wrapper.eq(this.getEditorId() != null, columnPrefix + "editor_id", this.getEditorId());
......
......@@ -71,6 +71,16 @@ public class DoctorFamilyAddressInfoParam extends BaseParam<DoctorFamilyAddressI
*/
@Parameter(description = "详细地址")
private String detailAddress;
/**
* 经度
*/
@Parameter(description = "经度")
private String lng;
/**
* 纬度
*/
@Parameter(description = "纬度")
private String lat;
/**
* 审核状态
*/
......@@ -222,6 +232,28 @@ public class DoctorFamilyAddressInfoParam extends BaseParam<DoctorFamilyAddressI
wrapper.eq(columnPrefix + "detail_address", this.getDetailAddress());
}
}
if (this.getLng() != null) {
if (this.getLng().startsWith("%") && this.getLng().endsWith("%")) {
wrapper.like(columnPrefix + "lng", this.getLng().substring(1, this.getLng().length() - 1));
} else if (this.getLng().startsWith("%") && !this.getLng().endsWith("%")) {
wrapper.likeLeft(columnPrefix + "lng", this.getLng().substring(1));
} else if (this.getLng().endsWith("%")) {
wrapper.likeRight(columnPrefix + "lng", this.getLng().substring(0, this.getLng().length() - 1));
} else {
wrapper.eq(columnPrefix + "lng", this.getLng());
}
}
if (this.getLat() != null) {
if (this.getLat().startsWith("%") && this.getLat().endsWith("%")) {
wrapper.like(columnPrefix + "lat", this.getLat().substring(1, this.getLat().length() - 1));
} else if (this.getLat().startsWith("%") && !this.getLat().endsWith("%")) {
wrapper.likeLeft(columnPrefix + "lat", this.getLat().substring(1));
} else if (this.getLat().endsWith("%")) {
wrapper.likeRight(columnPrefix + "lat", this.getLat().substring(0, this.getLat().length() - 1));
} else {
wrapper.eq(columnPrefix + "lat", this.getLat());
}
}
wrapper.eq(this.getAuditState() != null, columnPrefix + "audit_state", this.getAuditState());
wrapper.in(this.getAuditStateList() != null && this.getAuditStateList().size() > 0, columnPrefix + "audit_state", this.getAuditStateList());
wrapper.eq(this.getAuditId() != null, columnPrefix + "audit_id", this.getAuditId());
......
......@@ -98,6 +98,11 @@ public class DoctorInfoParam extends BaseParam<DoctorInfo> {
*/
@Parameter(description = "简介")
private String introduction;
/**
* 最大时间段服务人数限制
*/
@Parameter(description = "最大时间段服务人数限制")
private Integer maxOrderCount;
/**
* 身份证图片正面
*/
......@@ -254,6 +259,7 @@ public class DoctorInfoParam extends BaseParam<DoctorInfo> {
wrapper.eq(columnPrefix + "introduction", this.getIntroduction());
}
}
wrapper.eq(this.getMaxOrderCount() != null, columnPrefix + "max_order_count", this.getMaxOrderCount());
if (this.getIdCardPictureFront() != null) {
if (this.getIdCardPictureFront().startsWith("%") && this.getIdCardPictureFront().endsWith("%")) {
wrapper.like(columnPrefix + "id_card_picture_front", this.getIdCardPictureFront().substring(1, this.getIdCardPictureFront().length() - 1));
......
/**
* 项目:互联网医疗
* 模型分组:服务管理
* 模型名称:医生工作时间配置表
* @Author: xiongwei
* @Date: 2023-09-05 09:42:00
*/
package com.xwd.hospital.server.rest.req;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;
import com.xwd.hospital.server.base.BaseParam;
import com.xwd.hospital.server.enums.YesNoEnum;
import com.xwd.hospital.server.domain.DoctorTimeConfig;
@Data
@EqualsAndHashCode(callSuper = true)
@Builder(builderMethodName = "newBuilder")
@NoArgsConstructor
@AllArgsConstructor
public class DoctorTimeConfigParam extends BaseParam<DoctorTimeConfig> {
/**
* Id
*/
@Parameter(description = "Id")
private Long id;
/**
* Id IN值List
*/
@Parameter(description = "Id IN值List")
private List<Long> idList;
/**
* 医生Id
*/
@Parameter(description = "医生Id")
private Long doctorId;
/**
* 工作时间段
*/
@Parameter(description = "工作时间段")
private String workTime;
/**
* 工作状态
*/
@Parameter(description = "工作状态")
private YesNoEnum workStatus;
/**
* 工作状态 IN值List
*/
@Parameter(description = "工作状态 IN值List")
private List<String> workStatusList;
/**
* 操作人Id
*/
@Parameter(description = "操作人Id")
private Long editorId;
/**
* 操作人
*/
@Parameter(description = "操作人")
private String editorName;
/**
* 创建时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Parameter(description = "创建时间")
private java.util.Date createTime;
/**
* 创建时间 下限值(大于等于)
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Parameter(description = "创建时间 下限值(大于等于)")
private java.util.Date createTimeFrom;
/**
* 创建时间 上限值(小于)
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Parameter(description = "创建时间 上限值(小于)")
private java.util.Date createTimeTo;
/**
* 更新时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Parameter(description = "更新时间")
private java.util.Date updateTime;
/**
* 更新时间 下限值(大于等于)
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Parameter(description = "更新时间 下限值(大于等于)")
private java.util.Date updateTimeFrom;
/**
* 更新时间 上限值(小于)
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@Parameter(description = "更新时间 上限值(小于)")
private java.util.Date updateTimeTo;
/**
* 将查询参数转化为查询Wrapper
*/
@Override
public QueryWrapper<DoctorTimeConfig> toQueryWrapper() {
return this.toQueryWrapper("");
}
/**
* 将查询参数转化为查询Wrapper
*/
@Override
public QueryWrapper<DoctorTimeConfig> toQueryWrapper(String columnPrefix) {
QueryWrapper<DoctorTimeConfig> wrapper = Wrappers.<DoctorTimeConfig>query();
wrapper.eq(this.getId() != null, columnPrefix + "id", this.getId());
wrapper.in(this.getIdList() != null && this.getIdList().size() > 0, columnPrefix + "id", this.getIdList());
wrapper.eq(this.getDoctorId() != null, columnPrefix + "doctor_id", this.getDoctorId());
if (this.getWorkTime() != null) {
if (this.getWorkTime().startsWith("%") && this.getWorkTime().endsWith("%")) {
wrapper.like(columnPrefix + "work_time", this.getWorkTime().substring(1, this.getWorkTime().length() - 1));
} else if (this.getWorkTime().startsWith("%") && !this.getWorkTime().endsWith("%")) {
wrapper.likeLeft(columnPrefix + "work_time", this.getWorkTime().substring(1));
} else if (this.getWorkTime().endsWith("%")) {
wrapper.likeRight(columnPrefix + "work_time", this.getWorkTime().substring(0, this.getWorkTime().length() - 1));
} else {
wrapper.eq(columnPrefix + "work_time", this.getWorkTime());
}
}
wrapper.eq(this.getWorkStatus() != null, columnPrefix + "work_status", this.getWorkStatus());
wrapper.in(this.getWorkStatusList() != null && this.getWorkStatusList().size() > 0, columnPrefix + "work_status", this.getWorkStatusList());
wrapper.eq(this.getEditorId() != null, columnPrefix + "editor_id", this.getEditorId());
if (this.getEditorName() != null) {
if (this.getEditorName().startsWith("%") && this.getEditorName().endsWith("%")) {
wrapper.like(columnPrefix + "editor_name", this.getEditorName().substring(1, this.getEditorName().length() - 1));
} else if (this.getEditorName().startsWith("%") && !this.getEditorName().endsWith("%")) {
wrapper.likeLeft(columnPrefix + "editor_name", this.getEditorName().substring(1));
} else if (this.getEditorName().endsWith("%")) {
wrapper.likeRight(columnPrefix + "editor_name", this.getEditorName().substring(0, this.getEditorName().length() - 1));
} else {
wrapper.eq(columnPrefix + "editor_name", this.getEditorName());
}
}
wrapper.eq(this.getCreateTime() != null, columnPrefix + "create_time", this.getCreateTime());
wrapper.ge(this.getCreateTimeFrom() != null, columnPrefix + "create_time", this.getCreateTimeFrom());
wrapper.lt(this.getCreateTimeTo() != null, columnPrefix + "create_time", this.getCreateTimeTo());
wrapper.eq(this.getUpdateTime() != null, columnPrefix + "update_time", this.getUpdateTime());
wrapper.ge(this.getUpdateTimeFrom() != null, columnPrefix + "update_time", this.getUpdateTimeFrom());
wrapper.lt(this.getUpdateTimeTo() != null, columnPrefix + "update_time", this.getUpdateTimeTo());
return wrapper;
}
}
......@@ -113,6 +113,11 @@ public class UserCouponInfoParam extends BaseParam<UserCouponInfo> {
*/
@Parameter(description = "优惠券可用状态 IN值List")
private List<String> couponUseStateList;
/**
* 优惠券发放记录Id
*/
@Parameter(description = "优惠券发放记录Id")
private Long couponSendId;
/**
* 操作人Id
*/
......@@ -201,6 +206,7 @@ public class UserCouponInfoParam extends BaseParam<UserCouponInfo> {
wrapper.lt(this.getCouponEndDateTo() != null, columnPrefix + "coupon_end_date", this.getCouponEndDateTo());
wrapper.eq(this.getCouponUseState() != null, columnPrefix + "coupon_use_state", this.getCouponUseState());
wrapper.in(this.getCouponUseStateList() != null && this.getCouponUseStateList().size() > 0, columnPrefix + "coupon_use_state", this.getCouponUseStateList());
wrapper.eq(this.getCouponSendId() != null, columnPrefix + "coupon_send_id", this.getCouponSendId());
wrapper.eq(this.getEditorId() != null, columnPrefix + "editor_id", this.getEditorId());
if (this.getEditorName() != null) {
if (this.getEditorName().startsWith("%") && this.getEditorName().endsWith("%")) {
......
......@@ -17,4 +17,6 @@ import com.xwd.hospital.server.rest.req.DoctorFamilyAddressInfoParam;
public interface DoctorFamilyAddressInfoService extends BaseService<DoctorFamilyAddressInfo> {
boolean auditPass(Long id, User user);
boolean auditFail(Long id,String rejectReason, User user);
List queryNearbyDoctorList(String lat,String lng);
}
/**
* 项目:互联网医疗
* 模型分组:服务管理
* 模型名称:医生工作时间配置表
* @Author: xiongwei
* @Date: 2023-09-05 09:42:00
*/
package com.xwd.hospital.server.service;
import java.util.List;
import com.xwd.hospital.server.base.BaseService;
import com.xwd.hospital.server.domain.DoctorTimeConfig;
import com.xwd.hospital.server.rest.req.DoctorTimeConfigParam;
public interface DoctorTimeConfigService extends BaseService<DoctorTimeConfig> {
}
package com.xwd.hospital.server.service;
import com.google.gson.JsonObject;
import com.xwd.hospital.server.rest.thirdPartReq.BindIMUserReq;
import com.xwd.hospital.server.rest.thirdPartReq.UpdateIMUserReq;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Query;
public interface MapApiService {
/**
* 地图解析地址
* @return
*/
@POST("/v3/geocode/geo")
Call<JsonObject> geo(@Query("key") String key,
@Query("address") String address);
}
......@@ -94,4 +94,5 @@ public interface UserService extends BaseService<User> {
CaseAndReportCountDto getUserCaseAndReportCount(Long userInfoId);
void createDoctorWorkTime(Long doctorId);
}
......@@ -23,6 +23,7 @@ import com.xwd.hospital.server.dto.CouponInfoSendDto;
import com.xwd.hospital.server.enums.CouponUseStateEnum;
import com.xwd.hospital.server.enums.YesNoEnum;
import com.xwd.hospital.server.repository.UserInfoMapper;
import com.xwd.hospital.server.rest.res.ApiCode;
import com.xwd.hospital.server.service.CouponSendRecordService;
import com.xwd.hospital.server.service.UserCouponInfoService;
import com.xwd.hospital.server.service.UserInfoService;
......@@ -66,6 +67,9 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
public boolean consumerCoupons(ConsumerCouponInfoDto dto) {
Object userId = StpUtil.getExtra("userId");
CouponInfo couponInfo = this.getById(dto.getCouponId());
if(null == couponInfo){
throw new ApiCode.ApiException(-1,"优惠券不存在");
}
//todo 全体发优惠券
if (dto.getIsAll()) {
......@@ -75,6 +79,15 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
// ArrayList<UserCouponInfo> list = new ArrayList<>(dto.getConsumerList().size());
// ArrayList<CouponSendRecord> records = new ArrayList<>(dto.getConsumerList().size());
CouponSendRecord record = new CouponSendRecord();
record.setCouponId(dto.getCouponId());
record.setCouponName(couponInfo.getCouponName());
record.setCouponType(couponInfo.getCouponType());
record.setCouponDiscount(couponInfo.getCouponDiscount());
record.setSendId(Long.valueOf(userId.toString()));
record.setSendReason(dto.getSendReason());
recordService.save(record);
ArrayList<UserCouponInfo> list = new ArrayList<>(dto.getConsumerList().size());
for (Long consumerId : dto.getConsumerList()) {
UserCouponInfo userCouponInfo = new UserCouponInfo();
userCouponInfo.setUserInfoId(consumerId);
......@@ -85,19 +98,11 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
userCouponInfo.setCouponStartDate(couponInfo.getCouponStartDate());
userCouponInfo.setCouponEndDate(couponInfo.getCouponEndDate());
userCouponInfo.setCouponUseState(CouponUseStateEnum.USEABLE);
userCouponInfoService.save(userCouponInfo);
CouponSendRecord record = new CouponSendRecord();
record.setCouponId(dto.getCouponId());
record.setUserCouponId(userCouponInfo.getId());
record.setCouponName(couponInfo.getCouponName());
record.setCouponType(couponInfo.getCouponType());
record.setCouponDiscount(couponInfo.getCouponDiscount());
record.setSendId(Long.valueOf(userId.toString()));
record.setUserInfoId(consumerId);
recordService.save(record);
userCouponInfo.setCouponSendId(record.getId());
list.add(userCouponInfo);
}
userCouponInfoService.saveBatch(list);
}
}
......@@ -108,6 +113,9 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
public boolean giveOutCoupons(CouponInfoSendDto dto) {
Object userId = StpUtil.getExtra("userId");
CouponInfo couponInfo = this.getById(dto.getCouponInfoId());
if(null == couponInfo){
throw new ApiCode.ApiException(-1,"优惠券不存在");
}
//发优惠券
List<Long> idList = userInfoMapper.queryUserIdByCareerId(dto.getCareerId());
if (null != idList
......@@ -115,6 +123,17 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
// ArrayList<UserCouponInfo> list = new ArrayList<>(dto.getConsumerList().size());
// ArrayList<CouponSendRecord> records = new ArrayList<>(dto.getConsumerList().size());
CouponSendRecord record = new CouponSendRecord();
record.setCouponId(dto.getCouponInfoId());
record.setCouponName(couponInfo.getCouponName());
record.setCouponType(couponInfo.getCouponType());
record.setCouponDiscount(couponInfo.getCouponDiscount());
record.setSendId(Long.valueOf(userId.toString()));
record.setCareerId(dto.getCareerId());
record.setSendReason(dto.getSendReason());
recordService.save(record);
ArrayList<UserCouponInfo> list = new ArrayList<>(idList.size());
for (Long id : idList) {
UserCouponInfo userCouponInfo = new UserCouponInfo();
userCouponInfo.setUserInfoId(id);
......@@ -125,19 +144,10 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
userCouponInfo.setCouponStartDate(couponInfo.getCouponStartDate());
userCouponInfo.setCouponEndDate(couponInfo.getCouponEndDate());
userCouponInfo.setCouponUseState(CouponUseStateEnum.USEABLE);
userCouponInfoService.save(userCouponInfo);
CouponSendRecord record = new CouponSendRecord();
record.setCouponId(dto.getCouponInfoId());
record.setUserCouponId(userCouponInfo.getId());
record.setCouponName(couponInfo.getCouponName());
record.setCouponType(couponInfo.getCouponType());
record.setCouponDiscount(couponInfo.getCouponDiscount());
record.setSendId(Long.valueOf(userId.toString()));
record.setUserInfoId(id);
recordService.save(record);
userCouponInfo.setCouponSendId(record.getId());
list.add(userCouponInfo);
}
userCouponInfoService.saveBatch(list);
}
return true;
}
......
......@@ -76,7 +76,8 @@ public class DepartmentInfoServiceImpl extends ServiceImpl<DepartmentInfoMapper,
parentDepartmentList.add(departmentDto);
}
}
//根据order_extra排序,从小到大
parentDepartmentList.sort(Comparator.comparing(DepartmentDto::getOrderExtra));
return parentDepartmentList;
}
......
......@@ -13,6 +13,7 @@ import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xwd.hospital.server.domain.FamilyDoctor;
import com.xwd.hospital.server.domain.User;
import com.xwd.hospital.server.enums.AuditStateEnum;
......@@ -85,4 +86,8 @@ public class DoctorFamilyAddressInfoServiceImpl extends ServiceImpl<DoctorFamily
return false;
}
@Override
public List queryNearbyDoctorList(String lat,String lng) {
return this.baseMapper.queryNearbyDoctorList(lat,lng);
}
}
/**
* 项目:互联网医疗
* 模型分组:服务管理
* 模型名称:医生工作时间配置表
* @Author: xiongwei
* @Date: 2023-09-05 09:42:00
*/
package com.xwd.hospital.server.service.impl;
import java.io.Serializable;
import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
import jakarta.annotation.Resource;
import com.baomidou.mybatisplus.core.enums.SqlMethod;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.xwd.hospital.server.service.DoctorTimeConfigService;
import com.xwd.hospital.server.repository.DoctorTimeConfigMapper;
import com.xwd.hospital.server.repository.base.DoctorTimeConfigBaseMapper;
import com.xwd.hospital.server.domain.DoctorTimeConfig;
import com.xwd.hospital.server.rest.req.DoctorTimeConfigParam;
@Service
public class DoctorTimeConfigServiceImpl extends ServiceImpl<DoctorTimeConfigMapper, DoctorTimeConfig> implements DoctorTimeConfigService {
@Override
public int updateAllFieldsById(DoctorTimeConfig entity) {
return this.getBaseMapper().updateAllFieldsById(entity);
}
/**
* 批量插入
*
* @param entityList ignore
* @param batchSize ignore
* @return ignore
*/
@Transactional(rollbackFor = Exception.class)
@Override
public boolean saveBatch(Collection<DoctorTimeConfig> entityList, int batchSize) {
String sqlStatement = SqlHelper.getSqlStatement(DoctorTimeConfigBaseMapper.class, SqlMethod.INSERT_ONE);
return executeBatch(entityList, batchSize, (sqlSession, entity) -> sqlSession.insert(sqlStatement, entity));
}
}
......@@ -134,7 +134,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
User sysUser = userService.getById(Long.valueOf(userId.toString()));
Date date = new Date();
DateTime twoWeekAway = DateUtil.offsetDay(date, 14);
DateTime twoWeekAway = DateUtil.offsetDay(date, 7);
if(createOrderDto.getOrderType() != OrderTypeEnum.PRESCRIPTION){
// Date appointmentDate = DateUtil.parse(DateUtil.format(createOrderDto.getAppointmentDate(), "yyyy-MM-dd"));
// Date now = DateUtil.parse(DateUtil.format(date, "yyyy-MM-dd"));
......@@ -156,10 +156,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
long currentOrderCount = this.count(Wrappers.<Order>query().eq("doctor_id", createOrderDto.getDoctorId())
.eq("delete_status", YesNoEnum.NO.toString())
.eq("appointment_date", createOrderDto.getAppointmentDate())
.eq("order_state", OrderStateEnum.IN_SERVICE.toString()));
//todo 判断是否超过最大预约数
i
if(currentOrderCount >= doctorServiceInfo.){
.eq("order_state", OrderStateEnum.IN_SERVICE.toString())
.or()
.eq("order_state", OrderStateEnum.TO_CONFIRM.toString()));
//判断是否超过最大预约数
DoctorInfo doctorInfo = doctorInfoService.getById(createOrderDto.getDoctorId());
if(currentOrderCount >= doctorInfo.getMaxOrderCount()){
throw new ApiCode.ApiException(-1, "当前时间段预约已满,请选择其他时间!");
}
......@@ -175,7 +177,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
order.setAppointmentDate(createOrderDto.getAppointmentDate());
//查询相关服务价格
DoctorInfo doctorInfo = doctorInfoService.getById(createOrderDto.getDoctorId());
order.setOrderPrice(doctorServiceInfo.getServicePrice());
//查询优惠金额
......
......@@ -38,8 +38,6 @@ import com.xwd.hospital.server.rest.req.UserCouponInfoParam;
@Service
public class UserCouponInfoServiceImpl extends ServiceImpl<UserCouponInfoMapper, UserCouponInfo> implements UserCouponInfoService {
@Resource
private UserService userService;
@Resource
private UserInfoService userInfoService;
......
......@@ -14,6 +14,8 @@ import com.tencent.cloud.Response;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.TreeMap;
......@@ -164,4 +166,40 @@ public class TencentCOSUtil {
return null;
}
}
public static String upLoadTemporaryFile(File file) {
try {
// 获取上传的文件的输入流
InputStream inputStream = new FileInputStream(file);
// 避免文件覆盖,获取文件的原始名称,如123.jpg,然后通过截取获得文件的后缀,也就是文件的类型
String originalFilename = file.getName();
//获取文件的类型
String fileType = originalFilename.substring(originalFilename.lastIndexOf("."));
//使用UUID工具 创建唯一名称,放置文件重名被覆盖,在拼接上上命令获取的文件类型
String fileName = UUID.randomUUID().toString() + fileType;
// 指定文件上传到 COS 上的路径,即对象键。最终文件会传到存储桶名字中的images文件夹下的fileName名字
String key = "report-image/" + fileName;
// 创建上传Object的Metadata
ObjectMetadata objectMetadata = new ObjectMetadata();
// - 使用输入流存储,需要设置请求长度
objectMetadata.setContentLength(inputStream.available());
// - 设置缓存
objectMetadata.setCacheControl("no-cache");
// - 设置Content-Type
objectMetadata.setContentType(fileType);
//上传文件
PutObjectResult putResult = getCosClient().putObject(bucketName, key, inputStream, objectMetadata);
// 创建文件的网络访问路径
String url = rootSrc + key;
//关闭 cosClient,并释放 HTTP 连接的后台管理线程
getCosClient().shutdown();
return url;
} catch (Exception e) {
e.printStackTrace();
// 发生IO异常、COS连接异常等,返回空
return null;
}
}
}
......@@ -57,3 +57,7 @@ ronglian:
account: T00000029722
secret: 88275dd0-6667-11ee-a6e8-a9e02a8e273e
host: https://openapis.7moor.com
gaode:
map:
host: https://restapi.amap.com
key: ef5eac5dfca8a5e7f4a8832eb09a0079
......@@ -57,3 +57,7 @@ ronglian:
account: T00000029722
secret: 88275dd0-6667-11ee-a6e8-a9e02a8e273e
host: https://openapis.7moor.com
gaode:
map:
host: https://restapi.amap.com
key: ef5eac5dfca8a5e7f4a8832eb09a0079
......@@ -41,11 +41,13 @@
<id property="id" column="id"/>
<result property="departmentName" column="department_name"/>
<result property="parentId" column="parent_id"/>
<result property="orderExtra" column="order_extra"/>
<!-- 定义子对象的映射 -->
<collection property="childList" ofType="com.xwd.hospital.server.dto.DepartmentDto">
<id property="id" column="child_id"/>
<result property="departmentName" column="child_name"/>
<result property="parentId" column="child_parent_id"/>
<result property="orderExtra" column="order_extra"/>
<!-- 继续定义更多的子对象映射 -->
</collection>
</resultMap>
......@@ -54,7 +56,8 @@
SELECT
parent.id,
parent.department_name,
parent.parent_id
parent.parent_id,
parent.order_extra
FROM pms_department_info parent
where 1 = 1
<if test="hiddenStatus != null">
......
......@@ -36,4 +36,15 @@
from pms_doctor_family_address_info
${ew.customSqlSegment}
</select>
<select id="queryNearbyDoctorList" resultMap="ListResultMap">
SELECT *
FROM pms_doctor_family_address_info AS ai
WHERE ai.audit_state = 'AUDIT_SUCCESS'
and ST_DISTANCE_SPHERE(
POINT(ai.lng, ai.lat),
POINT(#{lng}, #{lat})
) &lt; 10000
limit 5;
</select>
</mapper>
<?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.xwd.hospital.server.repository.DoctorTimeConfigMapper">
<resultMap id="ResultMap" type="com.xwd.hospital.server.domain.DoctorTimeConfig" extends="com.xwd.hospital.server.repository.base.DoctorTimeConfigBaseMapper.ResultMap">
</resultMap>
<resultMap id="ListResultMap" type="com.xwd.hospital.server.domain.DoctorTimeConfig" extends="com.xwd.hospital.server.repository.base.DoctorTimeConfigBaseMapper.BaseResultMap">
</resultMap>
<!-- 根据主键查询 -->
<select id="selectById" parameterType="java.io.Serializable" resultMap="ResultMap">
select
<include refid="com.xwd.hospital.server.repository.base.DoctorTimeConfigBaseMapper.Base_Column_List" />
from pms_doctor_time_config
where id = #{id}
</select>
<!-- 根据Wrapper查询 -->
<select id="selectOne" resultMap="ResultMap">
select
<include refid="com.xwd.hospital.server.repository.base.DoctorTimeConfigBaseMapper.Base_Column_List" />
from pms_doctor_time_config
${ew.customSqlSegment}
LIMIT 1
</select>
<!-- 根据Wrapper查询 -->
<select id="selectPage" resultMap="ListResultMap">
select
<include refid="com.xwd.hospital.server.repository.base.DoctorTimeConfigBaseMapper.Base_Column_List" />
from pms_doctor_time_config
${ew.customSqlSegment}
</select>
<!-- 根据Wrapper查询 -->
<select id="selectList" resultMap="ResultMap">
select
<include refid="com.xwd.hospital.server.repository.base.DoctorTimeConfigBaseMapper.Base_Column_List" />
from pms_doctor_time_config
${ew.customSqlSegment}
</select>
</mapper>
......@@ -4,12 +4,12 @@
<resultMap id="BaseResultMap" type="com.xwd.hospital.server.domain.CouponSendRecord">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="coupon_id" jdbcType="BIGINT" property="couponId" />
<result column="user_coupon_id" jdbcType="BIGINT" property="userCouponId" />
<result column="coupon_name" jdbcType="VARCHAR" property="couponName" />
<result column="coupon_type" jdbcType="VARCHAR" property="couponType" />
<result column="coupon_discount" jdbcType="DECIMAL" property="couponDiscount" />
<result column="send_id" jdbcType="BIGINT" property="sendId" />
<result column="user_info_id" jdbcType="BIGINT" property="userInfoId" />
<result column="send_reason" jdbcType="VARCHAR" property="sendReason" />
<result column="career_id" jdbcType="BIGINT" property="careerId" />
<result column="editor_id" jdbcType="BIGINT" property="editorId" />
<result column="editor_name" jdbcType="VARCHAR" property="editorName" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
......@@ -18,27 +18,25 @@
<resultMap id="ResultMap" type="com.xwd.hospital.server.domain.CouponSendRecord" extends="BaseResultMap">
<association column="coupon_id" property="coupon" javaType="com.xwd.hospital.server.domain.CouponInfo"
select="com.xwd.hospital.server.repository.CouponInfoMapper.selectById" />
<association column="user_coupon_id" property="userCoupon" javaType="com.xwd.hospital.server.domain.UserCouponInfo"
select="com.xwd.hospital.server.repository.UserCouponInfoMapper.selectById" />
<association column="send_id" property="send" javaType="com.xwd.hospital.server.domain.User"
select="com.xwd.hospital.server.repository.UserMapper.selectById" />
<association column="user_info_id" property="userInfo" javaType="com.xwd.hospital.server.domain.UserInfo"
select="com.xwd.hospital.server.repository.UserInfoMapper.selectById" />
<association column="career_id" property="career" javaType="com.xwd.hospital.server.domain.Career"
select="com.xwd.hospital.server.repository.CareerMapper.selectById" />
</resultMap>
<sql id="Base_Column_List">
`id`, `coupon_id`, `user_coupon_id`, `coupon_name`, `coupon_type`, `coupon_discount`, `send_id`, `user_info_id`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `coupon_id`, `coupon_name`, `coupon_type`, `coupon_discount`, `send_id`, `send_reason`, `career_id`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql id="Base_Column_List_With_Prefix">
t.`id`, t.`coupon_id`, t.`user_coupon_id`, t.`coupon_name`, t.`coupon_type`, t.`coupon_discount`, t.`send_id`, t.`user_info_id`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
t.`id`, t.`coupon_id`, t.`coupon_name`, t.`coupon_type`, t.`coupon_discount`, t.`send_id`, t.`send_reason`, t.`career_id`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<insert id="batchInsert">
insert into pms_coupon_send_record (
`coupon_id`, `user_coupon_id`, `coupon_name`, `coupon_type`, `coupon_discount`, `send_id`, `user_info_id`, `editor_id`, `editor_name`
`coupon_id`, `coupon_name`, `coupon_type`, `coupon_discount`, `send_id`, `send_reason`, `career_id`, `editor_id`, `editor_name`
)
values
<foreach collection="records" item="record" separator=",">
(
#{record.couponId, jdbcType=BIGINT}, #{record.userCouponId, jdbcType=BIGINT}, #{record.couponName, jdbcType=VARCHAR}, #{record.couponType, jdbcType=VARCHAR}, #{record.couponDiscount, jdbcType=DECIMAL}, #{record.sendId, jdbcType=BIGINT}, #{record.userInfoId, jdbcType=BIGINT}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
#{record.couponId, jdbcType=BIGINT}, #{record.couponName, jdbcType=VARCHAR}, #{record.couponType, jdbcType=VARCHAR}, #{record.couponDiscount, jdbcType=DECIMAL}, #{record.sendId, jdbcType=BIGINT}, #{record.sendReason, jdbcType=VARCHAR}, #{record.careerId, jdbcType=BIGINT}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
)
</foreach>
</insert>
......@@ -46,12 +44,12 @@
update pms_coupon_send_record set
<trim suffixOverrides=",">
coupon_id = #{et.couponId, jdbcType=BIGINT},
user_coupon_id = #{et.userCouponId, jdbcType=BIGINT},
coupon_name = #{et.couponName, jdbcType=VARCHAR},
coupon_type = #{et.couponType, jdbcType=VARCHAR},
coupon_discount = #{et.couponDiscount, jdbcType=DECIMAL},
send_id = #{et.sendId, jdbcType=BIGINT},
user_info_id = #{et.userInfoId, jdbcType=BIGINT},
send_reason = #{et.sendReason, jdbcType=VARCHAR},
career_id = #{et.careerId, jdbcType=BIGINT},
editor_id = #{et.editorId, jdbcType=BIGINT},
editor_name = #{et.editorName, jdbcType=VARCHAR},
</trim>
......
......@@ -6,6 +6,7 @@
<result column="department_name" jdbcType="VARCHAR" property="departmentName" />
<result column="department_level" jdbcType="VARCHAR" property="departmentLevel" />
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
<result column="order_extra" jdbcType="BIGINT" property="orderExtra" />
<result column="hidden_status" jdbcType="VARCHAR" property="hiddenStatus" />
<result column="editor_id" jdbcType="BIGINT" property="editorId" />
<result column="editor_name" jdbcType="VARCHAR" property="editorName" />
......@@ -16,25 +17,25 @@
<result column="department_introduce" jdbcType="VARCHAR" property="departmentIntroduce" />
</resultMap>
<sql id="Base_Column_List">
`id`, `department_name`, `department_level`, `parent_id`, `hidden_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `department_name`, `department_level`, `parent_id`, `order_extra`, `hidden_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql id="Base_Column_List_With_Prefix">
t.`id`, t.`department_name`, t.`department_level`, t.`parent_id`, t.`hidden_status`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
t.`id`, t.`department_name`, t.`department_level`, t.`parent_id`, t.`order_extra`, t.`hidden_status`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<sql id="Base_Column_List_Full">
`id`, `department_name`, `department_introduce`, `department_level`, `parent_id`, `hidden_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `department_name`, `department_introduce`, `department_level`, `parent_id`, `order_extra`, `hidden_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql id="Base_Column_List_Full_With_Prefix">
t.`id`, t.`department_name`, t.`department_introduce`, t.`department_level`, t.`parent_id`, t.`hidden_status`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
t.`id`, t.`department_name`, t.`department_introduce`, t.`department_level`, t.`parent_id`, t.`order_extra`, t.`hidden_status`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<insert id="batchInsert">
insert into pms_department_info (
`department_name`, `department_introduce`, `department_level`, `parent_id`, `hidden_status`, `editor_id`, `editor_name`
`department_name`, `department_introduce`, `department_level`, `parent_id`, `order_extra`, `hidden_status`, `editor_id`, `editor_name`
)
values
<foreach collection="records" item="record" separator=",">
(
#{record.departmentName, jdbcType=VARCHAR}, #{record.departmentIntroduce, jdbcType=VARCHAR}, #{record.departmentLevel, jdbcType=VARCHAR}, #{record.parentId, jdbcType=BIGINT}, #{record.hiddenStatus, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
#{record.departmentName, jdbcType=VARCHAR}, #{record.departmentIntroduce, jdbcType=VARCHAR}, #{record.departmentLevel, jdbcType=VARCHAR}, #{record.parentId, jdbcType=BIGINT}, #{record.orderExtra, jdbcType=BIGINT}, #{record.hiddenStatus, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
)
</foreach>
</insert>
......@@ -45,6 +46,7 @@
department_introduce = #{et.departmentIntroduce, jdbcType=VARCHAR},
department_level = #{et.departmentLevel, jdbcType=VARCHAR},
parent_id = #{et.parentId, jdbcType=BIGINT},
order_extra = #{et.orderExtra, jdbcType=BIGINT},
hidden_status = #{et.hiddenStatus, jdbcType=VARCHAR},
editor_id = #{et.editorId, jdbcType=BIGINT},
editor_name = #{et.editorName, jdbcType=VARCHAR},
......
......@@ -10,6 +10,8 @@
<result column="city" jdbcType="VARCHAR" property="city" />
<result column="district" jdbcType="VARCHAR" property="district" />
<result column="detail_address" jdbcType="VARCHAR" property="detailAddress" />
<result column="lng" jdbcType="VARCHAR" property="lng" />
<result column="lat" jdbcType="VARCHAR" property="lat" />
<result column="audit_state" jdbcType="VARCHAR" property="auditState" />
<result column="audit_id" jdbcType="BIGINT" property="auditId" />
<result column="reject_reason" jdbcType="VARCHAR" property="rejectReason" />
......@@ -20,24 +22,24 @@
</resultMap>
<resultMap id="ResultMap" type="com.xwd.hospital.server.domain.DoctorFamilyAddressInfo" extends="BaseResultMap">
<association column="doctor_id" property="doctor" javaType="com.xwd.hospital.server.domain.DoctorInfo"
select="com.xwd.hospital.server.repository.DoctorInfoMapper.selectByDoctorId" />
select="com.xwd.hospital.server.repository.DoctorInfoMapper.selectById" />
<association column="audit_id" property="audit" javaType="com.xwd.hospital.server.domain.User"
select="com.xwd.hospital.server.repository.UserMapper.selectByUserId" />
select="com.xwd.hospital.server.repository.UserMapper.selectById" />
</resultMap>
<sql id="Base_Column_List">
`id`, `doctor_id`, `name`, `phone_number`, `province`, `city`, `district`, `detail_address`, `audit_state`, `audit_id`, `reject_reason`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `doctor_id`, `name`, `phone_number`, `province`, `city`, `district`, `detail_address`, `lng`, `lat`, `audit_state`, `audit_id`, `reject_reason`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql id="Base_Column_List_With_Prefix">
t.`id`, t.`doctor_id`, t.`name`, t.`phone_number`, t.`province`, t.`city`, t.`district`, t.`detail_address`, t.`audit_state`, t.`audit_id`, t.`reject_reason`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
t.`id`, t.`doctor_id`, t.`name`, t.`phone_number`, t.`province`, t.`city`, t.`district`, t.`detail_address`, t.`lng`, t.`lat`, t.`audit_state`, t.`audit_id`, t.`reject_reason`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<insert id="batchInsert">
insert into pms_doctor_family_address_info (
`doctor_id`, `name`, `phone_number`, `province`, `city`, `district`, `detail_address`, `audit_state`, `audit_id`, `reject_reason`, `editor_id`, `editor_name`
`doctor_id`, `name`, `phone_number`, `province`, `city`, `district`, `detail_address`, `lng`, `lat`, `audit_state`, `audit_id`, `reject_reason`, `editor_id`, `editor_name`
)
values
<foreach collection="records" item="record" separator=",">
(
#{record.doctorId, jdbcType=BIGINT}, #{record.name, jdbcType=VARCHAR}, #{record.phoneNumber, jdbcType=VARCHAR}, #{record.province, jdbcType=VARCHAR}, #{record.city, jdbcType=VARCHAR}, #{record.district, jdbcType=VARCHAR}, #{record.detailAddress, jdbcType=VARCHAR}, #{record.auditState, jdbcType=VARCHAR}, #{record.auditId, jdbcType=BIGINT}, #{record.rejectReason, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
#{record.doctorId, jdbcType=BIGINT}, #{record.name, jdbcType=VARCHAR}, #{record.phoneNumber, jdbcType=VARCHAR}, #{record.province, jdbcType=VARCHAR}, #{record.city, jdbcType=VARCHAR}, #{record.district, jdbcType=VARCHAR}, #{record.detailAddress, jdbcType=VARCHAR}, #{record.lng, jdbcType=VARCHAR}, #{record.lat, jdbcType=VARCHAR}, #{record.auditState, jdbcType=VARCHAR}, #{record.auditId, jdbcType=BIGINT}, #{record.rejectReason, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
)
</foreach>
</insert>
......@@ -51,6 +53,8 @@
city = #{et.city, jdbcType=VARCHAR},
district = #{et.district, jdbcType=VARCHAR},
detail_address = #{et.detailAddress, jdbcType=VARCHAR},
lng = #{et.lng, jdbcType=VARCHAR},
lat = #{et.lat, jdbcType=VARCHAR},
audit_state = #{et.auditState, jdbcType=VARCHAR},
audit_id = #{et.auditId, jdbcType=BIGINT},
reject_reason = #{et.rejectReason, jdbcType=VARCHAR},
......
......@@ -12,6 +12,7 @@
<result column="born_date" jdbcType="VARCHAR" property="bornDate" />
<result column="phone_number" jdbcType="VARCHAR" property="phoneNumber" />
<result column="expertise_area" jdbcType="VARCHAR" property="expertiseArea" />
<result column="max_order_count" jdbcType="INTEGER" property="maxOrderCount" />
<result column="id_card_picture_front" jdbcType="VARCHAR" property="idCardPictureFront" />
<result column="id_card_picture_back" jdbcType="VARCHAR" property="idCardPictureBack" />
<result column="delete_status" jdbcType="VARCHAR" property="deleteStatus" />
......@@ -36,25 +37,25 @@
select="com.xwd.hospital.server.repository.UserMapper.selectByUserId" />
</resultMap>
<sql id="Base_Column_List">
`id`, `user_id`, `medical_qualification_id`, `doctor_state`, `doctor_name`, `sex`, `id_no`, `born_date`, `phone_number`, `expertise_area`, `id_card_picture_front`, `id_card_picture_back`, `delete_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `user_id`, `medical_qualification_id`, `doctor_state`, `doctor_name`, `sex`, `id_no`, `born_date`, `phone_number`, `expertise_area`, `max_order_count`, `id_card_picture_front`, `id_card_picture_back`, `delete_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql id="Base_Column_List_With_Prefix">
t.`id`, t.`user_id`, t.`medical_qualification_id`, t.`doctor_state`, t.`doctor_name`, t.`sex`, t.`id_no`, t.`born_date`, t.`phone_number`, t.`expertise_area`, t.`id_card_picture_front`, t.`id_card_picture_back`, t.`delete_status`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
t.`id`, t.`user_id`, t.`medical_qualification_id`, t.`doctor_state`, t.`doctor_name`, t.`sex`, t.`id_no`, t.`born_date`, t.`phone_number`, t.`expertise_area`, t.`max_order_count`, t.`id_card_picture_front`, t.`id_card_picture_back`, t.`delete_status`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<sql id="Base_Column_List_Full">
`id`, `user_id`, `medical_qualification_id`, `doctor_state`, `doctor_name`, `sex`, `id_no`, `born_date`, `phone_number`, `expertise_area`, `introduction`, `id_card_picture_front`, `id_card_picture_back`, `delete_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `user_id`, `medical_qualification_id`, `doctor_state`, `doctor_name`, `sex`, `id_no`, `born_date`, `phone_number`, `expertise_area`, `introduction`, `max_order_count`, `id_card_picture_front`, `id_card_picture_back`, `delete_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql id="Base_Column_List_Full_With_Prefix">
t.`id`, t.`user_id`, t.`medical_qualification_id`, t.`doctor_state`, t.`doctor_name`, t.`sex`, t.`id_no`, t.`born_date`, t.`phone_number`, t.`expertise_area`, t.`introduction`, t.`id_card_picture_front`, t.`id_card_picture_back`, t.`delete_status`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
t.`id`, t.`user_id`, t.`medical_qualification_id`, t.`doctor_state`, t.`doctor_name`, t.`sex`, t.`id_no`, t.`born_date`, t.`phone_number`, t.`expertise_area`, t.`introduction`, t.`max_order_count`, t.`id_card_picture_front`, t.`id_card_picture_back`, t.`delete_status`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<insert id="batchInsert">
insert into pms_doctor_info (
`user_id`, `medical_qualification_id`, `doctor_state`, `doctor_name`, `sex`, `id_no`, `born_date`, `phone_number`, `expertise_area`, `introduction`, `id_card_picture_front`, `id_card_picture_back`, `delete_status`, `editor_id`, `editor_name`
`user_id`, `medical_qualification_id`, `doctor_state`, `doctor_name`, `sex`, `id_no`, `born_date`, `phone_number`, `expertise_area`, `introduction`, `max_order_count`, `id_card_picture_front`, `id_card_picture_back`, `delete_status`, `editor_id`, `editor_name`
)
values
<foreach collection="records" item="record" separator=",">
(
#{record.userId, jdbcType=BIGINT}, #{record.medicalQualificationId, jdbcType=BIGINT}, #{record.doctorState, jdbcType=VARCHAR}, #{record.doctorName, jdbcType=VARCHAR}, #{record.sex, jdbcType=VARCHAR}, #{record.idNo, jdbcType=VARCHAR}, #{record.bornDate, jdbcType=VARCHAR}, #{record.phoneNumber, jdbcType=VARCHAR}, #{record.expertiseArea, jdbcType=VARCHAR}, #{record.introduction, jdbcType=VARCHAR}, #{record.idCardPictureFront, jdbcType=VARCHAR}, #{record.idCardPictureBack, jdbcType=VARCHAR}, #{record.deleteStatus, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
#{record.userId, jdbcType=BIGINT}, #{record.medicalQualificationId, jdbcType=BIGINT}, #{record.doctorState, jdbcType=VARCHAR}, #{record.doctorName, jdbcType=VARCHAR}, #{record.sex, jdbcType=VARCHAR}, #{record.idNo, jdbcType=VARCHAR}, #{record.bornDate, jdbcType=VARCHAR}, #{record.phoneNumber, jdbcType=VARCHAR}, #{record.expertiseArea, jdbcType=VARCHAR}, #{record.introduction, jdbcType=VARCHAR}, #{record.maxOrderCount, jdbcType=INTEGER}, #{record.idCardPictureFront, jdbcType=VARCHAR}, #{record.idCardPictureBack, jdbcType=VARCHAR}, #{record.deleteStatus, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
)
</foreach>
</insert>
......@@ -71,6 +72,7 @@
phone_number = #{et.phoneNumber, jdbcType=VARCHAR},
expertise_area = #{et.expertiseArea, jdbcType=VARCHAR},
introduction = #{et.introduction, jdbcType=VARCHAR},
max_order_count = #{et.maxOrderCount, jdbcType=INTEGER},
id_card_picture_front = #{et.idCardPictureFront, jdbcType=VARCHAR},
id_card_picture_back = #{et.idCardPictureBack, jdbcType=VARCHAR},
delete_status = #{et.deleteStatus, jdbcType=VARCHAR},
......
<?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.xwd.hospital.server.repository.base.DoctorTimeConfigBaseMapper">
<resultMap id="BaseResultMap" type="com.xwd.hospital.server.domain.DoctorTimeConfig">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="doctor_id" jdbcType="BIGINT" property="doctorId" />
<result column="work_time" jdbcType="VARCHAR" property="workTime" />
<result column="work_status" jdbcType="VARCHAR" property="workStatus" />
<result column="editor_id" jdbcType="BIGINT" property="editorId" />
<result column="editor_name" jdbcType="VARCHAR" property="editorName" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<resultMap id="ResultMap" type="com.xwd.hospital.server.domain.DoctorTimeConfig" extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List">
`id`, `doctor_id`, `work_time`, `work_status`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql id="Base_Column_List_With_Prefix">
t.`id`, t.`doctor_id`, t.`work_time`, t.`work_status`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<insert id="batchInsert">
insert into pms_doctor_time_config (
`doctor_id`, `work_time`, `work_status`, `editor_id`, `editor_name`
)
values
<foreach collection="records" item="record" separator=",">
(
#{record.doctorId, jdbcType=BIGINT}, #{record.workTime, jdbcType=VARCHAR}, #{record.workStatus, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
)
</foreach>
</insert>
<update id="updateAllFieldsById" parameterType="com.xwd.hospital.server.domain.DoctorTimeConfig">
update pms_doctor_time_config set
<trim suffixOverrides=",">
doctor_id = #{et.doctorId, jdbcType=BIGINT},
work_time = #{et.workTime, jdbcType=VARCHAR},
work_status = #{et.workStatus, jdbcType=VARCHAR},
editor_id = #{et.editorId, jdbcType=BIGINT},
editor_name = #{et.editorName, jdbcType=VARCHAR},
</trim>
where id = #{et.id}
</update>
</mapper>
......@@ -11,6 +11,7 @@
<result column="coupon_start_date" jdbcType="TIMESTAMP" property="couponStartDate" />
<result column="coupon_end_date" jdbcType="TIMESTAMP" property="couponEndDate" />
<result column="coupon_use_state" jdbcType="VARCHAR" property="couponUseState" />
<result column="coupon_send_id" jdbcType="BIGINT" property="couponSendId" />
<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 +24,19 @@
select="com.xwd.hospital.server.repository.CouponInfoMapper.selectById" />
</resultMap>
<sql id="Base_Column_List">
`id`, `user_info_id`, `coupon_id`, `coupon_name`, `coupon_type`, `coupon_discount`, `coupon_start_date`, `coupon_end_date`, `coupon_use_state`, `editor_id`, `editor_name`, `create_time`, `update_time`
`id`, `user_info_id`, `coupon_id`, `coupon_name`, `coupon_type`, `coupon_discount`, `coupon_start_date`, `coupon_end_date`, `coupon_use_state`, `coupon_send_id`, `editor_id`, `editor_name`, `create_time`, `update_time`
</sql>
<sql id="Base_Column_List_With_Prefix">
t.`id`, t.`user_info_id`, t.`coupon_id`, t.`coupon_name`, t.`coupon_type`, t.`coupon_discount`, t.`coupon_start_date`, t.`coupon_end_date`, t.`coupon_use_state`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
t.`id`, t.`user_info_id`, t.`coupon_id`, t.`coupon_name`, t.`coupon_type`, t.`coupon_discount`, t.`coupon_start_date`, t.`coupon_end_date`, t.`coupon_use_state`, t.`coupon_send_id`, t.`editor_id`, t.`editor_name`, t.`create_time`, t.`update_time`
</sql>
<insert id="batchInsert">
insert into pms_user_coupon_info (
`user_info_id`, `coupon_id`, `coupon_name`, `coupon_type`, `coupon_discount`, `coupon_start_date`, `coupon_end_date`, `coupon_use_state`, `editor_id`, `editor_name`
`user_info_id`, `coupon_id`, `coupon_name`, `coupon_type`, `coupon_discount`, `coupon_start_date`, `coupon_end_date`, `coupon_use_state`, `coupon_send_id`, `editor_id`, `editor_name`
)
values
<foreach collection="records" item="record" separator=",">
(
#{record.userInfoId, jdbcType=BIGINT}, #{record.couponId, jdbcType=BIGINT}, #{record.couponName, jdbcType=VARCHAR}, #{record.couponType, jdbcType=VARCHAR}, #{record.couponDiscount, jdbcType=DECIMAL}, #{record.couponStartDate, jdbcType=TIMESTAMP}, #{record.couponEndDate, jdbcType=TIMESTAMP}, #{record.couponUseState, jdbcType=VARCHAR}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
#{record.userInfoId, jdbcType=BIGINT}, #{record.couponId, jdbcType=BIGINT}, #{record.couponName, jdbcType=VARCHAR}, #{record.couponType, jdbcType=VARCHAR}, #{record.couponDiscount, jdbcType=DECIMAL}, #{record.couponStartDate, jdbcType=TIMESTAMP}, #{record.couponEndDate, jdbcType=TIMESTAMP}, #{record.couponUseState, jdbcType=VARCHAR}, #{record.couponSendId, jdbcType=BIGINT}, #{record.editorId, jdbcType=BIGINT}, #{record.editorName, jdbcType=VARCHAR}
)
</foreach>
</insert>
......@@ -50,6 +51,7 @@
coupon_start_date = #{et.couponStartDate, jdbcType=TIMESTAMP},
coupon_end_date = #{et.couponEndDate, jdbcType=TIMESTAMP},
coupon_use_state = #{et.couponUseState, jdbcType=VARCHAR},
coupon_send_id = #{et.couponSendId, jdbcType=BIGINT},
editor_id = #{et.editorId, jdbcType=BIGINT},
editor_name = #{et.editorName, jdbcType=VARCHAR},
</trim>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论