From d8c8530752a3f19f082560f767b04471b2dd1085 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期三, 21 八月 2024 14:20:06 +0800
Subject: [PATCH] get product by orderId
---
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java | 2 ++
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java | 4 +++-
pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java | 11 +++++++++++
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderCtrl.java | 13 +++++++++++++
pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml | 1 -
pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml | 7 +++++++
6 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java
index 40a34b3..8218e39 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/daoPlt/PltProductMapper.java
@@ -23,6 +23,8 @@
List<PltProduct> selectAll(Map<String, Object> params);
+ List<PltProduct> selectByOrderId(@Param("orderId") Long orderId);
+
String selectMaxCode();
boolean exists(@Param("name") String name, @Param("id") Long id);
diff --git a/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
index af0c699..2dd7d75 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PltProductMapper.xml
@@ -192,6 +192,13 @@
</trim>
order by id desc
</select>
+ <select id="selectByOrderId" resultType="com.dy.pmsGlobal.pojoPlt.PltProduct">
+ SELECT p.* FROM
+ (select * from pr_order_item WHERE deleted!=1 AND order_id = #{orderId,jdbcType=BIGINT}) poi,
+ (select * from plt_product where deleted!=1) p
+ WHERE poi.pro_id = p.id
+ order by id desc
+ </select>
<select id="selectMaxCode" resultType="java.lang.String">
select max(code) from plt_product
</select>
diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml
index 5b96976..771f6fa 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml
@@ -135,7 +135,6 @@
</trim>
order by id desc
</select>
-
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from pr_order
where id = #{id,jdbcType=BIGINT}
diff --git a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java
index 8ba3968..e09023d 100644
--- a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java
+++ b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductCtrl.java
@@ -131,6 +131,17 @@
QueryVo vo = new QueryVo();
return BaseResponseUtils.buildSuccess(proSv.selectAll(vo));
}
+ /**
+ * 鍙牴鎹畂rderId鏌ヨ浜у搧
+ * @return
+ */
+ @GetMapping(path="selectByOrderId")
+ @SsoPowerAop(power = "10300000")
+ @Log("鍙牴鎹畂rderId鏌ヨ浜у搧")
+ public BaseResponse<List<PltProduct>> selectByOrderId(Long orderId){
+ return BaseResponseUtils.buildSuccess(proSv.selectByOrderId(orderId));
+ }
+
@PostMapping(path="export")
@SsoPowerAop(power = "10300001")
diff --git a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java
index 35e7675..d2e57f8 100644
--- a/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java
+++ b/pms-parent/pms-web-platform/src/main/java/com/dy/pmsPlatform/product/ProductSv.java
@@ -248,7 +248,9 @@
Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
return dao.selectAll(params);
}
-
+ public List<PltProduct> selectByOrderId(Long orderId) {
+ return dao.selectByOrderId(orderId);
+ }
// public void downloadDoc(HttpServletResponse response) {
// PltProduct pro=dao.selectByPrimaryKey(Long.valueOf(1));
diff --git a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderCtrl.java b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderCtrl.java
index ef2a603..3bd5971 100644
--- a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderCtrl.java
+++ b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderCtrl.java
@@ -5,6 +5,7 @@
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.aop.Log;
+import com.dy.pmsGlobal.pojoPlt.PltProduct;
import com.dy.pmsGlobal.pojoPr.PrAssemblyPlan;
import com.dy.pmsGlobal.pojoPr.PrOrder;
import com.dy.pmsProduct.order.QueryVo;
@@ -98,6 +99,18 @@
return BaseResponseUtils.buildSuccess(list);
}
+ /**
+ * 鏌ヨ鎵�鏈夎鍗�
+ * @return
+ */
+ @GetMapping(path="all")
+ @SsoPowerAop(power = "10300000")
+ @Log("鏌ヨ鎵�鏈変骇鍝�")
+ public BaseResponse<List<PrOrder>> all(){
+ QueryVo vo = new QueryVo();
+ return BaseResponseUtils.buildSuccess(sv.selectAll(vo));
+ }
+
@PostMapping(path="updateStatus")
@SsoPowerAop(power = "10200001")
@Log("鏇存柊浠诲姟璁″垝鐘舵��")
--
Gitblit v1.8.0