Merge branch 'develop_master' into 'FOTON'

Develop master

See merge request LiuChao/foton-slrs-system-rest!340
This commit is contained in:
王夏晖
2021-12-30 09:07:25 +08:00
8 changed files with 101 additions and 62 deletions
@@ -641,13 +641,7 @@ public class WorkFlowController {
map.put("comment","不同意"); map.put("comment","不同意");
break; break;
default: 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); ProcessDetailExport user = JSON.parseObject(JSON.toJSONString(map), ProcessDetailExport.class);
exportDatas.add(user); exportDatas.add(user);
@@ -16,7 +16,7 @@ public class ProcessDetailExport {
@Excel(name = "完成时间", orderNum = "4",exportFormat = "yyyy/MM/dd",width = 15) @Excel(name = "完成时间", orderNum = "4",exportFormat = "yyyy/MM/dd",width = 15)
private Date endTime; private Date endTime;
@Excel(name = "流程信息", orderNum = "5",width = 15) @Excel(name = "流程信息", orderNum = "5",width = 15)
private String comment; private String commentText;
@Excel(name = "状态", orderNum = "6",width = 15) @Excel(name = "状态", orderNum = "6",width = 15)
private String flag; private String flag;
} }
@@ -77,6 +77,9 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
break; break;
} }
item.setId(item.getName()); item.setId(item.getName());
if (null==item.getName() && null != item.getModel()){
item.setName(item.getModel());
}
}); });
@@ -123,8 +123,8 @@ public class SarStandItemsController extends BaseController<SarStandItems> {
@ApiOperation(value = "|SarFileSplitInfoEO|根据标准id查询分解单的文本类型") @ApiOperation(value = "|SarFileSplitInfoEO|根据标准id查询分解单的文本类型")
@GetMapping("getFileType") @GetMapping("getFileType")
public ResponseMessage<Map<String,String>> getFileType(String standId){ public ResponseMessage<List<Map<String, String>>> getFileType(String standId){
Map<String, String> fileType = ServiceImpl.getFileType(standId); List<Map<String, String>> fileType = ServiceImpl.getFileType(standId);
return Result.success(fileType); return Result.success(fileType);
} }
@@ -246,13 +246,16 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
return sarStandItems; return sarStandItems;
} }
public Map<String,String> getFileType(String standId){ public List<Map<String, String>> getFileType(String standId){
List<String> fileType = dao.getFileType(standId); List<String> fileType = dao.getFileType(standId);
Map<String, String> typeNameMap = InitStandAttrUtil.standInlandAttrFieldList.stream() Map<String, String> typeNameMap = InitStandAttrUtil.standInlandAttrFieldList.stream()
.collect(Collectors.toMap(SarStandAttrDetails::getAttrField, SarStandAttrDetails::getAttrName)); .collect(Collectors.toMap(SarStandAttrDetails::getAttrField, SarStandAttrDetails::getAttrName));
Map<String, String> collect = fileType.stream() List<Map<String, String>> collect = fileType.stream()
.collect(Collectors.toMap(a -> a, b -> typeNameMap.get(b))); .map(item -> new HashMap<String, String>(){ { put("label", typeNameMap.get(item));put("value", item);} }
).collect(Collectors.toList());
return collect; return collect;
} }
} }
@@ -714,12 +714,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
} }
} }
public void attrInfoShowExport(List<SarStandardsInfo> sarlist) throws Exception { public void attrInfoShowExport(List<SarStandardsInfo> sarlist,Map<String,String> dicMap) throws Exception {
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_type_code", "dic_type_name");
Map<String, String> dicMap =
dicInfo.stream()
.collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getDicTypeName,(value1, value2 )->value2));
for (SarStandardsInfo row : sarlist) { for (SarStandardsInfo row : sarlist) {
@@ -732,26 +729,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
String name = entry.getKey(); String name = entry.getKey();
String value = ""; String value = "";
/**
*============================ 对getAttrMap的value赋值中文名称===============================
*/
if(entry.getValue()!=null) {
StringBuilder builder = new StringBuilder("");
for (String s : entry.getValue().toString().split(",")) {
if (dicMap.containsKey(s)) {
builder.append(dicMap.get(s)+" ");
} else {
builder.append(entry.getValue().toString());
}
getAttrMap.put(name, builder.toString());
}
}
/**
*============================ 对getAttrMap的value赋值中文名称===============================
*/
if ("SVPPS".equals(name)) { if ("SVPPS".equals(name)) {
Object svpps = entry.getValue(); Object svpps = entry.getValue();
@@ -763,28 +741,49 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
} }
value = String.valueOf(getAttrMap.get("SVPPSName")); value = String.valueOf(getAttrMap.get("SVPPSName"));
entry.setValue(value); entry.setValue(value);
} else if (entry.getValue() != null && InitStandAttrUtil.fileFieldList != null && InitStandAttrUtil.fileFieldList.size() > 0 && InitStandAttrUtil.fileFieldList.contains(name)) { }
value = entry.getValue().toString(); // else if (entry.getValue() != null && InitStandAttrUtil.fileFieldList != null && InitStandAttrUtil.fileFieldList.size() > 0 && InitStandAttrUtil.fileFieldList.contains(name)) {
if (StringUtils.isNotBlank(value)) { // value = entry.getValue().toString();
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value); // if (StringUtils.isNotBlank(value)) {
entry.setValue(fileObj); // List<AttFileEO> 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)) { else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
value = sysInfoEOService.getGroupNamesByIds(value); // value = entry.getValue().toString();
} else { // String selVal = InitStandAttrUtil.selectFieldMap.get(name);
String selVal = InitStandAttrUtil.selectFieldMap.get(name); // if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal) || SelectionTypeEnum.USERLIST.getValue().equals(selVal) || SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal) || SelectionTypeEnum.USERLIST.getValue().equals(selVal) || SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) { // if (getAttrMap.get(name + "Name") != null) {
if (getAttrMap.get(name + "Name") != null) { // value = String.valueOf(getAttrMap.get(name + "Name"));
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<String> valArr = Arrays.asList(value.split(",")); *============================ 对getAttrMap的value赋值中文名称===============================
value = dicTypeEODao.getDicNamesByCodes(valArr); */
} // }
}
entry.setValue(value); // entry.setValue(value);
} }
} }
getAttrMap.put("SVPPSTips", svppsTip); getAttrMap.put("SVPPSTips", svppsTip);
@@ -1705,7 +1704,13 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
nowOrderFunc(page); nowOrderFunc(page);
} }
List<SarStandardsInfo> getList = dao.getSarStandardsExportInfo(page); List<SarStandardsInfo> getList = dao.getSarStandardsExportInfo(page);
attrInfoShowExport(getList);
//查询字典表,形成Hash映射提升速度
List<DicTypeEO> dicInfo = dicTypeEODao.getDicInfo("dic_type_code", "dic_type_name");
Map<String, String> dicMap = dicInfo.stream()
.filter(item-> !item.getDicTypeCode().isEmpty())
.collect(Collectors.toMap(DicTypeEO::getDicTypeCode,DicTypeEO::getDicTypeName,(value1, value2 )->value2));
attrInfoShowExport(getList,dicMap);
return getList; return getList;
} }
@@ -95,10 +95,39 @@ public class SarAdvanceSearchUtil {
String sql = ""; String sql = "";
SarAdvanceSearchVO searchVO=searchVOList.get(i); SarAdvanceSearchVO searchVO=searchVOList.get(i);
if (StringUtils.isNotBlank(searchVO.getValue())); 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); sqlBuilder.append(sql);
} }
@@ -602,6 +602,11 @@
</foreach> </foreach>
FROM FROM
TS_DICTYPE TS_DICTYPE
<where>
<foreach collection="filed" index="index" item="item" separator=" and " >
${item} is not NULL
</foreach>
</where>
</select> </select>