|
|
|
@ -1,33 +1,31 @@
|
|
|
|
package cn.iocoder.yudao.module.mes.controller.admin.orgworker;
|
|
|
|
package cn.iocoder.yudao.module.mes.controller.admin.orgworker;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.*;
|
|
|
|
|
|
|
|
import javax.validation.*;
|
|
|
|
|
|
|
|
import javax.servlet.http.*;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.orgworker.vo.OrgWorkerPageReqVO;
|
|
|
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.orgworker.vo.OrgWorkerRespVO;
|
|
|
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.orgworker.vo.OrgWorkerSaveReqVO;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.orgworker.vo.*;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.orgworker.OrgWorkerDO;
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.orgworker.OrgWorkerDO;
|
|
|
|
import cn.iocoder.yudao.module.mes.service.orgworker.OrgWorkerService;
|
|
|
|
import cn.iocoder.yudao.module.mes.service.orgworker.OrgWorkerService;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
|
|
|
|
|
|
|
|
|
@Tag(name = "管理后台 - 工位安排")
|
|
|
|
@Tag(name = "管理后台 - 工位安排")
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@ -73,10 +71,9 @@ public class OrgWorkerController {
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/page")
|
|
|
|
@GetMapping("/page")
|
|
|
|
@Operation(summary = "获得工位安排分页")
|
|
|
|
@Operation(summary = "获得工位安排分页")
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:org-worker:query')")
|
|
|
|
|
|
|
|
public CommonResult<PageResult<OrgWorkerRespVO>> getOrgWorkerPage(@Valid OrgWorkerPageReqVO pageReqVO) {
|
|
|
|
public CommonResult<PageResult<OrgWorkerRespVO>> getOrgWorkerPage(@Valid OrgWorkerPageReqVO pageReqVO) {
|
|
|
|
PageResult<OrgWorkerDO> pageResult = orgWorkerService.getOrgWorkerPage(pageReqVO);
|
|
|
|
PageResult<OrgWorkerRespVO> pageResult = orgWorkerService.getOrgWorkerPage(pageReqVO);
|
|
|
|
return success(BeanUtils.toBean(pageResult, OrgWorkerRespVO.class));
|
|
|
|
return success(pageResult);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/export-excel")
|
|
|
|
@GetMapping("/export-excel")
|
|
|
|
@ -86,10 +83,10 @@ public class OrgWorkerController {
|
|
|
|
public void exportOrgWorkerExcel(@Valid OrgWorkerPageReqVO pageReqVO,
|
|
|
|
public void exportOrgWorkerExcel(@Valid OrgWorkerPageReqVO pageReqVO,
|
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
|
|
List<OrgWorkerDO> list = orgWorkerService.getOrgWorkerPage(pageReqVO).getList();
|
|
|
|
List<OrgWorkerRespVO> list = orgWorkerService.getOrgWorkerPage(pageReqVO).getList();
|
|
|
|
// 导出 Excel
|
|
|
|
// 导出 Excel
|
|
|
|
ExcelUtils.write(response, "工位安排.xls", "数据", OrgWorkerRespVO.class,
|
|
|
|
ExcelUtils.write(response, "工位安排.xls", "数据", OrgWorkerRespVO.class,
|
|
|
|
BeanUtils.toBean(list, OrgWorkerRespVO.class));
|
|
|
|
list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|