MES开发第六天
今天继续后端的代码编写
ProcessTransferController
1 package com.lian.controller; 2 3 4 import com.lian.pojo.ProcessTransfer; 5 import com.lian.pojo.Result; 6 import com.lian.service.ProcessTransferService; 7 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.web.bind.annotation.*; 9 10 import java.util.List; 11 12 /** 13 * <p> 14 * 前端控制器 15 * </p> 16 * 17 * @author lsx 18 * 19 */ 20 @RestController 21 @RequestMapping("/process-transfer") 22 public class ProcessTransferController { 23 @Autowired 24 ProcessTransferService processTransferService; 25 @PostMapping("/add") 26 @CrossOrigin(origins = "*") 27 public Result addTransfer(@RequestBody ProcessTransfer processTransfer){ 28 int iRow=processTransferService.addTranfer(processTransfer); 29 return Result.success(iRow); 30 } 31 //获取所有工序交接信息 32 @GetMapping("/getAll") 33 @CrossOrigin(origins = "*") 34 public Result getAll(){ 35 List<ProcessTransfer>list=processTransferService.getAll(); 36 return Result.success(list); 37 } 38 //条件查询工序交接信息 39 @PostMapping("/query") 40 @CrossOrigin(origins = "*") 41 public Result queryProcessTransfer(@RequestBody ProcessTransfer processTransfer){ 42 List<ProcessTransfer>list=processTransferService.queryProcessTransfer(processTransfer); 43 return Result.success(list); 44 } 45 46 }
ProductionBatchController
1 package com.lian.controller; 2 3 4 import com.lian.pojo.ProductionBatch; 5 import com.lian.pojo.Result; 6 import com.lian.service.ProductionBatchService; 7 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.web.bind.annotation.*; 9 10 import java.util.List; 11 12 /** 13 * <p> 14 * 前端控制器 15 * </p> 16 * 17 * @author lsx 18 * @since 2024-10-08 19 */ 20 @RestController 21 @RequestMapping("/production-batch") 22 public class ProductionBatchController { 23 @Autowired 24 ProductionBatchService productionBatchService; 25 //添加生产批次信息 26 @PostMapping("/add") 27 @CrossOrigin(origins = "*") 28 public Result addBatch(@RequestBody ProductionBatch productionBatch){ 29 int iRow=productionBatchService.addBatch(productionBatch); 30 return Result.success(iRow); 31 } 32 //获取所有生产批次信息 33 @GetMapping("/getAll") 34 @CrossOrigin(origins = "*") 35 public Result getAll(){ 36 List<ProductionBatch>list=productionBatchService.getAll(); 37 return Result.success(list); 38 } 39 //条件获取生产批次信息 40 @GetMapping("/query") 41 @CrossOrigin(origins = "*") 42 public Result queryBatch(String productName,String productionStatus){ 43 List<ProductionBatch>list=productionBatchService.queryBatch(productName,productionStatus); 44 return Result.success(list); 45 } 46 @PutMapping("/status") 47 @CrossOrigin(origins = "*") 48 public Result changeStatus(Integer batchNo,String productionStatus){ 49 productionBatchService.changeStatus(batchNo,productionStatus); 50 return Result.success(); 51 } 52 53 }
浙公网安备 33010602011771号