chenlu
2025-04-08 aa7bcbc678a671a51a87c7ba6bbfaa107399a96d
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;
@@ -97,8 +104,36 @@
    @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));
    }