| | |
| | | package com.mes.uppattenusage.controller; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.service.EngineeringService; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.pp.entity.OptimizeProject; |
| | | import com.mes.pp.service.OptimizeProjectService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | 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 com.mes.uppattenusage.service.GlassInfoService; |
| | | //import com.mes.uppattenusage.entity.OptimizeUpPattenUsage; |
| | | //import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | //import com.mes.glassinfo.entity.GlassInfo; |
| | | //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.GetMapping; |
| | | //import org.springframework.web.bind.annotation.RequestBody; |
| | | //import org.springframework.web.bind.annotation.RequestMapping; |
| | | //import org.springframework.web.bind.annotation.RestController; |
| | | // |
| | | //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; |
| | | // @ApiOperation("显示正在出片的工程信息") |
| | | // @GetMapping("/prioritylist") //查询现在上片机的玻璃信息 |
| | | // public Result<List<UpPattenUsage>> prioritylist() { |
| | | // List<UpPattenUsage> glass = upPattenUsageService.prioritylist(1); |
| | | // log.info("显示工位上的玻璃信息:{}", glass); |
| | | // return Result.build(200, "", glass); |
| | | // } |
| | | // |
| | | // @ApiOperation("点击选择工程保存后进行调用,传入工程号") |
| | | // @GetMapping("/saveUpPattenUsage") //查询现在上片机的玻璃信息 |
| | | // public Result<Integer> saveUpPattenUsage(String engineeringId) { |
| | | // List<UpPattenUsage> upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineeringId); |
| | | // log.info("将查询出的UpPattenUsage数据保存到数据库表里"); |
| | | // upPattenUsageService.saveUpPattenUsage(upPattenUsages); |
| | | // log.info("从PP表查询glassinfo的数据并保存到表里"); |
| | | // List<GlassInfo> glassinfo=glassInfoService.selectGlassInfo(engineeringId); |
| | | // return Result.build(200, "", 200); |
| | | // } |
| | | //} |
| | | 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("/saveUpPattenUsage") //查询现在上片机的玻璃信息 |
| | | @ResponseBody |
| | | public Result<Engineering> saveUpPattenUsage(@RequestBody Engineering engineering) { |
| | | log.info("engineeringId:{}", engineering); |
| | | UpPattenUsage upPattenUsage= upPattenUsageService.selectedEngineering(engineering.getEngineerId()); |
| | | if (upPattenUsage!=null){ |
| | | log.info("已保存过"); |
| | | return Result.build(200, "已保存的工程", null); |
| | | }else { |
| | | List<UpPattenUsage> upPattenUsages = upPattenUsageService.selectSaveUpPattenUsage(engineering.getEngineerId()); |
| | | log.info("将查询出的UpPattenUsage数据保存到数据库表里"); |
| | | upPattenUsageService.saveUpPattenUsage(upPattenUsages); |
| | | log.info("从PP表查询glassinfo的数据并保存到表里"); |
| | | List<GlassInfo> glassinfo=glassInfoService.selectGlassInfo(engineering.getEngineerId()); |
| | | glassInfoService.saveGlassInfo(glassinfo); |
| | | log.info("从PP表查询engineering的数据并保存到表里"); |
| | | List<Engineering> listengineering= engineeringService.selectEngineering(engineering.getEngineerId()); |
| | | engineeringService.saveEngineering(listengineering); |
| | | log.info("更改pp表状态为已领取"); |
| | | optimizeProjectService.changeTask(engineering.getEngineerId(), 200); |
| | | // List<UpPattenUsage> data=upPattenUsageService.prioritylist(); |
| | | // log.info("显示保存后的上片顺序表"); |
| | | return Result.build(200, "", engineering); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |