(1)tree属性扩展,支持新增节点

(2)特定服务增加一列标记新增节点
This commit is contained in:
wangxin
2018-08-24 11:54:21 +08:00
parent 295d92fe79
commit 063fa03a94
15 changed files with 328 additions and 21 deletions

View File

@@ -12,6 +12,7 @@ import com.nis.domain.Page;
import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.web.dao.specific.SpecificServiceCfgDao;
import com.nis.web.service.BaseService;
@@ -89,6 +90,21 @@ public class SpecificServiceCfgService extends BaseService{
specificServiceCfg.setIsValid(1);
specificServiceCfg.setOpTime(new Date());
//用户添加的需要自增
if(specificServiceCfg.getAddFlag()!=null) {
Integer serviceCode=specificServiceCfgDao.getMaxServiceCode(Constants.APP_SPEC_SERVICE_CODE_MAX_VAL,specificServiceCfg.getCfgType(),specificServiceCfg.getAddFlag());
if(serviceCode==null) {//用户没有添加标签,获取最大的
serviceCode=specificServiceCfgDao.getMaxServiceCode(Constants.APP_SPEC_SERVICE_CODE_MAX_VAL,specificServiceCfg.getCfgType(),null);
}
if(serviceCode==null) {//没有标签,取开始值
serviceCode=Constants.APP_SPEC_SERVICE_CODE_MIN_VAL;
}else if(serviceCode>Constants.APP_SPEC_SERVICE_CODE_MAX_VAL){
throw new RuntimeException("Get specific service code failed,specific service code is beyond the scope of application");
}else if(serviceCode<Constants.APP_SPEC_SERVICE_CODE_MIN_VAL) {
serviceCode=Constants.APP_SPEC_SERVICE_CODE_MIN_VAL;
}
specificServiceCfg.setSpecServiceCode(serviceCode.intValue()+1);
}
specificServiceCfgDao.insert(specificServiceCfg);
}else{//修改
if(specificServiceCfg.getIsLeaf()==null){
@@ -145,5 +161,8 @@ public class SpecificServiceCfgService extends BaseService{
public SpecificServiceCfg getRepeat (Integer code,Integer cfgType,Integer parentId) {
return specificServiceCfgDao.getRepeat(code,cfgType,parentId);
}
public Integer getMaxServiceCode (Integer code, Integer cfgType,Integer addFlag) {
return specificServiceCfgDao.getMaxServiceCode(code,cfgType,addFlag);
}
}