ZengTao
2025-03-28 f68d3c71819feb59e7a227a5d992b059b900916c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package com.mes.bigstoragetask.controller;
 
 
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.mes.bigstoragetask.entity.BigStorageCageFeedTask;
import com.mes.bigstoragetask.entity.BigStorageCageOutTask;
import com.mes.bigstoragetask.service.BigStorageCageOutTaskService;
import com.mes.temperingglass.entity.TemperingGlassInfo;
import com.mes.temperingglass.service.TemperingGlassInfoService;
import com.mes.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.tomcat.util.bcel.Const;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zhoush
 * @since 2024-04-16
 */
@Api(description = "出片任务信息")
@RestController
@RequestMapping("/bigStorageCageOutTask")
public class BigStorageCageOutTaskController {
 
    @Autowired
    private BigStorageCageOutTaskService bigStorageCageOutTaskService;
    @Autowired
    private TemperingGlassInfoService temperingGlassInfoService;
 
    @ApiOperation("出片任务修改")
    @PostMapping("/updatebigStorageCageOutTask")
    public Result deleteBigStorageCageDetails(@RequestBody BigStorageCageOutTask bigStorageCageOutTask) {
        if (bigStorageCageOutTask.getTaskState() > 3) {
            temperingGlassInfoService.remove(
                    new LambdaUpdateWrapper<TemperingGlassInfo>()
                            .in(TemperingGlassInfo::getGlassId, bigStorageCageOutTask.getGlassId())
            );
        } else {
            temperingGlassInfoService.update(
                    new LambdaUpdateWrapper<TemperingGlassInfo>()
                            .in(TemperingGlassInfo::getGlassId, bigStorageCageOutTask.getGlassId())
                            .set(TemperingGlassInfo::getState, 0)
            );
        }
        bigStorageCageOutTaskService.updateById(bigStorageCageOutTask);
        return Result.build(200, "修改成功", 1);
    }
 
    @ApiOperation("出片任务报表")
    @PostMapping("/selectBigStorageCageOutTask")
    public Result selectBigStorageCageOutTask(@RequestBody BigStorageCageOutTask bigStorageCageOutTask,
                                               @RequestParam(required = false) String startTime,
                                               @RequestParam(required = false) String endTime) {
        return Result.build(200, "查询成功", bigStorageCageOutTaskService.selectBigStorageCageOutTask(bigStorageCageOutTask, startTime, endTime));
    }
}