Pārlūkot izejas kodu

医生模块多账户

liangpeile 1 gadu atpakaļ
vecāks
revīzija
3330069fdf

+ 60 - 32
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/controller/AdminDoctorUserController.java

@@ -1,10 +1,7 @@
 package org.jeecg.modules.adminuser.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.io.IOException;
-import java.util.UUID;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -21,6 +18,7 @@ import org.jeecg.common.util.PasswordUtil;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.config.shiro.ShiroRealm;
 import org.jeecg.modules.adminuser.entity.*;
+import org.jeecg.modules.adminuser.service.IAdminCompSelectService;
 import org.jeecg.modules.adminuser.service.IAdminTransferAccountsService;
 import org.jeecg.modules.adminuser.service.IAdminUserService;
 
@@ -62,6 +60,8 @@ public class AdminDoctorUserController extends JeecgController<AdminUser, IAdmin
     private ISysUserService sysUserService;
     @Autowired
     private IAdminTransferAccountsService adminTransferAccountsService;
+    @Autowired
+    private IAdminCompSelectService adminCompSelectService;
 
     /**
      * 分页列表查询
@@ -79,28 +79,58 @@ public class AdminDoctorUserController extends JeecgController<AdminUser, IAdmin
                                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                                   HttpServletRequest req, String ssname, String ssphone, String ssksname, String ssdwname) {
+
+
+
         QueryWrapper<AdminUser> queryWrapper = QueryGenerator.initQueryWrapper(adminUser, req.getParameterMap());
-        queryWrapper.eq("doctor_and_specialist", "1");
-        if (ssname != null) {
-            queryWrapper.like("name", ssname);
-        }
-        if (ssphone != null) {
-            queryWrapper.like("phone", ssphone);
-        }
-        if (ssksname != null) {
-            queryWrapper.like("ksname", ssksname);
-        }
-        if (ssdwname != null) {
-            queryWrapper.like("dwname", ssdwname);
-        }
+        ArrayList<AdminUser> adminUsers = new ArrayList<>();
+        IPage<AdminUser> pageList = null;
+
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
         List<String> role = sysUserService.getRole(sysUser.getUsername());
+
+        QueryWrapper<AdminCompSelect> adminCompSelectLambdaQueryWrapper = new QueryWrapper<>();
+
         if (!role.contains("admin")) {
-            queryWrapper.eq("sys_org_code", sysUser.getOrgCode());
+            adminCompSelectLambdaQueryWrapper.eq("sys_org_code", sysUser.getOrgCode());
+        }
+        List<AdminCompSelect> list = adminCompSelectService.list(adminCompSelectLambdaQueryWrapper);
+
+        for (AdminCompSelect adminCompSelect : list) {
+            String orderId = adminCompSelect.getOrderId();
+
+            queryWrapper.eq("doctor_and_specialist", "1");
+            if (ssname != null) {
+                queryWrapper.like("name", ssname);
+            }
+            if (ssphone != null) {
+                queryWrapper.like("phone", ssphone);
+            }
+            if (ssksname != null) {
+                queryWrapper.like("ksname", ssksname);
+            }
+            if (ssdwname != null) {
+                queryWrapper.like("dwname", ssdwname);
+            }
+            queryWrapper.eq("id", orderId);
+
+            Page<AdminUser> page = new Page<AdminUser>(pageNo, pageSize);
+            pageList = adminUserService.page(page, queryWrapper);
+            List<AdminUser> records = pageList.getRecords();
+            for (AdminUser record : records) {
+                record.setAvatar(adminCompSelect.getAvatar());
+                record.setCardPic(adminCompSelect.getCardPic());
+                record.setKsname(adminCompSelect.getKsName());
+                record.setDwname(adminCompSelect.getDwName());
+                adminUsers.add(record);
+            }
         }
-        Page<AdminUser> page = new Page<AdminUser>(pageNo, pageSize);
-        IPage<AdminUser> pageList = adminUserService.page(page, queryWrapper);
+        pageList.setRecords(adminUsers);
+
+
         return Result.OK(pageList);
+
+
     }
 
     /**
@@ -128,7 +158,7 @@ public class AdminDoctorUserController extends JeecgController<AdminUser, IAdmin
     @ApiOperation(value = "用户管理-编辑", notes = "用户管理-编辑")
     @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
     public Result<String> edit(@RequestBody AdminUser adminUser) {
-        adminUserService.updateById(adminUser);
+        adminUserService.updateByUser(adminUser);
         return Result.OK("编辑成功!");
     }
 
@@ -285,15 +315,15 @@ public class AdminDoctorUserController extends JeecgController<AdminUser, IAdmin
 
     @ApiOperation(value = "支付回调接口", notes = "支付回调接口")
     @PostMapping(value = "notifyUrl")
-    public String  notifyUrl(@RequestHeader("dealer-id") String dealerId,
-                               @RequestHeader("request-id") String requestId,
-                               @RequestParam(name = "data", required = true) String data,
-                               @RequestParam(name = "mess", required = true) String mess,
-                               @RequestParam(name = "timestamp", required = true) String timestamp,
-                               @RequestParam(name = "sign", required = true) String sign,
-                               @RequestParam(name = "sign_type", required = true) String sign_type,
-                               HttpServletRequest request) {
-        return adminTransferAccountsService.notifyUrl(requestId,data,mess,timestamp,sign,sign_type);
+    public String notifyUrl(@RequestHeader("dealer-id") String dealerId,
+                            @RequestHeader("request-id") String requestId,
+                            @RequestParam(name = "data", required = true) String data,
+                            @RequestParam(name = "mess", required = true) String mess,
+                            @RequestParam(name = "timestamp", required = true) String timestamp,
+                            @RequestParam(name = "sign", required = true) String sign,
+                            @RequestParam(name = "sign_type", required = true) String sign_type,
+                            HttpServletRequest request) {
+        return adminTransferAccountsService.notifyUrl(requestId, data, mess, timestamp, sign, sign_type);
     }
 
 //    @ApiOperation(value = "云账户批量支付接口信息存储", notes = "云账户批量支付接口信息存储")
@@ -310,6 +340,4 @@ public class AdminDoctorUserController extends JeecgController<AdminUser, IAdmin
 //    }
 
 
-
-
 }

+ 1 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/controller/AdminTransferAccountsController.java

@@ -84,6 +84,7 @@ public class AdminTransferAccountsController extends JeecgController<AdminTransf
 		}
 		Page<AdminTransferAccounts> page = new Page<AdminTransferAccounts>(pageNo, pageSize);
 		IPage<AdminTransferAccounts> pageList = adminTransferAccountsService.page(page, queryWrapper);
+
 		return Result.OK(pageList);
 	}
 

+ 18 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/entity/AdminCompSelect.java

@@ -62,4 +62,22 @@ public class AdminCompSelect implements Serializable {
 	@Excel(name = "外键", width = 15)
     @ApiModelProperty(value = "外键")
     private String orderId;
+
+    @Excel(name = "科室名称", width = 15)
+    @ApiModelProperty(value = "科室名称")
+    private String ksName;
+
+    @Excel(name = "单位名称", width = 15)
+    @ApiModelProperty(value = "单位名称")
+    private String dwName;
+
+    @Excel(name = "头像", width = 15)
+    @ApiModelProperty(value = "头像")
+    private String avatar;
+
+    @Excel(name = "证件照", width = 15)
+    @ApiModelProperty(value = "证件照")
+    private String cardPic;
+
+
 }

+ 2 - 0
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/service/IAdminUserService.java

@@ -34,4 +34,6 @@ public interface IAdminUserService extends IService<AdminUser> {
 
     //获取用户签约状态
     Result<?> getApiUserSignStatus(String authorization);
+
+    void updateByUser(AdminUser adminUser);
 }

+ 23 - 3
medical_history/jeecg-boot-module-system/src/main/java/org/jeecg/modules/adminuser/service/impl/AdminUserServiceImpl.java

@@ -134,6 +134,10 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
             adminCompSelect.setPhone(phone);
             adminCompSelect.setCompName(compName);
             adminCompSelect.setSysOrgCode(adminUser.getSysOrgCode());
+            adminCompSelect.setKsName(adminUser.getKsname());
+            adminCompSelect.setDwName(adminUser.getDwname());
+            adminCompSelect.setAvatar(adminUser.getAvatar());
+            adminCompSelect.setCardPic(adminUser.getCardPic());
 
 
             QueryWrapper<AdminCompSelect> adminCompSelectQueryWrapper = new QueryWrapper<>();
@@ -155,6 +159,10 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
             adminCompSelect.setPhone(phone);
             adminCompSelect.setCompName(compName);
             adminCompSelect.setSysOrgCode(adminUser.getSysOrgCode());
+            adminCompSelect.setKsName(adminUser.getKsname());
+            adminCompSelect.setDwName(adminUser.getDwname());
+            adminCompSelect.setAvatar(adminUser.getAvatar());
+            adminCompSelect.setCardPic(adminUser.getCardPic());
 
             QueryWrapper<AdminCompSelect> adminCompSelectQueryWrapper = new QueryWrapper<>();
             adminCompSelectQueryWrapper.eq("phone", phone);
@@ -167,12 +175,9 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
             } else {
                 adminCompSelectService.save(adminCompSelect);
             }
-
-
             this.save(adminUser);
 
         }
-
         return Result.OK("操作成功");
 
     }
@@ -434,6 +439,21 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
         }
     }
 
+    @Override
+    public void updateByUser(AdminUser adminUser) {
+        String phone = adminUser.getPhone();
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        QueryWrapper<AdminCompSelect> adminCompSelectQueryWrapper = new QueryWrapper<>();
+        adminCompSelectQueryWrapper.eq("phone",phone);
+        adminCompSelectQueryWrapper.eq("sys_org_code",sysUser.getOrgCode());
+        AdminCompSelect adminCompSelect = adminCompSelectService.getOne(adminCompSelectQueryWrapper);
+        adminCompSelect.setKsName(adminUser.getKsname());
+        adminCompSelect.setDwName(adminUser.getDwname());
+        adminCompSelect.setAvatar(adminUser.getAvatar());
+        adminCompSelect.setCardPic(adminUser.getCardPic());
+        adminCompSelectService.updateById(adminCompSelect);
+    }
+
     private Result<?> bankCardFourAuthConfirm(AdminUserVO adminUserVO, AdminUser adminUser) {
         BankCardFourAuthConfirmRequest request = new BankCardFourAuthConfirmRequest();
         request.setCardNo(adminUserVO.getBackCard());