From bc4420f7a0ba1d243abcbea44b2203e2f6c6bc11 Mon Sep 17 00:00:00 2001
From: 935090232@qq.com <ak473600000>
Date: Thu, 17 Feb 2022 22:35:44 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/score_shop' into score_shop

---
 zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html                      |    5 
 zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html                     |   16 +
 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-item.html |    5 
 zq-erp/pom.xml                                                                                 |    4 
 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/jyls.html                  |    5 
 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html          |    2 
 zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml                      |   68 +++++++++
 zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-item.html     |    5 
 zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java                   |    5 
 zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html                        |   13 +
 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yyServiceAddForm.html         |    2 
 zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml                              |   11 
 zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderStatisticsAction.java              |    4 
 zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoOrderAction.java                  |   54 +++++++
 zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderFlowAction.java                    |    3 
 zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java           |    7 
 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderBasicVo.java                 |    3 
 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenxiaoOrderListExportVo.java                |   40 +++++
 zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java                |    3 
 zq-erp/src/main/java/com/matrix/system/hive/vo/OrderFlowVo.java                                |  108 +--------------
 zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html                  |    2 
 21 files changed, 236 insertions(+), 129 deletions(-)

diff --git a/zq-erp/pom.xml b/zq-erp/pom.xml
index b23716b..e2607e6 100644
--- a/zq-erp/pom.xml
+++ b/zq-erp/pom.xml
@@ -413,11 +413,11 @@
                     <exclude>config/xcx/*</exclude>
                     <exclude>config/xcshop/*</exclude>
 
-                    <!--
+                    <!---->
                     <exclude>config/config.json</exclude>
                     <exclude>config/application.properties</exclude>
                     <exclude>config/system.properties</exclude>
-                    -->
+
 
 
                     <exclude>**/*.woff</exclude>
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoOrderAction.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoOrderAction.java
index 5c511b7..8c147d5 100644
--- a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoOrderAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoOrderAction.java
@@ -1,19 +1,33 @@
 package com.matrix.system.fenxiao.action;
 
 import com.matrix.core.pojo.AjaxResult;
+import com.matrix.core.tools.DateUtil;
+import com.matrix.core.tools.excl.ExcelSheetPO;
+import com.matrix.core.tools.excl.ExcelUtil;
+import com.matrix.core.tools.excl.ExcelVersion;
+import com.matrix.system.common.tools.ResponseHeadUtil;
 import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderBasicDto;
 import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto;
 import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto;
 import com.matrix.system.fenxiao.dto.UpdateSetOrderDoneDto;
 import com.matrix.system.fenxiao.service.ShopSalesmanOrderService;
+import com.matrix.system.fenxiao.vo.FenxiaoOrderListExportVo;
 import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo;
 import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo;
 import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo;
+import com.matrix.system.hive.bean.SysProjServices;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiResponse;
 import io.swagger.annotations.ApiResponses;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
 
 @RestController
 @RequestMapping(value = "/fenXiao/fenXiaoOrder")
@@ -70,7 +84,45 @@
     AjaxResult loadSetOrderList(@RequestBody LoadSetOrderListDtoDto loadSetOrderListDto) {
     	return shopSalesmanOrderService.loadSetOrderList(loadSetOrderListDto);
     }
-    
+
+    @RequestMapping(value = "/exportExcel")
+    public void exportExcel(HttpServletResponse response, LoadFenxiaoOrderListDto loadFenxiaoOrderListDto) throws IOException {
+        List<ExcelSheetPO> res = new ArrayList<>();
+        ExcelSheetPO orderSheet = new ExcelSheetPO();
+        String title = "分销订单明细";
+        orderSheet.setSheetName(title);
+        orderSheet.setTitle(title);
+        String[] header = {"订单编号","实付金额(元)", "订单状态", "下单门店","客户", "推广员","收益类型","收益金额", "结算状态", "结算编号", "结算时间", "结算人"};
+        orderSheet.setHeaders(header);
+
+        List<FenxiaoOrderListExportVo> dataList = shopSalesmanOrderService.findFenxiaoOrderList(loadFenxiaoOrderListDto);
+        List<List<Object>> list = new ArrayList<>();
+        if (dataList.size() > 0) {
+            for (FenxiaoOrderListExportVo item : dataList) {
+                List<Object> temp = new ArrayList<>();
+                temp.add(item.getOrderNo());
+                temp.add(item.getActualBalance());
+                temp.add(item.getOrderState());
+                temp.add(item.getAddress());
+                temp.add(item.getCustom());
+                temp.add(item.getParentSale());
+                temp.add(item.getProfitType());
+                temp.add(item.getProfitBalance());
+                temp.add(item.getSettleType());
+                temp.add(item.getSettleNo());
+                temp.add(DateUtil.dateToString(item.getSettleTime(), DateUtil.DATE_FORMAT_MM));
+                temp.add(item.getSettler());
+                list.add(temp);
+            }
+        }
+        orderSheet.setDataList(list);
+        res.add(orderSheet);
+        response = ResponseHeadUtil.setExcelHead(response);
+        response.setHeader("Content-Disposition",
+                "attachment;filename=" + URLEncoder.encode(title + DateUtil.getTimeMark() + ".xlsx".trim(), "UTF-8"));
+        OutputStream os = response.getOutputStream();
+        ExcelUtil.createWorkbookAtOutStream(ExcelVersion.V2007, res, os, true);
+    }
     
     
     
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java
index c5b69cb..7adcc35 100644
--- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanOrderDao.java
@@ -6,12 +6,15 @@
 import com.matrix.system.fenxiao.dto.LoadFenxiaoOrderListDto;
 import com.matrix.system.fenxiao.dto.LoadSetOrderListDtoDto;
 import com.matrix.system.fenxiao.entity.ShopSalesmanOrder;
+import com.matrix.system.fenxiao.vo.FenxiaoOrderListExportVo;
 import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderBasicVo;
 import com.matrix.system.fenxiao.vo.LoadFenxiaoOrderListVo;
 import com.matrix.system.fenxiao.vo.LoadSetOrderListDtoVo;
 import com.matrix.system.shopXcx.api.dto.SaleOrderDto;
 import com.matrix.system.shopXcx.vo.SalesOrderVo;
 import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * @description 分销订单
@@ -36,4 +39,6 @@
 	IPage<LoadSetOrderListDtoVo> findSetOrderList(Page<LoadSetOrderListDtoVo> page,
 			@Param("record")LoadSetOrderListDtoDto loadSetOrderListDto);
 
+	List<FenxiaoOrderListExportVo> selectFenxiaoOrderListNoPage(@Param("record")LoadFenxiaoOrderListDto loadFenxiaoOrderListDto);
+
 }
\ No newline at end of file
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java
index 55c708d..39a251d 100644
--- a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java
@@ -6,6 +6,7 @@
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.matrix.system.fenxiao.vo.FenxiaoOrderListExportVo;
 import com.matrix.system.hive.bean.SysVipInfo;
 import com.matrix.system.hive.dao.SysVipInfoDao;
 import com.matrix.core.constance.MatrixConstance;
@@ -179,7 +180,9 @@
 	}
 
 
+	public List<FenxiaoOrderListExportVo> findFenxiaoOrderList(LoadFenxiaoOrderListDto loadFenxiaoOrderListDto) {
+		QueryUtil.setQueryLimitCom(loadFenxiaoOrderListDto);
+		return  shopSalesmanOrderDao.selectFenxiaoOrderListNoPage(loadFenxiaoOrderListDto);
+	}
 
-
-  
 }
