📄 repositoryinfo.java
字号:
respositorydao.setPublish_user_id(inbuffer.getString("SESSION_USER_ID"));
respositorydao.setCust_id(inbuffer.getString("SESSION_CUST_ID"));
int iResult = -1;
try {
iResult = modRepositoryInfo(respositorydao);
}
catch (SaasApplicationException e) {
log.LOG_INFO(e.getMessage());
}
if (iResult != 0) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
}
else {
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出addRepositoryInfo方法...");
}
public int modRepositoryInfo(RepositoryDAO respositorydao) throws SaasApplicationException {
commMethodMgr comm = new commMethodMgr();
String repository_id = comm.GenTradeId();
String pic_path = "";
RepositoryExt repositoryExt = new RepositoryExt();
repositoryExt.setParam(":VREPOSITORY_ID", respositorydao.getRepository_id());
repositoryExt.setParam(":VTITLE", respositorydao.getTitle());
repositoryExt.setParam(":VCONTENT", respositorydao.getContent());
repositoryExt.setParam(":VREPOSITORY_TYPE", respositorydao.getRepository_type());
repositoryExt.setParam(":VPUBLISH_USER_ID", respositorydao.getPublish_user_id());
repositoryExt.setParam(":VCUST_ID", respositorydao.getCust_id());
repositoryExt.setParam(":VAFFIX_NUMBER", pic_path);
tradeQuery.executeBy(repositoryExt.insBy("MOD_BY_REPOSITORY"));
return 0;
}
// 知识删除
public void delRepositoryInfo(Buffers inbuffer) {
log.LOG_INFO("进入addRepositoryInfo方法...");
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
String respository_id = inbuffer.getString("REPOSITORY_ID");
int iResult = -1;
try {
iResult = delRepositoryInfo(respository_id);
}
catch (SaasApplicationException e) {
log.LOG_INFO(e.getMessage());
}
if (iResult != 0) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
}
else {
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出addRepositoryInfo方法...");
}
public int delRepositoryInfo(String respository_id) throws SaasApplicationException {
commMethodMgr comm = new commMethodMgr();
RepositoryExt repositoryExt = new RepositoryExt();
repositoryExt.setParam(":VREPOSITORY_ID", respository_id);
tradeQuery.executeBy(repositoryExt.insBy("DEL_BY_REPOSITORY"));
return 0;
}
// 查询单条知识库信息
public ArrayList getRepositoryIdx(String respository_id) throws SaasApplicationException {
commMethodMgr comm = new commMethodMgr();
ArrayList resposList = new ArrayList();
RepositoryExt repositoryExt = new RepositoryExt();
repositoryExt.setParam(":VREPOSITORY_ID", respository_id);
resposList = repositoryExt.selByList("SEL_BY_REPOSITORYID");
return resposList;
}
// 查找附件
public String searchfj(String commodity_id, String flag) throws SaasApplicationException {
log.LOG_INFO("进入searchfj方法...");
Attachinfo attachInfo = new Attachinfo();
String file_path = attachInfo.getAttachPath(commodity_id, flag, "0");
log.LOG_INFO("退出searchfj方法...");
return file_path;
}
/**
* @param title
* @param cust_id
* @return
* @throws SaasApplicationException
*/
public ArrayList searchRepoitory(String title, String cust_id) throws SaasApplicationException {
ArrayList itemsList = new ArrayList();
RepositoryExt repositoryExt = new RepositoryExt();
repositoryExt.setParam(":VTITLE", "%" + title + "%");
repositoryExt.setParam(":VCUST_ID", cust_id);
itemsList = repositoryExt.selByList("SEL_BY_SEARCH");
return itemsList;
}
// 知识库分页查询
public ArrayList getRepositoryByCustId(int iStart, String cust_id) throws SaasApplicationException {
ArrayList itemsList = new ArrayList();
RepositoryExt repositoryExt = new RepositoryExt();
repositoryExt.setParam(":VCUST_ID", cust_id);
repositoryExt.setParam(":VVALIDITY", "0");
if (iStart == 0) {
iStart = 0;
}
else {
iStart = (iStart - 1) * 30;
}
itemsList = repositoryExt.selByList("SEL_BY_CUST", iStart, 30);
return itemsList;
}
// 知识库信息统计
public int getReposityNumber(String cust_id) throws SaasApplicationException {
ArrayList itemsList = new ArrayList();
RepositoryExt repositoryExt = new RepositoryExt();
repositoryExt.setParam(":VCUST_ID", cust_id);
repositoryExt.setParam(":VVALIDITY", "0");
itemsList = repositoryExt.selByList("SEL_BY_CUST");
if (itemsList != null) {
return itemsList.size();
}
else {
return 0;
}
}
// 查询分类的级别
public String getProductClassByClassId(String classId) throws SaasApplicationException {
String classLeave = "";
ProductclassExt productclassExt = new ProductclassExt();
ArrayList classList = new ArrayList();
productclassExt.setParam(":VCLASS_ID", classId);
log.LOG_INFO("开始查询级别......." + classId);
classList = productclassExt.selByList("SEL_BY_CLASSID");
log.LOG_INFO("取出分类级别......." + classId + "...............");
if (classList != null && classList.size() > 0) {
HashMap map = (HashMap) classList.get(0);
if (map.get("class_level") != null) {
classLeave = map.get("class_level").toString();
}
}
log.LOG_INFO("返回级别......." + classLeave + "...............");
return classLeave;
}
// 判断是否有下级
public boolean hasChildren(String class_id) throws SaasApplicationException {
ProductclassExt productclassExt = new ProductclassExt();
ArrayList classList = new ArrayList();
productclassExt.setParam(":VUP_CLASS_ID", class_id);
classList = productclassExt.selByList("SEL_BY_UP");
if (classList != null && classList.size() > 0) {
return true;
}
else {
return false;
}
}
public ArrayList Schrepoitory() throws SaasApplicationException {
ArrayList itemsList = new ArrayList();
RepositoryExt repositoryExt = new RepositoryExt();
itemsList = repositoryExt.selByList("SEL_SCH_BY_REP");
return itemsList;
}
public ArrayList SchrepoitoryById(String repository_id) throws SaasApplicationException {
ArrayList itemsList = new ArrayList();
RepositoryExt repositoryExt = new RepositoryExt();
repositoryExt.setParam(":VREPOSITORY_ID", repository_id);
itemsList = repositoryExt.selByList("SEL_BY_PK");
return itemsList;
}
public ArrayList getRepositoryByDate(int iStart, int limit) throws SaasApplicationException {
if (iStart > 1) {
iStart = (iStart - 1) * limit;
}
else {
iStart = 0;
}
ArrayList itemsList = new ArrayList();
RepositoryExt repositoryExt = new RepositoryExt();
itemsList = repositoryExt.selByList("SEL_SCH_BY", iStart, limit);
return itemsList;
}
public int getRepositoryByDate() throws SaasApplicationException {
int count = 0;
RepositoryExt enquiryExt = new RepositoryExt();
ArrayList list = enquiryExt.selByList("SEL_SCH_BY");
if (list != null && list.size() > 0) {
count = list.size();
}
return count;
}
/**
* @param type
* 知识分类
* @param iStart
* 开始页码
* @param limit
* 限制条数
* @return 知识信息
* @throws SaasApplicationException
*/
public ArrayList getRepositoryByType(String type, int iStart, int limit) throws SaasApplicationException {
if (iStart > 1) {
iStart = (iStart - 1) * limit;
}
else {
iStart = 0;
}
ArrayList list = new ArrayList();
RepositoryExt repositoryExt = new RepositoryExt();
repositoryExt.setParam(":VREPOSITORY_TYPE", type);
list = repositoryExt.selByList("SEL_BY_CLASS_TYPE", iStart, limit);
return list;
}
public int getRepositoryByType(String type) throws SaasApplicationException {
ArrayList list = new ArrayList();
int size = 0;
RepositoryExt repositoryExt = new RepositoryExt();
repositoryExt.setParam(":VREPOSITORY_TYPE", type);
list = repositoryExt.selByList("SEL_BY_CLASS_TYPE_CT");
if (list != null && list.size() > 0) {
HashMap map = (HashMap) list.get(0);
size = Integer.parseInt(map.get("ct").toString());
}
return size;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -