Commit 0ee83985 by wuchao

新版本

parent 66012e05
package com.chenyang.nse.bussiness.commmon;
public interface Constant {
String DBTYPE_KAFKA = "KAFKA";
String DBTYPE_HIVE_TDH = "HIVE_TDH";
int CONFIG_DOWNLOAD_OFFLINE = 1;
int CONFIG_DOWNLOAD_ONLINE = 0;
String COLON = ":";
String CONNECT_IDENTIFIER = "|||";
String ORACLE_SID_FLAG = "1";
int CONFIG_DOWNLOAD_MAP = 1;
String COMPLETE = "5";
String RUNNING = "-1";
String FAIL = "4";
}
package com.chenyang.nse.bussiness.commmon;
import com.chenyang.nse.bussiness.commmon.json.RespHelper;
import com.chenyang.nse.bussiness.exception.ClientOutOfWhiteListException;
import com.chenyang.nse.bussiness.exception.CustomException;
import com.chenyang.nse.bussiness.exception.TokenException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.BindException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice
public class ControllerExceptionAdvice {
static final Logger logger = LoggerFactory.getLogger(ControllerExceptionAdvice.class);
@ExceptionHandler
@ResponseBody
public Object exceptionHandler(Exception e) {
logger.error("", e);
return RespHelper.exceptionResp(e);
}
@ExceptionHandler
@ResponseBody
public Object exceptionHandler(BindException e) {
logger.error("", e);
return RespHelper.paramErrResp();
}
@ExceptionHandler
@ResponseBody
public Object exceptionHandler(TokenException e) {
logger.error("", e);
return RespHelper.createResptoken();
}
@ExceptionHandler
@ResponseBody
public Object exceptionHandler(ClientOutOfWhiteListException e) {
logger.error("", e);
return RespHelper.createRespOutOfWhiteList();
}
@ExceptionHandler
@ResponseBody
public Object exceptionHandler(CustomException e) {
logger.error("custom error", e);
return RespHelper.createResp(e.getCode(), e.getMsg());
}
}
package com.chenyang.nse.bussiness.common;
public interface Constant {
String DBTYPE_KAFKA = "KAFKA";
String DBTYPE_HIVE_TDH = "HIVE_TDH";
}
package com.chenyang.nse.bussiness.controller.console;
import com.chenyang.nse.bussiness.entity.cache.LoginUser;
import com.chenyang.nse.bussiness.entity.orm.table.base.TBaseMenu;
import com.chenyang.nse.bussiness.entity.orm.table.base.TBaseRole;
import com.chenyang.nse.bussiness.service.console.ConsoleService;
import com.chenyang.nse.bussiness.tools.object.JsonTool;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping({"/console"})
public class ConsoleController {
@Autowired
private ConsoleService consoleService;
@RequestMapping({"/"})
public String console(HttpServletRequest request, HttpServletResponse response, Model model) {
return "console/index";
}
@RequestMapping({"/top"})
public String top(HttpServletRequest request, HttpServletResponse response, Model model) {
return "console/top";
}
@RequestMapping({"/bottom"})
public String bottom(HttpServletRequest request, HttpServletResponse response, Model model) {
return "console/bottom";
}
@RequestMapping({"/initMenu"})
public String initMenu(HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
LoginUser loginUser = (LoginUser)request.getSession().getAttribute("loginUser");
Object menuNeedRefresh = request.getSession().getAttribute("menuNeedRefresh");
if (menuNeedRefresh != null && (Boolean)menuNeedRefresh) {
List<TBaseRole> trole = loginUser.getTrole();
List<TBaseMenu> menus = new ArrayList();
for(TBaseRole role : trole) {
String roleId = role.getId();
menus.addAll(this.consoleService.qeuryMenusByRoleId(roleId));
}
loginUser.setMenus(menus);
request.getSession().setAttribute("menuNeedRefresh", false);
}
String menu_json = JsonTool.toJsonString(loginUser.getMenus());
if (menu_json == null) {
return null;
} else {
model.addAttribute("menu", menu_json);
return "console/left";
}
}
}
package com.chenyang.nse.bussiness.controller.core;
import com.chenyang.nse.bussiness.commmon.json.RespHelper;
import com.chenyang.nse.bussiness.commmon.json.Response;
import com.chenyang.nse.bussiness.dao.PageInfo;
import com.chenyang.nse.bussiness.entity.vo.ControlledAssertVO;
import com.chenyang.nse.bussiness.service.core.ControlledAssetService;
import com.chenyang.nse.bussiness.tools.login.CommonUtils;
import com.chenyang.nse.bussiness.tools.msg.MesUtil;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@EnableAsync
@Controller
@RequestMapping({"/core/controlledasset"})
public class ControlledAssetController {
private static Logger logger = LoggerFactory.getLogger(ControlledAssetController.class);
@Autowired
private ControlledAssetService controlledAssetService;
private static final Logger ddmauditLogger = LoggerFactory.getLogger("ddmauditLogger");
private static final Logger operationLogger = LoggerFactory.getLogger("operationLogger");
@RequestMapping({"/query"})
@ResponseBody
public Response query(@RequestParam Map<String, String> params, Integer pageno, Integer pagesize, PageInfo pageInfo, HttpServletRequest request, HttpServletResponse response, Model model) {
pageInfo.setPageno(pageno);
pageInfo.setPagesize(pagesize);
List<ControlledAssertVO> list = this.controlledAssetService.queryControlledAsset(pageInfo, params);
ddmauditLogger.info(MesUtil.getMsg("DDM_01302", new String[]{CommonUtils.loginUsername(), CommonUtils.loginUsername()}));
return RespHelper.updateResp(pageInfo, list);
}
@RequestMapping({"/initEdit"})
@ResponseBody
public Response<ControlledAssertVO> initControlledAsset(@RequestParam Map<String, String> params) {
String id = String.valueOf(params.get("id"));
ddmauditLogger.info(MesUtil.getMsg("DDM_01304", new String[]{CommonUtils.loginUsername(), CommonUtils.loginUsername()}));
if (id != null && id.toString().length() != 0) {
ControlledAssertVO assertVO = this.controlledAssetService.initControlledAsset(id);
return RespHelper.<ControlledAssertVO>successResp(assertVO);
} else {
return RespHelper.<ControlledAssertVO>paramErrResp();
}
}
@PostMapping({"/add"})
@ResponseBody
public Response<ControlledAssertVO> addControlledAsset(@RequestBody ControlledAssertVO controlledAssertVO, HttpServletRequest request) {
if (StringUtils.isBlank(controlledAssertVO.getId()) && !ObjectUtils.isEmpty(this.controlledAssetService.queryByName(controlledAssertVO.getName()))) {
return RespHelper.<ControlledAssertVO>createResp(false, "POP_00026", MesUtil.getMsg("POP_00026", new String[0]));
} else {
if (StringUtils.isBlank(controlledAssertVO.getId())) {
ddmauditLogger.info(MesUtil.getMsg("DDM_01304", new String[]{CommonUtils.loginUsername(), controlledAssertVO.getName()}));
} else {
ddmauditLogger.info(MesUtil.getMsg("DDM_01303", new String[]{CommonUtils.loginUsername(), controlledAssertVO.getName()}));
}
this.controlledAssetService.addControlledAsset(controlledAssertVO, request);
return RespHelper.<ControlledAssertVO>successResp(controlledAssertVO);
}
}
@PostMapping({"/del"})
@ResponseBody
public Response remove(@RequestBody Map<String, Object> params, HttpServletRequest request, HttpServletResponse response, Model model) {
String id = (String)params.get("id");
String name = (String)params.get("name");
ddmauditLogger.info(MesUtil.getMsg("DDM_01305", new String[]{CommonUtils.loginUsername(), name}));
this.controlledAssetService.remove(id);
this.controlledAssetService.deleteAreaByAssetid(id);
this.controlledAssetService.deleteRuleByAssetid(id);
return RespHelper.successResp();
}
}
package com.chenyang.nse.bussiness.controller.core;
import com.chenyang.nse.bussiness.entity.cache.LoginUser;
import com.chenyang.nse.bussiness.entity.orm.table.base.TBaseMenu;
import com.chenyang.nse.bussiness.entity.orm.table.base.TBaseRole;
import com.chenyang.nse.bussiness.enumeration.EroleFlag;
import com.chenyang.nse.bussiness.service.core.CoreService;
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping({"/core"})
public class CoreController {
@Autowired
private CoreService coreService;
@RequestMapping({"/index"})
public String index(HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
Object obj = request.getSession().getAttribute("loginUser");
if (null == obj) {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String ser = request.getServletPath();
String url = request.getRequestURL().toString();
String s = url.split(ser)[0];
String js = "<script type=\"text/javascript\">top.location.href='" + s + "';</script>";
out.println(js);
}
return "core/core_index";
}
@RequestMapping({"/top"})
public String top(HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
return "include/core_top";
}
@RequestMapping({"/bottom"})
public String bottom(HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
return "include/core_bottom";
}
@RequestMapping({"/navigation"})
public String navigation(HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {
LoginUser loginUser = (LoginUser)request.getSession().getAttribute("loginUser");
List<TBaseRole> roles = loginUser.getTrole();
EroleFlag ef = EroleFlag.getEroleFlagByFlag(((TBaseRole)roles.get(0)).getFlag());
loginUser.setFlag(ef.getFlag());
loginUser.setPrefix(ef.getCode());
if (ef == EroleFlag.USER) {
List<TBaseMenu> menus = loginUser.getMenus();
model.addAttribute("menus", menus);
}
return "include/core_navigation";
}
@RequestMapping({"/datasystemreport"})
@ResponseBody
public List<Map> datasystemreport(HttpServletRequest request, HttpServletResponse response, Model model) {
List<Map> list = this.coreService.datasystemreport();
return list;
}
@RequestMapping({"/sensitivedatareport"})
@ResponseBody
public List<Map> sensitivedatareport(HttpServletRequest request, HttpServletResponse response, Model model) {
List<Map> list = this.coreService.sensitivedatareport();
return list;
}
@RequestMapping({"/maskingefficiencyreport"})
@ResponseBody
public Map maskingefficiencyreport(HttpServletRequest request, HttpServletResponse response, Model model) {
Map map = this.coreService.maskingefficiencyreport();
return map;
}
@RequestMapping({"/maskingrulereport"})
@ResponseBody
public List<Map> maskingrulereport(HttpServletRequest request, HttpServletResponse response, Model model) {
List<Map> list = this.coreService.maskingrulereport();
return list;
}
}
package com.chenyang.nse.bussiness.dao.core;
import com.chenyang.nse.bussiness.dao.BaseDao;
import com.chenyang.nse.bussiness.tools.xml.XmlTool;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.hibernate.transform.Transformers;
import org.springframework.stereotype.Repository;
@Repository
public class CoreDao extends BaseDao<Object, String> {
public List<Map> dataSystemReport() {
String sql = XmlTool.getSql("core", "dataSystemReport");
List<Map> list = this.getSession().createNativeQuery(sql).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).getResultList();
return list;
}
public List<Map> sensitiveDataReport() {
String sql = XmlTool.getSql("core", "sensitiveDataReport");
List<Map> list = this.getSession().createNativeQuery(sql).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).getResultList();
return list;
}
public List<Map> maskingRuleReport() {
String sql = XmlTool.getSql("core", "maskingRuleReport");
List<Map> list = this.getSession().createNativeQuery(sql).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).getResultList();
return list;
}
public Map maskingEfficiencyReport() {
String sql_row = XmlTool.getSql("core", "maskingTotalRow");
String sql_time = XmlTool.getSql("core", "maskingTotalTime");
String totalrow = "0";
String totaltime = "0";
try {
totalrow = this.getSession().createNativeQuery(sql_row).uniqueResult().toString();
totaltime = this.getSession().createNativeQuery(sql_time).uniqueResult().toString();
} catch (Exception var6) {
}
Map map = new HashMap();
map.put("totalrow", totalrow);
map.put("totaltime", totaltime);
return map;
}
}
package com.chenyang.nse.bussiness.dao.table.core.controlled;
import com.chenyang.nse.bussiness.dao.BaseDao;
import com.chenyang.nse.bussiness.entity.orm.table.core.TCoreControlledAsset;
import com.chenyang.nse.bussiness.entity.vo.ControlledAssertVO;
import java.util.List;
import java.util.Map;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.hibernate.transform.Transformers;
import org.springframework.stereotype.Repository;
@Repository
public class ControlledAssetDao extends BaseDao<TCoreControlledAsset, String> {
static final String CACHE_NAME = "tcoredesensitization";
public List<ControlledAssertVO> queryAssertbyId(String id) {
String sql = "SELECT u.id as id,u.name, u.type, u.datasourceid, u.datasourcename, u.dbtype, u.business, u.note FROM t_core_controlled_asset u where u.id = :id";
return this.getSession().createNativeQuery(sql).setParameter("id", id).setResultTransformer(Transformers.aliasToBean(ControlledAssertVO.class)).getResultList();
}
public TCoreControlledAsset queryByName(String name) {
Criterion cusername = Restrictions.eq("name", name);
return (TCoreControlledAsset)this.queryUnique(new Criterion[]{cusername});
}
public TCoreControlledAsset queryByDatasourceid(String datasourceid) {
Criterion cusername = Restrictions.eq("datasourceid", datasourceid);
return (TCoreControlledAsset)this.queryUnique(new Criterion[]{cusername});
}
public List<Map<String, Object>> queryAreaNum2RuleNum() {
String sql = "select b.id, count(b.areaId) as areanum, count(b.ruleId) as rulenum from ( SELECT u.id AS id,a.id as areaId,r.id as ruleId FROM t_core_controlled_asset u LEFT JOIN t_core_controlled_asset_area a ON u.id = a.assetid LEFT JOIN t_core_controlled_asset_rule r ON u.id = r.assetid ) b group by b.id ";
List<Map<String, Object>> vo = this.getSession().createNativeQuery(sql).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).getResultList();
return vo;
}
}
package com.chenyang.nse.bussiness.engine.infa.basic.xmlbean;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"variable", "connectiontype", "connectionsubtype", "connectionnumber", "connectionname", "cnxrefname", "attribute"}
)
@XmlRootElement(
name = "CONNECTIONREFERENCE"
)
public class CONNECTIONREFERENCE {
@XmlAttribute(
name = "CNXREFNAME",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String cnxrefname;
@XmlAttribute(
name = "CONNECTIONTYPE",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String connectiontype;
@XmlAttribute(
name = "CONNECTIONSUBTYPE",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String connectionsubtype;
@XmlAttribute(
name = "CONNECTIONNUMBER",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String connectionnumber;
@XmlAttribute(
name = "CONNECTIONNAME",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String connectionname;
@XmlAttribute(
name = "PARTITIONNAME"
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String partitionname;
@XmlAttribute(
name = "VARIABLE"
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String variable;
@XmlAttribute(
name = "COMPONENTVERSION"
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String componentversion;
@XmlElement(
name = "ATTRIBUTE"
)
protected List<ATTRIBUTE> attribute;
public String getCNXREFNAME() {
return this.cnxrefname;
}
public void setCNXREFNAME(String value) {
this.cnxrefname = value;
}
public String getCONNECTIONTYPE() {
return this.connectiontype;
}
public void setCONNECTIONTYPE(String value) {
this.connectiontype = value;
}
public String getCONNECTIONSUBTYPE() {
return this.connectionsubtype;
}
public void setCONNECTIONSUBTYPE(String value) {
this.connectionsubtype = value;
}
public String getCONNECTIONNUMBER() {
return this.connectionnumber;
}
public void setCONNECTIONNUMBER(String value) {
this.connectionnumber = value;
}
public String getCONNECTIONNAME() {
return this.connectionname;
}
public void setCONNECTIONNAME(String value) {
this.connectionname = value;
}
public String getPARTITIONNAME() {
return this.partitionname;
}
public void setPARTITIONNAME(String value) {
this.partitionname = value;
}
public String getVARIABLE() {
return this.variable;
}
public void setVARIABLE(String value) {
this.variable = value;
}
public String getCOMPONENTVERSION() {
return this.componentversion;
}
public void setCOMPONENTVERSION(String value) {
this.componentversion = value;
}
public List<ATTRIBUTE> getATTRIBUTE() {
if (this.attribute == null) {
this.attribute = new ArrayList();
}
return this.attribute;
}
}
package com.chenyang.nse.bussiness.engine.infa.basic.xmlbean;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"toinstancetype", "toinstance", "tofield", "frominstancetype", "frominstance", "fromfield"}
)
@XmlRootElement(
name = "CONNECTOR"
)
public class CONNECTOR {
@XmlAttribute(
name = "FROMINSTANCE",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String frominstance;
@XmlAttribute(
name = "FROMINSTANCETYPE",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String frominstancetype;
@XmlAttribute(
name = "FROMFIELD",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String fromfield;
@XmlAttribute(
name = "TOINSTANCE",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String toinstance;
@XmlAttribute(
name = "TOINSTANCETYPE",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String toinstancetype;
@XmlAttribute(
name = "TOFIELD",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String tofield;
public String getFROMINSTANCE() {
return this.frominstance;
}
public void setFROMINSTANCE(String value) {
this.frominstance = value;
}
public String getFROMINSTANCETYPE() {
return this.frominstancetype;
}
public void setFROMINSTANCETYPE(String value) {
this.frominstancetype = value;
}
public String getFROMFIELD() {
return this.fromfield;
}
public void setFROMFIELD(String value) {
this.fromfield = value;
}
public String getTOINSTANCE() {
return this.toinstance;
}
public void setTOINSTANCE(String value) {
this.toinstance = value;
}
public String getTOINSTANCETYPE() {
return this.toinstancetype;
}
public void setTOINSTANCETYPE(String value) {
this.toinstancetype = value;
}
public String getTOFIELD() {
return this.tofield;
}
public void setTOFIELD(String value) {
this.tofield = value;
}
}
package com.chenyang.nse.bussiness.engine.infa.basic.xmlbean;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = ""
)
@XmlRootElement(
name = "CONWFRUNINFO"
)
public class CONWFRUNINFO {
@XmlAttribute(
name = "CONWFRUNINSTNAME"
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String conwfruninstname;
@XmlAttribute(
name = "CONWFPARAMFILE"
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String conwfparamfile;
public String getCONWFRUNINSTNAME() {
return this.conwfruninstname;
}
public void setCONWFRUNINSTNAME(String value) {
this.conwfruninstname = value;
}
public String getCONWFPARAMFILE() {
return this.conwfparamfile;
}
public void setCONWFPARAMFILE(String value) {
this.conwfparamfile = value;
}
}
package com.chenyang.nse.bussiness.engine.infa.powercenter961.maskdata;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.ATTRIBUTE;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.CONFIG;
import java.util.ArrayList;
import java.util.List;
public class Configutil {
public static CONFIG getConfig() throws Exception {
new CONFIG();
CONFIG config = geCONFIGXml();
return config;
}
public static CONFIG geCONFIGXml() throws Exception {
CONFIG config = new CONFIG();
config.setDESCRIPTION("Default session configuration object");
config.setISDEFAULT("YES");
config.setNAME("default_session_config");
config.setVERSIONNUMBER("1");
for(ATTRIBUTE attribute : geCONFIGATTRIBUTEXml()) {
config.getATTRIBUTE().add(attribute);
}
return config;
}
public static List<ATTRIBUTE> geCONFIGATTRIBUTEXml() throws Exception {
List<ATTRIBUTE> attributeList = new ArrayList();
String[] tmpStr = null;
String[] attributeInfo = new String[]{"Advanced_", "Constraint based load ordering_NO", "Cache LOOKUP() function_YES", "Default buffer block size_Auto", "Line Sequential buffer length_1024", "Maximum Memory Allowed For Auto Memory Attributes_512MB", "Maximum Percentage of Total Memory Allowed For Auto Memory Attributes_5", "Additional Concurrent Pipelines for Lookup Cache Creation_Auto", "Custom Properties_AutoCommit=Yes;", "Pre-build lookup cache_Auto", "Optimization Level_Medium", "DateTime Format String_MM/DD/YYYY HH24:MI:SS.US", "Pre 85 Timestamp Compatibility_NO", "Log Options_0", "Save session log by_Session runs", "Save session log for these runs_0", "Session Log File Max Size_0", "Session Log File Max Time Period_0", "Maximum Partial Session Log Files_1", "Writer Commit Statistics Log Frequency_1", "Writer Commit Statistics Log Interval_0", "Error handling_", "Stop on errors_0", "Override tracing_None", "On Stored Procedure error_Stop", "On Pre-session command task error_Stop", "On Pre-Post SQL error_Stop", "Enable Recovery_NO", "Error Log Type_None", "Error Log Table Name Prefix_", "Error Log File Name_PMError.log", "Log Source Row Data_NO", "Data Column Delimiter_|", "Partitioning Options_", "Dynamic Partitioning_Disabled", "Number of Partitions_1", "Multiplication Factor_Auto", "Session on Grid_", "Is Enabled_NO"};
for(int i = 0; i < attributeInfo.length; ++i) {
ATTRIBUTE attribute = new ATTRIBUTE();
tmpStr = attributeInfo[i].split("_");
attribute.setNAME(tmpStr[0]);
if (tmpStr.length > 1) {
attribute.setVALUE(tmpStr[1]);
} else {
attribute.setVALUE("");
}
attributeList.add(attribute);
}
return attributeList;
}
}
package com.chenyang.nse.bussiness.engine.infa.powercenter961.transferdata;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.ATTRIBUTE;
import com.chenyang.nse.bussiness.engine.infa.basic.xmlbean.CONFIG;
import java.util.ArrayList;
import java.util.List;
public class Configutil {
public CONFIG getConfig() throws Exception {
new CONFIG();
CONFIG config = this.geCONFIGXml();
return config;
}
public CONFIG geCONFIGXml() throws Exception {
CONFIG config = new CONFIG();
config.setDESCRIPTION("Default session configuration object");
config.setISDEFAULT("YES");
config.setNAME("default_session_config");
config.setVERSIONNUMBER("1");
for(ATTRIBUTE attribute : this.geCONFIGATTRIBUTEXml()) {
config.getATTRIBUTE().add(attribute);
}
return config;
}
public List<ATTRIBUTE> geCONFIGATTRIBUTEXml() throws Exception {
List<ATTRIBUTE> attributeList = new ArrayList();
String[] tmpStr = null;
String[] attributeInfo = new String[]{"Advanced_", "Constraint based load ordering_NO", "Cache LOOKUP() function_YES", "Default buffer block size_Auto", "Line Sequential buffer length_1024", "Maximum Memory Allowed For Auto Memory Attributes_512MB", "Maximum Percentage of Total Memory Allowed For Auto Memory Attributes_5", "Additional Concurrent Pipelines for Lookup Cache Creation_Auto", "Custom Properties_", "Pre-build lookup cache_Auto", "Optimization Level_Medium", "DateTime Format String_MM/DD/YYYY HH24:MI:SS.US", "Pre 85 Timestamp Compatibility_NO", "Log Options_0", "Save session log by_Session runs", "Save session log for these runs_0", "Session Log File Max Size_0", "Session Log File Max Time Period_0", "Maximum Partial Session Log Files_1", "Writer Commit Statistics Log Frequency_1", "Writer Commit Statistics Log Interval_0", "Error handling_", "Stop on errors_0", "Override tracing_None", "On Stored Procedure error_Stop", "On Pre-session command task error_Stop", "On Pre-Post SQL error_Stop", "Enable Recovery_NO", "Error Log Type_None", "Error Log Table Name Prefix_", "Error Log File Name_PMError.log", "Log Source Row Data_NO", "Data Column Delimiter_|", "Partitioning Options_", "Dynamic Partitioning_Disabled", "Number of Partitions_1", "Multiplication Factor_Auto", "Session on Grid_", "Is Enabled_NO"};
for(int i = 0; i < attributeInfo.length; ++i) {
ATTRIBUTE attribute = new ATTRIBUTE();
tmpStr = attributeInfo[i].split("_");
attribute.setNAME(tmpStr[0]);
if (tmpStr.length > 1) {
attribute.setVALUE(tmpStr[1]);
} else {
attribute.setVALUE("");
}
attributeList.add(attribute);
}
return attributeList;
}
}
package com.chenyang.nse.bussiness.entity.vo;
import com.chenyang.nse.bussiness.entity.orm.table.core.dataproject.TCoreDataArea;
import com.chenyang.nse.bussiness.entity.orm.table.core.rule.app.AppDataRule;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
public class ControlledAssertVO {
private String id;
private String note;
private String name;
private String type;
private String datasourceid;
private String dbtype;
private String datasourcename;
private String business;
private String flag;
private Date createtime;
private Date updatetime;
private String createuser;
private String updateuser;
private List<TCoreDataArea> dataAreaList;
private List<AppDataRule> dataRuleList;
private BigInteger areanum;
private BigInteger rulenum;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getNote() {
return this.note;
}
public void setNote(String note) {
this.note = note;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
}
public String getDatasourceid() {
return this.datasourceid;
}
public void setDatasourceid(String datasourceid) {
this.datasourceid = datasourceid;
}
public String getDbtype() {
return this.dbtype;
}
public void setDbtype(String dbtype) {
this.dbtype = dbtype;
}
public String getDatasourcename() {
return this.datasourcename;
}
public void setDatasourcename(String datasourcename) {
this.datasourcename = datasourcename;
}
public String getBusiness() {
return this.business;
}
public void setBusiness(String business) {
this.business = business;
}
public String getFlag() {
return this.flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
public Date getCreatetime() {
return this.createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public Date getUpdatetime() {
return this.updatetime;
}
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
public String getCreateuser() {
return this.createuser;
}
public void setCreateuser(String createuser) {
this.createuser = createuser;
}
public String getUpdateuser() {
return this.updateuser;
}
public void setUpdateuser(String updateuser) {
this.updateuser = updateuser;
}
public List<TCoreDataArea> getDataAreaList() {
return this.dataAreaList;
}
public void setDataAreaList(List<TCoreDataArea> dataAreaList) {
this.dataAreaList = dataAreaList;
}
public List<AppDataRule> getDataRuleList() {
return this.dataRuleList;
}
public void setDataRuleList(List<AppDataRule> dataRuleList) {
this.dataRuleList = dataRuleList;
}
public BigInteger getAreanum() {
return this.areanum;
}
public void setAreanum(BigInteger areanum) {
this.areanum = areanum;
}
public BigInteger getRulenum() {
return this.rulenum;
}
public void setRulenum(BigInteger rulenum) {
this.rulenum = rulenum;
}
}
package com.chenyang.nse.bussiness.init;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class CorsConfig implements WebMvcConfigurer {
static final String[] ORIGINS = new String[]{"GET", "POST", "PUT", "DELETE"};
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOriginPatterns(new String[]{"*"}).allowedMethods(new String[]{"GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS"}).allowCredentials(true).maxAge(3600L).allowedHeaders(new String[]{"*"});
}
}
package com.chenyang.nse.bussiness.performance_monitor.entity;
import com.chenyang.nse.bussiness.performance_monitor.utils.UUIDGenerator;
import java.util.Date;
public class CoreApiResponseMsg {
protected String code;
protected String msg;
protected boolean flag;
protected String errorInstanceId = UUIDGenerator.getUUID();
protected Object data;
public int total;
protected Date responseDate = new Date();
public int getTotal() {
return this.total;
}
public void setTotal(int total) {
this.total = total;
}
public String getCode() {
return this.code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return this.msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public boolean isFlag() {
return this.flag;
}
public void setFlag(boolean flag) {
this.flag = flag;
}
public String getErrorInstanceId() {
return this.errorInstanceId;
}
public void setErrorInstanceId(String errorInstanceId) {
this.errorInstanceId = errorInstanceId;
}
public Object getData() {
return this.data;
}
public void setData(Object data) {
this.data = data;
}
public Date getResponseDate() {
return this.responseDate;
}
public void setResponseDate(Date responseDate) {
this.responseDate = responseDate;
}
}
package com.chenyang.nse.bussiness.service.console;
import com.chenyang.nse.bussiness.entity.orm.table.base.TBaseMenu;
import java.util.List;
public interface ConsoleService {
List<TBaseMenu> qeuryMenusByRoleId(String roleId);
}
package com.chenyang.nse.bussiness.service.console.impl;
import com.chenyang.nse.bussiness.dao.table.base.TBaseMenuDao;
import com.chenyang.nse.bussiness.entity.orm.table.base.TBaseMenu;
import com.chenyang.nse.bussiness.service.console.ConsoleService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class ConsoleServiceImpl implements ConsoleService {
@Autowired
private TBaseMenuDao menuDao;
public List<TBaseMenu> qeuryMenusByRoleId(String roleId) {
List<TBaseMenu> list = this.menuDao.qeuryMenusByRoleId(roleId);
return list;
}
}
package com.chenyang.nse.bussiness.service.core;
import com.chenyang.nse.bussiness.dao.PageInfo;
import com.chenyang.nse.bussiness.entity.orm.table.core.TCoreControlledAsset;
import com.chenyang.nse.bussiness.entity.vo.ControlledAssertVO;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
public interface ControlledAssetService {
List<ControlledAssertVO> queryControlledAsset(PageInfo pageInfo, Map<String, String> params);
ControlledAssertVO initControlledAsset(String id);
TCoreControlledAsset queryByName(String name);
void addControlledAsset(ControlledAssertVO controlledAssertVO, HttpServletRequest request);
void remove(String id);
void deleteAreaByAssetid(String id);
void deleteRuleByAssetid(String id);
TCoreControlledAsset queryByDatasourceid(String datasourceid);
}
package com.chenyang.nse.bussiness.service.core;
import com.chenyang.nse.bussiness.dao.PageInfo;
import com.chenyang.nse.bussiness.entity.orm.table.core.charts.TCoreChartsEight;
import com.chenyang.nse.bussiness.entity.orm.table.core.charts.TCoreChartsFive;
import com.chenyang.nse.bussiness.entity.orm.table.core.charts.TCoreChartsFour;
import com.chenyang.nse.bussiness.entity.orm.table.core.charts.TCoreChartsOne;
import com.chenyang.nse.bussiness.entity.orm.table.core.charts.TCoreChartsSeven;
import com.chenyang.nse.bussiness.entity.orm.table.core.charts.TCoreChartsSix;
import com.chenyang.nse.bussiness.entity.orm.table.core.charts.TCoreChartsThree;
import com.chenyang.nse.bussiness.entity.orm.table.core.charts.TCoreChartsTwo;
import com.chenyang.nse.bussiness.entity.orm.table.core.project.TCoreProjectInfo;
import com.chenyang.nse.bussiness.entity.vo.Releasecolumn;
import java.util.List;
public interface CoreProjectService {
List<Releasecolumn> queryTcoreReleasecolumn(String projectid, String table);
void saveTCoreChartsOne(TCoreChartsOne tCoreChartsOne);
void saveTCoreChartsTwo(TCoreChartsTwo tCoreChartsTwo);
void saveTCoreChartsThree(TCoreChartsThree tCoreChartsThree);
void saveTCoreChartsFour(TCoreChartsFour tCoreChartsFour);
void saveTCoreChartsFive(TCoreChartsFive tCoreChartsFive);
void saveTCoreChartsSix(TCoreChartsSix tCoreChartsSix);
void saveTCoreChartsSeven(TCoreChartsSeven tCoreChartsSeven);
void saveTCoreChartsEight(TCoreChartsEight tCoreChartseight);
List<TCoreChartsOne> queryTCoreChartsOne(List<String> projectidlist);
List<TCoreChartsSeven> queryTCoreChartsSeven(List<String> projectidlist);
List<TCoreChartsEight> queryTCoreChartsEight(List<String> projectidlist);
List<TCoreChartsTwo> queryTCoreChartsTwo(List<String> projectidlist);
List<TCoreChartsThree> queryTCoreChartsThree(List<String> projectidlist);
List<TCoreChartsFour> queryTCoreChartsFour(List<String> projectidlist);
List<TCoreChartsFive> queryTCoreChartsFive(List<String> projectidlist);
List<TCoreChartsSix> queryTCoreChartsSix(List<String> projectidlist);
List<TCoreProjectInfo> query(String flag);
void save(TCoreProjectInfo tCoreProjectInfo);
void update(TCoreProjectInfo tCoreProjectInfo);
void remove(String id);
void removeByProjectid(String projectid);
List<TCoreProjectInfo> queryAll(PageInfo pageInfo, String projectname);
List<TCoreProjectInfo> queryAll();
void createsqlstr(StringBuilder sql);
List<TCoreProjectInfo> queryById(String id);
List<TCoreProjectInfo> queryByName(String projectname);
void removeAllChat(String projectname);
TCoreProjectInfo queryProjectByProjectId(String projectid);
}
package com.chenyang.nse.bussiness.service.core;
import java.util.List;
import java.util.Map;
public interface CoreService {
List<Map> datasystemreport();
List<Map> sensitivedatareport();
List<Map> maskingrulereport();
Map maskingefficiencyreport();
}
package com.chenyang.nse.bussiness.service.core.impl;
import com.chenyang.nse.bussiness.dao.core.CoreDao;
import com.chenyang.nse.bussiness.service.core.CoreService;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CoreServiceImpl implements CoreService {
@Autowired
private CoreDao coreDao;
public List<Map> datasystemreport() {
List<Map> list = this.coreDao.dataSystemReport();
return list;
}
public List<Map> sensitivedatareport() {
List<Map> list = this.coreDao.sensitiveDataReport();
return list;
}
public List<Map> maskingrulereport() {
List<Map> list = this.coreDao.maskingRuleReport();
return list;
}
public Map maskingefficiencyreport() {
Map map = this.coreDao.maskingEfficiencyReport();
return map;
}
}
package com.chenyang.nse.bussiness.tools.correlation;
import com.chenyang.nse.bussiness.tools.jdbc.JdbcTool;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CorrelationTool {
public static Map<String, Float> check(ArrayList<List<String>> data, int a, double rate) {
Map<String, Float> map = new HashMap();
List<String> target = (List)data.get(a);
for(int i = 0; i < data.size(); ++i) {
Map<String, Integer> checkMap = new HashMap();
if (i != a) {
List<String> current = (List)data.get(i);
ArrayList<String> list = new ArrayList();
for(int j = 0; j < ((List)data.get(i)).size(); ++j) {
Integer count = (Integer)checkMap.get(current.get(j));
String s = (String)target.get(j);
if (count == null) {
count = 1;
list.add(s);
} else if (list.contains(s)) {
count = count + 1;
list.add(s);
}
checkMap.put(current.get(j), count);
}
DecimalFormat df2 = new DecimalFormat("0.000");
String confidence = df2.format((double)((float)list.size() / (float)((List)data.get(0)).size()));
float confidenceRate = Float.parseFloat(confidence);
if ((double)confidenceRate > rate) {
map.put((data.get(i)).get(0), confidenceRate);
}
}
}
return map;
}
public static void main(String[] args) throws SQLException {
Connection conn = JdbcTool.getConnection("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@192.168.2.106:1521:orcl", "test", "test");
Statement sm = null;
sm = conn.createStatement();
String querySql = "select * from HAILONG.IP_INVPTY101";
ResultSet rs = sm.executeQuery(querySql);
ResultSetMetaData rsmd = rs.getMetaData();
int colCount = rsmd.getColumnCount();
Object columnValue = null;
long rowCount = 0L;
ArrayList<List<String>> list;
for(list = new ArrayList(); rs.next(); ++rowCount) {
for(int i = 0; i < colCount; ++i) {
if (rowCount == 0L) {
List<String> strlist = new ArrayList();
strlist.add(rsmd.getColumnName(i + 1));
list.add(i, strlist);
}
columnValue = rs.getObject(i + 1);
((List)list.get(i)).add(columnValue == null ? "" : columnValue.toString());
}
}
check(list, 4, 0.6);
}
}
package com.chenyang.nse.bussiness.tools.dataprocess.common;
public interface Constant {
String ENCRYPT_FLAG_RUNNING = "-1";
String ENCRYPT_FLAG_FAIL = "4";
String ENCRYPT_FLAG_COMPLETE = "5";
String DECRYPT_FLAG_RUNNING = "-2";
String DECRYPT_FLAG_FAIL = "44";
String DECRYPT_FLAG_COMPLETE = "7";
String PROGRESS_ENCRYPTION_FLAG = "0";
String PROGRESS_DECRYPTION_FLAG = "1";
}
package com.chenyang.nse.bussiness.tools.xml.xmlclass.product;
public class ConnectivityOracle {
private String name;
private String value;
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return this.value;
}
public void setValue(String value) {
this.value = value;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<sqls>
<!-- 统计数据系统 -->
<select id="dataSystemReport">
SELECT
count(*) value,
dbtype name
FROM
t_core_datasystem
GROUP BY dbtype
</select>
<!-- 统计敏感数据 -->
<select id="sensitiveDataReport">
SELECT
count(*) value,
regextype name
FROM
(
SELECT
*
FROM
t_core_sensitivecolumn t
GROUP BY
t.datasourceid,
t.tschema,
t.tablename
) tt
GROUP BY
regextype
</select>
<!-- 数据生成规则 -->
<select id="maskingRuleReport">
SELECT
count(*) value,
rulegroupname name
FROM
t_core_masking_rule
GROUP BY
rulegroupname
</select>
<!-- 总脱敏时间(秒) -->
<select id="maskingTotalTime">
SELECT
SUM(
TIMESTAMPDIFF(
SECOND,
t.starttime,
t.endtime
)
) totaltime
FROM
t_core_masking_detailrecord t;
</select>
<!-- 总脱敏行数 -->
<select id="maskingTotalRow">
SELECT
SUM(successrow) totalrow
FROM
t_core_masking_detailrecord t;
</select>
</sqls>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论