Commit 27271308 by wasx8023

1.修复页面和按钮删除时报错问题

parent 6cd5c01f
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.baosight.xservices.xs.service;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.log.xeye.entity.XEyeEntity;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XEventManager;
import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.iplat4j.core.util.JudgeCircleUtils;
import com.baosight.xservices.xs.common.AuthInfoManager;
import com.baosight.xservices.xs.util.XSServiceUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
public class ServiceXSResourceGroupManage extends ServiceEPBase {
private static final Logger logger = LogManager.getLogger(ServiceXSResourceGroupManage.class);
public ServiceXSResourceGroupManage() {
}
public EiInfo insertResourceGroup(EiInfo inInfo) {
boolean ignoreDuplicate = "true".equals(inInfo.get("ignoreDuplicate"));
XSServiceUtils.apiDataHandleDecorator(inInfo);
if (inInfo.getStatus() == -1) {
return inInfo;
} else {
StringBuilder buffer = new StringBuilder();
StringBuilder detail = new StringBuilder();
List insertedResourceGroupList = new ArrayList();
EiBlock eiBlock = inInfo.getBlock("result");
int rowCount = eiBlock.getRowCount();
for(int i = 0; i < rowCount; ++i) {
Map<String, Object> inInfoRowMap = eiBlock.getRow(i);
String resourceGroupId = inInfoRowMap.get("resourceGroupId") != null ? inInfoRowMap.get("resourceGroupId").toString() : "";
if (StringUtils.isBlank(resourceGroupId)) {
resourceGroupId = UUID.randomUUID().toString().replaceAll("-", "");
}
String resourceGroupEname;
String resourceGroupCname;
try {
resourceGroupEname = inInfoRowMap.get("resourceGroupEname").toString();
resourceGroupCname = inInfoRowMap.get("resourceGroupCname").toString();
} catch (Exception var23) {
inInfo.setMsg("没有提供有效的群组英文名/中文名,请检查!");
inInfo.setStatus(-1);
return inInfo;
}
if ("".equals(resourceGroupEname) || "".equals(resourceGroupCname)) {
inInfo.setMsg("新增第" + (i + 1) + "条记录失败,资源群组英文名和中文名均不能为空\n");
inInfo.setStatus(-1);
return inInfo;
}
try {
Map paramMap = new HashMap();
paramMap.put("resourceGroupEname", resourceGroupEname.toUpperCase());
List existResourceGroup = this.dao.query("XSResourceManage.queryResourceGroup", paramMap);
if (null != existResourceGroup && existResourceGroup.size() > 0) {
if (!ignoreDuplicate) {
inInfo.setMsg("新增第" + (i + 1) + "条记录失败,该资源组信息已存在\n");
inInfo.setStatus(-1);
inInfoRowMap.put("resourceGroupId", "");
return inInfo;
}
} else {
inInfoRowMap.put("resourceGroupEname", resourceGroupEname.toUpperCase());
inInfoRowMap.put("resourceGroupId", resourceGroupId);
inInfoRowMap.put("recCreateTime", DateUtils.curDateTimeStr14());
String archiveFlag = (String)inInfoRowMap.get("archiveFlag");
if (null == archiveFlag || "".equals(archiveFlag.trim())) {
archiveFlag = "0";
inInfoRowMap.put("archiveFlag", archiveFlag);
}
String sortIndex = (String)inInfoRowMap.get("sortIndex");
if (null == sortIndex || "".equals(sortIndex.trim())) {
inInfoRowMap.put("sortIndex", 0);
}
String recRevisor = (String)inInfoRowMap.get("recRevisor");
String recReviseTime = (String)inInfoRowMap.get("recReviseTime");
if (StringUtils.isBlank(recRevisor)) {
inInfoRowMap.put("recRevisor", " ");
}
if (StringUtils.isBlank(recReviseTime)) {
inInfoRowMap.put("recReviseTime", " ");
}
this.dao.insert("XS05.insert", inInfoRowMap);
logger.info("新增第" + (i + 1) + "条记录成功\n");
Map map = new HashMap();
map.put("resourceGroupId", resourceGroupId);
List insertResourceGroupList = this.dao.query("XS05.query", map);
Map insertResourceGroupMap = (Map)insertResourceGroupList.get(0);
insertedResourceGroupList.add(insertResourceGroupMap);
XEyeEntity xEyeEntity = new XEyeEntity();
xEyeEntity.setLogId("2300");
xEyeEntity.setLogName("新增资源组");
xEyeEntity.setStatus(inInfo.getStatus() + "");
xEyeEntity.setInvokeInfo(inInfoRowMap.get("recCreator") + "在" + DateUtils.curDateStr("yyyy-MM-dd HH:mm:ss") + "新增了资源组英文名为 " + inInfoRowMap.get("resourceGroupEname") + " 的资源组信息");
xEyeEntity.set("x_xs_rgi", resourceGroupId);
xEyeEntity.set("x_xs_on", inInfoRowMap.get("recCreator"));
xEyeEntity.set("x_xs_rge", resourceGroupEname);
this.log(xEyeEntity);
}
} catch (Exception var24) {
logger.error("新增第" + (i + 1) + "条记录失败\n");
buffer.append("新增第").append(i + 1).append("条记录失败\n").append(var24.getMessage());
inInfo.setStatus(-1);
inInfoRowMap.put("resourceGroupId", "");
String errorMsg = var24.getCause() == null ? var24.getMessage() : var24.getCause().toString();
detail.append(errorMsg);
logger.error(errorMsg);
return inInfo;
}
}
buffer.append("新增").append(rowCount).append("条记录成功\n");
if (inInfo.getStatus() != -1) {
inInfo.setStatus(1);
}
inInfo.setMsg(buffer.toString());
inInfo.setDetailMsg(detail.toString());
if (insertedResourceGroupList.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("list", insertedResourceGroupList);
eiInfo.set(EiConstant.eventId, "E_XS_40");
EiInfo outInfo = XEventManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
buffer.append("新增资源组失败\n").append(outInfo.getMsg());
inInfo.setStatus(-1);
detail.append(outInfo.getDetailMsg());
}
}
return inInfo;
}
}
public EiInfo deleteResourceGroup(EiInfo inInfo) {
XSServiceUtils.apiDataHandleDecorator(inInfo);
if (inInfo.getStatus() == -1) {
return inInfo;
} else {
StringBuilder buffer = new StringBuilder();
StringBuilder detail = new StringBuilder();
List deletedResourceGroupList = new ArrayList();
EiBlock eiBlock = inInfo.getBlock("result");
int rowCount = eiBlock.getRowCount();
for(int i = 0; i < rowCount; ++i) {
Map inInfoRowMap = eiBlock.getRow(i);
String resourceGroupId;
String resourceGroupEname;
try {
resourceGroupId = inInfoRowMap.get("resourceGroupId") != null ? inInfoRowMap.get("resourceGroupId").toString().trim() : "";
resourceGroupEname = inInfoRowMap.get("resourceGroupEname") != null ? inInfoRowMap.get("resourceGroupEname").toString().trim().toUpperCase() : "";
if (StringUtils.isEmpty(resourceGroupId) && StringUtils.isEmpty(resourceGroupEname)) {
throw new PlatException("没有提供有效的群组Id或群组英文名");
}
} catch (Exception var18) {
inInfo.setMsg("没有提供有效的群组Id/英文名,请检查!");
inInfo.setStatus(-1);
return inInfo;
}
try {
HashMap map;
List resourceGroupIdList;
if (StringUtils.isEmpty(resourceGroupId) && StringUtils.isNotEmpty(resourceGroupEname)) {
map = new HashMap();
map.put("resourceGroupEname", resourceGroupEname);
resourceGroupIdList = this.dao.query("XS05.queryResourceGroupId", map);
if (null == resourceGroupIdList || resourceGroupIdList.size() <= 0) {
inInfo.setMsg("删除第" + (i + 1) + "条记录失败,群组英文名" + resourceGroupEname + "不存在!\n");
inInfo.setStatus(-1);
return inInfo;
}
HashMap resourceGroupIdMap = (HashMap)resourceGroupIdList.get(0);
resourceGroupId = resourceGroupIdMap.get("resourceGroupId").toString();
}
map = new HashMap();
map.put("resourceMemberId", resourceGroupId);
resourceGroupIdList = this.dao.query("XS06.query", map);
if (null != resourceGroupIdList && resourceGroupIdList.size() > 0) {
throw new PlatException("[" + resourceGroupEname + "]资源组是其他资源组的成员,不能删除!");
}
map.put("resourceMemberId", "");
map.put("resourceParentId", resourceGroupId);
List resourceGroupAsParents = this.dao.query("XS06.query", map);
if (null != resourceGroupAsParents && resourceGroupAsParents.size() > 0) {
throw new PlatException("[" + resourceGroupEname + "]资源组下有成员关系,不能删除!");
}
map.put("objectId", resourceGroupId);
List resourceGroupAsObjects = this.dao.query("XS07.query", map);
if (null != resourceGroupAsObjects && resourceGroupAsObjects.size() > 0) {
throw new PlatException("[" + resourceGroupEname + "]资源组存在授权关系,不能删除!");
}
Map paramMap = new HashMap();
paramMap.put("resourceGroupId", resourceGroupId);
List existResourceGroup = this.dao.query("XSResourceManage.queryResourceGroup", paramMap);
if (existResourceGroup.size() <= 0) {
throw new PlatException("没有查到resourceGroupId为" + resourceGroupId + "的数据!");
}
this.dao.delete("XS05.delete", paramMap);
deletedResourceGroupList.add(existResourceGroup);
XEyeEntity xEyeEntity = new XEyeEntity();
xEyeEntity.setLogId("2301");
xEyeEntity.setLogName("删除资源组");
xEyeEntity.setInvokeInfo(inInfoRowMap.get("recRevisor") + "在" + DateUtils.curDateStr("yyyy-MM-dd HH:mm:ss") + "删除了资源组英文名为 " + inInfoRowMap.get("resourceGroupEname") + " 的资源组信息");
xEyeEntity.setStatus(inInfo.getStatus() + "");
xEyeEntity.set("x_xs_rgi", resourceGroupId);
xEyeEntity.set("x_xs_on", inInfoRowMap.get("recCreator"));
xEyeEntity.set("x_xs_rge", inInfoRowMap.get("resourceGroupEname"));
this.log(xEyeEntity);
} catch (Exception var19) {
buffer.append("删除第").append(i + 1).append("条记录失败\n");
inInfo.setStatus(-1);
inInfo.setMsg(buffer.toString());
detail.append(var19.getMessage());
logger.error(var19.getMessage());
return inInfo;
}
}
buffer.append("删除").append(rowCount).append("条记录成功\n");
if (inInfo.getStatus() != -1) {
inInfo.setStatus(1);
}
inInfo.setMsg(buffer.toString());
inInfo.setDetailMsg(detail.toString());
if (deletedResourceGroupList.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("list", deletedResourceGroupList);
eiInfo.set(EiConstant.eventId, "E_XS_41");
EiInfo outInfo = XEventManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
buffer.append("删除资源组失败\n").append(outInfo.getMsg());
inInfo.setStatus(-1);
detail.append(outInfo.getDetailMsg());
}
}
return inInfo;
}
}
public EiInfo updateResourceGroup(EiInfo inInfo) {
XSServiceUtils.apiDataHandleDecorator(inInfo);
if (inInfo.getStatus() == -1) {
return inInfo;
} else {
StringBuffer buffer = new StringBuffer();
StringBuffer detail = new StringBuffer();
List updatedResourceGroupList = new ArrayList();
EiBlock eiBlock = inInfo.getBlock("result");
int rowCount = eiBlock.getRowCount();
HashMap paramMap = new HashMap();
for(int i = 0; i < rowCount; ++i) {
Map<String, Object> inInfoRowMap = eiBlock.getRow(i);
inInfoRowMap.put("recReviseTime", DateUtils.curDateTimeStr14());
String resourceGroupId;
String resourceGroupEname;
try {
resourceGroupId = inInfoRowMap.get("resourceGroupId") != null ? inInfoRowMap.get("resourceGroupId").toString() : "";
resourceGroupEname = inInfoRowMap.get("resourceGroupEname").toString().toUpperCase();
String resourceGroupCname = inInfoRowMap.get("resourceGroupCname").toString();
if (StringUtils.isEmpty(resourceGroupId) && StringUtils.isEmpty(resourceGroupEname)) {
throw new PlatException("没有提供有效的群组Id或群组英文名");
}
} catch (Exception var19) {
inInfo.setMsg("没有提供有效的群组Id/英文名/中文名,请检查!");
inInfo.setStatus(-1);
return inInfo;
}
try {
if (StringUtils.isEmpty(resourceGroupId) && StringUtils.isNotEmpty(resourceGroupEname)) {
Map map = new HashMap();
map.put("resourceGroupEname", resourceGroupEname);
List resourceGroupIdList = this.dao.query("XS05.queryResourceGroupId", map);
if (null == resourceGroupIdList || resourceGroupIdList.size() <= 0) {
inInfo.setMsg("修改第" + (i + 1) + "条记录失败,群组英文名" + resourceGroupEname + "不存在!\n");
inInfo.setStatus(-1);
return inInfo;
}
map = (HashMap)resourceGroupIdList.get(0);
resourceGroupId = map.get("resourceGroupId").toString();
}
paramMap.put("resourceGroupId", resourceGroupId);
List existResourceGroup = this.dao.query("XSResourceManage.queryResourceGroup", paramMap);
if (existResourceGroup.size() <= 0) {
throw new PlatException("没有查到resourceGroupId为" + resourceGroupId + "的数据!");
}
Map result = (Map)existResourceGroup.get(0);
Iterator var26 = inInfoRowMap.entrySet().iterator();
while(var26.hasNext()) {
Entry entry = (Entry)var26.next();
Object _value = entry.getValue();
if (_value != null) {
result.put(entry.getKey(), _value);
}
}
this.dao.update("XS05.update", result);
buffer.append("更新资源组:").append(eiBlock.getCell(i, "resourceGroupEname")).append(" 的记录成功\n");
Map map = new HashMap();
map.put("resourceGroupId", resourceGroupId);
List updateResourceGroupList = this.dao.query("XS05.query", map);
Map updateResourceGroupMap = (Map)updateResourceGroupList.get(0);
updatedResourceGroupList.add(updateResourceGroupMap);
XEyeEntity xEyeEntity = new XEyeEntity();
xEyeEntity.setLogId("2302");
xEyeEntity.setLogName("修改资源组");
xEyeEntity.setInvokeInfo(inInfoRowMap.get("recRevisor") + "在" + DateUtils.curDateStr("yyyy-MM-dd HH:mm:ss") + "修改了资源组英文名为 " + inInfoRowMap.get("resourceGroupEname") + " 的资源组信息");
xEyeEntity.setStatus(inInfo.getStatus() + "");
xEyeEntity.set("x_xs_rgi", resourceGroupId);
xEyeEntity.set("x_xs_on", inInfoRowMap.get("recRevisor"));
xEyeEntity.set("x_xs_rge", inInfoRowMap.get("resourceGroupEname"));
this.log(xEyeEntity);
} catch (Exception var20) {
buffer.append("更新资源组:").append(eiBlock.getCell(i, "resourceGroupEname")).append(" 的记录失败\n");
inInfo.setStatus(-1);
String errorMsg = var20.getCause() == null ? var20.getMessage().toString() : var20.getCause().toString();
detail.append(errorMsg);
logger.error(errorMsg);
}
}
if (inInfo.getStatus() != -1) {
inInfo.setStatus(1);
}
inInfo.setMsg(buffer.toString());
inInfo.setDetailMsg(detail.toString());
if (updatedResourceGroupList.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("list", updatedResourceGroupList);
eiInfo.set(EiConstant.eventId, "E_XS_42");
EiInfo outInfo = XEventManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
buffer.append("更新资源组失败\n").append(outInfo.getMsg());
inInfo.setStatus(-1);
detail.append(outInfo.getDetailMsg());
}
}
return inInfo;
}
}
public EiInfo insertResourceGroupMember(EiInfo inInfo) {
boolean ignoreDuplicate = "true".equals(inInfo.get("ignoreDuplicate"));
XSServiceUtils.apiDataHandleDecorator(inInfo);
if (inInfo.getStatus() == -1) {
return inInfo;
} else {
StringBuilder buffer = new StringBuilder();
StringBuilder detail = new StringBuilder();
List insertedMemberList = new ArrayList();
EiBlock eiBlock = inInfo.getBlock("result");
int rowCount = eiBlock.getRowCount();
for(int i = 0; i < rowCount; ++i) {
Map<String, Object> inInfoRowMap = eiBlock.getRow(i);
inInfoRowMap.put("recCreateTime", DateUtils.curDateTimeStr14());
if (inInfoRowMap.get("resourceMemberId") == null || inInfoRowMap.get("resourceParentId") == null) {
inInfoRowMap.put("resourceMemberId", "");
inInfoRowMap.put("resourceParentId", "");
}
if (inInfoRowMap.get("resourceMemberEname") == null || inInfoRowMap.get("resourceParentEname") == null) {
inInfoRowMap.put("resourceMemberEname", "");
inInfoRowMap.put("resourceParentEname", "");
}
String resourceMemberId = inInfoRowMap.get("resourceMemberId").toString();
String resourceParentId = inInfoRowMap.get("resourceParentId").toString();
String resourceMemberEname = inInfoRowMap.get("resourceMemberEname").toString().toUpperCase();
String resourceParentEname = inInfoRowMap.get("resourceParentEname").toString().toUpperCase();
String memberType = inInfoRowMap.get("memberType").toString();
HashMap rowMap;
List list;
if ("".equals(resourceMemberId) || "".equals(resourceParentId) || "".equals(memberType)) {
if ("".equals(resourceMemberEname) || "".equals(resourceParentEname) || "".equals(memberType)) {
inInfo.setMsg("新增第" + (i + 1) + "条记录失败,资源ID、资源所属组ID或者资源英文名、资源组英文名及资源类别均不能为空\n");
inInfo.setStatus(-1);
return inInfo;
}
rowMap = new HashMap();
rowMap.put("resourceGroupEname", resourceParentEname);
list = this.dao.query("XS06.queryByResourceGroupId", rowMap);
if (list != null && list.size() <= 0) {
inInfo.setMsg("新增第" + (i + 1) + "条记录失败,资源组不存在\n");
inInfo.setStatus(-1);
return inInfo;
}
resourceParentId = ((HashMap)list.get(0)).get("resourceGroupId").toString();
list.clear();
rowMap.clear();
try {
byte var18 = -1;
switch(memberType.hashCode()) {
case -973253906:
if (memberType.equals("RESOURCE_GROUP")) {
var18 = 0;
}
default:
switch(var18) {
case 0:
rowMap.put("resourceGroupEname", resourceMemberEname);
list = this.dao.query("XS06.queryByResourceGroupId", rowMap);
if (list != null && list.size() <= 0) {
throw new PlatException("新增第" + (i + 1) + "条记录失败,资源不存在\n");
}
resourceMemberId = ((HashMap)list.get(0)).get("resourceGroupId").toString();
break;
default:
rowMap.put("resourceEname", resourceMemberEname);
list = this.dao.query("XS06.queryByResourceId", rowMap);
if (list != null && list.size() <= 0) {
throw new PlatException("新增第" + (i + 1) + "条记录失败,资源不存在\n");
}
resourceMemberId = ((HashMap)list.get(0)).get("resourceId").toString();
}
}
} catch (PlatException var26) {
inInfo.setMsg(var26.getMessage());
inInfo.setStatus(-1);
return inInfo;
}
}
if (resourceMemberId.equals(resourceParentId)) {
inInfo.setMsg("新增第" + (i + 1) + "条记录失败,资源与父节点不能是同一个\n");
inInfo.setStatus(-1);
return inInfo;
}
try {
rowMap = new HashMap();
rowMap.put("resourceMemberId", resourceMemberId);
rowMap.put("resourceParentId", resourceParentId);
list = this.dao.query("XS06.query", rowMap);
if (list != null && list.size() > 0) {
if (!ignoreDuplicate) {
inInfo.setMsg("新增第" + (i + 1) + "条记录失败,该记录已存在\n");
inInfo.setStatus(-1);
inInfoRowMap.put("resourceMemberId", "");
inInfoRowMap.put("resourceParentId", "");
return inInfo;
}
} else {
inInfoRowMap.put("resourceMemberId", resourceMemberId);
inInfoRowMap.put("resourceParentId", resourceParentId);
if (JudgeCircleUtils.judgeCircle("XS06.queryParentInfo", "XS06.queryChildInfo", resourceParentId, resourceMemberId).getStatus() < 0) {
inInfo.setMsg("新增第" + (i + 1) + "条记录失败,父节点与子节点不能形成环状\n");
} else {
String archiveFlag = (String)inInfoRowMap.get("archiveFlag");
if (null == archiveFlag || "".equals(archiveFlag)) {
archiveFlag = "0";
inInfoRowMap.put("archiveFlag", archiveFlag);
}
String sortIndex = (String)inInfoRowMap.get("sortIndex");
if (null == sortIndex || "".equals(sortIndex)) {
inInfoRowMap.put("sortIndex", 0);
}
String recRevisor = (String)inInfoRowMap.get("recRevisor");
String recReviseTime = (String)inInfoRowMap.get("recReviseTime");
if (StringUtils.isBlank(recRevisor)) {
inInfoRowMap.put("recRevisor", " ");
}
if (StringUtils.isBlank(recReviseTime)) {
inInfoRowMap.put("recReviseTime", DateUtils.curDateTimeStr14());
}
inInfoRowMap.putIfAbsent("path", "");
this.dao.insert("XS06.insert", inInfoRowMap);
logger.info("新增第" + (i + 1) + "条记录成功\n");
Map map = new HashMap();
map.put("resourceMemberId", resourceMemberId);
map.put("resourceParentId", resourceParentId);
List insertMemberList = this.dao.query("XS06.query", map);
Map insertMemberMap = (Map)insertMemberList.get(0);
insertedMemberList.add(insertMemberMap);
map.put("objectId", resourceParentId);
this.dao.query("XS07.query", map);
XEyeEntity xEyeEntity = new XEyeEntity();
xEyeEntity.setLogId("2303");
xEyeEntity.setLogName("为资源组添加新成员");
xEyeEntity.setInvokeInfo(inInfoRowMap.get("recCreator") + "在" + DateUtils.curDateStr("yyyy-MM-dd HH:mm:ss") + "将 " + insertMemberMap.get("memberName") + " 添加为" + insertMemberMap.get("resourceParentName") + " 资源组的成员");
xEyeEntity.setStatus(inInfo.getStatus() + "");
xEyeEntity.set("x_xs_rmi", inInfoRowMap.get("resourceMemberId"));
xEyeEntity.set("x_xs_rpi", resourceParentId);
xEyeEntity.set("x_xs_on", inInfoRowMap.get("recCreator"));
xEyeEntity.set("x_xs_rmn", insertMemberMap.get("memberName"));
xEyeEntity.set("x_xs_rpn", insertMemberMap.get("resourceParentName"));
this.log(xEyeEntity);
}
}
} catch (Exception var27) {
logger.info("新增第" + (i + 1) + "条记录失败\n");
buffer.append("新增第").append(i + 1).append("条记录失败\n");
inInfo.setStatus(-1);
inInfoRowMap.put("resourceMemberId", "");
detail.append(var27.getMessage());
logger.error(var27.getMessage());
return inInfo;
}
}
buffer.append("新增").append(rowCount).append("条记录成功\n");
if (inInfo.getStatus() != -1) {
inInfo.setStatus(1);
}
inInfo.setMsg(buffer.toString());
inInfo.setDetailMsg(detail.toString());
if (insertedMemberList.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("list", insertedMemberList);
eiInfo.set(EiConstant.eventId, "E_XS_43");
EiInfo outInfo = XEventManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
buffer.append("新增资源组成员失败\n").append(outInfo.getMsg());
inInfo.setStatus(-1);
detail.append(outInfo.getDetailMsg());
}
AuthInfoManager.clearAuthInfo();
}
return inInfo;
}
}
public EiInfo deleteResourceGroupMember(EiInfo inInfo) {
XSServiceUtils.apiDataHandleDecorator(inInfo);
if (inInfo.getStatus() == -1) {
return inInfo;
} else {
StringBuilder buffer = new StringBuilder();
StringBuilder detail = new StringBuilder();
List deletedMemberList = new ArrayList();
EiBlock eiBlock = inInfo.getBlock("result");
int rowCount = eiBlock.getRowCount();
for(int i = 0; i < rowCount; ++i) {
Map<String, Object> inInfoRowMap = eiBlock.getRow(i);
if (inInfoRowMap.get("resourceMemberId") == null || inInfoRowMap.get("resourceParentId") == null) {
inInfoRowMap.put("resourceMemberId", "");
inInfoRowMap.put("resourceParentId", "");
continue;
}
if (inInfoRowMap.get("resourceMemberEname") == null || inInfoRowMap.get("resourceParentEname") == null) {
inInfoRowMap.put("resourceMemberEname", "");
inInfoRowMap.put("resourceParentEname", "");
}
String resourceParentId = inInfoRowMap.get("resourceParentId").toString();
String objectId = inInfoRowMap.get("resourceMemberId").toString();
String resourceMemberEname = inInfoRowMap.get("resourceMemberEname").toString().toUpperCase();
String resourceParentEname = inInfoRowMap.get("resourceParentEname").toString().toUpperCase();
String memberType = inInfoRowMap.get("memberType").toString();
HashMap rowMap;
List list;
if (StringUtils.isEmpty(resourceParentId) && StringUtils.isEmpty(objectId) && StringUtils.isNotEmpty(resourceMemberEname) && StringUtils.isNotEmpty(resourceParentEname)) {
rowMap = new HashMap();
rowMap.put("resourceGroupEname", resourceParentEname);
rowMap.put("resourceEname", resourceMemberEname);
list = this.dao.query("XS06.queryByResourceGroupId", rowMap);
if (list != null && list.size() <= 0) {
inInfo.setMsg("删除第" + (i + 1) + "条记录失败,资源组不存在\n");
inInfo.setStatus(-1);
return inInfo;
}
resourceParentId = ((HashMap)list.get(0)).get("resourceGroupId").toString();
list.clear();
rowMap.clear();
try {
byte var17 = -1;
switch(memberType.hashCode()) {
case -973253906:
if (memberType.equals("RESOURCE_GROUP")) {
var17 = 0;
}
default:
switch(var17) {
case 0:
rowMap.put("resourceGroupEname", resourceMemberEname);
list = this.dao.query("XS06.queryByResourceGroupId", rowMap);
if (list != null && list.size() <= 0) {
throw new PlatException("新增第" + (i + 1) + "条记录失败,资源不存在\n");
}
objectId = ((HashMap)list.get(0)).get("resourceGroupId").toString();
break;
default:
rowMap.put("resourceEname", resourceMemberEname);
list = this.dao.query("XS06.queryByResourceId", rowMap);
if (list != null && list.size() <= 0) {
throw new PlatException("新增第" + (i + 1) + "条记录失败,资源不存在\n");
}
objectId = ((HashMap)list.get(0)).get("resourceId").toString();
}
}
} catch (PlatException var20) {
inInfo.setMsg(var20.getMessage());
inInfo.setStatus(-1);
return inInfo;
}
}
if (!StringUtils.isNotEmpty(resourceParentId) || !StringUtils.isNotEmpty(objectId)) {
inInfo.setStatus(-1);
String errorMsg = "传入数据为空,删除失败!";
inInfo.setMsg(errorMsg);
logger.error(errorMsg);
return inInfo;
}
try {
inInfoRowMap.put("resourceMemberId", objectId);
inInfoRowMap.put("resourceParentId", resourceParentId);
rowMap = new HashMap();
rowMap.put("resourceMemberId", objectId);
rowMap.put("resourceParentId", resourceParentId);
list = this.dao.query("XS06.query", rowMap);
Map deleteMemberMap = (Map)list.get(0);
deletedMemberList.add(deleteMemberMap);
this.dao.delete("XS06.delete", inInfoRowMap);
Map map2 = new HashMap();
map2.put("objectId", resourceParentId);
this.dao.query("XS07.query", map2);
XEyeEntity xEyeEntity = new XEyeEntity();
xEyeEntity.setLogId("2304");
xEyeEntity.setLogName("解除资源组与资源的成员关系");
xEyeEntity.setInvokeInfo(inInfoRowMap.get("recRevisor") + "在" + DateUtils.curDateStr("yyyy-MM-dd HH:mm:ss") + "解除了 " + inInfoRowMap.get("memberName") + " 与" + inInfoRowMap.get("resourceParentName") + " 资源组的成员关系");
xEyeEntity.setStatus(inInfo.getStatus() + "");
xEyeEntity.set("x_xs_rmi", inInfoRowMap.get("resourceMemberId"));
xEyeEntity.set("x_xs_rpi", resourceParentId);
xEyeEntity.set("x_xs_on", inInfoRowMap.get("recCreator"));
xEyeEntity.set("x_xs_rmn", inInfoRowMap.get("memberName"));
xEyeEntity.set("x_xs_rpn", inInfoRowMap.get("resourceParentName"));
this.log(xEyeEntity);
} catch (Exception var21) {
buffer.append("删除第").append(i + 1).append("条记录失败\n");
inInfo.setStatus(-1);
inInfo.setMsg(buffer.toString());
detail.append(var21.getMessage());
logger.error(var21.getMessage());
return inInfo;
}
}
buffer.append("删除").append(rowCount).append("条记录成功\n");
if (inInfo.getStatus() != -1) {
inInfo.setStatus(1);
}
inInfo.setMsg(buffer.toString());
inInfo.setDetailMsg(detail.toString());
if (deletedMemberList.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("list", deletedMemberList);
eiInfo.set(EiConstant.eventId, "E_XS_44");
EiInfo outInfo = XEventManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
buffer.append("删除资源组成员失败\n").append(outInfo.getMsg());
inInfo.setStatus(-1);
detail.append(outInfo.getDetailMsg());
}
AuthInfoManager.clearAuthInfo();
}
return inInfo;
}
}
public EiInfo getResourceByResourceGroupEname(EiInfo eiInfo) {
String msg = "";
int status = 0;
String resourceParentId = "";
String resourceGroupEname = eiInfo.get("resourceGroupEname").toString();
try {
if (null != resourceGroupEname && !"".equals(resourceGroupEname)) {
Map map = new HashMap();
if (!"root".equals(resourceGroupEname.toLowerCase())) {
Map map1 = new HashMap();
map1.put("resourceGroupEname", resourceGroupEname);
List resourceGroupList = this.dao.query("XSResourceManage.queryResourceGroup", map1);
if (null != resourceGroupList && resourceGroupList.size() > 0) {
Map resourceGroupMap = (Map)resourceGroupList.get(0);
resourceParentId = resourceGroupMap.get("resourceGroupId").toString();
} else {
msg = "该资源组英文名不存在!";
}
} else {
resourceParentId = resourceGroupEname;
}
if (StringUtils.isNotBlank(resourceParentId)) {
map.put("resourceParentId", resourceParentId);
List list = this.dao.query("XS06.query", map);
if (list != null && list.size() > 0) {
new HashMap();
String memberType = "";
Map paramMap = new HashMap();
List resourceList = new ArrayList();
String resourceMemberId = "";
for(int i = 0; i < list.size(); ++i) {
Map infoMap = (Map)list.get(i);
resourceMemberId = infoMap.get("resourceMemberId").toString();
memberType = infoMap.get("memberType").toString();
List resourceGroupInfoList;
Map resourceInfoMap;
if (memberType.equals("RESOURCE")) {
paramMap.put("resourceId", resourceMemberId);
resourceGroupInfoList = this.dao.query("XS04.queryResource", paramMap);
if (resourceGroupInfoList != null && resourceGroupInfoList.size() > 0) {
resourceInfoMap = (Map)resourceGroupInfoList.get(0);
String resourceMemberCname = resourceInfoMap.get("resourceCname") != null ? resourceInfoMap.get("resourceCname").toString() : " ";
infoMap.put("resourceMemberCname", resourceMemberCname);
}
} else if (memberType.equals("RESOURCE_GROUP")) {
paramMap.put("resourceGroupId", resourceMemberId);
resourceGroupInfoList = this.dao.query("XS05.query", paramMap);
if (resourceGroupInfoList != null && resourceGroupInfoList.size() > 0) {
resourceInfoMap = (Map)resourceGroupInfoList.get(0);
infoMap.put("resourceGroupEname", resourceInfoMap.get("resourceGroupEname").toString());
}
}
resourceList.add(infoMap);
}
status = 1;
msg = "该节点下存在资源组或资源信息!";
eiInfo.set("result", resourceList);
} else {
msg = "该节点下没有资源组或资源信息!";
}
}
} else {
msg = "传入的资源组英文名不能为空!";
status = -1;
}
} catch (Exception var17) {
logger.error(var17.getMessage());
status = -1;
msg = var17.getMessage();
}
eiInfo.setMsg(msg);
eiInfo.setStatus(status);
return eiInfo;
}
}
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.baosight.xservices.xs.service;
import com.baosight.iplat4j.core.ei.EiBlock;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.log.xeye.entity.XEyeEntity;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import com.baosight.iplat4j.core.service.soa.XEventManager;
import com.baosight.iplat4j.core.service.soa.XServiceManager;
import com.baosight.iplat4j.core.util.DateUtils;
import com.baosight.xservices.xs.util.XSServiceUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ServiceXSResourceManage extends ServiceEPBase {
private static final Logger logger = LogManager.getLogger(ServiceXSResourceManage.class);
public ServiceXSResourceManage() {
}
public EiInfo insertResource(EiInfo inInfo) {
boolean ignoreDuplicate = "true".equals(inInfo.get("ignoreDuplicate"));
XSServiceUtils.apiDataHandleDecorator(inInfo);
if (inInfo.getStatus() == -1) {
return inInfo;
} else {
StringBuilder buffer = new StringBuilder();
StringBuilder detail = new StringBuilder();
List insertedResourceList = new ArrayList();
EiBlock eiBlock = inInfo.getBlock("result");
int rowCount = eiBlock.getRowCount();
for(int i = 0; i < rowCount; ++i) {
Map<String, Object> inInfoRowMap = eiBlock.getRow(i);
String resourceEname = (String)inInfoRowMap.get("resourceEname");
String type = (String)inInfoRowMap.get("type");
String recCreator = (String)inInfoRowMap.get("recCreator");
if (null == resourceEname || null == type || null == recCreator || "".equals(resourceEname) || "".equals(type) || "".equals(recCreator)) {
inInfo.setMsg("新增第" + (i + 1) + "条记录失败,资源英文名,类型,创建者均不能为空\n");
inInfo.setStatus(-1);
return inInfo;
}
try {
Map paramMap = new HashMap();
paramMap.put("resourceEname", resourceEname);
List existResource = this.dao.query("XSResourceManage.queryResource", paramMap);
if (null != existResource && existResource.size() > 0) {
if (!ignoreDuplicate) {
inInfo.setMsg("新增第" + (i + 1) + "条记录失败,该资源信息已存在\n");
inInfo.setStatus(-1);
return inInfo;
}
} else {
String resourceId = inInfoRowMap.get("resourceId") != null ? inInfoRowMap.get("resourceId").toString() : "";
if (!StringUtils.isNotEmpty(resourceId) || resourceId.equals(" ")) {
resourceId = XSServiceUtils.getUUID();
inInfoRowMap.put("resourceId", resourceId);
}
inInfoRowMap.put("recCreateTime", DateUtils.curDateTimeStr14());
inInfoRowMap.put("isAuth", "0");
String archiveFlag = (String)inInfoRowMap.get("archiveFlag");
if (null == archiveFlag || "".equals(archiveFlag)) {
archiveFlag = "0";
inInfoRowMap.put("archiveFlag", archiveFlag);
}
String sortIndex = (String)inInfoRowMap.get("sortIndex");
if (StringUtils.isBlank(sortIndex)) {
inInfoRowMap.put("sortIndex", 0);
}
String recRevisor = (String)inInfoRowMap.get("recRevisor");
String recReviseTime = (String)inInfoRowMap.get("recReviseTime");
if (!"".equals(recRevisor)) {
inInfoRowMap.put("recRevisor", " ");
}
if (!"".equals(recReviseTime)) {
inInfoRowMap.put("recReviseTime", " ");
}
this.dao.insert("XS04.insert", inInfoRowMap);
Map map = new HashMap();
map.put("resourceId", resourceId);
List insertResourceList = this.dao.query("XS04.query", map);
Map insertResourceMap = (Map)insertResourceList.get(0);
insertedResourceList.add(insertResourceMap);
XEyeEntity xEyeEntity = new XEyeEntity();
xEyeEntity.setLogId("2000");
xEyeEntity.setLogName("新增资源");
xEyeEntity.setInvokeInfo(recCreator + "在" + DateUtils.curDateStr("yyyy-MM-dd HH:mm:ss") + "调用接口新增了资源名为 " + resourceEname + " 的资源信息");
xEyeEntity.setStatus(inInfo.getStatus() + "");
xEyeEntity.set("x_xs_ri", resourceId);
xEyeEntity.set("x_xs_on", recCreator);
xEyeEntity.set("x_xs_re", resourceEname);
this.log(xEyeEntity);
}
} catch (Exception var24) {
buffer.append("新增第").append(i + 1).append("条记录失败\n").append(var24.getMessage());
inInfo.setStatus(-1);
inInfoRowMap.put("resourceId", "");
detail.append(var24.getMessage());
logger.error(var24.getMessage());
inInfo.setMsg(buffer.toString());
inInfo.setDetailMsg(detail.toString());
return inInfo;
}
}
buffer.append("新增").append(rowCount).append("条记录成功\n");
inInfo.setMsg(buffer.toString());
inInfo.setDetailMsg(detail.toString());
if (insertedResourceList.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("list", insertedResourceList);
eiInfo.set(EiConstant.eventId, "E_XS_23");
EiInfo outInfo = XEventManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
buffer.append("新增资源失败\n").append(outInfo.getMsg());
inInfo.setStatus(-1);
detail.append(outInfo.getDetailMsg());
}
}
return inInfo;
}
}
public EiInfo updateResource(EiInfo inInfo) {
boolean ignoreDuplicate = "true".equals(inInfo.get("ignoreDuplicate"));
XSServiceUtils.apiDataHandleDecorator(inInfo);
if (inInfo.getStatus() == -1) {
return inInfo;
} else {
StringBuilder builder = new StringBuilder();
StringBuilder detail = new StringBuilder();
List updatedResourceList = new ArrayList();
List insertedResourceList = new ArrayList();
EiBlock eiBlock = inInfo.getBlock("result");
int rowCount = eiBlock.getRowCount();
for(int i = 0; i < rowCount; ++i) {
Map inInfoRowMap = eiBlock.getRow(i);
String resourceEname = (String)inInfoRowMap.get("resourceEname");
String recRevisor = (String)inInfoRowMap.get("recRevisor");
String type = (String)inInfoRowMap.get("type");
if (null == resourceEname || null == type || null == recRevisor || "".equals(resourceEname) || "".equals(type) || "".equals(recRevisor)) {
inInfo.setStatus(-1);
inInfo.setMsg("传入的资源英文名,资源类型与修改人均不能为空!");
return inInfo;
}
try {
Map paramMap = new HashMap();
paramMap.put("resourceEname", resourceEname);
List existResource = this.dao.query("XSResourceManage.queryResource", paramMap);
if (null != existResource && existResource.size() > 0) {
if (!ignoreDuplicate) {
builder.append(resourceEname + " 的资源信息已存在\n");
Map existMap = (Map)existResource.get(0);
existMap.put("recReviseTime", DateUtils.curDateTimeStr14());
existMap.put("recRevisor", recRevisor);
this.dao.update("XS04.update", existMap);
Map map = new HashMap();
map.put("resourceId", existMap.get("id"));
List updateResourceList = this.dao.query("XS04.query", map);
Map updateResourceMap = (Map)updateResourceList.get(0);
updatedResourceList.add(updateResourceMap);
XEyeEntity xEyeEntity = new XEyeEntity();
xEyeEntity.setLogId("2002");
xEyeEntity.setLogName("修改资源");
xEyeEntity.setInvokeInfo(recRevisor + "在" + DateUtils.curDateStr("yyyy-MM-dd HH:mm:ss") + "调用接口修改了资源名为 " + inInfoRowMap.get("resourceEname") + " 的资源信息");
xEyeEntity.setStatus(inInfo.getStatus() + "");
xEyeEntity.set("x_xs_ri", existMap.get("resourceId"));
xEyeEntity.set("x_xs_re", inInfoRowMap.get("resourceEname"));
xEyeEntity.set("x_xs_on", recRevisor);
this.log(xEyeEntity);
}
} else {
String resourceId = inInfoRowMap.get("resourceId") != null ? inInfoRowMap.get("resourceId").toString() : "";
if (!StringUtils.isNotEmpty(resourceId)) {
resourceId = XSServiceUtils.getUUID();
inInfoRowMap.put("resourceId", resourceId);
}
inInfoRowMap.put("recCreateTime", DateUtils.curDateTimeStr14());
inInfoRowMap.put("isAuth", "0");
String archiveFlag = (String)inInfoRowMap.get("archiveFlag");
if (null == archiveFlag || "".equals(archiveFlag)) {
archiveFlag = "0";
inInfoRowMap.put("archiveFlag", archiveFlag);
}
String sortIndex = (String)inInfoRowMap.get("sortIndex");
if (StringUtils.isBlank(sortIndex)) {
inInfoRowMap.put("sortIndex", 0);
}
inInfoRowMap.put("recRevisor", " ");
inInfoRowMap.put("recCreator", recRevisor);
String recReviseTime = (String)inInfoRowMap.get("recReviseTime");
if (!"".equals(recReviseTime)) {
inInfoRowMap.put("recReviseTime", " ");
}
this.dao.insert("XS04.insert", inInfoRowMap);
Map map = new HashMap();
map.put("resourceId", resourceId);
List insertResourceList = this.dao.query("XS04.query", map);
Map insertResourceMap = (Map)insertResourceList.get(0);
insertedResourceList.add(insertResourceMap);
builder.append("同步").append(resourceEname).append("的资源信息成功");
XEyeEntity xEyeEntity = new XEyeEntity();
xEyeEntity.setLogId("2000");
xEyeEntity.setLogName("新增资源");
xEyeEntity.setInvokeInfo(recRevisor + "在" + DateUtils.curDateStr("yyyy-MM-dd HH:mm:ss") + "调用接口新增了资源名为 " + inInfoRowMap.get("resourceEname") + " 的资源信息");
xEyeEntity.setStatus(inInfo.getStatus() + "");
xEyeEntity.set("x_xs_ri", resourceId);
xEyeEntity.set("x_xs_on", recRevisor);
xEyeEntity.set("x_xs_re", resourceEname);
this.log(xEyeEntity);
}
} catch (Exception var24) {
builder.append("同步").append(resourceEname).append(" 的资源信息失败\n");
inInfo.setStatus(-1);
detail.append(var24.getMessage());
logger.error(var24.getMessage());
}
}
inInfo.setMsg(builder.toString());
inInfo.setDetailMsg(detail.toString());
EiInfo eiInfo;
EiInfo outInfo;
if (insertedResourceList.size() > 0) {
eiInfo = new EiInfo();
eiInfo.set("list", insertedResourceList);
eiInfo.set(EiConstant.eventId, "E_XS_23");
outInfo = XEventManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
builder.append("新增资源失败\n").append(outInfo.getMsg());
inInfo.setStatus(-1);
detail.append(outInfo.getDetailMsg());
}
}
if (updatedResourceList.size() > 0) {
eiInfo = new EiInfo();
eiInfo.set("list", updatedResourceList);
eiInfo.set(EiConstant.eventId, "E_XS_25");
outInfo = XEventManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
builder.append("更新资源失败\n").append(outInfo.getMsg());
inInfo.setStatus(-1);
detail.append(outInfo.getDetailMsg());
}
}
return inInfo;
}
}
public EiInfo deleteResource(EiInfo inInfo) {
XSServiceUtils.apiDataHandleDecorator(inInfo);
if (inInfo.getStatus() == -1) {
return inInfo;
} else {
StringBuilder builder = new StringBuilder();
StringBuilder detail = new StringBuilder();
List deletedResourceList = new ArrayList();
EiBlock eiBlock = inInfo.getBlock("result");
int rowCount = eiBlock.getRowCount();
for(int i = 0; i < rowCount; ++i) {
Map inInfoRowMap = eiBlock.getRow(i);
String resourceEname = (String)inInfoRowMap.get("resourceEname");
String recRevisor = (String)inInfoRowMap.get("recRevisor");
if (null == resourceEname || "".equals(resourceEname) || null == recRevisor || "".equals(recRevisor)) {
inInfo.setStatus(-1);
inInfo.setMsg("传入的资源英文名与修改人不能为空!");
return inInfo;
}
Map paramMap = new HashMap();
paramMap.put("resourceEname", resourceEname);
try {
List resourceList = this.dao.query("XSResourceManage.queryResource", paramMap);
if (resourceList.size() < 1) {
builder.append("不存在 ").append(resourceEname).append(" 的资源信息\n");
} else {
Map resourceMap = (Map)resourceList.get(0);
String resourceId = (String)resourceMap.get("resourceId");
if (null != resourceId && !"".equals(resourceId)) {
inInfoRowMap.put("resourceId", resourceId);
EiInfo eiInfo = new EiInfo();
eiInfo.set(EiConstant.serviceId, "S_XS_27");
EiBlock block = new EiBlock("result");
eiInfo.setBlock(block);
Map map = new HashMap();
map.put("resourceMemberId", resourceId);
List resourceAsMembers = this.dao.query("XS06.query", map);
if (null != resourceAsMembers && resourceAsMembers.size() > 0) {
block.setRows(resourceAsMembers);
EiInfo outInfo = XServiceManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
inInfo.setMsg(outInfo.getMsg());
inInfo.setStatus(-1);
return inInfo;
}
}
map.put("subjectId", "");
map.put("objectId", resourceId);
List resourceAsObjects = this.dao.query("XS07.query", map);
if (null != resourceAsObjects && resourceAsObjects.size() > 0) {
block.setRows(resourceAsObjects);
eiInfo.set(EiConstant.serviceId, "S_XS_26");
EiInfo outInfo = XServiceManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
inInfo.setMsg(outInfo.getMsg());
inInfo.setStatus(-1);
return inInfo;
}
}
map.put("authResourceId", resourceId);
List resourceAsDataObjects = this.dao.query("XS10.query", map);
eiInfo.set(EiConstant.serviceId, "S_XS_31");
if (null != resourceAsDataObjects && resourceAsDataObjects.size() > 0) {
block.setRows(resourceAsDataObjects);
EiInfo outInfo = XServiceManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
inInfo.setMsg(outInfo.getMsg());
inInfo.setStatus(-1);
return inInfo;
}
}
this.dao.delete("XS04.delete", inInfoRowMap);
deletedResourceList.add(resourceMap);
builder.append("删除资源:").append(resourceEname).append("的信息成功!\n");
XEyeEntity xEyeEntity = new XEyeEntity();
xEyeEntity.setLogId("2001");
xEyeEntity.setLogName("删除资源");
xEyeEntity.setInvokeInfo(recRevisor + "在" + DateUtils.curDateStr("yyyy-MM-dd HH:mm:ss") + "调用接口删除了资源名为 " + inInfoRowMap.get("resourceEname") + " 的资源信息");
xEyeEntity.setStatus(inInfo.getStatus() + "");
xEyeEntity.set("x_xs_ri", resourceId);
xEyeEntity.set("x_xs_on", recRevisor);
xEyeEntity.set("x_xs_re", inInfoRowMap.get("resourceEname"));
this.log(xEyeEntity);
} else {
builder.append("不存在 ").append(resourceEname).append(" 的资源信息\n");
}
}
} catch (Exception var22) {
builder.append("删除资源:").append(resourceEname).append("的信息失败!\n");
inInfo.setStatus(-1);
detail.append(var22.getMessage());
logger.error(var22.getMessage());
}
}
inInfo.setMsg(builder.toString());
inInfo.setDetailMsg(detail.toString());
if (deletedResourceList.size() > 0) {
EiInfo eiInfo = new EiInfo();
eiInfo.set("list", deletedResourceList);
eiInfo.set(EiConstant.eventId, "E_XS_24");
EiInfo outInfo = XEventManager.call(eiInfo);
if (outInfo.getStatus() < 0) {
builder.append("删除资源失败\n").append(outInfo.getMsg());
inInfo.setStatus(-1);
detail.append(outInfo.getDetailMsg());
}
}
return inInfo;
}
}
public EiInfo getResourceInfo(EiInfo inInfo) {
String msg = "";
int status = -1;
List resourceList = new ArrayList();
Integer size = 0;
try {
String resourceEname = inInfo.getString("resourceEname");
String resourceCname = inInfo.getString("resourceCname");
String type = inInfo.getString("type");
Map resourceMap = new HashMap();
if (StringUtils.isNotEmpty(resourceEname)) {
resourceMap.put("resourceEname", resourceEname);
}
if (StringUtils.isNotEmpty(resourceCname)) {
resourceMap.put("resourceCname", resourceCname);
}
if (StringUtils.isNotEmpty(type)) {
resourceMap.put("type", type);
}
resourceList = this.dao.query("XS04.queryResource", resourceMap);
size = ((List)resourceList).size();
status = 1;
msg = "查询成功!";
} catch (Exception var10) {
msg = var10.getCause().toString();
}
EiInfo outInfo = new EiInfo();
outInfo.setMsg(msg);
outInfo.setStatus(status);
outInfo.set("result", resourceList);
outInfo.set("size", size);
return outInfo;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment