wangfei
2024-08-23 051613aa73be3e75af5a6dfdb86a722bcb5af094
hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/edgstoragecage/controller/EdgStorageCageController.java
@@ -1,12 +1,20 @@
package com.mes.edgstoragecage.controller;
import com.mes.edgstoragecage.entity.EdgStorageCage;
import com.mes.edgstoragecage.entity.EdgStorageCageDetails;
import com.mes.edgstoragecage.service.EdgStorageCageDetailsService;
import com.mes.edgstoragecage.service.EdgStorageCageService;
import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl;
import com.mes.taskcache.entity.TaskCache;
import com.mes.taskcache.service.impl.TaskCacheServiceImpl;
import com.mes.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.awt.image.ImageProducer;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -18,6 +26,7 @@
 * @author zhoush
 * @since 2024-04-07
 */
@Api(tags = "理片笼缓存")
@RestController
@RequestMapping("/edgStorageCage")
public class EdgStorageCageController {
@@ -25,34 +34,50 @@
    @Autowired
    private EdgStorageCageService edgStorageCageService;
    @ApiOperation("查询磨边缓存理片笼内详情")
    @Autowired
    private EdgStorageCageDetailsService edgStorageCageDetailsService;
    @ApiOperation("查询磨边缓存理片笼内详情 参数()")
    @PostMapping("/selectEdgStorageCage")
    @ResponseBody
    public Result selectEdgStorageCage () {
        List<Map> list=edgStorageCageService.selectEdgStorageCages();
        List<Map<String, Object>> list=edgStorageCageService.selectEdgStorageCages();
        return Result.build(200,"成功",list);
    }
    @ApiOperation("添加磨边缓存理片笼信息 功能:笼内绑定玻璃")
    @PostMapping("/insertEdgStorageCage")
    @ResponseBody
    public Result insertEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) {
        boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage);
        return Result.build(200,"添加成功",1);
    }
    @ApiOperation("修改磨边缓存理片笼信息   功能:对笼内栅格进行【启用/禁用】/ 【更换】笼内栅格玻璃信息")
//    @ApiOperation("添加磨边缓存理片笼信息   功能:笼内绑定玻璃  参数(EdgStorageCage edgStorageCage)")
//    @PostMapping("/insertEdgStorageCage")
//    @ResponseBody
//    public Result insertEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) {
//        boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage);
//        return Result.build(200,"添加成功",1);
//    }
    @ApiOperation("修改磨边缓存理片笼信息   功能:对笼内栅格进行【启用/禁用】")
    @PostMapping("/updateEdgStorageCage")
    @ResponseBody
    public Result updateEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) {
        boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage);
        return Result.build(200,"更换成功",1);
        String isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage)?"成功":"失败";
        return Result.build(200,"【启用/禁用】"+isSucess,1);
    }
    @ApiOperation("删除磨边缓存理片笼信息   功能:对笼内栅格玻璃进行【清除】")
    @PostMapping("/deleteEdgStorageCage")
    @ApiOperation("磨边缓存理片笼信息   功能:对笼内栅格玻璃进行【清除/更换/绑定】 EdgStorageCage格子信息,EdgStorageCageDetails 玻璃信息 ")
    @PostMapping("/edgStorageCageGlass")
    @ResponseBody
    public Result deleteEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) {
        boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage);
        return Result.build(200,"删除成功",1);
    public Result edgStorageCageGlass(@RequestBody EdgStorageCageDetails edgStorageCageDetails,int edgStorageCageId) {
        String isSucess=edgStorageCageService.updateEdgStorageCageDetails(edgStorageCageId,edgStorageCageDetails)?"成功":"失败";
        return Result.build(200,"【清除/更换/绑定】"+isSucess,1);
    }
    @ApiOperation("磨边模块汇报玻璃状态   功能:对笼内栅格玻璃进行【破损/拿走】  ")
    @PostMapping("/edgReportStatus")
    @ResponseBody
    public Result edgReportStatus(@RequestBody Map<String, Object> arguments) {
        /*arguments.put("line","1002");
        arguments.put("machine","卧式理片");*/
        String isSucess=edgStorageCageDetailsService.identWorn(arguments)?"成功":"失败";
        return Result.build(200,"【破损/拿走】"+isSucess,1);
    }
}