From 2757ea108a2e870a72978f9957c8454af605176c Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期一, 26 八月 2024 09:05:16 +0800
Subject: [PATCH] order status
---
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderSv.java | 24 ++++++++++++------------
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderCtrl.java | 2 +-
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderStatusEnum.java | 23 +++++++++++++++++++++++
3 files changed, 36 insertions(+), 13 deletions(-)
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 199160f..8751f27 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
@@ -122,7 +122,7 @@
@SsoPowerAop(power = "10200001")
@Log("鏇存柊璁㈠崟鐘舵��")
public BaseResponse<Boolean> updateStatus(@RequestBody PrOrder order) {
- int count = 0; //sv.updateStatus(plan);
+ int count = sv.updateStatus(order);
if (count <= 0) {
return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
} else {
diff --git a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderStatusEnum.java b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderStatusEnum.java
new file mode 100644
index 0000000..3781ec8
--- /dev/null
+++ b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderStatusEnum.java
@@ -0,0 +1,23 @@
+package com.dy.pmsProduct.order;
+
+public enum OrderStatusEnum {
+ //鏋氫妇, 鐘舵��:姝e父(1) 鏆傚仠(0) 缁撴潫(-1)
+ NORMAL(1,"姝e父"),
+ PAUSE(0,"鏆傚仠"),
+ END(-1,"缁撴潫");
+ private int code;
+ private String name;
+
+ OrderStatusEnum(int code, String name) {
+ this.code = code;
+ this.name = name;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
diff --git a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderSv.java b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderSv.java
index 3cf6817..f058cf1 100644
--- a/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderSv.java
+++ b/pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderSv.java
@@ -156,23 +156,23 @@
}
/**
* 鍙洿鏂扮姸鎬�,涓嶆洿鏂板叾浠栧瓧娈�
- * @param plan
+ * @param order
* 鏇存柊鐘舵�� 濡傛灉鏈夊湪鎵ц涓殑浠诲姟,涓嶈鏆傚仠
* @return
*/
- /* @Transactional
- public int updateStatus(PrOrder plan) {
- if(plan.status == PlanStatusEnum.NORMAL.getCode()){
- PrAssemblyPlan assemblyPlan = assemblyDao.selectByPrimaryKey(plan.id);
- assemblyPlan.status = plan.status;
- extractedCheck(assemblyPlan);
+ @Transactional
+ public int updateStatus(PrOrder order) {
+ if(order.status == OrderStatusEnum.NORMAL.getCode()){
+ PrOrder prOrder = orderDao.selectByPrimaryKey(order.id);
+ prOrder.status = order.status;
+ //extractedCheck(prOrder);
}
- PrAssemblyPlan param = new PrAssemblyPlan();
- param.id =plan.id;
- param.status = plan.status;
- return assemblyDao.updateByPrimaryKeySelective(param);
+ PrOrder param = new PrOrder();
+ param.id =order.id;
+ param.status = order.status;
+ return orderDao.updateByPrimaryKeySelective(param);
}
- private void extractedCheck(PrAssemblyPlan plan) {
+ /*private void extractedCheck(PrOrder order) {
PrProductionProcess process = processDao.selectByPrimaryKey(plan.processId);
if(process == null || !process.proId.equals(plan.proId)){
throw new RuntimeException("浜у搧涓庣敓浜ф祦绋嬩笉鍖归厤");
--
Gitblit v1.8.0