|
@@ -6,8 +6,10 @@ import java.time.ZoneOffset;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import cn.com.ty.lift.ud.chat.mapper.entity.MyCaseVo;
|
|
|
import cn.com.ty.lift.ud.operation.service.ICommissionSettingService;
|
|
|
import cn.com.ty.lift.ud.operation.service.IOtherSettingService;
|
|
|
+import cn.com.ty.lift.ud.payment.service.IUserBillService;
|
|
|
import cn.com.ty.lift.ud.question.mapper.entity.QuestionBankEntity;
|
|
|
import cn.com.ty.lift.ud.question.service.IQuestionBankService;
|
|
|
import cn.com.ty.lift.ud.redis.RedisUtil;
|
|
@@ -107,6 +109,7 @@ public class LiftCaseServiceImpl extends ServiceImpl<LiftCaseMapper, LiftCaseEnt
|
|
|
@Autowired
|
|
|
private ICommissionSettingService iCommissionSettingService;
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 问诊: 0用户新建1用户已付款2专家解决问题3用户确认问题已解决4用户已评论5专家已归档; 出诊: 0用户新建1用户付款2专家到场打卡3用户确认打卡4专家解决问题5用户确认问题已解决
|
|
|
*/
|
|
@@ -893,4 +896,42 @@ public class LiftCaseServiceImpl extends ServiceImpl<LiftCaseMapper, LiftCaseEnt
|
|
|
caseMapper.updateColorGarde(liftCase.getId());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 我的接单
|
|
|
+ * 返回 总收益(根据流水查询)、问诊单数(全部状态的)、出诊单数(全部状态的)、待处理数量(问诊出诊都是 已接单 状态)
|
|
|
+ * 专家收益 =
|
|
|
+ * 收入:打赏 2 出诊问诊收入 4 专家惩罚 9
|
|
|
+ * 支出:专家惩罚 9 申诉退款 10
|
|
|
+ * @param userId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public RestResponse getMyCase(Long userId) {
|
|
|
+ //问诊数量
|
|
|
+ int askNum = caseMapper.selectDataTableCount(1,userId);
|
|
|
+ //出诊数量
|
|
|
+ int outNum = caseMapper.selectDataTableCount(2,userId);
|
|
|
+ //问诊待处理数量就是,待评价之前所有状态的,不包括申诉的 即状态值 小于4的
|
|
|
+ int askDealingNum = caseMapper.selectDealingCount(1,userId,4);
|
|
|
+ //出诊待处理数量就是,待评价之前所有状态的,不包括申诉的 即状态值 小于5的
|
|
|
+ int outDealingNum = caseMapper.selectDealingCount(2,userId,5);
|
|
|
+ //总的待处理数量
|
|
|
+ int totalDealingNum = askDealingNum + outDealingNum;
|
|
|
+ //根据流水查询总收益
|
|
|
+ //专家收入:打赏 2 出诊问诊收入 4 专家惩罚 9 (撤销惩罚) 之和
|
|
|
+ //专家支出:专家惩罚 9 申诉退款 10 之和
|
|
|
+ BigDecimal income = userBillMapper.selectIncome(userId);
|
|
|
+ BigDecimal outcome = userBillMapper.selectOutcome(userId);
|
|
|
+ income = income == null?new BigDecimal(0):income;
|
|
|
+ outcome = outcome == null?new BigDecimal(0):outcome;
|
|
|
+ BigDecimal total = income.subtract(outcome);
|
|
|
+ //汇总
|
|
|
+ MyCaseVo vo = new MyCaseVo();
|
|
|
+ vo.setTotalMoney(total);
|
|
|
+ vo.setAskNum(askNum);
|
|
|
+ vo.setOutNum(outNum);
|
|
|
+ vo.setDealingNum(totalDealingNum);
|
|
|
+ return RestResponse.success(vo,"查询成功");
|
|
|
+ }
|
|
|
}
|