diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java index 01b61fbc4..980c025a0 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java @@ -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"); //第三方登录 @@ -140,6 +143,7 @@ public class ShiroConfig { filterChainDefinitionMap.put("/actuator/**", "anon"); filterChainDefinitionMap.put("/opensso/**", "anon"); //单点登录 + filterChainDefinitionMap.put("/phone/opensso/**", "anon"); //单点登录 filterChainDefinitionMap.put("/project/projectLibraryBase/getProjectInfo", "anon"); // 对接火山引擎接口-获取项目统计信息 filterChainDefinitionMap.put("/project/projectLibraryBase/getProjectProgressInfo", "anon"); // 对接火山引擎接口-获取项目统计信息 @@ -147,6 +151,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"); // 法规收集历史 工作流处理数据接口排除 // 法规技术评估表-流程明细 工作流处理数据接口排除 diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/config/entity/SysConfig.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/config/entity/SysConfig.java index 012ef73fb..0351866cd 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/config/entity/SysConfig.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/config/entity/SysConfig.java @@ -71,4 +71,10 @@ public class SysConfig implements Serializable { @ApiModelProperty(value = "配置信息说明") private java.lang.String configName; + + /**手机配置信息*/ + @Excel(name = "手机配置信息", width = 15) + @ApiModelProperty(value = "手机配置信息") + private java.lang.String phoneConfig; + } diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/opensso/controller/PhoneSSOLoginController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/opensso/controller/PhoneSSOLoginController.java new file mode 100644 index 000000000..75a2b76ee --- /dev/null +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/opensso/controller/PhoneSSOLoginController.java @@ -0,0 +1,222 @@ +package com.jero.modules.opensso.controller; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.common.constant.CommonConstant; +import com.jero.common.system.util.JwtUtil; +import com.jero.common.system.vo.LoginUser; +import com.jero.common.util.RedisUtil; +import com.jero.common.util.oConvertUtils; +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.service.ISysDepartService; +import com.jero.modules.system.service.ISysDictService; +import com.jero.modules.system.service.ISysUserService; +import com.jero.modules.system.util.HttpRequestUtil; +import com.jero.modules.system.util.StringUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +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 javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Author: liyawei + * @Description: + * @Date: Created in 11:19 2022/3/17 + */ +@RestController +@RequestMapping("/phone/opensso") +@Api(tags="单点登录") +@Slf4j +public class PhoneSSOLoginController { + @Autowired + private ISysUserService sysUserService; + @Autowired + private RedisUtil redisUtil; + @Autowired + private ISysDepartService sysDepartService; + @Autowired + private ISysDictService sysDictService; + @Resource + private BaseCommonService baseCommonService; + @Autowired + private ISysConfigService iSysConfigService; + + 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; + + @Value("${opensso.authorizeUrl}") + private String authorizeUrl; + @Value("${opensso.accessTokenUrl}") + private String accessTokenUrl; + @Value("${opensso.profileUrl}") + private String profileUrl; + @Value("${opensso.clientId}") + private String clientId; + @Value("${opensso.clientSecret}") + private String clientSecret; + @Value("${opensso.redirectUri}") + private String redirectUri; + + @AutoLog(value = "跳转至认证中心") + @ApiOperation(value = "跳转至认证中心", notes = "跳转至认证中心") + @GetMapping(value = "/ssoAuth") + public void ssoAuth(HttpServletRequest request, HttpServletResponse response){ + String callbackUri = "http%3A%2F%2F139.9.235.66%3A8008%2Fjero-boot%2Fopensso%2Fcallback"; + String authUrl = authorizeUrl +"?client_id=" + clientId + + "&redirect_uri=" + redirectUri + "&response_type=code"; + try { + response.sendRedirect(authUrl); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + } + //https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=http%3A%2F%2F139.9.235.66%3A8008%2Fjero-boot%2Fopensso%2Fcallback&response_type=code + //https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=http%3A%2F%2F139.9.235.66%3A8010&response_type=code + + //http://139.9.235.66:8010 + @AutoLog(value = "单点登录回调") + @ApiOperation(value = "单点登录回调", notes = "单点登录回调") + @GetMapping(value = "/callback") + public Result callback(@RequestParam(value = "code", required = false) String code, + HttpServletRequest request, HttpServletResponse response) throws IOException { + Result result = new Result(); + // 获取access_token + String getAccessTokenUrl = accessTokenUrl + "?client_id=" + clientId + "&client_secret=" + + clientSecret + "&redirect_uri=" + redirectUri + "&code=" + code; + log.info("access_token_url:" + getAccessTokenUrl); + Map headerMapToken = new HashMap<>(); + headerMapToken.put("Content-Type", "text/html;charset=utf-8"); + String accessTokenResult = HttpRequestUtil.getResponseOfGET(getAccessTokenUrl, headerMapToken); +// String accessTokenResult = "access_token=2.0N6OFCARTH7MRCVPSENQONSA67WGHV4FDR25TSHFCCXI6FA3NRVAA----&expires=602405"; + log.info("获取access_token返回结果:" + accessTokenResult); + // 返回结果:access_token=2.0N6OFCARTH7MRCVPSENQONSA67WGHV4FDR25TSHFCCXI6FA3NRVAA----&expires=602405 + if(StringUtils.isEmpty(accessTokenResult) || !accessTokenResult.contains("access_token")){ + return Result.error("【单点登录】获取access_token失败"); + } + int start = accessTokenResult.indexOf("="); + int end = accessTokenResult.indexOf("&"); + String accessToken = accessTokenResult.substring(start+1, end); + + //https://signin-test.nio.com/oauth2/profile?access_token=2.0N6OFCARTH7MRCVPSENQONSA67WGHV4FDR25TSHFCCXI6FA3NRVAA---- + //获取登录用户 + String getProfileUrl = profileUrl + "?access_token=" + accessToken; + log.info("profile_url:" + getProfileUrl); + Map headerMapProfile = new HashMap<>(); + headerMapProfile.put("Content-Type", "application/json; charset=utf-8"); + String profileResult = HttpRequestUtil.getResponseOfGET(getProfileUrl, headerMapProfile); +// String profileResult = "{ id: \"chengjun.wang.o\", attributes: [{workNo: \"\"},{account_id: \"\"},{user_name: \"chengjun.wang.o\"},{email: \"chengjun.wang.o@nio.com\"}]}"; + log.info("获取profile返回结果:" + profileResult); + // 返回结果:{ id: "chengjun.wang.o", attributes: [{workNo: ""},{account_id: ""},{user_name: "chengjun.wang.o"},{email: "chengjun.wang.o@nio.com"}]} + JSONObject userThirdIdJson = JSONObject.parseObject(profileResult); + if(ObjectUtil.isEmpty(userThirdIdJson) || !userThirdIdJson.containsKey("id")){ + return Result.error("【单点登录】获取用户profile失败"); + } + String userThirdId = userThirdIdJson.getString("id"); + String username = userThirdId; + + //1. 校验用户是否有效 + //update-begin-author:wangshuai date:20200601 for: 登录代码验证用户是否注销bug,if条件永远为false + LambdaQueryWrapper 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; + } + + //登录成功,清除错误登录次数 + 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 sysUser + * @param result + * @return + */ + private Result userInfo(SysUser sysUser, Result 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 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 userRoleListInfo = sysUserService.queryUserRoleListInfoByUserId(sysUser.getId()); + sysUser.setUserRoleList(userRoleListInfo); + + //获取配置信息 + List sysConfigs = iSysConfigService.queryList(); + if(CollectionUtils.isNotEmpty(sysConfigs)){ + for (SysConfig sysConfig : sysConfigs) { + obj.put(sysConfig.getConfigName(),sysConfig.getPhoneConfig()); + } + } + + obj.put("token", token); + obj.put("userInfo", sysUser); + obj.put("sysAllDictItems", sysDictService.queryAllDictItems()); + result.setResult(obj); + result.success("登录成功"); + return result; + } +} diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneCommonController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneCommonController.java new file mode 100644 index 000000000..ff4618f18 --- /dev/null +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneCommonController.java @@ -0,0 +1,774 @@ +package com.jero.modules.system.controller; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.jero.common.api.vo.Result; +import com.jero.common.constant.enums.CutEnum; +import com.jero.common.exception.JeroBootException; +import com.jero.common.system.api.ISysBaseAPI; +import com.jero.common.util.RestUtil; +import com.jero.common.util.TokenUtils; +import com.jero.common.util.oConvertUtils; +import com.jero.common.util.oss.CosBootUtil; +import com.jero.modules.oss.entity.OSSFile; +import com.jero.modules.oss.service.IOSSFileService; +import com.jero.modules.system.util.PDFUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.http.server.ServletServerHttpRequest; +import org.springframework.util.AntPathMatcher; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.HandlerMapping; +import org.springframework.web.servlet.ModelAndView; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.net.URLDecoder; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + *

+ * 用户表 前端控制器 + *

+ * + * @Author scott + * @since 2018-12-20 + */ +@Api(tags="文件通用") +@Slf4j +@RestController +@RequestMapping("/phone/sys/common") +public class PhoneCommonController { + + @Autowired + private ISysBaseAPI sysBaseAPI; + + @Resource + private IOSSFileService ossFileService; + + @Value(value = "${jero.path.upload}") + private String uploadpath; + + /** + * 本地:local minio:minio 阿里:alioss + */ + @Value(value="${jero.uploadType}") + private String uploadType; + /** + * 文件后缀黑名单 + */ + @Value(value="${jero.fileSuffixLimits}") + private String[] fileSuffixLimits; + + /** + * @Author 政辉 + * @return + */ + @GetMapping("/403") + public Result noauth() { + return Result.error("没有权限,请联系管理员授权"); + } + +// /** +// * 文件上传统一方法 +// * @param request +// * @param response +// * @return +// */ +// @PostMapping(value = "/upload") +// public Result upload(HttpServletRequest request, HttpServletResponse response) { +// Result result = new Result<>(); +// String savePath = ""; +// String bizPath = request.getParameter("biz"); +// MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; +// // 获取上传文件对象 +// MultipartFile file = multipartRequest.getFile("file"); +// // 文件类型是否处于黑名单 +// if(CommonUtils.limitFileSuffix(file.getOriginalFilename(),fileSuffixLimits)){ +// result.setMessage("该文件类型不允许上传"); +// result.setSuccess(false); +// result.setCode(0); +// return result; +// } +// if(oConvertUtils.isEmpty(bizPath)){ +// bizPath = ""; +// } +// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){ +// // 本地上传 +// savePath = CommonUtils.uploadLocal(file,bizPath,uploadpath); +// }else{ +// // minio上传 +// savePath = CommonUtils.upload(file, bizPath, uploadType); +// } +// if(oConvertUtils.isNotEmpty(savePath)){ +// //上传成功 进行数据库存储 +// OSSFile ossFile = new OSSFile(); +// // 文件名 +// String fileName = file.getOriginalFilename(); +// fileName = CommonUtils.getFileName(fileName); +// ossFile.setFileName(fileName); +// ossFile.setUrl(savePath); +// ossFileService.save(ossFile); +// result.setMessage(savePath); +// result.setResult(ossFile); +// result.setSuccess(true); +// }else { +// result.setMessage("上传失败!"); +// result.setSuccess(false); +// } +// return result; +// } + + /** + * 文件上传统一方法 + * + * @param request + * @param response + * @return + */ + @ApiOperation(value="文件上传统一方法", notes="文件上传统一方法") + @PostMapping(value = "/upload") + public Result upload(HttpServletRequest request, HttpServletResponse response, + @RequestParam(value = "state",required = false) String state, + @RequestParam(value = "cut",required = false) String cut) { + Result result = new Result<>(); + String bizPath = request.getParameter("biz"); + MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; + MultipartFile file = multipartRequest.getFile("file");// 获取上传文件对象 + if (oConvertUtils.isEmpty(bizPath)) { + bizPath = ""; +// if (CommonConstant.UPLOAD_TYPE_OSS.equals(uploadType)) { +// //未指定目录,则用阿里云默认目录 upload +// bizPath = "upload"; +// } else { +// bizPath = ""; +// } + } + if(file.getOriginalFilename().length()>100){ + if(StringUtils.equals(cut,CutEnum.CN.getValue())){ + throw new JeroBootException("文件名长度不能超过100位,请检查!"); + }else if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + throw new JeroBootException("File name length cannot exceed 100 characters, please check!"); + } + } +// OSSFile oSSFile = ossFileService.uploadLocal(file, bizPath,state,cut); + OSSFile oSSFile = ossFileService.uploadLocalOfCos(file, bizPath,state,cut); // 切换cos + if (oConvertUtils.isNotEmpty(oSSFile)) { + result.setResult(oSSFile); + result.setSuccess(true); + } else { + if("cut".equals(CutEnum.CN.getValue())){ + result.setMessage("上传失败!"); + }else{ + result.setMessage("fail to upload!"); + } + result.setSuccess(false); + } + return result; + } + + public static void main(String[] args) { + + } + + /** + * 查看已上传的文件 + * @param id + * @return + */ + @ApiOperation(value="查看已上传的文件", notes="查看已上传的文件") + @GetMapping(value = "/getFileInfos") + public Result getFileInfos(String id) { + List fileInfos = ossFileService.getFileInfos(id); + return Result.OK(fileInfos); + } + + + /** + * 预览图片&下载文件 + * + * @param id 传入文件id + * @param request + * @param response + */ +// @GetMapping(value = "/download/{id}") +// public void view(@PathVariable String id,HttpServletRequest request, HttpServletResponse response) { +// // 查询数据表数据是否存在 +// LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); +// queryWrapper.eq(OSSFile::getId,id); +// OSSFile ossFile = ossFileService.getOne(queryWrapper); +// if( null == ossFile){ +// throw new JeroBootException("文件不存在.."); +// } +// String fileUrl = ossFile.getUrl(); +// InputStream inputStream = null; +// OutputStream outputStream = null; +// try { +// String fileName = ""; +// if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){ +// //本地下载 +// String filePath = uploadpath + File.separator + fileUrl; +// File file = new File(filePath); +// if(!file.exists()){ +// response.setStatus(404); +// throw new RuntimeException("文件不存在.."); +// } +// // 文件名称 +// fileName = file.getName(); +// inputStream = new BufferedInputStream(new FileInputStream(filePath)); +// }else if(CommonConstant.UPLOAD_TYPE_MINIO.equals(uploadType)){ +// // minio 下载 +// // 通过MinioUtil查询时 只需要桶后面的路径 +// String minioUrl = MinioUtil.getMinioUrl(); +// // Linux/unix 系统下文件路径分隔符为"/" 获取minio与存储桶的路径 +// minioUrl = minioUrl + MinioUtil.getBucketName() + "/"; +// String url = fileUrl.replace(minioUrl, ""); +// // 文件名称 +// fileName = ossFile.getFileName(); +// inputStream = MinioUtil.getMinioFile(MinioUtil.getBucketName(), url); +// } +// response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1")); +//// response.setContentType("application/force-download");// 设置强制下载不打开 +// outputStream = response.getOutputStream(); +// byte[] buf = new byte[1024]; +// int len; +// while ((len = inputStream.read(buf)) > 0) { +// outputStream.write(buf, 0, len); +// } +// response.flushBuffer(); +// } catch (IOException e) { +// log.error("预览文件失败" + e.getMessage()); +// response.setStatus(404); +// e.printStackTrace(); +// } finally { +// if (inputStream != null) { +// try { +// inputStream.close(); +// } catch (IOException e) { +// log.error(e.getMessage(), e); +// } +// } +// if (outputStream != null) { +// try { +// outputStream.close(); +// } catch (IOException e) { +// log.error(e.getMessage(), e); +// } +// } +// } +// +// } + /** + * word,excel预览 + * + * @param id 传入文件id + * @param request + * @param response + */ + @GetMapping(value = "/download/{id}") + public void downLoad(@PathVariable("id") String id,HttpServletRequest request, HttpServletResponse response) { + if(StringUtils.isBlank(id)){ + throw new JeroBootException("参数信息不全"); + } + id = id.split("\\.")[0]; + // 查询数据表数据是否存在 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(OSSFile::getId,id); + OSSFile ossFile = ossFileService.getOne(queryWrapper); + if( null == ossFile){ + throw new JeroBootException("文件不存在"); + } + InputStream inputStream = null; + OutputStream outputStream = null; + try { + //本地下载 + String filePath = ossFile.getUrl(); + File file = new File(filePath); + if(!CosBootUtil.doesObjectExist(filePath)){ + response.setStatus(404); + throw new RuntimeException("文件不存在.."); + } + // 文件名称 + response.setContentType("application/force-download");// 设置强制下载不打开 + response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1")); + inputStream = CosBootUtil.download(filePath); + outputStream = response.getOutputStream(); + byte[] buf = new byte[1024]; + int len; + while ((len = inputStream.read(buf)) > 0) { + outputStream.write(buf, 0, len); + } + response.flushBuffer(); + } catch (IOException e) { + log.error("文件下载失败" + e.getMessage()); + response.setStatus(404); + e.printStackTrace(); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + } + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + } + } + } + + /** + * word,excel预览 cos + * + * @param id 传入文件id + * @param request + * @param response + */ + @GetMapping(value = "/downLoadFile") + public void downLoadFromCos(String id,HttpServletRequest request, HttpServletResponse response,String userName) { + if(StringUtils.isBlank(id)){ + throw new JeroBootException("参数信息不全"); + } + id = id.split("\\.")[0]; + // 查询数据表数据是否存在 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(OSSFile::getId,id); + OSSFile ossFile = ossFileService.getOne(queryWrapper); + if( null == ossFile){ + throw new JeroBootException("文件不存在"); + } + InputStream inputStream = null; + OutputStream outputStream = null; + File newFile =null; + try { + String fileName = ""; + //本地下载 + String filePath = ossFile.getUrl(); + if(!CosBootUtil.doesObjectExist(filePath)){ + response.setStatus(404); + throw new RuntimeException("文件不存在.."); + } + // 文件名称 + fileName = ossFile.getFileName(); + response.setContentType("application/force-download");// 设置强制下载不打开 + response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1")); + + File file = new File(filePath); + if(file.getName().endsWith(".pdf") || file.getName().endsWith(".PDF")){ + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String currentTime = sdf.format(new Date()); + String waterContent = userName+" "+currentTime; + InputStream download = CosBootUtil.download(filePath); + newFile = PDFUtils.PDFWatermark(download,uploadpath,file.getName(),waterContent); + inputStream = new FileInputStream(newFile.getPath()); + }else{ + inputStream = CosBootUtil.download(filePath); + } + outputStream = response.getOutputStream(); + byte[] buf = new byte[1024]; + int len; + while ((len = inputStream.read(buf)) > 0) { + outputStream.write(buf, 0, len); + } + response.flushBuffer(); + } catch (IOException e) { + log.error("文件下载失败" + e.getMessage()); + response.setStatus(404); + e.printStackTrace(); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + } + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + + } + if (newFile != null) { + try { + newFile.delete(); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + + } + + } + } + + /** + * word,excel预览 cos -pdf无水印 + * + * @param id 传入文件id + * @param request + * @param response + */ + @GetMapping(value = "/downLoadFileNOMark") + public void downLoadFileNoPDFWatermarkCos(String id,HttpServletRequest request, HttpServletResponse response,String userName) { + if(StringUtils.isBlank(id)){ + throw new JeroBootException("参数信息不全"); + } + id = id.split("\\.")[0]; + // 查询数据表数据是否存在 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(OSSFile::getId,id); + OSSFile ossFile = ossFileService.getOne(queryWrapper); + if( null == ossFile){ + throw new JeroBootException("文件不存在"); + } + InputStream inputStream = null; + OutputStream outputStream = null; + File newFile =null; + try { + String fileName = ""; + //本地下载 + String filePath = ossFile.getUrl(); + if(!CosBootUtil.doesObjectExist(filePath)){ + response.setStatus(404); + throw new RuntimeException("文件不存在.."); + } + // 文件名称 + fileName = ossFile.getFileName(); + response.setContentType("application/force-download");// 设置强制下载不打开 + response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1")); + + File file = new File(filePath); + inputStream = CosBootUtil.download(filePath); + outputStream = response.getOutputStream(); + byte[] buf = new byte[1024]; + int len; + while ((len = inputStream.read(buf)) > 0) { + outputStream.write(buf, 0, len); + } + response.flushBuffer(); + } catch (IOException e) { + log.error("文件下载失败" + e.getMessage()); + response.setStatus(404); + e.printStackTrace(); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + } + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + + } + if (newFile != null) { + try { + newFile.delete(); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + + } + + } + } + + /** + * 文件下载 + * + * @param id 传入文件id + * @param request + * @param response + */ +// @GetMapping(value = "/downLoadFile") + public void downLoadFile(String id,HttpServletRequest request, HttpServletResponse response) { + // 查询数据表数据是否存在 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(OSSFile::getId,id); + OSSFile ossFile = ossFileService.getOne(queryWrapper); + if( null == ossFile){ + throw new JeroBootException("文件不存在"); + } + InputStream inputStream = null; + OutputStream outputStream = null; + try { + String fileName = ""; + //本地下载 + String filePath = ossFile.getUrl(); + File file = new File(filePath); + if(!file.exists()){ + response.setStatus(404); + throw new RuntimeException("文件不存在.."); + } + // 文件名称 + fileName = file.getName(); + inputStream = new BufferedInputStream(new FileInputStream(filePath)); + response.setContentType("application/force-download");// 设置强制下载不打开 + response.addHeader("Content-Disposition", "attachment;fileName=" + new String(file.getName().getBytes("UTF-8"),"iso-8859-1")); + inputStream = new BufferedInputStream(new FileInputStream(filePath)); + outputStream = response.getOutputStream(); + byte[] buf = new byte[1024]; + int len; + while ((len = inputStream.read(buf)) > 0) { + outputStream.write(buf, 0, len); + } + response.flushBuffer(); + } catch (IOException e) { + log.error("文件下载失败" + e.getMessage()); + response.setStatus(404); + e.printStackTrace(); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + } + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + } + } + + } + /** + * 文件预览PDF + * + * @param id 传入文件id + * @param request + * @param response + */ + @GetMapping(value = "/pdf/viewFile") + public void viewFile(String id,HttpServletRequest request, HttpServletResponse response,String userName) { + // 查询数据表数据是否存在 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(OSSFile::getId,id); + OSSFile ossFile = ossFileService.getOne(queryWrapper); + if( null == ossFile){ + throw new JeroBootException("文件不存在.."); + } + InputStream inputStream = null; + OutputStream outputStream = null; + String fileName = ""; + try { + //本地下载 + String filePath = ossFile.getUrl(); + boolean b = CosBootUtil.doesObjectExist(filePath); + if (!b) { + response.setStatus(404); + throw new RuntimeException("文件不存在.."); + } + InputStream download = CosBootUtil.download(filePath); + File file = new File(filePath); + //水印内容 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String currentTime = sdf.format(new Date()); + String waterContent = userName+" "+currentTime; +// String waterContent = "water mark";//临时定义(水印信息通过传过来) + File newFile = PDFUtils.PDFWatermark(download,uploadpath,file.getName(),waterContent); + // 文件名称 + fileName = file.getName(); + inputStream = new BufferedInputStream(new FileInputStream(newFile)); + response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1")); + response.setContentType("application/force-download");// 设置强制下载不打开 + outputStream = response.getOutputStream(); + byte[] buf = new byte[1024]; + int len; + while ((len = inputStream.read(buf)) > 0) { + outputStream.write(buf, 0, len); + } + response.flushBuffer(); + } catch (IOException e) { + log.error("文件下载失败" + e.getMessage()); + response.setStatus(404); + e.printStackTrace(); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + } + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + } + File fileTemp = new File(uploadpath + File.separator +fileName); + fileTemp.delete(); + } + + } +// /** +// * 文件预览PDF +// * +// * @param id 传入文件id +// * @param request +// * @param response +// */ +// @GetMapping(value = "/pdf/viewFile") +// public void viewFile(String id,HttpServletRequest request, HttpServletResponse response) { +// // 查询数据表数据是否存在 +// LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); +// queryWrapper.eq(OSSFile::getId,id); +// OSSFile ossFile = ossFileService.getOne(queryWrapper); +// if( null == ossFile){ +// throw new JeroBootException("文件不存在.."); +// } +// InputStream inputStream = null; +// OutputStream outputStream = null; +// try { +// String fileName = ""; +// //本地下载 +// String filePath = ossFile.getUrl(); +// File file = new File(filePath); +// //水印内容 +// String waterContent = "water mark";//临时定义(水印信息通过传过来) +// File newFile = PDFUtils.PDFWatermark(file,waterContent); +// String path = newFile.getPath(); +//// String substring = path.substring(filePath.length(), path.length()); +// +// if(!file.exists()){ +// response.setStatus(404); +// throw new RuntimeException("文件不存在.."); +// } +// // 文件名称 +// fileName = file.getName(); +// inputStream = new BufferedInputStream(new FileInputStream(path)); +// response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1")); +// response.setContentType("application/force-download");// 设置强制下载不打开 +// outputStream = response.getOutputStream(); +// byte[] buf = new byte[1024]; +// int len; +// while ((len = inputStream.read(buf)) > 0) { +// outputStream.write(buf, 0, len); +// } +// response.flushBuffer(); +// } catch (IOException e) { +// log.error("文件下载失败" + e.getMessage()); +// response.setStatus(404); +// e.printStackTrace(); +// } finally { +// if (inputStream != null) { +// try { +// inputStream.close(); +// } catch (IOException e) { +// log.error(e.getMessage(), e); +// } +// } +// if (outputStream != null) { +// try { +// outputStream.close(); +// } catch (IOException e) { +// log.error(e.getMessage(), e); +// } +// } +// } +// +// } + + /** + * @功能:pdf预览Iframe + * @param modelAndView + * @return + */ + @RequestMapping("/pdf/pdfPreviewIframe") + public ModelAndView pdfPreviewIframe(ModelAndView modelAndView) { + modelAndView.setViewName("pdfPreviewIframe"); + return modelAndView; + } + + /** + * 把指定URL后的字符串全部截断当成参数 + * 这么做是为了防止URL中包含中文或者特殊字符(/等)时,匹配不了的问题 + * @param request + * @return + */ + private static String extractPathFromPattern(final HttpServletRequest request) { + String path = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE); + String bestMatchPattern = (String) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE); + return new AntPathMatcher().extractPathWithinPattern(bestMatchPattern, path); + } + + /** + * 中转HTTP请求,解决跨域问题 + * + * @param url 必填:请求地址 + * @return + */ + @RequestMapping("/transitRESTful") + public Result transitRESTful(@RequestParam("url") String url, HttpServletRequest request) { + try { + ServletServerHttpRequest httpRequest = new ServletServerHttpRequest(request); + // 中转请求method、body + HttpMethod method = httpRequest.getMethod(); + JSONObject params; + try { + params = JSON.parseObject(JSON.toJSONString(httpRequest.getBody())); + } catch (Exception e) { + params = new JSONObject(); + } + // 中转请求问号参数 + JSONObject variables = JSON.parseObject(JSON.toJSONString(request.getParameterMap())); + variables.remove("url"); + // 在 headers 里传递Token + String token = TokenUtils.getTokenByRequest(request); + HttpHeaders headers = new HttpHeaders(); + headers.set("X-Access-Token", token); + // 发送请求 + String httpURL = URLDecoder.decode(url, "UTF-8"); + ResponseEntity response = RestUtil.request(httpURL, method, headers , variables, params, String.class); + // 封装返回结果 + Result result = new Result<>(); + int statusCode = response.getStatusCodeValue(); + result.setCode(statusCode); + result.setSuccess(statusCode == 200); + String responseBody = response.getBody(); + try { + // 尝试将返回结果转为JSON + Object json = JSON.parse(responseBody); + result.setResult(json); + } catch (Exception e) { + // 转成JSON失败,直接返回原始数据 + result.setResult(responseBody); + } + return result; + } catch (Exception e) { + log.debug("中转HTTP请求失败", e); + return Result.error(e.getMessage()); + } + } + +} diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneLoginController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneLoginController.java new file mode 100644 index 000000000..7e3e7c41a --- /dev/null +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneLoginController.java @@ -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 login(@RequestBody SysLoginModel sysLoginModel){ + Result result = new Result(); + 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 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 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:: + 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 loginfo() { + Result result = new Result(); + 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>> visitInfo() { + Result>> result = new Result>>(); + 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> list = logService.findVisitCount(dayStart, dayEnd); + result.setResult(oConvertUtils.toLowerCasePageList(list)); + return result; + } + + + /** + * 登陆成功选择用户当前部门 + * @param user + * @return + */ + @RequestMapping(value = "/selectDepart", method = RequestMethod.PUT) + public Result selectDepart(@RequestBody SysUser user) { + Result result = new Result(); + 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 sms(@RequestBody JSONObject jsonObject) { + Result result = new Result(); + 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 phoneLogin(@RequestBody JSONObject jsonObject) { + Result result = new Result(); + 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 userInfo(SysUser sysUser, Result 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 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 userRoleListInfo = sysUserService.queryUserRoleListInfoByUserId(sysUser.getId()); + sysUser.setUserRoleList(userRoleListInfo); + + //获取配置信息 + List 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> getEncryptedString(){ + Result> result = new Result>(); + Map map = new HashMap(); + 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 randomImage(HttpServletResponse response,@PathVariable String key){ + Result res = new Result(); + 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 mLogin(@RequestBody SysLoginModel sysLoginModel) throws Exception { + Result result = new Result(); + 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 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 + */ + @ApiOperation("获取RSA公钥") + @GetMapping("/getRSAPublicKey") + public Result getRSAPublicKey(){ + RSA rsa = new RSA(); + String privateKeyBase64 = rsa.getPrivateKeyBase64(); + String publicKeyBase64 = rsa.getPublicKeyBase64(); + //存到redis key为公钥 value为私钥 + redisUtil.set(publicKeyBase64, privateKeyBase64, 60L); + Result result = new Result<>(); + result.setResult(publicKeyBase64); + return result; + } +} diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneSysDictController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneSysDictController.java new file mode 100644 index 000000000..132094970 --- /dev/null +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneSysDictController.java @@ -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; + +/** + *

+ * 字典表 前端控制器 + *

+ * + * @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 redisTemplate; + @Autowired + private ISysUserService sysUserService; + @Autowired + private IProjectUserBrandService projectUserBrandService; + + @RequestMapping(value = "/page", method = RequestMethod.GET) + @ApiOperation(value = "字典控制器-分页列表查询", notes = "字典控制器-分页列表查询") + public Result> queryPageList(SysDict sysDict, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { + Result> result = new Result>(); + QueryWrapper 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 page = new Page(pageNo, pageSize); + IPage 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 params) { + IPage 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> treeList(SysDict sysDict, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { + Result> result = new Result<>(); + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + // 构造查询条件 + String dictName = sysDict.getDictName(); + if(oConvertUtils.isNotEmpty(dictName)) { + query.like(true, SysDict::getDictName, dictName); + } + query.orderByDesc(true, SysDict::getCreateTime); + List list = sysDictService.list(query); + List 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> getDictItems(@PathVariable String dictCode, @RequestParam(value = "sign",required = false) String sign, HttpServletRequest request) { + log.info(" dictCode : "+ dictCode); + Result> result = new Result>(); + List 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() { + @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> res = new HashMap>(); + 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> res = new HashMap>(); + res = sysDictService.queryAllDictItemsByCut(cut); + return Result.OK(res); + } + @ApiOperation(value = "更新浏览器内保存的数据字典数据", notes = "更新浏览器内保存的数据字典数据") + @RequestMapping(value = "/login", method = RequestMethod.POST) + private Result userInfo(SysUser sysUser, Result 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 getDictText(@PathVariable("dictCode") String dictCode, @PathVariable("key") String key) { + log.info(" dictCode : "+ dictCode); + Result result = new Result(); + 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> 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> result = new Result>(); + List 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> loadDictItem(@PathVariable String dictCode, @RequestParam(name="key") String keys, @RequestParam(value = "sign",required = false) String sign, HttpServletRequest request) { + Result> result = new Result<>(); + try { + if(dictCode.indexOf(",")!=-1) { + String[] params = dictCode.split(","); + if(params.length!=3) { + result.error500("字典Code格式不正确!"); + return result; + } + List 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> 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> result = new Result>(); + + // SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件) + String dictCode = tbname +","+ text +","+ code; + SqlInjectionUtil.filterContent(dictCode); + List 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> queryAllTreeData(@RequestParam(name="pidField") String pidField, + @RequestParam(name="tableName") String tbname, + @RequestParam(name="text") String text, + @RequestParam(name="code") String code, + HttpServletRequest request) { + Result> result = new Result>(); + + // SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件) + String dictCode = tbname +","+ text +","+ code; + SqlInjectionUtil.filterContent(dictCode); + List ls = sysDictService.queryAllTreeData(tbname, text, code, pidField); + result.setSuccess(true); + result.setResult(ls); + return result; + } + /** + * 查询被删除的列表 + * @return + */ + @GetMapping(value = "/deleteList") + public Result> deleteList() { + Result> result = new Result>(); + List 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 add(@RequestBody SysDict sysDict) { + Result result = new Result(); + + sysDictService.setAddOrdderNum(sysDict); + //校验--不能重复数据 + QueryWrapper queryWrapper = new QueryWrapper<>(); + //查询同一模块下,同名数据 + queryWrapper.eq("dict_name",sysDict.getDictName()) + .eq("is_tag_dict",sysDict.getIsTagDict()); + List 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 edit(@RequestBody SysDict sysDict) { + Result result = new Result(); + 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 queryWrapper = new QueryWrapper<>(); + //查询同一模块下,同名数据 + queryWrapper.eq("dict_name", sysDict.getDictName()) + .eq("is_tag_dict",sysDict.getIsTagDict()); + List 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 delete(@RequestParam(name="id",required=true) String id) { + + Result result = new Result(); + 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 logicDelete(@RequestParam(name="id",required=true) String id) { + + Result result = new Result(); + 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 deleteBatch(@RequestParam(name="ids",required=true) String ids) { + Result result = new Result(); + SysDict sysDict = sysDictService.queryById(ids); + if(oConvertUtils.isEmpty(ids)) { + result.error500("参数不识别!"); + }else { + List 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 logicdeleteBatch(@RequestParam(name="ids",required=true) String ids) { + Result result = new Result(); + List 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(); + sysDictService.refreshCache(); + return result; + } + + /** + * 导出excel + * + * @param request + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(SysDict sysDict, HttpServletRequest request) { + // Step.1 组装查询条件 + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(sysDict, request.getParameterMap()); + //Step.2 AutoPoi 导出Excel + ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); + List pageList = new ArrayList(); + + List sysDictList = sysDictService.list(queryWrapper); + for (SysDict dictMain : sysDictList) { + SysDictPage vo = new SysDictPage(); + BeanUtils.copyProperties(dictMain, vo); + // 查询机票 + List 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 fileMap = multipartRequest.getFileMap(); + for (Map.Entry 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 list = ExcelImportUtil.importExcel(file.getInputStream(), SysDictPage.class, params); + // 错误信息 + List 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> queryDictName(@RequestParam(name = "cut") String cut,SysDict sysDict) { + List 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> getBrandDict() { + List dictModels = sysDictService.queryDictItemsByCode(DictCodeEnum.BRAND.getValue()); + if (!sysUserService.isAdministrator()) { + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List 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> getDutyTerritoryDictItems(@PathVariable String dictCode, @RequestParam(value = "sign",required = false) String sign, HttpServletRequest request) { + log.info(" dictCode : "+ dictCode); + Result> result = new Result>(); + List 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() { + @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; + } + +} diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneSysPermissionController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneSysPermissionController.java new file mode 100644 index 000000000..620dc22f7 --- /dev/null +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneSysPermissionController.java @@ -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; + +/** + *

+ * 菜单权限表 前端控制器 + *

+ * + * @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() { + long start = System.currentTimeMillis(); + Result> result = new Result<>(); + try { + LambdaQueryWrapper query = new LambdaQueryWrapper(); + query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0); + query.orderByAsc(SysPermission::getSortNo); + List list = sysPermissionService.list(query); + List 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> getSystemMenuList() { + long start = System.currentTimeMillis(); + Result> result = new Result<>(); + try { + LambdaQueryWrapper query = new LambdaQueryWrapper(); + query.eq(SysPermission::getMenuType,CommonConstant.MENU_TYPE_0); + query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0); + query.orderByAsc(SysPermission::getSortNo); + List list = sysPermissionService.list(query); + List sysPermissionTreeList = new ArrayList(); + 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> getSystemSubmenu(@RequestParam("parentId") String parentId){ + Result> result = new Result<>(); + try{ + LambdaQueryWrapper query = new LambdaQueryWrapper(); + query.eq(SysPermission::getParentId,parentId); + query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0); + query.orderByAsc(SysPermission::getSortNo); + List list = sysPermissionService.list(query); + List sysPermissionTreeList = new ArrayList(); + 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 query = new LambdaQueryWrapper<>(); + List parentIdList = Arrays.asList(parentIds.split(",")); + query.in(SysPermission::getParentId, parentIdList); + query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0); + query.orderByAsc(SysPermission::getSortNo); + List list = sysPermissionService.list(query); + Map> listMap = new HashMap<>(); + for (SysPermission item : list) { + String pid = item.getParentId(); + if (parentIdList.contains(pid)) { + List 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 queryByUser(HttpServletRequest req) { +// Result result = new Result<>(); +// try { +// String username = req.getParameter("username"); +// List 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 result = new Result(); + try { + //直接获取当前用户不适用前端token + LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if (oConvertUtils.isEmpty(loginUser)) { + return Result.error("请登录系统!"); + } + List metaList = sysPermissionService.queryByUser(loginUser.getUsername()); + //添加首页路由 + //update-begin-author:taoyan date:20200211 for: TASK #3368 【路由缓存】首页的缓存设置有问题,需要根据后台的路由配置来实现是否缓存 + if(!PermissionDataUtil.hasIndexPage(metaList)){ + SysPermission indexMenu = sysPermissionService.list(new LambdaQueryWrapper().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 query = new LambdaQueryWrapper(); + query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0); + query.eq(SysPermission::getMenuType, CommonConstant.MENU_TYPE_2); + //query.eq(SysPermission::getStatus, "1"); + List 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 add(@RequestBody SysPermission permission) { + Result result = new Result(); + 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 edit(@RequestBody SysPermission permission) { + Result 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 delete(@RequestParam(name = "id", required = true) String id) { + Result 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 deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + Result 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> queryTreeList() { + Result> result = new Result<>(); + // 全部权限ids + List ids = new ArrayList<>(); + try { + LambdaQueryWrapper query = new LambdaQueryWrapper(); + query.eq(SysPermission::getDelFlag, CommonConstant.DEL_FLAG_0); + query.orderByAsc(SysPermission::getSortNo); + List list = sysPermissionService.list(query); + for (SysPermission sysPer : list) { + ids.add(sysPer.getId()); + } + List treeList = new ArrayList<>(); + getTreeModelList(treeList, list, null); + + Map resMap = new HashMap(); + 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> queryAsync(@RequestParam(name = "pid", required = false) String parentId) { + Result> result = new Result<>(); + try { + List 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> queryRolePermission(@RequestParam(name = "roleId", required = true) String roleId) { + Result> result = new Result<>(); + try { + List list = sysRolePermissionService.list(new QueryWrapper().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 saveRolePermission(@RequestBody JSONObject json) { + long start = System.currentTimeMillis(); + Result 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 treeList, List 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 treeList, List 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 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 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 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 params = new HashMap<>(); + params.put("currentUserId",currentUser.getId()); + + List 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> getPermRuleListByPermId(SysPermissionDataRule sysPermissionDataRule) { + List permRuleList = sysPermissionDataRuleService.getPermRuleListByPermId(sysPermissionDataRule.getPermissionId()); + Result> result = new Result<>(); + result.setSuccess(true); + result.setResult(permRuleList); + return result; + } + + /** + * 添加菜单权限数据 + * + * @param sysPermissionDataRule + * @return + */ + //@RequiresRoles({ "admin" }) + @RequestMapping(value = "/addPermissionRule", method = RequestMethod.POST) + public Result addPermissionRule(@RequestBody SysPermissionDataRule sysPermissionDataRule) { + Result result = new Result(); + 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 editPermissionRule(@RequestBody SysPermissionDataRule sysPermissionDataRule) { + Result result = new Result(); + 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 deletePermissionRule(@RequestParam(name = "id", required = true) String id) { + Result result = new Result(); + 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> queryPermissionRule(SysPermissionDataRule sysPermissionDataRule) { + Result> result = new Result<>(); + try { + List 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> queryDepartPermission(@RequestParam(name = "departId", required = true) String departId) { + Result> result = new Result<>(); + try { + List list = sysDepartPermissionService.list(new QueryWrapper().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 saveDepartPermission(@RequestBody JSONObject json) { + long start = System.currentTimeMillis(); + Result 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; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/service/impl/AuthDummyInventoryBaseEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/service/impl/AuthDummyInventoryBaseEOServiceImpl.java index dd55752ed..09779899f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/service/impl/AuthDummyInventoryBaseEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/authDummy/service/impl/AuthDummyInventoryBaseEOServiceImpl.java @@ -87,6 +87,8 @@ public class AuthDummyInventoryBaseEOServiceImpl extends ServiceImpl params = new HashMap<>(); params.put("contentInfoFeiCn",contentInfoFeiCn + "\n" + contentCn); params.put("contentInfoFeiEn",contentLogFeishuTemp + "\n" + contentEn); params.put("userIdList",userIdList); params.put("back_url",href); + params.put("back_url_phone",backUrlPhone); params.put("titleCn", TemplateInfoEnum2.SUBSCRIPTION_INFORM.getNameCn()); params.put("titleEn",TemplateInfoEnum2.SUBSCRIPTION_INFORM.getNameEn()); iFeishuService.sendMessageSubscriptionNotification(TemplateInfoEnum2.SUBSCRIPTION_INFORM.getValue(),params); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index 6c1dfd3c7..8b4eb5137 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -175,6 +175,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsConfigDataVOList = this.getConfigDataVOList(controlType, paramsConfigEO, paramsConfigDataEO, collectManifestEO); // 重新组合配置数据 String key = UUID.randomUUID().toString().replaceAll("-", ""); - paramsConfigDataVO.put(key, paramsConfigDataVOList); + paramsConfigDataVO.put("0+" + key, paramsConfigDataVOList); } configMap.put("controlType",controlType); configMap.put("paramsConfigData",paramsConfigDataVO); @@ -1635,6 +1637,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl { - newConfigDataEO.setId(UUID.randomUUID().toString().replace("-","")); - }); +// newConfigDataEOList.forEach(newConfigDataEO -> { +// newConfigDataEO.setId(UUID.randomUUID().toString().replace("-","")); +// }); this.paramsConfigDataEOService.saveOrUpdateBatch(newConfigDataEOList); } @@ -1778,6 +1781,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsConfigDataVO : paramsConfigDataVOList) { @@ -2302,6 +2306,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl params = new HashMap<>(); params.put("contentInfoFeiCn",contentInfoFeiCn); @@ -2313,6 +2320,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl params = new HashMap<>(); params.put("contentInfoFeiCn",contentInfoFeiCn); @@ -2335,6 +2345,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl params = new HashMap<>(); params.put("contentInfoFeiCn",contentInfoFeiCn); @@ -2663,6 +2679,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl params = new HashMap<>(); @@ -6467,6 +6490,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl params = new HashMap<>(); @@ -6505,6 +6532,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl params = new HashMap<>(); @@ -6544,6 +6575,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl params = new HashMap<>(); params.put("contentInfoFeiCn",contentInfoFeiCn); @@ -7165,6 +7208,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl { + @Autowired + private IOnlCgformCollectionService onlCgformCollectionService; + @Autowired + BussDocumentLibraryEOController bussDocumentLibraryEOService; + + /** + * 分页列表查询 + * + * @param params + * @return + */ + @AutoLog(value = "我的收藏-分页列表查询") + @ApiOperation(value="我的收藏-分页列表查询", notes="我的收藏-分页列表查询") + @PostMapping(value = "/page") + public Result queryPageList(@RequestBody Map params){ + IPage pageList = onlCgformCollectionService.queryPageList(params); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "我的收藏-列表查询") + @ApiOperation(value="我的收藏-列表查询", notes="我的收藏-列表查询") + @GetMapping(value = "/list") + public Result> queryList(OnlCgformCollection onlCgformCollection) { + List 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 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>> getHeader(@RequestParam(name = "flag") String flag, + @RequestParam(name = "cut") String cut) { + List> list =onlCgformCollectionService.getHeader(flag, cut); + return Result.OK(list); + } + + /** + * 查询条件中英文切换 + * + * @return + */ + @AutoLog(value = "我的收藏-查询条件中英文切换") + @ApiOperation(value="我的收藏-查询条件中英文切换", notes="我的收藏-查询条件中英文切换") + @GetMapping(value = "/queryCondition") + public Result>> queryCondition(@RequestParam(name = "flag") String flag, + @RequestParam(name = "cut") String cut) { + List> list = onlCgformCollectionService.queryCondition(flag, cut); + return Result.OK(list); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/PhoneBussDocumentLibraryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/PhoneBussDocumentLibraryEOController.java new file mode 100644 index 000000000..67d5dbb56 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/PhoneBussDocumentLibraryEOController.java @@ -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 { + @Autowired + private IBussDocumentLibraryEOService bussDocumentLibraryEOService; + + + /** + * 分页列表查询 + * @param parameter + * @return + */ + @AutoLog(value = "分页查询") + @ApiOperation(value="分页查询", notes="分页查询") + @PostMapping(value = "/queryPageInfo") + @ResponseBody + @RequiresPermissions("document:queryPageInfo") + public JSONObject queryPageInfo(@RequestBody Map parameter) { + IPage infoPage = bussDocumentLibraryEOService.getInfoPage(parameter); + Result 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 parameter) { + IPage infoPage = bussDocumentLibraryEOService.replacePageInfo(parameter); +// Result 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 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 parameter) { + IPage infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter); + return Result.OK(infoPage); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "文档库信息表-列表查询") + @ApiOperation(value="文档库信息表-列表查询", notes="文档库信息表-列表查询") + @GetMapping(value = "/list") + public Result> queryList() { + List 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>> queryCondition(@RequestParam(name="flag",required=true) String flag, + @RequestParam(name="cut",required=true) String cut) { + List> 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>> getHeader(@RequestParam(name="flag",required=true) String flag, + @RequestParam(name="cut",required=true) String cut) { + List> 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>> getAddForm(@RequestParam(name="flag",required=true) String flag, + @RequestParam(name="cut",required=true) String cut, + @RequestParam(name="type",required=true) String type) { + List> 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>> getHeaderOrConditionForOcr(@RequestParam(name="flag",required=true) String flag, + @RequestParam(name="cut",required=true) String cut) { + List> 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>> getHeaderOrConditionForSplitFile(@RequestParam(name="flag",required=true) String flag, + @RequestParam(name="cut",required=true) String cut) { + List> 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>> getHeaderOrConditionForSplitResult(@RequestParam(name="flag",required=true) String flag, + @RequestParam(name="cut",required=true) String cut) { + List> 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>> getDocumentInfoById(@RequestParam(name="id",required=true) String id, + @RequestParam(name="cut",required=true) String cut) { + List> 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>> getInfoById(@RequestParam(name="id",required=true) String id, + @RequestParam(name="cut",required=true) String cut) { + List> list = bussDocumentLibraryEOService.getInfoById(id,cut); + return Result.OK(list); + } + + @ApiOperation(value="详情目录查询", notes="详情目录查询") + @GetMapping(value = "/getMenuList") + public Result>> getMenuList(@RequestParam(name="id",required=true) String id, + @RequestParam(name="cut",required=true) String cut) { + List> 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 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 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 map, + HttpServletResponse response, + HttpServletRequest request){ + bussDocumentLibraryEOService.exportExcel(map,response,request); + } + + @ApiOperation(value = "带文件导出") + @GetMapping(value = "/exportZip") + @RequiresPermissions("document:exportZip") + public void exportZip(@RequestParam Map 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 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 queryWrapper = QueryGenerator.initQueryWrapper(bussDocumentLibraryEO, req.getParameterMap()); + Page page = new Page(bussDocumentLibraryEO.getPageNo(), bussDocumentLibraryEO.getPageSize()); + IPage pageList = bussDocumentLibraryEOService.queryPageInfoDummy(page, queryWrapper,bussDocumentLibraryEO); + return Result.OK(pageList); + } + + + @ApiOperation(value="虚拟中心添加调用文档库数据--分页", notes="虚拟中心添加调用文档库数据--分页") + @PostMapping(value = "/queryPageDummy") + @ResponseBody + public JSONObject queryPageDummy(@RequestBody Map parameter) { + IPage infoPage = bussDocumentLibraryEOService.getPageDummy(parameter); + Result 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 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); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/PhonePhasedImplementationDetailsEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/PhonePhasedImplementationDetailsEOController.java new file mode 100644 index 000000000..c8c6f5546 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/PhonePhasedImplementationDetailsEOController.java @@ -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 { + @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 queryWrapper = QueryGenerator.initQueryWrapper(phasedImplementationDetailsEO, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage 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> queryList() { + List 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); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/enums/ImplementationTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/enums/ImplementationTypeEnum.java index 312566ecb..964d19b53 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/enums/ImplementationTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/enums/ImplementationTypeEnum.java @@ -4,8 +4,8 @@ package com.jero.modules.document.enums; * 实施类型枚举类 */ public enum ImplementationTypeEnum { - CAR_IN_PRODUCTION("1628228171473039361","在产车","Car in production","34e90bd6a000471bbdcd0ff325898740"), - NEW_CAR_MODEL("1628228101830815745","新车型","New car model","2148610ff06641849106321531656bfc"); + CAR_IN_PRODUCTION("1628228171473039361","在产车","New Vehicle","34e90bd6a000471bbdcd0ff325898740"), + NEW_CAR_MODEL("1628228101830815745","新车型","New Type","2148610ff06641849106321531656bfc"); String id; String nameCn; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java index 80e6d6b29..64ab11e5c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java @@ -207,6 +207,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl> mapList = bussDocumentLibraryEOMapper.selectMapsAll(documentIds); List serialNumberList = new ArrayList<>(); List urlList = new ArrayList<>(); + List urlPhonelList = new ArrayList<>(); List hrefList = new ArrayList<>(); for (Map map : mapList) { serialNumberList.add(StringUtils.valueOf(map.get("serial_number"))); @@ -5637,11 +5643,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl" + map.get("serial_number") + ""; + + String urlPhone = backUrlPhone + "/phoneDocumentDetails?id=" + map.get("id"); urlList.add(url); hrefList.add(href); + urlPhonelList.add(urlPhone); } @@ -5671,7 +5681,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl list = new ArrayList<>(); mapList.stream().forEach(e->{ @@ -5695,6 +5706,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl params = new HashMap<>(); params.put("contentInfoFeiCn",contentInfoFeiCn + "\n" + contentCn); params.put("contentInfoFeiEn",contentLogFeishuTemp + "\n" + contentEn); params.put("userIdList",userIdList); params.put("back_url",href); + params.put("back_url_phone",backUrlPhone); params.put("titleCn",TemplateInfoEnum2.SUBSCRIPTION_INFORM.getNameCn()); params.put("titleEn",TemplateInfoEnum2.SUBSCRIPTION_INFORM.getNameEn()); iFeishuService.sendMessageSubscriptionNotification(TemplateInfoEnum2.SUBSCRIPTION_INFORM.getValue(),params); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/impl/FeishuServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/impl/FeishuServiceImpl.java index e7c33753f..5e73a8002 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/impl/FeishuServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/impl/FeishuServiceImpl.java @@ -1425,7 +1425,7 @@ public class FeishuServiceImpl implements IFeishuService { paramsMap.put("user_ids", userIdArr); paramsMap.put("msg_type", "interactive"); paramsMap.put("card", templateJson); - + log.error("请求飞书消息:" + paramsMap.toJSONString()); // 发送请求给飞书 String response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString()); // 获取返回结果 @@ -1445,6 +1445,7 @@ public class FeishuServiceImpl implements IFeishuService { String contentCn = (String) params.get("contentInfoFeiCn"); String contentEn = (String) params.get("contentInfoFeiEn"); String back_url = (String) params.get("back_url"); + String back_url_phone = (String) params.get("back_url_phone"); String titleCn = (String) params.get("titleCn"); String titleEn = (String) params.get("titleEn"); try { @@ -1460,6 +1461,7 @@ public class FeishuServiceImpl implements IFeishuService { templateVariableMap.put("contentInfoFeiEn",contentEn); templateVariableMap.put("view_url_cn",back_url); templateVariableMap.put("view_url_en",back_url); + templateVariableMap.put("view_url_Phone",back_url_phone); templateVariableMap.put("titleCn",titleCn); templateVariableMap.put("titleEn",titleEn); @@ -1487,6 +1489,7 @@ public class FeishuServiceImpl implements IFeishuService { String contentCn = (String) params.get("contentInfoFeiCn"); String contentEn = (String) params.get("contentInfoFeiEn"); String back_url = (String) params.get("back_url"); + String back_url_phone = (String) params.get("back_url_phone"); String titleCn = (String) params.get("titleCn"); String titleEn = (String) params.get("titleEn"); String regulationNo = (String) params.get("regulationNo"); @@ -1505,6 +1508,7 @@ public class FeishuServiceImpl implements IFeishuService { templateVariableMap.put("contentInfoFeiEn",contentEn); templateVariableMap.put("view_url_cn",back_url); templateVariableMap.put("view_url_en",back_url); + templateVariableMap.put("back_url_phone",back_url_phone); templateVariableMap.put("titleCn",titleCn); templateVariableMap.put("titleEn",titleEn); templateVariableMap.put("regulationNo",regulationNo); @@ -1535,6 +1539,7 @@ public class FeishuServiceImpl implements IFeishuService { String contentCn = (String) params.get("contentInfoFeiCn"); String contentEn = (String) params.get("contentInfoFeiEn"); String back_url = (String) params.get("back_url"); + String back_url_Phone = (String) params.get("back_url_Phone"); String titleCn = (String) params.get("titleCn"); String titleEn = (String) params.get("titleEn"); String regulationNo = (String) params.get("regulationNo"); @@ -1555,7 +1560,8 @@ public class FeishuServiceImpl implements IFeishuService { templateVariableMap.put("contentInfoFeiCn",contentCn); templateVariableMap.put("contentInfoFeiEn",contentEn); templateVariableMap.put("view_url_cn",back_url); - templateVariableMap.put("view_url_en",back_url); + templateVariableMap.put("view_url_en",back_url);; + templateVariableMap.put("back_url_Phone",back_url_Phone); templateVariableMap.put("titleCn",titleCn); templateVariableMap.put("titleEn",titleEn); templateVariableMap.put("regulationNo",regulationNo); @@ -1590,6 +1596,7 @@ public class FeishuServiceImpl implements IFeishuService { String contentEn = (String) params.get("contentInfoFeiEn"); String back_url_cn = (String) params.get("back_url_cn"); String back_url_en = (String) params.get("back_url_en"); + String back_url_Phone = (String) params.get("back_url_phone"); String projectCn = (String) params.get("projectCn"); String projectEn = (String) params.get("projectEn"); String initiatorCn = (String) params.get("initiatorCn"); @@ -1608,13 +1615,14 @@ public class FeishuServiceImpl implements IFeishuService { templateVariableMap.put("contentInfoFeiEn",contentEn); templateVariableMap.put("view_url_cn",back_url_cn); templateVariableMap.put("view_url_en",back_url_en); + templateVariableMap.put("back_url_Phone",back_url_Phone); templateVariableMap.put("projectCn"," " + projectCn); templateVariableMap.put("projectEn"," " + projectEn); templateVariableMap.put("initiatorCn"," " + initiatorCn); if(StringUtils.isNotBlank(flag)){ templateVariableMap.put("initiatorEn"," " + initiatorEn); }else{ - templateVariableMap.put("initiatorEn"," " + initiatorCn); + templateVariableMap.put("initiatorCn"," " + initiatorCn); } templateVariableMap.put("dueDate"," " + dueDate); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java index 628e729e6..c966233e6 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java @@ -84,6 +84,9 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl { @Autowired diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/SearchCenterController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/SearchCenterController.java index fa9b5f564..f2e015f06 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/SearchCenterController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/SearchCenterController.java @@ -15,7 +15,7 @@ import java.util.Map; @Api(tags = "手机端-搜索中心") @RestController -@RequestMapping("/phone/search") +@RequestMapping("/phone/phone/search") public class SearchCenterController { @Autowired diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/TaskStatisticsController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/TaskStatisticsController.java index 431c9f2cb..0bb9f45b8 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/TaskStatisticsController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/TaskStatisticsController.java @@ -14,7 +14,7 @@ import java.util.Map; @Api(tags = "手机端-任务统计") @RestController -@RequestMapping("/phone/taskStatistics") +@RequestMapping("/phone/phone/taskStatistics") public class TaskStatisticsController { @Autowired diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/ToDoCenterController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/ToDoCenterController.java index 58df9bf88..49f4afa2b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/ToDoCenterController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/ToDoCenterController.java @@ -17,7 +17,7 @@ import java.util.Map; @Api(tags = "手机端-待办中心") @RestController -@RequestMapping("/phone/toDoCenter") +@RequestMapping("/phone/phone/toDoCenter") public class ToDoCenterController { @Autowired diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/enums/BrowseTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/enums/BrowseTypeEnum.java index b52761d5c..46b61b9ba 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/enums/BrowseTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/enums/BrowseTypeEnum.java @@ -8,7 +8,7 @@ import com.jero.modules.system.util.StringUtils; */ public enum BrowseTypeEnum { WDK("Document Library", "文档库", "Document Library"), - ZSFX("Knowledge sharing", "知识分享", "Knowledge sharing"), + ZSFX("Knowledge sharing", "知识分享", "Knowledge Sharing"), FGYB("Regulatory Monthly Report", "法规月报", "Regulatory Monthly Report"), ; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/service/impl/ToDoCenterServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/service/impl/ToDoCenterServiceImpl.java index 6d2a0c2da..e5f5c6827 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/service/impl/ToDoCenterServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/service/impl/ToDoCenterServiceImpl.java @@ -123,7 +123,7 @@ public class ToDoCenterServiceImpl implements IToDoCenterService { List datas = result.getRecords(); this.disposeData(cut, datas); - + Collections.sort(datas, Comparator.comparing(ProcessInfoVO::getEndTime)); return result; } @@ -148,6 +148,21 @@ public class ToDoCenterServiceImpl implements IToDoCenterService { // 判断当前用户在这个认证流程中 有几个任务。 责任人 接受、责任人 提交交付物、认证工程审批 if (CollectionUtils.isNotEmpty(pidEos)) { + + List rzgcsjsPidEos = pidEos.stream().filter(pidEo -> { + boolean flag = ( + StringUtils.equals(pidEo.getTaskDefinitionKey(), CertificationFlowNodeEnum.RZGCSJSRW.getKey()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), CertificationFlowNodeEnum.ZRRJJRW.getKey()) + ); + return flag; + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(rzgcsjsPidEos)) { + ProcessInfoVO processInfoVOTemp = new ProcessInfoVO(); + BeanUtils.copyProperties(data, processInfoVOTemp); + processInfoVOTemp.setTaskDefinitionKey(CertificationFlowNodeEnum.CHECKLIST_VERIFICATION.getKey()); + datasTemp.add(processInfoVOTemp); + } + List zrrjsrwPidEos = pidEos.stream().filter(pidEo -> { return StringUtils.equals(pidEo.getTaskDefinitionKey(), CertificationFlowNodeEnum.ZRRJSRW.getKey()); }).collect(Collectors.toList()); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseBrowsingHistoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseBrowsingHistoryEOController.java new file mode 100644 index 000000000..c4d091c30 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseBrowsingHistoryEOController.java @@ -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 { + @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 queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseBrowsingHistoryEO, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = problemKnowledgeBaseBrowsingHistoryEOService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "问题知识库浏览历史表-列表查询") + @ApiOperation(value="问题知识库浏览历史表-列表查询", notes="问题知识库浏览历史表-列表查询") + @GetMapping(value = "/list") + public Result> queryList() { + List 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); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseCollectEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseCollectEOController.java new file mode 100644 index 000000000..7840cdf15 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseCollectEOController.java @@ -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 { + @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 queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseCollectEO, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = problemKnowledgeBaseCollectEOService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "问题知识库收藏表-列表查询") + @ApiOperation(value="问题知识库收藏表-列表查询", notes="问题知识库收藏表-列表查询") + @GetMapping(value = "/list") + public Result> queryList() { + List 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 queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseEO, req.getParameterMap()); + queryWrapper.orderByDesc("create_time"); + this.problemKnowledgeBaseEOService.createQueryPermission(queryWrapper,problemKnowledgeBaseEO); + Page page = new Page(pageNo, pageSize); + + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + + QueryWrapper collectEOQueryWrapper = new QueryWrapper<>(); + collectEOQueryWrapper.lambda().eq(ProblemKnowledgeBaseCollectEO::getCollectUserId,currentUser.getId()); + collectEOQueryWrapper.lambda().eq(ProblemKnowledgeBaseCollectEO::getCollectStatus, CollectStatusEnum.COLLECT.getValue()); + List collectEOList = this.problemKnowledgeBaseCollectEOService.list(collectEOQueryWrapper); + + if(CollectionUtils.isNotEmpty(collectEOList)){ + List problemKnowledgeBaseIdList = collectEOList.stream().map(ProblemKnowledgeBaseCollectEO::getProblemKnowledgeBaseId).distinct().collect(Collectors.toList()); + + queryWrapper.lambda().in(ProblemKnowledgeBaseEO::getId,problemKnowledgeBaseIdList); + IPage pageList = this.problemKnowledgeBaseEOService.page(page, queryWrapper); + this.problemKnowledgeBaseEOService.disposeData(pageList.getRecords(),problemKnowledgeBaseEO.getCut()); + + return Result.OK(pageList); + } + return Result.OK(); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseCommentEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseCommentEOController.java new file mode 100644 index 000000000..d4ec30428 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseCommentEOController.java @@ -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 { + @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 queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseCommentEO, req.getParameterMap()); + queryWrapper.orderByDesc("create_time"); + Page page = new Page(pageNo, pageSize); + IPage pageList = problemKnowledgeBaseCommentEOService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "问题知识库评论表-列表查询") + @ApiOperation(value="问题知识库评论表-列表查询", notes="问题知识库评论表-列表查询") + @GetMapping(value = "/list") + public Result> queryList(ProblemKnowledgeBaseCommentEO problemKnowledgeBaseCommentEO, HttpServletRequest req) { + List 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); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseEOController.java new file mode 100644 index 000000000..3e210a832 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseEOController.java @@ -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 { + @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 queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseEO, req.getParameterMap()); + this.problemKnowledgeBaseEOService.createQueryPermission(queryWrapper,problemKnowledgeBaseEO); + queryWrapper.orderByDesc("create_time"); + Page page = new Page(pageNo, pageSize); + IPage 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> queryList(ProblemKnowledgeBaseEO problemKnowledgeBaseEO, + HttpServletRequest req) { + List 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.phoneQueryById(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); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBasePraiseEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBasePraiseEOController.java new file mode 100644 index 000000000..0a8dfa489 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBasePraiseEOController.java @@ -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 { + @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 queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBasePraiseEO, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = problemKnowledgeBasePraiseEOService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "问题知识库点赞表-列表查询") + @ApiOperation(value="问题知识库点赞表-列表查询", notes="问题知识库点赞表-列表查询") + @GetMapping(value = "/list") + public Result> queryList() { + List 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); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/ProblemKnowledgeBaseEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/ProblemKnowledgeBaseEOController.java index 3ab0e2c98..f494323cc 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/ProblemKnowledgeBaseEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/ProblemKnowledgeBaseEOController.java @@ -189,4 +189,12 @@ public class ProblemKnowledgeBaseEOController extends JeroController updateEs() { + this.problemKnowledgeBaseEOService.updateEs(); + return Result.OK("更新成功!"); + } + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/IProblemKnowledgeBaseEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/IProblemKnowledgeBaseEOService.java index 0c3131507..7306bc8a0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/IProblemKnowledgeBaseEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/IProblemKnowledgeBaseEOService.java @@ -17,6 +17,13 @@ import java.util.List; */ public interface IProblemKnowledgeBaseEOService extends IService { + /** + * 知识分享更新ES + * + * @return + */ + void updateEs(); + /** * 保存 * @@ -57,6 +64,8 @@ public interface IProblemKnowledgeBaseEOService extends IService list = this.list(); + log.error("知识分享更新ES==开始==总数:" + list.size()); + for (ProblemKnowledgeBaseEO problemKnowledgeBaseEO : list) { + if (StringUtils.equals(problemKnowledgeBaseEO.getReleaseStatus(), ReleaseStatusEnum.HAVE_RELEASED.getValue())) { + this.addOrUpdateElasticsearch(problemKnowledgeBaseEO); + index++; + } + } + log.error("知识分享更新ES==结束==更新数量:" + index); + } + /** * 保存 @@ -433,7 +460,7 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl sysConfigs = iSysConfigService.queryList(); + if(org.apache.commons.collections.CollectionUtils.isNotEmpty(sysConfigs)){ + for (SysConfig sysConfig : sysConfigs) { + if(sysConfig.getConfigName().equals("domainWebImgURL")){ + String pcUrl = sysConfig.getConfig(); + String phoneUrl = sysConfig.getPhoneConfig(); + if(ObjectUtils.isNotEmpty(problemKnowledgeBaseEO) && StringUtils.isNotBlank(problemKnowledgeBaseEO.getContent())){ + String content = problemKnowledgeBaseEO.getContent().replace(pcUrl,phoneUrl); + content = content.replace("jero-boot/","jero-boot/phone/"); + problemKnowledgeBaseEO.setContent(content); + } + break; + } + } + } + + List problemKnowledgeBaseEOList = new ArrayList<>(); + if (ObjectUtils.isNotEmpty(problemKnowledgeBaseEO)) { + problemKnowledgeBaseEOList.add(problemKnowledgeBaseEO); + } + this.disposeData(problemKnowledgeBaseEOList,cut); + if (CollectionUtils.isNotEmpty(problemKnowledgeBaseEOList)) { + problemKnowledgeBaseEO = problemKnowledgeBaseEOList.get(0); + } + return problemKnowledgeBaseEO; + } /** * 列表查询 @@ -946,6 +1008,7 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl { + @Autowired + private IProjectCertificationInventoryEOService projectCertificationInventoryEOService; + + /** + * 分页列表查询 + * + * @param projectCertificationInventoryEO + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @AutoLog(value = "项目库-认证清单表-分页列表查询") + @ApiOperation(value="项目库-认证清单表-分页列表查询", notes="项目库-认证清单表-分页列表查询") + @GetMapping(value = "/page") + public Result queryPageList(ProjectCertificationInventoryEO projectCertificationInventoryEO, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + @RequestParam(name="cut", defaultValue="cn") String cut, + HttpServletRequest req) { + String flowStatusStr = ""; + if (StringUtils.isNotEmpty(projectCertificationInventoryEO.getFlowStatus())) { + flowStatusStr = projectCertificationInventoryEO.getFlowStatus(); + projectCertificationInventoryEO.setFlowStatus(null); + } + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(projectCertificationInventoryEO, req.getParameterMap()); + if (StringUtils.isNotEmpty(flowStatusStr)) { + String finalflowStatusStr = flowStatusStr.replaceAll("\\*",""); + queryWrapper.and(query -> { + query.lambda().like(ProjectCertificationInventoryEO::getFlowStatus, finalflowStatusStr); + if(StringUtils.contains(finalflowStatusStr,",")){ + String[] flowStatusArr = finalflowStatusStr.split(","); + for (String fs : flowStatusArr) { + query.or(q -> { + q.like("flow_status",fs); + }); + } + } + }); + } + queryWrapper.orderByDesc("create_time"); + Page page = new Page(pageNo, pageSize); + IPage pageList = this.projectCertificationInventoryEOService.queryPage(queryWrapper,page,projectCertificationInventoryEO,cut); + return Result.OK(cut,pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "项目库-认证清单表-列表查询") + @ApiOperation(value="项目库-认证清单表-列表查询", notes="项目库-认证清单表-列表查询") + @GetMapping(value = "/list") + public Result> queryList() { + List list = projectCertificationInventoryEOService.queryList(); + return Result.OK(list); + } + + /** + * 添加 + * + * @param projectCertificationInventoryEO + * @return + */ + @AutoLog(value = "项目库-认证清单表-添加") + @ApiOperation(value="项目库-认证清单表-添加", notes="项目库-认证清单表-添加") + @PostMapping(value = "/add") + public Result add(@Validated @RequestBody ProjectCertificationInventoryEO projectCertificationInventoryEO) { + projectCertificationInventoryEOService.add(projectCertificationInventoryEO); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param projectCertificationInventoryEO + * @return + */ + @AutoLog(value = "项目库-认证清单表-编辑") + @ApiOperation(value="项目库-认证清单表-编辑", notes="项目库-认证清单表-编辑") + @PutMapping(value = "/edit") + public Result edit(@Validated @RequestBody ProjectCertificationInventoryEO projectCertificationInventoryEO) { + projectCertificationInventoryEOService.editById(projectCertificationInventoryEO); + 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) { + projectCertificationInventoryEOService.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.projectCertificationInventoryEOService.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) { + ProjectCertificationInventoryEO projectCertificationInventoryEO = projectCertificationInventoryEOService.queryById(id); + if(projectCertificationInventoryEO==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(projectCertificationInventoryEO); + } + + /** + * 导出excel + * + * @param request + * @param projectCertificationInventoryEO + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ProjectCertificationInventoryEO projectCertificationInventoryEO) { + return super.exportXls(request, projectCertificationInventoryEO, ProjectCertificationInventoryEO.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, ProjectCertificationInventoryEO.class); + } + + @AutoLog(value = "项目库-认证清单表-批量添加") + @ApiOperation(value="项目库-认证清单表-批量添加", notes="项目库-认证清单表-批量添加") + @PostMapping(value = "/batchAdd") + public Result batchAdd(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.batchAdd(json); + } + + @AutoLog(value = "项目库-认证清单表-批量设置") + @ApiOperation(value="项目库-认证清单表-批量设置", notes="项目库-认证清单表-批量设置") + @PostMapping(value = "/setBatch") + public Result setBatch(@RequestBody ProjectCertificationInventoryEO projectCertificationInventoryEO) { + return this.projectCertificationInventoryEOService.setBatch(projectCertificationInventoryEO); + } + + @AutoLog(value = "项目库-认证清单表-studio发布") + @ApiOperation(value="项目库-认证清单表-studio发布", notes="项目库-认证清单表-studio发布") + @PostMapping(value = "/issue") + public Result issue(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.issue(json); + } + + @AutoLog(value = "项目库-认证清单表-当前登录用户角色") + @ApiOperation(value="项目库-认证清单表-当前登录用户角色", notes="项目库-认证清单表-当前登录用户角色") + @GetMapping(value = "/getRoleByUserId") + public Result> getRoleByUserId(@RequestParam Map params) { + return this.projectCertificationInventoryEOService.getRoleByUserId(params); + } + + @AutoLog(value = "项目库-认证清单表-获取流程状态列表") + @ApiOperation(value="项目库-认证清单表-获取流程状态列表", notes="项目库-认证清单表-获取流程状态列表") + @GetMapping(value = "/getFlowStatusList") + public Result getFlowStatusList(@RequestParam("cut") String cut) { + return this.projectCertificationInventoryEOService.getFlowStatusList(cut); + } + + @AutoLog(value = "项目库-认证清单表-认证流程统一提交任务接口") + @ApiOperation(value="项目库-认证清单表-认证流程统一提交任务接口", notes="项目库-认证清单表-认证流程统一提交任务接口") + @PostMapping(value = "/submitTask") + public Result submitTask(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.submitTask(json); + } + + @AutoLog(value = "项目库-认证清单表-批量保存") + @ApiOperation(value="项目库-认证清单表-批量保存", notes="项目库-认证清单表-批量保存") + @PostMapping(value = "/saveBatch") + public Result saveBatch(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.saveBatch(json); + } + + @AutoLog(value = "项目库-认证清单表-流程重置") + @ApiOperation(value="项目库-认证清单表-流程重置", notes="项目库-认证清单表-流程重置") + @PostMapping(value = "/resetFlow") + public Result resetFlow(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.resetFlow(json); + } + + @AutoLog(value = "项目库-认证清单表-转办") + @ApiOperation(value="项目库-认证清单表-转办", notes="项目库-认证清单表-转办") + @PostMapping(value = "/transferTask") + public Result transferTask(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.transferTask(json); + } + + @AutoLog(value = "项目库-认证清单表-催办") + @ApiOperation(value="项目库-认证清单表-催办", notes="项目库-认证清单表-催办") + @PostMapping(value = "/expediting") + public Result expediting(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.expediting(json); + } + + @AutoLog(value = "项目库-认证清单表-批量修改配置项") + @ApiOperation(value="项目库-认证清单表-批量修改配置项", notes="项目库-认证清单表-批量修改配置项") + @PostMapping(value = "/updateConfigItemBatch") + public Result updateConfigItemBatch(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.updateConfigItemBatch(json); + } + + @ApiOperation(value="项目库-认证清单表-模板下载", notes="项目库-认证清单表-模板下载") + @GetMapping(value = "/exportTemplate") + public void exportTemplate(ProjectCertificationInventoryEO projectCertificationInventoryEO, HttpServletResponse response, HttpServletRequest request) throws Exception { + projectCertificationInventoryEOService.exportTemplate(projectCertificationInventoryEO,response,request); + } + + /** + * 导入数据 + * + * @param file + * @param projectCertificationInventoryEO + * @return + */ + @ApiOperation(value="项目库-认证清单表-导入数据", notes="项目库-认证清单表-导入数据") + @RequestMapping(value = "/importData", method = RequestMethod.POST) + public Result importData(@RequestParam(value = "file", required = false) MultipartFile file, + ProjectCertificationInventoryEO projectCertificationInventoryEO) { + projectCertificationInventoryEOService.importData(file,projectCertificationInventoryEO); + return Result.OK("导入成功"); + } + /** + * 导出数据 + * @param request + * @param projectCertificationInventoryEO + */ + @ApiOperation(value="项目库-认证清单表-导出数据", notes="项目库-认证清单表-导出数据") + @RequestMapping(value = "/exportData",method = RequestMethod.GET) +// @RequiresPermissions("projectLawsInventory:exportData") + public void exportData(HttpServletResponse response, + HttpServletRequest request, + ProjectCertificationInventoryEO projectCertificationInventoryEO) { + projectCertificationInventoryEOService.exportData(response,request, projectCertificationInventoryEO); + } + + @AutoLog(value = "项目库-认证清单表-调取添加") + @ApiOperation(value="项目库-认证清单表-调取添加", notes="项目库-认证清单表-调取添加") + @PostMapping(value = "/callAdd") + public Result callAdd(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.callAdd(json); + } + + @AutoLog(value = "项目库-认证清单表-引用交付物") + @ApiOperation(value="项目库-认证清单表-引用交付物", notes="项目库-认证清单表-引用交付物") + @PostMapping(value = "/citeDeliverable") + public Result citeDeliverable(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.citeDeliverable(json); + } + + /** + * 批量更新法规清单状态 + * @param json + * @return + */ + @AutoLog(value = "项目库-认证清单表-批量更新流程状态") + @ApiOperation(value="项目库-认证清单表-批量更新流程状态", notes="项目库-认证清单表-批量更新流程状态") + @PostMapping(value = "/updateStatusBatch") + public Result updateStatusBatch(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.updateStatusBatch(json); + } + + /** + * 添加配置 等同于 复制 + * @param json + * @return + */ + @AutoLog(value = "项目库-认证清单表-添加配置") + @ApiOperation(value="项目库-认证清单表-添加配置", notes="项目库-认证清单表-添加配置") + @PostMapping(value = "/addConfigByIds") + public Result addConfigByIds(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.addConfigByIds(json); + } + + /** + * 获取责任人和接口人 + * @return + */ + @AutoLog(value = "项目库-认证清单表-获取责任人和接口人") + @ApiOperation(value="项目库-认证清单表-获取责任人和接口人", notes="项目库-认证清单表-获取责任人和接口人") + @GetMapping(value = "/queryDutyPersonByProjectId") + public Result queryDutyPersonByProjectId(@RequestParam Map params) { + return Result.OK(this.projectCertificationInventoryEOService.queryDutyPersonByProjectId(params)); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java new file mode 100644 index 000000000..9ec966ed0 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java @@ -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 { + @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 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> queryList(ProjectLawsInventoryEO projectLawsInventoryEO,HttpServletRequest req) { + List 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 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 params) { + List 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 queryWrapper = QueryGenerator.initQueryWrapper(bussDocumentLibraryEO, req.getParameterMap()); + Page page = new Page(bussDocumentLibraryEO.getPageNo(), bussDocumentLibraryEO.getPageSize()); + IPage 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 queryWrapper = QueryGenerator.initQueryWrapper(dummyInventoryBaseEO, req.getParameterMap()); + queryWrapper.orderByDesc("create_time"); + Page page = new Page(pageNo, pageSize); + IPage 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 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>> queryConditionInventory(@RequestParam(name="flag",required=true) String flag, + @RequestParam(name="cut",required=true) String cut) { + List> list = bussDocumentLibraryEOService.queryConditionInventory(flag,cut); + return Result.OK(list); + } + + + @ApiOperation(value="法规清单中添加调用文档库数据--分页", notes="法规清单中添加调用文档库数据--分页") + @PostMapping(value = "/queryPageDummy") + @ResponseBody + public net.sf.json.JSONObject queryPageDummy(@RequestBody Map parameter) { + IPage infoPage = bussDocumentLibraryEOService.getPageDummy(parameter); + Result 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 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> getRoleByUserId(String projectLibraryId,String cut) { + Result> result = new Result<>(); + List 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 params){ + Map>> res = this.projectLawsInventoryEOService.queryDutyPersonByProjectId(params); + return Result.OK(res); + } + + /** + * 分页查询不符合项列表 + * @return + */ + @AutoLog(value = "项目库-法规清单表-查询不符合项列表") + @ApiOperation(value="项目库-法规清单表-查询不符合项列表", notes="项目库-法规清单表-查询不符合项列表") + @GetMapping(value = "/queryNotComplianList") + public Result queryNotComplianList(@RequestParam Map params) { + List> 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 params) { + this.projectLawsInventoryEOService.exportNotComplianList(response,request, params); + } + + @AutoLog(value = "项目库-法规清单表-定版校验") + @ApiOperation(value="项目库-法规清单表-定版校验", notes="项目库-法规清单表-定版校验") + @GetMapping(value = "/finalizationVerify") + public Result finalizationVerify(@RequestParam Map params){ + return this.projectLawsInventoryEOService.finalizationVerify(params); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLibraryBaseController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLibraryBaseController.java new file mode 100644 index 000000000..2f51b7038 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLibraryBaseController.java @@ -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 { + @Autowired + private IProjectLibraryBaseService projectLibraryBaseService; + + /** + * 分页列表查询 + * + * @return + */ + @AutoLog(value = "项目库基础表-分页列表查询") + @ApiOperation(value="项目库基础表-分页列表查询", notes="项目库基础表-分页列表查询") + @PostMapping(value = "/page") + public Result queryPageList(@RequestBody Map params) { + List 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> queryList(ProjectLibraryBase projectLibraryBase) { + List 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 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 data = projectLibraryBaseService.getProjectDetailsStatistics(id); + return Result.OK(cut,data); + } + + /** + * 项目详情-统计接口-根据领域分组 + * @return + */ + @AutoLog(value = "项目详情-统计接口-根据领域分组") + @ApiOperation(value="项目详情-统计接口-根据领域分组", notes="项目详情-统计接口-根据领域分组") + @GetMapping(value = "/getProjectDetailsStatisticsGroupByTerritory") + public Result getProjectDetailsStatisticsGroupByTerritory(@RequestParam Map params) { + Map 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 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 versionsInfoList = projectLibraryBaseService.getVersionsInfo(id); + return Result.OK(versionsInfoList); + } + + /** + * 版本统计 + * @return + */ + @AutoLog(value = "版本统计") + @ApiOperation(value="版本统计)", notes="版本统计") + @PostMapping(value = "/versionStatistics") + public Result versionStatistics(@RequestBody Map params) { + List 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 params) { + this.projectLibraryBaseService.exportProjectProgressStatisticsXls(response,request, params); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java index 09adf3b2d..c5d43e6e3 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java @@ -25,9 +25,9 @@ public enum CertificationFlowNodeEnum { * 任务办理 -> 责任人接受之后,等待提交交付物 * 任务审查 -> 责任人提交交付物之后,认证工程师审查。 */ - CHECKLIST_VERIFICATION ("Task initiation","任务发起","Task initiation"), - TASK_RESPONSIBILITY_CONFIRMATION ("Task responsibility confirmation","任务责任确认","Task responsibility confirmation"), - TASK_HANDLING ("Task handling","任务办理","Task handling"), + CHECKLIST_VERIFICATION ("Task initiation","任务发起","Task Initiation"), + TASK_RESPONSIBILITY_CONFIRMATION ("Task responsibility confirmation","任务责任确认","Responsibilty Confirmation"), + TASK_HANDLING ("Task handling","任务办理","Task Handling"), TASK_REVIEW ("Task Review","任务审查","Task Review"), ; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ComplianceFlowStatusEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ComplianceFlowStatusEnum.java index 129363940..1eb7e76cf 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ComplianceFlowStatusEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ComplianceFlowStatusEnum.java @@ -15,7 +15,7 @@ public enum ComplianceFlowStatusEnum { RESULTS_TO_BE_SUBMITTED("结果待提交","Results to be submitted","Results to be submitted"), RESULTS_TO_BE_REVIEWED("结果待审查","Results to be reviewed","Results to be reviewed"), CONFORMITY("符合","Compliance","Compliance"), - INCONFORMITY("不符合","Non-Compliance","Non-Compliance"), + INCONFORMITY("不符合","Non-compliance","Non-Compliance"), TO_TRACK("待追踪","To be tracked","To be tracked"), UNINVOLVED("不涉及","NA","NA"), TERMINATION_OF_TASK("任务终止","Termination of task","Termination of task"), diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/JumpLinkEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/JumpLinkEnum.java index b93669d80..5dc1528fe 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/JumpLinkEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/JumpLinkEnum.java @@ -29,6 +29,12 @@ public enum JumpLinkEnum { PROBLEM_KNOWLEDGE_BASE("问题知识库,列表页","","/problemknowledgeBase",""), + TO_DO_CENTER_PHONE("手机端待办中心","","/phoneToDoCenter",""), + TASK_HANDING_PHONE("手机端任务办理","","/phoneProcessManagement",""), + PRE_TASK_HANDING_PHONE("手机端认证任务办理","","/phoneHandlingPage",""), + + + //认证参数收集,认证工程师发起,工程接口人接收 // PROBLEM_KNOWLEDGE_BASE("问题知识库,列表页","","/problemknowledgeBase",""), diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java index 55523cda4..0cb504a45 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java @@ -7,6 +7,7 @@ import com.jero.modules.feishu.enums.TemplateInfoEnum2; import com.jero.modules.feishu.service.IFeishuService; import com.jero.modules.project.entity.ProjectCertificationInventoryEO; import com.jero.modules.project.entity.ProjectLibraryBase; +import com.jero.modules.project.enums.CertificationFlowNodeEnum; import com.jero.modules.project.enums.CertificationInventoryFlowStatusEnum; import com.jero.modules.project.service.IProjectCertificationInventoryEOService; import com.jero.modules.project.service.IProjectLibraryBaseService; @@ -112,7 +113,8 @@ public class CertificationInventoryJob implements Job { certificationEngineerId, threeDaysList, TemplateInfoEnum2.CERTIFICATION_MESSAGE6.getValue(), - threeDaysList.get(0).getEndTime() + threeDaysList.get(0).getEndTime(), + CertificationFlowNodeEnum.TASK_REVIEW.getKey() ); } } @@ -126,7 +128,8 @@ public class CertificationInventoryJob implements Job { certificationEngineerId, currentDaysList, TemplateInfoEnum2.CERTIFICATION_MESSAGE7.getValue(), - currentDaysList.get(0).getEndTime() + currentDaysList.get(0).getEndTime(), + CertificationFlowNodeEnum.TASK_REVIEW.getKey() ); } } @@ -140,7 +143,8 @@ public class CertificationInventoryJob implements Job { certificationEngineerId, overdueList, TemplateInfoEnum2.CERTIFICATION_MESSAGE8.getValue(), - overdueList.get(0).getEndTime() + overdueList.get(0).getEndTime(), + CertificationFlowNodeEnum.TASK_REVIEW.getKey() ); } } @@ -170,7 +174,7 @@ public class CertificationInventoryJob implements Job { certificationEngineerId, threeDaysList, TemplateInfoEnum2.CERTIFICATION_MESSAGE6.getValue(), - threeDaysList.get(0).getInventoryVerifyEndTime() + threeDaysList.get(0).getInventoryVerifyEndTime(),"" ); } } @@ -184,7 +188,7 @@ public class CertificationInventoryJob implements Job { certificationEngineerId, currentDaysList, TemplateInfoEnum2.CERTIFICATION_MESSAGE7.getValue(), - currentDaysList.get(0).getInventoryVerifyEndTime() + currentDaysList.get(0).getInventoryVerifyEndTime(),"" ); } } @@ -198,7 +202,7 @@ public class CertificationInventoryJob implements Job { certificationEngineerId, overdueList, TemplateInfoEnum2.CERTIFICATION_MESSAGE8.getValue(), - overdueList.get(0).getInventoryVerifyEndTime() + overdueList.get(0).getInventoryVerifyEndTime(),"" ); } } @@ -253,7 +257,8 @@ public class CertificationInventoryJob implements Job { dutyPersonUserId, fourteenDaysList, TemplateInfoEnum2.CERTIFICATION_MESSAGE19.getValue(), - fourteenDaysList.get(0).getEndTime() + fourteenDaysList.get(0).getEndTime(), + CertificationFlowNodeEnum.TASK_HANDLING.getKey() ); } @@ -266,7 +271,8 @@ public class CertificationInventoryJob implements Job { dutyPersonUserId, sevenDaysList, TemplateInfoEnum2.CERTIFICATION_MESSAGE20.getValue(), - sevenDaysList.get(0).getEndTime() + sevenDaysList.get(0).getEndTime(), + CertificationFlowNodeEnum.TASK_HANDLING.getKey() ); } @@ -279,7 +285,8 @@ public class CertificationInventoryJob implements Job { dutyPersonUserId, currentDaysList, TemplateInfoEnum2.CERTIFICATION_MESSAGE21.getValue(), - currentDaysList.get(0).getEndTime() + currentDaysList.get(0).getEndTime(), + CertificationFlowNodeEnum.TASK_HANDLING.getKey() ); } // 逾期的 @@ -291,7 +298,8 @@ public class CertificationInventoryJob implements Job { dutyPersonUserId, overdueList, TemplateInfoEnum2.CERTIFICATION_MESSAGE22.getValue(), - overdueList.get(0).getEndTime() + overdueList.get(0).getEndTime(), + CertificationFlowNodeEnum.TASK_HANDLING.getKey() ); } } @@ -325,7 +333,8 @@ public class CertificationInventoryJob implements Job { dutyPersonUserId, fourteenDaysList, TemplateInfoEnum2.CERTIFICATION_MESSAGE19.getValue(), - fourteenDaysList.get(0).getTaskConfirmEndTime() + fourteenDaysList.get(0).getTaskConfirmEndTime(), + CertificationFlowNodeEnum.TASK_RESPONSIBILITY_CONFIRMATION.getKey() ); } @@ -338,7 +347,8 @@ public class CertificationInventoryJob implements Job { dutyPersonUserId, sevenDaysList, TemplateInfoEnum2.CERTIFICATION_MESSAGE20.getValue(), - sevenDaysList.get(0).getTaskConfirmEndTime() + sevenDaysList.get(0).getTaskConfirmEndTime(), + CertificationFlowNodeEnum.TASK_RESPONSIBILITY_CONFIRMATION.getKey() ); } @@ -351,7 +361,8 @@ public class CertificationInventoryJob implements Job { dutyPersonUserId, currentDaysList, TemplateInfoEnum2.CERTIFICATION_MESSAGE21.getValue(), - currentDaysList.get(0).getTaskConfirmEndTime() + currentDaysList.get(0).getTaskConfirmEndTime(), + CertificationFlowNodeEnum.TASK_RESPONSIBILITY_CONFIRMATION.getKey() ); } // 逾期的 @@ -363,7 +374,8 @@ public class CertificationInventoryJob implements Job { dutyPersonUserId, overdueList, TemplateInfoEnum2.CERTIFICATION_MESSAGE22.getValue(), - overdueList.get(0).getTaskConfirmEndTime() + overdueList.get(0).getTaskConfirmEndTime(), + CertificationFlowNodeEnum.TASK_RESPONSIBILITY_CONFIRMATION.getKey() ); } } @@ -687,7 +699,8 @@ public class CertificationInventoryJob implements Job { List userList,String userId, List list, String templateId, - Date endTime) { + Date endTime, + String taskDefinitionKey){ String thirdId = this.sysUserService.getUserThirdIdByUserId(userList,userId); if(StringUtils.isNotEmpty(thirdId)){ @@ -698,6 +711,10 @@ public class CertificationInventoryJob implements Job { Map hrefFeishuMap = this.projectCertificationInventoryEOService.getCertificationInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN); String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + String hrefFeishu_CN_P = (String) hrefFeishuMap.get("hrefFeishu_CN_P"); + if(StringUtils.isNotEmpty(taskDefinitionKey)){ + hrefFeishu_CN_P = this.projectCertificationInventoryEOService.handlePhoneLink(projectLibraryBase.getId(),PRN_CN,taskDefinitionKey); + } Map standNameAndItemName = this.projectCertificationInventoryEOService.getStandNameAndItemName(list); String standName = (String) standNameAndItemName.get("standName"); @@ -717,6 +734,8 @@ public class CertificationInventoryJob implements Job { templateVariableMap.put("endTime", DateUtils.formatDate(endTime)); templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); + templateVariableMap.put("viewBtnUrlCnPhone",hrefFeishu_CN_P); + larkMesJson.put("templateVariableMap",templateVariableMap); this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/InventoryAffirmJob.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/InventoryAffirmJob.java index cdd502126..d77b9fa07 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/InventoryAffirmJob.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/InventoryAffirmJob.java @@ -137,6 +137,7 @@ public class InventoryAffirmJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN, ProjectRoleEnum.REGULATI_ENGINEER.getValue()); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); params.put("Initiator",projectLibraryBase.getStudioEngineerName()); this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE4.getValue(),params); @@ -168,6 +169,7 @@ public class InventoryAffirmJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN,ProjectRoleEnum.REGULATI_ENGINEER.getValue()); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); params.put("Initiator",projectLibraryBase.getStudioEngineerName()); this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE4.getValue(),params); @@ -199,6 +201,7 @@ public class InventoryAffirmJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN,PRN_EN,ProjectRoleEnum.REGULATI_ENGINEER.getValue()); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); params.put("Initiator",projectLibraryBase.getStudioEngineerName()); this.projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE4.getValue(),params); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/TaskAffirmJob.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/TaskAffirmJob.java index 03b944d72..594ad8c17 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/TaskAffirmJob.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/TaskAffirmJob.java @@ -147,6 +147,7 @@ public class TaskAffirmJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = designDutyDataList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -187,6 +188,7 @@ public class TaskAffirmJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = designDutyDataList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -227,6 +229,7 @@ public class TaskAffirmJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = overdueList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -282,6 +285,7 @@ public class TaskAffirmJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = threeDaysList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -322,6 +326,7 @@ public class TaskAffirmJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = currentDaysList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -362,6 +367,7 @@ public class TaskAffirmJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = overdueList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/VerifyComplianceJob.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/VerifyComplianceJob.java index 7c2db9b57..868ced1ca 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/VerifyComplianceJob.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/VerifyComplianceJob.java @@ -136,6 +136,7 @@ public class VerifyComplianceJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = fourteenDaysList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -175,6 +176,7 @@ public class VerifyComplianceJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = sevenDaysList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -214,6 +216,7 @@ public class VerifyComplianceJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = currentDaysList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -252,6 +255,7 @@ public class VerifyComplianceJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = overdueList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/designComplianceJob.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/designComplianceJob.java index 8eecd0f8a..348b92929 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/designComplianceJob.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/designComplianceJob.java @@ -136,6 +136,7 @@ public class designComplianceJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = fourteenDaysList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -175,6 +176,7 @@ public class designComplianceJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = sevenDaysList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -214,6 +216,7 @@ public class designComplianceJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = currentDaysList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -252,6 +255,7 @@ public class designComplianceJob implements Job { Map hrefFeishuMap = this.projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN",(String)hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN",(String)hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = overdueList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java index 2a53d7390..4c99ee3a5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java @@ -226,7 +226,7 @@ public interface IProjectCertificationInventoryEOService extends IService projectCertificationInventoryEOS, String templeteId, List userIdList, List userInfoList, Date endTime); + void sendMessageByTemplateId(List projectCertificationInventoryEOS, String templeteId, List userIdList, List userInfoList, Date endTimeString, String taskDefinitionKey); /** * 数据唯一校验。 @@ -249,7 +249,7 @@ public interface IProjectCertificationInventoryEOService extends IService addConfigByIds(JSONObject json); - + String handlePhoneLink(String id, String prn_cn, String key); void certificationInventoryEOListSortByEndTimeAsc(List projectCertificationInventoryEOList); void certificationInventoryEOListSortByInventoryVerifyEndTimeAsc(List projectCertificationInventoryEOList); void certificationInventoryEOListSortByTaskConfirmEndTimeAsc(List projectCertificationInventoryEOList); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 158d627ff..41a690f71 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -3,6 +3,7 @@ package com.jero.modules.project.service.impl; import cn.afterturn.easypoi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import cn.hutool.core.util.URLUtil; import cn.hutool.core.util.ZipUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; @@ -152,6 +153,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl userIdList, List userInfoList, - Date endTime){ + Date endTime, + String taskDefinitionKey){ LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectCertificationInventoryEOS.get(0).getProjectLibraryId()); @@ -695,6 +700,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN); String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + String hrefFeishu_CN_P = (String) hrefFeishuMap.get("hrefFeishu_CN_P"); + if(StringUtils.isNotEmpty(taskDefinitionKey)){ + hrefFeishu_CN_P = this.handlePhoneLink(projectLibraryBase.getId(),PRN_CN,taskDefinitionKey); + } Map standNameAndItemName = this.projectCertificationInventoryEOService.getStandNameAndItemName(projectCertificationInventoryEOS); String standName = (String) standNameAndItemName.get("standName"); @@ -722,6 +731,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryId, PRN_CN, PRN_EN); String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + String hrefFeishu_CN_P = (String) hrefFeishuMap.get("hrefFeishu_CN_P"); + List certificationEngineerUserInfoList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); certificationEngineerIdList.forEach(userId -> { @@ -1177,6 +1190,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN); String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + String hrefFeishu_CN_P = this.handlePhoneLink(projectLibraryBase.getId(),PRN_CN,CertificationFlowNodeEnum.TASK_HANDLING.getKey()); Map standNameAndItemName = this.projectCertificationInventoryEOService.getStandNameAndItemName(projectCertificationInventoryEOList); String standName = (String) standNameAndItemName.get("standName"); @@ -2149,8 +2167,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN); String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + String hrefFeishu_CN_P = (String) hrefFeishuMap.get("hrefFeishu_CN_P"); Map standNameAndItemName = this.projectCertificationInventoryEOService.getStandNameAndItemName(projectCertificationInventoryEOList); String standName = (String) standNameAndItemName.get("standName"); @@ -2287,6 +2308,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN); String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + String hrefFeishu_CN_P = (String) hrefFeishuMap.get("hrefFeishu_CN_P"); // 给studio分配待办中心任务 /*List processInfoDetailEOList = new ArrayList<>(); @@ -2416,6 +2440,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN); String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + //飞书手机跳转链接 + String hrefFeishu_CN_P = this.handlePhoneLink(projectLibraryBase.getId(),PRN_CN,CertificationFlowNodeEnum.TASK_RESPONSIBILITY_CONFIRMATION.getKey()); Map> certifycationInventoryListByDutyPersonMap = projectCertificationInventoryEOList.stream().collect(Collectors.groupingBy(ProjectCertificationInventoryEO::getDutyPerson)); try { @@ -2536,6 +2564,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl idList = Arrays.asList(ids.split(",")); @@ -3068,6 +3108,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getCertificationInventoryLinkHrefFeishu(projectLibraryId, PRN_CN, PRN_EN); String hrefFeishu_CN = (String) hrefFeishuMap.get("hrefFeishu_CN"); String hrefFeishu_EN = (String) hrefFeishuMap.get("hrefFeishu_EN"); + String hrefFeishu_CN_P = (String) hrefFeishuMap.get("hrefFeishu_CN_P"); /** * studio催办:除了 清单待发布、审查通过、认证退回 的 催办当前办理人 @@ -3307,8 +3350,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN", hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", hrefFeishuMap.get("hrefFeishu_CN_P")); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); @@ -867,6 +872,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); params.put("Initiator", regulationOwnerUserName); @@ -903,6 +909,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); params.put("Initiator", regulationOwnerUserName); @@ -948,6 +955,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); params.put("Initiator", regulationOwnerUserName); @@ -992,6 +1000,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); params.put("Initiator", regulationOwnerUserName); @@ -1038,7 +1047,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); - + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); params.put("Initiator", regulationOwnerUserName); @@ -1078,6 +1089,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); @@ -1090,6 +1104,40 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl processInfoDetailEOQueryWrapper = new QueryWrapper<>(); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId, projectLawsInventoryEO.getId()); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType, FlowTypeEnum.SJFHXSHLC.getValue()); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getStatus, TaskStatusEnum.NOT_DONE.getValue()); + List processInfoDetailEOS = this.processInfoDetailEOService.list(processInfoDetailEOQueryWrapper); + if (CollectionUtils.isNotEmpty(processInfoDetailEOS)) { + String designPId = processInfoDetailEOS.get(0).getActiProcInstId(); + url = backUrlPhone + JumpLinkEnum.TASK_HANDING_PHONE.getLink() + "?actiProcInstId=" + designPId + "&projectTaskInventoryId=" + projectLawsInventoryEO.getId() + + "&projectLibraryId=" + projectLawsInventoryEO.getProjectLibraryId() + "&TaskKey=" + processInfoDetailEOS.get(0).getTaskDefinitionKey() + + "&TaskKeyName=" + DesignComplianceFlowNodeKeyEnum.getTextByValue(processInfoDetailEOS.get(0).getTaskDefinitionKey(), CutEnum.CN.getValue()) + + "&isDisplay=false&flowType=2&Sponsor=regulationOwnerName&personLiable=designDutyIdName&typeOfDeliverables=designDeliverableTypeName&deliverableTemplate=designDeliverableTemplate&DueDate=designDueDate&remarks=designRemark"; + } + return URLUtil.encode(url); + } + + private String handlePhoneVerifyLink(ProjectLawsInventoryEO projectLawsInventoryEO) { + String url = backUrlPhone + JumpLinkEnum.TO_DO_CENTER_PHONE.getLink(); + QueryWrapper processInfoDetailEOQueryWrapper = new QueryWrapper<>(); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId, projectLawsInventoryEO.getId()); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType, FlowTypeEnum.YZFHXSCLC.getValue()); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getStatus, TaskStatusEnum.NOT_DONE.getValue()); + List processInfoDetailEOS = this.processInfoDetailEOService.list(processInfoDetailEOQueryWrapper); + if (CollectionUtils.isNotEmpty(processInfoDetailEOS)) { + String verifyPId = processInfoDetailEOS.get(0).getActiProcInstId(); + url = backUrlPhone + JumpLinkEnum.TASK_HANDING_PHONE.getLink() + "?actiProcInstId="+verifyPId+"&projectTaskInventoryId="+projectLawsInventoryEO.getId() + +"&projectLibraryId="+projectLawsInventoryEO.getProjectLibraryId()+"&TaskKey="+processInfoDetailEOS.get(0).getTaskDefinitionKey() + +"&TaskKeyName="+ VerifyComplianceFlowNodeKeyEnum.getTextByValue(processInfoDetailEOS.get(0).getTaskDefinitionKey(),CutEnum.CN.getValue()) + +"&isDisplay=false&flowType=4&Sponsor=regulationOwnerName&personLiable=verifyDutyIdName&typeOfDeliverables=verifyDeliverableTypeName&deliverableTemplate=verifyDeliverableTemplate&DueDate=verifyDueDate&remarks=verifyRemark"; + } + return URLUtil.encode(url); + } + private void setProjectLawsInventoryPermission(String userId, String projectId, String lawsInventoryId, Date now, List adds, String belong) { QueryWrapper del = new QueryWrapper<>(); del.eq("project_id", projectId) @@ -3571,6 +3619,18 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); @@ -6879,6 +6939,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN, com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getValue()); paramsMsg.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); paramsMsg.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + paramsMsg.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); paramsMsg.put("Initiator", projectLibraryBase.getStudioEngineerName()); this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE2.getValue(), paramsMsg); @@ -10639,6 +10700,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = lawsInventoryEOList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -10706,6 +10768,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryId, todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = lawsInventoryEOList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -10772,6 +10835,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); @@ -10834,6 +10898,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN, com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getValue()); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); params.put("Initiator", projectLibraryBase.getStudioEngineerName()); this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(), params); @@ -10895,6 +10960,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = lawsInventoryEOList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -10962,6 +11028,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryId, todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); String regulationOwnerId = lawsInventoryEOList.get(0).getRegulationOwnerId(); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); @@ -11028,6 +11095,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); @@ -11090,6 +11158,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN, com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getValue()); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); params.put("Initiator", projectLibraryBase.getStudioEngineerName()); this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(), params); @@ -11794,6 +11863,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN, com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getValue()); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); params.put("Initiator", projectLibraryBase.getStudioEngineerName()); this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE1.getValue(), params); @@ -11885,6 +11955,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN, com.jero.modules.system.enums.ProjectRoleEnum.REGULATI_ENGINEER.getValue()); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); params.put("Initiator", projectLibraryBase.getStudioEngineerName()); this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE2.getValue(), params); @@ -11955,6 +12026,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl hrefFeishuMap = this.getProjectLawsInventoryLinkHrefFeishu(projectLibraryBase.getId(), PRN_CN, PRN_EN, com.jero.modules.system.enums.ProjectRoleEnum.STUDIO_ENGINEER.getValue()); params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); params.put("Initiator", projectLibraryBase.getStudioEngineerName()); this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_LIST_RELEASE3.getValue(), params); @@ -12017,6 +12089,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl updateES() { + lawsMonthlyReportManageEOService.updateES(); + return Result.OK("操作成功"); + } + + + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportManageEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportManageEOService.java index cc0d078a2..165392bb5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportManageEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportManageEOService.java @@ -72,6 +72,6 @@ public interface ILawsMonthlyReportManageEOService extends IService list = this.list(); + log.error("法规月报更新ES==开始==总数:" + list.size()); + for (LawsMonthlyReportManageEO lmr : list) { + if (ObjectUtils.isNotEmpty(lmr) && "1".equals(lmr.getIssueStatus())) { + syncElasticsearch(lmr.getId(),"2",lmr.getUpdateTime()); + syncElasticsearch(lmr.getId(),"1",lmr.getUpdateTime()); + index++; + } + } + log.error("法规月报更新ES==结束==更新数量:" + index); + } + + + private void syncElasticsearch(String id, String issueStatus, Date issueTime) { LawsMonthlyReportManageEO monthlyReportManageEO = getById(id); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/controller/PhoneDocumentSearchController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/controller/PhoneDocumentSearchController.java new file mode 100644 index 000000000..ff59a5bff --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/controller/PhoneDocumentSearchController.java @@ -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>> queryCondition(@RequestParam(name="flag",required=true) String flag, + @RequestParam(name="cut",required=true) String cut, + @RequestParam(name="searchFlag",required=true) String searchFlag) { + List> list = iDocumentSearchService.queryCondition(flag,cut,searchFlag); + return Result.OK(list); + } + /** + * 列表表头 + * @param flag 标识传 1-->用于查询文档库字段属性 + * @return + */ + @AutoLog(value = "文档库信息表-列表表头") + @ApiOperation(value="文档库信息表-列表表头", notes="文档库信息表-列表表头") + @GetMapping(value = "/getHeader") + public Result>> getHeader(@RequestParam(name="flag",required=true) String flag, + @RequestParam(name="cut",required=true) String cut, + @RequestParam(name="searchFlag",required=true) String searchFla) { + List> list = iDocumentSearchService.getHeader(flag,cut,searchFla); + return Result.OK(list); + } + + @ApiOperation(value="列表查询", notes="列表查询") + @PostMapping(value = "/getInfoList") + @RequiresPermissions("document:search") + public Result getInfoList(@RequestBody Map 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 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 map) { + IPage infoList = iDocumentSearchService.getProblemKnowledgeBasePage(map); + return Result.OK(infoList); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/controller/PhoneLawsMonthlyReportSearchController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/controller/PhoneLawsMonthlyReportSearchController.java new file mode 100644 index 000000000..d543ea885 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/controller/PhoneLawsMonthlyReportSearchController.java @@ -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); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/controller/PhoneOnlCgformSubscribeController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/controller/PhoneOnlCgformSubscribeController.java new file mode 100644 index 000000000..db1c6cb8c --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/controller/PhoneOnlCgformSubscribeController.java @@ -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 { + @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 params) { + /* + public Result queryPageList(OnlCgformSubscribe onlCgformSubscribe, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(onlCgformSubscribe, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = onlCgformSubscribeService.page(page, queryWrapper); + */ + IPage pageList = onlCgformSubscribeService.queryPageList(params); + return Result.OK(pageList); + } + + /** + * 表头中英文切换 + * + * @return + */ + @AutoLog(value = "我的订阅-表头中英文切换") + @ApiOperation(value="我的订阅-表头中英文切换", notes="我的订阅-表头中英文切换") + @GetMapping(value = "/getHeader") + public Result>> getHeader(@RequestParam(name = "flag") String flag, + @RequestParam(name = "cut") String cut) { + List> list =onlCgformSubscribeService.getHeader(flag, cut); + return Result.OK(list); + } + + /** + * 查询条件中英文切换 + * + * @return + */ + @AutoLog(value = "我的订阅-查询条件中英文切换") + @ApiOperation(value="我的订阅-查询条件中英文切换", notes="我的订阅-查询条件中英文切换") + @GetMapping(value = "/queryCondition") + public Result>> queryCondition(@RequestParam(name = "flag") String flag, + @RequestParam(name = "cut") String cut) { + List> list = onlCgformSubscribeService.queryCondition(flag, cut); + return Result.OK(list); + } + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "我的订阅-列表查询") + @ApiOperation(value="我的订阅-列表查询", notes="我的订阅-列表查询") + @GetMapping(value = "/list") + public Result> queryList(OnlCgformSubscribe onlCgformSubscribe) { + List 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 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); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneParamsManifestTodoCenterController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneParamsManifestTodoCenterController.java new file mode 100644 index 000000000..9e80811a5 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneParamsManifestTodoCenterController.java @@ -0,0 +1,39 @@ +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.IParamsManifestTodoCenterService; +import com.jero.modules.todoCenter.vo.ParamsManifestTodoCenterEOPage; +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.RestController; + +/** + * @Author: liyawei + * @Description: + * @Date: Created in 09:43 2022/10/11 + */ + +@Api(tags="待办中心-参数清单") +@RestController +@RequestMapping("/phone/todoCenter/params/manifest") +@Slf4j +public class PhoneParamsManifestTodoCenterController { + + @Autowired + private IParamsManifestTodoCenterService paramsManifestTodoCenterService; + + @AutoLog(value = "分页查询") + @ApiOperation(value="分页查询", notes="分页查询") + @GetMapping(value = "/page") +// @RequiresPermissions("params:collectManifest:list") + public Result page(ParamsManifestTodoCenterEOPage pageVO) { + IPage page = paramsManifestTodoCenterService.queryPage(pageVO); + return Result.OK(page); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneProjectProcessTodoCenterController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneProjectProcessTodoCenterController.java new file mode 100644 index 000000000..029c5717a --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneProjectProcessTodoCenterController.java @@ -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 params) { + IPage page = this.processInfoEOService.projectProcessTodoTaskList(params); + return Result.OK(page); + } + + @AutoLog(value = "分页查询-已办任务列表") + @ApiOperation(value="分页查询-已办任务列表", notes="分页查询-已办任务列表") + @GetMapping(value = "/doneProcess") + public Result doneProcess(@RequestParam Map params) { + IPage page = this.processInfoEOService.projectProcessDoneProcess(params); + return Result.OK(page); + } + + @AutoLog(value = "分页查询-已发任务列表") + @ApiOperation(value="分页查询-已发任务列表", notes="分页查询-已发任务列表") + @GetMapping(value = "/issuedProcess") + public Result issuedProcess(@RequestParam Map params) { + IPage page = this.processInfoEOService.projectProcessIssuedProcess(params); + return Result.OK(page); + } + + @AutoLog(value = "待办中心-法规评估-初始化历史数据") + @ApiOperation(value="待办中心-法规评估-初始化历史数据", notes="待办中心-法规评估-初始化历史数据") + @GetMapping(value = "/initHistoryData") + public Result initHistoryData(@RequestParam Map params) { + return this.processInfoEOService.initHistoryData(params); + } + + @AutoLog(value = "待办中心-符合性流程数据迁移") + @ApiOperation(value="待办中心-符合性流程数据迁移", notes="待办中心-符合性流程数据迁移") + @GetMapping(value = "/complianceDataMigration") + public Result complianceDataMigration(@RequestParam Map params) { + return this.processInfoEOService.complianceDataMigration(params); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/DesignComplianceFlowNodeKeyEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/DesignComplianceFlowNodeKeyEnum.java index 614e745d8..8d06fe50c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/DesignComplianceFlowNodeKeyEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/DesignComplianceFlowNodeKeyEnum.java @@ -7,17 +7,17 @@ import org.apache.commons.lang3.StringUtils; * 待办中心-设计符合性流程节点key枚举类 */ public enum DesignComplianceFlowNodeKeyEnum { - FQLC("发起流程","Initiate the process","fqlc"), - ZRRQR("任务责任确认","Confirmation of mission responsibility","zrrqr"), // 责任人确认 - DEZRRQR("任务责任确认","Confirmation of mission responsibility","dezrrqr"),// 第二责任人确认 - ZRRTJJFW("符合性确认","Compliance confirmation","zrrtjjfw"),// "责任人提交交付物" - DEZRRTJJFW("符合性确认","Compliance confirmation","dezrrtjjfw"),// 第二责任人提交交付物 - FGGCSSH("符合性审查","Compliance review","fggcssh"), // 法规工程师审核 + FQLC("发起流程","Task Initiation","fqlc"), + ZRRQR("任务责任确认","Responsibilty Confirmation","zrrqr"), // 责任人确认 + DEZRRQR("任务责任确认","Responsibilty Confirmation","dezrrqr"),// 第二责任人确认 + ZRRTJJFW("符合性确认","Compliance Confirmation","zrrtjjfw"),// "责任人提交交付物" + DEZRRTJJFW("符合性确认","Compliance Confirmation","dezrrtjjfw"),// 第二责任人提交交付物 + FGGCSSH("符合性审查","Compliance Review","fggcssh"), // 法规工程师审核 // 修改交付物流程 - BCTJ_ZRRBCTJFQ("补充提交","Supplementary submission","zrrbctjfq"), // 责任人补充提交发起 - BCTJ_ZRRBCTJXG("补充提交","Supplementary submission","zrrbctjxg"), // 责任人补充提交修改 - BCTJ_FGGCSBCSH("补充审查","Supplemental Examination","fggcsbcsh"), // 法规工程师补充审核 + BCTJ_ZRRBCTJFQ("补充提交","Supplementary Submission","zrrbctjfq"), // 责任人补充提交发起 + BCTJ_ZRRBCTJXG("补充提交","Supplementary Submission","zrrbctjxg"), // 责任人补充提交修改 + BCTJ_FGGCSBCSH("补充审查","Supplementary Review","fggcsbcsh"), // 法规工程师补充审核 ; String cnName; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/VerifyComplianceFlowNodeKeyEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/VerifyComplianceFlowNodeKeyEnum.java index 0631d2071..26a44749a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/VerifyComplianceFlowNodeKeyEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/VerifyComplianceFlowNodeKeyEnum.java @@ -7,17 +7,17 @@ import org.apache.commons.lang3.StringUtils; * 待办中心-验证符合性流程节点key枚举类 */ public enum VerifyComplianceFlowNodeKeyEnum { - FQLC("发起流程","Initiate the process","fqlc"), - ZRRQR("任务责任确认","Confirmation of mission responsibility","zrrqr"), // 责任人确认 - DEZRRQR("任务责任确认","Confirmation of mission responsibility","dezrrqr"),// 第二责任人确认 - ZRRTJJFW("符合性确认","Compliance confirmation","zrrtjjfw"),// "责任人提交交付物" - DEZRRTJJFW("符合性确认","Compliance confirmation","dezrrtjjfw"),// 第二责任人提交交付物 - FGGCSSH("符合性审查","Compliance review","fggcssh"), // 法规工程师审核 + FQLC("发起流程","Task Initiation","fqlc"), + ZRRQR("任务责任确认","Responsibility Confirm","zrrqr"), // 责任人确认 + DEZRRQR("任务责任确认","Responsibility Confirm","dezrrqr"),// 第二责任人确认 + ZRRTJJFW("符合性确认","Compliance Confirm","zrrtjjfw"),// "责任人提交交付物" + DEZRRTJJFW("符合性确认","Compliance Confirm","dezrrtjjfw"),// 第二责任人提交交付物 + FGGCSSH("符合性审查","Compliance Review","fggcssh"), // 法规工程师审核 // 修改交付物流程 - BCTJ_ZRRBCTJFQ("补充提交","Supplementary submission","zrrbctjfq"), // 责任人补充提交发起 - BCTJ_ZRRBCTJXG("补充提交","Supplementary submission","zrrbctjxg"), // 责任人补充提交修改 - BCTJ_FGGCSBCSH("补充审查","Supplemental Examination","fggcsbcsh"), // 法规工程师补充审核 + BCTJ_ZRRBCTJFQ("补充提交","Supplementary Submission","zrrbctjfq"), // 责任人补充提交发起 + BCTJ_ZRRBCTJXG("补充提交","Supplementary Submission","zrrbctjxg"), // 责任人补充提交修改 + BCTJ_FGGCSBCSH("补充审查","Supplementary Review","fggcsbcsh"), // 法规工程师补充审核 ; String cnName; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ProcessInfoEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ProcessInfoEOServiceImpl.java index d7a52229f..9403ec827 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ProcessInfoEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ProcessInfoEOServiceImpl.java @@ -782,7 +782,7 @@ public class ProcessInfoEOServiceImpl extends ServiceImpl userIdListNew = userIdList; mapList.stream().forEach(e->{ if(s.contains((String)e.get("id"))){ @@ -599,6 +601,7 @@ public class LawsWarnService { params.put("contentInfoFeiEn",contentInfoFei); params.put("userIdList",userIdListNew); params.put("back_url",encode); + params.put("back_url_phone",backUrlPhone); params.put("titleCn", " "+documentTitleCn); params.put("titleEn"," "+documentTitleEn); params.put("regulationNo"," "+serialNumber); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java index b0ab1f770..8c2ab9692 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java @@ -56,6 +56,8 @@ public class TimedTaskWarn implements Job { private SysUserMapper sysUserMapper; @Value(value = "${jero.backUrl}") private String backUrl; + @Value(value = "${jero.backUrlPhone}") + private String backUrlPhone; /** * 法规预警定时任务 @@ -106,6 +108,7 @@ public class TimedTaskWarn implements Job { "&serial_number=" + serialNumber + "'" + " target='_blank'>" + serialNumber + ""; //跳转文档详情 String url = backUrl + "/docManage/library/detail?id=" + id; + String urlPhone = backUrlPhone + "/phoneDocumentDetails?id=" + id; //订阅的用户 List onlCgformSubscribe = subscribeList.stream().filter(e -> e.getDocumentId().equals(bussDocumentLibraryEO.getId())).collect(Collectors.toList()); List userIdList = new ArrayList<>(); @@ -139,19 +142,19 @@ public class TimedTaskWarn implements Job { // } if(currentTime.equals(beforeTimeSixTen)){ //发送飞书消息(提前一年) - sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"1",userIdList); + sendFeishu(sdf, bussDocumentLibraryEO, url, urlPhone,thirdIdList,"1",userIdList); //站内消息 sendMessage(bussDocumentLibraryEO, userIdList,"1",sdf,href); } if(currentTime.equals(beforeTimeSix)){ //发送飞书消息(提前6个月) - sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"6",userIdList); + sendFeishu(sdf, bussDocumentLibraryEO, url, urlPhone,thirdIdList,"6",userIdList); //站内消息 sendMessage(bussDocumentLibraryEO, userIdList,"6",sdf,href); } if(currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str)){ //发送飞书消息(当天) - sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"0",userIdList); + sendFeishu(sdf, bussDocumentLibraryEO, url, urlPhone,thirdIdList,"0",userIdList); //站内消息 sendMessage(bussDocumentLibraryEO, userIdList,"0",sdf,href); } @@ -178,19 +181,19 @@ public class TimedTaskWarn implements Job { } if(currentTime.equals(beforeTimeSixTen)){ //发送飞书消息(提前一年) - sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"1",userIdList); + sendFeishu(sdf, bussDocumentLibraryEO, url, urlPhone,thirdIdList,"1",userIdList); //站内消息 sendMessage(bussDocumentLibraryEO, userIdList,"1",sdf,href); } if(currentTime.equals(beforeTimeSix)){ //发送飞书消息(提前6个月) - sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"6",userIdList); + sendFeishu(sdf, bussDocumentLibraryEO, url, urlPhone,thirdIdList,"6",userIdList); //站内消息 sendMessage(bussDocumentLibraryEO, userIdList,"6",sdf,href); } if(currentTime.equals(implementTimeStr)){ //发送飞书消息(当天) - sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"0",userIdList); + sendFeishu(sdf, bussDocumentLibraryEO, url, urlPhone,thirdIdList,"0",userIdList); //站内消息 sendMessage(bussDocumentLibraryEO, userIdList,"0",sdf,href); } @@ -201,6 +204,7 @@ public class TimedTaskWarn implements Job { private void sendFeishu(SimpleDateFormat sdf, BussDocumentLibraryEO bussDocumentLibraryEO, String url, + String urlPhone, List thirdIdList, String flag, List userIdList) { @@ -241,6 +245,7 @@ public class TimedTaskWarn implements Job { params.put("contentInfoFeiEn",contentEn); params.put("userIdList",userIdList); params.put("back_url",url); + params.put("back_url_phone",urlPhone); params.put("titleCn", " "+ bussDocumentLibraryEO.getTitle()); params.put("titleEn", " "+ bussDocumentLibraryEO.getTitleEn()); params.put("regulationNo", " "+ bussDocumentLibraryEO.getSerialNumber()); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneProcessHistoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneProcessHistoryEOController.java new file mode 100644 index 000000000..c2271c9a6 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneProcessHistoryEOController.java @@ -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 { + @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 queryWrapper = QueryGenerator.initQueryWrapper(processHistoryEO, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = processHistoryEOService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 列表查询 + * + * @return + */ + @AutoLog(value = "流程历史表-列表查询") + @ApiOperation(value="流程历史表-列表查询", notes="流程历史表-列表查询") + @GetMapping(value = "/list") + public Result> queryList(@RequestParam Map params) { + List 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> queryComplianceProcessHistoryList(@RequestParam Map params) { + List list = processHistoryEOService.queryComplianceProcessHistoryList(params); + return Result.OK(list); + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneTaskController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneTaskController.java new file mode 100644 index 000000000..20c8cd06d --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneTaskController.java @@ -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 saveTask(@RequestBody BusMes busMes){ + return taskFeignClient.saveTask(busMes); + } + + @AutoLog(value = "我的已办任务列表") + @ApiOperation(value="我的已办任务列表", notes="我的已办任务列表") + @PostMapping("/hastodoTasksList") + public Result> 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 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 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 busProcessNames,TaskCommonQuery taskCommonQuery){ + List 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 projectLibraryBaseList = new ArrayList<>(); + List projectLawsInventoryEOList = new ArrayList<>(); + + if(CollectionUtils.isNotEmpty(projectLawsInventoryIdList)){ + QueryWrapper lawsInventoryQueryWrap = new QueryWrapper<>(); + lawsInventoryQueryWrap.lambda().in(ProjectLawsInventoryEO::getId,projectLawsInventoryIdList); + projectLawsInventoryEOList = this.projectLawsInventoryEOService.list(lawsInventoryQueryWrap); + + List projectLibraryIdList = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getProjectLibraryId).distinct().collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(projectLibraryIdList)){ + QueryWrapper 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 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 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().lambda().eq(ProjectNameInfoEO::getId, projectLibraryBase.getProjectNameId()) + ); + ProjectYearNameInfoEO projectYearNameInfoEO = this.projectYearNameInfoEOService.getOne( + new QueryWrapper().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 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 list = new ArrayList(); + 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 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 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; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneworkFlowController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneworkFlowController.java new file mode 100644 index 000000000..be53e0e48 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneworkFlowController.java @@ -0,0 +1,244 @@ +package com.jero.modules.wkflow.controller; + +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.common.constant.WebsocketConst; +import com.jero.common.system.vo.LoginUser; +import com.jero.modules.message.websocket.WebSocket; +import com.jero.modules.project.entity.ConditionAssessmentEO; +import com.jero.modules.project.enums.CurrentProjectStatusEnum; +import com.jero.modules.project.enums.ProjectRoleEnum; +import com.jero.modules.project.service.IConditionAssessmentEOService; +import com.jero.modules.wkflow.entity.BusMes; +import com.jero.modules.wkflow.enums.FlowTypeEnum; +import com.jero.modules.wkflow.feginClient.impl.WorkFlowFeignClientImpl; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import net.sf.json.JSONObject; +import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.SecurityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; + +@Slf4j +@Api(tags="工作流管理") +@RestController +@RequestMapping("/phone/workFlow") +public class PhoneworkFlowController { + + @Autowired + private WorkFlowFeignClientImpl workFlowFeignClient; + + @Autowired + private IConditionAssessmentEOService conditionAssessmentEOService; + + @Autowired + private WebSocket webSocket; + + public Result activiti_define_start(@RequestBody JSONObject jsonObject){ + return workFlowFeignClient.activiti_define_start(jsonObject); + } + + @AutoLog(value = "启动流程-以流程定义id") + @ApiOperation(value="启动流程-以流程定义id", notes="启动流程-以流程定义id") + @PostMapping("/startProcess") + public Result startProcess(@RequestBody JSONObject jsonObject){ + String type = jsonObject.getString("type"); + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + jsonObject.put("loginUserId", currentUser.getId()); + jsonObject.put("loginUserName", currentUser.getUsername()); + if(StringUtils.equals(type,FlowTypeEnum.RWQRLC.getValue())){ + /*jsonObject.put("id", FlowTypeEnum.RWQRLC.getProcessDefinitionKey()); //流程定义id + return this.activiti_define_start(jsonObject);*/ + jsonObject.put("processDefinitionKey", FlowTypeEnum.RWQRLC.getProcessDefinitionKey()); + return this.startTaskToConfirmProcess(jsonObject); + }else if(StringUtils.equals(type,FlowTypeEnum.SJFHXSHLC.getValue())){ + jsonObject.put("id", FlowTypeEnum.SJFHXSHLC.getProcessDefinitionKey()); + //initConditionAssessmentEO(jsonObject); + return this.activiti_define_start(jsonObject); + }else if(StringUtils.equals(type,FlowTypeEnum.PREHOMOQRLC.getValue())){ + jsonObject.put("id", FlowTypeEnum.PREHOMOQRLC.getProcessDefinitionKey()); + //initConditionAssessmentEO(jsonObject); + return this.activiti_define_start(jsonObject); + }else if(StringUtils.equals(type,FlowTypeEnum.YZFHXSCLC.getValue())){ + jsonObject.put("id", FlowTypeEnum.YZFHXSCLC.getProcessDefinitionKey()); + //initConditionAssessmentEO(jsonObject); + return this.activiti_define_start(jsonObject); + }else if(StringUtils.equals(type,FlowTypeEnum.FGYJSJLC.getValue())){ + jsonObject.put("id", FlowTypeEnum.FGYJSJLC.getProcessDefinitionKey()); + return this.activiti_define_start(jsonObject); + }else if(StringUtils.equals(type,FlowTypeEnum.FGJSPG.getValue())){ + jsonObject.put("processDefinitionKey", FlowTypeEnum.FGJSPG.getProcessDefinitionKey()); + return this.startLawsTechnologyEvaluationProcess(jsonObject); + }else if(StringUtils.equals(type,FlowTypeEnum.XGJFWLC.getValue())){ + jsonObject.put("id", FlowTypeEnum.XGJFWLC.getProcessDefinitionKey()); + return this.activiti_define_start(jsonObject); + }else{ + return null; + } + } + + @AutoLog(value = "完成任务") + @ApiOperation(value="完成任务", notes="完成任务") + @PostMapping("/completeTask") + public Result completeTaskByUserId(@RequestBody BusMes busMes){ + if(StringUtils.isEmpty(busMes.getUserId())){ + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + busMes.setUserId(currentUser.getId()); + } + Result str = workFlowFeignClient.completeTaskByUserId(busMes); + if(str.getCode() == 500){ + str.setSuccess(false); + } + sendWebsocket(busMes.getTaskId(),busMes.getTaskId()); + return str; + } + + @AutoLog(value = "批量完成任务") + @ApiOperation(value="批量完成任务", notes="批量完成任务") + @PostMapping("/completeTaskBatch") + public Result completeTaskByUserIdBatch(@RequestBody BusMes busMes){ + if(StringUtils.isEmpty(busMes.getUserId())){ + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + busMes.setUserId(currentUser.getId()); + } + Result str = workFlowFeignClient.completeTaskByUserIdBatch(busMes); + if(str.getCode() == 500){ + str.setSuccess(false); + } +// sendWebsocket(busMes.getTaskId(),busMes.getTaskId()); + return str; + } + + public void sendWebsocket(String msgId, String msgTet) { + com.alibaba.fastjson.JSONObject obj = new com.alibaba.fastjson.JSONObject(); + obj.put(WebsocketConst.MSG_CMD, WebsocketConst.CMD_TOPIC); + obj.put(WebsocketConst.MSG_ID, msgId); + obj.put(WebsocketConst.MSG_TXT, msgTet); + webSocket.sendMessage(obj.toJSONString()); + } + + @AutoLog(value = "通过流程实例id查询当前待办的流程实例是否结束") + @ApiOperation(value="通过流程实例id查询当前待办的流程实例是否结束", notes="通过流程实例id查询当前待办的流程实例是否结束") + @GetMapping("/queryTaskWhetherToEnd") + public String queryTaskWhetherToEnd(@RequestParam("prcId") String prcId) { + return workFlowFeignClient.queryTaskWhetherToEnd(prcId); + } + + @AutoLog(value = "改派") + @ApiOperation(value="改派", notes="改派") + @GetMapping("/changeAssigneeNew") + public Result run(@RequestParam("taskId")String taskId,@RequestParam("assignee") String assignee, + @RequestParam("userId")String userId,@RequestParam("pId") String pId) { + return workFlowFeignClient.run(taskId,assignee,userId,pId); + } + + @AutoLog(value = "保存任务第一步") + @ApiOperation(value="保存任务第一步", notes="保存任务第一步") + @PostMapping("/saveTaskFirst") + public Result saveTaskFirst(BusMes busMes){ + return workFlowFeignClient.saveTaskFirst(busMes); + } + + @AutoLog(value = "查询流程是否结束") + @ApiOperation(value="查询流程是否结束", notes="查询流程是否结束") + @GetMapping("/isEnd") + public String isEnd(@RequestParam("pId")String pId){ + return workFlowFeignClient.isEnd(pId); + } + + @AutoLog(value = "删除流程") + @ApiOperation(value="删除流程", notes="删除流程") + @GetMapping("/deleteProcessInstance") + public Result deleteProcessInstance(@RequestParam("pId")String pId){ + return workFlowFeignClient.deleteProcessInstance(pId); + } + + @AutoLog(value = "流程实例明细列表") + @ApiOperation(value="流程实例明细列表", notes="流程实例明细列表") + @GetMapping("/get_list_by_instance") + public List> get_list_by_instance(@RequestParam("prcNum") String prcNum,@RequestParam("cut") String cut,@RequestParam("prcType") String prcType,@RequestParam(value="sortWord",required = false)String sortWord,@RequestParam(value="shunxu",required = false) String shunxu){ + return workFlowFeignClient.get_list_by_instance(prcNum,cut,prcType,sortWord,shunxu); + } + + @AutoLog(value = "获取图片") + @ApiOperation(value="获取图片", notes="获取图片") + @GetMapping("/getImg") + public void getImg(@RequestParam("prcNum")String prcNum,HttpServletResponse response) throws IOException { + OutputStream os = null; + response.setContentType("image/jpg"); + response.flushBuffer(); + os = response.getOutputStream(); + os.write(workFlowFeignClient.getImg(prcNum)); + os.flush(); + os.close(); + } + + @AutoLog(value = "强制撤回") + @ApiOperation(value="强制撤回", notes="强制撤回") + @GetMapping("/forceRecall") + public Result forceRecall(@RequestParam("prcId") String prcId){ + return workFlowFeignClient.forceRecall(prcId); + } + + @AutoLog(value = "查询流程列表") + @ApiOperation(value="查询流程列表", notes="查询流程列表") + @GetMapping("/modelListPage") + public Result> modelListPage(@RequestParam(value="name",required = false)String name, @RequestParam(value="category_id ",required = false)String category_id, + @RequestParam("current")int current, @RequestParam("size")int size){ + return workFlowFeignClient.modelListPage(name,category_id,current,size); + } + + @AutoLog(value = "根据流程实例id查询流程历史") + @ApiOperation(value="根据流程实例id查询流程历史", notes="根据流程实例id查询流程历史") + @GetMapping("/queryProcessHistoryByPrcId") + public List> queryProcessHistoryByPrcId(@RequestParam("prcId") String prcId,@RequestParam("cut") String cut,@RequestParam("prcType") String prcType,@RequestParam(value="sortWord",required = false)String sortWord,@RequestParam(value="shunxu",required = false) String shunxu){ + return workFlowFeignClient.queryProcessHistoryByPrcId(prcId,cut,prcType,sortWord,shunxu); + } + + /** + * 初始化这条法规的 当前项目状态 + */ + public void initConditionAssessmentEO(JSONObject jsonObject){ + Object msg = jsonObject.get("msg"); + Map projectLawsInventoryMap = com.alibaba.fastjson.JSONObject.parseObject(com.alibaba.fastjson.JSONObject.toJSONString(msg), Map.class); + + ConditionAssessmentEO conditionAssessmentEO = new ConditionAssessmentEO(); + conditionAssessmentEO.setRoleCode(ProjectRoleEnum.REGULATI_AND_HOMOLOGATION_ENGINEER.getValue()); + conditionAssessmentEO.setProjectLawsInventoryId(projectLawsInventoryMap.get("id").toString()); + conditionAssessmentEO.setConditionAssessment(CurrentProjectStatusEnum.BLUE.getValue()); + conditionAssessmentEOService.addOrUpdate(conditionAssessmentEO); + } + + /** + * 启动流程-法规技术评估流程 + * @param jsonObject + * @return + */ + public Result startLawsTechnologyEvaluationProcess(@RequestBody JSONObject jsonObject){ + return workFlowFeignClient.startLawsTechnologyEvaluationProcess(jsonObject); + } + + /** + * 启动流程-任务确认流程 + * @param jsonObject + * @return + */ + public Result startTaskToConfirmProcess(@RequestBody JSONObject jsonObject){ + return workFlowFeignClient.startTaskToConfirmProcess(jsonObject); + } + + @AutoLog(value = "根据taskId删除流程") + @ApiOperation(value="根据taskId删除流程", notes="根据taskId删除流程") + @GetMapping("/deleteProcessInstanceByTaskId") + public Result deleteProcessInstanceByTaskId(@RequestParam("taskId")String taskId){ + return workFlowFeignClient.deleteProcessInstance(taskId); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java index a39fdb049..77c6683f8 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java @@ -9,17 +9,17 @@ import org.apache.commons.lang3.StringUtils; */ public enum FlowTypeEnum { - RWQRLC("1","任务确认流程","RWQRLC","任务确认流程","rwqrlc","清单任务确认","List task Confirmation"), + RWQRLC("1","任务确认流程","RWQRLC","任务确认流程","rwqrlc","清单任务确认","List task confirmation"), SJFHXSHLC("2","设计符合性审查流程","SJFHXSHLC","设计符合性审查流程","sjfhxlc","设计符合性流程","Design Compliance Process"), - PREHOMOQRLC("3","prehomo确认流程","PREHOMOQRLC","prehomo确认流程","prehomoqrlc","Pre-Homo确认","The Pre - Homo confirmation"), - YZFHXSCLC("4","验证符合性审查流程","YZFHXSCLC","验证符合性审查流程","yzfhxsclc","验证符合性流程","Verify Compliance Process"), - FGYJSJLC("5","法规意见收集流程","FGYJSJLC","法规意见收集流程","fgyjsjlc","法规意见收集","Collection of Legislative Comments"), - FGJSPG("6","法规技术评估流程","FGJSPG","法规技术评估流程","fgjspglc","法规技术评估","Regulatory and technical assessment"), - QDQR("10","清单确认","QDQR","清单确认流程","qdqr","法规清单发布","Release of regulatory list"), - CERTIFICATION_LC("21","认证流程","CERTIFICATION_LC","认证流程","certification_lc","Pre-Homo流程","Pre-Homo flow"), + PREHOMOQRLC("3","prehomo确认流程","PREHOMOQRLC","prehomo确认流程","prehomoqrlc","Pre-Homo确认","Pre-Homo Confirmation"), + YZFHXSCLC("4","验证符合性审查流程","YZFHXSCLC","验证符合性审查流程","yzfhxsclc","验证符合性流程","Verification Compliance Process"), + FGYJSJLC("5","法规意见收集流程","FGYJSJLC","法规意见收集流程","fgyjsjlc","法规意见收集","Opinion Collection on Regulation"), + FGJSPG("6","法规技术评估流程","FGJSPG","法规技术评估流程","fgjspglc","法规技术评估","Regulatory Technical Assessment"), + QDQR("10","清单确认","QDQR","清单确认流程","qdqr","法规清单发布","Regulation List Release"), + CERTIFICATION_LC("21","认证流程","CERTIFICATION_LC","认证流程","certification_lc","Pre-Homo流程","Pre-Homo Process"), XGJFWLC("31","修改交付物流程","XGJFWLC","修改交付物流程","xgjfwlc","修改交付物流程","Update Deliverable"), SJ_XGJFWLC("32","设计-修改交付物流程","SJ_XGJFWLC","设计-修改交付物流程","sj_xgjfwlc","设计-修改交付物流程","Design Update Deliverable"), - YZ_XGJFWLC("34","验证-修改交付物流程","YZ_XGJFWLC","验证-修改交付物流程","yz_xgjfwlc","验证-修改交付物流程","Verify Update Deliverable"), + YZ_XGJFWLC("34","验证-修改交付物流程","YZ_XGJFWLC","验证-修改交付物流程","yz_xgjfwlc","验证-修改交付物流程","Verification Update Deliverable"), ; private String value; diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/application-dev.yml b/jero-boot/jero-boot-single-startup/src/main/resources/application-dev.yml index 668711b6f..1fb617200 100644 --- a/jero-boot/jero-boot-single-startup/src/main/resources/application-dev.yml +++ b/jero-boot/jero-boot-single-startup/src/main/resources/application-dev.yml @@ -131,6 +131,7 @@ spring: datasource: master: url: jdbc:mysql://121.36.69.172:3307/laws_weilai?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false +# url: jdbc:mysql://127.0.0.1:3306/laws_weilai?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false username: root password: hzwlsoft.com driver-class-name: com.mysql.cj.jdbc.Driver @@ -185,6 +186,7 @@ jero : # 本地:local\Minio:minio\阿里云:alioss\腾讯云 cos uploadType: local backUrl: http://localhost:3000 + backUrlPhone: http://localhost:3000 #拆分图片展示地址 splitUrl: http://localhost:8080 path : diff --git a/jero-web/public/iframe.css b/jero-web/public/iframe.css new file mode 100644 index 000000000..3caecf643 --- /dev/null +++ b/jero-web/public/iframe.css @@ -0,0 +1,6 @@ +.my-photo { + width: 100%; +} +.container{ + padding: 0!important; +} \ No newline at end of file diff --git a/jero-web/public/index.html b/jero-web/public/index.html index 2f7255407..cd9912069 100644 --- a/jero-web/public/index.html +++ b/jero-web/public/index.html @@ -5,7 +5,7 @@ - + 蔚来全球法规平台 diff --git a/jero-web/src/App.vue b/jero-web/src/App.vue index 1caee63ae..c596ee1a8 100644 --- a/jero-web/src/App.vue +++ b/jero-web/src/App.vue @@ -216,4 +216,7 @@ height: 32px !important; line-height: 32px !important; } + .van-dialog .van-goods-action-button--danger{ + background: #00B3BE!important; + } \ No newline at end of file diff --git a/jero-web/src/assets/Avatar.png b/jero-web/src/assets/Avatar.png new file mode 100644 index 000000000..8dd82f356 Binary files /dev/null and b/jero-web/src/assets/Avatar.png differ diff --git a/jero-web/src/assets/niogrp.png b/jero-web/src/assets/niogrp.png new file mode 100644 index 000000000..12970a1db Binary files /dev/null and b/jero-web/src/assets/niogrp.png differ diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index 5a15385a1..b30c0a9fd 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -123,7 +123,7 @@ module.exports = { MergeAll: 'Merge All', TreeOperation: 'Tree Operation', essentialInformation: 'General Information', - DetailsPhasedImplementation: 'Details of the phased implementation', + DetailsPhasedImplementation: 'Phased Implementation', Statutenumberclause: 'Statute number/clause', OrganizationName: 'Organization Name', EnterOrganizationDepartment: 'Please enter organization / department name', @@ -501,9 +501,9 @@ module.exports = { feedback: 'Feedback', approvalHistory: 'Approval History', cannotExceed500characters: 'Cannot Exceed 500 characters', - accord: 'Compliant', - nonConformity: 'Non-compliant', - Tracked: 'To Be Tracked', + accord: 'Compliance', + nonConformity: 'Non-compliance', + Tracked: 'To be tracked', notInvolved: 'NA', Operator: 'Operator', role: 'Role', @@ -875,7 +875,7 @@ module.exports = { engineer: 'Engineer', engineeringConfirmationDetails: 'Engineering Deliverable Details', reminder: 'Reminder', - adopt: 'Pass', + adopt: 'Approve', reviewedByThePersonInCharge: 'Reviewed by Owner', onlyDeleted: 'Only delete data when the process is not started or already ended', experimentPassed: 'Test Passed', @@ -906,11 +906,11 @@ module.exports = { maintainVirtualList: 'Maintain Market List', certificationListMaintenance: 'Homo List Maintenance', reasonsForRejection: 'Reason for Rejection', - inconformity: 'Non-compliant', - toTrack: 'To Be Tracked', + inconformity: 'Non-compliance', + toTrack: 'To be tracked', Launch: 'Initiate', maintainProgress: 'Maintain Schedule', - redSchedule: 'Red: non-compliant, without acceptable solutions or timeline ', + redSchedule: 'Red: non-compliance, without acceptable solutions or timeline ', yellowSchedule: 'Yellow: non-compliant/to be tracked, with acceptable solutions and timeline ', greenRequirements: 'Green: compliant or meeting the requirements', blueUndeterminedState: 'Blue: pending', @@ -986,7 +986,7 @@ module.exports = { CollectionInitiated: 'To be collected', handledInterface: 'To be processed by eng. interface', ReturnedPerson: 'Rejected by eng. interface', - completed: 'To Be Filled', + completed: 'To be filled', Filledreturn: 'Rejected by the applicant', Submitted: 'Submitted', ReturnedEngineer: 'Rejected by homo engineer', @@ -1037,7 +1037,7 @@ module.exports = { primaryCoverageEn: 'Description (En)', workProgressCn: 'NIO Work Progress (Cn)', workProgressEn: 'NIO Work Progress (En)', - initiatingProcess: 'Initiate Process', + initiatingProcess: 'Process Initiation', collectResults: 'Collect Results', dateOfInitiation: 'Date Of Initiation', closingDate: 'Due Date', @@ -1361,10 +1361,11 @@ module.exports = { taskConfirmationHandling:'Task confirmation handling', relatedVersion:'Related Version', filledBy:'Filled by', - parameterToBeInitiated:'Parameter to be initiated', + parameterToBeInitiated:'To be initiated', listTaskConfirmation:'List task confirmation', - completednum: 'To Be Filled', + completednum: 'To be filled', filledBynum:'Filled by', + filledByPhone:'To be assigned', parameterToBeInitiatednum:'Parameter to be initiated', listToConfirm:'To Be Confirmed', toSubmit:'To Be Submitted', @@ -1414,8 +1415,8 @@ module.exports = { returnedForApproval:'Returned', changeSetting:'Change Configuration', referenceDeliverables:'Reference Deliverable', - missionAccepted:'Task Accepted', - missionRejection:'Task Rejected', + missionAccepted:'Accept', + missionRejection:'Reject', turnToDo:'Forward', initiateTask:'Initiate Task', compliancereport:'Generate Compliance report', @@ -1525,11 +1526,11 @@ module.exports = { VINcodelist:'VIN code list', VINcodeupload:'VIN code upload', Tasknode:'Task Node', - Taskresponsibilityrecognition:'Responsibility Confirm', + Taskresponsibilityrecognition:'Responsibilty Confirmation', uploadattachment:'Upload', - Processhistory:'Process history', + Processhistory:'Process History', historyData:'1. Regulatory Engineer, 2. Responsible person, 3. Responsible person, 4. Regulatory Engineer', - resultofhandling:'Result of handling', + resultofhandling:'Result', cause:'cause', networksecurityrequirements:'Network security requirements', upgradefunctionrequirements:'Upgrade function requirements', @@ -1664,7 +1665,6 @@ module.exports = { taskname:'Task name', updatereleasetime:'Update release time', upgradeplanexpirationtime:'Upgrade plan expiration time', - resultofhandling:'Result of handling', Listoftreatableregulations:'List of treatable regulations', Listofuntractableregulations:'List of untractable regulations', project:'Project', @@ -1712,7 +1712,6 @@ module.exports = { implementedupgrade:'Whether the implemented upgrade is consistent with the record', numberofvehicles:'Number of vehicles that have completed upgrades', vehicleshavenotcompletedonlineupgrade:'The reason why some vehicles have not completed online upgrade', - cause:'cause', implementationrecords:'Fault handling measures and emergency response implementation records', onlyDataWithListStatusDraftCanBeDeleted:'Only data with a list status of Draft can be deleted', implementationDateTwo:'Implementation Date', @@ -1754,13 +1753,13 @@ module.exports = { taskToBeConfirmed:'Task to be confirmed', resultsToBeSubmitted:'Results to be submitted', resultsToBeReviewed:'Results to be reviewed', - compliance:'Compliant', - nonCompliance:'Non-compliant', - toBeTracked:'To Be Tracked', + compliance:'Compliance', + nonCompliance:'Non-compliance', + toBeTracked:'To be tracked', NA:'NA', electroniccontrollerparameter:'Electronic controller parameter', - reviewAndPass:'Review and pass', - reviewAndReturn:'Review and return', + reviewAndPass:'Approve', + reviewAndReturn:'Reject', marketRegulationListDetails:'Market Regulation List Details', marketRegulationList:'Market Regulation List', onlyDataWithTheCurrentCanBeManipulated:'Only data with the current user as the responsible person can be manipulated', @@ -1829,7 +1828,7 @@ module.exports = { proportion:'Proportion', projectProgressStatistics:'Project Progress Statistics', GRPSystemProjectProgressStatistics:'GRP system project progress statistics', - statisticalNodes:'Statistical Nodes', + statisticalNodes:'Responsible Department', proportionWithInTheAreaOfResponsibility:'Proportion within the area of responsibility', contentsearch:'Content Search', masterProject:'Master Project', @@ -1858,47 +1857,52 @@ module.exports = { recentBrowsing:'Recent Browsing', mySubscription:'My Subscription', languageSwitching:'Language Switching', - phoneSearch:'search', + phoneSearch:'Search', taskStatistics:'Task Statistics', mine:'Mine', - regulatoryCertificationProcess:'Regulatory certification process', - authenticationParameterCollection:'Authentication parameter collection', - regulatoryCertificationProcessData:'Regulatory Certification Process Data', - regulationListIssuance:'Regulation list issuance', - designTheComplianceProcess:'Design the compliance process', - verifyComplianceProcess:'Verify compliance process', - thePreHomeProcess:'Pre-Home Process', - technicalAssessmentOfRegulations:'Technical Assessment Regulations', - legalOpinionCollection:'Legal Opinion Collection', - authenticationParameterCollectionData:'Authentication parameter collection data', - phoneRelatedItems:'Related items', - listHeading:'List heading', - phoneVersionNumber:'Version number', + regulatoryCertificationProcess:'Regulatoion Homologation Process', + authenticationParameterCollection:'Homo Parameter Collection', + regulatoryCertificationProcessData:'Regulatoion Homologation Process Data', + regulationListIssuance:'Regulation List Release', + designTheComplianceProcess:'Design Compliance Process', + verifyComplianceProcess:'Validation Compliance Process', + thePreHomeProcess:'Pre-Homo Process', + technicalAssessmentOfRegulations:'Regulation Technical Assessment', + legalOpinionCollection:'Opinion Collection on Regulation', + authenticationParameterCollectionData:'Homo Parameter Collection Data', + phoneRelatedItems:'Project', + listHeading:'List Name', + phoneVersionNumber:'Version', node:'Node', goToCheck:'View', stored:'Stored', individual:'a ', document:'document', treatmentMode:'Treatment Mode', - onlyMobilePhoneAreDisplayed:'Only the tasks that can be handled by the mobile phone are displayed', + onlyMobilePhoneAreDisplayed:'Only display tasks that can be processed by the mobile terminal', phoneReset:'Reset', noMore:'No More', loading:'Loading...', - howAboutComment:'How about a comment', + howAboutComment:'Comment...', send:'Send', - pleaseProcessThePC:'Please process it on the PC', - clickAndSelect:'Click and select', - phoneCreationTime:'Creation Time', + pleaseProcessThePC:'Please handle it on the PC side', + clickAndSelect:'Click and Select', + phoneCreationTime:'Create Time', theCurrentFormatSupportPreview:'The current format does not support preview', - nearlyMonth:'Nearly a month', - nearlyThreeMonths:'Nearly Three Months', - nearlySixMonths:'Nearly Six Months', - nearlyYear:'Nearly a Year', + nearlyMonth:'In a month', + nearlyThreeMonths:'In three months', + nearlySixMonths:'In six months', + nearlyYear:'In a year', browsingTime:'Browsing Time', pleaseViewOnPc:'Please view on PC', - taskHandling:'Task Handling', + taskHandling:'Task handling', pleaseEnterUserAccountSearchFor:'Please enter a user account to search for', exportOption:'Export Option', includeTitle:'Include title', Notitleincluded:'No title included', + backToHomePage:'Back To Home Page', + documentsHaveBeenStored:'documents have been stored', + knowledgeSharingHaveBeenStored:'Knowledge Sharing have been stored', + regulationMonthlyReportHaveBeenStored:'Regulation Monthly Report have been stored', + sendBackOne:'Return', } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 7913edf5c..e62a58bf2 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -1462,6 +1462,7 @@ module.exports = { taskConfirmationHandling: '任务确认办理', relatedVersion: '相关版本', filledBy: '待分配填写人', + filledByPhone:'待分配填写人', parameterToBeInitiated: '参数待发起', listTaskConfirmation: '清单任务确认', completednum: '待填写', @@ -1637,7 +1638,6 @@ module.exports = { Categoryofdeliverables: "交付物类型", Taskconfirmationresult: '任务确认结果', Compliancetaskhandling: '符合性任务办理', - resultofhandling: '处理结果', networksecurityrequirements: '网络安全要求', upgradefunctionrequirements: '升级功能要求', usernotificationrequirement: '用户告知要求', @@ -1928,7 +1928,7 @@ module.exports = { proportion:'占比', projectProgressStatistics:'项目进度统计', GRPSystemProjectProgressStatistics:'GRP系统项目进度统计', - statisticalNodes:'统计节点', + statisticalNodes:'责任部门', proportionWithInTheAreaOfResponsibility:'责任领域内占比', contentsearch:'内容搜索', masterProject:'主项目', @@ -2838,8 +2838,6 @@ module.exports = { blueUndeterminedState: '蓝:未判断状态', authenticationMessage: '认证参数任务', taskRegulationComplianceTask: '法规符合性任务', - accept: '接受', - refuse: '拒绝', taskTermination: '任务终止', projectStatusAndProgress: '项目状态进度', listConfirmationProgress: '清单确认进度', @@ -3539,14 +3537,12 @@ module.exports = { uploadattachment: '上传附件', Processhistory: '流程历史', historyData: '1.法规工程师,2.责任人,3.责任人,4.法规工程师', - resultofhandling: '处理结果', Listoftreatableregulations: '可处理法规列表', Listofuntractableregulations: '不可处理法规列表', project: '项目', Categoryofdeliverables: "交付物类型", Taskconfirmationresult: '任务确认结果', Compliancetaskhandling: '符合性任务办理', - resultofhandling: '处理结果', networksecurityrequirements: '网络安全要求', upgradefunctionrequirements: '升级功能要求', usernotificationrequirement: '用户告知要求', @@ -3837,7 +3833,7 @@ module.exports = { proportion:'占比', projectProgressStatistics:'项目进度统计', GRPSystemProjectProgressStatistics:'GRP系统项目进度统计', - statisticalNodes:'统计节点', + statisticalNodes:'责任部门', proportionWithInTheAreaOfResponsibility:'责任领域内占比', contentsearch:'内容搜索', masterProject:'主项目', @@ -3864,4 +3860,6 @@ module.exports = { exportOption:'导出选项', includeTitle:'包含标题', Notitleincluded:'不包含标题', + backToHomePage:'返回主页', + sendBackOne:'退回', } \ No newline at end of file diff --git a/jero-web/src/components/CollectionType/index.vue b/jero-web/src/components/CollectionType/index.vue index b00044d8c..4b6bc0fc6 100644 --- a/jero-web/src/components/CollectionType/index.vue +++ b/jero-web/src/components/CollectionType/index.vue @@ -1,11 +1,11 @@ diff --git a/jero-web/src/components/CollectionTypeDisabled/index.vue b/jero-web/src/components/CollectionTypeDisabled/index.vue index d37359513..8c2a0d9e3 100644 --- a/jero-web/src/components/CollectionTypeDisabled/index.vue +++ b/jero-web/src/components/CollectionTypeDisabled/index.vue @@ -3,7 +3,7 @@
-
+
@@ -93,7 +93,7 @@ v-if="Object.keys(detailDate.paramsConfigData).length - 1 == index && index < 9">
-
@@ -101,7 +101,7 @@
-
+
@@ -128,7 +128,7 @@ v-if="Object.keys(detailDate.paramsConfigData).length - 1 == index && index < 9">
-
@@ -136,7 +136,7 @@
-
+
@@ -156,7 +156,7 @@ v-if="Object.keys(detailDate.paramsConfigData).length - 1 == index && index < 9">
-
@@ -164,7 +164,7 @@
-
-
@@ -194,7 +194,7 @@
-
@@ -210,7 +210,7 @@ v-if="Object.keys(detailDate.paramsConfigData).length - 1 == index && index < 9">
-
@@ -218,7 +218,7 @@
-
+
@@ -320,7 +320,7 @@ v-if="Object.keys(detailDate.paramsConfigData).length - 1 == index && index < 9">
-
@@ -328,7 +328,7 @@
-
+
-
@@ -440,7 +440,7 @@
-
+
@@ -537,7 +537,7 @@ v-if="Object.keys(detailDate.paramsConfigData).length - 1 == index && index < 9">
-
@@ -545,7 +545,7 @@
-
+
@@ -574,7 +574,7 @@ v-if="Object.keys(detailDate.paramsConfigData).length - 1 == index && index < 9">
-
@@ -582,7 +582,7 @@
-
+
-
@@ -621,7 +621,7 @@
-
+
@@ -732,7 +732,7 @@ v-if="Object.keys(detailDate.paramsConfigData).length - 1 == index && index < 9">
-
@@ -765,7 +765,8 @@ detailDatetransformation: [], fileNameOne: '', fileNameTwo: '', - fileIndex: '' + fileIndex: '', + key:[], } }, components: { @@ -788,6 +789,11 @@ // }) // this.detailDatetransformation.push(item) }) + this.key = Object.keys(this.detailDate.paramsConfigData).sort((a, b) => { + let index = a.lastIndexOf('+') + let index1 = b.lastIndexOf('+') + return a.slice(0, index) - b.slice(0, index1) + }) }, methods: { onInput(r) { @@ -855,16 +861,36 @@ return id // return Math.random().toString(32) }, - + keyIndex(){ + let key = Object.keys(this.detailDate.paramsConfigData).sort((a, b) => { + let index = a.lastIndexOf('+') + let index1 = b.lastIndexOf('+') + return a.slice(0, index) - b.slice(0, index1) + }) + return key + }, addconfig() { - let paramsConfigData = Object.keys(this.detailDate.paramsConfigData) + let paramsConfigData = Object.keys(this.detailDate.paramsConfigData).sort((a, b) => { + let index = a.lastIndexOf('+') + let index1 = b.lastIndexOf('+') + return a.slice(0, index) - b.slice(0, index1) + }) for (let i = 0; i < paramsConfigData.length; i++) { + // this.detailDate.paramsConfigData[paramsConfigData[i]][0].orderNum = i + 1 if (i == paramsConfigData.length - 1) { let name = paramsConfigData[i] - let generateRandom = this.generateRandom() - console.log(generateRandom) + let index = name.lastIndexOf('+') + let num + if (index == '-1') { + num = 0 + } else { + num = name.slice(0, index) + } + console.log(num) + num = parseInt(num) + let generateRandom = (num + 1) + '+' + this.generateRandom() this.detailDate.paramsConfigData[generateRandom] = JSON.parse(JSON.stringify(this.detailDate.paramsConfigData[name])) - this.detailDate.paramsConfigData[generateRandom].forEach(res => { + this.detailDate.paramsConfigData[generateRandom].forEach((res, index) => { if (res.type === 'pull_more') { res.dataValue = [] } else { @@ -873,7 +899,20 @@ }) } } - this.detailDate.paramsConfigData = { ...this.detailDate.paramsConfigData } + const ordered = {} + let that = this + + Object.keys(this.detailDate.paramsConfigData).sort().forEach(function(key) { + ordered[key] = that.detailDate.paramsConfigData[key] + }) + console.log(ordered) + this.key = Object.keys(this.detailDate.paramsConfigData).sort((a, b) => { + let index = a.lastIndexOf('+') + let index1 = b.lastIndexOf('+') + return a.slice(0, index) - b.slice(0, index1) + }) + console.log(this.key) + this.detailDate.paramsConfigData = { ...ordered } this.$emit('consolidateData') // postAction('params/configData/add', { // paramsCollectManifestId: this.recordList.id, @@ -885,8 +924,9 @@ // } // }) }, - delconfig(item) { + delconfig(item,index) { delete this.detailDate.paramsConfigData[item] + this.key.splice(index,1) this.detailDate.paramsConfigData = { ...this.detailDate.paramsConfigData } this.$emit('consolidateData') // for (const key in this.detailDate.paramsConfigData) { diff --git a/jero-web/src/components/tools/UserMenu.vue b/jero-web/src/components/tools/UserMenu.vue index e67f9aea2..a26d99cf9 100644 --- a/jero-web/src/components/tools/UserMenu.vue +++ b/jero-web/src/components/tools/UserMenu.vue @@ -259,7 +259,7 @@ export default { // 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' //线上 + // encodeURIComponent(window.loginUrl) + '&response_type=code' //线上 localStorage.removeItem('language') // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面 diff --git a/jero-web/src/config/router.config.js b/jero-web/src/config/router.config.js index ed1c2df03..5f5916571 100644 --- a/jero-web/src/config/router.config.js +++ b/jero-web/src/config/router.config.js @@ -482,83 +482,83 @@ export const constantRouterMap = [ /* 手机端开始 */ //搜索 - { - path: '/phoneSearch', - name: 'phoneSearch', - component: () => import('@/views/phoneView/search') - }, - //待办中心 - { - path: '/phoneToDoCenter', - name: 'phoneToDoCenter', - component: () => import('@/views/phoneView/toDoCenter') - }, - //任务数据 - { - path: '/phoneTaskData', - name: 'phoneTaskData', - component: () => import('@/views/phoneView/taskData') - }, - //我的 - { - path: '/phoneHome', - name: 'phoneHome', - component: () => import('@/views/phoneView/home') - }, - //搜索列表 - { - path: '/phoneSearchList', - name: 'phoneSearchList', - component: () => import('@/views/phoneView/searchList') - }, - //文档详情 - { - path: '/phoneDocumentDetails', - name: 'phoneDocumentDetails', - component: () => import('@/views/phoneView/documentDetails') - }, - //流程 - { - path: '/phoneProcessManagement', - name: 'phoneProcessManagement', - component: () => import('@/views/phoneView/processManagement') - }, - //知识分享 - { - path: '/phoneProblemKnowledgeBase', - name: 'phoneProblemKnowledgeBase', - component: () => import('@/views/phoneView/problemKnowledgeBase') - }, - //办理页面 - { - path: '/phoneHandlingPage', - name: 'phoneHandlingPage', - component: () => import('@/views/phoneView/handlingPage') - }, - //我的收藏 - { - path: '/phoneMyCollection', - name: 'phoneMyCollection', - component: () => import('@/views/phoneView/myCollection') - }, - //最近预览 - { - path: '/phoneRecentBrowsing', - name: 'phoneRecentBrowsing', - component: () => import('@/views/phoneView/recentBrowsing') - }, - //我的订阅 - { - path: '/phoneMySubscribe', - name: 'phoneMySubscribe', - component: () => import('@/views/phoneView/mySubscribe') - }, - //perhome办理流程 - { - path: '/phonePreHomoMangement', - name: 'phonePreHomoMangement', - component: () => import('@/views/phoneView/preHomoMangement') - }, + // { + // path: '/phoneSearch', + // name: 'phoneSearch', + // component: () => import('@/views/phoneView/search') + // }, + // //待办中心 + // { + // path: '/phoneToDoCenter', + // name: 'phoneToDoCenter', + // component: () => import('@/views/phoneView/toDoCenter') + // }, + // //任务数据 + // { + // path: '/phoneTaskData', + // name: 'phoneTaskData', + // component: () => import('@/views/phoneView/taskData') + // }, + // //我的 + // { + // path: '/phoneHome', + // name: 'phoneHome', + // component: () => import('@/views/phoneView/home') + // }, + // //搜索列表 + // { + // path: '/phoneSearchList', + // name: 'phoneSearchList', + // component: () => import('@/views/phoneView/searchList') + // }, + // //文档详情 + // { + // path: '/phoneDocumentDetails', + // name: 'phoneDocumentDetails', + // component: () => import('@/views/phoneView/documentDetails') + // }, + // //流程 + // { + // path: '/phoneProcessManagement', + // name: 'phoneProcessManagement', + // component: () => import('@/views/phoneView/processManagement') + // }, + // //知识分享 + // { + // path: '/phoneProblemKnowledgeBase', + // name: 'phoneProblemKnowledgeBase', + // component: () => import('@/views/phoneView/problemKnowledgeBase') + // }, + // //办理页面 + // { + // path: '/phoneHandlingPage', + // name: 'phoneHandlingPage', + // component: () => import('@/views/phoneView/handlingPage') + // }, + // //我的收藏 + // { + // path: '/phoneMyCollection', + // name: 'phoneMyCollection', + // component: () => import('@/views/phoneView/myCollection') + // }, + // //最近预览 + // { + // path: '/phoneRecentBrowsing', + // name: 'phoneRecentBrowsing', + // component: () => import('@/views/phoneView/recentBrowsing') + // }, + // //我的订阅 + // { + // path: '/phoneMySubscribe', + // name: 'phoneMySubscribe', + // component: () => import('@/views/phoneView/mySubscribe') + // }, + // //perhome办理流程 + // { + // path: '/phonePreHomoMangement', + // name: 'phonePreHomoMangement', + // component: () => import('@/views/phoneView/preHomoMangement') + // }, /* 手机端结束 */ // { // path:'/vehicleinformation', @@ -716,6 +716,12 @@ export const phoneConstantRouterMap = [ name: 'phonePreHomoMangement', component: () => import('@/views/phoneView/preHomoMangement') }, + //法规月报详情页 + { + path: '/phoneProblemKnowledgeBaseFile', + name: 'phoneProblemKnowledgeBaseFile', + component: () => import('@/views/phoneView/problemKnowledgeBaseFile') + }, /* 手机端结束 */ { path: '/404', diff --git a/jero-web/src/permission.js b/jero-web/src/permission.js index 430dbd8d2..c319563c0 100644 --- a/jero-web/src/permission.js +++ b/jero-web/src/permission.js @@ -11,34 +11,7 @@ import { getAction } from '@/api/manage' import { welcome } from '@/utils/util' let isPhone = localStorage.getItem('isPhone') -console.log(isPhone) -// 判断当前设备 -function isMobile() { - var userAgentInfo = navigator.userAgent - - var mobileAgents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'] - - var mobile_flag = false - - //根据userAgent判断是否是手机 - for (var v = 0; v < mobileAgents.length; v++) { - if (userAgentInfo.indexOf(mobileAgents[v]) > 0) { - mobile_flag = true - break - } - } - var screen_width = window.screen.width - var screen_height = window.screen.height - - //根据屏幕分辨率判断是否是手机 - if (screen_width < 500 && screen_height < 800) { - mobile_flag = true - } - return mobile_flag -} - -let mobile = isMobile() NProgress.configure({ showSpinner: false }) // NProgress Configuration // TODO 线上部署在conmponetns/tools/UserMenu.vue的退出登录时需解开代码以及注释代码 @@ -49,6 +22,7 @@ const whiteList = ['/user/login', '/user/register', '/user/register-result', '/u // const whiteList = [] + // no redirect whitelist router.beforeEach((to, from, next) => { diff --git a/jero-web/src/store/modules/user.js b/jero-web/src/store/modules/user.js index ccd43b585..8b965f919 100644 --- a/jero-web/src/store/modules/user.js +++ b/jero-web/src/store/modules/user.js @@ -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)) diff --git a/jero-web/src/utils/kkfileView.js b/jero-web/src/utils/kkfileView.js index 18bb49ab7..750d1c578 100644 --- a/jero-web/src/utils/kkfileView.js +++ b/jero-web/src/utils/kkfileView.js @@ -10,11 +10,12 @@ export function kkFileView(fileName, fileId) { let fileSuffix = fileName.substring(index1, index2) if (fileSuffix == '.docx' || fileSuffix == '.doc' || fileSuffix == '.pdf' || fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(downLoadFileUrl + '/' + fileId + fileSuffix) - window.open(url) + return url } else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(downLoadImgUrl + '/' + fileId + fileSuffix) - window.open(url) + return url } else { Toast('当前格式不支持预览') + return '' } } \ No newline at end of file diff --git a/jero-web/src/utils/request.js b/jero-web/src/utils/request.js index 60ac92889..b16d6de02 100644 --- a/jero-web/src/utils/request.js +++ b/jero-web/src/utils/request.js @@ -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({ diff --git a/jero-web/src/views/phoneView/documentDetails.vue b/jero-web/src/views/phoneView/documentDetails.vue index ba0c63afb..d6afd2e3d 100644 --- a/jero-web/src/views/phoneView/documentDetails.vue +++ b/jero-web/src/views/phoneView/documentDetails.vue @@ -1,7 +1,7 @@