From d82642e04f2dd9f2dc04dd7196a1e83fcfc95913 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期二, 27 八月 2024 11:31:40 +0800
Subject: [PATCH] order status
---
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrderItem.java | 3 +++
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderSv.java | 2 +-
pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml | 4 ++--
pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml | 7 ++++++-
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrderItem.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrderItem.java
index 7fdae9b..8592795 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrderItem.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrderItem.java
@@ -37,6 +37,9 @@
@JSONField(serializeUsing= ObjectWriterImplToString.class)
public Long proId;
+ @TableField(exist = false)
+ public String proName;
+
/**
* 鐢熶骇鏁伴噺
*/
diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
index d97d985..363cc2f 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
@@ -11,6 +11,9 @@
<result property="number" column="number" jdbcType="INTEGER"/>
<result property="completeNumber" column="complete_number" jdbcType="INTEGER"/>
<result column="deleted" property="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler" />
+ <result property="proName" column="pro_id" jdbcType="VARCHAR"/>
+ <!-- <association property="proName" column="pro_id" javaType="java.lang.Long"
+ select="com.dy.pmsGlobal.daoPlt.PltProductMapper.selectProNameById" fetchType="eager"/>-->
</resultMap>
<sql id="Base_Column_List">
@@ -27,10 +30,12 @@
<select id="selectItems" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--绠楀嚭瀹屾垚鐜� Base_Column_List-->
SELECT aa.*, concat(round(((complete_number/number) * 100 ),2), '%') as complete_rate from (
- select oi.id,oi.order_id,oi.pro_id,oi.number, sum(IFNULL(pap.output_number,0)) as complete_number
+ select oi.id,oi.order_id,oi.pro_id,pp.`name`,oi.number, sum(IFNULL(pap.output_number,0)) as complete_number
from (SELECT * from pr_order_item where order_id = #{orderId,jdbcType=BIGINT} and deleted !=1 ) oi
LEFT JOIN pr_assembly_plan pap
ON oi.order_id = pap.order_id AND oi.pro_id = pap.pro_id
+ LEFT JOIN plt_product pp
+ ON oi.pro_id = pp.id
GROUP BY oi.id,oi.order_id,oi.pro_id,oi.number) aa
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
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 93c87e8..1bbba23 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrOrderMapper.xml
@@ -15,7 +15,7 @@
<result property="status" column="status" jdbcType="TINYINT"/>
<result property="creator" column="creator" jdbcType="VARCHAR"/>
<result property="dt" column="dt" jdbcType="TIMESTAMP"/>
- <result property="deleted" column="deleted" jdbcType="TINYINT"/>
+ <result column="deleted" property="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler" />
<result property="remark" column="remark" jdbcType="VARCHAR"/>
</resultMap>
<resultMap id="BaseResultMap2" type="com.dy.pmsGlobal.pojoPr.PrOrder" extends="BaseResultMap">
@@ -197,7 +197,7 @@
<if test="deliveryDate!= null and deliveryDate !=''">
delivery_date = #{deliveryDate,jdbcType=VARCHAR},
</if>
- <if test="status != null and status !=''">
+ <if test="status != null">
status = #{status,jdbcType=TINYINT},
</if>
<if test="creator != null and creator !=''">
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 228b8d5..2999306 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
@@ -48,7 +48,7 @@
throw new RuntimeException("璁㈠崟鍚嶇О涓嶈兘閲嶅");
}
extractedCheck(p);
- p.setDeleted(false);
+ p.deleted = false;
BaUser loginUser = userUtil.getUser(UserTokenContext.get());
if (loginUser != null) {
p.creator = loginUser.id;
--
Gitblit v1.8.0