检验任务不良类型优化
parent
677c6ddb83
commit
5ea60773d6
@ -0,0 +1,137 @@
|
||||
package com.op.quality.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.op.common.log.annotation.Log;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.quality.domain.QcCheckTaskDefect;
|
||||
import com.op.quality.service.IQcCheckTaskDefectService;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 来料检验任务--不良数量Controller
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2024-03-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/qcCheckTaskDefect")
|
||||
public class QcCheckTaskDefectController extends BaseController {
|
||||
@Autowired
|
||||
private IQcCheckTaskDefectService qcCheckTaskDefectService;
|
||||
|
||||
/**
|
||||
* 查询来料检验任务--不良数量列表
|
||||
*/
|
||||
@RequiresPermissions("quality:qcCheckTaskDefect:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(QcCheckTaskDefect qcCheckTaskDefect) {
|
||||
startPage();
|
||||
List<QcCheckTaskDefect> list = qcCheckTaskDefectService.selectQcCheckTaskDefectList(qcCheckTaskDefect);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出来料检验任务--不良数量列表
|
||||
*/
|
||||
@RequiresPermissions("quality:qcCheckTaskDefect:export")
|
||||
@Log(title = "来料检验任务--不良数量", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, QcCheckTaskDefect qcCheckTaskDefect) {
|
||||
List<QcCheckTaskDefect> list = qcCheckTaskDefectService.selectQcCheckTaskDefectList(qcCheckTaskDefect);
|
||||
ExcelUtil<QcCheckTaskDefect> util = new ExcelUtil<QcCheckTaskDefect>(QcCheckTaskDefect. class);
|
||||
util.exportExcel(response, list, "来料检验任务--不良数量数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取来料检验任务--不良数量详细信息
|
||||
*/
|
||||
@RequiresPermissions("quality:qcCheckTaskDefect:query")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") String recordId) {
|
||||
return success(qcCheckTaskDefectService.selectQcCheckTaskDefectByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增来料检验任务--不良数量
|
||||
*/
|
||||
@RequiresPermissions("quality:qcCheckTaskDefect:add")
|
||||
@Log(title = "来料检验任务--不良数量", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QcCheckTaskDefect qcCheckTaskDefect) {
|
||||
return toAjax(qcCheckTaskDefectService.insertQcCheckTaskDefect(qcCheckTaskDefect));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改来料检验任务--不良数量
|
||||
*/
|
||||
@RequiresPermissions("quality:qcCheckTaskDefect:edit")
|
||||
@Log(title = "来料检验任务--不良数量", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QcCheckTaskDefect qcCheckTaskDefect) {
|
||||
return toAjax(qcCheckTaskDefectService.updateQcCheckTaskDefect(qcCheckTaskDefect));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除来料检验任务--不良数量
|
||||
*/
|
||||
@RequiresPermissions("quality:qcCheckTaskDefect:remove")
|
||||
@Log(title = "来料检验任务--不良数量", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable String[] recordIds) {
|
||||
return toAjax(qcCheckTaskDefectService.deleteQcCheckTaskDefectByRecordIds(recordIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* PC不良数据获取
|
||||
*/
|
||||
@GetMapping("/getDefectValue/{belongToDetail}")
|
||||
public TableDataInfo getDefectValue(@PathVariable String belongToDetail) {
|
||||
List<QcCheckTaskDefect> list = qcCheckTaskDefectService.getDefectListByBelongToDetail(belongToDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* PC不良数据提交
|
||||
*/
|
||||
@PostMapping("/commitDefectValue")
|
||||
public AjaxResult commitDefectValue(@RequestBody List<QcCheckTaskDefect> checkTaskDefects) {
|
||||
if (CollectionUtils.isEmpty(checkTaskDefects)) {
|
||||
return error("操作失败,不良数据为空");
|
||||
}else {
|
||||
return toAjax(qcCheckTaskDefectService.commitDefectValue(checkTaskDefects));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* PC不良数据提交
|
||||
*/
|
||||
@PutMapping("/updateDefectValue")
|
||||
public AjaxResult updateDefectValue(@RequestBody List<QcCheckTaskDefect> checkTaskDefects) {
|
||||
if (CollectionUtils.isEmpty(checkTaskDefects)) {
|
||||
return error("操作失败,不良数据为空");
|
||||
}else {
|
||||
return toAjax(qcCheckTaskDefectService.updateDefectValue(checkTaskDefects));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue