ソースを参照

Merge branch 'master' of http://192.168.20.122:3000/root/qiyewechatApp

半月无霜 4 年 前
コミット
8a82bcab84

+ 1 - 1
ymall/src/main/java/com/liangjian11/ymall/controller/PartnerAPIController.java

@@ -218,7 +218,7 @@ public class PartnerAPIController {
       JSONArray messageList = new JSONArray();
       JSONObject messageJson = new JSONObject();
       messageJson.put("msgType", "text");
-      StringBuilder contentSB = new StringBuilder("注册链接<a href=\"").append(redirectPathSource.getFrontHost()).append("/#selectRoles?SuperiorPartnerID=")
+      StringBuilder contentSB = new StringBuilder("注册链接<a href=\"").append(redirectPathSource.getFrontHost()).append("/#/selectRoles?SuperiorPartnerID=")
         .append(partner.getId()).append("\">请点这里</a>");
       messageJson.put("content", contentSB.toString());
       messageList.add(messageJson);

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

@@ -148,10 +148,9 @@ public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> impleme
       }
     }
 
+    userRoleService.addUserRole(user, user.getNickname(), user.getHeadimg(), doctor.getId(), 1, 99); //添加userRole
     //绑定合伙人
     if (!StringUtils.isEmpty(doctor.getPartnerID())) {
-      userRoleService.addUserRole(user, user.getNickname(), user.getHeadimg(), doctor.getId(), 1, 1); //添加userRole
-
       QueryWrapper<PartnerRecommend> recQuery = new QueryWrapper<>();
       recQuery.eq("subordinate_id", doctor.getId());
       int reci = partnerRecommendService.count(recQuery);
@@ -169,18 +168,6 @@ public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> impleme
   public ResultInfo update(Doctor doctor) {
     String msg = "修改成功";
     Integer checkStatus = doctor.getCheckStatus() != null ? doctor.getCheckStatus() : 1;
-    QueryWrapper<UserRole> userRoleQuery = new QueryWrapper<>();
-    userRoleQuery.eq("user_role_type", 1);
-    userRoleQuery.eq("user_role_id", doctor.getId());
-    UserRole userRole = userRoleMapper.selectOne(userRoleQuery);
-    Integer userRoleStatus = checkStatus.equals(2) ? 1 : checkStatus.equals(1) ? 99 : 98;
-    if (userRole == null) {
-      userRole = new UserRole(1, doctor.getId(), doctor.getUnionid(), doctor.getAccountID(), doctor.getPhone(), doctor.getDoctorName(), userRoleStatus);
-      userRoleMapper.insert(userRole);
-    } else {
-      userRole.setUserRoleStatus(userRoleStatus);
-      userRoleMapper.updateById(userRole);
-    }
     if (2 == checkStatus) A:{
       JSONObject result = otherInsertDoctor(doctor);
       msg = "认证成功";
@@ -190,9 +177,6 @@ public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> impleme
         return ResultUtil.createFail("互联网医院:" + result.getString("errmsg"));
     }
     if (0 == checkStatus) {
-      if (userRole != null)
-        userRoleMapper.deleteById(userRole.getId());
-
       DoctorCheckCause cause = new DoctorCheckCause(doctor);
       dCCMapper.insertOne(cause);
     }
@@ -205,12 +189,20 @@ public class DoctorServiceImpl extends ServiceImpl<DoctorMapper, Doctor> impleme
     UserAccount account = new UserAccount();
     account.setGender(doctor.getGender());
     userAccountMapper.update(account, wrapper);
-    UserAccount user = userAccountMapper.selectOne(wrapper);
+
+    if(StringUtils.isNotBlank(doctor.getId())){
+      QueryWrapper<UserRole> userRoleQuery = new QueryWrapper<>();
+      userRoleQuery.eq("user_role_type", 1);
+      userRoleQuery.eq("user_role_id", doctor.getId());
+      Integer userRoleStatus = checkStatus.equals(2) ? 1 : checkStatus.equals(1) ? 99 : 98;
+      UserRole userRole = new UserRole();
+      userRole.setUserRoleStatus(userRoleStatus);
+      userRoleMapper.update(userRole,userRoleQuery);
+    }
 
     //绑定合伙人
+    UserAccount user = userAccountMapper.selectOne(wrapper);
     if (StringUtils.isNotBlank(doctor.getPartnerID()) && user != null) {
-      userRoleService.addUserRole(user, user.getNickname(), user.getHeadimg(), doctor.getId(), 1, 1); //添加userRole
-
       QueryWrapper<PartnerRecommend> recQuery = new QueryWrapper<>();
       recQuery.eq("subordinate_id", doctor.getId());
       int reci = partnerRecommendService.count(recQuery);

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

@@ -115,7 +115,7 @@ public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> i
     if (userRole != null && !userRole.getUserRoleStatus().equals(1)) { //不正常页面
       if (type == 1) {
         if (userRole.getUserRoleStatus().equals(98) || userRole.getUserRoleStatus().equals(99))
-          res.sendRedirect(redirectPathSource.getDoctorToBeCertified());
+          res.sendRedirect(redirectPathSource.getPersonalInfo());
         else
           res.sendRedirect(redirectPathSource.getDoctorDeactivation());
       } else if (type == 2) {

+ 2 - 2
ymall/src/main/resources/application-pgdev.properties

@@ -47,8 +47,8 @@ ymall.path.guideFlow= https://mem.360lj.com/ui1/#/h5Flow
 ymall.path.activityhelpPage= https://mem.360lj.com/ui1/#/friendsHelp
 ymall.path.activityIndex= https://mem.360lj.com/ui1/#/myHelp
 ymall.path.signUp= https://mem.360lj.com/uilyf/#/SignUp
-ymall.path.doctorDeactivation= https://mem.360lj.com/uilyf/#/DoctorDeactivation
-ymall.path.doctorToBeCertified= https://mem.360lj.com/uilyf/#/DoctorToBeCertified
+ymall.path.doctorDeactivation= https://mem.360lj.com/uilyf/#/doctorMine
+ymall.path.doctorToBeCertified= https://mem.360lj.com/uilyf/#/doctorFlow
 ymall.path.doctorHome= https://mem.360lj.com/uilyf/#/DoctorHome
 ymall.path.partnerDeactivation= https://mem.360lj.com/uilyf/#/PartnerDeactivation
 ymall.path.partnerToBeCertified= https://mem.360lj.com/uilyf/#/PartnerToBeCertified