Fancy
2024-06-25 7165632fcb7b3b782b8959cfe1e7e1c51872e228
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
package com.dy.pmsProduct.workStation;
 
import com.dy.common.aop.SsoPowerAop;
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.aop.Log;
import com.dy.pmsGlobal.pojoSta.StaAssemblyWorkLast;
import com.dy.pmsProduct.workStation.QueryVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
import java.util.Map;
/**
 * 工站使用情况
 */
@Slf4j
@RestController
@RequestMapping(path="workStation")
public class WorkStationCtl {
    private WorkStationSv sv;
    @Autowired
    public void setSv(WorkStationSv workStationSv){
        sv = workStationSv;
    }
    /**
     * 分页查询
     * @param vo
     * @return
     */
    @PostMapping(path="some")
    @SsoPowerAop(power = "-1")
    @Log("分页查询工站使用情况")
    public BaseResponse<QueryResultVo<List<StaAssemblyWorkLast>>> some(@RequestBody QueryVo vo){
        QueryResultVo<List<StaAssemblyWorkLast>> list = sv.selectSome(vo) ;
        return BaseResponseUtils.buildSuccess(list);
    }
    /**
     * 删除正在被使用的工站信息,将工站闲置
     * @param id
     * @return
     */
    @GetMapping(path="delete")
    @SsoPowerAop(power = "10300001")
    @Log("删除产品信息")
    public BaseResponse<Boolean> delete(String id){
        int count = sv.delete(Long.parseLong(id));
        if (count <= 0) {
            return BaseResponseUtils.buildFail("数据库存储失败");
        } else {
            return BaseResponseUtils.buildSuccess(true);
        }
    }
}