diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java index dcddca3d..944b20e2 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java @@ -641,13 +641,7 @@ public class WorkFlowController { map.put("comment","不同意"); break; default: - String commentText=""; - map.put("comment",comment+map.get("commentText")); } - - }else if (map.get("commentText")!=null && !"".equals(map.get("commentText"))){ - map.put("comment",map.get("commentText").toString()); - } ProcessDetailExport user = JSON.parseObject(JSON.toJSONString(map), ProcessDetailExport.class); exportDatas.add(user); diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/entity/ProcessDetailExport.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/entity/ProcessDetailExport.java index 1cde1409..0dbc9112 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/workFlow/entity/ProcessDetailExport.java +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/entity/ProcessDetailExport.java @@ -16,7 +16,7 @@ public class ProcessDetailExport { @Excel(name = "完成时间", orderNum = "4",exportFormat = "yyyy/MM/dd",width = 15) private Date endTime; @Excel(name = "流程信息", orderNum = "5",width = 15) - private String comment; + private String commentText; @Excel(name = "状态", orderNum = "6",width = 15) private String flag; } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarModelTree/service/impl/SarModelTreeServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarModelTree/service/impl/SarModelTreeServiceImpl.java index ee783e2a..0dd69717 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarModelTree/service/impl/SarModelTreeServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarModelTree/service/impl/SarModelTreeServiceImpl.java @@ -77,6 +77,9 @@ public class SarModelTreeServiceImpl extends ServiceImpl { @ApiOperation(value = "|SarFileSplitInfoEO|根据标准id查询分解单的文本类型") @GetMapping("getFileType") - public ResponseMessage> getFileType(String standId){ - Map fileType = ServiceImpl.getFileType(standId); + public ResponseMessage>> getFileType(String standId){ + List> fileType = ServiceImpl.getFileType(standId); return Result.success(fileType); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandItems/service/impl/SarStandItemsServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandItems/service/impl/SarStandItemsServiceImpl.java index c3672b64..bdda5828 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandItems/service/impl/SarStandItemsServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandItems/service/impl/SarStandItemsServiceImpl.java @@ -246,13 +246,16 @@ public class SarStandItemsServiceImpl extends ServiceImpl getFileType(String standId){ + public List> getFileType(String standId){ List fileType = dao.getFileType(standId); Map typeNameMap = InitStandAttrUtil.standInlandAttrFieldList.stream() .collect(Collectors.toMap(SarStandAttrDetails::getAttrField, SarStandAttrDetails::getAttrName)); - Map collect = fileType.stream() - .collect(Collectors.toMap(a -> a, b -> typeNameMap.get(b))); + List> collect = fileType.stream() + .map(item -> new HashMap(){ { put("label", typeNameMap.get(item));put("value", item);} } + ).collect(Collectors.toList()); + + return collect; } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java index aab3ee7c..5a211419 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarStandardsInfo/service/impl/SarStandardsInfoServiceImpl.java @@ -714,12 +714,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl sarlist) throws Exception { + public void attrInfoShowExport(List sarlist,Map dicMap) throws Exception { + - List dicInfo = dicTypeEODao.getDicInfo("dic_type_code", "dic_type_name"); - Map dicMap = - dicInfo.stream() - .collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getDicTypeName,(value1, value2 )->value2)); for (SarStandardsInfo row : sarlist) { @@ -732,26 +729,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl 0 && InitStandAttrUtil.fileFieldList.contains(name)) { - value = entry.getValue().toString(); - if (StringUtils.isNotBlank(value)) { - List fileObj = attFileEOService.getMultiFileInfos(value); - entry.setValue(fileObj); - } - } else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) { - value = entry.getValue().toString(); - if ("GZZXX".equals(name)) { - value = sysInfoEOService.getGroupNamesByIds(value); - } else { - String selVal = InitStandAttrUtil.selectFieldMap.get(name); - if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal) || SelectionTypeEnum.USERLIST.getValue().equals(selVal) || SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) { - if (getAttrMap.get(name + "Name") != null) { - value = String.valueOf(getAttrMap.get(name + "Name")); + } +// else if (entry.getValue() != null && InitStandAttrUtil.fileFieldList != null && InitStandAttrUtil.fileFieldList.size() > 0 && InitStandAttrUtil.fileFieldList.contains(name)) { +// value = entry.getValue().toString(); +// if (StringUtils.isNotBlank(value)) { +// List fileObj = attFileEOService.getMultiFileInfos(value); +// entry.setValue(fileObj); +// } +// } + else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) { +// value = entry.getValue().toString(); +// String selVal = InitStandAttrUtil.selectFieldMap.get(name); +// if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal) || SelectionTypeEnum.USERLIST.getValue().equals(selVal) || SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) { +// if (getAttrMap.get(name + "Name") != null) { +// value = String.valueOf(getAttrMap.get(name + "Name")); +// } +// +// +// } else { + /** + *============================ 对getAttrMap的value赋值中文名称=============================== + */ + if(entry.getValue()!=null) { + StringBuilder builder = new StringBuilder(""); + for (String s : entry.getValue().toString().split(",")) { + if (dicMap.containsKey(s) && !"ZRBM".equals(name)){ + builder.append(dicMap.get(s)+" "); + } + + } + + + if (builder.toString().isEmpty()){ + getAttrMap.put(name, entry.getValue().toString()); + }else { + getAttrMap.put(name, builder.toString()); + } } - } else { - List valArr = Arrays.asList(value.split(",")); - value = dicTypeEODao.getDicNamesByCodes(valArr); - } - } - entry.setValue(value); + /** + *============================ 对getAttrMap的value赋值中文名称=============================== + */ +// } + +// entry.setValue(value); } } getAttrMap.put("SVPPSTips", svppsTip); @@ -1705,7 +1704,13 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl getList = dao.getSarStandardsExportInfo(page); - attrInfoShowExport(getList); + + //查询字典表,形成Hash映射提升速度 + List dicInfo = dicTypeEODao.getDicInfo("dic_type_code", "dic_type_name"); + Map dicMap = dicInfo.stream() + .filter(item-> !item.getDicTypeCode().isEmpty()) + .collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getDicTypeName,(value1, value2 )->value2)); + attrInfoShowExport(getList,dicMap); return getList; } diff --git a/adc-da-slrs/src/main/java/com/adc/da/utils/util/SarAdvanceSearchUtil.java b/adc-da-slrs/src/main/java/com/adc/da/utils/util/SarAdvanceSearchUtil.java index 811274f5..72b2f6bc 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/utils/util/SarAdvanceSearchUtil.java +++ b/adc-da-slrs/src/main/java/com/adc/da/utils/util/SarAdvanceSearchUtil.java @@ -95,10 +95,39 @@ public class SarAdvanceSearchUtil { String sql = ""; SarAdvanceSearchVO searchVO=searchVOList.get(i); if (StringUtils.isNotBlank(searchVO.getValue())); - if (i==0){ - sql+=tableName+searchVO.getField()+" " + searchVO.getType() + " " + "concat(concat('%','" +searchVO.getValue() + "'),'%') "; - }else { - sql+="AND"+" "+tableName+searchVO.getField()+" " + searchVO.getType() + " " + "concat(concat('%','" +searchVO.getValue() + "'),'%') "; + + + + switch (searchVO.getType()){ + //多个正则查询 + case "regexp": + case "REGEXP": + if (i==0){ + sql+=tableName+searchVO.getField()+" " + "REGEXP" + " " + "\'" + searchVO.getValue().replaceAll(",","|").replaceAll("\\s*","") + "\'"; + }else { + sql+=" AND "+" "+tableName+searchVO.getField()+" " + "REGEXP" + " " +"\'"+ searchVO.getValue().replaceAll(",","|").replaceAll("\\s*","") + "\'" ; + } + break; + //模糊查询 + case "LIKE": + case "like": + if (i==0){ + sql+=tableName+searchVO.getField()+" " + "LIKE" + " " + "concat(concat('%','" +searchVO.getValue() + "'),'%') "; + }else { + sql+=" AND "+" "+tableName+searchVO.getField()+" " +"LIKE" + " " + "concat(concat('%','" +searchVO.getValue() + "'),'%') "; + } + break; + //日期范围查询 + case "between": + case "BETWEEN": + String[] boundaryArray = searchVO.getValue().split(","); + if (i==0){ + sql+= "DATE_FORMAT("+ tableName+searchVO.getField() + ",'%Y-%m-%d')"+" " + "BETWEEN" + " " +"DATE_FORMAT("+ "\'" + boundaryArray[0].replaceAll("\\s*","") + "\'" +",'%Y-%m-%d')" +" AND "+ "DATE_FORMAT("+ "\'" + boundaryArray[1].replaceAll("\\s*","") + "\'" + ",'%Y-%m-%d')"; + }else { + sql+=" AND "+" "+"DATE_FORMAT("+ tableName+searchVO.getField() + ",'%Y-%m-%d')"+" " + "BETWEEN" + " " +"DATE_FORMAT("+ "\'" + boundaryArray[0].replaceAll("\\s*","") + "\'" + ",'%Y-%m-%d')" +" AND "+ "DATE_FORMAT("+ "\'" + boundaryArray[1].replaceAll("\\s*","") + "\'" + ",'%Y-%m-%d')"; + } + break; + default: } sqlBuilder.append(sql); } diff --git a/adc-da-sys/src/main/resources/mybatis/mapper/sys/DicTypeEOMapper.xml b/adc-da-sys/src/main/resources/mybatis/mapper/sys/DicTypeEOMapper.xml index 8cc364d0..af630bc2 100644 --- a/adc-da-sys/src/main/resources/mybatis/mapper/sys/DicTypeEOMapper.xml +++ b/adc-da-sys/src/main/resources/mybatis/mapper/sys/DicTypeEOMapper.xml @@ -602,6 +602,11 @@ FROM TS_DICTYPE + + + ${item} is not NULL + +