gaoluyang
昨天 8c65f898ed6e5b0c7a94c792c4562f6ec831dccd
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
package cn.iocoder.yudao.module.mes.controller.admin.pro.wage;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.mes.controller.admin.pro.wage.vo.MesProProcessWageFieldRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.pro.wage.vo.MesProProcessWageFieldSaveListReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.pro.wage.MesProProcessWageFieldDO;
import cn.iocoder.yudao.module.mes.service.pro.wage.MesProProcessWageFieldService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
@Tag(name = "管理后台 - MES 工序工资字段")
@RestController
@RequestMapping("/mes/pro/process-wage-field")
@Validated
public class MesProProcessWageFieldController {
 
    @Resource
    private MesProProcessWageFieldService processWageFieldService;
 
    @GetMapping("/list")
    @Operation(summary = "获得工序的工资字段列表")
    @Parameter(name = "processId", description = "工序编号", required = true, example = "1024")
    public CommonResult<List<MesProProcessWageFieldRespVO>> getFieldList(@RequestParam("processId") Long processId) {
        List<MesProProcessWageFieldDO> list = processWageFieldService.getFieldList(processId);
        return success(BeanUtils.toBean(list, MesProProcessWageFieldRespVO.class));
    }
 
    @PostMapping("/save-list")
    @Operation(summary = "批量保存工序工资字段")
    @PreAuthorize("@ss.hasPermission('mes:pro-process:update')")
    public CommonResult<Boolean> saveFieldList(@Valid @RequestBody MesProProcessWageFieldSaveListReqVO reqVO) {
        processWageFieldService.saveFieldList(reqVO);
        return success(true);
    }
 
}