Commit f1dd4197 by wuchao

新版本

parent 189e2e81
/mvnw text eol=lf
*.cmd text eol=crlf
HELP.md
target/
.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
package com.chenyang.nse.bussiness.commmon;
import com.chenyang.nse.bussiness.tools.io.FileTool;
import java.io.File;
public class A {
public static void main(String[] args) {
String path = (new FileTool()).getClassRoot() + File.separator + "fastsql_tl" + File.separator + "greemplumload.yml";
System.out.println(path);
}
}
package com.chenyang.nse.bussiness.controller.core.dataproject;
import com.chenyang.nse.bussiness.entity.vo.DiscoveryMonitorVO;
import com.chenyang.nse.bussiness.entity.vo.dataproject.TCoreDiscoveryTaskVO;
import com.chenyang.nse.bussiness.service.core.dataproject.DiscoverytaskService;
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;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping({"/core/discoverymonitorlog"})
public class AllDiscoveryTaskMonitorController {
@Autowired
private DiscoverytaskService discoverytaskService;
@RequestMapping
public String index(HttpServletRequest request, HttpServletResponse response, Model model) {
return "core/dataproject/monitor/alldiscoverytask_monitor";
}
@RequestMapping({"/queryDiscoveryTask"})
@ResponseBody
public List<DiscoveryMonitorVO> queryDiscoveryTask(HttpServletRequest request, HttpServletResponse response, String projectid) {
return this.discoverytaskService.queryDiscoveryTaskForMonitor(projectid);
}
@ResponseBody
@RequestMapping({"/queryDetail"})
public List<TCoreDiscoveryTaskVO> queryDetail(String taskid, String discoverytype, String isDmpFlag) {
new ArrayList();
List list;
if (!"1".equals(discoverytype) && !"3".equals(discoverytype) && !"4".equals(discoverytype)) {
if ("1".equals(isDmpFlag)) {
list = this.discoverytaskService.queryDiscoveryTaskDetailforDmp(taskid);
} else {
list = this.discoverytaskService.queryDiscoveryTaskDetailforTxt(taskid);
}
} else {
list = this.discoverytaskService.queryDiscoveryTaskDetailforDB(taskid);
}
return list;
}
}
package com.chenyang.nse.bussiness.controller.webApi;
import com.chenyang.nse.bussiness.annot.PassToken;
import com.chenyang.nse.bussiness.ccoresdf.CcoreSDFUtil;
import com.chenyang.nse.bussiness.entity.webApi.ApiCode;
import com.chenyang.nse.bussiness.entity.webApi.DataParams;
import com.chenyang.nse.bussiness.entity.webApi.DataParamsList;
import com.chenyang.nse.bussiness.entity.webApi.Msg;
import com.chenyang.nse.bussiness.service.webApi.WebApiService;
import com.chenyang.nse.bussiness.service.webApi.business.SecretKeyCache;
import com.chenyang.nse.bussiness.tools.encryption.EncProvider;
import java.util.List;
import java.util.Map;
import org.apache.shiro.codec.Hex;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping({"/data/api"})
public class ApiController {
private static final Logger LOGGER = LoggerFactory.getLogger(ApiController.class);
@Autowired
private WebApiService service;
@PassToken
@RequestMapping(
value = {"/enc"},
method = {RequestMethod.POST},
produces = {"application/json;charset=utf-8"}
)
@ResponseBody
public Msg enc(@RequestBody DataParamsList data) {
List<DataParams> configs = data.getConfigs();
if (configs != null && configs.size() != 0) {
try {
return this.service.enc(data);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return Msg.error(ApiCode.other, e.getMessage());
}
} else {
return Msg.succed(configs);
}
}
@PassToken
@RequestMapping(
value = {"/dec"},
method = {RequestMethod.POST},
produces = {"application/json;charset=utf-8"}
)
@ResponseBody
public Msg dec(@RequestBody DataParamsList data) {
List<DataParams> configs = data.getConfigs();
if (configs != null && configs.size() != 0) {
try {
return this.service.dec(data);
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return Msg.error(ApiCode.other, e.getMessage());
}
} else {
return Msg.succed(configs);
}
}
@PassToken
@RequestMapping(
value = {"/remote/invoke"},
method = {RequestMethod.POST},
produces = {"application/json;charset=utf-8"}
)
@ResponseBody
public String remoteEncDecInvoke(@RequestBody Map<String, String> params) {
String api = (String)params.get("api");
String key = (String)params.get("key");
String content = (String)params.get("content");
String isLike = (String)params.get("isLike");
String type = (String)params.get("type");
String project = (String)params.get("project");
String mode = (String)params.get("mode");
String fid = (String)params.get("fid");
String keepfirst = (String)params.get("keepfirst");
String encdigit = (String)params.get("encdigit");
String twoindex = (String)params.get("twoindex");
if (api != null && api.length() != 0) {
if (key != null && key.length() != 0) {
if (content != null && content.length() != 0) {
if (type != null && type.length() != 0) {
if (mode != null && mode.equalsIgnoreCase("CCORESDF")) {
if (project == null || project.length() == 0 || fid == null || fid.length() == 0) {
return "{{ERR:加密卡加密解密缺少参数project|fid";
}
key = SecretKeyCache.instance().getPKey(project, fid);
}
try {
if (api.equals("enc")) {
return EncProvider.encryptEcb(type, key, content, isLike, keepfirst, encdigit, twoindex);
} else {
return EncProvider.decryptEcb(type, key, content, isLike, keepfirst, encdigit, twoindex);
}
} catch (Exception exception) {
return "{{ERR:远程调用执行错误," + exception.toString();
}
} else {
return "{{ERR:远程调用参数type为空";
}
} else {
return content;
}
} else {
return "{{ERR:远程调用参数key为空";
}
} else {
return "{{ERR:远程调用参数api为空";
}
}
@PassToken
@RequestMapping(
value = {"/remote/queryCcoreSDFKey"},
method = {RequestMethod.POST},
produces = {"application/json;charset=utf-8"}
)
@ResponseBody
public String queryCcoreSDFKey(@RequestBody Map<String, String> params) {
String key = (String)params.get("key");
if (key != null && key.length() != 0) {
try {
if (null != key && !"".equals(key)) {
try {
byte[] endData = Hex.decode(key);
return CcoreSDFUtil.getDecrypt(endData);
} catch (Exception e) {
e.printStackTrace();
}
}
return "{{ERR:远程调用执行错误,没有解密失败";
} catch (Exception exception) {
return "{{ERR:远程调用执行错误," + exception.toString();
}
} else {
return "{{ERR:远程调用参数key为空";
}
}
}
package com.chenyang.nse.bussiness.dao.table.core.api;
import com.chenyang.nse.bussiness.dao.BaseDao;
import com.chenyang.nse.bussiness.entity.vo.api.AccountabilityVO;
import java.util.List;
import org.hibernate.transform.Transformers;
import org.springframework.stereotype.Repository;
@Repository
public class AccountabilityAPIDao extends BaseDao<AccountabilityVO, String> {
public List<AccountabilityVO> selectAccountabilityInfo(String datasystemid) {
String sql = "select duty_id,duty_name,duty_scope,duty_main,d.sysname FROM t_duty_person p JOIN t_core_datasystem d ON d.id = p.datasystemid WHERE datasystemid =:datasystemid ";
return this.getSession().createNativeQuery(sql).setParameter("datasystemid", datasystemid).setResultTransformer(Transformers.aliasToBean(AccountabilityVO.class)).getResultList();
}
public List<AccountabilityVO> selectAccountabilityInfo(String projectid, String datasystemid, String taskid) {
String sql = "SELECT schemaname ,tablename ,joinid,jointype FROM t_console_dutytableinfo d LEFT JOIN t_console_dutyjoininfo i ON i.dutytableid = d.id\r\nWHERE d.projectid = :projectid AND d.datasystemid = :datasystemid AND d.id=:taskid";
return this.getSession().createNativeQuery(sql).setParameter("projectid", projectid).setParameter("datasystemid", datasystemid).setParameter("taskid", taskid).setResultTransformer(Transformers.aliasToBean(AccountabilityVO.class)).getResultList();
}
}
package com.chenyang.nse.bussiness.dao.table.core.api;
import com.chenyang.nse.bussiness.dao.BaseDao;
import com.chenyang.nse.bussiness.entity.orm.table.core.api.ApiHeaderParameter;
import org.springframework.stereotype.Repository;
@Repository
public class ApiHeaderParameterDao extends BaseDao<ApiHeaderParameter, String> {
}
package com.chenyang.nse.bussiness.entity.orm.table.core;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(
name = "AAAA"
)
public class AAAA {
@Id
private Integer id;
@Column(
length = 255
)
private String key;
public Integer getId() {
return this.id;
}
public void setId(Integer id) {
this.id = id;
}
public String getKey() {
return this.key;
}
public void setKey(String key) {
this.key = key;
}
}
package com.chenyang.nse.bussiness.entity.orm.table.core.api;
import com.chenyang.nse.bussiness.entity.orm.table.TBaseEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(
name = "api_header_parameter"
)
public class ApiHeaderParameter extends TBaseEntity {
private String parameterName;
private String parameterValue;
private String apiInfoId;
public String getParameterName() {
return this.parameterName;
}
public void setParameterName(String parameterName) {
this.parameterName = parameterName;
}
public String getParameterValue() {
return this.parameterValue;
}
public void setParameterValue(String parameterValue) {
this.parameterValue = parameterValue;
}
public String getApiInfoId() {
return this.apiInfoId;
}
public void setApiInfoId(String apiInfoId) {
this.apiInfoId = apiInfoId;
}
}
package com.chenyang.nse.bussiness.entity.orm.table.core.api;
import com.chenyang.nse.bussiness.entity.orm.table.TBaseEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(
name = "api_info"
)
public class ApiInfo extends TBaseEntity {
private String url;
private String requestWay;
private String state;
private String headerParameterId;
private String sysParameterId;
private String taskId;
private String projectId;
private String apiType;
public String getUrl() {
return this.url;
}
public void setUrl(String url) {
this.url = url;
}
public String getRequestWay() {
return this.requestWay;
}
public void setRequestWay(String requestWay) {
this.requestWay = requestWay;
}
public String getState() {
return this.state;
}
public void setState(String state) {
this.state = state;
}
public String getHeaderParameterId() {
return this.headerParameterId;
}
public void setHeaderParameterId(String headerParameterId) {
this.headerParameterId = headerParameterId;
}
public String getSysParameterId() {
return this.sysParameterId;
}
public void setSysParameterId(String sysParameterId) {
this.sysParameterId = sysParameterId;
}
public String getTaskId() {
return this.taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getProjectId() {
return this.projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getApiType() {
return this.apiType;
}
public void setApiType(String apiType) {
this.apiType = apiType;
}
}
package com.chenyang.nse.bussiness.entity.param.scheduler;
import java.util.List;
public class AddSchedulerParam {
private String id;
private String srName;
private String rulesType;
private String rulesDay;
private String rulesHour;
private String rulesMinute;
private String rulesMonth;
private String rulesYear;
private String rulestime;
private String ruleValidity;
private String createTime;
private String projectid;
private String[] xzlist;
private String qx;
private String xloptions;
private String howtime;
private String timebox;
private List<SaveTaskParam> saveTask;
public String getQx() {
return this.qx;
}
public void setQx(String qx) {
this.qx = qx;
}
public String getXloptions() {
return this.xloptions;
}
public void setXloptions(String xloptions) {
this.xloptions = xloptions;
}
public String getHowtime() {
return this.howtime;
}
public void setHowtime(String howtime) {
this.howtime = howtime;
}
public String getTimebox() {
return this.timebox;
}
public void setTimebox(String timebox) {
this.timebox = timebox;
}
public String[] getXzlist() {
return this.xzlist;
}
public void setXzlist(String[] xzlist) {
this.xzlist = xzlist;
}
public String getRulestime() {
return this.rulestime;
}
public void setRulestime(String rulestime) {
this.rulestime = rulestime;
}
public String getProjectid() {
return this.projectid;
}
public void setProjectid(String projectid) {
this.projectid = projectid;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getSrName() {
return this.srName;
}
public void setSrName(String srName) {
this.srName = srName;
}
public String getRulesType() {
return this.rulesType;
}
public void setRulesType(String rulesType) {
this.rulesType = rulesType;
}
public String getRulesDay() {
return this.rulesDay;
}
public void setRulesDay(String rulesDay) {
this.rulesDay = rulesDay;
}
public String getRulesHour() {
return this.rulesHour;
}
public void setRulesHour(String rulesHour) {
this.rulesHour = rulesHour;
}
public String getRulesMinute() {
return this.rulesMinute;
}
public void setRulesMinute(String rulesMinute) {
this.rulesMinute = rulesMinute;
}
public List<SaveTaskParam> getSaveTask() {
return this.saveTask;
}
public void setSaveTask(List<SaveTaskParam> saveTask) {
this.saveTask = saveTask;
}
public String getRuleValidity() {
return this.ruleValidity;
}
public void setRuleValidity(String ruleValidity) {
this.ruleValidity = ruleValidity;
}
public String getCreateTime() {
return this.createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getRulesMonth() {
return this.rulesMonth;
}
public void setRulesMonth(String rulesMonth) {
this.rulesMonth = rulesMonth;
}
public String getRulesYear() {
return this.rulesYear;
}
public void setRulesYear(String rulesYear) {
this.rulesYear = rulesYear;
}
}
package com.chenyang.nse.bussiness.entity.vo.api;
public class AccountabilityVO {
private String duty_id;
private String duty_name;
private String duty_scope;
private String duty_main;
private String tablename;
private String schemaname;
private String sysname;
private String joinid;
private String jointype;
public String getTablename() {
return this.tablename;
}
public void setTablename(String tablename) {
this.tablename = tablename;
}
public String getSchemaname() {
return this.schemaname;
}
public void setSchemaname(String schemaname) {
this.schemaname = schemaname;
}
public String getSysname() {
return this.sysname;
}
public void setSysname(String sysname) {
this.sysname = sysname;
}
public String getJoinid() {
return this.joinid;
}
public void setJoinid(String joinid) {
this.joinid = joinid;
}
public String getJointype() {
return this.jointype;
}
public void setJointype(String jointype) {
this.jointype = jointype;
}
public String getDuty_id() {
return this.duty_id;
}
public void setDuty_id(String duty_id) {
this.duty_id = duty_id;
}
public String getDuty_name() {
return this.duty_name;
}
public void setDuty_name(String duty_name) {
this.duty_name = duty_name;
}
public String getDuty_scope() {
return this.duty_scope;
}
public void setDuty_scope(String duty_scope) {
this.duty_scope = duty_scope;
}
public String getDuty_main() {
return this.duty_main;
}
public void setDuty_main(String duty_main) {
this.duty_main = duty_main;
}
}
package com.chenyang.nse.bussiness.entity.vo.auditlog;
import java.util.List;
public class AccessPojo {
private String type;
private String datetime;
private String username;
private String schema;
private List<String> tags;
private List<String> tables;
private Long records;
private String action;
private String sql;
private String sqltype;
private List<String> fileds;
public String getDatetime() {
return this.datetime;
}
public void setDatetime(String datetime) {
this.datetime = datetime;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public String getSchema() {
return this.schema;
}
public void setSchema(String schema) {
this.schema = schema;
}
public List<String> getTags() {
return this.tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public List<String> getTables() {
return this.tables;
}
public void setTables(List<String> tables) {
this.tables = tables;
}
public Long getRecords() {
return this.records;
}
public void setRecords(Long records) {
this.records = records;
}
public String getAction() {
return this.action;
}
public void setAction(String action) {
this.action = action;
}
public String getSql() {
return this.sql;
}
public void setSql(String sql) {
this.sql = sql;
}
public List<String> getFileds() {
return this.fileds;
}
public void setFileds(List<String> fileds) {
this.fileds = fileds;
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
}
public String getSqltype() {
return this.sqltype;
}
public void setSqltype(String sqltype) {
this.sqltype = sqltype;
}
}
package com.chenyang.nse.bussiness.entity.webApi;
public enum ApiCode {
ok("0", ""),
invaliadConfig("10", "无效的配置信息"),
encFailed("20", "加密失败%s"),
decFailed("30", "解密失败%s"),
dataOverflow("40", "超过数据处理上线,传入的数据量为:%s"),
unconfig("50", "未配置加密信息:%s"),
other("999", "其它未知异常:%s");
private String code;
private String text;
public String getCode() {
return this.code;
}
public String getText() {
return this.text;
}
private ApiCode(String code, String text) {
this.code = code;
this.text = text;
}
}
package com.chenyang.nse.bussiness.kms.controller;
import com.chenyang.nse.bussiness.kms.service.KmsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping({"kms"})
public class AccessTokenController {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
protected KmsService kmsService;
@RequestMapping({"accesstoken"})
public String accessToken() throws Exception {
return this.kmsService.obtainAccessToken(this.kmsService.obtainChallengeCode());
}
}
package com.chenyang.nse.bussiness.odbc;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.chenyang.nse.bussiness.odbc.business.OdbcApi;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import java.nio.charset.StandardCharsets;
public class ApiHandler extends ChannelInboundHandlerAdapter {
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
ByteBuf byteBuf = (ByteBuf)msg;
byte[] buffer = new byte[byteBuf.readableBytes()];
byteBuf.readBytes(buffer);
Object response = OdbcApi.service(buffer);
String json = "{}";
if (response != null) {
if (response instanceof String) {
json = (String)response;
} else {
ObjectMapper mapper = new ObjectMapper();
json = mapper.writeValueAsString(response);
}
}
json = json + "\n\n";
byte[] jsonBuf = json.getBytes(StandardCharsets.UTF_8);
ByteBuf buf = Unpooled.wrappedBuffer(jsonBuf);
ctx.writeAndFlush(buf);
buf.clear();
}
}
package com.chenyang.nse.bussiness.service.core;
import com.chenyang.nse.bussiness.engine.infa.InfoProperty;
import com.chenyang.nse.bussiness.engine.infa.basic.webservice.SessionBean;
import com.chenyang.nse.bussiness.entity.orm.table.core.TCoreImporttask;
import com.chenyang.nse.bussiness.entity.orm.table.core.masking.TCoreMaskingTask;
import com.chenyang.nse.bussiness.entity.orm.table.core.masking.TCoreSyncKeyindex;
import com.chenyang.nse.bussiness.entity.orm.table.core.maskingself.TCoreMaskingselfTask;
import java.sql.Connection;
import java.util.List;
import java.util.Map;
public interface AllwaysMonitorService {
SessionBean getLog(String taskid);
SessionBean getTime(String taskid);
boolean stopwork(String taskid, String wfname);
boolean recoverywork(String taskid, String wfname);
SessionBean getLogForTaskMapping(TCoreMaskingTask task, InfoProperty engine, String name);
SessionBean getLogForImpMapping(TCoreMaskingTask task, InfoProperty engine, TCoreImporttask timptask);
TCoreImporttask getImpTask(TCoreMaskingTask task);
SessionBean getLogForSelfTaskMapping(TCoreMaskingselfTask task, InfoProperty engine, String name);
SessionBean getRunid(TCoreMaskingTask task, InfoProperty engine, String name);
Connection getConnectionByDataSystemId(String datasystemid);
List<Map<String, String>> getSyncPrimary(String taskid, String sourcename, String targetname);
List<Map<String, String>> getSyncIndex(String taskid, String sourcename, String targetname);
TCoreSyncKeyindex getSyncKeyIndex(String taskid, String sourcename);
SessionBean getSessionLog(TCoreMaskingTask task, String wfname, InfoProperty engine);
}
package com.chenyang.nse.bussiness.service.core;
import com.chenyang.nse.bussiness.entity.vo.api.DiscoverApiDirectoryVO;
import java.util.List;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public interface ApiDirectoryService {
List<DiscoverApiDirectoryVO> getDiscoverApiDirectory(String projectid, String editionid);
List<DiscoverApiDirectoryVO> getSortApiDirectory(String projectid, String editionid);
List<DiscoverApiDirectoryVO> getLevelApiDirectory(String projectid, String editionid);
List<DiscoverApiDirectoryVO> getComplianceApiDirectory(String projectid, String editionid);
List<DiscoverApiDirectoryVO> getDesensitizationApiDirectory(String projectid, String editionid);
List<DiscoverApiDirectoryVO> getAccountabilityApiDirectory(String projectid, String editionid);
}
package com.chenyang.nse.bussiness.service.core.api;
import com.chenyang.nse.bussiness.entity.orm.table.core.duty.DutyTableInfo;
import com.chenyang.nse.bussiness.entity.vo.api.AccountabilityVO;
import java.util.List;
public interface AccountabilityAPIService {
List<AccountabilityVO> selectAccountabilityInfo(DutyTableInfo obj);
}
package com.chenyang.nse.bussiness.service.core.api;
import com.chenyang.nse.bussiness.entity.orm.table.core.api.ApiHeaderParameter;
import java.util.List;
public interface ApiHeaderParameterService {
List<ApiHeaderParameter> querylist();
}
package com.chenyang.nse.bussiness.service.core.api.impl;
import com.chenyang.nse.bussiness.dao.table.core.api.AccountabilityAPIDao;
import com.chenyang.nse.bussiness.entity.orm.table.core.duty.DutyTableInfo;
import com.chenyang.nse.bussiness.entity.vo.api.AccountabilityVO;
import com.chenyang.nse.bussiness.service.core.api.AccountabilityAPIService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class AccountabilityAPIServiceImpl implements AccountabilityAPIService {
@Autowired
private AccountabilityAPIDao accountabilityAPIDao;
public List<AccountabilityVO> selectAccountabilityInfo(DutyTableInfo obj) {
return obj.getProjectid() == null ? this.accountabilityAPIDao.selectAccountabilityInfo(obj.getDatasystemid()) : this.accountabilityAPIDao.selectAccountabilityInfo(obj.getProjectid(), obj.getDatasystemid(), obj.getId());
}
}
package com.chenyang.nse.bussiness.service.core.api.impl;
import com.chenyang.nse.bussiness.dao.table.core.api.ApiHeaderParameterDao;
import com.chenyang.nse.bussiness.entity.orm.table.core.api.ApiHeaderParameter;
import com.chenyang.nse.bussiness.service.core.api.ApiHeaderParameterService;
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 ApiHeaderParameterServiceImpl implements ApiHeaderParameterService {
@Autowired
private ApiHeaderParameterDao apiHeaderParameterDao;
public List<ApiHeaderParameter> querylist() {
List<ApiHeaderParameter> list = this.apiHeaderParameterDao.queryAll();
return list;
}
}
package com.chenyang.nse.bussiness.tools.string;
import com.chenyang.nse.bussiness.tools.encryption.EncProvider;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
public class AesTool {
private static final String PASSWORD_SM4_KEY = "D1439845B4270773520B1B2B269A4383";
public static String encrypt(String content, String password) {
try {
return EncProvider.encryptEcb("SM4", "D1439845B4270773520B1B2B269A4383", content, "0", (String)null, (String)null, (String)null);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static String decrypt(String content, String password) {
try {
return EncProvider.decryptEcb("SM4", "D1439845B4270773520B1B2B269A4383", content, "0", (String)null, (String)null, (String)null);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
e.printStackTrace();
} catch (BadPaddingException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static String parseByte2HexStr(byte[] buf) {
StringBuffer sb = new StringBuffer();
for(int i = 0; i < buf.length; ++i) {
String hex = Integer.toHexString(buf[i] & 255);
if (hex.length() == 1) {
hex = '0' + hex;
}
sb.append(hex.toUpperCase());
}
return sb.toString();
}
public static byte[] parseHexStr2Byte(String hexStr) {
if (hexStr.length() < 1) {
return null;
} else {
byte[] result = new byte[hexStr.length() / 2];
for(int i = 0; i < hexStr.length() / 2; ++i) {
int high = Integer.parseInt(hexStr.substring(i * 2, i * 2 + 1), 16);
int low = Integer.parseInt(hexStr.substring(i * 2 + 1, i * 2 + 2), 16);
result[i] = (byte)(high * 16 + low);
}
return result;
}
}
public static void main(String[] args) {
String content = "mydata";
String password = "ghca";
System.out.println("加密之前:" + content);
String encrypt = encrypt(content, password);
System.out.println("加密后的内容:" + encrypt);
System.out.println("加密后字符串长度:" + encrypt.length());
String decrypt = decrypt(encrypt, password);
System.out.println("解密后的内容:" + new String(decrypt));
}
}
package com.chenyang.nse.bussiness.tools.xml.xmlclass;
import com.spire.doc.Document;
import com.spire.doc.FileFormat;
import com.spire.doc.documents.HorizontalAlignment;
import com.spire.doc.documents.Paragraph;
import com.spire.doc.fields.TableOfContent;
import com.spire.doc.fields.TextRange;
import java.awt.Color;
public class AddToc {
public static void AddToc(String path) {
Document doc = new Document(path);
Paragraph parainserted = new Paragraph(doc);
TextRange tr = parainserted.appendText("目 录");
tr.getCharacterFormat().setBold(true);
tr.getCharacterFormat().setTextColor(Color.gray);
doc.getSections().get(0).getParagraphs().insert(0, parainserted);
parainserted.getFormat().setHorizontalAlignment(HorizontalAlignment.Center);
new TableOfContent(doc, "{\\o \"1-3\" \\h \\z \\u}");
doc.getSections().get(0).getParagraphs().get(0).appendTOC(1, 3);
doc.updateTableOfContents();
doc.saveToFile(path, FileFormat.Docx_2010);
}
}
package com.chenyang.nse.bussiness.tools.xml.xmlclass.product;
public class Address {
private String host;
private String port;
public String getHost() {
return this.host;
}
public void setHost(String host) {
this.host = host;
}
public String getPort() {
return this.port;
}
public void setPort(String port) {
this.port = port;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论