\ No newline at end of file
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenxiaoOrderListExportVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenxiaoOrderListExportVo.java
new file mode 100644
index 0000000..a72bc01
--- /dev/null
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/FenxiaoOrderListExportVo.java
@@ -0,0 +1,40 @@
+package com.matrix.system.fenxiao.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class FenxiaoOrderListExportVo {
+
+    @ApiModelProperty(value = "订单编号")
+    private String orderNo;
+    @ApiModelProperty(value = "订单状态")
+    private String orderState;
+    @ApiModelProperty(value = "实付金额(元)")
+    private BigDecimal actualBalance;
+    @ApiModelProperty(value = "下单门店")
+    private String address;
+    @ApiModelProperty(value = "客户")
+    private String custom;
+    @ApiModelProperty(value = "客户openId")
+    private String customUserId;
+    @ApiModelProperty(value = "推广员")
+    private String parentSale;
+    @ApiModelProperty(value = "收益类型")
+    private String profitType;
+    @ApiModelProperty(value = "收益金额")
+    private BigDecimal profitBalance;
+    @ApiModelProperty(value = "结算状态")
+    private String settleType;
+    @ApiModelProperty(value = "结算编号")
+    private String settleNo;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @ApiModelProperty(value = "结算时间")
+    private Date settleTime;
+    @ApiModelProperty(value = "结算人")
+    private String settler;
+}
diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderBasicVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderBasicVo.java
index c2ac378..596c689 100644
--- a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderBasicVo.java
+++ b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/LoadFenxiaoOrderBasicVo.java
@@ -17,4 +17,7 @@
 	@ApiModelProperty(value = "待结算订单")
 	private Integer waitOrderNum;
 
+	@ApiModelProperty(value = "订单金额")
+	private BigDecimal orderBalance;
+
 }
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java
index ce3fe59..e2c5007 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java
@@ -411,7 +411,7 @@
         String title = "商品资料";
         orderSheet.setSheetName(title);
         orderSheet.setTitle(title);
-        String[] header = {"商品名称", "商品编号", "售价/(本金)", "参考价/(赠送金额)", "真实销量", "状态", "是否赠送", "类型", "分类", "是否固定套餐", "产品归属"};
+        String[] header = {"商品名称", "商品编号", "售价/(本金)", "参考价/(赠送金额)", "真实销量", "状态", "是否赠送", "类型", "分类", "是否固定套餐", "产品归属","时长"};
         orderSheet.setHeaders(header);
         List<ShoppingGoods> dataList = shoppingGoodsService.findAll(shoppingGoods);
         List<List<Object>> list = new ArrayList<>();
@@ -429,6 +429,7 @@
                 temp.add(item.getCateName());
                 temp.add(item.getIsCourse());
                 temp.add(item.getHeadquarters() == 1 ? "总部产品" : "本店产品");
+                temp.add(item.getTimeLength());
                 list.add(temp);
             }
         }
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderFlowAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderFlowAction.java
index a3ad197..c77023d 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderFlowAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderFlowAction.java
@@ -107,7 +107,7 @@
         orderSheet.setSheetName("交易流水");
         orderSheet.setTitle("交易流水");
         String[] header = new String[]{"订单编号", "交易内容", "交易时间", "交易类型", "交易金额", "会员姓名",
-                "支付方式", "支付流水号", "操作人",  "门店名称"};
+                "支付方式","储值卡名称", "支付流水号", "操作人",  "门店名称"};
         orderSheet.setHeaders(header);
         List<List<Object>> body = new ArrayList<>();
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
@@ -120,6 +120,7 @@
                 bodyItem.add(flowVo.getAmount());
                 bodyItem.add(flowVo.getVipName());
                 bodyItem.add(flowVo.getPayMethod());
