|
|
|
|
@ -18,7 +18,6 @@ import cn.iocoder.yudao.module.mes.service.workteam.WorkTeamService;
|
|
|
|
|
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.*;
|
|
|
|
|
|
|
|
|
|
@ -46,7 +45,7 @@ public class ProduceReportController {
|
|
|
|
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
|
|
@Operation(summary = "创建生产报工单")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:produce-report:create')")
|
|
|
|
|
//@PreAuthorize("@ss.hasPermission('mes:produce-report:create')")
|
|
|
|
|
public CommonResult<Long> createProduceReport(@Valid @RequestBody ProduceReportSaveReqVO createReqVO) {
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
LocalDateTime localDateTime = LocalDateTime.parse(createReqVO.getReportDateString(), formatter);
|
|
|
|
|
@ -56,7 +55,7 @@ public class ProduceReportController {
|
|
|
|
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
|
|
@Operation(summary = "更新生产报工单")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:produce-report:update')")
|
|
|
|
|
//@PreAuthorize("@ss.hasPermission('mes:produce-report:update')")
|
|
|
|
|
public CommonResult<Boolean> updateProduceReport(@Valid @RequestBody ProduceReportSaveReqVO updateReqVO) {
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
LocalDateTime localDateTime = LocalDateTime.parse(updateReqVO.getReportDateString(), formatter);
|
|
|
|
|
@ -68,7 +67,7 @@ public class ProduceReportController {
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
|
|
@Operation(summary = "删除生产报工单")
|
|
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:produce-report:delete')")
|
|
|
|
|
//@PreAuthorize("@ss.hasPermission('mes:produce-report:delete')")
|
|
|
|
|
public CommonResult<Boolean> deleteProduceReport(@RequestParam("id") Long id) {
|
|
|
|
|
produceReportService.deleteProduceReport(id);
|
|
|
|
|
return success(true);
|
|
|
|
|
@ -77,7 +76,7 @@ public class ProduceReportController {
|
|
|
|
|
@GetMapping("/get")
|
|
|
|
|
@Operation(summary = "获得生产报工单")
|
|
|
|
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:produce-report:query')")
|
|
|
|
|
//@PreAuthorize("@ss.hasPermission('mes:produce-report:query')")
|
|
|
|
|
public CommonResult<ProduceReportRespVO> getProduceReport(@RequestParam("id") Long id) {
|
|
|
|
|
ProduceReportDO produceReport = produceReportService.getProduceReport(id);
|
|
|
|
|
return success(BeanUtils.toBean(produceReport, ProduceReportRespVO.class));
|
|
|
|
|
@ -85,7 +84,7 @@ public class ProduceReportController {
|
|
|
|
|
|
|
|
|
|
@GetMapping("/page")
|
|
|
|
|
@Operation(summary = "获得生产报工单分页")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:produce-report:query')")
|
|
|
|
|
//@PreAuthorize("@ss.hasPermission('mes:produce-report:query')")
|
|
|
|
|
public CommonResult<PageResult<ProduceReportRespVO>> getProduceReportPage(@Valid ProduceReportPageReqVO pageReqVO) {
|
|
|
|
|
|
|
|
|
|
PageResult<ProduceReportDO> pageResult = produceReportService.getProduceReportPage(pageReqVO);
|
|
|
|
|
@ -96,7 +95,7 @@ public class ProduceReportController {
|
|
|
|
|
|
|
|
|
|
@GetMapping("/pageReplace")
|
|
|
|
|
@Operation(summary = "获得生产报工单分页-代报工")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:produce-report:query')")
|
|
|
|
|
//@PreAuthorize("@ss.hasPermission('mes:produce-report:query')")
|
|
|
|
|
public CommonResult<PageResult<ProduceReportRespVO>> getProduceReportPageReplace(@Valid ProduceReportPageReqVO pageReqVO) {
|
|
|
|
|
Long userId = getLoginUserId();
|
|
|
|
|
WorkTeamDO workTeamDO = new WorkTeamDO().setTeamLeaderId(userId);
|
|
|
|
|
@ -116,7 +115,7 @@ public class ProduceReportController {
|
|
|
|
|
}
|
|
|
|
|
@GetMapping("/export-excel")
|
|
|
|
|
@Operation(summary = "导出生产报工单 Excel")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:produce-report:export')")
|
|
|
|
|
//@PreAuthorize("@ss.hasPermission('mes:produce-report:export')")
|
|
|
|
|
@ApiAccessLog(operateType = EXPORT)
|
|
|
|
|
public void exportProduceReportExcel(@Valid ProduceReportPageReqVO pageReqVO,
|
|
|
|
|
HttpServletResponse response) throws IOException {
|
|
|
|
|
@ -133,7 +132,7 @@ public class ProduceReportController {
|
|
|
|
|
@GetMapping("/produce-report-detail/list-by-report-id")
|
|
|
|
|
@Operation(summary = "获得生产报工明细列表")
|
|
|
|
|
@Parameter(name = "reportId", description = "报工单id")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('mes:produce-report:query')")
|
|
|
|
|
//@PreAuthorize("@ss.hasPermission('mes:produce-report:query')")
|
|
|
|
|
public CommonResult<List<ProduceReportDetailRespVO>> getProduceReportDetailListByReportId(@RequestParam("reportId") Long reportId) {
|
|
|
|
|
return success(produceReportService.getDetailListByReportId(reportId));
|
|
|
|
|
}
|
|
|
|
|
|