From 7be9b534dcd5cbdb8c24c908d1a738aeec6f52a9 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期五, 04 十月 2024 16:18:35 +0800
Subject: [PATCH] 添加工程打印明细
---
north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java | 71 ++++++++++++++++++++++++-----------
1 files changed, 48 insertions(+), 23 deletions(-)
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java b/north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java
index 05ba080..1aee90c 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java
+++ b/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,47 +85,57 @@
@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){
+ public Result getSelectDeliveryPrinting( @RequestBody DeliveryDetail deliveryDetail) throws IllegalAccessException {
return Result.seccess(deliveryService.getSelectDeliveryPrinting(deliveryDetail));
}
+ @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));
+ }
+
--
Gitblit v1.8.0