+                bodyItem.add(flowVo.getCardName());
                 bodyItem.add(flowVo.getFlowNo());
                 bodyItem.add(flowVo.getStaffName());
                 bodyItem.add(flowVo.getShopName());
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderStatisticsAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderStatisticsAction.java
index 317206f..5439672 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderStatisticsAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/OrderStatisticsAction.java
@@ -53,8 +53,8 @@
     public void exportShowList(@RequestParam Map<String, Object> param, HttpServletResponse response) throws Exception {
         SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
         String title = "产品销售明细统计";
-        String[] header = {"门店", "销售日期", "订单号", "商品名称", "分类", "客户名", "购买数量", "单价", "健康顾问", "支付方式", "状态"};
-        String[] column = {"SHOP_NAME", "pay_time", "ORDER_NO", "goodsName", "cateName", "VIP_NAME", "COUNT", "ZK_PRICE", "su_name", "pay_method", "status"};
+        String[] header = {"门店", "销售日期", "订单号", "商品名称", "分类", "客户名", "购买数量", "单价","小计", "健康顾问", "支付方式", "状态"};
+        String[] column = {"SHOP_NAME", "pay_time", "ORDER_NO", "goodsName", "cateName", "VIP_NAME", "COUNT", "ZK_PRICE", "total","su_name", "pay_method", "statu"};
 
         if(!DataAuthUtil.hasAllShopAuth()){
             param.put("shopId", sysUsers.getShopId());
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/vo/OrderFlowVo.java b/zq-erp/src/main/java/com/matrix/system/hive/vo/OrderFlowVo.java
index 78ce807..2a0c4f4 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/vo/OrderFlowVo.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/vo/OrderFlowVo.java
@@ -2,18 +2,18 @@
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.matrix.core.tools.DateUtil;
-import com.matrix.system.app.vo.OrderDetailItemVo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 
 import java.math.BigDecimal;
 import java.util.Date;
-import java.util.List;
 
 /**
  * @author jyy
  * @date 2021-01-27
  **/
+@Data
 @ApiModel(value = "OrderFlowVo", description = "订单流水返回参数类")
 public class OrderFlowVo {
 
@@ -26,10 +26,10 @@
     @ApiModelProperty(value = "订单号")
     private String orderNo;
 
-    @ApiModelProperty(value ="交易类型")
+    @ApiModelProperty(value = "交易类型")
     private String flowType;
 
-    @ApiModelProperty(value ="支付方式")
+    @ApiModelProperty(value = "支付方式")
     private String payMethod;
 
     @ApiModelProperty(value = "会员姓名")
@@ -50,103 +50,11 @@
     @ApiModelProperty(value = "门店名称")
     private String shopName;
 
+    @ApiModelProperty(value = "支付卡名称")
+    private String cardName;
+
     @JsonFormat(pattern = DateUtil.DATE_FORMAT_SS, timezone = "GMT+8")
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getOrderId() {
-        return orderId;
-    }
-
-    public void setOrderId(String orderId) {
-        this.orderId = orderId;
-    }
-
-    public String getOrderNo() {
-        return orderNo;
-    }
-
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo;
-    }
-
-    public String getFlowType() {
-        return flowType;
-    }
-
-    public void setFlowType(String flowType) {
-        this.flowType = flowType;
-    }
-
-    public String getPayMethod() {
-        return payMethod;
-    }
-
-    public void setPayMethod(String payMethod) {
-        this.payMethod = payMethod;
-    }
-
-    public String getVipName() {
-        return vipName;
-    }
-
-    public void setVipName(String vipName) {
-        this.vipName = vipName;
-    }
-
-    public String getFlowContent() {
-        return flowContent;
-    }
-
-    public void setFlowContent(String flowContent) {
-        this.flowContent = flowContent;
-    }
-
-    public BigDecimal getAmount() {
-        return amount;
-    }
-
-    public void setAmount(BigDecimal amount) {
-        this.amount = amount;
-    }
-
-    public String getStaffName() {
-        return staffName;
-    }
-
-    public void setStaffName(String staffName) {
-        this.staffName = staffName;
-    }
-
-    public String getFlowNo() {
-        return flowNo;
-    }
-
-    public void setFlowNo(String flowNo) {
-        this.flowNo = flowNo;
-    }
-
-    public String getShopName() {
-        return shopName;
-    }
-
-    public void setShopName(String shopName) {
-        this.shopName = shopName;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
 }
+
diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml
index a594e68..84c0ede 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml
@@ -76,7 +76,10 @@
 						WHERE order_status = 1 and company_id=#{companyId} ) a) waitNum,
 			(SELECT COUNT(*)
 				FROM shop_salesman_order
-				WHERE order_status = 1 and company_id=#{companyId}) waitOrderNum
+				WHERE order_status = 1 and company_id=#{companyId}) waitOrderNum,
+		    (select sum(order_money) from shop_salesman_order a
+				inner join shop_order b on a.order_id=b.ID
+			 where a.company_id=#{companyId}) orderBalance
 		FROM
 			shop_salesman_order
 		where company_id=#{companyId}
@@ -171,4 +174,67 @@
 		</if>
 	</select>
 
+	<select id="selectFenxiaoOrderListNoPage" resultType="com.matrix.system.fenxiao.vo.FenxiaoOrderListExportVo">
+		SELECT
+		a.id id,
+		d.order_no,
+		d.order_money actualBalance,
+		f.shop_name address,
+		case when d.order_status = 1 then '待付款'
+			when d.order_status = 2 then '待配送'
+			when d.order_status = 3 then '待收货'
+			when d.order_status = 4 then '待评价'
+			when d.order_status = 5 then '已评价'
+			when d.order_status = 6 then '申请退款'
+			when d.order_status = 7 then '退款成功'
+			when d.order_status = 8 then '退款拒绝'
+			when d.order_status = 9 then '已取消' end  orderState,
+		b.nick_name custom,
+		b.id customUserId,
+		e.nick_name parentSale,
+		case when a.revenue_type = 1 then '推广收益'
+		     when a.revenue_type = 2 then '邀请收益' end profitType,
+		a.amount profitBalance,
+		case when a.order_status = 1 then '待结算'
+			when a.order_status = 2 then '已结算'
+			when a.order_status = 3 then '已退款' end settleType,
+		c.order_no settleNo,
+		c.create_time settleTime,
+		g.su_name settler
+		FROM
+		shop_salesman_order a
+		LEFT JOIN sys_vip_info b on a.user_id = b.id
+		LEFT JOIN shop_saleman_settlement c on a.settlement_id = c.id
+		LEFT JOIN shop_order d on d.id = a.order_id
+		LEFT JOIN sys_vip_info e on a.sales_user_id = e.id
+		LEFT JOIN sys_shop_info f on f.id = d.store_id
+		LEFT JOIN sys_users g on c.user_id = g.su_id
+		<where>
+			a.company_id = #{record.companyId}
+			<if test="record.userName != null and record.userName != ''">
+				and b.nick_name like concat('%',#{record.userName},'%')
+			</if>
+			<if test="record.ddType != null and record.ddType != ''">
+				and d.order_status = #{record.ddType}
+			</if>
+			<if test="record.startTime != null ">
+				and a.create_time >= #{record.startTime}
+			</if>
+			<if test="record.endTime != null">
+				and  #{record.endTime} >= a.create_time
+			</if>
+			<if test="record.tgy != null and record.tgy != ''">
+				and e.nick_name like concat('%',#{record.tgy},'%')
+			</if>
+			<if test="record.orderType != null and record.orderType != ''">
+				and a.order_status = #{record.orderType}
+			</if>
+			<if test="record.jsbh != null and record.jsbh != ''">
+				and c.order_no = #{record.jsbh}
+			</if>
+			<if test="record.ddh != null and record.ddh != ''">
+				and d.order_no = #{record.ddh}
+			</if>
+		</where>
+	</select>
 </mapper>
\ 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 a3b0cd3..2e2de04 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/SysOrderItemDao.xml
@@ -353,11 +353,12 @@
         c.name as goodsName,
         g.name as cateName,
         a.COUNT,
+        a.COUNT *  a.ZK_PRICE as total,
         a.refundCount,
         a.ZK_PRICE,
         a.IS_FREE,
         a.pay_method,
-        a.status
+        b.statu
         from sys_order_item a
         left join sys_order b on a.ORDER_ID=b.ID
         left join shopping_goods c on a.goods_id=c.id
@@ -397,8 +398,8 @@
             <if test="guwenId != null and guwenId != ''  ">
                 and  b.STAFF_ID=#{guwenId}
             </if>
-            <if test="status != null and status != ''  ">
-                and  a.status=#{status}
+            <if test="statu != null and statu != ''  ">
+                and  b.statu=#{statu}
             </if>
 
         </where>
@@ -449,8 +450,8 @@
             <if test="guwenId != null and guwenId != ''  ">
                 and  b.STAFF_ID=#{guwenId}
             </if>
-            <if test="status != null and status != ''  ">
-                and  a.status=#{status}
+            <if test="statu != null and statu != ''  ">
+                and  b.statu=#{statu}
             </if>
         </where>
     </select>
diff --git a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html
index c047688..a3e3dce 100644
--- a/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html
+++ b/zq-erp/src/main/resources/templates/views/admin/fenxiao/fenxiao-order.html
@@ -53,12 +53,12 @@
 <div class="panel-body" id="app" v-cloak>
         <el-row>
                 <el-card class="box-card" style="background-color: #0a628f;">
-                    <div style="padding:10px;font-size: 20px;">¥{{basicdetail.balance}}</div>
+                    <div style="padding:10px;font-size: 20px;">¥{{basicdetail.orderBalance}}</div>
                     <div>订单总金额</div>
                 </el-card >
                 <el-card class="box-card" style="background-color: #0f9aef;">
                     <div style="padding:10px;font-size: 20px;">¥{{basicdetail.balance}}</div>
-                    <div>待计算金额</div>
+                    <div>待结算金额</div>
                 </el-card >
                 <el-card class="box-card" style="background: #67C23A;">
                     <div style="padding:10px;font-size: 20px;">{{basicdetail.waitNum}}人</div>
@@ -152,7 +152,7 @@
                             </el-form-item>
                             <el-button type="primary" @click="search" >搜索</el-button>
                             <el-button @click="resetForm('form')">重置</el-button>
-                            <el-button>导出</el-button>
+                            <el-button @click="excelExport">导出</el-button>
                         </el-form>
                     </el-col>
                 </el-row>
@@ -686,6 +686,16 @@
                     }
                 });
             },
+            excelExport() {
+                var jsonParam = this.getRequestParam();
+                var param = "";
+                Object.keys(jsonParam).forEach(function(key){
+                    if (jsonParam[key]) {
+                        param += key + "=" + jsonParam[key] + "&";
+                    }
+                });
+                window.location.href=basePath+"/fenXiao/fenXiaoOrder/exportExcel?"+param;
+            }
         }
     })
 </script>
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/jyls.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/jyls.html
index c3b2a39..5ca688e 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/jyls.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/jyls.html
@@ -150,6 +150,11 @@
                     label="支付方式">
             </el-table-column>
             <el-table-column
