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 296b1a0d7..e08fbe68c 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/invest/InvestBaseController.java +++ b/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)); } diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java index 6a2cc4f1f..df6cd49ca 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/InvestSchedule.java +++ b/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() { 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 536e99d2d..2ecda7c80 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 @@ -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 usersMap = getMap(this.queryUserList(null), MallUserInfo::getId); + WxShop shop = null; + Map 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> shopMap = shopService.listMapAsPage(shopMapQuery, 1, 10).getList(); + for (Map 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 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; }