From 1f27afeb9a001ef9df74011ab4ab2a64a3f2c5db Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Mon, 12 Apr 2021 14:44:39 +0800
Subject: [PATCH] Merge branch 'score_shop' of http://120.27.238.55:7000/r/beauty-erp into score_shop

---
 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html            |    3 
 zq-erp/src/main/resources/templates/views/common/login.html                              |    7 
 zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java                      |    6 +
 zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html     |    3 
 zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java                  |   22 ++++
 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html                |    5 +
 zq-erp/pom.xml                                                                           |    2 
 zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml                          |   20 ++--
 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java         |    2 
 zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html         |    4 
 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form.html          |   13 +-
 zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java       |   18 +++
 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java              |   11 +-
 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html |    3 
 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java         |    4 
 zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml                     |   24 ++++
 zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java                               |    6 +
 zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java               |    8 +
 zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml                            |   96 ++++++++++++++-----
 zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java                |    7 
 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html       |    4 
 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDao.xml                        |    2 
 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java                     |    2 
 23 files changed, 210 insertions(+), 62 deletions(-)

diff --git a/zq-erp/pom.xml b/zq-erp/pom.xml
index f11f7a0..dacc6f8 100644
--- a/zq-erp/pom.xml
+++ b/zq-erp/pom.xml
@@ -394,7 +394,7 @@
                     <exclude>config/test/*</exclude>
                     <exclude>config/xcx/*</exclude>
 
-                    <!---->
+                    <!-- -->
                     <exclude>config/config.json</exclude>
                     <exclude>config/application.properties</exclude>
                     <exclude>config/system.properties</exclude>
diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java
index 71d838c..3cdc992 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiStatisticsAction.java
@@ -154,6 +154,10 @@
                             return tjVipSumDao.selectProjConsumeCnt(timeSpaceParam, shopId, null);
                         case "20" :
                             return tjVipSumDao.selectTimeLength(timeSpaceParam, shopId, null);
+                        case "21" :
+                            return tjVipSumDao.selectCardAmount(timeSpaceParam, shopId, null);
+                        case "22" :
+                            return tjVipSumDao.selectFreeAmount(timeSpaceParam, shopId, null);
                         default :
                             return tjVipSumDao.selectBusinessInCome(timeSpaceParam, shopId, null);
                     }
@@ -205,6 +209,10 @@
                             return tjVipSumDao.selectProjConsumeCnt(timeSpaceParam, null, companyId);
                         case "20" :
                             return tjVipSumDao.selectTimeLength(timeSpaceParam, null, companyId);
+                        case "21" :
+                            return tjVipSumDao.selectCardAmount(timeSpaceParam, null, companyId);
+                        case "22" :
+                            return tjVipSumDao.selectFreeAmount(timeSpaceParam, null, companyId);
                         default :
                             return tjVipSumDao.selectBusinessInCome(timeSpaceParam, null, companyId);
                     }
diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java
index 714b2bf..5fae6d9 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java
@@ -40,6 +40,12 @@
     @ApiModelProperty(value = "卡项业绩")
     private BigDecimal cardAchieve;
 
+    @ApiModelProperty(value = "储值卡本金扣款")
+    private BigDecimal cardAmount;
+
+    @ApiModelProperty(value = "储值卡增金扣款")
+    private BigDecimal cardFreeAmount;
+
     @ApiModelProperty(value = "退款")
     private BigDecimal refund;
 
@@ -297,4 +303,20 @@
     public void setTimeLength(BigDecimal timeLength) {
         this.timeLength = timeLength;
     }
+
+    public BigDecimal getCardAmount() {
+        return cardAmount;
+    }
+
+    public void setCardAmount(BigDecimal cardAmount) {
+        this.cardAmount = cardAmount;
+    }
+
+    public BigDecimal getCardFreeAmount() {
+        return cardFreeAmount;
+    }
+
+    public void setCardFreeAmount(BigDecimal cardFreeAmount) {
+        this.cardFreeAmount = cardFreeAmount;
+    }
 }
diff --git a/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java b/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java
index 7c53969..fcd90d7 100644
--- a/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java
+++ b/zq-erp/src/main/java/com/matrix/system/common/constance/AppConstance.java
@@ -573,9 +573,10 @@
     public static final String WAREHOUSE_MANAGE_STOCK = "WAREHOUSE_MANAGE_STOCK";
 
 
-
-
-
+    /**
+     * 家居产品销售是否生成消耗业绩
+     */
+    public static final String SHOP_MANAGE_JJCPAS_CONSUME = "shopManageJjcpasConsume";
 
 
 
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java
index 268665d..40331bd 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java
@@ -8,7 +8,10 @@
 import com.matrix.core.tools.StringUtils;
 import com.matrix.core.tools.WebUtil;
 import com.matrix.system.app.vo.UserAchieveVo;
