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 WEEK_TYPE_ENGLISH = "english";
public static final String WEEK_TYPE_CHINESE = "chinese";
public static final String DATE_PATTERN_MMDD = "MMdd";
/**
* 日期格式化 日期格式为yyyy-MM-dd
* @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.page.PageData;
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.Result;
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.dto.IcFollowUpRecordDTO;
import com.epmet.dto.form.PageFollowUpFormDTO;
import com.epmet.dto.result.NatListResultDTO;
import com.epmet.service.IcFollowUpRecordService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
/**
@ -111,8 +112,9 @@ public class IcFollowUpRecordController {
int pageNo = formDTO.getPageNo();
try {
//导出文件名:张三随访记录0330
String fileName = "随访记录.xlsx";
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), NatListResultDTO.class).build();
String today= DateUtils.format(new Date(),DateUtils.DATE_PATTERN_MMDD);
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();
PageData<IcFollowUpRecordDTO> data = null;
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(IcFollowUpRecordEntity::getOrigin,formDTO.getOrigin())
.eq(IcFollowUpRecordEntity::getCustomerId,formDTO.getCustomerId())
.orderByDesc(IcFollowUpRecordEntity::getCreatedTime);
PageInfo<IcFollowUpRecordDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage())
.orderByDesc(IcFollowUpRecordEntity::getVisitTime);
PageInfo<IcFollowUpRecordEntity> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.isPage())
.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

Loading…
Cancel
Save