(1)ip,字符串,增强字符串mapper.xml里的get方法删除多余参数,只保留cfgId以及compileId。
(2)系统字典表更新方法查询多域增强字符串配置的匹配区域。mysql这里查询好像自动大小写忽略,待测试。 (3)多域界面提交。界面展示采用查一张主表再查其他表的方式展示,非所有表都有的字段只能查主表的,这里界面查询条件已做限制;另外表单提交未做验证;多个同类型(字符串,增强字符串)的表现在界面无法区分,后面会将界面展示意义不明的字段调整展示名称。
This commit is contained in:
@@ -274,7 +274,9 @@ public class SysDictInfoService extends BaseService{
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<SysDictInfo> getDistrictDict(String tableName){
|
||||
return sysDictInfoDao.getDistrictDict(tableName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.MultipleCfg;
|
||||
import com.nis.domain.configuration.MultipleSearchCfg;
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.configuration.ComplexStringCfgDao;
|
||||
import com.nis.web.dao.configuration.IpCfgDao;
|
||||
import com.nis.web.dao.configuration.MultipleCfgDao;
|
||||
@@ -76,7 +81,12 @@ public class MultipleCfgService extends CrudService<MultipleCfgDao,MultipleSearc
|
||||
if(cfg==null) return 0;
|
||||
if(cfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
|
||||
ipCfgDao.updateByPrimaryKeySelective(_cfg);
|
||||
if(_cfg.getCfgId()==null){//修改配置时用户可能希望新增IP配置,此时新增的IP配置无配置ID
|
||||
ipCfgDao.insert(_cfg);
|
||||
}else{
|
||||
ipCfgDao.updateByPrimaryKeySelective(_cfg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(cfg.getStringCfg()!=null){
|
||||
@@ -128,32 +138,85 @@ public class MultipleCfgService extends CrudService<MultipleCfgDao,MultipleSearc
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @throws Exception
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int auditCfg(MultipleCfg cfg){
|
||||
public int auditCfg(MultipleCfg sendCfg,MultipleCfg cfg) throws Exception{
|
||||
if(cfg==null) return 0;
|
||||
if(cfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
|
||||
ipCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getStringCfg()!=null){
|
||||
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
|
||||
stringCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getNumCfg()!=null){
|
||||
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
|
||||
numCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getComplexCfg()!=null){
|
||||
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
|
||||
complexStringCfgDao.audit(_cfg);
|
||||
if(Constants.AUDIT_YES==cfg.getIsAudit()||Constants.AUDIT_NOT_YES==cfg.getIsAudit()){
|
||||
List<BaseCfg> cfgs=new ArrayList<BaseCfg>();
|
||||
if(sendCfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:sendCfg.getIpCfg().values()){
|
||||
cfgs.add(_cfg);
|
||||
}
|
||||
}
|
||||
if(sendCfg.getStringCfg()!=null){
|
||||
for(BaseStringCfg _cfg:sendCfg.getStringCfg().values()){
|
||||
cfgs.add(_cfg);
|
||||
}
|
||||
}
|
||||
if(sendCfg.getNumCfg()!=null){
|
||||
for(NumBoundaryCfg _cfg:sendCfg.getNumCfg().values()){
|
||||
cfgs.add(_cfg);
|
||||
}
|
||||
}
|
||||
if(sendCfg.getComplexCfg()!=null){
|
||||
for(ComplexkeywordCfg _cfg:sendCfg.getComplexCfg().values()){
|
||||
cfgs.add(_cfg);
|
||||
}
|
||||
}
|
||||
BaseCfg[] cfgArray=new BaseCfg[cfgs.size()];
|
||||
cfgs.toArray(cfgArray);
|
||||
if(this.sendToMaatConvertor(cfg.getIsAudit(), null, cfgArray)){
|
||||
if(cfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
|
||||
ipCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getStringCfg()!=null){
|
||||
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
|
||||
stringCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getNumCfg()!=null){
|
||||
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
|
||||
numCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getComplexCfg()!=null){
|
||||
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
|
||||
complexStringCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
|
||||
}else{
|
||||
if(cfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
|
||||
ipCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getStringCfg()!=null){
|
||||
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
|
||||
stringCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getNumCfg()!=null){
|
||||
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
|
||||
numCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getComplexCfg()!=null){
|
||||
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
|
||||
complexStringCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user