|
@@ -13,7 +13,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.commons.beanutils.BeanUtils;
|
|
|
|
|
import org.apache.commons.beanutils.PropertyUtils;
|
|
import org.apache.commons.beanutils.PropertyUtils;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
import org.apache.shiro.SecurityUtils;
|
|
@@ -36,7 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
-
|
|
|
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.text.DateFormat;
|
|
import java.text.DateFormat;
|
|
@@ -58,7 +57,7 @@ import java.util.stream.Stream;
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
public class BusinessReminderCardController extends JeecgController<BusinessReminderCard, BusinessReminderCardService> {
|
|
public class BusinessReminderCardController extends JeecgController<BusinessReminderCard, BusinessReminderCardService> {
|
|
|
@Value("${jeecg.path.upload}")
|
|
@Value("${jeecg.path.upload}")
|
|
|
- private String upLoadPath;
|
|
|
|
|
|
|
+ private static String upLoadPath;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private BusinessReminderCardService businessReminderCardService;
|
|
private BusinessReminderCardService businessReminderCardService;
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -320,35 +319,61 @@ public class BusinessReminderCardController extends JeecgController<BusinessRem
|
|
|
|
|
|
|
|
List<String> numberResults = request.getParameterMap().get("numberResults[]")==null?new ArrayList<>(): new ArrayList<>(Arrays.asList(request.getParameterMap().get("numberResults[]")));
|
|
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!=null && numberResults.size()==1){
|
|
|
if (numberResults.get(0).equals("3")){
|
|
if (numberResults.get(0).equals("3")){
|
|
|
- BeanUtils.copyProperties(exportList, excels);
|
|
|
|
|
|
|
+ copyList(exportList,excels,NameListExcel.class);
|
|
|
for (NameListExcel excel : excels) {
|
|
for (NameListExcel excel : excels) {
|
|
|
excel.setApplicationDate(format);
|
|
excel.setApplicationDate(format);
|
|
|
}
|
|
}
|
|
|
- getModelAndView(excels,"骚扰电话\\诈骗电话管控申请表");
|
|
|
|
|
|
|
+ return getModelAndView(excels,"骚扰电话\\诈骗电话管控申请表",NameListExcel.class);
|
|
|
}
|
|
}
|
|
|
//关停 shutDown
|
|
//关停 shutDown
|
|
|
- if (numberResults.get(0).equals("1")){
|
|
|
|
|
- BeanUtils.copyProperties(exportList, excelList);
|
|
|
|
|
|
|
+ if (numberResults.get(0).equals("2")){
|
|
|
|
|
+ copyList(exportList,excelList,ShowDownExcel.class);
|
|
|
|
|
+ int i =1;
|
|
|
for (ShowDownExcel showDownExcel : excelList) {
|
|
for (ShowDownExcel showDownExcel : excelList) {
|
|
|
- showDownExcel.setIsNow("否");
|
|
|
|
|
- showDownExcel.setLabel("安防停机-不可复开");
|
|
|
|
|
|
|
+ showDownExcel.setIndex(i);
|
|
|
|
|
+ i++;
|
|
|
|
|
+ if (showDownExcel.getStatus().equals("0")){
|
|
|
|
|
+ showDownExcel.setIsNow("否");
|
|
|
|
|
+ showDownExcel.setLabel("安防停机-不可复开");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (showDownExcel.getStatus().equals("1")){
|
|
|
|
|
+ showDownExcel.setIsNow("是");
|
|
|
|
|
+ showDownExcel.setLabel("安防停机-不可复开");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- getModelAndView(excelList,"上报关停号码列表");
|
|
|
|
|
|
|
+ return getModelAndView(excelList,"上报关停号码列表",ShowDownExcel.class);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return getModelAndView(exportList,"入网信息业务");
|
|
|
|
|
|
|
+ return getModelAndView(exportList,"入网信息业务",BusinessReminderCard.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private ModelAndView getModelAndView(Object data,String title){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ public static <S,T> void copyList(Collection<S> sCollection,Collection<T> tCollection,Class<T> tClass) {
|
|
|
|
|
+ if (sCollection == null || tCollection == null || sCollection.size() == 0) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ for (S s : sCollection) {
|
|
|
|
|
+ T t = tClass.newInstance();
|
|
|
|
|
+ BeanUtils.copyProperties(s, t);
|
|
|
|
|
+ tCollection.add(t);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ private static <S,T> ModelAndView getModelAndView(Object data,String title,Class<T> tClass){
|
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
// Step.3 AutoPoi 导出Excel
|
|
// Step.3 AutoPoi 导出Excel
|
|
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
//此处设置的filename无效 ,前端会重更新设置一下
|
|
//此处设置的filename无效 ,前端会重更新设置一下
|
|
|
mv.addObject(NormalExcelConstants.FILE_NAME, "入网信息业务");
|
|
mv.addObject(NormalExcelConstants.FILE_NAME, "入网信息业务");
|
|
|
- mv.addObject(NormalExcelConstants.CLASS, BusinessReminderCard.class);
|
|
|
|
|
|
|
+ mv.addObject(NormalExcelConstants.CLASS, tClass);
|
|
|
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
|
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
|
|
ExportParams exportParams=new ExportParams( title, "导出人:" + sysUser.getRealname(), "入网信息业务");
|
|
ExportParams exportParams=new ExportParams( title, "导出人:" + sysUser.getRealname(), "入网信息业务");
|
|
|
exportParams.setImageBasePath(upLoadPath);
|
|
exportParams.setImageBasePath(upLoadPath);
|