Merge remote-tracking branch 'origin/jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支' into jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支

This commit is contained in:
HaoWang 2023-11-09 14:00:00 +08:00
commit 50ddc45c9f
31 changed files with 360 additions and 185 deletions

View File

@ -144,15 +144,12 @@ public class ResidentServiceApplyController extends BaseController {
@ApiOperation("服务评价列表") @ApiOperation("服务评价列表")
@GetMapping("/evaluateRecord/{identity}") @GetMapping("/evaluateRecord/{identity}")
public R<List<OrderEvaluateVo>> performanceEvaluateRecord(@PathVariable String identity) { public R<List<OrderEvaluateVo>> performanceEvaluateRecord(@PathVariable String identity, @RequestHeader("region") String region) {
PatientInfo patientInfo = residentPatientInfoService.getByCardNo(identity); String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/performance/recordV2/" + identity, null, String.class);
if (patientInfo != null && !StringUtils.isBlank(patientInfo.getCityCode())) { JSONObject jsonObject = JSONObject.parseObject(result);
String result = (String) httpService.get(SpringUtils.getFdUrl(patientInfo.getCityCode()) + "/performance/recordV2/" + identity, null, String.class); if (jsonObject.getInteger("code") == 1) {
JSONObject jsonObject = JSONObject.parseObject(result); if (jsonObject.get("data") != null && jsonObject.getJSONArray("data").size() > 0) {
if (jsonObject.getInteger("code") == 1) { return R.ok(JSONArray.parseArray(jsonObject.getJSONArray("data").toJSONString()).toJavaList(OrderEvaluateVo.class));
if (jsonObject.get("data") != null && jsonObject.getJSONArray("data").size() > 0) {
return R.ok(JSONArray.parseArray(jsonObject.getJSONArray("data").toJSONString()).toJavaList(OrderEvaluateVo.class));
}
} }
} }
return R.ok(); return R.ok();

View File

@ -249,8 +249,8 @@ xss:
# 家医配置 # 家医配置
fd: fd:
dz: http://8.131.93.145:54089/fd/mp dz: http://8.131.93.145:54007/fd/mp
dy: http://8.131.93.145:54089/fd/mp dy: http://8.131.93.145:54008/fd/mp
# 签约附近的机构多少公里内 <=0时不限制 # 签约附近的机构多少公里内 <=0时不限制
distance: 0 distance: 0
@ -281,15 +281,15 @@ applet-page-config:
# 首页跳转路径 # 首页跳转路径
page-url: pages/startup/startup page-url: pages/startup/startup
# 个人中心-优惠券页面跳转路径 # 个人中心-优惠券页面跳转路径
coupon-page-url: pages/coupon/coupon coupon-page-url: pagesB/coupon/coupon
# 商品订单页面跳转路径 # 商品订单页面跳转路径
goods-order-page-url: pages/CommodityOrder/CommodityOrder goods-order-page-url: pagesB/CommodityOrder/CommodityOrder
# 预约订单页面跳转路径 # 预约订单页面跳转路径
appoint-order-page-url: pages/Nursingstationserviceorder/Nursingstationserviceorder appoint-order-page-url: pagesB/Nursingstationserviceorder/Nursingstationserviceorder
# 积分页面跳转路径 # 积分页面跳转路径
integral-page-url: pages/integral/integral integral-page-url: pagesB/integral/integral
# 护理结构详情页面跳转路径 # 护理结构详情页面跳转路径
nursestation-details-page-url: pages/nursestation/nursestation nursestation-details-page-url: pagesB/nursestation/nursestation
# 新医路微信商户号配置参数 # 新医路微信商户号配置参数
xyl-we-chat-config: xyl-we-chat-config:

View File

@ -212,7 +212,7 @@ public class Constants {
/** /**
* 微信小程序ACCESS_TOKEN前缀 * 微信小程序ACCESS_TOKEN前缀
*/ */
public static final String NURSE_STATION_APPLET_ACCESS_TOKEN = "NURSE_STATION_APPLET_ACCESS_TOKEN"; public static final String NURSE_STATION_APPLET_ACCESS_TOKEN = "NURSE_STATION_APPLET_ACCESS_TOKEN_XYL_";
/** /**
* 护理员微信小程序ACCESS_TOKEN前缀 * 护理员微信小程序ACCESS_TOKEN前缀
@ -259,34 +259,34 @@ public class Constants {
*/ */
public static final String ATTRIBUTE_PICTURE_URL = "attributePitureUrl"; public static final String ATTRIBUTE_PICTURE_URL = "attributePitureUrl";
/** /**
* 筛查预约条码图片地址 * 筛查预约条码图片地址
*/ */
public static final String APPLY_BARCODE_PICTURE_URL = "applyBarcodePitureUrl"; public static final String APPLY_BARCODE_PICTURE_URL = "applyBarcodePitureUrl";
/** /**
* 筛查预约条码图片地址 * 筛查预约条码图片地址
*/ */
public static final String REGISTER_BARCODE_PICTURE_URL = "registerBarcodePitureUrl"; public static final String REGISTER_BARCODE_PICTURE_URL = "registerBarcodePitureUrl";
/** /**
* 血小板筛查图片地址 * 血小板筛查图片地址
*/ */
public static final String PLATELET_PICTURE_URL = "plateletPitureUrl"; public static final String PLATELET_PICTURE_URL = "plateletPitureUrl";
/** /**
* 眼底病变筛查左眼图片地址 * 眼底病变筛查左眼图片地址
*/ */
public static final String LEFT_EYE_PICTURE_URL = "leftEyePitureUrl"; public static final String LEFT_EYE_PICTURE_URL = "leftEyePitureUrl";
/** /**
* 眼底病变筛查右眼图片地址 * 眼底病变筛查右眼图片地址
*/ */
public static final String RIGHT_EYE_PICTURE_URL = "rightEyePitureUrl"; public static final String RIGHT_EYE_PICTURE_URL = "rightEyePitureUrl";
/** /**
* 阿尔兹海默症结果文件地址 * 阿尔兹海默症结果文件地址
*/ */
public static final String ALZHEIMER_FILE_URL = "alzheimerFileUrl"; public static final String ALZHEIMER_FILE_URL = "alzheimerFileUrl";
/** /**
* 护理站模板信息下载 * 护理站模板信息下载
*/ */

View File

@ -118,6 +118,11 @@ public class SysUser extends BaseEntity {
*/ */
private Long hospitalPersonId; private Long hospitalPersonId;
/**
* 医院主键
*/
private Long hospitalId;
/** /**
* 部门对象 * 部门对象
*/ */
@ -347,6 +352,14 @@ public class SysUser extends BaseEntity {
this.hospitalPersonId = hospitalPersonId; this.hospitalPersonId = hospitalPersonId;
} }
public Long getHospitalId() {
return hospitalId;
}
public void setHospitalId(Long hospitalId) {
this.hospitalId = hospitalId;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -39,20 +39,10 @@ import java.util.concurrent.TimeUnit;
@Component @Component
public class AppletChatUtil { public class AppletChatUtil {
private static RedisTemplate<String, Object> redisTemplate;
private static AppletChatConfig appletChatConfig;
@Resource @Resource
public void redisTemplate(RedisTemplate<String, Object> redisTemplate) { private RedisTemplate<String, Object> redisTemplate;
AppletChatUtil.redisTemplate = redisTemplate;
}
@Resource @Resource
public void appletChatConfig(AppletChatConfig appletChatConfig) { private AppletChatConfig appletChatConfig;
AppletChatUtil.appletChatConfig = appletChatConfig;
}
/** /**
* 返回成功状态码 * 返回成功状态码
@ -164,7 +154,7 @@ public class AppletChatUtil {
* @param filePathWeChatCodeUrl 文件保存路径 * @param filePathWeChatCodeUrl 文件保存路径
* @return java.lang.String 二维码地址 * @return java.lang.String 二维码地址
*/ */
public static String createAppletCode(Long weChatCodeId, boolean failFlag, String fileName, String appletPageUrl, String filePathWeChatCodeUrl) { public String createAppletCode(Long weChatCodeId, boolean failFlag, String fileName, String appletPageUrl, String filePathWeChatCodeUrl) {
if (BooleanUtils.isTrue(failFlag)) { if (BooleanUtils.isTrue(failFlag)) {
//删除原有Redis中的key值 //删除原有Redis中的key值
String accessTokenKey = Constants.NURSE_STATION_APPLET_ACCESS_TOKEN + "accessToken"; String accessTokenKey = Constants.NURSE_STATION_APPLET_ACCESS_TOKEN + "accessToken";
@ -250,7 +240,7 @@ public class AppletChatUtil {
* *
* @return 小程序的AccessToken * @return 小程序的AccessToken
*/ */
public static String getAppletAccessToken() { public String getAppletAccessToken() {
String accessToken; String accessToken;
String accessTokenKey = Constants.NURSE_STATION_APPLET_ACCESS_TOKEN + "accessToken"; String accessTokenKey = Constants.NURSE_STATION_APPLET_ACCESS_TOKEN + "accessToken";
//从Redis中取出accessToken //从Redis中取出accessToken

View File

@ -239,8 +239,6 @@ public class PatientInfoBody extends BaseEntity {
/** /**
* 绑定城市(1德州 2东营) * 绑定城市(1德州 2东营)
*/ */
@NotNull(message = "绑定城市不能为空")
@NotBlank(message = "绑定城市不能为空")
@ApiModelProperty(value = "绑定城市(1德州 2东营)") @ApiModelProperty(value = "绑定城市(1德州 2东营)")
private String cityCode; private String cityCode;

View File

@ -1,5 +1,6 @@
package com.xinelu.familydoctor.applet.pojo.body; package com.xinelu.familydoctor.applet.pojo.body;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.familydoctor.applet.pojo.dto.ResidentServiceFormApplyDto; import com.xinelu.familydoctor.applet.pojo.dto.ResidentServiceFormApplyDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -47,19 +48,20 @@ public class ResidentServiceApplyBody extends ResidentServiceFormApplyDto{
* 预约时间 * 预约时间
*/ */
@ApiModelProperty(value = "预约时间", required = true) @ApiModelProperty(value = "预约时间", required = true)
@JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date bookingTime; private Date bookingTime;
/** /**
* 预约机构编号 * 预约机构编号
*/ */
@ApiModelProperty(value = "预约机构编号", required = true) @ApiModelProperty(value = "预约机构编号", required = true)
private String orgNo; private String hospitalId;
/** /**
* 预约机构名称 * 预约机构名称
*/ */
@ApiModelProperty(value = "预约机构名称", required = true) @ApiModelProperty(value = "预约机构名称", required = true)
private String orgName; private String hospitalName;
/** /**
* 预约团队编号 * 预约团队编号

View File

@ -4,36 +4,39 @@ import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.config.AppletChatConfig; import com.xinelu.common.config.AppletChatConfig;
import com.xinelu.common.entity.AppletPhoneVO; import com.xinelu.common.entity.AppletPhoneVO;
import com.xinelu.common.enums.CouponReceiveTypeEnum;
import com.xinelu.common.enums.CouponUseStatusEnum;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.bean.BeanUtils; import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.http.HttpService; import com.xinelu.common.utils.http.HttpService;
import com.xinelu.common.utils.http.HttpUtils; import com.xinelu.common.utils.http.HttpUtils;
import com.xinelu.common.utils.http.SslUtils; import com.xinelu.common.utils.http.SslUtils;
import com.xinelu.common.utils.spring.SpringUtils;
import com.xinelu.common.utils.uuid.IdUtils; import com.xinelu.common.utils.uuid.IdUtils;
import com.xinelu.familydoctor.applet.mapper.ResidentPatientInfoMapper; import com.xinelu.familydoctor.applet.mapper.ResidentPatientInfoMapper;
import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody; import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody;
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo; import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
import com.xinelu.familydoctor.applet.pojo.query.PatientInfoQuery;
import com.xinelu.familydoctor.applet.pojo.vo.SignInfoDetailVo;
import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService; import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService;
import com.xinelu.familydoctor.applet.utils.AppletAccessTokenUtils; import com.xinelu.familydoctor.applet.utils.AppletAccessTokenUtils;
import com.xinelu.manage.domain.coupon.Coupon;
import com.xinelu.manage.domain.patientcouponreceive.PatientCouponReceive;
import com.xinelu.manage.domain.receiveAddressInfo.ReceiveAddressInfo; import com.xinelu.manage.domain.receiveAddressInfo.ReceiveAddressInfo;
import com.xinelu.manage.mapper.coupon.CouponMapper;
import com.xinelu.manage.mapper.patientcouponreceive.PatientCouponReceiveMapper;
import com.xinelu.manage.mapper.receiveAddressInfo.ReceiveAddressInfoMapper; import com.xinelu.manage.mapper.receiveAddressInfo.ReceiveAddressInfoMapper;
import com.xinelu.manage.vo.patientcouponreceive.PatientCouponReceiveInfoVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Arrays; import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -58,6 +61,10 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
private RedisTemplate<String, Object> redisTemplate; private RedisTemplate<String, Object> redisTemplate;
@Resource @Resource
private ReceiveAddressInfoMapper receiveAddressInfoMapper; private ReceiveAddressInfoMapper receiveAddressInfoMapper;
@Resource
private PatientCouponReceiveMapper patientCouponReceiveMapper;
@Resource
private CouponMapper couponMapper;
/** /**
* @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo * @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo
@ -192,10 +199,9 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
} else { } else {
patientInfo.setDisease("0"); patientInfo.setDisease("0");
} }
patientInfo.setLoginFlag(Long.valueOf(1)); patientInfo.setLoginFlag(1L);
patientInfo.setBindOpenid(body.getOpenid()); patientInfo.setBindOpenid(body.getOpenid());
updatePatientInfo(patientInfo); updatePatientInfo(patientInfo);
// 新增 // 新增
} else { } else {
patientInfo = residentPatientInfoMapper.isRegisterByCardNo(body.getCardNo()); patientInfo = residentPatientInfoMapper.isRegisterByCardNo(body.getCardNo());
@ -216,7 +222,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
patientInfo.setUpdateBy(body.getCardNo()); patientInfo.setUpdateBy(body.getCardNo());
patientInfo.setHeadPictureUrl(body.getHeadPictureUrl()); patientInfo.setHeadPictureUrl(body.getHeadPictureUrl());
patientInfo.setDelFlag(0); patientInfo.setDelFlag(0);
patientInfo.setLoginFlag(Long.valueOf(1)); patientInfo.setLoginFlag(1L);
if (body.getDiseaseList() != null) { if (body.getDiseaseList() != null) {
patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(","))); patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(",")));
} else { } else {
@ -229,6 +235,10 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
} }
// 注册 // 注册
} else { } else {
List<PatientInfo> list = residentPatientInfoMapper.getList(body.getOpenid(), null);
if(list != null && list.size() >= 8) {
throw new ServiceException("同一个微信最多绑定8个居民");
}
PatientInfo entity = new PatientInfo(); PatientInfo entity = new PatientInfo();
BeanUtils.copyBeanProp(entity, body); BeanUtils.copyBeanProp(entity, body);
// 已绑定openid将该值置空 // 已绑定openid将该值置空
@ -245,7 +255,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
entity.setIsChecked("0"); entity.setIsChecked("0");
entity.setCreateTime(new Date()); entity.setCreateTime(new Date());
entity.setCreateBy(body.getCardNo()); entity.setCreateBy(body.getCardNo());
entity.setLoginFlag(Long.valueOf(1)); entity.setLoginFlag(1L);
entity.setDelFlag(0); entity.setDelFlag(0);
entity.setBindOpenid(body.getOpenid()); entity.setBindOpenid(body.getOpenid());
residentPatientInfoMapper.insertPatientInfo(entity); residentPatientInfoMapper.insertPatientInfo(entity);
@ -264,6 +274,15 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
} }
this.insertReceiveAddress(patientInfo); this.insertReceiveAddress(patientInfo);
} }
PatientInfo patient = residentPatientInfoMapper.getLoginByOpenId(body.getOpenid());
//判断是否是第一次完善如果是则发放新人优惠券信息
PatientCouponReceive patientCouponReceive = new PatientCouponReceive();
patientCouponReceive.setReceiveSource(CouponReceiveTypeEnum.NEW_PEOPLE_WELFARE.getInfo());
patientCouponReceive.setPatientId(patient.getId());
int couponReceiveCount = patientCouponReceiveMapper.getCouponReceiveByReceiveSource(patient.getId(), CouponReceiveTypeEnum.NEW_PEOPLE_WELFARE.getInfo());
if (Objects.nonNull(patient.getLoginFlag()) && patient.getLoginFlag() ==1 && couponReceiveCount <= 0) {
issueCoupons(patient);
}
} }
/** 新增收货人地址信息 */ /** 新增收货人地址信息 */
@ -450,4 +469,50 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
HashMap.put("cityCode", cityCode); HashMap.put("cityCode", cityCode);
return HashMap; return HashMap;
} }
/**
* 发放优惠券方法胡
*
* @param patient 会员信息
*/
public void issueCoupons(PatientInfo patient ) {
PatientCouponReceiveInfoVO receiveInfoVO = new PatientCouponReceiveInfoVO();
//查询新人福利的优惠券列表信息
Coupon coupon = new Coupon();
Long patientId = patient.getId();
coupon.setReceiveType(CouponReceiveTypeEnum.NEW_PEOPLE_WELFARE.getInfo());
List<Coupon> couponList = couponMapper.selectCouponList(coupon);
if (CollectionUtils.isEmpty(couponList)) {
return ;
}
//组装优惠券信息
List<PatientCouponReceive> couponReceiveList = Lists.newArrayList();
for (Coupon couponInfo : couponList) {
if (Objects.isNull(couponInfo.getId())) {
continue;
}
PatientCouponReceive couponReceive = new PatientCouponReceive();
couponReceive.setPatientId(patientId);
couponReceive.setCouponId(couponInfo.getId());
couponReceive.setReceiveSource(CouponReceiveTypeEnum.NEW_PEOPLE_WELFARE.getInfo());
couponReceive.setUseStatus(CouponUseStatusEnum.WAIT_RECEIVE.getInfo());
couponReceive.setExpirationStartTime(LocalDateTime.now());
couponReceive.setExpirationEndTime(LocalDate.now().plusDays(Objects.isNull(couponInfo.getCouponReductionDays()) ? 0 : couponInfo.getCouponReductionDays()).atTime(23, 59, 59));
couponReceive.setReceiveTime(LocalDateTime.now());
couponReceive.setCouponReductionDays(Objects.isNull(couponInfo.getCouponReductionDays()) ? 0 : couponInfo.getCouponReductionDays());
couponReceive.setCreateTime(LocalDateTime.now());
couponReceive.setCouponTitle(StringUtils.isBlank(couponInfo.getCouponTitle()) ? "" : couponInfo.getCouponTitle());
couponReceive.setCouponPrice(Objects.isNull(couponInfo.getCouponPrice()) ? BigDecimal.ZERO : couponInfo.getCouponPrice());
couponReceive.setCouponConsumePrice(Objects.isNull(couponInfo.getCouponConsumePrice()) ? BigDecimal.ZERO : couponInfo.getCouponConsumePrice());
couponReceive.setCouponDescription(StringUtils.isBlank(couponInfo.getCouponDescription()) ? "" : couponInfo.getCouponDescription());
couponReceiveList.add(couponReceive);
}
if (CollectionUtils.isNotEmpty(couponReceiveList)) {
int insertCount = patientCouponReceiveMapper.insertBatchPatientReceive(couponReceiveList);
if (insertCount <= 0) {
log.error("完善用户信息接口-新人送券执行失败,输入参数[{}]", couponReceiveList);
throw new ServiceException("完善用户信息失败,请联系管理员!");
}
}
}
} }

View File

@ -88,6 +88,8 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
// 审批状态0:待批准 1:已同意 2:已拒绝 // 审批状态0:待批准 1:已同意 2:已拒绝
entity.setApprovalStatus("0"); entity.setApprovalStatus("0");
entity.setBookingNo(IdUtils.simpleUUID()); entity.setBookingNo(IdUtils.simpleUUID());
entity.setOrgNo(body.getHospitalId());
entity.setOrgName(body.getHospitalName());
if(StringUtils.isBlank(entity.getServiceWay())) { if(StringUtils.isBlank(entity.getServiceWay())) {
entity.setServiceWay("2"); entity.setServiceWay("2");
} }
@ -101,7 +103,7 @@ public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletSe
messagePushBody.setBusType("10"); messagePushBody.setBusType("10");
messagePushBody.setOpenid(patientInfo.getBindOpenid()); messagePushBody.setOpenid(patientInfo.getBindOpenid());
messagePushBody.setReceiveName(patientInfo.getPatientName()); messagePushBody.setReceiveName(patientInfo.getPatientName());
messagePushBody.setText1(body.getOrgName()); messagePushBody.setText1(body.getHospitalName());
messagePushBody.setText2(body.getFormName().length() >= 20? body.getFormName().substring(0,17) + "...": body.getFormName()); messagePushBody.setText2(body.getFormName().length() >= 20? body.getFormName().substring(0,17) + "...": body.getFormName());
messagePushBody.setText3(body.getFormName()); messagePushBody.setText3(body.getFormName());
messagePushBody.setSendTitle("服务预约"); messagePushBody.setSendTitle("服务预约");

View File

@ -1,6 +1,7 @@
package com.xinelu.framework.aspectj; package com.xinelu.framework.aspectj;
import com.xinelu.common.annotation.DataScope; import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.core.domain.BaseEntity; import com.xinelu.common.core.domain.BaseEntity;
import com.xinelu.common.core.domain.entity.SysRole; import com.xinelu.common.core.domain.entity.SysRole;
import com.xinelu.common.core.domain.entity.SysUser; import com.xinelu.common.core.domain.entity.SysUser;
@ -86,20 +87,21 @@ public class DataScopeAspect {
break; break;
} else if (DATA_SCOPE_CUSTOM.equals(dataScope)) { } else if (DATA_SCOPE_CUSTOM.equals(dataScope)) {
sqlString.append(StringUtils.format( sqlString.append(StringUtils.format(
" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, " OR {}.hospital_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias,
role.getRoleId())); role.getRoleId()));
} else if (DATA_SCOPE_DEPT.equals(dataScope)) { } else if (DATA_SCOPE_DEPT.equals(dataScope)) {
sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId())); sqlString.append(StringUtils.format(" OR {}.hospital_id = {} ", deptAlias, user.getHospitalId()));
} else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) { } else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) {
sqlString.append(StringUtils.format( //sqlString.append(StringUtils.format(
" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", // " OR {}.hospital_id IN ( SELECT hospital_id FROM hospital_info WHERE hospital_id = {} or find_in_set( {} , ancestors ) )",
deptAlias, user.getDeptId(), user.getDeptId())); // deptAlias, user.getHospitalId(), user.getHospitalId()));
sqlString.append(StringUtils.format(" OR {}.hospital_id = {} ", deptAlias, user.getHospitalId()));
} else if (DATA_SCOPE_SELF.equals(dataScope)) { } else if (DATA_SCOPE_SELF.equals(dataScope)) {
if (StringUtils.isNotBlank(userAlias)) { if (StringUtils.isNotBlank(userAlias)) {
sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId())); sqlString.append(StringUtils.format(" OR {}.doctor_id = {} ", userAlias, user.getUserId()));
} else { } else {
// 数据权限为仅本人且没有userAlias别名不查询任何数据 // 数据权限为仅本人且没有userAlias别名不查询任何数据
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias)); sqlString.append(StringUtils.format(" OR {}.hospital_id = 0 ", deptAlias));
} }
} }
} }
@ -110,6 +112,10 @@ public class DataScopeAspect {
BaseEntity baseEntity = (BaseEntity) params; BaseEntity baseEntity = (BaseEntity) params;
baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")"); baseEntity.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
} }
if (StringUtils.isNotNull(params) && params instanceof BaseDomain) {
BaseDomain baseDomain = (BaseDomain) params;
baseDomain.getParams().put(DATA_SCOPE, " AND (" + sqlString.substring(4) + ")");
}
} }
} }

