Browse Source

随访记录

dev
yinzuomei 3 years ago
parent
commit
647a9b605f
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  2. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java
  3. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -60,7 +60,7 @@ public class DateUtils {
public static final String DATE_PATTERN_YYYY_MM = "yyyy-MM"; public static final String DATE_PATTERN_YYYY_MM = "yyyy-MM";
public static final String WEEK_TYPE_ENGLISH = "english"; public static final String WEEK_TYPE_ENGLISH = "english";
public static final String WEEK_TYPE_CHINESE = "chinese"; public static final String WEEK_TYPE_CHINESE = "chinese";
public static final String DATE_PATTERN_MMDD = "MMdd";
/** /**
* 日期格式化 日期格式为yyyy-MM-dd * 日期格式化 日期格式为yyyy-MM-dd
* @param date 日期 * @param date 日期

8
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcFollowUpRecordController.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.AssertUtils;
@ -17,7 +18,6 @@ import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcFollowUpRecordDTO; import com.epmet.dto.IcFollowUpRecordDTO;
import com.epmet.dto.form.PageFollowUpFormDTO; import com.epmet.dto.form.PageFollowUpFormDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.service.IcFollowUpRecordService; import com.epmet.service.IcFollowUpRecordService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Date;
/** /**
@ -111,8 +112,9 @@ public class IcFollowUpRecordController {
int pageNo = formDTO.getPageNo(); int pageNo = formDTO.getPageNo();
try { try {
//导出文件名:张三随访记录0330 //导出文件名:张三随访记录0330
String fileName = "随访记录.xlsx"; String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), NatListResultDTO.class).build(); String fileName = formDTO.getName().concat("随访记录").concat(today).concat(".xlsx");
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcFollowUpRecordDTO.class).build();
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build(); WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").build();
PageData<IcFollowUpRecordDTO> data = null; PageData<IcFollowUpRecordDTO> data = null;
do { do {

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java

@ -47,10 +47,11 @@ public class IcFollowUpRecordServiceImpl extends BaseServiceImpl<IcFollowUpRecor
.eq(StringUtils.isNotBlank(formDTO.getName()),IcFollowUpRecordEntity::getName,formDTO.getName()) .eq(StringUtils.isNotBlank(formDTO.getName()),IcFollowUpRecordEntity::getName,formDTO.getName())
.eq(IcFollowUpRecordEntity::getOrigin,formDTO.getOrigin()) .eq(IcFollowUpRecordEntity::getOrigin,formDTO.getOrigin())
.eq(IcFollowUpRecordEntity::getCustomerId,formDTO.getCustomerId()) .eq(IcFollowUpRecordEntity::getCustomerId,formDTO.getCustomerId())
.orderByDesc(IcFollowUpRecordEntity::getCreatedTime); .orderByDesc(IcFollowUpRecordEntity::getVisitTime);
PageInfo<IcFollowUpRecordDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage()) PageInfo<IcFollowUpRecordEntity> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage())
.doSelectPageInfo(() -> baseDao.selectList(wrapper)); .doSelectPageInfo(() -> baseDao.selectList(wrapper));
return new PageData(data.getList(),data.getTotal()); List<IcFollowUpRecordDTO> list=ConvertUtils.sourceToTarget(data.getList(),IcFollowUpRecordDTO.class);
return new PageData(list,data.getTotal());
} }
@Override @Override

Loading…
Cancel
Save