Procházet zdrojové kódy

[招商]adjust

release_toaliyun_real
Burce před 6 roky
rodič
revize
1692f14383
3 změnil soubory, kde provedl 34 přidání a 5 odebrání
  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 Zobrazit soubor

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


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


+ 4
- 0
mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java Zobrazit soubor

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




@Slf4j
@Component @Component
public class InvestSchedule { public class InvestSchedule {


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


private void taskMonthMessage() { private void taskMonthMessage() {


+ 24
- 4
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestBizServiceImpl.java Zobrazit soubor

@@ -8,6 +8,7 @@ import com.iformall.domain.dto.InvestDemandDto;
import com.iformall.domain.dto.InvestTaskDto; import com.iformall.domain.dto.InvestTaskDto;
import com.iformall.domain.po.*; import com.iformall.domain.po.*;
import com.iformall.domain.po.invest.*; import com.iformall.domain.po.invest.*;
import com.iformall.domain.vo.WxShopVo;
import com.iformall.domain.vo.invest.*; import com.iformall.domain.vo.invest.*;
import com.iformall.enums.*; import com.iformall.enums.*;
import com.iformall.service.*; import com.iformall.service.*;
@@ -433,8 +434,12 @@ public class InvestBizServiceImpl implements InvestBizService {
InvestCustomerEntity customerEntity = customerService.getByIdNotNull(id); InvestCustomerEntity customerEntity = customerService.getByIdNotNull(id);
InvestDemandEntity demandEntity = demandService.getByCustomerId(customerEntity.getId()); InvestDemandEntity demandEntity = demandService.getByCustomerId(customerEntity.getId());
WxBrand brand = brandService.getById(customerEntity.getBrandId()); 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); return buildDemindItem(demandEntity, customerEntity, brand, shop, usersMap);
} }


@@ -442,8 +447,24 @@ public class InvestBizServiceImpl implements InvestBizService {
public InvestTaskVo findTaskById(Long id) { public InvestTaskVo findTaskById(Long id) {
InvestTaskEntity taskEntity = taskService.getByIdNotNull(id); InvestTaskEntity taskEntity = taskService.getByIdNotNull(id);
WxShop shop = shopService.getById(taskEntity.getTargetId()); 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); Map<Long, MallUserInfo> usersMap = getMap(this.queryUserList(null), MallUserInfo::getId);
return buildTaskItem(taskEntity, shop, usersMap);
return buildTaskItem(taskEntity, shopVo, usersMap);
} }


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

return remindVo; return remindVo;
} }




Načítá se…
Zrušit
Uložit