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","不同意");
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);
@@ -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;
}
@@ -77,6 +77,9 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
break;
}
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查询分解单的文本类型")
@GetMapping("getFileType")
public ResponseMessage<Map<String,String>> getFileType(String standId){
Map<String, String> fileType = ServiceImpl.getFileType(standId);
public ResponseMessage<List<Map<String, String>>> getFileType(String standId){
List<Map<String, String>> fileType = ServiceImpl.getFileType(standId);
return Result.success(fileType);
}
@@ -246,13 +246,16 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
return sarStandItems;
}
public Map<String,String> getFileType(String standId){
public List<Map<String, String>> getFileType(String standId){
List<String> fileType = dao.getFileType(standId);
Map<String, String> typeNameMap = InitStandAttrUtil.standInlandAttrFieldList.stream()
.collect(Collectors.toMap(SarStandAttrDetails::getAttrField, SarStandAttrDetails::getAttrName));
Map<String, String> collect = fileType.stream()
.collect(Collectors.toMap(a -> a, b -> typeNameMap.get(b)));
List<Map<String, String>> collect = fileType.stream()
.map(item -> new HashMap<String, String>(){ { put("label", typeNameMap.get(item));put("value", item);} }
).collect(Collectors.toList());
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) {
@@ -732,26 +729,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
String name = entry.getKey();
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)) {
Object svpps = entry.getValue();
@@ -763,28 +741,49 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
value = String.valueOf(getAttrMap.get("SVPPSName"));
entry.setValue(value);
} 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<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)) {
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<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();
// 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<String> 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<SarStandardsInfoDao
nowOrderFunc(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;
}
@@ -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);
}
@@ -602,6 +602,11 @@
</foreach>
FROM
TS_DICTYPE
<where>
<foreach collection="filed" index="index" item="item" separator=" and " >
${item} is not NULL
</foreach>
</where>
</select>