diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java index 05006409c..1da77c4a4 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationItemResultEOServiceImpl.java @@ -20,6 +20,14 @@ 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.RequestSourceEnum; +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.split.service.IFileSplitItemsEOService; +import com.jero.modules.split.service.ISarFileSplitItemsValEOService; import com.jero.modules.system.entity.SysCategory; import com.jero.modules.system.entity.SysUser; import com.jero.modules.system.service.ISysUserService; @@ -66,6 +74,10 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl private IOSSFileService iOSSFileService; @Autowired private ISysUserService sysUserService; + @Autowired + private IFileSplitItemsEOService fileSplitItemsEOService; + @Autowired + private ISarFileSplitItemsValEOService sarFileSplitItemsValEOService; /** * 保存 @@ -276,7 +288,7 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl //创建表头 String[] titleArr = title.split(","); - for (int i=0; i<=5; i++){ + for (int i=0; i<=10; i++){ sheet.setColumnWidth(i,4000); Cell cell = firstRow.createCell(i); cell.setCellStyle(titleCellStyle); @@ -285,12 +297,30 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl //设置导出数据 if(CollectionUtils.isNotEmpty(exportData)) { + List allTableList = new ArrayList<>(); // 存储表格数据 + List allImgList = new ArrayList<>(); // 存储文件数据 + SarFileSplitItemsEOPage page = new SarFileSplitItemsEOPage(); + for (int dataIndex = 0; dataIndex < exportData.size(); dataIndex++) { Row dataRow = sheet.createRow(dataIndex + 1); dataRow.createCell(0).setCellValue(exportData.get(dataIndex).getItemNum()); dataRow.createCell(1).setCellValue(exportData.get(dataIndex).getItemName()); - dataRow.createCell(2).setCellValue(exportData.get(dataIndex).getItemContent()); - dataRow.createCell(3).setCellValue(exportData.get(dataIndex).getCreateBy()); + + String itemContent = exportData.get(dataIndex).getItemContent(); + + if(StringUtils.isNotEmpty(exportData.get(dataIndex).getItemId())){ + SarFileSplitItemsValEOPage valEOPage = new SarFileSplitItemsValEOPage(); + valEOPage.setItemId(exportData.get(dataIndex).getItemId()); + valEOPage.setOrderBy("DISPLAY_SEQ,ID"); + List getValList = this.sarFileSplitItemsValEOService.queryByList(valEOPage); + List valContentList = this.fileSplitItemsEOService.combineItemValInfo(getValList,allTableList,allImgList,page); //TODO + if(CollectionUtils.isNotEmpty(valContentList)){ + itemContent = valContentList.get(0).getValContent(); + } + } + + dataRow.createCell(2).setCellValue(itemContent); + dataRow.createCell(3).setCellValue(exportData.get(dataIndex).getEvaluatorName()); dataRow.createCell(4).setCellValue(exportData.get(dataIndex).getEvaluationMethodsName()); dataRow.createCell(5).setCellValue(exportData.get(dataIndex).getTechnicalFileName()); dataRow.createCell(6).setCellValue(exportData.get(dataIndex).getSection()); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsComplianceBoardController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsComplianceBoardController.java new file mode 100644 index 000000000..b5167fba8 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsComplianceBoardController.java @@ -0,0 +1,45 @@ +package com.jero.modules.project.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.jero.common.api.vo.Result; +import com.jero.common.aspect.annotation.AutoLog; +import com.jero.modules.project.service.ILawsComplianceBoardService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import net.sf.json.JSONObject; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +@Api(tags="法规符合性看板") +@RestController +@RequestMapping("/project/lawsComplianceBoard") +@Slf4j +public class LawsComplianceBoardController { + + @Autowired + private ILawsComplianceBoardService lawsComplianceBoardService; + + @AutoLog(value = "项目库-法规符合性看板列表分页查询") + @ApiOperation(value="项目库-法规符合性看板列表分页查询", notes="项目库-法规符合性看板列表分页查询") + @GetMapping(value = "/page") + public JSONObject queryPageList(@RequestParam Map params){ + IPage infoPage = this.lawsComplianceBoardService.queryPageList(params); + Result ok = Result.OK(infoPage); + JSONObject jsonResult = JSONObject.fromObject(ok); + return jsonResult; + } + + @AutoLog(value = "项目库-法规符合性看板-查询符合性结果列表") + @ApiOperation(value="项目库-法规符合性看板-查询符合性结果列表", notes="项目库-法规符合性看板-查询符合性结果列表") + @GetMapping(value = "/queryComplianceResultList") + public Result queryComplianceResultList(@RequestParam Map params){ + JSONObject result = this.lawsComplianceBoardService.queryComplianceResultList(params); + return Result.OK(result); + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/LawsComplianceBoardMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/LawsComplianceBoardMapper.java new file mode 100644 index 000000000..cc7849ae8 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/LawsComplianceBoardMapper.java @@ -0,0 +1,24 @@ +package com.jero.modules.project.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +public interface LawsComplianceBoardMapper { + /** + * 查询出 启动过 设计、prehomo、验证符合性、法规技术评估、法规意见收集其中一个流程 的数据 + * @param page + * @param params + * @return + */ + IPage queryPageList(IPage page, @Param("params") Map params); + + /** + * 项目库-法规符合性看板-查询符合性结果列表 + * @param params + * @return + */ + List> queryComplianceResultList(@Param("params") Map params); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/LawsComplianceBoardMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/LawsComplianceBoardMapper.xml new file mode 100644 index 000000000..08027e0bf --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/LawsComplianceBoardMapper.xml @@ -0,0 +1,65 @@ + + + + + + + + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/ILawsComplianceBoardService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/ILawsComplianceBoardService.java new file mode 100644 index 000000000..12260ef23 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/ILawsComplianceBoardService.java @@ -0,0 +1,18 @@ +package com.jero.modules.project.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.jero.common.api.vo.Result; +import net.sf.json.JSONObject; + +import java.util.Map; + +public interface ILawsComplianceBoardService { + IPage queryPageList(Map params); + + /** + * 项目库-法规符合性看板-查询符合性结果列表 + * @param params + * @return + */ + JSONObject queryComplianceResultList(Map params); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/LawsComplianceBoardServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/LawsComplianceBoardServiceImpl.java new file mode 100644 index 000000000..c95840dda --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/LawsComplianceBoardServiceImpl.java @@ -0,0 +1,201 @@ +package com.jero.modules.project.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.jero.modules.document.enums.FieldTypeEnum; +import com.jero.modules.document.service.IBussDocumentLibraryEOService; +import com.jero.modules.document.vo.QueryConditionVO; +import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO; +import com.jero.modules.lawsOpinionGather.service.ILawsOpinionGatherEOService; +import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO; +import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService; +import com.jero.modules.project.mapper.LawsComplianceBoardMapper; +import com.jero.modules.project.service.ILawsComplianceBoardService; +import com.jero.modules.system.util.StringUtils; +import net.sf.json.JSONObject; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; + +@Service +@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) +public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardService { + + @Autowired + private LawsComplianceBoardMapper lawsComplianceBoardMapper; + @Autowired + private ILawsOpinionGatherEOService lawsOpinionGatherEOService; + @Autowired + private ILawsTechnologyEvaluationEOService lawsTechnologyEvaluationEOService; + @Autowired + private IBussDocumentLibraryEOService bussDocumentLibraryEOService; + + @Override + public IPage queryPageList(Map params) { + int pageNo = Integer.parseInt(params.get("pageNo").toString()); + int pageSize = Integer.parseInt(params.get("pageSize").toString()); + + //封装查询条件(包含高级搜索) + String condition = this.getConditionStr(params); + params.put("condition",condition); + IPage page = new Page(pageNo, pageSize); + IPage infoPage = this.lawsComplianceBoardMapper.queryPageList(page, params); + List records = infoPage.getRecords(); + this.disposeData(records); + return infoPage; + } + + public void disposeData(List datas){ + if (CollectionUtils.isNotEmpty(datas)) { + for (Object data : datas) { + Map dataMap = (Map) data; + } + } + } + + @Override + public JSONObject queryComplianceResultList(Map params) { + JSONObject result = new JSONObject(); + String id = (String) params.get("id"); + String cut = (String) params.get("cut"); + List> cmplianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params); + result.put("cmplianceResultList",cmplianceResultList); + + //查询当前数据是否有法规意见收集流程数据 + QueryWrapper opinionGatherEOQueryWrapper = new QueryWrapper<>(); + opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getStandId,id); + int opinionGatherCount = this.lawsOpinionGatherEOService.count(opinionGatherEOQueryWrapper); + result.put("opinionGather",opinionGatherCount); + + //查询当前数据是否有法规技术评估流程数据 + QueryWrapper evaluationEOQueryWrapper = new QueryWrapper<>(); + evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getStandId,id); + int evaluationCount = this.lawsTechnologyEvaluationEOService.count(evaluationEOQueryWrapper); + result.put("technologyEvaluation",evaluationCount); + return result; + } + + + @NotNull + public String getConditionStr(Map parameter) { + String cut = (String) parameter.get("cut"); + String flag = String.valueOf(parameter.get("flag")); + //查询条件 + StringBuilder conditionSb = new StringBuilder(""); + + //过滤查询条件字段类型使用 + List> mapList = this.bussDocumentLibraryEOService.queryCondition("1", cut, null); + + //查询条件处理 + for (Map.Entry entry : parameter.entrySet()) { + String key = entry.getKey(); + if (!"pageNo".equals(key) && !"pageSize".equals(key)) { + String value = ""; + if(ObjectUtils.isNotEmpty(entry.getValue())){ + value = StringUtils.valueOf(entry.getValue()); + } + if (StringUtils.isNotBlank(value)) { + for (Map map : mapList) { + String fieldName = (String) map.get("db_field_name");//字段 + if (key.equals(fieldName)) { + //字段类型(判断是输入框还是下拉,等等) + String fieldType = (String) map.get("field_show_type");//字段类型 + if (FieldTypeEnum.TEXT_STRING.getValue().equals(fieldType) || FieldTypeEnum.TEXT_NUMBER.getValue().equals(fieldType)) { + //输入框 LIKE CONCAT("%", '/%', "%") ESCAPE '/' + if (value.contains("%")) { + value = value.replace("%", "/%"); + } + conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%') ESCAPE '/'"); + } else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldType) + || FieldTypeEnum.PULL_MORE.getValue().equals(fieldType) + || FieldTypeEnum.TREE.getValue().equals(fieldType)) { + StringBuilder valueSb = new StringBuilder(); + StringBuilder condition = new StringBuilder(); + for (String valueTemp : value.split(",")) { + valueSb.append("'" + valueTemp + "',"); + condition.append(" or " + key + " like concat(concat('%','" + valueTemp + "'),'%')"); + } + condition.append(")"); + String substring = valueSb.substring(0, valueSb.length() - 1); + //下拉单选或下拉多选 + conditionSb.append(" and (" + key + " in(" + substring + ")" + condition.toString()); + + } else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) { + //日期(区分单日期还时间范围) + if (value.contains(",")) { + conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'" + + " and " + "date_format(" + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'"); + } else { + conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') = '" + value + "'"); + } + } else if (FieldTypeEnum.PERSON.getValue().equals(fieldType)) { + //输入框 LIKE CONCAT("%", '/%', "%") ESCAPE '/' + if (value.contains("%")) { + value = value.replace("%", "/%"); + } + conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%') ESCAPE '/'"); + } + } + } + } + } + + } + + //处理法规预警模块预警时间查询条件 flag = 0(新车实施日期), flag = 1(在产车实施日期) + String warnTime = (String) parameter.get("WarnTime"); + if(StringUtils.isNotBlank(warnTime)){ + if("0".equals(flag)){ + //日期(区分单日期还时间范围) + if (warnTime.contains(",")) { + conditionSb.append(" and " + "date_format(" + "xin1_che1_xing2_shi2_shi1_ri4_qi1" + ",'%Y-%m-%d') >= '" + warnTime.split(",")[0] + "'" + + " and " + "date_format(" + "xin1_che1_xing2_shi2_shi1_ri4_qi1" + ",'%Y-%m-%d') <= '" + warnTime.split(",")[1] + "'"); + } else { + conditionSb.append(" and " + "date_format(" + "xin1_che1_xing2_shi2_shi1_ri4_qi1" + ",'%Y-%m-%d') = '" + warnTime + "'"); + } + }else{ + //日期(区分单日期还时间范围) + if (warnTime.contains(",")) { + conditionSb.append(" and " + "date_format(" + "implement_time" + ",'%Y-%m-%d') >= '" + warnTime.split(",")[0] + "'" + + " and " + "date_format(" + "implement_time" + ",'%Y-%m-%d') <= '" + warnTime.split(",")[1] + "'"); + } else { + conditionSb.append(" and " + "date_format(" + "implement_time" + ",'%Y-%m-%d') = '" + warnTime + "'"); + } + } + } + + //高级搜索 queryConditionVOList List + if(ObjectUtils.isNotEmpty(parameter.get("queryConditionVOList"))){ + String queryConditionVOListStr = (String) parameter.get("queryConditionVOList"); + List queryConditionVOList = com.alibaba.fastjson.JSONObject.parseArray(queryConditionVOListStr, QueryConditionVO.class); + if(ObjectUtils.isNotEmpty(queryConditionVOList)){ + String queryCondition = this.bussDocumentLibraryEOService.sqlJoint(queryConditionVOList); + if(StringUtils.isNotBlank(queryCondition)){ + conditionSb.append(" and " + queryCondition); + } + } + } + + //处理列表表头排序 + /*if (StringUtils.isNotBlank((String) parameter.get("orderByField"))) { + conditionSb.append(" order by " + (String) parameter.get("orderByField")); + if ("1".equals((String) parameter.get("orderBy"))) { + conditionSb.append(" asc");//正序 + } else if ("2".equals((String) parameter.get("orderBy"))) { + conditionSb.append(" desc");//倒序 + } + } else { + conditionSb.append(" order by create_time desc"); + }*/ + String condition = conditionSb.toString(); + return condition; + } +}