New file |
| | |
| | | package com.mes.uppattenusage.controller; |
| | | |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.service.UpPattenUsageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | | * @since 2024-04-18 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/up-patten-usage") |
| | | @Slf4j |
| | | public class UpPattenUsageController { |
| | | |
| | | @Autowired |
| | | private UpPattenUsageService upPattenUsageService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | | private EngineeringService engineeringService; |
| | | @Autowired |
| | | private OptimizeProjectService optimizeProjectService; |
| | | @ApiOperation("显示选择的工程信息") |
| | | @GetMapping("/prioritylist") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<List<UpPattenUsage>> prioritylist() { |
| | | List<UpPattenUsage> glass = upPattenUsageService.prioritylist(); |
| | | log.info("显示正在出片的工程信息:{}", glass); |
| | | return Result.build(200, "", glass); |
| | | } |
| | | |
| | | @ApiOperation("选择工程号后显示上片顺序预览") |
| | | @PostMapping("/selectUpPattenUsage") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<List<UpPattenUsage>> selectUpPattenUsage(@RequestBody Engineering engineering) { |
| | | List<UpPattenUsage> upPattenUsages=null; |
| | | UpPattenUsage upPattenUsage = upPattenUsageService.selectedEngineering(engineering.getEngineerId()); |
| | | if(upPattenUsage == null){ |
| | | upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineering.getEngineerId()); |
| | | }else { |
| | | upPattenUsages= upPattenUsageService.selectUpPattenUsage(upPattenUsage); |
| | | } |
| | | |
| | | if (!upPattenUsages.isEmpty()) { |
| | | return Result.build(200, "成功", upPattenUsages); |
| | | }else { |
| | | return Result.build(100, "失败", upPattenUsages); |
| | | } |
| | | |
| | | } |
| | | |
| | | @ApiOperation("切换原片上片状态") |
| | | @PostMapping("/updateGlassState") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<Boolean> updateGlassState(@RequestBody UpPattenUsage upPattenUsage) { |
| | | Boolean whether = upPattenUsageService.updateGlassState(upPattenUsage); |
| | | if (whether){ |
| | | return Result.build(200, "成功", whether); |
| | | }else { |
| | | return Result.build(100, "失败", whether); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |