xuhy
2 天以前 bf74fbaa6732c5a192555a856de585ac9f70f3aa
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TCrmBranchController.java
@@ -18,6 +18,7 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -192,6 +193,13 @@
                // 冻结
                sysUser.setStatus("1");
                sysUserService.updateUser(sysUser);
                // 查询业务员
                List<TCrmSalesperson> crmSalespersons = crmSalespersonService.list(Wrappers.lambdaQuery(TCrmSalesperson.class)
                        .eq(TCrmSalesperson::getBranchId, id));
                if(!CollectionUtils.isEmpty(crmSalespersons)){
                    List<Long> userIds = crmSalespersons.stream().map(TCrmSalesperson::getUserId).collect(Collectors.toList());
                    sysUserService.updateUserStatusByUserIds(userIds, "1");
                }
                break;
        }
        return R.ok();