| | |
| | | /** |
| | | * param_data_expect |
| | | * |
| | | * @author zt generator |
| | | * @author zt generator |
| | | * @since 1.0.0 2024-03-04 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/basicInfo/ParamDataExpect/") |
| | | @Api(tags="param_data_expect") |
| | | @Api(tags = "param_data_expect") |
| | | public class ParamDataExpectController { |
| | | @Autowired |
| | | private ParamDataExpectService paramDataExpectService; |
| | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = Constant.QT.STRING, format = "NAME^LK"), |
| | | @ApiImplicitParam(name = "nodeType", value = "类型", dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "srcId", value = "上级ID", dataType = Constant.QT.STRING)}) |
| | | public PageResult<ParamDataExpect> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = Constant.QT.STRING, format = "NAME^LK"), |
| | | @ApiImplicitParam(name = "nodeType", value = "类型", dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "srcId", value = "上级ID", dataType = Constant.QT.STRING)}) |
| | | public PageResult<ParamDataExpect> page(@ApiIgnore @QueryParam QueryFilter queryFilter) { |
| | | |
| | | return PageResult.ok(paramDataExpectService.page(queryFilter)); |
| | | } |
| | | |
| | | @PostMapping("get") |
| | | public Result getSelect(@RequestBody List<ParamDataExpect> list){ |
| | | for(ParamDataExpect ParamDataExpect:list){ |
| | | public Result getSelect(@RequestBody List<ParamDataExpect> list) { |
| | | for (ParamDataExpect ParamDataExpect : list) { |
| | | ParamDataExpect.setProductId(ParamDataExpect.getId()); |
| | | ParamDataExpect.setId(null); |
| | | this.insert(ParamDataExpect); |
| | | paramDataExpectService.insert(ParamDataExpect); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @GetMapping("{id}") |
| | | @ApiOperation("信息") |
| | | public Result<ParamDataExpect> get(@PathVariable("id") Long id){ |
| | | public Result<ParamDataExpect> get(@PathVariable("id") Long id) { |
| | | ParamDataExpect data = paramDataExpectService.get(id); |
| | | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody ParamDataExpect paramDataExpect){ |
| | | @PostMapping("save") |
| | | public Result save(@RequestBody ParamDataExpect paramDataExpect) { |
| | | //效验数据 |
| | | |
| | | ValidatorUtils.validateEntity(paramDataExpect, AddGroup.class, DefaultGroup.class); |
| | | paramDataExpectService.insert(paramDataExpect); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody ParamDataExpect paramDataExpect){ |
| | | //效验数据 |
| | | for (ParamDataExpect expect:paramDataExpect.getDataThreeList()){ |
| | | ValidatorUtils.validateEntity(expect, UpdateGroup.class, DefaultGroup.class); |
| | | paramDataExpectService.update(expect); |
| | | for (ParamDataExpect expect : paramDataExpect.getDataThreeList()) { |
| | | if (expect.getId()!=null){ |
| | | ValidatorUtils.validateEntity(expect, UpdateGroup.class, DefaultGroup.class); |
| | | paramDataExpectService.update(expect); |
| | | }else{ |
| | | ValidatorUtils.validateEntity(expect, AddGroup.class, DefaultGroup.class); |
| | | paramDataExpectService.insert(expect); |
| | | } |
| | | } |
| | | return Result.ok(); |
| | | } |
| | |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |
| | | public Result delete(@RequestBody Long[] ids){ |
| | | public Result delete(@RequestBody Long[] ids) { |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | paramDataExpectService.delete(ids); |