修改手机端PC端接口分离
This commit is contained in:
+4
@@ -75,9 +75,12 @@ public class ShiroConfig {
|
||||
filterChainDefinitionMap.put("/ocr/ocrCheck/downFile", "anon"); //ocr校核下载文件
|
||||
filterChainDefinitionMap.put("/ocr/ocrCheck/saveFile", "anon"); //ocr校核回调
|
||||
filterChainDefinitionMap.put("/sys/randomImage/**", "anon"); //登录验证码接口排除
|
||||
filterChainDefinitionMap.put("/phone/sys/randomImage/**", "anon"); //登录验证码接口排除
|
||||
filterChainDefinitionMap.put("/sys/checkCaptcha", "anon"); //登录验证码接口排除
|
||||
filterChainDefinitionMap.put("/sys/getRSAPublicKey", "anon"); //获取RSA公钥接口排除
|
||||
filterChainDefinitionMap.put("/phone/sys/getRSAPublicKey", "anon"); //获取RSA公钥接口排除
|
||||
filterChainDefinitionMap.put("/sys/login", "anon"); //登录接口排除
|
||||
filterChainDefinitionMap.put("/phone/sys/login", "anon"); //登录接口排除
|
||||
filterChainDefinitionMap.put("/sys/mLogin", "anon"); //登录接口排除
|
||||
filterChainDefinitionMap.put("/sys/logout", "anon"); //登出接口排除
|
||||
filterChainDefinitionMap.put("/sys/thirdLogin/**", "anon"); //第三方登录
|
||||
@@ -147,6 +150,7 @@ public class ShiroConfig {
|
||||
filterChainDefinitionMap.put("/project/projectLawsInventoryEO/updateFlowInfoByProjectLibraryIds", "anon"); // 项目库-法规清单 根据项目库id更新符合性流程发起人、责任人接口排除
|
||||
filterChainDefinitionMap.put("/project/projectTaskInventoryEO/processCall", "anon"); // 项目库-任务清单 工作流处理数据接口排除
|
||||
filterChainDefinitionMap.put("/wkflow/processHistoryEO/processCall", "anon"); // 流程历史 工作流处理数据接口排除
|
||||
filterChainDefinitionMap.put("/phone/wkflow/processHistoryEO/processCall", "anon"); // 流程历史 工作流处理数据接口排除
|
||||
filterChainDefinitionMap.put("/lawsOpinionGather/lawsOpinionGatherEO/processCall", "anon"); // 法规收集表 工作流处理数据接口排除
|
||||
filterChainDefinitionMap.put("/lawsOpinionGather/lawsProcessHistoryEO/processCall", "anon"); // 法规收集历史 工作流处理数据接口排除
|
||||
// 法规技术评估表-流程明细 工作流处理数据接口排除
|
||||
|
||||
+573
@@ -0,0 +1,573 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.crypto.asymmetric.RSA;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyuncs.exceptions.ClientException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CacheConstant;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.util.JwtUtil;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.*;
|
||||
import com.jero.common.util.encryption.EncryptedString;
|
||||
import com.jero.modules.base.service.BaseCommonService;
|
||||
import com.jero.modules.config.entity.SysConfig;
|
||||
import com.jero.modules.config.service.ISysConfigService;
|
||||
import com.jero.modules.system.entity.SysDepart;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.model.SysLoginModel;
|
||||
import com.jero.modules.system.service.ISysDepartService;
|
||||
import com.jero.modules.system.service.ISysDictService;
|
||||
import com.jero.modules.system.service.ISysLogService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.util.RandImageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author scott
|
||||
* @since 2018-12-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/phone/sys")
|
||||
@Api(tags="用户登录")
|
||||
@Slf4j
|
||||
public class PhoneLoginController {
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Autowired
|
||||
private ISysLogService logService;
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
@Autowired
|
||||
private ISysDepartService sysDepartService;
|
||||
@Autowired
|
||||
private ISysDictService sysDictService;
|
||||
@Autowired
|
||||
private ISysConfigService iSysConfigService;
|
||||
@Resource
|
||||
private BaseCommonService baseCommonService;
|
||||
|
||||
private static final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890";
|
||||
//密码登录错误的次数前缀
|
||||
public static final String RETRY_LOGIN_PREFIX = "login:retryLoginCount_";
|
||||
//密码登录错误的最大限制次数
|
||||
public static final int RETRY_LOGIN_MAX_COUNT = 5;
|
||||
@ApiOperation("登录接口")
|
||||
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
||||
public Result<JSONObject> login(@RequestBody SysLoginModel sysLoginModel){
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
String username = sysLoginModel.getUsername();
|
||||
String password = sysLoginModel.getPassword();
|
||||
String rsaPublicKey = sysLoginModel.getRsaPublicKey();
|
||||
String rsaPrivateKey = String.valueOf(redisUtil.get(rsaPublicKey));
|
||||
//update-begin--Author:scott Date:20190805 for:暂时注释掉密码加密逻辑,有点问题
|
||||
//前端密码加密,后端进行密码解密
|
||||
//password = AesEncryptUtil.desEncrypt(sysLoginModel.getPassword().replaceAll("%2B", "\\+")).trim();//密码解密
|
||||
//update-begin--Author:scott Date:20190805 for:暂时注释掉密码加密逻辑,有点问题
|
||||
//update-begin-author:taoyan date:20190828 for:校验验证码
|
||||
String captcha = sysLoginModel.getCaptcha();
|
||||
if(captcha==null){
|
||||
result.error500("验证码无效");
|
||||
return result;
|
||||
}
|
||||
String lowerCaseCaptcha = captcha.toLowerCase();
|
||||
String realKey = MD5Util.MD5Encode(lowerCaseCaptcha+sysLoginModel.getCheckKey(), "utf-8");
|
||||
Object checkCode = redisUtil.get(realKey);
|
||||
//当进入登录页时,有一定几率出现验证码错误 #1714
|
||||
if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) {
|
||||
result.error500("验证码错误");
|
||||
return result;
|
||||
}
|
||||
try {
|
||||
//解密获取密码和用户名
|
||||
password = CommonUtils.decryptBtRsaPriKey(password, rsaPrivateKey);
|
||||
username = CommonUtils.decryptBtRsaPriKey(username, rsaPrivateKey);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//1. 校验用户是否有效
|
||||
//update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
||||
LambdaQueryWrapper<SysUser> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysUser::getUsername,username);
|
||||
SysUser sysUser = sysUserService.getOne(queryWrapper);
|
||||
//update-end-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false
|
||||
result = sysUserService.checkUserIsEffective(sysUser);
|
||||
if(!result.isSuccess()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// 若用户名有效,则查询该账号的登陆失败次数是否符合等保要求
|
||||
int retryCount = 0 ;
|
||||
if ( redisUtil.get(RETRY_LOGIN_PREFIX + username) != null){
|
||||
retryCount = (int) redisUtil.get(RETRY_LOGIN_PREFIX + username);
|
||||
}
|
||||
if (retryCount >= RETRY_LOGIN_MAX_COUNT){
|
||||
result.error500("密码错误次数过多,请稍后重试");
|
||||
return result;
|
||||
}
|
||||
//2. 校验用户名或密码是否正确
|
||||
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
||||
String syspassword = sysUser.getPassword();
|
||||
if (!syspassword.equals(userpassword)) {
|
||||
// 重试登录次数加一
|
||||
retryCount++;
|
||||
if( retryCount == 1){
|
||||
redisUtil.set(RETRY_LOGIN_PREFIX + username,retryCount,60 * 30);
|
||||
}else {
|
||||
redisUtil.set(RETRY_LOGIN_PREFIX + username,retryCount,redisUtil.getExpire(RETRY_LOGIN_PREFIX + username));
|
||||
}
|
||||
String msg = retryCount == RETRY_LOGIN_MAX_COUNT ? "密码错误次数过多,请稍后重试":"用户名或密码错误,剩余可登录次数:"+(RETRY_LOGIN_MAX_COUNT - retryCount);
|
||||
result.error500(msg);
|
||||
return result;
|
||||
}
|
||||
//登录成功,清除错误登录次数
|
||||
redisUtil.del(RETRY_LOGIN_PREFIX + username);
|
||||
|
||||
//用户登录信息
|
||||
userInfo(sysUser, result);
|
||||
//update-begin--Author:wangshuai Date:20200714 for:登录日志没有记录人员
|
||||
LoginUser loginUser = new LoginUser();
|
||||
BeanUtils.copyProperties(sysUser, loginUser);
|
||||
baseCommonService.addLog("用户名: " + username + ",登录成功!", CommonConstant.LOG_TYPE_1, null,loginUser);
|
||||
//update-end--Author:wangshuai Date:20200714 for:登录日志没有记录人员
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/logout")
|
||||
public Result<Object> logout(HttpServletRequest request,HttpServletResponse response) {
|
||||
//用户退出逻辑
|
||||
String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN);
|
||||
if(oConvertUtils.isEmpty(token)) {
|
||||
return Result.error("退出登录失败!");
|
||||
}
|
||||
String username = JwtUtil.getUsername(token);
|
||||
LoginUser sysUser = sysBaseAPI.getUserByName(username);
|
||||
if(sysUser!=null) {
|
||||
//update-begin--Author:wangshuai Date:20200714 for:登出日志没有记录人员
|
||||
baseCommonService.addLog("用户名: "+sysUser.getRealname()+",退出成功!", CommonConstant.LOG_TYPE_1, null,sysUser);
|
||||
//update-end--Author:wangshuai Date:20200714 for:登出日志没有记录人员
|
||||
log.info(" 用户名: "+sysUser.getRealname()+",退出成功! ");
|
||||
//清空用户登录Token缓存
|
||||
redisUtil.del(CommonConstant.PREFIX_USER_TOKEN + token);
|
||||
//清空用户登录Shiro权限缓存
|
||||
redisUtil.del(CommonConstant.PREFIX_USER_SHIRO_CACHE + sysUser.getId());
|
||||
//清空用户的缓存信息(包括部门信息),例如sys:cache:user::<username>
|
||||
redisUtil.del(String.format("%s::%s", CacheConstant.SYS_USERS_CACHE, sysUser.getUsername()));
|
||||
//调用shiro的logout
|
||||
SecurityUtils.getSubject().logout();
|
||||
return Result.OK("退出登录成功!");
|
||||
}else {
|
||||
return Result.error("Token无效!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取访问量
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("loginfo")
|
||||
public Result<JSONObject> loginfo() {
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
JSONObject obj = new JSONObject();
|
||||
//update-begin--Author:zhangweijian Date:20190428 for:传入开始时间,结束时间参数
|
||||
// 获取一天的开始和结束时间
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
Date dayStart = calendar.getTime();
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
Date dayEnd = calendar.getTime();
|
||||
// 获取系统访问记录
|
||||
Long totalVisitCount = logService.findTotalVisitCount();
|
||||
obj.put("totalVisitCount", totalVisitCount);
|
||||
Long todayVisitCount = logService.findTodayVisitCount(dayStart,dayEnd);
|
||||
obj.put("todayVisitCount", todayVisitCount);
|
||||
Long todayIp = logService.findTodayIp(dayStart,dayEnd);
|
||||
//update-end--Author:zhangweijian Date:20190428 for:传入开始时间,结束时间参数
|
||||
obj.put("todayIp", todayIp);
|
||||
result.setResult(obj);
|
||||
result.success("登录成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取访问量
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("visitInfo")
|
||||
public Result<List<Map<String,Object>>> visitInfo() {
|
||||
Result<List<Map<String,Object>>> result = new Result<List<Map<String,Object>>>();
|
||||
Calendar calendar = new GregorianCalendar();
|
||||
calendar.set(Calendar.HOUR_OF_DAY,0);
|
||||
calendar.set(Calendar.MINUTE,0);
|
||||
calendar.set(Calendar.SECOND,0);
|
||||
calendar.set(Calendar.MILLISECOND,0);
|
||||
calendar.add(Calendar.DAY_OF_MONTH, 1);
|
||||
Date dayEnd = calendar.getTime();
|
||||
calendar.add(Calendar.DAY_OF_MONTH, -7);
|
||||
Date dayStart = calendar.getTime();
|
||||
List<Map<String,Object>> list = logService.findVisitCount(dayStart, dayEnd);
|
||||
result.setResult(oConvertUtils.toLowerCasePageList(list));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 登陆成功选择用户当前部门
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/selectDepart", method = RequestMethod.PUT)
|
||||
public Result<JSONObject> selectDepart(@RequestBody SysUser user) {
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
String username = user.getUsername();
|
||||
if(oConvertUtils.isEmpty(username)) {
|
||||
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
|
||||
username = sysUser.getUsername();
|
||||
}
|
||||
String orgCode= user.getOrgCode();
|
||||
this.sysUserService.updateUserDepart(username, orgCode);
|
||||
SysUser sysUser = sysUserService.getUserByName(username);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("userInfo", sysUser);
|
||||
result.setResult(obj);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信登录接口
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/sms")
|
||||
public Result<String> sms(@RequestBody JSONObject jsonObject) {
|
||||
Result<String> result = new Result<String>();
|
||||
String mobile = jsonObject.get("mobile").toString();
|
||||
//手机号模式 登录模式: "2" 注册模式: "1"
|
||||
String smsmode=jsonObject.get("smsmode").toString();
|
||||
log.info(mobile);
|
||||
if(oConvertUtils.isEmpty(mobile)){
|
||||
result.setMessage("手机号不允许为空!");
|
||||
result.setSuccess(false);
|
||||
return result;
|
||||
}
|
||||
Object object = redisUtil.get(mobile);
|
||||
if (object != null) {
|
||||
result.setMessage("验证码10分钟内,仍然有效!");
|
||||
result.setSuccess(false);
|
||||
return result;
|
||||
}
|
||||
|
||||
//随机数
|
||||
String captcha = RandomUtil.randomNumbers(6);
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("code", captcha);
|
||||
try {
|
||||
boolean b = false;
|
||||
//注册模板
|
||||
if (CommonConstant.SMS_TPL_TYPE_1.equals(smsmode)) {
|
||||
SysUser sysUser = sysUserService.getUserByPhone(mobile);
|
||||
if(sysUser!=null) {
|
||||
result.error500(" 手机号已经注册,请直接登录!");
|
||||
baseCommonService.addLog("手机号已经注册,请直接登录!", CommonConstant.LOG_TYPE_1, null);
|
||||
return result;
|
||||
}
|
||||
b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.REGISTER_TEMPLATE_CODE);
|
||||
}else {
|
||||
//登录模式,校验用户有效性
|
||||
SysUser sysUser = sysUserService.getUserByPhone(mobile);
|
||||
result = sysUserService.checkUserIsEffective(sysUser);
|
||||
if(!result.isSuccess()) {
|
||||
String message = result.getMessage();
|
||||
if("该用户不存在,请注册".equals(message)){
|
||||
result.error500("该用户不存在或未绑定手机号");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* smsmode 短信模板方式 0 .登录模板、1.注册模板、2.忘记密码模板
|
||||
*/
|
||||
if (CommonConstant.SMS_TPL_TYPE_0.equals(smsmode)) {
|
||||
//登录模板
|
||||
b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.LOGIN_TEMPLATE_CODE);
|
||||
} else if(CommonConstant.SMS_TPL_TYPE_2.equals(smsmode)) {
|
||||
//忘记密码模板
|
||||
b = DySmsHelper.sendSms(mobile, obj, DySmsEnum.FORGET_PASSWORD_TEMPLATE_CODE);
|
||||
}
|
||||
}
|
||||
|
||||
if (b == false) {
|
||||
result.setMessage("短信验证码发送失败,请稍后重试");
|
||||
result.setSuccess(false);
|
||||
return result;
|
||||
}
|
||||
//验证码10分钟内有效
|
||||
redisUtil.set(mobile, captcha, 600);
|
||||
//update-begin--Author:scott Date:20190812 for:issues#391
|
||||
//result.setResult(captcha);
|
||||
//update-end--Author:scott Date:20190812 for:issues#391
|
||||
result.setSuccess(true);
|
||||
|
||||
} catch (ClientException e) {
|
||||
e.printStackTrace();
|
||||
result.error500(" 短信接口未配置,请联系管理员!");
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 手机号登录接口
|
||||
*
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("手机号登录接口")
|
||||
@PostMapping("/phoneLogin")
|
||||
public Result<JSONObject> phoneLogin(@RequestBody JSONObject jsonObject) {
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
String phone = jsonObject.getString("mobile");
|
||||
|
||||
//校验用户有效性
|
||||
SysUser sysUser = sysUserService.getUserByPhone(phone);
|
||||
result = sysUserService.checkUserIsEffective(sysUser);
|
||||
if(!result.isSuccess()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
String smscode = jsonObject.getString("captcha");
|
||||
Object code = redisUtil.get(phone);
|
||||
if (!smscode.equals(code)) {
|
||||
result.setMessage("手机验证码错误");
|
||||
return result;
|
||||
}
|
||||
//用户信息
|
||||
userInfo(sysUser, result);
|
||||
//添加日志
|
||||
baseCommonService.addLog("用户名: " + sysUser.getUsername() + ",登录成功!", CommonConstant.LOG_TYPE_1, null);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*
|
||||
* @param sysUser
|
||||
* @param result
|
||||
* @return
|
||||
*/
|
||||
private Result<JSONObject> userInfo(SysUser sysUser, Result<JSONObject> result) {
|
||||
String syspassword = sysUser.getPassword();
|
||||
String username = sysUser.getUsername();
|
||||
// 生成token
|
||||
String token = JwtUtil.sign(username, syspassword);
|
||||
// 设置token缓存有效时间
|
||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
|
||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME*2 / 1000);
|
||||
|
||||
// 获取用户部门信息
|
||||
JSONObject obj = new JSONObject();
|
||||
List<SysDepart> departs = sysDepartService.queryUserDeparts(sysUser.getId());
|
||||
obj.put("departs", departs);
|
||||
if (departs == null || departs.size() == 0) {
|
||||
obj.put("multi_depart", 0);
|
||||
} else if (departs.size() == 1) {
|
||||
sysUserService.updateUserDepart(username, departs.get(0).getOrgCode());
|
||||
obj.put("multi_depart", 1);
|
||||
} else {
|
||||
//查询当前是否有登录部门
|
||||
// update-begin--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去
|
||||
SysUser sysUserById = sysUserService.getById(sysUser.getId());
|
||||
if(oConvertUtils.isEmpty(sysUserById.getOrgCode())){
|
||||
sysUserService.updateUserDepart(username, departs.get(0).getOrgCode());
|
||||
}
|
||||
// update-end--Author:wangshuai Date:20200805 for:如果用戶为选择部门,数据库为存在上一次登录部门,则取一条存进去
|
||||
obj.put("multi_depart", 2);
|
||||
}
|
||||
|
||||
// 获取用户角色信息
|
||||
List<SysRole> userRoleListInfo = sysUserService.queryUserRoleListInfoByUserId(sysUser.getId());
|
||||
sysUser.setUserRoleList(userRoleListInfo);
|
||||
|
||||
//获取配置信息
|
||||
List<SysConfig> sysConfigs = iSysConfigService.queryList();
|
||||
if(CollectionUtils.isNotEmpty(sysConfigs)){
|
||||
for (SysConfig sysConfig : sysConfigs) {
|
||||
obj.put(sysConfig.getConfigName(),sysConfig.getConfig());
|
||||
}
|
||||
}
|
||||
|
||||
obj.put("token", token);
|
||||
obj.put("userInfo", sysUser);
|
||||
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
||||
result.setResult(obj);
|
||||
result.success("登录成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取加密字符串
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/getEncryptedString")
|
||||
public Result<Map<String,String>> getEncryptedString(){
|
||||
Result<Map<String,String>> result = new Result<Map<String,String>>();
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
map.put("key", EncryptedString.key);
|
||||
map.put("iv",EncryptedString.iv);
|
||||
result.setResult(map);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台生成图形验证码 :有效
|
||||
* @param response
|
||||
* @param key
|
||||
*/
|
||||
@ApiOperation("获取验证码")
|
||||
@GetMapping(value = "/randomImage/{key}")
|
||||
public Result<String> randomImage(HttpServletResponse response,@PathVariable String key){
|
||||
Result<String> res = new Result<String>();
|
||||
try {
|
||||
String code = RandomUtil.randomString(BASE_CHECK_CODES,4);
|
||||
String lowerCaseCode = code.toLowerCase();
|
||||
String realKey = MD5Util.MD5Encode(lowerCaseCode+key, "utf-8");
|
||||
redisUtil.set(realKey, lowerCaseCode, 60);
|
||||
String base64 = RandImageUtil.generate(code);
|
||||
res.setSuccess(true);
|
||||
res.setResult(base64);
|
||||
} catch (Exception e) {
|
||||
res.error500("获取验证码出错"+e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* app登录
|
||||
* @param sysLoginModel
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/mLogin", method = RequestMethod.POST)
|
||||
public Result<JSONObject> mLogin(@RequestBody SysLoginModel sysLoginModel) throws Exception {
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
String username = sysLoginModel.getUsername();
|
||||
String password = sysLoginModel.getPassword();
|
||||
|
||||
//1. 校验用户是否有效
|
||||
SysUser sysUser = sysUserService.getUserByName(username);
|
||||
result = sysUserService.checkUserIsEffective(sysUser);
|
||||
if(!result.isSuccess()) {
|
||||
return result;
|
||||
}
|
||||
|
||||
//2. 校验用户名或密码是否正确
|
||||
String userpassword = PasswordUtil.encrypt(username, password, sysUser.getSalt());
|
||||
String syspassword = sysUser.getPassword();
|
||||
if (!syspassword.equals(userpassword)) {
|
||||
result.error500("用户名或密码错误");
|
||||
return result;
|
||||
}
|
||||
|
||||
String orgCode = sysUser.getOrgCode();
|
||||
if(oConvertUtils.isEmpty(orgCode)) {
|
||||
//如果当前用户无选择部门 查看部门关联信息
|
||||
List<SysDepart> departs = sysDepartService.queryUserDeparts(sysUser.getId());
|
||||
if (departs == null || departs.size() == 0) {
|
||||
result.error500("用户暂未归属部门,不可登录!");
|
||||
return result;
|
||||
}
|
||||
orgCode = departs.get(0).getOrgCode();
|
||||
sysUser.setOrgCode(orgCode);
|
||||
this.sysUserService.updateUserDepart(username, orgCode);
|
||||
}
|
||||
JSONObject obj = new JSONObject();
|
||||
//用户登录信息
|
||||
obj.put("userInfo", sysUser);
|
||||
|
||||
// 生成token
|
||||
String token = JwtUtil.sign(username, syspassword);
|
||||
// 设置超时时间
|
||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
|
||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME*2 / 1000);
|
||||
|
||||
//token 信息
|
||||
obj.put("token", token);
|
||||
result.setResult(obj);
|
||||
result.setSuccess(true);
|
||||
result.setCode(200);
|
||||
baseCommonService.addLog("用户名: " + username + ",登录成功[移动端]!", CommonConstant.LOG_TYPE_1, null);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 图形验证码
|
||||
* @param sysLoginModel
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/checkCaptcha", method = RequestMethod.POST)
|
||||
public Result<?> checkCaptcha(@RequestBody SysLoginModel sysLoginModel){
|
||||
String captcha = sysLoginModel.getCaptcha();
|
||||
String checkKey = sysLoginModel.getCheckKey();
|
||||
if(captcha==null){
|
||||
return Result.error("验证码无效");
|
||||
}
|
||||
String lowerCaseCaptcha = captcha.toLowerCase();
|
||||
String realKey = MD5Util.MD5Encode(lowerCaseCaptcha+checkKey, "utf-8");
|
||||
Object checkCode = redisUtil.get(realKey);
|
||||
if(checkCode==null || !checkCode.equals(lowerCaseCaptcha)) {
|
||||
return Result.error("验证码错误");
|
||||
}
|
||||
return Result.OK();
|
||||
}
|
||||
/**
|
||||
* 返回一个RSA公钥
|
||||
* @author 马志朝
|
||||
* @date 2021/4/15 15:01
|
||||
* @param
|
||||
* @return com.jero.common.api.vo.Result<java.lang.String>
|
||||
*/
|
||||
@ApiOperation("获取RSA公钥")
|
||||
@GetMapping("/getRSAPublicKey")
|
||||
public Result<String> getRSAPublicKey(){
|
||||
RSA rsa = new RSA();
|
||||
String privateKeyBase64 = rsa.getPrivateKeyBase64();
|
||||
String publicKeyBase64 = rsa.getPublicKeyBase64();
|
||||
//存到redis key为公钥 value为私钥
|
||||
redisUtil.set(publicKeyBase64, privateKeyBase64, 60L);
|
||||
Result<String> result = new Result<>();
|
||||
result.setResult(publicKeyBase64);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+856
@@ -0,0 +1,856 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.CacheConstant;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.ImportExcelUtil;
|
||||
import com.jero.common.util.SqlInjectionUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.enums.DictCodeEnum;
|
||||
import com.jero.modules.enums.FixedFieldEnum;
|
||||
import com.jero.modules.enums.IsTagDict;
|
||||
import com.jero.modules.system.entity.SysDict;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.model.SysDictTree;
|
||||
import com.jero.modules.system.model.TreeSelectModel;
|
||||
import com.jero.modules.system.service.IProjectUserBrandService;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import com.jero.modules.system.service.ISysDictService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.vo.SysDictPage;
|
||||
import com.jero.modules.utils.HanYuPinYinUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.jeecgframework.poi.excel.ExcelImportCheckUtil;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @Author zhangweijian
|
||||
* @since 2018-12-28
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "字典控制器")
|
||||
@RequestMapping("/phone/sys/dict")
|
||||
@Slf4j
|
||||
public class PhoneSysDictController {
|
||||
|
||||
@Autowired
|
||||
private ISysDictService sysDictService;
|
||||
@Autowired
|
||||
private ISysDictItemService sysDictItemService;
|
||||
@Autowired
|
||||
public RedisTemplate<String, Object> redisTemplate;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private IProjectUserBrandService projectUserBrandService;
|
||||
|
||||
@RequestMapping(value = "/page", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "字典控制器-分页列表查询", notes = "字典控制器-分页列表查询")
|
||||
public Result<IPage<SysDict>> queryPageList(SysDict sysDict, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) {
|
||||
Result<IPage<SysDict>> result = new Result<IPage<SysDict>>();
|
||||
QueryWrapper<SysDict> queryWrapper = QueryGenerator.initQueryWrapper(sysDict, req.getParameterMap());
|
||||
queryWrapper.eq("del_flag",CommonConstant.DEL_FLAG_0);
|
||||
queryWrapper.eq("is_tag_dict", IsTagDict.SYS_DICT_SYSTEM.getValue());
|
||||
Page<SysDict> page = new Page<SysDict>(pageNo, pageSize);
|
||||
IPage<SysDict> pageList = sysDictService.page(page, queryWrapper);
|
||||
log.debug("查询当前页:"+pageList.getCurrent());
|
||||
log.debug("查询当前页数量:"+pageList.getSize());
|
||||
log.debug("查询结果数量:"+pageList.getRecords().size());
|
||||
log.debug("数据总数:"+pageList.getTotal());
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签内容-分页查询
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签内容-分页列表查询")
|
||||
@ApiOperation(value="标签内容-分页列表查询", notes="区域管理表-分页列表查询")
|
||||
@RequiresPermissions("dict:tagDictPage")
|
||||
@PostMapping(value = "/tagDictPage")
|
||||
public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
|
||||
IPage<SysDict> pageList=sysDictService.queryPageList(params);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* @功能:获取树形字典数据
|
||||
* @param sysDict
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-树形字典数据", notes = "字典控制器-树形字典数据")
|
||||
@RequestMapping(value = "/treeList", method = RequestMethod.GET)
|
||||
public Result<List<SysDictTree>> treeList(SysDict sysDict, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) {
|
||||
Result<List<SysDictTree>> result = new Result<>();
|
||||
LambdaQueryWrapper<SysDict> query = new LambdaQueryWrapper<>();
|
||||
// 构造查询条件
|
||||
String dictName = sysDict.getDictName();
|
||||
if(oConvertUtils.isNotEmpty(dictName)) {
|
||||
query.like(true, SysDict::getDictName, dictName);
|
||||
}
|
||||
query.orderByDesc(true, SysDict::getCreateTime);
|
||||
List<SysDict> list = sysDictService.list(query);
|
||||
List<SysDictTree> treeList = new ArrayList<>();
|
||||
for (SysDict node : list) {
|
||||
treeList.add(new SysDictTree(node));
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(treeList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典数据
|
||||
* @param dictCode 字典code
|
||||
* @param dictCode 表名,文本字段,code字段 | 举例:sys_user,realname,id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-根据字典编码获取字典数据", notes = "字典控制器-根据字典编码获取字典数据")
|
||||
@RequestMapping(value = "/getDictItems/{dictCode}", method = RequestMethod.GET)
|
||||
public Result<List<DictModel>> getDictItems(@PathVariable String dictCode, @RequestParam(value = "sign",required = false) String sign, HttpServletRequest request) {
|
||||
log.info(" dictCode : "+ dictCode);
|
||||
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
||||
List<DictModel> ls = null;
|
||||
try {
|
||||
if(dictCode.indexOf(",")!=-1) {
|
||||
//关联表字典(举例:sys_user,realname,id)
|
||||
String[] params = dictCode.split(",");
|
||||
|
||||
if(params.length<3) {
|
||||
result.error500("字典Code格式不正确!");
|
||||
return result;
|
||||
}
|
||||
//SQL注入校验(只限制非法串改数据库)
|
||||
final String[] sqlInjCheck = {params[0],params[1],params[2]};
|
||||
SqlInjectionUtil.filterContent(sqlInjCheck);
|
||||
|
||||
if(params.length==4) {
|
||||
//SQL注入校验(查询条件SQL 特殊check,此方法仅供此处使用)
|
||||
SqlInjectionUtil.specialFilterContent(params[3]);
|
||||
ls = sysDictService.queryTableDictItemsByCodeAndFilter(params[0],params[1],params[2],params[3]);
|
||||
}else if (params.length==3) {
|
||||
ls = sysDictService.queryTableDictItemsByCode(params[0],params[1],params[2]);
|
||||
}else{
|
||||
result.error500("字典Code格式不正确!");
|
||||
return result;
|
||||
}
|
||||
}else {
|
||||
//字典表
|
||||
ls = sysDictService.queryDictItemsByCode(dictCode);
|
||||
}
|
||||
|
||||
// 将结果集进行排序
|
||||
/*if (CollectionUtils.isNotEmpty(ls)) {
|
||||
// 匿名比较器排序
|
||||
Collections.sort(ls, new Comparator<DictModel>() {
|
||||
@Override
|
||||
public int compare(DictModel p1, DictModel p2) {
|
||||
return p1.getText().compareTo(p2.getText());
|
||||
}
|
||||
});
|
||||
}*/
|
||||
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
log.debug(result.toString());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部字典数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-获取全部字典数据", notes = "字典控制器-获取全部字典数据")
|
||||
@RequestMapping(value = "/queryAllDictItems", method = RequestMethod.GET)
|
||||
public Result<?> queryAllDictItems(HttpServletRequest request) {
|
||||
Map<String, List<DictModel>> res = new HashMap<String, List<DictModel>>();
|
||||
res = sysDictService.queryAllDictItems();
|
||||
//添加成功后需要刷新缓存
|
||||
sysDictService.refreshCache();
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部字典数据(中英文切换)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-获取全部字典数据", notes = "字典控制器-获取全部字典数据")
|
||||
@RequestMapping(value = "/queryAllDictItemsByCut", method = RequestMethod.GET)
|
||||
public Result<?> queryAllDictItemsByCut(HttpServletRequest request,String cut) {
|
||||
Map<String, List<DictModel>> res = new HashMap<String, List<DictModel>>();
|
||||
res = sysDictService.queryAllDictItemsByCut(cut);
|
||||
return Result.OK(res);
|
||||
}
|
||||
@ApiOperation(value = "更新浏览器内保存的数据字典数据", notes = "更新浏览器内保存的数据字典数据")
|
||||
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
||||
private Result<JSONObject> userInfo(SysUser sysUser, Result<JSONObject> result) {
|
||||
// 获取数据字典
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("sysAllDictItems", sysDictService.queryAllDictItems());
|
||||
result.setResult(obj);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典数据
|
||||
* @param dictCode
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-通过字典code和字典值key获取字典数据", notes = "字典控制器-通过字典code和字典值key获取字典数据")
|
||||
@RequestMapping(value = "/getDictText/{dictCode}/{key}", method = RequestMethod.GET)
|
||||
public Result<String> getDictText(@PathVariable("dictCode") String dictCode, @PathVariable("key") String key) {
|
||||
log.info(" dictCode : "+ dictCode);
|
||||
Result<String> result = new Result<String>();
|
||||
String text = null;
|
||||
try {
|
||||
text = sysDictService.queryDictTextByKey(dictCode, key);
|
||||
result.setSuccess(true);
|
||||
result.setResult(text);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 大数据量的字典表 走异步加载 即前端输入内容过滤数据
|
||||
* @param dictCode
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-通过字典code获取字典数据", notes = "字典控制器-通过字典code获取字典数据")
|
||||
@RequestMapping(value = "/loadDict/{dictCode}", method = RequestMethod.GET)
|
||||
public Result<List<DictModel>> loadDict(@PathVariable String dictCode,
|
||||
@RequestParam(name="keyword") String keyword,
|
||||
@RequestParam(value = "sign",required = false) String sign,
|
||||
@RequestParam(value = "pageSize", required = false) Integer pageSize) {
|
||||
log.info(" 加载字典表数据,加载关键字: "+ keyword);
|
||||
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
||||
List<DictModel> ls = null;
|
||||
try {
|
||||
if(dictCode.indexOf(",")!=-1) {
|
||||
String[] params = dictCode.split(",");
|
||||
if(params.length!=3) {
|
||||
result.error500("字典Code格式不正确!");
|
||||
return result;
|
||||
}
|
||||
if(pageSize!=null){
|
||||
ls = sysDictService.queryLittleTableDictItems(params[0],params[1],params[2],keyword, pageSize);
|
||||
}else{
|
||||
ls = sysDictService.queryTableDictItems(params[0],params[1],params[2],keyword);
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
log.info(result.toString());
|
||||
}else {
|
||||
result.error500("字典Code格式不正确!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典code加载字典text 返回
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-根据字典code加载字典text", notes = "字典控制器-根据字典code加载字典text")
|
||||
@RequestMapping(value = "/loadDictItem/{dictCode}", method = RequestMethod.GET)
|
||||
public Result<List<String>> loadDictItem(@PathVariable String dictCode, @RequestParam(name="key") String keys, @RequestParam(value = "sign",required = false) String sign, HttpServletRequest request) {
|
||||
Result<List<String>> result = new Result<>();
|
||||
try {
|
||||
if(dictCode.indexOf(",")!=-1) {
|
||||
String[] params = dictCode.split(",");
|
||||
if(params.length!=3) {
|
||||
result.error500("字典Code格式不正确!");
|
||||
return result;
|
||||
}
|
||||
List<String> texts = sysDictService.queryTableDictByKeys(params[0], params[1], params[2], keys);
|
||||
|
||||
result.setSuccess(true);
|
||||
result.setResult(texts);
|
||||
log.info(result.toString());
|
||||
}else {
|
||||
result.error500("字典Code格式不正确!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据表名——显示字段-存储字段 pid 加载树形数据
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-根据表名—显示字段-存储字段 pid 加载树形数据", notes = "字典控制器-根据表名—显示字段-存储字段 pid 加载树形数据")
|
||||
@RequestMapping(value = "/loadTreeData", method = RequestMethod.GET)
|
||||
public Result<List<TreeSelectModel>> loadTreeData(@RequestParam(name="pid") String pid, @RequestParam(name="pidField") String pidField,
|
||||
@RequestParam(name="tableName") String tbname,
|
||||
@RequestParam(name="text") String text,
|
||||
@RequestParam(name="code") String code,
|
||||
@RequestParam(name="hasChildField", required = false) String hasChildField,
|
||||
@RequestParam(value = "sign", required = false) String sign, HttpServletRequest request) {
|
||||
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
|
||||
|
||||
// SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件)
|
||||
String dictCode = tbname +","+ text +","+ code;
|
||||
SqlInjectionUtil.filterContent(dictCode);
|
||||
List<TreeSelectModel> ls = sysDictService.queryTreeList(null, tbname, text, code, pidField, pid, hasChildField);
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询后返回树型数据
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-根据表名—显示字段-存储字段 加载树形数据", notes = "字典控制器-根据表名—显示字段-存储字段 加载树形数据")
|
||||
@RequestMapping(value = "/queryAllTreeData", method = RequestMethod.GET)
|
||||
public Result<List<TreeSelectModel>> queryAllTreeData(@RequestParam(name="pidField") String pidField,
|
||||
@RequestParam(name="tableName") String tbname,
|
||||
@RequestParam(name="text") String text,
|
||||
@RequestParam(name="code") String code,
|
||||
HttpServletRequest request) {
|
||||
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
|
||||
|
||||
// SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件)
|
||||
String dictCode = tbname +","+ text +","+ code;
|
||||
SqlInjectionUtil.filterContent(dictCode);
|
||||
List<TreeSelectModel> ls = sysDictService.queryAllTreeData(tbname, text, code, pidField);
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 查询被删除的列表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/deleteList")
|
||||
public Result<List<SysDict>> deleteList() {
|
||||
Result<List<SysDict>> result = new Result<List<SysDict>>();
|
||||
List<SysDict> list = this.sysDictService.queryDeleteList();
|
||||
result.setSuccess(true);
|
||||
result.setResult(list);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* @功能:新增
|
||||
* @param sysDict
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-新增字典", notes = "字典控制器-新增字典")
|
||||
@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
||||
@RequiresPermissions("dict:add")
|
||||
public Result<SysDict> add(@RequestBody SysDict sysDict) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
|
||||
sysDictService.setAddOrdderNum(sysDict);
|
||||
//校验--不能重复数据
|
||||
QueryWrapper<SysDict> queryWrapper = new QueryWrapper<>();
|
||||
//查询同一模块下,同名数据
|
||||
queryWrapper.eq("dict_name",sysDict.getDictName())
|
||||
.eq("is_tag_dict",sysDict.getIsTagDict());
|
||||
List<SysDict> existDictList = this.sysDictService.list(queryWrapper);
|
||||
try {
|
||||
if(!existDictList.isEmpty()) {
|
||||
SysDict sysDictDB = existDictList.get(0);
|
||||
//存在重复同名标签内容,且已删,恢复
|
||||
if (sysDictDB.getDelFlag() == CommonConstant.DEL_FLAG_1) {
|
||||
sysDictService.updateDictDelFlag(CommonConstant.DEL_FLAG_0, sysDictDB.getId());
|
||||
}else{//存在重复同名标签内容,未删
|
||||
result.error500("标签名称不能重复");
|
||||
}
|
||||
} else {//不是同名
|
||||
if (ObjectUtils.isNotEmpty(sysDict.getIsTagDict())
|
||||
&& sysDict.getIsTagDict() == IsTagDict.TAG_DICT.getValue()) {
|
||||
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(sysDict.getDictName());
|
||||
sysDict.setDictCode(pinYin.replace(" ","_"));
|
||||
|
||||
sysDict.setCreateTime(new Date());
|
||||
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
|
||||
// sysDict.setDictName(sysDict.getDictName().replace(" ",""));
|
||||
sysDictService.save(sysDict);
|
||||
}else if(sysDict.getIsTagDict() == IsTagDict.SYS_DICT_SYSTEM.getValue()){
|
||||
sysDict.setCreateTime(new Date());
|
||||
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
sysDictService.save(sysDict);
|
||||
}
|
||||
result.success("保存成功!");
|
||||
//添加成功后需要刷新缓存
|
||||
sysDictService.refreshCache();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @功能:编辑
|
||||
* @param sysDict
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-编辑字典", notes = "字典控制器-编辑字典")
|
||||
@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
|
||||
@RequiresPermissions("dict:edit")
|
||||
public Result<SysDict> edit(@RequestBody SysDict sysDict) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
sysDictService.setEditOrderNum(sysDict);
|
||||
SysDict sysdict = sysDictService.getById(sysDict.getId());
|
||||
if (sysdict == null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
if (StringUtils.isNotBlank(String.valueOf(sysDict.getIsReadOnly()))) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(sysDict.getIsReadOnly()))) {
|
||||
result.error500("固定字段,不可修改");
|
||||
} else {
|
||||
//校验--不能重复数据
|
||||
QueryWrapper<SysDict> queryWrapper = new QueryWrapper<>();
|
||||
//查询同一模块下,同名数据
|
||||
queryWrapper.eq("dict_name", sysDict.getDictName())
|
||||
.eq("is_tag_dict",sysDict.getIsTagDict());
|
||||
List<SysDict> existDictList = this.sysDictService.list(queryWrapper);
|
||||
if (!existDictList.isEmpty()) {
|
||||
if (existDictList.get(0).getId().equals(sysDict.getId())) {//已存在同名的数据,就是正在编辑的这个
|
||||
sysDict.setUpdateTime(new Date());
|
||||
boolean ok = sysDictService.updateById(sysDict);
|
||||
if (ok) {
|
||||
result.success("编辑成功!");
|
||||
//编辑成功后需要刷新缓存
|
||||
sysDictService.refreshCache();
|
||||
}
|
||||
} else {//已存在同名的数据,不是正在编辑的这个
|
||||
SysDict sysDictDB = existDictList.get(0);
|
||||
//存在重复同名标签内容,且已删,恢复
|
||||
if (sysDictDB.getDelFlag() == CommonConstant.DEL_FLAG_1) {
|
||||
sysDictService.updateDictDelFlag(CommonConstant.DEL_FLAG_0, sysDictDB.getId());
|
||||
} else {//存在重复同名标签内容,未删
|
||||
result.error500("标签名称不能重复");
|
||||
}
|
||||
}
|
||||
} else {//不是同名
|
||||
sysDict.setUpdateTime(new Date());
|
||||
boolean ok = sysDictService.updateById(sysDict);
|
||||
if (ok) {
|
||||
result.success("编辑成功!");
|
||||
//编辑成功后需要刷新缓存
|
||||
sysDictService.refreshCache();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @功能:删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-删除字典", notes = "字典控制器-删除字典")
|
||||
@RequiresRoles({"admin"})
|
||||
@DeleteMapping(value = "/delete")
|
||||
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public Result<SysDict> delete(@RequestParam(name="id",required=true) String id) {
|
||||
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
SysDict sysDict = sysDictService.queryById(id);
|
||||
if (StringUtils.isNotBlank(String.valueOf(sysDict.getIsReadOnly()))) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(sysDict.getIsReadOnly()))) {
|
||||
result.error500("固定字段,不可删除");
|
||||
} else {
|
||||
boolean ok = sysDictService.removeById(id);
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
} else {
|
||||
result.error500("删除失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @功能:逻辑删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-逻辑删除字典", notes = "字典控制器-逻辑删除字典")
|
||||
@RequiresRoles({"admin"})
|
||||
@GetMapping(value = "/logicDelete")
|
||||
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
@RequiresPermissions("dict:logicDelete")
|
||||
public Result<SysDict> logicDelete(@RequestParam(name="id",required=true) String id) {
|
||||
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
try{
|
||||
SysDict sysDict = sysDictService.queryById(id);
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(sysDict.getIsReadOnly()))) {
|
||||
result.error500("固定字段,不可删除");
|
||||
} else {
|
||||
sysDictService.updateDictDelFlag(CommonConstant.DEL_FLAG_1,id);
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("删除失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @功能:批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-批量字典", notes = "字典控制器-批量字典")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public Result<SysDict> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
SysDict sysDict = sysDictService.queryById(ids);
|
||||
if(oConvertUtils.isEmpty(ids)) {
|
||||
result.error500("参数不识别!");
|
||||
}else {
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for (String list : idList) {
|
||||
SysDict midDict = sysDictService.getById(list);
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(sysDict.getIsReadOnly())) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(String.valueOf(midDict.getIsReadOnly()))) {
|
||||
return result.error500("包含固定字段,不可删除");
|
||||
} else {
|
||||
sysDictService.removeByIds(idList);
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @功能:批量逻辑删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-批量字典", notes = "字典控制器-批量字典")
|
||||
@GetMapping(value = "/logicDeleteBatch")
|
||||
@CacheEvict(value= CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
public Result<SysDict> logicdeleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
for(String list:idList){
|
||||
SysDict joinSystem=sysDictService.getById(list);
|
||||
if(oConvertUtils.isEmpty(ids)) {
|
||||
result.error500("参数不识别!");
|
||||
}else {
|
||||
if (StringUtils.isNotBlank(String.valueOf(joinSystem.getIsReadOnly()))) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(String.valueOf(joinSystem.getIsReadOnly()))) {
|
||||
result.error500("包含固定字段,不可删除");
|
||||
} else {
|
||||
sysDictService.updateDictDelFlag(CommonConstant.DEL_FLAG_1,joinSystem.getId());
|
||||
result.success("批量删除成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @功能:刷新缓存
|
||||
* @date 修改时间 2021.4.8
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/refleshCache")
|
||||
public Result<?> refleshCache() {
|
||||
Result<?> result = new Result<SysDict>();
|
||||
sysDictService.refreshCache();
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(SysDict sysDict, HttpServletRequest request) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<SysDict> queryWrapper = QueryGenerator.initQueryWrapper(sysDict, request.getParameterMap());
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<SysDictPage> pageList = new ArrayList<SysDictPage>();
|
||||
|
||||
List<SysDict> sysDictList = sysDictService.list(queryWrapper);
|
||||
for (SysDict dictMain : sysDictList) {
|
||||
SysDictPage vo = new SysDictPage();
|
||||
BeanUtils.copyProperties(dictMain, vo);
|
||||
// 查询机票
|
||||
List<SysDictItem> sysDictItemList = sysDictItemService.selectItemsByMainId(dictMain.getId());
|
||||
vo.setSysDictItemList(sysDictItemList);
|
||||
pageList.add(vo);
|
||||
}
|
||||
|
||||
// 导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "数据字典");
|
||||
// 注解对象Class
|
||||
mv.addObject(NormalExcelConstants.CLASS, SysDictPage.class);
|
||||
// 自定义表格参数
|
||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("数据字典列表", "导出人:"+user.getRealname(), "数据字典"));
|
||||
// 导出数据列表
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequiresRoles({"admin"})
|
||||
@PostMapping(value = "/importExcel")
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(2);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
//导入Excel格式校验,看匹配的字段文本概率
|
||||
Boolean t = ExcelImportCheckUtil.check(file.getInputStream(), SysDictPage.class, params);
|
||||
if(!t){
|
||||
throw new RuntimeException("导入Excel校验失败 !");
|
||||
}
|
||||
List<SysDictPage> list = ExcelImportUtil.importExcel(file.getInputStream(), SysDictPage.class, params);
|
||||
// 错误信息
|
||||
List<String> errorMessage = new ArrayList<>();
|
||||
int successLines = 0, errorLines = 0;
|
||||
for (int i=0;i< list.size();i++) {
|
||||
SysDict po = new SysDict();
|
||||
BeanUtils.copyProperties(list.get(i), po);
|
||||
po.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
try {
|
||||
Integer integer = sysDictService.saveMain(po, list.get(i).getSysDictItemList());
|
||||
if(integer>0){
|
||||
successLines++;
|
||||
}else{
|
||||
errorLines++;
|
||||
int lineNumber = i + 1;
|
||||
errorMessage.add("第 " + lineNumber + " 行:字典编码已经存在,忽略导入。");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
errorLines++;
|
||||
int lineNumber = i + 1;
|
||||
errorMessage.add("第 " + lineNumber + " 行:字典编码已经存在,忽略导入。");
|
||||
}
|
||||
}
|
||||
return ImportExcelUtil.imporReturnRes(errorLines,successLines,errorMessage);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Result.error("文件导入失败:"+e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.error("文件导入失败!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询选项内容
|
||||
*
|
||||
*/
|
||||
@GetMapping(value = "/queryDictName")
|
||||
public Result<List<SysDict>> queryDictName(@RequestParam(name = "cut") String cut,SysDict sysDict) {
|
||||
List<SysDict> list =sysDictService.queryDictName(cut,sysDict);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 物理删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deletePhysic/{id}")
|
||||
public Result<?> deletePhysic(@PathVariable String id) {
|
||||
try {
|
||||
sysDictService.deleteOneDictPhysically(id);
|
||||
return Result.OK("删除成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("删除失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取回
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/back/{id}")
|
||||
public Result<?> back(@PathVariable String id) {
|
||||
try {
|
||||
sysDictService.updateDictDelFlag(0,id);
|
||||
return Result.OK("操作成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询出当前用户可配置品牌")
|
||||
@GetMapping(value = "/getBrandDict")
|
||||
public Result<List<DictModel>> getBrandDict() {
|
||||
List<DictModel> dictModels = sysDictService.queryDictItemsByCode(DictCodeEnum.BRAND.getValue());
|
||||
if (!sysUserService.isAdministrator()) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
List<String> brands = projectUserBrandService.queryBrandByUserId(sysUser.getId());
|
||||
dictModels = dictModels.stream().filter(dictModel -> brands.contains(dictModel.getValue())).collect(Collectors.toList());
|
||||
}
|
||||
return Result.OK(dictModels);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取责任领域字典数据
|
||||
* @param dictCode 字典code
|
||||
* @param dictCode 表名,文本字段,code字段 | 举例:sys_user,realname,id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "字典控制器-获取责任领域字典数据", notes = "字典控制器-获取责任领域字典数据")
|
||||
@RequestMapping(value = "/getDutyTerritoryDictItems/{dictCode}", method = RequestMethod.GET)
|
||||
public Result<List<DictModel>> getDutyTerritoryDictItems(@PathVariable String dictCode, @RequestParam(value = "sign",required = false) String sign, HttpServletRequest request) {
|
||||
log.info(" dictCode : "+ dictCode);
|
||||
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
||||
List<DictModel> ls = null;
|
||||
try {
|
||||
if(dictCode.indexOf(",")!=-1) {
|
||||
//关联表字典(举例:sys_user,realname,id)
|
||||
String[] params = dictCode.split(",");
|
||||
|
||||
if(params.length<3) {
|
||||
result.error500("字典Code格式不正确!");
|
||||
return result;
|
||||
}
|
||||
//SQL注入校验(只限制非法串改数据库)
|
||||
final String[] sqlInjCheck = {params[0],params[1],params[2]};
|
||||
SqlInjectionUtil.filterContent(sqlInjCheck);
|
||||
|
||||
if(params.length==4) {
|
||||
//SQL注入校验(查询条件SQL 特殊check,此方法仅供此处使用)
|
||||
SqlInjectionUtil.specialFilterContent(params[3]);
|
||||
ls = sysDictService.queryTableDictItemsByCodeAndFilter(params[0],params[1],params[2],params[3]);
|
||||
}else if (params.length==3) {
|
||||
ls = sysDictService.queryTableDictItemsByCode(params[0],params[1],params[2]);
|
||||
}else{
|
||||
result.error500("字典Code格式不正确!");
|
||||
return result;
|
||||
}
|
||||
}else {
|
||||
//字典表
|
||||
ls = sysDictService.queryDictItemsByCode(dictCode);
|
||||
}
|
||||
|
||||
// 将结果集进行排序
|
||||
if (CollectionUtils.isNotEmpty(ls)) {
|
||||
// 匿名比较器排序
|
||||
Collections.sort(ls, new Comparator<DictModel>() {
|
||||
@Override
|
||||
public int compare(DictModel p1, DictModel p2) {
|
||||
return p1.getText().compareTo(p2.getText());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
result.setSuccess(true);
|
||||
result.setResult(ls);
|
||||
log.debug(result.toString());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
+865
@@ -0,0 +1,865 @@
|
||||
package com.jero.modules.system.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.MD5Util;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.system.entity.SysDepartPermission;
|
||||
import com.jero.modules.system.entity.SysPermission;
|
||||
import com.jero.modules.system.entity.SysPermissionDataRule;
|
||||
import com.jero.modules.system.entity.SysRolePermission;
|
||||
import com.jero.modules.system.enums.SysPermissionEnum;
|
||||
import com.jero.modules.system.mapper.TodoCenterMapper;
|
||||
import com.jero.modules.system.model.SysPermissionTree;
|
||||
import com.jero.modules.system.model.TreeModel;
|
||||
import com.jero.modules.system.service.ISysDepartPermissionService;
|
||||
import com.jero.modules.system.service.ISysPermissionDataRuleService;
|
||||
import com.jero.modules.system.service.ISysPermissionService;
|
||||
import com.jero.modules.system.service.ISysRolePermissionService;
|
||||
import com.jero.modules.system.util.PermissionDataUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 菜单权限表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @Author scott
|
||||
* @since 2018-12-21
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/phone/sys/permission")
|
||||
public class PhoneSysPermissionController {
|
||||
|
||||
@Autowired
|
||||
private ISysPermissionService sysPermissionService;
|
||||
|
||||
@Autowired
|
||||
private ISysRolePermissionService sysRolePermissionService;
|
||||
|
||||
@Autowired
|
||||
private ISysPermissionDataRuleService sysPermissionDataRuleService;
|
||||
|
||||
@Autowired
|
||||
private ISysDepartPermissionService sysDepartPermissionService;
|
||||
|
||||
@Autowired
|
||||
private TodoCenterMapper todoCenterMapper;
|
||||
|
||||
/**
|
||||
* 加载数据节点
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/page", method = RequestMethod.GET)
|
||||
public Result<List<SysPermissionTree>> list() {
|
||||
long start = System.currentTimeMillis();
|
||||
Result<List<SysPermissionTree>> result = new Result<>();
|
||||
try {
|
||||
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
|
||||
query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.orderByAsc(SysPermission::getSortNo);
|
||||
List<SysPermission> list = sysPermissionService.list(query);
|
||||
List<SysPermissionTree> treeList = new ArrayList<>();
|
||||
getTreeList(treeList, list, null);
|
||||
result.setResult(treeList);
|
||||
result.setSuccess(true);
|
||||
log.info("======获取全部菜单数据=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*update_begin author:wuxianquan date:20190908 for:先查询一级菜单,当用户点击展开菜单时加载子菜单 */
|
||||
/**
|
||||
* 系统菜单列表(一级菜单)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getSystemMenuList", method = RequestMethod.GET)
|
||||
public Result<List<SysPermissionTree>> getSystemMenuList() {
|
||||
long start = System.currentTimeMillis();
|
||||
Result<List<SysPermissionTree>> result = new Result<>();
|
||||
try {
|
||||
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
|
||||
query.eq(SysPermission::getMenuType,CommonConstant.MENU_TYPE_0);
|
||||
query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.orderByAsc(SysPermission::getSortNo);
|
||||
List<SysPermission> list = sysPermissionService.list(query);
|
||||
List<SysPermissionTree> sysPermissionTreeList = new ArrayList<SysPermissionTree>();
|
||||
for(SysPermission sysPermission : list){
|
||||
SysPermissionTree sysPermissionTree = new SysPermissionTree(sysPermission);
|
||||
sysPermissionTreeList.add(sysPermissionTree);
|
||||
}
|
||||
result.setResult(sysPermissionTreeList);
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
log.info("======获取一级菜单数据=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询子菜单
|
||||
* @param parentId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getSystemSubmenu", method = RequestMethod.GET)
|
||||
public Result<List<SysPermissionTree>> getSystemSubmenu(@RequestParam("parentId") String parentId){
|
||||
Result<List<SysPermissionTree>> result = new Result<>();
|
||||
try{
|
||||
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
|
||||
query.eq(SysPermission::getParentId,parentId);
|
||||
query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.orderByAsc(SysPermission::getSortNo);
|
||||
List<SysPermission> list = sysPermissionService.list(query);
|
||||
List<SysPermissionTree> sysPermissionTreeList = new ArrayList<SysPermissionTree>();
|
||||
for(SysPermission sysPermission : list){
|
||||
SysPermissionTree sysPermissionTree = new SysPermissionTree(sysPermission);
|
||||
sysPermissionTreeList.add(sysPermissionTree);
|
||||
}
|
||||
result.setResult(sysPermissionTreeList);
|
||||
result.setSuccess(true);
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/*update_end author:wuxianquan date:20190908 for:先查询一级菜单,当用户点击展开菜单时加载子菜单 */
|
||||
|
||||
// update_begin author:sunjianlei date:20200108 for: 新增批量根据父ID查询子级菜单的接口 -------------
|
||||
/**
|
||||
* 查询子菜单
|
||||
*
|
||||
* @param parentIds 父ID(多个采用半角逗号分割)
|
||||
* @return 返回 key-value 的 Map
|
||||
*/
|
||||
@GetMapping("/getSystemSubmenuBatch")
|
||||
public Result getSystemSubmenuBatch(@RequestParam("parentIds") String parentIds) {
|
||||
try {
|
||||
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<>();
|
||||
List<String> parentIdList = Arrays.asList(parentIds.split(","));
|
||||
query.in(SysPermission::getParentId, parentIdList);
|
||||
query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.orderByAsc(SysPermission::getSortNo);
|
||||
List<SysPermission> list = sysPermissionService.list(query);
|
||||
Map<String, List<SysPermissionTree>> listMap = new HashMap<>();
|
||||
for (SysPermission item : list) {
|
||||
String pid = item.getParentId();
|
||||
if (parentIdList.contains(pid)) {
|
||||
List<SysPermissionTree> mapList = listMap.get(pid);
|
||||
if (mapList == null) {
|
||||
mapList = new ArrayList<>();
|
||||
}
|
||||
mapList.add(new SysPermissionTree(item));
|
||||
listMap.put(pid, mapList);
|
||||
}
|
||||
}
|
||||
return Result.OK(listMap);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error("批量查询子菜单失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
// update_end author:sunjianlei date:20200108 for: 新增批量根据父ID查询子级菜单的接口 -------------
|
||||
|
||||
// /**
|
||||
// * 查询用户拥有的菜单权限和按钮权限(根据用户账号)
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @RequestMapping(value = "/queryByUser", method = RequestMethod.GET)
|
||||
// public Result<JSONArray> queryByUser(HttpServletRequest req) {
|
||||
// Result<JSONArray> result = new Result<>();
|
||||
// try {
|
||||
// String username = req.getParameter("username");
|
||||
// List<SysPermission> metaList = sysPermissionService.queryByUser(username);
|
||||
// JSONArray jsonArray = new JSONArray();
|
||||
// this.getPermissionJsonArray(jsonArray, metaList, null);
|
||||
// result.setResult(jsonArray);
|
||||
// result.success("查询成功");
|
||||
// } catch (Exception e) {
|
||||
// result.error500("查询失败:" + e.getMessage());
|
||||
// log.error(e.getMessage(), e);
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 查询用户拥有的菜单权限和按钮权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getUserPermissionByToken", method = RequestMethod.GET)
|
||||
public Result<?> getUserPermissionByToken(String cut) {
|
||||
Result<JSONObject> result = new Result<JSONObject>();
|
||||
try {
|
||||
//直接获取当前用户不适用前端token
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if (oConvertUtils.isEmpty(loginUser)) {
|
||||
return Result.error("请登录系统!");
|
||||
}
|
||||
List<SysPermission> metaList = sysPermissionService.queryByUser(loginUser.getUsername());
|
||||
//添加首页路由
|
||||
//update-begin-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
|
||||
if(!PermissionDataUtil.hasIndexPage(metaList)){
|
||||
SysPermission indexMenu = sysPermissionService.list(new LambdaQueryWrapper<SysPermission>().eq(SysPermission::getName,"首页")).get(0);
|
||||
metaList.add(0,indexMenu);
|
||||
}
|
||||
//update-end-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存
|
||||
JSONObject json = new JSONObject();
|
||||
JSONArray menujsonArray = new JSONArray();
|
||||
this.getPermissionJsonArray(menujsonArray, metaList, null,cut);
|
||||
JSONArray authjsonArray = new JSONArray();
|
||||
this.getAuthJsonArray(authjsonArray, metaList);
|
||||
//查询所有的权限
|
||||
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
|
||||
query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.eq(SysPermission::getMenuType, CommonConstant.MENU_TYPE_2);
|
||||
//query.eq(SysPermission::getStatus, "1");
|
||||
List<SysPermission> allAuthList = sysPermissionService.list(query);
|
||||
JSONArray allauthjsonArray = new JSONArray();
|
||||
this.getAllAuthJsonArray(allauthjsonArray, allAuthList);
|
||||
//路由菜单
|
||||
json.put("menu", menujsonArray);
|
||||
//按钮权限(用户拥有的权限集合)
|
||||
json.put("auth", authjsonArray);
|
||||
//全部权限配置集合(按钮权限,访问权限)
|
||||
json.put("allAuth", allauthjsonArray);
|
||||
result.setResult(json);
|
||||
result.success("查询成功");
|
||||
} catch (Exception e) {
|
||||
result.error500("查询失败:" + e.getMessage());
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加菜单
|
||||
* @param permission
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({ "admin" })
|
||||
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
||||
public Result<SysPermission> add(@RequestBody SysPermission permission) {
|
||||
Result<SysPermission> result = new Result<SysPermission>();
|
||||
try {
|
||||
permission = PermissionDataUtil.intelligentProcessData(permission);
|
||||
sysPermissionService.addPermission(permission);
|
||||
result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑菜单
|
||||
* @param permission
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({ "admin" })
|
||||
@RequestMapping(value = "/edit", method = { RequestMethod.PUT, RequestMethod.POST })
|
||||
public Result<SysPermission> edit(@RequestBody SysPermission permission) {
|
||||
Result<SysPermission> result = new Result<>();
|
||||
try {
|
||||
permission = PermissionDataUtil.intelligentProcessData(permission);
|
||||
sysPermissionService.editPermission(permission);
|
||||
result.success("修改成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({ "admin" })
|
||||
@RequestMapping(value = "/delete", method = RequestMethod.DELETE)
|
||||
public Result<SysPermission> delete(@RequestParam(name = "id", required = true) String id) {
|
||||
Result<SysPermission> result = new Result<>();
|
||||
try {
|
||||
sysPermissionService.deletePermission(id);
|
||||
result.success("删除成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
result.error500(e.getMessage());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除菜单
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({ "admin" })
|
||||
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
|
||||
public Result<SysPermission> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
Result<SysPermission> result = new Result<>();
|
||||
try {
|
||||
String[] arr = ids.split(",");
|
||||
for (String id : arr) {
|
||||
if (oConvertUtils.isNotEmpty(id)) {
|
||||
sysPermissionService.deletePermission(id);
|
||||
}
|
||||
}
|
||||
result.success("删除成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
result.error500("删除成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部的权限树
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryTreeList", method = RequestMethod.GET)
|
||||
public Result<Map<String, Object>> queryTreeList() {
|
||||
Result<Map<String, Object>> result = new Result<>();
|
||||
// 全部权限ids
|
||||
List<String> ids = new ArrayList<>();
|
||||
try {
|
||||
LambdaQueryWrapper<SysPermission> query = new LambdaQueryWrapper<SysPermission>();
|
||||
query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0);
|
||||
query.orderByAsc(SysPermission::getSortNo);
|
||||
List<SysPermission> list = sysPermissionService.list(query);
|
||||
for (SysPermission sysPer : list) {
|
||||
ids.add(sysPer.getId());
|
||||
}
|
||||
List<TreeModel> treeList = new ArrayList<>();
|
||||
getTreeModelList(treeList, list, null);
|
||||
|
||||
Map<String, Object> resMap = new HashMap<String, Object>();
|
||||
resMap.put("treeList", treeList); // 全部树节点数据
|
||||
resMap.put("ids", ids);// 全部树ids
|
||||
result.setResult(resMap);
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步加载数据节点
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryListAsync", method = RequestMethod.GET)
|
||||
public Result<List<TreeModel>> queryAsync(@RequestParam(name = "pid", required = false) String parentId) {
|
||||
Result<List<TreeModel>> result = new Result<>();
|
||||
try {
|
||||
List<TreeModel> list = sysPermissionService.queryListByParentId(parentId);
|
||||
if (list == null || list.size() <= 0) {
|
||||
result.error500("未找到角色信息");
|
||||
} else {
|
||||
result.setResult(list);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询角色授权
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:role:auth")
|
||||
@RequestMapping(value = "/queryRolePermission", method = RequestMethod.GET)
|
||||
public Result<List<String>> queryRolePermission(@RequestParam(name = "roleId", required = true) String roleId) {
|
||||
Result<List<String>> result = new Result<>();
|
||||
try {
|
||||
List<SysRolePermission> list = sysRolePermissionService.list(new QueryWrapper<SysRolePermission>().lambda().eq(SysRolePermission::getRoleId, roleId));
|
||||
result.setResult(list.stream().map(SysRolePermission -> String.valueOf(SysRolePermission.getPermissionId())).collect(Collectors.toList()));
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存角色授权
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:role:auth")
|
||||
@RequestMapping(value = "/saveRolePermission", method = RequestMethod.POST)
|
||||
//@RequiresRoles({ "admin" })
|
||||
public Result<String> saveRolePermission(@RequestBody JSONObject json) {
|
||||
long start = System.currentTimeMillis();
|
||||
Result<String> result = new Result<>();
|
||||
try {
|
||||
String roleId = json.getString("roleId");
|
||||
String permissionIds = json.getString("permissionIds");
|
||||
String lastPermissionIds = json.getString("lastpermissionIds");
|
||||
this.sysRolePermissionService.saveRolePermission(roleId, permissionIds, lastPermissionIds);
|
||||
result.success("保存成功!");
|
||||
log.info("======角色授权成功=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
} catch (Exception e) {
|
||||
result.error500("授权失败!");
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private void getTreeList(List<SysPermissionTree> treeList, List<SysPermission> metaList, SysPermissionTree temp) {
|
||||
for (SysPermission permission : metaList) {
|
||||
String tempPid = permission.getParentId();
|
||||
SysPermissionTree tree = new SysPermissionTree(permission);
|
||||
if (temp == null && oConvertUtils.isEmpty(tempPid)) {
|
||||
treeList.add(tree);
|
||||
if (!tree.getIsLeaf()) {
|
||||
getTreeList(treeList, metaList, tree);
|
||||
}
|
||||
} else if (temp != null && tempPid != null && tempPid.equals(temp.getId())) {
|
||||
temp.getChildren().add(tree);
|
||||
if (!tree.getIsLeaf()) {
|
||||
getTreeList(treeList, metaList, tree);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void getTreeModelList(List<TreeModel> treeList, List<SysPermission> metaList, TreeModel temp) {
|
||||
for (SysPermission permission : metaList) {
|
||||
String tempPid = permission.getParentId();
|
||||
TreeModel tree = new TreeModel(permission);
|
||||
if (temp == null && oConvertUtils.isEmpty(tempPid)) {
|
||||
treeList.add(tree);
|
||||
if (!tree.getIsLeaf()) {
|
||||
getTreeModelList(treeList, metaList, tree);
|
||||
}
|
||||
} else if (temp != null && tempPid != null && tempPid.equals(temp.getKey())) {
|
||||
temp.getChildren().add(tree);
|
||||
if (!tree.getIsLeaf()) {
|
||||
getTreeModelList(treeList, metaList, tree);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限JSON数组
|
||||
* @param jsonArray
|
||||
* @param allList
|
||||
*/
|
||||
private void getAllAuthJsonArray(JSONArray jsonArray,List<SysPermission> allList) {
|
||||
JSONObject json = null;
|
||||
for (SysPermission permission : allList) {
|
||||
json = new JSONObject();
|
||||
json.put("action", permission.getPerms());
|
||||
json.put("status", permission.getStatus());
|
||||
//1显示2禁用
|
||||
json.put("type", permission.getPermsType());
|
||||
json.put("describe", permission.getName());
|
||||
jsonArray.add(json);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取权限JSON数组
|
||||
* @param jsonArray
|
||||
* @param metaList
|
||||
*/
|
||||
private void getAuthJsonArray(JSONArray jsonArray,List<SysPermission> metaList) {
|
||||
for (SysPermission permission : metaList) {
|
||||
if(permission.getMenuType()==null) {
|
||||
continue;
|
||||
}
|
||||
JSONObject json = null;
|
||||
if(permission.getMenuType().equals(CommonConstant.MENU_TYPE_2) &&CommonConstant.STATUS_1.equals(permission.getStatus())) {
|
||||
json = new JSONObject();
|
||||
json.put("action", permission.getPerms());
|
||||
json.put("type", permission.getPermsType());
|
||||
json.put("describe", permission.getName());
|
||||
jsonArray.add(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 获取菜单JSON数组
|
||||
* @param jsonArray
|
||||
* @param metaList
|
||||
* @param parentJson
|
||||
*/
|
||||
private void getPermissionJsonArray(JSONArray jsonArray, List<SysPermission> metaList, JSONObject parentJson,String cut) {
|
||||
for (SysPermission permission : metaList) {
|
||||
if (permission.getMenuType() == null) {
|
||||
continue;
|
||||
}
|
||||
String tempPid = permission.getParentId();
|
||||
JSONObject json = getPermissionJsonObject(permission,cut);
|
||||
if(json==null) {
|
||||
continue;
|
||||
}
|
||||
if (parentJson == null && oConvertUtils.isEmpty(tempPid)) {
|
||||
jsonArray.add(json);
|
||||
if (!permission.isLeaf()) {
|
||||
getPermissionJsonArray(jsonArray, metaList, json,cut);
|
||||
}
|
||||
} else if (parentJson != null && oConvertUtils.isNotEmpty(tempPid) && tempPid.equals(parentJson.getString("id"))) {
|
||||
// 类型( 0:一级菜单 1:子菜单 2:按钮 )
|
||||
if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_2)) {
|
||||
JSONObject metaJson = parentJson.getJSONObject("meta");
|
||||
if (metaJson.containsKey("permissionList")) {
|
||||
metaJson.getJSONArray("permissionList").add(json);
|
||||
} else {
|
||||
JSONArray permissionList = new JSONArray();
|
||||
permissionList.add(json);
|
||||
metaJson.put("permissionList", permissionList);
|
||||
}
|
||||
// 类型( 0:一级菜单 1:子菜单 2:按钮 )
|
||||
} else if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_1) || permission.getMenuType().equals(CommonConstant.MENU_TYPE_0)) {
|
||||
if (parentJson.containsKey("children")) {
|
||||
parentJson.getJSONArray("children").add(json);
|
||||
} else {
|
||||
JSONArray children = new JSONArray();
|
||||
children.add(json);
|
||||
parentJson.put("children", children);
|
||||
}
|
||||
|
||||
if (!permission.isLeaf()) {
|
||||
getPermissionJsonArray(jsonArray, metaList, json,cut);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据菜单配置生成路由json
|
||||
* @param permission
|
||||
* @return
|
||||
*/
|
||||
private JSONObject getPermissionJsonObject(SysPermission permission,String cut) {
|
||||
JSONObject json = new JSONObject();
|
||||
// 类型(0:一级菜单 1:子菜单 2:按钮)
|
||||
if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_2)) {
|
||||
//json.put("action", permission.getPerms());
|
||||
//json.put("type", permission.getPermsType());
|
||||
//json.put("describe", permission.getName());
|
||||
return null;
|
||||
} else if (permission.getMenuType().equals(CommonConstant.MENU_TYPE_0) || permission.getMenuType().equals(CommonConstant.MENU_TYPE_1)) {
|
||||
json.put("id", permission.getId());
|
||||
if (permission.isRoute()) {
|
||||
json.put("route", "1");// 表示生成路由
|
||||
} else {
|
||||
json.put("route", "0");// 表示不生成路由
|
||||
}
|
||||
|
||||
if (isWWWHttpUrl(permission.getUrl())) {
|
||||
json.put("path", MD5Util.MD5Encode(permission.getUrl(), "utf-8"));
|
||||
} else {
|
||||
json.put("path", permission.getUrl());
|
||||
}
|
||||
|
||||
// 重要规则:路由name (通过URL生成路由name,路由name供前端开发,页面跳转使用)
|
||||
if (oConvertUtils.isNotEmpty(permission.getComponentName())) {
|
||||
json.put("name", permission.getComponentName());
|
||||
} else {
|
||||
json.put("name", urlToRouteName(permission.getUrl()));
|
||||
}
|
||||
|
||||
// 是否隐藏路由,默认都是显示的
|
||||
if (permission.isHidden()) {
|
||||
json.put("hidden", true);
|
||||
}
|
||||
// 聚合路由
|
||||
if (permission.isAlwaysShow()) {
|
||||
json.put("alwaysShow", true);
|
||||
}
|
||||
json.put("component", permission.getComponent());
|
||||
JSONObject meta = new JSONObject();
|
||||
// 由用户设置是否缓存页面 用布尔值
|
||||
if (permission.isKeepAlive()) {
|
||||
meta.put("keepAlive", true);
|
||||
} else {
|
||||
meta.put("keepAlive", false);
|
||||
}
|
||||
|
||||
/*update_begin author:wuxianquan date:20190908 for:往菜单信息里添加外链菜单打开方式 */
|
||||
//外链菜单打开方式
|
||||
if (permission.isInternalOrExternal()) {
|
||||
meta.put("internalOrExternal", true);
|
||||
} else {
|
||||
meta.put("internalOrExternal", false);
|
||||
}
|
||||
/* update_end author:wuxianquan date:20190908 for: 往菜单信息里添加外链菜单打开方式*/
|
||||
|
||||
if(CutEnum.EN.getValue().equals(cut)){
|
||||
meta.put("title", permission.getMenuEn());
|
||||
}else{
|
||||
meta.put("title", permission.getName());
|
||||
}
|
||||
|
||||
//update-begin--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
|
||||
String component = permission.getComponent();
|
||||
if(oConvertUtils.isNotEmpty(permission.getComponentName()) || oConvertUtils.isNotEmpty(component)){
|
||||
meta.put("componentName", oConvertUtils.getString(permission.getComponentName(),component.substring(component.lastIndexOf("/")+1)));
|
||||
}
|
||||
//update-end--Author:scott Date:20201015 for:路由缓存问题,关闭了tab页时再打开就不刷新 #842
|
||||
|
||||
if (oConvertUtils.isEmpty(permission.getParentId())) {
|
||||
// 一级菜单跳转地址
|
||||
json.put("redirect", permission.getRedirect());
|
||||
if (oConvertUtils.isNotEmpty(permission.getIcon())) {
|
||||
meta.put("icon", permission.getIcon());
|
||||
}
|
||||
} else {
|
||||
if (oConvertUtils.isNotEmpty(permission.getIcon())) {
|
||||
meta.put("icon", permission.getIcon());
|
||||
}
|
||||
}
|
||||
if (isWWWHttpUrl(permission.getUrl())) {
|
||||
meta.put("url", permission.getUrl());
|
||||
}
|
||||
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("currentUserId",currentUser.getId());
|
||||
|
||||
List<String> flowTypeList = new ArrayList<>();
|
||||
//项目法规任务
|
||||
if(StringUtils.equals(permission.getId(), SysPermissionEnum.PROJECT_REGULATION_TASKS.getId())){
|
||||
flowTypeList.add("1");
|
||||
flowTypeList.add("2");
|
||||
flowTypeList.add("3");
|
||||
flowTypeList.add("4");
|
||||
flowTypeList.add("10");
|
||||
flowTypeList.add("21");
|
||||
params.put("flowTypeList",flowTypeList);
|
||||
//存在待办任务标识,true为有
|
||||
boolean existTaskFlag = false;
|
||||
int result = todoCenterMapper.todoCenterTaskCount(params);
|
||||
if(result > 0){
|
||||
existTaskFlag = true;
|
||||
}
|
||||
//查询当前登录用户是否有项目法规任务
|
||||
meta.put("existTask",existTaskFlag);
|
||||
}
|
||||
//法规评估任务
|
||||
if(StringUtils.equals(permission.getId(), SysPermissionEnum.REGULATORY_ASSESSMENT_TASKS.getId())){
|
||||
flowTypeList.add("5");
|
||||
flowTypeList.add("6");
|
||||
params.put("flowTypeList",flowTypeList);
|
||||
int result = todoCenterMapper.todoCenterTaskCount(params);
|
||||
boolean existTaskFlag = false;
|
||||
if(result > 0){
|
||||
existTaskFlag = true;
|
||||
}
|
||||
meta.put("existTask",existTaskFlag);
|
||||
}
|
||||
//项目参数任务
|
||||
if(StringUtils.equals(permission.getId(), SysPermissionEnum.PROJECT_PARAMETER_TASKS.getId())){
|
||||
boolean existTaskFlag = false;
|
||||
existTaskFlag = sysPermissionService.judgeToDo();
|
||||
meta.put("existTask",existTaskFlag);
|
||||
}
|
||||
json.put("meta", meta);
|
||||
}
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否外网URL 例如: http://localhost:8080/jero-boot/swagger-ui.html#/ 支持特殊格式: {{
|
||||
* window._CONFIG['domianURL'] }}/druid/ {{ JS代码片段 }},前台解析会自动执行JS代码片段
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean isWWWHttpUrl(String url) {
|
||||
if (url != null && (url.startsWith("http://") || url.startsWith("https://") || url.startsWith("{{"))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过URL生成路由name(去掉URL前缀斜杠,替换内容中的斜杠‘/’为-) 举例: URL = /isystem/role RouteName =
|
||||
* isystem-role
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private String urlToRouteName(String url) {
|
||||
if (oConvertUtils.isNotEmpty(url)) {
|
||||
if (url.startsWith("/")) {
|
||||
url = url.substring(1);
|
||||
}
|
||||
url = url.replace("/", "-");
|
||||
|
||||
// 特殊标记
|
||||
url = url.replace(":", "@");
|
||||
return url;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据菜单id来获取其对应的权限数据
|
||||
*
|
||||
* @param sysPermissionDataRule
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getPermRuleListByPermId", method = RequestMethod.GET)
|
||||
public Result<List<SysPermissionDataRule>> getPermRuleListByPermId(SysPermissionDataRule sysPermissionDataRule) {
|
||||
List<SysPermissionDataRule> permRuleList = sysPermissionDataRuleService.getPermRuleListByPermId(sysPermissionDataRule.getPermissionId());
|
||||
Result<List<SysPermissionDataRule>> result = new Result<>();
|
||||
result.setSuccess(true);
|
||||
result.setResult(permRuleList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加菜单权限数据
|
||||
*
|
||||
* @param sysPermissionDataRule
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({ "admin" })
|
||||
@RequestMapping(value = "/addPermissionRule", method = RequestMethod.POST)
|
||||
public Result<SysPermissionDataRule> addPermissionRule(@RequestBody SysPermissionDataRule sysPermissionDataRule) {
|
||||
Result<SysPermissionDataRule> result = new Result<SysPermissionDataRule>();
|
||||
try {
|
||||
sysPermissionDataRule.setCreateTime(new Date());
|
||||
sysPermissionDataRuleService.savePermissionDataRule(sysPermissionDataRule);
|
||||
result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//@RequiresRoles({ "admin" })
|
||||
@RequestMapping(value = "/editPermissionRule", method = { RequestMethod.PUT, RequestMethod.POST })
|
||||
public Result<SysPermissionDataRule> editPermissionRule(@RequestBody SysPermissionDataRule sysPermissionDataRule) {
|
||||
Result<SysPermissionDataRule> result = new Result<SysPermissionDataRule>();
|
||||
try {
|
||||
sysPermissionDataRuleService.saveOrUpdate(sysPermissionDataRule);
|
||||
result.success("更新成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除菜单权限数据
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@RequiresRoles({ "admin" })
|
||||
@RequestMapping(value = "/deletePermissionRule", method = RequestMethod.DELETE)
|
||||
public Result<SysPermissionDataRule> deletePermissionRule(@RequestParam(name = "id", required = true) String id) {
|
||||
Result<SysPermissionDataRule> result = new Result<SysPermissionDataRule>();
|
||||
try {
|
||||
sysPermissionDataRuleService.deletePermissionDataRule(id);
|
||||
result.success("删除成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询菜单权限数据
|
||||
*
|
||||
* @param sysPermissionDataRule
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryPermissionRule", method = RequestMethod.GET)
|
||||
public Result<List<SysPermissionDataRule>> queryPermissionRule(SysPermissionDataRule sysPermissionDataRule) {
|
||||
Result<List<SysPermissionDataRule>> result = new Result<>();
|
||||
try {
|
||||
List<SysPermissionDataRule> permRuleList = sysPermissionDataRuleService.queryPermissionRule(sysPermissionDataRule);
|
||||
result.setResult(permRuleList);
|
||||
result.success("查询成功!");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 部门权限表
|
||||
* @param departId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/queryDepartPermission", method = RequestMethod.GET)
|
||||
public Result<List<String>> queryDepartPermission(@RequestParam(name = "departId", required = true) String departId) {
|
||||
Result<List<String>> result = new Result<>();
|
||||
try {
|
||||
List<SysDepartPermission> list = sysDepartPermissionService.list(new QueryWrapper<SysDepartPermission>().lambda().eq(SysDepartPermission::getDepartId, departId));
|
||||
result.setResult(list.stream().map(SysDepartPermission -> String.valueOf(SysDepartPermission.getPermissionId())).collect(Collectors.toList()));
|
||||
result.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存部门授权
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/saveDepartPermission", method = RequestMethod.POST)
|
||||
//@RequiresRoles({ "admin" })
|
||||
public Result<String> saveDepartPermission(@RequestBody JSONObject json) {
|
||||
long start = System.currentTimeMillis();
|
||||
Result<String> result = new Result<>();
|
||||
try {
|
||||
String departId = json.getString("departId");
|
||||
String permissionIds = json.getString("permissionIds");
|
||||
String lastPermissionIds = json.getString("lastpermissionIds");
|
||||
this.sysDepartPermissionService.saveDepartPermission(departId, permissionIds, lastPermissionIds);
|
||||
result.success("保存成功!");
|
||||
log.info("======部门授权成功=====耗时:" + (System.currentTimeMillis() - start) + "毫秒");
|
||||
} catch (Exception e) {
|
||||
result.error500("授权失败!");
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
package com.jero.modules.collection.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.collection.entity.OnlCgformCollection;
|
||||
import com.jero.modules.collection.service.IOnlCgformCollectionService;
|
||||
import com.jero.modules.document.controller.BussDocumentLibraryEOController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 我的收藏
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="我的收藏")
|
||||
@RestController
|
||||
@RequestMapping("/phone/collection/onlCgformCollection")
|
||||
@Slf4j
|
||||
public class PhoneOnlCgformCollectionController extends JeroController<OnlCgformCollection, IOnlCgformCollectionService> {
|
||||
@Autowired
|
||||
private IOnlCgformCollectionService onlCgformCollectionService;
|
||||
@Autowired
|
||||
BussDocumentLibraryEOController bussDocumentLibraryEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-分页列表查询")
|
||||
@ApiOperation(value="我的收藏-分页列表查询", notes="我的收藏-分页列表查询")
|
||||
@PostMapping(value = "/page")
|
||||
public Result<?> queryPageList(@RequestBody Map<String,Object> params){
|
||||
IPage<OnlCgformCollection> pageList = onlCgformCollectionService.queryPageList(params);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-列表查询")
|
||||
@ApiOperation(value="我的收藏-列表查询", notes="我的收藏-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<OnlCgformCollection>> queryList(OnlCgformCollection onlCgformCollection) {
|
||||
List<OnlCgformCollection> list = onlCgformCollectionService.queryList(onlCgformCollection);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param onlCgformCollection
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-添加")
|
||||
@ApiOperation(value="我的收藏-添加", notes="我的收藏-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody OnlCgformCollection onlCgformCollection) {
|
||||
LambdaQueryWrapper<OnlCgformCollection> lambdaQueryWrapper= new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(OnlCgformCollection::getId,onlCgformCollection.getDocumentId())
|
||||
.eq(OnlCgformCollection::getDocumentId,onlCgformCollection.getDocumentId());
|
||||
int count=onlCgformCollectionService.count(lambdaQueryWrapper);
|
||||
if(count==0){
|
||||
onlCgformCollectionService.add(onlCgformCollection);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
else{
|
||||
return Result.error("该值不可重复添加,系统中已存在!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-通过id删除")
|
||||
@ApiOperation(value="我的收藏-通过id删除", notes="我的收藏-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
onlCgformCollectionService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-批量删除")
|
||||
@ApiOperation(value="我的收藏-批量删除", notes="我的收藏-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.onlCgformCollectionService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-通过id查询")
|
||||
@ApiOperation(value="我的收藏-通过id查询", notes="我的收藏-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
OnlCgformCollection onlCgformCollection = onlCgformCollectionService.queryById(id);
|
||||
if(onlCgformCollection==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(onlCgformCollection);
|
||||
}
|
||||
|
||||
/**
|
||||
* 表头中英文切换
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-表头中英文切换")
|
||||
@ApiOperation(value="我的收藏-表头中英文切换", notes="我的收藏-表头中英文切换")
|
||||
@GetMapping(value = "/getHeader")
|
||||
public Result<List<Map<String, Object>>> getHeader(@RequestParam(name = "flag") String flag,
|
||||
@RequestParam(name = "cut") String cut) {
|
||||
List<Map<String, Object>> list =onlCgformCollectionService.getHeader(flag, cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件中英文切换
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-查询条件中英文切换")
|
||||
@ApiOperation(value="我的收藏-查询条件中英文切换", notes="我的收藏-查询条件中英文切换")
|
||||
@GetMapping(value = "/queryCondition")
|
||||
public Result<List<Map<String, Object>>> queryCondition(@RequestParam(name = "flag") String flag,
|
||||
@RequestParam(name = "cut") String cut) {
|
||||
List<Map<String, Object>> list = onlCgformCollectionService.queryCondition(flag, cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
}
|
||||
+526
@@ -0,0 +1,526 @@
|
||||
package com.jero.modules.document.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.entity.OSSFileForDocumentLibrary;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档库信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-01-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="文档库信息表")
|
||||
@RestController
|
||||
@RequestMapping("/phone/document/bussDocumentLibraryEO")
|
||||
@Slf4j
|
||||
public class PhoneBussDocumentLibraryEOController extends JeroController<BussDocumentLibraryEO, IBussDocumentLibraryEOService> {
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @param parameter
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "分页查询")
|
||||
@ApiOperation(value="分页查询", notes="分页查询")
|
||||
@PostMapping(value = "/queryPageInfo")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("document:queryPageInfo")
|
||||
public JSONObject queryPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = bussDocumentLibraryEOService.getInfoPage(parameter);
|
||||
Result<IPage> ok = Result.OK(infoPage);
|
||||
JSONObject jsonResult = JSONObject.fromObject(ok);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 代替标准分页列表查询
|
||||
* @param parameter
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "代替标准分页列表查询")
|
||||
@ApiOperation(value="代替标准分页列表查询", notes="代替标准分页列表查询")
|
||||
@PostMapping(value = "/replacePageInfo")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("document:getInfoById")
|
||||
public Result<?> replacePageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = bussDocumentLibraryEOService.replacePageInfo(parameter);
|
||||
// Result<IPage> ok = Result.OK(infoPage);
|
||||
// JSONObject jsonResult = JSONObject.fromObject(ok);
|
||||
return Result.OK(infoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* ocr识别调取已入库文件
|
||||
* @param parameter
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "ocr识别调取已入库文件分页")
|
||||
@ApiOperation(value="ocr识别调取已入库文件", notes="ocr识别调取已入库文件")
|
||||
@PostMapping(value = "/ocrPageInfo")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("document:ocrPageInfo")
|
||||
public Result<?> ocrPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
|
||||
return Result.OK(infoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档翻译调取已入库文件
|
||||
* @param parameter
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档翻译调取已入库文件")
|
||||
@ApiOperation(value="文档翻译调取已入库文件", notes="文档翻译调取已入库文件")
|
||||
@PostMapping(value = "/transPageInfo")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("documentTranslation:retrieval")
|
||||
public Result<?> transPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
|
||||
return Result.OK(infoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-列表查询")
|
||||
@ApiOperation(value="文档库信息表-列表查询", notes="文档库信息表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<BussDocumentLibraryEO>> queryList() {
|
||||
List<BussDocumentLibraryEO> list = bussDocumentLibraryEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-通过id删除")
|
||||
@ApiOperation(value="文档库信息表-通过id删除", notes="文档库信息表-通过id删除")
|
||||
@GetMapping(value = "/delete")
|
||||
@RequiresPermissions("document:deleteBatch")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
bussDocumentLibraryEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-批量删除")
|
||||
@ApiOperation(value="文档库信息表-批量删除", notes="文档库信息表-批量删除")
|
||||
@GetMapping(value = "/deleteBatch")
|
||||
@RequiresPermissions("document:deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids,String cut) {
|
||||
this.bussDocumentLibraryEOService.deleteByIds(Arrays.asList(ids.split(",")),cut);
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-通过id查询")
|
||||
@ApiOperation(value="文档库信息表-通过id查询", notes="文档库信息表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
@RequiresPermissions("document:queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(id);
|
||||
if(bussDocumentLibraryEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(bussDocumentLibraryEO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 列表查询条件 标识传 1-->用于查询文档库字段属性
|
||||
* @param flag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-查询条件")
|
||||
@ApiOperation(value="文档库信息表-查询条件", notes="文档库信息表-查询条件")
|
||||
@GetMapping(value = "/queryCondition")
|
||||
@RequiresPermissions("document:queryPageInfo")
|
||||
public Result<List<Map<String,Object>>> queryCondition(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String,Object>> list = bussDocumentLibraryEOService.queryCondition(flag,cut,null);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表表头
|
||||
* @param flag 标识传 1-->用于查询文档库字段属性
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-列表表头")
|
||||
@ApiOperation(value="文档库信息表-列表表头", notes="文档库信息表-列表表头")
|
||||
@GetMapping(value = "/getHeader")
|
||||
@RequiresPermissions("document:queryPageInfo")
|
||||
public Result<List<Map<String,Object>>> getHeader(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String,Object>> list = bussDocumentLibraryEOService.getHeader(flag,cut,null);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增表单
|
||||
* @param flag 标识传 1-->用于查询文档库字段属性
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-新增表单")
|
||||
@ApiOperation(value="文档库信息表-新增表单", notes="文档库信息表-新增表单")
|
||||
@GetMapping(value = "/getAddForm")
|
||||
@RequiresPermissions("document:queryPageInfo")
|
||||
public Result<List<Map<String,Object>>> getAddForm(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut,
|
||||
@RequestParam(name="type",required=true) String type) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getAddForm(flag,cut,type);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* ocr识别调取已入库文件-中英文切换
|
||||
* @param flag 标识传 1-->用于查询文档库字段属性
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-ocr表头和查询条件")
|
||||
@ApiOperation(value="文档库信息表-ocr表头和查询条件", notes="文档库信息表-ocr表头和查询条件")
|
||||
@GetMapping(value = "/getHeaderOrConditionForOcr")
|
||||
@RequiresPermissions("document:ocrPageInfo")
|
||||
public Result<List<Map<String,Object>>> getHeaderOrConditionForOcr(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForOcr(flag,cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param flag 标识传 1-->用于查询文档库字段属性
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-文档拆分表头和查询条件")
|
||||
@ApiOperation(value="文档库信息表-文档拆分表头和查询条件", notes="文档库信息表-文档拆分表头和查询条件")
|
||||
@GetMapping(value = "/getHeaderOrConditionForSplitFile")
|
||||
@RequiresPermissions("split:sarFileSplitInfo:splitFile")
|
||||
public Result<List<Map<String,Object>>> getHeaderOrConditionForSplitFile(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForSplit(flag,cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* ocr识别调取已入库文件-中英文切换
|
||||
* @param flag 标识传 1-->用于查询文档库字段属性
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-文档拆分表头和查询条件")
|
||||
@ApiOperation(value="文档库信息表-文档拆分表头和查询条件", notes="文档库信息表-文档拆分表头和查询条件")
|
||||
@GetMapping(value = "/getHeaderOrConditionForSplitResult")
|
||||
@RequiresPermissions("split:sarFileSplitInfo:splitResult")
|
||||
public Result<List<Map<String,Object>>> getHeaderOrConditionForSplitResult(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForSplit(flag,cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑数据查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "编辑数据查询")
|
||||
@ApiOperation(value="编辑数据查询", notes="编辑数据查询")
|
||||
@GetMapping(value = "/getDocumentInfoById")
|
||||
@RequiresPermissions("document:updateInfo")
|
||||
public Result<List<Map<String,Object>>> getDocumentInfoById(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getDocumentInfoById(id,cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
/**
|
||||
* 详情数据查询
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "详情数据查询")
|
||||
@ApiOperation(value="详情数据查询", notes="详情数据查询")
|
||||
@GetMapping(value = "/getInfoById")
|
||||
@RequiresPermissions("document:queryPageInfo")
|
||||
public Result<List<Map<String,Object>>> getInfoById(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getInfoById(id,cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value="详情目录查询", notes="详情目录查询")
|
||||
@GetMapping(value = "/getMenuList")
|
||||
public Result<List<Map<String,Object>>> getMenuList(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getMenuList(id,cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "新增数据")
|
||||
@ApiOperation(value="新增数据", notes="新增数据")
|
||||
@PostMapping(value = "/addInfo")
|
||||
@RequiresPermissions("document:getInfoById")
|
||||
public Result<?> getInfoById(@RequestBody Map<String,Object> map) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.addInfo(map);
|
||||
} catch (Exception e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
return Result.OK("新增成功");
|
||||
}
|
||||
/**
|
||||
* 编辑数据
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "编辑数据")
|
||||
@ApiOperation(value="编辑数据", notes="编辑数据")
|
||||
@PostMapping(value = "/updateInfo")
|
||||
@RequiresPermissions("document:updateInfo")
|
||||
public Result<?> updateInfo(@RequestBody Map<String,Object> map) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.updateInfo(map);
|
||||
} catch (Exception e) {
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
return Result.OK("编辑成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加收藏
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "添加收藏")
|
||||
@ApiOperation(value="添加收藏", notes="添加收藏")
|
||||
@GetMapping(value = "/addCollect")
|
||||
@RequiresPermissions("document:addCollect")
|
||||
public Result<?> addCollect(String id) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.addCollect(id);
|
||||
} catch (Exception e) {
|
||||
return Result.error("收藏失败");
|
||||
}
|
||||
return Result.OK("收藏成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消收藏
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "取消收藏")
|
||||
@ApiOperation(value="取消收藏", notes="取消收藏")
|
||||
@GetMapping(value = "/cancelCollect")
|
||||
@RequiresPermissions("document:addCollect")
|
||||
public Result<?> cancelCollect(String id) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.cancelCollect(id);
|
||||
} catch (Exception e) {
|
||||
return Result.error("取消收藏失败");
|
||||
}
|
||||
return Result.OK("取消收藏成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加订阅
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "添加订阅")
|
||||
@ApiOperation(value="添加订阅", notes="添加订阅")
|
||||
@GetMapping(value = "/addSubscribe")
|
||||
@RequiresPermissions("document:addSubscribe")
|
||||
public Result<?> addSubscribe(String id) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.addSubscribe(id);
|
||||
} catch (Exception e) {
|
||||
return Result.error("订阅失败");
|
||||
}
|
||||
return Result.OK("订阅成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消订阅
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "取消订阅")
|
||||
@ApiOperation(value="取消订阅", notes="取消订阅")
|
||||
@GetMapping(value = "/cancelSubscribe")
|
||||
@RequiresPermissions("document:addSubscribe")
|
||||
public Result<?> cancelSubscribe(String id) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.cancelSubscribe(id);
|
||||
} catch (Exception e) {
|
||||
return Result.error("取消订阅失败");
|
||||
}
|
||||
return Result.OK("取消订阅成功");
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "导出excel")
|
||||
@GetMapping(value = "/exportExcel")
|
||||
@RequiresPermissions("document:exportExcel")
|
||||
public void exportExcel(@RequestParam Map<String,Object> map,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request){
|
||||
bussDocumentLibraryEOService.exportExcel(map,response,request);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "带文件导出")
|
||||
@GetMapping(value = "/exportZip")
|
||||
@RequiresPermissions("document:exportZip")
|
||||
public void exportZip(@RequestParam Map<String,Object> map,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) throws Exception {
|
||||
bussDocumentLibraryEOService.exportZip(map,response,request);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "模板下载")
|
||||
@GetMapping(value = "/exportTemplate")
|
||||
@RequiresPermissions("document:exportTemplate")
|
||||
public void exportTemplate(@RequestParam Map<String,Object> map, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
bussDocumentLibraryEOService.exportTemplate(map,response,request);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "导入.zip")
|
||||
@PostMapping(value = "/importZip")
|
||||
@RequiresPermissions("document:importZip")
|
||||
public Result<?> importZip(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||
@RequestParam(value = "cut",required = false) String cut) throws Exception {
|
||||
try {
|
||||
bussDocumentLibraryEOService.importZip(file,cut);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error(e.getMessage());
|
||||
}
|
||||
return Result.OK("导入成功");
|
||||
}
|
||||
|
||||
@ApiOperation(value = "推送")
|
||||
@GetMapping(value = "/pullMessage")
|
||||
@RequiresPermissions("document:pullMessage")
|
||||
public Result<?> pullMessage(String departIds,String userIds,String documentIds) {
|
||||
|
||||
bussDocumentLibraryEOService.pullMessage(departIds,userIds,documentIds);
|
||||
|
||||
return Result.OK("推送成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 验证文档是否被其他的文档绑定
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "验证文档是否被其他的文档绑定")
|
||||
@ApiOperation(value="验证文档是否被其他的文档绑定", notes="验证文档是否被其他的文档绑定")
|
||||
@GetMapping(value = "/verifyBind")
|
||||
public Result<?> verifyBind(@RequestParam(name="ids",required=true) String ids) {
|
||||
String msg = bussDocumentLibraryEOService.verifyBind(Arrays.asList(ids.split(",")));
|
||||
return Result.OK(msg);
|
||||
}
|
||||
|
||||
@AutoLog(value = "虚拟中心添加调用文档库数据--分页")
|
||||
@ApiOperation(value="虚拟中心添加调用文档库数据--分页", notes="虚拟中心添加调用文档库数据--分页")
|
||||
@PostMapping(value = "/queryPageInfoDummy")
|
||||
public Result<?> queryPageInfoDummy(@RequestBody BussDocumentLibraryEO bussDocumentLibraryEO,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<BussDocumentLibraryEO> queryWrapper = QueryGenerator.initQueryWrapper(bussDocumentLibraryEO, req.getParameterMap());
|
||||
Page<BussDocumentLibraryEO> page = new Page<BussDocumentLibraryEO>(bussDocumentLibraryEO.getPageNo(), bussDocumentLibraryEO.getPageSize());
|
||||
IPage<BussDocumentLibraryEO> pageList = bussDocumentLibraryEOService.queryPageInfoDummy(page, queryWrapper,bussDocumentLibraryEO);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="虚拟中心添加调用文档库数据--分页", notes="虚拟中心添加调用文档库数据--分页")
|
||||
@PostMapping(value = "/queryPageDummy")
|
||||
@ResponseBody
|
||||
public JSONObject queryPageDummy(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = bussDocumentLibraryEOService.getPageDummy(parameter);
|
||||
Result<IPage> ok = Result.OK(infoPage);
|
||||
JSONObject jsonResult = JSONObject.fromObject(ok);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看已上传的文件
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="查看已上传的文件", notes="查看已上传的文件")
|
||||
@GetMapping(value = "/getFileInfos")
|
||||
@RequiresPermissions("document:queryPageInfo")
|
||||
public Result<?> getFileInfos(String id) {
|
||||
List<OSSFileForDocumentLibrary> fileInfos = bussDocumentLibraryEOService.getFileInfos(id);
|
||||
return Result.OK(fileInfos);
|
||||
}
|
||||
/**
|
||||
* 根据id查询编号和标题
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="查看已上传的文件", notes="查看已上传的文件")
|
||||
@GetMapping(value = "/getTitle")
|
||||
public Result<?> getTitle(String id,String cut) {
|
||||
String title = bussDocumentLibraryEOService.getTitle(id, cut);
|
||||
return Result.OK(title);
|
||||
}
|
||||
@ApiOperation(value="编辑ES数据(添加module_type_flag)", notes="编辑ES数据(添加module_type_flag)")
|
||||
@GetMapping(value = "/updateES")
|
||||
public Result<?> getTitle() {
|
||||
int count = bussDocumentLibraryEOService.updateES();
|
||||
return Result.OK(count);
|
||||
}
|
||||
}
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
package com.jero.modules.document.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.document.entity.PhasedImplementationDetailsEO;
|
||||
import com.jero.modules.document.service.IPhasedImplementationDetailsEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档库-分阶段实施详情表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-02-22
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="文档库-分阶段实施详情表")
|
||||
@RestController
|
||||
@RequestMapping("/phone/document/phasedImplementationDetailsEO")
|
||||
@Slf4j
|
||||
public class PhonePhasedImplementationDetailsEOController extends JeroController<PhasedImplementationDetailsEO, IPhasedImplementationDetailsEOService> {
|
||||
@Autowired
|
||||
private IPhasedImplementationDetailsEOService phasedImplementationDetailsEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param phasedImplementationDetailsEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-分页列表查询")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-分页列表查询", notes="文档库-分阶段实施详情表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(PhasedImplementationDetailsEO phasedImplementationDetailsEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name="cut", defaultValue="cn") String cut,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<PhasedImplementationDetailsEO> queryWrapper = QueryGenerator.initQueryWrapper(phasedImplementationDetailsEO, req.getParameterMap());
|
||||
Page<PhasedImplementationDetailsEO> page = new Page<PhasedImplementationDetailsEO>(pageNo, pageSize);
|
||||
IPage<PhasedImplementationDetailsEO> pageList = phasedImplementationDetailsEOService.page(page, queryWrapper);
|
||||
this.phasedImplementationDetailsEOService.disposeData(pageList.getRecords(),cut);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-列表查询")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-列表查询", notes="文档库-分阶段实施详情表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<PhasedImplementationDetailsEO>> queryList() {
|
||||
List<PhasedImplementationDetailsEO> list = phasedImplementationDetailsEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param phasedImplementationDetailsEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-添加")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-添加", notes="文档库-分阶段实施详情表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
phasedImplementationDetailsEOService.add(phasedImplementationDetailsEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param phasedImplementationDetailsEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-编辑")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-编辑", notes="文档库-分阶段实施详情表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
phasedImplementationDetailsEOService.editById(phasedImplementationDetailsEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-通过id删除")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-通过id删除", notes="文档库-分阶段实施详情表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
phasedImplementationDetailsEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-批量删除")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-批量删除", notes="文档库-分阶段实施详情表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.phasedImplementationDetailsEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库-分阶段实施详情表-通过id查询")
|
||||
@ApiOperation(value="文档库-分阶段实施详情表-通过id查询", notes="文档库-分阶段实施详情表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
PhasedImplementationDetailsEO phasedImplementationDetailsEO = phasedImplementationDetailsEOService.queryById(id);
|
||||
if(phasedImplementationDetailsEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(phasedImplementationDetailsEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param phasedImplementationDetailsEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, PhasedImplementationDetailsEO phasedImplementationDetailsEO) {
|
||||
return super.exportXls(request, phasedImplementationDetailsEO, PhasedImplementationDetailsEO.class, "文档库-分阶段实施详情表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, PhasedImplementationDetailsEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -26,7 +26,7 @@ import com.jero.common.aspect.annotation.AutoLog;
|
||||
*/
|
||||
@Api(tags="最近浏览表")
|
||||
@RestController
|
||||
@RequestMapping("/phone/recentBrowse")
|
||||
@RequestMapping("/phone/phone/recentBrowse")
|
||||
@Slf4j
|
||||
public class RecentBrowseController extends JeroController<RecentBrowse, IRecentBrowseService> {
|
||||
@Autowired
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import java.util.Map;
|
||||
|
||||
@Api(tags = "手机端-搜索中心")
|
||||
@RestController
|
||||
@RequestMapping("/phone/search")
|
||||
@RequestMapping("/phone/phone/search")
|
||||
public class SearchCenterController {
|
||||
|
||||
@Autowired
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import java.util.Map;
|
||||
|
||||
@Api(tags = "手机端-任务统计")
|
||||
@RestController
|
||||
@RequestMapping("/phone/taskStatistics")
|
||||
@RequestMapping("/phone/phone/taskStatistics")
|
||||
public class TaskStatisticsController {
|
||||
|
||||
@Autowired
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import java.util.Map;
|
||||
|
||||
@Api(tags = "手机端-待办中心")
|
||||
@RestController
|
||||
@RequestMapping("/phone/toDoCenter")
|
||||
@RequestMapping("/phone/phone/toDoCenter")
|
||||
public class ToDoCenterController {
|
||||
|
||||
@Autowired
|
||||
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
package com.jero.modules.problemKnowledgeBase.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseBrowsingHistoryEO;
|
||||
import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseBrowsingHistoryEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库浏览历史表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="问题知识库浏览历史表")
|
||||
@RestController
|
||||
@RequestMapping("/phone/problemKnowledgeBase/problemKnowledgeBaseBrowsingHistoryEO")
|
||||
@Slf4j
|
||||
public class PhoneProblemKnowledgeBaseBrowsingHistoryEOController extends JeroController<ProblemKnowledgeBaseBrowsingHistoryEO, IProblemKnowledgeBaseBrowsingHistoryEOService> {
|
||||
@Autowired
|
||||
private IProblemKnowledgeBaseBrowsingHistoryEOService problemKnowledgeBaseBrowsingHistoryEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param problemKnowledgeBaseBrowsingHistoryEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库浏览历史表-分页列表查询")
|
||||
@ApiOperation(value="问题知识库浏览历史表-分页列表查询", notes="问题知识库浏览历史表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(ProblemKnowledgeBaseBrowsingHistoryEO problemKnowledgeBaseBrowsingHistoryEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ProblemKnowledgeBaseBrowsingHistoryEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseBrowsingHistoryEO, req.getParameterMap());
|
||||
Page<ProblemKnowledgeBaseBrowsingHistoryEO> page = new Page<ProblemKnowledgeBaseBrowsingHistoryEO>(pageNo, pageSize);
|
||||
IPage<ProblemKnowledgeBaseBrowsingHistoryEO> pageList = problemKnowledgeBaseBrowsingHistoryEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库浏览历史表-列表查询")
|
||||
@ApiOperation(value="问题知识库浏览历史表-列表查询", notes="问题知识库浏览历史表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ProblemKnowledgeBaseBrowsingHistoryEO>> queryList() {
|
||||
List<ProblemKnowledgeBaseBrowsingHistoryEO> list = problemKnowledgeBaseBrowsingHistoryEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param problemKnowledgeBaseBrowsingHistoryEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库浏览历史表-添加")
|
||||
@ApiOperation(value="问题知识库浏览历史表-添加", notes="问题知识库浏览历史表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ProblemKnowledgeBaseBrowsingHistoryEO problemKnowledgeBaseBrowsingHistoryEO) {
|
||||
problemKnowledgeBaseBrowsingHistoryEOService.add(problemKnowledgeBaseBrowsingHistoryEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param problemKnowledgeBaseBrowsingHistoryEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库浏览历史表-编辑")
|
||||
@ApiOperation(value="问题知识库浏览历史表-编辑", notes="问题知识库浏览历史表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ProblemKnowledgeBaseBrowsingHistoryEO problemKnowledgeBaseBrowsingHistoryEO) {
|
||||
problemKnowledgeBaseBrowsingHistoryEOService.editById(problemKnowledgeBaseBrowsingHistoryEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库浏览历史表-通过id删除")
|
||||
@ApiOperation(value="问题知识库浏览历史表-通过id删除", notes="问题知识库浏览历史表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
problemKnowledgeBaseBrowsingHistoryEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库浏览历史表-批量删除")
|
||||
@ApiOperation(value="问题知识库浏览历史表-批量删除", notes="问题知识库浏览历史表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.problemKnowledgeBaseBrowsingHistoryEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库浏览历史表-通过id查询")
|
||||
@ApiOperation(value="问题知识库浏览历史表-通过id查询", notes="问题知识库浏览历史表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ProblemKnowledgeBaseBrowsingHistoryEO problemKnowledgeBaseBrowsingHistoryEO = problemKnowledgeBaseBrowsingHistoryEOService.queryById(id);
|
||||
if(problemKnowledgeBaseBrowsingHistoryEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(problemKnowledgeBaseBrowsingHistoryEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param problemKnowledgeBaseBrowsingHistoryEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProblemKnowledgeBaseBrowsingHistoryEO problemKnowledgeBaseBrowsingHistoryEO) {
|
||||
return super.exportXls(request, problemKnowledgeBaseBrowsingHistoryEO, ProblemKnowledgeBaseBrowsingHistoryEO.class, "问题知识库浏览历史表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ProblemKnowledgeBaseBrowsingHistoryEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
package com.jero.modules.problemKnowledgeBase.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseCollectEO;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseEO;
|
||||
import com.jero.modules.problemKnowledgeBase.enums.CollectStatusEnum;
|
||||
import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseCollectEOService;
|
||||
import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库收藏表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="问题知识库收藏表")
|
||||
@RestController
|
||||
@RequestMapping("/phone/problemKnowledgeBase/problemKnowledgeBaseCollectEO")
|
||||
@Slf4j
|
||||
public class PhoneProblemKnowledgeBaseCollectEOController extends JeroController<ProblemKnowledgeBaseCollectEO, IProblemKnowledgeBaseCollectEOService> {
|
||||
@Autowired
|
||||
private IProblemKnowledgeBaseCollectEOService problemKnowledgeBaseCollectEOService;
|
||||
@Autowired
|
||||
private IProblemKnowledgeBaseEOService problemKnowledgeBaseEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param problemKnowledgeBaseCollectEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库收藏表-分页列表查询")
|
||||
@ApiOperation(value="问题知识库收藏表-分页列表查询", notes="问题知识库收藏表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(ProblemKnowledgeBaseCollectEO problemKnowledgeBaseCollectEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ProblemKnowledgeBaseCollectEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseCollectEO, req.getParameterMap());
|
||||
Page<ProblemKnowledgeBaseCollectEO> page = new Page<ProblemKnowledgeBaseCollectEO>(pageNo, pageSize);
|
||||
IPage<ProblemKnowledgeBaseCollectEO> pageList = problemKnowledgeBaseCollectEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库收藏表-列表查询")
|
||||
@ApiOperation(value="问题知识库收藏表-列表查询", notes="问题知识库收藏表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ProblemKnowledgeBaseCollectEO>> queryList() {
|
||||
List<ProblemKnowledgeBaseCollectEO> list = problemKnowledgeBaseCollectEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param problemKnowledgeBaseCollectEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库收藏表-添加")
|
||||
@ApiOperation(value="问题知识库收藏表-添加", notes="问题知识库收藏表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ProblemKnowledgeBaseCollectEO problemKnowledgeBaseCollectEO) {
|
||||
problemKnowledgeBaseCollectEOService.add(problemKnowledgeBaseCollectEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param problemKnowledgeBaseCollectEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库收藏表-编辑")
|
||||
@ApiOperation(value="问题知识库收藏表-编辑", notes="问题知识库收藏表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ProblemKnowledgeBaseCollectEO problemKnowledgeBaseCollectEO) {
|
||||
problemKnowledgeBaseCollectEOService.editById(problemKnowledgeBaseCollectEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库收藏表-通过id删除")
|
||||
@ApiOperation(value="问题知识库收藏表-通过id删除", notes="问题知识库收藏表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
problemKnowledgeBaseCollectEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库收藏表-批量删除")
|
||||
@ApiOperation(value="问题知识库收藏表-批量删除", notes="问题知识库收藏表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.problemKnowledgeBaseCollectEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库收藏表-通过id查询")
|
||||
@ApiOperation(value="问题知识库收藏表-通过id查询", notes="问题知识库收藏表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ProblemKnowledgeBaseCollectEO problemKnowledgeBaseCollectEO = problemKnowledgeBaseCollectEOService.queryById(id);
|
||||
if(problemKnowledgeBaseCollectEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(problemKnowledgeBaseCollectEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param problemKnowledgeBaseCollectEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProblemKnowledgeBaseCollectEO problemKnowledgeBaseCollectEO) {
|
||||
return super.exportXls(request, problemKnowledgeBaseCollectEO, ProblemKnowledgeBaseCollectEO.class, "问题知识库收藏表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ProblemKnowledgeBaseCollectEO.class);
|
||||
}
|
||||
|
||||
@AutoLog(value = "我的收藏-分页列表查询-问题知识库")
|
||||
@ApiOperation(value="我的收藏-分页列表查询-问题知识库", notes="我的收藏-分页列表查询-问题知识库")
|
||||
@GetMapping(value = "/queryCollectPageList")
|
||||
public Result<?> queryCollectPageList(ProblemKnowledgeBaseEO problemKnowledgeBaseEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ProblemKnowledgeBaseEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseEO, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
this.problemKnowledgeBaseEOService.createQueryPermission(queryWrapper,problemKnowledgeBaseEO);
|
||||
Page<ProblemKnowledgeBaseEO> page = new Page<ProblemKnowledgeBaseEO>(pageNo, pageSize);
|
||||
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
QueryWrapper<ProblemKnowledgeBaseCollectEO> collectEOQueryWrapper = new QueryWrapper<>();
|
||||
collectEOQueryWrapper.lambda().eq(ProblemKnowledgeBaseCollectEO::getCollectUserId,currentUser.getId());
|
||||
collectEOQueryWrapper.lambda().eq(ProblemKnowledgeBaseCollectEO::getCollectStatus, CollectStatusEnum.COLLECT.getValue());
|
||||
List<ProblemKnowledgeBaseCollectEO> collectEOList = this.problemKnowledgeBaseCollectEOService.list(collectEOQueryWrapper);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(collectEOList)){
|
||||
List<String> problemKnowledgeBaseIdList = collectEOList.stream().map(ProblemKnowledgeBaseCollectEO::getProblemKnowledgeBaseId).distinct().collect(Collectors.toList());
|
||||
|
||||
queryWrapper.lambda().in(ProblemKnowledgeBaseEO::getId,problemKnowledgeBaseIdList);
|
||||
IPage<ProblemKnowledgeBaseEO> pageList = this.problemKnowledgeBaseEOService.page(page, queryWrapper);
|
||||
this.problemKnowledgeBaseEOService.disposeData(pageList.getRecords(),problemKnowledgeBaseEO.getCut());
|
||||
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
return Result.OK();
|
||||
}
|
||||
}
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
package com.jero.modules.problemKnowledgeBase.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseCommentEO;
|
||||
import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseCommentEOService;
|
||||
import com.jero.modules.problemKnowledgeBase.vo.ProblemKnowledgeBaseCommentVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库评论表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="问题知识库评论表")
|
||||
@RestController
|
||||
@RequestMapping("/phone/problemKnowledgeBase/problemKnowledgeBaseCommentEO")
|
||||
@Slf4j
|
||||
public class PhoneProblemKnowledgeBaseCommentEOController extends JeroController<ProblemKnowledgeBaseCommentEO, IProblemKnowledgeBaseCommentEOService> {
|
||||
@Autowired
|
||||
private IProblemKnowledgeBaseCommentEOService problemKnowledgeBaseCommentEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param problemKnowledgeBaseCommentEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库评论表-分页列表查询")
|
||||
@ApiOperation(value="问题知识库评论表-分页列表查询", notes="问题知识库评论表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(ProblemKnowledgeBaseCommentEO problemKnowledgeBaseCommentEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ProblemKnowledgeBaseCommentEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseCommentEO, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<ProblemKnowledgeBaseCommentEO> page = new Page<ProblemKnowledgeBaseCommentEO>(pageNo, pageSize);
|
||||
IPage<ProblemKnowledgeBaseCommentEO> pageList = problemKnowledgeBaseCommentEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库评论表-列表查询")
|
||||
@ApiOperation(value="问题知识库评论表-列表查询", notes="问题知识库评论表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ProblemKnowledgeBaseCommentVO>> queryList(ProblemKnowledgeBaseCommentEO problemKnowledgeBaseCommentEO, HttpServletRequest req) {
|
||||
List<ProblemKnowledgeBaseCommentVO> list = this.problemKnowledgeBaseCommentEOService.getInfoList(problemKnowledgeBaseCommentEO,req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param problemKnowledgeBaseCommentEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库评论表-添加")
|
||||
@ApiOperation(value="问题知识库评论表-添加", notes="问题知识库评论表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ProblemKnowledgeBaseCommentEO problemKnowledgeBaseCommentEO) {
|
||||
problemKnowledgeBaseCommentEOService.add(problemKnowledgeBaseCommentEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param problemKnowledgeBaseCommentEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库评论表-编辑")
|
||||
@ApiOperation(value="问题知识库评论表-编辑", notes="问题知识库评论表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ProblemKnowledgeBaseCommentEO problemKnowledgeBaseCommentEO) {
|
||||
problemKnowledgeBaseCommentEOService.editById(problemKnowledgeBaseCommentEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库评论表-通过id删除")
|
||||
@ApiOperation(value="问题知识库评论表-通过id删除", notes="问题知识库评论表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
problemKnowledgeBaseCommentEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库评论表-批量删除")
|
||||
@ApiOperation(value="问题知识库评论表-批量删除", notes="问题知识库评论表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.problemKnowledgeBaseCommentEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库评论表-通过id查询")
|
||||
@ApiOperation(value="问题知识库评论表-通过id查询", notes="问题知识库评论表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ProblemKnowledgeBaseCommentEO problemKnowledgeBaseCommentEO = problemKnowledgeBaseCommentEOService.queryById(id);
|
||||
if(problemKnowledgeBaseCommentEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(problemKnowledgeBaseCommentEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param problemKnowledgeBaseCommentEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProblemKnowledgeBaseCommentEO problemKnowledgeBaseCommentEO) {
|
||||
return super.exportXls(request, problemKnowledgeBaseCommentEO, ProblemKnowledgeBaseCommentEO.class, "问题知识库评论表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ProblemKnowledgeBaseCommentEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
package com.jero.modules.problemKnowledgeBase.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseEO;
|
||||
import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseEOService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="问题知识库表")
|
||||
@RestController
|
||||
@RequestMapping("/phone/problemKnowledgeBase/problemKnowledgeBaseEO")
|
||||
@Slf4j
|
||||
public class PhoneProblemKnowledgeBaseEOController extends JeroController<ProblemKnowledgeBaseEO, IProblemKnowledgeBaseEOService> {
|
||||
@Autowired
|
||||
private IProblemKnowledgeBaseEOService problemKnowledgeBaseEOService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param problemKnowledgeBaseEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库表-分页列表查询")
|
||||
@ApiOperation(value="问题知识库表-分页列表查询", notes="问题知识库表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(ProblemKnowledgeBaseEO problemKnowledgeBaseEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
boolean administrator = this.sysUserService.isAdministrator();
|
||||
//如果当前登录人是超级管理员角色,进入到管理发布页面时,查询所有的数据,其它用户只能查询自己创建的数据。
|
||||
if(administrator){
|
||||
problemKnowledgeBaseEO.setCreateBy(null);
|
||||
}
|
||||
QueryWrapper<ProblemKnowledgeBaseEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseEO, req.getParameterMap());
|
||||
this.problemKnowledgeBaseEOService.createQueryPermission(queryWrapper,problemKnowledgeBaseEO);
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<ProblemKnowledgeBaseEO> page = new Page<ProblemKnowledgeBaseEO>(pageNo, pageSize);
|
||||
IPage<ProblemKnowledgeBaseEO> pageList = problemKnowledgeBaseEOService.page(page, queryWrapper);
|
||||
this.problemKnowledgeBaseEOService.disposeData(pageList.getRecords(),problemKnowledgeBaseEO.getCut());
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库表-列表查询")
|
||||
@ApiOperation(value="问题知识库表-列表查询", notes="问题知识库表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ProblemKnowledgeBaseEO>> queryList(ProblemKnowledgeBaseEO problemKnowledgeBaseEO,
|
||||
HttpServletRequest req) {
|
||||
List<ProblemKnowledgeBaseEO> list = problemKnowledgeBaseEOService.queryList(problemKnowledgeBaseEO,req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param problemKnowledgeBaseEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库表-添加")
|
||||
@ApiOperation(value="问题知识库表-添加", notes="问题知识库表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ProblemKnowledgeBaseEO problemKnowledgeBaseEO) {
|
||||
problemKnowledgeBaseEOService.add(problemKnowledgeBaseEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param problemKnowledgeBaseEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库表-编辑")
|
||||
@ApiOperation(value="问题知识库表-编辑", notes="问题知识库表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ProblemKnowledgeBaseEO problemKnowledgeBaseEO) {
|
||||
problemKnowledgeBaseEOService.editById(problemKnowledgeBaseEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库表-通过id删除")
|
||||
@ApiOperation(value="问题知识库表-通过id删除", notes="问题知识库表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
problemKnowledgeBaseEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库表-批量删除")
|
||||
@ApiOperation(value="问题知识库表-批量删除", notes="问题知识库表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.problemKnowledgeBaseEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库表-通过id查询")
|
||||
@ApiOperation(value="问题知识库表-通过id查询", notes="问题知识库表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
ProblemKnowledgeBaseEO problemKnowledgeBaseEO = problemKnowledgeBaseEOService.queryById(id,cut);
|
||||
if(problemKnowledgeBaseEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(problemKnowledgeBaseEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param problemKnowledgeBaseEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProblemKnowledgeBaseEO problemKnowledgeBaseEO) {
|
||||
return super.exportXls(request, problemKnowledgeBaseEO, ProblemKnowledgeBaseEO.class, "问题知识库表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ProblemKnowledgeBaseEO.class);
|
||||
}
|
||||
|
||||
@AutoLog(value = "问题知识库表-转发")
|
||||
@ApiOperation(value="问题知识库表-转发", notes="问题知识库表-转发")
|
||||
@PostMapping(value = "/forward")
|
||||
public Result<?> forward(@RequestBody JSONObject json) {
|
||||
return this.problemKnowledgeBaseEOService.forward(json);
|
||||
}
|
||||
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
package com.jero.modules.problemKnowledgeBase.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBasePraiseEO;
|
||||
import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBasePraiseEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库点赞表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-08-03
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="问题知识库点赞表")
|
||||
@RestController
|
||||
@RequestMapping("/phone/problemKnowledgeBase/problemKnowledgeBasePraiseEO")
|
||||
@Slf4j
|
||||
public class PhoneProblemKnowledgeBasePraiseEOController extends JeroController<ProblemKnowledgeBasePraiseEO, IProblemKnowledgeBasePraiseEOService> {
|
||||
@Autowired
|
||||
private IProblemKnowledgeBasePraiseEOService problemKnowledgeBasePraiseEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param problemKnowledgeBasePraiseEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库点赞表-分页列表查询")
|
||||
@ApiOperation(value="问题知识库点赞表-分页列表查询", notes="问题知识库点赞表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(ProblemKnowledgeBasePraiseEO problemKnowledgeBasePraiseEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ProblemKnowledgeBasePraiseEO> queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBasePraiseEO, req.getParameterMap());
|
||||
Page<ProblemKnowledgeBasePraiseEO> page = new Page<ProblemKnowledgeBasePraiseEO>(pageNo, pageSize);
|
||||
IPage<ProblemKnowledgeBasePraiseEO> pageList = problemKnowledgeBasePraiseEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库点赞表-列表查询")
|
||||
@ApiOperation(value="问题知识库点赞表-列表查询", notes="问题知识库点赞表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ProblemKnowledgeBasePraiseEO>> queryList() {
|
||||
List<ProblemKnowledgeBasePraiseEO> list = problemKnowledgeBasePraiseEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param problemKnowledgeBasePraiseEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库点赞表-添加")
|
||||
@ApiOperation(value="问题知识库点赞表-添加", notes="问题知识库点赞表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ProblemKnowledgeBasePraiseEO problemKnowledgeBasePraiseEO) {
|
||||
problemKnowledgeBasePraiseEOService.add(problemKnowledgeBasePraiseEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param problemKnowledgeBasePraiseEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库点赞表-编辑")
|
||||
@ApiOperation(value="问题知识库点赞表-编辑", notes="问题知识库点赞表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ProblemKnowledgeBasePraiseEO problemKnowledgeBasePraiseEO) {
|
||||
problemKnowledgeBasePraiseEOService.editById(problemKnowledgeBasePraiseEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库点赞表-通过id删除")
|
||||
@ApiOperation(value="问题知识库点赞表-通过id删除", notes="问题知识库点赞表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
problemKnowledgeBasePraiseEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库点赞表-批量删除")
|
||||
@ApiOperation(value="问题知识库点赞表-批量删除", notes="问题知识库点赞表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.problemKnowledgeBasePraiseEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "问题知识库点赞表-通过id查询")
|
||||
@ApiOperation(value="问题知识库点赞表-通过id查询", notes="问题知识库点赞表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ProblemKnowledgeBasePraiseEO problemKnowledgeBasePraiseEO = problemKnowledgeBasePraiseEOService.queryById(id);
|
||||
if(problemKnowledgeBasePraiseEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(problemKnowledgeBasePraiseEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param problemKnowledgeBasePraiseEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProblemKnowledgeBasePraiseEO problemKnowledgeBasePraiseEO) {
|
||||
return super.exportXls(request, problemKnowledgeBasePraiseEO, ProblemKnowledgeBasePraiseEO.class, "问题知识库点赞表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ProblemKnowledgeBasePraiseEO.class);
|
||||
}
|
||||
|
||||
}
|
||||
+564
@@ -0,0 +1,564 @@
|
||||
package com.jero.modules.project.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.itextpdf.text.DocumentException;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
|
||||
import com.jero.modules.dummy.service.IDummyInventoryBaseEOService;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
||||
import com.jero.modules.project.vo.ProjectTaskUrgVo;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 项目库-法规清单表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="项目库-法规清单表")
|
||||
@RestController
|
||||
@RequestMapping("/phone/project/projectLawsInventoryEO")
|
||||
@Slf4j
|
||||
public class PhoneProjectLawsInventoryEOController extends JeroController<ProjectLawsInventoryEO, IProjectLawsInventoryEOService> {
|
||||
@Autowired
|
||||
private IProjectLawsInventoryEOService projectLawsInventoryEOService;
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
@Autowired
|
||||
private IDummyInventoryBaseEOService dummyInventoryBaseEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param projectLawsInventoryEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-分页列表查询")
|
||||
@ApiOperation(value="项目库-法规清单表-分页列表查询", notes="项目库-法规清单表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(ProjectLawsInventoryEO projectLawsInventoryEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<ProjectLawsInventoryEO> pageList = this.projectLawsInventoryEOService.queryPage(projectLawsInventoryEO,pageNo,pageSize,req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-列表查询")
|
||||
@ApiOperation(value="项目库-法规清单表-列表查询", notes="项目库-法规清单表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
@RequiresPermissions("projectLawsInventory:list")
|
||||
public Result<List<ProjectLawsInventoryEO>> queryList(ProjectLawsInventoryEO projectLawsInventoryEO,HttpServletRequest req) {
|
||||
List<ProjectLawsInventoryEO> list = projectLawsInventoryEOService.queryList(projectLawsInventoryEO,req);
|
||||
return Result.OK(projectLawsInventoryEO.getCut(),list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param projectLawsInventoryEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-添加")
|
||||
@ApiOperation(value="项目库-法规清单表-添加", notes="项目库-法规清单表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ProjectLawsInventoryEO projectLawsInventoryEO) {
|
||||
projectLawsInventoryEOService.add(projectLawsInventoryEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param projectLawsInventoryEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-编辑")
|
||||
@ApiOperation(value="项目库-法规清单表-编辑", notes="项目库-法规清单表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ProjectLawsInventoryEO projectLawsInventoryEO) {
|
||||
projectLawsInventoryEOService.editById(projectLawsInventoryEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-通过id删除")
|
||||
@ApiOperation(value="项目库-法规清单表-通过id删除", notes="项目库-法规清单表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="projectLibraryId",required=true) String projectLibraryId,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
projectLawsInventoryEOService.deleteById(id,projectLibraryId,cut);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-批量删除")
|
||||
@ApiOperation(value="项目库-法规清单表-批量删除", notes="项目库-法规清单表-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestBody JSONObject json) {
|
||||
String ids = json.getString("ids");
|
||||
String projectLibraryId = json.getString("projectLibraryId");
|
||||
String cut = json.getString("cut");
|
||||
this.projectLawsInventoryEOService.deleteByIds(Arrays.asList(ids.split(",")),projectLibraryId,cut);
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-通过id查询")
|
||||
@ApiOperation(value="项目库-法规清单表-通过id查询", notes="项目库-法规清单表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOService.queryById(id);
|
||||
if(projectLawsInventoryEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(projectLawsInventoryEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param projectLawsInventoryEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProjectLawsInventoryEO projectLawsInventoryEO) {
|
||||
return super.exportXls(request, projectLawsInventoryEO, ProjectLawsInventoryEO.class, "项目库-法规清单表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ProjectLawsInventoryEO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新法规清单状态
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-批量更新状态")
|
||||
@ApiOperation(value="项目库-法规清单表-批量更新状态", notes="项目库-法规清单表-批量更新状态")
|
||||
@PostMapping(value = "/updateStatusBatch")
|
||||
public Result<?> updateStatusBatch(@RequestBody JSONObject json) {
|
||||
return this.projectLawsInventoryEOService.updateStatusBatch(json);
|
||||
}
|
||||
|
||||
/**
|
||||
* 匹配相关人员
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-匹配相关人员")
|
||||
@ApiOperation(value="项目库-法规清单表-匹配相关人员", notes="项目库-法规清单表-匹配相关人员")
|
||||
@PostMapping(value = "/matchRelevantPeople")
|
||||
public Result<?> matchRelevantPeople(@RequestBody Map<String,Object> params){
|
||||
return this.projectLawsInventoryEOService.matchRelevantPeople(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程调用接口
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-流程调用")
|
||||
@ApiOperation(value="项目库-法规清单表-流程调用", notes="项目库-法规清单表-流程调用")
|
||||
@PostMapping(value = "/processCall")
|
||||
public Result<?> processCall(@RequestBody JSONObject jsonObject){
|
||||
return this.projectLawsInventoryEOService.processCall(jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-通过id与操作类型查询")
|
||||
@ApiOperation(value="项目库-法规清单表-通过id与操作类型查询", notes="项目库-法规清单表-通过id与操作类型查询")
|
||||
@GetMapping(value = "/queryProjectLawsInventoryInfoById")
|
||||
public Result<?> queryProjectLawsInventoryInfoById(@RequestParam Map<String,Object> params) {
|
||||
List<ProjectLawsInventoryEO> result = projectLawsInventoryEOService.queryProjectLawsInventoryInfoById(params);
|
||||
return Result.OK((String) params.get("cut"),result);
|
||||
}
|
||||
|
||||
@AutoLog(value = "法规清单添加调用文档库数据--分页")
|
||||
@ApiOperation(value="法规清单添加调用文档库数据--分页", notes="法规清单添加调用文档库数据--分页")
|
||||
@PostMapping(value = "/queryPageInfoBussDocument")
|
||||
public Result<?> queryPageInfo(@RequestBody BussDocumentLibraryEO bussDocumentLibraryEO,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<BussDocumentLibraryEO> queryWrapper = QueryGenerator.initQueryWrapper(bussDocumentLibraryEO, req.getParameterMap());
|
||||
Page<BussDocumentLibraryEO> page = new Page<BussDocumentLibraryEO>(bussDocumentLibraryEO.getPageNo(), bussDocumentLibraryEO.getPageSize());
|
||||
IPage<BussDocumentLibraryEO> pageList = bussDocumentLibraryEOService.queryPageInfoDummy(page, queryWrapper,bussDocumentLibraryEO);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "复制")
|
||||
@ApiOperation(value="复制", notes="复制")
|
||||
@GetMapping(value = "/copyInfoByIds")
|
||||
public Result<?> copyInfoByIds(@RequestParam(name="ids",required=true) String ids,
|
||||
@RequestParam(name="cut",required=true) String cut,
|
||||
@RequestParam(name="operateType",required=true) String operateType) {
|
||||
try {
|
||||
projectLawsInventoryEOService.copyInfoByIds(ids,operateType);
|
||||
} catch (Exception e) {
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
return Result.error("复制失败");
|
||||
}else{
|
||||
return Result.error("Copy the failure");
|
||||
}
|
||||
}
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
return Result.OK("复制成功");
|
||||
}else{
|
||||
return Result.OK("Copy success");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量设置
|
||||
*
|
||||
* @param projectLawsInventoryEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "批量设置")
|
||||
@ApiOperation(value="批量设置", notes="批量设置")
|
||||
@PostMapping(value = "/setBatch")
|
||||
public Result<?> setBatch(@RequestBody ProjectLawsInventoryEO projectLawsInventoryEO) {
|
||||
String cut = projectLawsInventoryEO.getCut();
|
||||
try {
|
||||
projectLawsInventoryEOService.setBatch(projectLawsInventoryEO);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("批量设置失败:" + e.getMessage());
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
return Result.error("批量设置失败!");
|
||||
}else{
|
||||
return Result.error("Batch set success");
|
||||
}
|
||||
}
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
return Result.OK("批量设置成功");
|
||||
}else{
|
||||
return Result.OK("Batch set success");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 调取虚拟清单数据
|
||||
*
|
||||
* @param dummyInventoryBaseEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "调取虚拟清单数据")
|
||||
@ApiOperation(value="调取虚拟清单数据", notes="调取虚拟清单数据")
|
||||
@PostMapping(value = "/getPageInfoDummy")
|
||||
public Result<?> getPageInfoDummy(@RequestBody DummyInventoryBaseEO dummyInventoryBaseEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
// dummyInventoryBaseEO.setName("*发*");
|
||||
QueryWrapper<DummyInventoryBaseEO> queryWrapper = QueryGenerator.initQueryWrapper(dummyInventoryBaseEO, req.getParameterMap());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
Page<DummyInventoryBaseEO> page = new Page<DummyInventoryBaseEO>(pageNo, pageSize);
|
||||
IPage<DummyInventoryBaseEO> pageList = dummyInventoryBaseEOService.getPageInfoDummy(page,queryWrapper);
|
||||
return Result.OK(dummyInventoryBaseEO.getCut(),pageList);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "模板下载")
|
||||
@GetMapping(value = "/exportTemplate")
|
||||
public void exportTemplate(ProjectLawsInventoryEO projectLawsInventoryEO, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
projectLawsInventoryEOService.exportTemplate(projectLawsInventoryEO,response,request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param request
|
||||
* @param projectLawsInventoryEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportData")
|
||||
@RequiresPermissions("projectLawsInventory:exportData")
|
||||
public void exportData(HttpServletResponse response,
|
||||
HttpServletRequest request,
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO) {
|
||||
projectLawsInventoryEOService.exportData(response,request, projectLawsInventoryEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*
|
||||
* @param file
|
||||
* @param projectLawsInventoryEO
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importData", method = RequestMethod.POST)
|
||||
public Result<?> importData(@RequestParam(value = "file", required = false) MultipartFile file,
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO) {
|
||||
projectLawsInventoryEOService.importData(file,projectLawsInventoryEO);
|
||||
return Result.OK("导入成功");
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "变更")
|
||||
@ApiOperation(value="变更", notes="变更")
|
||||
@PostMapping(value = "/change")
|
||||
public Result<?> change(@RequestBody JSONObject params) {
|
||||
return this.projectLawsInventoryEOService.change(params);
|
||||
}
|
||||
|
||||
@AutoLog(value = "下载pdf报告")
|
||||
@ApiOperation(value="下载pdf报告", notes="下载pdf报告")
|
||||
@GetMapping(value = "/downloadReport")
|
||||
public void downloadReport(@RequestParam Map<String,Object> params, HttpServletRequest req, HttpServletResponse resp) throws DocumentException {
|
||||
this.projectLawsInventoryEOService.downloadReport(params,req,resp);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询条件 标识传 1-->用于查询文档库字段属
|
||||
* 法规清单添加调取文档库时高级搜索条件
|
||||
* @param flag
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "法规清单添加调取文档库时高级搜索条件")
|
||||
@ApiOperation(value="法规清单添加调取文档库时高级搜索条件", notes="法规清单添加调取文档库时高级搜索条件")
|
||||
@GetMapping(value = "/queryConditionInventory")
|
||||
public Result<List<Map<String,Object>>> queryConditionInventory(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String,Object>> list = bussDocumentLibraryEOService.queryConditionInventory(flag,cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value="法规清单中添加调用文档库数据--分页", notes="法规清单中添加调用文档库数据--分页")
|
||||
@PostMapping(value = "/queryPageDummy")
|
||||
@ResponseBody
|
||||
public net.sf.json.JSONObject queryPageDummy(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = bussDocumentLibraryEOService.getPageDummy(parameter);
|
||||
Result<IPage> ok = Result.OK(infoPage);
|
||||
net.sf.json.JSONObject jsonResult = net.sf.json.JSONObject.fromObject(ok);
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param params
|
||||
* cut:中英文标识
|
||||
* id:法规清单id
|
||||
* @param req
|
||||
* @param resp
|
||||
* @throws DocumentException
|
||||
*/
|
||||
@AutoLog(value = "下载docx报告")
|
||||
@ApiOperation(value="下载docx报告", notes="下载docx报告")
|
||||
@GetMapping(value = "/downloadDocxReport")
|
||||
public void downloadDocxReport(@RequestParam Map<String,Object> params, HttpServletRequest req, HttpServletResponse resp) throws DocumentException {
|
||||
this.projectLawsInventoryEOService.downloadDocxReport(params,req,resp);
|
||||
}
|
||||
|
||||
@AutoLog(value = "催办")
|
||||
@ApiOperation(value="催办", notes="催办")
|
||||
@PostMapping(value = "/expediting")
|
||||
public Result<?> expediting(@RequestBody JSONObject json) {
|
||||
return this.projectLawsInventoryEOService.expediting(json);
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前登录用户角色
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "当前登录用户角色")
|
||||
@RequestMapping(value = "/getRoleByUserId", method = RequestMethod.GET)
|
||||
public Result<List<SysRole>> getRoleByUserId(String projectLibraryId,String cut) {
|
||||
Result<List<SysRole>> result = new Result<>();
|
||||
List<SysRole> list = projectLawsInventoryEOService.getRoleByUserId(projectLibraryId,cut);
|
||||
if(list==null||list.size()<=0) {
|
||||
result.error500("未找到角色信息");
|
||||
}else {
|
||||
result.setResult(list);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "任务清单催办")
|
||||
@ApiOperation(value="任务清单催办", notes="任务清单催办")
|
||||
@PostMapping(value = "/taskUrg")
|
||||
public Result<?> taskUrg(@RequestBody ProjectTaskUrgVo projectTaskUrgVo) {
|
||||
return this.projectLawsInventoryEOService.taskUrg(projectTaskUrgVo);
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "项目库-法规清单表-根据项目库id更新符合性流程发起人、责任人接口")
|
||||
@ApiOperation(value="项目库-法规清单表-根据项目库id更新符合性流程发起人、责任人接口", notes="项目库-法规清单表-根据项目库id更新符合性流程发起人、责任人接口")
|
||||
@GetMapping(value = "/updateFlowInfoByProjectLibraryIds")
|
||||
public Result<?> updateFlowInfoByProjectLibraryIds(@RequestParam("projectLibraryIds") String projectLibraryIds){
|
||||
return this.projectLawsInventoryEOService.updateFlowInfoByProjectLibraryIds(projectLibraryIds);
|
||||
}
|
||||
|
||||
@AutoLog(value = "项目库-法规清单表-studio发布")
|
||||
@ApiOperation(value="项目库-法规清单表-studio发布", notes="项目库-法规清单表-studio发布")
|
||||
@PostMapping(value = "/studioPublish")
|
||||
public Result<?> studioPublish(@RequestBody JSONObject json) {
|
||||
return this.projectLawsInventoryEOService.studioPublish(json);
|
||||
}
|
||||
|
||||
@AutoLog(value = "项目库-法规清单表-studio撤回")
|
||||
@ApiOperation(value="项目库-法规清单表-studio撤回", notes="项目库-法规清单表-studio撤回")
|
||||
@PostMapping(value = "/studioWithdrew")
|
||||
public Result<?> studioWithdrew(@RequestBody JSONObject json) {
|
||||
return this.projectLawsInventoryEOService.studioWithdrew(json);
|
||||
}
|
||||
|
||||
@AutoLog(value = "项目库-法规清单表-法规工程师退回")
|
||||
@ApiOperation(value="项目库-法规清单表-法规工程师退回", notes="项目库-法规清单表-法规工程师退回")
|
||||
@PostMapping(value = "/regulationOwnerReturned")
|
||||
public Result<?> regulationOwnerReturned(@RequestBody JSONObject json) {
|
||||
return this.projectLawsInventoryEOService.regulationOwnerReturned(json);
|
||||
}
|
||||
|
||||
@AutoLog(value = "流程重置-迁移法规清单流程历史数据专用")
|
||||
@ApiOperation(value="流程重置-迁移法规清单流程历史数据专用", notes="流程重置-迁移法规清单流程历史数据专用")
|
||||
@PostMapping(value = "/resetFlowTemp")
|
||||
public Result<?> resetFlowTemp(@RequestBody JSONObject params) {
|
||||
return this.projectLawsInventoryEOService.resetFlowTemp(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新法规清单状态
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-批量更新流程状态")
|
||||
@ApiOperation(value="项目库-法规清单表-批量更新流程状态", notes="项目库-法规清单表-批量更新流程状态")
|
||||
@PostMapping(value = "/updateFlowStatusBatch")
|
||||
public Result<?> updateFlowStatusBatch(@RequestBody JSONObject json) {
|
||||
return this.projectLawsInventoryEOService.updateFlowStatusBatch(json);
|
||||
}
|
||||
|
||||
@AutoLog(value = "项目库-法规清单表-引用交付物")
|
||||
@ApiOperation(value="项目库-法规清单表-引用交付物", notes="项目库-法规清单表-引用交付物")
|
||||
@PostMapping(value = "/citeDeliverable")
|
||||
public Result<?> citeDeliverable(@RequestBody JSONObject json) {
|
||||
return this.projectLawsInventoryEOService.citeDeliverable(json);
|
||||
}
|
||||
|
||||
@AutoLog(value = "项目库-法规清单表-强制转办")
|
||||
@ApiOperation(value="项目库-法规清单表-强制转办", notes="项目库-法规清单表-强制转办")
|
||||
@PostMapping(value = "/compulsoryTransfer")
|
||||
public Result<?> compulsoryTransfer(@RequestBody JSONObject json) {
|
||||
return this.projectLawsInventoryEOService.compulsoryTransfer(json);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过projectId查询责任人
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-通过projectId查询责任人")
|
||||
@ApiOperation(value="项目库-法规清单表-通过projectId查询责任人", notes="项目库-法规清单表-通过projectId查询责任人")
|
||||
@GetMapping(value = "/queryDutyPersonByProjectId")
|
||||
public Result<?> queryDutyPersonByProjectId(@RequestParam Map<String,Object> params){
|
||||
Map<String, List<Map<String, Object>>> res = this.projectLawsInventoryEOService.queryDutyPersonByProjectId(params);
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询不符合项列表
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-查询不符合项列表")
|
||||
@ApiOperation(value="项目库-法规清单表-查询不符合项列表", notes="项目库-法规清单表-查询不符合项列表")
|
||||
@GetMapping(value = "/queryNotComplianList")
|
||||
public Result<?> queryNotComplianList(@RequestParam Map<String,Object> params) {
|
||||
List<Map<String,Object>> result = this.projectLawsInventoryEOService.queryNotComplianList(params);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出不符合项列表
|
||||
* @param request
|
||||
* @param params
|
||||
*/
|
||||
@AutoLog(value = "项目库-法规清单表-导出不符合项列表")
|
||||
@ApiOperation(value="项目库-法规清单表-导出不符合项列表", notes="项目库-法规清单表-导出不符合项列表")
|
||||
@RequestMapping(value = "/exportNotComplianList")
|
||||
public void exportNotComplianList(HttpServletResponse response,
|
||||
HttpServletRequest request,
|
||||
@RequestParam Map<String,Object> params) {
|
||||
this.projectLawsInventoryEOService.exportNotComplianList(response,request, params);
|
||||
}
|
||||
|
||||
@AutoLog(value = "项目库-法规清单表-定版校验")
|
||||
@ApiOperation(value="项目库-法规清单表-定版校验", notes="项目库-法规清单表-定版校验")
|
||||
@GetMapping(value = "/finalizationVerify")
|
||||
public Result<?> finalizationVerify(@RequestParam Map<String,Object> params){
|
||||
return this.projectLawsInventoryEOService.finalizationVerify(params);
|
||||
}
|
||||
}
|
||||
+285
@@ -0,0 +1,285 @@
|
||||
package com.jero.modules.project.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.service.IProjectLibraryBaseService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.ParseException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 项目库基础表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="项目库基础表")
|
||||
@RestController
|
||||
@RequestMapping("/phone/project/projectLibraryBase")
|
||||
@Slf4j
|
||||
public class PhoneProjectLibraryBaseController extends JeroController<ProjectLibraryBase, IProjectLibraryBaseService> {
|
||||
@Autowired
|
||||
private IProjectLibraryBaseService projectLibraryBaseService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库基础表-分页列表查询")
|
||||
@ApiOperation(value="项目库基础表-分页列表查询", notes="项目库基础表-分页列表查询")
|
||||
@PostMapping(value = "/page")
|
||||
public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
|
||||
List<ProjectLibraryBase> pageList= projectLibraryBaseService.queryPageList(params);
|
||||
Page pages = projectLibraryBaseService.getPages(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()), pageList);
|
||||
return Result.OK(params.get("cut").toString(),pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库基础表-列表查询")
|
||||
@ApiOperation(value="项目库基础表-列表查询", notes="项目库基础表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ProjectLibraryBase>> queryList(ProjectLibraryBase projectLibraryBase) {
|
||||
List<ProjectLibraryBase> list = projectLibraryBaseService.getList(projectLibraryBase);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param projectLibraryBase
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库基础表-添加")
|
||||
@ApiOperation(value="项目库基础表-添加", notes="项目库基础表-添加")
|
||||
@RequiresPermissions("projectLibraryBase:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) throws ParseException {
|
||||
projectLibraryBaseService.add(projectLibraryBase);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
/**
|
||||
* 项目扩展(添加子项目子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致)
|
||||
*
|
||||
* @param projectLibraryBase
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目扩展(添加子项目)")
|
||||
@ApiOperation(value="项目扩展(添加子项目)", notes="项目扩展(添加子项目)")
|
||||
@RequiresPermissions("projectLibraryBase:add")
|
||||
@PostMapping(value = "/addChild")
|
||||
public Result<?> addChild(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) throws ParseException {
|
||||
projectLibraryBaseService.addChild(projectLibraryBase);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param projectLibraryBase
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库基础表-编辑")
|
||||
@ApiOperation(value="项目库基础表-编辑", notes="项目库基础表-编辑")
|
||||
@RequiresPermissions("projectLibraryBase:edit")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) {
|
||||
projectLibraryBaseService.editById(projectLibraryBase);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库基础表-通过id删除")
|
||||
@ApiOperation(value="项目库基础表-通过id删除", notes="项目库基础表-通过id删除")
|
||||
@RequiresPermissions("projectLibraryBase:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
projectLibraryBaseService.deleteById(id,cut);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库基础表-批量删除")
|
||||
@ApiOperation(value="项目库基础表-批量删除", notes="项目库基础表-批量删除")
|
||||
@RequiresPermissions("projectLibraryBase:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
this.projectLibraryBaseService.deleteByIds(Arrays.asList(ids.split(",")),cut);
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库基础表-通过id查询")
|
||||
@ApiOperation(value="项目库基础表-通过id查询", notes="项目库基础表-通过id查询")
|
||||
@RequiresPermissions("projectLibraryBase:queryById")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<ProjectLibraryBase> data = projectLibraryBaseService.queryById(id,cut);
|
||||
if(data==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(cut,data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param projectLibraryBase
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProjectLibraryBase projectLibraryBase) {
|
||||
return super.exportXls(request, projectLibraryBase, ProjectLibraryBase.class, "项目库基础表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ProjectLibraryBase.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目详情-统计接口
|
||||
* @param id 项目库id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目详情-统计接口")
|
||||
@ApiOperation(value="项目详情-统计接口", notes="项目详情-统计接口")
|
||||
@GetMapping(value = "/getProjectDetailsStatistics")
|
||||
public Result<?> getProjectDetailsStatistics(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
Map<String,Object> data = projectLibraryBaseService.getProjectDetailsStatistics(id);
|
||||
return Result.OK(cut,data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目详情-统计接口-根据领域分组
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目详情-统计接口-根据领域分组")
|
||||
@ApiOperation(value="项目详情-统计接口-根据领域分组", notes="项目详情-统计接口-根据领域分组")
|
||||
@GetMapping(value = "/getProjectDetailsStatisticsGroupByTerritory")
|
||||
public Result<?> getProjectDetailsStatisticsGroupByTerritory(@RequestParam Map<String,Object> params) {
|
||||
Map<String,Object> data = projectLibraryBaseService.getProjectDetailsStatisticsGroupByTerritory(params);
|
||||
return Result.OK((String)params.get("cut"),data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param params
|
||||
*/
|
||||
@RequestMapping(value = "/exportProjectDetailsStatisticsGroupByTerritoryXls")
|
||||
public void exportProjectDetailsStatisticsGroupByTerritoryXls(HttpServletResponse response,HttpServletRequest request, @RequestParam Map<String,Object> params) {
|
||||
projectLibraryBaseService.exportProjectDetailsStatisticsGroupByTerritoryXls(response,request, params);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 项目置顶,取消置顶(只置顶主项目)
|
||||
* @param id
|
||||
* @param flag 0为置顶, 1为取消置顶
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目置顶,取消置顶(只置顶主项目)")
|
||||
@ApiOperation(value="项目置顶,取消置顶(只置顶主项目)", notes="项目置顶,取消置顶(只置顶主项目)")
|
||||
@GetMapping(value = "/top")
|
||||
public Result<?> top(String id,String flag) {
|
||||
projectLibraryBaseService.top(id,flag);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目所有的版本(主版本和子版本的集合)
|
||||
* @param id 项目id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "获取项目所有的版本(主版本和子版本的集合)")
|
||||
@ApiOperation(value="获取项目所有的版本(主版本和子版本的集合)", notes="获取项目所有的版本(主版本和子版本的集合)")
|
||||
@GetMapping(value = "/getVersionsInfo")
|
||||
public Result<?> getVersionsInfo(String id) {
|
||||
List<String> versionsInfoList = projectLibraryBaseService.getVersionsInfo(id);
|
||||
return Result.OK(versionsInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 版本统计
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "版本统计")
|
||||
@ApiOperation(value="版本统计)", notes="版本统计")
|
||||
@PostMapping(value = "/versionStatistics")
|
||||
public Result<?> versionStatistics(@RequestBody Map<String,Object> params) {
|
||||
List<ProjectLibraryBase> projectLibraryBasesList = projectLibraryBaseService.versionStatistics(String.valueOf(params.get("id")));
|
||||
Page pages = projectLibraryBaseService.getPages(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()), projectLibraryBasesList);
|
||||
return Result.OK(pages);
|
||||
}
|
||||
|
||||
@AutoLog(value = "对接火山引擎接口getProjectInfo")
|
||||
@ApiOperation(value="对接火山引擎接口-获取项目统计信息1", notes="对接火山引擎接口-获取项目统计信息1")
|
||||
@PostMapping(value = "/getProjectInfo")
|
||||
public Result<?> getProjectInfo(){
|
||||
JSONArray resList = projectLibraryBaseService.getProjectInfo();
|
||||
return Result.OK(resList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "对接火山引擎接口getProjectProgressInfo")
|
||||
@ApiOperation(value="对接火山引擎接口-获取项目统计信息2", notes="对接火山引擎接口-获取项目统计信息2")
|
||||
@PostMapping(value = "/getProjectProgressInfo")
|
||||
public Result<?> getProjectProgressInfo(){
|
||||
JSONArray resList = this.projectLibraryBaseService.getProjectProgressInfo();
|
||||
return Result.OK(resList);
|
||||
}
|
||||
|
||||
// 导出项目进度统计(状态导出)
|
||||
@RequestMapping(value = "/exportProjectProgressStatisticsXls")
|
||||
public void exportProjectProgressStatisticsXls(HttpServletResponse response,HttpServletRequest request, @RequestParam Map<String,Object> params) {
|
||||
this.projectLibraryBaseService.exportProjectProgressStatisticsXls(response,request, params);
|
||||
}
|
||||
}
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
package com.jero.modules.searchcenter.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.modules.searchcenter.service.impl.IDocumentSearchService;
|
||||
import com.jero.modules.searchcenter.vo.SearchVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @date 2022/3/14 9:56
|
||||
* @auth zhn
|
||||
*/
|
||||
@Api(tags="搜索中心")
|
||||
@RestController
|
||||
@RequestMapping("/phone/search/document")
|
||||
@Slf4j
|
||||
public class PhoneDocumentSearchController {
|
||||
|
||||
@Autowired
|
||||
private IDocumentSearchService iDocumentSearchService;
|
||||
|
||||
/**
|
||||
* 列表查询条件 标识传 1-->用于查询文档库字段属性
|
||||
* @param flag 标识传 1-->用于查询文档库字段属性
|
||||
* @param cut 中英文切换
|
||||
* @param searchFlag 搜索中心标识 searchFlag = 0时,查询下拉,树形,日期等字段 type = 1时,查询输入框字段
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-查询条件")
|
||||
@ApiOperation(value="文档库信息表-查询条件", notes="文档库信息表-查询条件")
|
||||
@GetMapping(value = "/queryCondition")
|
||||
@RequiresPermissions("document:search")
|
||||
public Result<List<Map<String,Object>>> queryCondition(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut,
|
||||
@RequestParam(name="searchFlag",required=true) String searchFlag) {
|
||||
List<Map<String,Object>> list = iDocumentSearchService.queryCondition(flag,cut,searchFlag);
|
||||
return Result.OK(list);
|
||||
}
|
||||
/**
|
||||
* 列表表头
|
||||
* @param flag 标识传 1-->用于查询文档库字段属性
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-列表表头")
|
||||
@ApiOperation(value="文档库信息表-列表表头", notes="文档库信息表-列表表头")
|
||||
@GetMapping(value = "/getHeader")
|
||||
public Result<List<Map<String,Object>>> getHeader(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut,
|
||||
@RequestParam(name="searchFlag",required=true) String searchFla) {
|
||||
List<Map<String,Object>> list = iDocumentSearchService.getHeader(flag,cut,searchFla);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@ApiOperation(value="列表查询", notes="列表查询")
|
||||
@PostMapping(value = "/getInfoList")
|
||||
@RequiresPermissions("document:search")
|
||||
public Result<?> getInfoList(@RequestBody Map<String,Object> map) {
|
||||
IPage infoList = iDocumentSearchService.getInfoList(map);
|
||||
return Result.OK(infoList);
|
||||
}
|
||||
|
||||
@ApiOperation(value="全部查询", notes="全部查询")
|
||||
@PostMapping(value = "/getFullTextInfoList")
|
||||
@RequiresPermissions("document:search")
|
||||
public Result<?> getFullTextInfoList(@RequestBody SearchVO searchVO) {
|
||||
IPage pageInfo = iDocumentSearchService.getFullTextInfoList(searchVO);
|
||||
return Result.OK(pageInfo);
|
||||
}
|
||||
|
||||
@ApiOperation(value="文档库查询段落", notes="文档库查询段落")
|
||||
@PostMapping(value = "/getParagraphInfoList")
|
||||
@RequiresPermissions("document:search")
|
||||
public Result<?> getParagraphInfoList(@RequestBody Map<String,Object> map) {
|
||||
IPage pageInfo = iDocumentSearchService.getParagraphInfoList(map);
|
||||
return Result.OK(pageInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value="根据id删除", notes="根据id删除")
|
||||
@GetMapping(value = "/deleteById")
|
||||
public Result<?> deleteById(@RequestParam String ids) {
|
||||
iDocumentSearchService.deleteById(ids);
|
||||
return Result.OK();
|
||||
}
|
||||
@ApiOperation(value="全部删除", notes="全部删除")
|
||||
@GetMapping(value = "/deleteAll")
|
||||
public Result<?> deleteAll() {
|
||||
iDocumentSearchService.deleteAll();
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
@ApiOperation(value="列表查询问题知识库", notes="列表查询问题知识库")
|
||||
@PostMapping(value = "/getProblemKnowledgeBasePage")
|
||||
//@RequiresPermissions("document:search")
|
||||
public Result<?> getProblemKnowledgeBasePage(@RequestBody Map<String,Object> map) {
|
||||
IPage infoList = iDocumentSearchService.getProblemKnowledgeBasePage(map);
|
||||
return Result.OK(infoList);
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.jero.modules.searchcenter.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.searchcenter.service.ILawsMonthlyReportSearchService;
|
||||
import com.jero.modules.searchcenter.vo.SearchVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @description 搜索中心-法规月报 控制层
|
||||
* @date 2022/8/17 15:03
|
||||
* @auth liyawei
|
||||
*/
|
||||
@Api(tags="搜索中心")
|
||||
@RestController
|
||||
@RequestMapping("/phone/search/lawsMonthlyReport")
|
||||
@Slf4j
|
||||
public class PhoneLawsMonthlyReportSearchController {
|
||||
|
||||
@Autowired
|
||||
private ILawsMonthlyReportSearchService lawsMonthlyReportSearchService;
|
||||
|
||||
@ApiOperation(value="法规月报查询", notes="法规月报查询")
|
||||
@PostMapping(value = "/page")
|
||||
@RequiresPermissions("document:search")
|
||||
public Result<?> queryPageInfo(@RequestBody SearchVO searchVO) {
|
||||
IPage pageInfo = lawsMonthlyReportSearchService.pageInfo(searchVO);
|
||||
return Result.OK(pageInfo);
|
||||
}
|
||||
}
|
||||
+210
@@ -0,0 +1,210 @@
|
||||
package com.jero.modules.subscribe.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.subscribe.entity.OnlCgformSubscribe;
|
||||
import com.jero.modules.subscribe.service.IOnlCgformSubscribeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 我的订阅
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-02-23
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="我的订阅")
|
||||
@RestController
|
||||
@RequestMapping("/phone/subscribe/onlCgformSubscribe")
|
||||
@Slf4j
|
||||
public class PhoneOnlCgformSubscribeController extends JeroController<OnlCgformSubscribe, IOnlCgformSubscribeService> {
|
||||
@Autowired
|
||||
private IOnlCgformSubscribeService onlCgformSubscribeService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param onlCgformSubscribe
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的订阅-分页列表查询")
|
||||
@ApiOperation(value="我的订阅-分页列表查询", notes="我的订阅-分页列表查询")
|
||||
@PostMapping(value = "/page")
|
||||
public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
|
||||
/*
|
||||
public Result<?> queryPageList(OnlCgformSubscribe onlCgformSubscribe,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<OnlCgformSubscribe> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformSubscribe, req.getParameterMap());
|
||||
Page<OnlCgformSubscribe> page = new Page<OnlCgformSubscribe>(pageNo, pageSize);
|
||||
IPage<OnlCgformSubscribe> pageList = onlCgformSubscribeService.page(page, queryWrapper);
|
||||
*/
|
||||
IPage<OnlCgformSubscribe> pageList = onlCgformSubscribeService.queryPageList(params);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 表头中英文切换
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的订阅-表头中英文切换")
|
||||
@ApiOperation(value="我的订阅-表头中英文切换", notes="我的订阅-表头中英文切换")
|
||||
@GetMapping(value = "/getHeader")
|
||||
public Result<List<Map<String, Object>>> getHeader(@RequestParam(name = "flag") String flag,
|
||||
@RequestParam(name = "cut") String cut) {
|
||||
List<Map<String, Object>> list =onlCgformSubscribeService.getHeader(flag, cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件中英文切换
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的订阅-查询条件中英文切换")
|
||||
@ApiOperation(value="我的订阅-查询条件中英文切换", notes="我的订阅-查询条件中英文切换")
|
||||
@GetMapping(value = "/queryCondition")
|
||||
public Result<List<Map<String, Object>>> queryCondition(@RequestParam(name = "flag") String flag,
|
||||
@RequestParam(name = "cut") String cut) {
|
||||
List<Map<String, Object>> list = onlCgformSubscribeService.queryCondition(flag, cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的订阅-列表查询")
|
||||
@ApiOperation(value="我的订阅-列表查询", notes="我的订阅-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<OnlCgformSubscribe>> queryList(OnlCgformSubscribe onlCgformSubscribe) {
|
||||
List<OnlCgformSubscribe> list = onlCgformSubscribeService.queryList(onlCgformSubscribe);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param onlCgformSubscribe
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的订阅-添加")
|
||||
@ApiOperation(value="我的订阅-添加", notes="我的订阅-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody OnlCgformSubscribe onlCgformSubscribe) {
|
||||
LambdaQueryWrapper<OnlCgformSubscribe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(OnlCgformSubscribe::getDocumentId, onlCgformSubscribe.getDocumentId())
|
||||
.eq(OnlCgformSubscribe::getId, onlCgformSubscribe.getId());
|
||||
int count = onlCgformSubscribeService.count(lambdaQueryWrapper);
|
||||
if (count == 0) {
|
||||
onlCgformSubscribeService.add(onlCgformSubscribe);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
else{
|
||||
return Result.error("该值不可重复添加,系统中已存在");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param onlCgformSubscribe
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的订阅-编辑")
|
||||
@ApiOperation(value="我的订阅-编辑", notes="我的订阅-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody OnlCgformSubscribe onlCgformSubscribe) {
|
||||
onlCgformSubscribeService.editById(onlCgformSubscribe);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的订阅-通过id删除")
|
||||
@ApiOperation(value="我的订阅-通过id删除", notes="我的订阅-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
onlCgformSubscribeService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的订阅-批量删除")
|
||||
@ApiOperation(value="我的订阅-批量删除", notes="我的订阅-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.onlCgformSubscribeService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的订阅-通过id查询")
|
||||
@ApiOperation(value="我的订阅-通过id查询", notes="我的订阅-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
OnlCgformSubscribe onlCgformSubscribe = onlCgformSubscribeService.queryById(id);
|
||||
if(onlCgformSubscribe==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(onlCgformSubscribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param onlCgformSubscribe
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, OnlCgformSubscribe onlCgformSubscribe) {
|
||||
return super.exportXls(request, onlCgformSubscribe, OnlCgformSubscribe.class, "我的订阅");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, OnlCgformSubscribe.class);
|
||||
}
|
||||
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.jero.modules.todoCenter.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags="待办中心-项目流程")
|
||||
@RestController
|
||||
@RequestMapping("/phone/todoCenter/projectProcess")
|
||||
@Slf4j
|
||||
public class PhoneProjectProcessTodoCenterController {
|
||||
|
||||
@Autowired
|
||||
private IProcessInfoEOService processInfoEOService;
|
||||
|
||||
@AutoLog(value = "分页查询-待办任务列表")
|
||||
@ApiOperation(value="分页查询-待办任务列表", notes="分页查询-待办任务列表")
|
||||
@GetMapping(value = "/todoTaskList")
|
||||
public Result<?> todoTaskList(@RequestParam Map<String,Object> params) {
|
||||
IPage page = this.processInfoEOService.projectProcessTodoTaskList(params);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@AutoLog(value = "分页查询-已办任务列表")
|
||||
@ApiOperation(value="分页查询-已办任务列表", notes="分页查询-已办任务列表")
|
||||
@GetMapping(value = "/doneProcess")
|
||||
public Result<?> doneProcess(@RequestParam Map<String,Object> params) {
|
||||
IPage page = this.processInfoEOService.projectProcessDoneProcess(params);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@AutoLog(value = "分页查询-已发任务列表")
|
||||
@ApiOperation(value="分页查询-已发任务列表", notes="分页查询-已发任务列表")
|
||||
@GetMapping(value = "/issuedProcess")
|
||||
public Result<?> issuedProcess(@RequestParam Map<String,Object> params) {
|
||||
IPage page = this.processInfoEOService.projectProcessIssuedProcess(params);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@AutoLog(value = "待办中心-法规评估-初始化历史数据")
|
||||
@ApiOperation(value="待办中心-法规评估-初始化历史数据", notes="待办中心-法规评估-初始化历史数据")
|
||||
@GetMapping(value = "/initHistoryData")
|
||||
public Result<?> initHistoryData(@RequestParam Map<String,Object> params) {
|
||||
return this.processInfoEOService.initHistoryData(params);
|
||||
}
|
||||
|
||||
@AutoLog(value = "待办中心-符合性流程数据迁移")
|
||||
@ApiOperation(value="待办中心-符合性流程数据迁移", notes="待办中心-符合性流程数据迁移")
|
||||
@GetMapping(value = "/complianceDataMigration")
|
||||
public Result<?> complianceDataMigration(@RequestParam Map<String,Object> params) {
|
||||
return this.processInfoEOService.complianceDataMigration(params);
|
||||
}
|
||||
}
|
||||
+198
@@ -0,0 +1,198 @@
|
||||
package com.jero.modules.wkflow.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.wkflow.entity.ProcessHistoryEO;
|
||||
import com.jero.modules.wkflow.service.IProcessHistoryEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 流程历史表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-05-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="流程历史表")
|
||||
@RestController
|
||||
@RequestMapping("/phone/wkflow/processHistoryEO")
|
||||
@Slf4j
|
||||
public class PhoneProcessHistoryEOController extends JeroController<ProcessHistoryEO, IProcessHistoryEOService> {
|
||||
@Autowired
|
||||
private IProcessHistoryEOService processHistoryEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param processHistoryEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程历史表-分页列表查询")
|
||||
@ApiOperation(value="流程历史表-分页列表查询", notes="流程历史表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(ProcessHistoryEO processHistoryEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ProcessHistoryEO> queryWrapper = QueryGenerator.initQueryWrapper(processHistoryEO, req.getParameterMap());
|
||||
Page<ProcessHistoryEO> page = new Page<ProcessHistoryEO>(pageNo, pageSize);
|
||||
IPage<ProcessHistoryEO> pageList = processHistoryEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程历史表-列表查询")
|
||||
@ApiOperation(value="流程历史表-列表查询", notes="流程历史表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ProcessHistoryEO>> queryList(@RequestParam Map<String,Object> params) {
|
||||
List<ProcessHistoryEO> list = processHistoryEOService.queryList(params);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param processHistoryEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程历史表-添加")
|
||||
@ApiOperation(value="流程历史表-添加", notes="流程历史表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ProcessHistoryEO processHistoryEO) {
|
||||
processHistoryEOService.add(processHistoryEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param processHistoryEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程历史表-编辑")
|
||||
@ApiOperation(value="流程历史表-编辑", notes="流程历史表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ProcessHistoryEO processHistoryEO) {
|
||||
processHistoryEOService.editById(processHistoryEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程历史表-通过id删除")
|
||||
@ApiOperation(value="流程历史表-通过id删除", notes="流程历史表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
processHistoryEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程历史表-批量删除")
|
||||
@ApiOperation(value="流程历史表-批量删除", notes="流程历史表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.processHistoryEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程历史表-通过id查询")
|
||||
@ApiOperation(value="流程历史表-通过id查询", notes="流程历史表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ProcessHistoryEO processHistoryEO = processHistoryEOService.queryById(id);
|
||||
if(processHistoryEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(processHistoryEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param processHistoryEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProcessHistoryEO processHistoryEO) {
|
||||
return super.exportXls(request, processHistoryEO, ProcessHistoryEO.class, "流程历史表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ProcessHistoryEO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程调用接口
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-任务清单表-流程调用")
|
||||
@ApiOperation(value="项目库-任务清单表-流程调用", notes="项目库-任务清单表-流程调用")
|
||||
@PostMapping(value = "/processCall")
|
||||
public Result<?> processCall(@RequestBody JSONObject jsonObject){
|
||||
return this.processHistoryEOService.processCall(jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程历史表-符合性流程-列表查询")
|
||||
@ApiOperation(value="流程历史表-符合性流程-列表查询", notes="流程历史表-符合性流程-列表查询")
|
||||
@GetMapping(value = "/queryComplianceProcessHistoryList")
|
||||
public Result<List<ProcessHistoryEO>> queryComplianceProcessHistoryList(@RequestParam Map<String,Object> params) {
|
||||
List<ProcessHistoryEO> list = processHistoryEOService.queryComplianceProcessHistoryList(params);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
}
|
||||
+285
@@ -0,0 +1,285 @@
|
||||
package com.jero.modules.wkflow.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.entity.ProjectNameInfoEO;
|
||||
import com.jero.modules.project.entity.ProjectYearNameInfoEO;
|
||||
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
||||
import com.jero.modules.project.service.IProjectLibraryBaseService;
|
||||
import com.jero.modules.project.service.IProjectNameInfoEOService;
|
||||
import com.jero.modules.project.service.IProjectYearNameInfoEOService;
|
||||
import com.jero.modules.wkflow.entity.BusMes;
|
||||
import com.jero.modules.wkflow.entity.BusProcessName;
|
||||
import com.jero.modules.wkflow.entity.BusProcessNew;
|
||||
import com.jero.modules.wkflow.entity.TaskCommonQuery;
|
||||
import com.jero.modules.wkflow.enums.FlowTypeEnum;
|
||||
import com.jero.modules.wkflow.feginClient.impl.TaskFeignClientImpl;
|
||||
import com.jero.modules.wkflow.page.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.zhyd.oauth.utils.StringUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags="待办任务")
|
||||
@RestController
|
||||
@RequestMapping("/phone/task")
|
||||
public class PhoneTaskController {
|
||||
|
||||
@Autowired
|
||||
private TaskFeignClientImpl taskFeignClient;
|
||||
@Autowired
|
||||
private IProjectLawsInventoryEOService projectLawsInventoryEOService;
|
||||
@Autowired
|
||||
private IProjectLibraryBaseService projectLibraryBaseService;
|
||||
@Autowired
|
||||
private IProjectNameInfoEOService projectNameInfoEOService;
|
||||
@Autowired
|
||||
private IProjectYearNameInfoEOService projectYearNameInfoEOService;
|
||||
|
||||
/**
|
||||
* 通用接口
|
||||
* @param taskIds
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "查询待办任务数据")
|
||||
@ApiOperation(value="查询待办任务数据", notes="查询待办任务数据")
|
||||
@GetMapping("/queryTaskByTaskIds")
|
||||
public BusProcessNew queryTaskByTaskIds(@RequestParam("taskIds") String taskIds){
|
||||
return taskFeignClient.queryTaskByTaskIds(taskIds);
|
||||
}
|
||||
|
||||
@AutoLog(value = "根据待办id,查询任务明细数据")
|
||||
@ApiOperation(value="根据待办id,查询任务明细数据", notes="根据待办id,查询任务明细数据")
|
||||
@GetMapping("/queryTaskDetailByTaskIds")
|
||||
public String queryTaskDetailByTaskIds(@RequestParam("taskIds") String taskIds) {
|
||||
return taskFeignClient.queryTaskDetailByTaskIds(taskIds);
|
||||
}
|
||||
|
||||
@AutoLog(value = "保存任务")
|
||||
@ApiOperation(value="保存任务", notes="保存任务")
|
||||
@PostMapping("/saveTask")
|
||||
public Result<String> saveTask(@RequestBody BusMes busMes){
|
||||
return taskFeignClient.saveTask(busMes);
|
||||
}
|
||||
|
||||
@AutoLog(value = "我的已办任务列表")
|
||||
@ApiOperation(value="我的已办任务列表", notes="我的已办任务列表")
|
||||
@PostMapping("/hastodoTasksList")
|
||||
public Result<Map<String, Object>> HastodoTasksListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
return taskFeignClient.HastodoTasksListByUserId(taskCommonQuery);
|
||||
}
|
||||
|
||||
@AutoLog(value = "我的待办任务列表")
|
||||
@ApiOperation(value="我的待办任务列表", notes="我的待办任务列表")
|
||||
@PostMapping("/todoTaskList")
|
||||
public Page todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
taskCommonQuery.setUserId(sysUser.getId());
|
||||
List<BusProcessName> busProcessNames = taskFeignClient.todoTaskListByUserId(taskCommonQuery);
|
||||
List list1 = this.startPage(busProcessNames, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
Page pageInfo = new Page();
|
||||
if(busProcessNames!=null){
|
||||
this.disposeTaskToConfirm(busProcessNames,taskCommonQuery);
|
||||
pageInfo.setList(list1);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(busProcessNames.size()));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}else{
|
||||
List<BusProcessName> list = new ArrayList<>();
|
||||
pageInfo.setList(list);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(0));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理任务确认流程回显数据
|
||||
* @param busProcessNames
|
||||
*/
|
||||
public void disposeTaskToConfirm(List<BusProcessName> busProcessNames,TaskCommonQuery taskCommonQuery){
|
||||
List<String> projectLawsInventoryIdList = busProcessNames.stream().filter(busProcessName -> {
|
||||
boolean flag = false;
|
||||
if(org.apache.commons.lang3.StringUtils.equals(busProcessName.getPrcType(), FlowTypeEnum.RWQRLC.getValue())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(BusProcessName::getProjectLawsInventoryId).distinct().collect(Collectors.toList());
|
||||
List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = new ArrayList<>();
|
||||
|
||||
if(CollectionUtils.isNotEmpty(projectLawsInventoryIdList)){
|
||||
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryQueryWrap = new QueryWrapper<>();
|
||||
lawsInventoryQueryWrap.lambda().in(ProjectLawsInventoryEO::getId,projectLawsInventoryIdList);
|
||||
projectLawsInventoryEOList = this.projectLawsInventoryEOService.list(lawsInventoryQueryWrap);
|
||||
|
||||
List<String> projectLibraryIdList = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(projectLibraryIdList)){
|
||||
QueryWrapper<ProjectLibraryBase> libraryBaseQueryWrap = new QueryWrapper<>();
|
||||
libraryBaseQueryWrap.lambda().in(ProjectLibraryBase::getId,projectLibraryIdList);
|
||||
projectLibraryBaseList = this.projectLibraryBaseService.list(libraryBaseQueryWrap);
|
||||
this.projectLibraryBaseService.disposeData(projectLibraryBaseList,taskCommonQuery.getCut(),true);
|
||||
}
|
||||
for (BusProcessName busProcessName : busProcessNames) {
|
||||
if(org.apache.commons.lang3.StringUtils.equals(busProcessName.getPrcType(),FlowTypeEnum.RWQRLC.getValue())){
|
||||
if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryS = projectLawsInventoryEOList.stream().filter(lawsInventory -> {
|
||||
boolean flag = false;
|
||||
if(org.apache.commons.lang3.StringUtils.equals(busProcessName.getProjectLawsInventoryId(),lawsInventory.getId())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(projectLawsInventoryS) && CollectionUtils.isNotEmpty(projectLibraryBaseList)){
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryS.get(0);
|
||||
busProcessName.setSerialNumber(projectLawsInventoryEO.getSerialNumber());
|
||||
busProcessName.setTitle(projectLawsInventoryEO.getTitle());
|
||||
|
||||
List<ProjectLibraryBase> projectLibraryBaseS = projectLibraryBaseList.stream().filter(projectLibraryBase -> {
|
||||
boolean flag = false;
|
||||
if (org.apache.commons.lang3.StringUtils.equals(projectLibraryBase.getId(), projectLawsInventoryEO.getProjectLibraryId())) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(projectLibraryBaseS)){
|
||||
ProjectLibraryBase projectLibraryBase = projectLibraryBaseS.get(0);
|
||||
ProjectNameInfoEO projectNameInfoEO = this.projectNameInfoEOService.getOne(
|
||||
new QueryWrapper<ProjectNameInfoEO>().lambda().eq(ProjectNameInfoEO::getId, projectLibraryBase.getProjectNameId())
|
||||
);
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = this.projectYearNameInfoEOService.getOne(
|
||||
new QueryWrapper<ProjectYearNameInfoEO>().lambda().eq(ProjectYearNameInfoEO::getId, projectLibraryBase.getYearNameId())
|
||||
);
|
||||
|
||||
busProcessName.setProjectName(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" +projectLibraryBase.getTargetMarketName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@AutoLog(value = "查询草稿")
|
||||
@ApiOperation(value="查询草稿", notes="查询草稿")
|
||||
@PostMapping("/queryTaskDraft")
|
||||
public Page queryTaskDraft(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
List<BusProcessName> busProcessNames = taskFeignClient.queryTaskDraft(taskCommonQuery);
|
||||
List list1 = this.startPage(busProcessNames, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
Page pageInfo = new Page();
|
||||
if(busProcessNames!=null){
|
||||
pageInfo.setList(list1);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(busProcessNames.size()));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}else{
|
||||
List<BusProcessName> list = new ArrayList<BusProcessName>();
|
||||
pageInfo.setList(list);
|
||||
pageInfo.setPageNo(taskCommonQuery.getCurrent());
|
||||
pageInfo.setCount(Long.valueOf(0));
|
||||
pageInfo.setPageSize(taskCommonQuery.getSize());
|
||||
}
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@AutoLog(value = "已办流程")
|
||||
@ApiOperation(value="已办流程", notes="已办流程")
|
||||
@PostMapping("/doneProcess")
|
||||
public Page doneProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
taskCommonQuery.setUserId(sysUser.getId());
|
||||
return taskFeignClient.doneProcess(taskCommonQuery);
|
||||
}
|
||||
|
||||
@AutoLog(value = "已发流程")
|
||||
@ApiOperation(value="已发流程", notes="已发流程")
|
||||
@PostMapping("/IssuedProcess")
|
||||
public Page IssuedProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
taskCommonQuery.setUserId(sysUser.getId());
|
||||
return taskFeignClient.issuedProcess(taskCommonQuery);
|
||||
}
|
||||
|
||||
@AutoLog(value = "监控流程列表")
|
||||
@ApiOperation(value="监控流程列表", notes="监控流程列表")
|
||||
@PostMapping("/allProcess")
|
||||
public Page allProcess(@RequestBody TaskCommonQuery taskCommonQuery){
|
||||
return taskFeignClient.allProcess(taskCommonQuery);
|
||||
}
|
||||
|
||||
@AutoLog(value = "已办流程-根据taskId查询已办明细")
|
||||
@ApiOperation(value="已办流程-根据taskId查询已办明细", notes="已办流程-根据taskId查询已办明细")
|
||||
@GetMapping("/haveFinishedFlowDetail")
|
||||
public String haveFinishedFlowDetail(@RequestParam Map<String,Object> params){
|
||||
/**
|
||||
* params
|
||||
* taskId: 待办id 不能为null
|
||||
*/
|
||||
if(StringUtils.isEmpty((String) params.get("taskId"))){
|
||||
throw new RuntimeException("待办id不能为空。");
|
||||
}
|
||||
return taskFeignClient.haveFinishedFlowDetail(params);
|
||||
}
|
||||
|
||||
@AutoLog(value = "删除草稿")
|
||||
@ApiOperation(value="删除草稿", notes="删除草稿")
|
||||
@GetMapping("/deleteDraft")
|
||||
public Result<String> deleteDraft(@RequestParam("id")String id){
|
||||
return taskFeignClient.deleteDraft(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始分页
|
||||
* @param list
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 每页多少条数据
|
||||
* @return
|
||||
*/
|
||||
public static List startPage(List list, Integer pageNum,
|
||||
Integer pageSize) {
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
if (list.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Integer count = list.size(); // 记录总数
|
||||
Integer pageCount = 0; // 页数
|
||||
if (count % pageSize == 0) {
|
||||
pageCount = count / pageSize;
|
||||
} else {
|
||||
pageCount = count / pageSize + 1;
|
||||
}
|
||||
|
||||
int fromIndex = 0; // 开始索引
|
||||
int toIndex = 0; // 结束索引
|
||||
|
||||
if (pageNum != pageCount) {
|
||||
fromIndex = (pageNum - 1) * pageSize;
|
||||
toIndex = fromIndex + pageSize;
|
||||
} else {
|
||||
fromIndex = (pageNum - 1) * pageSize;
|
||||
toIndex = count;
|
||||
}
|
||||
|
||||
List pageList = list.subList(fromIndex, toIndex);
|
||||
|
||||
return pageList;
|
||||
}
|
||||
}
|
||||
@@ -253,13 +253,13 @@ export default {
|
||||
return that.Logout({}).then(() => {
|
||||
// update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
|
||||
// TODO 在部署线上时注掉以下代码
|
||||
that.$router.push({ path: '/user/login' })
|
||||
// that.$router.push({ path: '/user/login' })
|
||||
|
||||
// window.location.href = 'https://signin-test.nio.com/logout?client_id=100679&redirect_uri=' +
|
||||
// encodeURIComponent('http://localhost:3000/dashboard/analysis') + '&response_type=code' //本地
|
||||
// TODO 在部署线上时解开以下代码
|
||||
// window.location.href = 'https://signin.nio.com/logout?client_id=100679&redirect_uri=' +
|
||||
// encodeURIComponent('http://grp.nioint.com/dashboard/analysis') + '&response_type=code' //线上
|
||||
window.location.href = 'https://signin.nio.com/logout?client_id=100679&redirect_uri=' +
|
||||
encodeURIComponent(window.loginUrl) + '&response_type=code' //线上
|
||||
|
||||
localStorage.removeItem('language')
|
||||
// update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
|
||||
|
||||
@@ -135,10 +135,19 @@ const user = {
|
||||
const menuData = response.result.menu
|
||||
const authData = response.result.auth
|
||||
const allAuthData = response.result.allAuth
|
||||
window._CONFIG['domianPreviewURL'] = Vue.ls.get('domianPreviewURL') + '/jero-boot'
|
||||
window._CONFIG['domianWebSocketURL'] = Vue.ls.get('domianWebSocketURL') + '/jero-boot'
|
||||
window._CONFIG['onlinePreviewDomainURL'] = Vue.ls.get('onlinePreviewDomainURL') + '/onlinePreview'
|
||||
window._CONFIG['domianWebImgURL'] = Vue.ls.get('domianWebImgURL') + '/jero-boot'
|
||||
let isPhone = localStorage.getItem('isPhone')
|
||||
if (isPhone == 'yes'){
|
||||
window._CONFIG['domianPreviewURL'] = Vue.ls.get('domianPreviewURL') + '/jero-boot'
|
||||
window._CONFIG['domianWebSocketURL'] = Vue.ls.get('domianWebSocketURL') + '/jero-boot'
|
||||
window._CONFIG['onlinePreviewDomainURL'] = Vue.ls.get('onlinePreviewDomainURL') + '/onlinePreview'
|
||||
window._CONFIG['domianWebImgURL'] = Vue.ls.get('domianWebImgURL') + '/jero-boot'
|
||||
}else{
|
||||
window._CONFIG['domianPreviewURL'] = Vue.ls.get('domianPreviewURL') + '/jero-boot'
|
||||
window._CONFIG['domianWebSocketURL'] = Vue.ls.get('domianWebSocketURL') + '/jero-boot'
|
||||
window._CONFIG['onlinePreviewDomainURL'] = Vue.ls.get('onlinePreviewDomainURL') + '/onlinePreview'
|
||||
window._CONFIG['domianWebImgURL'] = Vue.ls.get('domianWebImgURL') + '/jero-boot'
|
||||
}
|
||||
|
||||
window._CONFIG['httpsOnlinePreviewDomainURL'] = Vue.ls.get('httpsOnlinePreviewDomainURL') + '/onlinePreview'
|
||||
//Vue.ls.set(USER_AUTH,authData);
|
||||
sessionStorage.setItem(USER_AUTH, JSON.stringify(authData))
|
||||
|
||||
@@ -11,7 +11,15 @@ import { ACCESS_TOKEN, TENANT_ID } from '@/store/mutation-types'
|
||||
* 则映射后端域名,通过 vue.config.js
|
||||
* @type {*|string}
|
||||
*/
|
||||
let apiBaseUrl = window._CONFIG['domianURL'] || '/jero-boot'
|
||||
|
||||
let apiBaseUrl = ''
|
||||
let isPhone = localStorage.getItem('isPhone')
|
||||
if (isPhone == 'yes'){
|
||||
apiBaseUrl = '/jero-boot/phone'
|
||||
}else{
|
||||
apiBaseUrl = '/jero-boot'
|
||||
}
|
||||
// let apiBaseUrl = window._CONFIG['domianURL'] || '/jero-boot'
|
||||
//console.log("apiBaseUrl= ",apiBaseUrl)
|
||||
// 创建 axios 实例
|
||||
const service = axios.create({
|
||||
|
||||
Reference in New Issue
Block a user