| | |
| | | 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.util.Map; |
| | | |
| | | @RestController |
| | | @Api(value="工单管理controller",tags={"工单管理操作接口"}) |
| | | @RequestMapping("/workOrder") |
| | | public class WorkOrderController { |
| | | @Autowired |
| | | WorkOrderService workOrderService; |
| | | |
| | | //查询工单 |
| | | @ApiOperation("查询工单接口") |
| | | @PostMapping ("/orderGlassDetail/{selectTime1}/{selectTime2}/{state}") |
| | | public Result DateWork( |
| | | public Result dateWork( |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable Integer state, |
| | |
| | | } |
| | | |
| | | //转生产订单查询 |
| | | @ApiOperation("转生产订单查询接口") |
| | | @PostMapping ("/addWork/{orderId}") |
| | | |
| | | public Result AddWork( |
| | | public Result addWork( |
| | | @PathVariable String orderId, |
| | | @RequestBody OrderDetail orderDetail){ |
| | | return Result.seccess(workOrderService.AddDateWork(orderId,orderDetail)); |
| | | return Result.seccess(workOrderService.addDateWork(orderId,orderDetail)); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //添加工单 |
| | | @ApiOperation("添加工单接口") |
| | | @PostMapping("/addOrderWork") |
| | | public Result AddOrderWork( @RequestBody Map<String,Object> object){ |
| | | System.out.println("obj:"+object); |
| | | if(workOrderService.AddOrderWorkSv(object)){ |
| | | public Result addOrderWork( @RequestBody Map<String,Object> object){ |
| | | |
| | | if(workOrderService.addOrderWorkSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"保存失败"); |
| | |
| | | } |
| | | } |
| | | |
| | | //删除工单 |
| | | @ApiOperation("删除工单接口") |
| | | @PostMapping("/deleteOrderWork/{orderId}/{productName}") |
| | | public Result deleteOrderWork( |
| | | @PathVariable String orderId, |
| | | @PathVariable String productName |
| | | ){ |
| | | if(workOrderService.DeleteOrderWorkSv(orderId,productName)){ |
| | | if(workOrderService.deleteOrderWorkSv(orderId,productName)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"删除失败"); |