1、修改服务评价接口;

2、添加获取服务评价列表接口;
3、居民信息表添加签约编号字段;
This commit is contained in:
mengkuiliang 2023-10-18 17:33:58 +08:00
parent 3bb2fd911f
commit 1002c6c2fc
18 changed files with 279 additions and 38 deletions

View File

@ -54,6 +54,7 @@ public class ResidentPatientInfoController extends BaseController {
residentPatientInfoService.register(body);
return R.ok();
} catch (Exception e) {
e.printStackTrace();
return R.fail(e.getMessage());
}
}

View File

@ -12,9 +12,7 @@ import com.xinelu.familydoctor.applet.pojo.body.ResidentServiceApplyBody;
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery;
import com.xinelu.familydoctor.applet.pojo.query.ServiceRecordQuery;
import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo;
import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceRecordVo;
import com.xinelu.familydoctor.applet.pojo.vo.ScreeningProjectVo;
import com.xinelu.familydoctor.applet.pojo.vo.*;
import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService;
import com.xinelu.familydoctor.applet.service.IResidentServiceAppletService;
import com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo;
@ -100,11 +98,11 @@ public class ResidentServiceApplyController extends BaseController {
@GetMapping("/record/{identity}")
public R<List<ResidentServiceRecordVo>> performanceBookingRecord(@PathVariable String identity, ServiceRecordQuery query, @RequestHeader("region") String region) {
query.setIdentity(identity);
if(query.getPageNum() == null) {
if (query.getPageNum() == null) {
query.setPageNum(1);
}
if(query.getPageSize() == null) {
query.setPageSize(100);
if (query.getPageSize() == null) {
query.setPageSize(1000);
}
JSONObject result = httpService.post(SpringUtils.getFdUrl(region) + "/performance/recordV1", null, JSONObject.parseObject(JSONObject.toJSONString(query)));
if (result.get("code").toString().equals("0")) {
@ -118,7 +116,7 @@ public class ResidentServiceApplyController extends BaseController {
if (list != null && list.size() > 0) {
List<OrderEvaluateInfo> orderEvaluateInfoTempList;
for (ResidentServiceRecordVo record : perRecordList) {
orderEvaluateInfoTempList = list.stream().filter(o -> o.getServiceCode().equals(record.getPerformanceNo())).collect(Collectors.toList());
orderEvaluateInfoTempList = list.stream().filter(o -> o.getOrderNo().equals(record.getPerformanceNo())).collect(Collectors.toList());
if (orderEvaluateInfoTempList.size() > 0) {
record.setOrderEvaluateInfo(orderEvaluateInfoTempList.get(0));
}
@ -129,4 +127,34 @@ public class ResidentServiceApplyController extends BaseController {
}
return R.ok();
}
@ApiOperation("获取服务记录详情")
@GetMapping("/serviceRecordDetail/{identity}/{performanceNo}")
public R<ResidentServiceRecordVo> serviceRecordDetail(@PathVariable String identity, @PathVariable String performanceNo, @RequestHeader("region") String region) {
String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/performance/detail/" + identity + "/" + performanceNo, null, String.class);
JSONObject jsonObject = JSONObject.parseObject(result);
if (jsonObject.getInteger("code") != 1) {
throw new ServiceException(jsonObject.getString("msg"));
}
if (jsonObject.get("data") != null) {
return R.ok(JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), ResidentServiceRecordVo.class));
}
return R.ok();
}
@ApiOperation("服务评价列表")
@GetMapping("/evaluateRecord/{identity}")
public R<List<OrderEvaluateVo>> performanceEvaluateRecord(@PathVariable String identity) {
PatientInfo patientInfo = residentPatientInfoService.getByCardNo(identity);
if (patientInfo != null && !StringUtils.isBlank(patientInfo.getCityCode())) {
String result = (String) httpService.get(SpringUtils.getFdUrl(patientInfo.getCityCode()) + "/performance/recordV2/" + identity, null, String.class);
JSONObject jsonObject = JSONObject.parseObject(result);
if (jsonObject.getInteger("code") == 1) {
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();
}
}

View File

@ -64,4 +64,20 @@ public class AppletChatConfig {
* 签到通知模板
*/
private String signTemplateId;
/**
* 家庭医生消息通知默认模版
*/
private String fdMessageDefaultTempId;
/**
* 家庭医生预约成功通知模版
*/
private String fdMessageApplyTempId;
/**
* 家庭医生用药提醒通知模版
*/
private String fdMessageMedicineTempId;
}

View File

@ -35,6 +35,6 @@ public enum RegionKeyType {
return uploadType;
}
}
throw new ServiceException("获取区域配置出错");
throw new ServiceException("未查询到区域配置");
}
}

View File

@ -0,0 +1,49 @@
package com.xinelu.familydoctor.applet.pojo.body;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author mengkuiliang
* @Description 消息推送请求对象
* @Date 2023-10-18 018 14:26
* @Param
* @return
**/
@Data
@ApiModel(value = "消息推送请求对象")
public class MessagePushBody {
/**
* 业务类型1 预约申请通知 2 审批结果通知 3用药提醒通知
*/
@ApiModelProperty(value = "务类型1 预约申请通知 2 审批结果通知 3用药提醒通知")
private String busType;
/**
* openid
*/
@ApiModelProperty(value = "openid")
private String openid;
/**
* 发送人
*/
@ApiModelProperty(value = "发送人")
private String senderName;
/**
* 发送标题
*/
@ApiModelProperty(value = "发送标题")
private String sendTitle;
/**
* 发送时间(yyyy-MM-dd HH:mm:ss)
*/
@ApiModelProperty(value = "发送时间(yyyy-MM-dd HH:mm:ss)")
private String sendTime;
}

View File

@ -262,4 +262,9 @@ public class PatientInfoBody extends BaseEntity {
@ApiModelProperty(value = "户主身份证号")
private String householdCardNo;
/**
* 签约编号
*/
@ApiModelProperty(value = "签约编号")
private String signNo;
}

View File

@ -300,6 +300,12 @@ public class PatientInfo extends BaseEntity {
@ApiModelProperty(value = "户主身份证号")
private String householdCardNo;
/**
* 签约编号
*/
@ApiModelProperty(value = "签约编号")
private String signNo;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -0,0 +1,56 @@
package com.xinelu.familydoctor.applet.pojo.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author mengkuiliang
* @Description 履约记录-小程序评价列表展示类
* @Date 2023-10-18 16:43
* @Param
* @return
**/
@ApiModel("履约记录-小程序评价列表展示类")
@Data
public class OrderEvaluateVo {
/**
* 居民身份证号
*/
@ApiModelProperty(value = "居民身份证号")
private String cardNo;
/**
* 订单编号
*/
@ApiModelProperty(value = "订单编号")
private String orderNo;
/**
* 订单状态
*/
@ApiModelProperty(value = "订单状态")
private String orderStatus;
/**
* 订单名称
*/
@ApiModelProperty(value = "订单名称")
private String orderName;
/**
* 订单类型
*/
@ApiModelProperty(value = "订单类型")
private String orderType;
/**
* 下单时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@ApiModelProperty(value = "下单时间")
private String createTime;
}

View File

@ -6,16 +6,19 @@ import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.config.AppletChatConfig;
import com.xinelu.common.core.domain.R;
import com.xinelu.common.entity.AppletPhoneVO;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.http.HttpService;
import com.xinelu.common.utils.http.HttpUtils;
import com.xinelu.common.utils.http.SslUtils;
import com.xinelu.common.utils.spring.SpringUtils;
import com.xinelu.common.utils.uuid.IdUtils;
import com.xinelu.familydoctor.applet.mapper.ResidentPatientInfoMapper;
import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody;
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
import com.xinelu.familydoctor.applet.pojo.vo.SignInfoDetailVo;
import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService;
import com.xinelu.familydoctor.applet.utils.AppletAccessTokenUtils;
import lombok.extern.slf4j.Slf4j;
@ -161,12 +164,13 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
patientInfo.setDisease("0");
}
patientInfo.setLoginFlag(Long.valueOf(1));
patientInfo.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo()));
updatePatientInfo(patientInfo);
// 注册
}
// 注册
} else {
// 获取当前微信绑定的居民
List<PatientInfo> list = residentPatientInfoMapper.getList(body.getOpenid(), body.getCityCode());
List<PatientInfo> list = residentPatientInfoMapper.getList(body.getOpenid(), null);
PatientInfo patientInfo = residentPatientInfoMapper.isRegisterByCardNo(body.getCardNo());
if (patientInfo == null) {
PatientInfo entity = new PatientInfo();
@ -182,6 +186,7 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
entity.setCreateTime(new Date());
entity.setCreateBy(body.getCardNo());
entity.setLoginFlag(Long.valueOf(1));
entity.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo()));
residentPatientInfoMapper.insertPatientInfo(entity);
} else {
if (!StringUtils.isBlank(patientInfo.getOpenid())) {
@ -203,12 +208,36 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
} else {
patientInfo.setDisease("0");
}
patientInfo.setSignNo(getSignInfo(body.getCityCode(), body.getCardNo()));
residentPatientInfoMapper.updatePatientInfo(patientInfo);
}
}
}
}
// 获取签约信息
private String getSignInfo(String region, String identity) {
if(!StringUtils.isBlank(region)) {
try {
// 查询签约信息
String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/resident/signinfo/detail/" + identity, null, String.class);
JSONObject jsonObject = JSONObject.parseObject(result);
if ("1".equals(jsonObject.get("code"))) {
if(jsonObject.getJSONObject("data") != null) {
SignInfoDetailVo signInfo = JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), SignInfoDetailVo.class);
if(signInfo != null) {
return signInfo.getSignNo();
}
}
}
} catch (Exception e) {
log.error("注册完善信息-更新签约标识出错:{}", e.getMessage());
}
}
return null;
}
/**
* @return void
* @Author mengkuiliang

View File

@ -47,7 +47,7 @@
<result property="isChecked" column="is_checked"/>
<result property="householdRelationship" column="household_relationship"/>
<result property="householdCardNo" column="household_card_no"/>
<result property="signNo" column="sign_no"/>
</resultMap>
<sql id="selectPatientInfoVo">
@ -92,7 +92,8 @@
binding_time,
is_checked,
household_relationship,
household_card_no
household_card_no,
sign_no
from patient_info
</sql>
@ -221,6 +222,9 @@
<if test="householdCardNo != null">
household_card_no,
</if>
<if test="signNo != null">
sign_no,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="areaCode != null">#{areaCode},
@ -306,6 +310,9 @@
<if test="householdCardNo != null">
#{householdCardNo},
</if>
<if test="signNo != null">
#{signNo},
</if>
</trim>
</insert>
@ -429,9 +436,12 @@
<if test="householdRelationship != null">
household_relationship = #{householdRelationship},
</if>
<if test="household_card_no != null">
<if test="householdCardNo != null">
household_card_no = #{householdCardNo},
</if>
<if test="signNo != null">
sign_no = #{signNo},
</if>
</trim>
where patient_code = #{patientCode}
</update>

View File

@ -1,6 +1,7 @@
package com.xinelu.applet.service.messagepush.Impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.xinelu.applet.service.messagepush.MessagePushService;
import com.xinelu.common.config.AppletChatConfig;
import com.xinelu.common.config.AppletPageConfig;
@ -218,4 +219,50 @@ public class MessagePushServiceImpl implements MessagePushService {
}
}
}
/**
* @return void
* @Author mengkuiliang
* @Description 家医申请审批结果消息推送
* @Date 2023-10-18 018 14:03
* @Param [appletAccessToken, paramsMap, busType]
**/
@Override
public void fdApprovePush(JSONObject body) {
AppletAccessToken appletAccessToken = AppletChatUtil.getAppletAccessToken(appletChatConfig.getAppletId(), appletChatConfig.getSecret());
if (Objects.isNull(appletAccessToken)) {
log.error("获取微信小程序accessToken信息失败");
}
if (Objects.nonNull(appletAccessToken.getErrcode()) && appletAccessToken.getErrcode() != AppletSubscriptionMessageEnum.SUCCESS_ERRCODE.getValue()) {
log.error("获取微信小程序accessToken信息失败失败信息为" + appletAccessToken.getErrmsg(), 201);
}
if (StringUtils.isBlank(appletAccessToken.getAccessToken())) {
log.error("accessToken信息为空");
}
String tempId = "";
switch (body.getString("1")) {
// 申请
case "2":
tempId = appletChatConfig.getFdMessageApplyTempId();
// 用药
case "3":
tempId = appletChatConfig.getFdMessageMedicineTempId();
// 默认
default:
tempId = appletChatConfig.getFdMessageDefaultTempId();
}
Map<String, Object> paramsMap = new HashMap<>();
paramsMap.put("touser", body.getString("openid"));
paramsMap.put("template_id", tempId);
paramsMap.put("page", appletPageConfig.getIntegralPageUrl());
//模板内容
Map<String, MessageValueEntity> messageValueEntityMap = new LinkedHashMap<>();
messageValueEntityMap.put("thing1", new MessageValueEntity(body.getString("senderName")));
messageValueEntityMap.put("time2", new MessageValueEntity(body.getString("sendTime")));
messageValueEntityMap.put("thing3", new MessageValueEntity(body.getString("sendTitle")));
//发送
this.sendPosts(appletAccessToken, paramsMap);
}
}

View File

@ -1,6 +1,7 @@
package com.xinelu.applet.service.messagepush;
import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.entity.AppletAccessToken;
import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord;
import com.xinelu.manage.vo.patientcouponreceive.PatientCouponReceiveInfoVO;
@ -38,4 +39,13 @@ public interface MessagePushService {
* @param paramsMap 模板
**/
void sendPosts(AppletAccessToken appletAccessToken, Map<String, Object> paramsMap);
/**
* @Author mengkuiliang
* @Description 家医申请审批结果消息推送
* @Date 2023-10-18 018 13:58
* @Param [appletAccessToken, paramsMap]
* @return void
**/
void fdApprovePush(JSONObject body);
}

View File

@ -62,7 +62,7 @@ public class OrderEvaluateInfoController extends BaseController {
/**
* 新增预约服务订单和商品订单评价信息
*/
@PreAuthorize("@ss.hasPermi('system:orderEvaluateInfo:add')")
// @PreAuthorize("@ss.hasPermi('system:orderEvaluateInfo:add')")
@Log(title = "预约服务订单和商品订单评价信息", businessType = BusinessType.INSERT)
@PostMapping("add")
public AjaxResult add(@RequestBody OrderEvaluateInfo orderEvaluateInfo) {
@ -88,4 +88,4 @@ public class OrderEvaluateInfoController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(orderEvaluateInfoService.deleteOrderEvaluateInfoByIds(ids));
}
}
}

View File

@ -65,13 +65,6 @@ public class OrderEvaluateInfo extends BaseDomain implements Serializable {
@NotBlank(message = "请选择订单编号", groups = {Insert.class})
private String orderNo;
/**
* 服务编号
*/
@ApiModelProperty(value = "服务编号")
@Excel(name = "服务编号")
private String serviceCode;
/**
* 评价内容
*/

View File

@ -70,5 +70,5 @@ public interface OrderEvaluateInfoMapper {
* @Param [serviceNoList]
* @return java.util.List<com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo>
**/
List<OrderEvaluateInfo> selectOrderEvaluateByServiceNos(@Param("serviceNoList") List<String> serviceNoList, @Param("orderSource") String orderSource);
List<OrderEvaluateInfo> selectOrderEvaluateByServiceNos(@Param("orderNoList") List<String> orderNoList, @Param("orderSource") String orderSource);
}

View File

@ -61,6 +61,6 @@ public interface IOrderEvaluateInfoService {
* @Param [orderEvaluateInfo]
* @return java.util.List<com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo>
**/
List<OrderEvaluateInfo> selectOrderEvaluateByServiceNos(List<String> serviceNoList, String orderSource);
List<OrderEvaluateInfo> selectOrderEvaluateByServiceNos(List<String> orderNoList, String orderSource);
}

View File

@ -82,11 +82,11 @@ public class OrderEvaluateInfoServiceImpl implements IOrderEvaluateInfoService {
* @Author mengkuiliang
* @Description 根据服务编号查询服务评价列表
* @Date 2023-10-17 017 11:36
* @Param [serviceNoList]
* @Param [orderNoList]
* @return java.util.List<com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo>
**/
@Override
public List<OrderEvaluateInfo> selectOrderEvaluateByServiceNos(List<String> serviceNoList, String orderSource) {
return orderEvaluateInfoMapper.selectOrderEvaluateByServiceNos(serviceNoList, orderSource);
public List<OrderEvaluateInfo> selectOrderEvaluateByServiceNos(List<String> orderNoList, String orderSource) {
return orderEvaluateInfoMapper.selectOrderEvaluateByServiceNos(orderNoList, orderSource);
}
}

View File

@ -10,7 +10,6 @@
<result property="openid" column="openid"/>
<result property="unionid" column="unionid"/>
<result property="orderNo" column="order_no"/>
<result property="serviceCode" column="service_code"/>
<result property="evaluateContent" column="evaluate_content"/>
<result property="evaluateChannel" column="evaluate_channel"/>
<result property="evaluateSatisfaction" column="evaluate_satisfaction"/>
@ -28,7 +27,6 @@
openid,
unionid,
order_no,
service_code,
evaluate_content,
evaluate_channel,
evaluate_satisfaction,
@ -88,8 +86,8 @@
<!-- 根据服务编号查询服务评价列表 -->
<select id="selectOrderEvaluateByServiceNos" resultType="com.xinelu.manage.domain.orderevaluateinfo.OrderEvaluateInfo">
<include refid="selectOrderEvaluateInfoVo"/>
where service_code in
<foreach collection="serviceNoList" item="no" open="(" separator="," close=")">#{no}</foreach>
where order_no in
<foreach collection="orderNoList" item="no" open="(" separator="," close=")">#{no}</foreach>
<if test="orderSource != null and orderSource != ''">
and order_source = #{orderSource}
</if>
@ -109,8 +107,6 @@
</if>
<if test="orderNo != null">order_no,
</if>
<if test="serviceCode != null">service_code,
</if>
<if test="evaluateContent != null">evaluate_content,
</if>
<if test="evaluateChannel != null">evaluate_channel,
@ -141,8 +137,6 @@
</if>
<if test="orderNo != null">#{orderNo},
</if>
<if test="serviceCode != null">#{serviceCode},
</if>
<if test="evaluateContent != null">#{evaluateContent},
</if>
<if test="evaluateChannel != null">#{evaluateChannel},
@ -179,9 +173,6 @@
<if test="orderNo != null">order_no =
#{orderNo},
</if>
<if test="serviceCode != null">service_code =
#{serviceCode},
</if>
<if test="evaluateContent != null">evaluate_content =
#{evaluateContent},
</if>