package com.example.erp.controller.pp;
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import com.example.erp.common.Constants;
|
import com.example.erp.common.Result;
|
import com.example.erp.entity.sd.OrderGlassDetail;
|
import com.example.erp.entity.sd.OrderDetail;
|
import com.example.erp.exception.ServiceException;
|
import com.example.erp.service.pp.WorkOrderService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.sql.Date;
|
import java.util.Map;
|
|
@RestController
|
@Api(value="工单管理controller",tags={"工单管理操作接口"})
|
@RequestMapping("/workOrder")
|
public class WorkOrderController {
|
@Autowired
|
WorkOrderService workOrderService;
|
|
//查询工单
|
@ApiOperation("查询工单接口")
|
@SaCheckPermission("SelectWorkOrder.search")
|
@PostMapping ("/orderGlassDetail/{selectTime1}/{selectTime2}/{state}")
|
public Result dateWork(
|
@PathVariable Date selectTime1,
|
@PathVariable Date selectTime2,
|
@PathVariable Integer state,
|
@RequestBody OrderGlassDetail orderGlassDetail){
|
return Result.seccess(workOrderService.defaultDateWork(selectTime1,selectTime2,state,orderGlassDetail));
|
}
|
|
//转生产订单查询
|
@ApiOperation("转生产订单查询接口")
|
@PostMapping ("/addWork/{orderId}")
|
public Result addWork(
|
@PathVariable String orderId,
|
@RequestBody OrderDetail orderDetail){
|
return Result.seccess(workOrderService.addDateWork(orderId,orderDetail));
|
|
}
|
|
|
//添加工单
|
@ApiOperation("添加工单接口")
|
@SaCheckPermission("addWorkOrder.add")
|
@PostMapping("/addOrderWork")
|
public Result addOrderWork( @RequestBody Map<String,Object> object){
|
|
if(workOrderService.addOrderWorkSv(object)){
|
return Result.seccess();
|
}else {
|
throw new ServiceException(Constants.Code_500,"保存失败");
|
|
}
|
}
|
|
//删除工单
|
@ApiOperation("删除工单接口")
|
@SaCheckPermission("SelectWorkOrder.delete")
|
@PostMapping("/deleteOrderWork/{orderId}/{productionId}")
|
public Result deleteOrderWork(
|
@PathVariable String orderId,
|
@PathVariable String productionId
|
){
|
// if(workOrderService.deleteOrderWorkSv(orderId,productionId)){
|
// return Result.seccess();
|
// }else {
|
// throw new ServiceException(Constants.Code_500,"删除失败");
|
//
|
// }
|
return Result.seccess(workOrderService.deleteOrderWorkSv(orderId,productionId));
|
}
|
}
|