guoyujie
2 天以前 c4b9a339caff12e95f61c3d5dc950aafcc8c566c
north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java
@@ -4,6 +4,9 @@
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.example.erp.common.Constants;
import com.example.erp.common.Result;
import com.example.erp.dto.mm.FinishedOperateLogDTO;
import com.example.erp.dto.sd.DeliveryDetailDTO;
import com.example.erp.dto.sd.DeliveryDetailProductDTO;
import com.example.erp.entity.mm.FinishedGoodsInventory;
import com.example.erp.entity.sd.Delivery;
import com.example.erp.entity.sd.DeliveryDetail;
@@ -11,17 +14,21 @@
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.exception.ServiceException;
import com.example.erp.service.sd.DeliveryService;
import com.example.erp.tools.DownExcel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
@RestController
@Api(value="发货controller",tags={"发货操作接口"})
@RequestMapping("/Delivery")
@RequestMapping("/delivery")
public class DeliveryController {
    @Autowired
    DeliveryService deliveryService;
@@ -41,6 +48,14 @@
    @PostMapping("/getSelectDeliveryDetailReport/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectDeliveryDetailReport(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody DeliveryDetail deliveryDetail){
        return Result.seccess(deliveryService.getSelectDeliveryDetailReport(pageNum,pageSize,selectDate,deliveryDetail));
    }
    /*发货报表查询*/
    @ApiOperation("发货产品分类报表查询接口")
    @SaCheckPermission("deliveryReport.search")
    @PostMapping("/getSelectDeliveryDetailProductReport/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectDeliveryDetailProductReport(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody DeliveryDetail deliveryDetail){
        return Result.seccess(deliveryService.getSelectDeliveryDetailProductReport(pageNum,pageSize,selectDate,deliveryDetail));
    }
    /*发货订单明细查询*/
@@ -70,45 +85,55 @@
    @SaCheckPermission("createDelivery.add")
    @PostMapping("/insertDelivery")
    public Result insertDelivery( @RequestBody Map<String,Object> object){
        if(deliveryService.insertDelivery(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"发货失败");
        }
        return Result.seccess(deliveryService.insertDelivery(object));
    }
    @ApiOperation("发货审核修改接口")
    @SaCheckPermission("createDelivery.review")
    @PostMapping("/updateDeliveryToExamine")
    public Result updateDeliveryToExamine( @RequestBody Map<String,Object> object){
        if(deliveryService.updateDeliveryToExamine(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"审核失败");
        }
        return Result.seccess(deliveryService.updateDeliveryToExamine(object));
    }
    @ApiOperation("发货删除接口")
    @SaCheckPermission("selectDelivery.delete")
    @PostMapping("/deleteDelivery")
    public Result deleteDelivery( @RequestBody Map<String,Object> object){
        if(deliveryService.deleteDelivery(object)){
            return Result.seccess();
        }else {
            throw new ServiceException(Constants.Code_500,"删除失败");
        }
        return Result.seccess(deliveryService.deleteDelivery(object));
    }
    @ApiOperation("发货订单查询接口")
    @SaCheckPermission("selectDelivery.search")
    @PostMapping("/getSelectDeliveryPrinting")
    public Result getSelectDeliveryPrinting( @RequestBody DeliveryDetail deliveryDetail){
        return Result.seccess(deliveryService.getSelectDeliveryPrinting(deliveryDetail));
    public Result getSelectDeliveryPrinting( @RequestBody Map<String,Object> object) throws IllegalAccessException {
        return Result.seccess(deliveryService.getSelectDeliveryPrinting(object));
    }
    @ApiOperation("订单发货订单查询接口")
    @SaCheckPermission("selectDelivery.search")
    @PostMapping("/getSelectOrderPrinting/{selectedValues}")
    public Result getSelectOrderPrinting(@PathVariable List<String> selectedValues, @RequestBody OrderDetail orderDetail){
        return Result.seccess(deliveryService.getSelectOrderPrinting(orderDetail,selectedValues));
    }
    @ApiOperation("发货明细报表")
    @PostMapping("/exportDeliveryDetailReport")
    public void exportDeliveryDetailReport(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException {
        //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字
        DownExcel.download(response, DeliveryDetailDTO.class, deliveryService.exportDeliveryDetailReport(dates),"orderReport");
    }
    @ApiOperation("发货明细产品分类报表")
    @PostMapping("/exportDeliveryDetailProductReport")
    public void exportDeliveryDetailProductReport(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException {
        //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字
        DownExcel.download(response, DeliveryDetailProductDTO.class, deliveryService.exportDeliveryDetailProductReport(dates),"orderReport");
    }
    @ApiOperation("发货单打印计数")
    @PostMapping ("/updateDeliveryPrintNumber/{deliveryId}")
    public Result updateDeliveryPrintNumber(@PathVariable String deliveryId)  {
        return  Result.seccess(deliveryService.updateDeliveryPrintNumber(deliveryId));
    }