支持多公司使用
This commit is contained in:
parent
b92c98a222
commit
457d1cf846
|
|
@ -72,6 +72,27 @@ public class SysDept extends BaseEntity
|
||||||
/** 备注信息 */
|
/** 备注信息 */
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/** 所属组织id */
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCompanyId() {
|
||||||
|
return companyId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompanyId(Long companyId) {
|
||||||
|
this.companyId = companyId;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getDeptId()
|
public Long getDeptId()
|
||||||
{
|
{
|
||||||
return deptId;
|
return deptId;
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,17 @@ public class SysRole extends BaseEntity
|
||||||
/** 数据所属组织 */
|
/** 数据所属组织 */
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
|
/** 所属组织id */
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
public Long getCompanyId() {
|
||||||
|
return companyId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompanyId(Long companyId) {
|
||||||
|
this.companyId = companyId;
|
||||||
|
}
|
||||||
|
|
||||||
public SysRole()
|
public SysRole()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -259,6 +270,7 @@ public class SysRole extends BaseEntity
|
||||||
.append("updateTime", getUpdateTime())
|
.append("updateTime", getUpdateTime())
|
||||||
.append("remark", getRemark())
|
.append("remark", getRemark())
|
||||||
.append("deptName", getDeptName())
|
.append("deptName", getDeptName())
|
||||||
|
.append("companyId", getCompanyId())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,4 @@
|
||||||
<description>
|
<description>
|
||||||
sgzb-modules业务模块
|
sgzb-modules业务模块
|
||||||
</description>
|
</description>
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.bonus.sgzb</groupId>
|
|
||||||
<artifactId>sgzb-api-system</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,12 @@
|
||||||
<artifactId>tencentcloud-sdk-java</artifactId>
|
<artifactId>tencentcloud-sdk-java</artifactId>
|
||||||
<version>3.1.423</version>
|
<version>3.1.423</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.qcloud</groupId>
|
||||||
|
<artifactId>cos_api</artifactId>
|
||||||
|
<version>5.6.54</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.bonus.sgzb.system.config;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description: 腾讯云cos配置
|
||||||
|
*
|
||||||
|
* @Author 阮世耀
|
||||||
|
* @Create 2023/12/3 16:26
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class ConstantPropertiesUtil implements InitializingBean {
|
||||||
|
|
||||||
|
@Value("${tencent.cos.file.region}")
|
||||||
|
private String region;
|
||||||
|
|
||||||
|
@Value("${tencent.cos.file.secretid}")
|
||||||
|
private String secretId;
|
||||||
|
|
||||||
|
@Value("${tencent.cos.file.secretkey}")
|
||||||
|
private String secretKey;
|
||||||
|
|
||||||
|
@Value("${tencent.cos.file.bucketname}")
|
||||||
|
private String bucketName;
|
||||||
|
|
||||||
|
public static String END_POINT;
|
||||||
|
public static String ACCESS_KEY_ID;
|
||||||
|
public static String ACCESS_KEY_SECRET;
|
||||||
|
public static String BUCKET_NAME;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterPropertiesSet() throws Exception {
|
||||||
|
END_POINT = region;
|
||||||
|
ACCESS_KEY_ID = secretId;
|
||||||
|
ACCESS_KEY_SECRET = secretKey;
|
||||||
|
BUCKET_NAME = bucketName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -48,25 +48,25 @@ import java.util.stream.Collectors;
|
||||||
@RequestMapping("/user")
|
@RequestMapping("/user")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SysUserController extends BaseController {
|
public class SysUserController extends BaseController {
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysUserService userService;
|
private ISysUserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysRoleService roleService;
|
private ISysRoleService roleService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysDeptService deptService;
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysPostService postService;
|
private ISysPostService postService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysSmsService smsService;
|
private ISysSmsService smsService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysPermissionService permissionService;
|
private ISysPermissionService permissionService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private ISysConfigService configService;
|
private ISysConfigService configService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -220,6 +220,7 @@ public class SysUserController extends BaseController {
|
||||||
}
|
}
|
||||||
user.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getUserName());
|
user.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getUserName());
|
||||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||||
|
|
||||||
return toAjax(userService.insertUser(user));
|
return toAjax(userService.insertUser(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import com.bonus.sgzb.system.service.ISysDeptService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -29,10 +30,10 @@ import java.util.stream.Collectors;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysDeptServiceImpl implements ISysDeptService {
|
public class SysDeptServiceImpl implements ISysDeptService {
|
||||||
@Autowired
|
@Resource
|
||||||
private SysDeptMapper deptMapper;
|
private SysDeptMapper deptMapper;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private SysRoleMapper roleMapper;
|
private SysRoleMapper roleMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,28 @@ package com.bonus.sgzb.system.service.impl;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.bonus.sgzb.common.core.utils.DateTimeHelper;
|
import com.bonus.sgzb.common.core.utils.DateTimeHelper;
|
||||||
import com.bonus.sgzb.common.core.utils.GlobalConstants;
|
import com.bonus.sgzb.common.core.utils.GlobalConstants;
|
||||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
import com.bonus.sgzb.common.core.utils.uuid.IdUtils;
|
||||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.sgzb.system.config.ConstantPropertiesUtil;
|
||||||
import com.bonus.sgzb.system.domain.FileInfo;
|
import com.bonus.sgzb.system.domain.FileInfo;
|
||||||
import com.bonus.sgzb.system.mapper.FileInfoMapper;
|
import com.bonus.sgzb.system.mapper.FileInfoMapper;
|
||||||
import com.bonus.sgzb.system.service.SysFileService;
|
import com.bonus.sgzb.system.service.SysFileService;
|
||||||
import com.bonus.sgzb.system.service.feign.FileClient;
|
import com.bonus.sgzb.system.service.feign.FileClient;
|
||||||
|
import com.qcloud.cos.COSClient;
|
||||||
|
import com.qcloud.cos.ClientConfig;
|
||||||
|
import com.qcloud.cos.auth.BasicCOSCredentials;
|
||||||
|
import com.qcloud.cos.auth.COSCredentials;
|
||||||
|
import com.qcloud.cos.http.HttpProtocol;
|
||||||
|
import com.qcloud.cos.model.ObjectMetadata;
|
||||||
|
import com.qcloud.cos.model.PutObjectRequest;
|
||||||
|
import com.qcloud.cos.model.PutObjectResult;
|
||||||
|
import com.qcloud.cos.region.Region;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.hwpf.extractor.WordExtractor;
|
import org.apache.poi.hwpf.extractor.WordExtractor;
|
||||||
import org.apache.poi.openxml4j.util.ZipSecureFile;
|
import org.apache.poi.openxml4j.util.ZipSecureFile;
|
||||||
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||||
|
import org.joda.time.DateTime;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -63,9 +74,10 @@ public class SysFileServiceImpl implements SysFileService {
|
||||||
List<MultipartFile> items = (List<MultipartFile>) map.get("filePath");
|
List<MultipartFile> items = (List<MultipartFile>) map.get("filePath");
|
||||||
MultipartFile item = items.get(0);
|
MultipartFile item = items.get(0);
|
||||||
try {
|
try {
|
||||||
String url = saveFile(request, item, photoType);
|
//String url = saveFile(request, item, photoType);
|
||||||
//AjaxResult res = fileClient.uploadFile(item);
|
/*AjaxResult res = fileClient.uploadFile(item);
|
||||||
//String url = (String) res.get("msg");
|
String url = (String) res.get("msg");*/
|
||||||
|
String url = this.uploadFile(item);
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
int words = getFileText(item);
|
int words = getFileText(item);
|
||||||
String fileName = item.getOriginalFilename();
|
String fileName = item.getOriginalFilename();
|
||||||
|
|
@ -87,6 +99,52 @@ public class SysFileServiceImpl implements SysFileService {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 腾讯云文件上传
|
||||||
|
* @param file
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String uploadFile(MultipartFile file) {
|
||||||
|
// 1 初始化用户身份信息(secretId, secretKey)。
|
||||||
|
String secretId = ConstantPropertiesUtil.ACCESS_KEY_ID;
|
||||||
|
String secretKey = ConstantPropertiesUtil.ACCESS_KEY_SECRET;
|
||||||
|
COSCredentials cred = new BasicCOSCredentials(secretId, secretKey);
|
||||||
|
// 2 设置 bucket 的地域, COS 地域的简称请参照 https://cloud.tencent.com/document/product/436/6224
|
||||||
|
Region region = new Region(ConstantPropertiesUtil.END_POINT);
|
||||||
|
ClientConfig clientConfig = new ClientConfig();
|
||||||
|
// 这里建议设置使用 https 协议
|
||||||
|
clientConfig.setHttpProtocol(HttpProtocol.https);
|
||||||
|
clientConfig.setRegion(region);
|
||||||
|
// 3 生成 cos 客户端。
|
||||||
|
COSClient cosClient = new COSClient(cred, clientConfig);
|
||||||
|
|
||||||
|
// 存储桶的命名格式为 BucketName-APPID,此处填写的存储桶名称必须为此格式
|
||||||
|
String bucketName = ConstantPropertiesUtil.BUCKET_NAME;
|
||||||
|
// 对象键(Key)是对象在存储桶中的唯一标识。 998u-09iu-09i-333
|
||||||
|
//在文件名称前面添加uuid值
|
||||||
|
String key = IdUtils.fastSimpleUuid() + file.getOriginalFilename();
|
||||||
|
//对上传文件分组,根据当前日期 /2024/04/02
|
||||||
|
String dateTime = new DateTime().toString("yyyy/MM/dd");
|
||||||
|
key = dateTime+"/"+key;
|
||||||
|
try {
|
||||||
|
//获取上传文件输入流
|
||||||
|
InputStream inputStream = file.getInputStream();
|
||||||
|
ObjectMetadata objectMetadata = new ObjectMetadata();
|
||||||
|
PutObjectRequest putObjectRequest = new PutObjectRequest(
|
||||||
|
bucketName,
|
||||||
|
key,
|
||||||
|
inputStream,
|
||||||
|
objectMetadata);
|
||||||
|
// 高级接口会返回一个异步结果Upload
|
||||||
|
PutObjectResult putObjectResult = cosClient.putObject(putObjectRequest);
|
||||||
|
// 返回上传文件路径:https://ggkt-atguigu-1310644373.cos.ap-beijing.myqcloud.com/01.jpg
|
||||||
|
return "https://" + bucketName + "." + "cos" + "." + ConstantPropertiesUtil.END_POINT+".myqcloud.com" + "/" + key;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 头像上传
|
* 头像上传
|
||||||
*
|
*
|
||||||
|
|
@ -98,9 +156,10 @@ public class SysFileServiceImpl implements SysFileService {
|
||||||
FileInfo file = new FileInfo();
|
FileInfo file = new FileInfo();
|
||||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||||
try {
|
try {
|
||||||
String url = saveFilePic(item, fileType);
|
//String url = saveFilePic(item, fileType);
|
||||||
/*AjaxResult res = fileClient.uploadFile(item);
|
/*AjaxResult res = fileClient.uploadFile(item);
|
||||||
String url = (String) res.get("msg");*/
|
String url = (String) res.get("msg");*/
|
||||||
|
String url = this.uploadFile(item);
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
int words = getFileText(item);
|
int words = getFileText(item);
|
||||||
String fileName = item.getOriginalFilename();
|
String fileName = item.getOriginalFilename();
|
||||||
|
|
@ -145,7 +204,7 @@ public class SysFileServiceImpl implements SysFileService {
|
||||||
String tmpName = multipartFile.getOriginalFilename();
|
String tmpName = multipartFile.getOriginalFilename();
|
||||||
tmpName = tmpName.substring(tmpName.lastIndexOf("\\") + 1);
|
tmpName = tmpName.substring(tmpName.lastIndexOf("\\") + 1);
|
||||||
tmpName = IdUtil.fastSimpleUUID() + System.currentTimeMillis() + tmpName.substring(tmpName.lastIndexOf("."), tmpName.length());
|
tmpName = IdUtil.fastSimpleUUID() + System.currentTimeMillis() + tmpName.substring(tmpName.lastIndexOf("."), tmpName.length());
|
||||||
String imageFiles = localFilePath + fileType + "/";
|
String imageFiles = localFilePath+ "/" + fileType + "/";
|
||||||
String os = System.getProperty("os.name");
|
String os = System.getProperty("os.name");
|
||||||
if (os.toLowerCase().startsWith(GlobalConstants.STRING_WIN)) {
|
if (os.toLowerCase().startsWith(GlobalConstants.STRING_WIN)) {
|
||||||
imageFiles = "D://files/" + fileType + "/";
|
imageFiles = "D://files/" + fileType + "/";
|
||||||
|
|
|
||||||
|
|
@ -67,14 +67,14 @@ public class SysSmsServiceImpl implements ISysSmsService {
|
||||||
if (phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) {
|
if (phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) {
|
||||||
return AjaxResult.error("手机号格式不正确");
|
return AjaxResult.error("手机号格式不正确");
|
||||||
}
|
}
|
||||||
/* try {
|
try {
|
||||||
String[] args = msg.split(",");
|
String[] args = msg.split(",");
|
||||||
String body = sendMessageNew(phone,tencentSmsConfig.getTemplateId().get(0),args);
|
String body = sendMessageNew(phone,tencentSmsConfig.getTemplateId().get(0),args);
|
||||||
return success("发送手机号码:" + phone + ",内容:" + msg + ",返回结果:" + body);
|
return success("发送手机号码:" + phone + ",内容:" + msg + ",返回结果:" + body);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return AjaxResult.error("发送失败:" + e.getMessage());
|
return AjaxResult.error("发送失败:" + e.getMessage());
|
||||||
}*/
|
}
|
||||||
return sendMsgByPhone( phone, msg);
|
// return sendMsgByPhone( phone, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -247,7 +247,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return resp.getRequestId();
|
return resp.getRequestId();
|
||||||
} catch (TencentCloudSDKException e) {
|
} catch (TencentCloudSDKException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
log.error("短信发送失败:{}", e.getMessage());
|
log.error("短信发送失败:{}", e.getMessage());
|
||||||
|
|
|
||||||
|
|
@ -39,28 +39,28 @@ import java.util.stream.Collectors;
|
||||||
public class SysUserServiceImpl implements ISysUserService {
|
public class SysUserServiceImpl implements ISysUserService {
|
||||||
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private SysUserMapper userMapper;
|
private SysUserMapper userMapper;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private SysRoleMapper roleMapper;
|
private SysRoleMapper roleMapper;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private SysPostMapper postMapper;
|
private SysPostMapper postMapper;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private SysUserRoleMapper userRoleMapper;
|
private SysUserRoleMapper userRoleMapper;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private SysUserPostMapper userPostMapper;
|
private SysUserPostMapper userPostMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ISysConfigService configService;
|
private ISysConfigService configService;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
protected Validator validator;
|
protected Validator validator;
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private SysDeptMapper deptMapper;
|
private SysDeptMapper deptMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -238,10 +238,11 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int insertUser(SysUser user) {
|
public int insertUser(SysUser user) {
|
||||||
// 暂时使用,需修改
|
// 暂时使用,需修改
|
||||||
Long deptId = user.getDeptId();
|
//南网改造,所属组织存公司id------20240516
|
||||||
|
/* Long deptId = user.getDeptId();
|
||||||
SysDept sysDept = deptMapper.selectDeptById(deptId);
|
SysDept sysDept = deptMapper.selectDeptById(deptId);
|
||||||
String ancestors = sysDept.getAncestors();
|
String ancestors = sysDept.getAncestors();
|
||||||
String[] split = ancestors.split(",");
|
String[] split = ancestors.split(",");*/
|
||||||
/* List<SysDept> deptList = deptMapper.selectDeptByAncestors(split);
|
/* List<SysDept> deptList = deptMapper.selectDeptByAncestors(split);
|
||||||
for (SysDept dept : deptList) {
|
for (SysDept dept : deptList) {
|
||||||
String ancestors1 = dept.getAncestors();
|
String ancestors1 = dept.getAncestors();
|
||||||
|
|
@ -252,14 +253,15 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
user.setCompanyId(dept.getDeptId());
|
user.setCompanyId(dept.getDeptId());
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
if (split.length == 2) {
|
//南网改造,所属组织存公司id------20240516
|
||||||
|
/* if (split.length == 2) {
|
||||||
//表示属于分公司
|
//表示属于分公司
|
||||||
user.setCompanyId(sysDept.getDeptId());
|
user.setCompanyId(sysDept.getDeptId());
|
||||||
}
|
}
|
||||||
if (split.length >= 3) {
|
if (split.length >= 3) {
|
||||||
//表示属于分公司下的某个部门
|
//表示属于分公司下的某个部门
|
||||||
user.setCompanyId(Long.parseLong(split[2]));
|
user.setCompanyId(Long.parseLong(split[2]));
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// 新增用户信息
|
// 新增用户信息
|
||||||
int rows = userMapper.insertUser(user);
|
int rows = userMapper.insertUser(user);
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,19 @@ tencent:
|
||||||
smsSign: 南方电网互联网
|
smsSign: 南方电网互联网
|
||||||
#云平台模板id 2116937-验收通知 2115503-登录验证
|
#云平台模板id 2116937-验收通知 2115503-登录验证
|
||||||
templateId: 2116937,2115503
|
templateId: 2116937,2115503
|
||||||
|
# 腾讯云cos
|
||||||
|
cos:
|
||||||
|
file:
|
||||||
|
# 存储桶所在地域
|
||||||
|
region: ap-guangzhou
|
||||||
|
# 存储桶所在地域
|
||||||
|
bucketregion: ap-guangzhou
|
||||||
|
# 存储桶名称
|
||||||
|
bucketname: prod-rental-1301524038
|
||||||
|
# API账号
|
||||||
|
secretid: AKIDrreCVaRKDtMcgfU5QW9iEfv67tMfldJn
|
||||||
|
# API密钥
|
||||||
|
secretkey: OXUgeMo0yhBRTGo6sVu3yiFX4rQtAzc3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time" />
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark" />
|
||||||
|
<result property="companyId" column="company_id" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectDeptVo">
|
<sql id="selectDeptVo">
|
||||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time,
|
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time,
|
||||||
d.remark
|
d.remark,d.company_id
|
||||||
from sys_dept d
|
from sys_dept d
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
@ -44,6 +45,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
AND status = #{status}
|
AND status = #{status}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="companyId != null and companyId != ''">
|
||||||
|
AND company_id = #{companyId}
|
||||||
|
</if>
|
||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
${params.dataScope}
|
${params.dataScope}
|
||||||
order by d.parent_id, d.order_num
|
order by d.parent_id, d.order_num
|
||||||
|
|
@ -99,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="email != null and email != ''">email,</if>
|
<if test="email != null and email != ''">email,</if>
|
||||||
<if test="status != null">status,</if>
|
<if test="status != null">status,</if>
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="companyId != null and companyId != ''">company_id,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||||
|
|
@ -111,6 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="email != null and email != ''">#{email},</if>
|
<if test="email != null and email != ''">#{email},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
||||||
sysdate()
|
sysdate()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<sql id="selectRoleVo">
|
<sql id="selectRoleVo">
|
||||||
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
|
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
|
||||||
r.status, r.del_flag, r.create_time, r.remark ,IFNULL(CONCAT_WS('/', d3.dept_name, d2.dept_name, d1.dept_name), 'Unknown') AS dept_name
|
r.status, r.del_flag, r.create_time, r.remark ,r.company_id,IFNULL(CONCAT_WS('/', d3.dept_name, d2.dept_name, d1.dept_name), 'Unknown') AS dept_name
|
||||||
from sys_role r
|
from sys_role r
|
||||||
left join sys_user_role ur on ur.role_id = r.role_id
|
left join sys_user_role ur on ur.role_id = r.role_id
|
||||||
left join sys_user u on u.user_id = ur.user_id
|
left join sys_user u on u.user_id = ur.user_id
|
||||||
|
|
@ -110,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="status != null and status != ''">status,</if>
|
<if test="status != null and status != ''">status,</if>
|
||||||
<if test="remark != null and remark != ''">remark,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="companyId != null and companyId != ''">company_id,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
<if test="roleId != null and roleId != 0">#{roleId},</if>
|
<if test="roleId != null and roleId != 0">#{roleId},</if>
|
||||||
|
|
@ -122,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="status != null and status != ''">#{status},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
||||||
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
||||||
sysdate()
|
sysdate()
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectUserVo">
|
<sql id="selectUserVo">
|
||||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.company_id,
|
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.company_id,
|
||||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
||||||
from sys_user u
|
from sys_user u
|
||||||
|
|
@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserList" parameterType="com.bonus.sgzb.system.api.domain.SysUser" resultMap="SysUserResult">
|
<select id="selectUserList" parameterType="com.bonus.sgzb.system.api.domain.SysUser" resultMap="SysUserResult">
|
||||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.company_id, d.dept_name, d.leader from sys_user u
|
||||||
left join sys_dept d on u.dept_id = d.dept_id
|
left join sys_dept d on u.dept_id = d.dept_id
|
||||||
where u.del_flag = '0'
|
where u.del_flag = '0'
|
||||||
<if test="userId != null and userId != 0">
|
<if test="userId != null and userId != 0">
|
||||||
|
|
@ -70,6 +70,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
AND u.status = #{status}
|
AND u.status = #{status}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="companyId != null and companyId != ''">
|
||||||
|
AND u.company_id = #{companyId}
|
||||||
|
</if>
|
||||||
<if test="phonenumber != null and phonenumber != ''">
|
<if test="phonenumber != null and phonenumber != ''">
|
||||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue