|
@@ -18,6 +18,8 @@ import cn.com.ty.lift.ud.chat.mapper.entity.ChatSessionEntity;
|
|
|
import cn.com.ty.lift.ud.chat.mapper.entity.LiftCaseEntity;
|
|
|
import cn.com.ty.lift.ud.chat.service.IChatSessionService;
|
|
|
import cn.com.ty.lift.ud.chat.service.ILiftCaseService;
|
|
|
+import cn.com.ty.lift.ud.neety.task.RoomInfo;
|
|
|
+import cn.com.ty.lift.ud.neety.task.UserInfo;
|
|
|
import cn.com.ty.lift.ud.operation.mapper.entity.CommissionSettingEntity;
|
|
|
import cn.com.ty.lift.ud.operation.mapper.entity.UserLevelRuleEntity;
|
|
|
import cn.com.ty.lift.ud.operation.mapper.entity.UserRebateRuleEntity;
|
|
@@ -38,6 +40,7 @@ import cn.com.ty.lift.ud.question.mapper.QuestionBankMapper;
|
|
|
import cn.com.ty.lift.ud.question.mapper.entity.QuestionBankEntity;
|
|
|
import cn.com.ty.lift.ud.question.mapper.entity.QuestionOperateEntity;
|
|
|
import cn.com.ty.lift.ud.question.service.IQuestionOperateService;
|
|
|
+import cn.com.ty.lift.ud.redis.RedisUtil;
|
|
|
import cn.com.ty.lift.ud.schoolVideo.mapper.entity.SchoolVideoEntity;
|
|
|
import cn.com.ty.lift.ud.schoolVideo.mapper.entity.SchoolVideoOperateEntity;
|
|
|
import cn.com.ty.lift.ud.schoolVideo.service.ISchoolVideoOperateService;
|
|
@@ -59,7 +62,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
@Transactional
|
|
|
@Slf4j
|
|
|
public class WxpayServiceImpl implements WxpayService {
|
|
|
-
|
|
|
+
|
|
|
private final Logger logger = LoggerFactory.getLogger(AlipayServiceImpl.class);
|
|
|
|
|
|
private @Autowired ILiftCaseService liftCaseService;
|
|
@@ -98,10 +101,12 @@ public class WxpayServiceImpl implements WxpayService {
|
|
|
private IUserAccountService iUserAccountService;
|
|
|
|
|
|
private @Autowired UserCouponMapper userCouponMapper;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private IUserRebateRuleService iUserRebateRuleService;
|
|
|
-
|
|
|
+
|
|
|
+ private @Autowired RedisUtil redis;
|
|
|
+
|
|
|
@Override
|
|
|
public void wxCasePaymentComplete(String outTradeNo, String totalAmount, String tradeNo) {
|
|
|
LocalDateTime date = LocalDateTime.now();
|
|
@@ -124,11 +129,19 @@ public class WxpayServiceImpl implements WxpayService {
|
|
|
entity.setDataId(orderId);
|
|
|
entity.setCreateTime(date);
|
|
|
List<ChatSessionEntity> sessionList = new ArrayList<>();
|
|
|
-
|
|
|
sessionList.add(entity);
|
|
|
-
|
|
|
chatSessionService.saveBatch(sessionList);
|
|
|
-
|
|
|
+ // 在redis中创建房间
|
|
|
+ RoomInfo roomInfo = new RoomInfo();
|
|
|
+ roomInfo.setSessionid(entity.getSessionid());
|
|
|
+ roomInfo.setDataTable(entity.getDataTable());
|
|
|
+ roomInfo.setLastTime(entity.getCreateTime());
|
|
|
+ UserInfo userInfo1 = new UserInfo();
|
|
|
+ userInfo1.setUserId(entity.getUserId());
|
|
|
+ List<UserInfo> userList = new ArrayList<>();
|
|
|
+ userList.add(userInfo1);
|
|
|
+ roomInfo.setUserLIst(userList);
|
|
|
+ redis.setValue("ROOM:" + entity.getSessionid(), roomInfo);
|
|
|
// 完善诊单状态
|
|
|
/**
|
|
|
* 问诊:0待付款(创建订单) =》 1已付款(待接单)=》 2已接单 =》 3专家确认完成 =》 4用户确认完成(待评价) =》 5待归档(已评价) =》 6已归档 =》 7申诉中 出诊:0待接单(创建订单) =》
|
|
@@ -148,7 +161,8 @@ public class WxpayServiceImpl implements WxpayService {
|
|
|
|
|
|
if (caseEntity.getRedEnvelopeId() != null) {
|
|
|
// 是否使用红包修改状态
|
|
|
- userCouponMapper.updateOrderIdAndStatusByCouponIdAndUserId(caseEntity.getRedEnvelopeId(), 2, caseEntity.getId());
|
|
|
+ userCouponMapper.updateOrderIdAndStatusByCouponIdAndUserId(caseEntity.getRedEnvelopeId(), 2,
|
|
|
+ caseEntity.getId());
|
|
|
}
|
|
|
|
|
|
log.info("--- 微信问诊记录平台流水开始 ---");
|
|
@@ -266,11 +280,19 @@ public class WxpayServiceImpl implements WxpayService {
|
|
|
entity.setDataId(orderId);
|
|
|
entity.setCreateTime(date);
|
|
|
List<ChatSessionEntity> sessionList = new ArrayList<>();
|
|
|
-
|
|
|
sessionList.add(entity);
|
|
|
-
|
|
|
chatSessionService.saveBatch(sessionList);
|
|
|
-
|
|
|
+ // 在redis中创建房间
|
|
|
+ RoomInfo roomInfo = new RoomInfo();
|
|
|
+ roomInfo.setSessionid(entity.getSessionid());
|
|
|
+ roomInfo.setDataTable(entity.getDataTable());
|
|
|
+ roomInfo.setLastTime(entity.getCreateTime());
|
|
|
+ UserInfo userInfo1 = new UserInfo();
|
|
|
+ userInfo1.setUserId(entity.getUserId());
|
|
|
+ List<UserInfo> userList = new ArrayList<>();
|
|
|
+ userList.add(userInfo1);
|
|
|
+ roomInfo.setUserLIst(userList);
|
|
|
+ redis.setValue("ROOM:" + entity.getSessionid(), roomInfo);
|
|
|
// 完善诊单状态
|
|
|
/**
|
|
|
* 问诊:0待付款(创建订单) =》 1已付款(待接单)=》 2已接单 =》 3专家确认完成 =》 4用户确认完成(待评价) =》 5待归档(已评价) =》 6已归档 =》 7申诉中 出诊:0待接单(创建订单)
|
|
@@ -289,9 +311,10 @@ public class WxpayServiceImpl implements WxpayService {
|
|
|
|
|
|
if (caseEntity.getRedEnvelopeId() != null) {
|
|
|
// 是否使用红包修改状态
|
|
|
- userCouponMapper.updateOrderIdAndStatusByCouponIdAndUserId(caseEntity.getRedEnvelopeId(), 2, caseEntity.getId());
|
|
|
+ userCouponMapper.updateOrderIdAndStatusByCouponIdAndUserId(caseEntity.getRedEnvelopeId(), 2,
|
|
|
+ caseEntity.getId());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
log.info("--- 微信出诊记录平台流水开始 ---");
|
|
|
// 记录平台流水
|
|
|
TyBillEntity tyBill = new TyBillEntity();
|
|
@@ -328,7 +351,8 @@ public class WxpayServiceImpl implements WxpayService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void wxQuestionPaymentComplete(Long questionId, Long userId, String tradeNo, String totalAmount, Integer payType) {
|
|
|
+ public void wxQuestionPaymentComplete(Long questionId, Long userId, String tradeNo, String totalAmount,
|
|
|
+ Integer payType) {
|
|
|
// 赏金
|
|
|
BigDecimal reward = new BigDecimal(totalAmount).divide(new BigDecimal("100"));
|
|
|
BigDecimal amount = BigDecimal.ZERO;
|
|
@@ -491,7 +515,6 @@ public class WxpayServiceImpl implements WxpayService {
|
|
|
log.info("--- 微信视频记录平台流水结束 ---");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -604,8 +627,7 @@ public class WxpayServiceImpl implements WxpayService {
|
|
|
|
|
|
// 后台生成二维码,流化后上传到阿里云服务器
|
|
|
try {
|
|
|
- String qrCodeurl =
|
|
|
- QrCodeUtil.getQrCode(userId, "/wode/vip");
|
|
|
+ String qrCodeurl = QrCodeUtil.getQrCode(userId, "/wode/vip");
|
|
|
// todo 二维码
|
|
|
UserInfoEntity userInfo = new UserInfoEntity();
|
|
|
userInfo.setUserId(userId);
|
|
@@ -754,5 +776,5 @@ public class WxpayServiceImpl implements WxpayService {
|
|
|
// 返回两个时间点的月数差
|
|
|
return (year2 - year1) * 12 + (month2 - month1);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|