|
@@ -1,14 +1,19 @@
|
|
|
package org.jeecg.modules.wzOutboundOrder.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.alibaba.fastjson.TypeReference;
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
+import org.jeecg.common.util.RedisUtil;
|
|
|
+import org.jeecg.modules.Index.util.CacheKey;
|
|
|
import org.jeecg.modules.dataSourceSwitch.annotation.TargetDataSource;
|
|
|
import org.jeecg.modules.dataSourceSwitch.enums.DataSourceType;
|
|
|
import org.jeecg.modules.wzOutboundOrder.entity.CLfCompareDO;
|
|
|
import org.jeecg.modules.wzOutboundOrder.entity.WzOutboundOrderH;
|
|
|
import org.jeecg.modules.wzOutboundOrder.mapper.WzOutboundOrderHMapper;
|
|
|
import org.jeecg.modules.wzOutboundOrder.service.IWzOutboundOrderHService;
|
|
|
+import org.jeecg.modules.wzOutboundOrder.vo.CLFCompareResultVO;
|
|
|
import org.jeecg.modules.wzOutboundOrder.vo.WzOutboundOrderBDetailListVO;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
@@ -20,6 +25,7 @@ import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -39,6 +45,8 @@ public class WzOutboundOrderHServiceImpl extends ServiceImpl<WzOutboundOrderHMap
|
|
|
@Value("${jeecg.path.upload}")
|
|
|
private String upLoadPath;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RedisUtil redisUtil;
|
|
|
/**查询列表*/
|
|
|
public List<WzOutboundOrderH> wzHlist(Wrapper<WzOutboundOrderH> queryWrapper) {
|
|
|
return this.getBaseMapper().selectList(queryWrapper);
|
|
@@ -84,4 +92,25 @@ public class WzOutboundOrderHServiceImpl extends ServiceImpl<WzOutboundOrderHMap
|
|
|
public List<CLfCompareDO> getCLFCompareDoListByTaskNoListHasPcCode(String taskno,Boolean hasPcCode,Double proportion) {
|
|
|
return hMapper.getCLFCompareDoListByTaskNoListHasPcCode(taskno,hasPcCode,proportion);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ModelAndView compareCLFDetailListExportExcel(String tasknos) {
|
|
|
+ String title = "材料费详情比";
|
|
|
+ ArrayList<CLFCompareResultVO> redisResultList = JSONObject.parseObject(JSONObject.toJSONString(redisUtil.get(CacheKey.CLF_COMPARE_RESULT_VOS + ":" + tasknos)), new TypeReference<ArrayList<CLFCompareResultVO>>() {
|
|
|
+ });
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+
|
|
|
+ // Step.3 AutoPoi 导出Excel
|
|
|
+ ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
|
|
+ //此处设置的filename无效 ,前端会重更新设置一下
|
|
|
+ mv.addObject(NormalExcelConstants.FILE_NAME, title);
|
|
|
+ mv.addObject(NormalExcelConstants.CLASS, CLFCompareResultVO.class);
|
|
|
+ //update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
|
|
+ ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
|
|
|
+ exportParams.setImageBasePath(upLoadPath);
|
|
|
+ //update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
|
|
+ mv.addObject(NormalExcelConstants.PARAMS,exportParams);
|
|
|
+ mv.addObject(NormalExcelConstants.DATA_LIST, redisResultList);
|
|
|
+ return mv;
|
|
|
+ }
|
|
|
}
|