| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.device.pojo.DeviceRepair; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.oA.pojo.OaProject; |
| | | import com.ruoyi.production.dto.ProductProcessDto; |
| | | import com.ruoyi.production.pojo.ProductProcess; |
| | | import com.ruoyi.production.service.impl.ProductProcessServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @Api(tags = "å·¥åº") |
| | | @RequestMapping("/productProcess") |
| | | public class ProductProcessController extends BaseController { |
| | | |
| | | |
| | | @Autowired |
| | | private ProductProcessServiceImpl productProcessService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "å·¥åº-å页æ¥è¯¢", businessType = BusinessType.OTHER) |
| | | @ApiOperation("å·¥åº-å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ProductProcessDto productProcessDto) { |
| | | IPage<ProductProcessDto> listPage = productProcessService.listPage(page, productProcessDto); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | | |
| | | @ApiModelProperty("æ°å¢å·¥åº") |
| | | @PostMapping() |
| | | @Log(title = "æ°å¢", businessType = BusinessType.INSERT) |
| | | public AjaxResult add( @RequestBody ProductProcessDto productProcessDto) { |
| | | return productProcessService.add(productProcessDto); |
| | | } |
| | | |
| | | @ApiOperation("æ´æ°å·¥åº") |
| | | @Log(title = "ä¿®æ¹", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/update") |
| | | public AjaxResult update(@RequestBody ProductProcess productProcess) { |
| | | return AjaxResult.success(productProcessService.updateById(productProcess)); |
| | | } |
| | | |
| | | @ApiOperation("å é¤å·¥åº") |
| | | @DeleteMapping("/batchDelete") |
| | | @Log(title = "å é¤", businessType = BusinessType.DELETE) |
| | | public AjaxResult batchDelete(@RequestBody List<Integer> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | } |
| | | return AjaxResult.success(productProcessService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢ææå·¥åº") |
| | | @GetMapping("/list") |
| | | public AjaxResult list() { |
| | | return AjaxResult.success(productProcessService.list()); |
| | | } |
| | | |
| | | /** |
| | | * 导å
¥å·¥åº |
| | | */ |
| | | @Log(title = "å·¥åº", businessType = BusinessType.IMPORT) |
| | | @PostMapping("/importData") |
| | | public AjaxResult importData(MultipartFile file) throws Exception { |
| | | return productProcessService.importData(file); |
| | | } |
| | | |
| | | @PostMapping("/downloadTemplate") |
| | | @Log(title = "å·¥åº-ä¸è½½æ¨¡æ¿", businessType = BusinessType.EXPORT) |
| | | public void downloadTemplate(HttpServletResponse response) { |
| | | ExcelUtil<ProductProcess> util = new ExcelUtil<ProductProcess>(ProductProcess.class); |
| | | util.importTemplateExcel(response, "å·¥åºæ¨¡æ¿"); |
| | | } |
| | | } |