admin
2019-03-15 c9f28b430799cc8d40c7a7d99fd0f0eeecff6a5c
fanli/src/main/java/com/yeshi/fanli/service/impl/config/SystemConfigServiceImpl.java
@@ -11,11 +11,11 @@
import org.springframework.stereotype.Service;
import com.yeshi.fanli.dao.config.SystemConfigDao;
import com.yeshi.fanli.entity.system.System;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.system.SystemConfig;
import com.yeshi.fanli.exception.NotExistObjectException;
import com.yeshi.fanli.service.inter.config.BusinessSystemService;
import com.yeshi.fanli.service.inter.config.SystemConfigService;
import com.yeshi.fanli.service.inter.config.SystemService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.Utils;
@@ -26,9 +26,9 @@
   private SystemConfigDao systemConfigDao;
   
   @Resource
   private SystemService systemService;
   private BusinessSystemService businessSystemService;
   
   public int getCount(System system,String key) {
   public int getCount(BusinessSystem system,String key) {
      Long lcount;
      if(system!=null){
         lcount = systemConfigDao.getCount("select count(sc.id) from SystemConfig sc left join sc.systems s  where s.id=? and sc.name like ?",new Serializable[]{system.getId(),"%"+key+"%"});
@@ -38,7 +38,7 @@
      return lcount.intValue();
   }
   public List<SystemConfig> getSystemConfigList(int index,System system, String key) {
   public List<SystemConfig> getSystemConfigList(int index,BusinessSystem system, String key) {
      
      int start =index * Constant.PAGE_SIZE;
      List<SystemConfig> list;
@@ -65,12 +65,12 @@
   }
   public void addSystemConfig(SystemConfig sc) {
      Set<System> systems = sc.getSystems();
      Set<System> newSystems=new HashSet<System>();
      for (System system : systems) {
      Set<BusinessSystem> systems = sc.getSystems();
      Set<BusinessSystem> newSystems=new HashSet<BusinessSystem>();
      for (BusinessSystem system : systems) {
         String platform = Utils.getMap().get(String.valueOf(system.getPlatform()));
         String packages = system.getPackageName();
         System find = systemService.getSystem(platform, packages);
         BusinessSystem find = businessSystemService.getBusinessSystem(platform, packages);
         if(find != null){
            newSystems.add(find);
         }
@@ -80,7 +80,7 @@
      systemConfigDao.save(sc);
   }
   public void deleteSystem(long id, System system) throws NotExistObjectException {
   public void deleteSystem(long id, BusinessSystem system) throws NotExistObjectException {
      SystemConfig find = systemConfigDao.find(SystemConfig.class, id);
      if(find==null){
         throw new NotExistObjectException("不存在该子系统");
@@ -90,7 +90,7 @@
      systemConfigDao.update(find);
   }
   public void addSystem(long id, System system) throws NotExistObjectException {
   public void addSystem(long id, BusinessSystem system) throws NotExistObjectException {
      SystemConfig find = systemConfigDao.find(SystemConfig.class, id);
      if(find==null){
         throw new NotExistObjectException("不存在该子系统");
@@ -111,12 +111,12 @@
         throw new NotExistObjectException("不存在该对象");
      }
      sc.setUpdatetime(java.lang.System.currentTimeMillis());
      Set<System> newSystems=new HashSet<System>();
      Set<System> systems = sc.getSystems();
      for (System system : systems) {
      Set<BusinessSystem> newSystems=new HashSet<BusinessSystem>();
      Set<BusinessSystem> systems = sc.getSystems();
      for (BusinessSystem system : systems) {
         String platform = Utils.getMap().get(String.valueOf(system.getPlatform()));
         String packages = system.getPackageName();
         System sfind = systemService.getSystem(platform, packages);
         BusinessSystem sfind = businessSystemService.getBusinessSystem(platform, packages);
         if(sfind != null){
            newSystems.add(sfind);
         }
@@ -137,7 +137,7 @@
      return list.get(0).getValue();
   }
   @Cacheable(value={"childSystemCache"}, key="#p0+#system.id")
   public String get(String key, System system) {
   public String get(String key, BusinessSystem system) {
      if(system==null || system.getId()==0){
         return "";
      }