+                    prop="cardName"
+                    sortable="custom"
+                    label="储值卡名称">
+            </el-table-column>
+            <el-table-column
                     prop="flowNo"
                     label="支付流水号">
             </el-table-column>
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-item.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-item.html
index 9f946dd..62a5048 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-item.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/statistics-order-item.html
@@ -27,7 +27,7 @@
 			</div>
 			<div class="form-group mr-20">
 				<label >订单状态</label>
-				<select class="form-control " name="status"  >
+				<select class="form-control " name="statu"  >
 					<option value=''>--请选择订单状态--</option>
 					<option value='欠款'>欠款</option>
 					<option value='待付款'>待付款</option>
@@ -92,9 +92,10 @@
 					<th data-field="VIP_NAME" >客户名</th>
       			    <th data-field="COUNT"  data-sortable="true"   >购买数量</th>
       			    <th data-field="ZK_PRICE"  data-sortable="true"   >单价</th>
+      			    <th data-field="total"      >小计</th>
       			    <th data-field="su_name" >健康顾问</th>
       			    <th data-field="pay_method" >支付方式</th>
-      			    <th data-field="status" >状态</th>
+      			    <th data-field="statu" >状态</th>
 				</tr>
 			</thead>
 		</table>
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html
index 60f715e..07bfb1c 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/servicceAddForm.html
@@ -133,7 +133,7 @@
 							<span class="openOrClose" v-if="item.openOrClose" @click="openOrCloseTc(item, index, 2)"><i class="el-icon-arrow-up"></i></span>
 							【{{item.isCourse=='N'?'固定套餐':'任选套餐'}}】{{item.projName}}
 							<span style="float: right" v-if="item.failTime != null">有效期:{{item.failTime}}</span>
