廖井涛
2024-02-23 b0edff4c02128b722a9a6674b016536d4395872d
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
@@ -1,6 +1,12 @@
package com.example.erp.controller.pp;
import com.example.erp.common.Constants;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.Order;
import com.example.erp.common.Result;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.entity.sd.OrderGlassDetail;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.pp.FlowCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -13,11 +19,61 @@
    @Autowired
    FlowCardService flowCardService;
    @PostMapping  ("/flowCard/{selectTime1}/{selectTime2}}")
    //流程卡管理查询
    @PostMapping  ("/flowCard/{selectTime1}/{selectTime2}")
    public Result DateProcess(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @RequestBody FlowCard  flowCard){
        return Result.seccess(flowCardService.selectProcessCard(selectTime1,selectTime2,flowCard));
    }
    //分架查询
    @PostMapping  ("/selectAddProcess/{selectTime1}/{selectTime2}")
    public Result SelectAddProcess(
            @PathVariable Date selectTime1,
            @PathVariable Date selectTime2,
            @RequestBody FlowCard  flowCard){
    //    System.out.println(selectTime1+" "+selectTime2+" "+flowCard.toString());
        return Result.seccess(flowCardService.selectAddProcess(selectTime1,selectTime2,flowCard));
    }
    //分架明细查询
    @PostMapping  ("/detailsSelect/{orderId}")
    public Result DetailsSelect(
            @PathVariable String orderId,
            @RequestBody FlowCard  flowCard){
        return Result.seccess(flowCardService.DetailsSelectSv(orderId,flowCard));
    }
    //删除工单
    @PostMapping("/deleteFlowCard/{orderId}/{processId}")
    public Result deleteOrderWork(
            @PathVariable String orderId,
            @PathVariable String processId
    ){
        if(flowCardService.DeleteFlowCardSv(orderId,processId)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"删除失败");
        }
    }
    //分架明细查询
    @PostMapping  ("/selectNoCard/{orderId}/{productionId}")
    public Result SelectNoCard(
            @PathVariable String orderId,
            @PathVariable String productionId,
            @RequestBody FlowCard  flowCard){
        return Result.seccess(flowCardService.SelectNoCardSv(orderId,productionId,flowCard));
    }
}