+import com.matrix.system.common.bean.BusParameterSettings;
 import com.matrix.system.common.bean.SysUsers;
+import com.matrix.system.common.constance.AppConstance;
+import com.matrix.system.common.dao.BusParameterSettingsDao;
 import com.matrix.system.common.dao.SysUsersDao;
 import com.matrix.system.constance.Dictionary;
 import com.matrix.system.hive.bean.*;
@@ -233,8 +236,11 @@
 
     @Autowired
     ShoppingGoodsDao shoppingGoodsDao;
+    @Autowired
+    BusParameterSettingsDao busParameterSettingsDao;
 
     private void buildAchieve(SysOrder pageOrder, SysOrderItem orderItem, AchieveNew achieveNew) {
+        BusParameterSettings shopManageJjcpasConsume =null;
         if (Dictionary.ORDER_STATU_TK.equals(pageOrder.getStatu())) {
             achieveNew.setId(null);
             achieveNew.setProjPercentage(0 - achieveNew.getProjPercentage());
@@ -249,6 +255,18 @@
         } else {
             achieveNew.setDatatime(new Date());
         }
+        if(Dictionary.SHOPPING_GOODS_TYPE_JJCP.equals(orderItem.getShoppingGoods().getGoodType())){
+            if(shopManageJjcpasConsume==null){
+                shopManageJjcpasConsume = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.SHOP_MANAGE_JJCPAS_CONSUME, pageOrder.getCompanyId());
+            }
+            if(AppConstance.IS_Y.equals(shopManageJjcpasConsume.getParamValue())){
+                achieveNew.setHisConsume(achieveNew.getGoodsCash());
+            }
+
+        }
+
+
+
         achieveNew.setOrderType(Dictionary.ORDER_TYPE_SEAL);
         achieveNew.setOrderId(pageOrder.getId());
         achieveNew.setOrderItemId(orderItem.getId());
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java
index 647ead9..93362f4 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java
@@ -1352,6 +1352,7 @@
         orderItem.setPrice(czVo.getBjmoney());
         orderItem.setStatus(Dictionary.ORDER_STATU_YFK);
         orderItem.setAchieveList(czVo.getAchaeveList());
+        orderItem.setShoppingGoods(shoppingGoods);
         orderItemDao.insert(orderItem);
         List<SysOrderItem> items = new ArrayList<>();
         items.add(orderItem);
@@ -1372,9 +1373,12 @@
         moneyCardUseFlowDao.insert(moneyCardUseFlow);
 
         order.setFlows(czVo.getFlows());
+
         addOrderFlow(order);
+
         // 添加员工业绩
         achieveNewService.addAchaeveByOrder(order);
+
         return order;
 
     }
diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java
index 3677903..3f1d10e 100644
--- a/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java
+++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/dao/TjVipSumDao.java
@@ -81,6 +81,12 @@
 	// 服务时长
 	Map<String, BigDecimal> selectTimeLength(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId);
 
