package com.gkhy.exam.admin.controller.web;
|
|
import com.gkhy.exam.common.api.CommonResult;
|
import com.gkhy.exam.system.domain.*;
|
import com.gkhy.exam.system.service.InspectionRecordService;
|
import com.gkhy.exam.system.service.InspectionSpecificationService;
|
import com.gkhy.exam.system.service.PurchaseApplyService;
|
import com.gkhy.exam.system.service.PurchaseContractService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
@Api(tags = "采买管理")
|
@RestController
|
@RequestMapping("/purchase/audit")
|
public class PurchaseController {
|
@Autowired
|
private PurchaseApplyService applyService;
|
|
@Autowired
|
private PurchaseContractService contractService;
|
|
@Autowired
|
private InspectionSpecificationService specificationService;
|
|
@Autowired
|
private InspectionRecordService recordService;
|
|
|
|
/**
|
* 采购申请
|
* @param purchaseApply
|
* @return
|
*/
|
@ApiOperation(value = "采购申请列表(分页)")
|
@ApiImplicitParams({
|
@ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
|
@ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
|
})
|
@GetMapping("/apply/list")
|
public CommonResult listApply(PurchaseApply purchaseApply){
|
return CommonResult.success(applyService.selectApplyList(purchaseApply));
|
}
|
|
|
/**
|
*采购申请新增
|
* @param purchaseApply
|
* @return
|
*/
|
@ApiOperation(value = "采购申请新增")
|
@PostMapping("/apply/insert")
|
public CommonResult insertApply(@RequestBody PurchaseApply purchaseApply){
|
return applyService.insertApply(purchaseApply);
|
}
|
|
/**
|
* 采购申请修改
|
* @param purchaseApply
|
* @return
|
*/
|
@ApiOperation(value = "采购申请修改")
|
@PostMapping("/apply/update")
|
public CommonResult updateApply(@RequestBody PurchaseApply purchaseApply){
|
return applyService.updateApply(purchaseApply);
|
}
|
|
/**
|
* 采购申请删除
|
* @param applyId
|
* @return
|
*/
|
@ApiOperation(value = "采购申请删除")
|
@GetMapping("/apply/deleted")
|
public CommonResult deletedApply(@RequestParam("applyId") Integer applyId){
|
return applyService.deletedApply(applyId);
|
}
|
|
|
/**
|
* 采购合同
|
* @param purchaseContract
|
* @return
|
*/
|
@ApiOperation(value = "采购合同列表(分页)")
|
@ApiImplicitParams({
|
@ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
|
@ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
|
})
|
@GetMapping("/contract/list")
|
public CommonResult listContract(PurchaseContract purchaseContract){
|
return CommonResult.success(contractService.selectContractList(purchaseContract));
|
}
|
|
|
/**
|
*采购合同新增
|
* @param purchaseContract
|
* @return
|
*/
|
@ApiOperation(value = "采购合同新增")
|
@PostMapping("/contract/insert")
|
public CommonResult insertContract(@RequestBody PurchaseContract purchaseContract){
|
return contractService.insertContract(purchaseContract);
|
}
|
|
/**
|
* 采购合同修改
|
* @param purchaseContract
|
* @return
|
*/
|
@ApiOperation(value = "采购合同修改")
|
@PostMapping("/contract/update")
|
public CommonResult updateContract(@RequestBody PurchaseContract purchaseContract){
|
return contractService.updateContract(purchaseContract);
|
}
|
|
/**
|
* 采购合同删除
|
* @param contractId
|
* @return
|
*/
|
@ApiOperation(value = "采购合同删除")
|
@GetMapping("/contract/deleted")
|
public CommonResult deletedContract(@RequestParam("contractId") Integer contractId){
|
return contractService.deletedContract(contractId);
|
}
|
|
/**
|
* 检验规范
|
* @param specification
|
* @return
|
*/
|
@ApiOperation(value = "检验规范列表(分页)")
|
@ApiImplicitParams({
|
@ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
|
@ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
|
})
|
@GetMapping("/specification/list")
|
public CommonResult listSpecification(InspectionSpecification specification){
|
return CommonResult.success(specificationService.selectSpecificationList(specification));
|
}
|
|
|
/**
|
*检验规范新增
|
* @param specification
|
* @return
|
*/
|
@ApiOperation(value = "检验规范新增")
|
@PostMapping("/specification/insert")
|
public CommonResult insertSpecification(@RequestBody InspectionSpecification specification){
|
return specificationService.insertSpecification(specification);
|
}
|
|
/**
|
* 检验规范修改
|
* @param specification
|
* @return
|
*/
|
@ApiOperation(value = "检验规范修改")
|
@PostMapping("/specification/update")
|
public CommonResult updateSpecification(@RequestBody InspectionSpecification specification){
|
return specificationService.updateSpecification(specification);
|
}
|
|
/**
|
* 检验规范删除
|
* @param specificationId
|
* @return
|
*/
|
@ApiOperation(value = "检验规范删除")
|
@GetMapping("/specification/deleted")
|
public CommonResult deletedSpecification(@RequestParam("specificationId") Integer specificationId){
|
return specificationService.deletedSpecification(specificationId);
|
}
|
|
/**
|
* 检验记录
|
* @param record
|
* @return
|
*/
|
@ApiOperation(value = "检验记录列表(分页)")
|
@ApiImplicitParams({
|
@ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
|
@ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
|
})
|
@GetMapping("/record/list")
|
public CommonResult listRecord(InspectionRecord record){
|
return CommonResult.success(recordService.selectRecordList(record));
|
}
|
|
|
/**
|
*检验记录新增
|
* @param record
|
* @return
|
*/
|
@ApiOperation(value = "检验记录新增")
|
@PostMapping("/record/insert")
|
public CommonResult insertRecord(@RequestBody InspectionRecord record){
|
return recordService.insertRecord(record);
|
}
|
|
/**
|
* 检验记录修改
|
* @param record
|
* @return
|
*/
|
@ApiOperation(value = "检验记录修改")
|
@PostMapping("/record/update")
|
public CommonResult updateRecord(@RequestBody InspectionRecord record){
|
return recordService.updateRecord(record);
|
}
|
|
/**
|
* 检验记录删除
|
* @param recordId
|
* @return
|
*/
|
@ApiOperation(value = "检验记录删除")
|
@GetMapping("/record/deleted")
|
public CommonResult deletedRecord(@RequestParam("recordId") Integer recordId){
|
return recordService.deletedRecord(recordId);
|
}
|
|
|
}
|