From 745b115acbb46829eb52f904f0c276012decf938 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期二, 20 八月 2024 10:53:35 +0800
Subject: [PATCH] order manage
---
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrderItem.java | 4 ++++
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderSv.java | 8 ++++++++
pms-parent/pms-web-product/src/main/java/com/dy/pmsProduct/order/OrderCtrl.java | 2 --
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrder.java | 7 ++++---
pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml | 31 +++++++++++++++++++++++++++++++
5 files changed, 47 insertions(+), 5 deletions(-)
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrder.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrder.java
index bee749a..5bb8369 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrder.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/pojoPr/PrOrder.java
@@ -59,9 +59,10 @@
*/
public Integer status;
/**
- * 鍒涘缓浜�
- */
- public String creator;
+ * 鍒涘缓浜�
+ */
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ public Long creator;
/**
* 鍒涘缓鏃堕棿
*/
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 775227c..7fdae9b 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
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.annotation.JSONField;
import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
+import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dy.common.po.BaseEntity;
import jakarta.validation.constraints.NotBlank;
@@ -48,4 +49,7 @@
@JSONField(serialize = false)
public Boolean deleted;
+ @TableField(exist = false)
+ public String completeRate;
+
}
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 0332664..a3ca0de 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrOrderItemMapper.xml
@@ -83,4 +83,35 @@
</set>
where id = #{id,jdbcType=BIGINT}
</update>
+ <delete id="deleteLogicById">
+ update pr_order_item set deleted = 1 where id = #{id}
+ </delete>
+ <select id="selectSome" resultMap="BaseResultMap">
+ select
+ <include refid="Base_Column_List" />
+ from pr_order_item p
+ where p.deleted!=1
+ <trim prefix="and " suffixOverrides="and">
+ <if test="orderId != null and orderId != ''">
+ p.orderId = #{orderId,jdbcType=BIGINT} and
+ </if>
+ </trim>
+ order by id desc
+ <trim prefix="limit " >
+ <if test="start != null and count != null">
+ #{start}, #{count}
+ </if>
+ </trim>
+ </select>
+
+ <select id="selectSomeCount" resultType="java.lang.Long">
+ select count(1)
+ from pr_order_item p
+ where p.deleted!=1
+ <trim prefix="and " suffixOverrides="and">
+ <if test="orderId != null and orderId != ''">
+ p.orderId = #{orderId,jdbcType=BIGINT} and
+ </if>
+ </trim>
+ </select>
</mapper>
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 9d88d07..ef2a603 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
@@ -31,8 +31,6 @@
@SsoPowerAop(power = "10200001")
@Log("淇濆瓨璁㈠崟淇℃伅")
public BaseResponse<Boolean> save(@RequestBody @Valid PrOrder order){
- order.id = null;
- order.setDeleted(false);
int count = sv.save(order);
if (count <= 0) {
return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
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 85eb20b..d0140b4 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
@@ -1,10 +1,12 @@
package com.dy.pmsProduct.order;
import cn.hutool.core.codec.Base64;
+import com.dy.common.webFilter.UserTokenContext;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.daoOth.OthFileMapper;
import com.dy.pmsGlobal.daoPr.*;
import com.dy.pmsGlobal.dyFile.FileOperate;
+import com.dy.pmsGlobal.pojoBa.BaUser;
import com.dy.pmsGlobal.pojoPlt.PltProduct;
import com.dy.pmsGlobal.pojoPr.*;
import com.dy.pmsGlobal.util.UserUtil;
@@ -57,10 +59,16 @@
@Transactional
public int save(PrOrder p) {
+ p.id = null;
//鍒ゆ柇浜у搧涓嶈兘閲嶅悕
if (orderDao.exists(p.name, p.id)) {
throw new RuntimeException("璁㈠崟鍚嶇О涓嶈兘閲嶅");
}
+ p.setDeleted(false);
+ BaUser loginUser = userUtil.getUser(UserTokenContext.get());
+ if(loginUser!=null){
+ p.creator = loginUser.id;
+ }
int count = orderDao.insertSelective(p);
saveOrderItems(p);
return count;
--
Gitblit v1.8.0