From 8a9ebcc57c4388325b9e8e48714ee1371115972a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Mon, 3 Jul 2023 09:04:19 +0800 Subject: [PATCH 01/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AFPC=E7=AB=AF=E6=8E=A5=E5=8F=A3=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jero/config/shiro/ShiroConfig.java | 4 + .../controller/PhoneLoginController.java | 573 ++++++++++++ .../controller/PhoneSysDictController.java | 856 +++++++++++++++++ .../PhoneSysPermissionController.java | 865 ++++++++++++++++++ .../PhoneOnlCgformCollectionController.java | 161 ++++ .../PhoneBussDocumentLibraryEOController.java | 526 +++++++++++ ...asedImplementationDetailsEOController.java | 173 ++++ .../controller/RecentBrowseController.java | 2 +- .../controller/SearchCenterController.java | 2 +- .../controller/TaskStatisticsController.java | 2 +- .../controller/ToDoCenterController.java | 2 +- ...wledgeBaseBrowsingHistoryEOController.java | 171 ++++ ...oblemKnowledgeBaseCollectEOController.java | 210 +++++ ...oblemKnowledgeBaseCommentEOController.java | 173 ++++ ...PhoneProblemKnowledgeBaseEOController.java | 192 ++++ ...roblemKnowledgeBasePraiseEOController.java | 171 ++++ ...PhoneProjectLawsInventoryEOController.java | 564 ++++++++++++ .../PhoneProjectLibraryBaseController.java | 285 ++++++ .../PhoneDocumentSearchController.java | 110 +++ ...honeLawsMonthlyReportSearchController.java | 38 + .../PhoneOnlCgformSubscribeController.java | 210 +++++ ...oneProjectProcessTodoCenterController.java | 64 ++ .../PhoneProcessHistoryEOController.java | 198 ++++ .../controller/PhoneTaskController.java | 285 ++++++ jero-web/src/components/tools/UserMenu.vue | 6 +- jero-web/src/store/modules/user.js | 17 +- jero-web/src/utils/request.js | 10 +- 27 files changed, 5858 insertions(+), 12 deletions(-) create mode 100644 jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneLoginController.java create mode 100644 jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneSysDictController.java create mode 100644 jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneSysPermissionController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/PhoneOnlCgformCollectionController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/PhoneBussDocumentLibraryEOController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/controller/PhonePhasedImplementationDetailsEOController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseBrowsingHistoryEOController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseCollectEOController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseCommentEOController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBaseEOController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/PhoneProblemKnowledgeBasePraiseEOController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLawsInventoryEOController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectLibraryBaseController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/controller/PhoneDocumentSearchController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/searchcenter/controller/PhoneLawsMonthlyReportSearchController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/controller/PhoneOnlCgformSubscribeController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneProjectProcessTodoCenterController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneProcessHistoryEOController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneTaskController.java 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..40bfd1bfd 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"); //第三方登录 @@ -147,6 +150,7 @@ public class ShiroConfig { filterChainDefinitionMap.put("/project/projectLawsInventoryEO/updateFlowInfoByProjectLibraryIds", "anon"); // 项目库-法规清单 根据项目库id更新符合性流程发起人、责任人接口排除 filterChainDefinitionMap.put("/project/projectTaskInventoryEO/processCall", "anon"); // 项目库-任务清单 工作流处理数据接口排除 filterChainDefinitionMap.put("/wkflow/processHistoryEO/processCall", "anon"); // 流程历史 工作流处理数据接口排除 + filterChainDefinitionMap.put("/phone/wkflow/processHistoryEO/processCall", "anon"); // 流程历史 工作流处理数据接口排除 filterChainDefinitionMap.put("/lawsOpinionGather/lawsOpinionGatherEO/processCall", "anon"); // 法规收集表 工作流处理数据接口排除 filterChainDefinitionMap.put("/lawsOpinionGather/lawsProcessHistoryEO/processCall", "anon"); // 法规收集历史 工作流处理数据接口排除 // 法规技术评估表-流程明细 工作流处理数据接口排除 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/collection/controller/PhoneOnlCgformCollectionController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/PhoneOnlCgformCollectionController.java new file mode 100644 index 000000000..1133f91f2 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/PhoneOnlCgformCollectionController.java @@ -0,0 +1,161 @@ +package com.jero.modules.collection.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.common.system.base.controller.JeroController; +import com.jero.modules.collection.entity.OnlCgformCollection; +import com.jero.modules.collection.service.IOnlCgformCollectionService; +import com.jero.modules.document.controller.BussDocumentLibraryEOController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + + +/** + * @Description: 我的收藏 + * @Author: jero-boot + * @Date: 2022-02-15 + * @Version: V1.0 + */ +@Api(tags="我的收藏") +@RestController +@RequestMapping("/phone/collection/onlCgformCollection") +@Slf4j +public class PhoneOnlCgformCollectionController extends JeroController { + @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/phone/controller/RecentBrowseController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/RecentBrowseController.java index 4df8ecff4..245ff4915 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/RecentBrowseController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/controller/RecentBrowseController.java @@ -26,7 +26,7 @@ import com.jero.common.aspect.annotation.AutoLog; */ @Api(tags="最近浏览表") @RestController -@RequestMapping("/phone/recentBrowse") +@RequestMapping("/phone/phone/recentBrowse") @Slf4j public class RecentBrowseController extends JeroController { @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/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..34299cb40 --- /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.queryById(id,cut); + if(problemKnowledgeBaseEO==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(problemKnowledgeBaseEO); + } + + /** + * 导出excel + * + * @param request + * @param problemKnowledgeBaseEO + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, ProblemKnowledgeBaseEO problemKnowledgeBaseEO) { + return super.exportXls(request, problemKnowledgeBaseEO, ProblemKnowledgeBaseEO.class, "问题知识库表"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, ProblemKnowledgeBaseEO.class); + } + + @AutoLog(value = "问题知识库表-转发") + @ApiOperation(value="问题知识库表-转发", notes="问题知识库表-转发") + @PostMapping(value = "/forward") + public Result forward(@RequestBody JSONObject json) { + return this.problemKnowledgeBaseEOService.forward(json); + } + +} 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/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/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/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/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-web/src/components/tools/UserMenu.vue b/jero-web/src/components/tools/UserMenu.vue index e67f9aea2..fc789d529 100644 --- a/jero-web/src/components/tools/UserMenu.vue +++ b/jero-web/src/components/tools/UserMenu.vue @@ -253,13 +253,13 @@ export default { return that.Logout({}).then(() => { // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面 // TODO 在部署线上时注掉以下代码 - that.$router.push({ path: '/user/login' }) + // that.$router.push({ path: '/user/login' }) // window.location.href = 'https://signin-test.nio.com/logout?client_id=100679&redirect_uri=' + // encodeURIComponent('http://localhost:3000/dashboard/analysis') + '&response_type=code' //本地 // TODO 在部署线上时解开以下代码 - // window.location.href = 'https://signin.nio.com/logout?client_id=100679&redirect_uri=' + - // encodeURIComponent('http://grp.nioint.com/dashboard/analysis') + '&response_type=code' //线上 + window.location.href = 'https://signin.nio.com/logout?client_id=100679&redirect_uri=' + + encodeURIComponent(window.loginUrl) + '&response_type=code' //线上 localStorage.removeItem('language') // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面 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/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({ From 2be6a5273fd4a7bdec7c40993877dbd127a76914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Mon, 3 Jul 2023 09:28:42 +0800 Subject: [PATCH 02/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AFPC=E7=AB=AF=E6=8E=A5=E5=8F=A3=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/components/tools/UserMenu.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jero-web/src/components/tools/UserMenu.vue b/jero-web/src/components/tools/UserMenu.vue index fc789d529..a26d99cf9 100644 --- a/jero-web/src/components/tools/UserMenu.vue +++ b/jero-web/src/components/tools/UserMenu.vue @@ -253,13 +253,13 @@ export default { return that.Logout({}).then(() => { // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面 // TODO 在部署线上时注掉以下代码 - // that.$router.push({ path: '/user/login' }) + that.$router.push({ path: '/user/login' }) // window.location.href = 'https://signin-test.nio.com/logout?client_id=100679&redirect_uri=' + // encodeURIComponent('http://localhost:3000/dashboard/analysis') + '&response_type=code' //本地 // TODO 在部署线上时解开以下代码 - window.location.href = 'https://signin.nio.com/logout?client_id=100679&redirect_uri=' + - encodeURIComponent(window.loginUrl) + '&response_type=code' //线上 + // window.location.href = 'https://signin.nio.com/logout?client_id=100679&redirect_uri=' + + // encodeURIComponent(window.loginUrl) + '&response_type=code' //线上 localStorage.removeItem('language') // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面 From edd5bc1fd58fc62fb9c32a8420830443a30d2e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Tue, 4 Jul 2023 09:08:56 +0800 Subject: [PATCH 03/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E7=9A=84url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/views/phoneView/preHomoMangement.vue | 2 +- jero-web/src/views/phoneView/processManagement.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jero-web/src/views/phoneView/preHomoMangement.vue b/jero-web/src/views/phoneView/preHomoMangement.vue index fe589e752..1d49bda05 100644 --- a/jero-web/src/views/phoneView/preHomoMangement.vue +++ b/jero-web/src/views/phoneView/preHomoMangement.vue @@ -274,7 +274,7 @@ queryForm: {}, queryData: {}, form: {}, - uploadAction: window._CONFIG['domianURL'] + '/sys/common/upload', + uploadAction: window._CONFIG['domianURL'] + '/phone/sys/common/upload', queryProject: {}, dataSourceFile: [], deliverablesResultFile: [], diff --git a/jero-web/src/views/phoneView/processManagement.vue b/jero-web/src/views/phoneView/processManagement.vue index 3eb70bd54..418fb65de 100644 --- a/jero-web/src/views/phoneView/processManagement.vue +++ b/jero-web/src/views/phoneView/processManagement.vue @@ -246,7 +246,7 @@ dataSourceFile: [], textLoading: '', fileList: [], - uploadAction: window._CONFIG['domianURL'] + '/sys/common/upload', + uploadAction: window._CONFIG['domianURL'] + '/phone/sys/common/upload', examineTitle: '', isAdopt: false } From 62d4dccc63fc11a3919abdc9f9a24e5543425c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Tue, 4 Jul 2023 13:40:05 +0800 Subject: [PATCH 04/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AFPC=E7=AB=AF=E6=8E=A5=E5=8F=A3=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jero/config/shiro/ShiroConfig.java | 1 + .../jero/modules/config/entity/SysConfig.java | 6 + .../controller/PhoneSSOLoginController.java | 222 +++++ .../controller/PhoneCommonController.java | 774 ++++++++++++++++++ ...PhoneProblemKnowledgeBaseEOController.java | 2 +- .../IProblemKnowledgeBaseEOService.java | 2 + .../ProblemKnowledgeBaseEOServiceImpl.java | 37 + .../controller/PhoneworkFlowController.java | 244 ++++++ 8 files changed, 1287 insertions(+), 1 deletion(-) create mode 100644 jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/opensso/controller/PhoneSSOLoginController.java create mode 100644 jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/PhoneCommonController.java create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/PhoneworkFlowController.java 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 40bfd1bfd..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 @@ -143,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"); // 对接火山引擎接口-获取项目统计信息 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-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 index 34299cb40..3e210a832 100644 --- 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 @@ -152,7 +152,7 @@ public class PhoneProblemKnowledgeBaseEOController extends JeroController queryById(@RequestParam(name="id",required=true) String id, @RequestParam(name="cut",required=true) String cut) { - ProblemKnowledgeBaseEO problemKnowledgeBaseEO = problemKnowledgeBaseEOService.queryById(id,cut); + ProblemKnowledgeBaseEO problemKnowledgeBaseEO = problemKnowledgeBaseEOService.phoneQueryById(id,cut); if(problemKnowledgeBaseEO==null) { return Result.error("未找到对应数据"); } 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..276f32100 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 @@ -57,6 +57,8 @@ public interface IProblemKnowledgeBaseEOService extends IService 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(); + 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; + } /** * 列表查询 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); + } +} From 397f0cee2db87a7f0c3a901452d3d82cc452be91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Tue, 4 Jul 2023 14:00:03 +0800 Subject: [PATCH 05/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AFPC=E7=AB=AF=E6=8E=A5=E5=8F=A3=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oneParamsManifestTodoCenterController.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneParamsManifestTodoCenterController.java 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); + } +} From ddc46bf64105de733253aad61b4c4fa682ee2134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Tue, 4 Jul 2023 14:16:56 +0800 Subject: [PATCH 06/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AFPC=E7=AB=AF=E6=8E=A5=E5=8F=A3=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ProblemKnowledgeBaseEOServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java index 1c1a151c1..dbf4ed2dc 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java @@ -557,9 +557,11 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl Date: Tue, 4 Jul 2023 17:11:12 +0800 Subject: [PATCH 07/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AFPC=E7=AB=AF=E6=8E=A5=E5=8F=A3=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ParamsManifestEOServiceImpl.java | 8 +++---- .../ProblemKnowledgeBaseEOController.java | 8 +++++++ .../IProblemKnowledgeBaseEOService.java | 7 ++++++ .../ProblemKnowledgeBaseEOServiceImpl.java | 21 ++++++++++++++++++ .../LawsMonthlyReportManageEOController.java | 10 ++++++++- .../ILawsMonthlyReportManageEOService.java | 2 +- .../LawsMonthlyReportManageEOServiceImpl.java | 22 +++++++++++++++++++ 7 files changed, 72 insertions(+), 6 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java index d9b838895..ab57f651d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsManifestEOServiceImpl.java @@ -241,10 +241,10 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl 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 276f32100..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(); + /** * 保存 * diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java index dbf4ed2dc..cb7cba3b0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java @@ -115,6 +115,27 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl 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); + } + + /** * 保存 * diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportManageEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportManageEOController.java index dcaf92ed1..3b3a516db 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportManageEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportManageEOController.java @@ -190,4 +190,12 @@ public class LawsMonthlyReportManageEOController extends JeroController 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); From c0b33d0f6fadf53c58843dfd9e409bdac172b3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Wed, 5 Jul 2023 11:54:00 +0800 Subject: [PATCH 08/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9UAT=E6=8F=90=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E5=8C=96=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/utils/kkfileView.js | 4 ++-- jero-web/src/views/phoneView/home.vue | 8 ++++++++ .../views/phoneView/problemKnowledgeBase.vue | 12 +++++++++-- .../src/views/phoneView/processManagement.vue | 2 +- jero-web/src/views/phoneView/search.vue | 13 ++++++++++-- jero-web/src/views/phoneView/searchList.vue | 16 ++++++++------- jero-web/src/views/phoneView/taskData.vue | 9 +++++++++ jero-web/src/views/phoneView/toDoCenter.vue | 20 +++++++++++++------ 8 files changed, 64 insertions(+), 20 deletions(-) diff --git a/jero-web/src/utils/kkfileView.js b/jero-web/src/utils/kkfileView.js index 18bb49ab7..3b16f384e 100644 --- a/jero-web/src/utils/kkfileView.js +++ b/jero-web/src/utils/kkfileView.js @@ -10,10 +10,10 @@ 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) + window.open(url,'_self') } else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(downLoadImgUrl + '/' + fileId + fileSuffix) - window.open(url) + window.open(url,'_self') } else { Toast('当前格式不支持预览') } diff --git a/jero-web/src/views/phoneView/home.vue b/jero-web/src/views/phoneView/home.vue index b24270714..a7faa4e30 100644 --- a/jero-web/src/views/phoneView/home.vue +++ b/jero-web/src/views/phoneView/home.vue @@ -289,4 +289,12 @@ width: 1rem; margin-right: 0.2rem; } + ::v-deep .van-tabbar { + height: 74px !important; + align-items: baseline; + } + + ::v-deep .van-tabbar-item { + margin-top: 8px !important; + } \ No newline at end of file diff --git a/jero-web/src/views/phoneView/problemKnowledgeBase.vue b/jero-web/src/views/phoneView/problemKnowledgeBase.vue index 23e825b12..1527609a1 100644 --- a/jero-web/src/views/phoneView/problemKnowledgeBase.vue +++ b/jero-web/src/views/phoneView/problemKnowledgeBase.vue @@ -452,8 +452,11 @@ } .header-buttom { - margin-top: 0.36rem; + margin-top: 0.16rem; text-align: right; + display: flex; + flex-wrap: wrap; + justify-content: flex-end; } .header-buttom-text { @@ -467,11 +470,11 @@ opacity: 1; display: inline-block; margin-left: 0.2rem; + margin-bottom: 0.2rem; } .problemName { display: flex; - margin-top: 0.16rem; height: 1rem; line-height: 1rem; } @@ -501,9 +504,14 @@ font-family: PingFang SC-Regular, PingFang SC; font-weight: 400; color: #040B29; + width: 100%; word-break: break-all; } + ::v-deep .content img { + max-width: 100% !important; + } + .contentFile { margin-top: 0.2rem; } diff --git a/jero-web/src/views/phoneView/processManagement.vue b/jero-web/src/views/phoneView/processManagement.vue index 418fb65de..7db671b3e 100644 --- a/jero-web/src/views/phoneView/processManagement.vue +++ b/jero-web/src/views/phoneView/processManagement.vue @@ -8,7 +8,7 @@ - +
{{$t('entryName')}} {{queryForm.projectName+'-'+queryForm.projectVersion}} diff --git a/jero-web/src/views/phoneView/search.vue b/jero-web/src/views/phoneView/search.vue index fd76a09c1..873ceb0a5 100644 --- a/jero-web/src/views/phoneView/search.vue +++ b/jero-web/src/views/phoneView/search.vue @@ -6,8 +6,8 @@
- +
@@ -266,4 +266,13 @@ color: #00B3BE; margin-top: 0.22rem; } + + ::v-deep .van-tabbar { + height: 74px !important; + align-items: baseline; + } + + ::v-deep .van-tabbar-item { + margin-top: 8px !important; + } \ No newline at end of file diff --git a/jero-web/src/views/phoneView/searchList.vue b/jero-web/src/views/phoneView/searchList.vue index 87b2ab4b7..83f00aed9 100644 --- a/jero-web/src/views/phoneView/searchList.vue +++ b/jero-web/src/views/phoneView/searchList.vue @@ -317,9 +317,10 @@ this.getList() }, activeChange() { - this.searchValue = '' - this.value = '' - this.selectModelName = '' + this.searchValue = this.value + // this.searchValue = '' + // this.value = '' + // this.selectModelName = '' if (this.activeTab == 'whole') { this.list = [] } else if (this.activeTab == 'documentLibrary') { @@ -350,8 +351,8 @@ query: { id: item.id.slice(0, 32), goRouter: '/phoneSearchList', - searchValue:this.value, - activeTab:this.activeTab + searchValue: this.value, + activeTab: this.activeTab } }) } else if (item.module_type_flag == 'WTZSK' || item.module_type_flag == 'ZSFX') { @@ -362,8 +363,8 @@ query: { id: id, goRouter: '/phoneSearchList', - searchValue:this.value, - activeTab:this.activeTab + searchValue: this.value, + activeTab: this.activeTab } }) } else if (item.module_type_flag == 'FGYB') { @@ -596,6 +597,7 @@ font-weight: 600; color: #040B29; font-size: 0.42rem; + word-break: break-all; } .content-box-type { diff --git a/jero-web/src/views/phoneView/taskData.vue b/jero-web/src/views/phoneView/taskData.vue index 784274adc..23e938d68 100644 --- a/jero-web/src/views/phoneView/taskData.vue +++ b/jero-web/src/views/phoneView/taskData.vue @@ -461,4 +461,13 @@ ::v-deep .van-tabs__wrap--scrollable .van-tab { padding: 0 0.1rem; } + + ::v-deep .van-tabbar { + height: 74px !important; + align-items: baseline; + } + + ::v-deep .van-tabbar-item { + margin-top: 8px !important; + } \ No newline at end of file diff --git a/jero-web/src/views/phoneView/toDoCenter.vue b/jero-web/src/views/phoneView/toDoCenter.vue index e8fd14881..fa9161981 100644 --- a/jero-web/src/views/phoneView/toDoCenter.vue +++ b/jero-web/src/views/phoneView/toDoCenter.vue @@ -425,12 +425,12 @@ } }, activeChange() { - this.phoneQueryValue = '' - this.form = { - checked: false, - selectModel: '0', - flowType:[], - } + // this.phoneQueryValue = '' + // this.form = { + // checked: false, + // selectModel: '0', + // flowType:[], + // } if (this.form.checked) { this.form.mobileProcessing = '1' } else { @@ -1089,4 +1089,12 @@ background: #00B3BE; color: #fff; } + ::v-deep .van-tabbar { + height: 74px !important; + align-items: baseline; + } + + ::v-deep .van-tabbar-item { + margin-top: 8px !important; + } \ No newline at end of file From efb8bf91017021c1caf7a48d2d21bb4ca146e220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Wed, 5 Jul 2023 14:45:36 +0800 Subject: [PATCH 09/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9UAT=E6=8F=90=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E5=8C=96=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/views/phoneView/home.vue | 7 +- jero-web/src/views/phoneView/toDoCenter.vue | 90 +++++++++++++++++---- 2 files changed, 81 insertions(+), 16 deletions(-) diff --git a/jero-web/src/views/phoneView/home.vue b/jero-web/src/views/phoneView/home.vue index a7faa4e30..59f0f49b4 100644 --- a/jero-web/src/views/phoneView/home.vue +++ b/jero-web/src/views/phoneView/home.vue @@ -2,7 +2,7 @@
- +
@@ -199,6 +199,10 @@ text-align: center; } + .img-header img { + width: 100%; + } + .name-header { font-size: 0.4rem; font-family: PingFang SC-Medium, PingFang SC; @@ -289,6 +293,7 @@ width: 1rem; margin-right: 0.2rem; } + ::v-deep .van-tabbar { height: 74px !important; align-items: baseline; diff --git a/jero-web/src/views/phoneView/toDoCenter.vue b/jero-web/src/views/phoneView/toDoCenter.vue index fa9161981..13f2dcc6f 100644 --- a/jero-web/src/views/phoneView/toDoCenter.vue +++ b/jero-web/src/views/phoneView/toDoCenter.vue @@ -52,6 +52,11 @@ :class="{'content-box-left-one':language == 'en-us' ? true : false}">{{$t('node')}} {{item.taskDefinitionKeyName || '--'}}
+
+ {{$t('cutoffTime')}} + {{item.endTime || '--'}} +
@@ -90,7 +95,11 @@ :class="{'content-box-left-one':language == 'en-us' ? true : false}">{{$t('node')}} {{item.taskDefinitionKeyName || '--'}}
- +
+ {{$t('cutoffTime')}} + {{item.endTime || '--'}} +
@@ -131,6 +140,11 @@ :class="{'content-box-left-one':language == 'en-us' ? true : false}">{{$t('node')}} {{item.taskDefinitionKeyName || '--'}}
+
+ {{$t('cutoffTime')}} + {{item.endTime || '--'}} +
@@ -171,9 +185,6 @@ @click="processClick('21')"> {{$t('preHomoFlow')}}
- - -
@@ -183,9 +194,18 @@ :label="$t('cutoffTime')" :placeholder="$t('clickAndSelect')"> @@ -228,10 +248,6 @@ show: false, date: '', columns: [ - { - text: this.$t('pleaseSelect'), - value: '0' - }, { text: this.$t('nearlyMonth'), value: '1' @@ -293,6 +309,7 @@ this.form.selectModel = this.$route.query.selectModel } this.form = { ...this.form } + // this.isNew('2023-06-01') // this.toDoProcessPageNo = 1 // this.getToDoProcess() }, @@ -459,7 +476,7 @@ toDoCenterClick(row, isTrue) { let query = {} let flowType = '' - if (this.form.flowType && this.form.flowType instanceof Array){ + if (this.form.flowType && this.form.flowType instanceof Array) { flowType = this.form.flowType.join(',') } row.taskId = row.taskId + '' @@ -669,7 +686,9 @@ } }) }, - + selectModelClick(value) { + this.form.selectModel = value + }, processClick(type) { if (!this.form.flowType) { this.form.flowType = [] @@ -701,6 +720,27 @@ } } return false + }, + selectModelColor(value) { + if (this.form.selectModel == value) { + return true + } + return false + }, + isNew(pubTime) { + if (pubTime != null && pubTime !== '' && pubTime !== undefined) { + pubTime = pubTime.replace(new RegExp(/-/gm), '/') + let currentTime = new Date().getTime() + let endTime = new Date(pubTime).getTime() + let numTime = endTime - currentTime + if (numTime < 30 * 24 * 3600 * 1000 && numTime > 0) { + return 'yellow' + } else if (numTime > 30 * 24 * 3600 * 1000) { + return 'green' + } else { + return 'red' + } + } } } } @@ -854,17 +894,24 @@ } .content-box-left { - width: 1rem; + width: 1.46rem; display: inline-block; word-break: break-all; } .content-box-left-one { - width: 1.6rem; + width: 1.66rem; } .content-box-text { margin-left: 0.3rem; + word-break: break-all; + } + + .content-box-text-color { + margin-left: 0.3rem; + color: #00B3BE; + word-break: break-all; } .content-box-right { @@ -1089,6 +1136,7 @@ background: #00B3BE; color: #fff; } + ::v-deep .van-tabbar { height: 74px !important; align-items: baseline; @@ -1097,4 +1145,16 @@ ::v-deep .van-tabbar-item { margin-top: 8px !important; } + + .yellow { + color: #fdd835; + } + + .red { + color: red; + } + + .green { + color: #00B3BE + } \ No newline at end of file From d742edc9ad3a6aee08fbe3ab5b257dc60449855d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Wed, 5 Jul 2023 16:28:09 +0800 Subject: [PATCH 10/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AFPC=E7=AB=AF=E6=8E=A5=E5=8F=A3=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProblemKnowledgeBaseEOServiceImpl.java | 2 +- ...ectCertificationInventoryEOController.java | 356 ++++++++++++++++++ 2 files changed, 357 insertions(+), 1 deletion(-) create mode 100644 jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/PhoneProjectCertificationInventoryEOController.java diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java index cb7cba3b0..2c7a9ff12 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java @@ -458,7 +458,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)); + } +} From 01d88ea2ec1885edd7a5f6d880bc4d630e791023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Wed, 5 Jul 2023 16:31:35 +0800 Subject: [PATCH 11/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9UAT=E6=8F=90=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E5=8C=96=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/assets/Avatar.png | Bin 0 -> 2637 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 jero-web/src/assets/Avatar.png diff --git a/jero-web/src/assets/Avatar.png b/jero-web/src/assets/Avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..8dd82f35653dc53f9fd32be424e972df14231eea GIT binary patch literal 2637 zcmV-T3bOTyP)vs0WBn*|Gnp&`{*M9OIcc4N>{7# zDL7&(?qI@)$O_1;gh)fmG@X)edq@#N6zLq7&M7){TlKLDUoOYv)#Y3+SA>NKSOOc| z_Y?Qv;9vBz@?_*JB18x*OJEs3o_k(p;q%XPE-b*P06{DF6EiUfUr32OG(v(bNFR?) zi(y27moLB1$Kqm6x6wNy#1mPoJ)WNa>-b>e}lt;(^B*ap;Q2NHBQWVWN(W<3H3rK5rEuH*7xJzl5f3-vw%Rs+pEm0 z2-cAcu(Y)Dr7!USr^elcMNMyrOaKnDKw^%J|257qj^M^snU88<7l{CY%aO@vr`Oka zi*UWNcQ*=`WGzYl}V#^T)h zSH46a^ejLd4oyp~}=Z6+R zSE`vF9>TS2S%TNKw1JCn< zqgdPuL{S$bgzE?|7iO>)vVSM$R2zR{;;J&^Gxd1#Nf1l;x&Hc>o8;m~pa!-T+w5dc z>;aTw&Cpqopb(WU|0LGmZQ#wDw@^WtpnR+VI{bcSBptL!lPDD7#CUM53-T4a9uBnJ z`b{%-IfKE$i%>v1nM{6r+zA~82wacE3>3n~k22fohw*VmE>OsOyfD@2&z*aK5TSxd zudw0S{n)|~^#Db^0QFVD4u3o9mqF`Sob?PTdb9nI85xEeWVX|M(a}9XaqDL?nLoic z(&ew8)=HE z)BtS6#6pqXGh^p~KLlvP#0Z@Q&|XQ()+}guS9^L~bhykHG*c{ogpF)%??Nx4=twE` z3$VEb+u&Zgxv95dNJ!TaLb}il5Bb;Ee}hf@{ALXX*mNXU7Bs-x+jVOu<@i$8O%uIR z!sV$57Y5*ru_C77^JvqE+BIiPH-)&Fyn?AY#K;Q+5MQD7N^CSpqlUgu87)m7=&A*?osHk6nIS{ z1p?0#2q1*B0E4jcbqC{ZlfIwv5j1+I{;i_DVr)Bnt*)+Ku(44zJ{`g(lle9ffPE49 zqy-p+jsNSK`gD+YWbhcoB$R$0)T=(24XsH$g<;-NFHoHkt*^f~-ui{aLHU9M0pd=j z01H@MeS@l^T@zd-#nhmynTGpe4g|2l4Kdt0KYaK|nVCeC@c(`PegmeVclETnc0|j9 zOsyv8VFBez89TeBNJQ{`N%Q?Ct@l`GUXXXENlZ65PeB(Oe ziRdq7{qSLv#u`S}AKY92oV;<=A3APJ@oVxv3^06Y5D7AVyZ4CV;F6e$gn?_6kMSrS z1qd=CDYecKv2p6#7KM_7UEB3*pVISatkNY=IPOCqj@_8$IMrEb3dmf*Bb&X()umL~ zKR6P}IIdqG*Cm3>AANG%2_ec>em4W*C@WjZrE5k<(?<4X@zuNJ?5AdaYY(<|KihK4Q%t=@*pDJ;a+)=s2r1eA$AoW3=AVp;nxN*4!3yR+yK zHuS{{^~$wI0%1sak)Fliqt_8Qc(;S7geqMeIytTvaqaHYG91SV>aY!2($c$ujn5)% zQ0iLV>*~@a*DF`TVF|OPvR19+?%c^mU%tM< zaY4CZ_{(aCN}Ocims$(QU8BXL=TZVRv-(>i8q21y3y|Sm0lK zd;jLm8wK=8Uji`O+uKv|MB?A*BSk%(h+?(k-5nep>}zXh-vTf+|DL6JmS;FWBDlU^ zyPHa-T=YpKsS3Z4WHOPHmaV3#fZrp(*C>q7MA8GAq24ePi^aG&X%=S-9@Wk!lgR=i zBys_meV6nN%^ztig{cxD@T6L;&PLVhTmCl`Qu4f+7@RqXQ~F7(Qn)o*m`bG*3s8ho z0UCHD1dWX6XfZvDQ-LT->Ccn9QT}^+ zK>n1AmU4X1QY<_K3)Cp)X&Pk#nlU0k0}j^ort_$ak%wLuXv+C1J-@creiTLpXr@$> zBt|Vyck^VBf5?bynTqql Date: Wed, 5 Jul 2023 17:13:32 +0800 Subject: [PATCH 12/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9UAT=E6=8F=90=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E5=8C=96=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/assets/niogrp.png | Bin 0 -> 7987 bytes jero-web/src/views/phoneView/search.vue | 8 +++++-- jero-web/src/views/phoneView/toDoCenter.vue | 22 ++++++++++---------- 3 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 jero-web/src/assets/niogrp.png diff --git a/jero-web/src/assets/niogrp.png b/jero-web/src/assets/niogrp.png new file mode 100644 index 0000000000000000000000000000000000000000..12970a1dbac4f27e3498844d55cc51ed4e4e492a GIT binary patch literal 7987 zcmY*e1yqz>v?Ycb1O^z8ZUIT*CnaZKkY?!a5Rep*Mi_<|LTOQul#g zDZglWf}3n?Rt@Kow&qo16-H87ga5 zjG+|r|M~&VPcq3eE~t7sx^Zm8fN#1D-}X_l-B;q}_W?{QqGwuS?~-gS6*3W^c;Mc%bklv5Rvwi~wGInn8g|68b6OHR3wPAKn# z^++KWh)32|cPMo4Bow=v)&8ee=WwVHJYCp%wsNyem`4~|2kS686^ik5=s%PxXXgC5!Zn(# zC$&1Y2gldf?>d+O!vKKw8OQVYR*eG0_*NIipm|FuB`7wSOdKCd8!| zFS*PUzJ`Ju2fnh@m&d;@NzS<>{)d({dTCU<#C7Sc`{{5Xo*J%WYwD@F(`x}tWx8g$ zP2S7kn~vI5LZs2E1aMrpvA{na!-$nIbsw^>`RpSh%8#{RrrI^A`-JOX+#)Gr?GX_G z7N*byLYv%s`|1v^LadeX-V=ztmmz94-1n%z8L6pzR2Sd`;XqBi7l*H0$-(#BtCVNa znY7L+cF85tl^_zRE%Q203h3@OB=30~Ri$6>HVR`q;Sq6BWKv+bR47{h37KBw zk}sDl2$`u{pb)$5?_LABf+|%+W znm%Ry^c%HHFQbaMF0Akj0%Vvi$;Mmf^vf9CU#8*tvMBL##X6Y`&+lAmX)w?`S-ZO( zO*{=|wn4Mhh32~tI$2oal2$VYY{*!4t1b8}r~nNDz4nRNmLnd}#CnCev#;%#e$-zO z3(`}cZOC}L+kYR0ZWMh9888&Ia|x+AApre?a%S|`_6hm>y)<1tB-N@D^{i^$ z;pgR?249rCc`E|zghV=jn|bkyNZ*n2w)iS5qSVy& znn{cw=}wgtYxhQeO$?Z|&CKcJs^L>%8CO;(9tEPrk0Bb32sMH0nKdU!W-N^F&`Pmv zMlk?v2PFK38wV1cuA+R*Le)^Hv;N?xHa5R~e<@8M;*4KGMu^Rh2pm4`zNizuerxvJ z0~{r{c;_8R5Y(VRe^Y)nUqtycoTKvKQ@V$=;{*Jq#sm(A;-`x)+`so9BAhk(v@$dnQq|}j$Ceb25m2%D4&VyQ3r2rc>ap%(+r6{j1OP4hAL0A z_zcaNp-e0tDRWmkpQUxtuQkP<>@!#2kN|sscG}W zdK1sD)TDINO<9}RMm^y+H76tuSyOIegBfPTBZZna+qt?oGf@fR4t7%~PLp_Tu>EO> zv(sAJ+C;ZYK%I6Vj2ism#9=@DFUzeh1y~R`H6Oan^|nN1O@eyUOKt;$VJ^+Ho8@$Z z4a$33N6*J%6Z?>cB$LaIx}zV*9-8<;v!tBT)}(onP--th09kWc=DURq$o*NEyv(76cRDAJ^0yHrrP}mROnrF1ltE1? z;^CDHq>GM5rutiLea*A^+V`ACb~)-RBtwyi`aj*(OG45yL{QIk`9psY_~$?dm|`<+ zRQfJ_W(lRC-zq)qkuWLn2>C3RxnZEaECw%Lh}cv7mc8~cSp3DZI*Mok{i~YBS4aG) z+emNZ$q6k{(&y$ljV?!_FAbK`T#l^PkXLxs>)n2k+!yJJwj4^(o&@K{d=1eSCLUPP zZ;Eo6O0NSfCA@YKFJX(9;|Ud(JilmXK9XhVzW7;h4=tfie^3IEc`qz{Bvf~+f-iiE zD~LNUXdx@EGYl~*ZssC357m#HitB6XD+oxYlBlN_8aqRiZM)N-SwURWbXq)s}Kc@p*xKVlq6 zY41wG;J76PJ0;6_=-xZy&z3O1`Q5;GW4?XJK|x>;iuY*Dy8d${ya^YEjL;Qv^BDfc z*r0ytNALjev$(kQXmwQ=pTu6n%TYUs_JI6IXbag`oiLwc2_!a(6u_sckp{Z!P&pKO zCH{=`RdiG#kch-p%$e;AE0@6O*+hnm-JiesF~HJ|WAi|xc)}tzA#L|*4U#qnA|eIe z*-0y56ZoY8vFb3)&70Qt8Aa$K_6k+=S~e-)e~=(eK=+G_0jblB%lJJrv+14Oi)!7Z z<_lr(*6L~aOo`ID1R$<$hFHit@W|AP?bA>^6$Q2}#MF{^wp`h7XA9Dw@Wm=*oM)cm4pEBi1|P?%(Vu}{xs;KwSDd+vLHrTpyDg&fvN6NxP;8iIg;pTP3`}5j+ zI^6i}6*x*ZdFT4yL@bNN4rtSG8VJo8N9&iFfboJ}nWSd$XMp~f6DsdDSpq@qEp?Bc zJJd{BPsKEBBz3kxEpMls>V(F%9zJl{t`(Y7%*kSKh(TWaFSDDd&sxz_i6n`CTjr=F zxQKh{%aS4v^QI7R)?eW9VfZXOD^_nK>*y^#-brQZFx_O?Q%qqS=S4d8r@n$RsG|4c z^WHDQmqW@dk($+bawF8gS&h;M^{-whD5EA1w5!@WI|v>_r#}!UmYK?C`y|JasDKNg({l)B z2R?BgbX0>i84$Q`Zz2Kpt~AbP=CP%oZZmy^Q^*r(KQb| z{u*3%@)gvc`2k~X_S^bc%hI0nJD`r~;JZs&nYR;MrgLOK`y*RX^fh(l3$@>;J6Vge9Xh4fc_voX)_Q8br2UJ2GPxN+3eGr|2xbiF!bu)!2WCC&=JD)SWYH-sUZbQ}K$M#^x+2cpRmxw zr(yInJCAL5zE2`VKes#(G2tPdQRQX)lIqh;%6mo)IQ{G&R%6fV8M1c1*(}2l!tA+g zG@PQL1l!Aa7?~?PIHjE)M_NF-LFRULQGgFaHfU|8WxG1Fo8oU&Yf89@&f&fz?RX%r zr3<@geTd^0@UX)&-LI2YoxoPhbdf&*K~5hh{J4WfQ@P~B*SdUedyCKZ-`LgEZs#7G zh4gLb?W z;a*qTaC>;f25nN8VdDNl(K^)mbAq95qItsl33X zH~t#Gn}#Pfqh-GucaKVO@pWm%x2#w{P+`M(iEHPF>MoFTrPN>;l51Gsk+r+yh|ToT zfJf;E^M%SNwXMQ(14K!AZGI{+oTWsI)QbvAR$lGK^(1Nt1>;=QafN+TK-uIrVhM+#q z_S_W~@CHBw_p}11bK}Z@izaA(e7wKe2)kvf&_+Btd+g?Hg2yezuk)L4nQ3cgC6(7Z zHP`junk%2gv;eG5L&#vo{hxv?ctN4>HhkQDK(D^HY}J;%{=2i#rv@Of{KLevJ*Z+D zKMUM)abuK60BAFRFMs$w<>A!%F&mX@E_u<0*Oy#(9@WNixJfoEZp&`S;)3VSJqbzX z9Qr%AI_n*Hx)m09z9lS%#4jMGNT=mp+$m}Ck#d7{hbTNhbrAe@MFf2_i5Cr`Pr&gm z#S<)=iode@LSOl7P4q!&(2m+X9*jEa^6A+aG{Vhx(_+(@VcS=tbiIw{eUqesMP@nq zFggnY;UhOh>~+m8y0t7GD+lF$h9G)Mmlg{i|6-f=ERgHWfa62LfH%$>GIEtpHcF2M z&%#ISI~?K>wtbtr4$oi=XMRMjYLc%Iq^*}A=LJ`mi#92vpyW|96L}A6gFsqx@`U&4 zEPrRrb%M0Ec=K_3>@%Wf=-t}2e+mT9_KI@<)M`A+B^zhaY%11wEfbfP5z2E@*11e$ zTR9GJhR%r4e)tMW+*d3=4XGv|5`Mhgq{H8gpro=%Lp(z{l;rrxX$l=(R?E?3e&W)^ z6|YCgz%N~gzRuy$n{HkQt?Q35an!xxS{O$~nrL+bTi3_~sEs~a|0r)f48;6J0H8R- zs4;zNNFv{|T7}k6G=Z& z5~L?+zTVSAa*pWs=HPc?tG6bZf=d&(1z%LWsD|YAs`tM!S-97jijG;Sn-7MWqKlNx zj15Z+yZD+D2qzFw6HBhx*Vm2tfEW|14*UplvrcgUe~fPzmXd4oj4W$sBmg34qW8j4 zB4p#%3H9oBvW=bM_pFJQsBwr-50`bSm{Ha! znxccJnaxelH#{3MpAH9jvR>ct>rZ&5`byaTH20MYlAqkT?L8Z0`NYMks63(wfB`*% z-!}b8z@%?RtFS)HmH2!Qf?A~#>T*;q<>9&{>vGB?n;tu*{!-{Z(O^$%dp6l84op`w z6k!b5gLi7FskL#yY`ljr<;|YOyH?|taGsgQqrnr}3W~W7>C%TS$&R){*1=|Ehp=*A zo;mL^>4c_q5Ni#HjXNn)JteEkE#oWcvfsLsreUKiZw4$)F|JAtr%HofNB%L@n=g*T zCRP&jAHci#OY3|L+(M`rB612fRs@?ye%$i6-deW@Twq6i0fLdF*&V$ir!OvfJy4c{ot zmeZ1VWAD^)n>Qb&MFHJhdR(+Pd8M7IhiU2e!xF{&o(-6uPt3majAn^6+pljn;QM_1 zlZ41wZ6E-Vv5s1hK zZY8cNzgjDSuTGR;FoOr}_I&==LoRY)fas$JgQgE2fr0vwXpkYO3_}$;FB><7QjuRo z%mm@LKI43L5V+-oRi?-824>sN9^#_U=<}$j&dn_CeT0X2>15~1;0;T9d`tP882Dkz z^6Wis#ecYwoQHV^Fa*DZr$g52=dxjN3qBGdUY>*%Y!YeE%W1 z`KvSe>N54(js4h8G)z4@K^aUACfd-iJW)z_ z`8itU%adA_7v>^zc=h}zQ|?)01)W??G}hs2I#yPZ@R#%VZPVA+%0H1cejN+ME53|A zxT?b@<_a+7Ps7Cvjy^BM8wgK@yG6N6O)+!mF4>KIHRg5wZYN?BF=8YyLVgh303rT1 zaQ=f`Az&(Ao6_^}59);v)*nI!h2*nan|&mZs6gANACp|I%>`Er9+gsD=o`-ovqIS@ zKR6Z4rc%r+^7WZNb{55L5tH?c7z?q!h}_R)mLC|Y1~g=jW~?7RNpu#iH87G*n+|A8 zy7!jR>C*sCtU{kAF5~Sa z)IIe>QQ0n*Fvf0eRmu|3uf7=n;v$B|6za7XrhTYzZCa>U(eqq*dsHFfn*upUhAp{~ za-V^@0Q+}k*ejOp$r}v6uenhS?P}z5enov9Xzo3Nr{M5l|tCp#?uiBaz6P!%=J+;0y%i z;5(El9v@w;1pd;eziFu~KaSf}!OIjGoLA3XTRe11q(}YE?nJXSP^AF2Mf-+-Ez+qO z4W|*{z*$sHZPm752=Fd(rMI-7j6chtc-nU+H=IIFB~YUA0)~m@vwlTZB!IwRa$WpL zGQW11jTDmIKiPRU@VdSHEVL3#89`1#3@||DfVOn{B*L0juNh~m~D=HYq`UsY25C*UK2;|CB#*VO4DRzJbX*RHEfU=UixP(fLL|NOvrjF zq}7s|l^jk3VeK35FMN!_H*wgLydaq_#W;TIPEyB{+AhGyJ=W5iJabjMqN19I0025k zTmQ>kJIm&T0Tg;}{Jbk-`8jAXKfQf`W*HMWbSs8vrFU^Fxr&Vg=a&Gt>e`ASt?Q0- z*2D^)HK(+%MDd(5G3lsNd@`W`OIyzg#gv?ErHEwAEY9dmce#%MNXV+<*_t( z&{K9}Lg6o6YkNpp-S^$3+&1g=Loe@1cn%^bmc30eS4zdrsTW?$MlqT;-3K!$?q z=k#tu$!Y;kXL!d{5v)_ZnDkl~uVrW*&ZxJq@Wma+#D{KUWkM@svoc3ezfmCMZ~4nD zKDJd4z4kgJw;z#hERr15sQk5 zJFi`W%`B{9*JrQi5}4|)R%V}^NI7(fnJP`_Xqi9vuv7gpQI1(ApN$>=>9@#D>5n=V zONlP4lk~IIxnm!~_5`9rrJJRdjyjtRh%A~?AYop7-1Q~2-*q2(g6r0dfFBf=2d?<< zezL565Xc`7o8}d+^Lp^iNi))=Am>E6GJ^hg`7B+%Yf7Z0V?N$f;+6ekx@w~!@6SC# zyup`^Gpeq6H?G~?Z)NkB%NLlJJB20PC5TwbBl*Atg{ItoHRr!5jKsu>1WvW^BTdap zc^xMC&N>X5++MU>P)zvLf_(YZ68kAlt2x`cjaQj@0kW*VcDAiZjf0LT4dOLZlU;i6 z3c9A8RAW;{Pt{^v8QtrJfn?0kqyMoFSEjtVgfD;Y1M10S=A%R=an z_y$~ZK7HA%>r>#^o8jp}q&Yt{P4au?>%eS@--MXC9o?W&Ld)21(N~L;qG>O9%6p(T z2v6C$tv6v8-7H@zD6k8GKyzv{YOH(Ri2Wxld&m9mx@yP2vq(3bygS{Am}ubdvF$?3 zx#WO#Ry?r)a3eeWmiC{@#Ew~wo?PB^&0S8ZwVV+QrSl;bLsbw6;@+m`=1!^n7#+rL zc-;nZ9QF57%H{UgbHFX5onji4tqTCjtqQNY!(C*4#G?97WGUzao(2c`i9n1btGC%e~s5F1=U zH>aH}>zZ`f?>RBk;X58)qo(Y^-NXM=ifDdK@!p(nr`aD&w)1cxKSSAAL?L0vL%}nD zwC-goK)8{)`V$WBpYeis(ALExR%}Qj0V{bzeNN7clkZXo4p}Pf_k$&ub8%XwtR*6I zhLRHql~v(!5q(Vmtb~>GbEY@p!I&Zxj_xjw;Bab6aOr`6^?vq8 zZ~1!|F9A?Gy+%58gdiwa=wwJ)`FCJ}qk%m}FH?p~XWdG+ibfVKvHt_S=A5a8Ce55j z)4gs-1hAjzEEaYn*j|!2i|e|lbKY}w6
- - NIO GRP + +
@@ -161,6 +161,10 @@ justify-content: center; } + .header-box-img { + width: 4.6rem; + } + .logoTitle { font-size: 0.64rem; margin-left: 0.24rem; diff --git a/jero-web/src/views/phoneView/toDoCenter.vue b/jero-web/src/views/phoneView/toDoCenter.vue index 13f2dcc6f..80d70767c 100644 --- a/jero-web/src/views/phoneView/toDoCenter.vue +++ b/jero-web/src/views/phoneView/toDoCenter.vue @@ -95,11 +95,11 @@ :class="{'content-box-left-one':language == 'en-us' ? true : false}">{{$t('node')}} {{item.taskDefinitionKeyName || '--'}}
-
- {{$t('cutoffTime')}} - {{item.endTime || '--'}} -
+ + + + +
@@ -140,11 +140,11 @@ :class="{'content-box-left-one':language == 'en-us' ? true : false}">{{$t('node')}} {{item.taskDefinitionKeyName || '--'}}
-
- {{$t('cutoffTime')}} - {{item.endTime || '--'}} -
+ + + + +
@@ -855,7 +855,7 @@ padding: 0.4rem 0.4rem; box-sizing: border-box; background: #F7F7F8; - margin-bottom: 0.8rem; + margin-bottom: 1.4rem; } .content-box-content { From c4156982e62c0fdf24236e198d591717b2eab865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Thu, 6 Jul 2023 09:54:17 +0800 Subject: [PATCH 13/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E4=B8=AD=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/ImplementationTypeEnum.java | 4 +- .../enums/CertificationFlowNodeEnum.java | 2 +- .../DesignComplianceFlowNodeKeyEnum.java | 12 ++--- .../VerifyComplianceFlowNodeKeyEnum.java | 12 ++--- jero-web/src/common/lang/en-us.js | 48 +++++++++---------- 5 files changed, 39 insertions(+), 39 deletions(-) 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/project/enums/CertificationFlowNodeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java index 09adf3b2d..54147a691 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 @@ -26,7 +26,7 @@ public enum CertificationFlowNodeEnum { * 任务审查 -> 责任人提交交付物之后,认证工程师审查。 */ CHECKLIST_VERIFICATION ("Task initiation","任务发起","Task initiation"), - TASK_RESPONSIBILITY_CONFIRMATION ("Task responsibility confirmation","任务责任确认","Task responsibility confirmation"), + TASK_RESPONSIBILITY_CONFIRMATION ("Task responsibility confirmation","任务责任确认","Responsibility confirm"), 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/todoCenter/enums/DesignComplianceFlowNodeKeyEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/DesignComplianceFlowNodeKeyEnum.java index 614e745d8..048ec2964 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"),// 第二责任人提交交付物 + FQLC("发起流程","Process 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_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..c9d05c3be 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"),// 第二责任人提交交付物 + FQLC("发起流程","Process 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_FGGCSBCSH("补充审查","Supplementary review","fggcsbcsh"), // 法规工程师补充审核 ; String cnName; diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index 5a15385a1..e7a31169c 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1858,45 +1858,45 @@ 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', From 3c4fabcdc4e028abdc091fb1b2d91124bbf9f9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Thu, 6 Jul 2023 10:12:39 +0800 Subject: [PATCH 14/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9UAT=E6=8F=90=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E5=8C=96=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/public/index.html | 2 +- jero-web/src/common/lang/en-us.js | 4 ++++ jero-web/src/common/lang/zh-cn.js | 1 + .../src/views/phoneView/documentDetails.vue | 4 ++-- jero-web/src/views/phoneView/handlingPage.vue | 4 ++-- jero-web/src/views/phoneView/home.vue | 2 +- jero-web/src/views/phoneView/myCollection.vue | 4 ++-- jero-web/src/views/phoneView/mySubscribe.vue | 4 ++-- .../src/views/phoneView/preHomoMangement.vue | 4 ++-- .../views/phoneView/problemKnowledgeBase.vue | 7 +++++-- .../src/views/phoneView/processManagement.vue | 20 +++++++++++++++---- .../src/views/phoneView/recentBrowsing.vue | 4 ++-- jero-web/src/views/phoneView/search.vue | 17 ++++++++++------ jero-web/src/views/phoneView/searchList.vue | 7 +++++-- 14 files changed, 56 insertions(+), 28 deletions(-) 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/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index e7a31169c..b7e62174a 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1901,4 +1901,8 @@ module.exports = { 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', } \ 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..58158a8fb 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -3864,4 +3864,5 @@ module.exports = { exportOption:'导出选项', includeTitle:'包含标题', Notitleincluded:'不包含标题', + backToHomePage:'返回主页', } \ No newline at end of file diff --git a/jero-web/src/views/phoneView/documentDetails.vue b/jero-web/src/views/phoneView/documentDetails.vue index ba0c63afb..c257b9899 100644 --- a/jero-web/src/views/phoneView/documentDetails.vue +++ b/jero-web/src/views/phoneView/documentDetails.vue @@ -1,7 +1,7 @@ diff --git a/jero-web/src/components/CollectionTypeDisabled/index.vue b/jero-web/src/components/CollectionTypeDisabled/index.vue index d37359513..5eb406f75 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) { @@ -857,14 +863,27 @@ }, 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 +892,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 +917,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/views/phoneView/problemKnowledgeBaseFile.vue b/jero-web/src/views/phoneView/problemKnowledgeBaseFile.vue index ccce60ac2..2451027d4 100644 --- a/jero-web/src/views/phoneView/problemKnowledgeBaseFile.vue +++ b/jero-web/src/views/phoneView/problemKnowledgeBaseFile.vue @@ -8,59 +8,60 @@ \ No newline at end of file From 0f2aef50a1d9fb4b277b759817da6647903d6e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Thu, 13 Jul 2023 17:44:51 +0800 Subject: [PATCH 30/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=94=B6=E9=9B=86=E6=B8=85=E5=8D=95=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/CollectionType/index.vue | 41 +++++++++++-------- .../CollectionTypeDisabled/index.vue | 31 ++++++++------ 2 files changed, 44 insertions(+), 28 deletions(-) diff --git a/jero-web/src/components/CollectionType/index.vue b/jero-web/src/components/CollectionType/index.vue index 5927e63fd..4b6bc0fc6 100644 --- a/jero-web/src/components/CollectionType/index.vue +++ b/jero-web/src/components/CollectionType/index.vue @@ -3,7 +3,7 @@
-
+
@@ -113,7 +113,7 @@
-
+
@@ -152,7 +152,7 @@
-
+
@@ -183,7 +183,7 @@
-
-
@@ -243,7 +243,7 @@
-
+
@@ -365,7 +365,7 @@
-
+
-
+
@@ -606,7 +606,7 @@
-
+
@@ -646,7 +646,7 @@
-
+
-
+
@@ -906,15 +906,24 @@ export default { // Object.keys(this.detailDate.paramsConfigData).sort().forEach(function(key) { // ordered[key] = that.detailDate.paramsConfigData[key] // }) - 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) - }) + // 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.detailDate.paramsConfigData = { ...this.detailDate.paramsConfigData } }, methods: { + 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 + }, selectChange(val) { this.$nextTick(() => { let element = document.querySelectorAll( diff --git a/jero-web/src/components/CollectionTypeDisabled/index.vue b/jero-web/src/components/CollectionTypeDisabled/index.vue index 5eb406f75..8c2a0d9e3 100644 --- a/jero-web/src/components/CollectionTypeDisabled/index.vue +++ b/jero-web/src/components/CollectionTypeDisabled/index.vue @@ -3,7 +3,7 @@
-
+
@@ -101,7 +101,7 @@
-
+
@@ -136,7 +136,7 @@
-
+
@@ -164,7 +164,7 @@
-
-
@@ -218,7 +218,7 @@
-
+
@@ -328,7 +328,7 @@
-
+
-
+
@@ -545,7 +545,7 @@
-
+
@@ -582,7 +582,7 @@
-
+
-
+
@@ -861,7 +861,14 @@ 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).sort((a, b) => { let index = a.lastIndexOf('+') From 80ebff1c76f3886ed2c73f3e8f439f56f6ee7274 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Thu, 13 Jul 2023 18:18:09 +0800 Subject: [PATCH 31/31] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E7=AB=AF=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jero/modules/feishu/service/impl/FeishuServiceImpl.java | 2 +- .../impl/ProjectCertificationInventoryEOServiceImpl.java | 2 +- .../service/impl/ProjectLawsInventoryEOServiceImpl.java | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) 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 96d366fde..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 @@ -1622,7 +1622,7 @@ public class FeishuServiceImpl implements IFeishuService { 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/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 2063aa759..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 @@ -2590,7 +2590,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl 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(); @@ -1133,7 +1135,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl adds, String belong) {