1.导出功能添加删除导出数据选项
This commit is contained in:
@@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.tkdata.controller.admin.newhosts.vo.NewHostsRespV
|
|||||||
import cn.iocoder.yudao.module.tkdata.controller.admin.newhosts.vo.NewHostsSaveReqVO;
|
import cn.iocoder.yudao.module.tkdata.controller.admin.newhosts.vo.NewHostsSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO;
|
import cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO;
|
||||||
import cn.iocoder.yudao.module.tkdata.service.newhosts.NewHostsService;
|
import cn.iocoder.yudao.module.tkdata.service.newhosts.NewHostsService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -33,6 +34,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Tag(name = "管理后台 - 主播数据")
|
@Tag(name = "管理后台 - 主播数据")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/server/new-hosts")
|
@RequestMapping("/server/new-hosts")
|
||||||
@@ -108,6 +110,10 @@ public class NewHostsController {
|
|||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<NewHostsDO> list = newHostsService.getNewHostsPage(pageReqVO).getList();
|
List<NewHostsDO> list = newHostsService.getNewHostsPage(pageReqVO).getList();
|
||||||
|
if (pageReqVO.getDeleteFlag()){
|
||||||
|
newHostsService.deleteExportData(list);
|
||||||
|
log.info("删除导出数据{}",list.size() );
|
||||||
|
}
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
ExcelUtils.write(response, "主播数据.xls", "数据", NewHostsRespVO.class,
|
ExcelUtils.write(response, "主播数据.xls", "数据", NewHostsRespVO.class,
|
||||||
BeanUtils.toBean(list, NewHostsRespVO.class));
|
BeanUtils.toBean(list, NewHostsRespVO.class));
|
||||||
|
|||||||
@@ -135,4 +135,7 @@ public class NewHostsPageReqVO extends PageParam {
|
|||||||
*/
|
*/
|
||||||
@Schema(description = "是否建联", example = "1")
|
@Schema(description = "是否建联", example = "1")
|
||||||
private Byte operationStatus;
|
private Byte operationStatus;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除原数据")
|
||||||
|
private Boolean deleteFlag;
|
||||||
}
|
}
|
||||||
@@ -62,4 +62,6 @@ public interface NewHostsService {
|
|||||||
PageResult<NewHostsDO> getNewHostsPage(NewHostsPageReqVO pageReqVO);
|
PageResult<NewHostsDO> getNewHostsPage(NewHostsPageReqVO pageReqVO);
|
||||||
|
|
||||||
void batchUpdateNewHosts(@Valid List<NewHostsSaveReqVO> updateReqVO);
|
void batchUpdateNewHosts(@Valid List<NewHostsSaveReqVO> updateReqVO);
|
||||||
|
|
||||||
|
void deleteExportData(List<NewHostsDO> list);
|
||||||
}
|
}
|
||||||
@@ -106,4 +106,9 @@ public class NewHostsServiceImpl implements NewHostsService {
|
|||||||
newHostsMapper.updateBatch(newHostsDOS);
|
newHostsMapper.updateBatch(newHostsDOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteExportData(List<NewHostsDO> list) {
|
||||||
|
newHostsMapper.deleteBatchIds(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user