+	// 储值卡本金扣款
+	Map<String, BigDecimal> selectCardAmount(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId);
+
+	// 储值卡赠金扣款
+	Map<String, BigDecimal> selectFreeAmount(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("shopId") Long shopId, @Param("companyId") Long companyId);
+
 	List<VipAchieveDataShowVo> selectVipAchieveInPage(@Param("list") List<StatisticsTimeDaoParam> timeSpaceParam, @Param("userId") Long userId);
 
 	// 订单业绩
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java
index 658a70d..d1ad6a3 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java
@@ -249,7 +249,7 @@
     public AjaxResult getOrderStatusCount() {
         SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
         AjaxResult result = AjaxResult.buildSuccessInstance(
-                shopOrderDao.selectOrderStatusCount(sysVipInfo.getOpenId()));
+                shopOrderDao.selectOrderStatusCount(sysVipInfo.getId()));
         return result;
     }
 
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java
index c4c6da2..6466163 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java
@@ -4,11 +4,11 @@
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.matrix.component.redis.RedisUserLoginUtils;
 import com.matrix.component.tools.HttpCurlUtil;
-import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
 import com.matrix.core.pojo.AjaxResult;
 import com.matrix.core.tools.LogUtil;
 import com.matrix.core.tools.StringUtils;
 import com.matrix.core.web.BaseAction;
+import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao;
 import com.matrix.system.common.bean.BusParameterSettings;
 import com.matrix.system.common.dao.BusParameterSettingsDao;
 import com.matrix.system.common.interceptor.HostInterceptor;
@@ -68,8 +68,10 @@
     private MoneyCardUseDao moneyCardUseDao;
 
     @Autowired
-    private WeixinServiceUtil weixinServiceUtil;
+    ShopCouponRecordDao shopCouponRecordDao;
 
+    @Autowired
+    ActivitySignReceiveRecordDao activitySignReceiveRecordDao;
     @Value("${debug}")
     private String isDebug;
 
@@ -142,8 +144,7 @@
         return res;
     }
 
