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

This commit is contained in:
wangzhijiang
2022-07-12 14:20:09 +08:00
25 changed files with 737 additions and 99 deletions
@@ -239,6 +239,10 @@ CREATE TABLE `laws_technology_evaluation` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '法规技术评估表' ROW_FORMAT = DYNAMIC;
-- 上报库认证类别参数信息 添加字段 2022-07-11
ALTER TABLE `laws_weilai`.`report_cert_category_params_info`
ADD COLUMN `params_manifest_id` varchar(50) NULL COMMENT '上报库id' AFTER `version`;
-- 法规技术评估-流程明细表
CREATE TABLE `laws_technology_evaluation_flow_detail` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
@@ -1552,6 +1552,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
ReportCertCategoryParamsInfoEO addCcpi = new ReportCertCategoryParamsInfoEO();
BeanUtils.copyProperties(ccpi, addCcpi);
addCcpi.setId(UUID.randomUUID().toString().replace("-",""));
addCcpi.setParamsManifestId(reportId); // 绑定上报库
addReportCertCategoryParamsInfoEOList.add(addCcpi);
}
@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController;
import com.jero.modules.cert.report.entity.ParamsReportConfigEO;
import com.jero.modules.cert.report.entity.ParamsReportDetailEO;
import com.jero.modules.cert.report.service.IParamsReportConfigEOService;
import com.jero.modules.cert.report.service.IParamsReportDetailEOService;
import com.jero.modules.cert.report.vo.ParamsReportDetailVO;
import io.swagger.annotations.Api;
@@ -38,6 +40,9 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
@Autowired
private IParamsReportDetailEOService paramsReportDetailEOService;
@Autowired
private IParamsReportConfigEOService paramsReportConfigEOService;
/**
* 表头中英文切换
*
@@ -148,4 +153,27 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
paramsReportDetailEOService.exportCustom(paramsReportDetailVO, response, request);
}
// @ApiOperation(value = "上报库参数项-自定义导出excel")
// @GetMapping(value = "/exportCustomExcel")
//// @RequiresPermissions("report:detail:export:custom")
// public void exportCustomExcel(ParamsReportDetailVO paramsReportDetailVO,
// HttpServletResponse response,
// HttpServletRequest request) {
// paramsReportDetailEOService.exportCustomExcel(paramsReportDetailVO, response, request);
// }
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "上报库参数配置-查看单个详情")
@ApiOperation(value="上报库参数配置-查看单个详情", notes="上报库参数配置-查看单个详情")
@GetMapping(value = "/getConfig")
// @RequiresPermissions("report:detail:list")
public Result<ParamsReportConfigEO> getById(@RequestParam(name = "id") String id) {
ParamsReportConfigEO paramsReportConfigEO = paramsReportConfigEOService.getById(id);
return Result.OK(paramsReportConfigEO);
}
}
@@ -29,4 +29,8 @@ public class ReportCertCategoryParamsInfoEO extends CertCategoryParamsInfoEO imp
@ApiModelProperty(value = "发布时版本")
private Integer version;
/**上报库id*/
@ApiModelProperty(value = "上报库id")
private String paramsManifestId;
}
@@ -103,10 +103,11 @@
prd.id as id,
prd.nio_number as nio_number,
prd.params_name as params_name,
prd.control_type as control_type,
rccpi.params_number as cert_number,
rccpi.params_name as cert_params_name
from params_report_detail prd
left join report_cert_category_params_info rccpi on prd.nio_number = rccpi.nio_number
left join report_cert_category_params_info rccpi on (prd.params_manifest_id = rccpi.params_manifest_id and prd.nio_number = rccpi.nio_number)
<include refid="BaseQuerySqlForExport"/>
<if test="idList != null and idList.size > 0">
and prd.id in
@@ -15,5 +15,6 @@
<result column="cert_category" property="certCategory" />
<result column="params_template_id" property="paramsTemplateId" />
<result column="version" property="version" />
<result column="params_manifest_id" property="paramsManifestId" />
</resultMap>
</mapper>
@@ -588,7 +588,8 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
// 添加导出历史
String uploadFileName = fileOriName + ".zip";
MultipartFile mFile = new MockMultipartFile(uploadFileName, uploadFileName, ContentType.APPLICATION_OCTET_STREAM.toString(), fis); // 用于上传
InputStream uploadFileio = new FileInputStream(new File(fileNowPath+".zip"));
MultipartFile mFile = new MockMultipartFile(uploadFileName, uploadFileName, "text/plain", uploadFileio); // 用于上传
OSSFile ossFile = ossFileService.uploadLocalOfCos(mFile, "/report", "", CutEnum.CN.getValue()); // 上传导出的压缩包
ParamsReportExportHistoryEO paramsReportExportHistoryEO = new ParamsReportExportHistoryEO();
paramsReportExportHistoryEO.setExportType(ExportTypeEnum.NORMAL.getValue());
@@ -597,6 +598,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
paramsReportExportHistoryEO.setExportTime(new Date());
paramsReportExportHistoryEOService.add(paramsReportExportHistoryEO);
uploadFileio.close();
os.flush();
os.close(); // 后开先关
fis.close(); // 先开后关
@@ -77,10 +77,10 @@ public class ParamsInfoEO implements Serializable {
private String paramsName;
/**技术领域*/
@Excel(name = "*技术领域", width = 15)
// @Excel(name = "*技术领域", width = 15)
// @Dict(dicCode = "technology_territory")
@ApiModelProperty(value = "技术领域")
private String technologyTerritory;
private String technologyTerritory; // 2022-07-12 需求去掉技术领域
/**参数批次*/
@Excel(name = "*参数批次", width = 15, dicCode = "params_batch")
@@ -455,7 +455,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
if (CutEnum.CN.getValue().equals(cut)) {
// 查询导出数据
List<ParamsInfoEO> paramsInfoEOList = paramsInfoEOMapper.selectListWithCert(paramsInfoVO); // 中文数据导出
getTreeDictItemText(paramsInfoEOList, cut);
// getTreeDictItemText(paramsInfoEOList, cut);
List<Map<String, Object>> sheetsList = new ArrayList<>();
sheetsList = getCnExportSheetsList(paramsInfoEOList, fileNowPath, paramsTemplateId);
workbook = ExcelExportUtil.exportExcel(sheetsList, ExcelType.XSSF);
@@ -463,7 +463,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
} else if (CutEnum.EN.getValue().equals(cut)) {
// 查询导出数据
List<ParamsInfoEnExport> paramsInfoEnExportList = paramsInfoEOMapper.selectListWithCertForEnExport(paramsInfoVO); // 英文数据导出
getTreeDictItemTextForEnExport(paramsInfoEnExportList);
// getTreeDictItemTextForEnExport(paramsInfoEnExportList);
List<Map<String, Object>> sheetsList = new ArrayList<>();
sheetsList = getEnExportSheetsList(paramsInfoEnExportList, fileNowPath, paramsTemplateId);
workbook = ExcelExportUtil.exportExcel(sheetsList, ExcelType.XSSF);
@@ -839,7 +839,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
// 第几个sheet页
if (numSheet == 0) { // 企业参数表
if (CutEnum.EN.getValue().equals(cut)) {
String fields[] ={ "*NIO Number", "*Is Must", "*Params Name","*Technical Field","*Params Batch","*Duty Territory",
String fields[] ={ "*NIO Number", "*Is Must", "*Params Name","*Params Batch","*Duty Territory",
"Description", "*Control Type", "Control Verify", "Control Values", "File Template"};
params.setImportFields(fields);
@@ -847,7 +847,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
List<ParamsInfoEnImport> paramsInfoEOListEn = resultEn.getList();
copyParamsInfoList(paramsInfoEOListEn, paramsInfoEOList);
} else {
String fields[] ={ "*NIO编号", "*是否必填", "*参数名称","*技术领域","*参数批次","*责任领域",
String fields[] ={ "*NIO编号", "*是否必填", "*参数名称","*参数批次","*责任领域",
"参数说明", "*控件类型", "控件校验", "控件备选值", "附件模板"};
params.setImportFields(fields);
@@ -1069,7 +1069,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
String cut){
List<CertCategoryParamsInfoCnImport> certCategoryParamsInfoEOList = new ArrayList<>();
// 树形数据字典
List<SysCategory> categoryList = sysCategoryService.queryByTreeDicCode("technology_territory");
// List<SysCategory> categoryList = sysCategoryService.queryByTreeDicCode("technology_territory");
// 普通数据字典
List<SysDictItem> dictItemList = new ArrayList<>();
List<String> dictCodeList = new ArrayList<>();
@@ -1091,12 +1091,12 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
//普通数据字典
List<String> itemNameList = new ArrayList<>();
if (CutEnum.CN.getValue().equals(cut)) {
treeNameList = categoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
// treeNameList = categoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
itemNameList = dictItemList.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
certCategoryMap = dictItemList.stream().filter(e->"cert_category".equals(e.getDictCode())).collect(Collectors.toMap(c->c.getItemText(),c->c.getItemValue()));
} else if(CutEnum.EN.getValue().equals(cut)){
treeNameList = categoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList());
// treeNameList = categoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList());
itemNameList = dictItemList.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
certCategoryMap = dictItemList.stream().filter(e->"cert_category".equals(e.getDictCode())).collect(Collectors.toMap(c->c.getEnName(),c->c.getItemValue()));
@@ -1177,15 +1177,15 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
countError += (int)resultMap.get("countError");
// 技术领域
String technologyTerritory = dto.getTechnologyTerritory();
resultMap = validateMustAndLength(technologyTerritory, "技术领域", "Technical Field", IsMustEnum.YES.getValue(), "1000", false, cut);
errorMsg += (String)resultMap.get("errorMsg");
countError += (int)resultMap.get("countError");
resultMap = getCodeByName(technologyTerritory,"技术领域", "Technical Field","treeDicCode",null,treeNameList,categoryList,cut);
errorMsg += (String)resultMap.get("errorMsg");
countError += (int)resultMap.get("countError");
technologyTerritory = (String)resultMap.get("value");
dto.setTechnologyTerritory(technologyTerritory);
// String technologyTerritory = dto.getTechnologyTerritory();
// resultMap = validateMustAndLength(technologyTerritory, "技术领域", "Technical Field", IsMustEnum.YES.getValue(), "1000", false, cut);
// errorMsg += (String)resultMap.get("errorMsg");
// countError += (int)resultMap.get("countError");
// resultMap = getCodeByName(technologyTerritory,"技术领域", "Technical Field","treeDicCode",null,treeNameList,categoryList,cut);
// errorMsg += (String)resultMap.get("errorMsg");
// countError += (int)resultMap.get("countError");
// technologyTerritory = (String)resultMap.get("value");
// dto.setTechnologyTerritory(technologyTerritory);
// 参数批次
String paramsBatch = dto.getParamsBatch();
@@ -28,7 +28,7 @@ public class ParamsInfoCnImport {
private String paramsName;
/**技术领域*/
@Excel(name = "*技术领域", width = 15)
// @Excel(name = "*技术领域", width = 15)
@ApiModelProperty(value = "技术领域")
private String technologyTerritory;
@@ -60,8 +60,8 @@ public class ParamsInfoEnExport {
private String paramsName;
/**技术领域*/
@Excel(name = "*Technical Field", width = 15)
// @Dict(dicCode = "technology_territory")
// @Excel(name = "*Technical Field", width = 15)
//// @Dict(dicCode = "technology_territory")
@ApiModelProperty(value = "技术领域")
private String technologyTerritory;
@@ -28,7 +28,7 @@ public class ParamsInfoEnImport {
private String paramsName;
/**技术领域*/
@Excel(name = "*Technical Field", width = 15)
// @Excel(name = "*Technical Field", width = 15)
@ApiModelProperty(value = "技术领域")
private String technologyTerritory;