2 Commits 20bea322a3 ... d119dcbfb1

Author SHA1 Message Date
  liaoyongfei d119dcbfb1 去除查询失败默认已取消 4 years ago
  liaoyongfei e4894bb989 增加订单时间 4 years ago

+ 14 - 12
ymall/src/main/java/com/liangjian11/ymall/handle/SynProfitHandle.java

@@ -523,18 +523,20 @@ public class SynProfitHandle {
     JSONObject jo;
     for (CalculationProfit profit : list) {
       jo = this.getOrderStatus(profit.getOrderCode());
-      if (jo != null && jo.getJSONObject("data").get("backStatus") != null && jo.getJSONObject("data").getString("backStatus").equals("2")) {
-        //未退款
-        profit.setStatus(1);
-        profit.setUpdateTime(now);
-        profit.setEntryTime(now);
-      } else {
-        //退款
-        profit.setStatus(3);
-        profit.setUpdateTime(now);
-        profit.setIsHandle(true);
+      if(jo != null && jo.getJSONObject("data").get("backStatus") != null ){
+        if (jo.getJSONObject("data").getString("backStatus").equals("2")) {
+          //未退款
+          profit.setStatus(1);
+          profit.setUpdateTime(now);
+          profit.setEntryTime(now);
+        } else {
+          //退款
+          profit.setStatus(3);
+          profit.setUpdateTime(now);
+          profit.setIsHandle(true);
+        }
+        calculationProfitService.updateById(profit);
       }
-      calculationProfitService.updateById(profit);
     }
   }
 
@@ -583,7 +585,7 @@ public class SynProfitHandle {
     String res = OkHttpUtils.httpPostJson(hospitalDomain.domainName + hospitalDomain.getOrderStatus, httpHeaders, requestPayload.toJSONString());
     JSONObject resJson = JSONObject.parseObject(res);
     if (resJson.get("err") == null || !resJson.get("err").toString().equals("0")) {
-      logger.error("查询订单状态失败:" + res);
+      logger.error("查询订单状态失败orderCode:" +orderCode+ res);
       return null;
     }
     return resJson;

+ 1 - 1
ymall/src/main/java/com/liangjian11/ymall/service/impl/DoctorServiceImpl.java

@@ -374,7 +374,7 @@ public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> impleme
       QueryWrapper<UserRole> userRoleQuery = new QueryWrapper<>();
       userRoleQuery.eq("user_role_type", 1);
       userRoleQuery.eq("mobile", enPhone);
-      UserRole userRole = userRoleService.getOne(userRoleQuery);
+      UserRole userRole = userRoleMapper.selectOne(userRoleQuery);
       if (userRole == null)
         userRoleService.addUserRole(userAccount, enPhone, userAccount.getNickname(), userAccount.getHeadimg(), doctorList.get(0).getId(), 1, 1);
       else{

+ 6 - 5
ymall/src/main/java/com/liangjian11/ymall/service/impl/UserRoleServiceImpl.java

@@ -3,6 +3,7 @@ package com.liangjian11.ymall.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.liangjian11.ymall.config.RedirectPathSource;
+import com.liangjian11.ymall.mapper.DoctorMapper;
 import com.liangjian11.ymall.mapper.PartnerMapper;
 import com.liangjian11.ymall.mapper.UserRoleMapper;
 import com.liangjian11.ymall.model.*;
@@ -25,15 +26,15 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
 
   private final UserRoleMapper userRoleMapper;
   private final RedirectPathSource redirectPathSource;
-  private final DoctorService doctorService;
+  private final DoctorMapper doctorMapper;
   private final PartnerMapper partnerMapper;
   private final PartnerRecommendService partnerRecommendService;
 
-  public UserRoleServiceImpl(UserRoleMapper userRoleMapper, RedirectPathSource redirectPathSource, DoctorService doctorService, PartnerMapper partnerMapper,
+  public UserRoleServiceImpl(UserRoleMapper userRoleMapper, RedirectPathSource redirectPathSource, DoctorMapper doctorMapper, PartnerMapper partnerMapper,
                              PartnerRecommendService partnerRecommendService) {
     this.userRoleMapper = userRoleMapper;
     this.redirectPathSource = redirectPathSource;
-    this.doctorService = doctorService;
+    this.doctorMapper = doctorMapper;
     this.partnerMapper = partnerMapper;
     this.partnerRecommendService = partnerRecommendService;
   }
@@ -48,7 +49,7 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
     QueryWrapper<Doctor> doctorQuery = new QueryWrapper<>();
     if (StringUtils.isNotBlank(account.getMobile())) {
       doctorQuery.eq("phone", account.getMobile());
-      doctor = doctorService.getOne(doctorQuery);
+      doctor = doctorMapper.selectOne(doctorQuery);
     }
     if (list == null || list.size() == 0) {
       if(type == 1 ) {
@@ -135,7 +136,7 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
         doctor.setAccountID(account.getId());
         doctor.setUnionid(account.getUnionid());
         doctor.setWxOpenID(account.getWxopenid());
-        doctorService.update(doctor,doctorQuery);
+        doctorMapper.update(doctor,doctorQuery);
         if (StringUtils.isNotBlank(id)) {
           QueryWrapper<PartnerRecommend> partnerRecommendQuery = new QueryWrapper<>();
           partnerRecommendQuery.eq("subordinate_id", doctor.getId());