From 25df7f3b2bcfd66c7f5284348495d8caec8e9839 Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Sat, 08 May 2021 22:39:07 +0800
Subject: [PATCH] 修改收银页面小数点bug

---
 zq-erp/src/test/java/com/matrix/四月份家居产品业绩恢复.java                                 |   61 ++++++++++++++++++++++++++++++
 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html |    2 
 zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java             |    2 +
 zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml                |    7 +++
 4 files changed, 71 insertions(+), 1 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java
index 5446b22..1abccec 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysOrderItemDao.java
@@ -64,4 +64,6 @@
 	List<OrderDetailItemVo> selectApiOrderDetailItemsByOrderId(@Param("orderId") Long orderId);
 
     List<ErpOrderDetailItemVo> selectErpOrderItemByOrderId(String orderId);
+
+	List<SysOrderItem> selectDgd();
 }
\ No newline at end of file
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml
index 846e27b..6c658ad 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml
@@ -557,4 +557,11 @@
         where a.ORDER_ID=#{orderId}
     </select>
 
+    <!-- 临时数据处理sql -->
+    <select id="selectDgd" resultMap="SysOrderItemMap">
+        SELECT a.* from sys_order_item a
+                            left join sys_order b on a.ORDER_ID=b.id
+        where a.type='家居产品' and DATE_FORMAT(a.create_time,'%Y-%m')='2021-04' and b.company_id=17 and b.STATU='已付款';
+    </select>
+
 </mapper>
\ No newline at end of file
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html
index 63f1f78..ee2103f 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/order-form.html
@@ -947,7 +947,7 @@
 
                                 // if (optionType != 1) {
                                     //直接修改支付金额不重置支付金额
-                                    item.payMoney = zkPrice * count;
+                                    item.payMoney = (zkPrice * count).toFixed(2);
                                 // }
                                 _this.order.payMoney += parseFloat(item.payMoney);
 
diff --git "a/zq-erp/src/test/java/com/matrix/\345\233\233\346\234\210\344\273\275\345\256\266\345\261\205\344\272\247\345\223\201\344\270\232\347\273\251\346\201\242\345\244\215.java" "b/zq-erp/src/test/java/com/matrix/\345\233\233\346\234\210\344\273\275\345\256\266\345\261\205\344\272\247\345\223\201\344\270\232\347\273\251\346\201\242\345\244\215.java"
new file mode 100644
index 0000000..4b1f86b
--- /dev/null
+++ "b/zq-erp/src/test/java/com/matrix/\345\233\233\346\234\210\344\273\275\345\256\266\345\261\205\344\272\247\345\223\201\344\270\232\347\273\251\346\201\242\345\244\215.java"
@@ -0,0 +1,61 @@
+package com.matrix;
+
+import com.matrix.system.hive.bean.AchieveNew;
+import com.matrix.system.hive.bean.SysOrderItem;
+import com.matrix.system.hive.dao.AchieveNewDao;
+import com.matrix.system.hive.dao.SysOrderDao;
+import com.matrix.system.hive.dao.SysOrderItemDao;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.List;
+
+/**
+ * 测试类示例
+ *
+ * @author jiangyouyao
+ * @email 512061637@qq.com
+ * @date 2019年2月25日
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = {ZqErpApplication.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+public class 四月份家居产品业绩恢复 {
+
+    @Autowired
+    SysOrderDao sysOrderDao;
+
+    @Autowired
+    SysOrderItemDao itemDao;
+
+    @Autowired
+    AchieveNewDao achieveNewDao;
+
+
+    @Test
+    public void recoverAchieve() {
+
+        AchieveNew queryAchieve=new AchieveNew();
+        List<SysOrderItem> items = itemDao.selectDgd();
+        for (SysOrderItem item :
+                items) {
+            if(item.getType().equals("家居产品")){
+                queryAchieve.setOrderItemId(item.getId());
+                List<AchieveNew> achieveNews = achieveNewDao.selectByModel(queryAchieve);
+                for (AchieveNew achieve :
+                        achieveNews) {
+                    if(achieve.getHisConsume()==null){
+                        achieve.setHisConsume(achieve.getGoodsCash());
+                        achieveNewDao.updateByModel(achieve);
+                        System.out.println("更新业绩"+achieve.getId());
+                    }
+                }
+            }
+        }
+
+    }
+
+
+}

--
Gitblit v1.9.1