-							<code v-if="item.projInfo.isCourse=='Y'" > 剩余次数:<span v-if="item.projInfo.isInfinite == 'Y'">无限次</span><span v-else>{{item.surplusCount}}</span> </code>
+							<code v-if="item.isCourse=='Y'" > 剩余次数:<span v-if="item.isInfinite == 'Y'">无限次</span><span v-else>{{item.surplusCount}}</span> </code>
 						</p>
 						<el-table
 								:data="item.taocanProjUse"
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yyServiceAddForm.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yyServiceAddForm.html
index d01ee11..7259054 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yyServiceAddForm.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yyServiceAddForm.html
@@ -133,7 +133,7 @@
 							<span class="openOrClose" v-if="item.openOrClose" @click="openOrCloseTc(item, index, 2)"><i class="el-icon-arrow-up"></i></span>
 							【{{item.isCourse=='N'?'固定套餐':'任选套餐'}}】{{item.projName}}
 							<span style="float: right" v-if="item.failTime != null">有效期:{{item.failTime}}</span>
-							<code v-if="item.projInfo.isCourse=='Y'" > 剩余次数:<span v-if="item.projInfo.isInfinite == 'Y'">无限次</span><span v-else>{{item.surplusCount}}</span> </code>
+							<code v-if="item.isCourse=='Y'" > 剩余次数:<span v-if="item.isInfinite == 'Y'">无限次</span><span v-else>{{item.surplusCount}}</span> </code>
 						</p>
 						<el-table
 								:data="item.taocanProjUse"
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html
index 82445c2..e748a60 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/products/goods-form.html
@@ -1696,7 +1696,7 @@
                         _this.userAdbleEdit();
 
                         //如果是总产品加载总部分类信息
