Просмотр исходного кода

[招商][预约提醒]更新表结构

release_toaliyun_real
Burce 6 лет назад
Родитель
Сommit
3a0a4e6fd9
8 измененных файлов: 56 добавлений и 12 удалений
  1. +3
    -0
      mallinkAdmin/src/main/resources/db/migration/V201910231900__W_INVEST_CREATE.sql
  2. +21
    -1
      mallinkService/src/main/java/com/iformall/domain/po/invest/InvestRemindEntity.java
  3. +0
    -8
      mallinkService/src/main/java/com/iformall/domain/vo/invest/InvestRemindVo.java
  4. +1
    -1
      mallinkService/src/main/java/com/iformall/enums/EnumNegotiationType.java
  5. +4
    -2
      mallinkService/src/main/java/com/iformall/service/invest/InvestRemindService.java
  6. +1
    -0
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestCustomerServiceImpl.java
  7. +23
    -0
      mallinkService/src/main/java/com/iformall/service/invest/impl/InvestRemindServiceImpl.java
  8. +3
    -0
      mallinkService/src/main/resources/mapper/InvestRemindMapper.xml

+ 3
- 0
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`),


+ 21
- 1
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;
}

+ 0
- 8
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;
}

+ 1
- 1
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) {


+ 4
- 2
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<InvestRemindEntity>,Invest
//InvestPageResult<InvestRemindEntity> queryPage(InvestPageQuery<InvestRemindEntity> params);

boolean removeAll() ;

List<InvestRemindEntity> findUnRemindList();
}


+ 1
- 0
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestCustomerServiceImpl.java Просмотреть файл

@@ -44,6 +44,7 @@ public class InvestCustomerServiceImpl extends InvestBaseServiceImpl<InvestCusto
@TableLog
@Override
public boolean updateById(InvestCustomerEntity entity) {

return super.updateByIdAction(entity, this::checkBeforeSaveOrUpdate);
}



+ 23
- 0
mallinkService/src/main/java/com/iformall/service/invest/impl/InvestRemindServiceImpl.java Просмотреть файл

@@ -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)));
}
}
}

+ 3
- 0
mallinkService/src/main/resources/mapper/InvestRemindMapper.xml Просмотреть файл

@@ -10,6 +10,9 @@
<result property="owner" column="owner"/>
<result property="content" column="content"/>
<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="endDate" column="end_date"/>
<result property="createDate" column="create_date"/>


Загрузка…
Отмена
Сохранить