/*
|
* Copyright (c) 2018-2025, ztt All rights reserved.
|
*
|
* Redistribution and use in source and binary forms, with or without
|
* modification, are permitted provided that the following conditions are met:
|
*
|
* Redistributions of source code must retain the above copyright notice,
|
* this list of conditions and the following disclaimer.
|
* Redistributions in binary form must reproduce the above copyright
|
* notice, this list of conditions and the following disclaimer in the
|
* documentation and/or other materials provided with the distribution.
|
* Neither the name of the pig4cloud.com developer nor the names of its
|
* contributors may be used to endorse or promote products derived from
|
* this software without specific prior written permission.
|
* Author: ztt
|
*/
|
|
package com.chinaztt.mes.production.controller;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.chinaztt.mes.production.entity.ArtificialInformationJoin;
|
import com.chinaztt.mes.production.entity.ArtificialInformationRelation;
|
import com.chinaztt.mes.production.service.ArtificialInformationJoinService;
|
import com.chinaztt.ztt.common.core.util.R;
|
import com.chinaztt.ztt.common.log.annotation.SysLog;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.AllArgsConstructor;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
|
/**
|
* 人工类型分组
|
*
|
* @author sunxl
|
* @date 2021-01-28 11:19:54
|
*/
|
@RestController
|
@AllArgsConstructor
|
@RequestMapping("/artificialInformationJoin" )
|
@Api(value = "artificialInformationJoin", tags = "人工类型分组管理")
|
public class ArtificialInformationJoinController {
|
|
private final ArtificialInformationJoinService artificialInformationJoinService;
|
|
/**
|
* 分页查询
|
* @param page 分页对象
|
* @param artificialInformationJoin 人工类型分组
|
* @return
|
*/
|
@ApiOperation(value = "分页查询", notes = "分页查询")
|
@GetMapping("/page" )
|
public R getArtificialInformationJoinPage(Page page, ArtificialInformationJoin artificialInformationJoin) {
|
return R.ok(artificialInformationJoinService.page(page, Wrappers.query(artificialInformationJoin)));
|
}
|
|
/**
|
* 返回树形菜单集合
|
* @return 树形菜单
|
*/
|
@GetMapping("/tree")
|
public R getTree() {
|
return R.ok(artificialInformationJoinService.selectTree());
|
}
|
/**
|
* 通过id查询人工类型分组
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
@GetMapping("/{id}" )
|
public R getById(@PathVariable("id" ) Long id) {
|
return R.ok(artificialInformationJoinService.getById(id));
|
}
|
|
/**
|
* 新增人工类型分组
|
* @param artificialInformationJoin 人工类型分组
|
* @return R
|
*/
|
@ApiOperation(value = "新增人工类型分组", notes = "新增人工类型分组")
|
@SysLog("新增人工类型分组" )
|
@PostMapping
|
public R save(@RequestBody ArtificialInformationJoin artificialInformationJoin) {
|
return R.ok(artificialInformationJoinService.save(artificialInformationJoin));
|
}
|
|
/**
|
* 修改人工类型分组
|
* @param artificialInformationJoin 人工类型分组
|
* @return R
|
*/
|
@ApiOperation(value = "修改人工类型分组", notes = "修改人工类型分组")
|
@SysLog("修改人工类型分组" )
|
@PutMapping
|
public R updateById(@RequestBody ArtificialInformationJoin artificialInformationJoin) {
|
return R.ok(artificialInformationJoinService.updateById(artificialInformationJoin));
|
}
|
|
/**
|
* 通过id删除人工类型分组
|
* @param id id
|
* @return R
|
*/
|
@ApiOperation(value = "通过id删除人工类型分组", notes = "通过id删除人工类型分组")
|
@SysLog("通过id删除人工类型分组" )
|
@DeleteMapping("/{id}" )
|
public R removeById(@PathVariable Long id) {
|
return R.ok(artificialInformationJoinService.fullDelete(id));
|
}
|
|
/**
|
* 新增人工类型与人工分组的关联
|
* @param artificialInformationRelationList 人工类型与人工分组的关联
|
* @return R
|
*/
|
@ApiOperation(value = "新增人工类型与人工分组的关联", notes = "新增人工类型与人工分组的关联")
|
@SysLog("新增人工类型与人工分组的关联" )
|
@PostMapping("/relation")
|
public R saveRelation(@RequestBody List<ArtificialInformationRelation> artificialInformationRelationList) {
|
return R.ok(artificialInformationJoinService.fullSave(artificialInformationRelationList));
|
}
|
}
|