Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage

# Conflicts:
#	jero-web/src/common/lang/en-us.js
#	jero-web/src/common/lang/zh-cn.js
This commit is contained in:
zyx.net
2022-08-09 17:54:10 +08:00
32 changed files with 1312 additions and 134 deletions
@@ -840,3 +840,33 @@ ALTER TABLE `laws_weilai`.`problem_knowledge_base`
-- 问题知识库 字段类型修改 2022-08-09
ALTER TABLE `laws_weilai`.`problem_knowledge_base`
MODIFY COLUMN `content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '内容(正文)' AFTER `stand_title`;
-- 国家与国旗关系表 2022-08-09
CREATE TABLE `laws_weilai`.`country_national_flag` (
`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 '所属部门',
`country_name_cn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '国家名称中文',
`country_name_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '国家名称英文',
`national_flag_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '国旗文件id',
`national_flag_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '国旗url',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '国家与国旗中间表' ROW_FORMAT = Dynamic;
-- 初始化数据 2022-08-09
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('11', NULL, NULL, NULL, NULL, NULL, '澳大利亚', 'Australia', NULL, '澳大利亚.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('12', NULL, NULL, NULL, NULL, NULL, '新西兰', 'New Zealand', NULL, '新西兰.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('13', NULL, NULL, NULL, NULL, NULL, '英国', 'UK', NULL, '英国.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('2', NULL, NULL, NULL, NULL, NULL, '中国', 'China', NULL, '中国.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('3', NULL, NULL, NULL, NULL, NULL, '中国香港', 'Hong Kong China', NULL, '中国香港.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('4', NULL, NULL, NULL, NULL, NULL, '韩国', 'South Korea', NULL, '韩国.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('5', NULL, NULL, NULL, NULL, NULL, '日本', 'Japan', NULL, '日本.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('6', NULL, NULL, NULL, NULL, NULL, '新加坡', 'Singapore', NULL, '新加坡.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('7', NULL, NULL, NULL, NULL, NULL, '马来西亚', 'Malaysia', NULL, '马来西亚.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('8', NULL, NULL, NULL, NULL, NULL, '海湾地区', 'GCC', NULL, '海湾地区.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('9', NULL, NULL, NULL, NULL, NULL, '阿联酋', 'UAE', NULL, '阿联酋.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('1', NULL, NULL, NULL, NULL, NULL, '欧盟', 'EU', NULL, '欧盟.jpg');
INSERT INTO `laws_weilai`.`country_national_flag` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `country_name_cn`, `country_name_en`, `national_flag_id`, `national_flag_url`) VALUES ('10', NULL, NULL, NULL, NULL, NULL, '美国', 'US', NULL, '美国.jpg');
@@ -726,16 +726,6 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
// 替换模板中的占位符
try {
//下载关联文件内容
List<OSSFile> allRelevFileList = (List<OSSFile>) allParamsInfoList.get(2).get("fileListAll");
if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList());
String exportFile = "导出文件";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
exportFile = "Export file";
}
downLoadFileList(allRelevFileList,fileNowPath + File.separator + exportFile);
}
// 拿取模板
String repFileName = fileName.replaceAll("/","_");
@@ -743,6 +733,35 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
if (CosBootUtil.doesObjectExist(templateUrl)) {
InputStream wordTemplate = CosBootUtil.download(templateUrl);
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(wordTemplate);
//下载关联文件内容
List<Map<String, Object>> fileListAll = (List<Map<String, Object>>) allParamsInfoList.get(2).get("fileListAll");
if (fileListAll != null && !fileListAll.isEmpty()) {
Map<String,String> paramsAfterFilter = WordUtil.filterParams(wordMLPackage, params);
if (CollectionUtil.isNotEmpty(paramsAfterFilter)) {
List<String> nioNumberList = paramsAfterFilter.keySet().stream().collect(Collectors.toList());
List<OSSFile> allRelevFileList = new ArrayList<>();
for (Map<String, Object> fileMap : fileListAll) {
for (Map.Entry map : fileMap.entrySet()) {
String key = (String) map.getKey();
List<OSSFile> fileList = (List<OSSFile>) map.getValue();
if (nioNumberList.contains(key)) {
allRelevFileList.addAll(fileList);
}
}
}
if (CollectionUtil.isNotEmpty(allRelevFileList)) {
String exportFile = "导出文件";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
exportFile = "Export file";
}
downLoadFileList(allRelevFileList, fileNowPath + File.separator + exportFile);
}
}
}
// 替换占位符内容
WordUtil.replacePictureBatch(wordMLPackage, imgListAll);
WordUtil.replaceVariable(wordMLPackage, params);
@@ -837,29 +856,47 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
// 替换模板中的占位符
try {
//下载关联文件内容
List<OSSFile> allRelevFileList = (List<OSSFile>) allParamsInfoList.get(2).get("fileListAll");
if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList());
String exportFile = "导出文件";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
exportFile = "Export file";
}
downLoadFileList(allRelevFileList,fileNowPath + File.separator + exportFile);
}
// 拿取模板
String repFileName = fileName.replaceAll("/","_");
wordOS = new FileOutputStream(fileNowPath + File.separator + repFileName);
if (CosBootUtil.doesObjectExist(templateUrl)) {
InputStream wordTemplate = CosBootUtil.download(templateUrl);
InputStream exceltemplateForDocx4j = CosBootUtil.download(templateUrl);
// com.qcloud.cos.utils.IOUtils.copy(wordTemplate, wordOS);
InputStream excelTemplateForPoi = CosBootUtil.download(templateUrl);
SpreadsheetMLPackage pkg = SpreadsheetMLPackage.load(exceltemplateForDocx4j);
//下载关联文件内容
List<Map<String, Object>> fileListAll = (List<Map<String, Object>>) allParamsInfoList.get(2).get("fileListAll");
if (fileListAll != null && !fileListAll.isEmpty()) {
Map<String,String> paramsAfterFilter = ExcelUtil.filterParams(pkg, params);
if (CollectionUtil.isNotEmpty(paramsAfterFilter)) {
List<String> nioNumberList = paramsAfterFilter.keySet().stream().collect(Collectors.toList());
List<OSSFile> allRelevFileList = new ArrayList<>();
for (Map<String, Object> fileMap : fileListAll) {
for (Map.Entry map : fileMap.entrySet()) {
String key = (String) map.getKey();
List<OSSFile> fileList = (List<OSSFile>) map.getValue();
if (nioNumberList.contains(key)) {
allRelevFileList.addAll(fileList);
}
}
}
if (CollectionUtil.isNotEmpty(allRelevFileList)) {
String exportFile = "导出文件";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
exportFile = "Export file";
}
downLoadFileList(allRelevFileList, fileNowPath + File.separator + exportFile);
}
}
}
// 替换占位符内容
// docx4j方式
InputStream excelTemplate = CosBootUtil.download(templateUrl);
SpreadsheetMLPackage pkg = SpreadsheetMLPackage.load(wordTemplate);
Workbook workbook = WorkbookFactory.create(excelTemplate);
Workbook workbook = WorkbookFactory.create(excelTemplateForPoi);
ExcelUtil.replacePictureBatchPOI(workbook, pkg, imgListAll, params);
ExcelUtil.variableReplace(pkg, params);
pkg.save(wordOS);
@@ -1092,7 +1129,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
Map<String, Object> resultMap = new HashMap<>();
List<Map<String, Object>> imgListAll = new ArrayList<>(); // 存放图片信息
List<OSSFile> fileListAll = new ArrayList<>(); // 存放文件
List<Map<String, Object>> fileListAll = new ArrayList<>(); // 存放文件
String fileTypeStr = ".png,.PNG,.jfif,.JFIF,.pjpeg,.PJPEG,.jpeg,.JPEG,.pjp,.PJP,.jpg,.JPG";
// 查询配置列数据
for (Map<String, Object> record1 : dataList) {
@@ -1125,13 +1162,16 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
fileNameList.add(ossFileList.get(0).getFileName());
fileList.addAll(ossFileList);
Map<String, Object> fileMap = new HashMap<>();
fileMap.put(nioNumber, ossFileList);
fileListAll.add(fileMap);
} else {
imgFileList.addAll(ossFileList);
}
}
}
}
fileListAll.addAll(fileList);
StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据
if ((ControlTypeEnum.FILE.getValue().equals(controlType)
@@ -246,6 +246,39 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
return updateById(paramsInfoEO);
}
public void verifyForAddOrEdit (String paramsNumber, String paramsName, String cut) {
// 编号,参数名称校验
if (StringUtils.isNotBlank(paramsNumber)) {
String numberRegex = "^[A-Za-z0-9-/. ]+$";
if (!paramsNumber.matches(numberRegex)) {
if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("编号只能输入字母,数字,横杠(-),小数点(.),左斜杠,空格");
} else {
throw new JeroBootException("Number enter only letters, numbers, dash (-),dot (.),left slash,spaces");
}
}
if (paramsNumber.length() > Long.parseLong("15")) {
if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("编号不能超过15个字符");
} else {
throw new JeroBootException("Number can not exceed 15 chars");
}
}
}
if (StringUtils.isNotBlank(paramsName)) {
if (paramsName.length() > Long.parseLong("100")) {
if (CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("参数名称不能超过100个字符");
} else {
throw new JeroBootException("Params Name can not exceed 100 chars");
}
}
}
}
/**
* 通过id删除
*
@@ -201,7 +201,7 @@ public class SyncDataServiceImpl implements ISyncDataService{
pageSum += 1;
}
//循环查询统一认证系统所有账户信息(从第二页开始)
for(int page = 1; page < 2; page++){
for(int page = 1; page < pageSum; page++){
path = "/people/v1/employee/all-info";
queryStr = "app_id=" + appId + "&hash_type=sha256&limit=100&offset=" + (page*100);
response = getResultDataOfGet(path, queryStr);
@@ -194,8 +194,21 @@ public class CountryCardManageReleaseEOController extends JeroController<Country
@AutoLog(value = "问题知识库-country_card-管理发布-获取适用市场下拉选")
@ApiOperation(value="问题知识库-country_card-管理发布-获取适用市场下拉选", notes="问题知识库-country_card-管理发布-获取适用市场下拉选")
@GetMapping(value = "/getApplyMarketList")
public Result<List<DictModel>> getApplyMarketList() {
Result<List<DictModel>> result = this.countryCardManageReleaseEOService.getApplyMarketList();
public Result<List<DictModel>> getApplyMarketList(@RequestParam(name = "queryFlag",required=false) String queryFlag) {
Result<List<DictModel>> result = this.countryCardManageReleaseEOService.getApplyMarketList(queryFlag);
return result;
}
/**
* 根据多个适用地区查询数据
*
* @return
*/
@AutoLog(value = "问题知识库-country_card-管理发布表-根据多个适用地区查询数据")
@ApiOperation(value="问题知识库-country_card-管理发布表-根据多个适用地区查询数据", notes="问题知识库-country_card-管理发布表-根据多个适用地区查询数据")
@PostMapping(value = "/queryCountryCardManageReleaseByApplyMarkets")
public Result<List<CountryCardManageReleaseEO>> queryCountryCardManageReleaseByApplyMarkets(@RequestBody JSONObject params) {
List<CountryCardManageReleaseEO> list = countryCardManageReleaseEOService.queryCountryCardManageReleaseByApplyMarkets(params);
return Result.OK(list);
}
}
@@ -0,0 +1,170 @@
package com.jero.modules.problemKnowledgeBase.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.problemKnowledgeBase.entity.CountryNationalFlagEO;
import com.jero.modules.problemKnowledgeBase.service.ICountryNationalFlagEOService;
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-08-09
* @Version: V1.0
*/
@Api(tags="国家与国旗中间表")
@RestController
@RequestMapping("/problemKnowledgeBase/countryNationalFlagEO")
@Slf4j
public class CountryNationalFlagEOController extends JeroController<CountryNationalFlagEO, ICountryNationalFlagEOService> {
@Autowired
private ICountryNationalFlagEOService countryNationalFlagEOService;
/**
* 分页列表查询
*
* @param countryNationalFlagEO
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "国家与国旗中间表-分页列表查询")
@ApiOperation(value="国家与国旗中间表-分页列表查询", notes="国家与国旗中间表-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(CountryNationalFlagEO countryNationalFlagEO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CountryNationalFlagEO> queryWrapper = QueryGenerator.initQueryWrapper(countryNationalFlagEO, req.getParameterMap());
Page<CountryNationalFlagEO> page = new Page<CountryNationalFlagEO>(pageNo, pageSize);
IPage<CountryNationalFlagEO> pageList = countryNationalFlagEOService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "国家与国旗中间表-列表查询")
@ApiOperation(value="国家与国旗中间表-列表查询", notes="国家与国旗中间表-列表查询")
@GetMapping(value = "/list")
public Result<List<CountryNationalFlagEO>> queryList() {
List<CountryNationalFlagEO> list = countryNationalFlagEOService.queryList();
return Result.OK(list);
}
/**
* 添加
*
* @param countryNationalFlagEO
* @return
*/
@AutoLog(value = "国家与国旗中间表-添加")
@ApiOperation(value="国家与国旗中间表-添加", notes="国家与国旗中间表-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody CountryNationalFlagEO countryNationalFlagEO) {
countryNationalFlagEOService.add(countryNationalFlagEO);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param countryNationalFlagEO
* @return
*/
@AutoLog(value = "国家与国旗中间表-编辑")
@ApiOperation(value="国家与国旗中间表-编辑", notes="国家与国旗中间表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody CountryNationalFlagEO countryNationalFlagEO) {
countryNationalFlagEOService.editById(countryNationalFlagEO);
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) {
countryNationalFlagEOService.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.countryNationalFlagEOService.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) {
CountryNationalFlagEO countryNationalFlagEO = countryNationalFlagEOService.queryById(id);
if(countryNationalFlagEO==null) {
return Result.error("未找到对应数据");
}
return Result.OK(countryNationalFlagEO);
}
/**
* 导出excel
*
* @param request
* @param countryNationalFlagEO
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, CountryNationalFlagEO countryNationalFlagEO) {
return super.exportXls(request, countryNationalFlagEO, CountryNationalFlagEO.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, CountryNationalFlagEO.class);
}
}
@@ -1,6 +1,8 @@
package com.jero.modules.problemKnowledgeBase.entity;
import java.io.Serializable;
import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
@@ -70,7 +72,7 @@ public class CountryCardManageReleaseDetailEO implements Serializable {
/**标签名称**/
@TableField(exist = false)
@ApiModelProperty(value = "标签名称")
private java.lang.String countryCardTempIdName;
private java.lang.String lableName;
/**描述*/
@Excel(name = "描述", width = 15)
@@ -89,4 +91,8 @@ public class CountryCardManageReleaseDetailEO implements Serializable {
@TableField(exist = false)
@ApiModelProperty(value = "标签类型")
private String lableType;
/**Country Card模板维护-字典项实体*/
@TableField(exist = false)
private List<CountryCardTempItemEO> countryCardTempItemEOList;
}
@@ -83,4 +83,8 @@ public class CountryCardManageReleaseEO implements Serializable {
@TableField(exist = false)
private List<CountryCardManageReleaseDetailEO> countryCardManageReleaseDetailEOList;
/**国旗**/
@TableField(exist = false)
private java.lang.String countryNationalFlag;
}
@@ -0,0 +1,84 @@
package com.jero.modules.problemKnowledgeBase.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
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-08-09
* @Version: V1.0
*/
@Data
@TableName("country_national_flag")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="country_national_flag对象", description="国家与国旗中间表")
public class CountryNationalFlagEO implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**国家名称*/
@Excel(name = "国家名称中文", width = 15)
@ApiModelProperty(value = "国家名称中文")
private java.lang.String countryNameCn;
/**国家名称*/
@Excel(name = "国家名称英文", width = 15)
@ApiModelProperty(value = "国家名称英文")
private java.lang.String countryNameEn;
/**国旗文件id*/
@Excel(name = "国旗文件id", width = 15)
@ApiModelProperty(value = "国旗文件id")
private java.lang.String nationalFlagId;
/**国旗文件url*/
@Excel(name = "国旗文件url", width = 15)
@ApiModelProperty(value = "国旗文件url")
private java.lang.String nationalFlagUrl;
}
@@ -0,0 +1,17 @@
package com.jero.modules.problemKnowledgeBase.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.jero.modules.problemKnowledgeBase.entity.CountryNationalFlagEO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 国家与国旗中间表
* @Author: jero-boot
* @Date: 2022-08-09
* @Version: V1.0
*/
public interface CountryNationalFlagEOMapper extends BaseMapper<CountryNationalFlagEO> {
}
@@ -0,0 +1,16 @@
<?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.problemKnowledgeBase.mapper.CountryNationalFlagEOMapper">
<resultMap id="CountryNationalFlagEOResultMap" type="com.jero.modules.problemKnowledgeBase.entity.CountryNationalFlagEO">
<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="country_name_cn" property="countryNameCn" />
<result column="country_name_en" property="countryNameEn" />
<result column="national_flag_id" property="nationalFlagId" />
<result column="national_flag_url" property="nationalFlagUrl" />
</resultMap>
</mapper>
@@ -79,5 +79,7 @@ public interface ICountryCardManageReleaseEOService extends IService<CountryCard
* 获取适用市场
* @return
*/
Result<List<DictModel>> getApplyMarketList();
Result<List<DictModel>> getApplyMarketList(String queryFlag);
List<CountryCardManageReleaseEO> queryCountryCardManageReleaseByApplyMarkets(JSONObject params);
}
@@ -0,0 +1,61 @@
package com.jero.modules.problemKnowledgeBase.service;
import com.jero.modules.problemKnowledgeBase.entity.CountryNationalFlagEO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 国家与国旗中间表
* @Author: jero-boot
* @Date: 2022-08-09
* @Version: V1.0
*/
public interface ICountryNationalFlagEOService extends IService<CountryNationalFlagEO> {
/**
* 保存
*
* @param countryNationalFlagEO
* @return
*/
void add(CountryNationalFlagEO countryNationalFlagEO);
/**
* 更新
*
* @param countryNationalFlagEO
* @return
*/
void editById(CountryNationalFlagEO countryNationalFlagEO);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
CountryNationalFlagEO queryById(String id);
/**
* 列表查询
*
* @return
*/
List<CountryNationalFlagEO> queryList();
}
@@ -5,6 +5,7 @@ import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
import com.jero.modules.problemKnowledgeBase.entity.CountryCardTempEO;
import com.jero.modules.problemKnowledgeBase.entity.CountryCardTempItemEO;
import com.jero.modules.problemKnowledgeBase.enums.LableTypeEnum;
import com.jero.modules.problemKnowledgeBase.mapper.CountryCardManageReleaseDetailEOMapper;
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseDetailEOService;
import com.jero.modules.problemKnowledgeBase.service.ICountryCardTempEOService;
@@ -35,6 +36,8 @@ public class CountryCardManageReleaseDetailEOServiceImpl extends ServiceImpl<Cou
@Autowired
private ICountryCardTempEOService countryCardTempEOService;
@Autowired
private ICountryCardTempItemEOService countryCardTempItemEOService;
/**
* 保存
@@ -104,6 +107,7 @@ public class CountryCardManageReleaseDetailEOServiceImpl extends ServiceImpl<Cou
@Override
public List<CountryCardManageReleaseDetailEO> queryList(CountryCardManageReleaseDetailEO countryCardManageReleaseDetailEO, HttpServletRequest req) {
QueryWrapper<CountryCardManageReleaseDetailEO> queryWrapper = QueryGenerator.initQueryWrapper(countryCardManageReleaseDetailEO, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
List<CountryCardManageReleaseDetailEO> result = this.list(queryWrapper);
return result;
}
@@ -114,6 +118,11 @@ public class CountryCardManageReleaseDetailEOServiceImpl extends ServiceImpl<Cou
//获取模板
List<CountryCardTempEO> countryCardTempEOList = this.countryCardTempEOService.list();
List<String> countroCardTempIdList = countryCardTempEOList.stream().map(CountryCardTempEO::getId).distinct().collect(Collectors.toList());
QueryWrapper<CountryCardTempItemEO> tempItemEOQueryWrapper = new QueryWrapper<>();
tempItemEOQueryWrapper.lambda().in(CountryCardTempItemEO::getCountryCardTempId,countroCardTempIdList);
List<CountryCardTempItemEO> countryCardTempItemEOList = this.countryCardTempItemEOService.list(tempItemEOQueryWrapper);
datas.forEach(data -> {
List<CountryCardTempEO> countryCardTemp = countryCardTempEOList.stream().filter(countryCardTempEO -> {
boolean flag = false;
@@ -122,9 +131,24 @@ public class CountryCardManageReleaseDetailEOServiceImpl extends ServiceImpl<Cou
}
return flag;
}).collect(Collectors.toList());
data.setCountryCardTempIdName(countryCardTemp.get(0).getLableName());
if(CollectionUtils.isNotEmpty(countryCardTemp)){
data.setLableName(countryCardTemp.get(0).getLableName());
data.setLableType(countryCardTemp.get(0).getLableType());
}
data.setLableType(countryCardTemp.get(0).getLableType());
//如果该条数据的标签类型是下拉选项
if(CollectionUtils.isNotEmpty(countryCardTempItemEOList) && StringUtils.equals(data.getLableType(), LableTypeEnum.PULL_SINGLE.getValue())){
//把这条模板的下拉选项设置进去
List<CountryCardTempItemEO> collect = countryCardTempItemEOList.stream().filter(countryCardTempItemEO -> {
boolean flag = false;
if (StringUtils.equals(data.getCountryCardTempId(), countryCardTempItemEO.getCountryCardTempId())) {
flag = true;
}
return flag;
}).collect(Collectors.toList());
data.setCountryCardTempItemEOList(collect);
}
});
}
@@ -6,10 +6,12 @@ import com.jero.common.api.vo.Result;
import com.jero.common.system.vo.DictModel;
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseDetailEO;
import com.jero.modules.problemKnowledgeBase.entity.CountryCardManageReleaseEO;
import com.jero.modules.problemKnowledgeBase.entity.CountryNationalFlagEO;
import com.jero.modules.problemKnowledgeBase.enums.ReleaseStatusEnum;
import com.jero.modules.problemKnowledgeBase.mapper.CountryCardManageReleaseEOMapper;
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseDetailEOService;
import com.jero.modules.problemKnowledgeBase.service.ICountryCardManageReleaseEOService;
import com.jero.modules.problemKnowledgeBase.service.ICountryNationalFlagEOService;
import com.jero.modules.system.enums.DicCodeEnum;
import com.jero.modules.system.service.ISysDictService;
import org.apache.commons.collections4.CollectionUtils;
@@ -41,6 +43,8 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
private ICountryCardManageReleaseDetailEOService countryCardManageReleaseDetailEOService;
@Autowired
private ISysDictService sysDictService;
@Autowired
private ICountryNationalFlagEOService countryNationalFlagEOService;
/**
* 保存
@@ -132,6 +136,12 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
QueryWrapper<CountryCardManageReleaseDetailEO> releaseDetailEOQueryWrapper = new QueryWrapper<>();
releaseDetailEOQueryWrapper.lambda().in(CountryCardManageReleaseDetailEO::getCountryCardManageReleaseId,CountryCardManageReleaseEOId);
List<CountryCardManageReleaseDetailEO> releaseDetailEOList = this.countryCardManageReleaseDetailEOService.list(releaseDetailEOQueryWrapper);
this.countryCardManageReleaseDetailEOService.disposeData(releaseDetailEOList,cut);
List<DictModel> dictModelList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
//获取国旗
List<CountryNationalFlagEO> countryNationalFlagList = countryNationalFlagEOService.list();
datas.forEach(data -> {
if (StringUtils.isNotEmpty(data.getReleaseStatus())) {
@@ -148,6 +158,27 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
}).collect(Collectors.toList());
data.setCountryCardManageReleaseDetailEOList(collect);
}
List<DictModel> regionList = dictModelList.stream().filter(region -> {
boolean flag = false;
if (StringUtils.equals(region.getValue(), data.getApplyMarket())) {
flag = true;
}
return flag;
}).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(regionList)){
DictModel dictModel = regionList.get(0);
String collect = countryNationalFlagList.stream().filter(nationalFlag -> {
boolean flag = false;
if(StringUtils.equals(nationalFlag.getCountryNameCn(),dictModel.getText())){
flag = true;
}
return flag;
}).map(CountryNationalFlagEO::getNationalFlagUrl).collect(Collectors.joining(","));
data.setCountryNationalFlag(collect);
}
});
}
}
@@ -168,7 +199,7 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
}
@Override
public Result<List<DictModel>> getApplyMarketList() {
public Result<List<DictModel>> getApplyMarketList(String queryFlag) {
List<DictModel> result = new ArrayList<>();
//获取所有的适用地区
@@ -176,24 +207,59 @@ public class CountryCardManageReleaseEOServiceImpl extends ServiceImpl<CountryCa
//获取已经创建了country Card的适用地区该接口只返回在country Card里面没有的适用地区
List<CountryCardManageReleaseEO> countryCardManageReleaseEOList = this.list();
if(CollectionUtils.isEmpty(countryCardManageReleaseEOList)){
result = dictModelList;
}else {
for (DictModel dictModel : dictModelList) {
boolean flag = true;
for (CountryCardManageReleaseEO countryCardManageReleaseEO : countryCardManageReleaseEOList) {
if(StringUtils.equals(dictModel.getValue(),countryCardManageReleaseEO.getApplyMarket())){
flag = false;
break;
//如果查询标识是空则是在countryCard管理发布页面新增数据时使用管理发布页新增查询的是所有未创建countryCard的适用市场
//如果查询标识不是空则是在CountryCard的首页使用首页查询的是 所有已创建了countryCard的适用市场
if (StringUtils.isEmpty(queryFlag)) {
if(CollectionUtils.isEmpty(countryCardManageReleaseEOList)){
result = dictModelList;
}else {
for (DictModel dictModel : dictModelList) {
boolean flag = true;
for (CountryCardManageReleaseEO countryCardManageReleaseEO : countryCardManageReleaseEOList) {
if(StringUtils.equals(dictModel.getValue(),countryCardManageReleaseEO.getApplyMarket())){
flag = false;
break;
}
}
if(flag){
result.add(dictModel);
}
}
}
}else {
if(CollectionUtils.isEmpty(countryCardManageReleaseEOList)){
result = null;
}else {
for (DictModel dictModel : dictModelList) {
boolean flag = false;
for (CountryCardManageReleaseEO countryCardManageReleaseEO : countryCardManageReleaseEOList) {
if(StringUtils.equals(dictModel.getValue(),countryCardManageReleaseEO.getApplyMarket())){
flag = true;
break;
}
}
if(flag){
result.add(dictModel);
if(flag){
result.add(dictModel);
}
}
}
}
return Result.OK(result);
}
@Override
public List<CountryCardManageReleaseEO> queryCountryCardManageReleaseByApplyMarkets(JSONObject params) {
String applyMarkets = params.getString("applyMarkets");
String cut = params.getString("cut");
List<String> applyMarketList = Arrays.asList(applyMarkets.split(","));
QueryWrapper<CountryCardManageReleaseEO> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().in(CountryCardManageReleaseEO::getApplyMarket,applyMarketList);
List<CountryCardManageReleaseEO> result = this.list(queryWrapper);
this.disposeData(result,cut);
return result;
}
}
@@ -0,0 +1,89 @@
package com.jero.modules.problemKnowledgeBase.service.impl;
import com.jero.modules.problemKnowledgeBase.entity.CountryNationalFlagEO;
import com.jero.modules.problemKnowledgeBase.mapper.CountryNationalFlagEOMapper;
import com.jero.modules.problemKnowledgeBase.service.ICountryNationalFlagEOService;
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-08-09
* @Version: V1.0
*/
@Service
public class CountryNationalFlagEOServiceImpl extends ServiceImpl<CountryNationalFlagEOMapper, CountryNationalFlagEO> implements ICountryNationalFlagEOService {
/**
* 保存
*
* @param countryNationalFlagEO
* @return
*/
@Override
public void add(CountryNationalFlagEO countryNationalFlagEO) {
Date now = new Date();
countryNationalFlagEO.setCreateTime(now);
countryNationalFlagEO.setUpdateTime(now);
save(countryNationalFlagEO);
}
/**
* 更新
*
* @param countryNationalFlagEO
* @return
*/
@Override
public void editById(CountryNationalFlagEO countryNationalFlagEO) {
Date now = new Date();
countryNationalFlagEO.setUpdateTime(now);
saveOrUpdate(countryNationalFlagEO);
}
/**
* 通过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 CountryNationalFlagEO queryById(String id) {
return getById(id);
}
/**
* 列表查询
*
* @return
*/
@Override
public List<CountryNationalFlagEO> queryList() {
return list();
}
}
@@ -1,5 +1,6 @@
package com.jero.modules.project.util;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
@@ -40,6 +41,7 @@ import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@Slf4j
public class ExcelUtil {
@@ -70,6 +72,33 @@ public class ExcelUtil {
System.out.println("mmmmmmm");
}
/**
* 过滤出需要导出的
* @param pkg
* @param params
* @return
* @throws Exception
*/
public static Map<String, String> filterParams(SpreadsheetMLPackage pkg, Map<String, String> params) throws Exception {
JaxbSmlPart smlPart = (JaxbSmlPart)pkg.getParts().get(new PartName("/xl/sharedStrings.xml")); // 获取所有sheet中的文本
String wmlTemplateString = getWmlTemplateString(smlPart);
List<String> placeholderList = new ArrayList<>();
getAllPlaceholderElementFromObject(wmlTemplateString, 0, placeholderList); // 获取文档中所有占位符
Map<String, String> paramsAfterFilter = new HashMap<>();
List<String> textValueList = placeholderList.stream().distinct().collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(textValueList)) {
for (Map.Entry<String, String> map : params.entrySet()) {
String value = "${" + map.getKey() + "}";
if (textValueList.contains(value)) {
paramsAfterFilter.put(map.getKey(), map.getValue());
}
}
}
return paramsAfterFilter;
}
public static void setRowHeight(WorksheetPart worksheetPart, int rIndex, double height, int cIndex, String text) {
SheetData sheetData = worksheetPart.getJaxbElement().getSheetData();
@@ -370,8 +399,8 @@ public class ExcelUtil {
// This seems to be about 5% faster than the Scanner approach
wmlTemplateString = IOUtils.toString(is, "UTF-8");
List<String> placeholderList = new ArrayList<>();
getAllPlaceholderElementFromObject(wmlTemplateString, 0, placeholderList);
// List<String> placeholderList = new ArrayList<>();
// getAllPlaceholderElementFromObject(wmlTemplateString, 0, placeholderList);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
@@ -381,18 +410,18 @@ public class ExcelUtil {
}
}
private static List<String> getAllPlaceholderElementFromObject(String wmlTemplateString, int offset, List<String> placeholderList) {
private static void getAllPlaceholderElementFromObject(String wmlTemplateString, int offset, List<String> placeholderList) {
int startKey = wmlTemplateString.indexOf("${", offset);
if (startKey == -1)
return null;
return;
else {
int keyEnd = wmlTemplateString.indexOf('}', startKey);
String placeHolder = wmlTemplateString.substring(startKey, keyEnd + 1);
if (isPlaceholder(placeHolder)) {
placeholderList.add(placeHolder);
}
return getAllPlaceholderElementFromObject(wmlTemplateString, keyEnd + 1, placeholderList);
getAllPlaceholderElementFromObject(wmlTemplateString, keyEnd + 1, placeholderList);
}
}
@@ -1,5 +1,6 @@
package com.jero.modules.project.util;
import cn.hutool.core.collection.CollectionUtil;
import org.docx4j.Docx4J;
import org.docx4j.TraversalUtil;
import org.docx4j.XmlUtils;
@@ -28,6 +29,7 @@ import java.io.OutputStream;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class WordUtil {
private static final Logger log = LoggerFactory.getLogger(WordUtil.class);
@@ -230,6 +232,34 @@ public class WordUtil {
}
/**
* 过滤出需要导出的
* @param wordMLPackage
* @param params
* @return
* @throws Exception
*/
public static Map<String, String> filterParams(WordprocessingMLPackage wordMLPackage, Map<String, String> params) throws Exception {
MainDocumentPart mainDocumentPart = wordMLPackage.getMainDocumentPart();
Docx4jUtils.cleanDocumentPart(mainDocumentPart);
Document wmlDoc = (Document)mainDocumentPart.getJaxbElement();
Body body = wmlDoc.getBody();
List<Text> textList = getAllPlaceholderElementFromObject(body); // 获取文档中所有占位符
Map<String, String> paramsAfterFilter = new HashMap<>();
List<String> textValueList = textList.stream().map(Text::getValue).distinct().collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(textValueList)) {
for (Map.Entry<String, String> map : params.entrySet()) {
String value = "${" + map.getKey() + "}";
if (textValueList.contains(value)) {
paramsAfterFilter.put(map.getKey(), map.getValue());
}
}
}
return paramsAfterFilter;
}
/**
* 发现docx文档包含占位符的文本节点
* 未解决问题两个连着的相同占位符会识别成一个 原文${key1}${key1}
@@ -546,10 +546,12 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}else{
content = "Content";
}
String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "") + "";
//单独设置每页右侧的时间
WordUtil.exportWordMonth(document, lawsMonthlyReportWriteEOS.get(0).getMonth(), null, ParagraphAlignment.RIGHT, 0, 12, false, true, "微软雅黑");
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 12, false, true, "Microsoft YaHei UI");
WordUtil.exportWord(document, content, null, ParagraphAlignment.LEFT, 0, 12, false, true, "Microsoft YaHei UI");
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18, false, false, "Blue Sky Noto Regular");
WordUtil.exportWord(document, content, null, ParagraphAlignment.LEFT, 0, 12, false, true, "Blue Sky Noto Regular");
//生成页脚
WordUtil.exportHeardAndFootMain(document,moth);
int oneCount = 1;
for (LawsMonthlyReportTitleTemplateEO lawsMonthlyReportTitleTemplateEO : reportTitleOneList) {
@@ -563,7 +565,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
oneTitle = lawsMonthlyReportTitleTemplateEO.getTitleEn();
}
if(StringUtils.isNotBlank(oneTitle)){
WordUtil.exportWord(document, oneNumber+" "+oneTitle, null, ParagraphAlignment.LEFT, 0, 12, false, true, "Microsoft YaHei UI");
WordUtil.exportWord(document, oneNumber+" "+oneTitle, null, ParagraphAlignment.LEFT, 0, 12, false, true, "Blue Sky Noto Regular");
oneCount++;
}
@@ -585,7 +587,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
twoTitle = monthlyReportTitleTemplateEO.getTitleEn();
}
if(StringUtils.isNotBlank(twoTitle)){
WordUtil.exportWord(document, twoNumber+" "+twoTitle, null, ParagraphAlignment.LEFT, 2, 12, false, true, "Microsoft YaHei UI");
WordUtil.exportWord(document, twoNumber+" "+twoTitle, null, ParagraphAlignment.LEFT, 2, 12, false, true, "Blue Sky Noto Regular");
twoCount++;
}
@@ -598,7 +600,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
reportTitle = lawsMonthlyReportWriteEO.getTitleEn();
}
if(org.apache.commons.lang3.StringUtils.isNotBlank(reportTitle)){
WordUtil.exportWord(document, reportCount+". "+reportTitle, null, ParagraphAlignment.LEFT, 6, 10, false, false, "Microsoft YaHei UI");
WordUtil.exportWord(document, reportCount+". "+reportTitle, null, ParagraphAlignment.LEFT, 6, 12, false, false, "Blue Sky Noto Regular");
reportCount++;
}
}
@@ -616,16 +618,11 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
//树形数据字典
List<SysCategory> categoryList = sysCategoryService.list();
String content = "";
if(CutEnum.CN.getValue().equals(cut)){
content = "主要内容";
}else{
content = "Content";
}
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 12, false, true, "Microsoft YaHei UI");
//单独设置每页右侧的时间
WordUtil.exportWordMonth(document, lawsMonthlyReportWriteEOS.get(0).getMonth(), null, ParagraphAlignment.RIGHT, 0, 12, false, true, "Microsoft YaHei UI");
// WordUtil.exportWord(document, content, null, ParagraphAlignment.LEFT, 0, 12, false, true, "Microsoft YaHei UI");
String moth = lawsMonthlyReportWriteEOS.get(0).getMonth().replaceAll("-", "") + "";
//生成页眉页脚
WordUtil.exportHeardAndFoot(document,moth);
//生成标题
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 18, false, true, "Blue Sky Noto Regular");
int oneCount = 1;
for (LawsMonthlyReportTitleTemplateEO lawsMonthlyReportTitleTemplateEO : reportTitleOneList) {
@@ -639,7 +636,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
oneTitle = lawsMonthlyReportTitleTemplateEO.getTitleEn();
}
if(StringUtils.isNotBlank(oneTitle)){
WordUtil.exportWord(document, oneNumber+" "+oneTitle, null, ParagraphAlignment.LEFT, 0, 12, false, true, "Microsoft YaHei UI");
WordUtil.exportWord(document, oneNumber+" "+oneTitle, null, ParagraphAlignment.LEFT, 0, 14, false, true, "Blue Sky Noto Regular");
oneCount++;
}
@@ -661,7 +658,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
twoTitle = monthlyReportTitleTemplateEO.getTitleEn();
}
if(StringUtils.isNotBlank(twoTitle)){
WordUtil.exportWord(document, twoNumber+" "+twoTitle, null, ParagraphAlignment.LEFT, 2, 12, false, true, "Microsoft YaHei UI");
WordUtil.exportWord(document, twoNumber+" "+twoTitle, null, ParagraphAlignment.LEFT, 2, 12, false, true, "Blue Sky Noto Regular");
twoCount++;
}
//二级目录下放--->新征求意见清单模板, 新发布标准清单模板
@@ -686,7 +683,7 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
reportTitle = lawsMonthlyReportWriteEO.getTitleEn();
}
if(StringUtils.isNotBlank(reportTitle)){
WordUtil.exportWord(document, reportCount+". "+reportTitle, null, ParagraphAlignment.LEFT, 6, 10, false, false, "Microsoft YaHei UI");
WordUtil.exportWord(document, reportCount+". "+reportTitle, null, ParagraphAlignment.LEFT, 6, 11, false, false, "Blue Sky Noto Regular");
}
@@ -8,20 +8,35 @@ import com.jero.modules.report.entity.NewStandardTemplateEO;
import com.jero.modules.report.enums.DictCodeReportEnum;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysDictItem;
import lombok.SneakyThrows;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.poi.util.Units;
import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFFooter;
import org.apache.poi.xwpf.usermodel.XWPFHeader;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFPicture;
import org.apache.poi.xwpf.usermodel.XWPFPictureData;
import org.apache.poi.xwpf.usermodel.XWPFRun;
import org.apache.poi.xwpf.usermodel.XWPFTable;
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import org.apache.xmlbeans.impl.xb.xmlschema.SpaceAttribute;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFldChar;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTJc;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPageMar;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblWidth;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STFldCharType;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STJc;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTblWidth;
import java.io.FileInputStream;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
@@ -103,6 +118,154 @@ public class WordUtil {
}
}
// @SneakyThrows
// public static void exportHeardAndFoot(XWPFDocument document){
//// XWPFDocument document = new XWPFDocument();
//
// // create header-footer
// XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
// if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy();
//
// // create header start
// XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
//
// XWPFParagraph paragraph = header.createParagraph();
// paragraph.setAlignment(ParagraphAlignment.CENTER);
//
// XWPFRun run = paragraph.createRun();
// run.setText("Header");
//
// // create footer start
// XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT);
//
// paragraph = footer.createParagraph();
// paragraph.setAlignment(ParagraphAlignment.CENTER);
//
// run = paragraph.createRun();
// run.setText("Footer");
//
// CTSectPr sectPr = document.getDocument().getBody().getSectPr();
// if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
// CTPageMar pageMar = sectPr.getPgMar();
// if (pageMar == null) pageMar = sectPr.addNewPgMar();
// pageMar.setLeft(BigInteger.valueOf(2000)); //720 TWentieths of an Inch Point (Twips) = 720/20 = 36 pt = 36/72 = 0.5"
// pageMar.setRight(BigInteger.valueOf(720));
// pageMar.setTop(BigInteger.valueOf(1440)); //1440 Twips = 1440/20 = 72 pt = 72/72 = 1"
// pageMar.setBottom(BigInteger.valueOf(1440));
//
// pageMar.setHeader(BigInteger.valueOf(2000)); //45.4 pt * 20 = 908 = 45.4 pt header from top
// pageMar.setFooter(BigInteger.valueOf(568)); //28.4 pt * 20 = 568 = 28.4 pt footer from bottom
//
// }
@SneakyThrows
public static void exportHeardAndFoot(XWPFDocument document,String month){
XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy();
XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
// String logoFilePath = "/jero-boot/home/weilai.png";
String logoFilePath = WordUtil.class.getClassLoader().getResource("static/home/weilai.png").getPath();
//页眉第一个段落展示logo-----------------------------------------------------------------------------------
if (org.apache.commons.lang3.StringUtils.isNotBlank(logoFilePath)) {
XWPFParagraph logo = header.createParagraph();
logo.setAlignment(ParagraphAlignment.LEFT);
XWPFRun run = logo.createRun();
String imgFile = logoFilePath;
InputStream is = new FileInputStream(imgFile);
XWPFPicture picture = run.addPicture(is, XWPFDocument.PICTURE_TYPE_PNG, imgFile, Units.toEMU(95), Units.toEMU(35));
String blipID = "";
for(XWPFPictureData picturedata : header.getAllPackagePictures()) { //这段必须有不然打开的logo图片不显示
blipID = header.getRelationId(picturedata);
}
picture.getCTPicture().getBlipFill().getBlip().setEmbed(blipID);
run.addTab();
is.close();
}
//页眉第二个段落展示日期------------------------------------------------------------
XWPFParagraph paragraph = header.createParagraph();//创建新的段落
paragraph.setAlignment(ParagraphAlignment.RIGHT);//段落文本的对齐方式
XWPFRun run = paragraph.createRun();
run.setText(month);
//页脚(三个段落分别展示3个内容)-----------------------------------------------------
XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT);
paragraph = footer.createParagraph();
paragraph.setAlignment(ParagraphAlignment.CENTER);
run = paragraph.createRun();
run.setText("NIO Internal");
paragraph = footer.createParagraph();
paragraph.setAlignment(ParagraphAlignment.LEFT);
run = paragraph.createRun();
run.setText("NIO.com");
//生成页码---------------------------------------------------------------------
paragraph = footer.createParagraph();
paragraph.setAlignment(ParagraphAlignment.RIGHT);
run = paragraph.createRun();
CTFldChar fldChar = run.getCTR().addNewFldChar();
fldChar.setFldCharType(STFldCharType.Enum.forString("begin"));
run = paragraph.createRun();
CTText ctText = run.getCTR().addNewInstrText();
ctText.setStringValue("PAGE \\* MERGEFORMAT");
ctText.setSpace(SpaceAttribute.Space.Enum.forString("preserve"));
fldChar = run.getCTR().addNewFldChar();
fldChar.setFldCharType(STFldCharType.Enum.forString("end"));
//----------------------------------------------------------------------------
CTSectPr sectPr = document.getDocument().getBody().getSectPr();
if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
CTPageMar pageMar = sectPr.getPgMar();
if (pageMar == null) pageMar = sectPr.addNewPgMar();
pageMar.setLeft(BigInteger.valueOf(1000)); //左边距
pageMar.setRight(BigInteger.valueOf(1000));//右边距
pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度
pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度
pageMar.setHeader(BigInteger.valueOf(500)); //页眉上边框到顶部的距离
pageMar.setFooter(BigInteger.valueOf(800)); //页脚下边框到底部的距离
}
/**
* 主页面(只有页脚)
* @param document
* @param month
*/
@SneakyThrows
public static void exportHeardAndFootMain(XWPFDocument document,String month){
XWPFHeaderFooterPolicy headerFooterPolicy = document.getHeaderFooterPolicy();
if (headerFooterPolicy == null) headerFooterPolicy = document.createHeaderFooterPolicy();
// XWPFHeader header = headerFooterPolicy.createHeader(XWPFHeaderFooterPolicy.DEFAULT);
// XWPFParagraph paragraph = header.createParagraph();//创建新的段落
// XWPFRun run = paragraph.createRun();
XWPFFooter footer = headerFooterPolicy.createFooter(XWPFHeaderFooterPolicy.DEFAULT);
XWPFParagraph paragraph = footer.createParagraph();
paragraph.setAlignment(ParagraphAlignment.CENTER);
XWPFRun run = paragraph.createRun();
run.setText("NIO Internal");
CTSectPr sectPr = document.getDocument().getBody().getSectPr();
if (sectPr == null) sectPr = document.getDocument().getBody().addNewSectPr();
CTPageMar pageMar = sectPr.getPgMar();
if (pageMar == null) pageMar = sectPr.addNewPgMar();
pageMar.setLeft(BigInteger.valueOf(1000)); //左边距
pageMar.setRight(BigInteger.valueOf(1000));//右边距
pageMar.setTop(BigInteger.valueOf(1440)); //页眉高度
pageMar.setBottom(BigInteger.valueOf(1440));//页脚高度
pageMar.setHeader(BigInteger.valueOf(500)); //页眉上边框到顶部的距离
pageMar.setFooter(BigInteger.valueOf(1200)); //页脚下边框到底部的距离
}
/**
* 导出工具示例
*
@@ -126,27 +289,6 @@ public class WordUtil {
Boolean isBold,
String fontFamily) {
// CTSectPr sectPr = document.getDocument().getBody().addNewSectPr();
// XWPFHeaderFooterPolicy policy = new XWPFHeaderFooterPolicy(document, sectPr);
//
// //添加页眉
// CTP ctpHeader = CTP.Factory.newInstance();
// CTR ctrHeader = ctpHeader.addNewR();
// CTText ctHeader = ctrHeader.addNewT();
// String headerText = "Java POI create MS word file.";
// ctHeader.setStringValue(headerText);
// XWPFParagraph headerParagraph = new XWPFParagraph(ctpHeader, document);
// //设置为右对齐
// headerParagraph.setAlignment(ParagraphAlignment.RIGHT);
// XWPFParagraph[] parsHeader = new XWPFParagraph[1];
// parsHeader[0] = headerParagraph;
// try {
// policy.createHeader(XWPFHeaderFooterPolicy.DEFAULT, parsHeader);
// } catch (IOException e) {
// e.printStackTrace();
// }
//添加标题
XWPFParagraph titleParagraph = document.createParagraph();
//设置段落左对齐
@@ -519,6 +661,7 @@ public class WordUtil {
}
private static void setCell(XWPFTableRow tableRow, String fieldName,String technologyTerritory) {
tableRow.setHeight(500);
CTTblWidth ctTblWidth0 = tableRow.getCell(0).getCTTc().addNewTcPr().addNewTcW();
ctTblWidth0.setType(STTblWidth.DXA);
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

+2
View File
@@ -1253,4 +1253,6 @@ module.exports = {
attachmentUpload:'file',
textInput:'Text Input',
deleteNode:'If any file information exists, it will be deleted',
HaveReleased:'Have released',
forward:'Forward',
}
+2
View File
@@ -1356,4 +1356,6 @@ module.exports = {
Parabatch: '参数批次',
freeze:'请选择冻结配置',
deleteNode:'若有文件信息将同步删除',
HaveReleased:'已发布',
forward:'转发',
}
@@ -0,0 +1,188 @@
<template>
<div>
<a-drawer
:title="title"
:maskClosable="false"
:width="600"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :spinning="confirmLoading">
<a-input-search style="margin-bottom: 8px" v-model="searchModel"
@search="onSearch"
allowClear
:placeholder="$t('NodeQuickLookup')"/>
<div class="drawer-content">
<a-tree
v-if="visibleTree"
style="margin-bottom: 60px;height: 600px"
checkable
:autoExpandParent="false"
:tree-data="gData"
@select="onSelect"
@check="checkChange"
@expand="onExpand"
:defaultExpandedKeys="defaultExpandedKeys"
>
</a-tree>
</div>
</a-spin>
<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="submitLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
import eventBUs from '../../common/event'
export default {
name: 'index',
props: {
url: {
type: Object,
default: {}
},
title:{
type: String,
default:''
},
},
data() {
return {
gData: [],
searchModel: '',
autoExpandParent: true,
expandedKeys: [],
visible: false,
confirmLoading: false,
selectedKey: [],
tableKey: [],
userIds: [],
departId: '',
defaultExpandedKeys: [],
submitLoading: false,
visibleTree: false
}
},
mounted() {
},
methods: {
getPush() {
this.searchModel = ''
this.visible = true
this.visibleTree = false
this.$nextTick(() => {
this.departId = ''
this.queryDepartUserTreeList()
})
},
onSelect(selectedKeys) {
this.selectedKey = selectedKeys
},
onExpand(selectedKeys, val) {
if (this.searchModel == '' || !this.searchModel) {
if (val.expanded) {
if (this.departId == val.node.value) {
} else {
this.departId = val.node.value
this.queryDepartUserTreeList()
}
}
}
},
handleCancel() {
this.visible = false
this.visibleTree = false
},
handleSubmit() {
this.$emit('SelectedByForm',this.userIds.join(','))
},
onSearch(e) {
this.gData = []
this.departId = ''
this.visibleTree = false
if (e) {
this.getUserAndDepart()
} else {
this.queryDepartUserTreeList()
}
},
getUserAndDepart() {
getAction('sys/user/getUserAndDepart', { name: this.searchModel }).then((res) => {
this.gData = res || []
this.visibleTree = true
})
},
queryDepartUserTreeList() {
let gData = JSON.parse(JSON.stringify(this.gData))
if (gData && gData.length > 0) {
gData = JSON.stringify(gData)
} else {
gData = ''
}
this.confirmLoading = true
postAction('sys/user/queryDepartUserTreeList', {
departId: this.departId,
json: gData
}).then((res) => {
this.confirmLoading = false
if (res.success) {
this.gData = res.result
this.defaultExpandedKeys = [this.departId]
this.visibleTree = true
} else {
this.gData = []
}
})
},
checkChange(e) {
this.userIds = e
}
}
}
</script>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.button-box {
margin-left: 10px;
height: 38px;
line-height: 38px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
z-index:100;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.drawer-content {
height: calc(100% - 60px);
overflow: auto;
}
</style>
@@ -8,8 +8,17 @@
<div class="title-text" :title="$t('applicableMarket')">
<span>{{$t('applicableMarket')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('applicableMarket')"
v-model="queryParam.applicableMarket"></a-input>
<a-select :placeholder="$t('PleaseSelect')+$t('applicableMarket')"
:disabled="false"
v-model="queryParam.applyMarket">
<a-select-option v-for="(item, key) in applyMarketList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.title ">
{{ item.title}}
</span>
</a-select-option>
</a-select>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
@@ -89,15 +98,25 @@
return {
queryParam: {},
conList: [],
applyMarketList: [],
pageSize: 10,
total: 0,
pageNo: 1
}
},
mounted() {
this.getApplyMarketList()
},
methods: {
getApplyMarketList() {
getAction('/problemKnowledgeBase/countryCardManageReleaseEO/getApplyMarketList', { queryFlag: 'countryCard' }).then((res) => {
if (res.success) {
this.applyMarketList = res.result || []
} else {
this.applyMarketList = []
}
})
},
searchQuery() {
},
@@ -19,8 +19,10 @@
<div class="title-text" :title="$t('applicableMarket')">
<span>{{$t('applicableMarket')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('applicableMarket')"
v-model="queryParam.applicableMarket"></a-input>
<j-dict-select-tag class="box-input" v-model="queryParam.applyMarket"
:placeholder="$t('PleaseSelect')+$t('applicableMarket')"
:type="'select'"
:triggerChange="false" :dictCode="'region'"/>
</div>
</a-col>
<a-col :md="6" :sm="8">
@@ -28,8 +30,18 @@
<div class="title-text" :title="$t('releaseStatus')">
<span>{{$t('releaseStatus')}}</span>
</div>
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('releaseStatus')"
v-model="queryParam.releaseStatus"></a-input>
<a-select class="box-input"
:placeholder="$t('PleaseSelect')+$t('releaseStatus')"
style="width: 100%"
v-model="queryParam.releaseStatus">
<a-select-option v-for="(item, key) in releaseStatusList"
:key="key"
:value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.name ">
{{ item.name}}
</span>
</a-select-option>
</a-select>
</div>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
@@ -74,8 +86,10 @@
{{!record.releaseStatus || record.releaseStatus == 'Draft' ? $t('release') :$t('withdraw')}}
</a>
<a class="text-operation"
v-if="record.createBy == userInfoQuery.username && record.releaseStatus == 'Draft'"
@click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation"
v-if="record.createBy == userInfoQuery.username && record.releaseStatus == 'Draft'"
@click="deleteData(record)">{{$t('delete')}}</a>
</span>
</a-table>
@@ -104,6 +118,7 @@
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import countryCardReleaseModel from './countryCardReleaseModel'
import countryCardReleaseAdd from './countryCardReleaseAdd'
import { mapGetters } from 'vuex'
export default {
name: 'countryCardRelease',
@@ -114,8 +129,19 @@
data() {
return {
queryParam: {},
releaseStatusList: [
{
value: 'Draft',
name: this.$t('draft')
},
{
value: 'Have released',
name: this.$t('HaveReleased')
}
],
loading: false,
dataSource: [{}],
dataSource: [],
selectedRowKeysRecord: [],
total: 0,
pageSize: 10,
pageNo: 1,
@@ -123,12 +149,13 @@
list: '/problemKnowledgeBase/countryCardManageReleaseEO/page',
deleteBatch: '/problemKnowledgeBase/countryCardManageReleaseEO/deleteBatch'
},
userInfoQuery: {},
selectedRowKeys: [],
columns: [
{
title: this.$t('applicableMarket'),
align: 'center',
dataIndex: 'applyMarket',
dataIndex: 'applyMarket_dictText',
ellipsis: true
},
{
@@ -150,8 +177,10 @@
mounted() {
document.title = 'Country Card-' + this.$t('managePublishing')
this.getList()
this.userInfoQuery = this.userInfo()
},
methods: {
...mapGetters(['userInfo']),
searchQuery() {
this.pageNo = 1
this.getList()
@@ -197,8 +226,9 @@
}
})
},
onSelectChange(value) {
onSelectChange(value, record) {
this.selectedRowKeys = value
this.selectedRowKeysRecord = record
},
newlyAddedClick() {
this.$refs.countryCardReleaseAddRef.add()
@@ -212,16 +242,27 @@
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
getAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(res.message)
let idList = []
let selectedRowKeysRecord = JSON.parse(JSON.stringify(_this.selectedRowKeysRecord))
for (let i = 0; i < selectedRowKeysRecord.length; i++) {
if (selectedRowKeysRecord[i].createBy == _this.userInfo().username &&
selectedRowKeysRecord[i].releaseStatus == 'Draft') {
idList.push(selectedRowKeysRecord[i].id)
}
})
}
if (idList.length > 0) {
deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.getList()
} else {
_this.$message.warning(res.message)
}
})
} else {
_this.$message.warning(_this.$t('doNotHavePermissionDeleteData'))
}
}
})
} else {
@@ -10,7 +10,7 @@
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-row :gutter="24" v-if="title == $t('newlyAdded')">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
@@ -20,6 +20,7 @@
</div>
<a-form-model-item class="itemModel" prop="applyMarket">
<a-select :placeholder="$t('PleaseSelect')+$t('applicableMarket')"
:disabled="false"
v-model="formInline.applyMarket">
<a-select-option v-for="(item, key) in applyMarketList"
:key="key"
@@ -33,6 +34,23 @@
</div>
</a-col>
</a-row>
<a-row :gutter="24" v-if="title == $t('edit')">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text"
:title="$t('applicableMarket')">{{$t('applicableMarket')}}</span>
</div>
<a-form-model-item class="itemModel">
<j-dict-select-tag class="box-input" v-model="formInline.applyMarket"
:disabled="true"
:placeholder="$t('PleaseSelect')+$t('applicableMarket')"
:type="'select'"
:triggerChange="false" :dictCode="'region'"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
<div style="margin-bottom: 60px">
<a-table
@@ -143,15 +161,23 @@
methods: {
add() {
this.visible = true
this.$nextTick(() => {
this.formInline = {}
this.$refs.ruleForm.clearValidate()
})
this.title = this.$t('newlyAdded')
this.replacePage()
this.getApplyMarketList()
},
edit(row) {
this.visible = true
this.$nextTick(() => {
this.formInline = row
this.formInline = { ...this.formInline }
this.$refs.ruleForm.clearValidate()
})
this.title = this.$t('edit')
this.editReplacePage(row)
this.getApplyMarketList()
},
getApplyMarketList() {
getAction('/problemKnowledgeBase/countryCardManageReleaseEO/getApplyMarketList', {}).then((res) => {
@@ -194,20 +220,29 @@
this.$refs.ruleForm.validate(valid => {
if (valid) {
let url = ''
let content = []
if (this.title == this.$t('newlyAdded')) {
url = this.url.add
this.dataList.forEach(res => {
content.push({
countryCardTempId: res.id,
description: res.description,
content: res.content
})
})
} else {
url = this.url.edit
this.dataList.forEach(res => {
content.push({
countryCardTempId: res.id,
description: res.description,
content: res.content,
id: res.id
})
})
}
this.confirmLoading = true
let content = []
this.dataList.forEach(res => {
content.push({
countryCardTempId: res.id,
description: res.description,
content: res.content
})
})
let query = {
countryCardManageReleaseDetailEOList: content,
applyMarket: this.formInline.applyMarket
@@ -240,7 +275,7 @@
},
editReplacePage(row) {
this.loading = true
getAction('/problemKnowledgeBase/countryCardManageReleaseDetailEO/list', { editReplacePage: row.id }).then((res) => {
getAction('/problemKnowledgeBase/countryCardManageReleaseDetailEO/list', { countryCardManageReleaseId: row.id }).then((res) => {
if (res.success) {
this.dataList = res.result || []
this.loading = false
@@ -36,7 +36,7 @@
</div>
</div>
</div>
<div v-if="conList.length > 0" style="margin-top: 58px;height: calc(100vh - 260px);overflow:auto;">
<div v-if="conList.length > 0" style="margin-top: 16px;height: calc(100vh - 260px);overflow:auto;">
<li v-for="(item,index) in conList" :key="item.id">
<div style="margin-bottom: 10px;position: relative">
<!-- <a-checkbox :value="item.id" class="checkbox-left"></a-checkbox>-->
@@ -215,8 +215,7 @@
}
.box-content-left {
width: 60%;
float: left;
width: 100%;
font-size: 14px;
font-weight: 400;
color: #040B29;
@@ -224,8 +223,7 @@
}
.box-content-right {
width: 40%;
float: left;
width: 100%;
display: inline-block;
text-align: right;
margin-top: 20px;
@@ -8,6 +8,12 @@
</span>
{{$t('applicableInstructionsMarketList')}}
</div>
<div class="doc-detail-right">
<div @click="forwardClick" class="operator-text-text" :title="$t('forward')">
<a-icon type="reload"/>
{{$t('forward')}}
</div>
</div>
</div>
<div style="padding-top: 68px;background: #fff">
<div class="detail-content" style="padding: 24px">
@@ -77,18 +83,21 @@
</div>
</div>
<viewFileModel ref="viewFileModelRef"/>
<SelectedBy ref="SelectedByRef" :title="$t('forward')" @SelectedByForm="SelectedByForm"></SelectedBy>
</div>
</template>
<script>
import viewFileModel from '@/components/viewFileModel/index'
import SelectedBy from '@/components/SelectedBy/index'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import { mapGetters } from 'vuex'
export default {
name: 'problemKnowledgeBaseView',
components: {
viewFileModel
viewFileModel,
SelectedBy
},
data() {
return {
@@ -140,6 +149,9 @@
},
methods: {
...mapGetters(['userInfo']),
SelectedByForm() {
},
queryById() {
let query = {
id: this.$route.query.id
@@ -251,6 +263,9 @@
this.loading = false
}
})
},
forwardClick() {
this.$refs.SelectedByRef.getPush()
}
}
}
@@ -454,4 +469,28 @@
.header-btn {
height: 38px;
}
.doc-detail-right {
width: 800px;
line-height: 68px;
display: flex;
justify-content: end;
padding-right: 30px;
.doc-detail-btn {
margin-right: 20px;
}
}
.operator-text-text {
cursor: pointer;
font-size: 14px;
font-weight: 400;
color: #040B29;
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
text-align: right;
}
</style>
@@ -104,7 +104,7 @@
{
title: this.$t('operation'),
align: 'center',
width: 100,
width: 120,
scopedSlots: { customRender: 'operation' }
}
],
@@ -45,7 +45,7 @@
</div>
<div class="title-text-content"
:class="{'title-text-content-one':!isTrue}">
{{selectedRowKeysRecord[0] ? selectedRowKeysRecord[0].serialNumber :''}}
{{selectedRowKeysRecord[0] ? selectedRowKeysRecord[0].serialNumber+' - '+selectedRowKeysRecord[0].title:''}}
</div>
<div class="title-text-right" v-if="isTrue">
<span :title="$t('standardDecompositionDocument')" @click="standardDecompositionDocumentClick">
@@ -124,7 +124,7 @@
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<!-- <span class="Required">*</span>-->
<!-- <span class="Required">*</span>-->
<span class="title-text-text" :title="$t('evaluationMethod')">{{$t('evaluationMethod')}}</span>
</div>
<a-form-model-item class="itemModel" prop="gatherResult">
@@ -240,20 +240,20 @@
trigger: 'change'
}
],
processBackground:[
processBackground: [
{
max: 300,
message: this.$t('processBackground') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
],
remark:[
remark: [
{
max: 300,
message: this.$t('remarks') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
],
]
},
searchParmes: {},
selectedRowKeysRecord: [],
@@ -86,7 +86,7 @@
size="middle"
:loading="loading"
:pagination="false"
:scroll="{x: '100%'}"
:scroll="{x: '100%',y:'calc(100vh)'}"
rowKey="id"
:data-source="dataSource"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"