| | |
| | | import com.aps.common.security.annotation.RequiresPermissions; |
| | | import com.aps.core.domain.ApsStandardProcess; |
| | | import com.aps.core.service.IApsStandardProcessService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @date 2025-04-23 |
| | | */ |
| | | |
| | | |
| | | @Tag(name = "标准工序", description = "标准工序接口") |
| | | @RestController |
| | | @RequestMapping("/standardProcess") |
| | | public class ApsStandardProcessController extends BaseController |
| | |
| | | /** |
| | | * 查询标准工序列表 |
| | | */ |
| | | @RequiresPermissions("core:standardProcess:list") |
| | | @Operation(summary = "查询标准工序列表", description = "分页查询") |
| | | @RequiresPermissions("aps:standardProcess:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(ApsStandardProcess apsStandardProcess) |
| | | { |
| | |
| | | /** |
| | | * 导出标准工序列表 |
| | | */ |
| | | @RequiresPermissions("core:standardProcess:export") |
| | | @Operation(summary = "导出标准工序列表", description = "导出Excel") |
| | | @RequiresPermissions("aps:standardProcess:export") |
| | | @Log(title = "标准工序", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ApsStandardProcess apsStandardProcess) |
| | |
| | | /** |
| | | * 获取标准工序详细信息 |
| | | */ |
| | | @RequiresPermissions("core:standardProcess:query") |
| | | @Operation(summary = "获取标准工序详细信息", description = "根据id获取") |
| | | @RequiresPermissions("aps:standardProcess:query") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | |
| | | /** |
| | | * 新增标准工序 |
| | | */ |
| | | @RequiresPermissions("core:standardProcess:add") |
| | | @Operation(summary = "新增标准工序", description = "单个增加") |
| | | @RequiresPermissions("aps:standardProcess:add") |
| | | @Log(title = "标准工序", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody ApsStandardProcess apsStandardProcess) |
| | |
| | | /** |
| | | * 修改标准工序 |
| | | */ |
| | | @RequiresPermissions("core:standardProcess:edit") |
| | | @Operation(summary = "修改标准工序", description = "单个修改") |
| | | @RequiresPermissions("aps:standardProcess:edit") |
| | | @Log(title = "标准工序", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody ApsStandardProcess apsStandardProcess) |
| | |
| | | /** |
| | | * 删除标准工序 |
| | | */ |
| | | @RequiresPermissions("core:standardProcess:remove") |
| | | @Operation(summary = "删除标准工序", description = "批量删除") |
| | | @RequiresPermissions("aps:standardProcess:remove") |
| | | @Log(title = "标准工序", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(apsStandardProcessService.deleteApsStandardProcessByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 导入标准工序数据 |
| | | */ |
| | | @Operation(summary = "导入标准工序数据", description = "增量导入") |
| | | @RequiresPermissions("aps:standardProcess:importData") |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | ExcelUtil<ApsStandardProcess> util = new ExcelUtil<>(ApsStandardProcess.class); |
| | | List<ApsStandardProcess> tempList = util.importExcel(file.getInputStream()); |
| | | //判断导入数据是否为空 |
| | | if (!tempList.isEmpty()) { |
| | | Boolean res = apsStandardProcessService.importData(tempList); |
| | | if(res){ |
| | | return AjaxResult.success("导入成功!"); |
| | | }else{ |
| | | return AjaxResult.error("导入失败!"); |
| | | } |
| | | } else { |
| | | return AjaxResult.error("模板内容为空"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据车间查询标准工序列表 |
| | | */ |
| | | @Operation(summary = "根据车间查询标准工序列表", description = "全量查询") |
| | | @RequiresPermissions("aps:standardProcess:listByWorkShop") |
| | | @GetMapping("/listByWorkShop") |
| | | public TableDataInfo listByWorkShop(ApsStandardProcess apsStandardProcess) |
| | | { |
| | | List<ApsStandardProcess> list = apsStandardProcessService.selectApsStandardProcessList(apsStandardProcess); |
| | | return getDataTable(list); |
| | | } |
| | | } |