From 9323d0e8ae91461fe3c1316875a237b6236999d0 Mon Sep 17 00:00:00 2001 From: Burce Date: Wed, 30 Oct 2019 14:14:13 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=8B=9B=E5=95=86][=E6=A6=82=E8=A7=88]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../invest/InvestBaseController.java | 1 + .../invest/impl/InvestBizServiceImpl.java | 25 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java index 5a069ca28..a22acd703 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java @@ -30,6 +30,7 @@ public class InvestBaseController extends BaseController { super.InitBinder(dataBinder); registerEnumEditor(dataBinder, EnumCustomerType.class, "customerType") ; registerEnumEditor(dataBinder, EnumCustomerRatingType.class, "customerRatingType") ; + registerEnumEditor(dataBinder, EnumCustomerRatingType.class, "rating") ; registerEnumEditor(dataBinder, EnumTaskStatus.class, "taskStatus") ; registerEnumEditor(dataBinder, EnumFollowType.class, "type") ; } diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java index 188260a90..778dac30a 100644 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java @@ -518,7 +518,7 @@ public class InvestBizServiceImpl implements InvestBizService { InvestPageResult investPage = new InvestPageResult<>(); taskQueryWrapper.apply(StringUtils.isNotBlank(taskParams.getOwner()), "`owner` REGEXP {0}", taskParams.getOwner()); taskQueryWrapper.apply(Objects.nonNull(params.getBusinessId()), "`content` REGEXP {0}", - String.format("\"businessId\": %d", params.getBusinessId())); + buildBusinessQuery(params)); taskParams.setOwner(null); taskQueryWrapper.setEntity(taskParams); @@ -567,6 +567,13 @@ public class InvestBizServiceImpl implements InvestBizService { return investPage; } + private String buildBusinessQuery(InvestTaskQuery params) { + if (params.getBusinessId() <= 10) { + return String.format("\"businessId\": %d[^1%d]", params.getBusinessId(), params.getBusinessId()); + } + return String.format("\"businessId\": %d", params.getBusinessId()); + } + private Collection buildShopContractQuery(Collection shops, EnumRentShopType shopType) { Collection shopIds = new ArrayList<>(); if (CollectionUtils.isNotEmpty(shops)) { @@ -699,10 +706,10 @@ public class InvestBizServiceImpl implements InvestBizService { } private String getDayEnd(Date date) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(date); - calendar.add(Calendar.DAY_OF_YEAR, 1); - return DateUtils.format(calendar.getTime()); + //Calendar calendar = Calendar.getInstance(); + //calendar.setTime(date); + //calendar.add(Calendar.DAY_OF_YEAR, 1); + return DateUtils.format(date); } private String getDayStart(Date date) { @@ -1041,11 +1048,11 @@ public class InvestBizServiceImpl implements InvestBizService { .eq(InvestTaskEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); result.put("customerTotal", customerService.count(new LambdaQueryWrapper() .eq(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); - result.put("taskToday", customerService.count(new LambdaQueryWrapper() + result.put("customerToday", customerService.count(new LambdaQueryWrapper() .apply("date_format(create_date,'%Y-%m-%d') = {0}", DateUtils.format(new Date())) .eq(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); result.put("customerImportant", customerService.count(new LambdaQueryWrapper() - .eq(InvestCustomerEntity::getType, EnumCustomerType.INTENTIONAL) + .in(InvestCustomerEntity::getType, EnumCustomerType.POTENTIAL,EnumCustomerType.INTENTIONAL) .eq(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); result.put("remindTotal", remindService.count(new LambdaQueryWrapper() .eq(InvestRemindEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); @@ -1061,10 +1068,10 @@ public class InvestBizServiceImpl implements InvestBizService { .apply("`owner` REGEXP {0}", InvestUserContext.getUserId()))); result.put("customerTotal", demandService.count(new LambdaQueryWrapper() .eq(InvestDemandEntity::getOwner, InvestUserContext.getUser().getTenantId()))); - result.put("taskToday", customerService.count(new LambdaQueryWrapper() + result.put("taskToday", taskService.count(new LambdaQueryWrapper() .apply("`owner` REGEXP {0}", InvestUserContext.getUserId()) .apply("date_format(create_date,'%Y-%m-%d') = {0}", DateUtils.format(new Date())) - .eq(InvestCustomerEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); + .eq(InvestTaskEntity::getTenantId, InvestUserContext.getUser().getTenantId()))); result.put("customerToday", demandService.count(new LambdaQueryWrapper() .eq(InvestDemandEntity::getOwner, InvestUserContext.getUser().getTenantId()) .apply("date_format(create_date,'%Y-%m-%d') = {0}", DateUtils.format(new Date()))