View File

@ -3,11 +3,17 @@ package com.xinelu.applet.controller.appletscreeningproject;
import com.xinelu.common.core.controller.BaseController; import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.R; import com.xinelu.common.core.domain.R;
import com.xinelu.manage.domain.screeningproject.ScreeningProject; import com.xinelu.manage.domain.screeningproject.ScreeningProject;
import com.xinelu.manage.service.screeningproject.IScreeningProjectService; import com.xinelu.manage.dto.screeningrecord.ScreeningRecordDTO;
import com.xinelu.manage.service.screeningrecord.IScreeningRecordService;
import com.xinelu.manage.vo.screeningrecord.ScreeningRecordVo;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -22,12 +28,29 @@ import org.springframework.web.bind.annotation.RestController;
@Api(tags = "项目控制器-小程序") @Api(tags = "项目控制器-小程序")
public class AppletScreeningProjectController extends BaseController { public class AppletScreeningProjectController extends BaseController {
@Resource @Resource
private IScreeningProjectService projectService; private IScreeningRecordService screeningRecordService;
@ApiOperation("筛查项目列表") @ApiOperation("筛查项目列表")
@GetMapping("list") @GetMapping("list")
public R<List<ScreeningProject>> list(ScreeningProject project) { public R<List<ScreeningProject>> list(ScreeningRecordDTO query) {
List<ScreeningProject> list = projectService.findList(project); // 查询居民预约过的项目
return R.ok(list); List<ScreeningProject> projectList = new ArrayList<>();
query.setScreeningType("1");
List<ScreeningRecordVo> recordList = screeningRecordService.list(query);
if (CollectionUtils.isNotEmpty(recordList)) {
// 按照项目进行分组
Map<String, List<ScreeningRecordVo>> groupByProject = recordList.stream()
.collect(Collectors.groupingBy(ScreeningRecordVo::getProjectId));
for (String projectId : groupByProject.keySet()) {
ScreeningProject project = new ScreeningProject();
project.setProjectId(projectId);
project.setProjectName(groupByProject.get(projectId).get(0).getProjectName());
project.setHospitalId(groupByProject.get(projectId).get(0).getHospitalId());
project.setHospitalName(groupByProject.get(projectId).get(0).getHospitalName());
projectList.add(project);
}
}
return R.ok(projectList);
} }
} }