-                        _this.getShoppinggoodscategory(1);
+                        // _this.getShoppinggoodscategory(1);
                         _this.getGoodstype(1);
                     }
                 });
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html
index 130f97d..b77076e 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/jyls.html
@@ -137,6 +137,11 @@
                     label="支付方式">
             </el-table-column>
             <el-table-column
+                    prop="cardName"
+                    sortable="custom"
+                    label="储值卡名称">
+            </el-table-column>
+            <el-table-column
                     prop="flowNo"
                     label="支付流水号">
             </el-table-column>
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-item.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-item.html
index 1a3af24..b714909 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-item.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/statistics-order-item.html
@@ -27,7 +27,7 @@
 			</div>
 			<div class="form-group mr-20">
 				<label >订单状态</label>
-				<select class="form-control " name="status"  >
+				<select class="form-control " name="statu"  >
 					<option value=''>--请选择订单状态--</option>
 					<option value='欠款'>欠款</option>
 					<option value='待付款'>待付款</option>
@@ -84,9 +84,10 @@
 					<th data-field="VIP_NAME" >客户名</th>
       			    <th data-field="COUNT"  data-sortable="true"   >购买数量</th>
       			    <th data-field="ZK_PRICE"  data-sortable="true"   >单价</th>
+					<th data-field="total"      >小计</th>
       			    <th data-field="su_name" >健康顾问</th>
       			    <th data-field="pay_method" >支付方式</th>
-      			    <th data-field="status" >状态</th>
+      			    <th data-field="statu" >状态</th>
 				</tr>
 			</thead>
 		</table>
diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html
index 6011fb9..108bb79 100644
--- a/zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html
+++ b/zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html
@@ -130,7 +130,7 @@
                         <th data-field="totalScore" data-align="center">获得总积分</th>
                         <th data-field="currentScore" data-align="center">可兑换积分</th>
                         <th data-field="isSales" data-align="center" data-formatter="buildIsSales">是否为销售员</th>
-                        <th data-align="center"  data-width="195px" data-field="userId" data-formatter="buildOperate">操作</th>
+                        <th data-align="center"  data-width="195px" data-field="userId" data-formatter="buildOperation">操作</th>
                     </tr>
                     </thead>
                 </table>
@@ -189,13 +189,18 @@
     var btns = [];
     btns[0] = "", btns[1] = "";
 
-    function buildOperate(value, row, index){
+    function buildOperation(value, row, index) {
         var html = "";
-        html += '<div class="btn-group">'
-        html += '</div>';
+        html += '<a class="text-info" href="javascript:void(0)" onClick="setSalesMan(\''+row.id+'\')">设置推广员</a>&nbsp;&nbsp;'
         return html;
     }
 
+    function setSalesMan(val) {
+        MTools.handleItem(basePath + "/fenXiao/fenXiaoUser/setSaleMan?id=" + val, "确定将该用户设置为推广员?",
+            function () {
+                myGrid.serchData();
+            });
+    }
 
 
 

--
Gitblit v1.9.1