guoyuji
2024-02-22 1b86547ddc47a96e86eb376d0a381814ad621fd0
north-glass-erp/src/main/java/com/example/erp/controller/mm/FinishedGoodsInventoryController.java
@@ -1,12 +1,21 @@
package com.example.erp.controller.mm;
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.entity.mm.FinishedOperateLog;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.mm.FinishedGoodsInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.example.erp.entity.mm.FinishedGoodsInventory;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/FinishedGoodsInventory")
@@ -14,8 +23,127 @@
    @Autowired
    FinishedGoodsInventoryService finishedGoodsInventoryService;
    @GetMapping("/getselet/{pageNum}/{pageSize}")
    public Result defaultDateFinishedGoodsInventory(@PathVariable Integer pageNum, @PathVariable Integer pageSize){
        return Result.seccess(finishedGoodsInventoryService.defaultDateFinishedGoodsInventory(pageNum,pageSize));
    /*成品库存查询*/
    @PostMapping("/getselet/{pageNum}/{pageSize}")
    public Result defaultDateFinishedGoodsInventory(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody FinishedGoodsInventory finishedGoodsInventory){
        return Result.seccess(finishedGoodsInventoryService.defaultDateFinishedGoodsInventory(pageNum,pageSize,finishedGoodsInventory));
    }
    /*查询可入库的成品数据*/
    @PostMapping("/getseletwarehousing/{pageNum}/{pageSize}")
    public Result getseletwarehousing(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody FlowCard flowCard){
        return Result.seccess(finishedGoodsInventoryService.getseletwarehousing(pageNum,pageSize,flowCard));
    }
    /*成品入库*/
    @PostMapping("/addseletwarehousing")
    public Result addseletwarehousing( @RequestBody Map<String,Object>  object){
        if(finishedGoodsInventoryService.addseletwarehousing(object)){
            return Result.seccess();
        }else {
           throw new ServiceException(Constants.Code_500,"入库失败");
        }
    }
    /*查询可发货的成品数据*/
    @PostMapping("/getseletdeliveryDetail/{pageNum}/{pageSize}")
    public Result getseletdeliveryDetail(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OrderDetail orderDetail){
        return Result.seccess(finishedGoodsInventoryService.getseletdeliveryDetail(pageNum,pageSize,orderDetail));
    }
    /*成品发货*/
    @PostMapping("/adddeliveryDetail")
    public Result adddeliveryDetail( @RequestBody Map<String,Object>  object){
        if(finishedGoodsInventoryService.adddeliveryDetail(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"出库失败");
        }
    }
    /* 调拨查询*/
    @PostMapping("/getSelectAllocate/{pageNum}/{pageSize}")
    public Result getSelectAllocate(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody OrderDetail orderDetail){
        return Result.seccess(finishedGoodsInventoryService.getSelectAllocate(pageNum,pageSize,orderDetail));
    }
    /*订单调拨*/
    @PostMapping("/updateFinishedGoodsInventoryAllocate")
    public Result updateFinishedGoodsInventoryAllocate( @RequestBody Map<String,Object>  object){
        if(finishedGoodsInventoryService.updateFinishedGoodsInventoryAllocate(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"调拨失败");
        }
    }
    /*领出查询*/
    @PostMapping("/getselectAllocateFinishedOperateLog/{pageNum}/{pageSize}")
    public Result getselectAllocateFinishedOperateLog(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody FinishedOperateLog finishedOperateLog){
        return Result.seccess(finishedGoodsInventoryService.getselectAllocateFinishedOperateLog(pageNum,pageSize,finishedOperateLog));
    }
    /*订单领出*/
    @PostMapping("/updateFinishedGoodsInventoryTakeOut")
    public Result updateFinishedGoodsInventoryTakeOut( @RequestBody Map<String,Object>  object){
        if(finishedGoodsInventoryService.updateFinishedGoodsInventoryTakeOut(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"领出失败");
        }
    }
    /*领出记录查询*/
    @PostMapping("/getSelectOperateRecord/{pageNum}/{pageSize}")
    public Result getSelectOperateRecord(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody FinishedOperateLog finishedOperateLog){
        return Result.seccess(finishedGoodsInventoryService.getSelectOperateRecord(pageNum,pageSize,finishedOperateLog));
    }
    /*订单返工*/
    @PostMapping("/updateFinishedGoodsInventoryRework")
    public Result updateFinishedGoodsInventoryRework( @RequestBody Map<String,Object>  object){
        if(finishedGoodsInventoryService.updateFinishedGoodsInventoryRework(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"返工失败");
        }
    }
    /*订单审核*/
    @PostMapping("/updateFinishedGoodsInventoryToExamine")
    public Result updateFinishedGoodsInventoryToExamine( @RequestBody Map<String,Object>  object){
        if(finishedGoodsInventoryService.updateFinishedGoodsInventoryToExamine(object,"审核")){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"领出失败");
        }
    }
    /*订单反审*/
    @PostMapping("/updateFinishedGoodsInventoryCounterexamination")
    public Result updateFinishedGoodsInventoryCounterexamination( @RequestBody Map<String,Object>  object){
        if(finishedGoodsInventoryService.updateFinishedGoodsInventoryToExamine(object,"反审")){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"领出失败");
        }
    }
}