Просмотр исходного кода

[招商]adjust

release_toaliyun_real
Burce 6 лет назад
Родитель
Сommit
1692f14383
3 измененных файлов: 34 добавлений и 5 удалений
  1. +6
    -1
      mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java
  2. +4
    -0
      mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java
  3. +24
    -4
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java

+ 6
- 1
mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java Просмотреть файл

@@ -9,6 +9,7 @@ import com.iformall.enums.*;
import com.iformall.exception.MallinkException;
import com.iformall.service.invest.InvestHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;

@@ -77,7 +78,11 @@ public class InvestBaseController extends BaseController {
@Override
public void setAsText(String text) {
try {
setValue(InvestHelper.codeOf(clz, text));
if (StringUtils.isNotBlank(text)) {
setValue(null);
} else {
setValue(InvestHelper.codeOf(clz, text));
}
} catch (Exception NumberFormatException) {
setValue(InvestHelper.valueOf(clz, text));
}


+ 4
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java Просмотреть файл

@@ -8,6 +8,7 @@ import com.iformall.domain.vo.invest.InvestCustomerVo;
import com.iformall.enums.*;
import com.iformall.service.invest.*;
import com.iformall.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
@@ -17,6 +18,7 @@ import org.springframework.util.CollectionUtils;
import java.util.*;


@Slf4j
@Component
public class InvestSchedule {

@@ -37,10 +39,12 @@ public class InvestSchedule {
//@Scheduled(cron = "0 0 14 * * ?") // 每天下午两点执行定时任务
@Scheduled(cron = "0 */5 * * * *?") // 测试,每5分钟执行
public void messageSchedule() {
log.info("招商定时任务: 开始");
//一个月内未完成提醒
taskMonthMessage();
//一周内未跟踪提醒
demandWeekMessage();
log.info("招商定时任务: 结束");
}

private void taskMonthMessage() {


+ 24
- 4
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java Просмотреть файл

@@ -8,6 +8,7 @@ import com.iformall.domain.dto.InvestDemandDto;
import com.iformall.domain.dto.InvestTaskDto;
import com.iformall.domain.po.*;
import com.iformall.domain.po.invest.*;
import com.iformall.domain.vo.WxShopVo;
import com.iformall.domain.vo.invest.*;
import com.iformall.enums.*;
import com.iformall.service.*;
@@ -433,8 +434,12 @@ public class InvestBizServiceImpl implements InvestBizService {
InvestCustomerEntity customerEntity = customerService.getByIdNotNull(id);
InvestDemandEntity demandEntity = demandService.getByCustomerId(customerEntity.getId());
WxBrand brand = brandService.getById(customerEntity.getBrandId());
WxShop shop = shopService.getById(demandEntity.getTargetId());
Map<Long, MallUserInfo> usersMap = getMap(this.queryUserList(null), MallUserInfo::getId);
WxShop shop = null;
Map<Long, MallUserInfo> usersMap = null;
if (Objects.nonNull(demandEntity)) {
shop = shopService.getById(demandEntity.getTargetId());
usersMap = getMap(this.queryUserList(null), MallUserInfo::getId);
}
return buildDemindItem(demandEntity, customerEntity, brand, shop, usersMap);
}

@@ -442,8 +447,24 @@ public class InvestBizServiceImpl implements InvestBizService {
public InvestTaskVo findTaskById(Long id) {
InvestTaskEntity taskEntity = taskService.getByIdNotNull(id);
WxShop shop = shopService.getById(taskEntity.getTargetId());
WxShopVo shopVo = null;
if (Objects.nonNull(shop)) {
WxShop shopMapQuery = new WxShop();
shopMapQuery.setIds(Arrays.asList(taskEntity.getTargetId()));
Collection<Map<String, Object>> shopMap = shopService.listMapAsPage(shopMapQuery, 1, 10).getList();
for (Map<String, Object> stringObjectMap : shopMap) {
Long shopId = Long.valueOf(String.valueOf(stringObjectMap.get("id")));
if (Objects.nonNull(shop.getId())) {
shopVo = new WxShopVo();
shopVo.setId(shopId);
shopVo.setFloorName(String.valueOf(stringObjectMap.get("floor")));
shopVo.setBuildingName(String.valueOf(stringObjectMap.get("building")));
BeanUtils.copyProperties(shop, shopVo);
}
}
}
Map<Long, MallUserInfo> usersMap = getMap(this.queryUserList(null), MallUserInfo::getId);
return buildTaskItem(taskEntity, shop, usersMap);
return buildTaskItem(taskEntity, shopVo, usersMap);
}

@Override
@@ -457,7 +478,6 @@ public class InvestBizServiceImpl implements InvestBizService {
remindVo.setBrand(brandService.getById(customerEntity.getBrandId()));
}
remindVo.setOwnerInfo(userInfoService.getById(remindEntity.getOwner()));

return remindVo;
}



Загрузка…
Отмена
Сохранить