|
@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.bz.smart_city.commom.exception.ServiceException;
|
|
|
import com.bz.smart_city.commom.model.Pagination;
|
|
|
import com.bz.smart_city.commom.util.UserUtil;
|
|
|
-import com.bz.smart_city.dao.ChannelDeviceTypeUseMapper;
|
|
|
import com.bz.smart_city.dao.ChannelMapper;
|
|
|
import com.bz.smart_city.dao.PermissionMapper;
|
|
|
import com.bz.smart_city.dao.SiteChannelMapper;
|
|
@@ -12,7 +11,6 @@ import com.bz.smart_city.dto.ChannelDeviceCountDto;
|
|
|
import com.bz.smart_city.dto.ChannelDto;
|
|
|
import com.bz.smart_city.dto.LoginUser;
|
|
|
import com.bz.smart_city.entity.Channel;
|
|
|
-import com.bz.smart_city.entity.ChannelDeviceTypeUse;
|
|
|
import com.bz.smart_city.service.ChannelService;
|
|
|
import com.bz.smart_city.service.DeviceService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
@@ -26,7 +24,6 @@ import java.time.LocalDateTime;
|
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
-import static com.google.common.collect.Lists.newArrayList;
|
|
|
|
|
|
@Slf4j
|
|
|
@Service
|
|
@@ -35,8 +32,6 @@ public class ChannelServiceImpl implements ChannelService {
|
|
|
@Resource
|
|
|
private ChannelMapper channelMapper;
|
|
|
@Resource
|
|
|
- private ChannelDeviceTypeUseMapper channelDeviceTypeUseMapper;
|
|
|
- @Resource
|
|
|
private PermissionMapper permissionMapper;
|
|
|
@Resource
|
|
|
private SiteChannelMapper siteChannelMapper;
|
|
@@ -238,29 +233,6 @@ public class ChannelServiceImpl implements ChannelService {
|
|
|
return siteChannelMapper.countByChannelId(id);
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void allocation(Integer channelId, List<Integer> deviceTypeIds) {
|
|
|
- log.info("begin allocation channelId:" + channelId + ",deviceTypeIds:" + JSON.toJSONString(deviceTypeIds));
|
|
|
- //先删除再插入
|
|
|
- int i = channelDeviceTypeUseMapper.deleteByChannelId(channelId, UserUtil.getCurrentUser().getUsername());
|
|
|
-
|
|
|
- if (deviceTypeIds != null && deviceTypeIds.size() > 0) {
|
|
|
- List<ChannelDeviceTypeUse> list = newArrayList();
|
|
|
- deviceTypeIds.forEach(deviceTypeId -> {
|
|
|
- ChannelDeviceTypeUse channelDeviceTypeUse = new ChannelDeviceTypeUse();
|
|
|
- channelDeviceTypeUse.setChannelId(channelId);
|
|
|
- channelDeviceTypeUse.setDeviceTypeId(deviceTypeId);
|
|
|
- channelDeviceTypeUse.setStatus(1);
|
|
|
- channelDeviceTypeUse.setCreateBy(UserUtil.getCurrentUser().getUsername());
|
|
|
- channelDeviceTypeUse.setDateCreate(LocalDateTime.now());
|
|
|
- channelDeviceTypeUse.setUpdateBy(UserUtil.getCurrentUser().getUsername());
|
|
|
- channelDeviceTypeUse.setDateUpdate(LocalDateTime.now());
|
|
|
- list.add(channelDeviceTypeUse);
|
|
|
- });
|
|
|
- channelDeviceTypeUseMapper.insertList(list);
|
|
|
- }
|
|
|
- log.info("end allocation reslut=" + i);
|
|
|
- }
|
|
|
|
|
|
@Override
|
|
|
public List<Channel> getUserChannelList(LoginUser loginUser) {
|