From 28cfa033f4c9e7e8639d9acb8f3c75688a3e539d Mon Sep 17 00:00:00 2001 From: jyy <jyy> Date: Mon, 02 Aug 2021 16:37:59 +0800 Subject: [PATCH] 优化需求 --- zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java | 5 zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java | 10 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html | 2 zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml | 370 +++++++++++++++++++++++++--------------------------- zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-meidu.html | 2 zq-erp/src/main/java/com/matrix/system/hive/statistics/SysBusinessDataAction.java | 4 zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java | 4 zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java | 2 zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java | 10 zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java | 8 10 files changed, 199 insertions(+), 218 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java index 755216d..3309ce6 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ShopInfoController.java @@ -7,8 +7,7 @@ import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.constance.AppConstance; -import com.matrix.system.constance.Dictionary; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.hive.action.util.QueryUtil; import com.matrix.system.hive.bean.SysShopInfo; import com.matrix.system.hive.service.SysShopInfoService; @@ -114,7 +113,7 @@ public @ResponseBody AjaxResult findAllWithPermi(SysShopInfo shopInfo) { QueryUtil.setQueryLimitCom(shopInfo); SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + if (!DataAuthUtil.hasAllShopAuth()) { shopInfo.setId(sysUsers.getShopId()); } return new AjaxResult(AjaxResult.STATUS_SUCCESS, currentService.findByModel(shopInfo), null); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java index c9b2bec..482ad02 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/dao/AchieveNewDao.java @@ -61,8 +61,8 @@ public List<AchieveNew> findSumDailyInfoNew(@Param("record") AchieveNew achieveNew, @Param("pageVo") PaginationVO pageVo); - - List<AchieveNew> selectVipConsumeStatisticsList(@Param("record") AchieveNew achieveNew, @Param("pageVo") PaginationVO pageVo); + + List<Map<String, Object>> selectVipConsumeStatisticsList(@Param("record") AchieveNew achieveNew, @Param("pageVo") PaginationVO pageVo); int selectVipConsumeStatisticsTotal(@Param("record") AchieveNew achieveNew); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java index e502b07..bdf9228 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/AchieveNewService.java @@ -1,14 +1,14 @@ package com.matrix.system.hive.service; -import java.util.List; - +import com.matrix.core.pojo.PaginationVO; import com.matrix.system.app.vo.UserAchieveVo; import com.matrix.system.hive.bean.AchieveNew; import com.matrix.system.hive.bean.SysOrder; import com.matrix.system.hive.bean.SysProjServices; - -import com.matrix.core.pojo.PaginationVO; import com.matrix.system.hive.plugin.util.BaseServices; + +import java.util.List; +import java.util.Map; /** * @@ -109,7 +109,7 @@ public void modifyAchieveTime(AchieveNew achieveNew); - List<AchieveNew> findVipConsumeStatisticsList(AchieveNew achieveNew, PaginationVO pageVo); + List<Map<String, Object>> findVipConsumeStatisticsList(AchieveNew achieveNew, PaginationVO pageVo); int findVipConsumeStatisticsTotal(AchieveNew achieveNew); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java index e302e9f..afec062 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/AchieveNewServiceImpl.java @@ -390,7 +390,7 @@ } @Override - public List<AchieveNew> findVipConsumeStatisticsList(AchieveNew achieveNew, PaginationVO pageVo) { + public List<Map<String, Object>> findVipConsumeStatisticsList(AchieveNew achieveNew, PaginationVO pageVo) { return achieveNewDao.selectVipConsumeStatisticsList(achieveNew, pageVo); } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java index 3469bb4..354a30d 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/AchieveAction.java @@ -11,8 +11,8 @@ import com.matrix.core.tools.excl.ExcelVersion; import com.matrix.system.common.bean.CustomerDataDictionary; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.dao.CustomerDataDictionaryDao; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.common.tools.ResponseHeadUtil; import com.matrix.system.hive.action.util.QueryUtil; import com.matrix.system.hive.bean.AchieveNew; @@ -78,7 +78,7 @@ public @ResponseBody AjaxResult findSumDailyInfoNew(@RequestBody AchieveNew achieveNew) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + if (!DataAuthUtil.hasAllShopAuth()) { achieveNew.setShopId(sysUsers.getShopId()); } AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, achieveNewService.findSumDailyInfoNew(achieveNew, null), @@ -95,7 +95,7 @@ AjaxResult findDailyInfoNew(@RequestBody AchieveNew achieveNew) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); achieveNew.setCompanyId(sysUsers.getCompanyId()); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + if (!DataAuthUtil.hasAllShopAuth()) { achieveNew.setShopId(sysUsers.getShopId()); } PaginationVO pageVo = new PaginationVO(); @@ -121,7 +121,7 @@ , "服务提成", "人头", "项目个数", "服务时间", "订单类型"}; orderSheet.setHeaders(header); SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + if (!DataAuthUtil.hasAllShopAuth()) { queryDto.setShopId(sysUsers.getShopId()); } queryDto.setCompanyId(sysUsers.getCompanyId()); @@ -198,7 +198,7 @@ orderSheet.setHeaders(header); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + if (!DataAuthUtil.hasAllShopAuth()) { achieveNew.setShopId(sysUsers.getShopId()); } 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 14b05f9..8d7165e 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 @@ -6,7 +6,7 @@ import com.matrix.core.tools.DateUtil; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.hive.dao.SysBusinessDataDao; import com.matrix.system.hiveErp.analysUtil.StatisticsTimeDaoParam; import com.matrix.system.hiveErp.analysUtil.StatisticsTimeUtil; @@ -39,7 +39,7 @@ public @ResponseBody AjaxResult showList(BusinessDataShowVo businessDataShowVo, PaginationVO pageVo) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + if (!DataAuthUtil.hasAllShopAuth()) { businessDataShowVo.setShopId(sysUsers.getShopId()+""); } pageVo.setSort("createTime"); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java b/zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java index e3a384a..52abb4e 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/statistics/VipStatisticsAction.java @@ -5,7 +5,7 @@ import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.constance.AppConstance; +import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.hive.bean.AchieveNew; import com.matrix.system.hive.service.AchieveNewService; import org.springframework.beans.factory.annotation.Autowired; @@ -13,8 +13,8 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; -import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 客户数据统计 @@ -33,10 +33,10 @@ @ResponseBody public AjaxResult vipConsumeStatistics(AchieveNew achieveNew, PaginationVO pageVo) { SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); - if(!AppConstance.ZONGDIAN.equals(sysUsers.getShopName())){ + if (!DataAuthUtil.hasAllShopAuth()) { achieveNew.setShopId(sysUsers.getShopId()); } - List<AchieveNew> list = achieveNewService.findVipConsumeStatisticsList(achieveNew, pageVo); + List<Map<String, Object>> list = achieveNewService.findVipConsumeStatisticsList(achieveNew, pageVo); int total = achieveNewService.findVipConsumeStatisticsTotal(achieveNew); return AjaxResult.buildSuccessInstance(list, total); } diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml index 1181f74..99190d7 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.matrix.system.hive.dao.AchieveNewDao"> <!-- 定义AchieveNew 的复杂关联map --> @@ -101,7 +101,7 @@ and a.company_id = #{record.companyId} <if test="record!=null"> <if - test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> + test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> and a.shop_id = #{record.shopId} </if> <if test="record.achieveRuleId != null "> @@ -151,7 +151,7 @@ </select> <select id="findDayFlowTotal" - resultType="java.lang.Integer"> + resultType="java.lang.Integer"> select count(*) from achieve_new a @@ -167,7 +167,7 @@ <where> <if test="record!=null"> <if - test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> + test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> and a.shop_id = #{record.shopId} </if> <if test="record.year != null and record.year !='' "> @@ -201,41 +201,41 @@ </where> </select> -<!-- + <!-- - 统计员工业绩 + 统计员工业绩 -select - u.name, - g.su_name guwen, - cast(SUM(b.ZK_TOTAL) AS decimal(15,2)) as zk_total, - cast(SUM(a.his_consume) AS decimal(15,2)), - cast(SUM(a.free_consume) AS decimal(15,2)), - cast(SUM(a.proj_percentage) AS decimal(15,2)), - cast(SUM(a.number_of_people) AS decimal(15,2)), - cast(SUM(a.proj_num) AS decimal(15,2)), - cast(SUM(a.proj_time) AS decimal(15,2)), - h.shop_short_name shop_name, - a.order_type, - a.achieveType - from - achieve_new a - left join sys_order b on a.order_id=b.id - left join sys_vip_info c on a.vip_id=c.id - left join sys_vip_level d on c.LEVEL_ID=d.id - left join shopping_goods e on a.shopping_goods_id=e.id - LEFT JOIN sys_users f on a.beault_id=f.su_id - LEFT JOIN sys_users g on a.sale_id = g.su_id - LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID - LEFT JOIN shopping_goods_category i ON e.cate_id = i.id - left join sys_proj_services l on a.service_order_id=l.id - left join sys_order_item j on a.order_item_id=j.ID - left join achieve_rule u on u.id=e.achieve_rule_id - where h.shop_short_name='龙华店' - GROUP BY g.su_name , a.order_type, h.id,a.achieveType - ORDER BY g.su_name + select + u.name, + g.su_name guwen, + cast(SUM(b.ZK_TOTAL) AS decimal(15,2)) as zk_total, + cast(SUM(a.his_consume) AS decimal(15,2)), + cast(SUM(a.free_consume) AS decimal(15,2)), + cast(SUM(a.proj_percentage) AS decimal(15,2)), + cast(SUM(a.number_of_people) AS decimal(15,2)), + cast(SUM(a.proj_num) AS decimal(15,2)), + cast(SUM(a.proj_time) AS decimal(15,2)), + h.shop_short_name shop_name, + a.order_type, + a.achieveType + from + achieve_new a + left join sys_order b on a.order_id=b.id + left join sys_vip_info c on a.vip_id=c.id + left join sys_vip_level d on c.LEVEL_ID=d.id + left join shopping_goods e on a.shopping_goods_id=e.id + LEFT JOIN sys_users f on a.beault_id=f.su_id + LEFT JOIN sys_users g on a.sale_id = g.su_id + LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID + LEFT JOIN shopping_goods_category i ON e.cate_id = i.id + left join sys_proj_services l on a.service_order_id=l.id + left join sys_order_item j on a.order_item_id=j.ID + left join achieve_rule u on u.id=e.achieve_rule_id + where h.shop_short_name='龙华店' + GROUP BY g.su_name , a.order_type, h.id,a.achieveType + ORDER BY g.su_name ---> + --> <select id="findSumDailyInfoNew" resultMap="AchieveNewMap"> @@ -268,7 +268,7 @@ <where> <if test="record!=null"> <if - test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> + test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> and a.shop_id = #{record.shopId} </if> <if test="record.year != null and record.year !='' "> @@ -415,120 +415,120 @@ <if test="record!=null"> <if - test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> + test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> and id = #{record.id} </if> <if test="record.companyId != null and record.companyId !='' "> and company_id = #{record.companyId} </if> <if - test="(record.saleId!=null and record.saleId!='') or (record.saleId!='' and record.saleId==0) "> + test="(record.saleId!=null and record.saleId!='') or (record.saleId!='' and record.saleId==0) "> and sale_id = #{record.saleId} </if> <if - test="(record.beaultId!=null and record.beaultId!='') or (record.beaultId!='' and record.beaultId==0) "> + test="(record.beaultId!=null and record.beaultId!='') or (record.beaultId!='' and record.beaultId==0) "> and beault_id = #{record.beaultId} </if> <if - test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> + test="(record.shopId!=null and record.shopId!='') or (record.shopId!='' and record.shopId==0) "> and shop_id = #{record.shopId} </if> <if - test="(record.datatime!=null and record.datatime!='') or (record.datatime!='' and record.datatime==0) "> + test="(record.datatime!=null and record.datatime!='') or (record.datatime!='' and record.datatime==0) "> and datatime = #{record.datatime} </if> <if - test="(record.orderId!=null and record.orderId!='') or (record.orderId!='' and record.orderId==0) "> + test="(record.orderId!=null and record.orderId!='') or (record.orderId!='' and record.orderId==0) "> and order_id = #{record.orderId} </if> <if - test="(record.orderItemId!=null and record.orderItemId!='') or (record.orderItemId!='' and record.orderItemId==0) "> + test="(record.orderItemId!=null and record.orderItemId!='') or (record.orderItemId!='' and record.orderItemId==0) "> and order_item_id = #{record.orderItemId} </if> <if - test="(record.shoppingGoodsId!=null and record.shoppingGoodsId!='') or (record.shoppingGoodsId!='' and record.shoppingGoodsId==0) "> + test="(record.shoppingGoodsId!=null and record.shoppingGoodsId!='') or (record.shoppingGoodsId!='' and record.shoppingGoodsId==0) "> and shopping_goods_id = #{record.shoppingGoodsId} </if> <if - test="(record.serviceOrderId!=null and record.serviceOrderId!='') or (record.serviceOrderId!='' and record.serviceOrderId==0) "> + test="(record.serviceOrderId!=null and record.serviceOrderId!='') or (record.serviceOrderId!='' and record.serviceOrderId==0) "> and service_order_id = #{record.serviceOrderId} </if> <if - test="(record.vipId!=null and record.vipId!='') or (record.vipId!='' and record.vipId==0) "> + test="(record.vipId!=null and record.vipId!='') or (record.vipId!='' and record.vipId==0) "> and vip_id = #{record.vipId} </if> <if - test="(record.freeConsume!=null and record.freeConsume!='') or (record.freeConsume!='' and record.freeConsume==0) "> + test="(record.freeConsume!=null and record.freeConsume!='') or (record.freeConsume!='' and record.freeConsume==0) "> and free_consume = #{record.freeConsume} </if> <if - test="(record.hisConsume!=null and record.hisConsume!='') or (record.hisConsume!='' and record.hisConsume==0) "> + test="(record.hisConsume!=null and record.hisConsume!='') or (record.hisConsume!='' and record.hisConsume==0) "> and his_consume = #{record.hisConsume} </if> <if - test="(record.goodsCash!=null and record.goodsCash!='') or (record.goodsCash!='' and record.goodsCash==0) "> + test="(record.goodsCash!=null and record.goodsCash!='') or (record.goodsCash!='' and record.goodsCash==0) "> and goods_cash = #{record.goodsCash} </if> <if - test="(record.projNum!=null and record.projNum!='') or (record.projNum!='' and record.projNum==0) "> + test="(record.projNum!=null and record.projNum!='') or (record.projNum!='' and record.projNum==0) "> and proj_num = #{record.projNum} </if> <if - test="(record.numberOfPeople!=null and record.numberOfPeople!='') or (record.numberOfPeople!='' and record.numberOfPeople==0) "> + test="(record.numberOfPeople!=null and record.numberOfPeople!='') or (record.numberOfPeople!='' and record.numberOfPeople==0) "> and number_of_people = #{record.numberOfPeople} </if> <if - test="(record.shopName!=null and record.shopName!='') or (record.shopName!='' and record.shopName==0) "> + test="(record.shopName!=null and record.shopName!='') or (record.shopName!='' and record.shopName==0) "> and shop_name = #{record.shopName} </if> <if - test="(record.projTime!=null and record.projTime!='') or (record.projTime!='' and record.projTime==0) "> + test="(record.projTime!=null and record.projTime!='') or (record.projTime!='' and record.projTime==0) "> and proj_time = #{record.projTime} </if> <if - test="(record.remark!=null and record.remark!='') or (record.remark!='' and record.remark==0) "> + test="(record.remark!=null and record.remark!='') or (record.remark!='' and record.remark==0) "> and remark = #{record.remark} </if> <if - test="(record.orderType!=null and record.orderType!='') or (record.orderType!='' and record.orderType==0) "> + test="(record.orderType!=null and record.orderType!='') or (record.orderType!='' and record.orderType==0) "> and order_type = #{record.orderType} </if> <if - test="(record.projPercentage!=null and record.projPercentage!='') or (record.projPercentage!='' and record.projPercentage==0) "> + test="(record.projPercentage!=null and record.projPercentage!='') or (record.projPercentage!='' and record.projPercentage==0) "> and proj_percentage = #{record.projPercentage} </if> <if - test="(record.t1!=null and record.t1!='') or (record.t1!='' and record.t1==0) "> + test="(record.t1!=null and record.t1!='') or (record.t1!='' and record.t1==0) "> and t1 = #{record.t1} </if> <if - test="(record.t2!=null and record.t2!='') or (record.t2!='' and record.t2==0) "> + test="(record.t2!=null and record.t2!='') or (record.t2!='' and record.t2==0) "> and t2 = #{record.t2} </if> <if - test="(record.achieveType!=null and record.achieveType!='') or (record.achieveType!='' and record.achieveType==0) "> + test="(record.achieveType!=null and record.achieveType!='') or (record.achieveType!='' and record.achieveType==0) "> and achieveType = #{record.achieveType} </if> <if - test="(record.t4!=null and record.t4!='') or (record.t4!='' and record.t4==0) "> + test="(record.t4!=null and record.t4!='') or (record.t4!='' and record.t4==0) "> and t4 = #{record.t4} </if> <if - test="(record.t5!=null and record.t5!='') or (record.t5!='' and record.t5==0) "> + test="(record.t5!=null and record.t5!='') or (record.t5!='' and record.t5==0) "> and t5 = #{record.t5} </if> <if - test="(record.t6!=null and record.t6!='') or (record.t6!='' and record.t6==0) "> + test="(record.t6!=null and record.t6!='') or (record.t6!='' and record.t6==0) "> and t6 = #{record.t6} </if> <if - test="(record.t8!=null and record.t8!='') or (record.t8!='' and record.t8==0) "> + test="(record.t8!=null and record.t8!='') or (record.t8!='' and record.t8==0) "> and t8 = #{record.t8} </if> <if - test="(record.t9!=null and record.t9!='') or (record.t9!='' and record.t9==0) "> + test="(record.t9!=null and record.t9!='') or (record.t9!='' and record.t9==0) "> and t9 = #{record.t9} </if> </if> @@ -537,7 +537,7 @@ <!-- 插入方法 --> <insert id="insert" parameterType="com.matrix.system.hive.bean.AchieveNew" - useGeneratedKeys="true" keyProperty="item.id"> + useGeneratedKeys="true" keyProperty="item.id"> INSERT INTO achieve_new ( <include refid="columns"></include> ) @@ -555,7 +555,7 @@ ) VALUES <foreach collection="list" item="item" index="index" - separator=","> + separator=","> ( <include refid="propertys"></include> ) @@ -668,15 +668,15 @@ UPDATE achieve_new set datatime = #{record.datatime} <where> <if - test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> + test="(record.id!=null and record.id!='') or (record.id!='' and record.id==0) "> and id = #{record.id} </if> <if - test="(record.orderId!=null and record.orderId!='') or (record.orderId!='' and record.orderId==0) "> + test="(record.orderId!=null and record.orderId!='') or (record.orderId!='' and record.orderId==0) "> and order_id = #{record.orderId} </if> <if - test="(record.serviceOrderId!=null and record.serviceOrderId!='') or (record.serviceOrderId!='' and record.serviceOrderId==0) "> + test="(record.serviceOrderId!=null and record.serviceOrderId!='') or (record.serviceOrderId!='' and record.serviceOrderId==0) "> and service_order_id = #{record.serviceOrderId} </if> </where> @@ -714,7 +714,7 @@ vip_id = #{record.vipId}, </if> <if - test="record.freeConsume != null and record.freeConsume != '' "> + test="record.freeConsume != null and record.freeConsume != '' "> free_consume = #{record.freeConsume}, </if> <if test="record.hisConsume != null "> @@ -782,7 +782,7 @@ <delete id="deleteByIds" parameterType="java.util.List"> delete from achieve_new where id in <foreach collection="list" index="index" item="item" open="(" - separator="," close=")"> + separator="," close=")"> #{item} </foreach> </delete> @@ -828,7 +828,7 @@ <!-- 查询总条数 --> <select id="selectTotalRecord" - resultType="java.lang.Integer"> + resultType="java.lang.Integer"> select count(*) from achieve_new where 1=1 @@ -865,48 +865,44 @@ </select> - <select id="selectVipConsumeStatisticsList" resultMap="AchieveNewMap"> + <select id="selectVipConsumeStatisticsList" resultType="java.util.HashMap"> select - a.VIP_NAME, - a.PHONE t9, - GROUP_CONCAT(DISTINCT e.su_name) meiliao, - d.cnt arrive_cnt, - sum(b.buyConsume) goods_cash, - sum(b.freeConsume) free_consume, - sum(b.hisConsume) his_consume + a.VIP_NAME vipName, + a.PHONE t9, + b.su_name meiliao, + (SELECT sum(IFNULL(goods_cash,0)) from achieve_new where pay_method='现金' and VIP_ID=a.id + <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if> + <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]> </if> ) as 'goodsCash' , + (SELECT sum(IFNULL(goods_cash,0)) from achieve_new where pay_method='划扣' and VIP_ID=a.id + <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if> + <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]> </if>) as 'cardCash' , + (SELECT sum(IFNULL(free_consume,0)) from achieve_new where VIP_ID=a.id + <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if> + <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]> </if> ) as 'freeConsume' , + (SELECT sum(IFNULL(number_of_people,0)) from achieve_new where VIP_ID=a.id + <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if> + <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]> </if> ) as 'arriveCnt' , + (SELECT sum(IFNULL(his_consume,0)) from achieve_new where VIP_ID=a.id + <if test="record.beginTime != null"> and date_format(datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') </if> + <if test="record.endTime != null"> <![CDATA[ and date_format(datatime, '%Y-%m-%d') < date_format(#{record.endTime}, '%Y-%m-%d') ]]> </if> ) as 'hisConsume' from sys_vip_info a - inner join ( - select vip_id,datatime, sum(a.free_consume) freeConsume, sum(a.his_consume) hisConsume, sum(IFNULL(goods_cash, 0) )) buyConsume from achieve_new a group by vip_id - ) b on a.ID = b.vip_id - inner join ( - select vip_id, count(1) cnt from ( - select vip_id, date_format(datatime, '%Y-%m-%d') - from achieve_new - group by date_format(datatime, '%Y-%m-%d'), vip_id - ) c group by vip_id - ) d on a.ID=d.vip_id + left join sys_users b on a.BEATUY_ID=b.su_id + inner join sys_shop_info c on c.id=a.SHOP_ID + <where> - left join sys_users e on find_in_set(e.su_id, a.BEATUY_ID) - where 1=1 - <if test="record.vipName != null and record.vipName !=''"> - and (a.vip_name like CONCAT(CONCAT('%', #{record.vipName}), '%') or a.vip_no=#{record.vipName} or a.phone = #{record.vipName}) - </if> - <if test="record.shopId != null"> - and a.shop_id=#{record.shopId} - </if> - <if test="record.beginTime != null"> - and date_format(b.datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') - </if> - <if test="record.endTime!=null"> - and date_format(b.datatime, '%Y-%m-%d') >= date_format(#{record.endTime}, '%Y-%m-%d') - </if> - <if test="record.beaultId != null and record.beaultId!=''"> - and FIND_IN_SET(#{record.beaultId}, a.BEATUY_ID) - </if> - <if test='record.t1 == "on"'> - and a.BEATUY_ID is not null - </if> - group by a.PHONE + <if test="record.vipName != null and record.vipName !=''"> + and (a.vip_name like CONCAT(CONCAT('%', #{record.vipName}), '%') or a.vip_no=#{record.vipName} or a.phone = #{record.vipName}) + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.beaultId != null and record.beaultId!=''"> + and FIND_IN_SET(#{record.beaultId}, a.BEATUY_ID) + </if> + <if test='record.t1 == "on"'> + and a.BEATUY_ID is not null + </if> + </where> <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> <if test="pageVo.sort !=null and pageVo.order !=null"> order by @@ -922,37 +918,23 @@ <select id="selectVipConsumeStatisticsTotal" resultType="java.lang.Integer"> select count(1) from sys_vip_info a - inner join ( - select vip_id,datatime, sum(a.free_consume) freeConsume, sum(a.his_consume) hisConsume, sum(IFNULL(goods_cash, 0) ) buyConsume from achieve_new a group by vip_id - ) b on a.ID = b.vip_id - inner join ( - select vip_id, count(1) cnt from ( - select vip_id, date_format(datatime, '%Y-%m-%d') - from achieve_new - group by date_format(datatime, '%Y-%m-%d'), vip_id - ) c group by vip_id - ) d on a.ID=d.vip_id + left join sys_users b on a.BEATUY_ID=b.su_id + inner join sys_shop_info c on c.id=a.SHOP_ID + <where> - left join sys_users e on find_in_set(e.su_id, a.BEATUY_ID) - where 1=1 - <if test="record.vipName != null and record.vipName !=''"> - and (a.vip_name like CONCAT(CONCAT('%', #{record.vipName}), '%') or a.vip_no=#{record.vipName} or a.phone = #{record.vipName}) - </if> - <if test="record.shopId != null"> - and a.shop_id=#{record.shopId} - </if> - <if test="record.beginTime != null"> - and date_format(b.datatime, '%Y-%m-%d') >= date_format(#{record.beginTime}, '%Y-%m-%d') - </if> - <if test="record.endTime!=null"> - and date_format(b.datatime, '%Y-%m-%d') >= date_format(#{record.endTime}, '%Y-%m-%d') - </if> - <if test="record.beaultId != null and record.beaultId!=''"> - and FIND_IN_SET(#{record.beaultId}, a.BEATUY_ID) - </if> - <if test='record.t1 == "on"'> - and a.BEATUY_ID is not null - </if> + <if test="record.vipName != null and record.vipName !=''"> + and (a.vip_name like CONCAT(CONCAT('%', #{record.vipName}), '%') or a.vip_no=#{record.vipName} or a.phone = #{record.vipName}) + </if> + <if test="record.shopId != null"> + and a.shop_id=#{record.shopId} + </if> + <if test="record.beaultId != null and record.beaultId!=''"> + and FIND_IN_SET(#{record.beaultId}, a.BEATUY_ID) + </if> + <if test='record.t1 == "on"'> + and a.BEATUY_ID is not null + </if> + </where> </select> @@ -960,14 +942,14 @@ select sale_id id, (select ifnull(sum(case pay_method when '现金' then goods_cash else 0 end),0) - from achieve_new a - where a.beault_id=#{userId} - and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d')) + from achieve_new a + where a.beault_id=#{userId} + and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d')) ) orderCash, (select ifnull(sum(case pay_method when '划扣' then goods_cash else 0 end),0) - from achieve_new a - where a.beault_id=#{userId} - and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d')) + from achieve_new a + where a.beault_id=#{userId} + and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d')) ) cash, sum(case order_type when '订单' then proj_percentage else 0 end) cardUse, sum(IFNULL(his_consume, 0)) hisConsume, @@ -975,7 +957,7 @@ sum(case order_type when '服务单' then proj_percentage else 0 end) projCommission from achieve_new a where a.beault_id=#{userId} - and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d')) + and (date_format(datatime, '%Y-%m-%d') >= date_format(#{startTime}, '%Y-%m-%d') and date_format(#{endTime}, '%Y-%m-%d') >= date_format(datatime, '%Y-%m-%d')) </select> <select id="selectApiOrderItemAchieve" resultType="com.matrix.system.app.vo.OrderDetailAchieveItemVo"> @@ -983,15 +965,15 @@ b.su_name name, IFNULL(a.goods_cash, 0) achieve from achieve_new a - inner join sys_users b on (a.beault_id=b.su_id or a.sale_id = b.su_id) + inner join sys_users b on (a.beault_id=b.su_id or a.sale_id = b.su_id) where a.order_item_id=#{itemId} and order_type = '订单' </select> <select id="selectShopConsumeAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> select - b.shop_short_name name, - b.SHOP_IMAG photo, - sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume,0)) amount + b.shop_short_name name, + b.SHOP_IMAG photo, + sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume,0)) amount from achieve_new a left join sys_shop_info b on a.shop_id=b.ID and b.shop_type!=1 <where> @@ -1014,11 +996,11 @@ <select id="selectBeauticianConsumeAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> select - b.su_name name, - b.su_id id, - b.su_photo photo, - sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume, 0) ) amount, - c.shop_short_name shopName + b.su_name name, + b.su_id id, + b.su_photo photo, + sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume, 0) ) amount, + c.shop_short_name shopName from achieve_new a inner join sys_users b on a.beault_id=b.su_id left join sys_shop_info c on a.shop_id=c.ID @@ -1052,9 +1034,9 @@ c.su_name meiliao, TRUNCATE(d.count*d.zk_price,2) zk_total from achieve_new a - left join shopping_goods b on a.shopping_goods_id=b.id - left join sys_users c on a.beault_id=c.su_id - left join sys_order_item d on a.order_item_id=d.id + left join shopping_goods b on a.shopping_goods_id=b.id + left join sys_users c on a.beault_id=c.su_id + left join sys_order_item d on a.order_item_id=d.id where a.order_id=#{orderId} </select> @@ -1091,9 +1073,9 @@ <select id="selectShopSaleAchieveRanking" resultType="com.matrix.system.app.vo.RankingVo"> select - b.shop_short_name name, - b.SHOP_IMAG photo, - sum(IFNULL(a.amount,0)) amount + b.shop_short_name name, + b.SHOP_IMAG photo, + sum(IFNULL(a.amount,0)) amount from sys_order_flow a inner join sys_order c on a.order_id=c.id and c.STATU != '已取消' inner join sys_shop_info b on a.shop_id=b.id and shop_type!=1 @@ -1132,35 +1114,35 @@ <select id="achieveNewStatistics" resultType="com.matrix.system.hive.vo.AchieveNewStatisticsVo"> select - u.name ruleName, - f.su_name guwen, - f.su_id gwid, - g.su_name createBy, - g.su_id createId, - cast(SUM(b.ZK_TOTAL) AS decimal(15,2)) as zk_total, - cast(SUM(a.his_consume) AS decimal(15,2)) his_consume, - cast(SUM(a.free_consume) AS decimal(15,2)) free_consume, - cast(SUM(a.proj_percentage) AS decimal(15,2)) proj_percentage, - cast(SUM(a.number_of_people) AS decimal(15,2)) number_of_people, - cast(SUM(a.proj_num) AS decimal(15,2)) proj_num, - cast(SUM(case when a.pay_method = '划扣' then goods_cash end )AS decimal(15,2)) card_cash, - cast(SUM(a.proj_time) AS decimal(15,2)) proj_time, - cast(SUM(case when a.pay_method = '现金' then goods_cash end )AS decimal(15,2)) goods_cash, - h.shop_short_name shop_name, - a.order_type + u.name ruleName, + f.su_name guwen, + f.su_id gwid, + g.su_name createBy, + g.su_id createId, + cast(SUM(b.ZK_TOTAL) AS decimal(15,2)) as zk_total, + cast(SUM(a.his_consume) AS decimal(15,2)) his_consume, + cast(SUM(a.free_consume) AS decimal(15,2)) free_consume, + cast(SUM(a.proj_percentage) AS decimal(15,2)) proj_percentage, + cast(SUM(a.number_of_people) AS decimal(15,2)) number_of_people, + cast(SUM(a.proj_num) AS decimal(15,2)) proj_num, + cast(SUM(case when a.pay_method = '划扣' then goods_cash end )AS decimal(15,2)) card_cash, + cast(SUM(a.proj_time) AS decimal(15,2)) proj_time, + cast(SUM(case when a.pay_method = '现金' then goods_cash end )AS decimal(15,2)) goods_cash, + h.shop_short_name shop_name, + a.order_type from - achieve_new a - left join sys_order b on a.order_id=b.id - left join sys_vip_info c on a.vip_id=c.id - left join sys_vip_level d on c.LEVEL_ID=d.id - left join shopping_goods e on a.shopping_goods_id=e.id - LEFT JOIN sys_users f on a.beault_id=f.su_id - LEFT JOIN sys_users g on a.sale_id = g.su_id - LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID - LEFT JOIN shopping_goods_category i ON e.cate_id = i.id - left join sys_proj_services l on a.service_order_id=l.id - left join sys_order_item j on a.order_item_id=j.ID - left join achieve_rule u on u.id=e.achieve_rule_id + achieve_new a + left join sys_order b on a.order_id=b.id + left join sys_vip_info c on a.vip_id=c.id + left join sys_vip_level d on c.LEVEL_ID=d.id + left join shopping_goods e on a.shopping_goods_id=e.id + LEFT JOIN sys_users f on a.beault_id=f.su_id + LEFT JOIN sys_users g on a.sale_id = g.su_id + LEFT JOIN sys_shop_info h ON a.SHOP_ID = h.ID + LEFT JOIN shopping_goods_category i ON e.cate_id = i.id + left join sys_proj_services l on a.service_order_id=l.id + left join sys_order_item j on a.order_item_id=j.ID + left join achieve_rule u on u.id=e.achieve_rule_id <where> and a.company_id = #{record.companyId} <if test="record.shopId != null"> @@ -1171,7 +1153,7 @@ </if> <if test="record.staffName != null and record.staffName!=''"> - <!-- 创建人和归属人都有业绩 --> + <!-- 创建人和归属人都有业绩 --> and (f.su_name like concat('%',#{record.staffName},'%') or g.su_name like concat('%',#{record.staffName},'%') ) </if> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html index a01f2d8..5723d51 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/yypb-form.html @@ -122,7 +122,7 @@ </tr> <tr v-for="(item,index) in projService.serviceItems"> - <td>{{item.projInfo.name}}</td> + <td>{{item.projInfo.name}}【{{item.projUse.source}}】</td> <td>{{item.count}}</td> <td>{{item.projUse.price * item.count}}</td> <td><el-input @change="changeTimeLength" v-model="item.projInfo.timeLength"></el-input></td> diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-meidu.html b/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-meidu.html index b7c3ca2..f56a3dc 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-meidu.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/printTemplates/print-service-meidu.html @@ -65,7 +65,7 @@ </tr> <template v-for="item in projService.serviceItems"> <tr > - <td style="text-align: left;" colspan="4" >{{item.projInfo.name }}</td> + <td style="text-align: left;" colspan="4" >{{item.projInfo.name }}【{{item.projUse.source}}】</td> </tr> <tr > <td>{{item.count }}</td> -- Gitblit v1.9.1