diff --git a/jero-boot/db/蔚来标准sql/dev_third_record.sql b/jero-boot/db/蔚来标准sql/dev_third_record.sql index f8c534ad3..aa02d7fe1 100644 --- a/jero-boot/db/蔚来标准sql/dev_third_record.sql +++ b/jero-boot/db/蔚来标准sql/dev_third_record.sql @@ -1179,4 +1179,27 @@ update onl_cgform_field set is_query = '1', is_read_only = '1' where id = '09fa6 -- 配置表,增加问题知识库预览图片配置 2022-09-27 已同步生产环境 INSERT INTO `laws_weilai`.`sys_config` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `config`, `config_name`) VALUES ('4', 'admin', '2022-09-28 14:35:30', NULL, NULL, 'A01', 'http://grp.nioint.com/', 'domianWebImgURL'); +--问题知识库,增加字段 发布状态 2022-10-13 已同步生产环境 +ALTER TABLE `laws_weilai`.`problem_knowledge_base` + ADD COLUMN `release_status` varchar(50) NULL COMMENT '发布状态' AFTER `release_time`; +--处理问题知识库数据,发布人,发布时间,发布状态数据sql 2022-10-13 已同步生产环境 +update problem_knowledge_base pkd set pkd.release_status = 'Have released',pkd.release_time = pkd.create_time,pkd.release_user_id = (select su.id from sys_user su where su.username = pkd.create_by) + +-- 参数项收集清单 添加同步上报库时间字段 2022-10-20 已同步生产环境 +ALTER TABLE `laws_weilai`.`params_collect_manifest` + ADD COLUMN `report_time` datetime NULL COMMENT '同步上报库时间' AFTER `title_default_value`; +ALTER TABLE `laws_weilai`.`params_collect_manifest_history` + ADD COLUMN `report_time` datetime NULL COMMENT '同步上报库时间' AFTER `title_default_value`; + +INSERT INTO `laws_weilai`.`onl_cgform_field`(`id`, `cgform_head_id`, `db_field_name`, `db_field_en_name`, `db_field_txt`, `order_num`, `db_field_name_old`, `db_is_key`, `db_is_null`, `db_type`, `db_length`, `db_point_length`, `db_default_val`, `dict_field`, `dict_table`, `dict_text`, `field_show_type`, `field_href`, `field_length`, `field_valid_type`, `field_must_input`, `field_extend_json`, `field_default_value`, `is_query`, `is_show_form`, `is_show_list`, `is_read_only`, `query_mode`, `main_table`, `main_field`, `update_by`, `update_time`, `create_time`, `create_by`, `converter`, `query_def_val`, `query_dict_text`, `query_dict_field`, `query_dict_table`, `query_show_type`, `query_config_flag`, `query_valid_type`, `query_must_input`, `sort_flag`, `show_area`, `is_show_laws_list`, `is_show_search`, `is_delete`, `is_model`, `dict_id`) VALUES ('5afe057bed3412bcedf5bf17565d3ff4', '9ca1773d2a484d2fadae38491ad51aa1', 'report_time', 'Sync Time', '同步上报库时间', 28, NULL, 0, 1, 'Date', 0, 0, '', '', '', '', 'date', '', 120, NULL, '0', '', '', 0, 0, 1, 0, 'single', '', '', NULL, NULL, '2022-10-20 11:08:04', 'admin', '', '', '', '', '', 'text', '0', NULL, NULL, '0', NULL, NULL, NULL, 0, '7', NULL); + +--法规月报填写修改主要内容中英文字段长度 2022-10-21 已同步生产环境 +ALTER TABLE `laws_weilai`.`laws_monthly_report_write` +MODIFY COLUMN `content_cn` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '主要内容中文' AFTER `production_car_implement_time`, +MODIFY COLUMN `content_en` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '主要内容英文' AFTER `content_cn`; + +--法规月报填写修改NIO工作进展中英文字段长度 2022-10-21 已同步生产环境 +ALTER TABLE `laws_weilai`.`laws_monthly_report_write` +MODIFY COLUMN `work_progress_cn` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'NIO工作进展中文' AFTER `content_en`, +MODIFY COLUMN `work_progress_en` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'NIO工作进展英文' AFTER `work_progress_cn`; diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java index 6e92fa0dd..d95b68abb 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java @@ -7,7 +7,6 @@ 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.system.vo.LoginUser; import com.jero.common.util.RestUtil; import com.jero.common.util.TokenUtils; import com.jero.common.util.oConvertUtils; @@ -19,7 +18,6 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.shiro.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; @@ -27,12 +25,7 @@ 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.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.HandlerMapping; @@ -41,12 +34,7 @@ import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.BufferedInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; +import java.io.*; import java.net.URLDecoder; import java.text.SimpleDateFormat; import java.util.Date; @@ -382,12 +370,13 @@ public class CommonController { fileName = ossFile.getFileName(); response.setContentType("application/force-download");// 设置强制下载不打开 response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1")); - InputStream download = CosBootUtil.download(filePath); + 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{ @@ -432,6 +421,83 @@ public class CommonController { } } + /** + * 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); + } + + } + + } + } + /** * 文件下载 * diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysUserController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysUserController.java index 4a67f32ad..e4198f9f9 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysUserController.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysUserController.java @@ -127,10 +127,24 @@ public class SysUserController { public Result> queryPageList(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { Result> result = new Result>(); - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap()); + Map reqMap = req.getParameterMap(); + Map newReqMap = new HashMap<>(); + for (String key : reqMap.keySet()){ + if(!key.equals("orgCode")){ + newReqMap.put(key,reqMap.get(key)); + } + } + user.setOrgCode(null); + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(user, newReqMap); //TODO 外部模拟登陆临时账号,列表不显示 queryWrapper.ne("username", "_reserve_user_external"); - Page page = new Page(pageNo, pageSize); + String[] orgCode = reqMap.get("orgCode"); + if(null != orgCode && orgCode.length > 0){ + List orgCodeList = sysDepartService.getSubDepIdsByDepId(orgCode[0]); + orgCodeList.add(orgCode[0]); + queryWrapper.in("org_code",orgCodeList); + } + Page page = new Page<>(pageNo, pageSize); IPage pageList = sysUserService.page(page, queryWrapper); //批量查询用户的所属部门 @@ -1549,6 +1563,12 @@ public class SysUserController { for (SysDepartTreeModel sdtm: departTreeModelList) { dutList.addAll(findChildNode(sdtm)); } + SysUser admin = sysUserService.getUserByName("admin"); + DepartUserTree dut = new DepartUserTree(); + dut.setId(admin.getId()); + dut.setName(admin.getUsername()); + dut.setType("User"); + dutList.add(dut); result.setResult(dutList); result.setSuccess(true); return result; diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/enums/RoleEnum.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/enums/RoleEnum.java new file mode 100644 index 000000000..5e344c977 --- /dev/null +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/enums/RoleEnum.java @@ -0,0 +1,62 @@ +package com.jero.modules.system.enums; + +public enum RoleEnum { + ADMIN_ID("R&H Manager","R&H Manager","manager","1534020391015444481",2), + MANAGER_ID("系统管理员","Administrator","admin","f6817f48af4fb3af11b9e8bf182f618b",3), + COUNTRU_CARD_MANAGE("countryCard管理员","countryCardManage","countryCardManage","1564916346120916993",4), + ; + + String name; + String enName; + String value; + String id; + Integer order; + + RoleEnum(String name, String enName, String value, String id, Integer order) { + this.name = name; + this.enName = enName; + this.value = value; + this.id = id; + this.order = order; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getEnName() { + return enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Integer getOrder() { + return order; + } + + public void setOrder(Integer order) { + this.order = order; + } +} diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java index b1ca1cf74..b091fc0c4 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java @@ -270,4 +270,10 @@ public interface ISysUserService extends IService { * @return */ List queryUserRoleListInfoByUserId(String userId); + + /** + * 验证当前登录用户是否是超级管理员。 + * @return + */ + boolean isAdministrator(); } diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDepartServiceImpl.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDepartServiceImpl.java index 02027b250..8c5c3d639 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDepartServiceImpl.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDepartServiceImpl.java @@ -1,5 +1,6 @@ package com.jero.modules.system.service.impl; +import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -24,6 +25,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.*; +import java.util.stream.Collectors; import static com.jero.modules.system.util.FindsDepartsChildrenUtil.convertSysDepartToSysDepartTreeModel; @@ -286,7 +288,37 @@ public class SysDepartServiceImpl extends ServiceImpl getSubDepIdsByDepId(String departId) { - return this.baseMapper.getSubDepIdsByDepId(departId); + List idList = new ArrayList<>(); + if(StringUtils.isNotEmpty(departId)) { + // 查询所有部门 + LambdaQueryWrapper query = new LambdaQueryWrapper(); + query.eq(SysDepart::getDelFlag, CommonConstant.DEL_FLAG_0.toString()); + List listAll = this.list(query); + + List result = new ArrayList<>(); + // 递归查询 指定父节点下的所有子节点,包括父节点 + if (CollectionUtil.isNotEmpty(listAll)) { + recursion(listAll, result, departId); + } + + + idList.add(departId); // 加上父节点 + idList = result.stream().map(SysDepart::getId).collect(Collectors.toList()); + + } + return idList; + } + + // 递归查询子节点 + private void recursion(List listAll, List result, String fatherId) { + List childern = listAll.stream().filter(e-> fatherId.equals(e.getParentId())).collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(childern)) { + result.addAll(childern); + for(SysDepart depart : childern) { + recursion(listAll, result, depart.getId()); + } + + } } @Override diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java index 3f4c2adcb..71dac6e67 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java @@ -17,6 +17,7 @@ import com.jero.common.util.oConvertUtils; import com.jero.modules.base.service.BaseCommonService; import com.jero.modules.system.entity.*; import com.jero.modules.system.enums.PPSyncEnum; +import com.jero.modules.system.enums.RoleEnum; import com.jero.modules.system.mapper.*; import com.jero.modules.system.model.SysUserSysDepartModel; import com.jero.modules.system.service.ISysUserService; @@ -24,6 +25,7 @@ import com.jero.modules.system.vo.SysUserDepVo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; +import org.apache.shiro.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.CacheEvict; import org.springframework.stereotype.Service; @@ -586,4 +588,30 @@ public class SysUserServiceImpl extends ServiceImpl impl } return result; } + + /** + * 验证当前登录用户是否是超级管理员 + * @return + */ + @Override + public boolean isAdministrator() { + boolean result = false; + RoleEnum administrator = RoleEnum.MANAGER_ID; + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List userRoleList = this.sysUserRoleMapper.selectList(new QueryWrapper().lambda().eq(SysUserRole::getUserId, currentUser.getId())); // 查询用户所有角色 + if(CollectionUtils.isNotEmpty(userRoleList)){ + List userRoles = userRoleList.stream().filter(userRole -> { + boolean flag = false; + if(StringUtils.equals(userRole.getRoleId(),administrator.getId())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(userRoles)){ + result = true; + } + } + return result; + } } diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/util/PDFUtils.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/util/PDFUtils.java index c83b6776c..9738325ef 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/util/PDFUtils.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/util/PDFUtils.java @@ -17,6 +17,7 @@ import java.awt.geom.Dimension2D; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.io.*; +import java.lang.reflect.Field; @Slf4j public class PDFUtils { @@ -217,7 +218,10 @@ public class PDFUtils { String path = uploadpath + File.separator + fileName; newFilePath = path.replace(fileName, "transformation" + fileName); reader = new PdfReader(byes); - + //解密文件 + Field f = PdfReader.class.getDeclaredField("ownerPasswordUsed"); + f.setAccessible(true); + f.set(reader, Boolean.TRUE); // 加完水印的文件 os = new FileOutputStream(newFilePath); stamper = new PdfStamper(reader, os); @@ -286,6 +290,11 @@ public class PDFUtils { e.printStackTrace(); log.error(e.getMessage()); + } catch (IllegalAccessException e) { + e.printStackTrace(); + log.error(e.getMessage()); + }catch (NoSuchFieldException e) { + e.printStackTrace(); } finally { try { stamper.close(); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java index 349d8ced7..b9da4fa4e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java @@ -56,8 +56,9 @@ public class ParamsCollectManifestEOController extends JeroController>> getHeader(@RequestParam(name = "paramsManifestId") String paramsManifestId, @RequestParam(name = "flag") String flag, + @RequestParam(name = "userType", required = false) String userType, @RequestParam(name = "cut") String cut) { - List> list = paramsCollectManifestEOService.getHeader(paramsManifestId, flag, cut); + List> list = paramsCollectManifestEOService.getHeader(paramsManifestId, flag, userType, cut); return Result.OK(list); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsCollectManifestEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsCollectManifestEO.java index 6b38ec36e..2dfe8f17f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsCollectManifestEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsCollectManifestEO.java @@ -2,14 +2,17 @@ package com.jero.modules.cert.collect.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; +import java.util.Date; /** @@ -41,6 +44,12 @@ public class ParamsCollectManifestEO extends ParamsCollectManifestBaseEO impleme @ApiModelProperty(value = "添加标识") private String addFlag; + /**同步上报库时间*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "同步上报库时间") + private Date reportTime; + @TableField(exist = false) private String userTypes; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsCollectManifestHistoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsCollectManifestHistoryEO.java index 223acf2b3..7a69ce97f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsCollectManifestHistoryEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/entity/ParamsCollectManifestHistoryEO.java @@ -1,12 +1,16 @@ package com.jero.modules.cert.collect.entity; import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; +import java.util.Date; /** @@ -22,4 +26,9 @@ import java.io.Serializable; @ApiModel(value="params_collect_manifest_history对象", description="参数项收集清单历史版本") public class ParamsCollectManifestHistoryEO extends ParamsCollectManifestBaseEO implements Serializable { + /**同步上报库时间*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "同步上报库时间") + private Date reportTime; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml index 9a10df792..26f0ae6c0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml @@ -30,6 +30,7 @@ + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestHistoryEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestHistoryEOMapper.xml index 07a93e805..e02a6edb6 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestHistoryEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestHistoryEOMapper.xml @@ -27,6 +27,7 @@ + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java index 8904cd11c..16249bc07 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java @@ -83,7 +83,7 @@ public interface IParamsCollectManifestEOService extends IService> getHeader(String paramsManifestId, String flag, String cut); + List> getHeader(String paramsManifestId, String flag, String userType, String cut); /** * 提交 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index 6ffb1fdef..34349bfc1 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -749,7 +749,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl> getHeader(String paramsManifestId, String flag, String cut) { + public List> getHeader(String paramsManifestId, String flag, String userType, String cut) { List fieldList = onlCgformFieldService.getFieldList(flag); // flag--->7 if (fieldList.size() != 0) { //过滤列表字段(is_show_list-->列表是否显示0否 1是) @@ -772,6 +772,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl map = new HashMap<>(); String dbFieldName = onlCgformField.getDbFieldName(); + if ("report_time".equals(dbFieldName) + && (CollectManifestUserTypeEnum.SDT.getValue().equals(userType) || CollectManifestUserTypeEnum.DRE.getValue().equals(userType))) { + continue; + } if ("nio_number".equals(dbFieldName) || "params_name".equals(dbFieldName)) { map.put("click5", true); if("nio_number".equals(dbFieldName)) { @@ -2080,6 +2084,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl configIdList = Arrays.asList(paramsReportDetailVO.getConfigIds().split(",")); // 需要导出的配置列 List> dataList = paramsReportDetailEOMapper.listInfoForExport(idList, paramsReportDetailVO); // 查询需要导出的数据 + dataList = dataList.stream().collect(Collectors.collectingAndThen( + Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(p -> (String) p.get("id")))), + ArrayList::new)); // 去重 List paramsConfigEOList = paramsReportConfigEOService.queryList(paramsReportDetailVO.getParamsManifestId()); // 查询所有配置列 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/entity/SarFileCompareResultVO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/entity/SarFileCompareResultVO.java index 9236eebf8..c517ef2bc 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/entity/SarFileCompareResultVO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/entity/SarFileCompareResultVO.java @@ -8,8 +8,10 @@ public class SarFileCompareResultVO { private String infoId; private String serialNumberLeft; private String fileNameLeft; + private String fileIdLeft; private String serialNumberRight; private String fileNameRight; + private String fileIdRight; private List resList; private String comments; @@ -78,4 +80,20 @@ public class SarFileCompareResultVO { public void setComments(String comments) { this.comments = comments; } + + public String getFileIdLeft() { + return fileIdLeft; + } + + public void setFileIdLeft(String fileIdLeft) { + this.fileIdLeft = fileIdLeft; + } + + public String getFileIdRight() { + return fileIdRight; + } + + public void setFileIdRight(String fileIdRight) { + this.fileIdRight = fileIdRight; + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/enums/AssessConsistencyEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/enums/AssessConsistencyEnum.java new file mode 100644 index 000000000..8e5eeeab6 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/enums/AssessConsistencyEnum.java @@ -0,0 +1,21 @@ +package com.jero.modules.compare.enums; + +public enum AssessConsistencyEnum { + + SAME("一致"), + DIFFERENT("差异"); + + private String value; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + AssessConsistencyEnum(String value) { + this.value = value; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/service/impl/SarFileCompareItemCommentServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/service/impl/SarFileCompareItemCommentServiceImpl.java index c13dd7034..c3c39bd8a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/service/impl/SarFileCompareItemCommentServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/service/impl/SarFileCompareItemCommentServiceImpl.java @@ -2,23 +2,26 @@ package com.jero.modules.compare.service.impl; import com.aliyuncs.utils.IOUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.common.constant.enums.CutEnum; import com.jero.common.exception.JeroBootException; import com.jero.common.util.oss.CosBootUtil; import com.jero.modules.compare.entity.*; +import com.jero.modules.compare.enums.AssessConsistencyEnum; import com.jero.modules.compare.mapper.SarFileCompareItemCommentMapper; import com.jero.modules.compare.service.ISarFileCompareInfoService; import com.jero.modules.compare.service.ISarFileCompareItemCommentService; import com.jero.modules.compare.service.ISarFileCompareItemService; +import com.jero.modules.compare.utils.ConvertHtml2Excel; import com.jero.modules.system.util.StringUtils; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; -import org.apache.poi.hssf.usermodel.HSSFClientAnchor; -import org.apache.poi.hssf.usermodel.HSSFPatriarch; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.common.usermodel.HyperlinkType; +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellRangeAddress; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -27,6 +30,7 @@ import javax.imageio.ImageIO; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import java.awt.*; import java.awt.image.BufferedImage; import java.io.*; import java.nio.file.Files; @@ -34,8 +38,7 @@ import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.text.SimpleDateFormat; import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import java.util.List; /** * @Description: 文档对比信息条款评论表 @@ -44,6 +47,7 @@ import java.util.regex.Pattern; * @Version: V1.0 */ @Service +@Slf4j public class SarFileCompareItemCommentServiceImpl extends ServiceImpl implements ISarFileCompareItemCommentService { @Autowired @@ -100,7 +104,29 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl left = new QueryWrapper<>(); + left.eq("items_id_left", itemsIdLeft); + if (baseMapper.selectCount(left) == 0) { + SarFileCompareItem sarFileCompareItem = SarFileCompareItemServiceImpl.queryById(itemsIdLeft); + sarFileCompareItem.setReviewed(0); + SarFileCompareItemServiceImpl.saveOrUpdate(sarFileCompareItem); + } + QueryWrapper right = new QueryWrapper<>(); + right.eq("items_id_right", itemsIdRight); + if (baseMapper.selectCount(right) == 0) { + SarFileCompareItem sarFileCompareItem = SarFileCompareItemServiceImpl.queryById(itemsIdRight); + sarFileCompareItem.setReviewed(0); + SarFileCompareItemServiceImpl.saveOrUpdate(sarFileCompareItem); + } + } /** @@ -142,8 +168,10 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl list = queryListByInfoId(infoId,comment); @@ -179,7 +207,11 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl queryListByInfoId(String infoId,String comment) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); if (ObjectUtils.isNotEmpty(comment)) { - queryWrapper.eq(SarFileCompareItemComment::getComment, comment); + if (AssessConsistencyEnum.SAME.getValue().equals(comment)) { + queryWrapper.eq(SarFileCompareItemComment::getComment, comment); + } else if (AssessConsistencyEnum.DIFFERENT.getValue().equals(comment)) { + queryWrapper.ne(SarFileCompareItemComment::getComment, AssessConsistencyEnum.SAME.getValue()); + } } queryWrapper.eq(SarFileCompareItemComment::getInfoId, infoId); queryWrapper.orderBy(true, true, SarFileCompareItemComment::getCreateTime); @@ -200,7 +232,11 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl mergeCells = new ArrayList<>(); @@ -270,64 +314,26 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl", "").replace("

", "\r\n"); - BufferedImage bufferImg = null; - ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream(); - addImgdata(text,request.getSession()); - String rowDataAndPath = (String) request.getSession().getAttribute("txtAndImg"); + log.info("-------------- 开始开始拆分左侧图片、文字、表格 :" + text + "-----------------"); + String rowDataAndPath = getSplitContent(request, text); + log.info("-------------- 左侧图片、文字、表格 拆分成功 :"+ rowDataAndPath +"-----------------"); leftSplit = rowDataAndPath.split("---"); if (leftSplit.length > 1) { for (int j = 0; j < leftSplit.length; j++) { - if (j > 0) { - Row row2 = sheet.createRow(j + i); - if (leftSplit[j].contains(".jpg") || leftSplit[j].contains(".png")) { - row2.setHeight((short) 5000); //设置行高 - //先将图片下载到本地 - String fileLastName = leftSplit[j].substring(leftSplit[j].lastIndexOf("/") + 1); - if (CosBootUtil.doesObjectExist(leftSplit[j])) { - try (InputStream in = CosBootUtil.download(leftSplit[j])) { - copyFile2(in, dir + File.separator + fileLastName); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage(), e); - } - } - File file = new File(dir + File.separator + fileLastName); - if (file.exists()) { - bufferImg = ImageIO.read(file); - ImageIO.write(bufferImg, "jpg", byteArrayOut); - //anchor主要用于设置图片的属性 - HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 600, 200, (short) 3, j + i, (short) 3, j + i); - patriarch.createPicture(anchor, workbook.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG)); - + if (ObjectUtils.isNotEmpty(leftSplit[j])) { + ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream(); + if (j > 0) { + Row row2 = sheet.getRow(j + i); + if (ObjectUtils.isEmpty(row2)) { + row2 = sheet.createRow(j + i); } + log.info("-------------- 开始开始处理左侧图片、表格 -----------------"); + handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row2, i, j, leftSplit[j], 3); + log.info("-------------- 左侧图片、表格 处理成功 -----------------"); } else { - row2.createCell(3).setCellValue(leftSplit[j]); - } - } else { - if (leftSplit[j].contains(".jpg") || leftSplit[j].contains(".png")) { - row.setHeight((short) 5000); //设置行高 - //先将图片下载到本地 - String fileLastName = leftSplit[j].substring(leftSplit[j].lastIndexOf("/") + 1); - if (CosBootUtil.doesObjectExist(leftSplit[j])) { - try (InputStream in = CosBootUtil.download(leftSplit[j])) { - copyFile2(in, dir + File.separator + fileLastName); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage(), e); - } - } - File file = new File(dir + File.separator + fileLastName); - if (file.exists()) { - bufferImg = ImageIO.read(file); - ImageIO.write(bufferImg, "jpg", byteArrayOut); - //anchor主要用于设置图片的属性 - HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 600, 200, (short) 3, j + i, (short) 3, j + i); - patriarch.createPicture(anchor, workbook.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG)); - - } - } else { - row.createCell(3).setCellValue(leftSplit[j]); + log.info("-------------- 开始开始处理左侧图片、表格 -----------------"); + handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row, i, j, leftSplit[j], 3); + log.info("-------------- 左侧图片、表格 处理成功 -----------------"); } } } @@ -339,7 +345,6 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl", "").replace("

", "\r\n"); - BufferedImage bufferImg = null; - ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream(); - addImgdata(text,request.getSession()); - String rowDataAndPath = (String) request.getSession().getAttribute("txtAndImg"); + log.info("-------------- 开始开始拆分右侧图片、文字、表格 :"+ text +" -----------------"); + String rowDataAndPath = getSplitContent(request, text); + log.info("-------------- 右侧图片、文字、表格 拆分成功 :"+ rowDataAndPath +" -----------------"); rightSplit = rowDataAndPath.split("---"); if (rightSplit.length > 1) { for (int j = 0; j < rightSplit.length; j++) { - if (j > 0) { - Row row2 = sheet.createRow(j + i); - if (rightSplit[j].contains(".jpg") || rightSplit[j].contains(".png")) { - row2.setHeight((short) 5000); //设置行高 - //先将图片下载到本地 - String fileLastName = rightSplit[j].substring(rightSplit[j].lastIndexOf("/") + 1); - if (CosBootUtil.doesObjectExist(rightSplit[j])) { - try (InputStream in = CosBootUtil.download(rightSplit[j])) { - copyFile2(in, dir + File.separator + fileLastName); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage(), e); - } - } - File file = new File(dir + File.separator + fileLastName); - if (file.exists()) { - bufferImg = ImageIO.read(file); - ImageIO.write(bufferImg, "jpg", byteArrayOut); - //anchor主要用于设置图片的属性 - HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 600, 200, (short) 3, j + i, (short) 3, j + i); - patriarch.createPicture(anchor, workbook.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG)); - + if (ObjectUtils.isNotEmpty(rightSplit[j])) { + ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream(); + if (j > 0) { + Row row2 = sheet.getRow(j + i); + if (ObjectUtils.isEmpty(row2)) { + row2 = sheet.createRow(j + i); } + log.info("-------------- 开始处理右侧图片、表格 -----------------"); + handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row2, i, j, rightSplit[j], 7); + log.info("-------------- 右侧图片、表格 处理成功 -----------------"); } else { - row2.createCell(3).setCellValue(rightSplit[j]); - } - } else { - if (rightSplit[j].contains(".jpg") || rightSplit[j].contains(".png")) { - row.setHeight((short) 5000); //设置行高 - //先将图片下载到本地 - String fileLastName = rightSplit[j].substring(rightSplit[j].lastIndexOf("/") + 1); - if (CosBootUtil.doesObjectExist(rightSplit[j])) { - try (InputStream in = CosBootUtil.download(rightSplit[j])) { - copyFile2(in, dir + File.separator + fileLastName); - } catch (IOException e) { - e.printStackTrace(); - log.error(e.getMessage(), e); - } - } - File file = new File(dir + File.separator + fileLastName); - if (file.exists()) { - bufferImg = ImageIO.read(file); - ImageIO.write(bufferImg, "jpg", byteArrayOut); - //anchor主要用于设置图片的属性 - HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 600, 200, (short) 3, j + i, (short) 3, j + i); - patriarch.createPicture(anchor, workbook.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG)); - - } - } else { - row.createCell(7).setCellValue(rightSplit[j]); + log.info("-------------- 开始处理右侧图片、表格 -----------------"); + handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row, i, j, rightSplit[j], 7); + log.info("-------------- 右侧图片、表格 处理成功 -----------------"); } } } @@ -416,11 +383,11 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl mergeCellSet = new HashSet<>(mergeCells); + for (SarFileCompareExcelMergeCell mergeCell : mergeCellSet) { Integer leftCount = mergeCell.getLeftEnd() - mergeCell.getLeftStart() + 1; Integer rightCount = mergeCell.getRightEnd() - mergeCell.getRightStart() + 1; Integer start = leftCount - rightCount >= 0 ? mergeCell.getLeftStart() : mergeCell.getRightStart(); + log.info("-------------- 合并开始行数:" + start + " -----------------"); Integer end = leftCount - rightCount >= 0 ? mergeCell.getLeftEnd() : mergeCell.getRightEnd(); + log.info("-------------- 合并结束行数: " + end + " -----------------"); //合并 CellRangeAddress region0 = new CellRangeAddress(start, end, 0, 0); sheet.addMergedRegion(region0); @@ -461,9 +432,10 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl标签内容中的图片路径,并重新按顺序拼接 + * 处理图片跟表格类型的数据 + * @param workbook + * @param dir + * @param patriarch + * @param cellStyleLink + * @param byteArrayOut + * @param row + * @param i + * @param j + * @param text + * @param cellNum + * @throws IOException + */ + private void handleSpecificData(Workbook workbook, String dir, HSSFPatriarch patriarch, CellStyle cellStyleLink, ByteArrayOutputStream byteArrayOut, Row row, int i, int j, String text, int cellNum) throws IOException { + if (text.contains("/upFiles")) { + row.setHeight((short) 3000); //设置行高 + //先将图片下载到本地 + log.info("-------------------------将图片下载到本地文件夹中----------------------------"); + String fileLastName = text.substring(text.lastIndexOf("/") + 1); + if (CosBootUtil.doesObjectExist(text)) { + try (InputStream in = CosBootUtil.download(text)) { + copyFile2(in, dir + File.separator + fileLastName); + } catch (IOException e) { + e.printStackTrace(); + log.error(e.getMessage(), e); + } + } + File file = new File(dir + File.separator + fileLastName); + log.info("-------------------------图片下载成功:"+ file.getAbsolutePath() +"----------------------------"); + if (file.exists()) { + log.info("-------------------------将图片插入excel指定单元格中----------------------------"); + BufferedImage bufferImg = ImageIO.read(file); + //获取文件后缀 + String fileName = file.getName(); + String formatName = fileName.substring(fileName.lastIndexOf(".") + 1); + //如果是jpg或者是jpeg,需要重画一下,否则会变色 + if (formatName.equalsIgnoreCase("jpg") || formatName.equalsIgnoreCase("jpeg")) { //重画一下,要么会变色 + BufferedImage tag; + tag = new BufferedImage(bufferImg.getWidth(), bufferImg.getHeight(), BufferedImage.TYPE_INT_BGR); + Graphics g = tag.getGraphics(); + g.drawImage(bufferImg, 0, 0, null); // 绘制缩小后的图 + g.dispose(); + bufferImg = tag; + } + ImageIO.write(bufferImg, formatName, byteArrayOut); + //anchor主要用于设置图片的属性 + HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 600, 200, (short) cellNum, j + i, (short) cellNum, j + i); + patriarch.createPicture(anchor, workbook.addPicture(byteArrayOut.toByteArray(), HSSFWorkbook.PICTURE_TYPE_JPEG)); + log.info("-------------------------将图片插入成功----------------------------"); + } + } else { + Cell cell = row.createCell(cellNum); + if (text.contains("") < 0) { + if (tableHtml.indexOf("") < 0) { + tableHtml = tableHtml.replaceFirst("", ""); + tableHtml = tableHtml.replaceFirst("", ""); + } else { + tableHtml = tableHtml.replaceFirst("", ""); + tableHtml = tableHtml.replaceFirst("", ""); + } + } + String cnt = "\n"; + tableHtml = tableHtml.replaceAll("<[\\s]*?br[^>]*?>|<[\\s]*?\\/[\\s]*?br[\\s]*?>", cnt); + String tableSheetName = "表格" + System.currentTimeMillis(); + ConvertHtml2Excel.table2Excel(tableHtml, (HSSFWorkbook) workbook, tableSheetName); + log.info("-------------------------表格生产完毕----------------------------"); + //添加超链接 + log.info("-------------------------开始添加超链接---------------------------"); + CreationHelper createHelper = workbook.getCreationHelper(); + Hyperlink hyperlink1 = createHelper.createHyperlink(HyperlinkType.DOCUMENT); + String tableName = "#\'" + tableSheetName + "\'!A1"; + hyperlink1.setAddress(tableName); + cell.setHyperlink(hyperlink1);// 链接 + cell.setCellStyle(cellStyleLink); + log.info("-------------------------超链接添加完毕---------------------------"); + } + + /** + * 获取文字、图片、表格分割后的内容 + * @param request * @param text * @return */ - private void addImgdata(String text,HttpSession session) { - if (text.contains("<") || text.contains(">")) { - String txtLeft = text.substring(0, text.indexOf("<")); - String txtRight = text.substring(text.indexOf(">") + 1); - String img = text.substring(text.indexOf("<"), text.indexOf(">")); - String path = img.substring(img.lastIndexOf("=") + 1, img.lastIndexOf("\"")); + private String getSplitContent(HttpServletRequest request, String text) { + text = text.replace("

", "").replace("

", "\r\n"); + //分割图片 + log.info("-------------------------开始分割文字与图片---------------------------"); + splitImg(text, request.getSession()); + log.info("-------------------------文字与图片分割完毕---------------------------"); + //分割表格 + log.info("-------------------------从剩余文字中开始分割表格---------------------------"); + String txtAndImg = (String) request.getSession().getAttribute("txtAndImg"); + txtAndImg = txtAndImg.replaceAll("table", "replaceTable"); + splitTable(txtAndImg, request.getSession()); + log.info("-------------------------表格分割完毕---------------------------"); + return (String) request.getSession().getAttribute("textAndTableAndImg"); + } + + /** + * 分割表格 + * @param textAndImg + * @param session + */ + private void splitTable(String textAndImg,HttpSession session) { + if (textAndImg.contains("") + 14); + String table = textAndImg.substring(textAndImg.indexOf("")+14); + table = table.replaceAll("replaceTable", "table"); + textAndImg = left + "---" + table + "---" + right; + splitTable(textAndImg, session); + } else { + session.setAttribute("textAndTableAndImg", textAndImg); + } + } + + /** + * 分割图片 + * @param text + * @param session + * @return + */ + private void splitImg(String text,HttpSession session) { + if (text.contains("") + 3); + String img = text.substring(text.indexOf("")); + String path = img.substring(img.lastIndexOf("=") + 1)+"g"; text = txtLeft + "---" + path + "---" + txtRight; - addImgdata(text, session); + splitImg(text, session); } else { session.setAttribute("txtAndImg", text); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/utils/ConvertHtml2Excel.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/utils/ConvertHtml2Excel.java new file mode 100644 index 000000000..db29bbb5c --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/utils/ConvertHtml2Excel.java @@ -0,0 +1,231 @@ +package com.jero.modules.compare.utils; +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.hssf.util.HSSFCellUtil; +import org.apache.poi.hssf.util.HSSFColor; +import org.apache.poi.ss.util.CellRangeAddress; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; + + +/**** + * html转excel + * @author user + * + */ +public class ConvertHtml2Excel { + /** + * html表格转excel + * + * @param tableHtml 如 + * + * .. + *
+ * @return + */ + public static void table2Excel(String tableHtml, HSSFWorkbook wb,String tableSheetName) { + HSSFSheet sheet = wb.createSheet(tableSheetName); + List crossRowEleMetaLs = new ArrayList(); + int rowIndex = 0; + try { + Document data = DocumentHelper.parseText(tableHtml); + // 生成表头 + Element thead = data.getRootElement().element("thead"); + HSSFCellStyle titleStyle = getTitleStyle(wb); + int ls=0;//列数 + if (thead != null) { + List trLs = thead.elements("tr"); + for (Element trEle : trLs) { + HSSFRow row = sheet.createRow(rowIndex); + List thLs = trEle.elements("th"); + ls=thLs.size(); + makeRowCell(thLs, rowIndex, row, 0, titleStyle, crossRowEleMetaLs); + rowIndex++; + } + } + // 生成表体 + Element tbody = data.getRootElement().element("tbody"); + HSSFCellStyle contentStyle = getContentStyle(wb); + if (tbody != null) { + List trLs = tbody.elements("tr"); + for (Element trEle : trLs) { + HSSFRow row = sheet.createRow(rowIndex); + List thLs = trEle.elements("th"); + int cellIndex = makeRowCell(thLs, rowIndex, row, 0, titleStyle, crossRowEleMetaLs); + List tdLs = trEle.elements("td"); + makeRowCell(tdLs, rowIndex, row, cellIndex, contentStyle, crossRowEleMetaLs); + rowIndex++; + } + } + // 合并表头 + for (CrossRangeCellMeta crcm : crossRowEleMetaLs) { + sheet.addMergedRegion(new CellRangeAddress(crcm.getFirstRow(), crcm.getLastRow(), crcm.getFirstCol(), crcm.getLastCol())); + setRegionStyle(sheet, new CellRangeAddress(crcm.getFirstRow(), crcm.getLastRow(), crcm.getFirstCol(), crcm.getLastCol()),contentStyle); + } + for(int i=0;i tdLs, int rowIndex, HSSFRow row, int startCellIndex, HSSFCellStyle cellStyle, + List crossRowEleMetaLs) { + int i = startCellIndex; + for (int eleIndex = 0; eleIndex < tdLs.size(); i++, eleIndex++) { + int captureCellSize = getCaptureCellSize(rowIndex, i, crossRowEleMetaLs); + while (captureCellSize > 0) { + for (int j = 0; j < captureCellSize; j++) {// 当前行跨列处理(补单元格) + row.createCell(i); + i++; + } + captureCellSize = getCaptureCellSize(rowIndex, i, crossRowEleMetaLs); + } + Element thEle = tdLs.get(eleIndex); + String val = thEle.getTextTrim(); + if (StringUtils.isBlank(val)) { + Element e = thEle.element("a"); + if (e != null) { + val = e.getTextTrim(); + } + } + HSSFCell c = row.createCell(i); + if (NumberUtils.isNumber(val)) { + c.setCellValue(Double.parseDouble(val)); + c.setCellType(HSSFCell.CELL_TYPE_NUMERIC); + } else { + c.setCellValue(val); + } + int rowSpan = NumberUtils.toInt(thEle.attributeValue("rowspan"), 1); + int colSpan = NumberUtils.toInt(thEle.attributeValue("colspan"), 1); + c.setCellStyle(cellStyle); + if (rowSpan > 1 || colSpan > 1) { // 存在跨行或跨列 + crossRowEleMetaLs.add(new CrossRangeCellMeta(rowIndex, i, rowSpan, colSpan)); + } + if (colSpan > 1) {// 当前行跨列处理(补单元格) + for (int j = 1; j < colSpan; j++) { + i++; + row.createCell(i); + } + } + } + return i; + } + + /** + * 设置合并单元格的边框样式 + * + * @param sheet + * @param region + * @param cs + */ + public static void setRegionStyle(HSSFSheet sheet, CellRangeAddress region, HSSFCellStyle cs) { + for (int i = region.getFirstRow(); i <= region.getLastRow(); i++) { + HSSFRow row = HSSFCellUtil.getRow(i, sheet); + for (int j = region.getFirstColumn(); j <= region.getLastColumn(); j++) { + HSSFCell cell = HSSFCellUtil.getCell(row, (short) j); + cell.setCellStyle(cs); + } + } + } + + /** + * 获得因rowSpan占据的单元格 + * + * @param rowIndex 行号 + * @param colIndex 列号 + * @param crossRowEleMetaLs 跨行列元数据 + * @return 当前行在某列需要占据单元格 + */ + private static int getCaptureCellSize(int rowIndex, int colIndex, List crossRowEleMetaLs) { + int captureCellSize = 0; + for (CrossRangeCellMeta crossRangeCellMeta : crossRowEleMetaLs) { + if (crossRangeCellMeta.getFirstRow() < rowIndex && crossRangeCellMeta.getLastRow() >= rowIndex) { + if (crossRangeCellMeta.getFirstCol() <= colIndex && crossRangeCellMeta.getLastCol() >= colIndex) { + captureCellSize = crossRangeCellMeta.getLastCol() - colIndex + 1; + } + } + } + return captureCellSize; + } + + /** + * 获得标题样式 + * + * @param workbook + * @return + */ + private static HSSFCellStyle getTitleStyle(HSSFWorkbook workbook) { + short titlebackgroundcolor = HSSFColor.GREY_25_PERCENT.index; + short fontSize = 12; + String fontName = "宋体"; + HSSFCellStyle style = workbook.createCellStyle(); + style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + style.setAlignment(HSSFCellStyle.ALIGN_CENTER); + style.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + style.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + style.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + style.setFillForegroundColor(titlebackgroundcolor);// 背景色 + + HSSFFont font = workbook.createFont(); + font.setFontName(fontName); + font.setFontHeightInPoints(fontSize); + font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); + style.setFont(font); + return style; + } + + /** + * 获得内容样式 + * + * @param wb + * @return + */ + private static HSSFCellStyle getContentStyle(HSSFWorkbook wb) { + short fontSize = 12; + String fontName = "宋体"; + HSSFCellStyle style = wb.createCellStyle(); + style.setBorderBottom((short) 1); + style.setBorderTop((short) 1); + style.setBorderLeft((short) 1); + style.setBorderRight((short) 1); + HSSFFont font = wb.createFont(); + font.setFontName(fontName); + font.setFontHeightInPoints(fontSize); + style.setFont(font); + style.setAlignment(HSSFCellStyle.ALIGN_CENTER);//水平居中 + style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//垂直居中 + + return style; + } +} + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/utils/CrossRangeCellMeta.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/utils/CrossRangeCellMeta.java new file mode 100644 index 000000000..acee632aa --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/compare/utils/CrossRangeCellMeta.java @@ -0,0 +1,37 @@ +package com.jero.modules.compare.utils; + +public class CrossRangeCellMeta { + + public CrossRangeCellMeta(int firstRowIndex, int firstColIndex, int rowSpan, int colSpan) { + super(); + this.firstRowIndex = firstRowIndex; + this.firstColIndex = firstColIndex; + this.rowSpan = rowSpan; + this.colSpan = colSpan; + } + + private int firstRowIndex; + private int firstColIndex; + private int rowSpan;// 跨越行数 + private int colSpan;// 跨越列数 + + public int getFirstRow() { + return firstRowIndex; + } + + public int getLastRow() { + return firstRowIndex + rowSpan - 1; + } + + public int getFirstCol() { + return firstColIndex; + } + + public int getLastCol() { + return firstColIndex + colSpan - 1; + } + + public int getColSpan(){ + return colSpan; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/docTranslation/enums/ReleaseConditionEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/docTranslation/enums/ReleaseConditionEnum.java index bba19ad94..1504bb042 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/docTranslation/enums/ReleaseConditionEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/docTranslation/enums/ReleaseConditionEnum.java @@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; */ public enum ReleaseConditionEnum { - PUBLISHED("已发布","published","Have published"), + PUBLISHED("已发布","published","Published"), DRAFT("草稿","draft","Draft"), ; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoDataController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoDataController.java index 4c6513783..b71be6192 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoDataController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoDataController.java @@ -25,6 +25,7 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; @@ -92,7 +93,11 @@ public class ExtRepoDataController extends JeroController pageList = extRepoDataService.page(page, queryWrapper); - ExtRepoDataPage res = new ExtRepoDataPage(extRepoFolderService.haveManageAuth(extRepoData.getSupFolder()), pageList); + //判断当前文件夹或者上级文件夹是否有权限 + HttpSession session = req.getSession(); + session.setAttribute("haveSuperiorManageAuth", false); + extRepoFolderService.haveSuperiorManageAuth(extRepoData.getSupFolder(),session); + ExtRepoDataPage res = new ExtRepoDataPage((Boolean)session.getAttribute("haveSuperiorManageAuth"), pageList); return Result.OK(res); } @@ -118,9 +123,12 @@ public class ExtRepoDataController extends JeroController add(@Validated @RequestBody ExtRepoData extRepoData) { + public Result add(@Validated @RequestBody ExtRepoData extRepoData,HttpSession session) { Result result = new Result(); - if (extRepoFolderService.haveManageAuth(extRepoData.getSupFolder())) { + //判断当前文件夹或者上级文件夹是否有权限 + session.setAttribute("haveSuperiorManageAuth", false); + extRepoFolderService.haveSuperiorManageAuth(extRepoData.getSupFolder(),session); + if ((Boolean)session.getAttribute("haveSuperiorManageAuth")) { log.info("对外报告数据表收到文件添加请求,开始处理文件:【" + sdf.format(new Date()) + "】"); int res = extRepoDataService.add(extRepoData); if (CutEnum.CN.getValue().equals(extRepoData.getCut())) { @@ -148,11 +156,14 @@ public class ExtRepoDataController extends JeroController edit(@Validated @RequestBody ExtRepoData extRepoData) { + public Result edit(@Validated @RequestBody ExtRepoData extRepoData,HttpSession session) { Result result = new Result(); ExtRepoData erd = extRepoDataService.queryById(extRepoData.getId()); - LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - if (extRepoFolderService.isManager() || sysUser.getUsername().equals(erd.getCreateBy())) { + //LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //判断当前文件夹或者上级文件夹是否有权限 + session.setAttribute("haveSuperiorManageAuth", false); + extRepoFolderService.haveSuperiorManageAuth(erd.getSupFolder(),session); + if (extRepoFolderService.isManager() || (Boolean)session.getAttribute("haveSuperiorManageAuth")) { extRepoData.setSupFolder(erd.getSupFolder()); extRepoDataService.editById(extRepoData); if (CutEnum.CN.getValue().equals(extRepoData.getCut())) { @@ -180,12 +191,15 @@ public class ExtRepoDataController extends JeroController delete(@RequestParam("id") String id, - @RequestParam(name = "cut", defaultValue = "cn") String cut) { + @RequestParam(name = "cut", defaultValue = "cn") String cut,HttpSession session) { Result result = new Result(); ExtRepoData erd = extRepoDataService.queryById(id); if (null != erd) { - LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - if (extRepoFolderService.isManager() || sysUser.getUsername().equals(erd.getCreateBy())) { + //LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //判断当前文件夹或者上级文件夹是否有权限 + session.setAttribute("haveSuperiorManageAuth", false); + extRepoFolderService.haveSuperiorManageAuth(erd.getSupFolder(),session); + if (extRepoFolderService.isManager() || (Boolean)session.getAttribute("haveSuperiorManageAuth")) { extRepoDataService.deleteById(id); CosBootUtil.delete(erd.getFileKey()); if (CutEnum.CN.getValue().equals(cut)) { diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoFolderController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoFolderController.java index deab4288f..7ad386fa8 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoFolderController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/controller/ExtRepoFolderController.java @@ -4,6 +4,7 @@ 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.enums.CutEnum; +import com.jero.common.exception.JeroBootException; import com.jero.common.system.base.controller.JeroController; import com.jero.modules.extRepo.entity.ERFTreeDataVO; import com.jero.modules.extRepo.entity.ExtRepoData; @@ -49,7 +50,7 @@ public class ExtRepoFolderController extends JeroController queryList() { ERFTreeDataVO dataVO = new ERFTreeDataVO(); - dataVO.setManager(extRepoFolderService.isManager()); + //dataVO.setManager(extRepoFolderService.isManager()); dataVO.setList(extRepoFolderService.queryTreeList()); return Result.OK(dataVO); } @@ -66,11 +67,20 @@ public class ExtRepoFolderController extends JeroController add(@Validated @RequestBody ExtRepoFolder extRepoFolder, HttpSession session) { Result result = new Result(); session.setAttribute("haveSuperiorManageAuth", false); - extRepoFolderService.haveSuperiorManageAuth(extRepoFolder.getSupFolder(),session); - if (ObjectUtils.isNotEmpty(session.getAttribute("haveSuperiorManageAuth"))&&(Boolean) session.getAttribute("haveSuperiorManageAuth")) { + ExtRepoFolder folder = extRepoFolderService.queryById(extRepoFolder.getSupFolder()); + extRepoFolderService.haveSuperiorManageAuth(folder.getSupFolder(),session); + //上层是否有权限 + boolean boo = (Boolean)session.getAttribute("haveSuperiorManageAuth"); + if (boo||extRepoFolderService.haveManageAuth(extRepoFolder.getSupFolder())) { if (!extRepoFolder.isAddSub()) { //增加同级文件夹 - ExtRepoFolder folder = extRepoFolderService.queryById(extRepoFolder.getSupFolder()); + if (!boo) { + if (CutEnum.CN.getValue().equals(extRepoFolder.getCut())) { + throw new JeroBootException("无法创建同级文件夹!请联系管理员!"); + } else { + throw new JeroBootException("Unable to create a sibling folder ! Please Contact your administrator !"); + } + } extRepoFolder.setSupFolder(folder.getSupFolder()); } extRepoFolderService.add(extRepoFolder); @@ -89,6 +99,41 @@ public class ExtRepoFolderController extends JeroController isAllowSiblingFolder(@Validated @RequestBody ExtRepoFolder extRepoFolder, + HttpSession session) { + Result result = new Result(); + session.setAttribute("haveSuperiorManageAuth", false); + ExtRepoFolder folder = extRepoFolderService.queryById(extRepoFolder.getId()); + extRepoFolderService.haveSuperiorManageAuth(folder.getSupFolder(),session); + //上层是否有权限 + boolean boo = (Boolean)session.getAttribute("haveSuperiorManageAuth"); + if (boo || extRepoFolderService.haveManageAuth(extRepoFolder.getId())) { + if (!boo) { + if (CutEnum.CN.getValue().equals(extRepoFolder.getCut())) { + return result.error500("无法创建同级文件夹!请联系管理员!"); + } else { + return result.error500("Unable to create a sibling folder ! Please Contact your administrator !"); + } + } + } else { + if (CutEnum.CN.getValue().equals(extRepoFolder.getCut())) { + return result.error500("没有权限!"); + } else { + return result.error500("You do not have permission !"); + } + } + return result.success(""); + } + /** * 编辑 * @@ -101,7 +146,7 @@ public class ExtRepoFolderController extends JeroController edit(@Validated @RequestBody ExtRepoFolder extRepoFolder, HttpSession session) { Result result = new Result(); session.setAttribute("haveSuperiorManageAuth", false); - extRepoFolderService.haveSuperiorManageAuth(extRepoFolder.getSupFolder(),session); + extRepoFolderService.haveSuperiorManageAuth(extRepoFolder.getId(),session); if (ObjectUtils.isNotEmpty(session.getAttribute("haveSuperiorManageAuth"))&&(Boolean) session.getAttribute("haveSuperiorManageAuth")) { extRepoFolderService.editById(extRepoFolder); if (CutEnum.CN.getValue().equals(extRepoFolder.getCut())) { diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/entity/ERFTreeData.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/entity/ERFTreeData.java index 0b0152705..04a4af70d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/entity/ERFTreeData.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/entity/ERFTreeData.java @@ -56,6 +56,19 @@ public class ERFTreeData implements Comparable { */ private String authManageIds = ""; + /** + * 是否能点击右键 + */ + private boolean isManager; + + public boolean isManager() { + return isManager; + } + + public void setManager(boolean manager) { + isManager = manager; + } + /** * 子文件夹 */ diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/entity/ERFTreeDataVO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/entity/ERFTreeDataVO.java index ba073d51e..23ca44b3b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/entity/ERFTreeDataVO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/entity/ERFTreeDataVO.java @@ -3,19 +3,19 @@ package com.jero.modules.extRepo.entity; import java.util.List; public class ERFTreeDataVO { - boolean isManager; +// boolean isManager; List list; public ERFTreeDataVO() { } - public boolean isManager() { - return isManager; - } +// public boolean isManager() { +// return isManager; +// } - public void setManager(boolean manager) { - isManager = manager; - } +// public void setManager(boolean manager) { +// isManager = manager; +// } public List getList() { return list; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/service/impl/ExtRepoFolderServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/service/impl/ExtRepoFolderServiceImpl.java index f9ad6ac17..442ab9d67 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/service/impl/ExtRepoFolderServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/extRepo/service/impl/ExtRepoFolderServiceImpl.java @@ -241,18 +241,21 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl resList = new ArrayList<>(); for (ExtRepoFolder erf : list) { if (supId.equals(erf.getSupFolder())) { - int childLevel = level + 1; if (haveViewAuth(erf.getId())) { ERFTreeData date = new ERFTreeData(erf.getFolderName(), erf.getId(), level, erf.getOrderId()); + boolean parentRightClick = haveManageAuth(erf.getId()); + if (parentRightClick) { + date.setManager(true); + } date.setAuthManageIdsName(erf.getAuthManageIdsName()); date.setAuthManageIds(erf.getAuthManageIds()); date.setAuthViewIdsName(erf.getAuthViewIdsName()); date.setAuthViewIds(erf.getAuthViewIds()); - date.setChildren(subFolderTree(erf.getId(),new ArrayList(),childLevel)); + date.setChildren(subFolderTree(new ArrayList(),date)); date.sortChildren(); resList.add(date); } else { - resList.addAll(getSubFolder(erf.getId(), list, childLevel)); + resList.addAll(getSubFolder(erf.getId(), list, level)); } } } @@ -261,20 +264,36 @@ public class ExtRepoFolderServiceImpl extends ServiceImpl subFolderTree(String folder,List childTree,int level) { - int childLevel = level + 1; - List listBySupFolder = getListBySupFolder(folder); + private List subFolderTree(List childTree,ERFTreeData father) { + int childLevel = father.getLevel() + 1; + List listBySupFolder = getListBySupFolder(father.getKey()); for (ExtRepoFolder extRepoFolder : listBySupFolder) { ERFTreeData date = new ERFTreeData(extRepoFolder.getFolderName(), extRepoFolder.getId(), childLevel, extRepoFolder.getOrderId()); - date.setAuthManageIdsName(extRepoFolder.getAuthManageIdsName()); - date.setAuthManageIds(extRepoFolder.getAuthManageIds()); - date.setAuthViewIdsName(extRepoFolder.getAuthViewIdsName()); - date.setAuthViewIds(extRepoFolder.getAuthViewIds()); - date.setChildren(subFolderTree(extRepoFolder.getId(), new ArrayList(),childLevel)); + //是否有管理权限 + boolean childRightClick = haveManageAuth(extRepoFolder.getId()); + if (father.isManager()||childRightClick) { + date.setManager(true); + } + //如果参数为空则延续父文件夹权限,反之用自己的 + if (ObjectUtils.isNotEmpty(extRepoFolder.getAuthManageIds()) && ObjectUtils.isNotEmpty(extRepoFolder.getAuthManageIdsName())) { + date.setAuthManageIdsName(extRepoFolder.getAuthManageIdsName()); + date.setAuthManageIds(extRepoFolder.getAuthManageIds()); + } else { + date.setAuthManageIdsName(father.getAuthManageIdsName()); + date.setAuthManageIds(father.getAuthManageIds()); + } + if (ObjectUtils.isNotEmpty(extRepoFolder.getAuthViewIds()) && ObjectUtils.isNotEmpty(extRepoFolder.getAuthViewIdsName())) { + date.setAuthViewIdsName(extRepoFolder.getAuthViewIdsName()); + date.setAuthViewIds(extRepoFolder.getAuthViewIds()); + } else { + date.setAuthViewIdsName(father.getAuthViewIdsName()); + date.setAuthViewIds(father.getAuthViewIds()); + } + date.setChildren(subFolderTree(new ArrayList(),date)); date.sortChildren(); childTree.add(date); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsOpinionGatherEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsOpinionGatherEOController.java index 6eec32d23..69864ff66 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsOpinionGatherEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsOpinionGatherEOController.java @@ -8,13 +8,16 @@ import javax.servlet.http.HttpServletResponse; import com.alibaba.fastjson.JSONObject; import com.jero.common.api.vo.Result; import com.jero.common.system.query.QueryGenerator; +import com.jero.common.system.vo.LoginUser; import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO; import com.jero.modules.lawsOpinionGather.service.ILawsOpinionGatherEOService; 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.modules.system.service.ISysUserService; import lombok.extern.slf4j.Slf4j; import com.jero.common.system.base.controller.JeroController; +import org.apache.shiro.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -37,6 +40,8 @@ import com.jero.common.aspect.annotation.AutoLog; public class LawsOpinionGatherEOController extends JeroController { @Autowired private ILawsOpinionGatherEOService lawsOpinionGatherEOService; + @Autowired + private ISysUserService sysUserService; /** * 分页列表查询 @@ -57,6 +62,19 @@ public class LawsOpinionGatherEOController extends JeroController queryWrapper = QueryGenerator.initQueryWrapper(lawsOpinionGatherEO, req.getParameterMap()); queryWrapper.orderByDesc("start_time"); + /** + * 创建查询数据权限,超级管理员可以看到所有的数据,并且能删除,其它用户只能看到自己创建、或自己为评估人的数据。 + */ + boolean administrator = this.sysUserService.isAdministrator(); + if(!administrator){ + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //如果不是超级管理员,获取自己所有参与过的法规意见收集 + queryWrapper.and(query -> { + query.eq("create_by",currentUser.getUsername()); + query.or().like("evaluator_ids",currentUser.getId()); + }); + } + Page page = new Page(pageNo, pageSize); IPage pageList = lawsOpinionGatherEOService.page(page, queryWrapper); this.lawsOpinionGatherEOService.disposeData(pageList.getRecords(),cut); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/entity/LawsOpinionGatherEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/entity/LawsOpinionGatherEO.java index 78205d522..91adffa7a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/entity/LawsOpinionGatherEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/entity/LawsOpinionGatherEO.java @@ -122,4 +122,8 @@ public class LawsOpinionGatherEO implements Serializable { @ApiModelProperty(value = "评估人ids,多个之间使用英文逗号分隔") private String evaluatorIds; + + /**删除标识 true 可以删除,false,没有权限删除**/ + @TableField(exist = false) + private boolean deleteFlag = false; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java index 376cc56a3..60217e805 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java @@ -6,6 +6,7 @@ import com.jero.common.api.vo.Result; import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.MessageTypeEnum; import com.jero.common.exception.JeroBootException; +import com.jero.common.system.vo.LoginUser; import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO; import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum; @@ -31,6 +32,7 @@ import com.jero.modules.system.service.impl.SysCategoryServiceImpl; import com.jero.modules.wkflow.feginClient.WorkFlowFeignClient; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.SecurityUtils; import org.jeecg.modules.jmreport.common.constant.CommonConstant; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -197,6 +199,8 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl lawsOpinionGatherEOList,String cut) { if(CollectionUtils.isNotEmpty(lawsOpinionGatherEOList)){ + boolean administrator = this.sysUserService.isAdministrator(); + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); //树形数据字典 List technologyTerritoryList = sysCategoryService.list(); lawsOpinionGatherEOList.forEach(lawsOpinionGather -> { @@ -211,6 +215,10 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl opinionArchiveFileList = iOSSFileService.getFileInfosByConnectId(StringUtils.join(lawsOpinionGather.getOpinionArchiveId(), ",")); lawsOpinionGather.setOpinionArchiveFileList(opinionArchiveFileList); } + //如果当前用户是超级管理员,或是这条数据的创建人,给删除权限。 + if(StringUtils.equals(lawsOpinionGather.getCreateBy(),currentUser.getUsername()) || administrator){ + lawsOpinionGather.setDeleteFlag(true); + } }); } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/controller/LawsTechnologyEvaluationEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/controller/LawsTechnologyEvaluationEOController.java index ca025a19e..eb3ec59fd 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/controller/LawsTechnologyEvaluationEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/controller/LawsTechnologyEvaluationEOController.java @@ -3,19 +3,26 @@ package com.jero.modules.lawsTechnologyEvaluation.controller; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.alibaba.fastjson.JSONObject; import com.jero.common.api.vo.Result; import com.jero.common.system.query.QueryGenerator; +import com.jero.common.system.vo.LoginUser; import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO; +import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO; import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService; 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.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationFlowDetailEOService; +import com.jero.modules.system.service.ISysUserService; import lombok.extern.slf4j.Slf4j; import com.jero.common.system.base.controller.JeroController; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.shiro.SecurityUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; @@ -40,6 +47,10 @@ import com.jero.common.aspect.annotation.AutoLog; public class LawsTechnologyEvaluationEOController extends JeroController { @Autowired private ILawsTechnologyEvaluationEOService lawsTechnologyEvaluationEOService; + @Autowired + private ISysUserService sysUserService; + @Autowired + private ILawsTechnologyEvaluationFlowDetailEOService lawsTechnologyEvaluationFlowDetailEOService; /** * 分页列表查询 @@ -60,6 +71,10 @@ public class LawsTechnologyEvaluationEOController extends JeroController queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationEO, req.getParameterMap()); queryWrapper.orderByDesc("start_time"); + boolean administrator = this.sysUserService.isAdministrator(); + if(!administrator){ + this.lawsTechnologyEvaluationEOService.createQueryPermission(queryWrapper,lawsTechnologyEvaluationEO,administrator); + } Page page = new Page(pageNo, pageSize); IPage pageList = lawsTechnologyEvaluationEOService.page(page, queryWrapper); this.lawsTechnologyEvaluationEOService.disposeData(pageList.getRecords(),cut); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/entity/LawsTechnologyEvaluationEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/entity/LawsTechnologyEvaluationEO.java index 37a7d210f..5cb9f2248 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/entity/LawsTechnologyEvaluationEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/entity/LawsTechnologyEvaluationEO.java @@ -149,4 +149,7 @@ public class LawsTechnologyEvaluationEO implements Serializable { @ApiModelProperty(value = "流程编号") private String prcNum; + /**删除标识 true 可以删除,false,没有权限删除**/ + @TableField(exist = false) + private boolean deleteFlag = false; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/ILawsTechnologyEvaluationEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/ILawsTechnologyEvaluationEOService.java index b2bad56ff..83138cd5f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/ILawsTechnologyEvaluationEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/ILawsTechnologyEvaluationEOService.java @@ -1,6 +1,7 @@ package com.jero.modules.lawsTechnologyEvaluation.service; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.jero.common.api.vo.Result; import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO; @@ -92,4 +93,6 @@ public interface ILawsTechnologyEvaluationEOService extends IService batchCompleteTask(JSONObject jsonObject); + + void createQueryPermission(QueryWrapper queryWrapper, LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO,boolean administrator); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationEOServiceImpl.java index 567660c55..cefc08e86 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationEOServiceImpl.java @@ -9,6 +9,7 @@ import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.MessageTypeEnum; import com.jero.common.constant.enums.ModuleEnum; import com.jero.common.exception.JeroBootException; +import com.jero.common.system.vo.LoginUser; import com.jero.generater.modules.online.cgform.entity.OnlCgformField; import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl; import com.jero.modules.document.enums.FieldTypeEnum; @@ -39,6 +40,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.*; +import org.apache.shiro.SecurityUtils; import org.jeecg.modules.jmreport.common.constant.CommonConstant; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -229,6 +231,8 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl datas, String cut) { if(CollectionUtils.isNotEmpty(datas)){ + boolean administrator = this.sysUserService.isAdministrator(); + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); List categoryList = sysCategoryService.list(); for (LawsTechnologyEvaluationEO data : datas) { if(StringUtils.isNotEmpty(data.getEvaluationMethods())){ @@ -244,6 +248,9 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl().success("手动结束成功!"); } + @Override + public void createQueryPermission(QueryWrapper queryWrapper, LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO,boolean administrator) { + if(!administrator){ + //如果不是超级管理员,获取自己创建的和所有参与过的法规技术评估数据。 + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + + QueryWrapper flowDetailQueryWrap = new QueryWrapper<>(); + flowDetailQueryWrap.lambda().eq(LawsTechnologyEvaluationFlowDetailEO::getEvaluatorId,currentUser.getId()); + List flowDetailEOList = this.lawsTechnologyEvaluationFlowDetailEOService.list(flowDetailQueryWrap); + if(CollectionUtils.isNotEmpty(flowDetailEOList)){ + List lawsTechnologyEvaluationIdList = flowDetailEOList.stream().map(LawsTechnologyEvaluationFlowDetailEO::getLawsTechnologyEvaluationId).distinct().collect(Collectors.toList()); + queryWrapper.and(query -> { + query.eq("create_by",currentUser.getUsername()); + query.or(q -> { + for (String lawsTechnologyEvaluationId : lawsTechnologyEvaluationIdList) { + q.or().like("id",lawsTechnologyEvaluationId); + } + }); + }); + } + } + } + private String getTreeName(String cut, List categoryList, List technologyTerritoryList) { StringBuilder sb = new StringBuilder(); for (String technologyTerritory : technologyTerritoryList) { @@ -752,20 +782,15 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl 100){ + if(StringUtils.equals(cut,CutEnum.CN.getValue())){ + errorMsg += "条款名称长度不能超过100;"; + }else if (StringUtils.equals(cut,CutEnum.EN.getValue())){ + errorMsg += "Item Name length of the cannot exceed 100;"; + } + countError++; } - countError++; - }else if(itemName.length() > 100){ - if(StringUtils.equals(cut,CutEnum.CN.getValue())){ - errorMsg += "条款名称长度不能超过100;"; - }else if (StringUtils.equals(cut,CutEnum.EN.getValue())){ - errorMsg += "Item Name length of the cannot exceed 100;"; - } - countError++; } if(StringUtils.isEmpty(itemContent)){ diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java index 177e76a01..8664dec9c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java @@ -255,6 +255,14 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl public void exportZip(HttpServletResponse response, HttpServletRequest request, LawsTechnologyEvaluationItemResultEO lawsTechnologyEvaluationItemResultEO, Map params) { String ids = (String)params.get("ids"); String cut = (String)params.get("cut"); + String serialNumber = (String)params.get("serialNumber"); + if(StringUtils.isEmpty(serialNumber)){ + if(StringUtils.equals(cut,CutEnum.CN.getValue())){ + throw new JeroBootException("编号为空,请检查!"); + }else if(StringUtils.equals(cut,CutEnum.EN.getValue())){ + throw new JeroBootException("The serialNumber is empty, please check!"); + } + } QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationItemResultEO, request.getParameterMap()); if(StringUtils.isNotEmpty(ids)){ List idList = Arrays.asList(ids.split(",")); @@ -267,10 +275,10 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl String fileName = ""; if(StringUtils.equals(cut, CutEnum.CN.getValue())){ title = "条款号,条款名称,条款内容,评估人,评估方式,技术文件名称,章节,符合性结果,意见,附件,反馈时间"; - fileName = "条款评估结果" + ".xls"; + fileName = serialNumber + " 条款评估结果" + ".xls"; }else if(StringUtils.equals(cut,CutEnum.EN.getValue())){ title = "Item No.,Item Name,Item Content,Assessor,Evaluation method,Name of technical document,Chapter,Compliance Results,Opinion,Enclosure,Feedback Time"; - fileName = "Item Evaluation results" + ".xls"; + fileName = serialNumber + " Item Evaluation results" + ".xls"; } OutputStream os = null; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/ProblemKnowledgeBaseEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/ProblemKnowledgeBaseEOController.java index ec31393a5..3ab0e2c98 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/ProblemKnowledgeBaseEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/controller/ProblemKnowledgeBaseEOController.java @@ -13,6 +13,7 @@ import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseEOServ 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.modules.system.service.ISysUserService; import lombok.extern.slf4j.Slf4j; import com.jero.common.system.base.controller.JeroController; import org.springframework.beans.factory.annotation.Autowired; @@ -37,6 +38,8 @@ import com.jero.common.aspect.annotation.AutoLog; public class ProblemKnowledgeBaseEOController extends JeroController { @Autowired private IProblemKnowledgeBaseEOService problemKnowledgeBaseEOService; + @Autowired + private ISysUserService sysUserService; /** * 分页列表查询 @@ -54,6 +57,11 @@ public class ProblemKnowledgeBaseEOController extends JeroController queryWrapper = QueryGenerator.initQueryWrapper(problemKnowledgeBaseEO, req.getParameterMap()); this.problemKnowledgeBaseEOService.createQueryPermission(queryWrapper,problemKnowledgeBaseEO); queryWrapper.orderByDesc("create_time"); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/entity/ProblemKnowledgeBaseEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/entity/ProblemKnowledgeBaseEO.java index 870abb198..81caaff2c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/entity/ProblemKnowledgeBaseEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/entity/ProblemKnowledgeBaseEO.java @@ -1,6 +1,7 @@ package com.jero.modules.problemKnowledgeBase.entity; import java.io.Serializable; +import java.util.Date; import java.util.List; import com.baomidou.mybatisplus.annotation.IdType; @@ -156,7 +157,7 @@ public class ProblemKnowledgeBaseEO implements Serializable { /**发布日期*/ @Excel(name = "发布日期", width = 15) @ApiModelProperty(value = "发布日期") - private java.lang.String releaseTime; + private Date releaseTime; /**点赞总数量*/ @TableField(exist = false) @@ -195,4 +196,9 @@ public class ProblemKnowledgeBaseEO implements Serializable { /**附件展示数组*/ @TableField(exist = false) private List accessoryFileNameList; + + /**发布状态*/ + @Excel(name = "发布状态", width = 15) + @ApiModelProperty(value = "发布状态") + private String releaseStatus; } 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 a1e1f7bd9..9ab7619ea 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 @@ -24,6 +24,7 @@ import com.jero.modules.oss.service.IOSSFileService; import com.jero.modules.problemKnowledgeBase.entity.*; import com.jero.modules.problemKnowledgeBase.enums.CollectStatusEnum; import com.jero.modules.problemKnowledgeBase.enums.PraiseStatusEnum; +import com.jero.modules.problemKnowledgeBase.enums.ReleaseStatusEnum; import com.jero.modules.problemKnowledgeBase.enums.ShowPermissionsEnum; import com.jero.modules.problemKnowledgeBase.mapper.ProblemKnowledgeBaseEOMapper; import com.jero.modules.problemKnowledgeBase.service.*; @@ -114,17 +115,19 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl queryWrapper,ProblemKnowledgeBaseEO problemKnowledgeBaseEO) { /** - * 查询权限 - * 公开:所有人都可以看到。 - * 私密:只有配置了的权限用户可以看到。 + * 2022-10-13增加权限,超级管理员可以看到所有的问题知识库数据。 */ - LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - QueryWrapper userPermissionQueryWrapper = new QueryWrapper<>(); - userPermissionQueryWrapper.lambda().eq(ProblemKnowledgeBaseUserEO::getUserId,currentUser.getId()); - List problemKnowledgeBaseUserEOList = problemKnowledgeBaseUserEOService.list(userPermissionQueryWrapper); + boolean administrator = this.sysUserService.isAdministrator(); + if(!administrator){ + /** + * 查询权限 + * 公开:所有人都可以看到。 + * 私密:只有配置了的权限用户可以看到。 + */ + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + QueryWrapper userPermissionQueryWrapper = new QueryWrapper<>(); + userPermissionQueryWrapper.lambda().eq(ProblemKnowledgeBaseUserEO::getUserId,currentUser.getId()); + List problemKnowledgeBaseUserEOList = problemKnowledgeBaseUserEOService.list(userPermissionQueryWrapper); - List problemKnowledgeBaseIdList = problemKnowledgeBaseUserEOList.stream().map(ProblemKnowledgeBaseUserEO::getProblemKnowledgeBaseId).distinct().collect(Collectors.toList()); + List problemKnowledgeBaseIdList = problemKnowledgeBaseUserEOList.stream().map(ProblemKnowledgeBaseUserEO::getProblemKnowledgeBaseId).distinct().collect(Collectors.toList()); - queryWrapper.lambda().and(query -> { - query.eq(ProblemKnowledgeBaseEO::getShowPermissions,ShowPermissionsEnum.OPEN.getValue()); + queryWrapper.lambda().and(query -> { + query.eq(ProblemKnowledgeBaseEO::getShowPermissions,ShowPermissionsEnum.OPEN.getValue()); if(CollectionUtils.isNotEmpty(problemKnowledgeBaseIdList)){ query.or(o -> { o.eq(ProblemKnowledgeBaseEO::getShowPermissions,ShowPermissionsEnum.PRIVACY.getValue()); o.in(ProblemKnowledgeBaseEO::getId,problemKnowledgeBaseIdList); }); } - }); + }); + } String searchStr = problemKnowledgeBaseEO.getSearchStr(); if(StringUtils.isNotEmpty(searchStr)){ diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectRelatedPersonnelServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectRelatedPersonnelServiceImpl.java index 12b491960..9127a8e3b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectRelatedPersonnelServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectRelatedPersonnelServiceImpl.java @@ -14,9 +14,11 @@ import com.jero.common.util.RedisUtil; import com.jero.common.util.TokenUtils; import com.jero.modules.dummy.service.impl.DummyInventoryInfoEOServiceImpl; import com.jero.modules.enums.DictCodeEnum; +import com.jero.modules.ocr.entity.User; import com.jero.modules.project.entity.ProjectLibraryBase; import com.jero.modules.project.entity.ProjectRelatedPersonnel; import com.jero.modules.project.enums.ProjectInventoryFieldEnum; +import com.jero.modules.project.enums.ProjectRoleEnum; import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper; import com.jero.modules.project.service.IProjectRelatedPersonnelService; import com.jero.modules.system.entity.SysDictItem; @@ -967,6 +969,11 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl oppositeDisposeData(List records, String projectId, String cut) { + //查询所有的用户 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.select(SysUser::getUsername,SysUser::getId); + List userList = sysUserService.list(wrapper); + Result result = new Result<>(); int row=3; StringBuilder message = new StringBuilder(); @@ -1021,15 +1028,18 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl lawEngineerNameList = Arrays.asList(projectRelatedPersonnel.getLawEngineerName().split(",")); if (CollectionUtils.isNotEmpty(lawEngineerNameList) && StringUtils.isNotBlank(lawEngineerNameList.get(0))) { lawEngineerNameList = lawEngineerNameList.stream().distinct().collect(Collectors.toList()); - lawEngineerUsers=sysUserService.queryUserIdListByNameList(lawEngineerNameList); - if(lawEngineerUsers.size()!=lawEngineerNameList.size()){ - //中英切换提示语 - if(CutEnum.CN.getValue().equals(cut)) { - message.append("导入的法规工程师姓名有误,请检查第" + row + "行"); - }else{ - message.append("The imported law engineer is wrong.Please check line " + row ); - } - } + //验证导入的相关人员 + lawEngineerUsers = personnelMatch(userList, lawEngineerNameList, message, ProjectRoleEnum.REGULATI_ENGINEER.getValue(), cut, row); + +// lawEngineerUsers=sysUserService.queryUserIdListByNameList(lawEngineerNameList); +// if(lawEngineerUsers.size()!=lawEngineerNameList.size()){ +// //中英切换提示语 +// if(CutEnum.CN.getValue().equals(cut)) { +// message.append("导入的法规工程师姓名有误,请检查第" + row + "行"); +// }else{ +// message.append("The imported law engineer is wrong.Please check line " + row ); +// } +// } } if(CollectionUtils.isNotEmpty(lawEngineerUsers)) { @@ -1055,15 +1065,18 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl engineeringInterfacePersonNameList = Arrays.asList(projectRelatedPersonnel.getEngineeringInterfacePersonName().split(",")); if (CollectionUtils.isNotEmpty(engineeringInterfacePersonNameList) && StringUtils.isNotBlank(engineeringInterfacePersonNameList.get(0))) { engineeringInterfacePersonNameList = engineeringInterfacePersonNameList.stream().distinct().collect(Collectors.toList()); - engineeringInterfacePersonUsers=sysUserService.queryUserIdListByNameList(engineeringInterfacePersonNameList); - if(engineeringInterfacePersonUsers.size()!=engineeringInterfacePersonNameList.size()){ - //中英切换提示语 - if(CutEnum.CN.getValue().equals(cut)) { - message.append("导入的工程接口人姓名有误,请检查第" + row + "行"); - }else{ - message.append("The imported engineering interface person is wrong.Please check line " + row ); - } - } + //验证导入的相关人员 + engineeringInterfacePersonUsers = personnelMatch(userList, engineeringInterfacePersonNameList, message, ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue(), cut, row); + +// engineeringInterfacePersonUsers=sysUserService.queryUserIdListByNameList(engineeringInterfacePersonNameList); +// if(engineeringInterfacePersonUsers.size()!=engineeringInterfacePersonNameList.size()){ +// //中英切换提示语 +// if(CutEnum.CN.getValue().equals(cut)) { +// message.append("导入的工程接口人姓名有误,请检查第" + row + "行"); +// }else{ +// message.append("The imported engineering interface person is wrong.Please check line " + row ); +// } +// } } if(CollectionUtils.isNotEmpty(engineeringInterfacePersonUsers)) { @@ -1090,8 +1103,13 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl baseCertificationEngineerList = queryCertificationEngineer(projectId); List baseCertificationEngineerNameList = baseCertificationEngineerList.stream().map(e -> e.getCertificationEngineerName()).collect(Collectors.toList()); + //转为小写后在判断 + List baseCertificationEngineerNameListTemp = new ArrayList<>(); + for (String s : baseCertificationEngineerNameList) { + baseCertificationEngineerNameListTemp.add(s.toLowerCase()); + } for(String certificationEngineerName : certificationEngineerNameList){ - if(!baseCertificationEngineerNameList.contains(certificationEngineerName)){ + if(!baseCertificationEngineerNameListTemp.contains(certificationEngineerName.toLowerCase())){ //中英切换提示语 if(CutEnum.CN.getValue().equals(cut)) { message.append("导入的认证工程师姓名不属于该项目,请检查第" + row + "行"); @@ -1101,18 +1119,32 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl personnelMatch(List userList, + List personnelList, + StringBuilder message, + String personnelType, + String cut, + int row){ + int count = 0; + //全部转为小写来匹配 + List sysUserList = new ArrayList<>(); + for (String personnel : personnelList) { + String personnelLower = personnel.toLowerCase(); + for (SysUser sysUser : userList) { + String username = sysUser.getUsername(); + String usernameLower = username.toLowerCase(); + if(personnelLower.equals(usernameLower)){ + sysUserList.add(sysUser); + count ++; + } + } + } + if(personnelList.size() != count){ + //法规工程师异常提示语 + if(ProjectRoleEnum.REGULATI_ENGINEER.getValue().equals(personnelType)){ + if(CutEnum.CN.getValue().equals(cut)) { + message.append("导入的工程接口人姓名有误,请检查第" + row + "行"); + }else{ + message.append("The imported engineering interface person is wrong.Please check line " + row ); + } + } + //认证工程师异常提示语 + if(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue().equals(personnelType)){ + if(CutEnum.CN.getValue().equals(cut)) { + message.append("导入的认证工程师姓名有误,请检查第" + row + "行"); + }else { + message.append("The imported certification engineer is wrong.Please check line " + row ); + } + } + //工程接口人异常提示语 + if(ProjectRoleEnum.ENGINEERING_INTERFACE_PERSON.getValue().equals(personnelType)){ + if(CutEnum.CN.getValue().equals(cut)) { + message.append("导入的工程接口人姓名有误,请检查第" + row + "行"); + }else{ + message.append("The imported engineering interface person is wrong.Please check line " + row ); + } + } + }else{ + return sysUserList; + } + return new ArrayList<>(); + } + @Override public ProjectRelatedPersonnel queryByProjectIdAndDutyTerritory(String projectId, String dutyTerritory) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/util/WordUtil.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/util/WordUtil.java index b492d8057..e21195135 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/util/WordUtil.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/util/WordUtil.java @@ -189,7 +189,7 @@ public class WordUtil { Drawing drawing = factory.createDrawing(); drawing.getAnchorOrInline().add(inline); run.getContent().add(drawing); - replaceTextToImage(bm, text, wordMLPackage, bytes); + replaceTextToImage(bm, "\\$\\{" + key + "\\}", text, wordMLPackage, bytes); } } } catch (Exception var17) { @@ -218,7 +218,7 @@ public class WordUtil { byte[] bytes = (byte[]) picMap.get("bytes"); for(Text bm : textList) { - if (bm.getValue().equals("${" + key + "}")) { + if (bm.getValue().contains("${" + key + "}")) { BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(wordMLPackage, bytes); Inline inline = imagePart.createImageInline("", "", 0, 1, true); ObjectFactory factory = new ObjectFactory(); @@ -226,7 +226,7 @@ public class WordUtil { Drawing drawing = factory.createDrawing(); drawing.getAnchorOrInline().add(inline); run.getContent().add(drawing); - replaceTextToImage(bm, text, wordMLPackage, bytes); + replaceTextToImage(bm, "\\$\\{" + key + "\\}", text, wordMLPackage, bytes); } } } @@ -387,7 +387,7 @@ public class WordUtil { * @throws Exception * @author liyawei */ - public static void replaceTextToImage(Text bm, Object object, WordprocessingMLPackage wordMLPackage , byte[] bytes) throws Exception { + public static void replaceTextToImage(Text bm, String key, Object object, WordprocessingMLPackage wordMLPackage , byte[] bytes) throws Exception { if (wordMLPackage == null) { return; } @@ -423,16 +423,49 @@ public class WordUtil { BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(wordMLPackage, bytes); Inline inline = imagePart.createImageInline("", "", 0, 1, true); ObjectFactory factory = Context.getWmlObjectFactory(); - R run = factory.createR(); +// R run = factory.createR(); Drawing drawing = factory.createDrawing(); - if(text != null){ - Text txt = factory.createText(); - txt.setValue(text); - run.getContent().add(txt); + + for(int j=0;j0 && !valueStr[k-1].equals("#")) { + Text txt = factory.createText(); + txt.setValue(values.substring(index, k)); + r.getContent().add(txt); + } + + if (text != null) { + Text txtp = factory.createText(); + txtp.setValue(text); + r.getContent().add(txtp); + } + r.getContent().add(drawing); + drawing.getAnchorOrInline().add(inline); + index = k + 1; + } + + } + + if(!values.endsWith("#")) { + Text txt = factory.createText(); + txt.setValue(values.substring(index)); + r.getContent().add(txt); + } + + theList.add(rangeStart, r); // 添加图片到原占位符位置 } else { return; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportWriteEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportWriteEOController.java index e4fb26d4e..b47ddcb11 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportWriteEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/controller/LawsMonthlyReportWriteEOController.java @@ -1,6 +1,7 @@ package com.jero.modules.report.controller; 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; @@ -62,9 +63,29 @@ public class LawsMonthlyReportWriteEOController extends JeroController pageList = lawsMonthlyReportWriteEOService.getPageInfo(lawsMonthlyReportWriteEO, pageNo,pageSize,req); - return Result.OK(pageList); + List listInfo = lawsMonthlyReportWriteEOService.getListInfo(lawsMonthlyReportWriteEO, pageNo, pageSize, req); + Page pages = lawsMonthlyReportWriteEOService.getPages(pageNo, pageSize, listInfo); + return Result.OK(pages); } +// /** +// * 分页列表查询 +// * +// * @param lawsMonthlyReportWriteEO +// * @param pageNo +// * @param pageSize +// * @param req +// * @return +// */ +// @AutoLog(value = "月报填写-分页列表查询") +// @ApiOperation(value="月报填写-分页列表查询", notes="月报填写-分页列表查询") +// @GetMapping(value = "/page") +// public Result queryPageList(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO, +// @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, +// @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, +// HttpServletRequest req) { +// IPage pageList = lawsMonthlyReportWriteEOService.getPageInfo(lawsMonthlyReportWriteEO, pageNo,pageSize,req); +// return Result.OK(pageList); +// } /** * 列表查询 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportTitleTemplateEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportTitleTemplateEO.java index 4a66c3f86..9bd5daf0f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportTitleTemplateEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportTitleTemplateEO.java @@ -13,7 +13,6 @@ import lombok.experimental.Accessors; import org.jeecgframework.poi.excel.annotation.Excel; import org.springframework.format.annotation.DateTimeFormat; -import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -29,7 +28,7 @@ import java.util.List; @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) @ApiModel(value="laws_monthly_report_title_template对象", description="月报标题模板") -public class LawsMonthlyReportTitleTemplateEO implements Serializable { +public class LawsMonthlyReportTitleTemplateEO implements Comparable { private static final long serialVersionUID = 1L; /**主键*/ @@ -84,4 +83,10 @@ public class LawsMonthlyReportTitleTemplateEO implements Serializable { @TableField(exist = false) private String key; + + @Override + public int compareTo(LawsMonthlyReportTitleTemplateEO o) { + return this.sort-o.sort;//升序 +// return o.id-this.id;//降序 + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportWriteEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportWriteEO.java index 2563e41b4..11892a582 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportWriteEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/entity/LawsMonthlyReportWriteEO.java @@ -116,7 +116,7 @@ public class LawsMonthlyReportWriteEO implements Serializable { /**适用范围*/ @Excel(name = "适用范围", width = 15) @ApiModelProperty(value = "适用范围") - @Dict(dicCode ="apply_scope") + @Dict(dicCode ="fa3_gui1_yue4_bao4_-_shi4_yong4_fan4_wei2") private java.lang.String applyScope; /**状态*/ diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/enums/DictCodeReportEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/enums/DictCodeReportEnum.java index 7aea0d69d..5e6d09401 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/enums/DictCodeReportEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/enums/DictCodeReportEnum.java @@ -8,7 +8,7 @@ package com.jero.modules.report.enums; */ public enum DictCodeReportEnum { APPLYCAR("适用车型","car_type"), - APPLYSCOPE("适用范围","apply_scope"), + APPLYSCOPE("适用范围","fa3_gui1_yue4_bao4_-_shi4_yong4_fan4_wei2"), STATE("状态","state"), USEMETHOD("用法","yong4_fa3"); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/enums/ExportStateEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/enums/ExportStateEnum.java index b4802d3f1..b9f7a4598 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/enums/ExportStateEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/enums/ExportStateEnum.java @@ -7,8 +7,8 @@ package com.jero.modules.report.enums; * @auth zhn */ public enum ExportStateEnum { - NOT_EXPORT("未导出","Not export","1"), - HAS_BEEN_EXPORT("已导出","Has been export","2"); + NOT_EXPORT("未导出","Not exported","1"), + HAS_BEEN_EXPORT("已导出","Exported","2"); String name; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportWriteEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportWriteEOService.java index 2f653b1b2..9bcf996c6 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportWriteEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/ILawsMonthlyReportWriteEOService.java @@ -1,6 +1,7 @@ package com.jero.modules.report.service; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.jero.modules.report.entity.LawsMonthlyReportWriteEO; @@ -72,7 +73,11 @@ public interface ILawsMonthlyReportWriteEOService extends IService getPageInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO, +// IPage getPageInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO, +// Integer pageNo, +// Integer pageSize, +// HttpServletRequest req); + List getListInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO, Integer pageNo, Integer pageSize, HttpServletRequest req); @@ -82,4 +87,6 @@ public interface ILawsMonthlyReportWriteEOService extends IService parameter); + + Page getPages(Integer currentPage, Integer pageSize, List list); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/impl/LawsMonthlyReportWriteEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/impl/LawsMonthlyReportWriteEOServiceImpl.java index c309c19a3..cb571424d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/impl/LawsMonthlyReportWriteEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/service/impl/LawsMonthlyReportWriteEOServiceImpl.java @@ -60,8 +60,10 @@ import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.Date; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -288,7 +290,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl getPageInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEOTemp, + public List getListInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEOTemp, Integer pageNo, Integer pageSize, HttpServletRequest req) { @@ -300,11 +302,48 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl page = new Page(pageNo, pageSize); - Page pageInfo = this.page(page, queryWrapper); +// Page page = new Page(pageNo, pageSize); +// Page pageInfo = this.page(page, queryWrapper); + + + //所有的月报 + List lawsMonthlyReportWriteEOList = this.list(queryWrapper); + //所有月报的一级目录 + List oneMenuIdLIst = lawsMonthlyReportWriteEOList.stream().map(LawsMonthlyReportWriteEO::getMemoriesChapterOne).distinct().collect(Collectors.toList()); + //月报标题模板 + LambdaQueryWrapper wrapperTemp = new LambdaQueryWrapper<>(); + wrapperTemp.orderByAsc(LawsMonthlyReportTitleTemplateEO::getSort); + List list = lawsMonthlyReportTitleTemplateEOService.list(wrapperTemp); + //1. 一级目录 + List oneList = list.stream().filter(e -> StringUtils.isBlank(e.getParentId())).collect(Collectors.toList()); + oneList = oneList.stream().filter(e -> oneMenuIdLIst.contains(e.getId())).collect(Collectors.toList()); + Collections.sort(oneList);//正序排序 + + List lawsMonthlyReportWriteEOS = new LinkedList<>(); + for (LawsMonthlyReportTitleTemplateEO lawsMonthlyReportTitleTemplateEO : oneList) { + String oneId = lawsMonthlyReportTitleTemplateEO.getId(); + //一级目录下的二级目录 + List twoList = list.stream().filter(e -> StringUtils.isNotBlank(e.getParentId()) && oneId.equals(e.getParentId())).collect(Collectors.toList()); + Collections.sort(twoList);//正序排序 + + //一级目录下的月报 + for (LawsMonthlyReportTitleTemplateEO monthlyReportTitleTemplateEO : twoList) { + for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : lawsMonthlyReportWriteEOList) { + if(oneId.equals(lawsMonthlyReportWriteEO.getMemoriesChapterOne()) && monthlyReportTitleTemplateEO.getId().equals(lawsMonthlyReportWriteEO.getMemoriesChapter())){ + lawsMonthlyReportWriteEOS.add(lawsMonthlyReportWriteEO); + } + } + } + +// List lawsMonthlyReportWriteEOListOne = lawsMonthlyReportWriteEOList.stream() +// .filter(e -> oneId.equals(e.getMemoriesChapterOne())).collect(Collectors.toList()); +// lawsMonthlyReportWriteEOS.addAll(lawsMonthlyReportWriteEOListOne); + } + + //法规月报id - List lawsMonthlyReportIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getId).collect(Collectors.toList()); - List userIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getLawsContact).collect(Collectors.toList()); + List lawsMonthlyReportIdList = lawsMonthlyReportWriteEOS.stream().map(LawsMonthlyReportWriteEO::getId).collect(Collectors.toList()); + List userIdList = lawsMonthlyReportWriteEOS.stream().map(LawsMonthlyReportWriteEO::getLawsContact).collect(Collectors.toList()); List userIds = new ArrayList<>(); for (String s : userIdList) { if(StringUtils.isNotBlank(s)){ @@ -343,7 +382,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl getPageInfo(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEOTemp, +// Integer pageNo, +// Integer pageSize, +// HttpServletRequest req) { +// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(lawsMonthlyReportWriteEOTemp, req.getParameterMap()); +// queryWrapper.orderByDesc("memories_chapter_one","memories_chapter","create_time"); +// //管理员查看全部数据,其余人只能查看自己的数据 +// LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); +// List rolesList = sysBaseApi.getRolesByUsername(currentUser.getUsername()); +// if(!rolesList.contains(ProjectRoleEnum.ADMIN.getCode())){ +// queryWrapper.in("create_by",currentUser.getUsername()); +// } +// Page page = new Page(pageNo, pageSize); +// Page pageInfo = this.page(page, queryWrapper); +// //法规月报id +// List lawsMonthlyReportIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getId).collect(Collectors.toList()); +// List userIdList = pageInfo.getRecords().stream().map(LawsMonthlyReportWriteEO::getLawsContact).collect(Collectors.toList()); +// List userIds = new ArrayList<>(); +// for (String s : userIdList) { +// if(StringUtils.isNotBlank(s)){ +// if(s.contains(",")){ +// userIds.addAll(Arrays.asList(s.split(","))); +// }else{ +// userIds.add(s); +// } +// } +// } +// List jsonObjects = sysBaseApi.queryUsersByIds(StringUtils.join(userIds, ",")); +// List userList = new ArrayList<>(); +// for (JSONObject jsonObject : jsonObjects) { +// LoginUser loginUser = JSONObject.parseObject(jsonObject.toJSONString(), LoginUser.class); +// userList.add(loginUser); +// } +// +// //获取章节目录 +// List lawsMonthlyReportTitleTemplateEOList = lawsMonthlyReportTitleTemplateEOService.list(); +// +// //新征求意见清单模板 +// List newOpinionTemplateEOList = new ArrayList<>(); +// if(lawsMonthlyReportIdList.size() != 0){ +// LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); +// wrapper.in(NewOpinionTemplateEO::getLawsMonthlyReportWriteId,lawsMonthlyReportIdList); +// newOpinionTemplateEOList = iNewOpinionTemplateEOService.list(wrapper); +// } +// +// +// //新发布标准清单模板 +// List newStandardTemplateEOList = new ArrayList<>(); +// if(lawsMonthlyReportIdList.size() != 0){ +// LambdaQueryWrapper qrapperTemp = new LambdaQueryWrapper<>(); +// qrapperTemp.in(NewStandardTemplateEO::getLawsMonthlyReportWriteId,lawsMonthlyReportIdList); +// newStandardTemplateEOList = iNewStandardTemplateEOService.list(qrapperTemp); +// } +// +// +// for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : pageInfo.getRecords()) { +// //处理法规联系人 +// lawsContact(userList, lawsMonthlyReportWriteEO,lawsMonthlyReportWriteEOTemp.getCut()); +// //处理章节目录 +// if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getMemoriesChapter())){ +// List lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOList.stream() +// .filter(e -> lawsMonthlyReportWriteEO.getMemoriesChapter().equals(e.getId())).collect(Collectors.toList()); +// if(CutEnum.CN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut()) && lawsMonthlyReportTitleTemplateEOS.size() != 0){ +// lawsMonthlyReportWriteEO.setMemoriesChapterName(lawsMonthlyReportTitleTemplateEOS.get(0).getTitleCn()); +// }else if(CutEnum.EN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut()) && lawsMonthlyReportTitleTemplateEOS.size() != 0){ +// lawsMonthlyReportWriteEO.setMemoriesChapterName(lawsMonthlyReportTitleTemplateEOS.get(0).getTitleEn()); +// } +// } +// //处理章节目录对应的一级目录 +// if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getMemoriesChapterOne())){ +// List lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOList.stream() +// .filter(e -> lawsMonthlyReportWriteEO.getMemoriesChapterOne().equals(e.getId())).collect(Collectors.toList()); +// if(CutEnum.CN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut()) && lawsMonthlyReportTitleTemplateEOS.size() != 0){ +// lawsMonthlyReportWriteEO.setMemoriesChapterOneName(lawsMonthlyReportTitleTemplateEOS.get(0).getTitleCn()); +// }else if(CutEnum.EN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut()) && lawsMonthlyReportTitleTemplateEOS.size() != 0){ +// lawsMonthlyReportWriteEO.setMemoriesChapterOneName(lawsMonthlyReportTitleTemplateEOS.get(0).getTitleEn()); +// } +// } +// +// if(ContentTemplateEnum.NEW_REQUEST_LIST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){ +// //新征求意见清单模板 +// List collect = newOpinionTemplateEOList.stream() +// .filter(e -> lawsMonthlyReportWriteEO.getId().equals(e.getLawsMonthlyReportWriteId())).collect(Collectors.toList()); +// lawsMonthlyReportWriteEO.setNewOpinionTemplateEOList(collect); +// +// }else if(ContentTemplateEnum.NEW_RELEASE_STANDARD_MANIFEST_TEMPLATE.getValue().equals(lawsMonthlyReportWriteEO.getContentTemplate())){ +// //新发布标准清单模板 +// List collect = newStandardTemplateEOList.stream() +// .filter(e -> lawsMonthlyReportWriteEO.getId().equals(e.getLawsMonthlyReportWriteId())).collect(Collectors.toList()); +// lawsMonthlyReportWriteEO.setNewStandardTemplateEOList(collect); +// } +// +// //处理导出状态 +// String exportState = lawsMonthlyReportWriteEO.getExportState(); +// if(StringUtils.isNotBlank(exportState)){ +// if(ExportStateEnum.NOT_EXPORT.getValue().equals(exportState)){ +// if(CutEnum.CN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut())){ +// lawsMonthlyReportWriteEO.setExportStateName(ExportStateEnum.NOT_EXPORT.getName()); +// }else{ +// lawsMonthlyReportWriteEO.setExportStateName(ExportStateEnum.NOT_EXPORT.getNameEn()); +// } +// }else if(ExportStateEnum.HAS_BEEN_EXPORT.getValue().equals(exportState)){ +// if(CutEnum.CN.getValue().equals(lawsMonthlyReportWriteEOTemp.getCut())){ +// lawsMonthlyReportWriteEO.setExportStateName(ExportStateEnum.HAS_BEEN_EXPORT.getName()); +// }else{ +// lawsMonthlyReportWriteEO.setExportStateName(ExportStateEnum.HAS_BEEN_EXPORT.getNameEn()); +// } +// } +// } +// } +// return pageInfo; +// } private void lawsContact(List userList, LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO,String cut) { String lawsContact = lawsMonthlyReportWriteEO.getLawsContact(); @@ -873,38 +1025,221 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl lawsMonthlyReportWriteEOS, String titleCN, XWPFDocument document) { //封面标识 String flag = "cover"; String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月"; + //标题前面添加一个换行 + WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null, + false, false, "Blue Sky Noto Regular",null,null,"break"); - titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"; + //添加标题 WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18, false, false, "Blue Sky Noto Regular",null,null,flag); - WordUtil.exportWord(document, moth+"\r\n", null, ParagraphAlignment.CENTER, 0, 12, - false, true, "Blue Sky Noto Regular",null,null,flag); + + //标题下面添加9个换行 + for (int i = 0; i < 9; i++) { + WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null, + false, false, "Blue Sky Noto Regular",null,null,"break"); + } + WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12, + false, false, "Blue Sky Noto Regular",null,null,flag); + + String year = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[0]; + String mothNew = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[1]; + int mothLast = Integer.valueOf(mothNew) + 1; + + //添加说明 2022/7/15 至 2022/8/14 期间发布的主要内容 + String text = year + "/" + mothNew +"/15 至 "+year+"/"+mothLast+"/14期间发布的主要内容"; + WordUtil.exportWord(document, text, null, ParagraphAlignment.CENTER, 0, 11, + false, false, "Blue Sky Noto Regular",null,null,flag); + + //添加换行 + WordUtil.exportWord(document, "\r\n", null, ParagraphAlignment.CENTER, 0, null, + false, false, null,null,null,flag); + + //添加说明 编辑: 整车工程 - 法规与认证&环保与材料科团队 + String text1 = "编辑: 整车工程 - 法规与认证&环保与材料科团队"; + WordUtil.exportWord(document, text1, null, ParagraphAlignment.CENTER, 0, 11, + false, false, "Blue Sky Noto Regular",null,null,flag); + //添加下一页 document.createParagraph().createRun().addBreak(BreakType.PAGE); } - //封面 + //封面(WPS版本) +// private void coverCn(List lawsMonthlyReportWriteEOS, +// String titleCN, +// XWPFDocument document) { +// //封面标识 +// String flag = "cover"; +// String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月"; +// +// titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"; +// WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18, +// false, false, "Blue Sky Noto Regular",null,null,flag); +// WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12, +// false, false, "Blue Sky Noto Regular",null,null,flag); +// +// String year = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[0]; +// String mothNew = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[1]; +// int mothLast = Integer.valueOf(mothNew) + 1; +// +// //添加说明 2022/7/15 至 2022/8/14 期间发布的主要内容 +// String text = year + "/" + mothNew +"/15 至 "+year+"/"+mothLast+"/14期间发布的主要内容"; +// WordUtil.exportWord(document, text, null, ParagraphAlignment.CENTER, 0, 11, +// false, false, "Blue Sky Noto Regular",null,null,flag); +// +// //添加换行 +// WordUtil.exportWord(document, "\r\n", null, ParagraphAlignment.CENTER, 0, null, +// false, false, null,null,null,flag); +// +// //添加说明 编辑: 整车工程 - 法规与认证&环保与材料科团队 +// String text1 = "编辑: 整车工程 - 法规与认证&环保与材料科团队"; +// WordUtil.exportWord(document, text1, null, ParagraphAlignment.CENTER, 0, 11, +// false, false, "Blue Sky Noto Regular",null,null,flag); +// +// //添加下一页 +// document.createParagraph().createRun().addBreak(BreakType.PAGE); +// } + //封面(office版本) private void coverEn(List lawsMonthlyReportWriteEOS, String titleCN, XWPFDocument document) { //封面标识 String flag = "cover"; - String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月"; - titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"; + String year = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[0]; + String mothNew = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[1]; + int mothLast = Integer.valueOf(mothNew) + 1; + String moth = mothNew+"/"+year; + String mothNewEn = getMothEn(mothNew); + String mothLastEn = getMothEn(String.valueOf(mothLast)); + + //标题前面添加一个换行 + WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null, + false, false, "Blue Sky Noto Regular",null,null,"break"); + + //添加标题 WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18, false, false, "Blue Sky Noto Regular",null,null,flag); - WordUtil.exportWord(document, moth+"\r\n", null, ParagraphAlignment.CENTER, 0, 12, - false, true, "Blue Sky Noto Regular",null,null,flag); + //标题下面添加8个换行 + for (int i = 0; i < 8; i++) { + WordUtil.exportWord(document, "", null, ParagraphAlignment.CENTER, 0, null, + false, false, "Blue Sky Noto Regular",null,null,"break"); + } + + WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12, + false, false, "Blue Sky Noto Regular",null,null,flag); + + + + //添加说明 Update between July 15, 2022 and August 14, 2022 + String text = "Update between "+mothNewEn+" 15,"+year+" and "+mothLastEn+" 14,"+year; + WordUtil.exportWord(document, text, null, ParagraphAlignment.CENTER, 0, 11, + false, false, "Blue Sky Noto Regular",null,null,flag); + + //添加换行 + WordUtil.exportWord(document, "\r\n", null, ParagraphAlignment.CENTER, 0, null, + false, false, null,null,null,flag); + + //添加说明 编辑: 整车工程 - 法规与认证&环保与材料科团队 + String text1 = "Edit By: Regulation & Homologation, Environmental & Materials Team"; + WordUtil.exportWord(document, text1, null, ParagraphAlignment.CENTER, 0, 11, + false, false, "Blue Sky Noto Regular",null,null,flag); + //添加下一页 document.createParagraph().createRun().addBreak(BreakType.PAGE); } + //封面(WPS版本) +// private void coverEn(List lawsMonthlyReportWriteEOS, +// String titleCN, +// XWPFDocument document) { +// //封面标识 +// String flag = "cover"; +// +// String year = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[0]; +// String mothNew = lawsMonthlyReportWriteEOS.get(0).getMonth().split("-")[1]; +// int mothLast = Integer.valueOf(mothNew) + 1; +// String moth = mothNew+"/"+year; +// String mothNewEn = getMothEn(mothNew); +// String mothLastEn = getMothEn(String.valueOf(mothLast)); +// +//// String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "年") + "月"; +// +// titleCN = "\r\n\r\n" + titleCN + "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"; +// WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18, +// false, false, "Blue Sky Noto Regular",null,null,flag); +// WordUtil.exportWord(document, moth, null, ParagraphAlignment.CENTER, 0, 12, +// false, false, "Blue Sky Noto Regular",null,null,flag); +// +// +// +// //添加说明 Update between July 15, 2022 and August 14, 2022 +// String text = "Update between "+mothNewEn+" 15,"+year+" and "+mothLastEn+" 14,"+year; +// WordUtil.exportWord(document, text, null, ParagraphAlignment.CENTER, 0, 11, +// false, false, "Blue Sky Noto Regular",null,null,flag); +// +// //添加换行 +// WordUtil.exportWord(document, "\r\n", null, ParagraphAlignment.CENTER, 0, null, +// false, false, null,null,null,flag); +// +// //添加说明 编辑: 整车工程 - 法规与认证&环保与材料科团队 +// String text1 = "Edit By: Regulation & Homologation, Environmental & Materials Team"; +// WordUtil.exportWord(document, text1, null, ParagraphAlignment.CENTER, 0, 11, +// false, false, "Blue Sky Noto Regular",null,null,flag); +// +// //添加下一页 +// document.createParagraph().createRun().addBreak(BreakType.PAGE); +// } + + private String getMothEn(String moth){ + String result = ""; + switch (moth) { + // 心跳检测 + case "1": + result = "January"; + break; + case "2": + result = "February"; + break; + case "3": + result = "March"; + break; + case "4": + result = "April"; + break; + case "5": + result = "May"; + break; + case "6": + result = "June"; + break; + case "7": + result = "July"; + break; + case "8": + result = "August"; + break; + case "9": + result = "September"; + break; + case "10": + result = "October"; + break; + case "11": + result = "November"; + break; + case "12": + result = "December"; + break; + default: + break; + } + return result; + } private void wordContent(List lawsMonthlyReportWriteEOS, List lawsMonthlyReportTitleTemplateEOS, List reportTitleOneList, @@ -1179,4 +1514,32 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl list){ + Page page =new Page(); + if(list==null){ + return null; + } + int size = list.size(); + if(pageSize > size){ + pageSize = size; + } + if(pageSize!=0){ + //求出最⼤页数,防⽌currentPage越界 + int maxPage = size % pageSize ==0? size / pageSize : size / pageSize +1; + if(currentPage > maxPage){ + currentPage = maxPage; + } + } + //当前页第⼀条数据的下标 + int curIdx = currentPage >1?(currentPage -1)* pageSize :0; + List pageList =new ArrayList(); + //将当前页的数据放进pageList + for(int i =0; i < pageSize && curIdx + i < size; i++){ + pageList.add(list.get(curIdx + i)); + } + page.setCurrent(currentPage).setSize(pageSize).setTotal(list.size()).setRecords(pageList); + return page; + } + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/util/WordUtil.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/util/WordUtil.java index b74545fc0..dc18a8ca8 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/util/WordUtil.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/report/util/WordUtil.java @@ -128,6 +128,10 @@ public class WordUtil { } XWPFRun titleParagraphRun = titleParagraph.createRun(); + //封面中的换行 + if("break".equals(flag)){ + titleParagraphRun.addBreak(); + } if (isNewline) { titleParagraphRun.setText("\r"); } else { @@ -202,45 +206,7 @@ public class WordUtil { styles.addStyle(style); } -// @SneakyThrows -// public static void exportHeardAndFoot(XWPFDocument document){ -//// XWPFDocument document = new XWPFDocument(); -// -// // create header-footer -// XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy(); -// if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy(); -// -// // create header start -// XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT); -// -// XWPFParagraph paragraph = header.createParagraph(); -// paragraph.setAlignment(ParagraphAlignment.CENTER); -// -// XWPFRun run = paragraph.createRun(); -// run.setText("Header"); -// -// // create footer start -// XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT); -// -// paragraph = footer.createParagraph(); -// paragraph.setAlignment(ParagraphAlignment.CENTER); -// -// run = paragraph.createRun(); -// run.setText("Footer"); -// -// CTSectPr sectPr = document.getDocument().getBody().getSectPr(); -// if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr(); -// CTPageMar pageMar = sectPr.getPgMar(); -// if (pageMar == null) pageMar = sectPr.addNewPgMar(); -// pageMar.setLeft(BigInteger.valueOf(2000)); //720 TWentieths of an Inch Point (Twips) = 720/20 = 36 pt = 36/72 = 0.5" -// pageMar.setRight(BigInteger.valueOf(720)); -// pageMar.setTop(BigInteger.valueOf(1440)); //1440 Twips = 1440/20 = 72 pt = 72/72 = 1" -// pageMar.setBottom(BigInteger.valueOf(1440)); -// -// pageMar.setHeader(BigInteger.valueOf(2000)); //45.4 pt * 20 = 908 = 45.4 pt header from top -// pageMar.setFooter(BigInteger.valueOf(568)); //28.4 pt * 20 = 568 = 28.4 pt footer from bottom -// -// } + //主要内容生成页眉页脚(office版本) @SneakyThrows public static void exportHeardAndFoot(XWPFDocument document,String month){ XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy(); @@ -266,12 +232,15 @@ public class WordUtil { picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID); run.addTab(); is.close(); + run.setText(" "+month); + run.setFontSize(11); + run.setFontFamily("Blue Sky Noto Regular"); } //页眉第二个段落展示日期------------------------------------------------------------ XWPFParagraph paragraph = header.createParagraph();//创建新的段落 - paragraph.setAlignment(ParagraphAlignment.RIGHT);//段落文本的对齐方式 +// paragraph.setAlignment(ParagraphAlignment.RIGHT);//段落文本的对齐方式 XWPFRun run = paragraph.createRun(); - run.setText(month); +// run.setText(month); //页脚(三个段落分别展示3个内容)----------------------------------------------------- XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT); @@ -280,11 +249,15 @@ public class WordUtil { paragraph.setAlignment(ParagraphAlignment.CENTER); run = paragraph.createRun(); run.setText("NIO Internal"); + run.setFontSize(11); + run.setFontFamily("Blue Sky Standard Regular"); paragraph = footer.createParagraph(); paragraph.setAlignment(ParagraphAlignment.LEFT); run = paragraph.createRun(); run.setText("NIO.com"); + run.setFontSize(11); + run.setFontFamily("Blue Sky Noto Regular"); //生成页码--------------------------------------------------------------------- paragraph = footer.createParagraph(); @@ -306,20 +279,107 @@ public class WordUtil { CTSectPr sectPr = document.getDocument().getBody().getSectPr(); if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr(); - //设置页面大小 + //设置页面大小(21*29.7) CTPageSz pgSz = sectPr.addNewPgSz(); - pgSz.setW(BigInteger.valueOf(11907)); - pgSz.setH(BigInteger.valueOf(16840)); + pgSz.setW(BigInteger.valueOf(11905)); + pgSz.setH(BigInteger.valueOf(16838)); CTPageMar pageMar = sectPr.getPgMar(); if (pageMar == null) pageMar = sectPr.addNewPgMar(); - pageMar.setLeft(BigInteger.valueOf(1803)); //左边距 - pageMar.setRight(BigInteger.valueOf(1803));//右边距 + pageMar.setLeft(BigInteger.valueOf(1797)); //左边距 + pageMar.setRight(BigInteger.valueOf(1797));//右边距 pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度 pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度 - pageMar.setHeader(BigInteger.valueOf(500)); //页眉上边框到顶部的距离 - pageMar.setFooter(BigInteger.valueOf(800)); //页脚下边框到底部的距离 + pageMar.setHeader(BigInteger.valueOf(720)); //页眉上边框到顶部的距离 + pageMar.setFooter(BigInteger.valueOf(720)); //页脚下边框到底部的距离 } + //主要内容生成页眉页脚(WPS版本) +// @SneakyThrows +// public static void exportHeardAndFoot(XWPFDocument document,String month){ +// XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy(); +// if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy(); +// XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT); +// +//// String logoFilePath = "/jero-boot/home/weilai.png"; +// String logoFilePath = WordUtil.class.getClassLoader().getResource("static/home/weilai.png").getPath(); +// //页眉第一个段落展示logo----------------------------------------------------------------------------------- +// if (org.apache.commons.lang3.StringUtils.isNotBlank(logoFilePath)) { +// XWPFParagraph logo = header.createParagraph(); +// logo.setAlignment(ParagraphAlignment.LEFT); +// XWPFRun run = logo.createRun(); +// +// String imgFile = logoFilePath; +// InputStream is = WordUtil.class.getClassLoader().getResourceAsStream("static/home/weilai.png"); +//// InputStream is = new FileInputStream(imgFile); +// XWPFPicture picture = run.addPicture(is, XWPFDocument.PICTURE_TYPE_PNG, imgFile, Units.toEMU(95), Units.toEMU(35)); +// String blipID = ""; +// for(XWPFPictureData picturedata : header.getAllPackagePictures()) { //这段必须有,不然打开的logo图片不显示 +// blipID = header.getRelationId(picturedata); +// } +// picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID); +// run.addTab(); +// is.close(); +// run.setText(" "+month); +// run.setFontSize(11); +// run.setFontFamily("Blue Sky Noto Regular"); +// } +// //页眉第二个段落展示日期------------------------------------------------------------ +// XWPFParagraph paragraph = header.createParagraph();//创建新的段落 +//// paragraph.setAlignment(ParagraphAlignment.RIGHT);//段落文本的对齐方式 +// XWPFRun run = paragraph.createRun(); +//// run.setText(month); +// +// //页脚(三个段落分别展示3个内容)----------------------------------------------------- +// XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT); +// +// paragraph = footer.createParagraph(); +// paragraph.setAlignment(ParagraphAlignment.CENTER); +// run = paragraph.createRun(); +// run.setText("NIO Internal"); +// run.setFontSize(11); +// run.setFontFamily("Blue Sky Standard Regular"); +// +// paragraph = footer.createParagraph(); +// paragraph.setAlignment(ParagraphAlignment.LEFT); +// run = paragraph.createRun(); +// run.setText("NIO.com"); +// run.setFontSize(11); +// run.setFontFamily("Blue Sky Noto Regular"); +// +// //生成页码--------------------------------------------------------------------- +// paragraph = footer.createParagraph(); +// paragraph.setAlignment(ParagraphAlignment.RIGHT); +// run = paragraph.createRun(); +// CTFldChar fldChar = run.getCTR().addNewFldChar(); +// fldChar.setFldCharType(STFldCharType.Enum.forString("begin")); +// +// run = paragraph.createRun(); +// CTText ctText = run.getCTR().addNewInstrText(); +// ctText.setStringValue("PAGE \\* MERGEFORMAT"); +// ctText.setSpace(SpaceAttribute.Space.Enum.forString("preserve")); +// +// fldChar = run.getCTR().addNewFldChar(); +// fldChar.setFldCharType(STFldCharType.Enum.forString("end")); +// //---------------------------------------------------------------------------- +// +// +// +// CTSectPr sectPr = document.getDocument().getBody().getSectPr(); +// if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr(); +// //设置页面大小 +// CTPageSz pgSz = sectPr.addNewPgSz(); +// pgSz.setW(BigInteger.valueOf(11907)); +// pgSz.setH(BigInteger.valueOf(16840)); +// CTPageMar pageMar = sectPr.getPgMar(); +// if (pageMar == null) pageMar = sectPr.addNewPgMar(); +// pageMar.setLeft(BigInteger.valueOf(1803)); //左边距 +// pageMar.setRight(BigInteger.valueOf(1803));//右边距 +// pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度 +// pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度 +// +// pageMar.setHeader(BigInteger.valueOf(720)); //页眉上边框到顶部的距离 +// pageMar.setFooter(BigInteger.valueOf(720)); //页脚下边框到底部的距离 +// } /** * 主页面(只有页脚) @@ -349,18 +409,58 @@ public class WordUtil { if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr(); //设置页面大小 CTPageSz pgSz = sectPr.addNewPgSz(); - pgSz.setW(BigInteger.valueOf(11907)); - pgSz.setH(BigInteger.valueOf(16840)); + pgSz.setW(BigInteger.valueOf(11905)); + pgSz.setH(BigInteger.valueOf(16838)); CTPageMar pageMar = sectPr.getPgMar(); if (pageMar == null) pageMar = sectPr.addNewPgMar(); - pageMar.setLeft(BigInteger.valueOf(1803)); //左边距 - pageMar.setRight(BigInteger.valueOf(1803));//右边距 + pageMar.setLeft(BigInteger.valueOf(1797)); //左边距 + pageMar.setRight(BigInteger.valueOf(1797));//右边距 pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度 pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度 pageMar.setHeader(BigInteger.valueOf(500)); //页眉上边框到顶部的距离 pageMar.setFooter(BigInteger.valueOf(1200)); //页脚下边框到底部的距离 } +// /** +// * 主页面(只有页脚 WPS版本) +// * @param document +// * @param month +// */ +// @SneakyThrows +// public static void exportHeardAndFootMain(XWPFDocument document,String month){ +// XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy(); +// if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy(); +//// XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT); +//// XWPFParagraph paragraph = header.createParagraph();//创建新的段落 +//// XWPFRun run = paragraph.createRun(); +// +// XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT); +// XWPFParagraph paragraph = footer.createParagraph(); +// paragraph.setAlignment(ParagraphAlignment.CENTER); +// XWPFRun run = paragraph.createRun(); +// run.setText("NIO Internal"); +// run.setFontSize(18); +// run.setFontFamily("Blue Sky Standard Regular"); +//// run.setFontFamily("Blue Sky Noto Regular"); +// run.setBold(true); +// +// +// CTSectPr sectPr = document.getDocument().getBody().getSectPr(); +// if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr(); +// //设置页面大小 +// CTPageSz pgSz = sectPr.addNewPgSz(); +// pgSz.setW(BigInteger.valueOf(11907)); +// pgSz.setH(BigInteger.valueOf(16840)); +// CTPageMar pageMar = sectPr.getPgMar(); +// if (pageMar == null) pageMar = sectPr.addNewPgMar(); +// pageMar.setLeft(BigInteger.valueOf(1803)); //左边距 +// pageMar.setRight(BigInteger.valueOf(1803));//右边距 +// pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度 +// pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度 +// +// pageMar.setHeader(BigInteger.valueOf(500)); //页眉上边框到顶部的距离 +// pageMar.setFooter(BigInteger.valueOf(1200)); //页脚下边框到底部的距离 +// } /** * 导出工具示例 @@ -447,7 +547,7 @@ public class WordUtil { String applyScope = lawsMonthlyReportWriteEO.getApplyScope();//适用范围 String state = lawsMonthlyReportWriteEO.getState();//状态 String useMethod = lawsMonthlyReportWriteEO.getUseMethod();//用法 - String implementCar = lawsMonthlyReportWriteEO.getImplementCar();//实施车型 +// String implementCar = lawsMonthlyReportWriteEO.getImplementCar();//实施车型 String newCarImplementTime = lawsMonthlyReportWriteEO.getNewCarImplementTime();//新车型实施日期 String productionCarImplementTime = lawsMonthlyReportWriteEO.getProductionCarImplementTime();//在产车实施日期 String contentCn = lawsMonthlyReportWriteEO.getContentCn();//主要内容中文 @@ -456,25 +556,25 @@ public class WordUtil { String workProgressEn = lawsMonthlyReportWriteEO.getWorkProgressEn();//NIO工作进展英文 String lawsContactTemp = lawsMonthlyReportWriteEO.getLawsContact();//法规联系人 String lawsContact = getLawsContact(loginUserList, lawsContactTemp); - if(StringUtils.isNotEmpty(lawsContact)){ - List lawsContactList = Arrays.asList(lawsContact.split(",")); - if (lawsContactList.size() > 4) { - StringBuilder str = new StringBuilder(); - int count = 0; - for (String s : lawsContactList) { - str.append(s + ","); - count++; - if (count % 4 == 0) { - str.append("\n"); - } - } - if(str.toString().endsWith("\n")){ - lawsContact = str.substring(0,str.length()-2); - }else{ - lawsContact = str.substring(0,str.length()-1); - } - } - } +// if(StringUtils.isNotEmpty(lawsContact)){ +// List lawsContactList = Arrays.asList(lawsContact.split(",")); +// if (lawsContactList.size() > 4) { +// StringBuilder str = new StringBuilder(); +// int count = 0; +// for (String s : lawsContactList) { +// str.append(s + ","); +// count++; +// if (count % 4 == 0) { +// str.append("\n"); +// } +// } +// if(str.toString().endsWith("\n")){ +// lawsContact = str.substring(0,str.length()-2); +// }else{ +// lawsContact = str.substring(0,str.length()-1); +// } +// } +// } String link = lawsMonthlyReportWriteEO.getLink();//链接 String technologyTerritoryName = ""; @@ -497,7 +597,7 @@ public class WordUtil { String stateName = dictItem(sysDictItems, state,cut, DictCodeReportEnum.STATE.getValue()); String useMethodName = dictItem(sysDictItems, useMethod,cut, DictCodeReportEnum.USEMETHOD.getValue()); - XWPFTable table = document.createTable(11, 2); + XWPFTable table = document.createTable(10, 2); //表格属性 CTTblPr tablePr = table.getCTTbl().addNewTblPr(); //固定列宽(英文和数字的时候自动换行) @@ -527,19 +627,19 @@ public class WordUtil { //第5行 setCellThree(table,3, "用法",useMethodName,sysDictItems,DictCodeReportEnum.USEMETHOD.getValue()); //第6行 - setCell(table,4, "实施车型",implementCar); +// setCell(table,4, "实施车型",implementCar); //第7行 - setCell(table,5, "新车型实施日期",newCarImplementTime); + setCell(table,4, "新车型实施日期",newCarImplementTime); //第8行 - setCell(table,6, "在产车实施日期",productionCarImplementTime); + setCell(table,5, "在产车实施日期",productionCarImplementTime); //第9行 - setCell(table,7, "主要内容",contentCn); + setCell(table,6, "主要内容",contentCn); //第10行 - setCell(table,8, "NIO工作进展",workProgressCn); + setCell(table,7, "NIO工作进展",workProgressCn); //第11行 - setCell(table,9, "法规联系人",lawsContact); + setCell(table,8, "法规联系人",lawsContact); //第12行 - setCell(table,10, "链接",link); + setCell(table,9, "链接",link); }else{ //第1行 setCell(table,0, "Related Areas",technologyTerritoryName); @@ -552,19 +652,19 @@ public class WordUtil { //第5行 setCellThree(table,3,"Usage",useMethodName,sysDictItems,DictCodeReportEnum.APPLYSCOPE.getValue()); //第6行 - setCell(table,4,"Implementation Model",implementCar); +// setCell(table,4,"Implementation Model",implementCar); //第7行 - setCell(table,5,"New Type Execution Date",newCarImplementTime); + setCell(table,4,"New Type Execution Date",newCarImplementTime); //第8行 - setCell(table,6,"New Vehicle Execution Date",productionCarImplementTime); + setCell(table,5,"New Vehicle Execution Date",productionCarImplementTime); //第9行 - setCell(table,7,"Main Content",contentEn); + setCell(table,6,"Main Content",contentEn); //第10行 - setCell(table,8,"NIO Work Progress",workProgressEn); + setCell(table,7,"NIO Work Progress",workProgressEn); //第11行 - setCell(table,9,"Regulatory Contact",lawsContact); + setCell(table,8,"Regulatory Contact",lawsContact); //第12行 - setCell(table, 10,"Link",link); + setCell(table, 9,"Link",link); } // ctTblLayoutType.setType(STTblLayoutType.FIXED); @@ -1033,7 +1133,7 @@ public class WordUtil { for (String s : lawsContact.split(",")) { List loginUserList = collect.stream().filter(e -> e.getId().equals(s)).collect(Collectors.toList()); if(loginUserList.size() != 0){ - sb.append(loginUserList.get(0).getUsername()+","); + sb.append(loginUserList.get(0).getRealname()+","); } } if(com.jero.modules.system.util.StringUtils.isNotBlank(sb)){ @@ -1065,6 +1165,7 @@ public class WordUtil { ctTc.addNewP() : ctTc.getPArray(0); //getParagraph(ctP) 获取 XWPFParagraph XWPFParagraph par = cell.getParagraph(ctP); + par.setAlignment(ParagraphAlignment.LEFT); //XWPFRun 设置格式 XWPFRun run = par.createRun(); //单元格内容换行 @@ -1102,6 +1203,7 @@ public class WordUtil { ctTc.addNewP() : ctTc.getPArray(0); //getParagraph(ctP) 获取 XWPFParagraph XWPFParagraph par = cell.getParagraph(ctP); + par.setAlignment(ParagraphAlignment.LEFT); //XWPFRun 设置格式 XWPFRun run = par.createRun(); //单元格内容换行 □ ■ @@ -1129,7 +1231,7 @@ public class WordUtil { setBlank(text, run, sb, itemText); } if("Usage".equals(fieldName)){ - String itemText = "Constraint,Recommend,Installation Is Compliant"; + String itemText = "Mandatory,Voluntary,Mandatory if fitted"; setBlank(text, run, sb, itemText); } } @@ -1162,13 +1264,13 @@ public class WordUtil { String blank = ""; switch (value) { case "M": - blank = " "; + blank = " "; break; case "N": blank = "\r\n"; break; case "企业": - blank = " "; + blank = " "; break; case "整车": blank = " "; @@ -1183,10 +1285,10 @@ public class WordUtil { blank = ""; break; case "Enterprise": - blank = " "; + blank = " "; break; case "Vehicle": - blank = " "; + blank = " "; break; case "System/Parts": blank = "\r\n"; @@ -1224,13 +1326,13 @@ public class WordUtil { case "安装需符合": blank = ""; break; - case "Constraint": + case "Mandatory": blank = " "; break; - case "Recommend": + case "Voluntary": blank = " "; break; - case "Installation Is Compliant": + case "Mandatory if fitted": blank = ""; break; default: diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java index de51fcadf..b7a5cb5fa 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java @@ -576,13 +576,13 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl messageList) { - return dao.insertForeach(messageList); + // 解决一次批量插入太多 PacketTooBigException 异常 + int total = messageList.size(); + int count = 0; + int pageSum = 1; + if(total > 100) { + pageSum = total / 100; // 总页数 + if ((total % 100) > 0) { + pageSum += 1; + } + } + List subList = new ArrayList<>(); + for(int i = 0; i < pageSum; i++) { + int j = i*100+100; + if (i == pageSum -1) { + j = total; + } + subList = messageList.subList(i*100, j); + count += dao.insertForeach(subList); + } + return count; } /** diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitPdfService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitPdfService.java index 1946515db..79ddc5648 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitPdfService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitPdfService.java @@ -1784,7 +1784,7 @@ public class FileSplitPdfService { if(StringUtils.isNotBlank(preName)) { List nowStartList = fileSpiltService.getNewNowStart(preName); - List subList1 = startDigitList.subList(preNameNum, startDigitList.size()-1); + List subList1 = startDigitList.subList(preNameNum, startDigitList.size()); // 后文有一级以下的标题 for (int i = nowStartList.size() - 1; i >= 1; i--) { int index1 = subList1.indexOf(nowStartList.get(i)); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/SarFileSplitItemsValEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/SarFileSplitItemsValEOServiceImpl.java index 87e8331e3..1ab1404f2 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/SarFileSplitItemsValEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/SarFileSplitItemsValEOServiceImpl.java @@ -12,6 +12,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.List; @@ -79,8 +80,26 @@ public class SarFileSplitItemsValEOServiceImpl extends ServiceImpl itemValList) { - - return dao.insertForeach(itemValList); + // 解决一次批量插入太多 PacketTooBigException 异常 + int total = itemValList.size(); + int count = 0; + int pageSum = 1; + if(total > 100) { + pageSum = total / 100; // 总页数 + if ((total % 100) > 0) { + pageSum += 1; + } + } + List subList = new ArrayList<>(); + for(int i = 0; i < pageSum; i++) { + int j = i*100+100; + if (i == pageSum -1) { + j = total; + } + subList = itemValList.subList(i*100, j); + count += dao.insertForeach(subList); + } + return count; } } diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index c1a20eec6..fb1b870a0 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -3,11 +3,11 @@ module.exports = { account: 'User Account', EnterAccountFuzzyQuery: 'Enter Account Fuzzy Search', Gender: 'Gender', - pleaseSelect: 'Please Select', + pleaseSelect: 'Please Select ', male: 'Male', female: 'Female', RealName: 'User Name', - pleaseEnter: 'Please Enter', + pleaseEnter: 'Please Enter ', phoneNumber: 'Phone Number', query: 'Search', userStatues: 'User Status', @@ -193,8 +193,15 @@ module.exports = { OperationLog: 'Operation Log', SearchLog: 'Search Log', enterSearchKeyword: 'Please enter a search keyword', + enterSearchContent:'Please enter Search Content', + enterStandard:'Please enter Number', + entertitle:'Please enter Title', OperationType: 'Operation Type', selectOperationType: 'Please select Operation type', + selectProblemClassification:'Please select Problem Classification', + selectClassification:'Please select Classification', + selectTranslationResults:'Please select Translation results', + selectMarket:'Please select Market', RequestMethod: 'Request Method', RequestParameters: 'Request Parameters', logManagementPage: 'This is the log management page', @@ -343,8 +350,8 @@ module.exports = { standard: 'Number', title: 'Title', TextStatus: 'Text Status', - PleaseEnter: 'Please enter', - PleaseSelect: 'Please select', + PleaseEnter: 'Please enter ', + PleaseSelect: 'Please select ', PleaseEnterOrSelect: 'Please Enter Or Select', ModificationTime: 'Modification Time', ModificationContent: 'Modification Content', @@ -386,7 +393,7 @@ module.exports = { DocumentComparison: 'Doc Comparison', KnowledgeDatabase: 'Q&A Knowledge', StandardDetails: 'Standard Details', - whole: 'Whole', + whole: 'All', DocumentLibrary: 'Document Library', GeneralExportInformation: 'General export information', CustomizeExportInformation: 'Customize export information', @@ -500,7 +507,7 @@ module.exports = { ProcessName: 'Process Name', ProcessType: 'Process Type', AddProcess: 'Add Process', - RelatedItems: 'Relevant Project', + RelatedItems: 'Project', Sponsor: 'Creator', CurrentProcessor: 'Current Processor', LastProcessor: 'Last Processor', @@ -721,7 +728,7 @@ module.exports = { directoryName: 'Catalogue Name', batch: 'Batch', uploadTime: 'Upload Time', - enclosure: 'Enclosure', + enclosure: 'Attachments', // 认证 // 认证状态 timeOperation: 'You have permission to operate this button.', @@ -916,7 +923,7 @@ module.exports = { deliveryHistory: 'Delivery History', projectDeliveryRequirements: 'Project delivery requirements', personLiableConfirm: 'PersonLiable Confirm', - complianceResults: 'Compliance Results', + complianceResults: 'Feedback', noData: 'No Data', confirmOperation: 'Confirm Operation', sponsorReview: 'Sponsor Review', @@ -983,25 +990,25 @@ module.exports = { taskConfirmationResponsiblePerson: 'Task confirmation of responsible person', or: 'or', warningTime: 'Warning Time', - RegulationMonthlyManagement: 'Regulation Monthly Management', - RegulationMonthlyFill: 'Regulation Monthly Fill', - RegulationMonthlyName: 'Regulation monthly name', - monthlyLanguage: 'Monthly Language', + RegulationMonthlyManagement: 'Manage Monthly Report', + RegulationMonthlyFill: 'Fill in Monthly Report', + RegulationMonthlyName: 'Report Name', + monthlyLanguage: 'Language', releaseStatus: 'Release Status', uploadedBy: 'Uploaded By', - uploadMonthly: 'Upload Monthly', - chapterContents: 'Chapter Contents', + uploadMonthly: 'Upload Report', + chapterContents: 'Chapter', chineseTitle: 'Chinese Title', englishTitle: 'English Title', - regulatoryContact: 'Regulatory Contact', + regulatoryContact: 'Reg. Contact', exportStatus: 'Export Status', - monthlyTitleTemplate: 'Monthly Title Template', - monthlyIntegrationAndExport: 'Monthly integration and export', + monthlyTitleTemplate: 'Title Template', + monthlyIntegrationAndExport: 'Export Report', addContent: 'Add Content', editContent: 'Edit Content', viewContent: 'View Content', - fillInTheMonth: 'Fill in the month', - monthSelection: 'Month Selection', + fillInTheMonth: 'Filled in (Month)', + monthSelection: 'Select Month', bringInStandardInformation: 'Bring in standard Information', contentTemplate: 'Content Template', moveUp: 'Move Up', @@ -1009,32 +1016,32 @@ module.exports = { vehicleType: 'Vehicle Type', usage: 'Usage', implementationModel: 'Implementation Model', - primaryCoverageCn: 'Primary Coverage (Cn)', - primaryCoverageEn: 'Primary Coverage (En)', + primaryCoverageCn: 'Description (Cn)', + primaryCoverageEn: 'Description (En)', workProgressCn: 'NIO Work Progress (Cn)', workProgressEn: 'NIO Work Progress (En)', - initiatingProcess: 'Initiating Process', + initiatingProcess: 'Initiate Process', collectResults: 'Collect Results', dateOfInitiation: 'Date Of Initiation', - closingDate: 'Closing Date', + closingDate: 'Due Date', viewProcess: 'View Process', evaluationResults: 'Evaluation Results', Assessor: 'Assessor', collectionOfRegulatoryOpinions: 'Collection Of Regulatory Opinions', collectionOfRegulatoryOpinionsProcess: 'Collection Of Regulatory Opinions Process', - feedbackInformation: 'Feedback Information', - relevantSections: 'Relevant Sections', - questionsSuggestions: 'Questions Or Suggestions', + feedbackInformation: 'Feedback', + relevantSections: 'Chapter', + questionsSuggestions: 'Questions/Suggestions', reason: 'Reason', proposedTime: 'Proposed Time', feedbackPoint: 'Feedback Point', link: 'Link', planNoChinese: 'Plan No.', - standardNameCn: 'Standard Name Cn', - standardNameEn: 'Standard Name En', - deadlineForComments: 'Deadline for comments', + standardNameCn: 'Standard Title Cn', + standardNameEn: 'Standard Title En', + deadlineForComments: 'Deadline for Comments', standardNo: 'Standard No', - implemenDate: 'Implementation Date', + implemenDate: 'Effective Date', // 上报库 Enable: 'Enable', Latestupdatetime: 'Latest Update Time', @@ -1115,7 +1122,7 @@ module.exports = { PreHomoNotification: 'Pre-Homo Notification', ValidationComplianceNotification: 'Validation Compliance Notification', RegulationTaskConfirmationNotification: 'Regulation Task Confirmation Notification', - evaluationMethod: 'Evaluation method', + evaluationMethod: 'Check Method', uploadRelevantMaterials: 'Upload relevant materials', processBackground: 'Process Background', selectedStandard: 'Selected Standard', @@ -1123,13 +1130,13 @@ module.exports = { pleaseSelectStandardFirst: 'Please select a standard first', RelevantMaterials: 'RelevantMaterials', evaluatorFeedback: 'Evaluator Feedback', - nameTechnicalDocument: 'Name of technical document', + nameTechnicalDocument: 'Technical Document', chapter: 'Chapter', problemDescription: 'Problem Description', filingExternalOpinions: 'Filing of external opinions', regulatoryTechnicalEvaluationResults: 'Regulatory technical evaluation results', initiateProcessForCurrentStandard: 'Initiate process for current standard', - engineerFeedbackResults: 'Engineer feedback results', + engineerFeedbackResults: 'Engineer Feedback', fileExport: 'File Export', feedbackTime: 'Feedback Time', regulatoryTechnologyAssessmentProcess: 'Regulatory technology assessment process', @@ -1147,29 +1154,30 @@ module.exports = { releaseSituation: 'Release situation', comparisonResults: 'Comparison results', Published: 'Published', - initiateComparison: 'Initiate comparison', + initiateComparison: 'Initiate Comparison', translationLanguage: 'Translation language', translationResults: 'Translation results', conversionTime: 'Conversion time', category: 'Category', RegulatoryProcessEvaluationResults: 'Regulatory Process Evaluation Results', ViewConformanceResults: 'View Conformance Results', - CommentsCollectionResultsForReference: 'Comments Collection Results For', - TechnicalEvaluationResultsForReference: 'Technical Evaluation Results For', + CommentsCollectionResultsForReference: 'Opinion Collection Results', + TechnicalEvaluationResultsForReference: 'Technical Assessment Results', ComplianceConfirmationRecord: 'Compliance Confirmation Record', complianceConfirmation: 'Compliance Confirmation', noComparisonDocumentSelected: 'No comparison document selected', RemarkInfo: 'Remarks Info', initiateDocumentComparison: 'Initiate Document Comparison', comparativeComments: 'Comparative Comments', - viewTheComparisonResults: 'View The Comparison Results', - addFullTextComment: 'Add Full Text Comment', - turnOffAutomaticMatching: 'Turn Off Automatic Matching', - Deriveconformanceresults: 'Derive Conformance Results', + viewTheComparisonResults: 'View Results', + addFullTextComment: 'Full Text Comment', + turnOffAutomaticMatching: 'Turn Off Auto Match', + Deriveconformanceresults: 'Export Results', Regulatorycompliancekanban: 'Regulatory Compliance Kanban', exportComparisonReport: 'Export Comparison Report', comparisonDifferenceComment: 'Comparison Difference Comment', - fullTextComments: 'Full text comments', + fullTextComments: 'Full Text Comment', + pleaseEnterfullTextComments:'Please enter Full Text Comment', fileDeclaration: 'File Declaration', FileForDetails: 'File For Details', Converting: 'Converting', @@ -1177,7 +1185,7 @@ module.exports = { convertFailed: 'Convert Failed', standardData: 'Standard Data', Theorganization: 'The Organization', - Addingfolder: 'Adding a folder', + Addingfolder: 'Create New Folder', Addingsubfolders: 'Adding Subfolders', Editfolder: 'Edit Folder', Deletefolders: 'Delete Folders', @@ -1188,8 +1196,8 @@ module.exports = { Openpersonnel: 'Open Personnel', originalText: 'Original Text', translatedText: 'Translated Text', - Administrativeprivileges: 'Administrativ Pprivileges', - Checkthepermissions: 'Check The Permissions', + Administrativeprivileges: 'Administrative Permissions', + Checkthepermissions: 'Read Permissions', onlyFilesUploaded: 'Only.Docx,.Doc files can be uploaded', selectDirectorylocation: 'Please select the directory location to add the folder', Fileuploaded: 'File uploaded, please wait', @@ -1199,10 +1207,10 @@ module.exports = { Parametercollection: 'Parameter Collection', Collectlist: 'Colle Ctlist', Statisticalmodels: 'Statisti Calmodels', - Inthecollection: 'In the collection', - Notatthe: 'Not at the', + Inthecollection: 'During collection', + Notatthe: 'Not started', Thepercentage: 'The Percentage', - problemKnowledgeBase: 'Problem Knowledge Base', + problemKnowledgeBase: 'Q&A Knowledge', recentHotSpots: 'Recent Hot Spots', disseminationMaterials: 'Dissemination Materials', informationSafety: 'Information Safety', @@ -1211,36 +1219,37 @@ module.exports = { productHighlights: 'Product Highlights', financialReimbursement: 'Financial Reimbursement', classificationMaintenance: 'Classification Maintenance', - managePublishing: 'Manage Publishing', - displayPermission: 'Display permission', + managePublishing: 'Release Management', + displayPermission: 'Display Permission', authorizedUser: 'Authorized user', - problemClassification: 'Problem classification', + problemClassification: 'Problem Classification', market: 'Market', documentNumber: 'Document Number', documentTitle: 'Document Title', bringInDocumentInformation: 'Bring in document information', + addStandardInformation:'Add standard information', thereWhichCannotDeleted: 'There are sub headings under this title, which cannot be deleted', sdt: 'Sdt', dre: 'Dre', applicableInstructionsMarketList: 'Applicable instructions of market list', pleaseSelectTheDataCompared: 'Please select the data to be compared', - problemLabel: 'Problem label', + problemLabel: 'Topic Tag', personCharge: 'Person in charge', - addLabel: 'Add Label', + addLabel: 'Add Tag', editLabel: 'Edit Label', - applicableMarket: 'Applicable market', - templateMaintenance: 'Template maintenance', + applicableMarket: 'Applicable Market', + templateMaintenance: 'Template Maintenance', associatedWebsite: 'Associated website', dropDownOptions: 'Drop down options', dropDownOptionMaintenance: 'Drop down option maintenance', - displayInformation: 'Display information', - addComparison: 'Add comparison', + displayInformation: 'Display Information', + addComparison: 'Add Comparison', showOrNot: 'Show or not', comparisonMarket: 'Comparison Market', share: 'Share', simplifiedChinese:'Simplified Chinese', uploadOnly:'Upload only', - turnOnAutoMatch:'Turn on auto match', + turnOnAutoMatch:'Turn On Auto Match', Adjustareasofresponsibility:'Adjust areas of responsibility', regulatoryTechnicalAssessment:'Regulatory Technical Assessment', punctuationmark:'You can only enter English punctuation marks except the # sign and commas', @@ -1266,8 +1275,8 @@ module.exports = { onlyTheDataWhoseStatusNotInitiatedAcceptedChanged:'Only the data whose list confirmation status is accepted and the task list status is not initiated or the task list status is accepted can be changed', thereTitleWhichCannotBeDeleted:'There are new contents under this title, which cannot be deleted', industryInformationDynamicTemplate:'Industry information dynamic template', - relatedFields:'Related fields', - relatedFieldsEn:'Related fields (English)', + relatedFields:'Relaevant Area', + relatedFieldsEn:'Relaevant Area (English)', source:'Source', sourceEn:'Source (English)', onlyone:'Only one merge delimiter can be entered', @@ -1307,14 +1316,17 @@ module.exports = { inRecentYear2:'In recent 2 year', selectAll:'Select All', importLocalDisassemblyOrder:'Import local disassembly order', - notExport:'Not export', - hasBeenExport:'Has been export', - firstLevelDirectory:'First level directory', + notExport:'Not exported', + hasBeenExport:'Exported', + firstLevelDirectory:'Primary Directory', deselectAll:'Deselect All', classification:'Classification', - consistentAssessment:'Consistent assessment', - viewConsistentAssessment:'View Consistent Assessment', + consistentAssessment:'Consistent', + viewConsistentAssessment:'View Consistent', + viewVarianceAssessment:'View Variance', viewAll:'View All', endProcess:'End Process', thereForTheCurrentlySelectedData:'There is no standard breakdown for the currently selected data', + secondaryDirectory:'Secondary Directory', + OnlyPersonsCanBeSelected:'The maximum upper limit is exceeded; Only 100 persons can be selected', } \ 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 6790de6e1..eb5e9af9a 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -195,8 +195,15 @@ module.exports = { OperationLog: '操作日志', SearchLog: '搜索日志', enterSearchKeyword: '请输入搜索关键词', + enterSearchContent:'请输入搜索内容', + enterStandard:'请输入编号', + entertitle:'请输入标题', OperationType: '操作类型', selectOperationType: '请选择操作类型', + selectProblemClassification:'请选择问题分类', + selectClassification:'请选择分类', + selectTranslationResults:'请选择翻译结果', + selectMarket:'请选择市场', RequestMethod: '请求方法', RequestParameters: '请求参数', logManagementPage: '这是日志管理页面', @@ -1173,6 +1180,7 @@ module.exports = { exportComparisonReport: '导出对比报告', comparisonDifferenceComment: '对比差异评论', fullTextComments: '全文评论', + pleaseEnterfullTextComments:'请输入全文评论', fileDeclaration: '文件说明', FileForDetails: '文件详情', Converting: '转换中', @@ -1321,6 +1329,7 @@ module.exports = { documentNumber: '文档编号', documentTitle: '文档标题', bringInDocumentInformation: '带入文档信息', + addStandardInformation:'添加标准信息', thereWhichCannotDeleted: '该标题下存在子标题无法进行删除', sdt: '工程接口人', dre: '填写人', @@ -1413,9 +1422,12 @@ module.exports = { firstLevelDirectory:'一级目录', deselectAll:'取消全选', classification:'分类', - consistentAssessment:'一致评估', - viewConsistentAssessment:'查看一致评估', + consistentAssessment:'一致', + viewConsistentAssessment:'查看一致项', + viewVarianceAssessment:'查看差异项', viewAll:'查看全部', endProcess:'结束流程', thereForTheCurrentlySelectedData:'当前所选数据暂无标准分解单', + secondaryDirectory:'二级目录', + OnlyPersonsCanBeSelected:'超出最大上限;最多只能选择100个人员', } \ No newline at end of file diff --git a/jero-web/src/components/CollectionType/index.vue b/jero-web/src/components/CollectionType/index.vue index 2f8d6386c..2b59628ee 100644 --- a/jero-web/src/components/CollectionType/index.vue +++ b/jero-web/src/components/CollectionType/index.vue @@ -652,7 +652,7 @@ + :detailDate='detailDate' watermark='download'> @@ -667,6 +667,10 @@ type: Object, default: {}, require: true + }, + watermark: { + type: String, + default: '' } }, data() { diff --git a/jero-web/src/components/PersonnelSelection/index.vue b/jero-web/src/components/PersonnelSelection/index.vue index 43b6f4b88..02ab1fba8 100644 --- a/jero-web/src/components/PersonnelSelection/index.vue +++ b/jero-web/src/components/PersonnelSelection/index.vue @@ -1,16 +1,33 @@ @@ -92,6 +107,8 @@ return { loading: false, gData: [], + valueSelect: [], + dictOptions: [], autoExpandParent: false, checkboxList: [], expandedKeys: [], @@ -107,29 +124,71 @@ defaultCheckedKeysName: [], content: [], dataList: [], - defaultExpandAll: false + defaultExpandAll: false, + searchData: '' } }, mounted() { - + this.valueSelect = [] + this.dictOptions = [] + setTimeout(() => { + if (this.value) { + let contentName = [] + let contentId = [] + if (this.personneQuery[this.query.db_field_name + 'Name']) { + contentName = this.personneQuery[this.query.db_field_name + 'Name'].split(',') + } else if (this.personneQuery[this.query.db_field_name]) { + contentName = this.personneQuery[this.query.db_field_name].split(',') + } else { + contentName = [] + } + if (this.personneQuery[this.query.db_field_name + '_id']) { + contentId = this.personneQuery[this.query.db_field_name + '_id'].split(',') + } else if (this.personneQuery[this.query.db_field_name]) { + contentId = this.personneQuery[this.query.db_field_name].split(',') + } else { + contentId = [] + } + contentId.forEach((res, index) => { + this.dictOptions.push({ + value: res, + title: contentName[index] + }) + this.valueSelect.push(res) + }) + } + }, 600) }, methods: { - // handleCheckChange(val, checked, indeterminate) { - // if (checked) { - // this.userName.push(val.title) - // this.userIds.push(val.id) - // } else { - // for (let i = 0; i < this.userName.length; i++) { - // if (this.userName[i] == val.title) { + // checkChange(val, checked, indeterminate) { + // if (!checked && this.searchData) { + // this.userName = this.userName.filter(res => { + // return res != val.title + // }) + // this.userIds = this.userIds.filter(res => { + // return res != val.id + // }) + // for (let i = 0; i < this.userIds.length; i++) { + // if (this.userIds[i] == val.parentId) { + // this.userIds.splice(i, 1) // this.userName.splice(i, 1) // i-- // } // } - // for (let i = 0; i < this.userIds.length; i++) { - // if (this.userIds[i] == val.id) { - // this.userIds.splice(i, 1) - // i-- - // } + // } else if (checked && this.searchData) { + // this.userName.push(val.title) + // this.userIds.push(val.id) + // } + // }, + // handleCheckChange(val, data, checked) { + // if (!this.searchData) { + // this.userName = [] + // this.userIds = [] + // if (data.checkedNodes && data.checkedNodes.length > 0) { + // data.checkedNodes.forEach(res => { + // this.userName.push(res.title) + // this.userIds.push(res.id) + // }) // } // } // }, @@ -137,6 +196,7 @@ this.treeVisible = false this.departId = '' this.searchModel = '' + this.searchData = '' this.userIds = [] this.userName = [] this.queryDepartUserTreeList(1) @@ -181,8 +241,28 @@ // } // }, 200) }, + // deleteChildren(value, arr) { + // let newarr = [] + // arr.forEach(element => { + // if (element.title.indexOf(value) > -1) { // 判断条件 + // newarr.push(element) + // } else { + // if (element.children && element.children.length > 0) { + // let redata = this.deleteChildren(value, element.children) + // if (redata && redata.length > 0) { + // let obj = { + // ...element, + // children: redata + // } + // newarr.push(obj) + // } + // } + // } + // }) + // return newarr + // }, //将数据拼成树形结构 - // toTree(config) { + // toTree(config, num) { // // 删除 所有 children,以防止多次调用 // config.forEach(function(item) { // delete item.children @@ -200,6 +280,7 @@ // config.forEach((item) => { // // 以当前遍历项,的pid,去map对象中找到索引的id // let parent = map[item.parentId] + // // // 如果找到索引,那么说明此项不在顶级当中,那么需要把此项添加到,他对应的父级中 // if (parent) { // (parent.children || (parent.children = [])).push(item) @@ -279,6 +360,28 @@ this.visible = false this.treeVisible = false }, + onChange(value) { + this.valueSelect = value + console.log(this.valueSelect) + console.log(this.dictOptions) + this.userIds = [] + this.userName = [] + if (this.valueSelect && this.valueSelect.length > 0) { + value.forEach(res => { + this.dictOptions.forEach(val => { + if (res == val.value) { + this.userIds.push(val.value) + this.userName.push(val.title) + } + }) + }) + } + let userIds = JSON.parse(JSON.stringify(this.userIds)) + let userName = JSON.parse(JSON.stringify(this.userName)) + console.log(userIds) + this.$emit('input', userName.join(',')) + this.$emit('change', this.query.db_field_name, userIds.join(','), this.query.subscript) + }, handleSubmit() { // if (this.userIds && this.userIds.length > 0) { if (this.isSingleChoice) { @@ -295,6 +398,19 @@ // userIds = userIds.filter(function(item, index) { // return userIds.indexOf(item) === index // 因为indexOf 只能查找到第一个 // }) + if (!this.isInput) { + this.dictOptions = [] + this.valueSelect = [] + if (userIds && userIds.length > 0) { + userIds.forEach((res, index) => { + this.dictOptions.push({ + title: userName[index], + value: res + }) + this.valueSelect.push(res) + }) + } + } this.$emit('input', userName.join(',')) this.$emit('change', this.query.db_field_name, userIds.join(','), this.query.subscript) this.visible = false @@ -312,12 +428,12 @@ this.defaultCheckedKeys = [] }, onSearch(e) { - // this.loading = true // this.treeVisible = false // let p = new Promise((resolve, reject) => { // resolve() // }) // p.then(() => { + // this.searchData = e // let gData = localStorage.getItem('gData') // let content = [] // if (gData) { @@ -328,15 +444,18 @@ // res.color = true // content.push(res) // } - // } else if (res.type == 'Depart') { - // if (!this.selectDepartment) { - // res.disabled = true - // } - // content.push(res) // } + // // else if(res.type == 'Depart'){ + // // content.push(res) + // // } // }) + // let gDataAdmin = this.toTree(content) + // this.gData = this.deleteChildren(e, gDataAdmin) // this.defaultExpandAll = true - // this.gData = this.toTree(content) + // this.treeVisible = true + // this.defaultCheckedKeys = this.userIds + // this.defaultCheckedKeys = [...this.defaultCheckedKeys] + // this.loading = false // } else { // let content = JSON.parse(gData) // if (!this.selectDepartment) { @@ -348,12 +467,12 @@ // } // this.gData = this.toTree(content) // this.defaultExpandAll = false + // this.defaultCheckedKeys = this.userIds + // this.defaultCheckedKeys = [...this.defaultCheckedKeys] + // this.treeVisible = true + // this.loading = false // } // } - // this.defaultCheckedKeys = this.userIds - // this.defaultCheckedKeys = [...this.defaultCheckedKeys] - // this.treeVisible = true - // this.loading = false // }) this.gData = [] this.departId = '' @@ -476,11 +595,18 @@ width: 100%; } + .itemModelStand-input { + width: calc(100% - 100px); + display: inline-block; + height: 38px; + } + .button-box { + width: 90px; margin-left: 10px; height: 38px; line-height: 38px; - + float: right; } .drawer-bootom-button { @@ -552,4 +678,18 @@ color: #21c9cc; display: inline-block; } + + .itemOption { + display: inline-block; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + } + + \ No newline at end of file diff --git a/jero-web/src/components/libraryAddForm/index.vue b/jero-web/src/components/libraryAddForm/index.vue index 73fae7f9f..86cd81291 100644 --- a/jero-web/src/components/libraryAddForm/index.vue +++ b/jero-web/src/components/libraryAddForm/index.vue @@ -150,6 +150,7 @@
+ + + + + + + + + + + + + + + + + + + + import { getAction, postAction } from '@/api/manage' import eventBUs from '../../common/event' + import virtualNodeTree from '@/components/virtualNodeTree/tree' export default { name: 'index', + components: { + virtualNodeTree + }, data() { return { gData: [], searchModel: '', autoExpandParent: true, expandedKeys: [], + checkboxList: [], visible: false, confirmLoading: false, selectedKey: [], @@ -56,28 +81,135 @@ userIds: [], departId: '', defaultExpandedKeys: [], + defaultExpandAll: false, + defaultCheckedKeys: [], content: [], userName: [], submitLoading: false, - visibleTree: false + visibleTree: false, + treeVisible: false } }, mounted() { }, methods: { + // checkChange(val, checked, indeterminate) { + // if (!checked && this.searchData) { + // this.userName = this.userName.filter(res => { + // return res != val.title + // }) + // this.userIds = this.userIds.filter(res => { + // return res != val.id + // }) + // for (let i = 0; i < this.userIds.length; i++) { + // if (this.userIds[i] == val.parentId) { + // this.userIds.splice(i, 1) + // this.userName.splice(i, 1) + // i-- + // } + // } + // } else if (checked && this.searchData) { + // this.userName.push(val.title) + // this.userIds.push(val.id) + // } + // }, + // handleCheckChange(val, data, checked) { + // if (!this.searchData) { + // this.userName = [] + // this.userIds = [] + // if (data.checkedNodes && data.checkedNodes.length > 0) { + // data.checkedNodes.forEach(res => { + // this.userName.push(res.title) + // this.userIds.push(res.id) + // }) + // } + // } + // }, getPush(data) { this.tableKey = data this.userName = [] + this.userIds = [] this.content = [] + this.defaultCheckedKeys = [] this.searchModel = '' this.visible = true this.visibleTree = false + this.treeVisible = false this.$nextTick(() => { this.departId = '' this.queryDepartUserTreeList() }) + // let gData = localStorage.getItem('gData') + // if (gData) { + // let dataList = JSON.parse(gData) + // dataList.forEach(res => { + // if (res.type == 'Depart') { + // res.disabled = true + // } + // }) + // this.dataList = this.toTree(dataList) + // } + // setTimeout(() => { + // if (gData) { + // this.gData = this.dataList + // this.gData = [...this.gData] + // this.treeVisible = true + // } else { + // this.queryDepartUserTreeList(1) + // } + // }, 200) }, + // deleteChildren(value, arr) { + // let newarr = [] + // arr.forEach(element => { + // if (element.title.indexOf(value) > -1) { // 判断条件 + // newarr.push(element) + // } else { + // if (element.children && element.children.length > 0) { + // let redata = this.deleteChildren(value, element.children) + // if (redata && redata.length > 0) { + // let obj = { + // ...element, + // children: redata + // } + // newarr.push(obj) + // } + // } + // } + // }) + // return newarr + // }, + // // 将数据拼成树形结构 + // toTree(config, num) { + // // 删除 所有 children,以防止多次调用 + // config.forEach(function(item) { + // delete item.children + // }) + // // 将数据存储为 以 id 为 KEY 的 map 索引数据列 + // let map = {} + // config.forEach((item) => { + // item.label = item.name + // item.key = item.id + // + // item.title = item.name + (item.itemName ? ' ' + item.itemName : '') + // map[item.id] = item + // }) + // let val = [] + // config.forEach((item) => { + // // 以当前遍历项,的pid,去map对象中找到索引的id + // let parent = map[item.parentId] + // + // // 如果找到索引,那么说明此项不在顶级当中,那么需要把此项添加到,他对应的父级中 + // if (parent) { + // (parent.children || (parent.children = [])).push(item) + // } else { + // //如果没有在map中找到对应的索引ID,那么直接把 当前的item添加到 val结果集中,作为顶级 + // val.push(item) + // } + // }) + // return val + // }, onSelect(selectedKeys) { this.selectedKey = selectedKeys }, @@ -125,6 +257,47 @@ }) }, onSearch(e) { + // this.treeVisible = false + // let p = new Promise((resolve, reject) => { + // resolve() + // }) + // p.then(() => { + // this.searchData = e + // let gData = localStorage.getItem('gData') + // let content = [] + // if (gData) { + // if (e) { + // JSON.parse(gData).forEach(res => { + // if (res.type == 'User') { + // if (res.name.includes(e)) { + // res.color = true + // content.push(res) + // } + // } + // }) + // let gDataAdmin = this.toTree(content) + // this.gData = this.deleteChildren(e, gDataAdmin) + // this.defaultExpandAll = true + // this.treeVisible = true + // this.defaultCheckedKeys = this.userIds + // this.defaultCheckedKeys = [...this.defaultCheckedKeys] + // this.loading = false + // } else { + // let content = JSON.parse(gData) + // content.forEach(res => { + // if (res.type == 'Depart') { + // res.disabled = true + // } + // }) + // this.gData = this.toTree(content) + // this.defaultExpandAll = false + // this.defaultCheckedKeys = this.userIds + // this.defaultCheckedKeys = [...this.defaultCheckedKeys] + // this.treeVisible = true + // this.loading = false + // } + // } + // }) this.gData = [] this.departId = '' this.visibleTree = false @@ -136,8 +309,8 @@ }, getUserAndDepart() { getAction('sys/user/getUserAndDepart', { name: this.searchModel }).then((res) => { - if (res){ - this.gData = res.filter(ele => ele.flag === 'DEPART'); + if (res) { + this.gData = res.filter(ele => ele.flag === 'DEPART') } else { this.gData = [] } @@ -159,8 +332,20 @@ }).then((res) => { this.confirmLoading = false if (res.success) { + // let content = JSON.parse(JSON.stringify(res.result)) + // res.result.forEach(res => { + // if (res.type == 'Depart') { + // res.disabled = true + // } + // }) + // localStorage.removeItem('gData') + // localStorage.setItem('gData', JSON.stringify(content)) + // this.gData = this.toTree(res.result) this.gData = res.result - this.defaultExpandedKeys = [this.departId] + this.gData = [...this.gData] + // this.defaultExpandedKeys = [this.departId] + this.defaultExpandAll = false + this.treeVisible = true this.visibleTree = true } else { this.gData = [] @@ -243,4 +428,13 @@ height: calc(100% - 60px); overflow: auto; } + + .treeWrap { + height: calc(100vh - 240px); + } + + .active { + color: #21c9cc; + display: inline-block; + } diff --git a/jero-web/src/components/tableCollection/index.vue b/jero-web/src/components/tableCollection/index.vue index 6e7bf6b0f..cc605e642 100644 --- a/jero-web/src/components/tableCollection/index.vue +++ b/jero-web/src/components/tableCollection/index.vue @@ -11,7 +11,6 @@ :data-source="dataSource" :loading="loading" sticky - :components="components" :columns="columns" :rowClassName="rowClassName" @change="tableOnChange" @@ -22,7 +21,7 @@
- {{ item.db_field_txt }} + {{ item.db_field_txt }} {{$t('See')}}
@@ -605,9 +604,11 @@ res.result.userType = result[0] ? result[0].value : '' } this.getTableList(res.result.userType) + this.getHeader(res.result.userType) } else { this.getTableList(result[0].value) + this.getHeader(result[0].value) } this.$emit('LoginUserType', result, this.currentPersonRole, res.result.userType) } else { @@ -615,7 +616,7 @@ } }) }, - getHeader() { + getHeader(userType) { let paramsManifestid let url if (this.$route.query.it === undefined) { @@ -629,7 +630,8 @@ } let params = { paramsManifestId: paramsManifestid, - flag: '7' + flag: '7', + userType:userType, } getAction(url, params).then((res) => { if (res.success) { diff --git a/jero-web/src/components/uploadFileChangeDown/file.vue b/jero-web/src/components/uploadFileChangeDown/file.vue index e742821cb..19b236668 100644 --- a/jero-web/src/components/uploadFileChangeDown/file.vue +++ b/jero-web/src/components/uploadFileChangeDown/file.vue @@ -43,7 +43,7 @@ import { mapGetters } from 'vuex' export default { name: 'file', - props: ['disableds', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'detailDate'], + props: ['disableds', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'detailDate','watermark'], data() { return { visible: false, @@ -91,7 +91,11 @@ import { mapGetters } from 'vuex' methods: { ...mapGetters(['userInfo']), download() { - downloadFile('/sys/common/downLoadFile', this.template.templateName, { id: this.template.templateId }) + if(this.watermark == 'download'){ + downloadFile('/sys/common/downLoadFileNOMark', this.template.templateName, { id: this.template.templateId }) + } else { + downloadFile('/sys/common/downLoadFile', this.template.templateName, { id: this.template.templateId }) + } }, perentHandleFunc(data) { this.myfileList = data @@ -220,7 +224,11 @@ import { mapGetters } from 'vuex' // let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) // window.open(url, '_blank') // } else { + if(this.watermark == 'download'){ + downloadFile('/sys/common/downLoadFileNOMark', fileQuery.fileName, { id: fileQuery.id }) + }else { downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id }) + } // } } } diff --git a/jero-web/src/components/viewFileModel/index.vue b/jero-web/src/components/viewFileModel/index.vue index 882c93446..19a707125 100644 --- a/jero-web/src/components/viewFileModel/index.vue +++ b/jero-web/src/components/viewFileModel/index.vue @@ -49,6 +49,7 @@ loading: false, visibleFile:false, downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', columnsFile: [ { title: this.$t('fileName'), @@ -78,10 +79,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') + } else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id }) } diff --git a/jero-web/src/components/virtualNodeTree/mixin/node.js b/jero-web/src/components/virtualNodeTree/mixin/node.js index 9c7850718..efeea4ce4 100644 --- a/jero-web/src/components/virtualNodeTree/mixin/node.js +++ b/jero-web/src/components/virtualNodeTree/mixin/node.js @@ -41,9 +41,8 @@ export default { return getNodeKey(this.tree.nodeKey, node.data); }, - handleSelectChange(checked, indeterminate) { + handleSelectChange(checked, indeterminate,source) { const node = this.node || this.source; - if (this.oldChecked !== checked && this.oldIndeterminate !== indeterminate) { this.tree.$emit('check-change', node.data, checked, indeterminate); } @@ -95,7 +94,6 @@ export default { handleCheckChange(_, ev) { const node = this.node || this.source; - node.setChecked(ev.target.checked, !this.tree.checkStrictly); this.$nextTick(() => { const store = this.tree.store; @@ -103,8 +101,9 @@ export default { checkedNodes: store.getCheckedNodes(), checkedKeys: store.getCheckedKeys(), halfCheckedNodes: store.getHalfCheckedNodes(), - halfCheckedKeys: store.getHalfCheckedKeys() - }); + halfCheckedKeys: store.getHalfCheckedKeys(), + getCurrentNode:store.getCurrentNode() + },this.source.checked); }); }, diff --git a/jero-web/src/components/virtualNodeTree/model/tree-store.js b/jero-web/src/components/virtualNodeTree/model/tree-store.js index c9df39c83..760ea8980 100644 --- a/jero-web/src/components/virtualNodeTree/model/tree-store.js +++ b/jero-web/src/components/virtualNodeTree/model/tree-store.js @@ -57,7 +57,6 @@ export default class TreeStore { if (node.visible && !node.isLeaf && !lazy) node.expand(); }; - traverse(this); } diff --git a/jero-web/src/components/virtualNodeTree/tree-virtual-node.vue b/jero-web/src/components/virtualNodeTree/tree-virtual-node.vue index acc2ba88e..2f0925b40 100644 --- a/jero-web/src/components/virtualNodeTree/tree-virtual-node.vue +++ b/jero-web/src/components/virtualNodeTree/tree-virtual-node.vue @@ -115,11 +115,11 @@ }, watch: { 'source.indeterminate'(val) { - this.handleSelectChange(this.source.checked, val); + this.handleSelectChange(this.source.checked, val,this.source); }, 'source.checked'(val) { - this.handleSelectChange(val, this.source.indeterminate); + this.handleSelectChange(val, this.source.indeterminate,this.source); }, 'source.expanded'(val) { diff --git a/jero-web/src/components/virtualNodeTree/tree.vue b/jero-web/src/components/virtualNodeTree/tree.vue index a98fea522..9d58be060 100644 --- a/jero-web/src/components/virtualNodeTree/tree.vue +++ b/jero-web/src/components/virtualNodeTree/tree.vue @@ -759,8 +759,8 @@ } .el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before { - background-color: #c0c4cc; - border-color: #c0c4cc + background-color: #fff; + border-color: #fff; } .el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner { @@ -927,7 +927,6 @@ .el-checkbox-button.is-checked:first-child .el-checkbox-button__inner { border-left-color: #409eff } - .el-checkbox-button.is-disabled .el-checkbox-button__inner { color: #c0c4cc; cursor: not-allowed; diff --git a/jero-web/src/store/modules/user.js b/jero-web/src/store/modules/user.js index c59903a89..ccd43b585 100644 --- a/jero-web/src/store/modules/user.js +++ b/jero-web/src/store/modules/user.js @@ -11,6 +11,7 @@ import { CACHE_INCLUDED_ROUTES } from '@/store/mutation-types' import { welcome } from '@/utils/util' +import { LZString } from '@/utils/compressedData' import { queryPermissionsByUser } from '@/api/api' import { getAction } from '@/api/manage' @@ -142,14 +143,15 @@ const user = { //Vue.ls.set(USER_AUTH,authData); sessionStorage.setItem(USER_AUTH, JSON.stringify(authData)) sessionStorage.setItem(SYS_BUTTON_AUTH, JSON.stringify(allAuthData)) - let gData = localStorage.getItem('gData') - if (!gData) { - getAction('sys/user/queryUserTreeList', {}).then((res) => { - if (res.success) { - localStorage.setItem('gData', JSON.stringify(res.result)) - } - }) - } + // let gData = localStorage.getItem('gData') + // if (!gData) { + // getAction('sys/user/queryUserTreeList', {}).then((res) => { + // if (res.success) { + // let index = LZString.compressToUint8Array(JSON.stringify(res.result)).join(',') + // localStorage.setItem('gData', LZString.compressToEncodedURIComponent(index)) + // } + // }) + // } if (menuData && menuData.length > 0) { //update--begin--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------ menuData.forEach((item, index) => { diff --git a/jero-web/src/utils/compressedData.js b/jero-web/src/utils/compressedData.js new file mode 100644 index 000000000..f855f5083 --- /dev/null +++ b/jero-web/src/utils/compressedData.js @@ -0,0 +1,313 @@ +export const LZString = function() { + function f(h, e) { + if (!b[h]) { + b[h] = {}; + for (var i = 0; i < h.length; i++) { + b[h][h.charAt(i)] = i + } + } + return b[h][e] + } + + var c = String.fromCharCode, + g = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$", + b = {}, + a = { + compressToBase64: function(h) { + if (null == h) { + return "" + } + var e = a._compress(h, 6, + function(i) { + return g.charAt(i) + }); + switch (e.length % 4) { + default: + case 0: + return e; + case 1: + return e + "==="; + case 2: + return e + "=="; + case 3: + return e + "=" + } + }, + decompressFromBase64: function(e) { + return null == e ? "": "" == e ? null: a._decompress(e.length, 32, + function(h) { + return f(g, e.charAt(h)) + }) + }, + compressToUTF16: function(e) { + return null == e ? "": a._compress(e, 15, + function(h) { + return c(h + 32) + }) + " " + }, + decompressFromUTF16: function(e) { + return null == e ? "": "" == e ? null: a._decompress(e.length, 16384, + function(h) { + return e.charCodeAt(h) - 32 + }) + }, + compressToUint8Array: function(l) { + for (var j = a.compress(l), m = new Uint8Array(2 * j.length), k = 0, h = j.length; h > k; k++) { + var i = j.charCodeAt(k); + m[2 * k] = i >>> 8, + m[2 * k + 1] = i % 256 + } + return m + }, + decompressFromUint8Array: function(k) { + if (null === k || void 0 === k) { + return a.decompress(k) + } + for (var l = new Array(k.length / 2), j = 0, h = l.length; h > j; j++) { + l[j] = 256 * k[2 * j] + k[2 * j + 1] + } + var i = []; + return l.forEach(function(e) { + i.push(c(e)) + }), + a.decompress(i.join("")) + }, + compressToEncodedURIComponent: function(e) { + return null == e ? "": a._compress(e, 6, + function(h) { + return d.charAt(h) + }) + }, + decompressFromEncodedURIComponent: function(e) { + return null == e ? "": "" == e ? null: (e = e.replace(/ /g, "+"), a._decompress(e.length, 32, + function(h) { + return f(d, e.charAt(h)) + })) + }, + compress: function(e) { + return a._compress(e, 16, + function(h) { + return c(h) + }) + }, + _compress: function(q, j, w) { + if (null == q) { + return "" + } + var C, I, z, J = {}, + k = {}, + H = "", + E = "", + F = "", + y = 2, + B = 3, + A = 2, + D = [], + x = 0, + G = 0; + for (z = 0; z < q.length; z += 1) { + if (H = q.charAt(z), Object.prototype.hasOwnProperty.call(J, H) || (J[H] = B++, k[H] = !0), E = F + H, Object.prototype.hasOwnProperty.call(J, E)) { + F = E + } else { + if (Object.prototype.hasOwnProperty.call(k, F)) { + if (F.charCodeAt(0) < 256) { + for (C = 0; A > C; C++) { + x <<= 1, + G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++ + } + for (I = F.charCodeAt(0), C = 0; 8 > C; C++) { + x = x << 1 | 1 & I, + G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++, + I >>= 1 + } + } else { + for (I = 1, C = 0; A > C; C++) { + x = x << 1 | I, + G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++, + I = 0 + } + for (I = F.charCodeAt(0), C = 0; 16 > C; C++) { + x = x << 1 | 1 & I, + G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++, + I >>= 1 + } + } + y--, + 0 == y && (y = Math.pow(2, A), A++), + delete k[F] + } else { + for (I = J[F], C = 0; A > C; C++) { + x = x << 1 | 1 & I, + G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++, + I >>= 1 + } + } + y--, + 0 == y && (y = Math.pow(2, A), A++), + J[E] = B++, + F = String(H) + } + } + if ("" !== F) { + if (Object.prototype.hasOwnProperty.call(k, F)) { + if (F.charCodeAt(0) < 256) { + for (C = 0; A > C; C++) { + x <<= 1, + G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++ + } + for (I = F.charCodeAt(0), C = 0; 8 > C; C++) { + x = x << 1 | 1 & I, + G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++, + I >>= 1 + } + } else { + for (I = 1, C = 0; A > C; C++) { + x = x << 1 | I, + G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++, + I = 0 + } + for (I = F.charCodeAt(0), C = 0; 16 > C; C++) { + x = x << 1 | 1 & I, + G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++, + I >>= 1 + } + } + y--, + 0 == y && (y = Math.pow(2, A), A++), + delete k[F] + } else { + for (I = J[F], C = 0; A > C; C++) { + x = x << 1 | 1 & I, + G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++, + I >>= 1 + } + } + y--, + 0 == y && (y = Math.pow(2, A), A++) + } + for (I = 2, C = 0; A > C; C++) { + x = x << 1 | 1 & I, + G == j - 1 ? (G = 0, D.push(w(x)), x = 0) : G++, + I >>= 1 + } + for (;;) { + if (x <<= 1, G == j - 1) { + D.push(w(x)); + break + } + G++ + } + return D.join("") + }, + decompress: function(e) { + return null == e ? "": "" == e ? null: a._decompress(e.length, 32768, + function(h) { + return e.charCodeAt(h) + }) + }, + _decompress: function(B, C, I) { + var r, F, x, z, q, K, L, E, H = [], + G = 4, + J = 4, + D = 3, + k = "", + j = [], + y = { + val: I(0), + position: C, + index: 1 + }; + for (F = 0; 3 > F; F += 1) { + H[F] = F + } + for (z = 0, K = Math.pow(2, 2), L = 1; L != K;) { + q = y.val & y.position, + y.position >>= 1, + 0 == y.position && (y.position = C, y.val = I(y.index++)), + z |= (q > 0 ? 1 : 0) * L, + L <<= 1 + } + switch (r = z) { + case 0: + for (z = 0, K = Math.pow(2, 8), L = 1; L != K;) { + q = y.val & y.position, + y.position >>= 1, + 0 == y.position && (y.position = C, y.val = I(y.index++)), + z |= (q > 0 ? 1 : 0) * L, + L <<= 1 + } + E = c(z); + break; + case 1: + for (z = 0, K = Math.pow(2, 16), L = 1; L != K;) { + q = y.val & y.position, + y.position >>= 1, + 0 == y.position && (y.position = C, y.val = I(y.index++)), + z |= (q > 0 ? 1 : 0) * L, + L <<= 1 + } + E = c(z); + break; + case 2: + return "" + } + for (H[3] = E, x = E, j.push(E);;) { + if (y.index > B) { + return "" + } + for (z = 0, K = Math.pow(2, D), L = 1; L != K;) { + q = y.val & y.position, + y.position >>= 1, + 0 == y.position && (y.position = C, y.val = I(y.index++)), + z |= (q > 0 ? 1 : 0) * L, + L <<= 1 + } + switch (E = z) { + case 0: + for (z = 0, K = Math.pow(2, 8), L = 1; L != K;) { + q = y.val & y.position, + y.position >>= 1, + 0 == y.position && (y.position = C, y.val = I(y.index++)), + z |= (q > 0 ? 1 : 0) * L, + L <<= 1 + } + H[J++] = c(z), + E = J - 1, + G--; + break; + case 1: + for (z = 0, K = Math.pow(2, 16), L = 1; L != K;) { + q = y.val & y.position, + y.position >>= 1, + 0 == y.position && (y.position = C, y.val = I(y.index++)), + z |= (q > 0 ? 1 : 0) * L, + L <<= 1 + } + H[J++] = c(z), + E = J - 1, + G--; + break; + case 2: + return j.join("") + } + if (0 == G && (G = Math.pow(2, D), D++), H[E]) { + k = H[E] + } else { + if (E !== J) { + return null + } + k = x + x.charAt(0) + } + j.push(k), + H[J++] = x + k.charAt(0), + G--, + x = k, + 0 == G && (G = Math.pow(2, D), D++) + } + } + }; + return a +} (); + +// module.exports = LZString \ No newline at end of file diff --git a/jero-web/src/views/businessSupport/collectionOfRegulatoryOpinions/components/evaluationResultsList.vue b/jero-web/src/views/businessSupport/collectionOfRegulatoryOpinions/components/evaluationResultsList.vue index 1e8d605e3..85e38ad5a 100644 --- a/jero-web/src/views/businessSupport/collectionOfRegulatoryOpinions/components/evaluationResultsList.vue +++ b/jero-web/src/views/businessSupport/collectionOfRegulatoryOpinions/components/evaluationResultsList.vue @@ -209,7 +209,7 @@ actiProcInstId: this.actiProcInstId } downloadFile('/lawsOpinionGather/lawsOpinionAssessmentResultEO/exportXls', - this.$t('evaluationResults') + '.zip', query) + this.$route.query.serialNumber+ ' ' +this.$t('evaluationResults') + '.zip', query) }, getData() { this.formInline = JSON.parse(JSON.stringify(this.$route.query)) diff --git a/jero-web/src/views/businessSupport/collectionOfRegulatoryOpinions/index.vue b/jero-web/src/views/businessSupport/collectionOfRegulatoryOpinions/index.vue index 42f004c5b..4f9789fa2 100644 --- a/jero-web/src/views/businessSupport/collectionOfRegulatoryOpinions/index.vue +++ b/jero-web/src/views/businessSupport/collectionOfRegulatoryOpinions/index.vue @@ -41,10 +41,10 @@
-
{{$t('classificationMaintenance')}} @@ -42,11 +44,15 @@ -
+
{{$t('managePublishing')}}
-
+
{{$t('newlyAdded')}}
@@ -65,16 +71,16 @@ {{val}}
-
-
- +
+
- {{val.fileName}} + {{val.fileName}}
@@ -85,9 +91,13 @@ {{item.createBy}}
-
+
- {{item.problemTypeName}} + {{item.standNumber}} +
+
+ + {{item.targetMarket_dicText}}
@@ -170,6 +180,7 @@ import SelectedBy from '@/components/SelectedBy/index' import problemKnowledgeBaseListView from './problemKnowledgeBaseListView' import { mapGetters } from 'vuex' + import { Base64 } from 'js-base64' export default { name: 'problemKnowledgeBaseList', @@ -193,6 +204,7 @@ queryForm: {}, tagList: [], downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', pageNo: 1, url: { getInfoList: '/problemKnowledgeBase/problemKnowledgeBaseEO/page' @@ -207,6 +219,17 @@ localStorage.removeItem('serial_number') } this.isTrue = true + let BaseQuery = localStorage.getItem('problemknowledgeBase') + if (BaseQuery) { + let content = JSON.parse(BaseQuery) + if (content.id) { + this.isTrue = false + this.$nextTick(() => { + this.$refs.problemKnowledgeBaseListViewRef.getData(JSON.parse(JSON.stringify(content))) + }) + } + localStorage.removeItem('problemknowledgeBase') + } this.getList() this.replacePage() }, @@ -255,6 +278,26 @@ this.getList() }) }, + fileClick(fileQuery) { + let fileName = fileQuery.fileName + let index1 = fileName.lastIndexOf('.') + let index2 = fileName.length + let fileSuffix = fileName.substring(index1, index2) + if (fileSuffix == '.pdf') { + window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id + '&userName=' + this.userInfo().username)) + } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') + } else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') + } else { + downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id }) + } + }, problemKnowledgeBase() { this.pageNo = 1 this.isTrue = true @@ -309,7 +352,8 @@ }, getText(str) { let words = str.replace(/<[^<>]+>/g, '').replace(/ /gi, '') //这里是去除标签 - return words.replace(/\s/g, '') //这里是去除空格 + //.replace(/\s/g, '') //这里是去除空格 + return words }, getList() { let selectedTags = JSON.parse(JSON.stringify(this.selectedTags)) @@ -317,7 +361,8 @@ pageNo: this.pageNo, pageSize: this.pageSize, searchStr: this.searchStr, - problemTypes: selectedTags.join(',') + problemTypes: selectedTags.join(','), + releaseStatus: 'Have released' } this.loading = true getAction(this.url.getInfoList, query).then((res) => { @@ -629,7 +674,7 @@ background: #DBF2F3; border-radius: 3px; margin-left: 6px; - max-width: 120px; + max-width: 140px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; @@ -662,22 +707,22 @@ margin-top: 10px; .content-box-content-botton-text { - width: 118px; + /*max-width: 198px;*/ height: 32px; display: inline-block; text-align: center; line-height: 32px; - padding: 0 6px; - background: #EFF1F3; + /*background: #EFF1F3;*/ border-radius: 4px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; - font-size: 12px; + font-size: 14px; font-weight: 400; color: #040B29; - margin-right: 10px; + margin-right: 20px; cursor: pointer; + text-decoration: underline; } } } @@ -789,7 +834,7 @@ background: #fff; background: rgba(4, 11, 41, 0.06); color: #363C54; - max-width: 150px; + max-width: 280px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; diff --git a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseListView.vue b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseListView.vue index 5c4fbfd08..4c0f51f27 100644 --- a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseListView.vue +++ b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseListView.vue @@ -33,9 +33,13 @@ {{queryForm.createBy}}
-
- - {{queryForm.problemTypeName}} +
+ + {{queryForm.standNumber}} +
+
+ + {{queryForm.targetMarket_dicText}}
@@ -96,8 +100,16 @@
{{item.commentContent}}
-
- {{$t('answer')}} +
+ + {{$t('answer')}} + + + {{$t('delete')}} +
@@ -109,8 +121,15 @@
{{val.commentContent}}
-
+
+ {{$t('answer')}} + + + {{$t('delete')}} +
@@ -158,6 +177,7 @@ import SelectedBy from '@/components/SelectedBy/index' import { mapGetters } from 'vuex' import { Base64 } from 'js-base64' + import { deleteAction } from '../../../../api/manage' export default { name: 'problemKnowledgeBaseListView', @@ -167,6 +187,8 @@ data() { return { visibleComment: false, + administrators: false, + userInfoQuery: {}, releaseList: [], loading: false, formInline: {}, @@ -200,11 +222,20 @@ queryForm: {}, isPraise: false, downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', isCollect: false } }, mounted() { - + this.administrators = false + this.userInfoQuery = this.userInfo() + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } }, methods: { ...mapGetters(['userInfo']), @@ -218,14 +249,38 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') + } else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id }) } }, + deleteClick(item) { + let _this = this + this.$confirm({ + content: _this.$t('ConfirmDelete'), + onOk() { + let url = '' + if (item.problemKnowledgeBaseId) { + url = '/problemKnowledgeBase/problemKnowledgeBaseCommentEO/deleteBatch' + } else { + url = '/project/problemKnowledgeBaseReplyEO/deleteBatch' + } + deleteAction(url, { ids: item.id }).then((res) => { + if (res.success) { + _this.$message.success(_this.$t('OperationSuccessful')) + _this.releaseData() + } else { + _this.$message.warning(res.message) + } + }) + } + }) + }, download(item) { downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id, userName: this.userInfo().username }) }, @@ -491,34 +546,37 @@ margin-top: 10px; .content-box-content-botton-text { - width: 140px; + /*max-width: 200px;*/ + /*min-width: 120px;*/ height: 32px; display: inline-block; text-align: center; line-height: 32px; - padding: 0 6px; - background: #EFF1F3; + /*padding: 0 10px;*/ + /*background: #EFF1F3;*/ border-radius: 4px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; - font-size: 12px; + font-size: 14px; font-weight: 400; color: #040B29; - margin-right: 10px; + margin-right: 20px; cursor: pointer; .file-text { - width: 90px; + width: calc(100% - 30px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + text-decoration: underline; display: inline-block; margin-right: 6px; cursor: pointer; } .icon-text { + width: 24px; font-size: 16px; overflow: hidden; margin-bottom: 9px; @@ -627,6 +685,10 @@ margin-top: 6px; } + .answer-text-index { + width: 100%; + } + .answer-text { display: inline-block; padding: 3px 14px; diff --git a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseRelease.vue b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseRelease.vue index 67a491e01..16bc05889 100644 --- a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseRelease.vue +++ b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseRelease.vue @@ -3,25 +3,49 @@
- - - + + + {{$t('managePublishing')}}
- -
-
- {{$t('searchContent')}} + + + +
+
+ {{$t('searchContent')}} +
+ +
+
+ +
+
+ {{$t('releaseStatus')}} +
+ + + + {{ item.name}} + + + +
+
+
+ {{$t('query')}} + {{$t('reset')}} +
- - {{$t('query')}} - {{$t('reset')}} -
+
@@ -41,9 +65,14 @@
{{item.contentOne}}
+
+ {{item.releaseStatus == 'Draft'?$t('draft'):$t('HaveReleased')}} +
@@ -83,10 +112,22 @@ conList: [], total: 0, pageSize: 10, - searchStr: '', + queryParam: {}, + releaseStatusList: [ + { + name: this.$t('draft'), + value: 'Draft' + }, + { + name: this.$t('HaveReleased'), + value: 'Have released' + } + ], loading: false, + administrators: false, downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', pageNo: 1, + userInfoQuery: {}, url: { getInfoList: '/problemKnowledgeBase/problemKnowledgeBaseEO/page', deleteBatch: '/problemKnowledgeBase/problemKnowledgeBaseEO/deleteBatch' @@ -96,6 +137,15 @@ mounted() { this.getList() document.title = this.$t('managePublishing') + this.administrators = false + this.userInfoQuery = this.userInfo() + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } }, methods: { ...mapGetters(['userInfo']), @@ -113,20 +163,21 @@ this.getList() }, ResetSearch() { - this.searchStr = '' + this.queryParam = {} this.pageNo = 1 this.getList() }, getText(str) { let words = str.replace(/<[^<>]+>/g, '').replace(/ /gi, '') //这里是去除标签 - return words.replace(/\s/g, '') //这里是去除空格 + //.replace(/\s/g, '') //这里是去除空格 + return words }, getList() { let query = { pageNo: this.pageNo, pageSize: this.pageSize, createBy: this.userInfo().username, - searchStr: this.searchStr + ...this.queryParam } this.loading = true getAction(this.url.getInfoList, query).then((res) => { @@ -271,11 +322,21 @@ .text-text-right { padding: 19px 19px; - width: calc(100% - 180px); + width: calc(100% - 300px); box-sizing: border-box; /*margin-left: 38px;*/ } + .text-text-right-text-One { + width: 120px; + height: 100%; + text-align: center; + position: absolute; + right: 180px; + top: 50%; + transform: translate-Y(-50%); + } + .text-text-right-text { width: 180px; height: 100%; @@ -351,16 +412,13 @@ .search-detail-wrap { width: 100%; - margin: 0 auto; + margin-bottom: 16px; } .box-title-text { line-height: 1.4; display: flex; align-items: center; - margin-bottom: 10px; - text-align: center; - justify-content: center; } .title-text { @@ -380,7 +438,7 @@ .box-input { /*min-width: 200px;*/ display: inline-block; - width: 50%; + width: 100%; height: 38px; margin-top: 2px; margin-right: 16px; diff --git a/jero-web/src/views/businessSupport/regulationReport/components/RegulationMonthlyFill.vue b/jero-web/src/views/businessSupport/regulationReport/components/RegulationMonthlyFill.vue index 5fcdfcf2e..2be197f75 100644 --- a/jero-web/src/views/businessSupport/regulationReport/components/RegulationMonthlyFill.vue +++ b/jero-web/src/views/businessSupport/regulationReport/components/RegulationMonthlyFill.vue @@ -44,19 +44,27 @@
-
+
{{$t('monthlyTitleTemplate')}}
-
+
{{$t('monthlyIntegrationAndExport')}}
-
+
{{$t('addContent')}}
-
+
{{$t('BatchDelete')}}
@@ -74,10 +82,28 @@ :columns="columns" > - {{$t('copy')}} - {{$t('view')}} - {{$t('edit')}} - {{$t('deleteLib')}} + + {{$t('copy')}} + + + {{$t('view')}} + + + {{$t('edit')}} + + + {{$t('deleteLib')}} +
@@ -103,6 +129,7 @@ import fillTable from './modules/fillTable' import fillAdd from './modules/fillAdd' import moment from 'moment' + import { mapGetters } from 'vuex' export default { name: 'RegulationMonthlyFill', @@ -118,14 +145,14 @@ list: '/report/lawsMonthlyReportWriteEO/page', exportData: '/report/lawsMonthlyReportWriteEO/exportMonthlyReport' }, - exportStatusList:[ + exportStatusList: [ { - value:'2', - name:this.$t('hasBeenExport') + value: '2', + name: this.$t('hasBeenExport') }, { - value:'1', - name:this.$t('notExport') + value: '1', + name: this.$t('notExport') } ], loading: false, @@ -144,7 +171,7 @@ width: 170 }, { - title: this.$t('chapterContents'), + title: this.$t('secondaryDirectory'), align: 'center', dataIndex: 'memoriesChapterName', ellipsis: true, @@ -192,15 +219,27 @@ width: 190, scopedSlots: { customRender: 'operation' } } - ] + ], + userData:{}, + administrators:false } }, mounted() { this.queryParam.month = moment(new Date()).format('YYYY-MM') this.getList() + this.userData = this.userInfo() + this.administrators = false + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } }, methods: { - copyClick(row){ + ...mapGetters(['userInfo']), + copyClick(row) { let _this = this this.$confirm({ content: _this.$t('ConfirmReplication'), diff --git a/jero-web/src/views/businessSupport/regulationReport/components/RegulationMonthlyManagement.vue b/jero-web/src/views/businessSupport/regulationReport/components/RegulationMonthlyManagement.vue index 67a9a1ca8..a89cbe2cd 100644 --- a/jero-web/src/views/businessSupport/regulationReport/components/RegulationMonthlyManagement.vue +++ b/jero-web/src/views/businessSupport/regulationReport/components/RegulationMonthlyManagement.vue @@ -22,7 +22,7 @@
-
+
{{$t('uploadMonthly')}}
@@ -51,14 +51,16 @@ {{record.issueStatus == 2 ? $t('release') : $t('withdraw')}} {{$t('deleteLib')}} {{$t('download')}} @@ -108,7 +110,9 @@ pageNo: 1, queryParam: {}, downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', userData: {}, + administrators:false, columns: [ { title: this.$t('RegulationMonthlyName'), @@ -160,6 +164,14 @@ mounted() { this.getList() this.userData = this.userInfo() + this.administrators = false + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } }, methods: { ...mapGetters(['userInfo']), @@ -216,10 +228,12 @@ } else if (fileSuffix === '.docx' || fileSuffix === '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + item.fileId + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix === '.xlsx' || fileSuffix === '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix === '.xlsx' || fileSuffix === '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + item.fileId + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + item.fileId + fileSuffix) + window.open(url, '_blank') } else { if (item.createBy == this.userInfo().username) { downloadFile('/sys/common/downLoadFile', item.name, { id: item.fileId, userName: this.userInfo().username }) diff --git a/jero-web/src/views/businessSupport/regulationReport/components/modules/defaultTemplate.vue b/jero-web/src/views/businessSupport/regulationReport/components/modules/defaultTemplate.vue index 9a91fe34f..4797f1267 100644 --- a/jero-web/src/views/businessSupport/regulationReport/components/modules/defaultTemplate.vue +++ b/jero-web/src/views/businessSupport/regulationReport/components/modules/defaultTemplate.vue @@ -4,8 +4,9 @@
- {{$t('title')}} + * + {{$t('title')}}
- {{$t('englishTitle')}} + * + {{$t('englishTitle')}}
- {{$t('technicalField')}} + * + {{$t('technicalField')}}
- +
- -
-
- {{$t('implementationModel')}} -
- - - -
-
+ + + + + + + + + + + + + + @@ -95,7 +98,7 @@ :placeholder="$t('PleaseSelect')+$t('scopeOfApplication')" :type="'checkbox'" :disabled="disabled" - :triggerChange="false" :dictCode="'apply_scope'"/> + :triggerChange="false" :dictCode="'fa3_gui1_yue4_bao4_-_shi4_yong4_fan4_wei2'"/>
@@ -108,10 +111,10 @@ :title="$t('status')">{{$t('status')}}
-
@@ -125,9 +128,9 @@ :title="$t('usage')">{{$t('usage')}}
- @@ -156,10 +159,11 @@ :title="$t('ImplementationDate')">{{$t('ImplementationDate')}}
+ + :placeholder="'202X.X.X'"/>
@@ -170,10 +174,11 @@ :title="$t('vehicleInProductionDate')">{{$t('vehicleInProductionDate')}}
+ + :placeholder="'202X.X.X'"/>
@@ -185,6 +190,7 @@
+ * {{$t('primaryCoverageCn')}}
@@ -200,6 +206,7 @@
+ * {{$t('primaryCoverageEn')}}
@@ -245,9 +252,10 @@
+ * {{$t('regulatoryContact')}}
- +
+ * {{$t('title')}}
@@ -18,6 +19,7 @@
+ * {{$t('englishTitle')}}
@@ -110,6 +112,7 @@
+ * {{$t('primaryCoverageCn')}}
@@ -125,6 +128,7 @@
+ * {{$t('primaryCoverageEn')}}
@@ -165,6 +169,11 @@ return { rules: { titleCn: [ + { + required: true, + message: this.$t('title') + this.$t('cannotEmpty'), + trigger: 'blur' + }, { max: 500, message: this.$t('title') + this.$t('cannotExceed') + 500 + this.$t('Characters'), @@ -172,6 +181,11 @@ } ], titleEn: [ + { + required: true, + message: this.$t('englishTitle') + this.$t('cannotEmpty'), + trigger: 'blur' + }, { max: 500, message: this.$t('englishTitle') + this.$t('cannotExceed') + 500 + this.$t('Characters'), @@ -222,15 +236,25 @@ ], contentEn: [ { - max: 300, - message: this.$t('primaryCoverageEn') + this.$t('cannotExceed') + 300 + this.$t('Characters'), + required: true, + message: this.$t('primaryCoverageEn') + this.$t('cannotEmpty'), + trigger: 'blur' + }, + { + max: 5000, + message: this.$t('primaryCoverageEn') + this.$t('cannotExceed') + 5000 + this.$t('Characters'), trigger: 'blur' } ], contentCn: [ { - max: 300, - message: this.$t('primaryCoverageCn') + this.$t('cannotExceed') + 300 + this.$t('Characters'), + required: true, + message: this.$t('primaryCoverageCn') + this.$t('cannotEmpty'), + trigger: 'blur' + }, + { + max: 5000, + message: this.$t('primaryCoverageCn') + this.$t('cannotExceed') + 5000 + this.$t('Characters'), trigger: 'blur' } ] diff --git a/jero-web/src/views/businessSupport/technologyAssessment/components/TermInformation.vue b/jero-web/src/views/businessSupport/technologyAssessment/components/TermInformation.vue index 9e3374a4a..36d49be72 100644 --- a/jero-web/src/views/businessSupport/technologyAssessment/components/TermInformation.vue +++ b/jero-web/src/views/businessSupport/technologyAssessment/components/TermInformation.vue @@ -6,13 +6,14 @@ :visible="visible" :confirm-loading="confirmLoading" :maskClosable="false" + :footer="null" @cancel="visible = false" > - + + + + +
diff --git a/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsClause.vue b/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsClause.vue index 667c1dcd1..7fe05490c 100644 --- a/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsClause.vue +++ b/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsClause.vue @@ -306,7 +306,8 @@ let query = { ...this.queryParam, ids: selectedRowKeys.join(','), - lawsTechnologyEvaluationId: this.$route.query.id + lawsTechnologyEvaluationId: this.$route.query.id, + serialNumber: this.$route.query.serialNumber } downloadFile(this.url.exportData, this.$route.query.serialNumber + ' ' + this.$t('regulatoryTechnicalEvaluationResults') + '.zip', query, this.Deselect) diff --git a/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsWhole.vue b/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsWhole.vue index cd25daf21..a57c1df23 100644 --- a/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsWhole.vue +++ b/jero-web/src/views/businessSupport/technologyAssessment/components/evaluationResultsWhole.vue @@ -39,22 +39,22 @@ -
-
- {{$t('engineer')+item.createBy+$t('feedbackResults')}} -
-
- {{$t('complianceResults')}}:{{item.complianceResultName}} -
-
+ + + + + + + + +
{{$t('fileExport')}}
+ { + const obj = { + children: value, + attrs: {} + } + if (index === 0) { + obj.attrs.rowSpan = row.indexData + } else { + obj.attrs.rowSpan = 0 + } + return obj + } + }, + { + title: this.$t('complianceResults'), + dataIndex: 'complianceResultName', + align: 'center', + width: 160, + ellipsis: true, + customRender: (value, row, index) => { + const obj = { + children: value, + attrs: {} + } + if (index === 0) { + obj.attrs.rowSpan = row.indexData + } else { + obj.attrs.rowSpan = 0 + } + return obj + } + }, { title: this.$t('relevantSections'), dataIndex: 'relatedSection', @@ -190,6 +228,18 @@ getAction(this.url.list, query).then((res) => { if (res.success) { this.dataSource = res.result || [] + if (this.dataSource && this.dataSource.length > 0) { + this.dataSource.forEach(val => { + if (val.lawsTechnologyEvaluationResultEOList && val.lawsTechnologyEvaluationResultEOList.length > 0) { + val.lawsTechnologyEvaluationResultEOList.forEach(ol => { + ol.indexData = val.lawsTechnologyEvaluationResultEOList.length + ol.complianceResultName = val.complianceResultName + ol.createBy = val.createBy + }) + } + }) + } + console.log(this.dataSource) if (this.dataSource.length == 0) { this.dataSource.push({ name: '' @@ -353,9 +403,10 @@ .table-operator-admin-right { float: left; - width: calc(100% - 240px); + width: 100%; text-align: right; - border-left: 1px solid #e8e8e8; + margin-bottom: 20px; + /*border-left: 1px solid #e8e8e8;*/ } .operator-text-index { diff --git a/jero-web/src/views/businessSupport/technologyAssessment/index.vue b/jero-web/src/views/businessSupport/technologyAssessment/index.vue index 5da2533c3..bac006983 100644 --- a/jero-web/src/views/businessSupport/technologyAssessment/index.vue +++ b/jero-web/src/views/businessSupport/technologyAssessment/index.vue @@ -262,6 +262,13 @@ ellipsis: true, dataIndex: 'flowStatusName' }, + { + title: this.$t('Sponsor'), + align: 'center', + width: 140, + ellipsis: true, + dataIndex: 'createBy' + }, { title: this.$t('dateOfInitiation'), align: 'center', @@ -464,8 +471,8 @@ lawsTechnologyEvaluationId: row.id, standId: row.standId, remark: row.remark, - createBy:row.createBy, - flowStatus:row.flowStatus + createBy: row.createBy, + flowStatus: row.flowStatus } }) window.open(newUrl.href, '_blank') @@ -479,8 +486,8 @@ lawsTechnologyEvaluationId: row.id, standId: row.standId, remark: row.remark, - createBy:row.createBy, - flowStatus:row.flowStatus + createBy: row.createBy, + flowStatus: row.flowStatus } }) window.open(newUrl.href, '_blank') diff --git a/jero-web/src/views/dashboard/components/monthlyReportRegulations.vue b/jero-web/src/views/dashboard/components/monthlyReportRegulations.vue index 96f62e53f..7955c1749 100644 --- a/jero-web/src/views/dashboard/components/monthlyReportRegulations.vue +++ b/jero-web/src/views/dashboard/components/monthlyReportRegulations.vue @@ -33,6 +33,7 @@ monthlyReportRegulationsList: [], loading: false, downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', url: { list: '/report/lawsMonthlyReportManageEO/page' } @@ -74,10 +75,12 @@ } else if (fileSuffix === '.docx' || fileSuffix === '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + item.fileId + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix === '.xlsx' || fileSuffix === '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix === '.xlsx' || fileSuffix === '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + item.fileId + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + item.fileId + fileSuffix) + window.open(url, '_blank') } else { if (item.createBy == this.userInfo().username){ downloadFile('/sys/common/downLoadFile', item.name, { id: item.fileId, userName: this.userInfo().username }) diff --git a/jero-web/src/views/documentManage/collection/components/problemKnowledgeBaseList.vue b/jero-web/src/views/documentManage/collection/components/problemKnowledgeBaseList.vue index 8d9566e23..bdb7e2f03 100644 --- a/jero-web/src/views/documentManage/collection/components/problemKnowledgeBaseList.vue +++ b/jero-web/src/views/documentManage/collection/components/problemKnowledgeBaseList.vue @@ -205,7 +205,8 @@ }, getText(str) { let words = str.replace(/<[^<>]+>/g, '').replace(/ /gi, '') //这里是去除标签 - return words.replace(/\s/g, '') //这里是去除空格 + //.replace(/\s/g, '') //这里是去除空格 + return words }, getList() { let query = { diff --git a/jero-web/src/views/documentManage/library/docDetail/index.vue b/jero-web/src/views/documentManage/library/docDetail/index.vue index 0fc6f949e..8f770354b 100644 --- a/jero-web/src/views/documentManage/library/docDetail/index.vue +++ b/jero-web/src/views/documentManage/library/docDetail/index.vue @@ -319,6 +319,7 @@ serial_number: '', confirmLoading: false, downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', loading: false, dataSource: [], pageNo: 1, @@ -462,10 +463,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id }) } diff --git a/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue b/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue index 38a09b877..c51d31859 100644 --- a/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue +++ b/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue @@ -155,6 +155,7 @@
{{$t('comparisonResults')}}
+
+ + {{$t('viewVarianceAssessment')}} +
{{$t('viewConsistentAssessment')}}
{{$t('viewAll')}} @@ -40,12 +49,19 @@
- {{$t('selectedStandard')}}:{{resultData.serialNumberLeft}} {{resultData.fileNameLeft}} + {{$t('selectedStandard')}}:{{resultData.serialNumberLeft}} + {{resultData.fileNameLeft}}
- {{$t('selectedStandard')}}:{{resultData.serialNumberRight}} {{resultData.fileNameRight}} + {{$t('selectedStandard')}}:{{resultData.serialNumberRight}} + {{resultData.fileNameRight}} +
+
+ {{$t('comparisonDifferenceComment')}}
{{$t('operation')}} @@ -75,19 +91,24 @@
-
-
- - {{$t('comparisonDifferenceComment')}}: -
-
+
+
{{item.comment}}
+ + + + + + + + + + + + +
@@ -141,7 +162,7 @@ {{$t('fullTextComments')}}
- @@ -167,6 +188,8 @@ import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage' import commentList from './commentList' import { putAction } from '../../../../api/manage' + import { Base64 } from 'js-base64' + import { mapGetters } from 'vuex' export default { name: 'comparisonResults', @@ -177,7 +200,12 @@ return { loading: false, checkboxList: [], + isVarianceOne: false, + isVarianceTwo: false, + isVarianceThe: false, confirmLoading: false, + downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', visible: false, formInlineText: {}, rulesText: {}, @@ -205,6 +233,7 @@ this.getData() }, methods: { + ...mapGetters(['userInfo']), Fallback() { this.$router.push({ path: '/documentComparison' @@ -232,12 +261,45 @@ }, viewConsistentAssessmentClick() { this.comment = '一致' + this.isVarianceTwo = true + this.isVarianceOne = false + this.isVarianceThe = false + this.getData() + }, + viewVarianceAssessmentClick() { + this.isVarianceOne = true + this.isVarianceTwo = false + this.isVarianceThe = false + this.comment = '差异' this.getData() }, viewAllClick() { this.comment = '' + this.isVarianceThe = true + this.isVarianceOne = false + this.isVarianceTwo = false this.getData() }, + fileClick(name, id) { + let fileName = name + let index1 = fileName.lastIndexOf('.') + let index2 = fileName.length + let fileSuffix = fileName.substring(index1, index2) + if (fileSuffix == '.pdf') { + window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + id + '&userName=' + this.userInfo().username)) + } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) + window.open(url, '_blank') + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) + window.open(url, '_blank') + } else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + id + fileSuffix) + window.open(url, '_blank') + } else { + downloadFile('/sys/common/downLoadFile', name, { id: id }) + } + }, getData() { let query = { id: this.$route.query.id, @@ -432,6 +494,7 @@ .operator-text-text { cursor: pointer; margin-right: 53px; + max-width: 138px; font-size: 14px; font-weight: 400; color: #040B29; @@ -466,7 +529,7 @@ color: #040B29; .detail-content-header-content-left { - width: calc(50% - 64px); + width: calc(50% - 194px); height: 56px; display: inline-block; background: rgba(4, 11, 41, 0.0300); @@ -479,7 +542,7 @@ } .detail-content-header-content-content { - width: calc(50% - 64px); + width: calc(50% - 194px); display: inline-block; height: 56px; background: rgba(4, 11, 41, 0.0300); @@ -491,6 +554,19 @@ white-space: nowrap; } + .detail-content-header-content-rightOne { + width: 260px; + display: inline-block; + height: 56px; + background: rgba(4, 11, 41, 0.0300); + border-radius: 4px 0px 0px 4px; + padding-left: 24px; + border-right: 1px #EFF1F3 solid; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .detail-content-header-content-right { width: 128px; display: inline-block; @@ -562,7 +638,7 @@ } .detail-content-left { - width: 50%; + width: calc(50% - 130px); display: inline-block; float: left; padding-right: 24px; @@ -570,10 +646,20 @@ } .detail-content-right { - width: 50%; + width: calc(50% - 104px); display: inline-block; float: left; padding-left: 24px; + padding-right: 24px; + border-right: 1px #EFF1F3 solid; + } + + .detail-content-right-one { + width: 234px; + display: inline-block; + float: left; + padding-left: 24px; + /*border-right: 1px #EFF1F3 solid;*/ } .detail-content-left-top { @@ -675,4 +761,7 @@ .detail-content-bottom-right-text { width: calc(50% - 256px); } + .operator-text-text-text{ + color: #00B3BE!important; + } \ No newline at end of file diff --git a/jero-web/src/views/documentTools/documentComparison/components/documentDataComparison.vue b/jero-web/src/views/documentTools/documentComparison/components/documentDataComparison.vue index 4d0b38763..309f061db 100644 --- a/jero-web/src/views/documentTools/documentComparison/components/documentDataComparison.vue +++ b/jero-web/src/views/documentTools/documentComparison/components/documentDataComparison.vue @@ -91,7 +91,9 @@
- +
{{$t('comparativeComments')}} @@ -99,7 +101,7 @@ + :rows="3"/>
@@ -135,7 +137,7 @@ {{$t('fullTextComments')}}
- @@ -536,7 +538,7 @@ .detail-content-left { width: 50%; float: left; - height: 620px; + height: calc(100vh - 210px); border-right: 2px #EFF1F3 solid; padding: 24px 32px; box-sizing: border-box; @@ -545,7 +547,7 @@ .detail-content-right { width: 50%; - height: 620px; + height: calc(100vh - 210px); float: left; padding: 24px 32px; box-sizing: border-box; @@ -593,6 +595,7 @@ .Remarks { margin-top: 20px; width: 50%; + display: inline-block; padding: 0 32px; box-sizing: border-box; } @@ -602,7 +605,8 @@ } .submit-button { - width: 100%; + display: inline-block; + width: 50%; margin-top: 20px; text-align: right; padding: 0 32px; diff --git a/jero-web/src/views/documentTools/documentComparison/components/initiateComparison.vue b/jero-web/src/views/documentTools/documentComparison/components/initiateComparison.vue index f110bf30f..7375c90ee 100644 --- a/jero-web/src/views/documentTools/documentComparison/components/initiateComparison.vue +++ b/jero-web/src/views/documentTools/documentComparison/components/initiateComparison.vue @@ -196,6 +196,7 @@ pageNoRight: 1, formInline: {}, downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', rules: { remark: [ { @@ -388,10 +389,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.fileId + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.fileId + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.fileId + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.fileId }) } diff --git a/jero-web/src/views/documentTools/documentComparison/index.vue b/jero-web/src/views/documentTools/documentComparison/index.vue index 0db7f9fde..57657ca5e 100644 --- a/jero-web/src/views/documentTools/documentComparison/index.vue +++ b/jero-web/src/views/documentTools/documentComparison/index.vue @@ -8,7 +8,7 @@
{{$t('standard')}}
-
@@ -17,7 +17,7 @@
{{$t('title')}}
-
@@ -42,11 +42,11 @@
-
+
{{$t('initiateComparison')}}
-
+
{{$t('BatchDelete')}}
@@ -67,15 +67,15 @@ {{$t('comparisonResults')}} {{!record.releaseState || record.releaseState == 'draft' ? $t('release') :$t('withdraw')}} {{$t('edit')}} {{$t('delete')}} @@ -126,15 +126,17 @@ dataSource: [], selectedRowKeys: [], downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', total: 0, pageSize: 10, pageNo: 1, queryParam: {}, userInfoQuery: {}, + administrators:false, selectedRowKeysRecord: [], columns: [ { - title: this.$t('standard') + 1, + title: this.$t('standard') + ' 1', align: 'center', dataIndex: 'serialNumberLeft', width: 170, @@ -142,7 +144,7 @@ scopedSlots: { customRender: 'serialNumberLeft' } }, { - title: this.$t('title') + 1, + title: this.$t('title') + ' 1', align: 'center', dataIndex: 'titleLeft', width: 170, @@ -150,7 +152,7 @@ scopedSlots: { customRender: 'serialNumberLeft' } }, { - title: this.$t('TextStatus') + 1, + title: this.$t('TextStatus') + ' 1', align: 'center', width: 200, ellipsis: true, @@ -165,7 +167,7 @@ // scopedSlots: { customRender: 'fileNameLeft' } // }, { - title: this.$t('standard') + 2, + title: this.$t('standard') + ' 2', align: 'center', dataIndex: 'serialNumberRight', ellipsis: true, @@ -173,7 +175,7 @@ width: 170 }, { - title: this.$t('title') + 2, + title: this.$t('title') + ' 2', align: 'center', dataIndex: 'titleRight', scopedSlots: { customRender: 'serialNumberRight' }, @@ -181,7 +183,7 @@ width: 170 }, { - title: this.$t('TextStatus') + 2, + title: this.$t('TextStatus') + ' 2', align: 'center', width: 200, ellipsis: true, @@ -232,6 +234,14 @@ this.queryParam = { ...this.queryParam } } this.userInfoQuery = this.userInfo() + this.administrators = false + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } this.getList() }, methods: { @@ -422,10 +432,12 @@ } else if (fileSuffix === '.docx' || fileSuffix === '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + row.fileIdLeft + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix === '.xlsx' || fileSuffix === '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix === '.xlsx' || fileSuffix === '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + row.fileIdLeft + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + row.fileIdLeft + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', row.fileNameLeft, { id: row.fileIdLeft }) } @@ -440,10 +452,12 @@ } else if (fileSuffix === '.docx' || fileSuffix === '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + row.fileIdRight + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix === '.xlsx' || fileSuffix === '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix === '.xlsx' || fileSuffix === '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + row.fileIdRight + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + row.fileIdRight + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', row.fileNameRight, { id: row.fileIdRight }) } diff --git a/jero-web/src/views/documentTools/documentTranslation/index.vue b/jero-web/src/views/documentTools/documentTranslation/index.vue index 36096b058..c78b81e2a 100644 --- a/jero-web/src/views/documentTools/documentTranslation/index.vue +++ b/jero-web/src/views/documentTools/documentTranslation/index.vue @@ -8,7 +8,7 @@
{{$t('standard')}}
-
@@ -17,7 +17,7 @@
{{$t('title')}}
-
@@ -27,7 +27,7 @@ {{$t('translationResults')}}
@@ -59,15 +59,15 @@
-
+
{{$t('upload1')}}
-
+
{{$t('RetrieveFiles')}}
-
+
{{$t('BatchDelete')}}
@@ -86,18 +86,22 @@ > - {{$t('view')}} + {{$t('view')}} {{!record.releaseCondition || record.releaseCondition == 'draft' ? $t('release') :$t('withdraw')}} {{$t('download')}} {{$t('delete')}} @@ -158,6 +162,7 @@ queryParam: {}, userInfoQuery: {}, selectedRowKeysRecord: [], + administrators:false, columns: [ { title: this.$t('standard'), @@ -233,6 +238,14 @@ } this.getList() this.userInfoQuery = this.userInfo() + this.administrators = false + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } }, methods: { ...mapGetters(['userInfo']), diff --git a/jero-web/src/views/documentTools/searchCenter/components/DocumentLibrary.vue b/jero-web/src/views/documentTools/searchCenter/components/DocumentLibrary.vue index 176ad2d8e..586d54b97 100644 --- a/jero-web/src/views/documentTools/searchCenter/components/DocumentLibrary.vue +++ b/jero-web/src/views/documentTools/searchCenter/components/DocumentLibrary.vue @@ -352,6 +352,7 @@ selectModel: '', fileList: [], downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', queryParamSeach: '', mapOne: {}, mapTwo: {}, @@ -696,10 +697,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', fileQuery.fileName || fileQuery.file_name, { id: fileQuery.id }) } diff --git a/jero-web/src/views/documentTools/searchCenter/components/monthlyReportRegulations.vue b/jero-web/src/views/documentTools/searchCenter/components/monthlyReportRegulations.vue index 4983ee2fc..a5ce3f338 100644 --- a/jero-web/src/views/documentTools/searchCenter/components/monthlyReportRegulations.vue +++ b/jero-web/src/views/documentTools/searchCenter/components/monthlyReportRegulations.vue @@ -92,6 +92,7 @@ total: 0, pageSize: 10, downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', pageNo: 1, queryParam: {} } @@ -129,10 +130,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + item.file_id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + item.file_id + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + item.file_id + fileSuffix) + window.open(url, '_blank') } }, ResetSearch() { @@ -151,10 +154,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id.slice(0, 32) + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id.slice(0, 32) + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id.slice(0, 32) + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', fileQuery.file_name, { id: fileQuery.id.slice(0, 32) }) } diff --git a/jero-web/src/views/documentTools/searchCenter/components/problemKnowledgeBase.vue b/jero-web/src/views/documentTools/searchCenter/components/problemKnowledgeBase.vue index 13b476153..f22aa238b 100644 --- a/jero-web/src/views/documentTools/searchCenter/components/problemKnowledgeBase.vue +++ b/jero-web/src/views/documentTools/searchCenter/components/problemKnowledgeBase.vue @@ -4,8 +4,8 @@
- {{$t('problemClassification')}} - {{$t('classification')}} + {{$t('market')}}
@@ -132,6 +132,7 @@ loading: false, fileList: [], downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', mapOne: {}, mapTwo: {}, queryParamOne: {}, @@ -175,13 +176,20 @@ }) }, checkedClick(item) { - let newUrl = this.$router.resolve({ - path: '/problemKnowledgeBaseView', + localStorage.setItem('problemknowledgeBase',JSON.stringify(item)) + this.$router.push({ + path: '/problemknowledgeBase', query: { id: item.id } }) - window.open(newUrl.href, '_blank') + // let newUrl = this.$router.resolve({ + // path: '/problemknowledgeBase', + // query: { + // id: item.id + // } + // }) + // window.open(newUrl.href, '_blank') }, pageOnChange(page, pageSize) { this.pageNo = page @@ -221,7 +229,8 @@ }, getText(str) { let words = str.replace(/<[^<>]+>/g, '').replace(/ /gi, '') //这里是去除标签 - return words.replace(/\s/g, '') //这里是去除空格 + //.replace(/\s/g, '') //这里是去除空格 + return words }, getParagraphInfoList() { let queryParamIndex = JSON.parse(JSON.stringify(this.queryParam)) @@ -267,10 +276,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', fileQuery.fileName || fileQuery.file_name, { id: fileQuery.id }) } diff --git a/jero-web/src/views/documentTools/searchCenter/components/whole.vue b/jero-web/src/views/documentTools/searchCenter/components/whole.vue index b59a97b57..0b2597018 100644 --- a/jero-web/src/views/documentTools/searchCenter/components/whole.vue +++ b/jero-web/src/views/documentTools/searchCenter/components/whole.vue @@ -116,6 +116,7 @@ total: 0, pageSize: 10, downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', pageNo: 1, queryParam: {} } @@ -170,10 +171,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id.slice(0, 32) + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id.slice(0, 32) + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id.slice(0, 32) + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', fileQuery.file_name, { id: fileQuery.id.slice(0, 32) }) } @@ -198,7 +201,8 @@ }, getText(str) { let words = str.replace(/<[^<>]+>/g, '').replace(/ /gi, '') //这里是去除标签 - return words.replace(/\s/g, '') //这里是去除空格 + //.replace(/\s/g, '') //这里是去除空格 + return words }, getList() { let queryParam = JSON.parse(JSON.stringify(this.queryParam)) @@ -239,10 +243,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + item.file_id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + item.file_id + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + item.file_id + fileSuffix) + window.open(url, '_blank') } }, titleClick(item) { diff --git a/jero-web/src/views/documentTools/searchCenter/index.vue b/jero-web/src/views/documentTools/searchCenter/index.vue index 8270a0c4b..eb06f6f1e 100644 --- a/jero-web/src/views/documentTools/searchCenter/index.vue +++ b/jero-web/src/views/documentTools/searchCenter/index.vue @@ -26,7 +26,7 @@ v-else-if="active === $t('whole') || active === $t('problemKnowledgeBase') || active === $t('monthlyReportRegulations')" class="inputSearch" - :placeholder="$t('pleaseEnter')+$t('searchContent')" + :placeholder="$t('enterSearchContent')" > * {{$t('file')}} + :title="$t('fileName')">{{$t('fileName')}}
18?title.slice(0,17)+'...':title}} @@ -61,10 +61,10 @@
-
- {{ $t('file') }} +
+ {{ $t('fileName') }}
-
@@ -82,16 +82,17 @@
{{ $t('uploadTime') }}
- + + class="box-input" + @change="onChange" + style='margin-left: -1px' + v-model="queryParams.time" + :disabled="false"/>
- + @@ -106,18 +107,22 @@
-
+
{{ $t('UploadFile') }}
-
+
{{ $t('BatchDelete') }}
@@ -158,9 +169,9 @@ />
- + - + - -
-
- * - {{$t('Foldername')}} + +
+
+ * + {{$t('Foldername')}} +
+ + +
- - - -
- - + +
@@ -205,9 +216,10 @@ {{$t('Administrativeprivileges')}}
- + {{$t('Checkthepermissions')}}
- + {{$t('Folderorder')}}
- + + :parser="limitNumber"/>
@@ -255,436 +268,453 @@ -
+
-
+
+ + + .split-detail-search-header { + .ant-col-sm-8 { + min-width: 300px; + } - \ No newline at end of file diff --git a/jero-web/src/views/processCenter/components/engineeringConfirmation.vue b/jero-web/src/views/processCenter/components/engineeringConfirmation.vue index bc666817e..3028d1b80 100644 --- a/jero-web/src/views/processCenter/components/engineeringConfirmation.vue +++ b/jero-web/src/views/processCenter/components/engineeringConfirmation.vue @@ -99,6 +99,7 @@ diff --git a/jero-web/src/views/processCenter/components/feedbackInformation.vue b/jero-web/src/views/processCenter/components/feedbackInformation.vue index 3b9722099..c86a652cb 100644 --- a/jero-web/src/views/processCenter/components/feedbackInformation.vue +++ b/jero-web/src/views/processCenter/components/feedbackInformation.vue @@ -31,25 +31,29 @@ :rules="[{ required: true, message: $t('relevantSections') + $t('cannotEmpty'), trigger: 'blur'}, {max: 300,message: $t('relevantSections') + $t('cannotExceed') + 300 + $t('Characters'),trigger: 'blur' }]"> - + + + + +
- {{$t('enclosure')}} + {{$t('clauseContent')}}
- - - {{ (item.accessoryFile === 'null' || item.accessoryFile === '' || - item.accessoryFile == null) ? $t('clickUpload') : $t('viewUploadedFiles') - }} - + +
@@ -95,16 +99,15 @@
- {{$t('clauseContent')}} + {{$t('enclosure')}}
- - + + + {{ (item.accessoryFile === 'null' || item.accessoryFile === '' || + item.accessoryFile == null) ? $t('clickUpload') : $t('viewUploadedFiles') + }} +
diff --git a/jero-web/src/views/processCenter/components/standardContentList.vue b/jero-web/src/views/processCenter/components/standardContentList.vue index dcc984c20..32fd02fd5 100644 --- a/jero-web/src/views/processCenter/components/standardContentList.vue +++ b/jero-web/src/views/processCenter/components/standardContentList.vue @@ -71,6 +71,7 @@ return { dataSource: [], downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', columns: [ { title: this.$t('ProcessType'), @@ -187,10 +188,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id }) } @@ -205,10 +208,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + id + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', name, { id: id }) } diff --git a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue index 904a21025..1fb2a099e 100644 --- a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue +++ b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue @@ -717,6 +717,7 @@ if (res.success) { this.currentPersonRole = this.formInlineRoleSwitching.roleSwitchingCode this.$message.success(this.$t('OperationSuccessful')) + this.$refs.CollectionTabel.getHeader(this.currentPersonRole) this.visibleRoleSwitching = false this.confirmLoadingRoleSwitching = false localStorage.setItem('currentPersonRole', JSON.stringify(this.formInlineRoleSwitching.roleSwitchingCode)) diff --git a/jero-web/src/views/projectManagement/components/addModel.vue b/jero-web/src/views/projectManagement/components/addModel.vue index 65b190bd4..4a4469093 100644 --- a/jero-web/src/views/projectManagement/components/addModel.vue +++ b/jero-web/src/views/projectManagement/components/addModel.vue @@ -93,10 +93,11 @@ * {{$t('StudioEngineer')}}
- + @@ -108,10 +109,11 @@
{{$t('certifiedEngineer')}}
- + diff --git a/jero-web/src/views/projectManagement/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/components/listOfRegulations.vue index b2b6e72b1..c09c6e5c9 100644 --- a/jero-web/src/views/projectManagement/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/components/listOfRegulations.vue @@ -848,6 +848,7 @@ AndUserIdEdit: '/project/projectLibraryRoleRelEO/edit' }, downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', loading: false, dataSource: [], isResultReported: false, @@ -1455,15 +1456,18 @@ this.selectedRowKeys = value }, searchQuery() { + this.selectedRowKeys = [] this.getList() }, searchReset() { this.queryParam = {} + this.selectedRowKeys = [] this.$refs.globalAdvancedQueryRef.resetLine() this.$refs.globalAdvancedQueryRef.emitCallback() // this.getList() }, addModelList() { + this.selectedRowKeys = [] this.getList() }, handleSuperQuery(params, matchType) { @@ -2126,10 +2130,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') + } else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id }) } @@ -2145,10 +2151,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) window.open(url, '_blank') + } else if (fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + id + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', name, { id: id, userName: this.userInfo().username }) } @@ -2479,17 +2487,17 @@ } ::v-deep .ant-table-body-one { - padding-bottom: 0!important; + padding-bottom: 0 !important; } ::v-deep .antfixedLeft { - padding-bottom: 0!important; - overflow: scroll!important; + padding-bottom: 0 !important; + overflow: scroll !important; } ::v-deep .antfixedRight { - padding-bottom: 0!important; - overflow: scroll!important; + padding-bottom: 0 !important; + overflow: scroll !important; } \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/historicalVersion/index.vue b/jero-web/src/views/projectManagement/historicalVersion/index.vue index e6e932166..a2ce6ffa2 100644 --- a/jero-web/src/views/projectManagement/historicalVersion/index.vue +++ b/jero-web/src/views/projectManagement/historicalVersion/index.vue @@ -363,6 +363,7 @@ list: '/project/projectVersionInfoEO/list' }, downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download', + downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download', loading: false, dataSource: [], // fieldList | array |✔| 需要查询的列集合示例如下,type类型有:date/datetime/string/int/number @@ -468,10 +469,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.id + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id }) } @@ -486,10 +489,12 @@ } else if (fileSuffix == '.docx' || fileSuffix == '.doc') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) window.open(url, '_blank') - } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls' - || fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') { + } else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') { let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) window.open(url, '_blank') + }else if(fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg'){ + let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + id + fileSuffix) + window.open(url, '_blank') } else { downloadFile('/sys/common/downLoadFile', name, { id: id }) } diff --git a/jero-web/src/views/regulationsKanban/index.vue b/jero-web/src/views/regulationsKanban/index.vue index 4dd1c1f39..6ec89741c 100644 --- a/jero-web/src/views/regulationsKanban/index.vue +++ b/jero-web/src/views/regulationsKanban/index.vue @@ -65,7 +65,9 @@
-
+
{{ $t('Deriveconformanceresults') }}
@@ -96,7 +98,7 @@ - {{$t('view')}} + {{$t('view')}}
diff --git a/jero-web/src/views/regulatoryEarlyWarning/index.vue b/jero-web/src/views/regulatoryEarlyWarning/index.vue index dbb45982a..1d39b7282 100644 --- a/jero-web/src/views/regulatoryEarlyWarning/index.vue +++ b/jero-web/src/views/regulatoryEarlyWarning/index.vue @@ -8,11 +8,14 @@ :url="url"/>
-
+
{{$t('Push')}}
-
+
{{$t('export')}}