|
|
|
@@ -1,13 +1,21 @@ |
|
|
|
package com.iformall.service.invest.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.iformall.domain.po.invest.InvestRemindEntity; |
|
|
|
import com.iformall.domain.vo.invest.InvestUserContext; |
|
|
|
import com.iformall.enums.EnumInvestRemindStatus; |
|
|
|
import com.iformall.enums.EnumNegotiationType; |
|
|
|
import com.iformall.mapper.InvestRemindMapper; |
|
|
|
import com.iformall.service.invest.InvestRemindService; |
|
|
|
import com.iformall.utils.DateUtils; |
|
|
|
import org.apache.commons.collections.MapUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
|
|
@@ -42,10 +50,25 @@ public class InvestRemindServiceImpl extends InvestBaseServiceImpl<InvestRemindM |
|
|
|
return super.remove(wrapper); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<InvestRemindEntity> findUnRemindList() { |
|
|
|
LambdaUpdateWrapper<InvestRemindEntity> wrapper = new LambdaUpdateWrapper<>(); |
|
|
|
wrapper.eq(InvestRemindEntity::getStatus, EnumInvestRemindStatus.UN_REMINDED); |
|
|
|
wrapper.gt(InvestRemindEntity::getBeginDate, DateUtils.formatDateTime(new Date())); |
|
|
|
return this.list(wrapper); |
|
|
|
} |
|
|
|
|
|
|
|
private void checkBeforeSaveOrUpdate(InvestRemindEntity input) { |
|
|
|
input.setOwner(InvestUserContext.getUserId()); |
|
|
|
if (Objects.nonNull(input.getContent())) { |
|
|
|
input.setContent(stringToJson(input.getContent())); |
|
|
|
} |
|
|
|
Map contentMap = JSON.parseObject(input.getContent(), Map.class); |
|
|
|
if (MapUtils.isNotEmpty(contentMap)) { |
|
|
|
Object customerId = contentMap.get(InvestRemindEntity.KEY_CUSTOMER); |
|
|
|
input.setCustomerId(Objects.isNull(customerId) ? null : Long.parseLong((String) customerId)); |
|
|
|
Object negotiationType = contentMap.get(InvestRemindEntity.KEY_NEGOTIATIONTYPE); |
|
|
|
input.setNegotiationType(EnumNegotiationType.getEnum(Integer.valueOf((String) negotiationType))); |
|
|
|
} |
|
|
|
} |
|
|
|
} |