From 8287f743a1ac2fd5330f6dd7ca08255df193ae03 Mon Sep 17 00:00:00 2001
From: jyy <jyy>
Date: Fri, 09 Jul 2021 20:50:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/score_shop' into score_shop
---
zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html | 11 +++
zq-erp/pom.xml | 4
zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java | 152 ++++++++++++++++++++++++++++++++++++++++++++++----
3 files changed, 152 insertions(+), 15 deletions(-)
diff --git a/zq-erp/pom.xml b/zq-erp/pom.xml
index 111a11a..ed1dc1f 100644
--- a/zq-erp/pom.xml
+++ b/zq-erp/pom.xml
@@ -401,12 +401,12 @@
<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>
<exclude>**/*.woff2</exclude>
diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java
index 3b7e203..ae84a02 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java
@@ -5,7 +5,10 @@
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
-import com.matrix.core.tools.*;
+import com.matrix.core.tools.DateUtil;
+import com.matrix.core.tools.LogUtil;
+import com.matrix.core.tools.PropertiesUtil;
+import com.matrix.core.tools.WebUtil;
import com.matrix.core.tools.excl.ExcelSheetPO;
import com.matrix.core.tools.excl.ExcelUtil;
import com.matrix.core.tools.excl.ExcelVersion;
@@ -18,11 +21,9 @@
import com.matrix.system.common.tools.ResponseHeadUtil;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.action.util.QueryUtil;
-import com.matrix.system.hive.bean.Question;
-import com.matrix.system.hive.bean.SysVipInfo;
-import com.matrix.system.hive.bean.SysVipLevel;
-import com.matrix.system.hive.bean.VipAnswer;
+import com.matrix.system.hive.bean.*;
import com.matrix.system.hive.dao.MoneyCardUseDao;
+import com.matrix.system.hive.dao.ShoppingGoodsDao;
import com.matrix.system.hive.dao.SysVipLabelDao;
import com.matrix.system.hive.dao.VipAnswerDao;
import com.matrix.system.hive.pojo.RegisterInfo;
@@ -31,10 +32,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
@@ -43,10 +41,8 @@
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
-import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
@@ -90,9 +86,141 @@
private CustomerDataDictionaryDao customerDataDictionaryDao;
@Resource
private SysOrderService sysOrderService;
-
+ @Autowired
+ ShoppingGoodsDao shoppingGoodsDao;
@Autowired
private ScoreVipDetailDao scoreVipDetailDao;
+ @Resource
+ private SysProjUseService projUseService;
+ @Resource
+ HttpServletResponse response;
+
+ @RequestMapping(value = "/exportExcel/{vipId}")
+ public void getVipAllProjInfo(@PathVariable Long vipId) throws IOException {
+
+ List<ExcelSheetPO> res = new ArrayList<>();
+ ExcelSheetPO orderSheet = new ExcelSheetPO();
+
+ SysVipInfo vipInfo = vipInfoService.findById(vipId);
+
+ String title = vipInfo.getVipName()+"("+vipInfo.getVipNo()+")会员资料";
+ orderSheet.setSheetName(title);
+ orderSheet.setTitle(title);
+ String[] header = {"产品类型", "产品名称","来源", "状态", "余额", "余次", "到期时间", "本金", "赠金"};
+ orderSheet.setHeaders(header);
+
+
+ SysProjUse queryUse = new SysProjUse();
+ queryUse.setVipId(vipId);
+ queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM);
+ queryUse.setTaocanId(-1L);
+ queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX);
+ queryUse.setIsOver(Dictionary.FLAG_NO_N);
+ List<SysProjUse> projList = projUseService.findInPage(queryUse, null);
+
+ List<List<Object>> list = new ArrayList<>();
+ if (projList.size() > 0) {
+ for (SysProjUse item : projList) {
+ List<Object> temp = new ArrayList<>();
+ temp.add("项目");
+ temp.add(item.getProjName());
+ temp.add(item.getSource());
+ temp.add("有效");
+ temp.add(item.getBalance());
+ temp.add(item.getSurplusCount());
+ temp.add(DateUtil.dateToString(item.getFailTimeStr(),DateUtil.DATE_FORMAT_DD));
+ temp.add("");
+ temp.add("");
+ list.add(temp);
+ }
+ }
+ //套餐
+ //切换到套餐查询条件
+ SysProjUse queryTaocan = new SysProjUse();
+ queryTaocan.setType(Dictionary.SHOPPING_GOODS_TYPE_TC);
+ queryTaocan.setStatus(Dictionary.TAOCAN_STATUS_YX);
+ queryTaocan.setVipId(vipId);
+ List<SysProjUse> taoCanList = projUseService.findInPage(queryTaocan, null);
+ taoCanList.forEach(item->{
+ item.setTaocanProjUse(projUseService.selectTaocanProjUse(item.getId(), queryUse.getStatus()));
+ item.setProjInfo(shoppingGoodsDao.selectById(item.getProjId()));
+ });
+ if (taoCanList.size() > 0) {
+ for (SysProjUse item : taoCanList) {
+ List<Object> temp = new ArrayList<>();
+
+ if(Dictionary.FLAG_YES_Y.equals(item.getIsCourse())){
+ temp.add("任选套餐");
+ }else{
+ temp.add("固定套餐");
+ }
+ temp.add(item.getProjName());
+ temp.add(item.getSource());
+ temp.add("有效");
+ temp.add(item.getBalance());
+ temp.add(item.getSurplusCount());
+ temp.add(DateUtil.dateToString(item.getFailTimeStr(),DateUtil.DATE_FORMAT_DD));
+ temp.add("");
+ temp.add("");
+ list.add(temp);
+
+ //套餐下项目
+ List<SysProjUse> taocanProjUse = item.getTaocanProjUse();
+ if (taocanProjUse.size() > 0) {
+ for (SysProjUse proj_item : taocanProjUse) {
+ List<Object> temp2 = new ArrayList<>();
+ temp2.add(" |————");
+ temp2.add(proj_item.getProjName());
+ temp2.add(proj_item.getSource());
+ temp2.add("有效");
+ temp2.add(proj_item.getBalance());
+ temp2.add(proj_item.getSurplusCount());
+ temp2.add(DateUtil.dateToString(proj_item.getFailTimeStr(),DateUtil.DATE_FORMAT_DD));
+ temp2.add("");
+ temp2.add("");
+ list.add(temp2);
+ }
+ }
+
+
+ }
+ }
+
+
+ //储值卡
+ MoneyCardUse moneyCardUse = new MoneyCardUse();
+ moneyCardUse.setVipId(vipId);
+ moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_YX);
+ List<MoneyCardUse> cards = cardUseService.findByModel(moneyCardUse);
+
+ if (cards.size() > 0) {
+ for (MoneyCardUse item : cards) {
+ List<Object> temp = new ArrayList<>();
+ temp.add("储值卡");
+ temp.add(item.getCardName());
+ temp.add(item.getSource());
+ temp.add("有效");
+ temp.add("");
+ temp.add(item.getLastCount());
+ temp.add(DateUtil.dateToString(item.getFailTime(),DateUtil.DATE_FORMAT_DD));
+ temp.add(item.getRealMoney());
+ temp.add(item.getGiftMoney());
+ 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);
+ }
+
@RequestMapping(value = "/showVipLevel")
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 cd511b3..7aa8771 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
@@ -127,6 +127,7 @@
<el-button type="primary" plain @click="recharge">充值</el-button>
<el-button type="warning" plain @click="addOrder">开单</el-button>
<el-button type="success" plain @click="addServiceOrder">开服务单</el-button>
+ <el-button type="info" plain @click="exportExcel">导出项目</el-button>
</el-col>
</el-header>
<el-container>
@@ -195,7 +196,7 @@
</el-col>
<el-col :span="10">
<p>会员卡类型 : {{vipInfo.vipType}}</p>
- <p>会员等级 : {{vipInfo.levelName}}</p>
+ <p>会员等级 : {{vipInfo.vipLevel == null ? "" : vipInfo.vipLevel.levelName}}</p>
<p>生肖/星座 : {{vipInfo.constell}}</p>
<p>地址 : {{vipInfo.addr}}</p>
<p>健康顾问 : {{vipInfo.staffName}}</p>
@@ -1542,6 +1543,14 @@
vipId = this.vipInfo.id;
openAddService(vipId);
},
+ exportExcel(){
+ if (!this.vipInfo.id) {
+ this.$message.error('请选择用户');
+ return;
+ }
+ vipId = this.vipInfo.id;
+ window.location.href=basePath+"/admin/vipInfo/exportExcel/"+vipId;
+ },
// 开订单
addOrder() {
if (!this.vipInfo.id) {
--
Gitblit v1.9.1