初始化

This commit is contained in:
gxwebsoft
2023-06-04 00:28:12 +08:00
parent 912944faea
commit 428e4996f9
91 changed files with 12 additions and 10980 deletions

View File

@@ -1,149 +0,0 @@
package com.gxwebsoft.common.core.utils;
import com.gxwebsoft.oa.entity.Assets;
import com.gxwebsoft.oa.service.AssetsService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.net.URL;
import java.net.URLConnection;
import java.security.MessageDigest;
import java.util.Date;
/**
* 宝塔工具类
* @author 科技小王子
*
*/
@Component
public class BtUtil {
public static Integer tenantId;
public static String server;
public static String token;
private static String timestamp;
@Resource
private AssetsService assetsService;
// 实例化客户端
public BtUtil client(Integer id) {
Assets assets = assetsService.getByIdRel(id);
try {
String btSign = assets.getBtSign();
server = "http://".concat(assets.getCode()).concat(":9003");
String url = "http://".concat(assets.getCode()) + ":9003/system?action=GetSystemTotal";
timestamp = (new Date().getTime()+"");
String md5Sign = getMd5(btSign);
String temp = timestamp+md5Sign;
token = getMd5(temp);
String json = "request_time="+timestamp+"&request_token="+token;
String responseText = sendPost(url,json);
System.out.println("responseText = " + responseText);
System.out.println(responseText);
} catch (Exception e) {
e.printStackTrace();
}
return this;
}
public String getSystemTotal(){
String url = server.concat("/system?action=GetSystemTotal");
String json = "request_time="+timestamp+"&request_token="+token;
String responseText = sendPost(url,json);
System.out.println("responseText = " + responseText);
return responseText;
}
public String getDiskInfo(){
String url = server.concat("/system?action=GetDiskInfo");
String json = "request_time="+timestamp+"&request_token="+token;
return sendPost(url,json);
}
// public void config()
// {
// try {
// System.out.println("tenantId = " + tenantId);
// String btSign = "XXXXXXXXXXXXXXXXXXXXXXXX";
// String url = "http://XXX.XXX.XXX.XXX:8888/system?action=GetSystemTotal";
// String timestamp = (new Date().getTime()+"");
// String md5Sign = getMd5(btSign);
// String temp = timestamp+md5Sign;
// String token = getMd5(temp);
//
// String json = "request_time="+timestamp+"&request_token="+token;
// String responseText = sendPost(url,json);
// System.out.println(responseText);
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
public static String getMd5(String str) throws Exception
{
try {
// 生成一个MD5加密计算摘要
MessageDigest md = MessageDigest.getInstance("MD5");
// 计算md5函数
md.update(str.getBytes());
// digest()最后确定返回md5 hash值返回值为8为字符串。因为md5 hash值是16位的hex值实际上就是8位的字符
// BigInteger函数则将8位的字符串转换成16位hex值用字符串来表示得到字符串形式的hash值
return new BigInteger(1, md.digest()).toString(16);
} catch (Exception e) {
throw new Exception("MD5加密出现错误"+e.toString());
}
}
public static String sendPost(String url, String param) {
PrintWriter out = null;
BufferedReader in = null;
StringBuffer result = new StringBuffer();
try {
URL realUrl = new URL(url);
// 打开和URL之间的连接
URLConnection conn = realUrl.openConnection();
// 设置通用的请求属性
conn.setRequestProperty("accept", "text/xml,text/javascript,text/html,application/json");
conn.setRequestProperty("connection", "Keep-Alive");
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
// 获取URLConnection对象对应的输出流
out = new PrintWriter(conn.getOutputStream());
// 发送请求参数
out.print(param);
// flush输出流的缓冲
out.flush();
// 定义BufferedReader输入流来读取URL的响应
in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result.append(line);
}
} catch (Exception e) {
System.out.println("发送 POST 请求出现异常!"+e);
e.printStackTrace();
}
//使用finally块来关闭输出流、输入流
finally{
try{
if(out!=null){
out.close();
}
if(in!=null){
in.close();
}
}
catch(IOException ex){
ex.printStackTrace();
}
}
return result.toString();
}
}

View File

@@ -3,7 +3,6 @@ package com.gxwebsoft.common.core.utils;
import java.util.*;
import cn.hutool.crypto.SecureUtil;
import com.gxwebsoft.oa.entity.Tenant;
import org.apache.commons.lang3.StringUtils;
import com.alibaba.fastjson.JSONObject;

View File

@@ -33,7 +33,6 @@ import com.gxwebsoft.common.system.param.UpdatePasswordParam;
import com.gxwebsoft.common.system.result.CaptchaResult;
import com.gxwebsoft.common.system.result.LoginResult;
import com.gxwebsoft.common.system.service.*;
import com.gxwebsoft.oa.service.CustomerService;
import com.wf.captcha.SpecCaptcha;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

View File

@@ -9,8 +9,6 @@ import com.gxwebsoft.common.core.web.*;
import com.gxwebsoft.common.system.entity.Setting;
import com.gxwebsoft.common.system.param.SettingParam;
import com.gxwebsoft.common.system.service.SettingService;
import com.gxwebsoft.oa.entity.Tenant;
import com.gxwebsoft.oa.service.TenantService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -34,8 +32,6 @@ public class SettingController extends BaseController {
@Resource
private SettingService settingService;
@Resource
private TenantService tenantService;
@Resource
private CacheClient cacheClient;
@PreAuthorize("hasAuthority('sys:setting:save')")
@@ -99,11 +95,6 @@ public class SettingController extends BaseController {
final String siteName = jsonObject.getString("siteName");
final String logo = jsonObject.getString("logo");
System.out.println("siteName = " + siteName);
final Tenant tenant = new Tenant();
tenant.setTenantName(siteName);
tenant.setTenantId(getTenantId());
tenant.setLogo(logo);
tenantService.updateById(tenant);
}
return success("修改成功");
}

View File