View File

@ -20,13 +20,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
/** /**
@ -102,13 +96,14 @@ public class ChatRecordController extends BaseController {
@ApiOperation(value = "获取指定类型的消息记录", notes = "1通知公告 2健康推送 4消息通知") @ApiOperation(value = "获取指定类型的消息记录", notes = "1通知公告 2健康推送 4消息通知")
@GetMapping("/getMegList") @GetMapping("/getMegList")
public TableDataInfo getMegList(MessageSearchDto messageDto) { public TableDataInfo getMegList(MessageSearchDto messageDto, @RequestHeader("region") String region) {
if (messageDto.getPatientId() == null) { if (messageDto.getPatientId() == null) {
throw new ServiceException("居民业务主键不能为空"); throw new ServiceException("居民业务主键不能为空");
} }
if (StringUtils.isBlank(messageDto.getMessageCategory())) { if (StringUtils.isBlank(messageDto.getMessageCategory())) {
throw new ServiceException("消息类型不能为空"); throw new ServiceException("消息类型不能为空");
} }
messageDto.setCityCode(region);
startPage(); startPage();
return getDataTable(chatRecordService.getMegList(messageDto)); return getDataTable(chatRecordService.getMegList(messageDto));
} }

View File

@ -9,12 +9,10 @@ import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo; import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.custominterface.Query; import com.xinelu.common.custominterface.Query;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.StringUtils;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -91,11 +89,11 @@ public class NurseAppLoginController extends BaseController {
*/ */
@MobileRequestAuthorization @MobileRequestAuthorization
@GetMapping("/appPersonal") @GetMapping("/appPersonal")
public AjaxResult nurseAppPersonal(Long patientId) { public AjaxResult nurseAppPersonal(Long patientId, @RequestHeader("region") String region) {
if (Objects.isNull(patientId)) { if (Objects.isNull(patientId)) {
return AjaxResult.error("用户信息不能为空!"); return AjaxResult.error("用户信息不能为空!");
} }
return nurseAppLoginService.nurseAppPersonal(patientId); return nurseAppLoginService.nurseAppPersonal(patientId, region);
} }
/** /**
@ -128,4 +126,4 @@ public class NurseAppLoginController extends BaseController {
} }
return nurseAppLoginService.updateAppointmentOrder(appointmentOrderId, cancelAppointmentReason); return nurseAppLoginService.updateAppointmentOrder(appointmentOrderId, cancelAppointmentReason);
} }
} }

View File

@ -44,7 +44,7 @@ public interface NurseAppLoginService {
* @param patientId 会员id * @param patientId 会员id
* @return 结果 * @return 结果
*/ */
AjaxResult nurseAppPersonal(Long patientId); AjaxResult nurseAppPersonal(Long patientId, String region);
/** /**
* App查询预约服务订单 * App查询预约服务订单

View File

@ -180,7 +180,7 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
* @return 结果 * @return 结果
*/ */
@Override @Override
public AjaxResult nurseAppPersonal(Long patientId) { public AjaxResult nurseAppPersonal(Long patientId, String region) {
PatientAndDiseaseVO patientDisease = nurseAppLoginMapper.getPatientDiseaseByPatientId(patientId); PatientAndDiseaseVO patientDisease = nurseAppLoginMapper.getPatientDiseaseByPatientId(patientId);
if (Objects.nonNull(patientDisease) && Objects.nonNull(patientDisease.getBirthDate())) { if (Objects.nonNull(patientDisease) && Objects.nonNull(patientDisease.getBirthDate())) {
patientDisease.setAge(AgeUtil.getAgeMonth(String.valueOf(patientDisease.getBirthDate()))); patientDisease.setAge(AgeUtil.getAgeMonth(String.valueOf(patientDisease.getBirthDate())));
@ -205,6 +205,7 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
} else { } else {
patientDisease.setAreaName(""); patientDisease.setAreaName("");
} }
patientDisease.setCityCode(region);
// 更新签约编号 // 更新签约编号
setSignInfo(patientDisease); setSignInfo(patientDisease);
//查询所有商品订单 //查询所有商品订单
@ -287,4 +288,4 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
} }
return AjaxResult.success(); return AjaxResult.success();
} }
} }

