|  |  | 
 |  |  | import com.doumee.core.exception.BusinessException; | 
 |  |  | import com.doumee.core.haikang.model.HKConstants; | 
 |  |  | import com.doumee.core.haikang.model.param.BaseResponse; | 
 |  |  | import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest; | 
 |  |  | import com.doumee.core.haikang.model.param.request.PrivilegeGroupRequest; | 
 |  |  | import com.doumee.core.haikang.model.param.respose.AcsDeviceInfoResponse; | 
 |  |  | import com.doumee.core.haikang.model.param.respose.AcsDeviceListResponse; | 
 |  |  | import com.doumee.core.haikang.model.param.respose.PrivilegeGroupInfoResponse; | 
 |  |  | import com.doumee.core.haikang.model.param.respose.PrivilegeGroupListResponse; | 
 |  |  | import com.doumee.core.haikang.service.HKService; | 
 |  |  | import com.doumee.core.utils.Constants; | 
 |  |  | import com.doumee.dao.business.DeviceRoleMapper; | 
 |  |  | import com.doumee.dao.business.model.Device; | 
 |  |  | import com.doumee.dao.business.model.DeviceRole; | 
 |  |  | import org.apache.commons.lang3.StringUtils; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | 
 |  |  |                 if(model !=null){ | 
 |  |  |                     //如果已存在,则更新数据 | 
 |  |  |                     model =  initDataByHkData(model,device,date); | 
 |  |  |                     if(allHkList.size()==1){ | 
 |  |  |                         model.setIsDefault(Constants.ZERO); | 
 |  |  |                     } | 
 |  |  |                     editList.add(model); | 
 |  |  |                 }else{ | 
 |  |  |                     //如果不存在,则新增数据 | 
 |  |  |                     model = new DeviceRole(); | 
 |  |  |                     model =  initDataByHkData(model,device,date); | 
 |  |  |                     if(allHkList.size()==1){ | 
 |  |  |                         model.setIsDefault(Constants.ZERO); | 
 |  |  |                     } | 
 |  |  |                     addList.add(model); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private boolean isDeletedData(DeviceRole device, List<PrivilegeGroupInfoResponse> allHkList) { | 
 |  |  |         if(allHkList.size()>0){ | 
 |  |  |             for(PrivilegeGroupInfoResponse r : allHkList){ | 
 |  |  | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         return  true; | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |      | 
 |  |  | } |