|
@@ -209,9 +209,9 @@ public class PlanServiceImpl implements PlanService {
|
|
|
.or()
|
|
|
.like("principal_telephone",bo.getText());
|
|
|
});
|
|
|
- if (bo.getStartTime() != null)
|
|
|
+ if (bo.getStartTime() != null) // 搜索开始时间小于等于广告计划创建时间
|
|
|
planQueryWrapper.apply("plan_create_time >= STR_TO_DATE({0},'%Y-%m-%d %H:%i:%s')",bo.getStartTime());
|
|
|
- if (bo.getEndTime() != null)
|
|
|
+ if (bo.getEndTime() != null) // 搜索结束时间大于等于广告计划创建时间
|
|
|
planQueryWrapper.apply("plan_create_time <= STR_TO_DATE({0},'%Y-%m-%d %H:%i:%s')",bo.getEndTime());
|
|
|
planQueryWrapper.eq("state", StateUtil.APPROVED);
|
|
|
planQueryWrapper.eq("deleted","0");
|
|
@@ -254,8 +254,11 @@ public class PlanServiceImpl implements PlanService {
|
|
|
List<PlanItem> items = planItemMapper.selectList(itemQueryWrapper);
|
|
|
for (PlanItem item : items){
|
|
|
QueryWrapper<Plan> planQueryWrapper = new QueryWrapper<>();
|
|
|
+
|
|
|
+ // 广告计划开始时间 <= 当前时间 < 广告计划结束时间
|
|
|
planQueryWrapper.apply("plan_start_time <= STR_TO_DATE({0},'%Y-%m-%d %H:%i:%s')",LocalDateTime.now(ZoneId.of("Asia/Shanghai")));
|
|
|
planQueryWrapper.apply("plan_end_time > STR_TO_DATE({0},'%Y-%m-%d %H:%i:%s')",LocalDateTime.now(ZoneId.of("Asia/Shanghai")));
|
|
|
+
|
|
|
planQueryWrapper.eq("plan_id",item.getPlanId());
|
|
|
planQueryWrapper.eq("state",StateUtil.APPROVED);
|
|
|
planQueryWrapper.eq("deleted","0");
|
|
@@ -279,8 +282,11 @@ public class PlanServiceImpl implements PlanService {
|
|
|
for (PlanItem item : items){ // 根据计划子项查询计划,并补齐返回信息
|
|
|
QueryWrapper<Plan> planQueryWrapper = new QueryWrapper<>();
|
|
|
planQueryWrapper.eq("plan_id",item.getPlanId());
|
|
|
+
|
|
|
+ // 广告计划开始时间 <= 当前时间 < 广告计划结束时间
|
|
|
planQueryWrapper.apply("plan_start_time <= STR_TO_DATE({0},'%Y-%m-%d %H:%i:%s')",LocalDateTime.now(ZoneId.of("Asia/Shanghai")));
|
|
|
planQueryWrapper.apply("plan_end_time > STR_TO_DATE({0},'%Y-%m-%d %H:%i:%s')",LocalDateTime.now(ZoneId.of("Asia/Shanghai")));
|
|
|
+
|
|
|
planQueryWrapper.eq("state",StateUtil.APPROVED);
|
|
|
planQueryWrapper.eq("on_state", OnStateUtil.UP);
|
|
|
planQueryWrapper.eq("deleted","0");
|
|
@@ -350,7 +356,7 @@ public class PlanServiceImpl implements PlanService {
|
|
|
itemQueryWrapper.eq("deleted","0");
|
|
|
List<PlanItem> items = planItemMapper.selectList(itemQueryWrapper);
|
|
|
List<PlanManageItemVo> itemVos = new ArrayList<>();
|
|
|
- for (PlanItem item : items){
|
|
|
+ for (PlanItem item : items){ // 补齐店铺信息
|
|
|
PlanManageItemVo itemVo = new PlanManageItemVo(item);
|
|
|
if (item.getStoreId() != null){
|
|
|
Store store = storeMapper.selectById(item.getStoreId());
|
|
@@ -388,6 +394,7 @@ public class PlanServiceImpl implements PlanService {
|
|
|
List<PlanPushListVo> vos = new ArrayList<>();
|
|
|
for (Plan plan : plans){
|
|
|
PlanPushListVo vo = new PlanPushListVo(plan);
|
|
|
+ // 根据计划id获取设备数量
|
|
|
Integer count = planItemMapper.selectEquipmentCountByPlanId(plan.getPlanId());
|
|
|
vo.setEquipmentCount(count);
|
|
|
vos.add(vo);
|
|
@@ -443,14 +450,8 @@ public class PlanServiceImpl implements PlanService {
|
|
|
planPushStatistics.setCarouselCount(carousalCount);
|
|
|
planPushStatistics.setScanCodeCount(scanCount);
|
|
|
planPushStatistics.setTradeCount(tradeCount);
|
|
|
- if (users == null)
|
|
|
- planPushStatistics.setTotalUserCount(0);
|
|
|
- else
|
|
|
- planPushStatistics.setTotalUserCount(users.size());
|
|
|
- if (totalPrice == null)
|
|
|
- planPushStatistics.setTotalPrice(Float.valueOf(0));
|
|
|
- else
|
|
|
- planPushStatistics.setTotalPrice(totalPrice);
|
|
|
+ planPushStatistics.setTotalUserCount(users == null ? 0 : users.size());
|
|
|
+ planPushStatistics.setTotalPrice(totalPrice == null ? Float.valueOf(0) : totalPrice);
|
|
|
planPushStatistics.setLasterTime(LocalDateTime.now(ZoneId.of("Asia/Shanghai")));
|
|
|
planPushStatisticsMapper.insert(planPushStatistics);
|
|
|
}
|
|
@@ -509,9 +510,11 @@ public class PlanServiceImpl implements PlanService {
|
|
|
});
|
|
|
if (bo.getAddrCodes() != null){
|
|
|
for (String addrCode : bo.getAddrCodes()){
|
|
|
+ // 拆分地址码
|
|
|
String province = String.valueOf(addrCode.charAt(0))+String.valueOf(addrCode.charAt(1));
|
|
|
String city = String.valueOf(addrCode.charAt(2))+String.valueOf(addrCode.charAt(3));
|
|
|
String district = String.valueOf(addrCode.charAt(4))+String.valueOf(addrCode.charAt(5));
|
|
|
+
|
|
|
if (district.equals("00")){
|
|
|
if (city.equals("00"))
|
|
|
equipmentQueryWrapper.or().likeRight("addr_code",province);
|