| | |
| | | import com.example.erp.entity.pp.ProductionScheduling; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.pp.ProductionSchedulingService; |
| | | 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("/productionScheduling") |
| | | public class ProductionSchedulingController { |
| | | @Autowired |
| | | ProductionSchedulingService productionSchedulingService; |
| | | |
| | | //查询第一次排版数据 |
| | | @PostMapping ("/selectLastScheduling/{selectTime1}/{selectTime2}") |
| | | @ApiOperation("加载时查询排版数据接口") |
| | | @PostMapping ("/selectLastScheduling/{selectTime1}/{selectTime2}/{processes}/{orderId}") |
| | | public Result selectLastScheduling( |
| | | @PathVariable String selectTime1, |
| | | @PathVariable String selectTime2, |
| | | @PathVariable String processes, |
| | | @PathVariable String orderId, |
| | | @RequestBody ProductionScheduling productionScheduling){ |
| | | return Result.seccess(productionSchedulingService.selectLastScheduling(selectTime1,selectTime2,productionScheduling)); |
| | | return Result.seccess(productionSchedulingService.selectLastScheduling(selectTime1,selectTime2,processes,orderId,productionScheduling)); |
| | | |
| | | } |
| | | //点击查询排版数据 |
| | | @ApiOperation("点击查询排版数据接口") |
| | | @PostMapping ("/selectScheduling/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}") |
| | | public Result SelectScheduling( |
| | | 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)); |
| | | return Result.seccess(productionSchedulingService.selectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling)); |
| | | |
| | | } |
| | | |
| | | //点击查询排版数据 |
| | | //点击查询排版数据(带订单号查询) |
| | | @ApiOperation("根据条件查询排版数据接口") |
| | | @PostMapping ("/selectSchedulingNot/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}") |
| | | public Result SelectSchedulingNot( |
| | | 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)); |
| | | return Result.seccess(productionSchedulingService.selectSchedulingNotSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling)); |
| | | |
| | | } |
| | | |
| | | //添加排产数据 |
| | | @ApiOperation("添加排产数据接口") |
| | | @PostMapping("/addScheduling") |
| | | public Result addScheduling( @RequestBody Map<String,Object> object){ |
| | | |
| | | if(productionSchedulingService.addSchedulingSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"保存失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | //删除排产数据 |
| | | @ApiOperation("删除排产数据接口") |
| | | @PostMapping("/deleteScheduling") |
| | | public Result deleteScheduling( @RequestBody Map<String,Object> object) throws Exception{ |
| | | |
| | | if(productionSchedulingService.deleteSchedulingSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"删除失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("排版审核接口") |
| | | @PostMapping("/examineScheduling") |
| | | public Result examineScheduling( @RequestBody Map<String,Object> object){ |
| | | |
| | | if(productionSchedulingService.examineSchedulingSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"审核失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |