|
|
@@ -13,6 +13,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.beanutils.BeanUtils;
|
|
|
import org.apache.commons.beanutils.PropertyUtils;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
@@ -24,6 +25,8 @@ import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
|
import org.jeecg.modules.smscheck.entity.*;
|
|
|
+import org.jeecg.modules.smscheck.entity.excel.NameListExcel;
|
|
|
+import org.jeecg.modules.smscheck.entity.excel.ShowDownExcel;
|
|
|
import org.jeecg.modules.smscheck.service.*;
|
|
|
import org.jeecg.modules.smscheck.util.HttpClientUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
@@ -38,6 +41,8 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.text.DateFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
@@ -236,7 +241,7 @@ public class BusinessReminderCardController extends JeecgController<BusinessRem
|
|
|
// Step.1 组装查询条件
|
|
|
|
|
|
QueryWrapper<BusinessReminderCard> queryWrapper =getQueryWrapper( request,businessReminderCard);
|
|
|
- LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+
|
|
|
|
|
|
// Step.2 获取导出数据
|
|
|
List<BusinessReminderCard> pageList = businessReminderCardService.list(queryWrapper);
|
|
|
@@ -303,24 +308,57 @@ public class BusinessReminderCardController extends JeecgController<BusinessRem
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ // 设置日期格式
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+
|
|
|
+ // 格式化日期为字符串
|
|
|
+ String format = LocalDate.now().format(formatter);
|
|
|
+ //name list
|
|
|
+ List<NameListExcel> excels =new ArrayList<>();
|
|
|
+ //上报蓝紫 nameList
|
|
|
+ List<ShowDownExcel>excelList =new ArrayList<>();
|
|
|
+
|
|
|
+ List<String> numberResults = request.getParameterMap().get("numberResults[]")==null?new ArrayList<>(): new ArrayList<>(Arrays.asList(request.getParameterMap().get("numberResults[]")));
|
|
|
+
|
|
|
+ if (numberResults!=null && numberResults.size()==1 && (numberResults.get(0).equals("3"))|| numberResults.get(0).equals("1")){
|
|
|
+ if (numberResults.get(0).equals("3")){
|
|
|
+ BeanUtils.copyProperties(exportList, excels);
|
|
|
+ for (NameListExcel excel : excels) {
|
|
|
+ excel.setApplicationDate(format);
|
|
|
+ }
|
|
|
+ getModelAndView(excels,"骚扰电话\\诈骗电话管控申请表");
|
|
|
+ }
|
|
|
+ //关停 shutDown
|
|
|
+ if (numberResults.get(0).equals("1")){
|
|
|
+ BeanUtils.copyProperties(exportList, excelList);
|
|
|
+ for (ShowDownExcel showDownExcel : excelList) {
|
|
|
+ showDownExcel.setIsNow("否");
|
|
|
+ showDownExcel.setLabel("安防停机-不可复开");
|
|
|
+ }
|
|
|
+ getModelAndView(excelList,"上报关停号码列表");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return getModelAndView(exportList,"入网信息业务");
|
|
|
+ }
|
|
|
|
|
|
+ private ModelAndView getModelAndView(Object data,String title){
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
// Step.3 AutoPoi 导出Excel
|
|
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
//此处设置的filename无效 ,前端会重更新设置一下
|
|
|
mv.addObject(NormalExcelConstants.FILE_NAME, "入网信息业务");
|
|
|
mv.addObject(NormalExcelConstants.CLASS, BusinessReminderCard.class);
|
|
|
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
|
|
- ExportParams exportParams=new ExportParams( "入网信息业务报表", "导出人:" + sysUser.getRealname(), "入网信息业务");
|
|
|
+ ExportParams exportParams=new ExportParams( title, "导出人:" + sysUser.getRealname(), "入网信息业务");
|
|
|
exportParams.setImageBasePath(upLoadPath);
|
|
|
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
|
|
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
|
|
|
- mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
|
|
|
- return mv;
|
|
|
+ mv.addObject(NormalExcelConstants.DATA_LIST, data);
|
|
|
+ return mv;
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 通过id查询 入网信息统计数
|
|
|
*
|