chenlu
2024-03-07 f595d1fc19019f30bb1ee8729eb50aab8999f50f
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProductionSchedulingController.java
New file
@@ -0,0 +1,90 @@
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<String,Object>  object){
        if(productionSchedulingService.AddSchedulingSv(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"保存失败");
        }
    }
    //删除排产数据
    @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,"删除失败");
        }
    }
    @PostMapping("/examineScheduling")
    public Result ExamineScheduling( @RequestBody Map<String,Object>  object){
        if(productionSchedulingService.ExamineSchedulingSv(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"审核失败");
        }
    }
}