合并分支 'master' 到 'fix_bug_first_stage'

Master

查看合并请求 laws-nio/laws-weilai!60
This commit is contained in:
李雪涛
2022-07-09 11:16:48 +08:00
54 changed files with 3200 additions and 218 deletions
@@ -203,4 +203,38 @@ CREATE TABLE `params_report_export_history` (
-- 参数清单历史版本 添加字段 -- 参数清单历史版本 添加字段
ALTER TABLE `laws_weilai`.`params_manifest_history` ALTER TABLE `laws_weilai`.`params_manifest_history`
ADD COLUMN `source_params_manifest_id` varchar(50) NULL COMMENT '源参数清单id' AFTER `params_template_publish_version`; ADD COLUMN `source_params_manifest_id` varchar(50) NULL COMMENT '源参数清单id' AFTER `params_template_publish_version`;
-- 上报库表 添加字段 2022-07-08
ALTER TABLE `laws_weilai`.`params_report`
ADD COLUMN `project_name` varchar(200) NULL COMMENT '项目名称' AFTER `params_template_publish_version`,
ADD COLUMN `title` varchar(200) NULL COMMENT '清单标题' AFTER `project_name`;
ALTER TABLE `laws_opinion_gather`
ADD COLUMN `opinion_archive_id` varchar(4000) NULL COMMENT '意见归档文件id' AFTER `prc_num`;
-- 法规技术评估流程相关表 - 法规技术评估表
CREATE TABLE `laws_technology_evaluation` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
`update_time` datetime NULL DEFAULT NULL COMMENT '更新日期',
`sys_org_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所属部门',
`stand_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标准id',
`serial_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '编号',
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
`technology_territory` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '技术领域',
`evaluation_methods` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评估方式',
`flow_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程状态',
`start_time` datetime NULL DEFAULT NULL COMMENT '发起日期',
`end_time` datetime NULL DEFAULT NULL COMMENT '截止日期',
`remark` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`acti_proc_inst_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程实例id',
`related_data_file_id` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '相关资料id',
`process_background` varchar(600) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程背景',
`regulation_owner_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '法规工程师id',
`evaluation_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评估类型(类型有:反馈评估、条款评估)',
`prc_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '法规技术评估表' ROW_FORMAT = DYNAMIC;
@@ -3,8 +3,11 @@ package com.jero.modules.cert.collect.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.modules.cert.collect.entity.ParamsManifestEO; import com.jero.modules.cert.collect.entity.ParamsManifestEO;
import com.jero.modules.cert.collect.vo.ParamsManifestVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @Description: 参数清单 * @Description: 参数清单
* @Author: jero-boot * @Author: jero-boot
@@ -18,4 +21,6 @@ public interface ParamsManifestEOMapper extends BaseMapper<ParamsManifestEO> {
@Param("state") String state, @Param("state") String state,
IPage page); IPage page);
List<ParamsManifestVO> listInfoAll(@Param("idList") List<String> idList);
} }
@@ -20,6 +20,7 @@
<resultMap id="ParamsManifestEOResultMapForCopy" type="com.jero.modules.cert.collect.vo.ParamsManifestVO"> <resultMap id="ParamsManifestEOResultMapForCopy" type="com.jero.modules.cert.collect.vo.ParamsManifestVO">
<id column="id" property="id" /> <id column="id" property="id" />
<result column="title" property="title" /> <result column="title" property="title" />
<result column="version" property="version" />
<result column="project_id" property="projectId" /> <result column="project_id" property="projectId" />
<result column="project_name" property="projectName" /> <result column="project_name" property="projectName" />
<result column="state" property="state" /> <result column="state" property="state" />
@@ -72,6 +73,7 @@
select select
pm.id as id, pm.id as id,
pm.title as title, pm.title as title,
pm.version as version,
pm.project_id as project_id, pm.project_id as project_id,
pm.state as state, pm.state as state,
concat(pni.project_name,'-',pyni.year_name) as project_name, concat(pni.project_name,'-',pyni.year_name) as project_name,
@@ -91,4 +93,23 @@
</if> </if>
order by create_time desc order by create_time desc
</select> </select>
<select id="listInfoAll" resultMap="ParamsManifestEOResultMapForCopy">
select tmp_tb.* from(
select
pm.id as id,
pm.version as version,
pm.title as title,
concat(pni.project_name,'-',pyni.year_name) as project_name
from params_manifest pm
left join project_library_base as plb on plb.id = pm.project_id
left join project_name_info as pni on plb.project_name_id = pni.id
left join project_year_name_info as pyni on plb.year_name_id=pyni.id
) tmp_tb
where 1=1 and id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper> </mapper>
@@ -34,4 +34,12 @@ public interface IParamsCollectManifestHistoryEOService extends IService<ParamsC
*/ */
List<Map<String, Object>> getHeader(String paramsManifestId, String flag, String cut); List<Map<String, Object>> getHeader(String paramsManifestId, String flag, String cut);
/**
* 批量删除
*
* @param ids
* @return
*/
boolean deleteByIds(List<String> ids);
} }
@@ -1,7 +1,6 @@
package com.jero.modules.cert.collect.service; package com.jero.modules.cert.collect.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.cert.collect.entity.ParamsConfigDataEO;
import com.jero.modules.cert.collect.entity.ParamsConfigDataHistoryEO; import com.jero.modules.cert.collect.entity.ParamsConfigDataHistoryEO;
import java.util.List; import java.util.List;
@@ -29,4 +28,7 @@ public interface IParamsConfigDataHistoryEOService extends IService<ParamsConfig
* @return * @return
*/ */
List<ParamsConfigDataHistoryEO> queryListByConfigIdList(List<String> configIdList); List<ParamsConfigDataHistoryEO> queryListByConfigIdList(List<String> configIdList);
int deleteByParamsCollectManifestIdList(List<String> paramsCollectManifestIdList);
} }
@@ -17,4 +17,6 @@ public interface IParamsManifestHistoryEOService extends IService<ParamsManifest
void addForChangeExtension(String paramsManifestId); void addForChangeExtension(String paramsManifestId);
List<ParamsManifestHistoryVO> getHistoryVersionList(String paramsManifestId); List<ParamsManifestHistoryVO> getHistoryVersionList(String paramsManifestId);
void deleteAllHistoryVersion(List<String> paramsManifestIdList);
} }
@@ -455,6 +455,19 @@ public class ParamsCollectManifestHistoryEOServiceImpl extends ServiceImpl<Param
return list; return list;
} }
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public boolean deleteByIds(List<String> ids) {
// 关联删除配置数据
paramsConfigDataHistoryEOService.deleteByParamsCollectManifestIdList(ids);
return removeByIds(ids);
}
/** /**
* 获取一个类和其父类的所有属性 * 获取一个类和其父类的所有属性
* *
@@ -7,6 +7,7 @@ import com.jero.modules.cert.collect.entity.ParamsConfigDataEO;
import com.jero.modules.cert.collect.entity.ParamsConfigDataHistoryEO; import com.jero.modules.cert.collect.entity.ParamsConfigDataHistoryEO;
import com.jero.modules.cert.collect.mapper.ParamsConfigDataHistoryEOMapper; import com.jero.modules.cert.collect.mapper.ParamsConfigDataHistoryEOMapper;
import com.jero.modules.cert.collect.service.IParamsConfigDataHistoryEOService; import com.jero.modules.cert.collect.service.IParamsConfigDataHistoryEOService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@@ -20,6 +21,9 @@ import java.util.List;
@Service @Service
public class ParamsConfigDataHistoryEOServiceImpl extends ServiceImpl<ParamsConfigDataHistoryEOMapper, ParamsConfigDataHistoryEO> implements IParamsConfigDataHistoryEOService { public class ParamsConfigDataHistoryEOServiceImpl extends ServiceImpl<ParamsConfigDataHistoryEOMapper, ParamsConfigDataHistoryEO> implements IParamsConfigDataHistoryEOService {
@Autowired
private ParamsConfigDataHistoryEOMapper paramsConfigDataHistoryEOMapper;
/** /**
* 通过id查询 * 通过id查询
* *
@@ -50,4 +54,12 @@ public class ParamsConfigDataHistoryEOServiceImpl extends ServiceImpl<ParamsConf
} }
return null; return null;
} }
@Override
public int deleteByParamsCollectManifestIdList(List<String> paramsCollectManifestIdList) {
LambdaQueryWrapper<ParamsConfigDataHistoryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ParamsConfigDataEO::getParamsCollectManifestId, paramsCollectManifestIdList);
return paramsConfigDataHistoryEOMapper.delete(queryWrapper);
}
} }
@@ -20,6 +20,7 @@ import com.jero.modules.cert.collect.mapper.ParamsConfigEOMapper;
import com.jero.modules.cert.collect.mapper.ParamsManifestEOMapper; import com.jero.modules.cert.collect.mapper.ParamsManifestEOMapper;
import com.jero.modules.cert.collect.service.*; import com.jero.modules.cert.collect.service.*;
import com.jero.modules.cert.collect.vo.ParamsManifestHistoryVO; import com.jero.modules.cert.collect.vo.ParamsManifestHistoryVO;
import com.jero.modules.cert.report.service.IParamsReportEOService;
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO; import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
import com.jero.modules.cert.template.entity.ParamsTemplateEO; import com.jero.modules.cert.template.entity.ParamsTemplateEO;
import com.jero.modules.cert.template.service.IParamsInfoPublishEOService; import com.jero.modules.cert.template.service.IParamsInfoPublishEOService;
@@ -81,6 +82,9 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
@Autowired @Autowired
private IParamsConfigDataEOService paramsConfigDataEOService; private IParamsConfigDataEOService paramsConfigDataEOService;
@Autowired
private IParamsReportEOService paramsReportEOService;
@@ -212,6 +216,14 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
} }
// 删除对应的历史版本数据
List<String> idList = new ArrayList<>();
idList.add(id);
paramsManifestHistoryEOService.deleteAllHistoryVersion(idList);
// 添加上报库的项目名称和清单标题
paramsReportEOService.setProjectNameAndTitle(idList);
return removeById(id); return removeById(id);
} }
@@ -251,6 +263,13 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
paramsCollectManifestEOService.deleteByIds(paramsCollectManifestIdList); paramsCollectManifestEOService.deleteByIds(paramsCollectManifestIdList);
} }
// 删除对应的历史版本数据
paramsManifestHistoryEOService.deleteAllHistoryVersion(ids);
// 添加上报库的项目名称和清单标题
paramsReportEOService.setProjectNameAndTitle(ids);
return removeByIds(ids); return removeByIds(ids);
} }
@@ -1,9 +1,11 @@
package com.jero.modules.cert.collect.service.impl; package com.jero.modules.cert.collect.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.modules.cert.collect.entity.*; import com.jero.modules.cert.collect.entity.*;
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper; import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper;
import com.jero.modules.cert.collect.mapper.ParamsConfigHistoryEOMapper;
import com.jero.modules.cert.collect.mapper.ParamsManifestHistoryEOMapper; import com.jero.modules.cert.collect.mapper.ParamsManifestHistoryEOMapper;
import com.jero.modules.cert.collect.service.*; import com.jero.modules.cert.collect.service.*;
import com.jero.modules.cert.collect.vo.ParamsManifestHistoryVO; import com.jero.modules.cert.collect.vo.ParamsManifestHistoryVO;
@@ -133,7 +135,7 @@ public class ParamsManifestHistoryEOServiceImpl extends ServiceImpl<ParamsManife
@Override @Override
public List<ParamsManifestHistoryVO> getHistoryVersionList(String paramsManifestId) { public List<ParamsManifestHistoryVO> getHistoryVersionList(String paramsManifestId) {
// 同一项目下标题时唯一的,历史版本和当前版本通过标题进行关联 // 历史版本和当前版本通过id进行关联
LambdaQueryWrapper<ParamsManifestHistoryEO> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ParamsManifestHistoryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ParamsManifestHistoryEO::getSourceParamsManifestId, paramsManifestId) queryWrapper.eq(ParamsManifestHistoryEO::getSourceParamsManifestId, paramsManifestId)
.orderByAsc(ParamsManifestHistoryEO::getVersion); .orderByAsc(ParamsManifestHistoryEO::getVersion);
@@ -149,4 +151,37 @@ public class ParamsManifestHistoryEOServiceImpl extends ServiceImpl<ParamsManife
return historyVersionList; return historyVersionList;
} }
@Autowired
private ParamsConfigHistoryEOMapper paramsConfigHistoryEOMapper;
@Autowired
private ParamsManifestHistoryEOMapper paramsManifestHistoryEOMapper;
@Override
public void deleteAllHistoryVersion(List<String> paramsManifestIdList) {
LambdaQueryWrapper<ParamsManifestHistoryEO> manifestHistoryEOLambdaQueryWrapper = new LambdaQueryWrapper<>();
manifestHistoryEOLambdaQueryWrapper.in(ParamsManifestHistoryEO::getSourceParamsManifestId, paramsManifestIdList);
List<ParamsManifestHistoryEO> list = list(manifestHistoryEOLambdaQueryWrapper);
if (CollectionUtil.isNotEmpty(list)) {
List<String> ids = list.stream().map(ParamsManifestHistoryEO::getId).collect(Collectors.toList());
// 关联删除配置
LambdaQueryWrapper<ParamsConfigHistoryEO> configEOQueryWrapper = new LambdaQueryWrapper<>();
configEOQueryWrapper.in(ParamsConfigHistoryEO::getParamsManifestId, ids);
paramsConfigHistoryEOMapper.delete(configEOQueryWrapper);
// 关联删除收集的参数项(包含配置数据)
LambdaQueryWrapper<ParamsCollectManifestHistoryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ParamsCollectManifestHistoryEO::getParamsManifestId, ids);
List<ParamsCollectManifestHistoryEO> paramsCollectManifestHistoryEOList = paramsCollectManifestHistoryEOService.list(queryWrapper);
if (CollectionUtil.isNotEmpty(paramsCollectManifestHistoryEOList)) {
List<String> paramsCollectManifestIdList = paramsCollectManifestHistoryEOList.stream().map(ParamsCollectManifestHistoryEO::getId).collect(Collectors.toList());
paramsCollectManifestHistoryEOService.deleteByIds(paramsCollectManifestIdList);
}
// 删除清单对应的所有历史版本清单
paramsManifestHistoryEOMapper.delete(manifestHistoryEOLambdaQueryWrapper);
}
}
} }
@@ -1,5 +1,6 @@
package com.jero.modules.cert.collect.vo; package com.jero.modules.cert.collect.vo;
import io.swagger.models.auth.In;
import lombok.Data; import lombok.Data;
/** /**
@@ -12,6 +13,7 @@ public class ParamsManifestVO {
private String id; private String id;
private String title; private String title;
private Integer version;
private String projectName; private String projectName;
private String projectId; private String projectId;
private String state; private String state;
@@ -1,13 +1,10 @@
package com.jero.modules.cert.report.controller; package com.jero.modules.cert.report.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController; import com.jero.common.system.base.controller.JeroController;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
import com.jero.modules.cert.report.entity.ParamsReportDetailEO; import com.jero.modules.cert.report.entity.ParamsReportDetailEO;
import com.jero.modules.cert.report.service.IParamsReportDetailEOService; import com.jero.modules.cert.report.service.IParamsReportDetailEOService;
import com.jero.modules.cert.report.vo.ParamsReportDetailVO; import com.jero.modules.cert.report.vo.ParamsReportDetailVO;
@@ -15,9 +12,11 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@@ -89,7 +88,7 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
@ApiOperation(value = "上报库参数项-常规导出") @ApiOperation(value = "上报库参数项-常规导出")
@GetMapping(value = "/exportNormal") @GetMapping(value = "/exportNormal")
// @RequiresPermissions("report:detail:export:normal") // @RequiresPermissions("report:detail:export:normal")
public void exportSplitInfoZip(ParamsReportDetailVO paramsReportDetailVO, public void exportNormal(ParamsReportDetailVO paramsReportDetailVO,
HttpServletResponse response, HttpServletResponse response,
HttpServletRequest request) { HttpServletRequest request) {
paramsReportDetailEOService.exportNormal(paramsReportDetailVO, response, request); paramsReportDetailEOService.exportNormal(paramsReportDetailVO, response, request);
@@ -140,4 +139,13 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
return Result.OK(templateLabelList); return Result.OK(templateLabelList);
} }
@ApiOperation(value = "上报库参数项-自定义导出")
@GetMapping(value = "/exportCustom")
// @RequiresPermissions("report:detail:export:custom")
public void exportCustom(ParamsReportDetailVO paramsReportDetailVO,
HttpServletResponse response,
HttpServletRequest request) {
paramsReportDetailEOService.exportCustom(paramsReportDetailVO, response, request);
}
} }
@@ -1,7 +1,6 @@
package com.jero.modules.cert.report.entity; package com.jero.modules.cert.report.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@@ -70,11 +69,9 @@ public class ParamsReportEO implements Serializable {
@ApiModelProperty(value = "对应参数模板发布版本") @ApiModelProperty(value = "对应参数模板发布版本")
private Integer paramsTemplatePublishVersion; private Integer paramsTemplatePublishVersion;
@TableField(exist = false)
@ApiModelProperty(value = "项目名称") @ApiModelProperty(value = "项目名称")
private String projectName; private String projectName;
@TableField(exist = false)
@ApiModelProperty(value = "清单标题") @ApiModelProperty(value = "清单标题")
private String title; private String title;
@@ -13,6 +13,8 @@
<result column="project_name" property="projectName" /> <result column="project_name" property="projectName" />
<result column="old_params_manifest_id" property="oldParamsManifestId" /> <result column="old_params_manifest_id" property="oldParamsManifestId" />
<result column="params_template_publish_version" property="paramsTemplatePublishVersion" /> <result column="params_template_publish_version" property="paramsTemplatePublishVersion" />
<result column="project_name" property="projectName" />
<result column="title" property="title" />
</resultMap> </resultMap>
<sql id="BaseColumnList"> <sql id="BaseColumnList">
@@ -24,8 +26,8 @@
pr.create_time as create_time, pr.create_time as create_time,
pr.update_by as update_by, pr.update_by as update_by,
pr.update_time as update_time, pr.update_time as update_time,
pm.title as title, if (pm.title is not null, pm.title, pr.title) as title,
pni.project_name as project_name if (pni.project_name is not null, concat(pni.project_name,'-', pyni.year_name), pr.project_name) as project_name
</sql> </sql>
<sql id="BaseQuerySql"> <sql id="BaseQuerySql">
@@ -48,6 +50,7 @@
left join params_manifest as pm on pm.id = pr.old_params_manifest_id left join params_manifest as pm on pm.id = pr.old_params_manifest_id
left join project_library_base as plb on plb.id = pm.project_id left join project_library_base as plb on plb.id = pm.project_id
left join project_name_info as pni on plb.project_name_id = pni.id left join project_name_info as pni on plb.project_name_id = pni.id
left join project_year_name_info as pyni on plb.year_name_id=pyni.id
) tmp_tb ) tmp_tb
<include refid="BaseQuerySql"/> <include refid="BaseQuerySql"/>
order by create_time desc order by create_time desc
@@ -36,6 +36,12 @@ public interface IParamsReportDetailEOService extends IService<ParamsReportDetai
*/ */
List<Map<String, Object>> getHeader(String paramsManifestId, String flag, String cut); List<Map<String, Object>> getHeader(String paramsManifestId, String flag, String cut);
/**
* 常规导出
* @param paramsReportDetailVO
* @param response
* @param request
*/
void exportNormal(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request); void exportNormal(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request);
// 配置-下拉选项 // 配置-下拉选项
@@ -43,4 +49,7 @@ public interface IParamsReportDetailEOService extends IService<ParamsReportDetai
// 导出模板下拉选项 // 导出模板下拉选项
List<Map<String, String>> getTemplateLabelList(); List<Map<String, String>> getTemplateLabelList();
void exportCustom(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request);
} }
@@ -67,4 +67,5 @@ public interface IParamsReportEOService extends IService<ParamsReportEO> {
ParamsReportEO queryByOldParamsManifestId(String oldParamsManifestId, Integer version); ParamsReportEO queryByOldParamsManifestId(String oldParamsManifestId, Integer version);
boolean setProjectNameAndTitle(List<String> oldParamsManifestIdList);
} }
@@ -14,7 +14,8 @@ import com.jero.common.exception.JeroBootException;
import com.jero.common.util.oss.CosBootUtil; import com.jero.common.util.oss.CosBootUtil;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField; import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl; import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.cert.collect.entity.*; import com.jero.modules.cert.collect.entity.ParamsConfigDataEO;
import com.jero.modules.cert.collect.entity.ParamsConfigEO;
import com.jero.modules.cert.collect.enums.CollectManifestStateEnum; import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
import com.jero.modules.cert.collect.enums.ConfigDataTypeEnum; import com.jero.modules.cert.collect.enums.ConfigDataTypeEnum;
import com.jero.modules.cert.collect.vo.ParamsConfigDataVO; import com.jero.modules.cert.collect.vo.ParamsConfigDataVO;
@@ -22,34 +23,23 @@ import com.jero.modules.cert.report.entity.*;
import com.jero.modules.cert.report.enums.ExportTypeEnum; import com.jero.modules.cert.report.enums.ExportTypeEnum;
import com.jero.modules.cert.report.mapper.ParamsReportDetailEOMapper; import com.jero.modules.cert.report.mapper.ParamsReportDetailEOMapper;
import com.jero.modules.cert.report.service.*; import com.jero.modules.cert.report.service.*;
import com.jero.modules.cert.report.util.Docx4jUtil;
import com.jero.modules.cert.report.vo.ParamsReportDetailVO; import com.jero.modules.cert.report.vo.ParamsReportDetailVO;
import com.jero.modules.cert.template.enums.ControlTypeEnum; import com.jero.modules.cert.template.enums.ControlTypeEnum;
import com.jero.modules.document.enums.FieldTypeEnum;
import com.jero.modules.ocr.util.LineHumpUtil; import com.jero.modules.ocr.util.LineHumpUtil;
import com.jero.modules.oss.entity.OSSFile; import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService; import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.split.common.ConvertHtml2Excel;
import com.jero.modules.split.common.ReadExcel; import com.jero.modules.split.common.ReadExcel;
import com.jero.modules.split.dto.FileSpiltValTableExportDto;
import com.jero.modules.split.dto.FileSplitValExportDto;
import com.jero.modules.split.dto.FileSplitValImgExportDto;
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
import com.jero.modules.split.page.SarFileSplitItemsEOPage;
import com.jero.modules.split.page.SarFileSplitItemsValEOPage;
import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.service.ISysDictItemService; import com.jero.modules.system.service.ISysDictItemService;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType; import org.apache.http.entity.ContentType;
import org.apache.poi.common.usermodel.HyperlinkType;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.Hyperlink;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.util.IOUtils; import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.usermodel.*; import org.apache.poi.xssf.usermodel.*;
import org.aspectj.util.FileUtil; import org.aspectj.util.FileUtil;
import org.docx4j.openpackaging.exceptions.Docx4JException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
@@ -97,6 +87,10 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
@Autowired @Autowired
private IParamsReportExportHistoryEOService paramsReportExportHistoryEOService; private IParamsReportExportHistoryEOService paramsReportExportHistoryEOService;
@Autowired
private IParamsExportTemplateEOService paramsExportTemplateEOService;
@Value(value = "${jero.path.upload}") @Value(value = "${jero.path.upload}")
private String uploadpath; private String uploadpath;
@@ -527,7 +521,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
List<String> fieldList = Arrays.asList(field.split(",")); // list形式 List<String> fieldList = Arrays.asList(field.split(",")); // list形式
// 查询导出数据 // 查询导出数据
List<Map<String, Object>> allParamsInfoList = queryForExport(paramsReportDetailVO); // id记得去掉 List<Map<String, Object>> allParamsInfoList = queryForExportNormal(paramsReportDetailVO); // id记得去掉
// 开始处理工作表 // 开始处理工作表
List<OSSFile> allRelevFileList = new ArrayList<>(); List<OSSFile> allRelevFileList = new ArrayList<>();
@@ -641,9 +635,6 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
return configLabelList; return configLabelList;
} }
@Autowired
private IParamsExportTemplateEOService paramsExportTemplateEOService;
@Override @Override
public List<Map<String, String>> getTemplateLabelList() { public List<Map<String, String>> getTemplateLabelList() {
// 查询所有导出模板 // 查询所有导出模板
@@ -664,6 +655,113 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
return templateLabelList; return templateLabelList;
} }
@Override
public void exportCustom(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request) {
OutputStream os = null;
OutputStream wordOS = null;
String fileOriName = "上报库参数项自定义导出信息";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
fileOriName = "Params report custom data";
}
if (StringUtils.isNotEmpty(paramsReportDetailVO.getExportName())) {
fileOriName = paramsReportDetailVO.getExportName();
}
//创建临时文件夹
String fileNowPath = uploadpath + "/tempZip/" + UUID.randomUUID().toString().replace("-","") + File.separator + fileOriName;
File nowFile = new File(fileNowPath);
if (nowFile.exists()){
nowFile.delete();
}
nowFile.mkdirs();
String fileName = fileOriName + ".docx";
// 查询导出数据
List<Map> allParamsInfoList = queryForExportCustom(paramsReportDetailVO);
Map<String, String> params = allParamsInfoList.get(0);
String templateUrl = "";
ParamsExportTemplateEO paramsExportTemplateEO = paramsExportTemplateEOService.getById(paramsReportDetailVO.getExportTemplateId());
List<OSSFile> ossFiles = ossFileService.getFileInfosByConnectId(paramsExportTemplateEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFiles)) {
templateUrl = ossFiles.get(0).getUrl();
}
// 替换模板中的占位符
try {
//下载关联文件内容
List<OSSFile> allRelevFileList = (List<OSSFile>) allParamsInfoList.get(1).get("fileListAll");
if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList());
downLoadFileList(allRelevFileList,fileNowPath + File.separator + "导出文件");
}
// 拿取模板
String repFileName = fileName.replaceAll("/","_");
wordOS = new FileOutputStream(fileNowPath + File.separator + repFileName);
if (CosBootUtil.doesObjectExist(templateUrl)) {
InputStream wordTemplate = CosBootUtil.download(templateUrl);
com.qcloud.cos.utils.IOUtils.copy(wordTemplate, wordOS);
}
// 替换占位符内容
byte[] wordContent = Docx4jUtil.of(fileNowPath + File.separator + repFileName)
.addParams(params)
.get();
ByteArrayInputStream wordis = new ByteArrayInputStream(wordContent);
OutputStream wordFileOS = new FileOutputStream(fileNowPath + File.separator + repFileName);
int len1 = 0;
while ((len1 = wordis.read()) != -1) {
wordFileOS.write(len1);
}
wordOS.flush();
wordOS.close();
wordFileOS.flush();
wordFileOS.close();
// 打包导出压缩包
response.setHeader("Content-Disposition",
"attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
ZipUtil.zip(fileNowPath,fileNowPath+".zip");
FileInputStream fis = new FileInputStream(fileNowPath+".zip");
int len2 = 0;
while ((len2 = fis.read()) != -1) {
os.write(len2);
}
// 添加导出历史
/*String uploadFileName = fileOriName + ".zip";
MultipartFile mFile = new MockMultipartFile(uploadFileName, uploadFileName, ContentType.APPLICATION_OCTET_STREAM.toString(), fis); // 用于上传
OSSFile ossFile = ossFileService.uploadLocalOfCos(mFile, "/report", "", CutEnum.CN.getValue()); // 上传导出的压缩包
ParamsReportExportHistoryEO paramsReportExportHistoryEO = new ParamsReportExportHistoryEO();
paramsReportExportHistoryEO.setExportType(ExportTypeEnum.NORMAL.getValue());
paramsReportExportHistoryEO.setExportFileId(ossFile.getId());
paramsReportExportHistoryEO.setParamsManifestId(paramsReportDetailVO.getParamsManifestId());
paramsReportExportHistoryEO.setExportTime(new Date());
paramsReportExportHistoryEOService.add(paramsReportExportHistoryEO);*/
os.flush();
os.close(); // 后开先关
fis.close(); // 先开后关
} catch (Docx4JException e) {
log.error(e.getMessage(), e);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new JeroBootException("下载文件失败,请重试");
} finally {
IOUtils.closeQuietly(os);
IOUtils.closeQuietly(wordOS);
File tempZipFile = new File(uploadpath + "/tempZip");
FileUtil.deleteContents(tempZipFile);
}
}
private void downLoadFileList(List<OSSFile> allRelevFileList,String fileNowPath) { private void downLoadFileList(List<OSSFile> allRelevFileList,String fileNowPath) {
File nowFile = new File(fileNowPath); File nowFile = new File(fileNowPath);
if (nowFile.exists()){ if (nowFile.exists()){
@@ -710,7 +808,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
bis.close(); // 先开后关 bis.close(); // 先开后关
} }
private List<Map<String, Object>> queryForExport(ParamsReportDetailVO paramsReportDetailVO) { private List<Map<String, Object>> queryForExportNormal(ParamsReportDetailVO paramsReportDetailVO) {
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
if (StringUtils.isNotEmpty(paramsReportDetailVO.getIds())) { if (StringUtils.isNotEmpty(paramsReportDetailVO.getIds())) {
idList = Arrays.asList(paramsReportDetailVO.getIds().split(",")); idList = Arrays.asList(paramsReportDetailVO.getIds().split(","));
@@ -803,6 +901,80 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
return dataList; return dataList;
} }
private List<Map> queryForExportCustom(ParamsReportDetailVO paramsReportDetailVO) {
List<String> idList = new ArrayList<>();
if (StringUtils.isNotEmpty(paramsReportDetailVO.getIds())) {
idList = Arrays.asList(paramsReportDetailVO.getIds().split(","));
}
List<String> configIdList = Arrays.asList(paramsReportDetailVO.getConfigIds().split(","));
List<Map<String, Object>> dataList = paramsReportDetailEOMapper.listInfoForExport(idList, paramsReportDetailVO);
List<ParamsReportConfigEO> paramsConfigEOList = paramsReportConfigEOService.queryList(paramsReportDetailVO.getParamsManifestId()); // 查询所有配置列
List<Map> resultList = new ArrayList<>();
Map<String, Object> resultMap = new HashMap<>();
List<OSSFile> fileListAll = new ArrayList<>();
// 查询配置列数据
for (Map<String, Object> record1 : dataList) {
String paramsCollectManifestId = (String) record1.get("id");
String nioNumber = (String) record1.get("nio_number");
if (CollectionUtil.isNotEmpty(paramsConfigEOList)) {
List<OSSFile> fileList = new ArrayList<>();
// 合并配置数据
String configData = "";
List<ParamsReportConfigDataEO> paramsReportConfigDataEOS = paramsReportConfigDataEOService.queryByConfigIdListAndCollectManifestId(configIdList, paramsCollectManifestId);
String textDatas = paramsReportConfigDataEOS.stream().filter(e->StringUtils.isNotEmpty(e.getTextData()))
.map(ParamsReportConfigDataEO::getTextData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator()));
String pullDatas = paramsReportConfigDataEOS.stream().filter(e->StringUtils.isNotEmpty(e.getPullData()))
.map(ParamsReportConfigDataEO::getPullData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator()));
List<String> fileNameList = new ArrayList<>();
paramsReportConfigDataEOS.forEach(paramsReportConfigDataEO -> {
if (StringUtils.isNotEmpty(paramsReportConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsReportConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
fileNameList.add(ossFileList.get(0).getFileName());
fileList.addAll(ossFileList);
}
}
});
StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据
if (StringUtils.isNotEmpty(textDatas)) {
configDataBuilder.append(textDatas).append("&");
}
if (StringUtils.isNotEmpty(pullDatas)) {
configDataBuilder.append(pullDatas).append("&");
}
if (CollectionUtil.isNotEmpty(fileNameList)) {
configDataBuilder.append(StringUtils.join(fileNameList, ",")).append("&");
}
configData = configDataBuilder.toString();
if (configData.contains("&")) {
configData = configData.substring(0, configData.lastIndexOf("&"));
}
resultMap.put(nioNumber, configData);
fileListAll.addAll(fileList);
}
}
Map<String, Object> fileMap = new HashMap<>();
fileMap.put("fileListAll", fileListAll);
resultList.add(resultMap);
resultList.add(fileMap);
return resultList;
}
/** /**
* 获取导出文件的表头 * 获取导出文件的表头
* *
@@ -3,13 +3,15 @@ package com.jero.modules.cert.report.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.modules.cert.collect.mapper.ParamsManifestEOMapper;
import com.jero.modules.cert.collect.vo.ParamsManifestVO;
import com.jero.modules.cert.report.entity.ParamsReportEO; import com.jero.modules.cert.report.entity.ParamsReportEO;
import com.jero.modules.cert.report.mapper.ParamsReportEOMapper; import com.jero.modules.cert.report.mapper.ParamsReportEOMapper;
import com.jero.modules.cert.report.service.IParamsReportEOService; import com.jero.modules.cert.report.service.IParamsReportEOService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -25,6 +27,9 @@ public class ParamsReportEOServiceImpl extends ServiceImpl<ParamsReportEOMapper,
@Autowired @Autowired
private ParamsReportEOMapper paramsReportEOMapper; private ParamsReportEOMapper paramsReportEOMapper;
@Autowired
private ParamsManifestEOMapper paramsManifestEOMapper;
/** /**
* 保存 * 保存
* *
@@ -121,4 +126,26 @@ public class ParamsReportEOServiceImpl extends ServiceImpl<ParamsReportEOMapper,
.eq(ParamsReportEO::getVersion, version); .eq(ParamsReportEO::getVersion, version);
return getOne(queryWrapper); return getOne(queryWrapper);
} }
@Override
public boolean setProjectNameAndTitle(List<String> oldParamsManifestIdList) {
List<ParamsReportEO> updateEOList = new ArrayList<>();
List<ParamsManifestVO> paramsManifestEOList = paramsManifestEOMapper.listInfoAll(oldParamsManifestIdList);
paramsManifestEOList.forEach(paramsManifestVO -> {
LambdaQueryWrapper<ParamsReportEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ParamsReportEO::getOldParamsManifestId, paramsManifestVO.getId())
.eq(ParamsReportEO::getVersion, paramsManifestVO.getVersion());
ParamsReportEO paramsReportEO = getOne(queryWrapper);
ParamsReportEO updateEO = new ParamsReportEO();
updateEO.setId(paramsReportEO.getId());
updateEO.setTitle(paramsManifestVO.getTitle());
updateEO.setProjectName(paramsManifestVO.getProjectName());
updateEOList.add(updateEO);
});
return updateBatchById(updateEOList);
}
} }
@@ -0,0 +1,481 @@
package com.jero.modules.cert.report.util;
import org.docx4j.XmlUtils;
import org.docx4j.dml.wordprocessingDrawing.Inline;
import org.docx4j.openpackaging.exceptions.Docx4JException;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
import org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage;
import org.docx4j.wml.*;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Docx4jUtil {
public static Builder Builder;
public static Builder of(String path) throws FileNotFoundException, Docx4JException {
return new Builder(path);
}
public static class Builder {
private WordprocessingMLPackage template = null;
private Iterator<Text> texts = null;
// 占位符参数map
private Map<String, String> params = new HashMap<>();
private Builder(String path) throws FileNotFoundException, Docx4JException {
if (path != null && !path.isEmpty()) {
this.template = WordprocessingMLPackage.load(new FileInputStream(new File(path)));
this.texts = getAllPlaceholderElementFromObject(template.getMainDocumentPart()).iterator();
}
}
/**
* 增加文本占位符参数(一个)
*
* @param key 键
* @param value 值
* @return Builder对象
*/
public Builder addParam(String key, String value) {
Builder builder = this;
if (key != null && !key.isEmpty()) {
/*while (texts.hasNext()) {
Text text = texts.next();
String temp = text.getValue();
if (temp.equals("${" + key + "}")) {
text.setValue(value);
texts.remove();
return builder;
}
}*/
params.put(key, value);
}
return builder;
}
/**
* 增加参数(多个)
*
* @param params 多个参数的map
* @return Builder对象
*/
public Builder addParams(Map<String, String> params) {
this.params = params;
return this;
}
/**
* 增加一个表格
*
* @param tablePlaceholder 寻找表格的占位符
* @param placeholderRows 模板行所占行数
* @param list 替换模板占位符的数据
* @return Builder对象
* @throws JAXBException JAXBException
* @throws Docx4JException Docx4JException
*/
public Builder addTable(String tablePlaceholder, int placeholderRows, List<Map<String, String>> list)
throws Docx4JException, JAXBException {
List<Object> tables = getAllElementFromObject(template.getMainDocumentPart(), Tbl.class);
Tbl tempTable = getTemplateTable(tables, tablePlaceholder); //
if (tempTable != null && list != null && !list.isEmpty()) {
List<Object> trs = getAllElementFromObject(tempTable, Tr.class);
int rows = trs.size();
if (rows > placeholderRows) {
List<Tr> tempTrs = new ArrayList<>();
for (int i = rows - placeholderRows; i < rows; i++) {
tempTrs.add((Tr) trs.get(i));
}
for (Map<String, String> trData : list) {
for (Tr tempTr : tempTrs) {
addRowToTable(tempTable, tempTr, trData);
}
}
for (Tr tempTr : tempTrs) {
tempTable.getContent().remove(tempTr);
}
}
}
return this;
}
private void loadImg(Tbl tempTable, byte[] decodeBuffer, int maxWidth) {
Inline inline = createInlineImage(template, decodeBuffer, maxWidth);
P paragraph = addInlineImageToParagraph(inline);
List<Object> rows = getAllElementFromObject(tempTable, Tr.class);
Tr tr = (Tr) rows.get(0);
List<Object> cells = getAllElementFromObject(tr, Tc.class);
Tc tc = (Tc) cells.get(0);
tc.getContent().clear();
tc.getContent().add(paragraph);
}
/**
* 通过占位符确定加载图片的位置,图片的位置为表格
*
* @param placeholder 占位符
* @param decodeBuffer 图片的字节流
* @return 当前对象
* @throws Docx4JException Docx4JException
* @throws JAXBException JAXBException
*/
public Builder addImg(String placeholder, byte[] decodeBuffer) throws Docx4JException, JAXBException {
addImg(placeholder, decodeBuffer, 0);
return this;
}
/**
* 通过占位符确定加载图片的位置,图片的位置为表格
*
* @param placeholder 占位符
* @param decodeBuffer 图片的字节流
* @param maxWidth 图片的最多宽度,不传默认写入图片原始宽度
* @return 当前对象
* @throws Docx4JException Docx4JException
* @throws JAXBException JAXBException
*/
public Builder addImg(String placeholder, byte[] decodeBuffer, int maxWidth) throws Docx4JException, JAXBException {
List<Object> tables = getAllElementFromObject(template.getMainDocumentPart(), Tbl.class);
Tbl tempTable = getTemplateTable(tables, placeholder);
loadImg(tempTable, decodeBuffer, maxWidth);
return this;
}
/**
* 通过int的位置数组确定加载图片的位置,图片的位置为表格(以主界面为基准)
*
* @param wz int型数组,长度必须为3 ,第一个值为第几个表格,第二个值为第几行,第三个参数为第几个单元格
* @param decodeBuffer 图片的字节流
* @param maxWidth 图片的最多宽度,不传默认写入图片原始宽度
* @return 当前对象
*/
public Builder addImg(int[] wz, byte[] decodeBuffer, int maxWidth) {
Tc tc = getTcByWz(wz);
Tbl tempTable = (Tbl) getAllElementFromObject(tc, Tbl.class).get(0);
loadImg(tempTable, decodeBuffer, maxWidth);
return this;
}
/**
* 通过int的位置数组确定加载图片的位置,图片的位置为表格(以主界面为基准)
*
* @param wz int型数组,长度必须为3 ,第一个值为第几个表格,第二个值为第几行,第三个参数为第几个单元格
* @param decodeBuffer 图片的字节流
* @return 当前对象
*/
public Builder addImg(int[] wz, byte[] decodeBuffer) {
addImg(wz, decodeBuffer, 0);
return this;
}
/**
* 添加段落
*
* @param list 数据集合
* @param wz 模板段落所在的位置,长度为三(第几个表格,第几行,第几个单元格)
* @return Builder对象
*/
public Builder addParagrash(List<Map<String, String>> list, int[] wz) {
Tc tc = getTcByWz(wz);
List<Object> paraList = getAllElementFromObject(tc, P.class);
tc.getContent().clear();
for (Map<String, String> item : list) {
paraList.forEach((tempPara) -> {
P workingPara = (P) XmlUtils.deepCopy(tempPara);
repaleTexts(workingPara, item);
tc.getContent().add(workingPara);
});
}
return this;
}
/**
* 移除含有占位符的Tr
* @param placeholder 占位符
* @return Builder对象
*/
public Builder removeTrByPlaceholder(String placeholder) {
//这种方式获取是正常的,但是get()方法操作的时候不能正常替换文本了。
//List<Object> trs = template.getMainDocumentPart().getJAXBNodesViaXPath("//w:tr", true);
List<Object> trs = getAllElementFromObject(template.getMainDocumentPart(), Tr.class);
Tr tr = (Tr) getTemplateObj(trs,placeholder,false);
if(tr != null){
Tbl tbl = (Tbl) tr.getParent();
tbl.getContent().remove(tr);
}
return this;
}
/**
* 移除含有占位符的Tr
* @param placeholders 占位符的集合
* @return Builder对象
*/
public Builder removeTrByPlaceholder(List<String> placeholders) {
/* List<Object> trs = template.getMainDocumentPart().getJAXBNodesViaXPath("//w:tr", true);*/
List<Object> trs = getAllElementFromObject(template.getMainDocumentPart(), Tr.class);
List<Object> list = getTemplateObjs(trs,placeholders);
for (Object o:list) {
Tr tr = (Tr) o;
if(tr != null){
Tbl tbl = (Tbl) tr.getParent();
tbl.getContent().remove(tr);
}
}
return this;
}
/**
* 获取文件字节流
*
* @return 文件字节流
* @throws Docx4JException docx异常
*/
public byte[] get() throws Docx4JException {
if (!params.isEmpty()) {
while (texts.hasNext()) {
Text text = texts.next();
String temp = text.getValue();
for (Map.Entry<String, String> param : params.entrySet()) {
if (temp.equals("${" + param.getKey() + "}")) {
text.setValue(param.getValue());
}
}
}
}
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
template.save(outputStream);
return outputStream.toByteArray();
}
/**
* 获取指定单元格
*
* @param temp 模板段落所在的位置,长度为三(第几个表格,第几行,第几个单元格)
* @return tc
*/
private Tc getTcByWz(int[] temp) {
List<Object> tables = getAllElementFromObject(template.getMainDocumentPart(), Tbl.class);
Tbl wzTable = (Tbl) tables.get(temp[0]);
Tr tr = (Tr) getAllElementFromObject(wzTable, Tr.class).get(temp[1]);
return (Tc) getAllElementFromObject(tr, Tc.class).get(temp[2]);
}
}
/**
* 创建包含图片的一个内联对象
*
* @param wordMLPackage WordprocessingMLPackage
* @param bytes 图片字节流
* @param maxWidth 最大宽度
* @return 图片的内联对象
*/
private static Inline createInlineImage(WordprocessingMLPackage wordMLPackage, byte[] bytes, int maxWidth) {
Inline inline = null;
try {
BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(wordMLPackage, bytes);
int docPrId = 1;
int cNvPrId = 2;
if (maxWidth > 0) {
inline = imagePart.createImageInline("Filename hint", "Alternative text", docPrId, cNvPrId, false, maxWidth);
} else {
inline = imagePart.createImageInline("Filename hint", "Alternative text", docPrId, cNvPrId, false);
}
} catch (Exception e) {
e.printStackTrace();
}
return inline;
}
/**
* 创建一个对象工厂并用它创建一个段落和一个可运行块R. 然后将可运行块添加到段落中. 接下来创建一个图画并将其添加到可运行块R中. 最后我们将内联
* 对象添加到图画中并返回段落对象.
*
* @param inline 包含图片的内联对象.
* @return 包含图片的段落
*/
private static P addInlineImageToParagraph(Inline inline) {
// 添加内联对象到一个段落中
ObjectFactory factory = new ObjectFactory();
P paragraph = factory.createP();
R run = factory.createR();
paragraph.getContent().add(run);
Drawing drawing = factory.createDrawing();
run.getContent().add(drawing);
drawing.getAnchorOrInline().add(inline);
return paragraph;
}
// 发现docx文档包含占位符的文本节点
private static List<Text> getAllPlaceholderElementFromObject(Object obj) {
List<Text> result = new ArrayList<>();
Class<Text> toSearch = Text.class;
Text textPlaceholder;
if (obj instanceof JAXBElement) {
obj = ((JAXBElement<?>) obj).getValue();
}
if (obj.getClass().equals(toSearch)) {
textPlaceholder = (Text) obj;
if (isPlaceholder(textPlaceholder.getValue())) {
result.add((Text) obj);
}
} else if (obj instanceof ContentAccessor) {
List<?> children = ((ContentAccessor) obj).getContent();
for (Object child : children) {
result.addAll(getAllPlaceholderElementFromObject(child));
}
}
return result;
}
// 发现docx文档中的节点
private static List<Object> getAllElementFromObject(Object obj, Class<?> toSearch) {
List<Object> result = new ArrayList<>();
if (obj instanceof JAXBElement) {
obj = ((JAXBElement<?>) obj).getValue();
}
if (obj.getClass().equals(toSearch)) {
result.add(obj);
} else if (obj instanceof ContentAccessor) {
List<?> children = ((ContentAccessor) obj).getContent();
for (Object child : children) {
result.addAll(getAllElementFromObject(child, toSearch));
}
}
return result;
}
// 这个方法只是查看表格是否含有我们的占位符,如果有则返回表格
private static Tbl getTemplateTable(List<Object> tables, String templateKey) {
return (Tbl) getTemplateObj(tables,templateKey,false);
}
/**
* 这个方法只是查看dom是否含有我们的占位符,如果有则返回dom
*
* @param objects 需要查找的dom元素
* @param placeholder 占位符
* @param f 是否全部查找,为ture时全部查找,返回的是list,为false时一找到元素就返回,只是单个元素
* @return 找到的元素
*/
private static Object getTemplateObj(List<Object> objects, String placeholder, boolean f) {
List<Object> objectList = new ArrayList<>();
for (Object o : objects) {
List<?> textElements = getAllElementFromObject(o, Text.class);
for (Object text : textElements) {
Text textElement = (Text) text;
if (textElement.getValue() != null && textElement.getValue().equals("${" + placeholder + "}")) {
if (!f) {
return o;
} else {
objectList.add(o);
}
}
}
}
return objectList.isEmpty()?null:objectList;
}
/**
* 这个方法只是查看dom是否含有我们的占位符,如果有则返回dom
* @param objects 需要查找的dom元素的集合
* @param placeholders 占位符集合
* @return 找到的元素的集合
*/
private static List<Object> getTemplateObjs(List<Object> objects, List<String> placeholders) {
List<Object> objectList = new ArrayList<>();
for (Object o : objects) {
List<?> textElements = getAllElementFromObject(o, Text.class);
for (Object text : textElements) {
Text textElement = (Text) text;
if (textElement.getValue() != null && placeholders.contains(getPlaceholderStr(textElement.getValue()))) {
objectList.add(o);
}
}
}
return objectList;
}
/**
* 复制模板行
*
* @param reviewtable 表格
* @param templateRow 模板行
* @param replacements 填充模板行的数据
*/
private static void addRowToTable(Tbl reviewtable, Tr templateRow, Map<String, String> replacements) {
Tr workingRow = XmlUtils.deepCopy(templateRow);
repaleTexts(workingRow, replacements);
reviewtable.getContent().add(workingRow);
}
/**
* 把工作对象中的全部占位符都替换掉
*
* @param working 工作对象
* @param replacements map数据对象
*/
private static void repaleTexts(Object working, Map<String, String> replacements) {
List<?> textElements = getAllElementFromObject(working, Text.class);
for (Object object : textElements) {
Text text = (Text) object;
String keyStr = getPlaceholderStr(text.getValue());
if (keyStr != null && !keyStr.isEmpty()) {
String replacementValue = replacements.get(keyStr);
if (replacementValue != null) {
text.setValue(replacementValue);
} else {
text.setValue("--");
}
}
}
}
/**
* 判断字符串是否有${}占位符
*
* @param str 需要判断的字符串
* @return 是否字符串是否有${}占位符
*/
private static boolean isPlaceholder(String str) {
if (str != null && !str.isEmpty()) {
Pattern pattern = Pattern.compile("([$]\\{\\w+\\})");
Matcher m = pattern.matcher(str);
return m.find();
}
return false;
}
/**
* 得到占位符${}中的文本
*
* @param str 需要判断的字符串
* @return 占位符${}中的文本
*/
private static String getPlaceholderStr(String str) {
if (str != null && !str.isEmpty()) {
Pattern p = Pattern.compile("\\$\\{(.*?)\\}");
Matcher m = p.matcher(str);
if (m.find()) {
return m.group(1);//m.group(0)包括这两个字符
}
}
return null;
}
}
@@ -1,13 +1,7 @@
package com.jero.modules.cert.report.vo; package com.jero.modules.cert.report.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
@Data @Data
public class ParamsReportDetailVO { public class ParamsReportDetailVO {
@@ -43,12 +37,19 @@ public class ParamsReportDetailVO {
@ApiModelProperty(value = "对应参数模板发布版本") @ApiModelProperty(value = "对应参数模板发布版本")
private Integer paramsTemplatePublishVersion; private Integer paramsTemplatePublishVersion;
// 导出通用
private String cut;
private String exportName;
private String ids; // 勾选导出 private String ids; // 勾选导出
private String configIds; // 导出的配置列 private String configIds; // 导出的配置列
// 常规导出专用
private String combineFlag; // 合并标识 1-不合并,2-合并 private String combineFlag; // 合并标识 1-不合并,2-合并
private String separator; // 分隔符 private String separator; // 分隔符
private String cut; // 自定义导出专用
private String exportName; private String exportTemplateId; //导出模板id
} }
@@ -35,11 +35,9 @@ import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.aspectj.util.FileUtil; import org.aspectj.util.FileUtil;
import org.checkerframework.checker.units.qual.C;
import org.jeecgframework.poi.excel.ExcelExportUtil; import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType; import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
@@ -516,14 +514,17 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
} }
List<OSSFile> fileTemplateList = new ArrayList<>(); List<OSSFile> fileTemplateList = new ArrayList<>();
Map<String, String> fileNowPathMap = new HashMap<>();
for (ParamsInfoEO paramsInfoEO : paramsInfoEOList) { for (ParamsInfoEO paramsInfoEO : paramsInfoEOList) {
String fileTemplateConnectId = paramsInfoEO.getFileTemplateConnectId(); String fileTemplateConnectId = paramsInfoEO.getFileTemplateConnectId();
if (StringUtils.isNotBlank(fileTemplateConnectId)) { if (StringUtils.isNotBlank(fileTemplateConnectId)) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(fileTemplateConnectId); List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(fileTemplateConnectId);
List<String> fileNameList = ossFileList.stream().map(OSSFile::getFileName).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(ossFileList)) {
paramsInfoEO.setFileTemplateName(StringUtils.join(fileNameList, ",")); paramsInfoEO.setFileTemplateName(paramsInfoEO.getNioNumber() + "/" + ossFileList.get(0).getFileName());
fileTemplateList.addAll(ossFileList); fileNowPathMap.put(ossFileList.get(0).getId(), fileNowPath + File.separator + paramsInfoEO.getNioNumber());
fileTemplateList.add(ossFileList.get(0));
}
} }
} }
@@ -590,7 +591,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
//下载附件模板对应文件 //下载附件模板对应文件
if (fileTemplateList != null && !fileTemplateList.isEmpty()) { if (fileTemplateList != null && !fileTemplateList.isEmpty()) {
fileTemplateList = fileTemplateList.stream().distinct().collect(Collectors.toList()); fileTemplateList = fileTemplateList.stream().distinct().collect(Collectors.toList());
downLoadFileList(fileTemplateList,fileNowPath); downLoadFileList(fileTemplateList, fileNowPathMap);
} }
return sheetsList; return sheetsList;
@@ -603,14 +604,17 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
} }
List<OSSFile> fileTemplateList = new ArrayList<>(); List<OSSFile> fileTemplateList = new ArrayList<>();
Map<String, String> fileNowPathMap = new HashMap<>();
for (ParamsInfoEnExport paramsInfoEnExport : paramsInfoEnExportList) { for (ParamsInfoEnExport paramsInfoEnExport : paramsInfoEnExportList) {
String fileTemplateConnectId = paramsInfoEnExport.getFileTemplateConnectId(); String fileTemplateConnectId = paramsInfoEnExport.getFileTemplateConnectId();
if (StringUtils.isNotBlank(fileTemplateConnectId)) { if (StringUtils.isNotBlank(fileTemplateConnectId)) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(fileTemplateConnectId); List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(fileTemplateConnectId);
List<String> fileNameList = ossFileList.stream().map(OSSFile::getFileName).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(ossFileList)) {
paramsInfoEnExport.setFileTemplateName(StringUtils.join(fileNameList, ",")); paramsInfoEnExport.setFileTemplateName(paramsInfoEnExport.getNioNumber() + "/" + ossFileList.get(0).getFileName());
fileTemplateList.addAll(ossFileList); fileNowPathMap.put(ossFileList.get(0).getId(), fileNowPath + File.separator + paramsInfoEnExport.getNioNumber());
fileTemplateList.add(ossFileList.get(0));
}
} }
} }
@@ -677,14 +681,21 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
//下载附件模板对应文件 //下载附件模板对应文件
if (fileTemplateList != null && !fileTemplateList.isEmpty()) { if (fileTemplateList != null && !fileTemplateList.isEmpty()) {
fileTemplateList = fileTemplateList.stream().distinct().collect(Collectors.toList()); fileTemplateList = fileTemplateList.stream().distinct().collect(Collectors.toList());
downLoadFileList(fileTemplateList,fileNowPath); downLoadFileList(fileTemplateList, fileNowPathMap);
} }
return sheetsList; return sheetsList;
} }
private void downLoadFileList(List<OSSFile> fileTemplateList,String fileNowPath) { private void downLoadFileList(List<OSSFile> fileTemplateList,Map<String ,String> fileNowPathMap) {
for(OSSFile fileExportDto : fileTemplateList){ for(OSSFile fileExportDto : fileTemplateList){
String fileNowPath = fileNowPathMap.get(fileExportDto.getId());
File nowFile = new File(fileNowPath);
if (nowFile.exists()){
nowFile.delete();
}
nowFile.mkdirs();
String oldPath = fileExportDto.getUrl(); String oldPath = fileExportDto.getUrl();
String newPath = fileNowPath + File.separator + fileExportDto.getFileName(); String newPath = fileNowPath + File.separator + fileExportDto.getFileName();
if (CosBootUtil.doesObjectExist(oldPath)){ if (CosBootUtil.doesObjectExist(oldPath)){
@@ -2,11 +2,13 @@ package com.jero.modules.lawsOpinionGather.entity;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.jero.modules.oss.entity.OSSFile;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@@ -111,4 +113,10 @@ public class LawsOpinionGatherEO implements Serializable {
@ApiModelProperty(value = "流程编号") @ApiModelProperty(value = "流程编号")
private String prcNum; private String prcNum;
@ApiModelProperty(value = "对外意见归档文件id")
private String opinionArchiveId;
/**对外意见归档文件数组**/
@TableField(exist = false)
private List<OSSFile> opinionArchiveFileList;
} }
@@ -8,6 +8,8 @@ import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO;
import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum; import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum;
import com.jero.modules.lawsOpinionGather.mapper.LawsOpinionGatherEOMapper; import com.jero.modules.lawsOpinionGather.mapper.LawsOpinionGatherEOMapper;
import com.jero.modules.lawsOpinionGather.service.ILawsOpinionGatherEOService; import com.jero.modules.lawsOpinionGather.service.ILawsOpinionGatherEOService;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.project.enums.OperatorTypeEnum; import com.jero.modules.project.enums.OperatorTypeEnum;
import com.jero.modules.project.enums.RequestSourceEnum; import com.jero.modules.project.enums.RequestSourceEnum;
import com.jero.modules.system.entity.SysCategory; import com.jero.modules.system.entity.SysCategory;
@@ -33,6 +35,8 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
@Autowired @Autowired
private SysCategoryServiceImpl sysCategoryService; private SysCategoryServiceImpl sysCategoryService;
@Autowired
private IOSSFileService iOSSFileService;
/** /**
* 保存 * 保存
@@ -149,6 +153,10 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
String technologyTerritoryShow = disposeTechnologyTerritory(technologyTerritoryList, lawsOpinionGather.getTechnologyTerritory(), cut); String technologyTerritoryShow = disposeTechnologyTerritory(technologyTerritoryList, lawsOpinionGather.getTechnologyTerritory(), cut);
lawsOpinionGather.setTechnologyTerritoryShow(technologyTerritoryShow); lawsOpinionGather.setTechnologyTerritoryShow(technologyTerritoryShow);
} }
if(StringUtils.isNotEmpty(lawsOpinionGather.getOpinionArchiveId())){
List<OSSFile> opinionArchiveFileList = iOSSFileService.getFileInfosByConnectId(StringUtils.join(lawsOpinionGather.getOpinionArchiveId(), ","));
lawsOpinionGather.setOpinionArchiveFileList(opinionArchiveFileList);
}
}); });
} }
} }
@@ -0,0 +1,170 @@
package com.jero.modules.lawsTechnologyEvaluation.controller;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
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 lombok.extern.slf4j.Slf4j;
import com.jero.common.system.base.controller.JeroController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
/**
* @Description: 法规技术评估
* @Author: jero-boot
* @Date: 2022-07-07
* @Version: V1.0
*/
@Api(tags="法规技术评估")
@RestController
@RequestMapping("/lawsTechnologyEvaluation/lawsTechnologyEvaluationEO")
@Slf4j
public class LawsTechnologyEvaluationEOController extends JeroController<LawsTechnologyEvaluationEO, ILawsTechnologyEvaluationEOService> {
@Autowired
private ILawsTechnologyEvaluationEOService lawsTechnologyEvaluationEOService;
/**
* 分页列表查询
*
* @param lawsTechnologyEvaluationEO
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "法规技术评估-分页列表查询")
@ApiOperation(value="法规技术评估-分页列表查询", notes="法规技术评估-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<LawsTechnologyEvaluationEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationEO, req.getParameterMap());
Page<LawsTechnologyEvaluationEO> page = new Page<LawsTechnologyEvaluationEO>(pageNo, pageSize);
IPage<LawsTechnologyEvaluationEO> pageList = lawsTechnologyEvaluationEOService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "法规技术评估-列表查询")
@ApiOperation(value="法规技术评估-列表查询", notes="法规技术评估-列表查询")
@GetMapping(value = "/list")
public Result<List<LawsTechnologyEvaluationEO>> queryList() {
List<LawsTechnologyEvaluationEO> list = lawsTechnologyEvaluationEOService.queryList();
return Result.OK(list);
}
/**
* 添加
*
* @param lawsTechnologyEvaluationEO
* @return
*/
@AutoLog(value = "法规技术评估-添加")
@ApiOperation(value="法规技术评估-添加", notes="法规技术评估-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO) {
lawsTechnologyEvaluationEOService.add(lawsTechnologyEvaluationEO);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param lawsTechnologyEvaluationEO
* @return
*/
@AutoLog(value = "法规技术评估-编辑")
@ApiOperation(value="法规技术评估-编辑", notes="法规技术评估-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO) {
lawsTechnologyEvaluationEOService.editById(lawsTechnologyEvaluationEO);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "法规技术评估-通过id删除")
@ApiOperation(value="法规技术评估-通过id删除", notes="法规技术评估-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
lawsTechnologyEvaluationEOService.deleteById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "法规技术评估-批量删除")
@ApiOperation(value="法规技术评估-批量删除", notes="法规技术评估-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.lawsTechnologyEvaluationEOService.deleteByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "法规技术评估-通过id查询")
@ApiOperation(value="法规技术评估-通过id查询", notes="法规技术评估-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO = lawsTechnologyEvaluationEOService.queryById(id);
if(lawsTechnologyEvaluationEO==null) {
return Result.error("未找到对应数据");
}
return Result.OK(lawsTechnologyEvaluationEO);
}
/**
* 导出excel
*
* @param request
* @param lawsTechnologyEvaluationEO
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO) {
return super.exportXls(request, lawsTechnologyEvaluationEO, LawsTechnologyEvaluationEO.class, "法规技术评估");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, LawsTechnologyEvaluationEO.class);
}
}
@@ -0,0 +1,145 @@
package com.jero.modules.lawsTechnologyEvaluation.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
* @Description: 法规技术评估
* @Author: jero-boot
* @Date: 2022-07-07
* @Version: V1.0
*/
@Data
@TableName("laws_technology_evaluation")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="laws_technology_evaluation对象", description="法规技术评估")
public class LawsTechnologyEvaluationEO implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**标准id*/
@Excel(name = "标准id", width = 15)
@ApiModelProperty(value = "标准id")
private String standId;
/**编号*/
@Excel(name = "编号", width = 15)
@ApiModelProperty(value = "编号")
private String serialNumber;
/**标题*/
@Excel(name = "标题", width = 15)
@ApiModelProperty(value = "标题")
private String title;
/**技术领域*/
@Excel(name = "技术领域", width = 15)
@ApiModelProperty(value = "技术领域")
private String technologyTerritory;
/**评估方式*/
@Excel(name = "评估方式", width = 15)
@ApiModelProperty(value = "评估方式")
private String evaluationMethods;
/**流程状态*/
@Excel(name = "流程状态", width = 15)
@ApiModelProperty(value = "流程状态")
private String flowStatus;
/**发起日期*/
@Excel(name = "发起日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "发起日期")
private Date startTime;
/**截止日期*/
@Excel(name = "截止日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "截止日期")
private Date endTime;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
/**流程实例id*/
@Excel(name = "流程实例id", width = 15)
@ApiModelProperty(value = "流程实例id")
private String actiProcInstId;
/**相关资料id*/
@Excel(name = "相关资料id", width = 15)
@ApiModelProperty(value = "相关资料id")
private String relatedDataFileId;
/**流程背景*/
@Excel(name = "流程背景", width = 15)
@ApiModelProperty(value = "流程背景")
private String processBackground;
/**法规工程师id*/
@Excel(name = "法规工程师id", width = 15)
@ApiModelProperty(value = "法规工程师id")
private String regulationOwnerId;
/**评估类型(类型有:反馈评估、条款评估)*/
@Excel(name = "评估类型(类型有:反馈评估、条款评估)", width = 15)
@ApiModelProperty(value = "评估类型(类型有:反馈评估、条款评估)")
private String evaluationType;
/**流程编号*/
@Excel(name = "流程编号", width = 15)
@ApiModelProperty(value = "流程编号")
private String prcNum;
}
@@ -0,0 +1,17 @@
package com.jero.modules.lawsTechnologyEvaluation.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 法规技术评估
* @Author: jero-boot
* @Date: 2022-07-07
* @Version: V1.0
*/
public interface LawsTechnologyEvaluationEOMapper extends BaseMapper<LawsTechnologyEvaluationEO> {
}
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationEOMapper">
<resultMap id="LawsTechnologyEvaluationEOResultMap" type="com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO">
<id column="id" property="id" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="sys_org_code" property="sysOrgCode" />
<result column="stand_id" property="standId" />
<result column="serial_number" property="serialNumber" />
<result column="title" property="title" />
<result column="technology_territory" property="technologyTerritory" />
<result column="evaluation_methods" property="evaluationMethods" />
<result column="flow_status" property="flowStatus" />
<result column="start_time" property="startTime" />
<result column="end_time" property="endTime" />
<result column="remark" property="remark" />
<result column="acti_proc_inst_id" property="actiProcInstId" />
<result column="related_data_file_id" property="relatedDataFileId" />
<result column="process_background" property="processBackground" />
<result column="regulation_owner_id" property="regulationOwnerId" />
<result column="evaluation_type" property="evaluationType" />
<result column="prc_num" property="prcNum" />
</resultMap>
</mapper>
@@ -0,0 +1,61 @@
package com.jero.modules.lawsTechnologyEvaluation.service;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 法规技术评估
* @Author: jero-boot
* @Date: 2022-07-07
* @Version: V1.0
*/
public interface ILawsTechnologyEvaluationEOService extends IService<LawsTechnologyEvaluationEO> {
/**
* 保存
*
* @param lawsTechnologyEvaluationEO
* @return
*/
void add(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO);
/**
* 更新
*
* @param lawsTechnologyEvaluationEO
* @return
*/
void editById(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
LawsTechnologyEvaluationEO queryById(String id);
/**
* 列表查询
*
* @return
*/
List<LawsTechnologyEvaluationEO> queryList();
}
@@ -0,0 +1,89 @@
package com.jero.modules.lawsTechnologyEvaluation.service.impl;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationEOMapper;
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 法规技术评估
* @Author: jero-boot
* @Date: 2022-07-07
* @Version: V1.0
*/
@Service
public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechnologyEvaluationEOMapper, LawsTechnologyEvaluationEO> implements ILawsTechnologyEvaluationEOService {
/**
* 保存
*
* @param lawsTechnologyEvaluationEO
* @return
*/
@Override
public void add(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO) {
Date now = new Date();
lawsTechnologyEvaluationEO.setCreateTime(now);
lawsTechnologyEvaluationEO.setUpdateTime(now);
save(lawsTechnologyEvaluationEO);
}
/**
* 更新
*
* @param lawsTechnologyEvaluationEO
* @return
*/
@Override
public void editById(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO) {
Date now = new Date();
lawsTechnologyEvaluationEO.setUpdateTime(now);
saveOrUpdate(lawsTechnologyEvaluationEO);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
public void deleteById(String id) {
removeById(id);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public void deleteByIds(List<String> ids) {
removeByIds(ids);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
public LawsTechnologyEvaluationEO queryById(String id) {
return getById(id);
}
/**
* 列表查询
*
* @return
*/
@Override
public List<LawsTechnologyEvaluationEO> queryList() {
return list();
}
}
@@ -10,6 +10,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@@ -22,6 +23,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@@ -172,4 +174,14 @@ public class LawsMonthlyReportWriteEOController extends JeroController<LawsMonth
return super.importExcel(request, response, LawsMonthlyReportWriteEO.class); return super.importExcel(request, response, LawsMonthlyReportWriteEO.class);
} }
/**
* 月报整合导出zip
*/
@AutoLog(value = "月报整合导出zip")
@ApiOperation(value = "月报整合导出zip", notes = "月报整合导出zip")
@RequestMapping(value = "/exportMonthlyReport", method = RequestMethod.GET)
public ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) throws IOException {
return lawsMonthlyReportWriteEOService.exportMonthlyReport(lawsMonthlyReportWriteEO);
}
} }
@@ -187,4 +187,8 @@ public class LawsMonthlyReportWriteEO implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String cut; private String cut;
//导出
@TableField(exist = false)
private String ids;
} }
@@ -3,6 +3,7 @@ package com.jero.modules.report.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.report.entity.LawsMonthlyReportWriteEO; import com.jero.modules.report.entity.LawsMonthlyReportWriteEO;
import org.springframework.http.ResponseEntity;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List; import java.util.List;
@@ -74,4 +75,6 @@ public interface ILawsMonthlyReportWriteEOService extends IService<LawsMonthlyRe
Integer pageNo, Integer pageNo,
Integer pageSize, Integer pageSize,
HttpServletRequest req); HttpServletRequest req);
ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO);
} }
@@ -18,13 +18,21 @@ import com.jero.modules.report.service.ILawsMonthlyReportTitleTemplateEOService;
import com.jero.modules.report.service.ILawsMonthlyReportWriteEOService; import com.jero.modules.report.service.ILawsMonthlyReportWriteEOService;
import com.jero.modules.report.service.INewOpinionTemplateEOService; import com.jero.modules.report.service.INewOpinionTemplateEOService;
import com.jero.modules.report.service.INewStandardTemplateEOService; import com.jero.modules.report.service.INewStandardTemplateEOService;
import com.jero.modules.report.util.WordUtil;
import com.jero.modules.system.entity.SysCategory; import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.service.impl.SysCategoryServiceImpl; import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import com.jero.modules.system.util.StringUtils; import com.jero.modules.system.util.StringUtils;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
@@ -48,6 +56,8 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
private ILawsMonthlyReportTitleTemplateEOService lawsMonthlyReportTitleTemplateEOService; private ILawsMonthlyReportTitleTemplateEOService lawsMonthlyReportTitleTemplateEOService;
@Autowired @Autowired
private SysCategoryServiceImpl sysCategoryService; private SysCategoryServiceImpl sysCategoryService;
@Value(value = "${jero.path.upload}")
private String uploadpath;
/** /**
* 保存 * 保存
* *
@@ -298,4 +308,77 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
} }
return pageInfo; return pageInfo;
} }
@Override
public ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) {
ResponseEntity<byte[]> result = null;
//获取数据
LambdaQueryWrapper<LawsMonthlyReportWriteEO> wrapper = new LambdaQueryWrapper<>();
if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getMonth())){
wrapper.eq(LawsMonthlyReportWriteEO::getMonth,lawsMonthlyReportWriteEO.getMonth());
}
if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getIds())){
wrapper.in(LawsMonthlyReportWriteEO::getId,StringUtils.join(lawsMonthlyReportWriteEO.getIds(),""));
}
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS = this.list(wrapper);
//月报填写列表所有的章节目录
List<String> memoriesChapterList = lawsMonthlyReportWriteEOS.stream()
.map(LawsMonthlyReportWriteEO::getMemoriesChapter).distinct().collect(Collectors.toList());
//所有的章节目录
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOService.list();
lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOS.stream()
.filter(e -> memoriesChapterList.contains(e.getId())).collect(Collectors.toList());
String path = uploadpath + "/tempZip";
File fileTemp = new File(path);
if (fileTemp.exists()) {
fileTemp.delete();
}
fileTemp.mkdirs();
createWord(path,lawsMonthlyReportWriteEOS,lawsMonthlyReportTitleTemplateEOS);
return null;
}
/**
*
* @param path
* @param lawsMonthlyReportWriteEOS 列表数据
* @param lawsMonthlyReportTitleTemplateEOS 章节目录
*/
private void createWord(String path,
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS){
//蔚来汽车法规月报-202004-主页面-CN
//NIO Monthly Report on Automobile Regulations-202004-Main Page-EN
String memoriesChapterCN = path + File.separator +"蔚来汽车法规月报" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"主页面-CN.docx";
String memoriesChapterEN = path + File.separator +"NIO Monthly Report on Automobile Regulations-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-Main Page-EN.docx";
File wordFile = new File(memoriesChapterCN);
if(!wordFile.exists()){
try {
wordFile.getParentFile().mkdirs();
wordFile.createNewFile();
} catch (IOException e) {
log.error("文件《"+memoriesChapterCN+"》创建失败");
}
}
try (XWPFDocument document = new XWPFDocument();
FileOutputStream out = new FileOutputStream(wordFile)) {
WordUtil.exportWord(document, memoriesChapterCN, null, ParagraphAlignment.CENTER, 0, 12, false, true, "Microsoft YaHei UI");
} catch (IOException e) {
log.error("文件创建异常,异常信息为:" + e.getMessage());
}
}
} }
@@ -0,0 +1,87 @@
package com.jero.modules.report.util;
import cn.hutool.core.util.ObjectUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
public class WordUtil {
/**
* 导出工具示例
*
* @param document POI文件类
* @param text 输出文本
* @param textColor 字体颜色
* @param align 字体位置,默认居左
* @param spaceNum 预留空格数,默认不留空格
* @param fontSize 字体大小,默认11
* @param isNewline 是否换行,换行后文本失效
* @param isBold 是否加粗,默认不加粗
* @param fontFamily 字体,默认宋体
*/
public static void exportWord(XWPFDocument document,
String text,
String textColor,
ParagraphAlignment align,
Integer spaceNum,
Integer fontSize,
Boolean isNewline,
Boolean isBold,
String fontFamily) {
document.createParagraph();
//添加标题
XWPFParagraph titleParagraph = document.createParagraph();
//设置段落左对齐
if (align == null) {
titleParagraph.setAlignment(ParagraphAlignment.LEFT);
} else {
titleParagraph.setAlignment(align);
}
XWPFRun titleParagraphRun = titleParagraph.createRun();
if (isNewline) {
titleParagraphRun.setText("\r");
} else {
//封装文字内容
StringBuilder newText = new StringBuilder();
for (int i = 0; i < spaceNum; i++) {
newText.append(" ");
}
newText.append(text);
titleParagraphRun.setText(newText.toString());
//设置颜色
if (StringUtils.isNotEmpty(textColor)) {
titleParagraphRun.setColor(textColor);
} else {
titleParagraphRun.setColor("000000");
}
//设置文字大小
if (ObjectUtil.isNotEmpty(fontSize)) {
titleParagraphRun.setFontSize(fontSize);
} else {
titleParagraphRun.setFontSize(11);
}
//设置加粗
if (ObjectUtil.isNotEmpty(isBold)) {
titleParagraphRun.setBold(isBold);
} else {
titleParagraphRun.setBold(false);
}
//设置字体样式
if (StringUtils.isNotEmpty(fontFamily)) {
titleParagraphRun.setFontFamily(fontFamily);
} else {
titleParagraphRun.setFontFamily("宋体");
}
}
}
}
@@ -5,7 +5,7 @@
:disabled="true" :disabled="true"
:title="value" :title="value"
:placeholder="$t('PleaseSelect')+query.db_field_txt"/> :placeholder="$t('PleaseSelect')+query.db_field_txt"/>
<a-button type="primary" class="button-box" @click="standardClick"> <a-button type="primary" class="button-box" :disabled="disabled" @click="standardClick">
{{this.$t('PersonnelSelection')}} {{this.$t('PersonnelSelection')}}
</a-button> </a-button>
<a-button type="primary" v-if='isDelete' class="button-box" @click="standardDelete"> <a-button type="primary" v-if='isDelete' class="button-box" @click="standardDelete">
@@ -58,7 +58,7 @@
export default { export default {
name: 'index', name: 'index',
props: ['query', 'value', 'personneQuery', 'isSingleChoice', 'isInput', 'isClass', 'isDelete'], props: ['query', 'value', 'personneQuery', 'isSingleChoice', 'isInput', 'isClass', 'isDelete', 'disabled'],
data() { data() {
return { return {
loading: true, loading: true,
@@ -23,14 +23,14 @@
<div class="title-text" :title="item.db_field_txt"> <div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span> <span>{{item.db_field_txt}}</span>
</div> </div>
<a-input class="box-input" style='width: 226px' :placeholder="$t('PleaseEnter')+item.db_field_txt" <a-input class="box-input ant-input" :placeholder="$t('PleaseEnter')+item.db_field_txt"
v-model="queryParam[item.db_field_name]"></a-input> v-model="queryParam[item.db_field_name]"></a-input>
</div> </div>
<div class="box-title-text" v-else-if="item.field_show_type == '2'"> <div class="box-title-text" v-else-if="item.field_show_type == '2'">
<div class="title-text" :title="item.db_field_txt"> <div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span> <span>{{item.db_field_txt}}</span>
</div> </div>
<a-input-number class="box-input" :placeholder="$t('PleaseEnter')+item.db_field_txt" <a-input-number class="box-input ant-input" :placeholder="$t('PleaseEnter')+item.db_field_txt"
v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/> v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/>
</div> </div>
<div class="box-title-text" v-else-if="item.field_show_type == '4'"> <div class="box-title-text" v-else-if="item.field_show_type == '4'">
@@ -90,14 +90,14 @@
<div class="title-text" :title="item.db_field_txt"> <div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span> <span>{{item.db_field_txt}}</span>
</div> </div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+item.db_field_txt" <a-input class="box-input" style='width: 264px' :placeholder="$t('PleaseEnter')+item.db_field_txt"
v-model="queryParam[item.db_field_name]"></a-input> v-model="queryParam[item.db_field_name]"></a-input>
</div> </div>
<div class="box-title-text" v-else-if="item.field_show_type == '2'"> <div class="box-title-text" v-else-if="item.field_show_type == '2'">
<div class="title-text" :title="item.db_field_txt"> <div class="title-text" :title="item.db_field_txt">
<span>{{item.db_field_txt}}</span> <span>{{item.db_field_txt}}</span>
</div> </div>
<a-input-number class="box-input" :placeholder="$t('PleaseEnter')+item.db_field_txt" <a-input-number class="box-input" style='width: 264px' :placeholder="$t('PleaseEnter')+item.db_field_txt"
v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/> v-model="queryParam[item.db_field_name]" :min="1" :max="99999999"/>
</div> </div>
<div class="box-title-text" v-else-if="item.field_show_type == '4'"> <div class="box-title-text" v-else-if="item.field_show_type == '4'">
@@ -0,0 +1,754 @@
<template>
<div style="height: 100%">
<div class="box">
<!-- -->
<a-table
class="table"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="false"
:scroll="{x: '100%',y:'calc(100vh - 230px)'}"
:data-source="dataSource"
:loading="loading"
sticky
:components="components"
:columns="columns"
:rowClassName="rowClassName"
@change="tableOnChange"
@onHeaderRow='onHeaderRow'
>
<span slot="titleName" slot-scope="text,record" :title="text">
{{ text }}
</span>
<div :slot="'titleName'+(index+1)" v-for="(item,index) in content">
<span style='padding-right: 20px'>{{ item.db_field_txt }} </span>
<a-button @click='onClickSee(item)'>{{$t('See')}}</a-button>
</div>
<!-- <span slot="operationbtn" slot-scope="record">-->
<!-- <span v-if='currentPersonRole === "homo"'>-->
<!--&lt;!&ndash; 认证工程师 &ndash;&gt;-->
<!-- <span-->
<!-- v-if='record.state == "待发起收集" || record.state == "工程接口人退回" || record.state == "变更" || record.state == "Wait Collect" || record.state == "Sdt Back" || record.state == "Change"'>-->
<!--&lt;!&ndash; <span&ndash;&gt;-->
<!--&lt;!&ndash; @click='ondataValueTobeinitiated(record)'>{{ (record.dataValue == null || record.dataValue == 'undefined')? '&#45;&#45;': record.dataValue}}</span>&ndash;&gt;-->
<!-- </span>-->
<!-- <span v-else>-->
<!-- <span @click='dataValueTobeinitiated(record)'>{{ (record.dataValue == null || record.dataValue == 'undefined')? '&#45;&#45;': record.dataValue}}</span>-->
<!-- </span>-->
<!-- </span>-->
<!-- <span v-else>-->
<!-- <span @click='dataValueTobeinitiated(record)'>{{ (record.dataValue == null || record.dataValue == 'undefined')? '&#45;&#45;': record.dataValue}}</span>-->
<!-- </span>-->
<!-- </span>-->
<span slot="detailClick" slot-scope="text,record">
<collection-type :detailDate='text'/>
</span>
</a-table>
</div>
<div class="page">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
:pageSizeOptions='pageSizeOptions'
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div>
<!-- 修改工程接口人--->
<a-modal v-model="areaVisible" :title="$t('modifyprojectInterfacePerson')" width='620px' :footer="null"
@cancel="cancleImports">
<a-form-model
class='tag-module'
ref='ruleForm'
:model='Dateline'
:rules='rules'
:label-col='labelCol'
:wrapper-col='wrapperCol'
>
<a-row :gutter='24'>
<a-col :span='24'>
<a-form-model-item ref='region' :label="$t('engineeringInterfacePerson')" prop='querySdt'>
<a-select allowClear :placeholder="$t('PleaseSelect')+$t('engineeringInterfacePerson')"
v-model="Dateline.querySdt">
<a-select-option v-for="(item, key) in querySdtList" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.label ">
{{ item.label }}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
<div class="imports-footer">
<div class="imports-footer-wrap">
<a-button class="imports-btn imports-sub" type="primary" @click="handleSubmit">{{$t('preservation')}}
</a-button>
<a-button class="imports-btn" type="primary" @click="cancleImports">{{$t('cancel')}}</a-button>
</div>
</div>
</a-modal>
<!-- 配置信息--->
<a-modal v-model="areaVisibleView" :title="$t('configurationInformation')" width='550px' :footer="null">
<div class="content-text">
<div class="text-field">
<span class="text-field-left" :title="$t('configurationName')">{{$t('configurationName')}}:</span>
<span class="text-field-right"
:title="configDetail.configName"
>{{configDetail.configName}}</span>
</div>
</div>
<div class="content-text">
<div class="text-field">
<span class="text-field-left" :title="$t('Model')">{{$t('Model')}}:</span>
<span class="text-field-right" :title="configDetail.carType"
>{{configDetail.carType}}</span>
</div>
<div class="text-field">
<span class="text-field-left" :title="$t('electricMachinery')">{{$t('electricMachinery')}}:</span>
<span class="text-field-right" :title="configDetail.motor"
>{{configDetail.motor}}</span>
</div>
</div>
<div class="content-text">
<div class="text-field">
<span class="text-field-left" :title="$t('Version')">{{$t('Version')}}:</span>
<span class="text-field-right" :title="configDetail.version"
>{{configDetail.version}}</span>
</div>
<div class="text-field">
<span class="text-field-left" :title="$t('Battery')">{{$t('Battery')}}:</span>
<span class="text-field-right" :title="configDetail.battery"
>{{configDetail.battery}}</span>
</div>
</div>
</a-modal>
</div>
</template>
<script>
import eventBUs from '../../common/event'
import { getAction, postAction } from '@/api/manage'
import CollectionType from '@/components/CollectionType'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import axios from 'axios'
import Vue from 'vue'
import VueDraggableResizable from 'vue-draggable-resizable'
import { mapGetters } from 'vuex'
export default {
name: 'index',
props: {
//接口
url: {
type: Object,
default: {}
},
// 详细列表得一条数据
paramsManifest: {
type: Object,
default: {},
require: true
},
formInline: {
type: Object,
default: true
},
currentPersonRole: {
type: String,
default: true
}
},
components: {
CollectionType,
VueDraggableResizable
},
data() {
this.components = {
header: {
cell: (h, props, children) => {
const { key, ...restProps } = props
// 此处的this.columns 是定义的table的表头属性变量
const col = this.columns.find((col) => {
const k = col.dataIndex || col.key
return k === key
})
if (!col || !col.width) {
return h('th', { ...restProps }, [...children])
}
const dragProps = {
key: col.dataIndex || col.key,
class: 'table-draggable-handle',
attrs: {
w: 10,
x: col.width,
z: 1,
axis: 'x',
draggable: false,
resizable: false
},
on: {
dragging: (x, y) => {
col.width = Math.max(x, 1)
}
}
}
const drag = h('vue-draggable-resizable', { ...dragProps })
return h('th', { ...restProps, class: 'resize-table-th' }, [...children, drag])
}
}
}
return {
token: Vue.ls.get(ACCESS_TOKEN),
jsonBody: [],
checkboxList: [],
tableAll: false,
indeterminate: false,
columns: [],
content: [],
selectedRowKeys: [],
selectedRowrowValue: [],
dataSource: [],
pageNo: 1,
pageSize: 10,
pageSizeOptions: ['10', '20','30', '50'],
total: 0,
searchParmes: {},
loading: false,
orderBy: '1',
orderByField: '',
homo: 0, // 认证工程师
sdt: 0, // 工程接口人
dre: 0, // 填写人
areaVisible: false,
form: {},
rules: {
querySdt: [
{
required: true,
message: this.$t('PleaseSelect') + this.$t('engineeringInterfacePerson'),
trigger: 'change'
}
]
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
querySdtList: [], // 工程接口人
Dateline: {},
getquerySdtId: '', // 当前工程接口人的id
areaVisibleView: false, // 查看配置得弹框
configDetail: {} // 查看配置得详细信息
}
},
mounted() {
this.getHeader()
},
watch: {
currentPersonRole: {
handler: function() {
console.log(123)
this.getTableList()
},
immediate: true
}
},
methods: {
...mapGetters(['userInfo']),
rowClassName(row, index) {
if (row.changeFlag == '1') {
return 'rowClassRedYellow'
}
if (row.delFlag == '1') {
return 'rowClassRed'
}
},
pageOnChange(page, pageSize) {
this.pageNo = page
this.$emit('handlePreservation')
this.getTableList()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.$emit('handlePreservation')
this.getTableList()
},
// 查看配置详细信息
onClickSee(val) {
let _this = this
this.areaVisibleView = true
axios({
url: `/jero-boot/params/config/getById?id=${val.db_field_name}`,
method: 'get',
transformRequest: [function(data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token': _this.token
}
})
.then((res) => {
console.log(res)
if (res.data.success) {
this.configDetail = res.data.result
} else {
_this.$message.warning(res.data.result)
}
})
.catch((error) => {
console.log(error)
})
},
// 获取工程接口人
getquerySdtList(record) {
// 当前工程接口人的id
this.getquerySdtId = record.id
getAction(this.url.getquerySdtList, {
projectId: this.$route.query.projectId,
dutyTerritory: record.dutyTerritory
}).then((res) => {
if (res.success) {
this.querySdtList = res.result
}
})
},
// 工程接口人 保存
handleSubmit(record) {
let _this = this
let param = { sdt: this.Dateline.querySdt, ids: this.getquerySdtId }
this.$refs.ruleForm.validate(valid => {
if (valid) {
axios({
url: '/jero-boot/params/collectManifest/updateSdt',
method: 'post',
data: param,
transformRequest: [function(data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token': _this.token
}
})
.then((res) => {
console.log(res)
if (res.data.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.areaVisible = false
this.getLoginUserType()
} else {
_this.$message.warning(_this.$t('operationFailed'))
}
})
.catch((error) => {
console.log(error)
})
}
})
},
// 工程接口人 取消
cancleImports() {
this.areaVisible = false
this.$refs['ruleForm'].resetFields()
},
// 点击工程接口人的详情人员 有权限
ondataValueTobeinitiated(record) {
this.areaVisible = true
// this.$refs.ruleForm.clearValidate()
this.$nextTick(() => {
this.Dateline = { ...this.Dateline }
this.getquerySdtList(record)
this.$refs.ruleForm.clearValidate()
})
},
dataValueTobeinitiated() {
this.$message.warning(this.$t('certifiedEngineer') + this.$t('and') + this.$t('Statusis') + this.$t('CollectionInitiated') + this.$t('ReturnedPerson') + this.$t('alteration') + this.$t('toHavePermission'))
},
// 点击工程接口人的详情人员 无权限
ondataValueNot() {
this.$message.warning(this.$t('operatethisbutton'))
},
onHeaderRow(column, index) {
console.log(column, index)
},
getLoginUserType() {
let params = {
paramsManifestId: this.$route.query.id,
projectId: this.$route.query.projectId
}
this.loading = true
getAction(this.url.getLoginUserType, params).then((res) => {
if (res.success) {
this.getAndUserId(res.result)
}
})
},
getAndUserId(result) {
let query = {
paramsManifestId: this.$route.query.id,
projectId: this.$route.query.projectId,
userId: this.userInfo().id
}
getAction('/params/userTypeLog/queryCurrentType', query).then((res) => {
if (res.success) {
if (res.result && res.result.userType) {
if (!(result.some(val => val.value == res.result.userType))) {
res.result.userType = result[0] ? result[0].value : ''
}
this.getTableList(res.result.userType)
} else {
this.getTableList(result[0].value)
}
this.$emit('LoginUserType', result, this.currentPersonRole, res.result.userType)
} else {
}
})
},
getHeader() {
console.log(this.url.tableHeader)
let paramsManifestid
let url
if (this.$route.query.it === undefined) {
// 页面跳转
paramsManifestid = this.$route.query.id
url = this.url.tableHeader
} else {
// 历史版本
paramsManifestid = this.$route.query.it
url = 'params/collectManifestHistory/getHeader'
}
let params = {
paramsManifestId: paramsManifestid,
flag: '8'
}
getAction(url, params).then((res) => {
if (res.success) {
var jsonHead = res.result
this.columns = []
let num = 0
this.content = []
jsonHead.forEach((res, index) => {
// 配置列
if (res.type) {
this.columns.push({
dataIndex: res.db_field_name,
align: 'center',
ellipsis: true,
sorter: res.sort,
width: 500
})
num++
this.content.push(res)
this.columns[index].scopedSlots = {
customRender: 'detailClick',
title: 'titleName' + num
}
// 非配置列
} else {
this.columns.push({
title: res.db_field_txt,
dataIndex: res.db_field_name,
align: 'center',
ellipsis: true,
sorter: res.sort,
width: 160
})
this.columns[index].scopedSlots = {
customRender: 'titleName'
}
if (res.click) {
// 工程接口人列表修改
this.columns[index].scopedSlots = {
customRender: 'operationbtn'
}
}
}
})
this.columns = [...this.columns]
console.log(this.columns)
}
})
},
tableOnChange(pagination, filters, sorter) {
console.log(pagination, filters, sorter, 'iiiiiiiiiiiiiiiii')
},
getTableListReset() {
let params = {
paramsManifestId: this.$route.query.id,
userTypes: this.currentPersonRole
}
this.loading = true
this.$emit('listReset', '')
getAction(this.url.tableList, params).then((res) => {
if (res.success) {
let tt = []
if (this.currentPersonRole !== 'dre') {
res.result.records.forEach((Obj) => {
Object.keys(Obj).forEach((item) => {
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
Obj[item].list.forEach((itemLi) => {
itemLi.isLock = 1
if (itemLi.type === 'pull_more') {
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
}
})
}
})
tt.push(Obj)
})
} else {
res.result.records.forEach((Obj) => {
Object.keys(Obj).forEach((item) => {
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
Obj[item].list.forEach((itemLi) => {
if (itemLi.type === 'pull_more') {
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
}
})
}
})
tt.push(Obj)
})
}
this.dataSource = tt
this.total = res.result.total
this.selectedRowKeys = []
this.$emit('getDataSource', this.dataSource)
setTimeout(() => {
this.loading = false
}, 500)
} else {
this.loading = false
}
})
},
cancleoperationFailed() {
this.selectedRowKeys = []
},
getTableList(currentPersonRole) {
console.log(this.url.tableList)
let paramsManifestid
let url
if (this.$route.query.it === undefined) {
// 页面跳转
paramsManifestid = this.$route.query.id
url = this.url.tableList
} else {
// 历史版本
paramsManifestid = this.$route.query.it
url = 'params/collectManifestHistory/list'
}
let params = {
pageNo: this.pageNo,
pageSize: this.pageSize,
userTypes: this.currentPersonRole || currentPersonRole,
paramsManifestId: paramsManifestid,
...this.formInline
}
this.loading = true
getAction(url, params).then((res) => {
if (res.success) {
// console.log(res.result,'res.result')
// let tt = []
// this.dataSource = []
// // 需要转化数据类型
// tt = res.result
// tt.forEach((Obj) => {
// Object.keys(Obj).forEach((item) => {
// if(Obj[item] instanceof Object && Obj[item].controlType !== undefined){
// Obj[item].list.forEach((itemLi) => {
// if(itemLi.type === 'pull_more'){
// itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.splice(',')
// }
// })
// }
// })
// })
let tt = []
if (this.currentPersonRole !== 'dre') {
res.result.records.forEach((Obj) => {
Object.keys(Obj).forEach((item) => {
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
Obj[item].list.forEach((itemLi) => {
itemLi.isLock = 1
if (itemLi.type === 'pull_more') {
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
}
})
}
})
tt.push(Obj)
})
} else {
res.result.records.forEach((Obj) => {
Object.keys(Obj).forEach((item) => {
if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) {
Obj[item].list.forEach((itemLi) => {
if (itemLi.type === 'pull_more') {
itemLi.dataValue = itemLi.dataValue === null ? [] : itemLi.dataValue.split(',')
}
})
}
})
tt.push(Obj)
})
}
this.dataSource = tt
this.total = res.result.total
this.selectedRowKeys = []
this.selectedRowrowValue = []
this.$emit('value', this.selectedRowKeys)
this.$emit('rowValue', this.selectedRowrowValue)
this.$emit('getDataSource', this.dataSource)
setTimeout(() => {
this.loading = false
}, 500)
} else {
this.loading = false
}
})
},
onChange(page, pageSize) {
},
onSelectChange(value, rowValue) {
this.selectedRowKeys = []
this.selectedRowrowValue = []
this.selectedRowKeys = value
this.selectedRowrowValue = rowValue
this.$emit('value', this.selectedRowKeys)
this.$emit('rowValue', this.selectedRowrowValue)
},
OperationClick(ol, item) {
// this.$emit(ol.ClickEvent, item)
},
detailClick(item, index) {
// this.$emit('detailClick', item)
}
}
}
</script>
<style lang='less'>
.imports-footer {
.imports-footer-wrap {
margin: 20px 0;
text-align: center;
.imports-sub {
margin-right: 20px;
}
}
}
.table .ant-table-column-title {
font-weight: bold;
}
.content-text {
width: 100%;
display: flex;
flex-wrap: wrap;
.text-field {
width: 50%;
margin-bottom: 8px;
display: flex;
.text-field-left {
width: 80px;
display: inline-block;
font-size: 16px;
color: #040B29;
font-weight: 400;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.text-field-right {
display: inline-block;
font-size: 16px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
color: #040B29;
font-weight: 400;
}
}
}
</style>
<style scoped>
.box {
width: 100%;
height: calc(100% - 100px);
overflow: auto;
}
.text {
margin-right: 10px;
}
.page {
text-align: right;
margin-top: 20px;
}
/deep/ .ant-table-tbody .yellow {
background-color: #ffff001f !important;
height: 40px !important;
border: none !important;
padding: 0 !important;
}
</style>
<style>
.resize-table-th {
position: relative;
}
.table-draggable-handle {
/* width: 10px !important; */
height: 100% !important;
left: auto !important;
right: -5px;
cursor: col-resize;
touch-action: none;
border: none;
position: absolute;
transform: none !important;
bottom: 0;
}
.rowClassRed {
background: #f3d9de;
}
.rowClassRedYellow {
background: yellow;
}
</style>
@@ -24,33 +24,69 @@
:data-source="dataSource" :data-source="dataSource"
:columns="columns" :columns="columns"
> >
<span slot="accessoryFile" slot-scope="text,record">
<a @click="seeFileClick(text)" v-if="text">
{{$t('viewFile')}}
</a>
<span v-else>--</span>
</span>
</a-table> </a-table>
<div class="page" v-if="dataSource && dataSource.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div>
<div> <div>
<span>对外意见归档:</span> <span class="text">对外意见归档:</span>
<div @click="clickButtonToUpload('opinionArchiveId')"
v-if="formInline.createBy == this.userInfoQuery.username" class="operator-text">
<a-icon type="cloud-upload" />
{{$t('clickUpload')}}
</div>
<div @click="seeFileClick(formInline.opinionArchiveId)" class="operator-text">
<a-icon type="eye" />
{{$t('viewFile')}}
</div>
</div> </div>
<div class="drawer-bootom-button"> <div class="drawer-bootom-button">
<a-button @click="handleCancel">{{$t('cancel')}}</a-button> <a-button @click="handleCancel">{{$t('cancel')}}</a-button>
</div> </div>
</a-drawer> </a-drawer>
<uploadFile ref="uploadFile" :isMultiple="true" @uploadSuccess="uploadSuccess"></uploadFile> <uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
<viewFileModel ref="viewFileModelRef"/>
</div> </div>
</template> </template>
<script> <script>
import uploadFile from '@/components/uploadFile/file' import uploadFile from '@/components/uploadFile/file'
import { getAction, postAction, downloadFile } from '@/api/manage' import viewFileModel from '@/components/viewFileModel/index'
import { getAction, putAction, downloadFile } from '@/api/manage'
import { mapGetters } from 'vuex'
export default { export default {
name: 'evaluationResultsList', name: 'evaluationResultsList',
components: { components: {
uploadFile uploadFile,
viewFileModel
}, },
data() { data() {
return { return {
confirmLoading: false, confirmLoading: false,
visible: false, visible: false,
loading: false, loading: false,
total: 0,
pageSize: 10,
pageNo: 1,
dataSource: [], dataSource: [],
formInline: {},
userInfoQuery:{},
columns: [ columns: [
{ {
title: this.$t('relevantSections'), title: this.$t('relevantSections'),
@@ -77,7 +113,8 @@
align: 'center', align: 'center',
width: 180, width: 180,
ellipsis: true, ellipsis: true,
dataIndex: 'accessoryFile' dataIndex: 'accessoryFile',
scopedSlots: { customRender: 'accessoryFile' }
}, },
{ {
title: this.$t('Assessor'), title: this.$t('Assessor'),
@@ -97,9 +134,10 @@
} }
}, },
mounted() { mounted() {
this.userInfoQuery = this.userInfo()
}, },
methods: { methods: {
...mapGetters(['userInfo']),
clickButtonToUpload(item) { clickButtonToUpload(item) {
this.$refs.uploadFile.perentHandleFunc() this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true this.$refs.uploadFile.visible = true
@@ -123,19 +161,67 @@
/** 赋值给当前对应的表单文件 */ /** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',') this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
this.edit()
},
edit() {
let query = {
id: this.lawsOpinionGatherId,
opinionArchiveId: this.formInline.opinionArchiveId
}
putAction('/lawsOpinionGather/lawsOpinionGatherEO/edit', query).then((res) => {
if (res.success) {
}
})
}, },
//导出 //导出
handleExport() { handleExport() {
let query = { let query = {
dummyInventoryBaseId: this.$route.query.id lawsOpinionGatherId: this.lawsOpinionGatherId,
actiProcInstId: this.actiProcInstId
} }
downloadFile(this.url.exportData, this.$route.query.name + this.$t('VirtualList') + '.zip', query, this.Deselect) downloadFile('/lawsOpinionGather/lawsOpinionAssessmentResultEO/exportXls',
this.$t('evaluationResults') + '.xls', query)
}, },
getData(row) { getData(row) {
this.visible = true this.visible = true
this.formInline = JSON.parse(JSON.stringify(row))
this.actiProcInstId = row.actiProcInstId
this.lawsOpinionGatherId = row.id
console.log(row)
this.getList()
}, },
handleCancel() { handleCancel() {
this.visible = false this.visible = false
},
pageOnChange(page) {
this.pageNo = page
this.getList()
},
SizeChange(pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.getList()
},
getList() {
let query = {
lawsOpinionGatherId: this.lawsOpinionGatherId,
actiProcInstId: this.actiProcInstId
}
this.loading = true
getAction('/lawsOpinionGather/lawsOpinionAssessmentResultEO/page', query).then((res) => {
if (res.success) {
this.dataSource = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.loading = false
this.dataSource = []
}
})
},
seeFileClick(item) {
this.$refs.viewFileModelRef.clickButtonToUpload(item)
} }
} }
} }
@@ -160,4 +246,16 @@
text-align: right; text-align: right;
margin-bottom: 16px; margin-bottom: 16px;
} }
.page {
text-align: right;
margin-top: 20px;
}
.text {
font-size: 14px;
font-weight: 400;
color: #040B29;
margin-right: 4px;
}
</style> </style>
@@ -22,12 +22,21 @@
</div> </div>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<div class="box-title-text"> <div class="box-title-text tree-select">
<div class="title-text" :title="$t('technicalField')"> <div class="title-text" :title="$t('technicalField')">
<span>{{$t('technicalField')}}</span> <span>{{$t('technicalField')}}</span>
</div> </div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('technicalField')" <a-tree-select
v-model="queryParam.technologyTerritory"></j-input> tree-node-filter-prop="title"
v-model="queryParam.technologyTerritory"
:maxTagCount="1"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="CategoryTreeList"
tree-checkable
:placeholder="$t('PleaseSelect')+$t('technicalField')"
/>
</div> </div>
</a-col> </a-col>
<template v-if="toggleSearchStatus"> <template v-if="toggleSearchStatus">
@@ -36,8 +45,19 @@
<div class="title-text" :title="$t('collectResults')"> <div class="title-text" :title="$t('collectResults')">
<span>{{$t('collectResults')}}</span> <span>{{$t('collectResults')}}</span>
</div> </div>
<j-input class="box-input" :placeholder="$t('PleaseEnter')+$t('collectResults')" <a-select :placeholder="$t('PleaseSelect')+$t('collectResults')"
v-model="queryParam.gatherResult"></j-input> class="box-input"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
allowClear
v-model="queryParam.gatherResult">
<a-select-option v-for="(item, key) in gatherResultList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name">
{{ item.name }}
</span>
</a-select-option>
</a-select>
</div> </div>
</a-col> </a-col>
</template> </template>
@@ -108,17 +128,28 @@
return { return {
//url传参严格按照当前命名 //url传参严格按照当前命名
url: { url: {
deleteBatch: '', list: '/lawsOpinionGather/lawsOpinionGatherEO/page',
list: '/lawsOpinionGather/lawsOpinionGatherEO/page' getSysCategoryTree: '/sys/category/getSysCategoryTree',
}, },
loading: false, loading: false,
toggleSearchStatus: false, toggleSearchStatus: false,
dataSource: [{}], dataSource: [],
selectedRowKeys: [], selectedRowKeys: [],
total: 0, total: 0,
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
CategoryTreeList:[],
queryParam: {}, queryParam: {},
gatherResultList:[
{
value:'Underway',
name:this.$t('inProgress'),
},
{
value:'Completed',
name:this.$t('Finished'),
}
],
columns: [ columns: [
{ {
title: this.$t('standard'), title: this.$t('standard'),
@@ -137,7 +168,7 @@
align: 'center', align: 'center',
width: 170, width: 170,
ellipsis: true, ellipsis: true,
dataIndex: 'technologyTerritoryShow' dataIndex: 'technologyTerritory'
}, },
{ {
title: this.$t('collectResults'), title: this.$t('collectResults'),
@@ -172,8 +203,18 @@
}, },
mounted() { mounted() {
this.getList() this.getList()
this.getSysCategoryTree()
}, },
methods: { methods: {
getSysCategoryTree() {
getAction(this.url.getSysCategoryTree, {}).then((res) => {
if (res.success) {
this.CategoryTreeList = res.result
} else {
this.CategoryTreeList = []
}
})
},
handleToggleSearch() { handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus this.toggleSearchStatus = !this.toggleSearchStatus
}, },
@@ -196,10 +237,16 @@
this.getList() this.getList()
}, },
getList() { getList() {
let queryParam = JSON.parse(JSON.stringify(this.queryParam))
Object.keys(queryParam).forEach(val => {
if (queryParam[val] instanceof Array) {
queryParam[val] = queryParam[val].join(',')
}
})
let query = { let query = {
pageNo: this.pageNo, pageNo: this.pageNo,
pageSize: this.pageSize, pageSize: this.pageSize,
...this.queryParam ...queryParam
} }
this.loading = true this.loading = true
getAction(this.url.list, query).then((res) => { getAction(this.url.list, query).then((res) => {
@@ -241,6 +288,11 @@
} }
} }
</script> </script>
<style>
.tree-select .ant-select-tree-dropdown{
height: 298px!important;
}
</style>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
@@ -9,7 +9,8 @@
<span>{{$t('monthSelection')}}</span> <span>{{$t('monthSelection')}}</span>
</div> </div>
<a-month-picker class="box-input" <a-month-picker class="box-input"
v-model="queryParam.monthSelection" @change="dateChange({db_field_name:'month'})"
v-model="queryParam.month"
:placeholder="$t('monthSelection')"/> :placeholder="$t('monthSelection')"/>
</div> </div>
</a-col> </a-col>
@@ -80,6 +81,7 @@
import { getAction, postAction, downloadFile } from '@/api/manage' import { getAction, postAction, downloadFile } from '@/api/manage'
import fillTable from './modules/fillTable' import fillTable from './modules/fillTable'
import fillAdd from './modules/fillAdd' import fillAdd from './modules/fillAdd'
import moment from 'moment'
export default { export default {
name: 'RegulationMonthlyFill', name: 'RegulationMonthlyFill',
@@ -153,15 +155,22 @@
} }
}, },
mounted() { mounted() {
this.queryParam.month = moment(new Date()).format('YYYY-MM')
this.getList() this.getList()
}, },
methods: { methods: {
dateChange(item) {
this.queryParam[item.db_field_name] = this.queryParam[item.db_field_name] ? moment(this.queryParam[item.db_field_name]).format('YYYY-MM') : ''
this.queryParam = {...this.queryParam}
},
searchQuery() { searchQuery() {
this.pageNo = 1 this.pageNo = 1
this.getList() this.getList()
}, },
searchReset() { searchReset() {
this.queryParam = {} this.queryParam = {}
this.queryParam.month = moment(new Date()).format('YYYY-MM')
this.queryParam = {...this.queryParam}
this.pageNo = 1 this.pageNo = 1
this.getList() this.getList()
}, },
@@ -0,0 +1,322 @@
<template>
<a-drawer
title="添加"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<div style="margin-bottom: 60px">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="12" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('standard')">
<span>{{$t('standard')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('standard')"
v-model="queryParam.serial_number"></a-input>
</div>
</a-col>
<a-col :md="12" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('title')">
<span>{{$t('title')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('title')"
v-model="queryParam.title"></a-input>
</div>
</a-col>
<a-col :md="12" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('status')">
<span>{{$t('status')}}</span>
</div>
<j-dict-select-tag class="box-input" v-model="queryParam.state"
:placeholder="$t('PleaseSelect')+$t('status')"
:type="'select'"
:triggerChange="false" :dictCode="'state'"/>
</div>
</a-col>
<span style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="12" :sm="24">
<globalAdvancedQuery ref="globalAdvancedQueryRef"
@handleSuperQuery="handleSuperQuery"
:fieldList="fieldList"/>
<a-button class="box-button" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<div style="width: 100%">
<a-table
:columns="columns"
rowKey="id"
:scroll="{x: 1200}"
:data-source="dataList"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,columnTitle:' '}"
:loading="loading">
</a-table>
</div>
<div class="page" v-if="dataList.length > 0">
<a-pagination
:show-total="total => $t('total')+`${total}`+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
@change="onChange"
@showSizeChange="SizeChange"
/>
</div>
</div>
<div class="drawer-bootom-button">
<a-button @click="handleCancel" type="danger" style="margin-right: 16px">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
import globalAdvancedQuery from '@/components/globalAdvancedQuery/index'
export default {
name: 'addModel',
components: {
globalAdvancedQuery
},
props: {
},
data() {
return {
visible: false,
confirmLoading: false,
selectedRowKeys: [],
queryParam: {},
columns: [
{
title: this.$t('standard'),
dataIndex: 'serial_number',
align: 'center',
ellipsis: true
},
{
title: this.$t('title'),
dataIndex: 'title',
align: 'center',
ellipsis: true
},
{
title: this.$t('zoneOfApplication'),
dataIndex: 'region',
align: 'center',
ellipsis: true
},
// {
// title: this.$t('status'),
// dataIndex: 'state',
// align: 'center',
// ellipsis: true
// },
// {
// title: this.$t('technicalField'),
// dataIndex: 'technology_territory',
// align: 'center',
// ellipsis: true
// },
{
title: this.$t('ImplementationDate'),
dataIndex: 'xin1_che1_xing2_shi2_shi1_ri4_qi1',
align: 'center',
ellipsis: true
},
{
title: this.$t('vehicleInProductionDate'),
dataIndex: 'implement_time',
align: 'center',
ellipsis: true
}
// {
// title: this.$t('correspondingStandard'),
// dataIndex: 'corresponding_standard',
// align: 'center',
// ellipsis: true
// }
],
dataList: [],
content: [],
loading: false,
pageNo: 1,
pageSize: 10,
total: 0,
fieldList: [],
queryParamQuery: {},
selectedRowKeysRecord:[],
queryConditionVOList: []
}
},
mounted() {
},
methods: {
addModel() {
this.visible = true
this.queryParam = {}
this.selectedRowKeys = []
this.queryConditionVOList = []
this.replacePage()
this.queryConditionInventory()
},
searchQuery() {
this.pageNo = 1
this.replacePage()
},
searchReset() {
this.pageNo = 1
this.queryParam = {}
this.queryConditionVOList = []
this.$refs.globalAdvancedQueryRef.resetLine()
this.$refs.globalAdvancedQueryRef.emitCallback()
},
onChange(page, pageSize) {
this.pageNo = page
this.replacePage()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.replacePage()
},
replacePage() {
let queryConditionVOList = JSON.parse(JSON.stringify(this.queryConditionVOList))
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.queryParam,
queryConditionVOList: JSON.stringify(queryConditionVOList)
}
this.loading = true
postAction('/dummy/dummyInventoryInfoEO/queryPageDummy', query).then((res) => {
if (res.success) {
this.dataList = res.result.records || []
this.total = res.result.total
this.loading = false
} else {
this.dataList = []
this.total = 0
this.loading = false
}
})
},
queryConditionInventory() {
let query = {
flag: 1
}
getAction('/dummy/dummyInventoryInfoEO/queryConditionInventory', query).then((res) => {
if (res.success) {
this.fieldList = res.result || []
} else {
this.fieldList = []
}
})
},
onSelectChange(value, record) {
this.selectedRowKeys = value
if (this.selectedRowKeys.length > 1) {
this.selectedRowKeys.shift()
record.shift()
}
this.selectedRowKeysRecord = record
},
handleCancel() {
this.visible = false
},
handleSubmit() {
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.$emit('addModelForm',this.selectedRowKeysRecord[0])
this.visible = false
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
handleSuperQuery(params, matchType) {
let sqp = {}
if (!params || (params && params.length == 0)) {
this.queryConditionVOList = []
this.$refs.globalAdvancedQueryRef.superQueryFlag = false
} else {
this.$refs.globalAdvancedQueryRef.superQueryFlag = true
this.queryConditionVOList = params
this.queryConditionVOList.forEach(res => {
res.type = matchType
})
}
this.replacePage()
}
}
}
</script>
<style scoped>
.page {
text-align: right;
margin-top: 20px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
z-index: 100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.box-title-text {
line-height: 1.4;
display: flex;
align-items: center;
margin-bottom: 10px;
}
.title-text {
width: 33px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 100%;
height: 38px;
}
.box-button {
height: 38px;
}
</style>
@@ -9,7 +9,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="titleCn"> <a-form-model-item class="itemModel" prop="titleCn">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="disabled"
v-model="formInline.titleCn" v-model="formInline.titleCn"
:placeholder="$t('PleaseEnter')+$t('title')"/> :placeholder="$t('PleaseEnter')+$t('title')"/>
</a-form-model-item> </a-form-model-item>
@@ -23,7 +23,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="titleEn"> <a-form-model-item class="itemModel" prop="titleEn">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="disabled"
v-model="formInline.titleEn" v-model="formInline.titleEn"
:placeholder="$t('PleaseEnter')+$t('englishTitle')"/> :placeholder="$t('PleaseEnter')+$t('englishTitle')"/>
</a-form-model-item> </a-form-model-item>
@@ -42,6 +42,7 @@
tree-node-filter-prop="title" tree-node-filter-prop="title"
v-model="formInline.technologyTerritory" v-model="formInline.technologyTerritory"
:maxTagCount="1" :maxTagCount="1"
:disabled="disabled"
:getPopupContainer="triggerNode=> triggerNode.parentNode" :getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input" class="box-input"
style="width: 100%" style="width: 100%"
@@ -62,6 +63,7 @@
<j-multi-select-tag class="box-input" v-model="formInline.applyCar" <j-multi-select-tag class="box-input" v-model="formInline.applyCar"
:placeholder="$t('PleaseSelect')+$t('vehicleType')" :placeholder="$t('PleaseSelect')+$t('vehicleType')"
:type="'select'" :type="'select'"
:disabled="disabled"
:triggerChange="false" :dictCode="'car_type'"/> :triggerChange="false" :dictCode="'car_type'"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -78,6 +80,7 @@
<j-multi-select-tag class="box-input" v-model="formInline.applyScope" <j-multi-select-tag class="box-input" v-model="formInline.applyScope"
:placeholder="$t('PleaseSelect')+$t('scopeOfApplication')" :placeholder="$t('PleaseSelect')+$t('scopeOfApplication')"
:type="'select'" :type="'select'"
:disabled="disabled"
:triggerChange="false" :dictCode="'apply_scope'"/> :triggerChange="false" :dictCode="'apply_scope'"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -91,6 +94,7 @@
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<j-dict-select-tag class="box-input" v-model="formInline.state" <j-dict-select-tag class="box-input" v-model="formInline.state"
@input="handleInput('status')" @input="handleInput('status')"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('status')" :placeholder="$t('PleaseSelect')+$t('status')"
:type="'select'" :type="'select'"
:triggerChange="false" :dictCode="'state'"/> :triggerChange="false" :dictCode="'state'"/>
@@ -110,6 +114,7 @@
@input="handleInput('usage')" @input="handleInput('usage')"
:placeholder="$t('PleaseSelect')+$t('usage')" :placeholder="$t('PleaseSelect')+$t('usage')"
:type="'select'" :type="'select'"
:disabled="disabled"
:triggerChange="false" :dictCode="'yong4_fa3'"/> :triggerChange="false" :dictCode="'yong4_fa3'"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -183,6 +188,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="contentCn"> <a-form-model-item class="itemModel" prop="contentCn">
<a-textarea <a-textarea
:disabled="disabled"
:placeholder="$t('PleaseEnter')+$t('primaryCoverageCn')" :placeholder="$t('PleaseEnter')+$t('primaryCoverageCn')"
v-model.trim="formInline.contentCn" :rows="4"/> v-model.trim="formInline.contentCn" :rows="4"/>
</a-form-model-item> </a-form-model-item>
@@ -197,6 +203,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="contentEn"> <a-form-model-item class="itemModel" prop="contentEn">
<a-textarea <a-textarea
:disabled="disabled"
:placeholder="$t('PleaseEnter')+$t('primaryCoverageEn')" :placeholder="$t('PleaseEnter')+$t('primaryCoverageEn')"
v-model.trim="formInline.contentEn" :rows="4"/> v-model.trim="formInline.contentEn" :rows="4"/>
</a-form-model-item> </a-form-model-item>
@@ -211,6 +218,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="workProgressCn"> <a-form-model-item class="itemModel" prop="workProgressCn">
<a-textarea <a-textarea
:disabled="disabled"
:placeholder="$t('PleaseEnter')+$t('workProgressCn')" :placeholder="$t('PleaseEnter')+$t('workProgressCn')"
v-model.trim="formInline.workProgressCn" :rows="4"/> v-model.trim="formInline.workProgressCn" :rows="4"/>
</a-form-model-item> </a-form-model-item>
@@ -225,6 +233,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="workProgressEn"> <a-form-model-item class="itemModel" prop="workProgressEn">
<a-textarea <a-textarea
:disabled="disabled"
:placeholder="$t('PleaseEnter')+$t('workProgressEn')" :placeholder="$t('PleaseEnter')+$t('workProgressEn')"
v-model.trim="formInline.workProgressEn" :rows="4"/> v-model.trim="formInline.workProgressEn" :rows="4"/>
</a-form-model-item> </a-form-model-item>
@@ -239,10 +248,11 @@
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<PersonnelSelection <PersonnelSelection
:query="{db_field_name:'lawsContact',db_field_txt:$t('regulatoryContact')}" :query="{db_field_name:'lawsContactName',db_field_txt:$t('regulatoryContact')}"
:personneQuery="formInline" :personneQuery="formInline"
:disabled="disabled"
@change="PersonnelSelectionChange" @change="PersonnelSelectionChange"
v-model="formInline.lawsContactName"/> v-model="formInline.lawsContact"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -255,7 +265,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="link"> <a-form-model-item class="itemModel" prop="link">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="disabled"
v-model="formInline.link" v-model="formInline.link"
:placeholder="$t('PleaseEnter')+$t('link')"/> :placeholder="$t('PleaseEnter')+$t('link')"/>
</a-form-model-item> </a-form-model-item>
@@ -272,7 +282,7 @@
export default { export default {
name: 'defaultTemplate', name: 'defaultTemplate',
props: ['formInlineQuery'], props: ['formInlineQuery', 'disabled'],
components: { components: {
PersonnelSelection PersonnelSelection
}, },
@@ -358,8 +368,7 @@
] ]
}, },
formInline: {}, formInline: {},
CategoryTreeList: [], CategoryTreeList: []
disabled: false
} }
}, },
mounted() { mounted() {
@@ -367,20 +376,24 @@
this.$nextTick(() => { this.$nextTick(() => {
if (this.formInlineQuery.id) { if (this.formInlineQuery.id) {
this.formInline = JSON.parse(JSON.stringify(this.formInlineQuery)) this.formInline = JSON.parse(JSON.stringify(this.formInlineQuery))
if(this.formInline.technologyTerritory){ if (this.formInline.technologyTerritory) {
this.formInline.technologyTerritory = this.formInline.technologyTerritory.split(',') this.formInline.technologyTerritory = this.formInline.technologyTerritory.split(',')
} }
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
} else { } else {
this.formInline = {} this.formInline = {}
this.formInline.lawsContactName = this.userInfo().username this.formInline.lawsContact = this.userInfo().username
this.formInline.lawsContact = this.userInfo().id this.formInline.lawsContactName = this.userInfo().id
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
} }
}) })
}, },
methods: { methods: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
getStandData(value) {
this.formInline.titleCn = value.serial_number + ' ' + value.title
this.formInline.titleEn = value.serial_number + ' ' + value.title_en
},
getSysCategoryTree() { getSysCategoryTree() {
getAction('/sys/category/getSysCategoryTree', {}).then((res) => { getAction('/sys/category/getSysCategoryTree', {}).then((res) => {
if (res.success) { if (res.success) {
@@ -15,12 +15,14 @@
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required">*</span> <span class="Required" v-if="!disabled">*</span>
<span class="title-text-text" <span class="title-text-text"
:title="$t('fillInTheMonth')">{{$t('fillInTheMonth')}}</span> :title="$t('fillInTheMonth')">{{$t('fillInTheMonth')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="month"> <a-form-model-item class="itemModel" :prop="!disabled?'month':''">
<a-month-picker class="box-input" <a-month-picker class="box-input"
:disabled="disabled"
@change="dateChange({db_field_name:'month'})"
v-model="formInline.month" v-model="formInline.month"
:placeholder="$t('fillInTheMonth')"/> :placeholder="$t('fillInTheMonth')"/>
</a-form-model-item> </a-form-model-item>
@@ -28,7 +30,9 @@
</a-col> </a-col>
<a-col :span="12" style="text-align: right" v-if="formInline.contentTemplate == 1"> <a-col :span="12" style="text-align: right" v-if="formInline.contentTemplate == 1">
<div style="text-align: right"> <div style="text-align: right">
<a-button class="button-text" type="primary">{{$t('bringInStandardInformation')}}</a-button> <a-button class="button-text" @click="bringInStandardInformationClick"
:disabled="disabled" type="primary">{{$t('bringInStandardInformation')}}
</a-button>
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
@@ -36,15 +40,16 @@
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required">*</span> <span class="Required" v-if="!disabled">*</span>
<span class="title-text-text" <span class="title-text-text"
:title="$t('chapterContents')">{{$t('chapterContents')}}</span> :title="$t('chapterContents')">{{$t('chapterContents')}}</span>
</div> </div>
<a-form-model-item class="itemModel-multi" prop="memoriesChapter"> <a-form-model-item class="itemModel-multi" :prop="!disabled?'memoriesChapter':''">
<a-tree-select <a-tree-select
tree-node-filter-prop="title" tree-node-filter-prop="title"
v-model="formInline.memoriesChapter" v-model="formInline.memoriesChapter"
:maxTagCount="1" :maxTagCount="1"
:disabled="disabled"
:getPopupContainer="triggerNode=> triggerNode.parentNode" :getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input" class="box-input"
style="width: 100%" style="width: 100%"
@@ -58,13 +63,13 @@
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required">*</span> <span class="Required" v-if="!templateDisabled">*</span>
<span class="title-text-text" <span class="title-text-text"
:title="$t('contentTemplate')">{{$t('contentTemplate')}}</span> :title="$t('contentTemplate')">{{$t('contentTemplate')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="contentTemplate"> <a-form-model-item class="itemModel" :prop="!templateDisabled?'contentTemplate':''">
<a-select :placeholder="$t('PleaseSelect')+$t('contentTemplate')" <a-select :placeholder="$t('PleaseSelect')+$t('contentTemplate')"
:disabled="disabled" :disabled="templateDisabled"
class="box-input" class="box-input"
:getPopupContainer="triggerNode=> triggerNode.parentNode" :getPopupContainer="triggerNode=> triggerNode.parentNode"
allowClear allowClear
@@ -81,19 +86,21 @@
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
<defaultTemplate :formInlineQuery="formInline" ref="defaultTemplateRef" <defaultTemplate :formInlineQuery="formInline" ref="defaultTemplateRef" :disabled="disabled"
v-if="formInline.contentTemplate == '1'"/> v-if="formInline.contentTemplate == '1' && isTrue"/>
<solicitOpinions :formInlineQuery="formInline " ref="solicitOpinionsRef" <solicitOpinions :formInlineQuery="formInline " ref="solicitOpinionsRef" :disabled="disabled"
v-else-if="formInline.contentTemplate == '2'"/> v-else-if="formInline.contentTemplate == '2' && isTrue"/>
<releaseStandard :formInlineQuery="formInline" ref="releaseStandardRef" <releaseStandard :formInlineQuery="formInline" ref="releaseStandardRef" :disabled="disabled"
v-else-if="formInline.contentTemplate == '3'"/> v-else-if="formInline.contentTemplate == '3' && isTrue"/>
</a-form-model> </a-form-model>
</a-spin> </a-spin>
<div class="drawer-bootom-button"> <div class="drawer-bootom-button">
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button> <a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button> <a-button @click="handleSubmit" v-if="!disabled" type="primary" :loading="confirmLoading">{{$t('submit')}}
</a-button>
</div> </div>
</a-drawer> </a-drawer>
<addModel ref="addModelRef" @addModelForm="addModelForm"/>
</div> </div>
</template> </template>
@@ -101,14 +108,17 @@
import defaultTemplate from './defaultTemplate' import defaultTemplate from './defaultTemplate'
import solicitOpinions from './solicitOpinions' import solicitOpinions from './solicitOpinions'
import releaseStandard from './releaseStandard' import releaseStandard from './releaseStandard'
import addModel from './addModel'
import { getAction, postAction, downloadFile } from '@/api/manage' import { getAction, postAction, downloadFile } from '@/api/manage'
import moment from 'moment'
export default { export default {
name: 'fillAdd', name: 'fillAdd',
components: { components: {
defaultTemplate, defaultTemplate,
solicitOpinions, solicitOpinions,
releaseStandard releaseStandard,
addModel
}, },
data() { data() {
return { return {
@@ -140,7 +150,9 @@
confirmLoading: false, confirmLoading: false,
title: '', title: '',
disabled: false, disabled: false,
isTrue: false,
chapterContentsList: [], chapterContentsList: [],
templateDisabled: false,
contentTemplateList: [ contentTemplateList: [
{ {
id: '1', id: '1',
@@ -165,6 +177,12 @@
mounted() { mounted() {
}, },
methods: { methods: {
bringInStandardInformationClick() {
this.$refs.addModelRef.addModel()
},
addModelForm(value) {
this.$refs.defaultTemplateRef.getStandData(value)
},
getTree() { getTree() {
getAction('/report/lawsMonthlyReportTitleTemplateEO/list', {}).then((res) => { getAction('/report/lawsMonthlyReportTitleTemplateEO/list', {}).then((res) => {
if (res.success) { if (res.success) {
@@ -174,37 +192,53 @@
} }
}) })
}, },
dateChange(item) {
this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM') : ''
this.formInline = { ...this.formInline }
},
add() { add() {
this.isTrue = false
this.templateDisabled = false
this.getTree() this.getTree()
this.title = this.$t('addContent') this.title = this.$t('addContent')
this.visible = true this.visible = true
this.disabled = false this.disabled = false
this.formInline = {}
this.$nextTick(() => { this.$nextTick(() => {
this.formInline = {}
this.formInline.contentTemplate = '1' this.formInline.contentTemplate = '1'
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
this.isTrue = true
this.$refs.ruleForm.clearValidate() this.$refs.ruleForm.clearValidate()
}) })
}, },
edit(row) { edit(row) {
this.getTree() this.getTree()
this.isTrue = false
this.title = this.$t('editContent') this.title = this.$t('editContent')
this.visible = true this.visible = true
this.disabled = false this.disabled = false
this.templateDisabled = true
this.$nextTick(() => { this.$nextTick(() => {
this.formInline = row this.formInline = row
if (this.formInline.memoriesChapter) { if (this.formInline.memoriesChapter) {
this.formInline.memoriesChapter = this.formInline.memoriesChapter.split(',') this.formInline.memoriesChapter = this.formInline.memoriesChapter.split(',')
} }
this.isTrue = true
this.$refs.ruleForm.clearValidate() this.$refs.ruleForm.clearValidate()
}) })
}, },
view(row) { view(row) {
this.title = this.$t('viewContent') this.title = this.$t('viewContent')
this.visible = true this.visible = true
this.isTrue = false
this.templateDisabled = true
this.disabled = true this.disabled = true
this.$nextTick(() => { this.$nextTick(() => {
this.formInline = row this.formInline = row
if (this.formInline.memoriesChapter) {
this.formInline.memoriesChapter = this.formInline.memoriesChapter.split(',')
}
this.isTrue = true
this.$refs.ruleForm.clearValidate() this.$refs.ruleForm.clearValidate()
}) })
}, },
@@ -237,17 +271,16 @@
} }
}) })
let query = Object.assign(val, { let query = Object.assign(val, {
month: JSON.stringify(formInline.month), month: formInline.month,
memoriesChapter: formInline.memoriesChapter, memoriesChapter: formInline.memoriesChapter,
contentTemplate: formInline.contentTemplate contentTemplate: formInline.contentTemplate
}) })
postAction(url, query).then((res) => { postAction(url, query).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
this.visible = false this.visible = false
this.confirmLoading = false this.confirmLoading = false
this.$emit('fillTableAddForm') this.$emit('fillAddForm')
} else { } else {
this.confirmLoading = false this.confirmLoading = false
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
@@ -260,7 +293,15 @@
} }
} }
</script> </script>
<style>
.ant-select-disabled {
color: rgba(0, 0, 0, 0.65);
}
.ant-input-disabled {
color: rgba(0, 0, 0, 0.65) !important;
}
</style>
<style scoped> <style scoped>
.box-title-text { .box-title-text {
@@ -5,11 +5,11 @@
{{'NO.'+(index+1)}} {{'NO.'+(index+1)}}
<a-icon class="icon-size" <a-icon class="icon-size"
@click="addData" @click="addData"
v-if="(dataList.length-1) == index" v-if="(dataList.length-1) == index && !disabled"
type="plus-circle"/> type="plus-circle"/>
<a-icon class="icon-size" <a-icon class="icon-size"
@click="deleteData" @click="deleteData"
v-if="dataList.length > 1 && (dataList.length - 1) == index" v-if="dataList.length > 1 && (dataList.length - 1) == index && !disabled"
type="minus-circle"/> type="minus-circle"/>
</div> </div>
<a-row :gutter="24"> <a-row :gutter="24">
@@ -20,8 +20,8 @@
</div> </div>
<a-form-model-item class="itemModel" prop="standardNo"> <a-form-model-item class="itemModel" prop="standardNo">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="disabled"
v-model="formInline.standardNumber" v-model="item.standardNumber"
:placeholder="$t('PleaseEnter')+$t('standardNo')"/> :placeholder="$t('PleaseEnter')+$t('standardNo')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -34,8 +34,8 @@
</div> </div>
<a-form-model-item class="itemModel" prop="standardNameCn"> <a-form-model-item class="itemModel" prop="standardNameCn">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="disabled"
v-model="formInline.standardNameCn" v-model="item.standardNameCn"
:placeholder="$t('PleaseEnter')+$t('standardNameCn')"/> :placeholder="$t('PleaseEnter')+$t('standardNameCn')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -49,8 +49,8 @@
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="disabled"
v-model="formInline.standardNameEn" v-model="item.standardNameEn"
:placeholder="$t('PleaseEnter')+$t('standardNameEn')"/> :placeholder="$t('PleaseEnter')+$t('standardNameEn')"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
@@ -66,7 +66,7 @@
@change="dateChange('issueTime',index)" @change="dateChange('issueTime',index)"
:getCalendarContainer="(trigger) => trigger.parentNode" :getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD" format="YYYY-MM-DD"
v-model="formInline['issueTime']" v-model="item['issueTime']"
:disabled="disabled" :disabled="disabled"
style="width: 100%"/> style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
@@ -85,7 +85,7 @@
@change="dateChange('implementTime',index)" @change="dateChange('implementTime',index)"
:getCalendarContainer="(trigger) => trigger.parentNode" :getCalendarContainer="(trigger) => trigger.parentNode"
format="YYYY-MM-DD" format="YYYY-MM-DD"
v-model="formInline['implementTime']" v-model="item['implementTime']"
:disabled="disabled" :disabled="disabled"
style="width: 100%"/> style="width: 100%"/>
</a-form-model-item> </a-form-model-item>
@@ -101,13 +101,12 @@
export default { export default {
name: 'releaseStandard', name: 'releaseStandard',
props:['formInlineQuery'], props:['formInlineQuery','disabled'],
data() { data() {
return { return {
rules: {}, rules: {},
formInline: {}, formInline: {},
CategoryTreeList: [], CategoryTreeList: [],
disabled: false,
dataList: [] dataList: []
} }
}, },
@@ -116,6 +115,8 @@
if (this.formInlineQuery.id) { if (this.formInlineQuery.id) {
this.formInline = JSON.parse(JSON.stringify(this.formInlineQuery)) this.formInline = JSON.parse(JSON.stringify(this.formInlineQuery))
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
this.dataList = this.formInline.newStandardTemplateEOList
this.dataList = [...this.dataList]
} else { } else {
this.dataList = [ this.dataList = [
{ {
@@ -157,7 +158,11 @@
getData(callback) { getData(callback) {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
callback && callback(this.formInline) let query = {
id: this.formInline.id,
newStandardTemplateEOList: this.dataList
}
callback && callback(query)
} }
}) })
} }
@@ -5,11 +5,11 @@
{{'NO.'+(index+1)}} {{'NO.'+(index+1)}}
<a-icon class="icon-size" <a-icon class="icon-size"
@click="addData" @click="addData"
v-if="(dataList.length-1) == index" v-if="(dataList.length-1) == index && !disabled"
type="plus-circle"/> type="plus-circle"/>
<a-icon class="icon-size" <a-icon class="icon-size"
@click="deleteData" @click="deleteData"
v-if="dataList.length > 1 && (dataList.length - 1) == index" v-if="dataList.length > 1 && (dataList.length - 1) == index && !disabled"
type="minus-circle"/> type="minus-circle"/>
</div> </div>
<a-row :gutter="24"> <a-row :gutter="24">
@@ -20,7 +20,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="planNoChinese"> <a-form-model-item class="itemModel" prop="planNoChinese">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="disabled"
v-model="item.planNumberCn" v-model="item.planNumberCn"
:placeholder="$t('PleaseEnter')+$t('planNoChinese')"/> :placeholder="$t('PleaseEnter')+$t('planNoChinese')"/>
</a-form-model-item> </a-form-model-item>
@@ -34,7 +34,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="standardNameCn"> <a-form-model-item class="itemModel" prop="standardNameCn">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="disabled"
v-model="item.standardNameCn" v-model="item.standardNameCn"
:placeholder="$t('PleaseEnter')+$t('standardNameCn')"/> :placeholder="$t('PleaseEnter')+$t('standardNameCn')"/>
</a-form-model-item> </a-form-model-item>
@@ -49,7 +49,7 @@
</div> </div>
<a-form-model-item class="itemModel"> <a-form-model-item class="itemModel">
<a-input class="box-input" <a-input class="box-input"
:disabled="false" :disabled="disabled"
v-model="item.standardNameEn" v-model="item.standardNameEn"
:placeholder="$t('PleaseEnter')+$t('standardNameEn')"/> :placeholder="$t('PleaseEnter')+$t('standardNameEn')"/>
</a-form-model-item> </a-form-model-item>
@@ -82,13 +82,12 @@
export default { export default {
name: 'solicitOpinions', name: 'solicitOpinions',
props: ['formInlineQuery'], props: ['formInlineQuery','disabled'],
data() { data() {
return { return {
rules: {}, rules: {},
formInline: {}, formInline: {},
CategoryTreeList: [], CategoryTreeList: [],
disabled: false,
dataList: [] dataList: []
} }
}, },
@@ -97,6 +96,8 @@
if (this.formInlineQuery.id) { if (this.formInlineQuery.id) {
this.formInline = JSON.parse(JSON.stringify(this.formInlineQuery)) this.formInline = JSON.parse(JSON.stringify(this.formInlineQuery))
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
this.dataList = this.formInline.newOpinionTemplateEOList
this.dataList = [...this.dataList]
} else { } else {
this.dataList = [ this.dataList = [
{ {
@@ -136,7 +137,11 @@
getData(callback) { getData(callback) {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
callback && callback(this.formInline) let query = {
id: this.formInline.id,
newOpinionTemplateEOList: this.dataList
}
callback && callback(query)
} }
}) })
} }
@@ -11,31 +11,34 @@
<div class="text-text-right" <div class="text-text-right"
:class="{ 'null-input':item.checked }"> :class="{ 'null-input':item.checked }">
<div class="text-header" @click="titleClick(item)"> <div class="text-header" @click="titleClick(item)">
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5"> <a-tooltip placement="topLeft" :mouseEnterDelay="0.5" >
<template slot="title"> <template slot="title">
<span v-html="item.module_type"></span> <span v-html="item.module_type"></span>
</template> </template>
<span v-html="item.module_type"></span> <span style="cursor: pointer" v-html="item.module_type"></span>
</a-tooltip>
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5">
<template slot="title"> <template slot="title">
<span v-html="item.serial_number"></span> <span v-html="item.serial_number"></span>
</template> </template>
<span style="cursor: pointer" <span style="cursor: pointer"
v-html="item.serial_number"></span> v-html="item.serial_number"></span>
</a-tooltip>
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5">
<template slot="title"> <template slot="title">
<span v-html="item.title"></span> <span v-html="item.title"></span>
</template> </template>
<span style="cursor: pointer" v-html="item.title"></span> <span style="cursor: pointer" v-html="item.title"></span>
</a-tooltip>
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5">
<template slot="title"> <template slot="title">
<span v-html="item.file_name"></span> <span v-html="item.file_name"></span>
</template> </template>
<span style="cursor: pointer" v-html="item.file_name"></span> <span style="cursor: pointer" v-html="item.file_name"></span>
</a-tooltip> </a-tooltip>
<!-- <a-tooltip placement="topLeft" :mouseEnterDelay="0.5">-->
<!-- </a-tooltip>-->
<!-- <a-tooltip placement="topLeft" :mouseEnterDelay="0.5">-->
<!-- </a-tooltip>-->
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5">
</a-tooltip>
</div> </div>
<a-tooltip placement="topLeft" v-if="!queryParam.selectValue" :mouseEnterDelay="0.5"> <a-tooltip placement="topLeft" v-if="!queryParam.selectValue" :mouseEnterDelay="0.5">
<template slot="title"> <template slot="title">
@@ -262,7 +265,7 @@
font-weight: bold; font-weight: bold;
color: #040B29; color: #040B29;
display: inline-block; display: inline-block;
max-width: 200px; max-width: 500px;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
@@ -131,6 +131,7 @@ export default {
this.title = '编辑' this.title = '编辑'
this.$nextTick(() => { this.$nextTick(() => {
this.formInline = value this.formInline = value
this.$refs['ruleForm'].clearValidate()
}) })
}, },
handleCancel() { handleCancel() {
@@ -38,11 +38,19 @@
<span>{{$t('configure')}}</span> <span>{{$t('configure')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="configIds"> <a-form-model-item class="itemModel" prop="configIds">
<j-multi-select-tag class="box-input" v-model="formInline.configIds" <!-- <j-multi-select-tag class="box-input" v-model="formInline.configIds"-->
:options="dictOptions" <!-- :options="dictOptions"-->
:placeholder="$t('PleaseSelect')+$t('configure')" <!-- :placeholder="$t('PleaseSelect')+$t('configure')"-->
:type="'select'" <!-- :type="'select'"-->
:triggerChange="false" :dictCode="'cert_category'"/> <!-- :triggerChange="false"/>-->
<a-select v-model="formInline.configIds" class="box-input" mode='multiple' :placeholder="$t('PleaseSelect')+$t('configure')">
<a-select-option
v-for="mode in dictOptions"
:key="mode.value"
:value="mode.value">
{{ mode.label }}
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -75,10 +83,9 @@
<span class="title-text-text" <span class="title-text-text"
:title="$t('MergeSeparator')">{{$t('MergeSeparator')}}</span> :title="$t('MergeSeparator')">{{$t('MergeSeparator')}}</span>
</div> </div>
<a-form-model-item class="itemModel" :prop="this.disabled == true?'separator':''"> <a-form-model-item class="itemModel" :prop="required?'separator':''">
<!-- :disabled="disabled"--> <!-- :disabled="disabled"-->
<a-input class="box-input" <a-input class="box-input"
v-model="formInline.separator" v-model="formInline.separator"
:placeholder="$t('PleaseEnter')+$t('MergeSeparator')"/> :placeholder="$t('PleaseEnter')+$t('MergeSeparator')"/>
</a-form-model-item> </a-form-model-item>
@@ -122,7 +129,6 @@ export default {
rules: { rules: {
separator:[ separator:[
{ required: true, message: this.$t('PleaseEnter')+this.$t('MergeSeparator'), trigger: 'change' }, { required: true, message: this.$t('PleaseEnter')+this.$t('MergeSeparator'), trigger: 'change' },
// { min:1, max: 50, message: this.$t('cantExeed')+'50'+this.$t('MergeSeparator'), trigger: 'blur' },
], ],
certCategory:[ certCategory:[
{ required: true, message: this.$t('PleaseEnter')+this.$t('certificationCategory'), trigger: 'change' }, { required: true, message: this.$t('PleaseEnter')+this.$t('certificationCategory'), trigger: 'change' },
@@ -180,10 +186,8 @@ export default {
console.log(value.target.value) console.log(value.target.value)
if(value.target.value == 2){ if(value.target.value == 2){
this.required = true this.required = true
this.disabled = true
}else{ }else{
this.required = false this.required = false
this.disabled = false
} }
}, },
getNameList() { getNameList() {
@@ -228,6 +232,7 @@ export default {
}, },
handleCancel() { handleCancel() {
this.visible = false this.visible = false
this.required = false
this.$refs.ruleForm.resetFields() this.$refs.ruleForm.resetFields()
}, },
certCategoryName(value){ certCategoryName(value){
@@ -20,7 +20,7 @@
<span>{{$t('configure')}}</span> <span>{{$t('configure')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="configIds"> <a-form-model-item class="itemModel" prop="configIds">
<a-select v-model="formInline.configIds" class="code-mode-select" :placeholder="$t('PleaseSelect')+$t('configure')"> <a-select v-model="formInline.configIds" class="box-input" :placeholder="$t('PleaseSelect')+$t('configure')">
<a-select-option <a-select-option
v-for="mode in dictOptions" v-for="mode in dictOptions"
:key="mode.value" :key="mode.value"
@@ -89,39 +89,48 @@
{{$t('CustomExport')}} {{$t('CustomExport')}}
</div> </div>
</div> </div>
<div> <div style="width: 100%">
<a-table <!-- 表格-10控件-->
ref="table" <table-collection ref="CollectionTabel" :url='url' :paramsManifest='paramsManifest' @rowValue='rowValue'
size="middle" :formInline='formInline' :currentPersonRole='currentPersonRole'
:loading="loading" @getDataSource="getDataSource"
:pagination="false" @handlePreservation="handlePreservation"
:scroll="{x: true}" @value='value'
rowKey="id" @listReset='listReset' @LoginUserType='LoginUserType'/>
:data-source="dataSource"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
>
<span slot="titleName" slot-scope="text,record" :title="text">
{{ text && text.length > 10 ? text.slice(0, 9) + '...' : text }}
</span>
<span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation" @click="deleteLib(record)">{{$t('deleteLib')}}</a>
</span>
</a-table>
</div>
<div class="page">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div> </div>
<!-- <div>-->
<!-- <a-table-->
<!-- ref="table"-->
<!-- size="middle"-->
<!-- :loading="loading"-->
<!-- :pagination="false"-->
<!-- :scroll="{x: true}"-->
<!-- rowKey="id"-->
<!-- :data-source="dataSource"-->
<!-- :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"-->
<!-- :columns="columns"-->
<!-- >-->
<!-- <span slot="titleName" slot-scope="text,record" :title="text">-->
<!-- {{ text && text.length > 10 ? text.slice(0, 9) + '...' : text }}-->
<!-- </span>-->
<!-- <span slot="operation" slot-scope="text,record">-->
<!-- <a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>-->
<!-- <a class="text-operation" @click="deleteLib(record)">{{$t('deleteLib')}}</a>-->
<!-- </span>-->
<!-- </a-table>-->
<!-- </div>-->
<!-- <div class="page">-->
<!-- <a-pagination-->
<!-- :show-total="total => $t('total')+` ${total} `+$t('strip')"-->
<!-- show-quick-jumper-->
<!-- show-size-changer-->
<!-- :page-size.sync="pageSize"-->
<!-- :total="total"-->
<!-- :current="pageNo"-->
<!-- @change="pageOnChange"-->
<!-- @showSizeChange="SizeChange"-->
<!-- />-->
<!-- </div>-->
<conventionalModel :url="url" ref="conventionalModel"/> <conventionalModel :url="url" ref="conventionalModel"/>
<customelModel :url="url" ref="customelModel"/> <customelModel :url="url" ref="customelModel"/>
</a-card> </a-card>
@@ -130,6 +139,7 @@
<script> <script>
import { getAction,postAction } from '../../../api/manage' import { getAction,postAction } from '../../../api/manage'
import axios from 'axios' import axios from 'axios'
import TableCollection from '@/components/tableCollection/index1'
import conventionalModel from './commponts/conventionalmodle' import conventionalModel from './commponts/conventionalmodle'
import customelModel from './commponts/customexportmodle' import customelModel from './commponts/customexportmodle'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
@@ -140,6 +150,7 @@ export default {
components: { components: {
conventionalModel, conventionalModel,
customelModel, customelModel,
TableCollection,
PersonnelSelection PersonnelSelection
}, },
data(){ data(){
@@ -212,7 +223,7 @@ export default {
props: { props: {
}, },
mounted() { mounted() {
this.Getlist() // this.Getlist()
this.getTableList() this.getTableList()
}, },
methods:{ methods:{
@@ -302,6 +313,82 @@ export default {
}, },
onSelectChange() { onSelectChange() {
},
getDataSource(data) {
this.dataSource = data
},
handlePreservation(num) {
let _this = this
let postDate = []
let data = JSON.parse(JSON.stringify(this.dataSource))
let selectedRowKeysValue = []
data.forEach(res => {
if (res.state == 'Wait Fill' || res.state == '待填写') {
selectedRowKeysValue.push(res)
}
})
for (let i = 0; i < selectedRowKeysValue.length; i++) {
let postDateobj = {}
let itemIn = Object.keys(selectedRowKeysValue[i])
for (let j = 0; j < itemIn.length; j++) {
if (itemIn[j] !== 'sdt') {
if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) {
postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]]
for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) {
if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more') {
selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',')
}
if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) {
selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString()
}
}
}
}
}
postDateobj.id = selectedRowKeysValue[i].id
postDate.push(postDateobj)
}
let configDataList = { configDataList: postDate }
if (selectedRowKeysValue && selectedRowKeysValue.length > 0) {
if (num && num == 1) {
this.textLoading = true
}
let query = {
...configDataList,
paramsManifestId: this.paramsManifest.id
}
postAction('/params/collectManifest/save', query).then((res) => {
if (res.success) {
if (num && num == 1) {
_this.$message.success(_this.$t('OperationSuccessful'))
this.textLoading = false
}
setTimeout(() => {
if (this.currentPersonRole == 'dre') {
this.handlePreservation()
}
}, 10000)
} else {
if (num && num == 1) {
_this.$message.warning(_this.$t('operationFailed'))
this.textLoading = false
}
}
})
} else {
if (num && num == 1) {
this.$message.warning(this.$t('theCurrentListSaved'))
}
}
},
LoginUserType(val, currentPersonRole, userType) {
this.RoleType = []
if (this.currentPersonRole == '') {
this.currentPersonRole = currentPersonRole || userType || val[0].value
}
this.RoleType = val
this.formInlineRoleSwitching.roleSwitchingCode = currentPersonRole || userType || val[0].value
this.formInlineRoleSwitching = { ...this.formInlineRoleSwitching }
}, },
GetgetTableList() { GetgetTableList() {
this.$refs.CollectionTabel.getTableList() this.$refs.CollectionTabel.getTableList()
@@ -326,19 +413,23 @@ export default {
}, },
searchQuery() { searchQuery() {
this.pageNo = 1 this.pageNo = 1
this.getTableList() this.$refs.CollectionTabel.getTableList()
}, },
searchReset() { searchReset() {
this.pageNo = 1 this.pageNo = 1
this.formInline = {} this.$refs.CollectionTabel.getTableListReset()
},
pageOnChange(page, pageSize) {
this.pageNo = page
this.$emit('handlePreservation')
this.getTableList() this.getTableList()
}, },
pageOnChange() { SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.$emit('handlePreservation')
this.getTableList()
}, },
SizeChange() {
}
} }
} }
</script> </script>
@@ -102,6 +102,7 @@
/> />
</div> </div>
<addModel :url="url" ref="addModelRef" @addModelList="addModelList" :certCategoryParamsInfoEOListItem='certCategoryParamsInfoEOList'/> <addModel :url="url" ref="addModelRef" @addModelList="addModelList" :certCategoryParamsInfoEOListItem='certCategoryParamsInfoEOList'/>
<JLoading :loading="textLoading">{{$t('pleaseWaitWhileRunning')}}</JLoading>
</a-card> </a-card>
</template> </template>
@@ -122,6 +123,7 @@ export default {
return { return {
certCategoryParamsInfoEOList: [], certCategoryParamsInfoEOList: [],
orderBy: '1', orderBy: '1',
textLoading:false,
selectedRowKeysArray: '', selectedRowKeysArray: '',
token:Vue.ls.get(ACCESS_TOKEN), token:Vue.ls.get(ACCESS_TOKEN),
loading: false, loading: false,
@@ -192,7 +194,7 @@ export default {
title: this.$t('operation'), title: this.$t('operation'),
align: 'center', align: 'center',
fixed: 'right', fixed: 'right',
width: 100, width: 120,
scopedSlots: { customRender: 'operation' } scopedSlots: { customRender: 'operation' }
} }
], ],
@@ -235,11 +237,14 @@ export default {
}, },
// 发布版本 // 发布版本
releaseVersion() { releaseVersion() {
this.textLoading = true
getAction('params/paramsInfo/publish', { paramsTemplateId: this.$route.query.id }).then((res) => { getAction('params/paramsInfo/publish', { paramsTemplateId: this.$route.query.id }).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(res.result) this.$message.success(res.result)
this.textLoading = false
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
this.textLoading = false
} }
}) })
}, },
@@ -49,15 +49,6 @@
// 请求转换流程图 // 请求转换流程图
processNum() { processNum() {
let params = {} let params = {}
if (this.$route.query.prcType == 5){
params = {
prcId: this.$route.query.prcId
}
}else{
params = {
prcNum: this.$route.query.prcNum
}
}
axios.request({ axios.request({
url: '/jero-boot/workFlow/getImg?_t=' + new Date().getTime(), url: '/jero-boot/workFlow/getImg?_t=' + new Date().getTime(),
responseType: 'blob', responseType: 'blob',
@@ -65,7 +56,9 @@
headers: { headers: {
'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)
}, },
params: params params: {
prcNum: this.$route.query.prcNum
}
}).then(res => { }).then(res => {
this.processStep = window.URL.createObjectURL(res.data) this.processStep = window.URL.createObjectURL(res.data)
}) })
@@ -304,7 +304,7 @@
<!-- 错误数据提示--> <!-- 错误数据提示-->
<a-modal <a-modal
:title="$t('operationFailed')" :title="$t('operationFailed')"
:width="700" :width="860"
v-model="visibleoperationFailed" v-model="visibleoperationFailed"
:maskClosable="false" :maskClosable="false"
:footer="null" :footer="null"
@@ -330,47 +330,47 @@
</div> </div>
</div> </div>
<!-- 认证工程师-提示--> <!-- 认证工程师-提示-->
<div style='font-size: 16px;color: red;display: flex;justify-content: center' v-if='NoEngineer === 1'> <div style='font-size: 16px;color: red;text-align: center' v-if='NoEngineer === 1'>
{{ currentPersonRole =='homo'? $t('certifiedEngineer'): (currentPersonRole =='sdt'? {{ currentPersonRole =='homo'? $t('certifiedEngineer'): (currentPersonRole =='sdt'?
$t('engineeringInterfacePerson'): $t('completedBy')) }}{{$t('Datastatusis')}} $t('engineeringInterfacePerson'): $t('completedBy')) }}{{$t('Datastatusis')}}
<!-- 下发收集时--> <!-- 下发收集时-->
<span v-if='jurisdiction === "HOMOZFSJ"'> <span v-if='jurisdiction === "HOMOZFSJ"' class="text-wraning">
'{{$t('CollectionInitiated')}}'、'{{$t('ReturnedPerson')}}'{{$t('or')}}'{{$t('alteration')}}' '{{$t('CollectionInitiated')}}'、'{{$t('ReturnedPerson')}}'{{$t('or')}}'{{$t('alteration')}}'
</span> </span>
<!-- 同步上报库--> <!-- 同步上报库-->
<span v-else-if='jurisdiction === "HOMOTBSBK"'> <span v-else-if='jurisdiction === "HOMOTBSBK"' class="text-wraning">
'{{$t('Submitted')}}'{{$t('or')}}'{{$t('alteration')}}' '{{$t('Submitted')}}'{{$t('or')}}'{{$t('alteration')}}'
</span> </span>
<!-- 截止时间--> <!-- 截止时间-->
<span v-else-if='jurisdiction === "HOMOJZSJ"'> <span v-else-if='jurisdiction === "HOMOJZSJ"' class="text-wraning">
'{{$t('CollectionInitiated')}}' '{{$t('CollectionInitiated')}}'
</span> </span>
<!-- 分配填写人 --> <!-- 分配填写人 -->
<span v-else-if='jurisdiction === "SDTFPTXR"'> <span v-else-if='jurisdiction === "SDTFPTXR"' class="text-wraning">
'{{$t('handledInterface')}}'{{$t('or')}}'{{$t('Filledreturn')}}' '{{$t('handledInterface')}}'{{$t('or')}}'{{$t('Filledreturn')}}'
</span> </span>
<!-- 引用参数--> <!-- 引用参数-->
<span v-else-if='jurisdiction === "DREYYCS"'> <span v-else-if='jurisdiction === "DREYYCS"' class="text-wraning">
'{{$t('completed')}}'{{$t('or')}}'{{$t('ReturnedEngineer')}}' '{{$t('completed')}}'{{$t('or')}}'{{$t('ReturnedEngineer')}}'
</span> </span>
<!-- 退回--> <!-- 退回-->
<span v-else-if='jurisdiction === "homoTH"'> <span v-else-if='jurisdiction === "homoTH"' class="text-wraning">
{{$t('Submitted')}} {{$t('Submitted')}}
</span> </span>
<span v-else-if='jurisdiction === "sdtTH"'> <span v-else-if='jurisdiction === "sdtTH"' class="text-wraning">
'{{$t('handledInterface')}}'{{$t('or')}}'{{$t('Filledreturn')}}' '{{$t('handledInterface')}}'{{$t('or')}}'{{$t('Filledreturn')}}'
</span> </span>
<span v-else-if='jurisdiction === "dreTH"'> <span v-else-if='jurisdiction === "dreTH"' class="text-wraning">
'{{$t('completed')}}'{{$t('or')}}'{{$t('ReturnedEngineer')}}' '{{$t('completed')}}'{{$t('or')}}'{{$t('ReturnedEngineer')}}'
</span> </span>
<!-- 强制撤回--> <!-- 强制撤回-->
<span v-else-if='jurisdiction === "homoQZTH"'> <span v-else-if='jurisdiction === "homoQZTH"' class="text-wraning">
'{{$t('handledInterface')}}'{{$t('or')}}'{{$t('Filledreturn')}}' '{{$t('handledInterface')}}'{{$t('or')}}'{{$t('Filledreturn')}}'
</span> </span>
<span v-else-if='jurisdiction === "sdtQZTH"'> <span v-else-if='jurisdiction === "sdtQZTH"' class="text-wraning">
{{$t('completed')}} {{$t('completed')}}
</span> </span>
<span v-else-if='jurisdiction === "dreQZTH"'> <span v-else-if='jurisdiction === "dreQZTH"' class="text-wraning">
{{$t('Submitted')}} {{$t('Submitted')}}
</span> </span>
{{$t('timeoperation')}} {{$t('timeoperation')}}
@@ -634,6 +634,10 @@
}, },
roleSwitchingClick() { roleSwitchingClick() {
this.visibleRoleSwitching = true this.visibleRoleSwitching = true
this.$nextTick(()=>{
this.formInlineRoleSwitching.roleSwitchingCode = this.currentPersonRole
this.$refs.ruleFormRoleSwitching.clearValidate()
})
}, },
GetgetLoginUserType() { GetgetLoginUserType() {
this.$refs.CollectionTabel.getLoginUserType() this.$refs.CollectionTabel.getLoginUserType()
@@ -1124,7 +1128,8 @@
let data = JSON.parse(JSON.stringify(this.dataSource)) let data = JSON.parse(JSON.stringify(this.dataSource))
let selectedRowKeysValue = [] let selectedRowKeysValue = []
data.forEach(res => { data.forEach(res => {
if (res.state == 'Wait Fill' || res.state == '待填写') { if (res.state == 'Wait Fill' || res.state == '待填写' || res.state == '认证工程师退回' ||
res.state == 'Cert Back') {
selectedRowKeysValue.push(res) selectedRowKeysValue.push(res)
} }
}) })
@@ -1674,4 +1679,7 @@
} }
} }
} }
.text-wraning{
word-break: break-word;
}
</style> </style>
@@ -155,14 +155,14 @@
title: this.$t('collectionCompletionTime'), title: this.$t('collectionCompletionTime'),
align: 'center', align: 'center',
dataIndex: 'finishTime', dataIndex: 'finishTime',
width: 160, width: 180,
ellipsis: true, ellipsis: true,
scopedSlots: { customRender: 'collectionCompletionTime' } scopedSlots: { customRender: 'collectionCompletionTime' }
}, },
{ {
title: this.$t('Version'), title: this.$t('Version'),
align: 'center', align: 'center',
width: 50, width: 80,
ellipsis: true, ellipsis: true,
dataIndex: 'version' dataIndex: 'version'
}, },