View File

@ -162,28 +162,35 @@ public class NursingOrderServiceImpl implements INursingOrderService {
if (CollectionUtils.isNotEmpty(goodsOrderAndConsultationOrder)) { if (CollectionUtils.isNotEmpty(goodsOrderAndConsultationOrder)) {
patientOrders.addAll(goodsOrderAndConsultationOrder); patientOrders.addAll(goodsOrderAndConsultationOrder);
} }
String result = HttpUtils.sendGet(SpringUtils.getFdUrl(nurseOrder.getRegion()) + "/performance/recordV2/" + nurseOrder.getCardNo()); PatientOrderVO resultHttp = new PatientOrderVO();
if (StringUtils.isBlank(result)) { if (Objects.nonNull(nurseOrder.getRegion())) {
log.info("获取家医小程序用户订单信息失败result = " + result); try {
} String result = HttpUtils.sendGet(SpringUtils.getFdUrl(nurseOrder.getRegion()) + "/performance/recordV2/" + nurseOrder.getCardNo());
PatientOrderVO resultHttp = JSON.parseObject(result, PatientOrderVO.class); if (StringUtils.isBlank(result)) {
if (Objects.nonNull(resultHttp) && CollectionUtils.isNotEmpty(resultHttp.getData()) && Objects.nonNull(resultHttp.getData().get(0).getOrderNo())) { log.info("获取家医小程序用户订单信息失败result = " + result);
List<PatientOrder> data = resultHttp.getData();
data.forEach(item -> item.setOrderSource(OrderSourceEnum.FAMILY_DOCTOR.getInfo()));
List<PatientOrder> orderEvaluate = nursingOrderMapper.getOrderEvaluateByPatientId(nurseOrder.getParentId());
if (CollectionUtils.isNotEmpty(orderEvaluate) && EVALUATED.equals(nurseOrder.getOrderStatus())) {
for (PatientOrder patientOrder : orderEvaluate) {
PatientOrder dataFirst = data.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getOrderNo()) && patientOrder.getOrderNo().equals(item.getOrderNo())).findFirst().orElse(new PatientOrder());
dataFirst.setCompositeScore(patientOrder.getCompositeScore());
patientOrders.add(dataFirst);
} }
resultHttp = JSON.parseObject(result, PatientOrderVO.class);
} catch (Exception e) {
log.error("查询家医履约评价记录异常: " + e.getMessage());
} }
if (CollectionUtils.isNotEmpty(orderEvaluate) && NOT_EVALUATED.equals(nurseOrder.getOrderStatus())) { if (Objects.nonNull(resultHttp) && CollectionUtils.isNotEmpty(resultHttp.getData()) && Objects.nonNull(resultHttp.getData().get(0).getOrderNo())) {
Collection<PatientOrder> subtract = CollectionUtils.subtract(data, orderEvaluate); List<PatientOrder> data = resultHttp.getData();
patientOrders.addAll(subtract); data.forEach(item -> item.setOrderSource(OrderSourceEnum.FAMILY_DOCTOR.getInfo()));
} List<PatientOrder> orderEvaluate = nursingOrderMapper.getOrderEvaluateByPatientId(nurseOrder.getParentId());
if (CollectionUtils.isEmpty(orderEvaluate) && NOT_EVALUATED.equals(nurseOrder.getOrderStatus())) { if (CollectionUtils.isNotEmpty(orderEvaluate) && EVALUATED.equals(nurseOrder.getOrderStatus())) {
patientOrders.addAll(data); for (PatientOrder patientOrder : orderEvaluate) {
PatientOrder dataFirst = data.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getOrderNo()) && patientOrder.getOrderNo().equals(item.getOrderNo())).findFirst().orElse(new PatientOrder());
dataFirst.setCompositeScore(patientOrder.getCompositeScore());
patientOrders.add(dataFirst);
}
}
if (CollectionUtils.isNotEmpty(orderEvaluate) && NOT_EVALUATED.equals(nurseOrder.getOrderStatus())) {
Collection<PatientOrder> subtract = CollectionUtils.subtract(data, orderEvaluate);
patientOrders.addAll(subtract);
}
if (CollectionUtils.isEmpty(orderEvaluate) && NOT_EVALUATED.equals(nurseOrder.getOrderStatus())) {
patientOrders.addAll(data);
}
} }
} }
TableDataInfo rspData = new TableDataInfo(); TableDataInfo rspData = new TableDataInfo();
@ -197,4 +204,4 @@ public class NursingOrderServiceImpl implements INursingOrderService {
rspData.setMsg("查询成功"); rspData.setMsg("查询成功");
return rspData; return rspData;
} }
} }

