Преглед изворни кода

:bug:修复无法修改企业认证子账号的问题

Twelve615 пре 1 година
родитељ
комит
33b3fbb530

+ 3 - 10
crmeb-admin/src/main/java/com/zbkj/admin/controller/platform/NewPlatformApi.java

@@ -311,7 +311,9 @@ public class NewPlatformApi {
             String realName = userBypassAccount.getRealName();
             UserBypassAccount userBypassAccount1 = userBypassAccountService.getById(userBypassAccount.getId());
 
+            userBypassAccount1.setDepartmentId(userBypassAccount.getDepartmentId());
             userBypassAccount1.setDepartment(department);
+            userBypassAccount1.setOrganizationDepartmentUserId(userBypassAccount.getOrganizationDepartmentUserId());
             userBypassAccount1.setRealName(realName);
             userBypassAccountService.updateById(userBypassAccount1);
             return CommonResult.success("修改子账号信息成功");
@@ -690,7 +692,7 @@ public class NewPlatformApi {
     ) {
         ArrayList<OrganizationDepartmentUser> organizationDepartmentUsers = new ArrayList<>();
         LambdaQueryWrapper<OrganizationDepartment> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(OrganizationDepartment::getName, id);
+        queryWrapper.eq(OrganizationDepartment::getId, id);
         queryWrapper.eq(OrganizationDepartment::getOrganizationId, organizationId);
         List<OrganizationDepartment> list = organizationDepartmentService.list(queryWrapper);
         for (OrganizationDepartment organizationDepartment : list) {
@@ -785,15 +787,6 @@ public class NewPlatformApi {
     @ApiOperation(value = "企业账号编辑")
     @RequestMapping(value = "/enterpriseEdit", method = RequestMethod.POST)
     public CommonResult<UserEnterprise> organizationEdit(@RequestBody @Validated UserEnterprise request) {
-        LambdaQueryWrapper<OrganizationDepartment> departmentLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        departmentLambdaQueryWrapper.eq(OrganizationDepartment::getOrganizationId,request.getOrganizationId());
-        departmentLambdaQueryWrapper.eq(OrganizationDepartment::getName,request.getDepartment());
-        List<OrganizationDepartment> list = organizationDepartmentService.list(departmentLambdaQueryWrapper);
-        if (null!=list &&list.size()>0){
-            for (OrganizationDepartment organizationDepartment : list) {
-                request.setDepartId(organizationDepartment.getId());
-            }
-        }
         userEnterpriseService.updateById(request);
         return CommonResult.success("操作成功");
     }

+ 3 - 0
crmeb-common/src/main/java/com/zbkj/common/model/user/UserBypassAccount.java

@@ -43,6 +43,9 @@ public class UserBypassAccount implements Serializable {
     @ApiModelProperty(value = "用户账号")
     private String account;
 
+    @ApiModelProperty(value = "企业子账户id")
+    private String organizationDepartmentUserId;
+
     @ApiModelProperty(value = "真实姓名")
     private String realName;