Helius
2022-02-14 59cf24b0aba393e145f4ba3d58e98b7a01a80992
zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java
@@ -18,6 +18,7 @@
import com.matrix.system.common.dao.CustomerDataDictionaryDao;
import com.matrix.system.common.service.SysUsersService;
import com.matrix.system.common.service.SystemDictionaryService;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.common.tools.ResponseHeadUtil;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.action.util.QueryUtil;
@@ -31,7 +32,6 @@
import com.matrix.system.score.dao.ScoreVipDetailDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -41,7 +41,6 @@
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
@@ -115,7 +114,6 @@
        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<>();
@@ -238,9 +236,9 @@
    public @ResponseBody
    AjaxResult showList(PaginationVO pageVo, SysVipInfo vipInfo) {
//        if (!getMe().getShopRole().equals(Dictionary.FLAG_YES_Y)) {
        vipInfo.setShopId(getMe().getShopId());
//        }
        QueryUtil.setQueryLimit(vipInfo);
        return showList(vipInfoService, vipInfo, pageVo);
    }
@@ -263,6 +261,7 @@
            vips.get(0).setLabels(sysVipLabelDao.selectByVipId(vips.get(0).getId()));
            vips.get(0).setAge(DateUtil.getAgeForBirthDay(vips.get(0).getBirthday1()));
            vips.get(0).setBalance(moneyCardUseDao.selectVipCardTotalMoney(vips.get(0).getId()));
            vips.get(0).setArrears(sysOrderService.findVipArrearsByVipId(vips.get(0).getId()));
            AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, vips, 0);
            return result;
        } else {
@@ -294,7 +293,9 @@
        } else {
            vipInfo.setVipState(Dictionary.VIP_STATE_HY);
            SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
            vipInfo.setShopId(users.getShopId());
            if(vipInfo.getShopId()==null){
                vipInfo.setShopId(users.getShopId());
            }
            return add(vipInfoService, vipInfo, "会员信息");
        }
    }
@@ -547,25 +548,17 @@
    }
    @RequestMapping(value = "/exportExcel")
    public void report(ModelMap model, HttpServletRequest request, HttpServletResponse response,
    public void report( HttpServletResponse response,
                       SysVipInfo vipInfo) throws IOException {
        if (vipInfo.getVipType() != null && !(vipInfo.getVipType().equals(""))) {
            vipInfo.setVipType(URLDecoder.decode(vipInfo.getVipType(), "UTF-8"));
        }
        if (vipInfo.getVipName() != null && !"".equals(vipInfo.getVipName())) {
            vipInfo.setVipName(URLDecoder.decode(vipInfo.getVipName(), "UTF-8"));
        }
        if (vipInfo.getArrivalWay() != null && !"".equals(vipInfo.getArrivalWay())) {
            vipInfo.setArrivalWay(URLDecoder.decode(vipInfo.getArrivalWay(), "UTF-8"));
        }
        if (vipInfo.getVipState() != null && !"".equals(vipInfo.getVipState())) {
            vipInfo.setVipState(URLDecoder.decode(vipInfo.getVipState(), "UTF-8"));
        SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        if(!DataAuthUtil.hasAllShopAuth()){
            vipInfo.setShopId(sysUsers.getShopId());
        }
        List<ExcelSheetPO> res = new ArrayList<>();
        ExcelSheetPO orderSheet = new ExcelSheetPO();
        String title = "每日单据明细";
        String title = "会员资料";
        orderSheet.setSheetName(title);
        orderSheet.setTitle(title);
        String[] header = {"会员编号", "姓名", "性别", "手机号码", "会员类型", "会员活跃度", "到店途径", "健康顾问", "所属门店"};