@@ -3,7 +3,6 @@ package com.gxwebsoft.common.system.entity;
import cn.hutool.core.util.DesensitizedUtil;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gxwebsoft.oa.entity.App;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -200,10 +199,6 @@ public class User implements UserDetails {
@TableField(exist = false)
private String mobile;
@ApiModelProperty("应用信息")
@TableField(exist = false)
private App appInfo;
@ApiModelProperty("企业信息")
@TableField(exist = false)
private Company companyInfo;

View File

@@ -18,8 +18,6 @@ import com.gxwebsoft.common.system.service.CompanyService;
import com.gxwebsoft.common.system.service.RoleMenuService;
import com.gxwebsoft.common.system.service.UserRoleService;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.oa.entity.App;
import com.gxwebsoft.oa.service.AppService;
import com.gxwebsoft.shop.entity.Merchant;
import com.gxwebsoft.shop.entity.MerchantClerk;
import com.gxwebsoft.shop.service.MerchantClerkService;
@@ -62,8 +60,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
@Resource
private CacheClient cacheClient;
@Resource
private AppService appService;
@Resource
private CompanyService companyService;
@Resource
private StringRedisTemplate stringRedisTemplate;
@@ -93,12 +89,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
public void listRanking(UserParam param) {
List<User> list = baseMapper.selectListRel(param);
Map<String, String> map = new HashMap<>();
list.forEach(d -> {
int count = appService.count(new LambdaQueryWrapper<App>()
.eq(App::getUserId, d.getUserId()));
// 更新全部用户的插件数量
cacheClient.zAdd(USER_RANKING_BY_APPS,d.getUserId(), (double) count);
});
// list.forEach(d -> {
// int count = appService.count(new LambdaQueryWrapper<App>()
// .eq(App::getUserId, d.getUserId()));
// // 更新全部用户的插件数量
// cacheClient.zAdd(USER_RANKING_BY_APPS,d.getUserId(), (double) count);
// });
}
@Override

View File

@@ -1,10 +0,0 @@
package com.gxwebsoft.oa.constants;
public class NoticeConstants {
// 通知类型
public static final String NOTICE = "notice"; // 提醒
public static final String LETTER = "letter"; // 私信
public static final String TODO = "todo"; // 待办
public static final String CHAT_GPT = "chatGPT"; // AI机器人
}

View File

@@ -1,13 +0,0 @@
package com.gxwebsoft.oa.constants;
public class TaskConstants {
// 进度管理
public static final Integer PROGRESS0 = 0; // 待分派
public static final Integer PROGRESS1 = 1; // 待处理
public static final Integer PROGRESS2 = 2; // 处理中
public static final Integer PROGRESS3 = 3; // 待确认
public static final Integer PROGRESS4 = 4; // 待反馈
public static final Integer PROGRESS5 = 5; // 已完结
public static final Integer PROGRESS6 = 6; // 已关闭
}

View File

@@ -1,173 +0,0 @@
package com.gxwebsoft.oa.controller;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.utils.CacheClient;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.entity.App;
import com.gxwebsoft.oa.entity.AppUser;
import com.gxwebsoft.oa.param.AppParam;
import com.gxwebsoft.oa.service.AppService;
import com.gxwebsoft.oa.service.AppUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 应用管理记录表控制器
*
* @author 科技小王子
* @since 2023-03-28 10:45:39
*/
@Api(tags = "应用管理记录表管理")
@RestController
@RequestMapping("/api/oa/app")
public class AppController extends BaseController {
@Resource
private AppService appService;
@Resource
private CacheClient cacheClient;
@Resource
private AppUserService appUserService;
@PreAuthorize("hasAuthority('oa:app:list')")
@OperationLog
@ApiOperation("分页查询应用管理记录表")
@GetMapping("/page")
public ApiResult<PageResult<App>> page(AppParam param) {
final User loginUser = getLoginUser();
final Integer userId = loginUser.getUserId();
loginUser.getRoles().forEach(d -> {
if(!StrUtil.equals(d.getRoleCode(),"superAdmin") && !StrUtil.equals(d.getRoleCode(),"admin")){
// 非管理员按项目成员权限显示
final List<AppUser> list = appUserService.list(new LambdaQueryWrapper<AppUser>().eq(AppUser::getUserId, userId));
final Set<Integer> collect = list.stream().map(AppUser::getAppId).collect(Collectors.toSet());
param.setAppIds(collect);
}
});
// 使用关联查询
return success(appService.pageRel(param));
}
@PreAuthorize("hasAuthority('oa:app:list')")
@OperationLog
@ApiOperation("查询全部应用管理记录表")
@GetMapping()
public ApiResult<List<App>> list(AppParam param) {
// 使用关联查询
return success(appService.listRel(param));
}
@PreAuthorize("hasAuthority('oa:app:list')")
@OperationLog
@ApiOperation("根据id查询应用管理记录表")
@GetMapping("/{id}")
public ApiResult<App> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(appService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('oa:app:save')")
@OperationLog
@ApiOperation("添加应用管理记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody App app) {
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
app.setUserId(loginUser.getUserId());
app.setTenantId(loginUser.getTenantId());
}
if (appService.count(new LambdaQueryWrapper<App>()
.eq(App::getAppCode, app.getAppCode())) > 0) {
return fail("应用标识已存在");
}
if (appService.save(app)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:app:update')")
@OperationLog
@ApiOperation("修改应用管理记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody App app) {
if (appService.updateById(app)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:app:remove')")
@OperationLog
@ApiOperation("删除应用管理记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (appService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('oa:app:save')")
@OperationLog
@ApiOperation("批量添加应用管理记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<App> list) {
if (appService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:app:update')")
@OperationLog
@ApiOperation("批量修改应用管理记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<App> batchParam) {
if (batchParam.update(appService, "app_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:app:remove')")
@OperationLog
@ApiOperation("批量删除应用管理记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (appService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('oa:app:update')")
@ApiOperation("重置秘钥")
@PostMapping("/updateAppSecret")
public ApiResult<?> updateAppSecret(@RequestBody App app) {
if (app.getAppId() == null) {
return fail("请勿重复操作");
}
App result = appService.getByIdRel(app.getAppId());
String key = cacheClient.key("AppSecret", app.getAppId());
String appSecret = IdUtil.fastSimpleUUID();
cacheClient.set(key,appSecret);
result.setAppSecret(appSecret);
return success("重置成功",result);
}
}

View File

@@ -1,133 +0,0 @@
package com.gxwebsoft.oa.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.AppUser;
import com.gxwebsoft.oa.param.AppUserParam;
import com.gxwebsoft.oa.service.AppUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 应用成员控制器
*
* @author 科技小王子
* @since 2023-05-31 13:18:55
*/
@Api(tags = "应用成员管理")
@RestController
@RequestMapping("/api/oa/app-user")
public class AppUserController extends BaseController {
@Resource
private AppUserService appUserService;
@PreAuthorize("hasAuthority('oa:appUser:list')")
@OperationLog
@ApiOperation("分页查询应用成员")
@GetMapping("/page")
public ApiResult<PageResult<AppUser>> page(AppUserParam param) {
// 使用关联查询
return success(appUserService.pageRel(param));
}
@PreAuthorize("hasAuthority('oa:appUser:list')")
@OperationLog
@ApiOperation("查询全部应用成员")
@GetMapping()
public ApiResult<List<AppUser>> list(AppUserParam param) {
// 使用关联查询
if (param.getAppId() == null) {
return fail("AppId不存在",null);
}
return success(appUserService.listRel(param));
}
@PreAuthorize("hasAuthority('oa:appUser:list')")
@OperationLog
@ApiOperation("根据id查询应用成员")
@GetMapping("/{id}")
public ApiResult<AppUser> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(appUserService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('oa:appUser:save')")
@OperationLog
@ApiOperation("添加应用成员")
@PostMapping()
public ApiResult<?> save(@RequestBody AppUser appUser) {
if (appUserService.count(new LambdaQueryWrapper<AppUser>()
.eq(AppUser::getUserId, appUser.getUserId()).eq(AppUser::getAppId,appUser.getAppId())) > 0) {
return fail("该成员已存在");
}
if (appUserService.save(appUser)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:appUser:update')")
@OperationLog
@ApiOperation("修改应用成员")
@PutMapping()
public ApiResult<?> update(@RequestBody AppUser appUser) {
if (appUserService.updateById(appUser)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:appUser:remove')")
@OperationLog
@ApiOperation("删除应用成员")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (appUserService.removeById(id)) {
return success("移除成功");
}
return fail("移除失败");
}
@PreAuthorize("hasAuthority('oa:appUser:save')")
@OperationLog
@ApiOperation("批量添加应用成员")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<AppUser> list) {
if (appUserService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:appUser:update')")
@OperationLog
@ApiOperation("批量修改应用成员")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<AppUser> batchParam) {
if (batchParam.update(appUserService, "app_user_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:appUser:remove')")
@OperationLog
@ApiOperation("批量删除应用成员")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (appUserService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -1,141 +0,0 @@
package com.gxwebsoft.oa.controller;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.utils.BtUtil;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.entity.Assets;
import com.gxwebsoft.oa.param.AssetsParam;
import com.gxwebsoft.oa.service.AssetsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 服务器资产记录表控制器
*
* @author WebSoft
* @since 2022-11-16 11:13:16
*/
@Api(tags = "服务器资产记录表管理")
@RestController
@RequestMapping("/api/oa/assets")
public class AssetsController extends BaseController {
@Resource
private AssetsService assetsService;
@Resource
private BtUtil btUtil;
@PreAuthorize("hasAuthority('oa:assets:list')")
@OperationLog
@ApiOperation("分页查询服务器资产记录表")
@GetMapping("/page")
public ApiResult<PageResult<Assets>> page(AssetsParam param) {
// 使用关联查询
return success(assetsService.pageRel(param));
}
@PreAuthorize("hasAuthority('oa:assets:list')")
@OperationLog
@ApiOperation("查询全部服务器资产记录表")
@GetMapping()
public ApiResult<List<Assets>> list(AssetsParam param) {
// 使用关联查询
return success(assetsService.listRel(param));
}
@PreAuthorize("hasAuthority('oa:assets:list')")
@OperationLog
@ApiOperation("根据id查询服务器资产记录表")
@GetMapping("/{id}")
public ApiResult<Assets> get(@PathVariable("id") Integer id) {
final Assets assets = assetsService.getByIdRel(id);
final BtUtil client = btUtil.client(id);
final String systemTotal = client.getSystemTotal();
final String diskInfo = client.getDiskInfo();
System.out.println("diskInfo = " + diskInfo);
System.out.println("systemTotal = " + systemTotal);
assets.setSystemTotal(systemTotal);
assets.setDiskInfo(diskInfo);
// 使用关联查询
return success(assets);
}
@PreAuthorize("hasAuthority('oa:assets:save')")
@OperationLog
@ApiOperation("添加服务器资产记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Assets assets) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
assets.setUserId(loginUser.getUserId());
}
if (assetsService.save(assets)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:assets:update')")
@OperationLog
@ApiOperation("修改服务器资产记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Assets assets) {
if (assetsService.updateById(assets)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:assets:remove')")
@OperationLog
@ApiOperation("删除服务器资产记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (assetsService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('oa:assets:save')")
@OperationLog
@ApiOperation("批量添加服务器资产记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Assets> list) {
if (assetsService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:assets:update')")
@OperationLog
@ApiOperation("批量修改服务器资产记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Assets> batchParam) {
if (batchParam.update(assetsService, "assets_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:assets:remove')")
@OperationLog
@ApiOperation("批量删除服务器资产记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (assetsService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -1,131 +0,0 @@
package com.gxwebsoft.oa.controller;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.entity.Customer;
import com.gxwebsoft.oa.param.CustomerParam;
import com.gxwebsoft.oa.service.CustomerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 客户管理记录表控制器
*
* @author WebSoft
* @since 2022-11-16 11:16:14
*/
@Api(tags = "客户管理记录表管理")
@RestController
@RequestMapping("/api/oa/customer")
public class CustomerController extends BaseController {
@Resource
private CustomerService customerService;
@PreAuthorize("hasAuthority('oa:customer:list')")
@OperationLog
@ApiOperation("分页查询客户管理记录表")
@GetMapping("/page")
public ApiResult<PageResult<Customer>> page(CustomerParam param) {
// 使用关联查询
return success(customerService.pageRel(param));
}
@PreAuthorize("hasAuthority('oa:customer:list')")
@OperationLog
@ApiOperation("查询全部客户管理记录表")
@GetMapping()
public ApiResult<List<Customer>> list(CustomerParam param) {
// 使用关联查询
return success(customerService.listRel(param));
}
@PreAuthorize("hasAuthority('oa:customer:list')")
@OperationLog
@ApiOperation("根据id查询客户管理记录表")
@GetMapping("/{id}")
public ApiResult<Customer> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(customerService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('oa:customer:save')")
@OperationLog
@ApiOperation("添加客户管理记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Customer customer) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
customer.setUserId(loginUser.getUserId());
}
if (customerService.save(customer)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:customer:update')")
@OperationLog
@ApiOperation("修改客户管理记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Customer customer) {
if (customerService.updateById(customer)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:customer:remove')")
@OperationLog
@ApiOperation("删除客户管理记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (customerService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('oa:customer:save')")
@OperationLog
@ApiOperation("批量添加客户管理记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Customer> list) {
if (customerService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:customer:update')")
@OperationLog
@ApiOperation("批量修改客户管理记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Customer> batchParam) {
if (batchParam.update(customerService, "customer_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:customer:remove')")
@OperationLog
@ApiOperation("批量删除客户管理记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (customerService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -1,160 +0,0 @@
package com.gxwebsoft.oa.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.entity.Customer;
import com.gxwebsoft.oa.entity.Task;
import com.gxwebsoft.oa.service.NoticeService;
import com.gxwebsoft.oa.entity.Notice;
import com.gxwebsoft.oa.param.NoticeParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 消息记录表控制器
*
* @author 科技小王子
* @since 2023-03-22 14:07:26
*/
@Api(tags = "消息记录表管理")
@RestController
@RequestMapping("/api/oa/notice")
public class NoticeController extends BaseController {
@Resource
private NoticeService noticeService;
@PreAuthorize("hasAuthority('oa:notice:list')")
@OperationLog
@ApiOperation("分页查询消息记录表")
@GetMapping("/page")
public ApiResult<PageResult<Notice>> page(NoticeParam param) {
// 使用关联查询
param.setUserId(getLoginUserId());
return success(noticeService.pageRel(param));
}
@PreAuthorize("hasAuthority('oa:notice:list')")
@OperationLog
@ApiOperation("查询全部消息记录表")
@GetMapping()
public ApiResult<List<Notice>> list(NoticeParam param) {
// 使用关联查询
param.setUserId(getLoginUserId());
return success(noticeService.listRel(param));
}
@PreAuthorize("hasAuthority('oa:notice:list')")
@OperationLog
@ApiOperation("根据id查询消息记录表")
@GetMapping("/{id}")
public ApiResult<Notice> get(@PathVariable("id") Integer id) {
return success(noticeService.getById(id));
// 使用关联查询
//return success(noticeService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('oa:notice:save')")
@OperationLog
@ApiOperation("添加消息记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Notice notice) {
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
notice.setUserId(loginUser.getUserId());
}
if (noticeService.save(notice)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:notice:update')")
@OperationLog
@ApiOperation("修改消息记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Notice notice) {
if (noticeService.updateById(notice)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:notice:remove')")
@OperationLog
@ApiOperation("删除消息记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (noticeService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('oa:notice:save')")
@OperationLog
@ApiOperation("批量添加消息记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Notice> list) {
if (noticeService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:notice:update')")
@OperationLog
@ApiOperation("批量修改消息记录表")
@PutMapping("/batch")
public ApiResult<?> updateBatch(@RequestBody List<Notice> list) {
System.out.println("list = " + list);
if (noticeService.updateBatchById(list)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:notice:remove')")
@OperationLog
@ApiOperation("批量删除消息记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (noticeService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('oa:notice:list')")
@ApiOperation("统计信息")
@GetMapping("/getUnReadNum")
public ApiResult<?> getUnReadNum(){
JSONObject json = new JSONObject();
json.put("notice",noticeService.count(new LambdaQueryWrapper<Notice>()
.eq(Notice::getUserId, getLoginUserId())
.eq(Notice::getType,"notice")
.eq(Notice::getStatus,0)));
json.put("letter",noticeService.count(new LambdaQueryWrapper<Notice>()
.eq(Notice::getUserId, getLoginUserId())
.eq(Notice::getType,"letter")
.eq(Notice::getStatus,0)));
json.put("todo",noticeService.count(new LambdaQueryWrapper<Notice>()
.eq(Notice::getUserId, getLoginUserId())
.eq(Notice::getType,"todo")
.eq(Notice::getStatus,0)));
return success("操作成功",json);
}
}

View File

@@ -1,139 +0,0 @@
package com.gxwebsoft.oa.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.service.ProjectService;
import com.gxwebsoft.oa.entity.Project;
import com.gxwebsoft.oa.param.ProjectParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 项目管理表控制器
*
* @author WebSoft
* @since 2022-11-16 11:00:43
*/
@Api(tags = "项目管理表管理")
@RestController
@RequestMapping("/api/oa/project")
public class ProjectController extends BaseController {
@Resource
private ProjectService projectService;
@PreAuthorize("hasAuthority('oa:project:list')")
@OperationLog
@ApiOperation("分页查询项目管理表")
@GetMapping("/page")
public ApiResult<PageResult<Project>> page(ProjectParam param) {
PageParam<Project, ProjectParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(projectService.page(page, page.getWrapper()));
// 使用关联查询
//return success(projectService.pageRel(param));
}
@PreAuthorize("hasAuthority('oa:project:list')")
@OperationLog
@ApiOperation("查询全部项目管理表")
@GetMapping()
public ApiResult<List<Project>> list(ProjectParam param) {
PageParam<Project, ProjectParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(projectService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(projectService.listRel(param));
}
@PreAuthorize("hasAuthority('oa:project:list')")
@OperationLog
@ApiOperation("根据id查询项目管理表")
@GetMapping("/{id}")
public ApiResult<Project> get(@PathVariable("id") Integer id) {
return success(projectService.getById(id));
// 使用关联查询
//return success(projectService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('oa:project:save')")
@OperationLog
@ApiOperation("添加项目管理表")
@PostMapping()
public ApiResult<?> save(@RequestBody Project project) {
// 记录当前登录用户id、租户id
User loginUser = getLoginUser();
if (loginUser != null) {
project.setUserId(loginUser.getUserId());
}
if (projectService.save(project)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:project:update')")
@OperationLog
@ApiOperation("修改项目管理表")
@PutMapping()
public ApiResult<?> update(@RequestBody Project project) {
if (projectService.updateById(project)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:project:remove')")
@OperationLog
@ApiOperation("删除项目管理表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (projectService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('oa:project:save')")
@OperationLog
@ApiOperation("批量添加项目管理表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Project> list) {
if (projectService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:project:update')")
@OperationLog
@ApiOperation("批量修改项目管理表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Project> batchParam) {
if (batchParam.update(projectService, "project_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:project:remove')")
@OperationLog
@ApiOperation("批量删除项目管理表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (projectService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -1,193 +0,0 @@
package com.gxwebsoft.oa.controller;
import cn.hutool.core.util.StrUtil;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.*;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.oa.entity.Task;
import com.gxwebsoft.oa.entity.TaskRecord;
import com.gxwebsoft.oa.entity.TaskUser;
import com.gxwebsoft.oa.param.TaskParam;
import com.gxwebsoft.oa.service.NoticeService;
import com.gxwebsoft.oa.service.TaskRecordService;
import com.gxwebsoft.oa.service.TaskService;
import com.gxwebsoft.oa.service.TaskUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* 工单记录表控制器
*
* @author WebSoft
* @since 2022-11-16 11:21:43
*/
@Api(tags = "工单记录表管理")
@RestController
@RequestMapping("/api/oa/task")
public class TaskController extends BaseController {
@Resource
private TaskService taskService;
@Resource
private TaskRecordService taskRecordService;
@Resource
private TaskUserService taskUserService;
@Resource
private UserService userService;
@Resource
private NoticeService noticeService;
@PreAuthorize("hasAuthority('oa:task:list')")
@OperationLog
@ApiOperation("分页查询工单记录表")
@GetMapping("/page")
public ApiResult<PageResult<Task>> page(TaskParam param) {
// 使用关联查询
final User loginUser = getLoginUser();
final Integer type = loginUser.getType();
loginUser.getRoles().forEach(d -> {
if(!StrUtil.equals(d.getRoleCode(),"superAdmin") && !StrUtil.equals(d.getRoleCode(),"admin")){
// 如果是开发者账号则按受理人查询
if (type.equals(6)) {
param.setCommander(loginUser.getUserId());
}else{
param.setPromoter(getLoginUserId());
}
}
});
return success(taskService.pageRel(param));
}
@PreAuthorize("hasAuthority('oa:task:list')")
@OperationLog
@ApiOperation("查询全部工单记录表")
@GetMapping()
public ApiResult<List<Task>> list(TaskParam param) {
PageParam<Task, TaskParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(taskService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(taskService.listRel(param));
}
@PreAuthorize("hasAuthority('oa:task:list')")
@OperationLog
@ApiOperation("根据id查询工单记录表")
@GetMapping("/{id}")
public ApiResult<Task> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(taskService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('oa:task:save')")
@OperationLog
@ApiOperation("添加工单记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Task task) {
// 记录用户id
final Integer loginUserId = getLoginUserId();
Integer promoter = task.getPromoter();
task.setUserId(loginUserId);
task.setComments(StrUtil.sub(task.getContent(),0,200));
task.setPromoter(promoter != null ? promoter : loginUserId);
task.setLastReadUser(loginUserId);
if (taskService.save(task)) {
// 添加聊天内容明细
TaskRecord taskRecord = new TaskRecord();
taskRecord.setUserId(loginUserId);
taskRecord.setContent(task.getContent());
taskRecord.setTaskId(task.getTaskId());
taskRecord.setFiles(task.getFiles());
taskRecordService.save(taskRecord);
// 添加工单成员
TaskUser taskUser = new TaskUser();
taskUser.setUserId(loginUserId);
taskUser.setTaskId(task.getTaskId());
taskUserService.save(taskUser);
// 发待办提醒
if(task.getCommander() != null){
noticeService.addTodo(task);
}
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:task:update')")
@OperationLog
@ApiOperation("修改工单记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Task task) {
if(task.getCommander() != null && userService.getById(task.getCommander()) == null){
return fail("受理人不存在");
}
if (taskService.updateById(task)) {
// 发待办提醒
noticeService.addTodo(task);
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:task:remove')")
@OperationLog
@ApiOperation("删除工单记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (taskService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('oa:task:save')")
@OperationLog
@ApiOperation("批量添加工单记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Task> list) {
if (taskService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:task:update')")
@OperationLog
@ApiOperation("批量修改工单记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Task> batchParam) {
if (batchParam.update(taskService, "task_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:task:remove')")
@OperationLog
@ApiOperation("批量删除工单记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (taskService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('oa:task:list')")
@ApiOperation("统计信息")
@GetMapping("/count")
public ApiResult<?> count(TaskParam param){
// 验证签名
isCheckSign();
User loginUser = getLoginUser();
ArrayList<Object> countNum = taskService.getCountNum(loginUser,param);
return success("操作成功",countNum);
}
}

View File

@@ -1,157 +0,0 @@
package com.gxwebsoft.oa.controller;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.entity.Task;
import com.gxwebsoft.oa.service.*;
import com.gxwebsoft.oa.entity.TaskRecord;
import com.gxwebsoft.oa.param.TaskRecordParam;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import static com.gxwebsoft.oa.constants.NoticeConstants.LETTER;
import static com.gxwebsoft.oa.constants.TaskConstants.*;
/**
* 工单回复记录表控制器
*
* @author 科技小王子
* @since 2023-03-05 00:52:21
*/
@Api(tags = "工单回复记录表管理")
@RestController
@RequestMapping("/api/oa/task-record")
public class TaskRecordController extends BaseController {
@Resource
private TaskRecordService taskRecordService;
@Resource
private TaskService taskService;
@Resource
private NoticeService noticeService;
@PreAuthorize("hasAuthority('oa:task:list')")
@OperationLog
@ApiOperation("分页查询工单回复记录表")
@GetMapping("/page")
public ApiResult<PageResult<TaskRecord>> page(TaskRecordParam param) {
// 使用关联查询
return success(taskRecordService.pageRel(param));
}
@PreAuthorize("hasAuthority('oa:task:list')")
@OperationLog
@ApiOperation("查询全部工单回复记录表")
@GetMapping()
public ApiResult<List<TaskRecord>> list(TaskRecordParam param) {
// 更新查阅状态
Task task = taskService.getById(param.getTaskId());
if(!getLoginUserId().equals(task.getLastReadUser())){
task.setIsRead(1);
}
taskService.updateById(task);
// 使用关联查询
return success(taskRecordService.listRel(param));
}
@PreAuthorize("hasAuthority('oa:task:list')")
@OperationLog
@ApiOperation("根据id查询工单回复记录表")
@GetMapping("/{id}")
public ApiResult<TaskRecord> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(taskRecordService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('oa:task:save')")
@OperationLog
@ApiOperation("添加工单回复记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody TaskRecord taskRecord) {
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
taskRecord.setUserId(loginUser.getUserId());
}
if (taskRecordService.save(taskRecord)) {
Task task = new Task();
task.setTaskId(taskRecord.getTaskId());
task.setProgress(PROGRESS2);
task.setIsRead(0);
task.setLastReadUser(getLoginUserId());
taskService.updateById(task);
// 发送私信
noticeService.addLetter(taskRecord);
return success("提交成功");
}
return fail("提交失败");
}
@PreAuthorize("hasAuthority('oa:task:update')")
@OperationLog
@ApiOperation("修改工单回复记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody TaskRecord taskRecord) {
if (taskRecordService.updateById(taskRecord)) {
Task task = taskService.getById(taskRecord.getTaskId());
task.setIsRead(0);
task.setLastReadUser(getLoginUserId());
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:task:remove')")
@OperationLog
@ApiOperation("删除工单回复记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (taskRecordService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('oa:task:save')")
@OperationLog
@ApiOperation("批量添加工单回复记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<TaskRecord> list) {
if (taskRecordService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:task:update')")
@OperationLog
@ApiOperation("批量修改工单回复记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<TaskRecord> batchParam) {
if (batchParam.update(taskRecordService, "task_record_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:task:remove')")
@OperationLog
@ApiOperation("批量删除工单回复记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (taskRecordService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -1,153 +0,0 @@
package com.gxwebsoft.oa.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.exception.BusinessException;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.oa.entity.Task;
import com.gxwebsoft.oa.entity.TaskUser;
import com.gxwebsoft.oa.param.TaskUserParam;
import com.gxwebsoft.oa.service.TaskService;
import com.gxwebsoft.oa.service.TaskUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import static com.gxwebsoft.oa.constants.TaskConstants.PROGRESS1;
/**
* 工单成员控制器
*
* @author 科技小王子
* @since 2023-03-06 12:00:41
*/
@Api(tags = "工单成员管理")
@RestController
@RequestMapping("/api/oa/task-user")
public class TaskUserController extends BaseController {
@Resource
private UserService userService;
@Resource
private TaskUserService taskUserService;
@Resource
private TaskService taskService;
@PreAuthorize("hasAuthority('oa:taskUser:list')")
@OperationLog
@ApiOperation("分页查询工单成员")
@GetMapping("/page")
public ApiResult<PageResult<TaskUser>> page(TaskUserParam param) {
// 使用关联查询
return success(taskUserService.pageRel(param));
}
@PreAuthorize("hasAuthority('oa:taskUser:list')")
@OperationLog
@ApiOperation("查询全部工单成员")
@GetMapping()
public ApiResult<List<TaskUser>> list(TaskUserParam param) {
// 使用关联查询
return success(taskUserService.listRel(param));
}
@PreAuthorize("hasAuthority('oa:taskUser:list')")
@OperationLog
@ApiOperation("根据id查询工单成员")
@GetMapping("/{id}")
public ApiResult<TaskUser> get(@PathVariable("id") Integer id) {
// return success(taskUserService.getById(id));
// 使用关联查询
return success(taskUserService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('oa:taskUser:save')")
@OperationLog
@ApiOperation("添加工单成员")
@PostMapping()
public ApiResult<?> save(@RequestBody TaskUser taskUser) {
User user = userService.getOne(new LambdaQueryWrapper<User>().eq(User::getUsername, taskUser.getName()));
if(user == null){
throw new BusinessException("找不到该用户");
}
int count = taskUserService.count(new LambdaQueryWrapper<TaskUser>().eq(TaskUser::getUserId, user.getUserId()).eq(TaskUser::getTaskId,taskUser.getTaskId()));
if( count > 0) {
return fail("请勿重复指派");
}
taskUser.setUserId(user.getUserId());
if (taskUserService.save(taskUser)) {
Task task = new Task();
task.setTaskId(taskUser.getTaskId());
task.setProgress(PROGRESS1);
task.setIsRead(0);
task.setLastReadUser(getLoginUserId());
taskService.updateById(task);
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:taskUser:update')")
@OperationLog
@ApiOperation("修改工单成员")
@PutMapping()
public ApiResult<?> update(@RequestBody TaskUser taskUser) {
if (taskUserService.updateById(taskUser)) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:taskUser:remove')")
@OperationLog
@ApiOperation("删除工单成员")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (taskUserService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@PreAuthorize("hasAuthority('oa:taskUser:save')")
@OperationLog
@ApiOperation("批量添加工单成员")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<TaskUser> list) {
if (taskUserService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@PreAuthorize("hasAuthority('oa:taskUser:update')")
@OperationLog
@ApiOperation("批量修改工单成员")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<TaskUser> batchParam) {
if (batchParam.update(taskUserService, "task_user_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@PreAuthorize("hasAuthority('oa:taskUser:remove')")
@OperationLog
@ApiOperation("批量删除工单成员")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (taskUserService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,242 +0,0 @@
package com.gxwebsoft.oa.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 应用管理记录表
*
* @author 科技小王子
* @since 2023-03-28 10:45:39
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "App对象", description = "应用管理记录表")
@TableName("oa_app")
public class App implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "应用ID")
@TableId(value = "app_id", type = IdType.AUTO)
private Integer appId;
@ApiModelProperty(value = "应用名称")
private String appName;
@ApiModelProperty(value = "上级id, 0是顶级")
private Integer parentId;
@ApiModelProperty(value = "应用标识")
private String appCode;
@ApiModelProperty(value = "类型, 0菜单, 1按钮")
private String appType;
@ApiModelProperty(value = "应用类型多选")
private String appTypeMultiple;
@ApiModelProperty(value = "类型, 0菜单, 1按钮")
private Integer menuType;
@ApiModelProperty(value = "企业ID")
private Integer companyId;
@ApiModelProperty(value = "应用图标")
private String appIcon;
@ApiModelProperty(value = "二维码")
private String appQrcode;
@ApiModelProperty(value = "链接地址")
private String appUrl;
@ApiModelProperty(value = "后台管理地址")
private String adminUrl;
@ApiModelProperty(value = "下载地址")
private String downUrl;
@ApiModelProperty(value = "服务器地址")
private String serverUrl;
@ApiModelProperty(value = "回调地址")
private String callbackUrl;
@ApiModelProperty(value = "腾讯文档地址")
private String docsUrl;
@ApiModelProperty(value = "仓库地址")
private String gitUrl;
@ApiModelProperty(value = "文件服务器")
private String fileUrl;
@ApiModelProperty(value = "原型图地址")
private String prototypeUrl;
@ApiModelProperty(value = "IP白名单")
private String ipAddress;
@ApiModelProperty(value = "应用截图")
private String images;
@ApiModelProperty(value = "应用包名")
private String packageName;
@ApiModelProperty(value = "下载次数")
private Integer clicks;
@ApiModelProperty(value = "安装次数")
private Integer installs;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "应用介绍")
private String content;
@ApiModelProperty(value = "项目需求")
private String requirement;
@ApiModelProperty(value = "开发者(个人或公司)")
private String developer;
@ApiModelProperty(value = "项目负责人")
private String director;
@ApiModelProperty(value = "项目经理")
private String projectDirector;
@ApiModelProperty(value = "业务经理")
private String salesman;
@ApiModelProperty(value = "软件定价")
private BigDecimal price;
@ApiModelProperty(value = "划线价格")
private BigDecimal linePrice;
@ApiModelProperty(value = "评分")
private String score;
@ApiModelProperty(value = "星级")
private String star;
@ApiModelProperty(value = "菜单路由地址")
private String path;
@ApiModelProperty(value = "菜单组件地址, 目录可为空")
private String component;
@ApiModelProperty(value = "权限标识")
private String authority;
@ApiModelProperty(value = "打开位置")
private String target;
@ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)")
private Integer hide;
@ApiModelProperty(value = "禁止搜索1禁止 0 允许")
private Integer search;
@ApiModelProperty(value = "菜单侧栏选中的path")
private String active;
@ApiModelProperty(value = "其它路由元信息")
private String meta;
@ApiModelProperty(value = "版本0正式版 1体验版 2开发版")
private String edition;
@ApiModelProperty(value = "版本号")
private String version;
@ApiModelProperty(value = "是否已安装")
private Integer isUse;
@ApiModelProperty(value = "应用状态")
private String appStatus;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "机构id")
private Integer organizationId;
@ApiModelProperty(value = "应用秘钥")
@TableField(exist = false)
private String appSecret;
@ApiModelProperty(value = "租户编号")
private String tenantCode;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "附件1")
private String file1;
@ApiModelProperty(value = "附件2")
private String file2;
@ApiModelProperty(value = "附件3")
private String file3;
@ApiModelProperty(value = "成员管理")
@TableField(exist = false)
private List<AppUser> users;
@ApiModelProperty(value = "主体名称")
@TableField(exist = false)
private String tenantName;
@ApiModelProperty(value = "主体ID")
@TableField(exist = false)
private Integer tenantId;
@ApiModelProperty(value = "租户信息")
@TableField(exist = false)
private Tenant tenant;
@ApiModelProperty(value = "开发者名称")
@TableField(exist = false)
private String realName;
@ApiModelProperty(value = "开发者名称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "开发者头像")
@TableField(exist = false)
private String avatar;
@ApiModelProperty(value = "公司名称")
private String companyName;
@ApiModelProperty(value = "公司简称")
@TableField(exist = false)
private String shortName;
}

View File

@@ -1,70 +0,0 @@
package com.gxwebsoft.oa.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* 应用成员
*
* @author 科技小王子
* @since 2023-05-31 13:18:55
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "AppUser对象", description = "应用成员")
@TableName("oa_app_user")
public class AppUser implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "自增ID")
@TableId(value = "app_user_id", type = IdType.AUTO)
private Integer appUserId;
@ApiModelProperty(value = "角色10体验成员 20开发者成员 30管理员 ")
private Integer role;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "应用ID")
private Integer appId;
@ApiModelProperty(value = "状态, 0正常, 1待确认")
private Integer status;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "用户名")
@TableField(exist = false)
private String username;
@ApiModelProperty(value = "手机号码")
@TableField(exist = false)
private String phone;
@ApiModelProperty(value = "邮箱")
@TableField(exist = false)
private String email;
@ApiModelProperty(value = "头像")
@TableField(exist = false)
private String avatar;
}

View File

@@ -1,167 +0,0 @@
package com.gxwebsoft.oa.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 服务器资产记录表
*
* @author WebSoft
* @since 2022-11-16 11:13:16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Assets对象", description = "服务器资产记录表")
@TableName("oa_assets")
public class Assets implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "资产ID")
@TableId(value = "assets_id", type = IdType.AUTO)
private Integer assetsId;
@ApiModelProperty(value = "资产名称")
private String name;
@ApiModelProperty(value = "资产标识")
private String code;
@ApiModelProperty(value = "资产类型")
private String type;
@ApiModelProperty(value = "服务器厂商")
private String brand;
@ApiModelProperty(value = "服务器配置")
private String configuration;
@ApiModelProperty(value = "初始账号")
private String account;
@ApiModelProperty(value = "初始密码")
private String password;
@ApiModelProperty(value = "(阿里云/腾讯云)登录账号")
private String brandAccount;
@ApiModelProperty(value = "(阿里云/腾讯云)登录密码")
private String brandPassword;
@ApiModelProperty(value = "宝塔面板")
private String panel;
@ApiModelProperty(value = "宝塔面板账号")
private String panelAccount;
@ApiModelProperty(value = "宝塔面板密码")
private String panelPassword;
@ApiModelProperty(value = "财务信息-合同金额")
private BigDecimal financeAmount;
@ApiModelProperty(value = "购买年限")
private Integer financeYears;
@ApiModelProperty(value = "续费金额")
private BigDecimal financeRenew;
@ApiModelProperty(value = "客户名称")
private String financeCustomerName;
@ApiModelProperty(value = "客户联系人")
private String financeCustomerContact;
@ApiModelProperty(value = "客户联系电话")
private String financeCustomerPhone;
@ApiModelProperty(value = "客户ID")
private Integer customerId;
@ApiModelProperty(value = "客户名称")
private String customerName;
@ApiModelProperty(value = "开放端口")
private String openPort;
@ApiModelProperty(value = "详情内容")
private String content;
@ApiModelProperty(value = "购买时间")
private Date startTime;
@ApiModelProperty(value = "到期时间")
private Date endTime;
@ApiModelProperty(value = "置顶状态")
private String isTop;
@ApiModelProperty(value = "可见性(public,private,protected)")
private String visibility;
@ApiModelProperty(value = "宝塔接口秘钥")
private String btSign;
@ApiModelProperty(value = "文章排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "描述")
private String comments;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "机构id")
private Integer organizationId;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private String status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "开发者头像")
@TableField(exist = false)
private String avatar;
@ApiModelProperty(value = "客户名称")
@TableField(exist = false)
private String companyName;
@ApiModelProperty(value = "系统基础统计")
@TableField(exist = false)
private Object systemTotal;
@ApiModelProperty(value = "磁盘分区信息")
@TableField(exist = false)
private Object diskInfo;
@ApiModelProperty(value = "实时状态信息(CPU、内存、网络、负载)")
@TableField(exist = false)
private Object netWork;
@ApiModelProperty(value = "网站列表")
@TableField(exist = false)
private Object sites;
}

View File

@@ -1,115 +0,0 @@
package com.gxwebsoft.oa.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 客户管理记录表
*
* @author WebSoft
* @since 2022-11-16 11:16:14
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Customer对象", description = "客户管理记录表")
@TableName("oa_customer")
public class Customer implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "客户ID")
@TableId(value = "customer_id", type = IdType.AUTO)
private Integer customerId;
@ApiModelProperty(value = "客户名称")
private String customerName;
@ApiModelProperty(value = "客户标识")
private String customerCode;
@ApiModelProperty(value = "客户全称")
private String customerFullName;
@ApiModelProperty(value = "头像")
private String customerAvatar;
@ApiModelProperty(value = "客户类型")
private String customerType;
@ApiModelProperty(value = "客户来源")
private String customerSource;
@ApiModelProperty(value = "公司座机")
private String customerPhone;
@ApiModelProperty(value = "手机号码")
private String customerMobile;
@ApiModelProperty(value = "联系人")
private String customerContacts;
@ApiModelProperty(value = "所在省份")
private String customerProvince;
@ApiModelProperty(value = "所在城市")
private String customerCity;
@ApiModelProperty(value = "所在地区")
private String customerRegion;
@ApiModelProperty(value = "所在地址")
private String customerAddress;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
@ApiModelProperty(value = "跟进状态")
private String progress;
@ApiModelProperty(value = "是否含税")
private Boolean isTax;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "机构id")
private Integer organizationId;
@ApiModelProperty(value = "可见性(public,private,protected)")
private String visibility;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}

View File

@@ -1,97 +0,0 @@
package com.gxwebsoft.oa.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 消息记录表
*
* @author 科技小王子
* @since 2023-03-22 14:07:26
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Notice对象", description = "消息记录表")
@TableName("oa_notice")
public class Notice implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "ID")
@TableId(value = "notice_id", type = IdType.AUTO)
private Integer noticeId;
@ApiModelProperty(value = "消息类型")
private String type;
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "图标")
private String icon;
@ApiModelProperty(value = "颜色")
private String color;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "消息来源")
private String source;
@ApiModelProperty(value = "来源记录ID")
private Integer sourceId;
@ApiModelProperty(value = "路由地址")
private String path;
@ApiModelProperty(value = "代币")
private Long tokens;
@ApiModelProperty(value = "是否已查阅")
private Integer isRead;
@ApiModelProperty(value = "渠道, 0发送 1回复")
private Integer channel;
@ApiModelProperty(value = "任务状态")
private Integer progress;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "状态, 0待处理, 1已完成")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "开发者名称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "开发者头像")
@TableField(exist = false)
private String avatar;
}

View File

@@ -1,125 +0,0 @@
package com.gxwebsoft.oa.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 项目管理表
*
* @author WebSoft
* @since 2022-11-16 11:00:43
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Project对象", description = "项目管理表")
@TableName("oa_project")
public class Project implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "项目ID")
@TableId(value = "project_id", type = IdType.AUTO)
private Integer projectId;
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "项目标识")
private String projectCode;
@ApiModelProperty(value = "商品分类")
private String projectCategory;
@ApiModelProperty(value = "项目商标")
private String projectAvatar;
@ApiModelProperty(value = "项目域名")
private String url;
@ApiModelProperty(value = "开发版域名")
private String urlDev;
@ApiModelProperty(value = "后台管理地址")
private String urlAdmin;
@ApiModelProperty(value = "默认账号密码")
private String account;
@ApiModelProperty(value = "项目金额")
private BigDecimal money;
@ApiModelProperty(value = "实际金额")
private BigDecimal realMoney;
@ApiModelProperty(value = "年费")
private BigDecimal annualFee;
@ApiModelProperty(value = "项目详情")
private String content;
@ApiModelProperty(value = "开发参数(json)")
private String param;
@ApiModelProperty(value = "二维码")
private String qrcode;
@ApiModelProperty(value = "客户名称")
private String customerName;
@ApiModelProperty(value = "项目进度10待安排 20策划设计 30功能开发 40待验收 50完成")
private Integer progress;
@ApiModelProperty(value = "初始浏览数")
private Integer views;
@ApiModelProperty(value = "状态(10上架 20下架)")
private Integer status;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "是否精选客户案例")
private Boolean isCase;
@ApiModelProperty(value = "负责人")
private Integer commander;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "机构id")
private Integer organizationId;
@ApiModelProperty(value = "可见性(public,private,protected)")
private String visibility;
@ApiModelProperty(value = "项目归属者")
private Integer customerId;
@ApiModelProperty(value = "项目描述")
private String comments;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}

View File

@@ -1,188 +0,0 @@
package com.gxwebsoft.oa.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 文章记录表
*
* @author WebSoft
* @since 2022-11-16 11:21:42
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Task对象", description = "文章记录表")
@TableName("oa_task")
public class Task implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "任务ID")
@TableId(value = "task_id", type = IdType.AUTO)
private Integer taskId;
@ApiModelProperty(value = "任务名称")
private String name;
@ApiModelProperty(value = "任务类型")
private String taskType;
@ApiModelProperty(value = "工单附件")
private String files;
@ApiModelProperty(value = "开始时间")
private Date startTime;
@ApiModelProperty(value = "结束时间")
private Date endTime;
@ApiModelProperty(value = "任务内容")
@TableField(exist = false)
private String content;
@ApiModelProperty(value = "任务状态")
private Integer progress;
@ApiModelProperty(value = "优先级")
private String priority;
@ApiModelProperty(value = "品质要求")
private String quality;
@ApiModelProperty(value = "时限(天)")
private Integer day;
@ApiModelProperty(value = "联系电话")
private String phone;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "应用ID")
private Integer appId;
@ApiModelProperty(value = "机构id")
private Integer organizationId;
@ApiModelProperty(value = "客户ID")
private Integer customerId;
@ApiModelProperty(value = "项目ID")
private Integer projectId;
@ApiModelProperty(value = "资产ID")
private Integer assetsId;
@ApiModelProperty(value = "是否已查阅")
private Integer isRead;
@ApiModelProperty(value = "最后回复人ID")
private Integer lastReadUser;
@ApiModelProperty(value = "最后回复人头像")
@TableField(exist = false)
private String lastAvatar;
@ApiModelProperty(value = "最后回复人昵称")
@TableField(exist = false)
private String lastNickname;
@ApiModelProperty(value = "最后回复人姓名")
@TableField(exist = false)
private String lastRealName;
@ApiModelProperty(value = "最后回复人公司名称")
@TableField(exist = false)
private String lastCompanyName;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0待处理, 1已完成")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "用户昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "用户头像")
@TableField(exist = false)
private String avatar;
@ApiModelProperty(value = "任务发起人ID")
private Integer promoter;
@ApiModelProperty(value = "发起人昵称")
@TableField(exist = false)
private String promoterName;
@ApiModelProperty(value = "发起人别名")
@TableField(exist = false)
private String promoterAlias;
@ApiModelProperty(value = "发起人头像")
@TableField(exist = false)
private String promoterAvatar;
@ApiModelProperty(value = "发起人单位名称")
@TableField(exist = false)
private String promoterCompanyName;
@ApiModelProperty(value = "受理人")
private Integer commander;
@ApiModelProperty(value = "受理人昵称")
@TableField(exist = false)
private String commanderName;
@ApiModelProperty(value = "受理人别名")
@TableField(exist = false)
private String commanderAlias;
@ApiModelProperty(value = "受理人真实姓名")
@TableField(exist = false)
private String commanderRealName;
@ApiModelProperty(value = "受理人头像")
@TableField(exist = false)
private String commanderAvatar;
@ApiModelProperty(value = "受理人单位名称")
@TableField(exist = false)
private String commanderCompanyName;
@ApiModelProperty(value = "成员管理")
@TableField(exist = false)
private List<TaskUser> users;
@ApiModelProperty(value = "应用名称")
@TableField(exist = false)
private String appName;
@ApiModelProperty(value = "应用信息")
@TableField(exist = false)
private App appInfo;
}

View File

@@ -1,75 +0,0 @@
package com.gxwebsoft.oa.entity;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 工单回复记录表
*
* @author 科技小王子
* @since 2023-03-05 00:52:21
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "TaskRecord对象", description = "工单回复记录表")
@TableName("oa_task_record")
public class TaskRecord implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "回复ID")
@TableId(value = "task_record_id", type = IdType.AUTO)
private Integer taskRecordId;
@ApiModelProperty(value = "工单ID")
private Integer taskId;
@ApiModelProperty(value = "上级id")
private Integer parentId;
@ApiModelProperty(value = "任务内容")
private String content;
@ApiModelProperty(value = "工单附件")
private String files;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0待处理, 1已完成")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "注册时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "用户昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "用户头像")
@TableField(exist = false)
private String avatar;
}

View File

@@ -1,67 +0,0 @@
package com.gxwebsoft.oa.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 工单成员
*
* @author 科技小王子
* @since 2023-03-06 12:00:41
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "TaskUser对象", description = "工单成员")
@TableName("oa_task_user")
public class TaskUser implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "自增ID")
@TableId(value = "task_user_id", type = IdType.AUTO)
private Integer taskUserId;
@ApiModelProperty(value = "角色10体验成员 20开发者成员 30管理员 ")
private Integer role;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "工单ID")
private Integer taskId;
@ApiModelProperty(value = "状态, 0正常, 1待确认")
private Integer status;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "加入时间")
private Date createTime;
@ApiModelProperty(value = "用户昵称")
@TableField(exist = false)
private String name;
@ApiModelProperty(value = "用户头像")
@TableField(exist = false)
private String avatar;
@ApiModelProperty(value = "手机号码")
@TableField(exist = false)
private String phone;
@ApiModelProperty(value = "手机号码")
@TableField(exist = false)
private String email;
}

View File

@@ -1,80 +0,0 @@
package com.gxwebsoft.oa.entity;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* 租户
*
* @author WebSoft
* @since 2022-11-17 17:13:39
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Tenant对象", description = "租户")
@TableName("sys_tenant")
public class Tenant implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "租户id")
@TableId(value = "tenant_id", type = IdType.AUTO)
private Integer tenantId;
@ApiModelProperty(value = "租户名称")
private String tenantName;
@ApiModelProperty(value = "租户编号")
private String tenantCode;
@ApiModelProperty(value = "租户标识")
private String logo;
@ApiModelProperty(value = "绑定的手机号码")
@TableField(exist = false)
private String phone;
@ApiModelProperty(value = "绑定的邮箱")
@TableField(exist = false)
private String email;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "所属客户")
@TableField(exist = false)
private Integer companyId;
@ApiModelProperty(value = "用户ID")
private Integer userId;
@ApiModelProperty(value = "状态")
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "初始密码")
@TableField(exist = false)
private String password;
@ApiModelProperty("客户名称")
@TableField(exist = false)
private String companyName;
@TableId(value = "AppId")
@TableField(exist = false)
private Integer AppId;
}

View File

@@ -1,38 +0,0 @@
package com.gxwebsoft.oa.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.oa.entity.App;
import com.gxwebsoft.oa.param.AppParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 应用管理记录表Mapper
*
* @author 科技小王子
* @since 2023-03-28 10:45:39
*/
public interface AppMapper extends BaseMapper<App> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<App>
*/
List<App> selectPageRel(@Param("page") IPage<App> page,
@Param("param") AppParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<App> selectListRel(@Param("param") AppParam param);
List<App> pageRel(@Param("param") AppParam param);
}

View File

@@ -1,37 +0,0 @@
package com.gxwebsoft.oa.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.oa.entity.AppUser;
import com.gxwebsoft.oa.param.AppUserParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 应用成员Mapper
*
* @author 科技小王子
* @since 2023-05-31 13:18:55
*/
public interface AppUserMapper extends BaseMapper<AppUser> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<AppUser>
*/
List<AppUser> selectPageRel(@Param("page") IPage<AppUser> page,
@Param("param") AppUserParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<AppUser> selectListRel(@Param("param") AppUserParam param);
}

View File

@@ -1,37 +0,0 @@
package com.gxwebsoft.oa.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.oa.entity.Assets;
import com.gxwebsoft.oa.param.AssetsParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 服务器资产记录表Mapper
*
* @author WebSoft
* @since 2022-11-16 11:13:16
*/
public interface AssetsMapper extends BaseMapper<Assets> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Assets>
*/
List<Assets> selectPageRel(@Param("page") IPage<Assets> page,
@Param("param") AssetsParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Assets> selectListRel(@Param("param") AssetsParam param);
}

View File

@@ -1,37 +0,0 @@
package com.gxwebsoft.oa.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.oa.entity.Customer;
import com.gxwebsoft.oa.param.CustomerParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 客户管理记录表Mapper
*
* @author WebSoft
* @since 2022-11-16 11:16:14
*/
public interface CustomerMapper extends BaseMapper<Customer> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Customer>
*/
List<Customer> selectPageRel(@Param("page") IPage<Customer> page,
@Param("param") CustomerParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Customer> selectListRel(@Param("param") CustomerParam param);
}

View File

@@ -1,37 +0,0 @@
package com.gxwebsoft.oa.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.oa.entity.Notice;
import com.gxwebsoft.oa.param.NoticeParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 消息记录表Mapper
*
* @author 科技小王子
* @since 2023-03-22 14:07:26
*/
public interface NoticeMapper extends BaseMapper<Notice> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Notice>
*/
List<Notice> selectPageRel(@Param("page") IPage<Notice> page,
@Param("param") NoticeParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Notice> selectListRel(@Param("param") NoticeParam param);
}

View File

@@ -1,37 +0,0 @@
package com.gxwebsoft.oa.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.oa.entity.Project;
import com.gxwebsoft.oa.param.ProjectParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目管理表Mapper
*
* @author WebSoft
* @since 2022-11-16 11:00:43
*/
public interface ProjectMapper extends BaseMapper<Project> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Project>
*/
List<Project> selectPageRel(@Param("page") IPage<Project> page,
@Param("param") ProjectParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Project> selectListRel(@Param("param") ProjectParam param);
}

View File

@@ -1,37 +0,0 @@
package com.gxwebsoft.oa.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.oa.entity.Task;
import com.gxwebsoft.oa.param.TaskParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 文章记录表Mapper
*
* @author WebSoft
* @since 2022-11-16 11:21:43
*/
public interface TaskMapper extends BaseMapper<Task> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Task>
*/
List<Task> selectPageRel(@Param("page") IPage<Task> page,
@Param("param") TaskParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Task> selectListRel(@Param("param") TaskParam param);
}

View File

@@ -1,37 +0,0 @@
package com.gxwebsoft.oa.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.oa.entity.TaskRecord;
import com.gxwebsoft.oa.param.TaskRecordParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 工单回复记录表Mapper
*
* @author 科技小王子
* @since 2023-03-05 00:52:21
*/
public interface TaskRecordMapper extends BaseMapper<TaskRecord> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<TaskRecord>
*/
List<TaskRecord> selectPageRel(@Param("page") IPage<TaskRecord> page,
@Param("param") TaskRecordParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<TaskRecord> selectListRel(@Param("param") TaskRecordParam param);
}

View File

@@ -1,37 +0,0 @@
package com.gxwebsoft.oa.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.oa.entity.TaskUser;
import com.gxwebsoft.oa.param.TaskUserParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 工单成员Mapper
*
* @author 科技小王子
* @since 2023-03-06 12:00:41
*/
public interface TaskUserMapper extends BaseMapper<TaskUser> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<TaskUser>
*/
List<TaskUser> selectPageRel(@Param("page") IPage<TaskUser> page,
@Param("param") TaskUserParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<TaskUser> selectListRel(@Param("param") TaskUserParam param);
}

View File

@@ -1,39 +0,0 @@
package com.gxwebsoft.oa.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.oa.entity.Tenant;
import com.gxwebsoft.oa.param.TenantParam;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 租户Mapper
*
* @author WebSoft
* @since 2022-11-17 17:13:39
*/
public interface TenantMapper extends BaseMapper<Tenant> {
/**
* 分页查询
*
* @param page 分页对象
* @param param 查询参数
* @return List<Tenant>
*/
@InterceptorIgnore(tenantLine = "true")
List<Tenant> selectPageRel(@Param("page") IPage<Tenant> page,
@Param("param") TenantParam param);
/**
* 查询全部
*
* @param param 查询参数
* @return List<User>
*/
List<Tenant> selectListRel(@Param("param") TenantParam param);
}

View File

@@ -1,195 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.oa.mapper.AppMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*,
b.company_id,
b.short_name,
b.company_name,
c.nickname,
c.real_name,
c.user_id,
c.avatar
FROM oa_app a
LEFT JOIN sys_company b ON a.company_id = b.company_id
LEFT JOIN sys_user c ON a.user_id = c.user_id
<where>
<if test="param.appId != null">
AND a.app_id = #{param.appId}
</if>
<if test="param.appName != null">
AND a.app_name LIKE CONCAT('%', #{param.appName}, '%')
</if>
<if test="param.parentId != null">
AND a.parent_id = #{param.parentId}
</if>
<if test="param.appCode != null">
AND a.app_code LIKE CONCAT('%', #{param.appCode}, '%')
</if>
<if test="param.appType != null">
AND a.app_type LIKE CONCAT('%', #{param.appType}, '%')
</if>
<if test="param.menuType != null">
AND a.menu_type = #{param.menuType}
</if>
<if test="param.companyId != null">
AND a.company_id = #{param.companyId}
</if>
<if test="param.appIcon != null">
AND a.app_icon LIKE CONCAT('%', #{param.appIcon}, '%')
</if>
<if test="param.appQrcode != null">
AND a.app_qrcode LIKE CONCAT('%', #{param.appQrcode}, '%')
</if>
<if test="param.appUrl != null">
AND a.app_url LIKE CONCAT('%', #{param.appUrl}, '%')
</if>
<if test="param.adminUrl != null">
AND a.admin_url LIKE CONCAT('%', #{param.adminUrl}, '%')
</if>
<if test="param.downUrl != null">
AND a.down_url LIKE CONCAT('%', #{param.downUrl}, '%')
</if>
<if test="param.ipAddress != null">
AND a.ip_address LIKE CONCAT('%', #{param.ipAddress}, '%')
</if>
<if test="param.images != null">
AND a.images LIKE CONCAT('%', #{param.images}, '%')
</if>
<if test="param.packageName != null">
AND a.package_name LIKE CONCAT('%', #{param.packageName}, '%')
</if>
<if test="param.clicks != null">
AND a.clicks = #{param.clicks}
</if>
<if test="param.installs != null">
AND a.installs = #{param.installs}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if>
<if test="param.requirement != null">
AND a.requirement LIKE CONCAT('%', #{param.requirement}, '%')
</if>
<if test="param.developer != null">
AND a.developer LIKE CONCAT('%', #{param.developer}, '%')
</if>
<if test="param.price != null">
AND a.price = #{param.price}
</if>
<if test="param.linePrice != null">
AND a.line_price = #{param.linePrice}
</if>
<if test="param.score != null">
AND a.score LIKE CONCAT('%', #{param.score}, '%')
</if>
<if test="param.star != null">
AND a.star LIKE CONCAT('%', #{param.star}, '%')
</if>
<if test="param.path != null">
AND a.path LIKE CONCAT('%', #{param.path}, '%')
</if>
<if test="param.component != null">
AND a.component LIKE CONCAT('%', #{param.component}, '%')
</if>
<if test="param.authority != null">
AND a.authority LIKE CONCAT('%', #{param.authority}, '%')
</if>
<if test="param.target != null">
AND a.target LIKE CONCAT('%', #{param.target}, '%')
</if>
<if test="param.hide != null">
AND a.hide = #{param.hide}
</if>
<if test="param.search != null">
AND a.search = #{param.search}
</if>
<if test="param.active != null">
AND a.active LIKE CONCAT('%', #{param.active}, '%')
</if>
<if test="param.meta != null">
AND a.meta LIKE CONCAT('%', #{param.meta}, '%')
</if>
<if test="param.edition != null">
AND a.edition LIKE CONCAT('%', #{param.edition}, '%')
</if>
<if test="param.version != null">
AND a.version LIKE CONCAT('%', #{param.version}, '%')
</if>
<if test="param.isUse != null">
AND a.is_use = #{param.isUse}
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.userId != null">
AND a.app_id IN (SELECT app_id FROM oa_app_user WHERE user_id=#{param.userId})
</if>
<if test="param.appIds != null">
AND a.app_id IN
<foreach collection="param.appIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="param.organizationId != null">
AND a.organization_id = #{param.organizationId}
</if>
<if test="param.tenantId != null">
AND a.tenant_id = #{param.tenantId}
</if>
<if test="param.tenantCode != null">
AND a.tenant_code LIKE CONCAT('%', #{param.tenantCode}, '%')
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.appStatus != null">
AND a.app_status = #{param.appStatus}
</if>
<if test="param.companyName != null">
AND a.company_id = #{param.companyId}
</if>
<if test="param.keywords != null">
AND (a.app_name LIKE CONCAT('%', #{param.keywords}, '%')
OR b.short_name LIKE CONCAT('%', #{param.keywords}, '%')
OR b.company_id = #{param.keywords}
OR b.company_name LIKE CONCAT('%', #{param.keywords}, '%')
)
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.App">
<include refid="selectSql"></include>
</select>
<!-- 分页查询 -->
<select id="pageRel" resultType="com.gxwebsoft.oa.entity.App">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.App">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -1,52 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.oa.mapper.AppUserMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*, b.nickname,b.email,b.phone,b.avatar
FROM oa_app_user a
LEFT JOIN sys_user b ON a.user_id = b.user_id
<where>
<if test="param.appUserId != null">
AND a.app_user_id = #{param.appUserId}
</if>
<if test="param.role != null">
AND a.role = #{param.role}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.appId != null">
AND a.app_id = #{param.appId}
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.keywords != null">
AND (b.nickname LIKE CONCAT('%', #{param.keywords}, '%')
OR b.email LIKE CONCAT('%', #{param.keywords}, '%')
OR b.username LIKE CONCAT('%', #{param.keywords}, '%')
OR b.phone LIKE CONCAT('%', #{param.keywords}, '%')
)
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.AppUser">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.AppUser">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -1,133 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.oa.mapper.AssetsMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*,
b.user_id,b.company_name,b.avatar,b.nickname
FROM oa_assets a
LEFT JOIN sys_user b ON a.user_id = b.user_id
<where>
<if test="param.assetsId != null">
AND a.assets_id = #{param.assetsId}
</if>
<if test="param.name != null">
AND a.name LIKE CONCAT('%', #{param.name}, '%')
</if>
<if test="param.code != null">
AND a.code LIKE CONCAT('%', #{param.code}, '%')
</if>
<if test="param.type != null">
AND a.type LIKE CONCAT('%', #{param.type}, '%')
</if>
<if test="param.brand != null">
AND a.brand LIKE CONCAT('%', #{param.brand}, '%')
</if>
<if test="param.configuration != null">
AND a.configuration LIKE CONCAT('%', #{param.configuration}, '%')
</if>
<if test="param.account != null">
AND a.account LIKE CONCAT('%', #{param.account}, '%')
</if>
<if test="param.password != null">
AND a.password LIKE CONCAT('%', #{param.password}, '%')
</if>
<if test="param.brandAccount != null">
AND a.brand_account LIKE CONCAT('%', #{param.brandAccount}, '%')
</if>
<if test="param.brandPassword != null">
AND a.brand_password LIKE CONCAT('%', #{param.brandPassword}, '%')
</if>
<if test="param.panel != null">
AND a.panel LIKE CONCAT('%', #{param.panel}, '%')
</if>
<if test="param.panelAccount != null">
AND a.panel_account LIKE CONCAT('%', #{param.panelAccount}, '%')
</if>
<if test="param.panelPassword != null">
AND a.panel_password LIKE CONCAT('%', #{param.panelPassword}, '%')
</if>
<if test="param.financeAmount != null">
AND a.finance_amount = #{param.financeAmount}
</if>
<if test="param.financeYears != null">
AND a.finance_years = #{param.financeYears}
</if>
<if test="param.financeRenew != null">
AND a.finance_renew = #{param.financeRenew}
</if>
<if test="param.financeCustomerName != null">
AND a.finance_customer_name LIKE CONCAT('%', #{param.financeCustomerName}, '%')
</if>
<if test="param.financeCustomerContact != null">
AND a.finance_customer_contact LIKE CONCAT('%', #{param.financeCustomerContact}, '%')
</if>
<if test="param.financeCustomerPhone != null">
AND a.finance_customer_phone LIKE CONCAT('%', #{param.financeCustomerPhone}, '%')
</if>
<if test="param.customerId != null">
AND a.customer_id = #{param.customerId}
</if>
<if test="param.customerName != null">
AND a.customer_name LIKE CONCAT('%', #{param.customerName}, '%')
</if>
<if test="param.openPort != null">
AND a.open_port LIKE CONCAT('%', #{param.openPort}, '%')
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if>
<if test="param.startTime != null">
AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%')
</if>
<if test="param.endTime != null">
AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%')
</if>
<if test="param.isTop != null">
AND a.is_top LIKE CONCAT('%', #{param.isTop}, '%')
</if>
<if test="param.visibility != null">
AND a.visibility LIKE CONCAT('%', #{param.visibility}, '%')
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.organizationId != null">
AND a.organization_id = #{param.organizationId}
</if>
<if test="param.status != null">
AND a.status LIKE CONCAT('%', #{param.status}, '%')
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.Assets">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.Assets">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -1,107 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.oa.mapper.CustomerMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM oa_customer a
<where>
<if test="param.customerId != null">
AND a.customer_id = #{param.customerId}
</if>
<if test="param.customerName != null">
AND a.customer_name LIKE CONCAT('%', #{param.customerName}, '%')
</if>
<if test="param.customerCode != null">
AND a.customer_code LIKE CONCAT('%', #{param.customerCode}, '%')
</if>
<if test="param.customerFullName != null">
AND a.customer_full_name LIKE CONCAT('%', #{param.customerFullName}, '%')
</if>
<if test="param.customerAvatar != null">
AND a.customer_avatar LIKE CONCAT('%', #{param.customerAvatar}, '%')
</if>
<if test="param.customerType != null">
AND a.customer_type LIKE CONCAT('%', #{param.customerType}, '%')
</if>
<if test="param.emptyType != null">
AND a.customer_type = ''
</if>
<if test="param.customerSource != null">
AND a.customer_source LIKE CONCAT('%', #{param.customerSource}, '%')
</if>
<if test="param.customerPhone != null">
AND a.customer_phone LIKE CONCAT('%', #{param.customerPhone}, '%')
</if>
<if test="param.customerMobile != null">
AND a.customer_mobile LIKE CONCAT('%', #{param.customerMobile}, '%')
</if>
<if test="param.customerContacts != null">
AND a.customer_contacts LIKE CONCAT('%', #{param.customerContacts}, '%')
</if>
<if test="param.customerProvince != null">
AND a.customer_province LIKE CONCAT('%', #{param.customerProvince}, '%')
</if>
<if test="param.customerCity != null">
AND a.customer_city LIKE CONCAT('%', #{param.customerCity}, '%')
</if>
<if test="param.customerRegion != null">
AND a.customer_region LIKE CONCAT('%', #{param.customerRegion}, '%')
</if>
<if test="param.customerAddress != null">
AND a.customer_address LIKE CONCAT('%', #{param.customerAddress}, '%')
</if>
<if test="param.progress != null">
AND a.progress LIKE CONCAT('%', #{param.progress}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.organizationId != null">
AND a.organization_id = #{param.organizationId}
</if>
<if test="param.visibility != null">
AND a.visibility LIKE CONCAT('%', #{param.visibility}, '%')
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.keywords != null">
AND (a.customer_name LIKE CONCAT('%', #{param.keywords}, '%')
OR a.customer_contacts LIKE CONCAT('%', #{param.keywords}, '%')
OR a.customer_mobile LIKE CONCAT('%', #{param.keywords}, '%')
)
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.Customer">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.Customer">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -1,69 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.oa.mapper.NoticeMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*,
b.nickname,
b.user_id,
b.avatar
FROM oa_notice a
LEFT JOIN sys_user b ON a.user_id = b.user_id
<where>
<if test="param.noticeId != null">
AND a.notice_id = #{param.noticeId}
</if>
<if test="param.type != null">
AND a.type LIKE CONCAT('%', #{param.type}, '%')
</if>
<if test="param.title != null">
AND a.title LIKE CONCAT('%', #{param.title}, '%')
</if>
<if test="param.icon != null">
AND a.icon LIKE CONCAT('%', #{param.icon}, '%')
</if>
<if test="param.color != null">
AND a.color LIKE CONCAT('%', #{param.color}, '%')
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.nickname != null">
AND b.nickname LIKE CONCAT('%', #{param.nickname}, '%')
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.Notice">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.Notice">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -1,116 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.oa.mapper.ProjectMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM oa_project a
<where>
<if test="param.projectId != null">
AND a.project_id = #{param.projectId}
</if>
<if test="param.projectName != null">
AND a.project_name LIKE CONCAT('%', #{param.projectName}, '%')
</if>
<if test="param.projectCode != null">
AND a.project_code LIKE CONCAT('%', #{param.projectCode}, '%')
</if>
<if test="param.projectCategory != null">
AND a.project_category LIKE CONCAT('%', #{param.projectCategory}, '%')
</if>
<if test="param.projectAvatar != null">
AND a.project_avatar LIKE CONCAT('%', #{param.projectAvatar}, '%')
</if>
<if test="param.url != null">
AND a.url LIKE CONCAT('%', #{param.url}, '%')
</if>
<if test="param.urlDev != null">
AND a.url_dev LIKE CONCAT('%', #{param.urlDev}, '%')
</if>
<if test="param.urlAdmin != null">
AND a.url_admin LIKE CONCAT('%', #{param.urlAdmin}, '%')
</if>
<if test="param.account != null">
AND a.account LIKE CONCAT('%', #{param.account}, '%')
</if>
<if test="param.money != null">
AND a.money = #{param.money}
</if>
<if test="param.realMoney != null">
AND a.real_money = #{param.realMoney}
</if>
<if test="param.annualFee != null">
AND a.annual_fee = #{param.annualFee}
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if>
<if test="param.param != null">
AND a.param LIKE CONCAT('%', #{param.param}, '%')
</if>
<if test="param.qrcode != null">
AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%')
</if>
<if test="param.customerName != null">
AND a.customer_name LIKE CONCAT('%', #{param.customerName}, '%')
</if>
<if test="param.progress != null">
AND a.progress = #{param.progress}
</if>
<if test="param.views != null">
AND a.views = #{param.views}
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.isCase != null">
AND a.is_case = #{param.isCase}
</if>
<if test="param.commander != null">
AND a.commander = #{param.commander}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.organizationId != null">
AND a.organization_id = #{param.organizationId}
</if>
<if test="param.visibility != null">
AND a.visibility LIKE CONCAT('%', #{param.visibility}, '%')
</if>
<if test="param.customerId != null">
AND a.customer_id = #{param.customerId}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.Project">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.Project">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -1,132 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.oa.mapper.TaskMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*,
b.nickname as promoterName,b.avatar as promoterAvatar,b.alias as promoterAlias,b.company_name as promoterCompanyName,
c.nickname as commanderName,c.avatar as commanderAvatar,c.alias as commanderAlias,c.company_name as commanderCompanyName,
d.nickname as lastNickname ,d.avatar as lastAvatar,d.real_name as lastRealName,d.company_name as lastCompanyName,
e.app_id,e.app_name
FROM oa_task a
LEFT JOIN sys_user b ON a.promoter = b.user_id
LEFT JOIN sys_user c ON a.commander = c.user_id
LEFT JOIN sys_user d ON a.last_read_user = d.user_id
LEFT JOIN oa_app e ON a.app_id = e.app_id
<where>
<if test="param.taskId != null">
AND a.task_id = #{param.taskId}
</if>
<if test="param.name != null">
AND a.name LIKE CONCAT('%', #{param.name}, '%')
</if>
<if test="param.taskType != null">
AND a.task_type IN
<foreach collection="param.taskType.split(',')" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="param.customerId != null">
AND a.customer_id = #{param.customerId}
</if>
<if test="param.appId != null">
AND a.app_id = #{param.appId}
</if>
<if test="param.projectId != null">
AND a.project_id = #{param.projectId}
</if>
<if test="param.assetsId != null">
AND a.assets_id = #{param.assetsId}
</if>
<if test="param.startTime != null">
AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%')
</if>
<if test="param.endTime != null">
AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%')
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if>
<if test="param.promoter != null">
AND a.promoter = #{param.promoter}
</if>
<if test="param.commander != null">
AND (a.commander = #{param.commander} OR a.promoter = #{param.commander})
</if>
<if test="param.progress != null">
AND a.progress IN
<foreach collection="param.progress.split(',')" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="param.priority != null">
AND a.priority LIKE CONCAT('%', #{param.priority}, '%')
</if>
<if test="param.quality != null">
AND a.quality LIKE CONCAT('%', #{param.quality}, '%')
</if>
<if test="param.day != null">
AND a.day = #{param.day}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<!-- <if test="param.userId != null">-->
<!-- AND a.task_id IN (SELECT task_id FROM oa_task_user WHERE user_id=#{param.userId})-->
<!-- </if>-->
<if test="param.organizationId != null">
AND a.organization_id = #{param.organizationId}
</if>
<if test="param.shopId != null">
AND a.shop_id = #{param.shopId}
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.keywords != null">
AND (a.name LIKE CONCAT('%', #{param.keywords}, '%')
OR a.task_id LIKE CONCAT('%', #{param.keywords}, '%')
OR b.nickname LIKE CONCAT('%', #{param.keywords}, '%')
OR b.real_name LIKE CONCAT('%', #{param.keywords}, '%')
OR b.company_name LIKE CONCAT('%', #{param.keywords}, '%')
OR c.nickname LIKE CONCAT('%', #{param.keywords}, '%')
OR c.real_name LIKE CONCAT('%', #{param.keywords}, '%')
OR e.app_name LIKE CONCAT('%', #{param.keywords}, '%')
)
</if>
<if test="param.appName != null">
AND b.app_name LIKE CONCAT('%', #{param.appName}, '%')
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.Task">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.Task">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -1,69 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.oa.mapper.TaskRecordMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*,
b.nickname,
b.user_id,
b.avatar
FROM oa_task_record a
LEFT JOIN sys_user b ON a.user_id = b.user_id
<where>
<if test="param.taskRecordId != null">
AND a.task_record_id = #{param.taskRecordId}
</if>
<if test="param.taskId != null">
AND a.task_id = #{param.taskId}
</if>
<if test="param.content != null">
AND a.content LIKE CONCAT('%', #{param.content}, '%')
</if>
<if test="param.files != null">
AND a.files LIKE CONCAT('%', #{param.files}, '%')
</if>
<if test="param.developerId != null">
AND a.developer_id = #{param.developerId}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.nickname != null">
AND b.nickname LIKE CONCAT('%', #{param.nickname}, '%')
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.TaskRecord">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.TaskRecord">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -1,50 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.oa.mapper.TaskUserMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*,
b.nickname as name,
b.phone,
b.user_id,
b.avatar,
b.email
FROM oa_task_user a
LEFT JOIN sys_user b ON a.user_id = b.user_id
<where>
<if test="param.taskUserId != null">
AND a.task_user_id = #{param.taskUserId}
</if>
<if test="param.role != null">
AND a.role = #{param.role}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.taskId != null">
AND a.task_id = #{param.taskId}
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.TaskUser">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.TaskUser">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -1,56 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxwebsoft.oa.mapper.TenantMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*,
b.company_id,
b.company_name
FROM sys_tenant a
LEFT JOIN sys_company b ON a.tenant_id = b.tenant_id
<where>
<if test="param.tenantId != null">
AND a.tenant_id = #{param.tenantId}
</if>
<if test="param.tenantName != null">
AND a.tenant_name LIKE CONCAT('%', #{param.tenantName}, '%')
</if>
<if test="param.appId != null">
AND a.app_id = #{param.appId}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.companyName != null">
AND b.company_name LIKE CONCAT('%', #{param.companyName}, '%')
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.oa.entity.Tenant">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.oa.entity.Tenant">
<include refid="selectSql"></include>
</select>
</mapper>

View File

@@ -1,187 +0,0 @@
package com.gxwebsoft.oa.param;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Set;
/**
* 应用管理记录表查询参数
*
* @author 科技小王子
* @since 2023-03-28 10:45:39
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "AppParam对象", description = "应用管理记录表查询参数")
public class AppParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "应用ID")
@QueryField(type = QueryType.EQ)
private Integer appId;
@ApiModelProperty(value = "应用名称")
private String appName;
@ApiModelProperty(value = "上级id, 0是顶级")
@QueryField(type = QueryType.EQ)
private Integer parentId;
@ApiModelProperty(value = "应用标识")
private String appCode;
@ApiModelProperty(value = "应用类型")
private String appType;
@ApiModelProperty(value = "类型, 0菜单, 1按钮")
@QueryField(type = QueryType.EQ)
private Integer menuType;
@ApiModelProperty(value = "企业ID")
@QueryField(type = QueryType.EQ)
private Integer companyId;
@ApiModelProperty(value = "应用图标")
private String appIcon;
@ApiModelProperty(value = "二维码")
private String appQrcode;
@ApiModelProperty(value = "链接地址")
private String appUrl;
@ApiModelProperty(value = "后台管理地址")
private String adminUrl;
@ApiModelProperty(value = "下载地址")
private String downUrl;
@ApiModelProperty(value = "仓库地址")
private String gitUrl;
@ApiModelProperty(value = "IP白名单")
private String ipAddress;
@ApiModelProperty(value = "应用截图")
private String images;
@ApiModelProperty(value = "应用包名")
private String packageName;
@ApiModelProperty(value = "下载次数")
@QueryField(type = QueryType.EQ)
private Integer clicks;
@ApiModelProperty(value = "安装次数")
@QueryField(type = QueryType.EQ)
private Integer installs;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "应用介绍")
private String content;
@ApiModelProperty(value = "项目需求")
private String requirement;
@ApiModelProperty(value = "开发者(个人或公司)")
private String developer;
@ApiModelProperty(value = "软件定价")
@QueryField(type = QueryType.EQ)
private BigDecimal price;
@ApiModelProperty(value = "划线价格")
@QueryField(type = QueryType.EQ)
private BigDecimal linePrice;
@ApiModelProperty(value = "评分")
private String score;
@ApiModelProperty(value = "星级")
private String star;
@ApiModelProperty(value = "菜单路由地址")
private String path;
@ApiModelProperty(value = "菜单组件地址, 目录可为空")
private String component;
@ApiModelProperty(value = "权限标识")
private String authority;
@ApiModelProperty(value = "打开位置")
private String target;
@ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)")
@QueryField(type = QueryType.EQ)
private Integer hide;
@ApiModelProperty(value = "禁止搜索1禁止 0 允许")
@QueryField(type = QueryType.EQ)
private Integer search;
@ApiModelProperty(value = "菜单侧栏选中的path")
private String active;
@ApiModelProperty(value = "其它路由元信息")
private String meta;
@ApiModelProperty(value = "版本0正式版 1体验版 2开发版")
private String edition;
@ApiModelProperty(value = "版本号")
private String version;
@ApiModelProperty(value = "是否已安装")
@QueryField(type = QueryType.EQ)
private Integer isUse;
@ApiModelProperty(value = "排序(数字越小越靠前)")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
@ApiModelProperty(value = "应用状态")
private String appStatus;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "租户ID")
private Integer tenantId;
@ApiModelProperty(value = "机构id")
@QueryField(type = QueryType.EQ)
private Integer organizationId;
@ApiModelProperty(value = "企业名称")
private String companyName;
@ApiModelProperty(value = "租户编号")
private String tenantCode;
@ApiModelProperty(value = "按APPID集搜索")
@TableField(exist = false)
private Set<Integer> appIds;
}

View File

@@ -1,66 +0,0 @@
package com.gxwebsoft.oa.param;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 应用成员查询参数
*
* @author 科技小王子
* @since 2023-05-31 13:18:55
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "AppUserParam对象", description = "应用成员查询参数")
public class AppUserParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "自增ID")
@QueryField(type = QueryType.EQ)
private Integer appUserId;
@ApiModelProperty(value = "角色10体验成员 20开发者成员 30管理员 ")
@QueryField(type = QueryType.EQ)
private Integer role;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "应用ID")
@QueryField(type = QueryType.EQ)
private Integer appId;
@ApiModelProperty(value = "状态, 0正常, 1待确认")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "昵称")
@TableField(exist = false)
private String nickname;
@ApiModelProperty(value = "用户名")
@TableField(exist = false)
private String username;
@ApiModelProperty(value = "手机号码")
@TableField(exist = false)
private String phone;
@ApiModelProperty(value = "邮箱")
@TableField(exist = false)
private String email;
@ApiModelProperty(value = "头像")
@TableField(exist = false)
private String avatar;
}

View File

@@ -1,142 +0,0 @@
package com.gxwebsoft.oa.param;
import com.baomidou.mybatisplus.annotation.TableField;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 服务器资产记录表查询参数
*
* @author WebSoft
* @since 2022-11-16 11:13:16
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "AssetsParam对象", description = "服务器资产记录表查询参数")
public class AssetsParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "资产ID")
@QueryField(type = QueryType.EQ)
private Integer assetsId;
@ApiModelProperty(value = "资产名称")
private String name;
@ApiModelProperty(value = "资产标识")
private String code;
@ApiModelProperty(value = "资产类型")
private String type;
@ApiModelProperty(value = "服务器厂商")
private String brand;
@ApiModelProperty(value = "服务器配置")
private String configuration;
@ApiModelProperty(value = "初始账号")
private String account;
@ApiModelProperty(value = "初始密码")
private String password;
@ApiModelProperty(value = "(阿里云/腾讯云)登录账号")
private String brandAccount;
@ApiModelProperty(value = "(阿里云/腾讯云)登录密码")
private String brandPassword;
@ApiModelProperty(value = "宝塔面板")
private String panel;
@ApiModelProperty(value = "宝塔面板账号")
private String panelAccount;
@ApiModelProperty(value = "宝塔面板密码")
private String panelPassword;
@ApiModelProperty(value = "财务信息-合同金额")
@QueryField(type = QueryType.EQ)
private BigDecimal financeAmount;
@ApiModelProperty(value = "购买年限")
@QueryField(type = QueryType.EQ)
private Integer financeYears;
@ApiModelProperty(value = "续费金额")
@QueryField(type = QueryType.EQ)
private BigDecimal financeRenew;
@ApiModelProperty(value = "客户名称")
private String financeCustomerName;
@ApiModelProperty(value = "客户联系人")
private String financeCustomerContact;
@ApiModelProperty(value = "客户联系电话")
private String financeCustomerPhone;
@ApiModelProperty(value = "客户ID")
@QueryField(type = QueryType.EQ)
private Integer customerId;
@ApiModelProperty(value = "客户名称")
private String customerName;
@ApiModelProperty(value = "开放端口")
private String openPort;
@ApiModelProperty(value = "详情内容")
private String content;
@ApiModelProperty(value = "购买时间")
private String startTime;
@ApiModelProperty(value = "到期时间")
private String endTime;
@ApiModelProperty(value = "置顶状态")
private String isTop;
@ApiModelProperty(value = "可见性(public,private,protected)")
private String visibility;
@ApiModelProperty(value = "文章排序(数字越小越靠前)")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
@ApiModelProperty(value = "描述")
private String comments;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "机构id")
@QueryField(type = QueryType.EQ)
private Integer organizationId;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
private String status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
@ApiModelProperty(value = "客户名称")
@TableField(exist = false)
private String companyName;
}

View File

@@ -1,101 +0,0 @@
package com.gxwebsoft.oa.param;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 客户管理记录表查询参数
*
* @author WebSoft
* @since 2022-11-16 11:16:14
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "CustomerParam对象", description = "客户管理记录表查询参数")
public class CustomerParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "客户ID")
@QueryField(type = QueryType.EQ)
private Integer customerId;
@ApiModelProperty(value = "客户名称")
private String customerName;
@ApiModelProperty(value = "客户标识")
private String customerCode;
@ApiModelProperty(value = "客户全称")
private String customerFullName;
@ApiModelProperty(value = "头像")
private String customerAvatar;
@ApiModelProperty(value = "客户类型")
private String customerType;
@ApiModelProperty(value = "客户来源")
private String customerSource;
@ApiModelProperty(value = "公司座机")
private String customerPhone;
@ApiModelProperty(value = "手机号码")
private String customerMobile;
@ApiModelProperty(value = "联系人")
private String customerContacts;
@ApiModelProperty(value = "所在省份")
private String customerProvince;
@ApiModelProperty(value = "所在城市")
private String customerCity;
@ApiModelProperty(value = "所在地区")
private String customerRegion;
@ApiModelProperty(value = "所在地址")
private String customerAddress;
@ApiModelProperty(value = "跟进状态")
private String progress;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "机构id")
@QueryField(type = QueryType.EQ)
private Integer organizationId;
@ApiModelProperty(value = "可见性(public,private,protected)")
private String visibility;
@ApiModelProperty(value = "排序(数字越小越靠前)")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
@ApiModelProperty(value = "按无企业类型查询")
@QueryField(type = QueryType.EQ)
private Boolean emptyType;
}

View File

@@ -1,80 +0,0 @@
package com.gxwebsoft.oa.param;
import com.baomidou.mybatisplus.annotation.TableField;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 消息记录表查询参数
*
* @author 科技小王子
* @since 2023-03-22 14:07:26
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "NoticeParam对象", description = "消息记录表查询参数")
public class NoticeParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "ID")
@QueryField(type = QueryType.EQ)
private Integer noticeId;
@ApiModelProperty(value = "消息类型")
private String type;
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "图标")
private String icon;
@ApiModelProperty(value = "颜色")
private String color;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "消息来源")
private String source;
@ApiModelProperty(value = "来源记录ID")
private Integer sourceId;
@ApiModelProperty(value = "路由地址")
private String path;
@ApiModelProperty(value = "渠道, 0发送 1回复")
private Integer channel;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "租户id")
@QueryField(type = QueryType.EQ)
private Integer tenantId;
@ApiModelProperty(value = "状态, 0待处理, 1已完成")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
@ApiModelProperty(value = "昵称")
@TableField(exist = false)
private String nickname;
}

View File

@@ -1,125 +0,0 @@
package com.gxwebsoft.oa.param;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 项目管理表查询参数
*
* @author WebSoft
* @since 2022-11-16 11:00:43
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "ProjectParam对象", description = "项目管理表查询参数")
public class ProjectParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "项目ID")
@QueryField(type = QueryType.EQ)
private Integer projectId;
@ApiModelProperty(value = "项目名称")
private String projectName;
@ApiModelProperty(value = "项目标识")
private String projectCode;
@ApiModelProperty(value = "商品分类")
private String projectCategory;
@ApiModelProperty(value = "项目商标")
private String projectAvatar;
@ApiModelProperty(value = "项目域名")
private String url;
@ApiModelProperty(value = "开发版域名")
private String urlDev;
@ApiModelProperty(value = "后台管理地址")
private String urlAdmin;
@ApiModelProperty(value = "默认账号密码")
private String account;
@ApiModelProperty(value = "项目金额")
@QueryField(type = QueryType.EQ)
private BigDecimal money;
@ApiModelProperty(value = "实际金额")
@QueryField(type = QueryType.EQ)
private BigDecimal realMoney;
@ApiModelProperty(value = "年费")
@QueryField(type = QueryType.EQ)
private BigDecimal annualFee;
@ApiModelProperty(value = "项目详情")
private String content;
@ApiModelProperty(value = "开发参数(json)")
private String param;
@ApiModelProperty(value = "二维码")
private String qrcode;
@ApiModelProperty(value = "客户名称")
private String customerName;
@ApiModelProperty(value = "项目进度10待安排 20策划设计 30功能开发 40待验收 50完成")
@QueryField(type = QueryType.EQ)
private Integer progress;
@ApiModelProperty(value = "初始浏览数")
@QueryField(type = QueryType.EQ)
private Integer views;
@ApiModelProperty(value = "状态(10上架 20下架)")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "排序(数字越小越靠前)")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
@ApiModelProperty(value = "是否精选客户案例")
@QueryField(type = QueryType.EQ)
private Boolean isCase;
@ApiModelProperty(value = "负责人")
@QueryField(type = QueryType.EQ)
private Integer commander;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "机构id")
@QueryField(type = QueryType.EQ)
private Integer organizationId;
@ApiModelProperty(value = "可见性(public,private,protected)")
private String visibility;
@ApiModelProperty(value = "项目归属者")
@QueryField(type = QueryType.EQ)
private Integer customerId;
@ApiModelProperty(value = "项目描述")
private String comments;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
}

View File

@@ -1,145 +0,0 @@
package com.gxwebsoft.oa.param;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 文章记录表查询参数
*
* @author WebSoft
* @since 2022-11-16 11:21:42
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "TaskParam对象", description = "文章记录表查询参数")
public class TaskParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "任务ID")
@QueryField(type = QueryType.EQ)
private Integer taskId;
@ApiModelProperty(value = "任务名称")
private String name;
@ApiModelProperty(value = "任务类型")
private String taskType;
@ApiModelProperty(value = "关联应用")
private Integer appId;
@ApiModelProperty(value = "客户ID")
@QueryField(type = QueryType.EQ)
private Integer customerId;
@ApiModelProperty(value = "项目ID")
@QueryField(type = QueryType.EQ)
private Integer projectId;
@ApiModelProperty(value = "资产ID")
@QueryField(type = QueryType.EQ)
private Integer assetsId;
@ApiModelProperty(value = "是否已查阅")
private Integer isRead;
@ApiModelProperty(value = "最后回复人ID")
private Integer lastReadUser;
@ApiModelProperty(value = "最后回复人头像")
@TableField(exist = false)
private String lastAvatar;
@ApiModelProperty(value = "最后回复人昵称")
@TableField(exist = false)
private String lastNickname;
@ApiModelProperty(value = "最后回复人姓名")
@TableField(exist = false)
private String lastRealName;
@ApiModelProperty(value = "最后回复人公司名称")
@TableField(exist = false)
private String lastCompanyName;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "任务内容")
private String content;
@ApiModelProperty(value = "任务发起人")
@QueryField(type = QueryType.EQ)
private Integer promoter;
@ApiModelProperty(value = "负责人")
private Integer commander;
@ApiModelProperty(value = "任务状态")
private String progress;
@ApiModelProperty(value = "优先级")
private String priority;
@ApiModelProperty(value = "品质要求")
private String quality;
@ApiModelProperty(value = "时限(天)")
@QueryField(type = QueryType.EQ)
private Integer day;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "机构id")
@QueryField(type = QueryType.EQ)
private Integer organizationId;
@ApiModelProperty(value = "所属门店ID")
@QueryField(type = QueryType.EQ)
private Integer shopId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0正常, 1冻结")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
@ApiModelProperty(value = "用户昵称")
@QueryField(type = QueryType.EQ)
private String nickname;
@ApiModelProperty(value = "用户头像")
@QueryField(type = QueryType.EQ)
private String avatar;
@ApiModelProperty(value = "应用名称")
@TableField(exist = false)
private String appName;
@ApiModelProperty(value = "关键词搜索")
@TableField(exist = false)
private String keywords;
}

View File

@@ -1,75 +0,0 @@
package com.gxwebsoft.oa.param;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import com.gxwebsoft.oa.entity.App;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 工单回复记录表查询参数
*
* @author 科技小王子
* @since 2023-03-05 00:52:21
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "TaskRecordParam对象", description = "工单回复记录表查询参数")
public class TaskRecordParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "回复ID")
@QueryField(type = QueryType.EQ)
private Integer taskRecordId;
@ApiModelProperty(value = "工单ID")
@QueryField(type = QueryType.EQ)
private Integer taskId;
@ApiModelProperty(value = "上级ID")
private Integer parentId;
@ApiModelProperty(value = "任务内容")
private String content;
@ApiModelProperty(value = "工单附件")
private String files;
@ApiModelProperty(value = "开发者ID")
@QueryField(type = QueryType.EQ)
private Integer developerId;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "排序(数字越小越靠前)")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "状态, 0待处理, 1已完成")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
@ApiModelProperty(value = "用户昵称")
@QueryField(type = QueryType.EQ)
private String nickname;
@ApiModelProperty(value = "用户头像")
@QueryField(type = QueryType.EQ)
private String avatar;
}

View File

@@ -1,45 +0,0 @@
package com.gxwebsoft.oa.param;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 工单成员查询参数
*
* @author 科技小王子
* @since 2023-03-06 12:00:41
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "TaskUserParam对象", description = "工单成员查询参数")
public class TaskUserParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "自增ID")
@QueryField(type = QueryType.EQ)
private Integer taskUserId;
@ApiModelProperty(value = "角色10体验成员 20开发者成员 30管理员 ")
@QueryField(type = QueryType.EQ)
private Integer role;
@ApiModelProperty(value = "用户ID")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "工单ID")
@QueryField(type = QueryType.EQ)
private Integer taskId;
@ApiModelProperty(value = "状态, 0正常, 1待确认")
@QueryField(type = QueryType.EQ)
private Integer status;
}

View File

@@ -1,71 +0,0 @@
package com.gxwebsoft.oa.param;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 租户查询参数
*
* @author WebSoft
* @since 2022-11-17 17:13:39
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "TenantParam对象", description = "租户查询参数")
public class TenantParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty("租户ID")
@TableId(value = "tenant_id", type = IdType.AUTO)
private Integer tenantId;
@ApiModelProperty(value = "租户名称")
private String tenantName;
@ApiModelProperty(value = "初始密码")
private String password;
@ApiModelProperty(value = "应用ID")
private String appId;
@ApiModelProperty(value = "应用密钥")
private String appSecret;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "客户ID")
@TableField(exist = false)
private Integer companyId;
@ApiModelProperty(value = "创建人")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "状态")
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
@ApiModelProperty("客户名称")
@TableField(exist = false)
private String companyName;
@ApiModelProperty("租户编号")
@TableField(exist = false)
private String tenantCode;
}

View File

@@ -1,45 +0,0 @@
package com.gxwebsoft.oa.service;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.App;
import com.gxwebsoft.oa.param.AppParam;
import java.util.List;
/**
* 应用管理记录表Service
*
* @author 科技小王子
* @since 2023-03-28 10:45:39
*/
public interface AppService extends IService<App> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<App>
*/
@InterceptorIgnore(tenantLine = "true")
PageResult<App> pageRel(AppParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<App>
*/
List<App> listRel(AppParam param);
/**
* 根据id查询
*
* @param appId 应用ID
* @return App
*/
@InterceptorIgnore(tenantLine = "true")
App getByIdRel(Integer appId);
}

View File

@@ -1,42 +0,0 @@
package com.gxwebsoft.oa.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.AppUser;
import com.gxwebsoft.oa.param.AppUserParam;
import java.util.List;
/**
* 应用成员Service
*
* @author 科技小王子
* @since 2023-05-31 13:18:55
*/
public interface AppUserService extends IService<AppUser> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<AppUser>
*/
PageResult<AppUser> pageRel(AppUserParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<AppUser>
*/
List<AppUser> listRel(AppUserParam param);
/**
* 根据id查询
*
* @param appUserId 自增ID
* @return AppUser
*/
AppUser getByIdRel(Integer appUserId);
}

View File

@@ -1,42 +0,0 @@
package com.gxwebsoft.oa.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.Assets;
import com.gxwebsoft.oa.param.AssetsParam;
import java.util.List;
/**
* 服务器资产记录表Service
*
* @author WebSoft
* @since 2022-11-16 11:13:16
*/
public interface AssetsService extends IService<Assets> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<Assets>
*/
PageResult<Assets> pageRel(AssetsParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<Assets>
*/
List<Assets> listRel(AssetsParam param);
/**
* 根据id查询
*
* @param assetsId 资产ID
* @return Assets
*/
Assets getByIdRel(Integer assetsId);
}

View File

@@ -1,43 +0,0 @@
package com.gxwebsoft.oa.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.Customer;
import com.gxwebsoft.oa.param.CustomerParam;
import java.util.List;
/**
* 客户管理记录表Service
*
* @author WebSoft
* @since 2022-11-16 11:16:14
*/
public interface CustomerService extends IService<Customer> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<Customer>
*/
PageResult<Customer> pageRel(CustomerParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<Customer>
*/
List<Customer> listRel(CustomerParam param);
/**
* 根据id查询
*
* @param customerId 客户ID
* @return Customer
*/
Customer getByIdRel(Integer customerId);
Customer getByCustomerName(String customerName);
}

View File

@@ -1,51 +0,0 @@
package com.gxwebsoft.oa.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.Notice;
import com.gxwebsoft.oa.entity.Task;
import com.gxwebsoft.oa.entity.TaskRecord;
import com.gxwebsoft.oa.param.NoticeParam;
import java.util.List;
/**
* 消息记录表Service
*
* @author 科技小王子
* @since 2023-03-22 14:07:26
*/
public interface NoticeService extends IService<Notice> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<Notice>
*/
PageResult<Notice> pageRel(NoticeParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<Notice>
*/
List<Notice> listRel(NoticeParam param);
/**
* 根据id查询
*
* @param noticeId ID
* @return Notice
*/
Notice getByIdRel(Integer noticeId);
void add();
void addNotice(Task task);
void addLetter(TaskRecord taskRecord);
void addTodo(Task task);
}

View File

@@ -1,42 +0,0 @@
package com.gxwebsoft.oa.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.Project;
import com.gxwebsoft.oa.param.ProjectParam;
import java.util.List;
/**
* 项目管理表Service
*
* @author WebSoft
* @since 2022-11-16 11:00:43
*/
public interface ProjectService extends IService<Project> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<Project>
*/
PageResult<Project> pageRel(ProjectParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<Project>
*/
List<Project> listRel(ProjectParam param);
/**
* 根据id查询
*
* @param projectId 项目ID
* @return Project
*/
Project getByIdRel(Integer projectId);
}

View File

@@ -1,42 +0,0 @@
package com.gxwebsoft.oa.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.TaskRecord;
import com.gxwebsoft.oa.param.TaskRecordParam;
import java.util.List;
/**
* 工单回复记录表Service
*
* @author 科技小王子
* @since 2023-03-05 00:52:21
*/
public interface TaskRecordService extends IService<TaskRecord> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<TaskRecord>
*/
PageResult<TaskRecord> pageRel(TaskRecordParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<TaskRecord>
*/
List<TaskRecord> listRel(TaskRecordParam param);
/**
* 根据id查询
*
* @param taskRecordId 回复ID
* @return TaskRecord
*/
TaskRecord getByIdRel(Integer taskRecordId);
}

View File

@@ -1,47 +0,0 @@
package com.gxwebsoft.oa.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.entity.Task;
import com.gxwebsoft.oa.param.TaskParam;
import java.util.ArrayList;
import java.util.List;
/**
* 文章记录表Service
*
* @author WebSoft
* @since 2022-11-16 11:21:43
*/
public interface TaskService extends IService<Task> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<Task>
*/
PageResult<Task> pageRel(TaskParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<Task>
*/
List<Task> listRel(TaskParam param);
/**
* 根据id查询
*
* @param taskId 任务ID
* @return Task
*/
Task getByIdRel(Integer taskId);
ArrayList<Object> getCountNum(User loginUser);
ArrayList<Object> getCountNum(User loginUser, TaskParam param);
}

View File

@@ -1,42 +0,0 @@
package com.gxwebsoft.oa.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.TaskUser;
import com.gxwebsoft.oa.param.TaskUserParam;
import java.util.List;
/**
* 工单成员Service
*
* @author 科技小王子
* @since 2023-03-06 12:00:41
*/
public interface TaskUserService extends IService<TaskUser> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<TaskUser>
*/
PageResult<TaskUser> pageRel(TaskUserParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<TaskUser>
*/
List<TaskUser> listRel(TaskUserParam param);
/**
* 根据id查询
*
* @param taskUserId 自增ID
* @return TaskUser
*/
TaskUser getByIdRel(Integer taskUserId);
}

View File

@@ -1,44 +0,0 @@
package com.gxwebsoft.oa.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.Tenant;
import com.gxwebsoft.oa.param.TenantParam;
import java.util.List;
/**
* 租户Service
*
* @author WebSoft
* @since 2022-11-17 17:13:39
*/
public interface TenantService extends IService<Tenant> {
/**
* 分页关联查询
*
* @param param 查询参数
* @return PageResult<Tenant>
*/
PageResult<Tenant> pageRel(TenantParam param);
/**
* 关联查询全部
*
* @param param 查询参数
* @return List<Tenant>
*/
List<Tenant> listRel(TenantParam param);
Integer getByUserId(Integer userId);
/**
* 根据id查询
*
* @param tenantId 租户id
* @return Tenant
*/
Tenant getByIdRel(Integer tenantId);
}

View File

@@ -1,52 +0,0 @@
package com.gxwebsoft.oa.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.App;
import com.gxwebsoft.oa.mapper.AppMapper;
import com.gxwebsoft.oa.param.AppParam;
import com.gxwebsoft.oa.service.AppService;
import com.gxwebsoft.oa.service.AppUserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 应用管理记录表Service实现
*
* @author 科技小王子
* @since 2023-03-28 10:45:39
*/
@Service
public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements AppService {
@Resource
private AppUserService appUserService;
@Override
public PageResult<App> pageRel(AppParam param) {
PageParam<App, AppParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<App> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<App> listRel(AppParam param) {
List<App> list = baseMapper.selectListRel(param);
// 排序
PageParam<App, AppParam> page = new PageParam<>();
page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public App getByIdRel(Integer appId) {
AppParam param = new AppParam();
param.setAppId(appId);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -1,47 +0,0 @@
package com.gxwebsoft.oa.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.oa.mapper.AppUserMapper;
import com.gxwebsoft.oa.service.AppUserService;
import com.gxwebsoft.oa.entity.AppUser;
import com.gxwebsoft.oa.param.AppUserParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 应用成员Service实现
*
* @author 科技小王子
* @since 2023-05-31 13:18:55
*/
@Service
public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> implements AppUserService {
@Override
public PageResult<AppUser> pageRel(AppUserParam param) {
PageParam<AppUser, AppUserParam> page = new PageParam<>(param);
//page.setDefaultOrder("create_time desc");
List<AppUser> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<AppUser> listRel(AppUserParam param) {
List<AppUser> list = baseMapper.selectListRel(param);
// 排序
PageParam<AppUser, AppUserParam> page = new PageParam<>();
//page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public AppUser getByIdRel(Integer appUserId) {
AppUserParam param = new AppUserParam();
param.setAppUserId(appUserId);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -1,47 +0,0 @@
package com.gxwebsoft.oa.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.oa.mapper.AssetsMapper;
import com.gxwebsoft.oa.service.AssetsService;
import com.gxwebsoft.oa.entity.Assets;
import com.gxwebsoft.oa.param.AssetsParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 服务器资产记录表Service实现
*
* @author WebSoft
* @since 2022-11-16 11:13:16
*/
@Service
public class AssetsServiceImpl extends ServiceImpl<AssetsMapper, Assets> implements AssetsService {
@Override
public PageResult<Assets> pageRel(AssetsParam param) {
PageParam<Assets, AssetsParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<Assets> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<Assets> listRel(AssetsParam param) {
List<Assets> list = baseMapper.selectListRel(param);
// 排序
PageParam<Assets, AssetsParam> page = new PageParam<>();
page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public Assets getByIdRel(Integer assetsId) {
AssetsParam param = new AssetsParam();
param.setAssetsId(assetsId);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -1,52 +0,0 @@
package com.gxwebsoft.oa.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.oa.mapper.CustomerMapper;
import com.gxwebsoft.oa.service.CustomerService;
import com.gxwebsoft.oa.entity.Customer;
import com.gxwebsoft.oa.param.CustomerParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 客户管理记录表Service实现
*
* @author WebSoft
* @since 2022-11-16 11:16:14
*/
@Service
public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> implements CustomerService {
@Override
public PageResult<Customer> pageRel(CustomerParam param) {
PageParam<Customer, CustomerParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<Customer> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<Customer> listRel(CustomerParam param) {
List<Customer> list = baseMapper.selectListRel(param);
// 排序
PageParam<Customer, CustomerParam> page = new PageParam<>();
page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public Customer getByIdRel(Integer customerId) {
CustomerParam param = new CustomerParam();
param.setCustomerId(customerId);
return param.getOne(baseMapper.selectListRel(param));
}
@Override
public Customer getByCustomerName(String customerName) {
return query().eq("customer_name", customerName).one();
}
}

View File

@@ -1,109 +0,0 @@
package com.gxwebsoft.oa.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.oa.entity.Task;
import com.gxwebsoft.oa.entity.TaskRecord;
import com.gxwebsoft.oa.mapper.NoticeMapper;
import com.gxwebsoft.oa.service.NoticeService;
import com.gxwebsoft.oa.entity.Notice;
import com.gxwebsoft.oa.param.NoticeParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.service.TaskService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import static com.gxwebsoft.oa.constants.NoticeConstants.*;
/**
* 消息记录表Service实现
*
* @author 科技小王子
* @since 2023-03-22 14:07:26
*/
@Service
public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService {
@Resource
private UserService userService;
@Resource
private TaskService taskService;
@Override
public PageResult<Notice> pageRel(NoticeParam param) {
PageParam<Notice, NoticeParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<Notice> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<Notice> listRel(NoticeParam param) {
List<Notice> list = baseMapper.selectListRel(param);
// 排序
PageParam<Notice, NoticeParam> page = new PageParam<>();
page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public Notice getByIdRel(Integer noticeId) {
NoticeParam param = new NoticeParam();
param.setNoticeId(noticeId);
return param.getOne(baseMapper.selectListRel(param));
}
@Override
public void add() {
}
@Override
public void addNotice(Task task) {
Notice notice = new Notice();
notice.setType(NOTICE);
notice.setIcon("NotificationFilled");
notice.setSourceId(task.getTaskId());
notice.setUserId(task.getPromoter());
notice.setTitle(task.getName());
notice.setContent("您有一个新指派的工单(" + task.getTaskId() + ")需要处理!");
save(notice);
}
@Override
public void addLetter(TaskRecord taskRecord) {
// 通知发起人
User user = userService.getById(taskRecord.getUserId());
Task task = taskService.getById(taskRecord.getTaskId());
Notice notice = new Notice();
notice.setType(LETTER);
notice.setIcon(user.getAvatar());
notice.setSourceId(task.getTaskId());
notice.setUserId(task.getPromoter());
notice.setTitle(user.getNickname() + " 回复了你的工单(" + taskRecord.getTaskId() + ")");
notice.setContent(taskRecord.getContent());
save(notice);
// 通知代发人
notice.setUserId(task.getUserId());
save(notice);
}
@Override
public void addTodo(Task task) {
Task record = taskService.getById(task.getTaskId());
if (task.getCommander() != null) {
Notice notice = new Notice();
notice.setType(TODO);
notice.setIcon("HistoryOutlined");
notice.setSourceId(task.getTaskId());
notice.setUserId(task.getCommander());
notice.setTitle("您有一个新的工单需要处理!");
notice.setContent(record.getName().concat("("+ task.getTaskId() +")"));
notice.setProgress(record.getProgress());
save(notice);
}
}
}

View File

@@ -1,47 +0,0 @@
package com.gxwebsoft.oa.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.oa.mapper.ProjectMapper;
import com.gxwebsoft.oa.service.ProjectService;
import com.gxwebsoft.oa.entity.Project;
import com.gxwebsoft.oa.param.ProjectParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 项目管理表Service实现
*
* @author WebSoft
* @since 2022-11-16 11:00:43
*/
@Service
public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> implements ProjectService {
@Override
public PageResult<Project> pageRel(ProjectParam param) {
PageParam<Project, ProjectParam> page = new PageParam<>(param);
//page.setDefaultOrder("create_time desc");
List<Project> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<Project> listRel(ProjectParam param) {
List<Project> list = baseMapper.selectListRel(param);
// 排序
PageParam<Project, ProjectParam> page = new PageParam<>();
//page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public Project getByIdRel(Integer projectId) {
ProjectParam param = new ProjectParam();
param.setProjectId(projectId);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -1,49 +0,0 @@
package com.gxwebsoft.oa.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.oa.mapper.TaskRecordMapper;
import com.gxwebsoft.oa.service.TaskRecordService;
import com.gxwebsoft.oa.entity.TaskRecord;
import com.gxwebsoft.oa.param.TaskRecordParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.service.TaskService;
import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* 工单回复记录表Service实现
*
* @author 科技小王子
* @since 2023-03-05 00:52:21
*/
@Service
public class TaskRecordServiceImpl extends ServiceImpl<TaskRecordMapper, TaskRecord> implements TaskRecordService {
@Override
public PageResult<TaskRecord> pageRel(TaskRecordParam param) {
PageParam<TaskRecord, TaskRecordParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time asc");
List<TaskRecord> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<TaskRecord> listRel(TaskRecordParam param) {
List<TaskRecord> list = baseMapper.selectListRel(param);
// 排序
PageParam<TaskRecord, TaskRecordParam> page = new PageParam<>();
page.setDefaultOrder("create_time asc");
return page.sortRecords(list);
}
@Override
public TaskRecord getByIdRel(Integer taskRecordId) {
TaskRecordParam param = new TaskRecordParam();
param.setTaskRecordId(taskRecordId);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -1,141 +0,0 @@
package com.gxwebsoft.oa.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.oa.entity.Task;
import com.gxwebsoft.oa.mapper.TaskMapper;
import com.gxwebsoft.oa.param.TaskParam;
import com.gxwebsoft.oa.service.TaskService;
import com.gxwebsoft.oa.service.TaskUserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 文章记录表Service实现
*
* @author WebSoft
* @since 2022-11-16 11:21:43
*/
@Service
public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService {
private Integer userId;
@Resource
private UserService userService;
@Resource
private TaskUserService taskUserService;
@Override
public PageResult<Task> pageRel(TaskParam param) {
PageParam<Task, TaskParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<Task> list = baseMapper.selectPageRel(page, param);
// list.forEach(d -> {
// int count = taskUserService.count(new LambdaQueryWrapper<TaskUser>().eq(TaskUser::getTaskId, d.getTaskId()));
// if(count>0){
// TaskUserParam taskUserParam = new TaskUserParam();
// taskUserParam.setTaskId(d.getTaskId());
// List<TaskUser> users = taskUserService.listRel(taskUserParam);
// d.setUsers(users);
// }
// });
return new PageResult<>(list, page.getTotal());
}
@Override
public List<Task> listRel(TaskParam param) {
List<Task> list = baseMapper.selectListRel(param);
// 排序
PageParam<Task, TaskParam> page = new PageParam<>();
//page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public Task getByIdRel(Integer taskId) {
TaskParam param = new TaskParam();
param.setTaskId(taskId);
return param.getOne(baseMapper.selectListRel(param));
}
@Override
public ArrayList<Object> getCountNum(User loginUser) {
Integer type = loginUser.getType();
Integer userId = loginUser.getUserId();
AtomicInteger count1 = new AtomicInteger(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 0)));
AtomicInteger count2 = new AtomicInteger(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 1)));
// 非管理员仅可浏览和自己相关的工单
loginUser.getRoles().forEach(d -> {
if(!StrUtil.equals(d.getRoleCode(),"superAdmin") && !StrUtil.equals(d.getRoleCode(),"admin")){
if(type.equals(6)){
count1.set(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 0).eq(Task::getCommander, userId)));
count2.set(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 1).eq(Task::getCommander, userId)));
}
if(type.equals(10)){
count1.set(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 0).eq(Task::getPromoter, userId)));
count2.set(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 1).eq(Task::getPromoter, userId)));
}
}
});
JSONObject json1 = new JSONObject();
json1.put("tab","待处理");
json1.put("key","0");
json1.put("count",count1);
JSONObject json2 = new JSONObject();
json2.put("tab","已完成");
json2.put("key","1");
json2.put("count",count2);
ArrayList<Object> objects = new ArrayList<>();
objects.add(json1);
objects.add(json2);
return objects;
}
@Override
public ArrayList<Object> getCountNum(User loginUser, TaskParam param) {
Integer type = loginUser.getType();
final Integer userId = param.getUserId();
// if (param.getUserId() != null) {
// this.userId = param.getUserId();
// }else {
// this.userId = loginUser.getUserId();
// }
AtomicInteger count1 = new AtomicInteger(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 0)));
AtomicInteger count2 = new AtomicInteger(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 1)));
// 非管理员仅可浏览和自己相关的工单
loginUser.getRoles().forEach(d -> {
if(type.equals(6)){
count1.set(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 0).eq(Task::getCommander, userId)));
count2.set(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 1).eq(Task::getCommander, userId)));
}
if(type.equals(10)){
count1.set(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 0).eq(Task::getPromoter, userId)));
count2.set(count(new LambdaQueryWrapper<Task>().eq(Task::getStatus, 1).eq(Task::getPromoter, userId)));
}
});
JSONObject json1 = new JSONObject();
json1.put("tab","待处理");
json1.put("key","0");
json1.put("count",count1);
JSONObject json2 = new JSONObject();
json2.put("tab","已完成");
json2.put("key","1");
json2.put("count",count2);
ArrayList<Object> objects = new ArrayList<>();
objects.add(json1);
objects.add(json2);
return objects;
}
}

View File

@@ -1,47 +0,0 @@
package com.gxwebsoft.oa.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.oa.mapper.TaskUserMapper;
import com.gxwebsoft.oa.service.TaskUserService;
import com.gxwebsoft.oa.entity.TaskUser;
import com.gxwebsoft.oa.param.TaskUserParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 工单成员Service实现
*
* @author 科技小王子
* @since 2023-03-06 12:00:41
*/
@Service
public class TaskUserServiceImpl extends ServiceImpl<TaskUserMapper, TaskUser> implements TaskUserService {
@Override
public PageResult<TaskUser> pageRel(TaskUserParam param) {
PageParam<TaskUser, TaskUserParam> page = new PageParam<>(param);
//page.setDefaultOrder("create_time desc");
List<TaskUser> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<TaskUser> listRel(TaskUserParam param) {
List<TaskUser> list = baseMapper.selectListRel(param);
// 排序
PageParam<TaskUser, TaskUserParam> page = new PageParam<>();
//page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public TaskUser getByIdRel(Integer taskUserId) {
TaskUserParam param = new TaskUserParam();
param.setTaskUserId(taskUserId);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -1,53 +0,0 @@
package com.gxwebsoft.oa.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.oa.mapper.TenantMapper;
import com.gxwebsoft.oa.service.TenantService;
import com.gxwebsoft.oa.entity.Tenant;
import com.gxwebsoft.oa.param.TenantParam;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 租户Service实现
*
* @author WebSoft
* @since 2022-11-17 17:13:39
*/
@Service
public class TenantServiceImpl extends ServiceImpl<TenantMapper, Tenant> implements TenantService {
@Override
public PageResult<Tenant> pageRel(TenantParam param) {
PageParam<Tenant, TenantParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
List<Tenant> list = baseMapper.selectPageRel(page, param);
return new PageResult<>(list, page.getTotal());
}
@Override
public List<Tenant> listRel(TenantParam param) {
List<Tenant> list = baseMapper.selectListRel(param);
// 排序
PageParam<Tenant, TenantParam> page = new PageParam<>();
//page.setDefaultOrder("create_time desc");
return page.sortRecords(list);
}
@Override
public Integer getByUserId(Integer userId) {
Tenant tenant = query().eq("user_id", userId).one();
return tenant.getTenantId();
}
@Override
public Tenant getByIdRel(Integer tenantId) {
TenantParam param = new TenantParam();
param.setTenantId(tenantId);
return param.getOne(baseMapper.selectListRel(param));
}
}

View File

@@ -1,181 +0,0 @@
package com.gxwebsoft.open.controller;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.utils.CacheClient;
import com.gxwebsoft.common.core.utils.CommonUtil;
import com.gxwebsoft.common.core.utils.JSONUtil;
import com.gxwebsoft.common.core.web.*;
import com.gxwebsoft.common.system.entity.Dictionary;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.param.UserParam;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.oa.controller.TenantController;
import com.gxwebsoft.oa.entity.App;
import com.gxwebsoft.oa.entity.AppUser;
import com.gxwebsoft.oa.entity.Tenant;
import com.gxwebsoft.oa.param.AppParam;
import com.gxwebsoft.oa.param.AppUserParam;
import com.gxwebsoft.oa.service.AppService;
import com.gxwebsoft.oa.service.AppUserService;
import com.gxwebsoft.oa.service.TenantService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import static com.gxwebsoft.common.core.constants.RedisConstants.USER_RANKING_BY_APPS;
/**
* 应用控制器
*
* @author WebSoft
* @since 2022-11-18 13:55:29
*/
@Api(tags = "应用管理")
@RestController
@RequestMapping("/api/open/app")
public class OpenAppController extends BaseController {
@Resource
private AppService appService;
@Resource
private AppUserService appUserService;
@Resource
private CacheClient cacheClient;
@ApiOperation("分页查询应用")
@GetMapping("/page")
public ApiResult<PageResult<App>> page(AppParam param) {
// 验证签名
isCheckSign();
// 非管理员仅显示已加入成员管理的应用列表
User loginUser = getLoginUser();
if(!loginUser.getUsername().equals("admin")){
param.setUserId(getLoginUserId());
}
param.setTenantId(getTenantId());
// 使用关联查询
return success(appService.pageRel(param));
}
@ApiOperation("查询全部应用")
@GetMapping()
public ApiResult<List<App>> list(AppParam param) {
// 验证签名
isCheckSign();
param.setUserId(getLoginUserId());
param.setTenantId(getTenantId());
// 使用关联查询
return success(appService.listRel(param));
}
@ApiOperation("根据id查询应用")
@GetMapping("/{id}")
public ApiResult<App> get(@PathVariable("id") Integer id) {
// return success(appService.getById(id));
// 验证签名
isCheckSign();
App app = appService.getByIdRel(id);
// 查询开发成员列表
AppUserParam appUserParam = new AppUserParam();
appUserParam.setAppId(app.getAppId());
List<AppUser> appUsers = appUserService.listRel(appUserParam);
// List<User> list = userService.list(new LambdaQueryWrapper<User>().in(User::getUserId, appUsers.stream().map(AppUser::getUserId).collect(Collectors.toList())));
app.setUsers(appUsers);
return success(app);
}
@ApiOperation("创建应用")
@Transactional(rollbackFor = {Exception.class}, isolation = Isolation.SERIALIZABLE)
@PostMapping()
public ApiResult<?> save(@RequestBody App app) {
// 验证签名
isCheckSign();
if (app.getAppType() == null) {
return fail("应用类型不能为空");
}
// 创建应用
final Integer loginUserId = getLoginUserId();
final User loginUser = getLoginUser();
app.setUserId(loginUserId);
app.setStatus(0); // 需要审核1 不需要审核0
app.setAppSecret(IdUtil.fastSimpleUUID());
app.setTenantId(loginUser.getTenantId());
System.out.println("app = " + app);
if (appService.save(app)) {
// 添加应用成员
AppUser appUser = new AppUser();
appUser.setAppId(app.getAppId());
appUser.setRole(30);
appUser.setUserId(loginUserId);
appUser.setStatus(0);
appUserService.save(appUser);
// 更新缓存
String key = "AppSecret:".concat(app.getAppId().toString());
cacheClient.set(key,app.getAppSecret());
// 更新用户的插件数量到排行榜
int count = appService.count(new LambdaQueryWrapper<App>()
.eq(App::getUserId, loginUserId));
cacheClient.zAdd(USER_RANKING_BY_APPS, loginUserId,(double) count);
return success("创建成功");
}
return fail("创建失败");
}
@ApiOperation("修改应用")
@PutMapping()
public ApiResult<?> update(@RequestBody App app) {
// 验证签名
isCheckSign();
if (appService.updateById(app)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除应用")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
// 验证签名
isCheckSign();
if (appService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("查看秘钥")
@PostMapping("/getAppSecret")
public ApiResult<?> getAppSecret(@RequestBody App app) {
App result = appService.getByIdRel(app.getAppId());
String key = "AppSecret:".concat(app.getAppId().toString());
result.setAppSecret(cacheClient.get(key));
return success("操作成功",result);
}
@ApiOperation("重置秘钥")
@PostMapping("/updateAppSecret")
public ApiResult<?> updateAppSecret(@RequestBody App app) {
// 验证签名
isCheckSign();
if (app.getAppId() == null) {
return fail("请勿重复操作");
}
App result = appService.getByIdRel(app.getAppId());
String key = cacheClient.key("AppSecret", app.getAppId());
String appSecret = IdUtil.fastSimpleUUID();
cacheClient.set(key,appSecret);
result.setAppSecret(appSecret);
return success("重置成功",result);
}
}

View File

@@ -1,155 +0,0 @@
package com.gxwebsoft.open.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.exception.BusinessException;
import com.gxwebsoft.common.core.web.*;
import com.gxwebsoft.oa.entity.AppUser;
import com.gxwebsoft.oa.param.AppUserParam;
import com.gxwebsoft.oa.service.AppUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 应用成员控制器
*
* @author 科技小王子
* @since 2023-02-17 13:22:20
*/
@Api(tags = "应用成员管理")
@RestController
@RequestMapping("/api/open/app-user")
public class OpenAppUserController extends BaseController {
@Resource
private AppUserService appUserService;
@OperationLog
@ApiOperation("分页查询应用成员")
@GetMapping("/page")
public ApiResult<PageResult<AppUser>> page(AppUserParam param) {
// 验证签名
isCheckSign();
PageParam<AppUser, AppUserParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(appUserService.page(page, page.getWrapper()));
// 使用关联查询
//return success(appUserService.pageRel(param));
}
@OperationLog
@ApiOperation("查询全部应用成员")
@GetMapping()
public ApiResult<List<AppUser>> list(AppUserParam param) {
// 验证签名
isCheckSign();
PageParam<AppUser, AppUserParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(appUserService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(appUserService.listRel(param));
}
@ApiOperation("根据id查询应用成员")
@GetMapping("/{id}")
public ApiResult<AppUser> get(@PathVariable("id") Integer id) {
// 验证签名
isCheckSign();
return success(appUserService.getById(id));
// 使用关联查询
//return success(appUserService.getByIdRel(id));
}
@OperationLog
@ApiOperation("添加应用成员")
@PostMapping()
public ApiResult<?> save(@RequestBody AppUser appUser) {
// 验证签名
isCheckSign();
String username = appUser.getUsername();
Integer appId = appUser.getAppId();
Integer userIdByUsername = getUserIdByUsername(username,getTenantId());
// 判断重复
if(appUserService.count(new LambdaQueryWrapper<AppUser>().eq(AppUser::getUserId,userIdByUsername).eq(AppUser::getAppId,appId)) > 0){
throw new BusinessException("请勿重复添加");
}
// 是否超出限制
if(appUserService.count(new LambdaQueryWrapper<AppUser>().eq(AppUser::getAppId,appUser.getAppId())) > 50){
throw new BusinessException("最多只能添加50个");
}
appUser.setUserId(userIdByUsername);
appUser.setStatus(0);
if (appUserService.save(appUser)) {
return success("添加成功");
}
return fail("添加失败");
}
@OperationLog
@ApiOperation("修改应用成员")
@PutMapping()
public ApiResult<?> update(@RequestBody AppUser appUser) {
// 验证签名
isCheckSign();
if (appUserService.updateById(appUser)) {
return success("修改成功");
}
return fail("修改失败");
}
@OperationLog
@ApiOperation("删除应用成员")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
// 验证签名
isCheckSign();
AppUser appUser = appUserService.getById(id);
if(appUser.getRole().equals(30)){
return fail("管理员不能删除");
}
if (appUserService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@OperationLog
@ApiOperation("批量添加应用成员")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<AppUser> list) {
// 验证签名
isCheckSign();
if (appUserService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@OperationLog
@ApiOperation("批量修改应用成员")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<AppUser> batchParam) {
// 验证签名
isCheckSign();
if (batchParam.update(appUserService, "app_user_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@OperationLog
@ApiOperation("批量删除应用成员")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
// 验证签名
isCheckSign();
if (appUserService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -1,61 +0,0 @@
package com.gxwebsoft.open.controller;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.entity.Tenant;
import com.gxwebsoft.oa.param.TenantParam;
import com.gxwebsoft.oa.service.TenantService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* 应用管理
*
* @author 科技小王子
* @since 2022-11-25 19:04:43
*/
@Api(tags = "应用管理(已废弃)")
@RestController
@RequestMapping("/api/open/appstore")
public class OpenAppstoreController extends BaseController {
@Resource
private TenantService tenantService;
@ApiOperation("分页查询应用")
@GetMapping("/page")
public ApiResult<PageResult<Tenant>> page(TenantParam param) {
PageParam<Tenant, TenantParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
// 记录当前登录用户id、应用id
User user = getLoginUser();
if (user != null) {
param.setUserId(user.getUserId());
}
// 使用关联查询
return success(tenantService.pageRel(param));
}
@ApiOperation("查询全部应用")
@GetMapping()
public ApiResult<List<Tenant>> list(TenantParam param) {
PageParam<Tenant, TenantParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
// 记录当前登录用户id、应用id
User user = getLoginUser();
if (user != null) {
param.setUserId(user.getUserId());
}
// 使用关联查询
return success(tenantService.listRel(param));
}
}

View File

@@ -1,112 +0,0 @@
package com.gxwebsoft.open.controller;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONObject;
import com.gxwebsoft.common.core.utils.JSONUtil;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.Setting;
import com.gxwebsoft.common.system.service.SettingService;
import com.gxwebsoft.oa.entity.Notice;
import com.gxwebsoft.oa.param.NoticeParam;
import com.gxwebsoft.oa.service.NoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.gxwebsoft.oa.constants.NoticeConstants.CHAT_GPT;
/**
* ChatGPT控制器
*
* @author WebSoft
* @since 2018-12-24 16:10:24
*/
@Api(tags = "ChatGPT")
@RestController
@RequestMapping("/api/open/chat")
public class OpenChatGptController extends BaseController {
@Resource
private NoticeService noticeService;
@Resource
private SettingService settingService;
@ApiOperation("向chatGPT提问")
@PostMapping("/send")
public ApiResult<?> send(@RequestBody NoticeParam param) {
// 保存问题
final Integer loginUserId = getLoginUserId();
Notice notice = new Notice();
notice.setType(CHAT_GPT);
notice.setUserId(loginUserId);
notice.setChannel(0);
notice.setContent(param.getContent());
noticeService.save(notice);
// 保存回答
Notice answer = new Notice();
answer.setUserId(loginUserId);
answer.setType(CHAT_GPT);
answer.setChannel(1);
answer.setContent("|");
noticeService.save(answer);
// 查询消息并返回
param.setUserId(loginUserId);
return success(answer.getNoticeId());
}
@ApiOperation("chatGPT")
@PostMapping("/chat")
public ApiResult<?> chat(@RequestBody NoticeParam param) {
String endpoint = "https://api.openai.com/v1/chat/completions";
final Setting setting = settingService.getData("chatGPT");
final String content1 = setting.getContent();
final JSONObject jsonObject1 = JSONObject.parseObject(content1);
final String chatKey = jsonObject1.getString("chatKey");
String apiKey = "Bearer ".concat(chatKey);
System.out.println("apiKey = " + apiKey);
if(StrUtil.isEmpty(apiKey)){
return fail("请配置有效的KEY");
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("model", "gpt-3.5-turbo");
List<Map<String, String>> dataList = new ArrayList<>();
dataList.add(new HashMap<String, String>(){{
put("role", "user");
put("content", param.getContent());
}});
paramMap.put("messages", dataList);
// JSONObject message = null;
// 构建请求
String body = HttpRequest.post(endpoint)
.header("Authorization", apiKey)
.header("Content-Type", "application/json")
.body(JSONUtil.toJSONString(paramMap)).execute().body();
JSONObject jsonObject = JSONObject.parseObject(body);
// 内容解析(代币)
String usage = jsonObject.getString("usage");
JSONObject jsonUsage = JSONObject.parseObject(usage);
String total_tokens = jsonUsage.getString("total_tokens");
// 内容解析(消息内容)
JSONObject choices = jsonObject.getJSONArray("choices").getJSONObject(0);
String message = choices.getString("message");
JSONObject jsonMessage = JSONObject.parseObject(message);
String content = jsonMessage.getString("content");
// 保存回答
Notice notice = noticeService.getById(param.getNoticeId());
notice.setTokens(new Long(total_tokens));
notice.setContent(content);
noticeService.updateById(notice);
return success(content);
}
}

View File

@@ -1,918 +0,0 @@
package com.gxwebsoft.open.controller;
import cn.hutool.core.util.StrUtil;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.profile.DefaultProfile;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.gson.Gson;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.core.exception.BusinessException;
import com.gxwebsoft.common.core.security.JwtSubject;
import com.gxwebsoft.common.core.security.JwtUtil;
import com.gxwebsoft.common.core.utils.CacheClient;
import com.gxwebsoft.common.core.utils.CommonUtil;
import com.gxwebsoft.common.core.utils.JSONUtil;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.ExistenceParam;
import com.gxwebsoft.common.system.entity.*;
import com.gxwebsoft.common.system.mapper.UserMapper;
import com.gxwebsoft.common.system.param.LoginParam;
import com.gxwebsoft.common.system.param.SmsCaptchaParam;
import com.gxwebsoft.common.system.param.UpdatePasswordParam;
import com.gxwebsoft.common.system.result.CaptchaResult;
import com.gxwebsoft.common.system.result.LoginResult;
import com.gxwebsoft.common.system.service.*;
import com.gxwebsoft.oa.entity.App;
import com.gxwebsoft.oa.entity.Tenant;
import com.gxwebsoft.oa.mapper.TenantMapper;
import com.gxwebsoft.oa.service.AppService;
import com.gxwebsoft.oa.service.CustomerService;
import com.gxwebsoft.oa.service.TenantService;
import com.wf.captcha.SpecCaptcha;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;
/**
* 登录认证控制器
*
* @author WebSoft
* @since 2018-12-24 16:10:11
*/
@Api(tags = "登录认证")
@RestController
@RequestMapping("/api/open")
public class OpenMainController extends BaseController {
@Resource
private ConfigProperties configProperties;
@Resource
private UserService userService;
@Resource
private RoleMenuService roleMenuService;
@Resource
private LoginRecordService loginRecordService;
@Resource
private CacheClient cacheClient;
@Resource
private RoleService roleService;
@Resource
private UserRoleService userRoleService;
@Resource
private MenuService menuService;
@Resource
private CustomerService customerService;
@Resource
private EmailRecordService emailRecordService;
@Resource
private UserMapper userMapper;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private TenantMapper tenantMapper;
@Resource
private TenantService tenantService;
@Resource
private AppService appService;
@Resource
private DictService dictService;
@Resource
private DictDataService dictDataService;
@ApiOperation("用户登录")
@PostMapping("/login")
public ApiResult<LoginResult> login(@RequestBody LoginParam param, HttpServletRequest request) {
// 验证签名
isCheckSign();
String username = param.getUsername();
Integer tenantId = param.getTenantId();
// 手机号码登录
User userByPhone = userService.getByPhone(param.getUsername());
if (userByPhone != null) {
username = userByPhone.getUsername();
}
User user = userService.getByUsername(username, tenantId);
if (user == null) {
String message = "账号不存在";
loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request);
return fail(message, null);
}
if (!user.getStatus().equals(0)) {
String message = "账号被冻结";
loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request);
return fail(message, null);
}
if (!userService.comparePassword(user.getPassword(), param.getPassword())) {
String message = "密码错误";
loginRecordService.saveAsync(username, LoginRecord.TYPE_ERROR, message, tenantId, request);
return fail(message, null);
}
loginRecordService.saveAsync(username, LoginRecord.TYPE_LOGIN, null, tenantId, request);
// 签发token
String access_token = JwtUtil.buildToken(new JwtSubject(username, tenantId),
configProperties.getTokenExpireTime(), configProperties.getTokenKey());
return success("登录成功", new LoginResult(access_token, user));
}
@Transactional(rollbackFor = {Exception.class}, isolation = Isolation.SERIALIZABLE)
@ApiOperation("账号注册")
@PostMapping("/register")
public ApiResult<?> register(@RequestBody User user) {
// 验证签名
isCheckSign();
Integer userType = user.getType(); // 用户类型
String tenantName = user.getCompanyName(); // 客户名称
String phone = user.getPhone(); // 手机号码
String username = user.getUsername(); // 账号
String password = user.getPassword(); // 密码
String code = user.getCode(); // 短信验证码
String email = user.getEmail(); // 邮箱
// 短信验证
if (!StrUtil.equals(code,cacheClient.get(phone,String.class)) && !StrUtil.equals(code,"170083")) {
throw new BusinessException("验证码不正确");
}
user.setUsername(username);
user.setPhone(phone);
user.setRealName(tenantName);
user.setCompanyName(tenantName);
user.setStatus(0); // 设置状态
user.setPassword(userService.encodePassword(password)); // 密码加密
userService.saveUser(user);
// 用户类型:开发者
if(userType.equals(6)) {
// 发送邮件通知
String title = "恭喜!您的开发者账号已注册成功";
String content = "用户ID".concat(user.getUserId().toString()).concat(",账号:".concat(phone).concat(",密码:").concat(password));
sendEmail(title,content,email);
return success("注册成功");
}
// 用户类型:企业主
if (userType.equals(10)) {
if (tenantMapper.selectCount(new LambdaQueryWrapper<Tenant>()
.eq(Tenant::getTenantName, tenantName)) > 0) {
throw new BusinessException("该主体名称已存在");
}
// 添加租户
Tenant tenant = new Tenant();
tenant.setUserId(user.getUserId());
tenant.setTenantName(tenantName);
tenant.setTenantCode(CommonUtil.randomUUID16());
tenantService.save(tenant);
// 添加默认字典
Dict dict = new Dict();
dict.setDictName("性别");
dict.setDictCode("sex");
dict.setTenantId(tenant.getTenantId());
dictService.save(dict);
DictData dictData = new DictData();
dictData.setDictId(dict.getDictId());
dictData.setDictDataName("");
dictData.setDictDataCode("1");
dictData.setSortNumber(100);
dictData.setTenantId(tenant.getTenantId());
dictDataService.save(dictData);
dictData.setDictDataName("");
dictData.setDictDataCode("2");
dictData.setTenantId(tenant.getTenantId());
dictDataService.save(dictData);
dict.setDictName("机构类型");
dict.setDictCode("organizationType");
dict.setTenantId(tenant.getTenantId());
dictService.save(dict);
dictData.setDictId(dict.getDictId());
dictData.setDictDataName("公司");
dictData.setDictDataCode("1");
dictData.setTenantId(tenant.getTenantId());
dictDataService.save(dictData);
dictData.setDictId(dict.getDictId());
dictData.setDictDataName("部门");
dictData.setDictDataCode("2");
dictData.setTenantId(tenant.getTenantId());
dictDataService.save(dictData);
// 添加超级管理员
User admin = new User();
admin.setUsername("admin");
admin.setNickname("超级管理员");
admin.setPhone(phone);
admin.setEmail(email);
admin.setRealName(tenantName);
admin.setCompanyName(tenantName);
admin.setPassword(userService.encodePassword(password));
admin.setTenantId(tenant.getTenantId());
boolean result = userService.save(admin);
Integer superAdminUserId = admin.getUserId();
// 创建角色
if (result) {
Role role = new Role();
role.setRoleName("超级管理员");
role.setRoleCode("superAdmin");
role.setComments("超级管理员");
role.setTenantId(tenant.getTenantId());
roleService.save(role);
// 保存超级管理员角色ID
Integer superAdminRoleId = role.getRoleId();
role.setRoleName("注册用户");
role.setRoleCode("user");
role.setComments("普通注册用户");
roleService.save(role);
role.setRoleName("游客");
role.setRoleCode("guest");
role.setComments("用于未登录时的浏览权限");
roleService.save(role);
Integer guestRoleId = role.getRoleId();
// 添加游客账号
User www = new User();
www.setTenantId(tenant.getTenantId());
www.setUsername("www");
www.setNickname("游客");
www.setPassword(userService.encodePassword(CommonUtil.randomUUID16()));
userService.save(www);
// 添加超管用户角色
UserRole userRole = new UserRole();
userRole.setUserId(superAdminUserId);
userRole.setRoleId(superAdminRoleId);
userRole.setTenantId(tenant.getTenantId());
userRoleService.save(userRole);
// 添加游客用户角色
userRole.setUserId(www.getUserId());
userRole.setRoleId(guestRoleId);
boolean resultUserRole = userRoleService.save(userRole);
/// 添加系统菜单
if (resultUserRole) {
Menu menu = new Menu();
// 10.系统管理
menu.setTitle("系统管理");
menu.setParentId(0);
menu.setPath("/system");
menu.setIcon("setting-outlined");
menu.setSortNumber(10);
menu.setTenantId(tenant.getTenantId());
menuService.save(menu);
Integer parentId = menu.getMenuId();
menu.setParentId(menu.getMenuId());
menu.setTitle("用户管理");
menu.setPath("/system/user");
menu.setComponent("/system/user");
menu.setIcon("team-outlined");
menu.setSortNumber(2);
menuService.save(menu);
Integer userParentId = menu.getMenuId();
menu.setParentId(userParentId);
menu.setMenuType(1);
menu.setTitle("查询");
menu.setIcon("");
menu.setAuthority("sys:user:list");
menuService.save(menu);
menu.setParentId(userParentId);
menu.setTitle("添加");
menu.setAuthority("sys:user:save");
menuService.save(menu);
menu.setParentId(userParentId);
menu.setTitle("修改");
menu.setAuthority("sys:user:update");
menuService.save(menu);
menu.setParentId(userParentId);
menu.setTitle("删除");
menu.setAuthority("sys:user:remove");
menuService.save(menu);
menu.setMenuType(0);
menu.setParentId(parentId);
menu.setTitle("角色管理");
menu.setPath("/system/role");
menu.setComponent("/system/role");
menu.setIcon("idcard-outlined");
menu.setAuthority("");
menu.setSortNumber(3);
menuService.save(menu);
Integer roleParentId = menu.getMenuId();
menu.setParentId(roleParentId);
menu.setMenuType(1);
menu.setIcon("");
menu.setPath("");
menu.setComponent("");
menu.setTitle("查询");
menu.setAuthority("sys:role:list");
menuService.save(menu);
menu.setParentId(roleParentId);
menu.setTitle("添加");
menu.setAuthority("sys:role:save");
menuService.save(menu);
menu.setParentId(roleParentId);
menu.setTitle("修改");
menu.setAuthority("sys:role:update");
menuService.save(menu);
menu.setParentId(roleParentId);
menu.setTitle("删除");
menu.setAuthority("sys:role:remove");
menuService.save(menu);
menu.setMenuType(0);
menu.setParentId(parentId);
menu.setTitle("菜单管理");
menu.setPath("/system/menu");
menu.setComponent("/system/menu");
menu.setIcon("appstore-outlined");
menu.setAuthority("");
menu.setSortNumber(1);
menuService.save(menu);
Integer menuParentId = menu.getMenuId();
menu.setParentId(menuParentId);
menu.setMenuType(1);
menu.setTitle("查询");
menu.setAuthority("sys:menu:list");
menu.setIcon("");
menu.setPath("");
menu.setComponent("");
menuService.save(menu);
menu.setParentId(menuParentId);
menu.setTitle("添加");
menu.setAuthority("sys:menu:save");
menuService.save(menu);
menu.setParentId(menuParentId);
menu.setTitle("修改");
menu.setAuthority("sys:menu:update");
menuService.save(menu);
menu.setParentId(menuParentId);
menu.setTitle("删除");
menu.setAuthority("sys:menu:remove");
menuService.save(menu);
menu.setMenuType(0);
menu.setParentId(parentId);
menu.setTitle("机构管理");
menu.setPath("/system/organization");
menu.setComponent("/system/organization");
menu.setIcon("bank-outlined");
menu.setAuthority("");
menu.setSortNumber(5);
menuService.save(menu);
Integer orgParentId = menu.getMenuId();
menu.setParentId(orgParentId);
menu.setMenuType(1);
menu.setPath("");
menu.setComponent("");
menu.setIcon("");
menu.setTitle("查询");
menu.setAuthority("sys:org:list");
menuService.save(menu);
menu.setParentId(orgParentId);
menu.setTitle("添加");
menu.setAuthority("sys:org:save");
menuService.save(menu);
menu.setParentId(orgParentId);
menu.setTitle("修改");
menu.setAuthority("sys:org:update");
menuService.save(menu);
menu.setParentId(orgParentId);
menu.setTitle("删除");
menu.setAuthority("sys:org:remove");
menuService.save(menu);
menu.setMenuType(0);
menu.setParentId(parentId);
menu.setTitle("字典管理");
menu.setPath("/system/dict");
menu.setComponent("/system/dict");
menu.setIcon("profile-outlined");
menu.setAuthority("");
menu.setSortNumber(4);
menuService.save(menu);
Integer dictParentId = menu.getMenuId();
menu.setParentId(dictParentId);
menu.setMenuType(1);
menu.setTitle("查询");
menu.setAuthority("sys:dict:list");
menu.setIcon("");
menu.setPath("");
menu.setComponent("");
menuService.save(menu);
menu.setParentId(dictParentId);
menu.setTitle("添加");
menu.setAuthority("sys:dict:save");
menuService.save(menu);
menu.setParentId(dictParentId);
menu.setTitle("修改");
menu.setAuthority("sys:dict:update");
menuService.save(menu);
menu.setParentId(dictParentId);
menu.setTitle("删除");
menu.setAuthority("sys:dict:remove");
menuService.save(menu);
menu.setMenuType(0);
menu.setParentId(parentId);
menu.setTitle("登录日志");
menu.setPath("/system/login-record");
menu.setComponent("/system/login-record");
menu.setIcon("calendar-outlined");
menu.setAuthority("sys:login-record:list");
menu.setSortNumber(7);
menuService.save(menu);
menu.setParentId(parentId);
menu.setTitle("操作日志");
menu.setPath("/system/operation-record");
menu.setComponent("/system/operation-record");
menu.setIcon("file-search-outlined");
menu.setAuthority("sys:operation-record:list");
menu.setSortNumber(8);
menuService.save(menu);
menu.setParentId(parentId);
menu.setTitle("文件管理");
menu.setPath("/system/file");
menu.setComponent("/system/file");
menu.setIcon("folder-outlined");
menu.setAuthority("");
menu.setSortNumber(6);
menuService.save(menu);
Integer fileParentId = menu.getMenuId();
menu.setParentId(fileParentId);
menu.setMenuType(1);
menu.setTitle("查看记录");
menu.setPath("");
menu.setComponent("");
menu.setIcon("");
menu.setAuthority("sys:file:list");
menuService.save(menu);
menu.setParentId(fileParentId);
menu.setTitle("上传文件");
menu.setAuthority("sys:file:upload");
menuService.save(menu);
menu.setParentId(fileParentId);
menu.setTitle("修改文件");
menu.setAuthority("sys:file:update");
menuService.save(menu);
menu.setParentId(fileParentId);
menu.setTitle("删除文件");
menu.setAuthority("sys:org:remove");
menuService.save(menu);
menu.setMenuType(0);
menu.setParentId(parentId);
menu.setTitle("系统设置");
menu.setPath("/system/setting");
menu.setComponent("/system/setting");
menu.setIcon("setting-outlined");
menu.setAuthority("sys:setting:save");
menu.setSortNumber(10);
menuService.save(menu);
menu.setParentId(parentId);
menu.setTitle("用户信息");
menu.setPath("/system/user-info");
menu.setComponent("/system/user-info");
menu.setIcon("team-outlined");
menu.setAuthority("");
menu.setHide(1);
menu.setMenuType(0);
menu.setSortNumber(9);
menuService.save(menu);
Integer userInfoParentId = menu.getMenuId();
menu.setParentId(userInfoParentId);
menu.setMenuType(1);
menu.setTitle("修改个人密码");
menu.setAuthority("sys:auth:password");
menu.setIcon("");
menu.setPath("");
menu.setComponent("");
menuService.save(menu);
menu.setParentId(userInfoParentId);
menu.setTitle("修改个人资料");
menu.setAuthority("sys:auth:user");
menuService.save(menu);
// 1.控制台
menu.setParentId(0);
menu.setTitle("控制台");
menu.setPath("/dashboard");
menu.setIcon("home-outlined");
menu.setComponent("");
menu.setAuthority("");
menu.setSortNumber(1);
menu.setHide(0);
menu.setMenuType(0);
menuService.save(menu);
Integer dashboardParentId = menu.getMenuId();
menu.setTitle("工作台");
menu.setPath("/dashboard/workplace");
menu.setComponent("/dashboard/workplace");
menu.setIcon("DesktopOutlined");
menu.setParentId(dashboardParentId);
menu.setMenuType(0);
menu.setHide(0);
menu.setSortNumber(0);
menuService.save(menu);
menu.setTitle("统计分析");
menu.setPath("/dashboard/analysis");
menu.setComponent("/dashboard/analysis");
menu.setIcon("BarChartOutlined");
menu.setParentId(dashboardParentId);
menu.setMenuType(0);
menu.setHide(0);
menu.setSortNumber(1);
menuService.save(menu);
// 2.办公协同
// 7.内容管理
menu.setParentId(0);
menu.setTitle("内容管理");
menu.setPath("/cms");
menu.setComponent("");
menu.setAuthority("");
menu.setIcon("FileSearchOutlined");
menu.setHide(0);
menu.setMenuType(0);
menu.setSortNumber(7);
menuService.save(menu);
Integer contentParentId = menu.getMenuId();
menu.setTitle("文章管理");
menu.setPath("/cms/article");
menu.setComponent("/cms/article");
menu.setIcon("FileSearchOutlined");
menu.setAuthority("");
menu.setSortNumber(1);
menu.setMenuType(0);
menu.setParentId(contentParentId);
menuService.save(menu);
Integer articleParentId = menu.getMenuId();
menu.setParentId(articleParentId);
menu.setMenuType(1);
menu.setIcon("");
menu.setPath("");
menu.setComponent("");
menu.setTitle("查询");
menu.setSortNumber(0);
menu.setAuthority("cms:article:list");
menuService.save(menu);
menu.setTitle("添加");
menu.setAuthority("cms:article:save");
menuService.save(menu);
menu.setTitle("修改");
menu.setAuthority("cms:article:update");
menuService.save(menu);
menu.setTitle("删除");
menu.setAuthority("cms:article:remove");
menuService.save(menu);
menu.setTitle("文章分类");
menu.setPath("/cms/category");
menu.setComponent("/cms/category");
menu.setIcon("ApartmentOutlined");
menu.setAuthority("");
menu.setMenuType(0);
menu.setSortNumber(2);
menu.setParentId(contentParentId);
menuService.save(menu);
Integer categoryParentId = menu.getMenuId();
menu.setParentId(categoryParentId);
menu.setMenuType(1);
menu.setIcon("");
menu.setPath("");
menu.setComponent("");
menu.setSortNumber(0);
menu.setTitle("查询");
menu.setAuthority("cms:articleCategory:list");
menuService.save(menu);
menu.setTitle("添加");
menu.setAuthority("cms:articleCategory:save");
menuService.save(menu);
menu.setTitle("修改");
menu.setAuthority("cms:articleCategory:update");
menuService.save(menu);
menu.setTitle("删除");
menu.setAuthority("cms:articleCategory:remove");
menuService.save(menu);
menu.setTitle("文档管理");
menu.setPath("/cms/docs/:id");
menu.setComponent("/cms/docs");
menu.setIcon("ReadOutlined");
menu.setAuthority("");
menu.setSortNumber(3);
menu.setMenuType(0);
menu.setParentId(contentParentId);
menuService.save(menu);
Integer docsParentId = menu.getMenuId();
menu.setParentId(docsParentId);
menu.setMenuType(1);
menu.setIcon("");
menu.setPath("");
menu.setComponent("");
menu.setSortNumber(0);
menu.setTitle("查询");
menu.setAuthority("cms:docs:list");
menuService.save(menu);
menu.setTitle("添加");
menu.setAuthority("cms:docs:save");
menuService.save(menu);
menu.setTitle("修改");
menu.setAuthority("cms:docs:update");
menuService.save(menu);
menu.setTitle("删除");
menu.setAuthority("cms:docs:remove");
menuService.save(menu);
// 9.应用中心
// menu.setParentId(0);
// menu.setTitle("应用中心");
// menu.setPath("https://www.gxwebsoft.com/market");
// menu.setIcon("AppstoreAddOutlined");
// menu.setComponent("");
// menu.setAuthority("");
// menu.setSortNumber(11);
// menu.setMenuType(0);
// menuService.save(menu);
// 个人中心
menu.setParentId(0);
menu.setTitle("个人中心");
menu.setPath("/user-center");
menu.setIcon("UserOutlined");
menu.setComponent("");
menu.setAuthority("");
menu.setMenuType(0);
menu.setHide(0);
menu.setSortNumber(99);
menuService.save(menu);
Integer userCenterParentId = menu.getMenuId();
menu.setTitle("个人资料");
menu.setPath("/user/profile");
menu.setComponent("/user/profile");
menu.setIcon("IdcardOutlined");
menu.setParentId(userCenterParentId);
menu.setMenuType(0);
menu.setSortNumber(0);
menuService.save(menu);
Integer userProfileParentId = menu.getMenuId();
menu.setParentId(userProfileParentId);
menu.setMenuType(1);
menu.setIcon("");
menu.setPath("");
menu.setComponent("");
menu.setTitle("修改资料");
menu.setSortNumber(0);
menu.setAuthority("sys:auth:user");
menuService.save(menu);
menu.setTitle("修改密码");
menu.setAuthority("sys:auth:password");
menuService.save(menu);
menu.setTitle("上传头像");
menu.setAuthority("sys:file:upload");
menuService.save(menu);
menu.setTitle("预览头像");
menu.setAuthority("sys:file:list");
menuService.save(menu);
menu.setTitle("保存头像");
menu.setAuthority("sys:user:update");
menuService.save(menu);
menu.setTitle("我的消息");
menu.setPath("/user/notice");
menu.setComponent("/user/notice");
menu.setIcon("sound-outlined");
menu.setParentId(userCenterParentId);
menu.setMenuType(0);
menuService.save(menu);
Integer userNoticeParentId = menu.getMenuId();
menu.setParentId(userNoticeParentId);
menu.setTitle("列表");
menu.setAuthority("oa:notice:list");
menu.setSortNumber(0);
menu.setMenuType(1);
menu.setIcon("");
menu.setPath("");
menu.setComponent("");
menuService.save(menu);
menu.setTitle("添加");
menu.setAuthority("oa:notice:save");
menuService.save(menu);
menu.setTitle("编辑");
menu.setAuthority("oa:notice:update");
menuService.save(menu);
menu.setTitle("删除");
menu.setAuthority("oa:notice:remove");
menuService.save(menu);
menu.setParentId(userCenterParentId);
menu.setTitle("用户注册");
menu.setAuthority("sys:user:save");
menuService.save(menu);
menu.setTitle("字典查询");
menu.setAuthority("sys:dict:list");
boolean resultMenu = menuService.save(menu);
// 添加菜单ID到超级管理员所属角色ID
if (resultMenu) {
saveRedis(tenant);
}
}
}
// 发送邮件通知
String title = "恭喜!您的企业账号已注册成功";
String content = "企业名称:".concat(tenantName) + "\r\n企业ID".concat(tenant.getTenantId().toString()).concat("\r\n管理员账号密码").concat("admin/").concat(password);
String adminUrl = "\r\n后台管理地址".concat("https://admin.gxwebsoft.com");
// String developer = "\r\n开发者账号".concat(phone).concat("\r\n密码".concat(password));
sendEmail(title,content.concat(adminUrl),email);
return success("创建成功");
}
return fail("注册失败");
}
private void sendEmail(String title, String content, String receiver) {
// 发送邮件通知
EmailRecord emailRecord = new EmailRecord();
emailRecord.setTitle(title);
emailRecord.setContent(content);
emailRecord.setReceiver(receiver);
emailRecord.setCreateUserId(42);
emailRecordService.sendTextEmail(title,content,receiver.split(","));
emailRecordService.save(emailRecord);
}
@ApiOperation("检查用户是否存在")
@GetMapping("/existence")
public ApiResult<?> existence(ExistenceParam<User> param) {
if (param.isExistence(userService, User::getUserId)) {
return success("已存在", param.getValue());
}
return fail("不存在");
}
@ApiOperation("获取应用信息")
@GetMapping("/appInfo")
public ApiResult<App> appInfo() {
// 验证签名
isCheckSign();
App appInfo = appService.getById(getAppId());
User user = userService.getByUsername("www", 10052);
System.out.println("user = " + user);
return success(appInfo);
}
@ApiOperation("获取登录用户信息")
@GetMapping("/auth/user")
public ApiResult<User> userInfo() {
// 验证签名
isCheckSign();
return success(userService.getByIdRel(getLoginUserId()));
}
@ApiOperation("获取登录用户菜单")
@GetMapping("/auth/menu")
public ApiResult<List<Menu>> userMenu() {
// 验证签名
isCheckSign();
List<Menu> menus = roleMenuService.listMenuByUserId(getLoginUserId(), Menu.TYPE_MENU);
return success(CommonUtil.toTreeData(menus, 0, Menu::getParentId, Menu::getMenuId, Menu::setChildren));
}
@PreAuthorize("hasAuthority('sys:auth:user')")
@OperationLog
@ApiOperation("修改个人信息")
@PutMapping("/auth/user")
public ApiResult<User> updateInfo(@RequestBody User user) {
// 验证签名
isCheckSign();
user.setUserId(getLoginUserId());
// 不能修改的字段
user.setUsername(null);
user.setPassword(null);
user.setEmailVerified(null);
user.setOrganizationId(null);
user.setStatus(null);
if (userService.updateById(user)) {
return success(userService.getByIdRel(user.getUserId()));
}
return fail("保存失败", null);
}
@PreAuthorize("hasAuthority('sys:auth:password')")
@OperationLog
@ApiOperation("修改自己密码")
@PutMapping("/auth/password")
public ApiResult<?> updatePassword(@RequestBody UpdatePasswordParam param) {
// 验证签名
isCheckSign();
if (StrUtil.hasBlank(param.getOldPassword(), param.getPassword())) {
return fail("参数不能为空");
}
Integer userId = getLoginUserId();
if (userId == null) {
return fail("未登录");
}
if (!userService.comparePassword(userService.getById(userId).getPassword(), param.getOldPassword())) {
return fail("原密码输入不正确");
}
User user = new User();
user.setUserId(userId);
user.setPassword(userService.encodePassword(param.getPassword()));
if (userService.updateById(user)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("图形验证码")
@GetMapping("/captcha")
public ApiResult<CaptchaResult> captcha() {
SpecCaptcha specCaptcha = new SpecCaptcha(130, 48, 5);
// 验证签名
isCheckSign();
return success(new CaptchaResult(specCaptcha.toBase64(), specCaptcha.text().toLowerCase()));
}
@ApiOperation("短信验证码")
@PostMapping("/sendSmsCaptcha")
public ApiResult<?> sendSmsCaptcha(@RequestBody SmsCaptchaParam param) {
// 验证签名
isCheckSign();
DefaultProfile profile = DefaultProfile.getProfile("regionld", "LTAI5tBWM9dSmEAoQFhNqxqJ", "Dr0BqiKl7eaL1NNKoCd12qKsbgjnum");
IAcsClient client = new DefaultAcsClient(profile);
CommonRequest request = new CommonRequest();
request.setSysMethod(MethodType.POST);
request.setSysDomain("dysmsapi.aliyuncs.com");
request.setSysVersion("2017-05-25");
request.setSysAction("SendSms");
request.putQueryParameter("RegionId", "cn-hangzhou");
request.putQueryParameter("PhoneNumbers", param.getPhone());
request.putQueryParameter("SignName", "南宁网宿科技");
request.putQueryParameter("TemplateCode", "SMS_257840118");
// 生成短信验证码
Random randObj = new Random();
String code = Integer.toString(100000 + randObj.nextInt(900000));
request.putQueryParameter("TemplateParam", "{\"code\":" + code + "}");
try {
CommonResponse response = client.getCommonResponse(request);
String json = response.getData();
Gson g = new Gson();
HashMap result = g.fromJson(json, HashMap.class);
if("OK".equals(result.get("Message"))) {
cacheClient.set(param.getPhone(),code,5L,TimeUnit.MINUTES);
return success("发送成功",result.get("Message"));
}else{
return fail("发送失败");
}
} catch (ServerException e) {
e.printStackTrace();
} catch (ClientException e) {
e.printStackTrace();
}
return fail("发送失败");
}
@OperationLog
@ApiOperation("重置密码")
@PutMapping("/password")
public ApiResult<?> resetPassword(@RequestBody User user) {
// 验证签名
isCheckSign();
if (user.getPassword() == null) {
return fail("参数不正确");
}
if (user.getCode() == null) {
return fail("验证码不能为空");
}
// 短信验证码校验
String code = cacheClient.get(user.getPhone(), String.class);
if (!StrUtil.equals(code,user.getCode())) {
return fail("验证码不正确");
}
user.setUserId(getLoginUserId());
user.setPassword(userService.encodePassword(user.getPassword()));
if (userService.updateById(user)) {
return success("密码修改成功");
} else {
return fail("密码修改失败");
}
}
// 缓存租户信息
private void saveRedis(Tenant tenant) {
String key = "cache:tenant";
String tenantId = tenant.getTenantId().toString();
if (StrUtil.isEmpty(tenant.getTenantCode())) {
tenant.setTenantCode(CommonUtil.randomUUID16());
}
String data = JSONUtil.toJSONString(tenant);
stringRedisTemplate.opsForHash().put(key,tenantId, data);
}
}

View File

@@ -1,125 +0,0 @@
package com.gxwebsoft.open.controller;
import cn.hutool.core.util.StrUtil;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.utils.CacheClient;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.param.UserParam;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.oa.entity.App;
import com.gxwebsoft.oa.param.AppParam;
import com.gxwebsoft.oa.service.AppService;
import com.gxwebsoft.oa.service.TenantService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import static com.gxwebsoft.common.core.constants.RedisConstants.*;
/**
* 应用控制器
*
* @author WebSoft
* @since 2022-11-18 13:55:29
*/
@Api(tags = "应用市场")
@RestController
@RequestMapping("/api/open/market")
public class OpenMarketController extends BaseController {
@Resource
private AppService appService;
@Resource
private UserService userService;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private TenantService tenantService;
@Resource
private CacheClient cacheClient;
@ApiOperation("分页查询应用")
@GetMapping("/page")
public ApiResult<PageResult<App>> page(AppParam param) {
// 验证签名
// isCheckSign();
// PageParam<App, AppParam> page = new PageParam<>(param);
// page.setDefaultOrder("create_time desc");
// return success(appService.page(page, page.getWrapper()));
// 使用关联查询
param.setSearch(1);
return success(appService.pageRel(param));
}
@ApiOperation("查询全部应用")
@GetMapping()
public ApiResult<List<App>> list(AppParam param) {
// 验证签名
isCheckSign();
// PageParam<App, AppParam> page = new PageParam<>(param);
// page.setDefaultOrder("create_time desc");
// return success(appService.list(page.getOrderWrapper()));
// 使用关联查询
param.setSearch(1);
return success(appService.listRel(param));
}
@ApiOperation("根据id查询应用")
@GetMapping("/{id}")
public ApiResult<App> get(@PathVariable("id") Integer id) {
// return success(appService.getById(id));
// 验证签名
isCheckSign();
return success(appService.getByIdRel(id));
}
@OperationLog
@ApiOperation("排行榜")
@GetMapping("/ranking")
public ApiResult<?> ranking(UserParam param) {
// 使用关联查询
Set<String> reverseRange = cacheClient.reverseRange(USER_RANKING_BY_APPS, 0, 2);
List<User> list = new ArrayList<>(reverseRange.size());
if(reverseRange.size() == 0) {
userService.listRanking(param);
}
reverseRange.forEach(v -> {
Double score = cacheClient.score(USER_RANKING_BY_APPS, v);
User user = userService.getById(v);
user.setApps(score);
list.add(user);
});
return success("操作成功",list);
}
@ApiOperation("搜索历史")
@GetMapping("/search-history")
public ApiResult<?> searchHistory(String keyword, Long number) {
// 验证签名
isCheckSign();
String key = cacheClient.key(SEARCH_HISTORY,getLoginUserId());
if(StrUtil.isNotBlank(keyword)){
cacheClient.leftPush(key,keyword);
}
// 超出100裁剪
Long size = cacheClient.listSize(key);
if (number == null) {
number = 9L;
}
return success("操作成功",cacheClient.listRange(key,0L,number));
}
}

View File

@@ -1,133 +0,0 @@
package com.gxwebsoft.open.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.entity.Notice;
import com.gxwebsoft.oa.param.NoticeParam;
import com.gxwebsoft.oa.service.NoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 消息记录表控制器
*
* @author 科技小王子
* @since 2023-03-22 14:07:26
*/
@Api(tags = "消息记录表管理")
@RestController
@RequestMapping("/api/open/notice")
public class OpenNoticeController extends BaseController {
@Resource
private NoticeService noticeService;
@ApiOperation("分页查询消息记录表")
@GetMapping("/page")
public ApiResult<PageResult<Notice>> page(NoticeParam param) {
// 验证签名
// isCheckSign();
// 使用关联查询
param.setUserId(getLoginUserId());
return success(noticeService.pageRel(param));
}
@ApiOperation("查询全部消息记录表")
@GetMapping()
public ApiResult<List<Notice>> list(NoticeParam param) {
// 验证签名
// isCheckSign();
// 使用关联查询
param.setUserId(getLoginUserId());
return success(noticeService.listRel(param));
}
@ApiOperation("根据id查询消息记录表")
@GetMapping("/{id}")
public ApiResult<Notice> get(@PathVariable("id") Integer id) {
// 验证签名
// isCheckSign();
return success(noticeService.getById(id));
// 使用关联查询
//return success(noticeService.getByIdRel(id));
}
@ApiOperation("添加消息记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Notice notice) {
// 验证签名
// isCheckSign();
// 记录当前登录用户id、租户id、商户编号
User loginUser = getLoginUser();
if (loginUser != null) {
notice.setUserId(loginUser.getUserId());
}
if (noticeService.save(notice)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改消息记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Notice notice) {
// 验证签名
// isCheckSign();
if (noticeService.updateById(notice)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除消息记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (noticeService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加消息记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Notice> list) {
// 验证签名
// isCheckSign();
if (noticeService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改消息记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Notice> batchParam) {
// 验证签名
// isCheckSign();
if (batchParam.update(noticeService, "notice_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除消息记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
// 验证签名
// isCheckSign();
if (noticeService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -1,190 +0,0 @@
package com.gxwebsoft.open.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.web.*;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.oa.entity.Task;
import com.gxwebsoft.oa.entity.TaskRecord;
import com.gxwebsoft.oa.entity.TaskUser;
import com.gxwebsoft.oa.param.TaskParam;
import com.gxwebsoft.oa.service.AppService;
import com.gxwebsoft.oa.service.TaskRecordService;
import com.gxwebsoft.oa.service.TaskService;
import com.gxwebsoft.oa.service.TaskUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 工单记录表控制器
*
* @author WebSoft
* @since 2022-11-16 11:21:43
*/
@Api(tags = "工单记录表管理")
@RestController
@RequestMapping("/api/open/oa/task")
public class OpenTaskController extends BaseController {
@Resource
private TaskService taskService;
@Resource
private TaskRecordService taskRecordService;
@Resource
private TaskUserService taskUserService;
@Resource
private AppService appService;
@ApiOperation("分页查询工单记录表")
@GetMapping("/page")
public ApiResult<PageResult<Task>> page(TaskParam param) {
// 验证签名
isCheckSign();
// 使用关联查询
final User loginUser = getLoginUser();
final Integer type = loginUser.getType();
// 如果是开发者账号则按受理人查询
if (type.equals(6)) {
param.setCommander(loginUser.getUserId());
}else{
param.setPromoter(getLoginUserId());
}
return success(taskService.pageRel(param));
}
@ApiOperation("查询全部工单记录表")
@GetMapping()
public ApiResult<List<Task>> list(TaskParam param) {
// 验证签名
isCheckSign();
PageParam<Task, TaskParam> page = new PageParam<>(param);
page.setDefaultOrder("create_time desc");
return success(taskService.list(page.getOrderWrapper()));
// 使用关联查询
//return success(taskService.listRel(param));
}
@PreAuthorize("hasAuthority('oa:task:list')")
@OperationLog
@ApiOperation("根据id查询工单记录表")
@GetMapping("/{id}")
public ApiResult<Task> get(@PathVariable("id") Integer id) {
// 验证签名
isCheckSign();
// 使用关联查询
Task task = taskService.getByIdRel(id);
task.setAppInfo(appService.getById(task.getAppId()));
return success(task);
}
@ApiOperation("添加工单记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody Task task) {
// 验证签名
isCheckSign();
// 当前登录用户id
Integer loginUserId = getLoginUserId();
task.setUserId(loginUserId);
task.setPromoter(loginUserId);
task.setComments(StrUtil.sub(task.getContent(),0,200));
task.setLastReadUser(loginUserId);
// 创建工单
if (taskService.save(task)) {
// 添加聊天内容明细
TaskRecord taskRecord = new TaskRecord();
taskRecord.setUserId(loginUserId);
taskRecord.setContent(task.getContent());
taskRecord.setTaskId(task.getTaskId());
taskRecord.setFiles(task.getFiles());
taskRecordService.save(taskRecord);
// 添加工单成员
TaskUser taskUser = new TaskUser();
taskUser.setUserId(loginUserId);
taskUser.setTaskId(task.getTaskId());
taskUserService.save(taskUser);
return success("创建成功");
}
return fail("创建失败");
}
@ApiOperation("修改工单记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody Task task) {
// 验证签名
isCheckSign();
if (taskService.updateById(task)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除工单记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
// 验证签名
isCheckSign();
if (taskService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加工单记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Task> list) {
// 验证签名
isCheckSign();
if (taskService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改工单记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Task> batchParam) {
// 验证签名
isCheckSign();
if (batchParam.update(taskService, "task_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除工单记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
// 验证签名
isCheckSign();
if (taskService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("统计信息")
@GetMapping("/count")
public ApiResult<?> count(){
// 验证签名
isCheckSign();
User loginUser = getLoginUser();
ArrayList<Object> countNum = taskService.getCountNum(loginUser,null);
return success("操作成功",countNum);
}
// 查询用户的工单ID
private List<Integer> getTaskIds(){
final Integer loginUserId = getLoginUserId();
return taskUserService.list(new LambdaQueryWrapper<TaskUser>().eq(TaskUser::getUserId, loginUserId))
.stream().map(TaskUser::getTaskId).collect(Collectors.toList());
}
}

View File

@@ -1,148 +0,0 @@
package com.gxwebsoft.open.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.oa.entity.Task;
import com.gxwebsoft.oa.entity.TaskRecord;
import com.gxwebsoft.oa.param.TaskRecordParam;
import com.gxwebsoft.oa.service.TaskRecordService;
import com.gxwebsoft.oa.service.TaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import static com.gxwebsoft.oa.constants.TaskConstants.PROGRESS2;
import static com.gxwebsoft.oa.constants.TaskConstants.PROGRESS3;
/**
* 工单回复记录表控制器
*
* @author 科技小王子
* @since 2023-03-05 00:52:21
*/
@Api(tags = "工单回复记录表管理")
@RestController
@RequestMapping("/api/open/oa/task-record")
public class OpenTaskRecordController extends BaseController {
@Resource
private TaskService taskService;
@Resource
private TaskRecordService taskRecordService;
@ApiOperation("分页查询工单回复记录表")
@GetMapping("/page")
public ApiResult<PageResult<TaskRecord>> page(TaskRecordParam param) {
// 验证签名
isCheckSign();
// 使用关联查询
return success(taskRecordService.pageRel(param));
}
@ApiOperation("查询全部工单回复记录表")
@GetMapping()
public ApiResult<List<TaskRecord>> list(TaskRecordParam param) {
// 验证签名
isCheckSign();
// 更新查阅状态
Task task = taskService.getById(param.getTaskId());
if(!getLoginUserId().equals(task.getLastReadUser())){
task.setIsRead(1);
}
taskService.updateById(task);
// 使用关联查询
return success(taskRecordService.listRel(param));
}
@ApiOperation("根据id查询工单回复记录表")
@GetMapping("/{id}")
public ApiResult<TaskRecord> get(@PathVariable("id") Integer id) {
// 验证签名
isCheckSign();
// 使用关联查询
return success(taskRecordService.getByIdRel(id));
}
@ApiOperation("添加工单回复记录表")
@PostMapping()
public ApiResult<?> save(@RequestBody TaskRecord taskRecord) {
// 验证签名
isCheckSign();
taskRecord.setUserId(getLoginUserId());
int count = taskRecordService.count(new LambdaQueryWrapper<TaskRecord>().eq(TaskRecord::getTaskId,taskRecord.getTaskId()));
if(count > 100){
return fail("回复数超过最大限制");
}
if (taskRecordService.save(taskRecord)) {
// 变更工单状态
Task task = taskService.getById(taskRecord.getTaskId());
task.setProgress(PROGRESS2);
task.setIsRead(0);
task.setLastReadUser(getLoginUserId());
taskService.updateById(task);
return success("提交成功");
}
return fail("提交失败");
}
@ApiOperation("修改工单回复记录表")
@PutMapping()
public ApiResult<?> update(@RequestBody TaskRecord taskRecord) {
// 验证签名
isCheckSign();
if (taskRecordService.updateById(taskRecord)) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("删除工单回复记录表")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
// 验证签名
isCheckSign();
if (taskRecordService.removeById(id)) {
return success("删除成功");
}
return fail("删除失败");
}
@ApiOperation("批量添加工单回复记录表")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<TaskRecord> list) {
// 验证签名
isCheckSign();
if (taskRecordService.saveBatch(list)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("批量修改工单回复记录表")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<TaskRecord> batchParam) {
// 验证签名
isCheckSign();
if (batchParam.update(taskRecordService, "task_record_id")) {
return success("修改成功");
}
return fail("修改失败");
}
@ApiOperation("批量删除工单回复记录表")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
// 验证签名
isCheckSign();
if (taskRecordService.removeByIds(ids)) {
return success("删除成功");
}
return fail("删除失败");
}
}

View File

@@ -1,166 +0,0 @@
package com.gxwebsoft.open.controller;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.core.exception.BusinessException;
import com.gxwebsoft.common.core.security.JwtSubject;
import com.gxwebsoft.common.core.security.JwtUtil;
import com.gxwebsoft.common.core.utils.CacheClient;
import com.gxwebsoft.common.core.utils.CommonUtil;
import com.gxwebsoft.common.core.utils.WxOfficialUtil;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.LoginRecord;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.param.UserParam;
import com.gxwebsoft.common.system.service.LoginRecordService;
import com.gxwebsoft.common.system.service.SettingService;
import com.gxwebsoft.common.system.service.UserService;
import com.gxwebsoft.oa.service.NoticeService;
import com.gxwebsoft.shop.entity.UserOauth;
import com.gxwebsoft.shop.param.UserOauthParam;
import com.gxwebsoft.shop.service.UserOauthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.concurrent.TimeUnit;
import static com.gxwebsoft.common.core.utils.CommonUtil.randomUsername;
/**
* 微信公众号接口
*
* @author WebSoft
* @since 2022-11-19 13:54:27
*/
@Api(tags = "微信公众号授权登录")
@RestController
@RequestMapping("/api/open/wx-official")
public class OpenWxOfficialController extends BaseController {
@Resource
private ConfigProperties configProperties;
@Resource
private WxOfficialUtil wxOfficialUtil;
@Resource
private UserService userService;
@Resource
private UserOauthService userOauthService;
@Resource
private LoginRecordService loginRecordService;
@Resource
private SettingService settingService;
public OpenWxOfficialController() {
}
@OperationLog
@ApiOperation("第一步用户同意授权获取code")
@GetMapping("/code")
public ApiResult<?> code() throws UnsupportedEncodingException {
WxOfficialUtil client = wxOfficialUtil.client(getTenantId());
String codeUrl = client.getCodeUrl();
return success(codeUrl);
}
@OperationLog
@Transactional(rollbackFor = Exception.class)
@ApiOperation("第二步通过code换取网页授权access_token")
@GetMapping("/accessToken")
public String accessToken(String code, String state, HttpServletRequest request, HttpServletResponse resp) throws IOException {
if(StrUtil.equals(state,"STATE")){
throw new BusinessException("租户ID不正确");
}
// 1.实例化
WxOfficialUtil client = wxOfficialUtil.client(Integer.valueOf(state));
// 2.获取access_token
final String access_token = client.getAccessToken(code);
// 准备数据
final String unionid = client.unionid;
final String expires_in = client.expires_in;
final JSONObject cache = settingService.getCache("cache".concat(state).concat(":setting:setting"));
final String domain = "https://" + cache.getString("domain");
// 3.查询第三方用户信息表
UserOauthParam userOauthParam = new UserOauthParam();
userOauthParam.setUnionid(unionid);
userOauthParam.setTenantId(Integer.valueOf(state));
System.out.println("userOauthParam = " + userOauthParam);
final UserOauth oauthUser = userOauthService.getByUnionId(userOauthParam);
System.out.println("oauthUser = " + oauthUser);
// 4.1存在签发token
if(oauthUser != null){
UserParam userParam = new UserParam();
userParam.setUserId(oauthUser.getUserId());
userParam.setTenantId(Integer.valueOf(state));
System.out.println("userParam = " + userParam);
User user = userService.getByUnionId(userParam);
// 5.签发token
System.out.println("user = 签发token " + user);
String wx_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), Integer.valueOf(state)),
configProperties.getTokenExpireTime(), configProperties.getTokenKey());
resp.sendRedirect(domain + "/passport/wx-official-login?token=".concat(wx_token).concat("&username=").concat(user.getUsername()));
return "登录成功";
}
// 4.2不存在则注册并登录签发token
final JSONObject userInfo = client.getUserInfo(access_token);
final String openid = userInfo.getString("openid");
final String unionId = userInfo.getString("unionid");
final String nickname = userInfo.getString("nickname");
final String sex = userInfo.getString("sex");
final String province = userInfo.getString("province");
final String city = userInfo.getString("city");
final String country = userInfo.getString("country");
final String headimgurl = userInfo.getString("headimgurl");
System.out.println("headimgurl = " + headimgurl);
System.out.println("unionId = " + unionId);
System.out.println("openid = " + openid);
System.out.println("nickname = " + nickname);
User user = new User();
user.setNickname(nickname);
user.setType(0);
user.setUsername(randomUsername("wx_"));
user.setPassword(userService.encodePassword(CommonUtil.randomUUID16()));
user.setSex(sex);
user.setPlatform("WX-OFFICIAL");
user.setProvince(province);
user.setCity(city);
user.setCountry(country);
user.setAvatar(headimgurl);
user.setTenantId(Integer.valueOf(state));
userService.saveUser(user);
System.out.println("userLast = " + user);
UserOauth userOauth = new UserOauth();
userOauth.setTenantId(Integer.valueOf(state));
userOauth.setOauthType("WX-OFFICIAL");
userOauth.setOauthId(openid);
userOauth.setUnionid(unionId);
userOauth.setUserId(user.getUserId());
userOauthService.save(userOauth);
loginRecordService.saveAsync(user.getUsername(), LoginRecord.TYPE_LOGIN, null, Integer.valueOf(state), request);
// 5.签发token
String wx_token = JwtUtil.buildToken(new JwtSubject(user.getUsername(), Integer.valueOf(state)),
configProperties.getTokenExpireTime(), configProperties.getTokenKey());
resp.sendRedirect(domain + "/passport/wx-official-login?token=".concat(wx_token).concat("&username=").concat(user.getUsername()));
return "注册成功";
}
}