feat: There is no way the,

This commit is contained in:
super_liu
2021-11-06 23:17:29 +08:00
parent 3171ce4622
commit 8b12a63925
10 changed files with 598 additions and 156 deletions
@@ -413,6 +413,53 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
}
public void attrInfoDetailsExport(SarStandardsInfo row) throws Exception {
String fieldInfo = InitStandAttrUtil.queryField;
// 查询属性表数据
if (StringUtils.isNotBlank(fieldInfo)) {
Map<String, Object> getAttrMap = sarStandAttrInfoEODao.selectStandFieldAndData(fieldInfo, row.getId());
if (InitStandAttrUtil.clobFieldList != null && !InitStandAttrUtil.clobFieldList.isEmpty()) {
// 遍历修改所有clob类型的值
for (String clobField : InitStandAttrUtil.clobFieldList) {
Clob clobValue = (Clob) getAttrMap.get(clobField);
String fieldValue = FieldConvertUtil.ClobToString(clobValue);
getAttrMap.put(clobField, fieldValue);
}
}
// 组织机构和人员
Map<String, Object> newMap = new HashMap<>();
if (getAttrMap != null) {
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
if ("\"null\"".equals(entry.getValue())) {
entry.setValue("");
}
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
String value = entry.getValue().toString();
String selVal = InitStandAttrUtil.selectFieldMap.get(name);
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
value = sysInfoEOService.getOrgNamesByIds(value);
newMap.put(name + "Name", value);
} else if (SelectionTypeEnum.USERLIST.getValue().equals(selVal)) {
value = sysInfoEOService.getUserNamesByIds(value);
newMap.put(name + "Name", value);
} else if (SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
value = sysInfoEOService.getRoleNamesByIds(value);
newMap.put(name + "Name", value);
}
}
}
getAttrMap.putAll(newMap);
}
if (getAttrMap != null && !getAttrMap.isEmpty()) {
row.setAttrInfoCaseMap(transformUpperCase(getAttrMap));
}
row.setAttrInfoMap(getAttrMap);
}
}
public void attrInfoSearchDetails(SarStandardsInfo row,String type) throws Exception {
String fieldInfo = InitStandAttrUtil.queryField;
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
@@ -604,6 +651,55 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
}
public void attrInfoShowExport(List<SarStandardsInfo> sarlist) throws Exception {
for (SarStandardsInfo row : sarlist) {
attrInfoDetailsExport(row);
Map<String, Object> getAttrMap = row.getAttrInfoMap();
Map<String, Object> getNewMap = new LinkedHashMap<>();
if (getAttrMap != null && getAttrMap.size() > 0) {
String svppsTip = "";
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
String value = "";
if ("SVPPS".equals(name)) {
Object svpps = entry.getValue();
if (svpps != null && StringUtils.isNotBlank(svpps.toString())) {
svppsTip = svpps.toString();
}
if (StringUtils.isNotBlank(svppsTip)) {
svppsTip = sysInfoEOService.getSvppsNamesTipByIds(svppsTip);
}
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 {
List<String> valArr = Arrays.asList(value.split(","));
value = dicTypeEODao.getDicNamesByCodes(valArr);
}
}
entry.setValue(value);
}
}
getAttrMap.put("SVPPSTips", svppsTip);
}
}
}
/***
* @Description: 新增标准
@@ -1456,19 +1552,23 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
page = (SarStandardsInfoEOPage) JSONObject.toBean(jsonObject, SarStandardsInfoEOPage.class);
page.setStandType(standardsInfoExcelVO.getStandType());
//查询当前登录人角色拥有权限的菜单
List<String> getMenuIdList = new ArrayList<>();
if(standardsInfoExcelVO.getUserId() != null){
getMenuIdList= tsUserService.getResourceUserId(standardsInfoExcelVO.getUserId());
}
// List<String> getMenuIdList = sarMenuEOService.queryRoleMenuIdList(page.getStandType() + "_STAND", null);
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
page.setMenuRoleList(getMenuIdList);
} else {
page.setMenuRoleList(null);
}
List<String> ids = sarMenuEOService.getChildMenuList(page.getMenuId());
if (ids != null && !ids.isEmpty()) {
page.setMenuAllChildrenIdList(ids);
if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())){
QueryWrapper<TsResource> qw = new QueryWrapper<>();
qw.eq("ID",page.getMenuId());
qw.isNull("PARENT_ID");
List<TsResource> children = iTsResourceService.list(qw);
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
page.setMenuRoleList(getMenuIdList);
} else {
page.setMenuRoleList(null);
}
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
if (ids != null && !ids.isEmpty()) {
page.setMenuAllChildrenIdList(ids);
}
}
}
if (org.apache.commons.lang.StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
List<SarAdvanceSearchVO> searchList = com.alibaba.fastjson.JSONObject.parseArray(page.getAdvanceSearchVOStr(), SarAdvanceSearchVO.class);
@@ -1480,14 +1580,13 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
}
}
page.setOrderBy("SAR_STANDARDS_INFO.issue_time is null,SAR_STANDARDS_INFO.issue_time desc,SAR_STANDARDS_INFO.id");
if(standardsInfoExcelVO.getUserId() != null){
page.setUserId(standardsInfoExcelVO.getUserId());
}else {
page.setUserId(LoginUserUtil.getUserId());
}
List<SarStandardsInfo> getList = dao.getSarStandardsExportInfo(page);
attrInfoShow(getList);
attrInfoShowExport(getList);
return getList;
}