2 files added
	
		
		7 files modified
	
	
 
	
	
	
	
	
	
	
	
|  |  |  | 
|---|
|  |  |  | import com.matrix.core.constance.MatrixConstance; | 
|---|
|  |  |  | import com.matrix.core.pojo.AjaxResult; | 
|---|
|  |  |  | import com.matrix.core.tools.WebUtil; | 
|---|
|  |  |  | import com.matrix.system.app.dto.SettingDto; | 
|---|
|  |  |  | import com.matrix.system.common.bean.SysUsers; | 
|---|
|  |  |  | import com.matrix.system.common.constance.AppConstance; | 
|---|
|  |  |  | import com.matrix.system.common.dao.BusParameterSettingsDao; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "根据code获取配置", notes = "根据code获取配置") | 
|---|
|  |  |  | @GetMapping(value = "/findAppSettingsByCode") | 
|---|
|  |  |  | public AjaxResult findAppSettingsByCode(String code) { | 
|---|
|  |  |  | @PostMapping(value = "/findAppSettingsByCode") | 
|---|
|  |  |  | public AjaxResult findAppSettingsByCode(@RequestBody SettingDto settingDto) { | 
|---|
|  |  |  | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
|---|
|  |  |  | AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); | 
|---|
|  |  |  | result.putInMap(code, busParameterSettingsDao.selectCompanyParamByCode(code,user.getCompanyId())); | 
|---|
|  |  |  | result.putInMap(settingDto.getCode(), busParameterSettingsDao.selectCompanyParamByCode(settingDto.getCode(),user.getCompanyId())); | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.matrix.system.app.dto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import io.swagger.annotations.ApiModel; | 
|---|
|  |  |  | import io.swagger.annotations.ApiModelProperty; | 
|---|
|  |  |  | import lombok.Data; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Data | 
|---|
|  |  |  | @ApiModel(value = "SettingDto", description = "根据code获取配置参数接收类") | 
|---|
|  |  |  | public class SettingDto { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiModelProperty(value = "code", example = "1") | 
|---|
|  |  |  | private String code; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | import org.apache.ibatis.annotations.Param; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | int unbundlingSaleMan(Long userId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int bindingRecommend(@Param("recommendId") Long recommendId,@Param("userId") Long userId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<Map<String, Object>> selectVipArrearsStatistics(@Param("record") SysVipInfo sysVipInfo, @Param("pageVo") PaginationVO pageVo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Integer selectVipArrearsStatisticsTotal(@Param("record") SysVipInfo sysVipInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | import java.io.File; | 
|---|
|  |  |  | import java.io.IOException; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * | 
|---|
|  |  |  | 
|---|
|  |  |  | public int setToBeAnSalesman(Long userId,Long invitationId,long gradeId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | SysVipInfo findByOpenId(String openId); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<Map<String, Object>> findVipArrearsStatistics(SysVipInfo sysVipInfo, PaginationVO pageVo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Integer findVipArrearsStatisticsTotal(SysVipInfo sysVipInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public List<Map<String, Object>> findVipArrearsStatistics(SysVipInfo sysVipInfo, PaginationVO pageVo) { | 
|---|
|  |  |  | return sysVipInfoDao.selectVipArrearsStatistics(sysVipInfo, pageVo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public Integer findVipArrearsStatisticsTotal(SysVipInfo sysVipInfo) { | 
|---|
|  |  |  | return sysVipInfoDao.selectVipArrearsStatisticsTotal(sysVipInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | import com.matrix.system.common.bean.SysUsers; | 
|---|
|  |  |  | import com.matrix.system.common.tools.DataAuthUtil; | 
|---|
|  |  |  | import com.matrix.system.hive.bean.AchieveNew; | 
|---|
|  |  |  | import com.matrix.system.hive.bean.SysVipInfo; | 
|---|
|  |  |  | import com.matrix.system.hive.service.AchieveNewService; | 
|---|
|  |  |  | import com.matrix.system.hive.service.SysVipInfoService; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Controller; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private AchieveNewService achieveNewService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SysVipInfoService sysVipInfoService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/vipConsumeStatistics") | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | public AjaxResult vipConsumeStatistics(AchieveNew achieveNew, PaginationVO pageVo) { | 
|---|
|  |  |  | 
|---|
|  |  |  | int total = achieveNewService.findVipConsumeStatisticsTotal(achieveNew); | 
|---|
|  |  |  | return AjaxResult.buildSuccessInstance(list, total); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/vipArrearsStatistics") | 
|---|
|  |  |  | @ResponseBody | 
|---|
|  |  |  | public AjaxResult vipArrearsStatistics(SysVipInfo sysVipInfo, PaginationVO pageVo) { | 
|---|
|  |  |  | SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); | 
|---|
|  |  |  | if (!DataAuthUtil.hasAllShopAuth()) { | 
|---|
|  |  |  | sysVipInfo.setShopId(sysUsers.getShopId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int total = sysVipInfoService.findVipArrearsStatisticsTotal(sysVipInfo); | 
|---|
|  |  |  | return AjaxResult.buildSuccessInstance(sysVipInfoService.findVipArrearsStatistics(sysVipInfo, pageVo), total); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | and date_format(a.create_time, '%Y') = date_format(#{record.datatime}, '%Y') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test='record.t1 == "4" and record.datatime != null'> | 
|---|
|  |  |  | and date_format(datatime, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') | 
|---|
|  |  |  | and date_format(a.create_time, '%Y-%m-%d %u') = date_format(#{record.datatime}, '%Y-%m-%d %u') | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </where> | 
|---|
|  |  |  | group by a.shop_id | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectVipArrearsStatistics" resultType="java.util.Map"> | 
|---|
|  |  |  | select | 
|---|
|  |  |  | a.VIP_NAME vipName, | 
|---|
|  |  |  | a.PHONE phone, | 
|---|
|  |  |  | c.shop_short_name shopName, | 
|---|
|  |  |  | sum(b.arrears) arrears, | 
|---|
|  |  |  | count(1) cnt, | 
|---|
|  |  |  | d.su_name staffName | 
|---|
|  |  |  | from sys_vip_info a | 
|---|
|  |  |  | inner join sys_order b on a.ID=b.VIP_ID | 
|---|
|  |  |  | inner join sys_shop_info c on a.SHOP_ID=c.ID | 
|---|
|  |  |  | left join sys_users d on a.STAFF_ID=d.su_id | 
|---|
|  |  |  | where b.STATU='欠款' and b.arrears!=0 | 
|---|
|  |  |  | <if test="record.companyId!=null"> | 
|---|
|  |  |  | and a.company_id=#{record.companyId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.shopId!=null"> | 
|---|
|  |  |  | and a.shop_id=#{record.shopId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test='record.vipName!=null and record.vipName!="" '> | 
|---|
|  |  |  | and (a.vip_name like concat('%', #{record.vipName}, '%') or a.vip_no like concat('%', #{record.vipName}, '%') or a.phone like concat('%', #{record.vipName}, '%')) | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | group by a.id | 
|---|
|  |  |  | <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> | 
|---|
|  |  |  | <if test="pageVo.sort !=null  and pageVo.order !=null"> | 
|---|
|  |  |  | order by | 
|---|
|  |  |  | ${pageVo.sort} ${pageVo.order} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="pageVo.offset >=0  and pageVo.limit >0"> | 
|---|
|  |  |  | limit | 
|---|
|  |  |  | #{pageVo.offset},#{pageVo.limit} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <select id="selectVipArrearsStatisticsTotal" resultType="java.lang.Integer"> | 
|---|
|  |  |  | select count(1) from ( | 
|---|
|  |  |  | select | 
|---|
|  |  |  | a.VIP_NAME vipName, | 
|---|
|  |  |  | a.PHONE phone, | 
|---|
|  |  |  | c.shop_short_name shopName, | 
|---|
|  |  |  | sum(b.arrears) arrears, | 
|---|
|  |  |  | count(1) cnt, | 
|---|
|  |  |  | d.su_name staffName | 
|---|
|  |  |  | from sys_vip_info a | 
|---|
|  |  |  | inner join sys_order b on a.ID=b.VIP_ID | 
|---|
|  |  |  | inner join sys_shop_info c on a.SHOP_ID=c.ID | 
|---|
|  |  |  | left join sys_users d on a.STAFF_ID=d.su_id | 
|---|
|  |  |  | where b.STATU='欠款' and b.arrears!=0 | 
|---|
|  |  |  | <if test="record.companyId!=null"> | 
|---|
|  |  |  | and a.company_id=#{record.companyId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | <if test="record.shopId!=null"> | 
|---|
|  |  |  | and a.shop_id=#{record.shopId} | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <if test='record.vipName!=null and record.vipName!="" '> | 
|---|
|  |  |  | and (a.vip_name like concat('%', #{record.vipName}, '%') or a.vip_no like concat('%', #{record.vipName}, '%') or a.phone like concat('%', #{record.vipName}, '%')) | 
|---|
|  |  |  | </if> | 
|---|
|  |  |  | group by a.id | 
|---|
|  |  |  | ) a | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </mapper> | 
|---|
|  |  |  |  | 
|---|
| New file | 
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!DOCTYPE HTML> | 
|---|
|  |  |  | <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> | 
|---|
|  |  |  | <head> | 
|---|
|  |  |  | <meta charset="utf-8"> | 
|---|
|  |  |  | <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> | 
|---|
|  |  |  | <meta name="renderer" content="webkit|ie-comp|ie-stand"> | 
|---|
|  |  |  | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
|---|
|  |  |  | <meta name="viewport" | 
|---|
|  |  |  | content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> | 
|---|
|  |  |  | <meta http-equiv="Cache-Control" content="no-siteapp" /> | 
|---|
|  |  |  | <LINK rel="Bookmark" href="../images/favicon.ico"> | 
|---|
|  |  |  | <!-- 本框架基本脚本和样式 --> | 
|---|
|  |  |  | <script type="text/javascript" | 
|---|
|  |  |  | th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> | 
|---|
|  |  |  | <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> | 
|---|
|  |  |  | </head> | 
|---|
|  |  |  | <body class="gray-bg"> | 
|---|
|  |  |  | <div class="ibox-content"> | 
|---|
|  |  |  | <!-- 搜索框部分start --> | 
|---|
|  |  |  | <form class="form-inline" id="serchform"> | 
|---|
|  |  |  | <div class="row mb-10"> | 
|---|
|  |  |  | <div class="col-sm-8"> | 
|---|
|  |  |  | <button  onclick="myGrid.serchData()" type="button" class="btn btn-info btn-sm"><i class="fa fa-search" ></i> 搜索</button> | 
|---|
|  |  |  | <button  onclick="myGrid.resetForm()" type="button"   class="btn btn-default btn-sm"><i class="fa fa-refresh " ></i> 重置</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="form-group mr-20"> | 
|---|
|  |  |  | <input autocomplete="off" placeholder="会员姓名/手机/编号"   name="vipName" type="text" class="form-control" /> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="form-group mr-20"> | 
|---|
|  |  |  | <label for="staffId">健康顾问</label> | 
|---|
|  |  |  | <select class="form-control autoFull select2" | 
|---|
|  |  |  | th:data-url="@{/admin/shopAll}" | 
|---|
|  |  |  | data-value="suId" | 
|---|
|  |  |  | id="staffId" | 
|---|
|  |  |  | data-filed="suName" | 
|---|
|  |  |  | name="staffId"> | 
|---|
|  |  |  | <option value="">--请选择顾问--</option> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </form> | 
|---|
|  |  |  | <div id="option-bar" > | 
|---|
|  |  |  | <button matrix:btn="bedList-exportExcel" onclick="exportExcel()" type="button" class="btn btn-default btn-sm"><i class="fa fa-download" ></i> 导出</button> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <table id="mgrid" data-url="" > | 
|---|
|  |  |  | <thead> | 
|---|
|  |  |  | <tr> | 
|---|
|  |  |  | <th data-formatter="MGrid.indexfn" data-align="center"  data-width="30px" >序号</th> | 
|---|
|  |  |  | <th data-field="vipName">会员名称</th> | 
|---|
|  |  |  | <th data-field="phone">手机号码</th> | 
|---|
|  |  |  | <th data-field="shopName">所属门店</th> | 
|---|
|  |  |  | <th data-field="arrears" data-sortable="true">欠款金额</th> | 
|---|
|  |  |  | <th data-field="cnt" data-sortable="true">欠款订单</th> | 
|---|
|  |  |  | <th data-field="staffName">所属顾问</th> | 
|---|
|  |  |  | </tr> | 
|---|
|  |  |  | </thead> | 
|---|
|  |  |  | </table> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script><script type="text/javascript"> | 
|---|
|  |  |  | var myGrid; | 
|---|
|  |  |  | $(function(){ | 
|---|
|  |  |  | //初始化项目属性搜索列表 | 
|---|
|  |  |  | MTools.autoFullSelect(); | 
|---|
|  |  |  | $(".select2").select2(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | myGrid=MGrid.initGrid({ | 
|---|
|  |  |  | url:basePath+"/admin/vipStatistics/vipArrearsStatistics" | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // function exportExcel(){ | 
|---|
|  |  |  | //     var param=MForm.toUrlParam("#serchform"); | 
|---|
|  |  |  | //     window.location.href=basePath+"/admin/moneyCardUseStatistics/exportSummaryItemDetail?"+param; | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | </body> | 
|---|
|  |  |  | </html> | 
|---|