补充上次提交.
This commit is contained in:
@@ -1769,158 +1769,158 @@ public class BaseController {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
if(!regionDict.getFunctionId().equals(560)) {
|
if(!regionDict.getFunctionId().equals(560)) {
|
||||||
List<BaseStringCfg> _stringCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
List<BaseStringCfg> _stringCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
while(!stringCfgs.isEmpty()) {
|
while(!stringCfgs.isEmpty()) {
|
||||||
stringCfgs.drainTo(_stringCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
stringCfgs.drainTo(_stringCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||||
List<Integer> compileIds=Lists.newArrayList();
|
List<Integer> compileIds=Lists.newArrayList();
|
||||||
List<Integer> groupIds=Lists.newArrayList();
|
List<Integer> groupIds=Lists.newArrayList();
|
||||||
List<Integer> regionIds=Lists.newArrayList();
|
List<Integer> regionIds=Lists.newArrayList();
|
||||||
try {
|
try {
|
||||||
compileIds = ConfigServiceUtil.getId(1,_stringCfgs.size());
|
compileIds = ConfigServiceUtil.getId(1,_stringCfgs.size());
|
||||||
if(isSend.equals("1")) {
|
if(isSend.equals("1")) {
|
||||||
groupIds = ConfigServiceUtil.getId(2,_stringCfgs.size());
|
groupIds = ConfigServiceUtil.getId(2,_stringCfgs.size());
|
||||||
regionIds = ConfigServiceUtil.getId(3,_stringCfgs.size());
|
regionIds = ConfigServiceUtil.getId(3,_stringCfgs.size());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("获取编译ID出错");
|
logger.info("获取编译ID出错");
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
}
|
|
||||||
int ind=0;
|
|
||||||
for (BaseStringCfg cfg : _stringCfgs) {
|
|
||||||
cfg.setAction(serviceDict.getAction());
|
|
||||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
|
||||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
|
||||||
cfg.setCreateTime(date);
|
|
||||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
|
||||||
cfg.setDoLog(2);
|
|
||||||
cfg.setFunctionId(regionDict.getFunctionId());
|
|
||||||
if(isSend.equals("1")) {
|
|
||||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
|
||||||
cfg.setIsValid(Constants.VALID_YES);
|
|
||||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
|
||||||
cfg.setAuditTime(date);
|
|
||||||
if(groupIds!=null&&groupIds.size()==_stringCfgs.size()) {
|
|
||||||
cfg.setGroupId(groupIds.get(ind));
|
|
||||||
}
|
|
||||||
if(regionIds!=null&®ionIds.size()==_stringCfgs.size()) {
|
|
||||||
cfg.setRegionId(regionIds.get(ind));
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
|
||||||
cfg.setIsValid(Constants.VALID_NO);
|
|
||||||
}
|
}
|
||||||
cfg.setIsAreaEffective(0);
|
int ind=0;
|
||||||
cfg.setLable("0");
|
for (BaseStringCfg cfg : _stringCfgs) {
|
||||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
cfg.setAction(serviceDict.getAction());
|
||||||
cfg.setAttribute(attribute);
|
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||||
cfg.setClassify(classify);
|
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||||
cfg.setServiceId(serviceDict.getServiceId());
|
cfg.setCreateTime(date);
|
||||||
if(compileIds!=null&&compileIds.size()==_stringCfgs.size()) {
|
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||||
cfg.setCompileId(compileIds.get(ind));
|
cfg.setDoLog(2);
|
||||||
}
|
cfg.setFunctionId(regionDict.getFunctionId());
|
||||||
if(specificServiceCfg!=null) {
|
if(isSend.equals("1")) {
|
||||||
cfg.setAppCode(specificServiceCfg.getSpecServiceCode());
|
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||||
cfg.setSpecServiceId(specificServiceCfg.getSpecServiceId());
|
cfg.setIsValid(Constants.VALID_YES);
|
||||||
if(StringUtils.isNotBlank(behaviorId))
|
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
cfg.setBehavCode(Integer.parseInt(behaviorId));
|
cfg.setAuditTime(date);
|
||||||
}
|
if(groupIds!=null&&groupIds.size()==_stringCfgs.size()) {
|
||||||
if (serviceDict.getServiceId().intValue() == 33
|
cfg.setGroupId(groupIds.get(ind));
|
||||||
|| serviceDict.getServiceId().intValue() == 145
|
|
||||||
|| serviceDict.getServiceId().intValue() == 35
|
|
||||||
|| serviceDict.getServiceId().intValue() == 147
|
|
||||||
|| serviceDict.getServiceId().intValue() == 36
|
|
||||||
|| serviceDict.getServiceId().intValue() == 148) {
|
|
||||||
if (appRegion != null) {
|
|
||||||
AppPolicyCfg appPolicyCfg = new AppPolicyCfg();
|
|
||||||
BeanUtils.copyProperties(cfg, appPolicyCfg,new String[] {"cfgId"});
|
|
||||||
//appPolicyCfg.setSpecServiceId(specificServiceCfg.getSpecServiceId());
|
|
||||||
//appPolicyCfg.setAppCode(specificServiceCfg.getSpecServiceCode());
|
|
||||||
appPolicyCfg.setMatchMethod(0);
|
|
||||||
appPolicyCfg.setIsHexbin(0);
|
|
||||||
appPolicyCfg.setCfgType(appRegion.getConfigRegionValue());
|
|
||||||
appPolicyCfg.setCfgRegionCode(appRegion.getConfigRegionCode());
|
|
||||||
if (StringUtils.isNotBlank(behaviorId)) {
|
|
||||||
//appPolicyCfg.setBehavCode(Integer.parseInt(behaviorId));
|
|
||||||
appPolicyCfg.setExprType(1);
|
|
||||||
} else {
|
|
||||||
appPolicyCfg.setExprType(0);
|
|
||||||
}
|
}
|
||||||
appPolicyCfgs.add(appPolicyCfg);
|
if(regionIds!=null&®ionIds.size()==_stringCfgs.size()) {
|
||||||
|
cfg.setRegionId(regionIds.get(ind));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
}
|
}
|
||||||
} else {
|
cfg.setIsAreaEffective(0);
|
||||||
if(!regionDict.getFunctionId().equals(403)) {
|
cfg.setLable("0");
|
||||||
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||||
BeanUtils.copyProperties(cfg, cfgIndexInfo, new String[] {"cfgId"});
|
cfg.setAttribute(attribute);
|
||||||
cfgIndexInfos.add(cfgIndexInfo);
|
cfg.setClassify(classify);
|
||||||
|
cfg.setServiceId(serviceDict.getServiceId());
|
||||||
|
if(compileIds!=null&&compileIds.size()==_stringCfgs.size()) {
|
||||||
|
cfg.setCompileId(compileIds.get(ind));
|
||||||
}
|
}
|
||||||
|
if(specificServiceCfg!=null) {
|
||||||
|
cfg.setAppCode(specificServiceCfg.getSpecServiceCode());
|
||||||
|
cfg.setSpecServiceId(specificServiceCfg.getSpecServiceId());
|
||||||
|
if(StringUtils.isNotBlank(behaviorId))
|
||||||
|
cfg.setBehavCode(Integer.parseInt(behaviorId));
|
||||||
|
}
|
||||||
|
if (serviceDict.getServiceId().intValue() == 33
|
||||||
|
|| serviceDict.getServiceId().intValue() == 145
|
||||||
|
|| serviceDict.getServiceId().intValue() == 35
|
||||||
|
|| serviceDict.getServiceId().intValue() == 147
|
||||||
|
|| serviceDict.getServiceId().intValue() == 36
|
||||||
|
|| serviceDict.getServiceId().intValue() == 148) {
|
||||||
|
if (appRegion != null) {
|
||||||
|
AppPolicyCfg appPolicyCfg = new AppPolicyCfg();
|
||||||
|
BeanUtils.copyProperties(cfg, appPolicyCfg,new String[] {"cfgId"});
|
||||||
|
//appPolicyCfg.setSpecServiceId(specificServiceCfg.getSpecServiceId());
|
||||||
|
//appPolicyCfg.setAppCode(specificServiceCfg.getSpecServiceCode());
|
||||||
|
appPolicyCfg.setMatchMethod(0);
|
||||||
|
appPolicyCfg.setIsHexbin(0);
|
||||||
|
appPolicyCfg.setCfgType(appRegion.getConfigRegionValue());
|
||||||
|
appPolicyCfg.setCfgRegionCode(appRegion.getConfigRegionCode());
|
||||||
|
if (StringUtils.isNotBlank(behaviorId)) {
|
||||||
|
//appPolicyCfg.setBehavCode(Integer.parseInt(behaviorId));
|
||||||
|
appPolicyCfg.setExprType(1);
|
||||||
|
} else {
|
||||||
|
appPolicyCfg.setExprType(0);
|
||||||
|
}
|
||||||
|
appPolicyCfgs.add(appPolicyCfg);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(!regionDict.getFunctionId().equals(403)) {
|
||||||
|
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
||||||
|
BeanUtils.copyProperties(cfg, cfgIndexInfo, new String[] {"cfgId"});
|
||||||
|
cfgIndexInfos.add(cfgIndexInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
ind++;
|
||||||
}
|
}
|
||||||
ind++;
|
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _stringCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,asnNoMaps,isSend.equals("1"));
|
||||||
|
cfgIndexInfos.clear();
|
||||||
|
appPolicyCfgs.clear();
|
||||||
|
_stringCfgs.clear();
|
||||||
}
|
}
|
||||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _stringCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,asnNoMaps,isSend.equals("1"));
|
|
||||||
cfgIndexInfos.clear();
|
|
||||||
appPolicyCfgs.clear();
|
|
||||||
_stringCfgs.clear();
|
|
||||||
}
|
|
||||||
}else {
|
}else {
|
||||||
// 主题网站
|
// 主题网站
|
||||||
List<AppTopicDomainCfg> _topicDomainCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
List<AppTopicDomainCfg> _topicDomainCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
while(!appTopicDomainCfgs.isEmpty()) {
|
while(!appTopicDomainCfgs.isEmpty()) {
|
||||||
appTopicDomainCfgs.drainTo(_topicDomainCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
appTopicDomainCfgs.drainTo(_topicDomainCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||||
List<Integer> compileIds=Lists.newArrayList();
|
List<Integer> compileIds=Lists.newArrayList();
|
||||||
List<Integer> groupIds=Lists.newArrayList();
|
List<Integer> groupIds=Lists.newArrayList();
|
||||||
List<Integer> regionIds=Lists.newArrayList();
|
List<Integer> regionIds=Lists.newArrayList();
|
||||||
try {
|
try {
|
||||||
compileIds = ConfigServiceUtil.getId(1,_topicDomainCfgs.size());
|
compileIds = ConfigServiceUtil.getId(1,_topicDomainCfgs.size());
|
||||||
if(isSend.equals("1")) {
|
if(isSend.equals("1")) {
|
||||||
groupIds = ConfigServiceUtil.getId(2,_topicDomainCfgs.size());
|
groupIds = ConfigServiceUtil.getId(2,_topicDomainCfgs.size());
|
||||||
regionIds = ConfigServiceUtil.getId(3,_topicDomainCfgs.size());
|
regionIds = ConfigServiceUtil.getId(3,_topicDomainCfgs.size());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("获取编译ID出错");
|
logger.info("获取编译ID出错");
|
||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
}
|
|
||||||
int ind=0;
|
|
||||||
for (AppTopicDomainCfg cfg : _topicDomainCfgs) {
|
|
||||||
cfg.setAction(serviceDict.getAction());
|
|
||||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
|
||||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
|
||||||
cfg.setCreateTime(date);
|
|
||||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
|
||||||
cfg.setDoLog(2);
|
|
||||||
cfg.setFunctionId(regionDict.getFunctionId());
|
|
||||||
/*if(isSend.equals("1")) {
|
|
||||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
|
||||||
cfg.setIsValid(Constants.VALID_YES);
|
|
||||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
|
||||||
cfg.setAuditTime(date);
|
|
||||||
if(groupIds!=null&&groupIds.size()==_topicDomainCfgs.size()) {
|
|
||||||
cfg.setGroupId(groupIds.get(ind));
|
|
||||||
}
|
|
||||||
if(regionIds!=null&®ionIds.size()==_topicDomainCfgs.size()) {
|
|
||||||
cfg.setRegionId(regionIds.get(ind));
|
|
||||||
}
|
|
||||||
}else {*/
|
|
||||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
|
||||||
cfg.setIsValid(Constants.VALID_NO);
|
|
||||||
//}
|
|
||||||
cfg.setIsAreaEffective(0);
|
|
||||||
cfg.setLable("0");
|
|
||||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
|
||||||
cfg.setAttribute(attribute);
|
|
||||||
cfg.setClassify(classify);
|
|
||||||
cfg.setServiceId(serviceDict.getServiceId());
|
|
||||||
if(compileIds!=null&&compileIds.size()==_topicDomainCfgs.size()) {
|
|
||||||
cfg.setCompileId(compileIds.get(ind));
|
|
||||||
}
|
}
|
||||||
ind++;
|
int ind=0;
|
||||||
|
for (AppTopicDomainCfg cfg : _topicDomainCfgs) {
|
||||||
|
cfg.setAction(serviceDict.getAction());
|
||||||
|
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||||
|
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||||
|
cfg.setCreateTime(date);
|
||||||
|
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setDoLog(2);
|
||||||
|
cfg.setFunctionId(regionDict.getFunctionId());
|
||||||
|
if(isSend.equals("1")) {
|
||||||
|
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||||
|
cfg.setIsValid(Constants.VALID_YES);
|
||||||
|
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setAuditTime(date);
|
||||||
|
if(groupIds!=null&&groupIds.size()==_topicDomainCfgs.size()) {
|
||||||
|
cfg.setGroupId(groupIds.get(ind));
|
||||||
|
}
|
||||||
|
if(regionIds!=null&®ionIds.size()==_topicDomainCfgs.size()) {
|
||||||
|
cfg.setRegionId(regionIds.get(ind));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
|
}
|
||||||
|
cfg.setIsAreaEffective(0);
|
||||||
|
cfg.setLable("0");
|
||||||
|
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||||
|
cfg.setAttribute(attribute);
|
||||||
|
cfg.setClassify(classify);
|
||||||
|
cfg.setServiceId(serviceDict.getServiceId());
|
||||||
|
if(compileIds!=null&&compileIds.size()==_topicDomainCfgs.size()) {
|
||||||
|
cfg.setCompileId(compileIds.get(ind));
|
||||||
|
}
|
||||||
|
ind++;
|
||||||
|
}
|
||||||
|
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _topicDomainCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,asnNoMaps,isSend.equals("1"));
|
||||||
|
cfgIndexInfos.clear();
|
||||||
|
_topicDomainCfgs.clear();
|
||||||
}
|
}
|
||||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _topicDomainCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,asnNoMaps,isSend.equals("1"));
|
|
||||||
cfgIndexInfos.clear();
|
|
||||||
_topicDomainCfgs.clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (regionDict.getRegionType().equals(3)) {
|
} else if (regionDict.getRegionType().equals(3)) {
|
||||||
if(!regionDict.getFunctionId().equals(563)) {
|
if(!regionDict.getFunctionId().equals(563)) {
|
||||||
|
|||||||
@@ -316,6 +316,9 @@ public class IpController extends BaseController{
|
|||||||
if(!menuName.equalsIgnoreCase(regionName)) {
|
if(!menuName.equalsIgnoreCase(regionName)) {
|
||||||
fileName = menuName +"_"+ fileName;
|
fileName = menuName +"_"+ fileName;
|
||||||
}
|
}
|
||||||
|
if(regionDict.getFunctionId().equals(560)) {
|
||||||
|
fileName = menuName + "_Template.xlsx";
|
||||||
|
}
|
||||||
//ip类模板
|
//ip类模板
|
||||||
if(regionDict.getRegionType().equals(1)){
|
if(regionDict.getRegionType().equals(1)){
|
||||||
if(regionDict.getFunctionId().equals(5)){// IP Address
|
if(regionDict.getFunctionId().equals(5)){// IP Address
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ import com.nis.domain.configuration.IpReusePolicyCfg;
|
|||||||
import com.nis.domain.configuration.PxyObjKeyring;
|
import com.nis.domain.configuration.PxyObjKeyring;
|
||||||
import com.nis.domain.configuration.PxyObjTrustedCaCert;
|
import com.nis.domain.configuration.PxyObjTrustedCaCert;
|
||||||
import com.nis.domain.configuration.PxyObjTrustedCaCrl;
|
import com.nis.domain.configuration.PxyObjTrustedCaCrl;
|
||||||
|
import com.nis.domain.configuration.WebsiteDomainTopic;
|
||||||
import com.nis.domain.maat.GroupReuseAddBean;
|
import com.nis.domain.maat.GroupReuseAddBean;
|
||||||
import com.nis.domain.maat.GroupReuseCfg;
|
import com.nis.domain.maat.GroupReuseCfg;
|
||||||
import com.nis.domain.maat.MaatCfg;
|
import com.nis.domain.maat.MaatCfg;
|
||||||
@@ -1650,7 +1651,7 @@ public abstract class BaseService {
|
|||||||
this.saveAppComplexFeatureBatch(regionDict,serviceDict,listPage,send);
|
this.saveAppComplexFeatureBatch(regionDict,serviceDict,listPage,send);
|
||||||
}else if("AppTopicDomain".equals(type)) {// 主题网站
|
}else if("AppTopicDomain".equals(type)) {// 主题网站
|
||||||
List<AppTopicDomainCfg> listPage = (List<AppTopicDomainCfg>) list;
|
List<AppTopicDomainCfg> listPage = (List<AppTopicDomainCfg>) list;
|
||||||
this.saveTopicDomainCfgBatch(listPage);
|
this.saveTopicDomainCfgBatch(regionDict,serviceDict,listPage,send);
|
||||||
}else if("BaseStringCfg".equals(type)) {
|
}else if("BaseStringCfg".equals(type)) {
|
||||||
List<BaseStringCfg<?>> listPage = (List<BaseStringCfg<?>>) list;
|
List<BaseStringCfg<?>> listPage = (List<BaseStringCfg<?>>) list;
|
||||||
// 调用对应配置的service
|
// 调用对应配置的service
|
||||||
@@ -1932,25 +1933,69 @@ public abstract class BaseService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入配置时数据批量入库
|
* 导入配置时数据批量入库
|
||||||
|
* @param serviceDict
|
||||||
|
* @param regionDict
|
||||||
* @param data
|
* @param data
|
||||||
|
* @param send
|
||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void saveTopicDomainCfgBatch(List<AppTopicDomainCfg> data) {
|
public void saveTopicDomainCfgBatch(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<AppTopicDomainCfg> data, boolean send) {
|
||||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
if (regionDict != null) {
|
||||||
SqlSession batchSqlSession = null;
|
Integer regionType = regionDict.getRegionType();
|
||||||
try{
|
if (2 == regionType.intValue()) {
|
||||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||||
for(int index = 0; index < data.size();index++){
|
AppCfgDao appCfgDao = SpringContextHolder.getBean(AppCfgDao.class);
|
||||||
AppTopicDomainCfg cfg = data.get(index);
|
List<MaatCfg> configCompileList = new ArrayList();
|
||||||
((AppCfgDao) batchSqlSession.getMapper(AppCfgDao.class)).insertAppTopicDomainCfgBatch(cfg);
|
SqlSession batchSqlSession = null;
|
||||||
}
|
try{
|
||||||
batchSqlSession.commit();
|
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||||
}finally {
|
for(int index = 0; index < data.size();index++){
|
||||||
if(batchSqlSession != null){
|
AppTopicDomainCfg cfg = data.get(index);
|
||||||
batchSqlSession.close();
|
((AppCfgDao) batchSqlSession.getMapper(AppCfgDao.class)).insertAppTopicDomainCfgBatch(cfg);
|
||||||
}
|
if (send) {
|
||||||
|
if(regionDict.getIsMaat().intValue()==1) {
|
||||||
|
MaatCfg maatCfg=convertMaatCfg(cfg,2);
|
||||||
|
//userRegion处理
|
||||||
|
WebsiteDomainTopic websiteDomainTopic = new WebsiteDomainTopic();
|
||||||
|
websiteDomainTopic.setDomain(cfg.getCfgKeywords());
|
||||||
|
List<WebsiteDomainTopic> domainDict = appCfgDao.getDomainDict(websiteDomainTopic);
|
||||||
|
Long domainId = domainDict.get(0).getId();
|
||||||
|
maatCfg.setUserRegion("WEB_ID=" + domainId);
|
||||||
|
configCompileList.add(maatCfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (send && configCompileList.size() > 0) {
|
||||||
|
ToMaatBean maatBean = new ToMaatBean();
|
||||||
|
maatBean.setConfigCompileList(configCompileList);
|
||||||
|
maatBean.setAuditTime(new Date());
|
||||||
|
maatBean.setCreatorName(UserUtils.getUser().getName());
|
||||||
|
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||||
|
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||||
|
// 调用服务接口下发配置数据
|
||||||
|
String json = BaseService.gsonToJson(maatBean);
|
||||||
|
if(configCompileList.size()>10) {
|
||||||
|
logger.info("APP主题网站配置下发配置参数:" + configCompileList.size());
|
||||||
|
}else {
|
||||||
|
logger.info("APP主题网站配置下发配置参数:" + json);
|
||||||
|
}
|
||||||
|
// 调用服务接口下发配置
|
||||||
|
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||||
|
logger.info("APP主题网站配置下发响应信息:" + result.getMsg());
|
||||||
|
|
||||||
|
}
|
||||||
|
batchSqlSession.commit();
|
||||||
|
|
||||||
|
}finally {
|
||||||
|
if(batchSqlSession != null){
|
||||||
|
batchSqlSession.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user