| @@ -408,20 +408,19 @@ public class WxCUserDataController extends BaseController { | |||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||
| c.set(Calendar.MINUTE, 0); | |||
| c.set(Calendar.SECOND, 0); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| wxCouponOrder.setStartTime(c.getTime()); | |||
| //今日消费金额 | |||
| int todayCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys); | |||
| int todayCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder); | |||
| //周交易金额 | |||
| c.add(Calendar.DAY_OF_YEAR, -7); | |||
| wxCouponOrder.setStartTime(c.getTime()); | |||
| int weekCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys); | |||
| int weekCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder); | |||
| //月交易金额 | |||
| c.add(Calendar.DAY_OF_YEAR, -22); | |||
| wxCouponOrder.setStartTime(c.getTime()); | |||
| int monthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys); | |||
| int monthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder); | |||
| Map<String, Object> map = new HashMap<>(); | |||
| DecimalFormat df = new DecimalFormat("0.00"); | |||
| @@ -9,8 +9,7 @@ import com.iformall.enums.EnumAppPlat; | |||
| import com.iformall.enums.EnumCarCmd; | |||
| import com.iformall.enums.EnumChartType; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxCUserCarService; | |||
| import com.iformall.service.*; | |||
| import com.iformall.service.cuser.CUserServiceFactory; | |||
| import com.iformall.utils.DateUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| @@ -25,7 +24,6 @@ import java.math.BigDecimal; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| @@ -36,7 +34,7 @@ public class ChartDataSchedule { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxCarCmdLogMapper wxCarCmdLogMapper; | |||
| WxCarCmdLogService wxCarCmdLogService; | |||
| @Autowired | |||
| WxMallMapper wxMallMapper; | |||
| @@ -48,10 +46,10 @@ public class ChartDataSchedule { | |||
| WxChartDataMapper wxChartDataMapper; | |||
| @Autowired | |||
| WxCouponOrderMapper wxCouponOrderMapper; | |||
| WxCouponOrderService wxCouponOrderService; | |||
| @Autowired | |||
| WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper; | |||
| WxMerchantTradeDailyService wxMerchantTradeDailyService; | |||
| @Autowired | |||
| WxCUserCarService wxCUserCarService; | |||
| @@ -64,10 +62,10 @@ public class ChartDataSchedule { | |||
| /** | |||
| * 每天7点执行 | |||
| * 每天5点执行 | |||
| */ | |||
| @Async | |||
| @Scheduled(cron = "0 0 7 * * ?") | |||
| @Scheduled(cron = "0 0 5 * * ?") | |||
| public void createData() { | |||
| createUserData(); | |||
| createCarData(); | |||
| @@ -179,7 +177,7 @@ public class ChartDataSchedule { | |||
| if (count == 0) { | |||
| logger.info("入场车数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| params.put("cmdTypes",EnumCarCmd.getCarIn()); | |||
| Long carOutCount = wxCarCmdLogMapper.queryHistoryCount(params); | |||
| Long carOutCount = wxCarCmdLogService.queryHistoryCount(params); | |||
| addChartData(tenantEntity, carOutCount.toString(), EnumChartType.CAR_IN.getCode(), date, createtime); | |||
| } | |||
| wxChartDataEntity.setType(EnumChartType.CAR_OUT.getCode()); | |||
| @@ -187,7 +185,7 @@ public class ChartDataSchedule { | |||
| if (count == 0) { | |||
| logger.info("出场车数>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| params.put("cmdTypes",EnumCarCmd.getCarOut()); | |||
| Long carOutCount = wxCarCmdLogMapper.queryHistoryCount(params); | |||
| Long carOutCount = wxCarCmdLogService.queryHistoryCount(params); | |||
| addChartData(tenantEntity, carOutCount.toString(), EnumChartType.CAR_OUT.getCode(), date, createtime); | |||
| } | |||
| wxChartDataEntity.setType(EnumChartType.CAR_PAID.getCode()); | |||
| @@ -195,7 +193,7 @@ public class ChartDataSchedule { | |||
| if (count == 0) { | |||
| logger.info("缴费车辆>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| params.put("cmdTypes", EnumCarCmd.getCarPay()); | |||
| Long carPayFeeCount = wxCarCmdLogMapper.queryHistoryCount(params); | |||
| Long carPayFeeCount = wxCarCmdLogService.queryHistoryCount(params); | |||
| addChartData(tenantEntity, carPayFeeCount.toString(), EnumChartType.CAR_PAID.getCode(), date, createtime); | |||
| } | |||
| wxChartDataEntity.setType(EnumChartType.CAR_PAY_FEE.getCode()); | |||
| @@ -203,7 +201,7 @@ public class ChartDataSchedule { | |||
| if (count == 0) { | |||
| logger.info("缴费金额>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| params.put("cmdTypes", EnumCarCmd.getCarPay()); | |||
| BigDecimal fee = wxCarCmdLogMapper.queryCarPay(params); | |||
| BigDecimal fee = wxCarCmdLogService.queryCarPay(params); | |||
| addChartData(tenantEntity, fee.toString(), EnumChartType.CAR_PAY_FEE.getCode(), date, createtime); | |||
| } | |||
| // wxChartDataEntity.setType(EnumChartType.CAR_MEMBER.getCode()); | |||
| @@ -227,7 +225,7 @@ public class ChartDataSchedule { | |||
| count = wxChartDataMapper.selectCount(new QueryWrapper(wxChartDataEntity)); | |||
| if (count == 0) { | |||
| logger.info("已绑车辆>>>>>>>>>>>>>>>>>>>>>>>>>>"); | |||
| Long todaybindcar = wxCUserCarMapper.queryCarCount(params); | |||
| Long todaybindcar = wxCUserCarService.queryCarCount(params); | |||
| addChartData(tenantEntity, todaybindcar.toString(), EnumChartType.CAR_BIND.getCode(), date, createtime); | |||
| } | |||
| } | |||
| @@ -263,7 +261,7 @@ public class ChartDataSchedule { | |||
| wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| wxCouponOrder.setStartTime(startdate); | |||
| wxCouponOrder.setEndTime(enddate); | |||
| Integer price = wxCouponOrderMapper.queryPriceTotal(wxCouponOrder); | |||
| Integer price = wxCouponOrderService.queryPriceTotal(wxCouponOrder); | |||
| addChartData(tenantEntity, price.toString(), EnumChartType.SALE_COUPON_PRICE.getCode(), startdate, createtime); | |||
| } | |||
| } | |||
| @@ -297,11 +295,7 @@ public class ChartDataSchedule { | |||
| WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | |||
| wxMerchantTradeDaily.updateTenantInfo(tenantEntity); | |||
| wxMerchantTradeDaily.setReportDate(yesterday); | |||
| List<WxMerchantTradeDaily> recordList = wxMerchantTradeDailyMapper.findTotalListOfMonth(wxMerchantTradeDaily); | |||
| Integer price = 0; | |||
| if (!recordList.isEmpty()) { | |||
| price = Integer.parseInt(recordList.get(0).getTradeAmt()); | |||
| } | |||
| Integer price = wxMerchantTradeDailyService.findSumMoney(wxMerchantTradeDaily); | |||
| addChartData(tenantEntity, price.toString(), EnumChartType.MERCHANT_TRADE.getCode(), querytime, createtime); | |||
| } | |||
| } | |||
| @@ -14,6 +14,6 @@ public interface WxCUserCarMapper extends CommonMapper<WxCUserCar, Long> { | |||
| Integer countList(WxCUserCar wxCUserCar); | |||
| Integer countUser(WxCUserBasicInfoDto dto); | |||
| long queryCarCount(Map<String,Object> carParams); | |||
| long queryCarCount(HashMap<String,Object> carParams); | |||
| } | |||
| @@ -5,6 +5,7 @@ import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||
| import com.iformall.domain.po.WxCUserCar; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| public interface WxCUserCarService { | |||
| @@ -42,6 +43,7 @@ public interface WxCUserCarService { | |||
| * @return | |||
| */ | |||
| Integer countUser(WxCUserBasicInfoDto dto); | |||
| /** | |||
| * 根据实体查询 | |||
| * | |||
| @@ -100,5 +102,13 @@ public interface WxCUserCarService { | |||
| */ | |||
| void deleteByObj(WxCUserCar record); | |||
| /** | |||
| * 查询count | |||
| * | |||
| * @param | |||
| * @return | |||
| */ | |||
| long queryCarCount(HashMap<String, Object> params); | |||
| } | |||
| @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxCarCmdLog; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.math.BigDecimal; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @@ -56,5 +57,7 @@ public interface WxCarCmdLogService { | |||
| Map<String, Long> getHourCountMap(WxCarCmdLog wxCarCmdLog); | |||
| long queryHistoryCount(HashMap<String, Object> weekParams); | |||
| long queryHistoryCount(HashMap<String, Object> params); | |||
| BigDecimal queryCarPay(HashMap<String, Object> params); | |||
| } | |||
| @@ -173,7 +173,7 @@ public interface WxCouponOrderService { | |||
| * 查询消费额 | |||
| * @return | |||
| */ | |||
| int queryPriceTotal(WxCouponOrder wxCouponOrder,List<TenantEntity> tenantEntitys); | |||
| int queryPriceTotal(WxCouponOrder wxCouponOrder); | |||
| ////// ------- 卡 | |||
| @@ -45,7 +45,7 @@ public interface WxMerchantTradeDailyService { | |||
| /** | |||
| * 上传当日解单数据 | |||
| * | |||
| * @param id | |||
| * @param userId | |||
| * @param volume | |||
| */ | |||
| @@ -92,4 +92,5 @@ public interface WxMerchantTradeDailyService { | |||
| ResultData summary(WxMerchantTradeDaily wxMerchantTradeDaily); | |||
| Integer findSumMoney(WxMerchantTradeDaily merchantTradeDaily); | |||
| } | |||
| @@ -19,10 +19,10 @@ import com.iformall.enums.EnumAssignTagsTrigger; | |||
| import com.iformall.enums.EnumYesOrNo; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.TtCUserMapper; | |||
| import com.iformall.mapper.WxMallMapper; | |||
| import com.iformall.service.WxAppinfoService; | |||
| import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxCUserTagsService; | |||
| import com.iformall.service.WxMallService; | |||
| import com.iformall.service.cuser.BasicCUserService; | |||
| import com.iformall.service.cuser.CUserServiceApapter; | |||
| import com.iformall.utils.Constant; | |||
| @@ -57,7 +57,7 @@ public class TtCUserServiceAdapter extends BasicCUserService implements CUserSer | |||
| private TtCUserMapper ttCUserMapper; | |||
| @Autowired | |||
| private WxMallMapper wxMallMapper; | |||
| private WxMallService wxMallService; | |||
| @Autowired | |||
| MaUtil maUtil; | |||
| @@ -306,7 +306,13 @@ public class TtCUserServiceAdapter extends BasicCUserService implements CUserSer | |||
| @Override | |||
| public long findCount(WxCUserBasicInfoDto dto) { | |||
| return ttCUserMapper.findCount(dto); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(dto); | |||
| long count = 0l; | |||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||
| dto.updateTenantInfo(tenantEntity); | |||
| count += ttCUserMapper.findCount(dto); | |||
| } | |||
| return count; | |||
| } | |||
| @Override | |||
| @@ -19,6 +19,7 @@ import com.iformall.mapper.WxMallMapper; | |||
| import com.iformall.service.WxAppinfoService; | |||
| import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxCUserTagsService; | |||
| import com.iformall.service.WxMallService; | |||
| import com.iformall.service.cuser.BasicCUserService; | |||
| import com.iformall.service.wechat.FmOpenService; | |||
| import com.iformall.utils.Constant; | |||
| @@ -62,7 +63,7 @@ public class WxCUserServiceAdapter extends BasicCUserService implements CUserSer | |||
| private WxCUserMapper wxCUserMapper; | |||
| @Autowired | |||
| private WxMallMapper wxMallMapper; | |||
| private WxMallService wxMallService; | |||
| @Autowired | |||
| MaUtil maUtil; | |||
| @@ -314,7 +315,13 @@ public class WxCUserServiceAdapter extends BasicCUserService implements CUserSer | |||
| @Override | |||
| public long findCount(WxCUserBasicInfoDto dto) { | |||
| return wxCUserMapper.findCount(dto); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(dto); | |||
| long count = 0l; | |||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||
| dto.updateTenantInfo(tenantEntity); | |||
| count += wxCUserMapper.findCount(dto); | |||
| } | |||
| return count; | |||
| } | |||
| @Override | |||
| @@ -73,7 +73,7 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| WxMsgConfigMapper wxMsgConfigMapper; | |||
| @Autowired | |||
| WxCUserCarMapper wxCUserCarMapper; | |||
| WxCUserCarService wxCUserCarService; | |||
| @Autowired | |||
| StringRedisTemplate stringRedisTemplate; | |||
| @@ -745,13 +745,13 @@ public class DataTowerServiceImpl implements DataTowerService { | |||
| } | |||
| carParams.put("startdate",DateUtils.getSystemTime("yyyy-MM-dd 00:00:00")); | |||
| carParams.put("enddate",DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss")); | |||
| long todaybindcar = wxCUserCarMapper.queryCarCount(carParams); | |||
| long todaybindcar = wxCUserCarService.queryCarCount(carParams); | |||
| carParams.put("startdate",yesterday+" 00:00:00"); | |||
| carParams.put("enddate",yesterday+" 23:59:59"); | |||
| long yesterdaybindcar = wxCUserCarMapper.queryCarCount(carParams); | |||
| long yesterdaybindcar = wxCUserCarService.queryCarCount(carParams); | |||
| carParams.put("startdate",lastweek+" 00:00:00"); | |||
| carParams.put("enddate",lastweek+" 23:59:59"); | |||
| long lastweekbindcar = wxCUserCarMapper.queryCarCount(carParams); | |||
| long lastweekbindcar = wxCUserCarService.queryCarCount(carParams); | |||
| datamap.put("todaybindcar",todaybindcar); | |||
| if (yesterdaybindcar > 0) { | |||
| @@ -53,7 +53,7 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| @Autowired | |||
| WxRentContractMapper wxRentContractMapper; | |||
| @Autowired | |||
| WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper; | |||
| WxMerchantTradeDailyService wxMerchantTradeDailyService; | |||
| @Autowired | |||
| WxPayAccountBillService wxPayAccountBillService; | |||
| @Autowired | |||
| @@ -312,8 +312,9 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| merchantTradeDaily.setMerchantId(billRent.getMerchantId()); | |||
| merchantTradeDaily.setStartTime(sd.format(billRent.getStarttime())); | |||
| merchantTradeDaily.setEndTime(sd.format(billRent.getEndtime())); | |||
| String money = wxMerchantTradeDailyMapper.findSumMoney(merchantTradeDaily); | |||
| result.put("solutionBillMoney", StringUtils.isBlank(money)?0:money); | |||
| Integer money = wxMerchantTradeDailyService.findSumMoney(merchantTradeDaily); | |||
| String moneyStr = new BigDecimal(money.toString()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN).toPlainString(); | |||
| result.put("solutionBillMoney", moneyStr); | |||
| return result; | |||
| } | |||
| @@ -12,6 +12,7 @@ import com.iformall.mapper.WxCUserBasicInfoMapper; | |||
| import com.iformall.mapper.WxCUserCarMapper; | |||
| import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxCUserCarService; | |||
| import com.iformall.service.WxMallService; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| @@ -19,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.ArrayList; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.stream.Collectors; | |||
| @@ -37,6 +39,9 @@ public class WxCUserCarServiceImpl implements WxCUserCarService { | |||
| @Autowired | |||
| WxCUserBasicInfoService wxCUserBasicInfoService; | |||
| @Autowired | |||
| WxMallService wxMallService; | |||
| private void handlerUserParam(WxCUserCar record){ | |||
| if(StringUtils.isNotBlank(record.getUserPhone())){ | |||
| WxCUserBasicInfo biq = new WxCUserBasicInfo(); | |||
| @@ -88,8 +93,13 @@ public class WxCUserCarServiceImpl implements WxCUserCarService { | |||
| @Override | |||
| public Integer countUser(WxCUserBasicInfoDto dto) { | |||
| Integer integer = wxCUserCarMapper.countUser(dto); | |||
| return integer==null?0:integer; | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(dto); | |||
| int count = 0; | |||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||
| dto.updateTenantInfo(tenantEntity); | |||
| count += wxCUserCarMapper.countUser(dto); | |||
| } | |||
| return count; | |||
| } | |||
| @Override | |||
| @@ -147,5 +157,23 @@ public class WxCUserCarServiceImpl implements WxCUserCarService { | |||
| public void deleteByObj(WxCUserCar record) { | |||
| wxCUserCarMapper.delete(new UpdateWrapper<>(record)); | |||
| } | |||
| @Override | |||
| public long queryCarCount(HashMap<String, Object> params) { | |||
| String tenantId = params.get("tenantId").toString(); | |||
| String parentTenantId = params.get("parentTenantId") == null?null:params.get("parentTenantId").toString(); | |||
| TenantEntity te = new TenantEntity(); | |||
| te.setTenantId(tenantId); | |||
| te.setParentTenantId(parentTenantId); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(te); | |||
| long count = 0l; | |||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||
| params.put("tenantId", tenantEntity.getTenantId()); | |||
| params.put("parentTenantId", tenantEntity.getParentTenantId()); | |||
| count += wxCUserCarMapper.queryCarCount(params); | |||
| } | |||
| return count; | |||
| } | |||
| } | |||
| @@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.common.IdWorker; | |||
| import java.math.BigDecimal; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @@ -97,8 +98,38 @@ public class WxCarCmdLogServiceImpl implements WxCarCmdLogService { | |||
| } | |||
| @Override | |||
| public long queryHistoryCount(HashMap<String, Object> weekParams) { | |||
| return wxCarCmdLogMapper.queryHistoryCount(weekParams); | |||
| public long queryHistoryCount(HashMap<String, Object> params) { | |||
| String tenantId = params.get("tenantId").toString(); | |||
| String parentTenantId = params.get("parentTenantId") == null?null:params.get("parentTenantId").toString(); | |||
| TenantEntity te = new TenantEntity(); | |||
| te.setTenantId(tenantId); | |||
| te.setParentTenantId(parentTenantId); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(te); | |||
| long count = 0l; | |||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||
| params.put("tenantId", tenantEntity.getTenantId()); | |||
| params.put("parentTenantId", tenantEntity.getParentTenantId()); | |||
| count += wxCarCmdLogMapper.queryHistoryCount(params); | |||
| } | |||
| return count; | |||
| } | |||
| @Override | |||
| public BigDecimal queryCarPay(HashMap<String, Object> params) { | |||
| String tenantId = params.get("tenantId").toString(); | |||
| String parentTenantId = params.get("parentTenantId") == null?null:params.get("parentTenantId").toString(); | |||
| TenantEntity te = new TenantEntity(); | |||
| te.setTenantId(tenantId); | |||
| te.setParentTenantId(parentTenantId); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(te); | |||
| BigDecimal carPay = new BigDecimal(0); | |||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||
| params.put("tenantId", tenantEntity.getTenantId()); | |||
| params.put("parentTenantId", tenantEntity.getParentTenantId()); | |||
| BigDecimal bigDecimal = wxCarCmdLogMapper.queryCarPay(params); | |||
| carPay.add(bigDecimal); | |||
| } | |||
| return carPay; | |||
| } | |||
| @@ -63,7 +63,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| @Autowired | |||
| WxUserVisitMapper wxUserVisitMapper; | |||
| @Autowired | |||
| WxCUserCarMapper wxCUserCarMapper; | |||
| WxCUserCarService wxCUserCarService; | |||
| @Autowired | |||
| WxCouponActionLogService wxCouponActionLogService; | |||
| @Autowired | |||
| @@ -128,10 +128,6 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| @Autowired | |||
| private WxCUserService wxCUserService; | |||
| @Lazy | |||
| @Autowired | |||
| private WxCUserCarService wxCUserCarService; | |||
| @Lazy | |||
| @Autowired | |||
| private WxShopService wxShopService; | |||
| @@ -809,20 +805,20 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| String yesterday = DateUtils.getTimeBefore(1, new Date()); | |||
| String lastweek = DateUtils.getTimeBefore(7, new Date()); | |||
| //绑定车牌 | |||
| Map<String, Object> carParams = new HashMap<>(); | |||
| HashMap<String, Object> carParams = new HashMap<>(); | |||
| carParams.put("tenantId", tenantEntity.getTenantId()); | |||
| if (StringUtils.isNotBlank(tenantEntity.getParentTenantId())) { | |||
| carParams.put("parentTenantId", tenantEntity.getParentTenantId()); | |||
| } | |||
| carParams.put("startdate", DateUtils.getSystemTime("yyyy-MM-dd 00:00:00")); | |||
| carParams.put("enddate", DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss")); | |||
| long todaybindcar = wxCUserCarMapper.queryCarCount(carParams); | |||
| long todaybindcar = wxCUserCarService.queryCarCount(carParams); | |||
| carParams.put("startdate", yesterday + " 00:00:00"); | |||
| carParams.put("enddate", yesterday + " 23:59:59"); | |||
| long yesterdaybindcar = wxCUserCarMapper.queryCarCount(carParams); | |||
| long yesterdaybindcar = wxCUserCarService.queryCarCount(carParams); | |||
| carParams.put("startdate", lastweek + " 00:00:00"); | |||
| carParams.put("enddate", lastweek + " 23:59:59"); | |||
| long lastweekbindcar = wxCUserCarMapper.queryCarCount(carParams); | |||
| long lastweekbindcar = wxCUserCarService.queryCarCount(carParams); | |||
| datamap.put("todaybindcar", todaybindcar); | |||
| if (yesterdaybindcar > 0) { | |||
| double yesterdaybinddhb = (double) (todaybindcar - yesterdaybindcar) / yesterdaybindcar * 100; | |||
| @@ -1389,11 +1385,10 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| Date endTime = c.getTime();//明天0点 | |||
| c.add(Calendar.DAY_OF_YEAR, -30); | |||
| Date startTime = c.getTime(); | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(tenantEntity); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.setStartTime(startTime); | |||
| wxCouponOrder.setEndTime(endTime); | |||
| int thisMonthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);//月消费金额 | |||
| int thisMonthCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder);//月消费金额 | |||
| c.clear(); | |||
| c.add(Calendar.DAY_OF_YEAR, -1); | |||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||
| @@ -1403,7 +1398,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| wxCouponOrder.setStartTime(startTime); | |||
| wxCouponOrder.setEndTime(endTime); | |||
| // wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| int todayCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder,tenantEntitys);//月消费金额 | |||
| int todayCount = wxCouponOrderService.queryPriceTotal(wxCouponOrder);//月消费金额 | |||
| DecimalFormat df = new DecimalFormat("0.00"); | |||
| datamap.put("todayCount", df.format((float) todayCount / 100));//今日消费金额 | |||
| String thisMonthCountStr = df.format((float) thisMonthCount / 100); | |||
| @@ -2158,14 +2158,14 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| } | |||
| @Override | |||
| public int queryPriceTotal(WxCouponOrder wxCouponOrder,List<TenantEntity> tenantEntitys) { | |||
| int count = 0; | |||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||
| wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| int i = wxCouponOrderMapper.queryPriceTotal(wxCouponOrder); | |||
| count += i; | |||
| } | |||
| return count; | |||
| public int queryPriceTotal(WxCouponOrder wxCouponOrder) { | |||
| int price = 0; | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(wxCouponOrder); | |||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||
| wxCouponOrder.updateTenantInfo(tenantEntity); | |||
| price += wxCouponOrderMapper.queryPriceTotal(wxCouponOrder); | |||
| } | |||
| return price; | |||
| } | |||
| private WxCardCVo findCardDetailOfCUser(Long id,String tenantId) { | |||
| @@ -204,6 +204,18 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ | |||
| return new ResultData(data); | |||
| } | |||
| @Override | |||
| public Integer findSumMoney(WxMerchantTradeDaily merchantTradeDaily) { | |||
| List<TenantEntity> tenantEntitys = wxMallService.getTenantEntitys(merchantTradeDaily); | |||
| int money = 0; | |||
| for (TenantEntity tenantEntity:tenantEntitys) { | |||
| merchantTradeDaily.updateTenantInfo(tenantEntity); | |||
| String sumMoney = wxMerchantTradeDailyMapper.findSumMoney(merchantTradeDaily); | |||
| money += Integer.parseInt(sumMoney); | |||
| } | |||
| return money; | |||
| } | |||
| @Override | |||
| public ResultData getVolumeOfMonth(Long merchantId) { | |||
| @@ -93,11 +93,9 @@ | |||
| <select id="countUser" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Integer"> | |||
| select count(DISTINCT ubi.id) | |||
| from wx_c_user_car uc, wx_c_user_basic_info ubi | |||
| where uc.c_user_id = ubi.id | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and uc.tenant_id = #{tenantId} | |||
| </if> | |||
| from wx_c_user_car uc | |||
| left join wx_c_user_basic_info ubi on uc.c_user_id = ubi.id | |||
| where uc.tenant_id = #{tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and uc.parent_tenant_id = #{parentTenantId} | |||
| </if> | |||
| @@ -111,10 +109,8 @@ | |||
| </select> | |||
| <select id="queryCarCount" parameterType="hashmap" resultType="long"> | |||
| select count(id) from wx_c_user_car where 1=1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| select count(id) from wx_c_user_car | |||
| where `tenant_id` = #{tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| @@ -186,15 +186,9 @@ | |||
| </select> | |||
| <select id="findSumMoney" parameterType="com.iformall.domain.po.WxMerchantTradeDaily" resultType="String"> | |||
| select round(sum(mtd.trade_amt)/100,2) | |||
| select IFNULL(sum(mtd.trade_amt),0) | |||
| from wx_merchant_trade_daily mtd | |||
| inner join wx_merchant m on mtd.merchant_id = m.id | |||
| left join wx_merchant_b_user mbu on mtd.b_user_id = mbu.id | |||
| where 1 = 1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and mtd`tenant_id` = #{tenantId} | |||
| </if> | |||
| where mtd`tenant_id` = #{tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and mtd`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| @@ -202,6 +196,9 @@ | |||
| <if test=" null != merchantId "> | |||
| and mtd.merchant_id = #{merchantId} | |||
| </if> | |||
| <if test=" null != reportDate "> | |||
| and mtd.report_date = #{reportDate} | |||
| </if> | |||
| <if test=" null != startTime and null != endTime"> | |||
| and mtd.report_date >= date_format(#{startTime},'%Y-%m-%d') | |||
| @@ -219,11 +216,7 @@ | |||
| resultMap="BaseTotalResultMap"> | |||
| select report_date, IFNULL(sum(mtd.trade_amt),0) as trade_amt | |||
| from wx_merchant_trade_daily mtd | |||
| where 1 = 1 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and mtd.`tenant_id` = #{tenantId} | |||
| </if> | |||
| where mtd.`tenant_id` = #{tenantId} | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and mtd.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||