From 570e9f8774a3b4d70a0924a06a0c803471357039 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Wed, 08 Sep 2021 16:45:45 +0800 Subject: [PATCH] add mendian jingying baobiao --- zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java | 2 zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html | 36 +++++++++++------ zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java | 44 ++++++++++++++++++++++ zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html | 35 +++++++++++------ 4 files changed, 91 insertions(+), 26 deletions(-) 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 5fae6d9..be5703e 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 @@ -173,7 +173,7 @@ } public BigDecimal getConsumePay() { - return consumePay; + return consumePay.setScale(2, BigDecimal.ROUND_HALF_UP); } public void setConsumePay(BigDecimal consumePay) { diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java index 8d7165e..a0e5f4f 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java @@ -1,12 +1,16 @@ package com.matrix.system.hive.statistics; +import cn.hutool.core.util.StrUtil; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.WebUtil; +import com.matrix.system.app.dto.BusinessesDto; +import com.matrix.system.app.vo.BusinessesDataShowVo; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.tools.DataAuthUtil; +import com.matrix.system.hive.bean.SysBusinessData; import com.matrix.system.hive.dao.SysBusinessDataDao; import com.matrix.system.hiveErp.analysUtil.StatisticsTimeDaoParam; import com.matrix.system.hiveErp.analysUtil.StatisticsTimeUtil; @@ -102,4 +106,44 @@ return AjaxResult.buildSuccessInstance(result, total); } + @RequestMapping(value = "/findShopBusinessesData") + @ResponseBody + public AjaxResult findShopBusinessesData(BusinessDataShowVo businessDataShowVo, PaginationVO pageVo) { + int start = pageVo.getOffset(); + int size = pageVo.getLimit(); + int calenderUnit = Calendar.DATE; + Long shopId = null; + SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); + + if (StrUtil.isNotBlank(businessDataShowVo.getShopId())) { + shopId = Long.parseLong(businessDataShowVo.getShopId()); + } else { + shopId = sysUsers.getShopId(); + } + Calendar calendar = Calendar.getInstance(); + if (businessDataShowVo.getBeginTime() != null) { + calendar.setTime(businessDataShowVo.getBeginTime()); + } + calendar.add(calenderUnit, 1); + calendar.add(calenderUnit, -start); + String endTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD); + calendar.add(calenderUnit, -size); + String startTime = DateUtil.dateToString(calendar.getTime(), DateUtil.DATE_FORMAT_DD); + + List<Date> xAxis = StatisticsTimeUtil.getTimeSpace(startTime, endTime, "日"); + List<StatisticsTimeDaoParam> timeSpaceParam = StatisticsTimeUtil.buidParam(xAxis); + List<StatisticsTimeDaoParam> statisticsTimeDaoParams = timeSpaceParam.subList(0, timeSpaceParam.size() - 2); + List<BusinessesDataShowVo> list = sysBusinessDataDao.selectApiBusinessData(statisticsTimeDaoParams, shopId, sysUsers.getCompanyId()); + + + List<BusinessesDataShowVo> result = new ArrayList<>(); + for (int i = list.size() - 1; i >= 0; i--) { + BusinessesDataShowVo item = list.get(i); + String dataTime = item.getDataTime(); + item.setDataTime(DateUtil.dateToString(DateUtil.stringToDate(dataTime, DateUtil.DATE_FORMAT_DD), DateUtil.DATE_FORMAT_DD)); + result.add(item); + } + return AjaxResult.buildSuccessInstance(result, 100); + } + } \ No newline at end of file diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html index 3ab0f06..e84629b 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/statistics/daily-sum-list-new.html @@ -28,9 +28,9 @@ </div> <div class="form-group mr-20"> - <label>日期范围</label> - <input autocomplete="off" name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- - <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="endTime"> + <label>日期</label> + <input autocomplete="off" name="beginTime" type="text" class="form-control datetimepicker" id="beginTime"> +<!-- <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="endTime">--> </div> <div class="form-group mr-20"> <label >所属门店</label> <select id="select_id" @@ -49,15 +49,27 @@ <tr> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px" data-footer-formatter="footCountTitle">序号</th> - <th data-field="time">日期</th> - <th data-field="shopName" >门店</th> - <th data-field="cashPay" data-footer-formatter="countColumn">收现金额</th> - <th data-field="cardPay" data-footer-formatter="countColumn">实收余额支付</th> - <th data-field="consumePay" data-footer-formatter="countColumn">消耗金额</th> - <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th> + <th data-field="dataTime">日期</th> + <th data-field="cashPay" data-footer-formatter="countColumn">现金收款</th> + <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th> + <th data-field="" data-footer-formatter="countColumn">还款</th> + <th data-field="productAchieve" data-footer-formatter="countColumn">产品业绩</th> + <th data-field="cardAchieve" data-footer-formatter="countColumn">卡项业绩</th> <th data-field="refundCashPay" data-footer-formatter="countColumn">现金退款</th> <th data-field="refundCardPay" data-footer-formatter="countColumn">卡项退款</th> - <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th> + <th data-field="cardAmount" data-footer-formatter="countColumn">储值卡本金扣款</th> + <th data-field="cardFreeAmount" data-footer-formatter="countColumn">储值卡赠送扣款</th> + <th data-field="consumePay" data-footer-formatter="countColumn">本金消耗</th> + <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th> + <th data-field="peopleCnt" data-footer-formatter="countColumn">人头数</th> + <th data-field="projConsumeCnt" data-footer-formatter="countColumn">项目消耗数</th> + <th data-field="timeLength" data-footer-formatter="countColumn">服务时长</th> + <th data-field="perCustomCnt" data-footer-formatter="countColumn">客单数</th> + <th data-field="customGoodsCnt" data-footer-formatter="countColumn">客品数</th> + <th data-field="perCustomPrice" data-footer-formatter="countColumn">客单价</th> + <th data-field="cost" data-footer-formatter="countColumn">成本</th> + <th data-field="grossProfit" data-footer-formatter="countColumn">毛利</th> + <th data-field="grossProfitRate" data-footer-formatter="countColumn">毛利率</th> </tr> </thead> </table> @@ -78,7 +90,7 @@ $(function() { MTools.autoFullSelect(); myGrid = MGrid.initGrid({ - url : basePath+"/admin/sysBusinessData/showList", + url : basePath+"/admin/sysBusinessData/findShopBusinessesData", showExport : true, showFooter : true, height:'', @@ -100,10 +112,8 @@ return "<b>合计</b>"; }; function countColumn(data) { - console.log(data) field = this.field; var resultsumQuantity = parseFloat((data.reduce(function(sum, row) { - console.log(sum,row[field]); return sum + (+row[field]); }, 0)).toFixed(2));//保留有效数字 return "<b>"+resultsumQuantity+"</b>"; diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html index 98c6e83..6d0fc17 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/statistics/daily-sum-list-new.html @@ -28,9 +28,9 @@ </div> <div class="form-group mr-20"> - <label>日期范围</label> - <input autocomplete="off" name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- - <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="endTime"> + <label>日期</label> + <input autocomplete="off" name="beginTime" type="text" class="form-control datetimepicker" id="beginTime"> +<!-- <input autocomplete="off" name="endTime" type="text" class="form-control datetimepicker" id="endTime">--> </div> </form> @@ -41,14 +41,27 @@ <tr> <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px" data-footer-formatter="footCountTitle">序号</th> - <th data-field="time">日期</th> - <th data-field="cashPay" data-footer-formatter="countColumn">收现金额</th> - <th data-field="cardPay" data-footer-formatter="countColumn">实收余额支付</th> - <th data-field="consumePay" data-footer-formatter="countColumn">消耗金额</th> - <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th> + <th data-field="dataTime">日期</th> + <th data-field="cashPay" data-footer-formatter="countColumn">现金收款</th> + <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th> + <th data-field="" data-footer-formatter="countColumn">还款</th> + <th data-field="productAchieve" data-footer-formatter="countColumn">产品业绩</th> + <th data-field="cardAchieve" data-footer-formatter="countColumn">卡项业绩</th> <th data-field="refundCashPay" data-footer-formatter="countColumn">现金退款</th> <th data-field="refundCardPay" data-footer-formatter="countColumn">卡项退款</th> - <th data-field="arrearsPay" data-footer-formatter="countColumn">欠款</th> + <th data-field="cardAmount" data-footer-formatter="countColumn">储值卡本金扣款</th> + <th data-field="cardFreeAmount" data-footer-formatter="countColumn">储值卡赠送扣款</th> + <th data-field="consumePay" data-footer-formatter="countColumn">本金消耗</th> + <th data-field="freeConsumePay" data-footer-formatter="countColumn">赠送消耗</th> + <th data-field="peopleCnt" data-footer-formatter="countColumn">人头数</th> + <th data-field="projConsumeCnt" data-footer-formatter="countColumn">项目消耗数</th> + <th data-field="timeLength" data-footer-formatter="countColumn">服务时长</th> + <th data-field="perCustomCnt" data-footer-formatter="countColumn">客单数</th> + <th data-field="customGoodsCnt" data-footer-formatter="countColumn">客品数</th> + <th data-field="perCustomPrice" data-footer-formatter="countColumn">客单价</th> + <th data-field="cost" data-footer-formatter="countColumn">成本</th> + <th data-field="grossProfit" data-footer-formatter="countColumn">毛利</th> + <th data-field="grossProfitRate" data-footer-formatter="countColumn">毛利率</th> </tr> </thead> </table> @@ -69,7 +82,7 @@ $(function() { MTools.autoFullSelect(); myGrid = MGrid.initGrid({ - url : basePath+"/admin/sysBusinessData/showList", + url : basePath+"/admin/sysBusinessData/findShopBusinessesData", showExport : true, showFooter : true, height:'', @@ -91,10 +104,8 @@ return "<b>合计</b>"; }; function countColumn(data) { - console.log(data) field = this.field; var resultsumQuantity = parseFloat((data.reduce(function(sum, row) { - console.log(sum,row[field]); return sum + (+row[field]); }, 0)).toFixed(2));//保留有效数字 return "<b>"+resultsumQuantity+"</b>"; -- Gitblit v1.9.1