-    @Autowired
-    ShopCouponRecordDao shopCouponRecordDao;
+
 
     /**
      * 查询用户信息
@@ -157,7 +158,7 @@
         sysVipInfo.setBalance(moneyCardUseDao.selectVipCardTotalMoney(loginUser.getId()));
         AjaxResult res = new AjaxResult();
         res.putInMap("couponCount", shopCouponRecordDao.countUnuseCouponRecord(loginUser.getId()));
-        res.putInMap("prizeCount",0);
+        res.putInMap("prizeCount",activitySignReceiveRecordDao.getSignAwardReceiveCount(loginUser.getId(),loginUser.getCompanyId()));
         res.putInMap("userInfo", sysVipInfo);
         res.setStatus(AjaxResult.STATUS_SUCCESS);
         return res;
diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java
index 8688651..5d925ad 100644
--- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java
+++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java
@@ -70,7 +70,7 @@
 
 	public int selectShopOrderTotalByApplyId(@Param("applyId") Long applyId);
 
-	public List<Map<String,Object>>  selectOrderStatusCount(String openId);
+	public List<Map<String,Object>>  selectOrderStatusCount(Long userId);
 
 	public int batchUpdateOrderStatus(@Param("list") List<ShopOrder> list);
 
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
index 9fd47fb..4d98102 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
@@ -920,15 +920,13 @@
 	<select id="selectUserAchieveByTime" resultType="com.matrix.system.app.vo.UserAchieveVo">
 		select
 			sale_id id,
-			(select ifnull(sum(case b.pay_method when '现金' then goods_cash else 0 end),0)
+			(select ifnull(sum(case pay_method when '现金' then goods_cash else 0 end),0)
 				from achieve_new a
-				inner join sys_order_item b on a.order_item_id=b.ID
 			where a.beault_id=#{userId}
 			and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d'))
 			) orderCash,
-			(select ifnull(sum(case b.pay_method when '划扣' then goods_cash else 0 end),0)
+			(select ifnull(sum(case pay_method when '划扣' then goods_cash else 0 end),0)
 				from achieve_new a
-				inner join sys_order_item b on a.order_item_id=b.ID
 			where  a.beault_id=#{userId}
 			and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d'))
 			) cash,
@@ -1056,21 +1054,23 @@
 		select
 			b.shop_short_name name,
 			b.SHOP_IMAG photo,
-			sum(IFNULL(a.goods_cash,0)) amount
-		from achieve_new a
-		left join sys_shop_info b on a.shop_id=b.ID and shop_type!=1
+			sum(IFNULL(a.amount,0)) amount
+		from sys_order_flow a
+		inner join sys_order c on a.order_id=c.id and c.STATU != '已取消'
+		inner join sys_shop_info b on a.shop_id=b.id and shop_type!=1
 		<where>
+			a.pay_method not in ('储值卡', '欠款')
 			<if test="record.companyId != null">
 				and a.company_id=#{record.companyId}
 			</if>
 			<if test='record.t1 == "1" and record.datatime != null'>
-				and date_format(datatime, '%Y-%m-%d') = date_format(#{record.datatime}, '%Y-%m-%d')
+				and date_format(a.create_time, '%Y-%m-%d') = date_format(#{record.datatime}, '%Y-%m-%d')
 			</if>
 			<if test='record.t1 == "2" and record.datatime != null'>
-				and date_format(datatime, '%Y-%m') = date_format(#{record.datatime}, '%Y-%m')
+				and date_format(a.create_time, '%Y-%m') = date_format(#{record.datatime}, '%Y-%m')
 			</if>
 			<if test='record.t1 == "3" and record.datatime != null'>
-				and date_format(datatime, '%Y') = date_format(#{record.datatime}, '%Y')
+				and date_format(a.create_time, '%Y') = date_format(#{record.datatime}, '%Y')
 			</if>
 		</where>
 		group by a.shop_id
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml
index 2cfc1a1..ddb5b13 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml
@@ -636,7 +636,7 @@
                     )totalPay,
                 (select IFNULL(sum(a.amount),0) from sys_order_flow a
                     inner join sys_order b on a.order_id=b.id and b.statu!='已取消'
-                    where a.pay_method not in ('储值卡', '欠款') and a.flow_type != '退款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
+                    where a.pay_method not in ('储值卡', '欠款') and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
                     <if test="shopId != null">
                         and a.shop_id=#{shopId}
                     </if>
@@ -716,6 +716,28 @@
                         and a.company_id=#{companyId}
                     </if>
                 ) refund,
+                (select sum(IFNULL(amount, 0))
+                    from sys_order_flow a
+                    inner join sys_order b on a.order_id=b.id and b.STATU!='已取消'
+                    where a.pay_method='储值卡' and a.is_gift='N' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
+                    <if test="shopId != null">
+                        and a.shop_id=#{shopId}
+                    </if>
+                    <if test="companyId != null">
+                        and a.company_id=#{companyId}
+                    </if>
+                ) cardAmount,
+                (select sum(IFNULL(amount, 0))
+                    from sys_order_flow a
+                    inner join sys_order b on a.order_id=b.id and b.STATU!='已取消'
+                    where a.pay_method='储值卡' and a.is_gift='Y' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
+                    <if test="shopId != null">
+                        and a.shop_id=#{shopId}
+                    </if>
+                    <if test="companyId != null">
+                        and a.company_id=#{companyId}
+                    </if>
+                ) cardFreeAmount,
                 (select IFNULL(count(1),0) from sys_order
                     where STATU in ('已付款', '欠款') and orderType=1 and <![CDATA[ ORDER_TIME > #{item.beginTime} and ORDER_TIME < #{item.endTime} ]]>
                     <if test="shopId != null">
diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
index 7a46366..e020304 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/TjVipSumDao.xml
@@ -90,13 +90,14 @@
 		select
 		<foreach collection="list" index="index" item="item"   separator=","  >
 			(
-			select IFNULL(sum(amount),0) from sys_order_flow
-			where pay_method not in ('储值卡', '欠款') and flow_type != '退款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]>
+			select IFNULL(sum(a.amount),0) from sys_order_flow a
+			inner join sys_order b on a.order_id=b.id and b.statu!='已取消'
+			where a.pay_method not in ('储值卡', '欠款') and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
 			<if test="shopId != null">
-				and shop_id=#{shopId}
+				and a.shop_id=#{shopId}
 			</if>
 			<if test="companyId != null">
-				and company_id=#{companyId}
+				and a.company_id=#{companyId}
 			</if>
 			) as t${index}
 
@@ -126,13 +127,14 @@
 		select
 		<foreach collection="list" index="index" item="item"   separator=","  >
 			(
-			select IFNULL(sum(amount),0) from sys_order_flow
-			where pay_method = '欠款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]>
+			select IFNULL(sum(a.amount),0) from sys_order_flow a
+			inner join sys_order b on a.order_id=b.id and b.statu!='已取消'
+			where a.pay_method = '欠款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
 			<if test="shopId != null">
-				and shop_id=#{shopId}
+				and a.shop_id=#{shopId}
 			</if>
 			<if test="companyId != null">
-				and company_id=#{companyId}
+				and a.company_id=#{companyId}
 			</if>
 			) as t${index}
 
@@ -230,10 +232,10 @@
 		select
 		<foreach collection="list" index="index" item="item"   separator=","  >
 			(
-			select IFNULL(sum(zk_price),0) from sys_order_item a
+			select IFNULL(sum(zk_price*count),0) from sys_order_item a
 			inner join shopping_goods b on a.goods_id=b.id
-			inner join sys_order c on a.ORDER_ID=c.id
-			where b.good_type='家居产品' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
+			inner join sys_order c on a.ORDER_ID=c.id and c.statu!='已取消'
+			where b.good_type='家居产品' and <![CDATA[ c.pay_time > #{item.beginTime} and c.pay_time < #{item.endTime}]]>
 			<if test="shopId != null">
 				and c.shop_id=#{shopId}
 			</if>
@@ -249,10 +251,10 @@
 		select
 		<foreach collection="list" index="index" item="item"   separator=","  >
 			(
-			select IFNULL(sum(zk_price),0) from sys_order_item a
+			select IFNULL(sum(zk_price*count),0) from sys_order_item a
 			inner join shopping_goods b on a.goods_id=b.id
-			inner join sys_order c on a.ORDER_ID=c.id
-			where b.good_type!='家居产品' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
+			inner join sys_order c on a.ORDER_ID=c.id and c.statu!='已取消'
+			where b.good_type!='家居产品' and <![CDATA[ c.pay_time > #{item.beginTime} and c.pay_time < #{item.endTime}]]>
 			<if test="shopId != null">
 				and c.shop_id=#{shopId}
 			</if>
@@ -268,12 +270,14 @@
 		select
 		<foreach collection="list" index="index" item="item"   separator=","  >
 			(
-			select IFNULL(sum(amount),0) from sys_order_flow where flow_type = '还款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]>
+			select IFNULL(sum(a.amount),0) from sys_order_flow a
+			inner join sys_order b on a.order_id=b.id and b.statu!='已取消'
+			where a.flow_type = '还款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
 			<if test="shopId != null">
-				and shop_id=#{shopId}
+				and a.shop_id=#{shopId}
 			</if>
 			<if test="companyId != null">
-				and company_id=#{companyId}
+				and a.company_id=#{companyId}
 			</if>
 			) as t${index}
 		</foreach>
@@ -490,13 +494,14 @@
 		select
 		<foreach collection="list" index="index" item="item"   separator=","  >
 			(
-			select IFNULL(sum(amount),0) from sys_order_flow
-			where pay_method not in ('储值卡', '欠款') and flow_type = '退款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]>
+			select IFNULL(sum(a.amount),0) from sys_order_flow a
+			inner join sys_order b on a.order_id=b.id and b.statu!='已取消'
+			where a.pay_method not in ('储值卡', '欠款') and a.flow_type = '退款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
 			<if test="shopId != null">
-				and shop_id=#{shopId}
+				and a.shop_id=#{shopId}
 			</if>
 			<if test="companyId != null">
-				and company_id=#{companyId}
+				and a.company_id=#{companyId}
 			</if>
 			) as t${index}
 
@@ -509,13 +514,54 @@
 		select
 		<foreach collection="list" index="index" item="item"   separator=","  >
 			(
-			select IFNULL(sum(amount),0) from sys_order_flow
-			where pay_method in ('储值卡') and flow_type = '退款' and <![CDATA[ create_time > #{item.beginTime} and create_time < #{item.endTime}]]>
+			select IFNULL(sum(a.amount),0) from sys_order_flow a
+			inner join sys_order b on a.order_id=b.id and b.statu!='已取消'
+			where a.pay_method in ('储值卡') and a.flow_type = '退款' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
 			<if test="shopId != null">
-				and shop_id=#{shopId}
+				and a.shop_id=#{shopId}
 			</if>
 			<if test="companyId != null">
-				and company_id=#{companyId}
+				and a.company_id=#{companyId}
+			</if>
+			) as t${index}
+
+		</foreach>
+		from area where id=1
+	</select>
+
+	<select id="selectCardAmount" resultType="java.util.TreeMap">
+		select
+		<foreach collection="list" index="index" item="item"   separator=","  >
+			(
+			select IFNULL(sum(IFNULL(amount, 0)), 0)
+			from sys_order_flow a
+			inner join sys_order b on a.order_id=b.id and b.STATU!='已取消'
+			where a.pay_method='储值卡' and a.is_gift='N' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
+			<if test="shopId != null">
+				and a.shop_id=#{shopId}
+			</if>
+			<if test="companyId != null">
+				and a.company_id=#{companyId}
+			</if>
+			) as t${index}
+
+		</foreach>
+		from area where id=1
+	</select>
+
+	<select id="selectFreeAmount" resultType="java.util.TreeMap">
+		select
+		<foreach collection="list" index="index" item="item"   separator=","  >
+			(
+			select IFNULL(sum(IFNULL(amount, 0)), 0)
+			from sys_order_flow a
+			inner join sys_order b on a.order_id=b.id and b.STATU!='已取消'
+			where a.pay_method='储值卡' and a.is_gift='Y' and <![CDATA[ a.create_time > #{item.beginTime} and a.create_time < #{item.endTime}]]>
+			<if test="shopId != null">
+				and a.shop_id=#{shopId}
+			</if>
+			<if test="companyId != null">
+				and a.company_id=#{companyId}
 			</if>
 			) as t${index}
 
diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDao.xml
index c699faf..c584cfa 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderDao.xml
@@ -768,7 +768,7 @@
     <select id="selectOrderStatusCount"  resultType="java.util.HashMap"  >
 		select  count(order_status) as count , order_status as orderStatus
 		from shop_order
-		where user_id=#{openId}
+		where user_id=#{userId}
 		group by order_status
 	</select>
 
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html
index 1982dfd..0f3eb7d 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/order/orderXq-form.html
@@ -690,7 +690,9 @@
                     callback: function (data) {
                         _this.isRefund = false;
                         _this.dialogSettleVisible = false;
-                        _this.queryOrderDetailData(_this.data.oldOrderId);
+                        var param = {};
+                        param.id = _this.data.oldOrderId;
+                        _this.queryOrderDetailData(param);
                     }
                 });
 
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html
index e738a10..83c8a58 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sale-list.html
@@ -116,7 +116,8 @@
 		}
 
 		function zkAmountFormat(value, row, index) {
-			return row.shouldPay + row.refund - row.arrears - row.totalPay;
+			var result = row.shouldPay + row.refund - row.arrears - row.totalPay;
+			return result.toFixed(2);
 		}
 
 		function footCountTitle(data) {
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html
index 1d204ba..d3837fd 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html
@@ -253,7 +253,7 @@
 								goodsCash: 0,
 								achieveType : _this.achieveTypeList[0].value,
 								commission : 0,
-								isShare: false,
+								isShare: false
 							});
 						}
 					});
@@ -309,6 +309,7 @@
 						goodsCash: achieve.goodsCash,
 						achieveType: achieve.achieveType,
 						projPercentage: achieve.commission,
+						payMethod:"现金",
 					};
 					achaeveList.push(achieveNew);
 				})
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html
index c43d2ce..58db52c 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/orderXq-form.html
@@ -710,7 +710,9 @@
                     callback: function (data) {
                         _this.isRefund = false;
                         _this.dialogSettleVisible = false;
-                        _this.queryOrderDetailData(_this.data.oldOrderId);
+                        var param = {};
+                        param.id = _this.data.oldOrderId;
+                        _this.queryOrderDetailData(param);
                     }
                 });
 
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form.html
index f76a2a6..05fd426 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/pbxq-form.html
@@ -79,6 +79,11 @@
                                 width="400">
                         </el-table-column>
                         <el-table-column
+                                prop="projUse.source"
+                                label="来源"
+                                width="400">
+                        </el-table-column>
+                        <el-table-column
                                 :formatter="hkPrice"
                                 label="划扣金额"
                                 width="100">
@@ -172,11 +177,9 @@
                 MTools.closeForm();
             },
             serviceTime(row, column) {
-                console.log(column);
-                console.log(row);
-                // if (!column.bedState) {
-                //     return "-";
-                // }
+                  if (!row.beginTime) {
+                     return "-";
+                 }
                 var startTime = this.dateFormat(row.beginTime);
                 var endTime = this.dateFormat(row.endTime);
                 return startTime + " - " + endTime;
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html
index ce54cfa..cd511b3 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html
@@ -276,6 +276,11 @@
                                     </template>
                                 </el-table-column>
                                 <el-table-column
+                                        prop="source"
+                                        label="来源"
+                                        width="180">
+                                </el-table-column>
+                                <el-table-column
                                         prop="status"
                                         label="状态"
                                         width="180">
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html
index a9c2d1b..33f01ce 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sale-list.html
@@ -116,7 +116,8 @@
 		}
 
 		function zkAmountFormat(value, row, index) {
-			return row.shouldPay + row.refund - row.arrears - row.totalPay;
+			var result = row.shouldPay + row.refund - row.arrears - row.totalPay;
+			return result.toFixed(2);
 		}
 
 		function footCountTitle(data) {
diff --git a/zq-erp/src/main/resources/templates/views/common/login.html b/zq-erp/src/main/resources/templates/views/common/login.html
index 1d532e2..0e119c6 100644
--- a/zq-erp/src/main/resources/templates/views/common/login.html
+++ b/zq-erp/src/main/resources/templates/views/common/login.html
@@ -260,7 +260,7 @@
 
     </div>
     <div class="signup-footer" style="color: #4968bd;">
-        <div class="" style="font-size: 16px;">HIVE管理系统V2.2.0</div>
+        <div class="" style="font-size: 16px;">讯聪管理系统V2.2.0</div>
         <div class="">
 
             <p class="download-bar" style="font-size: 12px;"><strong>浏览器:</strong>Win7以上<a
@@ -312,7 +312,6 @@
         });
         loginQrCodeKey="loginQrCodeKey_" + MTools.randomStr();
         let qrInfo={webClientId:webClientId,loginQrCodeKey:loginQrCodeKey}
-        console.log(qrInfo);
         qrcode.makeCode(JSON.stringify(qrInfo));
         $('#qrCodeIcon canvas').show();
 
@@ -390,7 +389,7 @@
             //实现化WebSocket对象,指定要连接的服务器地址与端口  建立连接
             let  wsPath= getRootPath();
             var socketUrl=  wsPath.replace("http","ws")+ "/webSocketServer?userId="+webClientId;
-            console.log(socketUrl);
+
             if(socket!=null){
                 socket.close();
                 socket=null;
@@ -403,7 +402,7 @@
             };
             //获得消息事件
             socket.onmessage = function(msg) {
-                console.log(msg);
+
                 var serverMsg = JSON.parse(msg.data);
 
                 if(serverMsg.msgType==1){
diff --git a/zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java b/zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java
index a29c349..eccda8a 100644
--- a/zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java
+++ b/zq-erp/src/test/java/com/matrix/ParameterSettingsTool.java
@@ -68,6 +68,12 @@
 		newSetting3.setCategory("微信开发配置");
 		newSettings.add(newSetting3);
 
+		ParameterSettings newSetting4=new ParameterSettings();
+		newSetting4.setCode(AppConstance.SHOP_MANAGE_JJCPAS_CONSUME);
+		newSetting4.setName("家居产品销售是否生成消耗业绩");
+		newSetting4.setType(1);
+		newSetting4.setCategory("店务配置");
+		newSettings.add(newSetting4);
 
 
 

--
Gitblit v1.9.1