| @@ -56,6 +56,9 @@ CREATE TABLE `invest_remind` ( | |||||
| `minute` BIGINT(6) NOT NULL COMMENT '提醒时间', | `minute` BIGINT(6) NOT NULL COMMENT '提醒时间', | ||||
| `begin_date` DATETIME NOT NULL COMMENT '开始时间', | `begin_date` DATETIME NOT NULL COMMENT '开始时间', | ||||
| `end_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 '创建时间', | `create_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | ||||
| `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | ||||
| PRIMARY KEY (`id`), | PRIMARY KEY (`id`), | ||||
| @@ -1,10 +1,13 @@ | |||||
| package com.iformall.domain.po.invest; | package com.iformall.domain.po.invest; | ||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import java.util.Date; | 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.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| @@ -57,4 +60,21 @@ public class InvestRemindEntity extends InvestBaseEntity { | |||||
| */ | */ | ||||
| @io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "endDate" ,example = "2018-10-01") | @io.swagger.annotations.ApiModelProperty(value = "结束时间", name = "endDate" ,example = "2018-10-01") | ||||
| private Date endDate; | 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; | |||||
| } | } | ||||
| @@ -15,18 +15,10 @@ public class InvestRemindVo extends InvestRemindEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "ownerInfo", name = "ownerInfo") | @io.swagger.annotations.ApiModelProperty(value = "ownerInfo", name = "ownerInfo") | ||||
| private MallUserInfo ownerInfo; | private MallUserInfo ownerInfo; | ||||
| /** | |||||
| * 提醒用户InvestRemindEntity | |||||
| */ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "customerId", name = "customerId") | |||||
| private Long customerId; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "customer", name = "customer") | @io.swagger.annotations.ApiModelProperty(value = "customer", name = "customer") | ||||
| private InvestCustomerEntity customer; | private InvestCustomerEntity customer; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "brand", name = "brand") | @io.swagger.annotations.ApiModelProperty(value = "brand", name = "brand") | ||||
| private WxBrand brand; | private WxBrand brand; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "拜访方式:0-拜访;1-来访;2-电话;3-短信、微信或其它", name = "negotiationType") | |||||
| private EnumNegotiationType negotiationType; | |||||
| } | } | ||||
| @@ -22,8 +22,8 @@ public enum EnumNegotiationType { | |||||
| return null; | return null; | ||||
| } | } | ||||
| private final Integer code; | |||||
| @EnumValue | @EnumValue | ||||
| private final Integer code; | |||||
| private final String info; | private final String info; | ||||
| EnumNegotiationType(Integer code, String info) { | EnumNegotiationType(Integer code, String info) { | ||||
| @@ -2,8 +2,8 @@ package com.iformall.service.invest; | |||||
| import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
| import com.iformall.domain.po.invest.InvestRemindEntity; | 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<InvestRemindEntity>,Invest | |||||
| //InvestPageResult<InvestRemindEntity> queryPage(InvestPageQuery<InvestRemindEntity> params); | //InvestPageResult<InvestRemindEntity> queryPage(InvestPageQuery<InvestRemindEntity> params); | ||||
| boolean removeAll() ; | boolean removeAll() ; | ||||
| List<InvestRemindEntity> findUnRemindList(); | |||||
| } | } | ||||
| @@ -44,6 +44,7 @@ public class InvestCustomerServiceImpl extends InvestBaseServiceImpl<InvestCusto | |||||
| @TableLog | @TableLog | ||||
| @Override | @Override | ||||
| public boolean updateById(InvestCustomerEntity entity) { | public boolean updateById(InvestCustomerEntity entity) { | ||||
| return super.updateByIdAction(entity, this::checkBeforeSaveOrUpdate); | return super.updateByIdAction(entity, this::checkBeforeSaveOrUpdate); | ||||
| } | } | ||||
| @@ -1,13 +1,21 @@ | |||||
| package com.iformall.service.invest.impl; | package com.iformall.service.invest.impl; | ||||
| import com.alibaba.fastjson.JSON; | |||||
| import com.baomidou.mybatisplus.core.conditions.Wrapper; | import com.baomidou.mybatisplus.core.conditions.Wrapper; | ||||
| import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||||
| import com.iformall.domain.po.invest.InvestRemindEntity; | import com.iformall.domain.po.invest.InvestRemindEntity; | ||||
| import com.iformall.domain.vo.invest.InvestUserContext; | 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.mapper.InvestRemindMapper; | ||||
| import com.iformall.service.invest.InvestRemindService; | import com.iformall.service.invest.InvestRemindService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import org.apache.commons.collections.MapUtils; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import java.util.Objects; | import java.util.Objects; | ||||
| @@ -42,10 +50,25 @@ public class InvestRemindServiceImpl extends InvestBaseServiceImpl<InvestRemindM | |||||
| return super.remove(wrapper); | 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) { | private void checkBeforeSaveOrUpdate(InvestRemindEntity input) { | ||||
| input.setOwner(InvestUserContext.getUserId()); | input.setOwner(InvestUserContext.getUserId()); | ||||
| if (Objects.nonNull(input.getContent())) { | if (Objects.nonNull(input.getContent())) { | ||||
| input.setContent(stringToJson(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))); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -10,6 +10,9 @@ | |||||
| <result property="owner" column="owner"/> | <result property="owner" column="owner"/> | ||||
| <result property="content" column="content"/> | <result property="content" column="content"/> | ||||
| <result property="minute" column="minute"/> | <result property="minute" column="minute"/> | ||||
| <result property="status" column="status"/> | |||||
| <result property="customerId" column="customer_id"/> | |||||
| <result property="negotiationType" column="negotiation_type"/> | |||||
| <result property="beginDate" column="begin_date"/> | <result property="beginDate" column="begin_date"/> | ||||
| <result property="endDate" column="end_date"/> | <result property="endDate" column="end_date"/> | ||||
| <result property="createDate" column="create_date"/> | <result property="createDate" column="create_date"/> | ||||