View File

@ -6,7 +6,6 @@ import com.xinelu.applet.dto.patientcenter.PatientCenterCouponDTO;
import com.xinelu.applet.mapper.nurseapplogin.NurseAppLoginMapper; import com.xinelu.applet.mapper.nurseapplogin.NurseAppLoginMapper;
import com.xinelu.applet.mapper.nursingstationgoods.NursingStationGoodsMapper; import com.xinelu.applet.mapper.nursingstationgoods.NursingStationGoodsMapper;
import com.xinelu.applet.mapper.patientcenter.PatientCenterMapper; import com.xinelu.applet.mapper.patientcenter.PatientCenterMapper;
import com.xinelu.manage.service.messagepush.MessagePushService;
import com.xinelu.applet.service.patientcenter.PatientCenterService; import com.xinelu.applet.service.patientcenter.PatientCenterService;
import com.xinelu.applet.vo.coupon.CouponVO; import com.xinelu.applet.vo.coupon.CouponVO;
import com.xinelu.applet.vo.patientcenter.PatientCenterCouponVO; import com.xinelu.applet.vo.patientcenter.PatientCenterCouponVO;
@ -43,6 +42,7 @@ import com.xinelu.manage.mapper.patientintegralchange.PatientIntegralChangeMappe
import com.xinelu.manage.mapper.patientsignininfo.PatientSignInInfoMapper; import com.xinelu.manage.mapper.patientsignininfo.PatientSignInInfoMapper;
import com.xinelu.manage.mapper.subscribemessagerecord.SubscribeMessageRecordMapper; import com.xinelu.manage.mapper.subscribemessagerecord.SubscribeMessageRecordMapper;
import com.xinelu.manage.mapper.systemsettingsinfo.SystemSettingsInfoMapper; import com.xinelu.manage.mapper.systemsettingsinfo.SystemSettingsInfoMapper;
import com.xinelu.manage.service.messagepush.MessagePushService;
import com.xinelu.manage.vo.patientcouponreceive.PatientCouponReceiveInfoVO; import com.xinelu.manage.vo.patientcouponreceive.PatientCouponReceiveInfoVO;
import com.xinelu.manage.vo.patientinfo.PatientInfoVO; import com.xinelu.manage.vo.patientinfo.PatientInfoVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -108,7 +108,8 @@ public class PatientCenterServiceImpl implements PatientCenterService {
private SubscribeMessageRecordMapper subscribeMessageRecordMapper; private SubscribeMessageRecordMapper subscribeMessageRecordMapper;
@Resource @Resource
private MessagePushService messagePushService; private MessagePushService messagePushService;
@Resource
private AppletChatUtil appletChatUtil;
/** /**
* 用户第一次签到次数 * 用户第一次签到次数
*/ */
@ -262,10 +263,10 @@ public class PatientCenterServiceImpl implements PatientCenterService {
String appletPageUrl = appletPageConfig.getPageUrl(); String appletPageUrl = appletPageConfig.getPageUrl();
//邀请人二维码存放路径 //邀请人二维码存放路径
String filePathWeChatCodeUrl = xinYiLuConfig.getPersonalWeChatCodeUrl(); String filePathWeChatCodeUrl = xinYiLuConfig.getPersonalWeChatCodeUrl();
String appletCodePicture = AppletChatUtil.createAppletCode(inviteId, false, fileName, appletPageUrl, filePathWeChatCodeUrl); String appletCodePicture = appletChatUtil.createAppletCode(inviteId, false, fileName, appletPageUrl, filePathWeChatCodeUrl);
if (StringUtils.isNotBlank(appletCodePicture) && StringUtils.equals(FAIL, appletCodePicture)) { if (StringUtils.isNotBlank(appletCodePicture) && StringUtils.equals(FAIL, appletCodePicture)) {
//第一次调用获取小程序二维码信息失败重新递归调用一次第二次失败直接返回提示信息 //第一次调用获取小程序二维码信息失败重新递归调用一次第二次失败直接返回提示信息
appletCodePicture = AppletChatUtil.createAppletCode(inviteId, true, fileName, appletPageUrl, filePathWeChatCodeUrl); appletCodePicture = appletChatUtil.createAppletCode(inviteId, true, fileName, appletPageUrl, filePathWeChatCodeUrl);
if (StringUtils.isNotBlank(appletCodePicture) && StringUtils.equals(FAIL, appletCodePicture)) { if (StringUtils.isNotBlank(appletCodePicture) && StringUtils.equals(FAIL, appletCodePicture)) {
return AjaxResult.error("获取小程序二维码信息失败,请联系管理员!"); return AjaxResult.error("获取小程序二维码信息失败,请联系管理员!");
} }

View File

@ -54,6 +54,12 @@ public class HospitalInfoController extends BaseController {
@PreAuthorize("@ss.hasPermi('system:hospital:list')") @PreAuthorize("@ss.hasPermi('system:hospital:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(HospitalInfo hospitalInfo) { public TableDataInfo list(HospitalInfo hospitalInfo) {
if (!getLoginUser().getUser().isAdmin()) {
HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoService.selectHospitalPersonInfoById(getLoginUser().getUser().getHospitalPersonId());
if (hospitalPersonInfo != null) {
hospitalInfo.setId(hospitalPersonInfo.getHospitalId());
}
}
startPage(); startPage();
List<HospitalInfo> list = hospitalInfoService.selectHospitalInfoList(hospitalInfo); List<HospitalInfo> list = hospitalInfoService.selectHospitalInfoList(hospitalInfo);
return getDataTable(list); return getDataTable(list);
@ -65,7 +71,6 @@ public class HospitalInfoController extends BaseController {
@ApiOperation("查询医院信息管理列表") @ApiOperation("查询医院信息管理列表")
@GetMapping("/getList") @GetMapping("/getList")
public AjaxResult getList(HospitalInfo hospitalInfo) { public AjaxResult getList(HospitalInfo hospitalInfo) {
// TODO 根据用户权限获取医院列表机构管理员只能看自己机构,超级管理员查看所有
if (!getLoginUser().getUser().isAdmin()) { if (!getLoginUser().getUser().isAdmin()) {
HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoService.selectHospitalPersonInfoById(getLoginUser().getUser().getHospitalPersonId()); HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoService.selectHospitalPersonInfoById(getLoginUser().getUser().getHospitalPersonId());
if (hospitalPersonInfo != null) { if (hospitalPersonInfo != null) {

View File

@ -15,13 +15,18 @@ import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService;
import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO; import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize; import java.util.List;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/** /**
* 健康咨询-科室人员信息Controller * 健康咨询-科室人员信息Controller

View File

@ -63,4 +63,7 @@ public class MessageSearchDto {
@ApiModelProperty(value = "通知适用人群编号集合", hidden = true) @ApiModelProperty(value = "通知适用人群编号集合", hidden = true)
private List<String> crowdNoList; private List<String> crowdNoList;
@ApiModelProperty("城市编码(1德州 2东营)")
private String cityCode;
} }

View File

@ -127,4 +127,12 @@ public interface PatientCouponReceiveMapper {
* @return 会员用户优惠券领取记录 * @return 会员用户优惠券领取记录
*/ */
PatientCouponReceiveInfoVO selectPatientCouponReceive(@Param("patientId") Long patientId, @Param("couponId") Long couponId); PatientCouponReceiveInfoVO selectPatientCouponReceive(@Param("patientId") Long patientId, @Param("couponId") Long couponId);
/**
*
* @param patientId 用户id
* @param receiveSource 优惠券状态
* @return int
*/
int getCouponReceiveByReceiveSource(@Param("patientId") Long patientId, @Param("receiveSource") String receiveSource);
} }

View File

@ -255,7 +255,7 @@ public class ChatRecordServiceImpl implements IChatRecordService {
return chatRecordMapper.selectMegList(messageDto); return chatRecordMapper.selectMegList(messageDto);
// 健康推送 // 健康推送
} else if(messageDto.getMessageCategory().equals("2")) { } else if(messageDto.getMessageCategory().equals("2")) {
String result = (String) httpService.get(SpringUtils.getFdUrl(patientInfo.getCityCode()) + "/resident/signinfo/detail/" + patientInfo.getCardNo(), null, String.class); String result = (String) httpService.get(SpringUtils.getFdUrl(messageDto.getCityCode()) + "/resident/signinfo/detail/" + patientInfo.getCardNo(), null, String.class);
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
if (!"1".equals(jsonObject.get("code"))) { if (!"1".equals(jsonObject.get("code"))) {
throw new ServiceException(jsonObject.get("msg").toString()); throw new ServiceException(jsonObject.get("msg").toString());

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.service.hospitaldepartmentinfo.impl; package com.xinelu.manage.service.hospitaldepartmentinfo.impl;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.constant.Constants; import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.exception.ServiceException; import com.xinelu.common.exception.ServiceException;
@ -55,6 +56,7 @@ public class HospitalDepartmentInfoServiceImpl implements IHospitalDepartmentInf
* @return 科室信息管理 * @return 科室信息管理
*/ */
@Override @Override
@DataScope(deptAlias = "d")
public List<HospitalDepartmentInfo> selectHospitalDepartmentInfoList(HospitalDepartmentInfo hospitalDepartmentInfo) { public List<HospitalDepartmentInfo> selectHospitalDepartmentInfoList(HospitalDepartmentInfo hospitalDepartmentInfo) {
return hospitalDepartmentInfoMapper.selectHospitalDepartmentInfoList(hospitalDepartmentInfo); return hospitalDepartmentInfoMapper.selectHospitalDepartmentInfoList(hospitalDepartmentInfo);
} }

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.service.hospitalpersoninfo.impl; package com.xinelu.manage.service.hospitalpersoninfo.impl;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.config.XinELuConfig; import com.xinelu.common.config.XinELuConfig;
import com.xinelu.common.constant.Constants; import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.domain.AjaxResult; import com.xinelu.common.core.domain.AjaxResult;
@ -72,6 +73,7 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService
* @return 健康咨询-科室人员信息 * @return 健康咨询-科室人员信息
*/ */
@Override @Override
@DataScope(deptAlias = "hpi", userAlias = "u")
public List<HospitalPersonInfoVO> selectHospitalPersonInfoList(HospitalPersonInfoVO hospitalPersonInfo) { public List<HospitalPersonInfoVO> selectHospitalPersonInfoList(HospitalPersonInfoVO hospitalPersonInfo) {
return hospitalPersonInfoMapper.selectHospitalPersonInfoList(hospitalPersonInfo); return hospitalPersonInfoMapper.selectHospitalPersonInfoList(hospitalPersonInfo);
} }
@ -138,6 +140,7 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService
sysUser.setPassword(SecurityUtils.encryptPassword(hospitalPersonInfo.getPersonPassword())); sysUser.setPassword(SecurityUtils.encryptPassword(hospitalPersonInfo.getPersonPassword()));
sysUser.setNickName(hospitalPersonInfo.getPersonName()); sysUser.setNickName(hospitalPersonInfo.getPersonName());
sysUser.setHospitalPersonId(hospitalPersonInfo.getId()); sysUser.setHospitalPersonId(hospitalPersonInfo.getId());
sysUser.setHospitalId(hospitalPersonInfo.getHospitalId());
sysUser.setStatus("0"); sysUser.setStatus("0");
sysUser.setDelFlag("0"); sysUser.setDelFlag("0");
userMapper.insertUser(sysUser); userMapper.insertUser(sysUser);
@ -169,6 +172,32 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService
hospitalPersonInfo.setUpdateTime(LocalDateTime.now()); hospitalPersonInfo.setUpdateTime(LocalDateTime.now());
hospitalPersonInfo.setUpdateBy(SecurityUtils.getUsername()); hospitalPersonInfo.setUpdateBy(SecurityUtils.getUsername());
hospitalPersonInfoMapper.updateHospitalPersonInfo(hospitalPersonInfo); hospitalPersonInfoMapper.updateHospitalPersonInfo(hospitalPersonInfo);
// 修改sys_user表
SysUser sysUser = new SysUser();
sysUser.setHospitalPersonId(hospitalPersonInfo.getId());
List<SysUser> userList = userMapper.selectUserList(sysUser);
if (CollectionUtils.isEmpty(userList)) {
SysUser newUser = new SysUser();
newUser.setUserName(hospitalPersonInfo.getPersonAccount());
newUser.setPassword(SecurityUtils.encryptPassword(hospitalPersonInfo.getPersonPassword()));
newUser.setNickName(hospitalPersonInfo.getPersonName());
newUser.setHospitalPersonId(hospitalPersonInfo.getId());
newUser.setHospitalId(hospitalPersonInfo.getHospitalId());
newUser.setStatus("0");
newUser.setDelFlag("0");
userMapper.insertUser(newUser);
} else {
SysUser updUser = userList.get(0);
updUser.setUserName(hospitalPersonInfo.getPersonAccount());
updUser.setPassword(SecurityUtils.encryptPassword(hospitalPersonInfo.getPersonPassword()));
updUser.setNickName(hospitalPersonInfo.getPersonName());
updUser.setHospitalPersonId(hospitalPersonInfo.getId());
updUser.setHospitalId(hospitalPersonInfo.getHospitalId());
updUser.setStatus("0");
updUser.setDelFlag("0");
userMapper.updateUser(updUser);
}
//根据科室人员id去查询对应的资质证书 使用流来获取所有的证书路径 //根据科室人员id去查询对应的资质证书 使用流来获取所有的证书路径
List<HospitalPersonCertificate> hospitalPersonCertificateList = hospitalPersonCertificateMapper.selectHospitalPersonCertificateByIds(Collections.singletonList(hospitalPersonInfo.getId())); List<HospitalPersonCertificate> hospitalPersonCertificateList = hospitalPersonCertificateMapper.selectHospitalPersonCertificateByIds(Collections.singletonList(hospitalPersonInfo.getId()));
//数据库中的 //数据库中的

View File

@ -69,6 +69,8 @@ public class NurseStationServiceImpl implements INurseStationService {
private AppletPageConfig appletPageConfig; private AppletPageConfig appletPageConfig;
@Resource @Resource
private XinELuConfig xinYiLuConfig; private XinELuConfig xinYiLuConfig;
@Resource
private AppletChatUtil appletChatUtil;
/** /**
* 护理站营业时间默认值 * 护理站营业时间默认值
@ -457,18 +459,18 @@ public class NurseStationServiceImpl implements INurseStationService {
case Constants.PERSON_CERTIFICATE_URL: case Constants.PERSON_CERTIFICATE_URL:
uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getPersonCertificateUrl(); uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getPersonCertificateUrl();
break; break;
case Constants.PLATELET_PICTURE_URL: case Constants.PLATELET_PICTURE_URL:
uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getPlateletPitureUrl(); uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getPlateletPitureUrl();
break; break;
case Constants.LEFT_EYE_PICTURE_URL: case Constants.LEFT_EYE_PICTURE_URL:
uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getLeftEyePitureUrl(); uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getLeftEyePitureUrl();
break; break;
case Constants.RIGHT_EYE_PICTURE_URL: case Constants.RIGHT_EYE_PICTURE_URL:
uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getRightEyePitureUrl(); uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getRightEyePitureUrl();
break; break;
case Constants.ALZHEIMER_FILE_URL: case Constants.ALZHEIMER_FILE_URL:
uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getAlzheimerFileUrl(); uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getAlzheimerFileUrl();
break; break;
default: default:
break; break;
} }
@ -476,12 +478,12 @@ public class NurseStationServiceImpl implements INurseStationService {
return AjaxResult.success(); return AjaxResult.success();
} }
//上传 //上传
String pictureName = ""; String pictureName = "";
if (StringUtils.isNotBlank(type) && StringUtils.equals(type, Constants.ALZHEIMER_FILE_URL)) { if (StringUtils.isNotBlank(type) && StringUtils.equals(type, Constants.ALZHEIMER_FILE_URL)) {
pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, multipartFile, MimeTypeUtils.FILE_EXTENSION); pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, multipartFile, MimeTypeUtils.FILE_EXTENSION);
} else { } else {
pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, multipartFile, MimeTypeUtils.IMAGE_EXTENSION); pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, multipartFile, MimeTypeUtils.IMAGE_EXTENSION);
} }
if (StringUtils.isBlank(pictureName)) { if (StringUtils.isBlank(pictureName)) {
throw new ServiceException("图片上传失败,请联系管理员!"); throw new ServiceException("图片上传失败,请联系管理员!");
@ -617,10 +619,10 @@ public class NurseStationServiceImpl implements INurseStationService {
String appletPageUrl = appletPageConfig.getNurseStationDetailsPageUrl(); String appletPageUrl = appletPageConfig.getNurseStationDetailsPageUrl();
//机构二维码存放路径 //机构二维码存放路径
String filePathWeChatCodeUrl = xinYiLuConfig.getStationWechatCodeUrl(); String filePathWeChatCodeUrl = xinYiLuConfig.getStationWechatCodeUrl();
String appletCodePicture = AppletChatUtil.createAppletCode(nurseStationId, false, fileName, appletPageUrl, filePathWeChatCodeUrl); String appletCodePicture = appletChatUtil.createAppletCode(nurseStationId, false, fileName, appletPageUrl, filePathWeChatCodeUrl);
if (StringUtils.isNotBlank(appletCodePicture) && StringUtils.equals(FAIL, appletCodePicture)) { if (StringUtils.isNotBlank(appletCodePicture) && StringUtils.equals(FAIL, appletCodePicture)) {
//第一次调用获取小程序二维码信息失败重新递归调用一次第二次失败直接返回提示信息 //第一次调用获取小程序二维码信息失败重新递归调用一次第二次失败直接返回提示信息
appletCodePicture = AppletChatUtil.createAppletCode(nurseStationId, true, fileName, appletPageUrl, filePathWeChatCodeUrl); appletCodePicture = appletChatUtil.createAppletCode(nurseStationId, true, fileName, appletPageUrl, filePathWeChatCodeUrl);
if (StringUtils.isNotBlank(appletCodePicture) && StringUtils.equals(FAIL, appletCodePicture)) { if (StringUtils.isNotBlank(appletCodePicture) && StringUtils.equals(FAIL, appletCodePicture)) {
return AjaxResult.error("获取小程序二维码信息失败,请联系管理员!"); return AjaxResult.error("获取小程序二维码信息失败,请联系管理员!");
} }

View File

@ -33,6 +33,12 @@ public class AppGoodsOrderVO {
@ApiModelProperty(value = "患者名称") @ApiModelProperty(value = "患者名称")
private String patientName; private String patientName;
@ApiModelProperty(value = "医生主键")
private Long doctorId;
@ApiModelProperty(value = "医生姓名")
private String doctorName;
/** /**
* 患者身份证号 * 患者身份证号
*/ */
@ -105,4 +111,5 @@ public class AppGoodsOrderVO {
**/ **/
@ApiModelProperty(value = "健康咨询内容") @ApiModelProperty(value = "健康咨询内容")
private String healthConsultationContent; private String healthConsultationContent;
} }

View File

@ -767,7 +767,7 @@
<select id="getConsultationOrders" resultType="com.xinelu.manage.vo.goodsorder.AppGoodsOrderVO"> <select id="getConsultationOrders" resultType="com.xinelu.manage.vo.goodsorder.AppGoodsOrderVO">
select select
c.patient_id as patientId, c.id as consultationInfoId, c.patient_id as patientId, c.id as consultationInfoId,
c.patient_name as patientName, c.card_no as cardNo, c.patient_name as patientName, c.doctor_id as doctorId,c.doctor_name as doctorName, c.card_no as cardNo,
c.phone, c.address,c.appointment_date, c.appointment_start_time, c.appointment_end_time,c.problem_description, c.phone, c.address,c.appointment_date, c.appointment_start_time, c.appointment_end_time,c.problem_description,
gr.id as goodsOrderId,gr.order_no, gr.order_status, gr.total_price, gr.health_consultation_content gr.id as goodsOrderId,gr.order_no, gr.order_status, gr.total_price, gr.health_consultation_content
from goods_order gr left join consultation_info c on gr.consultation_info_id = c.id from goods_order gr left join consultation_info c on gr.consultation_info_id = c.id

View File

@ -23,22 +23,22 @@
</resultMap> </resultMap>
<sql id="selectHospitalDepartmentInfoVo"> <sql id="selectHospitalDepartmentInfoVo">
select id, select d.id,
parent_id, d.parent_id,
hospital_id, d.hospital_id,
hospital_name, d.hospital_name,
department_code, d.department_code,
department_name, d.department_name,
department_phone, d.department_phone,
department_person, d.department_person,
department_address, d.department_address,
department_level, d.department_level,
department_sort, d.department_sort,
create_by, d.create_by,
create_time, d.create_time,
update_by, d.update_by,
update_time d.update_time
from hospital_department_info from hospital_department_info d
</sql> </sql>
<select id="selectHospitalDepartmentInfoList" parameterType="com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo" <select id="selectHospitalDepartmentInfoList" parameterType="com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo"
@ -46,43 +46,45 @@
<include refid="selectHospitalDepartmentInfoVo"/> <include refid="selectHospitalDepartmentInfoVo"/>
<where> <where>
<if test="parentId != null "> <if test="parentId != null ">
and parent_id = #{parentId} and d.parent_id = #{parentId}
</if> </if>
<if test="hospitalId != null "> <if test="hospitalId != null ">
and hospital_id = #{hospitalId} and d.hospital_id = #{hospitalId}
</if> </if>
<if test="hospitalName != null and hospitalName != ''"> <if test="hospitalName != null and hospitalName != ''">
and hospital_name like concat('%', #{hospitalName}, '%') and d.hospital_name like concat('%', #{hospitalName}, '%')
</if> </if>
<if test="departmentCode != null and departmentCode != ''"> <if test="departmentCode != null and departmentCode != ''">
and department_code = #{departmentCode} and dd.epartment_code = #{departmentCode}
</if> </if>
<if test="departmentName != null and departmentName != ''"> <if test="departmentName != null and departmentName != ''">
and department_name like concat('%', #{departmentName}, '%') and d.department_name like concat('%', #{departmentName}, '%')
</if> </if>
<if test="departmentPhone != null and departmentPhone != ''"> <if test="departmentPhone != null and departmentPhone != ''">
and department_phone = #{departmentPhone} and d.department_phone = #{departmentPhone}
</if> </if>
<if test="departmentPerson != null and departmentPerson != ''"> <if test="departmentPerson != null and departmentPerson != ''">
and department_person = #{departmentPerson} and d.department_person = #{departmentPerson}
</if> </if>
<if test="departmentAddress != null and departmentAddress != ''"> <if test="departmentAddress != null and departmentAddress != ''">
and department_address = #{departmentAddress} and d.department_address = #{departmentAddress}
</if> </if>
<if test="departmentLevel != null "> <if test="departmentLevel != null ">
and department_level = #{departmentLevel} and d.department_level = #{departmentLevel}
</if> </if>
<if test="departmentSort != null "> <if test="departmentSort != null ">
and department_sort = #{departmentSort} and d.department_sort = #{departmentSort}
</if> </if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where> </where>
ORDER BY id DESC ORDER BY d.id DESC
</select> </select>
<select id="selectHospitalDepartmentInfoById" parameterType="Long" <select id="selectHospitalDepartmentInfoById" parameterType="Long"
resultMap="HospitalDepartmentInfoResult"> resultMap="HospitalDepartmentInfoResult">
<include refid="selectHospitalDepartmentInfoVo"/> <include refid="selectHospitalDepartmentInfoVo"/>
where id = #{id} where d.id = #{id}
</select> </select>
<insert id="insertHospitalDepartmentInfo" parameterType="com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo" useGeneratedKeys="true" <insert id="insertHospitalDepartmentInfo" parameterType="com.xinelu.manage.domain.hospitaldepartmentinfo.HospitalDepartmentInfo" useGeneratedKeys="true"

View File

@ -152,6 +152,8 @@
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and hpi.status = #{status} and hpi.status = #{status}
</if> </if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where> </where>
ORDER BY id DESC ORDER BY id DESC
</select> </select>

View File

@ -363,4 +363,13 @@
where pcr.patient_id = #{patientId} where pcr.patient_id = #{patientId}
and pcr.coupon_id = #{couponId} and pcr.coupon_id = #{couponId}
</select> </select>
<select id="getCouponReceiveByReceiveSource" resultType="java.lang.Integer">
select
count(1)
from patient_coupon_receive
where
patient_id = #{patientId}
and receive_source = #{receiveSource}
</select>
</mapper> </mapper>

View File

@ -24,6 +24,7 @@
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
<result property="hospitalPersonId" column="hospital_person_id"/> <result property="hospitalPersonId" column="hospital_person_id"/>
<result property="hospitalId" column="hospital_id"/>
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult"/> <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult"/>
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/> <collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
</resultMap> </resultMap>
@ -49,7 +50,7 @@
<sql id="selectUserVo"> <sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status,
u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.hospital_person_id, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.hospital_person_id,u.hospital_id,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u from sys_user u
@ -163,6 +164,7 @@
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="hospitalPersonId != null and hospitalPersonId != ''">hospital_person_id,</if> <if test="hospitalPersonId != null and hospitalPersonId != ''">hospital_person_id,</if>
<if test="hospitalId != null and hospitalId != ''">hospital_id,</if>
create_time create_time
)values( )values(
<if test="userId != null and userId != ''">#{userId},</if> <if test="userId != null and userId != ''">#{userId},</if>
@ -178,6 +180,7 @@
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="hospitalPersonId != null and hospitalPersonId != ''">#{hospitalPersonId},</if> <if test="hospitalPersonId != null and hospitalPersonId != ''">#{hospitalPersonId},</if>
<if test="hospitalId != null and hospitalId != ''">#{hospitalId},</if>
sysdate() sysdate()
) )
</insert> </insert>