diff --git a/mallinkAdmin/src/main/resources/db/migration/V201910231900__W_INVEST_CREATE.sql b/mallinkAdmin/src/main/resources/db/migration/V201910231900__W_INVEST_CREATE.sql index cb62ca87d..2ad38c8a0 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V201910231900__W_INVEST_CREATE.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V201910231900__W_INVEST_CREATE.sql @@ -56,6 +56,9 @@ CREATE TABLE `invest_remind` ( `minute` BIGINT(6) NOT NULL COMMENT '提醒时间', `begin_date` DATETIME NOT NULL COMMENT '开始时间', `end_date` DATETIME NOT NULL COMMENT '结束时间', + `customer_id` BIGINT(20) NOT NULL DEFAULT '0' COMMENT '客户ID', + `negotiation_type` TINYINT(6) NOT NULL DEFAULT '0' COMMENT '拜访方式:0-拜访;1-来访;2-电话;3-短信、微信或其它', + `status` TINYINT(6) NOT NULL DEFAULT '0' COMMENT '是否提醒:0-未提醒;1-已提醒', `create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', PRIMARY KEY (`id`), diff --git a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java index ca8462c27..c62b0a8aa 100755 --- a/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java @@ -1,10 +1,13 @@ package com.iformall.domain.po.invest; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.iformall.enums.EnumInvestRemindStatus; +import com.iformall.enums.EnumNegotiationType; import lombok.Data; import lombok.EqualsAndHashCode; @@ -57,4 +60,21 @@ public class InvestRemindEntity extends InvestBaseEntity { */ @io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "endDate" ,example = "2018-10-01") private Date endDate; + + /** + * 是否提醒:0-未提醒;1-已提醒 + */ + //@io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "status") + @JsonIgnore + @TableField(value = "`status`") + private EnumInvestRemindStatus status; + + /** + * 提醒用户InvestRemindEntity + */ + @io.swagger.annotations.ApiModelProperty(value = "customerId", name = "customerId") + private Long customerId; + + @io.swagger.annotations.ApiModelProperty(value = "拜访方式:0-拜访;1-来访;2-电话;3-短信、微信或其它", name = "negotiationType") + private EnumNegotiationType negotiationType; } diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestRemindVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestRemindVo.java index 6f0bc8bc0..441243b15 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestRemindVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestRemindVo.java @@ -15,18 +15,10 @@ public class InvestRemindVo extends InvestRemindEntity { @io.swagger.annotations.ApiModelProperty(value = "ownerInfo", name = "ownerInfo") private MallUserInfo ownerInfo; - /** - * 提醒用户InvestRemindEntity - */ - @io.swagger.annotations.ApiModelProperty(value = "customerId", name = "customerId") - private Long customerId; @io.swagger.annotations.ApiModelProperty(value = "customer", name = "customer") private InvestCustomerEntity customer; @io.swagger.annotations.ApiModelProperty(value = "brand", name = "brand") private WxBrand brand; - - @io.swagger.annotations.ApiModelProperty(value = "拜访方式:0-拜访;1-来访;2-电话;3-短信、微信或其它", name = "negotiationType") - private EnumNegotiationType negotiationType; } diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumNegotiationType.java b/mallinkService/src/main/java/com/iformall/enums/EnumNegotiationType.java index 3373848fb..5335e59d5 100644 --- a/mallinkService/src/main/java/com/iformall/enums/EnumNegotiationType.java +++ b/mallinkService/src/main/java/com/iformall/enums/EnumNegotiationType.java @@ -22,8 +22,8 @@ public enum EnumNegotiationType { return null; } - private final Integer code; @EnumValue + private final Integer code; private final String info; EnumNegotiationType(Integer code, String info) { diff --git a/mallinkService/src/main/java/com/iformall/service/invest/InvestRemindService.java b/mallinkService/src/main/java/com/iformall/service/invest/InvestRemindService.java index e25a8ece7..d332c5afb 100755 --- a/mallinkService/src/main/java/com/iformall/service/invest/InvestRemindService.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/InvestRemindService.java @@ -2,8 +2,8 @@ package com.iformall.service.invest; import com.baomidou.mybatisplus.extension.service.IService; import com.iformall.domain.po.invest.InvestRemindEntity; -import com.iformall.domain.vo.invest.InvestPageQuery; -import com.iformall.domain.vo.invest.InvestPageResult; + +import java.util.List; /** * 招商提醒 @@ -17,5 +17,7 @@ public interface InvestRemindService extends IService,Invest //InvestPageResult queryPage(InvestPageQuery params); boolean removeAll() ; + + List findUnRemindList(); } diff --git a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestCustomerServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestCustomerServiceImpl.java index c9f03c884..4a5f15dc8 100755 --- a/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestCustomerServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/invest/impl/InvestCustomerServiceImpl.java @@ -44,6 +44,7 @@ public class InvestCustomerServiceImpl extends InvestBaseServiceImpl findUnRemindList() { + LambdaUpdateWrapper 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))); + } } } diff --git a/mallinkService/src/main/resources/mapper/InvestRemindMapper.xml b/mallinkService/src/main/resources/mapper/InvestRemindMapper.xml index 215503b91..5ed9e9009 100644 --- a/mallinkService/src/main/resources/mapper/InvestRemindMapper.xml +++ b/mallinkService/src/main/resources/mapper/InvestRemindMapper.xml @@ -10,6 +10,9 @@ + + +