75 lines
2.3 KiB
Java
75 lines
2.3 KiB
Java
|
|
package com.nis.web.service.basics;
|
||
|
|
|
||
|
|
import java.util.ArrayList;
|
||
|
|
import java.util.Date;
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
import org.springframework.beans.BeanUtils;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.stereotype.Service;
|
||
|
|
import org.springframework.transaction.annotation.Transactional;
|
||
|
|
|
||
|
|
import com.nis.domain.Page;
|
||
|
|
import com.nis.domain.basics.AsnGroupInfo;
|
||
|
|
import com.nis.domain.basics.AsnIpCfg;
|
||
|
|
import com.nis.domain.basics.UrlCommGroupCfg;
|
||
|
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||
|
|
import com.nis.domain.specific.ConfigGroupInfo;
|
||
|
|
import com.nis.util.ConfigServiceUtil;
|
||
|
|
import com.nis.util.Constants;
|
||
|
|
import com.nis.web.dao.CrudDao;
|
||
|
|
import com.nis.web.dao.basics.UrlCommGroupDao;
|
||
|
|
import com.nis.web.service.CrudService;
|
||
|
|
|
||
|
|
@Service
|
||
|
|
public class UrlCommGroupService extends CrudService<CrudDao<UrlCommGroupCfg>, UrlCommGroupCfg>{
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private UrlCommGroupDao urlCommGroupDao;
|
||
|
|
|
||
|
|
|
||
|
|
public Page<UrlCommGroupCfg> findPage(Page<UrlCommGroupCfg> page, UrlCommGroupCfg entity) {
|
||
|
|
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||
|
|
entity.setPage(page);
|
||
|
|
List<UrlCommGroupCfg> list=urlCommGroupDao.findAllPageList(entity);
|
||
|
|
page.setList(list);
|
||
|
|
return page;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
public List<UrlCommGroupCfg> findByPage(String ids) {
|
||
|
|
List<UrlCommGroupCfg> list=urlCommGroupDao.findByPage(ids);
|
||
|
|
return list;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//新增 insertUrlCommGroupCfg
|
||
|
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||
|
|
public void saveUrlCommGroupCfg(CfgIndexInfo entity) {
|
||
|
|
Date createTime=new Date();
|
||
|
|
if(entity.getUrlCommGroupList()!=null) {
|
||
|
|
for(UrlCommGroupCfg cfg:entity.getUrlCommGroupList()) {
|
||
|
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||
|
|
cfg.setRequestId(0);
|
||
|
|
cfg.setClassify("0");
|
||
|
|
cfg.setAttribute("0");
|
||
|
|
cfg.setLable("0");
|
||
|
|
cfg.setIsHexbin(0);
|
||
|
|
cfg.setCreateTime(createTime);
|
||
|
|
cfg.setCreatorId(entity.getCurrentUser().getId());
|
||
|
|
cfg.setIsValid(Constants.VALID_NO);
|
||
|
|
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||
|
|
if(cfg.getCfgKeywords().contains("and")){
|
||
|
|
cfg.setExprType(1);
|
||
|
|
}else{
|
||
|
|
cfg.setExprType(0);
|
||
|
|
}
|
||
|
|
urlCommGroupDao.insertUrlCommGroupCfg(cfg);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|