¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.aps.core.controller.mainPlan.ApsPlate; |
| | | |
| | | |
| | | import com.aps.common.core.utils.poi.ExcelUtil; |
| | | import com.aps.common.core.web.domain.AjaxResult; |
| | | import com.aps.common.log.annotation.Log; |
| | | import com.aps.common.log.enums.BusinessType; |
| | | import com.aps.common.security.annotation.RequiresPermissions; |
| | | import com.aps.core.domain.ApsPlate.ApsPlateRequireDate; |
| | | import com.aps.core.service.ApsPlate.ApsPlateRequireDateService; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import jakarta.annotation.Resource; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Tag(name = "é£éå·¥åéæ±æ¥æç®¡ç", description = "é£éå·¥åéæ±æ¥æç®¡ç") |
| | | @RestController |
| | | @RequestMapping("/plateRequireDate") |
| | | public class ApsPlateRequireDateController { |
| | | |
| | | @Resource |
| | | private ApsPlateRequireDateService apsPlateRequireDateService; |
| | | |
| | | @RequiresPermissions("plateRequireDate:list") |
| | | @GetMapping("/list") |
| | | @Tag(name = "æ¥è¯¢å表") |
| | | public Page<ApsPlateRequireDate> list(Page<ApsPlateRequireDate> page,ApsPlateRequireDate apsPlateRequireDate){ |
| | | return apsPlateRequireDateService.pagingList(page, apsPlateRequireDate); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导å
¥Excelæ°æ® |
| | | * @param file |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Operation(summary = "导å
¥å·¥åéæ±æ¥æ", description = "导å
¥å·¥åéæ±æ¥æ") |
| | | @RequiresPermissions("plateRequireDate:import") |
| | | @Log(title = "导å
¥å·¥åéæ±æ¥æ", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importRequireDate") |
| | | public AjaxResult importRequireDate(MultipartFile file) throws Exception { |
| | | ExcelUtil<ApsPlateRequireDate> util = new ExcelUtil<ApsPlateRequireDate>(ApsPlateRequireDate.class); |
| | | List<ApsPlateRequireDate> plateRequireDateList = util.importExcel(file.getInputStream()); |
| | | if (!plateRequireDateList.isEmpty()) { |
| | | try { |
| | | apsPlateRequireDateService.batchSave(plateRequireDateList); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } else { |
| | | return AjaxResult.error("模æ¿å
容为空"); |
| | | } |
| | | return AjaxResult.success("导å
¥æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®idå é¤å·¥åéæ±æ¥æ |
| | | * */ |
| | | @Operation(summary = "å é¤éæ±æ¥æ", description = "å é¤éæ±æ¥æ") |
| | | @Log(title = "å é¤éæ±æ¥æ", businessType = BusinessType.DELETE) |
| | | @PostMapping("/deleteRequireDate") |
| | | @RequiresPermissions("plateRequireDate:delete") |
| | | public AjaxResult deleteRequireDate(@RequestBody List<Long> idList) { |
| | | apsPlateRequireDateService.batchDelete(idList); |
| | | return AjaxResult.success("å 餿åï¼"); |
| | | } |
| | | |
| | | } |