package com.example.erp.controller.pp; import com.example.erp.common.Constants; import com.example.erp.common.Result; import com.example.erp.entity.pp.ProductionScheduling; import com.example.erp.exception.ServiceException; import com.example.erp.service.pp.ProductionSchedulingService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.sql.Date; import java.util.Map; @RestController @RequestMapping("/productionScheduling") public class ProductionSchedulingController { @Autowired ProductionSchedulingService productionSchedulingService; //查询第一次排版数据 @PostMapping ("/selectLastScheduling/{selectTime1}/{selectTime2}") public Result selectLastScheduling( @PathVariable String selectTime1, @PathVariable String selectTime2, @RequestBody ProductionScheduling productionScheduling){ return Result.seccess(productionSchedulingService.selectLastScheduling(selectTime1,selectTime2,productionScheduling)); } //点击查询排版数据 @PostMapping ("/selectScheduling/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}") public Result SelectScheduling( @PathVariable String selectTime1, @PathVariable String selectTime2, @PathVariable String orderId, @PathVariable String processes, @PathVariable Integer state, @RequestBody ProductionScheduling productionScheduling){ return Result.seccess(productionSchedulingService.SelectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling)); } //点击查询排版数据 @PostMapping ("/selectSchedulingNot/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}") public Result SelectSchedulingNot( @PathVariable String selectTime1, @PathVariable String selectTime2, @PathVariable String orderId, @PathVariable String processes, @PathVariable Integer state, @RequestBody ProductionScheduling productionScheduling){ return Result.seccess(productionSchedulingService.SelectSchedulingNotSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling)); } //添加排产数据 @PostMapping("/addScheduling") public Result AddScheduling( @RequestBody Map object){ if(productionSchedulingService.AddSchedulingSv(object)){ return Result.seccess(); }else { throw new ServiceException(Constants.Code_500,"保存失败"); } } }