Commit 8a2cedef by wuchao

新版本

parent aa9594ad
package com.chenyang.nse.bussiness.dao.core;
import com.chenyang.nse.bussiness.config.HibernateConfig;
import com.chenyang.nse.bussiness.dao.BaseDao;
import com.chenyang.nse.bussiness.entity.vo.api.DiscoverApiDirectoryVO;
import com.chenyang.nse.bussiness.entity.vo.datascope.ComplianceDirectoryVO;
import com.chenyang.nse.bussiness.tools.xml.XmlTool;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.hibernate.query.NativeQuery;
import org.hibernate.transform.Transformers;
import org.springframework.stereotype.Repository;
@Repository
public class ComplianceDirectoryDao extends BaseDao<Object, String> {
public List<ComplianceDirectoryVO> getDataScopeGroup(ComplianceDirectoryVO vo) {
String sql = StringUtils.isNotEmpty(vo.getSearchVal()) ? XmlTool.getSql("compliancedirectory", "dataScopeGroupByCondition") : XmlTool.getSql("compliancedirectory", "dataScopeGroup");
List<ComplianceDirectoryVO> res = null;
NativeQuery nativeQuery = this.getSession().createNativeQuery(sql).setParameter("edition_id", vo.getEdition_id());
if (StringUtils.isNotEmpty(vo.getSearchVal())) {
nativeQuery.setParameter("condition", vo.getCondition()).setParameter("searchVal", vo.getSearchVal());
}
res = nativeQuery.setResultTransformer(Transformers.aliasToBean(ComplianceDirectoryVO.class)).getResultList();
return res;
}
public List<DiscoverApiDirectoryVO> getComplianceDirectory(String edition_id) {
String sql = XmlTool.getSql("compliancedirectory", "complianceDirectory");
List<DiscoverApiDirectoryVO> vo = this.getSession().createNativeQuery(sql).setParameter("edition_id", edition_id).setResultTransformer(Transformers.aliasToBean(DiscoverApiDirectoryVO.class)).getResultList();
return vo;
}
public int insertAddFa(ComplianceDirectoryVO scope) {
String sql = XmlTool.getSql("compliancedirectory", "addfa");
int i = this.getSession().createNativeQuery(sql).setParameter("text", scope.getText()).setParameter("edition_id", scope.getEdition_id()).setParameter("id", scope.getTid()).setParameter("note", scope.getNote()).setParameter("chinese_name", scope.getChinese_name()).setParameter("foreigh_name", scope.getForeigh_name()).setParameter("abbreviation", scope.getAbbreviation()).setParameter("public_name", scope.getPublic_name()).setParameter("public_date", scope.getPublic_date()).setParameter("implementation_date", scope.getImplementation_date()).setParameter("revised_date", scope.getRevised_date()).setParameter("application_state", scope.getApplication_state()).setParameter("directory_type", scope.getDirectory_type()).setParameter("create_user", scope.getCreate_user()).setParameter("projectid", scope.getProjectId()).executeUpdate();
return i;
}
public List<ComplianceDirectoryVO> ishavebro(ComplianceDirectoryVO scope) {
String sql = XmlTool.getSql("compliancedirectory", "ishavebro");
List<ComplianceDirectoryVO> vo = this.getSession().createNativeQuery(sql).setParameter("fa_tid", scope.getFa_tid()).setResultTransformer(Transformers.aliasToBean(ComplianceDirectoryVO.class)).getResultList();
return vo;
}
public int havebro(ComplianceDirectoryVO scope) {
String sql = XmlTool.getSql("compliancedirectory", "havebro");
int i = this.getSession().createNativeQuery(sql).setParameter("text", scope.getText()).setParameter("id", scope.getTid()).setParameter("edition_id", scope.getEdition_id()).setParameter("fa_tid", scope.getFa_tid()).setParameter("note", scope.getNote()).setParameter("chinese_name", scope.getChinese_name()).setParameter("foreigh_name", scope.getForeigh_name()).setParameter("abbreviation", scope.getAbbreviation()).setParameter("public_name", scope.getPublic_name()).setParameter("public_date", scope.getPublic_date()).setParameter("implementation_date", scope.getImplementation_date()).setParameter("revised_date", scope.getRevised_date()).setParameter("application_state", scope.getApplication_state()).setParameter("directory_type", scope.getDirectory_type()).setParameter("create_user", scope.getCreate_user()).setParameter("projectid", scope.getProjectId()).executeUpdate();
return i;
}
public int nothavebro(ComplianceDirectoryVO scope) {
String sql = XmlTool.getSql("compliancedirectory", "nothavebro");
int i = this.getSession().createNativeQuery(sql).setParameter("text", scope.getText()).setParameter("id", scope.getTid()).setParameter("edition_id", scope.getEdition_id()).setParameter("fa_tid", scope.getFa_tid()).setParameter("note", scope.getNote()).setParameter("chinese_name", scope.getChinese_name()).setParameter("foreigh_name", scope.getForeigh_name()).setParameter("abbreviation", scope.getAbbreviation()).setParameter("public_name", scope.getPublic_name()).setParameter("public_date", scope.getPublic_date()).setParameter("implementation_date", scope.getImplementation_date()).setParameter("revised_date", scope.getRevised_date()).setParameter("application_state", scope.getApplication_state()).setParameter("directory_type", scope.getDirectory_type()).setParameter("create_user", scope.getCreate_user()).setParameter("projectid", scope.getProjectId()).executeUpdate();
return i;
}
public int updateScope(ComplianceDirectoryVO scope) {
String sql = XmlTool.getSql("compliancedirectory", "updatescope");
int i = this.getSession().createNativeQuery(sql).setParameter("text", scope.getText()).setParameter("id", scope.getTid()).setParameter("note", scope.getNote()).setParameter("chinese_name", scope.getChinese_name()).setParameter("foreigh_name", scope.getForeigh_name()).setParameter("abbreviation", scope.getAbbreviation()).setParameter("public_name", scope.getPublic_name()).setParameter("public_date", scope.getPublic_date()).setParameter("implementation_date", scope.getImplementation_date()).setParameter("revised_date", scope.getRevised_date()).setParameter("application_state", scope.getApplication_state()).setParameter("directory_type", scope.getDirectory_type()).setParameter("create_user", scope.getCreate_user()).executeUpdate();
return i;
}
public int delselfandson(String scope_id) {
String sql = XmlTool.getSql("compliancedirectory", "delselfandson");
int i = this.getSession().createNativeQuery(sql).setParameter("directory_id", scope_id).executeUpdate();
return i;
}
public List<ComplianceDirectoryVO> findbroandhisson(String scope_id, String fa_id) {
String sql = XmlTool.getSql("compliancedirectory", "findbroandhisson");
List<ComplianceDirectoryVO> vo = this.getSession().createNativeQuery(sql).setParameter("fa_id", fa_id).setParameter("directory_id", scope_id).setResultTransformer(Transformers.aliasToBean(ComplianceDirectoryVO.class)).getResultList();
return vo;
}
public int updatebro(String id) {
String sql = XmlTool.getSql("compliancedirectory", "updatebro");
int i = this.getSession().createNativeQuery(sql).setParameter("id", id).executeUpdate();
return i;
}
public int updatebroson(String id, String del_id) {
String sql = XmlTool.getSql("compliancedirectory", "updatebroson");
int i = this.getSession().createNativeQuery(sql).setParameter("id", id).setParameter("del_id", del_id).executeUpdate();
return i;
}
public int insertAddZero(ComplianceDirectoryVO scope) {
String sql = XmlTool.getSql("compliancedirectory", "addzero");
int i = this.getSession().createNativeQuery(sql).setParameter("text", scope.getText()).setParameter("id", scope.getTid()).setParameter("note", scope.getNote()).setParameter("chinese_name", scope.getChinese_name()).setParameter("foreigh_name", scope.getForeigh_name()).setParameter("abbreviation", scope.getAbbreviation()).setParameter("public_name", scope.getPublic_name()).setParameter("public_date", scope.getPublic_date()).setParameter("implementation_date", scope.getImplementation_date()).setParameter("revised_date", scope.getRevised_date()).setParameter("application_state", scope.getApplication_state()).setParameter("directory_type", scope.getDirectory_type()).setParameter("create_user", scope.getCreate_user()).setParameter("projectid", scope.getProjectId()).setParameter("edition_id", scope.getEdition_id()).executeUpdate();
return i;
}
public List<ComplianceDirectoryVO> getselfandson(String directory_id) {
String sql = XmlTool.getSql("compliancedirectory", "getselfandson");
return this.getSession().createNativeQuery(sql).setParameter("directory_id", directory_id).setResultTransformer(Transformers.aliasToBean(ComplianceDirectoryVO.class)).getResultList();
}
public List<Map<String, Object>> selectComplianceDirCount(String id) {
String sql = "SELECT COUNT(id) AS s FROM t_core_compliance_directory WHERE projectid = '" + id + "'";
List<Map<String, Object>> vo = this.getSession().createNativeQuery(sql).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).getResultList();
return vo;
}
public List<Map<String, Object>> selectComplianceDirCount1(String edition_id) {
String sql = "SELECT COUNT(id) AS s FROM t_core_compliance_directory WHERE edition_id = '" + edition_id + "'";
if (HibernateConfig.PEIZHIKUDBTYPE.equals("3")) {
sql = "SELECT COUNT(id) AS \"s\" FROM t_core_compliance_directory WHERE edition_id = '" + edition_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.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.NormalizedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(
name = "",
propOrder = {"versionnumber", "name", "isdefault", "description", "attribute"}
)
@XmlRootElement(
name = "CONFIG"
)
public class CONFIG {
@XmlAttribute(
name = "NAME",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String name;
@XmlAttribute(
name = "DESCRIPTION"
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String description;
@XmlAttribute(
name = "ISDEFAULT"
)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String isdefault;
@XmlAttribute(
name = "VERSIONNUMBER"
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String versionnumber;
@XmlElement(
name = "ATTRIBUTE"
)
protected List<ATTRIBUTE> attribute;
public String getNAME() {
return this.name;
}
public void setNAME(String value) {
this.name = value;
}
public String getDESCRIPTION() {
return this.description;
}
public void setDESCRIPTION(String value) {
this.description = value;
}
public String getISDEFAULT() {
return this.isdefault;
}
public void setISDEFAULT(String value) {
this.isdefault = value;
}
public String getVERSIONNUMBER() {
return this.versionnumber;
}
public void setVERSIONNUMBER(String value) {
this.versionnumber = 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 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 = {"type", "refobjectname", "attribute"}
)
@XmlRootElement(
name = "CONFIGREFERENCE"
)
public class CONFIGREFERENCE {
@XmlAttribute(
name = "REFOBJECTNAME",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String refobjectname;
@XmlAttribute(
name = "TYPE",
required = true
)
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
protected String type;
@XmlElement(
name = "ATTRIBUTE"
)
protected List<ATTRIBUTE> attribute;
public String getREFOBJECTNAME() {
return this.refobjectname;
}
public void setREFOBJECTNAME(String value) {
this.refobjectname = value;
}
public String getTYPE() {
return this.type;
}
public void setTYPE(String value) {
this.type = value;
}
public List<ATTRIBUTE> getATTRIBUTE() {
if (this.attribute == null) {
this.attribute = new ArrayList();
}
return this.attribute;
}
}
package com.chenyang.nse.bussiness.engine.infa.powercenter961.createdata;
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.engine.infa.powercenter961.pubbean;
import java.util.List;
public class CommonBean {
private List<String> keytype;
private List<String> nameList;
private List<String> typeList;
private List<String> lengthList;
private List<String> mappingLengthList;
private List<String> mappingTypeList;
private List<String> mappingPrecisionList;
private List<String> precisionList;
private List<String> scalelist;
private List<String> mappingScalelist;
private List<String> judgelist;
private List<String> dateformatlist;
public List<String> getDateformatlist() {
return this.dateformatlist;
}
public void setDateformatlist(List<String> dateformatlist) {
this.dateformatlist = dateformatlist;
}
public List<String> getJudgelist() {
return this.judgelist;
}
public void setJudgelist(List<String> judgelist) {
this.judgelist = judgelist;
}
public List<String> getMappingScalelist() {
return this.mappingScalelist;
}
public void setMappingScalelist(List<String> mappingScalelist) {
this.mappingScalelist = mappingScalelist;
}
public List<String> getMappingPrecisionList() {
return this.mappingPrecisionList;
}
public void setMappingPrecisionList(List<String> mappingPrecisionList) {
this.mappingPrecisionList = mappingPrecisionList;
}
public List<String> getPrecisionList() {
return this.precisionList;
}
public void setPrecisionList(List<String> precisionList) {
this.precisionList = precisionList;
}
public List<String> getMappingTypeList() {
return this.mappingTypeList;
}
public void setMappingTypeList(List<String> mappingTypeList) {
this.mappingTypeList = mappingTypeList;
}
public List<String> getMappingLengthList() {
return this.mappingLengthList;
}
public void setMappingLengthList(List<String> mappingLengthList) {
this.mappingLengthList = mappingLengthList;
}
public List<String> getKeytype() {
return this.keytype;
}
public void setKeytype(List<String> keytype) {
this.keytype = keytype;
}
public List<String> getNameList() {
return this.nameList;
}
public void setNameList(List<String> nameList) {
this.nameList = nameList;
}
public List<String> getTypeList() {
return this.typeList;
}
public void setTypeList(List<String> typeList) {
this.typeList = typeList;
}
public List<String> getLengthList() {
return this.lengthList;
}
public void setLengthList(List<String> lengthList) {
this.lengthList = lengthList;
}
public List<String> getScalelist() {
return this.scalelist;
}
public void setScalelist(List<String> scalelist) {
this.scalelist = scalelist;
}
}
package com.chenyang.nse.bussiness.entity.orm.table.core.encryption;
import com.chenyang.nse.bussiness.entity.orm.table.TBaseEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(
name = "COLUMN_PRIMARY_KEY_INFO"
)
public class ColumnPrimaryKeyInfo extends TBaseEntity {
private String project_id;
private String datasystem_id;
private String tschema;
private String tname;
private String primary_key_columns;
public String getProject_id() {
return this.project_id;
}
public void setProject_id(String project_id) {
this.project_id = project_id;
}
public String getDatasystem_id() {
return this.datasystem_id;
}
public void setDatasystem_id(String datasystem_id) {
this.datasystem_id = datasystem_id;
}
public String getTschema() {
return this.tschema;
}
public void setTschema(String tschema) {
this.tschema = tschema;
}
public String getTname() {
return this.tname;
}
public void setTname(String tname) {
this.tname = tname;
}
public String getPrimary_key_columns() {
return this.primary_key_columns;
}
public void setPrimary_key_columns(String primary_key_columns) {
this.primary_key_columns = primary_key_columns;
}
}
package com.chenyang.nse.bussiness.entity.vo.datascope;
import com.chenyang.nse.bussiness.entity.cache.LoginUser;
public class ComplianceDirectoryReqVO {
private ComplianceDirectoryVO complianceDirectoryVO;
private LoginUser loginUser;
public ComplianceDirectoryVO getComplianceDirectoryVO() {
return this.complianceDirectoryVO;
}
public LoginUser getLoginUser() {
return this.loginUser;
}
public void setComplianceDirectoryVO(final ComplianceDirectoryVO complianceDirectoryVO) {
this.complianceDirectoryVO = complianceDirectoryVO;
}
public void setLoginUser(final LoginUser loginUser) {
this.loginUser = loginUser;
}
public boolean equals(final Object o) {
if (o == this) {
return true;
} else if (!(o instanceof ComplianceDirectoryReqVO)) {
return false;
} else {
ComplianceDirectoryReqVO other = (ComplianceDirectoryReqVO)o;
if (!other.canEqual(this)) {
return false;
} else {
Object this$complianceDirectoryVO = this.getComplianceDirectoryVO();
Object other$complianceDirectoryVO = other.getComplianceDirectoryVO();
if (this$complianceDirectoryVO == null) {
if (other$complianceDirectoryVO != null) {
return false;
}
} else if (!this$complianceDirectoryVO.equals(other$complianceDirectoryVO)) {
return false;
}
Object this$loginUser = this.getLoginUser();
Object other$loginUser = other.getLoginUser();
if (this$loginUser == null) {
if (other$loginUser != null) {
return false;
}
} else if (!this$loginUser.equals(other$loginUser)) {
return false;
}
return true;
}
}
}
protected boolean canEqual(final Object other) {
return other instanceof ComplianceDirectoryReqVO;
}
public int hashCode() {
int PRIME = 59;
int result = 1;
Object $complianceDirectoryVO = this.getComplianceDirectoryVO();
result = result * 59 + ($complianceDirectoryVO == null ? 43 : $complianceDirectoryVO.hashCode());
Object $loginUser = this.getLoginUser();
result = result * 59 + ($loginUser == null ? 43 : $loginUser.hashCode());
return result;
}
public String toString() {
return "ComplianceDirectoryReqVO(complianceDirectoryVO=" + this.getComplianceDirectoryVO() + ", loginUser=" + this.getLoginUser() + ")";
}
}
package com.chenyang.nse.bussiness.entity.vo.maskingtask;
public class CompareInfoVO {
private Object columnname;
private Object maskingrulename;
private Object sourcedata;
private Object targetdata;
private Object diffMark;
private long curPage;
private long total;
public long getTotal() {
return this.total;
}
public void setTotal(long total) {
this.total = total;
}
public long getCurPage() {
return this.curPage;
}
public void setCurPage(long curPage) {
this.curPage = curPage;
}
public Object getColumnname() {
return this.columnname;
}
public void setColumnname(Object columnname) {
this.columnname = columnname;
}
public Object getMaskingrulename() {
return this.maskingrulename;
}
public void setMaskingrulename(Object maskingrulename) {
this.maskingrulename = maskingrulename;
}
public Object getSourcedata() {
return this.sourcedata;
}
public void setSourcedata(Object sourcedata) {
this.sourcedata = sourcedata;
}
public Object getTargetdata() {
return this.targetdata;
}
public void setTargetdata(Object targetdata) {
this.targetdata = targetdata;
}
public Object getDiffMark() {
return this.diffMark;
}
public void setDiffMark(Object diffMark) {
this.diffMark = diffMark;
}
}
package com.chenyang.nse.bussiness.odbc.po;
public class CommandType {
public static final byte PARSE_SQL_STRUCTURE = 1;
public static final byte REPLACE_SQL_STRUCTURE = 2;
public static final byte SM4_ENC_DEC = 3;
public static final byte SYNC_RULES = 4;
public static final byte SYNC_MASKS = 5;
}
package com.chenyang.nse.bussiness.performance_monitor.exception;
public class CommonException extends RuntimeException {
private static final long serialVersionUID = 1L;
private String errorCode;
public CommonException(String errorCode, String errorMessage) {
super(errorMessage);
this.errorCode = errorCode;
}
public String getErrorCode() {
return this.errorCode;
}
}
package com.chenyang.nse.bussiness.service.core;
import com.chenyang.nse.bussiness.entity.orm.table.core.TCoreAttachmentDirectory;
import com.chenyang.nse.bussiness.entity.vo.datascope.ComplianceDirectoryVO;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
@Service
@Transactional
public interface ComplianceDirectoryService {
void complianceDirectorySave(MultipartFile file, TCoreAttachmentDirectory dir);
void save(ComplianceDirectoryVO scope);
ComplianceDirectoryVO editbyid(String id);
void remove(String id);
List<ComplianceDirectoryVO> getScopeTable(ComplianceDirectoryVO vo);
List<TCoreAttachmentDirectory> getselectfilelist(String id);
void removeTask(String fileid);
TCoreAttachmentDirectory editTask(String fileid);
void complianceDirectorySaveEdit(TCoreAttachmentDirectory dir);
String getmaxdatetid(String projectId);
void removeByEdition(String editionid);
void saveExcelData(List<List<String>> list, String user, String projectId) throws Exception;
String checkName(String directoryname, String projectId);
}
package com.chenyang.nse.bussiness.service.core;
import com.chenyang.nse.bussiness.entity.orm.table.core.TCoreConfig;
import java.util.List;
public interface ConfigService {
TCoreConfig queryBydbtype(String dbtype);
List<String> queryBysystemid(String id);
void removeBysysid(String id);
}
package com.chenyang.nse.bussiness.service.core.impl;
import com.chenyang.nse.bussiness.dao.table.core.TCoreConfigDao;
import com.chenyang.nse.bussiness.dao.table.core.TCoreDatasystemDao;
import com.chenyang.nse.bussiness.entity.orm.table.core.TCoreConfig;
import com.chenyang.nse.bussiness.service.core.ConfigService;
import com.chenyang.nse.bussiness.tools.string.StringTool;
import com.chenyang.nse.bussiness.tools.xml.XmlTool;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class ConfigServiceImpl implements ConfigService {
@Autowired
private TCoreConfigDao tCoreConfigDao;
@Autowired
private TCoreDatasystemDao tCoreDatasystemDao;
public TCoreConfig queryBydbtype(String dbtype) {
TCoreConfig tCoreConfig = new TCoreConfig();
String sourcedelimiter = "";
String sourcequoteCharacter = "";
String targetquoteCharacter = "";
String targetdelimiter = "";
String fileDir = "";
String suffix = "";
String dabtype = "";
if (dbtype.equals("MYSQL")) {
dabtype = "MYSQL";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
} else if (dbtype.equals("HANA")) {
dabtype = "HANA";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
} else if (dbtype.equals("TERADATA")) {
dabtype = "TERADATA";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
} else if (dbtype.equals("HIVE")) {
dabtype = "HIVE";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
} else if (dbtype.equals("MSSQLSERVER")) {
dabtype = "MSSQLSERVER";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
} else if (dbtype.equals("SYBASE")) {
dabtype = "SYBASE";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
} else if (dbtype.equals("SYBASE_IQ")) {
dabtype = "SYBASE_IQ";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
} else if (dbtype.equals("DB2")) {
dabtype = "DB2";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
} else if (dbtype.equals("ORACLE")) {
dabtype = "ORACLE";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
} else if (dbtype.equals("INFORMIX")) {
dabtype = "INFORMIX";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
} else if (dbtype.equals("MARIADB")) {
dabtype = "MARIADB";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
} else if (dbtype.equals("GREENPLUM")) {
dabtype = "GREENPLUM";
sourcedelimiter = XmlTool.getFileValue(dbtype + "/db-sourcedelimiter");
sourcequoteCharacter = XmlTool.getFileValue(dbtype + "/db-sourcequoteCharacter");
targetdelimiter = XmlTool.getFileValue(dbtype + "/db-targetdelimiter");
targetquoteCharacter = XmlTool.getFileValue(dbtype + "/db-targetquoteCharacter");
suffix = XmlTool.getFileValue(dbtype + "/db-suffix");
fileDir = XmlTool.getFileValue(dbtype + "/db-fileDir");
}
List<String> tCoreConfig1 = this.tCoreConfigDao.queryBydbtype(dbtype);
if (tCoreConfig1 != null && tCoreConfig1.size() > 0) {
tCoreConfig.setId((String)tCoreConfig1.get(0));
tCoreConfig.setSourcedelimiter(sourcedelimiter);
tCoreConfig.setSourcequoteCharacter(sourcequoteCharacter);
tCoreConfig.setTargetdelimiter(targetdelimiter);
tCoreConfig.setTargetquoteCharacter(targetquoteCharacter);
tCoreConfig.setDbtype(dbtype);
tCoreConfig.setSuffix(suffix);
tCoreConfig.setFileDir(fileDir);
return tCoreConfig;
} else {
tCoreConfig.setId(StringTool.getTablePrimaryKey());
tCoreConfig.setSourcedelimiter(sourcedelimiter);
tCoreConfig.setSourcequoteCharacter(sourcequoteCharacter);
tCoreConfig.setTargetdelimiter(targetdelimiter);
tCoreConfig.setTargetquoteCharacter(targetquoteCharacter);
tCoreConfig.setDbtype(dbtype);
tCoreConfig.setSuffix(suffix);
tCoreConfig.setFileDir(fileDir);
return tCoreConfig;
}
}
public List<String> queryBysystemid(String id) {
List<String> list = this.tCoreConfigDao.queryBysystemid(id);
return list;
}
@Transactional
public void removeBysysid(String id) {
this.tCoreConfigDao.removeBysysid(id);
}
}
package com.chenyang.nse.bussiness.tools.login;
import com.chenyang.nse.bussiness.entity.cache.LoginUser;
import com.chenyang.nse.bussiness.entity.orm.table.base.TBaseUser;
import com.chenyang.nse.bussiness.tools.msg.PropertiesClassLoader;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.UnknownHostException;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
public class CommonUtils {
private static final Logger log = LoggerFactory.getLogger(CommonUtils.class);
private static Logger logger = LoggerFactory.getLogger(PropertiesClassLoader.class);
public static String getIpAddr(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
if (ip.equals("0:0:0:0:0:0:0:1")) {
ip = "本地";
}
return ip;
}
public static String getLocalMac(String ipAddress) throws SocketException, UnknownHostException {
String str = "";
String macAddress = "";
String LOOPBACK_ADDRESS = "127.0.0.1";
if ("127.0.0.1".equals(ipAddress)) {
InetAddress inetAddress = InetAddress.getLocalHost();
byte[] mac = NetworkInterface.getByInetAddress(inetAddress).getHardwareAddress();
StringBuilder sb = new StringBuilder();
for(int i = 0; i < mac.length; ++i) {
if (i != 0) {
sb.append("-");
}
String s = Integer.toHexString(mac[i] & 255);
sb.append(s.length() == 1 ? 0 + s : s);
}
macAddress = sb.toString().trim().toUpperCase();
} else {
Process p = null;
InputStreamReader ir = null;
BufferedReader br = null;
try {
System.out.println(ipAddress);
p = Runtime.getRuntime().exec("nbtstat -A " + ipAddress);
System.out.println("===process==" + p);
ir = new InputStreamReader(p.getInputStream());
br = new BufferedReader(ir);
while((str = br.readLine()) != null) {
if (str.indexOf("MAC") > 1) {
String var20 = str.substring(str.indexOf("MAC") + 9, str.length());
macAddress = var20.trim();
System.out.println("macAddress:" + macAddress);
break;
}
}
} catch (IOException var17) {
} finally {
try {
if (p != null) {
p.destroy();
}
if (br != null) {
br.close();
}
if (ir != null) {
ir.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
return macAddress;
}
public static TBaseUser loginUser() {
TBaseUser user = new TBaseUser();
user.setId("1");
try {
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
Object userObj = request.getSession().getAttribute("loginUser");
if (userObj != null && userObj instanceof LoginUser) {
user = ((LoginUser)userObj).getTsysUser();
}
} catch (Exception e) {
logger.info("登录用户获取失败", e.getMessage());
}
return user;
}
public static String loginUsername() {
String username = null;
try {
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
Object userObj = request.getSession().getAttribute("loginUser");
if (userObj != null && userObj instanceof LoginUser) {
username = ((LoginUser)userObj).getTsysUser().getUsername();
} else {
username = "admin";
}
} catch (Exception e) {
logger.info("登录用户获取失败", e.getMessage());
}
return username;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<sqls>
<!-- ***************** 新增部分**************** -->
<!-- 根节点添加 -->
<select id="addzero">
INSERT INTO t_core_compliance_directory (
id,
edition_id,
fa_tid,
directory_id,
directory_name,
chinese_name,
foreigh_name,
abbreviation,
public_name,
public_date,
implementation_date,
revised_date,
application_state,
directory_type,
create_user,
create_date,
note,
projectid
)
VALUES
(
:id,
:edition_id,
'全部',
'001',
:text,
:chinese_name,
:foreigh_name,
:abbreviation,
:public_name,
:public_date,
:implementation_date,
:revised_date,
:application_state,
:directory_type,
:create_user,
current_timestamp(),
:note,
:projectid
)
</select>
<select id="addfa">
INSERT INTO t_core_compliance_directory (
id,
edition_id,
fa_tid,
directory_id,
directory_name,
chinese_name,
foreigh_name,
abbreviation,
public_name,
public_date,
implementation_date,
revised_date,
application_state,
directory_type,
create_user,
create_date,
note,
projectid
)
VALUES
(
:id,
:edition_id,
'全部',
(
SELECT
LPAD(MAX(directory_id) + 1, 3, 0)
FROM
t_core_compliance_directory a
WHERE
fa_tid = '全部'
),
:text,
:chinese_name,
:foreigh_name,
:abbreviation,
:public_name,
:public_date,
:implementation_date,
:revised_date,
:application_state,
:directory_type,
:create_user,
current_timestamp(),
:note,
:projectid
)
</select>
<!-- 判断有没有兄弟 -->
<select id="ishavebro">
SELECT
id
FROM
t_core_compliance_directory
WHERE
fa_tid = :fa_tid
</select>
<!-- 添加 有兄弟,父id+获取兄弟id最大值,取最后三位+1-->
<select id="havebro">
INSERT INTO t_core_compliance_directory (
id,
edition_id,
fa_tid,
directory_id,
directory_name,
chinese_name,
foreigh_name,
abbreviation,
public_name,
public_date,
implementation_date,
revised_date,
application_state,
directory_type,
create_user,
create_date,
note,
projectid
)
VALUES
(
:id,
:edition_id,
:fa_tid,
( SELECT MAX(b.num)FROM (SELECT
LPAD( MAX(directory_id) + 1,CHARACTER_LENGTH(directory_id),0) as num
FROM
t_core_compliance_directory a
WHERE
fa_tid = :fa_tid
AND
edition_id = :edition_id
GROUP BY a.directory_id) b
),
:text,
:chinese_name,
:foreigh_name,
:abbreviation,
:public_name,
:public_date,
:implementation_date,
:revised_date,
:application_state,
:directory_type,
:create_user,
current_timestamp(),
:note,
:projectid
)
</select>
<!-- 添加 无兄弟 父id+001 本身id-->
<select id="nothavebro">
INSERT INTO t_core_compliance_directory (
id,
edition_id,
fa_tid,
directory_id,
directory_name,
chinese_name,
foreigh_name,
abbreviation,
public_name,
public_date,
implementation_date,
revised_date,
application_state,
directory_type,
create_user,
create_date,
note,
projectid
)
VALUES
(
:id,
:edition_id,
:fa_tid,
(
SELECT
CONCAT(directory_id, '001')
FROM
t_core_compliance_directory a
WHERE
tid = :fa_tid
),
:text,
:chinese_name,
:foreigh_name,
:abbreviation,
:public_name,
:public_date,
:implementation_date,
:revised_date,
:application_state,
:directory_type,
:create_user,
current_timestamp(),
:note,
:projectid
)
</select>
<!-- ***************** 删除部分**************** -->
<!-- 删除本身及子-->
<select id="delselfandson">
DELETE
FROM
t_core_compliance_directory
WHERE
directory_id LIKE (CONCAT(:directory_id, '%'))
</select>
<!-- 查询本身及子-->
<select id="getselfandson">
SELECT
ad.id as id,
cd.id as attachment_id,
ad.attachment_name as attachment_name,
ad.attachment_form as attachment_form
FROM
t_core_compliance_directory cd,t_core_attachment_directory ad
WHERE
cd.id = ad.attachment_id
and
cd.directory_id LIKE (CONCAT(:directory_id, '%'))
</select>
<!-- 查找所有大于自己的兄弟及其子-->
<select id="findbroandhisson">
SELECT
id,
fa_tid,
directory_id as id,
directory_name as text
FROM
t_core_compliance_directory
WHERE
directory_id LIKE (CONCAT(:fa_id, '%'))
AND substring(
directory_id,
1,
CHARACTER_LENGTH(:directory_id)
) > :directory_id
</select>
<!-- 如果父id与其相同 更新-->
<select id="updatebro">
UPDATE t_core_compliance_directory
SET directory_id = LPAD(
(directory_id - 1),
CHARACTER_LENGTH(directory_id),
0
)
WHERE
id = :id
</select>
<!-- 如果父id与其不相同 更新-->
<select id="updatebroson">
UPDATE t_core_compliance_directory
SET directory_id = LPAD(
CONCAT(
(
substring(
directory_id,
1,
CHARACTER_LENGTH(:del_id)
) - 1
),
substring(
directory_id,
CHARACTER_LENGTH(:del_id) + 1,
CHARACTER_LENGTH(directory_id)
)
),
CHARACTER_LENGTH(directory_id),
0
),
fa_tid = LPAD(
CONCAT(
(
substring(
fa_tid,
1,
CHARACTER_LENGTH(:del_id)
) - 1
),
substring(
fa_tid,
CHARACTER_LENGTH(:del_id) + 1,
CHARACTER_LENGTH(fa_tid)
)
),
CHARACTER_LENGTH(fa_tid),
0
)
WHERE
id= :id
</select>
<!-- 分页查询powercenter数据生成规则 -->
<select id="dataScopeGroup">
SELECT
id,
directory_id as id,
directory_name as text,
fa_tid,
chinese_name,
foreigh_name,
abbreviation,
public_name,
public_date,
implementation_date,
revised_date,
application_state,
directory_type,
create_user,
create_date,
note
FROM
t_core_compliance_directory
WHERE
edition_id = :edition_id
ORDER BY directory_id
</select>
<select id="dataScopeGroupByCondition">
SELECT
id,
directory_id as id,
directory_name as text,
fa_tid,
chinese_name,
foreigh_name,
abbreviation,
public_name,
public_date,
implementation_date,
revised_date,
application_state,
directory_type,
create_user,
create_date,
note
FROM
t_core_compliance_directory
WHERE
edition_id = :edition_id
and
:condition like (CONCAT(%,:searchVal, '%'))
ORDER BY directory_id
</select>
<!-- zhladd api用 -->
<select id="complianceDirectory">
SELECT
id as id,
directory_id as tid,
directory_name as text,
fa_tid,
edition_id as edition_id,
'5' as type
FROM
t_core_compliance_directory
WHERE
edition_id = :edition_id
ORDER BY directory_id
</select>
<!-- 更新操作 -->
<select id="updatescope">
UPDATE t_core_compliance_directory
SET directory_name = :text,
chinese_name =:chinese_name,
foreigh_name=:foreigh_name,
abbreviation=:abbreviation,
public_name=:public_name,
public_date=:public_date,
implementation_date=:implementation_date,
revised_date=:revised_date,
application_state=:application_state,
directory_type=:directory_type,
create_user = :create_user,
create_date = current_timestamp(),
note = :note
WHERE
id = :id
</select>
<!-- 合规目录下拉列表 -->
<select id="queryComplianceDirectoryList">
select a.id as id, a.directory_name as name from t_core_compliance_directory a
</select>
<!-- 敏感等级下拉列表 -->
<select id="getTCoreSensitiveLevelList">
select a.id as id, a.sensitive_name as name from t_core_sensitive_level a
</select>
<!-- 数据分类下拉列表 -->
<select id="getCoreDataScopeList">
select a.id as id, a.directory_name as name from t_core_compliance_directory a
</select>
<!-- 字段法律法规列表 -->
<select id="getFieldDetail">
select * from(
SELECT a.id,a.fields,a.`names`,a.tschemas,c.directory_name as rulename,'分类分级' as type
from t_core_table_field a,t_core_scope_field b,t_core_compliance_directory c
where a.id=b.tablefield_id and b.directory_id=c.id
UNION
select d.id,d.fields,d.`names`,d.tschemas,f.directory_name as rulename,'合规目录' as type
from t_core_table_field d,t_core_field_directory e,t_core_compliance_directory f
where d.id=e.tablefield_id and e.directory_id=f.id
UNION
select g.id,g.fields,g.`names`,g.tschemas,i.sensitive_name as rulename,'敏感等级' as type
from t_core_table_field g,t_core_field_sensitive h,t_core_sensitive_level i
where g.id=h.tablefield_id and h.sensitive_id=i.id
) x
where x.id=:columnid
</select>
<!-- 更新操作 -->
<select id="updateattachmentdirectory">
UPDATE t_core_attachment_directory
SET
create_user = :create_user,
create_date = current_timestamp(),
file_note = :file_note
WHERE
id = :id
</select>
</sqls>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论